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..43590d9ee6 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) : @@ -230,7 +230,7 @@ lemma firstMove_extQuasi_tree (hs : s.IsQuasi) (hT : IsPruned G.tree) : convert hbs using 1 simp only [firstMove, subtreeIncl, ↓reduceDIte] rfl⟩ -@[simp] lemma firstMove_extQuasi_isWinning (hT : IsPruned G.tree) (hs : s.IsQuasi) : +lemma firstMove_extQuasi_isWinning (hT : IsPruned G.tree) (hs : s.IsQuasi) : ((s.firstMove a h).extQuasi hT).1.IsWinning ↔ s.IsWinning := by unfold IsWinning rw [firstMove_extQuasi_tree a h s hs] @@ -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..e215de79d9 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 @@ -72,7 +72,7 @@ namespace BorelDet' variable (T : PTrees) (W : Set (body T.1.2)) {n : ℕ} /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps] def extendToGame : Games where +@[expose, simps] def extendToGame : Games where fst := T.1.1 snd := { fst := { @@ -83,7 +83,7 @@ variable (T : PTrees) (W : Set (body T.1.2)) {n : ℕ} } /-- a slight strengthening of Martin's notion of unravelable games to facilitate Borel induction -/ -def UniversallyUnravelable := +@[expose] def UniversallyUnravelable := ∀ ⦃T'⦄ (f : T' ⟶ T), (extendToGame T' <| (bodyFunctor.map f.toHom)⁻¹' W).IsUnravelable lemma unravelable_complement (h : UniversallyUnravelable T W) : UniversallyUnravelable T Wᶜ := by @@ -116,7 +116,7 @@ structure PartiallyUnravelled (n : ℕ) where sets : ℕ → PSigma (UniversallyUnravelable carrier) unrav : ∀ m < n, IsOpen (sets m).1 /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def PartiallyUnravelled.continue (G : PartiallyUnravelled n) (k : ℕ) : +@[expose] def PartiallyUnravelled.continue (G : PartiallyUnravelled n) (k : ℕ) : Σ' (G' : PartiallyUnravelled (n + 1)) (f : G'.carrier ⟶ G.carrier), Covering.Fixing (k + n) f ∧ ∀ n, (G'.sets n).1 = (bodyFunctor.map f.toHom)⁻¹' (G.sets n).1 := by @@ -143,11 +143,11 @@ def PartiallyUnravelled.continue (G : PartiallyUnravelled n) (k : ℕ) : }, f.toCovering, hf, fun _ ↦ rfl variable (G : PartiallyUnravelled 0) (k : ℕ) /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def unravelNth : ∀ n, PartiallyUnravelled n +@[expose] def unravelNth : ∀ n, PartiallyUnravelled n | 0 => G | n + 1 => ((unravelNth n).continue k).1 /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def unravelFunctor : ℕᵒᵖ ⥤ PTrees := +@[expose] def unravelFunctor : ℕᵒᵖ ⥤ PTrees := natFreeCat.symm ⟨fun n ↦ (unravelNth G k n).carrier, fun n ↦ ((unravelNth G k n).continue k).2.1⟩ lemma unravelFunctor_succ n : diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/BuildLevelwise.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/BuildLevelwise.lean index 7a247495f0..836b2477e7 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 @@ -288,7 +288,7 @@ lemma strategy_body (f : Strategy T p) : y ∈ body f.pre.subtree ↔ y ∈ body exact ⟨hy, fun x hp hx ↦ ExtensionsAt.ext (h x hp hx)⟩ end «Section2» /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def consistent (x : bodySystem.obj T) (S : StrategySystem T p) := +@[expose] def consistent (x : bodySystem.obj T) (S : StrategySystem T p) := ∀ (y : T), (hp : IsPosition y.val p) → (BodySystemObj.ofObj x).contains y.val → (BodySystemObj.ofObj x).contains (S.str y.val.length y hp le_rfl).val' lemma mem_principalOpen_iff_bodySystem_contains {T : Trees} (x : List T.1) (y : body T.2) : diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/Covering.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/Covering.lean index 8f2b227581..1916c5bf13 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] @@ -84,7 +84,7 @@ instance : Category PTreesS where @[ext] lemma LvlStratHom.ext' {T U : PTreesS} {f g : T ⟶ U} (h : f.toFun = g.toFun) : f = g := LvlStratHom.ext h /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def LvlStratHom.system (p : Player) : PTreesS ⥤ Type where +@[expose] def LvlStratHom.system (p : Player) : PTreesS ⥤ Type where obj T := StrategySystem T.tree.1 p map {T U} f := TypeCat.ofHom fun S : StrategySystem T.tree.1 p ↦ ({ str := fun k ↦ f.toFun p k (S.str k), @@ -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 @@ -213,7 +214,7 @@ instance : Category PTrees where rw [CategoryTheory.Functor.map_comp] exact (congrArg (fun w ↦ ((bodyFunctor.map g.toHom) w).val) hybody).trans hy'⟩ /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def PTreeForget : PTrees ⥤ Trees where +@[expose] def PTreeForget : PTrees ⥤ Trees where obj T := T.1 map f := f.toHom @[simp, simp_lengths] lemma id_covering_toHom (T : PTrees) : @@ -230,7 +231,7 @@ lemma comp_covering_str_apply (S T U : PTrees) (f : S ⟶ T) (g : T ⟶ U) A : (h2 : f.str = g.str) : f = g := Covering.ext h1 h2 /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def Fixing k {T U : PTrees} (f : T ⟶ U) := +@[expose] def Fixing k {T U : PTrees} (f : T ⟶ U) := ∃ _ : Tree.Fixing k f.toHom, ∀ p, f.str.toFun p k = ResStrategy.fromMap f.toHom @[simp] lemma fixing_id k T : Fixing k (𝟙 T) := by use (by synthFixing); intros; ext; simp @@ -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 := ⊥ @@ -284,7 +285,7 @@ lemma covering_winning {G' G} (f : Games.GameCovering G' G) {p : Player} hxpre, rfl⟩ /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def Games.IsUnravelable G := ∀ k, ∃ (G' : Games) (f : Games.GameCovering G' G), +@[expose] def Games.IsUnravelable G := ∀ k, ∃ (G' : Games) (f : Games.GameCovering G' G), Fixing k f.toCovering ∧ IsClopen G'.2.1.payoff lemma Games.IsUnravelable.isDetermined {G : Games} (h : G.IsUnravelable) : G.2.1.IsDetermined := diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/CoveringClosedGame.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/CoveringClosedGame.lean index 456c549dcd..120728dd5b 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 @@ -79,7 +79,7 @@ lemma LosingCondition.of_concat {x : List (upA hyp)} {a h} (H : LosingCondition ∃ y : subAt (getTree' hyp x) [a.1], a.2 = pullSub (subAt G.tree (x.map Prod.fst ++ a.1 :: y)) y := (concat.mp H).2 /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def WinningCondition (x : List (upA hyp)) (h : x.length = 2 * k + 2) := +@[expose] def WinningCondition (x : List (upA hyp)) (h : x.length = 2 * k + 2) := body (pullSub (getTree' hyp x) (x.map Prod.fst)) ⊆ G.payoff ∧ ∃ S' : QuasiStrategy (subAt (getTree' hyp (x.take (2 * k + 1))) [x[2 * k + 1].1]) Player.one, getTree' hyp x = S'.1.subtree @@ -103,7 +103,7 @@ lemma WinningCondition.of_concat {x : List (upA hyp)} {a h} (H : WinningConditio = S'.1.subtree := (concat.mp H).2 /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def ValidExt (x : List (upA hyp)) (a : upA hyp) := [a.1] ∈ getTree' hyp x ∧ +@[expose] def ValidExt (x : List (upA hyp)) (a : upA hyp) := [a.1] ∈ getTree' hyp x ∧ if x.length = 2 * k then ∃ S : QuasiStrategy (subAt (getTree' hyp x) [a.1]) Player.one, a.2 = S.1.subtree else if h : x.length = 2 * k + 1 then @@ -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 @@ -234,7 +234,7 @@ end «Section2» variable (hyp) /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def treeHom : gameAsTrees hyp ⟶ oldAsTrees hyp where +@[expose] def treeHom : gameAsTrees hyp ⟶ oldAsTrees hyp where toFun x := ⟨x.val.map Prod.fst, by have h : [] ∈ subAt _ _ := getTree_sub x (getTree_ne_and_pruned x).1 change x.val.map Prod.fst ∈ 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,9 @@ 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 => + change pInvTreeHomMap hyp [] = [] + exact 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 +374,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 +442,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..bf0d61ca97 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 @@ -45,7 +45,9 @@ include hF in lemma transition_fixing {m n} (h : m ≤ n) : · apply transition_fixing_full hF h · omega /-- Auxiliary declaration for the Borel determinacy formalization. -/ -abbrev limConePt : PTrees := ⟨(limCone (F ⋙ PTreeForget)).pt, by +abbrev limConePt + (hF : ∀ k, Fixing (K + k) (F.map (homOfLE k.le_succ).op)) : PTrees := + ⟨(limCone (F ⋙ PTreeForget)).pt, by constructor · apply lim_isPruned · intro n 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..1dcdf2dbd0 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) @@ -59,7 +59,7 @@ variable (hp : IsPosition H.x.val Player.one) (H.extensionMap hp R).val' (A := no_index _).take (α := no_index _) n = H.x.val.take n := ExtensionsAt.val'_take_of_le _ h /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps] def extensionLift : Lift hyp where +@[expose, simps] def extensionLift : Lift hyp where x := (H.extensionMap hp R).valT' R := H.R hlvl := by @@ -92,7 +92,7 @@ variable (hp : IsPosition H.x.val Player.one) conv => simp attribute [local implicit_reducible] upA oldAsTrees gameAsTrees in /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps! toLift] def extensionLift' : Lift' hyp where +@[expose, simps! toLift] def extensionLift' : Lift' hyp where toLift := H.extensionLift hp R con := by let a : upA hyp := (H.extension hp R).val @@ -193,12 +193,12 @@ 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) /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps! toPreLift liftTree] def toLift := H.extend H.S +@[expose, simps! toPreLift liftTree] def toLift := H.extend H.S attribute [simp_lengths] toLift_toPreLift lemma toLift_mono {H H' : LLift hyp} (h : H.toPreLift ≤ H'.toPreLift) : H.toLift.liftTree = H'.toLift.liftTree := by @@ -301,7 +301,7 @@ lemma concat_mem_tree {y a} (hp : IsPosition y Player.zero) ((H.x.val[2 * k], H.S.fst.subtree) : upA hyp)).symm ▸ hz end LLift /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def Losable (H : PreLift hyp) := ∃ h : H.Losable', (LLift.mk _ h).toLift.Con +@[expose] def Losable (H : PreLift hyp) := ∃ h : H.Losable', (LLift.mk _ h).toLift.Con lemma Losable.losable_of_le {H H' : PreLift hyp} (hL : H'.Losable) (h : H ≤ H') : H.Losable := by use hL.1.losable'_of_le h; (conv => rhs; rhs; lhs; rw [← h]) @@ -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 @@ -354,7 +354,7 @@ lemma le_minLength : 2 * k + 1 ≤ H.minLength := by /-- Auxiliary declaration for the Borel determinacy formalization. -/ lemma lt_minLength : 2 * k < H.minLength := H.le_minLength /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps!] def takeMin := H.take H.minLength H.lt_minLength +@[expose, simps!] def takeMin := H.take H.minLength H.lt_minLength @[simp] lemma takeMin_wonPos : H.takeMin.WonPos = H.WonPos := by simp [takeMin] lemma min_prefix : H.takeMin.Won := by classical @@ -371,11 +371,11 @@ lemma u_nil : H.u.val ≠ [] := H.u.prop.choose_spec.2.1.1 pullSub (subAt G.tree (H.x.val.take (2 * k + 1) ++ H.u.val)) H.u.val.tail := H.u.prop.choose_spec.2.2 /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps! toPreLift liftTree] def toLift := H.extend H.S +@[expose, simps! toPreLift liftTree] def toLift := H.extend H.S lemma u_zero : H.u.val[0]'(by simpa [List.length_pos_iff] using H.u_nil) = H.toLift.liftShort.val[2 * k + 1].1 := H.u.prop.choose_spec.2.1.2 /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps! toLift] def toLift' : Lift' hyp where +@[expose, simps! toLift] def toLift' : Lift' hyp where toLift := H.toLift con := by simp_rw [Lift.Con]; erw [WLift.getTree_liftShort] @@ -472,7 +472,7 @@ lemma toLift_mono {H H' : WLift hyp} (h : H.toPreLift ≤ H'.toPreLift) : simp end WLift /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps! toLift] def Won.lift' {H : PreLift hyp} (h : H.Won) := (WLift.mk _ h).toLift' +@[expose, simps! toLift] def Won.lift' {H : PreLift hyp} (h : H.Won) := (WLift.mk _ h).toLift' attribute [simp_lengths] Won.lift'_toLift namespace Winnable @@ -480,18 +480,18 @@ 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 +@[expose] def extension : ExtensionsAt H.x where val := (h.a hp).val property := by have h' := (h.a hp).prop; conv at h' => simp [game] @@ -500,7 +500,7 @@ def extension : ExtensionsAt H.x where end Winnable /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def extension (H : PreLift hyp) (hp : IsPosition H.x.val Player.one) +@[expose] def extension (H : PreLift hyp) (hp : IsPosition H.x.val Player.one) (R : ResStrategy (gameAsTrees hyp) Player.one H.x.val.length) : ExtensionsAt H.x := by classical exact diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/One/PreLift.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/One/PreLift.lean index 8b07bcf8bb..47f5893816 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 @@ -69,7 +69,7 @@ lemma gameTree_eq : · simp /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps] def take (n : ℕ) (h : 2 * k < n) : PreLift hyp where +@[expose, simps] def take (n : ℕ) (h : 2 * k < n) : PreLift hyp where x := Tree.take n H.x hlvl := by simp [h] R := H.R @@ -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,13 +241,13 @@ 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 /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps toPreLift liftTree] def take (n : ℕ) (h : 2 * k + 1 ≤ n) : Lift hyp where +@[expose, simps toPreLift liftTree] def take (n : ℕ) (h : 2 * k + 1 ≤ n) : Lift hyp where toPreLift := H.toPreLift.take n (by omega) liftTree := H.liftTree htree := by @@ -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'⟩ @@ -386,7 +386,7 @@ attribute [local implicit_reducible] upA oldAsTrees gameAsTrees in exact hget' /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps toLift] def take (n : ℕ) (h : 2 * k + 1 ≤ n) : Lift' hyp where +@[expose, simps toLift] def take (n : ℕ) (h : 2 * k + 1 ≤ n) : Lift' hyp where toLift := H.toLift.take n (by omega) con := H.con.take _ _ attribute [simp_lengths] take_toLift @@ -399,7 +399,7 @@ lemma take_of_length_le {h} (h' : H.x.val.length ≤ n) : H.take n h = H := by attribute [local implicit_reducible] upA oldAsTrees gameAsTrees in /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps] def lift : gameTree hyp where +@[expose, simps] def lift : gameTree hyp where val := H.liftVal property := by let ⟨n, hn⟩ := le_iff_exists_add.mp (Nat.add_one_le_iff.mpr H.hlvl) @@ -451,16 +451,16 @@ end Lift' namespace PreLift variable (H : PreLift hyp) /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps toPreLift liftTree] def extend --weird simps! error message +@[expose, simps toPreLift liftTree] def extend --weird simps! error message (S : QuasiStrategy (subAt G.tree (H.x.val.take (2 * k + 1))) Player.one) : Lift hyp where toPreLift := H liftTree := S.1.subtree 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 +@[expose, simps -isSimp] def game : Game A where tree := subAt G.tree (H.x.val.take (2 * k + 1)) payoff := Subtype.val ⁻¹' ⋃ u ∈ H.WonPos, principalOpen u lemma game_open : IsOpen H.game.payoff := IsOpen.preimage @@ -478,11 +478,11 @@ 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)) +@[expose] def Losable' := ¬ WinningPrefix H.game Player.zero (H.x.val.drop (2 * k + 1)) end PreLift end «Section1» diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/One/Strat.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/One/Strat.lean index eee1dbf127..fdca96b400 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 @@ -38,7 +38,7 @@ def stratMap (lvl : ℕ) (R : ResStrategy (gameAsTrees hyp) Player.one lvl) : R.res ((Nat.succ_le_of_lt (Nat.lt_of_not_ge hxlen)).trans hlen)⟩ pL.extension hp (R.res hlen) /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def stratMap' (R : Strategy (gameTree hyp) Player.one) : Strategy G.tree Player.one := +@[expose] def stratMap' (R : Strategy (gameTree hyp) Player.one) : Strategy G.tree Player.one := fun x hp ↦ stratMap x.val.length ((strategyEquivSystem R).str _) x hp le_rfl attribute [local implicit_reducible] upA oldAsTrees gameAsTrees in lemma stratMap'_short R x hp (hx : x.val.length ≤ 2 * k) : @@ -70,11 +70,11 @@ attribute [simp] TreeLift.hlvl lemma hlvl_le : 2 * k + 1 ≤ H.x.val.length (α := no_index _) := by linarith [H.hlvl] @[simp] lemma hlvl' : 2 * k ≤ H.x.val.length (α := no_index _) := by linarith [H.hlvl] /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps!] def preLift : PreLift hyp := ⟨subtreeIncl _ H.x, +@[expose, simps!] def preLift : PreLift hyp := ⟨subtreeIncl _ H.x, H.hlvl, (strategyEquivSystem H.R).str (2 * k + 1)⟩ attribute [simp_lengths] preLift_x_coe /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps] def take (n : ℕ) (hk : 2 * k < n) : TreeLift hyp where +@[expose, simps] def take (n : ℕ) (hk : 2 * k < n) : TreeLift hyp where R := H.R x := Tree.take n H.x hlvl := by simp [hk] @@ -104,7 +104,7 @@ lemma stratMap'_extend : stratMap' H.R (subtreeIncl _ H.x) = H.extension := by omega · rfl /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps! -isSimp] def dropLast (h : 2 * k + 2 ≤ H.x.val.length) := +@[expose, simps! -isSimp] def dropLast (h : 2 * k + 2 ≤ H.x.val.length) := H.take (H.x.val.length - 1) (by omega) @[simp, simp_lengths] lemma dropLast_x {h} : (H.dropLast h).x = Tree.take (H.x.val.length - 1) H.x := rfl @@ -661,7 +661,7 @@ end TreeLift variable {R : Strategy (gameAsTrees hyp).2 Player.one} (y : body (stratMap' R).pre.subtree) /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps] def bodyTake (n : ℕ) : TreeLift hyp where +@[expose, simps] def bodyTake (n : ℕ) : TreeLift hyp where R := R x := body.take (2 * k + 1 + n) y hlvl := by synthIsPosition @@ -711,9 +711,11 @@ lemma won_of_winnable n (h : (bodyTake y n).preLift.Winnable) : (((Stream'.take_prefix _ _ _).mpr (by as_aux_lemma => synthIsPosition)).drop _) (by simp) rfl simp_rw [add_assoc] at this ⊢; convert (hsub ▸ this) using 4 - exact (WinningPrefix.prefix_num _ - (((Stream'.take_prefix _ _ _).mpr (by as_aux_lemma => synthIsPosition)).drop _) - (by simp) rfl).symm + · simp only [Game.residual_tree] + · rfl + · exact (WinningPrefix.prefix_num _ + (((Stream'.take_prefix _ _ _).mpr (by as_aux_lemma => synthIsPosition)).drop _) + rfl rfl).symm have hw := h.strat_winning hb simp only [Set.mem_image, Subtype.exists, exists_and_right, exists_eq_right] at hw replace hw := hw.2 diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/WinAsap.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/WinAsap.lean index 703aaa5fc9..498468442b 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 @@ -317,13 +317,30 @@ lemma winAsap_body (x : body (winAsap G p).subtree) ⟨x.val, body_mono (subtree_sub _) x.prop⟩ ∈ p.payoff G := by obtain ⟨N, h⟩ := h; have hN : h.num ≤ N := by simpa using h.num_le_length 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] + obtain ⟨w, hW, hw⟩ := h.strat_winning this + have htake : (x.val.take N).take h.num = x.val.take h.num := by + simp [hN] + let w' : body (subAt G.tree (x.val.take h.num)) := + ⟨w.val, by rw [← htake]; exact w.prop⟩ + have hW' : body.append (x.val.take h.num) w' ∈ p.payoff G := by + have hpay : (p.residual ((x.val.take N).take h.num)).payoff + (G.residual ((x.val.take N).take h.num)) = + (body.append ((x.val.take N).take h.num))⁻¹' p.payoff G := by simp_all + have hWold : body.append ((x.val.take N).take h.num) w ∈ p.payoff G := by + rw [hpay] at hW + exact hW + have happend : body.append ((x.val.take N).take h.num) w = + body.append (x.val.take h.num) w' := by + apply Subtype.ext + change (x.val.take N).take h.num ++ₛ w.val = x.val.take h.num ++ₛ w.val + exact congrArg (fun l : List A => l ++ₛ w.val) htake + exact happend ▸ hWold + have heq : body.append (x.val.take h.num) w' = + ⟨x.val, body_mono (subtree_sub _) x.prop⟩ := by + apply Subtype.ext + change x.val.take h.num ++ₛ (w : Stream' A) = x.val + rw [hw, Stream'.append_take_drop] + exact heq ▸ 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..238f7c1eb3 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 @@ -38,7 +38,7 @@ def liftShortWinStrat : QuasiStrategy (subAt H.game.tree [H.liftNode]) Player.one := defensiveQuasi (H.game.residual [H.liftNode]) Player.one (H.game_pruned.sub _) /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps toLift] def toWLift : WLLift hyp where +@[expose, simps toLift] def toWLift : WLLift hyp where toLift := H liftTree := (liftShortWinStrat H).1.subtree attribute [simp_lengths] toWLift_toLift @@ -97,19 +97,17 @@ include hW in lemma liftMedium_mem : H.toWLift.liftMediumVal ∈ T' := by apply subset_trans h conv => simp [PreLift.game_payoff] intro a ha - rcases ha with ⟨a, haPay, rfl⟩ + rcases ha with ⟨b, haPay, heq⟩ have haBody' : (body.append [H.liftNode] a).val ∈ body (subAt G.tree (H.x.val.take (2 * k + 1))) := by simpa only [H.liftShort_val_map] using body_mono H.game_tree_sub (body.append [H.liftNode] a).prop let x : body (subAt G.tree (H.x.val.take (2 * k + 1))) := ⟨(body.append [H.liftNode] a).val, haBody'⟩ + have hb : b = x := Subtype.ext heq + subst b have hxmem : x ∈ body.append (H.x.val.take (2 * k + 1)) ⁻¹' G.payoff := by - rcases haPay with ⟨y, hy, hyval⟩ - have hyx : y = x := by - apply Subtype.ext - exact hyval - exact hyx ▸ of_not_not hy + exact of_not_not haPay use body.append (H.x.val.take (2 * k + 1)) x constructor · exact hxmem @@ -122,7 +120,7 @@ include hW in lemma liftMedium_mem : H.toWLift.liftMediumVal ∈ T' := by simp [x, body.append] attribute [local implicit_reducible] upA oldAsTrees gameAsTrees in /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps toWLLift] def toWLift' : WLLift' hyp where +@[expose, simps toWLLift] def toWLift' : WLLift' hyp where toWLLift := H.toWLift hlift := by let ⟨n, hn⟩ := le_iff_exists_add.mp H.h'lvl_le @@ -229,8 +227,8 @@ lemma losable (h : H.ConLong) : H.Losable := by apply AllWinning.existsWinning _ (H.game_pruned.sub _); have hL := H.lost' conv at hL => simp [Lost', WonPosition, AllWinning] conv => simp [Lost', WonPosition, AllWinning] - have hL' := Set.eq_univ_iff_forall.mp hL - apply Set.eq_univ_iff_forall.mpr + have hL' := Set.eq_empty_iff_forall_notMem.mp hL + apply Set.eq_empty_iff_forall_notMem.mpr rintro ⟨x, hx⟩ hxp conv at hx => simp [Nat.add_mod] conv at hxp => simp [Nat.add_mod, PreLift.game_payoff] @@ -245,6 +243,7 @@ lemma losable (h : H.ConLong) : H.Losable := by body.append (H.x.val.take (2 * k + 1)) w := by apply Subtype.ext change H.x.val ++ₛ x = H.x.val.take (2 * k + 1) ++ₛ w.val + change w.val = _ at hwval rw [hwval] simp [body.append, ← Stream'.append_append_stream, List.take_append_drop] rw [happ] @@ -264,7 +263,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,19 +276,19 @@ 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'» variable {H} variable {h} (hL : (H.take n h).Lost') /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps toLift] def extend' : LLift hyp where +@[expose, simps toLift] def extend' : LLift hyp where toLift := H lost' := by change G.WonPosition H.x.val (Player.one.residual H.x.val) @@ -346,7 +345,7 @@ lemma lLift_liftVal_mono {H H' : Lift hyp} (h : H.Lost') (h' : H ≤ H') : simp_rw (config := {singlePass := true}) [← Lift.eq_take_of_le h'] at h ⊢ change h.mk.toWLLift.liftVal <+: _; rw [← liftVal_extend']; apply List.take_prefix /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def Lost := ∃ (h : Lost' H), h.mk.takeMin.ConLong +@[expose] def Lost := ∃ (h : Lost' H), h.mk.takeMin.ConLong namespace Lost variable (hL : H.Lost) variable {H} @@ -444,7 +443,7 @@ lemma lift_mem n : hL.1.mk.toWLLift.liftMediumVal ++ have := hL.1.mk.le_minLength omega /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps toWLLift] def toLLift' : WLLift' hyp where +@[expose, simps toWLLift] def toLLift' : WLLift' hyp where toWLLift := hL.1.mk.toWLLift hlift := by have h := hL.lift_mem (H.x.val.length - (2 * k + 2)) @@ -467,20 +466,20 @@ 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 +@[expose] def extension : ExtensionsAt H.x where val := (h.a hp).val property := by simpa [subAt, ← List.append_assoc] using H.game_tree_sub (h.a hp).prop /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps] def extensionPreLift : PreLift hyp where +@[expose, simps] def extensionPreLift : PreLift hyp where x := (h.extension hp).valT' R := H.R hlvl := by simp @@ -490,7 +489,7 @@ lemma extensionPreLift_take : @[simp] lemma extensionPreLift_game : (h.extensionPreLift hp).game = H.game := by rw [← h.extensionPreLift_take hp]; simp /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps! toPreLift] def extensionLift : Lift hyp where +@[expose, simps! toPreLift] def extensionLift : Lift hyp where toPreLift := h.extensionPreLift hp h'lvl := by simp conShort := by @@ -515,7 +514,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..ab11bd369d 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 : @@ -87,7 +87,7 @@ lemma getTree_fair {y} {a} (hy : y ∈ getTree' hyp H.liftShort.val) simp_rw [hS] at hy ⊢; rwa [S.1.subtree_fair ⟨y, hy⟩ hp] /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps -isSimp] def game : Game A where +@[expose, simps -isSimp] def game : Game A where tree := getTree' hyp H.liftShort.val payoff := Subtype.val ⁻¹' (Subtype.val '' (G.residual (H.x.val.take (2 * k + 1))).payoffᶜ) lemma game_tree_sub : H.game.tree ≤ subAt G.tree (H.liftShort.val.map Prod.fst) := @@ -103,7 +103,7 @@ lemma game_closed : IsClosed H.game.payoff := by simp_all /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps] def take (n : ℕ) (h : 2 * k < n) : PreLift hyp where +@[expose, simps] def take (n : ℕ) (h : 2 * k < n) : PreLift hyp where x := Tree.take n H.x hlvl := by simp [h] R := H.R @@ -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,11 +191,11 @@ 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)) +@[expose] 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' ↦ h (winningPrefix_of_notMem H.game Player.one h') @@ -219,10 +219,10 @@ 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 +@[expose, simps toPreLift] def take (n : ℕ) (h : 2 * k + 2 ≤ n) : Lift hyp where toPreLift := H.toPreLift.take n (by omega) h'lvl := by simpa conShort := by simpa using H.conShort @@ -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] @@ -327,13 +327,13 @@ structure WLLift' extends WLLift hyp where namespace WLLift' variable (H : WLLift' hyp) /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps coe] def lift : gameTree hyp := ⟨H.liftVal, H.hlift⟩ +@[expose, simps coe] def lift : gameTree hyp := ⟨H.liftVal, H.hlift⟩ attribute [simp_lengths] lift_coe 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) @@ -361,7 +361,7 @@ variable (hp : IsPosition H.x.val Player.zero) rw [← H.liftVal_take_medium] simpa [gameAsTrees] using htake /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps] def extensionPreLift : PreLift hyp where +@[expose, simps] def extensionPreLift : PreLift hyp where x := (H.extensionMap hp R).valT' R := H.R hlvl := by @@ -382,7 +382,7 @@ attribute [simp_lengths] extensionPreLift_x rw [← (H.extensionPreLift hp R).game_take (h := by have := H.hlvl; synthIsPosition)] rw [extensionPreLift_take] /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps! toPreLift] def extensionLift : Lift hyp where +@[expose, simps! toPreLift] def extensionLift : Lift hyp where toPreLift := H.extensionPreLift hp R h'lvl := by have hlen := ExtensionsAt.val'_length (H.extensionMap hp R) diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/Zero/Strat.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/Zero/Strat.lean index fb02c03468..c6984cf3c3 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 @@ -35,7 +35,7 @@ noncomputable section «Section1» variable {R : Strategy (gameAsTrees hyp).2 Player.zero} (y : body (stratMap' R).pre.subtree) /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps] def bodyTake (n : ℕ) : TreeLift hyp where +@[expose, simps] def bodyTake (n : ℕ) : TreeLift hyp where R := R x := body.take (2 * k + 2 + n) y hlvl := by simp; omega @@ -49,7 +49,7 @@ variable {R : Strategy (gameAsTrees hyp).2 Player.zero} (y : body (stratMap' R). congr 1 omega /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps!] def takeLift (n : ℕ) := (bodyTake y n).lift (by simp) +@[expose, simps!] def takeLift (n : ℕ) := (bodyTake y n).lift (by simp) attribute [simp_lengths] bodyTake_x takeLift_x_coe @[simp] lemma takeLift_mono : takeLift y m ≤ takeLift y n ↔ m ≤ n := by constructor <;> intro h @@ -164,6 +164,8 @@ lemma body_lost_of_losable n (h : (takeLift y n).Losable) (h' : ∀ m, ¬ (takeL (((Stream'.take_prefix _ _ _).mpr (by as_aux_lemma => synthIsPosition)).drop _) (by as_aux_lemma => change _ = (takeLift y _).game; simp) rfl convert (hsub ▸ this) using 3 + · simp only [Game.residual_tree] + · rfl · symm; apply WinningPrefix.prefix_num _ (((Stream'.take_prefix _ _ _).mpr (by synthIsPosition)).drop _) (by change _ = (takeLift y _).game; simp) rfl diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/Zero/TreeLift.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/Zero/TreeLift.lean index 41a5e86918..11c906ab3b 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 ↦ @@ -56,7 +56,7 @@ noncomputable def stratMap (lvl : ℕ) (R : ResStrategy (gameAsTrees hyp) Player omega) hpL).extension hp (R.res hlen) else Classical.choice (hyp.pruned x) /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def stratMap' (R : Strategy (gameTree hyp) Player.zero) : Strategy G.tree Player.zero := +@[expose] def stratMap' (R : Strategy (gameTree hyp) Player.zero) : Strategy G.tree Player.zero := fun x hp ↦ stratMap x.val.length ((strategyEquivSystem R).str _) x hp le_rfl lemma stratMap'_short R x hp (hx : x.val.length ≤ 2 * k) : stratMap' R x hp = (ResStrategy.fromMap (treeHom hyp)) @@ -84,7 +84,7 @@ attribute [simp] hlvl lemma hlvl_le : 2 * k + 1 ≤ H.x.val.length (α := no_index _) := by linarith [H.hlvl] @[simp] lemma hlvl' : 2 * k ≤ H.x.val.length (α := no_index _) := by linarith [H.hlvl] /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps!] def preLift : PreLift hyp := ⟨subtreeIncl _ H.x, +@[expose, simps!] def preLift : PreLift hyp := ⟨subtreeIncl _ H.x, H.hlvl, (strategyEquivSystem H.R).str (2 * k)⟩ attribute [simp_lengths] preLift_x_coe lemma pInv_fixing (h : n ≤ 2 * k) : @@ -118,7 +118,7 @@ lemma pInv_isPosition_short : simp_all · simp [take_coe] /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps] def take (n : ℕ) (hk : 2 * k < n) : TreeLift hyp where +@[expose, simps] def take (n : ℕ) (hk : 2 * k < n) : TreeLift hyp where R := H.R x := Tree.take n H.x hlvl := by simp [hk] @@ -186,13 +186,13 @@ lemma conShort : H.preLift.ConShort := by exact List.length_take_le (2 * k) H.x.val simp [stratMap', stratMap, ResStrategy.fromMap, harg] /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps toPreLift] def lift (h : 2 * k + 2 ≤ H.x.val.length) : Lift hyp where +@[expose, simps toPreLift] def lift (h : 2 * k + 2 ≤ H.x.val.length) : Lift hyp where toPreLift := H.preLift h'lvl := h conShort := H.conShort attribute [simp_lengths] lift_toPreLift /-- 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) := (H.lift (by have := H.hlvl; synthIsPosition)).extension hp ((strategyEquivSystem H.R).str _) @[congr] lemma extension_val_congr {H H' : TreeLift hyp} (h : H = H') {hp} : (H.extension hp).val = (H'.extension (by subst h; exact hp)).val := by @@ -211,7 +211,8 @@ lemma stratMap'_extend : stratMap' H.R (subtreeIncl _ H.x) = H.extension := by · rfl · cases h' H.conShort /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps!] def dropLast (h : 2 * k + 2 ≤ H.x.val.length) := H.take (H.x.val.length - 1) (by omega) +@[expose, simps!] def dropLast (h : 2 * k + 2 ≤ H.x.val.length) := + H.take (H.x.val.length - 1) (by omega) attribute [simp_lengths] dropLast_x_coe lemma x_mem_tree h (hp : IsPosition H.x.val Player.one) : @@ -396,7 +397,7 @@ lemma x_mem_tree_short h' (h : n ≤ 2 * k) (hp : IsPosition (H.x.val.take n) Pl (H.pInv_fixing h)).val.length := hlen.symm)] /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def WinnableOrLost := ∃ h, (H.lift h).Winnable ∨ (H.lift h).Lost +@[expose] def WinnableOrLost := ∃ h, (H.lift h).Winnable ∨ (H.lift h).Lost variable (hWL : H.WinnableOrLost) /-- Auxiliary declaration for the Borel determinacy formalization. -/ noncomputable def wLLift' : WLLift' hyp := by 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..e2aa96afcb 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 + +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 7340d53252..f10680cb38 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/Internal/AX1/BlockSplit.lean b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/BlockSplit.lean index 47e3cc9e10..f1d833913d 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/BlockSplit.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/BlockSplit.lean @@ -27,7 +27,7 @@ public import Mathlib.Data.Int.Star /-! # BlockSplit -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/BoxAllocationSpec.lean b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/BoxAllocationSpec.lean index 55b5677ef1..1f3b74d4ef 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/BoxAllocationSpec.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/BoxAllocationSpec.lean @@ -49,7 +49,7 @@ public import Mathlib.Tactic.NormNum /-! # CellBoxAllocation -/ -@[expose] public section +public section open Finset @@ -119,7 +119,7 @@ end /-! # BoxAllocationSpec -/ -@[expose] public section +public section open Finset @@ -127,7 +127,7 @@ namespace Nibble.AX1 /-- **The area demanded in the ordered cluster pair `(S, T)`**: every copy through both clusters contributes the product of its two prescribed sizes there. -/ -def boxDemand {ι κ : Type*} [Fintype κ] [DecidableEq ι] +@[expose] def boxDemand {ι κ : Type*} [Fintype κ] [DecidableEq ι] (cl : κ → ZMod 3 → ι) (sz : κ → ZMod 3 → ℕ) (S T : ι) : ℝ := ∑ c : κ, ∑ a : ZMod 3, ∑ b : ZMod 3, if cl c a = S ∧ cl c b = T then (sz c a : ℝ) * (sz c b : ℝ) else 0 @@ -145,7 +145,7 @@ block-cover residual, while the number `P` of cells per cluster is driven to inf and it is what a nibble proof needs: the placement hypergraph has uniformity of order `s₀²`, and the codegree threshold of `Nibble.fracNibbleWeighted_nearPerfect` degrades with the uniformity, so `θ` cannot be chosen before `s₀` is known. -/ -def BoxAllocationResidual : Prop := +@[expose] def BoxAllocationResidual : Prop := ∀ ε : ℝ, 0 < ε → ∀ s₀ : ℕ, ∃ θ : ℝ, 0 < θ ∧ θ ≤ 1 ∧ ∀ P : ℕ, 0 < P → (s₀ : ℝ) ≤ θ * (P : ℝ) → ∀ (ι κ : Type) [Fintype ι] [DecidableEq ι] [Fintype κ] [DecidableEq κ] diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoarseCellCoupled.lean b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoarseCellCoupled.lean index 9dfabc3516..da6aead97e 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoarseCellCoupled.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoarseCellCoupled.lean @@ -56,7 +56,7 @@ public import LeanPool.AsymptoticTrianglePacking.Internal.AX1.CoreGapBlockCover /-! # CoreGapBlockCoverCoupled -/ -@[expose] public section +public section open Finset SimpleGraph Hypergraph Nibble.YusterE @@ -495,7 +495,7 @@ end /-! # CoreGapBlockAlloc -/ -@[expose] public section +public section open Finset SimpleGraph Hypergraph Nibble.YusterE @@ -721,7 +721,7 @@ end /-! # ClusterTripleLP -/ -@[expose] public section +public section open Finset SimpleGraph Hypergraph Nibble.YusterE @@ -1120,7 +1120,7 @@ end /-! # ClusterTripleLPCount -/ -@[expose] public section +public section open Finset SimpleGraph @@ -1292,7 +1292,7 @@ end /-! # CoarseCellBlocks -/ -@[expose] public section +public section open Finset @@ -1424,7 +1424,7 @@ end /-! # CoarseCellAssembly -/ -@[expose] public section +public section open Finset SimpleGraph @@ -1586,7 +1586,7 @@ end /-! # GridTripleDesign -/ -@[expose] public section +public section namespace Nibble.AX1 @@ -1706,7 +1706,7 @@ end /-! # GridTripleDesignRect -/ -@[expose] public section +public section open Finset @@ -1868,7 +1868,7 @@ end /-! # BlockCoverUniformAux -/ -@[expose] public section +public section open Finset SimpleGraph Hypergraph Nibble.YusterE @@ -1971,7 +1971,7 @@ end /-! # CoarseCellCoupled -/ -@[expose] public section +public section open Finset SimpleGraph Hypergraph Nibble.YusterE diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapAX1.lean b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapAX1.lean index 25573961f3..a35501f2c7 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapAX1.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapAX1.lean @@ -67,7 +67,7 @@ public import Mathlib.Analysis.Convex.Cone.InnerDual /-! # YusterNibbleApply -/ -@[expose] public section +public section open LeanPool.AsymptoticTrianglePacking.Internal @@ -124,7 +124,7 @@ end /-! # YusterSubBridge -/ -@[expose] public section +public section open LeanPool.AsymptoticTrianglePacking.Internal @@ -199,7 +199,7 @@ end /-! # Reduction to duality and rounding -/ -@[expose] public section +public section open Finset SimpleGraph Nibble.YusterE @@ -221,7 +221,7 @@ noncomputable def tau3Star : ℝ := /-- **AX1 statement** (PaperIII Layer X, verbatim): the fractional–integral triangle-packing gap is `o(n²)`, uniformly over graphs, read cover-side (`τ₃* − ν₃`). -/ -def AX1Statement : Prop := +@[expose] def AX1Statement : Prop := ∀ ε : ℝ, 0 < ε → ∃ n₀ : ℕ, ∀ (V : Type) [Fintype V] [DecidableEq V] (G : SimpleGraph V) [DecidableRel G.Adj], n₀ ≤ Fintype.card V → @@ -237,7 +237,7 @@ def StrongDualityHyp : Prop := near-regularity discharged for all large graphs): `ν₃* − ν₃ ≤ ε n²` uniformly. -/ -def NibbleGapHyp : Prop := +@[expose] def NibbleGapHyp : Prop := ∀ ε : ℝ, 0 < ε → ∃ n₀ : ℕ, ∀ (V : Type) [Fintype V] [DecidableEq V] (G : SimpleGraph V) [DecidableRel G.Adj], n₀ ≤ Fintype.card V → @@ -268,7 +268,7 @@ end /-! # Finite packing-cover LP duality -/ -@[expose] public section +public section open Finset @@ -987,7 +987,7 @@ end /-! # Strong duality for triangle packing and covering -/ -@[expose] public section +public section open Finset SimpleGraph Nibble.YusterE LPDuality @@ -1490,7 +1490,7 @@ end /-! # YusterGap -/ -@[expose] public section +public section open LeanPool.AsymptoticTrianglePacking.Internal @@ -1529,7 +1529,7 @@ end /-! # YusterAX1 -/ -@[expose] public section +public section open LeanPool.AsymptoticTrianglePacking.Internal @@ -1587,7 +1587,7 @@ end /-! # YusterMost -/ -@[expose] public section +public section open LeanPool.AsymptoticTrianglePacking.Internal @@ -1652,7 +1652,7 @@ end /-! # NibbleGapReduction -/ -@[expose] public section +public section open LeanPool.AsymptoticTrianglePacking.Internal @@ -1888,7 +1888,7 @@ end /-! # TightNibble -/ -@[expose] public section +public section open LeanPool.AsymptoticTrianglePacking.Internal @@ -2100,7 +2100,7 @@ end /-! # YusterSubDegree -/ -@[expose] public section +public section open Finset SimpleGraph Hypergraph @@ -2137,7 +2137,7 @@ end /-! # YusterSubDegreeChar -/ -@[expose] public section +public section open Finset SimpleGraph Hypergraph @@ -2263,7 +2263,7 @@ end /-! # YusterSubRegular -/ -@[expose] public section +public section open Finset SimpleGraph Hypergraph @@ -2301,7 +2301,7 @@ end /-! # DenseNearRegular -/ -@[expose] public section +public section open Finset SimpleGraph Hypergraph @@ -2439,7 +2439,7 @@ end /-! # Tight.DenseRegDischarge -/ -@[expose] public section +public section open Finset Hypergraph @@ -2483,7 +2483,7 @@ end /-! # DenseGapAX1 -/ -@[expose] public section +public section open Finset SimpleGraph Hypergraph Nibble.YusterE @@ -2633,7 +2633,7 @@ end /-! # CoreGapAX1 -/ -@[expose] public section +public section open Finset SimpleGraph Hypergraph Nibble.YusterE @@ -2766,7 +2766,7 @@ theorem gap_le_core_gap (G G' : SimpleGraph V) [DecidableRel G.Adj] [DecidableRe /-! ### The low-degree core -/ /-- `G` with every edge at a vertex of `K` deleted. -/ -def restrictAway (G : SimpleGraph V) (K : Finset V) : SimpleGraph V where +@[expose] def restrictAway (G : SimpleGraph V) (K : Finset V) : SimpleGraph V where Adj x y := G.Adj x y ∧ x ∉ K ∧ y ∉ K symm := ⟨by rintro x y ⟨h1, h2, h3⟩; exact ⟨h1.symm, h3, h2⟩⟩ loopless := ⟨fun x h => G.irrefl h.1⟩ @@ -3136,7 +3136,7 @@ theorem nibbleGap_of_dense_core (ε : ℝ) (hε : 0 < ε) : /-- **The core packing-gap statement at parameters `(ε, δ)`.** The gap `ν₃* − ν₃ ≤ ε|V|²` for large graphs in which every vertex is isolated or has degree at least `δ|V|`, and whose fractional packing number exceeds `ε|V|²` (otherwise the conclusion is immediate from `ν₃ ≥ 0`). -/ -def CoreGapAt (ε δ : ℝ) : Prop := +@[expose] def CoreGapAt (ε δ : ℝ) : Prop := ∃ n₀ : ℕ, ∀ (V : Type) [Fintype V] [DecidableEq V] (G : SimpleGraph V) [DecidableRel G.Adj], n₀ ≤ Fintype.card V → (∀ x : V, G.degree x = 0 ∨ δ * (Fintype.card V : ℝ) ≤ (G.degree x : ℝ)) → @@ -3144,7 +3144,7 @@ def CoreGapAt (ε δ : ℝ) : Prop := nu3star G - (nu3 G : ℝ) ≤ ε * (Fintype.card V : ℝ) ^ 2 /-- **The residual.** The core packing gap at every pair of parameters. -/ -def CoreGapResidual : Prop := ∀ ε : ℝ, 0 < ε → ∀ δ : ℝ, 0 < δ → CoreGapAt ε δ +@[expose] def CoreGapResidual : Prop := ∀ ε : ℝ, 0 < ε → ∀ δ : ℝ, 0 < δ → CoreGapAt ε δ /-- Raising the degree threshold weakens the statement. -/ theorem CoreGapAt.mono_delta {ε δ δ' : ℝ} (h : CoreGapAt ε δ) (hδ : δ ≤ δ') : CoreGapAt ε δ' := by diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapBlockCover.lean b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapBlockCover.lean index c7d0054c67..70855364d6 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapBlockCover.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapBlockCover.lean @@ -42,7 +42,7 @@ public import LeanPool.AsymptoticTrianglePacking.Internal.AX1.TripleEdgesThree /-! # CoreGapBlockCover -/ -@[expose] public section +public section open Finset SimpleGraph Hypergraph Nibble.YusterE diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapBlockShape.lean b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapBlockShape.lean index 46396b9b93..e6dd01920c 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapBlockShape.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapBlockShape.lean @@ -31,7 +31,7 @@ public import LeanPool.AsymptoticTrianglePacking.Internal.AX1.CoreGapRegularCove /-! # CoreGapReducedPair -/ -@[expose] public section +public section open Finset SimpleGraph @@ -102,7 +102,7 @@ end /-! # CoreGapBlockShape -/ -@[expose] public section +public section open Finset SimpleGraph Hypergraph Nibble.YusterE @@ -113,6 +113,7 @@ variable {V : Type} [Fintype V] [DecidableEq V] /-- **One sub-triple of the grid construction**: blocks `A ⊆ U`, `B ⊆ W`, `C ⊆ X` of a good cluster triple, each of relative size at least `α` in its cluster, with sizes proportional to the density of the *opposite* pair at the common scale `τ`. -/ +@[expose] def IsGridSubTriple (G : SimpleGraph V) [DecidableRel G.Adj] (P : Finpartition (univ : Finset V)) (ep de α τ : ℝ) (U W X A B C : Finset V) : Prop := GoodTriple G P ep de U W X ∧ A ⊆ U ∧ B ⊆ W ∧ C ⊆ X ∧ diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapClusterCapacity.lean b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapClusterCapacity.lean index d801d111b9..422d1a3141 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapClusterCapacity.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapClusterCapacity.lean @@ -31,7 +31,7 @@ public import Mathlib.Combinatorics.SimpleGraph.Density /-! # CoreGapClusterCapacity -/ -@[expose] public section +public section open Finset SimpleGraph Hypergraph Nibble.YusterE diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapClusterHost.lean b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapClusterHost.lean index 693475810a..c18f413ed6 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapClusterHost.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapClusterHost.lean @@ -36,7 +36,7 @@ public import Mathlib.Algebra.Order.Ring.Star /-! # CoreGapBlowUp -/ -@[expose] public section +public section open Finset SimpleGraph Hypergraph Nibble.YusterE @@ -716,7 +716,7 @@ end /-! # YusterBridgeFrac -/ -@[expose] public section +public section open Finset SimpleGraph Hypergraph @@ -976,7 +976,7 @@ end /-! # CoreGapPackingSplit -/ -@[expose] public section +public section open Finset SimpleGraph Hypergraph Nibble.YusterE @@ -1118,7 +1118,7 @@ end /-! # CoreGapClusterHost -/ -@[expose] public section +public section open Finset SimpleGraph Hypergraph Nibble.YusterE @@ -1130,6 +1130,7 @@ variable {V : Type} [Fintype V] [DecidableEq V] /-- **The cluster graph** of `G` along `P` at scales `ep`, `de`: the vertices are the parts of `P` and two distinct parts are joined when the pair is `ep`-uniform of density at least `de`. -/ +@[expose] def hostGraph (G : SimpleGraph V) [DecidableRel G.Adj] (P : Finpartition (univ : Finset V)) (ep de : ℝ) : SimpleGraph {S : Finset V // S ∈ P.parts} where Adj S T := (S : Finset V) ≠ (T : Finset V) ∧ G.IsUniform ep (S : Finset V) (T : Finset V) ∧ diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapClusterLP.lean b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapClusterLP.lean index 6e85262f5d..0fd8fb1cbc 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapClusterLP.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapClusterLP.lean @@ -41,7 +41,7 @@ public import LeanPool.AsymptoticTrianglePacking.Internal.AX1.CoreGapBlockCover /-! # CoreGapCoverCapacity -/ -@[expose] public section +public section open Finset SimpleGraph @@ -236,7 +236,7 @@ end /-! # CoreGapClusterLP -/ -@[expose] public section +public section open Finset SimpleGraph Hypergraph Nibble.YusterE diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapDesign.lean b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapDesign.lean index 15618b7b68..0f8b7c112a 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapDesign.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapDesign.lean @@ -31,7 +31,7 @@ public import LeanPool.AsymptoticTrianglePacking.Internal.AX1.CoreGapRegularFami /-! # CoreGapDesign -/ -@[expose] public section +public section open Finset SimpleGraph Hypergraph Nibble.YusterE @@ -41,6 +41,7 @@ variable {V : Type} [Fintype V] [DecidableEq V] /-- The exceptional-edge budget of a sub-triple at uniformity scale `ε₂`: the bound `4ε₂(|A||B| + |A||C| + |B||C|)` of `Nibble.AX1.tripleGraph_near_regular`. -/ +@[expose] noncomputable def designBad (ε₂ : ℝ) (A B C : Finset V) : ℝ := 4 * ε₂ * ((#A : ℝ) * (#B : ℝ) + (#A : ℝ) * (#C : ℝ) + (#B : ℝ) * (#C : ℝ)) @@ -50,6 +51,7 @@ noncomputable def designBad (ε₂ : ℝ) (A B C : Finset V) : ℝ := no probability and no regularity argument, only explicit inequalities about the `k` sub-triples `(A i, B i, C i)`, their common triangle-degree scales `d i` and the lower bounds `Elo i` for their edge counts. -/ +@[expose] def IsSubTripleDesign (G : SimpleGraph V) [DecidableRel G.Adj] (ε μ η d₀ ε₂ μ₂ t : ℝ) (k : ℕ) (A B C : ℕ → Finset V) (d Elo : ℕ → ℝ) : Prop := 0 < ε₂ ∧ ε₂ ≤ 1 ∧ 0 < t ∧ 0 ≤ η ∧ μ₂ ≤ μ ∧ diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapGridLocalResidual.lean b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapGridLocalResidual.lean index 3e62bad0f3..d1d0e3ce52 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapGridLocalResidual.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapGridLocalResidual.lean @@ -48,7 +48,7 @@ public import LeanPool.AsymptoticTrianglePacking.Internal.AX1.CoreGapPrune /-! # CoreGapPruneLocal -/ -@[expose] public section +public section open Finset SimpleGraph @@ -206,7 +206,7 @@ end /-! # CoreGapDesignLocal -/ -@[expose] public section +public section open Finset SimpleGraph Hypergraph Nibble.YusterE @@ -216,11 +216,13 @@ variable {V : Type} [Fintype V] [DecidableEq V] /-- The support size `|A| + |B| + |C|` of a sub-triple: the localised replacement for `|V|` in the exceptional-edge clause of a design. -/ +@[expose] noncomputable def designSupport (A B C : Finset V) : ℝ := (#A : ℝ) + (#B : ℝ) + (#C : ℝ) /-- **A local sub-triple design.** The shape of `Nibble.AX1.IsSubTripleShape` together with the global clauses, the exceptional-edge clause now being charged against the *support* of the sub-triple rather than against the whole vertex set. -/ +@[expose] def IsSubTripleDesignLocal (G : SimpleGraph V) [DecidableRel G.Adj] (ε μ η d₀ ε₂ μ₂ t : ℝ) (k : ℕ) (A B C : ℕ → Finset V) (d Elo : ℕ → ℝ) : Prop := IsSubTripleShape G ε₂ μ₂ k A B C d ∧ @@ -324,7 +326,7 @@ end /-! # CoreGapGridResidual -/ -@[expose] public section +public section open Finset SimpleGraph Hypergraph Nibble.YusterE @@ -379,7 +381,7 @@ end /-! # CoreGapGridLocalResidual -/ -@[expose] public section +public section open Finset SimpleGraph Hypergraph Nibble.YusterE @@ -388,6 +390,7 @@ namespace Nibble.AX1 /-- **The local design form of the reduced residual at parameters `(ε, μ, η, d₀)` and regularity scale `ε₁`**: every triangle-rich regularity-reduced graph carries a sub-triple design in the sense of `Nibble.AX1.IsSubTripleDesignLocal`. -/ +@[expose] def SubTripleDesignLocalAt (ε μ η d₀ ε₁ : ℝ) : Prop := ∃ n₀ : ℕ, ∀ (V : Type) [Fintype V] [DecidableEq V] (G : SimpleGraph V) [DecidableRel G.Adj] (P : Finpartition (univ : Finset V)), @@ -404,6 +407,7 @@ def SubTripleDesignLocalAt (ε μ η d₀ ε₁ : ℝ) : Prop := /-- **The local design residual**: a local sub-triple design at every window of parameters, for some regularity scale `ε₁` as small as one likes. -/ +@[expose] def SubTripleDesignLocalResidual : Prop := ∀ ε : ℝ, 0 < ε → ∀ μ : ℝ, 0 < μ → ∀ η : ℝ, 0 < η → ∀ d₀ : ℝ, 0 < d₀ → ∃ ε₁ : ℝ, 0 < ε₁ ∧ ε₁ ≤ ε ∧ ε₁ ≤ 1 ∧ SubTripleDesignLocalAt ε μ η d₀ ε₁ diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapPackingEdges.lean b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapPackingEdges.lean index 67745d0e18..a1955f269c 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapPackingEdges.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapPackingEdges.lean @@ -26,7 +26,7 @@ public import LeanPool.AsymptoticTrianglePacking.Internal.AX1.YusterEdge /-! # CoreGapPackingEdges -/ -@[expose] public section +public section open Finset SimpleGraph Hypergraph Nibble.YusterE diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapPrune.lean b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapPrune.lean index fefb071706..22a4e69d85 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapPrune.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapPrune.lean @@ -34,7 +34,7 @@ public import LeanPool.AsymptoticTrianglePacking.Internal.AX1.CoreGapTripleDegre /-! # CoreGapPrune -/ -@[expose] public section +public section open Finset SimpleGraph diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapRectPack.lean b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapRectPack.lean index 1da88462dd..d7f8844fa4 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapRectPack.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapRectPack.lean @@ -27,7 +27,7 @@ public import LeanPool.AsymptoticTrianglePacking.Internal.AX1.CoreGapTripleDegre /-! # CoreGapRectPack -/ -@[expose] public section +public section open Finset SimpleGraph @@ -37,7 +37,7 @@ variable {V : Type} [Fintype V] [DecidableEq V] /-- **The vertex-pair rectangle of a sub-triple**: all ordered pairs joining two different parts of `(A, B, C)`. -/ -def tripleRect (A B C : Finset V) : Finset (V × V) := +@[expose] def tripleRect (A B C : Finset V) : Finset (V × V) := ((A ×ˢ B) ∪ (B ×ˢ A)) ∪ ((A ×ˢ C) ∪ (C ×ˢ A)) ∪ ((B ×ˢ C) ∪ (C ×ˢ B)) omit [Fintype V] in diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapRegularCover.lean b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapRegularCover.lean index 935452bee4..1d6ae6fca4 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapRegularCover.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapRegularCover.lean @@ -39,7 +39,7 @@ public import LeanPool.AsymptoticTrianglePacking.Internal.AX1.CoreGapRegularFami /-! # CoreGapRegularCover -/ -@[expose] public section +public section open Finset SimpleGraph Hypergraph Nibble.YusterE @@ -50,6 +50,7 @@ variable {V : Type} [Fintype V] [DecidableEq V] /-! ### The triangle support -/ /-- The spanning subgraph of the edges of `G` that lie in at least one triangle. -/ +@[expose] noncomputable def triangleSupport (G : SimpleGraph V) [DecidableRel G.Adj] : SimpleGraph V := edgeSelect G (fun e => 0 < edgeTriangleDegree G e) @@ -216,6 +217,7 @@ theorem hasNearRegularFamily_of_cover (G : SimpleGraph V) [DecidableRel G.Adj] /-- A **good triple** of clusters: three distinct parts of `P`, pairwise `ep`-uniform in `G` with density at least `de`. These are the triples that can carry a triangle of the reduced graph. -/ +@[expose] def GoodTriple (G : SimpleGraph V) [DecidableRel G.Adj] (P : Finpartition (univ : Finset V)) (ep de : ℝ) (U W X : Finset V) : Prop := U ∈ P.parts ∧ W ∈ P.parts ∧ X ∈ P.parts ∧ U ≠ W ∧ U ≠ X ∧ W ≠ X ∧ diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapRegularFamily.lean b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapRegularFamily.lean index 2b182221c5..e87c548210 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapRegularFamily.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapRegularFamily.lean @@ -35,7 +35,7 @@ public import Mathlib.Combinatorics.SimpleGraph.Triangle.Removal /-! # CoreGapRemoval -/ -@[expose] public section +public section open Finset SimpleGraph Hypergraph Nibble.YusterE @@ -185,7 +185,7 @@ end /-! # WeightedNibble -/ -@[expose] public section +public section open Finset SimpleGraph Hypergraph Nibble.YusterE @@ -413,7 +413,7 @@ end /-! # CoreGapNearComplete -/ -@[expose] public section +public section open Finset SimpleGraph Nibble.YusterE @@ -658,7 +658,7 @@ end /-! # CoreGapRegularDegrees -/ -@[expose] public section +public section open Finset SimpleGraph Hypergraph Nibble.YusterE @@ -667,6 +667,7 @@ namespace Nibble.AX1 variable {V : Type} [Fintype V] [DecidableEq V] /-- The **triangle degree of an edge**: the number of triangles of `G` containing it. -/ +@[expose] def edgeTriangleDegree (G : SimpleGraph V) [DecidableRel G.Adj] (e : Finset V) : ℕ := ((G.cliqueFinset 3).filter (fun t => e ⊆ t)).card @@ -945,7 +946,7 @@ end /-! # CoreGapRegularDecomp -/ -@[expose] public section +public section open Finset SimpleGraph Hypergraph Nibble.YusterE @@ -956,7 +957,7 @@ variable {V : Type} [Fintype V] [DecidableEq V] /-! ### Colour classes of an edge colouring -/ /-- The spanning subgraph of `G` consisting of the edges `e` with `P e`. -/ -def edgeSelect (G : SimpleGraph V) (P : Finset V → Prop) : SimpleGraph V where +@[expose] def edgeSelect (G : SimpleGraph V) (P : Finset V → Prop) : SimpleGraph V where Adj x y := G.Adj x y ∧ P {x, y} symm := ⟨by rintro x y ⟨h1, h2⟩ @@ -976,6 +977,7 @@ theorem edgeSelect_le (G : SimpleGraph V) (P : Finset V → Prop) : edgeSelect G fun _ _ h => h.1 /-- The `i`-th colour class of the edge colouring `col`. -/ +@[expose] noncomputable def colorPart (G : SimpleGraph V) (col : Finset V → ℕ) (i : ℕ) : SimpleGraph V := edgeSelect G (fun e => col e = i) @@ -1141,7 +1143,7 @@ def RegularDecompAt (ε μ η d₀ : ℝ) : Prop := (((colorPart G col i).cliqueFinset 2).card : ℝ) / 3) + ε * (Fintype.card V : ℝ) ^ 2 /-- **The structural residual**: a near-regular decomposition at every window of parameters. -/ -def RegularDecompResidual : Prop := +@[expose] def RegularDecompResidual : Prop := ∀ ε : ℝ, 0 < ε → ∀ μ : ℝ, 0 < μ → ∀ η : ℝ, 0 < η → ∀ d₀ : ℝ, 0 < d₀ → RegularDecompAt ε μ η d₀ @@ -1267,7 +1269,7 @@ end /-! # CoreGapRegularFamily -/ -@[expose] public section +public section open Finset SimpleGraph Hypergraph Nibble.YusterE @@ -1278,6 +1280,7 @@ variable {V : Type} [Fintype V] [DecidableEq V] /-! ### Edge-disjoint families and the colouring they induce -/ /-- The first `k` members of the family `H` are pairwise edge-disjoint. -/ +@[expose] def EdgeDisjointFamily (H : ℕ → SimpleGraph V) (k : ℕ) : Prop := ∀ i < k, ∀ j < k, i ≠ j → ∀ x y, (H i).Adj x y → ¬ (H j).Adj x y @@ -1341,6 +1344,7 @@ open Classical in subgraphs `H 0, …, H (k−1)` of `G`, each with near-regular triangle degrees at its own scale `d i ≥ d₀` (the lower bound being allowed to fail on at most an `η`-fraction of that member's edges), whose total edge count is at least `3ν₃*(G) − 3ε|V|²`. -/ +@[expose] def HasNearRegularFamily (G : SimpleGraph V) [DecidableRel G.Adj] (ε μ η d₀ : ℝ) : Prop := ∃ (k : ℕ) (H : ℕ → SimpleGraph V) (d : ℕ → ℝ), (∀ i < k, H i ≤ G) ∧ @@ -1505,6 +1509,7 @@ triangle removal lemma have been applied: all pairs of parts carrying edges are so the missing mathematics is the Haxell–Rödl splitting of each uniform pair among the cluster triples together with the sparsification making the triangle degrees of each triple concentrate at a common scale. -/ +@[expose] def ReducedFamilyAt (ε μ η d₀ ε₁ : ℝ) : Prop := ∃ n₀ : ℕ, ∀ (V : Type) [Fintype V] [DecidableEq V] (G : SimpleGraph V) [DecidableRel G.Adj] (P : Finpartition (univ : Finset V)), @@ -1520,6 +1525,7 @@ def ReducedFamilyAt (ε μ η d₀ ε₁ : ℝ) : Prop := /-- **The reduced residual**: at every window of parameters, *for some* regularity scale `ε₁` as small as one likes. The scale is existentially quantified — the cleaning loss it causes is paid for out of the accuracy `ε` — so a proof is free to run the regularity lemma as finely as it needs. -/ +@[expose] def ReducedFamilyResidual : Prop := ∀ ε : ℝ, 0 < ε → ∀ μ : ℝ, 0 < μ → ∀ η : ℝ, 0 < η → ∀ d₀ : ℝ, 0 < d₀ → ∃ ε₁ : ℝ, 0 < ε₁ ∧ ε₁ ≤ ε ∧ ε₁ ≤ 1 ∧ ReducedFamilyAt ε μ η d₀ ε₁ diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapTripleDegrees.lean b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapTripleDegrees.lean index 5cc02d080c..dc8bf218af 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapTripleDegrees.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapTripleDegrees.lean @@ -40,7 +40,7 @@ public import Mathlib.Tactic.ContinuousFunctionalCalculus /-! # CoreGapUniformCodegree -/ -@[expose] public section +public section open Finset SimpleGraph @@ -339,7 +339,7 @@ end /-! # CoreGapTripleDegrees -/ -@[expose] public section +public section open Finset SimpleGraph @@ -427,6 +427,7 @@ theorem edgeTriangleDegree_pair (G : SimpleGraph V) [DecidableRel G.Adj] {x y : /-! ### The tripartite graph carried by a triple of parts -/ /-- The (symmetric) predicate "`x` and `y` lie in two different parts of the triple". -/ +@[expose] def crossAdj (U W X : Finset V) (x y : V) : Prop := (x ∈ U ∧ y ∈ W) ∨ (x ∈ W ∧ y ∈ U) ∨ (x ∈ U ∧ y ∈ X) ∨ (x ∈ X ∧ y ∈ U) ∨ (x ∈ W ∧ y ∈ X) ∨ (x ∈ X ∧ y ∈ W) @@ -438,6 +439,7 @@ theorem crossAdj_symm {U W X : Finset V} {x y : V} (h : crossAdj U W X x y) : /-- **The tripartite subgraph carried by a triple of parts**: the edges of `G` joining two different parts of `(U, W, X)`. -/ +@[expose] def tripleGraph (G : SimpleGraph V) (U W X : Finset V) : SimpleGraph V where Adj x y := G.Adj x y ∧ crossAdj U W X x y symm := ⟨by diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapTripleShape.lean b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapTripleShape.lean index 9e54132fd0..eec8f30aef 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapTripleShape.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/CoreGapTripleShape.lean @@ -44,7 +44,7 @@ public import LeanPool.AsymptoticTrianglePacking.Internal.AX1.GridDesign /-! # GridDesignRect -/ -@[expose] public section +public section open Finset SimpleGraph @@ -234,7 +234,7 @@ end /-! # GridScale -/ -@[expose] public section +public section namespace Nibble.AX1 @@ -361,7 +361,7 @@ end /-! # CoreGapSubblock -/ -@[expose] public section +public section open Finset SimpleGraph @@ -430,7 +430,7 @@ end /-! # CoreGapTripleShape -/ -@[expose] public section +public section open Finset SimpleGraph Hypergraph Nibble.YusterE @@ -443,6 +443,7 @@ variable {V : Type} [Fintype V] [DecidableEq V] each sub-triple are disjoint, pairwise `ε₂`-uniform and of density at least `2ε₂`, the three triangle-degree scales of each sub-triple agree with a common `d i` to within `μ₂`, and the tripartite graphs of the family are pairwise edge-disjoint. -/ +@[expose] def IsSubTripleShape (G : SimpleGraph V) [DecidableRel G.Adj] (ε₂ μ₂ : ℝ) (k : ℕ) (A B C : ℕ → Finset V) (d : ℕ → ℝ) : Prop := (∀ i < k, Disjoint (A i) (B i)) ∧ diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/GridDesign.lean b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/GridDesign.lean index 10b44f1d0a..b1f537a91b 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/GridDesign.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/GridDesign.lean @@ -33,7 +33,7 @@ public import LeanPool.AsymptoticTrianglePacking.Internal.Prelude /-! # GridShiftUnique -/ -@[expose] public section +public section open Finset @@ -98,7 +98,7 @@ end /-! # GridDesign -/ -@[expose] public section +public section open Finset SimpleGraph diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/GridLineDesign.lean b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/GridLineDesign.lean index 5cf626a7a3..0567acc426 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/GridLineDesign.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/GridLineDesign.lean @@ -45,7 +45,7 @@ public import Mathlib.Algebra.Lie.OfAssociative /-! # GridLineDesign -/ -@[expose] public section +public section namespace Nibble.AX1 @@ -53,7 +53,7 @@ variable {q : ℕ} /-- **One block sub-triple of the line `(a, b)`**: the blocks `j` of `U`, `j + a` of `W` and `j + b` of `X`. -/ -def lineTriple (a b j : ZMod q) : ZMod q × ZMod q × ZMod q := (j, j + a, j + b) +@[expose] def lineTriple (a b j : ZMod q) : ZMod q × ZMod q × ZMod q := (j, j + a, j + b) @[simp] theorem lineTriple_fst (a b j : ZMod q) : (lineTriple a b j).1 = j := rfl diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/TripleEdgesThree.lean b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/TripleEdgesThree.lean index 0b5ac299f1..344f51a7c7 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/TripleEdgesThree.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/TripleEdgesThree.lean @@ -26,7 +26,7 @@ public import LeanPool.AsymptoticTrianglePacking.Internal.AX1.CoreGapDesign /-! # TripleEdges -/ -@[expose] public section +public section open Finset SimpleGraph @@ -98,7 +98,7 @@ end /-! # TripleEdgesThree -/ -@[expose] public section +public section open Finset SimpleGraph diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/YusterEdge.lean b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/YusterEdge.lean index ed60a76a50..9af4ac5d32 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/YusterEdge.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/YusterEdge.lean @@ -33,7 +33,7 @@ import Mathlib.Tactic.Bound /-! # Edge-based triangle hypergraph -/ -@[expose] public section +public section open Finset SimpleGraph Hypergraph @@ -43,7 +43,7 @@ variable {V : Type*} [Fintype V] [DecidableEq V] (G : SimpleGraph V) [DecidableR /-- The **edge-based triangle hypergraph**: ground set = edges of `G` (as `2`-subsets), hyperedges = the three edges of each triangle. Its matchings are the edge-disjoint triangle packings (`ν₃`). -/ -def triangleHypergraphE : Finset (Finset (Finset V)) := +@[expose] def triangleHypergraphE : Finset (Finset (Finset V)) := (G.cliqueFinset 3).image (fun t => t.powersetCard 2) /-- **The edge-based triangle hypergraph is 3-uniform** (every triangle has exactly three edges). -/ @@ -145,7 +145,7 @@ theorem triangleHypergraphE_degree (e : Finset V) : /-- **Y4 — the integral triangle-packing number `ν₃(G)`**: the maximum size of a matching of the edge-based triangle hypergraph, i.e. the maximum number of edge-disjoint triangles. -/ -noncomputable def nu3 (G : SimpleGraph V) [DecidableRel G.Adj] : ℕ := by +@[expose] noncomputable def nu3 (G : SimpleGraph V) [DecidableRel G.Adj] : ℕ := by classical exact ((triangleHypergraphE G).powerset.filter (fun M => IsMatching (triangleHypergraphE G) M)).sup Finset.card @@ -162,12 +162,12 @@ theorem nu3_ge {M : Finset (Finset (Finset V))} /-- A **fractional triangle packing**: nonnegative weights on the triangle hyperedges with total weight through every edge `≤ 1` (Paper III §2.2). -/ -def IsFracPacking (w : Finset (Finset V) → ℝ) : Prop := +@[expose] def IsFracPacking (w : Finset (Finset V) → ℝ) : Prop := (∀ T, 0 ≤ w T) ∧ (∀ T ∉ triangleHypergraphE G, w T = 0) ∧ ∀ e : Finset V, ∑ T ∈ (triangleHypergraphE G).filter (fun T => e ∈ T), w T ≤ 1 /-- **Y4 — the fractional triangle-packing number `ν₃*(G)`.** -/ -noncomputable def nu3star (G : SimpleGraph V) [DecidableRel G.Adj] : ℝ := +@[expose] noncomputable def nu3star (G : SimpleGraph V) [DecidableRel G.Adj] : ℝ := sSup {x : ℝ | ∃ w, IsFracPacking G w ∧ x = ∑ T ∈ triangleHypergraphE G, w T} /-- The fractional-packing value set is bounded above by `|H|` (each weight is `≤ 1`). -/ diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/YusterEdgeType.lean b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/YusterEdgeType.lean index e018d36901..b6054bce45 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/YusterEdgeType.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/YusterEdgeType.lean @@ -29,7 +29,7 @@ public import Mathlib.Tactic.Bound /-! # YusterEdgeType -/ -@[expose] public section +public section open Finset SimpleGraph Hypergraph @@ -47,7 +47,7 @@ theorem card_EdgeV : Fintype.card (EdgeV G) = (G.cliqueFinset 2).card := /-- The **triangle hypergraph on the edge vertex type**: each triangle contributes the hyperedge of its three edges (its `2`-subsets, lifted to the edge type). -/ -def triangleHypergraphSub : Finset (Finset (EdgeV G)) := +@[expose] def triangleHypergraphSub : Finset (Finset (EdgeV G)) := (G.cliqueFinset 3).image (fun t => (t.powersetCard 2).subtype (· ∈ G.cliqueFinset 2)) /-- Every `2`-subset of a `3`-clique is a `2`-clique (an edge). -/ diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/YusterFracUpper.lean b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/YusterFracUpper.lean index 5c3386b91f..d2669948e5 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/AX1/YusterFracUpper.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/AX1/YusterFracUpper.lean @@ -23,7 +23,7 @@ public import LeanPool.AsymptoticTrianglePacking.Internal.AX1.YusterEdgeType /-! # YusterFracUpper -/ -@[expose] public section +public section open Finset SimpleGraph Hypergraph diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Assemble.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Assemble.lean index eee247d7ce..0c7553cf8e 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Assemble.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Assemble.lean @@ -36,7 +36,7 @@ Definitions come from `LeanPool.AsymptoticTrianglePacking.Internal.Basic` / `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open Finset @@ -98,7 +98,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/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/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 518073414a..9ec5d4de8a 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/CoveredExpectation.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/CoveredExpectation.lean @@ -33,7 +33,7 @@ Definitions come from `LeanPool.AsymptoticTrianglePacking.Internal.Basic`, axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open Finset @@ -82,7 +82,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/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/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/RegularMost.lean b/LeanPool/AsymptoticTrianglePacking/Internal/RegularMost.lean index 38520d68cd..b9e53cc749 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/RegularMost.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/RegularMost.lean @@ -28,7 +28,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 @@ -37,11 +37,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, @@ -78,7 +78,7 @@ Definitions come from `LeanPool.AsymptoticTrianglePacking.Internal.Basic` (`IsUn (`NearlyRegular`, `CodegreeBounded`). -/ -@[expose] public section +public section open Hypergraph @@ -88,7 +88,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) → @@ -117,7 +117,7 @@ that consume this hypothesis. Must be placeholder-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open Finset @@ -127,7 +127,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 @@ -149,7 +149,7 @@ open Hypergraph such that every `r`-uniform hypergraph that is `(1±μ)`-nearly `d`-regular OUTSIDE an `η`-fraction exceptional set, with codegree `≤ μd`, has a matching covering `≥ (1-β)·(|V|/r)`. The nibble absorbs the small exceptional set into the target slack `β`. -/ -def NibbleTheoremMost : Prop := +@[expose] def NibbleTheoremMost : 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 → IsUniform H r → NearlyRegularMost H d μ η → CodegreeBounded H (μ * d) → @@ -160,6 +160,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 → @@ -172,7 +173,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/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/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 00999e64bb..c0eb13709f 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/CoverVariance.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/CoverVariance.lean @@ -44,7 +44,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 @@ -253,7 +253,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 @@ -478,7 +478,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 @@ -752,7 +752,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/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/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/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/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 352f99d42e..940bd2be61 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/SharpRound.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/SharpRound.lean @@ -38,7 +38,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 @@ -242,7 +242,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 @@ -412,7 +412,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 @@ -559,7 +559,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 @@ -740,7 +740,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 @@ -835,7 +835,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 @@ -1146,7 +1146,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 @@ -1176,7 +1176,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 778324481a..8f2aadcac1 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/SharpRoundAssembly.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/SharpRoundAssembly.lean @@ -49,7 +49,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 @@ -508,7 +508,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 @@ -718,7 +718,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 @@ -1161,7 +1161,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 @@ -1731,7 +1731,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 @@ -1900,7 +1900,7 @@ for which (`LeanPool.AsymptoticTrianglePacking.Internal.cube_centred_sq_le`). -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Finset @@ -2056,7 +2056,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 @@ -2430,7 +2430,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/TightRound.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/TightRound.lean index 51497b5389..d3ae4b6062 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/TightRound.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/TightRound.lean @@ -34,7 +34,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 @@ -195,7 +195,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/TightSchedule.lean b/LeanPool/AsymptoticTrianglePacking/Internal/TightSchedule.lean index 667f9715b4..131f43ad96 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/TightSchedule.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/TightSchedule.lean @@ -41,7 +41,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 @@ -151,7 +151,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 @@ -298,7 +298,7 @@ matching. Must be placeholder-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open Finset Hypergraph @@ -522,7 +522,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 → @@ -792,7 +792,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 @@ -830,7 +830,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 ∧ @@ -909,7 +909,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 @@ -1454,7 +1454,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/Internal/WeightedBoundedEdges.lean b/LeanPool/AsymptoticTrianglePacking/Internal/WeightedBoundedEdges.lean index 3c8088b700..a50c8cc1ac 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/WeightedBoundedEdges.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/WeightedBoundedEdges.lean @@ -52,7 +52,7 @@ public import Mathlib.Tactic.ContinuousFunctionalCalculus /-! # Fractional rounding with bounded incidence discrepancy -/ -@[expose] public section +public section open Finset @@ -424,7 +424,7 @@ end /-! # Simultaneous fractional rounding of degrees and codegrees -/ -@[expose] public section +public section open Finset @@ -631,7 +631,7 @@ near-regular hypotheses of `nearRegularNibbleTheorem`. These definitions retain finite-set model of the frozen proof. The rounding theorem itself is not asserted here. -/ -@[expose] public section +public section open Finset @@ -689,7 +689,7 @@ end /-! # Weighted fractional-to-integral nibble bridge -/ -@[expose] public section +public section open Finset Hypergraph LeanPool.AsymptoticTrianglePacking.Internal @@ -889,7 +889,7 @@ end /-! # Three-uniform weighted rounding with total slack -/ -@[expose] public section +public section open Finset Hypergraph @@ -900,7 +900,7 @@ namespace Slack variable {X : Type} [DecidableEq X] /-- The `w`-load of a vertex: the total weight of the edges through it. -/ -def wLoad (K : Finset (Finset X)) (w : Finset X → ℝ) (v : X) : ℝ := +@[expose] def wLoad (K : Finset (Finset X)) (w : Finset X → ℝ) (v : X) : ℝ := ∑ T ∈ K.filter (fun T => v ∈ T), w T /-- The padded vertex type: the real vertices together with `2m` dummies, `m` on each side. -/ @@ -1448,7 +1448,7 @@ end /-! # Uniform weighted rounding with total slack -/ -@[expose] public section +public section open Finset Hypergraph @@ -2075,7 +2075,7 @@ end /-! # Weighted rounding for nonuniform hypergraphs with bounded edge size -/ -@[expose] public section +public section open Finset Hypergraph diff --git a/LeanPool/AsymptoticTrianglePacking/Main.lean b/LeanPool/AsymptoticTrianglePacking/Main.lean index 3910f3489b..bbe2051bd5 100644 --- a/LeanPool/AsymptoticTrianglePacking/Main.lean +++ b/LeanPool/AsymptoticTrianglePacking/Main.lean @@ -21,7 +21,7 @@ public import Mathlib.Tactic.Ring open Finset -@[expose] public section +public section namespace Nibble.AX1.BoxCount @@ -339,7 +339,7 @@ end open Finset -@[expose] public section +public section namespace Nibble.AX1 @@ -575,7 +575,7 @@ end /-! # Box placement hypergraph -/ -@[expose] public section +public section open Finset @@ -612,6 +612,7 @@ theorem mem_placeFam {U : Finset (PlaceVtx ι κ P)} (hU : U ∈ placeFam P idx /-- The contribution of one copy to the demand of the cluster pair `(S, T)`. -/ +@[expose] def boxDemandC (cl : κ → ZMod 3 → ι) (sz : κ → ZMod 3 → ℕ) (c : κ) (S T : ι) : ℝ := ∑ a : ZMod 3, ∑ b : ZMod 3, if cl c a = S ∧ cl c b = T then (sz c a : ℝ) * (sz c b : ℝ) else 0 @@ -1282,7 +1283,7 @@ end /-! # Weighted nibble for box placement -/ -@[expose] public section +public section open Finset @@ -1663,7 +1664,7 @@ end /-! # Unconditional AX1 -/ -@[expose] public section +public section namespace Nibble.AX1 @@ -1693,7 +1694,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 @@ -1714,7 +1715,7 @@ The full development remains internal so that the public API is limited to stabl statements. -/ -@[expose] public section +public section namespace LeanPool.AsymptoticTrianglePacking @@ -1733,7 +1734,7 @@ end Public entry point for the finite, ceiling-carrying near-regular hypergraph nibble theorem. -/ -@[expose] public section +public section namespace LeanPool.AsymptoticTrianglePacking diff --git a/LeanPool/BKARForestFormula/Audit/ForestFormula/Solution.lean b/LeanPool/BKARForestFormula/Audit/ForestFormula/Solution.lean index 17b220e20f..657bd75f09 100644 --- a/LeanPool/BKARForestFormula/Audit/ForestFormula/Solution.lean +++ b/LeanPool/BKARForestFormula/Audit/ForestFormula/Solution.lean @@ -26,7 +26,7 @@ maintain an automated comparison with the upstream challenge. `#print axioms` gives exactly `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section noncomputable section open MeasureTheory diff --git a/LeanPool/BKARForestFormula/Audit/ForestFormula/SolutionBasic.lean b/LeanPool/BKARForestFormula/Audit/ForestFormula/SolutionBasic.lean index e328bd026c..43eba458c2 100644 --- a/LeanPool/BKARForestFormula/Audit/ForestFormula/SolutionBasic.lean +++ b/LeanPool/BKARForestFormula/Audit/ForestFormula/SolutionBasic.lean @@ -41,7 +41,7 @@ that upstream statement is maintained here. `indexEquiv`. -/ -@[expose] public section +public section noncomputable section open MeasureTheory @@ -64,6 +64,7 @@ def Edge.left (e : Edge V) : V := e.val.out.1 def Edge.right (e : Edge V) : V := e.val.out.2 /-- The simple graph carried by a finite edge set. -/ +@[expose] def edgeGraph (S : Finset (Edge V)) : SimpleGraph V := SimpleGraph.fromEdgeSet {x : Sym2 V | ∃ e : Edge V, e ∈ S ∧ e.val = x} @@ -133,6 +134,7 @@ def cubeContribution (J : ForestIndex V) (ρ : (Edge V → ℝ) → ℝ) : ℝ : ∫ u in unitCube J, mixedPartial J ρ (standardInterp J u) /-- BKAR smoothness hypothesis (mirror of `BKARContDiff`). -/ +@[expose] def ContDiffHyp (ρ : (Edge V → ℝ) → ℝ) : Prop := ContDiff ℝ (∞ : WithTop ℕ∞) ρ /-! ## Q1 bridge: mirror graph acyclicity ↔ repository certificate -/ diff --git a/LeanPool/BKARForestFormula/BKAR/CubePartition/Branches.lean b/LeanPool/BKARForestFormula/BKAR/CubePartition/Branches.lean index 606e78a6e3..7d1d598e82 100644 --- a/LeanPool/BKARForestFormula/BKAR/CubePartition/Branches.lean +++ b/LeanPool/BKARForestFormula/BKAR/CubePartition/Branches.lean @@ -17,7 +17,7 @@ bookkeeping to the per-order sector integrals of the BKAR forest interpolation formula (see `BKAR.Formula`). -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/BKARForestFormula/BKAR/CubePartition/CubeIntegral.lean b/LeanPool/BKARForestFormula/BKAR/CubePartition/CubeIntegral.lean index 444736b72b..526b732396 100644 --- a/LeanPool/BKARForestFormula/BKAR/CubePartition/CubeIntegral.lean +++ b/LeanPool/BKARForestFormula/BKAR/CubePartition/CubeIntegral.lean @@ -22,7 +22,7 @@ cube integral of the BKAR forest interpolation formula (see `BKAR.Formula`). -/ -@[expose] public section +public section noncomputable section @@ -36,6 +36,7 @@ variable {V : Type*} [Fintype V] [DecidableEq V] The parameter cube `[0, 1]^{E(F)}` for a forest. Parameters are indexed by the edge subtype `F.EdgeParam`. -/ +@[expose] def unitCube (F : Forest V) : Set (F.EdgeParam → ℝ) := Set.univ.pi fun _ => Set.Icc (0 : ℝ) 1 @@ -49,6 +50,7 @@ The ordered simplex sector inside the unit cube attached to one edge order. For `order = [e₁, ..., eₙ]`, this is the region `1 ≥ u(e₁) ≥ ... ≥ u(eₙ) ≥ 0`, together with the ambient cube bounds. -/ +@[expose] def orderedCubeSimplex (F : Forest V) (order : List (Edge V)) : Set (F.EdgeParam → ℝ) := {u | u ∈ F.unitCube ∧ @@ -277,6 +279,7 @@ theorem unitCube_eq_iUnion_orderedCubeSimplex (F : Forest V) : The usual unordered BKAR cube contribution for one `Forest` representative, using the mixed partial attached to `F.edges.toList`. -/ +@[expose] def cubeContribution (F : Forest V) (ρ : (Edge V → ℝ) → ℝ) : ℝ := ∫ u in F.unitCube, F.mixedPartial ρ (F.standardInterp u) @@ -285,6 +288,7 @@ The set-integral version of one ordered cube sector. The later cube-partition bridge identifies the sum of these sectors with `cubeContribution`; the ordered-simplex bridge identifies each sector with `orderedContribution`. -/ +@[expose] def orderedCubeSectorContribution (F : Forest V) (order : List (Edge V)) (ρ : (Edge V → ℝ) → ℝ) : ℝ := diff --git a/LeanPool/BKARForestFormula/BKAR/CubePartition/MeasurePartition.lean b/LeanPool/BKARForestFormula/BKAR/CubePartition/MeasurePartition.lean index 26e1aedc11..65a82067b5 100644 --- a/LeanPool/BKARForestFormula/BKAR/CubePartition/MeasurePartition.lean +++ b/LeanPool/BKARForestFormula/BKAR/CubePartition/MeasurePartition.lean @@ -19,7 +19,7 @@ integrals of the BKAR forest interpolation formula (see `BKAR.Formula`) into one cube integral. -/ -@[expose] public section +public section noncomputable section @@ -49,6 +49,7 @@ open MeasureTheory variable {V : Type*} [Fintype V] [DecidableEq V] /-- Ordered pairs of distinct forest-edge parameters. -/ +@[expose] def collisionPairs (F : Forest V) : Type _ := {p : F.EdgeParam × F.EdgeParam // p.1 ≠ p.2} diff --git a/LeanPool/BKARForestFormula/BKAR/CubePartition/MeasureSmoothness.lean b/LeanPool/BKARForestFormula/BKAR/CubePartition/MeasureSmoothness.lean index e41b226933..1cc57649e4 100644 --- a/LeanPool/BKARForestFormula/BKAR/CubePartition/MeasureSmoothness.lean +++ b/LeanPool/BKARForestFormula/BKAR/CubePartition/MeasureSmoothness.lean @@ -18,7 +18,7 @@ finite sum of its closed ordered sector contributions, with sector overlaps null by the collision-hyperplane theorem. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/BKARForestFormula/BKAR/CubePartition/Orders.lean b/LeanPool/BKARForestFormula/BKAR/CubePartition/Orders.lean index 02d8597e3f..5f087447b9 100644 --- a/LeanPool/BKARForestFormula/BKAR/CubePartition/Orders.lean +++ b/LeanPool/BKARForestFormula/BKAR/CubePartition/Orders.lean @@ -23,7 +23,7 @@ between order-by-order sector contributions and the order-free contribution of a forest in the BKAR forest interpolation formula (see `BKAR.Formula`). -/ -@[expose] public section +public section noncomputable section @@ -366,6 +366,7 @@ theorem sum_edgeSetOrders_eq_sum_cons_of_nonempty exact sum_edgeSetOrders_filter_ne_nil_eq_sum_cons S φ /-- All linear orderings of the edge set of a forest. -/ +@[expose] def edgeOrders (F : Forest V) : Finset (List (Edge V)) := edgeSetOrders F.edges @@ -430,6 +431,7 @@ Read a list of simplex parameters as edge parameters for a forest, according to a chosen edge order. Missing parameters default to zero; on valid orders and simplex-length parameter lists, this default is never used. -/ +@[expose] def paramsOfOrder (F : Forest V) (order : List (Edge V)) (ts : List ℝ) : F.EdgeParam → ℝ := fun e => ts.getD (order.idxOf e.val) 0 @@ -620,6 +622,7 @@ end OrderedGrowth The ordered-simplex contribution attached to one concrete ordering of a forest edge set. -/ +@[expose] def orderedContribution (F : Forest V) (order : List (Edge V)) (ρ : (Edge V → ℝ) → ℝ) : ℝ := orderedSimplexIntegral order diff --git a/LeanPool/BKARForestFormula/BKAR/CubePartition/Prefixed.lean b/LeanPool/BKARForestFormula/BKAR/CubePartition/Prefixed.lean index f33704efe0..256b983571 100644 --- a/LeanPool/BKARForestFormula/BKAR/CubePartition/Prefixed.lean +++ b/LeanPool/BKARForestFormula/BKAR/CubePartition/Prefixed.lean @@ -16,7 +16,7 @@ the local recursion step behind the BKAR forest interpolation formula (see `BKAR.Formula`) consumes the branch integral. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/BKARForestFormula/BKAR/CubePartition/SimplexSector/Equiv.lean b/LeanPool/BKARForestFormula/BKAR/CubePartition/SimplexSector/Equiv.lean index 065a84c40c..46fe9b9151 100644 --- a/LeanPool/BKARForestFormula/BKAR/CubePartition/SimplexSector/Equiv.lean +++ b/LeanPool/BKARForestFormula/BKAR/CubePartition/SimplexSector/Equiv.lean @@ -18,7 +18,7 @@ equivalence — the change of variables underlying the simplex-sector conversion. -/ -@[expose] public section +public section noncomputable section @@ -207,6 +207,7 @@ The ordered finite simplex in `Fin n` coordinates, including the ambient closed cube bounds. This is the coordinate target for arbitrary canonical orders. -/ +@[expose] def orderedFinSimplex (n : ℕ) : Set (Fin n → ℝ) := {ts | (∀ i, 0 ≤ ts i ∧ ts i ≤ 1) ∧ OrderedSimplexParams 1 (List.ofFn ts)} diff --git a/LeanPool/BKARForestFormula/BKAR/CubePartition/SimplexSector/Finite.lean b/LeanPool/BKARForestFormula/BKAR/CubePartition/SimplexSector/Finite.lean index 11624a09e0..54b197b16d 100644 --- a/LeanPool/BKARForestFormula/BKAR/CubePartition/SimplexSector/Finite.lean +++ b/LeanPool/BKARForestFormula/BKAR/CubePartition/SimplexSector/Finite.lean @@ -19,7 +19,7 @@ smoothness hypothesis every recursive ordered contribution equals the corresponding closed ordered cube-sector contribution. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/BKARForestFormula/BKAR/CubePartition/SimplexSector/Singleton.lean b/LeanPool/BKARForestFormula/BKAR/CubePartition/SimplexSector/Singleton.lean index 27b2ac24d1..7eaf39f587 100644 --- a/LeanPool/BKARForestFormula/BKAR/CubePartition/SimplexSector/Singleton.lean +++ b/LeanPool/BKARForestFormula/BKAR/CubePartition/SimplexSector/Singleton.lean @@ -20,7 +20,7 @@ over `[0, 1]` in the unique cube coordinate, identified through the ordered cube-sector contribution. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/BKARForestFormula/BKAR/CubePartition/Smoothness.lean b/LeanPool/BKARForestFormula/BKAR/CubePartition/Smoothness.lean index 6cf59b1706..70255ff2a7 100644 --- a/LeanPool/BKARForestFormula/BKAR/CubePartition/Smoothness.lean +++ b/LeanPool/BKARForestFormula/BKAR/CubePartition/Smoothness.lean @@ -17,7 +17,7 @@ mixed-partial integrand along the appended coordinate. Analytic input for converting nested simplex integrals into sector set integrals. -/ -@[expose] public section +public section namespace BKAR diff --git a/LeanPool/BKARForestFormula/BKAR/CubePartition/Support/Contribution.lean b/LeanPool/BKARForestFormula/BKAR/CubePartition/Support/Contribution.lean index a2d493844b..4714f538ac 100644 --- a/LeanPool/BKARForestFormula/BKAR/CubePartition/Support/Contribution.lean +++ b/LeanPool/BKARForestFormula/BKAR/CubePartition/Support/Contribution.lean @@ -18,7 +18,7 @@ This is the combinatorial regrouping behind the sum-over-forests form of the BKAR forest interpolation formula (see `BKAR.Formula`). -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/BKARForestFormula/BKAR/CubePartition/Support/Growth.lean b/LeanPool/BKARForestFormula/BKAR/CubePartition/Support/Growth.lean index 2afb546979..ecd52e90aa 100644 --- a/LeanPool/BKARForestFormula/BKAR/CubePartition/Support/Growth.lean +++ b/LeanPool/BKARForestFormula/BKAR/CubePartition/Support/Growth.lean @@ -17,7 +17,7 @@ index the regrouping of branch contributions by support and order in the BKAR forest interpolation formula (see `BKAR.Formula`). -/ -@[expose] public section +public section noncomputable section @@ -126,6 +126,7 @@ theorem growth_orderTail_mem_edgeSetOrderTails_emptyStart The terminal first-edge/tail sector selected by one active-terminal branch from the empty forest. -/ +@[expose] def growthOrderTail (data : ActiveTerminalBranchData (Forest.empty V)) (e : {e // e ∈ (Forest.empty V).activeEdges}) : @@ -156,6 +157,7 @@ theorem growthOrderTail_order rfl /-- The selected terminal edge order of one active-terminal branch. -/ +@[expose] def growthOrder (data : ActiveTerminalBranchData (Forest.empty V)) (e : {e // e ∈ (Forest.empty V).activeEdges}) : List (Edge V) := diff --git a/LeanPool/BKARForestFormula/BKAR/CubePartition/Support/Terminal.lean b/LeanPool/BKARForestFormula/BKAR/CubePartition/Support/Terminal.lean index 180ab96cfc..ec73ae9d4e 100644 --- a/LeanPool/BKARForestFormula/BKAR/CubePartition/Support/Terminal.lean +++ b/LeanPool/BKARForestFormula/BKAR/CubePartition/Support/Terminal.lean @@ -17,7 +17,7 @@ boundary cases closing the support/order recursion of the BKAR forest interpolation formula (see `BKAR.Formula`). -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/BKARForestFormula/BKAR/Differential.lean b/LeanPool/BKARForestFormula/BKAR/Differential.lean index 3a0de01026..fdadd05549 100644 --- a/LeanPool/BKARForestFormula/BKAR/Differential.lean +++ b/LeanPool/BKARForestFormula/BKAR/Differential.lean @@ -18,7 +18,7 @@ the direction data `activeDirection` used by the one-edge expansion step of the BKAR forest interpolation formula (see `BKAR.Formula`). -/ -@[expose] public section +public section namespace BKAR @@ -57,6 +57,7 @@ theorem empty_activeEdges : exact e.left_ne_right (Forest.empty_inSameComponent_iff.mp hcomp) /-- View any edge as an active edge of the empty forest. -/ +@[expose] noncomputable def emptyActiveEdge (e : Edge V) : {e // e ∈ (Forest.empty V).activeEdges} := ⟨e, by @@ -218,6 +219,7 @@ theorem hasDerivAt_interpWithFill (F : Forest V) exact F.hasDerivAt_interpWithFill_apply_of_not_mem_activeEdges u he t /-- Right-hand side of the differential identity. -/ +@[expose] noncomputable def activeEdgePartialSum (F : Forest V) (u : F.EdgeParam → ℝ) (ρ : (Edge V → ℝ) → ℝ) (t : ℝ) : ℝ := Finset.sum F.activeEdges fun e => partialDeriv e ρ (F.interpWithFill u t) diff --git a/LeanPool/BKARForestFormula/BKAR/Forest.lean b/LeanPool/BKARForestFormula/BKAR/Forest.lean index 1fd1ac3ce1..174bb9e5db 100644 --- a/LeanPool/BKARForestFormula/BKAR/Forest.lean +++ b/LeanPool/BKARForestFormula/BKAR/Forest.lean @@ -25,7 +25,7 @@ sets, over which the final forest sum ranges; and the working type extension characterization. -/ -@[expose] public section +public section namespace BKAR @@ -42,6 +42,7 @@ namespace Edge variable {V} [DecidableEq V] /-- The edge with endpoints `i` and `j`. -/ +@[expose] def mk (i j : V) (hij : i ≠ j) : Edge V := ⟨Sym2.mk i j, by intro hdiag @@ -58,6 +59,7 @@ theorem not_isDiag (e : Edge V) : ¬ e.val.IsDiag := e.property /-- `e.Between i j` says that `e` is the unordered pair `{i, j}`. -/ +@[expose] def Between (e : Edge V) (i j : V) : Prop := e.val = Sym2.mk i j @@ -72,10 +74,12 @@ theorem mk_comm (i j : V) (hij : i ≠ j) : exact Sym2.eq_swap /-- A fixed first endpoint of an unordered edge. -/ +@[expose] noncomputable def left (e : Edge V) : V := e.val.out.1 /-- A fixed second endpoint of an unordered edge. -/ +@[expose] noncomputable def right (e : Edge V) : V := e.val.out.2 @@ -131,6 +135,7 @@ inductive IsPath (S : Finset (Edge V)) : IsPath S (e :: γ) i k /-- A graph-level simple path: an edge walk with no repeated edges. -/ +@[expose] def IsSimplePath (S : Finset (Edge V)) (γ : List (Edge V)) (i j : V) : Prop := IsPath S γ i j ∧ γ.Nodup @@ -339,6 +344,7 @@ structure AcyclicEdgeSetData {V : Type*} [Fintype V] [DecidableEq V] ∀ {e : Edge V}, e ∈ S → isSimplePath [e] e.left e.right /-- A custom acyclicity predicate for finite edge sets. -/ +@[expose] def IsAcyclicEdgeSet {V : Type*} [Fintype V] [DecidableEq V] (S : Finset (Edge V)) : Prop := Nonempty (AcyclicEdgeSetData S) @@ -611,6 +617,7 @@ def singletonAcyclicEdgeSetData (e₀ : Edge V) : exact Or.inr ⟨rfl, e₀.between_left_right⟩ /-- The empty forest, with equality as its component relation. -/ +@[expose] def empty (V : Type*) [Fintype V] [DecidableEq V] : Forest V where edges := ∅ acyclic := emptyAcyclicEdgeSetData @@ -631,6 +638,7 @@ theorem isAcyclicEdgeSet (F : Forest V) : IsAcyclicEdgeSet F.edges := ⟨F.acyclic⟩ /-- Forget the path data of a `Forest` representative, retaining only its finite edge-set index. -/ +@[expose] def support (F : Forest V) : ForestIndex V where edges := F.edges acyclic := F.isAcyclicEdgeSet @@ -644,6 +652,7 @@ theorem empty_support : rfl /-- The component relation of a forest. -/ +@[expose] def inSameComponent (F : Forest V) (i j : V) : Prop := F.acyclic.inSameComponent i j @@ -663,6 +672,7 @@ def pathInF (F : Forest V) (i j : V) (h : F.inSameComponent i j) : end Forest /-- Simple paths in a forest, as exposed by its acyclicity certificate. -/ +@[expose] def IsSimplePath {V : Type*} [Fintype V] [DecidableEq V] (F : Forest V) (γ : List (Edge V)) (i j : V) : Prop := F.acyclic.isSimplePath γ i j @@ -801,6 +811,7 @@ namespace ForestIndex variable {V} [Fintype V] [DecidableEq V] /-- The finite forest index consisting of one edge. -/ +@[expose] def singleton (e : Edge V) : ForestIndex V where edges := {e} acyclic := ⟨Forest.singletonAcyclicEdgeSetData e⟩ diff --git a/LeanPool/BKARForestFormula/BKAR/ForestGraph.lean b/LeanPool/BKARForestFormula/BKAR/ForestGraph.lean index 370a4a8a7c..10da696587 100644 --- a/LeanPool/BKARForestFormula/BKAR/ForestGraph.lean +++ b/LeanPool/BKARForestFormula/BKAR/ForestGraph.lean @@ -19,7 +19,7 @@ and stability of acyclicity under adding an edge between distinct components. -/ -@[expose] public section +public section noncomputable section @@ -70,6 +70,7 @@ namespace EdgePath variable {V : Type*} [DecidableEq V] /-- The simple graph whose edge set is the underlying `Sym2` image of `S`. -/ +@[expose] def edgeSetGraph (S : Finset (Edge V)) : SimpleGraph V := SimpleGraph.fromEdgeSet {x : Sym2 V | ∃ e : Edge V, e ∈ S ∧ e.val = x} @@ -426,6 +427,7 @@ theorem acyclic_insert_iff · exact data.isAcyclicEdgeSet_insert_of_not_inSameComponent /-- Upgrade any acyclicity certificate to a `Forest` representative certificate. -/ +@[expose] def toForest {S : Finset (Edge V)} (data : AcyclicEdgeSetData S) : Forest V where edges := S diff --git a/LeanPool/BKARForestFormula/BKAR/Formula.lean b/LeanPool/BKARForestFormula/BKAR/Formula.lean index ed90bda5a6..ab1531c85f 100644 --- a/LeanPool/BKARForestFormula/BKAR/Formula.lean +++ b/LeanPool/BKARForestFormula/BKAR/Formula.lean @@ -38,7 +38,7 @@ needs only `C^{|V|-1}` — a deliberate strengthening of the hypothesis. Lecture Notes in Physics 446, Springer, 1995. arXiv:hep-th/9409094. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/BKARForestFormula/BKAR/Interpolation.lean b/LeanPool/BKARForestFormula/BKAR/Interpolation.lean index a66d028630..36fc8ccaae 100644 --- a/LeanPool/BKARForestFormula/BKAR/Interpolation.lean +++ b/LeanPool/BKARForestFormula/BKAR/Interpolation.lean @@ -22,13 +22,14 @@ inductive proof, and one-edge extensions `EdgeExtension` with their parameter transport. -/ -@[expose] public section +public section namespace BKAR variable {V : Type*} [DecidableEq V] /-- The constant BKAR configuration. -/ +@[expose] def constantConfig (t : ℝ) : Edge V → ℝ := fun _ => t @@ -37,6 +38,7 @@ def zeroConfig : Edge V → ℝ := constantConfig 0 /-- The all-one BKAR configuration. -/ +@[expose] def oneConfig : Edge V → ℝ := constantConfig 1 @@ -66,6 +68,7 @@ theorem emptyParam_unique (u : (Forest.empty V).EdgeParam → ℝ) : exact Finset.notMem_empty e.val he) /-- Look up the value of an edge parameter, with default value `1` off the forest. -/ +@[expose] def paramValue (F : Forest V) (u : F.EdgeParam → ℝ) (e : Edge V) : ℝ := if he : e ∈ F.edges then u ⟨e, he⟩ else 1 @@ -76,12 +79,14 @@ theorem paramValue_of_mem (F : Forest V) (u : F.EdgeParam → ℝ) rw [paramValue, dite_eq_left he] /-- Auxiliary minimum, seeded by the first edge of a nonempty path. -/ +@[expose] def pathMinAux (F : Forest V) (u : F.EdgeParam → ℝ) : ℝ → List (Edge V) → ℝ | a, [] => a | a, e :: γ => F.pathMinAux u (min a (F.paramValue u e)) γ /-- Minimum of forest parameters along a path, with empty path convention `1`. -/ +@[expose] def pathMin (F : Forest V) (u : F.EdgeParam → ℝ) : List (Edge V) → ℝ | [] => 1 | e :: γ => F.pathMinAux u (F.paramValue u e) γ @@ -132,6 +137,7 @@ theorem pathMin_mem_Icc (F : Forest V) (u : F.EdgeParam → ℝ) exact F.pathMinAux_mem_Icc u hu (F.paramValue_mem_Icc u hu e) γ /-- The standard BKAR interpolation point `x^F(u)`. -/ +@[expose] noncomputable def standardInterp (F : Forest V) (u : F.EdgeParam → ℝ) : Edge V → ℝ := fun e => @@ -141,6 +147,7 @@ noncomputable def standardInterp (F : Forest V) (u : F.EdgeParam → ℝ) : 0 /-- The one-parameter family `W^F(u; t)` used in the iterative proof. -/ +@[expose] noncomputable def interpWithFill (F : Forest V) (u : F.EdgeParam → ℝ) (t : ℝ) : Edge V → ℝ := fun e => @@ -368,6 +375,7 @@ namespace EdgeExtension variable {F F' : Forest V} {e₀ : Edge V} /-- Extend forest-edge parameters to a one-edge extension. -/ +@[expose] def extendParam (h : EdgeExtension F F' e₀) (u : F.EdgeParam → ℝ) (s : ℝ) : F'.EdgeParam → ℝ := fun e => diff --git a/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/AllBranches.lean b/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/AllBranches.lean index 23e34f3906..82cb94c055 100644 --- a/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/AllBranches.lean +++ b/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/AllBranches.lean @@ -19,7 +19,7 @@ family equals the expansion at every depth — the engine driving the proof of the BKAR forest interpolation formula (see `BKAR.Formula`). -/ -@[expose] public section +public section noncomputable section @@ -53,6 +53,7 @@ At level zero it is the current fill-parameter remainder. At level `n + 1` it exposes the current ordered-sector boundary term and recursively expands every active-edge remainder one level deeper. -/ +@[expose] noncomputable def allBranchesExpansion (choices : ActiveExtensionChoice V) : Nat → (F : Forest V) → List (Edge V) → List ℝ → ℝ → @@ -94,6 +95,7 @@ theorem allBranchesExpansion_succ The pure boundary-sector tree with the same branching shape as `allBranchesExpansion`, but with no fill-parameter remainder at the leaves. -/ +@[expose] noncomputable def allBranchesBoundaryExpansion (choices : ActiveExtensionChoice V) : Nat → (F : Forest V) → List (Edge V) → List ℝ → ℝ → @@ -139,6 +141,7 @@ This is a precise recursion-tree version of the usual smoothness and integrability requirements; the final smoothness API will discharge it in one place rather than weakening the induction theorem. -/ +@[expose] def allBranchesAnalytic (choices : ActiveExtensionChoice V) : Nat → (F : Forest V) → List (Edge V) → List ℝ → ℝ → diff --git a/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/AllBranchesFiberBridge/Core.lean b/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/AllBranchesFiberBridge/Core.lean index 23fbe8758f..c8d5f0dbd5 100644 --- a/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/AllBranchesFiberBridge/Core.lean +++ b/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/AllBranchesFiberBridge/Core.lean @@ -16,7 +16,7 @@ extensions, and, when `followOrder` succeeds, the root fiber equals the recursive ordered contribution of the grown forest. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/AllBranchesFiberBridge/FollowOrder.lean b/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/AllBranchesFiberBridge/FollowOrder.lean index eef7941047..627a31b93e 100644 --- a/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/AllBranchesFiberBridge/FollowOrder.lean +++ b/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/AllBranchesFiberBridge/FollowOrder.lean @@ -16,7 +16,7 @@ such a growth. Every chosen growth arises this way, giving the canonical realization of a support/order fiber used by the fiber bridge. -/ -@[expose] public section +public section noncomputable section @@ -67,6 +67,7 @@ theorem support_edges_eq_toFinset_emptyStart end ChosenGrowth /-- Follow an edge order through the active extensions selected by `choices`. -/ +@[expose] noncomputable def followOrderOption (choices : ActiveExtensionChoice V) : Forest V → List (Edge V) → Option (Forest V) diff --git a/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/AllBranchesFiberBridge/LowRank.lean b/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/AllBranchesFiberBridge/LowRank.lean index 1829c99bdc..4a928bdd46 100644 --- a/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/AllBranchesFiberBridge/LowRank.lean +++ b/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/AllBranchesFiberBridge/LowRank.lean @@ -15,7 +15,7 @@ when `followOrder` succeeds and vanishes otherwise, with the empty, singleton, and pair supports worked out explicitly. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/AllBranchesFiberSmoothness.lean b/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/AllBranchesFiberSmoothness.lean index 965404c027..7be83cc917 100644 --- a/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/AllBranchesFiberSmoothness.lean +++ b/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/AllBranchesFiberSmoothness.lean @@ -18,7 +18,7 @@ form of the identity: `ρ` at the all-ones configuration equals `ρ` at zero plus the sum of the nonempty-support fibers. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/AllBranchesFibers.lean b/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/AllBranchesFibers.lean index 3d97282571..8210a32489 100644 --- a/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/AllBranchesFibers.lean +++ b/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/AllBranchesFibers.lean @@ -18,7 +18,7 @@ support/order form of the BKAR forest interpolation formula (see `BKAR.Formula`). -/ -@[expose] public section +public section noncomputable section @@ -260,6 +260,7 @@ support/order fibers not already killed by the structural zero lemmas: the target support is nonempty and the target order is strictly longer than the child prefix. -/ +@[expose] def boundarySupportOrderTreeFiberNontrivialIntegrable (choices : ActiveExtensionChoice V) : Nat → (F : Forest V) → List (Edge V) → List ℝ → ℝ → @@ -542,6 +543,7 @@ theorem boundarySupportOrderTreeContribution_eq_sum_treeFiber_of_activeEdges_car The final root support/order contribution: the empty sector contributes `ρ zeroConfig`, and every nonempty sector is supplied by the folded tree fiber. -/ +@[expose] noncomputable def rootBoundarySupportOrderContribution (choices : ActiveExtensionChoice V) (ρ : (Edge V → ℝ) → ℝ) diff --git a/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/AllBranchesRegrouping.lean b/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/AllBranchesRegrouping.lean index 5637080d7f..efe2961d98 100644 --- a/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/AllBranchesRegrouping.lean +++ b/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/AllBranchesRegrouping.lean @@ -16,7 +16,7 @@ expansion's boundary terms as sums over supports and their enumerating orders. -/ -@[expose] public section +public section noncomputable section @@ -119,6 +119,7 @@ theorem localBoundarySupportContribution_def Local active-boundary sectors from a recursion node with fixed child support and fixed canonical order. -/ +@[expose] noncomputable def localBoundarySupportOrderContribution (choices : ActiveExtensionChoice V) (F : Forest V) (pref : List (Edge V)) (prefixTs : List ℝ) @@ -440,6 +441,7 @@ theorem sum_firstBoundarySupportOrderContribution The first recursive boundary remainder after exposing and regrouping all one-edge sectors below the empty forest. -/ +@[expose] noncomputable def firstRecursiveBoundaryRemainder (choices : ActiveExtensionChoice V) (ρ : (Edge V → ℝ) → ℝ) : ℝ := diff --git a/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/AllBranchesSmoothness.lean b/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/AllBranchesSmoothness.lean index 8212031a8b..cd7eaa8add 100644 --- a/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/AllBranchesSmoothness.lean +++ b/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/AllBranchesSmoothness.lean @@ -17,7 +17,7 @@ contributions, with or without the empty sector split off as `ρ` at the zero configuration. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/AllBranchesTelescoping.lean b/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/AllBranchesTelescoping.lean index 0ead04526a..ed2a910f87 100644 --- a/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/AllBranchesTelescoping.lean +++ b/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/AllBranchesTelescoping.lean @@ -17,7 +17,7 @@ contributions. This closes the depth induction in the proof of the BKAR forest interpolation formula (see `BKAR.Formula`). -/ -@[expose] public section +public section noncomputable section @@ -31,6 +31,7 @@ variable {V : Type*} [Fintype V] [DecidableEq V] The exact recursive boundary remainder left after one arbitrary-node support/order regrouping step. -/ +@[expose] noncomputable def localRecursiveBoundaryRemainder (choices : ActiveExtensionChoice V) (F : Forest V) (pref : List (Edge V)) (prefixTs : List ℝ) @@ -110,6 +111,7 @@ theorem allBranchesAnalytic.child_activeEdges_card exact allBranchesAnalytic_of_le choices hchild_le (hchild e t ht) /-- The local support/order boundary layer at one recursion node. -/ +@[expose] noncomputable def localBoundarySupportOrderSum (choices : ActiveExtensionChoice V) (F : Forest V) (pref : List (Edge V)) (prefixTs : List ℝ) diff --git a/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/CanonicalForestBridge.lean b/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/CanonicalForestBridge.lean index 3c779bb510..dfeaa32fea 100644 --- a/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/CanonicalForestBridge.lean +++ b/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/CanonicalForestBridge.lean @@ -17,7 +17,7 @@ canonical order of the support. Both carry the support as their edge set, so every abstract forest index acquires a concrete forest realizing it. -/ -@[expose] public section +public section noncomputable section @@ -32,6 +32,7 @@ The canonical list order of a forest index, obtained from the finite edge-set enumeration. This is a definite support representative; later sector sums may still range over all permutations of the same support. -/ +@[expose] def canonicalOrder (I : ForestIndex V) : {order : List (Edge V) // order ∈ Forest.edgeSetOrders I.edges} := ⟨I.edges.toList, @@ -52,6 +53,7 @@ variable {V : Type*} [Fintype V] [DecidableEq V] The `Forest` representative grown by following a canonical order of a forest index from the empty forest through the selected active-extension choices. -/ +@[expose] def grownForestForSupportOrder (choices : ActiveExtensionChoice V) (I : ForestIndex V) @@ -105,6 +107,7 @@ The `Forest` representative grown through the canonical order of the support. Th fixed representative for the support once an active-extension choice system is fixed. -/ +@[expose] def canonicalGrownForestForSupport (choices : ActiveExtensionChoice V) (I : ForestIndex V) : Forest V := diff --git a/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/CanonicalSector.lean b/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/CanonicalSector.lean index cc537cea22..3fe1e8ab25 100644 --- a/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/CanonicalSector.lean +++ b/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/CanonicalSector.lean @@ -17,7 +17,7 @@ grown-forest sector contributions agree with those of the canonical representative. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/ChosenGrowth.lean b/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/ChosenGrowth.lean index 0631b33861..ed8bd49243 100644 --- a/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/ChosenGrowth.lean +++ b/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/ChosenGrowth.lean @@ -16,7 +16,7 @@ canonical forests with the intrinsic ordered-contribution data of those forests. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/CubeFold.lean b/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/CubeFold.lean index 903342cce4..ab70c7f4ff 100644 --- a/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/CubeFold.lean +++ b/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/CubeFold.lean @@ -18,7 +18,7 @@ sectors to the one-cube-integral-per-forest form of the BKAR forest interpolation formula (see `BKAR.Formula`). -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/ForestIndexCube.lean b/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/ForestIndexCube.lean index 596bad4e52..c9306ca6f4 100644 --- a/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/ForestIndexCube.lean +++ b/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/ForestIndexCube.lean @@ -17,7 +17,7 @@ system used to realize it. This is the right-hand side of the flagship form of the BKAR forest interpolation formula (see `BKAR.Formula`). -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/LocalRecursion.lean b/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/LocalRecursion.lean index baeba7dabb..fb85f29d18 100644 --- a/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/LocalRecursion.lean +++ b/LeanPool/BKARForestFormula/BKAR/OrderedAssembly/LocalRecursion.lean @@ -17,7 +17,7 @@ all-branches expansion behind the BKAR forest interpolation formula (see `BKAR.Formula`). -/ -@[expose] public section +public section noncomputable section @@ -38,6 +38,7 @@ At a general recursion node, the selected terminal tail integral can be compared to the one-step active-extension integral. The difference is the piece that remains to be expanded by the all-branches induction. -/ +@[expose] noncomputable def localFirstTailRemainder (data : ActiveTerminalBranchData F) (e : {e // e ∈ F.activeEdges}) diff --git a/LeanPool/BKARForestFormula/BKAR/OrderedBranch.lean b/LeanPool/BKARForestFormula/BKAR/OrderedBranch.lean index 56ca8dc0a9..3e8e91248c 100644 --- a/LeanPool/BKARForestFormula/BKAR/OrderedBranch.lean +++ b/LeanPool/BKARForestFormula/BKAR/OrderedBranch.lean @@ -18,7 +18,7 @@ recursion proving the BKAR forest interpolation formula (see `BKAR.Formula`). -/ -@[expose] public section +public section noncomputable section @@ -38,6 +38,7 @@ Derivative order accumulated by following a growth list from left to right. The one-step recursion conses each new derivative onto the front, so the final mixed-partial list is the reverse of the growth order. -/ +@[expose] def derivativeOrder (_h : OrderedGrowth F order G) : List (Edge V) := order.reverse @@ -45,6 +46,7 @@ def derivativeOrder (_h : OrderedGrowth F order G) : List (Edge V) := The terminal BKAR interpolation point attached to one ordered branch and a list of simplex parameters. -/ +@[expose] def branchPoint (h : OrderedGrowth F order G) (u : F.EdgeParam → ℝ) (ts : List ℝ) : Edge V → ℝ := G.standardInterp (h.params u ts) @@ -52,6 +54,7 @@ def branchPoint (h : OrderedGrowth F order G) /-- The terminal integrand attached to one ordered forest-growth branch. -/ +@[expose] def branchIntegrand (h : OrderedGrowth F order G) (u : F.EdgeParam → ℝ) (ρ : (Edge V → ℝ) → ℝ) : List ℝ → ℝ := @@ -61,6 +64,7 @@ def branchIntegrand (h : OrderedGrowth F order G) The ordered-simplex integral with an explicit outer bound attached to one ordered forest-growth branch. -/ +@[expose] def branchIntegralAux (top : ℝ) (h : OrderedGrowth F order G) (u : F.EdgeParam → ℝ) (ρ : (Edge V → ℝ) → ℝ) : ℝ := orderedSimplexIntegralAux top order (h.branchIntegrand u ρ) @@ -68,6 +72,7 @@ def branchIntegralAux (top : ℝ) (h : OrderedGrowth F order G) /-- The ordered-simplex integral attached to one ordered forest-growth branch. -/ +@[expose] def branchIntegral (h : OrderedGrowth F order G) (u : F.EdgeParam → ℝ) (ρ : (Edge V → ℝ) → ℝ) : ℝ := h.branchIntegralAux 1 u ρ diff --git a/LeanPool/BKARForestFormula/BKAR/OrderedExpansion.lean b/LeanPool/BKARForestFormula/BKAR/OrderedExpansion.lean index 5e0355b003..27066b0b0d 100644 --- a/LeanPool/BKARForestFormula/BKAR/OrderedExpansion.lean +++ b/LeanPool/BKARForestFormula/BKAR/OrderedExpansion.lean @@ -20,7 +20,7 @@ derivative and integrability lemmas consumed by the recursion behind the BKAR forest interpolation formula (see `BKAR.Formula`). -/ -@[expose] public section +public section namespace BKAR diff --git a/LeanPool/BKARForestFormula/BKAR/OrderedForest.lean b/LeanPool/BKARForestFormula/BKAR/OrderedForest.lean index 24b402e822..12f1536e44 100644 --- a/LeanPool/BKARForestFormula/BKAR/OrderedForest.lean +++ b/LeanPool/BKARForestFormula/BKAR/OrderedForest.lean @@ -17,7 +17,7 @@ cardinalities) used throughout the ordered expansion of the BKAR forest interpolation formula (see `BKAR.Formula`). -/ -@[expose] public section +public section namespace BKAR @@ -50,6 +50,7 @@ structure ConsData (F : Forest V) (e : Edge V) (order : List (Edge V)) tail : OrderedGrowth forest order G /-- Decompose a nonempty ordered growth into its first step and tail growth. -/ +@[expose] def consData (h : OrderedGrowth F (e :: order) G) : ConsData F e order G := by cases h with @@ -57,6 +58,7 @@ def consData (h : OrderedGrowth F (e :: order) G) : exact ⟨_, step, tail⟩ /-- The intermediate forest after the first step of a nonempty ordered growth. -/ +@[expose] def tailForest (h : OrderedGrowth F (e :: order) G) : Forest V := h.consData.forest @@ -66,11 +68,13 @@ theorem firstStep (h : OrderedGrowth F (e :: order) G) : h.consData.step /-- The remaining ordered growth after the first step. -/ +@[expose] def tailGrowth (h : OrderedGrowth F (e :: order) G) : OrderedGrowth h.tailForest order G := h.consData.tail /-- The first edge of a nonempty ordered growth is active for the starting forest. -/ +@[expose] def firstActiveExtension (h : OrderedGrowth F (e :: order) G) : ActiveExtension F e := ⟨h.tailForest, h.firstStep⟩ @@ -108,6 +112,7 @@ theorem tailGrowth_edges_eq_toFinset_union h.tailGrowth.edges_eq_toFinset_union /-- The finite forest index grown by an ordered growth. -/ +@[expose] def support (_h : OrderedGrowth F order G) : ForestIndex V := G.support diff --git a/LeanPool/BKARForestFormula/BKAR/OrderedParams.lean b/LeanPool/BKARForestFormula/BKAR/OrderedParams.lean index 46f1e0be5d..83e89cebac 100644 --- a/LeanPool/BKARForestFormula/BKAR/OrderedParams.lean +++ b/LeanPool/BKARForestFormula/BKAR/OrderedParams.lean @@ -17,7 +17,7 @@ parameter bookkeeping for the nested integrals in the ordered expansion of the BKAR forest interpolation formula (see `BKAR.Formula`). -/ -@[expose] public section +public section namespace BKAR @@ -60,6 +60,7 @@ reading newly added edge parameters from a list in growth order. If the list is shorter than the order, the missing new parameters are filled with `0`; extra parameters are ignored once the growth terminates. -/ +@[expose] def params {F G : Forest V} {order : List (Edge V)} (h : OrderedGrowth F order G) : (F.EdgeParam → ℝ) → List ℝ → G.EdgeParam → ℝ := diff --git a/LeanPool/BKARForestFormula/BKAR/OrderedRecursion.lean b/LeanPool/BKARForestFormula/BKAR/OrderedRecursion.lean index c6c9a6afd7..1f1dec3864 100644 --- a/LeanPool/BKARForestFormula/BKAR/OrderedRecursion.lean +++ b/LeanPool/BKARForestFormula/BKAR/OrderedRecursion.lean @@ -17,7 +17,7 @@ inductive proof of the BKAR forest interpolation formula (see `BKAR.Formula`). -/ -@[expose] public section +public section noncomputable section @@ -34,6 +34,7 @@ variable {F G : Forest V} {e : Edge V} {order : List (Edge V)} /-- Prepend a chosen active extension to an ordered growth from the extended forest. -/ +@[expose] def consGrowth (h : ActiveExtension F e) (tail : OrderedGrowth h.forest order G) : OrderedGrowth F (e :: order) G := diff --git a/LeanPool/BKARForestFormula/BKAR/OrderedRemainder.lean b/LeanPool/BKARForestFormula/BKAR/OrderedRemainder.lean index 7680b5bd5d..28bf72dc00 100644 --- a/LeanPool/BKARForestFormula/BKAR/OrderedRemainder.lean +++ b/LeanPool/BKARForestFormula/BKAR/OrderedRemainder.lean @@ -17,7 +17,7 @@ the telescoping argument behind the BKAR forest interpolation formula (see `BKAR.Formula`). -/ -@[expose] public section +public section noncomputable section @@ -50,17 +50,20 @@ namespace ActiveBranchData variable {F : Forest V} /-- The full ordered branch obtained by prepending the selected active edge. -/ +@[expose] def growth (data : ActiveBranchData F) (e : {e // e ∈ F.activeEdges}) : OrderedGrowth F (e.val :: data.order e) (data.terminal e) := (data.extension e).consGrowth (data.tail e) /-- The finite active-edge sum of branch integrals with an explicit top bound. -/ +@[expose] def branchIntegralAux (data : ActiveBranchData F) (top : ℝ) (u : F.EdgeParam → ℝ) (ρ : (Edge V → ℝ) → ℝ) : ℝ := Finset.sum F.activeEdges.attach fun e => (data.growth e).branchIntegralAux top u ρ /-- The finite active-edge sum of branch integrals over the unit simplex. -/ +@[expose] def branchIntegral (data : ActiveBranchData F) (u : F.EdgeParam → ℝ) (ρ : (Edge V → ℝ) → ℝ) : ℝ := data.branchIntegralAux 1 u ρ @@ -69,6 +72,7 @@ def branchIntegral (data : ActiveBranchData F) The active-branch data whose selected branch over each active edge stops after the first extension. -/ +@[expose] def singleton (extensions : ∀ e : {e // e ∈ F.activeEdges}, ActiveExtension F e.val) : diff --git a/LeanPool/BKARForestFormula/BKAR/OrderedSimplex.lean b/LeanPool/BKARForestFormula/BKAR/OrderedSimplex.lean index 534129152a..526e241807 100644 --- a/LeanPool/BKARForestFormula/BKAR/OrderedSimplex.lean +++ b/LeanPool/BKARForestFormula/BKAR/OrderedSimplex.lean @@ -17,7 +17,7 @@ ordered expansion of the BKAR forest interpolation formula (see `BKAR.Formula`) first produces its remainder terms. -/ -@[expose] public section +public section noncomputable section @@ -32,6 +32,7 @@ The list of real parameters supplied to the integrand is in the same order as the edge list. If `order = [e₁, e₂, ...]`, then the bounds are `0 ≤ tₙ ≤ ... ≤ t₂ ≤ t₁ ≤ top`. -/ +@[expose] def orderedSimplexIntegralAux (top : ℝ) : List (Edge V) → (List ℝ → ℝ) → ℝ | [], f => f [] @@ -42,6 +43,7 @@ def orderedSimplexIntegralAux (top : ℝ) : /-- Nested interval integral over the ordered simplex with outer bound `1`. -/ +@[expose] def orderedSimplexIntegral (order : List (Edge V)) (f : List ℝ → ℝ) : ℝ := orderedSimplexIntegralAux 1 order f @@ -49,6 +51,7 @@ def orderedSimplexIntegral (order : List (Edge V)) (f : List ℝ → ℝ) : ℝ Predicate saying that a parameter list lies in the ordered simplex with outer bound `top`: `0 ≤ tₙ ≤ ... ≤ t₂ ≤ t₁ ≤ top`. -/ +@[expose] def OrderedSimplexParams : ℝ → List ℝ → Prop | _, [] => True | top, t :: ts => 0 ≤ t ∧ t ≤ top ∧ OrderedSimplexParams t ts diff --git a/LeanPool/BKARForestFormula/BKAR/OrderedTerminal.lean b/LeanPool/BKARForestFormula/BKAR/OrderedTerminal.lean index 1da8a87ae8..2161d16742 100644 --- a/LeanPool/BKARForestFormula/BKAR/OrderedTerminal.lean +++ b/LeanPool/BKARForestFormula/BKAR/OrderedTerminal.lean @@ -16,7 +16,7 @@ the partial derivative along the interpolation family, when the extended forest has no active edges left. -/ -@[expose] public section +public section noncomputable section @@ -33,6 +33,7 @@ variable {F : Forest V} {e : Edge V} /-- The one-edge ordered growth determined by a chosen active extension. -/ +@[expose] def singletonGrowth (h : ActiveExtension F e) : OrderedGrowth F [e] h.forest := OrderedGrowth.cons h.extension (OrderedGrowth.nil h.forest) diff --git a/LeanPool/BKARForestFormula/BKAR/OrderedTerminalGrowth.lean b/LeanPool/BKARForestFormula/BKAR/OrderedTerminalGrowth.lean index 0cf0b87e9e..219f7d6cca 100644 --- a/LeanPool/BKARForestFormula/BKAR/OrderedTerminalGrowth.lean +++ b/LeanPool/BKARForestFormula/BKAR/OrderedTerminalGrowth.lean @@ -17,7 +17,7 @@ run the recursion behind the BKAR forest interpolation formula (see `BKAR.Formula`) to completion. -/ -@[expose] public section +public section noncomputable section @@ -47,16 +47,19 @@ namespace TerminalGrowth variable {F : Forest V} /-- The ordered branch integral with an explicit outer bound. -/ +@[expose] def branchIntegralAux (data : TerminalGrowth F) (top : ℝ) (u : F.EdgeParam → ℝ) (ρ : (Edge V → ℝ) → ℝ) : ℝ := data.growth.branchIntegralAux top u ρ /-- The ordered branch integral over the unit simplex. -/ +@[expose] def branchIntegral (data : TerminalGrowth F) (u : F.EdgeParam → ℝ) (ρ : (Edge V → ℝ) → ℝ) : ℝ := data.branchIntegralAux 1 u ρ /-- The empty terminal branch attached to a forest with no active edges. -/ +@[expose] def ofActiveEdgesEqEmpty (F : Forest V) (hF : F.activeEdges = ∅) : TerminalGrowth F where order := [] @@ -65,6 +68,7 @@ def ofActiveEdgesEqEmpty (F : Forest V) (hF : F.activeEdges = ∅) : terminal_activeEdges_eq_empty := hF /-- Prepend a chosen active extension to a terminal branch from the extended forest. -/ +@[expose] def cons {e : Edge V} (h : ActiveExtension F e) (tail : TerminalGrowth h.forest) : TerminalGrowth F where order := e :: tail.order @@ -115,6 +119,7 @@ theorem edges_eq_toFinset_union (data : TerminalGrowth F) : data.growth.edges_eq_toFinset_union /-- The finite forest index grown by a terminal branch. -/ +@[expose] def support (data : TerminalGrowth F) : ForestIndex V := data.terminal.support @@ -341,6 +346,7 @@ namespace ActiveTerminalBranchData variable {F : Forest V} /-- Forget terminality, retaining the active-branch data underneath. -/ +@[expose] def branchData (data : ActiveTerminalBranchData F) : ActiveBranchData F where extension := data.extension order := fun e => (data.tail e).order @@ -348,16 +354,19 @@ def branchData (data : ActiveTerminalBranchData F) : ActiveBranchData F where tail := fun e => (data.tail e).growth /-- The full terminal branch selected over one active edge. -/ +@[expose] def growth (data : ActiveTerminalBranchData F) (e : {e // e ∈ F.activeEdges}) : TerminalGrowth F := TerminalGrowth.cons (data.extension e) (data.tail e) /-- The finite active-edge sum of terminal branch integrals with an explicit bound. -/ +@[expose] def branchIntegralAux (data : ActiveTerminalBranchData F) (top : ℝ) (u : F.EdgeParam → ℝ) (ρ : (Edge V → ℝ) → ℝ) : ℝ := data.branchData.branchIntegralAux top u ρ /-- The finite active-edge sum of terminal branch integrals over the unit simplex. -/ +@[expose] def branchIntegral (data : ActiveTerminalBranchData F) (u : F.EdgeParam → ℝ) (ρ : (Edge V → ℝ) → ℝ) : ℝ := data.branchIntegralAux 1 u ρ @@ -366,6 +375,7 @@ def branchIntegral (data : ActiveTerminalBranchData F) The active-terminal branch data whose selected branch over each active edge stops after the first extension. -/ +@[expose] def singleton (extensions : ∀ e : {e // e ∈ F.activeEdges}, ActiveExtension F e.val) diff --git a/LeanPool/BKARForestFormula/BKAR/PartialDeriv.lean b/LeanPool/BKARForestFormula/BKAR/PartialDeriv.lean index c92d60162d..f0a13363ce 100644 --- a/LeanPool/BKARForestFormula/BKAR/PartialDeriv.lean +++ b/LeanPool/BKARForestFormula/BKAR/PartialDeriv.lean @@ -20,13 +20,14 @@ appearing in the integrand of the BKAR forest interpolation formula (see `BKAR.Formula`). -/ -@[expose] public section +public section namespace BKAR variable {V : Type*} [DecidableEq V] /-- Replace one BKAR edge coordinate in a parameter vector. -/ +@[expose] def updateCoord (x : Edge V → ℝ) (e : Edge V) (t : ℝ) : Edge V → ℝ := Function.update x e t @@ -70,6 +71,7 @@ theorem edgeBasis_of_ne {e e' : Edge V} (hne : e' ≠ e) : Pi.single_eq_of_ne (M := fun _ : Edge V => ℝ) hne (1 : ℝ) /-- Partial derivative of `ρ` along one edge coordinate. -/ +@[expose] noncomputable def partialDeriv (e : Edge V) (ρ : (Edge V → ℝ) → ℝ) (x : Edge V → ℝ) : ℝ := deriv (fun t : ℝ => ρ (updateCoord x e t)) (x e) @@ -108,6 +110,7 @@ theorem partialDeriv_of_hasFDerivAt [Finite V] (e : Edge V) exact hcomp.deriv /-- Iterated mixed partial derivative along a list of edge coordinates. -/ +@[expose] noncomputable def mixedPartialList : List (Edge V) → ((Edge V → ℝ) → ℝ) → (Edge V → ℝ) → ℝ | [], ρ => ρ @@ -155,6 +158,7 @@ variable {V : Type*} [Fintype V] [DecidableEq V] variable (F : Forest V) /-- The mixed partial derivative indexed by the edge set of a forest. -/ +@[expose] noncomputable def mixedPartial (ρ : (Edge V → ℝ) → ℝ) : (Edge V → ℝ) → ℝ := mixedPartialList F.edges.toList ρ diff --git a/LeanPool/BKARForestFormula/BKAR/PartialDerivSymmetry.lean b/LeanPool/BKARForestFormula/BKAR/PartialDerivSymmetry.lean index 640d68cb31..878245eddf 100644 --- a/LeanPool/BKARForestFormula/BKAR/PartialDerivSymmetry.lean +++ b/LeanPool/BKARForestFormula/BKAR/PartialDerivSymmetry.lean @@ -20,7 +20,7 @@ the order-by-order expansion be regrouped into the order-free integrand of the BKAR forest interpolation formula (see `BKAR.Formula`). -/ -@[expose] public section +public section open scoped ContDiff diff --git a/LeanPool/BKARForestFormula/BKAR/Smoothness.lean b/LeanPool/BKARForestFormula/BKAR/Smoothness.lean index 3fba99042a..b05de8cc4d 100644 --- a/LeanPool/BKARForestFormula/BKAR/Smoothness.lean +++ b/LeanPool/BKARForestFormula/BKAR/Smoothness.lean @@ -25,7 +25,7 @@ suffices); assuming `C^∞` is a deliberate strengthening of the hypothesis that keeps the analytic bookkeeping uniform in the induction. -/ -@[expose] public section +public section open scoped ContDiff @@ -40,6 +40,7 @@ conditions in the BKAR induction. It is deliberately only `C^∞` smoothness on the finite edge-parameter space; the order/support conditions remain separate combinatorial obligations. -/ +@[expose] def BKARContDiff (ρ : (Edge V → ℝ) → ℝ) : Prop := ContDiff ℝ (∞ : WithTop ℕ∞) ρ @@ -162,6 +163,7 @@ A path of finite parameter lists with fixed length whose coordinates are all continuous. This is the small API needed for recursive ordered-simplex diagonals such as `prefixTs ++ [t₁] ++ [t₂]`. -/ +@[expose] def ListPathContinuous {X : Type*} [TopologicalSpace X] (n : Nat) (tsPath : X → List ℝ) : Prop := (∀ x, (tsPath x).length = n) ∧ diff --git a/LeanPool/BKARForestFormula/BKAR/Threshold.lean b/LeanPool/BKARForestFormula/BKAR/Threshold.lean index b982d2a0af..690c1937f9 100644 --- a/LeanPool/BKARForestFormula/BKAR/Threshold.lean +++ b/LeanPool/BKARForestFormula/BKAR/Threshold.lean @@ -15,7 +15,7 @@ BKAR interpolation points: threshold connectivity in a forest is equivalent to the path-min inequality along the unique forest path. -/ -@[expose] public section +public section namespace BKAR @@ -37,6 +37,7 @@ theorem mem_thresholdEdges (F : Forest V) (u : F.EdgeParam → ℝ) simp [thresholdEdges] /-- The threshold edge set is again an acyclic forest index. -/ +@[expose] def thresholdIndex (F : Forest V) (u : F.EdgeParam → ℝ) (s : ℝ) : ForestIndex V where edges := F.thresholdEdges u s @@ -48,6 +49,7 @@ def thresholdIndex (F : Forest V) (u : F.EdgeParam → ℝ) (s : ℝ) : Two vertices are threshold-connected when a simple forest path joins them using only edges whose parameter is at least `s`. -/ +@[expose] def thresholdConnected (F : Forest V) (u : F.EdgeParam → ℝ) (s : ℝ) (i j : V) : Prop := ∃ γ : List (Edge V), diff --git a/LeanPool/BKARForestFormula/BKAR/ThresholdComponents.lean b/LeanPool/BKARForestFormula/BKAR/ThresholdComponents.lean index dc9834e568..5287847c32 100644 --- a/LeanPool/BKARForestFormula/BKAR/ThresholdComponents.lean +++ b/LeanPool/BKARForestFormula/BKAR/ThresholdComponents.lean @@ -20,7 +20,7 @@ vertices lie in the same partition cell exactly when they are connected by forest edges whose parameters are at least `s`. -/ -@[expose] public section +public section namespace BKAR @@ -80,6 +80,7 @@ noncomputable section /-- The `Forest` representative carried by the threshold edge set. -/ +@[expose] def thresholdForest (F : Forest V) (u : F.EdgeParam → ℝ) (s : ℝ) : Forest V := (Classical.choice (F.thresholdIndex u s).acyclic).toForest diff --git a/LeanPool/BKARForestFormula/BKAR/ThresholdLayerCake.lean b/LeanPool/BKARForestFormula/BKAR/ThresholdLayerCake.lean index 154ab8ea20..31d356c228 100644 --- a/LeanPool/BKARForestFormula/BKAR/ThresholdLayerCake.lean +++ b/LeanPool/BKARForestFormula/BKAR/ThresholdLayerCake.lean @@ -21,7 +21,7 @@ nonnegative weights, and the weighted sum of threshold-component indicators recovers the BKAR interpolation value. -/ -@[expose] public section +public section namespace BKAR 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/BeckFialaMatrix/Basic.lean b/LeanPool/BeckFialaMatrix/Basic.lean index 30fa03d6c0..6ba5cd9754 100644 --- a/LeanPool/BeckFialaMatrix/Basic.lean +++ b/LeanPool/BeckFialaMatrix/Basic.lean @@ -31,7 +31,7 @@ Ported from the separate Paper IV contribution working copy. The paper freeze is unchanged. This candidate introduces no dependency on the paper library. -/ -@[expose] public section +public section open Finset 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..96e534118f 100644 --- a/LeanPool/Besicovitch/SixPoint/EndpointPacking.lean +++ b/LeanPool/Besicovitch/SixPoint/EndpointPacking.lean @@ -18,14 +18,14 @@ 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 namespace LeanPool.Besicovitch /-- The weighted geometric inequality for two ordered sibling pairs in the unit disk. -/ -def WeightedGeometricBound (lambda mu : ℝ) : Prop := +@[expose] def WeightedGeometricBound (lambda mu : ℝ) : Prop := ∀ e p₁ p₂ w₁ w₂ : (EuclideanSpace ℝ (Fin 2)), ‖e‖ = 1 → ‖p₁‖ ≤ 1 → ‖p₂‖ ≤ 1 → ‖w₁‖ ≤ 1 → ‖w₂‖ ≤ 1 → 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/BicausalOT.lean b/LeanPool/BicausalOT.lean index d9d68317e8..09e8ebd48b 100644 --- a/LeanPool/BicausalOT.lean +++ b/LeanPool/BicausalOT.lean @@ -71,4 +71,4 @@ analytic superlevel sets for finite-kernel sections, measurable selection, and c results. Its local Souslin-scheme construction supports the kernel-section proof. -/ -@[expose] public section +public section diff --git a/LeanPool/BicausalOT/BicausalOT.lean b/LeanPool/BicausalOT/BicausalOT.lean index 553b543925..87eea70ec0 100644 --- a/LeanPool/BicausalOT/BicausalOT.lean +++ b/LeanPool/BicausalOT/BicausalOT.lean @@ -16,4 +16,4 @@ public import LeanPool.BicausalOT.BicausalOT.Basic Supporting results for bicausal optimal transport and measurable selection. -/ -@[expose] public section +public section diff --git a/LeanPool/BicausalOT/BicausalOT/Basic.lean b/LeanPool/BicausalOT/BicausalOT/Basic.lean index 29990f5992..8ef60ce127 100644 --- a/LeanPool/BicausalOT/BicausalOT/Basic.lean +++ b/LeanPool/BicausalOT/BicausalOT/Basic.lean @@ -41,4 +41,4 @@ public import LeanPool.BicausalOT.BicausalOT.MeasurableFeasibleStrategy Supporting results for bicausal optimal transport and measurable selection. -/ -@[expose] public section +public section diff --git a/LeanPool/BicausalOT/BicausalOT/BicausalOT.lean b/LeanPool/BicausalOT/BicausalOT/BicausalOT.lean index 9dc8c20078..a1d0f68b67 100644 --- a/LeanPool/BicausalOT/BicausalOT/BicausalOT.lean +++ b/LeanPool/BicausalOT/BicausalOT/BicausalOT.lean @@ -45,4 +45,4 @@ public import LeanPool.BicausalOT.BicausalOT.Existence Supporting results for bicausal optimal transport and measurable selection. -/ -@[expose] public section +public section diff --git a/LeanPool/BicausalOT/BicausalOT/Defs.lean b/LeanPool/BicausalOT/BicausalOT/Defs.lean index 9adcb21479..fc42f6b3a3 100644 --- a/LeanPool/BicausalOT/BicausalOT/Defs.lean +++ b/LeanPool/BicausalOT/BicausalOT/Defs.lean @@ -24,7 +24,7 @@ public import Mathlib.Probability.Kernel.Basic Supporting results for bicausal optimal transport and measurable selection. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Set ENNReal @@ -35,12 +35,12 @@ variable [MeasurableSpace X₀] [MeasurableSpace X₁] variable [MeasurableSpace Y₀] [MeasurableSpace Y₁] /-- The measures coupling the two initial marginals. -/ -def CouplingSet₀ (μ₀ : Measure X₀) (ν₀ : Measure Y₀) : +@[expose] def CouplingSet₀ (μ₀ : Measure X₀) (ν₀ : Measure Y₀) : Set (Measure (X₀ × Y₀)) := { γ | γ.map Prod.fst = μ₀ ∧ γ.map Prod.snd = ν₀ } /-- The measures coupling the next-step conditional marginals at a given initial pair. -/ -def FeasibleSet₀ +@[expose] def FeasibleSet₀ (κ_μ : X₀ → Measure X₁) (κ_ν : Y₀ → Measure Y₁) (z₀ : X₀ × Y₀) : Set (Measure (X₁ × Y₁)) := { γ | γ.map Prod.fst = κ_μ z₀.1 ∧ γ.map Prod.snd = κ_ν z₀.2 } @@ -58,7 +58,7 @@ structure KernelDecomp π s = ∫⁻ z₀, (γ₁ z₀) {z₁ | ((z₀.1, z₁.1), (z₀.2, z₁.2)) ∈ s} ∂γ₀ /-- A two-step plan admits a kernel decomposition with the prescribed marginals at each step. -/ -def IsBicausal₂ +@[expose] def IsBicausal₂ (μ₀ : Measure X₀) (ν₀ : Measure Y₀) (κ_μ : X₀ → Measure X₁) (κ_ν : Y₀ → Measure Y₁) (π : Measure ((X₀ × X₁) × (Y₀ × Y₁))) : Prop := @@ -69,13 +69,13 @@ def IsBicausal₂ variable (c₀ : X₀ × Y₀ → ENNReal) (c₁ : (X₀ × Y₀) × (X₁ × Y₁) → ENNReal) /-- The initial cost plus the infimum of conditional continuation costs over feasible couplings. -/ -def V₀ (κ_μ : X₀ → Measure X₁) (κ_ν : Y₀ → Measure Y₁) +@[expose] def V₀ (κ_μ : X₀ → Measure X₁) (κ_ν : Y₀ → Measure Y₁) (z₀ : X₀ × Y₀) : ENNReal := c₀ z₀ + ⨅ (γ : Measure (X₁ × Y₁)) (_ : γ ∈ FeasibleSet₀ κ_μ κ_ν z₀), ∫⁻ z₁, c₁ (z₀, z₁) ∂γ /-- The expected sum of the initial and continuation costs under the decomposed plan. -/ -def totalCost (kd_γ₀ : Measure (X₀ × Y₀)) +@[expose] def totalCost (kd_γ₀ : Measure (X₀ × Y₀)) (kd_γ₁ : X₀ × Y₀ → Measure (X₁ × Y₁)) : ENNReal := ∫⁻ z₀, (c₀ z₀ + ∫⁻ z₁, c₁ (z₀, z₁) ∂(kd_γ₁ z₀)) ∂kd_γ₀ diff --git a/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory.lean b/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory.lean index a4d8fff083..1b7a8d238d 100644 --- a/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory.lean +++ b/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory.lean @@ -29,4 +29,4 @@ public import LeanPool.BicausalOT.BicausalOT.DescriptiveSetTheory.Tree Supporting modules for BicausalOT. -/ -@[expose] public section +public section diff --git a/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/AnalyticSet.lean b/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/AnalyticSet.lean index b7508f420e..9b92661ef2 100644 --- a/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/AnalyticSet.lean +++ b/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/AnalyticSet.lean @@ -30,7 +30,7 @@ public import Mathlib.MeasureTheory.Constructions.Polish.Basic Supporting results for bicausal optimal transport and measurable selection. -/ -@[expose] public section +public section -- Re-export for downstream modules open MeasureTheory diff --git a/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/AnalyticSigmaAlgebra.lean b/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/AnalyticSigmaAlgebra.lean index 771884bda3..13cd56e9e8 100644 --- a/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/AnalyticSigmaAlgebra.lean +++ b/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/AnalyticSigmaAlgebra.lean @@ -21,7 +21,7 @@ public import LeanPool.BicausalOT.BicausalOT.DescriptiveSetTheory.AnalyticSet Supporting results for bicausal optimal transport and measurable selection. -/ -@[expose] public section +public section open MeasureTheory Set @@ -30,7 +30,7 @@ noncomputable section variable {X : Type*} [TopologicalSpace X] /-- σ(Σ₁¹): the σ-algebra generated by the analytic subsets. (BS, Def 7.19) -/ -@[reducible] +@[reducible, expose] def analyticMeasurableSpace (X : Type*) [TopologicalSpace X] : MeasurableSpace X := MeasurableSpace.generateFrom { s : Set X | AnalyticSet s } @@ -61,7 +61,7 @@ theorem IsOpen.analyticSet [PolishSpace X] {s : Set X} (hs : IsOpen s) : /-- A function is analytically measurable (BS, Def 7.20) if preimages of Borel sets in the codomain land in σ(Σ₁¹) on the domain. -/ -def AnalyticallyMeasurable {Y : Type*} [TopologicalSpace Y] +@[expose] def AnalyticallyMeasurable {Y : Type*} [TopologicalSpace Y] (f : X → Y) : Prop := @Measurable X Y (analyticMeasurableSpace X) (borel Y) f diff --git a/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/Capacitability.lean b/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/Capacitability.lean index 5f97f5afe6..cf1fbfc16a 100644 --- a/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/Capacitability.lean +++ b/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/Capacitability.lean @@ -34,7 +34,7 @@ public import LeanPool.BicausalOT.BicausalOT.DescriptiveSetTheory.AnalyticSet /-! ## Part I: Bounded branch sets in Baire space -/ -@[expose] public section +public section open Set Topology MeasureTheory Filter open scoped ENNReal diff --git a/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/CouplingsCompact.lean b/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/CouplingsCompact.lean index 0a4da667b6..1e4a34cc73 100644 --- a/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/CouplingsCompact.lean +++ b/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/CouplingsCompact.lean @@ -40,7 +40,7 @@ public import Mathlib.Tactic /-! ## Translation between `ProbabilityMeasure.map` and `Measure.map` constraints -/ -@[expose] public section +public section open MeasureTheory Topology diff --git a/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/CouplingsUHC.lean b/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/CouplingsUHC.lean index 5bfa03c586..cde8065fe2 100644 --- a/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/CouplingsUHC.lean +++ b/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/CouplingsUHC.lean @@ -28,7 +28,7 @@ public import LeanPool.BicausalOT.BicausalOT.DescriptiveSetTheory.ProbabilityMea /-! ## U1: convergent sequences of probability measures are tight -/ -@[expose] public section +public section open MeasureTheory Set Filter Topology diff --git a/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/EpsOptimalSelection.lean b/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/EpsOptimalSelection.lean index 67a955031c..96c9edc475 100644 --- a/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/EpsOptimalSelection.lean +++ b/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/EpsOptimalSelection.lean @@ -31,7 +31,7 @@ public import Mathlib.MeasureTheory.MeasurableSpace.Constructions /-! ## Fiber infimum approximation -/ -@[expose] public section +public section open MeasureTheory Set ENNReal diff --git a/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/JankovVonNeumann.lean b/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/JankovVonNeumann.lean index 17447fcc4e..7da0db4c4c 100644 --- a/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/JankovVonNeumann.lean +++ b/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/JankovVonNeumann.lean @@ -30,7 +30,7 @@ public import Mathlib.MeasureTheory.Measure.Prod Supporting results for bicausal optimal transport and measurable selection. -/ -@[expose] public section +public section open MeasureTheory Set ENNReal diff --git a/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/KernelIntegral.lean b/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/KernelIntegral.lean index c4cd73b635..8f8458ae79 100644 --- a/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/KernelIntegral.lean +++ b/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/KernelIntegral.lean @@ -33,7 +33,7 @@ public import Mathlib.MeasureTheory.Integral.Lebesgue.Sub /-! ## Binary closure properties of analytic sets -/ -@[expose] public section +public section open Set Topology MeasureTheory ProbabilityTheory Filter open scoped ENNReal diff --git a/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/LintegralLsc.lean b/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/LintegralLsc.lean index 4198fc8a55..004707af3d 100644 --- a/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/LintegralLsc.lean +++ b/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/LintegralLsc.lean @@ -52,7 +52,7 @@ public import Mathlib.Tactic Supporting results for BicausalOT. -/ -@[expose] public section +public section open MeasureTheory Filter Set Topology open scoped ENNReal diff --git a/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/LowerSemianalytic.lean b/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/LowerSemianalytic.lean index 369b3e6701..0019d628d6 100644 --- a/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/LowerSemianalytic.lean +++ b/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/LowerSemianalytic.lean @@ -32,7 +32,7 @@ universal measurability (`MeasureTheory.AnalyticSet.nullMeasurableSet`) and the parametrized kernel version (`MeasureTheory.AnalyticSet.kernel_section_gt`). -/ -@[expose] public section +public section open MeasureTheory Set ENNReal @@ -42,7 +42,7 @@ variable {X : Type*} [TopologicalSpace X] /-- A function f : X → ℝ≥0∞ is lower semianalytic if its strict sublevel sets {f < c} are analytic for all c. (BS, Definition 7.21) -/ -def IsLowerSemianalytic (f : X → ENNReal) : Prop := +@[expose] def IsLowerSemianalytic (f : X → ENNReal) : Prop := ∀ c : ENNReal, AnalyticSet {x | f x < c} /-- l.s.c. functions are lower semianalytic. diff --git a/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/LsaAlgebra.lean b/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/LsaAlgebra.lean index e9e9b2cd6b..e41520ad41 100644 --- a/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/LsaAlgebra.lean +++ b/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/LsaAlgebra.lean @@ -22,7 +22,7 @@ public import LeanPool.BicausalOT.BicausalOT.DescriptiveSetTheory.KernelIntegral Supporting results for bicausal optimal transport and measurable selection. -/ -@[expose] public section +public section open Set MeasureTheory open scoped ENNReal diff --git a/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/LscIntegral.lean b/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/LscIntegral.lean index 935f94fd92..3cc87f8ea8 100644 --- a/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/LscIntegral.lean +++ b/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/LscIntegral.lean @@ -31,7 +31,7 @@ public import Mathlib.MeasureTheory.Measure.RegularityCompacts /-! ## J1: joint continuity of the pairing -/ -@[expose] public section +public section open MeasureTheory Set Filter Topology open scoped ENNReal diff --git a/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/MeasurableSelection.lean b/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/MeasurableSelection.lean index 4f7f10aa41..b3d4bb5184 100644 --- a/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/MeasurableSelection.lean +++ b/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/MeasurableSelection.lean @@ -37,7 +37,7 @@ public import Mathlib.Tactic /-! ### Least-index choice over `ℕ`, classical-decidability wrapper -/ -@[expose] public section +public section open Metric Set Filter Topology TopologicalSpace diff --git a/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/ProbabilityMeasurePolish.lean b/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/ProbabilityMeasurePolish.lean index 16dd1a3798..35ad8033b9 100644 --- a/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/ProbabilityMeasurePolish.lean +++ b/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/ProbabilityMeasurePolish.lean @@ -24,7 +24,7 @@ public import Mathlib.MeasureTheory.Measure.GiryMonad /-! ## Node A: Lévy-Prokhorov Cauchy sequences are uniformly tight -/ -@[expose] public section +public section open MeasureTheory Topology TopologicalSpace Metric Filter Set open scoped ENNReal NNReal diff --git a/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/Tree.lean b/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/Tree.lean index c21b90feb8..c2b6604e79 100644 --- a/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/Tree.lean +++ b/LeanPool/BicausalOT/BicausalOT/DescriptiveSetTheory/Tree.lean @@ -21,7 +21,7 @@ public import LeanPool.BicausalOT.BicausalOT.DescriptiveSetTheory.AnalyticSigmaA /-! ## Part I: Fibers (generic domain X, codomain ℕᴺ) -/ -@[expose] public section +public section open Set Topology MeasureTheory diff --git a/LeanPool/BicausalOT/BicausalOT/Existence.lean b/LeanPool/BicausalOT/BicausalOT/Existence.lean index 9b5b3d68f6..cae4792086 100644 --- a/LeanPool/BicausalOT/BicausalOT/Existence.lean +++ b/LeanPool/BicausalOT/BicausalOT/Existence.lean @@ -19,7 +19,7 @@ public import Mathlib.Topology.Semicontinuity.Basic Supporting results for bicausal optimal transport and measurable selection. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Set ENNReal diff --git a/LeanPool/BicausalOT/BicausalOT/FeasNonempty.lean b/LeanPool/BicausalOT/BicausalOT/FeasNonempty.lean index d0d88311d9..84bff72e77 100644 --- a/LeanPool/BicausalOT/BicausalOT/FeasNonempty.lean +++ b/LeanPool/BicausalOT/BicausalOT/FeasNonempty.lean @@ -31,7 +31,7 @@ Mathlib's `Measure.map_fst_prod : (μ.prod ν).map Prod.fst = (ν univ) • μ` (and symmetrically `Measure.map_snd_prod`) carry a total-mass scalar; for probability factors the scalar is `1` and disappears. -/ -@[expose] public section +public section open MeasureTheory Set ENNReal diff --git a/LeanPool/BicausalOT/BicausalOT/LowerBound.lean b/LeanPool/BicausalOT/BicausalOT/LowerBound.lean index b7718729cd..e804075bf9 100644 --- a/LeanPool/BicausalOT/BicausalOT/LowerBound.lean +++ b/LeanPool/BicausalOT/BicausalOT/LowerBound.lean @@ -17,7 +17,7 @@ public import LeanPool.BicausalOT.BicausalOT.Defs Supporting results for bicausal optimal transport and measurable selection. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Set ENNReal diff --git a/LeanPool/BicausalOT/BicausalOT/LscBellman.lean b/LeanPool/BicausalOT/BicausalOT/LscBellman.lean index bf13b5a412..a6bb640a05 100644 --- a/LeanPool/BicausalOT/BicausalOT/LscBellman.lean +++ b/LeanPool/BicausalOT/BicausalOT/LscBellman.lean @@ -35,7 +35,7 @@ public import LeanPool.BicausalOT.BicausalOT.DescriptiveSetTheory.MeasurableSele /-! ## KRN on the Polish space of probability measures -/ -@[expose] public section +public section open MeasureTheory Set Filter Topology open scoped ENNReal diff --git a/LeanPool/BicausalOT/BicausalOT/MeasurableFeasibleStrategy.lean b/LeanPool/BicausalOT/BicausalOT/MeasurableFeasibleStrategy.lean index 0ab174655f..f9f2149b89 100644 --- a/LeanPool/BicausalOT/BicausalOT/MeasurableFeasibleStrategy.lean +++ b/LeanPool/BicausalOT/BicausalOT/MeasurableFeasibleStrategy.lean @@ -29,7 +29,7 @@ public import LeanPool.BicausalOT.BicausalOT.LscBellman Supporting results for bicausal optimal transport and measurable selection. -/ -@[expose] public section +public section open MeasureTheory Set Filter Topology open scoped ENNReal diff --git a/LeanPool/BicausalOT/BicausalOT/MeasurableStrategy.lean b/LeanPool/BicausalOT/BicausalOT/MeasurableStrategy.lean index 75ae5bfc7f..4e9f8fbbb0 100644 --- a/LeanPool/BicausalOT/BicausalOT/MeasurableStrategy.lean +++ b/LeanPool/BicausalOT/BicausalOT/MeasurableStrategy.lean @@ -27,7 +27,7 @@ public import LeanPool.BicausalOT.BicausalOT.DescriptiveSetTheory.EpsOptimalSele /-! ## Fibers of the feasibility graph -/ -@[expose] public section +public section open MeasureTheory Set ENNReal diff --git a/LeanPool/BicausalOT/BicausalOT/MultiPeriod.lean b/LeanPool/BicausalOT/BicausalOT/MultiPeriod.lean index e3bf57abce..0bee32c964 100644 --- a/LeanPool/BicausalOT/BicausalOT/MultiPeriod.lean +++ b/LeanPool/BicausalOT/BicausalOT/MultiPeriod.lean @@ -23,7 +23,7 @@ public import Mathlib.MeasureTheory.Integral.Lebesgue.Add Supporting results for bicausal optimal transport and measurable selection. -/ -@[expose] public section +public section open MeasureTheory Set ENNReal @@ -35,29 +35,29 @@ variable (X Y : ℕ → Type*) /-- D1: pair-history up to time `t`, as nested products. Appending one step is literally pairing `(h, z)`. -/ -def PairHist : ℕ → Type _ +@[expose] def PairHist : ℕ → Type _ | 0 => X 0 × Y 0 | t + 1 => PairHist t × (X (t + 1) × Y (t + 1)) /-- D2: X-side history. -/ -def XHist : ℕ → Type _ +@[expose] def XHist : ℕ → Type _ | 0 => X 0 | t + 1 => XHist t × X (t + 1) /-- D2: Y-side history. -/ -def YHist : ℕ → Type _ +@[expose] def YHist : ℕ → Type _ | 0 => Y 0 | t + 1 => YHist t × Y (t + 1) variable {X Y} /-- D3: X-side projection of a pair-history. -/ -def projX : (t : ℕ) → PairHist X Y t → XHist X t +@[expose] def projX : (t : ℕ) → PairHist X Y t → XHist X t | 0, h => h.1 | t + 1, hz => (projX t hz.1, hz.2.1) /-- D3: Y-side projection of a pair-history. -/ -def projY : (t : ℕ) → PairHist X Y t → YHist Y t +@[expose] def projY : (t : ℕ) → PairHist X Y t → YHist Y t | 0, h => h.2 | t + 1, hz => (projY t hz.1, hz.2.2) @@ -69,25 +69,26 @@ variable (c : (t : ℕ) → PairHist X Y t → ℝ≥0∞) /-- D5: one-step feasible couplings after history `h`: couplings of the conditional marginals. -/ -def Feas (t : ℕ) (h : PairHist X Y t) : +@[expose] def Feas (t : ℕ) (h : PairHist X Y t) : Set (Measure (X (t + 1) × Y (t + 1))) := {γ | γ.map Prod.fst = κμ t (projX t h) ∧ γ.map Prod.snd = κν t (projY t h)} /-- D6: a strategy is an arbitrary family of one-step transition plans (no measurability imposed; mirrors the T=1 design). -/ -def Strat (X Y : ℕ → Type*) +@[expose] def Strat (X Y : ℕ → Type*) [∀ n, MeasurableSpace (X n)] [∀ n, MeasurableSpace (Y n)] : Type _ := (t : ℕ) → PairHist X Y t → Measure (X (t + 1) × Y (t + 1)) variable {κμ κν} /-- D7: cost-to-go with `k` remaining periods, starting at time `t`. -/ +@[expose] def costGo (γ : Strat X Y) : (k : ℕ) → (t : ℕ) → PairHist X Y t → ℝ≥0∞ | 0, t, h => c t h | k + 1, t, h => c t h + ∫⁻ z, costGo γ k (t + 1) (h, z) ∂(γ t h) /-- D8: Bellman value with `k` remaining periods. -/ -def VGo (κμ : (t : ℕ) → XHist X t → Measure (X (t + 1))) +@[expose] def VGo (κμ : (t : ℕ) → XHist X t → Measure (X (t + 1))) (κν : (t : ℕ) → YHist Y t → Measure (Y (t + 1))) : (k : ℕ) → (t : ℕ) → PairHist X Y t → ℝ≥0∞ | 0, t, h => c t h diff --git a/LeanPool/BicausalOT/BicausalOT/MultiPeriodTopology.lean b/LeanPool/BicausalOT/BicausalOT/MultiPeriodTopology.lean index 30c2229459..3d91cc5364 100644 --- a/LeanPool/BicausalOT/BicausalOT/MultiPeriodTopology.lean +++ b/LeanPool/BicausalOT/BicausalOT/MultiPeriodTopology.lean @@ -28,7 +28,7 @@ public import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic The product topology on histories, by recursion on the time index. -/ -@[expose] public section +public section open MeasureTheory diff --git a/LeanPool/BicausalOT/BicausalOT/Proposition1.lean b/LeanPool/BicausalOT/BicausalOT/Proposition1.lean index 723d243465..3446c53391 100644 --- a/LeanPool/BicausalOT/BicausalOT/Proposition1.lean +++ b/LeanPool/BicausalOT/BicausalOT/Proposition1.lean @@ -21,7 +21,7 @@ public import LeanPool.BicausalOT.BicausalOT.Defs Supporting results for bicausal optimal transport and measurable selection. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Set ENNReal diff --git a/LeanPool/BicausalOT/BicausalOT/SemianalyticValue.lean b/LeanPool/BicausalOT/BicausalOT/SemianalyticValue.lean index dfc6410565..3e99724d29 100644 --- a/LeanPool/BicausalOT/BicausalOT/SemianalyticValue.lean +++ b/LeanPool/BicausalOT/BicausalOT/SemianalyticValue.lean @@ -33,7 +33,7 @@ public import LeanPool.BicausalOT.BicausalOT.DescriptiveSetTheory.ProbabilityMea not the Borel σ-algebra of the weak topology; the type synonym `WeakP` installs the Borel structure (Polish by W1). -/ -@[expose] public section +public section open MeasureTheory Set ENNReal @@ -43,6 +43,7 @@ noncomputable section /-- Probability measures on `W`, considered with the topology of weak convergence and its Borel σ-algebra. -/ +@[expose] def WeakP (W : Type*) [MeasurableSpace W] : Type _ := ProbabilityMeasure W namespace WeakP @@ -61,6 +62,7 @@ instance [PolishSpace W] [BorelSpace W] : PolishSpace (WeakP W) := ProbabilityMeasure.instPolishSpace (X := W) /-- The underlying measure. -/ +@[expose] def toMeasure (γ : WeakP W) : Measure W := ProbabilityMeasure.toMeasure γ @@ -90,6 +92,7 @@ variable (c : (t : ℕ) → PairHist X Y t → ℝ≥0∞) /-- The feasibility correspondence, as a subset of the product of the history space with the Polish space of probability measures. -/ +@[expose] def FeasGraph (t : ℕ) : Set (PairHist X Y t × WeakP (X (t + 1) × Y (t + 1))) := {p | p.2.toMeasure ∈ Feas κμ κν t p.1} diff --git a/LeanPool/BicausalOT/BicausalOT/UpperBound.lean b/LeanPool/BicausalOT/BicausalOT/UpperBound.lean index 555ef349a5..a724a48b76 100644 --- a/LeanPool/BicausalOT/BicausalOT/UpperBound.lean +++ b/LeanPool/BicausalOT/BicausalOT/UpperBound.lean @@ -18,7 +18,7 @@ public import LeanPool.BicausalOT.BicausalOT.DescriptiveSetTheory.JankovVonNeuma Supporting results for bicausal optimal transport and measurable selection. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Set ENNReal diff --git a/LeanPool/BicausalOT/BicausalOT/ValueRepresentation.lean b/LeanPool/BicausalOT/BicausalOT/ValueRepresentation.lean index 8b6bca8afd..8b8236a68e 100644 --- a/LeanPool/BicausalOT/BicausalOT/ValueRepresentation.lean +++ b/LeanPool/BicausalOT/BicausalOT/ValueRepresentation.lean @@ -21,7 +21,7 @@ public import Mathlib.MeasureTheory.Integral.Lebesgue.Add Supporting results for bicausal optimal transport and measurable selection. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Set ENNReal diff --git a/LeanPool/BicausalOT/Solution.lean b/LeanPool/BicausalOT/Solution.lean index 354d6e834e..1cd07c738a 100644 --- a/LeanPool/BicausalOT/Solution.lean +++ b/LeanPool/BicausalOT/Solution.lean @@ -38,7 +38,7 @@ and is one of the theorems covered by the repository's `#print axioms` audit `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open TopologicalSpace diff --git a/LeanPool/BicausalOT/SolutionCapacitability.lean b/LeanPool/BicausalOT/SolutionCapacitability.lean index 8051164dcc..92b613ebd1 100644 --- a/LeanPool/BicausalOT/SolutionCapacitability.lean +++ b/LeanPool/BicausalOT/SolutionCapacitability.lean @@ -65,7 +65,7 @@ namespace so that their names match the `ChallengeCapacitability` declarations n report only `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open MeasureTheory diff --git a/LeanPool/BicausalOT/SolutionJvN.lean b/LeanPool/BicausalOT/SolutionJvN.lean index c6d462296e..3edefdcf21 100644 --- a/LeanPool/BicausalOT/SolutionJvN.lean +++ b/LeanPool/BicausalOT/SolutionJvN.lean @@ -83,7 +83,7 @@ repository root, and is checked again during the build by `BicausalOT/AxiomsAudi (line 35); both report only `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section namespace Uniformization diff --git a/LeanPool/BicausalOT/SolutionPolish.lean b/LeanPool/BicausalOT/SolutionPolish.lean index ad7eda71ba..e11c39f45f 100644 --- a/LeanPool/BicausalOT/SolutionPolish.lean +++ b/LeanPool/BicausalOT/SolutionPolish.lean @@ -59,7 +59,7 @@ library, and is one of the declarations covered by the repository's `#print axio `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open MeasureTheory 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..849b0a8dca 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)) : @@ -125,6 +125,7 @@ theorem anf_four_eq_zero {m : Nat} : (4 : ANF m) = 0 := by simp [CharTwo.ofNat_eq_mod] /-- Evaluation of a canonical ANF on a Boolean input. -/ +@[expose] def eval {m : Nat} (p : ANF m) (x : Fin m → F₂) : F₂ := p.coeff.sum fun s c => c * ∏ i ∈ s.vars, x i @@ -174,12 +175,14 @@ theorem prod_union_f2 {m : Nat} (x : Fin m → F₂) (s t : Finset (Fin m)) : · rw [h, k] /-- Evaluation of a squarefree monomial as a monoid homomorphism. -/ +@[expose] def monomialEval {m : Nat} (x : Fin m → F₂) : Monomial m →* F₂ where toFun s := ∏ i ∈ s.vars, x i map_one' := by simp map_mul' s t := prod_union_f2 x s.vars t.vars /-- Evaluation at a Boolean point as an `F₂`-algebra homomorphism. -/ +@[expose] noncomputable def evalHom {m : Nat} (x : Fin m → F₂) : ANF m →ₐ[F₂] F₂ := MonoidAlgebra.lift F₂ F₂ (Monomial m) (monomialEval x) @@ -274,7 +277,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..f31b87c68d 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,20 +35,20 @@ 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. -/ -def mulAmbient (n : Nat) : Submodule F₂ (ANF (2 * n)) := +@[expose] def mulAmbient (n : Nat) : Submodule F₂ (ANF (2 * n)) := affine (2 * n) ⊔ mulTarget n theorem Mul_mem_target (n : Nat) (s : Fin (2 * n - 1)) : Mul n s ∈ mulTarget n := by @@ -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..4e8120f48c 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 @@ -29,6 +29,7 @@ noncomputable section /-- Complete homogeneous normal form of a cubic seed arising from the normalized rational prefix. -/ +@[expose] def CubicSeedNormalForm (g : ANF 8) : Prop := ∃ (leftConst rightConst : F₂) (leftLinear rightLinear : LinearForm) (leftCoeff rightCoeff anchorCoeff : Fin 3 → F₂) @@ -289,6 +290,7 @@ theorem anfQuinticAnchorProbe_mul_target_congr_of_cubic /-- Classified algebraic output of a seed-using useful child at a specified rational place. Indexing by the place keeps every later normalization tied to the very same feedback witness. -/ +@[expose] def SeedUsingCubicClassifiedFormAt (g : ANF 8) (theta : Fin 3) : Prop := ∃ (correction factor target : ANF 8) (targetConst factorConst : F₂) @@ -312,7 +314,7 @@ def SeedUsingCubicClassifiedFormAt (g : ANF 8) (theta : Fin 3) : Prop := /-- Classified algebraic output of a seed-using useful child after quartic exclusion. Right idempotence makes the low factor a rational singleton and the new target its first tangent. -/ -def SeedUsingCubicClassifiedForm (g : ANF 8) : Prop := +@[expose] def SeedUsingCubicClassifiedForm (g : ANF 8) : Prop := ∃ theta : Fin 3, SeedUsingCubicClassifiedFormAt g theta /-- A seed-using branch of the first useful child has the classified cubic @@ -647,7 +649,7 @@ theorem seedUsingCubicClassified_normalized_anchor seedUsingCubicClassified_normalized_anchor_at hseed hfeedback⟩ /-- Canonical zero-place representative of the seed coset. -/ -def ZeroAnchoredCubicSeedForm (g : ANF 8) : Prop := +@[expose] def ZeroAnchoredCubicSeedForm (g : ANF 8) : Prop := ∃ (anchorLinear companionLinear : LinearForm) (correction : ANF 8), correction ∈ rationalLowSpace ∧ g + correction = 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..53704b049c 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 @@ -24,6 +24,7 @@ namespace N4 noncomputable section /-- The third finite difference at zero in three coordinate directions. -/ +@[expose] def triplePolarMap (i j k : Fin 8) : ANF 8 →ₗ[F₂] F₂ := sparseEvalMap ∅ + sparseEvalMap {i} + sparseEvalMap {j} + sparseEvalMap {k} + sparseEvalMap {i, j} + @@ -31,6 +32,7 @@ def triplePolarMap (i j k : Fin 8) : ANF 8 →ₗ[F₂] F₂ := sparseEvalMap {i, j, k} /-- Extract the coefficient supported on the specified three variables. -/ +@[expose] def tripleCoeffMap (i j k : Fin 8) : ANF 8 →ₗ[F₂] F₂ where toFun p := p.coeff ⟨{i, j, k}⟩ map_add' p q := by simp diff --git a/LeanPool/BooleanMultiplication/N4/CubicSlice.lean b/LeanPool/BooleanMultiplication/N4/CubicSlice.lean index 250148b6d6..fdc7e155f8 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 @@ -530,6 +530,7 @@ theorem seedUsingCubicClassifiedForm_impossible htargetEq' htargetRep' hfeedbackRep hright' /-- A new target at the fifth gate represented, modulo the preceding flag, by a low-low product. -/ +@[expose] def FirstLowLowData (C : Circuit 8 8) : Prop := ∃ (target representative shift : ANF 8), target ∈ targetAmbient 8 (mulTarget 4) ∧ 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..72243201f3 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 @@ -45,6 +45,7 @@ def homogeneousProjection {m : Nat} (d : Nat) : ANF m →ₗ[F₂] ANF m where simp [homogeneousPart] /-- The ANF has no monomial above degree `d`. -/ +@[expose] def DegreeLE {m : Nat} (d : Nat) (p : ANF m) : Prop := ∀ s : Monomial m, d < s.vars.card → p.coeff s = 0 @@ -96,6 +97,7 @@ theorem DegreeLE.mono {m d e : Nat} {p : ANF m} exact hp s (lt_of_le_of_lt hde hes) /-- There is a genuinely high monomial (degree at least three). -/ +@[expose] def HasNonzeroHigh {m : Nat} (p : ANF m) : Prop := ∃ s : Monomial m, 3 ≤ s.vars.card ∧ p.coeff s ≠ 0 @@ -104,17 +106,21 @@ def QuarticFree {m : Nat} (p : ANF m) : Prop := homogeneousPart 4 p = 0 /-- A seed whose only possible nonzero high component is cubic. -/ +@[expose] def IsCubicSeed {m : Nat} (p : ANF m) : Prop := HasNonzeroHigh p ∧ DegreeLE 3 p /-- The fourth gate has a nonzero component of degree greater than two. -/ +@[expose] def SeedHighNonzero (C : Circuit 8 8) : Prop := HasNonzeroHigh (C.gate 3) /-- The fourth gate has no degree-four homogeneous component. -/ def SeedQuarticFree (C : Circuit 8 8) : Prop := QuarticFree (C.gate 3) /-- The fourth gate is a cubic seed. -/ +@[expose] def CubicSeedState (C : Circuit 8 8) : Prop := IsCubicSeed (C.gate 3) /-- The linear subspace of Boolean ANFs of degree at most two. -/ +@[expose] def quadraticANFSpace (m : Nat) : Submodule F₂ (ANF m) where carrier := {p | DegreeLE 2 p} zero_mem' := by intro s hs; simp 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..09db1f6a72 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 @@ -113,6 +113,7 @@ theorem feedback_wedge_relations {q c : FeedbackCoord} exact ⟨h02, h03, h12, h13, h23⟩ /-- The feedback vector lies in the plane of the first two target coefficients. -/ +@[expose] def InFirstJetPlane (q : FeedbackCoord) : Prop := q 2 = 0 ∧ q 3 = 0 theorem feedback_dependent_or_firstJetPlane {q c : FeedbackCoord} @@ -247,6 +248,7 @@ theorem feedback_zero_wedge_structure_of_rows {q c : FeedbackCoord} exact feedback_dependent_or_firstJetPlane h02 h03 h12 h13 h23 /-- The second-jet coefficient vector with its two lower-order parameters. -/ +@[expose] def secondJetFeedbackCoeff (α β : F₂) : TargetCoeff := targetBasis 2 + α • targetBasis 1 + β • targetBasis 0 diff --git a/LeanPool/BooleanMultiplication/N4/FeedbackHomogeneous.lean b/LeanPool/BooleanMultiplication/N4/FeedbackHomogeneous.lean index 98a39c67ba..c6a4abfc4d 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 @@ -24,11 +24,13 @@ namespace N4 noncomputable section /-- The six quartic coordinates used by the feedback minors. -/ +@[expose] def feedbackQuarticCoord : Fin 6 → Fin 8 × Fin 8 × Fin 8 × Fin 8 := ![(0, 1, 4, 5), (0, 1, 4, 6), (0, 3, 4, 7), (0, 3, 5, 7), (0, 3, 6, 7), (0, 1, 6, 7)] /-- Extract the six quartic ANF coefficients used in feedback arguments. -/ +@[expose] def feedbackQuarticProbeANF : ANF 8 →ₗ[F₂] (Fin 6 → F₂) where toFun p u := anfFourProjection p (feedbackQuarticCoord u).1 (feedbackQuarticCoord u).2.1 @@ -49,6 +51,7 @@ def feedbackQuarticProbeANF : ANF 8 →ₗ[F₂] (Fin 6 → F₂) where (feedbackQuarticCoord u).2.2.2 := rfl /-- Extract the six feedback coordinates of a wedge of two two-forms. -/ +@[expose] def feedbackQuarticWedgeProbe (q c : TwoForm) : Fin 6 → F₂ := fun u => wedgeTwo q c (feedbackQuarticCoord u).1 (feedbackQuarticCoord u).2.1 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..8855a5ea97 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 @@ -211,6 +211,7 @@ theorem factorLinear_mem_anchor_plane · simpa [sliceX, sliceY, aLinear, bLinear, aCoord, bCoord, Pi.basisFun] using h7 /-- The affine perturbations of the zero-place product supported on its two inputs. -/ +@[expose] def ZeroPlaceFeedbackForm (factor : ANF 8) : Prop := ∃ delta rho sigma : F₂, factor = affineANF delta (rho • sliceX + sigma • sliceY) + diff --git a/LeanPool/BooleanMultiplication/N4/FirstJet.lean b/LeanPool/BooleanMultiplication/N4/FirstJet.lean index b2f1c331f9..29d365fa42 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 @@ -116,6 +116,7 @@ def CubicLowLowNormalCollisionAt ¬ IsRationalCoeff targetCoeff /-- Existence of a target and affine correction in the normalized cubic low-low collision form. -/ +@[expose] def CubicLowLowNormalCollision (g : ANF 8) : Prop := ∃ (target targetAffine : ANF 8) (targetCoeff : TargetCoeff), CubicLowLowNormalCollisionAt g target targetAffine targetCoeff @@ -214,6 +215,7 @@ def ExteriorFirstJetCollision : Prop := booleanContraction childLinear (rationalTwo childCoeff)) /-- Exterior collision data retaining the seed projections and the particular target. -/ +@[expose] def ExteriorFirstJetCollisionAt (g target targetAffine : ANF 8) (targetCoeff : TargetCoeff) : Prop := targetAffine ∈ affine 8 ∧ @@ -376,6 +378,7 @@ theorem contraction_sum_mem_rational_of_cubic_equal exact Submodule.smul_mem _ _ (rationalPlaceTwo_mem theta) /-- The reduced exterior-coordinate form of a first-jet collision. -/ +@[expose] def ExteriorFirstJetReducedCollision : Prop := ∃ (seedCoeff childCoeff rationalCoeff : Fin 3 → F₂) (seedLinear seedCompanion childLinear childCompanion : LinearForm) @@ -445,6 +448,7 @@ theorem exteriorFirstJetCollision_reduced hcubicNonzero, hcubic, htargetNonrational, htarget⟩ /-- A linear form lies in the two-input support of a rational place. -/ +@[expose] def InPlaceSupport (theta : Fin 3) (u : LinearForm) : Prop := ∃ a b : F₂, u = a • placeA theta + b • placeB theta diff --git a/LeanPool/BooleanMultiplication/N4/FirstJetState.lean b/LeanPool/BooleanMultiplication/N4/FirstJetState.lean index 38bfab1c6e..81ee0ca5ca 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 @@ -24,6 +24,7 @@ namespace N4 noncomputable section /-- The normalized seed and fifth-gate target data at a rational first jet. -/ +@[expose] def FirstJetState (C : Circuit 8 8) : Prop := ∃ (theta : Fin 3) (eps : F₂) (seedLinear seedCompanion : LinearForm) (seedRho : F₂), diff --git a/LeanPool/BooleanMultiplication/N4/FirstJetSupport.lean b/LeanPool/BooleanMultiplication/N4/FirstJetSupport.lean index 172309048e..a5a349f00b 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₂) : @@ -182,6 +182,7 @@ theorem normalizedFirstJetVector_eq (pa pb ja jb : F₂) : simp [normalizedFirstJetVector, aLinear, bLinear, aCoord, bCoord, Pi.basisFun] /-- After place normalization, the vector has first-jet support and a nonzero jet component. -/ +@[expose] def InNormalizedFirstJet (theta : Fin 3) (u : LinearForm) : Prop := ∃ pa pb ja jb : F₂, normalizePlaceLinear theta u = normalizedFirstJetVector pa pb ja jb ∧ @@ -454,6 +455,7 @@ theorem NormalizedEight.exteriorFirstJetNormalForm (exteriorFirstJetCollision_reduced h.exteriorFirstJetCollision) /-- The full ANF target normal form associated with a first-jet seed. -/ +@[expose] def FirstJetTargetNormalForm (g target targetAffine : ANF 8) (targetCoeff : TargetCoeff) : Prop := ∃ (theta : Fin 3) (eps : F₂) diff --git a/LeanPool/BooleanMultiplication/N4/Flag.lean b/LeanPool/BooleanMultiplication/N4/Flag.lean index d18f25c664..6570910c1a 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,28 +25,28 @@ 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 wire space. Minimal circuits have this property at every gate. -/ -def NonredundantAt {m r : Nat} (C : Circuit m r) (j : Fin r) : Prop := +@[expose] 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..e77f647570 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,21 +24,22 @@ 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 part of two linear forms and their same-side exterior components vanish. -/ +@[expose] def IsDecomposableTarget (c : TargetCoeff) : Prop := ∃ u v : LinearForm, (∀ i j : Fin 4, vectorWedge u v (aCoord i) (aCoord j) = 0) ∧ @@ -83,7 +84,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..c50d96fbf0 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,32 +26,32 @@ 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 := +@[expose] 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. -/ -def HankelRankLEOne (c : TargetCoeff) : Prop := +@[expose] def HankelRankLEOne (c : TargetCoeff) : Prop := ∀ i k j l : Fin 4, hankelMatrix c i j * hankelMatrix c k l = hankelMatrix c i l * hankelMatrix c k j diff --git a/LeanPool/BooleanMultiplication/N4/Homogeneous.lean b/LeanPool/BooleanMultiplication/N4/Homogeneous.lean index 9f757299b2..24c6275d59 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,15 +49,15 @@ 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. -/ -def rationalANF (α : Fin 3 → F₂) : ANF 8 := +@[expose] def rationalANF (α : Fin 3 → F₂) : ANF 8 := targetANF (rationalCoeffRep α) theorem rationalANF_eq_sum (α : Fin 3 → F₂) : @@ -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) : @@ -243,6 +243,7 @@ theorem vectorWedgeTwo_smul_right_h (u : LinearForm) (a : F₂) ring /-- The vector and two-form exterior product as a bilinear map. -/ +@[expose] def vectorWedgeTwoBilinear : LinearForm →ₗ[F₂] TwoForm →ₗ[F₂] ThreeForm where toFun u := @@ -375,11 +376,11 @@ theorem anfThreeProjection_linear_mul_rational rfl /-- Three quartic monomials detecting the rational-place wedge coordinates. -/ -def quarticProbeSet : Fin 3 → Finset (Fin 8) := +@[expose] def quarticProbeSet : Fin 3 → Finset (Fin 8) := ![{0, 1, 4, 6}, {1, 3, 5, 7}, {0, 3, 4, 7}] /-- Extract the three designated quartic coefficients of an ANF. -/ -def quarticProbeANF : ANF 8 →ₗ[F₂] (Fin 3 → F₂) where +@[expose] def quarticProbeANF : ANF 8 →ₗ[F₂] (Fin 3 → F₂) where toFun p t := p.coeff ⟨quarticProbeSet t⟩ map_add' p q := by ext t; simp map_smul' a p := by ext t; simp @@ -391,7 +392,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..9e32ef1852 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 @@ -25,21 +25,23 @@ namespace N4 noncomputable section /-- The plane spanned by the constant-coefficient inputs of the two polynomials. -/ +@[expose] def anchorPlane : Submodule F₂ LinearForm := Submodule.span F₂ (Set.range ![aLinear 0, bLinear 0]) /-- The target subspace spanned by the first two coefficients, the last, and evaluation at one. -/ +@[expose] def feedbackCoeffSpace : Submodule F₂ TargetCoeff := Submodule.span F₂ (Set.range ![targetBasis 0, targetBasis 1, 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 := @@ -49,6 +51,7 @@ def feedbackBasePart (c : TargetCoeff) : TargetCoeff := c 5 • rOneCoeff /-- The three remaining target coordinates after removing the feedback component. -/ +@[expose] def jetResidualCoeff (c : TargetCoeff) : TargetCoeff := jetA c • targetBasis 2 + jetB c • targetBasis 3 + jetC c • targetBasis 4 @@ -110,19 +113,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..31d060247d 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 @@ -24,6 +24,7 @@ namespace N4 noncomputable section /-- Every row indexed outside the normalized first-jet coordinates vanishes. -/ +@[expose] def SupportedK0Two (k : TwoForm) : Prop := ∀ z j : Fin 8, OutsideK0Index z → k z j = 0 diff --git a/LeanPool/BooleanMultiplication/N4/LowProductBridge.lean b/LeanPool/BooleanMultiplication/N4/LowProductBridge.lean index 92c58c4e48..4b21a569fb 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 @@ -308,6 +308,7 @@ theorem lowProduct_cubicProjection_of_quartic_zero rw [add_comm] /-- The exterior product of two linear forms as a bilinear map. -/ +@[expose] def vectorWedgeBilinear : LinearForm →ₗ[F₂] LinearForm →ₗ[F₂] TwoForm where toFun ell := @@ -378,7 +379,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..263f3372ea 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 @@ -68,18 +68,18 @@ theorem circuit_first_entry_replacement {m r : Nat} (C : Circuit m r) exact span_first_entry_replacement _ _ _ ht htFirst /-- The product target corresponding to evaluation at zero. -/ -def rZeroANF : ANF 8 := targetANF rZeroCoeff +@[expose] def rZeroANF : ANF 8 := targetANF rZeroCoeff /-- The product target corresponding to evaluation at one. -/ -def rOneANF : ANF 8 := targetANF rOneCoeff +@[expose] def rOneANF : ANF 8 := targetANF rOneCoeff /-- The product target corresponding to the leading coefficient. -/ -def rInfinityANF : ANF 8 := targetANF rInfinityCoeff +@[expose] 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. -/ -def rationalLowSpace : Submodule F₂ (ANF 8) := +@[expose] def rationalLowSpace : Submodule F₂ (ANF 8) := affine 8 ⊔ rationalTargetSpace theorem targetANF_rationalCoeffRep (α : Fin 3 → F₂) : @@ -185,6 +185,7 @@ theorem NormalizedEight.seed_right_mem_rationalLow {C : Circuit 8 8} exact C.right_mem 3 /-- Algebraic factor data exposed by the normalized seed. -/ +@[expose] def SeedFactorData (C : Circuit 8 8) : Prop := ∃ (leftAffine rightAffine : ANF 8) (leftCoeff rightCoeff : Fin 3 → F₂), 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..e6b124af88 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 @@ -144,6 +144,7 @@ theorem anfPlaceNormalize_mem_rationalLow_iff /-- The correlated first-jet state after moving its selected place to zero. The seed representative uses the very same linear form whose nonzero first-jet component was obtained in `FirstJetSupport`. -/ +@[expose] def ZeroNormalizedFirstJetState (C : Circuit 8 8) : Prop := ∃ (theta : Fin 3) (eps : F₂) (anchorLinear companionLinear : LinearForm) (correction : ANF 8) (pa pb ja jb : F₂), @@ -271,6 +272,7 @@ theorem NormalizedEight.zeroNormalizedFirstJetState /-- The degree-at-most-two state after the first feedback, in zero-place coordinates. The choice of tangent representative is immaterial modulo the rational place `E₀`. -/ +@[expose] def zeroFeedbackLowSpace : Submodule F₂ (ANF 8) := rationalLowSpace ⊔ Submodule.span F₂ {targetANF (rationalTangentAt 0 0)} diff --git a/LeanPool/BooleanMultiplication/N4/PlaceSymmetry.lean b/LeanPool/BooleanMultiplication/N4/PlaceSymmetry.lean index a069f6003d..b54fde188b 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,11 +42,11 @@ 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. -/ -def normalizeRationalCoeff +@[expose] def normalizeRationalCoeff (theta : Fin 3) (alpha : Fin 3 → F₂) : Fin 3 → F₂ := ![![alpha 0, alpha 1, alpha 2], ![alpha 1, alpha 0, alpha 2], @@ -137,6 +137,7 @@ theorem anf_prod_union Finset.prod_union_inter /-- Substitute the normalized linear inputs into a squarefree monomial. -/ +@[expose] def placeSubstitutionMonoid (theta : Fin 3) : Monomial 8 →* ANF 8 where toFun s := ∏ i ∈ s.vars, linearANF (inputPlaceChange theta i) map_one' := by simp @@ -161,6 +162,7 @@ def anfPlaceNormalize (theta : Fin 3) : ANF 8 →ₐ[F₂] ANF 8 := simp [X] /-- Convert a coefficient vector to its linear ANF, as a linear map. -/ +@[expose] def linearANFMap : LinearForm →ₗ[F₂] ANF 8 where toFun := linearANF map_add' := linearANF_add diff --git a/LeanPool/BooleanMultiplication/N4/Places.lean b/LeanPool/BooleanMultiplication/N4/Places.lean index ac2ec7bbd1..6475b074d7 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,18 +24,18 @@ 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) /-- Algebraic rank-at-most-two condition: all `3 × 3` minors vanish. -/ -def HankelRankLETwo (c : TargetCoeff) : Prop := +@[expose] def HankelRankLETwo (c : TargetCoeff) : Prop := ∀ dropRow dropCol : Fin 4, hankelMinorThree c dropRow dropCol = 0 instance (c : TargetCoeff) : Decidable (HankelRankLETwo c) := by @@ -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], @@ -69,7 +69,7 @@ theorem rankTwo_target_classification (c : TargetCoeff) : decide +kernel /-- Direct algebraic description of the rational-place span. -/ -def IsRationalCoeff (c : TargetCoeff) : Prop := +@[expose] def IsRationalCoeff (c : TargetCoeff) : Prop := ∃ α β γ : F₂, c = α • rZeroCoeff + β • rOneCoeff + γ • rInfinityCoeff @@ -77,6 +77,7 @@ instance (c : TargetCoeff) : Decidable (IsRationalCoeff c) := Fintype.decidableExistsFintype /-- Six tangent words followed by the three nonzero degree-two-place words. -/ +@[expose] def outsideRankTwoWord : Fin 9 → TargetCoeff := ![![0, 1, 0, 0, 0, 0, 0], ![1, 1, 0, 0, 0, 0, 0], @@ -106,6 +107,7 @@ def degreeTwoCoeffSpace : Submodule F₂ TargetCoeff := /-- The first Hasse-jet direction at each rational place, with its translate by the place itself. -/ +@[expose] def tangentWord : Fin 6 → TargetCoeff := ![outsideRankTwoWord 0, outsideRankTwoWord 1, outsideRankTwoWord 2, outsideRankTwoWord 3, 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..3f895d6d3e 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 : @@ -434,6 +434,7 @@ theorem decomposable_mem_rationalPlaceTwoSpace {q : TwoForm} h).symm⟩ /-- The span of eight candidate two-form generators. -/ +@[expose] def decomposableTwoSpan (q : Fin 8 → TwoForm) : Submodule F₂ TwoForm := Submodule.span F₂ (Set.range q) diff --git a/LeanPool/BooleanMultiplication/N4/QuadraticProjection.lean b/LeanPool/BooleanMultiplication/N4/QuadraticProjection.lean index f308eacf1e..69fa6e6f7e 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 @@ -24,13 +24,14 @@ namespace N4 noncomputable section /-- Extract the coefficients of the eight linear monomials. -/ +@[expose] def anfLinearProjection : ANF 8 →ₗ[F₂] LinearForm where toFun p i := p.coeff ⟨{i}⟩ map_add' p q := by ext i; simp 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..12d8d62247 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 @@ -70,11 +70,12 @@ def quarticOtherPairSeparatorTable (i : Fin 288) : Nat := /-- Pair zero is `(P₁,P₀)`, pair one `(P₀,P∞)`, and pair two `(P₁,P∞)`. -/ +@[expose] 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..a8f8087a22 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, _⟩ => @@ -37,6 +37,7 @@ def rationalTangentAt (theta : Fin 3) (eps : F₂) : TargetCoeff := /-- A compact set of quartic coordinates sufficient for the rational annihilator classification. -/ +@[expose] def quarticAnnihilatorCoord : Fin 9 → Fin 8 × Fin 8 × Fin 8 × Fin 8 := ![(0,1,4,5), (0,3,5,7), (0,1,4,6), @@ -55,7 +56,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 @@ -76,6 +77,7 @@ def quarticAnnihilatorCoeffProbe | ⟨8, _⟩ => c 4 * delta 1 + c 4 * delta 2 + c 6 * delta 1 /-- Every designated quartic-annihilator coefficient vanishes. -/ +@[expose] def VanishesOnQuarticAnnihilatorProbe (c : TargetCoeff) (delta : Fin 3 → F₂) : Prop := ∀ k : Fin 9, quarticAnnihilatorCoeffProbe c delta k = 0 @@ -97,6 +99,7 @@ theorem quarticAnnihilatorCoeffProbe_eq simp [N3Certificate.two_eq_zero_f2] /-- The rational-place coefficient vectors paired with the six tangent targets. -/ +@[expose] def rationalAnnihilatorDelta : Fin 6 → (Fin 3 → F₂) := ![![1, 0, 0], ![1, 0, 0], ![0, 1, 0], ![0, 1, 0], diff --git a/LeanPool/BooleanMultiplication/N4/QuarticBasisChange.lean b/LeanPool/BooleanMultiplication/N4/QuarticBasisChange.lean index 9c05a7fbff..8dde9206c1 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 @@ -25,19 +25,19 @@ namespace N4 noncomputable section /-- The minor computing the first coefficient in a rational-plane basis change. -/ -def basisChangeP (β γ : Fin 3 → F₂) (i j : Fin 3) : F₂ := +@[expose] def basisChangeP (β γ : Fin 3 → F₂) (i j : Fin 3) : F₂ := γ i * β j + γ j * β i /-- The minor computing the second coefficient in a rational-plane basis change. -/ -def basisChangeQ (α γ : Fin 3 → F₂) (i j : Fin 3) : F₂ := +@[expose] 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. -/ -def SameRationalMinors (α β γ δ : Fin 3 → F₂) : Prop := +@[expose] def SameRationalMinors (α β γ δ : Fin 3 → F₂) : Prop := ∀ pair : Fin 3, rationalCoeffMinor α β (quarticSupportPair pair).1 (quarticSupportPair pair).2 = @@ -119,10 +119,12 @@ theorem same_rational_minors_of_wedge_eq · simpa [quarticSupportPair] using h12 /-- The first linear factor after applying the inverse two-dimensional basis change. -/ +@[expose] def changedFirstLinear (s q : F₂) (ell m : LinearForm) : LinearForm := s • ell + q • m /-- The second linear factor after applying the inverse two-dimensional basis change. -/ +@[expose] def changedSecondLinear (r p : F₂) (ell m : LinearForm) : LinearForm := r • ell + p • m 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..091f14b546 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 @@ -30,6 +30,7 @@ noncomputable section /-- The 28 upper-triangular coordinate pairs of an alternating `8 × 8` matrix. -/ +@[expose] def upperPair : Fin 28 → Fin 8 × Fin 8 := ![(0,1),(0,2),(0,3),(0,4),(0,5),(0,6),(0,7), (1,2),(1,3),(1,4),(1,5),(1,6),(1,7), @@ -40,6 +41,7 @@ def upperPair : Fin 28 → Fin 8 × Fin 8 := /-- Packed separating covectors. The flat index order is `(P₁-A coefficient, P₁-B coefficient, P₀-A coefficient, P₀-B coefficient, outside-word index)`. -/ +@[expose] def quarticLowLowSeparatorTable (i : Fin 144) : Nat := #[0x0000010,0x0000008,0x0000010,0x0000008,0x0020000,0x0020000, 0x0000010,0x0000008,0x0000008, @@ -75,41 +77,47 @@ def quarticLowLowSeparatorTable (i : Fin 144) : Nat := 0x0008480,0x0004203,0x0004203][i.val]'i.isLt /-- Encode a field element as the natural number zero or one. -/ +@[expose] def f2IndexBit (a : F₂) : Nat := if a = 0 then 0 else 1 /-- Pack four Boolean parameters and an outside-target index into a table row. -/ +@[expose] def quarticSeparatorIndex (a b c d : F₂) (i : Fin 9) : Fin 144 := let n := ((((f2IndexBit a * 2 + f2IndexBit b) * 2 + f2IndexBit c) * 2 + f2IndexBit d) * 9 + i.val) ⟨n % 144, Nat.mod_lt _ (by decide)⟩ /-- Extract one coefficient of the packed quartic separating covector. -/ +@[expose] def quarticSeparatorBit (a b c d : F₂) (i : Fin 9) (k : Fin 28) : F₂ := if Nat.testBit (quarticLowLowSeparatorTable (quarticSeparatorIndex a b c d i)) k.val then 1 else 0 /-- Extract one coordinate from a two-form coordinate array. -/ +@[expose] def twoFormCoordinate (i j : Fin 8) : TwoForm →ₗ[F₂] F₂ where toFun := fun q => q i j map_add' _ _ := rfl map_smul' _ _ := rfl /-- The linear functional encoded by a quartic separating table row. -/ +@[expose] def quarticSeparatorLinear (a b c d : F₂) (i : Fin 9) : TwoForm →ₗ[F₂] F₂ := ∑ k : Fin 28, quarticSeparatorBit a b c d i k • twoFormCoordinate (upperPair k).1 (upperPair k).2 /-- Evaluate a quartic separating covector on a two-form. -/ +@[expose] 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 : @@ -121,13 +129,23 @@ theorem quarticSeparator_pone_basis_check : ∀ (a b c d : F₂) (i : Fin 9) (j : Fin 8), quarticSeparatorLinear a b c d i (vectorWedge (quarticPoneVector a b) (coordinateLinear j)) = 0 := by - decide +kernel + intro a b c d + rcases f2_eq_zero_or_one a with rfl | rfl <;> + rcases f2_eq_zero_or_one b with rfl | rfl <;> + rcases f2_eq_zero_or_one c with rfl | rfl <;> + rcases f2_eq_zero_or_one d with rfl | rfl <;> + decide +kernel theorem quarticSeparator_pzero_basis_check : ∀ (a b c d : F₂) (i : Fin 9) (j : Fin 8), quarticSeparatorLinear a b c d i (vectorWedge (quarticPzeroVector c d) (coordinateLinear j)) = 0 := by - decide +kernel + intro a b c d + rcases f2_eq_zero_or_one a with rfl | rfl <;> + rcases f2_eq_zero_or_one b with rfl | rfl <;> + rcases f2_eq_zero_or_one c with rfl | rfl <;> + rcases f2_eq_zero_or_one d with rfl | rfl <;> + decide +kernel theorem quarticSeparator_pone (a b c d : F₂) (i : Fin 9) (z : LinearForm) : @@ -333,9 +351,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..242f8cf006 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 @@ -24,11 +24,13 @@ namespace N4 noncomputable section /-- Extract a designated quartic-annihilator coefficient from an ANF. -/ +@[expose] def anfQuarticAnnihilatorProbe (p : ANF 8) (k : Fin 9) : F₂ := let ijkl := quarticAnnihilatorCoord k anfFourProjection p ijkl.1 ijkl.2.1 ijkl.2.2.1 ijkl.2.2.2 /-- One quartic-annihilator coefficient projection as a linear map. -/ +@[expose] def anfQuarticAnnihilatorProbeLinear (k : Fin 9) : ANF 8 →ₗ[F₂] F₂ where toFun := fun p => anfQuarticAnnihilatorProbe p k map_add' p q := by @@ -54,6 +56,7 @@ def anfQuarticAnnihilatorProbeLinear (k : Fin 9) : ANF 8 →ₗ[F₂] F₂ where simp [anfQuarticAnnihilatorProbe, map_smul, Pi.smul_apply] /-- The squarefree monomial underlying a quartic-annihilator coordinate. -/ +@[expose] def quarticAnnihilatorSet (k : Fin 9) : Finset (Fin 8) := let ijkl := quarticAnnihilatorCoord k {ijkl.1, ijkl.2.1, ijkl.2.2.1, ijkl.2.2.2} 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..85a3685437 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 @@ -25,6 +25,7 @@ namespace N4 noncomputable section /-- One of the three nonzero coefficient vectors supported away from the zero place. -/ +@[expose] def QuarticPlaneTypeAtZero (zeta : Fin 3 → F₂) : Prop := zeta = rationalSingleton 1 ∨ zeta = rationalSingleton 2 ∨ @@ -78,6 +79,7 @@ theorem representedLowFactor_linear_combination _ = _ := by rw [hgamma] /-- A quartic seed and correction expressed in the normalized zero-anchored plane form. -/ +@[expose] def ZeroAnchoredQuarticSeedForm (g correction : ANF 8) : Prop := ∃ (normalizedSeed normalizedCorrection : ANF 8) (leftConst rightConst : F₂) diff --git a/LeanPool/BooleanMultiplication/N4/QuarticSeedClassified.lean b/LeanPool/BooleanMultiplication/N4/QuarticSeedClassified.lean index 17bd8f73ed..ca4668d10c 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 @@ -24,6 +24,7 @@ namespace N4 noncomputable section /-- A seed-using target witness with its factor in the classified quartic normal form. -/ +@[expose] def SeedUsingQuarticClassifiedForm (g : ANF 8) : Prop := ∃ (correction factor target : ANF 8) (targetConst factorConst : F₂) diff --git a/LeanPool/BooleanMultiplication/N4/QuarticSeedNormalForm.lean b/LeanPool/BooleanMultiplication/N4/QuarticSeedNormalForm.lean index 8bcdfcebc6..004d2cc7b9 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 @@ -26,6 +26,7 @@ noncomputable section /-- The complete seed-using normal form, kept in `Prop` so that it can be obtained from the existential useful-child certificate without choosing data computationally. -/ +@[expose] def SeedUsingQuarticNormalForm (g : ANF 8) : Prop := ∃ (correction factor target : ANF 8) (targetConst factorConst : F₂) diff --git a/LeanPool/BooleanMultiplication/N4/QuarticSeedUsing.lean b/LeanPool/BooleanMultiplication/N4/QuarticSeedUsing.lean index 5f2aded757..af2bab78cd 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 @@ -26,6 +26,7 @@ namespace N4 noncomputable section /-- A seed-using product that gives a target outside the affine-plus-rational-target space. -/ +@[expose] def SeedUsingTargetWitness (g : ANF 8) : Prop := ∃ (a c F : ANF 8), a ∈ rationalLowSpace ∧ 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..55f0e12bd0 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 @@ -44,6 +44,7 @@ def assignmentTail {n : Nat} (x : Fin (n + 1) → F₂) : Fin n → F₂ := fun i => x i.succ /-- Prepend one field element to a Boolean assignment. -/ +@[expose] def assignmentCons {n : Nat} (b : F₂) (x : Fin n → F₂) : Fin (n + 1) → F₂ := Fin.cases b x @@ -59,6 +60,7 @@ def assignmentCons {n : Nat} (b : F₂) (x : Fin n → F₂) : rfl /-- Split a Boolean assignment into its first coordinate and its tail. -/ +@[expose] def assignmentEquiv (n : Nat) : (Fin (n + 1) → F₂) ≃ F₂ × (Fin n → F₂) where toFun x := (x 0, assignmentTail x) @@ -73,12 +75,14 @@ def assignmentEquiv (n : Nat) : rfl /-- Evaluate a recursively encoded affine polynomial on a Boolean assignment. -/ +@[expose] def AffineCode.eval : {n : Nat} → AffineCode n → (Fin n → F₂) → F₂ | 0, .nil c, _ => c | _ + 1, .cons tail head, x => AffineCode.eval tail (assignmentTail x) + x 0 * head /-- Evaluate a recursively encoded quadratic polynomial on a Boolean assignment. -/ +@[expose] def QuadraticCode.eval : {n : Nat} → QuadraticCode n → (Fin n → F₂) → F₂ | 0, .nil c, _ => c | _ + 1, .cons tail cross, x => @@ -105,10 +109,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..8ffc96ce47 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₂) : @@ -185,6 +185,7 @@ private theorem equal_feedback_factor_product_mem · exact feedbackTarget_mem_zeroFeedbackLow q /-- An input coordinate outside the normalized first-jet support. -/ +@[expose] def OutsideK0Index (i : Fin 8) : Prop := i = 2 ∨ i = 3 ∨ i = 6 ∨ i = 7 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..a3a96561b6 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 @@ -25,11 +25,13 @@ namespace N4 noncomputable section /-- A product of two ANFs in the affine-plus-rational-target space. -/ +@[expose] def IsLowLowProduct (f : ANF 8) : Prop := ∃ p q : ANF 8, p ∈ rationalLowSpace ∧ q ∈ rationalLowSpace ∧ f = p * q /-- A product whose first input is the seed plus a low term and whose second input is low. -/ +@[expose] def IsSeedUsingProduct (g f : ANF 8) : Prop := ∃ p c : ANF 8, p ∈ rationalLowSpace ∧ c ∈ rationalLowSpace ∧ @@ -104,6 +106,7 @@ theorem normalize_seed_state_product {C : Circuit 8 8} · exact Submodule.add_mem _ hp hq /-- A new target at the fifth gate, represented modulo the fourth-gate flag by a seed child. -/ +@[expose] def UsefulSeedChildData (C : Circuit 8 8) : Prop := ∃ (target representative shift : ANF 8), target ∈ targetAmbient 8 (mulTarget 4) ∧ diff --git a/LeanPool/BooleanMultiplication/N4/SemanticQuadratic.lean b/LeanPool/BooleanMultiplication/N4/SemanticQuadratic.lean index 0cedfc0b1a..6e218fca82 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 @@ -129,7 +129,7 @@ theorem quadratic_monomial_semantic (i j : Fin 8) : simp [a, b, eval_mul', eval_X] /-- Retain only the coefficients of squarefree monomials of degree at most two. -/ -def lowReconstruct (p : ANF 8) : ANF 8 := +@[expose] def lowReconstruct (p : ANF 8) : ANF 8 := ∑ s : Monomial 8, if s.vars.card ≤ 2 then p.coeff s • monomial s.vars else 0 @@ -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)) : @@ -208,15 +208,18 @@ theorem eval_monomial_supportAssignment (s t : Finset (Fin 8)) : rw [eval_monomial, prod_supportAssignment] /-- Evaluate an ANF on the indicator assignment of a finite set. -/ +@[expose] def sparseEvalMap (t : Finset (Fin 8)) : ANF 8 →ₗ[F₂] F₂ := (evalHom (supportAssignment t)).toLinearMap /-- The second finite difference at zero in two coordinate directions. -/ +@[expose] def pairPolarMap (i j : Fin 8) : ANF 8 →ₗ[F₂] F₂ := sparseEvalMap ∅ + sparseEvalMap {i} + sparseEvalMap {j} + sparseEvalMap {i, j} /-- Extract the coefficient supported on the specified pair of variables. -/ +@[expose] def pairCoeffMap (i j : Fin 8) : ANF 8 →ₗ[F₂] F₂ where toFun p := p.coeff ⟨{i, j}⟩ map_add' p q := by simp @@ -324,7 +327,8 @@ theorem sparseEvalMap_single (t : Finset (Fin 8)) (s : Monomial 8) (c : F₂) : sparseEvalMap t (MonoidAlgebra.single s c) = c * (if s.vars ⊆ t then 1 else 0) := by - change eval (MonoidAlgebra.single s c) (supportAssignment t) = _ + change evalHom (supportAssignment t) (MonoidAlgebra.single s c) = _ + rw [← eval_eq_evalHom] have hsingle : (MonoidAlgebra.single s c : ANF 8) = c • monomial s.vars := by apply MonoidAlgebra.coeff_injective 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..b447a953ed 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 @@ -229,6 +229,7 @@ theorem rationalTripleDet_eq_zero_of_seedUsing_target _ = 0 := htargetProbe /-- The third rational coefficient vector belongs to the span of the first two. -/ +@[expose] def InRationalCoeffPlane (alpha beta delta : Fin 3 → F₂) : Prop := ∃ p q : F₂, delta = p • alpha + q • beta 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..49629a2e66 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 + @@ -126,6 +126,7 @@ theorem sliceQuadratics_independent exact hI /-- Membership in the two-input support of the infinity place. -/ +@[expose] def InSliceInfinityPlane (ell : LinearForm) : Prop := ∃ a b : F₂, ell = a • placeA 2 + b • placeB 2 @@ -421,7 +422,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..4b94359b0d 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,32 +26,33 @@ 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. -/ +@[expose] def InSliceComplementPlane (ell : LinearForm) : Prop := ∃ a b : F₂, ell = a • sliceABar + b • sliceBBar 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..09db058115 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 @@ -40,10 +40,12 @@ theorem eval_linearANF_supportAssignment simp [supportAssignment] /-- The first finite difference at zero in one coordinate direction. -/ +@[expose] def singlePolarMap (i : Fin 8) : ANF 8 →ₗ[F₂] F₂ := sparseEvalMap ∅ + sparseEvalMap {i} /-- Extract the coefficient of one linear monomial. -/ +@[expose] def singleCoeffMap (i : Fin 8) : ANF 8 →ₗ[F₂] F₂ where toFun p := p.coeff ⟨{i}⟩ map_add' p q := by simp @@ -528,7 +530,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 +541,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 +552,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..dba7f13e67 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. -/ @@ -153,6 +153,7 @@ theorem feedbackCorner_has_zero (delta rho sigma : F₂) : decide /-- The feedback factor vanishes at exactly one of the four Boolean anchor corners. -/ +@[expose] def ExactlyThreeActiveCorners (delta rho sigma : F₂) : Prop := ∃ x₀ y₀ : F₂, feedbackCorner delta rho sigma x₀ y₀ = 0 ∧ 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..b2d5c21806 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 @@ -23,7 +23,7 @@ namespace N4 noncomputable section /-- The linear map from target coefficient vectors to product ANFs. -/ -def targetANFLinear : TargetCoeff →ₗ[F₂] ANF 8 where +@[expose] def targetANFLinear : TargetCoeff →ₗ[F₂] ANF 8 where toFun := targetANF map_add' c d := by simp only [targetANF, Pi.add_apply, add_smul, Finset.sum_add_distrib] @@ -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..c95577a3aa 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⟩ @@ -55,7 +55,7 @@ def targetTwo (c : TargetCoeff) : TwoForm := fun i j => else 0 /-- The target Hankel two-form construction as a linear map. -/ -def targetTwoLinear : TargetCoeff →ₗ[F₂] TwoForm where +@[expose] def targetTwoLinear : TargetCoeff →ₗ[F₂] TwoForm where toFun := targetTwo map_add' c d := by funext i j @@ -129,10 +129,11 @@ theorem targetTwo_rationalCoeffRep (α : Fin 3 → F₂) : placeB, rZeroCoeff, rOneCoeff, rInfinityCoeff, Fin.sum_univ_succ] /-- The seven-dimensional subspace of target Hankel two-forms. -/ +@[expose] def targetTwoSpace : Submodule F₂ TwoForm := LinearMap.range targetTwoLinear /-- The two-form is the exterior product of two linear forms. -/ -def IsDecomposableTwo (q : TwoForm) : Prop := +@[expose] def IsDecomposableTwo (q : TwoForm) : Prop := ∃ u v : LinearForm, q = vectorWedge u v theorem targetTwoSpace_finrank : Module.finrank F₂ targetTwoSpace = 7 := by diff --git a/LeanPool/BooleanMultiplication/N4/UsefulWitness.lean b/LeanPool/BooleanMultiplication/N4/UsefulWitness.lean index 4e782376b7..bc73fb1ba5 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 d273329c1c..06260dbae5 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 a2ae8b58fc..d27943c679 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 dd0f699a30..40c642ee45 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 4920c0ef4d..ee831ad84e 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 2f23d0d335..0b30836b67 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/BrillNoetherGraphs.lean b/LeanPool/BrillNoetherGraphs.lean index 46bf810fca..22c8168110 100644 --- a/LeanPool/BrillNoetherGraphs.lean +++ b/LeanPool/BrillNoetherGraphs.lean @@ -551,7 +551,7 @@ Tags: brill-noether-theory, graph-theory, chip-firing, tropical-geometry MSC: 14T15, 05C50 -/ -@[expose] public section +public section /- Upstream attribution notices: diff --git a/LeanPool/BrillNoetherGraphs/Bananas.lean b/LeanPool/BrillNoetherGraphs/Bananas.lean index d847001db3..05a3f6c795 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas.lean @@ -218,4 +218,4 @@ public import LeanPool.BrillNoetherGraphs.Bananas.ChainOfLoops.Highlights /-! # Bananas -/ -@[expose] public section +public section diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Basics.lean b/LeanPool/BrillNoetherGraphs/Bananas/Basics.lean index f8c75b9e59..7bf6641347 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Basics.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Basics.lean @@ -19,4 +19,4 @@ public import LeanPool.BrillNoetherGraphs.Bananas.Basics.TwoEdgeCuts /-! Supporting modules for Brill–Noether theory and gonality of finite graphs. -/ -@[expose] public section +public section diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Basics/BananaBasics.lean b/LeanPool/BrillNoetherGraphs/Bananas/Basics/BananaBasics.lean index ea2859de45..7ca7fae96c 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Basics/BananaBasics.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Basics/BananaBasics.lean @@ -17,7 +17,7 @@ arbitrary orientation. These lemmas certify that `strandVertex` repairs that choice and agrees with the paper's common two-endpoint coordinates. -/ -@[expose] public section +public section namespace Bananas @@ -84,6 +84,7 @@ theorem strandVertex_length {g : ℕ} (B : Banana g) (α : Fin (g + 1)) : `SubdivisionGraph.Spec` allows a slot to be stored in either orientation; this picks out whichever raw path position `strandVertex` actually reads from. -/ +@[expose] def normalizedPathPosition {g : ℕ} (B : Banana g) (α : Fin (g + 1)) (i : B.PathPosition α) : B.PathPosition α := if B.core.tail α = 0 then i else diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Basics/BananaGeometry.lean b/LeanPool/BrillNoetherGraphs/Bananas/Basics/BananaGeometry.lean index d3fc0b85c0..644f42de8d 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Basics/BananaGeometry.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Basics/BananaGeometry.lean @@ -19,7 +19,7 @@ their presentation as positive subdivisions of a two-vertex parallel-edge core. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Basics/BananaSameStrandLemma.lean b/LeanPool/BrillNoetherGraphs/Bananas/Basics/BananaSameStrandLemma.lean index 31ff557727..05fb96754b 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Basics/BananaSameStrandLemma.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Basics/BananaSameStrandLemma.lean @@ -26,7 +26,7 @@ divisor has rank zero, so the displayed four-alternative claim fails for three suitable points on a cycle. -/ -@[expose] public section +public section namespace Bananas @@ -36,11 +36,13 @@ open Utilities.Certificate.SubdivisionGraph.Spec /-- A physical vertex lies on the normalized strand `alpha`. Unlike a raw coordinate equality, this treats the two common endpoints invariantly. -/ +@[expose] def VertexOnBananaStrand {g : ℕ} (B : Banana g) (alpha : Fin (g + 1)) (x : B.graph.V) : Prop := ∃ p : B.PathPosition alpha, x = strandVertex B alpha p /-- Three physical vertices lie on one common banana strand. -/ +@[expose] def VerticesOnCommonBananaStrand {g : ℕ} (B : Banana g) (x y z : B.graph.V) : Prop := ∃ alpha : Fin (g + 1), diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Basics/Definitions.lean b/LeanPool/BrillNoetherGraphs/Bananas/Basics/Definitions.lean index eccd484853..4cd590af4a 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Basics/Definitions.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Basics/Definitions.lean @@ -18,7 +18,7 @@ two core vertices and `g + 1` distinct edge slots. Thus parallel strands are retained by construction, rather than identified as a simple graph. -/ -@[expose] public section +public section namespace Bananas @@ -35,6 +35,7 @@ abbrev Banana (g : ℕ) := Spec 2 (g + 1) core with `g + 1` parallel strands, none of which is a loop. This is the coordinate-first constructor behind the notation `B_{n₀,…,nₑ}` and, at `g = 2`, `θ_{a,b,c}`. -/ +@[expose] def bananaOfLengths (g : ℕ) (length : Fin (g + 1) → ℕ) (hpos : ∀ i, 0 < length i) : Banana g where core := { tail := fun _ => 0, head := fun _ => 1 } @@ -46,6 +47,7 @@ def bananaOfLengths (g : ℕ) (length : Fin (g + 1) → ℕ) /-- The vertex at position `i` along strand `α`, measured from core vertex `0`. `SubdivisionGraph.Spec` allows an individual slot to be stored in either orientation, so this deliberately reverses its coordinate when necessary. -/ +@[expose] def strandVertex {g : ℕ} (B : Banana g) (α : Fin (g + 1)) (i : B.PathPosition α) : B.graph.V := B.pathVertex α @@ -55,6 +57,7 @@ def strandVertex {g : ℕ} (B : Banana g) (α : Fin (g + 1)) omega⟩) /-- Reflection of a normalized strand coordinate about its midpoint. -/ +@[expose] def strandMirror {g : ℕ} (B : Banana g) (α : Fin (g + 1)) (i : B.PathPosition α) : B.PathPosition α := ⟨B.length α - i.val, by @@ -62,8 +65,10 @@ def strandMirror {g : ℕ} (B : Banana g) (α : Fin (g + 1)) omega⟩ /-- The two multivalent vertices of a banana. -/ +@[expose] def leftEndpoint {g : ℕ} (B : Banana g) : B.graph.V := B.coreVertex 0 /-- The right multivalent endpoint of the banana graph. -/ +@[expose] def rightEndpoint {g : ℕ} (B : Banana g) : B.graph.V := B.coreVertex 1 /-- A graph with an ordered pair of marked vertices. -/ @@ -81,22 +86,26 @@ abbrev mark (G : CFGraph) (u v : G.V) : TwiceMarked := ⟨G, u, v⟩ /-- Paper source: `def-Delt` (Definition 2.8), the function `Δ(D)`. The paper's second rank difference, relative to the two marks. -/ +@[expose] noncomputable def rankDelta (M : TwiceMarked) (D : CFDiv M.graph) : ℤ := rank M.graph D - rank M.graph (D - oneChip M.u) - rank M.graph (D - oneChip M.v) + rank M.graph (D - oneChip M.u - oneChip M.v) /-- Paper source: `def-Twist` (Definition 2.7). -/ +@[expose] def twist (M : TwiceMarked) (D : CFDiv M.graph) (a b : ℤ) : CFDiv M.graph := D + a • oneChip M.u + b • oneChip M.v /-- Paper source: `def-submod` (Definition 2.9). Submodularity of a divisor, including all of its marked twists. -/ +@[expose] def Submodular (M : TwiceMarked) (D : CFDiv M.graph) : Prop := ∀ a b : ℤ, 0 ≤ rankDelta M (twist M D a b) /-- Every divisor is submodular for this marked graph. -/ +@[expose] def AllSubmodular (M : TwiceMarked) : Prop := ∀ D : CFDiv M.graph, Submodular M D @@ -104,6 +113,7 @@ def AllSubmodular (M : TwiceMarked) : Prop := definition (Definition 1.10), *not* the torsion order of `def-TwMkGraph`. A positive `k` kills the degree-zero class of the marked-point difference. -/ +@[expose] def TorsionWitness (M : TwiceMarked) (k : ℕ) : Prop := 0 < k ∧ linearEquiv M.graph ((k : ℤ) • (oneChip M.u - oneChip M.v)) 0 @@ -111,6 +121,7 @@ def TorsionWitness (M : TwiceMarked) (k : ℕ) : Prop := /-- Paper source: `def-TwMkGraph` (Definition 2.6), the torsion order. The torsion order is the least positive `k` killing the marked difference. -/ +@[expose] def IsTorsionOrder (M : TwiceMarked) (k : ℕ) : Prop := TorsionWitness M k ∧ ∀ m : ℕ, TorsionWitness M m → k ≤ m @@ -122,6 +133,7 @@ instead of using a separate affine-permutation structure. Note that the main library models the same notion by `AspPerm` together with `Utilities.SatisfiesTransmission`; the two presentations are not yet connected by any lemma. -/ +@[expose] def IsTransmissionPermutation (M : TwiceMarked) (D : CFDiv M.graph) (τ : ℤ → ℤ) : Prop := Function.Bijective τ ∧ ∀ a b : ℤ, @@ -130,6 +142,7 @@ def IsTransmissionPermutation (M : TwiceMarked) (D : CFDiv M.graph) /-- Paper source: `def-EA` (Definition 2.10), membership in the extended affine symmetric group `\widetilde{Sigma}_k`. -/ +@[expose] def IsKAffine (k : ℕ) (τ : ℤ → ℤ) : Prop := ∀ n : ℤ, τ (n + k) = τ n + k @@ -139,10 +152,12 @@ The paper's `k`-inversions are `k`-equivalence classes of inversions, where `(a,b) ∼ (a',b')` iff `a - a' = b - b'` and `a ≡ a' (mod k)`. Each class has a unique representative with `0 ≤ a < k`, and this set of representatives is what is recorded here. -/ +@[expose] def kInversions (k : ℕ) (τ : ℤ → ℤ) : Set (ℤ × ℤ) := { p | p.1 < p.2 ∧ τ p.1 > τ p.2 ∧ 0 ≤ p.1 ∧ p.1 < k } /-- Paper source: `def-inv` (Definition 2.13), the number `inv_k(τ)`. -/ +@[expose] noncomputable def kInversionCount (k : ℕ) (τ : ℤ → ℤ) : ℕ := (kInversions k τ).ncard @@ -155,6 +170,7 @@ the count bound would be satisfied vacuously by a permutation with infinitely many `k`-inversions. (Finiteness is in fact automatic here — see `kInversions_finite_of_isKAffine` — but only because of the other conjuncts.) -/ +@[expose] def KGeneralTransmission (M : TwiceMarked) (k : ℕ) : Prop := TorsionWitness M k ∧ AllSubmodular M ∧ ∀ D : CFDiv M.graph, ∃ τ : ℤ → ℤ, @@ -171,6 +187,7 @@ the paper records as open outside small genus. Building it into the definition would silently strengthen every hypothesis `BrillNoetherGeneral G` and, more importantly, weaken every conclusion of the form `¬ BrillNoetherGeneral G`. -/ +@[expose] def BrillNoetherGeneral (G : CFGraph) : Prop := ∀ r d : ℤ, 0 ≤ r → BNExists G r d → 0 ≤ bnNumber G r d @@ -182,6 +199,7 @@ The bounds are stated over `ℤ`. The paper places no order relation on `i` and `j`, and with truncated `ℕ` subtraction the constraint `j - i ≤ q` would collapse to `0 ≤ q` whenever `j < i`; the `ℕ` reading therefore only agrees with the paper's set when `i ≤ j`. -/ +@[expose] def thetaExceptionalPositions {g : ℕ} (B : Banana g) (α : Fin (g + 1)) (i j : B.PathPosition α) : Set (B.PathPosition α) := { q | (q.val : ℤ) ≠ (B.length α : ℤ) - (i.val : ℤ) ∧ @@ -193,6 +211,7 @@ def thetaExceptionalPositions {g : ℕ} (B : Banana g) (α : Fin (g + 1)) Two interior marks on distinct theta strands divide their strands in the same rational ratio. Cross multiplication avoids a division convention. -/ +@[expose] def EvenlyMarkedTheta (B : Banana 2) (α β : Fin 3) (i : B.PathPosition α) (j : B.PathPosition β) : Prop := α ≠ β ∧ 0 < i.val ∧ i.val < B.length α ∧ 0 < j.val ∧ j.val < B.length β ∧ diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Basics/DegreeOneRepresentatives.lean b/LeanPool/BrillNoetherGraphs/Bananas/Basics/DegreeOneRepresentatives.lean index 2e27efe96a..e485fba639 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Basics/DegreeOneRepresentatives.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Basics/DegreeOneRepresentatives.lean @@ -16,7 +16,7 @@ rank-zero, degree-one divisor class is represented by one vertex; on a nontrivial banana that vertex is unique. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Basics/GraphIsoCuts.lean b/LeanPool/BrillNoetherGraphs/Bananas/Basics/GraphIsoCuts.lean index 88873eec00..3837ba90d6 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Basics/GraphIsoCuts.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Basics/GraphIsoCuts.lean @@ -18,7 +18,7 @@ normal forms. Keeping this at the graph-isomorphism layer avoids rebuilding the same finite-cut argument for every presentation theorem. -/ -@[expose] public section +public section namespace Utilities diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Basics/MarkedIso.lean b/LeanPool/BrillNoetherGraphs/Bananas/Basics/MarkedIso.lean index bd79501617..9f6eb00a1e 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Basics/MarkedIso.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Basics/MarkedIso.lean @@ -13,7 +13,7 @@ public import LeanPool.BrillNoetherGraphs.Utilities.Iso.GraphIso # Second rank differences under marked graph isomorphism -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Basics/ReducedCutCriterion.lean b/LeanPool/BrillNoetherGraphs/Bananas/Basics/ReducedCutCriterion.lean index f270392b7c..8e99fa2c81 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Basics/ReducedCutCriterion.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Basics/ReducedCutCriterion.lean @@ -16,7 +16,7 @@ packages the only finite-set calculation it needs: a strict total chip versus boundary inequality produces the pointwise witness required by `qReduced`. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Basics/SegmentScript.lean b/LeanPool/BrillNoetherGraphs/Bananas/Basics/SegmentScript.lean index f05f1137e3..3f58f43f93 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Basics/SegmentScript.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Basics/SegmentScript.lean @@ -23,7 +23,7 @@ consumes the chips at path positions `lo` and `hi` and produces chips at `target` and its mirror `lo + hi - target`. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Basics/TwoEdgeCuts.lean b/LeanPool/BrillNoetherGraphs/Bananas/Basics/TwoEdgeCuts.lean index 49c35fe0f4..e0864a1f02 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Basics/TwoEdgeCuts.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Basics/TwoEdgeCuts.lean @@ -18,7 +18,7 @@ same side. The remaining interval classification is deliberately kept separate from this cardinality fact. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/ChainOfLoops.lean b/LeanPool/BrillNoetherGraphs/Bananas/ChainOfLoops.lean index b96ae58bf6..5129014d44 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/ChainOfLoops.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/ChainOfLoops.lean @@ -13,4 +13,4 @@ public import LeanPool.BrillNoetherGraphs.Bananas.ChainOfLoops.Highlights /-! Supporting modules for Brill–Noether theory and gonality of finite graphs. -/ -@[expose] public section +public section diff --git a/LeanPool/BrillNoetherGraphs/Bananas/ChainOfLoops/BridgeChainTransport.lean b/LeanPool/BrillNoetherGraphs/Bananas/ChainOfLoops/BridgeChainTransport.lean index cdd219299b..9d011ac520 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/ChainOfLoops/BridgeChainTransport.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/ChainOfLoops/BridgeChainTransport.lean @@ -11,7 +11,7 @@ public import LeanPool.BrillNoetherGraphs.Utilities.Gluing.BridgeContraction /-! # Bridge Chain Transport -/ -@[expose] public section +public section open Utilities @@ -27,6 +27,7 @@ abbrev bridge (M N : MarkedGraph.{u}) : MarkedGraph.{u} where right := Sum.inr N.right /-- Attach each graph in the list by a bridge, starting from the given marked graph. -/ +@[expose] def bridgeChain (M : MarkedGraph.{u}) : List MarkedGraph.{u} → MarkedGraph.{u} | [] => M | N :: rest => bridgeChain (M.bridge N) rest @@ -35,6 +36,7 @@ end Utilities.MarkedGraph namespace Bananas /-- Reassociate a bridge followed by a vertex wedge without changing the graph. -/ +@[expose] noncomputable def bridgeWedgeAssocIso (M N K : MarkedGraph.{u}) : CFGraphIso ((M.bridge N).wedge K).graph (M.bridge (N.wedge K)).graph := by change CFGraphIso diff --git a/LeanPool/BrillNoetherGraphs/Bananas/ChainOfLoops/CDPR.lean b/LeanPool/BrillNoetherGraphs/Bananas/ChainOfLoops/CDPR.lean index 170a1e7cb7..0a4412d53d 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/ChainOfLoops/CDPR.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/ChainOfLoops/CDPR.lean @@ -76,7 +76,7 @@ at `v_0` under the prefix budget reports immediate counterexamples at `g = 2` (`ℓ_1 = m_1`, torsion order two, so `2 v_0` has rank one). -/ -@[expose] public section +public section namespace ChainOfLoops @@ -104,6 +104,7 @@ namespace Loop /-- The loop as a genus-one banana, i.e. a cycle: two parallel strands of lengths `top` and `bot` between the two junction vertices. -/ +@[expose] noncomputable def banana (P : Loop) : Banana 1 := bananaOfLengths 1 ![P.top, P.bot] (by intro i @@ -118,6 +119,7 @@ noncomputable def banana (P : Loop) : Banana 1 := /-- The torsion order of `(loop, v_{i-1}, v_i)`: the order of the class of `v_i - v_{i-1}` in the Jacobian of the cycle, which is `(ℓ+m)/gcd(ℓ,m)` (`Bananas.cycle_isTorsionOrder`, Pflueger--Solomon Example 1.11). -/ +@[expose] def torsionOrder (P : Loop) : ℕ := (P.top + P.bot) / Nat.gcd P.top P.bot /-! ### The reduced pair `(ℓ/d, m/d)` @@ -186,6 +188,7 @@ theorem reduced_mul_eq_mul (P : Loop) {p q : ℕ} (heq : P.top * q = P.bot * p) /-- The loop packaged as a chain factor, carrying its `k`-general transmission at `k = torsionOrder`. -/ +@[expose] noncomputable def factor (P : Loop) : KGeneralChainFactor where marked := ⟨P.banana.graph, leftEndpoint P.banana, rightEndpoint P.banana⟩ period := P.torsionOrder @@ -220,10 +223,12 @@ on the nose: `List.map_map` is not a definitional equality, so writing the list as `(L.map Loop.factor).map KGeneralChainFactor.marked` rather than the fused `L.map (·.factor.marked)` is what lets the bananas conclusions and the reversal isomorphism apply without any list transport. -/ +@[expose] noncomputable def chainMarked (P : Loop) (L : List Loop) : MarkedGraph := P.factor.marked.chain ((L.map Loop.factor).map KGeneralChainFactor.marked) /-- The underlying graph of a chain of loops. -/ +@[expose] noncomputable def chainGraph (P : Loop) (L : List Loop) : CFGraph := (chainMarked P L).graph @@ -285,6 +290,7 @@ the ratio of two positive integers whose sum is at most `2g - 2`. Cross multiplication avoids a division convention, exactly as in `Bananas.EvenlyMarkedTheta`. -/ +@[expose] def CDPRGeneric (L : List Loop) : Prop := ∀ P ∈ L, ∀ p q : ℕ, 0 < p → 0 < q → p + q ≤ 2 * L.length - 2 → P.top * q ≠ P.bot * p diff --git a/LeanPool/BrillNoetherGraphs/Bananas/ChainOfLoops/CommonPeriodGonality.lean b/LeanPool/BrillNoetherGraphs/Bananas/ChainOfLoops/CommonPeriodGonality.lean index 478dca785c..5a993c9761 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/ChainOfLoops/CommonPeriodGonality.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/ChainOfLoops/CommonPeriodGonality.lean @@ -19,7 +19,7 @@ the vertex-wedge chain, where common-period `k`-general transmission composes; contracting every displayed bridge preserves degree and rank. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/ChainOfLoops/Highlights.lean b/LeanPool/BrillNoetherGraphs/Bananas/ChainOfLoops/Highlights.lean index 93ff56fffa..7922c9a8c7 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/ChainOfLoops/Highlights.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/ChainOfLoops/Highlights.lean @@ -37,7 +37,7 @@ vertex. -/ -@[expose] public section +public section namespace ChainOfLoops.Highlights diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Classification.lean b/LeanPool/BrillNoetherGraphs/Bananas/Classification.lean index 1197562661..c4ef70f6c4 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Classification.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Classification.lean @@ -29,4 +29,4 @@ public import LeanPool.BrillNoetherGraphs.Bananas.Classification.WeierstrassPart /-! Supporting modules for Brill–Noether theory and gonality of finite graphs. -/ -@[expose] public section +public section diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Classification/BridgelessDegreeOneClasses.lean b/LeanPool/BrillNoetherGraphs/Bananas/Classification/BridgelessDegreeOneClasses.lean index 32b038571d..beed7ed3db 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Classification/BridgelessDegreeOneClasses.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Classification/BridgelessDegreeOneClasses.lean @@ -18,7 +18,7 @@ explicitly: for the one-vertex edgeless graph the cut condition is vacuous, but its unique degree-one class has rank one rather than rank zero. -/ -@[expose] public section +public section namespace Bananas @@ -70,6 +70,7 @@ theorem rank_one_chip_eq_zero_of_twoEdgeCutCondition /-- The rank-zero part of the degree-one Picard component, represented in the additive quotient model used throughout the formalization. -/ +@[expose] def RankZeroDegreeOneClass (G : CFGraph) := {c : CFDiv G ⧸ principalDivisors G // ∃ D : CFDiv G, diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Classification/BridgelessGenusOneTopology.lean b/LeanPool/BrillNoetherGraphs/Bananas/Classification/BridgelessGenusOneTopology.lean index 5c1c2d86dc..f9aa57f5b8 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Classification/BridgelessGenusOneTopology.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Classification/BridgelessGenusOneTopology.lean @@ -16,7 +16,7 @@ two-regular. This is the numerical cycle property needed by an explicit cycle-presentation construction. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Classification/BridgelessGenusTwoClassification.lean b/LeanPool/BrillNoetherGraphs/Bananas/Classification/BridgelessGenusTwoClassification.lean index cceb6b4b53..575f13448e 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Classification/BridgelessGenusTwoClassification.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Classification/BridgelessGenusTwoClassification.lean @@ -38,7 +38,7 @@ in `Bananas/MarkedIso.lean`; `twoEdgeCutCondition_map_iff` in `Bananas/GraphIsoCuts.lean`), so no new transport lemma is needed here. -/ -@[expose] public section +public section namespace Bananas @@ -51,6 +51,7 @@ non-recurrent coordinates in one of three families; vertex gluing of two equal-torsion-order cycles; vertex gluing of a length-two cycle at both its vertices) as an isomorphism-transported disjunction between the theta and wedge normal forms. -/ +@[expose] def BridgelessGenusTwoKGeneralCharacterization (G : CFGraph.{0}) (u v : G.V) (k : ℕ) : Prop := (∃ (B : Banana 2) (φ : CFGraphIso G B.graph) diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Classification/BridgelessGenusTwoCornerAlgebra.lean b/LeanPool/BrillNoetherGraphs/Bananas/Classification/BridgelessGenusTwoCornerAlgebra.lean index 8ca2566cc4..fadd342d75 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Classification/BridgelessGenusTwoCornerAlgebra.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Classification/BridgelessGenusTwoCornerAlgebra.lean @@ -19,7 +19,7 @@ The hypotheses isolate exactly what bridgelessness supplies: every one-chip divisor has rank zero. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Classification/BridgelessGenusTwoDegreeShape.lean b/LeanPool/BrillNoetherGraphs/Bananas/Classification/BridgelessGenusTwoDegreeShape.lean index dae523d397..8552221b86 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Classification/BridgelessGenusTwoDegreeShape.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Classification/BridgelessGenusTwoDegreeShape.lean @@ -17,7 +17,7 @@ valence shapes. It is deliberately independent of any bivalent-suppression construction: those shapes are invariants of the original graph as well. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Classification/BridgelessGenusTwoKGeneralReduction.lean b/LeanPool/BrillNoetherGraphs/Bananas/Classification/BridgelessGenusTwoKGeneralReduction.lean index e9e9747d17..cff2ddaf8e 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Classification/BridgelessGenusTwoKGeneralReduction.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Classification/BridgelessGenusTwoKGeneralReduction.lean @@ -18,7 +18,7 @@ theorem, there is no bivalent-path suppression or graph-isomorphism transport left to prove. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Classification/BridgelessGenusTwoNonrecurrence.lean b/LeanPool/BrillNoetherGraphs/Bananas/Classification/BridgelessGenusTwoNonrecurrence.lean index 92c8c57bff..dc3298d62c 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Classification/BridgelessGenusTwoNonrecurrence.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Classification/BridgelessGenusTwoNonrecurrence.lean @@ -19,7 +19,7 @@ unique vertex representative. This module packages that argument with the library's `TwoEdgeCutCondition` as the no-bridge hypothesis. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Classification/BridgelessGenusTwoPseudocore.lean b/LeanPool/BrillNoetherGraphs/Bananas/Classification/BridgelessGenusTwoPseudocore.lean index 4fdab11e4b..2cc4f93056 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Classification/BridgelessGenusTwoPseudocore.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Classification/BridgelessGenusTwoPseudocore.lean @@ -23,7 +23,7 @@ vertices; bivalent semantic-loop markers are retained by the pseudocore construction rather than accidentally suppressed. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Classification/BridgelessGenusTwoTopology.lean b/LeanPool/BrillNoetherGraphs/Bananas/Classification/BridgelessGenusTwoTopology.lean index c17fcf96ac..cc22138d7f 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Classification/BridgelessGenusTwoTopology.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Classification/BridgelessGenusTwoTopology.lean @@ -18,7 +18,7 @@ have valence at least two. This module records that reduction and its sharp genus-two topological-vertex bound. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Classification/CorrectedBananaSimple.lean b/LeanPool/BrillNoetherGraphs/Bananas/Classification/CorrectedBananaSimple.lean index 41ab1ed37d..02a2fd34ea 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Classification/CorrectedBananaSimple.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Classification/CorrectedBananaSimple.lean @@ -25,7 +25,7 @@ mark is the midpoint of a distinct length-two strand, or an explicit divisor has negative marked rank difference. -/ -@[expose] public section +public section namespace Bananas @@ -33,6 +33,7 @@ open Utilities /-- A normalized banana-strand position lies at graph distance at least two from each of the two multivalent vertices. -/ +@[expose] def FarFromBananaEndpoints {g : ℕ} (B : Banana g) (alpha : Fin (g + 1)) (p : B.PathPosition alpha) : Prop := 2 ≤ p.val ∧ p.val + 2 ≤ B.length alpha @@ -40,6 +41,7 @@ def FarFromBananaEndpoints {g : ℕ} (B : Banana g) (alpha : Fin (g + 1)) /-- The extra exceptional family missing from the published Theorem 1.16: one of the marks is the midpoint of a length-two strand distinct from the strand containing the other mark. -/ +@[expose] def CorrectedBananaSimpleException {g : ℕ} (B : Banana g) (alpha beta : Fin (g + 1)) (i : B.PathPosition alpha) (j : B.PathPosition beta) : Prop := diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Classification/CorrectedBananaTheorem117.lean b/LeanPool/BrillNoetherGraphs/Bananas/Classification/CorrectedBananaTheorem117.lean index fb1903a75c..cadeabef91 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Classification/CorrectedBananaTheorem117.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Classification/CorrectedBananaTheorem117.lean @@ -24,7 +24,7 @@ assembly then combines the remaining `g ≤ k` branch with the banana Brill--Noether obstruction. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Classification/CorrectedBananaTorsion.lean b/LeanPool/BrillNoetherGraphs/Bananas/Classification/CorrectedBananaTorsion.lean index 8b7123a0f9..69ce8d1625 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Classification/CorrectedBananaTorsion.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Classification/CorrectedBananaTorsion.lean @@ -20,7 +20,7 @@ midpoint strands need only have length two; the other may have any even length. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Classification/CorrectedMidpointKGeneral.lean b/LeanPool/BrillNoetherGraphs/Bananas/Classification/CorrectedMidpointKGeneral.lean index ed4a91fba1..e5a8c92722 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Classification/CorrectedMidpointKGeneral.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Classification/CorrectedMidpointKGeneral.lean @@ -24,7 +24,7 @@ endpoint pencil. The marked graph therefore has exact torsion order two and has `2`-general transmission. -/ -@[expose] public section +public section namespace Bananas @@ -33,6 +33,7 @@ open Utilities /-- The corrected exceptional family in Proposition 4.19 and Corollary 6.4: the marks lie at midpoints of distinct strands, and at least one of the two strands has length two. -/ +@[expose] def CorrectedMidpointException {g : ℕ} (B : Banana g) (α β : Fin (g + 1)) (i : B.PathPosition α) (j : B.PathPosition β) : Prop := α ≠ β ∧ 2 * i.val = B.length α ∧ 2 * j.val = B.length β ∧ diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Classification/GenusOneKGeneral.lean b/LeanPool/BrillNoetherGraphs/Bananas/Classification/GenusOneKGeneral.lean index 3b23b38a9f..338715e7c2 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Classification/GenusOneKGeneral.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Classification/GenusOneKGeneral.lean @@ -36,7 +36,7 @@ The `k = 1` case is separated out because `affineReflection` needs `2 ≤ k`. There every index is principal, so `τ` is again a translation. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Classification/GenusOneRankDelta.lean b/LeanPool/BrillNoetherGraphs/Bananas/Classification/GenusOneRankDelta.lean index 58b7291dfb..4ddb6f0f55 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Classification/GenusOneRankDelta.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Classification/GenusOneRankDelta.lean @@ -19,7 +19,7 @@ rank-theoretic core needed to identify genus-one transmission permutations as an affine translation with at most one adjacent interchange. -/ -@[expose] public section +public section namespace Bananas @@ -177,6 +177,7 @@ theorem rankDelta_genusOne_of_degree_gt_two ring /-- The degree-zero member of the marked twist orbit at index `b`. -/ +@[expose] def genusOneZeroTwist (D : CFDiv G) (b : ℤ) : CFDiv G := D + (b - CFDiv.degree D) • oneChip u - b • oneChip v diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Classification/GenusTwoDegreeTwo.lean b/LeanPool/BrillNoetherGraphs/Bananas/Classification/GenusTwoDegreeTwo.lean index e2b84dc294..fe619d3d96 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Classification/GenusTwoDegreeTwo.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Classification/GenusTwoDegreeTwo.lean @@ -17,7 +17,7 @@ them at an abstract graph prevents later theta proofs from unfolding concrete subdivision vertices during divisor algebra. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Classification/GenusTwoReduction.lean b/LeanPool/BrillNoetherGraphs/Bananas/Classification/GenusTwoReduction.lean index fe2df1e273..0d165f6170 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Classification/GenusTwoReduction.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Classification/GenusTwoReduction.lean @@ -20,7 +20,7 @@ a negative marked second difference on a genus-two graph with inequivalent marks is necessarily represented in degree two. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Classification/PointedGenusOneKGeneral.lean b/LeanPool/BrillNoetherGraphs/Bananas/Classification/PointedGenusOneKGeneral.lean index 20009b150d..7899522d33 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Classification/PointedGenusOneKGeneral.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Classification/PointedGenusOneKGeneral.lean @@ -19,7 +19,7 @@ genus-one transmission theorem, this turns an exact torsion calculation on a cycle factor directly into `KGeneralTransmission`. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Classification/SciWeierstrass.lean b/LeanPool/BrillNoetherGraphs/Bananas/Classification/SciWeierstrass.lean index 366193a6c1..959e67d48b 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Classification/SciWeierstrass.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Classification/SciWeierstrass.lean @@ -19,7 +19,7 @@ transmission permutation is the size of the Weierstrass partition at its second marked point. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Classification/WeierstrassPartition.lean b/LeanPool/BrillNoetherGraphs/Bananas/Classification/WeierstrassPartition.lean index 299b6c55c0..fb664e9fb1 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Classification/WeierstrassPartition.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Classification/WeierstrassPartition.lean @@ -28,18 +28,20 @@ is a minimum. The parts are weakly decreasing and vanish from row `genus G` onward, hence define an honest finite `YoungDiagram`. -/ -@[expose] public section +public section namespace Bananas open Utilities /-- The integers at which the pointed rank has reached row `i`. -/ +@[expose] def poleOrderSet (G : CFGraph) (v : G.V) (D : CFDiv G) (i : ℕ) : Set ℤ := {ell | (i : ℤ) ≤ rank G (D + ell • oneChip v)} /-- Definition 1.6: the least twist at the marked point having rank at least `i`. -/ +@[expose] noncomputable def poleOrder (G : CFGraph) (v : G.V) (D : CFDiv G) (i : ℕ) : ℤ := sInf (poleOrderSet G v D i) @@ -214,6 +216,7 @@ theorem poleOrder_succ_le {G : CFGraph} (hG : _root_.graphConnected G) omega /-- The integer underlying the `i`th Weierstrass part. -/ +@[expose] noncomputable def weierstrassPartInt (G : CFGraph) (v : G.V) (D : CFDiv G) (i : ℕ) : ℤ := (i : ℤ) + CFGraph.genus G - CFDiv.degree D - poleOrder G v D i @@ -226,6 +229,7 @@ theorem weierstrassPartInt_nonneg {G : CFGraph} (hG : _root_.graphConnected G) omega /-- Definition 1.6: the `i`th part of the Weierstrass partition. -/ +@[expose] noncomputable def weierstrassPart (G : CFGraph) (v : G.V) (D : CFDiv G) (i : ℕ) : ℕ := (weierstrassPartInt G v D i).toNat @@ -398,6 +402,7 @@ private theorem card_cellsOfRowLens (rows : List ℕ) : omega /-- Definition 1.6: the finite size `|lambda(D,v)|`. -/ +@[expose] noncomputable def weierstrassSize {G : CFGraph} (hG : _root_.graphConnected G) (v : G.V) (D : CFDiv G) : ℕ := (weierstrassPartition hG v D).card diff --git a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff.lean b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff.lean index 6fa61bb3b4..d3282bf5da 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff.lean @@ -45,4 +45,4 @@ public import LeanPool.BrillNoetherGraphs.Bananas.CrossOneOff.SignChangingInvers /-! Supporting modules for Brill–Noether theory and gonality of finite graphs. -/ -@[expose] public section +public section diff --git a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/AffineInversionFinite.lean b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/AffineInversionFinite.lean index f77db5267e..4032abc558 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/AffineInversionFinite.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/AffineInversionFinite.lean @@ -12,7 +12,7 @@ public import LeanPool.BrillNoetherGraphs.Bananas.Basics.Definitions # Finiteness for periodic affine inversion sets -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/AffineReduction.lean b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/AffineReduction.lean index 9c05c1251a..745018ee4f 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/AffineReduction.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/AffineReduction.lean @@ -18,13 +18,14 @@ descent of the inverse permutation. Simultaneously swapping that adjacent pair in every residue-period removes exactly one normalized inversion class. -/ -@[expose] public section +public section namespace Bananas open Utilities /-- The support of the affine simple reflection indexed by `i` modulo `k`. -/ +@[expose] def affineReflectionSupport (k : ℕ) (i : ℤ) : Set ℤ := {n | (k : ℤ) ∣ n - i} @@ -50,6 +51,7 @@ theorem affineReflectionSupport_congr simpa only [sub_sub_sub_cancel_right] using (dvd_sub h₂ h₁) /-- The ASP permutation implementing one affine simple reflection. -/ +@[expose] noncomputable def affineReflection (k : ℕ) (i : ℤ) (hk : 2 ≤ k) : AspPerm := Transpositions.sigma (affineReflectionSupport k i) (affineReflectionSupport_noConsecutive k hk i) diff --git a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/BananaCrossOneOffDeltaFamilies.lean b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/BananaCrossOneOffDeltaFamilies.lean index 1ea73525dc..5f24e4f96d 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/BananaCrossOneOffDeltaFamilies.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/BananaCrossOneOffDeltaFamilies.lean @@ -15,7 +15,7 @@ This completes the rank-difference assertions in part (3) of paper Corollary 2.25. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/BananaOneOffDeltaFamilies.lean b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/BananaOneOffDeltaFamilies.lean index 473f021d2a..8756808eeb 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/BananaOneOffDeltaFamilies.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/BananaOneOffDeltaFamilies.lean @@ -15,7 +15,7 @@ This completes part (2) of paper Corollary 2.25 for the marking consisting of the common left endpoint and the penultimate point of one strand. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffArithmetic.lean b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffArithmetic.lean index d1a84ae4c6..2eb742d00e 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffArithmetic.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffArithmetic.lean @@ -23,7 +23,7 @@ belong to three different congruence classes; in particular, its second bound is not asserted for every integer below the cutoff. -/ -@[expose] public section +public section namespace Bananas @@ -31,11 +31,13 @@ open Utilities /-- The largest natural number in the interval `b ≤ (n / (n - 1)) g`, for `1 < n`. -/ +@[expose] def crossOneOffCutoff (g n : ℕ) : ℕ := g + g / (n - 1) /-- A precise, uniform version of the paper's phrase "the first marked strand is sufficiently long relative to the genus". The minimal integral threshold needed for the corrected block is `g + 1 + g / (n₁ - 1) ≤ n₀`. -/ +@[expose] def CrossOneOffLongEnough (g n₀ n₁ : ℕ) : Prop := g + 1 + g / (n₁ - 1) ≤ n₀ diff --git a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffBlock.lean b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffBlock.lean index 48d8ff1003..fb221c2e17 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffBlock.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffBlock.lean @@ -15,7 +15,7 @@ This file assembles the three residue-specific calculations of corrected Lemma 4.30 over the full interval guaranteed by `CrossOneOffLongEnough`. -/ -@[expose] public section +public section namespace Bananas @@ -23,6 +23,7 @@ open Utilities /-- The corrected value forced in row `b` of the both-off transmission permutation. -/ +@[expose] def crossOneOffRow (g n b : ℕ) : ℕ := if b % n = 0 then b / n + 1 else if b % n = n - 1 then g + b / n + 1 diff --git a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffCorrectedInversion.lean b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffCorrectedInversion.lean index c54654cf1a..d97d9dfc4d 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffCorrectedInversion.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffCorrectedInversion.lean @@ -17,7 +17,7 @@ arithmetic count. It is Corollary 4.31 with the corrected row block and its explicit period-separation hypothesis. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffCorrectedKGeneral.lean b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffCorrectedKGeneral.lean index 4db6b9b275..9d39236f43 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffCorrectedKGeneral.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffCorrectedKGeneral.lean @@ -18,7 +18,7 @@ as the second marked strand has length at least `g+1`. This includes the boundary length `g+1` omitted by the earlier extended-simple-block argument. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffDelta.lean b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffDelta.lean index 6fb6ed5836..e3667b8b72 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffDelta.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffDelta.lean @@ -19,7 +19,7 @@ interior chips as a semibreak divisor, shifts them after deleting a marked point, and applies the endpoint/semibreak rank formula four times. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffExtendedBlock.lean b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffExtendedBlock.lean index 9fe62c5ea7..f1420977bf 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffExtendedBlock.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffExtendedBlock.lean @@ -22,7 +22,7 @@ coordinate is one less than the final block coordinate, so `lo + length ≤ k` is enough. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffFiniteCountSol.lean b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffFiniteCountSol.lean index 786baa2529..9c6d569ae7 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffFiniteCountSol.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffFiniteCountSol.lean @@ -19,19 +19,21 @@ immediately preceding row. This is the combinatorial skeleton behind the count `choose (g - 1) 2 + g / (n - 1)`. -/ -@[expose] public section +public section namespace Bananas open Utilities /-- The preferred row with compressed coordinate `x`. -/ +@[expose] def crossOneOffColumnPosition (n x : ℕ) : ℕ := x + x / (n - 1) /-- A row strictly before the preferred row over `x`, chosen so that it is never a multiple of `n`. At a multiple of `n-1` it is the exceptional `-1`-residue row; otherwise it is the preferred row itself. -/ +@[expose] def crossOneOffPredecessorPosition (n x : ℕ) : ℕ := if x % (n - 1) = 0 then crossOneOffColumnPosition n x - 1 else crossOneOffColumnPosition n x @@ -421,6 +423,7 @@ private theorem crossOneOffTriangularPair_mem /-- The additional adjacent high-to-low inversion over the `i`th complete column. -/ +@[expose] def crossOneOffAdjacentPair (n : ℕ) (i : ℕ) : ℕ × ℕ := ((i + 1) * n - 1, (i + 1) * n) diff --git a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffFiniteRows.lean b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffFiniteRows.lean index 68b1db52f3..410f57756e 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffFiniteRows.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffFiniteRows.lean @@ -18,7 +18,7 @@ finite-row injection precise and then specializes it to the corrected cross-one-off row function. -/ -@[expose] public section +public section namespace Bananas @@ -26,6 +26,7 @@ open Utilities /-- Ordered pairs of rows in `[lo, hi]` on which a finite row function is strictly decreasing. -/ +@[expose] def finiteRowInversionPairs (lo hi : ℕ) (row : ℕ → ℕ) : Finset (ℕ × ℕ) := ((Finset.Icc lo hi).product (Finset.Icc lo hi)).filter fun ij => @@ -84,6 +85,7 @@ theorem finiteRowInversionPairs_card_le_kInversionCount /-- The finite set of all ordinary inversions forced by the corrected common block `2 ≤ b ≤ crossOneOffCutoff g n`. -/ +@[expose] def crossOneOffForcedInversionPairs (g n : ℕ) : Finset (ℕ × ℕ) := finiteRowInversionPairs 2 (crossOneOffCutoff g n) (crossOneOffRow g n) @@ -117,6 +119,7 @@ theorem crossOneOff_forcedInversionPairs_card_le /-- The corrected numerical target from Corollary 4.31. Its `n = 2` branch accounts for the corrected block beginning at row `2`; for `n ≥ 3` the target is `choose (g-1) 2 + floor(g/(n-1))`. -/ +@[expose] def correctedCrossOneOffForcedCount (g n : ℕ) : ℕ := if n = 2 then Nat.choose g 2 else Nat.choose (g - 1) 2 + g / (n - 1) diff --git a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffFiring.lean b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffFiring.lean index 0977332a57..a46fcf7579 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffFiring.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffFiring.lean @@ -29,7 +29,7 @@ the divisor identities needed before applying the banana normal-form rank calculus. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffForcedCountArithmetic.lean b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffForcedCountArithmetic.lean index 218451716e..1b723c843f 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffForcedCountArithmetic.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffForcedCountArithmetic.lean @@ -16,7 +16,7 @@ This file proves the pure finite-row count left open by `crossOneOff_corrected_inversion_lower_bound_of_finiteRows`. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffForcedCountLengthTwo.lean b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffForcedCountLengthTwo.lean index f986ddb2e3..63ca06a03e 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffForcedCountLengthTwo.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffForcedCountLengthTwo.lean @@ -17,7 +17,7 @@ selects a distinct inversion: its smaller index selects an odd row and its larger index selects a later even row. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffInversions.lean b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffInversions.lean index eca034c734..626395db23 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffInversions.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffInversions.lean @@ -17,7 +17,7 @@ explicit hypothesis. This is the period-separation condition missing from the printed proof of Corollary 4.31. -/ -@[expose] public section +public section namespace Bananas @@ -25,6 +25,7 @@ open Utilities /-- Translate the standard pair embedding into a natural interval beginning at `lo`. -/ +@[expose] noncomputable def shiftedEndpointPairEmbedding (lo length : ℕ) : Sym2 (Fin length) → ℤ × ℤ := fun x => let p := endpointPairEmbedding length x diff --git a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffKGeneral.lean b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffKGeneral.lean index fd1f3cab5e..e8aebdaa83 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffKGeneral.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffKGeneral.lean @@ -20,7 +20,7 @@ order-two branch of the corrected torsion dichotomy is impossible, so a more than `genus = g` inversions as soon as `g ≥ 7`. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffPeriodSeparation.lean b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffPeriodSeparation.lean index d5dcc17b9d..0d0643d963 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffPeriodSeparation.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffPeriodSeparation.lean @@ -18,7 +18,7 @@ strand regime the zero-rise exception is impossible. Since then by the corrected finite-row inversion count. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffResidueDelta.lean b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffResidueDelta.lean index f611109baf..9a8e8f57cc 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffResidueDelta.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffResidueDelta.lean @@ -21,7 +21,7 @@ difference is zero, not one; arithmetically that boundary is exactly the paper's `N = 2, b = 1` case. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffShortStrandPeriod.lean b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffShortStrandPeriod.lean index d38b9863e1..f64891a4b8 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffShortStrandPeriod.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffShortStrandPeriod.lean @@ -29,7 +29,7 @@ strands, then a ray/primitivity argument on the two integers (`L := lcm` of the other lengths). -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffTransmission.lean b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffTransmission.lean index 0ca649cabd..3683cedd50 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffTransmission.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossOneOffTransmission.lean @@ -16,7 +16,7 @@ corresponding row of a transmission permutation. The geometric calculations are kept in the preceding modules; this file is deliberately purely formal. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossStrandNegative.lean b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossStrandNegative.lean index 943b705a82..a63da41999 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossStrandNegative.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossStrandNegative.lean @@ -16,7 +16,7 @@ The reducedness theorem supplies the rank `-1` conclusion directly; no additional rank-zero argument is bundled into it. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossStrandSupport.lean b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossStrandSupport.lean index 3e23bf562e..246d74b284 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossStrandSupport.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossStrandSupport.lean @@ -23,7 +23,7 @@ handles directly: deleting an endpoint from a semibreak divisor puts a `-1` endpoint coefficient into the normal form, and such a divisor has rank `-1`. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossingInversionCount.lean b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossingInversionCount.lean index fa202a3214..483de2be38 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossingInversionCount.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/CrossingInversionCount.lean @@ -17,7 +17,7 @@ the same affine inversion class force at least `2 * k - 1` distinct affine inversion classes. -/ -@[expose] public section +public section namespace Bananas @@ -25,6 +25,7 @@ open Utilities /-- Normalize an ordinary inversion by translating its first coordinate into the fundamental interval `[0, k)`. -/ +@[expose] def normalizeInversionFirst (k : ℕ) (p : ℤ × ℤ) : ℤ × ℤ := (p.1 % k, p.2 - (p.1 / k) * k) diff --git a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/LengthTwoCross.lean b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/LengthTwoCross.lean index c064fdbff2..11ee79fbef 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/LengthTwoCross.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/LengthTwoCross.lean @@ -15,7 +15,7 @@ public import LeanPool.BrillNoetherGraphs.Bananas.SameStrand.Semibreak midpoint, rank-difference, and dual-degree steps. -/ -@[expose] public section +public section namespace Bananas @@ -191,6 +191,7 @@ theorem rank_bananaNormalForm_remove_midpoint_chip rw [max_eq_left htop, max_eq_left htop'] /-- The drop in divisor rank when one chip is removed from the first mark. -/ +@[expose] noncomputable def basePointDrop (M : TwiceMarked) (D : CFDiv M.graph) : ℤ := rank M.graph D - rank M.graph (D - oneChip M.u) diff --git a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/LengthTwoCrossBasePoint.lean b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/LengthTwoCrossBasePoint.lean index 163cf6ef79..ad37e286a5 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/LengthTwoCrossBasePoint.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/LengthTwoCrossBasePoint.lean @@ -16,7 +16,7 @@ distinct-strand theorem. It is kept separate from the dependent semibreak update API in `LengthTwoCross`. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/LengthTwoCrossMonotonicity.lean b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/LengthTwoCrossMonotonicity.lean index 1e40d47ca0..25a42fbdd1 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/LengthTwoCrossMonotonicity.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/LengthTwoCrossMonotonicity.lean @@ -30,7 +30,7 @@ evaluating `DecidableEq` on the subdivision vertex type (a nested `Sum` of every use downstream is a syntactic `rw`/`exact`. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/OneOffInversionLowerBound.lean b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/OneOffInversionLowerBound.lean index b55215f4f9..0223faf57f 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/OneOffInversionLowerBound.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/OneOffInversionLowerBound.lean @@ -18,7 +18,7 @@ length `(n-2) * floor(g/(n-1))`, hence contribute the corresponding binomial number of distinct `k`-inversions. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/OneOffKGeneral.lean b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/OneOffKGeneral.lean index 31d115fc5b..e25f895c16 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/OneOffKGeneral.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/OneOffKGeneral.lean @@ -18,7 +18,7 @@ under which the paper's one-off row block is large enough to obstruct generality. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/OneOffMultipleRows.lean b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/OneOffMultipleRows.lean index e4bfe5a509..903d96ecfa 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/OneOffMultipleRows.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/OneOffMultipleRows.lean @@ -18,7 +18,7 @@ prefix firing reduces the marked twist of `g • rightEndpoint` to `tau(b)=m`. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/OneOffPeriodBound.lean b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/OneOffPeriodBound.lean index 313f020aa2..d4924305e4 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/OneOffPeriodBound.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/OneOffPeriodBound.lean @@ -17,7 +17,7 @@ to lie strictly beyond `g + floor(g/(n-1))`, the exact natural-number form of the paper's rational cutoff `(n/(n-1))g`. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/OneOffPositiveRows.lean b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/OneOffPositiveRows.lean index aa65476f4a..01fc05328a 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/OneOffPositiveRows.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/OneOffPositiveRows.lean @@ -23,7 +23,7 @@ must be the right endpoint. With that correction the divisor has the right degree and its marked second difference is one. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/OneOffRefinedInversion.lean b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/OneOffRefinedInversion.lean index addb4c7c34..7a1eb0540d 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/OneOffRefinedInversion.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/OneOffRefinedInversion.lean @@ -26,13 +26,14 @@ immediately before it whenever `(n-1) | x`. Every ordered pair of compressed coordinates gives an inversion, as does each additional adjacent pair. -/ -@[expose] public section +public section namespace Bananas open Utilities /-- The three rows in Lemma 4.23, written as one finite row function. -/ +@[expose] def oneOffRow (g n b : ℕ) : ℕ := if b % n = 0 then b / n else if b % n = n - 1 then g + b / n + 1 diff --git a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/OneOffTransmission.lean b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/OneOffTransmission.lean index f3f17a0f81..ab3af81567 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/OneOffTransmission.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/OneOffTransmission.lean @@ -18,7 +18,7 @@ normal form. At the divisor `g • rightEndpoint`, the resulting four ranks give `rankDelta = 1`, hence the base transmission row `tau 0 = 0`. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/QuadraticInversionGrowth.lean b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/QuadraticInversionGrowth.lean index e0a929f9cd..aa2f453041 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/QuadraticInversionGrowth.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/QuadraticInversionGrowth.lean @@ -23,7 +23,7 @@ verified length hypotheses for its endpoint, one-off, and cross-one-off families. -/ -@[expose] public section +public section namespace Bananas @@ -32,6 +32,7 @@ open Utilities /-- A marked graph has a transmission permutation with at least `q` normalized `k`-inversion classes. This is the existential lower-bound form of the paper's maximum `M`. -/ +@[expose] def HasInversionLowerBound (M : TwiceMarked) (k q : ℕ) : Prop := ∃ D : CFDiv M.graph, ∃ tau : ℤ → ℤ, IsTransmissionPermutation M D tau ∧ IsKAffine k tau ∧ diff --git a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/SignChangingInversions.lean b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/SignChangingInversions.lean index f592e35e8d..ab5b112069 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/SignChangingInversions.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/CrossOneOff/SignChangingInversions.lean @@ -54,7 +54,7 @@ and its northwest twin) plus a Riemann-Roch telescoping sum; and `thm:bngChain` (6.16) is the induction over the chain. -/ -@[expose] public section +public section namespace Bananas @@ -65,6 +65,7 @@ open Utilities A *sign-changing inversion* of `α` is a pair `u < v` with `α u > 0` and `α v ≤ 0`. Unlike an ordinary inversion this compares each value against the fixed threshold `0` rather than against the other value. -/ +@[expose] def sciSet (α : ℤ → ℤ) : Set (ℤ × ℤ) := { p | p.1 < p.2 ∧ 0 < α p.1 ∧ α p.2 ≤ 0 } @@ -74,6 +75,7 @@ As with `kInversionCount`, `Set.ncard` is `0` on an infinite set, so every statement below that bounds `sci` from above must either carry finiteness or be read only for `α` where the set is finite. For an almost-sign-preserving `α` it is automatically finite. -/ +@[expose] noncomputable def sci (α : ℤ → ℤ) : ℕ := (sciSet α).ncard theorem mem_sciSet_iff (α : ℤ → ℤ) (p : ℤ × ℤ) : diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Examples.lean b/LeanPool/BrillNoetherGraphs/Bananas/Examples.lean index 796caaaef0..bdc8b66625 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Examples.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Examples.lean @@ -11,4 +11,4 @@ public import LeanPool.BrillNoetherGraphs.Bananas.Examples.MechanicalAPIAudit /-! Supporting modules for Brill–Noether theory and gonality of finite graphs. -/ -@[expose] public section +public section diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Examples/ExampleBngChain.lean b/LeanPool/BrillNoetherGraphs/Bananas/Examples/ExampleBngChain.lean index 329ec874d1..3cb100dbf5 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Examples/ExampleBngChain.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Examples/ExampleBngChain.lean @@ -35,7 +35,7 @@ orders `4,5,5,5,3` disagree with its per-factor computations `4,4,5,5,3`; the `k`-values used here are the correct per-factor ones, and the conclusion is unaffected either way.) -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Examples/MechanicalAPIAudit.lean b/LeanPool/BrillNoetherGraphs/Bananas/Examples/MechanicalAPIAudit.lean index e82d33f71e..6874430655 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Examples/MechanicalAPIAudit.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Examples/MechanicalAPIAudit.lean @@ -18,7 +18,7 @@ library. It records the strongest reductions available from the current API; the remaining hypotheses are the graph-specific arithmetic/counting lemmas. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Jacobian.lean b/LeanPool/BrillNoetherGraphs/Bananas/Jacobian.lean index c47e1cbcfb..3b576ed417 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Jacobian.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Jacobian.lean @@ -21,4 +21,4 @@ public import LeanPool.BrillNoetherGraphs.Bananas.Jacobian.BananaTorsionSlopes /-! Supporting modules for Brill–Noether theory and gonality of finite graphs. -/ -@[expose] public section +public section diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianDiagonal.lean b/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianDiagonal.lean index f89ae612fc..75ec1e7a07 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianDiagonal.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianDiagonal.lean @@ -19,7 +19,7 @@ normalized strand slopes, so it treats arbitrary storage orientations and length-one strands uniformly. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianLatticeReduction.lean b/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianLatticeReduction.lean index 790793fc91..510e6dbf11 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianLatticeReduction.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianLatticeReduction.lean @@ -24,7 +24,7 @@ length. The lemmas here record the algebraic invariants needed by that iteration without hiding them in the full kernel of the class map. -/ -@[expose] public section +public section namespace Bananas @@ -33,6 +33,7 @@ open scoped BigOperators /-- The relation lattice displayed in Proposition 2.14: it is generated by the diagonal vector and the strand-length relations based at strand zero. -/ +@[expose] def bananaDisplayedRelations {g : ℕ} (B : Banana g) : AddSubgroup (Fin (g + 1) → ℤ) := AddSubgroup.closure @@ -145,6 +146,7 @@ theorem exists_nonnegative_zero_mod_displayedRelations {g : ℕ} /-- The displayed relation comparing arbitrary strands `alpha` and `beta`. It is the difference of the paper's two generators based at strand zero. -/ +@[expose] def bananaPairwiseLengthRelation {g : ℕ} (B : Banana g) (alpha beta : Fin (g + 1)) : Fin (g + 1) → ℤ := (B.length alpha : ℤ) • bananaCoordinateBasis alpha - diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianLeftJustification.lean b/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianLeftJustification.lean index 96323ad7d4..0c33a8e7c9 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianLeftJustification.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianLeftJustification.lean @@ -17,7 +17,7 @@ sorting pass: terminal coordinates move left of zero coordinates. The sum of the reverse indices of all zeros is a strictly decreasing natural measure. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianPresentation.lean b/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianPresentation.lean index 1eb7749c25..4dac758fa8 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianPresentation.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianPresentation.lean @@ -22,7 +22,7 @@ first-neighbor form of firing the left endpoint; that finite Laplacian identity is kept separate from the pairwise path-prefix calculation below. -/ -@[expose] public section +public section namespace Bananas @@ -33,6 +33,7 @@ open Utilities.Certificate.SubdivisionGraph.Spec /-- The degree-zero divisor representing one unit of the `alpha`th coordinate in the paper's presentation. -/ +@[expose] def bananaCoordinateStep {g : ℕ} (B : Banana g) (alpha : Fin (g + 1)) : CFDiv B.graph := oneChip (strandVertex B alpha ⟨1, by @@ -40,6 +41,7 @@ def bananaCoordinateStep {g : ℕ} (B : Banana g) (alpha : Fin (g + 1)) : omega⟩) - oneChip (leftEndpoint B) /-- The free coordinate-vector map `tphi` in the proof of Proposition 2.14. -/ +@[expose] def bananaCoordinateDivisorHom {g : ℕ} (B : Banana g) : (Fin (g + 1) → ℤ) →+ CFDiv B.graph where toFun a := ∑ alpha : Fin (g + 1), a alpha • bananaCoordinateStep B alpha @@ -63,6 +65,7 @@ def bananaCoordinateDivisorHom {g : ℕ} (B : Banana g) : is the additive quotient by principal divisors, i.e. the graph-level Picard group model used here. The preceding degree lemma shows that its image lies in the degree-zero (Jacobian) component. -/ +@[expose] def bananaCoordinateClassHom {g : ℕ} (B : Banana g) : (Fin (g + 1) → ℤ) →+ (CFDiv B.graph ⧸ principalDivisors B.graph) := @@ -72,6 +75,7 @@ def bananaCoordinateClassHom {g : ℕ} (B : Banana g) : /-- The exact relation subgroup of the graph-level coordinate map. Showing that this kernel equals the paper's displayed lattice is the injectivity half of Proposition 2.14. -/ +@[expose] def bananaCoordinateRelations {g : ℕ} (B : Banana g) : AddSubgroup (Fin (g + 1) → ℤ) := (bananaCoordinateClassHom B).ker @@ -87,6 +91,7 @@ def bananaPresentedClassHom {g : ℕ} (B : Banana g) : exact ha) /-- The standard coordinate vector `e_alpha`. -/ +@[expose] def bananaCoordinateBasis {g : ℕ} (alpha : Fin (g + 1)) : Fin (g + 1) → ℤ := fun beta => if beta = alpha then 1 else 0 @@ -98,12 +103,14 @@ def bananaCoordinateBasis {g : ℕ} (alpha : Fin (g + 1)) : simp [bananaCoordinateDivisorHom, bananaCoordinateBasis] /-- The displayed relation `n_0 e_0 - n_beta e_beta`. -/ +@[expose] def bananaStrandLengthRelation {g : ℕ} (B : Banana g) (beta : Fin (g + 1)) : Fin (g + 1) → ℤ := (B.length 0 : ℤ) • bananaCoordinateBasis (0 : Fin (g + 1)) - (B.length beta : ℤ) • bananaCoordinateBasis beta /-- The other displayed relation vector, `(1, ..., 1)`. -/ +@[expose] def bananaDiagonalRelation {g : ℕ} : Fin (g + 1) → ℤ := fun _ => 1 @[simp] theorem bananaCoordinateDivisorHom_diagonalRelation diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianProposition214.lean b/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianProposition214.lean index e658037941..00fa74cf74 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianProposition214.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianProposition214.lean @@ -20,7 +20,7 @@ representative to vanish. The first isomorphism theorem then identifies the displayed quotient with the range of the graph-level divisor-class map. -/ -@[expose] public section +public section namespace Bananas @@ -62,6 +62,7 @@ abbrev bananaCoordinateClassRange {g : ℕ} (B : Banana g) := AddMonoidHom.mrange (bananaCoordinateClassHom B) /-- The displayed-quotient map to the coordinate class range. -/ +@[expose] def bananaDisplayedClassRangeHom {g : ℕ} (B : Banana g) : ((Fin (g + 1) → ℤ) ⧸ bananaDisplayedRelations B) →+ bananaCoordinateClassRange B := @@ -98,6 +99,7 @@ theorem bananaDisplayedClassRangeHom_bijective /-- **Proposition 2.14, quotient form.** Coordinates modulo the paper's displayed lattice are additively isomorphic to the degree-zero divisor-class range of the banana graph. -/ +@[expose] noncomputable def bananaDisplayedQuotientEquivClassRange {g : ℕ} (B : Banana g) : ((Fin (g + 1) → ℤ) ⧸ bananaDisplayedRelations B) ≃+ diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianQuotientCertificate.lean b/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianQuotientCertificate.lean index 2a20c4e31f..ab4d981f2f 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianQuotientCertificate.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianQuotientCertificate.lean @@ -19,7 +19,7 @@ vector and the position vector differ by an explicit combination of the paper's displayed relation generators. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianReducedBridge.lean b/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianReducedBridge.lean index d672bfadf0..87ca9f0bfb 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianReducedBridge.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianReducedBridge.lean @@ -19,7 +19,7 @@ the right endpoint, and every nonzero coordinate contributes one unit of debt at the left endpoint. -/ -@[expose] public section +public section namespace Bananas @@ -29,6 +29,7 @@ open Utilities.Certificate SubdivisionGraph open Utilities.Certificate.SubdivisionGraph.Spec /-- The decidable numerical form of being an interior normalized position. -/ +@[expose] def IsPaperInteriorCoordinate {g : ℕ} (B : Banana g) (p : ∀ alpha : Fin (g + 1), B.PathPosition alpha) (alpha : Fin (g + 1)) : Prop := @@ -36,6 +37,7 @@ def IsPaperInteriorCoordinate {g : ℕ} (B : Banana g) /-- The storage-oriented semibreak chips encoded by a vector of normalized strand positions. -/ +@[expose] noncomputable def paperCoordinateChips {g : ℕ} (B : Banana g) (p : ∀ alpha : Fin (g + 1), B.PathPosition alpha) : ∀ alpha : Fin (g + 1), Option (Fin (B.length alpha - 1)) := @@ -49,12 +51,14 @@ def paperCoordinateLeftCoefficient {g : ℕ} (B : Banana g) ∑ alpha : Fin (g + 1), if (p alpha).val = 0 then 0 else -1 /-- One right-endpoint chip for every terminal coordinate. -/ +@[expose] def paperCoordinateRightCoefficient {g : ℕ} (B : Banana g) (p : ∀ alpha : Fin (g + 1), B.PathPosition alpha) : ℤ := ∑ alpha : Fin (g + 1), if (p alpha).val = B.length alpha then 1 else 0 /-- The semibreak part of the paper coordinate divisor. -/ +@[expose] noncomputable def paperCoordinateSemibreak {g : ℕ} (B : Banana g) (p : ∀ alpha : Fin (g + 1), B.PathPosition alpha) : CFDiv B.graph := semibreakDivisor B (paperCoordinateChips B p) diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianReducedInjectivity.lean b/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianReducedInjectivity.lean index 8f06672dce..ce749cc977 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianReducedInjectivity.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianReducedInjectivity.lean @@ -23,7 +23,7 @@ concrete reducedness theorem: the paper's three conditions on the coordinates must be converted into the endpoint/semibreak normal form of `Semibreak.lean`. -/ -@[expose] public section +public section namespace Bananas @@ -34,6 +34,7 @@ open Utilities.Certificate.SubdivisionGraph.Spec /-- The divisor attached in Proposition 2.14 to coordinates represented by positions on their respective strands. -/ +@[expose] def bananaPositionCoordinateDivisor {g : ℕ} (B : Banana g) (p : ∀ alpha : Fin (g + 1), B.PathPosition alpha) : CFDiv B.graph := ∑ alpha : Fin (g + 1), @@ -41,6 +42,7 @@ def bananaPositionCoordinateDivisor {g : ℕ} (B : Banana g) /-- Regard a vector of strand positions as the corresponding nonnegative integer coordinate vector. -/ +@[expose] def bananaPositionCoordinates {g : ℕ} (B : Banana g) (p : ∀ alpha : Fin (g + 1), B.PathPosition alpha) : Fin (g + 1) → ℤ := @@ -49,6 +51,7 @@ def bananaPositionCoordinates {g : ℕ} (B : Banana g) /-- The paper's three conditions for its preferred coordinate representatives. The bounds `0 ≤ a_alpha ≤ n_alpha` are built into `PathPosition`; the two remaining clauses are recorded literally. -/ +@[expose] def IsPaperReducedPositionCoordinates {g : ℕ} (B : Banana g) (p : ∀ alpha : Fin (g + 1), B.PathPosition alpha) : Prop := (∃ alpha, (p alpha).val = 0) ∧ diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianReducedUniqueness.lean b/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianReducedUniqueness.lean index 79e8890f3a..726c2f980e 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianReducedUniqueness.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianReducedUniqueness.lean @@ -17,7 +17,7 @@ vectors differing by the displayed lattice first give linearly equivalent left-reduced divisors, hence equal divisors by uniqueness of q-reduction. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianReductionTermination.lean b/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianReductionTermination.lean index 6fd0c82712..601cb8ca7e 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianReductionTermination.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianReductionTermination.lean @@ -24,7 +24,7 @@ certificate module translates a terminal vector into the displayed integer relation lattice. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianSurjectivity.lean b/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianSurjectivity.lean index ef4bb0e729..d05c819e75 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianSurjectivity.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaJacobianSurjectivity.lean @@ -18,7 +18,7 @@ degree-zero divisor as a sum of these differences then gives a coordinate vector whose image is linearly equivalent to that divisor. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaTorsionSlopes.lean b/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaTorsionSlopes.lean index a0c7d6a382..5f9e4b1ab0 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaTorsionSlopes.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Jacobian/BananaTorsionSlopes.lean @@ -19,7 +19,7 @@ has one common endpoint rise, while every unmarked strand carries a nonzero integral slope when that rise is nonzero. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/SameStrand.lean b/LeanPool/BrillNoetherGraphs/Bananas/SameStrand.lean index abff3942f7..36dadd404d 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/SameStrand.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/SameStrand.lean @@ -22,4 +22,4 @@ public import LeanPool.BrillNoetherGraphs.Bananas.SameStrand.Semibreak /-! Supporting modules for Brill–Noether theory and gonality of finite graphs. -/ -@[expose] public section +public section diff --git a/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/BananaEndpointDelta.lean b/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/BananaEndpointDelta.lean index 0596b52850..7a8cb1e1b6 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/BananaEndpointDelta.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/BananaEndpointDelta.lean @@ -16,7 +16,7 @@ rank second difference of the `a`-fold endpoint pencil is one through genus and zero afterwards. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/BananaEndpointRankCriterion.lean b/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/BananaEndpointRankCriterion.lean index b1a4d55d0d..d1dc8cee8a 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/BananaEndpointRankCriterion.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/BananaEndpointRankCriterion.lean @@ -24,7 +24,7 @@ If the Riemann--Roch term does not already give rank one, the right endpoint test forces the bounded right coefficient to be positive as well. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/EndpointBlock.lean b/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/EndpointBlock.lean index 6cd6715292..a119a69ad1 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/EndpointBlock.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/EndpointBlock.lean @@ -15,7 +15,7 @@ The endpoint pencil determines a decreasing block in the transmission permutation. This is the algebraic input to the endpoint inversion bound. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/EndpointCardinality.lean b/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/EndpointCardinality.lean index 8224545947..7702f908e7 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/EndpointCardinality.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/EndpointCardinality.lean @@ -20,13 +20,14 @@ assembles the resulting quadratic-versus-linear contradiction that rules out `k`-general transmission for the endpoint marking. -/ -@[expose] public section +public section namespace Bananas open Utilities /-- Encode an unordered endpoint pair by its minimum and one more than its maximum. -/ +@[expose] noncomputable def endpointPairEmbedding (g : ℕ) : Sym2 (Fin g) → ℤ × ℤ := Sym2.lift ⟨(fun (a b : Fin g) => (((min a.val b.val : ℕ) : ℤ), ((max a.val b.val + 1 : ℕ) : ℤ))), by diff --git a/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/EndpointInversions.lean b/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/EndpointInversions.lean index 7d584c164c..c40ef18726 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/EndpointInversions.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/EndpointInversions.lean @@ -23,7 +23,7 @@ permutations from the rank slipface. The endpoint-specific rank calculation and inversion count are developed separately from this generic layer. -/ -@[expose] public section +public section namespace Bananas @@ -326,6 +326,7 @@ theorem banana_genus {g : ℕ} (B : Banana g) : omega /-- The literal divisor consisting of one chip at each multivalent endpoint. -/ +@[expose] def endpointPencilDivisor {g : ℕ} (B : Banana g) : CFDiv B.graph := oneChip (leftEndpoint B) + oneChip (rightEndpoint B) diff --git a/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/NSMClassification.lean b/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/NSMClassification.lean index f1eec8c60c..5e76dcf666 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/NSMClassification.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/NSMClassification.lean @@ -31,7 +31,7 @@ not be replaced by the weaker `nonSubmodular_of_rank_pattern` API, whose rank pattern is itself a hypothesis. -/ -@[expose] public section +public section namespace Bananas @@ -44,6 +44,7 @@ Theorem 3.9. The first two clauses are exchanged by globally swapping the two multivalent vertices. The latter two clauses are the correction: a midpoint on a length-two strand is exceptional against every interior mark on a distinct strand, not only a near-endpoint mark. -/ +@[expose] def NSMForBananaInteriorException {g : ℕ} (B : Banana g) (α β : Fin (g + 1)) (i : B.PathPosition α) (j : B.PathPosition β) : Prop := α ≠ β ∧ diff --git a/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/NSMCrossWitness.lean b/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/NSMCrossWitness.lean index be8b5cfd2c..f3413e9d68 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/NSMCrossWitness.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/NSMCrossWitness.lean @@ -18,7 +18,7 @@ records the normal-form calculation abstractly, so the eventual case split does not need to unfold a concrete banana divisor. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/NSMFullClassification.lean b/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/NSMFullClassification.lean index 820c0ddf32..377fdf9460 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/NSMFullClassification.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/NSMFullClassification.lean @@ -19,7 +19,7 @@ for the two marked *vertices*. The exceptional alternatives retain their coordinate descriptions only for genuinely interior marks. -/ -@[expose] public section +public section namespace Bananas @@ -30,6 +30,7 @@ open Utilities.Certificate.SubdivisionGraph.Spec /-- The endpoint-aware exceptional alternatives in corrected Theorem 3.9. The first three clauses are the same-strand endpoint cases, stated as vertex equalities. The final clause is the corrected interior classification. -/ +@[expose] def NSMForBananaException {g : ℕ} (B : Banana g) (u v : B.graph.V) : Prop := (u = leftEndpoint B ∧ v = rightEndpoint B) ∨ (u = rightEndpoint B ∧ v = leftEndpoint B) ∨ diff --git a/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/NSMSecondCrossWitness.lean b/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/NSMSecondCrossWitness.lean index 62714ad1f4..f8326f66c9 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/NSMSecondCrossWitness.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/NSMSecondCrossWitness.lean @@ -19,7 +19,7 @@ interior point. The extra hypothesis `2 < B.length beta` excludes precisely the corrected length-two midpoint exception; without it the theorem is false. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/SameStrand.lean b/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/SameStrand.lean index 93b740d173..b03f01db24 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/SameStrand.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/SameStrand.lean @@ -21,7 +21,7 @@ turn vertex equalities into slot equalities when the positions concerned are genuinely interior. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/SameStrandEndpointNegative.lean b/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/SameStrandEndpointNegative.lean index 3633117e29..3b4fb9a2a1 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/SameStrandEndpointNegative.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/SameStrandEndpointNegative.lean @@ -24,7 +24,7 @@ For the left endpoint and an interior mark `v_j` with `j < n-1`, take `D = v_(j-1) + v_n`. -/ -@[expose] public section +public section namespace Bananas @@ -229,6 +229,7 @@ theorem rankDelta_one_chip_self_lt_zero /-- The three same-strand exceptional coordinate pairs in Theorem 3.9, expanded to include both orders. -/ +@[expose] def NSMForBananaSameStrandException {g : ℕ} (B : Banana g) (alpha : Fin (g + 1)) (i j : B.PathPosition alpha) : Prop := diff --git a/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/SameStrandInteriorNegative.lean b/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/SameStrandInteriorNegative.lean index ea3f3d27eb..01191ae23b 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/SameStrandInteriorNegative.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/SameStrandInteriorNegative.lean @@ -23,7 +23,7 @@ other deletions are respectively one chip and a nonprincipal degree-zero divisor. Thus `rankDelta D = -1`. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/Semibreak.lean b/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/Semibreak.lean index a441fa2a69..23557c6dd0 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/Semibreak.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/SameStrand/Semibreak.lean @@ -26,7 +26,7 @@ endpoint/semibreak normal form, extract that form from every left-reduced divisor, and hence construct one in every linear-equivalence class. -/ -@[expose] public section +public section namespace Bananas @@ -36,6 +36,7 @@ open Utilities.Certificate.SubdivisionGraph.Spec /-- The divisor with the selected optional interior chip on each strand and no chips at the core vertices. -/ +@[expose] def semibreakDivisor {g : ℕ} (B : Banana g) (chips : ∀ γ : Fin (g + 1), Option (Fin (B.length γ - 1))) : CFDiv B.graph | Sum.inl _ => 0 @@ -43,6 +44,7 @@ def semibreakDivisor {g : ℕ} (B : Banana g) /-- A divisor represented by at most one selected interior chip per strand and none at the core vertices. -/ +@[expose] def IsSemibreak {g : ℕ} (B : Banana g) (E : CFDiv B.graph) : Prop := ∃ chips : ∀ γ : Fin (g + 1), Option (Fin (B.length γ - 1)), E = semibreakDivisor B chips @@ -856,6 +858,7 @@ theorem rank_semibreak_eq_zero {g : ℕ} (B : Banana g) /-- The divisor `a·L + b·R + E` occurring in the banana reduced-divisor normal form. -/ +@[expose] noncomputable def bananaNormalForm {g : ℕ} (B : Banana g) (a b : ℤ) (E : CFDiv B.graph) : CFDiv B.graph := a • oneChip (leftEndpoint B) + b • oneChip (rightEndpoint B) + E diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Sections.lean b/LeanPool/BrillNoetherGraphs/Bananas/Sections.lean index c6eef6edf6..907e288592 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Sections.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Sections.lean @@ -18,4 +18,4 @@ public import LeanPool.BrillNoetherGraphs.Bananas.Sections.SectionSixFoundation /-! Supporting modules for Brill–Noether theory and gonality of finite graphs. -/ -@[expose] public section +public section diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Sections/SectionFiveDefinitions.lean b/LeanPool/BrillNoetherGraphs/Bananas/Sections/SectionFiveDefinitions.lean index 7db7ff9b5e..757c1b26fd 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Sections/SectionFiveDefinitions.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Sections/SectionFiveDefinitions.lean @@ -16,7 +16,7 @@ The structures and finite rank-drop sum used by the formal statements of the marked-point symmetry section. -/ -@[expose] public section +public section namespace Bananas @@ -39,6 +39,7 @@ structure MarkedPointSwap (M : TwiceMarked) extends MarkedPointAutomorphism M wh /-- The finite rank-drop sum in the final, unlabelled proposition of Section 5. This is the paper's sum over a fundamental domain `[k]`, encoded by `Fin k`. -/ +@[expose] noncomputable def sectionFiveRankDropSum (M : TwiceMarked) (D : CFDiv M.graph) (k : ℕ) : ℤ := ∑ m : Fin k, diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Sections/SectionFiveInversionBound.lean b/LeanPool/BrillNoetherGraphs/Bananas/Sections/SectionFiveInversionBound.lean index fcf8825c31..c4c37ad636 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Sections/SectionFiveInversionBound.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Sections/SectionFiveInversionBound.lean @@ -18,7 +18,7 @@ in Section 5. Its remaining graph-theoretic input is the identification of the displayed rank-drop sum with the cardinality of the finite fibres below. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Sections/SectionFiveStatements.lean b/LeanPool/BrillNoetherGraphs/Bananas/Sections/SectionFiveStatements.lean index e60495e21b..d8ed89b72a 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Sections/SectionFiveStatements.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Sections/SectionFiveStatements.lean @@ -24,7 +24,7 @@ Riemann--Roch/tau-characteristic argument needs it; the paper has a global connected-graph convention. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Sections/SectionFiveSymmetries.lean b/LeanPool/BrillNoetherGraphs/Bananas/Sections/SectionFiveSymmetries.lean index c6c7ff1d9c..4e2579423b 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Sections/SectionFiveSymmetries.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Sections/SectionFiveSymmetries.lean @@ -17,7 +17,7 @@ The two symmetry arguments are deliberately carried out at the raw linear-equivalence transports independent of the ASP packaging. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Sections/SectionFiveTransports.lean b/LeanPool/BrillNoetherGraphs/Bananas/Sections/SectionFiveTransports.lean index 20d68bb0f7..59172fb48d 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Sections/SectionFiveTransports.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Sections/SectionFiveTransports.lean @@ -20,7 +20,7 @@ that the latter can expose the paper-facing names without becoming an implementation dependency for later symmetry arguments. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Sections/SectionSixBananaCorollary.lean b/LeanPool/BrillNoetherGraphs/Bananas/Sections/SectionSixBananaCorollary.lean index 3cc686e8c1..b56d346778 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Sections/SectionSixBananaCorollary.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Sections/SectionSixBananaCorollary.lean @@ -20,7 +20,7 @@ high-genus banana cannot have `k ≥ g`, since Proposition 6.1 would make the underlying banana Brill--Noether general. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Sections/SectionSixChainConclusion.lean b/LeanPool/BrillNoetherGraphs/Bananas/Sections/SectionSixChainConclusion.lean index 5b07e0993e..e3479207c1 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Sections/SectionSixChainConclusion.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Sections/SectionSixChainConclusion.lean @@ -25,7 +25,7 @@ The generic commutativity isomorphism is recorded here; associativity is in `VertexWedgeAssociativity`. -/ -@[expose] public section +public section namespace Bananas @@ -44,6 +44,7 @@ universe u v /-! ## Commuting a vertex wedge -/ /-- The wedge with its two factors exchanged, presented by the original ordered pair of factors. -/ +@[expose] noncomputable def vertexWedgeCommPresentation (G : CFGraph.{u}) (H : CFGraph.{v}) (x : G.V) (y : H.V) : VertexWedgePresentation (vertexWedge H G y x) G H x y where @@ -79,6 +80,7 @@ noncomputable def vertexWedgeCommPresentation simp [hb] /-- Vertex wedges are commutative up to graph isomorphism. -/ +@[expose] noncomputable def vertexWedgeComm (G : CFGraph.{u}) (H : CFGraph.{v}) (x : G.V) (y : H.V) : CFGraphIso (vertexWedge G H x y) (vertexWedge H G y x) := diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Sections/SectionSixDefinitions.lean b/LeanPool/BrillNoetherGraphs/Bananas/Sections/SectionSixDefinitions.lean index 7526570a3d..0974256fb6 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Sections/SectionSixDefinitions.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Sections/SectionSixDefinitions.lean @@ -18,7 +18,7 @@ every Young diagram that occurs has size at most the genus. The paper calls that property a once-marked Brill--Noether general graph. -/ -@[expose] public section +public section namespace Bananas @@ -32,6 +32,7 @@ divisor census has size at most the genus. `OnceMarkedCensusContains` is an all-row, degree-independent encoding of membership in that census, so this is a literal formalization of the paper's definition rather than the differently directed `OnceMarkedBNExistence` predicate. -/ +@[expose] def OnceMarkedBrillNoetherGeneral (G : CFGraph) (v : G.V) : Prop := ∀ lambda : YoungDiagram, OnceMarkedCensusContains G v lambda → (lambda.card : ℤ) ≤ CFGraph.genus G diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Sections/SectionSixFoundation.lean b/LeanPool/BrillNoetherGraphs/Bananas/Sections/SectionSixFoundation.lean index 1ace92047a..9f799399c4 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Sections/SectionSixFoundation.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Sections/SectionSixFoundation.lean @@ -20,7 +20,7 @@ version, which is the transmission-existence backbone of the Section 6 chain arguments. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Theta.lean b/LeanPool/BrillNoetherGraphs/Bananas/Theta.lean index 211b0b5ba6..4389738869 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Theta.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Theta.lean @@ -40,4 +40,4 @@ public import LeanPool.BrillNoetherGraphs.Bananas.Theta.ThetaTransmissionCases /-! Supporting modules for Brill–Noether theory and gonality of finite graphs. -/ -@[expose] public section +public section diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Theta/EvenlyMarkedThetaKGeneral.lean b/LeanPool/BrillNoetherGraphs/Bananas/Theta/EvenlyMarkedThetaKGeneral.lean index 631fac0d4d..a56459f704 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Theta/EvenlyMarkedThetaKGeneral.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Theta/EvenlyMarkedThetaKGeneral.lean @@ -23,7 +23,7 @@ non-recurrence, and k-general transmission (Lemma 4.15, Theorem 4.8, Corollary 4.17). -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaArithmetic.lean b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaArithmetic.lean index 7c6e37e28f..5dc7e7b012 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaArithmetic.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaArithmetic.lean @@ -10,7 +10,7 @@ public import LeanPool.BrillNoetherGraphs.Bananas.Basics.Definitions /-! # Theta Arithmetic -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaBoundarySubmodularity.lean b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaBoundarySubmodularity.lean index 690ddc88b2..d8a730055f 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaBoundarySubmodularity.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaBoundarySubmodularity.lean @@ -20,7 +20,7 @@ boundary cases. We first work in the subdivision spec's stored path coordinates; normalized-coordinate wrappers are supplied below. -/ -@[expose] public section +public section namespace Bananas @@ -829,6 +829,7 @@ vertices may be presented on any strand. The first clause is the genuinely different-strand case (both coordinates must be interior). The second says that the two physical marked vertices are, in either order, one of the three normalized same-strand boundary pairs. -/ +@[expose] def ThetaAllSubmodularCoordinates (B : Banana 2) (alpha beta : Fin 3) (i : B.PathPosition alpha) (j : B.PathPosition beta) : Prop := diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaChipEval.lean b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaChipEval.lean index c0a3606f12..66697c1287 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaChipEval.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaChipEval.lean @@ -20,7 +20,7 @@ needs a length split: on a strand of length one it is the head core vertex, whereas on a longer strand it is the first interior vertex. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaCoordinateRigidity.lean b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaCoordinateRigidity.lean index 5eb549803f..e804155df0 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaCoordinateRigidity.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaCoordinateRigidity.lean @@ -18,7 +18,7 @@ genus-two inversion formula to vanish. Here that is checked directly from the coordinate families of Corollary 3.6. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaCounterexampleNormalForm.lean b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaCounterexampleNormalForm.lean index 2e54947d8b..cbb176ef6b 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaCounterexampleNormalForm.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaCounterexampleNormalForm.lean @@ -15,7 +15,7 @@ public import LeanPool.BrillNoetherGraphs.Bananas.Basics.DegreeOneRepresentative This connects the general rank-theoretic reduction to the strand geometry. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaExactTorsion.lean b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaExactTorsion.lean index 3aca82a860..a5b0f45be8 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaExactTorsion.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaExactTorsion.lean @@ -14,7 +14,7 @@ public import LeanPool.BrillNoetherGraphs.Bananas.Theta.ThetaTorsionAPI /-! Exact torsion order for normalized evenly marked theta marks. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaExactTorsionRelabel.lean b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaExactTorsionRelabel.lean index edfca15feb..f0b4188eaf 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaExactTorsionRelabel.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaExactTorsionRelabel.lean @@ -19,7 +19,7 @@ preserving and fixes the two core vertices, so normalized strand coordinates and the ordered pair of marks are preserved. -/ -@[expose] public section +public section namespace Bananas @@ -44,10 +44,12 @@ theorem thetaNormalizeSlots_apply_right (alpha beta : Fin 3) : /-- The same banana presentation with its strand occurrences normalized so that `alpha` and `beta` become slots `0` and `1`. -/ +@[expose] def thetaNormalizedBanana (B : Banana 2) (alpha beta : Fin 3) : Banana 2 := specReindex B (Equiv.refl (Fin 2)) (thetaNormalizeSlots alpha beta) (by omega) /-- The relabeling identifying a theta banana with the normalization of its two chosen strands. -/ +@[expose] def thetaNormalizationRelabeling (B : Banana 2) (alpha beta : Fin 3) : B.Relabeling (thetaNormalizedBanana B alpha beta) := specReindexRelabeling B (Equiv.refl (Fin 2)) diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaExceptionalArithmetic.lean b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaExceptionalArithmetic.lean index 97422c9143..97aec42b18 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaExceptionalArithmetic.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaExceptionalArithmetic.lean @@ -17,7 +17,7 @@ from its divisor-rank content. Coordinates here are the normalized coordinates used by `strandVertex`, measured from core vertex `0`. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaGenusTwoCornerSum.lean b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaGenusTwoCornerSum.lean index 7deaed4cb2..7959e527dd 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaGenusTwoCornerSum.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaGenusTwoCornerSum.lean @@ -18,7 +18,7 @@ the latter comparison is where the endpoint and canonical correction terms enter. -/ -@[expose] public section +public section namespace Bananas @@ -26,10 +26,12 @@ open Utilities /-- Rank plus one, the nonnegative multiplicity used throughout the paper's inclusion--exclusion formula. -/ +@[expose] noncomputable def rankPlusOne (G : CFGraph) (X : CFDiv G) : ℤ := rank G X + 1 /-- A fixed-degree twist with graph and marks as separate arguments. -/ +@[expose] def fixedDegreeTwist (G : CFGraph) (u v : G.V) (D : CFDiv G) (d b : ℤ) : CFDiv G := D + (d - CFDiv.degree D + b) • oneChip u - b • oneChip v @@ -88,6 +90,7 @@ theorem fixedDegreeTwist_one_eq_next_zero_add_v /-- The marked second difference with graph and marks kept as separate arguments, avoiding dependent coercions through the `TwiceMarked` bundle. -/ +@[expose] noncomputable def markedRankDelta (G : CFGraph) (u v : G.V) (X : CFDiv G) : ℤ := rank G X - rank G (X - oneChip u) - rank G (X - oneChip v) + @@ -112,6 +115,7 @@ theorem rankDelta_eq_rankPlusOne_inclusionExclusion /-- The divisor at the graph point `(tau b,b)` of a transmission permutation. -/ +@[expose] noncomputable def transmissionCorner (M : TwiceMarked) (D : CFDiv M.graph) (tau : ℤ → ℤ) (b : ℤ) : CFDiv M.graph := @@ -669,6 +673,7 @@ noncomputable def genusTwoCornerWeight /-- The three degree slices which survive the genus-two specialization of the paper's general inclusion--exclusion formula. -/ +@[expose] noncomputable def threeDegreeTwistContribution (G : CFGraph) (u v : G.V) (D : CFDiv G) (b : ℤ) : ℤ := markedRankDelta G u v (fixedDegreeTwist G u v D 0 b) * diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaGenusTwoTwistIdentities.lean b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaGenusTwoTwistIdentities.lean index 4d712001e4..5ad459b076 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaGenusTwoTwistIdentities.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaGenusTwoTwistIdentities.lean @@ -16,7 +16,7 @@ marked chips from a fixed-degree twist. These elementary identities make the resulting shifts of the finite torsion index explicit. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaInvTauCorrection.lean b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaInvTauCorrection.lean index b4e51df2e3..dfbfcd2496 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaInvTauCorrection.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaInvTauCorrection.lean @@ -32,7 +32,7 @@ the formula to `D = w` for a vertex `w` and read the bound `inv_k ≤ g = 2` backwards. -/ -@[expose] public section +public section namespace Bananas @@ -193,6 +193,7 @@ open Classical in `0 ∈ T⁰_D` says some degree-zero twist of `D` is principal; the second conjunct is the failure of the paper's rigidity condition (in genus two, `r(u+v) = 0` is equivalent to `u + v ≁ K_G`). -/ +@[expose] noncomputable def invTauCorrection (M : TwiceMarked) (D : CFDiv M.graph) : ℤ := if (∃ b : ℤ, linearEquiv M.graph (degreeTwistInt M D 0 b) 0) ∧ linearEquiv M.graph (oneChip M.u + oneChip M.v) diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaInversionCount.lean b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaInversionCount.lean index 39335483dc..097b892bc2 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaInversionCount.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaInversionCount.lean @@ -19,7 +19,7 @@ degree-one twist determines a unique inversion crossing the corresponding row and column of the transmission permutation. -/ -@[expose] public section +public section namespace Bananas @@ -30,12 +30,14 @@ coordinate in the fundamental period. The proof of Lemma 4.10 sums the inversion rows in precisely this normalization. We retain the original `kInversions` definition (which normalizes the first coordinate) for the public K-general-transmission contract. -/ +@[expose] def kInversionsBySecond (k : ℕ) (τ : ℤ → ℤ) : Set (ℤ × ℤ) := {p | p.1 < p.2 ∧ τ p.1 > τ p.2 ∧ 0 ≤ p.2 ∧ p.2 < k} /-- The effective degree-one members of the finite torsion orbit of `D`. This is the concrete `Fin k` model for the paper's set of effective classes in `T_D^1`. -/ +@[expose] def effectiveDegreeOneTwistResidues (M : TwiceMarked) (D : CFDiv M.graph) (k : ℕ) : Set (Fin k) := {b | 0 ≤ rank M.graph (degreeTwistInt M D 1 b.val)} diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaInversionFiniteSum.lean b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaInversionFiniteSum.lean index f975eb5f6f..24dd2dd52e 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaInversionFiniteSum.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaInversionFiniteSum.lean @@ -21,7 +21,7 @@ northwest quadrants which are already identified with complementary divisor ranks in `ThetaNonrecurrence`. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaJacobian.lean b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaJacobian.lean index 12339cc5b3..55f49a78d4 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaJacobian.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaJacobian.lean @@ -10,7 +10,7 @@ public import LeanPool.BrillNoetherGraphs.Bananas.Theta.ThetaResidue /-! # Theta Jacobian -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaJacobianPresentation.lean b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaJacobianPresentation.lean index b107568020..62b3acbd29 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaJacobianPresentation.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaJacobianPresentation.lean @@ -18,7 +18,7 @@ the projection `(x, y, z) ↦ (x - z, y - z)`. Its image relation lattice is generated by `(a + c, c)` and `(-a, b)`, exactly as in the paper. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaKGeneralClassification.lean b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaKGeneralClassification.lean index d97006808e..c6d1c57fed 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaKGeneralClassification.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaKGeneralClassification.lean @@ -19,7 +19,7 @@ terms for endpoint aliases while stating exactly the three non-endpoint families. -/ -@[expose] public section +public section namespace Bananas @@ -27,6 +27,7 @@ open Utilities /-- The coordinate alternatives for k-general theta markings: nonrecurrent interior marks on distinct strands, or an allowed boundary pair on one strand. -/ +@[expose] def ThetaKGeneralCoordinates {k : ℕ} (B : Banana 2) (alpha beta : Fin 3) (i : B.PathPosition alpha) (j : B.PathPosition beta) : Prop := diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaKGeneralCoordinates.lean b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaKGeneralCoordinates.lean index 0d08b8f509..180957d276 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaKGeneralCoordinates.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaKGeneralCoordinates.lean @@ -17,7 +17,7 @@ is rigid, so the general genus-two nonrecurrence criterion applies without any residual graph-theoretic hypothesis. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaLattice.lean b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaLattice.lean index 5890ebf4ee..dd96f0b079 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaLattice.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaLattice.lean @@ -10,7 +10,7 @@ public import LeanPool.BrillNoetherGraphs.Bananas.Theta.ThetaJacobian /-! # Theta Lattice -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaMoment.lean b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaMoment.lean index 5329a02cb0..b31b078aee 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaMoment.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaMoment.lean @@ -10,7 +10,7 @@ public import LeanPool.BrillNoetherGraphs.Bananas.Theta.ThetaLattice /-! # Theta Moment -/ -@[expose] public section +public section namespace Bananas @@ -21,6 +21,7 @@ open Utilities.Certificate.SubdivisionGraph.Spec /-! Interior path moments in normalized strand coordinates. Endpoints are omitted; this is the coordinate part of the theta Jacobian invariant. -/ /-- The position-weighted sum of divisor coefficients at the interior vertices of one strand. -/ +@[expose] def interiorMoment (B : Banana 2) (α : Fin 3) (D : CFDiv B.graph) : ℤ := Finset.sum (Finset.range (B.length α - 1)) (fun r => if h : r + 1 < B.length α then @@ -46,6 +47,7 @@ def thetaCoordinate (B : Banana 2) (D : CFDiv B.graph) : ℤ × ℤ × ℤ := /-! The two-coordinate projection used by the paper's theta presentation. -/ /-- The two Jacobian coordinates obtained by subtracting the third moment from the endpoint-corrected first and second moments. -/ +@[expose] def thetaJacobianMoment (B : Banana 2) (D : CFDiv B.graph) : ℤ × ℤ := (interiorMoment B 0 D + (B.length 0 : ℤ) * D (rightEndpoint B) - interiorMoment B 2 D, diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaNegativeDivisorClasses.lean b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaNegativeDivisorClasses.lean index e88aa29e8e..c57f9ea077 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaNegativeDivisorClasses.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaNegativeDivisorClasses.lean @@ -22,7 +22,7 @@ interval theorem. Generic divisor-algebra wrappers keep its surjectivity proof away from the concrete `oneChip` elaboration blowup. -/ -@[expose] public section +public section namespace Bananas @@ -50,6 +50,7 @@ def divisorClass (G : CFGraph) (D : CFDiv G) : DivisorClass G := /-- Classes which possess a representative with negative marked rank difference. This is literally the paper's set `{[D] : Δ(D) < 0}`. -/ +@[expose] def negativeRankDeltaClasses (M : TwiceMarked) : Set (DivisorClass M.graph) := {c | ∃ D : CFDiv M.graph, divisorClass M.graph D = c ∧ rankDelta M D < 0} @@ -185,6 +186,7 @@ theorem rankDelta_path_pair_neg_of_mem_thetaExceptionalPositions /-- The advertised class-valued map of Theorem 3.4, restricted to its interior same-strand branch and written in raw path coordinates. -/ +@[expose] def thetaPairDivisorClass (B : Banana 2) (alpha : Fin 3) (i k : B.PathPosition alpha) : DivisorClass B.graph := diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaNegativeDivisorClassesBoundary.lean b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaNegativeDivisorClassesBoundary.lean index 8a65aaa5f2..b45f6f3c7d 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaNegativeDivisorClassesBoundary.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaNegativeDivisorClassesBoundary.lean @@ -18,7 +18,7 @@ excluded terminal-near positions are precisely the all-submodular cases of Corollary 3.6. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaNegativeDivisorClassesTerminal.lean b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaNegativeDivisorClassesTerminal.lean index dba264b4c6..5afc927656 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaNegativeDivisorClassesTerminal.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaNegativeDivisorClassesTerminal.lean @@ -17,7 +17,7 @@ terminal endpoint and the first is an interior point at least two steps from the initial endpoint. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaNonrecurrence.lean b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaNonrecurrence.lean index 022f39e4c0..7fcff87255 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaNonrecurrence.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaNonrecurrence.lean @@ -20,7 +20,7 @@ surface. Consequently its southeast and northwest quadrant cardinalities are exactly the two Riemann--Roch rank terms (paper Lemma `lem:tauChars`). -/ -@[expose] public section +public section namespace Bananas @@ -29,6 +29,7 @@ open Utilities /-! ## Concrete degree-twist representatives -/ /-- The degree-`d` representative at an integer marked-difference index. -/ +@[expose] noncomputable def degreeTwistInt (M : TwiceMarked) (D : CFDiv M.graph) (d b : ℤ) : CFDiv M.graph := D + (d - CFDiv.degree D + b) • oneChip M.u - b • oneChip M.v @@ -67,6 +68,7 @@ theorem degreeTwistInt_add_torsion_linearEquiv /-- The paper's nonrecurrence condition, formulated on concrete torsion residues instead of Picard-group quotient classes. -/ +@[expose] def NonRecurrent (M : TwiceMarked) (k : ℕ) : Prop := ∀ (w : M.graph.V) (n m : Fin k), n.val ≠ 0 → m.val ≠ 0 → 0 ≤ rank M.graph diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaPrefix.lean b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaPrefix.lean index 349fa3b28a..cdc451a240 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaPrefix.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaPrefix.lean @@ -10,7 +10,7 @@ public import LeanPool.BrillNoetherGraphs.Bananas.SameStrand.SameStrand /-! # Theta Prefix -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaPrincipal.lean b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaPrincipal.lean index 9fbbaa4d68..bcb4124ecc 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaPrincipal.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaPrincipal.lean @@ -10,7 +10,7 @@ public import LeanPool.BrillNoetherGraphs.Bananas.Theta.ThetaMoment /-! # Theta Principal -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaReflectionRank.lean b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaReflectionRank.lean index 773de561e9..b8be0baa75 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaReflectionRank.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaReflectionRank.lean @@ -16,7 +16,7 @@ degree-two divisor. This is the rank-theoretic exclusion used in the `SameStrand` argument: a rank-zero pair cannot be a reflected pair. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaResidue.lean b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaResidue.lean index e0d8f361b0..e6b9d76b88 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaResidue.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaResidue.lean @@ -11,7 +11,7 @@ public import LeanPool.BrillNoetherGraphs.Bananas.Theta.ThetaArithmetic /-! # Theta Residue -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaTorsionAPI.lean b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaTorsionAPI.lean index 5434412f7e..c0f0d0b53a 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaTorsionAPI.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaTorsionAPI.lean @@ -18,7 +18,7 @@ multiples of two marks is recorded below as an explicit remaining interface; it is not assumed here. -/ -@[expose] public section +public section namespace Bananas @@ -69,6 +69,7 @@ firing-script lemma. It is now *discharged* by `Statements.evenlyMarkedTheta_torsion` is unconditional. The named `Prop` is kept only as the interface through which that discharge is routed. -/ +@[expose] def EvenlyMarkedThetaMultiplePrincipalContract : Prop := ∀ (B : Banana 2) (α β : Fin 3) (i : B.PathPosition α) (j : B.PathPosition β), diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaTransmissionAudit.lean b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaTransmissionAudit.lean index 74eaf3d52b..d1f73367f2 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaTransmissionAudit.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaTransmissionAudit.lean @@ -16,7 +16,7 @@ helpers. It records only reductions that compile from the current API. In particular, it is not an attempted proof of the theorem-level gaps. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaTransmissionCases.lean b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaTransmissionCases.lean index bf19731ab7..500d90d22e 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaTransmissionCases.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Theta/ThetaTransmissionCases.lean @@ -19,7 +19,7 @@ exceptional rows below are graph-independent once their stated divisor-class conditions hold. -/ -@[expose] public section +public section namespace Bananas @@ -279,6 +279,7 @@ theorem transmission_eq_add_two_of_linearEquiv_canonical_sub_u_add_v /-- Proposition 4.5's `t - 2` exceptional class, stated independently of a chosen transmission permutation. -/ +@[expose] def ThetaTransmissionSubTwoCase (B : Banana 2) (u : B.graph.V) (X : CFDiv B.graph) : Prop := linearEquiv B.graph X (2 • oneChip u) @@ -286,6 +287,7 @@ def ThetaTransmissionSubTwoCase /-- Proposition 4.5's `t - 1` exceptional class. The two inequalities in the paper mean that the residual chip belongs to neither marked degree-one class. -/ +@[expose] def ThetaTransmissionSubOneCase (B : Banana 2) (u v : B.graph.V) (X : CFDiv B.graph) : Prop := ∃ w : B.graph.V, @@ -296,6 +298,7 @@ def ThetaTransmissionSubOneCase /-- Proposition 4.5's `t + 1` exceptional class. Saying that `w` is neither reflected marked point is precisely saying that neither marked pair with `w` is canonical. -/ +@[expose] def ThetaTransmissionAddOneCase (B : Banana 2) (u v : B.graph.V) (X : CFDiv B.graph) : Prop := ∃ w : B.graph.V, @@ -307,6 +310,7 @@ def ThetaTransmissionAddOneCase /-- Proposition 4.5's `t + 2` exceptional class, with the reflected class `bar u` written coordinate-freely as `K-u`. -/ +@[expose] def ThetaTransmissionAddTwoCase (B : Banana 2) (u v : B.graph.V) (X : CFDiv B.graph) : Prop := linearEquiv B.graph X diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Transmission.lean b/LeanPool/BrillNoetherGraphs/Bananas/Transmission.lean index bbb638a949..ecb10128aa 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Transmission.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Transmission.lean @@ -40,4 +40,4 @@ public import LeanPool.BrillNoetherGraphs.Bananas.Transmission.TwoVertexGenusOne /-! Supporting modules for Brill–Noether theory and gonality of finite graphs. -/ -@[expose] public section +public section diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/ChainBalanceArithmetic.lean b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/ChainBalanceArithmetic.lean index 6003b1914a..bf27219dfc 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/ChainBalanceArithmetic.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/ChainBalanceArithmetic.lean @@ -23,7 +23,7 @@ Genus-zero factors are deliberately handled separately by the balancing cut nonempty. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/ChainTwoLoopsSameLeft.lean b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/ChainTwoLoopsSameLeft.lean index 73f4f40ca6..0ff9a7faf2 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/ChainTwoLoopsSameLeft.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/ChainTwoLoopsSameLeft.lean @@ -19,7 +19,7 @@ The graph is the vertex wedge of two positive two-path cycles. This file isolates the same-left-side argument in paper Proposition 3.7. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/ChainTwoLoopsSameRight.lean b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/ChainTwoLoopsSameRight.lean index 0eb64db687..52e6faaf2f 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/ChainTwoLoopsSameRight.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/ChainTwoLoopsSameRight.lean @@ -19,7 +19,7 @@ that theorem across commutativity of vertex wedges, supplying the symmetric right-cycle statement required by the paper's Proposition 3.7. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/CycleTorsionOrder.lean b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/CycleTorsionOrder.lean index c0c876dbfb..954f9d4032 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/CycleTorsionOrder.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/CycleTorsionOrder.lean @@ -38,7 +38,7 @@ Combining the two pins down the torsion order at `eg:cycle`. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/EqualTorsionKGeneral.lean b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/EqualTorsionKGeneral.lean index b977942d7e..32ff635aa8 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/EqualTorsionKGeneral.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/EqualTorsionKGeneral.lean @@ -25,7 +25,7 @@ and iterated graph statements and the resulting Brill--Noether generality criterion. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/ExactTorsionAPI.lean b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/ExactTorsionAPI.lean index a1e35cdfbd..f87a1f6e80 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/ExactTorsionAPI.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/ExactTorsionAPI.lean @@ -17,7 +17,7 @@ file derives the group-theoretic consequence used throughout the paper: its period divides every other annihilating period. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/FarMarkAPI.lean b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/FarMarkAPI.lean index 59394805b9..3f48faf140 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/FarMarkAPI.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/FarMarkAPI.lean @@ -19,7 +19,7 @@ attempt the far-mark case split itself: it exposes the rank-zero and rank-minus-one three-chip facts that each case consumes. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/FarMarkNegativeAPI.lean b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/FarMarkNegativeAPI.lean index 341cc55e4e..2e479e752d 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/FarMarkNegativeAPI.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/FarMarkNegativeAPI.lean @@ -11,7 +11,7 @@ public import LeanPool.BrillNoetherGraphs.Bananas.CrossOneOff.CrossStrandNegativ /-! Normalized-coordinate adapter for the verified cross-strand negative-rank calculation. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/GenericFarWitness.lean b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/GenericFarWitness.lean index abaf88be68..20ab7c9e4a 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/GenericFarWitness.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/GenericFarWitness.lean @@ -24,7 +24,7 @@ cross-strand ingredient; selecting that third position from a normalized "far" hypothesis is a separate orientation/mark-selection bridge. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/GenericRankWitness.lean b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/GenericRankWitness.lean index 6de626940e..fb89c865d6 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/GenericRankWitness.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/GenericRankWitness.lean @@ -18,7 +18,7 @@ rank facts used by the far-mark construction in Theorem 3.5 of the twice-marked banana paper. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/KGeneralBNGeneral.lean b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/KGeneralBNGeneral.lean index b3b8a1bac2..e6a3fbcc4f 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/KGeneralBNGeneral.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/KGeneralBNGeneral.lean @@ -24,7 +24,7 @@ same `k`-inversion. The interval between those representatives then supplies at least `2k - 1` distinct `k`-inversions, contradicting the defining bound. -/ -@[expose] public section +public section namespace Bananas @@ -32,10 +32,12 @@ open Utilities /-- Normalize an ordinary inversion by moving its first coordinate into the fundamental interval `[0,k)`. -/ +@[expose] def normalizeFirstInversion (k : ℕ) (p : ℤ × ℤ) : ℤ × ℤ := (p.1 % k, p.2 - (p.1 / k) * k) /-- The rectangular family of inversions crossing both coordinate axes. -/ +@[expose] def crossingInversions (τ : ℤ → ℤ) : Set (ℤ × ℤ) := northwestSet τ 1 0 ×ˢ southeastSet τ 1 0 diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/KGeneralGonality.lean b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/KGeneralGonality.lean index c8b1ae2453..391aef6670 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/KGeneralGonality.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/KGeneralGonality.lean @@ -26,7 +26,7 @@ inequality is the elementary observation from Pflueger--Solomon Lemma zero divisor gives a rank-one divisor `k u`. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/KGeneralSwap.lean b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/KGeneralSwap.lean index c46029962c..e23358ed14 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/KGeneralSwap.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/KGeneralSwap.lean @@ -22,7 +22,7 @@ and consequently that `KGeneralTransmission` is independent of the ordering of the two marks. -/ -@[expose] public section +public section namespace Bananas @@ -30,6 +30,7 @@ open Utilities /-- The inverse of a bijection, kept at the raw-function level used by `IsTransmissionPermutation`. -/ +@[expose] noncomputable def rawInverse (tau : ℤ → ℤ) : ℤ → ℤ := Function.invFun tau @@ -53,20 +54,24 @@ theorem IsKAffine.rawInverse {k : ℕ} {tau : ℤ → ℤ} apply_rawInverse_apply tau hBij] /-- Reflection in both the domain and range. -/ +@[expose] def rawAffineReflection (tau : ℤ → ℤ) : ℤ → ℤ := fun n => -tau (-n) /-- The reflected inverse is the raw transmission permutation after swapping the two marks. -/ +@[expose] noncomputable def swapTransmissionPermutation (tau : ℤ → ℤ) : ℤ → ℤ := rawAffineReflection (rawInverse tau) /-- Simultaneously translate a pair by an integral number of periods. -/ +@[expose] def shiftPair (k : ℕ) (q : ℤ) (p : ℤ × ℤ) : ℤ × ℤ := (p.1 + q * k, p.2 + q * k) /-- Normalize the first coordinate of a pair into the standard period. -/ +@[expose] def normalizeFirstPair (k : ℕ) (p : ℤ × ℤ) : ℤ × ℤ := (p.1 % k, p.2 - (p.1 / k) * k) diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/LengthTwoTorsion.lean b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/LengthTwoTorsion.lean index cfe66a173d..1832a2fdea 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/LengthTwoTorsion.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/LengthTwoTorsion.lean @@ -16,7 +16,7 @@ is independent of the number of other strands: each midpoint doubles to the same endpoint pencil. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/MidpointTorsion.lean b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/MidpointTorsion.lean index e3059751d3..cfea9ac462 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/MidpointTorsion.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/MidpointTorsion.lean @@ -23,7 +23,7 @@ the reflected case without choosing an orientation. In fact the even-period argument only needs the first mark to be a midpoint, of any strand length. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/MixedTorsionChainBalance.lean b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/MixedTorsionChainBalance.lean index f231fcc370..b1abcc1583 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/MixedTorsionChainBalance.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/MixedTorsionChainBalance.lean @@ -26,7 +26,7 @@ parenthesization avoids identifying the different nested `Sum` vertex types of left- and right-associated `MarkedGraph.chain` constructions. -/ -@[expose] public section +public section namespace Bananas @@ -35,6 +35,7 @@ open Utilities /-! ## Reversing a chain factor -/ /-- Reverse the orientation of a twice-marked chain factor. -/ +@[expose] def KGeneralChainFactor.swapMarks (F : KGeneralChainFactor) : KGeneralChainFactor where marked := { @@ -64,6 +65,7 @@ def KGeneralChainFactor.swapMarks (F : KGeneralChainFactor) : /-! ## Genus budgets from the right -/ /-- The sum of the genera of a list of chain factors. -/ +@[expose] def chainFactorGenus (L : List KGeneralChainFactor) : ℤ := (L.map fun F => CFGraph.genus F.marked.graph).sum @@ -147,6 +149,7 @@ theorem chainSuffixBudget_iff_indexed (L : List KGeneralChainFactor) : simpa using h (i + 1) (by simp; omega) /-- The literal minimum hypothesis in Corollary 6.16(2), indexed from zero. -/ +@[expose] def ChainMinBudget (L : List KGeneralChainFactor) : Prop := ∀ (i : ℕ) (hi : i < L.length), min (chainFactorGenus (L.take (i + 1))) @@ -158,6 +161,7 @@ def ChainMinBudget (L : List KGeneralChainFactor) : Prop := Before the cut, each prefix is no larger than the corresponding suffix; after the cut, each suffix is no larger than the corresponding prefix. The maximal index used in the paper's proof has exactly this property. -/ +@[expose] def ChainDominatesAtSplit (left right : List KGeneralChainFactor) : Prop := (∀ (i : ℕ) (_hi : i < left.length), @@ -221,6 +225,7 @@ For the original order `F :: next :: rest`, this is the chain whose factor order is `reverse (F :: next :: rest)` and whose factor marks are all swapped. Its right mark is therefore the original left mark of `F`, namely the vertex at which this suffix is attached to the left half of the chain. -/ +@[expose] def reversedMarkedChain (F : KGeneralChainFactor) : List KGeneralChainFactor → MarkedGraph | [] => F.swapMarks.marked @@ -334,6 +339,7 @@ theorem graph_connected_factorChain /-- The graph obtained by gluing the two nonempty halves at their central marks. The right half is presented from the outside inward. -/ +@[expose] def balancedChainGraph (leftHead : KGeneralChainFactor) (leftTail : List KGeneralChainFactor) diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/MixedTorsionChains.lean b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/MixedTorsionChains.lean index 5b3a3263e5..84359cdc6d 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/MixedTorsionChains.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/MixedTorsionChains.lean @@ -26,7 +26,7 @@ then uses that enlarged genus. This presentation follows the left-associated recursion in `MarkedGraph.chain` and avoids any indexing conventions. -/ -@[expose] public section +public section namespace Bananas @@ -48,6 +48,7 @@ to a chain whose accumulated genus is `g`. For factors `F₂, ..., Fℓ` and `g = g₁`, this unfolds to `g₁ + g₂ < k₂`, `g₁ + g₂ + g₃ < k₃`, and so on. -/ +@[expose] def ChainPrefixBudget : ℤ → List KGeneralChainFactor → Prop | _, [] => True | g, F :: rest => diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/NonrecurrenceDisjoint.lean b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/NonrecurrenceDisjoint.lean index ba7adf198e..2d9352893b 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/NonrecurrenceDisjoint.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/NonrecurrenceDisjoint.lean @@ -19,7 +19,7 @@ paper's nonrecurrence condition is exactly pairwise disjointness of those canonical supports. -/ -@[expose] public section +public section namespace Bananas @@ -57,6 +57,7 @@ theorem mem_rankSupport_canonical_sub_markedTwist_iff /-- The canonical supports indexed by two distinct nonzero residues are disjoint. -/ +@[expose] def CanonicalMarkedSupportsPairwiseDisjoint (M : TwiceMarked) (k : ℕ) : Prop := ∀ n m : Fin k, n.val ≠ 0 → m.val ≠ 0 → n ≠ m → Disjoint diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/NonrecurrenceWitness.lean b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/NonrecurrenceWitness.lean index 7e79235a87..4ba9336e94 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/NonrecurrenceWitness.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/NonrecurrenceWitness.lean @@ -16,7 +16,7 @@ torsion residues at which the same degree-one vertex twist is effective. This small generic lemma packages that final finite-residue step. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/RankDeltaDuality.lean b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/RankDeltaDuality.lean index edae656455..650830957e 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/RankDeltaDuality.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/RankDeltaDuality.lean @@ -17,7 +17,7 @@ difference. Consequently `rankDelta` is invariant under the involution `D ↦ K + u + v - D`. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/RankDetermining.lean b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/RankDetermining.lean index d2b47cf7b8..3af6b3e3fb 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/RankDetermining.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/RankDetermining.lean @@ -17,7 +17,7 @@ for restricted rank, which is the literal quantified content of `r_A(D) ≥ k` and avoids making a second noncomputable choice of an integer rank. -/ -@[expose] public section +public section namespace Bananas @@ -28,12 +28,14 @@ open Utilities.Certificate.SubdivisionGraph.Spec /-- A divisor is supported on `A` when every vertex with nonzero coefficient belongs to `A`. -/ +@[expose] def DivisorSupportedOn {G : CFGraph} (A : Set G.V) (E : CFDiv G) : Prop := ∀ v, E v ≠ 0 → v ∈ A /-- The literal restricted-rank lower-bound relation from the paper: `r_A(D) ≥ k` means that subtracting every effective degree-`k` divisor supported on `A` leaves a winnable divisor. -/ +@[expose] def restrictedRankGeq (G : CFGraph) (A : Set G.V) (D : CFDiv G) (k : ℤ) : Prop := ∀ E : CFDiv G, effective E → CFDiv.degree E = k → DivisorSupportedOn A E → @@ -42,6 +44,7 @@ def restrictedRankGeq (G : CFGraph) (A : Set G.V) /-- A set is rank determining when restricted rank agrees with ordinary rank at every integer lower bound, equivalently when `r_A(D) = r(D)` for every divisor `D`. -/ +@[expose] def RankDetermining (G : CFGraph) (A : Set G.V) : Prop := ∀ (D : CFDiv G) (k : ℤ), restrictedRankGeq G A D k ↔ rankGeq G D k diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/RankZeroSupport.lean b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/RankZeroSupport.lean index 017870eed1..0d8164eff1 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/RankZeroSupport.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/RankZeroSupport.lean @@ -18,7 +18,7 @@ criterion is Lemma 3.1(2) of the paper, stated without choosing an effective representative. -/ -@[expose] public section +public section namespace Bananas @@ -26,6 +26,7 @@ open Utilities /-- The support complex of `D`: vertices whose one-chip deletion is still winnable (equivalently, has nonnegative rank). -/ +@[expose] def rankSupport (G : CFGraph) (D : CFDiv G) : Set G.V := {x | 0 ≤ rank G (D - oneChip x)} diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/RankZeroVertexBridge.lean b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/RankZeroVertexBridge.lean index 2ba58c368b..eb1ab6c038 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/RankZeroVertexBridge.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/RankZeroVertexBridge.lean @@ -18,7 +18,7 @@ than an arbitrary divisor. This file records that passage in the precise form needed before applying the banana cut calculation. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/RankZeroWitness.lean b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/RankZeroWitness.lean index 4085eb72fa..6b80c18453 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/RankZeroWitness.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/RankZeroWitness.lean @@ -17,7 +17,7 @@ form below avoids choosing representatives and is exactly what the later reduced-divisor calculation consumes. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/TorsionIso.lean b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/TorsionIso.lean index 5ffcf796ba..558c015f56 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/TorsionIso.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/TorsionIso.lean @@ -16,7 +16,7 @@ The paper's torsion order is intrinsic to a marked graph. This file supplies the raw-divisor transport needed to use certified subdivision relabelings. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/TorsionOrderExact.lean b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/TorsionOrderExact.lean index 2a9b6a21fc..2f008efbea 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/TorsionOrderExact.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/TorsionOrderExact.lean @@ -26,7 +26,7 @@ inversion `(a, 0)`. Since `k`-general transmission bounds the number of new inversion `(a + n, n)` whose normalization forces `k ∣ n`. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/TorsionOrderTwoGeneral.lean b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/TorsionOrderTwoGeneral.lean index cc8d0df254..354b3a3902 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/TorsionOrderTwoGeneral.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/TorsionOrderTwoGeneral.lean @@ -29,7 +29,7 @@ and `b = 1` with the periodicity `τ(n + 2) = τ(n) + 2` to bound the `2`-inversion count. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/TransmissionAPI.lean b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/TransmissionAPI.lean index 2406ebfb78..b89ef42f89 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/TransmissionAPI.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/TransmissionAPI.lean @@ -19,7 +19,7 @@ mechanical consequences of the present contracts, and separates those from the geometric/non-recurrence input used by the evenly-marked theta theorem. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/TransmissionBasics.lean b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/TransmissionBasics.lean index ae7caae582..31911ee1b6 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/TransmissionBasics.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/TransmissionBasics.lean @@ -18,7 +18,7 @@ torsion-periodicity argument that follows solely from linear equivalence, before any banana rank computation is used. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/TransmissionBridge.lean b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/TransmissionBridge.lean index 306619707c..3e10b8ed66 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/TransmissionBridge.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/TransmissionBridge.lean @@ -43,7 +43,7 @@ and `rank (K - (D - u)) + 1`, and Riemann-Roch turns the difference into constructs a `SatisfiesTransmission` witness directly. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/TwoVertexGenusOneTorsion.lean b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/TwoVertexGenusOneTorsion.lean index cbbac209bc..cb4a70a14f 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Transmission/TwoVertexGenusOneTorsion.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Transmission/TwoVertexGenusOneTorsion.lean @@ -17,7 +17,7 @@ two parallel edges. Firing either vertex therefore doubles the marked difference, while rigidity excludes order one. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Wedge.lean b/LeanPool/BrillNoetherGraphs/Bananas/Wedge.lean index 83c933f088..6a55eb29bf 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Wedge.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Wedge.lean @@ -26,4 +26,4 @@ public import LeanPool.BrillNoetherGraphs.Bananas.Wedge.ZeroGenusWedge /-! Supporting modules for Brill–Noether theory and gonality of finite graphs. -/ -@[expose] public section +public section diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Wedge/KGeneralWedgeGenerality.lean b/LeanPool/BrillNoetherGraphs/Bananas/Wedge/KGeneralWedgeGenerality.lean index 16ad6ab0eb..df045a9521 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Wedge/KGeneralWedgeGenerality.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Wedge/KGeneralWedgeGenerality.lean @@ -21,7 +21,7 @@ sign-changing inversions, and Proposition 6.10 identifies those inversions with the size of the Weierstrass partition at the surviving mark. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Wedge/OnceMarkedWedgeGenerality.lean b/LeanPool/BrillNoetherGraphs/Bananas/Wedge/OnceMarkedWedgeGenerality.lean index 35692cd6aa..394d43a071 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Wedge/OnceMarkedWedgeGenerality.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Wedge/OnceMarkedWedgeGenerality.lean @@ -25,7 +25,7 @@ Proposition 6.10. It uses only the exact vertex-wedge rank formula and the all-row definition `OnceMarkedCensusContains`. -/ -@[expose] public section +public section namespace Bananas @@ -146,6 +146,7 @@ theorem pointedRankThreshold_succ_le /-! ## Finite pointed diagrams -/ /-- The `i`th (truncated) Weierstrass row attached to a pointed divisor. -/ +@[expose] noncomputable def pointedRowLength (G : CFGraph.{u}) (hG : graphConnected G) (D : CFDiv G) (q : G.V) (i : ℕ) : ℕ := @@ -164,6 +165,7 @@ theorem pointedRowLength_anti /-- The first `r+1` pointed rows, sufficient for studying a divisor of rank `r` on a vertex wedge. -/ +@[expose] noncomputable def finitePointedRows (G : CFGraph.{u}) (hG : graphConnected G) (D : CFDiv G) (q : G.V) (r : ℕ) : List ℕ := diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Wedge/OppositeWedgeKGeneralClassification.lean b/LeanPool/BrillNoetherGraphs/Bananas/Wedge/OppositeWedgeKGeneralClassification.lean index 6f385c63b3..e6460818b0 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Wedge/OppositeWedgeKGeneralClassification.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Wedge/OppositeWedgeKGeneralClassification.lean @@ -18,7 +18,7 @@ factor torsion orders, forces them equal, and identifies the asserted wedge period with that common order. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Wedge/OppositeWedgeRigidity.lean b/LeanPool/BrillNoetherGraphs/Bananas/Wedge/OppositeWedgeRigidity.lean index 9ed681a5a1..9c08847210 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Wedge/OppositeWedgeRigidity.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Wedge/OppositeWedgeRigidity.lean @@ -17,7 +17,7 @@ The phase `ell = 0` in the exact wedge rank formula shows that one chip on each factor has rank zero whenever neither chip is the gluing point. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Wedge/SameFactorWedgeKGeneral.lean b/LeanPool/BrillNoetherGraphs/Bananas/Wedge/SameFactorWedgeKGeneral.lean index 3c9c057cdd..ece0eb8283 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Wedge/SameFactorWedgeKGeneral.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Wedge/SameFactorWedgeKGeneral.lean @@ -19,7 +19,7 @@ order-two criterion supplies general transmission as soon as submodularity is known. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Wedge/SameFactorWedgePeriod.lean b/LeanPool/BrillNoetherGraphs/Bananas/Wedge/SameFactorWedgePeriod.lean index 828717eecc..300656f4a3 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Wedge/SameFactorWedgePeriod.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Wedge/SameFactorWedgePeriod.lean @@ -14,7 +14,7 @@ public import LeanPool.BrillNoetherGraphs.Bananas.Wedge.WedgeTorsionRestriction # The period in the same-factor wedge exception -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Wedge/SameFactorWedgeRight.lean b/LeanPool/BrillNoetherGraphs/Bananas/Wedge/SameFactorWedgeRight.lean index d2f95f080d..bfe231ba3d 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Wedge/SameFactorWedgeRight.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Wedge/SameFactorWedgeRight.lean @@ -16,7 +16,7 @@ This is the factor-symmetric transport of the left-factor theorems across the explicit commutativity isomorphism for vertex wedges. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Wedge/SameFactorWedgeSubmodularity.lean b/LeanPool/BrillNoetherGraphs/Bananas/Wedge/SameFactorWedgeSubmodularity.lean index ce40826f33..df597a176a 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Wedge/SameFactorWedgeSubmodularity.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Wedge/SameFactorWedgeSubmodularity.lean @@ -18,7 +18,7 @@ two vertices. The point is that a third vertex supplies the explicit negative rank-difference witness already used for Proposition 3.7. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Wedge/TwoVertexWedgeSubmodularity.lean b/LeanPool/BrillNoetherGraphs/Bananas/Wedge/TwoVertexWedgeSubmodularity.lean index b8b8d91e96..0a3fa18f54 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Wedge/TwoVertexWedgeSubmodularity.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Wedge/TwoVertexWedgeSubmodularity.lean @@ -17,7 +17,7 @@ vertex. This is the converse to the obstruction in `SameFactorWedgeSubmodularity`. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Wedge/VertexWedgeAssociativity.lean b/LeanPool/BrillNoetherGraphs/Bananas/Wedge/VertexWedgeAssociativity.lean index 6b3787cb19..31d0026c7b 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Wedge/VertexWedgeAssociativity.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Wedge/VertexWedgeAssociativity.lean @@ -18,7 +18,7 @@ Consequently, both bracketings of a three-factor wedge have the same three classes of vertices. This file records the resulting graph isomorphism. -/ -@[expose] public section +public section namespace Bananas @@ -26,6 +26,7 @@ open Utilities universe u v w /-- Rebracket the concrete vertex types underlying a three-factor wedge. -/ +@[expose] def vertexWedgeAssocVertexEquiv (G : CFGraph.{u}) (H : CFGraph.{v}) (K : CFGraph.{w}) (x : G.V) (y z : H.V) (t : K.V) : @@ -66,6 +67,7 @@ def vertexWedgeAssocVertexEquiv /-- The unglued middle-factor vertex viewed in the right-associated outer wedge's unmarked right subtype. -/ +@[expose] def vertexWedgeAssocMiddleVertex (H : CFGraph.{v}) (K : CFGraph.{w}) (y z : H.V) (t : K.V) (b : { b : H.V // b ≠ y }) : @@ -73,6 +75,7 @@ def vertexWedgeAssocMiddleVertex ⟨Sum.inl b.1, fun h => b.2 (Sum.inl.inj h)⟩ /-- The unglued last-factor vertex viewed in the right-associated outer wedge's unmarked right subtype. -/ +@[expose] def vertexWedgeAssocLastVertex (H : CFGraph.{v}) (K : CFGraph.{w}) (y z : H.V) (t : K.V) (c : { c : K.V // c ≠ t }) : @@ -132,6 +135,7 @@ def vertexWedgeAssocLastVertex The middle graph is glued to `G` at `y` and to `K` at `z`; no hypothesis that these two vertices are distinct is needed. -/ +@[expose] def vertexWedgeAssoc (G : CFGraph.{u}) (H : CFGraph.{v}) (K : CFGraph.{w}) (x : G.V) (y z : H.V) (t : K.V) : diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Wedge/WedgeKGeneralClassification.lean b/LeanPool/BrillNoetherGraphs/Bananas/Wedge/WedgeKGeneralClassification.lean index 6fbef4f730..2149d1e8dd 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Wedge/WedgeKGeneralClassification.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Wedge/WedgeKGeneralClassification.lean @@ -17,7 +17,7 @@ This is the wedge half of Theorem 4.13. It is deliberately intrinsic: the two genus-one factors are not presented as chosen cycles. -/ -@[expose] public section +public section namespace Bananas @@ -38,6 +38,7 @@ private theorem card_eq_two_of_le_two_rigid rigid wedge of two genus-one factors. The first four are the order-two two-vertex same-factor exceptions; the last two are the distinct-factor equal-order branch. -/ +@[expose] def WedgeKGeneralPlacement (G H : CFGraph) (x : G.V) (y : H.V) (u v : (vertexWedge G H x y).V) (k : ℕ) : Prop := diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Wedge/WedgeKGeneralConverse.lean b/LeanPool/BrillNoetherGraphs/Bananas/Wedge/WedgeKGeneralConverse.lean index 500a017d21..706bbecc2a 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Wedge/WedgeKGeneralConverse.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Wedge/WedgeKGeneralConverse.lean @@ -20,7 +20,7 @@ transmission on a bridgeless rigid wedge forces the smaller nontrivial order to equal the other one. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Wedge/WedgeKGeneralSymmetric.lean b/LeanPool/BrillNoetherGraphs/Bananas/Wedge/WedgeKGeneralSymmetric.lean index 894a39bb36..59404b351e 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Wedge/WedgeKGeneralSymmetric.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Wedge/WedgeKGeneralSymmetric.lean @@ -21,7 +21,7 @@ commuting the vertex wedge and swapping the marked vertices in the other case. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Wedge/WedgePeriodRecurrence.lean b/LeanPool/BrillNoetherGraphs/Bananas/Wedge/WedgePeriodRecurrence.lean index 4928008a31..95bdcf7e40 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Wedge/WedgePeriodRecurrence.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Wedge/WedgePeriodRecurrence.lean @@ -17,7 +17,7 @@ Theorem 4.13. The generic residue contradiction is kept in `NonrecurrenceWitness`; this file supplies the wedge rank witnesses. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Wedge/WedgeSubmodularity.lean b/LeanPool/BrillNoetherGraphs/Bananas/Wedge/WedgeSubmodularity.lean index b090cf3a5f..fbeae9ef61 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Wedge/WedgeSubmodularity.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Wedge/WedgeSubmodularity.lean @@ -26,7 +26,7 @@ permutation is kept abstract. This avoids unfolding `oneChip` on a concrete wedge vertex type. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Wedge/WedgeTorsionRestriction.lean b/LeanPool/BrillNoetherGraphs/Bananas/Wedge/WedgeTorsionRestriction.lean index fccd433698..c103301859 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Wedge/WedgeTorsionRestriction.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Wedge/WedgeTorsionRestriction.lean @@ -23,7 +23,7 @@ pairs. The proof uses the exact winnability convolution, avoiding a separate Jacobian-product construction. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/Bananas/Wedge/ZeroGenusWedge.lean b/LeanPool/BrillNoetherGraphs/Bananas/Wedge/ZeroGenusWedge.lean index 57c35ec6ce..8b0fd874e0 100644 --- a/LeanPool/BrillNoetherGraphs/Bananas/Wedge/ZeroGenusWedge.lean +++ b/LeanPool/BrillNoetherGraphs/Bananas/Wedge/ZeroGenusWedge.lean @@ -22,7 +22,7 @@ This is the zero-genus reduction needed at the endpoints of the balancing argument in Corollary 6.16(2) of the banana-graph paper. -/ -@[expose] public section +public section namespace Bananas diff --git a/LeanPool/BrillNoetherGraphs/ChipFiringWithLean.lean b/LeanPool/BrillNoetherGraphs/ChipFiringWithLean.lean index 8dc99f284c..520d865f1b 100644 --- a/LeanPool/BrillNoetherGraphs/ChipFiringWithLean.lean +++ b/LeanPool/BrillNoetherGraphs/ChipFiringWithLean.lean @@ -15,4 +15,4 @@ public import LeanPool.BrillNoetherGraphs.ChipFiringWithLean.RiemannRoch /-! Supporting modules for Brill–Noether theory and gonality of finite graphs. -/ -@[expose] public section +public section diff --git a/LeanPool/BrillNoetherGraphs/ChipFiringWithLean/Basic.lean b/LeanPool/BrillNoetherGraphs/ChipFiringWithLean/Basic.lean index 12aa3aec56..d42be864c7 100644 --- a/LeanPool/BrillNoetherGraphs/ChipFiringWithLean/Basic.lean +++ b/LeanPool/BrillNoetherGraphs/ChipFiringWithLean/Basic.lean @@ -13,7 +13,7 @@ public import Mathlib.Data.Matrix.Mul /-! # Basic -/ -@[expose] public section +public section @@ -56,6 +56,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. -/ +@[expose] def numEdges (G : CFGraph) (v w : G.V) : ℕ := Multiset.card (G.edges.filter (fun e => e = (v, w) ∨ e = (w, v))) @@ -64,11 +65,13 @@ with no edges between them. This is equivalent to saying that there is a path between any two vertices, but the partition formulation is more convenient in this repository. -/ +@[expose] def graphConnected (G : CFGraph) : Prop := ∀ S : Finset G.V, (∃ (v w : G.V), v ∈ S ∧ w ∉ S) → (∃ v ∈ S, ∃ w ∉ S, numEdges G v w > 0) /-- The genus of a graph is its cyclomatic number, $|E| - |V| + 1$. -/ +@[expose] def CFGraph.genus (G : CFGraph) : ℤ := Multiset.card G.edges - Fintype.card G.V + 1 @@ -89,6 +92,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. -/ +@[expose] def vertexDegree (G : CFGraph) (v : G.V) : ℤ := ∑ u : G.V, (numEdges G v u : ℤ) @@ -116,6 +120,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. -/ +@[expose] def oneChip {G : CFGraph} (v_chip : G.V) : CFDiv G := fun v => if v = v_chip then 1 else 0 @@ -147,6 +152,7 @@ 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. -/ +@[expose] def outdegreeSet (G : CFGraph) (S : Finset G.V) (v : G.V) : ℤ := ∑ w ∈ (univ \ S), (numEdges G v w : ℤ) @@ -191,6 +197,7 @@ theorem le_set_firing_apply_of_not_mem (G : CFGraph) (D : CFDiv G) exact le_add_of_nonneg_right (outdeg_S_nonneg G Sᶜ v) /-- The principal divisor associated to firing a single vertex. -/ +@[expose] def firingVector (G : CFGraph) (v : G.V) : CFDiv G := fun w => if w = v then -vertexDegree G v else numEdges G v w @@ -213,12 +220,14 @@ divisors have the same degree (see `linear_equiv_preserves_deg`). -/ /-- The subgroup of principal divisors is generated by firing vectors at individual vertices. -/ +@[expose] def principalDivisors (G : CFGraph) : AddSubgroup (CFDiv G) := AddSubgroup.closure (Set.range (firingVector 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. -/ +@[expose] def linearEquiv (G : CFGraph) (D D' : CFDiv G) : Prop := D' - D ∈ principalDivisors G @@ -258,6 +267,7 @@ See: [Corry-Perkinson](https://pubs.ams.org/ebooks/mbk/114), Definition 2.2. -/ abbrev firingScript (G : CFGraph) := G.V → ℤ /-- The firing script that fires exactly the vertices in `S`, once each. -/ +@[expose] def indicatorScript (G : CFGraph) (S : Finset G.V) : firingScript G := fun v => if v ∈ S then 1 else 0 @@ -270,6 +280,7 @@ $$ See: [Corry-Perkinson](https://pubs.ams.org/ebooks/mbk/114), Definition 2.3; `prin G σ` is the *negative* of the divisor $\operatorname{div}(\sigma)$ defined there, since they implement a firing script as $D \mapsto D - \operatorname{div}(\sigma)$. -/ +@[expose] def prin (G : CFGraph) : firingScript G →+ CFDiv G := { toFun := fun σ v => ∑ u : G.V, (σ u - σ v) * (numEdges G v u), @@ -426,11 +437,13 @@ 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. -/ +@[expose] def effective {G : CFGraph} (D : CFDiv G) : Prop := ∀ v : G.V, D v ≥ 0 /-- The submonoid of effective divisors is denoted `Eff G`. -/ +@[expose] def Eff (G : CFGraph) : AddSubmonoid (CFDiv G) := { carrier := {D : CFDiv G | effective D}, zero_mem' := by @@ -454,6 +467,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. -/ +@[expose] def winnable (G : CFGraph) (D : CFDiv G) : Prop := ∃ D' ∈ Eff G, linearEquiv G D D' @@ -473,6 +487,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. -/ +@[expose] def CFDiv.degree {G : CFGraph} : CFDiv G →+ ℤ := { toFun := fun D => ∑ v, D v, map_zero' := by @@ -674,6 +689,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$. -/ +@[expose] def qEffective {G : CFGraph} (q : G.V) (D : CFDiv G) : Prop := ∀ v : G.V, v ≠ q → D v ≥ 0 @@ -1029,6 +1045,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. -/ +@[expose] def legalSet (G : CFGraph) (D : CFDiv G) (S : Finset G.V) : Prop := ∀ v ∈ S, outdegreeSet G S v ≤ D v @@ -1074,6 +1091,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. -/ +@[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 @@ -1292,6 +1310,7 @@ theorem q_reduced_unique (G : CFGraph) (q : G.V) (D₁ D₂ : CFDiv G) : /-- A vertex is *active* if there exists a firing script that leaves the divisor effective away from $q$, fires $q$ minimally, and fires this vertex strictly more than $q$. -/ +@[expose] def active (G : CFGraph) (q : G.V) (D : CFDiv G) (v : G.V) : Prop := ∃ σ : firingScript G, qReducer G q σ ∧ qEffective q (D + prin G σ) ∧ σ q < σ v diff --git a/LeanPool/BrillNoetherGraphs/ChipFiringWithLean/Config.lean b/LeanPool/BrillNoetherGraphs/ChipFiringWithLean/Config.lean index 483c20d323..f14aacd5d5 100644 --- a/LeanPool/BrillNoetherGraphs/ChipFiringWithLean/Config.lean +++ b/LeanPool/BrillNoetherGraphs/ChipFiringWithLean/Config.lean @@ -10,7 +10,7 @@ public import LeanPool.BrillNoetherGraphs.ChipFiringWithLean.Basic /-! # ChipFiringConfiguration -/ -@[expose] public section +public section open Multiset Finset /-! @@ -54,11 +54,13 @@ $$ \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. -/ +@[expose] def configDegree {G : CFGraph} {q : G.V} (c : ChipFiringConfiguration G q) : ℤ := CFDiv.degree (c.chips) /-- Converts a configuration $c$ to a divisor of prescribed degree $d$ by placing $d-\deg(c)$ chips at $q$. -/ +@[expose] def toDiv {G : CFGraph} {q : G.V} (d : ℤ) (c : ChipFiringConfiguration G q) : CFDiv G := c.chips + (d - configDegree c) • (oneChip q) @@ -111,6 +113,7 @@ def toQEffectiveDivisor {q : G.V} (d : ℤ) exact c.non_negative v } /-- Converts a $q$-effective divisor to a configuration by zeroing out the chip count at $q$. -/ +@[expose] def toConfig {q : G.V} (D : qEffectiveDivisor G q) : ChipFiringConfiguration G q := { chips := D.D - (D.D q) • (oneChip q) q_zero := by @@ -389,6 +392,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. -/ +@[expose] def maximalSuperstable (G : CFGraph) {q : G.V} (c : ChipFiringConfiguration G q) : Prop := superstable G q c ∧ ∀ c' : ChipFiringConfiguration G q, superstable G q c' → c ≤ c' → c' = c @@ -620,6 +624,7 @@ lemma superstable_burn_list (G : CFGraph) {q : G.V} (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 : ChipFiringConfiguration 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/BrillNoetherGraphs/ChipFiringWithLean/Orientation.lean b/LeanPool/BrillNoetherGraphs/ChipFiringWithLean/Orientation.lean index 1d175041fb..cb4beabba0 100644 --- a/LeanPool/BrillNoetherGraphs/ChipFiringWithLean/Orientation.lean +++ b/LeanPool/BrillNoetherGraphs/ChipFiringWithLean/Orientation.lean @@ -11,7 +11,7 @@ public import Mathlib.Data.DFinsupp.Multiset /-! # Orientation -/ -@[expose] public section +public section open Multiset Finset /-! @@ -154,6 +154,7 @@ private lemma card_directed_edges_eq_card_edges {G : CFGraph} (O : CFOrientation linarith /-- The number of edges directed into a vertex under an orientation. -/ +@[expose] def indeg (G : CFGraph) (O : CFOrientation G) (v : G.V) : ℕ := Multiset.card (O.directedEdges.filter (fun e => e.snd = v)) @@ -201,11 +202,13 @@ 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. -/ +@[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$ to $v$ in orientation $\mathcal{O}$. -/ +@[expose] def directedEdge (G : CFGraph) (O : CFOrientation G) (u v : G.V) : Prop := (u, v) ∈ O.directedEdges @@ -219,6 +222,7 @@ structure DirectedPath {G : CFGraph} (O : CFOrientation G) where valid_edges : List.IsChain (directedEdge G O) vertices /-- A directed path is *non-repeating* if its vertex list has no duplicates. -/ +@[expose] def nonRepeating {G : CFGraph} {O : CFOrientation G} (p : DirectedPath O) : Prop := p.vertices.Nodup @@ -229,6 +233,7 @@ private lemma path_length_bound {G : CFGraph} {O : CFOrientation G} (p : Directe exact List.Nodup.length_le_card h_distinct /-- An orientation is acyclic if every directed path has no repeated vertices. -/ +@[expose] def isAcyclic (G : CFGraph) (O : CFOrientation G) : Prop := ∀ (p : DirectedPath O), nonRepeating p @@ -365,7 +370,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. -/ @@ -410,11 +415,13 @@ 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. -/ +@[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. -/ +@[expose] def orqed {G : CFGraph} (O : CFOrientation G) {q : G.V} (hO : acyclicWithUniqueSource G O q) : qEffectiveDivisor G q := { D := ordiv G O, @@ -875,6 +882,7 @@ See: [Corry-Perkinson](https://pubs.ams.org/ebooks/mbk/114), Definition 5.7. It is independent of orientation and equals $D(\mathcal{O}) + D(\overline{\mathcal{O}})$. -/ +@[expose] def canonicalDivisor (G : CFGraph) : CFDiv G := fun v => (vertexDegree G v) - 2 @@ -998,6 +1006,7 @@ The key lemma `dp_dec` formalizes this as a strict chain of natural numbers, and /-- Create a multiset with a given count function. This is a thin wrapper around `DFinsupp.toMultiset` specialized to a finite type. -/ +@[expose] def multisetOfCount {T : Type*} [DecidableEq T] [Fintype T] (f : T → ℕ) : Multiset T := DFinsupp.toMultiset (DFinsupp.equivFunOnFintype.symm f) @@ -1014,6 +1023,7 @@ def multisetOfCount {T : Type*} [DecidableEq T] [Fintype T] (f : T → ℕ) : Mu /-- Constructs a `CFOrientation` from an explicit flow function, given proofs that it respects edge multiplicities and has no bidirectional edges. -/ +@[expose] def orientationFromFlow {G : CFGraph} (f : G.V × G.V → ℕ) (h_count_preserving : ∀ v w : G.V, f (v,w) + f (w,v) = numEdges G v w) : CFOrientation G := { diff --git a/LeanPool/BrillNoetherGraphs/ChipFiringWithLean/RRGHelpers.lean b/LeanPool/BrillNoetherGraphs/ChipFiringWithLean/RRGHelpers.lean index ae13abcc97..d82d698f64 100644 --- a/LeanPool/BrillNoetherGraphs/ChipFiringWithLean/RRGHelpers.lean +++ b/LeanPool/BrillNoetherGraphs/ChipFiringWithLean/RRGHelpers.lean @@ -11,7 +11,7 @@ public import LeanPool.BrillNoetherGraphs.ChipFiringWithLean.Rank /-! # RRGHelpers -/ -@[expose] public section +public section open Multiset Finset /-! @@ -29,6 +29,7 @@ maximal unwinnable divisors: -/ /-- The chosen unique $q$-reduced representative of the linear equivalence class of $D$. -/ +@[expose] noncomputable def qReducedRep {G : CFGraph} (h_conn : graphConnected G) (q : G.V) (D : CFDiv G) : CFDiv G := Classical.choose (unique_q_reduced h_conn q D) diff --git a/LeanPool/BrillNoetherGraphs/ChipFiringWithLean/Rank.lean b/LeanPool/BrillNoetherGraphs/ChipFiringWithLean/Rank.lean index 8ef2329901..7027d53a23 100644 --- a/LeanPool/BrillNoetherGraphs/ChipFiringWithLean/Rank.lean +++ b/LeanPool/BrillNoetherGraphs/ChipFiringWithLean/Rank.lean @@ -10,7 +10,7 @@ public import LeanPool.BrillNoetherGraphs.ChipFiringWithLean.Basic /-! # Rank -/ -@[expose] public section +public section open Multiset Finset /-! @@ -43,6 +43,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. -/ +@[expose] def maximalUnwinnable (G : CFGraph) (D : CFDiv G) : Prop := ¬winnable G D ∧ ∀ v : G.V, winnable G (D + oneChip v) @@ -62,6 +63,7 @@ lemma maximal_unwinnable_preserved (G : CFGraph) (D1 D2 : CFDiv G) : This is used to define `rankGeq`: the relation $r(D) \ge k$ means that $D-E$ is winnable for every effective divisor $E$ of degree $k$. -/ +@[expose] def effOfDegree (G : CFGraph) (k : ℤ) : Set (CFDiv G) := {E | effective E ∧ CFDiv.degree E = k} @@ -76,10 +78,12 @@ 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$. -/ +@[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. -/ +@[expose] def rankEq (G : CFGraph) (D : CFDiv G) (r : ℤ) : Prop := rankGeq G D r ∧ ¬(rankGeq G D (r+1)) diff --git a/LeanPool/BrillNoetherGraphs/ChipFiringWithLean/RiemannRoch.lean b/LeanPool/BrillNoetherGraphs/ChipFiringWithLean/RiemannRoch.lean index 600d78562d..acb70bff2b 100644 --- a/LeanPool/BrillNoetherGraphs/ChipFiringWithLean/RiemannRoch.lean +++ b/LeanPool/BrillNoetherGraphs/ChipFiringWithLean/RiemannRoch.lean @@ -10,7 +10,7 @@ public import LeanPool.BrillNoetherGraphs.ChipFiringWithLean.RRGHelpers /-! # Riemann Roch -/ -@[expose] public section +public section universe u open Multiset Finset @@ -225,6 +225,7 @@ of a graph. /-- The relation $\operatorname{gon}(G) \le k$: there exists a divisor of degree $k$ with rank at least $1$. -/ +@[expose] def gonalityLeq (G : CFGraph) (k : ℤ) : Prop := ∃ D : CFDiv G, rank G D ≥ 1 ∧ CFDiv.degree D = k /-- The relation $\operatorname{gon}(G) \ge k$: no divisor of degree less than $k$ @@ -260,6 +261,7 @@ private theorem one_le_of_gonality_leq {G : CFGraph} {k : ℤ} (h_gon : gonality /-- The *(divisorial) gonality* of a connected graph is the smallest degree of a divisor of rank at least one. -/ +@[expose] noncomputable def gonality {G : CFGraph} (_h_conn : graphConnected G) : ℤ := sInf {k : ℤ | gonalityLeq G k} @@ -358,6 +360,7 @@ at most $\lfloor (g+3)/2 \rfloor$. This is an open problem, posed by Baker in [Specialization of linear systems from curves to graphs](https://doi.org/10.2140/ant.2008.2.613), Conjecture 3.10(1). -/ +@[expose] def gonalityConjecture {G : CFGraph} (h_conn : graphConnected G) : Prop := gonality h_conn ≤ (CFGraph.genus G + 3) / 2 @@ -371,6 +374,7 @@ there exists a divisor of degree $d$ and rank at least $r$. This is an open problem, posed in slightly different form by Baker in [Specialization of linear systems from curves to graphs](https://doi.org/10.2140/ant.2008.2.613), Conjecture 3.9(1). -/ +@[expose] def brillNoetherConjecture {G : CFGraph} (_h_conn : graphConnected G) (r d : ℤ) : Prop := let g := CFGraph.genus G let ρ := g - (r + 1) * (g - d + r) diff --git a/LeanPool/BrillNoetherGraphs/Demazure.lean b/LeanPool/BrillNoetherGraphs/Demazure.lean index 7e736ee4f2..3da9e63c5e 100644 --- a/LeanPool/BrillNoetherGraphs/Demazure.lean +++ b/LeanPool/BrillNoetherGraphs/Demazure.lean @@ -18,4 +18,4 @@ public import LeanPool.BrillNoetherGraphs.Demazure.Valley /-! Supporting modules for Brill–Noether theory and gonality of finite graphs. -/ -@[expose] public section +public section diff --git a/LeanPool/BrillNoetherGraphs/Demazure/AspPerm.lean b/LeanPool/BrillNoetherGraphs/Demazure/AspPerm.lean index e796a49438..8b02be6c3d 100644 --- a/LeanPool/BrillNoetherGraphs/Demazure/AspPerm.lean +++ b/LeanPool/BrillNoetherGraphs/Demazure/AspPerm.lean @@ -23,19 +23,22 @@ bounded-difference material from Section 7, of [An extended Demazure product](https://arxiv.org/abs/2206.14227). -/ -@[expose] public section +public section /-- The inversion set $\operatorname{Inv} \tau = \{(u,v) \in \mathbb{Z}^2 : u < v \text{ and } \tau(u) > \tau(v)\}$. *Definition 2.5 (`defn:Inv`) of [An extended Demazure product](https://arxiv.org/abs/2206.14227).* -/ +@[expose] def invSet (τ : ℤ → ℤ) : Set (ℤ × ℤ) := {(i,j) : ℤ × ℤ | i < j ∧ τ j < τ i} /-- The indices at least `n` whose images lie strictly below `m`. -/ +@[expose] def southeastSet (τ : ℤ → ℤ) (m n : ℤ) : Set ℤ := { k : ℤ | n ≤ k ∧ τ k < m } /-- The indices strictly below `n` whose images lie at least at `m`. -/ +@[expose] def northwestSet (τ : ℤ → ℤ) (m n : ℤ) : Set ℤ := { k : ℤ | k < n ∧ m ≤ τ k } /-- Conjugation of an integer-valued function by the reflection `k ↦ -1-k`. -/ @@ -111,6 +114,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 @@ -212,6 +216,7 @@ lemma ext {σ τ : AspPerm} : σ = τ ↔ σ.func = τ.func := by · intro h; cases σ; cases τ; congr /-- Composition of almost sign-preserving permutations, applying the right factor first. -/ +@[expose] def mul (σ τ : AspPerm) : AspPerm where func := Function.comp σ.func τ.func bijective := @@ -257,6 +262,7 @@ def mul (σ τ : AspPerm) : AspPerm where exact Set.Finite.union (Set.Finite.union τ.asp h_pre) h_zero /-- The inverse permutation, with its inherited almost sign-preserving property. -/ +@[expose] noncomputable def inv (τ : AspPerm) : AspPerm where func := Function.invFun τ.func bijective := by @@ -275,6 +281,7 @@ noncomputable def inv (τ : AspPerm) : AspPerm where simp only [Set.preimage_ofPred_eq, Set.mem_ofPred_eq, this, mul_comm] /-- The identity almost sign-preserving permutation. -/ +@[expose] def id : AspPerm where func := _root_.id bijective := ⟨Function.injective_id, Function.surjective_id⟩ @@ -341,6 +348,7 @@ lemma inv_set_inverse (u v : ℤ) : exact ⟨u_lt_v, τv_lt_τu⟩ /-- The map sending an inversion pair `(i,j)` to the reversed image pair `(τ j,τ i)`. -/ +@[expose] def revMap : ℤ × ℤ → ℤ × ℤ := fun ⟨i, j⟩ => ⟨τ j, τ i⟩ /-- The slipface associated to an ASP permutation is defined by @@ -756,6 +764,7 @@ private lemma s_noninc_raw (a : ℤ) {b b' : ℤ} (b_le_b' : b ≤ b') : [An extended Demazure product](https://arxiv.org/abs/2206.14227) writes its values as $s_\tau(a,b)$; in Lean the corresponding value is `τ.sRaw a b`, and `τ.s` packages the same data as a `SlipFace`. -/ +@[expose] noncomputable def s : SlipFace := { func := τ.sRaw χ := τ.χ @@ -1102,6 +1111,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 incoming inversion indices at `v`. -/ +@[expose] def inset (v : ℤ) : Set ℤ := {u | ⟨u, v⟩ ∈ invSet τ} lemma inset_eq_nw (v : ℤ) : τ.inset v = northwestSet τ (τ v) v := by @@ -1127,6 +1137,7 @@ lemma inset_finite (v : ℤ) : (τ.inset v).Finite := by apply τ.nw_finite /-- The outgoing inversion indices at `u`. -/ +@[expose] def outset (u : ℤ) : Set ℤ := {v | ⟨u, v⟩ ∈ invSet τ} lemma outset_eq_se (u : ℤ) : τ.outset u = southeastSet τ (τ u) u := by @@ -1606,12 +1617,14 @@ $\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).* -/ +@[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 τ /-- Notation for the left weak order on almost sign-preserving permutations. -/ infix:50 " ≤L " => leWeakL @@ -1620,6 +1633,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 /-- Notation for the right weak order on almost sign-preserving permutations. -/ infix:50 " ≤R " => leWeakR @@ -1746,25 +1760,30 @@ lemma sr_subset (τ α : AspPerm) (h_R : α ≤R τ) : (τ.sr α) '' invSet α exact ⟨u_lt_v, τu_gt_τv⟩ /-- Every intermediate-index sum of the two slipfaces is at least `n`. -/ +@[expose] def dprodValGe (α β : AspPerm) (a b n : ℤ) : Prop := ∀ l : ℤ, α.s a l + β.s l b ≥ n /-- The slipface of `τ` lies below every intermediate-index sum defining the Demazure product of `α` and `β`. -/ +@[expose] def leDprod (τ α β : AspPerm) : Prop := ∀ a b : ℤ, dprodValGe α β a b (τ.s a b) /-- Some intermediate-index sum of the two slipfaces is at most `n`. -/ +@[expose] def dprodValLe (α β : AspPerm) (a b n : ℤ) : Prop := ∃ l : ℤ, α.s a l + β.s l b ≤ n /-- At each pair of coordinates, an intermediate-index sum for `α` and `β` lies below the slipface of `τ`. -/ +@[expose] def geDprod (τ α β : AspPerm) : Prop := ∀ a b : ℤ, dprodValLe α β a b (τ.s a b) /-- The lower and upper slipface inequalities characterizing `τ` as the Demazure product of `α` and `β`. -/ +@[expose] def eqDprod (τ α β : AspPerm) : Prop := τ.leDprod α β ∧ τ.geDprod α β diff --git a/LeanPool/BrillNoetherGraphs/Demazure/InvSet.lean b/LeanPool/BrillNoetherGraphs/Demazure/InvSet.lean index 720fe155bc..379d6df7bb 100644 --- a/LeanPool/BrillNoetherGraphs/Demazure/InvSet.lean +++ b/LeanPool/BrillNoetherGraphs/Demazure/InvSet.lean @@ -17,7 +17,7 @@ It corresponds to Theorem 2.13 of [An extended Demazure product](https://arxiv.org/abs/2206.14227). -/ -@[expose] public section +public section /-- The axioms characterizing inversion sets of ASP permutations: directedness, closure, coclosure, and finite in/out degree. *Definition 2.12 (`defn:aspSet`) of @@ -172,6 +172,7 @@ lemma AspSet_InvSet_of_AspPerm (τ : AspPerm) : AspSet_prop (invSet τ) := by · exact τ.inset_finite /-- The abstract inversion set carried by an almost sign-preserving permutation. -/ +@[expose] def ofAspPerm (τ : AspPerm) : AspSet := ⟨invSet τ, AspSet_InvSet_of_AspPerm τ⟩ @@ -227,6 +228,7 @@ private lemma post_Ico_swap_eq_empty_of_post_lt (asps : AspSet) {m n : ℤ} (hmn /-- Reconstruct a function `ℤ → ℤ` from an abstract ASP inversion set and a shift parameter `χ`. -/ +@[expose] noncomputable def recon (asps : AspSet) (χ : ℤ) : ℤ → ℤ := fun n => n + (asps.outset n).card - (asps.inset n).card - χ @@ -645,6 +647,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 χ⟩ @@ -692,6 +695,7 @@ end OfAspSet /-- ASP permutations are equivalent to abstract ASP inversion sets together with a shift parameter. *Theorem 2.13 (`thm:aspSetReconstruction`) of [An extended Demazure product](https://arxiv.org/abs/2206.14227).* -/ +@[expose] noncomputable def AspPermEquivAspSet : AspPerm ≃ AspSet × ℤ where toFun τ := (⟨invSet τ, AspSet_InvSet_of_AspPerm τ⟩, τ.χ) diff --git a/LeanPool/BrillNoetherGraphs/Demazure/ReducedProducts.lean b/LeanPool/BrillNoetherGraphs/Demazure/ReducedProducts.lean index 50b0c8cde0..d1d9d659d5 100644 --- a/LeanPool/BrillNoetherGraphs/Demazure/ReducedProducts.lean +++ b/LeanPool/BrillNoetherGraphs/Demazure/ReducedProducts.lean @@ -15,7 +15,7 @@ permutations. It corresponds roughly to Section 5 of [An extended Demazure product](https://arxiv.org/abs/2206.14227). -/ -@[expose] public section +public section /-! ### Reduced products and ordinary products diff --git a/LeanPool/BrillNoetherGraphs/Demazure/Reduction.lean b/LeanPool/BrillNoetherGraphs/Demazure/Reduction.lean index 19ef14cd81..1b77ecd7cd 100644 --- a/LeanPool/BrillNoetherGraphs/Demazure/Reduction.lean +++ b/LeanPool/BrillNoetherGraphs/Demazure/Reduction.lean @@ -15,7 +15,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 Reduction diff --git a/LeanPool/BrillNoetherGraphs/Demazure/SlipFace.lean b/LeanPool/BrillNoetherGraphs/Demazure/SlipFace.lean index 694eba5b33..6ad3a544fb 100644 --- a/LeanPool/BrillNoetherGraphs/Demazure/SlipFace.lean +++ b/LeanPool/BrillNoetherGraphs/Demazure/SlipFace.lean @@ -18,7 +18,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 /-- A slipface function of shift `χ`, i.e. a function $s : \mathbb{Z}^2 \to \mathbb{N}$ satisfying conditions (S1) to (S3) from @@ -329,6 +329,7 @@ properties. -/ /-- The valley $\ell \mapsto s(a,\ell) + t(\ell,b)$ whose minimum computes the slipface product at `(a,b)`. -/ +@[expose] noncomputable def SlipValley (s t : SlipFace) (a b : ℤ) : Valley where f := fun l => s a l + t l b rises := by @@ -356,6 +357,7 @@ In Lean, `starFunction s t a b` is this integer value, while `s ⋆ t` is the re `SlipFace`. See *Definition 3.7 (`defn:sfAlgebra`) of [An extended Demazure product](https://arxiv.org/abs/2206.14227).* -/ +@[expose] noncomputable def starFunction (s t : SlipFace) : ℤ → ℤ → ℤ := fun a b => (SlipValley s t a b).min @@ -623,6 +625,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, @@ -777,6 +780,7 @@ $$ $$ See *Definition 3.7* (`defn:sfAlgebra`) of [An extended Demazure product](https://arxiv.org/abs/2206.14227). -/ +@[expose] noncomputable def leftResidualFunction (s t : SlipFace) : ℤ → ℤ → ℤ := fun a b => s a (leftResidualWitness s t a b) - t.dual b (leftResidualWitness s t a b) @@ -1277,6 +1281,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.* -/ +@[expose] def bendSet (t : SlipFace) (b : ℤ) : Set ℤ := {l : ℤ | t (l-1) b = t l b ∧ t l b ≠ t (l+1) b} @@ -1715,6 +1720,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) @@ -1827,11 +1833,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 @@ -1849,6 +1857,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) \}.$ -/ +@[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)} @@ -1948,6 +1957,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/BrillNoetherGraphs/Demazure/Submodular.lean b/LeanPool/BrillNoetherGraphs/Demazure/Submodular.lean index 876962ca3d..fe41a23ebf 100644 --- a/LeanPool/BrillNoetherGraphs/Demazure/Submodular.lean +++ b/LeanPool/BrillNoetherGraphs/Demazure/Submodular.lean @@ -18,7 +18,7 @@ It corresponds roughly to Section 4 of [An extended Demazure product](https://arxiv.org/abs/2206.14227). -/ -@[expose] public section +public section /-! ### Submodular slipfaces and recovery of ASP permutations @@ -1308,7 +1308,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 `≤χ`. -/ -def leChi (σ τ : AspPerm) : Prop := σ ≤ τ ∧ σ.χ = τ.χ +@[expose] def leChi (σ τ : AspPerm) : Prop := σ ≤ τ ∧ σ.χ = τ.χ /-- Bruhat comparison restricted to permutations with equal shift. -/ infix:50 " ≤χ " => leChi diff --git a/LeanPool/BrillNoetherGraphs/Demazure/Transpositions.lean b/LeanPool/BrillNoetherGraphs/Demazure/Transpositions.lean index c26cc165c3..e0b3a6613f 100644 --- a/LeanPool/BrillNoetherGraphs/Demazure/Transpositions.lean +++ b/LeanPool/BrillNoetherGraphs/Demazure/Transpositions.lean @@ -17,12 +17,13 @@ Theorem A and the theorem labeled `thm:resL`, which describe the special case of $S = \{n\}$ a singleton. -/ -@[expose] public section +public section namespace Transpositions /-- A set of integers contains no consecutive pair. This asymmetric formulation is enough on `ℤ`: applying it to `n - 1` rules out `n - 1, n`. -/ +@[expose] def NoConsecutive (S : Set ℤ) : Prop := ∀ n : ℤ, n ∈ S → n + 1 ∉ S @@ -35,6 +36,7 @@ private lemma noConsecutive_singleton (n : ℤ) : NoConsecutive ({n} : Set ℤ) /-- The underlying function of $\sigma_S$: swap $n$ with $n + 1$ for every $n \in S$, and fix all other integers. -/ +@[expose] noncomputable def sigmaFun (S : Set ℤ) (n : ℤ) : ℤ := open Classical in if n ∈ S then n + 1 else if n - 1 ∈ S then n - 1 else n @@ -104,6 +106,7 @@ private lemma sigmaFun_asp (S : Set ℤ) : isAsp (sigmaFun S) := by /-- The ASP permutation $\sigma_S$, exchanging each adjacent pair $n, n + 1$ for $n \in S$. -/ +@[expose] noncomputable def sigma (S : Set ℤ) (hS : NoConsecutive S) : AspPerm where func := sigmaFun S bijective := by exact ⟨sigmaFun_injective hS, sigmaFun_surjective hS⟩ @@ -642,6 +645,7 @@ theorem asp_residual_sigma_sf (S : Set ℤ) (hS : NoConsecutive S) /-- The subset of $S$ where right multiplication by $\sigma_S$ should increase the permutation in Bruhat order. -/ +@[expose] def risingSet (α : AspPerm) (S : Set ℤ) : Set ℤ := {n : ℤ | n ∈ S ∧ α n < α (n + 1)} diff --git a/LeanPool/BrillNoetherGraphs/Demazure/Utils.lean b/LeanPool/BrillNoetherGraphs/Demazure/Utils.lean index 5d25a4ff15..ebdc0a2306 100644 --- a/LeanPool/BrillNoetherGraphs/Demazure/Utils.lean +++ b/LeanPool/BrillNoetherGraphs/Demazure/Utils.lean @@ -18,7 +18,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 Utils diff --git a/LeanPool/BrillNoetherGraphs/Demazure/Valley.lean b/LeanPool/BrillNoetherGraphs/Demazure/Valley.lean index b25303540f..4fa0722379 100644 --- a/LeanPool/BrillNoetherGraphs/Demazure/Valley.lean +++ b/LeanPool/BrillNoetherGraphs/Demazure/Valley.lean @@ -21,7 +21,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 /-- A function on `ℤ` whose sublevel sets are finite. This is the abstraction used to talk about minima and rightmost minimizers. @@ -100,6 +100,7 @@ lemma M_spec : ∀ n : ℤ, v.f n ≥ v.f v.M ∧ (n > v.M → v.f n > v.f v.M) simpa [M] using Finset.le_max' (v.floor v.min) n this /-- Shift every value of a valley downward by the constant `k`. -/ +@[expose] def shiftDown (k : ℤ) : Valley where f := fun n => v.f n - k rises := by diff --git a/LeanPool/BrillNoetherGraphs/Highlights.lean b/LeanPool/BrillNoetherGraphs/Highlights.lean index 7d3f653560..284a3cdd00 100644 --- a/LeanPool/BrillNoetherGraphs/Highlights.lean +++ b/LeanPool/BrillNoetherGraphs/Highlights.lean @@ -30,7 +30,7 @@ lower bound on divisorial gonality. Further headline theorems can be added one at a time in the same style. -/ -@[expose] public section +public section namespace Highlights @@ -622,6 +622,7 @@ conversion is where the file deliberately crosses into the implementation library. -/ /-- View a public graph in the chip-firing implementation model. -/ +@[expose] def libraryGraph (G : CFGraph) : _root_.CFGraph := { V := G.V instDecidableEq := G.instDecidableEq diff --git a/LeanPool/BrillNoetherGraphs/LowGenus.lean b/LeanPool/BrillNoetherGraphs/LowGenus.lean index 9a6de2d936..da9e92e38f 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus.lean @@ -88,4 +88,4 @@ certificates and is outside the dependency closure of Add an import line above whenever a module is added under `LowGenus/`, or `lake build LowGenus` will silently skip it. -/ -@[expose] public section +public section diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/AtanasovRanganathanExistence.lean b/LeanPool/BrillNoetherGraphs/LowGenus/AtanasovRanganathanExistence.lean index aade1a0bb7..a32577de64 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/AtanasovRanganathanExistence.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/AtanasovRanganathanExistence.lean @@ -21,7 +21,7 @@ Semantic loops in either genus are discharged uniformly after fossilization by splitting off a rigid genus-one wedge factor. -/ -@[expose] public section +public section namespace AtanasovRanganathan open Utilities diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/AtanasovRanganathanProgram.lean b/LeanPool/BrillNoetherGraphs/LowGenus/AtanasovRanganathanProgram.lean index 2bec23e84e..cc45247221 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/AtanasovRanganathanProgram.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/AtanasovRanganathanProgram.lean @@ -31,7 +31,7 @@ cores, and connect the loop, bridge, and contraction reductions to those core statements. -/ -@[expose] public section +public section namespace AtanasovRanganathan @@ -44,6 +44,7 @@ open Certificate.SubdivisionGraph /-- A fixed ordered loopless core carries a degree-`degree` rank-one pencil on every assignment of positive integral edge lengths. This is the exact target proved by each uniform configuration calculation in the paper. -/ +@[expose] def PositiveSubdivisionPencil {n p : ℕ} (core : Core n p) (core_nonempty : 0 < n) (core_loopless : ∀ edge : Fin p, core.tail edge ≠ core.head edge) @@ -62,6 +63,7 @@ This formulation deliberately does not mention the historical numbering of the sixteen cubic pictures. A finite catalog theorem may discharge these quantifiers later, while structural proofs can already handle looped, separated, and small-core families directly. -/ +@[expose] def GenusFivePseudocorePencils : Prop := ∀ (vertexCount : ℕ) (core : Certificate.GenusFourPseudocore.Pseudocore vertexCount) diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/ClosedConstructionTail.lean b/LeanPool/BrillNoetherGraphs/LowGenus/ClosedConstructionTail.lean index 829526fc3a..0ea1284301 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/ClosedConstructionTail.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/ClosedConstructionTail.lean @@ -22,7 +22,7 @@ Only the middle statement is row specific. This file packages the other three once, so that a row's closing theorem is a single application. -/ -@[expose] public section +public section namespace AtanasovRanganathan.Configurations diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationBananaDoubleChip.lean b/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationBananaDoubleChip.lean index d2f2a0eb41..efff1e4e38 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationBananaDoubleChip.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationBananaDoubleChip.lean @@ -53,7 +53,7 @@ programme where a canonical ramp runs at **slope two** -- `headContribution q 0 (2 * q) = 2`. The four one-edge facts that needs are proved first. -/ -@[expose] public section +public section namespace AtanasovRanganathan.ConfigurationBananaDoubleChip @@ -115,9 +115,11 @@ theorem doubleChip_add_tail_nonneg {L h : ℕ} (hh : h ≤ 2 * L) : /-- The height at the near vertex: two chips' worth of its own arm, clamped by the far arm. -/ +@[expose] def nearHeight (p q : ℕ) : ℕ := min (2 * q) p /-- The height at the far vertex, the target. -/ +@[expose] def farHeight (p q par : ℕ) : ℕ := min p (nearHeight p q + par) theorem nearHeight_le_far {p q par : ℕ} : diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationBananaTail.lean b/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationBananaTail.lean index 387db2a2db..2eff873f67 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationBananaTail.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationBananaTail.lean @@ -70,7 +70,7 @@ orientation ledger extends `ConfigurationThreeChain.ChainLedger` by the one fact proofs below need that it does not carry. -/ -@[expose] public section +public section namespace AtanasovRanganathan.ConfigurationBananaTail @@ -92,11 +92,13 @@ structure BananaLedger extends ChainLedger where toChainLedger.head L hu hv = 1 /-- The slot read from its core tail. -/ +@[expose] def fwd : BananaLedger where toChainLedger := ConfigurationThreeChain.forward head_eq_one_of_full h1 h2 := headContribution_eq_one_of_full h1 h2 /-- The same slot read from its core head. -/ +@[expose] def rev : BananaLedger where toChainLedger := ConfigurationThreeChain.reverse head_eq_one_of_full h1 h2 := tailContribution_eq_one_of_full h1 h2 diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationChippedTriangle.lean b/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationChippedTriangle.lean index cc16f62991..83946dd496 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationChippedTriangle.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationChippedTriangle.lean @@ -58,7 +58,7 @@ class, so `c` lends it the chip it is sitting on. That transfer is `lend`, and it is the only allocation the picture needs. -/ -@[expose] public section +public section namespace AtanasovRanganathan.ConfigurationChippedTriangle @@ -88,6 +88,7 @@ def partnerHeight (al be ga p q r : ℕ) : ℕ := /-- The chip `c` lends its partner when the slot between them has collapsed and `c` is strictly shallower than the partner's own arm. -/ +@[expose] def lend (r hc be : ℕ) : ℤ := if r = 0 ∧ hc < be then 1 else 0 theorem lend_nonneg (r hc be : ℕ) : 0 ≤ lend r hc be := by @@ -131,6 +132,7 @@ theorem bounds {al be ga p q r hc h0 ht hv : ℕ} /-- The target delivers its own chip: its arm goes full, or one of the two triangle slots at it goes full. -/ +@[expose] def Delivers (al p q hc h0 ht : ℕ) : Prop := ht = al ∨ (0 < p ∧ ht = hc + p) ∨ (0 < q ∧ ht = h0 + q) diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationCommon.lean b/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationCommon.lean index 9fa65a08a1..462abe013e 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationCommon.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationCommon.lean @@ -40,7 +40,7 @@ inferred from the `DegSpec`, no genus-five call site had to change when this file stopped being genus-five specific. -/ -@[expose] public section +public section namespace AtanasovRanganathan.ConfigurationCommon @@ -95,6 +95,7 @@ theorem lastStep_neg_nonpos {L k : ℕ} (hk : 0 < k) (hkL : k ≤ L) : /-! ### The one-class potential -/ /-- Negative height on one contracted class and zero on all other classes. -/ +@[expose] def centerPotential (d : DegSpec n p) (center : Fin n) (height : ℕ) (v : Fin n) : ℤ := if d.rep v = d.rep center then -(height : ℤ) else 0 @@ -117,6 +118,7 @@ theorem centerPotential_eq_of_singleton /-! ### Endpoint bookkeeping -/ /-- The per-source-core endpoint contribution used by the class-sum formula. -/ +@[expose] def endpointContribution (d : DegSpec n p) (potential : Fin n → ℤ) (v : Fin n) : ℤ := ∑ e : Fin p, @@ -131,6 +133,7 @@ def endpointContribution (d : DegSpec n p) (potential : Fin n → ℤ) /-- The two endpoint terms contributed by one original core slot to one contracted core class. Keeping them paired is essential on a closed face: when a zero slot is contracted, its two artificial endpoint terms cancel. -/ +@[expose] def endpointPair (d : DegSpec n p) (potential : Fin n → ℤ) (e : Fin p) (r : Fin n) : ℤ := (if d.rep (d.core.tail e) = d.rep r then @@ -173,10 +176,12 @@ Both are handled by moving weight *within* a class, which leaves every class sum -- hence the divisor -- unchanged. -/ /-- The integer indicator assigning one chip at the source vertex and zero elsewhere. -/ +@[expose] def indicatorWeight (vertex source : Fin n) : ℤ := if vertex = source then 1 else 0 /-- The degree-zero weight that removes one chip at the source and adds one at the target. -/ +@[expose] def transferWeight (source target vertex : Fin n) : ℤ := indicatorWeight vertex target - indicatorWeight vertex source @@ -202,6 +207,7 @@ theorem sum_indicatorWeight_class /-- Endpoint contribution with the artificial endpoints of a zero slot suppressed. Those two terms cancel after passing to a contracted class. -/ +@[expose] def positiveEndpointContribution (d : DegSpec n p) (potential : Fin n → ℤ) (v : Fin n) : ℤ := ∑ e : Fin p, diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationEleven.lean b/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationEleven.lean index ad88097047..8d988c3d64 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationEleven.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationEleven.lean @@ -97,7 +97,7 @@ row 10 supplies `alpha = gamma` in the first place. The one-edge arithmetic is `ConfigurationFive`'s, reused unchanged. -/ -@[expose] public section +public section namespace AtanasovRanganathan.ConfigurationEleven diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationFive.lean b/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationFive.lean index a9cd0d0586..5cffbc453b 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationFive.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationFive.lean @@ -34,7 +34,7 @@ spelled out directly. A row supplies its lookup tables and the five height equations; nothing else. -/ -@[expose] public section +public section namespace AtanasovRanganathan.ConfigurationFive @@ -47,11 +47,13 @@ open Certificate.DegenerateSpec /-! ## One-edge arithmetic used by configuration 5 -/ /-- The contribution at the tail of a subdivided edge with the prescribed endpoint heights. -/ +@[expose] def tailContribution (L hu hv : ℕ) : ℤ := if L = 0 then 0 else SubdivisionArithmetic.step L ((hu : ℤ) - (hv : ℤ)) 0 /-- The contribution at the head of a subdivided edge with the prescribed endpoint heights. -/ +@[expose] def headContribution (L hu hv : ℕ) : ℤ := if L = 0 then 0 else -SubdivisionArithmetic.step L ((hu : ℤ) - (hv : ℤ)) (L - 1) @@ -138,8 +140,10 @@ theorem headContribution_eq_one_of_full {L hu hv : ℕ} ConfigurationCommon.lastStep_neg_full_eq_neg_one hL] /-- One chip when the edge length is positive, and zero for a collapsed edge. -/ +@[expose] def positiveChip (L : ℕ) : ℤ := if L = 0 then 0 else 1 /-- One chip for a collapsed edge, and zero when the edge length is positive. -/ +@[expose] def zeroChip (L : ℕ) : ℤ := if L = 0 then 1 else 0 theorem positiveChip_nonneg (L : ℕ) : 0 ≤ positiveChip L := by @@ -253,6 +257,7 @@ structure SlotLedger where 0 ≤ positiveChip L + head L h 0 /-- The slot read from its tail. -/ +@[expose] def forward : SlotLedger where tail := tailContribution head := headContribution @@ -261,6 +266,7 @@ def forward : SlotLedger where positiveChip_add_head_nonneg h := positiveChip_add_head_nonneg h /-- The same slot read from its head. -/ +@[expose] def reverse : SlotLedger where tail L hu hv := headContribution L hv hu head L hu hv := tailContribution L hv hu diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationMarkedCommon.lean b/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationMarkedCommon.lean index f6eb7f9cbf..a987dd2463 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationMarkedCommon.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationMarkedCommon.lean @@ -38,7 +38,7 @@ is also the hypothesis under which the chip pays for the kink; see `Utilities/Subdivision/SplitRampArithmetic.lean`. -/ -@[expose] public section +public section namespace AtanasovRanganathan.ConfigurationMarkedCommon diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationMarkedRow.lean b/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationMarkedRow.lean index 394b411e60..345e14bb52 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationMarkedRow.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationMarkedRow.lean @@ -48,7 +48,7 @@ the height is constant across collapsed slots. Those five facts give costs a chamber nothing beyond declaring its profile. -/ -@[expose] public section +public section namespace AtanasovRanganathan.ConfigurationMarkedRow @@ -178,11 +178,13 @@ theorem marks_admissible {mark : Fin 12 → ℕ} {h : Fin 8 → ℕ} /-! ## Each slot as one or two ordinary arms -/ /-- The tail contribution of a slot, splitting at an interior mark when one is present. -/ +@[expose] def slotTailForm (mark : Fin 12 → ℕ) (h : Fin 8 → ℕ) (e : Fin 12) : ℤ := if 0 < mark e then tailContribution (mark e) (h (d.core.tail e)) 0 else tailContribution (d.length e) (h (d.core.tail e)) (h (d.core.head e)) /-- The head contribution of a slot, using the arm beyond an interior mark when it exists. -/ +@[expose] def slotHeadForm (mark : Fin 12 → ℕ) (h : Fin 8 → ℕ) (e : Fin 12) : ℤ := if 0 < mark e then (if mark e < d.length e then @@ -459,10 +461,12 @@ def markedDivisorOne (W : Fin 8 → ℤ) (mark : Fin 12 → ℕ) (e : Fin 12) : d.coreClassDivisor W + oneChip (d.pathAt e (mark e)) /-- The core-class weight of a two-mark divisor. -/ +@[expose] def baseTwo (W : Fin 8 → ℤ) (mark : Fin 12 → ℕ) (e f : Fin 12) (v : Fin 8) : ℤ := W v + markChipWeight d mark e v + markChipWeight d mark f v /-- The core-class weight of a one-mark divisor. -/ +@[expose] def baseOne (W : Fin 8 → ℤ) (mark : Fin 12 → ℕ) (e : Fin 12) (v : Fin 8) : ℤ := W v + markChipWeight d mark e v diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationMarkedThree.lean b/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationMarkedThree.lean index 68849c88a6..dc0a361a13 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationMarkedThree.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationMarkedThree.lean @@ -53,7 +53,7 @@ the two centres merge, and the chip may have to be charged to the partner. That is the `targetOwner` device every finished row already uses. -/ -@[expose] public section +public section namespace AtanasovRanganathan.ConfigurationMarkedThree @@ -87,6 +87,7 @@ def slotHeadTerm (potential : Fin 8 → ℤ) (mark : Fin 12 → ℕ) (d.length e - 1) /-- The per-vertex endpoint ledger of a marked script. -/ +@[expose] def positiveEndpointContribution (potential : Fin 8 → ℤ) (mark : Fin 12 → ℕ) (markValue : Fin 12 → ℤ) (v : Fin 8) : ℤ := ∑ e : Fin 12, @@ -356,6 +357,7 @@ the chip collapses, `mark = length` on the chamber wall where the figure's inequality is an equality. -/ /-- Where the chip at the mark of `e` sits, as a weight on core vertices. -/ +@[expose] def markChipWeight (mark : Fin 12 → ℕ) (e : Fin 12) (v : Fin 8) : ℤ := if mark e = 0 then (if v = d.core.tail e then 1 else 0) else if d.length e ≤ mark e then (if v = d.core.head e then 1 else 0) @@ -432,6 +434,7 @@ structure PairLedger where tail_eq_one_of_full : ∀ {L hu hv : ℕ}, 0 < L → hu = hv + L → tail L hu hv = 1 /-- The slot read from its tail. -/ +@[expose] def fwd : PairLedger where tail := tailContribution tail_nonneg h hUpper := tailContribution_nonneg h hUpper @@ -441,6 +444,7 @@ def fwd : PairLedger where tail_eq_one_of_full h hFull := tailContribution_eq_one_of_full h hFull /-- The same slot read from its head. -/ +@[expose] def rev : PairLedger where tail L hu hv := headContribution L hv hu tail_nonneg h hUpper := headContribution_nonneg h hUpper diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationMarkedTripod.lean b/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationMarkedTripod.lean index b40b8f45d9..833d845191 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationMarkedTripod.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationMarkedTripod.lean @@ -51,7 +51,7 @@ no collapsed-middle-slot case, so the delivered chip is always charged to the centre itself and a row needs no `owner` indirection at a tripod. -/ -@[expose] public section +public section namespace AtanasovRanganathan.ConfigurationMarkedTripod diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationSeven.lean b/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationSeven.lean index 85d6500e2a..58cf65d34d 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationSeven.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationSeven.lean @@ -52,7 +52,7 @@ pairs and covers the rest by other pictures. Rows `05` and `08` pair this file with `ConfigurationThree`. -/ -@[expose] public section +public section namespace AtanasovRanganathan.ConfigurationSeven diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationThree.lean b/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationThree.lean index 21bce77381..a54912b87f 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationThree.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationThree.lean @@ -49,7 +49,7 @@ and takes it as a hypothesis, the same one `Guarding.GuardingSet.closedConstruction` carries. -/ -@[expose] public section +public section namespace AtanasovRanganathan.ConfigurationThree @@ -69,6 +69,7 @@ variable {n p : ℕ} /-! ## Unordered incidence -/ /-- The slot `e` joins `u` and `v`, in either orientation. -/ +@[expose] def Ends (core : Core n p) (e : Fin p) (u v : Fin n) : Prop := (core.tail e = u ∧ core.head e = v) ∨ (core.tail e = v ∧ core.head e = u) @@ -114,6 +115,7 @@ theorem step_zero {L i : ℕ} (hi : i < L) : SubdivisionArithmetic.step_zero_of_lt hi /-- One chip leaves an arm exactly when its ramp has positive height. -/ +@[expose] def drain (height : ℕ) : ℤ := if 0 < height then 1 else 0 theorem drain_bounds (height : ℕ) : @@ -185,6 +187,7 @@ theorem sum_five (g : Fin p → ℤ) {a b c u v : Fin p} /-- The two endpoint terms one core slot contributes at one core vertex. This is literally the summand of `ConfigurationCommon.endpointContribution`. -/ +@[expose] def slotTerm (d : DegSpec n p) (potential : Fin n → ℤ) (e : Fin p) (v : Fin n) : ℤ := (if d.core.tail e = v then @@ -343,6 +346,7 @@ theorem endpointPair_arm (d : DegSpec n p) (potential : Fin n → ℤ) /-- Membership in a displayed four-chip set. Spelled out so that the fields of `ConfigThree` can refer to it. -/ +@[expose] def IsChipOf (a b c e v : Fin n) : Prop := v = a ∨ v = b ∨ v = c ∨ v = e instance (a b c e v : Fin n) : Decidable (IsChipOf a b c e v) := by @@ -484,6 +488,7 @@ theorem not_incident_of_ne {center : Fin n} (hCenter : cfg.isCenter center = tru /-! ### The displayed divisor -/ /-- The indicator of "the chip at `v` sits in the contracted class of `r`". -/ +@[expose] def chipInd (r v : Fin n) : ℤ := if d.rep v = d.rep r then 1 else 0 theorem chipInd_nonneg (r v : Fin n) : 0 ≤ chipInd d r v := by @@ -491,6 +496,7 @@ theorem chipInd_nonneg (r v : Fin n) : 0 ≤ chipInd d r v := by split_ifs <;> omega /-- One chip on each of the four displayed vertices. -/ +@[expose] def divisor : CFDiv d.graph := fourChipDivisor (d.coreVertex cfg.chipOne) (d.coreVertex cfg.chipTwo) (d.coreVertex cfg.chipThree) (d.coreVertex cfg.chipFour) diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationThreeChain.lean b/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationThreeChain.lean index 95edef0613..4557527c5d 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationThreeChain.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationThreeChain.lean @@ -73,7 +73,7 @@ The one-edge arithmetic itself is `ConfigurationFive`'s and is reused unchanged. -/ -@[expose] public section +public section namespace AtanasovRanganathan.ConfigurationThreeChain @@ -138,6 +138,7 @@ theorem positiveChip_add_head_nonneg {L hu hv : ℕ} end ChainLedger /-- The slot read from its core tail. -/ +@[expose] def forward : ChainLedger where tail := tailContribution head := headContribution @@ -150,6 +151,7 @@ def forward : ChainLedger where tail_eq_one_of_full h1 h2 := tailContribution_eq_one_of_full h1 h2 /-- The same slot read from its core head. -/ +@[expose] def reverse : ChainLedger where tail L hu hv := headContribution L hv hu head L hu hv := tailContribution L hv hu diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationTwo.lean b/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationTwo.lean index 083d0f7b2b..fb6a502105 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationTwo.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/ConfigurationTwo.lean @@ -37,7 +37,7 @@ currently lives in `ConfigurationThree.lean`; that is why this file imports it. Neither structure mentions the other. -/ -@[expose] public section +public section namespace AtanasovRanganathan.ConfigurationTwo @@ -55,6 +55,7 @@ open ConfigurationCommon open ConfigurationThree /-- The indicator of "the chip at `v` sits in the contracted class of `r`". -/ +@[expose] def chipInd (d : DegSpec 8 12) (r v : Fin 8) : ℤ := if d.rep v = d.rep r then 1 else 0 @@ -152,6 +153,7 @@ theorem chip_ne_center {chip center : Fin 8} (hChip : cfg.IsChip chip) variable (d : DegSpec 8 12) /-- One chip on each of the four displayed vertices. -/ +@[expose] def divisor : CFDiv d.graph := fourChipDivisor (d.coreVertex cfg.chipOne) (d.coreVertex cfg.chipTwo) (d.coreVertex cfg.chipThree) (d.coreVertex cfg.chipFour) diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/Generated.lean b/LeanPool/BrillNoetherGraphs/LowGenus/Generated.lean index 801d35817c..0472d5a5f9 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/Generated.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/Generated.lean @@ -16,4 +16,4 @@ public import LeanPool.BrillNoetherGraphs.LowGenus.Generated.GenusFourRow095Face /-! Supporting modules for Brill–Noether theory and gonality of finite graphs. -/ -@[expose] public section +public section diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/Generated/G4Row096.lean b/LeanPool/BrillNoetherGraphs/LowGenus/Generated/G4Row096.lean index a0169cc351..27fc92c0e2 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/Generated/G4Row096.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/Generated/G4Row096.lean @@ -29,7 +29,7 @@ The entailment certificates were synthesised by exact rational Farkas and re-verified over `ℤ` before emission; the kernel re-checks them anyway. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFourGeneratedRows.G4Row096 diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/Generated/G4Row099.lean b/LeanPool/BrillNoetherGraphs/LowGenus/Generated/G4Row099.lean index fba4e1d668..3a0a2c1cf9 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/Generated/G4Row099.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/Generated/G4Row099.lean @@ -29,7 +29,7 @@ The entailment certificates were synthesised by exact rational Farkas and re-verified over `ℤ` before emission; the kernel re-checks them anyway. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFourGeneratedRows.G4Row099 diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/Generated/G4Row100.lean b/LeanPool/BrillNoetherGraphs/LowGenus/Generated/G4Row100.lean index 8777ba6b13..c1f0d62a13 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/Generated/G4Row100.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/Generated/G4Row100.lean @@ -29,7 +29,7 @@ The entailment certificates were synthesised by exact rational Farkas and re-verified over `ℤ` before emission; the kernel re-checks them anyway. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFourGeneratedRows.G4Row100 diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/Generated/GenusFiveCanonicalClassifierData.lean b/LeanPool/BrillNoetherGraphs/LowGenus/Generated/GenusFiveCanonicalClassifierData.lean index 257a0513ea..e5db8eba84 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/Generated/GenusFiveCanonicalClassifierData.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/Generated/GenusFiveCanonicalClassifierData.lean @@ -40,7 +40,7 @@ Generated classifier data with `--n 8 --deg 3 --layout bucket`. -/ -@[expose] public section +public section namespace AtanasovRanganathan.Generated.GenusFiveCanonicalClassifierData @@ -60,6 +60,7 @@ with a vertex permutation matching the leaf table against that row. -/ abbrev Payload := Fin 20 × List (Fin 8) /-- The pair-multiplicity tables of the 20 atlas rows. -/ +@[expose] def atlasTable : List (List (List ℕ)) := [[[0, 2, 1, 0, 0, 0, 0, 0], [2, 0, 0, 1, 0, 0, 0, 0], [1, 0, 0, 1, 1, 0, 0, 0], [0, 1, 1, 0, 0, 1, 0, 0], [0, 0, 1, 0, 0, 1, 1, 0], [0, 0, 0, 1, 1, 0, 0, 1], [0, 0, 0, 0, 1, 0, 0, 2], [0, 0, @@ -123,10 +124,12 @@ def atlasTable : List (List (List ℕ)) := 0, 0, 0, 2, 1, 0]]] /-- One entry of one atlas table. -/ +@[expose] def atlasEntry (idx : Fin 20) (a b : Fin 8) : ℕ := ((atlasTable.getD idx.val []).getD a.val []).getD b.val 0 /-- A stored permutation, read as a function. -/ +@[expose] def permOf (p : List (Fin 8)) (i : Fin 8) : Fin 8 := p.getD i.val 0 @@ -134,14 +137,17 @@ def permOf (p : List (Fin 8)) (i : Fin 8) : Fin 8 := entry is at most `3`. This is only a lookup key: the checker verifies the payload it retrieves entry by entry, so a collision would cause `pruned_valid` to fail rather than to prove something false. -/ +@[expose] def rowKey (rows : List (List ℕ)) : ℕ := rows.foldl (fun acc row => row.foldl (fun a x => a * 4 + x) acc) 0 /-- The number of payload buckets. -/ +@[expose] def bucketCount : ℕ := 251 /-- Buckets 0 through 19 of the canonical genus-five classifier, storing row-key and payload associations for connected canonical leaves. -/ +@[expose] def payloadBucketPart0 : List (List (ℕ × Payload)) := [[ (26414401459200, (6, [6, 5, 2, 0, 3, 1, 7, 4])), @@ -230,6 +236,7 @@ def payloadBucketPart0 : List (List (ℕ × Payload)) := /-- Buckets 20 through 39 of the canonical genus-five classifier, storing row-key and payload associations for connected canonical leaves. -/ +@[expose] def payloadBucketPart1 : List (List (ℕ × Payload)) := [[ (26491635373056, (19, [6, 1, 5, 3, 0, 2, 7, 4])), @@ -321,6 +328,7 @@ def payloadBucketPart1 : List (List (ℕ × Payload)) := /-- Buckets 40 through 59 of the canonical genus-five classifier, storing row-key and payload associations for connected canonical leaves. -/ +@[expose] def payloadBucketPart2 : List (List (ℕ × Payload)) := [[ (26479077425412, (7, [1, 2, 7, 6, 5, 3, 4, 0])), @@ -421,6 +429,7 @@ def payloadBucketPart2 : List (List (ℕ × Payload)) := /-- Buckets 60 through 79 of the canonical genus-five classifier, storing row-key and payload associations for connected canonical leaves. -/ +@[expose] def payloadBucketPart3 : List (List (ℕ × Payload)) := [[ (93802088169744, (8, [0, 3, 7, 4, 5, 1, 2, 6]))], @@ -520,6 +529,7 @@ def payloadBucketPart3 : List (List (ℕ × Payload)) := /-- Buckets 80 through 99 of the canonical genus-five classifier, storing row-key and payload associations for connected canonical leaves. -/ +@[expose] def payloadBucketPart4 : List (List (ℕ × Payload)) := [[ (26491644821760, (7, [1, 7, 3, 2, 5, 6, 4, 0])), @@ -606,6 +616,7 @@ def payloadBucketPart4 : List (List (ℕ × Payload)) := /-- Buckets 100 through 119 of the canonical genus-five classifier, storing row-key and payload associations for connected canonical leaves. -/ +@[expose] def payloadBucketPart5 : List (List (ℕ × Payload)) := [[ (92381878157313, (18, [4, 5, 0, 1, 2, 3, 6, 7])), @@ -690,6 +701,7 @@ def payloadBucketPart5 : List (List (ℕ × Payload)) := /-- Buckets 120 through 139 of the canonical genus-five classifier, storing row-key and payload associations for connected canonical leaves. -/ +@[expose] def payloadBucketPart6 : List (List (ℕ × Payload)) := [[ (92771362881552, (6, [0, 5, 6, 1, 7, 2, 3, 4])), @@ -778,6 +790,7 @@ def payloadBucketPart6 : List (List (ℕ × Payload)) := /-- Buckets 140 through 159 of the canonical genus-five classifier, storing row-key and payload associations for connected canonical leaves. -/ +@[expose] def payloadBucketPart7 : List (List (ℕ × Payload)) := [[ (92703748800513, (8, [0, 4, 7, 5, 3, 6, 2, 1])), @@ -861,6 +874,7 @@ def payloadBucketPart7 : List (List (ℕ × Payload)) := /-- Buckets 160 through 179 of the canonical genus-five classifier, storing row-key and payload associations for connected canonical leaves. -/ +@[expose] def payloadBucketPart8 : List (List (ℕ × Payload)) := [[ (26491710624000, (0, [0, 6, 5, 3, 4, 7, 2, 1])), @@ -932,6 +946,7 @@ def payloadBucketPart8 : List (List (ℕ × Payload)) := /-- Buckets 180 through 199 of the canonical genus-five classifier, storing row-key and payload associations for connected canonical leaves. -/ +@[expose] def payloadBucketPart9 : List (List (ℕ × Payload)) := [[ (26749194813444, (7, [0, 5, 6, 2, 7, 4, 3, 1])), @@ -1010,6 +1025,7 @@ def payloadBucketPart9 : List (List (ℕ × Payload)) := /-- Buckets 200 through 219 of the canonical genus-five classifier, storing row-key and payload associations for connected canonical leaves. -/ +@[expose] def payloadBucketPart10 : List (List (ℕ × Payload)) := [[ (26427336507456, (1, [0, 3, 5, 2, 6, 4, 1, 7])), @@ -1091,6 +1107,7 @@ def payloadBucketPart10 : List (List (ℕ × Payload)) := /-- Buckets 220 through 239 of the canonical genus-five classifier, storing row-key and payload associations for connected canonical leaves. -/ +@[expose] def payloadBucketPart11 : List (List (ℕ × Payload)) := [[ (26414385792000, (6, [6, 5, 0, 2, 3, 1, 7, 4])), @@ -1177,6 +1194,7 @@ def payloadBucketPart11 : List (List (ℕ × Payload)) := /-- Buckets 240 through 250 of the canonical genus-five classifier, storing row-key and payload associations for connected canonical leaves. -/ +@[expose] def payloadBucketPart12 : List (List (ℕ × Payload)) := [[ (26414401519680, (6, [6, 5, 2, 3, 0, 1, 7, 4])), @@ -1224,6 +1242,7 @@ def payloadBucketPart12 : List (List (ℕ × Payload)) := keyed by `rowKey` of that leaf and split into 251 buckets. There are 777 payloads in all; the largest bucket holds 9. Disconnected leaves are absent by design. -/ +@[expose] def payloadBuckets : List (List (ℕ × Payload)) := payloadBucketPart0 ++ payloadBucketPart1 ++ @@ -1240,6 +1259,7 @@ def payloadBuckets : List (List (ℕ × Payload)) := payloadBucketPart12 /-- Look a leaf key up in its bucket. -/ +@[expose] def payloadLookup (key : ℕ) : Option Payload := List.lookup key (payloadBuckets.getD (key % bucketCount) []) diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/Generated/GenusFourCanonicalClassifierData.lean b/LeanPool/BrillNoetherGraphs/LowGenus/Generated/GenusFourCanonicalClassifierData.lean index 547e26ac6d..245325954e 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/Generated/GenusFourCanonicalClassifierData.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/Generated/GenusFourCanonicalClassifierData.lean @@ -18,7 +18,7 @@ pair-multiplicity tables and the twenty connected canonical leaf payloads. Generated classifier data, checked by the consuming Lean declarations. -/ -@[expose] public section +public section namespace AtanasovRanganathan.Generated.GenusFourCanonicalClassifierData open Utilities.Certificate.CubicMatrixReplay @@ -26,6 +26,7 @@ open Utilities.Certificate.CubicMatrixReplay abbrev Payload := Fin 6 × (Fin 6 → Fin 6) /-- Pair-multiplicity tables of the six atlas rows, in atlas order. -/ +@[expose] def atlasTable : Fin 6 → Fin 6 → Fin 6 → ℕ := ![ ![![0, 0, 0, 0, 1, 2], ![0, 0, 0, 1, 1, 1], ![0, 0, 0, 2, 1, 0], ![0, 1, 2, 0, 0, 0], ![1, 1, @@ -44,10 +45,12 @@ def atlasTable : Fin 6 → Fin 6 → Fin 6 → ℕ := /-- Base-four lookup key for a leaf row list. Payloads are independently checked entry by entry, so a key collision cannot validate a bad leaf. -/ +@[expose] def rowKey (rows : List (List ℕ)) : ℕ := rows.foldl (fun acc row => row.foldl (fun a x => a * 4 + x) acc) 0 /-- Payloads of all twenty connected leaves reached by the pruned traversal. -/ +@[expose] def payloadTable : List (ℕ × Payload) := [ (6379776, (0, ![0, 1, 2, 3, 4, 5])), diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/Generated/GenusFourClosedRows.lean b/LeanPool/BrillNoetherGraphs/LowGenus/Generated/GenusFourClosedRows.lean index b4f65b805f..022b84a107 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/Generated/GenusFourClosedRows.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/Generated/GenusFourClosedRows.lean @@ -31,7 +31,7 @@ face. Their Farkas receipts and firing scripts are rechecked by Lean's kernel; no external checker is trusted. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFourGeneratedRows open Utilities diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/Generated/GenusFourRow095FaceData.lean b/LeanPool/BrillNoetherGraphs/LowGenus/Generated/GenusFourRow095FaceData.lean index 5c876e9547..5a1c4469af 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/Generated/GenusFourRow095FaceData.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/Generated/GenusFourRow095FaceData.lean @@ -21,7 +21,7 @@ vertex representatives, surviving slots, and slot reversals. Every field is rechecked by the kernel through `decide`. -/ -@[expose] public section +public section namespace AtanasovRanganathan.Generated.GenusFourRow095FaceData open Utilities.Certificate @@ -32,28 +32,33 @@ open LowGenus.GenusFourRow095 open LowGenus.GenusFourRow097Contractions /-- The two-vertex target core with five parallel edges, used by the row 095 face certificates. -/ +@[expose] def core002 : ExplicitPotential.Core 2 5 where tail := ![0, 0, 0, 0, 0] head := ![1, 1, 1, 1, 1] /-- The three-vertex target core with three edges from each of vertices zero and one to vertex two. -/ +@[expose] def core009 : ExplicitPotential.Core 3 6 where tail := ![0, 0, 0, 1, 1, 1] head := ![2, 2, 2, 2, 2, 2] /-- The three-vertex target core with edge multiplicities one, two, and three between its vertex pairs. -/ +@[expose] def core010 : ExplicitPotential.Core 3 6 where tail := ![0, 0, 0, 1, 1, 1] head := ![1, 2, 2, 2, 2, 2] /-- The four-vertex, seven-slot target core used for the row 095 contraction faces. -/ +@[expose] def core029 : ExplicitPotential.Core 4 7 where tail := ![0, 0, 0, 1, 1, 1, 2] head := ![3, 3, 3, 2, 2, 3, 3] /-- The five-vertex, eight-slot target core used for the row 095 contraction faces. -/ +@[expose] def core069 : ExplicitPotential.Core 5 8 where tail := ![0, 0, 0, 1, 1, 1, 2, 3] head := ![3, 4, 4, 2, 2, 3, 3, 4] @@ -116,6 +121,7 @@ def rev0358 : Fin 5 → Bool := ![false, false, true, false, false] /-- The checked contraction of row 095 along source slots {0} onto `core068`, oriented by `rev0`. -/ +@[expose] def data0 : ContractionData core (Core.reorient core068 rev0) where F := {0}; vtx := ![2, 1, 5, 4, 3]; slot := ![8, 6, 7, 5, 4, 3, 1, 2] isForest := by decide @@ -131,6 +137,7 @@ def data0 : ContractionData core (Core.reorient core068 rev0) where /-- The checked contraction of row 095 along source slots {3} onto `core068`, oriented by `rev3`. -/ +@[expose] def data3 : ContractionData core (Core.reorient core068 rev3) where F := {3}; vtx := ![5, 4, 2, 3, 0]; slot := ![5, 1, 2, 8, 4, 0, 6, 7] isForest := by decide @@ -146,6 +153,7 @@ def data3 : ContractionData core (Core.reorient core068 rev3) where /-- The checked contraction of row 095 along source slots {5} onto `core068`, oriented by `rev5`. -/ +@[expose] def data5 : ContractionData core (Core.reorient core068 rev5) where F := {5}; vtx := ![3, 4, 0, 5, 2]; slot := ![3, 6, 7, 0, 4, 8, 1, 2] isForest := by decide @@ -161,6 +169,7 @@ def data5 : ContractionData core (Core.reorient core068 rev5) where /-- The checked contraction of row 095 along source slots {8} onto `core068`, oriented by `rev8`. -/ +@[expose] def data8 : ContractionData core (Core.reorient core068 rev8) where F := {8}; vtx := ![0, 1, 3, 4, 5]; slot := ![0, 1, 2, 3, 4, 5, 6, 7] isForest := by decide @@ -176,6 +185,7 @@ def data8 : ContractionData core (Core.reorient core068 rev8) where /-- The checked contraction of row 095 along source slots {4} onto `core069`, oriented by `rev4`. -/ +@[expose] def data4 : ContractionData core (Core.reorient core069 rev4) where F := {4}; vtx := ![0, 2, 3, 4, 5]; slot := ![0, 1, 2, 6, 7, 8, 3, 5] isForest := by decide @@ -191,6 +201,7 @@ def data4 : ContractionData core (Core.reorient core069 rev4) where /-- The checked contraction of row 095 along source slots {0, 4} onto `core029`, oriented by `rev04`. -/ +@[expose] def data04 : ContractionData core (Core.reorient core029 rev04) where F := {0, 4}; vtx := ![5, 2, 3, 4]; slot := ![1, 2, 5, 6, 7, 8, 3] isForest := by decide @@ -206,6 +217,7 @@ def data04 : ContractionData core (Core.reorient core029 rev04) where /-- The checked contraction of row 095 along source slots {3, 4} onto `core029`, oriented by `rev34`. -/ +@[expose] def data34 : ContractionData core (Core.reorient core029 rev34) where F := {3, 4}; vtx := ![2, 0, 5, 4]; slot := ![6, 7, 8, 1, 2, 0, 5] isForest := by decide @@ -221,6 +233,7 @@ def data34 : ContractionData core (Core.reorient core029 rev34) where /-- The checked contraction of row 095 along source slots {4, 5} onto `core029`, oriented by `rev45`. -/ +@[expose] def data45 : ContractionData core (Core.reorient core029 rev45) where F := {4, 5}; vtx := ![0, 2, 3, 5]; slot := ![0, 1, 2, 6, 7, 8, 3] isForest := by decide @@ -236,6 +249,7 @@ def data45 : ContractionData core (Core.reorient core029 rev45) where /-- The checked contraction of row 095 along source slots {4, 8} onto `core029`, oriented by `rev48`. -/ +@[expose] def data48 : ContractionData core (Core.reorient core029 rev48) where F := {4, 8}; vtx := ![3, 0, 5, 4]; slot := ![3, 6, 7, 1, 2, 0, 5] isForest := by decide @@ -251,6 +265,7 @@ def data48 : ContractionData core (Core.reorient core029 rev48) where /-- The checked contraction of row 095 along source slots {0, 8} onto `core031`, oriented by `rev08`. -/ +@[expose] def data08 : ContractionData core (Core.reorient core031 rev08) where F := {0, 8}; vtx := ![3, 5, 1, 4]; slot := ![3, 6, 7, 5, 1, 2, 4] isForest := by decide @@ -266,6 +281,7 @@ def data08 : ContractionData core (Core.reorient core031 rev08) where /-- The checked contraction of row 095 along source slots {3, 5} onto `core031`, oriented by `rev35`. -/ +@[expose] def data35 : ContractionData core (Core.reorient core031 rev35) where F := {3, 5}; vtx := ![0, 2, 4, 5]; slot := ![0, 1, 2, 8, 6, 7, 4] isForest := by decide @@ -281,6 +297,7 @@ def data35 : ContractionData core (Core.reorient core031 rev35) where /-- The checked contraction of row 095 along source slots {0, 3} onto `core032`, oriented by `rev03`. -/ +@[expose] def data03 : ContractionData core (Core.reorient core032 rev03) where F := {0, 3}; vtx := ![2, 5, 4, 3]; slot := ![8, 6, 7, 1, 2, 5, 4] isForest := by decide @@ -296,6 +313,7 @@ def data03 : ContractionData core (Core.reorient core032 rev03) where /-- The checked contraction of row 095 along source slots {5, 8} onto `core032`, oriented by `rev58`. -/ +@[expose] def data58 : ContractionData core (Core.reorient core032 rev58) where F := {5, 8}; vtx := ![0, 3, 4, 5]; slot := ![0, 1, 2, 6, 7, 3, 4] isForest := by decide @@ -311,6 +329,7 @@ def data58 : ContractionData core (Core.reorient core032 rev58) where /-- The checked contraction of row 095 along source slots {0, 5} onto `core034`, oriented by `rev05`. -/ +@[expose] def data05 : ContractionData core (Core.reorient core034 rev05) where F := {0, 5}; vtx := ![2, 5, 4, 3]; slot := ![8, 6, 7, 1, 2, 4, 3] isForest := by decide @@ -326,6 +345,7 @@ def data05 : ContractionData core (Core.reorient core034 rev05) where /-- The checked contraction of row 095 along source slots {3, 8} onto `core034`, oriented by `rev38`. -/ +@[expose] def data38 : ContractionData core (Core.reorient core034 rev38) where F := {3, 8}; vtx := ![0, 3, 4, 5]; slot := ![0, 1, 2, 4, 6, 7, 5] isForest := by decide @@ -341,6 +361,7 @@ def data38 : ContractionData core (Core.reorient core034 rev38) where /-- The checked contraction of row 095 along source slots {0, 3, 4} onto `core009`, oriented by `rev034`. -/ +@[expose] def data034 : ContractionData core (Core.reorient core009 rev034) where F := {0, 3, 4}; vtx := ![2, 5, 4]; slot := ![6, 7, 8, 1, 2, 5] isForest := by decide @@ -356,6 +377,7 @@ def data034 : ContractionData core (Core.reorient core009 rev034) where /-- The checked contraction of row 095 along source slots {3, 4, 5} onto `core009`, oriented by `rev345`. -/ +@[expose] def data345 : ContractionData core (Core.reorient core009 rev345) where F := {3, 4, 5}; vtx := ![0, 2, 5]; slot := ![0, 1, 2, 6, 7, 8] isForest := by decide @@ -371,6 +393,7 @@ def data345 : ContractionData core (Core.reorient core009 rev345) where /-- The checked contraction of row 095 along source slots {0, 4, 8} onto `core009`, oriented by `rev048`. -/ +@[expose] def data048 : ContractionData core (Core.reorient core009 rev048) where F := {0, 4, 8}; vtx := ![3, 5, 4]; slot := ![3, 6, 7, 1, 2, 5] isForest := by decide @@ -386,6 +409,7 @@ def data048 : ContractionData core (Core.reorient core009 rev048) where /-- The checked contraction of row 095 along source slots {4, 5, 8} onto `core009`, oriented by `rev458`. -/ +@[expose] def data458 : ContractionData core (Core.reorient core009 rev458) where F := {4, 5, 8}; vtx := ![0, 3, 5]; slot := ![0, 1, 2, 3, 6, 7] isForest := by decide @@ -401,6 +425,7 @@ def data458 : ContractionData core (Core.reorient core009 rev458) where /-- The checked contraction of row 095 along source slots {0, 3, 5} onto `core010`, oriented by `rev035`. -/ +@[expose] def data035 : ContractionData core (Core.reorient core010 rev035) where F := {0, 3, 5}; vtx := ![2, 4, 5]; slot := ![8, 6, 7, 1, 2, 4] isForest := by decide @@ -416,6 +441,7 @@ def data035 : ContractionData core (Core.reorient core010 rev035) where /-- The checked contraction of row 095 along source slots {0, 3, 8} onto `core010`, oriented by `rev038`. -/ +@[expose] def data038 : ContractionData core (Core.reorient core010 rev038) where F := {0, 3, 8}; vtx := ![5, 3, 4]; slot := ![5, 1, 2, 4, 6, 7] isForest := by decide @@ -431,6 +457,7 @@ def data038 : ContractionData core (Core.reorient core010 rev038) where /-- The checked contraction of row 095 along source slots {0, 5, 8} onto `core010`, oriented by `rev058`. -/ +@[expose] def data058 : ContractionData core (Core.reorient core010 rev058) where F := {0, 5, 8}; vtx := ![3, 5, 4]; slot := ![3, 6, 7, 1, 2, 4] isForest := by decide @@ -446,6 +473,7 @@ def data058 : ContractionData core (Core.reorient core010 rev058) where /-- The checked contraction of row 095 along source slots {3, 5, 8} onto `core010`, oriented by `rev358`. -/ +@[expose] def data358 : ContractionData core (Core.reorient core010 rev358) where F := {3, 5, 8}; vtx := ![0, 4, 5]; slot := ![0, 1, 2, 4, 6, 7] isForest := by decide @@ -461,6 +489,7 @@ def data358 : ContractionData core (Core.reorient core010 rev358) where /-- The checked contraction of row 095 along source slots {0, 3, 5, 8} onto `core002`, oriented by `rev0358`. -/ +@[expose] def data0358 : ContractionData core (Core.reorient core002 rev0358) where F := {0, 3, 5, 8}; vtx := ![4, 5]; slot := ![1, 2, 4, 6, 7] isForest := by decide diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveBridgeRows.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveBridgeRows.lean index 6abece8de7..7b56282050 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveBridgeRows.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveBridgeRows.lean @@ -23,7 +23,7 @@ genus-three side at vertex `0`. The occurrence-level core cut checker and the factor-genus calculator verify this finite structural data directly. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveBridgeRows open Utilities diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveCanonicalClassifier.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveCanonicalClassifier.lean index f73fba8f6b..dfc5df1478 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveCanonicalClassifier.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveCanonicalClassifier.lean @@ -40,7 +40,7 @@ Everything in this file is generated by the generated classifier data. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveCanonicalClassifier open Utilities.Certificate diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveClosedCover.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveClosedCover.lean index 01fc37ac4c..494aa88ab9 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveClosedCover.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveClosedCover.lean @@ -23,7 +23,7 @@ Generated row modules contain data only: certificates, cones, and one checked cover tree. All graph and divisor semantics are proved here once. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveClosedCover @@ -53,6 +53,7 @@ theorem degSpec_ext rfl /-- The affine coordinate reading the length of slot `edge`. -/ +@[expose] def coordinateForm (edge : Fin p) : ExplicitPotential.AffineForm p where fixedValue := 0 coefficient := fun coordinate => if coordinate = edge then 1 else 0 @@ -71,6 +72,7 @@ structure CoordinateCell (core : ExplicitPotential.Core n p) where cone : List (ExplicitPotential.AffineForm p) /-- Interpret a cell as the standard explicit-potential certificate. -/ +@[expose] def CoordinateCell.certificate {core : ExplicitPotential.Core n p} (cell : CoordinateCell core) : CertificateData p n p where core := core @@ -84,6 +86,7 @@ def CoordinateCell.certificate {core : ExplicitPotential.Core n p} cell.certificate.cone = cell.cone := rfl /-- The length point used by a coordinate cell. -/ +@[expose] def lengthPoint (length : Fin p → ℕ) : Fin p → ℤ := fun edge => length edge @@ -168,6 +171,7 @@ namespace CellTree /-- The affine cone attached to a cell index, defaulting to the empty constraint list for an invalid index. -/ +@[expose] def coneAt {core : ExplicitPotential.Core n p} (cells : List (CoordinateCell core)) (index : ℕ) : List (ExplicitPotential.AffineForm p) := @@ -199,6 +203,7 @@ def Valid {core : ExplicitPotential.Core n p} /-- The Boolean checker for cell coverage, contradiction receipts, and both branches of each affine split. -/ +@[expose] def check {core : ExplicitPotential.Core n p} (cells : List (CoordinateCell core)) (active : List (ExplicitPotential.AffineForm p)) : CellTree p → Bool @@ -297,6 +302,7 @@ namespace CompactCellTree /-- Expand the shared form and receipt indices into a full cell tree, using zero forms and empty receipts for invalid indices. -/ +@[expose] def decode {p : ℕ} (forms : List (ExplicitPotential.AffineForm p)) (receipts : List Certificate.AffineCover.FarkasData) : @@ -309,6 +315,7 @@ def decode {p : ℕ} (nonnegative.decode forms receipts) (negative.decode forms receipts) /-- Check a compact tree by decoding its shared tables and checking the resulting cell tree. -/ +@[expose] def check {core : ExplicitPotential.Core n p} (tree : CompactCellTree) (forms : List (ExplicitPotential.AffineForm p)) (receipts : List Certificate.AffineCover.FarkasData) diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveClosedOrbit.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveClosedOrbit.lean index af6c57c4f3..203d27a373 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveClosedOrbit.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveClosedOrbit.lean @@ -34,7 +34,7 @@ the forest hypothesis nor the looplessness hypothesis has to be re-proved at the moved face -- `isForest_iff` and `isLoopy_iff` transport them. -/ -@[expose] public section +public section namespace AtanasovRanganathan.ClosedOrbit diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveConfigurations.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveConfigurations.lean index 89bae2f9dc..2f12609b9c 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveConfigurations.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveConfigurations.lean @@ -26,7 +26,7 @@ is the firing script and effective residual, which is both unambiguous and what the rank proof actually consumes. -/ -@[expose] public section +public section namespace AtanasovRanganathan.Configurations @@ -44,6 +44,7 @@ variable {G : CFGraph} /-- The degree-four divisor used by the genus-five pictures. Repeated chip positions are allowed, as required by AR's seventh family. -/ +@[expose] def fourChipDivisor (first second third fourth : G.V) : CFDiv G := oneChip first + oneChip second + oneChip third + oneChip fourth @@ -218,6 +219,7 @@ theorem PositiveSubdivisionDharConstruction.toPositiveSubdivisionPencil /-! ## Closed-orthant constructions -/ /-- The zero-length slots of a closed length vector. -/ +@[expose] def zeroSlots {p : ℕ} (length : Fin p → ℕ) : Finset (Fin p) := Finset.univ.filter (fun e => length e = 0) @@ -231,6 +233,7 @@ The representative map is the union-find quotient generated by the zero-length slots. This is the public, unmarked counterpart of the private row-authoring `censusSpec`; unlike a bare `DegSpec`, it cannot contain an artificial identification unrelated to a vanishing slot. -/ +@[expose] def faceSpec {n p : ℕ} (core : Certificate.ExplicitPotential.Core n p) (core_nonempty : 0 < n) (length : Fin p → ℕ) (forest : IsForest core (zeroSlots length)) @@ -268,6 +271,7 @@ The only face hypotheses are the two intrinsic graph checks: the zero set is a forest and its contraction creates no surviving loop. Consequently one proof covers the positive subdivision and every honest nonloopy forest face, with no arbitrary representative map in the authoring interface. -/ +@[expose] def ClosedSubdivisionDharConstruction {n p : ℕ} (core : Certificate.ExplicitPotential.Core n p) (core_nonempty : 0 < n) : Prop := diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveConstructions.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveConstructions.lean index 1f5f9f93ab..93fd603141 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveConstructions.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveConstructions.lean @@ -34,7 +34,7 @@ rows and the named length-dependent families are kept separate so that filling one theorem is a genuine, reportable unit of progress. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveConstructions diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveCoreAtlas.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveCoreAtlas.lean index 9227877c8e..0dc7995024 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveCoreAtlas.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveCoreAtlas.lean @@ -24,7 +24,7 @@ the twelfth and sixteenth scopes; both scopes are already cubic with twelve non-loop edges, so those commands are omitted, as the figure caption requires. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveCoreAtlas @@ -36,95 +36,114 @@ open Certificate.ExplicitPotential abbrev Core := Certificate.ExplicitPotential.Core 8 12 /-- Number of half-edge incidences at a vertex of a loopless ordered core. -/ +@[expose] def incidenceDegree (core : Core) (vertex : Fin 8) : Nat := ∑ edge : Fin 12, ((if core.tail edge = vertex then 1 else 0) + (if core.head edge = vertex then 1 else 0)) /-- Every vertex has exactly three incident half-edges in the ordered core. -/ +@[expose] def Trivalent (core : Core) : Prop := ∀ vertex : Fin 8, incidenceDegree core vertex = 3 /-- Every edge slot has two distinct endpoints. -/ +@[expose] def Loopless (core : Core) : Prop := ∀ edge : Fin 12, core.tail edge ≠ core.head edge /-- Figure scope 1 (`a6,b6,c6,d6,x,y,e6,f6`). -/ +@[expose] def row01Core : Core := { tail := ![0, 0, 2, 1, 2, 3, 5, 2, 4, 4, 6, 6] head := ![1, 1, 0, 3, 3, 5, 7, 4, 6, 5, 7, 7] } /-- Figure scope 2 (`a9,b9,c9,b9a,c9a,d9,e9,f9`). -/ +@[expose] def row02Core : Core := { tail := ![0, 1, 2, 5, 5, 6, 7, 7, 1, 2, 3, 3] head := ![1, 2, 5, 6, 6, 7, 0, 0, 3, 4, 4, 4] } /-- Figure scope 3 (`41,42,43,45,A3,A5,B3,B5`). -/ +@[expose] def row03Core : Core := { tail := ![0, 2, 0, 3, 0, 2, 6, 3, 7, 4, 4, 6] head := ![2, 1, 3, 1, 1, 6, 4, 7, 5, 5, 5, 7] } /-- Figure scope 4 (`A1,A2,A8,A7,A3,A4,A5,A6`). -/ +@[expose] def row04Core : Core := { tail := ![0, 0, 1, 4, 4, 5, 6, 6, 7, 3, 3, 2] head := ![1, 1, 4, 5, 5, 6, 7, 7, 3, 2, 2, 0] } /-- Figure scope 5 (`a6,b6,c6,d6,x,y,e6,f6`). -/ +@[expose] def row05Core : Core := { tail := ![0, 0, 2, 1, 2, 3, 5, 2, 4, 4, 6, 6] head := ![1, 1, 0, 3, 5, 5, 7, 4, 6, 3, 7, 7] } /-- Figure scope 6 (`a6,b6,c6,d6,e6,f6,q6,p6`). -/ +@[expose] def row06Core : Core := { tail := ![0, 0, 2, 1, 2, 7, 7, 6, 3, 2, 4, 4] head := ![1, 1, 0, 3, 7, 6, 6, 3, 5, 4, 5, 5] } /-- Figure scope 7 (`41,42,43,45,B1,B2,B3,B4`). -/ +@[expose] def row07Core : Core := { tail := ![0, 2, 0, 3, 2, 0, 1, 6, 4, 4, 5, 5] head := ![2, 1, 3, 1, 3, 4, 5, 7, 6, 6, 7, 7] } /-- Figure scope 8 (`a6,b6,c6,j6,d6,h6,e6,f6`). -/ +@[expose] def row08Core : Core := { tail := ![0, 0, 6, 3, 1, 2, 4, 5, 5, 2, 6, 6] head := ![1, 1, 3, 0, 4, 4, 5, 7, 2, 3, 7, 7] } /-- Figure scope 9 (`31,32,33,34,35,36,311,312`). -/ +@[expose] def row09Core : Core := { tail := ![0, 2, 1, 2, 1, 3, 4, 5, 0, 3, 6, 6] head := ![2, 1, 0, 5, 4, 4, 5, 3, 6, 7, 7, 7] } /-- Figure scope 10 (`31,32,33,34,35,36,37,38`). -/ +@[expose] def row10Core : Core := { tail := ![0, 2, 1, 2, 1, 3, 4, 6, 6, 5, 0, 5] head := ![2, 1, 0, 5, 4, 4, 6, 7, 7, 3, 3, 7] } /-- Figure scope 11 (outer square and inner square). -/ +@[expose] def row11Core : Core := { tail := ![0, 1, 3, 2, 4, 5, 7, 6, 4, 5, 7, 6] head := ![1, 3, 2, 0, 5, 7, 6, 4, 0, 1, 3, 2] } /-- Figure scope 12, omitting the anomalous extra self-loop command. -/ +@[expose] def row12Core : Core := { tail := ![0, 4, 2, 3, 0, 1, 5, 6, 7, 5, 6, 7] head := ![4, 2, 3, 1, 3, 4, 6, 7, 5, 0, 1, 2] } /-- Figure scope 13 (two `K₄`-minus-edge blocks). -/ +@[expose] def row13Core : Core := { tail := ![0, 2, 0, 3, 2, 4, 6, 4, 7, 6, 0, 1] head := ![2, 1, 3, 1, 3, 6, 5, 7, 5, 7, 4, 5] } /-- Figure scope 14 (`a,b,c,d,e,f,g,h`). -/ +@[expose] def row14Core : Core := { tail := ![0, 7, 7, 7, 0, 2, 3, 1, 5, 4, 2, 3] head := ![6, 1, 6, 6, 2, 3, 1, 5, 4, 0, 5, 4] } /-- Figure scope 15, with cyclic vertex labels `O1, ..., O8`. -/ +@[expose] def row15Core : Core := { tail := ![0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 7] head := ![1, 2, 3, 4, 5, 6, 7, 0, 4, 5, 6, 3] } /-- Figure scope 16, omitting the anomalous extra self-loop command. -/ +@[expose] def row16Core : Core := { tail := ![0, 4, 2, 3, 0, 3, 5, 6, 7, 5, 6, 7] head := ![4, 2, 3, 1, 1, 4, 6, 7, 5, 0, 1, 2] } diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveCubicAtlas.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveCubicAtlas.lean index 2b0c8f317c..3c8bb7be33 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveCubicAtlas.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveCubicAtlas.lean @@ -19,7 +19,7 @@ is passive finite data plus kernel-checked validity; exhaustiveness is proved separately by the public canonical classifier. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveCubicAtlas open Utilities @@ -47,54 +47,71 @@ private theorem connected (core : ExplicitPotential.Core 8 12) : /-- Atlas row 01, bundling `row01Core` with its looplessness, connectivity, and cubic-degree proofs. -/ +@[expose] def row01 : Row := ⟨row01Core, row01_loopless, row01_connected, row01_trivalent⟩ /-- Atlas row 02, bundling `row02Core` with its looplessness, connectivity, and cubic-degree proofs. -/ +@[expose] def row02 : Row := ⟨row02Core, row02_loopless, row02_connected, row02_trivalent⟩ /-- Atlas row 03, bundling `row03Core` with its looplessness, connectivity, and cubic-degree proofs. -/ +@[expose] def row03 : Row := ⟨row03Core, row03_loopless, row03_connected, row03_trivalent⟩ /-- Atlas row 04, bundling `row04Core` with its looplessness, connectivity, and cubic-degree proofs. -/ +@[expose] def row04 : Row := ⟨row04Core, row04_loopless, row04_connected, row04_trivalent⟩ /-- Atlas row 05, bundling `row05Core` with its looplessness, connectivity, and cubic-degree proofs. -/ +@[expose] def row05 : Row := ⟨row05Core, row05_loopless, row05_connected, row05_trivalent⟩ /-- Atlas row 06, bundling `row06Core` with its looplessness, connectivity, and cubic-degree proofs. -/ +@[expose] def row06 : Row := ⟨row06Core, row06_loopless, row06_connected, row06_trivalent⟩ /-- Atlas row 07, bundling `row07Core` with its looplessness, connectivity, and cubic-degree proofs. -/ +@[expose] def row07 : Row := ⟨row07Core, row07_loopless, row07_connected, row07_trivalent⟩ /-- Atlas row 08, bundling `row08Core` with its looplessness, connectivity, and cubic-degree proofs. -/ +@[expose] def row08 : Row := ⟨row08Core, row08_loopless, row08_connected, row08_trivalent⟩ /-- Atlas row 09, bundling `row09Core` with its looplessness, connectivity, and cubic-degree proofs. -/ +@[expose] def row09 : Row := ⟨row09Core, row09_loopless, row09_connected, row09_trivalent⟩ /-- Atlas row 10, bundling `row10Core` with its looplessness, connectivity, and cubic-degree proofs. -/ +@[expose] def row10 : Row := ⟨row10Core, row10_loopless, row10_connected, row10_trivalent⟩ /-- Atlas row 11, bundling `row11Core` with its looplessness, connectivity, and cubic-degree proofs. -/ +@[expose] def row11 : Row := ⟨row11Core, row11_loopless, row11_connected, row11_trivalent⟩ /-- Atlas row 12, bundling `row12Core` with its looplessness, connectivity, and cubic-degree proofs. -/ +@[expose] def row12 : Row := ⟨row12Core, row12_loopless, row12_connected, row12_trivalent⟩ /-- Atlas row 13, bundling `row13Core` with its looplessness, connectivity, and cubic-degree proofs. -/ +@[expose] def row13 : Row := ⟨row13Core, row13_loopless, row13_connected, row13_trivalent⟩ /-- Atlas row 14, bundling `row14Core` with its looplessness, connectivity, and cubic-degree proofs. -/ +@[expose] def row14 : Row := ⟨row14Core, row14_loopless, row14_connected, row14_trivalent⟩ /-- Atlas row 15, bundling `row15Core` with its looplessness, connectivity, and cubic-degree proofs. -/ +@[expose] def row15 : Row := ⟨row15Core, row15_loopless, row15_connected, row15_trivalent⟩ /-- Atlas row 16, bundling `row16Core` with its looplessness, connectivity, and cubic-degree proofs. -/ +@[expose] def row16 : Row := ⟨row16Core, row16_loopless, row16_connected, row16_trivalent⟩ /-- The sixteen Atanasov–Ranganathan cubic rows, in their numbered order. -/ +@[expose] def arAtlas : List Row := [row01, row02, row03, row04, row05, row06, row07, row08, row09, row10, row11, row12, row13, row14, row15, row16] @@ -102,21 +119,25 @@ def arAtlas : List Row := /-! ## The four bridge rows -/ /-- The eight-vertex root-double bridge core, given by its twelve ordered endpoint pairs. -/ +@[expose] def rootDoubleCore : ExplicitPotential.Core 8 12 where tail := ![0, 0, 1, 1, 0, 3, 3, 4, 5, 5, 6, 6] head := ![1, 2, 2, 2, 3, 4, 4, 5, 6, 7, 7, 7] /-- The eight-vertex one-chord bridge core, given by its twelve ordered endpoint pairs. -/ +@[expose] def oneChordCore : ExplicitPotential.Core 8 12 where tail := ![0, 0, 1, 1, 0, 3, 3, 4, 4, 5, 6, 6] head := ![1, 2, 2, 2, 3, 4, 5, 5, 6, 7, 7, 7] /-- The eight-vertex square bridge core, given by its twelve ordered endpoint pairs. -/ +@[expose] def squareCore : ExplicitPotential.Core 8 12 where tail := ![0, 0, 1, 1, 0, 3, 3, 4, 4, 5, 5, 6] head := ![1, 2, 2, 2, 3, 4, 5, 6, 7, 6, 7, 7] /-- The eight-vertex double-matching bridge core, given by its twelve ordered endpoint pairs. -/ +@[expose] def doubleMatchingCore : ExplicitPotential.Core 8 12 where tail := ![0, 0, 1, 1, 0, 3, 3, 4, 4, 5, 5, 6] head := ![1, 2, 2, 2, 3, 4, 5, 6, 6, 7, 7, 7] @@ -151,24 +172,30 @@ private theorem doubleMatching_cubic : doubleMatchingCore.Cubic := by /-- The root-double bridge core bundled with its looplessness, connectivity, and cubic-degree proofs. -/ +@[expose] def rootDouble : Row := ⟨rootDoubleCore, by exact rootDouble_loopless, by exact connected rootDoubleCore (by decide +kernel), by exact rootDouble_cubic⟩ /-- The one-chord bridge core bundled with its looplessness, connectivity, and cubic-degree proofs. -/ +@[expose] def oneChord : Row := ⟨oneChordCore, by exact oneChord_loopless, by exact connected oneChordCore (by decide +kernel), by exact oneChord_cubic⟩ /-- The square bridge core bundled with its looplessness, connectivity, and cubic-degree proofs. -/ +@[expose] def square : Row := ⟨squareCore, by exact square_loopless, by exact connected squareCore (by decide +kernel), by exact square_cubic⟩ /-- The double-matching bridge core bundled with its looplessness, connectivity, and cubic-degree proofs. -/ +@[expose] def doubleMatching : Row := ⟨doubleMatchingCore, by exact doubleMatching_loopless, by exact connected doubleMatchingCore (by decide +kernel), by exact doubleMatching_cubic⟩ /-- The four bridge cores, ordered as root-double, one-chord, square, and double-matching. -/ +@[expose] def bridgeAtlas : List Row := [rootDouble, oneChord, square, doubleMatching] /-- The exact atlas order used by the emitted classifier payload. -/ +@[expose] def atlas : List Row := arAtlas ++ bridgeAtlas @[simp] theorem atlas_length : atlas.length = 20 := by diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveCubicCoverage.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveCubicCoverage.lean index 30a0784c40..0328c87470 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveCubicCoverage.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveCubicCoverage.lean @@ -19,7 +19,7 @@ the remaining four rows are the bridge types and are deliberately left as a separate structural branch. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveCubicCoverage open Utilities @@ -32,6 +32,7 @@ open AtanasovRanganathan.GenusFiveCubicAtlas /-- The finite structural obligation left after the sixteen AR rows: every closed face of each of the four cubic bridge cores carries a degree-four rank-one pencil. -/ +@[expose] def BridgeAtlasClosedCoverage : Prop := ∀ row ∈ bridgeAtlas, ClosedSubdivisionDharConstruction row.core (by norm_num) diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFivePseudocoreCoverage.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFivePseudocoreCoverage.lean index ab87b061df..fad16a6f49 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFivePseudocoreCoverage.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFivePseudocoreCoverage.lean @@ -23,7 +23,7 @@ degree-four pencil on the original subdivision. Thus the finite cubic atlas only has to handle the loopless pseudocore branch. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFivePseudocoreCoverage open Utilities diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow03CoverReceipts.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow03CoverReceipts.lean index 68ea8fa6de..d2c74c8b3e 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow03CoverReceipts.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow03CoverReceipts.lean @@ -14,7 +14,7 @@ These passive row multipliers are replayed by the corresponding fixed-cover modu The ordered blocks and their concatenation retain the global receipt indices used by its tree. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveRow03FixedCover @@ -22,6 +22,7 @@ open Utilities /-- Farkas receipt entries 0 through 127 for the row-03 cover: sparse rational combinations of active inequalities used to certify cell inclusion or exclude a branch. -/ +@[expose] def farkasReceipts0 : List Certificate.AffineCover.FarkasData := [ { terms := @@ -284,6 +285,7 @@ def farkasReceipts0 : List Certificate.AffineCover.FarkasData := /-- Farkas receipt entries 128 through 255 for the row-03 cover: sparse rational combinations of active inequalities used to certify cell inclusion or exclude a branch. -/ +@[expose] def farkasReceipts1 : List Certificate.AffineCover.FarkasData := [ { terms := @@ -554,6 +556,7 @@ def farkasReceipts1 : List Certificate.AffineCover.FarkasData := /-- Farkas receipt entries 256 through 383 for the row-03 cover: sparse rational combinations of active inequalities used to certify cell inclusion or exclude a branch. -/ +@[expose] def farkasReceipts2 : List Certificate.AffineCover.FarkasData := [ { terms := @@ -837,6 +840,7 @@ def farkasReceipts2 : List Certificate.AffineCover.FarkasData := /-- Farkas receipt entries 384 through 511 for the row-03 cover: sparse rational combinations of active inequalities used to certify cell inclusion or exclude a branch. -/ +@[expose] def farkasReceipts3 : List Certificate.AffineCover.FarkasData := [ { terms := @@ -1120,6 +1124,7 @@ def farkasReceipts3 : List Certificate.AffineCover.FarkasData := /-- Farkas receipt entries 512 through 639 for the row-03 cover: sparse rational combinations of active inequalities used to certify cell inclusion or exclude a branch. -/ +@[expose] def farkasReceipts4 : List Certificate.AffineCover.FarkasData := [ { terms := @@ -1406,6 +1411,7 @@ def farkasReceipts4 : List Certificate.AffineCover.FarkasData := /-- Farkas receipt entries 640 through 767 for the row-03 cover: sparse rational combinations of active inequalities used to certify cell inclusion or exclude a branch. -/ +@[expose] def farkasReceipts5 : List Certificate.AffineCover.FarkasData := [ { terms := @@ -1697,6 +1703,7 @@ def farkasReceipts5 : List Certificate.AffineCover.FarkasData := /-- Farkas receipt entries 768 through 795 for the row-03 cover: sparse rational combinations of active inequalities used to certify cell inclusion or exclude a branch. -/ +@[expose] def farkasReceipts6 : List Certificate.AffineCover.FarkasData := [ { terms := @@ -1765,6 +1772,7 @@ def farkasReceipts6 : List Certificate.AffineCover.FarkasData := ] /-- The concatenated Farkas receipt table indexed by the compact row-03 cover tree. -/ +@[expose] def farkasReceipts : List Certificate.AffineCover.FarkasData := farkasReceipts0 ++ farkasReceipts1 ++ farkasReceipts2 ++ farkasReceipts3 ++ farkasReceipts4 ++ farkasReceipts5 ++ farkasReceipts6 diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow03FixedCover.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow03FixedCover.lean index ba1a47cfe5..145708502d 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow03FixedCover.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow03FixedCover.lean @@ -17,7 +17,7 @@ an additional exact replay. Generated exact replay of the fixed AR row-03 divisor. `cells_check` and `tree_check` replay every arithmetic obligation in the kernel. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveRow03FixedCover diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow04CoverBase.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow04CoverBase.lean index 5d9e9b4b3c..44c5ded58a 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow04CoverBase.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow04CoverBase.lean @@ -16,7 +16,7 @@ Generated shared data for the chamber-restricted AR row-04 cover: the fixed divisor and the pooled anchor witnesses. Imported by every cell chunk and by the assembling module. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveRow04CoverBase @@ -29,12 +29,14 @@ open GenusFiveCoreAtlas GenusFiveClosedCover Configurations /-- Decode an integer coefficient list as a twelve-variable affine form: the first entry is the constant and missing entries are zero. -/ +@[expose] def aff (data : List ℤ) : ExplicitPotential.AffineForm 12 where fixedValue := data.getD 0 0 coefficient := fun coordinate => data.getD (coordinate.val + 1) 0 /-- The fixed degree-four row-04 divisor, with one chip at each of vertices zero, two, five, and six. -/ +@[expose] def rowDivisor : Fin 8 → ℤ := fun vertex => ([1, 0, 1, 0, 0, 1, 1, 0] : List ℤ).getD vertex.val 0 @@ -45,6 +47,7 @@ def defaultWitness : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 0 for the row-04 closed cover: `alpha` is zero. `beta` is zero. The affine potential is zero. -/ +@[expose] def witness0 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] : List ℤ).getD edge.val 0, @@ -54,6 +57,7 @@ def witness0 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 1 for the row-04 closed cover: `alpha` is -1 at slots 0, 1, 11, and zero elsewhere. `beta` is -1 at slots 5; 1 at slots 0, 11, and zero elsewhere. The nonzero affine potentials occur at vertices 1, 2, 3, 4, 5, 6, 7. -/ +@[expose] def witness1 : AnchorWitness 12 8 12 := { alpha := fun edge => ([-1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1] : List ℤ).getD edge.val 0, beta := fun edge => ([1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 1] : List ℤ).getD edge.val 0, @@ -64,6 +68,7 @@ def witness1 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 2 for the row-04 closed cover: `alpha` is -1 at slots 5; 1 at slots 9, 11, and zero elsewhere. `beta` is -1 at slots 9, 10, 11, and zero elsewhere. The nonzero affine potentials occur at vertices 2, 3, 6, 7. -/ +@[expose] def witness2 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, 0, 0, 0, -1, 0, 0, 0, 1, 0, 1] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1] : List ℤ).getD edge.val 0, @@ -74,6 +79,7 @@ def witness2 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 3 for the row-04 closed cover: `alpha` is -1 at slots 0, 1, 2, 11, and zero elsewhere. `beta` is -1 at slots 5; 1 at slots 0, 2, 11, and zero elsewhere. The nonzero affine potentials occur at vertices 1, 2, 3, 4, 5, 6, 7. -/ +@[expose] def witness3 : AnchorWitness 12 8 12 := { alpha := fun edge => ([-1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1] : List ℤ).getD edge.val 0, beta := fun edge => ([1, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1] : List ℤ).getD edge.val 0, @@ -84,6 +90,7 @@ def witness3 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 4 for the row-04 closed cover: `alpha` is -1 at slots 5; 1 at slots 8, 9, 11, and zero elsewhere. `beta` is -1 at slots 8, 9, 10, 11, and zero elsewhere. The nonzero affine potentials occur at vertices 2, 3, 6, 7. -/ +@[expose] def witness4 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, 0, 0, 0, -1, 0, 0, 1, 1, 0, 1] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1] : List ℤ).getD edge.val 0, @@ -94,6 +101,7 @@ def witness4 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 5 for the row-04 closed cover: `alpha` is -1 at slots 5, 6, 7; 1 at slots 9, 11, and zero elsewhere. `beta` is -1 at slots 9, 10, 11; 1 at slots 5, 6, and zero elsewhere. The nonzero affine potentials occur at vertices 2, 3, 6, 7. -/ +@[expose] def witness5 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, 0, 0, 0, -1, -1, -1, 0, 1, 0, 1] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, 0, 0, 1, 1, 0, 0, -1, -1, -1] : List ℤ).getD edge.val 0, @@ -104,6 +112,7 @@ def witness5 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 6 for the row-04 closed cover: `alpha` is -1 at slots 5, 6, 7; 1 at slots 9, 11, and zero elsewhere. `beta` is -1 at slots 8, 9, 10, 11; 1 at slots 5, 6, and zero elsewhere. The nonzero affine potentials occur at vertices 2, 3, 6, 7. -/ +@[expose] def witness6 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, 0, 0, 0, -1, -1, -1, 0, 1, 0, 1] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, 0, 0, 1, 1, 0, -1, -1, -1, -1] : List ℤ).getD edge.val 0, @@ -114,6 +123,7 @@ def witness6 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 7 for the row-04 closed cover: `alpha` is -1 at slots 5, 6, 7; 1 at slots 8, 9, 11, and zero elsewhere. `beta` is -1 at slots 8, 9, 10, 11; 1 at slots 5, and zero elsewhere. The nonzero affine potentials occur at vertices 2, 3, 6, 7. -/ +@[expose] def witness7 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, 0, 0, 0, -1, -1, -1, 1, 1, 0, 1] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, 0, 0, 1, 0, 0, -1, -1, -1, -1] : List ℤ).getD edge.val 0, @@ -124,6 +134,7 @@ def witness7 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 8 for the row-04 closed cover: `alpha` is -1 at slots 0, 1, 11; 1 at slots 3, 5, and zero elsewhere. `beta` is -1 at slots 3, 4, 5; 1 at slots 0, 11, and zero elsewhere. The nonzero affine potentials occur at vertices 1, 2, 3, 4, 5, 6, 7. -/ +@[expose] def witness8 : AnchorWitness 12 8 12 := { alpha := fun edge => ([-1, -1, 0, 1, 0, 1, 0, 0, 0, 0, 0, -1] : List ℤ).getD edge.val 0, beta := fun edge => ([1, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0, 1] : List ℤ).getD edge.val 0, @@ -134,6 +145,7 @@ def witness8 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 9 for the row-04 closed cover: `alpha` is -1 at slots 0, 1, 2, 11; 1 at slots 3, 5, and zero elsewhere. `beta` is -1 at slots 3, 4, 5; 1 at slots 0, 11, and zero elsewhere. The nonzero affine potentials occur at vertices 1, 2, 3, 4, 5, 6, 7. -/ +@[expose] def witness9 : AnchorWitness 12 8 12 := { alpha := fun edge => ([-1, -1, -1, 1, 0, 1, 0, 0, 0, 0, 0, -1] : List ℤ).getD edge.val 0, beta := fun edge => ([1, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0, 1] : List ℤ).getD edge.val 0, @@ -145,6 +157,7 @@ def witness9 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 10 for the row-04 closed cover: `alpha` is -1 at slots 0, 1, 2, 11; 1 at slots 5, and zero elsewhere. `beta` is -1 at slots 3, 4, 5; 1 at slots 0, 2, 11, and zero elsewhere. The nonzero affine potentials occur at vertices 1, 2, 3, 4, 5, 6, 7. -/ +@[expose] def witness10 : AnchorWitness 12 8 12 := { alpha := fun edge => ([-1, -1, -1, 0, 0, 1, 0, 0, 0, 0, 0, -1] : List ℤ).getD edge.val 0, beta := fun edge => ([1, 0, 1, -1, -1, -1, 0, 0, 0, 0, 0, 1] : List ℤ).getD edge.val 0, @@ -156,6 +169,7 @@ def witness10 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 11 for the row-04 closed cover: `alpha` is -1 at slots 0, 1, 11, and zero elsewhere. `beta` is -1 at slots 5; 1 at slots 1, 11, and zero elsewhere. The nonzero affine potentials occur at vertices 1, 2, 3, 4, 5, 6, 7. -/ +@[expose] def witness11 : AnchorWitness 12 8 12 := { alpha := fun edge => ([-1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 1] : List ℤ).getD edge.val 0, @@ -166,6 +180,7 @@ def witness11 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 12 for the row-04 closed cover: `alpha` is -1 at slots 0, 1, 2, 11, and zero elsewhere. `beta` is -1 at slots 5; 1 at slots 1, 2, 11, and zero elsewhere. The nonzero affine potentials occur at vertices 1, 2, 3, 4, 5, 6, 7. -/ +@[expose] def witness12 : AnchorWitness 12 8 12 := { alpha := fun edge => ([-1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 1, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1] : List ℤ).getD edge.val 0, @@ -177,6 +192,7 @@ def witness12 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 13 for the row-04 closed cover: `alpha` is -1 at slots 0, 1, 11; 1 at slots 3, 5, and zero elsewhere. `beta` is -1 at slots 2, 3, 4, 5; 1 at slots 0, 11, and zero elsewhere. The nonzero affine potentials occur at vertices 1, 2, 3, 4, 5, 6, 7. -/ +@[expose] def witness13 : AnchorWitness 12 8 12 := { alpha := fun edge => ([-1, -1, 0, 1, 0, 1, 0, 0, 0, 0, 0, -1] : List ℤ).getD edge.val 0, beta := fun edge => ([1, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 1] : List ℤ).getD edge.val 0, @@ -188,6 +204,7 @@ def witness13 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 14 for the row-04 closed cover: `alpha` is -1 at slots 0, 1, 11; 1 at slots 3, 5, and zero elsewhere. `beta` is -1 at slots 3, 4, 5; 1 at slots 11, and zero elsewhere. The nonzero affine potentials occur at vertices 1, 2, 3, 4, 5, 6, 7. -/ +@[expose] def witness14 : AnchorWitness 12 8 12 := { alpha := fun edge => ([-1, -1, 0, 1, 0, 1, 0, 0, 0, 0, 0, -1] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0, 1] : List ℤ).getD edge.val 0, @@ -199,6 +216,7 @@ def witness14 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 15 for the row-04 closed cover: `alpha` is -1 at slots 0, 1, 11; 1 at slots 2, 3, 5, and zero elsewhere. `beta` is -1 at slots 2, 3, 4, 5; 1 at slots 0, 11, and zero elsewhere. The nonzero affine potentials occur at vertices 1, 2, 3, 4, 5, 6, 7. -/ +@[expose] def witness15 : AnchorWitness 12 8 12 := { alpha := fun edge => ([-1, -1, 1, 1, 0, 1, 0, 0, 0, 0, 0, -1] : List ℤ).getD edge.val 0, beta := fun edge => ([1, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 1] : List ℤ).getD edge.val 0, @@ -209,6 +227,7 @@ def witness15 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 16 for the row-04 closed cover: `alpha` is -1 at slots 0, 1, 2, 11; 1 at slots 3, 5, and zero elsewhere. `beta` is -1 at slots 3, 4, 5; 1 at slots 0, 1, 11, and zero elsewhere. The nonzero affine potentials occur at vertices 1, 2, 3, 4, 5, 6, 7. -/ +@[expose] def witness16 : AnchorWitness 12 8 12 := { alpha := fun edge => ([-1, -1, -1, 1, 0, 1, 0, 0, 0, 0, 0, -1] : List ℤ).getD edge.val 0, beta := fun edge => ([1, 1, 0, -1, -1, -1, 0, 0, 0, 0, 0, 1] : List ℤ).getD edge.val 0, @@ -220,6 +239,7 @@ def witness16 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 17 for the row-04 closed cover: `alpha` is -1 at slots 0, 1, 11; 1 at slots 5, and zero elsewhere. `beta` is -1 at slots 3, 4, 5; 1 at slots 0, 11, and zero elsewhere. The nonzero affine potentials occur at vertices 1, 2, 3, 4, 5, 6, 7. -/ +@[expose] def witness17 : AnchorWitness 12 8 12 := { alpha := fun edge => ([-1, -1, 0, 0, 0, 1, 0, 0, 0, 0, 0, -1] : List ℤ).getD edge.val 0, beta := fun edge => ([1, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0, 1] : List ℤ).getD edge.val 0, @@ -231,6 +251,7 @@ def witness17 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 18 for the row-04 closed cover: `alpha` is -2 at slots 2; -1 at slots 0, 1, 11; 1 at slots 3, 5, and zero elsewhere. `beta` is -1 at slots 3, 4, 5; 1 at slots 0, 1, 11, and zero elsewhere. The nonzero affine potentials occur at vertices 1, 2, 3, 4, 5, 6, 7. -/ +@[expose] def witness18 : AnchorWitness 12 8 12 := { alpha := fun edge => ([-1, -1, -2, 1, 0, 1, 0, 0, 0, 0, 0, -1] : List ℤ).getD edge.val 0, beta := fun edge => ([1, 1, 0, -1, -1, -1, 0, 0, 0, 0, 0, 1] : List ℤ).getD edge.val 0, @@ -242,6 +263,7 @@ def witness18 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 19 for the row-04 closed cover: `alpha` is -1 at slots 0, 1, 11; 1 at slots 2, 3, 5, and zero elsewhere. `beta` is -1 at slots 2, 3, 4, 5; 1 at slots 11, and zero elsewhere. The nonzero affine potentials occur at vertices 1, 2, 3, 4, 5, 6, 7. -/ +@[expose] def witness19 : AnchorWitness 12 8 12 := { alpha := fun edge => ([-1, -1, 1, 1, 0, 1, 0, 0, 0, 0, 0, -1] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 1] : List ℤ).getD edge.val 0, @@ -253,6 +275,7 @@ def witness19 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 20 for the row-04 closed cover: `alpha` is -1 at slots 0, 1, 11; 1 at slots 3, 5, and zero elsewhere. `beta` is -1 at slots 2, 3, 4, 5; 1 at slots 1, 11, and zero elsewhere. The nonzero affine potentials occur at vertices 1, 2, 3, 4, 5, 6, 7. -/ +@[expose] def witness20 : AnchorWitness 12 8 12 := { alpha := fun edge => ([-1, -1, 0, 1, 0, 1, 0, 0, 0, 0, 0, -1] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 1] : List ℤ).getD edge.val 0, @@ -264,6 +287,7 @@ def witness20 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 21 for the row-04 closed cover: `alpha` is -1 at slots 5; 1 at slots 10, 11, and zero elsewhere. `beta` is -1 at slots 9, 10, 11, and zero elsewhere. The nonzero affine potentials occur at vertices 2, 3, 6, 7. -/ +@[expose] def witness21 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1, 1] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1] : List ℤ).getD edge.val 0, @@ -274,6 +298,7 @@ def witness21 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 22 for the row-04 closed cover: `alpha` is -1 at slots 5; 1 at slots 8, 10, 11, and zero elsewhere. `beta` is -1 at slots 8, 9, 10, 11, and zero elsewhere. The nonzero affine potentials occur at vertices 2, 3, 6, 7. -/ +@[expose] def witness22 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, 0, 0, 0, -1, 0, 0, 1, 0, 1, 1] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1] : List ℤ).getD edge.val 0, @@ -284,6 +309,7 @@ def witness22 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 23 for the row-04 closed cover: `alpha` is -1 at slots 5, 6, 7, 8; 1 at slots 9, 11, and zero elsewhere. `beta` is -1 at slots 9, 10, 11; 1 at slots 5, 6, and zero elsewhere. The nonzero affine potentials occur at vertices 2, 3, 6, 7. -/ +@[expose] def witness23 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, 0, 0, 0, -1, -1, -1, -1, 1, 0, 1] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, 0, 0, 1, 1, 0, 0, -1, -1, -1] : List ℤ).getD edge.val 0, @@ -294,6 +320,7 @@ def witness23 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 24 for the row-04 closed cover: `alpha` is -1 at slots 5, 6, 7; 1 at slots 11, and zero elsewhere. `beta` is -1 at slots 9, 10, 11; 1 at slots 5, 6, and zero elsewhere. The nonzero affine potentials occur at vertices 2, 3, 6, 7. -/ +@[expose] def witness24 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, 1] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, 0, 0, 1, 1, 0, 0, -1, -1, -1] : List ℤ).getD edge.val 0, @@ -304,6 +331,7 @@ def witness24 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 25 for the row-04 closed cover: `alpha` is -1 at slots 5, 6, 7; 1 at slots 9, 10, 11, and zero elsewhere. `beta` is -1 at slots 8, 9, 10, 11; 1 at slots 5, 6, and zero elsewhere. The nonzero affine potentials occur at vertices 2, 3, 6, 7. -/ +@[expose] def witness25 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, 0, 0, 0, -1, -1, -1, 0, 1, 1, 1] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, 0, 0, 1, 1, 0, -1, -1, -1, -1] : List ℤ).getD edge.val 0, @@ -314,6 +342,7 @@ def witness25 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 26 for the row-04 closed cover: `alpha` is -1 at slots 5, 6, 7, 8; 1 at slots 9, 11, and zero elsewhere. `beta` is -1 at slots 9, 10, 11; 1 at slots 5, 6, 8, and zero elsewhere. The nonzero affine potentials occur at vertices 2, 3, 6, 7. -/ +@[expose] def witness26 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, 0, 0, 0, -1, -1, -1, -1, 1, 0, 1] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, 0, 0, 1, 1, 0, 1, -1, -1, -1] : List ℤ).getD edge.val 0, @@ -324,6 +353,7 @@ def witness26 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 27 for the row-04 closed cover: `alpha` is -1 at slots 5, 6, 7; 1 at slots 9, 11, and zero elsewhere. `beta` is -1 at slots 9, 10, 11; 1 at slots 5, and zero elsewhere. The nonzero affine potentials occur at vertices 2, 3, 6, 7. -/ +@[expose] def witness27 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, 0, 0, 0, -1, -1, -1, 0, 1, 0, 1] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, 0, 0, 1, 0, 0, 0, -1, -1, -1] : List ℤ).getD edge.val 0, @@ -334,6 +364,7 @@ def witness27 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 28 for the row-04 closed cover: `alpha` is -1 at slots 5, 6, 7; 1 at slots 9, 10, 11, and zero elsewhere. `beta` is -2 at slots 8; -1 at slots 9, 10, 11; 1 at slots 5, 6, and zero elsewhere. The nonzero affine potentials occur at vertices 2, 3, 6, 7. -/ +@[expose] def witness28 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, 0, 0, 0, -1, -1, -1, 0, 1, 1, 1] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, 0, 0, 1, 1, 0, -2, -1, -1, -1] : List ℤ).getD edge.val 0, @@ -344,6 +375,7 @@ def witness28 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 29 for the row-04 closed cover: `alpha` is -1 at slots 5, 6, 7, 8; 1 at slots 11, and zero elsewhere. `beta` is -1 at slots 9, 10, 11; 1 at slots 5, 6, 8, and zero elsewhere. The nonzero affine potentials occur at vertices 2, 3, 6, 7. -/ +@[expose] def witness29 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 1] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, 0, 0, 1, 1, 0, 1, -1, -1, -1] : List ℤ).getD edge.val 0, @@ -354,6 +386,7 @@ def witness29 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 30 for the row-04 closed cover: `alpha` is -1 at slots 5, 6, 7, 8; 1 at slots 10, 11, and zero elsewhere. `beta` is -1 at slots 9, 10, 11; 1 at slots 5, 6, and zero elsewhere. The nonzero affine potentials occur at vertices 2, 3, 6, 7. -/ +@[expose] def witness30 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 1, 1] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, 0, 0, 1, 1, 0, 0, -1, -1, -1] : List ℤ).getD edge.val 0, @@ -363,6 +396,7 @@ def witness30 : AnchorWitness 12 8 12 := /-- The thirty-one endpoint-slope and affine-potential witnesses shared by the row-04 closed-cover cells. -/ +@[expose] def witnesses : List (AnchorWitness 12 8 12) := [witness0, witness1, witness2, witness3, witness4, witness5, witness6, witness7, witness8, witness9, witness10, witness11, witness12, witness13, witness14, witness15, witness16, witness17, diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow04CoverCells0.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow04CoverCells0.lean index b67ff2cb11..fa78a27f0c 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow04CoverCells0.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow04CoverCells0.lean @@ -15,7 +15,7 @@ Generated cell chunk 0 of 2 for the AR row-04 chamber cover (cells 0-97). Split across modules because the kernel cost of replaying a cell is cumulative within one Lean process. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveRow04CoverCells0 diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow04CoverCells1.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow04CoverCells1.lean index 9f4705708c..6be4b82b60 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow04CoverCells1.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow04CoverCells1.lean @@ -15,7 +15,7 @@ Generated cell chunk 1 of 2 for the AR row-04 chamber cover (cells 98-194). Split across modules because the kernel cost of replaying a cell is cumulative within one Lean process. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveRow04CoverCells1 diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow04CoverReceipts.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow04CoverReceipts.lean index 77faf9404c..ddf02ee4b8 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow04CoverReceipts.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow04CoverReceipts.lean @@ -14,7 +14,7 @@ These passive row multipliers are replayed by the corresponding fixed-cover modu The ordered blocks and their concatenation retain the global receipt indices used by its tree. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveRow04FixedCover diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow04FixedCover.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow04FixedCover.lean index d6dcdd9cf1..1561163019 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow04FixedCover.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow04FixedCover.lean @@ -23,7 +23,7 @@ The external discovery data are untrusted: `cells_check` and chamber is discharged by the generated coverage theorem, so the conclusion is the row on the whole closed orthant. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveRow04FixedCover diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow04Symmetry.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow04Symmetry.lean index f9e979e518..60a102e85c 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow04Symmetry.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow04Symmetry.lean @@ -23,7 +23,7 @@ Every permutation is supplied with an explicit inverse, which keeps `reindexLength` definitionally transparent; all endpoint laws are `decide`d. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveRow04Symmetry diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow05.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow05.lean index fa421e0a61..a8f445ffb4 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow05.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow05.lean @@ -51,7 +51,7 @@ The other three chambers are the images of this one under the two leg swaps, so the closed orthant. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveRow05 diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow05Symmetry.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow05Symmetry.lean index 5cc0a58a9f..7660f2bd1e 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow05Symmetry.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow05Symmetry.lean @@ -36,7 +36,7 @@ transparent, the pattern of `GenusFiveRow04Symmetry` and `GenusFiveRow06Symmetry`. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveRow05Symmetry @@ -99,12 +99,15 @@ def tauR : CoreSymmetry row05Core := (by decide) (by decide) (by decide) (by decide) (by decide) (by decide) /-- The left leg comparison of AR's figure. -/ +@[expose] def LeftCond (length : Fin 12 → ℕ) : Prop := length 2 ≤ length 3 /-- The right leg comparison of AR's figure. -/ +@[expose] def RightCond (length : Fin 12 → ℕ) : Prop := length 6 ≤ length 8 /-- Chamber A: the scope Atanasov--Ranganathan draw first. -/ +@[expose] def Chamber (length : Fin 12 → ℕ) : Prop := LeftCond length ∧ RightCond length theorem left_normalize (length : Fin 12 → ℕ) : diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06.lean index c368c635c0..a853343862 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06.lean @@ -59,7 +59,7 @@ as an `AtanasovRanganathan.Guarding.GuardingSet` and independent machine-generated chamber-cover proof of the same theorem. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveRow06 @@ -80,6 +80,7 @@ open Guarding /-! ## The divisor -/ /-- The hub `3` together with the near end of each of the three bananas. -/ +@[expose] def IsChipVertex (v : Fin 8) : Prop := v = 0 ∨ v = 3 ∨ v = 4 ∨ v = 7 diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06CoverBase.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06CoverBase.lean index 70291b849f..ae25f6d572 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06CoverBase.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06CoverBase.lean @@ -16,7 +16,7 @@ Generated shared data for the chamber-restricted AR row-06 cover: the fixed divisor and the pooled anchor witnesses. Imported by every cell chunk and by the assembling module. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveRow06CoverBase @@ -29,12 +29,14 @@ open GenusFiveCoreAtlas GenusFiveClosedCover Configurations /-- Decode an integer coefficient list as a twelve-variable affine form: the first entry is the constant and missing entries are zero. -/ +@[expose] def aff (data : List ℤ) : ExplicitPotential.AffineForm 12 where fixedValue := data.getD 0 0 coefficient := fun coordinate => data.getD (coordinate.val + 1) 0 /-- The fixed degree-four row-06 divisor, with two chips at each of the hub vertices two and three. -/ +@[expose] def rowDivisor : Fin 8 → ℤ := fun vertex => ([0, 0, 2, 2, 0, 0, 0, 0] : List ℤ).getD vertex.val 0 @@ -46,6 +48,7 @@ def defaultWitness : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 0 for the row-06 closed cover: `alpha` is -1 at slots 2, and zero elsewhere. `beta` is -1 at slots 3; 1 at slots 2, and zero elsewhere. The nonzero affine potentials occur at vertices 2, 3, 4, 5, 6, 7. -/ +@[expose] def witness0 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0] : List ℤ).getD edge.val 0, @@ -55,6 +58,7 @@ def witness0 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 1 for the row-06 closed cover: `alpha` is -1 at slots 2; 1 at slots 3, and zero elsewhere. `beta` is -1 at slots 3, and zero elsewhere. The nonzero affine potentials occur at vertices 2, 3, 4, 5, 6, 7. -/ +@[expose] def witness1 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0] : List ℤ).getD edge.val 0, @@ -63,6 +67,7 @@ def witness1 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 2 for the row-06 closed cover: `alpha` is zero. `beta` is zero. The affine potential is zero. -/ +@[expose] def witness2 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] : List ℤ).getD edge.val 0, @@ -72,6 +77,7 @@ def witness2 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 3 for the row-06 closed cover: `alpha` is -1 at slots 8, 9, and zero elsewhere. `beta` is 1 at slots 9, and zero elsewhere. The nonzero affine potentials occur at vertices 4, 5. -/ +@[expose] def witness3 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0] : List ℤ).getD edge.val 0, @@ -81,6 +87,7 @@ def witness3 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 4 for the row-06 closed cover: `alpha` is -1 at slots 8, 9, and zero elsewhere. `beta` is 1 at slots 8, and zero elsewhere. The nonzero affine potentials occur at vertices 4, 5. -/ +@[expose] def witness4 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0] : List ℤ).getD edge.val 0, @@ -90,6 +97,7 @@ def witness4 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 5 for the row-06 closed cover: `alpha` is -1 at slots 4; 1 at slots 7, and zero elsewhere. `beta` is -1 at slots 7, and zero elsewhere. The nonzero affine potentials occur at vertices 6, 7. -/ +@[expose] def witness5 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0] : List ℤ).getD edge.val 0, @@ -99,6 +107,7 @@ def witness5 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 6 for the row-06 closed cover: `alpha` is -1 at slots 4, and zero elsewhere. `beta` is -1 at slots 7; 1 at slots 4, and zero elsewhere. The nonzero affine potentials occur at vertices 6, 7. -/ +@[expose] def witness6 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0] : List ℤ).getD edge.val 0, @@ -108,6 +117,7 @@ def witness6 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 7 for the row-06 closed cover: `alpha` is -2 at slots 2; 2 at slots 3, and zero elsewhere. `beta` is -2 at slots 3, and zero elsewhere. The nonzero affine potentials occur at vertices 2, 3, 4, 5, 6, 7. -/ +@[expose] def witness7 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, -2, 2, 0, 0, 0, 0, 0, 0, 0, 0] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, -2, 0, 0, 0, 0, 0, 0, 0, 0] : List ℤ).getD edge.val 0, @@ -117,6 +127,7 @@ def witness7 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 8 for the row-06 closed cover: `alpha` is -2 at slots 2; 1 at slots 3, and zero elsewhere. `beta` is -1 at slots 3, and zero elsewhere. The nonzero affine potentials occur at vertices 2, 3, 4, 5, 6, 7. -/ +@[expose] def witness8 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, -2, 1, 0, 0, 0, 0, 0, 0, 0, 0] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0] : List ℤ).getD edge.val 0, @@ -126,6 +137,7 @@ def witness8 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 9 for the row-06 closed cover: `alpha` is -2 at slots 2; -1 at slots 0, 1, and zero elsewhere. `beta` is -1 at slots 3; 1 at slots 0; 2 at slots 2, and zero elsewhere. The nonzero affine potentials occur at vertices 1, 2, 3, 4, 5, 6, 7. -/ +@[expose] def witness9 : AnchorWitness 12 8 12 := { alpha := fun edge => ([-1, -1, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0] : List ℤ).getD edge.val 0, beta := fun edge => ([1, 0, 2, -1, 0, 0, 0, 0, 0, 0, 0, 0] : List ℤ).getD edge.val 0, @@ -135,6 +147,7 @@ def witness9 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 10 for the row-06 closed cover: `alpha` is -2 at slots 2; -1 at slots 0, 1, and zero elsewhere. `beta` is -2 at slots 3; 1 at slots 0; 2 at slots 2, and zero elsewhere. The nonzero affine potentials occur at vertices 1, 2, 3, 4, 5, 6, 7. -/ +@[expose] def witness10 : AnchorWitness 12 8 12 := { alpha := fun edge => ([-1, -1, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0] : List ℤ).getD edge.val 0, beta := fun edge => ([1, 0, 2, -2, 0, 0, 0, 0, 0, 0, 0, 0] : List ℤ).getD edge.val 0, @@ -144,6 +157,7 @@ def witness10 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 11 for the row-06 closed cover: `alpha` is -2 at slots 2; -1 at slots 0, 1; 2 at slots 3, and zero elsewhere. `beta` is -2 at slots 3; 2 at slots 2, and zero elsewhere. The nonzero affine potentials occur at vertices 1, 2, 3, 4, 5, 6, 7. -/ +@[expose] def witness11 : AnchorWitness 12 8 12 := { alpha := fun edge => ([-1, -1, -2, 2, 0, 0, 0, 0, 0, 0, 0, 0] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 2, -2, 0, 0, 0, 0, 0, 0, 0, 0] : List ℤ).getD edge.val 0, @@ -153,6 +167,7 @@ def witness11 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 12 for the row-06 closed cover: `alpha` is -1 at slots 4, and zero elsewhere. `beta` is -2 at slots 7; 1 at slots 4, and zero elsewhere. The nonzero affine potentials occur at vertices 6, 7. -/ +@[expose] def witness12 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, 0, 1, 0, 0, -2, 0, 0, 0, 0] : List ℤ).getD edge.val 0, @@ -162,6 +177,7 @@ def witness12 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 13 for the row-06 closed cover: `alpha` is -1 at slots 4; 1 at slots 5; 2 at slots 7, and zero elsewhere. `beta` is -2 at slots 7; -1 at slots 5, 6, and zero elsewhere. The nonzero affine potentials occur at vertices 6, 7. -/ +@[expose] def witness13 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, 0, 0, -1, 1, 0, 2, 0, 0, 0, 0] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, 0, 0, -1, -1, -2, 0, 0, 0, 0] : List ℤ).getD edge.val 0, @@ -171,6 +187,7 @@ def witness13 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 14 for the row-06 closed cover: `alpha` is -2 at slots 4; 1 at slots 5; 2 at slots 7, and zero elsewhere. `beta` is -2 at slots 7; -1 at slots 5, 6, and zero elsewhere. The nonzero affine potentials occur at vertices 6, 7. -/ +@[expose] def witness14 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, 0, 0, -2, 1, 0, 2, 0, 0, 0, 0] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, 0, 0, -1, -1, -2, 0, 0, 0, 0] : List ℤ).getD edge.val 0, @@ -180,6 +197,7 @@ def witness14 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 15 for the row-06 closed cover: `alpha` is -1 at slots 2, 4; 1 at slots 3, and zero elsewhere. `beta` is -1 at slots 3, 7; 1 at slots 2, 4, and zero elsewhere. The nonzero affine potentials occur at vertices 2, 3, 4, 5, 6, 7. -/ +@[expose] def witness15 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, -1, 1, -1, 0, 0, 0, 0, 0, 0, 0] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 1, -1, 1, 0, 0, -1, 0, 0, 0, 0] : List ℤ).getD edge.val 0, @@ -189,6 +207,7 @@ def witness15 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 16 for the row-06 closed cover: `alpha` is -1 at slots 4; 2 at slots 7, and zero elsewhere. `beta` is -2 at slots 7; -1 at slots 5, 6; 1 at slots 4, and zero elsewhere. The nonzero affine potentials occur at vertices 6, 7. -/ +@[expose] def witness16 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, 0, 0, -1, 0, 0, 2, 0, 0, 0, 0] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, 0, 1, -1, -1, -2, 0, 0, 0, 0] : List ℤ).getD edge.val 0, @@ -198,6 +217,7 @@ def witness16 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 17 for the row-06 closed cover: `alpha` is -2 at slots 9; -1 at slots 8, and zero elsewhere. `beta` is 1 at slots 8, and zero elsewhere. The nonzero affine potentials occur at vertices 4, 5. -/ +@[expose] def witness17 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, 0, 0, 0, 0, 0, 0, -1, -2, 0, 0] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0] : List ℤ).getD edge.val 0, @@ -207,6 +227,7 @@ def witness17 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 18 for the row-06 closed cover: `alpha` is -2 at slots 9; -1 at slots 8, 10, 11, and zero elsewhere. `beta` is 1 at slots 10; 2 at slots 9, and zero elsewhere. The nonzero affine potentials occur at vertices 4, 5. -/ +@[expose] def witness18 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, 0, 0, 0, 0, 0, 0, -1, -2, -1, -1] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 0] : List ℤ).getD edge.val 0, @@ -216,6 +237,7 @@ def witness18 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 19 for the row-06 closed cover: `alpha` is -2 at slots 8, 9; -1 at slots 10, 11, and zero elsewhere. `beta` is 1 at slots 10; 2 at slots 9, and zero elsewhere. The nonzero affine potentials occur at vertices 4, 5. -/ +@[expose] def witness19 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, 0, 0, 0, 0, 0, 0, -2, -2, -1, -1] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 0] : List ℤ).getD edge.val 0, @@ -225,6 +247,7 @@ def witness19 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 20 for the row-06 closed cover: `alpha` is -1 at slots 2, 8, 9; 1 at slots 3, and zero elsewhere. `beta` is -1 at slots 3; 1 at slots 2, 8, and zero elsewhere. The nonzero affine potentials occur at vertices 2, 3, 4, 5, 6, 7. -/ +@[expose] def witness20 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, -1, 1, 0, 0, 0, 0, -1, -1, 0, 0] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 1, -1, 0, 0, 0, 0, 1, 0, 0, 0] : List ℤ).getD edge.val 0, @@ -235,6 +258,7 @@ def witness20 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 21 for the row-06 closed cover: `alpha` is -2 at slots 9; -1 at slots 8, 10, 11, and zero elsewhere. `beta` is 1 at slots 8; 2 at slots 9, and zero elsewhere. The nonzero affine potentials occur at vertices 4, 5. -/ +@[expose] def witness21 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, 0, 0, 0, 0, 0, 0, -1, -2, -1, -1] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0] : List ℤ).getD edge.val 0, @@ -244,6 +268,7 @@ def witness21 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 22 for the row-06 closed cover: `alpha` is -2 at slots 8; -1 at slots 9, and zero elsewhere. `beta` is 1 at slots 9, and zero elsewhere. The nonzero affine potentials occur at vertices 4, 5. -/ +@[expose] def witness22 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, 0, 0, 0, 0, 0, 0, -2, -1, 0, 0] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0] : List ℤ).getD edge.val 0, @@ -253,6 +278,7 @@ def witness22 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 23 for the row-06 closed cover: `alpha` is -2 at slots 8; -1 at slots 9; 1 at slots 10, and zero elsewhere. `beta` is -1 at slots 10, 11; 2 at slots 8, and zero elsewhere. The nonzero affine potentials occur at vertices 4, 5. -/ +@[expose] def witness23 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, 0, 0, 0, 0, 0, 0, -2, -1, 1, 0] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, 0, 0, 0, 0, 0, 2, 0, -1, -1] : List ℤ).getD edge.val 0, @@ -262,6 +288,7 @@ def witness23 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 24 for the row-06 closed cover: `alpha` is -2 at slots 8, 9; 1 at slots 10, and zero elsewhere. `beta` is -1 at slots 10, 11; 2 at slots 8, and zero elsewhere. The nonzero affine potentials occur at vertices 4, 5. -/ +@[expose] def witness24 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, 0, 0, 0, 0, 0, 0, -2, -2, 1, 0] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, 0, 0, 0, 0, 0, 2, 0, -1, -1] : List ℤ).getD edge.val 0, @@ -271,6 +298,7 @@ def witness24 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 25 for the row-06 closed cover: `alpha` is -1 at slots 2, 8, 9; 1 at slots 3, and zero elsewhere. `beta` is -1 at slots 3; 1 at slots 2, 9, and zero elsewhere. The nonzero affine potentials occur at vertices 2, 3, 4, 5, 6, 7. -/ +@[expose] def witness25 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, -1, 1, 0, 0, 0, 0, -1, -1, 0, 0] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 1, -1, 0, 0, 0, 0, 0, 1, 0, 0] : List ℤ).getD edge.val 0, @@ -281,6 +309,7 @@ def witness25 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 26 for the row-06 closed cover: `alpha` is -2 at slots 8; -1 at slots 9, and zero elsewhere. `beta` is -1 at slots 10, 11; 1 at slots 9; 2 at slots 8, and zero elsewhere. The nonzero affine potentials occur at vertices 4, 5. -/ +@[expose] def witness26 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, 0, 0, 0, 0, 0, 0, -2, -1, 0, 0] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, 0, 0, 0, 0, 0, 2, 1, -1, -1] : List ℤ).getD edge.val 0, @@ -290,6 +319,7 @@ def witness26 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 27 for the row-06 closed cover: `alpha` is -2 at slots 4; 1 at slots 7, and zero elsewhere. `beta` is -1 at slots 7, and zero elsewhere. The nonzero affine potentials occur at vertices 6, 7. -/ +@[expose] def witness27 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, 0, 0, -2, 0, 0, 1, 0, 0, 0, 0] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0] : List ℤ).getD edge.val 0, @@ -299,6 +329,7 @@ def witness27 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 28 for the row-06 closed cover: `alpha` is -2 at slots 4; -1 at slots 5, 6, and zero elsewhere. `beta` is -1 at slots 7; 1 at slots 5; 2 at slots 4, and zero elsewhere. The nonzero affine potentials occur at vertices 6, 7. -/ +@[expose] def witness28 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, 0, 0, -2, -1, -1, 0, 0, 0, 0, 0] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, 0, 2, 1, 0, -1, 0, 0, 0, 0] : List ℤ).getD edge.val 0, @@ -308,6 +339,7 @@ def witness28 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 29 for the row-06 closed cover: `alpha` is -2 at slots 4; -1 at slots 5, 6, and zero elsewhere. `beta` is -2 at slots 7; 1 at slots 5; 2 at slots 4, and zero elsewhere. The nonzero affine potentials occur at vertices 6, 7. -/ +@[expose] def witness29 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, 0, 0, -2, -1, -1, 0, 0, 0, 0, 0] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, 0, 2, 1, 0, -2, 0, 0, 0, 0] : List ℤ).getD edge.val 0, @@ -317,6 +349,7 @@ def witness29 : AnchorWitness 12 8 12 := /-- Endpoint-slope witness 30 for the row-06 closed cover: `alpha` is -2 at slots 4; -1 at slots 5, 6; 1 at slots 7, and zero elsewhere. `beta` is -1 at slots 7; 2 at slots 4, and zero elsewhere. The nonzero affine potentials occur at vertices 6, 7. -/ +@[expose] def witness30 : AnchorWitness 12 8 12 := { alpha := fun edge => ([0, 0, 0, 0, -2, -1, -1, 1, 0, 0, 0, 0] : List ℤ).getD edge.val 0, beta := fun edge => ([0, 0, 0, 0, 2, 0, 0, -1, 0, 0, 0, 0] : List ℤ).getD edge.val 0, @@ -325,6 +358,7 @@ def witness30 : AnchorWitness 12 8 12 := /-- The thirty-one endpoint-slope and affine-potential witnesses shared by the row-06 closed-cover cells. -/ +@[expose] def witnesses : List (AnchorWitness 12 8 12) := [witness0, witness1, witness2, witness3, witness4, witness5, witness6, witness7, witness8, witness9, witness10, witness11, witness12, witness13, witness14, witness15, witness16, witness17, diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06CoverCells0.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06CoverCells0.lean index 558ce533c4..fd5ade752b 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06CoverCells0.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06CoverCells0.lean @@ -15,7 +15,7 @@ Generated cell chunk 0 of 5 for the AR row-06 chamber cover (cells 0-96). Split across modules because the kernel cost of replaying a cell is cumulative within one Lean process. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveRow06CoverCells0 diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06CoverCells1.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06CoverCells1.lean index 95f074d3a6..3cc64081db 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06CoverCells1.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06CoverCells1.lean @@ -15,7 +15,7 @@ Generated cell chunk 1 of 5 for the AR row-06 chamber cover (cells 97-193). Split across modules because the kernel cost of replaying a cell is cumulative within one Lean process. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveRow06CoverCells1 diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06CoverCells2.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06CoverCells2.lean index e05b36d60e..71e078cfbd 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06CoverCells2.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06CoverCells2.lean @@ -15,7 +15,7 @@ Generated cell chunk 2 of 5 for the AR row-06 chamber cover (cells 194-290). Split across modules because the kernel cost of replaying a cell is cumulative within one Lean process. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveRow06CoverCells2 diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06CoverCells3.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06CoverCells3.lean index 05306e733f..2184baa415 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06CoverCells3.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06CoverCells3.lean @@ -15,7 +15,7 @@ Generated cell chunk 3 of 5 for the AR row-06 chamber cover (cells 291-386). Split across modules because the kernel cost of replaying a cell is cumulative within one Lean process. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveRow06CoverCells3 diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06CoverCells4.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06CoverCells4.lean index 5e8e0bbd63..7f9f6b3c79 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06CoverCells4.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06CoverCells4.lean @@ -15,7 +15,7 @@ Generated cell chunk 4 of 5 for the AR row-06 chamber cover (cells 387-482). Split across modules because the kernel cost of replaying a cell is cumulative within one Lean process. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveRow06CoverCells4 diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06CoverReceipts.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06CoverReceipts.lean index 516d4a25d8..220eb1df7f 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06CoverReceipts.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06CoverReceipts.lean @@ -14,7 +14,7 @@ These passive row multipliers are replayed by the corresponding fixed-cover modu The ordered blocks and their concatenation retain the global receipt indices used by its tree. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveRow06FixedCover diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06FixedCover.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06FixedCover.lean index 6c34d6a9e4..1c18ea3ae8 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06FixedCover.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06FixedCover.lean @@ -26,7 +26,7 @@ The external discovery data are untrusted: `cells_check` and chamber is discharged by the generated coverage theorem, so the conclusion is the row on the whole closed orthant. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveRow06FixedCover diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06Symmetry.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06Symmetry.lean index 35de0ff265..ef231d30b1 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06Symmetry.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow06Symmetry.lean @@ -23,7 +23,7 @@ Every permutation is supplied with an explicit inverse, which keeps `reindexLength` definitionally transparent; all endpoint laws are `decide`d. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveRow06Symmetry diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow08.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow08.lean index 3ee66b0453..d10dc24557 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow08.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow08.lean @@ -31,7 +31,7 @@ three-way disjunction, and `ClosedOrbit.closedConstruction_of_chamber` turns one chamber proof per disjunct into the statement on the whole closed orthant. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveRow08 diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow08ChamberOne.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow08ChamberOne.lean index 629e46fe70..c4532e56d3 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow08ChamberOne.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow08ChamberOne.lean @@ -36,7 +36,7 @@ file is an instantiation of `ConfigurationMarkedRow` plus four coefficient tables. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveRow08ChamberOne diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow08ChamberThree.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow08ChamberThree.lean index cfb1e3e1c2..e11739f501 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow08ChamberThree.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow08ChamberThree.lean @@ -44,7 +44,7 @@ chamber and is discharged by `GenusFiveRow08Symmetry.chamber_covers` together with `ClosedOrbit.closedConstruction_of_chamber`; there is no chamber-4 file. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveRow08ChamberThree diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow08ChamberTwo.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow08ChamberTwo.lean index 6875ede492..f4392e0ac8 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow08ChamberTwo.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow08ChamberTwo.lean @@ -40,7 +40,7 @@ marked `e4`), `be = |e7| - |e2|` (the near half of the marked `e7`), target `5` the same picture is read with `al ↔ be` and `p ↔ r`. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveRow08ChamberTwo diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow08Symmetry.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow08Symmetry.lean index c65e019876..207d941115 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow08Symmetry.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow08Symmetry.lean @@ -39,7 +39,7 @@ fixed. It reverses only the triangle edge `e6` and the four slots it swaps in pairs; all six endpoint laws are `decide`d. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveRow08Symmetry @@ -93,19 +93,23 @@ def sigma : CoreSymmetry row08Core := (by decide) (by decide) (by decide) (by decide) (by decide) (by decide) /-- AR's first scope: `a ≤ b` and `d ≤ c`. -/ +@[expose] def ChamberOne (length : Fin 12 → ℕ) : Prop := length 4 ≤ length 3 ∧ length 7 ≤ length 2 /-- AR's second scope: `b ≤ a` and `c ≤ d`. -/ +@[expose] def ChamberTwo (length : Fin 12 → ℕ) : Prop := length 3 ≤ length 4 ∧ length 2 ≤ length 7 /-- AR's third scope: `b ≤ a` and `d ≤ c`. Its `sigma` image gives the remaining sign pattern. -/ +@[expose] def ChamberThree (length : Fin 12 → ℕ) : Prop := length 3 ≤ length 4 ∧ length 7 ≤ length 2 /-- The union of the three scopes AR draw. -/ +@[expose] def Chamber (length : Fin 12 → ℕ) : Prop := ChamberOne length ∨ ChamberTwo length ∨ ChamberThree length diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow09.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow09.lean index e399cf6823..ae68f5223d 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow09.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow09.lean @@ -61,7 +61,7 @@ identically-zero mark `noMark`, which recovers the ordinary one-ramp script definitionally; no slot of row 09 carries a chip in its interior. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveRow09 @@ -88,6 +88,7 @@ Passing the identically-zero mark through `ConfigurationMarkedRow` recovers exactly that, and buys the whole residual-effectivity wrapper unchanged. -/ /-- The zero mark: no slot of row 09 carries an interior chip. -/ +@[expose] def noMark : Fin 12 → ℕ := fun _ => 0 @[simp] theorem noMark_apply (e : Fin 12) : noMark e = 0 := rfl diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow10.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow10.lean index 4a205afa05..c548ded36b 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow10.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow10.lean @@ -44,7 +44,7 @@ inequalities supply. `GenusFiveRow10Symmetry.chamber_covers` and `ClosedOrbit.closedConstruction_of_chamber` then finish the closed orthant. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveRow10 diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow10ChamberOne.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow10ChamberOne.lean index e604ce1ef1..a2f4b4fc3d 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow10ChamberOne.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow10ChamberOne.lean @@ -42,7 +42,7 @@ the interior chip at distance `|e10|` from `4` -- and its second inequality is exactly `gamma ≤ beta`. Both are used, and nothing else about the chamber is. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveRow10ChamberOne diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow10ChamberTwo.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow10ChamberTwo.lean index 149f1106c5..9fa8c92231 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow10ChamberTwo.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow10ChamberTwo.lean @@ -45,7 +45,7 @@ chamber and is carried for free by `GenusFiveRow10Symmetry.chamber_covers`. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveRow10ChamberTwo diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow10Symmetry.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow10Symmetry.lean index 075f00b6d0..b4f9039831 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow10Symmetry.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow10Symmetry.lean @@ -52,7 +52,7 @@ which keeps `CoreSymmetry.reindexLength` definitionally transparent, the pattern of `GenusFiveRow01Symmetry` and `GenusFiveRow05Symmetry`. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveRow10Symmetry @@ -107,15 +107,18 @@ def sigma : CoreSymmetry row10Core := (by decide) (by decide) (by decide) (by decide) (by decide) (by decide) /-- Chamber 1: AR's first scope, the apex spoke `a` realizes the minimum. -/ +@[expose] def ChamberOne (length : Fin 12 → ℕ) : Prop := length 10 ≤ length 4 ∧ length 10 ≤ length 3 /-- Chamber 2: AR's second scope, the spoke `b` realizes the minimum. -/ +@[expose] def ChamberTwo (length : Fin 12 → ℕ) : Prop := length 4 ≤ length 10 ∧ length 4 ≤ length 3 /-- The union of the two scopes AR draw. The third case, `c = min`, is the `sigma` image of chamber 2 and needs no proof of its own. -/ +@[expose] def Chamber (length : Fin 12 → ℕ) : Prop := ChamberOne length ∨ ChamberTwo length diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow11.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow11.lean index 0e49440356..c376e6540b 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow11.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow11.lean @@ -27,7 +27,7 @@ ramp and endpoint lemmas this file used to carry now live). All this file does is name the row's lookup tables and check the incidence facts. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveRow11 @@ -111,6 +111,7 @@ def spareChip : Fin 8 → Fin 8 | _ => 0 /-- The cube read as four AR configuration-2 pictures. -/ +@[expose] def row11Config : ConfigTwo where core := row11Core chipOne := 0 @@ -144,6 +145,7 @@ def row11Config : ConfigTwo where ring /-- One chip on the selected bipartition class. -/ +@[expose] def cubeDivisor (d : DegSpec 8 12) : CFDiv d.graph := fourChipDivisor (d.coreVertex 0) (d.coreVertex 3) (d.coreVertex 5) (d.coreVertex 6) diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow12.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow12.lean index fc287f0b97..8958af8977 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow12.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow12.lean @@ -25,7 +25,7 @@ name the row's lookup tables, check the incidence facts, and observe that the two tables between them cover every chip-free vertex. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveRow12 @@ -85,6 +85,7 @@ def middleEdge : Fin 8 → Fin 12 | _ => 11 /-- The pair `2--7` of row 12, read as an AR configuration-3 picture. -/ +@[expose] def row12PairConfig : ConfigThree 8 12 where core := row12Core chipOne := 3 diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow12Guarding.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow12Guarding.lean index 5434bcdb82..cbbcfc53a9 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow12Guarding.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow12Guarding.lean @@ -35,7 +35,7 @@ is a proof about AR's own divisor and not merely a similar one. As of deleted, and `GenusFiveConstructions.row12_straightforward` points here. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveRow12Guarding diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow12Tripod.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow12Tripod.lean index 92db69b1b0..fc361aefd4 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow12Tripod.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow12Tripod.lean @@ -23,7 +23,7 @@ name the row's lookup tables, check the incidence facts that file asks for, and re-export the reach statement in the shape row 12 consumes. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveRow12Tripod @@ -40,6 +40,7 @@ open GenusFiveCoreAtlas open ConfigurationTwo /-- The two configuration-2 centers, as a decidable table. -/ +@[expose] def isCenter : Fin 8 → Bool | 0 | 1 => true | _ => false @@ -87,6 +88,7 @@ def spareChip : Fin 8 → Fin 8 | _ => 0 /-- The two tripod centres of row 12, read as AR configuration-2 pictures. -/ +@[expose] def row12TripodConfig : ConfigTwo where core := row12Core chipOne := 3 @@ -122,6 +124,7 @@ def row12TripodConfig : ConfigTwo where /-! ## The shape row 12 consumes -/ /-- The two configuration-2 centers. -/ +@[expose] def IsTripodCenter (v : Fin 8) : Prop := v = 0 ∨ v = 1 instance (v : Fin 8) : Decidable (IsTripodCenter v) := by @@ -133,6 +136,7 @@ theorem isCenter_of_isTripodCenter {v : Fin 8} (h : IsTripodCenter v) : rcases h with rfl | rfl <;> rfl /-- One chip on the selected bipartition class. -/ +@[expose] def rowDivisor (d : DegSpec 8 12) : CFDiv d.graph := fourChipDivisor (d.coreVertex 3) (d.coreVertex 4) (d.coreVertex 5) (d.coreVertex 6) diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow14.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow14.lean index f178f74a20..c4adbdcc9d 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow14.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow14.lean @@ -41,7 +41,7 @@ The two families are combined exactly as in `GenusFiveRow12`: each names its own centres, and between them they cover every chip-free vertex. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveRow14 @@ -62,6 +62,7 @@ open ConfigurationBananaTail /-! ## The divisor -/ /-- The four guarding-set chip vertices 0, 3, 5, and 7 of row 14. -/ +@[expose] def IsChipVertex (v : Fin 8) : Prop := v = 0 ∨ v = 3 ∨ v = 5 ∨ v = 7 diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow14CoverReceipts.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow14CoverReceipts.lean index 79d76516ce..6df01d5fa0 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow14CoverReceipts.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow14CoverReceipts.lean @@ -14,7 +14,7 @@ These passive row multipliers are replayed by the corresponding fixed-cover modu The ordered blocks and their concatenation retain the global receipt indices used by its tree. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveRow14FixedCover @@ -23,6 +23,7 @@ open Utilities /-- Farkas receipt block 0 for the row-14 tree, providing global indices 0 through 127. Each receipt specifies a positive integer combination of active affine rows for a cell constraint or a contradiction. -/ +@[expose] def farkasReceipts0 : List Certificate.AffineCover.FarkasData := [ { terms := @@ -287,6 +288,7 @@ def farkasReceipts0 : List Certificate.AffineCover.FarkasData := /-- Farkas receipt block 1 for the row-14 tree, providing global indices 128 through 255. Each receipt specifies a positive integer combination of active affine rows for a cell constraint or a contradiction. -/ +@[expose] def farkasReceipts1 : List Certificate.AffineCover.FarkasData := [ { terms := @@ -568,6 +570,7 @@ def farkasReceipts1 : List Certificate.AffineCover.FarkasData := /-- Farkas receipt block 2 for the row-14 tree, providing global indices 256 through 346. Each receipt specifies a positive integer combination of active affine rows for a cell constraint or a contradiction. -/ +@[expose] def farkasReceipts2 : List Certificate.AffineCover.FarkasData := [ { terms := @@ -769,6 +772,7 @@ def farkasReceipts2 : List Certificate.AffineCover.FarkasData := /-- The complete table of 347 row-14 Farkas receipts, concatenated in the global order referenced by decision-tree leaves. -/ +@[expose] def farkasReceipts : List Certificate.AffineCover.FarkasData := farkasReceipts0 ++ farkasReceipts1 ++ farkasReceipts2 diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow14FixedCover.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow14FixedCover.lean index d2a05b22ee..be71297c85 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow14FixedCover.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow14FixedCover.lean @@ -17,7 +17,7 @@ an additional exact replay. Generated exact replay of the fixed AR row-14 divisor. `cells_check` and `tree_check` replay every arithmetic obligation in the kernel. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveRow14FixedCover diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow15.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow15.lean index fe6f7455a0..2d7905399e 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow15.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow15.lean @@ -22,7 +22,7 @@ is name the row's lookup tables and check the incidence facts that file asks for. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveRow15 diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow16.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow16.lean index af206cd3a7..636bbfc0ed 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow16.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveRow16.lean @@ -21,7 +21,7 @@ is name the row's lookup tables and check the incidence facts that file asks for. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveRow16 diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveTwoPole.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveTwoPole.lean index e3d0372a81..66ae73f987 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveTwoPole.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveTwoPole.lean @@ -23,7 +23,7 @@ The theorem here concerns positive subdivisions. `GenusFiveTwoPoleClosed` extends the same weights to contraction faces by discrete specialization. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveTwoPole diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveTwoPoleClosed.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveTwoPoleClosed.lean index 503f19810f..6e6c160b46 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveTwoPoleClosed.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveTwoPoleClosed.lean @@ -18,7 +18,7 @@ specialization transports their rank from positive subdivisions to the contracted graph. No row-specific boundary construction is imported here. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveTwoPoleClosed diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveTwoPoleData.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveTwoPoleData.lean index 2561c9bfa5..9b60e323e7 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveTwoPoleData.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFiveTwoPoleData.lean @@ -23,7 +23,7 @@ contain no rank or length hypotheses. The source slots are exactly those in `GenusFiveCoreAtlas`, including the reversed connector in rows 02 and 04. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFiveTwoPoleData diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourCanonicalClassifier.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourCanonicalClassifier.lean index 207314b39c..318654b62e 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourCanonicalClassifier.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourCanonicalClassifier.lean @@ -20,7 +20,7 @@ canonical-matrix traversal and a small generated payload table, but no replay tree, `native_decide`, private import, or unproved hypothesis. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFourCanonicalClassifier open Utilities diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourCubicAtlas.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourCubicAtlas.lean index deb049b8f3..ee5f21e131 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourCubicAtlas.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourCubicAtlas.lean @@ -20,7 +20,7 @@ kernel-checked validity. Exhaustiveness is proved separately by `LowGenus.GenusFourCanonicalClassifier`. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFourCubicAtlas open Utilities.Certificate @@ -44,36 +44,42 @@ catalog from which these six terminal loopless cubic rows were extracted. -/ /-- The six-vertex cubic core for genus-four atlas row 095, with oriented slots `0→4, 0→5, 0→5, 1→3, 1→4, 1→5, 2→3, 2→3, 2→4` in index order. -/ +@[expose] def row095Core : Core 6 9 where tail := ![0, 0, 0, 1, 1, 1, 2, 2, 2] head := ![4, 5, 5, 3, 4, 5, 3, 3, 4] /-- The six-vertex cubic core for genus-four atlas row 096, with oriented slots `0→4, 0→5, 0→5, 1→3, 1→4, 1→4, 2→3, 2→3, 2→5` in index order. -/ +@[expose] def row096Core : Core 6 9 where tail := ![0, 0, 0, 1, 1, 1, 2, 2, 2] head := ![4, 5, 5, 3, 4, 4, 3, 3, 5] /-- The six-vertex cubic core for genus-four atlas row 097, with oriented slots `0→4, 0→5, 0→5, 1→2, 1→3, 1→5, 2→3, 2→4, 3→4` in index order. -/ +@[expose] def row097Core : Core 6 9 where tail := ![0, 0, 0, 1, 1, 1, 2, 2, 3] head := ![4, 5, 5, 2, 3, 5, 3, 4, 4] /-- The six-vertex cubic core for genus-four atlas row 098, with oriented slots `0→4, 0→5, 0→5, 1→2, 1→3, 1→4, 2→3, 2→3, 4→5` in index order. -/ +@[expose] def row098Core : Core 6 9 where tail := ![0, 0, 0, 1, 1, 1, 2, 2, 4] head := ![4, 5, 5, 2, 3, 4, 3, 3, 5] /-- The six-vertex cubic core for genus-four atlas row 099, with oriented slots `0→3, 0→4, 0→5, 1→3, 1→4, 1→5, 2→3, 2→4, 2→5` in index order. -/ +@[expose] def row099Core : Core 6 9 where tail := ![0, 0, 0, 1, 1, 1, 2, 2, 2] head := ![3, 4, 5, 3, 4, 5, 3, 4, 5] /-- The six-vertex cubic core for genus-four atlas row 100, with oriented slots `0→3, 0→4, 0→5, 1→2, 1→4, 1→5, 2→3, 2→5, 3→4` in index order. -/ +@[expose] def row100Core : Core 6 9 where tail := ![0, 0, 0, 1, 1, 1, 2, 2, 3] head := ![3, 4, 5, 2, 4, 5, 3, 5, 4] @@ -122,30 +128,37 @@ private theorem row100_cubic : row100Core.Cubic := by /-- Genus-four atlas row 095, packaging its concrete core with proofs that it is loopless, connected, and cubic. -/ +@[expose] def row095 : Row := ⟨row095Core, by exact row095_loopless, by exact connected row095Core (by decide +kernel), by exact row095_cubic⟩ /-- Genus-four atlas row 096, packaging its concrete core with proofs that it is loopless, connected, and cubic. -/ +@[expose] def row096 : Row := ⟨row096Core, by exact row096_loopless, by exact connected row096Core (by decide +kernel), by exact row096_cubic⟩ /-- Genus-four atlas row 097, packaging its concrete core with proofs that it is loopless, connected, and cubic. -/ +@[expose] def row097 : Row := ⟨row097Core, by exact row097_loopless, by exact connected row097Core (by decide +kernel), by exact row097_cubic⟩ /-- Genus-four atlas row 098, packaging its concrete core with proofs that it is loopless, connected, and cubic. -/ +@[expose] def row098 : Row := ⟨row098Core, by exact row098_loopless, by exact connected row098Core (by decide +kernel), by exact row098_cubic⟩ /-- Genus-four atlas row 099, packaging its concrete core with proofs that it is loopless, connected, and cubic. -/ +@[expose] def row099 : Row := ⟨row099Core, by exact row099_loopless, by exact connected row099Core (by decide +kernel), by exact row099_cubic⟩ /-- Genus-four atlas row 100, packaging its concrete core with proofs that it is loopless, connected, and cubic. -/ +@[expose] def row100 : Row := ⟨row100Core, by exact row100_loopless, by exact connected row100Core (by decide +kernel), by exact row100_cubic⟩ /-- The exact atlas order used by the emitted canonical-classifier payload. -/ +@[expose] def atlas : List Row := [row095, row096, row097, row098, row099, row100] @[simp] theorem atlas_length : atlas.length = 6 := by diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourCubicCoverage.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourCubicCoverage.lean index ceff5eded0..30140c4094 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourCubicCoverage.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourCubicCoverage.lean @@ -19,7 +19,7 @@ row proofs into the classifier-facing coverage theorem consumed by the public pseudocore reduction. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFourCubicCoverage open Utilities @@ -31,6 +31,7 @@ open AtanasovRanganathan.GenusFourCubicAtlas open AtanasovRanganathan.GenusFourPseudocoreCoverage /-- The six concrete closed-row obligations. -/ +@[expose] def RowClosedCoverage : Prop := ∀ row ∈ atlas, ∀ (length : Fin 9 → ℕ) diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourPseudocoreCoverage.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourPseudocoreCoverage.lean index eea22fb038..383298f01d 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourPseudocoreCoverage.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourPseudocoreCoverage.lean @@ -28,7 +28,7 @@ closed degree-three pencils on connected loopless cubic `6/9` cores. No 111-row pseudocore catalog is needed by this unmarked proof. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFourPseudocoreCoverage open Utilities @@ -48,6 +48,7 @@ open AtanasovRanganathan.Configurations /-- Exact finite input for the public genus-four reduction: every connected loopless cubic `6/9` core carries a degree-three pencil on all of its nonloopy forest faces. -/ +@[expose] def CubicClosedCoverage : Prop := ∀ (candidate : Core 6 9), candidate.Connected → (∀ edge : Fin 9, candidate.tail edge ≠ candidate.head edge) → diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow095.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow095.lean index dcdf1f1410..3f42abba24 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow095.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow095.lean @@ -30,7 +30,7 @@ We first normalize `length 0 <= length 5`. The opposite chamber is carried to this one by the Core-095 involution and is treated separately below. -/ -@[expose] public section +public section namespace LowGenus.GenusFourRow095 open Utilities.Certificate @@ -44,6 +44,7 @@ open WindowProfile /-- The ordered nine-slot presentation of the catalog's loopless Core 095. Keeping the concrete cardinalities visible makes subsequent `Fin` arithmetic small and transparent. -/ +@[expose] def core : ExplicitPotential.Core 6 9 where tail := ![0, 0, 0, 1, 1, 1, 2, 2, 2] head := ![4, 5, 5, 3, 4, 5, 3, 3, 4] @@ -93,6 +94,7 @@ theorem length_five_eq_A_add_X (hNorm : length 0 ≤ length 5) : omega /-- The moving chip `q`, at distance `X` from vertex 1 on slot 5. -/ +@[expose] def q (_hNorm : length 0 ≤ length 5) : (Spec length hLength).Vertex := (Spec length hLength).pathVertex 5 ⟨X length, by @@ -104,6 +106,7 @@ def q (_hNorm : length 0 ≤ length 5) : (Spec length hLength).Vertex := the three displayed divisors. Its endpoint divisor is `a + b - c - q`. -/ +@[expose] def abProfile (hNorm : length 0 ≤ length 5) : WindowProfile.Data (Spec length hLength) where coreValue := fun vertex => diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow095CaseOne.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow095CaseOne.lean index 8abae3e465..b557b6d9e7 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow095CaseOne.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow095CaseOne.lean @@ -22,7 +22,7 @@ the rather complicated firing scripts on arbitrary subdivisions are never expanded vertex-by-vertex. -/ -@[expose] public section +public section namespace LowGenus.GenusFourRow095.CaseOne open Utilities.Certificate @@ -75,6 +75,7 @@ def xStart : (Spec length hLength).Vertex := omega⟩ /-- The signed-window profile reaching the vertex `d=1`. -/ +@[expose] def dProfile (_hBC : C length ≤ B length) : WindowProfile.Data (Spec length hLength) where coreValue := ![m length, 0, m length, m length, m length, m length] @@ -98,6 +99,7 @@ def dProfile (_hBC : C length ≤ B length) : fin_cases edge <;> simp [core, P, m, B, C, Delta, X] /-- The profile used for both `e=2` and `f=3`. -/ +@[expose] def efProfile (hBC : C length ≤ B length) : WindowProfile.Data (Spec length hLength) where coreValue := ![C length, C length, 0, 0, C length, C length] diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow095CaseThreeProof.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow095CaseThreeProof.lean index f636c38ecd..32b7efb370 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow095CaseThreeProof.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow095CaseThreeProof.lean @@ -17,7 +17,7 @@ sparse endpoint replay and closes the three remaining core reachability tests. -/ -@[expose] public section +public section namespace LowGenus.GenusFourRow095.CaseThree open Utilities.Certificate diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow095CasesTwoThree.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow095CasesTwoThree.lean index 16cc6c7ad0..0ef2f6f77b 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow095CasesTwoThree.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow095CasesTwoThree.lean @@ -17,7 +17,7 @@ file records the two remaining pairs of signed windows and packages their endpoint computations as reachability statements. -/ -@[expose] public section +public section namespace LowGenus.GenusFourRow095 open Utilities.Certificate @@ -87,6 +87,7 @@ def dProfile : WindowProfile.Data (Spec length hLength) where /-- Case-2 window profile which reaches the two zero-valued core vertices `e=2` and `f=3`. -/ +@[expose] def efProfile : WindowProfile.Data (Spec length hLength) where coreValue := ![B length + m length, B length, 0, 0, B length + m length, B length + m length] @@ -420,12 +421,14 @@ private theorem Y_lt_Delta (hYsmall : Y length < min (X length) (Delta length)) lt_of_lt_of_le hYsmall (min_le_right _ _) /-- The moving third chip in Case 3. -/ +@[expose] def s : (Spec length hLength).Vertex := (Spec length hLength).pathVertex 4 ⟨Y length, by exact Nat.lt_succ_iff.mpr (Y_lt_Delta length hYsmall).le⟩ /-- Case-3 window profile which reaches `d=1`. -/ +@[expose] def dProfile : WindowProfile.Data (Spec length hLength) where coreValue := ![Y length, 0, 0, 0, Y length, Y length] start := fun edge => @@ -471,6 +474,7 @@ def dProfile : WindowProfile.Data (Spec length hLength) where all_goals omega /-- Case-3 window profile which reaches `e=2` and `f=3`. -/ +@[expose] def efProfile : WindowProfile.Data (Spec length hLength) where coreValue := ![C length, B length, 0, 0, C length, C length] start := fun edge => diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow095Closed.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow095Closed.lean index c2e92e830b..af41ddee15 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow095Closed.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow095Closed.lean @@ -30,7 +30,7 @@ The repetitive contraction witnesses are isolated as passive checked data in `LowGenus.Generated.GenusFourRow095FaceData`. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFourRow095Closed open Utilities diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow095Positive.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow095Positive.lean index 6e9757e6ed..80738cbb90 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow095Positive.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow095Positive.lean @@ -20,7 +20,7 @@ involution. The result is a kernel-checked degree-three rank-one divisor for every positive integral subdivision of the public row-095 core. -/ -@[expose] public section +public section namespace LowGenus.GenusFourRow095 open Utilities.Certificate diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow095Symmetry.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow095Symmetry.lean index ce712efbcf..6900010f6a 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow095Symmetry.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow095Symmetry.lean @@ -25,7 +25,7 @@ involution as an occurrence-preserving subdivision relabeling, so a proof in the normalized chamber transports to all positive length assignments. -/ -@[expose] public section +public section namespace LowGenus.GenusFourRow095 open Utilities.Certificate @@ -41,6 +41,7 @@ theorem slotSwapFun_bijective : Function.Bijective slotSwapFun := by decide /-- The involutive permutation of the nine slots induced by the row-095 core symmetry, packaged as an equivalence for transporting lengths. -/ +@[expose] def slotSwap : Fin 9 ≃ Fin 9 where toFun := slotSwapFun invFun := slotSwapFun diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow096Pencil.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow096Pencil.lean index d36e516841..77a15165b2 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow096Pencil.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow096Pencil.lean @@ -61,7 +61,7 @@ three-slot instance of `prin_cutRamp` at the cut `{e0,e6,e7}`. This file is complete: no `sorry` remains. -/ -@[expose] public section +public section namespace LowGenus.GenusFourRow096Pencil diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow097Closed.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow097Closed.lean index 05719a85ec..72a5830793 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow097Closed.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow097Closed.lean @@ -72,7 +72,7 @@ The four per-march divisor identities of the retired open proof — four This file needs no heartbeat override. -/ -@[expose] public section +public section namespace LowGenus.GenusFourRow097Closed diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow097Contractions.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow097Contractions.lean index 7ad4214cdb..a0aac795c9 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow097Contractions.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow097Contractions.lean @@ -19,7 +19,7 @@ below deliberately name the small target cores directly, so this public proof is self-contained. -/ -@[expose] public section +public section namespace LowGenus.GenusFourRow097Contractions @@ -31,24 +31,28 @@ open Utilities.Certificate.ReorientContraction /-- The explicit contraction target core 031 for row 097, with oriented slots `0→2, 0→3, 0→3, 1→2, 1→3, 1→3, 2→3` in index order. -/ +@[expose] def core031 : ExplicitPotential.Core 4 7 where tail := ![0, 0, 0, 1, 1, 1, 2] head := ![2, 3, 3, 2, 3, 3, 3] /-- The explicit contraction target core 032 for row 097, with oriented slots `0→2, 0→3, 0→3, 1→2, 1→2, 1→3, 2→3` in index order. -/ +@[expose] def core032 : ExplicitPotential.Core 4 7 where tail := ![0, 0, 0, 1, 1, 1, 2] head := ![2, 3, 3, 2, 2, 3, 3] /-- The explicit contraction target core 034 for row 097, with oriented slots `0→2, 0→3, 0→3, 1→2, 1→2, 1→2, 1→3` in index order. -/ +@[expose] def core034 : ExplicitPotential.Core 4 7 where tail := ![0, 0, 0, 1, 1, 1, 1] head := ![2, 3, 3, 2, 2, 2, 3] /-- The explicit contraction target core 068 for row 097, with oriented slots `0→3, 0→4, 0→4, 1→2, 1→3, 1→4, 2→3, 2→3` in index order. -/ +@[expose] def core068 : ExplicitPotential.Core 5 8 where tail := ![0, 0, 0, 1, 1, 1, 2, 2] head := ![3, 4, 4, 2, 3, 4, 3, 3] diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow098Closed.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow098Closed.lean index 2319a799c9..55e17df44c 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow098Closed.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRow098Closed.lean @@ -22,7 +22,7 @@ This gives a short structural proof on the whole closed orthant; the generated `g4row098.rpf` cut-vertex certificate is therefore no longer load-bearing. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFourRow098Closed open Utilities diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRowsClosed.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRowsClosed.lean index d570ebcd0c..688682d04c 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRowsClosed.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GenusFourRowsClosed.lean @@ -22,7 +22,7 @@ certificates for the boundary faces; row 096 additionally has a readable symbolic proof on the positive orthant. -/ -@[expose] public section +public section namespace AtanasovRanganathan.GenusFourRowsClosed open Utilities diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/GuardingSet.lean b/LeanPool/BrillNoetherGraphs/LowGenus/GuardingSet.lean index e4f43e21e3..cd55acb9d3 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/GuardingSet.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/GuardingSet.lean @@ -87,7 +87,7 @@ a weight function. `coreClassDivisor_eq_fourChipDivisor` below is that translation, proved for four pairwise-distinct chips. -/ -@[expose] public section +public section namespace AtanasovRanganathan.Guarding @@ -200,6 +200,7 @@ that "chip free" is a statement about the weight and not about a list. The two agree as soon as the four names are pairwise distinct. -/ /-- The weight of the four-chip divisor: one on each named vertex. -/ +@[expose] def fourChipWeight (a b c e : Fin n) (v : Fin n) : ℤ := if ConfigurationThree.IsChipOf a b c e v then 1 else 0 diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/Highlights.lean b/LeanPool/BrillNoetherGraphs/LowGenus/Highlights.lean index 0952823bdc..8a7fdaf776 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/Highlights.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/Highlights.lean @@ -35,7 +35,7 @@ by the same checked `(2,3)` articulation. The public canonical classifiers make both reductions exhaustive. -/ -@[expose] public section +public section namespace LowGenus.Highlights diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/Infrastructure.lean b/LeanPool/BrillNoetherGraphs/LowGenus/Infrastructure.lean index 54e6f3320d..ed2cc5af06 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/Infrastructure.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/Infrastructure.lean @@ -11,4 +11,4 @@ public import LeanPool.BrillNoetherGraphs.LowGenus.Infrastructure.TrivalentExpan /-! Supporting modules for Brill–Noether theory and gonality of finite graphs. -/ -@[expose] public section +public section diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/Infrastructure/CoreRelabelingClosed.lean b/LeanPool/BrillNoetherGraphs/LowGenus/Infrastructure/CoreRelabelingClosed.lean index 03ea8d53a2..60481f65f9 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/Infrastructure/CoreRelabelingClosed.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/Infrastructure/CoreRelabelingClosed.lean @@ -20,7 +20,7 @@ reachability relation generated by zero slots and then builds the induced equivalence of quotient classes. -/ -@[expose] public section +public section namespace Utilities.Certificate.ExplicitPotential.Core.Relabeling open Utilities diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/Infrastructure/TrivalentExpansionClosed.lean b/LeanPool/BrillNoetherGraphs/LowGenus/Infrastructure/TrivalentExpansionClosed.lean index 9f52c6f591..39be871fa5 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/Infrastructure/TrivalentExpansionClosed.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/Infrastructure/TrivalentExpansionClosed.lean @@ -18,7 +18,7 @@ original subdivision. This file expresses that observation in the closed orthant language consumed by the Atanasov--Ranganathan row constructions. -/ -@[expose] public section +public section namespace Utilities.Subdivision.TrivalentExpansion open Utilities @@ -184,6 +184,7 @@ theorem closedLength_not_isLoopy exact hLoop j (by simpa [bigTail, bigHead] using hFib) /-- The canonical closed face of the centipede expansion. -/ +@[expose] noncomputable def closedFace (small : Spec n p) (hLoop : ∀ e : Fin p, C.tail e ≠ C.head e) : DegSpec (expandedVertexCount (n := n) (p := p)) (expandedSlotCount (n := n) (p := p)) := diff --git a/LeanPool/BrillNoetherGraphs/LowGenus/LowGenusExistence.lean b/LeanPool/BrillNoetherGraphs/LowGenus/LowGenusExistence.lean index 667cb88ddb..b4ab86a1cc 100644 --- a/LeanPool/BrillNoetherGraphs/LowGenus/LowGenusExistence.lean +++ b/LeanPool/BrillNoetherGraphs/LowGenus/LowGenusExistence.lean @@ -29,15 +29,17 @@ The library's `BNExists G r d` uses the equivalent convenient convention inequality exposed as an implication. -/ -@[expose] public section +public section namespace Utilities /-- The genus-four geometric heart of the Atanasov--Ranganathan theorem. -/ +@[expose] def GenusFourRankOneExistence : Prop := ∀ (G : CFGraph.{0}), graphConnected G → CFGraph.genus G = 4 → BNExists G 1 3 /-- The genus-five geometric heart of the Atanasov--Ranganathan theorem. -/ +@[expose] def GenusFiveRankOneExistence : Prop := ∀ (G : CFGraph.{0}), graphConnected G → CFGraph.genus G = 5 → BNExists G 1 4 @@ -159,6 +161,7 @@ theorem brillNoetherConjecture_of_genus_le_five_of_criticalPencils /-- The proposition represented by the paper's main theorem in the library's degree-exact, rank-lower-bound convention. -/ +@[expose] def BrillNoetherExistenceThroughFive : Prop := ∀ (G : CFGraph.{0}) (hG : graphConnected G), CFGraph.genus G ≤ 5 → ∀ r d : ℤ, brillNoetherConjecture hG r d diff --git a/LeanPool/BrillNoetherGraphs/Research.lean b/LeanPool/BrillNoetherGraphs/Research.lean index ae58171f95..c9f3c01d03 100644 --- a/LeanPool/BrillNoetherGraphs/Research.lean +++ b/LeanPool/BrillNoetherGraphs/Research.lean @@ -10,4 +10,4 @@ public import LeanPool.BrillNoetherGraphs.Research.GenusFiveSpecializationAudit /-! Supporting modules for Brill–Noether theory and gonality of finite graphs. -/ -@[expose] public section +public section diff --git a/LeanPool/BrillNoetherGraphs/Research/GenusFiveSpecializationAudit.lean b/LeanPool/BrillNoetherGraphs/Research/GenusFiveSpecializationAudit.lean index 7b853b1394..9599efb053 100644 --- a/LeanPool/BrillNoetherGraphs/Research/GenusFiveSpecializationAudit.lean +++ b/LeanPool/BrillNoetherGraphs/Research/GenusFiveSpecializationAudit.lean @@ -11,4 +11,4 @@ public import LeanPool.BrillNoetherGraphs.LowGenus.GenusFiveTwoPoleClosed /-! # genus-five-specialization-audit -/ -@[expose] public section +public section diff --git a/LeanPool/BrillNoetherGraphs/TreewidthGonality.lean b/LeanPool/BrillNoetherGraphs/TreewidthGonality.lean index efded769c4..94fec41ee6 100644 --- a/LeanPool/BrillNoetherGraphs/TreewidthGonality.lean +++ b/LeanPool/BrillNoetherGraphs/TreewidthGonality.lean @@ -33,4 +33,4 @@ public import LeanPool.BrillNoetherGraphs.TreewidthGonality.Highlights /-! # Treewidth Gonality -/ -@[expose] public section +public section diff --git a/LeanPool/BrillNoetherGraphs/TreewidthGonality/Gonality.lean b/LeanPool/BrillNoetherGraphs/TreewidthGonality/Gonality.lean index 3f74f4cefa..001b611c4c 100644 --- a/LeanPool/BrillNoetherGraphs/TreewidthGonality/Gonality.lean +++ b/LeanPool/BrillNoetherGraphs/TreewidthGonality/Gonality.lean @@ -11,4 +11,4 @@ public import LeanPool.BrillNoetherGraphs.TreewidthGonality.Gonality.TreewidthGo /-! Supporting modules for Brill–Noether theory and gonality of finite graphs. -/ -@[expose] public section +public section diff --git a/LeanPool/BrillNoetherGraphs/TreewidthGonality/Gonality/BrambleGonality.lean b/LeanPool/BrillNoetherGraphs/TreewidthGonality/Gonality/BrambleGonality.lean index ce1ae8d053..e92070ddca 100644 --- a/LeanPool/BrillNoetherGraphs/TreewidthGonality/Gonality/BrambleGonality.lean +++ b/LeanPool/BrillNoetherGraphs/TreewidthGonality/Gonality/BrambleGonality.lean @@ -38,7 +38,7 @@ Connectivity of a vertex set is `((underlyingSimpleGraph G).induce (↑B : Set G the convention fixed in `TreewidthGonality/Treewidth/TreeDecomposition.lean`. -/ -@[expose] public section +public section namespace Utilities.Gonality diff --git a/LeanPool/BrillNoetherGraphs/TreewidthGonality/Gonality/TreewidthGonality.lean b/LeanPool/BrillNoetherGraphs/TreewidthGonality/Gonality/TreewidthGonality.lean index 9cc5816479..4fe15f17b6 100644 --- a/LeanPool/BrillNoetherGraphs/TreewidthGonality/Gonality/TreewidthGonality.lean +++ b/LeanPool/BrillNoetherGraphs/TreewidthGonality/Gonality/TreewidthGonality.lean @@ -28,7 +28,7 @@ Both halves are unconditional, so `#print axioms` on the theorems below reports exactly `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section namespace Utilities.Gonality diff --git a/LeanPool/BrillNoetherGraphs/TreewidthGonality/Highlights.lean b/LeanPool/BrillNoetherGraphs/TreewidthGonality/Highlights.lean index 23438eafc7..b10794c83c 100644 --- a/LeanPool/BrillNoetherGraphs/TreewidthGonality/Highlights.lean +++ b/LeanPool/BrillNoetherGraphs/TreewidthGonality/Highlights.lean @@ -30,7 +30,7 @@ are unconditional; `#print axioms` on either reports exactly Bellenbaum–Diestel proof. -/ -@[expose] public section +public section namespace TreewidthGonality.Highlights diff --git a/LeanPool/BrillNoetherGraphs/TreewidthGonality/Treewidth.lean b/LeanPool/BrillNoetherGraphs/TreewidthGonality/Treewidth.lean index daaa6e3ac9..3aa4897f53 100644 --- a/LeanPool/BrillNoetherGraphs/TreewidthGonality/Treewidth.lean +++ b/LeanPool/BrillNoetherGraphs/TreewidthGonality/Treewidth.lean @@ -16,4 +16,4 @@ public import LeanPool.BrillNoetherGraphs.TreewidthGonality.Treewidth.TreePath /-! Supporting modules for Brill–Noether theory and gonality of finite graphs. -/ -@[expose] public section +public section diff --git a/LeanPool/BrillNoetherGraphs/TreewidthGonality/Treewidth/Bramble.lean b/LeanPool/BrillNoetherGraphs/TreewidthGonality/Treewidth/Bramble.lean index 98a7b06587..d75da8a3a5 100644 --- a/LeanPool/BrillNoetherGraphs/TreewidthGonality/Treewidth/Bramble.lean +++ b/LeanPool/BrillNoetherGraphs/TreewidthGonality/Treewidth/Bramble.lean @@ -30,7 +30,7 @@ there is no separate nonemptiness field. hitting set) is what makes it meaningful rather than the `sInf ∅ = 0` default. -/ -@[expose] public section +public section namespace Utilities.Treewidth @@ -83,6 +83,7 @@ theorem nonempty_of_mem {B : Finset V} (hB : B ∈ 𝔅.members) : B.Nonempty := exact Finset.coe_nonempty.mp h /-- A **hitting set** of a bramble meets every member. -/ +@[expose] def IsHittingSet (S : Finset V) : Prop := ∀ B ∈ 𝔅.members, (B ∩ S).Nonempty @@ -100,6 +101,7 @@ theorem order_le_card_of_isHittingSet {S : Finset V} (hS : 𝔅.IsHittingSet S) Nat.sInf_le ⟨S, hS, rfl⟩ /-- Restricting a bramble to a subfamily of its members is again a bramble. -/ +@[expose] def restrict (M : Finset (Finset V)) (hM : M ⊆ 𝔅.members) : Bramble H where members := M connected_mem := fun B hB => 𝔅.connected_mem B (hM hB) diff --git a/LeanPool/BrillNoetherGraphs/TreewidthGonality/Treewidth/PartialDecomposition.lean b/LeanPool/BrillNoetherGraphs/TreewidthGonality/Treewidth/PartialDecomposition.lean index c5c4bd88d6..d46acf485e 100644 --- a/LeanPool/BrillNoetherGraphs/TreewidthGonality/Treewidth/PartialDecomposition.lean +++ b/LeanPool/BrillNoetherGraphs/TreewidthGonality/Treewidth/PartialDecomposition.lean @@ -51,7 +51,7 @@ supports: `SimpleGraph.Connected.sum_sup_edge` gives connectivity and * `join` — the binary gluing along a common root bag. -/ -@[expose] public section +public section namespace Utilities.Treewidth @@ -97,6 +97,7 @@ variable {U : Finset V} /-- The **width** of a partial decomposition, defined exactly as for `TreeDecomposition`. -/ +@[expose] def width (D : PartialDecomposition H U) : ℕ := (Finset.univ.sup fun t : D.Node => (D.bag t).card) - 1 @@ -109,6 +110,7 @@ theorem card_bag_le_width_succ (D : PartialDecomposition H U) (t : D.Node) : omega /-- A partial decomposition on all of `V` is a tree decomposition. -/ +@[expose] def toTreeDecomposition [Fintype V] (D : PartialDecomposition H Finset.univ) : TreeDecomposition H where Node := D.Node @@ -132,6 +134,7 @@ theorem width_toTreeDecomposition [Fintype V] (D : PartialDecomposition H Finset /-- The **one-bag partial decomposition**: a single node carrying the bag `X`, a decomposition of `H` on `U = X`. -/ +@[expose] def single (H : SimpleGraph V) (X : Finset V) : PartialDecomposition H X where Node := Unit tree := ⊥ @@ -236,6 +239,7 @@ bag `X` at a designated node (`Sum.inl r₁`). `hcap` says the two ground sets meet only inside `X`, and `hsep` says `H` has no edge between `U₁ \ X` and `U₂ \ X`; for the components of `H − X` both hold. -/ +@[expose] def join (D₁ : PartialDecomposition H U₁) (r₁ : D₁.Node) (h₁ : D₁.bag r₁ = X) (D₂ : PartialDecomposition H U₂) (r₂ : D₂.Node) (h₂ : D₂.bag r₂ = X) (hcap : ∀ v, v ∈ U₁ → v ∈ U₂ → v ∈ X) @@ -326,6 +330,7 @@ inside `X ∪ Y` has both ends in `X` or both ends in `Y`. This is the decomposition the paper uses in the branch where `𝔅 ∪ {C}` fails to be a bramble (`X` and `Y := V(C) ∪ N(C)`). -/ +@[expose] def pairDecomp (H : SimpleGraph V) (X Y : Finset V) (hedge : ∀ v ∈ X ∪ Y, ∀ w ∈ X ∪ Y, H.Adj v w → (v ∈ X ∧ w ∈ X) ∨ (v ∈ Y ∧ w ∈ Y)) : diff --git a/LeanPool/BrillNoetherGraphs/TreewidthGonality/Treewidth/Separation.lean b/LeanPool/BrillNoetherGraphs/TreewidthGonality/Treewidth/Separation.lean index 4ebb420ea4..5c86f02b8b 100644 --- a/LeanPool/BrillNoetherGraphs/TreewidthGonality/Treewidth/Separation.lean +++ b/LeanPool/BrillNoetherGraphs/TreewidthGonality/Treewidth/Separation.lean @@ -28,7 +28,7 @@ Three independent ingredients of the Seymour--Thomas induction: time. -/ -@[expose] public section +public section namespace Utilities.Treewidth @@ -96,8 +96,8 @@ theorem separates_of_mem_anc {U : Finset V} (D : PartialDecomposition H U) refine huv.trans (ih (fun z hz => hU z (List.mem_cons_of_mem u hz)) (fun z hz => hT z (List.mem_cons_of_mem u hz))) have hat : a ∉ D.bag t := hcon a p.start_mem_support - have hPa := mono a ha hat na hna h1 - exact h2 ((step a b p hp hcon).mp hPa hnb) + have hPa := mono a ha hat na hna ((mem_below_iff D.isTree s t na).2 h1) + exact h2 ((mem_below_iff D.isTree s t nb).1 ((step a b p hp hcon).mp hPa hnb)) /-! ### Lemma 4 -/ @@ -146,6 +146,7 @@ end Bramble /-- `H` with every vertex of `X` isolated. Its connected components on `V \ X` are the components of `H − X`, but the construction never leaves the type `V`. -/ +@[expose] def awayGraph (H : SimpleGraph V) (X : Finset V) : SimpleGraph V where Adj a b := H.Adj a b ∧ a ∉ X ∧ b ∉ X symm := ⟨fun _ _ h => ⟨h.1.symm, h.2.2, h.2.1⟩⟩ @@ -186,7 +187,7 @@ theorem mem_compOf_self {H : SimpleGraph V} {X R : Finset V} {v : V} (hv : v ∈ (mem_compOf_iff H X R v v).mpr ⟨hv, SimpleGraph.Reachable.refl v⟩ /-- A set of vertices outside `X` closed under `awayGraph`-adjacency. -/ -def IsClosedAway (H : SimpleGraph V) (X R : Finset V) : Prop := +@[expose] def IsClosedAway (H : SimpleGraph V) (X R : Finset V) : Prop := (∀ v ∈ R, v ∉ X) ∧ ∀ a ∈ R, ∀ b, (awayGraph H X).Adj a b → b ∈ R /-- Inside a closed set, `compOf` really is a component. diff --git a/LeanPool/BrillNoetherGraphs/TreewidthGonality/Treewidth/SeymourThomas.lean b/LeanPool/BrillNoetherGraphs/TreewidthGonality/Treewidth/SeymourThomas.lean index 8ad9c6db41..24973fa098 100644 --- a/LeanPool/BrillNoetherGraphs/TreewidthGonality/Treewidth/SeymourThomas.lean +++ b/LeanPool/BrillNoetherGraphs/TreewidthGonality/Treewidth/SeymourThomas.lean @@ -39,7 +39,7 @@ bramble of order `≥ treewidth H + 1` contains a sub-bramble of order exactly strictly cheaper than the easy half of duality. -/ -@[expose] public section +public section namespace Utilities.Treewidth diff --git a/LeanPool/BrillNoetherGraphs/TreewidthGonality/Treewidth/SeymourThomasInduction.lean b/LeanPool/BrillNoetherGraphs/TreewidthGonality/Treewidth/SeymourThomasInduction.lean index 5ad7b95a5a..036e70d183 100644 --- a/LeanPool/BrillNoetherGraphs/TreewidthGonality/Treewidth/SeymourThomasInduction.lean +++ b/LeanPool/BrillNoetherGraphs/TreewidthGonality/Treewidth/SeymourThomasInduction.lean @@ -45,7 +45,7 @@ then falls out (`rerootBag_card_le`). Mathlib has no Menger's theorem, no vertex separators, and no treewidth, so this is what makes the campaign finite. -/ -@[expose] public section +public section namespace Utilities.Treewidth @@ -106,7 +106,7 @@ theorem admissible_join (𝔅 : Bramble H) {k : ℕ} {U₁ U₂ X : Finset V} /-- The empty bramble. Every set covers it, which is what makes the base case of the induction say something. -/ -def empty (H : SimpleGraph V) : Bramble H where +@[expose] def empty (H : SimpleGraph V) : Bramble H where members := ∅ connected_mem := by simp touching := by simp @@ -154,7 +154,7 @@ theorem one_le_order_singletonBramble [Finite V] (H : SimpleGraph V) (v : V) : /-! ### Adding one member -/ /-- Adjoin a connected set touching every member. -/ -def insertMember (𝔅 : Bramble H) (C : Finset V) +@[expose] def insertMember (𝔅 : Bramble H) (C : Finset V) (hC : (H.induce (↑C : Set V)).Connected) (htouch : ∀ B ∈ 𝔅.members, (H.induce (↑(C ∪ B) : Set V)).Connected) : Bramble H where members := insert C 𝔅.members @@ -387,7 +387,7 @@ theorem rerootBag_card_le (𝔅 : Bramble H) /-- **`𝒟_s(H)`**: the same tree, the same `isTree`, only the bags change. This is why the campaign never needs to re-root a tree. -/ -noncomputable def rerootDecomp (hhome : ∀ x ∈ X, x ∈ D.bag (home x)) +@[expose] noncomputable def rerootDecomp (hhome : ∀ x ∈ X, x ∈ D.bag (home x)) (_hsC : ∀ v ∈ D.bag s, v ∉ C) (_hC : IsComponent H X C) : PartialDecomposition H (C ∪ X) where Node := D.Node diff --git a/LeanPool/BrillNoetherGraphs/TreewidthGonality/Treewidth/TreeDecomposition.lean b/LeanPool/BrillNoetherGraphs/TreewidthGonality/Treewidth/TreeDecomposition.lean index ff017ffc83..52845b8f54 100644 --- a/LeanPool/BrillNoetherGraphs/TreewidthGonality/Treewidth/TreeDecomposition.lean +++ b/LeanPool/BrillNoetherGraphs/TreewidthGonality/Treewidth/TreeDecomposition.lean @@ -56,7 +56,7 @@ not change treewidth, so nothing is lost. achievable widths nonempty; `treewidth_le_card_sub_one`. -/ -@[expose] public section +public section namespace Utilities.Treewidth @@ -105,6 +105,7 @@ variable {H : SimpleGraph V} The subtraction is truncated `ℕ` subtraction, which is harmless: `sup (card - 1)` and `sup card - 1` agree in every case, including the degenerate all-bags-empty one. -/ +@[expose] def width (D : TreeDecomposition H) : ℕ := (Finset.univ.sup fun t : D.Node => (D.bag t).card) - 1 @@ -124,6 +125,7 @@ theorem card_bag_le_card [Fintype V] (D : TreeDecomposition H) (t : D.Node) : end TreeDecomposition /-- The set of widths realized by some tree decomposition of `H`. -/ +@[expose] def widthSet (H : SimpleGraph V) : Set ℕ := {w : ℕ | ∃ D : TreeDecomposition H, D.width = w} @@ -132,6 +134,7 @@ def widthSet (H : SimpleGraph V) : Set ℕ := This is an `sInf` over `ℕ`, which is total; `widthSet_nonempty` (via `trivialDecomposition`) is what makes the value meaningful rather than the `sInf ∅ = 0` default. -/ +@[expose] noncomputable def treewidth (H : SimpleGraph V) : ℕ := sInf (widthSet H) diff --git a/LeanPool/BrillNoetherGraphs/TreewidthGonality/Treewidth/TreePath.lean b/LeanPool/BrillNoetherGraphs/TreewidthGonality/Treewidth/TreePath.lean index 948a7c338b..81db79a251 100644 --- a/LeanPool/BrillNoetherGraphs/TreewidthGonality/Treewidth/TreePath.lean +++ b/LeanPool/BrillNoetherGraphs/TreewidthGonality/Treewidth/TreePath.lean @@ -31,7 +31,7 @@ the set of ancestors of `n`, and `Below hT s t = {n | t ∈ Anc hT s n}` is the subtree hanging below `t`. -/ -@[expose] public section +public section namespace Utilities.Treewidth diff --git a/LeanPool/BrillNoetherGraphs/Tricycle.lean b/LeanPool/BrillNoetherGraphs/Tricycle.lean index e399e66a60..5df39a0aca 100644 --- a/LeanPool/BrillNoetherGraphs/Tricycle.lean +++ b/LeanPool/BrillNoetherGraphs/Tricycle.lean @@ -34,4 +34,4 @@ public import LeanPool.BrillNoetherGraphs.Tricycle.Highlights /-! # Tricycle -/ -@[expose] public section +public section diff --git a/LeanPool/BrillNoetherGraphs/Tricycle/Core.lean b/LeanPool/BrillNoetherGraphs/Tricycle/Core.lean index 237cefbd48..4973599fff 100644 --- a/LeanPool/BrillNoetherGraphs/Tricycle/Core.lean +++ b/LeanPool/BrillNoetherGraphs/Tricycle/Core.lean @@ -42,7 +42,7 @@ positive length vector; `σ_k(T_m)` is `length ≡ k`; and a *tricycle graph* is one with `IsTricycle length`, i.e. the three transition slots have length one. -/ -@[expose] public section +public section namespace Utilities.Tricycle @@ -55,6 +55,7 @@ open Utilities.Certificate.SubdivisionGraph /-- The minimal tricycle `T_m` as an ordered core: six spokes, three bananas, three transition slots. -/ +@[expose] def tricycleCore : ExplicitPotential.Core 7 15 where tail := ![0, 0, 0, 0, 0, 0, 1, 1, 3, 3, 5, 5, 2, 4, 6] head := ![1, 2, 3, 4, 5, 6, 2, 2, 4, 4, 6, 6, 3, 5, 1] @@ -69,24 +70,31 @@ theorem tricycleCore_connected : tricycleCore.Connected := by /-! ## Named vertices and slots -/ /-- The central vertex `v₀`. -/ +@[expose] def centre : Fin 7 := 0 /-- The transition vertices `vᵢ⁻`. -/ +@[expose] def vMinus : Fin 3 → Fin 7 := ![1, 3, 5] /-- The transition vertices `vᵢ⁺`. -/ +@[expose] def vPlus : Fin 3 → Fin 7 := ![2, 4, 6] /-- The spoke slot `v₀ — vᵢ⁻`. -/ +@[expose] def spokeMinus : Fin 3 → Fin 15 := ![0, 2, 4] /-- The spoke slot `v₀ — vᵢ⁺`. -/ +@[expose] def spokePlus : Fin 3 → Fin 15 := ![1, 3, 5] /-- The two parallel slots of the cycle `Cᵢ`. -/ +@[expose] def cycleSlot : Fin 3 → Fin 2 → Fin 15 := ![![6, 7], ![8, 9], ![10, 11]] /-- The transition slot leaving `vᵢ⁺`. -/ +@[expose] def transitionSlot : Fin 3 → Fin 15 := ![12, 13, 14] /-- The six spoke slots. -/ @@ -131,6 +139,7 @@ theorem slot_classification (e : Fin 15) : /-- A subdivision `H` of the minimal tricycle, at an arbitrary positive length vector. -/ +@[expose] def tricycleSpec (length : Fin 15 → ℕ) (hpos : ∀ e, 0 < length e) : Spec 7 15 := Spec.ofCore tricycleCore (by omega) tricycleCore_loopless length hpos @@ -153,6 +162,7 @@ theorem tricycleSpec_genus (length : Fin 15 → ℕ) (hpos : ∀ e, 0 < length e /-- **A tricycle graph**: the transition slots are not subdivided. This is the characterisation at line 537 of the source's TeX, not Definition 3.1. -/ +@[expose] def IsTricycle (length : Fin 15 → ℕ) : Prop := ∀ i : Fin 3, length (transitionSlot i) = 1 end Utilities.Tricycle diff --git a/LeanPool/BrillNoetherGraphs/Tricycle/Degree5.lean b/LeanPool/BrillNoetherGraphs/Tricycle/Degree5.lean index 406a1a964d..2dc861acfd 100644 --- a/LeanPool/BrillNoetherGraphs/Tricycle/Degree5.lean +++ b/LeanPool/BrillNoetherGraphs/Tricycle/Degree5.lean @@ -31,7 +31,7 @@ integers, the degree identity is one more, and `linarith` finishes. No `Finset` union, no inclusion–exclusion. -/ -@[expose] public section +public section namespace Utilities.Tricycle @@ -47,11 +47,13 @@ variable {spec : Spec 7 15} /-! ## Aggregates -/ /-- The chips on the closed transition path `i`, from `vᵢ⁺` to `vᵢ₊₁⁻`. -/ +@[expose] def transitionPathChips (spec : Spec 7 15) (D : CFDiv spec.graph) (i : Fin 3) : ℤ := D (spec.coreVertex (vPlus i)) + spec.slotInteriorChips D (transitionSlot i) + D (spec.coreVertex (vMinus (i + 1))) /-- The chips on the cycle `Cᵢ`. -/ +@[expose] def cycleChips (spec : Spec 7 15) (D : CFDiv spec.graph) (i : Fin 3) : ℤ := D (spec.coreVertex (vMinus i)) + D (spec.coreVertex (vPlus i)) + spec.slotInteriorChips D (cycleSlot i 0) + spec.slotInteriorChips D (cycleSlot i 1) diff --git a/LeanPool/BrillNoetherGraphs/Tricycle/Gap.lean b/LeanPool/BrillNoetherGraphs/Tricycle/Gap.lean index 9ba9403c2b..59c7766211 100644 --- a/LeanPool/BrillNoetherGraphs/Tricycle/Gap.lean +++ b/LeanPool/BrillNoetherGraphs/Tricycle/Gap.lean @@ -39,7 +39,7 @@ systems from curves to graphs*, Conjecture 3.14(a) at `r = 1` and `k = 2`: `regularSubdivisionGonality` rather than `metricGonality`. -/ -@[expose] public section +public section namespace Utilities.Tricycle diff --git a/LeanPool/BrillNoetherGraphs/Tricycle/HelperLemma.lean b/LeanPool/BrillNoetherGraphs/Tricycle/HelperLemma.lean index 79c46a9768..124bf89d67 100644 --- a/LeanPool/BrillNoetherGraphs/Tricycle/HelperLemma.lean +++ b/LeanPool/BrillNoetherGraphs/Tricycle/HelperLemma.lean @@ -30,7 +30,7 @@ is *not* burned — pays for all of them at once, giving `|I₀| ≤ D(v₀)`. so the slot has a burned/unburned split and therefore a chip in its interior. -/ -@[expose] public section +public section namespace Utilities.Tricycle @@ -44,9 +44,11 @@ open Utilities.Gonality /-! ## Indexing the six spokes -/ /-- The six spoke slots, indexed by `Fin 6`. -/ +@[expose] def spokeOf : Fin 6 → Fin 15 := ![0, 1, 2, 3, 4, 5] /-- The transition vertex at the far end of spoke `i`. -/ +@[expose] def transitionOf : Fin 6 → Fin 7 := ![1, 2, 3, 4, 5, 6] theorem spokeOf_injective : Function.Injective spokeOf := by decide diff --git a/LeanPool/BrillNoetherGraphs/Tricycle/Highlights.lean b/LeanPool/BrillNoetherGraphs/Tricycle/Highlights.lean index 16a2dc73aa..28d96d696d 100644 --- a/LeanPool/BrillNoetherGraphs/Tricycle/Highlights.lean +++ b/LeanPool/BrillNoetherGraphs/Tricycle/Highlights.lean @@ -32,7 +32,7 @@ Thus a proof for metric gonality alone does not imply the corresponding result for discrete divisorial gonality. -/ -@[expose] public section +public section namespace Tricycle.Highlights diff --git a/LeanPool/BrillNoetherGraphs/Tricycle/RegularSubdivisionBridge.lean b/LeanPool/BrillNoetherGraphs/Tricycle/RegularSubdivisionBridge.lean index b2842f53a9..77a147a293 100644 --- a/LeanPool/BrillNoetherGraphs/Tricycle/RegularSubdivisionBridge.lean +++ b/LeanPool/BrillNoetherGraphs/Tricycle/RegularSubdivisionBridge.lean @@ -33,7 +33,7 @@ The payoff is that the tricycle gap can be stated for `regularSubdivisionGonality : CFGraph → ℕ`, with no `Spec` in the statement. -/ -@[expose] public section +public section namespace Utilities.Certificate.SubdivisionGraph.Spec @@ -47,6 +47,7 @@ variable {n p : ℕ} /-- **The slot correspondence.** The edge multiset of a subdivision, viewed as a type, enumerates the unit steps — compatibly with `unitEdge`. -/ +@[expose] noncomputable def stepEquivEdges (spec : Spec n p) : spec.Step ≃ (spec.graph.edges : Type) := by classical @@ -67,6 +68,7 @@ noncomputable def stepEquivEdges (spec : Spec n p) : variable (spec : Spec n p) (hlen : ∀ e : Fin p, spec.length e = 1) /-- With all lengths one there are no interior vertices. -/ +@[expose] def unitVertexEquiv : Fin n ≃ spec.Vertex where toFun := spec.coreVertex invFun := Sum.elim id fun y => absurd y.2.isLt (by have := hlen y.1; omega) diff --git a/LeanPool/BrillNoetherGraphs/Tricycle/UpperBounds.lean b/LeanPool/BrillNoetherGraphs/Tricycle/UpperBounds.lean index fc1f9b77f8..635621488a 100644 --- a/LeanPool/BrillNoetherGraphs/Tricycle/UpperBounds.lean +++ b/LeanPool/BrillNoetherGraphs/Tricycle/UpperBounds.lean @@ -37,7 +37,7 @@ is a single explicit firing set, checked by `decide`. The firing sets and residual divisors are checked directly by the Lean kernel. -/ -@[expose] public section +public section namespace Utilities.Tricycle @@ -66,9 +66,11 @@ theorem winnable_of_effective_add_prin {G : CFGraph} (D : CFDiv G) /-! ## The two concrete subdivisions -/ /-- The minimal tricycle `T_m` itself. -/ +@[expose] def Tm : Spec 7 15 := tricycleSpec (fun _ => 1) (fun _ => Nat.one_pos) /-- Its `2`-subdivision `σ₂(T_m)`. -/ +@[expose] def Tm2 : Spec 7 15 := tricycleSpec (fun _ => 2) (fun _ => by omega) theorem Tm_connected : graphConnected Tm.graph := diff --git a/LeanPool/BrillNoetherGraphs/TwiceMarkedBananas.lean b/LeanPool/BrillNoetherGraphs/TwiceMarkedBananas.lean index d20c54a4de..820b02ec86 100644 --- a/LeanPool/BrillNoetherGraphs/TwiceMarkedBananas.lean +++ b/LeanPool/BrillNoetherGraphs/TwiceMarkedBananas.lean @@ -53,7 +53,7 @@ restatement of an existing proof. Further paper-specific reference sources are `Bananas/FORMALIZATION_NOTES.md`. -/ -@[expose] public section +public section /-! ## Bridges to the implementation library diff --git a/LeanPool/BrillNoetherGraphs/TwiceMarkedBananas/CoreVocabulary.lean b/LeanPool/BrillNoetherGraphs/TwiceMarkedBananas/CoreVocabulary.lean index a5db675667..3b7e28dcbc 100644 --- a/LeanPool/BrillNoetherGraphs/TwiceMarkedBananas/CoreVocabulary.lean +++ b/LeanPool/BrillNoetherGraphs/TwiceMarkedBananas/CoreVocabulary.lean @@ -14,7 +14,7 @@ Basic graph, divisor, and banana path data used by the paper-facing statements. These declarations keep their independent `TMB` meanings and storage conventions. -/ -@[expose] public section +public section /-! ## Standalone mathematical vocabulary @@ -59,19 +59,23 @@ attribute [instance] CFGraph.instDecidableEq CFGraph.instFintype CFGraph.instNonempty /-- Number of edge occurrences joining two vertices. -/ +@[expose] def numEdges (G : CFGraph) (x y : G.V) : ℕ := Multiset.card (G.edges.filter fun e => e = (x, y) ∨ e = (y, x)) /-- Connectivity in cut form. -/ +@[expose] def graphConnected (G : CFGraph) : Prop := ∀ S : Finset G.V, (∃ x y : G.V, x ∈ S ∧ y ∉ S) → ∃ x ∈ S, ∃ y ∉ S, numEdges G x y > 0 /-- Cyclomatic genus `|E| - |V| + 1`. -/ +@[expose] def genus (G : CFGraph) : ℤ := Multiset.card G.edges - Fintype.card G.V + 1 /-- Valence of a vertex. -/ +@[expose] def vertexDegree (G : CFGraph) (x : G.V) : ℤ := ∑ y : G.V, (numEdges G x y : ℤ) @@ -79,30 +83,37 @@ def vertexDegree (G : CFGraph) (x : G.V) : ℤ := abbrev CFDiv (G : CFGraph) := G.V → ℤ /-- One chip at `x`. -/ +@[expose] def oneChip {G : CFGraph} (x : G.V) : CFDiv G := fun y => if y = x then 1 else 0 /-- Edges leaving `x` towards the complement of `S`, with multiplicity. -/ +@[expose] def outdegreeSet (G : CFGraph) (S : Finset G.V) (x : G.V) : ℤ := ∑ y ∈ (univ \ S), (numEdges G x y : ℤ) /-- The principal divisor obtained by firing `x` once. -/ +@[expose] def firingVector (G : CFGraph) (x : G.V) : CFDiv G := fun y => if y = x then -vertexDegree G x else numEdges G x y /-- The subgroup generated by vertex firings. -/ +@[expose] def principalDivisors (G : CFGraph) : AddSubgroup (CFDiv G) := AddSubgroup.closure (Set.range (firingVector G)) /-- Linear equivalence of divisors. -/ +@[expose] def linearEquiv (G : CFGraph) (D E : CFDiv G) : Prop := E - D ∈ principalDivisors G /-- An effective divisor has nonnegative coefficients. -/ +@[expose] def effective {G : CFGraph} (D : CFDiv G) : Prop := ∀ x : G.V, D x ≥ 0 /-- Effective divisors as an additive submonoid. -/ +@[expose] def Eff (G : CFGraph) : AddSubmonoid (CFDiv G) where carrier := {D : CFDiv G | effective D} zero_mem' := by @@ -113,10 +124,12 @@ def Eff (G : CFGraph) : AddSubmonoid (CFDiv G) where exact add_nonneg (hD x) (hE x) /-- A divisor is winnable if its class has an effective representative. -/ +@[expose] def winnable (G : CFGraph) (D : CFDiv G) : Prop := ∃ E ∈ Eff G, linearEquiv G D E /-- Divisor degree. The short proofs certify that summation is additive. -/ +@[expose] def deg {G : CFGraph} : CFDiv G →+ ℤ where toFun D := ∑ x, D x map_zero' := by @@ -126,36 +139,44 @@ def deg {G : CFGraph} : CFDiv G →+ ℤ where simp only [Pi.add_apply, Finset.sum_add_distrib] /-- Effective divisors of a prescribed degree. -/ +@[expose] def effOfDegree (G : CFGraph) (d : ℤ) : Set (CFDiv G) := {E | effective E ∧ deg E = d} /-- Baker--Norine rank at least `r`, in subtraction-test form. -/ +@[expose] def rankGeq (G : CFGraph) (D : CFDiv G) (r : ℤ) : Prop := ∀ E ∈ effOfDegree G r, winnable G (D - E) /-- Exact rank as adjacent lower-bound tests. -/ +@[expose] def rankEq (G : CFGraph) (D : CFDiv G) (r : ℤ) : Prop := rankGeq G D r ∧ ¬ rankGeq G D (r + 1) open Classical in /-- The unique exact rank when it exists, and `-1` as a fallback. -/ +@[expose] noncomputable def rank (G : CFGraph) (D : CFDiv G) : ℤ := if h : ∃ r, rankEq G D r then Classical.choose h else -1 /-- The canonical divisor `K(x) = val(x) - 2`. -/ +@[expose] def canonicalDivisor (G : CFGraph) : CFDiv G := fun x => vertexDegree G x - 2 /-- Effective away from `q`. -/ +@[expose] def qEffective {G : CFGraph} (q : G.V) (D : CFDiv G) : Prop := ∀ x : G.V, x ≠ q → D x ≥ 0 /-- Firing `S` keeps every vertex of `S` out of debt. -/ +@[expose] def legalSet (G : CFGraph) (D : CFDiv G) (S : Finset G.V) : Prop := ∀ x ∈ S, outdegreeSet G S x ≤ D x /-- A `q`-reduced divisor: effective away from `q`, and no nonempty set avoiding `q` can be fired legally. -/ +@[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 @@ -163,14 +184,17 @@ def qReduced (G : CFGraph) (q : G.V) (D : CFDiv G) : Prop := /-! ### Brill--Noether parameters -/ /-- The width `g - d + r` of the Brill--Noether rectangle. -/ +@[expose] def rectangleWidth (G : CFGraph) (r d : ℤ) : ℤ := genus G - d + r /-- The Brill--Noether number. -/ +@[expose] def bnNumber (G : CFGraph) (r d : ℤ) : ℤ := genus G - (r + 1) * rectangleWidth G r d /-- Existence of a degree-`d` divisor of rank at least `r`. -/ +@[expose] def BNExists (G : CFGraph) (r d : ℤ) : Prop := ∃ D : CFDiv G, deg D = d ∧ rank G D ≥ r @@ -185,16 +209,19 @@ structure CFGraphIso (G : CFGraph.{u}) (H : CFGraph.{v}) where numEdges H (vertexEquiv x) (vertexEquiv y) = numEdges G x y /-- Push a divisor forward along a graph isomorphism. -/ +@[expose] def CFGraphIso.mapDiv {G : CFGraph.{u}} {H : CFGraph.{v}} (φ : CFGraphIso G H) (D : CFDiv G) : CFDiv H := fun y => D (φ.vertexEquiv.symm y) /-- Embed a right-factor vertex into a vertex wedge. -/ +@[expose] def wedgeRightVertex (G : CFGraph.{u}) (H : CFGraph.{v}) (x : G.V) (y : H.V) : H.V → Sum G.V {b : H.V // b ≠ y} := fun b => if h : b = y then Sum.inl x else Sum.inr ⟨b, h⟩ /-- Identify `x` and `y` in the disjoint union of two graphs. -/ +@[expose] def vertexWedge (G : CFGraph.{u}) (H : CFGraph.{v}) (x : G.V) (y : H.V) : CFGraph.{max u v} where V := Sum G.V {b : H.V // b ≠ y} @@ -260,6 +287,7 @@ abbrev wedge (M N : MarkedGraph) : MarkedGraph where right := wedgeRightVertex M.graph N.graph M.right N.left N.right /-- Left-associated iterated vertex gluing. -/ +@[expose] def chain (M : MarkedGraph) : List MarkedGraph → MarkedGraph | [] => M | N :: rest => chain (M.wedge N) rest @@ -267,10 +295,12 @@ def chain (M : MarkedGraph) : List MarkedGraph → MarkedGraph end MarkedGraph /-- Total multiplicity of the edges leaving `S`. -/ +@[expose] def cutMultiplicity (G : CFGraph) (S : Finset G.V) : ℤ := ∑ x ∈ S, outdegreeSet G S x /-- Every nonempty proper cut has at least two crossing edges. -/ +@[expose] def TwoEdgeCutCondition (G : CFGraph) : Prop := ∀ S : Finset G.V, S.Nonempty → S ≠ Finset.univ → 2 ≤ cutMultiplicity G S @@ -318,24 +348,29 @@ abbrev Step := Σ α : Fin (g + 1), Fin (B.length α) abbrev PathPosition (α : Fin (g + 1)) := Fin (B.length α + 1) /-- A multivalent vertex. -/ +@[expose] def coreVertex (i : Fin 2) : B.Vertex := Sum.inl i /-- An interior vertex. -/ +@[expose] def interiorVertex (α : Fin (g + 1)) (offset : Fin (B.length α - 1)) : B.Vertex := Sum.inr ⟨α, offset⟩ /-- The left endpoint of a unit step. -/ +@[expose] def stepLeft (α : Fin (g + 1)) (offset : Fin (B.length α)) : B.Vertex := if hzero : offset.val = 0 then B.coreVertex (B.tail α) else B.interiorVertex α ⟨offset.val - 1, by have := offset.isLt; omega⟩ /-- The right endpoint of a unit step. -/ +@[expose] def stepRight (α : Fin (g + 1)) (offset : Fin (B.length α)) : B.Vertex := if hlast : offset.val + 1 = B.length α then B.coreVertex (B.head α) else B.interiorVertex α ⟨offset.val, by have := offset.isLt; omega⟩ /-- The ordered pair emitted by one unit step. -/ +@[expose] def unitEdge (step : B.Step) : B.Vertex × B.Vertex := (B.stepLeft step.1 step.2, B.stepRight step.1 step.2) diff --git a/LeanPool/BrillNoetherGraphs/TwiceMarkedBananas/StatementVocabulary.lean b/LeanPool/BrillNoetherGraphs/TwiceMarkedBananas/StatementVocabulary.lean index aa48060d6b..41acada88d 100644 --- a/LeanPool/BrillNoetherGraphs/TwiceMarkedBananas/StatementVocabulary.lean +++ b/LeanPool/BrillNoetherGraphs/TwiceMarkedBananas/StatementVocabulary.lean @@ -14,7 +14,7 @@ Marked divisors, transmission permutations, exceptional configurations, and finite counting expressions used by the paper-facing theorem statements. -/ -@[expose] public section +public section namespace TMB @@ -27,6 +27,7 @@ namespace Banana variable {g : ℕ} (B : Banana g) /-- Replace every labelled strand by a path of its specified length. -/ +@[expose] def graph : CFGraph where V := B.Vertex instNonempty := ⟨B.coreVertex 0⟩ @@ -40,12 +41,14 @@ def graph : CFGraph where /-- The vertex at a path position along a strand, measured from the strand's tail. -/ +@[expose] def pathVertex (α : Fin (g + 1)) (i : B.PathPosition α) : B.Vertex := if hzero : i.val = 0 then B.coreVertex (B.tail α) else if hlast : i.val = B.length α then B.coreVertex (B.head α) else B.interiorVertex α ⟨i.val - 1, by have := i.isLt; omega⟩ /-- Interior positions exclude the two shared endpoints. -/ +@[expose] def IsInteriorPosition (α : Fin (g + 1)) (i : B.PathPosition α) : Prop := 0 < i.val ∧ i.val < B.length α @@ -64,6 +67,7 @@ def bananaOfLengths (g : ℕ) (length : Fin (g + 1) → ℕ) /-- The vertex `v_{α,i}` at normalized position `i` along strand `α`, measured from multivalent vertex `0`; the stored orientation of the strand is reversed when necessary. -/ +@[expose] def strandVertex {g : ℕ} (B : Banana g) (α : Fin (g + 1)) (i : B.PathPosition α) : B.graph.V := B.pathVertex α @@ -71,18 +75,22 @@ def strandVertex {g : ℕ} (B : Banana g) (α : Fin (g + 1)) ⟨B.length α - i.val, by have := i.isLt; omega⟩) /-- Reflection of a strand coordinate. -/ +@[expose] def strandMirror {g : ℕ} (B : Banana g) (α : Fin (g + 1)) (i : B.PathPosition α) : B.PathPosition α := ⟨B.length α - i.val, by have := i.isLt; omega⟩ /-- The two multivalent vertices. -/ +@[expose] def leftEndpoint {g : ℕ} (B : Banana g) : B.graph.V := B.coreVertex 0 /-- The multivalent banana endpoint corresponding to core pole 1. -/ +@[expose] def rightEndpoint {g : ℕ} (B : Banana g) : B.graph.V := B.coreVertex 1 namespace TwoPathCycle /-- A two-path cycle is the genus-one banana with the prescribed lengths. -/ +@[expose] def spec (length : Fin 2 → ℕ) (hLength : ∀ edge, 0 < length edge) : Banana 1 where tail := fun _ => 0 @@ -109,33 +117,40 @@ structure TwiceMarked where abbrev mark (G : CFGraph) (u v : G.V) : TwiceMarked := ⟨G, u, v⟩ /-- The marked second difference of divisor rank. -/ +@[expose] noncomputable def rankDelta (M : TwiceMarked) (D : CFDiv M.graph) : ℤ := rank M.graph D - rank M.graph (D - oneChip M.u) - rank M.graph (D - oneChip M.v) + rank M.graph (D - oneChip M.u - oneChip M.v) /-- A two-point twist of a divisor. -/ +@[expose] def twist (M : TwiceMarked) (D : CFDiv M.graph) (a b : ℤ) : CFDiv M.graph := D + a • oneChip M.u + b • oneChip M.v /-- Submodularity of every marked twist. -/ +@[expose] def Submodular (M : TwiceMarked) (D : CFDiv M.graph) : Prop := ∀ a b : ℤ, 0 ≤ rankDelta M (twist M D a b) /-- Every divisor is submodular. -/ +@[expose] def AllSubmodular (M : TwiceMarked) : Prop := ∀ D : CFDiv M.graph, Submodular M D /-- A positive multiple killing the marked difference. -/ +@[expose] def TorsionWitness (M : TwiceMarked) (k : ℕ) : Prop := 0 < k ∧ linearEquiv M.graph ((k : ℤ) • (oneChip M.u - oneChip M.v)) 0 /-- The least positive torsion witness. -/ +@[expose] def IsTorsionOrder (M : TwiceMarked) (k : ℕ) : Prop := TorsionWitness M k ∧ ∀ m : ℕ, TorsionWitness M m → k ≤ m /-- Rank-difference characterization of a transmission permutation. -/ +@[expose] def IsTransmissionPermutation (M : TwiceMarked) (D : CFDiv M.graph) (τ : ℤ → ℤ) : Prop := Function.Bijective τ ∧ ∀ a b : ℤ, @@ -143,18 +158,22 @@ def IsTransmissionPermutation (M : TwiceMarked) (D : CFDiv M.graph) rankDelta M (D + a • oneChip M.u - b • oneChip M.v) /-- Period-`k` affine permutations. -/ +@[expose] def IsKAffine (k : ℕ) (τ : ℤ → ℤ) : Prop := ∀ n : ℤ, τ (n + k) = τ n + k /-- Fundamental-domain representatives of affine inversions. -/ +@[expose] def kInversions (k : ℕ) (τ : ℤ → ℤ) : Set (ℤ × ℤ) := { p | p.1 < p.2 ∧ τ p.1 > τ p.2 ∧ 0 ≤ p.1 ∧ p.1 < k } /-- Number of affine inversions. -/ +@[expose] noncomputable def kInversionCount (k : ℕ) (τ : ℤ → ℤ) : ℕ := (kInversions k τ).ncard /-- `k`-general transmission. -/ +@[expose] def KGeneralTransmission (M : TwiceMarked) (k : ℕ) : Prop := TorsionWitness M k ∧ AllSubmodular M ∧ ∀ D : CFDiv M.graph, ∃ τ : ℤ → ℤ, @@ -163,10 +182,12 @@ def KGeneralTransmission (M : TwiceMarked) (k : ℕ) : Prop := kInversionCount k τ ≤ Int.toNat (genus M.graph) /-- Brill--Noether generality in the nonexistence direction. -/ +@[expose] def BrillNoetherGeneral (G : CFGraph) : Prop := ∀ r d : ℤ, 0 ≤ r → BNExists G r d → 0 ≤ bnNumber G r d /-- The exceptional same-strand position set from Theorem 3.4. -/ +@[expose] def thetaExceptionalPositions {g : ℕ} (B : Banana g) (α : Fin (g + 1)) (i j : B.PathPosition α) : Set (B.PathPosition α) := { q | (q.val : ℤ) ≠ (B.length α : ℤ) - (i.val : ℤ) ∧ @@ -175,6 +196,7 @@ def thetaExceptionalPositions {g : ℕ} (B : Banana g) (α : Fin (g + 1)) (q.val : ℤ) ≤ (j.val : ℤ) - (i.val : ℤ) + (B.length α : ℤ) } /-- Even marking on two distinct theta strands, by cross multiplication. -/ +@[expose] def EvenlyMarkedTheta (B : Banana 2) (α β : Fin 3) (i : B.PathPosition α) (j : B.PathPosition β) : Prop := α ≠ β ∧ 0 < i.val ∧ i.val < B.length α ∧ 0 < j.val ∧ j.val < B.length β ∧ @@ -193,6 +215,7 @@ structure KGeneralChainFactor where (mark marked.graph marked.left marked.right) period /-- Prefix-genus period inequalities. -/ +@[expose] def ChainPrefixBudget : ℤ → List KGeneralChainFactor → Prop | _, [] => True | g, F :: rest => @@ -200,10 +223,12 @@ def ChainPrefixBudget : ℤ → List KGeneralChainFactor → Prop ChainPrefixBudget (g + genus F.marked.graph) rest /-- Total genus of a list of chain factors. -/ +@[expose] def chainFactorGenus (L : List KGeneralChainFactor) : ℤ := (L.map fun F => genus F.marked.graph).sum /-- Sharp two-sided torsion budget for a chain. -/ +@[expose] def ChainMinBudget (L : List KGeneralChainFactor) : Prop := ∀ (i : ℕ) (hi : i < L.length), min (chainFactorGenus (L.take (i + 1))) @@ -213,20 +238,24 @@ def ChainMinBudget (L : List KGeneralChainFactor) : Prop := /-! ### Weierstrass partitions and the once-marked census -/ /-- Twists at the marked point having rank at least `i`. -/ +@[expose] def poleOrderSet (G : CFGraph) (v : G.V) (D : CFDiv G) (i : ℕ) : Set ℤ := {ell | (i : ℤ) ≤ rank G (D + ell • oneChip v)} /-- Pole order `s_i(D, v)`: the least twist of rank at least `i`. -/ +@[expose] noncomputable def poleOrder (G : CFGraph) (v : G.V) (D : CFDiv G) (i : ℕ) : ℤ := sInf (poleOrderSet G v D i) /-- The `i`th Weierstrass part `i + g - deg D - s_i(D, v)`, over `ℤ`. -/ +@[expose] noncomputable def weierstrassPartInt (G : CFGraph) (v : G.V) (D : CFDiv G) (i : ℕ) : ℤ := (i : ℤ) + genus G - deg D - poleOrder G v D i /-- The `i`th Weierstrass part as a natural number. -/ +@[expose] noncomputable def weierstrassPart (G : CFGraph) (v : G.V) (D : CFDiv G) (i : ℕ) : ℕ := (weierstrassPartInt G v D i).toNat @@ -234,17 +263,20 @@ noncomputable def weierstrassPart (G : CFGraph) (v : G.V) (D : CFDiv G) /-- Size `|λ(D, v)|` of the Weierstrass partition: the sum of its parts. On a connected graph only the first `g` parts can be nonzero, so the sum is taken over those. -/ +@[expose] noncomputable def weierstrassSize {G : CFGraph} (_hconn : graphConnected G) (v : G.V) (D : CFDiv G) : ℕ := ∑ i ∈ Finset.range (genus G).toNat, weierstrassPart G v D i /-- The `i`th part of a Young diagram, extended by zero. -/ +@[expose] def onceMarkedPart (lambda : YoungDiagram) (i : ℕ) : ℕ := lambda.rowLens.getD i 0 /-- Membership of a partition in the divisor census of a once-marked graph: some divisor has `λ_i(D, v) ≥ λ_i` for every `i`, written as the rank test `r(D + (i + g - deg D - λ_i) v) ≥ i`. -/ +@[expose] def OnceMarkedCensusContains (G : CFGraph) (v : G.V) (lambda : YoungDiagram) : Prop := ∃ D : CFDiv G, @@ -255,6 +287,7 @@ def OnceMarkedCensusContains (G : CFGraph) (v : G.V) /-- Once-marked Brill--Noether generality: every partition in the divisor census has size at most the genus. -/ +@[expose] def OnceMarkedBrillNoetherGeneral (G : CFGraph) (v : G.V) : Prop := ∀ lambda : YoungDiagram, OnceMarkedCensusContains G v lambda → (lambda.card : ℤ) ≤ genus G @@ -262,68 +295,81 @@ def OnceMarkedBrillNoetherGeneral (G : CFGraph) (v : G.V) : Prop := /-! ### Support complexes and rank determining sets -/ /-- Support on which deleting one chip leaves nonnegative rank. -/ +@[expose] def rankSupport (G : CFGraph) (D : CFDiv G) : Set G.V := {x | 0 ≤ rank G (D - oneChip x)} /-- A divisor is supported on `A`. -/ +@[expose] def DivisorSupportedOn {G : CFGraph} (A : Set G.V) (E : CFDiv G) : Prop := ∀ x, E x ≠ 0 → x ∈ A /-- Restricted rank lower bound. -/ +@[expose] def restrictedRankGeq (G : CFGraph) (A : Set G.V) (D : CFDiv G) (r : ℤ) : Prop := ∀ E : CFDiv G, effective E → deg E = r → DivisorSupportedOn A E → winnable G (D - E) /-- A set tests every divisor-rank lower bound. -/ +@[expose] def RankDetermining (G : CFGraph) (A : Set G.V) : Prop := ∀ (D : CFDiv G) (r : ℤ), restrictedRankGeq G A D r ↔ rankGeq G D r /-! ### Banana normal forms and exceptional families -/ /-- A semibreak divisor has at most one chosen interior chip per strand. -/ +@[expose] def semibreakDivisor {g : ℕ} (B : Banana g) (chips : ∀ α : Fin (g + 1), Option (Fin (B.length α - 1))) : CFDiv B.graph | Sum.inl _ => 0 | Sum.inr ⟨α, offset⟩ => if chips α = some offset then 1 else 0 /-- Membership in the semibreak family. -/ +@[expose] def IsSemibreak {g : ℕ} (B : Banana g) (E : CFDiv B.graph) : Prop := ∃ chips : ∀ α : Fin (g + 1), Option (Fin (B.length α - 1)), E = semibreakDivisor B chips /-- Endpoint/semibreak normal form. -/ +@[expose] def bananaNormalForm {g : ℕ} (B : Banana g) (a b : ℤ) (E : CFDiv B.graph) : CFDiv B.graph := a • oneChip (leftEndpoint B) + b • oneChip (rightEndpoint B) + E /-- The endpoint hyperelliptic pencil. -/ +@[expose] def endpointPencilDivisor {g : ℕ} (B : Banana g) : CFDiv B.graph := oneChip (leftEndpoint B) + oneChip (rightEndpoint B) /-- A position at distance at least two from both endpoints. -/ +@[expose] def FarFromBananaEndpoints {g : ℕ} (B : Banana g) (α : Fin (g + 1)) (i : B.PathPosition α) : Prop := 2 ≤ i.val ∧ i.val + 2 ≤ B.length α /-- Corrected exceptional family for Theorem 1.16. -/ +@[expose] def CorrectedBananaSimpleException {g : ℕ} (B : Banana g) (α β : Fin (g + 1)) (i : B.PathPosition α) (j : B.PathPosition β) : Prop := (α ≠ β ∧ B.length β = 2 ∧ j.val = 1) ∨ (α ≠ β ∧ B.length α = 2 ∧ i.val = 1) /-- Corrected midpoint exception in high genus. -/ +@[expose] def CorrectedMidpointException {g : ℕ} (B : Banana g) (α β : Fin (g + 1)) (i : B.PathPosition α) (j : B.PathPosition β) : Prop := α ≠ β ∧ 2 * i.val = B.length α ∧ 2 * j.val = B.length β ∧ (B.length α = 2 ∨ B.length β = 2) /-- A vertex lies on a normalized banana strand. -/ +@[expose] def VertexOnBananaStrand {g : ℕ} (B : Banana g) (α : Fin (g + 1)) (x : B.graph.V) : Prop := ∃ i : B.PathPosition α, x = strandVertex B α i /-- Three vertices lie on one common strand. -/ +@[expose] def VerticesOnCommonBananaStrand {g : ℕ} (B : Banana g) (x y z : B.graph.V) : Prop := ∃ α : Fin (g + 1), @@ -333,6 +379,7 @@ def VerticesOnCommonBananaStrand {g : ℕ} (B : Banana g) /-- The corrected cross-strand exceptional coordinates of Theorem 3.9 for two strictly interior marks. -/ +@[expose] def NSMForBananaInteriorException {g : ℕ} (B : Banana g) (α β : Fin (g + 1)) (i : B.PathPosition α) (j : B.PathPosition β) : Prop := α ≠ β ∧ @@ -342,6 +389,7 @@ def NSMForBananaInteriorException {g : ℕ} (B : Banana g) (B.length β = 2 ∧ j.val = 1)) /-- Endpoint-safe exceptional alternatives in corrected Theorem 3.9. -/ +@[expose] def NSMForBananaException {g : ℕ} (B : Banana g) (u v : B.graph.V) : Prop := (u = leftEndpoint B ∧ v = rightEndpoint B) ∨ (u = rightEndpoint B ∧ v = leftEndpoint B) ∨ @@ -356,6 +404,7 @@ def NSMForBananaException {g : ℕ} (B : Banana g) (u v : B.graph.V) : Prop := NSMForBananaInteriorException B α β i j) /-- Coordinate alternatives for all-submodular theta markings. -/ +@[expose] def ThetaAllSubmodularCoordinates (B : Banana 2) (α β : Fin 3) (i : B.PathPosition α) (j : B.PathPosition β) : Prop := @@ -372,12 +421,14 @@ def ThetaAllSubmodularCoordinates strandVertex B β j = strandVertex B γ p)) /-- The four exceptional transmission rows in genus two. -/ +@[expose] def ThetaTransmissionSubTwoCase (B : Banana 2) (u : B.graph.V) (X : CFDiv B.graph) : Prop := linearEquiv B.graph X (2 • oneChip u) /-- The theta-graph case where `X` is equivalent to a chip at `u` plus a chip at some `w`, and the degree-zero differences from `w` to either mark are nonprincipal. -/ +@[expose] def ThetaTransmissionSubOneCase (B : Banana 2) (u v : B.graph.V) (X : CFDiv B.graph) : Prop := ∃ w : B.graph.V, @@ -387,6 +438,7 @@ def ThetaTransmissionSubOneCase /-- The theta-graph case where `X` is equivalent to a chip at `v` plus a chip at `w`, and neither marked two-chip divisor with `w` is canonical. -/ +@[expose] def ThetaTransmissionAddOneCase (B : Banana 2) (u v : B.graph.V) (X : CFDiv B.graph) : Prop := ∃ w : B.graph.V, @@ -398,12 +450,14 @@ def ThetaTransmissionAddOneCase /-- The theta-graph case where `X` is equivalent to the canonical divisor shifted by a chip from `u` to `v`. -/ +@[expose] def ThetaTransmissionAddTwoCase (B : Banana 2) (u v : B.graph.V) (X : CFDiv B.graph) : Prop := linearEquiv B.graph X (canonicalDivisor B.graph - oneChip u + oneChip v) /-- Concrete finite-residue nonrecurrence. -/ +@[expose] def NonRecurrent (M : TwiceMarked) (k : ℕ) : Prop := ∀ (w : M.graph.V) (n m : Fin k), n.val ≠ 0 → m.val ≠ 0 → 0 ≤ rank M.graph @@ -413,6 +467,7 @@ def NonRecurrent (M : TwiceMarked) (k : ℕ) : Prop := n = m /-- The three coordinate families in the theta branch of Theorem 4.13. -/ +@[expose] def ThetaKGeneralCoordinates {k : ℕ} (B : Banana 2) (alpha beta : Fin 3) (i : B.PathPosition alpha) (j : B.PathPosition beta) : Prop := @@ -439,6 +494,7 @@ def ThetaKGeneralCoordinates /-- The six ordered placements that can have general transmission on a rigid wedge of two genus-one factors. -/ +@[expose] def WedgeKGeneralPlacement (G H : CFGraph) (x : G.V) (y : H.V) (u v : (vertexWedge G H x y).V) (k : ℕ) : Prop := @@ -462,6 +518,7 @@ def WedgeKGeneralPlacement IsTorsionOrder (mark H y p) r ∧ k = r) /-- The isomorphism-invariant theta-or-wedge classification in genus two. -/ +@[expose] def BridgelessGenusTwoKGeneralCharacterization (G : CFGraph.{0}) (u v : G.V) (k : ℕ) : Prop := (∃ (B : Banana 2) (φ : CFGraphIso G B.graph) @@ -480,6 +537,7 @@ def BridgelessGenusTwoKGeneralCharacterization /-- Pairwise disjointness of the canonical marked supports at the nonzero torsion residues. -/ +@[expose] def CanonicalMarkedSupportsPairwiseDisjoint (M : TwiceMarked) (k : ℕ) : Prop := ∀ n m : Fin k, n.val ≠ 0 → m.val ≠ 0 → n ≠ m → Disjoint @@ -489,17 +547,20 @@ def CanonicalMarkedSupportsPairwiseDisjoint (M : TwiceMarked) (k : ℕ) : Prop : (canonicalDivisor M.graph - (m.val : ℤ) • (oneChip M.u - oneChip M.v))) /-- Degree-`d` representative at a marked-difference index. -/ +@[expose] noncomputable def degreeTwistInt (M : TwiceMarked) (D : CFDiv M.graph) (d b : ℤ) : CFDiv M.graph := D + (d - deg D + b) • oneChip M.u - b • oneChip M.v /-- Effective degree-one torsion residues. -/ +@[expose] def effectiveDegreeOneTwistResidues (M : TwiceMarked) (D : CFDiv M.graph) (k : ℕ) : Set (Fin k) := {b | 0 ≤ rank M.graph (degreeTwistInt M D 1 b.val)} open Classical in /-- Correction term in Lemma 4.10. -/ +@[expose] noncomputable def invTauCorrection (M : TwiceMarked) (D : CFDiv M.graph) : ℤ := if (∃ b : ℤ, linearEquiv M.graph (degreeTwistInt M D 0 b) 0) ∧ linearEquiv M.graph (oneChip M.u + oneChip M.v) @@ -507,34 +568,42 @@ noncomputable def invTauCorrection (M : TwiceMarked) (D : CFDiv M.graph) : ℤ : then 1 else 0 /-- Southeast and northwest quadrant index sets. -/ +@[expose] def southeastSet (τ : ℤ → ℤ) (m n : ℤ) : Set ℤ := { k : ℤ | n ≤ k ∧ τ k < m } /-- The northwest quadrant of an integer function at thresholds `(m, n)`: indices below `n` whose image is at least `m`. -/ +@[expose] def northwestSet (τ : ℤ → ℤ) (m n : ℤ) : Set ℤ := { k : ℤ | k < n ∧ m ≤ τ k } /-- Set-theoretic inverse of an integer function. -/ +@[expose] noncomputable def rawInverse (τ : ℤ → ℤ) : ℤ → ℤ := Function.invFun τ /-- Conjugation by negation. -/ +@[expose] def rawAffineReflection (τ : ℤ → ℤ) : ℤ → ℤ := fun n => -τ (-n) /-- Reflected inverse used when swapping marks. -/ +@[expose] noncomputable def swapTransmissionPermutation (τ : ℤ → ℤ) : ℤ → ℤ := rawAffineReflection (rawInverse τ) /-- Riemann--Roch dual divisor with both marks restored. -/ +@[expose] def transmissionDualDivisor {G : CFGraph} (u v : G.V) (D : CFDiv G) : CFDiv G := canonicalDivisor G - D + oneChip u + oneChip v /-- Sign-changing inversions and their number. -/ +@[expose] def sciSet (τ : ℤ → ℤ) : Set (ℤ × ℤ) := { p | p.1 < p.2 ∧ 0 < τ p.1 ∧ τ p.2 ≤ 0 } /-- The natural cardinality of inversion pairs crossing zero in the images: the earlier image is positive and the later image is nonpositive. -/ +@[expose] noncomputable def sci (τ : ℤ → ℤ) : ℕ := (sciSet τ).ncard /-- Mark-preserving and mark-swapping graph automorphisms. -/ @@ -552,6 +621,7 @@ structure MarkedPointSwap (M : TwiceMarked) extends MarkedPointAutomorphism M wh map_v : toMarkedPointAutomorphism.iso.vertexEquiv M.v = M.u /-- Finite rank-drop sum from Section 5. -/ +@[expose] noncomputable def sectionFiveRankDropSum (M : TwiceMarked) (D : CFDiv M.graph) (k : ℕ) : ℤ := ∑ m : Fin k, @@ -563,21 +633,25 @@ noncomputable def sectionFiveRankDropSum ((m : ℕ) : ℤ) • oneChip M.v)) /-- A transmission permutation with a specified inversion lower bound. -/ +@[expose] def HasInversionLowerBound (M : TwiceMarked) (k q : ℕ) : Prop := ∃ D : CFDiv M.graph, ∃ τ : ℤ → ℤ, IsTransmissionPermutation M D τ ∧ IsKAffine k τ ∧ (kInversions k τ).Finite ∧ q ≤ kInversionCount k τ /-- Arithmetic functions used by the one-off and cross-one-off blocks. -/ +@[expose] def crossOneOffCutoff (g n : ℕ) : ℕ := g + g / (n - 1) /-- The cross one-off length condition requiring `n₀` to be at least `g + 1 + g / (n₁ - 1)`, with natural-number division. -/ +@[expose] def CrossOneOffLongEnough (g n₀ n₁ : ℕ) : Prop := g + 1 + g / (n₁ - 1) ≤ n₀ /-- The one-off row value at index `b`, computed separately for residues zero, `n - 1`, and all remaining residues modulo `n`. -/ +@[expose] def oneOffRow (g n b : ℕ) : ℕ := if b % n = 0 then b / n else if b % n = n - 1 then g + b / n + 1 @@ -585,6 +659,7 @@ def oneOffRow (g n b : ℕ) : ℕ := /-- The cross one-off row value at index `b`, with its extra unit in the zero-residue and interior-residue cases. -/ +@[expose] def crossOneOffRow (g n b : ℕ) : ℕ := if b % n = 0 then b / n + 1 else if b % n = n - 1 then g + b / n + 1 @@ -592,6 +667,7 @@ def crossOneOffRow (g n b : ℕ) : ℕ := /-- The corrected forced-count formula: `choose g 2` at period two, and `choose (g - 1) 2 + g / (n - 1)` otherwise. -/ +@[expose] def correctedCrossOneOffForcedCount (g n : ℕ) : ℕ := if n = 2 then Nat.choose g 2 else Nat.choose (g - 1) 2 + g / (n - 1) diff --git a/LeanPool/BrillNoetherGraphs/Utilities.lean b/LeanPool/BrillNoetherGraphs/Utilities.lean index 52c40dbb79..86f6ad8caf 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities.lean @@ -200,4 +200,4 @@ public import LeanPool.BrillNoetherGraphs.Utilities.Transmission.TransmissionWed /-! # Utilities -/ -@[expose] public section +public section diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Certificate.lean b/LeanPool/BrillNoetherGraphs/Utilities/Certificate.lean index b0103812f9..116153257c 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Certificate.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Certificate.lean @@ -11,4 +11,4 @@ public import LeanPool.BrillNoetherGraphs.Utilities.Certificate.CubicMatrixRepla /-! Supporting modules for Brill–Noether theory and gonality of finite graphs. -/ -@[expose] public section +public section diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Certificate/CubicMatrixCanonical.lean b/LeanPool/BrillNoetherGraphs/Utilities/Certificate/CubicMatrixCanonical.lean index 71dc2a2581..e085147b23 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Certificate/CubicMatrixCanonical.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Certificate/CubicMatrixCanonical.lean @@ -60,7 +60,7 @@ carry all six atlas indices; see the accompanying analysis. -/ -@[expose] public section +public section namespace Utilities.Certificate.CubicMatrixReplay open Utilities.Certificate @@ -70,6 +70,7 @@ open Utilities.Certificate.CubicMatrixReplay /-! ## The canonical predicate -/ /-- A list of naturals is ascending. -/ +@[expose] def SortedAsc : List ℕ → Bool | [] => true | [_] => true @@ -78,6 +79,7 @@ def SortedAsc : List ℕ → Bool /-- `BlocksSorted keys values` asks that `values` be ascending across every adjacent pair whose `keys` agree. With `keys` the tail of row `0` and `values` row `1`, this is cut 1. -/ +@[expose] def BlocksSorted : List ℕ → List ℕ → Bool | a :: b :: keys, x :: y :: values => (decide (a ≠ b) || decide (x ≤ y)) && BlocksSorted (b :: keys) (y :: values) @@ -85,6 +87,7 @@ def BlocksSorted : List ℕ → List ℕ → Bool /-- The canonical predicate on a row list. It inspects only rows `0` and `1`, so it is decided as soon as those two are chosen. -/ +@[expose] def canonicalPrefix (rows : List (List ℕ)) : Bool := match rows with | [] => true @@ -118,6 +121,7 @@ def AcceptsAlong (accept : List (List ℕ) → Bool) : /-- Exhaustive check that skips branches the `accept` predicate rejects. A rejected branch is discharged immediately, so the subtree below it is never traversed. -/ +@[expose] def prunedCheck (accept leafDecide : List (List ℕ) → Bool) : ℕ → List ℕ → List (List ℕ) → Bool | 0, _, _ => false diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Certificate/CubicMatrixReplay.lean b/LeanPool/BrillNoetherGraphs/Utilities/Certificate/CubicMatrixReplay.lean index 83277a68dc..765368a217 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Certificate/CubicMatrixReplay.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Certificate/CubicMatrixReplay.lean @@ -49,7 +49,7 @@ This is the generic checker side only. Application-specific datasets, leaf decoders, and classifier handoff theorems belong in their application layer. -/ -@[expose] public section +public section namespace Utilities.Certificate.CubicMatrixReplay @@ -64,6 +64,7 @@ open Utilities.Certificate.CubicMatrixReplay in order, with the `k`-th summand bounded by the `k`-th capacity. This is the branch set of one vertex of the completion tree: the remaining degree of the current vertex is distributed over the vertices that come after it. -/ +@[expose] def boundedCompositions (total : ℕ) : List ℕ → List (List ℕ) | [] => if total = 0 then [[]] else [] | capacity :: capacities => @@ -270,6 +271,7 @@ structure Conditions (n deg : ℕ) (M : ℕ → ℕ → ℕ) : Prop where /-- The strict-upper-triangular row list of `M`: `rowsOf M i len` lists the rows of vertices `i, …, i + len - 1`, each row recording the multiplicities to the strictly later vertices in that range. -/ +@[expose] def rowsOf (M : ℕ → ℕ → ℕ) : ℕ → ℕ → List (List ℕ) | _, 0 => [] | i, len + 1 => @@ -419,6 +421,7 @@ theorem follows_capsOf_rowsOf {n deg : ℕ} {M : ℕ → ℕ → ℕ} /-- The entry of a symmetric matrix recovered from its strict-upper-triangular row list. -/ +@[expose] def entryOf (rows : List (List ℕ)) (i j : ℕ) : ℕ := if i < j then (rows.getD i []).getD (j - i - 1) 0 else if j < i then (rows.getD j []).getD (i - j - 1) 0 @@ -486,6 +489,7 @@ theorem entryOf_rowsOf {n deg : ℕ} {M : ℕ → ℕ → ℕ} (h : Conditions n /-- The unordered vertex-pair multiplicity table of an ordered core, as a total function on `ℕ`. -/ +@[expose] def matrixOf {n p : ℕ} (core : Core n p) (i j : ℕ) : ℕ := if hi : i < n then if hj : j < n then core.pairMultiplicity ⟨i, hi⟩ ⟨j, hj⟩ else 0 @@ -529,6 +533,7 @@ required to fire on connected tables. `MatrixConnected` is the cut form of over `(Finset.range size).powerset` rather than over all of `Finset ℕ`, so the predicate is decidable and a generated leaf record may discharge it by evaluation. -/ +@[expose] def MatrixConnected (size : ℕ) (M : ℕ → ℕ → ℕ) : Prop := ∀ S ∈ (Finset.range size).powerset, (∃ v ∈ S, ∃ w ∈ Finset.range size, w ∉ S) → diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Foundations.lean b/LeanPool/BrillNoetherGraphs/Utilities/Foundations.lean index 212c11006a..2319c5c920 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Foundations.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Foundations.lean @@ -31,4 +31,4 @@ public import LeanPool.BrillNoetherGraphs.Utilities.Foundations.UnderlyingSimple /-! Supporting modules for Brill–Noether theory and gonality of finite graphs. -/ -@[expose] public section +public section diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/AcyclicOrientation.lean b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/AcyclicOrientation.lean index 6a0ef2fdf1..39c1b5c842 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/AcyclicOrientation.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/AcyclicOrientation.lean @@ -44,7 +44,7 @@ The proof assembles the following results from `chip-firing-with-lean`: -/ -@[expose] public section +public section namespace Utilities diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/BlockSlopeRounding.lean b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/BlockSlopeRounding.lean index b3a9601935..5b2f0ff5d3 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/BlockSlopeRounding.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/BlockSlopeRounding.lean @@ -30,7 +30,7 @@ bounds `|δ|` by the total distance the chips travel. All of this is finite-sum integer arithmetic; no graph theory is involved. -/ -@[expose] public section +public section namespace Utilities.BlockSlopeRounding diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/BrillNoetherRank.lean b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/BrillNoetherRank.lean index ea2ce1d90c..b56af387e9 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/BrillNoetherRank.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/BrillNoetherRank.lean @@ -52,7 +52,7 @@ The descent of this predicate along an odd subdivision lives in `Utilities/Subdivision/SubdivisionChipDescent.lean` and is not imported here. -/ -@[expose] public section +public section namespace Utilities @@ -69,6 +69,7 @@ The literature says "`E` is contained in an effective divisor `D` of degree `d` and rank at least `r`"; since rank is a class invariant, that is the same as asking for `D - E` to be winnable, which is the form stated here. The containment form is recovered by `bnRankGe_iff_contained`. -/ +@[expose] def BNRankGe (G : CFGraph) (r d k : ℤ) : Prop := ∀ E : CFDiv G, effective E → CFDiv.degree E = r + k → ∃ D : CFDiv G, CFDiv.degree D = d ∧ rank G D ≥ r ∧ winnable G (D - E) diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/CanonicalSlackPair.lean b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/CanonicalSlackPair.lean index 44c16d48b2..a1c22f6f6b 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/CanonicalSlackPair.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/CanonicalSlackPair.lean @@ -21,7 +21,7 @@ The declarations use the established `MarkedGraphs` namespace for API compatibility. -/ -@[expose] public section +public section namespace MarkedGraphs @@ -30,6 +30,7 @@ open Utilities /-- A specified divisor satisfying the slack-column near-rectangle conditions at the marked vertices: degree equal to the genus, rank at least one, and nonnegative rank after the two marked chips are removed. -/ +@[expose] def IsSlackNearRectangleDivisor (H : CFGraph) (x y : H.V) (D : CFDiv H) : Prop := CFDiv.degree D = CFGraph.genus H ∧ diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/CommonOffsetRounding.lean b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/CommonOffsetRounding.lean index bbc05c48c5..b71349e5ec 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/CommonOffsetRounding.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/CommonOffsetRounding.lean @@ -24,7 +24,7 @@ The endpoint-slope bounds used in finite graph specialization are preserved by this same rounding, including negative heights and negative slopes. -/ -@[expose] public section +public section namespace Utilities.CommonOffsetRounding diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/ConvexIntegerRounding.lean b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/ConvexIntegerRounding.lean index 0b83d6541c..987c2be8a9 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/ConvexIntegerRounding.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/ConvexIntegerRounding.lean @@ -17,13 +17,14 @@ therefore gives a coarse edge slope between those same slopes. Consecutive coarse slopes remain nondecreasing. -/ -@[expose] public section +public section namespace Utilities.ConvexIntegerRounding open Finset CommonOffsetRounding /-- The forward slope on an integer path. -/ +@[expose] def slope (v : ℕ → ℤ) (i : ℕ) : ℤ := v (i + 1) - v i /-- Successive slope comparisons give all slope comparisons before `L`. -/ diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/Duality.lean b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/Duality.lean index 38aac24750..569a3ea81e 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/Duality.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/Duality.lean @@ -17,7 +17,7 @@ dual rank condition for `K_G - D`. This module records both the pointwise rank equivalence and the induced symmetry of `BNExists`. -/ -@[expose] public section +public section namespace Utilities diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/EdgeAddition.lean b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/EdgeAddition.lean index a076a0dd78..e7c3349ea4 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/EdgeAddition.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/EdgeAddition.lean @@ -17,7 +17,7 @@ unchanged, so divisors and firing scripts on the old and new graphs are the same functions. -/ -@[expose] public section +public section open Multiset Finset @@ -137,6 +137,7 @@ theorem graph_connected_addEdge simp [hvx, hvy] /-- The degree-zero divisor supported with opposite signs at the new edge's endpoints. -/ +@[expose] def seamDivisor {H : CFGraph} (x y : H.V) : CFDiv H := oneChip x - oneChip y diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/EffectiveDifference.lean b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/EffectiveDifference.lean index 7b6be2ecc6..4e3bddb4f5 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/EffectiveDifference.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/EffectiveDifference.lean @@ -34,7 +34,7 @@ Write `K` for `canonicalDivisor G` and `g` for `genus G`. 4. `F - E ~ (K - F*) - E = K - (E + F*) = K - M ~ K - (K - γ) = γ`. -/ -@[expose] public section +public section namespace Utilities diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/ElementaryExistence.lean b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/ElementaryExistence.lean index 59eb07c8af..c8f66b001c 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/ElementaryExistence.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/ElementaryExistence.lean @@ -17,7 +17,7 @@ only effective divisors, the degree bound for winnability, and graph Riemann--Roch. -/ -@[expose] public section +public section namespace Utilities diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/InducedSubgraph.lean b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/InducedSubgraph.lean index aa1361e4ff..f782de6544 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/InducedSubgraph.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/InducedSubgraph.lean @@ -16,7 +16,7 @@ Raw edge occurrences are filtered before their endpoints are bundled into the subtype, so parallel edges are retained without identification. -/ -@[expose] public section +public section open Multiset Finset @@ -77,6 +77,7 @@ noncomputable abbrev inducedSubgraph (G : CFGraph.{u}) (S : Finset G.V) (inducedEdges G S).pmap (restrictInducedEdge G S) (by exact inducedEdges_all G S) := rfl /-- The inclusion of the induced vertex set into the original graph. -/ +@[expose] def inducedSubgraphInclusion (G : CFGraph.{u}) (S : Finset G.V) (hS : S.Nonempty) : (inducedSubgraph G S hS).V → G.V := fun x => x.val diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/Orientability.lean b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/Orientability.lean index 2e155c2d7c..14f2053352 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/Orientability.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/Orientability.lean @@ -79,7 +79,7 @@ their identities) is stated for an *arbitrary* edge multiset, because step (1) r -/ -@[expose] public section +public section namespace Utilities @@ -336,6 +336,7 @@ lemma edgesBetweenOf_eq_sum (M : Multiset (G.V × G.V)) {S T : Finset G.V} /-- `e(S, T)`, as the double sum of edge multiplicities over `S × T`. For disjoint `S` and `T` this is the number of edges with one end in each (`edgesBetweenOf_eq_sum`), which is what makes it the right bookkeeping device for a set firing. -/ +@[expose] def edgesBetween (G : CFGraph) (S T : Finset G.V) : ℕ := ∑ v ∈ S, ∑ w ∈ T, numEdges G v w diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/OrientationReversal.lean b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/OrientationReversal.lean index 51b5071eb9..41f045d9f2 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/OrientationReversal.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/OrientationReversal.lean @@ -74,7 +74,7 @@ all of them realised in this file: -/ -@[expose] public section +public section namespace Utilities diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/Parameters.lean b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/Parameters.lean index 9e6cdd32cb..9bf947f37e 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/Parameters.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/Parameters.lean @@ -20,27 +20,32 @@ duality and later arithmetic reductions insensitive to the particular divisor chosen as a witness. -/ -@[expose] public section +public section namespace Utilities /-- The width `g - d + r` of the Brill--Noether rectangle. -/ +@[expose] def rectangleWidth (G : CFGraph) (r d : ℤ) : ℤ := CFGraph.genus G - d + r /-- The Brill--Noether number `g - (r + 1) * (g - d + r)`. -/ +@[expose] def bnNumber (G : CFGraph) (r d : ℤ) : ℤ := CFGraph.genus G - (r + 1) * rectangleWidth G r d /-- There is a divisor of degree `d` and rank at least `r` on `G`. -/ +@[expose] def BNExists (G : CFGraph) (r d : ℤ) : Prop := ∃ D : CFDiv G, CFDiv.degree D = d ∧ rank G D ≥ r /-- The degree complementary to `d` with respect to the canonical divisor. -/ +@[expose] def dualDegree (G : CFGraph) (d : ℤ) : ℤ := 2 * CFGraph.genus G - 2 - d /-- The dual rank `g - d + r - 1`. -/ +@[expose] def dualRank (G : CFGraph) (r d : ℤ) : ℤ := rectangleWidth G r d - 1 diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/RankChipStep.lean b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/RankChipStep.lean index 8e582eba79..09e1ea1ce9 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/RankChipStep.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/RankChipStep.lean @@ -19,7 +19,7 @@ These two inequalities are the rank-side input for propagating transmission conditions between adjacent lattice rows. -/ -@[expose] public section +public section namespace Utilities diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/RankDeterminingSet.lean b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/RankDeterminingSet.lean index edabba4781..8c065e487e 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/RankDeterminingSet.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/RankDeterminingSet.lean @@ -134,7 +134,7 @@ J. van Dobben de Bruyn and D. Gijswijt, *Treewidth is a lower bound on graph gonality*, Lemma 2.6, formalized in `Subdivision/StrongSeparator.lean`. -/ -@[expose] public section +public section namespace Utilities @@ -478,6 +478,7 @@ variable {n p : ℕ} /-- The core vertices of a subdivision, as a finite set of subdivision vertices. -/ +@[expose] def Spec.coreVertices (spec : Spec n p) : Finset spec.graph.V := (Finset.univ : Finset (Fin n)).image spec.coreVertex diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/RankInvariance.lean b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/RankInvariance.lean index 2e9ced2e67..2cba33e98c 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/RankInvariance.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/RankInvariance.lean @@ -16,7 +16,7 @@ equivalence. This module lifts that statement through the universal tests in the definition of divisor rank. -/ -@[expose] public section +public section namespace Utilities diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/RankOne.lean b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/RankOne.lean index 150f0d98aa..450fdb8316 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/RankOne.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/RankOne.lean @@ -16,7 +16,7 @@ that reduction independently of the edge-addition machinery and gives a certificate interface suited to explicit chip-firing arguments. -/ -@[expose] public section +public section namespace Utilities diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/RiemannRochWinnable.lean b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/RiemannRochWinnable.lean index bf72809432..9bd631f70a 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/RiemannRochWinnable.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/RiemannRochWinnable.lean @@ -18,7 +18,7 @@ common-complement arguments, where the degree bookkeeping is fixed before the rank condition is applied. -/ -@[expose] public section +public section namespace Utilities diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/ScriptClamping.lean b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/ScriptClamping.lean index 5d56874d49..d025fea26c 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/ScriptClamping.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/ScriptClamping.lean @@ -22,7 +22,7 @@ appears in `Utilities.Gonality.LegalFiring`; here it is a short consequence of maximum closure, without importing the gonality development. -/ -@[expose] public section +public section namespace Utilities @@ -55,6 +55,7 @@ theorem effective_add_prin_max {D : CFDiv G} {σ τ : firingScript G} exact le_trans (hσ v) (add_le_add le_rfl hle) /-- Subtract a constant from a script and replace negative values by zero. -/ +@[expose] def clampScript (σ : firingScript G) (c : ℤ) : firingScript G := fun v => max (σ v - c) 0 diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/TopologicalVertices.lean b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/TopologicalVertices.lean index 2b518ea104..8d9ea571d8 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/TopologicalVertices.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/TopologicalVertices.lean @@ -17,16 +17,18 @@ minimum-valence-two hypothesis is essential for bounding their number in terms of the genus. -/ -@[expose] public section +public section namespace Utilities /-- The vertices of valence at least three. -/ +@[expose] def topologicalVertices (G : CFGraph) : Finset G.V := Finset.univ.filter fun v => 3 ≤ vertexDegree G v /-- Every vertex has valence at least two. This is the structural condition obtained after pruning grafted trees. -/ +@[expose] def HasMinimumValenceTwo (G : CFGraph) : Prop := ∀ v : G.V, 2 ≤ vertexDegree G v diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/UnderlyingSimpleGraph.lean b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/UnderlyingSimpleGraph.lean index f581e32f95..2374073829 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Foundations/UnderlyingSimpleGraph.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Foundations/UnderlyingSimpleGraph.lean @@ -18,11 +18,12 @@ connectivity and `SimpleGraph.Connected`. This provides a general interface from chip-firing multigraphs to Mathlib's simple-graph connectivity theory. -/ -@[expose] public section +public section namespace Utilities /-- The simple graph underlying a chip-firing multigraph. -/ +@[expose] def underlyingSimpleGraph (G : CFGraph) : SimpleGraph G.V where Adj v w := numEdges G v w > 0 -- `SimpleGraph.symm` now asks for `Std.Symm Adj` (a one-field class), not the diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Gluing.lean b/LeanPool/BrillNoetherGraphs/Utilities/Gluing.lean index 2241d2f435..0f5a29bc7c 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Gluing.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Gluing.lean @@ -39,4 +39,4 @@ public import LeanPool.BrillNoetherGraphs.Utilities.Gluing.VertexWedgeRankFormul /-! Supporting modules for Brill–Noether theory and gonality of finite graphs. -/ -@[expose] public section +public section diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/BridgeContraction.lean b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/BridgeContraction.lean index 7b28a1baa4..eac9746a5e 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/BridgeContraction.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/BridgeContraction.lean @@ -24,7 +24,7 @@ The declarations remain in the established `MarkedGraphs` namespace for API compatibility. -/ -@[expose] public section +public section open Finset @@ -36,6 +36,7 @@ universe u v /-- Contract the bridge endpoints, using the left endpoint as the vertex of the resulting wedge. -/ +@[expose] def contractBridgeVertex (G : CFGraph.{u}) (H : CFGraph.{v}) (x : G.V) (y : H.V) : (bridgeGraph G H x y).V → (vertexWedge G H x y).V := @@ -56,6 +57,7 @@ def contractBridgeVertex (G : CFGraph.{u}) (H : CFGraph.{v}) /-- Push a divisor through bridge contraction. The coefficients at the two bridge endpoints are added; every other coefficient is unchanged. -/ +@[expose] def bridgePushforwardHom (G : CFGraph.{u}) (H : CFGraph.{v}) (x : G.V) (y : H.V) : CFDiv (bridgeGraph G H x y) →+ CFDiv (vertexWedge G H x y) where @@ -103,6 +105,7 @@ abbrev bridgePushforward (G : CFGraph.{u}) (H : CFGraph.{v}) /-- The canonical lift puts the coefficient of the common wedge vertex at the left bridge endpoint and puts zero at the right bridge endpoint. -/ +@[expose] def bridgeCanonicalLiftHom (G : CFGraph.{u}) (H : CFGraph.{v}) (x : G.V) (y : H.V) : CFDiv (vertexWedge G H x y) →+ CFDiv (bridgeGraph G H x y) where @@ -222,12 +225,14 @@ theorem effective_bridgePushforward · simpa [hb] using hD (Sum.inr ⟨b, hb⟩) /-- Restrict a firing script on the bridge graph to the left factor. -/ +@[expose] def restrictLeftBridgeScript (G : CFGraph.{u}) (H : CFGraph.{v}) (x : G.V) (y : H.V) (σ : firingScript (bridgeGraph G H x y)) : firingScript G := fun a => σ (Sum.inl a) /-- Restrict a firing script on the bridge graph to the right factor. -/ +@[expose] def restrictRightBridgeScript (G : CFGraph.{u}) (H : CFGraph.{v}) (x : G.V) (y : H.V) (σ : firingScript (bridgeGraph G H x y)) : firingScript H := @@ -498,6 +503,7 @@ theorem linear_equiv_bridgePushforward /-- Pull a firing script on the wedge back to the bridge graph, assigning the common wedge value to both bridge endpoints. -/ +@[expose] def expandWedgeScript (G : CFGraph.{u}) (H : CFGraph.{v}) (x : G.V) (y : H.V) (σ : firingScript (vertexWedge G H x y)) : diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/BridgeCut.lean b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/BridgeCut.lean index db715a3d21..e833d84952 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/BridgeCut.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/BridgeCut.lean @@ -21,7 +21,7 @@ either factor remain fully visible while the separating edge has multiplicity exactly one. -/ -@[expose] public section +public section namespace MarkedGraphs @@ -65,10 +65,12 @@ noncomputable abbrev rightGraph : CFGraph := inducedSubgraph K cut.right cut.right_nonempty /-- The left endpoint, as a vertex of the left induced factor. -/ +@[expose] noncomputable def leftGlue : cut.leftGraph.V := ⟨cut.leftAttach, cut.leftAttach_mem⟩ /-- The right endpoint, as a vertex of the right induced factor. -/ +@[expose] noncomputable def rightGlue : cut.rightGraph.V := ⟨cut.rightAttach, cut.rightAttach_mem⟩ @@ -87,6 +89,7 @@ noncomputable abbrev bridgeGraph : CFGraph := Utilities.bridgeGraph cut.leftGraph cut.rightGraph cut.leftGlue cut.rightGlue /-- The vertex equivalence from the concrete bridge model to the ambient graph. -/ +@[expose] noncomputable def vertexEquiv : cut.bridgeGraph.V ≃ K.V where toFun | Sum.inl a => a.val @@ -269,6 +272,7 @@ theorem graph_connected_left_of_connected (hK : graphConnected K) : simpa [leftGraph, hxValue, yLeft] using hxy /-- Exchange the two sides of a bridge cut. -/ +@[expose] def swap : OneBridgeCut K where left := cut.right right := cut.left diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/BridgeDivisors.lean b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/BridgeDivisors.lean index 9711903338..90db4d4a91 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/BridgeDivisors.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/BridgeDivisors.lean @@ -16,7 +16,7 @@ by joining the factors with a bridge. A script which is one on the left factor and zero on the right records the elementary chip transfer across the bridge. -/ -@[expose] public section +public section open Finset @@ -27,12 +27,14 @@ open Utilities universe u v /-- Extend a divisor on the left factor by zero on the right factor. -/ +@[expose] def liftLeftDivisor (G : CFGraph.{u}) (H : CFGraph.{v}) (x : G.V) (y : H.V) (D : CFDiv G) : CFDiv (bridgeGraph G H x y) := Sum.elim D (fun _ => 0) /-- Extend a divisor on the right factor by zero on the left factor. -/ +@[expose] def liftRightDivisor (G : CFGraph.{u}) (H : CFGraph.{v}) (x : G.V) (y : H.V) (D : CFDiv H) : CFDiv (bridgeGraph G H x y) := @@ -105,12 +107,14 @@ divisor is effective. -/ | inr b => exact h b /-- Extend a firing script on the left factor by zero on the right. -/ +@[expose] def liftLeftScript (G : CFGraph.{u}) (H : CFGraph.{v}) (x : G.V) (y : H.V) (σ : firingScript G) : firingScript (bridgeGraph G H x y) := Sum.elim σ (fun _ => 0) /-- Extend a firing script on the right factor by zero on the left. -/ +@[expose] def liftRightScript (G : CFGraph.{u}) (H : CFGraph.{v}) (x : G.V) (y : H.V) (σ : firingScript H) : firingScript (bridgeGraph G H x y) := @@ -138,6 +142,7 @@ def liftRightScript (G : CFGraph.{u}) (H : CFGraph.{v}) /-- Extend a left-factor script constantly across the right factor, using its value at the bridge endpoint. This introduces no firing across the bridge. -/ +@[expose] def extendLeftScript (G : CFGraph.{u}) (H : CFGraph.{v}) (x : G.V) (y : H.V) (σ : firingScript G) : firingScript (bridgeGraph G H x y) := @@ -145,6 +150,7 @@ def extendLeftScript (G : CFGraph.{u}) (H : CFGraph.{v}) /-- Extend a right-factor script constantly across the left factor, using its value at the bridge endpoint. This introduces no firing across the bridge. -/ +@[expose] def extendRightScript (G : CFGraph.{u}) (H : CFGraph.{v}) (x : G.V) (y : H.V) (σ : firingScript H) : firingScript (bridgeGraph G H x y) := @@ -323,6 +329,7 @@ theorem winnable_liftRightDivisor linear_equiv_liftRightDivisor G H x y hDE⟩ /-- The firing script which is one on the left factor and zero on the right. -/ +@[expose] def leftSideIndicator (G : CFGraph.{u}) (H : CFGraph.{v}) (x : G.V) (y : H.V) : firingScript (bridgeGraph G H x y) := liftLeftScript G H x y (fun _ => 1) diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/BridgeGraph.lean b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/BridgeGraph.lean index 2b0dbbd53a..0be9e265ce 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/BridgeGraph.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/BridgeGraph.lean @@ -16,7 +16,7 @@ type and adds one edge between specified vertices in the two factors. The construction is useful for reducing divisor questions across separating edges. -/ -@[expose] public section +public section open Multiset Finset diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/BridgeRankOne.lean b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/BridgeRankOne.lean index 590cb7cecb..883b703a09 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/BridgeRankOne.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/BridgeRankOne.lean @@ -17,7 +17,7 @@ sum after removing one chip at a bridge endpoint. The loss of one degree is the familiar bridge gluing correction. -/ -@[expose] public section +public section namespace MarkedGraphs diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/CanonicalWedge.lean b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/CanonicalWedge.lean index 37cfde7aff..99fcdda505 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/CanonicalWedge.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/CanonicalWedge.lean @@ -26,7 +26,7 @@ This file is deliberately independent of genus two and of two-pole joins. It is the reusable one-pole calculation underlying the genus-two/genus-two seed. -/ -@[expose] public section +public section open Finset @@ -79,6 +79,7 @@ theorem vertex_degree_vertexWedge_inr linarith /-- The sum of the two factor canonical divisors on their vertex wedge. -/ +@[expose] def wedgeCanonicalSum (G : CFGraph.{u}) (H : CFGraph.{v}) (x : G.V) (y : H.V) : CFDiv (vertexWedge G H x y) := diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/ChainGluing.lean b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/ChainGluing.lean index 94775d3d56..270342d22d 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/ChainGluing.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/ChainGluing.lean @@ -42,7 +42,7 @@ generality would raise the level at every step. Everything here therefore works with all factors in a single fixed universe, where the wedge is closed. -/ -@[expose] public section +public section namespace Utilities @@ -63,6 +63,7 @@ namespace MarkedGraph /-- Glue the right mark of `M` to the left mark of `N`. The result keeps the left mark of `M` and the right mark of `N`, which is the marking the Demazure composition theorem produces. -/ +@[expose] def wedge (M N : MarkedGraph.{u}) : MarkedGraph.{u} where graph := vertexWedge M.graph N.graph M.right N.left left := Sum.inl M.left @@ -75,6 +76,7 @@ def wedge (M N : MarkedGraph.{u}) : MarkedGraph.{u} where /-- The left-associated iterated vertex gluing of a chain, growing to the right. `chain M []` is `M`, and each further factor is glued onto the accumulated right mark. -/ +@[expose] def chain (M : MarkedGraph.{u}) : List MarkedGraph.{u} → MarkedGraph.{u} | [] => M | N :: rest => chain (M.wedge N) rest diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/CycleRigidity.lean b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/CycleRigidity.lean index 6b00dd24b6..16ec37ae72 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/CycleRigidity.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/CycleRigidity.lean @@ -19,7 +19,7 @@ length. This file proves that every such subdivision has no one-edge cut and therefore satisfies the pointed genus-one rigidity interface. -/ -@[expose] public section +public section namespace Utilities @@ -29,6 +29,7 @@ open Certificate /-! ## Two-regular connected graphs have no one-edge cuts -/ /-- The contribution to the degree of `v` from vertices inside `S`. -/ +@[expose] def internalDegree (H : CFGraph) (S : Finset H.V) (v : H.V) : ℤ := ∑ w ∈ S, (numEdges H v w : ℤ) @@ -169,6 +170,7 @@ theorem twoEdgeCutCondition_of_connected_vertexDegree_two namespace TwoPathCycle /-- The ordered core with two parallel slots from vertex `0` to vertex `1`. -/ +@[expose] def core : ExplicitPotential.Core 2 2 where tail := fun _ => 0 head := fun _ => 1 @@ -177,6 +179,7 @@ theorem core_connected : core.Connected := by exact core.connectedCheck_eq_true_iff.mp (by decide) /-- Two positive subdivided paths with common endpoints. -/ +@[expose] def spec (length : Fin 2 → ℕ) (hLength : ∀ edge, 0 < length edge) : SubdivisionGraph.Spec 2 2 where core := core diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/DegSpecLocalization.lean b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/DegSpecLocalization.lean index 166ba326da..eabf8aa9e0 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/DegSpecLocalization.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/DegSpecLocalization.lean @@ -47,7 +47,7 @@ Dhar calculation by a genus-two one with two frozen endpoints. may use this directly. -/ -@[expose] public section +public section namespace Utilities.Gluing diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/GenusFiveVertexCut.lean b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/GenusFiveVertexCut.lean index 5339e61135..22730d7bd3 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/GenusFiveVertexCut.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/GenusFiveVertexCut.lean @@ -22,7 +22,7 @@ the genus-four factor uses the supplied genus-four theorem, and bridge gluing followed by contraction of the artificial bridge loses exactly one degree. -/ -@[expose] public section +public section namespace Utilities universe u diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/GenusFourVertexCut.lean b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/GenusFourVertexCut.lean index b4f67f3e72..6f1d8d2951 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/GenusFourVertexCut.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/GenusFourVertexCut.lean @@ -21,7 +21,7 @@ a genus-three factor and a pointed rigid genus-one factor glue without adding a chip. This module keeps those statements in the public gluing layer. -/ -@[expose] public section +public section namespace Utilities diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/GenusThreeCycleWedge.lean b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/GenusThreeCycleWedge.lean index 3b1ce23068..b8dd714420 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/GenusThreeCycleWedge.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/GenusThreeCycleWedge.lean @@ -20,7 +20,7 @@ genus-one cycle without adding chips. The theorem uses the established `MarkedGraphs` namespace for API compatibility. -/ -@[expose] public section +public section namespace MarkedGraphs diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/GenusTwoTwoPole.lean b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/GenusTwoTwoPole.lean index 35e6106756..fb75181efb 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/GenusTwoTwoPole.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/GenusTwoTwoPole.lean @@ -29,7 +29,7 @@ choose one seam phase compatible with the desired rank tests; that scalar problem is represented by `TwoPoleProfile.lean`. -/ -@[expose] public section +public section namespace Utilities namespace TwoPole diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/InteriorScriptTransport.lean b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/InteriorScriptTransport.lean index 9fdcd040ce..947c597db8 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/InteriorScriptTransport.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/InteriorScriptTransport.lean @@ -51,7 +51,7 @@ boundary vertex may deliver into `A` only the chips it already carries. `Utilities` only, so every `LowGenus` configuration file may use it. -/ -@[expose] public section +public section namespace Utilities.Gluing @@ -65,6 +65,7 @@ variable {G : CFGraph.{u}} /-- `v` is **interior** to `A` when every ambient edge at `v` has its other end in `A`. A script supported on interior vertices cannot be felt outside `A`. -/ +@[expose] def Interior (G : CFGraph.{u}) (A : Finset G.V) (v : G.V) : Prop := ∀ w : G.V, w ∉ A → numEdges G v w = 0 diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/MarkedTwistDegree.lean b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/MarkedTwistDegree.lean index 296c80a401..53d7c56a3a 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/MarkedTwistDegree.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/MarkedTwistDegree.lean @@ -17,7 +17,7 @@ degree identities so later formalizations do not repeatedly unfold `CFDiv.degree fight integer casts. -/ -@[expose] public section +public section namespace Utilities diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/OneVertexCutFactors.lean b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/OneVertexCutFactors.lean index 8febfdbc27..7ee51c9737 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/OneVertexCutFactors.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/OneVertexCutFactors.lean @@ -20,7 +20,7 @@ imports this file) so that the bridgeless genus-two classification does not depend on the once-marked census. -/ -@[expose] public section +public section namespace Utilities diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/OneVertexCutReaches.lean b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/OneVertexCutReaches.lean index 9e9a64719f..e1021275ce 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/OneVertexCutReaches.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/OneVertexCutReaches.lean @@ -26,7 +26,7 @@ express and which is what a chip-free component of a two-edge-connected core actually presents. -/ -@[expose] public section +public section namespace Utilities.Gluing diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/SeparatingEdgeCut.lean b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/SeparatingEdgeCut.lean index 92b4d22bd7..85fa636d30 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/SeparatingEdgeCut.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/SeparatingEdgeCut.lean @@ -18,7 +18,7 @@ multiplicity equation is important for multigraphs: a bridge in the underlying simple graph is not enough when parallel edge occurrences exist. -/ -@[expose] public section +public section namespace Utilities diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/SeparatingEdgePath.lean b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/SeparatingEdgePath.lean index ba3fe17853..db1369154e 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/SeparatingEdgePath.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/SeparatingEdgePath.lean @@ -21,7 +21,7 @@ needed to show that a script normalized across every bridge is constant on the degree-one divisor classes. -/ -@[expose] public section +public section namespace Utilities diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/TwoEdgeConnectedRigidity.lean b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/TwoEdgeConnectedRigidity.lean index 09c155b735..cb1bf5081f 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/TwoEdgeConnectedRigidity.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/TwoEdgeConnectedRigidity.lean @@ -24,7 +24,7 @@ out-degree zero; at `y` it forces out-degree at most one. Thus the whole cut has size at most one, contradicting the hypothesis. -/ -@[expose] public section +public section namespace Utilities @@ -36,12 +36,14 @@ variable {H : CFGraph.{uTwoEdgeRigidity}} /-- Total edge multiplicity crossing from `S` to its complement, counted at the endpoint in `S`. -/ +@[expose] def cutMultiplicity (H : CFGraph) (S : Finset H.V) : ℤ := ∑ v ∈ S, outdegreeSet H S v /-- Every nonempty proper vertex set has at least two outgoing edges, counted with multiplicity. For a connected loopless multigraph this is the usual absence of bridges. -/ +@[expose] def TwoEdgeCutCondition (H : CFGraph) : Prop := ∀ S : Finset H.V, S.Nonempty → S ≠ Finset.univ → 2 ≤ cutMultiplicity H S diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/TwoPole.lean b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/TwoPole.lean index bf599c5624..41a43cfacc 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/TwoPole.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/TwoPole.lean @@ -26,7 +26,7 @@ four pole chips. In genus two plus genus two, Riemann--Roch therefore says that the two degree-four candidates have exactly the same rank. -/ -@[expose] public section +public section open Finset @@ -68,6 +68,7 @@ theorem second_endpoints_ne (A : CFGraph.{u}) (B : CFGraph.{v}) /-- Add divisors on the two factors by placing them on the two summands. The same function is a divisor on both `bridge` and `join`, since `addEdge` keeps the vertex type unchanged. -/ +@[expose] def sumDivisor (A : CFGraph.{u}) (B : CFGraph.{v}) (p : TwoPole A) (q : TwoPole B) (D : CFDiv A) (E : CFDiv B) : CFDiv (join A B p q) := @@ -240,6 +241,7 @@ def boundaryDivisor (A : CFGraph.{u}) (B : CFGraph.{v}) oneChip (Sum.inr q.first) + oneChip (Sum.inr q.second) /-- The sum of the two local canonical divisors, with no pole chips added. -/ +@[expose] def canonicalSum (A : CFGraph.{u}) (B : CFGraph.{v}) (p : TwoPole A) (q : TwoPole B) : CFDiv (join A B p q) := sumDivisor A B p q (canonicalDivisor A) (canonicalDivisor B) diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/TwoPoleProfile.lean b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/TwoPoleProfile.lean index d1f8fc13c5..9cad87ba01 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/TwoPoleProfile.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/TwoPoleProfile.lean @@ -23,7 +23,7 @@ intentional: marked residuals such as `4a - 2u`, higher-rank tests, and future multi-stage gluings can all use the same interface. -/ -@[expose] public section +public section open Finset @@ -69,6 +69,7 @@ def IsCreditResponse {G : CFGraph.{u}} (p : TwoPole G) (D : CFDiv G) /-- Glue factor scripts, translating the right script by a constant. The translation changes neither its factor principal divisor nor its displacement, but it sets the absolute flux through the first cross-edge. -/ +@[expose] def glueScript (A : CFGraph.{u}) (B : CFGraph.{v}) (p : TwoPole A) (q : TwoPole B) (f : firingScript A) (g : firingScript B) (k : ℤ) : diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/TwoPoleRank.lean b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/TwoPoleRank.lean index 47f511f94e..a3d086b2b0 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/TwoPoleRank.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/TwoPoleRank.lean @@ -25,7 +25,7 @@ condition. They also apply to every seam phase and to arbitrary factor divisors, not only canonical divisors or genus-two graphs. -/ -@[expose] public section +public section namespace Utilities namespace TwoPole diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/TwoPoleReachability.lean b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/TwoPoleReachability.lean index c69e8813d3..3d350590b3 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/TwoPoleReachability.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/TwoPoleReachability.lean @@ -18,7 +18,7 @@ convex integral path potential; the second connector is constant. This avoids requiring an isomorphism to a separately constructed path-join graph. -/ -@[expose] public section +public section namespace Utilities.TwoPole diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/VertexCutConnectivity.lean b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/VertexCutConnectivity.lean index c71765b8f7..3452667144 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/VertexCutConnectivity.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/VertexCutConnectivity.lean @@ -15,7 +15,7 @@ The two induced graphs associated with a one-vertex cut inherit connectivity from the ambient graph. -/ -@[expose] public section +public section namespace Utilities @@ -139,6 +139,7 @@ theorem graph_connected_left_of_connected exact heq.symm ▸ hpositive /-- The same cut with its two factors exchanged. -/ +@[expose] def swap : OneVertexCut K where left := cut.right right := cut.left diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/VertexCutWedge.lean b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/VertexCutWedge.lean index b1bba435fe..d5392c6d87 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/VertexCutWedge.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/VertexCutWedge.lean @@ -19,7 +19,7 @@ by their induced subgraphs. This is the structural extraction lemma needed to turn articulation/block data into divisor and transmission theorems. -/ -@[expose] public section +public section namespace Utilities @@ -53,18 +53,22 @@ theorem right_nonempty : cut.right.Nonempty := ⟨cut.glue, cut.glue_mem_right⟩ /-- The induced left factor. -/ +@[expose] noncomputable def leftGraph : CFGraph := inducedSubgraph K cut.left cut.left_nonempty /-- The induced right factor. -/ +@[expose] noncomputable def rightGraph : CFGraph := inducedSubgraph K cut.right cut.right_nonempty /-- The common vertex as a vertex of the left induced factor. -/ +@[expose] noncomputable def leftGlue : cut.leftGraph.V := ⟨cut.glue, cut.glue_mem_left⟩ /-- The common vertex as a vertex of the right induced factor. -/ +@[expose] noncomputable def rightGlue : cut.rightGraph.V := ⟨cut.glue, cut.glue_mem_right⟩ @@ -74,6 +78,7 @@ noncomputable def rightGlue : cut.rightGraph.V := /-- A one-vertex cut canonically presents the ambient graph as the wedge of its two induced factors. -/ +@[expose] noncomputable def presentation : VertexWedgePresentation K cut.leftGraph cut.rightGraph cut.leftGlue cut.rightGlue where @@ -125,6 +130,7 @@ noncomputable def presentation : exact hValue /-- The occurrence-safe graph isomorphism extracted from a one-vertex cut. -/ +@[expose] noncomputable def graphIso : CFGraphIso (vertexWedge cut.leftGraph cut.rightGraph cut.leftGlue cut.rightGlue) K := diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/VertexWedge.lean b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/VertexWedge.lean index a7099d7a47..39ab8fb85d 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/VertexWedge.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/VertexWedge.lean @@ -20,7 +20,7 @@ maps for divisors and firing scripts. Later vertex-gluing arguments can use these maps without choosing a quotient representative. -/ -@[expose] public section +public section open Multiset Finset @@ -30,6 +30,7 @@ universe u v /-- Map the vertices of the right factor into a wedge, sending its marked vertex to the marked vertex on the left. -/ +@[expose] def wedgeRightVertex (G : CFGraph.{u}) (H : CFGraph.{v}) (x : G.V) (y : H.V) : H.V → Sum G.V { b : H.V // b ≠ y } := fun b => if h : b = y then Sum.inl x else Sum.inr ⟨b, h⟩ @@ -108,7 +109,7 @@ abbrev vertexWedge (G : CFGraph.{u}) (H : CFGraph.{v}) (wedgeRightVertex G H x y e.1, wedgeRightVertex G H x y e.2)) := rfl /-- The left factor is included literally in the wedge. -/ -def wedgeLeftVertex (G : CFGraph.{u}) (H : CFGraph.{v}) +@[expose] def wedgeLeftVertex (G : CFGraph.{u}) (H : CFGraph.{v}) (x : G.V) (y : H.V) : G.V → (vertexWedge G H x y).V := Sum.inl @[simp] theorem wedgeLeftVertex_apply @@ -117,19 +118,20 @@ def wedgeLeftVertex (G : CFGraph.{u}) (H : CFGraph.{v}) /-- A divisor on the wedge obtained by adding a left divisor and a right divisor, with the right marked chip placed at the common vertex. -/ -def wedgeAddDivisor (G : CFGraph.{u}) (H : CFGraph.{v}) +@[expose] def wedgeAddDivisor (G : CFGraph.{u}) (H : CFGraph.{v}) (x : G.V) (y : H.V) (D : CFDiv G) (E : CFDiv H) : CFDiv (vertexWedge G H x y) := Sum.elim (fun a => D a + if a = x then E y else 0) (fun b => E b.1) /-- Extend a left divisor by zero away from the common vertex. -/ +@[expose] def wedgeLiftLeftDivisor (G : CFGraph.{u}) (H : CFGraph.{v}) (x : G.V) (y : H.V) (D : CFDiv G) : CFDiv (vertexWedge G H x y) := wedgeAddDivisor G H x y D 0 /-- Extend a right divisor by zero away from the common vertex, placing its marked coefficient at the common vertex. -/ -def wedgeLiftRightDivisor (G : CFGraph.{u}) (H : CFGraph.{v}) +@[expose] def wedgeLiftRightDivisor (G : CFGraph.{u}) (H : CFGraph.{v}) (x : G.V) (y : H.V) (E : CFDiv H) : CFDiv (vertexWedge G H x y) := wedgeAddDivisor G H x y 0 E @@ -260,7 +262,7 @@ theorem effective_wedgeLiftLeftDivisor_iff /-- Glue firing scripts by requiring their values to agree at the identified vertex. -/ -def wedgeScript (G : CFGraph.{u}) (H : CFGraph.{v}) +@[expose] def wedgeScript (G : CFGraph.{u}) (H : CFGraph.{v}) (x : G.V) (y : H.V) (σ : firingScript G) (τ : firingScript H) (_hxy : σ x = τ y) : firingScript (vertexWedge G H x y) := Sum.elim σ (fun b => τ b.1) @@ -616,6 +618,7 @@ theorem prin_const_script (G : CFGraph.{u}) (c : ℤ) : simp [prin] /-- Add a constant to a firing script. This changes no principal divisor. -/ +@[expose] def shiftScript (G : CFGraph.{u}) (σ : firingScript G) (c : ℤ) : firingScript G := fun v => σ v + c @@ -815,13 +818,13 @@ theorem BNExists_vertexWedge_rank_one rw [deg_wedgeAddDivisor, hDegD, hDegE] /-- Restrict a wedge firing script to the left factor. -/ -def restrictLeftWedgeScript (G : CFGraph.{u}) (H : CFGraph.{v}) +@[expose] def restrictLeftWedgeScript (G : CFGraph.{u}) (H : CFGraph.{v}) (x : G.V) (y : H.V) (σ : firingScript (vertexWedge G H x y)) : firingScript G := fun a => σ (Sum.inl a) /-- Restrict a wedge firing script to the right factor, reading the common vertex at `y`. -/ -def restrictRightWedgeScript (G : CFGraph.{u}) (H : CFGraph.{v}) +@[expose] def restrictRightWedgeScript (G : CFGraph.{u}) (H : CFGraph.{v}) (x : G.V) (y : H.V) (σ : firingScript (vertexWedge G H x y)) : firingScript H := fun b => σ (wedgeRightVertex G H x y b) @@ -854,6 +857,7 @@ def restrictRightWedgeScript (G : CFGraph.{u}) (H : CFGraph.{v}) rw [wedgeRightVertex_unmarked G H x y b.1 b.2] /-- Add a prescribed integral number of chips at a vertex. -/ +@[expose] def chipShift (G : CFGraph.{u}) (D : CFDiv G) (v : G.V) (t : ℤ) : CFDiv G := D + t • oneChip v diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/VertexWedgeGenusOne.lean b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/VertexWedgeGenusOne.lean index 638ffb5b16..88004c130c 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/VertexWedgeGenusOne.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/VertexWedgeGenusOne.lean @@ -17,7 +17,7 @@ winnability convolution. The rigidity condition is deliberately explicit: it is *not* asserted for every genus-one graph. -/ -@[expose] public section +public section namespace Utilities diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/VertexWedgePresentation.lean b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/VertexWedgePresentation.lean index a2e1d2d1c0..f25f370def 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/VertexWedgePresentation.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/VertexWedgePresentation.lean @@ -18,7 +18,7 @@ stated using edge multiplicities, so it can be used without choosing an orientation of the raw edge multisets. -/ -@[expose] public section +public section namespace Utilities @@ -52,6 +52,7 @@ variable {K : CFGraph.{w}} {G : CFGraph.{u}} {H : CFGraph.{v}} /-- The concrete vertex wedge carries its tautological presentation. Besides being useful in compositions, this witnesses that the presentation fields do not impose any unintended restrictions at the common vertex. -/ +@[expose] def canonical (G : CFGraph.{u}) (H : CFGraph.{v}) (x : G.V) (y : H.V) : VertexWedgePresentation (vertexWedge G H x y) G H x y where leftMap := Sum.inl @@ -95,6 +96,7 @@ def canonical (G : CFGraph.{u}) (H : CFGraph.{v}) (x : G.V) (y : H.V) : /-- The map from the concrete wedge vertex type into a presented ambient graph. -/ +@[expose] def map (P : VertexWedgePresentation K G H x y) : (vertexWedge G H x y).V → K.V := Sum.elim P.leftMap (fun b => P.rightMap b.1) @@ -134,6 +136,7 @@ theorem map_surjective (P : VertexWedgePresentation K G H x y) : · exact ⟨Sum.inr ⟨b, hby⟩, hb⟩ /-- The vertex equivalence induced by a wedge presentation. -/ +@[expose] noncomputable def vertexEquiv (P : VertexWedgePresentation K G H x y) : (vertexWedge G H x y).V ≃ K.V := Equiv.ofBijective P.map ⟨P.map_injective, P.map_surjective⟩ @@ -157,6 +160,7 @@ carried to the advertised ambient map. -/ /-- A wedge presentation determines an isomorphism from the concrete wedge to the ambient graph. -/ +@[expose] noncomputable def graphIso (P : VertexWedgePresentation K G H x y) : CFGraphIso (vertexWedge G H x y) K where vertexEquiv := P.vertexEquiv diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/VertexWedgeRankFormula.lean b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/VertexWedgeRankFormula.lean index 5f2e9f34d6..a646ade76f 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Gluing/VertexWedgeRankFormula.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Gluing/VertexWedgeRankFormula.lean @@ -27,7 +27,7 @@ staggered crossing of the two marked rank profiles; its one-step offset is exactly the offset required by the common chip shift on the wedge. -/ -@[expose] public section +public section namespace Utilities diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Gonality.lean b/LeanPool/BrillNoetherGraphs/Utilities/Gonality.lean index a145e98a61..e07750bce5 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Gonality.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Gonality.lean @@ -15,4 +15,4 @@ public import LeanPool.BrillNoetherGraphs.Utilities.Gonality.ReducedCertificate /-! Supporting modules for Brill–Noether theory and gonality of finite graphs. -/ -@[expose] public section +public section diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Gonality/BurnedSet.lean b/LeanPool/BrillNoetherGraphs/Utilities/Gonality/BurnedSet.lean index 572ecbbf1f..d38b627187 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Gonality/BurnedSet.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Gonality/BurnedSet.lean @@ -42,7 +42,7 @@ No algorithm, no termination proof, no fuel. `maximalLegal` is `noncomputable` and is only ever used propositionally; never `decide` it (blueprint risk R2). -/ -@[expose] public section +public section namespace Utilities.Gonality @@ -61,6 +61,7 @@ noncomputable def maximalLegal (G : CFGraph) (D : CFDiv G) (q : G.V) : /-- The burned set of `(G, D, q)`: the complement of the maximal legal set. This is what Dhar's burning algorithm computes. -/ +@[expose] noncomputable def burned (G : CFGraph) (D : CFDiv G) (q : G.V) : Finset G.V := (maximalLegal G D q)ᶜ diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Gonality/DivisorialGonality.lean b/LeanPool/BrillNoetherGraphs/Utilities/Gonality/DivisorialGonality.lean index 13ad341245..0121387e67 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Gonality/DivisorialGonality.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Gonality/DivisorialGonality.lean @@ -34,7 +34,7 @@ the bridges in both directions. the coercion of this one). -/ -@[expose] public section +public section namespace Utilities.Gonality @@ -62,11 +62,13 @@ theorem one_le_deg_of_rank_ge_one {D : CFDiv G} (hD : rank G D ≥ 1) : 1 ≤ CF /-! ## The gonality set and `divisorialGonality` -/ /-- The degrees of the effective divisors of rank at least one. -/ +@[expose] def gonalitySet (G : CFGraph) : Set ℕ := {d : ℕ | ∃ D : CFDiv G, effective D ∧ CFDiv.degree D = (d : ℤ) ∧ rank G D ≥ 1} /-- The **divisorial gonality** of `G`: the least degree of an effective divisor of rank at least one, as a natural number. -/ +@[expose] noncomputable def divisorialGonality (G : CFGraph) : ℕ := sInf (gonalitySet G) diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Gonality/GonalityTransport.lean b/LeanPool/BrillNoetherGraphs/Utilities/Gonality/GonalityTransport.lean index 0a5d049f1b..ad47b36ee1 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Gonality/GonalityTransport.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Gonality/GonalityTransport.lean @@ -45,7 +45,7 @@ per-edge counts is the unit model of a *different* metric graph `Γ(G, ℓ)`, so -/ -@[expose] public section +public section namespace Utilities.Gonality @@ -163,6 +163,7 @@ variable {n p : ℕ} /-! ## Regular subdivisions of a `Spec` -/ /-- `σ_k` of a subdivision specification: multiply every slot length by `k`. -/ +@[expose] def scale {n p : ℕ} (spec : Spec n p) (k : ℕ) (hk : 0 < k) : Spec n p where core := spec.core @@ -193,6 +194,7 @@ def scaleOneRelabeling {n p : ℕ} (spec : Spec n p) : See the module docstring for why this is neither `metricGonality` nor `stableGonality`. -/ +@[expose] noncomputable def regularSubdivisionGonality {n p : ℕ} (spec : Spec n p) : ℕ := sInf {d : ℕ | ∃ (k : ℕ) (hk : 0 < k), divisorialGonality (spec.scale k hk).graph = d} @@ -236,10 +238,12 @@ open Utilities.Certificate /-- `σ_k(G)` for an arbitrary finite loopless multigraph, built on the occurrence-safe unit subdivision presentation of `G`. -/ +@[expose] noncomputable def regularSubdivision (G : CFGraph) (k : ℕ) (hk : 0 < k) : CFGraph := ((UnitSubdivisionPresentation.spec G).scale k hk).graph /-- `min_{k ≥ 1} dgon(σ_k(G))` for an arbitrary finite loopless multigraph. -/ +@[expose] noncomputable def regularSubdivisionGonality (G : CFGraph) : ℕ := (UnitSubdivisionPresentation.spec G).regularSubdivisionGonality diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Gonality/LegalFiring.lean b/LeanPool/BrillNoetherGraphs/Utilities/Gonality/LegalFiring.lean index b4f8caead8..2e55383784 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Gonality/LegalFiring.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Gonality/LegalFiring.lean @@ -38,7 +38,7 @@ A set `U` is **legal** for `D` when firing it keeps `D` effective, i.e. `D u ≥ outdegreeSet G U u` for all `u ∈ U`. -/ -@[expose] public section +public section namespace Utilities.Gonality @@ -110,6 +110,7 @@ theorem effective_add_prin_truncate {D : CFDiv G} {x : firingScript G} /-! ## Iterated firing -/ /-- `fireChain G D U i` is the result of firing `U 0, U 1, …, U (i-1)` in turn. -/ +@[expose] def fireChain (G : CFGraph) (D : CFDiv G) (U : ℕ → Finset G.V) : ℕ → CFDiv G | 0 => D | (i + 1) => setFiring G (fireChain G D U i) (U i) diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Gonality/OrientationRank.lean b/LeanPool/BrillNoetherGraphs/Utilities/Gonality/OrientationRank.lean index 4bb23ecc28..a5630efc19 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Gonality/OrientationRank.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Gonality/OrientationRank.lean @@ -24,7 +24,7 @@ when its class contains, for each vertex `q`, a source-free orientation with also be expressed as reachability in the cycle--cocycle reversal system. -/ -@[expose] public section +public section namespace Utilities.Gonality diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Gonality/ReducedCertificate.lean b/LeanPool/BrillNoetherGraphs/Utilities/Gonality/ReducedCertificate.lean index e085374eac..cc5505bcc1 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Gonality/ReducedCertificate.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Gonality/ReducedCertificate.lean @@ -41,7 +41,7 @@ together with `D' ≥ 0 off v` and `D' v ≤ 0` `BurningOrder` quantifies over `Fin π.length` and `G.V`, both finite. -/ -@[expose] public section +public section namespace Utilities.Gonality @@ -57,6 +57,7 @@ chips than it has edges to its predecessors. Repetitions are harmless; only the *first* occurrence of each vertex matters to the soundness proof. -/ +@[expose] def BurningOrder (G : CFGraph) (D : CFDiv G) (v : G.V) (order : List G.V) : Prop := order.head? = some v ∧ (∀ w : G.V, w ∈ order) ∧ @@ -170,6 +171,7 @@ variable {D : CFDiv G} (c : RankZeroCertificate G D) def reduced : CFDiv G := D + prin G c.script /-- Everything the certificate must satisfy, as one decidable proposition. -/ +@[expose] def Valid : Prop := qEffective c.vertex c.reduced ∧ BurningOrder G c.reduced c.vertex c.order ∧ diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Grassmannian.lean b/LeanPool/BrillNoetherGraphs/Utilities/Grassmannian.lean index 4c4e525fe1..2735f1cc8e 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Grassmannian.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Grassmannian.lean @@ -15,4 +15,4 @@ public import LeanPool.BrillNoetherGraphs.Utilities.Grassmannian.OnceMarkedGonal /-! Supporting modules for Brill–Noether theory and gonality of finite graphs. -/ -@[expose] public section +public section diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Grassmannian/GrassmannianAsp.lean b/LeanPool/BrillNoetherGraphs/Utilities/Grassmannian/GrassmannianAsp.lean index 263320dcca..ffa86f1fd7 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Grassmannian/GrassmannianAsp.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Grassmannian/GrassmannianAsp.lean @@ -27,7 +27,7 @@ The exact slipface/corner-envelope theorem is completed in below. -/ -@[expose] public section +public section namespace Utilities @@ -131,6 +131,7 @@ def grassmannianAspSet (lambda : YoungDiagram) : AspSet where prop := grassmannianInvSet_prop lambda /-- The shift-zero Grassmannian ASP permutation associated to a Young diagram. -/ +@[expose] noncomputable def grassmannianPermOfYoungDiagram (lambda : YoungDiagram) : AspPerm := (grassmannianAspSet lambda).toAspPerm 0 diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Grassmannian/GrassmannianEnvelope.lean b/LeanPool/BrillNoetherGraphs/Utilities/Grassmannian/GrassmannianEnvelope.lean index 05db99aefc..08bc763a79 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Grassmannian/GrassmannianEnvelope.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Grassmannian/GrassmannianEnvelope.lean @@ -22,7 +22,7 @@ corner envelope and once-marked dictionary are unconditional facts about the explicitly reconstructed ASP permutation. -/ -@[expose] public section +public section namespace Utilities diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Grassmannian/GrassmannianExistence.lean b/LeanPool/BrillNoetherGraphs/Utilities/Grassmannian/GrassmannianExistence.lean index 9462525ca6..bd1932faa5 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Grassmannian/GrassmannianExistence.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Grassmannian/GrassmannianExistence.lean @@ -18,7 +18,7 @@ imports this file and keeps the genus-bounded consequences) so that the genus-generic transmission layer does not depend on the low-genus census. -/ -@[expose] public section +public section namespace Utilities @@ -26,6 +26,7 @@ namespace Utilities a witness. The second mark is retained because it belongs to the transmission presentation, although the Grassmannian locus depends only on the first mark up to existence. -/ +@[expose] def GrassmannianTransmissionExistence (G : CFGraph) (u v : G.V) : Prop := ∀ lambda : YoungDiagram, diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Grassmannian/GrassmannianShift.lean b/LeanPool/BrillNoetherGraphs/Utilities/Grassmannian/GrassmannianShift.lean index c1bbebcad2..80a06a4cf4 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Grassmannian/GrassmannianShift.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Grassmannian/GrassmannianShift.lean @@ -18,7 +18,7 @@ family from the shift-zero Grassmannian constructor without reconstructing its inversion set a second time. -/ -@[expose] public section +public section namespace Utilities diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Grassmannian/OnceMarked.lean b/LeanPool/BrillNoetherGraphs/Utilities/Grassmannian/OnceMarked.lean index 401aa2112e..c3c2a1bc98 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Grassmannian/OnceMarked.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Grassmannian/OnceMarked.lean @@ -27,7 +27,7 @@ The auxiliary second mark in transmission disappears because every one of these rows lies on the cut `b = 0`. -/ -@[expose] public section +public section namespace Utilities @@ -74,12 +74,14 @@ theorem youngDiagram_transpose_card (lambda : YoungDiagram) : /-- The finite pointed rank rows encoded by a Young diagram. We deliberately retain every positive row. Passing to the last row of each constant block is an optional certificate compression, not part of the semantic definition. -/ +@[expose] def onceMarkedCorners (lambda : YoungDiagram) : List Corner := lambda.rowLens.zipIdx.map fun p => ((p.2 : ℤ) - (p.1 : ℤ), 0, (p.2 : ℤ)) /-- The `i`th part of a Young diagram, extended by zero beyond its positive row list. -/ +@[expose] def onceMarkedPart (lambda : YoungDiagram) (i : ℕ) : ℕ := lambda.rowLens.getD i 0 @@ -91,6 +93,7 @@ Pflueger--Solomon divisor census. It is the pole-order inequality For a connected graph this is equivalent to the finite normalized predicate `OnceMarkedBNExists` below. -/ +@[expose] def OnceMarkedCensusContains (G : CFGraph) (u : G.V) (lambda : YoungDiagram) : Prop := ∃ D : CFDiv G, @@ -101,6 +104,7 @@ def OnceMarkedCensusContains (G : CFGraph) (u : G.V) /-- The normalized form of membership of `lambda` in the divisor census of the once-marked graph `(G,u)`. -/ +@[expose] def OnceMarkedBNExists (G : CFGraph) (u : G.V) (lambda : YoungDiagram) : Prop := ∃ D : CFDiv G, @@ -110,6 +114,7 @@ def OnceMarkedBNExists (G : CFGraph) (u : G.V) /-- Once-marked Brill--Noether existence for `(G,u)`: every Young diagram of size at most the genus occurs in its divisor census. -/ +@[expose] def OnceMarkedBNExistence (G : CFGraph) (u : G.V) : Prop := ∀ lambda : YoungDiagram, (lambda.card : ℤ) ≤ CFGraph.genus G → @@ -349,6 +354,7 @@ once-marked partition `lambda` at the cut `b = 0`. For the Grassmannian permutation attached to `lambda`, these facts follow from its essential-set formula. Packaging them separately keeps the graph side independent of the particular construction of that permutation. -/ +@[expose] def GrassmannianPartitionProfile (tau : AspPerm) (lambda : YoungDiagram) : Prop := tau.χ = 0 ∧ diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Grassmannian/OnceMarkedGonality.lean b/LeanPool/BrillNoetherGraphs/Utilities/Grassmannian/OnceMarkedGonality.lean index bfb243592d..cbed598809 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Grassmannian/OnceMarkedGonality.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Grassmannian/OnceMarkedGonality.lean @@ -55,7 +55,7 @@ at all: `deg (d • oneChip u) = d ≥ genus G + r` makes Riemann's inequality below case-splits exactly on this sign. -/ -@[expose] public section +public section namespace Utilities diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Harmonic.lean b/LeanPool/BrillNoetherGraphs/Utilities/Harmonic.lean index ee4b97656f..353c2f8927 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Harmonic.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Harmonic.lean @@ -11,4 +11,4 @@ public import LeanPool.BrillNoetherGraphs.Utilities.Harmonic.Pullback /-! Supporting modules for Brill–Noether theory and gonality of finite graphs. -/ -@[expose] public section +public section diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Harmonic/Basic.lean b/LeanPool/BrillNoetherGraphs/Utilities/Harmonic/Basic.lean index 4fd93989ff..a4029c9ca7 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Harmonic/Basic.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Harmonic/Basic.lean @@ -30,7 +30,7 @@ source vertex. Equivalence of one-chip divisors on the target transports the corresponding fibres, so the fibre has rank at least one. -/ -@[expose] public section +public section namespace MarkedGraphs @@ -193,6 +193,7 @@ def fibre (f : IndexedHarmonicData G H) (z : H.V) : CFDiv G := fun x => if f.vertexMap x = z then f.localDegree x else 0 /-- Pullback of an arbitrary target divisor using the local degrees. -/ +@[expose] def pullback (f : IndexedHarmonicData G H) (A : CFDiv H) : CFDiv G := fun x => (f.localDegree x : ℤ) * A (f.vertexMap x) @@ -537,6 +538,7 @@ theorem targetOneChipEquivalent_of_connected_genus_zero /-- Mathematical pullback compatibility, deliberately separate from the raw finite data. The unit-indexed checker implies it below; non-unit metric dilations still need a future weighted-Laplacian development. -/ +@[expose] def PullbackPrincipalCompatible (f : IndexedHarmonicData G H) : Prop := ∀ A B : CFDiv H, linearEquiv H A B → linearEquiv G (f.pullback A) (f.pullback B) diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Harmonic/Pullback.lean b/LeanPool/BrillNoetherGraphs/Utilities/Harmonic/Pullback.lean index ee941a65bf..4b9cfe589c 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Harmonic/Pullback.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Harmonic/Pullback.lean @@ -24,7 +24,7 @@ added, so the degree can be adjusted independently; only the final transmission-degree equation remains to be supplied. -/ -@[expose] public section +public section namespace MarkedGraphs diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Highlights.lean b/LeanPool/BrillNoetherGraphs/Utilities/Highlights.lean index 7aa09f2763..f75860dae3 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Highlights.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Highlights.lean @@ -47,7 +47,7 @@ it: `Tricycle/`, restated in `Tricycle/Highlights.lean`. -/ -@[expose] public section +public section namespace Utilities.Highlights diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Iso.lean b/LeanPool/BrillNoetherGraphs/Utilities/Iso.lean index 003840bc8c..c38dcefe7d 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Iso.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Iso.lean @@ -17,4 +17,4 @@ public import LeanPool.BrillNoetherGraphs.Utilities.Iso.GraphIso /-! Supporting modules for Brill–Noether theory and gonality of finite graphs. -/ -@[expose] public section +public section diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Iso/Fossil.lean b/LeanPool/BrillNoetherGraphs/Utilities/Iso/Fossil.lean index 78acc1d1fe..364b324016 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Iso/Fossil.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Iso/Fossil.lean @@ -32,7 +32,7 @@ the fossil is canonical and can therefore serve as a common target for constructions which differ only by attached trees. -/ -@[expose] public section +public section namespace Utilities @@ -44,6 +44,7 @@ universe u /-- Two vertices belong to the same fossil class when their one-chip divisors are linearly equivalent. -/ +@[expose] def chipEquivalent (G : CFGraph.{u}) (v w : G.V) : Prop := linearEquiv G (oneChip v) (oneChip w) @@ -88,6 +89,7 @@ def fossilEdge (G : CFGraph.{u}) (edge : G.V × G.V) : /-- The fossil of `G`: its degree-one Abel--Jacobi image, equivalently (when `G` is connected) its 2-edge-connectivization. It quotients vertices by one-chip divisor class and discards edge occurrences that become loops. -/ +@[expose] noncomputable def fossil (G : CFGraph.{u}) : CFGraph.{u} where V := FossilVertex G instDecidableEq := fossilVertexDecidableEq G @@ -105,6 +107,7 @@ noncomputable def fossil (G : CFGraph.{u}) : CFGraph.{u} where /-! ## Canonical contraction and divisor pushforward -/ /-- The quotient map, viewed as a graph-contraction certificate. -/ +@[expose] noncomputable def fossilContraction (G : CFGraph.{u}) : Certificate.GraphContractionCertificate G (fossil G) where vertexMap := fossilVertex G @@ -301,6 +304,7 @@ theorem fossilContraction_valid (G : CFGraph.{u}) : /-- Push a divisor to the fossil by summing its coefficients over each linear-equivalence class of vertices. -/ +@[expose] noncomputable def fossilPushforward (G : CFGraph.{u}) (D : CFDiv G) : CFDiv (fossil G) := (fossilContraction G).pushDiv D @@ -337,6 +341,7 @@ theorem effective_fossilPushforward (G : CFGraph.{u}) {D : CFDiv G} (fossilContraction G).deg_pushDiv D /-- Fibre summation, packaged as an additive homomorphism. -/ +@[expose] noncomputable def fossilPushforwardHom (G : CFGraph.{u}) : CFDiv G →+ CFDiv (fossil G) where toFun := fossilPushforward G @@ -391,6 +396,7 @@ noncomputable def fossilLift (G : CFGraph.{u}) exact (divisor_eq_sum_smul_oneChip D).symm /-- Pull a fossil firing script back to the original graph. -/ +@[expose] noncomputable def fossilPullScript (G : CFGraph.{u}) (tau : firingScript (fossil G)) : firingScript G := (fossilContraction G).pullScript tau diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Iso/FossilTopology.lean b/LeanPool/BrillNoetherGraphs/Utilities/Iso/FossilTopology.lean index a8d9f1a11b..7042837c39 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Iso/FossilTopology.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Iso/FossilTopology.lean @@ -21,7 +21,7 @@ needed by public applications: the fossil remains connected, has the same cyclomatic genus and divisorial gonality, and has no one-edge cuts or leaves. -/ -@[expose] public section +public section namespace Utilities diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Iso/GraphConstructorIso.lean b/LeanPool/BrillNoetherGraphs/Utilities/Iso/GraphConstructorIso.lean index 24b45814cd..b4ea44c8f9 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Iso/GraphConstructorIso.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Iso/GraphConstructorIso.lean @@ -18,7 +18,7 @@ uses its presentation interface so that the dependent subtype of unmarked right vertices never has to be relabelled directly. -/ -@[expose] public section +public section namespace Utilities @@ -29,6 +29,7 @@ namespace CFGraphIso variable {G : CFGraph.{u}} {G' : CFGraph.{v}} {H : CFGraph.{w}} {H' : CFGraph.{x}} /-- Relabel both factors of a separating bridge. -/ +@[expose] def bridgeGraphCongr (φ : CFGraphIso G G') (ψ : CFGraphIso H H') (a : G.V) (b : H.V) : CFGraphIso (bridgeGraph G H a b) @@ -71,6 +72,7 @@ def bridgeGraphCongr (φ : CFGraphIso G G') (ψ : CFGraphIso H H') (bridgeGraphCongr φ ψ a b).vertexEquiv (Sum.inr y) = Sum.inr (ψ.vertexEquiv y) := rfl /-- A presentation of the relabelled wedge by the original two factors. -/ +@[expose] noncomputable def vertexWedgeCongrPresentation (φ : CFGraphIso G G') (ψ : CFGraphIso H H') (a : G.V) (b : H.V) : @@ -120,6 +122,7 @@ noncomputable def vertexWedgeCongrPresentation simp [φ.vertexEquiv.apply_eq_iff_eq, ψ.map_num_edges] /-- Relabel both factors of a vertex wedge. -/ +@[expose] noncomputable def vertexWedgeCongr (φ : CFGraphIso G G') (ψ : CFGraphIso H H') (a : G.V) (b : H.V) : CFGraphIso (vertexWedge G H a b) diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Iso/GraphContraction.lean b/LeanPool/BrillNoetherGraphs/Utilities/Iso/GraphContraction.lean index 326a07996f..e7e1983079 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Iso/GraphContraction.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Iso/GraphContraction.lean @@ -23,7 +23,7 @@ source to the target. It does **not** assert that arbitrary divisor rank is preserved by contraction. -/ -@[expose] public section +public section namespace Utilities.Certificate @@ -47,6 +47,7 @@ Laplacian-preserving relabeling. The quotient target is left unchanged. This is a change of names on source vertices, not a rank-transport claim through a contraction. -/ +@[expose] def precomposeLaplacianEquiv {G' : CFGraph.{w}} (c : GraphContractionCertificate G H) (equivalence : LaplacianEquiv G' G) : GraphContractionCertificate G' H where @@ -61,6 +62,7 @@ def precomposeLaplacianEquiv {G' : CFGraph.{w}} /-- Reindex the target of a contraction certificate along a checked Laplacian-preserving relabeling. This only changes the names of quotient vertices; it is not a claim that rank descends through a contraction. -/ +@[expose] def postcomposeLaplacianEquiv {H' : CFGraph.{w}} (c : GraphContractionCertificate G H) (equivalence : LaplacianEquiv H H') : GraphContractionCertificate G H' where @@ -75,6 +77,7 @@ def postcomposeLaplacianEquiv {H' : CFGraph.{w}} /-- The exact quotient condition. It is imposed only for distinct target vertices: source edges internal to one fibre are precisely the edges which are contracted, so no equation is required on the diagonal. -/ +@[expose] def Valid (c : GraphContractionCertificate G H) : Prop := Function.Surjective c.vertexMap ∧ ∀ a b : H.V, a ≠ b → @@ -178,10 +181,12 @@ def check (c : GraphContractionCertificate G H) : Bool := exact and_congr (@decide_eq_true_eq (Function.Surjective c.vertexMap) _).to_iff Iff.rfl /-- Push a divisor forward by summing it over fibres. -/ +@[expose] def pushDiv (c : GraphContractionCertificate G H) (D : CFDiv G) : CFDiv H := fun b => ∑ x : G.V, if c.vertexMap x = b then D x else 0 /-- Pull a firing script back by composition with the quotient map. -/ +@[expose] def pullScript (c : GraphContractionCertificate G H) (tau : firingScript H) : firingScript G := fun x => tau (c.vertexMap x) diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Iso/GraphContractionEuler.lean b/LeanPool/BrillNoetherGraphs/Utilities/Iso/GraphContractionEuler.lean index 490d338311..401a17d55c 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Iso/GraphContractionEuler.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Iso/GraphContractionEuler.lean @@ -26,7 +26,7 @@ count. Keeping this boundary explicit avoids silently treating arbitrary quotients as rank-preserving contractions. -/ -@[expose] public section +public section namespace Utilities.Certificate @@ -40,6 +40,7 @@ variable {G : CFGraph.{u}} {H : CFGraph.{v}} /-- The total directed multiplicity of source edges which stay inside one vertex fibre. -/ +@[expose] def internalDirectedMultiplicity (c : GraphContractionCertificate G H) : ℤ := ∑ x : G.V, ∑ y : G.V, if c.vertexMap x = c.vertexMap y then (numEdges G x y : ℤ) else 0 @@ -51,6 +52,7 @@ def externalDirectedMultiplicity (c : GraphContractionCertificate G H) : ℤ := if c.vertexMap x ≠ c.vertexMap y then (numEdges G x y : ℤ) else 0 /-- The vertices in one contraction fibre. -/ +@[expose] def fibreVertices (c : GraphContractionCertificate G H) (target : H.V) : Finset G.V := Finset.univ.filter fun x => c.vertexMap x = target @@ -61,6 +63,7 @@ theorem fibreVertices_nonempty (c : GraphContractionCertificate G H) exact ⟨x, by simp [fibreVertices, hx]⟩ /-- The actual induced graph carried by a contraction fibre. -/ +@[expose] noncomputable def fibreGraph (c : GraphContractionCertificate G H) (hValid : c.Valid) (target : H.V) : CFGraph := inducedSubgraph G (c.fibreVertices target) (c.fibreVertices_nonempty hValid target) diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Iso/GraphContractionFibreTree.lean b/LeanPool/BrillNoetherGraphs/Utilities/Iso/GraphContractionFibreTree.lean index b421b64f56..803c88d654 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Iso/GraphContractionFibreTree.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Iso/GraphContractionFibreTree.lean @@ -26,7 +26,7 @@ the fibre edge multisets, equality of source and target genus forces equality in this bound fibre by fibre. -/ -@[expose] public section +public section namespace Utilities diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Iso/GraphContractionTopology.lean b/LeanPool/BrillNoetherGraphs/Utilities/Iso/GraphContractionTopology.lean index d4a424057d..f713f74a58 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Iso/GraphContractionTopology.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Iso/GraphContractionTopology.lean @@ -23,7 +23,7 @@ multiplicities alone do not prevent a certificate from identifying two disconnected pieces of the source graph. -/ -@[expose] public section +public section namespace Utilities.Certificate @@ -38,6 +38,7 @@ variable {G : CFGraph.{u}} {H : CFGraph.{v}} /-- The fibre over `target` is connected, expressed by finite cuts of the ambient source graph. Only cuts which split that fibre need be crossed, and the crossing edge is required to remain inside the fibre. -/ +@[expose] def FibreConnectedAt (c : GraphContractionCertificate G H) (target : H.V) : Prop := ∀ S : Finset G.V, (∃ inside outside : G.V, @@ -48,6 +49,7 @@ def FibreConnectedAt (c : GraphContractionCertificate G H) (target : H.V) : Prop numEdges G inside outside > 0 /-- Every vertex fibre is connected. -/ +@[expose] def ConnectedFibres (c : GraphContractionCertificate G H) : Prop := ∀ target : H.V, c.FibreConnectedAt target @@ -68,6 +70,7 @@ def connectedFibresCheck (c : GraphContractionCertificate G H) : Bool := simp [connectedFibresCheck, ConnectedFibres, FibreConnectedAt] /-- A quotient certificate whose fibres are actual connected subgraphs. -/ +@[expose] def TopologicalValid (c : GraphContractionCertificate G H) : Prop := c.Valid ∧ c.ConnectedFibres diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Iso/GraphIso.lean b/LeanPool/BrillNoetherGraphs/Utilities/Iso/GraphIso.lean index f36472897c..04ba5a5223 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Iso/GraphIso.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Iso/GraphIso.lean @@ -17,7 +17,7 @@ the orientation chosen for pairs in the raw edge multiset: `numEdges` is the mathematical graph structure used by chip firing. -/ -@[expose] public section +public section namespace Utilities @@ -36,12 +36,13 @@ namespace CFGraphIso variable {G : CFGraph.{u}} {H : CFGraph.{v}} {K : CFGraph.{w}} /-- The identity graph isomorphism. -/ +@[expose] def refl (G : CFGraph.{u}) : CFGraphIso G G where vertexEquiv := Equiv.refl G.V map_num_edges := by simp /-- The inverse of a graph isomorphism. -/ -def symm (φ : CFGraphIso G H) : CFGraphIso H G where +@[expose] def symm (φ : CFGraphIso G H) : CFGraphIso H G where vertexEquiv := φ.vertexEquiv.symm map_num_edges := by intro x y @@ -49,7 +50,7 @@ def symm (φ : CFGraphIso G H) : CFGraphIso H G where (φ.map_num_edges (φ.vertexEquiv.symm x) (φ.vertexEquiv.symm y)).symm /-- The composite of graph isomorphisms. -/ -def trans (φ : CFGraphIso G H) (ψ : CFGraphIso H K) : CFGraphIso G K where +@[expose] def trans (φ : CFGraphIso G H) (ψ : CFGraphIso H K) : CFGraphIso G K where vertexEquiv := φ.vertexEquiv.trans ψ.vertexEquiv map_num_edges := by intro x y @@ -58,7 +59,7 @@ def trans (φ : CFGraphIso G H) (ψ : CFGraphIso H K) : CFGraphIso G K where /-- Relabel an integer-valued vertex function along a graph isomorphism. This is used for both divisors and firing scripts. -/ -def mapDiv (φ : CFGraphIso G H) : CFDiv G ≃+ CFDiv H := +@[expose] def mapDiv (φ : CFGraphIso G H) : CFDiv G ≃+ CFDiv H := AddEquiv.arrowCongr φ.vertexEquiv (AddEquiv.refl ℤ) /-- Relabeling a firing script is the same additive equivalence as relabeling diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Pseudocore.lean b/LeanPool/BrillNoetherGraphs/Utilities/Pseudocore.lean index 3032da73b7..8babed195e 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Pseudocore.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Pseudocore.lean @@ -16,4 +16,4 @@ public import LeanPool.BrillNoetherGraphs.Utilities.Pseudocore.PseudocoreSubdivi /-! Supporting modules for Brill–Noether theory and gonality of finite graphs. -/ -@[expose] public section +public section diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Pseudocore/GenusFourPseudocore.lean b/LeanPool/BrillNoetherGraphs/Utilities/Pseudocore/GenusFourPseudocore.lean index 2eea31f65b..f665e84203 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Pseudocore/GenusFourPseudocore.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Pseudocore/GenusFourPseudocore.lean @@ -31,7 +31,7 @@ marker counts, looplessness, core connectivity, and every unordered edge multiplicity are all replayed by finite Boolean folds. -/ -@[expose] public section +public section namespace Utilities.Certificate.GenusFourPseudocore @@ -51,24 +51,29 @@ namespace Pseudocore variable {n : ℕ} (core : Pseudocore n) /-- Total number of semantic loop occurrences. -/ +@[expose] def loopCount : ℕ := ∑ vertex : Fin n, core.loops vertex /-- Number of nonloop edge occurrences, counted in the strict upper triangle. -/ +@[expose] def nonloopEdgeCount : ℕ := ∑ first : Fin n, ∑ second : Fin n, if first < second then core.multiplicity first second else 0 /-- Total number of topological edge occurrences. -/ +@[expose] def edgeCount : ℕ := core.loopCount + core.nonloopEdgeCount /-- Loop-aware valence: a loop contributes two and a nonloop occurrence one. -/ +@[expose] def valence (vertex : Fin n) : ℕ := 2 * core.loops vertex + ∑ neighbor : Fin n, core.multiplicity vertex neighbor /-- The redundant multiplicity matrix really represents unordered nonloops. -/ +@[expose] def MatrixWellFormed : Prop := (∀ vertex : Fin n, core.multiplicity vertex vertex = 0) ∧ ∀ first second : Fin n, @@ -76,6 +81,7 @@ def MatrixWellFormed : Prop := /-- Connectedness of the nonloop support, in the same cut form used by `graphConnected`. Semantic loops do not cross cuts. -/ +@[expose] def Connected : Prop := ∀ S : Finset (Fin n), (∃ inside outside : Fin n, inside ∈ S ∧ outside ∉ S) → @@ -83,6 +89,7 @@ def Connected : Prop := 0 < core.multiplicity inside outside /-- Every topological vertex has valence at least three. -/ +@[expose] def Stable : Prop := ∀ vertex : Fin n, 3 ≤ core.valence vertex @@ -90,6 +97,7 @@ def Stable : Prop := The edge equation is written without truncated natural subtraction, so it is the exact Euler-characteristic identity at every genus. -/ +@[expose] def ValidAt (g : ℕ) : Prop := core.MatrixWellFormed ∧ core.Connected ∧ @@ -97,6 +105,7 @@ def ValidAt (g : ℕ) : Prop := core.edgeCount + 1 = n + g /-- Backwards-compatible genus-four specialization of `ValidAt`. -/ +@[expose] def Valid : Prop := core.ValidAt 4 @@ -187,6 +196,7 @@ theorem vertexCount_pos_of_valid (hValid : core.Valid) : 0 < n := by /-- Number of edge slots after replacing each semantic loop by two parallel edges from its base vertex to a fresh marker. -/ +@[expose] def splitEdgeCount : ℕ := core.nonloopEdgeCount + 2 * core.loopCount @@ -197,6 +207,7 @@ theorem splitEdgeCount_eq_edgeCount_add_loopCount : omega /-- Cyclomatic genus of the loopless split incidence data. -/ +@[expose] def splitTopologicalGenus : ℤ := (core.splitEdgeCount : ℤ) - (n + core.loopCount : ℕ) + 1 @@ -215,15 +226,18 @@ theorem splitTopologicalGenus_eq_four (hValid : core.Valid) : core.splitTopologicalGenus_eq hValid /-- Original base vertices occupy the left summand of the split vertex type. -/ +@[expose] def baseVertex (vertex : Fin n) : Fin (n + core.loopCount) := Fin.castAdd core.loopCount vertex /-- Loop markers occupy the right summand of the split vertex type. -/ +@[expose] def markerVertex (marker : Fin core.loopCount) : Fin (n + core.loopCount) := Fin.natAdd n marker /-- Unordered edge multiplicity of an ordered-slot explicit-potential core. -/ +@[expose] def explicitCoreMultiplicity {vertexCount edgeCount : ℕ} (splitCore : ExplicitPotential.Core vertexCount edgeCount) (first second : Fin vertexCount) : ℕ := @@ -247,11 +261,13 @@ namespace SplitMetadata variable {core : Pseudocore n} (data : SplitMetadata core) /-- Number of displayed markers attached to a base vertex. -/ +@[expose] def markerMultiplicity (vertex : Fin n) : ℕ := (Finset.univ.filter fun marker : Fin core.loopCount => data.markerBase marker = vertex).card /-- Expected split multiplicity between two displayed split vertices. -/ +@[expose] def expectedMultiplicity (first second : Fin (n + core.loopCount)) : ℕ := match (@finSumFinEquiv n core.loopCount).symm first, @@ -266,6 +282,7 @@ def expectedMultiplicity /-- Exact mathematical relation between loop-aware data and its displayed loopless ordered-slot split core at genus `g`. -/ +@[expose] def ValidAt (g : ℕ) : Prop := core.ValidAt g ∧ (∀ vertex : Fin n, @@ -279,6 +296,7 @@ def ValidAt (g : ℕ) : Prop := /-- Backwards-compatible genus-four specialization of `SplitMetadata.ValidAt`. -/ +@[expose] def Valid : Prop := data.ValidAt 4 diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Pseudocore/PseudocoreCompatible.lean b/LeanPool/BrillNoetherGraphs/Utilities/Pseudocore/PseudocoreCompatible.lean index 7043cc373a..fdd9695d38 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Pseudocore/PseudocoreCompatible.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Pseudocore/PseudocoreCompatible.lean @@ -19,7 +19,7 @@ The marker-fibre counting lemma below supports comparison of two compatible presentations. -/ -@[expose] public section +public section namespace Utilities.Certificate.PseudocoreSplitGlue diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Pseudocore/PseudocoreMarkerCut.lean b/LeanPool/BrillNoetherGraphs/Utilities/Pseudocore/PseudocoreMarkerCut.lean index fa0bb057ee..724dbfd44f 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Pseudocore/PseudocoreMarkerCut.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Pseudocore/PseudocoreMarkerCut.lean @@ -18,7 +18,7 @@ vertex, by two parallel slot occurrences. The two vertices therefore form a canonical genus-one side of a core vertex cut. -/ -@[expose] public section +public section namespace Utilities.Certificate.PseudocoreMarkerCut diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Pseudocore/PseudocoreMarkerWedge.lean b/LeanPool/BrillNoetherGraphs/Utilities/Pseudocore/PseudocoreMarkerWedge.lean index 9f8c732c73..4feb8b430a 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Pseudocore/PseudocoreMarkerWedge.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Pseudocore/PseudocoreMarkerWedge.lean @@ -22,7 +22,7 @@ the genus-five loop-aware normal-form interface: the complementary graph is the left (base) factor and the marker cycle is the right factor. -/ -@[expose] public section +public section namespace Utilities.Certificate.PseudocoreMarkerWedge open ExplicitPotential @@ -79,18 +79,21 @@ noncomputable def cut (marker : Fin core.loopCount) /-- The base graph remaining on the right side of the cut after separating the selected loop marker. -/ +@[expose] noncomputable def base (marker : Fin core.loopCount) (hCore : spec.core = split.splitCore) (hCompatible : PseudocoreSplitGlue.Compatible split) : CFGraph := (cut split spec marker hCore hCompatible).rightGraph /-- The left factor isolated by the selected loop-marker cut. -/ +@[expose] noncomputable def factor (marker : Fin core.loopCount) (hCore : spec.core = split.splitCore) (hCompatible : PseudocoreSplitGlue.Compatible split) : CFGraph := (cut split spec marker hCore hCompatible).leftGraph /-- The glue vertex in the base graph where the separated marker factor is attached. -/ +@[expose] noncomputable def attachment (marker : Fin core.loopCount) (hCore : spec.core = split.splitCore) (hCompatible : PseudocoreSplitGlue.Compatible split) : @@ -98,6 +101,7 @@ noncomputable def attachment (marker : Fin core.loopCount) (cut split spec marker hCore hCompatible).rightGlue /-- The corresponding root vertex in the separated marker factor. -/ +@[expose] noncomputable def root (marker : Fin core.loopCount) (hCore : spec.core = split.splitCore) (hCompatible : PseudocoreSplitGlue.Compatible split) : @@ -105,6 +109,7 @@ noncomputable def root (marker : Fin core.loopCount) (cut split spec marker hCore hCompatible).leftGlue /-- The wedge isomorphism in base-first orientation. -/ +@[expose] noncomputable def wedgeIso (marker : Fin core.loopCount) (hCore : spec.core = split.splitCore) (hCompatible : PseudocoreSplitGlue.Compatible split) : @@ -151,6 +156,7 @@ theorem base_genus (marker : Fin core.loopCount) /-- Compose a presentation of `G` by the split subdivision with the base-first marker wedge isomorphism. -/ +@[expose] noncomputable def wedgeEquiv {G : CFGraph} (marker : Fin core.loopCount) (hCore : spec.core = split.splitCore) (hCompatible : PseudocoreSplitGlue.Compatible split) @@ -259,7 +265,7 @@ theorem restricted_second_factor_rigid change flatten.vertexEquiv.symm secondCut.leftGlue = restricted.leftGlue apply flatten.vertexEquiv.injective rw [Equiv.apply_symm_apply] - exact firstCut.restrictRightLeftIso_apply_leftGlue secondCut hSubset + exact (firstCut.restrictRightLeftIso_apply_leftGlue secondCut hSubset).symm rw [hRoot] at hTransported exact hTransported diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Pseudocore/PseudocorePresentation.lean b/LeanPool/BrillNoetherGraphs/Utilities/Pseudocore/PseudocorePresentation.lean index 349d7f9f3d..46cff9a8d4 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Pseudocore/PseudocorePresentation.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Pseudocore/PseudocorePresentation.lean @@ -39,7 +39,7 @@ vertex/unit-step bijection has to be built by hand: the split's own `canonicalSplitLaplacianEquiv` supplies it. -/ -@[expose] public section +public section namespace Utilities.Certificate.PseudocorePresentation open Finset @@ -87,6 +87,7 @@ def slotEnds {n p : ℕ} (core : Core n p) (vertex : Fin n) : if x.2 then core.head x.1 = vertex else core.tail x.1 = vertex /-- Core valence: the number of slot ends at a core vertex. -/ +@[expose] def slotValence {n p : ℕ} (core : Core n p) (vertex : Fin n) : ℕ := (slotEnds core vertex).card diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Pseudocore/PseudocoreRelabeling.lean b/LeanPool/BrillNoetherGraphs/Utilities/Pseudocore/PseudocoreRelabeling.lean index e7cff22083..aaba06647b 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Pseudocore/PseudocoreRelabeling.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Pseudocore/PseudocoreRelabeling.lean @@ -26,7 +26,7 @@ Three ingredients, all generic in the vertex count: the classifier to one generated tree per *sorted* degree sequence. -/ -@[expose] public section +public section namespace Utilities.Certificate.GenusFourPseudocore @@ -36,6 +36,7 @@ variable {n : ℕ} /-- Transport of a pseudocore along a vertex permutation: vertex `v` of the relabeled pseudocore carries the data of vertex `σ v`. -/ +@[expose] def relabel (core : Pseudocore n) (σ : Equiv.Perm (Fin n)) : Pseudocore n where loops := fun v => core.loops (σ v) multiplicity := fun v w => core.multiplicity (σ v) (σ w) diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Pseudocore/PseudocoreSubdivisionProperties.lean b/LeanPool/BrillNoetherGraphs/Utilities/Pseudocore/PseudocoreSubdivisionProperties.lean index 077d1dd6ae..7a23608841 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Pseudocore/PseudocoreSubdivisionProperties.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Pseudocore/PseudocoreSubdivisionProperties.lean @@ -18,7 +18,7 @@ the low-genus normalizers: connectedness, genus, and leaflessness of every positive subdivision. -/ -@[expose] public section +public section namespace Utilities.Certificate.PseudocoreSubdivisionProperties open Utilities diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Segments.lean b/LeanPool/BrillNoetherGraphs/Utilities/Segments.lean index 7708586d10..83e47a4186 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Segments.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Segments.lean @@ -14,4 +14,4 @@ public import LeanPool.BrillNoetherGraphs.Utilities.Segments.SegmentReflection /-! Supporting modules for Brill–Noether theory and gonality of finite graphs. -/ -@[expose] public section +public section diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Segments/AtanasovRanganathan.lean b/LeanPool/BrillNoetherGraphs/Utilities/Segments/AtanasovRanganathan.lean index 6d051d7762..77fe7e92b2 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Segments/AtanasovRanganathan.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Segments/AtanasovRanganathan.lean @@ -20,7 +20,7 @@ vertices outside the support. Their seven pictured configurations are local ways to establish precisely the remaining `Reaches` hypotheses below. -/ -@[expose] public section +public section namespace AtanasovRanganathan diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Segments/AtanasovRanganathanConfigurations.lean b/LeanPool/BrillNoetherGraphs/Utilities/Segments/AtanasovRanganathanConfigurations.lean index cad3f3d205..6b83e39aea 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Segments/AtanasovRanganathanConfigurations.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Segments/AtanasovRanganathanConfigurations.lean @@ -34,7 +34,7 @@ picture, or Core 095, has been encoded. It gives the reusable checked moves to which such incidence data must eventually be connected. -/ -@[expose] public section +public section namespace AtanasovRanganathan.Configurations @@ -138,6 +138,7 @@ theorem bnExists_one_three_of_dharMoves_off_support /-- The degree-three divisor used throughout the genus-four pictures. The three vertices need not be distinct. -/ +@[expose] def threeChipDivisor (first second third : G.V) : CFDiv G := oneChip first + oneChip second + oneChip third @@ -276,6 +277,7 @@ end MovingDivisor /-- An exact reflection starting with one chip at each of two endpoints. The second output chip is allowed to coincide with the requested target. -/ +@[expose] def TwoEndpointReflection (left right target : G.V) : Prop := ∃ (reflected : G.V) (script : firingScript G), prin G script = @@ -328,6 +330,7 @@ variable {n p : ℕ} (spec : SubdivisionGraph.Spec n p) /-- Exact geometric obligation for a subdivided segment: its two endpoint chips reflect to a named path position and one further effective chip. -/ +@[expose] def ReflectsTo (edge : Fin p) (position : spec.PathPosition edge) : Prop := TwoEndpointReflection (G := spec.graph) (spec.coreVertex (spec.core.tail edge)) diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Segments/GenusFourLoopLemma.lean b/LeanPool/BrillNoetherGraphs/Utilities/Segments/GenusFourLoopLemma.lean index 6ee0fad376..2c88d4e455 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Segments/GenusFourLoopLemma.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Segments/GenusFourLoopLemma.lean @@ -32,7 +32,7 @@ the reflection move uniformly for two subdivided paths of arbitrary positive lengths. Neither assertion is silently delegated to generated data here. -/ -@[expose] public section +public section namespace Utilities.Certificate.GenusFourLoopLemma @@ -44,6 +44,7 @@ variable {G : CFGraph} /-- The divisor class of `D` has an effective representative carrying two chips at `base`. This is the exact pointed input needed to enter an attached topological loop. -/ +@[expose] def HasTwoChipsRepresentative (D : CFDiv G) (base : G.V) : Prop := ∃ E : CFDiv G, effective E ∧ linearEquiv G D E ∧ 2 ≤ E base diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Segments/SeamCalculus.lean b/LeanPool/BrillNoetherGraphs/Utilities/Segments/SeamCalculus.lean index d226d177e4..22087a71bb 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Segments/SeamCalculus.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Segments/SeamCalculus.lean @@ -98,7 +98,7 @@ What the library **lacks**, and how it is handled here: below is proved outright from the library's API. -/ -@[expose] public section +public section open Finset @@ -289,14 +289,17 @@ lemma winnable_sub_one_chip_iff_of_qReduced {q : H.V} {D : CFDiv H} /-! ## Scripts, twists and displacements -/ /-- The `m`-th seam twist `C + m • α` of the base divisor `C`. -/ +@[expose] def seamTwist (C : CFDiv H) (x y : H.V) (m : ℤ) : CFDiv H := C + m • seamDivisor x y /-- The displacement `t(f) = f x - f y` of a firing script. -/ +@[expose] def displacement (x y : H.V) (f : firingScript H) : ℤ := f x - f y /-- `t` is a displacement of the `m`-twist: some script puts the `m`-twist into effective position with displacement `t`. -/ +@[expose] def IsDisplacement (C : CFDiv H) (x y : H.V) (m t : ℤ) : Prop := ∃ f : firingScript H, effective (seamTwist C x y m + prin H f) ∧ displacement x y f = t diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Segments/SegmentReflection.lean b/LeanPool/BrillNoetherGraphs/Utilities/Segments/SegmentReflection.lean index 75eeb3256a..24522ef0a1 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Segments/SegmentReflection.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Segments/SegmentReflection.lean @@ -18,7 +18,7 @@ so extending it by zero away from the chosen subdivision slot creates no unwanted firing across the rest of the core. -/ -@[expose] public section +public section namespace Utilities @@ -29,6 +29,7 @@ open Certificate open Certificate.SubdivisionGraph /-- The path position symmetric to `position` under reversal of the slot. -/ +@[expose] def symmetricPosition {n p : ℕ} (spec : SubdivisionGraph.Spec n p) (edge : Fin p) (position : spec.PathPosition edge) : spec.PathPosition edge := @@ -51,6 +52,7 @@ def value (length position i : ℕ) : ℤ := else (i : ℤ) - (length : ℤ) /-- The oriented slope after numerical path position `i`. -/ +@[expose] def slope (length position i : ℕ) : ℤ := if i < min position (length - position) then -1 else if max position (length - position) ≤ i then 1 @@ -103,6 +105,7 @@ theorem slope_divergence {length position j : ℕ} /-- Extend the plateau potential by zero over every core vertex and every other subdivision slot. -/ +@[expose] def script {n p : ℕ} (spec : SubdivisionGraph.Spec n p) (edge : Fin p) (position : spec.PathPosition edge) : firingScript spec.graph diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision.lean index 78311c19a0..1b057e144e 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision.lean @@ -100,4 +100,4 @@ public import LeanPool.BrillNoetherGraphs.Utilities.Subdivision.WindowProfileRea /-! Supporting modules for Brill–Noether theory and gonality of finite graphs. -/ -@[expose] public section +public section diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/AffineCover.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/AffineCover.lean index fdb2062a3f..175205e622 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/AffineCover.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/AffineCover.lean @@ -38,7 +38,7 @@ This layer deliberately gives no graph, subdivision, or divisor semantics to the cones. Those belong in a separate local-certificate checker. -/ -@[expose] public section +public section namespace Utilities.Certificate.AffineCover @@ -48,6 +48,7 @@ open Finset /-- Boolean universal quantification over `Fin k`, implemented as a list fold rather than a proof-producing `Decidable` computation. -/ +@[expose] def allFin {k : ℕ} (test : Fin k → Bool) : Bool := (List.ofFn test).all id @@ -58,6 +59,7 @@ def allFin {k : ℕ} (test : Fin k → Bool) : Bool := /-- Boolean universal quantification over an arbitrary finite set. `Finset.fold` keeps kernel evaluation proof-free even when the element type itself is a finite combinatorial object such as `Finset (Fin n)`. -/ +@[expose] def allFinset {α : Type*} (elements : Finset α) (test : α → Bool) : Bool := elements.fold (fun left right => left && right) true test @@ -94,6 +96,7 @@ instance : Zero (AffineForm m) where this avoids asking `Decidable` to construct an equality proof between two function-valued coefficient fields while a large generated certificate is being reduced by the kernel. -/ +@[expose] def equal (left right : AffineForm m) : Bool := decide (left.fixedValue = right.fixedValue) && allFin fun coordinate => @@ -120,6 +123,7 @@ def equal (left right : AffineForm m) : Bool := simp [equal] /-- Proof-free list membership for integral affine forms. -/ +@[expose] def mem (form : AffineForm m) (forms : List (AffineForm m)) : Bool := forms.any fun candidate => equal form candidate @@ -129,10 +133,12 @@ def mem (form : AffineForm m) (forms : List (AffineForm m)) : Bool := simp [mem] /-- Evaluation of an integral affine form at an integral point. -/ +@[expose] def eval (form : AffineForm m) (point : Fin m → ℤ) : ℤ := form.fixedValue + ∑ i, form.coefficient i * point i /-- The closed integral inequality represented by an affine form. -/ +@[expose] def Holds (form : AffineForm m) (point : Fin m → ℤ) : Prop := 0 ≤ form.eval point @@ -140,6 +146,7 @@ def Holds (form : AffineForm m) (point : Fin m → ℤ) : Prop := If `a(x) >= 0` fails and `a(x)` is integral, then `a(x) <= -1`, equivalently `-a(x)-1 >= 0`. -/ +@[expose] def violation (form : AffineForm m) : AffineForm m where fixedValue := -form.fixedValue - 1 coefficient := fun i => -form.coefficient i @@ -176,11 +183,13 @@ end AffineForm /-- A finite conjunction of affine inequalities. This is used for base regions and for individual proof cones. -/ +@[expose] def FormsHold {m : ℕ} (forms : List (AffineForm m)) (point : Fin m → ℤ) : Prop := ∀ form ∈ forms, form.Holds point /-- A family of cones covers a base region at every integral point. -/ +@[expose] def Covers {m : ℕ} (base : List (AffineForm m)) (cones : List (List (AffineForm m))) : Prop := ∀ point : Fin m → ℤ, FormsHold base point → @@ -207,6 +216,7 @@ namespace FarkasData variable {m : ℕ} /-- Look up an affine row, returning the zero form when the index is out of range. -/ +@[expose] def rowAt (rows : List (AffineForm m)) (index : ℕ) : AffineForm m := rows.getD index 0 @@ -231,6 +241,7 @@ def Valid (data : FarkasData) (rows : List (AffineForm m)) : Prop := /-- Whether every sparse multiplier is integral. External emitters may always clear denominators within one homogeneous Farkas contradiction. -/ +@[expose] def integralWeights (data : FarkasData) : Bool := data.terms.all fun term => decide (term.weight.den = 1) @@ -240,12 +251,14 @@ def integralWeights (data : FarkasData) : Bool := simp [integralWeights, List.all_eq_true] /-- Integer coefficient sum used by the kernel-reduction fast path. -/ +@[expose] def coefficientSumInt (data : FarkasData) (rows : List (AffineForm m)) (coordinate : Fin m) : ℤ := (data.terms.map fun term => term.weight.num * (rowAt rows term.row).coefficient coordinate).sum /-- Integer constant sum used by the kernel-reduction fast path. -/ +@[expose] def constantSumInt (data : FarkasData) (rows : List (AffineForm m)) : ℤ := (data.terms.map fun term => term.weight.num * (rowAt rows term.row).fixedValue).sum @@ -253,6 +266,7 @@ def constantSumInt (data : FarkasData) (rows : List (AffineForm m)) : ℤ := /-- Proof-free arithmetic replay for a leaf whose multipliers have denominator one. Unlike rational multiplication and addition, these integer operations are transparent to ordinary kernel reduction. -/ +@[expose] def integralCheck (data : FarkasData) (rows : List (AffineForm m)) : Bool := (data.terms.all fun term => @@ -400,6 +414,7 @@ private theorem rationalCheck_eq_true_iff (data : FarkasData) /-- Executable exact checker for a Farkas leaf. Integral multipliers take a kernel-transparent fast path; arbitrary rationals retain the original exact checker. -/ +@[expose] def check (data : FarkasData) (rows : List (AffineForm m)) : Bool := match data.integralWeights with | true => data.integralCheck rows @@ -512,16 +527,19 @@ namespace CoverTree variable {m : ℕ} /-- Look up a cone in the cover table, returning an empty cone for an out-of-range index. -/ +@[expose] def coneAt (cones : List (List (AffineForm m))) (index : ℕ) : List (AffineForm m) := cones.getD index [] /-- Look up an affine constraint in a cone, returning the zero form for an out-of-range index. -/ +@[expose] def formAt (cone : List (AffineForm m)) (index : ℕ) : AffineForm m := cone.getD index 0 /-- Mathematical validity of a contradiction tree under the currently active affine rows. -/ +@[expose] def Valid (cones : List (List (AffineForm m))) (active : List (AffineForm m)) : CoverTree m → Prop | .leaf farkas => farkas.Valid active @@ -853,6 +871,7 @@ def form2 (fixedValue a b : ℤ) : AffineForm 2 where /-- The two cones `x-y >= 1` and `y-x >= 0`. Their use of constants `-1` and `0` is the strict integer partition required by the C kernel grammar. -/ +@[expose] def strictPartitionCones : List (List (AffineForm 2)) := [ [form2 (-1) 1 (-1)], [form2 0 (-1) 1] @@ -860,6 +879,7 @@ def strictPartitionCones : List (List (AffineForm 2)) := [ /-- If both one-row cones were violated, the active rows would be `x-y-1 >= 0` and `y-x >= 0`; adding them gives `-1 >= 0`. -/ +@[expose] def strictPartitionTree : CoverTree 2 := .branch 0 1 fun _ => .branch 1 1 fun _ => diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/AffineCoverData.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/AffineCoverData.lean index 83ec7b5411..d678922d30 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/AffineCoverData.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/AffineCoverData.lean @@ -23,7 +23,7 @@ converted to the already-proved `CoverTree` checker. An emitter may use any easy upper bound on tree depth, such as the number of witness commands. -/ -@[expose] public section +public section namespace Utilities.Certificate.AffineCover open Utilities.Certificate @@ -85,6 +85,7 @@ def ValidActive {m : ℕ} /-- Direct Boolean replay of list-backed data. This deliberately fuses decoding and checking: generated trees remain ordinary lists all the way down, so kernel reduction never materializes a large function-backed tree. -/ +@[expose] def checkActive {m : ℕ} (cones : List (List (AffineForm m))) (active : List (AffineForm m)) : ℕ → CoverTreeData → Bool @@ -111,12 +112,14 @@ def checkActive {m : ℕ} /-- Propositional validity of list-backed data, stated directly on the passive representation checked by the kernel. -/ +@[expose] def Valid {m : ℕ} (data : CoverTreeData) (fuel : ℕ) (base : List (AffineForm m)) (cones : List (List (AffineForm m))) : Prop := ValidActive cones base fuel data /-- Executable checker for list-backed covering data. -/ +@[expose] def check {m : ℕ} (data : CoverTreeData) (fuel : ℕ) (base : List (AffineForm m)) (cones : List (List (AffineForm m))) : Bool := @@ -245,6 +248,7 @@ open Utilities.Certificate.AffineCover.Examples /-- List-backed spelling of the strict two-cone partition example from `AffineCover`. Child-list position is the corresponding cone-form index. -/ +@[expose] def strictPartitionTreeData : CoverTreeData := .branch 0 [ .branch 1 [ diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/AffineDecisionCoverData.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/AffineDecisionCoverData.lean index d3c1e80b0a..a73b785bf6 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/AffineDecisionCoverData.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/AffineDecisionCoverData.lean @@ -22,7 +22,7 @@ The checker is deliberately small. Generated search code is untrusted; only the Boolean replay and the theorem below enter the proof. -/ -@[expose] public section +public section namespace Utilities.Certificate.AffineCover open Utilities.Certificate @@ -53,6 +53,7 @@ def ValidActive {m : ℕ} ValidActive cones (active ++ [form.violation]) fails /-- Check active affine constraints at each decision-tree node using Boolean arithmetic. -/ +@[expose] def checkActive {m : ℕ} (cones : List (List (AffineForm m))) (active : List (AffineForm m)) : DecisionTreeData m → Bool @@ -71,6 +72,7 @@ def Valid {m : ℕ} (data : DecisionTreeData m) ValidActive cones base data /-- Executable exact replay of wall-decision data. -/ +@[expose] def check {m : ℕ} (data : DecisionTreeData m) (base : List (AffineForm m)) (cones : List (List (AffineForm m))) : Bool := diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/AffinePosition.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/AffinePosition.lean index 04bdcc8390..fa5419f312 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/AffinePosition.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/AffinePosition.lean @@ -20,7 +20,7 @@ lies in its slot are required literally in its local cone. Cone soundness then supplies the bounds needed to construct a typed path position. -/ -@[expose] public section +public section namespace MarkedGraphs.Certificate.AffinePosition open Utilities.Certificate @@ -149,6 +149,7 @@ theorem rawOffset_le_segmentNat /-- Tail-oriented numerical coordinate of a code in the concrete subdivision. -/ +@[expose] def coordinate (certificate : ExplicitPotential.CertificateData m n p) (code : Code m p) (point : Fin m → ℤ) : ℕ := if code.fromHead then @@ -169,6 +170,7 @@ theorem coordinate_le_segmentNat · exact code.rawOffset_le_segmentNat certificate point hValid hBounds hCone /-- Typed path position decoded from a cone-certified affine position. -/ +@[expose] def decodePosition (certificate : ExplicitPotential.CertificateData m n p) (code : Code m p) (point : Fin m → ℤ) (core_nonempty : 0 < n) {degree : ℤ} (hValid : certificate.Valid degree) @@ -180,6 +182,7 @@ def decodePosition (certificate : ExplicitPotential.CertificateData m n p) (code.coordinate_le_segmentNat certificate point hValid hBounds hCone) /-- The actual subdivision vertex named by an affine position code. -/ +@[expose] def decodeVertex (certificate : ExplicitPotential.CertificateData m n p) (code : Code m p) (point : Fin m → ℤ) (core_nonempty : 0 < n) {degree : ℤ} (hValid : certificate.Valid degree) diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/AffinePositionMultiBreak.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/AffinePositionMultiBreak.lean index 08d24ba578..5c340fbd6c 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/AffinePositionMultiBreak.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/AffinePositionMultiBreak.lean @@ -46,7 +46,7 @@ only Boolean checks are the fail-closed bound checks already introduced by `AffinePosition`. -/ -@[expose] public section +public section namespace MarkedGraphs.Certificate open Utilities.Certificate @@ -151,6 +151,7 @@ variable {m n p : ℕ} /-- A certificate carrying only length geometry. Its `divisor` and `witness` fields are placeholders: the real pencil is a `MultiCode` and the real firing scripts are multi-break scripts. -/ +@[expose] def certificate (core : ExplicitPotential.Core n p) (segment : Fin p → ExplicitPotential.AffineForm m) (cone : List (ExplicitPotential.AffineForm m)) : @@ -450,6 +451,7 @@ open Utilities.Certificate.SubdivisionGraph.Spec /-- Scan a break list left to right, keeping the value of the last entry whose start index is at most `k`. `initial` is the slope in force before the list begins. -/ +@[expose] def breakSlopeFrom (initial : ℤ) : List (ℕ × ℤ) → ℕ → ℤ | [], _ => initial | entry :: rest, k => @@ -457,6 +459,7 @@ def breakSlopeFrom (initial : ℤ) : List (ℕ × ℤ) → ℕ → ℤ /-- The slope named by a break list at unit step `k`: the value of the last entry whose start is at most `k`, and `0` before every entry. -/ +@[expose] def breakSlope (breaks : List (ℕ × ℤ)) (k : ℕ) : ℤ := breakSlopeFrom 0 breaks k @[simp] theorem breakSlopeFrom_nil (initial : ℤ) (k : ℕ) : @@ -632,6 +635,7 @@ def checkBounds (certificate : ExplicitPotential.CertificateData m n p) /-- The concrete per-slot break list obtained by evaluating every affine break position at a length point. -/ +@[expose] def breaks (certificate : ExplicitPotential.CertificateData m n p) (script : SlopeScript m p b) (point : Fin m → ℤ) (edge : Fin p) : List (ℕ × ℤ) := diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CanonicalDivisor.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CanonicalDivisor.lean index a630e0e64b..841c679b85 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CanonicalDivisor.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CanonicalDivisor.lean @@ -25,7 +25,7 @@ All statements here concern positive `SubdivisionGraph.Spec` objects, not contracted zero-length faces. -/ -@[expose] public section +public section namespace Utilities diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedContraction.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedContraction.lean index 5681ed8782..09b540d78a 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedContraction.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedContraction.lean @@ -48,7 +48,7 @@ constant along every face reachable this way, and a loop-carrying row is never a face of a loopless one. See the corresponding closed-row proof module. -/ -@[expose] public section +public section namespace Utilities.Certificate.ClosedContraction diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedCoreSymmetry.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedCoreSymmetry.lean index c0b66df6b2..d980b368a9 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedCoreSymmetry.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedCoreSymmetry.lean @@ -13,7 +13,7 @@ public import LeanPool.BrillNoetherGraphs.Utilities.Subdivision.DegenerateSubdiv /-! # Core automorphisms on closed subdivision faces -/ -@[expose] public section +public section namespace Utilities.Certificate.ClosedCoreSymmetry open Utilities @@ -122,6 +122,7 @@ theorem rep_eq_iff (u v : Fin n) : rw [compFold_iff, compFold_iff, reach_map_iff symmetry length] /-- The core symmetry induces an equivalence of contracted vertex classes. -/ +@[expose] noncomputable def classEquiv : {v : Fin n // compFold core (zeroSet length) v = v} ≃ {v : Fin n // compFold core (zeroSet (targetLength symmetry length)) v = v} := @@ -227,6 +228,7 @@ theorem isLoopy_iff : simpa [ht, hh] using htarget /-- Relabel the canonical forest contraction along a core symmetry. -/ +@[expose] noncomputable def relabeling (hn : 0 < n) (hForest : IsForest core (zeroSet length)) (hNotLoopy : ¬ IsLoopy core (zeroSet length)) : (censusSpec core hn length hForest hNotLoopy).Relabeling diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedFaceCensus.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedFaceCensus.lean index 78c0be5ca3..f7c09442df 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedFaceCensus.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedFaceCensus.lean @@ -17,7 +17,7 @@ its forest census to a `DegSpec`. The representative map is the canonical union-find map generated by the zero slots. -/ -@[expose] public section +public section namespace Utilities.Certificate.ClosedFaceCensus @@ -28,6 +28,7 @@ open Utilities.Certificate.ContractionForestCensusGeneral variable {n p : ℕ} /-- The vanishing slots of a nonnegative length assignment. -/ +@[expose] def zeroSet (length : Fin p → ℕ) : Finset (Fin p) := Finset.univ.filter (fun edge => length edge = 0) @@ -36,6 +37,7 @@ def zeroSet (length : Fin p → ℕ) : Finset (Fin p) := simp [zeroSet] /-- The canonical degenerate subdivision attached to a forest face. -/ +@[expose] def censusSpec (core : ExplicitPotential.Core n p) (hn : 0 < n) (length : Fin p → ℕ) (hForest : IsForest core (zeroSet length)) diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedFaceDispatch.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedFaceDispatch.lean index a07513a5bf..a6380705e7 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedFaceDispatch.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedFaceDispatch.lean @@ -19,7 +19,7 @@ stored in `ContractionData`, its degenerate subdivision is equivalent to a positive subdivision of the displayed target core. -/ -@[expose] public section +public section namespace Utilities.Certificate.ClosedFaceDispatch open Utilities diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof.lean index 3a355a8437..7042fd6c41 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof.lean @@ -23,4 +23,4 @@ public import LeanPool.BrillNoetherGraphs.Utilities.Subdivision.ClosedRowProof.T /-! Supporting modules for Brill–Noether theory and gonality of finite graphs. -/ -@[expose] public section +public section diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/Arith.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/Arith.lean index bd9c7a8315..90bf9f4df0 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/Arith.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/Arith.lean @@ -39,7 +39,7 @@ multiplier contributes `0` to the equality part. So the checker is fail-closed on malformed indices without spending a comparison on them. -/ -@[expose] public section +public section namespace Utilities.Subdivision.ClosedRowProof @@ -48,6 +48,7 @@ namespace Utilities.Subdivision.ClosedRowProof abbrev Form := List ℤ /-- Dot product, truncating at the shorter list. -/ +@[expose] def dot : List ℤ → List ℤ → ℤ | [], _ => 0 | _, [] => 0 @@ -55,6 +56,7 @@ def dot : List ℤ → List ℤ → ℤ /-- Evaluate a form at a point. The constant term is the coefficient of the leading `1`, which makes `eval` a dot product and hence linear in the form. -/ +@[expose] def eval (g : Form) (x : List ℤ) : ℤ := dot g (1 :: x) @[simp] theorem dot_nil_left (y : List ℤ) : dot [] y = 0 := rfl @@ -65,15 +67,18 @@ def eval (g : Form) (x : List ℤ) : ℤ := dot g (1 :: x) @[simp] theorem eval_nil (x : List ℤ) : eval [] x = 0 := rfl /-- Sum of two forms, aligned at the constant term. -/ +@[expose] def addForm : Form → Form → Form | [], b => b | a, [] => a | a :: as, b :: bs => (a + b) :: addForm as bs /-- Scalar multiple of a form. -/ +@[expose] def smulForm (k : ℤ) (f : Form) : Form := f.map (fun a => k * a) /-- Difference of two forms. -/ +@[expose] def subForm (f g : Form) : Form := addForm f (smulForm (-1) g) theorem dot_addForm (f g : Form) (y : List ℤ) : @@ -129,6 +134,7 @@ theorem dot_eq_zero_of_all_zero {l : List ℤ} (h : ∀ a ∈ l, a = 0) /-- Syntactic equality of forms, up to padding: their difference is zero in every coordinate. -/ +@[expose] def formEq (f g : Form) : Bool := (subForm f g).all (fun a => a == 0) theorem eval_eq_of_formEq {f g : Form} (h : formEq f g = true) (x : List ℤ) : @@ -151,6 +157,7 @@ structure Context where eq : List Form /-- The point `x` satisfies the context. -/ +@[expose] def Context.Holds (Γ : Context) (x : List ℤ) : Prop := (∀ g ∈ Γ.ge, 0 ≤ eval g x) ∧ (∀ g ∈ Γ.eq, eval g x = 0) @@ -165,6 +172,7 @@ as an identity of forms. Nothing searches for `λ`; the generator supplies it. -/ /-- A sparse combination of context rows. -/ +@[expose] def combineRows (rows : List Form) (w : List (ℕ × ℤ)) : Form := w.foldr (fun p acc => addForm (smulForm p.2 (rows.getD p.1 [])) acc) [] @@ -180,11 +188,13 @@ structure Cert where c : ℤ /-- The form the certificate claims equals `k · g`. -/ +@[expose] def Cert.combination (w : Cert) (Γ : Context) : Form := addForm [w.c] (addForm (combineRows Γ.ge w.lam) (combineRows Γ.eq w.mu)) /-- The checker of spec §4.1. One pass over the sparse lists and one vector comparison; **no rounding**, deliberately (§13.4). -/ +@[expose] def Cert.check (w : Cert) (Γ : Context) (g : Form) : Bool := decide (1 ≤ w.k) && decide (0 ≤ w.c) && w.lam.all (fun p => decide (0 ≤ p.2)) && diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/ClosedAuto.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/ClosedAuto.lean index dded70b10e..a1cfdcea27 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/ClosedAuto.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/ClosedAuto.lean @@ -21,7 +21,7 @@ union-find representatives need not commute definitionally with a vertex permutation, but their fibres do. -/ -@[expose] public section +public section namespace Utilities.Subdivision.ClosedRowProof @@ -61,29 +61,35 @@ namespace AutoData /-- Decode a proposed vertex image using zero for missing entries and reduction modulo the nonzero vertex count. -/ +@[expose] def vertexMap (d : AutoData) (hn : 0 < n) (v : Fin n) : Fin n := ⟨d.vertex.getD v.val 0 % n, Nat.mod_lt _ hn⟩ /-- Decode a proposed inverse vertex image using zero for missing entries and reduction modulo the nonzero vertex count. -/ +@[expose] def vertexInvMap (d : AutoData) (hn : 0 < n) (v : Fin n) : Fin n := ⟨d.vertexInv.getD v.val 0 % n, Nat.mod_lt _ hn⟩ /-- Decode a proposed slot image using zero for missing entries and reduction modulo the nonzero slot count. -/ +@[expose] def slotMap (d : AutoData) (hp : 0 < p) (e : Fin p) : Fin p := ⟨d.slot.getD e.val 0 % p, Nat.mod_lt _ hp⟩ /-- Decode a proposed inverse slot image using zero for missing entries and reduction modulo the nonzero slot count. -/ +@[expose] def slotInvMap (d : AutoData) (hp : 0 < p) (e : Fin p) : Fin p := ⟨d.slotInv.getD e.val 0 % p, Nat.mod_lt _ hp⟩ /-- Read the reversal flag of a source slot, defaulting to false when the list has no entry. -/ +@[expose] def reverseAt (d : AutoData) (e : Fin p) : Bool := d.reversed.getD e.val false /-- Check nonempty vertex and slot sets, both inverse identities, and the two endpoint laws for the decoded automorphism data. -/ +@[expose] def checks (d : AutoData) (core : ExplicitPotential.Core n p) : Bool := if hn : 0 < n then if hp : 0 < p then @@ -129,11 +135,13 @@ def toSymmetry (d : AutoData) (core : ExplicitPotential.Core n p) /-- Pull a form back exactly as `rpfcheck`: the old coefficient at `e` moves to `slotMap e`, equivalently the new coefficient at `j` is read at `slotInvMap j`. RPF row proofs have exactly `p` coordinates. -/ +@[expose] def pullbackForm (d : AutoData) (hp : 0 < p) (g : Form) : Form := g.getD 0 0 :: List.ofFn (fun e : Fin p => g.getD (d.slotInvMap hp e).val.succ 0) /-- Pull back every inequality and equality form in the context through the decoded inverse slot map. -/ +@[expose] def pullbackContext (d : AutoData) (hp : 0 < p) (Γ : Context) : Context := ⟨Γ.ge.map (d.pullbackForm hp), Γ.eq.map (d.pullbackForm hp)⟩ diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/ClosedVertexCut.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/ClosedVertexCut.lean index 26b8261beb..c58c7cc164 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/ClosedVertexCut.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/ClosedVertexCut.lean @@ -20,7 +20,7 @@ automatic. This small adapter presents the result in the exact form consumed by the deep-embedded closed-row checker. -/ -@[expose] public section +public section namespace Utilities.Subdivision.ClosedRowProof diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/Leaf.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/Leaf.lean index f922bd5c82..619b0609a0 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/Leaf.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/Leaf.lean @@ -60,7 +60,7 @@ slot. The multi-block half of §4.3 is unexercised by every accepted proof in the catalog; see the note at the end of this file for what it would cost. -/ -@[expose] public section +public section namespace Utilities.Subdivision.ClosedRowProof @@ -91,6 +91,7 @@ theorem dot_eq_sum_range (l r : List ℤ) : /-- A `List ℤ` form, read as an `AffineForm m`: the head is the constant and entry `i + 1` is the coefficient of coordinate `i`. -/ +@[expose] def toAffineForm (m : ℕ) (g : Form) : ExplicitPotential.AffineForm m where fixedValue := g.getD 0 0 coefficient := fun i => g.getD (i.val + 1) 0 @@ -132,6 +133,7 @@ theorem contextHolds_of_formsHold_toAffineForm {m : ℕ} /-! ### The coordinate forms -/ /-- The form `x_e`, as a `List ℤ`: entry `e + 1` is `1` and the rest are `0`. -/ +@[expose] def coordForm (e : ℕ) : Form := List.replicate (e + 1) 0 ++ [1] private theorem dot_replicate_append (e : ℕ) (x : List ℤ) : @@ -179,6 +181,7 @@ structure Block where hi : ℤ /-- The out-of-range block: every check on it fails. -/ +@[expose] def Block.dflt : Block := ⟨[], [], 1, 0⟩ /-- The firing script attached to one anchor: a potential at each core vertex, @@ -285,17 +288,22 @@ variable (w : RichWitness) /-- Look up the rich firing plan for an anchor, returning the empty default plan for an absent entry. -/ +@[expose] def plan (a : ℕ) : RichAnchorPlan := w.anchors.getD a RichAnchorPlan.dflt /-- Read an anchor plan’s potential at a core vertex, using the zero affine form for a missing entry. -/ +@[expose] def pot (a v : ℕ) : Form := (w.plan a).potential.getD v [] /-- Read the ordered block list for an anchor and slot, using an empty list when it is absent. -/ +@[expose] def blockList (a e : ℕ) : List Block := (w.plan a).blocks.getD e [] /-- Read a specified interpolation block, using the default block with inconsistent slope bounds for a missing entry. -/ +@[expose] def block (a e i : ℕ) : Block := (w.blockList a e).getD i Block.dflt /-- Read an anchor’s receipts for a slot and block, falling back to the default rich block certificate. -/ +@[expose] def blockReceipt (a e i : ℕ) : RichBlockCert := ((w.plan a).blockCert.getD e []).getD i RichBlockCert.dflt /-- Read the strict separation receipt for a run of named points, indexed by anchor, slot, and @@ -321,15 +329,19 @@ namespace Witness variable (w : Witness) /-- The plan of anchor `a`. -/ +@[expose] def plan (a : ℕ) : AnchorPlan := w.anchors.getD a AnchorPlan.dflt /-- The potential of anchor `a` at core vertex `v`. -/ +@[expose] def pot (a v : ℕ) : Form := (w.plan a).potential.getD v [] /-- The block list of anchor `a` on slot `e`. -/ +@[expose] def blockList (a e : ℕ) : List Block := (w.plan a).blocks.getD e [] /-- The first (and, once `leafChecks` accepts, only) block of slot `e`. -/ +@[expose] def block (a e : ℕ) : Block := (w.blockList a e).getD 0 Block.dflt end Witness @@ -346,6 +358,7 @@ variable {m n p : ℕ} /-- The row `rise_e − lo_e·σ_e ≥ 0`, written so that it is *definitionally* `(leafCertificate …).lowerForm`. -/ +@[expose] def leafLowerForm (m : ℕ) (core : ExplicitPotential.Core n p) (w : Witness) (a : Fin n) (e : Fin p) : ExplicitPotential.AffineForm m := ExplicitPotential.AffineForm.sub @@ -357,6 +370,7 @@ def leafLowerForm (m : ℕ) (core : ExplicitPotential.Core n p) (w : Witness) /-- The row `hi_e·σ_e − rise_e ≥ 0`, written so that it is *definitionally* `(leafCertificate …).upperForm`. -/ +@[expose] def leafUpperForm (m : ℕ) (core : ExplicitPotential.Core n p) (w : Witness) (a : Fin n) (e : Fin p) : ExplicitPotential.AffineForm m := ExplicitPotential.AffineForm.sub @@ -376,6 +390,7 @@ def leafCone (m : ℕ) (core : ExplicitPotential.Core n p) (w : Witness) : [leafLowerForm m core w a e, leafUpperForm m core w a e])) /-- The explicit-potential certificate a single-block leaf denotes. -/ +@[expose] def leafCertificate (m : ℕ) (core : ExplicitPotential.Core n p) (w : Witness) : ExplicitPotential.CertificateData m n p where core := core @@ -402,6 +417,7 @@ this node; `degree` is the goal's degree. Restrictions, both fail-closed and both deliberate: no chips, and exactly one block per slot. See the module docstring. -/ +@[expose] def Witness.leafChecks (w : Witness) (m : ℕ) (core : ExplicitPotential.Core n p) (Γ : Context) (degree : ℤ) : Bool := -- the row itself: a loopless, connected core @@ -446,6 +462,7 @@ This is where the soundness hazard of `RESULTS.md` §9 is discharged: the `rep_loopless` field below is supplied by `hNotLoopy` and by nothing else. -/ /-- The vanishing set of a length vector. -/ +@[expose] def zeroSet {p : ℕ} (ℓ : Fin p → ℕ) : Finset (Fin p) := Finset.univ.filter (fun e => ℓ e = 0) @@ -455,6 +472,7 @@ def zeroSet {p : ℕ} (ℓ : Fin p → ℕ) : Finset (Fin p) := `hForest` is genus preservation and `hNotLoopy` is looplessness of the contracted core — which is exactly what the strong-separator step needs, and is why `DegSpec.strongSeparatorCertificate` can be hypothesis-free. -/ +@[expose] def censusSpec (core : ExplicitPotential.Core n p) (hn : 0 < n) (ℓ : Fin p → ℕ) (hForest : IsForest core (zeroSet ℓ)) (hNotLoopy : ¬ IsLoopy core (zeroSet ℓ)) : @@ -633,6 +651,7 @@ and leaves exactly the row obligation of §3: *for every* `ℓ : Fin p → ℕ` vanishing set is a non-loopy forest, the goal holds. -/ /-- The closed-orthant root context. -/ +@[expose] def rootContextClosed (p : ℕ) : Context where ge := (List.range p).map coordForm eq := [] diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/LeggedChecks.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/LeggedChecks.lean index 71bff3ce71..31d4dbf5fd 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/LeggedChecks.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/LeggedChecks.lean @@ -54,7 +54,7 @@ file is imported. Keeping these four here is what lets the marked programmes consume the row-proof checker without maintaining a second copy of it. -/ -@[expose] public section +public section namespace Utilities.Subdivision.ClosedRowProof diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/RichChipBridge.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/RichChipBridge.lean index e50cd3075c..ff6df8d58c 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/RichChipBridge.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/RichChipBridge.lean @@ -41,7 +41,7 @@ declared slack, which is what the `minOver` in `tailContribution` / `headContribution` needs. -/ -@[expose] public section +public section namespace Utilities.Subdivision.ClosedRowProof @@ -68,6 +68,7 @@ private theorem sum_range_list_sum {α : Type} (l : List α) (f : ℕ → α → /-- The head-side chip sum used by `headCandidate`, named so that the bridge can be stated without repeating the fold. -/ +@[expose] def headChipSum (w : RichWitness) (a e s : ℕ) : ℤ := (List.range (s + 1)).foldl (fun z t => if t = 0 then z else z + w.chipAt a e ((w.blockList a e).length - t)) 0 diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/RichChipDecoder.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/RichChipDecoder.lean index 4bad360dde..042f769b7b 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/RichChipDecoder.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/RichChipDecoder.lean @@ -19,7 +19,7 @@ divisor and its degree calculation once, so the endpoint-specific decoder is the only remaining W5 geometry. -/ -@[expose] public section +public section namespace Utilities.Subdivision.ClosedRowProof @@ -36,6 +36,7 @@ variable {n p : ℕ} Unlike a quotient-core vertex, this remains meaningful before any zero-length core edges are contracted. The W5 endpoint bridge identifies this mass with the C first-match prefix/suffix accounting on collapsed endpoint runs. -/ +@[expose] def rawChipMassAt (w : RichWitness) (x : List ℤ) (slot : ℕ) (coordinate : ℤ) : ℤ := (w.chips.map fun chip => if chip.1 == slot && eval chip.2.1 x == coordinate then chip.2.2 else 0).sum @@ -157,6 +158,7 @@ endpoint accounting. -/ /-- Push the raw core coefficient list to the quotient core of a degenerate subdivision; interior vertices receive no core coefficient. -/ +@[expose] def richCoreDivisor (d : Utilities.Certificate.DegenerateSpec.DegSpec n p) (w : RichWitness) : CFDiv d.graph @@ -210,6 +212,7 @@ both for W4 runs and for W5 endpoint prefixes/suffixes. -/ /-- The Boolean predicate by which the C checker assigns a raw chip to a named point. The `range (i - 1)` clause makes this the first syntactic match; index zero is excluded separately by `chipAt`. -/ +@[expose] def chipMatches (w : RichWitness) (a e i : ℕ) (c : ℕ × Form × ℤ) : Bool := c.1 == e && formEq c.2.1 (w.point a e i) && (List.range (i - 1)).all diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/RichChipPlacement.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/RichChipPlacement.lean index 4f3cbbd070..30fdbbcced 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/RichChipPlacement.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/RichChipPlacement.lean @@ -28,7 +28,7 @@ adding a tail term and a head term would count a chip there twice. anyway, so nothing is lost. -/ -@[expose] public section +public section namespace Utilities.Subdivision.ClosedRowProof @@ -229,6 +229,7 @@ tail term and a head term would double count. By `RichChipBridge.rawChipMassAt_eq_zero_of_coord_eq_zero` an accepted rich leaf has no chip on such a slot at all, so the suppressed value is `0`; the `if` is what makes that visible without a hypothesis. -/ +@[expose] def headMassAdj (w : RichWitness) (x : List ℤ) (e : Fin p) : ℤ := if d.length e = 0 then 0 else w.rawChipMassAt x e.val (d.length e) diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/RichLeafAssembly.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/RichLeafAssembly.lean index d1a4f49134..d011fb4496 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/RichLeafAssembly.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/RichLeafAssembly.lean @@ -12,7 +12,7 @@ public import LeanPool.BrillNoetherGraphs.Utilities.Subdivision.ClosedRowProof.R /-! # Rich Leaf Assembly -/ -@[expose] public section +public section open MarkedGraphs.Certificate open Utilities.Certificate diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/RichLeafChecks.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/RichLeafChecks.lean index 8e98823319..50ba8353b2 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/RichLeafChecks.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/RichLeafChecks.lean @@ -20,7 +20,7 @@ The indices deliberately agree with `rpfcheck.c`: a named point has index `s : ℕ`, is the end of block `s - 1`, and hence runs in W4 start at `1`. -/ -@[expose] public section +public section namespace Utilities.Subdivision.ClosedRowProof @@ -33,10 +33,12 @@ namespace RichWitness variable {m n p : ℕ} /-- The right end of block `i - 1`; index zero is the tail of the slot. -/ +@[expose] def point (w : RichWitness) (a e i : ℕ) : Form := if i = 0 then [] else (w.block a e (i - 1)).endForm /-- The length of block `i`, as a form. -/ +@[expose] def blockLength (w : RichWitness) (a e i : ℕ) : Form := subForm (w.block a e i).endForm (w.point a e i) @@ -47,6 +49,7 @@ This intentionally follows `rpfcheck.c`'s W3 scan: a chip belongs to the when zero-length blocks make two named forms equal. In particular index zero is the tail, not a named interior point, so it never receives a chip. W3 separately ensures that every chip has such a matching interior point. -/ +@[expose] def chipAt (w : RichWitness) (a e i : ℕ) : ℤ := if i == 0 then 0 else w.chips.foldl (fun z c => @@ -60,16 +63,19 @@ def chipAt (w : RichWitness) (a e i : ℕ) : ℤ := simp [chipAt] /-- Chip coefficients at named points `1, …, s`, inclusive. -/ +@[expose] def chipPrefix (w : RichWitness) (a e s : ℕ) : ℤ := (List.range (s + 1)).foldl (fun z i => z + w.chipAt a e i) 0 /-- The W5 tail candidate when precisely the first `s` named points have fallen into the tail. -/ +@[expose] def tailCandidate (w : RichWitness) (a e s : ℕ) : ℤ := w.chipPrefix a e s + (w.block a e s).lo /-- The W5 head candidate when precisely the last `s` named points have fallen into the head. -/ +@[expose] def headCandidate (w : RichWitness) (a e s : ℕ) : ℤ := let k := (w.blockList a e).length (List.range (s + 1)).foldl (fun z t => @@ -81,27 +87,33 @@ def headCandidate (w : RichWitness) (a e s : ℕ) : ℤ := This is public because the closed-face soundness proof uses the elementary fact that it is bounded above by every candidate represented by a collapsed endpoint prefix/suffix. -/ +@[expose] def minOver (f : ℕ → ℤ) (bound : ℕ) : ℤ := (List.range bound).foldl (fun z i => min z (f (i + 1))) (f 0) /-- The conservative W5 contribution of a slot at its tail. -/ +@[expose] def tailContribution (w : RichWitness) (a e : ℕ) : ℤ := minOver (w.tailCandidate a e) ((w.plan a).headSlack.getD e 0) /-- The conservative W5 contribution of a slot at its head. -/ +@[expose] def headContribution (w : RichWitness) (a e : ℕ) : ℤ := minOver (w.headCandidate a e) ((w.plan a).tailSlack.getD e 0) /-- The constant residual of the W4 run from named point `i` through `j`. -/ +@[expose] def w4Residual (w : RichWitness) (a e i j : ℕ) : ℤ := (List.range (j + 1 - i)).foldl (fun z t => z + w.chipAt a e (i + t)) 0 + (w.block a e j).lo - (w.block a e (i - 1)).hi /-- The strict-integer certificate that a form is positive. -/ +@[expose] def positiveCheck (c : Cert) (Γ : Context) (f : Form) : Bool := c.check Γ (subForm f [1]) /-- W1: block order, final endpoint, and endpoint-slack discipline. -/ +@[expose] def w1Checks (w : RichWitness) (_core : ExplicitPotential.Core n p) (Γ : Context) : Bool := ExplicitPotential.allFin (fun a : Fin n => ExplicitPotential.allFin fun e : Fin p => let bs := w.blockList a.val e.val @@ -121,6 +133,7 @@ def w1Checks (w : RichWitness) (_core : ExplicitPotential.Core n p) (Γ : Contex /-- W2: each block is realizable by convex interpolation and the block rises close the potential around every slot. -/ +@[expose] def w2Checks (w : RichWitness) (core : ExplicitPotential.Core n p) (Γ : Context) : Bool := ExplicitPotential.allFin (fun a : Fin n => ExplicitPotential.allFin fun e : Fin p => let k := (w.blockList a.val e.val).length @@ -134,6 +147,7 @@ def w2Checks (w : RichWitness) (core : ExplicitPotential.Core n p) (Γ : Context (subForm (w.pot a.val (core.head e).val) (w.pot a.val (core.tail e).val))) /-- W3: each chip is on this slot's syntactically named interior point. -/ +@[expose] def w3Checks (w : RichWitness) (_core : ExplicitPotential.Core n p) : Bool := w.chips.all (fun c => decide (c.1 < p)) && ExplicitPotential.allFin (fun a : Fin n => ExplicitPotential.allFin fun e : Fin p => @@ -147,10 +161,12 @@ def w3Checks (w : RichWitness) (_core : ExplicitPotential.Core n p) : Bool := W1 makes the named points weakly increasing from `0`, such a point evaluates to `0` at every parameter value, so any collapsed run through it sits on the tail core vertex, where W5 — not W4 — accounts for it. -/ +@[expose] def tailConfined (w : RichWitness) (a e i : ℕ) : Bool := formEq (w.point a e i) [] /-- The head-side mirror of `tailConfined`. -/ +@[expose] def headConfined (w : RichWitness) (a e j : ℕ) : Bool := formEq (w.point a e j) (coordForm e) @@ -167,6 +183,7 @@ the *declared* endpoint slack. That is unsound: `α` bounds how many named points **may** slide onto the tail, not how many **do**, so a run starting at `i ≤ α` can collapse at a strictly interior vertex whose residual then goes unchecked. See the accompanying analysis. -/ +@[expose] def w4Checks (w : RichWitness) (_core : ExplicitPotential.Core n p) (Γ : Context) : Bool := ExplicitPotential.allFin (fun a : Fin n => ExplicitPotential.allFin fun e : Fin p => let k := (w.blockList a.val e.val).length @@ -188,6 +205,7 @@ at the plan's own vertex. instead that `D − m·1_x` is winnable. The two run through identical machinery; this coefficient is the only difference, exactly as in `rpfcheck.c`'s W5. -/ +@[expose] def w5MultResidual (w : RichWitness) (core : ExplicitPotential.Core n p) (mult : ℤ) (a v : ℕ) : ℤ := w.divisorCore.getD v 0 - (if v == a then mult else 0) + @@ -196,6 +214,7 @@ def w5MultResidual (w : RichWitness) (core : ExplicitPotential.Core n p) (if (core.head e).val == v then w.headContribution a e.val else 0)) 0 /-- W5 residual at one core vertex for one anchor. -/ +@[expose] def w5Residual (w : RichWitness) (core : ExplicitPotential.Core n p) (a v : ℕ) : ℤ := w.w5MultResidual core 1 a v @@ -213,6 +232,7 @@ def w5MultChecks (w : RichWitness) (core : ExplicitPotential.Core n p) simp [w5MultChecks, ExplicitPotential.allFin_eq_true_iff] /-- W5: all conservative core residuals are effective. -/ +@[expose] def w5Checks (w : RichWitness) (core : ExplicitPotential.Core n p) : Bool := ExplicitPotential.allFin (fun a : Fin n => ExplicitPotential.allFin fun v : Fin n => decide (0 ≤ w.w5Residual core a.val v.val)) @@ -220,6 +240,7 @@ def w5Checks (w : RichWitness) (core : ExplicitPotential.Core n p) : Bool := /-- The executable W1--W5 checker for a rich multi-block leaf. Structural row conditions and degree are included here so that this is directly usable as the replacement leaf predicate by the tree layer. -/ +@[expose] def richLeafChecks (w : RichWitness) (_m : ℕ) (core : ExplicitPotential.Core n p) (Γ : Context) (degree : ℤ) : Bool := ExplicitPotential.allFin (fun e : Fin p => decide (core.tail e ≠ core.head e)) && diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/RichLeafDivisor.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/RichLeafDivisor.lean index 38cf5d5821..13a01eae1d 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/RichLeafDivisor.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/RichLeafDivisor.lean @@ -16,7 +16,7 @@ This module isolates the representation-independent divisor and degree calculation from the closed-face soundness assembly. -/ -@[expose] public section +public section namespace Utilities.Subdivision.ClosedRowProof @@ -33,6 +33,7 @@ variable {m n p : ℕ} /-- The divisor denoted by a rich witness on a particular closed face: raw core coefficients are pushed to quotient classes and raw chip forms are evaluated at their physical subdivision positions. -/ +@[expose] def richDivisor (d : Utilities.Certificate.DegenerateSpec.DegSpec n p) (w : RichWitness) (fallback : Fin n) (x : List ℤ) : CFDiv d.graph := diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/RichLeafSound.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/RichLeafSound.lean index 151f0a654b..1456eaa01f 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/RichLeafSound.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/RichLeafSound.lean @@ -27,7 +27,7 @@ finite-list decoder which supplies `PiecewiseData.covers`, two residual comparison lemmas documented at the end of this file. -/ -@[expose] public section +public section namespace Utilities.Subdivision.ClosedRowProof @@ -44,6 +44,7 @@ variable {m n p : ℕ} /-- Evaluation of a named point. This is kept as an integer: W1 first proves nonnegativity, after which the lowerer may take `toNat` to obtain a path offset. -/ +@[expose] def pointValue (w : RichWitness) (x : List ℤ) (a e i : ℕ) : ℤ := eval (w.point a e i) x @@ -466,6 +467,7 @@ blocks) need no special case: they simply enlarge the run. /-- The chip sum used by W4, written in the same `List.range`/`foldl` form as the executable checker. -/ +@[expose] def w4ChipSum (chip : ℕ → ℤ) (i j : ℕ) : ℤ := (List.range (j + 1 - i)).foldl (fun z t => z + chip (i + t)) 0 @@ -479,6 +481,7 @@ theorem w4Residual_eq_chipSum (w : RichWitness) (a e i j : ℕ) : /-- The actual coefficient at a collapsed named-endpoint run: chips on the run plus outgoing slope minus incoming slope. -/ +@[expose] def w4Actual (chip : ℕ → ℤ) (incoming outgoing : ℤ) (i j : ℕ) : ℤ := w4ChipSum chip i j + outgoing - incoming @@ -783,6 +786,7 @@ theorem piecewise_balance_of_total_rises {n p : ℕ} /-- The canonical piecewise interpolation data for one rich anchor on the census face selected by the current length vector. -/ +@[expose] noncomputable def richCensusPiecewiseData (w : RichWitness) (core : ExplicitPotential.Core n p) (Γ : Context) (x : List ℤ) (hW1 : w.w1Checks core Γ = true) (hW2 : w.w2Checks core Γ = true) @@ -822,6 +826,7 @@ noncomputable def richCensusPiecewiseData (w : RichWitness) omega) /-- The firing script denoted by the decoded rich block data. -/ +@[expose] noncomputable def richCensusPiecewiseScript (w : RichWitness) (core : ExplicitPotential.Core n p) (Γ : Context) (x : List ℤ) (hW1 : w.w1Checks core Γ = true) (hW2 : w.w2Checks core Γ = true) diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/RichW5Aggregation.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/RichW5Aggregation.lean index 04a3362314..7224393fc7 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/RichW5Aggregation.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/RichW5Aggregation.lean @@ -23,7 +23,7 @@ module, so that `RichLeafFullSound.richLeaf_sound` can consume it; the `hTail`/`hHead` hypotheses are produced by `RichChipBridge`. -/ -@[expose] public section +public section namespace Utilities.Subdivision.ClosedRowProof @@ -38,6 +38,7 @@ variable {n p : ℕ} /-- The actual residual at an original core vertex, parameterized by the tail/head endpoint contributions furnished by the closed-face geometry. -/ +@[expose] def w5ActualResidual (w : RichWitness) (core : ExplicitPotential.Core n p) (mult : ℤ) (a : Fin n) (tail head : Fin p → ℤ) (v : Fin n) : ℤ := w.divisorCore.getD v.val 0 - (if v.val == a.val then mult else 0) + diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/Tree.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/Tree.lean index f31a7f71f0..0656127983 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/Tree.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ClosedRowProof/Tree.lean @@ -113,7 +113,7 @@ conditions at `p … p+k−1`. That stability is what lets the emitter address context rows by a fixed index in every certificate it synthesises. -/ -@[expose] public section +public section namespace Utilities.Subdivision.ClosedRowProof @@ -124,6 +124,7 @@ open Utilities.Certificate open Utilities.Certificate.ContractionForestCensusGeneral /-- `−1 − g`: the negation of `g ≥ 0` over the integers. -/ +@[expose] def negForm (g : Form) : Form := subForm [-1] g @[simp] theorem eval_negForm (g : Form) (x : List ℤ) : @@ -140,6 +141,7 @@ def falseForm : Form := [-1] /-- Append a form to the inequality part of a context. Appending, rather than prepending, is what keeps context indices stable down a branch. -/ +@[expose] def Context.pushGe (Γ : Context) (g : Form) : Context := ⟨Γ.ge ++ [g], Γ.eq⟩ theorem Context.pushGe_holds {Γ : Context} {g : Form} {x : List ℤ} @@ -229,12 +231,14 @@ context the citation sits in. -/ subtree's declared entry forms. Appending keeps the root's `p` coordinate rows at indices `0 … p−1`, so a certificate synthesised against the root addresses the same rows inside a subtree. -/ +@[expose] def subContext (p : ℕ) (entry : List Form) : Context := ⟨(List.range p).map coordForm ++ entry, []⟩ /-- Positional lookup into the list of entry contexts. Written out rather than taken from `List.getElem?` so that `lookup_mem` — the only fact soundness needs — is a three-line induction that cannot drift with the library. -/ +@[expose] def lookupEntry : List (List Form) → ℕ → Option (List Form) | [], _ => none | e :: _, 0 => some e @@ -253,6 +257,7 @@ theorem lookupEntry_mem : /-- The citation's obligation: certificate `i` must entail entry form `i`. A missing certificate is `Cert.dflt`, which fails `1 ≤ k`, so a `use` with too few certificates is a reject rather than a gap. -/ +@[expose] def entryChecks (Γ : Context) : List Form → List Cert → Bool | [], _ => true | g :: gs, cs => @@ -293,6 +298,7 @@ inductive PTree where /-- The tree checker, in scope of the entry contexts `E` of the subtrees this node may cite. One `Bool` for the whole proof. -/ +@[expose] def PTree.checksIn {n p : ℕ} (m : ℕ) (core : ExplicitPotential.Core n p) (degree : ℤ) (E : List (List Form)) (Γ : Context) : PTree → Bool | .leaf w => w.leafChecks m core Γ degree @@ -329,6 +335,7 @@ structure PProof where main : PTree /-- Check the subtrees in order, each in scope of its predecessors' entries. -/ +@[expose] def subsCheck {n p : ℕ} (m : ℕ) (core : ExplicitPotential.Core n p) (degree : ℤ) : List (List Form) → List (List Form × PTree) → Bool | _, [] => true @@ -338,6 +345,7 @@ def subsCheck {n p : ℕ} (m : ℕ) (core : ExplicitPotential.Core n p) (degree /-- The whole-proof checker: the subtrees, then the main tree in scope of all of them. -/ +@[expose] def PProof.checks {n p : ℕ} (m : ℕ) (core : ExplicitPotential.Core n p) (degree : ℤ) (Γ : Context) (P : PProof) : Bool := subsCheck m core degree [] P.subs && diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ConnectedCheckFast.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ConnectedCheckFast.lean index 78432d6d02..69113a26ba 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ConnectedCheckFast.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ConnectedCheckFast.lean @@ -54,7 +54,7 @@ the literal reading of the definition and stays available as an independent cross-check. -/ -@[expose] public section +public section namespace Utilities.Certificate @@ -84,6 +84,7 @@ theorem mem_iff_of_reachIn {core : ExplicitPotential.Core n p} /-- **The union--find connectivity checker.** A core is connected exactly when contracting every slot leaves one class. -/ +@[expose] def connectedCheckFast (core : ExplicitPotential.Core n p) : Bool := decide (∀ v w : Fin n, compFold core Finset.univ v = compFold core Finset.univ w) diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ContractionForestCensusGeneral.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ContractionForestCensusGeneral.lean index 2c19f1b053..ae823586f2 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ContractionForestCensusGeneral.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ContractionForestCensusGeneral.lean @@ -48,7 +48,7 @@ Two more facts are needed for that (`DegenerateSpecCensus.lean` consumes both): spanning-forest structure that already defines `rep` — no separate search. -/ -@[expose] public section +public section namespace Utilities.Certificate.ContractionForestCensusGeneral open Utilities.Certificate @@ -63,6 +63,7 @@ variable {n p : ℕ} (core : ExplicitPotential.Core n p) /-- `u` and `v` are joined by one edge slot drawn from the list `l` (in either reading direction). -/ +@[expose] def AdjInList (l : List (Fin p)) (u v : Fin n) : Prop := ∃ e ∈ l, (core.tail e = u ∧ core.head e = v) ∨ (core.head e = u ∧ core.tail e = v) @@ -121,6 +122,7 @@ theorem adjInList_snoc (l : List (Fin p)) (e : Fin p) (x y : Fin n) : /-- The reachability relation generated by a list of edge slots: the reflexive-transitive closure of direct adjacency. Symmetric because `AdjInList` already is. -/ +@[expose] def ReachInList (l : List (Fin p)) : Fin n → Fin n → Prop := Relation.ReflTransGen (AdjInList core l) @@ -255,6 +257,7 @@ theorem reachInList_snoc (l : List (Fin p)) (e : Fin p) (x y : Fin n) : /-- Merge the `rep`-class of `u` into the `rep`-class of `v`. See `ContractionForestCensus.unionStep`'s docstring for the sharing discipline this `let`-binding shape enforces. -/ +@[expose] def unionStep (rep : Fin n → Fin n) (u v : Fin n) : Fin n → Fin n := let ru := rep u let rv := rep v @@ -348,6 +351,7 @@ theorem card_image_le_card_image_unionStep_succ (rep : Fin n → Fin n) (u v : F /-! ## Folding over a list of edges: union-find, and its correctness -/ /-- Union-find over a list of edge slots, applied in order. -/ +@[expose] def foldRep (l : List (Fin p)) : Fin n → Fin n := l.foldl (fun rep e => unionStep rep (core.tail e) (core.head e)) id @@ -412,6 +416,7 @@ theorem card_le_card_image_foldRep_add_length (l : List (Fin p)) : /-- The edge slots of the core belonging to a finite set `F`, listed in the fixed canonical order `0, 1, …, p - 1`. -/ +@[expose] def edgeList (F : Finset (Fin p)) : List (Fin p) := (List.finRange p).filter (fun e => decide (e ∈ F)) @@ -433,12 +438,14 @@ theorem length_edgeList (F : Finset (Fin p)) : (edgeList (p := p) F).length = F. /-- The vertex partition induced by contracting the edge set `F`: each vertex's canonical representative under the union-find fold. -/ +@[expose] def compFold (F : Finset (Fin p)) : Fin n → Fin n := foldRep core (edgeList F) @[simp] theorem compFold_empty : compFold core ∅ = id := by simp [compFold, edgeList, foldRep] /-- The reachability relation actually induced by contracting `F`. -/ +@[expose] def ReachIn (F : Finset (Fin p)) : Fin n → Fin n → Prop := ReachInList core (edgeList F) theorem reachIn_equivalence (F : Finset (Fin p)) : Equivalence (ReachIn core F) := @@ -477,6 +484,7 @@ theorem reachIn_self_compFold (F : Finset (Fin p)) (v : Fin n) : /-- `F` is a *forest* of the core: contracting it is an equal-genus topological contraction. -/ +@[expose] def IsForest (F : Finset (Fin p)) : Prop := F.card = n - (Finset.image (compFold core F) Finset.univ).card @@ -547,6 +555,7 @@ theorem forest_card_lt {F : Finset (Fin p)} (hn : 0 < n) (h : IsForest core F) : /-- `F` leaves a semantic loop: some uncontracted edge slot has both endpoints identified by the contraction. Exactly the negation of `core_loopless`/`rep_loopless` for the contraction target. -/ +@[expose] def IsLoopy (F : Finset (Fin p)) : Prop := let g := compFold core F ∃ e : Fin p, e ∉ F ∧ g (core.tail e) = g (core.head e) diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreBridgeCut.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreBridgeCut.lean index f727cf6db7..3f4ce9089d 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreBridgeCut.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreBridgeCut.lean @@ -21,7 +21,7 @@ an interior point, and no assumption that a bridge has length one, is hidden in a generated core row. -/ -@[expose] public section +public section namespace MarkedGraphs.Certificate open Utilities.Certificate @@ -247,6 +247,7 @@ theorem not_step_right_left (h : c.Valid) /-- Lift valid core bridge data to an occurrence-safe separating bridge cut of every positive subdivision. -/ +@[expose] noncomputable def toOneBridgeCut (h : c.Valid) : OneBridgeCut spec.graph where left := leftVertices spec c right := rightVertices spec c diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreBridgeRankOne.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreBridgeRankOne.lean index c95f258273..a01f7aa8df 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreBridgeRankOne.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreBridgeRankOne.lean @@ -23,7 +23,7 @@ This is the structural shortcut used by the first Draisma--Vargas genus-four type. It is independent of that application and of any finite cone cover. -/ -@[expose] public section +public section namespace MarkedGraphs.Certificate.CoreBridgeCut.Data diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreExpansion.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreExpansion.lean index ff38414acc..56b76465d2 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreExpansion.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreExpansion.lean @@ -36,7 +36,7 @@ The output is a *topological contraction certificate* fibre is connected. Nothing here is specific to genus four. -/ -@[expose] public section +public section namespace Utilities.Subdivision.CoreExpansion open Utilities.Certificate @@ -111,6 +111,7 @@ theorem kindLength_pos (small : Spec n p) (k : SlotKind p) : /-- The vertex of the small subdivision sitting at path position `q` of a big slot with the given role. Positions beyond the slot are clamped, which keeps the definition total and free of transported bound proofs. -/ +@[expose] def kindVertex (small : Spec n p) (fallback : Fin n) : SlotKind p → ℕ → small.Vertex | .contracted, _ => small.coreVertex fallback @@ -157,6 +158,7 @@ namespace ExpansionData variable (D : ExpansionData n p N Q) (C : Core n p) /-- Endpoint compatibility of one big slot with its role. -/ +@[expose] def SlotCompatible (e : Fin Q) : Prop := (D.kind e = .contracted → D.fib (D.bigCore.tail e) = D.fib (D.bigCore.head e)) ∧ (∀ j : Fin p, D.kind e = .single j → @@ -166,12 +168,14 @@ def SlotCompatible (e : Fin Q) : Prop := D.fib (D.bigCore.head e) = C.head j₂) /-- `owner`/`side` really invert `kind`. -/ +@[expose] def SlotIndexed (e : Fin Q) : Prop := (∀ j : Fin p, D.kind e = .single j → D.owner j = e ∧ D.side j = false) ∧ (∀ j₁ j₂ : Fin p, D.kind e = .double j₁ j₂ → D.owner j₁ = e ∧ D.side j₁ = false ∧ D.owner j₂ = e ∧ D.side j₂ = true) /-- Every small slot really is claimed by its recorded owner. -/ +@[expose] def SlotClaimed (j : Fin p) : Prop := D.kind (D.owner j) ≠ .contracted ∧ (∀ j' : Fin p, D.kind (D.owner j) = .single j' → D.side j = false ∧ j' = j) ∧ @@ -180,6 +184,7 @@ def SlotClaimed (j : Fin p) : Prop := /-- The middle vertex of a double is a genuine bivalent marker: it is outside the image of the fibre map, and no other small slot ends there. -/ +@[expose] def MarkerIsolated (e : Fin Q) : Prop := ∀ j₁ j₂ : Fin p, D.kind e = .double j₁ j₂ → (∀ v : Fin N, D.fib v ≠ C.head j₁) ∧ @@ -187,6 +192,7 @@ def MarkerIsolated (e : Fin Q) : Prop := /-- All conditions a usable expansion datum has to satisfy. Every clause ranges over finite types, so the whole conjunction is decidable. -/ +@[expose] def Conditions : Prop := (∀ e : Fin Q, D.bigCore.tail e ≠ D.bigCore.head e) ∧ (∀ e : Fin Q, D.SlotCompatible C e) ∧ @@ -301,6 +307,7 @@ variable (small : Spec n p) /-- The two ordered-endpoint indicators of one unit step of a small slot, written through clamped path positions. -/ +@[expose] def smallStepTerm (j : Fin p) (a b : small.Vertex) (i : ℕ) : ℕ := (if small.pathVertex j ⟨min i (small.length j), by omega⟩ = a ∧ small.pathVertex j ⟨min (i + 1) (small.length j), by omega⟩ = b then 1 @@ -310,6 +317,7 @@ def smallStepTerm (j : Fin p) (a b : small.Vertex) (i : ℕ) : ℕ := /-- The two ordered-endpoint indicators of one unit step of a big slot, after applying the contraction. -/ +@[expose] def kindStepTerm (fallback : Fin n) (k : SlotKind p) (a b : small.Vertex) (i : ℕ) : ℕ := (if kindVertex small fallback k i = a ∧ @@ -570,6 +578,7 @@ variable (D : ExpansionData n p N Q) (small : Spec n p) (hN : 0 < N) (hL : ∀ e : Fin Q, D.bigCore.tail e ≠ D.bigCore.head e) /-- The contraction on subdivision vertices. -/ +@[expose] def vertexMap : (D.bigSpec small hN hL).Vertex → small.Vertex := fun x => match x with | Sum.inl v => small.coreVertex (D.fib v) @@ -1147,6 +1156,7 @@ variable (D : ExpansionData n p N Q) (small : Spec n p) (hN : 0 < N) (hL : ∀ e : Fin Q, D.bigCore.tail e ≠ D.bigCore.head e) /-- The contraction certificate attached to an expansion datum. -/ +@[expose] def certificate : GraphContractionCertificate (D.bigSpec small hN hL).graph small.graph where vertexMap := vertexMap D small hN hL diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreExpansionClosed.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreExpansionClosed.lean index 84fc6ac957..7fc3e33b06 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreExpansionClosed.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreExpansionClosed.lean @@ -24,7 +24,7 @@ the combinatorial heart of lowering a closed construction on a trivalent expansion back to the smaller core. -/ -@[expose] public section +public section namespace Utilities.Subdivision.CoreExpansion open Utilities diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CorePairMultiplicity.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CorePairMultiplicity.lean index ef94aafd8a..d6fe064d70 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CorePairMultiplicity.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CorePairMultiplicity.lean @@ -21,7 +21,7 @@ file) so that consumers of these three declarations do not pull in the occurrence-relabeling and replay machinery. -/ -@[expose] public section +public section namespace Utilities.Certificate @@ -32,6 +32,7 @@ variable {n p : ℕ} /-- The number of ordered edge slots of `core` whose two endpoints are exactly the unordered vertex pair `{i, j}`. Both orientations are counted, so the value is symmetric in `i` and `j`. -/ +@[expose] def pairMultiplicity (core : Core n p) (i j : Fin n) : ℕ := (Finset.univ.filter fun edge : Fin p => (core.tail edge = i ∧ core.head edge = j) ∨ diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreRelabeling.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreRelabeling.lean index 000cab3a6a..2eda780a82 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreRelabeling.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreRelabeling.lean @@ -19,7 +19,7 @@ provides that neutral bridge, independently of any genus, atlas, or marked graph application. -/ -@[expose] public section +public section namespace Utilities.Certificate.ExplicitPotential.Core open Utilities @@ -32,6 +32,7 @@ variable {n p m q : ℕ} /-! ## Relabeling one core by a vertex permutation -/ /-- Relabel the vertices of a core while leaving slot occurrences fixed. -/ +@[expose] def relabel (core : Core n p) (vertexPerm : Equiv.Perm (Fin n)) : Core n p where tail := fun edge => vertexPerm (core.tail edge) head := fun edge => vertexPerm (core.head edge) diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreSymmetry.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreSymmetry.lean index 9212126198..0efeb3b766 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreSymmetry.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreSymmetry.lean @@ -27,7 +27,7 @@ The declarations use the established `Utilities.Certificate.CoreOrbitReduction` namespace for API compatibility. -/ -@[expose] public section +public section namespace Utilities.Certificate.CoreOrbitReduction open Utilities.Certificate @@ -70,6 +70,7 @@ namespace CoreSymmetry variable {core : ExplicitPotential.Core n p} /-- The identity symmetry. -/ +@[expose] def refl (core : ExplicitPotential.Core n p) : CoreSymmetry core where vertexPerm := Equiv.refl _ slotPerm := Equiv.refl _ @@ -100,6 +101,7 @@ inverse function by hand. At a concrete core all four hypotheses are This is the public successor of the retired `Certificate/CoreAutomorphismOrbit.lean`'s `mkCoreSymmetry`, which was specialized to eight-vertex, twelve-slot cores. -/ +@[expose] noncomputable def ofMaps (core : ExplicitPotential.Core n p) (vertexMap : Fin n → Fin n) (slotMap : Fin p → Fin p) (reversed : Fin p → Bool) (hVertex : ∀ i j : Fin n, vertexMap i = vertexMap j → i = j) @@ -144,6 +146,7 @@ closed-orthant orbit and chamber arguments. forward and backward, reduces. **Use it whenever the symmetry will be fed to `reindexLength`**; `reindexLength_ofInverses` below is the one-line regression test that the reduction is really there. -/ +@[expose] def ofInverses (core : ExplicitPotential.Core n p) (vertexMap vertexInv : Fin n → Fin n) (slotMap slotInv : Fin p → Fin p) (reversed : Fin p → Bool) @@ -184,6 +187,7 @@ def ofInverses (core : ExplicitPotential.Core n p) hVL hVR hSL hSR hTail hHead).slotPerm.symm edge = slotInv edge := rfl /-- The composite of two core symmetries: apply `first`, then `second`. -/ +@[expose] def trans (first second : CoreSymmetry core) : CoreSymmetry core where vertexPerm := first.vertexPerm.trans second.vertexPerm slotPerm := first.slotPerm.trans second.slotPerm @@ -206,6 +210,7 @@ def trans (first second : CoreSymmetry core) : CoreSymmetry core where /-! ### Reindexing a length vector -/ /-- Transport a length vector along the slot permutation. -/ +@[expose] def reindexLength (symmetry : CoreSymmetry core) (length : Fin p → ℕ) : Fin p → ℕ := fun edge => length (symmetry.slotPerm.symm edge) @@ -272,6 +277,7 @@ Stating the two length vectors independently (rather than forcing `length' = reindexLength length`) is what lets the same lemma serve both the row packaging, which reindexes, and the catalog rows, which sort a chosen pair of parallel slots. -/ +@[expose] def relabeling (symmetry : CoreSymmetry core) (length length' : Fin p → ℕ) (hLength : ∀ edge, 0 < length edge) (hLength' : ∀ edge, 0 < length' edge) @@ -308,6 +314,7 @@ def graphIso (symmetry : CoreSymmetry core) hLength hLength' hCompat) /-- The vertex bijection carried by a core symmetry. -/ +@[expose] def vertexEquiv (symmetry : CoreSymmetry core) (length length' : Fin p → ℕ) (hLength : ∀ edge, 0 < length edge) (hLength' : ∀ edge, 0 < length' edge) diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreVertexCut.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreVertexCut.lean index 6f767cb711..022b9ffeef 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreVertexCut.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreVertexCut.lean @@ -23,7 +23,7 @@ to the complementary side is assigned wholly to the complementary factor; there is no length-dependent case split and parallel slots are retained. -/ -@[expose] public section +public section namespace Utilities.Certificate @@ -48,12 +48,14 @@ namespace Data variable {n p : ℕ} {core : ExplicitPotential.Core n p} /-- The complementary core side, retaining the articulation in both sides. -/ +@[expose] def right (c : Data core) : Finset (Fin n) := insert c.glue (univ \ c.left) /-- A core slot whose two non-articulation endpoints lie on opposite sides. Both orientations are included, since slots are stored as ordered pairs while the graph is undirected. -/ +@[expose] def Crosses (c : Data core) (edge : Fin p) : Prop := (core.tail edge ∈ c.left ∧ core.tail edge ≠ c.glue ∧ core.head edge ∉ c.left) ∨ @@ -66,10 +68,12 @@ instance crossesDecidable (c : Data core) (edge : Fin p) : infer_instance /-- Exact mathematical validity of passive core-cut data. -/ +@[expose] def Valid (c : Data core) : Prop := c.glue ∈ c.left ∧ ∀ edge : Fin p, ¬ c.Crosses edge /-- Transparent finite replay of `Valid`. -/ +@[expose] def check (c : Data core) : Bool := decide (c.glue ∈ c.left) && ExplicitPotential.allFin (fun edge : Fin p => decide (¬ c.Crosses edge)) @@ -96,6 +100,7 @@ variable (spec : SubdivisionGraph.Spec n p) /-- The named factor in a subdivision. An interior is admitted precisely when both endpoints of its original slot are admitted by the core cut. -/ +@[expose] noncomputable def leftVertices (c : Data spec.core) : Finset spec.Vertex := by classical exact Finset.univ.filter fun vertex => @@ -107,6 +112,7 @@ noncomputable def leftVertices (c : Data spec.core) : Finset spec.Vertex := by /-- The complementary subdivision factor. It is literally the complement of `leftVertices`, with the embedded articulation reinserted. -/ +@[expose] noncomputable def rightVertices (c : Data spec.core) : Finset spec.Vertex := insert (spec.coreVertex c.glue) (Finset.univ \ leftVertices spec c) @@ -215,6 +221,7 @@ theorem stepRight_eq_glue_of_mem_not_mem (h : c.Valid) /-- Lift valid finite core data to a literal one-vertex cut of every positive subdivision of that core. -/ +@[expose] noncomputable def toOneVertexCut (h : c.Valid) : OneVertexCut spec.graph where left := leftVertices spec c right := rightVertices spec c @@ -381,6 +388,7 @@ theorem satisfiesTransmission_map_wedgeAddDivisor_sameRight_of_profile /-- Accepted finite core data immediately yields a checked cut of any positive subdivision. -/ +@[expose] noncomputable def cutOfCheck (h : c.check = true) : OneVertexCut spec.graph := c.toOneVertexCut spec (c.check_eq_true_iff.mp h) diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreVertexCutGenus.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreVertexCutGenus.lean index 821e977bec..08a2ed5efd 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreVertexCutGenus.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreVertexCutGenus.lean @@ -22,7 +22,7 @@ cancel in Euler characteristic, leaving one edge-slot contribution. Hence the answer is independent of every subdivision length. -/ -@[expose] public section +public section namespace Utilities.Certificate @@ -34,6 +34,7 @@ namespace CoreVertexCut.Data variable {n p : ℕ} {core : ExplicitPotential.Core n p} /-- A core edge occurrence lies wholly in the named side. -/ +@[expose] def LeftSlot (c : CoreVertexCut.Data core) (edge : Fin p) : Prop := core.tail edge ∈ c.left ∧ core.head edge ∈ c.left @@ -43,6 +44,7 @@ instance leftSlotDecidable (c : CoreVertexCut.Data core) (edge : Fin p) : infer_instance /-- A core edge occurrence lies wholly in the derived complementary side. -/ +@[expose] def RightSlot (c : CoreVertexCut.Data core) (edge : Fin p) : Prop := core.tail edge ∈ c.right ∧ core.head edge ∈ c.right @@ -52,26 +54,32 @@ instance rightSlotDecidable (c : CoreVertexCut.Data core) (edge : Fin p) : infer_instance /-- Ordered core slots wholly contained in the named side. -/ +@[expose] def leftSlots (c : CoreVertexCut.Data core) : Finset (Fin p) := Finset.univ.filter c.LeftSlot /-- Ordered core slots wholly contained in the complementary side. -/ +@[expose] def rightSlots (c : CoreVertexCut.Data core) : Finset (Fin p) := Finset.univ.filter c.RightSlot /-- Executable number of ordered core slots in the named side. -/ +@[expose] def leftSlotCount (c : CoreVertexCut.Data core) : ℕ := c.leftSlots.card /-- Executable number of ordered core slots in the complementary side. -/ +@[expose] def rightSlotCount (c : CoreVertexCut.Data core) : ℕ := c.rightSlots.card /-- Cyclomatic genus predicted from the named core side. -/ +@[expose] def leftGenus (c : CoreVertexCut.Data core) : ℤ := (c.leftSlotCount : ℤ) - (c.left.card : ℤ) + 1 /-- Cyclomatic genus predicted from the complementary core side. -/ +@[expose] def rightGenus (c : CoreVertexCut.Data core) : ℤ := (c.rightSlotCount : ℤ) - (c.right.card : ℤ) + 1 diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreVertexCutGenusFour.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreVertexCutGenusFour.lean index 50f5dcaa7c..527ce2d014 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreVertexCutGenusFour.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreVertexCutGenusFour.lean @@ -19,7 +19,7 @@ side two-regular. The checker and its soundness theorem are public and apply uniformly to every positive subdivision. -/ -@[expose] public section +public section namespace Utilities.Certificate.CoreVertexCut.Data open MarkedGraphs.Certificate @@ -34,12 +34,14 @@ variable {n p : ℕ} {core : ExplicitPotential.Core n p} /-- The three finite factor alternatives consumed by the genus-four wedge theorems. The two-regular condition is required only on a genus-one side. -/ +@[expose] def GenusFourRankOneAlternatives (c : CoreVertexCut.Data core) : Prop := (c.leftGenus = 2 ∧ c.rightGenus = 2) ∨ (c.leftGenus = 3 ∧ c.RightTwoRegular ∧ c.rightGenus = 1) ∨ (c.LeftTwoRegular ∧ c.leftGenus = 1 ∧ c.rightGenus = 3) /-- Exact mathematical conditions for the genus-four cut argument. -/ +@[expose] def GenusFourRankOneConditions (c : CoreVertexCut.Data core) : Prop := c.Valid ∧ core.Connected ∧ c.GenusFourRankOneAlternatives diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreVertexCutRankOne.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreVertexCutRankOne.lean index 404499744d..090413064f 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreVertexCutRankOne.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreVertexCutRankOne.lean @@ -17,7 +17,7 @@ cycle after every positive subdivision. The public genus-three rigid-wedge theorem then supplies a degree-three rank-one divisor on the ambient graph. -/ -@[expose] public section +public section namespace Utilities.Certificate.CoreVertexCut.Data diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreVertexCutTwoRegular.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreVertexCutTwoRegular.lean index e53f33315a..34fd28d92e 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreVertexCutTwoRegular.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreVertexCutTwoRegular.lean @@ -23,7 +23,7 @@ interior path vertex has degree two. Together with core connectedness and a checked side genus of one, this constructs a `PointedGenusOneRigid` witness. -/ -@[expose] public section +public section namespace Utilities.Certificate @@ -37,6 +37,7 @@ variable {n p : ℕ} {core : ExplicitPotential.Core n p} /-- Number of incidences of retained ordered slots at a named-side core vertex. A parallel slot contributes separately; each endpoint contributes one incidence. -/ +@[expose] def leftIncidentDegree (c : CoreVertexCut.Data core) (vertex : Fin n) : ℕ := ∑ edge ∈ c.leftSlots, ((if core.tail edge = vertex then 1 else 0) + @@ -44,17 +45,20 @@ def leftIncidentDegree (c : CoreVertexCut.Data core) (vertex : Fin n) : ℕ := /-- Number of incidences of retained ordered slots at a complementary-side core vertex. -/ +@[expose] def rightIncidentDegree (c : CoreVertexCut.Data core) (vertex : Fin n) : ℕ := ∑ edge ∈ c.rightSlots, ((if core.tail edge = vertex then 1 else 0) + if core.head edge = vertex then 1 else 0) /-- Every core vertex retained by the named side has retained degree two. -/ +@[expose] def LeftTwoRegular (c : CoreVertexCut.Data core) : Prop := ∀ vertex : Fin n, vertex ∈ c.left → c.leftIncidentDegree vertex = 2 /-- Every core vertex retained by the complementary side has retained degree two. -/ +@[expose] def RightTwoRegular (c : CoreVertexCut.Data core) : Prop := ∀ vertex : Fin n, vertex ∈ c.right → c.rightIncidentDegree vertex = 2 @@ -474,11 +478,13 @@ variable {n p : ℕ} {core : ExplicitPotential.Core n p} /-- Exact finite conditions which make the named factor a pointed rigid genus-one graph. -/ +@[expose] def LeftRigidConditions (c : CoreVertexCut.Data core) : Prop := c.Valid ∧ core.Connected ∧ c.LeftTwoRegular ∧ c.leftGenus = 1 /-- Exact finite conditions which make the complementary factor a pointed rigid genus-one graph. -/ +@[expose] def RightRigidConditions (c : CoreVertexCut.Data core) : Prop := c.Valid ∧ core.Connected ∧ c.RightTwoRegular ∧ c.rightGenus = 1 diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreVertexReachability.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreVertexReachability.lean index 9d78276d02..e481826557 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreVertexReachability.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CoreVertexReachability.lean @@ -18,7 +18,7 @@ is the common final step shared by explicit-potential, loop-split, and local configuration certificates. -/ -@[expose] public section +public section namespace Utilities.Certificate.CoreVertexReachability diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CubicCore.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CubicCore.lean index 385205bb61..292880eba3 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CubicCore.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/CubicCore.lean @@ -16,13 +16,14 @@ slots are counted separately, and a loop contributes twice. Looplessness is an independent property. -/ -@[expose] public section +public section namespace Utilities.Certificate.ExplicitPotential.Core open Finset /-- Incidence degree, counting every ordered slot endpoint. -/ +@[expose] def incidenceDegree {n p : ℕ} (core : ExplicitPotential.Core n p) (vertex : Fin n) : ℕ := ∑ edge : Fin p, @@ -30,6 +31,7 @@ def incidenceDegree {n p : ℕ} (core : ExplicitPotential.Core n p) (if core.head edge = vertex then 1 else 0)) /-- Every vertex has exactly three incident slot endpoints. -/ +@[expose] def Cubic {n p : ℕ} (core : ExplicitPotential.Core n p) : Prop := ∀ vertex : Fin n, core.incidenceDegree vertex = 3 diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateAffinePosition.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateAffinePosition.lean index adcfa74247..a49e044c9c 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateAffinePosition.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateAffinePosition.lean @@ -38,7 +38,7 @@ boundary-safe *as a statement*; what is not boundary-safe is concluding "interior" from `0 < coordinate`. -/ -@[expose] public section +public section namespace MarkedGraphs.Certificate.AffinePosition open Utilities.Certificate @@ -105,6 +105,7 @@ variable (certificate : ExplicitPotential.CertificateData m n p) (code : Code m /-- Typed path position on the contracted subdivision, decoded from a cone-certified affine position. -/ +@[expose] def decodeDegeneratePosition {degree : ℤ} (hValid : certificate.ValidClosed degree) (hBounds : code.BoundsCertified certificate) diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateAffinePositionMultiBreak.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateAffinePositionMultiBreak.lean index 38c0313990..2f6d50ab54 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateAffinePositionMultiBreak.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateAffinePositionMultiBreak.lean @@ -35,7 +35,7 @@ certificates remain the existing `Code.BoundsCertified` facts, so all affine arithmetic is shared with the positive decoder. -/ -@[expose] public section +public section namespace MarkedGraphs.Certificate.AffinePosition open Utilities.Certificate diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateCoreVertexCut.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateCoreVertexCut.lean index f76e1b72fe..798a737512 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateCoreVertexCut.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateCoreVertexCut.lean @@ -78,7 +78,7 @@ assumed away: it as the field `core_loopless`; on a concrete row core it is `by decide`. -/ -@[expose] public section +public section namespace Utilities.Certificate.DegenerateSpec.DegSpec open Utilities.Certificate diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateInterpolation.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateInterpolation.lean index 4cc5d6a69d..9ea72dedcc 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateInterpolation.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateInterpolation.lean @@ -46,7 +46,7 @@ definitionally, so the certificate's endpoint bounds apply verbatim. Under (`coreRise_eq_zero_of_length_zero`). -/ -@[expose] public section +public section namespace Utilities.Certificate.DegenerateSpec open Utilities.Certificate @@ -62,6 +62,7 @@ variable {n p : ℕ} (d : DegSpec n p) /-! ## Potentials constant on the contracted classes -/ /-- A core potential that is constant on every contracted class. -/ +@[expose] def RepInvariant (potential : Fin n → ℤ) : Prop := ∀ v : Fin n, potential (d.rep v) = potential v @@ -77,6 +78,7 @@ theorem repInvariant_of_pos (hpos : ∀ e : Fin p, 0 < d.length e) /-- Rise of a core potential along an oriented edge slot. Verbatim the `Spec` definition; no `rep` appears. -/ +@[expose] def coreRise (potential : Fin n → ℤ) (e : Fin p) : ℤ := potential (d.core.head e) - potential (d.core.tail e) @@ -134,6 +136,7 @@ def pathValue (potential : Fin n → ℤ) (e : Fin p) (k : ℕ) : ℤ := /-- Extend a rep-invariant core potential over every surviving slot by the canonical convex interpolation. Collapsed slots contribute nothing: they carry no interior vertex and their two endpoints are already one class. -/ +@[expose] def interpolatedScript (potential : Fin n → ℤ) : firingScript d.graph := d.slotValueScript potential (d.pathValue potential) @@ -253,6 +256,7 @@ consumer-facing difference is the trichotomy: `pathVertex_zero`, collapsed slot the first two coincide. -/ /-- The path position at a numerical offset known not to pass the head. -/ +@[expose] def pathPosition (e : Fin p) (offset : ℕ) (hOffset : offset ≤ d.length e) : d.PathPosition e := ⟨offset, by omega⟩ diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateMultiBreakScript.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateMultiBreakScript.lean index 02b7142f3e..dff154a735 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateMultiBreakScript.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateMultiBreakScript.lean @@ -19,7 +19,7 @@ then supplies the resulting concrete lists here. A zero-length slot has no steps; `BreakData.balance` consequently forces its endpoint potential to agree. -/ -@[expose] public section +public section namespace Utilities.Certificate.DegenerateSpec open Utilities.Certificate diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegeneratePiecewiseInterpolation.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegeneratePiecewiseInterpolation.lean index e870067a05..8b722262f2 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegeneratePiecewiseInterpolation.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegeneratePiecewiseInterpolation.lean @@ -25,7 +25,7 @@ slot has no selected step, and `balance` then forces its two endpoint values to coincide. -/ -@[expose] public section +public section namespace Utilities.Certificate.DegenerateSpec open Utilities.Certificate @@ -40,10 +40,12 @@ variable {n p : ℕ} (d : DegSpec n p) /-- The left endpoint of a block. Block zero starts at the tail; every later block starts where its predecessor ended. -/ +@[expose] def blockStart (blockEnd : Fin p → ℕ → ℕ) (e : Fin p) (block : ℕ) : ℕ := if block = 0 then 0 else blockEnd e (block - 1) /-- The canonical slope at a unit step, selected from its containing block. -/ +@[expose] def blockSlope (blockAt blockEnd : Fin p → ℕ → ℕ) (blockRise : Fin p → ℕ → ℤ) (e : Fin p) (k : ℕ) : ℤ := let block := blockAt e k diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateRamp.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateRamp.lean index 6874e611f9..166f4799fa 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateRamp.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateRamp.lean @@ -56,7 +56,7 @@ open `RampData`. Stating the closed analogue here, on an arbitrary copy. -/ -@[expose] public section +public section namespace Utilities.Certificate.DegenerateSpec open Utilities.Certificate @@ -93,6 +93,7 @@ structure RampData (d : DegSpec n p) (pot : Fin n → ℤ) (sgn : Fin p → ℤ) repInv : ∀ v : Fin n, pot (d.rep v) = pot v /-- The ramp firing script. -/ +@[expose] def rampScript (d : DegSpec n p) (pot : Fin n → ℤ) (sgn : Fin p → ℤ) (lo : Fin p → ℕ) (t : ℕ) : firingScript d.graph := d.slotValueScript pot (d.rampValue pot sgn lo t) diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateRankOne.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateRankOne.lean index e0d44a3b12..0e656da1ca 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateRankOne.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateRankOne.lean @@ -51,7 +51,7 @@ names the face and the certificate does not. `ZeroReach` and chain; that is the exact join with the contraction census. -/ -@[expose] public section +public section namespace Utilities.Certificate open Utilities.Certificate @@ -255,6 +255,7 @@ theorem classEndpointContribution_eq_of_rep_id (certificate : CertificateData m /-! ## Rep-invariance of the anchor potential -/ /-- Two core vertices joined by one collapsed slot. -/ +@[expose] def ZeroLink (certificate : CertificateData m n p) (point : Fin m → ℤ) (u v : Fin n) : Prop := ∃ e : Fin p, certificate.segmentNat point e = 0 ∧ @@ -263,6 +264,7 @@ def ZeroLink (certificate : CertificateData m n p) (point : Fin m → ℤ) /-- Joined by a chain of collapsed slots. This is the relation a contraction census decides; `rep` is meant to be its component map. -/ +@[expose] def ZeroReach (certificate : CertificateData m n p) (point : Fin m → ℤ) : Fin n → Fin n → Prop := Relation.ReflTransGen (certificate.ZeroLink point) @@ -365,6 +367,7 @@ end Face of its members' chips, and every interior vertex carries none. This is the shape change forced by non-injectivity of `coreVertex`. -/ +@[expose] def degenerateDivisor (certificate : CertificateData m n p) (d : Utilities.Certificate.DegenerateSpec.DegSpec n p) : CFDiv d.graph := d.coreClassDivisor certificate.divisor @@ -561,6 +564,7 @@ end Assembly /-- The embedded core classes of a contracted subdivision. `coreVertex` is not injective, so this image can be strictly smaller than `n`. -/ +@[expose] def degenerateCoreVertices (d : Utilities.Certificate.DegenerateSpec.DegSpec n p) : Finset d.graph.V := Finset.univ.image d.coreVertex diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateRepRigidity.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateRepRigidity.lean index ef7ee8a31e..141fcdf525 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateRepRigidity.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateRepRigidity.lean @@ -60,7 +60,7 @@ the accompanying analysis measures how many such faces a genus-five legged row has. -/ -@[expose] public section +public section -- `Certificate` is a structure inside a namespace already ending in `Certificate`. namespace Utilities.Certificate.DegenerateSpec.DegSpec @@ -195,6 +195,7 @@ end RepIndependence /-- The vanishing slots of a degenerate spec. Syntactically the `Finset` appearing in the `forest` field. -/ +@[expose] def zeroSlotSet (d : DegSpec n p) : Finset (Fin p) := Finset.univ.filter (fun e => d.length e = 0) @@ -208,6 +209,7 @@ theorem forest' (d : DegSpec n p) : /-- **The classes of `rep` are generated by the vanishing slots.** `rep_zero` is the easy direction; this is the converse, which a bare `DegSpec` does not carry. It holds by definition for every `rep` built as a `compFold`. -/ +@[expose] def RepIsContraction (d : DegSpec n p) : Prop := ∀ u v : Fin n, d.rep u = d.rep v → ReachIn d.core d.zeroSlotSet u v @@ -328,6 +330,7 @@ that is, by exactly the `rep` a census-facing producer builds No `¬ IsLoopy` hypothesis is needed: `rep_loopless` is inherited from `d` through `rep_eq_of_compFold_eq`. -/ +@[expose] def censusFace (d : DegSpec n p) (hForest : IsForest d.core d.zeroSlotSet) : DegSpec n p where core := d.core diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateSeparator.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateSeparator.lean index 4eb3ac8038..e33428c7e9 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateSeparator.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateSeparator.lean @@ -59,7 +59,7 @@ is the image `Finset` `degenerateCoreVertices d`, which is exactly the set of `coreVertices` of the contracted target without ever asserting injectivity. -/ -@[expose] public section +public section namespace Utilities.Certificate.DegenerateSpec.DegSpec open Utilities.Certificate @@ -79,9 +79,11 @@ theorem class_nonempty : Nonempty d.Class := ⟨⟨d.rep ⟨0, d.core_nonempty⟩, d.rep_idem _⟩⟩ /-- Number of contracted core classes. -/ +@[expose] def classCard : ℕ := Fintype.card d.Class /-- Number of surviving slots. -/ +@[expose] def slotCard : ℕ := Fintype.card d.PositiveSlot /-- An indexing of the contracted classes. Any bijection will do; the @@ -98,6 +100,7 @@ theorem classCard_pos : 0 < d.classCard := /-- The contracted core: one vertex per `rep`-class, one slot per surviving slot, endpoints taken `rep`-wise. -/ +@[expose] noncomputable def contractedCore : ExplicitPotential.Core d.classCard d.slotCard where tail := fun e' => d.classIndex ⟨d.rep (d.core.tail (d.slotIndex.symm e').val), d.rep_idem _⟩ @@ -107,6 +110,7 @@ noncomputable def contractedCore : ExplicitPotential.Core d.classCard d.slotCard /-- **The canonical contraction target.** A genuinely positive `SubdivisionGraph.Spec`, so every lemma of the open-orthant layer applies to it verbatim. -/ +@[expose] noncomputable def contractedSpec : SubdivisionGraph.Spec d.classCard d.slotCard where core := d.contractedCore @@ -121,6 +125,7 @@ noncomputable def contractedSpec : /-- The `DegSpec` is a contraction onto its canonical target. This is the datum a row would otherwise have to produce by hand. -/ +@[expose] noncomputable def canonicalContraction : Contraction d d.contractedSpec where vtx := fun v' => (d.classIndex.symm v').val vtx_rep := fun v' => (d.classIndex.symm v').property diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateSlopeScript.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateSlopeScript.lean index 06058c04cf..d505f74f87 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateSlopeScript.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateSlopeScript.lean @@ -46,7 +46,7 @@ whole economic argument for the closed-orthant layer, and it is a theorem here. -/ -@[expose] public section +public section namespace Utilities.Certificate.DegenerateSpec open Utilities.Certificate @@ -195,6 +195,7 @@ theorem prin_eq_sum_steps (script : firingScript d.graph) (v : d.Vertex) : /-- A slope datum for a firing script: the script rises by `slope edge k` across the `k`-th unit step of slot `edge`. Vanishing slots impose no condition, since they carry no unit step. -/ +@[expose] def IsStepSlope (script : firingScript d.graph) (slope : Fin p → ℕ → ℤ) : Prop := ∀ (e : Fin p) (o : Fin (d.length e)), @@ -373,6 +374,7 @@ theorem le_sum_of_member {F : Fin n → ℤ} (r u : Fin n) /-- The script whose value at path position `k` of slot `edge` is `value edge k`, and `potential (rep v)` at the class of the core vertex `v`. -/ +@[expose] def slotValueScript (potential : Fin n → ℤ) (value : Fin p → ℕ → ℤ) : firingScript d.graph | Sum.inl c => potential c.val diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateSpec.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateSpec.lean index fc71160202..8bb78b0472 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateSpec.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateSpec.lean @@ -59,7 +59,7 @@ The two bridges are `DegSpec` *is* an ordinary `Spec`, with `rep = id`. -/ -@[expose] public section +public section namespace Utilities.Certificate.DegenerateSpec open Utilities.Certificate @@ -117,10 +117,12 @@ abbrev Vertex := d.Class ⊕ d.Interior abbrev Step := Σ e : Fin p, Fin (d.length e) /-- The class of a core vertex, as a vertex of the degenerate subdivision. -/ +@[expose] def coreVertex (v : Fin n) : d.Vertex := Sum.inl ⟨d.rep v, d.rep_idem v⟩ /-- The interior vertex at zero-based offset `o` on a slot, corresponding to path position `o + 1`. -/ +@[expose] def interiorVertex (e : Fin p) (o : Fin (d.length e - 1)) : d.Vertex := Sum.inr ⟨e, o⟩ @@ -132,16 +134,19 @@ theorem coreVertex_eq_iff (u v : Fin n) : · intro h; rw [Sum.inl.injEq]; exact Subtype.ext h /-- The left vertex of a unit step, using the tail core class at the initial step. -/ +@[expose] def stepLeft (e : Fin p) (o : Fin (d.length e)) : d.Vertex := if hzero : o.val = 0 then d.coreVertex (d.core.tail e) else d.interiorVertex e ⟨o.val - 1, by have := o.isLt; omega⟩ /-- The right vertex of a unit step, using the head core class at the final step. -/ +@[expose] def stepRight (e : Fin p) (o : Fin (d.length e)) : d.Vertex := if hlast : o.val + 1 = d.length e then d.coreVertex (d.core.head e) else d.interiorVertex e ⟨o.val, by have := o.isLt; omega⟩ /-- The ordered endpoint pair of a unit-step occurrence in the degenerate subdivision. -/ +@[expose] def unitEdge (s : d.Step) : d.Vertex × d.Vertex := (d.stepLeft s.1 s.2, d.stepRight s.1 s.2) @@ -193,6 +198,7 @@ abbrev PathPosition (e : Fin p) := Fin (d.length e + 1) /-- Decode a slot position as its tail, interior, or head vertex; a zero-length slot has a single contracted endpoint. -/ +@[expose] def pathVertex (e : Fin p) (k : d.PathPosition e) : d.Vertex := if hzero : k.val = 0 then d.coreVertex (d.core.tail e) else if hlast : k.val = d.length e then d.coreVertex (d.core.head e) @@ -222,6 +228,7 @@ theorem pathVertex_eq_of_val_eq (e : Fin p) {j k : d.PathPosition e} /-- A path position clamped into range. On a slot the certificate actually uses this is the identity; it exists so that a *generic* statement can name a position on every slot without carrying a bound for the slots it ignores. -/ +@[expose] def clampPos (d : DegSpec n p) (e : Fin p) (k : ℕ) : d.PathPosition e := ⟨min k (d.length e), by omega⟩ @@ -241,6 +248,7 @@ clamped to the head, which is where a chip pushed off the end belongs. It lives here rather than beside its first consumer because the two consumers sit on independent branches of the tower: ramp scripts read chips off it, and `Certificate/ScaleQReduced.lean` walks along it. -/ +@[expose] def pathAt (d : DegSpec n p) (e : Fin p) (k : ℕ) : d.Vertex := d.pathVertex e (d.clampPos e k) @@ -456,6 +464,7 @@ theorem classMap_bijective : Function.Bijective c.classMap := by exact ⟨v', Subtype.ext (hv'.trans hv)⟩ /-- Interior half of the vertex bijection. -/ +@[expose] def interiorMap : (Σ e' : Fin p', Fin (target.length e' - 1)) → d.Interior := fun s => ⟨c.slot s.1, ⟨s.2.val, by have := s.2.isLt @@ -480,6 +489,7 @@ theorem interiorMap_bijective : Function.Bijective c.interiorMap := by exact congrArg (Sigma.mk (c.slot e')) (Fin.ext rfl) /-- Unit-step bijection. -/ +@[expose] def stepMap : target.Step → d.Step := fun s => ⟨c.slot s.1, ⟨s.2.val, by have := s.2.isLt @@ -504,12 +514,14 @@ theorem stepMap_bijective : Function.Bijective c.stepMap := by exact congrArg (Sigma.mk (c.slot e')) (Fin.ext rfl) /-- Vertex bijection of the correspondence. -/ +@[expose] noncomputable def vertexEquiv : target.Vertex ≃ d.Vertex := Equiv.sumCongr (Equiv.ofBijective _ c.classMap_bijective) (Equiv.ofBijective _ c.interiorMap_bijective) /-- The bijection from unit steps in the positive contracted presentation to surviving unit steps in the closed presentation, preserving offsets. -/ +@[expose] noncomputable def stepEquiv : target.Step ≃ d.Step := Equiv.ofBijective _ c.stepMap_bijective @@ -569,6 +581,7 @@ theorem unitEdge_stepEquiv (s : target.Step) : /-- **The correspondence.** A face of the closed orthant whose zero set is a forest carries the same Laplacian as the strictly positive subdivision of the contracted core. -/ +@[expose] noncomputable def laplacianEquiv : LaplacianEquiv target.graph d.graph where toEquiv := c.vertexEquiv num_edges_eq := by @@ -631,6 +644,7 @@ theorem rep_eq_self_of_pos (hpos : ∀ e : Fin p, 0 < d.length e) (v : Fin n) : /-- A degenerate spec with strictly positive lengths *is* an ordinary subdivision spec on the same core and lengths. -/ +@[expose] def toSpec (hpos : ∀ e : Fin p, 0 < d.length e) : SubdivisionGraph.Spec n p where core := d.core length := d.length @@ -670,6 +684,7 @@ theorem bnExists_toSpec_iff (hpos : ∀ e : Fin p, 0 < d.length e) (r deg : ℤ) /-- Push arbitrary core weights to contracted core classes. A class carries the sum of its members' weights and subdivision-interior vertices carry zero. -/ +@[expose] def coreClassDivisor (weight : Fin n → ℤ) : CFDiv d.graph | Sum.inl c => ∑ v ∈ Finset.univ.filter (fun v : Fin n => d.rep v = c.val), weight v diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateSpecCensus.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateSpecCensus.lean index 01ea7a1f76..009c208d21 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateSpecCensus.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateSpecCensus.lean @@ -54,7 +54,7 @@ below is the resulting one-call wrapper, shaped to exactly match conclusion. -/ -@[expose] public section +public section namespace Utilities.Certificate open Utilities.Certificate @@ -81,6 +81,7 @@ variable {m n p : ℕ} /-- The slots that vanish at `point`: exactly the `Finset` a contraction census classifies. -/ +@[expose] def zeroSlots (certificate : CertificateData m n p) (point : Fin m → ℤ) : Finset (Fin p) := Finset.univ.filter (fun edge => certificate.segmentNat point edge = 0) @@ -98,6 +99,7 @@ theorem not_mem_zeroSlots_of_pos (certificate : CertificateData m n p) (point : /-- **The census-produced `rep`.** No row ever writes this by hand: it is the union-find component map of the vanishing-slot set. -/ +@[expose] def censusRep (certificate : CertificateData m n p) (point : Fin m → ℤ) : Fin n → Fin n := compFold certificate.core (certificate.zeroSlots point) diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateSubdivisionIso.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateSubdivisionIso.lean index c1fa8d3717..ddc0f17cc9 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateSubdivisionIso.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DegenerateSubdivisionIso.lean @@ -28,7 +28,7 @@ Slot reversal is part of the datum, just as it is for the positive-length inside a surviving slot; the quotient-class boundary is unchanged. -/ -@[expose] public section +public section namespace Utilities.Certificate.DegenerateSpec.DegSpec open Utilities.Certificate @@ -80,12 +80,14 @@ def stepOffsetEquiv (e : Fin p) : (finCongr (r.length_eq e)) /-- The vertex equivalence induced by a closed-face relabeling. -/ +@[expose] def vertexEquiv : source.Vertex ≃ target.Vertex := Equiv.sumCongr r.classEquiv (Equiv.sigmaCongr r.slotEquiv (fun e => interiorEquiv source target r e)) /-- The unit-step occurrence equivalence induced by a closed-face relabeling. -/ +@[expose] def stepEquiv : source.Step ≃ target.Step := Equiv.sigmaCongr r.slotEquiv (fun e => stepOffsetEquiv source target r e) diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DiscreteSpecialization.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DiscreteSpecialization.lean index 0433a04af4..4f555f5447 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DiscreteSpecialization.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DiscreteSpecialization.lean @@ -25,7 +25,7 @@ slots, increasing the outgoing endpoint contributions preserves effectivity. This isolates the graph bookkeeping from the integer rounding argument. -/ -@[expose] public section +public section namespace Utilities.Certificate.DiscreteSpecialization @@ -230,6 +230,7 @@ open Utilities.CommonOffsetRounding variable {n p : ℕ} /-- The positive graph used to prove a specified contraction face. -/ +@[expose] def stretch (d : DegSpec n p) (N : ℕ) (hN : 0 < N) (hLoopless : ∀ e, d.core.tail e ≠ d.core.head e) : Spec n p where core := d.core diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DoubledAnchorChecks.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DoubledAnchorChecks.lean index 341b8aa39d..cecdf500f8 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DoubledAnchorChecks.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/DoubledAnchorChecks.lean @@ -36,7 +36,7 @@ theorems that consume them — `effective_degenerateDivisor_sub_smul_one_chip`, only consumers are. -/ -@[expose] public section +public section -- The established name of the certificate namespace repeats `Certificate`, -- which is what `ExplicitPotential.CertificateData` means. Lean v4.33 added @@ -76,6 +76,7 @@ def dominatesMarkCheck (certificate : CertificateData m n p) (mark : Fin n) /-- The target coefficient at a core vertex after removing `mult` chips at the anchor. At `mult = 1` this is `targetCoefficient`, syntactically. -/ +@[expose] def multTargetCoefficient (certificate : CertificateData m n p) (mult : ℤ) (anchor vertex : Fin n) : ℤ := certificate.divisor vertex - if vertex = anchor then mult else 0 diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ExplicitPotential.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ExplicitPotential.lean index 68a8bbc28d..b050e1b266 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ExplicitPotential.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ExplicitPotential.lean @@ -34,7 +34,7 @@ actual firing script on a subdivision graph. The graph-construction layer is kept separate so that this file remains a small arithmetic trust boundary. -/ -@[expose] public section +public section namespace Utilities.Certificate @@ -49,6 +49,7 @@ abbrev AffineForm (m : ℕ) := AffineCover.AffineForm m abbrev FormsHold {m : ℕ} := AffineCover.FormsHold (m := m) /-- Executable universal quantification over a finite index type. -/ +@[expose] def allFin {k : ℕ} (test : Fin k → Bool) : Bool := AffineCover.allFin test @@ -94,17 +95,20 @@ namespace AffineForm /-- Integral scalar multiplication, kept explicit to make the generated data grammar independent of typeclass inference. -/ +@[expose] def scale (scalar : ℤ) (form : AffineForm m) : AffineForm m where fixedValue := scalar * form.fixedValue coefficient := fun coordinate => scalar * form.coefficient coordinate /-- Difference of two integral affine forms. -/ +@[expose] def sub (left right : AffineForm m) : AffineForm m where fixedValue := left.fixedValue - right.fixedValue coefficient := fun coordinate => left.coefficient coordinate - right.coefficient coordinate /-- The strict-integral positivity row `form(point) - 1 >= 0`. -/ +@[expose] def positive (form : AffineForm m) : AffineForm m where fixedValue := form.fixedValue - 1 coefficient := form.coefficient @@ -147,6 +151,7 @@ end AffineForm namespace CertificateData /-- The potential rise from the tail to the head of one expanded edge. -/ +@[expose] def rise (certificate : CertificateData m n p) (anchor : Fin n) (edge : Fin p) : AffineForm m := AffineForm.sub @@ -154,6 +159,7 @@ def rise (certificate : CertificateData m n p) (anchor : Fin n) ((certificate.witness anchor).potential (certificate.core.tail edge)) /-- The displayed lower endpoint inequality `rise - alpha * length >= 0`. -/ +@[expose] def lowerForm (certificate : CertificateData m n p) (anchor : Fin n) (edge : Fin p) : AffineForm m := AffineForm.sub (certificate.rise anchor edge) @@ -162,6 +168,7 @@ def lowerForm (certificate : CertificateData m n p) (anchor : Fin n) /-- The displayed upper endpoint inequality `-beta * length - rise >= 0`. -/ +@[expose] def upperForm (certificate : CertificateData m n p) (anchor : Fin n) (edge : Fin p) : AffineForm m := AffineForm.sub @@ -170,11 +177,13 @@ def upperForm (certificate : CertificateData m n p) (anchor : Fin n) (certificate.rise anchor edge) /-- The target coefficient at a core vertex after removing the anchor chip. -/ +@[expose] def targetCoefficient (certificate : CertificateData m n p) (anchor vertex : Fin n) : ℤ := certificate.divisor vertex - if vertex = anchor then 1 else 0 /-- The conservative endpoint contribution checked before seeing any lengths. -/ +@[expose] def lowerEndpointContribution (certificate : CertificateData m n p) (anchor vertex : Fin n) : ℤ := ∑ edge : Fin p, @@ -184,6 +193,7 @@ def lowerEndpointContribution (certificate : CertificateData m n p) (certificate.witness anchor).beta edge else 0)) /-- Point-independent exact validity of a passive local record. -/ +@[expose] def Valid (certificate : CertificateData m n p) (degree : ℤ) : Prop := (∀ edge : Fin p, certificate.core.tail edge ≠ certificate.core.head edge) ∧ (∑ vertex : Fin n, certificate.divisor vertex) = degree ∧ @@ -260,6 +270,7 @@ theorem segment_positive_of_valid omega /-- The natural-number segment length decoded from an integral point. -/ +@[expose] def segmentNat (certificate : CertificateData m n p) (point : Fin m → ℤ) (edge : Fin p) : ℕ := ((certificate.segment edge).eval point).toNat @@ -283,6 +294,7 @@ theorem segmentNat_positive exact_mod_cast hPositive /-- Numerical core-potential rise at one integral length point. -/ +@[expose] def riseValue (certificate : CertificateData m n p) (anchor : Fin n) (point : Fin m → ℤ) (edge : Fin p) : ℤ := (certificate.rise anchor edge).eval point @@ -334,6 +346,7 @@ theorem interpolated_endpoint_bounds · simpa only [hCast] using hBounds.2 /-- Actual interpolated endpoint contribution at a core vertex. -/ +@[expose] def endpointContribution (certificate : CertificateData m n p) (anchor : Fin n) (point : Fin m → ℤ) (vertex : Fin n) : ℤ := ∑ edge : Fin p, diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ExplicitPotentialRankOne.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ExplicitPotentialRankOne.lean index c83dac30d1..8e91d35f5e 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ExplicitPotentialRankOne.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ExplicitPotentialRankOne.lean @@ -25,7 +25,7 @@ The remaining graph-theoretic input is the uniform statement that the core vertices form a strong separator in a subdivision. -/ -@[expose] public section +public section namespace Utilities.Certificate @@ -290,6 +290,7 @@ namespace ExplicitPotential.CertificateData /-- The concrete subdivision specified by an integral point of a checked local cone. -/ +@[expose] def subdivisionSpec (certificate : ExplicitPotential.CertificateData m n p) (point : Fin m → ℤ) (core_nonempty : 0 < n) {degree : ℤ} (hValid : certificate.Valid degree) @@ -309,6 +310,7 @@ def subdivisionDivisor (certificate : ExplicitPotential.CertificateData m n p) | Sum.inr _interior => 0 /-- Evaluate one affine core potential at the chosen integral length point. -/ +@[expose] def evaluatedPotential (certificate : ExplicitPotential.CertificateData m n p) (anchor : Fin n) (point : Fin m → ℤ) (vertex : Fin n) : ℤ := ((certificate.witness anchor).potential vertex).eval point @@ -438,6 +440,7 @@ theorem reaches_coreVertex (divisor - oneChip (spec.coreVertex anchor)) script /-- The embedded core vertices of a subdivision. -/ +@[expose] def coreVertices (spec : SubdivisionGraph.Spec n p) : Finset spec.graph.V := Finset.univ.image spec.coreVertex diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/GraphIsoLaplacianEquiv.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/GraphIsoLaplacianEquiv.lean index 0b0e3e6a15..497f968b16 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/GraphIsoLaplacianEquiv.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/GraphIsoLaplacianEquiv.lean @@ -19,7 +19,7 @@ conversions, so results from either layer can be used without rebuilding that data by hand. -/ -@[expose] public section +public section namespace Utilities @@ -31,6 +31,7 @@ variable {G : CFGraph.{u}} {H : CFGraph.{v}} /-- Regard a chip-firing graph isomorphism as a Laplacian-preserving vertex equivalence. -/ +@[expose] def toLaplacianEquiv (φ : CFGraphIso G H) : Certificate.LaplacianEquiv G H where toEquiv := φ.vertexEquiv num_edges_eq := φ.map_num_edges @@ -50,6 +51,7 @@ variable {G : CFGraph.{u}} {H : CFGraph.{v}} /-- Regard a Laplacian-preserving vertex equivalence as a chip-firing graph isomorphism. -/ +@[expose] def toGraphIso (equivalence : LaplacianEquiv G H) : CFGraphIso G H where vertexEquiv := equivalence.toEquiv map_num_edges := equivalence.num_edges_eq diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/IteratedSplitRefinement.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/IteratedSplitRefinement.lean index e3931982c1..53c61cb110 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/IteratedSplitRefinement.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/IteratedSplitRefinement.lean @@ -23,7 +23,7 @@ finite chain of positive bivalent refinements. In particular, Brill--Noether existence is invariant along the whole chain. -/ -@[expose] public section +public section namespace Utilities.Certificate.IteratedSplitRefinement @@ -50,6 +50,7 @@ abbrev Vertex (packed : PackedSpec) : Type := packed.spec.Vertex end PackedSpec /-- The target presentation produced by one canonical bivalent split. -/ +@[expose] def splitPacked (source : PackedSpec) (split : Fin source.p) (first second : ℕ) (hFirst : 0 < first) (hSecond : 0 < second) : PackedSpec where diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/LaplacianEquiv.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/LaplacianEquiv.lean index da989b7870..3c29a6f3e2 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/LaplacianEquiv.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/LaplacianEquiv.lean @@ -19,7 +19,7 @@ Brill--Noether existence transport without requiring a general graph isomorphism API. -/ -@[expose] public section +public section namespace Utilities.Certificate @@ -49,6 +49,7 @@ instance : CoeFun (LaplacianEquiv G H) (fun _ => G.V → H.V) := basic transport API rather than in a particular subdivision construction, so proof-carrying normalization certificates can combine independent graph presentations without changing universes. -/ +@[expose] def trans {K : CFGraph.{w}} (first : LaplacianEquiv G H) (second : LaplacianEquiv H K) : LaplacianEquiv G K where toEquiv := first.toEquiv.trans second.toEquiv @@ -59,6 +60,7 @@ def trans {K : CFGraph.{w}} (first : LaplacianEquiv G H) rw [second.num_edges_eq, first.num_edges_eq] /-- Reverse an adjacency-preserving vertex equivalence. -/ +@[expose] def symm (equivalence : LaplacianEquiv G H) : LaplacianEquiv H G where toEquiv := equivalence.toEquiv.symm num_edges_eq := by @@ -68,10 +70,12 @@ def symm (equivalence : LaplacianEquiv G H) : LaplacianEquiv H G where (equivalence.toEquiv.symm x) (equivalence.toEquiv.symm y)).symm /-- Transport a divisor forward along the vertex equivalence. -/ +@[expose] def mapDiv (equivalence : LaplacianEquiv G H) (D : CFDiv G) : CFDiv H := fun y => D (equivalence.toEquiv.symm y) /-- Transport a firing script forward along the vertex equivalence. -/ +@[expose] def mapScript (equivalence : LaplacianEquiv G H) (script : firingScript G) : firingScript H := fun y => script (equivalence.toEquiv.symm y) @@ -303,20 +307,20 @@ namespace LaplacianEquiv.Examples abbrev PairVertex := Fin 2 /-- Two vertices joined by two parallel edges. -/ -def parallelPair : CFGraph where +@[expose] def parallelPair : CFGraph where V := PairVertex edges := Multiset.ofList [(0, 1), (0, 1)] loopless := by decide /-- The same parallel pair with both endpoint labels exchanged. -/ -def relabeledParallelPair : CFGraph where +@[expose] def relabeledParallelPair : CFGraph where V := PairVertex edges := Multiset.ofList [(1, 0), (1, 0)] loopless := by decide /-- Swapping the two labels preserves every Laplacian entry, including the off-diagonal multiplicity two. -/ -def parallelPairEquiv : LaplacianEquiv parallelPair relabeledParallelPair where +@[expose] def parallelPairEquiv : LaplacianEquiv parallelPair relabeledParallelPair where toEquiv := Equiv.swap (0 : PairVertex) (1 : PairVertex) num_edges_eq := by decide diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/LaplacianEquivSeparator.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/LaplacianEquivSeparator.lean index 3c0319312a..07b99d0835 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/LaplacianEquivSeparator.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/LaplacianEquivSeparator.lean @@ -36,7 +36,7 @@ false, we run it on the contracted *positive* spec, where it applies verbatim, and pull the resulting certificate back along the equivalence. -/ -@[expose] public section +public section namespace Utilities.Certificate open Utilities.Certificate diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/LeafExtension.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/LeafExtension.lean index 1148ab1ed3..2009984727 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/LeafExtension.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/LeafExtension.lean @@ -22,7 +22,7 @@ The resulting rank-one interface shows that adjoining or pruning a leaf does not change divisorial gonality. -/ -@[expose] public section +public section namespace Utilities.Certificate @@ -191,11 +191,13 @@ theorem graph_connected_addLeaf (hH : graphConnected H) : exact ⟨none, hLeaf, some root, hRoot, by simp⟩ /-- Extend an old divisor by zero at the new leaf. -/ +@[expose] def extendDiv (D : CFDiv H) : CFDiv (addLeaf H root) | none => 0 | some x => D x /-- Extend a firing script constantly across the new leaf edge. -/ +@[expose] def extendScript (script : firingScript H) : firingScript (addLeaf H root) | none => script root | some x => script x @@ -405,6 +407,7 @@ theorem bnExists_rank_one_addLeaf {d : ℤ} : /-! ## Retracting the added leaf -/ /-- Move the coefficient at the new leaf into its old neighbour. -/ +@[expose] def retractDiv (E : CFDiv (addLeaf H root)) : CFDiv H := fun x => E (some x) + if x = root then E none else 0 diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/LeafPruning.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/LeafPruning.lean index f7a1430944..35cdf71fa1 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/LeafPruning.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/LeafPruning.lean @@ -19,7 +19,7 @@ the corresponding explicit leaf extension. The rank-one lifting theorem is then an immediate composition of the two small certificate interfaces. -/ -@[expose] public section +public section namespace Utilities.Certificate diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/LeafReduction.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/LeafReduction.lean index 868b101323..f5e2f4d095 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/LeafReduction.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/LeafReduction.lean @@ -27,7 +27,7 @@ still needs a well-founded wrapper (for example, recursion on the number of vertices) and a choice of a degree-one vertex at every nonterminal step. -/ -@[expose] public section +public section namespace Utilities.Certificate diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/LegSplit.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/LegSplit.lean index 8364c2ab5b..3256ffa462 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/LegSplit.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/LegSplit.lean @@ -29,7 +29,7 @@ are exactly bivalent in the edge graph (their leg supplies the third incidence) and every other vertex is exactly trivalent. -/ -@[expose] public section +public section namespace Utilities.Certificate.ExplicitPotential @@ -41,6 +41,7 @@ variable {n p : ℕ} slot keeps the tail and is redirected into the fresh vertex; the fresh last slot runs from the fresh vertex to the old head. Definitionally the core of `OneEdgeSplitRefinement.splitCore` (see `legSplit_eq_splitCore`). -/ +@[expose] def legSplit (core : Core n p) (slot : Fin p) : Core (n + 1) (p + 1) where tail := Fin.lastCases (Fin.last n) (fun edge => (core.tail edge).castSucc) head := Fin.lastCases ((core.head slot).castSucc) diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/MovingPosition.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/MovingPosition.lean index 4ec611ab25..3430c1c4b9 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/MovingPosition.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/MovingPosition.lean @@ -19,7 +19,7 @@ vertices of `SubdivisionGraph.Spec`, with the elementary endpoint and interiority facts kept independent of any particular configuration. -/ -@[expose] public section +public section namespace Utilities.Certificate @@ -29,6 +29,7 @@ variable {n p : ℕ} (spec : SubdivisionGraph.Spec n p) /-- The path position at a natural offset known to be no further than the head endpoint. -/ +@[expose] def pathPosition (edge : Fin p) (offset : ℕ) (hOffset : offset ≤ spec.length edge) : spec.PathPosition edge := ⟨offset, by omega⟩ @@ -94,6 +95,7 @@ theorem isInteriorPosition_pathPosition_iff (edge : Fin p) (offset : ℕ) /-- The minimum of two core-edge lengths, viewed as a position on an edge which is at least that long. -/ +@[expose] def minLengthPosition (edge left right : Fin p) (hBound : min (spec.length left) (spec.length right) ≤ spec.length edge) : spec.PathPosition edge := @@ -141,6 +143,7 @@ theorem minLengthPosition_eq_right (edge left right : Fin p) /-- The truncated difference of two core-edge lengths, viewed as a position on an edge which is at least that far from its tail. -/ +@[expose] def differencePosition (edge minuend subtrahend : Fin p) (hBound : spec.length minuend - spec.length subtrahend ≤ spec.length edge) : spec.PathPosition edge := diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/MultiBreakScript.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/MultiBreakScript.lean index 8e5a4a0c58..24fbaeba6c 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/MultiBreakScript.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/MultiBreakScript.lean @@ -59,7 +59,7 @@ only Boolean checks anywhere in the stack are the fail-closed bound checks already introduced by `AffinePosition`. -/ -@[expose] public section +public section namespace MarkedGraphs.Certificate open Utilities.Certificate diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/NestedOneVertexCut.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/NestedOneVertexCut.lean index 4c02867142..8913ed82a3 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/NestedOneVertexCut.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/NestedOneVertexCut.lean @@ -18,7 +18,7 @@ needed to display successive wedge factors without making any assumptions on their origin. -/ -@[expose] public section +public section namespace Utilities @@ -82,6 +82,7 @@ variable {K : CFGraph.{u}} (first second : OneVertexCut K) -- constructions no longer unfolds them; use the previous transparency locally. /-- The second cut may be viewed inside the right factor of the first when its left side is contained in that factor. -/ +@[expose] noncomputable def restrictRight (hLeft : second.left ⊆ first.right) : OneVertexCut first.rightGraph where left := Finset.univ.filter fun z => z.val ∈ second.left @@ -127,6 +128,7 @@ theorem restrictRight_graph_connected_factors (first.graph_connected_right_of_connected hK) /-- Flatten the two subtype layers of the restricted left factor. -/ +@[expose] def restrictRightLeftVertex (hLeft : second.left ⊆ first.right) (vertex : (first.restrictRight second hLeft).leftGraph.V) : second.leftGraph.V := @@ -161,6 +163,7 @@ theorem restrictRightLeftVertex_bijective /-- Flatten the left factor of a restricted cut back to the second cut's original left factor. This removes the two layers of induced-subgraph subtypes without changing any edge multiplicity. -/ +@[expose] noncomputable def restrictRightLeftIso (hLeft : second.left ⊆ first.right) : CFGraphIso (first.restrictRight second hLeft).leftGraph second.leftGraph where diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/OddSubdivisionDescent.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/OddSubdivisionDescent.lean index b2604c6d2b..becabb7bbf 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/OddSubdivisionDescent.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/OddSubdivisionDescent.lean @@ -42,7 +42,7 @@ witnesses) for a genus-five graph is a separate matter, discussed in the private research notes; this file proves only the descent. -/ -@[expose] public section +public section namespace Utilities.Certificate.SubdivisionGraph.Spec diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/OneEdgeSplitRefinement.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/OneEdgeSplitRefinement.lean index 4b6574f071..c7075347ad 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/OneEdgeSplitRefinement.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/OneEdgeSplitRefinement.lean @@ -35,7 +35,7 @@ Matching such a presentation to its source remains an explicit data obligation rather than treating edge ordering as definitional equality. -/ -@[expose] public section +public section namespace Utilities.Certificate.OneEdgeSplitRefinement @@ -49,6 +49,7 @@ open ExplicitPotential SubdivisionGraph induce a `LaplacianEquiv` when each step preserves its unordered endpoints. The step equivalence, rather than an endpoint-pair map, retains parallel-edge multiplicity. -/ +@[expose] def laplacianEquivOfUnorientedUnitSteps {n p n' p' : ℕ} (source : SubdivisionGraph.Spec n p) (target : SubdivisionGraph.Spec n' p') @@ -139,11 +140,13 @@ def laplacianEquivTrans {G H K : CFGraph} variable {n p : ℕ} /-- Original vertices embed below the fresh last core vertex. -/ +@[expose] def oldVertex (_source : SubdivisionGraph.Spec n p) (vertex : Fin n) : Fin (n + 1) := vertex.castSucc /-- The fresh bivalent vertex. -/ +@[expose] def splitVertex (_source : SubdivisionGraph.Spec n p) : Fin (n + 1) := Fin.last n @@ -161,6 +164,7 @@ variable (source : SubdivisionGraph.Spec n p) (split : Fin p) /-- Replace the named occurrence by a path through the fresh vertex. All other occurrences retain their old slots, including parallel copies. -/ +@[expose] def splitCore : ExplicitPotential.Core (n + 1) (p + 1) where tail := Fin.lastCases (splitVertex source) (fun edge => oldVertex source (source.core.tail edge)) @@ -170,6 +174,7 @@ def splitCore : ExplicitPotential.Core (n + 1) (p + 1) where /-- The first half remains in the old slot and the second half occupies the new last slot. -/ +@[expose] def splitLength : Fin (p + 1) → ℕ := Fin.lastCases second (fun edge => if edge = split then first else source.length edge) @@ -205,6 +210,7 @@ def splitLength : Fin (p + 1) → ℕ := simp [splitLength, secondSlot] /-- Positive-length subdivision specification on the canonical split core. -/ +@[expose] def splitSpec (hFirst : 0 < first) (hSecond : 0 < second) : SubdivisionGraph.Spec (n + 1) (p + 1) where core := splitCore source split diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/OneVertexCutCheck.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/OneVertexCutCheck.lean index e8a8eb98d9..d1d1f5c065 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/OneVertexCutCheck.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/OneVertexCutCheck.lean @@ -15,7 +15,7 @@ This is a passive boundary for finite cut data emitted by an external search. Every condition of `OneVertexCut` is replayed by a transparent computation. -/ -@[expose] public section +public section namespace Utilities.Certificate @@ -38,6 +38,7 @@ structure Data (K : CFGraph.{u}) where namespace Data /-- The exact conditions required by `OneVertexCut`. -/ +@[expose] def Valid (c : Data K) : Prop := c.glue ∈ c.left ∧ c.glue ∈ c.right ∧ diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/PathSplitRefinement.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/PathSplitRefinement.lean index 09e8798f33..84bd0b615b 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/PathSplitRefinement.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/PathSplitRefinement.lean @@ -24,7 +24,7 @@ external certificate generally orders its bivalent vertices and edge occurrences differently from this canonical append-at-the-end convention. -/ -@[expose] public section +public section namespace Utilities.Certificate.IteratedSplitRefinement diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/PiecewiseBlockDecoder.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/PiecewiseBlockDecoder.lean index 4ee2a733bb..58a59cef35 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/PiecewiseBlockDecoder.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/PiecewiseBlockDecoder.lean @@ -22,7 +22,7 @@ closed-face soundness proof. The lowerer/checker bridge proves its three displayed facts from a concrete RPF block list. -/ -@[expose] public section +public section namespace MarkedGraphs.Certificate open Utilities.Certificate @@ -51,6 +51,7 @@ variable {L : ℕ} (b : FiniteBlockEnds L) /-- A nonempty weakly ordered list whose final endpoint is `L` automatically covers every unit step below `L`: the final block is always a possible owner. This is the form produced directly by the W1 checks of a rich row leaf. -/ +@[expose] def ofOrderedLast (ends : List ℕ) (hNonempty : 0 < ends.length) (hLast : ends.getD (ends.length - 1) L = L) (hOrdered : ∀ i : ℕ, ends.getD i L ≤ ends.getD (i + 1) L) : @@ -66,9 +67,11 @@ def ofOrderedLast (ends : List ℕ) (hNonempty : 0 < ends.length) exact hk /-- The endpoint at a block index, defaulting to the total length. -/ +@[expose] def endAt (i : ℕ) : ℕ := b.ends.getD i L /-- The left endpoint of a block. -/ +@[expose] def startAt (i : ℕ) : ℕ := if i = 0 then 0 else b.endAt (i - 1) /-- The first (finite) block ending strictly after `k`; its arbitrary value @@ -378,6 +381,7 @@ variable {n p : ℕ} (d : DegSpec n p) /-- Decode one finite endpoint list per slot into the selector portion of a `PiecewiseData`. Endpoint rises and the endpoint balance are supplied by the rich leaf separately. -/ +@[expose] def decodePiecewiseData (potential : Fin n → ℤ) (blocks : (e : Fin p) → FiniteBlockEnds (d.length e)) (rises : Fin p → ℕ → ℤ) diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/PointedGenusOneRigidTransport.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/PointedGenusOneRigidTransport.lean index d2f9371675..9deb83abd0 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/PointedGenusOneRigidTransport.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/PointedGenusOneRigidTransport.lean @@ -17,7 +17,7 @@ small transport lemma is useful when nested induced-subgraph cuts introduce extra subtype layers around an already-certified marker cycle. -/ -@[expose] public section +public section namespace Utilities diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/RampScript.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/RampScript.lean index 7ce85b9d24..36194b9d73 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/RampScript.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/RampScript.lean @@ -16,7 +16,7 @@ window of each edge slot, then constant again. This is the generic positive- length infrastructure behind the readable genus-four pencil proofs. -/ -@[expose] public section +public section namespace Utilities.Certificate.SubdivisionRamp @@ -87,6 +87,7 @@ def rampScript (spec : SubdivisionGraph.Spec n p) (pot : Fin n → ℤ) spec.slotValueScript pot (rampValue spec pot sgn lo t) /-- Unit-step slopes of a ramp script. -/ +@[expose] def rampSlope (sgn : Fin p → ℤ) (lo : Fin p → ℕ) (t : ℕ) : Fin p → ℕ → ℤ := fun edge k => if lo edge ≤ k ∧ k < lo edge + t then sgn edge else 0 diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/RankOne.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/RankOne.lean index ec03cfc28a..5ac79c6d56 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/RankOne.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/RankOne.lean @@ -28,7 +28,7 @@ Our script convention agrees with `ChipFiringWithLean.prin`: the checked residual is `D - q + prin G sigma`, equivalently `D - q - L sigma`. -/ -@[expose] public section +public section namespace Utilities.Certificate @@ -78,6 +78,7 @@ namespace RankOne variable {G : CFGraph} /-- The result of removing the chip at `q` and applying its certificate script. -/ +@[expose] def residual (certificate : RankOne G) (q : G.V) : CFDiv G := certificate.divisor - oneChip q + prin G (certificate.scripts q) diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ReorientContraction.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ReorientContraction.lean index 4222f09a88..9af9f02ea7 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ReorientContraction.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ReorientContraction.lean @@ -29,7 +29,7 @@ reorient the target spec, contract there, and transport back along the identity relabeling whose `reversed` field records the flips. -/ -@[expose] public section +public section namespace Utilities.Certificate.ReorientContraction @@ -43,6 +43,7 @@ open Utilities.Certificate.ContractionForestCensusGeneral variable {n p n' p' : ℕ} /-- Reverse a chosen set of slots of a core. -/ +@[expose] def Core.reorient (core : ExplicitPotential.Core n p) (rev : Fin p → Bool) : ExplicitPotential.Core n p where tail := fun e => if rev e then core.head e else core.tail e @@ -71,6 +72,7 @@ theorem Core.reorient_loopless {core : ExplicitPotential.Core n p} exact h e /-- The same subdivision, with a chosen set of slots read backwards. -/ +@[expose] def reorientSpec (s : SubdivisionGraph.Spec n p) (rev : Fin p → Bool) : SubdivisionGraph.Spec n p where core := Core.reorient s.core rev diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SlopeScript.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SlopeScript.lean index df6a67e3ff..e0497b1ea0 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SlopeScript.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SlopeScript.lean @@ -30,7 +30,7 @@ unit step of slot `edge`. Then Both statements are exact, and neither refers to the values of the script. -/ -@[expose] public section +public section namespace Utilities.Certificate @@ -42,6 +42,7 @@ variable {n p : ℕ} (spec : SubdivisionGraph.Spec n p) /-- A slope datum for a firing script: the script rises by `slope edge k` across the `k`-th unit step of slot `edge`. -/ +@[expose] def IsStepSlope (script : firingScript spec.graph) (slope : Fin p → ℕ → ℤ) : Prop := ∀ (edge : Fin p) (offset : Fin (spec.length edge)), @@ -231,6 +232,7 @@ theorem prin_interiorVertex_eq_slopeDifference /-- The script whose value at path position `k` of slot `edge` is `value edge k`, and `potential v` at the core vertex `v`. -/ +@[expose] def slotValueScript (potential : Fin n → ℤ) (value : Fin p → ℕ → ℤ) : firingScript spec.graph | Sum.inl vertex => potential vertex diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SpanningTreeConnectivity.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SpanningTreeConnectivity.lean index 94f714f79d..bc2472c0de 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SpanningTreeConnectivity.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SpanningTreeConnectivity.lean @@ -23,7 +23,7 @@ side, so its displayed parent edge crosses the cut. The external program which chooses this data is not trusted. -/ -@[expose] public section +public section namespace MarkedGraphs.Certificate.SpanningTreeConnectivity open Utilities.Certificate diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SpecBurning.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SpecBurning.lean index 9606b41283..9834ae72f9 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SpecBurning.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SpecBurning.lean @@ -45,7 +45,7 @@ between are the slot interior. Statements carry explicit change the meaning. -/ -@[expose] public section +public section namespace Utilities.Gonality @@ -264,6 +264,7 @@ risk R1, one step further than the blueprint's own suggestion: not merely a disjoint partition, but a *coordinate system*. -/ /-- The chips on the interior of slot `edge`. -/ +@[expose] def slotInteriorChips (sp : Spec n p) (D : CFDiv sp.graph) (edge : Fin p) : ℤ := ∑ j : Fin (sp.length edge - 1), D (sp.interiorVertex edge j) diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SplitRampArithmetic.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SplitRampArithmetic.lean index 22f8d217dc..49b4aa0844 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SplitRampArithmetic.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SplitRampArithmetic.lean @@ -40,7 +40,7 @@ arbitrary slot-value function, `interpolatedScript` being merely the instance whose value is one ramp. -/ -@[expose] public section +public section namespace Utilities.Certificate.SubdivisionArithmetic @@ -61,6 +61,7 @@ def splitPotential (L t : ℕ) (first second : ℤ) (i : ℕ) : ℤ := if i < t then potential t first i else first + potential (L - t) second (i - t) /-- The slope on the unit step from offset `i` to offset `i + 1`. -/ +@[expose] def splitStep (L t : ℕ) (first second : ℤ) (i : ℕ) : ℤ := splitPotential L t first second (i + 1) - splitPotential L t first second i diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SplitRampScript.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SplitRampScript.lean index 72d79aa37b..a47cc48d1b 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SplitRampScript.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SplitRampScript.lean @@ -39,7 +39,7 @@ are stated for an arbitrary slot-value function. What this file adds is The arithmetic lives in `SplitRampArithmetic.lean`. -/ -@[expose] public section +public section namespace Utilities.Certificate.DegenerateSpec.DegSpec @@ -50,15 +50,18 @@ open Finset ExplicitPotential variable {n p : ℕ} (d : DegSpec n p) /-- The rise of the ramp from the tail class up to the mark. -/ +@[expose] def markRiseIn (potential : Fin n → ℤ) (markValue : Fin p → ℤ) (e : Fin p) : ℤ := markValue e - potential (d.rep (d.core.tail e)) /-- The rise of the ramp from the mark down to the head class. -/ +@[expose] def markRiseOut (potential : Fin n → ℤ) (markValue : Fin p → ℤ) (e : Fin p) : ℤ := potential (d.rep (d.core.head e)) - markValue e /-- Admissibility of the marks: each sits inside its slot, and a mark at an end of its slot carries that end's value. -/ +@[expose] def MarksAdmissible (potential : Fin n → ℤ) (mark : Fin p → ℕ) (markValue : Fin p → ℤ) : Prop := ∀ e : Fin p, SubdivisionArithmetic.SplitRamp (d.length e) (mark e) diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SquareRootDescent.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SquareRootDescent.lean index c68d0bdef3..6436361f27 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SquareRootDescent.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SquareRootDescent.lean @@ -61,7 +61,7 @@ for all of them. Nothing in this file asserts that the square root exists; it only exploits one when it does. -/ -@[expose] public section +public section namespace Utilities.Certificate.SubdivisionGraph.Spec @@ -143,6 +143,7 @@ theorem sum_abs_stepCost_le_sum_abs_group {ι J : Type*} [Fintype ι] [Fintype J namespace Chip /-- Re-round a chip to a prescribed end of its coarse step. -/ +@[expose] def reround {n p : ℕ} {spec : Spec n p} {N : ℕ} (c : spec.Chip N) (b : Bool) : spec.Chip N := { c with toRight := b } @@ -167,6 +168,7 @@ def reround {n p : ℕ} {spec : Spec n p} {N : ℕ} (c : spec.Chip N) (b : Bool) /-- The two chips of a doubled interior point, rounded so that their total signed cost is the distance from `2 * offset` to `N * ℤ`: both left when `4 * offset ≤ N`, both right when `3 * N ≤ 4 * offset`, and split otherwise. -/ +@[expose] def double {n p : ℕ} {spec : Spec n p} {N : ℕ} (c : spec.Chip N) (k : Fin 2) : spec.Chip N := c.reround (if k.val = 0 then decide (3 * N ≤ 4 * c.offset) else decide (N < 4 * c.offset)) diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/StrongSeparator.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/StrongSeparator.lean index 82c16abbed..01c3437d25 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/StrongSeparator.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/StrongSeparator.lean @@ -33,7 +33,7 @@ is deliberately left as future graph-plumbing work; the soundness theorem below is complete and uses only the public `qReduced` API. -/ -@[expose] public section +public section namespace Utilities.Certificate.StrongSeparator @@ -42,15 +42,18 @@ open Finset variable {G : CFGraph} /-- The divisor class of `D` reaches `v` after one chip is removed. -/ +@[expose] def Reaches (G : CFGraph) (D : CFDiv G) (v : G.V) : Prop := winnable G (D - oneChip v) /-- Total edge multiplicity from `v` into `C`, as an integer. -/ +@[expose] def intoMultiplicity (G : CFGraph) (C : Finset G.V) (v : G.V) : ℤ := ∑ x ∈ C, (numEdges G v x : ℤ) /-- A vertex outside `C` is on its boundary when it has a positive-multiplicity edge into `C`. -/ +@[expose] def IsBoundary (G : CFGraph) (C : Finset G.V) (v : G.V) : Prop := ∃ x ∈ C, 0 < numEdges G v x @@ -210,6 +213,7 @@ structure ExpansionCell (G : CFGraph) (R : Finset G.V) where /-- A transparent strong-separator certificate: every proper enlargement of `S` has a complementary cell with the exact tree/path cut data above. -/ +@[expose] def StrongSeparatorCertificate (G : CFGraph) (S : Finset G.V) : Prop := ∀ R : Finset G.V, S ⊆ R → R.Nonempty → R ≠ Finset.univ → Nonempty (ExpansionCell G R) diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionArithmetic.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionArithmetic.lean index 6cb03d660c..b6d3785fbf 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionArithmetic.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionArithmetic.lean @@ -27,27 +27,32 @@ chip-firing application: at an interior path vertex, `prin` will be the next slope minus the previous slope. -/ -@[expose] public section +public section namespace Utilities.Certificate.SubdivisionArithmetic /-- The lower of the two slopes used to realize rise `T` over length `L`. -/ +@[expose] def quotient (L : ℕ) (T : ℤ) : ℤ := T / (L : ℤ) /-- The number of final steps on which the slope is `quotient L T + 1`. -/ +@[expose] def remainder (L : ℕ) (T : ℤ) : ℤ := T % (L : ℤ) /-- The integral offset at which the slope changes from `q` to `q + 1`. -/ +@[expose] def bend (L : ℕ) (T : ℤ) : ℤ := (L : ℤ) - remainder L T /-- The two-slope potential at integral offset `i` from the tail endpoint. -/ +@[expose] def potential (L : ℕ) (T : ℤ) (i : ℕ) : ℤ := quotient L T * (i : ℤ) + max 0 ((i : ℤ) - bend L T) /-- The slope on the unit step from offset `i` to offset `i + 1`. -/ +@[expose] def step (L : ℕ) (T : ℤ) (i : ℕ) : ℤ := potential L T (i + 1) - potential L T i diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionChipDescent.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionChipDescent.lean index 7ab46449f7..49f1b563f2 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionChipDescent.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionChipDescent.lean @@ -66,7 +66,7 @@ by step from the fine script, and the budget hypothesis is exactly what fails for two chips at the midpoints of an even refinement. -/ -@[expose] public section +public section namespace Utilities.Certificate.SubdivisionGraph.Spec @@ -78,6 +78,7 @@ variable {n p : ℕ} (spec : Spec n p) (N : ℕ) (hN : 0 < N) /-- The fine vertex at fine offset `N * k` of slot `edge`, for a coarse path position `k`. -/ +@[expose] def scaledPosition (edge : Fin p) (position : spec.PathPosition edge) : (spec.scale N hN).PathPosition edge := ⟨N * position.val, by @@ -95,6 +96,7 @@ def scaledPosition (edge : Fin p) (position : spec.PathPosition edge) : /-- The embedding of the coarse vertices into the fine graph: core vertices go to core vertices, and the interior vertex at coarse offset `j + 1` of a slot goes to fine offset `N * (j + 1)`. -/ +@[expose] def fineOf : spec.Vertex → (spec.scale N hN).Vertex | Sum.inl vertex => Sum.inl vertex | Sum.inr ⟨edge, offset⟩ => @@ -179,6 +181,7 @@ theorem fineOf_pathVertex (edge : Fin p) (position : spec.PathPosition edge) : /-- Push a coarse divisor forward along `fineOf`: the chips stay on the images of the coarse vertices and every other fine vertex carries none. -/ +@[expose] def embed (D : CFDiv spec.graph) : CFDiv (spec.scale N hN).graph := fun y => ∑ x : spec.Vertex, if spec.fineOf N hN x = y then D x else 0 @@ -265,6 +268,7 @@ namespace Chip variable {spec N} /-- The fine position of a chip: offset `N * step + offset` along its slot. -/ +@[expose] def finePosition (c : spec.Chip N) : (spec.scale N hN).PathPosition c.edge := ⟨N * c.step + c.offset, by have h1 : N * (c.step + 1) ≤ N * spec.length c.edge := @@ -275,25 +279,30 @@ def finePosition (c : spec.Chip N) : (spec.scale N hN).PathPosition c.edge := omega⟩ /-- The fine vertex carrying the chip. -/ +@[expose] def fineVertex (c : spec.Chip N) : (spec.scale N hN).Vertex := (spec.scale N hN).pathVertex c.edge (c.finePosition hN) /-- The coarse step containing the chip. -/ +@[expose] def coarseStep (c : spec.Chip N) : spec.Step := ⟨c.edge, ⟨c.step, c.step_lt⟩⟩ /-- The coarse vertex the chip is rounded to. -/ +@[expose] def coarseVertex (c : spec.Chip N) : spec.Vertex := if c.toRight then spec.stepRight c.edge ⟨c.step, c.step_lt⟩ else spec.stepLeft c.edge ⟨c.step, c.step_lt⟩ /-- The fine distance from the chip to the coarse vertex it is rounded to. -/ +@[expose] def distance (c : spec.Chip N) : ℕ := if c.toRight then N - c.offset else c.offset /-- The signed rounding cost: positive when rounding right, negative when rounding left. Adding it to the fine height at the right end of the step plays the role of moving the chip. -/ +@[expose] def signedCost (c : spec.Chip N) : ℤ := if c.toRight then (N : ℤ) - (c.offset : ℤ) else -(c.offset : ℤ) @@ -344,11 +353,13 @@ theorem fineVertex_not_mem_range (c : spec.Chip N) : end Chip /-- The fine divisor of a family of chips. -/ +@[expose] def fineChips {ι : Type*} [Fintype ι] (chips : ι → spec.Chip N) : CFDiv (spec.scale N hN).graph := ∑ i, oneChip ((chips i).fineVertex hN) /-- The rounded coarse divisor of a family of chips. -/ +@[expose] def coarseChips {ι : Type*} [Fintype ι] (chips : ι → spec.Chip N) : CFDiv spec.graph := ∑ i, oneChip (chips i).coarseVertex @@ -362,6 +373,7 @@ def fineValue (σ : firingScript (spec.scale N hN).graph) (edge : Fin p) (j : else 0 /-- The fine slope across fine step `j` of slot `edge`. -/ +@[expose] def fineSlope (σ : firingScript (spec.scale N hN).graph) (edge : Fin p) (j : ℕ) : ℤ := spec.fineValue N hN σ edge (j + 1) - spec.fineValue N hN σ edge j @@ -383,6 +395,7 @@ def roundedScript (κ : Fin N) (σ : firingScript (spec.scale N hN).graph) : /-- The coarse slope of the rounded script across coarse step `k` of slot `edge`. -/ +@[expose] def roundedSlope (κ : Fin N) (σ : firingScript (spec.scale N hN).graph) (edge : Fin p) (k : ℕ) : ℤ := round N κ (spec.fineValue N hN σ edge (N * (k + 1))) - @@ -403,19 +416,23 @@ theorem isStepSlope_roundedSlope (κ : Fin N) /-! ## The step inequality -/ /-- The chips of a family lying in a given coarse step. -/ +@[expose] def stepChips {ι : Type*} [Fintype ι] (chips : ι → spec.Chip N) (step : spec.Step) : Finset ι := Finset.univ.filter fun i => (chips i).coarseStep = step /-- The number of chips of a step rounded to its left end. -/ +@[expose] def leftCount {ι : Type*} [Fintype ι] (chips : ι → spec.Chip N) (step : spec.Step) : ℤ := ((spec.stepChips N chips step).filter fun i => (chips i).toRight = false).card /-- The number of chips of a step rounded to its right end. -/ +@[expose] def rightCount {ι : Type*} [Fintype ι] (chips : ι → spec.Chip N) (step : spec.Step) : ℤ := ((spec.stepChips N chips step).filter fun i => (chips i).toRight = true).card /-- The total signed rounding cost of the chips of a step. -/ +@[expose] def stepCost {ι : Type*} [Fintype ι] (chips : ι → spec.Chip N) (step : spec.Step) : ℤ := ∑ i ∈ spec.stepChips N chips step, (chips i).signedCost diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionChipDescentMain.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionChipDescentMain.lean index f019c092ad..b81fccf35b 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionChipDescentMain.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionChipDescentMain.lean @@ -18,7 +18,7 @@ The vertex inequalities for the rounded script, and the descent theorems the overall argument. -/ -@[expose] public section +public section namespace Utilities.Certificate.SubdivisionGraph.Spec diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionChipDescentStep.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionChipDescentStep.lean index 2983900b48..406447b7ef 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionChipDescentStep.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionChipDescentStep.lean @@ -22,7 +22,7 @@ costs, the same bounds hold for the coarse slopes of the rounded script. See the overall argument. -/ -@[expose] public section +public section namespace Utilities.Certificate.SubdivisionGraph.Spec diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionConnectivity.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionConnectivity.lean index b06566dde4..c1f2968785 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionConnectivity.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionConnectivity.lean @@ -25,7 +25,7 @@ It is therefore constant on the core by core connectedness, and then constant on every interior vertex as well. -/ -@[expose] public section +public section namespace Utilities.Certificate @@ -37,6 +37,7 @@ variable {n p : ℕ} /-- Cut connectedness for an ordered loopless core. Edge slots, rather than endpoint pairs, are quantified so parallel edges are retained exactly. -/ +@[expose] def Connected (core : ExplicitPotential.Core n p) : Prop := ∀ S : Finset (Fin n), (∃ v w : Fin n, v ∈ S ∧ w ∉ S) → @@ -45,6 +46,7 @@ def Connected (core : ExplicitPotential.Core n p) : Prop := (core.head edge ∈ S ∧ core.tail edge ∉ S) /-- Exact finite Boolean checker for core connectedness. -/ +@[expose] def connectedCheck (core : ExplicitPotential.Core n p) : Bool := AffineCover.allFinset Finset.univ fun S : Finset (Fin n) => decide ((∃ v w : Fin n, v ∈ S ∧ w ∉ S) → diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionCoreSupport.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionCoreSupport.lean index 7ef9e1dcd0..0c5396b17e 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionCoreSupport.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionCoreSupport.lean @@ -25,7 +25,7 @@ least one. The subdivision theorems specialize it to the transparent divisor which is zero on every edge-interior vertex. -/ -@[expose] public section +public section namespace Utilities.Subdivision.SubdivisionCoreSupport open Utilities.Certificate @@ -56,6 +56,7 @@ variable {n p : ℕ} /-- The divisor which places `weight vertex` chips at each embedded core vertex and no chips at subdivision-interior vertices. -/ +@[expose] def coreDivisor (spec : SubdivisionGraph.Spec n p) (weight : Fin n → ℤ) : CFDiv spec.graph | Sum.inl vertex => weight vertex diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionGraph.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionGraph.lean index 31fbbfa712..5b602846a1 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionGraph.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionGraph.lean @@ -25,7 +25,7 @@ type of all unit steps, so every unit edge is emitted exactly once even when several emitted pairs coincide. -/ -@[expose] public section +public section namespace Utilities.Certificate.SubdivisionGraph @@ -45,6 +45,7 @@ structure Spec (n p : ℕ) where /-- Package a positive length assignment on a fixed finite loopless core as a subdivision specification, without repeating the structure fields. -/ +@[expose] def Spec.ofCore {n p : ℕ} (core : ExplicitPotential.Core n p) (core_nonempty : 0 < n) (core_loopless : ∀ edge : Fin p, core.tail edge ≠ core.head edge) @@ -72,15 +73,18 @@ abbrev Vertex := Fin n ⊕ spec.Interior abbrev Step := Σ edge : Fin p, Fin (spec.length edge) /-- Injection of a core vertex into the subdivision. -/ +@[expose] def coreVertex (vertex : Fin n) : spec.Vertex := Sum.inl vertex /-- Injection of an edge-interior coordinate into the subdivision. -/ +@[expose] def interiorVertex (edge : Fin p) (offset : Fin (spec.length edge - 1)) : spec.Vertex := Sum.inr ⟨edge, offset⟩ /-- The left endpoint of a unit step. -/ +@[expose] def stepLeft (edge : Fin p) (offset : Fin (spec.length edge)) : spec.Vertex := if hzero : offset.val = 0 then @@ -92,6 +96,7 @@ def stepLeft (edge : Fin p) (offset : Fin (spec.length edge)) : omega⟩ /-- The right endpoint of a unit step. -/ +@[expose] def stepRight (edge : Fin p) (offset : Fin (spec.length edge)) : spec.Vertex := if hlast : offset.val + 1 = spec.length edge then @@ -104,6 +109,7 @@ def stepRight (edge : Fin p) (offset : Fin (spec.length edge)) : /-- The ordered pair emitted by one unit step. Its orientation is only a storage convention; `numEdges` treats it as undirected. -/ +@[expose] def unitEdge (step : spec.Step) : spec.Vertex × spec.Vertex := (spec.stepLeft step.1 step.2, spec.stepRight step.1 step.2) @@ -274,6 +280,7 @@ theorem unitStep_num_edges_pos (edge : Fin p) exact ⟨⟨edge, offset⟩, Or.inl rfl⟩ /-- The neighbor of a core tail on its first unit step. -/ +@[expose] def tailNeighbor (edge : Fin p) : spec.Vertex := spec.stepRight edge ⟨0, spec.length_pos edge⟩ @@ -297,21 +304,25 @@ theorem head_num_edges_pos (edge : Fin p) : ⟨spec.length edge - 1, by have := spec.length_pos edge; omega⟩ /-- The step immediately before the interior vertex with coordinate `j`. -/ +@[expose] def previousStep (edge : Fin p) (offset : Fin (spec.length edge - 1)) : Fin (spec.length edge) := ⟨offset.val, by have := offset.isLt; omega⟩ /-- The step immediately after the interior vertex with coordinate `j`. -/ +@[expose] def nextStep (edge : Fin p) (offset : Fin (spec.length edge - 1)) : Fin (spec.length edge) := ⟨offset.val + 1, by have := offset.isLt; omega⟩ /-- The preceding path vertex of an interior vertex. -/ +@[expose] def previousVertex (edge : Fin p) (offset : Fin (spec.length edge - 1)) : spec.Vertex := spec.stepLeft edge (spec.previousStep edge offset) /-- The following path vertex of an interior vertex. -/ +@[expose] def nextVertex (edge : Fin p) (offset : Fin (spec.length edge - 1)) : spec.Vertex := spec.stepRight edge (spec.nextStep edge offset) @@ -470,10 +481,12 @@ theorem prin_eq_sum_step_differences (script : firingScript spec.graph) /-! ## Canonical integer interpolation on the constructed graph -/ /-- Rise of a core potential along an oriented edge slot. -/ +@[expose] def coreRise (potential : Fin n → ℤ) (edge : Fin p) : ℤ := potential (spec.core.head edge) - potential (spec.core.tail edge) /-- Value at a numerical path offset, normalized by the tail potential. -/ +@[expose] def pathValue (potential : Fin n → ℤ) (edge : Fin p) (offset : ℕ) : ℤ := potential (spec.core.tail edge) + @@ -482,7 +495,7 @@ def pathValue (potential : Fin n → ℤ) (edge : Fin p) /-- Extend an integral core potential over every subdivided slot by the canonical convex interpolation from `SubdivisionArithmetic`. -/ -def interpolatedScript (potential : Fin n → ℤ) : firingScript spec.graph +@[expose] def interpolatedScript (potential : Fin n → ℤ) : firingScript spec.graph | Sum.inl vertex => potential vertex | Sum.inr interior => spec.pathValue potential interior.1 (interior.2.val + 1) diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionIso.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionIso.lean index 6affa4192d..bdbb339c3a 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionIso.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionIso.lean @@ -26,7 +26,7 @@ presentations. Thus it applies both to automorphisms of one presentation and to comparisons with another presentation having a different slot order. -/ -@[expose] public section +public section namespace Utilities.Certificate.SubdivisionGraph @@ -94,12 +94,14 @@ def stepOffsetEquiv (edge : Fin p) : (finCongr (relabeling.length_eq edge)) /-- Vertex equivalence induced by a relabeling. -/ +@[expose] def vertexEquiv : source.Vertex ≃ target.Vertex := Equiv.sumCongr relabeling.coreEquiv (Equiv.sigmaCongr relabeling.slotEquiv (fun edge => interiorEquiv source target relabeling edge)) /-- Unit-step occurrence equivalence induced by a relabeling. -/ +@[expose] def stepEquiv : source.Step ≃ target.Step := Equiv.sigmaCongr relabeling.slotEquiv (fun edge => stepOffsetEquiv source target relabeling edge) @@ -296,6 +298,7 @@ theorem unitEdge_stepEquiv (step : source.Step) : /-- The resulting vertex equivalence is a graph isomorphism in the precise Laplacian sense used by the certificate checker. -/ +@[expose] def laplacianEquiv : LaplacianEquiv source.graph target.graph := OneEdgeSplitRefinement.laplacianEquivOfUnorientedUnitSteps source target (vertexEquiv source target relabeling) (stepEquiv source target relabeling) @@ -304,6 +307,7 @@ def laplacianEquiv : LaplacianEquiv source.graph target.graph := /-- The same relabeling packaged for the older, transmission-facing graph isomorphism API. It has exactly the same finite multiplicity content as `laplacianEquiv`. -/ +@[expose] def graphIso : CFGraphIso source.graph target.graph where vertexEquiv := vertexEquiv source target relabeling map_num_edges := (laplacianEquiv source target relabeling).num_edges_eq @@ -324,6 +328,7 @@ end Spec /-! ## Reindexing a specification along index equivalences -/ /-- Rename the vertices and edge slots of an ordered core. -/ +@[expose] def coreReindex {n p n' p' : ℕ} (core : Core n p) (vertexEquiv : Fin n ≃ Fin n') (slotEquiv : Fin p ≃ Fin p') : Core n' p' where @@ -331,6 +336,7 @@ def coreReindex {n p n' p' : ℕ} (core : Core n p) head := fun edge => vertexEquiv (core.head (slotEquiv.symm edge)) /-- Rename the vertices and edge slots of a subdivision specification. -/ +@[expose] def specReindex {n p n' p' : ℕ} (spec : Spec n p) (vertexEquiv : Fin n ≃ Fin n') (slotEquiv : Fin p ≃ Fin p') (hn : 0 < n') : Spec n' p' where @@ -344,6 +350,7 @@ def specReindex {n p n' p' : ℕ} (spec : Spec n p) length_pos := fun edge => spec.length_pos _ /-- Reindexing is a relabeling, hence preserves the subdivided graph. -/ +@[expose] def specReindexRelabeling {n p n' p' : ℕ} (spec : Spec n p) (vertexEquiv : Fin n ≃ Fin n') (slotEquiv : Fin p ≃ Fin p') (hn : 0 < n') : diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionSeparator.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionSeparator.lean index 8950e1ee7e..c92a7b9b3f 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionSeparator.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionSeparator.lean @@ -20,7 +20,7 @@ vertex, and the elementary path-cut property required by `StrongSeparator.ExpansionCell`. -/ -@[expose] public section +public section namespace Utilities.Certificate @@ -36,6 +36,7 @@ variable {n p : ℕ} (spec : SubdivisionGraph.Spec n p) abbrev PathPosition (edge : Fin p) := Fin (spec.length edge + 1) /-- The vertex at a path position. -/ +@[expose] def pathVertex (edge : Fin p) (position : spec.PathPosition edge) : spec.Vertex := if hzero : position.val = 0 then @@ -51,11 +52,13 @@ def pathVertex (edge : Fin p) (position : spec.PathPosition edge) : omega⟩ /-- Position of the left endpoint of a unit step. -/ +@[expose] def stepLeftPosition (edge : Fin p) (offset : Fin (spec.length edge)) : spec.PathPosition edge := ⟨offset.val, by have := offset.isLt; omega⟩ /-- Position of the right endpoint of a unit step. -/ +@[expose] def stepRightPosition (edge : Fin p) (offset : Fin (spec.length edge)) : spec.PathPosition edge := ⟨offset.val + 1, by have := offset.isLt; omega⟩ @@ -149,11 +152,13 @@ theorem consecutive_num_edges_pos (edge : Fin p) simpa using spec.unitStep_num_edges_pos edge offset /-- A numerical path position is strictly internal to its edge. -/ +@[expose] def IsInteriorPosition (edge : Fin p) (position : spec.PathPosition edge) : Prop := 0 < position.val ∧ position.val < spec.length edge /-- Interior-vertex coordinate represented by an internal path position. -/ +@[expose] def interiorOffsetOfPosition (edge : Fin p) (position : spec.PathPosition edge) (hInterior : spec.IsInteriorPosition edge position) : @@ -163,6 +168,7 @@ def interiorOffsetOfPosition (edge : Fin p) omega⟩ /-- Predecessor of a positive path position. -/ +@[expose] def previousPathPosition (edge : Fin p) (position : spec.PathPosition edge) (hPositive : 0 < position.val) : spec.PathPosition edge := @@ -171,6 +177,7 @@ def previousPathPosition (edge : Fin p) omega⟩ /-- Successor of a position strictly before the head. -/ +@[expose] def nextPathPosition (edge : Fin p) (position : spec.PathPosition edge) (hBeforeHead : position.val < spec.length edge) : diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionTwoEdgeCut.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionTwoEdgeCut.lean index 482c434346..7fac47f7f7 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionTwoEdgeCut.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/SubdivisionTwoEdgeCut.lean @@ -21,7 +21,7 @@ subdivision, and proves bridgelessness of positive subdivisions (`twoEdgeCutCondition_graph_of_coreTwoEdgeConnected`). -/ -@[expose] public section +public section namespace Utilities.Certificate open Finset @@ -190,6 +190,7 @@ variable {n p : ℕ} /-- Two-edge connectedness for an ordered loopless core: every nonempty proper vertex set is crossed by at least two edge *slots*. Parallel slots are counted separately, exactly as they are in the subdivision. -/ +@[expose] def TwoEdgeConnected (core : ExplicitPotential.Core n p) : Prop := ∀ S : Finset (Fin n), S.Nonempty → S ≠ Finset.univ → 2 ≤ ((Finset.univ : Finset (Fin p)).filter fun edge => diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/TrivalentExpansion.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/TrivalentExpansion.lean index afa49212cf..e21167421f 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/TrivalentExpansion.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/TrivalentExpansion.lean @@ -33,7 +33,7 @@ actual topological contraction certificate from a positive subdivision of the expanded cubic core onto any positive subdivision of the given core. -/ -@[expose] public section +public section namespace Utilities.Subdivision.TrivalentExpansion open Utilities.Certificate @@ -131,11 +131,13 @@ def headEnd (j : Fin p) : slotEnds C (C.head j) := ⟨(j, true), by simp [mem_slotEnds]⟩ /-- Tail endpoint of an expansion slot. -/ +@[expose] noncomputable def bigTail : BigE C → BigV C | Sum.inl x => ⟨x.1, ⟨x.2.val, by have := x.2.isLt; omega⟩⟩ | Sum.inr j => ⟨C.tail j, legOf C hDeg (C.tail j) (tailEnd C j)⟩ /-- Head endpoint of an expansion slot. -/ +@[expose] noncomputable def bigHead : BigE C → BigV C | Sum.inl x => ⟨x.1, ⟨x.2.val + 1, by have := x.2.isLt; omega⟩⟩ | Sum.inr j => ⟨C.head j, legOf C hDeg (C.head j) (headEnd C j)⟩ @@ -200,6 +202,7 @@ noncomputable def eEquiv : BigE C ≃ Fin (3 * (p - n)) := Fintype.equivFinOfCardEq (card_bigE C hDeg) /-- The centipede expansion datum. -/ +@[expose] noncomputable def data : ExpansionData n p (2 * (p - n)) (3 * (p - n)) where bigCore := { tail := fun e => vEquiv C hDeg (bigTail C hDeg ((eEquiv C hDeg).symm e)) diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/TwoEdgeConnectedCheckFast.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/TwoEdgeConnectedCheckFast.lean index 2b1d3a859d..51d5dda3a8 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/TwoEdgeConnectedCheckFast.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/TwoEdgeConnectedCheckFast.lean @@ -61,7 +61,7 @@ remains the literal reading of the definition and stays available as an independent cross-check. -/ -@[expose] public section +public section namespace Utilities.Certificate diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/TwoPoleSubdivision.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/TwoPoleSubdivision.lean index 51c36f13a1..01280d8129 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/TwoPoleSubdivision.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/TwoPoleSubdivision.lean @@ -17,7 +17,7 @@ hypotheses. The first connector is oriented from the left factor to the right; the second may be stored in either orientation. -/ -@[expose] public section +public section namespace Utilities.Certificate.TwoPoleSubdivision @@ -100,6 +100,7 @@ variable (s : Spec n p) (d : Data s.core nA pA nB pB) /-- The left factor retains its own vertices and its five (in the application) internal slots, with the original subdivision lengths. -/ +@[expose] def leftSpec : Spec nA pA where core := d.leftCore length e := s.length (d.slots (.inl (.inl e))) @@ -109,6 +110,7 @@ def leftSpec : Spec nA pA where length_pos e := s.length_pos _ /-- The corresponding right factor. -/ +@[expose] def rightSpec : Spec nB pB where core := d.rightCore length e := s.length (d.slots (.inl (.inr e))) @@ -126,12 +128,14 @@ def rightSpec : Spec nB pB where /-- Embed the left factor's subdivision vertices into the full subdivision, preserving core vertices and interior slot coordinates. -/ +@[expose] def left : (d.leftSpec s).Vertex → s.Vertex | .inl a => s.coreVertex (d.vertices (.inl a)) | .inr ⟨e, k⟩ => s.interiorVertex (d.slots (.inl (.inl e))) k /-- Embed the right factor's subdivision vertices into the full subdivision, preserving core vertices and interior slot coordinates. -/ +@[expose] def right : (d.rightSpec s).Vertex → s.Vertex | .inl b => s.coreVertex (d.vertices (.inr b)) | .inr ⟨e, k⟩ => s.interiorVertex (d.slots (.inl (.inr e))) k @@ -219,6 +223,7 @@ def potential (f : firingScript (d.leftSpec s).graph) /-- Slot values assembled from the two factor scripts, the supplied first-connector profile, and a constant value at the second left pole on the other connector. -/ +@[expose] def values (f : firingScript (d.leftSpec s).graph) (g : firingScript (d.rightSpec s).graph) (h : ℕ → ℤ) (e : Fin p) (k : ℕ) : ℤ := match d.slots.symm e with diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/TwoPoleSubdivisionGluing.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/TwoPoleSubdivisionGluing.lean index a1c5baef4a..6d39640697 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/TwoPoleSubdivisionGluing.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/TwoPoleSubdivisionGluing.lean @@ -18,7 +18,7 @@ by the outgoing slope of the first connector at its attachment pole. The second connector is constant, so its stored orientation has no effect. -/ -@[expose] public section +public section namespace Utilities.Certificate.TwoPoleSubdivision.Data @@ -102,12 +102,14 @@ variable (s : Spec n p) (d : TwoPoleSubdivision.Data s.core nA pA nB pB) /-- The left subdivision's ordered attachment poles, obtained from the two designated left core vertices. -/ +@[expose] def leftPoles : Utilities.TwoPole (d.leftSpec s).graph where first := (d.leftSpec s).coreVertex (d.leftPole 0) second := (d.leftSpec s).coreVertex (d.leftPole 1) /-- The right subdivision's ordered attachment poles, obtained from the two designated right core vertices. -/ +@[expose] def rightPoles : Utilities.TwoPole (d.rightSpec s).graph where first := (d.rightSpec s).coreVertex (d.rightPole 0) second := (d.rightSpec s).coreVertex (d.rightPole 1) @@ -147,6 +149,7 @@ theorem prin_script_nonneg_outside /-- Finite incidence data realize the abstract path-gluing interface. The interface hypotheses are discharged by actual global firing scripts. -/ +@[expose] def scriptGluing : Utilities.TwoPole.ScriptGluing (d.leftSpec s).graph (d.rightSpec s).graph s.graph (d.leftPoles s) (d.rightPoles s) (s.length (d.slots (.inr 0))) where diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/TwoVertexPencilCore.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/TwoVertexPencilCore.lean index 8113d51611..eee1373ff1 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/TwoVertexPencilCore.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/TwoVertexPencilCore.lean @@ -22,7 +22,7 @@ This packages the uniform hyperelliptic argument for banana graphs. It depends only on the segment-reflection and rank-one layers. -/ -@[expose] public section +public section namespace Utilities.Certificate diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/UnitSubdivisionPresentation.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/UnitSubdivisionPresentation.lean index bf23887ef4..7c4333d8a3 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/UnitSubdivisionPresentation.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/UnitSubdivisionPresentation.lean @@ -25,7 +25,7 @@ of `G.edges`, hence two different slots. No conversion through `toFinset` is used, so parallel edges are never collapsed. -/ -@[expose] public section +public section namespace Utilities.Certificate.UnitSubdivisionPresentation @@ -38,6 +38,7 @@ universe u variable (G : CFGraph.{u}) /-- A fixed finite label for each vertex of `G`. -/ +@[expose] noncomputable def vertexEquiv : G.V ≃ Fin (Fintype.card G.V) := Fintype.equivFin G.V @@ -46,14 +47,17 @@ noncomputable def vertexEquiv : G.V ≃ Fin (Fintype.card G.V) := The domain is the multiset-as-type: its second dependent coordinate distinguishes repeated copies of the same endpoint pair. -/ +@[expose] noncomputable def edgeEquiv : G.edges ≃ Fin G.edges.card := by simpa using Fintype.equivFin G.edges /-- The actual multiset occurrence occupying an ordered edge slot. -/ +@[expose] noncomputable def edgeOccurrence (slot : Fin G.edges.card) : G.edges := (edgeEquiv G).symm slot /-- The endpoint pair underlying an ordered edge slot. -/ +@[expose] noncomputable def edgeAt (slot : Fin G.edges.card) : G.V × G.V := (edgeOccurrence G slot : G.V × G.V) @@ -90,6 +94,7 @@ theorem edgeAt_fst_ne_snd (slot : Fin G.edges.card) : exact G.loopless tail hMember /-- The ordered loopless core having one slot for every edge occurrence. -/ +@[expose] noncomputable def core : ExplicitPotential.Core (Fintype.card G.V) G.edges.card where tail slot := vertexEquiv G (edgeAt G slot).1 @@ -112,12 +117,14 @@ theorem core_head_edgeEquiv (occurrence : G.edges) : simp /-- Every edge occurrence receives length one. -/ +@[expose] def unitLength : Fin G.edges.card → ℕ := fun _slot => 1 @[simp] theorem unitLength_apply (slot : Fin G.edges.card) : unitLength G slot = 1 := rfl /-- The unit-length subdivision presentation of an arbitrary `CFGraph`. -/ +@[expose] noncomputable def spec : SubdivisionGraph.Spec (Fintype.card G.V) G.edges.card where core := core G @@ -133,6 +140,7 @@ noncomputable def spec : (spec G).length slot = 1 := rfl /-- With unit lengths, a unit step is exactly an original edge occurrence. -/ +@[expose] noncomputable def stepEquiv : (spec G).Step ≃ G.edges where toFun step := edgeOccurrence G step.1 invFun occurrence := @@ -163,6 +171,7 @@ theorem noInterior (interior : (spec G).Interior) : False := by exact Fin.elim0 interior.2 /-- The original vertices are exactly all vertices of the unit subdivision. -/ +@[expose] noncomputable def graphVertexEquiv : G.V ≃ (spec G).graph.V where toFun vertex := (spec G).coreVertex (vertexEquiv G vertex) invFun vertex := diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ValidClosed.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ValidClosed.lean index 7fdde92431..34b4bdfae9 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ValidClosed.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/ValidClosed.lean @@ -61,7 +61,7 @@ Laplacian, so the conservative bound is still conservative. That inequality is `Valid`'s third conjunct, unchanged. -/ -@[expose] public section +public section namespace Utilities.Certificate open Utilities.Certificate @@ -89,6 +89,7 @@ variable {m n p : ℕ} /-- The closed-orthant segment row. The first two disjuncts are exactly `Valid`'s row (`ℓ_e ≥ 1`); the last two are the relaxation (`ℓ_e ≥ 0`). Any one of the four delivers `0 ≤ (segment e).eval point` at a cone point. -/ +@[expose] def SegmentRowClosed (certificate : CertificateData m n p) (edge : Fin p) : Prop := AffineForm.positive (certificate.segment edge) = 0 ∨ AffineForm.positive (certificate.segment edge) ∈ certificate.cone ∨ @@ -97,6 +98,7 @@ def SegmentRowClosed (certificate : CertificateData m n p) (edge : Fin p) : Prop /-- Point-independent validity on the **closed** length orthant. Identical to `Valid` except that the segment row is `SegmentRowClosed`. -/ +@[expose] def ValidClosed (certificate : CertificateData m n p) (degree : ℤ) : Prop := (∀ edge : Fin p, certificate.core.tail edge ≠ certificate.core.head edge) ∧ (∑ vertex : Fin n, certificate.divisor vertex) = degree ∧ @@ -146,6 +148,7 @@ theorem validClosed_iff_valid_of_strict {certificate : CertificateData m n p} /-! ## Executable checker -/ /-- Proof-free check of the relaxed segment row. -/ +@[expose] def checkSegmentRowClosed (certificate : CertificateData m n p) (edge : Fin p) : Bool := AffineCover.AffineForm.equal @@ -162,6 +165,7 @@ def checkSegmentRowClosed (certificate : CertificateData m n p) (edge : Fin p) : simp [checkSegmentRowClosed, SegmentRowClosed, or_assoc] /-- Executable closed-orthant validity checker. -/ +@[expose] def checkClosed (certificate : CertificateData m n p) (degree : ℤ) : Bool := (allFin fun edge : Fin p => decide (certificate.core.tail edge ≠ certificate.core.head edge)) && @@ -350,6 +354,7 @@ obligation beyond the census data. -/ /-- Turn evaluated affine segment lengths and a checked idempotent contraction representative into a degenerate subdivision specification, retaining the supplied looplessness and forest-count guarantees. -/ +@[expose] def degenerateSpec (certificate : CertificateData m n p) (point : Fin m → ℤ) (core_nonempty : 0 < n) (rep : Fin n → Fin n) diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/WindowProfile.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/WindowProfile.lean index 245a8ac8df..35679a1ea8 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/WindowProfile.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/WindowProfile.lean @@ -23,7 +23,7 @@ allowed to be any integer; the `-1`, `0`, and `1` profiles used in genus four are special cases. -/ -@[expose] public section +public section open Finset @@ -144,6 +144,7 @@ def pathValue (data : Data spec) (edge : Fin p) (offset : ℕ) : ℤ := windowValue (data.start edge) (data.stop edge) (data.slope edge) offset /-- Extend a compatible profile over every subdivision vertex. -/ +@[expose] def script (data : Data spec) : firingScript spec.graph | Sum.inl vertex => data.coreValue vertex | Sum.inr interior => data.pathValue interior.1 (interior.2.val + 1) @@ -213,6 +214,7 @@ theorem script_stepDifference (data : Data spec) (edge : Fin p) /-! ## Exact principal divisor -/ /-- The initial endpoint of a slot's signed slope window. -/ +@[expose] def startPosition (data : Data spec) (edge : Fin p) : spec.PathPosition edge := ⟨data.start edge, by @@ -221,6 +223,7 @@ def startPosition (data : Data spec) (edge : Fin p) : omega⟩ /-- The terminal endpoint of a slot's signed slope window. -/ +@[expose] def stopPosition (data : Data spec) (edge : Fin p) : spec.PathPosition edge := ⟨data.stop edge, by diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/WindowProfileReachability.lean b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/WindowProfileReachability.lean index 260f319f35..e44e080dad 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/WindowProfileReachability.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Subdivision/WindowProfileReachability.lean @@ -17,7 +17,7 @@ a linear-equivalence witness. These lemmas package that use for winnability and one-chip reachability without imposing restrictions on the profile slopes. -/ -@[expose] public section +public section namespace Utilities.Certificate.WindowProfile.Data open Utilities.Certificate @@ -30,6 +30,7 @@ open SubdivisionGraph variable {n p : ℕ} {spec : SubdivisionGraph.Spec n p} /-- The signed sum of the start and stop endpoint divisors of a profile. -/ +@[expose] def endpointDivisors (data : Data spec) : CFDiv spec.graph := ∑ edge : Fin p, data.slope edge • diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Transmission.lean b/LeanPool/BrillNoetherGraphs/Utilities/Transmission.lean index 679187e3b5..b1b5c5d6db 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Transmission.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Transmission.lean @@ -25,4 +25,4 @@ public import LeanPool.BrillNoetherGraphs.Utilities.Transmission.TransmissionWed /-! Supporting modules for Brill–Noether theory and gonality of finite graphs. -/ -@[expose] public section +public section diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Transmission/DemazureFactorization.lean b/LeanPool/BrillNoetherGraphs/Utilities/Transmission/DemazureFactorization.lean index dd999395c2..59358ccfd6 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Transmission/DemazureFactorization.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Transmission/DemazureFactorization.lean @@ -17,7 +17,7 @@ inversion-length cut. This supplies the combinatorial input needed for unconditional opposite-side vertex-wedge transmission gluing. -/ -@[expose] public section +public section namespace AspPerm diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Transmission/MarkedRankProfile.lean b/LeanPool/BrillNoetherGraphs/Utilities/Transmission/MarkedRankProfile.lean index ca9c964a90..f068d948b3 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Transmission/MarkedRankProfile.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Transmission/MarkedRankProfile.lean @@ -18,7 +18,7 @@ attained at an integer phase and equals the wedge rank. This formulation is suited to recursive attachments and avoids any `min` or `sInf` interface. -/ -@[expose] public section +public section namespace Utilities @@ -127,6 +127,7 @@ theorem vertexWedge_rank_eq_iff_pointedRankProfile_convolution_attained /-- Same-left transmission data after replacing the unmarked right pendant factor by its realized pointed rank profile. -/ +@[expose] def WedgeSameLeftTransmissionProfileWithRightProfile (G : CFGraph.{u}) (H : CFGraph.{v}) (x : G.V) (_y : H.V) (D : CFDiv G) (E : CFDiv H) (p q : G.V) @@ -163,6 +164,7 @@ theorem wedgeSameLeftTransmissionProfile_iff_withRightProfile /-- Same-right transmission data after replacing the unmarked left pendant factor by its realized pointed rank profile. -/ +@[expose] def WedgeSameRightTransmissionProfileWithLeftProfile (G : CFGraph.{u}) (H : CFGraph.{v}) (_x : G.V) (y : H.V) (D : CFDiv G) (E : CFDiv H) (p q : H.V) diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Transmission/Transmission.lean b/LeanPool/BrillNoetherGraphs/Utilities/Transmission/Transmission.lean index 8af24d5a69..4e21f4f79c 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Transmission/Transmission.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Transmission/Transmission.lean @@ -23,18 +23,20 @@ prove that one finite set of lattice points is complete without changing the basic definition of transmission. -/ -@[expose] public section +public section namespace Utilities /-- The rank inequality attached to one lattice point `(a,b)` for a divisor representative and an ASP permutation. -/ +@[expose] def TransmissionInequality (G : CFGraph) (u v : G.V) (τ : AspPerm) (D : CFDiv G) (a b : ℤ) : Prop := rank G (D + a • oneChip u - b • oneChip v) ≥ τ.s (a + 1) b - 1 /-- The transmission inequalities restricted to a set of lattice points. -/ +@[expose] def SatisfiesTransmissionOn (G : CFGraph) (u v : G.V) (τ : AspPerm) (D : CFDiv G) (S : Set (ℤ × ℤ)) : Prop := @@ -43,6 +45,7 @@ def SatisfiesTransmissionOn /-- A divisor representative satisfies the transmission condition for `τ` if it has the prescribed degree `g + χτ` and every twice-marked twist satisfies the corresponding slipface rank inequality. -/ +@[expose] def SatisfiesTransmission (G : CFGraph) (u v : G.V) (τ : AspPerm) (D : CFDiv G) : Prop := CFDiv.degree D = (CFGraph.genus G : ℤ) + τ.χ ∧ @@ -150,6 +153,7 @@ theorem satisfiesTransmission_linear_equiv_iff · exact satisfiesTransmission_of_linear_equiv hDE.symm u v τ /-- Existence of a divisor class satisfying the graph transmission condition. -/ +@[expose] def TransmissionExists (G : CFGraph) (u v : G.V) (τ : AspPerm) : Prop := ∃ D : CFDiv G, SatisfiesTransmission G u v τ D diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionBN.lean b/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionBN.lean index f72b33cad3..9ed462599b 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionBN.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionBN.lean @@ -19,7 +19,7 @@ This is the generic core needed later for the Grassmannian-transmission ⇒ `W^r_d` implication. -/ -@[expose] public section +public section namespace Utilities diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionCorner.lean b/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionCorner.lean index b4dcf53f13..5480bdd335 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionCorner.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionCorner.lean @@ -32,7 +32,7 @@ condition `BNExists G r d`; the length of `τ` is exactly `(r+1) * (g - d + r)`, so `ℓ(τ) ≤ g` is the Brill--Noether inequality `ρ ≥ 0`. -/ -@[expose] public section +public section namespace Utilities @@ -143,12 +143,14 @@ theorem rank_transmissionTwist_ge_of_corner abbrev Corner := ℤ × ℤ × ℤ /-- The rank bound that a corner transports to the lattice point `(a, b)`. -/ +@[expose] def cornerBound (c : Corner) (a b : ℤ) : ℤ := c.2.2 - max 0 (c.1 - a) - max 0 (b - c.2.1) /-- A corner list dominates `τ` when every transmission threshold is met by one of three things: the trivial bound `rank ≥ -1`, the Riemann line, or transport from one of the corners. -/ +@[expose] def CornersDominate (τ : AspPerm) (C : List Corner) : Prop := ∀ a b : ℤ, τ.s (a + 1) b - 1 < 0 ∨ diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionDuality.lean b/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionDuality.lean index 53d40e7e28..ffd4450e66 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionDuality.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionDuality.lean @@ -22,12 +22,13 @@ It has the degree prescribed by `τ⁻¹`, and its rows are exactly those requir for `τ⁻¹` at the swapped marks. -/ -@[expose] public section +public section namespace Utilities /-- The marked normalization of the canonical complement appropriate to transmission duality. -/ +@[expose] def transmissionDualDivisor {G : CFGraph} (u v : G.V) (D : CFDiv G) : CFDiv G := canonicalDivisor G - D + oneChip u + oneChip v diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionExistence.lean b/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionExistence.lean index 4483885003..1fedfe05cd 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionExistence.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionExistence.lean @@ -27,7 +27,7 @@ restriction to shifted Grassmannian permutations is exactly the once-marked Brill--Noether existence predicate. -/ -@[expose] public section +public section namespace Utilities @@ -35,11 +35,13 @@ universe uTransmission /-- The inversion set of `tau` is finite. Keeping this named avoids the incorrect convention that `Set.ncard` alone detects finite ASP length. -/ +@[expose] def FiniteTransmissionPerm (tau : AspPerm) : Prop := (invSet tau).Finite /-- Every finite-length ASP transmission problem allowed by the genus has a witness on the twice-marked graph `(G,u,v)`. -/ +@[expose] def TransmissionExistence (G : CFGraph) (u v : G.V) : Prop := forall tau : AspPerm, FiniteTransmissionPerm tau -> diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionIso.lean b/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionIso.lean index 5dc7cc6d20..c352f63fce 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionIso.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionIso.lean @@ -18,7 +18,7 @@ graph. In particular, the affine permutation is *not* changed: an isomorphism only transports the two marked vertices and the witness divisor. -/ -@[expose] public section +public section namespace Utilities diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionRR.lean b/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionRR.lean index d47840b2ed..6e5f4eff29 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionRR.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionRR.lean @@ -17,7 +17,7 @@ canonical complement. This file packages that conversion without yet using any ASP-specific simplification of the complementary slipface expression. -/ -@[expose] public section +public section namespace Utilities diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionShift.lean b/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionShift.lean index e0722bb951..25650dd5aa 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionShift.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionShift.lean @@ -24,7 +24,7 @@ marked point. This is the useful normalization convention because both the slipface inequality and the prescribed degree move by the same integer `c`. -/ -@[expose] public section +public section namespace Utilities diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionSpecial.lean b/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionSpecial.lean index 276bbb1f02..b21b89b5c6 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionSpecial.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionSpecial.lean @@ -29,7 +29,7 @@ checked. This is the Schubert-special locus on which an essential-set theorem should operate. -/ -@[expose] public section +public section namespace Utilities diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionWedge.lean b/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionWedge.lean index 768805ece1..612bd3a024 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionWedge.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionWedge.lean @@ -23,7 +23,7 @@ equivalent to the tropical-dot-product inequality for the two factor profiles, indexed by the extra gluing shift `ell`. -/ -@[expose] public section +public section namespace Utilities @@ -126,6 +126,7 @@ theorem wedgeAddDivisor_transmissionTwist /-- The profile inequality attached to a single transmission row of a wedge. The `ell` coordinate is the chip transfer across the identified vertex. -/ +@[expose] def WedgeTransmissionRowProfile (G : CFGraph.{u}) (H : CFGraph.{v}) (x : G.V) (y : H.V) (D : CFDiv G) (E : CFDiv H) (u : G.V) (v : H.V) @@ -190,6 +191,7 @@ theorem wedgeTransmissionRowProfile_of_transmissionInequality /-- The full factor-profile condition for a wedge divisor and an arbitrary ASP permutation. -/ +@[expose] def WedgeTransmissionProfile (G : CFGraph.{u}) (H : CFGraph.{v}) (x : G.V) (y : H.V) (D : CFDiv G) (E : CFDiv H) (u : G.V) (v : H.V) (tau : AspPerm) : Prop := diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionWedgeDemazure.lean b/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionWedgeDemazure.lean index ac9bc38aeb..a522af665d 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionWedgeDemazure.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionWedgeDemazure.lean @@ -25,7 +25,7 @@ budgets. The imported Demazure library supplies the min-plus product formula but currently no theorem producing this bounded finite factorization. -/ -@[expose] public section +public section namespace Utilities @@ -77,6 +77,7 @@ theorem transmissionExists_vertexWedge_opposite_star /-- A finite Demazure factorization whose two factors fit the two genus budgets. This is the precise combinatorial input needed to glue full `TransmissionExistence` statements. -/ +@[expose] def BoundedDemazureFactorization (tau : AspPerm) (gG gH : ℤ) : Prop := ∃ alpha beta : AspPerm, tau = alpha ⋆ beta ∧ @@ -89,6 +90,7 @@ def BoundedDemazureFactorization (tau : AspPerm) (gG gH : ℤ) : Prop := wedge gluing. It is isolated here because `Demazure.Submodular` proves the min-plus product formula but does not provide this length-budgeted factorization theorem. -/ +@[expose] def HasBoundedDemazureFactorizations (gG gH : ℤ) : Prop := ∀ tau : AspPerm, FiniteTransmissionPerm tau -> ((invSet tau).ncard : ℤ) ≤ gG + gH -> diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionWedgePresentation.lean b/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionWedgePresentation.lean index c44f9c1407..b60f872918 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionWedgePresentation.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionWedgePresentation.lean @@ -18,7 +18,7 @@ presentation interface for an ambient graph. It is deliberately valid for an arbitrary ASP permutation and arbitrary factor divisors. -/ -@[expose] public section +public section namespace Utilities diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionWedgeSameSide.lean b/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionWedgeSameSide.lean index 39577860b0..5f2e971744 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionWedgeSameSide.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionWedgeSameSide.lean @@ -21,7 +21,7 @@ vertex-wedge rank formula. This is useful for arbitrary ASP transmission, whose required rank `tau.s (a + 1) b - 1` can equal `-1`. -/ -@[expose] public section +public section namespace Utilities @@ -78,6 +78,7 @@ theorem wedgeAddDivisor_transmissionTwist_sameLeft /-- The factor-rank inequality for one transmission row when both marks lie on the left factor. `ell` records chip transfer across the gluing vertex. -/ +@[expose] def WedgeSameLeftTransmissionRowProfile (G : CFGraph.{u}) (H : CFGraph.{v}) (x : G.V) (y : H.V) (D : CFDiv G) (E : CFDiv H) (p q : G.V) @@ -104,6 +105,7 @@ theorem transmissionInequality_wedgeAddDivisor_sameLeft_iff_rowProfile rfl /-- The full arbitrary-ASP profile with both marks on the left factor. -/ +@[expose] def WedgeSameLeftTransmissionProfile (G : CFGraph.{u}) (H : CFGraph.{v}) (x : G.V) (y : H.V) (D : CFDiv G) (E : CFDiv H) (p q : G.V) (tau : AspPerm) : Prop := @@ -177,6 +179,7 @@ theorem wedgeAddDivisor_transmissionTwist_sameRight /-- The factor-rank inequality for one transmission row when both marks lie on the right factor. -/ +@[expose] def WedgeSameRightTransmissionRowProfile (G : CFGraph.{u}) (H : CFGraph.{v}) (x : G.V) (y : H.V) (D : CFDiv G) (E : CFDiv H) (p q : H.V) @@ -203,6 +206,7 @@ theorem transmissionInequality_wedgeAddDivisor_sameRight_iff_rowProfile rfl /-- The full arbitrary-ASP profile with both marks on the right factor. -/ +@[expose] def WedgeSameRightTransmissionProfile (G : CFGraph.{u}) (H : CFGraph.{v}) (x : G.V) (y : H.V) (D : CFDiv G) (E : CFDiv H) (p q : H.V) (tau : AspPerm) : Prop := diff --git a/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionWedgeSameSidePresentation.lean b/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionWedgeSameSidePresentation.lean index 0dc6e2b4e4..bc6f50eeca 100644 --- a/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionWedgeSameSidePresentation.lean +++ b/LeanPool/BrillNoetherGraphs/Utilities/Transmission/TransmissionWedgeSameSidePresentation.lean @@ -20,7 +20,7 @@ explicit mapped divisors needed when wedge decompositions are used recursively. -/ -@[expose] public section +public section namespace Utilities diff --git a/LeanPool/BrooksSubcubic/CandidatePair.lean b/LeanPool/BrooksSubcubic/CandidatePair.lean index 5d6207adf9..f6ff722b7d 100644 --- a/LeanPool/BrooksSubcubic/CandidatePair.lean +++ b/LeanPool/BrooksSubcubic/CandidatePair.lean @@ -13,7 +13,7 @@ public import LeanPool.BrooksSubcubic.ComponentAttachments Part of the proof that a finite subcubic K₄-free graph is three-colourable. -/ -@[expose] public section +public section section diff --git a/LeanPool/BrooksSubcubic/ColouringGlue.lean b/LeanPool/BrooksSubcubic/ColouringGlue.lean index 5d6d38c177..44e30e04be 100644 --- a/LeanPool/BrooksSubcubic/ColouringGlue.lean +++ b/LeanPool/BrooksSubcubic/ColouringGlue.lean @@ -13,7 +13,7 @@ public import Mathlib.Combinatorics.SimpleGraph.Coloring.Vertex Part of the proof that a finite subcubic K₄-free graph is three-colourable. -/ -@[expose] public section +public section section diff --git a/LeanPool/BrooksSubcubic/ComponentAttachments.lean b/LeanPool/BrooksSubcubic/ComponentAttachments.lean index 26632473db..95f6b44517 100644 --- a/LeanPool/BrooksSubcubic/ComponentAttachments.lean +++ b/LeanPool/BrooksSubcubic/ComponentAttachments.lean @@ -14,7 +14,7 @@ public import Mathlib.Tactic.Push Part of the proof that a finite subcubic K₄-free graph is three-colourable. -/ -@[expose] public section +public section section diff --git a/LeanPool/BrooksSubcubic/CubicColouring.lean b/LeanPool/BrooksSubcubic/CubicColouring.lean index cd48135057..2057e84ae5 100644 --- a/LeanPool/BrooksSubcubic/CubicColouring.lean +++ b/LeanPool/BrooksSubcubic/CubicColouring.lean @@ -18,7 +18,7 @@ public import LeanPool.BrooksSubcubic.GoodTriple Part of the proof that a finite subcubic K₄-free graph is three-colourable. -/ -@[expose] public section +public section section diff --git a/LeanPool/BrooksSubcubic/CutColouring.lean b/LeanPool/BrooksSubcubic/CutColouring.lean index 016e1c5a67..e0f5df3fd4 100644 --- a/LeanPool/BrooksSubcubic/CutColouring.lean +++ b/LeanPool/BrooksSubcubic/CutColouring.lean @@ -14,7 +14,7 @@ public import LeanPool.BrooksSubcubic.NonRegular Part of the proof that a finite subcubic K₄-free graph is three-colourable. -/ -@[expose] public section +public section section diff --git a/LeanPool/BrooksSubcubic/CutPartition.lean b/LeanPool/BrooksSubcubic/CutPartition.lean index 042a8a4315..946e2b010b 100644 --- a/LeanPool/BrooksSubcubic/CutPartition.lean +++ b/LeanPool/BrooksSubcubic/CutPartition.lean @@ -13,7 +13,7 @@ public import LeanPool.BrooksSubcubic.ComponentAttachments Part of the proof that a finite subcubic K₄-free graph is three-colourable. -/ -@[expose] public section +public section section diff --git a/LeanPool/BrooksSubcubic/CutVertex.lean b/LeanPool/BrooksSubcubic/CutVertex.lean index f798294844..cf9dc70804 100644 --- a/LeanPool/BrooksSubcubic/CutVertex.lean +++ b/LeanPool/BrooksSubcubic/CutVertex.lean @@ -13,7 +13,7 @@ public import LeanPool.BrooksSubcubic.ComponentAttachments Part of the proof that a finite subcubic K₄-free graph is three-colourable. -/ -@[expose] public section +public section section @@ -24,6 +24,7 @@ namespace BrooksSubcubic variable {V : Type*} [Fintype V] /-- `x` is a cut vertex of `G` when deleting it disconnects `G`. -/ +@[expose] def IsCutVertex (G : SimpleGraph V) (x : V) : Prop := ¬ (G.induce ({x}ᶜ : Set V)).Connected diff --git a/LeanPool/BrooksSubcubic/Endblock.lean b/LeanPool/BrooksSubcubic/Endblock.lean index 3ffc20152a..1b20021caf 100644 --- a/LeanPool/BrooksSubcubic/Endblock.lean +++ b/LeanPool/BrooksSubcubic/Endblock.lean @@ -13,7 +13,7 @@ public import LeanPool.BrooksSubcubic.CutVertex Part of the proof that a finite subcubic K₄-free graph is three-colourable. -/ -@[expose] public section +public section section open SimpleGraph Finset diff --git a/LeanPool/BrooksSubcubic/GoodTriple.lean b/LeanPool/BrooksSubcubic/GoodTriple.lean index e77e30dfba..752160f684 100644 --- a/LeanPool/BrooksSubcubic/GoodTriple.lean +++ b/LeanPool/BrooksSubcubic/GoodTriple.lean @@ -13,7 +13,7 @@ public import LeanPool.BrooksSubcubic.NoCutTriple Part of the proof that a finite subcubic K₄-free graph is three-colourable. -/ -@[expose] public section +public section section open SimpleGraph Finset diff --git a/LeanPool/BrooksSubcubic/Greedy.lean b/LeanPool/BrooksSubcubic/Greedy.lean index df00a4eea1..abbb35432c 100644 --- a/LeanPool/BrooksSubcubic/Greedy.lean +++ b/LeanPool/BrooksSubcubic/Greedy.lean @@ -14,7 +14,7 @@ public import Mathlib.Data.Finset.Max Part of the proof that a finite subcubic K₄-free graph is three-colourable. -/ -@[expose] public section +public section section diff --git a/LeanPool/BrooksSubcubic/K4Free.lean b/LeanPool/BrooksSubcubic/K4Free.lean index 77c8e8fe3c..06c7be712a 100644 --- a/LeanPool/BrooksSubcubic/K4Free.lean +++ b/LeanPool/BrooksSubcubic/K4Free.lean @@ -14,7 +14,7 @@ public import Mathlib.Tactic.Push Part of the proof that a finite subcubic K₄-free graph is three-colourable. -/ -@[expose] public section +public section section diff --git a/LeanPool/BrooksSubcubic/Main.lean b/LeanPool/BrooksSubcubic/Main.lean index 6600756ba3..111ce4e197 100644 --- a/LeanPool/BrooksSubcubic/Main.lean +++ b/LeanPool/BrooksSubcubic/Main.lean @@ -13,7 +13,7 @@ public import LeanPool.BrooksSubcubic.CubicColouring Part of the proof that a finite subcubic K₄-free graph is three-colourable. -/ -@[expose] public section +public section section diff --git a/LeanPool/BrooksSubcubic/NoCutTriple.lean b/LeanPool/BrooksSubcubic/NoCutTriple.lean index aed4d00cbe..73b461ab33 100644 --- a/LeanPool/BrooksSubcubic/NoCutTriple.lean +++ b/LeanPool/BrooksSubcubic/NoCutTriple.lean @@ -15,7 +15,7 @@ public import LeanPool.BrooksSubcubic.K4Free Part of the proof that a finite subcubic K₄-free graph is three-colourable. -/ -@[expose] public section +public section section open SimpleGraph Finset diff --git a/LeanPool/BrooksSubcubic/NonRegular.lean b/LeanPool/BrooksSubcubic/NonRegular.lean index 677356d98e..8a6d7e0348 100644 --- a/LeanPool/BrooksSubcubic/NonRegular.lean +++ b/LeanPool/BrooksSubcubic/NonRegular.lean @@ -16,7 +16,7 @@ public import Mathlib.Tactic.Ring Part of the proof that a finite subcubic K₄-free graph is three-colourable. -/ -@[expose] public section +public section section diff --git a/LeanPool/Brouwer.lean b/LeanPool/Brouwer.lean index 99e1a30091..86678ca1c8 100644 --- a/LeanPool/Brouwer.lean +++ b/LeanPool/Brouwer.lean @@ -19,4 +19,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 e6259cd091..4c3c2b62e2 100644 --- a/LeanPool/Brouwer/Brouwer.lean +++ b/LeanPool/Brouwer/Brouwer.lean @@ -26,7 +26,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 3d6c61fbc6..231f930106 100644 --- a/LeanPool/Brouwer/BrouwerProduct.lean +++ b/LeanPool/Brouwer/BrouwerProduct.lean @@ -19,7 +19,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 f517cac422..18889e8ab6 100644 --- a/LeanPool/Brouwer/Nash.lean +++ b/LeanPool/Brouwer/Nash.lean @@ -21,7 +21,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) @@ -235,7 +235,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 e86d900e55..0b5ee8aae4 100644 --- a/LeanPool/Brouwer/Primitive.lean +++ b/LeanPool/Brouwer/Primitive.lean @@ -21,7 +21,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 @@ -54,6 +54,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) @@ -922,6 +923,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 @@ -1659,6 +1661,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 c5f71232fc..f63b7d6764 100644 --- a/LeanPool/Brouwer/Scarf.lean +++ b/LeanPool/Brouwer/Scarf.lean @@ -26,7 +26,7 @@ machinery used in the parity (door-counting) argument that culminates in colorful room. -/ -@[expose] public section +public section section fiberlemma @@ -99,7 +99,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 @@ -916,12 +916,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 5d07ebb0ec..72d7d52c65 100644 --- a/LeanPool/Brouwer/ScarfPath.lean +++ b/LeanPool/Brouwer/ScarfPath.lean @@ -18,7 +18,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 @@ -34,11 +34,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 @@ -47,6 +49,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 ∧ @@ -92,12 +95,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 @@ -107,10 +112,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 @@ -439,6 +446,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 @@ -465,6 +473,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) ∧ @@ -512,6 +521,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 f6fa2eb88a..38d3426acd 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 18557c739c..02d9ba2bf6 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 e1bcb8bcdd..0f472b1f19 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 @@ -321,6 +324,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 d79db7fc18..c76fdde3e2 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 1f2916ad27..f4524ef416 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/CarlsonFunctions/SeveralComplexVariables/Basic.lean b/LeanPool/CarlsonFunctions/SeveralComplexVariables/Basic.lean index 6164774b0b..3b3bea6622 100644 --- a/LeanPool/CarlsonFunctions/SeveralComplexVariables/Basic.lean +++ b/LeanPool/CarlsonFunctions/SeveralComplexVariables/Basic.lean @@ -34,7 +34,7 @@ is proved first and then transported along a linear equivalence; this proof orde no choice of coordinates on the general statements. -/ -@[expose] public section +public section open Set diff --git a/LeanPool/CarlsonFunctions/SeveralComplexVariables/CauchyEstimates.lean b/LeanPool/CarlsonFunctions/SeveralComplexVariables/CauchyEstimates.lean index fb5aa53fa9..192c06fd7d 100644 --- a/LeanPool/CarlsonFunctions/SeveralComplexVariables/CauchyEstimates.lean +++ b/LeanPool/CarlsonFunctions/SeveralComplexVariables/CauchyEstimates.lean @@ -15,7 +15,7 @@ These estimates reuse the one-variable Cauchy estimate on coordinate slices. The has the supremum norm, so a coordinate disc fits in the ball of the same radius. -/ -@[expose] public section +public section open Complex Function Metric Set diff --git a/LeanPool/CarlsonFunctions/SeveralComplexVariables/CauchyIntegral.lean b/LeanPool/CarlsonFunctions/SeveralComplexVariables/CauchyIntegral.lean index 58e5234370..805642854e 100644 --- a/LeanPool/CarlsonFunctions/SeveralComplexVariables/CauchyIntegral.lean +++ b/LeanPool/CarlsonFunctions/SeveralComplexVariables/CauchyIntegral.lean @@ -14,7 +14,7 @@ The vector-valued iterated Cauchy formula assumes continuity and coordinatewise on the closed polydisc. It does not depend on the several-variable Osgood theorem. -/ -@[expose] public section +public section open Complex Filter Function MeasureTheory Metric Set open scoped ENNReal NNReal Real Topology diff --git a/LeanPool/CarlsonFunctions/SeveralComplexVariables/CauchySeries.lean b/LeanPool/CarlsonFunctions/SeveralComplexVariables/CauchySeries.lean index fb5556cf91..cca3b9714c 100644 --- a/LeanPool/CarlsonFunctions/SeveralComplexVariables/CauchySeries.lean +++ b/LeanPool/CarlsonFunctions/SeveralComplexVariables/CauchySeries.lean @@ -25,7 +25,7 @@ and radius independence are developed in `CauchyCoefficients`; the separate-radi expansion, its uniform convergence and remainder estimates are in `PolydiscTaylor`. -/ -@[expose] public section +public section open Complex Filter Function MeasureTheory Metric Set open scoped ENNReal NNReal Real Topology @@ -142,6 +142,7 @@ private lemma hasSum_antidiagonalTuple_geometric {K : Type*} [NormedField K] [Co exact he.sigma hfin /-- The multi-index Cauchy coefficient of a vector-valued function on a polydisc. -/ +@[expose] noncomputable def polydiscCauchyCoeff {d : ℕ} (f : (Fin d → ℂ) → E) (c : Fin d → ℂ) (R : ℝ) (m : Fin d → ℕ) : E := ((2 * π * I : ℂ) ^ d)⁻¹ • torusIntegral diff --git a/LeanPool/CarlsonFunctions/SeveralComplexVariables/ContourIntegral.lean b/LeanPool/CarlsonFunctions/SeveralComplexVariables/ContourIntegral.lean index d681d3c57d..3462adb412 100644 --- a/LeanPool/CarlsonFunctions/SeveralComplexVariables/ContourIntegral.lean +++ b/LeanPool/CarlsonFunctions/SeveralComplexVariables/ContourIntegral.lean @@ -24,7 +24,7 @@ It does not assert a Jordan-curve theorem or homotopy invariance of contours. open Complex MeasureTheory Filter Metric Set open scoped Topology -@[expose] public section +public section variable {E α : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] [FiniteDimensional ℂ E] [MeasurableSpace α] [TopologicalSpace α] [BorelSpace α] [T2Space α] diff --git a/LeanPool/CarlsonFunctions/SeveralComplexVariables/DominatedIntegral.lean b/LeanPool/CarlsonFunctions/SeveralComplexVariables/DominatedIntegral.lean index b3be9bc3e0..0b70dc9d24 100644 --- a/LeanPool/CarlsonFunctions/SeveralComplexVariables/DominatedIntegral.lean +++ b/LeanPool/CarlsonFunctions/SeveralComplexVariables/DominatedIntegral.lean @@ -21,7 +21,7 @@ separate hypothesis so that the integration space needs no topology. open Complex MeasureTheory Filter Metric Set open scoped Topology -@[expose] public section +public section variable {α ι : Type*} [MeasurableSpace α] [Fintype ι] /-- A locally dominated holomorphic integrand has a holomorphic integral. The derivative diff --git a/LeanPool/CarlsonFunctions/SeveralComplexVariables/LocallyBounded.lean b/LeanPool/CarlsonFunctions/SeveralComplexVariables/LocallyBounded.lean index 1eebf3cc1b..79cb81011d 100644 --- a/LeanPool/CarlsonFunctions/SeveralComplexVariables/LocallyBounded.lean +++ b/LeanPool/CarlsonFunctions/SeveralComplexVariables/LocallyBounded.lean @@ -16,7 +16,7 @@ separately holomorphic functions. This supplies the continuity hypothesis of Osg theorem and the equicontinuity estimate used in Montel's theorem. -/ -@[expose] public section +public section open Complex Filter Function Metric Set open scoped NNReal Topology diff --git a/LeanPool/CarlsonFunctions/SeveralComplexVariables/LocallyUniform.lean b/LeanPool/CarlsonFunctions/SeveralComplexVariables/LocallyUniform.lean index 7cb3faa003..03e26de562 100644 --- a/LeanPool/CarlsonFunctions/SeveralComplexVariables/LocallyUniform.lean +++ b/LeanPool/CarlsonFunctions/SeveralComplexVariables/LocallyUniform.lean @@ -39,7 +39,7 @@ Derivative convergence uses a one-variable Cauchy estimate on compact thickening by finite sums, currying, and transport along a continuous linear choice of coordinates. -/ -@[expose] public section +public section open Filter Set diff --git a/LeanPool/CarlsonFunctions/SeveralComplexVariables/Montel.lean b/LeanPool/CarlsonFunctions/SeveralComplexVariables/Montel.lean index e55a807cfc..5b5258c33d 100644 --- a/LeanPool/CarlsonFunctions/SeveralComplexVariables/Montel.lean +++ b/LeanPool/CarlsonFunctions/SeveralComplexVariables/Montel.lean @@ -18,7 +18,7 @@ domain is equicontinuous. For finite-dimensional targets it has compact closure compact-open topology. Compactness is supplied by Mathlib's Arzelà–Ascoli theorem. -/ -@[expose] public section +public section open Complex Filter Function Metric Set open scoped Topology diff --git a/LeanPool/CarlsonFunctions/SeveralComplexVariables/Osgood.lean b/LeanPool/CarlsonFunctions/SeveralComplexVariables/Osgood.lean index 41b78b18ca..c80270e914 100644 --- a/LeanPool/CarlsonFunctions/SeveralComplexVariables/Osgood.lean +++ b/LeanPool/CarlsonFunctions/SeveralComplexVariables/Osgood.lean @@ -17,7 +17,7 @@ proved here. The polydisc Cauchy formula and its series construction live in the modules and remain available through this file. -/ -@[expose] public section +public section open Complex Filter Function MeasureTheory Metric Set open scoped ENNReal NNReal Real Topology diff --git a/LeanPool/CarlsonFunctions/SeveralComplexVariables/ParametricIntegral.lean b/LeanPool/CarlsonFunctions/SeveralComplexVariables/ParametricIntegral.lean index cc3a6ca3ff..8d3c3c73c1 100644 --- a/LeanPool/CarlsonFunctions/SeveralComplexVariables/ParametricIntegral.lean +++ b/LeanPool/CarlsonFunctions/SeveralComplexVariables/ParametricIntegral.lean @@ -35,7 +35,7 @@ derivative identification is already Mathlib's `hasFDerivAt_integral_of_dominate The integral theorem names remain in the root namespace, consistently with that API. -/ -@[expose] public section +public section open Filter MeasureTheory Set open scoped Topology diff --git a/LeanPool/CarlsonFunctions/SeveralComplexVariables/Polydisc.lean b/LeanPool/CarlsonFunctions/SeveralComplexVariables/Polydisc.lean index 65ebece275..ce4875a95f 100644 --- a/LeanPool/CarlsonFunctions/SeveralComplexVariables/Polydisc.lean +++ b/LeanPool/CarlsonFunctions/SeveralComplexVariables/Polydisc.lean @@ -15,7 +15,7 @@ Geometry for the polydisc Cauchy formula. Equal-radius polydiscs use the supremu these are not Euclidean balls. -/ -@[expose] public section +public section open Complex Filter Function MeasureTheory Metric Set open scoped ENNReal NNReal Real Topology @@ -28,6 +28,7 @@ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] [CompleteSpace E /-- The closed polydisc of equal radii. For `0 ≤ R` this coincides with the closed ball for the sup-norm. -/ +@[expose] def closedPolydisc {ι : Type*} (c : ι → ℂ) (R : ℝ) : Set (ι → ℂ) := Set.pi univ fun i => closedBall (c i) R @@ -36,6 +37,7 @@ def polydiscWithRadii {ι : Type*} (c : ι → ℂ) (r : ι → ℝ) : Set (ι Set.pi univ fun i => ball (c i) (r i) /-- A closed polydisc with a separate radius in each coordinate. -/ +@[expose] def closedPolydiscWithRadii {ι : Type*} (c : ι → ℂ) (r : ι → ℝ) : Set (ι → ℂ) := Set.pi univ fun i => closedBall (c i) (r i) diff --git a/LeanPool/CarlsonFunctions/SeveralComplexVariables/Reindex.lean b/LeanPool/CarlsonFunctions/SeveralComplexVariables/Reindex.lean index 38814fc8a9..f06690aa1c 100644 --- a/LeanPool/CarlsonFunctions/SeveralComplexVariables/Reindex.lean +++ b/LeanPool/CarlsonFunctions/SeveralComplexVariables/Reindex.lean @@ -16,7 +16,7 @@ is transported along any enumeration of a finite index type; its value is indepe of that enumeration whenever the Cauchy hypotheses hold. -/ -@[expose] public section +public section open Complex Function MeasureTheory Set open scoped Real diff --git a/LeanPool/CarlsonFunctions/Solution.lean b/LeanPool/CarlsonFunctions/Solution.lean index dc688cb648..4871d2b652 100644 --- a/LeanPool/CarlsonFunctions/Solution.lean +++ b/LeanPool/CarlsonFunctions/Solution.lean @@ -28,7 +28,7 @@ source revision; this import does not maintain that upstream comparison. [carlsonAudit]: https://github.com/bjbraams/lean-codes/blob/fcc2be9a086c1bdd572db91f005e868b80a8d644/PALOMAR.md -/ -@[expose] public section +public section open Complex MeasureTheory Set open scoped Topology Matrix diff --git a/LeanPool/CarlsonFunctions/StdSimplexMeasure/PiSnoc.lean b/LeanPool/CarlsonFunctions/StdSimplexMeasure/PiSnoc.lean index ffbce5c8e5..c1fbb88960 100644 --- a/LeanPool/CarlsonFunctions/StdSimplexMeasure/PiSnoc.lean +++ b/LeanPool/CarlsonFunctions/StdSimplexMeasure/PiSnoc.lean @@ -29,7 +29,7 @@ TODO: if those lemmas land in Mathlib, delete this file and switch uses to the u open MeasureTheory MeasureTheory.Measure -@[expose] public section +public section namespace MeasurableEquiv @@ -37,6 +37,7 @@ namespace MeasurableEquiv `((i : Fin n) → α i.castSucc) × α (Fin.last n) ≃ᵐ (∀ i, α i)` given by `Fin.snoc`. Measurable version of `Fin.snocEquiv` with the product factors swapped. -/ +@[expose] def piFinSnoc {n : ℕ} (α : Fin (n + 1) → Type*) [∀ i, MeasurableSpace (α i)] : ((i : Fin n) → α i.castSucc) × α (Fin.last n) ≃ᵐ (∀ i, α i) where toFun p := Fin.snoc p.1 p.2 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..a102b9f2ba 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,12 +57,12 @@ $$ \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 $d-\deg(c)$ chips at $q$. -/ -def toDiv {G : CFGraph} {q : G.V} (d : ℤ) (c : Config G q) : CFDiv G := +@[expose] def toDiv {G : CFGraph} {q : G.V} (d : ℤ) (c : Config G q) : CFDiv G := c.chips + (d - configDegree c) • (oneChip q) /-- Two configurations are equal if their chip counts agree at every vertex. -/ @@ -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..b805e717c8 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. -/ @@ -66,7 +66,7 @@ lemma maximal_unwinnable_preserved (G : CFGraph) (D1 D2 : CFDiv G) : This is used to define `rankGeq`: the relation $r(D) \ge k$ means that $D-E$ is winnable for every effective divisor $E$ of degree $k$. -/ -def effOfDegree (G : CFGraph) (k : ℤ) : Set (CFDiv G) := +@[expose] def effOfDegree (G : CFGraph) (k : ℤ) : Set (CFDiv G) := {E | effective E ∧ deg E = k} /-- For any nonnegative integer $k$, the set of effective divisors of degree $k$ is nonempty. -/ @@ -80,11 +80,11 @@ 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. -/ -def rankEq (G : CFGraph) (D : CFDiv G) (r : ℤ) : Prop := +@[expose] def rankEq (G : CFGraph) (D : CFDiv G) (r : ℤ) : Prop := rankGeq G D r ∧ ¬(rankGeq G D (r+1)) /-- The relation `rankGeq G D k` holds vacuously for $k < 0$, since there are no effective 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 548201787b..fb80e6eb7f 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..14f03fce13 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 @@ -29,6 +29,7 @@ open Complex open SurfaceCellComplex /-- The point on occurrence `i` of the canonical orientable one-face presentation. -/ +@[expose] noncomputable def orientableOccurrencePoint (p n : ℕ) (i : Fin (orientableBoundaryWord p n).length) (t : unitInterval) : (orientableCellComplex p n).PolygonalPreRealization := @@ -260,6 +261,7 @@ theorem orientableCarrier_boundary_c_eqvGen (OrientableRel.c (p := p) t (Fin.rev j))) /-- The point on occurrence `i` of the canonical nonorientable one-face presentation. -/ +@[expose] noncomputable def nonOrientableOccurrencePoint (p n : ℕ) (i : Fin (nonOrientableBoundaryWord p n).length) (t : unitInterval) : (nonOrientableCellComplex p n).PolygonalPreRealization := 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..8d576633c6 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 @@ -33,6 +33,7 @@ open SurfaceCellComplex /-! ## Nonorientable pairing instructions -/ /-- The same-direction identification contributed by the square `aᵢ aᵢ`. -/ +@[expose] def nonOrientableCrosscapIdentification {p n : ℕ} (i : Fin p) : PolygonGluing.Identification (nonOrientableCellComplex p n).Face (nonOrientableCellComplex p n).faceBoundaryLength := @@ -45,6 +46,7 @@ def nonOrientableCrosscapIdentification {p n : ℕ} (i : Fin p) : (nonOrientableCrosscapPosition p n i 1))) /-- The opposite-direction identification contributed by `cⱼ ... cⱼ⁻¹`. -/ +@[expose] def nonOrientableBoundaryIdentification {p n : ℕ} (j : Fin n) : PolygonGluing.Identification (nonOrientableCellComplex p n).Face (nonOrientableCellComplex p n).faceBoundaryLength := @@ -57,6 +59,7 @@ def nonOrientableBoundaryIdentification {p n : ℕ} (j : Fin n) : (nonOrientableBoundaryPosition p n j 2))) /-- The reverse ordered direction of a crosscap identification. -/ +@[expose] def nonOrientableCrosscapIdentificationReverse {p n : ℕ} (i : Fin p) : PolygonGluing.Identification (nonOrientableCellComplex p n).Face (nonOrientableCellComplex p n).faceBoundaryLength := @@ -69,6 +72,7 @@ def nonOrientableCrosscapIdentificationReverse {p n : ℕ} (i : Fin p) : (nonOrientableCrosscapPosition p n i 0))) /-- The reverse ordered direction of a boundary-seam identification. -/ +@[expose] def nonOrientableBoundaryIdentificationReverse {p n : ℕ} (j : Fin n) : PolygonGluing.Identification (nonOrientableCellComplex p n).Face (nonOrientableCellComplex p n).faceBoundaryLength := @@ -511,6 +515,7 @@ theorem orientableBoundaryWord_edgeOccurrences_h {p n : ℕ} (j : Fin n) : simp /-- The opposite-direction identification contributed by `aᵢ ... aᵢ⁻¹`. -/ +@[expose] def orientableHandleAIdentification {p n : ℕ} (i : Fin p) : PolygonGluing.Identification (orientableCellComplex p n).Face (orientableCellComplex p n).faceBoundaryLength := @@ -523,6 +528,7 @@ def orientableHandleAIdentification {p n : ℕ} (i : Fin p) : (orientableHandlePosition p n i 2))) /-- The opposite-direction identification contributed by `bᵢ ... bᵢ⁻¹`. -/ +@[expose] def orientableHandleBIdentification {p n : ℕ} (i : Fin p) : PolygonGluing.Identification (orientableCellComplex p n).Face (orientableCellComplex p n).faceBoundaryLength := @@ -535,6 +541,7 @@ def orientableHandleBIdentification {p n : ℕ} (i : Fin p) : (orientableHandlePosition p n i 3))) /-- The opposite-direction identification contributed by `cⱼ ... cⱼ⁻¹`. -/ +@[expose] def orientableBoundaryIdentification {p n : ℕ} (j : Fin n) : PolygonGluing.Identification (orientableCellComplex p n).Face (orientableCellComplex p n).faceBoundaryLength := @@ -547,6 +554,7 @@ def orientableBoundaryIdentification {p n : ℕ} (j : Fin n) : (orientableBoundaryPosition p n j 2))) /-- The reverse ordered direction of an orientable `aᵢ` identification. -/ +@[expose] def orientableHandleAIdentificationReverse {p n : ℕ} (i : Fin p) : PolygonGluing.Identification (orientableCellComplex p n).Face (orientableCellComplex p n).faceBoundaryLength := @@ -559,6 +567,7 @@ def orientableHandleAIdentificationReverse {p n : ℕ} (i : Fin p) : (orientableHandlePosition p n i 0))) /-- The reverse ordered direction of an orientable `bᵢ` identification. -/ +@[expose] def orientableHandleBIdentificationReverse {p n : ℕ} (i : Fin p) : PolygonGluing.Identification (orientableCellComplex p n).Face (orientableCellComplex p n).faceBoundaryLength := @@ -571,6 +580,7 @@ def orientableHandleBIdentificationReverse {p n : ℕ} (i : Fin p) : (orientableHandlePosition p n i 1))) /-- The reverse ordered direction of an orientable boundary-seam identification. -/ +@[expose] def orientableBoundaryIdentificationReverse {p n : ℕ} (j : Fin n) : PolygonGluing.Identification (orientableCellComplex p n).Face (orientableCellComplex p n).faceBoundaryLength := diff --git a/LeanPool/ClassificationOfSurfaces/CanonicalWords.lean b/LeanPool/ClassificationOfSurfaces/CanonicalWords.lean index b1ecbedc56..9024e19645 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 @@ -148,14 +148,14 @@ private theorem orientableBoundaryWords_eq_ofFn (p n : ℕ) : simp [orientableBoundaryLinearDart, orientableBoundaryBlock] /-- Position `k` in handle block `i` inside the full orientable boundary word. -/ -def orientableHandlePosition (p n : ℕ) (i : Fin p) (k : Fin 4) : +@[expose] def orientableHandlePosition (p n : ℕ) (i : Fin p) (k : Fin 4) : Fin (orientableBoundaryWord p n).length := ⟨i.val * 4 + k.val, by rw [orientableBoundaryWord_length] omega⟩ /-- Position `k` in boundary block `j` inside the full orientable boundary word. -/ -def orientableBoundaryPosition (p n : ℕ) (j : Fin n) (k : Fin 3) : +@[expose] def orientableBoundaryPosition (p n : ℕ) (j : Fin n) (k : Fin 3) : Fin (orientableBoundaryWord p n).length := ⟨4 * p + j.val * 3 + k.val, by rw [orientableBoundaryWord_length] @@ -273,14 +273,14 @@ private theorem nonOrientableBoundaryWords_eq_ofFn (p n : ℕ) : simp [nonOrientableBoundaryLinearDart, nonOrientableBoundaryBlock] /-- Position `k` in crosscap block `i` inside the full nonorientable boundary word. -/ -def nonOrientableCrosscapPosition (p n : ℕ) (i : Fin p) (k : Fin 2) : +@[expose] def nonOrientableCrosscapPosition (p n : ℕ) (i : Fin p) (k : Fin 2) : Fin (nonOrientableBoundaryWord p n).length := ⟨i.val * 2 + k.val, by rw [nonOrientableBoundaryWord_length] omega⟩ /-- Position `k` in boundary block `j` inside the full nonorientable boundary word. -/ -def nonOrientableBoundaryPosition (p n : ℕ) (j : Fin n) (k : Fin 3) : +@[expose] def nonOrientableBoundaryPosition (p n : ℕ) (j : Fin n) (k : Fin 3) : Fin (nonOrientableBoundaryWord p n).length := ⟨2 * p + j.val * 3 + k.val, by rw [nonOrientableBoundaryWord_length] diff --git a/LeanPool/ClassificationOfSurfaces/CellComplex.lean b/LeanPool/ClassificationOfSurfaces/CellComplex.lean index 6d771403e8..ff2d941d6b 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 @@ -59,10 +59,12 @@ attribute [instance] SurfaceCellComplex.vertexFintype namespace SurfaceCellComplex /-- The number of faces in a finite surface cell complex. -/ +@[expose] def numFaces (K : SurfaceCellComplex) : ℕ := Fintype.card K.Face /-- The number of oriented darts in a finite surface cell complex. -/ +@[expose] def numDarts (K : SurfaceCellComplex) : ℕ := Fintype.card K.Dart @@ -82,28 +84,29 @@ 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. -/ -def OccursExactlyOnce (K : SurfaceCellComplex) (d : K.Dart) : Prop := +@[expose] def OccursExactlyOnce (K : SurfaceCellComplex) (d : K.Dart) : Prop := ∃ o, K.Occurs d o ∧ ∀ o', K.Occurs d o' → o' = o /-- The unoriented edge named by `d` occurs at exactly two boundary positions. -/ -def OccursExactlyTwice (K : SurfaceCellComplex) (d : K.Dart) : Prop := +@[expose] def OccursExactlyTwice (K : SurfaceCellComplex) (d : K.Dart) : Prop := ∃ o₁ o₂, o₁ ≠ o₂ ∧ K.Occurs d o₁ ∧ K.Occurs d o₂ ∧ ∀ o, K.Occurs d o → o = o₁ ∨ o = o₂ /-- Boundary status derived from incidence: the edge orbit of `d` occurs exactly once. -/ -def IsBoundaryDart (K : SurfaceCellComplex) (d : K.Dart) : Prop := +@[expose] def IsBoundaryDart (K : SurfaceCellComplex) (d : K.Dart) : Prop := K.OccursExactlyOnce d /-- Incidence validity for the stored face-boundary system. @@ -113,7 +116,7 @@ distinct, and every unoriented edge occurs either once (a boundary edge) or twic Boundary status and occurrence counts are derived from explicit boundary positions, so repeated darts such as the projective-plane word `a a` are retained. The stored vertex endpoints are an enrichment of Gallier--Xu's boundary-word data and are deliberately not part of this predicate. -/ -def IsSurfaceValid (K : SurfaceCellComplex) : Prop := +@[expose] def IsSurfaceValid (K : SurfaceCellComplex) : Prop := Nonempty K.Face ∧ (∀ f g, (K.boundary f).IsRotated (K.boundary g) → f = g) ∧ (∀ d, K.inv d ≠ d) ∧ @@ -153,11 +156,11 @@ theorem occurs_twice_of_not_boundary {K : SurfaceCellComplex} (h : K.IsSurfaceVa end IsSurfaceValid /-- Two faces are adjacent when their boundaries use the same unoriented edge. -/ -def FaceAdjacent (K : SurfaceCellComplex) (f g : K.Face) : Prop := +@[expose] def FaceAdjacent (K : SurfaceCellComplex) (f g : K.Face) : Prop := ∃ d ∈ K.boundary f, ∃ e ∈ K.boundary g, K.SameEdge d e /-- Gallier-Xu connectivity of the face-edge incidence system. -/ -def IsConnected (K : SurfaceCellComplex) : Prop := +@[expose] def IsConnected (K : SurfaceCellComplex) : Prop := Nonempty K.Face ∧ ∀ f g, Relation.ReflTransGen K.FaceAdjacent f g /-- A signed occurrence of a named edge in a polygonal boundary word. -/ @@ -174,7 +177,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 @@ -185,7 +188,7 @@ def flip {α : Type*} : SignedDart α → SignedDart α cases d <;> rfl /-- Orientation reversal as an equivalence. -/ -def flipEquiv (α : Type*) : SignedDart α ≃ SignedDart α where +@[expose] def flipEquiv (α : Type*) : SignedDart α ≃ SignedDart α where toFun := flip invFun := flip left_inv := flip_flip @@ -233,7 +236,7 @@ theorem oneFacePresentation_isConnected (Edge : Type) [Fintype Edge] exact Relation.ReflTransGen.refl /-- Convert an oriented triangulation edge occurrence to a cell-complex signed dart. -/ -def signedDartOfOrientedEdge {Edge : Type*} : +@[expose] def signedDartOfOrientedEdge {Edge : Type*} : OrientedEdge Edge → SignedDart Edge | OrientedEdge.pos e => SignedDart.pos e | OrientedEdge.neg e => SignedDart.neg e @@ -253,7 +256,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 @@ -392,7 +395,7 @@ variable {S : Type*} [TopologicalSpace S] /-- Triangle-boundary positions are canonically the boundary occurrences of the converted cell complex. -/ -def boundaryPositionEquivCellOccurrence (T : FiniteSurfaceTriangulation S) : +@[expose] def boundaryPositionEquivCellOccurrence (T : FiniteSurfaceTriangulation S) : T.BoundaryPosition ≃ T.toCellComplex.BoundaryOccurrence := Equiv.sigmaCongrRight fun _ => (Fin.castOrderIso (by simp [toCellComplex])).toEquiv diff --git a/LeanPool/ClassificationOfSurfaces/CellComplexQuotient.lean b/LeanPool/ClassificationOfSurfaces/CellComplexQuotient.lean index eea331b711..8b8bd0baf6 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 @@ -234,7 +234,7 @@ theorem oneFacePresentation_occurrencePairingValid namespace BoundaryPairing /-- The generic polygon-side identification associated to an occurrence pairing. -/ -def identification {K : SurfaceCellComplex} (pairing : K.BoundaryPairing) : +@[expose] def identification {K : SurfaceCellComplex} (pairing : K.BoundaryPairing) : PolygonGluing.Identification K.Face K.faceBoundaryLength where source := K.occurrenceSide pairing.source target := K.occurrenceSide pairing.target @@ -258,6 +258,7 @@ theorem identification_direction {K : SurfaceCellComplex} (pairing : K.BoundaryP end BoundaryPairing /-- All side identifications compatible with a pairing-valid complex. -/ +@[expose] def polygonalIdentifications (K : SurfaceCellComplex) (_valid : K.OccurrencePairingValid) : Set (PolygonGluing.Identification K.Face K.faceBoundaryLength) := Set.range BoundaryPairing.identification @@ -307,7 +308,7 @@ theorem mem_polygonalIdentifications_iff_exists_occurrences rfl /-- The boundary occurrence at position `i` in a one-face word. -/ -def oneFaceOccurrence {Edge : Type} [Fintype Edge] +@[expose] def oneFaceOccurrence {Edge : Type} [Fintype Edge] (word : List (SignedDart Edge)) (i : Fin word.length) : (oneFacePresentation Edge word).BoundaryOccurrence := ⟨PUnit.unit, i⟩ @@ -390,7 +391,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 @@ -510,6 +511,7 @@ abbrev PolygonalRealization (K : SurfaceCellComplex) (valid : K.OccurrencePairin PolygonGluing.Realization (K.polygonalIdentifications valid) /-- The quotient map from the polygonal disjoint union of `K`. -/ +@[expose] def polygonalMk (K : SurfaceCellComplex) (valid : K.OccurrencePairingValid) : K.PolygonalPreRealization → K.PolygonalRealization valid := PolygonGluing.mk (K.polygonalIdentifications valid) @@ -535,11 +537,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 +590,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..86c4d388f5 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 @@ -108,7 +108,7 @@ def diskCellComplex : SurfaceCellComplex := The `dᵢ` pairs are internal seams and the single occurrences `cᵢ` are the two boundary contours. This is a renaming of the genus-zero, two-contour normal form from Gallier--Xu Definition 6.5. -/ -def annulusCellComplex : SurfaceCellComplex := +@[expose] def annulusCellComplex : SurfaceCellComplex := SurfaceCellComplex.oneFacePresentation AnnulusEdge [pos AnnulusEdge.d₀, pos AnnulusEdge.c₀, neg AnnulusEdge.d₀, pos AnnulusEdge.d₁, pos AnnulusEdge.c₁, neg AnnulusEdge.d₁] @@ -220,7 +220,7 @@ theorem mobiusStripCellComplex_isSurfaceValid : mobiusStripCellComplex.IsSurface mobiusStripCellComplex_occurrencePairingValid.surface_valid /-- A minimal one-triangle triangulation of `PUnit`, used only to test the data conversion API. -/ -def oneTriangleTriangulation : FiniteSurfaceTriangulation PUnit where +@[expose] def oneTriangleTriangulation : FiniteSurfaceTriangulation PUnit where Vertex := Fin 3 Edge := Fin 3 Triangle := PUnit @@ -280,7 +280,7 @@ example : rfl /-- A one-triangle fixture with one reversed side, used to test oriented conversion. -/ -def reversedSideTriangulation : FiniteSurfaceTriangulation PUnit where +@[expose] def reversedSideTriangulation : FiniteSurfaceTriangulation PUnit where Vertex := Fin 3 Edge := Fin 3 Triangle := PUnit diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicCancellation.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicCancellation.lean index d15253a57c..75f71eef33 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 @@ -31,13 +31,13 @@ open SurfaceCellComplex namespace Cancellation /-- The word after deleting the displayed inverse pair. -/ -@[reducible] +@[expose, reducible] def target {n : ℕ} (X : List (SignedDart (Fin n))) : FiniteCyclicPresentation := Dyck.oneFace X /-- The base cancellation spelling, with the cancellable edge named last. -/ -@[reducible] +@[expose, reducible] def source {n : ℕ} (X : List (SignedDart (Fin n))) : FiniteCyclicPresentation := Dyck.oneFace @@ -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) @@ -139,7 +139,7 @@ theorem retainWord_lowerTail {n : ℕ} (renamedTail a X) (freshEdge_not_mem_renamedTail a X ha) /-- A one-face word with a displayed positive inverse pair. -/ -@[reducible] +@[expose, reducible] def namedSource {n : ℕ} (a : Fin (n + 1)) (X : List (SignedDart (Fin (n + 1)))) : FiniteCyclicPresentation := @@ -173,6 +173,7 @@ def namedSourceSignedIso {n : ℕ} .neg (P1.freshEdge n) by simp [hmove]] /-- Split the inverse pair from the remaining word. -/ +@[expose] def sourceCut {n : ℕ} (X : List (SignedDart (Fin n))) : P2Cut (source X) where face := ⟨0, false⟩ @@ -182,6 +183,7 @@ def sourceCut {n : ℕ} (X : List (SignedDart (Fin n))) : exact List.IsRotated.refl _ /-- Split the target at position zero, producing a monogon and the target word. -/ +@[expose] def targetCut {n : ℕ} (X : List (SignedDart (Fin n))) : P2Cut (target X) := P2Cut.canonical ⟨0, false⟩ 0 @@ -403,7 +405,7 @@ theorem sphereNormalizationEquivalent namespace Context /-- Delete the displayed pair in the first face and retain all other faces. -/ -@[reducible] +@[expose, reducible] def target {n : ℕ} (X : List (SignedDart (Fin n))) (W : List (List (SignedDart (Fin n)))) : @@ -412,7 +414,7 @@ def target {n : ℕ} faces := X :: W /-- The base contextual cancellation spelling, with the cancellable edge named last. -/ -@[reducible] +@[expose, reducible] def source {n : ℕ} (X : List (SignedDart (Fin n))) (W : List (List (SignedDart (Fin n)))) : @@ -423,6 +425,7 @@ def source {n : ℕ} P2.retainWord X) :: W.map P2.retainWord /-- Split the displayed inverse pair from the rest of the first source face. -/ +@[expose] def sourceCut {n : ℕ} (X : List (SignedDart (Fin n))) (W : List (List (SignedDart (Fin n)))) : @@ -433,6 +436,7 @@ def sourceCut {n : ℕ} boundary_rotated := List.IsRotated.refl _ /-- Split the first target face at position zero. -/ +@[expose] def targetCut {n : ℕ} (X : List (SignedDart (Fin n))) (W : List (List (SignedDart (Fin n)))) : @@ -826,7 +830,7 @@ theorem namedNormalizationEquivalent {n : ℕ} (normalizationEquivalent (lowerTail a X) hlower validBase) /-- A one-face word with a negatively displayed inverse pair. -/ -@[reducible] +@[expose, reducible] def negativeNamedSource {n : ℕ} (a : Fin (n + 1)) (X : List (SignedDart (Fin (n + 1)))) : FiniteCyclicPresentation := diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicCanonical.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicCanonical.lean index d79f298ee3..5e514a32b7 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 @@ -43,7 +43,7 @@ theorem map_edgeOfDart_eq_map_edgeName {Edge : Type} cases d <;> simp [edgeOfDart, SignedDart.edgeName, ih] /-- Enumerate the edge names of a typed one-face signed boundary word. -/ -@[reducible] +@[expose, reducible] noncomputable def ofOneFaceWord {Edge : Type} [Fintype Edge] (word : List (SignedDart Edge)) : FiniteCyclicPresentation where edgeCount := Fintype.card Edge @@ -149,6 +149,7 @@ namespace NormalForm The admissibility predicate excludes the empty orientable word and the zero-crosscap nonorientable word when ordinary surface validity is required. -/ +@[expose] noncomputable def canonicalPresentation : NormalForm → FiniteCyclicPresentation | .sphere => FiniteCyclicPresentation.twoMonogonSphere | .orientable p n => diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicCanonicalRealization.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicCanonicalRealization.lean index b8c12996b5..b15e5f6658 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 @@ -60,6 +60,7 @@ noncomputable def ofOneFaceWordFaceHomeomorph /-- Enumerating the edge names and the unique face leaves the polygonal pre-realization homeomorphic to the original typed one-face pre-realization. -/ +@[expose] noncomputable def ofOneFaceWordPreHomeomorph (word : List (SignedDart Edge)) : (ofOneFaceWord word).PolygonalPreRealization ≃ₜ @@ -86,6 +87,7 @@ theorem ofOneFaceWordPreHomeomorph_apply_snd /-- A boundary position of the enumerated word, read as the same position of the original typed word. -/ +@[expose] noncomputable def ofOneFaceWordMapOccurrence (word : List (SignedDart Edge)) : (ofOneFaceWord word).BoundaryOccurrence → @@ -169,6 +171,7 @@ noncomputable def ofOneFaceWordComapOccurrence exact i)⟩ /-- Boundary positions are unchanged by enumeration. -/ +@[expose] noncomputable def ofOneFaceWordOccurrenceEquiv (word : List (SignedDart Edge)) : (ofOneFaceWord word).BoundaryOccurrence ≃ @@ -240,6 +243,7 @@ theorem IsSurfaceValid.not_isBoundaryEdge_of_distinct_occurrences exact hne (hs.trans ht.symm) /-- Transport a finite-cyclic pairing back to the original typed one-face word. -/ +@[expose] noncomputable def ofOneFaceWordMapPairing (word : List (SignedDart Edge)) (pairing : (ofOneFaceWord word).BoundaryPairing) : @@ -313,6 +317,7 @@ noncomputable def ofOneFaceWordMapPairing compatible := hcompatible } /-- Pull a typed one-face pairing forward to the enumerated finite-cyclic word. -/ +@[expose] noncomputable def ofOneFaceWordComapPairing (word : List (SignedDart Edge)) (valid : (ofOneFaceWord word).IsSurfaceValid) diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicCrosscap.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicCrosscap.lean index 3073df1372..15548e47ae 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,20 +37,21 @@ 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 := Dyck.oneFace ((X ++ [.pos a]) ++ ([.pos a] ++ inverseWord Y)) /-- Split the source between the two occurrences of `a`. -/ +@[expose] def sourceCut {n : ℕ} (a : Fin n) (X Y : List (SignedDart (Fin n))) : P2Cut (source a X Y) where @@ -67,6 +68,7 @@ def sourceCut {n : ℕ} (a : Fin n) /-- Split the target along the edge used to merge the first source child with the reverse of the second. -/ +@[expose] def targetCut {n : ℕ} (a : Fin n) (X Y : List (SignedDart (Fin n))) : P2Cut (target a X Y) where @@ -155,6 +157,7 @@ theorem commonEdgeRelabeling_retainWord {n : ℕ} (a : Fin n) Equiv.swap_apply_of_ne_of_ne hcast (Fin.castSucc_ne_last e)] /-- Match the explicit face indices of the two canonical splits. -/ +@[expose] def commonFaceEquiv {n : ℕ} (a : Fin n) (X Y : List (SignedDart (Fin n))) : (P2.split (target a X Y) (targetCut a X Y)).Face ≃ diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicDerivedRewrites.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicDerivedRewrites.lean index 61c0ff15f7..abf4bb0251 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,35 +440,35 @@ 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 := Dyck.source a U ([.pos b] ++ V) (X ++ [.neg b] ++ Y) /-- The result of the first Dyck rewrite. -/ -@[reducible] +@[expose, reducible] def afterFirst {n : ℕ} (a b : Fin n) (U V X Y : List (SignedDart (Fin n))) : FiniteCyclicPresentation := Dyck.target a U ([.pos b] ++ V) (X ++ [.neg b] ++ Y) /-- A cyclic spelling of `afterFirst` exposing the two occurrences of `b`. -/ -@[reducible] +@[expose, reducible] def secondSource {n : ℕ} (a b : Fin n) (U V X Y : List (SignedDart (Fin n))) : FiniteCyclicPresentation := Dyck.source b (V ++ U) ([.neg a] ++ X) (Y ++ [.pos a]) /-- The result of the second Dyck rewrite. -/ -@[reducible] +@[expose, reducible] def afterSecond {n : ℕ} (a b : Fin n) (U V X Y : List (SignedDart (Fin n))) : FiniteCyclicPresentation := Dyck.target b (V ++ U) ([.neg a] ++ X) (Y ++ [.pos a]) /-- A cyclic spelling of `afterSecond` exposing `a⁻¹` before `a`. -/ -@[reducible] +@[expose, reducible] def thirdSource {n : ℕ} (a b : Fin n) (U V X Y : List (SignedDart (Fin n))) : FiniteCyclicPresentation := @@ -476,7 +476,7 @@ def thirdSource {n : ℕ} (a b : Fin n) /-- The target spelling contains the handle `a b a⁻¹ b⁻¹`, followed cyclically by `Y X V U`. -/ -@[reducible] +@[expose, reducible] def target {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 := @@ -676,7 +676,7 @@ def source {n : ℕ} (a b c : Fin n) (X ++ [.pos b, .pos c]) ([.neg b, .neg c] ++ Y) /-- The first alternate cross-cap rewrite. -/ -@[reducible] +@[expose, reducible] def afterFirst {n : ℕ} (a b c : Fin n) (X Y : List (SignedDart (Fin n))) : FiniteCyclicPresentation := @@ -684,7 +684,7 @@ def afterFirst {n : ℕ} (a b c : Fin n) (X ++ [.pos b, .pos c]) ([.neg b, .neg c] ++ Y) /-- Rotate the first target to expose the two negative occurrences of `b`. -/ -@[reducible] +@[expose, reducible] def secondSource {n : ℕ} (a b c : Fin n) (X Y : List (SignedDart (Fin n))) : FiniteCyclicPresentation := @@ -693,7 +693,7 @@ def secondSource {n : ℕ} (a b c : Fin n) (inverseWord X ++ [.pos a]) /-- The result of rewriting the two negative occurrences of `b`. -/ -@[reducible] +@[expose, reducible] def afterSecond {n : ℕ} (a b c : Fin n) (X Y : List (SignedDart (Fin n))) : FiniteCyclicPresentation := @@ -702,7 +702,7 @@ def afterSecond {n : ℕ} (a b c : Fin n) (inverseWord X ++ [.pos a]) /-- Expose the two negative occurrences of `c`. -/ -@[reducible] +@[expose, reducible] def thirdSource {n : ℕ} (a b c : Fin n) (X Y : List (SignedDart (Fin n))) : FiniteCyclicPresentation := @@ -711,7 +711,7 @@ def thirdSource {n : ℕ} (a b c : Fin n) ([.neg b, .neg b, .neg a] ++ X) /-- The result of rewriting the two negative occurrences of `c`. -/ -@[reducible] +@[expose, reducible] def afterThird {n : ℕ} (a b c : Fin n) (X Y : List (SignedDart (Fin n))) : FiniteCyclicPresentation := @@ -720,7 +720,7 @@ def afterThird {n : ℕ} (a b c : Fin n) ([.neg b, .neg b, .neg a] ++ X) /-- Expose the remaining two occurrences of `a`. -/ -@[reducible] +@[expose, reducible] def fourthSource {n : ℕ} (a b c : Fin n) (X Y : List (SignedDart (Fin n))) : FiniteCyclicPresentation := @@ -729,7 +729,7 @@ def fourthSource {n : ℕ} (a b c : Fin n) ([.neg c, .neg c] ++ inverseWord X) /-- The final spelling is cyclically `a a X c c b b Y`: three crosscaps. -/ -@[reducible] +@[expose, reducible] def target {n : ℕ} (a b c : Fin n) (X Y : List (SignedDart (Fin n))) : FiniteCyclicPresentation := @@ -903,21 +903,21 @@ 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 := Dyck.oneFace (([.pos a] ++ H) ++ ([.neg a] ++ X ++ V)) /-- Rotate the source to expose the negative occurrence of `a` first. -/ -@[reducible] +@[expose, reducible] def rotatedSource {n : ℕ} (a : Fin n) (H X V : List (SignedDart (Fin n))) : FiniteCyclicPresentation := Dyck.negativeSource a X V H /-- The target is cyclically `a H a⁻¹ V X`, so `V` has crossed the separating word `X`. -/ -@[reducible] +@[expose, reducible] def target {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..e6e2e7aa2e 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,13 +56,14 @@ 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 := oneFace ((U ++ [.neg a]) ++ (X ++ [.pos a] ++ V)) /-- The P2 cut of the source word. -/ +@[expose] def sourceCut {n : ℕ} (a : Fin n) (U V X : List (SignedDart (Fin n))) : P2Cut (source a U V X) where @@ -78,6 +79,7 @@ def sourceCut {n : ℕ} (a : Fin n) exact List.IsRotated.refl _ /-- The P2 cut of the cyclic target spelling. -/ +@[expose] def targetCut {n : ℕ} (a : Fin n) (U V X : List (SignedDart (Fin n))) : P2Cut (target a U V X) where @@ -176,6 +178,7 @@ theorem commonEdgeRelabeling_retainWord {n : ℕ} (a : Fin n) exact commonEdgeRelabeling_castSucc_of_ne a e hda true /-- Match the explicit face indices of the two canonical splits. -/ +@[expose] def commonFaceEquiv {n : ℕ} (a : Fin n) (U V X : List (SignedDart (Fin n))) : (P2.split (target a U V X) (targetCut a U V X)).Face ≃ diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicFaceMerge.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicFaceMerge.lean index 1a83cfe869..dc254e52ff 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 @@ -31,7 +31,7 @@ open SurfaceCellComplex namespace FaceMerge /-- The one-face presentation obtained after merging the displayed pair. -/ -@[reducible] +@[expose, reducible] def target {n : ℕ} (U V : List (SignedDart (Fin n))) : FiniteCyclicPresentation := @@ -48,6 +48,7 @@ def source {n : ℕ} [.neg (P1.freshEdge n)] ++ P2.retainWord V] /-- The canonical cut of the concatenated target word between `U` and `V`. -/ +@[expose] def targetCut {n : ℕ} (U V : List (SignedDart (Fin n))) : P2Cut (target U V) where @@ -264,7 +265,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 +284,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)))) : @@ -327,6 +328,7 @@ theorem markedTargetCut_isNondegenerate {n : ℕ} constructor <;> simp [markedTargetCut] /-- The canonical cut of the first face of a contextual merge. -/ +@[expose] def targetCut {n : ℕ} (U V : List (SignedDart (Fin n))) (W : List (List (SignedDart (Fin n)))) : @@ -351,7 +353,7 @@ theorem targetCut_right {n : ℕ} rfl /-- The canonical source for merging in context is the exact P2 split of the target. -/ -@[reducible] +@[expose, reducible] def source {n : ℕ} (U V : List (SignedDart (Fin n))) (W : List (List (SignedDart (Fin n)))) : @@ -359,6 +361,7 @@ def source {n : ℕ} P2.split (target U V W) (targetCut U V W) /-- Match the face positions of the expanded contextual source with the split marked target. -/ +@[expose] def markedMiddleFaceEquiv {n : ℕ} (U V : List (SignedDart (Fin n))) (W : List (List (SignedDart (Fin n)))) : @@ -412,7 +415,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 := @@ -420,6 +423,7 @@ def selectedFace {n : ℕ} (targetCut U V W).face.face /-- The child appended by the P2 split. -/ +@[expose] def rightFace {n : ℕ} (U V : List (SignedDart (Fin n))) (W : List (List (SignedDart (Fin n)))) : @@ -427,7 +431,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 +442,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..eb550f1088 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 @@ -156,6 +156,7 @@ theorem isGallierValid {P Q : FiniteCyclicPresentation} end Subdivides /-- Two presentations have a common directed subdivision. -/ +@[expose] def HasCommonSubdivision (P Q : FiniteCyclicPresentation) : Prop := ∃ R : FiniteCyclicPresentation, Subdivides P R ∧ Subdivides Q R @@ -248,12 +249,14 @@ def SubdivisionStep.PreservesPolygonalRealization : Prop := P.PolygonallyEquivalent Q validP validQ /-- The realization-invariance obligation isolated to P1 subdivisions. -/ +@[expose] def P1Subdivision.PreservesPolygonalRealization : Prop := ∀ {P Q : FiniteCyclicPresentation}, P1Subdivision P Q → ∀ (validP : P.IsSurfaceValid) (validQ : Q.IsSurfaceValid), P.PolygonallyEquivalent Q validP validQ /-- The realization-invariance obligation isolated to P2 subdivisions. -/ +@[expose] def P2Subdivision.PreservesPolygonalRealization : Prop := ∀ {P Q : FiniteCyclicPresentation}, P2Subdivision P Q → ∀ (validP : P.IsSurfaceValid) (validQ : Q.IsSurfaceValid), 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..7c85d99add 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 @@ -29,6 +29,7 @@ namespace FiniteCyclicPresentation open SurfaceCellComplex /-- The validity-bundled canonical presentation selected by an admissible normal form. -/ +@[expose] noncomputable def canonicalValidPresentation (N : NormalForm) (hN : N.IsEvalAdmissible) : ValidPresentation := @@ -56,6 +57,7 @@ structure NormalizationResult (P : ValidPresentation) where namespace NormalizationResult /-- A canonical presentation is already normalized. -/ +@[expose] noncomputable def canonical (N : NormalForm) (hN : N.IsEvalAdmissible) : NormalizationResult (canonicalValidPresentation N hN) where @@ -64,6 +66,7 @@ noncomputable def canonical equivalent := NormalizationEquivalent.refl _ /-- Transport a normalization result backward through a normalization equivalence. -/ +@[expose] noncomputable def ofEquivalent {P Q : ValidPresentation} (hPQ : NormalizationEquivalent P Q) @@ -74,6 +77,7 @@ noncomputable def ofEquivalent equivalent := hPQ.trans result.equivalent /-- Transport a normalization result across a signed presentation isomorphism. -/ +@[expose] noncomputable def ofSignedIso {P Q : ValidPresentation} (e : SignedPresentationIso P.presentation Q.presentation) diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicP1.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicP1.lean index b2d85bf4e5..cc953bcb5c 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 @@ -538,6 +538,7 @@ end P1 This is a syntactic move relation and deliberately does not bundle source validity. The preservation theorems below transport validity and connectivity when those hypotheses are available. -/ +@[expose] def P1Subdivision (P Q : FiniteCyclicPresentation) : Prop := ∃ a : P.Edge, Nonempty (SignedPresentationIso (P1.expand P a) Q) diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicP1Realization.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicP1Realization.lean index 01d96297d7..299c168366 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 @@ -122,6 +122,7 @@ theorem faceWeights_sum exact congrArg List.length (expand_boundary P a f).symm /-- The first target side replacing source side `i`. -/ +@[expose] def expandedStartIndex (P : FiniteCyclicPresentation) (a : P.Edge) (f : P.Face) (i : Fin (P.boundary f).length) : @@ -327,6 +328,7 @@ theorem faceWeights_get simp /-- A target-side index inside the expanded block of source side `i`. -/ +@[expose] def expandedOffsetIndex (P : FiniteCyclicPresentation) (a : P.Edge) (f : P.Face) (i : Fin (P.boundary f).length) @@ -617,6 +619,7 @@ theorem expandedOccurrenceAt_dart_eq_expandedSubdart exact expandedOccurrenceAt_dart P a p /-- Transport a block-local offset across an equal-dart pairing. -/ +@[expose] def samePairedOffset {P : FiniteCyclicPresentation} (a : P.Edge) (pairing : P.BoundaryPairing) @@ -733,6 +736,7 @@ noncomputable def expandedPairingOpposite exact expandedSubdart_oppositePairedOffset a pairing hcompatible k /-- The second target side replacing a selected source occurrence. -/ +@[expose] def secondExpandedIndex (P : FiniteCyclicPresentation) (a : P.Edge) (f : P.Face) (i : Fin (P.boundary f).length) @@ -817,6 +821,7 @@ noncomputable def faceHomeomorph PolygonCell.radialHomeomorph (faceCircleHomeomorph P a validP f) /-- P1 acts facewise on the polygonal pre-realization. -/ +@[expose] noncomputable def preHomeomorph (P : FiniteCyclicPresentation) (a : P.Edge) (validP : P.IsSurfaceValid) : @@ -909,11 +914,13 @@ theorem faceHomeomorph_side_of_not_selected ring /-- Rescale the first half of a source side to a complete target side. -/ +@[expose] def firstHalfParameter (t : unitInterval) (h : (t : ℝ) ≤ 1 / 2) : unitInterval := ⟨2 * (t : ℝ), mul_nonneg (by norm_num) t.property.1, by linarith⟩ /-- Rescale the second half of a source side to a complete target side. -/ +@[expose] def secondHalfParameter (t : unitInterval) (h : 1 / 2 ≤ (t : ℝ)) : unitInterval := ⟨2 * (t : ℝ) - 1, by linarith, by linarith [t.property.2]⟩ @@ -1325,6 +1332,7 @@ theorem card_expandedSourcePosition exact faceWeights_sum P a f /-- Expanded source blocks enumerate all target boundary occurrences. -/ +@[expose] noncomputable def expandedOccurrenceEquiv (P : FiniteCyclicPresentation) (a : P.Edge) : ExpandedSourcePosition P a ≃ (expand P a).BoundaryOccurrence := @@ -1670,6 +1678,7 @@ theorem dartWeight_pos {n : ℕ} (a : Fin n) split <;> omega /-- Convert a target subedge-local parameter back to the original source-side parameter. -/ +@[expose] noncomputable def unexpandParameter {n : ℕ} (a : Fin n) (d : SignedDart (Fin n)) (k : Fin (dartWeight a d)) (u : unitInterval) : unitInterval := ⟨((k : ℝ) + (u : ℝ)) / dartWeight a d, diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicP2.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicP2.lean index a167655149..53b2a3adb3 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 @@ -61,6 +61,7 @@ namespace P2Cut The raw `P2Cut` structure also represents the exceptional empty-word-sphere conversion, for which both pieces are necessarily empty. -/ +@[expose] def IsNondegenerate {P : FiniteCyclicPresentation} (cut : P2Cut P) : Prop := cut.left ≠ [] ∧ cut.right ≠ [] @@ -70,7 +71,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 +108,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 +116,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 +177,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 +248,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 +292,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) @@ -1295,10 +1296,12 @@ theorem split_isGallierValid split_isConnected P cut hempty.isConnected⟩ /-- The zero-position P2 cut of Gallier--Xu's exceptional sphere presentation. -/ +@[expose] def emptyWordSphereCut : P2Cut emptyWordSphere := P2Cut.canonical (.pos 0) 0 /-- The last-position spelling of the same empty boundary cut. -/ +@[expose] def emptyWordSphereLastCut : P2Cut emptyWordSphere := P2Cut.canonical (.pos 0) (Fin.last 0) @@ -1328,6 +1331,7 @@ boundary pieces are nonempty. The sole degenerate case admitted here is Gallier- empty-word sphere, whose conversion to the ordinary-valid two-monogon presentation is also represented by the raw `P2.split` construction. This is a syntactic move relation and deliberately does not bundle source validity. -/ +@[expose] def P2Subdivision (P Q : FiniteCyclicPresentation) : Prop := ∃ cut : P2Cut P, (cut.IsNondegenerate ∨ P.IsEmptyWordSphere) ∧ diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicP2DegenerateRealization.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicP2DegenerateRealization.lean index 26d4725a44..6b8d99aef1 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 @@ -37,6 +37,7 @@ theorem leftLength_eq_zero simp [hleft] /-- The rotated source side index, specialized to an empty-left cut. -/ +@[expose] noncomputable def rightDegenerateCutSideIndex (P : FiniteCyclicPresentation) (cut : P2Cut P) (horientation : cut.face.orientation = false) @@ -157,6 +158,7 @@ theorem zeroLeftCellHomeomorph_side simp [hl] /-- The `zeroLeftChildPairHomeomorph` declaration. -/ +@[expose] noncomputable def zeroLeftChildPairHomeomorph {l r : ℕ} (hl : l = 0) : DiskSquare.ChildPair 0 r ≃ₜ @@ -258,6 +260,7 @@ theorem zeroLeftChildPair_eqvGen_iff hcomap hxy /-- The `zeroLeftChildGluingHomeomorph` declaration. -/ +@[expose] noncomputable def zeroLeftChildGluingHomeomorph {l r : ℕ} (hl : l = 0) : DiskSquare.ParamChildGluing 0 r ≃ₜ @@ -1667,6 +1670,7 @@ theorem rightDegenerateInvPreMap_respects /-! ### Descended equivalence -/ /-- Forward map after descent through the source polygonal quotient. -/ +@[expose] noncomputable def rightDegenerateRealizationMap (P : FiniteCyclicPresentation) (cut : P2Cut P) (horientation : cut.face.orientation = false) @@ -1683,6 +1687,7 @@ noncomputable def rightDegenerateRealizationMap P cut horientation hleft hr validP hxy) /-- Inverse map after descent through the target polygonal quotient. -/ +@[expose] noncomputable def rightDegenerateRealizationInvMap (P : FiniteCyclicPresentation) (cut : P2Cut P) (horientation : cut.face.orientation = false) diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicP2Realization.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicP2Realization.lean index 5d25b54bb3..e6882760d5 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 @@ -67,6 +67,7 @@ theorem rotate_cutBoundary_eq_sourceBoundary simpa [orientedBoundary, horientation] using h) /-- The linear cut-word index carrying a stored source side. -/ +@[expose] noncomputable def positiveCutSideIndex (P : FiniteCyclicPresentation) (cut : P2Cut P) (horientation : cut.face.orientation = false) @@ -188,6 +189,7 @@ theorem positiveSelectedCellHomeomorph_side (Nat.add_pos_left hl _) (positiveCutRotation P cut horientation) i t /-- A rotated source side lying in the left cut piece, viewed with its local left index. -/ +@[expose] noncomputable def positiveLeftSideIndex (P : FiniteCyclicPresentation) (cut : P2Cut P) (horientation : cut.face.orientation = false) @@ -213,6 +215,7 @@ theorem positiveLeftSideIndex_val rfl /-- A rotated source side lying in the right cut piece, viewed with its local right index. -/ +@[expose] noncomputable def positiveRightSideIndex (P : FiniteCyclicPresentation) (cut : P2Cut P) (horientation : cut.face.orientation = false) @@ -371,6 +374,7 @@ theorem positive_split_boundary_right_length simp [retainWord, Nat.add_comm] /-- Stored target index of the positive fresh dart in the selected child. -/ +@[expose] def positiveSelectedFreshIndex (P : FiniteCyclicPresentation) (cut : P2Cut P) (horientation : cut.face.orientation = false) : @@ -389,6 +393,7 @@ theorem positiveSelectedFreshIndex_val rfl /-- Stored target index of the negative fresh dart in the right child. -/ +@[expose] def positiveRightFreshIndex (P : FiniteCyclicPresentation) (cut : P2Cut P) (horientation : cut.face.orientation = false) : @@ -405,6 +410,7 @@ theorem positiveRightFreshIndex_val rfl /-- The selected child's fresh-edge boundary occurrence. -/ +@[expose] def positiveSelectedFreshOccurrence (P : FiniteCyclicPresentation) (cut : P2Cut P) (horientation : cut.face.orientation = false) : @@ -413,6 +419,7 @@ def positiveSelectedFreshOccurrence positiveSelectedFreshIndex P cut horientation⟩ /-- The right child's fresh-edge boundary occurrence. -/ +@[expose] def positiveRightFreshOccurrence (P : FiniteCyclicPresentation) (cut : P2Cut P) (horientation : cut.face.orientation = false) : @@ -520,6 +527,7 @@ theorem positiveFresh_not_boundary norm_num /-- The exact reversed-parameter pairing carried by the fresh P2 seam. -/ +@[expose] def positiveFreshPairing (P : FiniteCyclicPresentation) (cut : P2Cut P) (horientation : cut.face.orientation = false) : @@ -597,7 +605,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)) : @@ -660,6 +668,7 @@ theorem positiveRightChildCellHomeomorph_side /-- Include the two local child cells into the corresponding two faces of the split pre-realization. -/ +@[expose] noncomputable def positiveChildPairPreMap (P : FiniteCyclicPresentation) (cut : P2Cut P) (horientation : cut.face.orientation = false) : @@ -712,7 +721,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) : @@ -807,6 +816,7 @@ theorem positiveChildPairMap_respects | trans _ _ _ _ _ ih₁ ih₂ => exact ih₁.trans ih₂ /-- Include the locally glued pair of P2 children into the complete target realization. -/ +@[expose] noncomputable def positiveChildGluingMap (P : FiniteCyclicPresentation) (cut : P2Cut P) (horientation : cut.face.orientation = false) @@ -950,7 +960,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 +992,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) : @@ -1573,6 +1583,7 @@ theorem positiveMapOccurrence_injective rfl /-- Transport an old-edge source pairing to the corresponding pairing of target occurrences. -/ +@[expose] noncomputable def positiveMapPairing (P : FiniteCyclicPresentation) (cut : P2Cut P) (horientation : cut.face.orientation = false) @@ -1898,6 +1909,7 @@ theorem continuous_positiveRightChildInvFaceMap P cut horientation) /-- Inverse map on a retained target face. -/ +@[expose] noncomputable def retainedInvFaceMap (P : FiniteCyclicPresentation) (cut : P2Cut P) {f : P.Face} (hface : f ≠ cut.face.face) @@ -2838,6 +2850,7 @@ theorem positiveInvPreMap_respects | trans _ _ _ _ _ ih₁ ih₂ => exact ih₁.trans ih₂ /-- Forward map after descent through the source polygonal quotient. -/ +@[expose] noncomputable def positiveRealizationMap (P : FiniteCyclicPresentation) (cut : P2Cut P) (horientation : cut.face.orientation = false) @@ -2853,6 +2866,7 @@ noncomputable def positiveRealizationMap P cut horientation hl hr validP hxy) /-- Inverse map after descent through the target polygonal quotient. -/ +@[expose] noncomputable def positiveRealizationInvMap (P : FiniteCyclicPresentation) (cut : P2Cut P) (horientation : cut.face.orientation = false) @@ -3232,6 +3246,7 @@ theorem swapFaceEquiv_old_of_ne hselected hlast] /-- The raw edge relabeling for a swapped cut reverses precisely the fresh edge. -/ +@[expose] def swapRawEdgeRelabeling (P : FiniteCyclicPresentation) (_cut : P2Cut P) : EdgeRelabeling (Fin (P.edgeCount + 1)) @@ -3433,6 +3448,7 @@ def swapSignedPresentationIso /-- Identity edge relabeling between the definitionally equal edge types of the two reversed-cut splits. Naming the transport keeps the signed-isomorphism boundary proof transparent. -/ +@[expose] def flipEdgeRelabeling (P : FiniteCyclicPresentation) (cut : P2Cut P) : EdgeRelabeling (split P cut.flip).Edge (split P cut).Edge := by diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicPresentation.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicPresentation.lean index 6bef5d6c54..2bc1476d4f 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) @@ -159,6 +159,7 @@ def mapDart {α β : Type*} (e : EdgeRelabeling α β) : SignedDart α → Signe .neg (e.edgeEquiv a) /-- The identity signed-edge relabeling. -/ +@[expose] def refl (α : Type*) : EdgeRelabeling α α where edgeEquiv := Equiv.refl α reverse := fun _ ↦ false @@ -177,6 +178,7 @@ def trans {α β γ : Type*} /-- An ordinary edge equivalence, viewed as a relabeling that preserves every chosen orientation. -/ +@[expose] def ofEquiv {α β : Type*} (e : α ≃ β) : EdgeRelabeling α β where edgeEquiv := e reverse := fun _ ↦ false @@ -211,7 +213,7 @@ theorem mapDart_apply_symm {α β : Type*} (e : EdgeRelabeling α β) simp [mapDart, symm, h] /-- A signed-edge relabeling is an equivalence on darts. -/ -def dartEquiv {α β : Type*} (e : EdgeRelabeling α β) : +@[expose] def dartEquiv {α β : Type*} (e : EdgeRelabeling α β) : SignedDart α ≃ SignedDart β where toFun := e.mapDart invFun := e.symm.mapDart @@ -380,15 +382,15 @@ 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. -/ -def neg {P : FiniteCyclicPresentation} (f : P.Face) : P.OrientedFace := +@[expose] 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 +460,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,37 +477,37 @@ 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. -/ -def IsBoundaryEdge (P : FiniteCyclicPresentation) (e : P.Edge) : Prop := +@[expose] def IsBoundaryEdge (P : FiniteCyclicPresentation) (e : P.Edge) : Prop := P.edgeMultiplicity e = 1 /-- Incidence validity for a finite cyclic presentation. There is at least one face, every face has a nonempty boundary, different faces have different cyclic boundary words, and every edge occurs either once or twice. -/ -def IsSurfaceValid (P : FiniteCyclicPresentation) : Prop := +@[expose] def IsSurfaceValid (P : FiniteCyclicPresentation) : Prop := Nonempty P.Face ∧ (∀ f, P.boundary f ≠ []) ∧ (∀ f g, (P.boundary f).IsRotated (P.boundary g) → f = g) ∧ ∀ e, P.edgeMultiplicity e = 1 ∨ P.edgeMultiplicity e = 2 /-- Two faces are adjacent when their boundary words contain a common unoriented edge. -/ -def FaceAdjacent (P : FiniteCyclicPresentation) (f g : P.Face) : Prop := +@[expose] def FaceAdjacent (P : FiniteCyclicPresentation) (f g : P.Face) : Prop := ∃ e : P.Edge, e ∈ (P.boundary f).map edgeOfDart ∧ e ∈ (P.boundary g).map edgeOfDart /-- Connectivity of the face-edge incidence graph. -/ -def IsConnected (P : FiniteCyclicPresentation) : Prop := +@[expose] def IsConnected (P : FiniteCyclicPresentation) : Prop := Nonempty P.Face ∧ ∀ f g, Relation.ReflTransGen P.FaceAdjacent f g /-- The exceptional Gallier--Xu presentation with one face, no edges, and an empty boundary. Definition 6.1 explicitly allows this case. Its geometric realization is assigned to the sphere on page 86. -/ -@[reducible] +@[expose, reducible] def emptyWordSphere : FiniteCyclicPresentation where edgeCount := 0 faces := [[]] @@ -514,7 +516,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]] @@ -841,7 +843,7 @@ def trans {P Q R : FiniteCyclicPresentation} exact h₁.trans h₂ /-- A signed presentation isomorphism transports the two orientations of every face. -/ -def orientedFaceEquiv {P Q : FiniteCyclicPresentation} +@[expose] def orientedFaceEquiv {P Q : FiniteCyclicPresentation} (e : SignedPresentationIso P Q) : P.OrientedFace ≃ Q.OrientedFace where toFun f := ⟨e.faceEquiv f.face, f.orientation⟩ @@ -1041,7 +1043,7 @@ def IsEmptyWordSphere (P : FiniteCyclicPresentation) : Prop := The first disjunct is the ordinary nonempty-boundary case. The second is precisely the exceptional one-face, zero-edge, empty-boundary presentation allowed by Definition 6.1. -/ -def IsGallierValid (P : FiniteCyclicPresentation) : Prop := +@[expose] def IsGallierValid (P : FiniteCyclicPresentation) : Prop := (P.IsSurfaceValid ∧ P.IsConnected) ∨ P.IsEmptyWordSphere theorem IsEmptyWordSphere.edgeCount_eq_zero diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicRealization.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicRealization.lean index 97fc8eace9..0b4d7bb621 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 @@ -50,11 +50,11 @@ instance boundaryOccurrenceFintype (P : FiniteCyclicPresentation) : namespace BoundaryOccurrence /-- The signed dart stored at a boundary occurrence. -/ -def dart {P : FiniteCyclicPresentation} (o : P.BoundaryOccurrence) : P.Dart := +@[expose] 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 @@ -284,6 +284,7 @@ theorem identification_direction {P : FiniteCyclicPresentation} (pairing : P.Bou end BoundaryPairing /-- All polygon-side identifications compatible with a valid finite cyclic presentation. -/ +@[expose] def polygonalIdentifications (P : FiniteCyclicPresentation) (_valid : P.IsSurfaceValid) : Set (PolygonGluing.Identification P.Face fun f => (P.boundary f).length) := @@ -323,6 +324,7 @@ abbrev PolygonalRealization PolygonGluing.Realization (P.polygonalIdentifications valid) /-- The quotient map from the disjoint union of face polygons. -/ +@[expose] def polygonalMk (P : FiniteCyclicPresentation) (valid : P.IsSurfaceValid) : P.PolygonalPreRealization → P.PolygonalRealization valid := @@ -375,6 +377,7 @@ structure RealizationEquivData namespace RealizationEquivData /-- Descend the forward cut-and-paste map through the source gluing relation. -/ +@[expose] def toQuotient {P Q : FiniteCyclicPresentation} {validP : P.IsSurfaceValid} {validQ : Q.IsSurfaceValid} (data : RealizationEquivData P Q validP validQ) : @@ -382,6 +385,7 @@ def toQuotient Quotient.lift data.toPre data.to_respects /-- Descend the reverse cut-and-paste map through the target gluing relation. -/ +@[expose] def invQuotient {P Q : FiniteCyclicPresentation} {validP : P.IsSurfaceValid} {validQ : Q.IsSurfaceValid} (data : RealizationEquivData P Q validP validQ) : @@ -437,6 +441,7 @@ noncomputable def homeomorph end RealizationEquivData /-- Quotient semantics for comparing two valid finite cyclic presentations. -/ +@[expose] def PolygonallyEquivalent (P Q : FiniteCyclicPresentation) (validP : P.IsSurfaceValid) (validQ : Q.IsSurfaceValid) : Prop := diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicReduction.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicReduction.lean index ea5e2976b7..bfca22f80a 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 @@ -628,6 +628,7 @@ theorem NegativeOccurrence.edge_not_mem_tail simpa [positive, map_edgeOfDart_inverseWord] using hpositive /-- The lowered left word used by the canonical contextual merge. -/ +@[expose] def mergeLeftWord {P : FiniteCyclicPresentation} {f : P.Face} {e : P.Edge} (occurrence : PositiveOccurrence P f e) : @@ -635,6 +636,7 @@ def mergeLeftWord lowerTail P e occurrence.tail /-- The lowered right word used by the canonical contextual merge. -/ +@[expose] def mergeRightWord {P : FiniteCyclicPresentation} {g : P.Face} {e : P.Edge} (occurrence : NegativeOccurrence P g e) : @@ -642,6 +644,7 @@ def mergeRightWord lowerTail P e occurrence.tail /-- Lower and enumerate all faces not selected for a merge. -/ +@[expose] def mergeMiddleWords (P : FiniteCyclicPresentation) (e : P.Edge) (f g : P.Face) (hfg : f ≠ g) : @@ -681,7 +684,7 @@ theorem faceCountBetween_add_two omega /-- The canonical contextual P2 source associated to two oppositely displayed adjacent faces. -/ -@[reducible] +@[expose, reducible] def mergeSource {P : FiniteCyclicPresentation} {f g : P.Face} {e : P.Edge} (left : PositiveOccurrence P f e) diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicSignedRealization.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicSignedRealization.lean index 7af4f98ef5..19331b492e 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 @@ -76,6 +76,7 @@ theorem rotateHomeomorph_apply_val {n m : ℕ} (h : n = m) (k : ℕ) rfl /-- The `rotateIndex` declaration. -/ +@[expose] def rotateIndex {n : ℕ} (hn : 0 < n) (k : ℕ) (i : Fin n) : Fin n := ⟨(i.val + k) % n, Nat.mod_lt _ hn⟩ @@ -137,7 +138,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 @@ -190,6 +191,7 @@ theorem boundary_get_sideIndex (e : SignedPresentationIso P Q) exact htarget /-- The disk homeomorphism on a face selected by the cyclic boundary rotation. -/ +@[expose] noncomputable def faceHomeomorph (e : SignedPresentationIso P Q) (f : P.Face) : PolygonCell (P.boundary f).length ≃ₜ PolygonCell (Q.boundary (e.faceEquiv f)).length := @@ -197,6 +199,7 @@ noncomputable def faceHomeomorph (e : SignedPresentationIso P Q) (f : P.Face) : /-- A signed presentation isomorphism gives a facewise homeomorphism of polygonal pre-realizations. -/ +@[expose] noncomputable def preHomeomorph (e : SignedPresentationIso P Q) : P.PolygonalPreRealization ≃ₜ Q.PolygonalPreRealization := (IsHomeomorph.sigmaMap e.faceEquiv.bijective @@ -302,6 +305,7 @@ theorem mapOccurrence_edge (e : SignedPresentationIso P Q) rfl /-- A compatible source pairing transports to a compatible target pairing. -/ +@[expose] noncomputable def mapPairing (e : SignedPresentationIso P Q) (validQ : Q.IsSurfaceValid) (pairing : P.BoundaryPairing) : Q.BoundaryPairing where @@ -364,6 +368,7 @@ noncomputable def rawOccurrenceEquiv (e : SignedPresentationIso P Q) : (Fin.castOrderIso (e.boundary_length_eq f)).toEquiv /-- The cyclic occurrence transport bundled as an equivalence. -/ +@[expose] noncomputable def occurrenceEquiv (e : SignedPresentationIso P Q) (validQ : Q.IsSurfaceValid) : P.BoundaryOccurrence ≃ Q.BoundaryOccurrence := @@ -411,6 +416,7 @@ theorem occurrenceEquiv_symm_edge rw [e.mapOccurrence_occurrenceEquiv_symm validQ] /-- Pull a compatible target pairing back through the occurrence equivalence. -/ +@[expose] noncomputable def comapPairing (e : SignedPresentationIso P Q) (validQ : Q.IsSurfaceValid) (pairing : Q.BoundaryPairing) : P.BoundaryPairing where 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..99264c9c2d 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 @@ -1034,6 +1034,7 @@ theorem map_sequenceWord_signedRelabeling_normalized /-- An already ordered orientable completed word relabels exactly to the existing canonical orientable finite-cyclic presentation. -/ +@[expose] noncomputable def orientableOrderedResult (terminal : TerminalCompletedWord) (hcrosscap : @@ -1148,6 +1149,7 @@ private theorem orientableOrderedResult_normalForm /-- An already ordered nonorientable completed word relabels exactly to the existing canonical nonorientable finite-cyclic presentation. -/ +@[expose] noncomputable def nonOrientableOrderedResult (terminal : TerminalCompletedWord) (hhandle : diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicTriangulation.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicTriangulation.lean index cba2e70568..d36fce5fa8 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 @@ -29,6 +29,7 @@ namespace ClassificationOfSurfaces namespace SurfaceCellComplex /-- Oriented triangulation edges and signed cell-complex darts carry the same data. -/ +@[expose] def orientedEdgeSignedDartEquiv {Edge : Type*} : OrientedEdge Edge ≃ SignedDart Edge where toFun := signedDartOfOrientedEdge @@ -59,7 +60,7 @@ open SurfaceCellComplex variable {S : Type*} [TopologicalSpace S] /-- Relabel an oriented triangulation edge by a signed `Fin` edge name. -/ -noncomputable def finiteCyclicDartEquiv (T : FiniteSurfaceTriangulation S) : +@[expose] noncomputable def finiteCyclicDartEquiv (T : FiniteSurfaceTriangulation S) : OrientedEdge T.Edge ≃ SignedDart (Fin (Fintype.card T.Edge)) := SurfaceCellComplex.orientedEdgeSignedDartEquiv.trans (SignedDart.mapEquiv (Fintype.equivFin T.Edge)) @@ -73,7 +74,7 @@ theorem edgeOfDart_finiteCyclicDartEquiv /-- Enumerate the faces and unoriented edges of a finite triangulation and retain its cyclic signed triangle boundaries. -/ -@[reducible] +@[expose, reducible] noncomputable def toFiniteCyclicPresentation (T : FiniteSurfaceTriangulation S) : FiniteCyclicPresentation where edgeCount := Fintype.card T.Edge @@ -101,7 +102,7 @@ theorem edgeOfDart_finiteCyclicDartEquiv_eq_edgeEquiv exact T.edgeOfDart_finiteCyclicDartEquiv d /-- The original triangles are equivalent to positions in the presentation's face list. -/ -noncomputable def finiteCyclicFaceEquiv (T : FiniteSurfaceTriangulation S) : +@[expose] noncomputable def finiteCyclicFaceEquiv (T : FiniteSurfaceTriangulation S) : T.Triangle ≃ T.toFiniteCyclicPresentation.Face := (Fintype.equivFin T.Triangle).trans (Fin.castOrderIso T.toFiniteCyclicPresentation_faces_length.symm).toEquiv @@ -167,7 +168,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) := @@ -430,7 +431,7 @@ namespace GeometricTriangulation variable {S : Type*} [TopologicalSpace S] /-- The finite cyclic presentation underlying a geometric triangulation. -/ -@[reducible] noncomputable def toFiniteCyclicPresentation (T : GeometricTriangulation S) : +@[expose, reducible] noncomputable def toFiniteCyclicPresentation (T : GeometricTriangulation S) : FiniteCyclicPresentation := T.toFiniteSurfaceTriangulation.toFiniteCyclicPresentation @@ -474,6 +475,7 @@ variable [IsManifold (modelWithCornersEuclideanHalfSpace 2) 0 S] /-- The named finite cyclic presentation obtained by enumerating the Radó triangulation of a compact connected Eval surface. -/ +@[expose] noncomputable def compactEvalSurfaceFiniteCyclicPresentation : FiniteCyclicPresentation := (compactEvalSurfaceGeometricTriangulation S).toFiniteCyclicPresentation diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicUnorientedRealization.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicUnorientedRealization.lean index aea7d058b9..83b79780e6 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 @@ -36,6 +36,7 @@ open scoped ComplexConjugate namespace PolygonCell /-- Reflection of a polygon cell across the real axis. -/ +@[expose] noncomputable def reflectionHomeomorph (n : ℕ) : PolygonCell n ≃ₜ PolygonCell n where toFun z := ⟨conj z.val, by simpa only [Metric.mem_closedBall, Complex.dist_eq, sub_zero, Complex.norm_conj] @@ -414,6 +415,7 @@ theorem faceHomeomorph_side exact PolygonCell.reflectionHomeomorph_side _ _ /-- A facewise homeomorphism of polygonal pre-realizations. -/ +@[expose] noncomputable def preHomeomorph (e : UnorientedPresentationIso P Q) : P.PolygonalPreRealization ≃ₜ Q.PolygonalPreRealization := (IsHomeomorph.sigmaMap e.faceEquiv.bijective @@ -556,6 +558,7 @@ noncomputable def rawOccurrenceEquiv (e : UnorientedPresentationIso P Q) : (Fin.castOrderIso (e.boundary_length_eq f)).toEquiv /-- Boundary-occurrence transport bundled as an equivalence. -/ +@[expose] noncomputable def occurrenceEquiv (e : UnorientedPresentationIso P Q) (validQ : Q.IsSurfaceValid) : P.BoundaryOccurrence ≃ Q.BoundaryOccurrence := @@ -602,6 +605,7 @@ theorem transportDirection_parameter /-- Transport a compatible source pairing, toggling its parameter direction precisely when one of the two incident faces is reflected. -/ +@[expose] noncomputable def mapPairing (e : UnorientedPresentationIso P Q) (validQ : Q.IsSurfaceValid) (pairing : P.BoundaryPairing) : Q.BoundaryPairing where @@ -780,6 +784,7 @@ theorem occurrenceEquiv_symm_edge rw [e.mapOccurrence_occurrenceEquiv_symm validQ] /-- Pull a compatible target pairing back through the occurrence equivalence. -/ +@[expose] noncomputable def comapPairing (e : UnorientedPresentationIso P Q) (validQ : Q.IsSurfaceValid) (pairing : Q.BoundaryPairing) : P.BoundaryPairing where diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicWordReduction.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicWordReduction.lean index dacd8000ac..eb8980995b 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 @@ -3092,6 +3092,7 @@ def toBoundaryClosure {n : ℕ} /-- A lifted residual pair whose protected interval begins with a completed boundary loop exposes the exact boundary-block commute transition. -/ +@[expose] def toBoundaryBlockCommute {n : ℕ} {tokens : List (ReductionToken (n + 1))} (pair : MarkedResidualCancellablePair tokens) @@ -3207,6 +3208,7 @@ theorem boundaryBlockCommuteConditions_of_valid {n : ℕ} /-- Surface multiplicity supplies all freshness conditions needed to commute a completed boundary-loop atom at the head of a lifted residual-pair interval. -/ +@[expose] noncomputable def toBoundaryBlockCommuteOfValid {n : ℕ} {tokens : List (ReductionToken (n + 1))} (pair : MarkedResidualCancellablePair tokens) @@ -3256,6 +3258,7 @@ theorem toBoundaryBlockCommuteOfValid_outsideTokens {n : ℕ} /-- A lifted residual pair whose protected interval begins with a completed crosscap exposes the exact contextual crosscap transition. -/ +@[expose] def toCrosscapBlockCommute {n : ℕ} {tokens : List (ReductionToken (n + 1))} (pair : MarkedResidualCancellablePair tokens) @@ -3379,6 +3382,7 @@ theorem crosscapBlockCommuteConditions_of_valid {n : ℕ} /-- Surface multiplicity supplies every freshness condition needed for a contextual crosscap transition at the head of a lifted residual-pair interval. -/ +@[expose] noncomputable def toCrosscapBlockCommuteOfValid {n : ℕ} {tokens : List (ReductionToken (n + 1))} (pair : MarkedResidualCancellablePair tokens) @@ -3427,6 +3431,7 @@ theorem toCrosscapBlockCommuteOfValid_outsideTokens {n : ℕ} /-- A lifted residual pair whose protected interval begins with a completed handle exposes the exact contextual handle transition. -/ +@[expose] def toHandleBlockCommute {n : ℕ} {tokens : List (ReductionToken (n + 1))} (pair : MarkedResidualCancellablePair tokens) @@ -3585,6 +3590,7 @@ theorem handleBlockCommuteConditions_of_valid {n : ℕ} /-- Surface multiplicity supplies every distinction and freshness condition needed for a contextual handle transition. -/ +@[expose] noncomputable def toHandleBlockCommuteOfValid {n : ℕ} {tokens : List (ReductionToken (n + 1))} (pair : MarkedResidualCancellablePair tokens) @@ -7469,6 +7475,7 @@ namespace MarkedExecutionState /-- Forget the marked-token implementation of a residual-empty state and retain its exact terminal protected-atom word. -/ +@[expose] noncomputable def toTerminalProtectedWord {n : ℕ} {tokens : List (ReductionToken n)} (state : MarkedExecutionState tokens) @@ -7526,14 +7533,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..b00c1bf7fa 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 @@ -154,6 +154,7 @@ noncomputable def nonOrientableNormalizationResultOfRotated /-- Signed finished orientable word adapter, permitting independent orientation normalization of every handle and boundary-loop edge. -/ +@[expose] noncomputable def orientableNormalizationResultOfSignedRotated {k p n : ℕ} (sourceWord : List (SignedDart (Fin k))) @@ -174,6 +175,7 @@ noncomputable def orientableNormalizationResultOfSignedRotated /-- Signed finished nonorientable word adapter, permitting independent orientation normalization of every crosscap and boundary-loop edge. -/ +@[expose] noncomputable def nonOrientableNormalizationResultOfSignedRotated {k p n : ℕ} (sourceWord : List (SignedDart (Fin k))) @@ -194,7 +196,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] @@ -210,6 +212,7 @@ structure CancellablePair {n : ℕ} rotated : word.IsRotated (inversePair edge negativeFirst ++ tail) /-- A one-face word has no cyclically adjacent inverse pair. -/ +@[expose] def IsPairReduced {n : ℕ} (word : List (SignedDart (Fin n))) : Prop := IsEmpty (CancellablePair word) @@ -619,6 +622,7 @@ noncomputable def normalizeConnected namespace Pairing /-- A signed dart with its orientation represented by a Boolean. -/ +@[expose] def dart {α : Type*} (a : α) : Bool → SignedDart α | false => .pos a | true => .neg a @@ -629,7 +633,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 +699,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 α) := @@ -789,6 +793,7 @@ inductive EdgePattern {n : ℕ} /-- Every edge name actually used by a residual word still has a surface multiplicity. Unlike `IsSurfaceValid`, this predicate permits the ambient `Fin` type to contain already-grouped edge names which no longer occur in the residual word. -/ +@[expose] def HasValidUsedMultiplicities {n : ℕ} (word : List (SignedDart (Fin n))) : Prop := ∀ a, a ∈ word.map edgeOfDart → @@ -1452,7 +1457,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 +1789,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 => @@ -1982,6 +1987,7 @@ theorem edges_lowerAvoiding_map_restoreEdge {n : ℕ} simp [lowerAvoiding, edges] /-- Concatenate a sequence of extracted blocks into its exact signed boundary word. -/ +@[expose] def sequenceWord {n : ℕ} (blocks : List (ExtractedBlock n)) : List (SignedDart (Fin n)) := (blocks.map word).flatten @@ -2040,7 +2046,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 +2057,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] @@ -2250,6 +2256,7 @@ theorem names_lowerAvoiding_map_restoreEdge {n : ℕ} simp [lowerAvoiding, names] /-- Concatenate a completed block sequence into its exact signed one-face word. -/ +@[expose] def sequenceWord {n : ℕ} (blocks : List (CompletedBlock n)) : List (SignedDart (Fin n)) := (blocks.map word).flatten @@ -2275,7 +2282,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 +2301,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 +2323,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 +2371,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 +2385,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 +2398,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 +2411,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 +2990,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 +3002,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 +3191,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 +3203,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 +3674,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 +3682,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 +3690,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 +3698,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 +3706,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 +3726,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 +4232,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 +4241,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)))) : @@ -4502,23 +4509,24 @@ end BoundaryPairContraction namespace BoundaryEnvelope /-- A one-face word before a fresh opposite carrier pair is introduced. -/ -@[reducible] +@[expose, reducible] def source {n : ℕ} (word : List (SignedDart (Fin n))) : FiniteCyclicPresentation := Dyck.oneFace word /-- The fresh carrier name in the enlarged edge type. -/ +@[expose] 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)] /-- The `target` declaration. -/ -@[reducible] +@[expose, reducible] def target {n : ℕ} (word : List (SignedDart (Fin n))) : FiniteCyclicPresentation := Dyck.oneFace (targetWord word) @@ -4836,7 +4844,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 +4857,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 @@ -4880,11 +4888,13 @@ def inverse {n : ℕ} : ProtectedAtom n → ProtectedAtom n .completed block.inverse /-- Concatenate a protected atom sequence into its exact signed word. -/ +@[expose] def sequenceWord {n : ℕ} (atoms : List (ProtectedAtom n)) : List (SignedDart (Fin n)) := (atoms.map word).flatten /-- Concatenate the distinct-name spines owned by a protected atom sequence. -/ +@[expose] def sequenceNames {n : ℕ} (atoms : List (ProtectedAtom n)) : List (Fin n) := (atoms.map names).flatten @@ -5175,7 +5185,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 +5193,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 => @@ -5228,6 +5238,7 @@ theorem rawBoundaryCount_map_ofProtectedAtom {n : ℕ} ProtectedAtom.rawBoundaryCount, ofProtectedAtom, ih] /-- Exact signed word represented by one marked token. -/ +@[expose] def word {n : ℕ} : ReductionToken n → List (SignedDart (Fin n)) | .residual dart => [dart] @@ -5235,6 +5246,7 @@ def word {n : ℕ} : ReductionToken n → | .completed block => block.word /-- Residual contribution of one marked token. -/ +@[expose] def residualWord {n : ℕ} : ReductionToken n → List (SignedDart (Fin n)) | .residual dart => [dart] @@ -5242,12 +5254,14 @@ def residualWord {n : ℕ} : ReductionToken n → | .completed _ => [] /-- Edge names protected inside one extracted-block token. -/ +@[expose] def extractedEdges {n : ℕ} : ReductionToken n → List (Fin n) | .residual _ => [] | .extracted block => block.edges | .completed block => block.edges /-- One occurrence of every protected edge name represented by a token. -/ +@[expose] def extractedNames {n : ℕ} : ReductionToken n → List (Fin n) | .residual _ => [] | .extracted block => block.edges @@ -5337,6 +5351,7 @@ theorem mem_extractedNames_iff_mem_extractedEdges {n : ℕ} /-- Structural grammar of marked execution states. Extracted crosscaps and handles are promoted immediately to completed blocks; only a boundary singleton may remain in the intermediate `extracted` constructor. -/ +@[expose] def IsClassified {n : ℕ} : ReductionToken n → Prop | .residual _ => True | .extracted (.boundary _ _) => True @@ -5344,6 +5359,7 @@ def IsClassified {n : ℕ} : ReductionToken n → Prop | .completed _ => True /-- Every token in a marked execution state obeys the classified-token grammar. -/ +@[expose] def AllClassified {n : ℕ} (tokens : List (ReductionToken n)) : Prop := ∀ token ∈ tokens, token.IsClassified @@ -5745,28 +5761,32 @@ theorem extractedNames_lowerAvoiding_map_restoreEdge {n : ℕ} a block _ /-- Expand a marked word to the exact signed word on which normalization moves act. -/ +@[expose] def expand {n : ℕ} (tokens : List (ReductionToken n)) : List (SignedDart (Fin n)) := (tokens.map word).flatten /-- Erase extracted blocks and retain only the darts still available to pairing reduction. -/ +@[expose] def residualDarts {n : ℕ} (tokens : List (ReductionToken n)) : List (SignedDart (Fin n)) := (tokens.map residualWord).flatten /-- All edge names protected inside extracted block tokens. -/ +@[expose] def protectedEdges {n : ℕ} (tokens : List (ReductionToken n)) : List (Fin n) := (tokens.map extractedEdges).flatten /-- Distinct-name spine of all protected tokens. Each token contributes each of its edge names once, so global `Nodup` expresses disjoint ownership of protected names. -/ +@[expose] def protectedNames {n : ℕ} (tokens : List (ReductionToken n)) : List (Fin 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 +6072,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..bb101ff165 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 @@ -341,6 +341,7 @@ theorem polygonalPreMap_respects | trans _ _ _ _ _ ih₁ ih₂ => exact ih₁.trans ih₂ /-- Descend the calibrated face maps through the cyclic polygonal quotient. -/ +@[expose] noncomputable def polygonalRealizationMap (valid : T.toFiniteCyclicPresentation.IsSurfaceValid) : T.toFiniteCyclicPresentation.PolygonalRealization valid → T.realization := 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..3c61aa67b7 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 @@ -181,7 +181,7 @@ namespace IntrinsicTwoComplex variable (K : IntrinsicTwoComplex) (U : Set K.realization) /-- The ambient open cover obtained from controlled neighborhoods in the open subspace `U`. -/ -noncomputable def controlledAdaptiveOpenCover (hU : IsOpen U) +@[expose] noncomputable def controlledAdaptiveOpenCover (hU : IsOpen U) (f : U → Plane) (hf : Continuous f) (phi : U → ℝ) (hphi : StronglyPositiveOn Set.univ phi) : K.AdaptiveOpenCover U := by letI : LocallyCompactSpace U := hU.locallyCompactSpace diff --git a/LeanPool/ClassificationOfSurfaces/Moise/AdaptiveFanAffine.lean b/LeanPool/ClassificationOfSurfaces/Moise/AdaptiveFanAffine.lean index e153742f7f..bba84c237c 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 @@ -171,7 +171,7 @@ noncomputable def adaptiveGlobalFanLinearPiece (K.adaptiveFanVertexSource U hU f p).1 /-- The affine map describing one global adaptive fan face in standard coordinates. -/ -noncomputable def adaptiveGlobalFanMapStandardAffine +@[expose] noncomputable def adaptiveGlobalFanMapStandardAffine (hU : IsOpen U) (f : K.AdaptiveFanFace U hU) : Plane →ᵃ[ℝ] (K.Vertex → ℝ) := ((K.adaptiveGlobalFanAffinePiece hU f).comp @@ -183,7 +183,7 @@ abbrev adaptiveGlobalFanSimplex (hU : IsOpen U) (f : K.AdaptiveFanFace U hU) := stdSimplex ℝ {v // v ∈ K.adaptiveGlobalFanFaceVertices U hU f} /-- The intrinsic-coordinate value of a global adaptive fan face map. -/ -noncomputable def adaptiveGlobalFanFaceMapValue +@[expose] noncomputable def adaptiveGlobalFanFaceMapValue (hU : IsOpen U) (f : K.AdaptiveFanFace U hU) : K.adaptiveGlobalFanSimplex hU f → (K.Vertex → ℝ) := fun x ↦ (K.adaptiveGlobalFanFaceMap U hU f x).1.1 diff --git a/LeanPool/ClassificationOfSurfaces/Moise/AdaptiveFanComplex.lean b/LeanPool/ClassificationOfSurfaces/Moise/AdaptiveFanComplex.lean index 5a5164a696..bec0a0a7cd 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 @@ -102,7 +102,7 @@ theorem homeo_symm_mem_levelFaceCarrier {n : ℕ} (t : K.LevelFace n) rwa [heq] /-- The source point of a geometric fan vertex in the refined realization carrying its tile. -/ -noncomputable def adaptiveFanVertexSource (hU : IsOpen U) +@[expose] noncomputable def adaptiveFanVertexSource (hU : IsOpen U) (f : K.AdaptiveFanFace U hU) (p : {p // p ∈ K.adaptiveFanFaceVertices U hU f}) : (K.safeSubdivision f.1.1).refined.realization := @@ -117,21 +117,21 @@ theorem adaptiveFanVertexSource_mem_carrier (hU : IsOpen U) exact K.adaptiveFanVertex_mem_carrier U hU f p.2 /-- The distinguished cone-center vertex of a fan triangle. -/ -noncomputable def adaptiveFanCenterVertex (hU : IsOpen U) +@[expose] noncomputable def adaptiveFanCenterVertex (hU : IsOpen U) (f : K.AdaptiveFanFace U hU) : {p // p ∈ K.adaptiveFanFaceVertices U hU f} := ⟨K.adaptiveFaceCenter U f.1, by simp [adaptiveFanFaceVertices]⟩ /-- The first base vertex of a fan triangle. -/ -noncomputable def adaptiveFanFirstVertex (hU : IsOpen U) +@[expose] noncomputable def adaptiveFanFirstVertex (hU : IsOpen U) (f : K.AdaptiveFanFace U hU) : {p // p ∈ K.adaptiveFanFaceVertices U hU f} := ⟨K.adaptiveEdgeIntervalFirst U hU f.1 f.2.1 f.2.2, by simp [adaptiveFanFaceVertices]⟩ /-- The second base vertex of a fan triangle. -/ -noncomputable def adaptiveFanSecondVertex (hU : IsOpen U) +@[expose] noncomputable def adaptiveFanSecondVertex (hU : IsOpen U) (f : K.AdaptiveFanFace U hU) : {p // p ∈ K.adaptiveFanFaceVertices U hU f} := ⟨K.adaptiveEdgeIntervalSecond U hU f.1 f.2.1 f.2.2, by @@ -888,7 +888,7 @@ theorem adaptiveFanSourcePoint_val_injective (hU : IsOpen U) simpa only [source, Finset.sum_apply, Pi.smul_apply, smul_eq_mul] using hxy /-- One parametrized fan triangle in the open subspace. -/ -noncomputable def adaptiveFanFaceMap (hU : IsOpen U) +@[expose] noncomputable def adaptiveFanFaceMap (hU : IsOpen U) (f : K.AdaptiveFanFace U hU) : K.adaptiveFanSimplex U hU f → U := fun x ↦ ⟨(K.safeSubdivision f.1.1).homeo @@ -1045,7 +1045,7 @@ theorem continuous_adaptiveFanFaceMap (hU : IsOpen U) (K.continuous_adaptiveFanSourcePoint U hU f) /-- The geometric interval path along a resolved fan base. -/ -noncomputable def adaptiveFanBasePath (hU : IsOpen U) +@[expose] noncomputable def adaptiveFanBasePath (hU : IsOpen U) (f : K.AdaptiveFanFace U hU) : Set.Icc (0 : ℝ) 1 → U := K.adaptiveFanFaceMap U hU f ∘ K.adaptiveFanBaseSimplexPath U hU f diff --git a/LeanPool/ClassificationOfSurfaces/Moise/AdaptiveOpenComplex.lean b/LeanPool/ClassificationOfSurfaces/Moise/AdaptiveOpenComplex.lean index f3e40234ac..0960d73179 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 @@ -34,7 +34,7 @@ variable (K : IntrinsicTwoComplex) (U : Set K.realization) abbrev LevelFace (n : ℕ) := (K.safeSubdivision n).refined.Face /-- The carrier of a level face, transported back to the original realization. -/ -def levelFaceCarrier {n : ℕ} (t : K.LevelFace n) : Set K.realization := +@[expose] def levelFaceCarrier {n : ℕ} (t : K.LevelFace n) : Set K.realization := (K.safeSubdivision n).homeo '' (K.safeSubdivision n).refined.faceCarrier t.1 @@ -65,7 +65,7 @@ instance (priority := 100) defaultAdaptiveSafety : AdaptiveSafety K U where hereditary hts hs := hts.trans hs /-- The active safety predicate. -/ -def LevelFace.IsSafe [AdaptiveSafety K U] {n : ℕ} (t : K.LevelFace n) : Prop := +@[expose] def LevelFace.IsSafe [AdaptiveSafety K U] {n : ℕ} (t : K.LevelFace n) : Prop := AdaptiveSafety.safe (K := K) (U := U) t theorem levelFace_isSafe_iff {n : ℕ} (t : K.LevelFace n) : @@ -323,7 +323,7 @@ theorem LevelFace.IsSafe.child {n : ℕ} {t : K.LevelFace (n + 1)} /-- Relative interior of a transported level face, expressed by positive barycentric coordinates on all three face vertices. -/ -def levelFaceRelInterior {n : ℕ} (t : K.LevelFace n) : Set K.realization := +@[expose] def levelFaceRelInterior {n : ℕ} (t : K.LevelFace n) : Set K.realization := (K.safeSubdivision n).homeo '' {x : (K.safeSubdivision n).refined.realization | x ∈ (K.safeSubdivision n).refined.faceCarrier t.1 ∧ @@ -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)) : @@ -409,7 +409,7 @@ theorem LevelFace.IsSafe.ancestor_child {n k : ℕ} {t : K.LevelFace (n + k)} (K.levelFaceCarrier_subset_ancestor n k t) ht /-- A first-safe face is safe, but at a positive level its chosen parent is not safe. -/ -def LevelFace.IsFirstSafe : {n : ℕ} → K.LevelFace n → Prop +@[expose] def LevelFace.IsFirstSafe : {n : ℕ} → K.LevelFace n → Prop | 0, t => LevelFace.IsSafe K U t | n + 1, t => LevelFace.IsSafe K U t ∧ ¬LevelFace.IsSafe K U (K.levelParentFace n t) @@ -486,7 +486,7 @@ theorem adaptiveFace_level_le_commonLevel exact Finset.le_sup (f := fun u : K.AdaptiveFace U ↦ u.1) ht /-- Carrier of one adaptive triangle in the original realization. -/ -def adaptiveFaceCarrier (t : K.AdaptiveFace U) : Set K.realization := +@[expose] def adaptiveFaceCarrier (t : K.AdaptiveFace U) : Set K.realization := K.levelFaceCarrier t.2.1 /-- Every tile in a finite adaptive family is a union of faces of the family's common midpoint @@ -510,7 +510,7 @@ theorem adaptiveFaceCarrier_subset (t : K.AdaptiveFace U) : · exact AdaptiveSafety.carrier_subset (K := K) (U := U) t.2.1 /-- Relative interior of one adaptive face. -/ -def adaptiveFaceRelInterior (t : K.AdaptiveFace U) : Set K.realization := +@[expose] def adaptiveFaceRelInterior (t : K.AdaptiveFace U) : Set K.realization := K.levelFaceRelInterior t.2.1 /-- Distinct first-safe adaptive faces meet only on their relative boundaries. -/ @@ -652,7 +652,7 @@ theorem finite_adaptiveFace_level_lt (N : ℕ) : (show Finite {t : K.AdaptiveFace U // t.1 < N} from inferInstance) /-- Carrier of an adaptive face in the open subspace itself. -/ -def adaptiveFaceCarrierInOpen (t : K.AdaptiveFace U) : Set U := +@[expose] def adaptiveFaceCarrierInOpen (t : K.AdaptiveFace U) : Set U := Subtype.val ⁻¹' K.adaptiveFaceCarrier U t /-- The first-safe adaptive triangle family is locally finite in the open set. -/ @@ -686,7 +686,7 @@ theorem locallyFinite_adaptiveFaceCarrierInOpen (hU : IsOpen U) : /-! ## Finite boundary data on each adaptive tile -/ /-- The geometric point represented by one vertex of a level face. -/ -noncomputable def levelFaceVertexPoint {n : ℕ} (t : K.LevelFace n) +@[expose] noncomputable def levelFaceVertexPoint {n : ℕ} (t : K.LevelFace n) (v : {v // v ∈ t.1}) : K.realization := (K.safeSubdivision n).homeo ((K.safeSubdivision n).refined.facePoint t v) @@ -704,7 +704,7 @@ abbrev AdaptiveVertexOccurrence (t : K.AdaptiveFace U) := {v // v ∈ t.2.1.1} /-- The `adaptiveVertexPoint` declaration. -/ -noncomputable def adaptiveVertexPoint (t : K.AdaptiveFace U) +@[expose] noncomputable def adaptiveVertexPoint (t : K.AdaptiveFace U) (v : K.AdaptiveVertexOccurrence U t) : K.realization := K.levelFaceVertexPoint t.2.1 v @@ -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} @@ -890,7 +890,7 @@ theorem adaptiveVertexPoint_mem_boundaryVertices (hU : IsOpen U) exact ⟨v, rfl⟩ /-- Carrier of one cyclic edge of a level face. -/ -def levelFaceEdgeCarrier {n : ℕ} (t : K.LevelFace n) (i : ZMod 3) : +@[expose] def levelFaceEdgeCarrier {n : ℕ} (t : K.LevelFace n) (i : ZMod 3) : Set K.realization := (K.safeSubdivision n).homeo '' (K.safeSubdivision n).refined.faceCarrier @@ -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)) @@ -1348,7 +1348,7 @@ theorem boundaryEdgeVertexList_last_parameter (hU : IsOpen U) apply le_antisymm hupper hle /-- The equal-weight point of the standard simplex on an intrinsic face. -/ -noncomputable def faceCenterSimplex (t : K.Face) : +@[expose] noncomputable def faceCenterSimplex (t : K.Face) : stdSimplex ℝ {v // v ∈ t.1} := by let x : {v // v ∈ t.1} → ℝ := fun _ ↦ 1 / 3 refine ⟨x, ?_, ?_⟩ @@ -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..2aea2d824f 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 @@ -43,7 +43,7 @@ namespace AdaptiveOpenCover variable (C : K.AdaptiveOpenCover U) /-- A level face is cover-safe when its complete carrier lies in one cover member. -/ -@[reducible] +@[reducible, expose] def safety : K.AdaptiveSafety U where safe t := ∃ i, K.levelFaceCarrier t ⊆ C.set i carrier_subset := by @@ -97,21 +97,21 @@ theorem safety_isAdmissible : noncomputable abbrev locallyFiniteTriangleComplex (hU : IsOpen U) : LocallyFiniteTriangleComplex U := by letI : K.AdaptiveSafety U := C.safety - letI : AdaptiveSafety.IsAdmissible (K := K) (U := U) := C.safety_isAdmissible + letI : @AdaptiveSafety.IsAdmissible K U C.safety := C.safety_isAdmissible exact K.adaptiveLocallyFiniteTriangleComplex U hU /-- The cover-subordinate adaptive complex covers all of `U`. -/ theorem locallyFiniteTriangleComplex_support (hU : IsOpen U) : (locallyFiniteTriangleComplex K U C hU).support = Set.univ := by let : K.AdaptiveSafety U := C.safety - let : AdaptiveSafety.IsAdmissible (K := K) (U := U) := C.safety_isAdmissible + let : @AdaptiveSafety.IsAdmissible K U C.safety := C.safety_isAdmissible exact K.adaptiveLocallyFiniteTriangleComplex_support U hU /-- Distinct faces of the cover-subordinate adaptive complex carry distinct vertex triples. -/ theorem faceVertices_injective (hU : IsOpen U) : Function.Injective (locallyFiniteTriangleComplex K U C hU).faceVertices := by let : K.AdaptiveSafety U := C.safety - let : AdaptiveSafety.IsAdmissible (K := K) (U := U) := C.safety_isAdmissible + let : @AdaptiveSafety.IsAdmissible K U C.safety := C.safety_isAdmissible exact K.adaptiveGlobalFanFaceVertices_injective U hU /-- Every adaptive tile selected by `C` lies in one member of the cover. -/ @@ -129,7 +129,7 @@ theorem exists_cover_set_of_complex_face (hU : IsOpen U) ∃ i, Subtype.val '' ((locallyFiniteTriangleComplex K U C hU).faceCarrier f) ⊆ C.set i := by let : K.AdaptiveSafety U := C.safety - let : AdaptiveSafety.IsAdmissible (K := K) (U := U) := C.safety_isAdmissible + let : @AdaptiveSafety.IsAdmissible K U C.safety := C.safety_isAdmissible obtain ⟨i, hi⟩ := exists_cover_set_of_adaptiveFace K U C f.1 refine ⟨i, ?_⟩ rintro p ⟨q, hq, rfl⟩ diff --git a/LeanPool/ClassificationOfSurfaces/Moise/AdaptiveTileComplex.lean b/LeanPool/ClassificationOfSurfaces/Moise/AdaptiveTileComplex.lean index 5cfef46c86..c67de8e808 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 @@ -47,7 +47,7 @@ theorem levelFaceHomeoSymm_mem_carrier {n : ℕ} (t : K.LevelFace n) simpa only [(K.safeSubdivision n).homeo.symm_apply_apply] using hx /-- Remove the faithful subdivision transport from one adaptive tile. -/ -noncomputable def adaptiveFaceSourceHomeomorph (t : K.AdaptiveFace U) : +@[expose] noncomputable def adaptiveFaceSourceHomeomorph (t : K.AdaptiveFace U) : K.AdaptiveClosedFace U t ≃ₜ (K.safeSubdivision t.1).refined.ClosedFace t.2.1 where toFun p := ⟨(K.safeSubdivision t.1).homeo.symm p.1, @@ -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..0d6fe47b8f 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 @@ -45,7 +45,7 @@ noncomputable def adaptiveFanVertexEmbedding (hU : IsOpen U) exact congrArg (fun z : K.AdaptiveFanVertex U hU ↦ z.1) hpq /-- The three vertices of a fan face, now regarded as global used vertices. -/ -noncomputable def adaptiveGlobalFanFaceVertices (hU : IsOpen U) +@[expose] noncomputable def adaptiveGlobalFanFaceVertices (hU : IsOpen U) (f : K.AdaptiveFanFace U hU) : Finset (K.AdaptiveFanVertex U hU) := (K.adaptiveFanFaceVertices U hU f).attach.map (K.adaptiveFanVertexEmbedding U hU f) @@ -68,7 +68,7 @@ theorem mem_adaptiveGlobalFanFaceVertices_iff (hU : IsOpen U) rfl /-- Relabel the local global vertices of a face by their underlying geometric points. -/ -noncomputable def adaptiveFanFaceVertexEquiv (hU : IsOpen U) +@[expose] noncomputable def adaptiveFanFaceVertexEquiv (hU : IsOpen U) (f : K.AdaptiveFanFace U hU) : {v // v ∈ K.adaptiveGlobalFanFaceVertices U hU f} ≃ {p // p ∈ K.adaptiveFanFaceVertices U hU f} where @@ -171,7 +171,7 @@ theorem adaptiveFanRelabel_extended_eq_iff (hU : IsOpen U) extendFaceCoordinates_of_notMem _ _ hpg] /-- One adaptive fan face parametrized by its global used vertices. -/ -noncomputable def adaptiveGlobalFanFaceMap (hU : IsOpen U) +@[expose] noncomputable def adaptiveGlobalFanFaceMap (hU : IsOpen U) (f : K.AdaptiveFanFace U hU) : stdSimplex ℝ {v // v ∈ K.adaptiveGlobalFanFaceVertices U hU f} → U := fun x ↦ K.adaptiveFanFaceMap U hU f (K.adaptiveFanRelabelSimplex U hU f x) 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..c6a3bf6fbe 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 @@ -104,7 +104,7 @@ def standardTriangleCircle : PolygonalCircle where absurd ((by decide : ∀ i j : ZMod 3, i ≠ j → i ≠ j + 1 → j = i + 1) i j h₁ h₂) h₃ /-- Three affinely independent points in the plane form an affine basis. -/ -noncomputable def planeAffineBasisOfTriple (p : Fin 3 → Plane) +@[expose] noncomputable def planeAffineBasisOfTriple (p : Fin 3 → Plane) (hp : AffineIndependent ℝ p) : AffineBasis (Fin 3) ℝ Plane where toFun := p ind' := hp 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..eeae60c2d1 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. -/ @@ -416,7 +416,7 @@ manifold-boundary stratum is exactly the model edge line. The forward half-disk implication is `ChartBoundaryInvariant`. The reverse implication follows from the same invariance-of-domain layer: chart independence identifies a zero normal coordinate with the frontier of the half-space model. -/ -def MoiseChart.BoundaryFaithful {S : Type*} [TopologicalSpace S] +@[expose] def MoiseChart.BoundaryFaithful {S : Type*} [TopologicalSpace S] [ChartedSpace (EuclideanHalfSpace 2) S] (c : MoiseChart S) : Prop := (c.kind = ChartKind.disk → ∀ y ∈ c.domain, y ∉ (modelWithCornersEuclideanHalfSpace 2).boundary S) ∧ diff --git a/LeanPool/ClassificationOfSurfaces/Moise/ChartInduction.lean b/LeanPool/ClassificationOfSurfaces/Moise/ChartInduction.lean index 5b80fe71a7..f37b1b3bea 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 @@ -1792,7 +1792,56 @@ private theorem MixedLocalFanCertificate.hasLocalCommonCoordinates_iff (pushGeometricRealization C.oldCompactToCommon C.mixedOldComplex.compactIntrinsic.faces x).1 = (pushGeometricRealization M.targetToCommon M.localComplex.faces z).1 := by - rfl + classical + let defaultOldPush : M.CommonVertex → ℝ := + (pushGeometricRealization C.oldCompactToCommon + C.mixedOldComplex.compactIntrinsic.faces x).1 + let defaultTargetPush : M.CommonVertex → ℝ := + (pushGeometricRealization M.targetToCommon M.localComplex.faces z).1 + have hDefaultOldOutside (b : M.CommonVertex) + (hb : b ∉ Set.range C.oldCompactToCommon) : + defaultOldPush b = 0 := by + exact pushGeometricRealization_apply_of_notMem_range + C.oldCompactToCommon C.mixedOldComplex.compactIntrinsic.faces x hb + have hDefaultTargetOutside (b : M.CommonVertex) + (hb : b ∉ Set.range M.targetToCommon) : + defaultTargetPush b = 0 := by + exact pushGeometricRealization_apply_of_notMem_range + M.targetToCommon M.localComplex.faces z hb + let : Fintype M.UsedOldVertex := + C.mixedOldComplex.compactIntrinsic.vertexFintype + let compactOldPush : M.CommonVertex → ℝ := + (pushGeometricRealization C.oldCompactToCommon + C.mixedOldComplex.compactIntrinsic.faces x).1 + let compactTargetPush : M.CommonVertex → ℝ := + (pushGeometricRealization M.targetToCommon M.localComplex.faces z).1 + have hCompactOldOutside (b : M.CommonVertex) + (hb : b ∉ Set.range C.oldCompactToCommon) : + compactOldPush b = 0 := by + exact pushGeometricRealization_apply_of_notMem_range + C.oldCompactToCommon C.mixedOldComplex.compactIntrinsic.faces x hb + have hCompactTargetOutside (b : M.CommonVertex) + (hb : b ∉ Set.range M.targetToCommon) : + compactTargetPush b = 0 := by + exact pushGeometricRealization_apply_of_notMem_range + M.targetToCommon M.localComplex.faces z hb + have hOldPush : compactOldPush = defaultOldPush := by + funext b + by_cases hb : b ∈ Set.range C.oldCompactToCommon + · obtain ⟨a, rfl⟩ := hb + simp only [compactOldPush, defaultOldPush, pushGeometricRealization_apply_embedding] + · exact (hCompactOldOutside b hb).trans (hDefaultOldOutside b hb).symm + have hTargetPush : compactTargetPush = defaultTargetPush := by + funext b + by_cases hb : b ∈ Set.range M.targetToCommon + · obtain ⟨a, rfl⟩ := hb + simp only [compactTargetPush, defaultTargetPush, + pushGeometricRealization_apply_embedding] + · exact (hCompactTargetOutside b hb).trans (hDefaultTargetOutside b hb).symm + simp only [MixedLocalFanCertificate.hasLocalCommonCoordinates] + change compactOldPush = compactTargetPush ↔ + defaultOldPush = defaultTargetPush + simp only [hOldPush, hTargetPush] /-- A local realization lifts canonically to the compact mixed complex, with the same coordinates after amalgamating the local vertices. -/ @@ -2012,8 +2061,6 @@ private theorem MixedLocalFanCertificate.fanFace_oldPoint_mem_baseEdge_of_common C.mixedOldComplex.compactEval xb ∈ M.ambient.faceCarrier (M.ambient.faceEdge f.1.1 f.1.2.1).1 := by classical - let : Fintype M.UsedOldVertex := - C.mixedOldComplex.compactIntrinsic.vertexFintype let fc := M.marking.fanCenterVertex f.1 let gc : M.marking.FanVertex := M.marking.fanVertexEmbedding f.1 fc have hgc : gc ∈ M.marking.globalFanFaceVertices f.1 := @@ -2073,6 +2120,8 @@ private theorem MixedLocalFanCertificate.fanFace_oldPoint_mem_baseEdge_of_common (Sum.inl ⟨uc, hnotLocal⟩) := congrFun hcoords (Sum.inl ⟨uc, hnotLocal⟩) _ = 0 := htargetZero + let : Fintype M.UsedOldVertex := + C.mixedOldComplex.compactIntrinsic.vertexFintype let x₂ : stdSimplex ℝ {v // v ∈ M.mixedUsedFaceVertices (Sum.inr f)} := C.mixedOldComplex.restrictToFace (M.mixedUsedFaceVertices (Sum.inr f)) ⟨xb.1, xb.2.1⟩ hxb @@ -2110,8 +2159,6 @@ private theorem MixedLocalFanCertificate.positive_usedOld_isLocal_of_common (hv : 0 < xb.1 (C.compactVertexEquiv.symm v)) : ∃ u : M.localComplex.UsedVertex, M.localUsedOldEmbedding u = v := by classical - let : Fintype M.UsedOldVertex := - C.mixedOldComplex.compactIntrinsic.vertexFintype apply exists_local_of_positive_of_amalgamated_coordinates M.localUsedOldEmbedding M.localUsedVertexEmbedding (fun w ↦ xb.1 (C.compactVertexEquiv.symm w)) diff --git a/LeanPool/ClassificationOfSurfaces/Moise/ChartInductionCore.lean b/LeanPool/ClassificationOfSurfaces/Moise/ChartInductionCore.lean index 255dd7aeb7..8a0dc1dde2 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 @@ -97,7 +97,7 @@ namespace PartialTriangulation variable {S : Type*} [TopologicalSpace S] (T : PartialTriangulation S) /-- Forget the ambient embedding and retain the intrinsic finite complex. -/ -@[reducible] def toIntrinsic : IntrinsicTwoComplex where +@[expose, reducible] def toIntrinsic : IntrinsicTwoComplex where Vertex := T.Vertex faces := T.faces faces_card := T.faces_card @@ -105,7 +105,7 @@ variable {S : Type*} [TopologicalSpace S] (T : PartialTriangulation S) @[simp] theorem toIntrinsic_faces : T.toIntrinsic.faces = T.faces := rfl /-- The part of `S` covered by the partial triangulation. -/ -def support : Set S := +@[expose] def support : Set S := Set.range T.embed /-- Restrict the ambient embedding to a set known to contain the support. -/ @@ -138,7 +138,8 @@ abbrev reembed (f : T.toIntrinsic.realization → S) theorem reembed_support (f : T.toIntrinsic.realization → S) (hf : _root_.Topology.IsEmbedding f) : - (T.reembed f hf).support = Set.range f := rfl + (T.reembed f hf).support = Set.range f := by + exact rfl /-- Replace the ambient embedding on a selected part of the intrinsic realization and retain the old embedding outside. The analytic frontier argument is deliberately supplied as an @@ -251,7 +252,7 @@ theorem restrictFaces_support (p : Finset T.Vertex → Prop) exact ⟨z, rfl⟩ /-- Replace a partial triangulation by a faithful finite intrinsic subdivision. -/ -noncomputable def refine (R : T.toIntrinsic.Subdivision) : PartialTriangulation S where +@[expose] noncomputable def refine (R : T.toIntrinsic.Subdivision) : PartialTriangulation S where Vertex := R.refined.Vertex faces := R.refined.faces faces_card := R.refined.faces_card @@ -316,7 +317,7 @@ noncomputable def toGeometricTriangulation (hcovers : T.support = Set.univ) : T.isEmbedding.toHomeomorphOfSurjective (Set.range_eq_univ.mp hcovers) /-- The edges of a partial triangulation: the two-element subsets of its faces. -/ -def edges : Finset (Finset T.Vertex) := +@[expose] def edges : Finset (Finset T.Vertex) := T.faces.biUnion fun t => t.powersetCard 2 /-- The dual graph of the maximal faces of a partial triangulation is connected. -/ @@ -335,7 +336,7 @@ boundary to be an edge subcomplex permits an interior chord joining two boundary arbitrary convex-hull polygonalization can flatten such a chord onto the model boundary. The facewise condition rules that out and is stable under affine subdivision: the pullback of its supporting face to every new triangle is again empty, a vertex, or an edge. -/ -def BoundaryFacewiseRegular [ChartedSpace (EuclideanHalfSpace 2) S] : Prop := +@[expose] def BoundaryFacewiseRegular [ChartedSpace (EuclideanHalfSpace 2) S] : Prop := ∀ t ∈ T.faces, ∃ b : Finset T.Vertex, b ⊆ t ∧ b.card ≤ 2 ∧ ∀ x : T.toIntrinsic.realization, x ∈ T.toIntrinsic.faceCarrier t → @@ -346,7 +347,7 @@ def BoundaryFacewiseRegular [ChartedSpace (EuclideanHalfSpace 2) S] : Prop := This is the side-local form used by the gluing theorem. It deliberately mentions only barycentric coordinates, so it transports transparently across vertex relabelings. -/ -def BoundaryFacewiseRegularEmbedding +@[expose] def BoundaryFacewiseRegularEmbedding [ChartedSpace (EuclideanHalfSpace 2) S] {V : Type*} [Fintype V] (F : Finset (Finset V)) (e : GeometricRealization V F → S) : Prop := @@ -1296,7 +1297,7 @@ namespace PartialTriangulation variable {S : Type*} [TopologicalSpace S] /-- The part of the intrinsic realization whose ambient image lies in a Rado chart domain. -/ -def chartOverlap (T : PartialTriangulation S) (c : MoiseChart S) : +@[expose] def chartOverlap (T : PartialTriangulation S) (c : MoiseChart S) : Set T.toIntrinsic.realization := T.embed ⁻¹' c.domain @@ -1305,7 +1306,7 @@ theorem isOpen_chartOverlap (T : PartialTriangulation S) (c : MoiseChart S) : c.isOpen_domain.preimage T.isEmbedding.continuous /-- Include an overlap point into the chart domain through the old partial triangulation. -/ -def chartOverlapToDomain (T : PartialTriangulation S) (c : MoiseChart S) : +@[expose] def chartOverlapToDomain (T : PartialTriangulation S) (c : MoiseChart S) : T.chartOverlap c → c.domain := fun x ↦ ⟨T.embed x.1, x.2⟩ @@ -1316,7 +1317,7 @@ theorem isEmbedding_chartOverlapToDomain (T : PartialTriangulation S) c.domain fun x ↦ x.2 /-- Chart coordinates of the old partial triangulation on the overlap. -/ -def chartOverlapMap (T : PartialTriangulation S) (c : MoiseChart S) : +@[expose] def chartOverlapMap (T : PartialTriangulation S) (c : MoiseChart S) : T.chartOverlap c → Plane := fun x ↦ (c.chart (T.chartOverlapToDomain c x) : Plane) @@ -2112,7 +2113,7 @@ theorem finite_facesMeeting Q.complex.locallyFinite.finite_nonempty_inter_compact hC /-- The finite subtype of replacement faces meeting a specified compact chart set. -/ -noncomputable def FacesMeeting +@[expose] noncomputable def FacesMeeting (Q : PolygonalReplacementPresentation X V) (C : Set V) (_ : IsCompact C) : Type := {f : Q.complex.Face | (Q.complex.faceCarrier f ∩ C).Nonempty} @@ -2487,13 +2488,13 @@ noncomputable def patchTriangleMesh (k : ChartKind) : TriangleMesh := k.patchComplex.toTriangleMesh /-- The finite old-side coordinate mesh in the common old/patch arrangement. -/ -noncomputable def patchOldMesh (k : ChartKind) +@[expose] noncomputable def patchOldMesh (k : ChartKind) (Q : PolygonalReplacementPresentation X k.perturbationRegion) : TriangleMesh := PolygonalFamily.selectedSynchronizedMesh (Q.patchFacePolygon k) (patchTriangleMesh k) (fun _ ↦ True) /-- The finite new-patch coordinate mesh in the same common arrangement. -/ -noncomputable def patchNewMesh (k : ChartKind) +@[expose] noncomputable def patchNewMesh (k : ChartKind) (Q : PolygonalReplacementPresentation X k.perturbationRegion) : TriangleMesh := PolygonalFamily.targetSynchronizedMesh (Q.patchFacePolygon k) (patchTriangleMesh k) @@ -2780,12 +2781,12 @@ theorem patchComplex_support_subset_arrangementMesh (k : ChartKind) (PolygonalFamily.enclosingRadius_pos J) /-- The old member of the common arrangement, restricted to the chosen polygonal union. -/ -noncomputable def synchronizedPatchOldMesh (k : ChartKind) +@[expose] noncomputable def synchronizedPatchOldMesh (k : ChartKind) (J : ι → PolygonalCircle) : TriangleMesh := PolygonalFamily.selectedSynchronizedMesh J k.patchComplex.toTriangleMesh (fun _ ↦ True) /-- The fixed chart patch in the same common arrangement. -/ -noncomputable def synchronizedPatchNewMesh (k : ChartKind) +@[expose] noncomputable def synchronizedPatchNewMesh (k : ChartKind) (J : ι → PolygonalCircle) : TriangleMesh := PolygonalFamily.targetSynchronizedMesh J k.patchComplex.toTriangleMesh @@ -2985,11 +2986,11 @@ namespace SynchronizedTarget variable {ι : Type*} [Fintype ι] /-- The old polygonal member of the common arrangement with an arbitrary finite target mesh. -/ -noncomputable def oldMesh (J : ι → PolygonalCircle) (N : TriangleMesh) : TriangleMesh := +@[expose] noncomputable def oldMesh (J : ι → PolygonalCircle) (N : TriangleMesh) : TriangleMesh := PolygonalFamily.selectedSynchronizedMesh J N (fun _ ↦ True) /-- The prescribed finite target member of the same common arrangement. -/ -noncomputable def newMesh (J : ι → PolygonalCircle) (N : TriangleMesh) : TriangleMesh := +@[expose] noncomputable def newMesh (J : ι → PolygonalCircle) (N : TriangleMesh) : TriangleMesh := PolygonalFamily.targetSynchronizedMesh J N theorem oldMesh_support (J : ι → PolygonalCircle) (N : TriangleMesh) : @@ -3230,12 +3231,12 @@ variable {ι : Type*} [Fintype ι] /-- The selected polygonal side of the common arrangement after finitely many additional certificate cuts. -/ -noncomputable def oldMesh (J : ι → PolygonalCircle) (N : TriangleMesh) +@[expose] noncomputable def oldMesh (J : ι → PolygonalCircle) (N : TriangleMesh) (lines : List (Plane →ᵃ[ℝ] ℝ)) : TriangleMesh := PolygonalFamily.selectedRelativeSynchronizedMesh J N lines (fun _ ↦ True) /-- The target side of the same additionally cut arrangement. -/ -noncomputable def newMesh (J : ι → PolygonalCircle) (N : TriangleMesh) +@[expose] noncomputable def newMesh (J : ι → PolygonalCircle) (N : TriangleMesh) (lines : List (Plane →ᵃ[ℝ] ℝ)) : TriangleMesh := PolygonalFamily.targetRelativeSynchronizedMesh J N lines @@ -3300,15 +3301,15 @@ def newFaceToAmbient (J : ι → PolygonalCircle) (N : TriangleMesh) theorem oldFaceToAmbient_val (J : ι → PolygonalCircle) (N : TriangleMesh) (lines : List (Plane →ᵃ[ℝ] ℝ)) (f : TriangleFamily.Face (oldMesh J N lines).triangles) : - (oldFaceToAmbient J N lines f).1 = f.1 := - rfl + (oldFaceToAmbient J N lines f).1 = f.1 := by + exact rfl @[simp] theorem newFaceToAmbient_val (J : ι → PolygonalCircle) (N : TriangleMesh) (lines : List (Plane →ᵃ[ℝ] ℝ)) (f : TriangleFamily.Face (newMesh J N lines).triangles) : - (newFaceToAmbient J N lines f).1 = f.1 := - rfl + (newFaceToAmbient J N lines f).1 = f.1 := by + exact rfl /-- Ambient-adjacent chambers retained on opposite sides give a genuine cross-edge certificate for the two synchronized submeshes. -/ @@ -3362,7 +3363,7 @@ theorem meshes_coordinateEmbed_eq_iff exact ((PolygonalFamily.targetRelativeSynchronizedMesh_triangle_mem J N lines).mp ht).1 /-- The `oldSurfaceEmbed` declaration. -/ -noncomputable def oldSurfaceEmbed +@[expose] noncomputable def oldSurfaceEmbed {S : Type*} [TopologicalSpace S] (c : MoiseChart S) (J : ι → PolygonalCircle) (N : TriangleMesh) (lines : List (Plane →ᵃ[ℝ] ℝ)) @@ -3375,7 +3376,7 @@ noncomputable def oldSurfaceEmbed exact hmodel) x)).1 /-- The `newSurfaceEmbed` declaration. -/ -noncomputable def newSurfaceEmbed +@[expose] noncomputable def newSurfaceEmbed {S : Type*} [TopologicalSpace S] (c : MoiseChart S) (J : ι → PolygonalCircle) (N : TriangleMesh) (lines : List (Plane →ᵃ[ℝ] ℝ)) @@ -3601,7 +3602,7 @@ theorem tileFaceMeetingPullback_coordinateLine_mem exact ⟨f, by simp, ha⟩ /-- The retained certificate lines together with any additional finite conforming cuts. -/ -noncomputable def tileFaceMeetingLines +@[expose] noncomputable def tileFaceMeetingLines {K : IntrinsicTwoComplex} {U : Set K.realization} {V : Set Plane} {Q : PolygonalReplacementPresentation U V} (A : PolygonalReplacementSourceAtlas K U V Q) @@ -3625,7 +3626,7 @@ theorem tileFaceMeetingPullback_coordinateLine_mem_lines (A.tileFaceMeetingPullback_coordinateLine_mem C hC N f ha) /-- Two transverse coordinate cuts through each point in a finite family. -/ -noncomputable def coordinateAnchorLines +@[expose] noncomputable def coordinateAnchorLines {α : Type*} [Fintype α] (p : α → Plane) : List (Plane →ᵃ[ℝ] ℝ) := (Finset.univ : Finset α).toList.flatMap fun a ↦ @@ -3647,7 +3648,7 @@ theorem horizontalLine_mem_coordinateAnchorLines exact ⟨a, by simp, by simp⟩ /-- The certificate-cut synchronized old mesh over the finite selected source family. -/ -noncomputable def tileFacesMeetingRelativeOldMesh +@[expose] noncomputable def tileFacesMeetingRelativeOldMesh {K : IntrinsicTwoComplex} {U : Set K.realization} {V : Set Plane} {Q : PolygonalReplacementPresentation U V} (A : PolygonalReplacementSourceAtlas K U V Q) @@ -3801,7 +3802,7 @@ theorem sourceTileFacesMeeting_eq_coordinatePreimage /-- The certificate-cut synchronized old mesh, regarded as a subspace of the global replacement support. -/ -noncomputable def tileFacesMeetingRelativeOldCoordinateSupport +@[expose] noncomputable def tileFacesMeetingRelativeOldCoordinateSupport {K : IntrinsicTwoComplex} {U : Set K.realization} {V : Set Plane} {Q : PolygonalReplacementPresentation U V} (A : PolygonalReplacementSourceAtlas K U V Q) @@ -3858,7 +3859,7 @@ theorem isEmbedding_tileFacesMeetingRelativeOldCoordinateSupport /-- Pull the certificate-cut old coordinate triangulation back through the retained source homeomorphism. -/ -noncomputable def tileFacesMeetingRelativeSourceEmbed +@[expose] noncomputable def tileFacesMeetingRelativeSourceEmbed {K : IntrinsicTwoComplex} {U : Set K.realization} {V : Set Plane} {Q : PolygonalReplacementPresentation U V} (A : PolygonalReplacementSourceAtlas K U V Q) @@ -3942,7 +3943,7 @@ noncomputable abbrev tileFacesMeetingRelativeSourceComplex /-- The original intrinsic point represented by one used vertex of the certificate-cut local source mesh. -/ -noncomputable def tileFacesMeetingRelativeSourceVertexPoint +@[expose] noncomputable def tileFacesMeetingRelativeSourceVertexPoint {K : IntrinsicTwoComplex} {U : Set K.realization} {V : Set Plane} {Q : PolygonalReplacementPresentation U V} (A : PolygonalReplacementSourceAtlas K U V Q) @@ -3957,7 +3958,7 @@ noncomputable def tileFacesMeetingRelativeSourceVertexPoint /-- The same local source vertex, retaining its proof of membership in the replacement domain. -/ -noncomputable def tileFacesMeetingRelativeSourceVertexPointInOpen +@[expose] noncomputable def tileFacesMeetingRelativeSourceVertexPointInOpen {K : IntrinsicTwoComplex} {U : Set K.realization} {V : Set Plane} {Q : PolygonalReplacementPresentation U V} (A : PolygonalReplacementSourceAtlas K U V Q) @@ -3980,8 +3981,8 @@ noncomputable def tileFacesMeetingRelativeSourceVertexPointInOpen C hC N extraLines).UsedVertex) : (A.tileFacesMeetingRelativeSourceVertexPointInOpen C hC N extraLines v).1 = - A.tileFacesMeetingRelativeSourceVertexPoint C hC N extraLines v := - rfl + A.tileFacesMeetingRelativeSourceVertexPoint C hC N extraLines v := by + exact rfl /-- In replacement coordinates, a used local source vertex is its literal plane-mesh vertex. -/ @@ -4458,8 +4459,8 @@ theorem relativeOldTrianglePoint_val_eq_triangleCoords C hC N extraLines).triangleCarrier t.1}) : (A.relativeOldTrianglePoint C hC N extraLines t p).1 = (A.tileFacesMeetingRelativeOldMesh - C hC N extraLines).triangleCoords t p.1 := - rfl + C hC N extraLines).triangleCoords t p.1 := by + exact rfl theorem relativeOldTrianglePoint_supported {K : IntrinsicTwoComplex} {U : Set K.realization} {V : Set Plane} @@ -4775,7 +4776,7 @@ theorem levelFaceParentPlaneAffine_surjective exact levelFaceParentPlaneAffine_injOn K s /-- Barycentric coordinate of a level face after transport to its original parent plane. -/ -noncomputable def levelFaceParentCoord +@[expose] noncomputable def levelFaceParentCoord (K : IntrinsicTwoComplex) {n : ℕ} (s : K.LevelFace n) (k : Fin 3) : Plane →ᵃ[ℝ] ℝ := (affineBasisOfTriangle @@ -5300,7 +5301,7 @@ private noncomputable def straightenedChartOpenPresentation sourceHomeomorph := q facePolygon := fun f ↦ R.facePolygonalCircle (G := G) f faceFillingMap := fun f ↦ (R.facePLFilling (G := G) f).map - faceMap_eq := fun _ _ ↦ rfl + faceMap_eq := fun _ _ ↦ by exact rfl faceCertificate := fun f ↦ (R.facePLFilling (G := G) f).certificate faceClosedRegion_subset := fun f ↦ H.closedRegions_mem_region f faceCarrier_eq := fun f ↦ R.polygonalReplacementComplex_faceCarrier H f } @@ -5535,8 +5536,16 @@ private theorem straightenedChartOpen_coordZero_iff_boundary let E := T.toIntrinsic.adaptiveFanFaceVertexEquiv U hU a let v₀ : {v // v ∈ T.toIntrinsic.adaptiveGlobalFanFaceVertices U hU a} := E.symm (T.toIntrinsic.adaptiveFanCenterVertex U hU a) + have hv₀value : v₀.1.1 = T.toIntrinsic.adaptiveFaceCenter U a.1 := by + calc + v₀.1.1 = (E v₀).1 := + (T.toIntrinsic.adaptiveFanFaceVertexEquiv_apply_val U hU a v₀).symm + _ = (T.toIntrinsic.adaptiveFanCenterVertex U hU a).1 := + congrArg Subtype.val (E.apply_symm_apply _) + _ = T.toIntrinsic.adaptiveFaceCenter U a.1 := by + simp only [IntrinsicTwoComplex.adaptiveFanCenterVertex] have hv₀ : v₀.1.1 ∉ T.toIntrinsic.faceCarrier b := by - change T.toIntrinsic.adaptiveFaceCenter U a.1 ∉ T.toIntrinsic.faceCarrier b + rw [hv₀value] apply T.toIntrinsic.adaptiveFaceCenter_not_mem_faceCarrier_of_subordinate hU a t · exact (Classical.choose_spec hs).2 · exact hbt @@ -6347,7 +6356,7 @@ theorem moise_secondCountableTopology : SecondCountableTopology S := by /-- Two embeddings of the same source preserve the ambient manifold-boundary stratum pointwise. This is the exact relative certificate needed by the crossing weld. -/ -def PreservesManifoldBoundary {X : Type*} (f g : X → S) : Prop := +@[expose] def PreservesManifoldBoundary {X : Type*} (f g : X → S) : Prop := ∀ x, f x ∈ (modelWithCornersEuclideanHalfSpace 2).boundary S ↔ g x ∈ (modelWithCornersEuclideanHalfSpace 2).boundary S @@ -6355,7 +6364,7 @@ def PreservesManifoldBoundary {X : Type*} (f g : X → S) : Prop := /-- The raw chart straightening, augmented only with the certificate that its frontier-glued embedding preserves ambient boundary membership. The crossing-weld implementation consumes this proposition to retain the boundary-line subcomplex during the bordered induction. -/ -def PartialTriangulation.BoundaryPreservingStraightening +@[expose] def PartialTriangulation.BoundaryPreservingStraightening (T : PartialTriangulation S) (c : MoiseChart S) : Prop := ∀ (A : Set S), IsClosed A → ∃ (U : Set T.toIntrinsic.realization) (_ : IsOpen U) diff --git a/LeanPool/ClassificationOfSurfaces/Moise/ChartPatch.lean b/LeanPool/ClassificationOfSurfaces/Moise/ChartPatch.lean index d04c220fac..6708071a25 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 := @@ -390,7 +390,7 @@ noncomputable abbrev ChartKind.patchComplex : ChartKind → PlaneComplex /-- The model-boundary condition appropriate to a chart kind. A disk chart has no boundary stratum; in a half-disk chart it is the zero normal-coordinate line. -/ -def ChartKind.IsModelBoundary : (k : ChartKind) → Plane → Prop +@[expose] def ChartKind.IsModelBoundary : (k : ChartKind) → Plane → Prop | .disk, _ => False | .halfDisk, p => p 0 = 0 diff --git a/LeanPool/ClassificationOfSurfaces/Moise/CommonSubdivision.lean b/LeanPool/ClassificationOfSurfaces/Moise/CommonSubdivision.lean index a6c482986a..52839d09b6 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 @@ -268,7 +268,7 @@ theorem triangleCoords_nonneg_of_mem (T : M.Triangle) {p : Plane} · rw [M.triangleCoords_apply_of_notMem T hv p] /-- The barycentric-coordinate hyperplanes of all maximal triangles. -/ -noncomputable def coordinateLines : List (Plane →ᵃ[ℝ] ℝ) := +@[expose] noncomputable def coordinateLines : List (Plane →ᵃ[ℝ] ℝ) := (Finset.univ : Finset M.Triangle).toList.flatMap fun t => (Finset.univ : Finset (Fin 3)).toList.map (M.oppositeCoord t) @@ -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..3679777743 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, @@ -1066,26 +1066,26 @@ theorem repositionMap_isPL (position' : K.Vertex → Plane) exact K.repositionMap_affineOn_face position' hinj haff hface hs /-- Vertex positions for the cone on `K`, with `none` as the cone vertex. -/ -def conePosition (c : Plane) : Option K.Vertex → Plane +@[expose] def conePosition (c : Plane) : Option K.Vertex → Plane | none => c | some v => K.position v /-- The `coneWeights` declaration. -/ -def coneWeights (z : K.Vertex → ℝ) : Option K.Vertex → ℝ +@[expose] 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. -/ @@ -1158,7 +1158,7 @@ theorem conePosition_injective {c : Plane} (hc : c ∉ Set.range K.position) : | some w => exact congrArg some (K.position_injective h) /-- All nonempty faces of cones on the faces of `K`. -/ -def coneSimplexes : Finset (Finset (Option K.Vertex)) := +@[expose] def coneSimplexes : Finset (Finset (Option K.Vertex)) := K.simplexes.biUnion fun s => (insert none (K.liftFace s)).powerset.filter (·.Nonempty) @@ -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..f92165d268 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 @@ -56,7 +56,7 @@ open PlaneGraphRealization /-! ## Barycentric coordinates on the standard triangle -/ /-- The standard triangle vertices as an affine basis of the plane. -/ -noncomputable def stdTriBasis : AffineBasis (Fin 3) ℝ Plane := +@[expose] noncomputable def stdTriBasis : AffineBasis (Fin 3) ℝ Plane := planeAffineBasisOfTriple standardTriangleVertex standardTriangleVertex_affineIndependent @[simp] theorem stdTriBasis_apply (j : Fin 3) : @@ -377,7 +377,7 @@ theorem exists_comparisonScale (G : K.PlaneGraphRealization) (f : K.Face) : exact (hd₁close z hzmem x hx hzx).le /-- A canonical positive comparison scale for every face. -/ -noncomputable def comparisonScale (G : K.PlaneGraphRealization) (f : K.Face) : ℝ := +@[expose] noncomputable def comparisonScale (G : K.PlaneGraphRealization) (f : K.Face) : ℝ := Classical.choose (exists_comparisonScale G f) theorem comparisonScale_pos (G : K.PlaneGraphRealization) (f : K.Face) : 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..6b0f014d60 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,29 +29,30 @@ 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 used to find Moise's geometrically free triangles; by itself it does not exclude an additional isolated boundary vertex. -/ -def IsFreeTriangle (t : Finset M.Vertex) : Prop := +@[expose] 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 @@ -1253,7 +1254,7 @@ theorem card_incidentTriangles_eq_two_of_not_boundary {e t : Finset M.Vertex} omega /-- Two maximal triangles are edge-neighbors if they contain a common two-vertex face. -/ -def AreEdgeNeighbors (t u : Finset M.Vertex) : Prop := +@[expose] def AreEdgeNeighbors (t u : Finset M.Vertex) : Prop := ∃ e : Finset M.Vertex, e.card = 2 ∧ e ⊆ t ∧ e ⊆ u /-- A triangle with an edge-neighbor cannot have all three edges on the boundary. -/ @@ -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..023bd16d65 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) @@ -132,7 +132,7 @@ namespace TriangleMesh variable (M : TriangleMesh) /-- Order a triangle so that index `2` is a specified opposite vertex. -/ -noncomputable def freeTriangleOrder (T : M.Triangle) (k : Fin 3) : Fin 3 → Plane := +@[expose] noncomputable def freeTriangleOrder (T : M.Triangle) (k : Fin 3) : Fin 3 → Plane := fun i => M.position (M.orderedVertex T ((Equiv.swap 2 k) i)) theorem freeTriangleOrder_affineIndependent (T : M.Triangle) (k : Fin 3) : @@ -193,19 +193,19 @@ 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) /-- The `IsGeometricallyFreeTriangle` declaration. -/ -def IsGeometricallyFreeTriangle (T : M.Triangle) : Prop := +@[expose] def IsGeometricallyFreeTriangle (T : M.Triangle) : Prop := ∃ k : Fin 3, M.IsOneEdgeFreeTriangle T k ∨ M.IsTwoEdgeFreeTriangle T k /-- The relative interior of the base in the Figure 3.3 ordering misses both apex edges. -/ diff --git a/LeanPool/ClassificationOfSurfaces/Moise/FrontierGlue.lean b/LeanPool/ClassificationOfSurfaces/Moise/FrontierGlue.lean index a842673786..8ad89dcde8 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 @@ -28,13 +28,13 @@ open scoped _root_.Topology /-- A positive control on `U` is strongly positive when it has a positive lower bound on every compact subset of `U`. This is Moise's notation `phi >> 0`, stated without continuity. -/ -def StronglyPositiveOn {X : Type*} [TopologicalSpace X] +@[expose] def StronglyPositiveOn {X : Type*} [TopologicalSpace X] (U : Set X) (phi : X → ℝ) : Prop := ∀ C : Set X, IsCompact C → C ⊆ U → ∃ eps : ℝ, 0 < eps ∧ ∀ x ∈ C, eps ≤ phi x /-- Distance to the complement, the canonical frontier-vanishing control on an open set. -/ -noncomputable def frontierDistance {X : Type*} [PseudoMetricSpace X] +@[expose] noncomputable def frontierDistance {X : Type*} [PseudoMetricSpace X] (U : Set X) (x : X) : ℝ := Metric.infDist x Uᶜ @@ -150,7 +150,7 @@ noncomputable def frontierGlue {X Y : Type*} (U : Set X) (g h : X → Y) : X → /-- A replacement agrees asymptotically with the old map at the frontier of its open domain. This is the topology-only form of Moise's condition `phi(P) → 0`. -/ -def MatchesAtFrontier {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] +@[expose] def MatchesAtFrontier {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] (U : Set X) (g h : X → Y) : Prop := ∀ x ∈ frontier U, Tendsto g (nhdsWithin x U) (nhds (h x)) diff --git a/LeanPool/ClassificationOfSurfaces/Moise/GeometricTriangulation.lean b/LeanPool/ClassificationOfSurfaces/Moise/GeometricTriangulation.lean index bd7c3c17f1..7079016e83 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. -/ @@ -386,18 +386,18 @@ abbrev Face (faces : Finset (Finset Vertex)) := {t : Finset Vertex // t ∈ faces} /-- The two-vertex faces occurring in a finite triangle family. -/ -def edges (faces : Finset (Finset Vertex)) : Finset (Finset Vertex) := +@[expose] 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`. Unlike `FaceAdjacent`, this relation remembers the vertex star in which the adjacency step occurs. -/ -def FaceAdjacentAtVertex (faces : Finset (Finset Vertex)) (v : Vertex) +@[expose] def FaceAdjacentAtVertex (faces : Finset (Finset Vertex)) (v : Vertex) (f g : Face faces) : Prop := ∃ e : Finset Vertex, e.card = 2 ∧ v ∈ e ∧ e ⊆ f.1 ∧ e ⊆ g.1 @@ -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. @@ -511,7 +511,7 @@ def IsVertexStarConnected (faces : Finset (Finset Vertex)) : Prop := /-- Every pair of triangles incident to one vertex can be joined by a chain whose every adjacency step shares an edge containing that same vertex. -/ -def IsStrongVertexStarConnected (faces : Finset (Finset Vertex)) : Prop := +@[expose] def IsStrongVertexStarConnected (faces : Finset (Finset Vertex)) : Prop := ∀ (v : Vertex) (f g : Face faces), v ∈ f.1 → v ∈ g.1 → Relation.ReflTransGen (FaceAdjacentAtVertex faces v) f g @@ -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) @@ -815,7 +815,7 @@ theorem three_le_card_vertex [Nonempty S] : 3 ≤ Fintype.card T.Vertex := by _ = Fintype.card T.Vertex := Finset.card_univ /-- The edges of the triangulation: the 2-element subsets of its faces. -/ -def edges : Finset (Finset T.Vertex) := +@[expose] def edges : Finset (Finset T.Vertex) := T.faces.biUnion fun t => t.powersetCard 2 theorem card_of_mem_edges {e : Finset T.Vertex} (he : e ∈ T.edges) : e.card = 2 := by @@ -841,11 +841,11 @@ theorem triangle_card (t : T.Triangle) : t.1.card = 3 := T.faces_card t.1 t.2 /-- The chosen first endpoint of an edge. -/ -noncomputable def edgeSource (e : T.Edge) : T.Vertex := +@[expose] noncomputable def edgeSource (e : T.Edge) : T.Vertex := (Finset.card_eq_two.mp (T.edge_card e)).choose /-- The chosen second endpoint of an edge. -/ -noncomputable def edgeTarget (e : T.Edge) : T.Vertex := +@[expose] noncomputable def edgeTarget (e : T.Edge) : T.Vertex := (Finset.card_eq_two.mp (T.edge_card e)).choose_spec.choose theorem edgeSource_ne_edgeTarget (e : T.Edge) : T.edgeSource e ≠ T.edgeTarget e := diff --git a/LeanPool/ClassificationOfSurfaces/Moise/GraphPolygonalization.lean b/LeanPool/ClassificationOfSurfaces/Moise/GraphPolygonalization.lean index d912978192..8726511a24 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)} @@ -2084,7 +2084,7 @@ theorem graphBreakpointPoint_mem_support {h : Plane → Plane} K.edge_lineMap_mem_support b.1 (K.graphBreakpointParameter_mem hcont D C b) /-- The common source subdivision carrying all edgewise PL breakpoints. -/ -noncomputable def graphReplacementSubdivision {h : Plane → Plane} +@[expose] noncomputable def graphReplacementSubdivision {h : Plane → Plane} (hcont : ContinuousOn h K.support) (D : K.VertexDiskControl h) (C : K.CentralTubeControl hcont D) : PlaneComplex := K.markedEdgeSubdivision (K.graphBreakpointPoint hcont D C) @@ -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 [A, middleSourceMap_apply, AffineMap.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..69e08657a3 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 @@ -40,7 +40,7 @@ variable (A : K.CloseGraphApproximation (hcont := hcont) (hinj := hinj) (D := D) (C := C) ε) /-- The close graph embedding in standard coordinates on one face boundary. -/ -noncomputable def faceBoundaryMap (t : K.Face) : Plane → Plane := +@[expose] noncomputable def faceBoundaryMap (t : K.Face) : Plane → Plane := A.planeMap ∘ K.faceBoundaryMap (hcont := hcont) (hinj := hinj) (D := D) (C := C) t diff --git a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicCloseGraphApproximation.lean b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicCloseGraphApproximation.lean index 9fd995e12d..5fc67b2272 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 @@ -106,7 +106,7 @@ structure CloseGraphApproximation (ε : ℝ) where namespace CloseGraphApproximation /-- The final graph map on the intrinsic realization. -/ -noncomputable def intrinsicMap {ε : ℝ} (A : K.CloseGraphApproximation +@[expose] noncomputable def intrinsicMap {ε : ℝ} (A : K.CloseGraphApproximation (hcont := hcont) (hinj := hinj) (D := D) (C := C) ε) : K.realization → Plane := A.planeMap ∘ K.graphReplacementMap hcont hinj D C diff --git a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicComplex.lean b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicComplex.lean index 010cad2412..7dd91bf741 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 @@ -176,7 +177,7 @@ theorem exists_face_of_mem_edges {e : Finset K.Vertex} (he : e ∈ K.edges) : abbrev Edge : Type := {e : Finset K.Vertex // e ∈ K.edges} /-- The intrinsic one-skeleton, as the finite union of all barycentric edge carriers. -/ -def oneSkeleton : Set K.realization := +@[expose] def oneSkeleton : Set K.realization := {x | ∃ e : K.Edge, x ∈ K.faceCarrier e.1} theorem mem_oneSkeleton_iff (x : K.realization) : @@ -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 @@ -352,11 +353,11 @@ theorem edge_subset_parent (e : K.Edge) : e.1 ⊆ K.edgeParent e := (Classical.choose_spec (K.exists_face_of_mem_edges e.2)).2 /-- The chosen first endpoint of an intrinsic edge. -/ -noncomputable def edgeFirst (e : K.Edge) : K.Vertex := +@[expose] noncomputable def edgeFirst (e : K.Edge) : K.Vertex := (Finset.card_eq_two.mp (K.card_of_mem_edges e.2)).choose /-- The chosen second endpoint of an intrinsic edge. -/ -noncomputable def edgeSecond (e : K.Edge) : K.Vertex := +@[expose] noncomputable def edgeSecond (e : K.Edge) : K.Vertex := (Finset.card_eq_two.mp (K.card_of_mem_edges e.2)).choose_spec.choose theorem edgeFirst_ne_edgeSecond (e : K.Edge) : K.edgeFirst e ≠ K.edgeSecond e := @@ -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,20 +393,20 @@ 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. -/ -noncomputable def edgeFirstUsed (e : K.Edge) : K.UsedVertex := +@[expose] noncomputable def edgeFirstUsed (e : K.Edge) : K.UsedVertex := ⟨K.edgeFirst e, K.edgeParent e, K.edgeParent_mem e, K.edge_subset_parent e (K.edgeFirst_mem e)⟩ /-- The second endpoint as a used vertex. -/ -noncomputable def edgeSecondUsed (e : K.Edge) : K.UsedVertex := +@[expose] noncomputable def edgeSecondUsed (e : K.Edge) : K.UsedVertex := ⟨K.edgeSecond e, K.edgeParent e, K.edgeParent_mem e, K.edge_subset_parent e (K.edgeSecond_mem e)⟩ @@ -507,7 +508,7 @@ theorem injective_edgePath (e : K.Edge) : Function.Injective (K.edgePath e) := b simpa using hcoord /-- An ambient map restricted to the canonical interval of one intrinsic edge. -/ -noncomputable def mappedEdgePath (h : K.realization → Plane) (e : K.Edge) : +@[expose] noncomputable def mappedEdgePath (h : K.realization → Plane) (e : K.Edge) : Set.Icc (0 : ℝ) 1 → Plane := h ∘ K.edgePath e @@ -702,7 +703,7 @@ theorem disjoint_range_mappedEdgePath {h : K.realization → Plane} /-- `f` is affine on an intrinsic set when it is the restriction of an ambient affine map in barycentric coordinates. -/ -def IsAffineOnSetTo {E : Type*} [AddCommGroup E] [Module ℝ E] +@[expose] def IsAffineOnSetTo {E : Type*} [AddCommGroup E] [Module ℝ E] (f : K.realization → E) (A : Set K.realization) : Prop := ∃ a : (K.Vertex → ℝ) →ᵃ[ℝ] E, ∀ x : K.realization, x ∈ A → f x = a x.1 @@ -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..ab3a4434d3 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 @@ -113,7 +113,7 @@ noncomputable def faceBoundaryRight (t : K.Face) (fun i => h (K.vertexPoint (K.faceUsedVertex t i))) p /-- The union of the three complete replacement-edge carriers around one intrinsic face. -/ -def faceReplacementCarrier (t : K.Face) : Set Plane := +@[expose] def faceReplacementCarrier (t : K.Face) : Set Plane := ⋃ i : ZMod 3, (faceReplacementArc (hcont := hcont) (hinj := hinj) (D := D) (C := C) t i |>.completeCarrier) diff --git a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicFaceExtension.lean b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicFaceExtension.lean index c84e1f08a9..0f66125d1d 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 @@ -87,7 +87,7 @@ theorem facePlaneHomeomorph_symm_mem_oneSkeleton (t : K.Face) /-- The canonical lift of the standard triangular frontier to the global intrinsic one-skeleton. -/ -noncomputable def faceBoundaryLift (t : K.Face) : +@[expose] noncomputable def faceBoundaryLift (t : K.Face) : StandardFaceBoundary → K.oneSkeleton := fun p => ⟨((K.facePlaneHomeomorph t).symm ⟨p.1, standardFaceBoundary_mem_region p⟩).1, @@ -242,7 +242,7 @@ theorem faceStandardEdge_card (i : ZMod 3) : (faceStandardEdge i).card = 2 := by ((by decide : ∀ j : ZMod 3, j ≠ j + 1) i) /-- A cyclic side of the standard triangle, regarded as an edge of its one-skeleton. -/ -noncomputable def standardFaceEdgeFace (i : ZMod 3) : +@[expose] noncomputable def standardFaceEdgeFace (i : ZMod 3) : standardTrianglePlaneComplex.oneSkeleton.EdgeFace := ⟨faceStandardEdge i, Finset.mem_filter.mpr ⟨ standardTrianglePlaneComplex.mem_oneSkeleton_simplexes.mpr @@ -250,7 +250,7 @@ noncomputable def standardFaceEdgeFace (i : ZMod 3) : faceStandardEdge_card i⟩⟩ /-- The finite graph enumeration index of a cyclic standard side. -/ -noncomputable def standardFaceEdgeIndex (i : ZMod 3) : +@[expose] noncomputable def standardFaceEdgeIndex (i : ZMod 3) : Fin (Fintype.card standardTrianglePlaneComplex.oneSkeleton.EdgeFace) := Classical.choose (standardTrianglePlaneComplex.oneSkeleton.exists_edgeAt (standardFaceEdgeFace i)) @@ -364,13 +364,13 @@ theorem standardFaceEdgeFace_cellCarrier (i : ZMod 3) : rfl /-- The first oriented standard corner, typed as a vertex of the opaque one-skeleton object. -/ -noncomputable def faceEdgeFirstBoundaryVertex (t : K.Face) (i : ZMod 3) : +@[expose] noncomputable def faceEdgeFirstBoundaryVertex (t : K.Face) (i : ZMod 3) : standardTrianglePlaneComplex.oneSkeleton.Vertex := by change Fin 3 exact K.faceEdgeFirstIndex t i /-- The second oriented standard corner, typed as a vertex of the opaque one-skeleton object. -/ -noncomputable def faceEdgeSecondBoundaryVertex (t : K.Face) (i : ZMod 3) : +@[expose] noncomputable def faceEdgeSecondBoundaryVertex (t : K.Face) (i : ZMod 3) : standardTrianglePlaneComplex.oneSkeleton.Vertex := by change Fin 3 exact K.faceEdgeSecondIndex t i @@ -421,7 +421,7 @@ theorem standardFaceEdge_endpoint_order (t : K.Face) (i : ZMod 3) : /-- The intrinsic edge parameter, pulled back as an ambient affine coordinate on the standard face plane. -/ -noncomputable def faceEdgeParameterAffine (t : K.Face) (i : ZMod 3) : +@[expose] noncomputable def faceEdgeParameterAffine (t : K.Face) (i : ZMod 3) : Plane →ᵃ[ℝ] ℝ := (K.edgeCoordinateAffine (K.faceEdge t i)).comp (K.facePlaneInverseAffine t) 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..853f027a72 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 @@ -42,7 +42,7 @@ theorem standardTriangle_univ_mem_cells : decide /-- The unique maximal face of the standard triangle mesh. -/ -noncomputable def standardTriangleMeshFace : +@[expose] noncomputable def standardTriangleMeshFace : standardTrianglePlaneComplex.toTriangleMesh.Triangle := ⟨Finset.univ, standardTriangle_univ_mem_cells⟩ @@ -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) @@ -471,7 +471,7 @@ theorem faceStandardEdge_eq_endpointIndices (t : K.Face) (i : ZMod 3) : K.faceVertexEmbedding_faceEdgeSecondIndex, K.edge_eq_pair] /-- The standard source point on a face side, oriented by the global intrinsic edge ordering. -/ -noncomputable def faceEdgeSourcePoint (t : K.Face) (i : ZMod 3) (r : ℝ) : Plane := +@[expose] noncomputable def faceEdgeSourcePoint (t : K.Face) (i : ZMod 3) (r : ℝ) : Plane := AffineMap.lineMap (standardTriangleVertex (K.faceEdgeFirstIndex t i)) (standardTriangleVertex (K.faceEdgeSecondIndex t i)) r 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..1a56443133 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 @@ -609,7 +609,7 @@ noncomputable def exitData (A : K.CentralPolygonalArc hcont hinj D C e) : (K.edgeFirstUsed_ne_edgeSecondUsed e) /-- The `trimmedCarrier` declaration. -/ -def trimmedCarrier (A : K.CentralPolygonalArc hcont hinj D C e) : Set Plane := +@[expose] def trimmedCarrier (A : K.CentralPolygonalArc hcont hinj D C e) : Set Plane := A.parameterization.curve '' Set.Icc A.exitData.left A.exitData.right theorem trimmedCarrier_subset_resolvedCarrier @@ -664,27 +664,27 @@ theorem trimmedCarrier_avoids_nonincident (Set.image_subset_range _ _) /-- The `leftEndpoint` declaration. -/ -noncomputable def leftEndpoint +@[expose] noncomputable def leftEndpoint (A : K.CentralPolygonalArc hcont hinj D C e) : Plane := A.parameterization.curve A.exitData.left /-- The `rightEndpoint` declaration. -/ -noncomputable def rightEndpoint +@[expose] noncomputable def rightEndpoint (A : K.CentralPolygonalArc hcont hinj D C e) : Plane := A.parameterization.curve A.exitData.right /-- The `leftSpoke` declaration. -/ -noncomputable def leftSpoke +@[expose] noncomputable def leftSpoke (A : K.CentralPolygonalArc hcont hinj D C e) : Set Plane := segment ℝ (h (K.edgeFirstPoint e)) A.leftEndpoint /-- The `rightSpoke` declaration. -/ -noncomputable def rightSpoke +@[expose] noncomputable def rightSpoke (A : K.CentralPolygonalArc hcont hinj D C e) : Set Plane := segment ℝ A.rightEndpoint (h (K.edgeSecondPoint e)) /-- The complete replacement carrier of one intrinsic edge. -/ -noncomputable def completeCarrier +@[expose] noncomputable def completeCarrier (A : K.CentralPolygonalArc hcont hinj D C e) : Set Plane := A.leftSpoke ∪ A.trimmedCarrier ∪ A.rightSpoke @@ -724,7 +724,7 @@ theorem rightEndpoint_on_sphere A.exitData.right_on_sphere /-- The trimmed polygonal middle as a path. -/ -noncomputable def middlePath (A : K.CentralPolygonalArc hcont hinj D C e) : +@[expose] noncomputable def middlePath (A : K.CentralPolygonalArc hcont hinj D C e) : Path A.leftEndpoint A.rightEndpoint where toFun t := A.parameterization.curve (Path.segment A.exitData.left A.exitData.right t) @@ -758,7 +758,7 @@ theorem range_middlePath (A : K.CentralPolygonalArc hcont hinj D C e) : exact ⟨t, rfl⟩ /-- The complete polygonal replacement path for one intrinsic edge. -/ -noncomputable def completePath (A : K.CentralPolygonalArc hcont hinj D C e) : +@[expose] noncomputable def completePath (A : K.CentralPolygonalArc hcont hinj D C e) : Path (h (K.edgeFirstPoint e)) (h (K.edgeSecondPoint e)) := (Path.segment (h (K.edgeFirstPoint e)) A.leftEndpoint).trans (A.middlePath.trans (Path.segment A.rightEndpoint (h (K.edgeSecondPoint e)))) @@ -1333,7 +1333,7 @@ theorem faceReplacementCarrier_inter_next {h : K.realization → Plane} simp [IntrinsicTwoComplex.faceUsedVertex, add_assoc] /-- A point is an active graph vertex when it is a canonical used-vertex point. -/ -def IsGraphVertexPoint (x : K.realization) : Prop := +@[expose] def IsGraphVertexPoint (x : K.realization) : Prop := ∃ v : K.UsedVertex, x = K.vertexPoint v /-- The unique unit-interval parameter of a point on an intrinsic edge. -/ @@ -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..00432835a3 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 @@ -108,14 +108,14 @@ noncomputable def replacementGraphArrangement : BrokenLineData (Set.univ : Set P (hcont := hcont) (hinj := hinj) (D := D) (C := C)) /-- Restrict the common arrangement to the actual replacement segments. -/ -noncomputable def replacementGraphBaseComplex : PlaneComplex := +@[expose] noncomputable def replacementGraphBaseComplex : PlaneComplex := (K.replacementGraphArrangement (hcont := hcont) (hinj := hinj) (D := D) (C := C)).arrangementMesh.toPlaneComplex |>.restrictToSet (K.replacementGraphCarrier (hcont := hcont) (hinj := hinj) (D := D) (C := C)) /-- The conforming finite plane graph complex of the simultaneous intrinsic replacement. -/ -noncomputable def replacementGraphComplex : PlaneComplex := +@[expose] noncomputable def replacementGraphComplex : PlaneComplex := (K.replacementGraphBaseComplex (hcont := hcont) (hinj := hinj) (D := D) (C := C)).oneSkeleton @@ -308,7 +308,7 @@ theorem replacementGraphComplex_support_eq_range : /-- The intrinsic one-skeleton is homeomorphic to the support of its conforming polygonal plane graph model. -/ -noncomputable def replacementGraphHomeomorph : +@[expose] noncomputable def replacementGraphHomeomorph : K.oneSkeleton ≃ₜ (K.replacementGraphComplex (hcont := hcont) (hinj := hinj) (D := D) (C := C)).support := diff --git a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicGraphPL.lean b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicGraphPL.lean index e0b6a89aa2..add1b4ae39 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 @@ -130,7 +130,7 @@ theorem edgeReplacementMap_eq_right {x : K.realization} ring /-- The second barycentric coordinate of an intrinsic edge, as an ambient affine map. -/ -noncomputable def edgeCoordinateAffine (K : IntrinsicTwoComplex) (e : K.Edge) : +@[expose] noncomputable def edgeCoordinateAffine (K : IntrinsicTwoComplex) (e : K.Edge) : (K.Vertex → ℝ) →ᵃ[ℝ] ℝ := (LinearMap.proj (K.edgeSecond e)).toAffineMap @@ -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 @@ -406,7 +406,7 @@ theorem leftSourcePoint_zero_lt_right : nlinarith [A.exitData.left_lt_right] /-- The two source points at which the middle polygonal path exits the endpoint disks. -/ -noncomputable def trimMark : Fin 2 → Plane +@[expose] noncomputable def trimMark : Fin 2 → Plane | ⟨0, _⟩ => A.leftSourcePoint | ⟨1, _⟩ => A.rightSourcePoint @@ -577,7 +577,7 @@ theorem trimSource_support : exact ⟨u, hu, hxu, huSegment⟩ /-- Remove the unused vertices retained by `restrictedTo`. -/ -noncomputable def trimActive : PlaneComplex := +@[expose] noncomputable def trimActive : PlaneComplex := PlaneComplex.active A.trimSource theorem trimActive_support : @@ -644,7 +644,7 @@ theorem trimActive_map_affine : exact hx' /-- The finite target graph carried by the trimmed polygonal middle. -/ -noncomputable def trimTarget : PlaneComplex := +@[expose] noncomputable def trimTarget : PlaneComplex := A.trimActive.mapGraph A.parameterization.map A.trimActive_vertex_mem_support A.trimActive_map_injective A.trimActive_card_le_two A.trimActive_map_affine @@ -835,7 +835,7 @@ theorem completeChain_vertex_finish : simp [completeChain] /-- The finite plane complex carried by one complete replacement edge. -/ -noncomputable def completeTarget : PlaneComplex := +@[expose] noncomputable def completeTarget : PlaneComplex := A.completeChain.arrangementMesh.toPlaneComplex.restrictedTo A.completeCarrier /-- Every point of a complete replacement edge lies in a one-dimensional arrangement face diff --git a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicMarkedFan.lean b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicMarkedFan.lean index 571b287696..bf80a0c0c7 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 @@ -40,7 +40,7 @@ structure EdgeMarking where second_mem : ∀ e : K.Edge, K.edgeSecondPoint e ∈ points /-- Enlarge any prescribed finite point set by all abstract edge endpoints. -/ -noncomputable def EdgeMarking.ofFinset (P : Finset K.realization) : +@[expose] noncomputable def EdgeMarking.ofFinset (P : Finset K.realization) : K.EdgeMarking := by classical let first : Finset K.realization := @@ -1026,18 +1026,18 @@ theorem fanVertex_mem_faceCarrier (f : M.FanFace) {p : K.realization} hvt (K.faceEdge_subset_face f.1 f.2.1 hve) /-- The distinguished cone-center vertex of a marked fan triangle. -/ -noncomputable def fanCenterVertex (f : M.FanFace) : +@[expose] noncomputable def fanCenterVertex (f : M.FanFace) : {p // p ∈ M.fanFaceVertices f} := ⟨K.faceCenter f.1, by simp [fanFaceVertices]⟩ /-- The first base vertex of a marked fan triangle. -/ -noncomputable def fanFirstVertex (f : M.FanFace) : +@[expose] noncomputable def fanFirstVertex (f : M.FanFace) : {p // p ∈ M.fanFaceVertices f} := ⟨M.edgeIntervalFirst (K.faceEdge f.1 f.2.1) f.2.2, by simp [fanFaceVertices]⟩ /-- The second base vertex of a marked fan triangle. -/ -noncomputable def fanSecondVertex (f : M.FanFace) : +@[expose] noncomputable def fanSecondVertex (f : M.FanFace) : {p // p ∈ M.fanFaceVertices f} := ⟨M.edgeIntervalSecond (K.faceEdge f.1 f.2.1) f.2.2, by simp [fanFaceVertices]⟩ @@ -1086,7 +1086,7 @@ theorem fanFirstVertex_ne_second (f : M.FanFace) : (K.faceEdge f.1 f.2.1) f.2.2 (congrArg Subtype.val h) /-- The affine barycentric realization of one marked fan triangle inside its parent face. -/ -noncomputable def fanFaceMap (f : M.FanFace) : +@[expose] noncomputable def fanFaceMap (f : M.FanFace) : stdSimplex ℝ {p // p ∈ M.fanFaceVertices f} → K.realization := by classical intro x @@ -2672,14 +2672,14 @@ theorem fanExtendedCoordinates_eq_of_faceMap_eq hxy hxCenter hyCenter /-- The finite set of every geometric point used as a marked fan vertex. -/ -noncomputable def fanVertices : Finset K.realization := +@[expose] noncomputable def fanVertices : Finset K.realization := (Finset.univ : Finset M.FanFace).biUnion M.fanFaceVertices /-- Geometric vertices occurring in the global marked fan family. -/ abbrev FanVertex := {p : K.realization // p ∈ M.fanVertices} /-- Include the three local vertices of one fan face in the global used-vertex type. -/ -noncomputable def fanVertexEmbedding (f : M.FanFace) : +@[expose] noncomputable def fanVertexEmbedding (f : M.FanFace) : {p // p ∈ M.fanFaceVertices f} ↪ M.FanVertex where toFun p := ⟨p.1, Finset.mem_biUnion.mpr ⟨f, Finset.mem_univ f, p.2⟩⟩ @@ -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) @@ -2710,15 +2710,15 @@ theorem mem_globalFanFaceVertices_iff (f : M.FanFace) (v : M.FanVertex) : rfl /-- The center vertex of a fan face, included in the global fan-vertex type. -/ -noncomputable def globalFanCenter (f : M.FanFace) : M.FanVertex := +@[expose] noncomputable def globalFanCenter (f : M.FanFace) : M.FanVertex := M.fanVertexEmbedding f (M.fanCenterVertex f) /-- The first base vertex of a fan face, included in the global fan-vertex type. -/ -noncomputable def globalFanFirst (f : M.FanFace) : M.FanVertex := +@[expose] noncomputable def globalFanFirst (f : M.FanFace) : M.FanVertex := M.fanVertexEmbedding f (M.fanFirstVertex f) /-- The second base vertex of a fan face, included in the global fan-vertex type. -/ -noncomputable def globalFanSecond (f : M.FanFace) : M.FanVertex := +@[expose] noncomputable def globalFanSecond (f : M.FanFace) : M.FanVertex := M.fanVertexEmbedding f (M.fanSecondVertex f) @[simp] theorem globalFanCenter_val (f : M.FanFace) : @@ -2792,7 +2792,7 @@ theorem eq_globalFanBase_of_card_two_of_subset_of_center_notMem simp [hne] /-- Relabel global vertices of one face by their underlying intrinsic points. -/ -noncomputable def fanFaceVertexEquiv (f : M.FanFace) : +@[expose] noncomputable def fanFaceVertexEquiv (f : M.FanFace) : {v // v ∈ M.globalFanFaceVertices f} ≃ {p // p ∈ M.fanFaceVertices f} where toFun v := ⟨v.1.1, @@ -2893,7 +2893,7 @@ theorem fanRelabel_extended_eq_iff extendFaceCoordinates_of_notMem _ _ hpg] /-- One marked fan face parametrized by the global used-vertex type. -/ -noncomputable def globalFanFaceMap (f : M.FanFace) : +@[expose] noncomputable def globalFanFaceMap (f : M.FanFace) : stdSimplex ℝ {v // v ∈ M.globalFanFaceVertices f} → K.realization := fun x ↦ M.fanFaceMap f (M.fanRelabelSimplex f x) @@ -3320,7 +3320,7 @@ theorem markedFanLocallyFiniteTriangleComplex_support : exact ⟨x, hx⟩ /-- The finite geometric triangulation of the old realization induced by all global edge marks. -/ -noncomputable def markedFanGeometricTriangulation : +@[expose] noncomputable def markedFanGeometricTriangulation : GeometricTriangulation K.realization := M.markedFanLocallyFiniteTriangleComplex.toGeometricTriangulation M.markedFanLocallyFiniteTriangleComplex_support @@ -3333,7 +3333,7 @@ noncomputable def markedFanGeometricTriangulation : /-- The same evaluation homeomorphism with its source stated directly as the compact intrinsic complex, avoiding any projection opacity through `GeometricTriangulation`. -/ -noncomputable def markedFanHomeomorph : +@[expose] noncomputable def markedFanHomeomorph : M.markedFanLocallyFiniteTriangleComplex.compactIntrinsic.realization ≃ₜ K.realization := by let L := M.markedFanLocallyFiniteTriangleComplex 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..d4c9edc80d 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 @@ -1142,12 +1142,12 @@ variable (M : TriangleMesh) (f : Plane →ᵃ[ℝ] ℝ) abbrev Triangle := {t : Finset M.Vertex // t ∈ M.triangles} /-- A proof-independent ordering of the three vertices of a maximal triangle. -/ -noncomputable def triangleEquiv (t : M.Triangle) : t.1 ≃ Fin 3 := +@[expose] noncomputable def triangleEquiv (t : M.Triangle) : t.1 ≃ Fin 3 := Fintype.equivFinOfCardEq (by 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..8350795cd3 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 @@ -35,7 +35,7 @@ variable {S : Type*} [TopologicalSpace S] {K : LocallyFiniteTriangleComplex S} namespace FacePLFilling /-- A standard-triangle filling transported back to the native simplex of its source face. -/ -noncomputable def faceMap {f : K.Face} (F : K.FacePLFilling (G := G) f) : +@[expose] noncomputable def faceMap {f : K.Face} (F : K.FacePLFilling (G := G) f) : K.ClosedFace f → Plane := fun x ↦ F.map (K.facePlaneHomeomorph f x).1 @@ -452,7 +452,7 @@ theorem locallyFinite_faceInSupport : exact K.faceInSupport_eq_preimage f /-- The image of one source face, regarded as a subset of the permitted open plane region. -/ -def PlaneGraphRealization.faceImageInRegion (G : K.PlaneGraphRealization) +@[expose] def PlaneGraphRealization.faceImageInRegion (G : K.PlaneGraphRealization) (f : K.Face) : Set G.region := {q | q.1 ∈ G.map '' faceInSupport (K := K) f} @@ -496,7 +496,7 @@ theorem isEmbedding_faceToSupport [T2Space S] (f : K.Face) : (fun x ↦ Set.mem_iUnion.mpr ⟨f, Set.mem_range_self x⟩) /-- A closed abstract face is homeomorphic to its carrier inside the whole support. -/ -noncomputable def faceToSupportHomeomorph [T2Space S] (f : K.Face) : +@[expose] noncomputable def faceToSupportHomeomorph [T2Space S] (f : K.Face) : K.ClosedFace f ≃ₜ faceInSupport (K := K) f := (K.isEmbedding_faceToSupport f).toHomeomorph @@ -507,7 +507,7 @@ noncomputable def faceToSupportHomeomorph [T2Space S] (f : K.Face) : variable [T2Space S] /-- The coherent cellwise filling as a map into the support of the assembled plane complex. -/ -noncomputable def polygonalReplacementMap (H : K.CellwiseCompatibility G) : +@[expose] noncomputable def polygonalReplacementMap (H : K.CellwiseCompatibility G) : K.support → (K.polygonalReplacementComplex H).support := fun p ↦ ⟨⟨(K.facePLFilling (G := G) (K.supportFace p)).faceMap (K.supportFacePoint p), H.closedRegions_mem_region (K.supportFace p) <| @@ -659,7 +659,7 @@ theorem polygonalReplacementMap_apply_inverse K.polygonalReplacementMap_faceToSupport H f x] /-- The source support and its coherent polygonal replacement are canonically homeomorphic. -/ -noncomputable def polygonalReplacementHomeomorph (H : K.CellwiseCompatibility G) : +@[expose] noncomputable def polygonalReplacementHomeomorph (H : K.CellwiseCompatibility G) : K.support ≃ₜ (K.polygonalReplacementComplex H).support where toFun := K.polygonalReplacementMap H invFun := K.polygonalReplacementInverse H diff --git a/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteControlledApproximation.lean b/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteControlledApproximation.lean index 8929c8abf1..b54993c955 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 @@ -43,7 +43,7 @@ def PlaneGraphRealization.ControlsStayInRegion (G : K.PlaneGraphRealization) /-- A global bound and a frontier-relative bound sufficient to control a locally finite family of polygonal face fillings. -/ -def PlaneGraphRealization.UniformFrontierControl (G : K.PlaneGraphRealization) +@[expose] def PlaneGraphRealization.UniformFrontierControl (G : K.PlaneGraphRealization) (phi : K.support → ℝ) : Prop := (∀ p, phi p ≤ 1) ∧ ∀ (_ : G.regionᶜ.Nonempty) (p : K.support), @@ -301,7 +301,7 @@ def PlaneGraphRealization.SourceCoordZeroCarriedByOneSkeleton /-- On every source triangle, the supporting-line locus is an exposed face with at most two vertices. This is the intrinsic condition which excludes a boundary chord: the zero locus in a triangle is either empty, a vertex, or an entire edge. -/ -def PlaneGraphRealization.FacewiseCoordZeroExposed +@[expose] def PlaneGraphRealization.FacewiseCoordZeroExposed (G : K.PlaneGraphRealization) : Prop := ∀ f : K.Face, ∃ b : Finset K.Vertex, b ⊆ K.faceVertices f ∧ b.card ≤ 2 ∧ diff --git a/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteFaceBoundary.lean b/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteFaceBoundary.lean index 427b8f6271..fa0028cbcf 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 @@ -112,7 +112,7 @@ noncomputable def faceBoundaryRight (t : K.Face) (fun i => G.vertexImage (K.faceVertex t i)) p /-- The union of the three complete replacement-edge carriers around one intrinsic face. -/ -def faceReplacementCarrier (t : K.Face) : Set Plane := +@[expose] def faceReplacementCarrier (t : K.Face) : Set Plane := ⋃ i : ZMod 3, (faceReplacementArc (G := G) t i |>.completeCarrier) diff --git a/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteFaceExtension.lean b/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteFaceExtension.lean index 31b1d0b994..6347948494 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 @@ -49,7 +49,7 @@ theorem facePlaneHomeomorph_symm_mem_faceSide (f : K.Face) (i : ZMod 3) rwa [heq] /-- The source-support point named by a standard face-boundary point. -/ -noncomputable def faceBoundarySupportPoint (f : K.Face) +@[expose] noncomputable def faceBoundarySupportPoint (f : K.Face) (p : StandardFaceBoundary) : K.support := faceToSupport (K := K) f ((K.facePlaneHomeomorph f).symm @@ -74,7 +74,7 @@ theorem faceBoundarySupportPoint_mem_oneSkeleton (f : K.Face) ⟨K.faceEdge f i, K.faceBoundarySupportPoint_mem_edge f i p hi⟩ /-- The canonical lift of a standard triangular frontier to the source one-skeleton. -/ -noncomputable def faceBoundaryLift (f : K.Face) : +@[expose] noncomputable def faceBoundaryLift (f : K.Face) : StandardFaceBoundary → oneSkeletonInSupport (K := K) := fun p ↦ ⟨K.faceBoundarySupportPoint f p, K.faceBoundarySupportPoint_mem_oneSkeleton f p⟩ @@ -334,14 +334,14 @@ theorem faceBoundarySubdivision_support (f : K.Face) : /-- The first globally oriented standard corner, typed as a vertex of the standard boundary graph. -/ -noncomputable def faceEdgeFirstBoundaryVertex (f : K.Face) (i : ZMod 3) : +@[expose] noncomputable def faceEdgeFirstBoundaryVertex (f : K.Face) (i : ZMod 3) : standardTrianglePlaneComplex.oneSkeleton.Vertex := by change Fin 3 exact K.faceEdgeFirstIndex f i /-- The second globally oriented standard corner, typed as a vertex of the standard boundary graph. -/ -noncomputable def faceEdgeSecondBoundaryVertex (f : K.Face) (i : ZMod 3) : +@[expose] noncomputable def faceEdgeSecondBoundaryVertex (f : K.Face) (i : ZMod 3) : standardTrianglePlaneComplex.oneSkeleton.Vertex := by change Fin 3 exact K.faceEdgeSecondIndex f i diff --git a/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteFaceFilling.lean b/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteFaceFilling.lean index 709ffc0f07..3c57a763d5 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 @@ -66,7 +66,7 @@ theorem exists_facePLFilling (f : K.Face) : }⟩ /-- A fixed certified PL filling for downstream locally finite gluing. -/ -noncomputable def facePLFilling (f : K.Face) : +@[expose] noncomputable def facePLFilling (f : K.Face) : K.FacePLFilling (G := G) f := Classical.choice (K.exists_facePLFilling (G := G) f) diff --git a/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteFaceModel.lean b/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteFaceModel.lean index e0c53fac43..36ef102d2a 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 @@ -44,14 +44,14 @@ theorem standardFaceBoundary_mem_region (p : StandardFaceBoundary) : abbrev ClosedFace (f : K.Face) := stdSimplex ℝ {v // v ∈ K.faceVertices f} /-- Reindex native face coordinates by the chosen cyclic `Fin 3` ordering. -/ -noncomputable def faceReindexToStandard (f : K.Face) (x : K.ClosedFace f) : +@[expose] noncomputable def faceReindexToStandard (f : K.Face) (x : K.ClosedFace f) : stdSimplex ℝ (Fin 3) := by refine ⟨fun i ↦ x (K.faceVertexEquiv f i), ?_, ?_⟩ · exact fun i ↦ x.2.1 _ · exact (K.faceVertexEquiv f).sum_comp (fun v ↦ x v) |>.trans x.2.2 /-- Undo the cyclic coordinate reindexing. -/ -noncomputable def faceReindexFromStandard (f : K.Face) (z : stdSimplex ℝ (Fin 3)) : +@[expose] noncomputable def faceReindexFromStandard (f : K.Face) (z : stdSimplex ℝ (Fin 3)) : K.ClosedFace f := by refine ⟨fun v ↦ z ((K.faceVertexEquiv f).symm v), ?_, ?_⟩ · exact fun v ↦ z.2.1 _ @@ -86,7 +86,7 @@ theorem continuous_faceReindexFromStandard (f : K.Face) : (continuous_apply ((K.faceVertexEquiv f).symm v)).comp continuous_subtype_val /-- Native face coordinates are canonically homeomorphic to `stdSimplex ℝ (Fin 3)`. -/ -noncomputable def faceReindexHomeomorph (f : K.Face) : +@[expose] noncomputable def faceReindexHomeomorph (f : K.Face) : K.ClosedFace f ≃ₜ stdSimplex ℝ (Fin 3) where toFun := K.faceReindexToStandard f invFun := K.faceReindexFromStandard f @@ -97,12 +97,12 @@ noncomputable def faceReindexHomeomorph (f : K.Face) : /-- Insert a standard simplex point into the one-face intrinsic realization used by the standard plane triangle complex. -/ -noncomputable def standardSimplexToRealization (z : stdSimplex ℝ (Fin 3)) : +@[expose] noncomputable def standardSimplexToRealization (z : stdSimplex ℝ (Fin 3)) : standardTrianglePlaneComplex.toIntrinsic.realization := ⟨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⟩ @@ -118,7 +118,7 @@ noncomputable def standardRealizationToSimplex /-- The standard simplex and the canonical intrinsic realization of the standard triangle are the same topological simplex. -/ -noncomputable def standardSimplexRealizationHomeomorph : +@[expose] noncomputable def standardSimplexRealizationHomeomorph : stdSimplex ℝ (Fin 3) ≃ₜ standardTrianglePlaneComplex.toIntrinsic.realization where toFun := standardSimplexToRealization invFun := standardRealizationToSimplex @@ -148,7 +148,7 @@ theorem edgeSecond_faceEdge_mem_face (f : K.Face) (i : ZMod 3) : K.faceEdge_subset_faceVertices f i (K.edgeSecond_mem (K.faceEdge f i)) /-- The standard plane realization of one locally finite closed face. -/ -noncomputable def facePlaneHomeomorph (f : K.Face) : +@[expose] noncomputable def facePlaneHomeomorph (f : K.Face) : K.ClosedFace f ≃ₜ standardTrianglePlaneComplex.support := (K.faceReindexHomeomorph f).trans (standardSimplexRealizationHomeomorph.trans @@ -214,7 +214,7 @@ theorem faceStandardEdge_eq_endpointIndices (f : K.Face) (i : ZMod 3) : exact Finset.pair_comm _ _ /-- The standard source point on a face side, oriented by the global edge ordering. -/ -noncomputable def faceEdgeSourcePoint (f : K.Face) (i : ZMod 3) (r : ℝ) : Plane := +@[expose] noncomputable def faceEdgeSourcePoint (f : K.Face) (i : ZMod 3) (r : ℝ) : Plane := AffineMap.lineMap (standardTriangleVertex (K.faceEdgeFirstIndex f i)) (standardTriangleVertex (K.faceEdgeSecondIndex f i)) r @@ -276,7 +276,7 @@ theorem faceEdgeSourcePoint_image_Icc (f : K.Face) (i : ZMod 3) : rfl /-- Native face-simplex points supported on cyclic edge `i`. -/ -def faceSide (f : K.Face) (i : ZMod 3) : Set (K.ClosedFace f) := +@[expose] def faceSide (f : K.Face) (i : ZMod 3) : Set (K.ClosedFace f) := {x | ∀ v, v.1 ∉ (K.faceEdge f i).1 → x v = 0} private theorem eq_edgeFirst_or_edgeSecond (e : K.Edge) {v : K.Vertex} @@ -389,7 +389,7 @@ theorem faceMap_mem_edgeCarrier_of_mem_faceSide (f : K.Face) (i : ZMod 3) (K.faceEdge_subset_faceVertices f i) x hx /-- Include edge-local simplex coordinates in any incident maximal face. -/ -noncomputable def edgeSimplexInFace (f : K.Face) (e : K.Edge) +@[expose] noncomputable def edgeSimplexInFace (f : K.Face) (e : K.Edge) (hef : e.1 ⊆ K.faceVertices f) (z : stdSimplex ℝ {v // v ∈ e.1}) : K.ClosedFace f := stdSimplex.map (fun v : {v // v ∈ e.1} ↦ ⟨v.1, hef v.2⟩) z diff --git a/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteGraphApproximation.lean b/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteGraphApproximation.lean index 7feb3010a5..5210c21107 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 @@ -76,7 +76,7 @@ variable {K : LocallyFiniteTriangleComplex S} (G : K.PlaneGraphRealization) /-- Reduce the quantitative replacement controls without changing the realized map, its target region, or any local-finiteness data. -/ -def withApproximationControls +@[expose] def withApproximationControls (vertexControl : K.Vertex → ℝ) (hvertex : ∀ v, 0 < vertexControl v) (edgeControl : K.Edge → ℝ) (hedge : ∀ e, 0 < edgeControl e) : K.PlaneGraphRealization where @@ -103,17 +103,17 @@ def withApproximationControls (G.withApproximationControls vertexControl hvertex edgeControl hedge).map = G.map := rfl /-- Include an edge point into the whole support. -/ -def edgeToSupport (e : K.Edge) (p : K.edgeCarrier e) : K.support := +@[expose] def edgeToSupport (e : K.Edge) (p : K.edgeCarrier e) : K.support := ⟨p.1, by apply Set.mem_iUnion.mpr exact ⟨K.edgeFace e, K.edgeCarrier_subset_faceCarrier e p.2⟩⟩ /-- The image of a global vertex in chart coordinates. -/ -noncomputable def vertexImage (v : K.Vertex) : Plane := +@[expose] noncomputable def vertexImage (v : K.Vertex) : Plane := G.map ⟨K.vertexPoint v, K.vertexPoint_mem_support v⟩ /-- The image of an edge carrier in chart coordinates. -/ -def edgeImage (e : K.Edge) : Set Plane := +@[expose] def edgeImage (e : K.Edge) : Set Plane := G.map '' {p : K.support | p.1 ∈ K.edgeCarrier e} theorem edgeImage_eq_structure_family (e : K.Edge) : @@ -248,7 +248,7 @@ theorem isClosed_edgeImage (e : K.Edge) : IsClosed (G.edgeImage e) := (G.isCompact_edgeImage e).isClosed /-- The canonical interval parametrization of an edge, included into the source support. -/ -noncomputable def edgePathInSupport (e : K.Edge) (r : Set.Icc (0 : ℝ) 1) : K.support := +@[expose] noncomputable def edgePathInSupport (e : K.Edge) (r : Set.Icc (0 : ℝ) 1) : K.support := edgeToSupport (K := K) e ⟨K.edgePath e r, by rw [← K.range_edgePath e]; exact Set.mem_range_self r⟩ @@ -264,7 +264,7 @@ theorem edgePathInSupport_injective (e : K.Edge) : exact congrArg Subtype.val hrs /-- The charted embedded arc carried by one abstract edge. -/ -noncomputable def chartEdgePath (e : K.Edge) : Set.Icc (0 : ℝ) 1 → Plane := +@[expose] noncomputable def chartEdgePath (e : K.Edge) : Set.Icc (0 : ℝ) 1 → Plane := G.map ∘ edgePathInSupport (K := K) e theorem continuous_chartEdgePath (e : K.Edge) : Continuous (G.chartEdgePath e) := @@ -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 @@ -1896,7 +1896,7 @@ theorem exists_parameterization (A : G.CentralPolygonalArc e) : ⟨A.parameterizationData⟩ /-- The `parameterization` declaration. -/ -noncomputable def parameterization (A : G.CentralPolygonalArc e) : A.Parameterization := +@[expose] noncomputable def parameterization (A : G.CentralPolygonalArc e) : A.Parameterization := A.parameterizationData /-- Ordered exits of the resolved polygonal arc from the two variable-radius vertex disks. -/ @@ -1917,7 +1917,7 @@ noncomputable def exitData (A : G.CentralPolygonalArc e) : · exact G.disjoint_vertexDisks (K.edgeFirst_ne_edgeSecond e) /-- The `trimmedCarrier` declaration. -/ -def trimmedCarrier (A : G.CentralPolygonalArc e) : Set Plane := +@[expose] def trimmedCarrier (A : G.CentralPolygonalArc e) : Set Plane := A.parameterization.curve '' Set.Icc A.exitData.left A.exitData.right theorem trimmedCarrier_subset_resolvedCarrier (A : G.CentralPolygonalArc e) : @@ -1953,23 +1953,23 @@ theorem trimmedCarrier_avoids_second (A : G.CentralPolygonalArc e) {x : Plane} · exact lt_of_le_of_ne ht.2 fun heq => hxright (by rw [heq]) /-- The `leftEndpoint` declaration. -/ -noncomputable def leftEndpoint (A : G.CentralPolygonalArc e) : Plane := +@[expose] noncomputable def leftEndpoint (A : G.CentralPolygonalArc e) : Plane := A.parameterization.curve A.exitData.left /-- The `rightEndpoint` declaration. -/ -noncomputable def rightEndpoint (A : G.CentralPolygonalArc e) : Plane := +@[expose] noncomputable def rightEndpoint (A : G.CentralPolygonalArc e) : Plane := A.parameterization.curve A.exitData.right /-- The `leftSpoke` declaration. -/ -noncomputable def leftSpoke (A : G.CentralPolygonalArc e) : Set Plane := +@[expose] noncomputable def leftSpoke (A : G.CentralPolygonalArc e) : Set Plane := segment ℝ (G.vertexImage (K.edgeFirst e)) A.leftEndpoint /-- The `rightSpoke` declaration. -/ -noncomputable def rightSpoke (A : G.CentralPolygonalArc e) : Set Plane := +@[expose] noncomputable def rightSpoke (A : G.CentralPolygonalArc e) : Set Plane := segment ℝ A.rightEndpoint (G.vertexImage (K.edgeSecond e)) /-- The `completeCarrier` declaration. -/ -noncomputable def completeCarrier (A : G.CentralPolygonalArc e) : Set Plane := +@[expose] noncomputable def completeCarrier (A : G.CentralPolygonalArc e) : Set Plane := A.leftSpoke ∪ A.trimmedCarrier ∪ A.rightSpoke theorem leftEndpoint_on_sphere (A : G.CentralPolygonalArc e) : @@ -2114,7 +2114,7 @@ theorem leftSpoke_disjoint_rightSpoke (A : G.CentralPolygonalArc e) : A.leftSpoke_subset_vertexDisk A.rightSpoke_subset_vertexDisk /-- The trimmed resolved middle, with its parameter interval normalized to the unit interval. -/ -noncomputable def middlePath (A : G.CentralPolygonalArc e) : +@[expose] noncomputable def middlePath (A : G.CentralPolygonalArc e) : Path A.leftEndpoint A.rightEndpoint where toFun t := A.parameterization.curve (Path.segment A.exitData.left A.exitData.right t) @@ -2164,7 +2164,7 @@ theorem middlePath_injective (A : G.CentralPolygonalArc e) : exact Path.segment_injective_of_ne A.exitData.left_lt_right.ne hparam /-- The complete polygonal replacement path of a locally finite abstract edge. -/ -noncomputable def completePath (A : G.CentralPolygonalArc e) : +@[expose] noncomputable def completePath (A : G.CentralPolygonalArc e) : Path (G.vertexImage (K.edgeFirst e)) (G.vertexImage (K.edgeSecond e)) := (Path.segment (G.vertexImage (K.edgeFirst e)) A.leftEndpoint).trans (A.middlePath.trans @@ -2589,7 +2589,7 @@ end CentralPolygonalArc /-! ## Strongly-positive edge controls -/ /-- The carrier of an abstract edge, included into the whole source support. -/ -def edgeInSupport (e : K.Edge) : Set K.support := +@[expose] def edgeInSupport (e : K.Edge) : Set K.support := Set.range (edgeToSupport (K := K) e) theorem isCompact_edgeInSupport (e : K.Edge) : @@ -2679,6 +2679,7 @@ noncomputable def ofIsOpenEmbedding (f : K.support → Plane) /-- Build a plane graph realization when the source image is closed in a specified open perturbation region. Unlike `ofIsOpenEmbedding`, this permits the source image itself to have boundary, which is the form used on a Rado chart overlap. -/ +@[expose] noncomputable def ofEmbeddingInOpenRegion (V : Set Plane) (hV : IsOpen V) (f : K.support → Plane) (hf : _root_.Topology.IsEmbedding f) (hmem : ∀ p, f p ∈ V) @@ -2733,7 +2734,7 @@ theorem range_edgePathInSupport (e : K.Edge) : exact hr /-- Restrict the source edge path to its carrier inside the full support. -/ -noncomputable def edgePathInSupportToCarrier (e : K.Edge) : +@[expose] noncomputable def edgePathInSupportToCarrier (e : K.Edge) : Set.Icc (0 : ℝ) 1 → edgeInSupport (K := K) e := fun r ↦ ⟨edgePathInSupport (K := K) e r, by rw [← range_edgePathInSupport (K := K) e]; exact Set.mem_range_self r⟩ @@ -2757,7 +2758,7 @@ theorem edgePathInSupportToCarrier_surjective (e : K.Edge) : exact ⟨r, rfl⟩ /-- The canonical source interval of an edge, inside the support subtype. -/ -noncomputable def edgePathInSupportHomeomorph (e : K.Edge) : +@[expose] noncomputable def edgePathInSupportHomeomorph (e : K.Edge) : Set.Icc (0 : ℝ) 1 ≃ₜ edgeInSupport (K := K) e := by letI : T2Space K.support := G.isEmbedding.t2Space exact ((continuous_edgePathInSupportToCarrier (K := K) e).isClosedEmbedding @@ -2770,7 +2771,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) @@ -2846,7 +2847,7 @@ theorem replacementEdgeMap_vertex (e : K.Edge) (v : K.Vertex) (hve : v ∈ e.1) exact (G.replacementArc e).completePath.target /-- The source one-skeleton as a subspace of the complete support. -/ -def oneSkeletonInSupport : Set K.support := +@[expose] def oneSkeletonInSupport : Set K.support := ⋃ e : K.Edge, edgeInSupport (K := K) e /-- A chosen source edge carrying a one-skeleton point. -/ @@ -3257,7 +3258,7 @@ def IsPhiApproximation (phi : K.support → ℝ) (f : K.support → Plane) : Pro ∀ p, dist (f p) (G.map p) < phi p /-- The edge-mesh condition which converts setwise polygonal tubes into a pointwise control. -/ -def EdgeImagesControlled (phi : K.support → ℝ) : Prop := +@[expose] def EdgeImagesControlled (phi : K.support → ℝ) : Prop := ∀ e : K.Edge, ∀ p ∈ edgeInSupport (K := K) e, 2 * Metric.diam (G.edgeImage e) < phi p @@ -3307,7 +3308,7 @@ theorem edgeImagesControlled_of_diam_lt_controlRadius {phi : K.support → ℝ} exact (hsmall e).trans_le (edgeControlRadius_le (K := K) hphi e hp) /-- Include a maximal face into the whole source support. -/ -def faceToSupport (f : K.Face) +@[expose] def faceToSupport (f : K.Face) (p : stdSimplex ℝ {v // v ∈ K.faceVertices f}) : K.support := ⟨K.faceMap f p, Set.mem_iUnion.mpr ⟨f, Set.mem_range_self p⟩⟩ @@ -3317,7 +3318,7 @@ theorem continuous_faceToSupport (f : K.Face) : exact K.faceMap_continuous f /-- A face carrier as a compact subset of the whole source support. -/ -def faceInSupport (f : K.Face) : Set K.support := +@[expose] def faceInSupport (f : K.Face) : Set K.support := Set.range (faceToSupport (K := K) f) theorem isCompact_faceInSupport (f : K.Face) : diff --git a/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteGraphPL.lean b/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteGraphPL.lean index e2094d38f7..08aa435d93 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 @@ -124,7 +124,7 @@ noncomputable def rawEdgeMiddleBreakpoint (A.exitData.right - A.exitData.left) + 2) / 4 /-- The `edgeMiddleBreakpoint` declaration. -/ -noncomputable def edgeMiddleBreakpoint +@[expose] noncomputable def edgeMiddleBreakpoint (A : G.CentralPolygonalArc e) (v : A.parameterization.source.Vertex) : ℝ := max (1 / 2 : ℝ) (min (3 / 4 : ℝ) (rawEdgeMiddleBreakpoint A v)) @@ -183,7 +183,7 @@ abbrev EdgeBreakpoint (A : G.CentralPolygonalArc e) := Option (Option A.parameterization.source.Vertex) /-- The `edgeBreakpointParameter` declaration. -/ -noncomputable def edgeBreakpointParameter +@[expose] noncomputable def edgeBreakpointParameter (A : G.CentralPolygonalArc e) (b : EdgeBreakpoint A) : ℝ := match b with | none => 1 / 2 @@ -245,7 +245,7 @@ theorem leftSourcePoint_zero_lt_right : nlinarith [A.exitData.left_lt_right] /-- The two source points at which the middle polygonal path exits the endpoint disks. -/ -noncomputable def trimMark : Fin 2 → Plane +@[expose] noncomputable def trimMark : Fin 2 → Plane | ⟨0, _⟩ => A.leftSourcePoint | ⟨1, _⟩ => A.rightSourcePoint @@ -416,7 +416,7 @@ theorem trimSource_support : exact ⟨u, hu, hxu, huSegment⟩ /-- Remove the unused vertices retained by `restrictedTo`. -/ -noncomputable def trimActive : PlaneComplex := +@[expose] noncomputable def trimActive : PlaneComplex := PlaneComplex.active A.trimSource theorem trimActive_support : @@ -483,7 +483,7 @@ theorem trimActive_map_affine : exact hx' /-- The finite target graph carried by the trimmed polygonal middle. -/ -noncomputable def trimTarget : PlaneComplex := +@[expose] noncomputable def trimTarget : PlaneComplex := A.trimActive.mapGraph A.parameterization.map A.trimActive_vertex_mem_support A.trimActive_map_injective A.trimActive_card_le_two A.trimActive_map_affine diff --git a/LeanPool/ClassificationOfSurfaces/Moise/LocallyFinitePLApproximation.lean b/LeanPool/ClassificationOfSurfaces/Moise/LocallyFinitePLApproximation.lean index 956b4f5ae1..b8245d2816 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 @@ -56,7 +56,7 @@ theorem vertexSupportPoint_mem_faceInSupport_iff (f : K.Face) (v : K.Vertex) : /-- The original plane embedding, written in the standard coordinates of one face. Values outside the standard closed triangle are irrelevant. -/ -noncomputable def faceOriginalMap (G : K.PlaneGraphRealization) (f : K.Face) +@[expose] noncomputable def faceOriginalMap (G : K.PlaneGraphRealization) (f : K.Face) (p : Plane) : Plane := by classical exact if hp : p ∈ standardFaceRegion then @@ -88,7 +88,7 @@ theorem faceOriginalMap_mem_face_image (f : K.Face) (p : standardFaceRegion) : /-- The replacement graph is close to the original embedding on each face boundary, with a radius allowed to depend on the face. This is the quantitative hypothesis actually used in Moise's side-preservation argument. -/ -def FaceBoundariesClose (G : K.PlaneGraphRealization) (r : K.Face → ℝ) : Prop := +@[expose] def FaceBoundariesClose (G : K.PlaneGraphRealization) (r : K.Face → ℝ) : Prop := ∀ (f : K.Face) (q : StandardFaceBoundary), dist (G.graphReplacementMap (K.faceBoundaryLift f q)) (faceOriginalMap G f q.1) < r f @@ -96,7 +96,7 @@ def FaceBoundariesClose (G : K.PlaneGraphRealization) (r : K.Face → ℝ) : Pro /-- A face-indexed radius separates every nonincident vertex from the original embedded face. The closed-ball/closed-thickening formulation is exactly what the bounded Tietze extension argument consumes. -/ -def FaceVertexThickeningsSeparated (G : K.PlaneGraphRealization) +@[expose] def FaceVertexThickeningsSeparated (G : K.PlaneGraphRealization) (r : K.Face → ℝ) : Prop := ∀ (f : K.Face) (v : K.Vertex), v ∉ K.faceVertices f → Disjoint (Metric.closedBall (G.vertexImage v) (r f)) @@ -190,7 +190,7 @@ theorem exists_faceVertexSeparationRadius (f : K.Face) : · exact Set.Subset.rfl /-- A canonical positive side-separation radius for every face. -/ -noncomputable def faceVertexSeparationRadius (G : K.PlaneGraphRealization) +@[expose] noncomputable def faceVertexSeparationRadius (G : K.PlaneGraphRealization) (f : K.Face) : ℝ := Classical.choose (exists_faceVertexSeparationRadius (G := G) f) @@ -305,7 +305,7 @@ theorem faceBoundariesClose_of_edgeFaceSeparation_control /-- The exact facewise estimate needed to control a Schoenflies filling. Every point of a replacement boundary is compared first with its original boundary point and then with an arbitrary point of the same source face. -/ -def FaceBoundariesControlled (G : K.PlaneGraphRealization) +@[expose] def FaceBoundariesControlled (G : K.PlaneGraphRealization) (phi : K.support → ℝ) : Prop := ∀ (f : K.Face) (p : K.support), p ∈ faceInSupport (K := K) f → ∀ q : StandardFaceBoundary, @@ -487,7 +487,7 @@ theorem stronglyPositiveOn_vertexSeparationControl : ⟨p, mem_facesContaining.mp hfp, hp⟩ /-- The vertex-side compatibility condition used in Moise's side-preservation argument. -/ -def FaceFillingsVerticesAvoidClosedRegions (G : K.PlaneGraphRealization) : Prop := +@[expose] def FaceFillingsVerticesAvoidClosedRegions (G : K.PlaneGraphRealization) : Prop := ∀ (f : K.Face) (v : K.Vertex), v ∉ K.faceVertices f → G.vertexImage v ∉ (K.facePolygonalCircle (G := G) f).closedRegion diff --git a/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteSidePreservation.lean b/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteSidePreservation.lean index 9ef6a6ca95..86f6a44529 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 @@ -86,7 +86,7 @@ theorem mem_faceInSupport_of_graphReplacement_mem_facePolygonalCircle exact K.faceBoundaryLift_mem_faceInSupport f q' /-- Include the interval parametrization of an edge in the source one-skeleton. -/ -noncomputable def edgePathInOneSkeleton (e : K.Edge) (r : Set.Icc (0 : ℝ) 1) : +@[expose] noncomputable def edgePathInOneSkeleton (e : K.Edge) (r : Set.Icc (0 : ℝ) 1) : oneSkeletonInSupport (K := K) := ⟨edgePathInSupport (K := K) e r, Set.mem_iUnion.mpr ⟨e, by diff --git a/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteTriangulation.lean b/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteTriangulation.lean index 9177b0a8ca..effb0189f6 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,10 +147,10 @@ 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 +@[expose] noncomputable def relabelFaceSimplex {A B : Type*} (e : A ↪ B) (t : Finset A) (x : stdSimplex ℝ {b // b ∈ t.map e}) : @@ -308,7 +308,7 @@ noncomputable def univMapSubtypeEquiv right_inv := fun _ ↦ rfl } /-- Pull simplex coordinates on the image of a finite type back to that finite type. -/ -noncomputable def relabelUnivSimplex +@[expose] noncomputable def relabelUnivSimplex {A B : Type*} [Fintype A] (e : A ↪ B) (x : stdSimplex ℝ {b // b ∈ (Finset.univ : Finset A).map e}) : @@ -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. -/ @@ -516,7 +515,7 @@ end TriangleFamily namespace Moise /-- Push a geometric realization forward along an injective relabeling of all vertices. -/ -noncomputable def pushGeometricRealization +@[expose] noncomputable def pushGeometricRealization {A B : Type*} [Fintype A] [Fintype B] [DecidableEq B] (e : A ↪ B) (F : Finset (Finset A)) : @@ -537,7 +536,7 @@ noncomputable def pushGeometricRealization · exact stdSimplex_map_embedding_apply_of_notMem_range e _ hbrange /-- Pull a point of a relabeled realization back to its original vertex type. -/ -noncomputable def pullGeometricRealization +@[expose] noncomputable def pullGeometricRealization {A B : Type*} [Fintype A] [Fintype B] [DecidableEq B] (e : A ↪ B) (F : Finset (Finset A)) : @@ -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] @@ -697,7 +696,7 @@ theorem continuous_pullGeometricRealization (continuous_apply (e a)).comp continuous_subtype_val /-- Relabeling a finite face family along a vertex embedding does not change its realization. -/ -noncomputable def relabelGeometricRealizationHomeomorph +@[expose] noncomputable def relabelGeometricRealizationHomeomorph {A B : Type*} [Fintype A] [Fintype B] [DecidableEq B] (e : A ↪ B) (F : Finset (Finset A)) : @@ -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 @@ -891,7 +890,7 @@ theorem mem_faceVertices_incidentFace (v : K.Vertex) : Classical.choose_spec (K.vertex_used v) /-- The ambient point represented by a global vertex. -/ -noncomputable def vertexPoint (v : K.Vertex) : S := +@[expose] noncomputable def vertexPoint (v : K.Vertex) : S := K.faceMap (K.incidentFace v) (stdSimplex.vertex ⟨v, K.mem_faceVertices_incidentFace v⟩) @@ -944,12 +943,12 @@ theorem locallyFinite_vertexPoints : /-! ## Cyclic data on a maximal face -/ /-- A chosen cyclic enumeration of the three vertices of a maximal face. -/ -noncomputable def faceVertexEquiv (f : K.Face) : Fin 3 ≃ {v // v ∈ K.faceVertices f} := +@[expose] noncomputable def faceVertexEquiv (f : K.Face) : Fin 3 ≃ {v // v ∈ K.faceVertices f} := Fintype.equivOfCardEq (by rw [Fintype.card_fin, Fintype.card_coe, K.faceVertices_card f]) /-- Cyclically indexed vertices of a maximal face. -/ -noncomputable def faceVertex (f : K.Face) (i : ZMod 3) : K.Vertex := +@[expose] noncomputable def faceVertex (f : K.Face) (i : ZMod 3) : K.Vertex := (K.faceVertexEquiv f ((ZMod.finEquiv 3).symm i)).1 theorem faceVertex_mem (f : K.Face) (i : ZMod 3) : @@ -987,7 +986,7 @@ theorem faceVertex_ne_add_two (f : K.Face) (i : ZMod 3) : /-! ## Edges -/ /-- A two-element vertex set contained in a maximal face. -/ -def IsEdge (e : Finset K.Vertex) : Prop := +@[expose] def IsEdge (e : Finset K.Vertex) : Prop := e.card = 2 ∧ ∃ f : K.Face, e ⊆ K.faceVertices f /-- The edge type of a locally finite triangle complex. -/ @@ -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) : @@ -1165,11 +1164,11 @@ theorem extendFaceCoordinates_map_edgeVertexToFace (e : K.Edge) exact extendFaceCoordinates_map_subset (K.edge_subset_faceVertices e) x /-- Parametrization of a closed edge by its standard one-simplex. -/ -noncomputable def edgeMap (e : K.Edge) (x : stdSimplex ℝ {v // v ∈ e.1}) : S := +@[expose] noncomputable def edgeMap (e : K.Edge) (x : stdSimplex ℝ {v // v ∈ e.1}) : S := K.faceMap (K.edgeFace e) (stdSimplex.map (K.edgeVertexToFace e) x) /-- The canonical interval parametrization of an ambient edge carrier. -/ -noncomputable def edgePath (e : K.Edge) (r : Set.Icc (0 : ℝ) 1) : S := +@[expose] noncomputable def edgePath (e : K.Edge) (r : Set.Icc (0 : ℝ) 1) : S := K.edgeMap e (K.edgeSimplexPath e r) theorem edgeMap_eq_faceMap (e : K.Edge) (f : K.Face) @@ -1266,7 +1265,7 @@ theorem range_edgeSimplexPath (e : K.Edge) : rw [K.edgeSimplexPath_apply_second] /-- The ambient carrier of an edge. -/ -def edgeCarrier (e : K.Edge) : Set S := +@[expose] def edgeCarrier (e : K.Edge) : Set S := Set.range (K.edgeMap e) theorem range_edgePath (e : K.Edge) : @@ -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) : @@ -1577,7 +1576,8 @@ theorem finite_vertex [Finite K.Face] : Finite K.Vertex := by exact Set.finite_iUnion fun f ↦ (K.faceVertices f).finite_toSet /-- The finite vertex instance induced by compactness and the no-junk-vertices condition. -/ -@[implicit_reducible] noncomputable def vertexFintype [CompactSpace S] : Fintype K.Vertex := by +@[expose, implicit_reducible] +noncomputable def vertexFintype [CompactSpace S] : Fintype K.Vertex := by letI : Fintype K.Face := K.faceFintype letI : Finite K.Vertex := K.finite_vertex exact Fintype.ofFinite K.Vertex @@ -1591,7 +1591,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 @@ -1614,7 +1614,7 @@ theorem compactIntrinsic_face_mem [CompactSpace S] (f : K.Face) : /-- Restrict a global standard-simplex point supported on `t` to the coordinates indexed by `t`. -/ -noncomputable def restrictToFace [Fintype K.Vertex] (t : Finset K.Vertex) +@[expose] noncomputable def restrictToFace [Fintype K.Vertex] (t : Finset K.Vertex) (x : stdSimplex ℝ K.Vertex) (hx : ∀ v ∉ t, x v = 0) : stdSimplex ℝ {v // v ∈ t} := by refine ⟨fun v ↦ x v.1, fun v ↦ x.2.1 v.1, ?_⟩ @@ -1771,7 +1771,7 @@ theorem range_compactEval [CompactSpace S] : Set.range K.compactEval = K.support /-- A locally finite triangle complex covering a compact Hausdorff space is an honest finite geometric triangulation. -/ -noncomputable def toGeometricTriangulation [CompactSpace S] [T2Space S] +@[expose] noncomputable def toGeometricTriangulation [CompactSpace S] [T2Space S] (hcovers : K.support = Set.univ) : GeometricTriangulation S := by letI : Fintype K.Face := K.faceFintype letI : Fintype K.Vertex := K.vertexFintype @@ -1793,22 +1793,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) : @@ -1846,7 +1844,7 @@ namespace IntrinsicTwoComplex variable (K : IntrinsicTwoComplex) /-- Include the standard simplex on one maximal face into the global barycentric realization. -/ -noncomputable def faceStandardMap (t : K.Face) +@[expose] noncomputable def faceStandardMap (t : K.Face) (x : stdSimplex ℝ {v // v ∈ t.1}) : K.realization := by let x0 : stdSimplex ℝ K.Vertex := stdSimplex.map Subtype.val x have hxSupport : ∀ v ∉ t.1, x0 v = 0 := by 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..6acbce92f8 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. -/ @@ -193,7 +193,7 @@ end PlaneComplex /-- Change only the endpoint witnesses of a path. Its underlying function, and hence its range and injectivity, are unchanged. -/ -def Path.copy {X : Type*} [TopologicalSpace X] {a b a' b' : X} +@[expose] def Path.copy {X : Type*} [TopologicalSpace X] {a b a' b' : X} (p : Path a b) (ha : a = a') (hb : b = b') : Path a' b' where toFun := p continuous_toFun := p.continuous @@ -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 f60091694a..9751c807c8 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 @@ -251,7 +251,7 @@ noncomputable def vertexLines : List (Plane →ᵃ[ℝ] ℝ) := [verticalLine (B.vertex i), horizontalLine (B.vertex i)] /-- The `arrangementLines` declaration. -/ -noncomputable def arrangementLines : List (Plane →ᵃ[ℝ] ℝ) := +@[expose] noncomputable def arrangementLines : List (Plane →ᵃ[ℝ] ℝ) := B.segmentLines ++ B.vertexLines /-- A positive radius containing every chain vertex. -/ @@ -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 @@ -1037,7 +1037,7 @@ theorem exists_face_on_segmentFamily {I : Type*} [Fintype I] /-- The geometric carrier of all listed segments of a finite broken line. Auxiliary line arrangements may contain many additional faces, so this is the carrier relevant to the polygonal object itself. -/ -def segmentCarrier : Set Plane := +@[expose] def segmentCarrier : Set Plane := ⋃ i : Fin B.n, segment ℝ (B.vertex i.castSucc) (B.vertex i.succ) /-- The line arrangement restricted to the actual segments of a finite broken line. This is a @@ -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 { @@ -1676,8 +1676,9 @@ theorem resolvedSegment_inter_of_succ_eq (i j : Fin B.resolvedWalk.length) ext x simp [] rw [himage, convexHull_singleton] - change {(B.arrangementMesh.toPlaneComplex.position - (B.resolvedWalk.getVert (i.val + 1)))} = {B.resolvedVertex i.succ} + change Set.singleton (B.arrangementMesh.toPlaneComplex.position + (B.resolvedWalk.getVert (i.val + 1))) = + Set.singleton (B.resolvedVertex i.succ) rfl /-- The shifted affine edge parameters agree wherever two selected path edges meet. -/ @@ -1925,18 +1926,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..01bcca479d 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) @@ -855,7 +855,7 @@ theorem insertZero_exteriorRegion (J : PolygonalCircle) (p : Plane) (regions_eq_of_carrier_eq (J.insertZero_carrier p hp hp0 hp1)).2 /-- A point is a vertex of one of the cyclic presentations of a polygon. -/ -def IsVertexPoint (J : PolygonalCircle) (p : Plane) : Prop := +@[expose] def IsVertexPoint (J : PolygonalCircle) (p : Plane) : Prop := ∃ i, J.vertex i = p /-- A point known to be a polygon vertex lies on an edge exactly when it is one of that edge's @@ -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 @@ -2306,7 +2306,7 @@ theorem interior13_subset_interior12 : G.J12.disjoint_interior_exterior hsubsetUnion ⟨z, hz13, hz12⟩ /-- Exchange the two boundary arcs of a theta graph. -/ -def swap12 : PolygonalTheta where +@[expose] def swap12 : PolygonalTheta where P := G.P Q := G.Q B1 := G.B2 @@ -2582,7 +2582,7 @@ namespace MeshCrosscut variable {G : PolygonalTheta} {M : TriangleMesh} (C : G.MeshCrosscut M) /-- Exchange the two sides of a realized mesh crosscut. -/ -noncomputable def swap12 (C : G.MeshCrosscut M) : G.swap12.MeshCrosscut M where +@[expose] noncomputable def swap12 (C : G.MeshCrosscut M) : G.swap12.MeshCrosscut M where support_eq := C.support_eq chordEdge := C.chordEdge chordEdge_mem := C.chordEdge_mem @@ -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..f432061dd7 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 @@ -29,7 +29,7 @@ namespace Moise namespace TriangleMesh /-- The canonical barycentric embedding of a finite plane triangle mesh realization. -/ -noncomputable def coordinateEmbed (M : TriangleMesh) : +@[expose] noncomputable def coordinateEmbed (M : TriangleMesh) : GeometricRealization M.Vertex M.triangles → Plane := fun x ↦ M.toPlaneComplex.baryEval x.1 @@ -71,7 +71,7 @@ theorem range_coordinateEmbed (M : TriangleMesh) : exact congrArg Subtype.val hy /-- Restrict the coordinate embedding to any plane region containing the mesh support. -/ -noncomputable def coordinateEmbedInto (M : TriangleMesh) (W : Set Plane) +@[expose] noncomputable def coordinateEmbedInto (M : TriangleMesh) (W : Set Plane) (hW : M.toPlaneComplex.support ⊆ W) : GeometricRealization M.Vertex M.triangles → W := fun x ↦ ⟨M.coordinateEmbed x, hW (by @@ -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 @@ -99,7 +99,7 @@ theorem isCompact_closedRegion [Finite ι] : IsCompact (closedRegion J) := by exact isCompact_iUnion fun i ↦ (J i).isCompact_closedRegion /-- A positive radius of a ball containing every disk in the family. -/ -noncomputable def enclosingRadius : ℝ := +@[expose] noncomputable def enclosingRadius : ℝ := max ((isCompact_closedRegion J).isBounded.subset_closedBall (0 : Plane)).choose 1 theorem enclosingRadius_pos : 0 < enclosingRadius J := @@ -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 : @@ -152,7 +152,7 @@ theorem arrangementMesh_isMonochromatic (i : ι) (k : ZMod (J i).n) : (edgeLines J) (edgeLine_mem_edgeLines J i k) /-- Carrier of one maximal chamber of the common arrangement. -/ -def arrangementTriangleCarrier (t : Finset (arrangementMesh J).Vertex) : Set Plane := +@[expose] def arrangementTriangleCarrier (t : Finset (arrangementMesh J).Vertex) : Set Plane := convexHull ℝ ((arrangementMesh J).position '' (t : Set _)) theorem convex_arrangementTriangleCarrier @@ -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..2712ba3992 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) : @@ -1431,7 +1431,7 @@ theorem edgeSegment_inter_subset_endpoints {i j : ZMod J.n} (hij : i ≠ j) : exact (Set.disjoint_left.1 hdisj hx.1 hx.2).elim /-- The union of all polygon edges other than edge `i`. -/ -def otherEdges (i : ZMod J.n) : Set Plane := +@[expose] def otherEdges (i : ZMod J.n) : Set Plane := ⋃ (j : ZMod J.n) (_ : j ≠ i), J.edgeSegment j theorem isCompact_otherEdges (i : ZMod J.n) : IsCompact (J.otherEdges i) := by @@ -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 @@ -4010,7 +4010,7 @@ theorem polygonal_jordan : exact J.polygonal_jordan_of_twoGateStrip J.exists_twoGateStrip.some /-- The interior region of a polygon (the bounded complementary component). -/ -noncomputable def interiorRegion : Set Plane := +@[expose] noncomputable def interiorRegion : Set Plane := J.polygonal_jordan.choose /-- The exterior region of a polygon (the unbounded complementary component). -/ @@ -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..aca2d9dd96 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 @@ -241,7 +241,7 @@ theorem PolygonalCircle.edgeSegment_inter_eq_shared_vertices simp /-- The nonempty abstract faces of the cyclic edges of a polygon. -/ -noncomputable def PolygonalCircle.edgeFaces (J : PolygonalCircle) : +@[expose] noncomputable def PolygonalCircle.edgeFaces (J : PolygonalCircle) : Finset (Finset (ZMod J.n)) := by classical exact (Finset.univ : Finset (ZMod J.n)).biUnion fun i => @@ -254,7 +254,7 @@ theorem PolygonalCircle.mem_edgeFaces_iff (J : PolygonalCircle) simp [PolygonalCircle.edgeFaces, and_comm] /-- A polygon, regarded as its finite one-dimensional geometric complex. -/ -noncomputable def PolygonalCircle.edgeComplex (J : PolygonalCircle) : PlaneComplex where +@[expose] noncomputable def PolygonalCircle.edgeComplex (J : PolygonalCircle) : PlaneComplex where Vertex := ZMod J.n position := J.vertex position_injective := J.vertex_injective @@ -2044,7 +2044,10 @@ theorem frontier_inter_triangleCarrier_side23 {t : Finset M.Vertex} exact ht have h := C.swap12.frontier_inter_triangleCarrier_side13 (G := G.swap12) (M := M) (t := t) ht' hchord - simpa using h + have hcarrier : C.swap12.side13Mesh.triangleCarrier t = + C.side23Mesh.triangleCarrier t := rfl + rw [hcarrier] at h + simpa only [C.swap12_side13Mesh] using h /-- A geometrically free triangle not incident to the cut edge remains geometrically free after the first cut subdisk is glued back into the original polygonal disk. -/ 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..e124dad10d 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 @@ -29,7 +29,7 @@ variable {ι : Type*} [Fintype ι] (J : ι → PolygonalCircle) /-- Cut the polygon-family arrangement simultaneously by a target mesh and by an additional finite list of affine lines. -/ -noncomputable def relativeSynchronizedArrangement (N : TriangleMesh) +@[expose] noncomputable def relativeSynchronizedArrangement (N : TriangleMesh) (lines : List (Plane →ᵃ[ℝ] ℝ)) : TriangleMesh := (arrangementMesh J).refineByLines (N.coordinateLines ++ lines) @@ -40,7 +40,7 @@ theorem relativeSynchronizedArrangement_support (N : TriangleMesh) (arrangementMesh J).refineByLines_support _ /-- A relative synchronized chamber belongs to the selected polygonal side. -/ -def IsSelectedRelativeSynchronizedTriangle (N : TriangleMesh) +@[expose] def IsSelectedRelativeSynchronizedTriangle (N : TriangleMesh) (lines : List (Plane →ᵃ[ℝ] ℝ)) (p : ι → Prop) (t : Finset (relativeSynchronizedArrangement J N lines).Vertex) : Prop := ∃ i, p i ∧ @@ -48,7 +48,7 @@ def IsSelectedRelativeSynchronizedTriangle (N : TriangleMesh) (J i).interiorRegion /-- The selected polygonal member after all additional cuts. -/ -noncomputable def selectedRelativeSynchronizedMesh (N : TriangleMesh) +@[expose] noncomputable def selectedRelativeSynchronizedMesh (N : TriangleMesh) (lines : List (Plane →ᵃ[ℝ] ℝ)) (p : ι → Prop) : TriangleMesh := by classical exact (relativeSynchronizedArrangement J N lines).restrictTriangles @@ -63,7 +63,7 @@ def IsTargetRelativeSynchronizedTriangle (N : TriangleMesh) N.toPlaneComplex.support).Nonempty /-- The target member after all additional cuts. -/ -noncomputable def targetRelativeSynchronizedMesh (N : TriangleMesh) +@[expose] noncomputable def targetRelativeSynchronizedMesh (N : TriangleMesh) (lines : List (Plane →ᵃ[ℝ] ℝ)) : TriangleMesh := by classical exact (relativeSynchronizedArrangement J N lines).restrictTriangles diff --git a/LeanPool/ClassificationOfSurfaces/Moise/ThinKiteMove.lean b/LeanPool/ClassificationOfSurfaces/Moise/ThinKiteMove.lean index 7096cf0efb..50a95ea52e 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,15 +151,15 @@ 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. -/ -noncomputable def thinKiteInv (δ : ℝ) (p : Plane) : Plane := +@[expose] noncomputable def thinKiteInv (δ : ℝ) (p : Plane) : Plane := planePoint (p 0) ((p 1 - (1 - |p 0|) / 2) / thinKiteScale δ) theorem thinKiteScale_pos {δ : ℝ} (hδ : 0 < δ) : 0 < thinKiteScale δ := by @@ -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..710c808432 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 @@ -242,6 +242,7 @@ theorem im_le_chordHeight (z : PolygonCell 2) : /-- The lower unit-circle point on the vertical chord through a digon point, squared so that the two chord endpoints sweep the teardrop boundary once. -/ +@[expose] noncomputable def collarCircleValue (z : PolygonCell 2) : ℂ := ((z.val.re : ℂ) - (chordHeight z : ℂ) * Complex.I) ^ 2 @@ -534,6 +535,7 @@ abbrev BaseChildPair := DiskSquare.ChildPair 0 1 /-- Map both children into their complementary regions of the teardrop. -/ +@[expose] noncomputable def baseChildPairMap : BaseChildPair → Teardrop | .inl z => ⟨monogonMap z, monogonMap_mem_teardrop z⟩ | .inr z => ⟨collarMap z, collarMap_mem_teardrop z⟩ @@ -579,6 +581,7 @@ theorem baseChildPairMap_respects | trans _ _ _ _ _ ih₁ ih₂ => exact ih₁.trans ih₂ /-- The continuous analytic map induced on the one-sided-degenerate child quotient. -/ +@[expose] noncomputable def baseChildGluingMap : C(DiskSquare.ParamChildGluing 0 1, Teardrop) where toFun := @@ -658,7 +661,7 @@ theorem collarCircleValue_eq_of_collarMap_eq hzw /-- The lower unit-circle representatives used by the squaring map. -/ -noncomputable def lowerChordValue (z : PolygonCell 2) : ℂ := +@[expose] noncomputable def lowerChordValue (z : PolygonCell 2) : ℂ := (z.val.re : ℂ) - (chordHeight z : ℂ) * Complex.I theorem collarCircleValue_eq_lowerChordValue_sq @@ -1365,6 +1368,7 @@ theorem baseChildGluingMap_surjective : rw [hw, hscale] /-- A monogon glued along its entire side to one side of a digon is a closed disk. -/ +@[expose] noncomputable def baseChildGluingHomeomorph : DiskSquare.ParamChildGluing 0 1 ≃ₜ Teardrop := by let e : DiskSquare.ParamChildGluing 0 1 ≃ Teardrop := @@ -1749,6 +1753,7 @@ theorem sourceCellHomeomorph_side /-- Simultaneously straighten a one-sided-degenerate child pair to the base monogon--digon pair. -/ +@[expose] noncomputable def childPairBaseHomeomorph (r : ℕ) (hr : 0 < r) : DiskSquare.ChildPair 0 r ≃ₜ BaseChildPair := @@ -1861,6 +1866,7 @@ theorem childPairBase_eqvGen_iff /-- The arbitrary one-sided-degenerate child quotient is identified with the base monogon--digon quotient. -/ +@[expose] noncomputable def childGluingBaseHomeomorph (r : ℕ) (hr : 0 < r) : DiskSquare.ParamChildGluing 0 r ≃ₜ 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..a3b5aed9b7 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⟩ @@ -235,23 +235,23 @@ deriving DecidableEq, Repr namespace ParameterDirection /-- The affine interval homeomorphism associated to a parameter direction. -/ -def homeomorph : ParameterDirection → (unitInterval ≃ₜ unitInterval) +@[expose] def homeomorph : ParameterDirection → (unitInterval ≃ₜ unitInterval) | same => Homeomorph.refl 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 @@ -309,7 +309,7 @@ inductive Generator {Face : Type u} {sideCount : Face → ℕ} (identification.target.point (identification.parameter t)) /-- The equivalence relation generated by the prescribed side identifications. -/ -def setoid {Face : Type u} {sideCount : Face → ℕ} +@[expose] def setoid {Face : Type u} {sideCount : Face → ℕ} (identifications : Set (Identification Face sideCount)) : Setoid (PreRealization Face sideCount) := Relation.EqvGen.setoid (Generator identifications) @@ -348,7 +348,7 @@ abbrev Realization {Face : Type u} {sideCount : Face → ℕ} Quotient (setoid identifications) /-- The quotient map from the disjoint union to the glued realization. -/ -def mk {Face : Type u} {sideCount : Face → ℕ} +@[expose] def mk {Face : Type u} {sideCount : Face → ℕ} (identifications : Set (Identification Face sideCount)) : PreRealization Face sideCount → Realization identifications := @Quotient.mk' _ (setoid identifications) 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..08d6db3cf7 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 @@ -38,6 +38,7 @@ deriving DecidableEq, Repr The orientable sphere is represented by the separate sphere branch, so an orientable polygonal normal form must have a handle or a boundary component; nonorientable forms must have at least one crosscap. -/ +@[expose] def NormalForm.IsEvalAdmissible : NormalForm → Prop | NormalForm.sphere => True | NormalForm.orientable handles boundaryComponents => 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..606c28bbb2 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 @@ -37,7 +37,7 @@ open scoped ComplexConjugate namespace PolygonCell /-- Complex conjugation as a self-homeomorphism of an indexed polygon cell. -/ -noncomputable def conjHomeomorph (n : ℕ) : PolygonCell n ≃ₜ PolygonCell n where +@[expose] noncomputable def conjHomeomorph (n : ℕ) : PolygonCell n ≃ₜ PolygonCell n where toFun z := ⟨conj z.val, by simpa only [Metric.mem_closedBall, Complex.dist_eq, sub_zero, Complex.norm_conj] using z.property⟩ 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..bad7f5a4d3 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 @@ -64,6 +64,7 @@ theorem mem_sphere_of_hemisphereHeight_eq_zero {n : ℕ} (z : PolygonCell n) nlinarith [norm_nonneg z.val] /-- The horizontal coordinates of a point on the standard sphere, regarded as a disk point. -/ +@[expose] noncomputable def sphereDiskPoint (x : SphereRepresentative) : PolygonCell 1 := ⟨Complex.mk (x.val 0) (x.val 1), by rw [Metric.mem_closedBall, Complex.dist_eq, sub_zero] @@ -145,6 +146,7 @@ theorem spherePreMap_eq_of_gluingRel | trans _ _ _ _ _ hxy hyz => exact hxy.trans hyz /-- The continuous sphere map descended from the two monogon faces to their polygonal quotient. -/ +@[expose] noncomputable def sphereQuotientMap : C(sphere.PolygonalRealization sphere_occurrencePairingValid, SphereRepresentative) where toFun := Quotient.lift spherePreMap fun _ _ hxy ↦ spherePreMap_eq_of_gluingRel hxy @@ -258,6 +260,7 @@ theorem sphereQuotientMap_bijective : Function.Bijective sphereQuotientMap := ⟨sphereQuotientMap_injective, sphereQuotientMap_surjective⟩ /-- The underlying equivalence of the two-monogon quotient with the standard sphere. -/ +@[expose] noncomputable def spherePolygonalRealizationEquiv : sphere.PolygonalRealization sphere_occurrencePairingValid ≃ SphereRepresentative := Equiv.ofBijective sphereQuotientMap sphereQuotientMap_bijective @@ -269,6 +272,7 @@ theorem spherePolygonalRealizationEquiv_apply rfl /-- The polygonal realization of the two-monogon presentation is the standard two-sphere. -/ +@[expose] noncomputable def spherePolygonalRealizationHomeomorph : sphere.PolygonalRealization sphere_occurrencePairingValid ≃ₜ SphereRepresentative := Continuous.homeoOfEquivCompactToT2 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..a71d776029 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,11 +41,12 @@ 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 /-- Reverse an oriented edge. -/ +@[expose] def flip {α : Type*} : OrientedEdge α → OrientedEdge α | pos e => neg e | neg e => pos e @@ -154,19 +155,19 @@ abbrev BoundaryPosition {S : Type*} [TopologicalSpace S] namespace BoundaryPosition /-- The oriented edge stored at a triangle-boundary position. -/ -def orientedEdge {S : Type*} [TopologicalSpace S] {T : FiniteSurfaceTriangulation S} +@[expose] def orientedEdge {S : Type*} [TopologicalSpace S] {T : FiniteSurfaceTriangulation S} (o : T.BoundaryPosition) : OrientedEdge T.Edge := (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 end BoundaryPosition /-- Two triangles are adjacent when their stored boundaries share an unoriented edge. -/ -def TriangleAdjacent {S : Type*} [TopologicalSpace S] +@[expose] def TriangleAdjacent {S : Type*} [TopologicalSpace S] (T : FiniteSurfaceTriangulation S) (f g : T.Triangle) : Prop := ∃ df ∈ T.triangleBoundary f, ∃ dg ∈ T.triangleBoundary g, df.edge = dg.edge @@ -198,7 +199,7 @@ namespace GeometricTriangulation variable {S : Type*} [TopologicalSpace S] (T : GeometricTriangulation S) /-- Forget the target-space homeomorphism and retain the intrinsic two-complex. -/ -@[reducible] def toIntrinsic : Moise.IntrinsicTwoComplex where +@[expose, reducible] def toIntrinsic : Moise.IntrinsicTwoComplex where Vertex := T.Vertex faces := T.faces faces_card := T.faces_card @@ -206,11 +207,13 @@ variable {S : Type*} [TopologicalSpace S] (T : GeometricTriangulation S) @[simp] theorem toIntrinsic_faces : T.toIntrinsic.faces = T.faces := rfl /-- Source vertex of an oriented geometric edge. -/ +@[expose] noncomputable def orientedEdgeSource : OrientedEdge T.Edge → T.Vertex | OrientedEdge.pos e => T.edgeSource e | OrientedEdge.neg e => T.edgeTarget e /-- Target vertex of an oriented geometric edge. -/ +@[expose] noncomputable def orientedEdgeTarget : OrientedEdge T.Edge → T.Vertex | OrientedEdge.pos e => T.edgeTarget e | OrientedEdge.neg e => T.edgeSource e @@ -361,7 +364,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 @@ -571,6 +574,7 @@ theorem moise_triangulation_explicit : nonempty_geometricTriangulation_iff_explicit.mp (moise_triangulation S) /-- The named geometric triangulation produced for a compact connected Eval surface. -/ +@[expose] noncomputable def compactEvalSurfaceGeometricTriangulation : GeometricTriangulation S := Classical.choice (moise_triangulation S) 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 d8dc09cc29..7400b5ca33 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 76294de98e..568e461a8d 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 @@ -136,7 +136,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 @@ -478,7 +478,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)) @@ -486,16 +486,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) : @@ -503,6 +505,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 @@ -515,7 +519,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..d11b92909b 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 @@ -35,7 +35,7 @@ abbrev A := Fin 3 → R abbrev H := SpecialLinear.SL3 × Sp4.Group /-- Countable discrete wrapper for the acting group. Paper: §2. -/ -noncomputable def actingGroup : CountableDiscreteGroup where +@[expose] noncomputable def actingGroup : CountableDiscreteGroup where Carrier := H group := inferInstance countable := by infer_instance @@ -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..ca065e4e43 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,11 +47,11 @@ 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. -/ -def avStarActionHom : H →* (AVStar ≃ₗ[k] AVStar) where +@[expose] def avStarActionHom : H →* (AVStar ≃ₗ[k] AVStar) where toFun h := avStarAction h.1 h.2 map_one' := by apply LinearEquiv.ext @@ -128,7 +128,7 @@ theorem sl3CAction_comp_inv (l : SpecialLinear.SL3) : (sl3TensorAction_comp_inv l) /-- The SL₃ action on the fixed tensor module is invertible. Paper: §2. -/ -def sl3CActionEquiv (l : SpecialLinear.SL3) : C ≃ₗ[k] C := +@[expose] def sl3CActionEquiv (l : SpecialLinear.SL3) : C ≃ₗ[k] C := { toFun := sl3CAction l invFun := sl3CAction l⁻¹ left_inv := by @@ -153,7 +153,7 @@ def sl3CActionEquiv (l : SpecialLinear.SL3) : C ≃ₗ[k] C := exact (sl3CAction l).map_smul a c } /-- The fixed-tensor action is a homomorphism. Paper: §2. -/ -def sl3CActionHom : SpecialLinear.SL3 →* (C ≃ₗ[k] C) where +@[expose] def sl3CActionHom : SpecialLinear.SL3 →* (C ≃ₗ[k] C) where toFun := sl3CActionEquiv map_one' := by apply LinearEquiv.ext @@ -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. -/ @@ -183,11 +183,11 @@ def paperThetaOneLinear (h : H) : D ≃ₗ[k] D := (avStarAction h.1 h.2 d.1, sl3CAction h.1 d.2) := rfl /-- Reinterpret a linear kernel equivalence as a multiplicative automorphism. Paper: §2. -/ -def additiveEquivToMulAut (e : D ≃ₗ[k] D) : MulAut (Multiplicative D) := +@[expose] def additiveEquivToMulAut (e : D ≃ₗ[k] D) : MulAut (Multiplicative D) := e.toAddEquiv.toMultiplicative /-- The first Zhou action as a linear homomorphism. Paper: §2. -/ -def paperThetaOneLinearHom : H →* (D ≃ₗ[k] D) where +@[expose] def paperThetaOneLinearHom : H →* (D ≃ₗ[k] D) where toFun := paperThetaOneLinear map_one' := by apply LinearEquiv.ext @@ -215,7 +215,7 @@ def paperThetaOneLinearHom : H →* (D ≃ₗ[k] D) where exact congrArg (fun e : C ≃ₗ[k] C => e c) hm /-- The first Zhou action on the multiplicative kernel. Paper: §2. -/ -def paperThetaOneHom : H →* MulAut (Multiplicative D) where +@[expose] def paperThetaOneHom : H →* MulAut (Multiplicative D) where toFun h := additiveEquivToMulAut (paperThetaOneLinearHom h) map_one' := by apply MulEquiv.ext @@ -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 @@ -392,7 +392,7 @@ theorem thetaTwoLinearMap_one : thetaTwoLinearMap (1 : H) = LinearMap.id := by exact congrArg (fun e : C →ₗ[k] C => e c) hc /-- The second Zhou action as a linear equivalence. Paper: §2. -/ -def paperThetaTwoLinearEquiv (h : H) : D ≃ₗ[k] D := +@[expose] def paperThetaTwoLinearEquiv (h : H) : D ≃ₗ[k] D := { toFun := thetaTwoLinearMap h invFun := thetaTwoLinearMap h⁻¹ left_inv := by @@ -429,7 +429,7 @@ def paperThetaTwoLinearEquiv (h : H) : D ≃ₗ[k] D := exact (thetaTwoLinearMap h).map_smul a x } /-- The second Zhou action as a linear homomorphism. Paper: §2. -/ -def paperThetaTwoLinearHom : H →* (D ≃ₗ[k] D) where +@[expose] def paperThetaTwoLinearHom : H →* (D ≃ₗ[k] D) where toFun := paperThetaTwoLinearEquiv map_one' := by apply LinearEquiv.ext @@ -443,7 +443,7 @@ def paperThetaTwoLinearHom : H →* (D ≃ₗ[k] D) where (thetaTwoLinearMap_mul h h') /-- The second Zhou action on the multiplicative kernel. Paper: §2. -/ -def paperThetaTwoHom : H →* MulAut (Multiplicative D) where +@[expose] def paperThetaTwoHom : H →* MulAut (Multiplicative D) where toFun h := additiveEquivToMulAut (paperThetaTwoLinearHom h) map_one' := by apply MulEquiv.ext @@ -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..f7d7a2dc1c 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] @@ -88,7 +89,7 @@ def qVAction (q : Q) : PaperV ≃ₗ[k] PaperV := exact Matrix.mulVec_smul _ _ _ } /-- The Q action homomorphism on the finite module. Paper: §2. -/ -def qVActionHom : Q →* (PaperV ≃ₗ[k] PaperV) where +@[expose] def qVActionHom : Q →* (PaperV ≃ₗ[k] PaperV) where toFun := qVAction map_one' := by apply LinearEquiv.ext @@ -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..ba77bf78e5 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,12 +130,12 @@ 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)) /-- Left-regular representation boundary. Paper: §3. -/ -def leftRegularRepresentation (G : Type u) [Group G] : +@[expose] def leftRegularRepresentation (G : Type u) [Group G] : G →* unitary (GroupL2 G →L[ℂ] GroupL2 G) where toFun := leftRegularUnitary map_one' := by @@ -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)) @@ -192,13 +192,13 @@ abbrev GroupVonNeumannAlgebra (G : CountableDiscreteGroup.{u}) := (groupVonNeumannAlgebra G).toStarSubalgebra /-- Point-mass basis vector boundary. Paper: §3. -/ -def delta (G : CountableDiscreteGroup.{u}) (g : G) : GroupL2 G := +@[expose] def delta (G : CountableDiscreteGroup.{u}) (g : G) : GroupL2 G := by classical 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..fa7605609f 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] @@ -101,7 +101,7 @@ def characterIntoRoots {M : Type*} [AddCommGroup M] [Module F M] /-- The additive binary character underlying a Pontryagin character. Paper: §3. -/ -def characterAdd {M : Type*} [AddCommGroup M] [Module F M] +@[expose] def characterAdd {M : Type*} [AddCommGroup M] [Module F M] [TopologicalSpace M] (χ : PontryaginDual (Multiplicative M)) : M →+ F := { toFun x := Multiplicative.toAdd @@ -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..da830fd36b 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) : @@ -158,7 +158,7 @@ abbrev crossedCoefficient /-- Multiplication on the base Hilbert space supplies crossed multipliers. Paper: §3. -/ -def crossedBaseMultiplier +@[expose] def crossedBaseMultiplier {K : Type u} {Ω : Type v} [Group K] [AddCommGroup Ω] [TopologicalSpace Ω] [MeasurableSpace Ω] (X : HaarProbabilityAction K Ω) @@ -182,7 +182,7 @@ Paper: §3. /-- The `crossedFiberwiseOperator` construction used in the Connes rigidity formalization. -/ -def crossedFiberwiseOperator +@[expose] def crossedFiberwiseOperator {K : Type u} {H : Type v} [NormedAddCommGroup H] [NormedSpace ℂ H] (T : H →L[ℂ] H) : @@ -219,12 +219,12 @@ 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. -/ -def crossedMultiplier +@[expose] def crossedMultiplier {K : Type u} {Ω : Type v} [Group K] [AddCommGroup Ω] [TopologicalSpace Ω] [MeasurableSpace Ω] (X : HaarProbabilityAction K Ω) @@ -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,11 +293,11 @@ 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. -/ -def crossedIndexEquiv +@[expose] def crossedIndexEquiv {K : Type u} {H : Type v} [NormedAddCommGroup H] [NormedSpace ℂ H] (e : K ≃ K) : @@ -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,12 +460,12 @@ 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. -/ -def crossedGeneratorSet +@[expose] def crossedGeneratorSet {K : Type u} {Ω : Type v} [Group K] [AddCommGroup Ω] [TopologicalSpace Ω] [MeasurableSpace Ω] (X : HaarProbabilityAction K Ω) : @@ -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 @@ -503,7 +503,7 @@ structure CrossedProductModel /-- The `crossedProductModel` construction used in the Connes rigidity formalization. -/ -def crossedProductModel +@[expose] def crossedProductModel {K : Type u} {Ω : Type v} [Group K] [AddCommGroup Ω] [TopologicalSpace Ω] [MeasurableSpace Ω] (X : HaarProbabilityAction K Ω) : diff --git a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/CrossedProductFactorTransport.lean b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/CrossedProductFactorTransport.lean index be2a01656e..4cff7de6b8 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 @@ -182,7 +182,7 @@ local instance haarProbabilityTarget Y.probability /-- Apply a bounded operator to each fibre of a square-summable family. -/ -def crossedFiberwiseOperatorContinuousLinearMap +@[expose] def crossedFiberwiseOperatorContinuousLinearMap {E : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] : (E →L[ℂ] E) →L[ℂ] (lp (fun _ : K ↦ E) 2 →L[ℂ] lp (fun _ : K ↦ E) 2) := by @@ -222,7 +222,7 @@ def crossedFiberwiseOperatorContinuousLinearMap /-- Continuous coefficients act as a continuous family of fiberwise multipliers on the regular crossed-product Hilbert space. -/ -def continuousCrossedMultiplier +@[expose] def continuousCrossedMultiplier (X : HaarProbabilityAction K Ω) : C(Ω, ℂ) →L[ℂ] (crossedHilbert X →L[ℂ] crossedHilbert X) := (crossedFiberwiseOperatorContinuousLinearMap (K := K) @@ -248,7 +248,7 @@ def continuousCrossedGeneratorSet /-- The regular crossed-product generators cut down to a specified family of continuous coefficients, together with all action unitaries. -/ -def crossedGeneratorSetOfContinuousCoefficients +@[expose] def crossedGeneratorSetOfContinuousCoefficients (X : HaarProbabilityAction K Ω) {I : Type*} (v : I → C(Ω, ℂ)) : Set (crossedHilbert X →L[ℂ] crossedHilbert X) := Set.range (fun i ↦ continuousCrossedMultiplier X (v i)) ∪ 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..28024139e2 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 @@ -56,7 +56,7 @@ variable [MeasurableSpace (DiscreteCharacterSpace A)] /-- The `spectralUnitTest` construction used in the Connes rigidity formalization. -/ -def spectralUnitTest (A : Type u) +@[expose] def spectralUnitTest (A : Type u) [AddCommGroup A] [TopologicalSpace A] [DiscreteTopology A] : C_c(DiscreteCharacterSpace A, ℝ) where toFun _ := 1 @@ -139,7 +139,7 @@ theorem measure_isProbabilityMeasure /-- The `probabilityMeasure` construction used in the Connes rigidity formalization. -/ -def probabilityMeasure +@[expose] def probabilityMeasure (Φ : PositiveSpectralFunctional E V π) (x : V) (hx : ‖x‖ = 1) : ProbabilityMeasure (DiscreteCharacterSpace A) := @@ -573,7 +573,7 @@ theorem character_sub_norm_sq /-- The `spectralFiniteAverageTest` construction used in the Connes rigidity formalization. -/ -def spectralFiniteAverageTest +@[expose] def spectralFiniteAverageTest {ι : Type v} (s : Finset ι) (a : ι → A) (w : ι → ℝ) : C_c(DiscreteCharacterSpace A, ℝ) where toFun χ := @@ -913,7 +913,7 @@ variable {V : Type v} [NormedAddCommGroup V] /-- The `spectralOperatorGenerators` construction used in the Connes rigidity formalization. -/ -def spectralOperatorGenerators +@[expose] def spectralOperatorGenerators (E : SplitAbelianExtension A G H) (π : UnitaryRepresentation G V) : Set (V →L[ℂ] V) := Set.range fun a : A ↦ @@ -922,7 +922,7 @@ def spectralOperatorGenerators /-- The `spectralOperatorAlgebra` construction used in the Connes rigidity formalization. -/ -def spectralOperatorAlgebra +@[expose] def spectralOperatorAlgebra (E : SplitAbelianExtension A G H) (π : UnitaryRepresentation G V) : StarSubalgebra ℂ (V →L[ℂ] V) := (StarAlgebra.adjoin ℂ (spectralOperatorGenerators E π)).topologicalClosure @@ -994,7 +994,7 @@ instance spectralOperatorAlgebraCommCStarAlgebra /-- The `spectralKernelOperator` construction used in the Connes rigidity formalization. -/ -def spectralKernelOperator +@[expose] def spectralKernelOperator (E : SplitAbelianExtension A G H) (π : UnitaryRepresentation G V) (a : A) : spectralOperatorAlgebra E π := @@ -1064,7 +1064,7 @@ theorem spectralCharacter_generator_mem_circle /-- The `spectralCharacter` construction used in the Connes rigidity formalization. -/ -def spectralCharacter +@[expose] def spectralCharacter (E : SplitAbelianExtension A G H) (π : UnitaryRepresentation G V) (φ : characterSpace ℂ (spectralOperatorAlgebra E π)) : @@ -1111,7 +1111,7 @@ theorem spectralCharacter_continuous /-- The `spectralCharacterMap` construction used in the Connes rigidity formalization. -/ -def spectralCharacterMap +@[expose] def spectralCharacterMap (E : SplitAbelianExtension A G H) (π : UnitaryRepresentation G V) : C(characterSpace ℂ (spectralOperatorAlgebra E π), @@ -1132,7 +1132,7 @@ def jointFunctionalCalculus /-- The `spectralCharacterEvaluation` construction used in the Connes rigidity formalization. -/ -def spectralCharacterEvaluation +@[expose] def spectralCharacterEvaluation (a : A) : C(DiscreteCharacterSpace A, ℂ) := ⟨fun χ ↦ ((χ (Multiplicative.ofAdd a) : Circle) : ℂ), continuous_character_evaluation a⟩ @@ -1282,7 +1282,7 @@ theorem dualCharacterAction_mul /-- The `dualCharacterHomeomorph` construction used in the Connes rigidity formalization. -/ -def dualCharacterHomeomorph +@[expose] def dualCharacterHomeomorph (action : H →* Multiplicative (AddAut A)) (h : H) : DiscreteCharacterSpace A ≃ₜ DiscreteCharacterSpace A where toFun := dualCharacterAction action h @@ -1385,7 +1385,7 @@ variable {V : Type v} [NormedAddCommGroup V] /-- The `quotientOperatorConjugation` construction used in the Connes rigidity formalization. -/ -def quotientOperatorConjugation +@[expose] def quotientOperatorConjugation (E : SplitAbelianExtension A G H) (π : UnitaryRepresentation G V) (h : H) : (V →L[ℂ] V) ≃⋆ₐ[ℂ] (V →L[ℂ] V) := @@ -1476,7 +1476,7 @@ omit [TopologicalSpace A] [DiscreteTopology A] in /-- The `quotientSpectralOperatorConjugation` construction used in the Connes rigidity formalization. -/ -def quotientSpectralOperatorConjugation +@[expose] def quotientSpectralOperatorConjugation (E : SplitAbelianExtension A G H) (π : UnitaryRepresentation G V) (h : H) : spectralOperatorAlgebra E π ≃⋆ₐ[ℂ] @@ -1559,7 +1559,7 @@ theorem spectralCharacter_quotientConjugation /-- The `dualCharacterActionContinuousMap` construction used in the Connes rigidity formalization. -/ -def dualCharacterActionContinuousMap +@[expose] def dualCharacterActionContinuousMap (action : H →* Multiplicative (AddAut A)) (h : H) : C(DiscreteCharacterSpace A, DiscreteCharacterSpace A) := ⟨dualCharacterAction action h, continuous_dualCharacterAction action h⟩ @@ -1629,7 +1629,7 @@ variable {V : Type v} [NormedAddCommGroup V] /-- The `characterRealComplexification` construction used in the Connes rigidity formalization. -/ -def characterRealComplexification +@[expose] def characterRealComplexification (f : C_c(X, ℝ)) : C(X, ℂ) where toFun y := (f y : ℂ) continuous_toFun := Complex.continuous_ofReal.comp f.continuous @@ -1659,7 +1659,7 @@ variable [CompactSpace X] /-- The `characterRealSqrt` construction used in the Connes rigidity formalization. -/ -def characterRealSqrt (f : C_c(X, ℝ)) : C_c(X, ℝ) where +@[expose] def characterRealSqrt (f : C_c(X, ℝ)) : C_c(X, ℝ) where toFun y := Real.sqrt (f y) continuous_toFun := Real.continuous_sqrt.comp f.continuous hasCompactSupport' := HasCompactSupport.of_compactSpace _ @@ -1682,7 +1682,7 @@ theorem characterRealComplexification_eq_star_mul_sqrt /-- The `characterVectorFunctionalLinear` construction used in the Connes rigidity formalization. -/ -def characterVectorFunctionalLinear +@[expose] def characterVectorFunctionalLinear (calculus : C(X, ℂ) →⋆ₐ[ℂ] (V →L[ℂ] V)) (x : V) : C_c(X, ℝ) →ₗ[ℝ] ℝ where toFun f := @@ -1724,7 +1724,7 @@ theorem characterVectorFunctionalLinear_nonneg /-- The `characterVectorFunctional` construction used in the Connes rigidity formalization. -/ -def characterVectorFunctional +@[expose] def characterVectorFunctional (calculus : C(X, ℂ) →⋆ₐ[ℂ] (V →L[ℂ] V)) (x : V) : C_c(X, ℝ) →ₚ[ℝ] ℝ where toLinearMap := characterVectorFunctionalLinear calculus x @@ -1827,7 +1827,7 @@ variable {W : Type v} [NormedAddCommGroup W] /-- The `jointFunctionalCalculusOperator` construction used in the Connes rigidity formalization. -/ -def jointFunctionalCalculusOperator +@[expose] def jointFunctionalCalculusOperator (E : SplitAbelianExtension A G H) (π : UnitaryRepresentation G W) : C(DiscreteCharacterSpace A, ℂ) →⋆ₐ[ℂ] (W →L[ℂ] W) := @@ -1848,7 +1848,7 @@ def jointFunctionalCalculusOperator /-- The `jointCharacterFunctional` construction used in the Connes rigidity formalization. -/ -def jointCharacterFunctional +@[expose] def jointCharacterFunctional (E : SplitAbelianExtension A G H) (π : UnitaryRepresentation G W) (x : W) : C_c(DiscreteCharacterSpace A, ℝ) →ₚ[ℝ] ℝ := 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..ea8227272c 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 @@ -213,7 +213,7 @@ step. Paper: §4. /-- The `HasQuotientFixedApproximation` construction used in the Connes rigidity formalization. -/ -def HasQuotientFixedApproximation +@[expose] def HasQuotientFixedApproximation (E : SplitAbelianExtension A G H) (π : UnitaryRepresentation G K) : Prop := HasKazhdanPropertyT.{u, v} H → diff --git a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/PropertyTTransfer.lean b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/PropertyTTransfer.lean index e48d94b78e..cc187437e9 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 @@ -33,7 +33,7 @@ namespace CountableDiscreteGroup /-- The `quotient` construction used in the Connes rigidity formalization. -/ -noncomputable def quotient +@[expose] noncomputable def quotient (G : CountableDiscreteGroup.{u}) (N : Subgroup G) (hN : N.Normal) : CountableDiscreteGroup.{u} := by let normalInstance : N.Normal := hN 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..387e19eaed 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 @@ -33,7 +33,7 @@ family used by the closure reduction. Paper: §3. /-- The `generatorSet` construction used in the Connes rigidity formalization. -/ -def generatorSet +@[expose] def generatorSet {A K : Type*} [Group A] [Group K] (φ : K →* MulAut A) : Set (GroupL2 (A ⋊[φ] K) →L[ℂ] GroupL2 (A ⋊[φ] K)) := diff --git a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/SpectralCriterion.lean b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/SpectralCriterion.lean index 825cdef388..93826ad6a7 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 @@ -45,7 +45,7 @@ abbrev DiscreteCharacterSpace (A : Type u) PontryaginDual (Multiplicative A) /-- Inverse-dual action of a group on the character space. Paper: §4. -/ -def dualCharacterAction +@[expose] def dualCharacterAction (action : H →* Multiplicative (AddAut A)) (h : H) (χ : DiscreteCharacterSpace A) : DiscreteCharacterSpace A where toFun a := χ (Multiplicative.ofAdd @@ -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} @@ -122,7 +122,7 @@ theorem continuous_character_evaluation (a : A) : omit [MeasurableSpace (DiscreteCharacterSpace A)] [BorelSpace (DiscreteCharacterSpace A)] in /-- Compactly supported continuous test for spectral displacement. Paper: §4. -/ -def spectralEnergyTest (a : A) : +@[expose] def spectralEnergyTest (a : A) : C_c(DiscreteCharacterSpace A, ℝ) where toFun χ := ‖((χ (Multiplicative.ofAdd a) : Circle) : ℂ) - 1‖ ^ 2 continuous_toFun := @@ -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 @@ -212,7 +212,7 @@ structure SpectralMeasureInterface (∀ h : H, (π (E.splitting h) : K →L[ℂ] K) η = η) /-- Finite spectral detection inequality. Paper: §4. -/ -def HasFiniteSpectralDetection +@[expose] def HasFiniteSpectralDetection (E : SplitAbelianExtension A G H) (J : Finset A) (c : ℝ) : Prop := ∀ μ : ProbabilityMeasure (DiscreteCharacterSpace A), IsInvariantSpectralMeasure E.action μ → 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..656c5df781 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 @@ -86,7 +86,7 @@ theorem characterLinearEquiv_characterActionOfLinear (M := D) (Additive.toMul χ)) (e.symm d)) rw [BinaryPontryaginDual.characterLinear_circle, BinaryPontryaginDual.characterLinear_circle] - rfl + exact PaperDualAutomorphism.dualCharacterEquiv_apply e.toAddEquiv χ d /- The compact dual action is continuous. Paper: §3. -/ theorem continuous_characterActionOfLinear (e : D ≃ₗ[k] D) : diff --git a/LeanPool/ConnesRigidity/Paper/Section3/CrossedHaar.lean b/LeanPool/ConnesRigidity/Paper/Section3/CrossedHaar.lean index f51020004d..90718bee90 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 @@ -92,7 +92,7 @@ theorem paperCoordinateActionTwo_measurePreserving (h : H) : /-- The `paperHaarActionOne` construction used in the Connes rigidity formalization. -/ -def paperHaarActionOne : HaarProbabilityAction H Coordinates where +@[expose] def paperHaarActionOne : HaarProbabilityAction H Coordinates where measure := coordinatesHaar haar := by unfold coordinatesHaar @@ -110,7 +110,7 @@ def paperHaarActionOne : HaarProbabilityAction H Coordinates where /-- The second Zhou action packaged as a probability Haar action. Paper: §3. -/ -def paperHaarActionTwo : HaarProbabilityAction H Coordinates where +@[expose] def paperHaarActionTwo : HaarProbabilityAction H Coordinates where measure := coordinatesHaar haar := by unfold coordinatesHaar @@ -129,7 +129,7 @@ def paperHaarActionTwo : HaarProbabilityAction H Coordinates where /-- The quadratic fiber shear as a homeomorphism. Its inverse is the same quadratic shear, but it need not preserve the compact-group law. Paper: §3. -/ -def paperFiberShearHomeomorph : Coordinates ≃ₜ Coordinates where +@[expose] def paperFiberShearHomeomorph : Coordinates ≃ₜ Coordinates where toEquiv := { toFun := fiberShear invFun := fiberShear @@ -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..a6b71491c1 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 @@ -94,7 +94,7 @@ def coordinateComplexCharacter (d : D) : C(Coordinates, ℂ) where /-- The bounded coefficient used by the crossed base multiplier. Paper: §3. -/ -def coordinateCharacterCoefficient (d : D) : crossedCoefficient X := +@[expose] def coordinateCharacterCoefficient (d : D) : crossedCoefficient X := ContinuousMap.toLp ⊤ coordinatesHaar ℂ (coordinateComplexCharacter d) theorem coordinateCharacterCoefficient_apply_ae (d : D) : @@ -158,7 +158,7 @@ theorem coordinateCharacterMultiplier_eq_baseMultiplier (d : D) : /-- The `paperCrossedKernelFourierUnitary` construction used in the Connes rigidity formalization. -/ -def paperCrossedKernelFourierUnitary : ProductL2 ≃ₗᵢ[ℂ] CrossedL2 := +@[expose] def paperCrossedKernelFourierUnitary : ProductL2 ≃ₗᵢ[ℂ] CrossedL2 := crossedFiberwiseEquiv (K := H) paperFourierCoordinateUnitary @[simp] theorem paperCrossedKernelFourierUnitary_apply @@ -175,7 +175,7 @@ def productKernelRegularUnitary (d : D) : ProductL2 ≃ₗᵢ[ℂ] ProductL2 := /-- The kernel translation on the concrete crossed base. Paper: §3. -/ -def crossedKernelMultiplier (d : D) : CrossedL2 →L[ℂ] CrossedL2 := +@[expose] def crossedKernelMultiplier (d : D) : CrossedL2 →L[ℂ] CrossedL2 := crossedMultiplier X (coordinateCharacterCoefficient d) /- Kernel regular translations become crossed-base multipliers on every fiber. 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..0a39cbad90 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 @@ -72,7 +72,7 @@ theorem avDualEquiv_eval (F : Module.Dual k PaperKernel.AVStar) (a : A) /-- The `qTensor` construction used in the Connes rigidity formalization. -/ -def qTensor (z : A →ₗ[k] PaperV) : PaperKernel.TensorAA →ₗ[k] k := +@[expose] def qTensor (z : A →ₗ[k] PaperV) : PaperKernel.TensorAA →ₗ[k] k := PaperFactorIsomorphism.tensorFunctional (PaperFactorIsomorphism.coordinate z (Sum.inl 0)) (PaperFactorIsomorphism.coordinate z (Sum.inr 0)) + @@ -88,7 +88,7 @@ def zAction (h : H) (z : A →ₗ[k] PaperV) : A →ₗ[k] PaperV := /-- The tensor form of the second-action correction. Paper: §3. -/ -def thetaTwoTermTensor (h : H) : PaperKernel.TensorAA →ₗ[k] +@[expose] def thetaTwoTermTensor (h : H) : PaperKernel.TensorAA →ₗ[k] PaperKernel.AVStar := ((TensorProduct.mk k A VStar).flip (OpenAIPort.quadraticDefectLinear (h⁻¹).2)).comp 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..114f4c92d9 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 @@ -148,11 +148,11 @@ theorem coordinateAction_mul simp [coordinateAction, AddEquiv.trans_apply] /-- The first actual Zhou action on the raw dual coordinates. Paper: §3. -/ -def paperCoordinateActionOne (h : H) : Coordinates ≃+ Coordinates := +@[expose] def paperCoordinateActionOne (h : H) : Coordinates ≃+ Coordinates := coordinateAction paperDualActionOne h /-- The second actual Zhou action on the raw dual coordinates. Paper: §3. -/ -def paperCoordinateActionTwo (h : H) : Coordinates ≃+ Coordinates := +@[expose] def paperCoordinateActionTwo (h : H) : Coordinates ≃+ Coordinates := coordinateAction paperDualActionTwo h @[simp] theorem paperCoordinateActionOne_apply (h : H) (p : Coordinates) : @@ -167,7 +167,7 @@ def paperCoordinateActionTwo (h : H) : Coordinates ≃+ Coordinates := /-- Forget the additive structure when the factor witness needs permutation actions. Paper: §3. -/ -def paperCoordinatePermAction (dualAction : H →* (Dual ≃ₗ[k] Dual)) : +@[expose] def paperCoordinatePermAction (dualAction : H →* (Dual ≃ₗ[k] Dual)) : H →* Equiv.Perm Coordinates where toFun h := (coordinateAction dualAction h).toEquiv map_one' := by @@ -185,11 +185,11 @@ def paperCoordinatePermAction (dualAction : H →* (Dual ≃ₗ[k] Dual)) : (coordinateAction_mul dualAction h h') /-- The first Zhou coordinate action as a permutation action. Paper: §3. -/ -def paperCoordinatePermActionOne : H →* Equiv.Perm Coordinates := +@[expose] def paperCoordinatePermActionOne : H →* Equiv.Perm Coordinates := paperCoordinatePermAction paperDualActionOne /-- The second Zhou coordinate action as a permutation action. Paper: §3. -/ -def paperCoordinatePermActionTwo : H →* Equiv.Perm Coordinates := +@[expose] def paperCoordinatePermActionTwo : H →* Equiv.Perm Coordinates := paperCoordinatePermAction paperDualActionTwo end 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..be8a82a2a6 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 := @@ -177,7 +180,7 @@ def dualTensorToPartial : Module.Dual k AVStar →ₗ[k] /-- The `partialToDual` construction used in the Connes rigidity formalization. -/ -def partialToDual : (VStar →ₗ[k] Module.Dual k A) →ₗ[k] +@[expose] def partialToDual : (VStar →ₗ[k] Module.Dual k A) →ₗ[k] Module.Dual k AVStar where toFun g := TensorProduct.lift { toFun := fun a => @@ -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..f18ddf747b 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 @@ -169,7 +169,7 @@ def characterToProduct (χ : CharacterSpace) : Additive PChar × Additive QChar /-- The `characterProductEquiv` construction used in the Connes rigidity formalization. -/ -def characterProductEquiv : CharacterSpace ≃+ +@[expose] def characterProductEquiv : CharacterSpace ≃+ (Additive PChar × Additive QChar) where toFun := characterToProduct invFun := productToCharacter @@ -260,7 +260,7 @@ theorem continuous_productToCharacter : Continuous (productToCharacter : /-- The `characterProductHomeomorph` construction used in the Connes rigidity formalization. -/ -def characterProductHomeomorph : +@[expose] def characterProductHomeomorph : CharacterSpace ≃ₜ (Additive PChar × Additive QChar) := Homeomorph.mk characterProductEquiv.toEquiv (by exact continuous_characterToProduct) @@ -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..cdbe0e8231 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 χ) @@ -328,7 +330,7 @@ noncomputable instance paperCoordinatesTopology : TopologicalSpace Coordinates : /-- The character/coordinate equivalence is a homeomorphism for the transported topology. Paper: §3. -/ -def characterCoordinatesHomeomorph : CharacterSpace ≃ₜ Coordinates := +@[expose] def characterCoordinatesHomeomorph : CharacterSpace ≃ₜ Coordinates := Homeomorph.mk PaperDualHaar.characterCoordinatesEquiv.toEquiv (by apply continuous_induced_rng.mpr @@ -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..33f9966474 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. -/ @@ -301,7 +303,7 @@ theorem characterL2_span_closure_eq_top : /-- The `FourierBasis` construction used in the Connes rigidity formalization. -/ -def FourierBasis : HilbertBasis D ℂ (Lp ℂ 2 paperCharacterHaar) := +@[expose] def FourierBasis : HilbertBasis D ℂ (Lp ℂ 2 paperCharacterHaar) := HilbertBasis.mk characterL2_orthonormal characterL2_span_closure_eq_top.ge @@ -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..90e7a81298 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 @@ -162,8 +162,8 @@ theorem paperFourierUnitary_single (d : D) : (l2Reindex (Multiplicative.toAdd : Multiplicative D ≃ D) (lp.single 2 (Multiplicative.ofAdd d) (1 : ℂ))) = characterL2 d rw [l2Reindex_single] - exact Orthonormal.linearIsometryEquiv_symm_apply_single_one - characterL2_orthonormal characterL2_span_closure_eq_top.ge d + change FourierBasis.repr.symm (lp.single 2 d 1) = characterL2 d + simpa only [FourierBasis_coe] using FourierBasis.repr_symm_single d /- Scalar multiples of Fourier point masses are transported linearly. Paper: §3. -/ private theorem fourierUnitary_single_smul diff --git a/LeanPool/ConnesRigidity/Paper/Section3/FourierCoordinates.lean b/LeanPool/ConnesRigidity/Paper/Section3/FourierCoordinates.lean index 84e9a098fe..b327502b02 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 @@ -70,7 +70,7 @@ local instance paperMultiplicativeDDecidableEq : /-- The `characterCoordinatesMeasurableEquiv` construction used in the Connes rigidity formalization. -/ -def characterCoordinatesMeasurableEquiv : CharacterSpace ≃ᵐ Coordinates where +@[expose] def characterCoordinatesMeasurableEquiv : CharacterSpace ≃ᵐ Coordinates where toEquiv := PaperDualHaar.characterCoordinatesEquiv.toEquiv measurable_toFun := characterCoordinatesHomeomorph.continuous.measurable measurable_invFun := characterCoordinatesHomeomorph.symm.continuous.measurable @@ -103,7 +103,7 @@ theorem characterCoordinates_measurePreserving : /-- The `characterCoordinatesLpEquiv` construction used in the Connes rigidity formalization. -/ -def characterCoordinatesLpEquiv : CharacterL2 ≃ₗᵢ[ℂ] CoordinateL2 where +@[expose] def characterCoordinatesLpEquiv : CharacterL2 ≃ₗᵢ[ℂ] CoordinateL2 where toLinearEquiv := { toFun := Lp.compMeasurePreserving (characterCoordinatesMeasurableEquiv.symm : Coordinates → CharacterSpace) @@ -163,7 +163,7 @@ def paperFourierCoordinateUnitary : /-- The `coordinateCharacterL2` construction used in the Connes rigidity formalization. -/ -def coordinateCharacterL2 (d : D) : CoordinateL2 := +@[expose] def coordinateCharacterL2 (d : D) : CoordinateL2 := characterCoordinatesLpEquiv (characterL2 d) @[simp] theorem paperFourierCoordinateUnitary_single (d : D) : @@ -175,7 +175,7 @@ def coordinateCharacterL2 (d : D) : CoordinateL2 := /-- The transported kernel multiplier in raw coordinates. Paper: §3. -/ -def coordinateCharacterMultiplier (d : D) : +@[expose] def coordinateCharacterMultiplier (d : D) : CoordinateL2 →L[ℂ] CoordinateL2 := characterCoordinatesLpEquiv.conjStarAlgEquiv (characterMultiplier (complexCharacter d)) diff --git a/LeanPool/ConnesRigidity/Paper/Section3/GroupFactor.lean b/LeanPool/ConnesRigidity/Paper/Section3/GroupFactor.lean index 3c283afb02..800700d65e 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 @@ -57,14 +57,14 @@ abbrev CrossedTwo := crossedHilbert paperHaarActionTwo /-- The `paperGroupFactorUnitaryOne` construction used in the Connes rigidity formalization. -/ -def paperGroupFactorUnitaryOne : +@[expose] def paperGroupFactorUnitaryOne : GroupL2 Γ₁ ≃ₗᵢ[ℂ] CrossedOne := (semidirectFubini paperThetaOneHom).trans (crossedFiberwiseEquiv (K := H) paperFourierCoordinateUnitary) /-- The second concrete Zhou group-factor unitary. Paper: §3. -/ -def paperGroupFactorUnitaryTwo : +@[expose] def paperGroupFactorUnitaryTwo : GroupL2 Γ₂ ≃ₗᵢ[ℂ] CrossedTwo := (semidirectFubini paperThetaTwoHom).trans (crossedFiberwiseEquiv (K := H) paperFourierCoordinateUnitary) 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..238c283f85 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 @@ -79,13 +79,13 @@ local instance paperHaarActionTwoFinite : /-- The `paperIdentityOne` construction used in the Connes rigidity formalization. -/ -def paperIdentityOne : GroupL2 Γ₁ := +@[expose] def paperIdentityOne : GroupL2 Γ₁ := lp.single 2 (1 : Γ₁) (1 : ℂ) /-- The `paperIdentityTwo` construction used in the Connes rigidity formalization. -/ -def paperIdentityTwo : GroupL2 Γ₂ := +@[expose] def paperIdentityTwo : GroupL2 Γ₂ := lp.single 2 (1 : Γ₂) (1 : ℂ) /- The zero Fourier character is the constant vector. Paper: §3. -/ diff --git a/LeanPool/ConnesRigidity/Paper/Section3/QuotientAction.lean b/LeanPool/ConnesRigidity/Paper/Section3/QuotientAction.lean index a247543749..561f3ee283 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 @@ -95,13 +95,13 @@ def paperThetaTwoAddEquiv (h : H) : D ≃+ D := /-- The multiplicative reindexing form used by the group Hilbert space. Paper: §3. -/ -def paperThetaOneMulEquiv (h : H) : Multiplicative D ≃ Multiplicative D := +@[expose] def paperThetaOneMulEquiv (h : H) : Multiplicative D ≃ Multiplicative D := (additiveEquivToMulAut (paperThetaOneLinearHom h)).toEquiv /-- The second quotient has the analogous multiplicative reindexing. Paper: §3. -/ -def paperThetaTwoMulEquiv (h : H) : Multiplicative D ≃ Multiplicative D := +@[expose] def paperThetaTwoMulEquiv (h : H) : Multiplicative D ≃ Multiplicative D := (additiveEquivToMulAut (paperThetaTwoLinearHom h)).toEquiv @[simp] theorem paperThetaOneMulEquiv_ofAdd (h : H) (d : D) : 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..7231183848 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 @@ -55,7 +55,7 @@ abbrev CharacterSpace := PaperDualTopology.CharacterSpace /-- The A-coordinate embedding into the first kernel summand. Paper: §4. -/ -def aCoordinateEmbedding (v : OpenAIPort.SymplecticIndex) : +@[expose] def aCoordinateEmbedding (v : OpenAIPort.SymplecticIndex) : A →ₗ[k] D where toFun a := (a ⊗ₜ[k] LinearMap.proj v, 0) map_add' a b := by @@ -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) @@ -501,7 +501,7 @@ theorem aChartVector_mem_some_chart (a : A) : /-- The `aNonzeroLocus` construction used in the Connes rigidity formalization. -/ -def aNonzeroLocus (v : OpenAIPort.SymplecticIndex) : +@[expose] def aNonzeroLocus (v : OpenAIPort.SymplecticIndex) : Set CharacterSpace := {χ : CharacterSpace | aChartLinear χ v ≠ 0} diff --git a/LeanPool/ConnesRigidity/Paper/Section4/ChartDetector.lean b/LeanPool/ConnesRigidity/Paper/Section4/ChartDetector.lean index 3361f89c9d..31dbb22886 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 @@ -167,7 +167,7 @@ theorem diagonal_sum_expansion {ι : Type*} [Fintype ι] [LinearOrder ι] /-- The `chartIndexOfCoefficients` construction used in the Connes rigidity formalization. -/ -def chartIndexOfCoefficients (N : ℕ) (s : Fin 3) +@[expose] def chartIndexOfCoefficients (N : ℕ) (s : Fin 3) (x : PaperFiniteCharts.CoeffIndex N → F) : PaperFiniteCharts.ChartIndex N := (s, (fun i => x (Sum.inl i)), (fun i => x (Sum.inr i))) @@ -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,13 +372,13 @@ 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 /-- The `chartEvalSupport` construction used in the Connes rigidity formalization. -/ -def chartEvalSupport (χ : C →ₗ[k] k) (N : ℕ) : +@[expose] def chartEvalSupport (χ : C →ₗ[k] k) (N : ℕ) : Finset (ChartEvalIndex N) := by classical exact Finset.univ.filter (fun i => chartEvalValue χ N i ≠ 0) diff --git a/LeanPool/ConnesRigidity/Paper/Section4/ChartDetectorMeasure.lean b/LeanPool/ConnesRigidity/Paper/Section4/ChartDetectorMeasure.lean index 4c90630ce5..31aeac32dd 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 @@ -64,7 +64,7 @@ abbrev CharacterSpace := PaperDualTopology.CharacterSpace /-- The `paperThetaOneAddAction` construction used in the Connes rigidity formalization. -/ -def paperThetaOneAddAction : H →* Multiplicative (AddAut D) := +@[expose] def paperThetaOneAddAction : H →* Multiplicative (AddAut D) := (MulAutMultiplicative D).toMonoidHom.comp PaperKernel.paperThetaOneHom @@ -75,7 +75,7 @@ def paperThetaOneAddAction : H →* Multiplicative (AddAut D) := /-- The second paper kernel action reserved for the companion detector. Paper: §4. -/ -def paperThetaTwoAddAction : H →* Multiplicative (AddAut D) := +@[expose] def paperThetaTwoAddAction : H →* Multiplicative (AddAut D) := (MulAutMultiplicative D).toMonoidHom.comp PaperKernel.paperThetaTwoHom @@ -86,7 +86,7 @@ def paperThetaTwoAddAction : H →* Multiplicative (AddAut D) := /-- In Zhou's detector corollary only the SL₃ subgroup is used. Paper: §4. -/ -def IsInvariantPaperSL3SpectralMeasure +@[expose] def IsInvariantPaperSL3SpectralMeasure (μ : ProbabilityMeasure CharacterSpace) : Prop := ∀ g : SpecialLinear.SL3, (μ : Measure CharacterSpace).map @@ -126,12 +126,12 @@ lemma paperThetaOne_inverse_transport (g : SpecialLinear.SL3) (e : C) /-- The `chartLinear` construction used in the Connes rigidity formalization. -/ -def chartLinear (χ : CharacterSpace) : C →ₗ[k] k := +@[expose] def chartLinear (χ : CharacterSpace) : C →ₗ[k] k := (PaperDualHaar.characterCoordinatesEquiv χ).2 /-- 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. -/ @@ -195,7 +195,7 @@ theorem chartSquareDetector_measure_eq_base /-- The `chartEvalIndexEquiv` construction used in the Connes rigidity formalization. -/ -def chartEvalIndexEquiv (N : ℕ) : ChartIndex N ≃ ChartEvalIndex N where +@[expose] def chartEvalIndexEquiv (N : ℕ) : ChartIndex N ≃ ChartEvalIndex N where toFun i := (i.1, fun x => Sum.elim i.2.1 i.2.2 x) invFun j := (j.1, (fun x => j.2 (Sum.inl x)), (fun x => j.2 (Sum.inr x))) left_inv i := by @@ -238,7 +238,7 @@ theorem chartEvalValue_of_chartIndex (χ : CharacterSpace) /-- The `chartDetectorSupport` construction used in the Connes rigidity formalization. -/ -def chartDetectorSupport (χ : CharacterSpace) (N : ℕ) : +@[expose] def chartDetectorSupport (χ : CharacterSpace) (N : ℕ) : Finset (ChartIndex N) := by classical exact Finset.univ.filter @@ -394,7 +394,7 @@ theorem chartDetectorUnion_mono {N M : ℕ} (hNM : N ≤ M) : /-- The `chartNonzeroLocus` construction used in the Connes rigidity formalization. -/ -def chartNonzeroLocus : Set CharacterSpace := +@[expose] def chartNonzeroLocus : Set CharacterSpace := {χ : CharacterSpace | chartLinear χ ≠ 0} /- The chart unions exhaust the characters with nonzero C-coordinate. Paper: §4. -/ diff --git a/LeanPool/ConnesRigidity/Paper/Section4/ChartMeasure.lean b/LeanPool/ConnesRigidity/Paper/Section4/ChartMeasure.lean index afd70a16ad..d56ef54f67 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 @@ -76,7 +76,7 @@ theorem measurable_paperDualCharacterAction {H : CountableDiscreteGroup} /-- Invariant probability measure for the additive character action, whose measurability is recorded above. Paper: §4. -/ -def IsInvariantPaperSpectralMeasure {H : CountableDiscreteGroup} +@[expose] def IsInvariantPaperSpectralMeasure {H : CountableDiscreteGroup} (action : H →* Multiplicative (AddAut D)) (μ : ProbabilityMeasure CharacterSpace) : Prop := ∀ h : H, @@ -85,7 +85,7 @@ def IsInvariantPaperSpectralMeasure {H : CountableDiscreteGroup} /-- The `linearDetector` construction used in the Connes rigidity formalization. -/ -def linearDetector (d : D) : Set CharacterSpace := +@[expose] def linearDetector (d : D) : Set CharacterSpace := {χ | BinaryPontryaginDual.characterLinear (M := D) (Additive.toMul χ) d = 1} 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..54ff45d15f 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,18 +133,18 @@ 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. -/ -def chartSubmodule (N : ℕ) : Submodule k C := +@[expose] def chartSubmodule (N : ℕ) : Submodule k C := Submodule.span k (Set.range (chartSquare N)) /-- Coordinate basis for the two polynomial parameters. 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..b3e8887d4e 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 @@ -70,7 +70,7 @@ theorem aChartLinear_eq_coordinate (χ : CharacterSpace) /-- The `fullNonzeroLocus` construction used in the Connes rigidity formalization. -/ -def fullNonzeroLocus : Set CharacterSpace := +@[expose] def fullNonzeroLocus : Set CharacterSpace := {χ : CharacterSpace | PaperDualHaar.characterLinearEquiv χ ≠ 0} diff --git a/LeanPool/ConnesRigidity/Paper/Section4/PropertyT.lean b/LeanPool/ConnesRigidity/Paper/Section4/PropertyT.lean index cc90185dd5..d490bb66e8 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 @@ -52,7 +52,7 @@ theorem sl3_propertyT_from_EJZK (input : EJZKInput.{v}) : elementaryGroup SpecialLinear.sl3Group elementaryEquivSL3).mp input.propertyT /-- Inclusion of the SL₃ factor into the actual acting group. Paper: §4. -/ -def sl3ToActingGroup : SpecialLinear.SL3 →* H where +@[expose] def sl3ToActingGroup : SpecialLinear.SL3 →* H where toFun l := (l, 1) map_one' := by rfl map_mul' l m := by simp @@ -63,7 +63,7 @@ def sl3ToActingGroup : SpecialLinear.SL3 →* H where rfl /-- The finite quotient in Zhou Proposition 4.8. Paper: §4. -/ -noncomputable def finiteSymplecticGroup : CountableDiscreteGroup where +@[expose] noncomputable def finiteSymplecticGroup : CountableDiscreteGroup where Carrier := Q group := inferInstance countable := by infer_instance 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..5b879ac8b6 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 @@ -159,7 +159,7 @@ lemma diagonal_basisVector_zero_ne_zero : apply basisVector_zero_ne_zero have hdelta := congrArg PaperKernel.delta h rw [PaperKernel.delta_diagonal] at hdelta - exact hdelta + simpa only [map_zero] using hdelta /- The C detector does not duplicate an A-coordinate detector. Paper: §4. -/ lemma cDetector_not_mem_image : 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..aea99e93e5 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 @@ -38,7 +38,7 @@ private theorem semidirectConjugation by simpa only [map_inv] using (SemidirectProduct.inl_aut g n).symm /-- The SL₃ semidirect product as a split abelian extension. Paper: §4. -/ -noncomputable def lambdaExtension +@[expose] noncomputable def lambdaExtension (action : H →* MulAut (Multiplicative PaperKernel.D)) : SplitAbelianExtension PaperKernel.D (PaperPropertyT.lambdaOf action) SpecialLinear.sl3Group := { 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..5554aac49f 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 @@ -115,7 +115,7 @@ theorem qVStar_transitive_on_nonzero_test : /-- The `qVStarRepresentation` construction used in the Connes rigidity formalization. -/ -def qVStarRepresentation : Representation k Q W where +@[expose] def qVStarRepresentation : Representation k Q W where toFun q := (qVStarActionHom q).toLinearMap map_one' := by apply LinearMap.ext @@ -179,18 +179,18 @@ abbrev DS := DirectSum I (fun _ => W) /-- The `avStarActionQEquivHom` construction used in the Connes rigidity formalization. -/ -def avStarActionQEquivHom : Q →* (AV ≃ₗ[k] AV) := +@[expose] def avStarActionQEquivHom : Q →* (AV ≃ₗ[k] AV) := PaperKernel.avStarActionHom.comp qToH /-- The tensor summand carries the actual quotient action. Paper: §6. -/ -def avStarRepresentation : Representation k Q AV := +@[expose] def avStarRepresentation : Representation k Q AV := LinearEquiv.automorphismGroup.toLinearMapMonoidHom.comp avStarActionQEquivHom /-- The direct sum of copies of the finite dual representation is explicit. Paper: §6. -/ -def directSumRepresentation : Representation k Q DS := +@[expose] def directSumRepresentation : Representation k Q DS := Representation.directSum (fun _ : I => qVStarRepresentation) /-- The direct sum is identified with its finitely supported coordinate model. Paper: §6. @@ -204,7 +204,7 @@ noncomputable def directSumFinsuppEquiv : /-- The ordered tensor basis identifies `AVStar` with the direct sum coordinates. Paper: §6. -/ -def tensorDirectSumEquiv : AV ≃ₗ[k] DS := +@[expose] def tensorDirectSumEquiv : AV ≃ₗ[k] DS := (TensorProduct.equivFinsuppOfBasisLeft (M := Construction.A) (N := PaperKernel.VStar) PaperKernel.orderedBasis).trans (finsuppLequivDFinsupp k) @@ -384,7 +384,7 @@ noncomputable def cBasis : Module.Basis CI k PaperKernel.C := /-- The quotient action on `C` is trivial in the first module. Paper: §6. -/ -def cRepresentation : Representation k Q PaperKernel.C := +@[expose] def cRepresentation : Representation k Q PaperKernel.C := Representation.trivial k Q PaperKernel.C /-- The coordinate representation on the `C` basis is trivial. Paper: §6. @@ -476,12 +476,12 @@ theorem cRepresentation_semisimple : /-- The `firstProductRepresentation` construction used in the Connes rigidity formalization. -/ -def firstProductRepresentation : Representation k Q (AV × PaperKernel.C) := +@[expose] def firstProductRepresentation : Representation k Q (AV × PaperKernel.C) := avStarRepresentation.prod cRepresentation /-- The tensor summand embeds as a group-algebra submodule of the product. Paper: §6. -/ -def firstProductInl : avStarRepresentation.asModule →ₗ[Ring] +@[expose] def firstProductInl : avStarRepresentation.asModule →ₗ[Ring] firstProductRepresentation.asModule := (Representation.IntertwiningMap.equivLinearMapAsModule avStarRepresentation firstProductRepresentation).toFun @@ -489,7 +489,7 @@ def firstProductInl : avStarRepresentation.asModule →ₗ[Ring] /-- The `C` summand embeds as a group-algebra submodule of the product. Paper: §6. -/ -def firstProductInr : cRepresentation.asModule →ₗ[Ring] +@[expose] def firstProductInr : cRepresentation.asModule →ₗ[Ring] firstProductRepresentation.asModule := (Representation.IntertwiningMap.equivLinearMapAsModule cRepresentation firstProductRepresentation).toFun diff --git a/LeanPool/ConnesRigidity/Paper/Section6/ModuleSemisimpleTransport.lean b/LeanPool/ConnesRigidity/Paper/Section6/ModuleSemisimpleTransport.lean index ad3aedf3ba..ed92feb6da 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 @@ -39,7 +39,7 @@ abbrev D := PaperKernel.D /-- The `paperFirstProductRepresentation` construction used in the Connes rigidity formalization. -/ -def paperFirstProductRepresentation : Representation k Q D := +@[expose] def paperFirstProductRepresentation : Representation k Q D := PaperModuleSemisimple.firstProductRepresentation /- The paper-facing first action agrees with the decomposed representation. Paper: §6. -/ diff --git a/LeanPool/ConnesRigidity/Paper/Section6/Nonisomorphism.lean b/LeanPool/ConnesRigidity/Paper/Section6/Nonisomorphism.lean index 991d2d5dfe..60c664f184 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 @@ -39,21 +39,21 @@ The `Ring` construction used in the Connes rigidity formalization. abbrev Ring := MonoidAlgebra k Q /-- The quotient action map `Sp₄(F₂) → SL₃(R) × Sp₄(F₂)`. Paper: §§2, 6. -/ -def qToH : Q →* H where +@[expose] def qToH : Q →* H where toFun q := (1, q) map_one' := by rfl map_mul' p q := by simp /-- The first quotient action on the actual additive kernel. Paper: §6. -/ -def qLinearActionOne : Q →* (D ≃ₗ[k] D) := +@[expose] def qLinearActionOne : Q →* (D ≃ₗ[k] D) := PaperKernel.paperThetaOneLinearHom.comp qToH /-- The second quotient action on the actual additive kernel. Paper: §6. -/ -def qLinearActionTwo : Q →* (D ≃ₗ[k] D) := +@[expose] def qLinearActionTwo : Q →* (D ≃ₗ[k] D) := PaperKernel.paperThetaTwoLinearHom.comp qToH /-- Linear representation attached to the first actual quotient action. -/ -def qRepresentationOne : Representation k Q D where +@[expose] def qRepresentationOne : Representation k Q D where toFun q := (qLinearActionOne q).toLinearMap map_one' := by apply LinearMap.ext @@ -70,7 +70,7 @@ def qRepresentationOne : Representation k Q D where (qLinearActionOne.map_mul p q) /-- Linear representation attached to the second actual quotient action. -/ -def qRepresentationTwo : Representation k Q D where +@[expose] def qRepresentationTwo : Representation k Q D where toFun q := (qLinearActionTwo q).toLinearMap map_one' := by apply LinearMap.ext @@ -88,7 +88,7 @@ def qRepresentationTwo : Representation k Q D where /-- Pull back the second quotient action along the quotient automorphism induced by a hypothetical group isomorphism. Paper: §6. -/ -def qRepresentationTwoAlong (σ : Q ≃* Q) : Representation k Q D where +@[expose] def qRepresentationTwoAlong (σ : Q ≃* Q) : Representation k Q D where toFun q := qRepresentationTwo (σ q) map_one' := by apply LinearMap.ext @@ -131,7 +131,7 @@ abbrev W := OpenAIPort.ModTwoSpace /-- The finite quadratic correction appearing in the second action. Paper: §2, §6. -/ -def cocycle (q : Q) (v : W) : k := +@[expose] def cocycle (q : Q) (v : W) : k := OpenAIPort.standardQuadraticForm (q⁻¹ • v) + OpenAIPort.standardQuadraticForm v diff --git a/LeanPool/ConnesRigidity/Paper/Section6/NonisomorphismEmbedding.lean b/LeanPool/ConnesRigidity/Paper/Section6/NonisomorphismEmbedding.lean index ce5bb67dd5..a2a7444183 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 @@ -31,7 +31,7 @@ noncomputable section /-- The `paperDTwoEmbeddingLinear` construction used in the Connes rigidity formalization. -/ -def paperDTwoEmbeddingLinear : PaperEll →ₗ[k] PaperKernel.D where +@[expose] def paperDTwoEmbeddingLinear : PaperEll →ₗ[k] PaperKernel.D where toFun p := (a0 ⊗ₜ[k] p.1, p.2 • PaperKernel.diagonal a0) map_add' p r := by @@ -102,7 +102,7 @@ theorem paperDTwoEmbedding_injective : apply a0_ne_zero have hdelta := congrArg PaperKernel.delta hzero rw [PaperKernel.delta_diagonal] at hdelta - exact hdelta + simpa only [map_zero] using hdelta have hscalar : p.2 = r.2 := (smul_left_injective k (m := PaperKernel.diagonal a0) hdiag) hsecond have hfunctional : ∀ v : PaperKernel.PaperV, p.1 v = r.1 v := by @@ -146,7 +146,7 @@ theorem paper_moduleTwo_not_semisimple : /-- The `paperEllRepresentationAlong` construction used in the Connes rigidity formalization. -/ -def paperEllRepresentationAlong (σ : PaperKernel.Q ≃* PaperKernel.Q) : +@[expose] def paperEllRepresentationAlong (σ : PaperKernel.Q ≃* PaperKernel.Q) : Representation k PaperKernel.Q PaperEll := paperEllRepresentation.comp σ @@ -198,7 +198,7 @@ theorem paperDTwoEmbeddingAlong_injective /-- The `paperEllVStarRepresentationAlong` construction used in the Connes rigidity formalization. -/ -def paperEllVStarRepresentationAlong +@[expose] def paperEllVStarRepresentationAlong (σ : PaperKernel.Q ≃* PaperKernel.Q) : Representation k PaperKernel.Q PaperKernel.VStar := paperEllVStarRepresentation.comp σ @@ -206,7 +206,7 @@ def paperEllVStarRepresentationAlong /-- The `paperEllScalarRepresentationAlong` construction used in the Connes rigidity formalization. -/ -def paperEllScalarRepresentationAlong +@[expose] def paperEllScalarRepresentationAlong (σ : PaperKernel.Q ≃* PaperKernel.Q) : Representation k PaperKernel.Q k := paperEllScalarRepresentation.comp σ @@ -214,7 +214,7 @@ def paperEllScalarRepresentationAlong /-- The `paperEllInclusionIntertwiningAlong` construction used in the Connes rigidity formalization. -/ -def paperEllInclusionIntertwiningAlong +@[expose] def paperEllInclusionIntertwiningAlong (σ : PaperKernel.Q ≃* PaperKernel.Q) : Representation.IntertwiningMap (paperEllVStarRepresentationAlong σ) @@ -235,7 +235,7 @@ def paperEllInclusionIntertwiningAlong /-- The `paperEllProjectionIntertwiningAlong` construction used in the Connes rigidity formalization. -/ -def paperEllProjectionIntertwiningAlong +@[expose] def paperEllProjectionIntertwiningAlong (σ : PaperKernel.Q ≃* PaperKernel.Q) : Representation.IntertwiningMap (paperEllRepresentationAlong σ) @@ -256,7 +256,7 @@ def paperEllProjectionIntertwiningAlong /-- The `paperEllInclusionAlong` construction used in the Connes rigidity formalization. -/ -def paperEllInclusionAlong +@[expose] def paperEllInclusionAlong (σ : PaperKernel.Q ≃* PaperKernel.Q) : (paperEllVStarRepresentationAlong σ).asModule →ₗ[Ring] (paperEllRepresentationAlong σ).asModule := @@ -268,7 +268,7 @@ def paperEllInclusionAlong /-- The `paperEllProjectionAlong` construction used in the Connes rigidity formalization. -/ -def paperEllProjectionAlong +@[expose] def paperEllProjectionAlong (σ : PaperKernel.Q ≃* PaperKernel.Q) : (paperEllRepresentationAlong σ).asModule →ₗ[Ring] (paperEllScalarRepresentationAlong σ).asModule := diff --git a/LeanPool/ConnesRigidity/Paper/Section6/NonisomorphismProofs.lean b/LeanPool/ConnesRigidity/Paper/Section6/NonisomorphismProofs.lean index 3f9a71e548..dea54f4224 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 @@ -36,7 +36,7 @@ abbrev PaperEll := PaperKernel.VStar × k /-- The `paperEllMap` construction used in the Connes rigidity formalization. -/ -def paperEllMap (q : PaperKernel.Q) : PaperEll →ₗ[k] PaperEll where +@[expose] def paperEllMap (q : PaperKernel.Q) : PaperEll →ₗ[k] PaperEll where toFun p := (qVStarActionHom q p.1 + p.2 • OpenAIPort.quadraticDefectLinear q, p.2) map_add' p r := by @@ -52,7 +52,7 @@ def paperEllMap (q : PaperKernel.Q) : PaperEll →ₗ[k] PaperEll where /-- The `paperEllRepresentation` construction used in the Connes rigidity formalization. -/ -def paperEllRepresentation : Representation k PaperKernel.Q PaperEll where +@[expose] def paperEllRepresentation : Representation k PaperKernel.Q PaperEll where toFun := paperEllMap map_one' := by have hq : OpenAIPort.quadraticDefectLinear (1 : PaperKernel.Q) = 0 := by @@ -81,7 +81,7 @@ def paperEllRepresentation : Representation k PaperKernel.Q PaperEll where /-- The `paperEllVStarRepresentation` construction used in the Connes rigidity formalization. -/ -def paperEllVStarRepresentation : Representation k PaperKernel.Q PaperKernel.VStar := +@[expose] def paperEllVStarRepresentation : Representation k PaperKernel.Q PaperKernel.VStar := { toFun := fun q => (qVStarActionHom q).toLinearMap map_one' := by apply LinearMap.ext @@ -98,13 +98,13 @@ 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 /-- The `paperEllInclusionLinear` construction used in the Connes rigidity formalization. -/ -def paperEllInclusionLinear : PaperKernel.VStar →ₗ[k] PaperEll where +@[expose] def paperEllInclusionLinear : PaperKernel.VStar →ₗ[k] PaperEll where toFun f := (f, 0) map_add' f g := by simp map_smul' a f := by simp @@ -112,7 +112,7 @@ def paperEllInclusionLinear : PaperKernel.VStar →ₗ[k] PaperEll where /-- The `paperEllInclusionIntertwining` construction used in the Connes rigidity formalization. -/ -def paperEllInclusionIntertwining : +@[expose] def paperEllInclusionIntertwining : Representation.IntertwiningMap paperEllVStarRepresentation paperEllRepresentation := paperEllInclusionLinear.intertwiningMap_of_isIntertwiningMap paperEllVStarRepresentation paperEllRepresentation (by @@ -125,7 +125,7 @@ def paperEllInclusionIntertwining : /-- The `paperEllProjectionLinear` construction used in the Connes rigidity formalization. -/ -def paperEllProjectionLinear : PaperEll →ₗ[k] k where +@[expose] def paperEllProjectionLinear : PaperEll →ₗ[k] k where toFun p := p.2 map_add' p q := by simp map_smul' a p := by simp @@ -133,7 +133,7 @@ def paperEllProjectionLinear : PaperEll →ₗ[k] k where /-- The `paperEllProjectionIntertwining` construction used in the Connes rigidity formalization. -/ -def paperEllProjectionIntertwining : +@[expose] def paperEllProjectionIntertwining : Representation.IntertwiningMap paperEllRepresentation paperEllScalarRepresentation := paperEllProjectionLinear.intertwiningMap_of_isIntertwiningMap paperEllRepresentation paperEllScalarRepresentation (by 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/ConwayRefinement/CombinatorialGames/Game/Basic.lean b/LeanPool/ConwayRefinement/CombinatorialGames/Game/Basic.lean index bf666a4dd5..6a0af53c89 100644 --- a/LeanPool/ConwayRefinement/CombinatorialGames/Game/Basic.lean +++ b/LeanPool/ConwayRefinement/CombinatorialGames/Game/Basic.lean @@ -29,7 +29,7 @@ there exist `x₁ ≈ x₂` and `y₁ ≈ y₂` with `x₁ * y₁ ≉ x₂ * y universe u -@[expose] public noncomputable section +public noncomputable section open IGame Set Pointwise @@ -44,13 +44,13 @@ extra move for Left. In particular, note that a `ConwayGame` has no well-defined notion of left and right options. This means you should prefer `IGame` when analyzing specific games. -/ -def ConwayGame : Type (u + 1) := +@[expose] def ConwayGame : Type (u + 1) := Antisymmetrization IGame (· ≤ ·) namespace ConwayGame /-- The quotient map from `IGame` into `ConwayGame`. -/ -def mk (x : IGame) : ConwayGame := Quotient.mk _ x +@[expose] def mk (x : IGame) : ConwayGame := Quotient.mk _ x theorem mk_eq_mk {x y : IGame} : mk x = mk y ↔ x ≈ y := Quotient.eq alias ⟨_, mk_eq⟩ := mk_eq_mk @@ -60,7 +60,7 @@ theorem ind {motive : ConwayGame → Prop} (mk : ∀ y, motive (mk y)) (x : Conw Quotient.ind mk x /-- Choose an element of the equivalence class using the axiom of choice. -/ -@[no_expose] def out (x : ConwayGame) : IGame := Quotient.out x +def out (x : ConwayGame) : IGame := Quotient.out x @[simp] theorem out_eq (x : ConwayGame) : mk x.out = x := Quotient.out_eq x theorem mk_out_equiv (x : IGame) : (mk x).out ≈ x := Quotient.mk_out (s := AntisymmRel.setoid ..) x diff --git a/LeanPool/ConwayRefinement/CombinatorialGames/Game/Classes.lean b/LeanPool/ConwayRefinement/CombinatorialGames/Game/Classes.lean index f16eb77e0f..6fcb7460fc 100644 --- a/LeanPool/ConwayRefinement/CombinatorialGames/Game/Classes.lean +++ b/LeanPool/ConwayRefinement/CombinatorialGames/Game/Classes.lean @@ -47,7 +47,7 @@ on combinatorial games. This functionality is now implemented through the `game_ universe u -@[expose] public section +public section namespace IGame diff --git a/LeanPool/ConwayRefinement/CombinatorialGames/Game/Functor.lean b/LeanPool/ConwayRefinement/CombinatorialGames/Game/Functor.lean index 79fcb23f74..96c40a7d45 100644 --- a/LeanPool/ConwayRefinement/CombinatorialGames/Game/Functor.lean +++ b/LeanPool/ConwayRefinement/CombinatorialGames/Game/Functor.lean @@ -40,7 +40,7 @@ functor. universe u -@[expose] public section +public section /-! ### ConwayGame Functor -/ @@ -61,7 +61,7 @@ coinductive LGame : Type (u + 1) | ofSets (st : Player → Set IGame) [∀ p, Small.{u} (st p)] : LGame.{u} ``` -/ -def GameFunctor (α : Type (u + 1)) : Type (u + 1) := +@[expose] def GameFunctor (α : Type (u + 1)) : Type (u + 1) := {s : Player → Set α // ∀ p, Small.{u} (s p)} namespace GameFunctor diff --git a/LeanPool/ConwayRefinement/CombinatorialGames/Game/Ordinal.lean b/LeanPool/ConwayRefinement/CombinatorialGames/Game/Ordinal.lean index 99a5ea4000..f50888f7a9 100644 --- a/LeanPool/ConwayRefinement/CombinatorialGames/Game/Ordinal.lean +++ b/LeanPool/ConwayRefinement/CombinatorialGames/Game/Ordinal.lean @@ -34,7 +34,7 @@ universe u open Set IGame -@[expose] public noncomputable section +public noncomputable section /-! ### Lemmas to upstream -/ @@ -75,7 +75,6 @@ private theorem toIGame'_strictMono : StrictMono toIGame' := by termination_by a => a /-- The canonical map from `NatOrdinal` to `IGame`, sending `o` to `{Iio o | ∅}`. -/ -@[no_expose] def toIGame : NatOrdinal.{u} ↪o IGame.{u} := .ofStrictMono NatOrdinal.toIGame' toIGame'_strictMono @@ -139,7 +138,7 @@ theorem toIGame_nonneg (a : NatOrdinal) : 0 ≤ a.toIGame := by /-! ### `NatOrdinal` to `ConwayGame` -/ /-- Converts an ordinal into the corresponding game. -/ -noncomputable def toGame : NatOrdinal.{u} ↪o ConwayGame.{u} := +@[expose] noncomputable def toGame : NatOrdinal.{u} ↪o ConwayGame.{u} := .ofStrictMono (fun o ↦ .mk o.toIGame) fun _ _ h ↦ toIGame.strictMono h instance : Coe NatOrdinal ConwayGame where @@ -205,7 +204,7 @@ theorem toGame_mul (a b : NatOrdinal) : (a * b).toGame = .mk (a.toIGame * b.toIG ConwayGame.mk_eq (toIGame_mul a b) /-- `NatOrdinal.toGame` as an `OrderAddMonoidHom`. -/ -@[simps] +@[expose, simps] def toGameAddHom : NatOrdinal →+o ConwayGame where toFun := toGame map_zero' := toGame_zero diff --git a/LeanPool/ConwayRefinement/CombinatorialGames/Game/Player.lean b/LeanPool/ConwayRefinement/CombinatorialGames/Game/Player.lean index aa99e052b3..423e5b0b0d 100644 --- a/LeanPool/ConwayRefinement/CombinatorialGames/Game/Player.lean +++ b/LeanPool/ConwayRefinement/CombinatorialGames/Game/Player.lean @@ -21,7 +21,7 @@ This file implements the two-element type of players (`Left`, `Right`), alongsid notational machinery to be used within game theory. -/ -@[expose] public section +public section universe u diff --git a/LeanPool/ConwayRefinement/CombinatorialGames/Game/Special.lean b/LeanPool/ConwayRefinement/CombinatorialGames/Game/Special.lean index 08e22a947a..33c8b29a3c 100644 --- a/LeanPool/ConwayRefinement/CombinatorialGames/Game/Special.lean +++ b/LeanPool/ConwayRefinement/CombinatorialGames/Game/Special.lean @@ -23,14 +23,14 @@ This file defines some simple yet notable combinatorial games: universe u -@[expose] public noncomputable section +public noncomputable section namespace IGame /-! ### Star -/ /-- The game `⋆ = {0 | 0}`, which is fuzzy with zero. -/ -def star : IGame := +@[expose] def star : IGame := !{fun _ ↦ {0}} @[inherit_doc] notation "⋆" => star @@ -58,7 +58,7 @@ protected instance Impartial.star : Impartial ⋆ := by rw [impartial_def]; simp /-! ### Half -/ /-- The game `½ = {0 | 1}`, which we prove satisfies `½ + ½ = 1`. -/ -def half : IGame := +@[expose] def half : IGame := !{{0} | {1}} @[inherit_doc] notation "½" => half @@ -77,7 +77,7 @@ protected instance Short.half : Short ½ := by rw [short_def]; simp /-! ### Up and down -/ /-- The game `↑ = {0 | ⋆}`. -/ -def up : IGame := +@[expose] def up : IGame := !{{0} | {⋆}} @[inherit_doc] notation "↑" => up @@ -94,7 +94,7 @@ protected instance Dicotic.up : Dicotic ↑ := by rw [dicotic_def]; simp protected instance Short.up : Short ↑ := by rw [short_def]; simp /-- The game `↓ = {⋆ | 0}`. -/ -def down : IGame := +@[expose] def down : IGame := !{{⋆} | {0}} @[inherit_doc] notation "↓" => down @@ -117,7 +117,7 @@ protected instance Short.down : Short ↓ := by rw [short_def]; simp /-- A tiny game `⧾x` is defined as `{0 | {0 | -x}}`, and is amongst the smallest of the infinitesimals. -/ -def tiny (x : IGame) : IGame := +@[expose] def tiny (x : IGame) : IGame := !{{0} | {!{{0} | {-x}}}} @[inherit_doc] prefix:75 "⧾" => tiny diff --git a/LeanPool/ConwayRefinement/CombinatorialGames/Mathlib/Dyadic.lean b/LeanPool/ConwayRefinement/CombinatorialGames/Mathlib/Dyadic.lean index b00dd7ec89..654c350f31 100644 --- a/LeanPool/ConwayRefinement/CombinatorialGames/Mathlib/Dyadic.lean +++ b/LeanPool/ConwayRefinement/CombinatorialGames/Mathlib/Dyadic.lean @@ -17,7 +17,7 @@ A dyadic (rational) number is a rational number whose denominator is a power of the `CommRing` structure, as well as proving some auxiliary theorems on them. -/ -@[expose] public section +public section /-! ### For Mathlib -/ @@ -173,14 +173,14 @@ instance instSMulIntConway : SMul Int Dyadic where (coe_mul x y).trans (by simp) /-- The dyadic number ½. -/ -def half : Dyadic := (1 : Dyadic) >>> 1 +@[expose] def half : Dyadic := (1 : Dyadic) >>> 1 @[simp, norm_cast] theorem coe_half : half.toRat = 2⁻¹ := (Rat.inv_def 2).symm @[simp] theorem num_half : half.num = 1 := rfl @[simp] theorem num_den : half.den = 2 := rfl /-- Constructor for the fraction `m / n`. -/ -protected def mkRat (m : ℤ) {n : ℕ} (h : n ∈ Submonoid.powers 2) : Dyadic := +@[expose] protected def mkRat (m : ℤ) {n : ℕ} (h : n ∈ Submonoid.powers 2) : Dyadic := ofIntWithPrec m (Submonoid.log ⟨n, h⟩) @[simp, norm_cast] @@ -348,7 +348,7 @@ theorem den_add_le_den_right {x y : Dyadic} (h : x.den ≤ y.den) : (x + y).den exact den_mkRat_le _ y.den_ne_zero /-- Coercion as a `RingHom`. -/ -@[simps] +@[expose, simps] def coeRingHom : Dyadic →+* ℚ where toFun := Dyadic.toRat map_zero' := rfl diff --git a/LeanPool/ConwayRefinement/CombinatorialGames/NatOrdinal/Pow.lean b/LeanPool/ConwayRefinement/CombinatorialGames/NatOrdinal/Pow.lean index 48515aed5c..ac2d4ae0ee 100644 --- a/LeanPool/ConwayRefinement/CombinatorialGames/NatOrdinal/Pow.lean +++ b/LeanPool/ConwayRefinement/CombinatorialGames/NatOrdinal/Pow.lean @@ -28,7 +28,7 @@ notation `ω^ x` for `of (ω ^ x.val)`. This typeclass will get reused for `IGam `CombinatorialGames.Surreal.Pow`. -/ -@[expose] public section +public section open Ordinal diff --git a/LeanPool/ConwayRefinement/CombinatorialGames/Surreal/Basic.lean b/LeanPool/ConwayRefinement/CombinatorialGames/Surreal/Basic.lean index 7e52b91077..16607110ce 100644 --- a/LeanPool/ConwayRefinement/CombinatorialGames/Surreal/Basic.lean +++ b/LeanPool/ConwayRefinement/CombinatorialGames/Surreal/Basic.lean @@ -31,7 +31,7 @@ surreals are a field. universe u -@[expose] public noncomputable section +public noncomputable section /-! ### Simplicity theorem -/ @@ -43,7 +43,7 @@ namespace IGame The simplicity theorem states that if a game fits a numeric game, but none of its options do, then the games are equivalent. In particular, a numeric game is equivalent to the game of the least birthday that fits in it -/ -def Fits (x y : IGame) : Prop := +@[expose] def Fits (x y : IGame) : Prop := (∀ z ∈ yᴸ, z ⧏ x) ∧ (∀ z ∈ yᴿ, x ⧏ z) theorem fits_of_equiv {x y : IGame} (h : x ≈ y) : Fits x y := @@ -123,13 +123,13 @@ open IGame /-- The type of surreal numbers. These are the numeric games quotiented by the antisymmetrization relation `x ≈ y ↔ x ≤ y ∧ y ≤ x`. In the quotient, the order becomes a total order. -/ -def Surreal : Type (u + 1) := +@[expose] def Surreal : Type (u + 1) := Antisymmetrization (Subtype Numeric) (· ≤ ·) namespace Surreal /-- The quotient map from the subtype of numeric `IGame`s into `ConwayGame`. -/ -def mk (x : IGame) [h : Numeric x] : Surreal := Quotient.mk _ ⟨x, h⟩ +@[expose] def mk (x : IGame) [h : Numeric x] : Surreal := Quotient.mk _ ⟨x, h⟩ theorem mk_eq_mk {x y : IGame} [Numeric x] [Numeric y] : mk x = mk y ↔ x ≈ y := Quotient.eq alias ⟨_, mk_eq⟩ := mk_eq_mk @@ -139,7 +139,7 @@ theorem ind {motive : Surreal → Prop} (mk : ∀ y [Numeric y], motive (mk y)) motive x := Quotient.ind (fun h ↦ @mk _ h.2) x /-- Choose an element of the equivalence class using the axiom of choice. -/ -@[no_expose] def out (x : Surreal) : IGame := (Quotient.out x).1 +def out (x : Surreal) : IGame := (Quotient.out x).1 @[simp] instance (x : Surreal) : Numeric x.out := (Quotient.out x).2 @[simp] theorem out_eq (x : Surreal) : mk x.out = x := Quotient.out_eq x @@ -208,7 +208,7 @@ instance : Nontrivial Surreal := ⟨_, _, zero_ne_one⟩ /-- Casts a `Surreal` number into a `ConwayGame`. -/ -def toGame : Surreal ↪o ConwayGame where +@[expose] def toGame : Surreal ↪o ConwayGame where toFun := Quotient.lift (fun x ↦ .mk x) fun _ _ ↦ ConwayGame.mk_eq inj' x y := by cases x; cases y; @@ -229,7 +229,7 @@ theorem toGame_lt_iff {a b : Surreal} : toGame a < toGame b ↔ a < b := by simp theorem toGame_inj {a b : Surreal} : toGame a = toGame b ↔ a = b := by simp /-- `Surreal.toGame` as an `OrderAddMonoidHom` -/ -@[simps] +@[expose, simps] def toGameAddHom : Surreal →+o ConwayGame where toFun := toGame map_zero' := rfl diff --git a/LeanPool/ConwayRefinement/CombinatorialGames/Surreal/Dyadic.lean b/LeanPool/ConwayRefinement/CombinatorialGames/Surreal/Dyadic.lean index 7e83fe02ed..1349580b76 100644 --- a/LeanPool/ConwayRefinement/CombinatorialGames/Surreal/Dyadic.lean +++ b/LeanPool/ConwayRefinement/CombinatorialGames/Surreal/Dyadic.lean @@ -35,7 +35,7 @@ the future: universe u open IGame -@[expose] public section +public section namespace Dyadic @@ -278,7 +278,7 @@ termination_by x.den decreasing_by dyadic_wf /-- `Dyadic.toIGame` as an `OrderEmbedding`. -/ -@[simps!] +@[expose, simps!] noncomputable def toIGameEmbedding : Dyadic ↪o IGame := .ofStrictMono toIGame fun _ _ ↦ by exact toIGame_lt_toIGame_aux @@ -562,7 +562,6 @@ rational number. TODO: it should be possible to compute this value explicitly, given the finsets of `Dyadic` rationals corresponding to the left and right moves. -/ -@[no_expose] noncomputable def toDyadic (x : IGame) [Short x] [Numeric x] : Dyadic := Classical.choose x.equiv_dyadic diff --git a/LeanPool/ConwayRefinement/CombinatorialGames/Surreal/Leading.lean b/LeanPool/ConwayRefinement/CombinatorialGames/Surreal/Leading.lean index 60cb51f27e..baf92d95de 100644 --- a/LeanPool/ConwayRefinement/CombinatorialGames/Surreal/Leading.lean +++ b/LeanPool/ConwayRefinement/CombinatorialGames/Surreal/Leading.lean @@ -18,7 +18,7 @@ We don't yet prove this characterization; rather, these functions are a key ingr the map from surreals into Hahn series. -/ -@[expose] public noncomputable section +public noncomputable section namespace Surreal open ArchimedeanClass @@ -26,6 +26,7 @@ open ArchimedeanClass /-! ### Leading coefficient -/ /-- The leading coefficient of a surreal's Hahn series. -/ +@[expose] def leadingCoeff (x : Surreal) : ℝ := stdPart (x / ω^ x.wlog) @@ -166,7 +167,7 @@ theorem leadingCoeff_sub_eq_right {x y : Surreal} : y <ᵥ x → /-! ### Leading term -/ /-- The leading term of a surreal's Hahn series. -/ -def leadingTerm (x : Surreal) : Surreal := +@[expose] def leadingTerm (x : Surreal) : Surreal := x.leadingCoeff * ω^ x.wlog @[simp] diff --git a/LeanPool/ConwayRefinement/CombinatorialGames/Surreal/Ordinal.lean b/LeanPool/ConwayRefinement/CombinatorialGames/Surreal/Ordinal.lean index 076f304f69..a9041db357 100644 --- a/LeanPool/ConwayRefinement/CombinatorialGames/Surreal/Ordinal.lean +++ b/LeanPool/ConwayRefinement/CombinatorialGames/Surreal/Ordinal.lean @@ -17,7 +17,7 @@ We define the canonical map `NatOrdinal → Surreal` in terms of the map `NatOrd open IGame Set Surreal -@[expose] public noncomputable section +public noncomputable section /-- Ordinal games are numeric. -/ instance IGame.Numeric.toIGame (o : NatOrdinal) : Numeric o.toIGame := by @@ -28,7 +28,7 @@ termination_by o namespace NatOrdinal /-- Converts an ordinal into the corresponding surreal. -/ -def toSurreal : NatOrdinal ↪o Surreal := +@[expose] def toSurreal : NatOrdinal ↪o Surreal := .ofStrictMono (fun o ↦ .mk o.toIGame) fun _ _ h ↦ toIGame.strictMono h instance : Coe NatOrdinal Surreal where @@ -61,7 +61,7 @@ theorem toSurreal_mul (a b : NatOrdinal) : (a * b).toSurreal = a.toSurreal * b.t mk_eq (toIGame_mul a b) /-- `NatOrdinal.toGame` as an `OrderRingHom`. -/ -@[simps] +@[expose, simps] def toSurrealRingHom : NatOrdinal →+*o Surreal where toFun := toSurreal map_zero' := toSurreal_zero diff --git a/LeanPool/ConwayRefinement/CombinatorialGames/Surreal/Real.lean b/LeanPool/ConwayRefinement/CombinatorialGames/Surreal/Real.lean index 0577c1e65d..5029ee6707 100644 --- a/LeanPool/ConwayRefinement/CombinatorialGames/Surreal/Real.lean +++ b/LeanPool/ConwayRefinement/CombinatorialGames/Surreal/Real.lean @@ -26,7 +26,7 @@ universe u open IGame -@[expose] public noncomputable section +public noncomputable section theorem exists_dyadic_btwn {K : Type*} [Field K] [LinearOrder K] [IsStrictOrderedRing K] [Archimedean K] {x y : K} (h : x < y) : ∃ q : Dyadic, x < q.toRat ∧ q.toRat < y := by @@ -50,7 +50,7 @@ namespace Real /-- The canonical map from `ℝ` to `IGame`, sending a real number to its Dedekind cut of dyadic rationals. -/ -@[coe, match_pattern] def toIGame (x : ℝ) : IGame.{u} := +@[coe, match_pattern, expose] def toIGame (x : ℝ) : IGame.{u} := !{(↑) '' {q : Dyadic | q.toRat < x} | (↑) '' {q : Dyadic | x < q.toRat}} instance : Coe ℝ IGame := ⟨toIGame⟩ @@ -96,7 +96,7 @@ theorem mem_rightMoves_toIGame_of_lt {q : Dyadic} {x : ℝ} (h : x < q.toRat) : simpa /-- `Real.toIGame` as an `OrderEmbedding`. -/ -@[simps!] +@[expose, simps!] def toIGameEmbedding : ℝ ↪o IGame := by refine .ofStrictMono toIGame fun x y h ↦ ?_ obtain ⟨q, hx, hy⟩ := exists_dyadic_btwn h @@ -280,7 +280,7 @@ theorem toIGame_sub_equiv (x y : ℝ) : toIGame (x - y) ≈ x - y := by /-! ### `ℝ` to `ConwayGame` -/ /-- The canonical map from `ℝ` to `ConwayGame`, sending a real number to its Dedekind cut. -/ -@[coe, match_pattern] def toGame (x : ℝ) : ConwayGame := .mk x +@[coe, match_pattern, expose] def toGame (x : ℝ) : ConwayGame := .mk x instance : Coe ℝ ConwayGame := ⟨toGame⟩ @@ -293,7 +293,7 @@ theorem toGame_def (x : ℝ) : simp [Set.image_image] /-- `Real.toGame` as an `OrderEmbedding`. -/ -@[simps!] +@[expose, simps!] def toGameEmbedding : ℝ ↪o ConwayGame := .ofStrictMono toGame fun _ _ h ↦ toIGameEmbedding.strictMono h @@ -334,7 +334,7 @@ theorem toGame_sub (x y : ℝ) : toGame (x - y) = toGame x - toGame y := by simpa using ConwayGame.mk_eq (toIGame_sub_equiv x y) /-- `Real.toGame` as an `OrderAddMonoidHom`. -/ -@[simps] +@[expose, simps] def toGameAddHom : ℝ →+o ConwayGame where toFun := toGame map_zero' := toGame_zero @@ -344,7 +344,7 @@ def toGameAddHom : ℝ →+o ConwayGame where /-! ### `ℝ` to `Surreal` -/ /-- The canonical map from `ℝ` to `Surreal`, sending a real number to its Dedekind cut. -/ -@[coe, match_pattern] def toSurreal (x : ℝ) : Surreal := .mk x +@[coe, match_pattern, expose] def toSurreal (x : ℝ) : Surreal := .mk x instance : Coe ℝ Surreal := ⟨toSurreal⟩ @@ -366,7 +366,7 @@ theorem toSurreal_def (x : ℝ) : toSurreal x = congr! <;> aesop /-- `Real.toSurreal` as an `OrderEmbedding`. -/ -@[simps!] +@[expose, simps!] def toSurrealEmbedding : ℝ ↪o Surreal := .ofStrictMono toSurreal fun _ _ h ↦ toIGameEmbedding.strictMono h @@ -626,7 +626,7 @@ theorem toSurreal_mul (x y : ℝ) : (x * y).toSurreal = x * y := Surreal.mk_eq (toIGame_mul_equiv x y) /-- `Real.toSurreal` as an `OrderRingHom`. -/ -@[simps] +@[expose, simps] def toSurrealRingHom : ℝ →+*o Surreal where toFun := toSurreal map_zero' := toSurreal_zero diff --git a/LeanPool/ConwayRefinement/CombinatorialGames/Tactic/OrdinalAlias.lean b/LeanPool/ConwayRefinement/CombinatorialGames/Tactic/OrdinalAlias.lean index eb9e65f7b6..5e8c5f4079 100644 --- a/LeanPool/ConwayRefinement/CombinatorialGames/Tactic/OrdinalAlias.lean +++ b/LeanPool/ConwayRefinement/CombinatorialGames/Tactic/OrdinalAlias.lean @@ -36,10 +36,10 @@ meta def mkVal (Alias : TSyntax `ident) : TSyntax `ident := /-- Declare a type alias of either `Ordinal` or `Nat`, preserving the order structure. -/ macro "alias!" doc:docComment Alias:ident Source:ident : command => `( -@[expose] public section +public section $doc:docComment -def $Alias : Type _ := +@[expose] def $Alias : Type _ := $Source deriving Zero, One, Nontrivial, Inhabited, WellFoundedRelation namespace $Alias @@ -58,11 +58,11 @@ noncomputable instance : ConditionallyCompleteLinearOrderBot $Alias := theorem $(mkIdent `lt_wf) : @WellFounded $Alias (· < ·) := wellFounded_lt $(mkDocComment s!" The identity function between `{Source.getId}` and `{Alias.getId}`."):docComment -@[match_pattern] +@[expose, match_pattern] def $(mkIdent `of) : $Source ≃o $Alias := .refl _ $(mkDocComment s!" The identity function between `{Alias.getId}` and `{Source.getId}`."):docComment -@[match_pattern] +@[expose, match_pattern] def $(mkIdent `val) : $Alias ≃o $Source := .refl _ @[simp] theorem $(mkIdent `of_symm) : .symm $(mkOf Alias) = $(mkVal Alias) := rfl @@ -134,7 +134,7 @@ macro "ordinal_alias!" doc:docComment Alias:ident : command => `( alias! $doc $Alias Ordinal -@[expose] public section +public section namespace $Alias universe u diff --git a/LeanPool/ConwayRefinement/ConwayRefinement/Examples/OmnificInteger/DegreeTwoNormalForm.lean b/LeanPool/ConwayRefinement/ConwayRefinement/Examples/OmnificInteger/DegreeTwoNormalForm.lean index 68489036f2..16f4392a3c 100644 --- a/LeanPool/ConwayRefinement/ConwayRefinement/Examples/OmnificInteger/DegreeTwoNormalForm.lean +++ b/LeanPool/ConwayRefinement/ConwayRefinement/Examples/OmnificInteger/DegreeTwoNormalForm.lean @@ -25,13 +25,14 @@ every universe `u`. Its support order type and primeness are stated in `DegreeTw universe u -@[expose] public noncomputable section +public noncomputable section namespace Surreal.OmnificInteger.DegreeTwoExample open Set /-- The positive Conway exponent in row `m` and column `n`. -/ +@[expose] def exponent (m n : ℕ) : ℝ := 1 / (m + 1 : ℝ) + 1 / ((m + 1 : ℝ) * (m + 2 : ℝ) * (n + 1 : ℝ)) @@ -98,6 +99,7 @@ private theorem exponent_strictAnti_lex : abbrev Index := WithTop (Lex (ℕ × ℕ)) /-- The exponent sequence of the concrete Conway normal form. -/ +@[expose] def exponentAtIndex : Index → Surreal.{u} | ⊤ => 0 | (p : Lex (ℕ × ℕ)) => (exponent (ofLex p).1 (ofLex p).2 : ℝ) @@ -121,6 +123,7 @@ private theorem exponentAtIndex_strictAnti : StrictAnti exponentAtIndex.{u} := b exact_mod_cast exponent_strictAnti_lex (WithTop.coe_lt_coe.mp hpq) /-- The coefficient function of the explicit normal form. -/ +@[expose] def coefficient (i : Surreal.{u}) : ℝ := by classical @@ -148,6 +151,7 @@ theorem wellFoundedOn_support_coefficient : exact exponentAtIndex_strictAnti.lt_iff_gt /-- The explicit Conway normal form with all coefficients equal to one. -/ +@[expose] def normalForm : SurrealHahnSeries.{u} := SurrealHahnSeries.mk coefficient small_support_coefficient wellFoundedOn_support_coefficient diff --git a/LeanPool/ConwayRefinement/ConwayRefinement/Examples/OmnificInteger/OneRowNormalForm.lean b/LeanPool/ConwayRefinement/ConwayRefinement/Examples/OmnificInteger/OneRowNormalForm.lean index a7a4315272..2857d0549a 100644 --- a/LeanPool/ConwayRefinement/ConwayRefinement/Examples/OmnificInteger/OneRowNormalForm.lean +++ b/LeanPool/ConwayRefinement/ConwayRefinement/Examples/OmnificInteger/OneRowNormalForm.lean @@ -21,13 +21,14 @@ converging to zero, followed by the final constant term. The sibling statement ` records its arithmetic properties using only Mathlib and CombinatorialGames. -/ -@[expose] public noncomputable section +public noncomputable section namespace Surreal.OmnificInteger.OneRowExample open Set /-- The `n`-th positive exponent in Conway's one-row normal form. -/ +@[expose] def exponent (n : ℕ) : ℝ := 1 / (n + 1 : ℝ) @@ -46,6 +47,7 @@ private theorem exponent_strictAnti : StrictAnti exponent := by abbrev Index := WithTop ℕ /-- The exponent at an index of the displayed normal form. -/ +@[expose] def exponentAtIndex : Index → Surreal | ⊤ => 0 | (n : ℕ) => (exponent n : ℝ) @@ -68,6 +70,7 @@ private theorem exponentAtIndex_strictAnti : StrictAnti exponentAtIndex := by exact_mod_cast exponent_strictAnti (WithTop.coe_lt_coe.mp hpq) /-- The coefficient function supported on the displayed exponents. -/ +@[expose] def coefficient (i : Surreal) : ℝ := by classical @@ -94,6 +97,7 @@ theorem wellFoundedOn_support_coefficient : exact exponentAtIndex_strictAnti.lt_iff_gt /-- Conway's coefficient-one normal form `1 + Σ n, ω ^ (1 / (n + 1))`. -/ +@[expose] def normalForm : SurrealHahnSeries := SurrealHahnSeries.mk coefficient small_support_coefficient wellFoundedOn_support_coefficient diff --git a/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Examples/DegreeTwoPrime.lean b/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Examples/DegreeTwoPrime.lean index 0421b295cd..939e519191 100644 --- a/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Examples/DegreeTwoPrime.lean +++ b/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Examples/DegreeTwoPrime.lean @@ -38,13 +38,14 @@ Proc. Amer. Math. Soc. 134 (2006), 1277–1287, cited as [PS06]. universe u -@[expose] public noncomputable section +public noncomputable section namespace ConwayRefinement.Standalone.Oz.DegreeTwoExample open Ordinal /-- The exponents displayed in the normal form: zero and the row-column exponents above. -/ +@[expose] def IsDisplayedExponent (i : Surreal.{u}) : Prop := i = 0 ∨ ∃ m n : ℕ, i = ((1 / (m + 1 : ℝ) + @@ -52,27 +53,33 @@ def IsDisplayedExponent (i : Surreal.{u}) : Prop := /-- The named omnific integer is exactly the normal form displayed above: its coefficients are one at zero and at the row-column exponents, and zero everywhere else. -/ +@[expose] def HasDisplayedCoefficients : Prop := (∀ i : Surreal.{u}, IsDisplayedExponent i → degreeTwoOz.{u}.1.coeff i = 1) ∧ ∀ i : Surreal.{u}, ¬ IsDisplayedExponent i → degreeTwoOz.{u}.1.coeff i = 0 /-- The displayed normal form has exact support order type `ω ^ 2 + 1`. -/ +@[expose] def HasExactSupportOrderType : Prop := degreeTwoOz.{u}.1.length = ω ^ (2 : Ordinal) + 1 /-- The displayed omnific integer is prime. -/ +@[expose] def IsPrime : Prop := Prime degreeTwoOz.{u} /-- The coefficient-doubled foil still has exact support order type `ω ^ 2 + 1`. -/ +@[expose] def FoilHasExactSupportOrderType : Prop := degreeTwoFoil.{u}.1.length = ω ^ (2 : Ordinal) + 1 /-- The comparison element is literally twice the displayed prime. -/ +@[expose] def FoilIsCoefficientDouble : Prop := degreeTwoFoil.{u} = 2 * degreeTwoOz.{u} /-- The coefficient-doubled foil admits a factorisation into two nonunits. -/ +@[expose] def FoilHasNontrivialFactorization : Prop := ∃ a b : Oz.OmnificInteger.{u}, degreeTwoFoil = a * b ∧ ¬ IsUnit a ∧ ¬ IsUnit b diff --git a/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Examples/FiniteDegreeFamily.lean b/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Examples/FiniteDegreeFamily.lean index d58f0f037e..a433230ae4 100644 --- a/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Examples/FiniteDegreeFamily.lean +++ b/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Examples/FiniteDegreeFamily.lean @@ -15,7 +15,7 @@ order type exactly `ω ^ n + 1` and which is primal. Thus primality occurs at ev the statement does not assert that these examples are irreducible. -/ -@[expose] public noncomputable section +public noncomputable section namespace ConwayRefinement.Standalone.Oz.FiniteDegreeExamples @@ -23,6 +23,7 @@ open Ordinal /-- Every finite power `ω ^ n + 1` occurs as the exact Conway length of a primal omnific integer. -/ +@[expose] def EveryFinitePowerOccurs : Prop := ∀ n : ℕ, ∃ x : Oz.OmnificInteger.{0}, x.1.length = (omega0 : Ordinal.{0}) ^ (n : Ordinal.{0}) + 1 ∧ IsPrimal x diff --git a/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Examples/OmegaOmegaBoundary.lean b/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Examples/OmegaOmegaBoundary.lean index 39b354dae6..7dbefc2792 100644 --- a/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Examples/OmegaOmegaBoundary.lean +++ b/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Examples/OmegaOmegaBoundary.lean @@ -15,27 +15,31 @@ exactly `ω ^ ω`. It therefore lies exactly at the first limit excluded by the finite-degree hypothesis. This statement makes no primality or nonprimality claim about it. -/ -@[expose] public noncomputable section +public noncomputable section namespace ConwayRefinement.Standalone.Oz.OmegaOmegaBoundaryExample open Ordinal /-- An omnific integer is ordinary when its normal form is an integer constant. -/ +@[expose] def IsOrdinary (x : Oz.OmnificInteger.{0}) : Prop := ∃ z : ℤ, x.1 = (z : SurrealHahnSeries) /-- Reducedness means that `x` is nonzero and the exponents shared by `x` and `x - 1` lie in one Archimedean class. -/ +@[expose] def IsReduced (x : Oz.OmnificInteger.{0}) : Prop := x ≠ 0 ∧ ∃ c : ArchimedeanClass Surreal, x.1.support ∩ (x.1 - 1).support ⊆ {i | ArchimedeanClass.mk i = c} /-- Finite degree is the strict Conway-length bound below `ω ^ ω`. -/ +@[expose] def HasFiniteDegree (x : Oz.OmnificInteger.{0}) : Prop := Ordinal.lift.{1, 0} x.1.length < (omega0 : Ordinal.{1}) ^ (omega0 : Ordinal.{1}) /-- A reduced nonordinary omnific integer exists exactly at the `ω ^ ω` boundary. -/ +@[expose] def ExistsAtBoundary : Prop := ∃ x : Oz.OmnificInteger.{0}, ¬ IsOrdinary x ∧ IsReduced x ∧ diff --git a/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Examples/OmnificFactorization.lean b/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Examples/OmnificFactorization.lean index 0fc52e53b1..ec092d3f7e 100644 --- a/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Examples/OmnificFactorization.lean +++ b/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Examples/OmnificFactorization.lean @@ -35,7 +35,7 @@ omnific integer into irreducibles agree up to order and units. universe u -@[expose] public noncomputable section +public noncomputable section namespace ConwayRefinement.Standalone.Oz @@ -48,20 +48,24 @@ theorem mem_normalFormOmnificIntegers_iff (x : SurrealHahnSeries.{u}) : /-- A ring equivalence from surreal numbers to surreal Hahn series identifies Conway's cut-defined omnific integers with the normal-form subring `omnificIntegers`. -/ +@[expose] def NormalFormIdentifiesOmnificIntegers : Prop := ∃ e : Surreal.{u} ≃+* SurrealHahnSeries.{u}, ∀ x : Surreal.{u}, IsConwayOmnificInteger x ↔ e x ∈ omnificIntegers /-- Every omnific integer is primal. Equivalently, `Oz` is a pre-Schreier ring. -/ +@[expose] def EveryOmnificIntegerIsPrimal : Prop := ∀ x : (omnificIntegers : Subring SurrealHahnSeries.{u}), IsPrimal x /-- Every irreducible omnific integer is prime. -/ +@[expose] def IrreducibleIsPrime : Prop := ∀ x : (omnificIntegers : Subring SurrealHahnSeries.{u}), Irreducible x → Prime x /-- Unique factorisation: two products of irreducible omnific integers that agree up to a unit have the same factors up to order and association. -/ +@[expose] def IrreducibleFactorizationsAreUnique : Prop := ∀ f g : Multiset (omnificIntegers : Subring SurrealHahnSeries.{u}), (∀ x ∈ f, Irreducible x) → (∀ x ∈ g, Irreducible x) → diff --git a/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Examples/OneRowPrime.lean b/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Examples/OneRowPrime.lean index 27839dd4d4..d96b05573e 100644 --- a/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Examples/OneRowPrime.lean +++ b/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Examples/OneRowPrime.lean @@ -27,27 +27,31 @@ LM24, Example 9.2.8. integers*, Adv. Math. 442 (2024) 109513, cited as [LM24]. -/ -@[expose] public noncomputable section +public noncomputable section namespace ConwayRefinement.Standalone.Oz.OneRowExample open Ordinal /-- The exponents displayed in the normal form: zero and `1/(n+1)` for `n ≥ 0`. -/ +@[expose] def IsDisplayedExponent (i : Surreal) : Prop := i = 0 ∨ ∃ n : ℕ, i = ((1 / (n + 1 : ℝ) : ℝ) : Surreal) /-- The named omnific integer is exactly the normal form displayed above: its coefficients are one at zero and at the exponents `1/(n+1)`, and zero everywhere else. -/ +@[expose] def HasDisplayedCoefficients : Prop := (∀ i : Surreal, IsDisplayedExponent i → oneRowOz.1.coeff i = 1) ∧ ∀ i : Surreal, ¬ IsDisplayedExponent i → oneRowOz.1.coeff i = 0 /-- The displayed normal form has exact support order type `ω + 1`. -/ +@[expose] def HasExactSupportOrderType : Prop := oneRowOz.1.length = omega0 + 1 /-- Conway's displayed one-row omnific integer is prime. -/ +@[expose] def IsPrime : Prop := Prime oneRowOz diff --git a/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/PrincipalRVAlgebraicIndependence.lean b/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/PrincipalRVAlgebraicIndependence.lean index 91a6db8fd5..320568cecd 100644 --- a/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/PrincipalRVAlgebraicIndependence.lean +++ b/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/PrincipalRVAlgebraicIndependence.lean @@ -55,7 +55,7 @@ series represent the same class exactly when their difference lies in `J_{ω^α} open Ordinal open scoped NatOrdinal -@[expose] public noncomputable section +public noncomputable section namespace ConwayRefinement.Standalone.PrincipalRVAlgebraicIndependence @@ -68,7 +68,7 @@ variable {K : Type u} [Field K] variable (K) in /-- `K((ℝ^{≤0}))`: Hahn series with real exponents `≤ 0` [LM24, §1.2], as a `K`-subalgebra of `K((ℝ))`. -/ -def nonpos : Subalgebra K (HahnSeries ℝ K) where +@[expose] def nonpos : Subalgebra K (HahnSeries ℝ K) where carrier := {x | x.support ⊆ Set.Iic 0} algebraMap_mem' k := by intro g hg @@ -89,24 +89,24 @@ theorem supportIsWellOrder (x : HahnSeries ℝ K) : exact Subtype.ext (le_antisymm (le_of_not_gt hba) (le_of_not_gt hab)) /-- The order type of the well-ordered support of `x` [LM24, §2.2]. -/ -def ot (x : HahnSeries ℝ K) : Ordinal.{0} := +@[expose] def ot (x : HahnSeries ℝ K) : Ordinal.{0} := @Ordinal.type x.support (Subrel (· < ·) (· ∈ x.support)) (supportIsWellOrder x) /-! ### The ordinal value -/ /-- The ideal `J` generated by the monomials `t^x`, `x < 0` [Ber00, Def. 5.1]: the series whose support is bounded away from `0`. -/ -def MemJ (x : nonpos K) : Prop := +@[expose] def MemJ (x : nonpos K) : Prop := ∃ s < (0 : ℝ), (x : HahnSeries ℝ K).support ⊆ Set.Iic s /-- Congruence to a constant modulo `J`: membership in Berarducci's subgroup `J + K`. -/ -def IsNearConstant (x : nonpos K) : Prop := +@[expose] def IsNearConstant (x : nonpos K) : Prop := ∃ k : K, MemJ (x - algebraMap K (nonpos K) k) open scoped Classical in /-- **Berarducci's ordinal value** `v_J` [Ber00, Def. 5.2]: `0` on `J`, `1` on `(J + K) \ J`, and otherwise the least order type of the support of a series congruent to `x` modulo `J + K`. -/ -def ordinalValue (x : nonpos K) : NatOrdinal := +@[expose] def ordinalValue (x : nonpos K) : NatOrdinal := if MemJ x then 0 else if IsNearConstant x then 1 else sInf {o | ∃ c : nonpos K, @@ -120,7 +120,7 @@ variable {ι : Type v} representatives of classes of positive degrees `β_k ⊕ β'_k = α` — a representative of an element of `(P̂_+)² ∩ P_α = ∑_{i ⊕ j = α, i, j ≠ 0} P_i P_j`, the square of the ideal of positive degree in degree `α`. -/ -def IsDecomposable (α : NatOrdinal) (x : nonpos K) : Prop := +@[expose] def IsDecomposable (α : NatOrdinal) (x : nonpos K) : Prop := ∃ (n : ℕ) (β β' : Fin n → NatOrdinal) (u w : Fin n → nonpos K), (∀ k, β k ≠ 0 ∧ β' k ≠ 0 ∧ β k + β' k = α) ∧ (∀ k, ordinalValue (u k) < ω^ (β k + 1)) ∧ (∀ k, ordinalValue (w k) < ω^ (β' k + 1)) ∧ diff --git a/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Support/DegreeTwoExample.lean b/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Support/DegreeTwoExample.lean index 1277773952..cdf46cd64e 100644 --- a/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Support/DegreeTwoExample.lean +++ b/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Support/DegreeTwoExample.lean @@ -27,13 +27,14 @@ every universe `u`. Its support order type and primeness are stated in `DegreeTw universe u -@[expose] public noncomputable section +public noncomputable section namespace ConwayRefinement.Standalone.Oz.DegreeTwoExample open Set /-- The positive Conway exponent in row `m` and column `n`. -/ +@[expose] def exponent (m n : ℕ) : ℝ := 1 / (m + 1 : ℝ) + 1 / ((m + 1 : ℝ) * (m + 2 : ℝ) * (n + 1 : ℝ)) @@ -100,6 +101,7 @@ private theorem exponent_strictAnti_lex : abbrev Index := WithTop (Lex (ℕ × ℕ)) /-- The exponent sequence of the concrete Conway normal form. -/ +@[expose] def exponentAtIndex : Index → Surreal.{u} | ⊤ => 0 | (p : Lex (ℕ × ℕ)) => (exponent (ofLex p).1 (ofLex p).2 : ℝ) @@ -123,6 +125,7 @@ private theorem exponentAtIndex_strictAnti : StrictAnti exponentAtIndex.{u} := b exact_mod_cast exponent_strictAnti_lex (WithTop.coe_lt_coe.mp hpq) /-- The coefficient function of the explicit normal form. -/ +@[expose] def coefficient (i : Surreal.{u}) : ℝ := by classical @@ -150,6 +153,7 @@ theorem wellFoundedOn_support_coefficient : exact exponentAtIndex_strictAnti.lt_iff_gt /-- The explicit Conway normal form with all coefficients equal to one. -/ +@[expose] def normalForm : SurrealHahnSeries.{u} := SurrealHahnSeries.mk coefficient small_support_coefficient wellFoundedOn_support_coefficient @@ -196,6 +200,7 @@ theorem degreeTwoOz_val : degreeTwoOz.{u}.1 = normalForm := by /-- The coefficient-doubled comparison element. It has the same support as `degreeTwoOz`, but its factorisation as `2 * degreeTwoOz` is visible in the definition. -/ +@[expose] def degreeTwoFoil : Oz.OmnificInteger.{u} := 2 * degreeTwoOz diff --git a/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Support/FinitePowerFamily.lean b/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Support/FinitePowerFamily.lean index 41aeb5db55..462f35ff25 100644 --- a/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Support/FinitePowerFamily.lean +++ b/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Support/FinitePowerFamily.lean @@ -48,7 +48,7 @@ doubling every coefficient preserves the support but destroys reducedness. Proc. Amer. Math. Soc. 134 (2006), 1277–1287, cited as [PS06]. -/ -@[expose] public noncomputable section +public noncomputable section namespace ConwayRefinement.Standalone.Oz.FinitePowerFamily @@ -89,6 +89,7 @@ theorem typeLT_finiteLex (n : ℕ) : congr 2 /-- The contraction factor separating consecutive lexicographic blocks. -/ +@[expose] def scale : ℝ := 1 / 3 @[simp] @@ -540,6 +541,7 @@ theorem finitePowerOz_hasFiniteDegree (n : ℕ) : exact omega_opow_nat_add_one_lt_omega_opow_omega n /-- Every coefficient-one omnific integer `finitePowerOz n` is primal. -/ +@[expose] def PrimalFamily : Prop := ∀ n : ℕ, IsPrimal (finitePowerOz n) diff --git a/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Support/OmegaOmegaBoundary.lean b/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Support/OmegaOmegaBoundary.lean index 3022e59e69..49f9b9cd2a 100644 --- a/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Support/OmegaOmegaBoundary.lean +++ b/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Support/OmegaOmegaBoundary.lean @@ -39,7 +39,7 @@ primality theorem. No primality or nonprimality assertion is made about this bou integers*, Adv. Math. 442 (2024) 109513, cited as [LM24]. -/ -@[expose] public noncomputable section +public noncomputable section namespace ConwayRefinement.Standalone.Oz.OmegaOmegaBoundary diff --git a/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Support/OmnificFiniteDegree.lean b/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Support/OmnificFiniteDegree.lean index 6ac8a3fa3d..0b1f6a6108 100644 --- a/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Support/OmnificFiniteDegree.lean +++ b/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Support/OmnificFiniteDegree.lean @@ -16,18 +16,20 @@ These predicates state the finite-degree examples in `Examples/`. universe u -@[expose] public noncomputable section +public noncomputable section namespace ConwayRefinement.Standalone.Oz open Ordinal /-- An omnific integer is ordinary when its Conway normal form is an integer constant. -/ +@[expose] def IsOrdinaryInteger (x : OmnificInteger.{u}) : Prop := ∃ z : ℤ, x.1 = (z : SurrealHahnSeries) /-- LM24 reducedness: `x` is nonzero, and the exponents occurring in both `x` and `x - 1` lie in one Archimedean class. -/ +@[expose] def IsReduced (x : OmnificInteger.{u}) : Prop := x ≠ 0 ∧ ∃ c : ArchimedeanClass Surreal, x.1.support ∩ (x.1 - 1).support ⊆ {i | ArchimedeanClass.mk i = c} @@ -37,6 +39,7 @@ def ReducedIsPrimal : Prop := ∀ x : OmnificInteger.{u}, ¬ IsOrdinaryInteger x → IsReduced x → IsPrimal x /-- The Conway normal form has finite degree when its support order type is below `ω ^ ω`. -/ +@[expose] def HasFiniteDegree (x : OmnificInteger.{u}) : Prop := Ordinal.lift.{u + 1, u} x.1.length < (ω : Ordinal.{u + 1}) ^ (ω : Ordinal.{u + 1}) diff --git a/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Support/OneRowExample.lean b/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Support/OneRowExample.lean index 76502bb1a3..3234607f85 100644 --- a/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Support/OneRowExample.lean +++ b/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/CombinatorialGames/Support/OneRowExample.lean @@ -21,13 +21,14 @@ converging to zero, followed by the final constant term. The sibling statement ` records its arithmetic properties using only Mathlib and CombinatorialGames. -/ -@[expose] public noncomputable section +public noncomputable section namespace ConwayRefinement.Standalone.Oz.OneRowExample open Set /-- The `n`-th positive exponent in Conway's one-row normal form. -/ +@[expose] def exponent (n : ℕ) : ℝ := 1 / (n + 1 : ℝ) @@ -46,6 +47,7 @@ private theorem exponent_strictAnti : StrictAnti exponent := by abbrev Index := WithTop ℕ /-- The exponent at an index of the displayed normal form. -/ +@[expose] def exponentAtIndex : Index → Surreal | ⊤ => 0 | (n : ℕ) => (exponent n : ℝ) @@ -68,6 +70,7 @@ private theorem exponentAtIndex_strictAnti : StrictAnti exponentAtIndex := by exact_mod_cast exponent_strictAnti (WithTop.coe_lt_coe.mp hpq) /-- The coefficient function supported on the displayed exponents. -/ +@[expose] def coefficient (i : Surreal) : ℝ := by classical @@ -94,6 +97,7 @@ theorem wellFoundedOn_support_coefficient : exact exponentAtIndex_strictAnti.lt_iff_gt /-- Conway's coefficient-one normal form `1 + Σ n, ω ^ (1 / (n + 1))`. -/ +@[expose] def normalForm : SurrealHahnSeries := SurrealHahnSeries.mk coefficient small_support_coefficient wellFoundedOn_support_coefficient diff --git a/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/Mathlib/CompleteHahnGerm.lean b/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/Mathlib/CompleteHahnGerm.lean index 7a6de99115..2435416ef8 100644 --- a/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/Mathlib/CompleteHahnGerm.lean +++ b/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/Mathlib/CompleteHahnGerm.lean @@ -23,7 +23,7 @@ Archimedean magnitude, then this germ ring is a polynomial algebra over `K`. Con four-factor refinement. -/ -@[expose] public noncomputable section +public noncomputable section namespace ConwayRefinement.Standalone.CompleteHahnGerm @@ -34,7 +34,7 @@ variable [AddCommGroup G] [LinearOrder G] [IsOrderedAddMonoid G] variable [NoMinOrder G] [Field K] /-- The Hahn-series `K`-algebra `K((G^{≤ 0}))`. -/ -def NonpositiveSeries : Subalgebra K (HahnSeries G K) where +@[expose] def NonpositiveSeries : Subalgebra K (HahnSeries G K) where carrier := {x | x.support ⊆ Set.Iic 0} algebraMap_mem' k := by intro g hg @@ -47,7 +47,7 @@ def NonpositiveSeries : Subalgebra K (HahnSeries G K) where h ▸ show i + j ≤ 0 from add_nonpos (hx hi) (hy hj) /-- The ideal of series whose support is bounded away from zero. -/ -def BoundedAwayIdeal : Ideal (NonpositiveSeries G K) where +@[expose] def BoundedAwayIdeal : Ideal (NonpositiveSeries G K) where carrier := {x | ∃ r < (0 : G), (x : HahnSeries G K).support ⊆ Set.Iic r} zero_mem' := by obtain ⟨r, hr⟩ := exists_lt (0 : G) diff --git a/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/Mathlib/Examples/DegreeTwoPrime.lean b/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/Mathlib/Examples/DegreeTwoPrime.lean index 485347f22d..e233fd5c01 100644 --- a/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/Mathlib/Examples/DegreeTwoPrime.lean +++ b/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/Mathlib/Examples/DegreeTwoPrime.lean @@ -17,14 +17,14 @@ The coefficient-one series on the displayed two-dimensional support is prime in `-1 / (m + 1)`, and those row limits converge to zero. -/ -@[expose] public noncomputable section +public noncomputable section namespace ConwayRefinement.Standalone.Hahn.DegreeTwoExample universe u /-- Hahn series over `K` supported in the nonpositive real exponents. -/ -def NonpositiveSeries (K : Type u) [Field K] : Subring (HahnSeries ℝ K) where +@[expose] def NonpositiveSeries (K : Type u) [Field K] : Subring (HahnSeries ℝ K) where carrier := {x | x.support ⊆ Set.Iic 0} zero_mem' := by simp one_mem' := fun _ hg ↦ (HahnSeries.support_single_subset hg).le @@ -35,17 +35,17 @@ def NonpositiveSeries (K : Type u) [Field K] : Subring (HahnSeries ℝ K) where h ▸ show i + j ≤ 0 from add_nonpos (hx hi) (hy hj) /-- The exponent in row `m` and column `n` of the displayed support. -/ -def exponent (m n : ℕ) : ℝ := +@[expose] def exponent (m n : ℕ) : ℝ := -(1 / (m + 1 : ℝ)) - 1 / ((m + 1 : ℝ) * (m + 2 : ℝ) * (n + 1 : ℝ)) /-- The support consists exactly of zero and the displayed row-column exponents. -/ -def IsDisplayedExponent (r : ℝ) : Prop := +@[expose] def IsDisplayedExponent (r : ℝ) : Prop := r = 0 ∨ ∃ m n : ℕ, r = exponent m n /-- Over every characteristic-zero field there is a prime series whose coefficient is one at exactly the displayed exponents and zero elsewhere. -/ -def ExistsPrime (K : Type u) [Field K] : Prop := +@[expose] def ExistsPrime (K : Type u) [Field K] : Prop := CharZero K → ∃ x : NonpositiveSeries K, (∀ r : ℝ, IsDisplayedExponent r → (x : HahnSeries ℝ K).coeff r = 1) ∧ (∀ r : ℝ, ¬ IsDisplayedExponent r → (x : HahnSeries ℝ K).coeff r = 0) ∧ diff --git a/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/Mathlib/Examples/NegativeMonomialRoots.lean b/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/Mathlib/Examples/NegativeMonomialRoots.lean index b8d470f957..572036096b 100644 --- a/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/Mathlib/Examples/NegativeMonomialRoots.lean +++ b/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/Mathlib/Examples/NegativeMonomialRoots.lean @@ -16,7 +16,7 @@ primality theorems impose no bound on factorisation length. This example by itse atomicity claim. -/ -@[expose] public noncomputable section +public noncomputable section namespace ConwayRefinement.Standalone.Hahn.NegativeMonomialExample @@ -28,20 +28,20 @@ theorem mem_ring_iff (x : HahnSeries ℝ ℚ) : x ∈ Ring ↔ x.support ⊆ Set.Iic 0 := (Iff.rfl) /-- The monomial `tˣ`, for `x ≤ 0`, as an element of `ℚ((ℝ^{≤0}))`. -/ -def monomial (x : ℝ) (hx : x ≤ 0) : Ring := +@[expose] def monomial (x : ℝ) (hx : x ≤ 0) : Ring := ⟨HahnSeries.single x 1, fun y hy ↦ by rw [HahnSeries.eq_of_mem_support_single hy] exact hx⟩ /-- The monomial `t⁻¹⁄ⁿ`. -/ -def nthRoot (n : ℕ) : Ring := +@[expose] def nthRoot (n : ℕ) : Ring := monomial (-(n : ℝ)⁻¹) (neg_nonpos.mpr (inv_nonneg.mpr (Nat.cast_nonneg n))) /-- The monomial `t⁻¹`. -/ -def negativeOne : Ring := monomial (-1) (by norm_num) +@[expose] def negativeOne : Ring := monomial (-1) (by norm_num) /-- For every `n > 0`, `t⁻¹⁄ⁿ` is a nonunit and `(t⁻¹⁄ⁿ)ⁿ = t⁻¹`. -/ -def NegativeMonomialHasAllRoots : Prop := +@[expose] def NegativeMonomialHasAllRoots : Prop := ∀ (n : ℕ), 0 < n → ¬ IsUnit (nthRoot n) ∧ nthRoot n ^ n = negativeOne end ConwayRefinement.Standalone.Hahn.NegativeMonomialExample diff --git a/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/Mathlib/GermPolynomialRing.lean b/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/Mathlib/GermPolynomialRing.lean index 5e51d7c17b..60c82056f4 100644 --- a/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/Mathlib/GermPolynomialRing.lean +++ b/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/Mathlib/GermPolynomialRing.lean @@ -31,7 +31,7 @@ The polynomial presentation proves Berarducci's factorisation conjecture as stat as [LM17]. -/ -@[expose] public noncomputable section +public noncomputable section namespace ConwayRefinement.Standalone.GermPolynomial @@ -40,7 +40,7 @@ universe u variable {K : Type u} [Field K] /-- The Hahn-series ring `K((ℝ^{≤0}))`. -/ -def nonpos (K : Type u) [Field K] : Subring (HahnSeries ℝ K) where +@[expose] def nonpos (K : Type u) [Field K] : Subring (HahnSeries ℝ K) where carrier := {x | x.support ⊆ Set.Iic 0} zero_mem' := by simp one_mem' := by @@ -64,7 +64,7 @@ theorem mem_nonpos_iff (x : HahnSeries ℝ K) : variable (K) in /-- Berarducci's ideal `J`: the ideal of `K((ℝ^{≤0}))` generated by the monomials `t^x`, `x < 0`. -/ -def J : Ideal (nonpos K) := +@[expose] def J : Ideal (nonpos K) := Ideal.span {m : nonpos K | ∃ x : ℝ, x < 0 ∧ (m : HahnSeries ℝ K) = HahnSeries.single x 1} diff --git a/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/Mathlib/HahnSeriesGCD.lean b/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/Mathlib/HahnSeriesGCD.lean index bca8f063fd..4303fa85e4 100644 --- a/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/Mathlib/HahnSeriesGCD.lean +++ b/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/Mathlib/HahnSeriesGCD.lean @@ -25,7 +25,7 @@ the theorems below establish the properties themselves. as [LM24]. -/ -@[expose] public noncomputable section +public noncomputable section namespace ConwayRefinement.Standalone.Hahn @@ -34,7 +34,7 @@ universe u variable (K : Type u) [Field K] /-- `K((ℝ^{≤0}))`: Hahn series with real exponents `≤ 0` [LM24, §1.2]. -/ -def nonpos : Subring (HahnSeries ℝ K) where +@[expose] def nonpos : Subring (HahnSeries ℝ K) where carrier := {x | x.support ⊆ Set.Iic 0} zero_mem' := by simp one_mem' := fun _ hg ↦ (HahnSeries.support_single_subset hg).le diff --git a/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/Mathlib/HahnSeriesPolynomialRing.lean b/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/Mathlib/HahnSeriesPolynomialRing.lean index 36325f4b92..f2a544dca7 100644 --- a/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/Mathlib/HahnSeriesPolynomialRing.lean +++ b/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/Mathlib/HahnSeriesPolynomialRing.lean @@ -23,7 +23,7 @@ principal graded ring or a chosen generating system. open Cardinal -@[expose] public noncomputable section +public noncomputable section namespace ConwayRefinement.Standalone.HahnPolynomial @@ -32,7 +32,7 @@ universe u variable (K : Type u) [Field K] /-- The Hahn-series ring `K((ℝ^{≤0}))`. -/ -def Series : Subring (HahnSeries ℝ K) where +@[expose] def Series : Subring (HahnSeries ℝ K) where carrier := {x | x.support ⊆ Set.Iic 0} zero_mem' := by simp one_mem' := fun _ hg ↦ (HahnSeries.support_single_subset hg).le diff --git a/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/Mathlib/Support/InlineSurreal.lean b/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/Mathlib/Support/InlineSurreal.lean index 5b8b4fd88f..ce95fa0591 100644 --- a/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/Mathlib/Support/InlineSurreal.lean +++ b/LeanPool/ConwayRefinement/ConwayRefinement/Standalone/Mathlib/Support/InlineSurreal.lean @@ -25,11 +25,12 @@ The first-principles indexed-game statement remains in `InlineConwayRefinement`. Its proof bridges directly to the imported CombinatorialGames implementation. -/ -@[expose] public noncomputable section +public noncomputable section universe u namespace ConwayRefinement.Standalone.InlineSurreal.Surreal /-- The singleton Conway cut `{x - 1 | x + 1}`. -/ +@[expose] def singletonIntegerCut (x : _root_.Surreal.{u}) : _root_.Surreal.{u} := !{{x - 1} | {x + 1}}' (by simp only [Set.mem_singleton_iff] @@ -37,10 +38,12 @@ def singletonIntegerCut (x : _root_.Surreal.{u}) : _root_.Surreal.{u} := simp [sub_eq_add_neg]) /-- Conway's cut equation defining an omnific integer. -/ +@[expose] def IsConwayOmnificInteger (x : _root_.Surreal.{u}) : Prop := x = singletonIntegerCut x /-- Conway's refinement conjecture for the concretely defined surreal numbers. -/ +@[expose] def ConwayConjecture : Prop := ∀ a b c d : _root_.Surreal.{u}, IsConwayOmnificInteger a → IsConwayOmnificInteger b → 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 67f90a17ef..f13ac803f0 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..a87ac09552 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 @@ -28,11 +28,11 @@ open scoped BigOperators namespace DensityHalesJewett /-- Two words are equivalent after freely interchanging the letters `i` and `j`. -/ -def InsensitiveEquiv {α ι : Type*} (i j : α) (x y : ι → α) : Prop := +@[expose] 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,14 +84,14 @@ 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 exact D.filter fun w ↦ ∀ V ∈ 𝒱, w ∉ Subspace.range V /-- The intersection of a finite indexed family of finite sets. -/ -noncomputable def intersection {r : ℕ} {X : Type*} [Fintype X] +@[expose] noncomputable def intersection {r : ℕ} {X : Type*} [Fintype X] (D : Fin r → Finset X) : Finset X := by classical exact Finset.univ.inf D 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..fcca095c42 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,12 +36,12 @@ 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 /-- The proposition that every term of `P` belongs to `s`. -/ -def IsSubset {α : Type*} [AddMonoid α] {k : ℕ} (P : ArithmeticProgression α k) +@[expose] def IsSubset {α : Type*} [AddMonoid α] {k : ℕ} (P : ArithmeticProgression α k) (s : Set α) : Prop := ∀ i, P.term i ∈ s diff --git a/LeanPool/DensityHalesJewett/DensityHalesJewett/UniformFibers.lean b/LeanPool/DensityHalesJewett/DensityHalesJewett/UniformFibers.lean index 02f0c1c5d0..3d9eb1bb54 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) @@ -341,7 +341,7 @@ lemma exists_of_density {k : ℕ} (hDHJ : HasDensityHJ k) densityBound_spec hDHJ m hm δ hδ n hn A hA /-- Split the coordinates of a word family into a prefix and a suffix along a cut equivalence. -/ -def splitWords {alphabet p q n : ℕ} (e : Fin p ⊕ Fin q ≃ Fin n) +@[expose] def splitWords {alphabet p q n : ℕ} (e : Fin p ⊕ Fin q ≃ Fin n) (A : Finset (Fin n → Fin alphabet)) : Finset (Fin p ⊕ Fin q → Fin alphabet) := A.map (e.arrowCongr (Equiv.refl (Fin alphabet))).symm.toEmbedding @@ -460,7 +460,7 @@ lemma exists_denser_fiber {alphabet m q : ℕ} (halphabet : 0 < alphabet) {ε : /-- Every ambient dimension admits a cut into a prefix carrying a subspace and a nonempty suffix above which all fibers are almost as dense as the whole family. -/ -def VariableCutFibersSufficient (alphabet dimension : ℕ) (ε : ℝ) (n : ℕ) : Prop := +@[expose] def VariableCutFibersSufficient (alphabet dimension : ℕ) (ε : ℝ) (n : ℕ) : Prop := ∀ A : Finset (Fin n → Fin alphabet), ∃ p q : ℕ, ∃ e : Fin p ⊕ Fin q ≃ Fin n, 0 < q ∧ ∃ V : Combinatorics.Subspace (Fin dimension) (Fin alphabet) (Fin p), 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 1f4d91aab8..70183217b4 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..2b1c449b2f 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) @@ -78,7 +78,7 @@ lemma directed_induced {α : Type u} {β : Type v} [TopologicalSpace α] [hβ : /-- The inclusion of a subtype with the induced directed structure into the ambient space is a directed map. -/ -def DirectedSubtypeInclusion {α : Type u} (p : α → Prop) [DirectedSpace α] : +@[expose] def DirectedSubtypeInclusion {α : Type u} (p : α → Prop) [DirectedSpace α] : D(Subtype p, α) where toFun := fun x => ↑x continuous_toFun := continuous_induced_dom @@ -86,6 +86,7 @@ def DirectedSubtypeInclusion {α : Type u} (p : α → Prop) [DirectedSpace α] /-- The inclusion of one subset into another, when both carry the induced directed structure, is a directed map. -/ +@[expose] def DirectedSubsetInclusion {α : Type u} [t : DirectedSpace α] {X Y : Set α} (h : X ⊆ Y) : D(X,Y) where toFun := Set.inclusion h @@ -116,12 +117,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 +133,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γ⟩ @@ -140,26 +141,26 @@ protected def DirectedMap.prodMapMk (f : D(α,β)) (g : D(α,γ)) : D(α, β × by mapping `(a, b) : α × β` to `(f a, g b)`. -/ -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.1, g x.2) directed_toFun := fun x y γ ⟨hγ₁, hγ₂⟩ => ⟨f.directed_toFun _ hγ₁, g.directed_toFun _ hγ₂⟩ /-- 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..adfb83853a 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: @@ -108,7 +108,7 @@ lemma compact_unitSquare : IsCompact UnitSquare := isCompact_univ /-- For any four natural numbers `n m i j : ℕ` such that `i < n + 1` and `j < m + 1`, we have the rectangle `[i/(n+1), (i+1)/(n+1)] × [j/(m+1), (j+1)/(m+1)]` in the unit square. -/ -def UnitSubrectangle {n m i j : ℕ} (hi : i < n.succ) (hj : j < m.succ) : Set (I × I) := +@[expose] def UnitSubrectangle {n m i j : ℕ} (hi : i < n.succ) (hj : j < m.succ) : Set (I × I) := Set.ofPred <| fun (a : I × I) => ((Fraction (Nat.succ_pos n) (le_of_lt hi)) ≤ a.1 ∧ diff --git a/LeanPool/DirectedTopologyLean4/DTop.lean b/LeanPool/DirectedTopologyLean4/DTop.lean index 8096b18200..985e62c05a 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] @@ -75,14 +75,12 @@ abbrev ofHom {X Y : Type u} [DirectedSpace X] [DirectedSpace Y] (f : D(X,Y)) : o @[simp] lemma hom_id {X : dTopCat.{u}} : (𝟙 X : X ⟶ X).hom = DirectedMap.id X := rfl -@[simp] lemma id_app (X : dTopCat.{u}) (x : ↑X) : (𝟙 X : X ⟶ X) x = x := rfl @[simp] lemma hom_comp {X Y Z : dTopCat.{u}} (f : X ⟶ Y) (g : Y ⟶ Z) : (f ≫ g).hom = g.hom.comp f.hom := rfl -@[simp] lemma comp_app {X Y Z : dTopCat.{u}} (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : (f ≫ g : X → Z) x = g (f x) := rfl @@ -101,20 +99,21 @@ 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⟩ /-- The inclusion of a directed subspace into its ambient space. -/ -def DirectedSubtypeHom {X : dTopCat} (Y : Set X) : (dTopCat.of Y) ⟶ X := +@[expose] def DirectedSubtypeHom {X : dTopCat} (Y : Set X) : (dTopCat.of Y) ⟶ X := ofHom (DirectedSubtypeInclusion (fun s => s ∈ Y)) /-- The inclusion between two directed subspaces, given a subset relation. -/ +@[expose] def DirectedSubsetHom {X : dTopCat} {Y₀ Y₁ : Set X} (h : Y₀ ⊆ Y₁) : (dTopCat.of Y₀) ⟶ Y₁ := ofHom (DirectedSubsetInclusion h) diff --git a/LeanPool/DirectedTopologyLean4/DihomotopyCover.lean b/LeanPool/DirectedTopologyLean4/DihomotopyCover.lean index 813b31d4da..22d3fde231 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₂: @@ -36,7 +36,7 @@ variable {X : dTopCat} {f g : D(I,X)} {X₀ X₁ : Set X} /-- A dihomotopy of directed maps is covered if its image lies entirely in X₀ or in X₁. -/ -def covered (F : Dihomotopy f g) (hX : X₀ ∪ X₁ = univ) : Prop := +@[expose] def covered (F : Dihomotopy f g) (hX : X₀ ∪ X₁ = univ) : Prop := let _ : X₀ ∪ X₁ = univ := hX range F ⊆ X₀ ∨ range F ⊆ 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₁ @@ -412,7 +412,7 @@ lemma covered_right_of_covered {F : Dihomotopy γ₁ γ₂} {hX : X₀ ∪ X₁ /-- Two paths are `m × n`-dihomotopic if there is a dihomotopy between them that can be covered by `m × n` rectangles. -/ -def dihomotopicCovered (hX : X₀ ∪ X₁ = univ) (γ₁ γ₂ : Dipath x y) (n m : ℕ) : Prop := +@[expose] def dihomotopicCovered (hX : X₀ ∪ X₁ = univ) (γ₁ γ₂ : Dipath x y) (n m : ℕ) : Prop := ∃ (F : Dihomotopy γ₁ γ₂), DirectedMap.Dihomotopy.coveredPartwise hX F.toDihomotopy n m /-- If `γ₁` and `γ₂` are two paths connected by a path-dihomotopy `F` that is covered by `m × (n + 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..98d7090ab4 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: @@ -43,7 +43,7 @@ namespace Dihomotopy variable {X : dTopCat} {x y : X} (γ : Dipath x y) /-- The directed map taking the pointwise minimum of the two coordinates on `I × I`. -/ -def MinDirected : D(I × I, I) where +@[expose] def MinDirected : D(I × I, I) where toFun := fun t => min t.1 t.2 continuous_toFun := Continuous.subtype_mk ((continuous_subtype_val.comp continuous_fst).min @@ -52,7 +52,7 @@ def MinDirected : D(I × I, I) where le_min (min_le_of_left_le (h₁ hab)) (min_le_of_right_le (h₂ hab)) /-- The directed map taking the pointwise maximum of the two coordinates on `I × I`. -/ -def MaxDirected : D(I × I, I) where +@[expose] def MaxDirected : D(I × I, I) where toFun := fun t => max t.1 t.2 continuous_toFun := Continuous.subtype_mk ((continuous_subtype_val.comp continuous_fst).max @@ -62,7 +62,7 @@ def MaxDirected : D(I × I, I) where /-- Dihomotopy from the constant path at the source to a dipath, given by `SourceToPath γ (s, t) = γ (min s t)`. -/ -def SourceToPath : Dihomotopy (Dipath.refl x).toDirectedMap γ.toDirectedMap where +@[expose] def SourceToPath : Dihomotopy (Dipath.refl x).toDirectedMap γ.toDirectedMap where toDirectedMap := γ.toDirectedMap.comp MinDirected map_zero_left := fun t => by change γ (min 0 t) = _ @@ -88,7 +88,7 @@ lemma sourceToPath_range : Set.range (SourceToPath γ) = Set.range γ := by /-- Dihomotopy from a dipath to the constant path at the target, given by `PathToTarget γ (s, t) = γ (max s t)`. -/ -def PathToTarget : Dihomotopy γ.toDirectedMap (Dipath.refl y).toDirectedMap where +@[expose] def PathToTarget : Dihomotopy γ.toDirectedMap (Dipath.refl y).toDirectedMap where toDirectedMap := γ.toDirectedMap.comp MaxDirected map_zero_left := fun t => by change γ (max 0 t) = _ 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..ba0133c478 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. @@ -50,14 +50,14 @@ lemma target_elt_of_image_subset {γ : Dipath x y} (hγ : range γ ⊆ X₀) : y := γ.target ▸ (hγ (mem_range_self 1)) /-- Lift a path whose range lies inside `X₀` to a path in the subtype `X₀`. -/ -def SubtypePath {γ : Dipath x y} (hγ : range γ ⊆ X₀) : +@[expose] def SubtypePath {γ : Dipath x y} (hγ : range γ ⊆ X₀) : Path (⟨x, source_elt_of_image_subset hγ⟩ : X₀) ⟨y, target_elt_of_image_subset hγ⟩ where toFun := fun t => ⟨γ t, hγ (mem_range_self t)⟩ source' := by simp target' := by simp /-- Lift a dipath whose range lies inside `X₀` to a dipath in the subtype `X₀`. -/ -def SubtypeDipath (γ : Dipath x y) (hγ : range γ ⊆ X₀) : +@[expose] def SubtypeDipath (γ : Dipath x y) (hγ : range γ ⊆ X₀) : Dipath (⟨x, source_elt_of_image_subset hγ⟩ : X₀) ⟨y, target_elt_of_image_subset hγ⟩ where toPath := SubtypePath hγ dipath_toPath := γ.dipath_toPath 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..dc99a03e9c 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 @@ -122,10 +122,12 @@ variable {p₀ p₁ p₂ : Dipath x y} /-- Given a dipath `p`, we can define a `Dihomotopy p p` by `F (t, x) = p x` -/ -@[simps!] +@[simps! (isSimp := false)] def refl (p : Dipath x y) : Dihomotopy p p := DirectedMap.DihomotopyRel.refl p.toDirectedMap {0, 1} +attribute [simp] _root_.Dipath.Dihomotopy.refl_toFun + /-- Given `Dihomotopy p₀ p₁` and `Dihomotopy p₁ p₂`, we can define a `Dihomotopy p₀ p₂` by putting the first dihomotopy on `[0, 1/2]` and the second on `[1/2, 1]`. @@ -205,7 +207,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 +240,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 +522,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! (isSimp := false)] 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 @@ -537,6 +539,8 @@ def _root_.Dipath.Dihomotopy.map {p q : Dipath x y} (F : Dihomotopy p q) (f : D( simp directed_toFun := (f.comp F.toDirectedMap).directed_toFun +attribute [simp] _root_.Dipath.Dihomotopy.map_toFun + end Dihomotopy @@ -546,11 +550,11 @@ variable (p₀ p₁ : Dipath x y) /-- Two dipaths `p₀` and `p₁` are `Dipath.PreDihomotopic` if there exists a `Dihomotopy` from `p₀` to `p₁`. -/ -def _root_.Dipath.PreDihomotopic : Prop := Nonempty (Dihomotopy p₀ p₁) +@[expose] 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 +702,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 +718,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 +729,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..2867ac809e 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. @@ -240,7 +240,7 @@ lemma functorOnHomOfCoveredAux_equal {γ : Dipath x y} (hγ₁ : range γ ⊆ X have hγ₀ : range γ ⊆ X₁ ∩ X₂ := subset_inter hγ₁ hγ₂ apply (eqToHom_comp_iff _ _ _).mpr apply (comp_eqToHom_iff _ _ _).mpr - simp only [dTopCat.coe_of, eqToHom_trans_assoc, Category.assoc, eqToHom_trans] + simp only [eqToHom_trans_assoc, Category.assoc, eqToHom_trans] exact map_eq_map_of_eq h_comm ⟦SubtypeDipath γ hγ₀⟧ /- - ### Define the mapping behaviour on covered paths @@ -389,7 +389,7 @@ lemma functorOnHomOfCovered_dihomotopic {x y : X} {γ γ' : Dipath x y} {F : Dih - ### Define the behaviour on partwise covered paths -/ /-- Recursive map on paths split into finitely many covered pieces. -/ -def FunctorOnHomOfCoveredPartwiseAux {n : ℕ} : +@[expose] def FunctorOnHomOfCoveredPartwiseAux {n : ℕ} : ∀ (x y : X) (γ : Dipath x y) (_ : coveredPartwise hX γ n), F_obj ⟨x⟩ ⟶ F_obj ⟨y⟩ := Nat.recOn n @@ -629,13 +629,11 @@ lemma functorOnHomOfCoveredPartwise_trans {n : ℕ} : focus intro t rw [SplitProperties.firstPart_cast] - simp only [Dipath.cast_apply] exact SplitProperties.trans_first_part_of_second_part γ₁ γ₂ n t simp · apply functorOnHomOfCovered_heq_of_ext hX h_comm intro t rw [SplitProperties.secondPart_cast] - simp only [Dipath.cast_apply] exact SplitProperties.trans_second_part_second_part γ₁ γ₂ n t lemma functorOnHomOfCoveredPartwise_unique {n m : ℕ} {γ : Dipath x y} (hγ_n : coveredPartwise hX γ n) (hγ_m : coveredPartwise hX γ m) : @@ -949,7 +947,7 @@ lemma functorOnHomAux_of_dihomotopic (γ γ' : Dipath x y) (h : γ.Dihomotopic - ### Define the behaviour on quotient of paths -/ /-- Map on morphisms of the directed fundamental category. -/ -def FunctorOnHom {x y : dπₓ X} (γ : x ⟶ y) : F_obj x ⟶ F_obj y := +@[expose] def FunctorOnHom {x y : dπₓ X} (γ : x ⟶ y) : F_obj x ⟶ F_obj y := Quotient.liftOn γ Fh_aux (functorOnHomAux_of_dihomotopic hX X₁_open X₂_open h_comm) local notation "F_hom" => FunctorOnHom hX X₁_open X₂_open h_comm lemma functorOnHom_apply (γ : Dipath x y) : @@ -977,7 +975,7 @@ lemma functorOnHom_comp {x y z : dπₓ X} (γ₁ : x ⟶ y) (γ₂ : y ⟶ z) : ## Define the functor F : (dπₓ X) ⟶ C -/ /-- The pushout functor from the directed fundamental category of `X` to `C`. -/ -def Functor : (dπₓ X) ⥤ C where +@[expose] def Functor : (dπₓ X) ⥤ C where obj := F_obj map γ := F_hom γ map_id x := functorOnHom_id hX X₁_open X₂_open h_comm x 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..36e487d200 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. @@ -66,7 +66,7 @@ lemma transAssocReparamAux_directed : DirectedMap.Directed /-- The directed self-map of the unit interval used to associate triple concatenations of dipaths. -/ -def transAssocReparamAuxMap : D(I,I) where +@[expose] def transAssocReparamAuxMap : D(I,I) where toFun := fun t => ⟨transAssocReparamAux t, transAssocReparamAux_mem_I t⟩ continuous_toFun := Continuous.subtype_mk continuous_transAssocReparamAux _ directed_toFun := transAssocReparamAux_directed @@ -111,7 +111,7 @@ structure FundamentalCategory (X : Type u) where namespace FundamentalCategory /-- The fundamental-category wrapper is type-equivalent to the underlying type. -/ -@[simps] +@[expose, simps] def equiv (X : Type*) : FundamentalCategory X ≃ X where toFun x := x.as invFun x := .mk x @@ -176,7 +176,7 @@ lemma id_eq_path_refl (x : FundamentalCategory X) : 𝟙 x = ⟦Dipath.refl x.as⟧ := rfl /-- The functor on fundamental categories induced by a directed map. -/ -@[simps] +@[expose, simps] def mapFunctor {X Y : Type*} [DirectedSpace X] [DirectedSpace Y] (f : D(X,Y)) : FundamentalCategory X ⥤ FundamentalCategory Y where obj x := ⟨f x.as⟩ @@ -212,7 +212,7 @@ protected theorem mapFunctor_comp {X Y Z : Type*} [DirectedSpace X] [DirectedSpa /-- The fundamental-category functor `dTopCat ⥤ Cat` sending a directed space to its fundamental category. -/ -def fundamentalCategoryFunctor : dTopCat ⥤ CategoryTheory.Cat where +@[expose] def fundamentalCategoryFunctor : dTopCat ⥤ CategoryTheory.Cat where obj X := Cat.of (FundamentalCategory X) map f := (mapFunctor f.hom).toCatHom map_id X := by @@ -228,7 +228,7 @@ scoped notation "dπ" => FundamentalCategory.fundamentalCategoryFunctor scoped notation "dπₓ" => FundamentalCategory.fundamentalCategoryFunctor.obj /-- The underlying functor (not just `Cat.Hom`) induced by a `dTopCat` map. -/ -@[reducible] +@[expose, reducible] def fundamentalCategoryMap {X Y : dTopCat} (f : X ⟶ Y) : (fundamentalCategoryFunctor.obj X) ⥤ (fundamentalCategoryFunctor.obj Y) := (fundamentalCategoryFunctor.map f).toFunctor diff --git a/LeanPool/DirectedTopologyLean4/Interpolate.lean b/LeanPool/DirectedTopologyLean4/Interpolate.lean index 68a18cf246..520e20a30c 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 @@ -54,18 +54,18 @@ lemma interp_const_le_of_le_of_le {a b T₀ T₁ : I} (hab : a ≤ b) (hT : T₀ nlinarith /-- The continuous map `t ↦ (1 - t) * a + t * b` interpolating between `a` and `b` in `I`. -/ -def interpolateConst (a b : I) : C(I, I) where +@[expose] def interpolateConst (a b : I) : C(I, I) where toFun := fun t => ⟨_, interp_mem_I t a b⟩ /-- The directed-map version of `interpolateConst` when `a ≤ b`. -/ -def directedInterpolateConst {a b : I} (h : a ≤ b) : D(I,I) where +@[expose] def directedInterpolateConst {a b : I} (h : a ≤ b) : D(I,I) where toContinuousMap := interpolateConst a b directed_toFun := fun _ _ _ hγ _ _ hxy => interp_const_le_of_le_of_le h (hγ hxy) 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..fb4457ad4d 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₂: @@ -35,7 +35,7 @@ variable {X : dTopCat} {X₀ X₁ : Set X} /-- A dipath `γ` is *covered* by the cover `X₀ ∪ X₁ = univ` when its range lies inside one of the two sets. -/ -def covered {x₀ x₁ : X} (hX : X₀ ∪ X₁ = univ) (γ : Dipath x₀ x₁) : Prop := +@[expose] def covered {x₀ x₁ : X} (hX : X₀ ∪ X₁ = univ) (γ : Dipath x₀ x₁) : Prop := let _ : X₀ ∪ X₁ = univ := hX (range γ ⊆ X₀) ∨ (range γ ⊆ X₁) @@ -98,7 +98,7 @@ open covered /-- We say that `coveredPartwise hX γ n` if a dipath γ can be split into n+1 parts, each of which is covered by `X₁` or `X₂` -/ -def coveredPartwise (hX : X₀ ∪ X₁ = Set.univ) {x y : X} (γ : Dipath x y) (n : ℕ) : Prop := +@[expose] def coveredPartwise (hX : X₀ ∪ X₁ = Set.univ) {x y : X} (γ : Dipath x y) (n : ℕ) : Prop := match n with | Nat.zero => covered hX γ | Nat.succ n => 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 634b32c816..0d6a9c4c63 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 327b12c15c..f297ebfc20 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 4024c094b6..079a7b8a66 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 372aa0a9d7..d27531d5b9 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 64066d85fe..ebc47ee87e 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 a0d58c39d8..fd0b0ea3bb 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 9aceb55ada..85bc15ced4 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 d8703c0166..6cd4b9d34d 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..4d900e0e34 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 @@ -42,18 +42,22 @@ variable {V : Type*} {G : SimpleGraph V} /-- A graph is **chordal** if every cycle of length `≥ 4` has a chord: an adjacency between two vertices of the cycle whose edge is not one of the cycle's own edges. -/ +@[expose] def IsChordal (G : SimpleGraph V) : Prop := ∀ ⦃v : V⦄ (c : G.Walk v v), c.IsCycle → 4 ≤ c.length → ∃ x y : V, x ∈ c.support ∧ y ∈ c.support ∧ G.Adj x y ∧ s(x, y) ∉ c.edges /-- A vertex is **simplicial** if its neighbourhood induces a clique. -/ +@[expose] def IsSimplicial (G : SimpleGraph V) (v : V) : Prop := G.IsClique (G.neighborSet v) /-- `S` **separates** `a` from `b` if neither lies in `S` and every walk `a → b` meets `S`. -/ +@[expose] def Separates (G : SimpleGraph V) (S : Set V) (a b : V) : Prop := a ∉ S ∧ b ∉ S ∧ ¬ Relation.ReflTransGen (fun p q => p ∉ S ∧ q ∉ S ∧ G.Adj p q) a b /-- `S` is a **minimal** `a`–`b` separator: it separates them and no proper subset does. -/ +@[expose] def IsMinimalSeparator (G : SimpleGraph V) (S : Set V) (a b : V) : Prop := G.Separates S a b ∧ ∀ T ⊂ S, ¬ G.Separates T a b 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/ErdosGinzburgZiv/EGZ/Asymptotics.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Asymptotics.lean index 7cfec52163..ee0fea5135 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Asymptotics.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Asymptotics.lean @@ -13,11 +13,12 @@ public import Mathlib.Order.Filter.AtTopBot.Basic /-! ## Consequences of the polynomial bound -/ -@[expose] public section +public section namespace EGZ /-- The filter for a natural number tending to infinity through prime values. -/ +@[expose] def atTopAlongPrimes : Filter ℕ := Filter.atTop ⊓ Filter.principal {p : ℕ | p.Prime} @@ -26,6 +27,7 @@ elementary lower bound `hollowConstant p d * (p - 1) + 1 ≤ egzConstant p d` and a bound on `hollowConstant p d` that is uniform in `p` for fixed `d` (Proposition `thw` in the paper), this implies the little-`o` formulation of Theorem 1.2. -/ +@[expose] def MainUpperBound (d : ℕ) : Prop := ∀ ε : ℝ, 0 < ε → ∀ᶠ p in atTopAlongPrimes, @@ -33,6 +35,7 @@ def MainUpperBound (d : ℕ) : Prop := ((hollowConstant p d : ℝ) + ε) * (p : ℝ) /-- The direct little-`o` formulation of Theorem 1.2. -/ +@[expose] def MainAsymptotic (d : ℕ) : Prop := (fun p : ℕ => (egzConstant p d : ℝ) - diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Balanced/Existence.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Balanced/Existence.lean index 7d9a7c0aa6..ac713509e6 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Balanced/Existence.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Balanced/Existence.lean @@ -17,7 +17,7 @@ Bounded integer correction then supplies every sufficiently large weight, with its lower fraction and threshold independent of centrality. -/ -@[expose] public section +public section namespace EGZ diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Balanced/IntegerApproximation.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Balanced/IntegerApproximation.lean index 0a42715034..305bcd83e9 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Balanced/IntegerApproximation.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Balanced/IntegerApproximation.lean @@ -18,7 +18,7 @@ integer correction depends only on the remainder modulo one common denominator, and therefore has uniformly bounded error. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Balanced/RationalApproximation.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Balanced/RationalApproximation.lean index d355eec56b..2209f88cce 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Balanced/RationalApproximation.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Balanced/RationalApproximation.lean @@ -18,7 +18,7 @@ any consistent rational system. Its real extension allows approximation by rational solutions while retaining open inequalities. -/ -@[expose] public section +public section open scoped BigOperators Matrix diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Balanced/RationalCoefficients.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Balanced/RationalCoefficients.lean index d5652d309c..a9a7b3b0b2 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Balanced/RationalCoefficients.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Balanced/RationalCoefficients.lean @@ -17,7 +17,7 @@ equations. The largest centrality keeps the resulting coefficients uniform over every admissible centrality parameter. -/ -@[expose] public section +public section open scoped BigOperators Matrix diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Balanced/RealCoefficients.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Balanced/RealCoefficients.lean index 84d3d5e908..ad6c27a220 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Balanced/RealCoefficients.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Balanced/RealCoefficients.lean @@ -20,7 +20,7 @@ image of a capped simplex. The cap can be selected at the largest centrality, so the resulting coefficients do not depend on the centrality parameter. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/BalancedCombination.lean b/LeanPool/ErdosGinzburgZiv/EGZ/BalancedCombination.lean index d9cca3f5ed..bfb623331d 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/BalancedCombination.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/BalancedCombination.lean @@ -22,7 +22,7 @@ case. The constants are chosen before the centrality parameter, as required by the paper's uniformity in the main proof. -/ -@[expose] public section +public section open scoped BigOperators @@ -32,6 +32,7 @@ namespace BalancedCombination /-- Centrality for a finite weight on integer coordinate points. Testing closed halfspaces through the center suffices for all containing halfspaces. -/ +@[expose] def IsCentral {d : ℕ} (S : Finset (IntCoord d)) (w : S → ℝ) (θ : ℝ) (c : RealCoord d) : Prop := by classical @@ -130,17 +131,21 @@ namespace BoundedConfiguration variable {d K W : ℕ} /-- Underlying finite lattice support of the bounded configuration. -/ +@[expose] def support (Q : BoundedConfiguration d K W) : Finset (IntCoord d) := Q.1.val /-- Real weights obtained from the bounded integer weights. -/ +@[expose] def weight (Q : BoundedConfiguration d K W) : Q.support → ℝ := fun q ↦ (Q.2.1 q).val /-- Integral center encoded by the bounded configuration. -/ +@[expose] def center (Q : BoundedConfiguration d K W) : IntCoord d := Q.2.2.val /-- Geometric validity and positivity are checked before applying the balanced-combination statement. Centrality is deliberately absent. -/ +@[expose] def Valid (Q : BoundedConfiguration d K W) : Prop := Q.support.Nonempty ∧ (∀ q, 0 < Q.weight q) ∧ Q.center ∈ affineSpan ℤ (↑Q.support : Set (IntCoord d)) ∧ @@ -148,6 +153,7 @@ def Valid (Q : BoundedConfiguration d K W) : Prop := (convexHull ℝ (IntCoord.real '' (↑Q.support : Set (IntCoord d)))) /-- Construct balanced-combination data from a valid bounded configuration. -/ +@[expose] def data (Q : BoundedConfiguration d K W) (h : Q.Valid) : Data d where support := Q.support support_nonempty := h.1 @@ -158,6 +164,7 @@ def data (Q : BoundedConfiguration d K W) (h : Q.Valid) : Data d where center_mem_interior := h.2.2.2 /-- Encode any support and positive bounded integer weights. -/ +@[expose] def ofWeights (S : Finset (IntCoord d)) (hS : S ⊆ latticeBox d K) (w : S → ℕ) (hw : ∀ q, w q ≤ W) (c : IntCoord d) (hc : c ∈ latticeBox d K) : BoundedConfiguration d K W := @@ -170,6 +177,7 @@ end BalancedCombination /-- The finite balanced convex-combination lemma in integer lattice coordinates. This is a proposition interface, not an axiom or a proved theorem. In particular, both `μ` and `N` are independent of `θ` and `n`. -/ +@[expose] def BalancedCombinationLemma : Prop := ∀ (d : ℕ) (D : BalancedCombination.Data d) (ε : ℝ), 0 < ε → ∃ (μ : ℝ) (N : ℕ), 0 < μ ∧ diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/BalancedRounding.lean b/LeanPool/ErdosGinzburgZiv/EGZ/BalancedRounding.lean index 833d76adbe..74fc199476 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/BalancedRounding.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/BalancedRounding.lean @@ -18,7 +18,7 @@ and coefficient upper bounds transfer quantitatively. Bounded rounded weights belong to a finite family before the prime or original masses are fixed. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Consistency/ConvexHullClosure.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Consistency/ConvexHullClosure.lean index d1c139c441..2781945e2e 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Consistency/ConvexHullClosure.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Consistency/ConvexHullClosure.lean @@ -16,7 +16,7 @@ the two downstream consequences used by decomposition visible at the consistency layer. -/ -@[expose] public section +public section namespace EGZ diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Consistency/FaceFlagHellyBound.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Consistency/FaceFlagHellyBound.lean index 3a1b2b8eb2..62d2cc4462 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Consistency/FaceFlagHellyBound.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Consistency/FaceFlagHellyBound.lean @@ -39,7 +39,7 @@ distinction is essential: an unsupported zero-dimensional face has no affine lattice generated by the support. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Consistency/PropositionSevenOne.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Consistency/PropositionSevenOne.lean index 85bc5fad18..0d3796394f 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Consistency/PropositionSevenOne.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Consistency/PropositionSevenOne.lean @@ -25,7 +25,7 @@ Keeping these as standalone, proved lemmas prevents the later flag interface from hiding either step in an axiom. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Consistency/TheoremOneTwelve.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Consistency/TheoremOneTwelve.lean index 4d6c637b36..342c4645e5 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Consistency/TheoremOneTwelve.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Consistency/TheoremOneTwelve.lean @@ -27,7 +27,7 @@ obligations below suffice. In particular, the Helly bound is derived from the three-case check in `FaceFlagHellyBound`, rather than stored as a field. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Convex/AffineLattice.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Convex/AffineLattice.lean index 3acbb88871..d9eaa8f607 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Convex/AffineLattice.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Convex/AffineLattice.lean @@ -17,7 +17,7 @@ integer span is contained in a rescaled copy of the standard integer lattice, so its intersection with a compact set is finite. -/ -@[expose] public section +public section open scoped BigOperators @@ -291,6 +291,7 @@ theorem finite_mem_of_isCompact {d : ℕ} (L : AffineLattice d) exact L.finite_inter_compact hK /-- The standard integer lattice in the chosen coordinates. -/ +@[expose] def standard (d : ℕ) : AffineLattice d where carrier := {q | IsIntegral q} nonempty := ⟨0, ⟨0, by ext i; simp [IntCoord.real]⟩⟩ @@ -305,6 +306,7 @@ def standard (d : ℕ) : AffineLattice d where exact RationalPolytope.finite_integral_of_isCompact hK /-- The affine lattice generated by a finite nonempty rational set. -/ +@[expose] noncomputable def span {d : ℕ} (S : Set (RealCoord d)) (hfinite : S.Finite) (hnonempty : S.Nonempty) (hrational : ∀ q ∈ S, IsRational q) : AffineLattice d where diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Convex/Coordinate.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Convex/Coordinate.lean index 891ee99915..b82cb14eed 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Convex/Coordinate.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Convex/Coordinate.lean @@ -30,7 +30,7 @@ integer, and modulo-`p` realizations. This is the compatibility needed in the proof of Proposition 7.1. -/ -@[expose] public section +public section open scoped BigOperators @@ -48,9 +48,10 @@ abbrev FpCoord (p n : ℕ) := Fin n → ZMod p namespace IntCoord /-- Realification of an integer coordinate vector. -/ -def real {n : ℕ} (z : IntCoord n) : RealCoord n := fun i ↦ (z i : ℝ) +@[expose] def real {n : ℕ} (z : IntCoord n) : RealCoord n := fun i ↦ (z i : ℝ) /-- Coordinatewise reduction modulo `p`. -/ +@[expose] def mod (p : ℕ) {n : ℕ} (z : IntCoord n) : FpCoord p n := fun i ↦ (z i : ZMod p) @[simp] @@ -87,9 +88,11 @@ end IntCoord /-- A real coordinate vector represents a point of the distinguished affine integer lattice. -/ +@[expose] def IsIntegral {n : ℕ} (q : RealCoord n) : Prop := ∃ z : IntCoord n, z.real = q /-- A real point has rational coordinate data. -/ +@[expose] def IsRational {n : ℕ} (q : RealCoord n) : Prop := ∀ i, ∃ a : ℚ, (a : ℝ) = q i @@ -113,6 +116,7 @@ structure IntegralAffineMap (m n : ℕ) where namespace IntegralAffineMap /-- The identity integral-affine map. -/ +@[expose] def id (n : ℕ) : IntegralAffineMap n n where real := AffineMap.id ℝ (RealCoord n) integer := _root_.id @@ -121,6 +125,7 @@ def id (n : ℕ) : IntegralAffineMap n n where mod_integer _ _ := rfl /-- Composition of integral-affine maps. -/ +@[expose] def comp {l m n : ℕ} (f : IntegralAffineMap m n) (g : IntegralAffineMap l m) : IntegralAffineMap l n where real := f.real.comp g.real @@ -276,6 +281,7 @@ theorem finite_integral_convexHull {n : ℕ} /-- A nonempty finite rational set, presented as a finset, determines a `RationalPolytope` with exactly its ordinary real convex hull as carrier. -/ +@[expose] def ofFinsetConvexHull {n : ℕ} (generators : Finset (RealCoord n)) (hnonempty : generators.Nonempty) (hrational : ∀ q ∈ generators, IsRational q) : RationalPolytope n where @@ -294,6 +300,7 @@ theorem ofFinsetConvexHull_carrier {n : ℕ} convexHull ℝ (↑generators : Set (RealCoord n)) := rfl /-- Set-based constructor used for the support hull in Theorem 1.12. -/ +@[expose] noncomputable def ofFiniteConvexHull {n : ℕ} (S : Set (RealCoord n)) (hfinite : S.Finite) (hnonempty : S.Nonempty) (hrational : ∀ q ∈ S, IsRational q) : RationalPolytope n := @@ -335,7 +342,7 @@ theorem nonempty {n : ℕ} (P : RationalPolytope n) : P.carrier.Nonempty := by /-- The actual vertices are the extreme points of the carrier. They are kept separate from an arbitrary finite generating set, which may be redundant. -/ -def vertexSet {n : ℕ} (P : RationalPolytope n) : Set (RealCoord n) := +@[expose] def vertexSet {n : ℕ} (P : RationalPolytope n) : Set (RealCoord n) := P.carrier.extremePoints ℝ theorem vertexSet_subset_generators {n : ℕ} (P : RationalPolytope n) : @@ -378,6 +385,7 @@ theorem ext {n : ℕ} {P : RationalPolytope n} {F G : P.Face} simp_all /-- Relative interior, called simply "interior of a face" in the paper. -/ +@[expose] def relInterior {n : ℕ} {P : RationalPolytope n} (F : P.Face) : Set (RealCoord n) := intrinsicInterior ℝ F.carrier diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Convex/FaceCombinations.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Convex/FaceCombinations.lean index c4f9580225..3a84f0305d 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Convex/FaceCombinations.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Convex/FaceCombinations.lean @@ -18,7 +18,7 @@ is the least face containing the point. Independently, finiteness of the face poset constructs such a least face for every point of the polytope. -/ -@[expose] public section +public section open scoped BigOperators @@ -109,6 +109,7 @@ theorem eq_of_mem_relInterior {d : ℕ} {P : RationalPolytope d} · exact le_of_mem_relInterior hqG (intrinsicInterior_subset hqF) /-- Order-theoretic minimality among the faces which contain a point. -/ +@[expose] def IsLeastFaceAt {d : ℕ} (P : RationalPolytope d) (q : RealCoord d) (F : P.Face) : Prop := q ∈ F.carrier ∧ ∀ G : P.Face, q ∈ G.carrier → F ≤ G diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Convex/Faces.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Convex/Faces.lean index ee938b6786..c158840420 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Convex/Faces.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Convex/Faces.lean @@ -18,7 +18,7 @@ type used by this project is finite, even though an exposure is stored using arbitrary real affine data. -/ -@[expose] public section +public section namespace EGZ.RationalPolytope @@ -26,6 +26,7 @@ namespace Face /-- The generators of `P` which lie on a face. This finite set uniquely determines the face. -/ +@[expose] noncomputable def generatorFinset {n : ℕ} {P : RationalPolytope n} (F : P.Face) : Finset (RealCoord n) := by classical @@ -126,6 +127,7 @@ theorem le_iff_carrier_subset {n : ℕ} {P : RationalPolytope n} {F G : P.Face} : F ≤ G ↔ F.carrier ⊆ G.carrier := Iff.rfl /-- The whole polytope is its top exposed face. -/ +@[expose] def top {n : ℕ} (P : RationalPolytope n) : P.Face where carrier := P.carrier is_exposed := by @@ -145,6 +147,7 @@ noncomputable instance faceOrderTop {n : ℕ} (P : RationalPolytope n) : le_top F := F.subset_polytope /-- The intersection of two faces is a face whenever it is nonempty. -/ +@[expose] def interOfNonempty {n : ℕ} {P : RationalPolytope n} (F G : P.Face) (hnonempty : (F.carrier ∩ G.carrier).Nonempty) : P.Face where carrier := F.carrier ∩ G.carrier diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Convex/FiniteHull.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Convex/FiniteHull.lean index 0bfa6f8ae4..b82ad8b514 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Convex/FiniteHull.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Convex/FiniteHull.lean @@ -21,7 +21,7 @@ rational polytope whose vertices are exactly a given rational family in convex position. -/ -@[expose] public section +public section open scoped BigOperators @@ -29,7 +29,7 @@ namespace EGZ /-- The paper's finite-family notion of convex position, in the operational form needed by Definition 3.7. -/ -def IsInConvexPosition {d n : ℕ} (points : Fin n → RealCoord d) : Prop := +@[expose] def IsInConvexPosition {d n : ℕ} (points : Fin n → RealCoord d) : Prop := ∀ (i : Fin n) (weight : Fin n → ℝ), (∀ j, 0 ≤ weight j) → (∑ j, weight j) = 1 → diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Convex/HollowBound.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Convex/HollowBound.lean index 30d3bd6eb0..1442b52b4e 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Convex/HollowBound.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Convex/HollowBound.lean @@ -21,7 +21,7 @@ the vertex counts defining `hollowPolytopeNumber`. It also develops the Smith-normal-form saturation lemma needed to prove that bridge. -/ -@[expose] public section +public section open scoped BigOperators @@ -30,6 +30,7 @@ namespace EGZ /-- The weakest consequence of Proposition `wl` needed for bounding one hollow polytope: its vertices have a `p`-hollow reduction for at least one prime. -/ +@[expose] def RationalPolytope.HasPrimeHollowReduction {d : ℕ} (P : RationalPolytope d) : Prop := ∃ p : ℕ, p.Prime ∧ @@ -38,6 +39,7 @@ def RationalPolytope.HasPrimeHollowReduction {d : ℕ} /-- Dimensionwise form of the reduction bridge. Proposition `wl` proves a stronger eventual-prime statement, while this existential form is all that the polynomial bound needs. -/ +@[expose] def HollowReductionBridge (d : ℕ) : Prop := ∀ P : RationalPolytope d, P.IsHollow → P.HasPrimeHollowReduction diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Convex/HollowReduction.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Convex/HollowReduction.lean index f5c45fcce1..a5a015eee8 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Convex/HollowReduction.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Convex/HollowReduction.lean @@ -21,7 +21,7 @@ uniform saturation of the submodules generated by the vertices of every face. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Convex/Homogenization.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Convex/Homogenization.lean index a322969944..c5b1a109c6 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Convex/Homogenization.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Convex/Homogenization.lean @@ -18,7 +18,7 @@ vertices on each face. The final coordinate turns linear combinations in the homogenized module into affine combinations in the original polytope. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Convex/LeastFaceInterior.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Convex/LeastFaceInterior.lean index 26427aab43..0349df681d 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Convex/LeastFaceInterior.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Convex/LeastFaceInterior.lean @@ -22,7 +22,7 @@ original face produces a strictly smaller exposed face through the point, contradicting leastness. -/ -@[expose] public section +public section namespace EGZ.RationalPolytope.Face diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Convex/Polytope.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Convex/Polytope.lean index 9dec4f88ab..a7e6c06779 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Convex/Polytope.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Convex/Polytope.lean @@ -21,13 +21,14 @@ be rational. Without that requirement a finite set such as "the lattice spanned by the support" would be undefined. -/ -@[expose] public section +public section open scoped BigOperators namespace EGZ /-- The affine integer span of a set: finite integer affine combinations. -/ +@[expose] def affineIntSpan {n : ℕ} (S : Set (RealCoord n)) : Set (RealCoord n) := {q | ∃ (k : ℕ) (points : Fin k → RealCoord n) (coeff : Fin k → ℤ), (∀ i, points i ∈ S) ∧ (∑ i, coeff i) = 1 ∧ @@ -39,36 +40,42 @@ namespace RationalPolytope standard equivalent characterization that `q` lies in the relative interior of `F`. The order-theoretic characterization (every containing face also contains `F`) belongs in the finite-face API. -/ +@[expose] def IsMinimalFaceAt {n : ℕ} (P : RationalPolytope n) (q : RealCoord n) (F : P.Face) : Prop := q ∈ F.relInterior /-- Definition 1.7 (`intpt`): integrality is measured in the affine integer span of the vertices of the minimal face, not in an ambient fixed lattice. -/ +@[expose] def IsIntrinsicInteger {n : ℕ} (P : RationalPolytope n) (q : RealCoord n) : Prop := ∃ F : P.Face, P.IsMinimalFaceAt q F ∧ q ∈ affineIntSpan (P.vertexSet ∩ F.carrier) /-- A hollow polytope has no intrinsic integer points other than vertices. -/ +@[expose] def IsHollow {n : ℕ} (P : RationalPolytope n) : Prop := ∀ q ∈ P.carrier, P.IsIntrinsicInteger q → q ∈ P.vertexSet end RationalPolytope /-- There is a hollow rational `d`-polytope with exactly `n` vertices. -/ +@[expose] def AdmitsHollowPolytopeVertexCount (d n : ℕ) : Prop := ∃ P : RationalPolytope d, P.IsHollow ∧ P.vertexSet.ncard = n /-- The paper's convex-geometric constant `L(d)`, defined as a supremum. Finiteness/attainment will be supplied by the hollow-polytope theory. -/ -noncomputable def hollowPolytopeNumber (d : ℕ) : ℕ := +@[expose] noncomputable def hollowPolytopeNumber (d : ℕ) : ℕ := sSup {n : ℕ | AdmitsHollowPolytopeVertexCount d n} /-- Total mass of a finitely supported nonnegative weight. -/ +@[expose] noncomputable def totalWeight {n : ℕ} (w : RealCoord n → NNReal) : NNReal := ∑ᶠ q, w q /-- Weight on the closed affine halfspace through `q` selected by `xi`. -/ +@[expose] noncomputable def upperHalfspaceWeight {n : ℕ} (w : RealCoord n → NNReal) (q : RealCoord n) (xi : RealCoord n →ᵃ[ℝ] ℝ) : NNReal := ∑ᶠ x, if xi q ≤ xi x then w x else 0 @@ -76,12 +83,14 @@ noncomputable def upperHalfspaceWeight {n : ℕ} (w : RealCoord n → NNReal) /-- A point is `theta`-central if every closed halfspace containing it has at least a `theta` fraction of the total weight. It suffices to test supporting halfspaces whose boundary passes through the point. -/ +@[expose] def IsCentral {n : ℕ} (w : RealCoord n → NNReal) (theta : NNReal) (q : RealCoord n) : Prop := ∀ xi : RealCoord n →ᵃ[ℝ] ℝ, theta * totalWeight w ≤ upperHalfspaceWeight w q xi /-- The exact conclusion of Theorem 1.12. -/ +@[expose] def PolytopeCenterpointConclusion {d : ℕ} (P : RationalPolytope d) (w : RealCoord d → NNReal) : Prop := ∃ (F : P.Face) (q : RealCoord d), diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Convex/VertexHull.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Convex/VertexHull.lean index fd0fd6d93d..3eb0520692 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Convex/VertexHull.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Convex/VertexHull.lean @@ -16,7 +16,7 @@ This finite-dimensional consequence of Krein--Milman is used when a hollow rational polytope is converted into a finite `p`-hollow family. -/ -@[expose] public section +public section namespace EGZ.RationalPolytope diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Convex/VertexWeights.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Convex/VertexWeights.lean index 4d762c5ee9..aa5ec95bef 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Convex/VertexWeights.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Convex/VertexWeights.lean @@ -23,7 +23,7 @@ face lies on that face, and a positive summand of a combination equal to a vertex must be that vertex. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/ConvexFlag/Basic.lean b/LeanPool/ErdosGinzburgZiv/EGZ/ConvexFlag/Basic.lean index ba67077b5b..2d742e03a5 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/ConvexFlag/Basic.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/ConvexFlag/Basic.lean @@ -22,7 +22,7 @@ the same coordinate at an upper node but different domains are distinct (the `0` versus `0'` phenomenon in the examples following Proposition 3.11). -/ -@[expose] public section +public section open scoped BigOperators @@ -79,6 +79,7 @@ theorem mem_domain {F : ConvexFlag} (q : F.Point) (x : F.Node) : x ∈ q.domain ↔ q.base ≤ x := Iff.rfl /-- Coordinate of a point at a node in its domain. -/ +@[expose] def coord {F : ConvexFlag} (q : F.Point) {x : F.Node} (h : q.base ≤ x) : RealCoord (F.rank x) := (F.transition h).real q.val @@ -94,6 +95,7 @@ theorem coord_base {F : ConvexFlag} (q : F.Point) : q.coord (le_refl q.base) = q /-- A point is integral if its coordinate at its base is in that fibre's distinguished affine lattice. -/ +@[expose] def IsIntegral {F : ConvexFlag} (q : F.Point) : Prop := q.val ∈ F.lattice q.base theorem isIntegral_coord {F : ConvexFlag} {q : F.Point} (hq : q.IsIntegral) @@ -103,6 +105,7 @@ theorem isIntegral_coord {F : ConvexFlag} {q : F.Point} (hq : q.IsIntegral) /-- `q` is a projection of `q'` when `q'` has the larger domain and they agree on the domain of `q`. By the cocycle law it is enough to compare at `q.base`. -/ +@[expose] def IsProjectionOf {F : ConvexFlag} (q q' : F.Point) : Prop := ∃ h : q'.base ≤ q.base, q.val = q'.coord h @@ -140,6 +143,7 @@ theorem mem_domain {F : ConvexFlag} (xi : F.LinearFunction) (x : F.Node) : x ∈ xi.domain ↔ x ≤ xi.base := Iff.rfl /-- A function can be evaluated at a point exactly when their domains meet. -/ +@[expose] def EvaluableAt {F : ConvexFlag} (xi : F.LinearFunction) (q : F.Point) : Prop := q.base ≤ xi.base @@ -152,6 +156,7 @@ theorem evaluableAt_iff_domains_inter {F : ConvexFlag} (xi : F.LinearFunction) exact hq.trans hx /-- Evaluation, using the function's base. -/ +@[expose] def eval {F : ConvexFlag} (xi : F.LinearFunction) (q : F.Point) (h : xi.EvaluableAt q) : ℝ := xi.toAffine (q.coord h) @@ -285,6 +290,7 @@ theorem exists_convexCombination {F : ConvexFlag} {I : Type*} [Fintype I] (fun i _ ↦ hx i i.property) /-- The flag-convex hull from Definition 3.5. -/ +@[expose] def convexHull (F : ConvexFlag) (S : Set F.Point) : Set F.Point := {result | ∃ (n : ℕ) (points : Fin n → F.Point) (weight : Fin n → ℝ), (∀ i, points i ∈ S) ∧ ConvexCombination points weight result} diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/ConvexFlag/Centerpoint.lean b/LeanPool/ErdosGinzburgZiv/EGZ/ConvexFlag/Centerpoint.lean index 8363902879..f7a04f16ec 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/ConvexFlag/Centerpoint.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/ConvexFlag/Centerpoint.lean @@ -17,7 +17,7 @@ theory, exactly matching the finite weighted set in the paper and its later application to local lifted mass. -/ -@[expose] public section +public section open scoped BigOperators @@ -26,7 +26,7 @@ namespace EGZ.ConvexFlag /-- The total weight of the input points that lie on or above `center` for a flag functional. Points outside the functional's domain are omitted, as in equation `ceq` of the paper. -/ -noncomputable def upperWeight {F : ConvexFlag} {n : ℕ} +@[expose] noncomputable def upperWeight {F : ConvexFlag} {n : ℕ} (points : Fin n → F.Point) (weight : Fin n → ℝ) (xi : F.LinearFunction) (center : F.Point) (hcenter : xi.EvaluableAt center) : ℝ := by diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/ConvexFlag/ConvexHull.lean b/LeanPool/ErdosGinzburgZiv/EGZ/ConvexFlag/ConvexHull.lean index 76bb9bdaa0..f1987d36ab 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/ConvexFlag/ConvexHull.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/ConvexFlag/ConvexHull.lean @@ -18,7 +18,7 @@ positive supports are used throughout, so the least-upper-bound base is preserved by flattening. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/ConvexFlag/FaceModel.lean b/LeanPool/ErdosGinzburgZiv/EGZ/ConvexFlag/FaceModel.lean index 6d558b0607..675a4c73da 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/ConvexFlag/FaceModel.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/ConvexFlag/FaceModel.lean @@ -23,7 +23,7 @@ is only needed when the final centerpoint is stated as lying in a relative interior. -/ -@[expose] public section +public section open scoped BigOperators @@ -42,6 +42,7 @@ structure FaceFlagModel {d : ℕ} (P : RationalPolytope d) where namespace FaceFlagModel /-- The physical point represented by a proper flag point. -/ +@[expose] def physical {d : ℕ} {P : RationalPolytope d} (A : FaceFlagModel P) (q : A.flag.Point) (hq : q ∈ A.proper) : RealCoord d := (A.properEquiv ⟨q, hq⟩).1 @@ -95,6 +96,7 @@ structure FaceFlagCombinationLaws {d : ℕ} {P : RationalPolytope d} namespace RationalPolytope.Face /-- Restrict a face of `P` to a subpolytope `Q`. -/ +@[expose] def restrict {d : ℕ} {P Q : RationalPolytope d} (F : P.Face) (hQP : Q.carrier ⊆ P.carrier) (hnonempty : (Q.carrier ∩ F.carrier).Nonempty) : Q.Face where @@ -138,6 +140,7 @@ theorem asPolytope_carrier {d : ℕ} {P : RationalPolytope d} F.carrier_eq_convexHull_generatorFinset] /-- The affine lattice generated by the vertices of a face. -/ +@[expose] noncomputable def generatorLattice {d : ℕ} {P : RationalPolytope d} (F : P.Face) : AffineLattice d := AffineLattice.span (F.generatorFinset : Set (RealCoord d)) @@ -223,6 +226,7 @@ private theorem sum_eq_sum_pos_subtype {I E : Type*} [Fintype I] rw [hinactive, add_zero] /-- Proper points are based at their order-theoretic least containing face. -/ +@[expose] def faceProperCarrier {d : ℕ} (P : RationalPolytope d) : Set (faceFlag P).Point := {q | RationalPolytope.Face.IsLeastFaceAt P q.val q.base} @@ -264,6 +268,7 @@ noncomputable abbrev faceProper {d : ℕ} (P : RationalPolytope d) : exact (hpoints i).2 G hpointG /-- Send a proper face-flag point to its physical point in the polytope. -/ +@[expose] def facePhysical {d : ℕ} (P : RationalPolytope d) (q : {q : (faceFlag P).Point // q ∈ faceProper P}) : {x : RealCoord d // x ∈ P.carrier} := by @@ -273,6 +278,7 @@ def facePhysical {d : ℕ} (P : RationalPolytope d) exact q.1.base.subset_polytope hq.1 /-- Identify proper face-flag points with points of the polytope. -/ +@[expose] noncomputable def facePhysicalEquiv {d : ℕ} (P : RationalPolytope d) : {q : (faceFlag P).Point // q ∈ faceProper P} ≃ {x : RealCoord d // x ∈ P.carrier} := diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/ConvexFlag/Helly.lean b/LeanPool/ErdosGinzburgZiv/EGZ/ConvexFlag/Helly.lean index cf5c38a961..c5877522d9 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/ConvexFlag/Helly.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/ConvexFlag/Helly.lean @@ -19,7 +19,7 @@ bounded maximum: the cutoff is the number of integral points in all fibre polytopes, which is finite by local finiteness of the fibre lattices. -/ -@[expose] public section +public section open scoped BigOperators @@ -27,6 +27,7 @@ namespace EGZ.ConvexFlag /-- Integral points in one fibre polytope, before attaching the fibre as the base of a flag point. -/ +@[expose] def IntegralFiber (F : ConvexFlag) (x : F.Node) := {q : RealCoord (F.rank x) // q ∈ (F.polytope x).carrier ∧ q ∈ F.lattice x} @@ -36,6 +37,7 @@ noncomputable instance integralFiberFintype (F : ConvexFlag) (x : F.Node) : exact ((F.lattice x).finite_mem_of_isCompact (F.polytope x).isCompact).fintype /-- A finite code for all integral flag points. -/ +@[expose] def IntegralPointCode (F : ConvexFlag) := Σ x : F.Node, IntegralFiber F x @@ -163,6 +165,7 @@ theorem hellyConstant_pos {F : ConvexFlag} {Ω : F.ProperPointSet} exact (HellyIndependent.singleton hqΩ hqint).card_le_hellyConstant /-- A proper integral point common to the weak hulls of a family of sets. -/ +@[expose] def HasCommonWeakHullPoint {F : ConvexFlag} (Ω : F.ProperPointSet) (ℱ : Set (Set F.Point)) : Prop := ∃ q, q ∈ Ω ∧ q.IsIntegral ∧ diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/ConvexFlag/WeakHull.lean b/LeanPool/ErdosGinzburgZiv/EGZ/ConvexFlag/WeakHull.lean index 4eade29ece..da1da97ab0 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/ConvexFlag/WeakHull.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/ConvexFlag/WeakHull.lean @@ -17,13 +17,13 @@ This is Definition 3.10 and the elementary closure API around equation characterization, is stated as the geometric proof target. -/ -@[expose] public section +public section namespace EGZ.ConvexFlag /-- The weak convex hull of `S`: every flag functional defined at `q` has a defined point of `S` on the same or higher side. -/ -def weakConvexHull (F : ConvexFlag) (S : Set F.Point) : Set F.Point := +@[expose] def weakConvexHull (F : ConvexFlag) (S : Set F.Point) : Set F.Point := {q | ∀ (xi : F.LinearFunction) (hq : xi.EvaluableAt q), ∃ s, s ∈ S ∧ ∃ hs : xi.EvaluableAt s, xi.eval q hq ≤ xi.eval s hs} diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/AffineImages.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/AffineImages.lean index 74274f3058..29238446ce 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/AffineImages.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/AffineImages.lean @@ -20,7 +20,7 @@ These constructions place a lineage's varying coordinate spaces inside its initial coordinate space for the common-measure face-counting argument. -/ -@[expose] public section +public section open scoped BigOperators @@ -47,6 +47,7 @@ variable {l m n : ℕ} /-- Image under an affine map which preserves rational coordinates. The image carrier is definitionally the set-theoretic affine image. -/ +@[expose] noncomputable def affineImage (P : RationalPolytope m) (A : RealCoord m →ᵃ[ℝ] RealCoord n) (hAq : ∀ q, IsRational q → IsRational (A q)) : RationalPolytope n := by @@ -97,6 +98,7 @@ variable {P : RationalPolytope m} /-- An injective affine map carries every exposed face to an exposed face of the image, using an affine left inverse to transport its functional. -/ +@[expose] noncomputable def affineImage (Γ : P.Face) (A : RealCoord m →ᵃ[ℝ] RealCoord n) (hAq : ∀ q, IsRational q → IsRational (A q)) (hA : Function.Injective A) : (P.affineImage A hAq).Face where @@ -135,6 +137,7 @@ theorem image_carrier (Γ : P.Face) (A : IntegralAffineMap m n) /-- Pull back any face of an image polytope. The image description supplies the required nonemptiness automatically. -/ +@[expose] noncomputable def affineImagePullback (A : RealCoord m →ᵃ[ℝ] RealCoord n) (hAq : ∀ q, IsRational q → IsRational (A q)) (Δ : (P.affineImage A hAq).Face) : P.Face := diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/AugmentedCompleteness.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/AugmentedCompleteness.lean index aacd2222e4..0b7ca519aa 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/AugmentedCompleteness.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/AugmentedCompleteness.lean @@ -17,7 +17,7 @@ of fibre-constant affine functionals. A functional distinguishing them lies outside that space, where maximality supplies thickness after slab pruning. -/ -@[expose] public section +public section namespace EGZ diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/AugmentedCoordinates.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/AugmentedCoordinates.lean index 88eeb52581..14810bcb78 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/AugmentedCoordinates.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/AugmentedCoordinates.lean @@ -18,7 +18,7 @@ additional coordinates along lower transitions, and commute with scalar extension and reduction modulo every modulus. -/ -@[expose] public section +public section namespace EGZ @@ -27,10 +27,12 @@ namespace Coord variable {R : Type*} [CommRing R] /-- Linear projection onto the first block of coordinates. -/ +@[expose] def first (m k : ℕ) : (Fin (m + k) → R) →ₗ[R] (Fin m → R) := LinearMap.pi fun i ↦ LinearMap.proj (Fin.castAdd k i) /-- Linear projection onto the last block of coordinates. -/ +@[expose] def last (m k : ℕ) : (Fin (m + k) → R) →ₗ[R] (Fin k → R) := LinearMap.pi fun i ↦ LinearMap.proj (Fin.natAdd m i) @@ -115,6 +117,7 @@ end Coord namespace IntegralAffineMap /-- Forget the extra coordinates of an augmented lattice fibre. -/ +@[expose] def first (m k : ℕ) : IntegralAffineMap (m + k) m where real := (Coord.first m k).toAffineMap integer := Coord.first m k @@ -202,6 +205,7 @@ namespace EGZ.Coord variable {R : Type*} [CommRing R] /-- Keep the initial coordinates of a finite coordinate vector. -/ +@[expose] def prefixMap (es et : ℕ) (h : et ≤ es) : (Fin es → R) →ₗ[R] (Fin et → R) := LinearMap.pi fun i ↦ LinearMap.proj (Fin.castLE h i) @@ -257,6 +261,7 @@ namespace EGZ.IntegralAffineMap /-- Extend an integral-affine map while retaining an initial segment of its additional coordinates. -/ +@[expose] noncomputable def extendPrefix {m n : ℕ} (A : IntegralAffineMap m n) (es et : ℕ) (h : et ≤ es) : IntegralAffineMap (m + es) (n + et) where real := Coord.extendPrefix A.real es et h diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/AugmentedDecomposition.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/AugmentedDecomposition.lean index 6fad47a75b..8f7a029fdb 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/AugmentedDecomposition.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/AugmentedDecomposition.lean @@ -22,7 +22,7 @@ nodes and with the same local weights. Forgetting the additional coordinates maps its proper points to the original decomposition. -/ -@[expose] public section +public section open scoped BigOperators @@ -322,6 +322,7 @@ theorem decomposition_isKBounded {K L B : Φ.flag.Node → ℕ} (hK : Φ.IsKBoun open Classical in /-- Project a new flag point by forgetting the augmented coordinate block. -/ +@[expose] noncomputable def forwardPoint (q : (decomposition Φ e ξ hp he C hmod hcenter).flag.Point) : Φ.flag.Point := q.map (SupHom.id _) (fun x ↦ (forget Φ e ξ hp he C x).real) @@ -343,6 +344,7 @@ theorem forwardPoint_mem_omegaZero open Classical in /-- Forgetting the slab block is a subdivision map to the original flag. -/ +@[expose] noncomputable def subdivisionMap : SubdivisionMap Φ (decomposition Φ e ξ hp he C hmod hcenter) := SubdivisionMap.ofLocalGenerators (SupHom.id _) diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/AugmentedDiagram.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/AugmentedDiagram.lean index 848edf305d..5486382c6e 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/AugmentedDiagram.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/AugmentedDiagram.lean @@ -21,7 +21,7 @@ Centered lifts of cumulative atoms give a finite support diagram, even when the augmented finite-field maps are not surjective. -/ -@[expose] public section +public section namespace EGZ.FlagDecomposition.Augmented @@ -52,6 +52,7 @@ theorem lift_last (x : Φ.flag.Node) (v : FpCoord p d) : open Classical in /-- The finite-field affine map augmented by the same sequence of directions. -/ +@[expose] def map (x : Φ.flag.Node) : FpCoord p d →ᵃ[ZMod p] FpCoord p (Φ.flag.rank x + e x) := Coord.append (Φ.representation.map x) (AffineMap.pi fun i : Fin (e x) ↦ ξ i) @@ -117,6 +118,7 @@ theorem first_image_support (hp : Odd p) (x : Φ.flag.Node) : open Classical in /-- Along an order relation keep only the upper node's prefix of directions. -/ +@[expose] noncomputable def transition (he : Antitone e) {x y : Φ.flag.Node} (h : x ≤ y) : IntegralAffineMap (Φ.flag.rank x + e x) (Φ.flag.rank y + e y) := (Φ.flag.transition h).extendPrefix (e x) (e y) (he h) diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/AugmentedRepresentation.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/AugmentedRepresentation.lean index 0dc5cddf64..495bc48430 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/AugmentedRepresentation.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/AugmentedRepresentation.lean @@ -17,7 +17,7 @@ the augmented support diagram admits a representation on the old cumulative support spans. Its maps are the modular chart inverses of the augmented maps. -/ -@[expose] public section +public section namespace EGZ.FlagDecomposition.Augmented @@ -37,12 +37,12 @@ noncomputable abbrev representation : @[simp] theorem representation_map (x : Φ.flag.Node) : - (representation Φ e ξ hp he C hmod).map x = (C x).rechartMap (map Φ e ξ x) := rfl + (representation Φ e ξ hp he C hmod).map x = (C x).rechartMap (map Φ e ξ x) := by rfl @[simp] theorem representation_space (x : Φ.flag.Node) : (representation Φ e ξ hp he C hmod).space x = - affineSpan (ZMod p) {v | Φ.cumulativeWeight x v ≠ 0} := rfl + affineSpan (ZMod p) {v | Φ.cumulativeWeight x v ≠ 0} := by rfl theorem local_supported (x : Φ.flag.Node) (v : FpCoord p d) (hv : Φ.localWeight x v ≠ 0) : v ∈ (representation Φ e ξ hp he C hmod).space x := diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Basic.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Basic.lean index 9e8af6ba52..1c60d74069 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Basic.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Basic.lean @@ -22,7 +22,7 @@ generators are defined from `localLift`. This distinction is the correction integrated into the current version of the paper. -/ -@[expose] public section +public section open scoped BigOperators @@ -36,46 +36,47 @@ universe u This definition remains meaningful without a large-prime hypothesis. Such a hypothesis is needed only when uniqueness of the representative is used. -/ +@[expose] def HasBoundedRepresentative (p K : ℕ) (a : ZMod p) : Prop := ∃ z : ℤ, z.natAbs ≤ K ∧ (z : ZMod p) = a /-- The `K`-slab cut out by an affine functional on `𝔽_p^d`. -/ -def slab {p d : ℕ} (ξ : FpCoord p d →ᵃ[ZMod p] ZMod p) (K : ℕ) : +@[expose] def slab {p d : ℕ} (ξ : FpCoord p d →ᵃ[ZMod p] ZMod p) (K : ℕ) : Set (FpCoord p d) := {v | HasBoundedRepresentative p K (ξ v)} /-- The mass of a natural-valued function on a subset of a finite type. -/ -noncomputable def natMassOn {α : Type*} [Fintype α] (w : α → ℕ) (S : Set α) : ℕ := by +@[expose] noncomputable def natMassOn {α : Type*} [Fintype α] (w : α → ℕ) (S : Set α) : ℕ := by classical exact ∑ a, if a ∈ S then w a else 0 /-- The total mass of a natural-valued function on a finite type. -/ -noncomputable def natMass {α : Type*} [Fintype α] (w : α → ℕ) : ℕ := +@[expose] noncomputable def natMass {α : Type*} [Fintype α] (w : α → ℕ) : ℕ := ∑ a, w a /-- Mass of an `NNReal`-valued function on a subset of a finite type. -/ -noncomputable def nnrealMassOn {α : Type*} [Fintype α] +@[expose] noncomputable def nnrealMassOn {α : Type*} [Fintype α] (w : α → NNReal) (S : Set α) : NNReal := by classical exact ∑ a, if a ∈ S then w a else 0 /-- Total mass of an `NNReal`-valued function on a finite type. -/ -noncomputable def nnrealMass {α : Type*} [Fintype α] (w : α → NNReal) : NNReal := +@[expose] noncomputable def nnrealMass {α : Type*} [Fintype α] (w : α → NNReal) : NNReal := ∑ a, w a /-- Definition 4.1 for the nonnegative real weights used in the paper. -/ -def IsThinAlongNNReal {p d : ℕ} [NeZero p] (w : FpCoord p d → NNReal) +@[expose] def IsThinAlongNNReal {p d : ℕ} [NeZero p] (w : FpCoord p d → NNReal) (ξ : FpCoord p d →ᵃ[ZMod p] ZMod p) (K : ℕ) (ε : ℝ) : Prop := (1 - ε) * (nnrealMass w : ℝ) ≤ (nnrealMassOn w (slab ξ K) : ℝ) /-- Natural-valued specialization used by flag decompositions and Theorem 4.13. -/ -def IsThinAlong {p d : ℕ} [NeZero p] (w : FpCoord p d → ℕ) +@[expose] def IsThinAlong {p d : ℕ} [NeZero p] (w : FpCoord p d → ℕ) (ξ : FpCoord p d →ᵃ[ZMod p] ZMod p) (K : ℕ) (ε : ℝ) : Prop := IsThinAlongNNReal (fun v ↦ (w v : NNReal)) ξ K ε /-- Thickness is the negation of thinness, as in Definition `tt`. -/ -def IsThickAlong {p d : ℕ} [NeZero p] (w : FpCoord p d → ℕ) +@[expose] def IsThickAlong {p d : ℕ} [NeZero p] (w : FpCoord p d → ℕ) (ξ : FpCoord p d →ᵃ[ZMod p] ZMod p) (K : ℕ) (ε : ℝ) : Prop := ¬ IsThinAlong w ξ K ε @@ -105,6 +106,7 @@ namespace FpRepresentation /-- An affine functional is nonconstant on the fibres of the representation at `x` if two points in one fibre receive different values. -/ +@[expose] def NonconstantOnFibers {p d : ℕ} {F : ConvexFlag} (R : FpRepresentation p d F) (x : F.Node) (ξ : FpCoord p d →ᵃ[ZMod p] ZMod p) : Prop := @@ -116,12 +118,12 @@ end FpRepresentation /-! ## Coordinate lifts -/ /-- Sup norm in the chosen affine-lattice coordinates. -/ -def latticeSupNorm {n : ℕ} (z : IntCoord n) : ℕ := +@[expose] def latticeSupNorm {n : ℕ} (z : IntCoord n) : ℕ := Finset.univ.sup fun i ↦ (z i).natAbs /-- A lattice coordinate lies in the centered representative box modulo `p`. -/ -def IsCenteredLift (p : ℕ) {n : ℕ} (z : IntCoord n) : Prop := +@[expose] def IsCenteredLift (p : ℕ) {n : ℕ} (z : IntCoord n) : Prop := latticeSupNorm z ≤ (p - 1) / 2 namespace FlagDecompositionRaw @@ -129,23 +131,26 @@ namespace FlagDecompositionRaw variable {p d : ℕ} [NeZero p] {F : ConvexFlag} /-- Sum of all local summands at an ambient point. -/ +@[expose] noncomputable def retainedWeight (pieces : F.Node → FpCoord p d → ℕ) (v : FpCoord p d) : ℕ := ∑ x, pieces x v /-- The cumulative function `f_{≼ x}`. -/ +@[expose] noncomputable def cumulativeWeight (pieces : F.Node → FpCoord p d → ℕ) (x : F.Node) (v : FpCoord p d) : ℕ := by classical exact ∑ y, if y ≤ x then pieces y v else 0 /-- Push a finite weight through an affine map whose target rank may vary. -/ -noncomputable def affineFibreMass {n : ℕ} (w : FpCoord p d → ℕ) +@[expose] noncomputable def affineFibreMass {n : ℕ} (w : FpCoord p d → ℕ) (φ : FpCoord p d → FpCoord p n) (c : FpCoord p n) : ℕ := by classical exact ∑ v, if φ v = c then w v else 0 /-- The local centered lift `f_x°`, using only the summand based at `x`. -/ +@[expose] noncomputable def localLift (R : FpRepresentation p d F) (pieces : F.Node → FpCoord p d → ℕ) (x : F.Node) (q : IntCoord (F.rank x)) : ℕ := by @@ -155,6 +160,7 @@ noncomputable def localLift (R : FpRepresentation p d F) else 0 /-- The cumulative centered lift `hat f_x`. -/ +@[expose] noncomputable def hat (R : FpRepresentation p d F) (pieces : F.Node → FpCoord p d → ℕ) (x : F.Node) (q : IntCoord (F.rank x)) : ℕ := by @@ -165,17 +171,20 @@ noncomputable def hat (R : FpRepresentation p d F) /-- Corrected local generating points. A generator based at `x` is selected by positive `localLift`, not by cumulative `hat`. -/ +@[expose] def omegaZero (R : FpRepresentation p d F) (pieces : F.Node → FpCoord p d → ℕ) : Set F.Point := {q | ∃ z : IntCoord (F.rank q.base), z.real = q.val ∧ localLift R pieces q.base z ≠ 0} /-- Proper points associated with local decomposition data. -/ +@[expose] def omega (R : FpRepresentation p d F) (pieces : F.Node → FpCoord p d → ℕ) : Set F.Point := F.convexHull (omegaZero R pieces) /-- Proper points whose coordinate at `x` lies on a given face. -/ +@[expose] def pointsOnFace (R : FpRepresentation p d F) (pieces : F.Node → FpCoord p d → ℕ) (x : F.Node) (Γ : (F.polytope x).Face) : Set F.Point := @@ -183,6 +192,7 @@ def pointsOnFace (R : FpRepresentation p d F) ∃ h : q.base ≤ x, q.coord h ∈ Γ.carrier} /-- Visibility before packaging the data into a `FlagDecomposition`. -/ +@[expose] def VisibleFace (R : FpRepresentation p d F) (pieces : F.Node → FpCoord p d → ℕ) (x : F.Node) (Γ : (F.polytope x).Face) : Prop := @@ -231,44 +241,51 @@ namespace FlagDecomposition variable {p d : ℕ} [NeZero p] {f : FpCoord p d → ℕ} /-- Total retained function `f^Φ`. -/ +@[expose] noncomputable def retainedWeight (Φ : FlagDecomposition p d f) : FpCoord p d → ℕ := FlagDecompositionRaw.retainedWeight Φ.localWeight /-- Cumulative function `f_{≼ x}`. -/ +@[expose] noncomputable def cumulativeWeight (Φ : FlagDecomposition p d f) (x : Φ.flag.Node) : FpCoord p d → ℕ := FlagDecompositionRaw.cumulativeWeight Φ.localWeight x /-- Local centered lifted function `f_x°`. -/ +@[expose] noncomputable def localLift (Φ : FlagDecomposition p d f) (x : Φ.flag.Node) : IntCoord (Φ.flag.rank x) → ℕ := FlagDecompositionRaw.localLift Φ.representation Φ.localWeight x /-- Cumulative centered lifted function `hat f_x`. -/ +@[expose] noncomputable def hat (Φ : FlagDecomposition p d f) (x : Φ.flag.Node) : IntCoord (Φ.flag.rank x) → ℕ := FlagDecompositionRaw.hat Φ.representation Φ.localWeight x /-- Total retained mass `f^Φ(V)`. -/ -noncomputable def retainedMass (Φ : FlagDecomposition p d f) : ℕ := +@[expose] noncomputable def retainedMass (Φ : FlagDecomposition p d f) : ℕ := natMass Φ.retainedWeight /-- Mass of `hat f_x` over lattice points whose real coordinates lie in `S`. The stored support makes this a finite sum. -/ -noncomputable def liftedMassOn (Φ : FlagDecomposition p d f) (x : Φ.flag.Node) +@[expose] noncomputable def liftedMassOn (Φ : FlagDecomposition p d f) (x : Φ.flag.Node) (S : Set (RealCoord (Φ.flag.rank x))) : ℕ := by classical exact ∑ q ∈ Φ.liftedSupport x, if q.real ∈ S then Φ.hat x q else 0 /-- Corrected set `Ω₀` of local generating points. -/ +@[expose] def omegaZero (Φ : FlagDecomposition p d f) : Set Φ.flag.Point := FlagDecompositionRaw.omegaZero Φ.representation Φ.localWeight /-- Corrected proper-point set `Ω = conv Ω₀`. -/ +@[expose] def omega (Φ : FlagDecomposition p d f) : Set Φ.flag.Point := FlagDecompositionRaw.omega Φ.representation Φ.localWeight /-- The corrected proper points, packaged with convex closure. -/ +@[expose] def properPoints (Φ : FlagDecomposition p d f) : Φ.flag.ProperPointSet where carrier := Φ.omega convex_closed := FlagDecompositionRaw.omega_convex_closed @@ -282,6 +299,7 @@ def HasLocalPointMass (Φ : FlagDecomposition p d f) (q : Φ.flag.Point) ∃ z : IntCoord (Φ.flag.rank q.base), z.real = q.val ∧ Φ.localLift q.base z = m /-- Points of `Ω` lying over the face `Γ` at `x`. -/ +@[expose] def pointsOnFace (Φ : FlagDecomposition p d f) (x : Φ.flag.Node) (Γ : (Φ.flag.polytope x).Face) : Set Φ.flag.Point := FlagDecompositionRaw.pointsOnFace Φ.representation Φ.localWeight x Γ @@ -292,7 +310,7 @@ def IsVisibleFace (Φ : FlagDecomposition p d f) (x : Φ.flag.Node) (Φ.pointsOnFace x Γ).Nonempty /-- The finite set of bases used to define `x_Γ`. -/ -noncomputable def faceBases (Φ : FlagDecomposition p d f) (x : Φ.flag.Node) +@[expose] noncomputable def faceBases (Φ : FlagDecomposition p d f) (x : Φ.flag.Node) (Γ : (Φ.flag.polytope x).Face) : Finset Φ.flag.Node := by classical exact Finset.univ.filter fun y ↦ @@ -308,7 +326,7 @@ private theorem faceBases_nonempty (Φ : FlagDecomposition p d f) (x : Φ.flag.N /-- The element `x_Γ`: the supremum of the bases of proper points over a face. Every face of a flag decomposition is visible. -/ -noncomputable def faceIndex (Φ : FlagDecomposition p d f) (x : Φ.flag.Node) +@[expose] noncomputable def faceIndex (Φ : FlagDecomposition p d f) (x : Φ.flag.Node) (Γ : (Φ.flag.polytope x).Face) : Φ.flag.Node := (Φ.faceBases x Γ).sup' (by exact faceBases_nonempty Φ x Γ) id @@ -322,21 +340,25 @@ theorem faceIndex_le (Φ : FlagDecomposition p d f) (x : Φ.flag.Node) exact hq.2.choose /-- A face is realized when the polytope at `x_Γ` maps into it. -/ +@[expose] def IsRealizedFace (Φ : FlagDecomposition p d f) (x : Φ.flag.Node) (Γ : (Φ.flag.polytope x).Face) : Prop := ∀ q ∈ (Φ.flag.polytope (Φ.faceIndex x Γ)).carrier, (Φ.flag.transition (Φ.faceIndex_le x Γ)).real q ∈ Γ.carrier /-- An element is reduced when some proper point is based exactly there. -/ +@[expose] def IsReducedElement (Φ : FlagDecomposition p d f) (x : Φ.flag.Node) : Prop := ∃ q, q ∈ Φ.omega ∧ q.base = x /-- Every element of the decomposition is reduced. -/ +@[expose] def IsReduced (Φ : FlagDecomposition p d f) : Prop := ∀ x, Φ.IsReducedElement x /-- A finite set of lattice points affinely generates the full coordinate lattice over `ℤ`. -/ +@[expose] def AffineIntSpans {n : ℕ} (S : Finset (IntCoord n)) : Prop := ∀ z : IntCoord n, ∃ c : IntCoord n →₀ ℤ, c.support ⊆ S ∧ @@ -344,6 +366,7 @@ def AffineIntSpans {n : ℕ} (S : Finset (IntCoord n)) : Prop := (∑ q ∈ c.support, c q • q) = z /-- Minimality of the finite-field affine spaces and affine lattices. -/ +@[expose] def IsMinimal (Φ : FlagDecomposition p d f) : Prop := ∀ x, Φ.representation.space x = @@ -352,12 +375,13 @@ def IsMinimal (Φ : FlagDecomposition p d f) : Prop := /-- The chosen affine-lattice coordinates are bounded by `K` on every lattice point of every node polytope. -/ +@[expose] def IsKBounded (Φ : FlagDecomposition p d f) (K : Φ.flag.Node → ℕ) : Prop := ∀ x (z : IntCoord (Φ.flag.rank x)), z.real ∈ (Φ.flag.polytope x).carrier → latticeSupNorm z ≤ K x /-- An `ε`-large face, Definition `largef`. -/ -def IsLargeFace (Φ : FlagDecomposition p d f) (ε : ℝ) (x : Φ.flag.Node) +@[expose] def IsLargeFace (Φ : FlagDecomposition p d f) (ε : ℝ) (x : Φ.flag.Node) (Γ : (Φ.flag.polytope x).Face) : Prop := ε * (Φ.retainedMass : ℝ) ≤ (Φ.liftedMassOn x Γ.carrier : ℝ) ∧ ∀ Γ' : (Φ.flag.polytope x).Face, Γ'.carrier ⊂ Γ.carrier → @@ -365,25 +389,26 @@ def IsLargeFace (Φ : FlagDecomposition p d f) (ε : ℝ) (x : Φ.flag.Node) (1 - ε) * (Φ.liftedMassOn x Γ.carrier : ℝ) /-- An `ε`-large flag element. -/ -def IsLargeElement (Φ : FlagDecomposition p d f) (ε : ℝ) +@[expose] def IsLargeElement (Φ : FlagDecomposition p d f) (ε : ℝ) (x : Φ.flag.Node) : Prop := ε * (Φ.retainedMass : ℝ) ≤ (Φ.liftedMassOn x (Φ.flag.polytope x).carrier : ℝ) /-- The minimum positive cumulative lifted mass at a node. -/ -noncomputable def gap (Φ : FlagDecomposition p d f) (x : Φ.flag.Node) : ℕ := +@[expose] noncomputable def gap (Φ : FlagDecomposition p d f) (x : Φ.flag.Node) : ℕ := (Φ.liftedSupport x).image (Φ.hat x) |>.min' ((Φ.liftedSupport_nonempty x).image (Φ.hat x)) /-- Completeness of one element: every affine functional which varies on a representation fibre sees a thick cumulative weight. -/ -def IsCompleteElement (Φ : FlagDecomposition p d f) (x : Φ.flag.Node) +@[expose] def IsCompleteElement (Φ : FlagDecomposition p d f) (x : Φ.flag.Node) (t : ℕ) (δ : ℝ) : Prop := ∀ ξ : FpCoord p d →ᵃ[ZMod p] ZMod p, Φ.representation.NonconstantOnFibers x ξ → IsThickAlong (Φ.cumulativeWeight x) ξ t δ /-- A `(T, ε, δ)`-complete flag decomposition. -/ +@[expose] def IsComplete (Φ : FlagDecomposition p d f) (T : Φ.flag.Node → ℕ) (ε δ : ℝ) : Prop := Φ.IsMinimal ∧ Φ.IsReduced ∧ @@ -394,6 +419,7 @@ def IsComplete (Φ : FlagDecomposition p d f) (T : Φ.flag.Node → ℕ) end FlagDecomposition /-- A growing function is monotone and strictly exceeds the identity. -/ +@[expose] def IsGrowing (g : ℕ → ℕ) : Prop := Monotone g ∧ ∀ n, n < g n diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/BoundedRun.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/BoundedRun.lean index 9285e2e790..edc5865289 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/BoundedRun.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/BoundedRun.lean @@ -19,7 +19,7 @@ states and stages beyond the horizon keep their state. No infinite sequence of progress certificates is assumed. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/CenteredLift.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/CenteredLift.lean index abd513336b..16adfb17a4 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/CenteredLift.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/CenteredLift.lean @@ -19,7 +19,7 @@ finite coordinate space. The finite boxes also supply explicit support sets for the lifted weights used in flag decompositions. -/ -@[expose] public section +public section open scoped BigOperators @@ -63,6 +63,7 @@ theorem card_le_of_latticeSupNorm_le {n K : ℕ} (S : Finset (IntCoord n)) namespace FpCoord /-- Coordinatewise integer representatives with least absolute value. -/ +@[expose] def centeredLift {p n : ℕ} (c : FpCoord p n) : IntCoord n := fun i ↦ (c i).valMinAbs diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/CenteredPolytope.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/CenteredPolytope.lean index ecc0dcd5c2..218e869a25 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/CenteredPolytope.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/CenteredPolytope.lean @@ -17,7 +17,7 @@ integer transitions of nonzero local lifts are centered without any additional coordinate bound or large-modulus hypothesis. -/ -@[expose] public section +public section namespace EGZ.FlagDecomposition diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Cleanup.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Cleanup.lean index 1de24c26ba..656413bd35 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Cleanup.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Cleanup.lean @@ -18,7 +18,7 @@ once: after deletion its mass remains zero. Strong induction on the remaining finite set of fibres proves termination and the total mass bound together. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/CommonMeasure.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/CommonMeasure.lean index 8c845611c8..cac0931f77 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/CommonMeasure.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/CommonMeasure.lean @@ -17,7 +17,7 @@ The estimates apply to finite real weights, including natural weights by `WeightedIncidence.mass_natCast`. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/CompleteBounds.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/CompleteBounds.lean index 3a4c4e2f5a..e9be8eab5a 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/CompleteBounds.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/CompleteBounds.lean @@ -19,7 +19,7 @@ support has rank at most twice the ambient dimension and lies in the last selected width box. -/ -@[expose] public section +public section namespace EGZ.FlagDecomposition.CompletePreparation diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/CompleteLevels.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/CompleteLevels.lean index 8d3b34dda4..b892a2371c 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/CompleteLevels.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/CompleteLevels.lean @@ -18,7 +18,7 @@ the old fibre-constant functionals forces every lower level above the old anchor. In particular this applies to the reduced complete representative. -/ -@[expose] public section +public section namespace EGZ.FlagDecomposition.CompletePreparation diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/CompletePreparation.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/CompletePreparation.lean index 74bacdd9d7..981cf742b1 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/CompletePreparation.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/CompletePreparation.lean @@ -19,7 +19,7 @@ actual flag decomposition, with controlled mass loss and a non-reduced old upper anchor, before adjoining the new slab coordinates. -/ -@[expose] public section +public section open scoped BigOperators @@ -53,6 +53,7 @@ variable {Φ : FlagDecomposition p d f} {anchor : Φ.flag.Node} {t : ℕ → ℕ (D : CompletePreparation Φ anchor t δ) /-- Intersection of the slabs selected by the direction chain. -/ +@[expose] def selectedSet : Set (FpCoord p d) := slabIntersection D.count D.chain.direction t theorem selected_nonzero (hδ : 0 ≤ δ) (hsmall : (3 : ℝ) ^ (d + 1) * δ < 1) : @@ -94,11 +95,11 @@ theorem lowerAnchor_cumulativeWeight : theorem lowerAnchor_space : (D.split hp hδ hsmall).representation.space (D.lowerAnchor hp hδ hsmall) = - Φ.representation.space anchor := rfl + Φ.representation.space anchor := by rfl theorem lowerAnchor_map : (D.split hp hδ hsmall).representation.map (D.lowerAnchor hp hδ hsmall) = - Φ.representation.map anchor := rfl + Φ.representation.map anchor := by rfl theorem upperAnchor_not_isReducedElement : ¬ (D.split hp hδ hsmall).IsReducedElement (D.upperAnchor hp hδ hsmall) := @@ -128,6 +129,7 @@ theorem card_le : (D.selected_nonzero hδ hsmall)).rebuildData hp).card_decomposition_le /-- Forget the lower-layer labels and recover a proper point of the old flag. -/ +@[expose] noncomputable def subdivisionMap : SubdivisionMap Φ (D.split hp hδ hsmall) := ((LocalizedPruning.prunedWeights Φ anchor D.selectedSet (D.selected_nonzero hδ hsmall)).rebuiltSubdivisionMap hp).comp diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/CompleteRefinement.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/CompleteRefinement.lean index c70d25cbcb..c99c2051b8 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/CompleteRefinement.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/CompleteRefinement.lean @@ -19,7 +19,7 @@ thin directions. Passing to the face index of its whole polytope supplies a reduced complete representative with exactly the same cumulative function. -/ -@[expose] public section +public section namespace EGZ.FlagDecomposition.CompletePreparation @@ -135,6 +135,7 @@ theorem refined_isKBounded {B : ℕ} (D.refined hp hδ hsmall C hmod hcenter).IsKBounded (fun _ ↦ B) := hB /-- Subdivision map from the augmented refinement back to the original decomposition. -/ +@[expose] noncomputable def refinedSubdivisionMap : SubdivisionMap Φ (D.refined hp hδ hsmall C hmod hcenter) := (D.subdivisionMap hp hδ hsmall).comp diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Completeness.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Completeness.lean index 23111af1c6..77393e063e 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Completeness.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Completeness.lean @@ -15,7 +15,7 @@ These monotonicity and mass identities are used when normalizing epsilon, choosing the final uniform delta, and transferring thickness through cleanup. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Conclusion.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Conclusion.lean index 10083f7ffe..96176713b5 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Conclusion.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Conclusion.lean @@ -24,7 +24,7 @@ The zero-dimensional case is proved by the initial one-node decomposition. The positive-dimensional existence proof is assembled in `Existence.lean`. -/ -@[expose] public section +public section namespace EGZ @@ -36,6 +36,7 @@ and one nonzero input function. The primality proof installs the `NeZero p` instance required by finite sums over `ZMod p`. Keeping that implementation detail inside this predicate makes the public theorem quantify naturally over primes. -/ +@[expose] def HasFlagDecompositionConclusion {p d : ℕ} (hp : p.Prime) (f : FpCoord p d → ℕ) (ε δ : ℝ) (g : ℕ → ℕ) (Bcard BK : ℕ) : Prop := by diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/ConclusionBridge.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/ConclusionBridge.lean index 6a63d2568b..29d025ed3f 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/ConclusionBridge.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/ConclusionBridge.lean @@ -11,7 +11,7 @@ public import LeanPool.ErdosGinzburgZiv.EGZ.Decomposition.IterationConstants /-! # A finished bounded state supplies the public decomposition conclusion -/ -@[expose] public section +public section namespace EGZ.FlagDecomposition.Iteration diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Construction.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Construction.lean index 4ade55d472..0e30551cf8 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Construction.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Construction.lean @@ -12,7 +12,7 @@ public import LeanPool.ErdosGinzburgZiv.EGZ.Decomposition.IterationColorCapacity /-! # Extracting the decomposition from the bounded iteration -/ -@[expose] public section +public section namespace EGZ.FlagDecomposition.Iteration.boundedRun diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Existence.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Existence.lean index fb9e50233b..732b61d83f 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Existence.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Existence.lean @@ -12,7 +12,7 @@ public import LeanPool.ErdosGinzburgZiv.EGZ.Decomposition.FinalConstruction # Existence -/ -@[expose] public section +public section namespace EGZ diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/FaceLevels.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/FaceLevels.lean index a46658bf9e..3ad658aa99 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/FaceLevels.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/FaceLevels.lean @@ -19,7 +19,7 @@ the dimension of the selected proper face. Its represented space must then shrink, giving the strict level increase used in termination. -/ -@[expose] public section +public section namespace EGZ.FlagDecomposition.FaceRefinement diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/FaceMassChain.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/FaceMassChain.lean index b64677e2d5..8ec32b4572 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/FaceMassChain.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/FaceMassChain.lean @@ -20,7 +20,7 @@ loss by global mass loss. Passing to the final cumulative weight then gives the uniform common-measure large-face bound. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/FacePreservation.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/FacePreservation.lean index 89b791d77d..fcb67dac7c 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/FacePreservation.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/FacePreservation.lean @@ -20,7 +20,7 @@ a realized face whenever its pullback is nonempty. The key order inequality compares the new face index with the old one. -/ -@[expose] public section +public section namespace EGZ @@ -29,6 +29,7 @@ open scoped BigOperators namespace ConvexFlag /-- Map a flag point using a map on nodes and compatible affine fibre maps. -/ +@[expose] def Point.map {F G : ConvexFlag} (q : F.Point) (node : SupHom F.Node G.Node) (fibre : (x : F.Node) → RealCoord (F.rank x) →ᵃ[ℝ] RealCoord (G.rank (node x))) (hpolytope : ∀ x, Set.MapsTo (fibre x) @@ -123,6 +124,7 @@ namespace RationalPolytope.Face /-- Pull back an exposed face along an affine map taking one polytope into another. The pullback includes the source polytope constraint. -/ +@[expose] def preimage {m n : ℕ} {P : RationalPolytope m} {Q : RationalPolytope n} (Γ : P.Face) (A : RealCoord n →ᵃ[ℝ] RealCoord m) (hA : Set.MapsTo A Q.carrier P.carrier) @@ -178,6 +180,7 @@ variable {Φ Ψ : FlagDecomposition p d f} (M : SubdivisionMap Φ Ψ) /-- To construct a subdivision map it suffices to send local generators to old local generators. Convex-combination preservation then gives inclusion of the entire proper-point sets. -/ +@[expose] def ofLocalGenerators (node : SupHom Ψ.flag.Node Φ.flag.Node) (fibre : (x : Ψ.flag.Node) → @@ -201,6 +204,7 @@ def ofLocalGenerators hcomb.map node fibre polytope_mem transition_comm⟩ /-- The induced map on flag points. -/ +@[expose] def point (q : Ψ.flag.Point) : Φ.flag.Point := ⟨M.node q.base, M.fibre q.base q.val, M.polytope_mem q.base q.val_mem⟩ @@ -215,6 +219,7 @@ theorem point_proper {q : Ψ.flag.Point} (hq : q ∈ Ψ.omega) : M.point q ∈ M.proper q hq /-- Compose successive subdivisions, including their proper-point maps. -/ +@[expose] def comp {Θ : FlagDecomposition p d f} (N : SubdivisionMap Ψ Θ) : SubdivisionMap Φ Θ where node := M.node.comp N.node @@ -233,6 +238,7 @@ theorem comp_point {Θ : FlagDecomposition p d f} (N : SubdivisionMap Ψ Θ) (q : Θ.flag.Point) : (M.comp N).point q = M.point (N.point q) := rfl /-- The part of an old face lying in the new fibre. -/ +@[expose] def face (x : Ψ.flag.Node) (Γ : (Φ.flag.polytope (M.node x)).Face) (hne : ((Ψ.flag.polytope x).carrier ∩ M.fibre x ⁻¹' Γ.carrier).Nonempty) : (Ψ.flag.polytope x).Face := @@ -292,6 +298,7 @@ end SubdivisionMap /-- The inclusion of reduced nodes is a subdivision map. Its fibre maps are identities and every original proper point survives the restriction. -/ +@[expose] noncomputable def reducedSubdivisionMap (Φ : FlagDecomposition p d f) (hp : Odd p) : SubdivisionMap Φ (Φ.reduced hp) where node := { diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/FaceRefinement.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/FaceRefinement.lean index 87e87cae8b..09d0cb55e8 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/FaceRefinement.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/FaceRefinement.lean @@ -20,7 +20,7 @@ that face. This allows a refinement that moves the selected local atoms to a lower layer to realize the face while retaining the old upper fibres. -/ -@[expose] public section +public section open scoped BigOperators @@ -95,6 +95,7 @@ variable (Φ : FlagDecomposition p d f) (anchor : Φ.flag.Node) open Classical in /-- The layer-forgetting order map. -/ +@[expose] def projection : TwoLayer.Node anchor →o Φ.flag.Node where toFun := TwoLayer.projection anchor monotone' := OrderHomClass.monotone (TwoLayer.projection anchor) @@ -173,11 +174,13 @@ theorem active_lower (x : Φ.flag.Node) (hx : x ≤ anchor) (v : FpCoord p d) open Classical in /-- The active upper copy of an old node. -/ +@[expose] noncomputable def upper (x : Φ.flag.Node) : (decomposition Φ anchor selected hp).flag.Node := ⟨TwoLayer.upper anchor x, active_upper Φ anchor selected hp x⟩ open Classical in /-- The original node order embeds into the active upper layer. -/ +@[expose] noncomputable def upperOrderEmbedding : Φ.flag.Node ↪o (decomposition Φ anchor selected hp).flag.Node where toFun := upper Φ anchor selected hp @@ -249,6 +252,7 @@ theorem upper_polytope (x : Φ.flag.Node) : open Classical in /-- An original face, viewed in its unchanged upper polytope. -/ +@[expose] noncomputable def upperFace (x : Φ.flag.Node) (Γ : (Φ.flag.polytope x).Face) : ((decomposition Φ anchor selected hp).flag.polytope (upper Φ anchor selected hp x)).Face where carrier := Γ.carrier @@ -295,6 +299,7 @@ theorem isKBounded {K : Φ.flag.Node → ℕ} (hK : Φ.IsKBounded K) : open Classical in /-- Forgetting layers maps the split decomposition into the old one. -/ +@[expose] noncomputable def subdivisionMap : SubdivisionMap Φ (decomposition Φ anchor selected hp) := (splitWeights Φ anchor selected).subdivisionMap hp (fun _ _ ↦ rfl) @@ -403,6 +408,7 @@ theorem face_active_lower_anchor (Γ : (Φ.flag.polytope anchor).Face) : open Classical in /-- The active lower copy of the selected anchor. -/ +@[expose] noncomputable def lowerAnchor (Γ : (Φ.flag.polytope anchor).Face) : (decomposition Φ anchor (Φ.faceSelector anchor Γ) hp).flag.Node := ⟨TwoLayer.lower anchor anchor le_rfl, face_active_lower_anchor Φ anchor hp Γ⟩ diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/FaceSelection.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/FaceSelection.lean index e02f980be5..dd4cd3bd3a 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/FaceSelection.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/FaceSelection.lean @@ -17,7 +17,7 @@ same predicate on ambient points. Compatibility of centered lifts identifies the selected cumulative support with the inverse image of the target face. -/ -@[expose] public section +public section open scoped BigOperators @@ -28,6 +28,7 @@ variable {p d : ℕ} [NeZero p] {f : FpCoord p d → ℕ} open Classical in /-- Ambient atoms whose centered coordinate at the anchor lies on its face. -/ +@[expose] def faceSelector (x : Φ.flag.Node) (Γ : (Φ.flag.polytope x).Face) (v : FpCoord p d) : Prop := (FpCoord.centeredLift (Φ.representation.map x v)).real ∈ Γ.carrier diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/FaceSupport.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/FaceSupport.lean index dc0bd80cfb..b5347a3058 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/FaceSupport.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/FaceSupport.lean @@ -17,7 +17,7 @@ The support/polytope invariant nevertheless identifies every face with the convex hull of precisely the lifted support points lying on that face. -/ -@[expose] public section +public section namespace EGZ.FlagDecomposition diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/FaceSurvival.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/FaceSurvival.lean index 57a76df2de..a208d33c9a 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/FaceSurvival.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/FaceSurvival.lean @@ -18,7 +18,7 @@ other generators witnessing old reducedness still have active copies, so their join together with this upper generator is the old upper node. -/ -@[expose] public section +public section namespace EGZ.FlagDecomposition.FaceRefinement diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/FinalConstruction.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/FinalConstruction.lean index aa910967c6..59de4974dd 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/FinalConstruction.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/FinalConstruction.lean @@ -11,7 +11,7 @@ public import LeanPool.ErdosGinzburgZiv.EGZ.Decomposition.IterationTermination /-! # The positive-dimensional Flag Decomposition Lemma -/ -@[expose] public section +public section namespace EGZ diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/GapCleanup.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/GapCleanup.lean index 6b49aa3b89..25c5dc0aed 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/GapCleanup.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/GapCleanup.lean @@ -19,7 +19,7 @@ hulls. Restricting that flag to reduced nodes finishes the geometric cleanup. The construction retains exactly the mass supplied by numerical pruning. -/ -@[expose] public section +public section open scoped BigOperators @@ -120,6 +120,7 @@ theorem cleaned_isKBounded {K : Φ.flag.Node → ℕ} (hK : Φ.IsKBounded K) : fun x z hz ↦ hK x.1.1 z (D.cleaned_polytope_subset hp x hz) /-- Subdivision map from the rebuilt decomposition to the original one. -/ +@[expose] noncomputable def rebuiltSubdivisionMap : SubdivisionMap Φ (D.rebuilt hp) := SubdivisionMap.ofLocalGenerators { toFun := Subtype.val, map_sup' := fun _ _ ↦ rfl } @@ -133,6 +134,7 @@ noncomputable def rebuiltSubdivisionMap : SubdivisionMap Φ (D.rebuilt hp) := exact ne_of_gt ((Nat.pos_of_ne_zero hmass).trans_le (D.localLift_le_old _ _))) /-- Subdivision map from the cleaned decomposition to the original one. -/ +@[expose] noncomputable def cleanedSubdivisionMap : SubdivisionMap Φ (D.cleaned hp) := (D.rebuiltSubdivisionMap hp).comp ((D.rebuilt hp).reducedSubdivisionMap hp) diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/GapProgress.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/GapProgress.lean index 23981ad78c..a696e5f665 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/GapProgress.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/GapProgress.lean @@ -12,7 +12,7 @@ public import LeanPool.ErdosGinzburgZiv.EGZ.Decomposition.NormalizedOperations /-! # Gap cleanup as a certified iteration step -/ -@[expose] public section +public section namespace EGZ.FlagDecomposition.Iteration @@ -21,6 +21,7 @@ variable {p d : ℕ} [NeZero p] [Fact p.Prime] {f : FpCoord p d → ℕ} (D : NormalizedGapStep s.decomposition s.radius R (ε * δ ^ 2)) /-- Iteration state produced by the gap-cleanup data. -/ +@[expose] noncomputable def gapState : State p d f where decomposition := D.decomposition radius := D.radius diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Initialization.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Initialization.lean index 74fb6161d9..0b8090f6e0 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Initialization.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Initialization.lean @@ -17,7 +17,7 @@ It retains all the input mass and is reduced and minimal. This is the starting object for the refinement argument. -/ -@[expose] public section +public section open scoped BigOperators @@ -118,6 +118,7 @@ private theorem initial_localLift (f : FpCoord p d → ℕ) (hf : f ≠ 0) /-- The singleton initial decomposition retains all of a nonzero input weight. No lower bound on the modulus is needed for its rank-zero lifts. -/ +@[expose] noncomputable def initial (f : FpCoord p d → ℕ) (hf : f ≠ 0) : FlagDecomposition p d f := by classical diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IntervalCapacity.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IntervalCapacity.lean index f018b391b6..ae009c7f14 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IntervalCapacity.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IntervalCapacity.lean @@ -16,7 +16,7 @@ interval lemma into a uniform bound on operation-sequence length. The bound depends only on the number of colors and the capacity function. -/ -@[expose] public section +public section namespace EGZ @@ -24,12 +24,14 @@ attribute [local instance] Classical.propDecidable /-- Every interval before `N` has at most `capacity a` occurrences of any color which is a lower bound for all colors on that interval. -/ +@[expose] def HasIntervalCapacity (χ capacity : ℕ → ℕ) (N : ℕ) : Prop := ∀ a b l, a ≤ b → b < N → (∀ i ∈ Finset.Icc a b, l ≤ χ i) → ((Finset.Icc a b).filter fun i ↦ χ i = l).card ≤ capacity a /-- The first length at which the interval lemma forces a capacity violation. The requested occurrence threshold is exactly `capacity + 1`. -/ +@[expose] noncomputable def intervalCapacityBound (k : ℕ) (capacity : ℕ → ℕ) : ℕ := Nat.find (exists_color_interval_bound k (fun a ↦ capacity a + 1)) diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationBounds.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationBounds.lean index 2747789d94..f05e05619e 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationBounds.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationBounds.lean @@ -17,7 +17,7 @@ The state at stage `i` has at most `2^i` nodes, lies within the predetermined radius horizon, and has lost at most the first `i` explicit mass budgets. -/ -@[expose] public section +public section open scoped BigOperators @@ -26,6 +26,7 @@ namespace EGZ.FlagDecomposition.Iteration open DecompositionParameters /-- Scale assigned to a given stage of the bounded iteration. -/ +@[expose] noncomputable def stageScale (d : ℕ) (ε : ℝ) (i : ℕ) : ℝ := scale d (initialScale d ε) (i + 1) @@ -97,6 +98,7 @@ theorem mass_bounds (hd : 1 ≤ d) (hε : 0 < ε) (hεhalf : ε ≤ 1 / 2) : constructor <;> nlinarith [s.mass_loss_bound] /-- Initial bounded state for a nonzero input weight. -/ +@[expose] noncomputable def initial (hf : f ≠ 0) : BoundedState (f := f) P ε 0 where decomposition := FlagDecomposition.initial f hf radius := 1 @@ -109,6 +111,7 @@ noncomputable def initial (hf : f ≠ 0) : BoundedState (f := f) P ε 0 where mass_loss_bound := by rw [initial_retainedMass, prefixBudget_zero]; simp /-- Advance a bounded state using a certified progress step and a radius bound. -/ +@[expose] noncomputable def advance {t : State p d f} (hε : 0 < ε) (D : Progress s.toState t ε (stageScale d ε i) g) (hR : t.radius ≤ P.radiusGrowth s.radius) : BoundedState (f := f) P ε (i + 1) where @@ -131,6 +134,7 @@ noncomputable def advance {t : State p d f} (hε : 0 < ε) nlinarith [s.mass_loss_bound] /-- Retain the same underlying state at the next iteration index. -/ +@[expose] noncomputable def keep (hε : 0 < ε) : BoundedState (f := f) P ε (i + 1) where toState := s.toState card_bound := s.card_bound.trans (Nat.pow_le_pow_right (by omega) (Nat.le_succ i)) diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationColorCapacity.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationColorCapacity.lean index 9a23231c34..419dead99c 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationColorCapacity.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationColorCapacity.lean @@ -11,7 +11,7 @@ public import LeanPool.ErdosGinzburgZiv.EGZ.Decomposition.IterationGapCapacity /-! # Combining the three event capacities -/ -@[expose] public section +public section namespace EGZ.FlagDecomposition.Iteration diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationCompleteCapacity.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationCompleteCapacity.lean index 97e91368a7..5a0750c03d 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationCompleteCapacity.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationCompleteCapacity.lean @@ -18,7 +18,7 @@ return. A finite family of such events therefore has cardinality bounded by the initial node population. -/ -@[expose] public section +public section namespace EGZ.FlagDecomposition.Iteration diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationConstants.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationConstants.lean index 1c65c726ca..92bac9c079 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationConstants.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationConstants.lean @@ -11,11 +11,12 @@ public import LeanPool.ErdosGinzburgZiv.EGZ.Decomposition.IntervalCapacity /-! # Uniform constants for the bounded decomposition iteration -/ -@[expose] public section +public section namespace EGZ.FlagDecomposition.Iteration /-- A positive integer upper bound for face events on one surviving lineage. -/ +@[expose] noncomputable def faceCapacity (d : ℕ) (ε : ℝ) : ℕ := max 1 ⌈((((ε / 2) ^ 3)⁻¹ + (d : ℝ) + 2) ^ (d + 2))⌉₊ @@ -29,6 +30,7 @@ theorem le_faceCapacity_of_real_le {d n : ℕ} {ε : ℝ} exact hn.trans (le_max_right _ _) /-- Capacity of the interval beginning at a given iteration index. -/ +@[expose] noncomputable def intervalCapacity (d : ℕ) (ε : ℝ) (a : ℕ) : ℕ := 2 ^ a * faceCapacity d ε @@ -42,6 +44,7 @@ theorem one_le_intervalCapacity (d : ℕ) (ε : ℝ) (a : ℕ) : (Nat.one_le_two_pow).trans (pow_le_intervalCapacity d ε a) /-- Uniform stopping bound derived from the interval capacities. -/ +@[expose] noncomputable def stoppingBound (d : ℕ) (ε : ℝ) : ℕ := intervalCapacityBound (2 * (d + 1) ^ 2 + 1) (intervalCapacity d ε) diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationEvents.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationEvents.lean index 210534bfba..b8cf8eedd9 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationEvents.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationEvents.lean @@ -17,7 +17,7 @@ An event records an unsatisfied conclusion. Its color orders completeness and face events by the represented level, with gap cleanup last. -/ -@[expose] public section +public section namespace EGZ.FlagDecomposition @@ -30,6 +30,7 @@ theorem isRealizedFace_top (Φ : FlagDecomposition p d f) (x : Φ.flag.Node) : exact Φ.flag.transition_mem (Φ.faceIndex_le x ⊤) hq /-- A node equality transports its face without choosing coordinates. -/ +@[expose] def faceAtNode (Φ : FlagDecomposition p d f) {x y : Φ.flag.Node} (Γ : (Φ.flag.polytope x).Face) (h : y = x) : (Φ.flag.polytope y).Face := by subst y @@ -58,11 +59,13 @@ namespace State variable (s : State p d f) /-- Every node gap exceeds the prescribed scale relative to the total input mass. -/ +@[expose] def GapCondition (δ : ℝ) : Prop := ∀ x, δ ^ 3 * (s.radius : ℝ)⁻¹ ^ d * (natMass f : ℝ) ≤ (s.decomposition.gap x : ℝ) /-- The state satisfies the gap bound and the required completeness condition. -/ +@[expose] def Finished (ε δ : ℝ) (g : ℕ → ℕ) : Prop := s.GapCondition δ ∧ s.decomposition.IsComplete (fun _ ↦ g s.radius) ε δ @@ -77,6 +80,7 @@ namespace Event variable {s} /-- The chosen event witnesses a failure of the corresponding termination condition. -/ +@[expose] def Valid (ε δ : ℝ) (g : ℕ → ℕ) : s.Event → Prop | .gap => ¬ s.GapCondition δ | .face x Γ => s.decomposition.IsLargeFace ε x Γ ∧ ¬ s.decomposition.IsRealizedFace x Γ @@ -84,13 +88,14 @@ def Valid (ε δ : ℝ) (g : ℕ → ℕ) : s.Event → Prop ¬ s.decomposition.IsCompleteElement x (g s.radius) δ /-- The largest level required to remain stable during this event. -/ +@[expose] noncomputable def cutoff : s.Event → ℕ | .gap => (d + 1) ^ 2 | .face x _ => s.decomposition.level x | .complete x => s.decomposition.level x /-- Encode the event type and its level as a natural number for the stopping argument. -/ -noncomputable def color : s.Event → ℕ +@[expose] noncomputable def color : s.Event → ℕ | .gap => 2 * (d + 1) ^ 2 | .face x _ => 2 * s.decomposition.level x + 1 | .complete x => 2 * s.decomposition.level x @@ -145,6 +150,7 @@ variable {s t : State p d f} /-- A face event has a surviving node at the same level where its selected face has become realized. Completeness events kill the selected low-level lineage. Gap events establish the gap condition at the current scale. -/ +@[expose] def Resolves (S : SubdivisionMap s.decomposition t.decomposition) (δ : ℝ) : s.Event → Prop | .gap => t.GapCondition δ | .face x Γ => ∃ y : t.decomposition.flag.Node, diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationFaceCapacity.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationFaceCapacity.lean index 8bd149a56a..20937cfc81 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationFaceCapacity.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationFaceCapacity.lean @@ -22,7 +22,7 @@ and composed subdivisions preserve realization. This is the geometric no-repeat input for the uniform face-chain bound. -/ -@[expose] public section +public section namespace EGZ.Lineages diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationGapCapacity.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationGapCapacity.lean index 01b7730c96..51355b8b19 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationGapCapacity.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationGapCapacity.lean @@ -10,7 +10,7 @@ public import LeanPool.ErdosGinzburgZiv.EGZ.Decomposition.IterationBounds /-! # A gap cleanup cannot be followed by another gap cleanup -/ -@[expose] public section +public section namespace EGZ.FlagDecomposition.Iteration diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationIntervalBounds.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationIntervalBounds.lean index 683c358bc8..3552c6cca6 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationIntervalBounds.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationIntervalBounds.lean @@ -10,7 +10,7 @@ public import LeanPool.ErdosGinzburgZiv.EGZ.Decomposition.StoppedLineages /-! # Bounds after restarting and stopping a finite interval -/ -@[expose] public section +public section namespace EGZ.FlagDecomposition.Iteration diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationLineages.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationLineages.lean index 9074f7de75..1838bd8e86 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationLineages.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationLineages.lean @@ -17,7 +17,7 @@ sequence. A lower bound on event colors supplies the uniform cutoff needed for low-level ancestor bookkeeping. -/ -@[expose] public section +public section namespace EGZ.FlagDecomposition.Iteration @@ -26,6 +26,7 @@ variable {p d : ℕ} [Fact p.Prime] {f : FpCoord p d → ℕ} (P : ∀ i, Progress (s i) (s (i + 1)) ε (δ i) g) /-- The lineage mass maps induced by a sequence of iteration progress steps. -/ +@[expose] noncomputable def lineageMassMaps : LineageMassMaps (fun i ↦ (s i).decomposition) where minimal i := (s i).minimal step i := (P i).subdivision diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationTermination.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationTermination.lean index 92e11d5ed4..34b0004c1a 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationTermination.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/IterationTermination.lean @@ -12,7 +12,7 @@ public import LeanPool.ErdosGinzburgZiv.EGZ.Decomposition.IterationFaceCapacity /-! # Uniform termination of certified finite refinement runs -/ -@[expose] public section +public section namespace EGZ.FlagDecomposition.Iteration diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LargeFaceGeometry.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LargeFaceGeometry.lean index 24128b37f6..c52f50e957 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LargeFaceGeometry.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LargeFaceGeometry.lean @@ -17,7 +17,7 @@ containing that set have strictly decreasing dimension in a nested polytope sequence satisfying the no-repetition condition. -/ -@[expose] public section +public section namespace EGZ.RationalPolytope.Face @@ -40,6 +40,7 @@ theorem mem_of_mem_affineSpan_subset {d : ℕ} {P : RationalPolytope d} (Γ : P. Γ.mem_of_mem_affineSpan hqP (affineSpan_mono ℝ hS hq) /-- Dimension of the affine hull of a face. -/ +@[expose] noncomputable def dimension {d : ℕ} {P : RationalPolytope d} (Γ : P.Face) : ℕ := Module.finrank ℝ (affineSpan ℝ Γ.carrier).direction diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LargeFaceSequence.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LargeFaceSequence.lean index 2307a7f477..890c23dc9d 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LargeFaceSequence.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LargeFaceSequence.lean @@ -18,7 +18,7 @@ and lose a fixed fraction of that mass on every proper subface. The bound depends only on the dimension and these two fractions. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LatticeCoordinates.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LatticeCoordinates.lean index 53ae27067c..98c9b67b7d 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LatticeCoordinates.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LatticeCoordinates.lean @@ -17,7 +17,7 @@ generation statement uses the finitely supported integer weights required by `FlagDecomposition.IsMinimal`. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LatticeTransition.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LatticeTransition.lean index afd2ac5ece..780e83ed74 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LatticeTransition.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LatticeTransition.lean @@ -16,7 +16,7 @@ factors uniquely through their integer coordinate charts. Uniqueness then supplies the identity and composition laws for recharted flag transitions. -/ -@[expose] public section +public section namespace EGZ.IntegerLatticeChart diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LevelInjectivity.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LevelInjectivity.lean index 6724e5378c..0202dc0ff8 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LevelInjectivity.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LevelInjectivity.lean @@ -18,7 +18,7 @@ levels force equal spaces and equal ranks. The factor is then bijective modulo the prime, injective on integer lattices, and bijective over the reals. -/ -@[expose] public section +public section namespace EGZ.FpRepresentation diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Levels.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Levels.lean index bea12739ab..de12bf7fe0 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Levels.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Levels.lean @@ -19,13 +19,14 @@ and increase under restriction of the represented space when the old map factors through the new map. This includes minimalization. -/ -@[expose] public section +public section namespace EGZ namespace LevelCode /-- Encode two coordinates in the square `[0,d]²` in lexicographic order. -/ +@[expose] def code (d a b : ℕ) : ℕ := (d + 1) * a + b theorem lt_of_first_lt {d a b a' b' : ℕ} (h : a < a') (hb : b ≤ d) : @@ -68,14 +69,17 @@ namespace FpRepresentation variable {p d : ℕ} [Fact p.Prime] {F G : ConvexFlag} /-- Dimension of the represented affine space. -/ +@[expose] noncomputable def spaceDimension (R : FpRepresentation p d F) (x : F.Node) : ℕ := Module.finrank (ZMod p) (R.space x).direction /-- Codimension of the represented affine space in the ambient space. -/ +@[expose] noncomputable def codimension (R : FpRepresentation p d F) (x : F.Node) : ℕ := d - R.spaceDimension x /-- Natural-number encoding of `(codim V_x, rank Λ_x)`. -/ +@[expose] noncomputable def level (R : FpRepresentation p d F) (x : F.Node) : ℕ := LevelCode.code d (R.codimension x) (F.rank x) @@ -299,17 +303,16 @@ theorem level_antitone (Φ : FlagDecomposition p d f) : Antitone Φ.level := @[simp] theorem reduced_level (Φ : FlagDecomposition p d f) (hp : Odd p) - (x : (Φ.reduced hp).flag.Node) : (Φ.reduced hp).level x = Φ.level x.1 := rfl + (x : (Φ.reduced hp).flag.Node) : (Φ.reduced hp).level x = Φ.level x.1 := by rfl @[simp] theorem PrunedWeights.rebuilt_level {Φ : FlagDecomposition p d f} (D : PrunedWeights Φ) (hp : Odd p) (x : (D.rebuilt hp).flag.Node) : - (D.rebuilt hp).level x = Φ.level x.1 := rfl + (D.rebuilt hp).level x = Φ.level x.1 := by rfl -@[simp] theorem PrunedWeights.cleaned_level {Φ : FlagDecomposition p d f} (D : PrunedWeights Φ) (hp : Odd p) (x : (D.cleaned hp).flag.Node) : - (D.cleaned hp).level x = Φ.level x.1.1 := rfl + (D.cleaned hp).level x = Φ.level x.1.1 := by rfl namespace Rechart diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LiftedMass.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LiftedMass.lean index ffd4004174..ca3eae3822 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LiftedMass.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LiftedMass.lean @@ -17,7 +17,7 @@ integer support coordinate. Thus mass on any set of real fibre coordinates can be computed directly on the ambient finite-field space. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LineageMassMaps.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LineageMassMaps.lean index d9e5685cf2..5d16b8970d 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LineageMassMaps.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LineageMassMaps.lean @@ -18,7 +18,7 @@ gives the geometric and measure comparison between any two stages, while the parent agrees with the abstract lineage ancestor. -/ -@[expose] public section +public section namespace EGZ.FlagDecomposition @@ -27,6 +27,7 @@ variable {p d : ℕ} [Fact p.Prime] {f : FpCoord p d → ℕ} namespace SubdivisionMap /-- The identity subdivision of a flag decomposition. -/ +@[expose] def refl (Φ : FlagDecomposition p d f) : SubdivisionMap Φ Φ where node := SupHom.id _ fibre _ := AffineMap.id ℝ _ @@ -84,6 +85,7 @@ namespace Transport variable {L i j k l : ℕ} /-- Identity transport at a single stage. -/ +@[expose] def refl (Φ : ℕ → FlagDecomposition p d f) (L i : ℕ) : Transport Φ L i i where subdivision := SubdivisionMap.refl (Φ i) level_parent _ := le_rfl @@ -91,12 +93,14 @@ def refl (Φ : ℕ → FlagDecomposition p d f) (L i : ℕ) : Transport Φ L i i stable_real _ := rfl /-- The parent of a low-level node is still below the cutoff. -/ +@[expose] def lowParent (M : Transport Φ L i j) (y : {y : (Φ j).flag.Node // (Φ j).level y ≤ L}) : {x : (Φ i).flag.Node // (Φ i).level x ≤ L} := ⟨M.subdivision.node y, (M.level_parent y).trans y.property⟩ /-- Compose transports across two consecutive intervals of stages. -/ +@[expose] def comp (M : Transport Φ L i j) (N : Transport Φ L j k) : Transport Φ L i k where subdivision := M.subdivision.comp N.subdivision level_parent y := (M.level_parent (N.subdivision.node y)).trans (N.level_parent y) @@ -121,6 +125,7 @@ theorem comp_stable_coord (M : Transport Φ L i j) (N : Transport Φ L j k) ((M.comp N).stable y).coord = (M.stable (N.lowParent y)).coord.comp (N.stable y).coord := rfl /-- A stable map whose target is named by an equal node. -/ +@[expose] def stableAt (M : Transport Φ L i j) (y : {y : (Φ j).flag.Node // (Φ j).level y ≤ L}) (x : (Φ i).flag.Node) (h : M.subdivision.node y = x) : @@ -174,6 +179,7 @@ theorem system_injectiveBelow : D.system.InjectiveBelow L := fun i ↦ D.injective_below i L (hL i) /-- A one-step comparison at a cutoff below the current selected level. -/ +@[expose] def stepTransport (i : ℕ) : Transport Φ L i (i + 1) where subdivision := D.step i level_parent := D.level_parent i diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LineageOperations.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LineageOperations.lean index f4e7fb09bb..36c324d4da 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LineageOperations.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LineageOperations.lean @@ -17,7 +17,7 @@ the parent map is injective. Complete refinement additionally removes the upper anchor, so no such low node can have the selected anchor as parent. -/ -@[expose] public section +public section namespace EGZ diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Lineages.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Lineages.lean index 0be5ba23b8..fe1f93c100 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Lineages.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Lineages.lean @@ -20,7 +20,7 @@ one. Event counts therefore reduce to counts for initial ancestor labels. A killed lineage cannot label any later event. -/ -@[expose] public section +public section open scoped BigOperators @@ -52,6 +52,7 @@ variable (S : System) abbrev LowNode (L i : ℕ) := {x : S.Node i // S.level i x ≤ L} /-- Later low-level nodes have distinct old parents. -/ +@[expose] def InjectiveBelow (L : ℕ) : Prop := ∀ i, Set.InjOn (S.parent i) {x | S.level (i + 1) x ≤ L} @@ -60,6 +61,7 @@ variable {L : ℕ} (hinj : S.InjectiveBelow L) include hinj /-- The restricted parent map is an embedding. -/ +@[expose] def parentEmbedding (i : ℕ) : S.LowNode L (i + 1) ↪ S.LowNode L i where toFun x := ⟨S.parent i x, (S.level_parent i x).trans x.property⟩ inj' x y h := Subtype.ext (hinj i x.property y.property (congrArg Subtype.val h)) @@ -119,6 +121,7 @@ theorem card_lowNode_le_initial (i : ℕ) : /-- A selected node is killed when it has no child below the cutoff in the next stage. Higher-level replacements are permitted. -/ +@[expose] def IsKilled (i : ℕ) (x : S.LowNode L i) : Prop := ∀ y : S.LowNode L (i + 1), S.parent i y ≠ x.val diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LocalToCumulative.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LocalToCumulative.lean index f4248cb34c..c69b212bb0 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LocalToCumulative.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LocalToCumulative.lean @@ -19,7 +19,7 @@ on the right-hand side. Boundedness at the upper node prevents a transition of a nonzero local lift from wrapping around modulo `p`. -/ -@[expose] public section +public section open scoped BigOperators @@ -30,6 +30,7 @@ variable {p d : ℕ} [NeZero p] {F : ConvexFlag} open Classical in /-- Local lifted masses below a node, transported by the integer transition maps and summed over the finite centered boxes. -/ +@[expose] noncomputable def localIntegerMassBelow (R : FpRepresentation p d F) (pieces : F.Node → FpCoord p d → ℕ) (x : F.Node) (q : IntCoord (F.rank x)) : ℕ := by diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LocalizedPruning.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LocalizedPruning.lean index d0d183d629..32e4698a6b 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LocalizedPruning.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LocalizedPruning.lean @@ -18,7 +18,7 @@ The lost total mass is exactly the lost cumulative mass at the anchor. The surviving weights can be rebuilt using the geometric pruning construction. -/ -@[expose] public section +public section open scoped BigOperators @@ -133,6 +133,7 @@ theorem active_anchor : open Classical in /-- The surviving anchor as a node of the rebuilt decomposition. -/ +@[expose] def anchorNode : (decomposition Φ anchor S hne hp).flag.Node := ⟨anchor, active_anchor Φ anchor S hne hp⟩ diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LowerTransfer.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LowerTransfer.lean index 236d9004bd..1db9aa49db 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LowerTransfer.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/LowerTransfer.lean @@ -17,7 +17,7 @@ local summand below the anchor to the lower layer. The lower anchor keeps the same cumulative function, while its upper copy ceases to be reduced. -/ -@[expose] public section +public section namespace EGZ.FlagDecomposition.LowerTransfer @@ -46,6 +46,7 @@ theorem active_lowerAnchor : open Classical in /-- The active lower-layer copy of the anchor after lower transfer. -/ +@[expose] def lowerAnchor : (decomposition Φ anchor hp).flag.Node := ⟨TwoLayer.lower anchor anchor le_rfl, active_lowerAnchor Φ anchor hp⟩ @@ -115,6 +116,7 @@ theorem upperAnchor_not_isReducedElement : open Classical in /-- Additional slab coordinates are carried only by lower nodes. -/ +@[expose] noncomputable def extra (k : ℕ) (x : (decomposition Φ anchor hp).flag.Node) : ℕ := if x.1.1.2 = 0 then k else 0 diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Mass.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Mass.lean index d8fdcd1f37..c1a568e9cb 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Mass.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Mass.lean @@ -15,7 +15,7 @@ The cleanup operations delete local atoms. These finite-sum estimates keep track of the lost mass and of the resulting deterioration of thickness. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/MinimalLattice.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/MinimalLattice.lean index 1d00453c8a..3df07e7987 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/MinimalLattice.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/MinimalLattice.lean @@ -18,7 +18,7 @@ its own generated lattice. Finiteness of the collection of bounded supports then makes coordinate and prime-saturation bounds uniform in the support. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/MinimalParameters.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/MinimalParameters.lean index 0cdc1648d4..ac40ca0725 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/MinimalParameters.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/MinimalParameters.lean @@ -17,7 +17,7 @@ bound makes all chosen chart reductions injective and all new supports centered, simultaneously for every input decomposition. -/ -@[expose] public section +public section namespace EGZ diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/MinimalRepresentation.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/MinimalRepresentation.lean index 97f64f9a7b..ebc39032c8 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/MinimalRepresentation.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/MinimalRepresentation.lean @@ -17,13 +17,14 @@ vector space. Its retraction identity extends from the support to its affine span. Integer affine generation also implies affine generation modulo `p`. -/ -@[expose] public section +public section open scoped BigOperators namespace EGZ /-- An affine retraction that is a left inverse when the original affine map is injective. -/ +@[expose] noncomputable def affineLeftInverse {k : Type*} [Field k] {m n : ℕ} (A : (Fin m → k) →ᵃ[k] (Fin n → k)) : (Fin n → k) →ᵃ[k] (Fin m → k) := A.linear.leftInverse.toAffineMap.comp diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Minimalization.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Minimalization.lean index 16a84f21c6..7ea3cac95e 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Minimalization.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Minimalization.lean @@ -20,7 +20,7 @@ The coordinate growth function depends only on dimension, and the prime threshold depends only on dimension and the original uniform box bound. -/ -@[expose] public section +public section namespace EGZ diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/ModularRank.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/ModularRank.lean index 98086cd45d..d36ac6588f 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/ModularRank.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/ModularRank.lean @@ -18,7 +18,7 @@ integer determinant is nonzero. Its real scalar extension is therefore injective. This applies to integral affine maps between equal-rank fibres. -/ -@[expose] public section +public section namespace EGZ.IntegralAffineMap diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/NodeMassMap.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/NodeMassMap.lean index be3a888cec..bfbdeda693 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/NodeMassMap.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/NodeMassMap.lean @@ -18,7 +18,7 @@ the loss at the node by the loss of the entire decomposition. These data compose, so the same estimates apply along a surviving lineage. -/ -@[expose] public section +public section open scoped BigOperators @@ -46,6 +46,7 @@ variable {Φ Ψ Ω : FlagDecomposition p d f} open Classical in /-- The identity map on a node and its cumulative weight. -/ +@[expose] def refl (Φ : FlagDecomposition p d f) (x : Φ.flag.Node) : NodeMassMap Φ Φ x x where coord := IntegralAffineMap.id _ polytope_mem := fun _ h ↦ h @@ -54,6 +55,7 @@ def refl (Φ : FlagDecomposition p d f) (x : Φ.flag.Node) : NodeMassMap Φ Φ x open Classical in /-- Compose compatible coordinate and cumulative-weight maps between three nodes. -/ +@[expose] def comp (M : NodeMassMap Φ Ψ x y) (N : NodeMassMap Ψ Ω y z) : NodeMassMap Φ Ω x z where coord := M.coord.comp N.coord @@ -139,12 +141,14 @@ variable {Φ Ψ Ω : FlagDecomposition p d f} open Classical in /-- The identity stable node map, with zero mass loss. -/ +@[expose] def refl (Φ : FlagDecomposition p d f) (x : Φ.flag.Node) : StableNodeMap Φ Φ x x where toNodeMassMap := NodeMassMap.refl Φ x mass_loss_le := by simp open Classical in /-- Compose stable node maps, adding their bounds on mass loss. -/ +@[expose] def comp (M : StableNodeMap Φ Ψ x y) (N : StableNodeMap Ψ Ω y z) : StableNodeMap Φ Ω x z where toNodeMassMap := M.toNodeMassMap.comp N.toNodeMassMap diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/NodeMassMapLevels.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/NodeMassMapLevels.lean index 2d2ec82260..d82ec95b9a 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/NodeMassMapLevels.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/NodeMassMapLevels.lean @@ -18,7 +18,7 @@ contains all data needed for level monotonicity and equal-level coordinate injectivity; no extra transport fields are required. -/ -@[expose] public section +public section namespace EGZ.FlagDecomposition.NodeMassMap diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/NormalizedComplete.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/NormalizedComplete.lean index e0cd988c74..9d86916fb9 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/NormalizedComplete.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/NormalizedComplete.lean @@ -16,7 +16,7 @@ retains the explicit complete representative and removes the old upper anchor. Minimality, all mass bounds, and the subdivision map survive. -/ -@[expose] public section +public section namespace EGZ.FlagDecomposition.CompletePreparation @@ -90,6 +90,7 @@ theorem normalized_node_ne_upperAnchor (heq ▸ x.property) /-- The subdivision map from the original decomposition to its normalized completion. -/ +@[expose] noncomputable def normalizedSubdivisionMap : SubdivisionMap Φ (D.normalized hp hδ hsmall C hmod hcenter) := (D.refinedSubdivisionMap hp hδ hsmall C hmod hcenter).comp diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/NormalizedFace.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/NormalizedFace.lean index db5b0de08f..cc2c0f8b8f 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/NormalizedFace.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/NormalizedFace.lean @@ -17,7 +17,7 @@ keeps the upper anchor for every proper selected face of a reduced old node. This gives a normalized operation with unchanged mass and uniform bounds. -/ -@[expose] public section +public section namespace EGZ.FlagDecomposition.Rechart @@ -65,6 +65,7 @@ noncomputable abbrev normalizedTargetNode (hΓ : Γ ≠ ⊤) (hred : Φ.IsReduce minimalized_upperAnchor_isReduced Φ anchor Γ hp C hmod hcenter hΓ hred⟩ /-- The face corresponding to the original target face in normalized coordinates. -/ +@[expose] noncomputable def normalizedTargetFace (hΓ : Γ ≠ ⊤) (hred : Φ.IsReducedElement anchor) : ((normalized Φ anchor Γ hp C hmod hcenter).flag.polytope (normalizedTargetNode Φ anchor Γ hp C hmod hcenter hΓ hred)).Face := @@ -111,7 +112,7 @@ theorem normalized_isKBounded {K B : ℕ} (hK : Φ.IsKBounded (fun _ ↦ K)) (isKBounded Φ anchor (Φ.faceSelector anchor Γ) hp hK) hC) /-- The subdivision map from the original decomposition to the normalized face refinement. -/ -noncomputable def normalizedSubdivisionMap : +@[expose] noncomputable def normalizedSubdivisionMap : SubdivisionMap Φ (normalized Φ anchor Γ hp C hmod hcenter) := (subdivisionMap Φ anchor (Φ.faceSelector anchor Γ) hp).comp ((Rechart.subdivisionMap (decomposition Φ anchor (Φ.faceSelector anchor Γ) hp) diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/NormalizedGap.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/NormalizedGap.lean index 3581e87814..458eee5e8b 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/NormalizedGap.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/NormalizedGap.lean @@ -18,7 +18,7 @@ the coordinate change. Increasing the coordinate bounds only weakens the required inverse-power gap threshold. -/ -@[expose] public section +public section namespace EGZ @@ -145,13 +145,14 @@ theorem normalized_gap_bound {K : Φ.flag.Node → ℕ} Fintype.card_pos (hKB x) d).trans (hgap x) /-- The subdivision map obtained by cleaning and normalizing the pruned weights. -/ +@[expose] noncomputable def normalizedSubdivisionMap : SubdivisionMap Φ (D.normalized hp C hmod hcenter) := (D.cleanedSubdivisionMap hp).comp (Rechart.subdivisionMap (D.cleaned hp) C hp hmod hcenter) @[simp] theorem normalizedSubdivisionMap_node (x : (D.cleaned hp).flag.Node) : - (D.normalizedSubdivisionMap hp C hmod hcenter).node x = x.val.val := rfl + (D.normalizedSubdivisionMap hp C hmod hcenter).node x = x.val.val := by rfl theorem normalized_isRealizedFace (x : (D.cleaned hp).flag.Node) (Γ : (Φ.flag.polytope x.val.val).Face) diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/NormalizedMassMaps.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/NormalizedMassMaps.lean index e7db312bdd..1ff053c07c 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/NormalizedMassMaps.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/NormalizedMassMaps.lean @@ -13,7 +13,7 @@ public import LeanPool.ErdosGinzburgZiv.EGZ.Decomposition.NormalizedGap /-! # Stable mass maps for normalized refinement steps -/ -@[expose] public section +public section namespace EGZ.FlagDecomposition @@ -27,6 +27,7 @@ variable {Φ : FlagDecomposition p d f} (D : Φ.PrunedWeights) (hp : Odd p) (hcenter : ∀ x q, q ∈ (C x).coordinateSupport → IsCenteredLift p q) /-- The stable map from a normalized pruned node to its original ancestor. -/ +@[expose] noncomputable def normalizedStableNodeMap (x : (D.normalized hp C hmod hcenter).flag.Node) : StableNodeMap Φ (D.normalized hp C hmod hcenter) ((D.normalizedSubdivisionMap hp C hmod hcenter).node x) x := @@ -50,6 +51,7 @@ variable {Φ : FlagDecomposition p d f} {anchor : Φ.flag.Node} {t : ℕ → ℕ (hcenter : ∀ x q, q ∈ (C x).coordinateSupport → IsCenteredLift p q) /-- The stable node map induced by the splitting stage of complete preparation. -/ +@[expose] noncomputable def splitStableNodeMap (x : (D.split hp hδ hsmall).flag.Node) : StableNodeMap Φ (D.split hp hδ hsmall) ((D.subdivisionMap hp hδ hsmall).node x) x := ((LocalizedPruning.prunedWeights Φ anchor D.selectedSet @@ -57,6 +59,7 @@ noncomputable def splitStableNodeMap (x : (D.split hp hδ hsmall).flag.Node) : (LowerTransfer.stableNodeMap (D.pruned hp hδ hsmall) (D.prunedAnchor hp hδ hsmall) hp x) /-- The stable node map after splitting and recharting the completion refinement. -/ +@[expose] noncomputable def refinedStableNodeMap (x : (D.refined hp hδ hsmall C hmod hcenter).flag.Node) : StableNodeMap Φ (D.refined hp hδ hsmall C hmod hcenter) ((D.refinedSubdivisionMap hp hδ hsmall C hmod hcenter).node x) x := @@ -65,6 +68,7 @@ noncomputable def refinedStableNodeMap (x : (D.refined hp hδ hsmall C hmod hcen D.chain.direction hp (D.extra_antitone hp hδ hsmall) C hmod hcenter x) /-- The stable node map from a normalized complete refinement to the original decomposition. -/ +@[expose] noncomputable def normalizedStableNodeMap (x : (D.normalized hp hδ hsmall C hmod hcenter).flag.Node) : StableNodeMap Φ (D.normalized hp hδ hsmall C hmod hcenter) diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/NormalizedOperations.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/NormalizedOperations.lean index 29e522c92b..6c7442f5fc 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/NormalizedOperations.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/NormalizedOperations.lean @@ -18,7 +18,7 @@ monotone prime threshold. A finite radius horizon therefore fixes the prime before any choices in the refinement run are made. -/ -@[expose] public section +public section namespace EGZ @@ -126,6 +126,7 @@ theorem card_le : @Fintype.card D.decomposition.flag.Node D.decomposition.flag.n FaceRefinement.normalized_card_le Φ anchor Γ D.odd D.charts D.modInjective D.centered /-- The subdivision map carried by the normalized face step. -/ +@[expose] noncomputable def subdivisionMap : SubdivisionMap Φ D.decomposition := FaceRefinement.normalizedSubdivisionMap Φ anchor Γ D.odd D.charts D.modInjective D.centered @@ -135,6 +136,7 @@ noncomputable abbrev targetNode (hΓ : Γ ≠ ⊤) (hred : Φ.IsReducedElement a FaceRefinement.normalizedTargetNode Φ anchor Γ D.odd D.charts D.modInjective D.centered hΓ hred /-- The target face of the normalized face step in its new coordinates. -/ +@[expose] noncomputable def targetFace (hΓ : Γ ≠ ⊤) (hred : Φ.IsReducedElement anchor) : (D.decomposition.flag.polytope (D.targetNode hΓ hred)).Face := FaceRefinement.normalizedTargetFace Φ anchor Γ D.odd D.charts D.modInjective D.centered hΓ hred @@ -169,6 +171,7 @@ theorem card_le : @Fintype.card D.decomposition.flag.Node D.decomposition.flag.n D.weights.normalized_card_le D.odd D.charts D.modInjective D.centered /-- The subdivision map carried by the normalized gap step. -/ +@[expose] noncomputable def subdivisionMap : SubdivisionMap Φ D.decomposition := D.weights.normalizedSubdivisionMap D.odd D.charts D.modInjective D.centered @@ -196,6 +199,7 @@ theorem card_le : @Fintype.card D.decomposition.flag.Node D.decomposition.flag.n D.preparation.normalized_card_le D.odd hδ hsmall D.charts D.modInjective D.centered /-- The subdivision map carried by the normalized completion step. -/ +@[expose] noncomputable def subdivisionMap : SubdivisionMap Φ D.decomposition := D.preparation.normalizedSubdivisionMap D.odd hδ hsmall D.charts D.modInjective D.centered @@ -310,6 +314,7 @@ theorem exists_normalizedOperationParameters (d : ℕ) (g : ℕ → ℕ) (hg : M /-- Choose uniform radius and prime bounds together with providers of the normalized operations. -/ +@[expose] noncomputable def normalizedOperationParameters (d : ℕ) (g : ℕ → ℕ) (hg : Monotone g) : NormalizedOperationParameters d g := Classical.choice (exists_normalizedOperationParameters d g hg) @@ -321,9 +326,11 @@ variable {d : ℕ} {g : ℕ → ℕ} (P : NormalizedOperationParameters d g) theorem radiusGrowth_ge (K : ℕ) : K ≤ P.radiusGrowth K := (P.radiusGrowth_growing.2 K).le /-- The radius bound obtained after `N` successive applications of the growth function. -/ +@[expose] def radiusHorizon (K N : ℕ) : ℕ := P.radiusGrowth^[N] K /-- The prime threshold at the radius bound after `N` normalized operations. -/ +@[expose] def primeHorizon (K N : ℕ) : ℕ := P.primeThreshold (P.radiusHorizon K N) theorem radius_sequence_le (r : ℕ → ℕ) {K : ℕ} (hstart : r 0 ≤ K) diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/OperationLevels.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/OperationLevels.lean index 897a820c61..f81ad4e540 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/OperationLevels.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/OperationLevels.lean @@ -20,7 +20,7 @@ state the comparisons using the actual normalized subdivision maps, ready for tracking persistent nodes through an iteration. -/ -@[expose] public section +public section namespace EGZ.FlagDecomposition diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/OperationMassMaps.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/OperationMassMaps.lean index 2616589f75..fe3cf0bff0 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/OperationMassMaps.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/OperationMassMaps.lean @@ -14,7 +14,7 @@ public import LeanPool.ErdosGinzburgZiv.EGZ.Decomposition.GapCleanup /-! # Coordinate and mass maps for the elementary constructions -/ -@[expose] public section +public section namespace EGZ.FlagDecomposition @@ -22,6 +22,7 @@ variable {p d : ℕ} [NeZero p] {f : FpCoord p d → ℕ} /-- The stable node map identifying a node of the reduced decomposition with its original node. -/ +@[expose] noncomputable def reducedStableNodeMap (Φ : FlagDecomposition p d f) (hp : Odd p) (x : (Φ.reduced hp).flag.Node) : StableNodeMap Φ (Φ.reduced hp) x.val x where coord := IntegralAffineMap.id _ @@ -37,6 +38,7 @@ namespace PrunedWeights variable {Φ : FlagDecomposition p d f} (D : Φ.PrunedWeights) (hp : Odd p) /-- The stable node map from an original node to its rebuilt pruned counterpart. -/ +@[expose] noncomputable def rebuiltStableNodeMap (x : (D.rebuilt hp).flag.Node) : StableNodeMap Φ (D.rebuilt hp) x.val x where coord := IntegralAffineMap.id _ @@ -56,6 +58,7 @@ noncomputable def rebuiltStableNodeMap (x : (D.rebuilt hp).flag.Node) : exact FlagDecompositionRaw.cumulativeWeight_mass_loss_le_real D.weight_le x.val /-- The stable node map obtained by rebuilding pruned weights and then reducing the result. -/ +@[expose] noncomputable def cleanedStableNodeMap (x : (D.cleaned hp).flag.Node) : StableNodeMap Φ (D.cleaned hp) x.val.val x := (D.rebuiltStableNodeMap hp x.val).comp ((D.rebuilt hp).reducedStableNodeMap hp x) @@ -71,6 +74,7 @@ variable (Φ : FlagDecomposition p d f) (hcenter : ∀ x q, q ∈ (C x).coordinateSupport → IsCenteredLift p q) /-- The stable node map induced by the chosen change of integral affine coordinates. -/ +@[expose] noncomputable def stableNodeMap (x : Φ.flag.Node) : StableNodeMap Φ (decomposition Φ C hp hinj hcenter) x x where coord := chart Φ C x @@ -109,6 +113,7 @@ namespace LowerTransfer variable (Φ : FlagDecomposition p d f) (anchor : Φ.flag.Node) (hp : Odd p) /-- The stable node map from the original node underlying a node of the lower transfer. -/ +@[expose] noncomputable def stableNodeMap (x : (decomposition Φ anchor hp).flag.Node) : StableNodeMap Φ (decomposition Φ anchor hp) x.val.val.1 x where coord := IntegralAffineMap.id _ @@ -131,6 +136,7 @@ variable (Φ : FlagDecomposition p d f) (e : Φ.flag.Node → ℕ) /-- The stable node map for augmentation, using the coordinate map that forgets the added directions. -/ +@[expose] noncomputable def stableNodeMap (x : Φ.flag.Node) : StableNodeMap Φ (decomposition Φ e ξ hp he C hmod hcenter) x x where coord := forget Φ e ξ hp he C x diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Parameters.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Parameters.lean index 701eefe296..933f97befe 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Parameters.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Parameters.lean @@ -17,23 +17,24 @@ choices in the paper. The geometric estimates include arbitrary tails, so they also control every finite execution of the refinement procedure. -/ -@[expose] public section +public section namespace EGZ.DecompositionParameters open scoped BigOperators /-- The constant in the mass loss of a complete-element refinement. -/ -def refinementConstant (d : ℕ) : ℝ := (3 : ℝ) ^ (d + 1) +@[expose] def refinementConstant (d : ℕ) : ℝ := (3 : ℝ) ^ (d + 1) /-- The ratio between two consecutive scales. -/ noncomputable def decayRatio (d : ℕ) : ℝ := (3 : ℝ)⁻¹ ^ (2 * d) /-- The scale `δ_i = δ₀ 3^(-2di)`. -/ +@[expose] noncomputable def scale (d : ℕ) (δ₀ : ℝ) (i : ℕ) : ℝ := δ₀ * decayRatio d ^ i /-- A bound for the mass lost at one stage, divided by the input mass. -/ -noncomputable def lossBudget (d : ℕ) (ε δ₀ : ℝ) (i : ℕ) : ℝ := +@[expose] noncomputable def lossBudget (d : ℕ) (ε δ₀ : ℝ) (i : ℕ) : ℝ := ε * scale d δ₀ i ^ 2 + refinementConstant d * scale d δ₀ i /-- A choice depending only on the dimension and retained-mass tolerance. -/ diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/PruningData.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/PruningData.lean index 38b369eff8..6bf3b5b02e 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/PruningData.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/PruningData.lean @@ -18,7 +18,7 @@ pruning. A surviving collection is pointwise below the old local weights and has at least one nonzero atom. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/PruningStability.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/PruningStability.lean index fba6ffe6f4..1df34c7da9 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/PruningStability.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/PruningStability.lean @@ -16,7 +16,7 @@ their mass loss is at most the global retained mass loss. This connects the gap-pruning estimate to the thickness estimate at every old large node. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Pullback.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Pullback.lean index 70567b298d..c5539f6dbc 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Pullback.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Pullback.lean @@ -19,7 +19,7 @@ can then be rebuilt on their active nodes. This construction permits the two-layer face refinement before the subsequent minimalization. -/ -@[expose] public section +public section open scoped BigOperators @@ -49,6 +49,7 @@ variable {p d : ℕ} {F : ConvexFlag} {N : Type*} [Fintype N] [SemilatticeSup N] [OrderTop N] /-- Reindex the finite-field representation with the same node map. -/ +@[expose] noncomputable def reindex (R : FpRepresentation p d F) (node : N →o F.Node) : FpRepresentation p d (F.reindex node) where space x := R.space (node x) @@ -259,6 +260,7 @@ theorem decomposition_card_le (hp : Odd p) : (D.rebuildData hp).card_decomposition_le /-- Every surviving split generator is an old local generator. -/ +@[expose] noncomputable def subdivisionMap (hp : Odd p) (hsup : ∀ x y, node (x ⊔ y) = node x ⊔ node y) : SubdivisionMap Φ (D.decomposition hp) := by diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/QuotientMass.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/QuotientMass.lean index d98011a9fb..ca1757e663 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/QuotientMass.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/QuotientMass.lean @@ -22,7 +22,7 @@ identity to the paper's sum over local flag points additionally uses uniqueness of centered representatives for odd `p`. -/ -@[expose] public section +public section open scoped BigOperators @@ -51,7 +51,7 @@ noncomputable def localToCumulativeMass /-- The same local mass sum, now partitioned by residue classes in the source lattice fibre and transported along the flag map. -/ -noncomputable def localTransitionMassBelow +@[expose] noncomputable def localTransitionMassBelow (R : FpRepresentation p d F) (pieces : F.Node → FpCoord p d → ℕ) (x : F.Node) (c : FpCoord p (F.rank x)) : ℕ := by diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/RealSupportRank.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/RealSupportRank.lean index 4d2db1e430..fa52c8258b 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/RealSupportRank.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/RealSupportRank.lean @@ -18,7 +18,7 @@ support polytope. A chart for support in a proper face of a minimal node has strictly smaller rank. -/ -@[expose] public section +public section namespace EGZ diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Rebuild.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Rebuild.lean index e44eb9f0d0..11966cdc81 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Rebuild.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Rebuild.lean @@ -17,7 +17,7 @@ nodes and replacing their polytopes by these support hulls reconstructs a flag decomposition, including visibility of every face. -/ -@[expose] public section +public section open scoped BigOperators @@ -50,6 +50,7 @@ include D open Classical in /-- A node is active when it has a nonzero local contribution below it. -/ +@[expose] def Active (_D : RebuildData R pieces f) (x : F.Node) : Prop := ∃ y, y ≤ x ∧ ∃ v, pieces y v ≠ 0 @@ -195,6 +196,7 @@ noncomputable abbrev flag : ConvexFlag where open Classical in /-- The finite-field representation restricted to the active nodes of the rebuilt flag. -/ +@[expose] noncomputable def representation : FpRepresentation p d D.flag where space x := R.space x.1 map x := R.map x.1 diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/RechartDecomposition.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/RechartDecomposition.lean index 3c95603b8a..8685c68a41 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/RechartDecomposition.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/RechartDecomposition.lean @@ -20,7 +20,7 @@ face. All weights and lifted masses are preserved, and the new decomposition has minimal ambient affine spaces and integer lattices. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/RechartFlag.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/RechartFlag.lean index 559a28dd63..0f2275a2a1 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/RechartFlag.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/RechartFlag.lean @@ -19,7 +19,7 @@ the support polytopes and factoring the old transitions through these charts gives a convex flag on the same node poset with standard coordinate lattices. -/ -@[expose] public section +public section namespace EGZ.FlagDecomposition @@ -54,6 +54,7 @@ variable (Φ : FlagDecomposition p d f) (C : ∀ x, IntegerLatticeChart (Φ.liftedSupport x)) /-- The coordinate chart at a node, with real and modular realizations. -/ +@[expose] noncomputable def chart (x : Φ.flag.Node) : IntegralAffineMap (C x).rank (Φ.flag.rank x) := IntegralAffineMap.ofIntAffineMap (C x).map @@ -61,6 +62,7 @@ theorem chart_real_injective (x : Φ.flag.Node) : Function.Injective (chart Φ C IntegralAffineMap.ofIntAffineMap_real_injective _ (C x).injective /-- The new node polytope is the hull of its support in the new coordinates. -/ +@[expose] noncomputable def polytope (x : Φ.flag.Node) : RationalPolytope (C x).rank := RationalPolytope.ofFinsetConvexHull ((C x).coordinateSupport.image IntCoord.real) (((C x).coordinateSupport_nonempty (Φ.liftedSupport_nonempty x)).image _) diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/RechartMass.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/RechartMass.lean index 0f4f086b71..19f83da51e 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/RechartMass.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/RechartMass.lean @@ -20,7 +20,7 @@ Summing that pointwise identification proves exact transport for every weight bounded by the cumulative weight, including the local summand. -/ -@[expose] public section +public section open scoped BigOperators @@ -30,7 +30,7 @@ namespace FlagDecompositionRaw open Classical in /-- The centered lift of a weight through one coordinate map. -/ -noncomputable def centeredFibreMass {p d n : ℕ} [NeZero p] +@[expose] noncomputable def centeredFibreMass {p d n : ℕ} [NeZero p] (w : FpCoord p d → ℕ) (φ : FpCoord p d → FpCoord p n) (q : IntCoord n) : ℕ := by classical @@ -52,6 +52,7 @@ namespace IntegerLatticeChart open Classical in /-- Express a finite-field representation map in the chart coordinates. -/ +@[expose] noncomputable def rechartMap {p d n : ℕ} [Fact p.Prime] {S : Finset (IntCoord n)} (C : IntegerLatticeChart S) (φ : FpCoord p d →ᵃ[ZMod p] FpCoord p n) : diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/RechartPreservation.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/RechartPreservation.lean index 19bd8c6fd9..8c290ea3c6 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/RechartPreservation.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/RechartPreservation.lean @@ -17,7 +17,7 @@ proper points. These maps preserve reducedness, realized faces, and completeness of individual elements. -/ -@[expose] public section +public section namespace EGZ.FlagDecomposition.Rechart @@ -64,6 +64,7 @@ theorem inverseChart_transition {x y : Φ.flag.Node} (h : x ≤ y) chart_inverseChart Φ C x q hq] /-- Map a point in the new coordinates to its original flag point. -/ +@[expose] noncomputable def forwardPoint (q : (flag Φ C).Point) : Φ.flag.Point := q.map (SupHom.id _) (fun x ↦ (chart Φ C x).real) (chart_mem_polytope Φ C) @@ -146,6 +147,7 @@ theorem inversePoint_mem_omega {q : Φ.flag.Point} (hq : q ∈ Φ.omega) : /-- The new decomposition is a subdivision of the old one through its coordinate charts. -/ +@[expose] noncomputable def subdivisionMap : SubdivisionMap Φ (decomposition Φ C hp hinj hcenter) := SubdivisionMap.ofLocalGenerators (SupHom.id _) (fun x ↦ (chart Φ C x).real) diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/RechartRepresentation.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/RechartRepresentation.lean index b22ee4736f..f54854e1d1 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/RechartRepresentation.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/RechartRepresentation.lean @@ -17,7 +17,7 @@ An affine left inverse of the modular lattice chart then gives a surjective representation in the new coordinates, compatible with all transitions. -/ -@[expose] public section +public section namespace EGZ.FlagDecomposition.Rechart @@ -26,11 +26,13 @@ variable {p d : ℕ} [NeZero p] [Fact p.Prime] {f : FpCoord p d → ℕ} (C : ∀ x, IntegerLatticeChart (Φ.liftedSupport x)) /-- The minimal ambient affine space at a node. -/ +@[expose] def space (x : Φ.flag.Node) : AffineSubspace (ZMod p) (FpCoord p d) := affineSpan (ZMod p) {v | Φ.cumulativeWeight x v ≠ 0} /-- The old representation expressed through an affine left inverse of the modular chart. The definition is an affine map on the whole ambient space. -/ +@[expose] noncomputable def map (x : Φ.flag.Node) : FpCoord p d →ᵃ[ZMod p] FpCoord p (C x).rank := (affineLeftInverse ((chart Φ C x).modp p)).comp (Φ.representation.map x) @@ -136,6 +138,7 @@ theorem map_compatible {x y : Φ.flag.Node} (h : x ≤ y) /-- The finite-field representation in minimal lattice and ambient affine coordinates. Modular injectivity is the only chart hypothesis. -/ +@[expose] noncomputable def representation : FpRepresentation p d (flag Φ C) where space := space Φ map := map Φ C diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/ReducedRepresentative.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/ReducedRepresentative.lean index e6a2d23756..49310081f5 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/ReducedRepresentative.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/ReducedRepresentative.lean @@ -16,7 +16,7 @@ the node. Every nonzero local summand has such a base, so passing to this reduced node preserves the entire cumulative function. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Reduction.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Reduction.lean index e383ce6818..68a0458ca3 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Reduction.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Reduction.lean @@ -17,7 +17,7 @@ closed under joins. These are the order-theoretic facts used when removing inactive nodes in the reduced-decomposition lemma. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/RefinementGrowth.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/RefinementGrowth.lean index 1b0a8243d0..b868f07f17 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/RefinementGrowth.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/RefinementGrowth.lean @@ -17,12 +17,13 @@ to the bounded lattice coordinates. The same sequence bounds every possible number of added directions up to the ambient dimension. -/ -@[expose] public section +public section namespace EGZ /-- The next refinement bound, chosen above both the current index and the prescribed growth at `A n`. -/ +@[expose] def refinementGrowth (A g : ℕ → ℕ) (n : ℕ) : ℕ := max (n + 1) (g (A n)) theorem refinementGrowth_isGrowing {A g : ℕ → ℕ} (hA : Monotone A) (hg : Monotone g) : @@ -34,6 +35,7 @@ theorem refinementGrowth_isGrowing {A g : ℕ → ℕ} (hA : Monotone A) (hg : M exact (Nat.lt_succ_self n).trans_le (le_max_left _ _) /-- The width after `i` iterations of the refinement growth function starting at `K`. -/ +@[expose] def refinementWidth (A g : ℕ → ℕ) (K i : ℕ) : ℕ := (refinementGrowth A g)^[i] K @[simp] diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/RefinementProgress.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/RefinementProgress.lean index d2fde86d93..adb32c4838 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/RefinementProgress.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/RefinementProgress.lean @@ -19,7 +19,7 @@ The concrete normalized operations satisfy the iteration's level, stable mass transport, parent injectivity, resolution, and numerical requirements. -/ -@[expose] public section +public section namespace EGZ.FlagDecomposition.Iteration diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Restrict.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Restrict.lean index 9e0d52007e..15983f51b5 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Restrict.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Restrict.lean @@ -18,7 +18,7 @@ zero local weight. The resulting flag has the same proper points, viewed through the inclusion of its nodes in the original flag. -/ -@[expose] public section +public section open scoped BigOperators @@ -70,12 +70,14 @@ noncomputable abbrev reducedFlag (Φ : FlagDecomposition p d f) : ConvexFlag whe open Classical in /-- The inclusion of points of the restricted flag in the original flag. -/ +@[expose] def reducedPointInclusion (Φ : FlagDecomposition p d f) (q : Φ.reducedFlag.Point) : Φ.flag.Point := ⟨q.base.1, q.val, q.val_mem⟩ open Classical in /-- A point whose base is reduced can be viewed in the restricted flag. -/ +@[expose] def toReducedPoint (Φ : FlagDecomposition p d f) (q : Φ.flag.Point) (hq : Φ.IsReducedElement q.base) : Φ.reducedFlag.Point := ⟨⟨q.base, hq⟩, q.val, q.val_mem⟩ @@ -150,6 +152,7 @@ theorem convexCombination_reducedPointInclusion (Φ : FlagDecomposition p d f) open Classical in /-- The original representation restricted to the reduced nodes. -/ +@[expose] noncomputable def reducedRepresentation (Φ : FlagDecomposition p d f) : FpRepresentation p d Φ.reducedFlag where space x := Φ.representation.space x.1 diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/ScalarExtension.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/ScalarExtension.lean index 3e5b92801d..ec2992b972 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/ScalarExtension.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/ScalarExtension.lean @@ -19,7 +19,7 @@ these integer coefficients constructs compatible affine maps over the real numbers and modulo every natural number. -/ -@[expose] public section +public section open scoped BigOperators @@ -54,7 +54,7 @@ namespace IntegralAffineMap variable {l m n : ℕ} /-- Extend the integer matrix of a linear map to a commutative ring. -/ -noncomputable def linearScalarExtension (R : Type*) [CommRing R] +@[expose] noncomputable def linearScalarExtension (R : Type*) [CommRing R] (A : IntCoord m →ₗ[ℤ] IntCoord n) : (Fin m → R) →ₗ[R] (Fin n → R) where toFun x i := ∑ j, x j * (A (Pi.single j 1) i : R) map_add' x y := by @@ -65,6 +65,7 @@ noncomputable def linearScalarExtension (R : Type*) [CommRing R] simp [Finset.mul_sum, mul_assoc] /-- Extend the integer coefficients and offset of an affine lattice map. -/ +@[expose] noncomputable def scalarExtension (R : Type*) [CommRing R] (A : IntCoord m →ᵃ[ℤ] IntCoord n) : (Fin m → R) →ᵃ[R] (Fin n → R) := (linearScalarExtension R A.linear).toAffineMap + @@ -143,6 +144,7 @@ theorem scalarExtension_comp (R : Type*) [CommRing R] simp only [scalarExtension_intCast, AffineMap.comp_apply] /-- Package any integer affine map with its real and modular scalar extensions. -/ +@[expose] noncomputable def ofIntAffineMap (A : IntCoord m →ᵃ[ℤ] IntCoord n) : IntegralAffineMap m n where real := scalarExtension ℝ A @@ -236,6 +238,7 @@ def integerLinear (A : IntegralAffineMap m n) : IntCoord m →ₗ[ℤ] IntCoord RingHom.id_apply] /-- The stored integer realization is itself an affine map over the integers. -/ +@[expose] def toIntAffineMap (A : IntegralAffineMap m n) : IntCoord m →ᵃ[ℤ] IntCoord n where toFun := A.integer linear := A.integerLinear diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/SlabPruning.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/SlabPruning.lean index ef7589148a..fe2f3fa105 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/SlabPruning.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/SlabPruning.lean @@ -19,7 +19,7 @@ maximal space of selected directions. Retained points also have bounded integer coordinates in the selected directions. -/ -@[expose] public section +public section open scoped BigOperators @@ -30,7 +30,7 @@ section Restriction variable {α I : Type*} [Fintype α] [Fintype I] /-- Delete all mass outside a set. -/ -noncomputable def restrictWeight (w : α → ℕ) (S : Set α) : α → ℕ := by +@[expose] noncomputable def restrictWeight (w : α → ℕ) (S : Set α) : α → ℕ := by classical exact fun v ↦ if v ∈ S then w v else 0 @@ -123,6 +123,7 @@ theorem IsThinAlong.compl_mass_le {p d : ℕ} [NeZero p] linarith /-- The intersection of the first `k` stage-indexed slabs. -/ +@[expose] def slabIntersection {p d : ℕ} (k : ℕ) (ξ : ℕ → FpCoord p d →ᵃ[ZMod p] ZMod p) (t : ℕ → ℕ) : Set (FpCoord p d) := {v | ∀ i : Fin k, v ∈ slab (ξ i) (t (i + 1))} @@ -212,7 +213,7 @@ theorem HasBoundedRepresentative.valMinAbs_natAbs_le {p K : ℕ} [NeZero p] rwa [hval] /-- Integer coordinates supplied by the selected affine functionals. -/ -def slabCoordinates {p d : ℕ} (k : ℕ) +@[expose] def slabCoordinates {p d : ℕ} (k : ℕ) (ξ : ℕ → FpCoord p d →ᵃ[ZMod p] ZMod p) (v : FpCoord p d) : IntCoord k := fun i ↦ (ξ i v).valMinAbs diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/StoppedLineages.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/StoppedLineages.lean index 9506d134de..f60251e7b8 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/StoppedLineages.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/StoppedLineages.lean @@ -16,7 +16,7 @@ extension requires no progress certificate, event, or unsatisfied condition at the constant stages. -/ -@[expose] public section +public section namespace EGZ.FlagDecomposition diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/SupportDecomposition.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/SupportDecomposition.lean index dfa1080767..3121c2b590 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/SupportDecomposition.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/SupportDecomposition.lean @@ -17,7 +17,7 @@ decomposition on the given flag itself. Integer transitions preserving these supports imply face visibility, so visibility is not an extra input. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/SupportDiagram.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/SupportDiagram.lean index 62db93a723..da2d613bb4 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/SupportDiagram.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/SupportDiagram.lean @@ -19,7 +19,7 @@ is required. Choosing the support-generated lattice charts gives a new diagram and a convex flag in minimal integer lattice coordinates. -/ -@[expose] public section +public section namespace EGZ @@ -93,6 +93,7 @@ noncomputable abbrev toConvexFlag : ConvexFlag where variable (C : ∀ x, IntegerLatticeChart (D.support x)) /-- Real, integer, and modular realizations of the chosen lattice chart. -/ +@[expose] noncomputable def chart (x : D.Node) : IntegralAffineMap (C x).rank (D.rank x) := IntegralAffineMap.ofIntAffineMap (C x).map diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/SupportDiagramRepresentation.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/SupportDiagramRepresentation.lean index efacf55956..b4d3a58cce 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/SupportDiagramRepresentation.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/SupportDiagramRepresentation.lean @@ -18,7 +18,7 @@ supported atoms. Injective modular lattice charts then give a surjective representation of the charted flag on its minimal ambient affine spaces. -/ -@[expose] public section +public section namespace EGZ.LatticeSupportDiagram @@ -28,6 +28,7 @@ variable {p d : ℕ} [NeZero p] [Fact p.Prime] (φ : (x : D.Node) → FpCoord p d →ᵃ[ZMod p] FpCoord p (D.rank x)) /-- Express the old coordinate map through the modular chart's left inverse. -/ +@[expose] noncomputable def coordinateMap (x : D.Node) : FpCoord p d →ᵃ[ZMod p] FpCoord p (C x).rank := (C x).rechartMap (φ x) @@ -112,6 +113,7 @@ theorem coordinateMap_compatible {x y : D.Node} (h : x ≤ y) {v : FpCoord p d} exact hcompat h hv /-- The actual representation of the charted support diagram. -/ +@[expose] noncomputable def chartedRepresentation : FpRepresentation p d (D.chartedFlag C) := FpRepresentation.ofCumulativeSupport w (coordinateMap D C φ) (fun x ↦ (C x).coordinateSupport) diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/SupportParameters.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/SupportParameters.lean index 8f6863ef7f..40cc3017c0 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/SupportParameters.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/SupportParameters.lean @@ -17,7 +17,7 @@ Only the ranks and integer support boxes enter the coordinate growth function and the prime threshold. -/ -@[expose] public section +public section namespace EGZ diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/SupportRechartMass.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/SupportRechartMass.lean index c3e0ee1a15..17f9b7ad1d 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/SupportRechartMass.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/SupportRechartMass.lean @@ -16,7 +16,7 @@ modular injectivity, and containment of the supported centered lifts in the old support. The original finite-field affine map need not be surjective. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/SupportRepresentation.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/SupportRepresentation.lean index 726cd3c154..058c4aeff1 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/SupportRepresentation.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/SupportRepresentation.lean @@ -18,7 +18,7 @@ constructs a representation without assuming surjectivity of the original coordinate maps on the ambient space. -/ -@[expose] public section +public section open scoped BigOperators @@ -57,6 +57,7 @@ variable {p d : ℕ} {F : ConvexFlag} open Classical in /-- The smallest ambient affine space containing the cumulative support. -/ +@[expose] def cumulativeSpace (w : F.Node → FpCoord p d → ℕ) (x : F.Node) : AffineSubspace (ZMod p) (FpCoord p d) := affineSpan (ZMod p) {v | FlagDecompositionRaw.cumulativeWeight w x v ≠ 0} @@ -93,6 +94,7 @@ open Classical in /-- Construct a representation from its cumulative support images. Integer affine generation supplies surjectivity, and compatibility is needed only on the nonzero cumulative atoms. -/ +@[expose] noncomputable def ofCumulativeSupport [Fact p.Prime] (w : F.Node → FpCoord p d → ℕ) (ψ : (x : F.Node) → FpCoord p d →ᵃ[ZMod p] FpCoord p (F.rank x)) diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Termination.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Termination.lean index 25a81cb7a3..04954cc97f 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Termination.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Termination.lean @@ -20,7 +20,7 @@ occurrences of its least color. The required number of occurrences may depend arbitrarily on the first index of the interval. -/ -@[expose] public section +public section namespace EGZ @@ -28,6 +28,7 @@ open scoped BigOperators /-- An interval on which `l` is a lower bound for the colors and occurs at least `h a` times. Indices and colors start at zero. -/ +@[expose] def HasColorInterval (χ : ℕ → ℕ) (h : ℕ → ℕ) (a b l : ℕ) : Prop := a ≤ b ∧ (∀ i ∈ Finset.Icc a b, l ≤ χ i) ∧ h a ≤ ((Finset.Icc a b).filter fun i => χ i = l).card diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Thickness.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Thickness.lean index c859f57e72..edd44168aa 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Thickness.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/Thickness.lean @@ -12,7 +12,7 @@ public import LeanPool.ErdosGinzburgZiv.EGZ.Decomposition.Mass # Thickness -/ -@[expose] public section +public section namespace EGZ diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/ThinDirections.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/ThinDirections.lean index f4de91da6a..4f33068a5f 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/ThinDirections.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/ThinDirections.lean @@ -20,7 +20,7 @@ steps. The selected directions have the prescribed stage-dependent widths, and every direction outside the final submodule is thick at the next stage. -/ -@[expose] public section +public section namespace EGZ @@ -29,6 +29,7 @@ namespace FpRepresentation variable {p d : ℕ} [Fact p.Prime] {F : ConvexFlag} /-- Affine functionals constant on every fibre inside the represented space. -/ +@[expose] def fiberConstantSubmodule (R : FpRepresentation p d F) (x : F.Node) : Submodule (ZMod p) (FpCoord p d →ᵃ[ZMod p] ZMod p) where carrier := {ξ | ∀ v w, v ∈ R.space x → w ∈ R.space x → diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/TwoLayer.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/TwoLayer.lean index ab8c1b21f1..2d93020ee9 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/TwoLayer.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/TwoLayer.lean @@ -19,7 +19,7 @@ selected atoms below the anchor to the lower layer; this preserves all total mass and every upper cumulative weight. -/ -@[expose] public section +public section open scoped BigOperators @@ -59,16 +59,19 @@ instance (anchor : α) [OrderTop α] : OrderTop (Node anchor) where open Classical in /-- Forget the layer; this preserves joins. -/ +@[expose] def projection (anchor : α) : SupHom (Node anchor) α where toFun a := a.1.1 map_sup' _ _ := rfl open Classical in /-- The upper copy of an old node. -/ +@[expose] def upper (anchor : α) (a : α) : Node anchor := ⟨(a, 1), by simp⟩ open Classical in /-- The lower copy of a node below the anchor. -/ +@[expose] def lower (anchor : α) (a : α) (ha : a ≤ anchor) : Node anchor := ⟨(a, 0), fun _ ↦ ha⟩ @[simp] theorem projection_upper (anchor a : α) : projection anchor (upper anchor a) = a := rfl @@ -111,6 +114,7 @@ def lowerEmbedding (anchor : α) : {a : α // a ≤ anchor} ↪o Node anchor whe open Classical in /-- Every layered node is uniquely either an upper copy or a lower copy. -/ +@[expose] noncomputable def layerEquiv (anchor : α) : α ⊕ {a : α // a ≤ anchor} ≃ Node anchor where toFun := Sum.elim (upper anchor) (fun a ↦ lower anchor a.1 a.2) invFun a := if h : a.1.2 = 0 then Sum.inr ⟨a.1.1, a.2 h⟩ else Sum.inl a.1.1 @@ -161,6 +165,7 @@ variable {β : Type*} open Classical in /-- Move selected atoms below the anchor into the lower layer. -/ +@[expose] noncomputable def splitWeight (anchor : α) (w : α → β → ℕ) (S : β → Prop) (a : Node anchor) (v : β) : ℕ := if a.1.2 = 0 then (if S v then w a.1.1 v else 0) @@ -213,6 +218,7 @@ theorem sum_splitWeight (anchor : α) (w : α → β → ℕ) (S : β → Prop) open Classical in /-- Cumulative weight in an arbitrary finite node order. -/ +@[expose] noncomputable def cumulativeWeight (w : α → β → ℕ) (a : α) (v : β) : ℕ := ∑ b, if b ≤ a then w b v else 0 diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/UniformCompleteRefinement.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/UniformCompleteRefinement.lean index 8983297081..4e526a4242 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/UniformCompleteRefinement.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/UniformCompleteRefinement.lean @@ -18,7 +18,7 @@ Iterating a growth step gives all slab widths and a prime threshold uniform over the input decomposition, its local masses, and the selected anchor. -/ -@[expose] public section +public section namespace EGZ diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/WeightedIncidence.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/WeightedIncidence.lean index 3d8ad67df9..87428a4234 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/WeightedIncidence.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Decomposition/WeightedIncidence.lean @@ -17,7 +17,7 @@ point increases a bounded rank, the number of sets containing a point is uniformly bounded. This is the counting induction used for large faces. -/ -@[expose] public section +public section open scoped BigOperators @@ -28,7 +28,7 @@ attribute [local instance] Classical.propDecidable variable {α I : Type*} [Fintype α] [Fintype I] /-- Mass of a set for a finite real-valued weight. -/ -noncomputable def mass (w : α → ℝ) (S : Set α) : ℝ := +@[expose] noncomputable def mass (w : α → ℝ) (S : Set α) : ℝ := ∑ a, if a ∈ S then w a else 0 @[simp] diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/Affine.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/Affine.lean index 5826ff693c..fd96c6bce1 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/Affine.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/Affine.lean @@ -19,7 +19,7 @@ An affine surjection from an affine subspace becomes first-coordinate projection after choosing coordinates on its kernel. -/ -@[expose] public section +public section open scoped BigOperators @@ -116,6 +116,7 @@ theorem exists_affineModel {p d r : ℕ} [Fact p.Prime] simpa using hdim /-- Relative thickness restricted to the affine space carrying the weight. -/ +@[expose] def IsThickRelativeOn {p d r : ℕ} [NeZero p] (w : FpCoord p d → ℕ) (V : Set (FpCoord p d)) (φ : FpCoord p d → FpCoord p r) (T : ℕ) (δ : ℝ) : Prop := diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/AffineApplication.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/AffineApplication.lean index b20d7e0a1c..a5848c26fd 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/AffineApplication.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/AffineApplication.lean @@ -18,7 +18,7 @@ uniform thresholds in the original ambient dimension. Translating the integer centre doubles the box radius and changes the weighted sum to zero. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/AffineRelations.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/AffineRelations.lean index 55e245a223..b43a46bb78 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/AffineRelations.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/AffineRelations.lean @@ -19,7 +19,7 @@ family of integer relations. Their evaluations measure the discrepancy from a function that factors through the original constraint matrix. -/ -@[expose] public section +public section open scoped BigOperators Matrix diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/Basic.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/Basic.lean index f1aaf9789a..3fe3bbab07 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/Basic.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/Basic.lean @@ -18,7 +18,7 @@ weights retain these multiplicities when several positions have the same vector. Affine changes of coordinates preserve zero sums of length `p`. -/ -@[expose] public section +public section open scoped BigOperators @@ -26,7 +26,7 @@ namespace EGZ namespace Expansion /-- Push a finite multiplicity function through an arbitrary map. -/ -noncomputable def pushWeight {α β : Type*} [Fintype α] +@[expose] noncomputable def pushWeight {α β : Type*} [Fintype α] (f : α → β) (w : α → ℕ) (b : β) : ℕ := by classical exact ∑ a, if f a = b then w a else 0 @@ -119,12 +119,14 @@ theorem hasZeroSumMultiplicity_pushWeight {p m n : ℕ} [NeZero p] exact affine_sum_eq_zero A u hm hz /-- Two points in one fibre of `φ` are distinguished by `ξ`. -/ +@[expose] def NonconstantOnFibers {p n r : ℕ} (φ : FpCoord p n → FpCoord p r) (ξ : FpCoord p n →ᵃ[ZMod p] ZMod p) : Prop := ∃ v u, φ v = φ u ∧ ξ v ≠ ξ u /-- The thickness assumption of the relative expansion theorem. -/ +@[expose] def IsThickRelative {p n r : ℕ} [NeZero p] (w : FpCoord p n → ℕ) (φ : FpCoord p n → FpCoord p r) (T : ℕ) (δ : ℝ) : Prop := diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/CharacterLinear.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/CharacterLinear.lean index 8610944b5e..2bd20d95ab 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/CharacterLinear.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/CharacterLinear.lean @@ -18,7 +18,7 @@ one-dimensional character equivalence recovers its finite-field linear functional. This gives the exact normalization needed for geometric sums. -/ -@[expose] public section +public section namespace EGZ.Expansion @@ -26,6 +26,7 @@ variable {p d : ℕ} [NeZero p] /-- The scalar additive character obtained by restricting a vector-space character to multiples of `a`. -/ +@[expose] noncomputable def scalarCharacter (χ : AddChar (FpCoord p d) ℂ) (a : FpCoord p d) : AddChar (ZMod p) ℂ := χ.compAddMonoidHom (LinearMap.toSpanSingleton (ZMod p) (FpCoord p d) a).toAddMonoidHom diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/CharacterSum.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/CharacterSum.lean index b7b2415ce3..a3e81e85c7 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/CharacterSum.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/CharacterSum.lean @@ -18,7 +18,7 @@ terms of its centered residue. The finite geometric-series identity then bounds every partial character sum independently of its length. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/DilatedGrowth.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/DilatedGrowth.lean index db92ae94be..bb86d3f9ae 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/DilatedGrowth.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/DilatedGrowth.lean @@ -18,13 +18,14 @@ spectral gap for short integer multiples of the available translations. Subadditivity then transfers growth back to an original translation. -/ -@[expose] public section +public section open scoped BigOperators namespace EGZ.Expansion /-- The non-strict central-slab thickness condition for real weights. -/ +@[expose] def IsCentrallyThick {p d : ℕ} [NeZero p] (w : FpCoord p d → ℝ) (K : ℕ) (δ : ℝ) : Prop := by classical diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/ExchangeCompletion.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/ExchangeCompletion.lean index 8e50d545fc..59ee1ab601 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/ExchangeCompletion.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/ExchangeCompletion.lean @@ -16,14 +16,14 @@ prescribed filler counts. Disjointness of multiset positions is expressed by a pointwise capacity bound on all reserved multiplicities. -/ -@[expose] public section +public section open scoped BigOperators namespace EGZ.Expansion /-- The sum of the group elements counted with their natural-number multiplicities. -/ -noncomputable def vectorSum {G : Type*} [AddCommMonoid G] [Fintype G] +@[expose] noncomputable def vectorSum {G : Type*} [AddCommMonoid G] [Fintype G] (u : G → ℕ) : G := ∑ v, u v • v theorem vectorSum_add {G : Type*} [AddCommMonoid G] [Fintype G] diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/ExchangePattern.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/ExchangePattern.lean index 1a319f7f6b..e96e97132f 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/ExchangePattern.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/ExchangePattern.lean @@ -18,7 +18,7 @@ fibre. Sampling all these positions independently gives exact uniform marginals; injective samples are the disjoint exchanges used later. -/ -@[expose] public section +public section open scoped BigOperators @@ -37,6 +37,7 @@ variable {S : Type*} [Fintype S] [DecidableEq S] /-- The labelled positions of an exchange pattern, separated into positive and negative copies. -/ +@[expose] def Position (P : ExchangePattern S) := (Σ q, Fin (P.positive q)) ⊕ (Σ q, Fin (P.negative q)) @@ -47,15 +48,18 @@ instance (P : ExchangePattern S) : DecidableEq P.Position := inferInstanceAs (DecidableEq ((Σ q, Fin (P.positive q)) ⊕ (Σ q, Fin (P.negative q)))) /-- The label carried by a position of the exchange pattern. -/ +@[expose] def label (P : ExchangePattern S) : P.Position → S := Sum.elim Sigma.fst Sigma.fst /-- The integer sign of a position: one for a positive copy and minus one for a negative copy. -/ +@[expose] def sign (P : ExchangePattern S) : P.Position → ℤ := Sum.elim (fun _ ↦ 1) (fun _ ↦ -1) /-- A choice of a sample from the prescribed fibre at every labelled position. -/ abbrev Sample (P : ExchangePattern S) (X : S → Type*) := ∀ i : P.Position, X (P.label i) /-- The total number of positive and negative positions in the pattern. -/ +@[expose] def size (P : ExchangePattern S) : ℕ := (∑ q, P.positive q) + ∑ q, P.negative q omit [DecidableEq S] in @@ -78,12 +82,14 @@ theorem sum_sign_smul {G : Type*} [AddCommGroup G] (P : ExchangePattern S) (r : simp [Fintype.sum_sum_type, Fintype.sum_sigma, ← Finset.sum_neg_distrib, sub_eq_add_neg] /-- The signed sum of the vectors selected by a sample of the exchange pattern. -/ +@[expose] noncomputable def sampleSum {G : Type*} [AddCommGroup G] (P : ExchangePattern S) {X : S → Type*} (v : ∀ q, X q → G) (x : P.Sample X) : G := ∑ i, P.sign i • v (P.label i) (x i) /-- The exchange pattern obtained by separating an integral relation into positive and negative parts. -/ +@[expose] def ofRelation (b : S → ℤ) : ExchangePattern S := ⟨fun q ↦ (b q).toNat, fun q ↦ (-b q).toNat⟩ omit [DecidableEq S] in diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/ExchangeResources.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/ExchangeResources.lean index 5b76bbcad4..1e10d8687c 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/ExchangeResources.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/ExchangeResources.lean @@ -18,7 +18,7 @@ equal first-coordinate sums. Its shift lies in the remaining coordinates. Injective samples of a balanced pattern produce such exchanges. -/ -@[expose] public section +public section open scoped BigOperators @@ -29,6 +29,7 @@ variable {p r t : ℕ} {A : Type*} [Fintype A] open Classical in /-- The finite collection of exchanges of bounded size in a fixed atom family. Multiplicity is represented by distinct atom positions. -/ +@[expose] def Exchange (point : A → FpCoord p (r + t)) (B : ℕ) := {J : Finset A × Finset A // Disjoint J.1 J.2 ∧ J.1.card = J.2.card ∧ (∑ x ∈ J.1, Coord.first r t (point x)) = (∑ x ∈ J.2, Coord.first r t (point x)) ∧ @@ -51,13 +52,16 @@ open Classical in def right (E : Exchange point B) : Finset A := E.val.2 open Classical in /-- The atoms used by either side of an exchange. -/ +@[expose] noncomputable def support (E : Exchange point B) : Finset A := E.left ∪ E.right open Classical in /-- The difference between the vector sums of the left and right sides of an exchange. -/ +@[expose] noncomputable def difference (E : Exchange point B) : FpCoord p (r + t) := (∑ x ∈ E.left, point x) - ∑ x ∈ E.right, point x open Classical in /-- The final coordinate block of the exchange difference. -/ +@[expose] noncomputable def shift (E : Exchange point B) : FpCoord p t := Coord.last r t E.difference omit [Fintype A] in diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/FibreSlots.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/FibreSlots.lean index 735f41624b..7c9f78b99f 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/FibreSlots.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/FibreSlots.lean @@ -16,7 +16,7 @@ their separate multiplicities. The remaining fibres reconstruct exactly the remaining natural-valued weight. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/FiniteProbability.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/FiniteProbability.lean index 339c79d481..9324189f67 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/FiniteProbability.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/FiniteProbability.lean @@ -17,14 +17,14 @@ public import Mathlib.Tactic These lemmas keep the sampling estimates for exchanges finite and explicit. -/ -@[expose] public section +public section open scoped BigOperators namespace EGZ.Expansion /-- The probability of a predicate under the uniform distribution on a finite type. -/ -noncomputable def finiteProb {A : Type*} [Fintype A] (P : A → Prop) : ℝ := by +@[expose] noncomputable def finiteProb {A : Type*} [Fintype A] (P : A → Prop) : ℝ := by classical exact 𝔼 a, if P a then 1 else 0 diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/FourierEnergy.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/FourierEnergy.lean index 4ad6441303..a3a5ab389e 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/FourierEnergy.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/FourierEnergy.lean @@ -17,7 +17,7 @@ finite sum identities used in the spectral growth estimate directly, without introducing a weighted graph or its eigenvalues. -/ -@[expose] public section +public section open scoped BigOperators ComplexConjugate open RCLike diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/GrowthIteration.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/GrowthIteration.lean index 5a70f0e2b1..8ce9619717 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/GrowthIteration.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/GrowthIteration.lean @@ -18,7 +18,7 @@ a multiplicative stage produce more than half of the group; two disjoint such families then cover the whole group. -/ -@[expose] public section +public section open scoped BigOperators Pointwise open Module @@ -31,6 +31,7 @@ variable {E A G : Type*} [DecidableEq E] [DecidableEq A] [AddCommGroup G] [DecidableEq G] /-- All sums obtained by choosing any subfamily of a finite family. -/ +@[expose] def binarySums (shift : E → G) (F : Finset E) : Finset G := F.powerset.image fun J ↦ ∑ e ∈ J, shift e @@ -80,6 +81,7 @@ theorem exists_bool_choice_of_mem_binarySums (shift : E → G) (F : Finset E) exact fun h ↦ hJF h /-- Atoms reserved by a family of exchanges. -/ +@[expose] def usedAtoms (support : E → Finset A) (F : Finset E) : Finset A := F.biUnion support omit [DecidableEq E] in diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/PrescribedCounts.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/PrescribedCounts.lean index 59f527feca..577f47c8bc 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/PrescribedCounts.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/PrescribedCounts.lean @@ -17,7 +17,7 @@ The integer coefficients give a natural multiplicity on the quotient. For a zero-dimensional fibre, this already proves relative expansion. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/Relative.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/Relative.lean index 0adc686fb5..219c658e79 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/Relative.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/Relative.lean @@ -25,7 +25,7 @@ The paper's "linear functions" are affine functionals, consistently with its slab definition and with the functional constructed in its proof. -/ -@[expose] public section +public section open scoped BigOperators @@ -34,6 +34,7 @@ namespace Expansion /-- A single instance of the relative expansion conclusion, at the stated dimension, box, thickness, width, and prime. -/ +@[expose] def RelativeExpansionAt (r t K : ℕ) (δ : ℝ) (T p : ℕ) [NeZero p] : Prop := ∀ (S : Finset (IntCoord r)) (w : FpCoord p (r + t) → ℕ) (α : S → ℤ), (∀ q ∈ S, latticeSupNorm q ≤ K) → @@ -49,6 +50,7 @@ def RelativeExpansionAt (r t K : ℕ) (δ : ℝ) (T p : ℕ) [NeZero p] : Prop : /-- The relative expansion theorem, with its uniform quantifier order. Neither threshold depends on `T`, `p`, the support, the multiplicities, or the selected coefficients. -/ +@[expose] def RelativeExpansionStatement : Prop := ∀ r t K : ℕ, 1 ≤ K → ∀ δ : ℝ, 0 < δ → ∃ T₀ p₀ : ℕ, ∀ T : ℕ, T₀ ≤ T → diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/RelativeConcentration.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/RelativeConcentration.lean index 114b920618..a0da2d9062 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/RelativeConcentration.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/RelativeConcentration.lean @@ -17,7 +17,7 @@ Concentration of the individual exchange components gives centres in each fibre. Integer affine relations turn these centres into one affine slab. -/ -@[expose] public section +public section open scoped BigOperators Matrix diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/RelativeProof.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/RelativeProof.lean index f0ecd24dbc..16da732de8 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/RelativeProof.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/RelativeProof.lean @@ -19,7 +19,7 @@ made uniform over every support in the prescribed box. All sampling and deletion arguments retain the positions of repeated vectors. -/ -@[expose] public section +public section open scoped BigOperators Matrix open Module diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/ResourceCompletion.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/ResourceCompletion.lean index 149e392d37..afff0b42a6 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/ResourceCompletion.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/ResourceCompletion.lean @@ -15,7 +15,7 @@ public import LeanPool.ErdosGinzburgZiv.EGZ.Expansion.PrescribedCounts # Converting exchange coverage to multiplicity bounds -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/SampleAvailability.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/SampleAvailability.lean index 73dfa9d051..9b532bf16e 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/SampleAvailability.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/SampleAvailability.lean @@ -18,7 +18,7 @@ The collision estimate permits restriction to injective samples, which are actual exchanges on the unused atom positions. -/ -@[expose] public section +public section open scoped BigOperators Matrix diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/SampleDistribution.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/SampleDistribution.lean index 643517d5e1..708af302ba 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/SampleDistribution.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/SampleDistribution.lean @@ -17,7 +17,7 @@ set from every sample space retains positive mass and preserves thickness provided one component witnesses escape from each central slab. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/Sampling.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/Sampling.lean index 88f6747fc0..f14aa0b671 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/Sampling.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/Sampling.lean @@ -17,7 +17,7 @@ then turns concentration of an exchange sum into a bounded relation among those centres. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/SetGrowth.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/SetGrowth.lean index b733ff60a9..8a7a08674d 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/SetGrowth.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/SetGrowth.lean @@ -21,7 +21,7 @@ basis growth estimate needed in relative expansion without using Loomis--Whitney. -/ -@[expose] public section +public section open scoped BigOperators open Module diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/SlabArithmetic.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/SlabArithmetic.lean index c886ab8bd0..7096fa2ecf 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/SlabArithmetic.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/SlabArithmetic.lean @@ -12,7 +12,7 @@ public import LeanPool.ErdosGinzburgZiv.EGZ.Expansion.Basic # Slab Arithmetic -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/Subweights.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/Subweights.lean index 54f133df00..5b9766f490 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/Subweights.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/Subweights.lean @@ -15,7 +15,7 @@ All selections are made in natural multiplicities, so coincident vector values are still allowed to occupy distinct positions. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/ThickSupport.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/ThickSupport.lean index 81d2adc030..b4ba3cf589 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/ThickSupport.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Expansion/ThickSupport.lean @@ -17,7 +17,7 @@ subspace. A basis selected from the positive support can therefore be used in the initial growth phase. -/ -@[expose] public section +public section open scoped BigOperators open Module diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Main/Assembly.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Main/Assembly.lean index ee7ac00edb..0db8dd4072 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Main/Assembly.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Main/Assembly.lean @@ -19,7 +19,7 @@ statement. Thresholds are selected before the decomposition, with the final prime bound taken over its uniformly bounded node radii. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Main/Centerpoint.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Main/Centerpoint.lean index d8892b3dc6..563b047949 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Main/Centerpoint.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Main/Centerpoint.lean @@ -21,7 +21,7 @@ does not require the family to be injective. Compatibility and centered integer transitions identify its upper masses with cumulative lifted mass. -/ -@[expose] public section +public section open scoped BigOperators @@ -79,6 +79,7 @@ theorem localLift_centeredLift_ne_zero (hp : Odd p) (x : Φ.flag.Node) open Classical in /-- The flag point associated with a local atom through its centered integral lift. -/ +@[expose] def localAtomPoint (hp : Odd p) (a : Φ.LocalAtom) : Φ.flag.Point where base := a.1.1 val := (FpCoord.centeredLift (Φ.representation.map a.1.1 a.1.2)).real diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Main/Coefficients.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Main/Coefficients.lean index e2f8efed69..a20d16b0cf 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Main/Coefficients.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Main/Coefficients.lean @@ -21,7 +21,7 @@ within their scope. The centrality identity then gives the reserve required by relative expansion. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Main/Input.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Main/Input.lean index e5e66f26af..0e43a38dce 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Main/Input.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Main/Input.lean @@ -13,7 +13,7 @@ public import LeanPool.ErdosGinzburgZiv.EGZ.Main.Parameters # Input -/ -@[expose] public section +public section open scoped BigOperators @@ -34,6 +34,7 @@ theorem one_le_hollowConstant {p d : ℕ} (hp : p.Prime) : 1 ≤ hollowConstant namespace MainProof /-- A convenient prime-independent upper bound for the hollow constant. -/ +@[expose] def hollowBound (d : ℕ) : ℕ := (2 * d - 1).choose d + 1 theorem hollowBound_pos (d : ℕ) : 0 < hollowBound d := by unfold hollowBound; omega diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Main/Interior.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Main/Interior.lean index 64ada24bf7..98e9e8d9cb 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Main/Interior.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Main/Interior.lean @@ -17,7 +17,7 @@ functional suppresses all points outside that face. This gives the halfspaces needed to show that the centerpoint's least face is large. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Main/Parameters.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Main/Parameters.lean index dfeef25040..ee452ecf26 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Main/Parameters.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Main/Parameters.lean @@ -16,7 +16,7 @@ the particular exponential constants in the paper; only a positive margin after rounding and balancing is needed. -/ -@[expose] public section +public section namespace EGZ.MainProof @@ -45,6 +45,7 @@ theorem errorScale_le_inv {C ζ W : ℝ} (hC : 0 ≤ C) /-- The flag lemma supplies this fraction of `p` in every nonempty fibre, because the normalized input contains at least `p` terms. -/ +@[expose] noncomputable def gapScale (d : ℕ) (δ : ℝ) (K : ℕ) : ℝ := δ ^ 3 * (K : ℝ)⁻¹ ^ d diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Main/Selection.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Main/Selection.lean index ba9f00fedc..c006746b42 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Main/Selection.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Main/Selection.lean @@ -20,7 +20,7 @@ lift at its base in the finite integer-coordinate language used by balanced combinations. The bounds retain the selected node's own radius. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Main/UpperBound.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Main/UpperBound.lean index 8bef1b59a4..51979ce80a 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Main/UpperBound.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Main/UpperBound.lean @@ -17,12 +17,13 @@ enough for `MainUpperBound`, but the ceiling must be absorbed using a smaller internal error parameter. It cannot simply be dropped. -/ -@[expose] public section +public section namespace EGZ /-- The finite multiplicity statement to be supplied by the structural argument. The prime threshold is uniform over the input multiset. -/ +@[expose] def EventualCeilZeroSum (d : ℕ) : Prop := ∀ ζ : ℝ, 0 < ζ → ζ < 1 → ∃ P : ℕ, ∀ (p : ℕ) (hp : p.Prime), P < p → diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/MainTheorem.lean b/LeanPool/ErdosGinzburgZiv/EGZ/MainTheorem.lean index efc8486508..27e9ae503b 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/MainTheorem.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/MainTheorem.lean @@ -14,7 +14,7 @@ public import LeanPool.ErdosGinzburgZiv.EGZ.Expansion.RelativeProof # Main Theorem -/ -@[expose] public section +public section namespace EGZ diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/Polynomial/HollowBound.lean b/LeanPool/ErdosGinzburgZiv/EGZ/Polynomial/HollowBound.lean index bc94e1d4bb..0b0b8a6e04 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/Polynomial/HollowBound.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/Polynomial/HollowBound.lean @@ -34,7 +34,7 @@ that last block, while hollowness identifies it with `h(t)^q`; these two facts contradict the choice of `h`. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/TheoremOneTwelve.lean b/LeanPool/ErdosGinzburgZiv/EGZ/TheoremOneTwelve.lean index d8d2adcb36..3cb7197d01 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/TheoremOneTwelve.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/TheoremOneTwelve.lean @@ -17,7 +17,7 @@ its centerpoint corollary, and the prime-reduction bound for hollow rational polytopes into Theorem 1.12. -/ -@[expose] public section +public section namespace EGZ diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/ZeroSum/Basic.lean b/LeanPool/ErdosGinzburgZiv/EGZ/ZeroSum/Basic.lean index b324af45f3..f22b486a88 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/ZeroSum/Basic.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/ZeroSum/Basic.lean @@ -14,7 +14,7 @@ public import Mathlib.Data.ZMod.Basic # Basic -/ -@[expose] public section +public section open scoped BigOperators @@ -27,24 +27,28 @@ field structure will carry a primality hypothesis. -/ abbrev FpVec (p d : ℕ) := Fin d → ZMod p /-- A sequence contains `p` terms, at distinct positions, whose sum is zero. -/ +@[expose] def HasZeroSumSubsequence {ι : Type*} (p : ℕ) {d : ℕ} (a : ι → FpVec p d) : Prop := ∃ I : Finset ι, I.card = p ∧ ∑ i ∈ I, a i = 0 /-- Every sequence of exactly `n` vectors in `𝔽_p^d` has a zero-sum subsequence of length `p`. -/ +@[expose] def EGZProperty (p d n : ℕ) : Prop := ∀ a : Fin n → FpVec p d, HasZeroSumSubsequence p a /-- A family `v₁, ..., vₛ` is `p`-hollow when the only nonnegative integer combinations of total weight `p` that sum to zero put all their weight on a single vector. For prime `p`, this condition forces `v` to be injective. -/ +@[expose] def IsPHollow (p : ℕ) {d s : ℕ} (v : Fin s → FpVec p d) : Prop := ∀ α : Fin s → ℕ, (∑ i, α i) = p → ((∑ i, α i • v i) = 0 ↔ ∃ i, α i = p) /-- There is a `p`-hollow family of `s` vectors in `𝔽_p^d`. -/ +@[expose] def AdmitsPHollowLength (p d s : ℕ) : Prop := ∃ v : Fin s → FpVec p d, IsPHollow p v diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/ZeroSum/Constants.lean b/LeanPool/ErdosGinzburgZiv/EGZ/ZeroSum/Constants.lean index 7f266b8e51..877a75fa55 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/ZeroSum/Constants.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/ZeroSum/Constants.lean @@ -12,7 +12,7 @@ public import LeanPool.ErdosGinzburgZiv.EGZ.ZeroSum.Basic # Constants -/ -@[expose] public section +public section namespace EGZ diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/ZeroSum/DimensionOne.lean b/LeanPool/ErdosGinzburgZiv/EGZ/ZeroSum/DimensionOne.lean index a39adbc135..6f2fd77def 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/ZeroSum/DimensionOne.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/ZeroSum/DimensionOne.lean @@ -15,7 +15,7 @@ It proves the classical one-dimensional Erdős--Ginzburg--Ziv theorem already supported by Mathlib. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ErdosGinzburgZiv/EGZ/ZeroSum/Multiplicity.lean b/LeanPool/ErdosGinzburgZiv/EGZ/ZeroSum/Multiplicity.lean index 92964f87b9..21a972d6a1 100644 --- a/LeanPool/ErdosGinzburgZiv/EGZ/ZeroSum/Multiplicity.lean +++ b/LeanPool/ErdosGinzburgZiv/EGZ/ZeroSum/Multiplicity.lean @@ -17,13 +17,14 @@ EGZ constant uses sequences with distinct selected positions. This file supplies the bridge between these two models. -/ -@[expose] public section +public section open scoped BigOperators namespace EGZ /-- A submultiset of exactly `p` vectors whose sum vanishes. -/ +@[expose] def HasZeroSumMultiplicity {p d : ℕ} [NeZero p] (f : FpCoord p d → ℕ) : Prop := ∃ a : FpCoord p d → ℕ, diff --git a/LeanPool/ErdosGinzburgZiv/Solution.lean b/LeanPool/ErdosGinzburgZiv/Solution.lean index 5b544f505c..e4c2d43eb3 100644 --- a/LeanPool/ErdosGinzburgZiv/Solution.lean +++ b/LeanPool/ErdosGinzburgZiv/Solution.lean @@ -20,7 +20,7 @@ are the same independent definitions, and the bridge lemmas identify their constants with the ones used by the full EGZ proof. -/ -@[expose] public section +public section open scoped BigOperators 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/EuclideanJordan.lean b/LeanPool/EuclideanJordan.lean index 316f449a89..baf69faac0 100644 --- a/LeanPool/EuclideanJordan.lean +++ b/LeanPool/EuclideanJordan.lean @@ -71,4 +71,4 @@ Tags: nonassociative-algebra MSC: 17C20, 17C27, 17C37, 17C65, 17A15, 46L70 -/ -@[expose] public section +public section diff --git a/LeanPool/EuclideanJordan/EuclideanJordan.lean b/LeanPool/EuclideanJordan/EuclideanJordan.lean index 29643674b3..cd3df0e257 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan.lean @@ -56,4 +56,4 @@ public import LeanPool.EuclideanJordan.EuclideanJordan.Witness Root import for the library. See `README.md` for the headline results. -/ -@[expose] public section +public section diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/Block.lean b/LeanPool/EuclideanJordan/EuclideanJordan/Block.lean index 8909478ba0..22770ebaa8 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/Block.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/Block.lean @@ -53,7 +53,7 @@ they just stop being a Peirce decomposition. Callers wanting the FK reading shou in hand from `IsOrthIdemFamily`; the theorem simply does not need to be told. -/ -@[expose] public section +public section namespace EuclideanJordan diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/Bridge.lean b/LeanPool/EuclideanJordan/EuclideanJordan/Bridge.lean index cd1deb405e..c981eec661 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/Bridge.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/Bridge.lean @@ -42,7 +42,7 @@ power-associativity theorem — cannot be bridged this way, because the instance exist before the statement elaborates. -/ -@[expose] public section +public section namespace EuclideanJordan section Bridge @@ -50,7 +50,7 @@ section Bridge variable {J : Type*} [NormedAddCommGroup J] [Module ℝ J] /-- Build the multiplicative structure ON the ambient additive group, from a bilinear map. -/ -@[instance_reducible] +@[expose, instance_reducible] def ringOfBilinear (m : J →ₗ[ℝ] J →ₗ[ℝ] J) (hcomm : ∀ x y, m x y = m y x) : NonUnitalNonAssocCommRing J := { (inferInstance : AddCommGroup J) with diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/Class.lean b/LeanPool/EuclideanJordan/EuclideanJordan/Class.lean index 9d32b23702..0d3dfe0673 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/Class.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/Class.lean @@ -105,7 +105,7 @@ if one is ever declared, that scoped instance and this class's `toMul` will both inside `open HermMul` sections and one of them has to give way. -/ -@[expose] public section +public section noncomputable section @@ -211,6 +211,7 @@ and the five lemmas after it are exactly that hypothesis tuple, so a consumer of rebuilding them. -/ /-- The Jordan product of a `EuclideanJordanAlgebra` as a bundled bilinear map. -/ +@[expose] def jmulₗ (J : Type*) [NormedAddCommGroup J] [InnerProductSpace ℝ J] [EuclideanJordanAlgebra J] : J →ₗ[ℝ] J →ₗ[ℝ] J := LinearMap.mk₂ ℝ (· * ·) EuclideanJordanAlgebra.add_mul EuclideanJordanAlgebra.smul_mul diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/Connection.lean b/LeanPool/EuclideanJordan/EuclideanJordan/Connection.lean index 3525a02420..33ebfdc89d 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/Connection.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/Connection.lean @@ -68,7 +68,7 @@ The statement "a simple `J` has every block nonzero" is **not proved anywhere in library**, which has no notion of a Jordan ideal to state simplicity with. -/ -@[expose] public section +public section noncomputable section @@ -385,7 +385,7 @@ theorem IsConnector.act {F : JordanFrame J n} {i j k : Fin n} (hij : i ≠ j) (h /-- The transfer map `y ↦ 2 (c ∘ y)` attached to a connector. -/ def connMap (c : J) : J →ₗ[ℝ] J := (2 : ℝ) • jmulₗ J c -@[simp] theorem connMap_apply (c y : J) : connMap c y = (2 : ℝ) • (c * y) := rfl +@[simp] theorem connMap_apply (c y : J) : connMap c y = (2 : ℝ) • (c * y) := by rfl /-- The transfer map carries `V_{jk}` into `V_{ik}`. -/ theorem connMap_mem {F : JordanFrame J n} {i j k : Fin n} (hij : i ≠ j) (hjk : j ≠ k) diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/FormallyReal.lean b/LeanPool/EuclideanJordan/EuclideanJordan/FormallyReal.lean index 83bb6c0647..62208b4876 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/FormallyReal.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/FormallyReal.lean @@ -49,7 +49,7 @@ conclusion whose connecting lemma was already in the tree (after row 35 and the that documents it.** -/ -@[expose] public section +public section namespace EuclideanJordan diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/Frame.lean b/LeanPool/EuclideanJordan/EuclideanJordan/Frame.lean index 59afbf4f9d..cb3fb7cd91 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/Frame.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/Frame.lean @@ -59,7 +59,7 @@ facts needs it; it is what the *spectral* theorem produces and what the rank arg consumes. Keeping it out makes visible which results are independent of the spectral theorem. -/ -@[expose] public section +public section namespace EuclideanJordan diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/FrameExists.lean b/LeanPool/EuclideanJordan/EuclideanJordan/FrameExists.lean index 9793be3c06..414a3b0fff 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/FrameExists.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/FrameExists.lean @@ -75,7 +75,7 @@ frame conjugacy. Nothing here is a step towards it. Do not read `exists_jordan "`J` has rank `n`". -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/FramePeirce.lean b/LeanPool/EuclideanJordan/EuclideanJordan/FramePeirce.lean index a2ffbadd92..8c823a227b 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/FramePeirce.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/FramePeirce.lean @@ -101,7 +101,7 @@ existentially quantified. Note what that does and does not settle: see the rank -/ -@[expose] public section +public section noncomputable section @@ -114,6 +114,7 @@ variable {J : Type*} [NormedAddCommGroup J] [InnerProductSpace ℝ J] [Euclidean /-! ## Eigenspaces of left multiplication -/ /-- The `r`-eigenspace of `L_a`. -/ +@[expose] def eigSub (a : J) (r : ℝ) : Submodule ℝ J where carrier := {x : J | a * x = r • x} add_mem' := fun {u v} hu hv => by @@ -131,6 +132,7 @@ def eigSub (a : J) (r : ℝ) : Submodule ℝ J where variable {n : ℕ} /-- The eigenvalue attached to the pair `(i, j)`: `1` on the diagonal, `1/2` off it. -/ +@[expose] def blockCoef (i j : Fin n) : ℝ := if i = j then 1 else (2 : ℝ)⁻¹ theorem blockCoef_comm (i j : Fin n) : blockCoef i j = blockCoef j i := by @@ -140,6 +142,7 @@ theorem blockCoef_comm (i j : Fin n) : blockCoef i j = blockCoef j i := by · simp [h, Ne.symm h] /-- `V_{ij}` before it is pushed through `Sym2`. -/ +@[expose] def frameBlockRaw (F : JordanFrame J n) (i j : Fin n) : Submodule ℝ J := eigSub (F.p i) (blockCoef i j) ⊓ eigSub (F.p j) (blockCoef i j) @@ -150,6 +153,7 @@ theorem frameBlockRaw_comm (F : JordanFrame J n) (i j : Fin n) : /-- **`V_{ij}`.** For `i ≠ j` the joint `1/2`-eigenspace of `L_{p i}` and `L_{p j}`; on the diagonal, `J₂(p i)`. -/ +@[expose] def frameBlock (F : JordanFrame J n) : Sym2 (Fin n) → Submodule ℝ J := Sym2.lift ⟨frameBlockRaw F, frameBlockRaw_comm F⟩ diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/FramePeirceMul.lean b/LeanPool/EuclideanJordan/EuclideanJordan/FramePeirceMul.lean index 3e676a1067..c73424a421 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/FramePeirceMul.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/FramePeirceMul.lean @@ -105,7 +105,7 @@ bounds a frame's cardinality by the rank and by the dimension, and nothing anywh `dim V_{ii} = 1` into a statement about `rank J`. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/HermitianBilin.lean b/LeanPool/EuclideanJordan/EuclideanJordan/HermitianBilin.lean index 27ec96bcfe..c4e452ea9f 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/HermitianBilin.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/HermitianBilin.lean @@ -25,7 +25,7 @@ than 𝕜-linearity) is the right statement because `HermitianMat n 𝕜` is onl a 𝕜-multiple of a Hermitian matrix need not be Hermitian. -/ -@[expose] public section +public section noncomputable section @@ -52,6 +52,7 @@ theorem symmMul_smul_rightG (t : ℝ) (a b : HermitianMat n 𝕜) : rw [Matrix.mul_smul, Matrix.smul_mul, ← smul_add, smul_comm] /-- The Euclidean Jordan product `x ∘ y = ½(xy + yx)` on `H_n(𝕜)` as an ℝ-bilinear map. -/ +@[expose] def jordanBilinG (𝕜 : Type*) [RCLike 𝕜] : HermitianMat n 𝕜 →ₗ[ℝ] HermitianMat n 𝕜 →ₗ[ℝ] HermitianMat n 𝕜 := LinearMap.mk₂ ℝ (fun a b => a.symmMul b) diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/HermitianCarrier.lean b/LeanPool/EuclideanJordan/EuclideanJordan/HermitianCarrier.lean index ad7716b139..c3c3d49788 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/HermitianCarrier.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/HermitianCarrier.lean @@ -117,7 +117,7 @@ which is **not** proved to be the rank — `EuclideanJordan/Rank.lean` proves on `card ≤ finrank`. -/ -@[expose] public section +public section noncomputable section @@ -356,7 +356,7 @@ noncomputable def diagJordanFrame : JordanFrame (HermitianMat n ℂ) (Fintype.ca exact diagFrame_sum @[simp] theorem diagJordanFrame_p (k : Fin (Fintype.card n)) : - (diagJordanFrame (n := n)).p k = diagFrame ((Fintype.equivFin n).symm k) := rfl + (diagJordanFrame (n := n)).p k = diagFrame ((Fintype.equivFin n).symm k) := by rfl /-- **(M4) on a named frame.** `H_n(ℂ)` is the internal direct sum of the Peirce blocks of the diagonal frame — the frame Peirce decomposition with nothing left quantified. -/ diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/Order.lean b/LeanPool/EuclideanJordan/EuclideanJordan/Order.lean index c5ed0ebf7e..638f6f3613 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/Order.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/Order.lean @@ -82,7 +82,7 @@ Two deliberate choices, both forced by diamonds. coefficient off. -/ -@[expose] public section +public section noncomputable section @@ -102,6 +102,7 @@ variable {J : Type*} [AddCommGroup J] [Module ℝ J] /-- **The positive cone**: `z` is a finite sum of squares of the bilinear product `m`. The empty sum is allowed, so `0` is in the cone by `k = 0`. -/ +@[expose] def IsSoS (m : J →ₗ[ℝ] J →ₗ[ℝ] J) (z : J) : Prop := ∃ (k : ℕ) (f : Fin k → J), z = ∑ i, m (f i) (f i) @@ -166,7 +167,7 @@ theorem eq_zero_of_isSoS_of_isSoS_neg simp [hi] /-- The partial order induced by the cone: `x ≤ y` iff `y - x` is a sum of squares. -/ -@[instance_reducible] +@[expose, instance_reducible] def partialOrderOfSoS (m : J →ₗ[ℝ] J →ₗ[ℝ] J) (hfr : ∀ (k : ℕ) (f : Fin k → J), (∑ i, m (f i) (f i)) = 0 → ∀ i, f i = 0) : PartialOrder J where @@ -225,7 +226,7 @@ as the positive cone and the Jordan unit as the order unit. A `def`, not an `instance` — see the module docstring. The `NormedAddCommGroup` and `NormedSpace` parents are filled from the ambient instances, so no second normed structure is created. -/ -@[instance_reducible] +@[expose, instance_reducible] def orderUnitSpaceOfBilinear (m : J →ₗ[ℝ] J →ₗ[ℝ] J) (hcomm : ∀ x y : J, m x y = m y x) (hjordan : ∀ a b : J, m (m a b) (m a a) = m a (m b (m a a))) diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/OrderAuto.lean b/LeanPool/EuclideanJordan/EuclideanJordan/OrderAuto.lean index e8468a076a..3800a0e5a3 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/OrderAuto.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/OrderAuto.lean @@ -88,7 +88,7 @@ automorphism, and the fixing and cocycle properties (vdW Props 5.5, 5.7). **Onl proved here.** The other two are cited, not formalized, and nothing below establishes them. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/OrderUnitSpace.lean b/LeanPool/EuclideanJordan/EuclideanJordan/OrderUnitSpace.lean index fa3525f5e9..b969258bf6 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/OrderUnitSpace.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/OrderUnitSpace.lean @@ -33,7 +33,7 @@ structure, not derived here as the order-unit norm. * van de Wetering, arXiv:1803.11139 -/ -@[expose] public section +public section noncomputable section @@ -107,6 +107,7 @@ theorem le_add_of_nonneg_right {a b : V} (h : (0 : V) ≤ b) : a ≤ a + b := by -- Effect space /-- An effect is an element `a` with `0 ≤ a ≤ 𝟙`. -/ +@[expose] def IsEffect (a : V) : Prop := (0 : V) ≤ a ∧ a ≤ 𝟙 /-- The converse of `sub_nonneg_of_le`: a nonnegative difference gives an inequality. -/ @@ -264,6 +265,7 @@ difference is what a homogeneity argument consumes at its last step. needing it says so in its own statement. Nothing is given up by that: the Archimedean property *is* part of the standard definition of an order unit space — not a stand-in for a cited result — so a theorem proved under it is proved at the standard generality. -/ +@[expose] def IsArchimedean (V : Type*) [OrderUnitSpace V] : Prop := ∀ x : V, (∀ ε : ℝ, 0 < ε → x ≤ ε • ousUnit) → x ≤ 0 diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/Orthogonal.lean b/LeanPool/EuclideanJordan/EuclideanJordan/Orthogonal.lean index 5c6bcfd42b..56df57d5ad 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/Orthogonal.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/Orthogonal.lean @@ -39,7 +39,7 @@ and `EuclideanJordan/Frame.lean` assembles it (`opCommute_scalarOn_frame`). * Faraut and Korányi, *Analysis on Symmetric Cones*, Ch. IV. -/ -@[expose] public section +public section namespace EuclideanJordan diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/Pattern.lean b/LeanPool/EuclideanJordan/EuclideanJordan/Pattern.lean index 1f35eceda7..df64c944a9 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/Pattern.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/Pattern.lean @@ -41,7 +41,7 @@ one-line consequence is written out above so a reader can check it rather than t constraints say what the summands can be, not that every element decomposes into them. -/ -@[expose] public section +public section namespace EuclideanJordan diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/Peirce.lean b/LeanPool/EuclideanJordan/EuclideanJordan/Peirce.lean index bce4c9192b..216c018021 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/Peirce.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/Peirce.lean @@ -74,7 +74,7 @@ searched them systematically. * McCrimmon, *A Taste of Jordan Algebras*, §II.8. -/ -@[expose] public section +public section namespace EuclideanJordan @@ -146,6 +146,7 @@ theorem mul_smul_comm' (r : ℝ) (a b : J) : a * (r • b) = r • (a * b) := by rw [mul_comm, smul_mul_assoc, mul_comm] /-- The Jordan multiplication operator `L_c : y ↦ c ∘ y`, as an `ℝ`-linear map. -/ +@[expose] def mulL (c : J) : J →ₗ[ℝ] J where toFun y := c * y map_add' := mul_add c @@ -155,14 +156,17 @@ def mulL (c : J) : J →ₗ[ℝ] J where /-- The Peirce projection onto the `1`-eigenspace of `L_c`: the Lagrange interpolant `2L² − L`, which is `1` at `1` and `0` at `0` and `1/2`. -/ +@[expose] def peirceOne (c : J) : J →ₗ[ℝ] J := (2 : ℝ) • (mulL c ∘ₗ mulL c) - mulL c /-- The Peirce projection onto the `1/2`-eigenspace of `L_c`: the Lagrange interpolant `4L − 4L²`. -/ +@[expose] def peirceHalf (c : J) : J →ₗ[ℝ] J := (4 : ℝ) • mulL c - (4 : ℝ) • (mulL c ∘ₗ mulL c) /-- The Peirce projection onto the `0`-eigenspace of `L_c`: the Lagrange interpolant `1 − 3L + 2L²`. -/ +@[expose] def peirceZero (c : J) : J →ₗ[ℝ] J := LinearMap.id - (3 : ℝ) • mulL c + (2 : ℝ) • (mulL c ∘ₗ mulL c) diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/PeirceMul.lean b/LeanPool/EuclideanJordan/EuclideanJordan/PeirceMul.lean index bfda7784a0..676e9326a6 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/PeirceMul.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/PeirceMul.lean @@ -59,7 +59,7 @@ characterisation of the rank-two block. * McCrimmon, *A Taste of Jordan Algebras*, §II.8. -/ -@[expose] public section +public section namespace EuclideanJordan diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/PeirceSubalgebra.lean b/LeanPool/EuclideanJordan/EuclideanJordan/PeirceSubalgebra.lean index b6d6fe2217..6a5b085f2f 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/PeirceSubalgebra.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/PeirceSubalgebra.lean @@ -103,7 +103,7 @@ zero. -/ -@[expose] public section +public section noncomputable section @@ -120,6 +120,7 @@ variable {J : Type*} [NormedAddCommGroup J] [InnerProductSpace ℝ J] [Euclidean The idempotency hypothesis is carried but unused: the eigenspace of any element is a submodule. It is present so that the *type* `↥(peirceOneSub hc)` records it, which is what lets the `Mul`, `One` and `EuclideanJordanAlgebra` instances below be found by synthesis. -/ +@[expose] def peirceOneSub {c : J} (_hc : c * c = c) : Submodule ℝ J where carrier := {x : J | c * x = x} add_mem' := fun {a b} ha hb => by @@ -134,6 +135,7 @@ def peirceOneSub {c : J} (_hc : c * c = c) : Submodule ℝ J where x ∈ peirceOneSub hc ↔ c * x = x := Iff.rfl /-- **`J₀(c)`**, the eigenvalue-`0` Peirce space `{x | c ∘ x = 0}`, as a submodule. -/ +@[expose] def peirceZeroSub {c : J} (_hc : c * c = c) : Submodule ℝ J where carrier := {x : J | c * x = 0} add_mem' := fun {a b} ha hb => by diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/Power.lean b/LeanPool/EuclideanJordan/EuclideanJordan/Power.lean index 83dc9344d7..b10e3b48ce 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/Power.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/Power.lean @@ -54,7 +54,7 @@ this vocabulary, and because `commuteAt_two` is what made the general pattern vi above and nothing more. -/ -@[expose] public section +public section namespace EuclideanJordan @@ -64,6 +64,7 @@ variable {J : Type*} [NonUnitalNonAssocCommRing J] [IsCommJordan J] /-- `jpow x n = x^{n+1}`. Indexed from `1` rather than `0` so that no unit is assumed — the Peirce layer of this development is unit-free and this stays so. -/ +@[expose] def jpow (x : J) : ℕ → J | 0 => x | (n + 1) => x * jpow x n @@ -80,6 +81,7 @@ theorem jpow_succ' (x : J) (n : ℕ) : jpow x (n + 1) = jpow x n * x := by /-- `L_{x^{m+1}}` commutes with `L_x`. Power associativity is exactly `∀ m, CommuteAt x m` (see `jpow_mul_jpow_of_commuteAt`). -/ +@[expose] def CommuteAt (x : J) (m : ℕ) : Prop := ∀ w : J, x * (jpow x m * w) = jpow x m * (x * w) omit [IsCommJordan J] in diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/PowerAssoc.lean b/LeanPool/EuclideanJordan/EuclideanJordan/PowerAssoc.lean index 0f6ef05b99..af14096385 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/PowerAssoc.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/PowerAssoc.lean @@ -55,7 +55,7 @@ across it is the upstream contribution. **Not done here** — that translation i this file should not be read as providing it. -/ -@[expose] public section +public section namespace EuclideanJordan diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/Rank.lean b/LeanPool/EuclideanJordan/EuclideanJordan/Rank.lean index d1084fc882..12fe48f285 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/Rank.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/Rank.lean @@ -55,7 +55,7 @@ without restating it. -/ -@[expose] public section +public section noncomputable section @@ -72,6 +72,7 @@ The third clause is stated in the ambient algebra — `d` idempotent with `c ∘ membership in `peirceOneSub` — rather than over the subtype, so that it can be checked without first producing the subalgebra. `isPrimitive_iff_of_idem` below is the two readings' equivalence. -/ +@[expose] def IsPrimitive (c : J) : Prop := c * c = c ∧ c ≠ 0 ∧ ∀ d : J, d * d = d → c * d = d → d = 0 ∨ d = c diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/Spectral.lean b/LeanPool/EuclideanJordan/EuclideanJordan/Spectral.lean index db1f230649..5d0b22f8cf 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/Spectral.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/Spectral.lean @@ -88,7 +88,7 @@ because of step 3. Multiplicities never enter, and neither does `Mathlib`'s `rad polynomial calculus is built on it. -/ -@[expose] public section +public section namespace EuclideanJordan diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/Subalgebra.lean b/LeanPool/EuclideanJordan/EuclideanJordan/Subalgebra.lean index c5ace796eb..b22f69601e 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/Subalgebra.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/Subalgebra.lean @@ -52,7 +52,7 @@ development deliberately does not assume. The two theorems below say exactly wha version would, without the bundling. -/ -@[expose] public section +public section namespace EuclideanJordan diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/TraceForm.lean b/LeanPool/EuclideanJordan/EuclideanJordan/TraceForm.lean index ab9fc55b08..e4d80d4790 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/TraceForm.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/TraceForm.lean @@ -77,7 +77,7 @@ normalisation, and definite form rather than a normalised one, so `traceForm` is admissible there as it stands. -/ -@[expose] public section +public section noncomputable section @@ -141,6 +141,7 @@ variable {J : Type*} [NonUnitalNonAssocCommRing J] [IsCommJordan J] [Module ℝ /-- `EuclideanJordan/Peirce.lean`'s `mulL`, bundled as a linear map in the multiplier — which is what makes `jtr` linear. -/ +@[expose] def mulLₗ : J →ₗ[ℝ] J →ₗ[ℝ] J where toFun := mulL map_add' a b := by ext y; simp only [mulL_apply, LinearMap.add_apply, add_mul] @@ -167,6 +168,7 @@ It is not normalised — see the module docstring. ★ The carrier here has no (`NonUnitalNonAssocCommRing`), so the normalisation cannot even be *stated* at this generality; where a unit `e` is available it is `L_e = id`, so `jtr e` would be `finrank ℝ J` rather than the rank. That is a remark, not a lemma: nothing below proves it and nothing needs it. -/ +@[expose] def jtr : J →ₗ[ℝ] ℝ := (LinearMap.trace ℝ J).comp mulLₗ omit [IsCommJordan J] in @@ -250,6 +252,7 @@ variable {J : Type*} [NonUnitalNonAssocCommRing J] [IsCommJordan J] [Module ℝ [IsScalarTower ℝ J J] /-- **The Jordan trace form** `τ(x, y) = tr(L_{x ∘ y})`. -/ +@[expose] def traceForm : J →ₗ[ℝ] J →ₗ[ℝ] ℝ := LinearMap.mk₂ ℝ (fun x y => jtr (x * y)) (fun x x' y => by rw [add_mul, map_add]) diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor.lean b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor.lean index ca3417123d..7f2d58c719 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor.lean @@ -23,4 +23,4 @@ Supporting modules for Euclidean Jordan algebras: power associativity, the spect trace form, Koecher/Alfsen-Shultz, and the frame Peirce decomposition. -/ -@[expose] public section +public section diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/ContinuousLinearMap.lean b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/ContinuousLinearMap.lean index e1e96b3d02..5ebbb413cd 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/ContinuousLinearMap.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/ContinuousLinearMap.lean @@ -23,7 +23,7 @@ Mathlib. nonzero eigenvalues. -/ -@[expose] public section +public section namespace ContinuousLinearMap diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat.lean b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat.lean index 85d602e36b..21d060b600 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat.lean @@ -24,4 +24,4 @@ Supporting modules for Euclidean Jordan algebras: power associativity, the spect trace form, Koecher/Alfsen-Shultz, and the frame Peirce decomposition. -/ -@[expose] public section +public section diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat/Basic.lean b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat/Basic.lean index 6d7fa7c0ae..b4e5042a98 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat/Basic.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat/Basic.lean @@ -13,10 +13,11 @@ public import LeanPool.EuclideanJordan.EuclideanJordan.Vendor.Tactic.Commutes /-! Hermitian matrices, their algebraic structure, eigenspaces, and tensor products. -/ -@[expose] public section +public section /-- The type of Hermitian matrices, as a `Subtype`. Equivalent to a `Matrix n n α` bundled with the fact that `Matrix.IsHermitian`. -/ +@[expose] def HermitianMat (n : Type*) (α : Type*) [AddGroup α] [StarAddMonoid α] := (selfAdjoint (Matrix n n α) : Type (max u_1 u_2)) @@ -34,7 +35,7 @@ theorem eq_IsHermitian : HermitianMat n α = { m : Matrix n n α // m.IsHermiti rfl /-- The underlying matrix of a Hermitian matrix. -/ -@[coe] def mat : HermitianMat n α → Matrix n n α := +@[coe, expose] def mat : HermitianMat n α → Matrix n n α := Subtype.val instance : Coe (HermitianMat n α) (Matrix n n α) := ⟨mat⟩ @@ -206,7 +207,7 @@ instance : Module R (HermitianMat n α) := variable [TopologicalSpace α] /-- The projection from HermitianMat to Matrix, as a continuous linear map. -/ -@[simps] +@[simps, expose] def matₗ : HermitianMat n α →L[R] Matrix n n α where toFun := mat cont := by fun_prop @@ -363,6 +364,7 @@ square, this would apply to any `Semigroup`+`StarMul` (as proved by `IsSelfAdjoi us conjugate to other sizes too, as is done in e.g. Kraus operators. That is, it's a _heterogeneous_ conjguation. -/ +@[expose] def conj {m} (B : Matrix m n α) : HermitianMat n α →+ HermitianMat m α where toFun A := ⟨B * A.mat * B.conjTranspose, by @@ -450,6 +452,7 @@ instance [i : Nonempty n] : FaithfulSMul ℝ (HermitianMat n 𝕜) where simpa [RCLike.smul_re, -mat_apply] using congr(RCLike.re ($(h 1).val i.some i.some)) /-- The continuous linear map associated with a Hermitian matrix. -/ +@[expose] noncomputable def lin : EuclideanSpace 𝕜 n →L[𝕜] EuclideanSpace 𝕜 n where toLinearMap := A.mat.toEuclideanLin cont := LinearMap.continuous_of_finiteDimensional _ @@ -472,6 +475,7 @@ noncomputable def eigenspace (μ : 𝕜) : Submodule 𝕜 (EuclideanSpace 𝕜 n /-- The kernel of a Hermitian matrix `A` as a submodule of Euclidean space, defined by `LinearMap.ker A.toMat.toEuclideanLin`. Equivalently, the zero-eigenspace. -/ +@[expose] noncomputable def ker : Submodule 𝕜 (EuclideanSpace 𝕜 n) := LinearMap.ker A.lin.toLinearMap @@ -496,6 +500,7 @@ theorem ker_pos_smul {c : ℝ} (hc : c ≠ 0) : (c • A).ker = A.ker := by /-- The support of a Hermitian matrix `A` as a submodule of Euclidean space, defined by `LinearMap.range A.toMat.toEuclideanLin`. Equivalently, the sum of all nonzero eigenspaces. -/ +@[expose] noncomputable def support : Submodule 𝕜 (EuclideanSpace 𝕜 n) := LinearMap.range A.lin.toLinearMap @@ -530,6 +535,7 @@ variable {𝕜 : Type*} [RCLike 𝕜] [DecidableEq n] variable (𝕜) in /-- The Hermitian diagonal matrix whose diagonal is the given real-valued function. -/ +@[expose] def diagonal (f : n → ℝ) : HermitianMat n 𝕜 := ⟨Matrix.diagonal (f ·), by simp [selfAdjoint.mem_iff, Matrix.star_eq_conjTranspose, Matrix.diagonal_conjTranspose]⟩ diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat/CFC.lean b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat/CFC.lean index 639098d99d..4bbb00d384 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat/CFC.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat/CFC.lean @@ -17,7 +17,7 @@ public import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic /-! Matrix operations on HermitianMats with the CFC -/ -@[expose] public section +public section namespace HermitianMat noncomputable section CFC @@ -44,6 +44,7 @@ theorem conjTranspose_cfc : (cfc f A.mat).conjTranspose = cfc f A.mat := by exact cfc_predicate f A.mat /-- Continuous functional calculus for a real-valued function of a Hermitian matrix. -/ +@[expose] protected def cfc : HermitianMat d 𝕜 := ⟨cfc f A.mat, cfc_predicate _ _⟩ diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat/Inner.lean b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat/Inner.lean index 0ec648bd3a..26767fbb88 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat/Inner.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat/Inner.lean @@ -34,7 +34,7 @@ topology that HermitianMat inherits from the topology on Matrix. This can be don -/ -@[expose] public section +public section namespace HermitianMat @@ -317,7 +317,7 @@ This disagrees slightly with Mathlib convention on the `Matrix` type, which avoi norm as there are several reasonable ones; for Hermitian matrices, though, this seem to be the right choice. -/ -@[reducible] +@[reducible, expose] noncomputable def InnerProductCore : InnerProductSpace.Core ℝ (HermitianMat d 𝕜) := { inner A B := ⟪A, B⟫ diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat/Jordan.lean b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat/Jordan.lean index 4a41e63218..ca5606623f 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat/Jordan.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat/Jordan.lean @@ -17,7 +17,7 @@ Hermitian matrices have a Jordan algebra structure given by `HermMul`. When `A` and `B` commute, this reduces to standard matrix multiplication. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat/NonSingular.lean b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat/NonSingular.lean index 1fe4393936..c43a7159f3 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat/NonSingular.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat/NonSingular.lean @@ -10,7 +10,7 @@ public import LeanPool.EuclideanJordan.EuclideanJordan.Vendor.Isometry /-! Nonsingular Hermitian matrices and their inverses. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat/Order.lean b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat/Order.lean index 9d8d2970b1..def401d643 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat/Order.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat/Order.lean @@ -10,7 +10,7 @@ public import Mathlib.Analysis.RCLike.Basic /-! The positive semidefinite order and associated norm bounds on Hermitian matrices. -/ -@[expose] public section +public section namespace HermitianMat diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat/Proj.lean b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat/Proj.lean index 6290006062..f69170dc5f 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat/Proj.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat/Proj.lean @@ -27,7 +27,7 @@ public import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.Pos nonpositive) eigenvalues. -/ -@[expose] public section +public section noncomputable section namespace HermitianMat diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat/Reindex.lean b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat/Reindex.lean index 32ac3034fd..a56ff4315b 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat/Reindex.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat/Reindex.lean @@ -17,7 +17,7 @@ Hermitian matrix; however, this only makes sense when both permutations are the This file then gives relevant lemmas for simplifying this. -/ -@[expose] public section +public section namespace HermitianMat variable {d d₂ d₃ d₄ 𝕜 : Type*} [RCLike 𝕜] @@ -25,6 +25,7 @@ variable {d d₂ d₃ d₄ 𝕜 : Type*} [RCLike 𝕜] variable (A B : HermitianMat d 𝕜) (e : d ≃ d₂) /-- Reindex both rows and columns of a Hermitian matrix along an equivalence. -/ +@[expose] def reindex (e : d ≃ d₂) : HermitianMat d₂ 𝕜 := ⟨A.mat.reindex e e, A.H.submatrix e.symm⟩ diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat/Trace.lean b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat/Trace.lean index 18274db177..4df81a31b9 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat/Trace.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/HermitianMat/Trace.lean @@ -23,7 +23,7 @@ The `IsMaximalSelfAdjoint` class is used so that (for example) for matrices over it uses the real part. -/ -@[expose] public section +public section namespace HermitianMat @@ -38,6 +38,7 @@ variable [Ring α] [StarAddMonoid α] [CommSemiring R] [Algebra R α] [IsMaximal but that the trace of a `HermitianMat n ℂ` gives values in ℝ. The fact that traces are "automatically" real reduces coercions down the line. -/ +@[expose] def trace (A : HermitianMat n α) : R := IsMaximalSelfAdjoint.selfadjMap (A.mat.trace) diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/IsMaximalSelfAdjoint.lean b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/IsMaximalSelfAdjoint.lean index 0d0f01cf28..8c8ef11dff 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/IsMaximalSelfAdjoint.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/IsMaximalSelfAdjoint.lean @@ -18,7 +18,7 @@ Hermitian matrix be valued in `ℝ` instead of `ℂ`, reflecting that physical o self-adjoint and take real expectation values. -/ -@[expose] public section +public section /-- `IsMaximalSelfAdjoint R α` witnesses that `R` is the maximal `TrivialStar` subring of the star ring `α`, via an additive map `selfadjMap : α →+ R` collecting the self-adjoint part of diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/Isometry.lean b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/Isometry.lean index 0cb375084d..399eccadc5 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/Isometry.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/Isometry.lean @@ -11,7 +11,7 @@ public import LeanPool.EuclideanJordan.EuclideanJordan.Vendor.Matrix /-! Simultaneous orthogonal diagonalization of commuting symmetric operators. -/ -@[expose] public section +public section open scoped Matrix diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/LinearEquiv.lean b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/LinearEquiv.lean index 52ad179036..a2e9b13aec 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/LinearEquiv.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/LinearEquiv.lean @@ -33,7 +33,7 @@ together with lemmas relating them to `Matrix.reindex`. -/ -@[expose] public section +public section variable {d d₁ d₂ d₃ R 𝕜 : Type*} [RCLike 𝕜] @@ -51,7 +51,7 @@ variable (R) in /-- The `R`-linear equivalence `(d₂ → R) ≃ₗ[R] (d → R)` that relabels the coordinates of a function along an index equivalence `e : d ≃ d₂`. This is the linear-equivalence packaging of `Equiv.piCongrLeft`. -/ -@[simps] +@[simps, expose] def ofRelabel (e : d ≃ d₂) : (d₂ → R) ≃ₗ[R] (d → R) := by refine { e.symm.piCongrLeft (fun _ ↦ R) with map_add' := ?_, map_smul' := ?_ } <;> (intros; ext; simp [Equiv.piCongrLeft_apply]) @@ -63,7 +63,7 @@ variable (𝕜) in coordinates of a vector along an index equivalence `e : d ≃ d₂`. This is the `EuclideanSpace` analogue of `LinearEquiv.ofRelabel`, obtained by transporting it across the `WithLp` identifications. -/ -@[simps!] +@[simps!, expose] def euclideanOfRelabel (e : d ≃ d₂) : EuclideanSpace 𝕜 d₂ ≃ₗ[𝕜] EuclideanSpace 𝕜 d := (WithLp.linearEquiv 2 𝕜 _).trans ((ofRelabel _ e).trans (WithLp.linearEquiv 2 𝕜 _).symm) diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/Matrix.lean b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/Matrix.lean index 896f94e584..54d0e339da 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/Matrix.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/Matrix.lean @@ -26,7 +26,7 @@ public import LeanPool.EuclideanJordan.EuclideanJordan.Vendor.Misc /-! Matrix order, partial traces, spectra, and block constructions. -/ -@[expose] public section +public section noncomputable section @@ -637,10 +637,12 @@ section partial_trace variable [AddCommMonoid R] [Fintype d] /-- The partial trace obtained by summing diagonal entries in the left index factor. -/ +@[expose] def traceLeft (m : Matrix (d × d₁) (d × d₂) R) : Matrix d₁ d₂ R := Matrix.of fun i₁ j₁ ↦ ∑ i₂, m (i₂, i₁) (i₂, j₁) /-- The partial trace obtained by summing diagonal entries in the right index factor. -/ +@[expose] def traceRight (m : Matrix (d₁ × d) (d₂ × d) R) : Matrix d₁ d₂ R := Matrix.of fun i₂ j₂ ↦ ∑ i₁, m (i₂, i₁) (j₂, i₁) diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/Misc.lean b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/Misc.lean index b933a50ed9..22002aedb6 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/Misc.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/Misc.lean @@ -10,7 +10,7 @@ public import Mathlib.Order.CompletePartialOrder /-! Auxiliary finite-dimensional linear algebra and functional calculus lemmas. -/ -@[expose] public section +public section --Can this be rewritten more generally? For `finiteness` to work, I don't know how. --PR'ed in #33105 diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/Tactic.lean b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/Tactic.lean index d6d62fb313..36b52d54b8 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/Tactic.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/Tactic.lean @@ -16,4 +16,4 @@ Supporting modules for Euclidean Jordan algebras: power associativity, the spect trace form, Koecher/Alfsen-Shultz, and the frame Peirce decomposition. -/ -@[expose] public section +public section diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/Tactic/Commutes.lean b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/Tactic/Commutes.lean index ef276b92a5..cea2ecbe74 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/Tactic/Commutes.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/Tactic/Commutes.lean @@ -40,7 +40,7 @@ tries to do straightforward recursion on expressions, along with some basic norm of ring operations. -/ -@[expose] public section +public section /-- A tactic for proving goals of the `Commute` relation. diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/Tactic/Commutes/Attribute.lean b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/Tactic/Commutes/Attribute.lean index d673b60a88..b40a4e24a1 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/Tactic/Commutes/Attribute.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/Vendor/Tactic/Commutes/Attribute.lean @@ -16,6 +16,6 @@ This module defines the `Commutes` Aesop rule set which is used by the they're declared is imported, so we must put this declaration into its own file. -/ -@[expose] public section +public section declare_aesop_rule_sets [Commutes] (default := false) diff --git a/LeanPool/EuclideanJordan/EuclideanJordan/Witness.lean b/LeanPool/EuclideanJordan/EuclideanJordan/Witness.lean index a7cb7224c5..078e1e4342 100644 --- a/LeanPool/EuclideanJordan/EuclideanJordan/Witness.lean +++ b/LeanPool/EuclideanJordan/EuclideanJordan/Witness.lean @@ -54,7 +54,7 @@ with all three components nonzero, and nothing more. The rank-two carrier is use is the smallest place where a `1/2`-eigenvector exists, not because rank two matters here. -/ -@[expose] public section +public section open HermMul EuclideanJordan @@ -73,9 +73,11 @@ noncomputable example : IsScalarTower ℝ H2 H2 := inferInstance /-! ### 2. An idempotent with a nonzero `1/2`-eigenspace -/ /-- The rank-one projection `diag(1,0)`. -/ +@[expose] noncomputable def cWit : H2 := HermitianMat.diagonal ℂ ![1, 0] /-- The off-diagonal Hermitian matrix `[[0,1],[1,0]]`. -/ +@[expose] def xWit : H2 := ⟨!![0, 1; 1, 0], by simp only [selfAdjoint.mem_iff, Matrix.star_eq_conjTranspose] @@ -226,6 +228,7 @@ section JordanFrame variable {d : Type*} [Fintype d] [DecidableEq d] /-- The diagonal matrix units `E_ii`, as Hermitian matrices. -/ +@[expose] noncomputable def diagFrame (i : d) : HermitianMat d ℂ := HermitianMat.diagonal ℂ (fun j => if j = i then 1 else 0) diff --git a/LeanPool/EuclideanJordan/FramePeirceSolution.lean b/LeanPool/EuclideanJordan/FramePeirceSolution.lean index c9233286e7..a585aeeabc 100644 --- a/LeanPool/EuclideanJordan/FramePeirceSolution.lean +++ b/LeanPool/EuclideanJordan/FramePeirceSolution.lean @@ -135,7 +135,7 @@ challenge file states. The contract here is that the two files' declaration typ nose, so the extra instance is kept out of every statement. -/ -@[expose] public section +public section noncomputable section @@ -225,7 +225,7 @@ structure JordanFrame (J : Type*) [NormedAddCommGroup J] [InnerProductSpace ℝ /-! ## The blocks -/ /-- The `r`-eigenspace of `L_a : x ↦ a ∘ x`, as a submodule. -/ -def eigSub (a : J) (r : ℝ) : Submodule ℝ J where +@[expose] def eigSub (a : J) (r : ℝ) : Submodule ℝ J where carrier := {x : J | a * x = r • x} add_mem' := fun {u v} hu hv => by change a * (u + v) = r • (u + v) @@ -253,7 +253,7 @@ theorem blockCoef_comm (i j : Fin n) : blockCoef i j = blockCoef j i := by /-- `V_{ij}` before it is pushed through `Sym2`: the joint `blockCoef i j`-eigenspace of `L_{pᵢ}` and `L_{pⱼ}`. On the diagonal this is `J₂(pᵢ) = {x | pᵢ ∘ x = x}`; off it, the joint `½`-eigenspace. -/ -def frameBlockRaw (F : JordanFrame J n) (i j : Fin n) : Submodule ℝ J := +@[expose] def frameBlockRaw (F : JordanFrame J n) (i j : Fin n) : Submodule ℝ J := eigSub (F.p i) (blockCoef i j) ⊓ eigSub (F.p j) (blockCoef i j) theorem frameBlockRaw_comm (F : JordanFrame J n) (i j : Fin n) : @@ -263,11 +263,11 @@ theorem frameBlockRaw_comm (F : JordanFrame J n) (i j : Fin n) : /-- **`V_{ij}`**, indexed by unordered pairs. For `i ≠ j` the joint `½`-eigenspace of `L_{pᵢ}` and `L_{pⱼ}`; on the diagonal, `J₂(pᵢ)`. -/ -def frameBlock (F : JordanFrame J n) : Sym2 (Fin n) → Submodule ℝ J := +@[expose] def frameBlock (F : JordanFrame J n) : Sym2 (Fin n) → Submodule ℝ J := Sym2.lift ⟨frameBlockRaw F, frameBlockRaw_comm F⟩ @[simp] theorem frameBlock_mk (F : JordanFrame J n) (i j : Fin n) : - frameBlock F s(i, j) = frameBlockRaw F i j := rfl + frameBlock F s(i, j) = frameBlockRaw F i j := by rfl theorem mem_frameBlock_diag {F : JordanFrame J n} {i : Fin n} {x : J} : x ∈ frameBlock F s(i, i) ↔ F.p i * x = x := by diff --git a/LeanPool/EuclideanJordan/KoecherSolution.lean b/LeanPool/EuclideanJordan/KoecherSolution.lean index 94846aef4f..5efb090d8b 100644 --- a/LeanPool/EuclideanJordan/KoecherSolution.lean +++ b/LeanPool/EuclideanJordan/KoecherSolution.lean @@ -72,7 +72,7 @@ reference library, and discharges the theorem from `EuclideanJordan.orderIso_pre local `IsSoS` is the same existential as `EuclideanJordan.IsSoS`, so the bridge is definitional. -/ -@[expose] public section +public section namespace KoecherAlfsenShultz diff --git a/LeanPool/EuclideanJordan/SpectralSolution.lean b/LeanPool/EuclideanJordan/SpectralSolution.lean index fc6c4120ba..96228ca699 100644 --- a/LeanPool/EuclideanJordan/SpectralSolution.lean +++ b/LeanPool/EuclideanJordan/SpectralSolution.lean @@ -26,7 +26,7 @@ ring on `J`, `IsCommJordan`, `IsScalarTower ℝ J J`, `IsFormallyReal J`) are bu library from `m`, `hcomm`, `hjordan` and `hfr`, and none of them escapes into the statement. -/ -@[expose] public section +public section namespace JordanSpectral diff --git a/LeanPool/EuclideanJordan/StructureSolution.lean b/LeanPool/EuclideanJordan/StructureSolution.lean index 8c860897a5..440261b92d 100644 --- a/LeanPool/EuclideanJordan/StructureSolution.lean +++ b/LeanPool/EuclideanJordan/StructureSolution.lean @@ -18,7 +18,7 @@ projections. Named adapters preserve the multiplication, unit and frame data whe the shared interface; they introduce no ambient library algebra instance into theorem headers. -/ -@[expose] public section +public section namespace EuclideanJordan.StructureSolution @@ -33,20 +33,20 @@ theorem mul_smul_comm' (r : ℝ) (a b : J) : a * (r • b) = r • (a * b) := /-- **The Jordan multiplication operator** `L_c : y ↦ c * y`, as an `ℝ`-linear map. Its `ℝ`-linearity is exactly what the scalar tower buys, and it is what makes `L_c` traceable. -/ -def mulL (c : J) : J →ₗ[ℝ] J := +@[expose] def mulL (c : J) : J →ₗ[ℝ] J := _root_.JordanTraceForm.mulL c @[simp] theorem mulL_apply (c y : J) : mulL c y = c * y := rfl /-- `L_·` bundled as a linear map in the multiplier, which is what makes `jtr` linear. -/ -def mulLₗ : J →ₗ[ℝ] J →ₗ[ℝ] J := +@[expose] def mulLₗ : J →ₗ[ℝ] J →ₗ[ℝ] J := _root_.JordanTraceForm.mulLₗ @[simp] theorem mulLₗ_apply (a : J) : mulLₗ a = mulL a := rfl /-- **The Jordan trace functional** `x ↦ tr(L_x)`, as an `ℝ`-linear form. Not normalised: see the module docstring. -/ -noncomputable def jtr : J →ₗ[ℝ] ℝ := +@[expose] noncomputable def jtr : J →ₗ[ℝ] ℝ := _root_.JordanTraceForm.jtr @[simp] theorem jtr_apply (x : J) : jtr x = LinearMap.trace ℝ J (mulL x) := rfl @@ -55,7 +55,7 @@ noncomputable def jtr : J →ₗ[ℝ] ℝ := Bilinearity is part of the type. This compatibility definition reuses the standalone trace-form construction with the same multiplication operator. -/ -noncomputable def traceForm : J →ₗ[ℝ] J →ₗ[ℝ] ℝ := +@[expose] noncomputable def traceForm : J →ₗ[ℝ] J →ₗ[ℝ] ℝ := _root_.JordanTraceForm.traceForm @[simp] theorem traceForm_apply (x y : J) : traceForm x y = jtr (x * y) := rfl @@ -237,7 +237,7 @@ def JordanFrame.toFramePeirce {n : ℕ} (F : JordanFrame J n) : /-! ## The blocks -/ /-- The `r`-eigenspace of `L_a : x ↦ a ∘ x`, as a submodule. -/ -def eigSub (a : J) (r : ℝ) : Submodule ℝ J := +@[expose] def eigSub (a : J) (r : ℝ) : Submodule ℝ J := letI := EuclideanJordanAlgebra.toFramePeirce (J := J) _root_.JordanFramePeirce.eigSub a r @@ -255,7 +255,7 @@ theorem blockCoef_comm (i j : Fin n) : blockCoef i j = blockCoef j i := /-- `V_{ij}` before it is pushed through `Sym2`: the joint `blockCoef i j`-eigenspace of `L_{pᵢ}` and `L_{pⱼ}`. On the diagonal this is `J₂(pᵢ) = {x | pᵢ ∘ x = x}`; off it, the joint `½`-eigenspace. -/ -def frameBlockRaw (F : JordanFrame J n) (i j : Fin n) : Submodule ℝ J := +@[expose] def frameBlockRaw (F : JordanFrame J n) (i j : Fin n) : Submodule ℝ J := letI := EuclideanJordanAlgebra.toFramePeirce (J := J) _root_.JordanFramePeirce.frameBlockRaw F.toFramePeirce i j @@ -266,7 +266,7 @@ theorem frameBlockRaw_comm (F : JordanFrame J n) (i j : Fin n) : /-- **`V_{ij}`**, indexed by unordered pairs. For `i ≠ j` the joint `½`-eigenspace of `L_{pᵢ}` and `L_{pⱼ}`; on the diagonal, `J₂(pᵢ)`. -/ -def frameBlock (F : JordanFrame J n) : Sym2 (Fin n) → Submodule ℝ J := +@[expose] def frameBlock (F : JordanFrame J n) : Sym2 (Fin n) → Submodule ℝ J := letI := EuclideanJordanAlgebra.toFramePeirce (J := J) _root_.JordanFramePeirce.frameBlock F.toFramePeirce diff --git a/LeanPool/EuclideanJordan/TraceFormSolution.lean b/LeanPool/EuclideanJordan/TraceFormSolution.lean index c358a1f2af..e9c0d80047 100644 --- a/LeanPool/EuclideanJordan/TraceFormSolution.lean +++ b/LeanPool/EuclideanJordan/TraceFormSolution.lean @@ -31,7 +31,7 @@ The one piece of real work is formal reality. The challenge states it as a hypot only by reindexing along `Finset.equivFin`, done inline in each of the two positivity proofs. -/ -@[expose] public section +public section namespace JordanTraceForm @@ -44,6 +44,7 @@ theorem mul_smul_comm' (r : ℝ) (a b : J) : a * (r • b) = r • (a * b) := by /-- **The Jordan multiplication operator** `L_c : y ↦ c * y`, as an `ℝ`-linear map. Its `ℝ`-linearity is exactly what the scalar tower buys, and it is what makes `L_c` traceable. -/ +@[expose] def mulL (c : J) : J →ₗ[ℝ] J where toFun y := c * y map_add' := mul_add c @@ -52,6 +53,7 @@ def mulL (c : J) : J →ₗ[ℝ] J where @[simp] theorem mulL_apply (c y : J) : mulL c y = c * y := rfl /-- `L_·` bundled as a linear map in the multiplier, which is what makes `jtr` linear. -/ +@[expose] def mulLₗ : J →ₗ[ℝ] J →ₗ[ℝ] J where toFun := mulL map_add' a b := by ext y; simp only [mulL_apply, LinearMap.add_apply, add_mul] @@ -63,6 +65,7 @@ def mulLₗ : J →ₗ[ℝ] J →ₗ[ℝ] J where /-- **The Jordan trace functional** `x ↦ tr(L_x)`, as an `ℝ`-linear form. Not normalised: see the module docstring. -/ +@[expose] noncomputable def jtr : J →ₗ[ℝ] ℝ := (LinearMap.trace ℝ J).comp mulLₗ @[simp] theorem jtr_apply (x : J) : jtr x = LinearMap.trace ℝ J (mulL x) := rfl @@ -72,6 +75,7 @@ noncomputable def jtr : J →ₗ[ℝ] ℝ := (LinearMap.trace ℝ J).comp mulL Bilinearity is not a theorem below because it is the *type*: the four `mk₂` fields are additivity and homogeneity in each argument, and they are immediate from linearity of `jtr` and bilinearity of the product. -/ +@[expose] noncomputable def traceForm : J →ₗ[ℝ] J →ₗ[ℝ] ℝ := LinearMap.mk₂ ℝ (fun x y => jtr (x * y)) (fun x x' y => by rw [add_mul, map_add]) 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 6400a3e828..2f07beead3 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 fa761ac529..f50b8930ae 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) : @@ -214,7 +214,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 bd58c23c09..0d413851a5 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 a2b3f0ee6a..66e2a80f95 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 b00c9a8da4..93af8f1ee5 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 34e28dd4c3..f181e61217 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 75056918ff..9581a7bdef 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 2d6f37636d..f9a19e6dbe 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/FullyDynamicMatching/FD1D/Arithmetic.lean b/LeanPool/FullyDynamicMatching/FD1D/Arithmetic.lean index e80c0d10ce..3033d7d817 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/Arithmetic.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/Arithmetic.lean @@ -10,7 +10,7 @@ public import LeanPool.FullyDynamicMatching.FD1D.Basic /-! # Arithmetic -/ -@[expose] public section +public section namespace FD1D diff --git a/LeanPool/FullyDynamicMatching/FD1D/Averaging.lean b/LeanPool/FullyDynamicMatching/FD1D/Averaging.lean index 63512281f2..31b5e38b7f 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/Averaging.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/Averaging.lean @@ -10,7 +10,7 @@ public import LeanPool.FullyDynamicMatching.FD1D.Expectations /-! # Averaging -/ -@[expose] public section +public section namespace FD1D @@ -26,6 +26,7 @@ variable {α : Type*} [Fintype α] Choose a time uniformly from `Fin T`, then sample from the law assigned to that time. -/ +@[expose] def timeAverage {T : ℕ} (hT : 0 < T) (μ : Fin T → FiniteLaw α) : FiniteLaw (Fin T × α) where mass z := (1 / (T : ℝ)) * (μ z.1).mass z.2 @@ -92,6 +93,7 @@ theorem expect_timeAverage_state {T : ℕ} (hT : 0 < T) simpa using expect_timeAverage_eq_sum_range hT μ (fun _ => f) /-- Lift a state permutation without changing the sampled time. -/ +@[expose] def timeLiftPerm {T : ℕ} (e : Equiv.Perm α) : Equiv.Perm (Fin T × α) := (Equiv.refl (Fin T)).prodCongr e diff --git a/LeanPool/FullyDynamicMatching/FD1D/Basic.lean b/LeanPool/FullyDynamicMatching/FD1D/Basic.lean index 4cb216af96..faab892a6a 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/Basic.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/Basic.lean @@ -24,13 +24,14 @@ bound. All analytic quantities are represented in `ℝ`; finite probability laws are represented by weighted sums over finite types. -/ -@[expose] public section +public section namespace FD1D noncomputable section /-- The regularizing parameter used by the policy. -/ +@[expose] def policyA (m : ℕ) : ℕ := 200 * ⌈Real.logb 2 (m + 1)⌉₊ /-- A probability mass function on a finite type, represented without quotienting. -/ @@ -45,6 +46,7 @@ namespace FiniteLaw variable {α β : Type*} [Fintype α] [Fintype β] /-- Expectation of a real observable under the finite law. -/ +@[expose] def expect (μ : FiniteLaw α) (f : α → ℝ) : ℝ := ∑ x, μ.mass x * f x diff --git a/LeanPool/FullyDynamicMatching/FD1D/Bellman.lean b/LeanPool/FullyDynamicMatching/FD1D/Bellman.lean index dc7dcdf3b6..c273d6089d 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/Bellman.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/Bellman.lean @@ -10,7 +10,7 @@ public import LeanPool.FullyDynamicMatching.FD1D.PolynomialCertificate /-! # Bellman -/ -@[expose] public section +public section namespace FD1D @@ -26,14 +26,17 @@ surrounding lemmas connect them to the real-valued Bellman residual. -/ /-- The cubic scalar weight in the Bellman function. -/ +@[expose] def d (y : ℝ) : ℝ := (1 + 7 * y ^ 3) / 12 /-- The Bellman function from equation (6). -/ +@[expose] def B (h t y : ℝ) : ℝ := d y * (t - y * h) * (2 * h - t - (3 / 2 : ℝ) * y * h) /-- `W = w²` in the normalized local variables. -/ +@[expose] def normalizedW (s v : ℝ) : ℝ := s * (1 + v) * v / (s + 2) diff --git a/LeanPool/FullyDynamicMatching/FD1D/Bounds.lean b/LeanPool/FullyDynamicMatching/FD1D/Bounds.lean index e4ad638f30..f96ebca07c 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/Bounds.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/Bounds.lean @@ -11,7 +11,7 @@ public import LeanPool.FullyDynamicMatching.FD1D.Expectations /-! # Bounds -/ -@[expose] public section +public section namespace FD1D diff --git a/LeanPool/FullyDynamicMatching/FD1D/ConcreteTransport.lean b/LeanPool/FullyDynamicMatching/FD1D/ConcreteTransport.lean index a9cfcad20d..d99716cf5c 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/ConcreteTransport.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/ConcreteTransport.lean @@ -13,7 +13,7 @@ public import LeanPool.FullyDynamicMatching.FD1D.Spatial /-! # Concrete Transport -/ -@[expose] public section +public section namespace FD1D @@ -35,6 +35,7 @@ namespace HierarchicalDynamics variable {L m : ℕ} /-- The deletion-mass tree below `v`, with `k` levels still to descend. -/ +@[expose] def stateDyadicMassAt (a : ℝ) (x : InventoryState (DyadicNode L) m) : (d k : ℕ) → DyadicNode d → DyadicMass k @@ -258,6 +259,7 @@ theorem stateDyadicMass_haarSeries_eq exact stateDyadicMass_nodeCoefficient a ha x i /-- The concrete coefficient family in the canonical complete-tree index. -/ +@[expose] def stateHaarCoefficient (a : ℝ) (x : InventoryState (DyadicNode L) m) (i : CompleteHaarNode L) : ℝ := diff --git a/LeanPool/FullyDynamicMatching/FD1D/Drift.lean b/LeanPool/FullyDynamicMatching/FD1D/Drift.lean index 6c469fb92e..9c4cfbe36f 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/Drift.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/Drift.lean @@ -10,7 +10,7 @@ public import LeanPool.FullyDynamicMatching.FD1D.Arithmetic /-! # Drift -/ -@[expose] public section +public section namespace FD1D @@ -26,6 +26,7 @@ stationary and finite-horizon arguments. -/ /-- The finite harmonic potential used at a node with inventory `k`. -/ +@[expose] def harmonicPotential (a : ℝ) (k : ℕ) : ℝ := ∑ j ∈ Finset.Icc 1 k, 1 / (j + a) diff --git a/LeanPool/FullyDynamicMatching/FD1D/Dynamics.lean b/LeanPool/FullyDynamicMatching/FD1D/Dynamics.lean index 4beb130e08..5b951d640c 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/Dynamics.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/Dynamics.lean @@ -13,7 +13,7 @@ public import LeanPool.FullyDynamicMatching.FD1D.PotentialBounds /-! # Dynamics -/ -@[expose] public section +public section namespace FD1D @@ -34,12 +34,14 @@ namespace HierarchicalDynamics variable {L m : ℕ} /-- Regard a fixed-total count vector as a leaf inventory. -/ +@[expose] def leafInventory (x : InventoryState (DyadicNode L) m) : LeafInventory L m where count := x.1 total_count := x.2 /-- Canonical coherent counts associated with a count-chain state. -/ +@[expose] def aggregatedInventory (x : InventoryState (DyadicNode L) m) : AggregatedInventory L m := (leafInventory x).aggregate @@ -65,6 +67,7 @@ theorem aggregatedInventory_count LeafInventory.nodeCount, leafInventory, hdL] /-- Leaf deletion probabilities prescribed by the hierarchical policy. -/ +@[expose] def deletionRule (a : ℝ) (ha : 0 < a) (hm : 0 < m) : DeletionRule (DyadicNode L) m where prob x w := @@ -94,6 +97,7 @@ def deletionRule (a : ℝ) (ha : 0 < a) (hm : 0 < m) : rfl /-- Delete according to the hierarchical rule, then add a uniform leaf. -/ +@[expose] def kernel (a : ℝ) (ha : 0 < a) (hm : 0 < m) : FiniteKernel (InventoryState (DyadicNode L) m) := (deletionRule a ha hm).kernel @@ -321,6 +325,7 @@ theorem deletionMarginal_eq (coherent_eq_sum_leafBlock q hdL v).symm /-- Probability that a uniform arriving leaf lies below a given node. -/ +@[expose] def arrivalMarginal {d : ℕ} (hdL : d ≤ L) (v : DyadicNode d) : ℝ := ∑ _w ∈ leafBlock hdL v, (1 / Fintype.card (DyadicNode L) : ℝ) @@ -605,16 +610,19 @@ theorem kernel_expected_nodePotentialChange /-! ## Global state observables and exact kernel drift -/ /-- Coherent natural count label of a count-chain state. -/ +@[expose] def countLabel (x : InventoryState (DyadicNode L) m) : ∀ d, DyadicNode d → ℕ := (aggregatedInventory x).count /-- Hierarchical deletion mass at every tree node. -/ +@[expose] def deletionLabel (a : ℝ) (x : InventoryState (DyadicNode L) m) : ∀ d, DyadicNode d → ℝ := HierarchicalPolicy.deletionMass (aggregatedInventory x) a /-- Extended policy hazard at every tree node. -/ +@[expose] def hazardLabel (a : ℝ) (x : InventoryState (DyadicNode L) m) : ∀ d, DyadicNode d → ℝ := HierarchicalPolicy.hazard (aggregatedInventory x) a @@ -635,6 +643,7 @@ def stateRemainder (a : ℝ) potentialRemainder L a (countLabel x) (deletionLabel a x) /-- Hazard energy at one level in a count-chain state. -/ +@[expose] def stateHazardEnergy (a : ℝ) (x : InventoryState (DyadicNode L) m) (d : ℕ) : ℝ := hazardEnergy (hazardLabel a x) d diff --git a/LeanPool/FullyDynamicMatching/FD1D/Expectations.lean b/LeanPool/FullyDynamicMatching/FD1D/Expectations.lean index 1ce4871459..f98a5e8fc1 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/Expectations.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/Expectations.lean @@ -10,7 +10,7 @@ public import LeanPool.FullyDynamicMatching.FD1D.Markov /-! # Expectations -/ -@[expose] public section +public section namespace FD1D diff --git a/LeanPool/FullyDynamicMatching/FD1D/FinalArithmetic.lean b/LeanPool/FullyDynamicMatching/FD1D/FinalArithmetic.lean index 1a644c98f4..1ba499ed23 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/FinalArithmetic.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/FinalArithmetic.lean @@ -19,7 +19,7 @@ the advertised `6a/m` and `7a/m` bounds. Transport enters only through an equation-(3) inequality supplied as a hypothesis. -/ -@[expose] public section +public section namespace FD1D @@ -29,6 +29,7 @@ open scoped BigOperators /-- The concrete hierarchical count kernel with the paper's parameter and tree depth. -/ +@[expose] def parameterizedKernel (m : ℕ) (hm : 1 ≤ m) : FiniteKernel (InventoryState (DyadicNode (treeDepth m)) m) := @@ -37,6 +38,7 @@ def parameterizedKernel (m : ℕ) (hm : 1 ≤ m) : (parameterA_cast_pos hm) (by omega) /-- Terminal hazard energy for the paper's parameter and tree depth. -/ +@[expose] def parameterizedHazardEnergy (m : ℕ) (x : InventoryState (DyadicNode (treeDepth m)) m) : ℝ := HierarchicalDynamics.stateHazardEnergy diff --git a/LeanPool/FullyDynamicMatching/FD1D/FiniteConvergence.lean b/LeanPool/FullyDynamicMatching/FD1D/FiniteConvergence.lean index 7ae2a66cf2..b75c1d651b 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/FiniteConvergence.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/FiniteConvergence.lean @@ -10,7 +10,7 @@ public import LeanPool.FullyDynamicMatching.FD1D.Expectations /-! # Finite Convergence -/ -@[expose] public section +public section namespace FD1D diff --git a/LeanPool/FullyDynamicMatching/FD1D/Hazard.lean b/LeanPool/FullyDynamicMatching/FD1D/Hazard.lean index a6f38519e4..15c7995f1b 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/Hazard.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/Hazard.lean @@ -10,7 +10,7 @@ public import LeanPool.FullyDynamicMatching.FD1D.Basic /-! # Hazard -/ -@[expose] public section +public section namespace FD1D @@ -31,9 +31,11 @@ keeps all `q = N * h` propagation identities valid without a separate API. namespace LocalHazard /-- The parent count, coerced to `ℝ`. -/ +@[expose] def N (x y : ℕ) : ℝ := (x : ℝ) + (y : ℝ) /-- The denominator `D = 2xy + a(x+y)` at a nonempty parent. -/ +@[expose] def D (a : ℝ) (x y : ℕ) : ℝ := 2 * (x : ℝ) * (y : ℝ) + a * N x y @@ -46,26 +48,33 @@ def dR (a : ℝ) (x y : ℕ) : ℝ := if x + y = 0 then 1 / 2 else (y : ℝ) * ((x : ℝ) + a) / D a x y /-- The left child hazard, including the paper's extension at an empty node. -/ +@[expose] def hL (a h : ℝ) (x y : ℕ) : ℝ := if x + y = 0 then h else h * N x y * ((y : ℝ) + a) / D a x y /-- The right child hazard, including the paper's extension at an empty node. -/ +@[expose] def hR (a h : ℝ) (x y : ℕ) : ℝ := if x + y = 0 then h else h * N x y * ((x : ℝ) + a) / D a x y /-- Parent deletion mass under the invariant `q = N h`. -/ +@[expose] def q (h : ℝ) (x y : ℕ) : ℝ := N x y * h /-- Left deletion mass obtained from the policy split. -/ +@[expose] def qL (a h : ℝ) (x y : ℕ) : ℝ := q h x y * dL a x y /-- Right deletion mass obtained from the policy split. -/ +@[expose] def qR (a h : ℝ) (x y : ℕ) : ℝ := q h x y * dR a x y /-- The signed child-mass imbalance `b = q_L - q_R`. -/ +@[expose] def b (a h : ℝ) (x y : ℕ) : ℝ := qL a h x y - qR a h x y /-- The average hazard increment in `h_L = h + V + w`. -/ +@[expose] def V (a h : ℝ) (x y : ℕ) : ℝ := (hL a h x y + hR a h x y) / 2 - h /-- The antisymmetric hazard increment in `h_L = h + V + w`. -/ @@ -75,12 +84,15 @@ def w (a h : ℝ) (x y : ℕ) : ℝ := (hL a h x y - hR a h x y) / 2 def rho (x y : ℕ) : ℝ := ((x : ℝ) - (y : ℝ)) / N x y /-- The parent discrepancy variable `t = (p-q)/a`. -/ +@[expose] def t (a p h : ℝ) (x y : ℕ) : ℝ := (p - q h x y) / a /-- The left child discrepancy variable. -/ +@[expose] def tL (a p h : ℝ) (x y : ℕ) : ℝ := (p / 2 - qL a h x y) / a /-- The right child discrepancy variable. -/ +@[expose] def tR (a p h : ℝ) (x y : ℕ) : ℝ := (p / 2 - qR a h x y) / a theorem N_nonneg (x y : ℕ) : 0 ≤ N x y := by diff --git a/LeanPool/FullyDynamicMatching/FD1D/Initialization.lean b/LeanPool/FullyDynamicMatching/FD1D/Initialization.lean index becf11c16b..40acbfca69 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/Initialization.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/Initialization.lean @@ -11,7 +11,7 @@ public import LeanPool.FullyDynamicMatching.FD1D.Tree /-! # Initialization -/ -@[expose] public section +public section namespace FD1D @@ -34,6 +34,7 @@ abbrev Assignment (ι : Type*) (m : ℕ) := Fin m → ι abbrev DyadicAssignment (L m : ℕ) := Assignment (DyadicNode L) m /-- Number of labels assigned to one location. -/ +@[expose] def assignmentCount {ι : Type*} [DecidableEq ι] {m : ℕ} (ω : Assignment ι m) (i : ι) : ℕ := (Finset.univ.filter fun j => ω j = i).card @@ -48,6 +49,7 @@ theorem sum_assignmentCount {ι : Type*} [Fintype ι] [DecidableEq ι] simp /-- The fixed-total inventory state formed from assignment fiber cardinalities. -/ +@[expose] def assignmentState {ι : Type*} [Fintype ι] [DecidableEq ι] {m : ℕ} (ω : Assignment ι m) : InventoryState ι m := ⟨assignmentCount ω, sum_assignmentCount ω⟩ @@ -59,6 +61,7 @@ theorem assignmentState_count {ι : Type*} [Fintype ι] rfl /-- Postcompose every assignment with a location permutation. -/ +@[expose] def assignmentPerm {ι : Type*} {m : ℕ} (e : Equiv.Perm ι) : Equiv.Perm (Assignment ι m) := Equiv.arrowCongr (Equiv.refl (Fin m)) e @@ -70,6 +73,7 @@ theorem assignmentPerm_apply {ι : Type*} {m : ℕ} rfl /-- Push a fixed-total count vector forward along a location permutation. -/ +@[expose] def inventoryStatePerm {ι : Type*} [Fintype ι] {m : ℕ} (e : Equiv.Perm ι) : Equiv.Perm (InventoryState ι m) where toFun x := @@ -144,6 +148,7 @@ theorem uniform_map_lawInvariant /-- The refreshed inventory law: choose every labeled item's leaf uniformly and independently, then forget the labels and retain only fiber counts. -/ +@[expose] def refreshedLaw (L m : ℕ) : FiniteLaw (InventoryState (DyadicNode L) m) := (FiniteLaw.uniform : FiniteLaw (DyadicAssignment L m)).map assignmentState diff --git a/LeanPool/FullyDynamicMatching/FD1D/InvariantTransport.lean b/LeanPool/FullyDynamicMatching/FD1D/InvariantTransport.lean index 712b0bb40b..00d81ceeea 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/InvariantTransport.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/InvariantTransport.lean @@ -14,7 +14,7 @@ public import LeanPool.FullyDynamicMatching.FD1D.Averaging /-! # Invariant Transport -/ -@[expose] public section +public section namespace FD1D diff --git a/LeanPool/FullyDynamicMatching/FD1D/KernelBridge.lean b/LeanPool/FullyDynamicMatching/FD1D/KernelBridge.lean index ae71958bc9..ec81135e14 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/KernelBridge.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/KernelBridge.lean @@ -10,7 +10,7 @@ public import LeanPool.FullyDynamicMatching.FD1D.MeasureBridge /-! # Kernel Bridge -/ -@[expose] public section +public section namespace FD1D @@ -40,6 +40,7 @@ theorem measure_ext_of_singletons [Finite α] [MeasurableSpace α] Measure.ext_of_singleton h /-- The independent product of two finite laws. -/ +@[expose] def product (μ : FiniteLaw α) (ν : FiniteLaw β) : FiniteLaw (α × β) where mass p := μ.mass p.1 * ν.mass p.2 diff --git a/LeanPool/FullyDynamicMatching/FD1D/Markov.lean b/LeanPool/FullyDynamicMatching/FD1D/Markov.lean index 1643f66b24..55fdf5fe86 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/Markov.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/Markov.lean @@ -10,7 +10,7 @@ public import LeanPool.FullyDynamicMatching.FD1D.Basic /-! # Markov -/ -@[expose] public section +public section namespace FD1D @@ -45,6 +45,7 @@ theorem ext {μ ν : FiniteLaw α} (h : ∀ x, μ.mass x = ν.mass x) : μ = ν rfl /-- The point mass at `x`. -/ +@[expose] def dirac [DecidableEq α] (x : α) : FiniteLaw α where mass y := if y = x then 1 else 0 mass_nonneg y := by split_ifs <;> positivity @@ -56,6 +57,7 @@ theorem mass_dirac [DecidableEq α] (x y : α) : rfl /-- The uniform law on a nonempty finite type. -/ +@[expose] def uniform [Nonempty α] : FiniteLaw α where mass _ := 1 / Fintype.card α mass_nonneg _ := by positivity @@ -71,6 +73,7 @@ theorem mass_uniform [Nonempty α] (x : α) : rfl /-- Push a finite law forward along a map. -/ +@[expose] def map [DecidableEq β] (f : α → β) (μ : FiniteLaw α) : FiniteLaw β where mass y := ∑ x with f x = y, μ.mass x mass_nonneg y := Finset.sum_nonneg fun x _ => μ.mass_nonneg x @@ -110,6 +113,7 @@ theorem matrix_rowStochastic [DecidableEq α] (K : FiniteKernel α) : exact ⟨K.trans_nonneg, K.sum_trans⟩ /-- Advance a law by one step of the kernel. -/ +@[expose] def step (K : FiniteKernel α) (μ : FiniteLaw α) : FiniteLaw α where mass y := ∑ x, μ.mass x * K x y mass_nonneg y := @@ -125,6 +129,7 @@ theorem mass_step (K : FiniteKernel α) (μ : FiniteLaw α) (y : α) : rfl /-- The law after `n` steps. -/ +@[expose] def iterate (K : FiniteKernel α) : ℕ → FiniteLaw α → FiniteLaw α | 0, μ => μ | n + 1, μ => K.step (K.iterate n μ) @@ -205,6 +210,7 @@ theorem iterate_dirac [DecidableEq α] (K : FiniteKernel α) simp [FiniteLaw.mass_dirac] /-- A law is stationary when one step leaves it unchanged. -/ +@[expose] def IsStationary (K : FiniteKernel α) (μ : FiniteLaw α) : Prop := K.step μ = μ @@ -370,10 +376,12 @@ theorem exists_stationary [Nonempty α] simpa [IsStationary, step, π, Matrix.vecMul, dotProduct, matrix] using hy /-- Reachability by a positive-probability path. -/ +@[expose] def Reaches [DecidableEq α] (K : FiniteKernel α) (x y : α) : Prop := ∃ n : ℕ, 0 < K.pow n x y /-- Every state can be reached from every other state. -/ +@[expose] def Irreducible [DecidableEq α] (K : FiniteKernel α) : Prop := ∀ x y, K.Reaches x y @@ -496,16 +504,19 @@ theorem stationary_unique [DecidableEq α] [Nonempty α] rw [hmass x, ← hsum, one_mul] /-- Strictly positive one-step self-loops. -/ +@[expose] def HasPositiveLoops (K : FiniteKernel α) : Prop := ∀ x, 0 < K x x /-! ## Equivariance and invariant laws -/ /-- Equivariance of a kernel under a permutation of its state space. -/ +@[expose] def Equivariant (K : FiniteKernel α) (e : Equiv.Perm α) : Prop := ∀ x y, K (e x) (e y) = K x y /-- Invariance of a law under a permutation of its state space. -/ +@[expose] def LawInvariant (μ : FiniteLaw α) (e : Equiv.Perm α) : Prop := ∀ x, μ.mass (e x) = μ.mass x @@ -669,6 +680,7 @@ instance (m : ℕ) : DecidableEq (InventoryState ι m) := /-- The count vector after deleting at `d` and arriving at `a`. If `d` is empty, this is defined to be the original state. -/ +@[expose] def move {m : ℕ} (x : InventoryState ι m) (d a : ι) : InventoryState ι m := if hd : 0 < x.1 d then let removed := Function.update x.1 d (x.1 d - 1) @@ -750,6 +762,7 @@ variable {ι : Type*} [Fintype ι] [DecidableEq ι] [Nonempty ι] {m : ℕ} /-- Transition probability: delete according to `R`, then independently arrive at a uniformly chosen leaf. -/ +@[expose] def kernel (R : DeletionRule ι m) : FiniteKernel (InventoryState ι m) where trans x y := ∑ d, ∑ a, if InventoryState.move x d a = y then diff --git a/LeanPool/FullyDynamicMatching/FD1D/MeasureBridge.lean b/LeanPool/FullyDynamicMatching/FD1D/MeasureBridge.lean index bde9453bbc..157ea27f09 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/MeasureBridge.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/MeasureBridge.lean @@ -15,7 +15,7 @@ public import LeanPool.FullyDynamicMatching.FD1D.Realization /-! # Measure Bridge -/ -@[expose] public section +public section namespace FD1D @@ -39,6 +39,7 @@ namespace FiniteLaw variable {α β Ω : Type*} [Fintype α] /-- The probability mass function represented by a `FiniteLaw`. -/ +@[expose] def toPMF (μ : FiniteLaw α) : PMF α := PMF.ofFintype (fun x => ENNReal.ofReal (μ.mass x)) (by rw [← ENNReal.ofReal_sum_of_nonneg @@ -56,6 +57,7 @@ The probability measure represented by a `FiniteLaw`. On a finite type it is enough to assume measurable singletons: this already makes every function from the type measurable. -/ +@[expose] def toMeasure [MeasurableSpace α] (μ : FiniteLaw α) : Measure α := μ.toPMF.toMeasure @@ -145,6 +147,7 @@ namespace FiniteKernel variable {α : Type*} [Fintype α] /-- The probability law represented by one row of a finite kernel. -/ +@[expose] def rowLaw (K : FiniteKernel α) (x : α) : FiniteLaw α where mass := K x mass_nonneg := K.trans_nonneg x @@ -156,6 +159,7 @@ theorem rowLaw_mass (K : FiniteKernel α) (x y : α) : rfl /-- A project `FiniteKernel`, viewed as a Mathlib Markov kernel. -/ +@[expose] noncomputable def toKernel [MeasurableSpace α] [MeasurableSingletonClass α] (K : FiniteKernel α) : Kernel α α where toFun x := (K.rowLaw x).toMeasure diff --git a/LeanPool/FullyDynamicMatching/FD1D/Parameters.lean b/LeanPool/FullyDynamicMatching/FD1D/Parameters.lean index 36b7456505..0b7f4bf2ad 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/Parameters.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/Parameters.lean @@ -16,7 +16,7 @@ computationally exact. Natural-number division is the floor in the definition of the tree depth. -/ -@[expose] public section +public section namespace FD1D @@ -25,6 +25,7 @@ noncomputable section open Filter Asymptotics /-- The regularization parameter `a = 200 * ceil(log₂(m+1))`. -/ +@[expose] def parameterA (m : ℕ) : ℕ := 200 * Nat.clog 2 (m + 1) @@ -33,10 +34,12 @@ def depthTarget (m : ℕ) : ℕ := max 1 (m / parameterA m) /-- The depth of the complete dyadic tree. -/ +@[expose] def treeDepth (m : ℕ) : ℕ := Nat.log 2 (depthTarget m) /-- The number `n = 2^L` of leaves in the complete dyadic tree. -/ +@[expose] def leafCount (m : ℕ) : ℕ := 2 ^ treeDepth m diff --git a/LeanPool/FullyDynamicMatching/FD1D/Policy.lean b/LeanPool/FullyDynamicMatching/FD1D/Policy.lean index c4a9e1c933..0c34626197 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/Policy.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/Policy.lean @@ -12,7 +12,7 @@ public import LeanPool.FullyDynamicMatching.FD1D.Bellman /-! # Policy -/ -@[expose] public section +public section namespace FD1D @@ -34,10 +34,12 @@ open LocalHazard variable {L m : ℕ} /-- Select the appropriate extended child hazard. -/ +@[expose] def childHazard (a h : ℝ) (x y : ℕ) (side : Fin 2) : ℝ := if side = 0 then hL a h x y else hR a h x y /-- The recursively propagated extended hazard, rooted at `1 / m`. -/ +@[expose] def hazard (I : AggregatedInventory L m) (a : ℝ) : ∀ d, DyadicNode d → ℝ | 0, _ => 1 / (m : ℝ) @@ -48,37 +50,44 @@ def hazard (I : AggregatedInventory L m) (a : ℝ) : (I.count (d + 1) (rightChild z.1)) z.2 /-- Inventory counts, coerced to reals. -/ +@[expose] def inventory (I : AggregatedInventory L m) (d : ℕ) (v : DyadicNode d) : ℝ := I.count d v /-- Conditional left-child deletion probability at an internal node. -/ +@[expose] def splitLeft (I : AggregatedInventory L m) (a : ℝ) (d : ℕ) (v : DyadicNode d) : ℝ := dL a (I.count (d + 1) (leftChild v)) (I.count (d + 1) (rightChild v)) /-- Conditional right-child deletion probability at an internal node. -/ +@[expose] def splitRight (I : AggregatedInventory L m) (a : ℝ) (d : ℕ) (v : DyadicNode d) : ℝ := dR a (I.count (d + 1) (leftChild v)) (I.count (d + 1) (rightChild v)) /-- Deletion mass `q_v = N_v h_v`. -/ +@[expose] def deletionMass (I : AggregatedInventory L m) (a : ℝ) (d : ℕ) (v : DyadicNode d) : ℝ := inventory I d v * hazard I a d v /-- Interval mass `p_v`. -/ +@[expose] def intervalMass (d : ℕ) (v : DyadicNode d) : ℝ := nodeMass d v /-- Discrepancy `t_v = (p_v - q_v) / a`. -/ +@[expose] def discrepancy (I : AggregatedInventory L m) (a : ℝ) (d : ℕ) (v : DyadicNode d) : ℝ := (intervalMass d v - deletionMass I a d v) / a /-- Reciprocal regularized count `Z_v = p_v / (N_v + a)`. -/ +@[expose] def regularizedMass (I : AggregatedInventory L m) (a : ℝ) (d : ℕ) (v : DyadicNode d) : ℝ := intervalMass d v / (inventory I d v + a) @@ -436,6 +445,7 @@ theorem discrepancy_div_hazard_le_bellmanY exact div_le_div_of_nonneg_right hbase hh.le /-- The signed imbalance at an internal node. -/ +@[expose] def imbalance (I : AggregatedInventory L m) (a : ℝ) (d : ℕ) (v : DyadicNode d) : ℝ := deletionMass I a (d + 1) (leftChild v) - diff --git a/LeanPool/FullyDynamicMatching/FD1D/PolynomialCertificate.lean b/LeanPool/FullyDynamicMatching/FD1D/PolynomialCertificate.lean index e3b18da7dd..ce0a1fad51 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/PolynomialCertificate.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/PolynomialCertificate.lean @@ -18,7 +18,7 @@ coefficient in the four Bellman charts without materializing enormous `ring_nf` goals. -/ -@[expose] public section +public section namespace FD1D @@ -33,6 +33,7 @@ deriving DecidableEq, Repr namespace DPoly /-- The dense representation of a constant polynomial. -/ +@[expose] def const (a : R) : DPoly R := ⟨[a]⟩ /-- Coefficientwise addition, extending the shorter list by zeros. -/ @@ -92,12 +93,14 @@ instance (n : ℕ) [OfNat R (n + 2)] : OfNat (DPoly R) (n + 2) := def X [Zero R] [One R] : DPoly R := ⟨[0, 1]⟩ /-- Horner evaluation of a coefficient list after applying the coefficient map. -/ +@[expose] def evalCoeffs [Zero S] [Add S] [Mul S] (f : R → S) (x : S) : List R → S | [] => 0 | a :: p => f a + x * evalCoeffs f x p /-- Evaluation of a dense polynomial using the given coefficient map. -/ +@[expose] def eval [Zero S] [Add S] [Mul S] (f : R → S) (x : S) (p : DPoly R) : S := evalCoeffs f x p.coeffs @@ -219,14 +222,17 @@ def V : Poly3 := DPoly.const DPoly.X def Z : Poly3 := DPoly.const (DPoly.const DPoly.X) /-- Real evaluation of an integer polynomial at its single argument. -/ +@[expose] def eval1 (p : DPoly ℤ) (z : ℝ) : ℝ := DPoly.eval (fun c : ℤ => (c : ℝ)) z p /-- Real evaluation of a nested polynomial at the middle and innermost variables. -/ +@[expose] def eval2 (p : DPoly (DPoly ℤ)) (v z : ℝ) : ℝ := DPoly.eval (fun q => eval1 q z) v p /-- Real evaluation of a three-variable integer polynomial. -/ +@[expose] def eval3 (p : Poly3) (u v z : ℝ) : ℝ := DPoly.eval (fun q => eval2 q v z) u p @@ -452,6 +458,7 @@ def projectiveBellmanAt (den s num v : Poly3) : Poly3 := 12 * den ^ 5 * BB ^ 5 * M ^ 5 * (S * (A ^ 2 - 1) + W0) /-- Real-valued expression corresponding to the affine Bellman polynomial. -/ +@[expose] def bellmanRealAt (s r v : ℝ) : ℝ := let A := 1 + v let S := s + 2 diff --git a/LeanPool/FullyDynamicMatching/FD1D/Potential.lean b/LeanPool/FullyDynamicMatching/FD1D/Potential.lean index 2b50792f8b..3132b5ca62 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/Potential.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/Potential.lean @@ -11,7 +11,7 @@ public import LeanPool.FullyDynamicMatching.FD1D.Drift /-! # Potential -/ -@[expose] public section +public section namespace FD1D @@ -32,6 +32,7 @@ open scoped BigOperators /-! ## One-node deletion/arrival experiment -/ /-- Probability mass of a Bernoulli outcome. -/ +@[expose] def bernoulliMass (r : ℝ) (outcome : Bool) : ℝ := if outcome then r else 1 - r @@ -39,6 +40,7 @@ def bernoulliMass (r : ℝ) (outcome : Bool) : ℝ := The new count after a deletion followed by an arrival. The hypotheses used below ensure that deletion has probability zero when the old count is zero. -/ +@[expose] def updateCount (N : ℕ) (deleted arrived : Bool) : ℕ := if deleted then if arrived then N else N - 1 @@ -46,6 +48,7 @@ def updateCount (N : ℕ) (deleted arrived : Bool) : ℕ := if arrived then N + 1 else N /-- Expected change of one harmonic potential under independent Bernoulli events. -/ +@[expose] def expectedNodePotentialChange (a : ℝ) (N : ℕ) (p q : ℝ) : ℝ := ∑ deleted : Bool, ∑ arrived : Bool, @@ -70,18 +73,21 @@ theorem expectedNodePotentialChange_eq /-! ## Global potential, drift, and remainder -/ /-- `Phi = sum_{v ≠ root} p_v² phi(N_v)`. -/ +@[expose] def globalHarmonicPotential (L : ℕ) (a : ℝ) (N : ∀ d, DyadicNode d → ℕ) : ℝ := ∑ d ∈ Finset.range L, ∑ v : DyadicNode (d + 1), (nodeMass (d + 1) v) ^ 2 * harmonicPotential a (N (d + 1) v) /-- `D`, with natural inventory counts coerced to reals. -/ +@[expose] def potentialDrift (L : ℕ) (a : ℝ) (N : ∀ d, DyadicNode d → ℕ) (q : ∀ d, DyadicNode d → ℝ) : ℝ := bellmanDrift L a (fun d v => N d v) q /-- The nonnegative remainder `R` in the exact harmonic-potential drift. -/ +@[expose] def potentialRemainder (L : ℕ) (a : ℝ) (N : ∀ d, DyadicNode d → ℕ) (q : ∀ d, DyadicNode d → ℝ) : ℝ := @@ -95,6 +101,7 @@ The conditional expected global change, obtained by summing the independent one-node deletion/arrival experiment. Correlations between distinct nodes do not enter this expression. -/ +@[expose] def expectedGlobalPotentialChange (L : ℕ) (a : ℝ) (N : ∀ d, DyadicNode d → ℕ) (q : ∀ d, DyadicNode d → ℝ) : ℝ := diff --git a/LeanPool/FullyDynamicMatching/FD1D/PotentialBounds.lean b/LeanPool/FullyDynamicMatching/FD1D/PotentialBounds.lean index 5ab1f5b001..318e3a0c88 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/PotentialBounds.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/PotentialBounds.lean @@ -14,7 +14,7 @@ public import LeanPool.FullyDynamicMatching.FD1D.Parameters /-! # Potential Bounds -/ -@[expose] public section +public section namespace FD1D diff --git a/LeanPool/FullyDynamicMatching/FD1D/Realization.lean b/LeanPool/FullyDynamicMatching/FD1D/Realization.lean index 7c4d2abd70..35bde43f99 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/Realization.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/Realization.lean @@ -10,7 +10,7 @@ public import LeanPool.FullyDynamicMatching.FD1D.Spatial /-! # Realization -/ -@[expose] public section +public section namespace FD1D @@ -108,6 +108,7 @@ private theorem countAssignment_fiber_card The canonical spatial realization of a fixed-total leaf count state. Every point is placed at the left endpoint of its declared dyadic cell. -/ +@[expose] noncomputable def ofCountState (x : InventoryState (DyadicNode L) m) : SupplyConfiguration L m where @@ -151,6 +152,7 @@ theorem exists_countState_eq ⟨ofCountState x, ofCountState_countState x⟩ /-- A canonical total representative fallback whenever the inventory is nonempty. -/ +@[expose] def canonicalFallback (hm : 0 < m) : Fin m := ⟨0, hm⟩ diff --git a/LeanPool/FullyDynamicMatching/FD1D/Refresh.lean b/LeanPool/FullyDynamicMatching/FD1D/Refresh.lean index a869604d82..8e7cceda5e 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/Refresh.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/Refresh.lean @@ -10,7 +10,7 @@ public import LeanPool.FullyDynamicMatching.FD1D.FinalArithmetic /-! # Refresh -/ -@[expose] public section +public section namespace FD1D @@ -100,6 +100,7 @@ theorem refreshAssignment_preserves_later {ι : Type*} {m k : ℕ} exact (refreshAssignment_apply_of_le initial replenishment j hj.le).symm /-- The leaf-count state after the first `k` labeled replacements. -/ +@[expose] def refreshState {L m : ℕ} (initial replenishment : DyadicAssignment L m) (k : ℕ) : InventoryState (DyadicNode L) m := @@ -144,6 +145,7 @@ structure ReplenishmentCoordinates (L m : ℕ) where namespace ReplenishmentCoordinates /-- The realized labeled replenishment configuration for outcome `ω`. -/ +@[expose] def supply {L m : ℕ} (R : ReplenishmentCoordinates L m) (ω : DyadicAssignment L m) : RefreshSupply L m where location := R.location ω @@ -167,11 +169,13 @@ end ReplenishmentCoordinates namespace RefreshSupply /-- Count projection of a labeled supply configuration. -/ +@[expose] def countState {L m : ℕ} (C : RefreshSupply L m) : InventoryState (DyadicNode L) m := assignmentState C.leaf /-- The labeled configuration after the first `k` replacements. -/ +@[expose] def refresh {L m : ℕ} (initial replenishment : RefreshSupply L m) (k : ℕ) : RefreshSupply L m where location := @@ -285,6 +289,7 @@ theorem scheduledInitializationStepCost_eq {L m : ℕ} refreshAssignment] /-- The total cost of matching each initialization request to its old label. -/ +@[expose] def initializationMatchingCost {L m : ℕ} (initial : RefreshSupply L m) (demand : Fin m → ℝ) : ℝ := ∑ j, |demand j - initial.location j| diff --git a/LeanPool/FullyDynamicMatching/FD1D/Spatial.lean b/LeanPool/FullyDynamicMatching/FD1D/Spatial.lean index ae666e88f8..aa2f2f31ed 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/Spatial.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/Spatial.lean @@ -12,7 +12,7 @@ public import LeanPool.FullyDynamicMatching.FD1D.Tree /-! # Spatial -/ -@[expose] public section +public section namespace FD1D @@ -49,6 +49,7 @@ theorem dyadicLeafSumEquiv_inr_val {L : ℕ} (i : DyadicNode L) : namespace DyadicMass /-- The mass of a specified leaf, indexed from left to right. -/ +@[expose] def leafMass : {L : ℕ} → DyadicMass L → DyadicNode L → ℝ | 0, leaf mass, _ => mass | L + 1, branch left right, i => @@ -302,10 +303,12 @@ theorem selectedIndex_eq_iff_mem_massInterval {L : ℕ} (q : DyadicMass L) simp [selectedIndex, huRight, hlocal] /-- Lebesgue-uniform demand on the unit interval. -/ +@[expose] def uniformDemand : Measure ℝ := volume.restrict (Icc (0 : ℝ) 1) /-- Raw singleton mass of the finite pushforward by `selectedIndex`. -/ +@[expose] def selectedIndexPushforwardMass {L : ℕ} (q : DyadicMass L) (i : DyadicNode L) : ℝ := ((Measure.map q.selectedIndex uniformDemand) {i}).toReal @@ -378,6 +381,7 @@ end DyadicMass /-! ## Exact spatial configurations -/ /-- Width of one depth-`L` dyadic cell. -/ +@[expose] def dyadicCellWidth (L : ℕ) : ℝ := 1 / ((2 ^ L : ℕ) : ℝ) @@ -386,6 +390,7 @@ def dyadicCellLeft {L : ℕ} (i : DyadicNode L) : ℝ := i.val / ((2 ^ L : ℕ) : ℝ) /-- The closed cell certified for a labeled supply point. -/ +@[expose] def dyadicCell {L : ℕ} (i : DyadicNode L) : Set ℝ := Icc (dyadicCellLeft i) (dyadicCellLeft i + dyadicCellWidth L) @@ -431,6 +436,7 @@ namespace SupplyConfiguration variable {L m : ℕ} /-- Number of configured supply points carrying one leaf label. -/ +@[expose] def leafCount (C : SupplyConfiguration L m) (i : DyadicNode L) : ℕ := (Finset.univ.filter fun j => C.leaf j = i).card @@ -442,6 +448,7 @@ theorem sum_leafCount (C : SupplyConfiguration L m) : simp /-- Count projection from exact locations to the finite inventory chain. -/ +@[expose] def countState (C : SupplyConfiguration L m) : InventoryState (DyadicNode L) m := ⟨C.leafCount, C.sum_leafCount⟩ @@ -456,6 +463,7 @@ A total representative of a leaf. If the leaf is empty, the supplied fallback is returned; the later a.e. feasibility theorem proves that this case occurs only on the null exceptional demand set. -/ +@[expose] def representative (C : SupplyConfiguration L m) (fallback : Fin m) (i : DyadicNode L) : Fin m := if h : ∃ j, C.leaf j = i then Classical.choose h else fallback @@ -483,11 +491,13 @@ theorem supports_of_emptyMass (C : SupplyConfiguration L m) exact ⟨j, (Finset.mem_filter.mp hj).2⟩ /-- The supply label selected by a uniform demand coordinate. -/ +@[expose] def selectedSupplyIndex (C : SupplyConfiguration L m) (q : DyadicMass L) (fallback : Fin m) (u : ℝ) : Fin m := C.representative fallback (q.selectedIndex u) /-- The actual configured supply location selected by the policy. -/ +@[expose] def selectedSupplyPoint (C : SupplyConfiguration L m) (q : DyadicMass L) (fallback : Fin m) (u : ℝ) : ℝ := C.location (C.selectedSupplyIndex q fallback u) @@ -602,6 +612,7 @@ theorem selectedSupplyPoint_sub_quantile_le_ae q hq hsupport fallback hu hu0 /-- Expected distance from a uniform demand to the actual selected supply point. -/ +@[expose] def expectedActualDistance (C : SupplyConfiguration L m) (q : DyadicMass L) (fallback : Fin m) : ℝ := ∫ u in Icc (0 : ℝ) 1, |C.selectedSupplyPoint q fallback u - u| @@ -748,6 +759,7 @@ theorem expectedActualDistance_le_one_cell_of_deletionRule end SupplyConfiguration /-- Prefix a relative dyadic node by an absolute node. -/ +@[expose] def appendDyadicNode {d r : ℕ} (v : DyadicNode d) (w : DyadicNode r) : DyadicNode (d + r) := diff --git a/LeanPool/FullyDynamicMatching/FD1D/Symmetry.lean b/LeanPool/FullyDynamicMatching/FD1D/Symmetry.lean index 2bbf2ec92b..47b8c19fe3 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/Symmetry.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/Symmetry.lean @@ -11,7 +11,7 @@ public import LeanPool.FullyDynamicMatching.FD1D.Initialization /-! # Symmetry -/ -@[expose] public section +public section namespace FD1D @@ -49,6 +49,7 @@ def liftNodePerm {k : ℕ} (e : Equiv.Perm (DyadicNode k)) : /-- The permutation at level `d+1+r` induced by swapping the children of `v`. -/ +@[expose] def subtreeSwap {d : ℕ} (v : DyadicNode d) : (r : ℕ) → Equiv.Perm (DyadicNode ((d + 1) + r)) | 0 => Equiv.swap (leftChild v) (rightChild v) @@ -112,6 +113,7 @@ theorem subtreeSwap_symm {d r : ℕ} (v : DyadicNode d) : simp /-- The ancestor `r` levels above a node. -/ +@[expose] def ancestorNode {k : ℕ} : (r : ℕ) → DyadicNode (k + r) → DyadicNode k | 0, w => w | r + 1, w => ancestorNode r (parent w) @@ -176,6 +178,7 @@ instance inventoryStateNonempty exact ⟨⟨fun i => if i = Classical.arbitrary ι then m else 0, by simp⟩⟩ /-- Push a fixed-total count vector forward along a permutation. -/ +@[expose] def inventoryPerm {ι : Type*} [Fintype ι] {m : ℕ} (e : Equiv.Perm ι) : Equiv.Perm (InventoryState ι m) := inventoryStatePerm e @@ -193,6 +196,7 @@ theorem inventoryPerm_apply_image_count simp [inventoryPerm] /-- Transport an explicitly iterated subtree swap to a named leaf depth. -/ +@[expose] def leafSwapWithGap {d L : ℕ} (v : DyadicNode d) (r : ℕ) (hlevel : (d + 1) + r = L) : Equiv.Perm (DyadicNode L) := let c : DyadicNode ((d + 1) + r) ≃ DyadicNode L := @@ -200,16 +204,19 @@ def leafSwapWithGap {d L : ℕ} (v : DyadicNode d) (r : ℕ) c.symm.trans ((subtreeSwap v r).trans c) /-- The involution of depth-`L` leaves induced by a child swap at `v`. -/ +@[expose] def leafSwap {d L : ℕ} (hdL : d < L) (v : DyadicNode d) : Equiv.Perm (DyadicNode L) := leafSwapWithGap v (L - (d + 1)) (by omega) /-- The child swap lifted to fixed-total leaf inventories. -/ +@[expose] def inventorySwap {d L m : ℕ} (hdL : d < L) (v : DyadicNode d) : Equiv.Perm (InventoryState (DyadicNode L) m) := inventoryPerm (leafSwap hdL v) /-- The lifted inventory swap with an explicit depth gap. -/ +@[expose] def inventorySwapWithGap {d L m : ℕ} (v : DyadicNode d) (r : ℕ) (hlevel : (d + 1) + r = L) : Equiv.Perm (InventoryState (DyadicNode L) m) := @@ -254,6 +261,7 @@ def stateLeafInventory {L m : ℕ} HierarchicalDynamics.leafInventory x /-- The canonical aggregate counts of a fixed-total state. -/ +@[expose] def stateAggregate {L m : ℕ} (x : InventoryState (DyadicNode L) m) : AggregatedInventory L m := HierarchicalDynamics.aggregatedInventory x @@ -1088,6 +1096,7 @@ theorem concrete_kernel_equivariant /-! ## Invariant stationary laws for a single permutation -/ /-- Push a finite law forward along a permutation, in pointwise form. -/ +@[expose] def permuteLaw {α : Type*} [Fintype α] (e : Equiv.Perm α) (μ : FiniteLaw α) : FiniteLaw α where mass x := μ.mass (e.symm x) diff --git a/LeanPool/FullyDynamicMatching/FD1D/TrajectoryBridge.lean b/LeanPool/FullyDynamicMatching/FD1D/TrajectoryBridge.lean index 4131b1571d..5694b061da 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/TrajectoryBridge.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/TrajectoryBridge.lean @@ -16,7 +16,7 @@ homogeneous Markov kernel and identifies every coordinate marginal with the usual recursive iterate of the initial law. -/ -@[expose] public section +public section namespace FD1D.TrajectoryBridge @@ -28,6 +28,7 @@ open scoped ENNReal variable {α : Type*} [MeasurableSpace α] /-- The state law obtained after recursively applying a homogeneous kernel. -/ +@[expose] def iterateLaw (κ : Kernel α α) (μ₀ : Measure α) : ℕ → Measure α | 0 => μ₀ | n + 1 => κ ∘ₘ iterateLaw κ μ₀ n @@ -43,6 +44,7 @@ theorem iterateLaw_succ (κ : Kernel α α) (μ₀ : Measure α) (n : ℕ) : rfl /-- A homogeneous kernel viewed as a history-dependent kernel. -/ +@[expose] def historyKernel (κ : Kernel α α) (n : ℕ) : Kernel ((i : Finset.Iic n) → α) α := κ.comap (fun h => h ⟨n, Finset.mem_Iic.mpr le_rfl⟩) (by fun_prop) @@ -54,6 +56,7 @@ instance historyKernel.instIsMarkovKernel (κ : Kernel α α) infer_instance /-- The single path-space law generated from `μ₀` by repeatedly applying `κ`. -/ +@[expose] def trajectoryLaw (μ₀ : Measure α) (κ : Kernel α α) [IsMarkovKernel κ] : Measure (ℕ → α) := Kernel.trajMeasure (X := fun _ => α) μ₀ (historyKernel κ) diff --git a/LeanPool/FullyDynamicMatching/FD1D/Transport.lean b/LeanPool/FullyDynamicMatching/FD1D/Transport.lean index 4af510fa5a..19ac053c91 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/Transport.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/Transport.lean @@ -12,7 +12,7 @@ public import LeanPool.FullyDynamicMatching.FD1D.Basic /-! # Transport -/ -@[expose] public section +public section namespace FD1D @@ -42,6 +42,7 @@ inductive DyadicMass : ℕ → Type namespace DyadicMass /-- Total mass below the root. -/ +@[expose] def total : {L : ℕ} → DyadicMass L → ℝ | 0, leaf m => m | _ + 1, branch l r => total l + total r @@ -86,6 +87,7 @@ def ofLeafVector : (L : ℕ) → (Fin (2 ^ L) → ℝ) → DyadicMass L exact (Fin.sum_univ_add (fun i => f (e i))).symm /-- Every leaf mass is nonnegative. -/ +@[expose] def allNonneg : {L : ℕ} → DyadicMass L → Prop | 0, leaf m => 0 ≤ m | _ + 1, branch l r => allNonneg l ∧ allNonneg r @@ -129,6 +131,7 @@ The explicit piecewise-linear CDF. Outside `[0,1]` this is merely a piecewise-linear extension; all CDF statements below are restricted to the unit interval. -/ +@[expose] def piecewiseCDF : {L : ℕ} → DyadicMass L → ℝ → ℝ | 0, leaf m => fun z => m * z | _ + 1, branch l r => fun z => @@ -219,6 +222,7 @@ theorem piecewiseCDF_monotoneOn {L : ℕ} (q : DyadicMass L) (hq : q.allNonneg) The explicit generalized inverse in mass coordinates. Its input ranges from `0` to `q.total`; at a branch the interval is split at the left mass. -/ +@[expose] def quantile : {L : ℕ} → DyadicMass L → ℝ → ℝ | 0, leaf m => fun u => u / m | _ + 1, branch l r => fun u => @@ -229,6 +233,7 @@ def quantile : {L : ℕ} → DyadicMass L → ℝ → ℝ The actual selected-leaf policy. It returns the left endpoint of the leaf whose cumulative-mass interval contains `u`. -/ +@[expose] def selectedLeaf : {L : ℕ} → DyadicMass L → ℝ → ℝ | 0, leaf _ => fun _ => 0 | _ + 1, branch l r => fun u => @@ -708,6 +713,7 @@ def value (t : HaarTerm) (z : ℝ) : ℝ := end HaarTerm /-- Pointwise value of a finite list of integrated Haar terms. -/ +@[expose] def haarTermSum (ts : List HaarTerm) (z : ℝ) : ℝ := (ts.map (fun t => t.value z)).sum @@ -909,10 +915,12 @@ theorem DyadicMass.haarSeries_eq_haarTermSum abbrev CompleteHaarNode (L : ℕ) := Σ d : Fin L, Fin (2 ^ d.val) /-- Left endpoint of the dyadic interval indexed by a complete Haar node. -/ +@[expose] def haarNodeLeft {L : ℕ} (v : CompleteHaarNode L) : ℝ := (v.2.val : ℝ) / (2 ^ v.1.val : ℕ) /-- Width of the dyadic interval indexed by a complete Haar node. -/ +@[expose] def haarNodeWidth {L : ℕ} (v : CompleteHaarNode L) : ℝ := 1 / (2 ^ v.1.val : ℕ) @@ -947,6 +955,7 @@ namespace DyadicMass The masses of the two children of an internal node `v = ⟨d,k⟩`. At positive depth, `k` selects the appropriate half-tree recursively. -/ +@[expose] def nodeChildMasses : {L : ℕ} → DyadicMass L → CompleteHaarNode L → ℝ × ℝ | 0, .leaf _, v => Fin.elim0 v.1 | _ + 1, .branch l r, ⟨⟨0, _⟩, _⟩ => (l.total, r.total) @@ -959,6 +968,7 @@ def nodeChildMasses : {L : ℕ} → DyadicMass L → CompleteHaarNode L → ℝ (fun vr => nodeChildMasses r ⟨d', vr⟩) w /-- The Haar coefficient at a node is its left-child mass minus its right-child mass. -/ +@[expose] def nodeCoefficient {L : ℕ} (q : DyadicMass L) (v : CompleteHaarNode L) : ℝ := (q.nodeChildMasses v).1 - (q.nodeChildMasses v).2 @@ -979,6 +989,7 @@ theorem nodeCoefficient_eq_childMass_sub {L : ℕ} (q : DyadicMass L) rfl /-- Embed a node into the left half-tree one level below a new root. -/ +@[expose] def leftNode {L : ℕ} (v : CompleteHaarNode L) : CompleteHaarNode (L + 1) := ⟨v.1.succ, ⟨v.2.val, by change v.2.val < 2 ^ (v.1.val + 1) @@ -986,6 +997,7 @@ def leftNode {L : ℕ} (v : CompleteHaarNode L) : CompleteHaarNode (L + 1) := omega⟩⟩ /-- Embed a node into the right half-tree one level below a new root. -/ +@[expose] def rightNode {L : ℕ} (v : CompleteHaarNode L) : CompleteHaarNode (L + 1) := ⟨v.1.succ, ⟨2 ^ v.1.val + v.2.val, by change 2 ^ v.1.val + v.2.val < 2 ^ (v.1.val + 1) @@ -1059,6 +1071,7 @@ namespace FiniteLaw variable {Ω : Type*} [Fintype Ω] /-- A finite law is invariant under a state-space equivalence. -/ +@[expose] def InvariantUnder (μ : FiniteLaw Ω) (e : Ω ≃ Ω) : Prop := ∀ ω, μ.mass (e ω) = μ.mass ω @@ -1067,6 +1080,7 @@ An observable has an odd symmetry if a mass-preserving child swap changes its sign. A local tree automorphism supplies precisely such an equivalence for an ancestor-descendant coefficient product. -/ +@[expose] def OddSymmetry (μ : FiniteLaw Ω) (f : Ω → ℝ) : Prop := ∃ e : Ω ≃ Ω, InvariantUnder μ e ∧ ∀ ω, f (e ω) = -f ω @@ -1099,6 +1113,7 @@ theorem expect_eq_zero_of_oddSymmetry (μ : FiniteLaw Ω) (f : Ω → ℝ) end FiniteLaw /-- The interiors of two tent supports are disjoint (endpoints may coincide). -/ +@[expose] def IntervalsSeparated {ι : Type*} (l p : ι → ℝ) (i j : ι) : Prop := l i + p i ≤ l j ∨ l j + p j ≤ l i @@ -1329,6 +1344,7 @@ theorem cdf_sub_linear_eq_haarCombination {L : ℕ} (q : DyadicMass L) end DyadicMass /-- Squared `L²` norm of a finite integrated Haar expansion. -/ +@[expose] def haarL2 (l p : ι → ℝ) (b : ι → ℝ) : ℝ := ∫ z, haarCombination l p b z ^ 2 @@ -1423,6 +1439,7 @@ The elementary one-dimensional monotone-transport cost: the area between the source and target CDFs. This representation avoids introducing a separate Wasserstein API. -/ +@[expose] def cdfTransportArea (f : ℝ → ℝ) : ℝ := ∫ z in Icc (0 : ℝ) 1, |f z| @@ -1618,6 +1635,7 @@ def expectedDistance {F : ℝ → ℝ} (P : MonotoneQuantilePolicy F) : ℝ := ∫ u in Icc (0 : ℝ) 1, |P.selectedPoint u - u| /-- Cost of the continuous generalized inverse before leaf rounding. -/ +@[expose] def quantileDistance {F : ℝ → ℝ} (P : MonotoneQuantilePolicy F) : ℝ := ∫ u in Icc (0 : ℝ) 1, |P.quantileMap u - u| @@ -1682,6 +1700,7 @@ theorem expectedDistance_le {F : ℝ → ℝ} (P : MonotoneQuantilePolicy F) end MonotoneQuantilePolicy /-- The explicit dyadic CDF, inverse, and leaf endpoint form an actual policy. -/ +@[expose] def DyadicMass.quantilePolicy {L : ℕ} (q : DyadicMass L) (hq : q.IsProbability) : MonotoneQuantilePolicy q.piecewiseCDF where diff --git a/LeanPool/FullyDynamicMatching/FD1D/Tree.lean b/LeanPool/FullyDynamicMatching/FD1D/Tree.lean index 56e220eb6d..95f60da509 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/Tree.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/Tree.lean @@ -10,7 +10,7 @@ public import LeanPool.FullyDynamicMatching.FD1D.Basic /-! # Tree -/ -@[expose] public section +public section namespace FD1D @@ -29,6 +29,7 @@ hypotheses; no policy-specific algebra is hidden here. abbrev DyadicNode (d : ℕ) := Fin (2 ^ d) /-- The unique node at depth zero. -/ +@[expose] def dyadicRoot : DyadicNode 0 := 0 /-- Splitting a level into the two children of every node. -/ @@ -36,10 +37,12 @@ def childrenEquiv (d : ℕ) : DyadicNode d × Fin 2 ≃ DyadicNode (d + 1) := finProdFinEquiv.trans (finCongr (by simp [pow_succ])) /-- The left child of a dyadic node. -/ +@[expose] def leftChild {d : ℕ} (v : DyadicNode d) : DyadicNode (d + 1) := childrenEquiv d (v, 0) /-- The right child of a dyadic node. -/ +@[expose] def rightChild {d : ℕ} (v : DyadicNode d) : DyadicNode (d + 1) := childrenEquiv d (v, 1) @@ -215,6 +218,7 @@ theorem leafBlock_children {d L : ℕ} (hdL : d < L) omega /-- Interval mass of every node at depth `d`. -/ +@[expose] def nodeMass (d : ℕ) (_ : DyadicNode d) : ℝ := ((2 : ℝ) ^ d)⁻¹ @@ -275,6 +279,7 @@ structure AggregatedInventory (L m : ℕ) where namespace LeafInventory /-- Concrete aggregate of a leaf inventory over one descendant block. -/ +@[expose] def nodeCount {L m d : ℕ} (I : LeafInventory L m) (hdL : d ≤ L) (v : DyadicNode d) : ℕ := ∑ w ∈ leafBlock hdL v, I.count w @@ -314,6 +319,7 @@ theorem nodeCount_children {L m d : ℕ} (I : LeafInventory L m) (leftChild_ne_rightChild v)) /-- Every fixed-total leaf vector has canonical coherent aggregate counts. -/ +@[expose] def aggregate {L m : ℕ} (I : LeafInventory L m) : AggregatedInventory L m where leaf := I @@ -342,6 +348,7 @@ structure CoherentTreeLabel (L : ℕ) (A : Type*) [AddCommMonoid A] where value (d + 1) (rightChild v) /-- Sum of a depth-indexed label over one complete level. -/ +@[expose] def levelSum {A : Type*} [AddCommMonoid A] (f : ∀ d, DyadicNode d → A) (d : ℕ) : A := ∑ v, f d v @@ -382,6 +389,7 @@ theorem AggregatedInventory.leaf_count_eq_total /-! ## Weighted telescopes -/ /-- Mass-weighted sum of a real label over one complete level. -/ +@[expose] def weightedLevel (f : ∀ d, DyadicNode d → ℝ) (d : ℕ) : ℝ := ∑ v, nodeMass d v * f d v @@ -393,6 +401,7 @@ def weightedLevel (f : ∀ d, DyadicNode d → ℝ) (d : ℕ) : ℝ := simp [nodeMass, dyadicRoot] /-- Arithmetic mean of a real label over the two children of `v`. -/ +@[expose] def childAverage (f : ∀ d, DyadicNode d → ℝ) (d : ℕ) (v : DyadicNode d) : ℝ := (f (d + 1) (leftChild v) + f (d + 1) (rightChild v)) / 2 @@ -432,14 +441,17 @@ theorem weighted_tree_telescope rw [weightedLevel_zero] /-- Sum of a mass-weighted label over all nonroot levels through `L`. -/ +@[expose] def nonrootWeightedSum (f : ∀ d, DyadicNode d → ℝ) (L : ℕ) : ℝ := ∑ d ∈ Finset.range L, weightedLevel f (d + 1) /-- Sum of a mass-weighted label over all internal levels before `L`. -/ +@[expose] def internalWeightedSum (f : ∀ d, DyadicNode d → ℝ) (L : ℕ) : ℝ := ∑ d ∈ Finset.range L, weightedLevel f d /-- The hazard energy `H_d = ∑_{depth(v)=d} p_v h_v²`. -/ +@[expose] def hazardEnergy (h : ∀ d, DyadicNode d → ℝ) (d : ℕ) : ℝ := weightedLevel (fun d v => (h d v) ^ 2) d @@ -626,6 +638,7 @@ theorem bellman_global_bound linarith /-- The drift quantity `D` from equation (9). -/ +@[expose] def bellmanDrift (L : ℕ) (a : ℝ) (N q : ∀ d, DyadicNode d → ℝ) : ℝ := @@ -706,6 +719,7 @@ theorem sum_nodeMass_sq (d : ℕ) : field_simp /-- Sum of `p_v²` over every nonroot node through depth `L`. -/ +@[expose] def nonrootMassSqSum (L : ℕ) : ℝ := ∑ d ∈ Finset.range L, ∑ v : DyadicNode (d + 1), (nodeMass (d + 1) v) ^ 2 diff --git a/LeanPool/FullyDynamicMatching/FD1D/UniformArrival.lean b/LeanPool/FullyDynamicMatching/FD1D/UniformArrival.lean index 0a180426b3..f4aa128163 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/UniformArrival.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/UniformArrival.lean @@ -10,7 +10,7 @@ public import LeanPool.FullyDynamicMatching.FD1D.Spatial /-! # Uniform Arrival -/ -@[expose] public section +public section namespace FD1D @@ -133,10 +133,12 @@ theorem uniformArrivalMass_quantile exact hself /-- The dyadic label assigned to the continuous arrival coordinate `u`. -/ +@[expose] def uniformArrivalLeaf (L : ℕ) (u : ℝ) : DyadicNode L := (uniformArrivalMass L).selectedIndex u /-- The finite pushforward law of the selected uniform-arrival label. -/ +@[expose] def uniformArrivalLeafLaw (L : ℕ) : FiniteLaw (DyadicNode L) := (uniformArrivalMass L).selectedIndexLaw (uniformArrivalMass_isProbability L) diff --git a/LeanPool/FullyDynamicMatching/FD1D/V5/Balanced.lean b/LeanPool/FullyDynamicMatching/FD1D/V5/Balanced.lean index a175b602ee..b35f5d39fc 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/V5/Balanced.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/V5/Balanced.lean @@ -19,7 +19,7 @@ maximal, which removes the endpoint term from the finite-horizon energy telescope. -/ -@[expose] public section +public section namespace FD1D.V5.Balanced @@ -159,6 +159,7 @@ theorem potentialMaximizers_nonempty (L m : ℕ) (a : ℝ) : exact hmax y (by simp) /-- Uniform probability law on the finite set of potential maximizers. -/ +@[expose] def law (L m : ℕ) (a : ℝ) : FiniteLaw (InventoryState (DyadicNode L) m) where mass x := @@ -197,7 +198,7 @@ theorem law_mass (L m : ℕ) (a : ℝ) (law L m a).mass x = if x ∈ potentialMaximizers L m a then 1 / ((potentialMaximizers L m a).card : ℝ) - else 0 := + else 0 := by rfl /-- The maximizer law is invariant under every child-subtree swap. -/ @@ -372,6 +373,7 @@ theorem law_average_rms_squaredCostEnvelope_le (by norm_num))) /-- The manuscript-parameter balanced initial count law. -/ +@[expose] def parameterizedLaw (m : ℕ) : FiniteLaw (InventoryState (DyadicNode (treeDepth m)) m) := law (treeDepth m) m (parameterA m : ℝ) diff --git a/LeanPool/FullyDynamicMatching/FD1D/V5/CompleteFormalizationAudit.lean b/LeanPool/FullyDynamicMatching/FD1D/V5/CompleteFormalizationAudit.lean index 735f37dcd1..e1cca79b85 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/V5/CompleteFormalizationAudit.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/V5/CompleteFormalizationAudit.lean @@ -16,7 +16,7 @@ The commands below reject proof placeholders and nonstandard axioms in the paper-facing theorem and its principal producer lemmas. -/ -@[expose] public section +public section open Lean Meta Elab Command diff --git a/LeanPool/FullyDynamicMatching/FD1D/V5/Complexity.lean b/LeanPool/FullyDynamicMatching/FD1D/V5/Complexity.lean index 1402c7d8a7..c24909908b 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/V5/Complexity.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/V5/Complexity.lean @@ -20,7 +20,7 @@ These are mathematical accounting functions, not runtime measurements of Lean's noncomputable definitions. -/ -@[expose] public section +public section namespace FD1D.V5 diff --git a/LeanPool/FullyDynamicMatching/FD1D/V5/ContinuousProcess.lean b/LeanPool/FullyDynamicMatching/FD1D/V5/ContinuousProcess.lean index 880ce82ae0..3256360b8e 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/V5/ContinuousProcess.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/V5/ContinuousProcess.lean @@ -17,7 +17,7 @@ public import Mathlib.Probability.Kernel.IonescuTulcea.Traj /-! # Continuous Process -/ -@[expose] public section +public section namespace FD1D @@ -43,6 +43,7 @@ variable {L m : ℕ} abbrev Noise := unitInterval × unitInterval /-- The law of an independent uniform demand/replenishment pair. -/ +@[expose] def noiseLaw : Measure Noise := (volume : Measure unitInterval).prod volume @@ -119,6 +120,7 @@ theorem map_noiseLeaves measurable_subtype_coe)).symm /-- Iid continuous coordinates for the refreshed live inventory. -/ +@[expose] def initialSpatialLaw (m : ℕ) : Measure (SpatialState m) := Measure.pi fun _ : Fin m => (volume : Measure unitInterval) @@ -363,6 +365,7 @@ private theorem comap_comp_measure rw [Measure.deterministic_comp_eq_map hf] /-- The continuous spatial law after `t` policy steps. -/ +@[expose] def spatialLaw (a : ℝ) (fallback : Fin m) : ℕ → Measure (SpatialState m) | 0 => initialSpatialLaw m @@ -421,6 +424,7 @@ current independent demand/replenishment pair. abbrev ProcessState (m : ℕ) := SpatialState m × Noise /-- The refreshed inventory and first noise pair are independent. -/ +@[expose] def initialProcessLaw (m : ℕ) : Measure (ProcessState m) := (initialSpatialLaw m).prod noiseLaw @@ -433,6 +437,7 @@ instance initialProcessLaw.isProbabilityMeasure : Apply the current noise pair to the inventory, then attach the freshly sampled noise pair for the following period. -/ +@[expose] def processAdvance (L : ℕ) (a : ℝ) (fallback : Fin m) (p : ProcessState m × Noise) : ProcessState m := (spatialStep L a fallback p.1.1 p.1.2, p.2) @@ -446,6 +451,7 @@ theorem processAdvance_measurable (measurable_snd.comp measurable_fst))).prodMk measurable_snd /-- The homogeneous transition kernel of the joint process. -/ +@[expose] def processKernel (a : ℝ) (fallback : Fin m) : Kernel (ProcessState m) (ProcessState m) := (Kernel.id ×ₖ Kernel.const (ProcessState m) noiseLaw).map @@ -536,7 +542,7 @@ theorem processLaw_eq_product rw [ih, processKernel_comp_product, spatialLaw_succ] /-- One path-space law carrying the entire joint continuous process. -/ -def trajectoryLaw (a : ℝ) (fallback : Fin m) : +@[expose] def trajectoryLaw (a : ℝ) (fallback : Fin m) : Measure (ℕ → ProcessState m) := TrajectoryBridge.trajectoryLaw (initialProcessLaw m) (processKernel (L := L) a fallback) @@ -605,6 +611,7 @@ theorem spatialLookup_measurable : exact hswap.comp measurable_swap /-- The actual matching cost paid at one joint process state. -/ +@[expose] def processCost (L : ℕ) (a : ℝ) (fallback : Fin m) (z : ProcessState m) : ℝ := Dynamics.actualStepCost a (toConfiguration L z.1) @@ -896,6 +903,7 @@ theorem integral_processCost_processLaw exact integral_processCost_noise_eq_actualConfigurationCost L a hm s /-- One-period reward, integrated on the single infinite trajectory law. -/ +@[expose] def trajectoryExpectedCost (a : ℝ) (hm : 0 < m) (fallback : Fin m) (t : ℕ) : ℝ := ∫ path : ℕ → ProcessState m, @@ -986,6 +994,7 @@ theorem integral_processSquaredCost_processLaw /-- One-period squared reward, integrated on the single infinite trajectory law. -/ +@[expose] def trajectoryExpectedSquaredCost (a : ℝ) (hm : 0 < m) (fallback : Fin m) (t : ℕ) : ℝ := ∫ path : ℕ → ProcessState m, diff --git a/LeanPool/FullyDynamicMatching/FD1D/V5/ContinuousState.lean b/LeanPool/FullyDynamicMatching/FD1D/V5/ContinuousState.lean index 261f3acdc4..785f048ae5 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/V5/ContinuousState.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/V5/ContinuousState.lean @@ -11,7 +11,7 @@ public import Mathlib.MeasureTheory.Constructions.UnitInterval /-! # Continuous State -/ -@[expose] public section +public section namespace FD1D @@ -33,10 +33,12 @@ spatial configuration and its finite count projection pathwise. abbrev SpatialState (m : ℕ) := Fin m → unitInterval /-- The dyadic leaf assigned to each coordinate of a spatial state. -/ +@[expose] def spatialLeaves (L : ℕ) (s : SpatialState m) : Fin m → DyadicNode L := fun j => DyadicMass.uniformArrivalLeaf L (s j : ℝ) /-- Convert a coordinate state to its certified spatial configuration. -/ +@[expose] def toConfiguration (L : ℕ) (s : SpatialState m) : SupplyConfiguration L m where location j := s j @@ -56,6 +58,7 @@ theorem toConfiguration_leaf (L : ℕ) (s : SpatialState m) (j : Fin m) : rfl /-- The finite inventory-count projection of a coordinate state. -/ +@[expose] def spatialCount (L : ℕ) (s : SpatialState m) : InventoryState (DyadicNode L) m := (toConfiguration L s).countState @@ -133,6 +136,7 @@ theorem spatialCount_measurable (L : ℕ) : /-! ## Selected labels and coordinate update -/ /-- The concrete supply label selected from a coordinate state. -/ +@[expose] def spatialSelectedLabel (L : ℕ) (a : ℝ) (fallback : Fin m) (s : SpatialState m) (u : unitInterval) : Fin m := Dynamics.selectedSupplyLabel @@ -226,6 +230,7 @@ theorem spatialSelectedLabel_demand_measurable Replace the selected supply coordinate by a replenishment coordinate. The noise pair consists of demand first and replenishment second. -/ +@[expose] def spatialStep (L : ℕ) (a : ℝ) (fallback : Fin m) (s : SpatialState m) (z : unitInterval × unitInterval) : SpatialState m := diff --git a/LeanPool/FullyDynamicMatching/FD1D/V5/CostBounds.lean b/LeanPool/FullyDynamicMatching/FD1D/V5/CostBounds.lean index a97e18e99f..0ce6bf39c6 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/V5/CostBounds.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/V5/CostBounds.lean @@ -18,7 +18,7 @@ discharges the parameter arithmetic, and records stationary, transient, and ordinary-convergence bounds for the count-state cost envelope. -/ -@[expose] public section +public section namespace FD1D.V5 @@ -110,6 +110,7 @@ end Transport /-! ## Parameterized count chain -/ /-- Inventory transition kernel at the manuscript parameters determined by `m`. -/ +@[expose] def parameterizedKernel (m : ℕ) (hm : 1 ≤ m) : FiniteKernel (InventoryState (DyadicNode (treeDepth m)) m) := @@ -123,11 +124,13 @@ def parameterizedTransportEnergy (m : ℕ) Dynamics.stateTransportEnergy (parameterA m : ℝ) x /-- Squared transport-cost envelope at the manuscript parameters. -/ +@[expose] def parameterizedSquaredCostEnvelope (m : ℕ) (x : InventoryState (DyadicNode (treeDepth m)) m) : ℝ := Transport.stateSquaredCostEnvelope (parameterA m : ℝ) x /-- Inventory law after `t` steps starting from independently refreshed supply. -/ +@[expose] def refreshedIterate (m : ℕ) (hm : 1 ≤ m) (t : ℕ) : FiniteLaw (InventoryState (DyadicNode (treeDepth m)) m) := @@ -339,6 +342,7 @@ theorem refreshed_average_rms_squaredCostEnvelope_le /-! ## Ordinary convergence from arbitrary count laws -/ /-- Expected squared-cost envelope at time `t` from the chosen initial inventory law. -/ +@[expose] def rmsSquaredCostExpectation (m : ℕ) (hm : 1 ≤ m) (mu0 : FiniteLaw diff --git a/LeanPool/FullyDynamicMatching/FD1D/V5/Dynamics.lean b/LeanPool/FullyDynamicMatching/FD1D/V5/Dynamics.lean index 9ae93b405f..a4f790b1ed 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/V5/Dynamics.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/V5/Dynamics.lean @@ -17,7 +17,7 @@ the v5 deletion masses and connects it to the harmonic potential with regularizer `a / 2`. -/ -@[expose] public section +public section namespace FD1D.V5.Dynamics @@ -45,6 +45,7 @@ theorem aggregatedInventory_count FD1D.HierarchicalDynamics.aggregatedInventory_count x hdL v /-- The v5 leaf deletion probabilities. -/ +@[expose] def deletionRule (a : ℝ) (ha : 0 < a) (hm : 0 < m) : DeletionRule (DyadicNode L) m where prob x w := @@ -70,6 +71,7 @@ def deletionRule (a : ℝ) (ha : 0 < a) (hm : 0 < m) : rfl /-- Delete according to the v5 rule and add an independent uniform leaf. -/ +@[expose] def kernel (a : ℝ) (ha : 0 < a) (hm : 0 < m) : FiniteKernel (InventoryState (DyadicNode L) m) := (deletionRule a ha hm).kernel @@ -227,11 +229,13 @@ theorem kernel_expected_nodePotentialChange /-! ## State observables and exact harmonic drift -/ /-- Aggregated inventory counts viewed as labels on every dyadic level. -/ +@[expose] def countLabel (x : InventoryState (DyadicNode L) m) : ∀ d, DyadicNode d → ℕ := (aggregatedInventory x).count /-- Deletion mass at every node of the aggregated inventory tree. -/ +@[expose] def deletionLabel (a : ℝ) (x : InventoryState (DyadicNode L) m) : ∀ d, DyadicNode d → ℝ := TreePolicy.deletionMass (aggregatedInventory x) a @@ -242,6 +246,7 @@ def rateLabel (a : ℝ) (x : InventoryState (DyadicNode L) m) : TreePolicy.rate (aggregatedInventory x) a /-- The manuscript potential `Φ`, whose harmonic shift is `a/2`. -/ +@[expose] def statePotential (a : ℝ) (x : InventoryState (DyadicNode L) m) : ℝ := globalHarmonicPotential L (a / 2) (countLabel x) @@ -257,11 +262,13 @@ def stateRemainder (a : ℝ) potentialRemainder L (a / 2) (countLabel x) (deletionLabel a x) /-- Hazard energy of the state rate labels at the selected dyadic level. -/ +@[expose] def stateRateEnergy (a : ℝ) (x : InventoryState (DyadicNode L) m) (d : ℕ) : ℝ := hazardEnergy (rateLabel a x) d /-- Transport energy of the aggregated inventory state. -/ +@[expose] def stateTransportEnergy (a : ℝ) (x : InventoryState (DyadicNode L) m) : ℝ := TreePolicy.transportEnergy (aggregatedInventory x) a diff --git a/LeanPool/FullyDynamicMatching/FD1D/V5/Energy.lean b/LeanPool/FullyDynamicMatching/FD1D/V5/Energy.lean index 27a36a1f8c..ea8d29607f 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/V5/Energy.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/V5/Energy.lean @@ -16,7 +16,7 @@ This module proves the stationary and finite-horizon forms of the manuscript's master energy inequality. -/ -@[expose] public section +public section namespace FD1D.V5.Dynamics @@ -27,6 +27,7 @@ open scoped BigOperators variable {L m : ℕ} /-- Sum of transport energy and the weighted finest-level rate energy. -/ +@[expose] def combinedEnergy (a : ℝ) (x : InventoryState (DyadicNode L) m) : ℝ := a ^ 2 / 2 * stateRateEnergy a x L + stateTransportEnergy a x diff --git a/LeanPool/FullyDynamicMatching/FD1D/V5/InitialProcess.lean b/LeanPool/FullyDynamicMatching/FD1D/V5/InitialProcess.lean index d92a51dfc0..ad037f345d 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/V5/InitialProcess.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/V5/InitialProcess.lean @@ -10,7 +10,7 @@ public import LeanPool.FullyDynamicMatching.FD1D.V5.ContinuousProcess /-! # Initial Process -/ -@[expose] public section +public section namespace FD1D @@ -35,7 +35,7 @@ def spatialLawFrom (μ₀ : Measure (SpatialState m)) @[simp] theorem spatialLawFrom_zero (μ₀ : Measure (SpatialState m)) (a : ℝ) (fallback : Fin m) : - spatialLawFrom (L := L) μ₀ a fallback 0 = μ₀ := + spatialLawFrom (L := L) μ₀ a fallback 0 = μ₀ := by rfl @[simp] @@ -44,7 +44,7 @@ theorem spatialLawFrom_succ (fallback : Fin m) (t : ℕ) : spatialLawFrom (L := L) μ₀ a fallback (t + 1) = spatialKernel (L := L) a fallback ∘ₘ - spatialLawFrom (L := L) μ₀ a fallback t := + spatialLawFrom (L := L) μ₀ a fallback t := by rfl instance spatialLawFrom.isProbabilityMeasure @@ -98,6 +98,7 @@ theorem map_spatialCount_spatialLawFrom /-! ## Joint process and trajectory laws -/ /-- Attach an independent first demand/replenishment pair to `μ₀`. -/ +@[expose] def initialProcessLawFrom (μ₀ : Measure (SpatialState m)) : Measure (ProcessState m) := μ₀.prod noiseLaw @@ -105,7 +106,7 @@ def initialProcessLawFrom (μ₀ : Measure (SpatialState m)) : @[simp] theorem initialProcessLawFrom_eq_product (μ₀ : Measure (SpatialState m)) : - initialProcessLawFrom μ₀ = μ₀.prod noiseLaw := + initialProcessLawFrom μ₀ = μ₀.prod noiseLaw := by rfl instance initialProcessLawFrom.isProbabilityMeasure @@ -154,7 +155,7 @@ theorem processLawFrom_eq_product rw [ih, processKernel_comp_product, spatialLawFrom_succ] /-- One path-space law for the joint process initialized by `μ₀`. -/ -def trajectoryLawFrom +@[expose] def trajectoryLawFrom (μ₀ : Measure (SpatialState m)) (a : ℝ) (fallback : Fin m) : Measure (ℕ → ProcessState m) := @@ -262,6 +263,7 @@ theorem integral_processSquaredCost_processLawFrom L a hm s /-- One-period cost on the generalized path-space law. -/ +@[expose] def trajectoryExpectedSquaredCostFrom (μ₀ : Measure (SpatialState m)) (a : ℝ) (hm : 0 < m) (fallback : Fin m) (t : ℕ) : ℝ := @@ -374,12 +376,14 @@ def processLawFromState (s₀ : SpatialState m) processLawFrom (L := L) (Measure.dirac s₀) a fallback t /-- Path-space law from a fixed spatial state. -/ +@[expose] def trajectoryLawFromState (s₀ : SpatialState m) (a : ℝ) (fallback : Fin m) : Measure (ℕ → ProcessState m) := trajectoryLawFrom (L := L) (Measure.dirac s₀) a fallback /-- One-period trajectory cost from a fixed spatial state. -/ +@[expose] def trajectoryExpectedSquaredCostFromState (s₀ : SpatialState m) (a : ℝ) (hm : 0 < m) (fallback : Fin m) (t : ℕ) : ℝ := diff --git a/LeanPool/FullyDynamicMatching/FD1D/V5/JoinedTrajectory.lean b/LeanPool/FullyDynamicMatching/FD1D/V5/JoinedTrajectory.lean index 48bd3f1e7d..141bb340a6 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/V5/JoinedTrajectory.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/V5/JoinedTrajectory.lean @@ -11,7 +11,7 @@ public import LeanPool.FullyDynamicMatching.FD1D.Refresh /-! # Joined Trajectory -/ -@[expose] public section +public section namespace FD1D @@ -35,6 +35,7 @@ live on one path space, with a pathwise (not merely count-law) phase boundary. /-- A continuous coordinate state, viewed as the supply used by initialization. -/ +@[expose] def coordinateRefreshSupply (L : ℕ) (s : SpatialState m) : RefreshSupply L m where location j := s j @@ -189,6 +190,7 @@ theorem pathProcessCost_integrable The average cost of initialization followed by the main policy, as one random variable on the single infinite continuous trajectory. -/ +@[expose] def joinedTrajectoryAverageCost (initial : RefreshSupply L m) (demand : Fin m → ℝ) (a : ℝ) (hm : 0 < m) (N : ℕ) diff --git a/LeanPool/FullyDynamicMatching/FD1D/V5/LocalBellman.lean b/LeanPool/FullyDynamicMatching/FD1D/V5/LocalBellman.lean index 1924b96a08..0e2f220603 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/V5/LocalBellman.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/V5/LocalBellman.lean @@ -15,7 +15,7 @@ This module follows the normalization and three active-cap cases in the appendix of `manuscript-v5/optimal_dynamic_matching.tex`. -/ -@[expose] public section +public section namespace FD1D.V5.LocalBellman @@ -1753,6 +1753,7 @@ end Normalized /-! ## Concrete local policy -/ /-- The left side of the manuscript's local Bellman inequality. -/ +@[expose] def localResidual (a p h : ℝ) (x y : ℕ) : ℝ := ((discrepancyLeft a p h x y * regularizedMassLeft a p x + bellman (rateLeft a p h x y) (discrepancyLeft a p h x y) @@ -1763,6 +1764,7 @@ def localResidual (a p h : ℝ) (x y : ℕ) : ℝ := bellman h (discrepancy a p h x y) (regularizedMass a p x y) /-- The rate increment plus squared deletion bias in the local inequality. -/ +@[expose] def localEnergy (a p h : ℝ) (x y : ℕ) : ℝ := (rateLeft a p h x y ^ 2 + rateRight a p h x y ^ 2) / 2 - h ^ 2 + bias a p h x y ^ 2 / a ^ 2 diff --git a/LeanPool/FullyDynamicMatching/FD1D/V5/LocalInvariants.lean b/LeanPool/FullyDynamicMatching/FD1D/V5/LocalInvariants.lean index d0a0ac43ab..a40f9343a8 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/V5/LocalInvariants.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/V5/LocalInvariants.lean @@ -12,7 +12,7 @@ public import LeanPool.FullyDynamicMatching.FD1D.V5.LocalPolicy # Feasibility and invariant domain of the v5 local policy -/ -@[expose] public section +public section namespace FD1D.V5.LocalPolicy diff --git a/LeanPool/FullyDynamicMatching/FD1D/V5/LocalPolicy.lean b/LeanPool/FullyDynamicMatching/FD1D/V5/LocalPolicy.lean index 96bd725c92..39514f9dfb 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/V5/LocalPolicy.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/V5/LocalPolicy.lean @@ -16,33 +16,39 @@ the fixed left/right spatial sign. Empty-child rates are auxiliary analytic rates; empty children still receive zero deletion mass. -/ -@[expose] public section +public section namespace FD1D.V5.LocalPolicy noncomputable section /-- Parent inventory, coerced to `ℝ`. -/ +@[expose] def inventory (x y : ℕ) : ℝ := (x : ℝ) + (y : ℝ) /-- Parent deletion mass under the identity `q = Nh`. -/ +@[expose] def parentMass (h : ℝ) (x y : ℕ) : ℝ := inventory x y * h /-- The feedback candidate, for ordered positive counts `x ≥ y > 0`. -/ +@[expose] def feedbackCandidate (a h : ℝ) (x y : ℕ) : ℝ := 2 * a * parentMass h x y * ((x : ℝ) - y) / ((x : ℝ) * y) /-- The uniform-deletion cap, for ordered counts. -/ +@[expose] def uniformCandidate (h : ℝ) (x y : ℕ) : ℝ := parentMass h x y * ((x : ℝ) - y) / inventory x y /-- The rate-floor cap, for ordered counts and parent interval mass `p`. -/ +@[expose] def floorCandidate (a p h : ℝ) (x y : ℕ) : ℝ := parentMass h x y - 2 * p * y / (2 * (y : ℝ) + a) /-- Nonnegative bias magnitude after temporarily ordering `x ≥ y`. -/ +@[expose] def orderedBias (a p h : ℝ) (x y : ℕ) : ℝ := if x = y then 0 else if x + y = 0 then 0 @@ -51,54 +57,66 @@ def orderedBias (a p h : ℝ) (x y : ℕ) : ℝ := (min (uniformCandidate h x y) (floorCandidate a p h x y)) /-- Signed left-minus-right deletion bias in fixed spatial labels. -/ +@[expose] def bias (a p h : ℝ) (x y : ℕ) : ℝ := if y ≤ x then orderedBias a p h x y else -orderedBias a p h y x /-- Left-child deletion mass. -/ +@[expose] def massLeft (a p h : ℝ) (x y : ℕ) : ℝ := (parentMass h x y + bias a p h x y) / 2 /-- Right-child deletion mass. -/ +@[expose] def massRight (a p h : ℝ) (x y : ℕ) : ℝ := (parentMass h x y - bias a p h x y) / 2 /-- Auxiliary child rate on the spatial left. -/ +@[expose] def rateLeft (a p h : ℝ) (x y : ℕ) : ℝ := if x + y = 0 then h else if x = 0 then max h (p / a) else massLeft a p h x y / x /-- Auxiliary child rate on the spatial right. -/ +@[expose] def rateRight (a p h : ℝ) (x y : ℕ) : ℝ := if x + y = 0 then h else if y = 0 then max h (p / a) else massRight a p h x y / y /-- Discrepancy `t = (p-q)/a`. -/ +@[expose] def discrepancy (a p h : ℝ) (x y : ℕ) : ℝ := (p - parentMass h x y) / a /-- Regularized inverse inventory `Z = p/(N+a/2)`. -/ +@[expose] def regularizedMass (a p : ℝ) (x y : ℕ) : ℝ := p / (inventory x y + a / 2) /-- Left-child discrepancy. -/ +@[expose] def discrepancyLeft (a p h : ℝ) (x y : ℕ) : ℝ := (p / 2 - massLeft a p h x y) / a /-- Right-child discrepancy. -/ +@[expose] def discrepancyRight (a p h : ℝ) (x y : ℕ) : ℝ := (p / 2 - massRight a p h x y) / a /-- Left-child regularized inverse inventory. -/ +@[expose] def regularizedMassLeft (a p : ℝ) (x : ℕ) : ℝ := (p / 2) / ((x : ℝ) + a / 2) /-- Right-child regularized inverse inventory. -/ +@[expose] def regularizedMassRight (a p : ℝ) (y : ℕ) : ℝ := (p / 2) / ((y : ℝ) + a / 2) /-- The quadratic Bellman correction in equation (15). -/ +@[expose] def bellman (h t Z : ℝ) : ℝ := (t - h / 2) * Z - t ^ 2 / 6 diff --git a/LeanPool/FullyDynamicMatching/FD1D/V5/Main.lean b/LeanPool/FullyDynamicMatching/FD1D/V5/Main.lean index 080829af5e..6ffc59ff02 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/V5/Main.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/V5/Main.lean @@ -19,7 +19,7 @@ theorem, the balanced-initial-law corollary, and the abstract resource guarantees. -/ -@[expose] public section +public section namespace FD1D.V5 @@ -29,6 +29,7 @@ open Filter MeasureTheory open scoped BigOperators Topology /-- One universal constant sufficient for both parts of the main theorem. -/ +@[expose] def universalConstant : ℝ := 72000 / Real.log 2 diff --git a/LeanPool/FullyDynamicMatching/FD1D/V5/PaperStatements.lean b/LeanPool/FullyDynamicMatching/FD1D/V5/PaperStatements.lean index c16232951c..4894217554 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/V5/PaperStatements.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/V5/PaperStatements.lean @@ -16,7 +16,7 @@ This module instantiates the compact paper-facing stochastic model with the hierarchical V5 selector and transfers the proved continuous-process bounds. -/ -@[expose] public section +public section namespace FD1D.V5.Palomar @@ -48,7 +48,10 @@ private theorem trajectoryFromState_hierarchicalPolicy_eq (L := FD1D.V5.treeDepth m) s₀ (FD1D.V5.parameterA m : ℝ) (FD1D.SupplyConfiguration.canonicalFallback (by omega)) := by - rfl + unfold trajectoryFromState ContinuousProcess.trajectoryLawFromState + unfold trajectoryFrom ContinuousProcess.trajectoryLawFrom + TrajectoryBridge.trajectoryLaw + congr 1 private theorem uniformTrajectory_hierarchicalPolicy_eq {m : ℕ} (hm : 1 ≤ m) : @@ -57,7 +60,10 @@ private theorem uniformTrajectory_hierarchicalPolicy_eq (L := FD1D.V5.treeDepth m) (m := m) (FD1D.V5.parameterA m : ℝ) (FD1D.SupplyConfiguration.canonicalFallback (by omega)) := by - rfl + unfold uniformTrajectory ContinuousProcess.trajectoryLaw + unfold trajectoryFrom + TrajectoryBridge.trajectoryLaw + congr 1 private theorem processCost_hierarchicalPolicy_eq {m : ℕ} (hm : 1 ≤ m) (z : ProcessState m) : diff --git a/LeanPool/FullyDynamicMatching/FD1D/V5/Parameters.lean b/LeanPool/FullyDynamicMatching/FD1D/V5/Parameters.lean index b8bc4d7822..3e9683b317 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/V5/Parameters.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/V5/Parameters.lean @@ -17,7 +17,7 @@ This module records the exact choices `n = 2^L = 2^floor(log₂(max(1, floor(m/a))))`. -/ -@[expose] public section +public section namespace FD1D.V5 @@ -38,6 +38,7 @@ def treeDepth (m : ℕ) : ℕ := Nat.log 2 (depthTarget m) /-- The number of leaves in the complete dyadic partition. -/ +@[expose] def leafCount (m : ℕ) : ℕ := 2 ^ treeDepth m diff --git a/LeanPool/FullyDynamicMatching/FD1D/V5/Process.lean b/LeanPool/FullyDynamicMatching/FD1D/V5/Process.lean index 7d3dc024f0..af6146bd0f 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/V5/Process.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/V5/Process.lean @@ -12,7 +12,7 @@ public import LeanPool.FullyDynamicMatching.FD1D.Realization /-! # Process -/ -@[expose] public section +public section namespace FD1D @@ -52,6 +52,7 @@ theorem stateDyadicMass_leafMass_eq_deletionRule Transport.stateDyadicMass_leafMass_eq_deletionRule a ha hm x w /-- The concrete supply label selected from the hierarchical dyadic mass. -/ +@[expose] def selectedSupplyLabel (a : ℝ) (C : SupplyConfiguration L m) (fallback : Fin m) (u : ℝ) : Fin m := C.selectedSupplyIndex (stateDyadicMass a C.countState) fallback u @@ -351,6 +352,7 @@ theorem actualStep_eq_actualLeafStep rfl /-- Pathwise cost of the actual match made in one hierarchical step. -/ +@[expose] def actualStepCost (a : ℝ) (C : SupplyConfiguration L m) (fallback : Fin m) (u : ℝ) : ℝ := |C.location (selectedSupplyLabel a C fallback u) - u| @@ -360,7 +362,7 @@ theorem actualStepCost_eq_selectedSupplyPoint (fallback : Fin m) (u : ℝ) : actualStepCost a C fallback u = |C.selectedSupplyPoint (stateDyadicMass a C.countState) - fallback u - u| := + fallback u - u| := by rfl /-- Integrating the pathwise one-step cost is exactly the existing configured @@ -372,6 +374,7 @@ theorem integral_actualStepCost_eq_expectedActualDistance rfl /-- Squared pathwise cost of the actual v5 match. -/ +@[expose] def actualStepSquaredCost (a : ℝ) (C : SupplyConfiguration L m) (fallback : Fin m) (u : ℝ) : ℝ := (C.location (selectedSupplyLabel a C fallback u) - u) ^ 2 @@ -381,7 +384,7 @@ theorem actualStepSquaredCost_eq_selectedSupplyPoint (fallback : Fin m) (u : ℝ) : actualStepSquaredCost a C fallback u = (C.selectedSupplyPoint (stateDyadicMass a C.countState) - fallback u - u) ^ 2 := + fallback u - u) ^ 2 := by rfl theorem integral_actualStepSquaredCost_eq_expected @@ -392,12 +395,14 @@ theorem integral_actualStepSquaredCost_eq_expected rfl /-- The actual one-period expected distance of a concrete configuration. -/ +@[expose] def actualConfigurationCost (a : ℝ) (hm : 0 < m) (C : SupplyConfiguration L m) : ℝ := C.expectedActualDistance (stateDyadicMass a C.countState) (SupplyConfiguration.canonicalFallback hm) /-- The actual one-period expected squared distance. -/ +@[expose] def actualConfigurationSquaredCost (a : ℝ) (hm : 0 < m) (C : SupplyConfiguration L m) : ℝ := Transport.expectedActualSquaredDistance C diff --git a/LeanPool/FullyDynamicMatching/FD1D/V5/QuantileSquared.lean b/LeanPool/FullyDynamicMatching/FD1D/V5/QuantileSquared.lean index ba3c13ecfc..c58ac76277 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/V5/QuantileSquared.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/V5/QuantileSquared.lean @@ -20,7 +20,7 @@ offset. On each leaf it is an elementary polynomial identity. At a branch, the two boundary cubic terms cancel. -/ -@[expose] public section +public section namespace FD1D diff --git a/LeanPool/FullyDynamicMatching/FD1D/V5/SquaredCost.lean b/LeanPool/FullyDynamicMatching/FD1D/V5/SquaredCost.lean index 300b8f7868..f7d823153a 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/V5/SquaredCost.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/V5/SquaredCost.lean @@ -17,7 +17,7 @@ bounds while allowing arbitrary occupied locations inside their certified dyadic cells. -/ -@[expose] public section +public section namespace FD1D.V5.Transport @@ -29,6 +29,7 @@ open Set MeasureTheory variable {L m : ℕ} /-- Conditional squared distance to the actual selected supply point. -/ +@[expose] def expectedActualSquaredDistance (C : SupplyConfiguration L m) (q : DyadicMass L) (fallback : Fin m) : ℝ := @@ -205,6 +206,7 @@ theorem expectedActualSquaredDistance_le rfl /-- Count-state envelope for the actual conditional squared matching cost. -/ +@[expose] def stateSquaredCostEnvelope (a : ℝ) (x : InventoryState (DyadicNode L) m) : ℝ := (dyadicCellWidth L + diff --git a/LeanPool/FullyDynamicMatching/FD1D/V5/StatementModel.lean b/LeanPool/FullyDynamicMatching/FD1D/V5/StatementModel.lean index dec9bc6893..dac82d1bad 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/V5/StatementModel.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/V5/StatementModel.lean @@ -24,7 +24,7 @@ uniform replenishment. The path measure below is the homogeneous Markov law driven by iid uniform demand/replenishment pairs. -/ -@[expose] public section +public section namespace FD1D.V5.Palomar @@ -40,6 +40,7 @@ abbrev Inventory (m : ℕ) := Fin m → unitInterval abbrev Noise := unitInterval × unitInterval /-- The law of an independent uniform demand/replenishment pair. -/ +@[expose] def noiseLaw : Measure Noise := (volume : Measure unitInterval).prod volume @@ -63,6 +64,7 @@ structure OnlinePolicy (m : ℕ) where Function.update p.1 (select p.1 p.2.1) p.2.2) /-- Replace the selected supply by the replenishment coordinate. -/ +@[expose] def step (P : OnlinePolicy m) (s : Inventory m) (z : Noise) : Inventory m := Function.update s (P.select s z.1) z.2 @@ -71,6 +73,7 @@ def step (P : OnlinePolicy m) (s : Inventory m) (z : Noise) : abbrev ProcessState (m : ℕ) := Inventory m × Noise /-- Apply the current noise and attach fresh noise for the next period. -/ +@[expose] def processAdvance (P : OnlinePolicy m) (p : ProcessState m × Noise) : ProcessState m := (step P p.1.1 p.1.2, p.2) @@ -80,6 +83,7 @@ theorem processAdvance_measurable (P : OnlinePolicy m) : exact (P.stepMeasurable.comp measurable_fst).prodMk measurable_snd /-- The homogeneous one-period kernel of an online policy. -/ +@[expose] def processKernel (P : OnlinePolicy m) : Kernel (ProcessState m) (ProcessState m) := (Kernel.id ×ₖ Kernel.const (ProcessState m) noiseLaw).map @@ -91,6 +95,7 @@ instance processKernel_isMarkovKernel (P : OnlinePolicy m) : exact Kernel.IsMarkovKernel.map _ (processAdvance_measurable P) /-- Attach an independent first demand/replenishment pair to an inventory law. -/ +@[expose] def initialProcessLaw (μ₀ : Measure (Inventory m)) : Measure (ProcessState m) := μ₀.prod noiseLaw @@ -102,6 +107,7 @@ instance initialProcessLaw_isProbabilityMeasure infer_instance /-- A homogeneous kernel viewed as a history-dependent kernel. -/ +@[expose] def historyKernel (P : OnlinePolicy m) (n : ℕ) : Kernel ((i : Finset.Iic n) → ProcessState m) (ProcessState m) := (processKernel P).comap @@ -113,6 +119,7 @@ instance historyKernel_isMarkovKernel (P : OnlinePolicy m) (n : ℕ) : infer_instance /-- The path-space law generated from an arbitrary initial inventory law. -/ +@[expose] def trajectoryFrom (P : OnlinePolicy m) (μ₀ : Measure (Inventory m)) : Measure (ℕ → ProcessState m) := @@ -120,11 +127,13 @@ def trajectoryFrom (P : OnlinePolicy m) (initialProcessLaw μ₀) (historyKernel P) /-- The trajectory law from a fixed initial inventory. -/ +@[expose] def trajectoryFromState (P : OnlinePolicy m) (s₀ : Inventory m) : Measure (ℕ → ProcessState m) := trajectoryFrom P (Measure.dirac s₀) /-- The iid uniform law of the inventory produced by scheduled replacement. -/ +@[expose] def uniformInventoryLaw (m : ℕ) : Measure (Inventory m) := Measure.pi fun _ : Fin m => (volume : Measure unitInterval) @@ -134,15 +143,18 @@ instance uniformInventoryLaw_isProbabilityMeasure : infer_instance /-- The policy trajectory after iid uniform initialization. -/ +@[expose] def uniformTrajectory (P : OnlinePolicy m) : Measure (ℕ → ProcessState m) := trajectoryFrom P (uniformInventoryLaw m) /-- The distance paid in one period. -/ +@[expose] def processCost (P : OnlinePolicy m) (z : ProcessState m) : ℝ := |(z.1 (P.select z.1 z.2.1) : ℝ) - (z.2.1 : ℝ)| /-- Root mean square one-period cost from a fixed initial inventory. -/ +@[expose] def trajectoryRMSCostFromState (P : OnlinePolicy m) (s₀ : Inventory m) (t : ℕ) : ℝ := Real.sqrt @@ -153,6 +165,7 @@ def trajectoryRMSCostFromState The total cost of matching once to every original labeled supply during the first `m` periods. -/ +@[expose] def initializationCost (initial demand : Inventory m) : ℝ := ∑ j, |(demand j : ℝ) - (initial j : ℝ)| @@ -160,6 +173,7 @@ def initializationCost (initial demand : Inventory m) : ℝ := Average cost over `N` periods: scheduled replacement first, followed by the online policy on the resulting iid uniform inventory. -/ +@[expose] def initializedAverageCost (P : OnlinePolicy m) (initial demand : Inventory m) (N : ℕ) (path : ℕ → ProcessState m) : ℝ := @@ -187,6 +201,7 @@ def memoryCount (m : ℕ) : ℕ := m + 4 * leafCount m /-- One explicit universal constant for both cost bounds. -/ +@[expose] def universalConstant : ℝ := 72000 / Real.log 2 diff --git a/LeanPool/FullyDynamicMatching/FD1D/V5/Symmetry.lean b/LeanPool/FullyDynamicMatching/FD1D/V5/Symmetry.lean index e54a213f2b..af58e6d049 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/V5/Symmetry.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/V5/Symmetry.lean @@ -17,7 +17,7 @@ The underlying subtree permutations are policy-independent and live in rates and deletion masses are equivariant under those permutations. -/ -@[expose] public section +public section namespace FD1D.V5.TreeSymmetry diff --git a/LeanPool/FullyDynamicMatching/FD1D/V5/TrajectoryBounds.lean b/LeanPool/FullyDynamicMatching/FD1D/V5/TrajectoryBounds.lean index 5cb7328b5b..1d3a4ac6de 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/V5/TrajectoryBounds.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/V5/TrajectoryBounds.lean @@ -11,7 +11,7 @@ public import LeanPool.FullyDynamicMatching.FD1D.V5.CostBounds /-! # Trajectory Bounds -/ -@[expose] public section +public section namespace FD1D.V5.ContinuousProcess @@ -90,6 +90,7 @@ theorem trajectoryExpectedSquaredCost_le_refreshedEnvelope /-- Per-period RMS cost of the parameterized policy from a fixed arbitrary initial inventory. -/ +@[expose] def trajectoryRMSCostFromState (m : ℕ) (hm : 1 ≤ m) (s₀ : SpatialState m) (t : ℕ) : ℝ := Real.sqrt diff --git a/LeanPool/FullyDynamicMatching/FD1D/V5/Transport.lean b/LeanPool/FullyDynamicMatching/FD1D/V5/Transport.lean index d43dfb6fd2..625eff6751 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/V5/Transport.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/V5/Transport.lean @@ -21,7 +21,7 @@ dyadic mass, identifies its integrated Haar coefficients with the v5 deletion imbalances, and proves the exact invariant-law `L²` identity. -/ -@[expose] public section +public section namespace FD1D.V5.Transport @@ -35,6 +35,7 @@ variable {L m : ℕ} /-! ## The concrete v5 dyadic mass -/ /-- The v5 deletion-mass tree below `v`, with `k` levels left to descend. -/ +@[expose] def stateDyadicMassAt (a : ℝ) (x : InventoryState (DyadicNode L) m) : (d k : ℕ) → DyadicNode d → DyadicMass k @@ -232,6 +233,7 @@ theorem stateDyadicMass_nodeCoefficient simp [appendDyadicNode, dyadicRoot] /-- The canonical v5 integrated-Haar coefficient family. -/ +@[expose] def stateHaarCoefficient (a : ℝ) (x : InventoryState (DyadicNode L) m) (i : CompleteHaarNode L) : ℝ := diff --git a/LeanPool/FullyDynamicMatching/FD1D/V5/TreePolicy.lean b/LeanPool/FullyDynamicMatching/FD1D/V5/TreePolicy.lean index 25f1bcede2..b040e32b94 100644 --- a/LeanPool/FullyDynamicMatching/FD1D/V5/TreePolicy.lean +++ b/LeanPool/FullyDynamicMatching/FD1D/V5/TreePolicy.lean @@ -16,7 +16,7 @@ tree. It proves the invariant domain, rate-energy monotonicity, the lifted local Bellman inequality, and the deterministic aggregate estimate. -/ -@[expose] public section +public section namespace FD1D.V5.TreePolicy @@ -27,10 +27,12 @@ open LocalPolicy variable {L m : ℕ} /-- Select the left or right rate of the local rule for one dyadic child. -/ +@[expose] def childRate (a p h : ℝ) (x y : ℕ) (side : Fin 2) : ℝ := if side = 0 then rateLeft a p h x y else rateRight a p h x y /-- Recursively propagated analytic rate, rooted at `1/m`. -/ +@[expose] def rate (I : AggregatedInventory L m) (a : ℝ) : ∀ d, DyadicNode d → ℝ | 0, _ => 1 / (m : ℝ) @@ -41,25 +43,30 @@ def rate (I : AggregatedInventory L m) (a : ℝ) : (I.count (d + 1) (rightChild z.1)) z.2 /-- Inventory count coerced to `ℝ`. -/ +@[expose] def inventory (I : AggregatedInventory L m) (d : ℕ) (v : DyadicNode d) : ℝ := I.count d v /-- Node interval mass. -/ +@[expose] def intervalMass (d : ℕ) (v : DyadicNode d) : ℝ := nodeMass d v /-- Deletion mass `q_v = N_v h_v`. -/ +@[expose] def deletionMass (I : AggregatedInventory L m) (a : ℝ) (d : ℕ) (v : DyadicNode d) : ℝ := inventory I d v * rate I a d v /-- Discrepancy `t_v = (p_v-q_v)/a`. -/ +@[expose] def discrepancy (I : AggregatedInventory L m) (a : ℝ) (d : ℕ) (v : DyadicNode d) : ℝ := (intervalMass d v - deletionMass I a d v) / a /-- Regularized mass `Z_v = p_v/(N_v+a/2)`. -/ +@[expose] def regularizedMass (I : AggregatedInventory L m) (a : ℝ) (d : ℕ) (v : DyadicNode d) : ℝ := intervalMass d v / (inventory I d v + a / 2) @@ -71,6 +78,7 @@ def bellmanValue (I : AggregatedInventory L m) (a : ℝ) (d : ℕ) (regularizedMass I a d v) /-- Fixed-spatial-label child deletion imbalance. -/ +@[expose] def imbalance (I : AggregatedInventory L m) (a : ℝ) (d : ℕ) (v : DyadicNode d) : ℝ := deletionMass I a (d + 1) (leftChild v) - @@ -571,10 +579,12 @@ theorem local_bellman_inequality_separated /-! ## Deterministic aggregate estimate -/ /-- The transport energy `G = ∑_{v internal} p_v b_v²`. -/ +@[expose] def transportEnergy (I : AggregatedInventory L m) (a : ℝ) : ℝ := internalWeightedSum (fun d v => imbalance I a d v ^ 2) L /-- The restoring term in the drift of the harmonic inventory potential. -/ +@[expose] def restoringDrift (I : AggregatedInventory L m) (a : ℝ) : ℝ := bellmanDrift L (a / 2) (inventory I) (deletionMass I a) 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/GraphColouringMatching/Basic.lean b/LeanPool/GraphColouringMatching/Basic.lean index 3d0a7f6207..16c961cedf 100644 --- a/LeanPool/GraphColouringMatching/Basic.lean +++ b/LeanPool/GraphColouringMatching/Basic.lean @@ -22,7 +22,7 @@ colour. Empty classes are allowed. These are classical equivalences of representations, not new graph-theoretic bounds. -/ -@[expose] public section +public section namespace SimpleGraph diff --git a/LeanPool/GraphColouringMatching/Cardinal.lean b/LeanPool/GraphColouringMatching/Cardinal.lean index 605bedaca1..04cbf0e135 100644 --- a/LeanPool/GraphColouringMatching/Cardinal.lean +++ b/LeanPool/GraphColouringMatching/Cardinal.lean @@ -16,7 +16,7 @@ vertices, edges, or palette. The lift only reconciles the two type universes. This is distinct from natural-number counting, which requires finite edges. -/ -@[expose] public section +public section universe u v diff --git a/LeanPool/GraphColouringMatching/Finite.lean b/LeanPool/GraphColouringMatching/Finite.lean index 718cfc0c3a..f112de6100 100644 --- a/LeanPool/GraphColouringMatching/Finite.lean +++ b/LeanPool/GraphColouringMatching/Finite.lean @@ -16,7 +16,7 @@ with unused colours. Only the edge set must be finite: infinitely many isolated vertices are allowed. Empty matching classes contribute zero. -/ -@[expose] public section +public section namespace SimpleGraph.MatchingDecomposition 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 9a91380610..001f021021 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 4bc7efa036..ab87362760 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..9d3c2e43f0 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,13 +31,13 @@ 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 +@[expose] noncomputable def partsTriangleC : R2 := (partsPoint 215).toR2 /-- The origin, adjacent to all three canonical triangle vertices. -/ noncomputable def partsTriangleCenter : R2 := (partsPoint 0).toR2 diff --git a/LeanPool/HadwigerNelsonBounds/PartsCertificate.lean b/LeanPool/HadwigerNelsonBounds/PartsCertificate.lean index 54abb932c1..dfd3fbcdf6 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,21 +69,22 @@ 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. -/ -def PartsProper (coloring : Fin 481 → Fin 4) : Prop := +@[expose] 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..68ea35e549 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsFirstStage.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsFirstStage.lean @@ -13,6 +13,8 @@ public import LeanPool.HadwigerNelsonBounds.PartsCertificateData3 public import LeanPool.HadwigerNelsonBounds.PartsCertificateData4 public import LeanPool.HadwigerNelsonBounds.PartsCertificateData5 public import LeanPool.HadwigerNelsonBounds.PartsCertificateData6 +import Mathlib.Tactic.IntervalCases +import Mathlib.Tactic.NormNum /-! # The Parts obstruction to a monochromatic sqrt-three triangle @@ -22,25 +24,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 => @@ -190,11 +192,4929 @@ private lemma IsTransform.isUnit_eq {symmetry : Fin 6} {point image : PartsPoint end PartsPoint /-- The stored vertex tables implement the exact isometries described above. -/ +private lemma partsPoint_permuteVertex_isTransform_case0 : + ∀ vertex, PartsPoint.IsTransform (0 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (0 : Fin 6) vertex)) := by + rintro ⟨vertex, bound⟩ + have hsplit : + vertex < 120 ∨ + (120 ≤ vertex ∧ vertex < 240) ∨ + (240 ≤ vertex ∧ vertex < 360) ∨ + 360 ≤ vertex := by omega + rcases hsplit with upper | ⟨lower, upper⟩ | ⟨lower, upper⟩ | lower + all_goals + interval_cases vertex <;> simp only [PartsPoint.IsTransform] + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + rfl + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk0 + (vertex : Fin 481) (range : vertex.val < 8) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + interval_cases vertex + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk0, + partsPointChunk0] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk1 + (vertex : Fin 481) (range : 8 ≤ vertex.val ∧ vertex.val < 16) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk0, + partsPointChunk0] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk2 + (vertex : Fin 481) (range : 16 ≤ vertex.val ∧ vertex.val < 24) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk0, + partsPointChunk0] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk3 + (vertex : Fin 481) (range : 24 ≤ vertex.val ∧ vertex.val < 32) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk0, + partsPointChunk0] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk4 + (vertex : Fin 481) (range : 32 ≤ vertex.val ∧ vertex.val < 40) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk0, + partsPointChunk0] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk5 + (vertex : Fin 481) (range : 40 ≤ vertex.val ∧ vertex.val < 48) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk0, + partsPointChunk0] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk6 + (vertex : Fin 481) (range : 48 ≤ vertex.val ∧ vertex.val < 56) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk0, + partsPointChunk0, partsPointChunk1] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk7 + (vertex : Fin 481) (range : 56 ≤ vertex.val ∧ vertex.val < 64) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk0, + partsPointChunk0] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk8 + (vertex : Fin 481) (range : 64 ≤ vertex.val ∧ vertex.val < 72) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk1, + partsPointChunk0, partsPointChunk1] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk9 + (vertex : Fin 481) (range : 72 ≤ vertex.val ∧ vertex.val < 80) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk1, + partsPointChunk1] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk10 + (vertex : Fin 481) (range : 80 ≤ vertex.val ∧ vertex.val < 88) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk1, + partsPointChunk1] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk11 + (vertex : Fin 481) (range : 88 ≤ vertex.val ∧ vertex.val < 96) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk1, + partsPointChunk1] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk12 + (vertex : Fin 481) (range : 96 ≤ vertex.val ∧ vertex.val < 104) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk1, + partsPointChunk1] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk13 + (vertex : Fin 481) (range : 104 ≤ vertex.val ∧ vertex.val < 112) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk1, + partsPointChunk1] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk14 + (vertex : Fin 481) (range : 112 ≤ vertex.val ∧ vertex.val < 120) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk1, + partsPointChunk1, partsPointChunk2] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk15 + (vertex : Fin 481) (range : 120 ≤ vertex.val ∧ vertex.val < 128) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk1, + partsPointChunk1] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk16 + (vertex : Fin 481) (range : 128 ≤ vertex.val ∧ vertex.val < 136) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk2, + partsPointChunk1, partsPointChunk2] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk17 + (vertex : Fin 481) (range : 136 ≤ vertex.val ∧ vertex.val < 144) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk2, + partsPointChunk2] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk18 + (vertex : Fin 481) (range : 144 ≤ vertex.val ∧ vertex.val < 152) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk2, + partsPointChunk2] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk19 + (vertex : Fin 481) (range : 152 ≤ vertex.val ∧ vertex.val < 160) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk2, + partsPointChunk2] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk20 + (vertex : Fin 481) (range : 160 ≤ vertex.val ∧ vertex.val < 168) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk2, + partsPointChunk2] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk21 + (vertex : Fin 481) (range : 168 ≤ vertex.val ∧ vertex.val < 176) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk2, + partsPointChunk2] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk22 + (vertex : Fin 481) (range : 176 ≤ vertex.val ∧ vertex.val < 184) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk2, + partsPointChunk2] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk23 + (vertex : Fin 481) (range : 184 ≤ vertex.val ∧ vertex.val < 192) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk2, + partsPointChunk2, partsPointChunk3] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk24 + (vertex : Fin 481) (range : 192 ≤ vertex.val ∧ vertex.val < 200) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk3, + partsPointChunk2, partsPointChunk3] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk25 + (vertex : Fin 481) (range : 200 ≤ vertex.val ∧ vertex.val < 208) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk3, + partsPointChunk3] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk26 + (vertex : Fin 481) (range : 208 ≤ vertex.val ∧ vertex.val < 216) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk3, + partsPointChunk3] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk27 + (vertex : Fin 481) (range : 216 ≤ vertex.val ∧ vertex.val < 224) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk3, + partsPointChunk3] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk28 + (vertex : Fin 481) (range : 224 ≤ vertex.val ∧ vertex.val < 232) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk3, + partsPointChunk3] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk29 + (vertex : Fin 481) (range : 232 ≤ vertex.val ∧ vertex.val < 240) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk3, + partsPointChunk3] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk30 + (vertex : Fin 481) (range : 240 ≤ vertex.val ∧ vertex.val < 248) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk3, + partsPointChunk3, partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk31 + (vertex : Fin 481) (range : 248 ≤ vertex.val ∧ vertex.val < 256) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk3, + partsPointChunk3, partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk32 + (vertex : Fin 481) (range : 256 ≤ vertex.val ∧ vertex.val < 264) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk4, + partsPointChunk3, partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk33 + (vertex : Fin 481) (range : 264 ≤ vertex.val ∧ vertex.val < 272) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk4, + partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk34 + (vertex : Fin 481) (range : 272 ≤ vertex.val ∧ vertex.val < 280) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk4, + partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk35 + (vertex : Fin 481) (range : 280 ≤ vertex.val ∧ vertex.val < 288) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk4, + partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk36 + (vertex : Fin 481) (range : 288 ≤ vertex.val ∧ vertex.val < 296) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk4, + partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk37 + (vertex : Fin 481) (range : 296 ≤ vertex.val ∧ vertex.val < 304) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk4, + partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk38 + (vertex : Fin 481) (range : 304 ≤ vertex.val ∧ vertex.val < 312) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk4, + partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk39 + (vertex : Fin 481) (range : 312 ≤ vertex.val ∧ vertex.val < 320) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk4, + partsPointChunk4, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk40 + (vertex : Fin 481) (range : 320 ≤ vertex.val ∧ vertex.val < 328) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk5, + partsPointChunk4, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk41 + (vertex : Fin 481) (range : 328 ≤ vertex.val ∧ vertex.val < 336) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk5, + partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk42 + (vertex : Fin 481) (range : 336 ≤ vertex.val ∧ vertex.val < 344) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk5, + partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk43 + (vertex : Fin 481) (range : 344 ≤ vertex.val ∧ vertex.val < 352) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk5, + partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk44 + (vertex : Fin 481) (range : 352 ≤ vertex.val ∧ vertex.val < 360) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk5, + partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk45 + (vertex : Fin 481) (range : 360 ≤ vertex.val ∧ vertex.val < 368) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk5, + partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk46 + (vertex : Fin 481) (range : 368 ≤ vertex.val ∧ vertex.val < 376) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk5, + partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk47 + (vertex : Fin 481) (range : 376 ≤ vertex.val ∧ vertex.val < 384) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk5, + partsPointChunk5, partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk48 + (vertex : Fin 481) (range : 384 ≤ vertex.val ∧ vertex.val < 392) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk6, + partsPointChunk5, partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk49 + (vertex : Fin 481) (range : 392 ≤ vertex.val ∧ vertex.val < 400) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk6, + partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk50 + (vertex : Fin 481) (range : 400 ≤ vertex.val ∧ vertex.val < 408) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk6, + partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk51 + (vertex : Fin 481) (range : 408 ≤ vertex.val ∧ vertex.val < 416) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk6, + partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk52 + (vertex : Fin 481) (range : 416 ≤ vertex.val ∧ vertex.val < 424) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk6, + partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk53 + (vertex : Fin 481) (range : 424 ≤ vertex.val ∧ vertex.val < 432) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk6, + partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk54 + (vertex : Fin 481) (range : 432 ≤ vertex.val ∧ vertex.val < 440) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk6, + partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk55 + (vertex : Fin 481) (range : 440 ≤ vertex.val ∧ vertex.val < 448) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk6, + partsPointChunk6, partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk56 + (vertex : Fin 481) (range : 448 ≤ vertex.val ∧ vertex.val < 456) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk7, + partsPointChunk6, partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk57 + (vertex : Fin 481) (range : 456 ≤ vertex.val ∧ vertex.val < 464) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk7, + partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk58 + (vertex : Fin 481) (range : 464 ≤ vertex.val ∧ vertex.val < 472) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk7, + partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk59 + (vertex : Fin 481) (range : 472 ≤ vertex.val ∧ vertex.val < 480) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk7, + partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case1_chunk60 + (vertex : Fin 481) (range : 480 ≤ vertex.val ∧ vertex.val < 481) : + PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation1, partsVertexPermutation1Chunk7, + partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case1 : + ∀ vertex, PartsPoint.IsTransform (1 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (1 : Fin 6) vertex)) := by + intro vertex + by_cases h0 : vertex.val < 8 + · exact partsPoint_permuteVertex_isTransform_case1_chunk0 vertex h0 + by_cases h1 : vertex.val < 16 + · exact partsPoint_permuteVertex_isTransform_case1_chunk1 vertex ⟨by omega, h1⟩ + by_cases h2 : vertex.val < 24 + · exact partsPoint_permuteVertex_isTransform_case1_chunk2 vertex ⟨by omega, h2⟩ + by_cases h3 : vertex.val < 32 + · exact partsPoint_permuteVertex_isTransform_case1_chunk3 vertex ⟨by omega, h3⟩ + by_cases h4 : vertex.val < 40 + · exact partsPoint_permuteVertex_isTransform_case1_chunk4 vertex ⟨by omega, h4⟩ + by_cases h5 : vertex.val < 48 + · exact partsPoint_permuteVertex_isTransform_case1_chunk5 vertex ⟨by omega, h5⟩ + by_cases h6 : vertex.val < 56 + · exact partsPoint_permuteVertex_isTransform_case1_chunk6 vertex ⟨by omega, h6⟩ + by_cases h7 : vertex.val < 64 + · exact partsPoint_permuteVertex_isTransform_case1_chunk7 vertex ⟨by omega, h7⟩ + by_cases h8 : vertex.val < 72 + · exact partsPoint_permuteVertex_isTransform_case1_chunk8 vertex ⟨by omega, h8⟩ + by_cases h9 : vertex.val < 80 + · exact partsPoint_permuteVertex_isTransform_case1_chunk9 vertex ⟨by omega, h9⟩ + by_cases h10 : vertex.val < 88 + · exact partsPoint_permuteVertex_isTransform_case1_chunk10 vertex ⟨by omega, h10⟩ + by_cases h11 : vertex.val < 96 + · exact partsPoint_permuteVertex_isTransform_case1_chunk11 vertex ⟨by omega, h11⟩ + by_cases h12 : vertex.val < 104 + · exact partsPoint_permuteVertex_isTransform_case1_chunk12 vertex ⟨by omega, h12⟩ + by_cases h13 : vertex.val < 112 + · exact partsPoint_permuteVertex_isTransform_case1_chunk13 vertex ⟨by omega, h13⟩ + by_cases h14 : vertex.val < 120 + · exact partsPoint_permuteVertex_isTransform_case1_chunk14 vertex ⟨by omega, h14⟩ + by_cases h15 : vertex.val < 128 + · exact partsPoint_permuteVertex_isTransform_case1_chunk15 vertex ⟨by omega, h15⟩ + by_cases h16 : vertex.val < 136 + · exact partsPoint_permuteVertex_isTransform_case1_chunk16 vertex ⟨by omega, h16⟩ + by_cases h17 : vertex.val < 144 + · exact partsPoint_permuteVertex_isTransform_case1_chunk17 vertex ⟨by omega, h17⟩ + by_cases h18 : vertex.val < 152 + · exact partsPoint_permuteVertex_isTransform_case1_chunk18 vertex ⟨by omega, h18⟩ + by_cases h19 : vertex.val < 160 + · exact partsPoint_permuteVertex_isTransform_case1_chunk19 vertex ⟨by omega, h19⟩ + by_cases h20 : vertex.val < 168 + · exact partsPoint_permuteVertex_isTransform_case1_chunk20 vertex ⟨by omega, h20⟩ + by_cases h21 : vertex.val < 176 + · exact partsPoint_permuteVertex_isTransform_case1_chunk21 vertex ⟨by omega, h21⟩ + by_cases h22 : vertex.val < 184 + · exact partsPoint_permuteVertex_isTransform_case1_chunk22 vertex ⟨by omega, h22⟩ + by_cases h23 : vertex.val < 192 + · exact partsPoint_permuteVertex_isTransform_case1_chunk23 vertex ⟨by omega, h23⟩ + by_cases h24 : vertex.val < 200 + · exact partsPoint_permuteVertex_isTransform_case1_chunk24 vertex ⟨by omega, h24⟩ + by_cases h25 : vertex.val < 208 + · exact partsPoint_permuteVertex_isTransform_case1_chunk25 vertex ⟨by omega, h25⟩ + by_cases h26 : vertex.val < 216 + · exact partsPoint_permuteVertex_isTransform_case1_chunk26 vertex ⟨by omega, h26⟩ + by_cases h27 : vertex.val < 224 + · exact partsPoint_permuteVertex_isTransform_case1_chunk27 vertex ⟨by omega, h27⟩ + by_cases h28 : vertex.val < 232 + · exact partsPoint_permuteVertex_isTransform_case1_chunk28 vertex ⟨by omega, h28⟩ + by_cases h29 : vertex.val < 240 + · exact partsPoint_permuteVertex_isTransform_case1_chunk29 vertex ⟨by omega, h29⟩ + by_cases h30 : vertex.val < 248 + · exact partsPoint_permuteVertex_isTransform_case1_chunk30 vertex ⟨by omega, h30⟩ + by_cases h31 : vertex.val < 256 + · exact partsPoint_permuteVertex_isTransform_case1_chunk31 vertex ⟨by omega, h31⟩ + by_cases h32 : vertex.val < 264 + · exact partsPoint_permuteVertex_isTransform_case1_chunk32 vertex ⟨by omega, h32⟩ + by_cases h33 : vertex.val < 272 + · exact partsPoint_permuteVertex_isTransform_case1_chunk33 vertex ⟨by omega, h33⟩ + by_cases h34 : vertex.val < 280 + · exact partsPoint_permuteVertex_isTransform_case1_chunk34 vertex ⟨by omega, h34⟩ + by_cases h35 : vertex.val < 288 + · exact partsPoint_permuteVertex_isTransform_case1_chunk35 vertex ⟨by omega, h35⟩ + by_cases h36 : vertex.val < 296 + · exact partsPoint_permuteVertex_isTransform_case1_chunk36 vertex ⟨by omega, h36⟩ + by_cases h37 : vertex.val < 304 + · exact partsPoint_permuteVertex_isTransform_case1_chunk37 vertex ⟨by omega, h37⟩ + by_cases h38 : vertex.val < 312 + · exact partsPoint_permuteVertex_isTransform_case1_chunk38 vertex ⟨by omega, h38⟩ + by_cases h39 : vertex.val < 320 + · exact partsPoint_permuteVertex_isTransform_case1_chunk39 vertex ⟨by omega, h39⟩ + by_cases h40 : vertex.val < 328 + · exact partsPoint_permuteVertex_isTransform_case1_chunk40 vertex ⟨by omega, h40⟩ + by_cases h41 : vertex.val < 336 + · exact partsPoint_permuteVertex_isTransform_case1_chunk41 vertex ⟨by omega, h41⟩ + by_cases h42 : vertex.val < 344 + · exact partsPoint_permuteVertex_isTransform_case1_chunk42 vertex ⟨by omega, h42⟩ + by_cases h43 : vertex.val < 352 + · exact partsPoint_permuteVertex_isTransform_case1_chunk43 vertex ⟨by omega, h43⟩ + by_cases h44 : vertex.val < 360 + · exact partsPoint_permuteVertex_isTransform_case1_chunk44 vertex ⟨by omega, h44⟩ + by_cases h45 : vertex.val < 368 + · exact partsPoint_permuteVertex_isTransform_case1_chunk45 vertex ⟨by omega, h45⟩ + by_cases h46 : vertex.val < 376 + · exact partsPoint_permuteVertex_isTransform_case1_chunk46 vertex ⟨by omega, h46⟩ + by_cases h47 : vertex.val < 384 + · exact partsPoint_permuteVertex_isTransform_case1_chunk47 vertex ⟨by omega, h47⟩ + by_cases h48 : vertex.val < 392 + · exact partsPoint_permuteVertex_isTransform_case1_chunk48 vertex ⟨by omega, h48⟩ + by_cases h49 : vertex.val < 400 + · exact partsPoint_permuteVertex_isTransform_case1_chunk49 vertex ⟨by omega, h49⟩ + by_cases h50 : vertex.val < 408 + · exact partsPoint_permuteVertex_isTransform_case1_chunk50 vertex ⟨by omega, h50⟩ + by_cases h51 : vertex.val < 416 + · exact partsPoint_permuteVertex_isTransform_case1_chunk51 vertex ⟨by omega, h51⟩ + by_cases h52 : vertex.val < 424 + · exact partsPoint_permuteVertex_isTransform_case1_chunk52 vertex ⟨by omega, h52⟩ + by_cases h53 : vertex.val < 432 + · exact partsPoint_permuteVertex_isTransform_case1_chunk53 vertex ⟨by omega, h53⟩ + by_cases h54 : vertex.val < 440 + · exact partsPoint_permuteVertex_isTransform_case1_chunk54 vertex ⟨by omega, h54⟩ + by_cases h55 : vertex.val < 448 + · exact partsPoint_permuteVertex_isTransform_case1_chunk55 vertex ⟨by omega, h55⟩ + by_cases h56 : vertex.val < 456 + · exact partsPoint_permuteVertex_isTransform_case1_chunk56 vertex ⟨by omega, h56⟩ + by_cases h57 : vertex.val < 464 + · exact partsPoint_permuteVertex_isTransform_case1_chunk57 vertex ⟨by omega, h57⟩ + by_cases h58 : vertex.val < 472 + · exact partsPoint_permuteVertex_isTransform_case1_chunk58 vertex ⟨by omega, h58⟩ + by_cases h59 : vertex.val < 480 + · exact partsPoint_permuteVertex_isTransform_case1_chunk59 vertex ⟨by omega, h59⟩ + exact partsPoint_permuteVertex_isTransform_case1_chunk60 vertex ⟨by omega, by omega⟩ + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk0 + (vertex : Fin 481) (range : vertex.val < 8) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + interval_cases vertex + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk0, + partsPointChunk0] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk1 + (vertex : Fin 481) (range : 8 ≤ vertex.val ∧ vertex.val < 16) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk0, + partsPointChunk0] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk2 + (vertex : Fin 481) (range : 16 ≤ vertex.val ∧ vertex.val < 24) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk0, + partsPointChunk0] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk3 + (vertex : Fin 481) (range : 24 ≤ vertex.val ∧ vertex.val < 32) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk0, + partsPointChunk0] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk4 + (vertex : Fin 481) (range : 32 ≤ vertex.val ∧ vertex.val < 40) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk0, + partsPointChunk0] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk5 + (vertex : Fin 481) (range : 40 ≤ vertex.val ∧ vertex.val < 48) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk0, + partsPointChunk0] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk6 + (vertex : Fin 481) (range : 48 ≤ vertex.val ∧ vertex.val < 56) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk0, + partsPointChunk0] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk7 + (vertex : Fin 481) (range : 56 ≤ vertex.val ∧ vertex.val < 64) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk0, + partsPointChunk0, partsPointChunk1] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk8 + (vertex : Fin 481) (range : 64 ≤ vertex.val ∧ vertex.val < 72) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk1, + partsPointChunk0, partsPointChunk1] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk9 + (vertex : Fin 481) (range : 72 ≤ vertex.val ∧ vertex.val < 80) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk1, + partsPointChunk1] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk10 + (vertex : Fin 481) (range : 80 ≤ vertex.val ∧ vertex.val < 88) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk1, + partsPointChunk1] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk11 + (vertex : Fin 481) (range : 88 ≤ vertex.val ∧ vertex.val < 96) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk1, + partsPointChunk1] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk12 + (vertex : Fin 481) (range : 96 ≤ vertex.val ∧ vertex.val < 104) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk1, + partsPointChunk1] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk13 + (vertex : Fin 481) (range : 104 ≤ vertex.val ∧ vertex.val < 112) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk1, + partsPointChunk1] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk14 + (vertex : Fin 481) (range : 112 ≤ vertex.val ∧ vertex.val < 120) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk1, + partsPointChunk1] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk15 + (vertex : Fin 481) (range : 120 ≤ vertex.val ∧ vertex.val < 128) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk1, + partsPointChunk1, partsPointChunk2] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk16 + (vertex : Fin 481) (range : 128 ≤ vertex.val ∧ vertex.val < 136) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk2, + partsPointChunk1, partsPointChunk2] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk17 + (vertex : Fin 481) (range : 136 ≤ vertex.val ∧ vertex.val < 144) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk2, + partsPointChunk2] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk18 + (vertex : Fin 481) (range : 144 ≤ vertex.val ∧ vertex.val < 152) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk2, + partsPointChunk2] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk19 + (vertex : Fin 481) (range : 152 ≤ vertex.val ∧ vertex.val < 160) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk2, + partsPointChunk2] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk20 + (vertex : Fin 481) (range : 160 ≤ vertex.val ∧ vertex.val < 168) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk2, + partsPointChunk2] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk21 + (vertex : Fin 481) (range : 168 ≤ vertex.val ∧ vertex.val < 176) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk2, + partsPointChunk2] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk22 + (vertex : Fin 481) (range : 176 ≤ vertex.val ∧ vertex.val < 184) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk2, + partsPointChunk2] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk23 + (vertex : Fin 481) (range : 184 ≤ vertex.val ∧ vertex.val < 192) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk2, + partsPointChunk2, partsPointChunk3] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk24 + (vertex : Fin 481) (range : 192 ≤ vertex.val ∧ vertex.val < 200) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk3, + partsPointChunk2, partsPointChunk3] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk25 + (vertex : Fin 481) (range : 200 ≤ vertex.val ∧ vertex.val < 208) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk3, + partsPointChunk3] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk26 + (vertex : Fin 481) (range : 208 ≤ vertex.val ∧ vertex.val < 216) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk3, + partsPointChunk3] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk27 + (vertex : Fin 481) (range : 216 ≤ vertex.val ∧ vertex.val < 224) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk3, + partsPointChunk3] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk28 + (vertex : Fin 481) (range : 224 ≤ vertex.val ∧ vertex.val < 232) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk3, + partsPointChunk3] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk29 + (vertex : Fin 481) (range : 232 ≤ vertex.val ∧ vertex.val < 240) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk3, + partsPointChunk3] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk30 + (vertex : Fin 481) (range : 240 ≤ vertex.val ∧ vertex.val < 248) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk3, + partsPointChunk3] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk31 + (vertex : Fin 481) (range : 248 ≤ vertex.val ∧ vertex.val < 256) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk3, + partsPointChunk3, partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk32 + (vertex : Fin 481) (range : 256 ≤ vertex.val ∧ vertex.val < 264) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk4, + partsPointChunk3, partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk33 + (vertex : Fin 481) (range : 264 ≤ vertex.val ∧ vertex.val < 272) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk4, + partsPointChunk3, partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk34 + (vertex : Fin 481) (range : 272 ≤ vertex.val ∧ vertex.val < 280) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk4, + partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk35 + (vertex : Fin 481) (range : 280 ≤ vertex.val ∧ vertex.val < 288) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk4, + partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk36 + (vertex : Fin 481) (range : 288 ≤ vertex.val ∧ vertex.val < 296) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk4, + partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk37 + (vertex : Fin 481) (range : 296 ≤ vertex.val ∧ vertex.val < 304) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk4, + partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk38 + (vertex : Fin 481) (range : 304 ≤ vertex.val ∧ vertex.val < 312) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk4, + partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk39 + (vertex : Fin 481) (range : 312 ≤ vertex.val ∧ vertex.val < 320) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk4, + partsPointChunk4, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk40 + (vertex : Fin 481) (range : 320 ≤ vertex.val ∧ vertex.val < 328) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk5, + partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk41 + (vertex : Fin 481) (range : 328 ≤ vertex.val ∧ vertex.val < 336) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk5, + partsPointChunk4, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk42 + (vertex : Fin 481) (range : 336 ≤ vertex.val ∧ vertex.val < 344) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk5, + partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk43 + (vertex : Fin 481) (range : 344 ≤ vertex.val ∧ vertex.val < 352) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk5, + partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk44 + (vertex : Fin 481) (range : 352 ≤ vertex.val ∧ vertex.val < 360) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk5, + partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk45 + (vertex : Fin 481) (range : 360 ≤ vertex.val ∧ vertex.val < 368) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk5, + partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk46 + (vertex : Fin 481) (range : 368 ≤ vertex.val ∧ vertex.val < 376) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk5, + partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk47 + (vertex : Fin 481) (range : 376 ≤ vertex.val ∧ vertex.val < 384) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk5, + partsPointChunk5, partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk48 + (vertex : Fin 481) (range : 384 ≤ vertex.val ∧ vertex.val < 392) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk6, + partsPointChunk5, partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk49 + (vertex : Fin 481) (range : 392 ≤ vertex.val ∧ vertex.val < 400) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk6, + partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk50 + (vertex : Fin 481) (range : 400 ≤ vertex.val ∧ vertex.val < 408) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk6, + partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk51 + (vertex : Fin 481) (range : 408 ≤ vertex.val ∧ vertex.val < 416) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk6, + partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk52 + (vertex : Fin 481) (range : 416 ≤ vertex.val ∧ vertex.val < 424) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk6, + partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk53 + (vertex : Fin 481) (range : 424 ≤ vertex.val ∧ vertex.val < 432) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk6, + partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk54 + (vertex : Fin 481) (range : 432 ≤ vertex.val ∧ vertex.val < 440) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk6, + partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk55 + (vertex : Fin 481) (range : 440 ≤ vertex.val ∧ vertex.val < 448) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk6, + partsPointChunk6, partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk56 + (vertex : Fin 481) (range : 448 ≤ vertex.val ∧ vertex.val < 456) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk7, + partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk57 + (vertex : Fin 481) (range : 456 ≤ vertex.val ∧ vertex.val < 464) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk7, + partsPointChunk6, partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk58 + (vertex : Fin 481) (range : 464 ≤ vertex.val ∧ vertex.val < 472) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk7, + partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk59 + (vertex : Fin 481) (range : 472 ≤ vertex.val ∧ vertex.val < 480) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk7, + partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case2_chunk60 + (vertex : Fin 481) (range : 480 ≤ vertex.val ∧ vertex.val < 481) : + PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation2, partsVertexPermutation2Chunk7, + partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case2 : + ∀ vertex, PartsPoint.IsTransform (2 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (2 : Fin 6) vertex)) := by + intro vertex + by_cases h0 : vertex.val < 8 + · exact partsPoint_permuteVertex_isTransform_case2_chunk0 vertex h0 + by_cases h1 : vertex.val < 16 + · exact partsPoint_permuteVertex_isTransform_case2_chunk1 vertex ⟨by omega, h1⟩ + by_cases h2 : vertex.val < 24 + · exact partsPoint_permuteVertex_isTransform_case2_chunk2 vertex ⟨by omega, h2⟩ + by_cases h3 : vertex.val < 32 + · exact partsPoint_permuteVertex_isTransform_case2_chunk3 vertex ⟨by omega, h3⟩ + by_cases h4 : vertex.val < 40 + · exact partsPoint_permuteVertex_isTransform_case2_chunk4 vertex ⟨by omega, h4⟩ + by_cases h5 : vertex.val < 48 + · exact partsPoint_permuteVertex_isTransform_case2_chunk5 vertex ⟨by omega, h5⟩ + by_cases h6 : vertex.val < 56 + · exact partsPoint_permuteVertex_isTransform_case2_chunk6 vertex ⟨by omega, h6⟩ + by_cases h7 : vertex.val < 64 + · exact partsPoint_permuteVertex_isTransform_case2_chunk7 vertex ⟨by omega, h7⟩ + by_cases h8 : vertex.val < 72 + · exact partsPoint_permuteVertex_isTransform_case2_chunk8 vertex ⟨by omega, h8⟩ + by_cases h9 : vertex.val < 80 + · exact partsPoint_permuteVertex_isTransform_case2_chunk9 vertex ⟨by omega, h9⟩ + by_cases h10 : vertex.val < 88 + · exact partsPoint_permuteVertex_isTransform_case2_chunk10 vertex ⟨by omega, h10⟩ + by_cases h11 : vertex.val < 96 + · exact partsPoint_permuteVertex_isTransform_case2_chunk11 vertex ⟨by omega, h11⟩ + by_cases h12 : vertex.val < 104 + · exact partsPoint_permuteVertex_isTransform_case2_chunk12 vertex ⟨by omega, h12⟩ + by_cases h13 : vertex.val < 112 + · exact partsPoint_permuteVertex_isTransform_case2_chunk13 vertex ⟨by omega, h13⟩ + by_cases h14 : vertex.val < 120 + · exact partsPoint_permuteVertex_isTransform_case2_chunk14 vertex ⟨by omega, h14⟩ + by_cases h15 : vertex.val < 128 + · exact partsPoint_permuteVertex_isTransform_case2_chunk15 vertex ⟨by omega, h15⟩ + by_cases h16 : vertex.val < 136 + · exact partsPoint_permuteVertex_isTransform_case2_chunk16 vertex ⟨by omega, h16⟩ + by_cases h17 : vertex.val < 144 + · exact partsPoint_permuteVertex_isTransform_case2_chunk17 vertex ⟨by omega, h17⟩ + by_cases h18 : vertex.val < 152 + · exact partsPoint_permuteVertex_isTransform_case2_chunk18 vertex ⟨by omega, h18⟩ + by_cases h19 : vertex.val < 160 + · exact partsPoint_permuteVertex_isTransform_case2_chunk19 vertex ⟨by omega, h19⟩ + by_cases h20 : vertex.val < 168 + · exact partsPoint_permuteVertex_isTransform_case2_chunk20 vertex ⟨by omega, h20⟩ + by_cases h21 : vertex.val < 176 + · exact partsPoint_permuteVertex_isTransform_case2_chunk21 vertex ⟨by omega, h21⟩ + by_cases h22 : vertex.val < 184 + · exact partsPoint_permuteVertex_isTransform_case2_chunk22 vertex ⟨by omega, h22⟩ + by_cases h23 : vertex.val < 192 + · exact partsPoint_permuteVertex_isTransform_case2_chunk23 vertex ⟨by omega, h23⟩ + by_cases h24 : vertex.val < 200 + · exact partsPoint_permuteVertex_isTransform_case2_chunk24 vertex ⟨by omega, h24⟩ + by_cases h25 : vertex.val < 208 + · exact partsPoint_permuteVertex_isTransform_case2_chunk25 vertex ⟨by omega, h25⟩ + by_cases h26 : vertex.val < 216 + · exact partsPoint_permuteVertex_isTransform_case2_chunk26 vertex ⟨by omega, h26⟩ + by_cases h27 : vertex.val < 224 + · exact partsPoint_permuteVertex_isTransform_case2_chunk27 vertex ⟨by omega, h27⟩ + by_cases h28 : vertex.val < 232 + · exact partsPoint_permuteVertex_isTransform_case2_chunk28 vertex ⟨by omega, h28⟩ + by_cases h29 : vertex.val < 240 + · exact partsPoint_permuteVertex_isTransform_case2_chunk29 vertex ⟨by omega, h29⟩ + by_cases h30 : vertex.val < 248 + · exact partsPoint_permuteVertex_isTransform_case2_chunk30 vertex ⟨by omega, h30⟩ + by_cases h31 : vertex.val < 256 + · exact partsPoint_permuteVertex_isTransform_case2_chunk31 vertex ⟨by omega, h31⟩ + by_cases h32 : vertex.val < 264 + · exact partsPoint_permuteVertex_isTransform_case2_chunk32 vertex ⟨by omega, h32⟩ + by_cases h33 : vertex.val < 272 + · exact partsPoint_permuteVertex_isTransform_case2_chunk33 vertex ⟨by omega, h33⟩ + by_cases h34 : vertex.val < 280 + · exact partsPoint_permuteVertex_isTransform_case2_chunk34 vertex ⟨by omega, h34⟩ + by_cases h35 : vertex.val < 288 + · exact partsPoint_permuteVertex_isTransform_case2_chunk35 vertex ⟨by omega, h35⟩ + by_cases h36 : vertex.val < 296 + · exact partsPoint_permuteVertex_isTransform_case2_chunk36 vertex ⟨by omega, h36⟩ + by_cases h37 : vertex.val < 304 + · exact partsPoint_permuteVertex_isTransform_case2_chunk37 vertex ⟨by omega, h37⟩ + by_cases h38 : vertex.val < 312 + · exact partsPoint_permuteVertex_isTransform_case2_chunk38 vertex ⟨by omega, h38⟩ + by_cases h39 : vertex.val < 320 + · exact partsPoint_permuteVertex_isTransform_case2_chunk39 vertex ⟨by omega, h39⟩ + by_cases h40 : vertex.val < 328 + · exact partsPoint_permuteVertex_isTransform_case2_chunk40 vertex ⟨by omega, h40⟩ + by_cases h41 : vertex.val < 336 + · exact partsPoint_permuteVertex_isTransform_case2_chunk41 vertex ⟨by omega, h41⟩ + by_cases h42 : vertex.val < 344 + · exact partsPoint_permuteVertex_isTransform_case2_chunk42 vertex ⟨by omega, h42⟩ + by_cases h43 : vertex.val < 352 + · exact partsPoint_permuteVertex_isTransform_case2_chunk43 vertex ⟨by omega, h43⟩ + by_cases h44 : vertex.val < 360 + · exact partsPoint_permuteVertex_isTransform_case2_chunk44 vertex ⟨by omega, h44⟩ + by_cases h45 : vertex.val < 368 + · exact partsPoint_permuteVertex_isTransform_case2_chunk45 vertex ⟨by omega, h45⟩ + by_cases h46 : vertex.val < 376 + · exact partsPoint_permuteVertex_isTransform_case2_chunk46 vertex ⟨by omega, h46⟩ + by_cases h47 : vertex.val < 384 + · exact partsPoint_permuteVertex_isTransform_case2_chunk47 vertex ⟨by omega, h47⟩ + by_cases h48 : vertex.val < 392 + · exact partsPoint_permuteVertex_isTransform_case2_chunk48 vertex ⟨by omega, h48⟩ + by_cases h49 : vertex.val < 400 + · exact partsPoint_permuteVertex_isTransform_case2_chunk49 vertex ⟨by omega, h49⟩ + by_cases h50 : vertex.val < 408 + · exact partsPoint_permuteVertex_isTransform_case2_chunk50 vertex ⟨by omega, h50⟩ + by_cases h51 : vertex.val < 416 + · exact partsPoint_permuteVertex_isTransform_case2_chunk51 vertex ⟨by omega, h51⟩ + by_cases h52 : vertex.val < 424 + · exact partsPoint_permuteVertex_isTransform_case2_chunk52 vertex ⟨by omega, h52⟩ + by_cases h53 : vertex.val < 432 + · exact partsPoint_permuteVertex_isTransform_case2_chunk53 vertex ⟨by omega, h53⟩ + by_cases h54 : vertex.val < 440 + · exact partsPoint_permuteVertex_isTransform_case2_chunk54 vertex ⟨by omega, h54⟩ + by_cases h55 : vertex.val < 448 + · exact partsPoint_permuteVertex_isTransform_case2_chunk55 vertex ⟨by omega, h55⟩ + by_cases h56 : vertex.val < 456 + · exact partsPoint_permuteVertex_isTransform_case2_chunk56 vertex ⟨by omega, h56⟩ + by_cases h57 : vertex.val < 464 + · exact partsPoint_permuteVertex_isTransform_case2_chunk57 vertex ⟨by omega, h57⟩ + by_cases h58 : vertex.val < 472 + · exact partsPoint_permuteVertex_isTransform_case2_chunk58 vertex ⟨by omega, h58⟩ + by_cases h59 : vertex.val < 480 + · exact partsPoint_permuteVertex_isTransform_case2_chunk59 vertex ⟨by omega, h59⟩ + exact partsPoint_permuteVertex_isTransform_case2_chunk60 vertex ⟨by omega, by omega⟩ + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk0 + (vertex : Fin 481) (range : vertex.val < 8) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + interval_cases vertex + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk0, + partsPointChunk0, partsPointChunk3] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk1 + (vertex : Fin 481) (range : 8 ≤ vertex.val ∧ vertex.val < 16) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk0, + partsPointChunk0, partsPointChunk3, partsPointChunk6, partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk2 + (vertex : Fin 481) (range : 16 ≤ vertex.val ∧ vertex.val < 24) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk0, + partsPointChunk0, partsPointChunk6, partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk3 + (vertex : Fin 481) (range : 24 ≤ vertex.val ∧ vertex.val < 32) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk0, + partsPointChunk0, partsPointChunk6, partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk4 + (vertex : Fin 481) (range : 32 ≤ vertex.val ∧ vertex.val < 40) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk0, + partsPointChunk0, partsPointChunk2, partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk5 + (vertex : Fin 481) (range : 40 ≤ vertex.val ∧ vertex.val < 48) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk0, + partsPointChunk0, partsPointChunk2, partsPointChunk3] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk6 + (vertex : Fin 481) (range : 48 ≤ vertex.val ∧ vertex.val < 56) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk0, + partsPointChunk0, partsPointChunk2, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk7 + (vertex : Fin 481) (range : 56 ≤ vertex.val ∧ vertex.val < 64) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk0, + partsPointChunk0, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk8 + (vertex : Fin 481) (range : 64 ≤ vertex.val ∧ vertex.val < 72) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk1, + partsPointChunk1, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk9 + (vertex : Fin 481) (range : 72 ≤ vertex.val ∧ vertex.val < 80) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk1, + partsPointChunk1] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk10 + (vertex : Fin 481) (range : 80 ≤ vertex.val ∧ vertex.val < 88) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk1, + partsPointChunk1, partsPointChunk5, partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk11 + (vertex : Fin 481) (range : 88 ≤ vertex.val ∧ vertex.val < 96) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk1, + partsPointChunk1, partsPointChunk5, partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk12 + (vertex : Fin 481) (range : 96 ≤ vertex.val ∧ vertex.val < 104) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk1, + partsPointChunk1, partsPointChunk3, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk13 + (vertex : Fin 481) (range : 104 ≤ vertex.val ∧ vertex.val < 112) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk1, + partsPointChunk1, partsPointChunk3, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk14 + (vertex : Fin 481) (range : 112 ≤ vertex.val ∧ vertex.val < 120) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk1, + partsPointChunk1, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk15 + (vertex : Fin 481) (range : 120 ≤ vertex.val ∧ vertex.val < 128) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk1, + partsPointChunk1, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk16 + (vertex : Fin 481) (range : 128 ≤ vertex.val ∧ vertex.val < 136) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk2, + partsPointChunk2, partsPointChunk4, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk17 + (vertex : Fin 481) (range : 136 ≤ vertex.val ∧ vertex.val < 144) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk2, + partsPointChunk2, partsPointChunk4, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk18 + (vertex : Fin 481) (range : 144 ≤ vertex.val ∧ vertex.val < 152) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk2, + partsPointChunk2, partsPointChunk4, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk19 + (vertex : Fin 481) (range : 152 ≤ vertex.val ∧ vertex.val < 160) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk2, + partsPointChunk2, partsPointChunk4, partsPointChunk5, partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk20 + (vertex : Fin 481) (range : 160 ≤ vertex.val ∧ vertex.val < 168) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk2, + partsPointChunk2, partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk21 + (vertex : Fin 481) (range : 168 ≤ vertex.val ∧ vertex.val < 176) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk2, + partsPointChunk2, partsPointChunk6, partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk22 + (vertex : Fin 481) (range : 176 ≤ vertex.val ∧ vertex.val < 184) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk2, + partsPointChunk0, partsPointChunk2, partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk23 + (vertex : Fin 481) (range : 184 ≤ vertex.val ∧ vertex.val < 192) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk2, + partsPointChunk0, partsPointChunk2] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk24 + (vertex : Fin 481) (range : 192 ≤ vertex.val ∧ vertex.val < 200) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk3, + partsPointChunk0, partsPointChunk3] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk25 + (vertex : Fin 481) (range : 200 ≤ vertex.val ∧ vertex.val < 208) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk3, + partsPointChunk3] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk26 + (vertex : Fin 481) (range : 208 ≤ vertex.val ∧ vertex.val < 216) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk3, + partsPointChunk3] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk27 + (vertex : Fin 481) (range : 216 ≤ vertex.val ∧ vertex.val < 224) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk3, + partsPointChunk1, partsPointChunk3] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk28 + (vertex : Fin 481) (range : 224 ≤ vertex.val ∧ vertex.val < 232) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk3, + partsPointChunk1, partsPointChunk3] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk29 + (vertex : Fin 481) (range : 232 ≤ vertex.val ∧ vertex.val < 240) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk3, + partsPointChunk0, partsPointChunk1, partsPointChunk3] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk30 + (vertex : Fin 481) (range : 240 ≤ vertex.val ∧ vertex.val < 248) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk3, + partsPointChunk0, partsPointChunk3, partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk31 + (vertex : Fin 481) (range : 248 ≤ vertex.val ∧ vertex.val < 256) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk3, + partsPointChunk3, partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk32 + (vertex : Fin 481) (range : 256 ≤ vertex.val ∧ vertex.val < 264) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk4, + partsPointChunk3, partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk33 + (vertex : Fin 481) (range : 264 ≤ vertex.val ∧ vertex.val < 272) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk4, + partsPointChunk4, partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk34 + (vertex : Fin 481) (range : 272 ≤ vertex.val ∧ vertex.val < 280) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk4, + partsPointChunk4, partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk35 + (vertex : Fin 481) (range : 280 ≤ vertex.val ∧ vertex.val < 288) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk4, + partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk36 + (vertex : Fin 481) (range : 288 ≤ vertex.val ∧ vertex.val < 296) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk4, + partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk37 + (vertex : Fin 481) (range : 296 ≤ vertex.val ∧ vertex.val < 304) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk4, + partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk38 + (vertex : Fin 481) (range : 304 ≤ vertex.val ∧ vertex.val < 312) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk4, + partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk39 + (vertex : Fin 481) (range : 312 ≤ vertex.val ∧ vertex.val < 320) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk4, + partsPointChunk2, partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk40 + (vertex : Fin 481) (range : 320 ≤ vertex.val ∧ vertex.val < 328) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk5, + partsPointChunk2, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk41 + (vertex : Fin 481) (range : 328 ≤ vertex.val ∧ vertex.val < 336) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk5, + partsPointChunk2, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk42 + (vertex : Fin 481) (range : 336 ≤ vertex.val ∧ vertex.val < 344) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk5, + partsPointChunk0, partsPointChunk1, partsPointChunk2, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk43 + (vertex : Fin 481) (range : 344 ≤ vertex.val ∧ vertex.val < 352) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk5, + partsPointChunk0, partsPointChunk1, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk44 + (vertex : Fin 481) (range : 352 ≤ vertex.val ∧ vertex.val < 360) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk5, + partsPointChunk0, partsPointChunk1, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk45 + (vertex : Fin 481) (range : 360 ≤ vertex.val ∧ vertex.val < 368) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk5, + partsPointChunk1, partsPointChunk2, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk46 + (vertex : Fin 481) (range : 368 ≤ vertex.val ∧ vertex.val < 376) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk5, + partsPointChunk1, partsPointChunk2, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk47 + (vertex : Fin 481) (range : 376 ≤ vertex.val ∧ vertex.val < 384) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk5, + partsPointChunk1, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk48 + (vertex : Fin 481) (range : 384 ≤ vertex.val ∧ vertex.val < 392) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk6, + partsPointChunk1, partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk49 + (vertex : Fin 481) (range : 392 ≤ vertex.val ∧ vertex.val < 400) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk6, + partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk50 + (vertex : Fin 481) (range : 400 ≤ vertex.val ∧ vertex.val < 408) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk6, + partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk51 + (vertex : Fin 481) (range : 408 ≤ vertex.val ∧ vertex.val < 416) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk6, + partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk52 + (vertex : Fin 481) (range : 416 ≤ vertex.val ∧ vertex.val < 424) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk6, + partsPointChunk2, partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk53 + (vertex : Fin 481) (range : 424 ≤ vertex.val ∧ vertex.val < 432) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk6, + partsPointChunk2, partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk54 + (vertex : Fin 481) (range : 432 ≤ vertex.val ∧ vertex.val < 440) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk6, + partsPointChunk2, partsPointChunk4, partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk55 + (vertex : Fin 481) (range : 440 ≤ vertex.val ∧ vertex.val < 448) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk6, + partsPointChunk0, partsPointChunk4, partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk56 + (vertex : Fin 481) (range : 448 ≤ vertex.val ∧ vertex.val < 456) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk7, + partsPointChunk0, partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk57 + (vertex : Fin 481) (range : 456 ≤ vertex.val ∧ vertex.val < 464) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk7, + partsPointChunk0, partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk58 + (vertex : Fin 481) (range : 464 ≤ vertex.val ∧ vertex.val < 472) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk7, + partsPointChunk0, partsPointChunk2, partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk59 + (vertex : Fin 481) (range : 472 ≤ vertex.val ∧ vertex.val < 480) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk7, + partsPointChunk2, partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case3_chunk60 + (vertex : Fin 481) (range : 480 ≤ vertex.val ∧ vertex.val < 481) : + PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation3, partsVertexPermutation3Chunk7, + partsPointChunk2, partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case3 : + ∀ vertex, PartsPoint.IsTransform (3 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (3 : Fin 6) vertex)) := by + intro vertex + by_cases h0 : vertex.val < 8 + · exact partsPoint_permuteVertex_isTransform_case3_chunk0 vertex h0 + by_cases h1 : vertex.val < 16 + · exact partsPoint_permuteVertex_isTransform_case3_chunk1 vertex ⟨by omega, h1⟩ + by_cases h2 : vertex.val < 24 + · exact partsPoint_permuteVertex_isTransform_case3_chunk2 vertex ⟨by omega, h2⟩ + by_cases h3 : vertex.val < 32 + · exact partsPoint_permuteVertex_isTransform_case3_chunk3 vertex ⟨by omega, h3⟩ + by_cases h4 : vertex.val < 40 + · exact partsPoint_permuteVertex_isTransform_case3_chunk4 vertex ⟨by omega, h4⟩ + by_cases h5 : vertex.val < 48 + · exact partsPoint_permuteVertex_isTransform_case3_chunk5 vertex ⟨by omega, h5⟩ + by_cases h6 : vertex.val < 56 + · exact partsPoint_permuteVertex_isTransform_case3_chunk6 vertex ⟨by omega, h6⟩ + by_cases h7 : vertex.val < 64 + · exact partsPoint_permuteVertex_isTransform_case3_chunk7 vertex ⟨by omega, h7⟩ + by_cases h8 : vertex.val < 72 + · exact partsPoint_permuteVertex_isTransform_case3_chunk8 vertex ⟨by omega, h8⟩ + by_cases h9 : vertex.val < 80 + · exact partsPoint_permuteVertex_isTransform_case3_chunk9 vertex ⟨by omega, h9⟩ + by_cases h10 : vertex.val < 88 + · exact partsPoint_permuteVertex_isTransform_case3_chunk10 vertex ⟨by omega, h10⟩ + by_cases h11 : vertex.val < 96 + · exact partsPoint_permuteVertex_isTransform_case3_chunk11 vertex ⟨by omega, h11⟩ + by_cases h12 : vertex.val < 104 + · exact partsPoint_permuteVertex_isTransform_case3_chunk12 vertex ⟨by omega, h12⟩ + by_cases h13 : vertex.val < 112 + · exact partsPoint_permuteVertex_isTransform_case3_chunk13 vertex ⟨by omega, h13⟩ + by_cases h14 : vertex.val < 120 + · exact partsPoint_permuteVertex_isTransform_case3_chunk14 vertex ⟨by omega, h14⟩ + by_cases h15 : vertex.val < 128 + · exact partsPoint_permuteVertex_isTransform_case3_chunk15 vertex ⟨by omega, h15⟩ + by_cases h16 : vertex.val < 136 + · exact partsPoint_permuteVertex_isTransform_case3_chunk16 vertex ⟨by omega, h16⟩ + by_cases h17 : vertex.val < 144 + · exact partsPoint_permuteVertex_isTransform_case3_chunk17 vertex ⟨by omega, h17⟩ + by_cases h18 : vertex.val < 152 + · exact partsPoint_permuteVertex_isTransform_case3_chunk18 vertex ⟨by omega, h18⟩ + by_cases h19 : vertex.val < 160 + · exact partsPoint_permuteVertex_isTransform_case3_chunk19 vertex ⟨by omega, h19⟩ + by_cases h20 : vertex.val < 168 + · exact partsPoint_permuteVertex_isTransform_case3_chunk20 vertex ⟨by omega, h20⟩ + by_cases h21 : vertex.val < 176 + · exact partsPoint_permuteVertex_isTransform_case3_chunk21 vertex ⟨by omega, h21⟩ + by_cases h22 : vertex.val < 184 + · exact partsPoint_permuteVertex_isTransform_case3_chunk22 vertex ⟨by omega, h22⟩ + by_cases h23 : vertex.val < 192 + · exact partsPoint_permuteVertex_isTransform_case3_chunk23 vertex ⟨by omega, h23⟩ + by_cases h24 : vertex.val < 200 + · exact partsPoint_permuteVertex_isTransform_case3_chunk24 vertex ⟨by omega, h24⟩ + by_cases h25 : vertex.val < 208 + · exact partsPoint_permuteVertex_isTransform_case3_chunk25 vertex ⟨by omega, h25⟩ + by_cases h26 : vertex.val < 216 + · exact partsPoint_permuteVertex_isTransform_case3_chunk26 vertex ⟨by omega, h26⟩ + by_cases h27 : vertex.val < 224 + · exact partsPoint_permuteVertex_isTransform_case3_chunk27 vertex ⟨by omega, h27⟩ + by_cases h28 : vertex.val < 232 + · exact partsPoint_permuteVertex_isTransform_case3_chunk28 vertex ⟨by omega, h28⟩ + by_cases h29 : vertex.val < 240 + · exact partsPoint_permuteVertex_isTransform_case3_chunk29 vertex ⟨by omega, h29⟩ + by_cases h30 : vertex.val < 248 + · exact partsPoint_permuteVertex_isTransform_case3_chunk30 vertex ⟨by omega, h30⟩ + by_cases h31 : vertex.val < 256 + · exact partsPoint_permuteVertex_isTransform_case3_chunk31 vertex ⟨by omega, h31⟩ + by_cases h32 : vertex.val < 264 + · exact partsPoint_permuteVertex_isTransform_case3_chunk32 vertex ⟨by omega, h32⟩ + by_cases h33 : vertex.val < 272 + · exact partsPoint_permuteVertex_isTransform_case3_chunk33 vertex ⟨by omega, h33⟩ + by_cases h34 : vertex.val < 280 + · exact partsPoint_permuteVertex_isTransform_case3_chunk34 vertex ⟨by omega, h34⟩ + by_cases h35 : vertex.val < 288 + · exact partsPoint_permuteVertex_isTransform_case3_chunk35 vertex ⟨by omega, h35⟩ + by_cases h36 : vertex.val < 296 + · exact partsPoint_permuteVertex_isTransform_case3_chunk36 vertex ⟨by omega, h36⟩ + by_cases h37 : vertex.val < 304 + · exact partsPoint_permuteVertex_isTransform_case3_chunk37 vertex ⟨by omega, h37⟩ + by_cases h38 : vertex.val < 312 + · exact partsPoint_permuteVertex_isTransform_case3_chunk38 vertex ⟨by omega, h38⟩ + by_cases h39 : vertex.val < 320 + · exact partsPoint_permuteVertex_isTransform_case3_chunk39 vertex ⟨by omega, h39⟩ + by_cases h40 : vertex.val < 328 + · exact partsPoint_permuteVertex_isTransform_case3_chunk40 vertex ⟨by omega, h40⟩ + by_cases h41 : vertex.val < 336 + · exact partsPoint_permuteVertex_isTransform_case3_chunk41 vertex ⟨by omega, h41⟩ + by_cases h42 : vertex.val < 344 + · exact partsPoint_permuteVertex_isTransform_case3_chunk42 vertex ⟨by omega, h42⟩ + by_cases h43 : vertex.val < 352 + · exact partsPoint_permuteVertex_isTransform_case3_chunk43 vertex ⟨by omega, h43⟩ + by_cases h44 : vertex.val < 360 + · exact partsPoint_permuteVertex_isTransform_case3_chunk44 vertex ⟨by omega, h44⟩ + by_cases h45 : vertex.val < 368 + · exact partsPoint_permuteVertex_isTransform_case3_chunk45 vertex ⟨by omega, h45⟩ + by_cases h46 : vertex.val < 376 + · exact partsPoint_permuteVertex_isTransform_case3_chunk46 vertex ⟨by omega, h46⟩ + by_cases h47 : vertex.val < 384 + · exact partsPoint_permuteVertex_isTransform_case3_chunk47 vertex ⟨by omega, h47⟩ + by_cases h48 : vertex.val < 392 + · exact partsPoint_permuteVertex_isTransform_case3_chunk48 vertex ⟨by omega, h48⟩ + by_cases h49 : vertex.val < 400 + · exact partsPoint_permuteVertex_isTransform_case3_chunk49 vertex ⟨by omega, h49⟩ + by_cases h50 : vertex.val < 408 + · exact partsPoint_permuteVertex_isTransform_case3_chunk50 vertex ⟨by omega, h50⟩ + by_cases h51 : vertex.val < 416 + · exact partsPoint_permuteVertex_isTransform_case3_chunk51 vertex ⟨by omega, h51⟩ + by_cases h52 : vertex.val < 424 + · exact partsPoint_permuteVertex_isTransform_case3_chunk52 vertex ⟨by omega, h52⟩ + by_cases h53 : vertex.val < 432 + · exact partsPoint_permuteVertex_isTransform_case3_chunk53 vertex ⟨by omega, h53⟩ + by_cases h54 : vertex.val < 440 + · exact partsPoint_permuteVertex_isTransform_case3_chunk54 vertex ⟨by omega, h54⟩ + by_cases h55 : vertex.val < 448 + · exact partsPoint_permuteVertex_isTransform_case3_chunk55 vertex ⟨by omega, h55⟩ + by_cases h56 : vertex.val < 456 + · exact partsPoint_permuteVertex_isTransform_case3_chunk56 vertex ⟨by omega, h56⟩ + by_cases h57 : vertex.val < 464 + · exact partsPoint_permuteVertex_isTransform_case3_chunk57 vertex ⟨by omega, h57⟩ + by_cases h58 : vertex.val < 472 + · exact partsPoint_permuteVertex_isTransform_case3_chunk58 vertex ⟨by omega, h58⟩ + by_cases h59 : vertex.val < 480 + · exact partsPoint_permuteVertex_isTransform_case3_chunk59 vertex ⟨by omega, h59⟩ + exact partsPoint_permuteVertex_isTransform_case3_chunk60 vertex ⟨by omega, by omega⟩ + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk0 + (vertex : Fin 481) (range : vertex.val < 8) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + interval_cases vertex + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk0, + partsPointChunk0, partsPointChunk3] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk1 + (vertex : Fin 481) (range : 8 ≤ vertex.val ∧ vertex.val < 16) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk0, + partsPointChunk0, partsPointChunk3, partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk2 + (vertex : Fin 481) (range : 16 ≤ vertex.val ∧ vertex.val < 24) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk0, + partsPointChunk0, partsPointChunk6, partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk3 + (vertex : Fin 481) (range : 24 ≤ vertex.val ∧ vertex.val < 32) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk0, + partsPointChunk0, partsPointChunk6, partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk4 + (vertex : Fin 481) (range : 32 ≤ vertex.val ∧ vertex.val < 40) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk0, + partsPointChunk0, partsPointChunk2, partsPointChunk3, partsPointChunk6, + partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk5 + (vertex : Fin 481) (range : 40 ≤ vertex.val ∧ vertex.val < 48) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk0, + partsPointChunk0, partsPointChunk2] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk6 + (vertex : Fin 481) (range : 48 ≤ vertex.val ∧ vertex.val < 56) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk0, + partsPointChunk0, partsPointChunk2, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk7 + (vertex : Fin 481) (range : 56 ≤ vertex.val ∧ vertex.val < 64) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk0, + partsPointChunk0, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk8 + (vertex : Fin 481) (range : 64 ≤ vertex.val ∧ vertex.val < 72) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk1, + partsPointChunk1, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk9 + (vertex : Fin 481) (range : 72 ≤ vertex.val ∧ vertex.val < 80) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk1, + partsPointChunk1] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk10 + (vertex : Fin 481) (range : 80 ≤ vertex.val ∧ vertex.val < 88) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk1, + partsPointChunk1, partsPointChunk5, partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk11 + (vertex : Fin 481) (range : 88 ≤ vertex.val ∧ vertex.val < 96) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk1, + partsPointChunk1, partsPointChunk5, partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk12 + (vertex : Fin 481) (range : 96 ≤ vertex.val ∧ vertex.val < 104) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk1, + partsPointChunk1, partsPointChunk3, partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk13 + (vertex : Fin 481) (range : 104 ≤ vertex.val ∧ vertex.val < 112) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk1, + partsPointChunk1, partsPointChunk3, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk14 + (vertex : Fin 481) (range : 112 ≤ vertex.val ∧ vertex.val < 120) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk1, + partsPointChunk1, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk15 + (vertex : Fin 481) (range : 120 ≤ vertex.val ∧ vertex.val < 128) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk1, + partsPointChunk1, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk16 + (vertex : Fin 481) (range : 128 ≤ vertex.val ∧ vertex.val < 136) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk2, + partsPointChunk2, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk17 + (vertex : Fin 481) (range : 136 ≤ vertex.val ∧ vertex.val < 144) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk2, + partsPointChunk2, partsPointChunk4, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk18 + (vertex : Fin 481) (range : 144 ≤ vertex.val ∧ vertex.val < 152) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk2, + partsPointChunk2, partsPointChunk4, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk19 + (vertex : Fin 481) (range : 152 ≤ vertex.val ∧ vertex.val < 160) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk2, + partsPointChunk2, partsPointChunk4, partsPointChunk5, partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk20 + (vertex : Fin 481) (range : 160 ≤ vertex.val ∧ vertex.val < 168) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk2, + partsPointChunk2, partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk21 + (vertex : Fin 481) (range : 168 ≤ vertex.val ∧ vertex.val < 176) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk2, + partsPointChunk2, partsPointChunk6, partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk22 + (vertex : Fin 481) (range : 176 ≤ vertex.val ∧ vertex.val < 184) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk2, + partsPointChunk0, partsPointChunk2, partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk23 + (vertex : Fin 481) (range : 184 ≤ vertex.val ∧ vertex.val < 192) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk2, + partsPointChunk0, partsPointChunk2] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk24 + (vertex : Fin 481) (range : 192 ≤ vertex.val ∧ vertex.val < 200) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk3, + partsPointChunk0, partsPointChunk3] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk25 + (vertex : Fin 481) (range : 200 ≤ vertex.val ∧ vertex.val < 208) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk3, + partsPointChunk3] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk26 + (vertex : Fin 481) (range : 208 ≤ vertex.val ∧ vertex.val < 216) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk3, + partsPointChunk3] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk27 + (vertex : Fin 481) (range : 216 ≤ vertex.val ∧ vertex.val < 224) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk3, + partsPointChunk1, partsPointChunk3] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk28 + (vertex : Fin 481) (range : 224 ≤ vertex.val ∧ vertex.val < 232) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk3, + partsPointChunk1, partsPointChunk3] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk29 + (vertex : Fin 481) (range : 232 ≤ vertex.val ∧ vertex.val < 240) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk3, + partsPointChunk0, partsPointChunk1, partsPointChunk3] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk30 + (vertex : Fin 481) (range : 240 ≤ vertex.val ∧ vertex.val < 248) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk3, + partsPointChunk0, partsPointChunk3, partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk31 + (vertex : Fin 481) (range : 248 ≤ vertex.val ∧ vertex.val < 256) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk3, + partsPointChunk3, partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk32 + (vertex : Fin 481) (range : 256 ≤ vertex.val ∧ vertex.val < 264) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk4, + partsPointChunk3, partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk33 + (vertex : Fin 481) (range : 264 ≤ vertex.val ∧ vertex.val < 272) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk4, + partsPointChunk3, partsPointChunk4, partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk34 + (vertex : Fin 481) (range : 272 ≤ vertex.val ∧ vertex.val < 280) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk4, + partsPointChunk4, partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk35 + (vertex : Fin 481) (range : 280 ≤ vertex.val ∧ vertex.val < 288) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk4, + partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk36 + (vertex : Fin 481) (range : 288 ≤ vertex.val ∧ vertex.val < 296) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk4, + partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk37 + (vertex : Fin 481) (range : 296 ≤ vertex.val ∧ vertex.val < 304) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk4, + partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk38 + (vertex : Fin 481) (range : 304 ≤ vertex.val ∧ vertex.val < 312) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk4, + partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk39 + (vertex : Fin 481) (range : 312 ≤ vertex.val ∧ vertex.val < 320) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk4, + partsPointChunk2, partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk40 + (vertex : Fin 481) (range : 320 ≤ vertex.val ∧ vertex.val < 328) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk5, + partsPointChunk2, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk41 + (vertex : Fin 481) (range : 328 ≤ vertex.val ∧ vertex.val < 336) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk5, + partsPointChunk2, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk42 + (vertex : Fin 481) (range : 336 ≤ vertex.val ∧ vertex.val < 344) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk5, + partsPointChunk0, partsPointChunk2, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk43 + (vertex : Fin 481) (range : 344 ≤ vertex.val ∧ vertex.val < 352) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk5, + partsPointChunk0, partsPointChunk1, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk44 + (vertex : Fin 481) (range : 352 ≤ vertex.val ∧ vertex.val < 360) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk5, + partsPointChunk0, partsPointChunk1, partsPointChunk2, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk45 + (vertex : Fin 481) (range : 360 ≤ vertex.val ∧ vertex.val < 368) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk5, + partsPointChunk1, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk46 + (vertex : Fin 481) (range : 368 ≤ vertex.val ∧ vertex.val < 376) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk5, + partsPointChunk1, partsPointChunk2, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk47 + (vertex : Fin 481) (range : 376 ≤ vertex.val ∧ vertex.val < 384) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk5, + partsPointChunk1, partsPointChunk2, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk48 + (vertex : Fin 481) (range : 384 ≤ vertex.val ∧ vertex.val < 392) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk6, + partsPointChunk1, partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk49 + (vertex : Fin 481) (range : 392 ≤ vertex.val ∧ vertex.val < 400) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk6, + partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk50 + (vertex : Fin 481) (range : 400 ≤ vertex.val ∧ vertex.val < 408) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk6, + partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk51 + (vertex : Fin 481) (range : 408 ≤ vertex.val ∧ vertex.val < 416) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk6, + partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk52 + (vertex : Fin 481) (range : 416 ≤ vertex.val ∧ vertex.val < 424) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk6, + partsPointChunk2, partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk53 + (vertex : Fin 481) (range : 424 ≤ vertex.val ∧ vertex.val < 432) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk6, + partsPointChunk2, partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk54 + (vertex : Fin 481) (range : 432 ≤ vertex.val ∧ vertex.val < 440) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk6, + partsPointChunk2, partsPointChunk4, partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk55 + (vertex : Fin 481) (range : 440 ≤ vertex.val ∧ vertex.val < 448) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk6, + partsPointChunk0, partsPointChunk4, partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk56 + (vertex : Fin 481) (range : 448 ≤ vertex.val ∧ vertex.val < 456) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk7, + partsPointChunk0, partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk57 + (vertex : Fin 481) (range : 456 ≤ vertex.val ∧ vertex.val < 464) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk7, + partsPointChunk0, partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk58 + (vertex : Fin 481) (range : 464 ≤ vertex.val ∧ vertex.val < 472) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk7, + partsPointChunk0, partsPointChunk2, partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk59 + (vertex : Fin 481) (range : 472 ≤ vertex.val ∧ vertex.val < 480) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk7, + partsPointChunk2, partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case4_chunk60 + (vertex : Fin 481) (range : 480 ≤ vertex.val ∧ vertex.val < 481) : + PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation4, partsVertexPermutation4Chunk7, + partsPointChunk2, partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case4 : + ∀ vertex, PartsPoint.IsTransform (4 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (4 : Fin 6) vertex)) := by + intro vertex + by_cases h0 : vertex.val < 8 + · exact partsPoint_permuteVertex_isTransform_case4_chunk0 vertex h0 + by_cases h1 : vertex.val < 16 + · exact partsPoint_permuteVertex_isTransform_case4_chunk1 vertex ⟨by omega, h1⟩ + by_cases h2 : vertex.val < 24 + · exact partsPoint_permuteVertex_isTransform_case4_chunk2 vertex ⟨by omega, h2⟩ + by_cases h3 : vertex.val < 32 + · exact partsPoint_permuteVertex_isTransform_case4_chunk3 vertex ⟨by omega, h3⟩ + by_cases h4 : vertex.val < 40 + · exact partsPoint_permuteVertex_isTransform_case4_chunk4 vertex ⟨by omega, h4⟩ + by_cases h5 : vertex.val < 48 + · exact partsPoint_permuteVertex_isTransform_case4_chunk5 vertex ⟨by omega, h5⟩ + by_cases h6 : vertex.val < 56 + · exact partsPoint_permuteVertex_isTransform_case4_chunk6 vertex ⟨by omega, h6⟩ + by_cases h7 : vertex.val < 64 + · exact partsPoint_permuteVertex_isTransform_case4_chunk7 vertex ⟨by omega, h7⟩ + by_cases h8 : vertex.val < 72 + · exact partsPoint_permuteVertex_isTransform_case4_chunk8 vertex ⟨by omega, h8⟩ + by_cases h9 : vertex.val < 80 + · exact partsPoint_permuteVertex_isTransform_case4_chunk9 vertex ⟨by omega, h9⟩ + by_cases h10 : vertex.val < 88 + · exact partsPoint_permuteVertex_isTransform_case4_chunk10 vertex ⟨by omega, h10⟩ + by_cases h11 : vertex.val < 96 + · exact partsPoint_permuteVertex_isTransform_case4_chunk11 vertex ⟨by omega, h11⟩ + by_cases h12 : vertex.val < 104 + · exact partsPoint_permuteVertex_isTransform_case4_chunk12 vertex ⟨by omega, h12⟩ + by_cases h13 : vertex.val < 112 + · exact partsPoint_permuteVertex_isTransform_case4_chunk13 vertex ⟨by omega, h13⟩ + by_cases h14 : vertex.val < 120 + · exact partsPoint_permuteVertex_isTransform_case4_chunk14 vertex ⟨by omega, h14⟩ + by_cases h15 : vertex.val < 128 + · exact partsPoint_permuteVertex_isTransform_case4_chunk15 vertex ⟨by omega, h15⟩ + by_cases h16 : vertex.val < 136 + · exact partsPoint_permuteVertex_isTransform_case4_chunk16 vertex ⟨by omega, h16⟩ + by_cases h17 : vertex.val < 144 + · exact partsPoint_permuteVertex_isTransform_case4_chunk17 vertex ⟨by omega, h17⟩ + by_cases h18 : vertex.val < 152 + · exact partsPoint_permuteVertex_isTransform_case4_chunk18 vertex ⟨by omega, h18⟩ + by_cases h19 : vertex.val < 160 + · exact partsPoint_permuteVertex_isTransform_case4_chunk19 vertex ⟨by omega, h19⟩ + by_cases h20 : vertex.val < 168 + · exact partsPoint_permuteVertex_isTransform_case4_chunk20 vertex ⟨by omega, h20⟩ + by_cases h21 : vertex.val < 176 + · exact partsPoint_permuteVertex_isTransform_case4_chunk21 vertex ⟨by omega, h21⟩ + by_cases h22 : vertex.val < 184 + · exact partsPoint_permuteVertex_isTransform_case4_chunk22 vertex ⟨by omega, h22⟩ + by_cases h23 : vertex.val < 192 + · exact partsPoint_permuteVertex_isTransform_case4_chunk23 vertex ⟨by omega, h23⟩ + by_cases h24 : vertex.val < 200 + · exact partsPoint_permuteVertex_isTransform_case4_chunk24 vertex ⟨by omega, h24⟩ + by_cases h25 : vertex.val < 208 + · exact partsPoint_permuteVertex_isTransform_case4_chunk25 vertex ⟨by omega, h25⟩ + by_cases h26 : vertex.val < 216 + · exact partsPoint_permuteVertex_isTransform_case4_chunk26 vertex ⟨by omega, h26⟩ + by_cases h27 : vertex.val < 224 + · exact partsPoint_permuteVertex_isTransform_case4_chunk27 vertex ⟨by omega, h27⟩ + by_cases h28 : vertex.val < 232 + · exact partsPoint_permuteVertex_isTransform_case4_chunk28 vertex ⟨by omega, h28⟩ + by_cases h29 : vertex.val < 240 + · exact partsPoint_permuteVertex_isTransform_case4_chunk29 vertex ⟨by omega, h29⟩ + by_cases h30 : vertex.val < 248 + · exact partsPoint_permuteVertex_isTransform_case4_chunk30 vertex ⟨by omega, h30⟩ + by_cases h31 : vertex.val < 256 + · exact partsPoint_permuteVertex_isTransform_case4_chunk31 vertex ⟨by omega, h31⟩ + by_cases h32 : vertex.val < 264 + · exact partsPoint_permuteVertex_isTransform_case4_chunk32 vertex ⟨by omega, h32⟩ + by_cases h33 : vertex.val < 272 + · exact partsPoint_permuteVertex_isTransform_case4_chunk33 vertex ⟨by omega, h33⟩ + by_cases h34 : vertex.val < 280 + · exact partsPoint_permuteVertex_isTransform_case4_chunk34 vertex ⟨by omega, h34⟩ + by_cases h35 : vertex.val < 288 + · exact partsPoint_permuteVertex_isTransform_case4_chunk35 vertex ⟨by omega, h35⟩ + by_cases h36 : vertex.val < 296 + · exact partsPoint_permuteVertex_isTransform_case4_chunk36 vertex ⟨by omega, h36⟩ + by_cases h37 : vertex.val < 304 + · exact partsPoint_permuteVertex_isTransform_case4_chunk37 vertex ⟨by omega, h37⟩ + by_cases h38 : vertex.val < 312 + · exact partsPoint_permuteVertex_isTransform_case4_chunk38 vertex ⟨by omega, h38⟩ + by_cases h39 : vertex.val < 320 + · exact partsPoint_permuteVertex_isTransform_case4_chunk39 vertex ⟨by omega, h39⟩ + by_cases h40 : vertex.val < 328 + · exact partsPoint_permuteVertex_isTransform_case4_chunk40 vertex ⟨by omega, h40⟩ + by_cases h41 : vertex.val < 336 + · exact partsPoint_permuteVertex_isTransform_case4_chunk41 vertex ⟨by omega, h41⟩ + by_cases h42 : vertex.val < 344 + · exact partsPoint_permuteVertex_isTransform_case4_chunk42 vertex ⟨by omega, h42⟩ + by_cases h43 : vertex.val < 352 + · exact partsPoint_permuteVertex_isTransform_case4_chunk43 vertex ⟨by omega, h43⟩ + by_cases h44 : vertex.val < 360 + · exact partsPoint_permuteVertex_isTransform_case4_chunk44 vertex ⟨by omega, h44⟩ + by_cases h45 : vertex.val < 368 + · exact partsPoint_permuteVertex_isTransform_case4_chunk45 vertex ⟨by omega, h45⟩ + by_cases h46 : vertex.val < 376 + · exact partsPoint_permuteVertex_isTransform_case4_chunk46 vertex ⟨by omega, h46⟩ + by_cases h47 : vertex.val < 384 + · exact partsPoint_permuteVertex_isTransform_case4_chunk47 vertex ⟨by omega, h47⟩ + by_cases h48 : vertex.val < 392 + · exact partsPoint_permuteVertex_isTransform_case4_chunk48 vertex ⟨by omega, h48⟩ + by_cases h49 : vertex.val < 400 + · exact partsPoint_permuteVertex_isTransform_case4_chunk49 vertex ⟨by omega, h49⟩ + by_cases h50 : vertex.val < 408 + · exact partsPoint_permuteVertex_isTransform_case4_chunk50 vertex ⟨by omega, h50⟩ + by_cases h51 : vertex.val < 416 + · exact partsPoint_permuteVertex_isTransform_case4_chunk51 vertex ⟨by omega, h51⟩ + by_cases h52 : vertex.val < 424 + · exact partsPoint_permuteVertex_isTransform_case4_chunk52 vertex ⟨by omega, h52⟩ + by_cases h53 : vertex.val < 432 + · exact partsPoint_permuteVertex_isTransform_case4_chunk53 vertex ⟨by omega, h53⟩ + by_cases h54 : vertex.val < 440 + · exact partsPoint_permuteVertex_isTransform_case4_chunk54 vertex ⟨by omega, h54⟩ + by_cases h55 : vertex.val < 448 + · exact partsPoint_permuteVertex_isTransform_case4_chunk55 vertex ⟨by omega, h55⟩ + by_cases h56 : vertex.val < 456 + · exact partsPoint_permuteVertex_isTransform_case4_chunk56 vertex ⟨by omega, h56⟩ + by_cases h57 : vertex.val < 464 + · exact partsPoint_permuteVertex_isTransform_case4_chunk57 vertex ⟨by omega, h57⟩ + by_cases h58 : vertex.val < 472 + · exact partsPoint_permuteVertex_isTransform_case4_chunk58 vertex ⟨by omega, h58⟩ + by_cases h59 : vertex.val < 480 + · exact partsPoint_permuteVertex_isTransform_case4_chunk59 vertex ⟨by omega, h59⟩ + exact partsPoint_permuteVertex_isTransform_case4_chunk60 vertex ⟨by omega, by omega⟩ + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk0 + (vertex : Fin 481) (range : vertex.val < 8) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + interval_cases vertex + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk0, + partsPointChunk0, partsPointChunk3] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk1 + (vertex : Fin 481) (range : 8 ≤ vertex.val ∧ vertex.val < 16) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk0, + partsPointChunk0, partsPointChunk3, partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk2 + (vertex : Fin 481) (range : 16 ≤ vertex.val ∧ vertex.val < 24) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk0, + partsPointChunk0, partsPointChunk6, partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk3 + (vertex : Fin 481) (range : 24 ≤ vertex.val ∧ vertex.val < 32) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk0, + partsPointChunk0, partsPointChunk6, partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk4 + (vertex : Fin 481) (range : 32 ≤ vertex.val ∧ vertex.val < 40) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk0, + partsPointChunk0, partsPointChunk2, partsPointChunk6, partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk5 + (vertex : Fin 481) (range : 40 ≤ vertex.val ∧ vertex.val < 48) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk0, + partsPointChunk0, partsPointChunk2, partsPointChunk3] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk6 + (vertex : Fin 481) (range : 48 ≤ vertex.val ∧ vertex.val < 56) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk0, + partsPointChunk0, partsPointChunk2, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk7 + (vertex : Fin 481) (range : 56 ≤ vertex.val ∧ vertex.val < 64) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk0, + partsPointChunk0, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk8 + (vertex : Fin 481) (range : 64 ≤ vertex.val ∧ vertex.val < 72) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk1, + partsPointChunk1, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk9 + (vertex : Fin 481) (range : 72 ≤ vertex.val ∧ vertex.val < 80) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk1, + partsPointChunk1] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk10 + (vertex : Fin 481) (range : 80 ≤ vertex.val ∧ vertex.val < 88) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk1, + partsPointChunk1, partsPointChunk5, partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk11 + (vertex : Fin 481) (range : 88 ≤ vertex.val ∧ vertex.val < 96) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk1, + partsPointChunk1, partsPointChunk5, partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk12 + (vertex : Fin 481) (range : 96 ≤ vertex.val ∧ vertex.val < 104) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk1, + partsPointChunk1, partsPointChunk3, partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk13 + (vertex : Fin 481) (range : 104 ≤ vertex.val ∧ vertex.val < 112) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk1, + partsPointChunk1, partsPointChunk3, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk14 + (vertex : Fin 481) (range : 112 ≤ vertex.val ∧ vertex.val < 120) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk1, + partsPointChunk1, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk15 + (vertex : Fin 481) (range : 120 ≤ vertex.val ∧ vertex.val < 128) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk1, + partsPointChunk1, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk16 + (vertex : Fin 481) (range : 128 ≤ vertex.val ∧ vertex.val < 136) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk2, + partsPointChunk2, partsPointChunk4, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk17 + (vertex : Fin 481) (range : 136 ≤ vertex.val ∧ vertex.val < 144) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk2, + partsPointChunk2, partsPointChunk4, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk18 + (vertex : Fin 481) (range : 144 ≤ vertex.val ∧ vertex.val < 152) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk2, + partsPointChunk2, partsPointChunk4, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk19 + (vertex : Fin 481) (range : 152 ≤ vertex.val ∧ vertex.val < 160) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk2, + partsPointChunk2, partsPointChunk4, partsPointChunk5, partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk20 + (vertex : Fin 481) (range : 160 ≤ vertex.val ∧ vertex.val < 168) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk2, + partsPointChunk2, partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk21 + (vertex : Fin 481) (range : 168 ≤ vertex.val ∧ vertex.val < 176) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk2, + partsPointChunk2, partsPointChunk6, partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk22 + (vertex : Fin 481) (range : 176 ≤ vertex.val ∧ vertex.val < 184) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk2, + partsPointChunk0, partsPointChunk2, partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk23 + (vertex : Fin 481) (range : 184 ≤ vertex.val ∧ vertex.val < 192) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk2, + partsPointChunk0, partsPointChunk2] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk24 + (vertex : Fin 481) (range : 192 ≤ vertex.val ∧ vertex.val < 200) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk3, + partsPointChunk0, partsPointChunk3] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk25 + (vertex : Fin 481) (range : 200 ≤ vertex.val ∧ vertex.val < 208) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk3, + partsPointChunk3] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk26 + (vertex : Fin 481) (range : 208 ≤ vertex.val ∧ vertex.val < 216) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk3, + partsPointChunk3] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk27 + (vertex : Fin 481) (range : 216 ≤ vertex.val ∧ vertex.val < 224) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk3, + partsPointChunk1, partsPointChunk3] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk28 + (vertex : Fin 481) (range : 224 ≤ vertex.val ∧ vertex.val < 232) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk3, + partsPointChunk1, partsPointChunk3] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk29 + (vertex : Fin 481) (range : 232 ≤ vertex.val ∧ vertex.val < 240) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk3, + partsPointChunk0, partsPointChunk1, partsPointChunk3] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk30 + (vertex : Fin 481) (range : 240 ≤ vertex.val ∧ vertex.val < 248) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk3, + partsPointChunk0, partsPointChunk3] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk31 + (vertex : Fin 481) (range : 248 ≤ vertex.val ∧ vertex.val < 256) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk3, + partsPointChunk3, partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk32 + (vertex : Fin 481) (range : 256 ≤ vertex.val ∧ vertex.val < 264) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk4, + partsPointChunk3, partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk33 + (vertex : Fin 481) (range : 264 ≤ vertex.val ∧ vertex.val < 272) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk4, + partsPointChunk4, partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk34 + (vertex : Fin 481) (range : 272 ≤ vertex.val ∧ vertex.val < 280) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk4, + partsPointChunk4, partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk35 + (vertex : Fin 481) (range : 280 ≤ vertex.val ∧ vertex.val < 288) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk4, + partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk36 + (vertex : Fin 481) (range : 288 ≤ vertex.val ∧ vertex.val < 296) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk4, + partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk37 + (vertex : Fin 481) (range : 296 ≤ vertex.val ∧ vertex.val < 304) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk4, + partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk38 + (vertex : Fin 481) (range : 304 ≤ vertex.val ∧ vertex.val < 312) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk4, + partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk39 + (vertex : Fin 481) (range : 312 ≤ vertex.val ∧ vertex.val < 320) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk4, + partsPointChunk2, partsPointChunk4] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk40 + (vertex : Fin 481) (range : 320 ≤ vertex.val ∧ vertex.val < 328) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk5, + partsPointChunk2, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk41 + (vertex : Fin 481) (range : 328 ≤ vertex.val ∧ vertex.val < 336) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk5, + partsPointChunk2, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk42 + (vertex : Fin 481) (range : 336 ≤ vertex.val ∧ vertex.val < 344) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk5, + partsPointChunk0, partsPointChunk1, partsPointChunk2, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk43 + (vertex : Fin 481) (range : 344 ≤ vertex.val ∧ vertex.val < 352) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk5, + partsPointChunk0, partsPointChunk1, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk44 + (vertex : Fin 481) (range : 352 ≤ vertex.val ∧ vertex.val < 360) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk5, + partsPointChunk0, partsPointChunk1, partsPointChunk2, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk45 + (vertex : Fin 481) (range : 360 ≤ vertex.val ∧ vertex.val < 368) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk5, + partsPointChunk1, partsPointChunk2, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk46 + (vertex : Fin 481) (range : 368 ≤ vertex.val ∧ vertex.val < 376) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk5, + partsPointChunk1, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk47 + (vertex : Fin 481) (range : 376 ≤ vertex.val ∧ vertex.val < 384) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk5, + partsPointChunk1, partsPointChunk2, partsPointChunk5] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk48 + (vertex : Fin 481) (range : 384 ≤ vertex.val ∧ vertex.val < 392) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk6, + partsPointChunk1, partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk49 + (vertex : Fin 481) (range : 392 ≤ vertex.val ∧ vertex.val < 400) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk6, + partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk50 + (vertex : Fin 481) (range : 400 ≤ vertex.val ∧ vertex.val < 408) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk6, + partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk51 + (vertex : Fin 481) (range : 408 ≤ vertex.val ∧ vertex.val < 416) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk6, + partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk52 + (vertex : Fin 481) (range : 416 ≤ vertex.val ∧ vertex.val < 424) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk6, + partsPointChunk2, partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk53 + (vertex : Fin 481) (range : 424 ≤ vertex.val ∧ vertex.val < 432) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk6, + partsPointChunk2, partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk54 + (vertex : Fin 481) (range : 432 ≤ vertex.val ∧ vertex.val < 440) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk6, + partsPointChunk2, partsPointChunk4, partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk55 + (vertex : Fin 481) (range : 440 ≤ vertex.val ∧ vertex.val < 448) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk6, + partsPointChunk0, partsPointChunk4, partsPointChunk6] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk56 + (vertex : Fin 481) (range : 448 ≤ vertex.val ∧ vertex.val < 456) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk7, + partsPointChunk0, partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk57 + (vertex : Fin 481) (range : 456 ≤ vertex.val ∧ vertex.val < 464) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk7, + partsPointChunk0, partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk58 + (vertex : Fin 481) (range : 464 ≤ vertex.val ∧ vertex.val < 472) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk7, + partsPointChunk0, partsPointChunk2, partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk59 + (vertex : Fin 481) (range : 472 ≤ vertex.val ∧ vertex.val < 480) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk7, + partsPointChunk2, partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case5_chunk60 + (vertex : Fin 481) (range : 480 ≤ vertex.val ∧ vertex.val < 481) : + PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + rcases vertex with ⟨vertex, bound⟩ + rcases range with ⟨lower, upper⟩ + interval_cases vertex using lower, upper + all_goals + have hbound : bound = (by decide) := Subsingleton.elim _ _ + rw [hbound] + norm_num [PartsPoint.IsTransform, partsPoint, partsPermuteVertex, + partsVertexPermutation5, partsVertexPermutation5Chunk7, + partsPointChunk2, partsPointChunk7] + +private lemma partsPoint_permuteVertex_isTransform_case5 : + ∀ vertex, PartsPoint.IsTransform (5 : Fin 6) (partsPoint vertex) + (partsPoint (partsPermuteVertex (5 : Fin 6) vertex)) := by + intro vertex + by_cases h0 : vertex.val < 8 + · exact partsPoint_permuteVertex_isTransform_case5_chunk0 vertex h0 + by_cases h1 : vertex.val < 16 + · exact partsPoint_permuteVertex_isTransform_case5_chunk1 vertex ⟨by omega, h1⟩ + by_cases h2 : vertex.val < 24 + · exact partsPoint_permuteVertex_isTransform_case5_chunk2 vertex ⟨by omega, h2⟩ + by_cases h3 : vertex.val < 32 + · exact partsPoint_permuteVertex_isTransform_case5_chunk3 vertex ⟨by omega, h3⟩ + by_cases h4 : vertex.val < 40 + · exact partsPoint_permuteVertex_isTransform_case5_chunk4 vertex ⟨by omega, h4⟩ + by_cases h5 : vertex.val < 48 + · exact partsPoint_permuteVertex_isTransform_case5_chunk5 vertex ⟨by omega, h5⟩ + by_cases h6 : vertex.val < 56 + · exact partsPoint_permuteVertex_isTransform_case5_chunk6 vertex ⟨by omega, h6⟩ + by_cases h7 : vertex.val < 64 + · exact partsPoint_permuteVertex_isTransform_case5_chunk7 vertex ⟨by omega, h7⟩ + by_cases h8 : vertex.val < 72 + · exact partsPoint_permuteVertex_isTransform_case5_chunk8 vertex ⟨by omega, h8⟩ + by_cases h9 : vertex.val < 80 + · exact partsPoint_permuteVertex_isTransform_case5_chunk9 vertex ⟨by omega, h9⟩ + by_cases h10 : vertex.val < 88 + · exact partsPoint_permuteVertex_isTransform_case5_chunk10 vertex ⟨by omega, h10⟩ + by_cases h11 : vertex.val < 96 + · exact partsPoint_permuteVertex_isTransform_case5_chunk11 vertex ⟨by omega, h11⟩ + by_cases h12 : vertex.val < 104 + · exact partsPoint_permuteVertex_isTransform_case5_chunk12 vertex ⟨by omega, h12⟩ + by_cases h13 : vertex.val < 112 + · exact partsPoint_permuteVertex_isTransform_case5_chunk13 vertex ⟨by omega, h13⟩ + by_cases h14 : vertex.val < 120 + · exact partsPoint_permuteVertex_isTransform_case5_chunk14 vertex ⟨by omega, h14⟩ + by_cases h15 : vertex.val < 128 + · exact partsPoint_permuteVertex_isTransform_case5_chunk15 vertex ⟨by omega, h15⟩ + by_cases h16 : vertex.val < 136 + · exact partsPoint_permuteVertex_isTransform_case5_chunk16 vertex ⟨by omega, h16⟩ + by_cases h17 : vertex.val < 144 + · exact partsPoint_permuteVertex_isTransform_case5_chunk17 vertex ⟨by omega, h17⟩ + by_cases h18 : vertex.val < 152 + · exact partsPoint_permuteVertex_isTransform_case5_chunk18 vertex ⟨by omega, h18⟩ + by_cases h19 : vertex.val < 160 + · exact partsPoint_permuteVertex_isTransform_case5_chunk19 vertex ⟨by omega, h19⟩ + by_cases h20 : vertex.val < 168 + · exact partsPoint_permuteVertex_isTransform_case5_chunk20 vertex ⟨by omega, h20⟩ + by_cases h21 : vertex.val < 176 + · exact partsPoint_permuteVertex_isTransform_case5_chunk21 vertex ⟨by omega, h21⟩ + by_cases h22 : vertex.val < 184 + · exact partsPoint_permuteVertex_isTransform_case5_chunk22 vertex ⟨by omega, h22⟩ + by_cases h23 : vertex.val < 192 + · exact partsPoint_permuteVertex_isTransform_case5_chunk23 vertex ⟨by omega, h23⟩ + by_cases h24 : vertex.val < 200 + · exact partsPoint_permuteVertex_isTransform_case5_chunk24 vertex ⟨by omega, h24⟩ + by_cases h25 : vertex.val < 208 + · exact partsPoint_permuteVertex_isTransform_case5_chunk25 vertex ⟨by omega, h25⟩ + by_cases h26 : vertex.val < 216 + · exact partsPoint_permuteVertex_isTransform_case5_chunk26 vertex ⟨by omega, h26⟩ + by_cases h27 : vertex.val < 224 + · exact partsPoint_permuteVertex_isTransform_case5_chunk27 vertex ⟨by omega, h27⟩ + by_cases h28 : vertex.val < 232 + · exact partsPoint_permuteVertex_isTransform_case5_chunk28 vertex ⟨by omega, h28⟩ + by_cases h29 : vertex.val < 240 + · exact partsPoint_permuteVertex_isTransform_case5_chunk29 vertex ⟨by omega, h29⟩ + by_cases h30 : vertex.val < 248 + · exact partsPoint_permuteVertex_isTransform_case5_chunk30 vertex ⟨by omega, h30⟩ + by_cases h31 : vertex.val < 256 + · exact partsPoint_permuteVertex_isTransform_case5_chunk31 vertex ⟨by omega, h31⟩ + by_cases h32 : vertex.val < 264 + · exact partsPoint_permuteVertex_isTransform_case5_chunk32 vertex ⟨by omega, h32⟩ + by_cases h33 : vertex.val < 272 + · exact partsPoint_permuteVertex_isTransform_case5_chunk33 vertex ⟨by omega, h33⟩ + by_cases h34 : vertex.val < 280 + · exact partsPoint_permuteVertex_isTransform_case5_chunk34 vertex ⟨by omega, h34⟩ + by_cases h35 : vertex.val < 288 + · exact partsPoint_permuteVertex_isTransform_case5_chunk35 vertex ⟨by omega, h35⟩ + by_cases h36 : vertex.val < 296 + · exact partsPoint_permuteVertex_isTransform_case5_chunk36 vertex ⟨by omega, h36⟩ + by_cases h37 : vertex.val < 304 + · exact partsPoint_permuteVertex_isTransform_case5_chunk37 vertex ⟨by omega, h37⟩ + by_cases h38 : vertex.val < 312 + · exact partsPoint_permuteVertex_isTransform_case5_chunk38 vertex ⟨by omega, h38⟩ + by_cases h39 : vertex.val < 320 + · exact partsPoint_permuteVertex_isTransform_case5_chunk39 vertex ⟨by omega, h39⟩ + by_cases h40 : vertex.val < 328 + · exact partsPoint_permuteVertex_isTransform_case5_chunk40 vertex ⟨by omega, h40⟩ + by_cases h41 : vertex.val < 336 + · exact partsPoint_permuteVertex_isTransform_case5_chunk41 vertex ⟨by omega, h41⟩ + by_cases h42 : vertex.val < 344 + · exact partsPoint_permuteVertex_isTransform_case5_chunk42 vertex ⟨by omega, h42⟩ + by_cases h43 : vertex.val < 352 + · exact partsPoint_permuteVertex_isTransform_case5_chunk43 vertex ⟨by omega, h43⟩ + by_cases h44 : vertex.val < 360 + · exact partsPoint_permuteVertex_isTransform_case5_chunk44 vertex ⟨by omega, h44⟩ + by_cases h45 : vertex.val < 368 + · exact partsPoint_permuteVertex_isTransform_case5_chunk45 vertex ⟨by omega, h45⟩ + by_cases h46 : vertex.val < 376 + · exact partsPoint_permuteVertex_isTransform_case5_chunk46 vertex ⟨by omega, h46⟩ + by_cases h47 : vertex.val < 384 + · exact partsPoint_permuteVertex_isTransform_case5_chunk47 vertex ⟨by omega, h47⟩ + by_cases h48 : vertex.val < 392 + · exact partsPoint_permuteVertex_isTransform_case5_chunk48 vertex ⟨by omega, h48⟩ + by_cases h49 : vertex.val < 400 + · exact partsPoint_permuteVertex_isTransform_case5_chunk49 vertex ⟨by omega, h49⟩ + by_cases h50 : vertex.val < 408 + · exact partsPoint_permuteVertex_isTransform_case5_chunk50 vertex ⟨by omega, h50⟩ + by_cases h51 : vertex.val < 416 + · exact partsPoint_permuteVertex_isTransform_case5_chunk51 vertex ⟨by omega, h51⟩ + by_cases h52 : vertex.val < 424 + · exact partsPoint_permuteVertex_isTransform_case5_chunk52 vertex ⟨by omega, h52⟩ + by_cases h53 : vertex.val < 432 + · exact partsPoint_permuteVertex_isTransform_case5_chunk53 vertex ⟨by omega, h53⟩ + by_cases h54 : vertex.val < 440 + · exact partsPoint_permuteVertex_isTransform_case5_chunk54 vertex ⟨by omega, h54⟩ + by_cases h55 : vertex.val < 448 + · exact partsPoint_permuteVertex_isTransform_case5_chunk55 vertex ⟨by omega, h55⟩ + by_cases h56 : vertex.val < 456 + · exact partsPoint_permuteVertex_isTransform_case5_chunk56 vertex ⟨by omega, h56⟩ + by_cases h57 : vertex.val < 464 + · exact partsPoint_permuteVertex_isTransform_case5_chunk57 vertex ⟨by omega, h57⟩ + by_cases h58 : vertex.val < 472 + · exact partsPoint_permuteVertex_isTransform_case5_chunk58 vertex ⟨by omega, h58⟩ + by_cases h59 : vertex.val < 480 + · exact partsPoint_permuteVertex_isTransform_case5_chunk59 vertex ⟨by omega, h59⟩ + exact partsPoint_permuteVertex_isTransform_case5_chunk60 vertex ⟨by omega, by omega⟩ + private lemma partsPoint_permuteVertex_isTransform (symmetry : Fin 6) : ∀ vertex, PartsPoint.IsTransform symmetry (partsPoint vertex) (partsPoint (partsPermuteVertex symmetry vertex)) := by - fin_cases symmetry <;> - simp only [PartsPoint.IsTransform] <;> decide +kernel + fin_cases symmetry + · simpa using partsPoint_permuteVertex_isTransform_case0 + · simpa using partsPoint_permuteVertex_isTransform_case1 + · simpa using partsPoint_permuteVertex_isTransform_case2 + · simpa using partsPoint_permuteVertex_isTransform_case3 + · simpa using partsPoint_permuteVertex_isTransform_case4 + · simpa using partsPoint_permuteVertex_isTransform_case5 private lemma partsAdjacent_permuteVertex (symmetry : Fin 6) (left right : Fin 481) : partsAdjacent (partsPermuteVertex symmetry left) (partsPermuteVertex symmetry right) = @@ -251,7 +5171,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 +5294,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..2541a415ef 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,28 +62,28 @@ 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 | some chunk => chunk[index % 64]? /-- Properness on every listed unit edge. -/ -def PartsGadgetProper (coloring : Fin 73 → Fin 4) : Prop := +@[expose] def PartsGadgetProper (coloring : Fin 73 → Fin 4) : Prop := ∀ vertex neighbor, neighbor ∈ partsGadgetNeighbors vertex → coloring vertex ≠ coloring neighbor /-- Every listed sqrt-three triangle is non-monochromatic. -/ -def PartsGadgetNoMono (coloring : Fin 73 → Fin 4) : Prop := +@[expose] def PartsGadgetNoMono (coloring : Fin 73 → Fin 4) : Prop := ∀ vertex pair, pair ∈ partsGadgetTriplePairs vertex → ¬(coloring vertex = coloring pair.1 ∧ coloring pair.1 = coloring pair.2) /-- The two constraints used by the second-stage checker. -/ -def PartsGadgetValid (coloring : Fin 73 → Fin 4) : Prop := +@[expose] 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..32a10fc644 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsGadgetEmbeddingCore.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsGadgetEmbeddingCore.lean @@ -15,15 +15,15 @@ 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 /-- The integral quadratic norm of an axial lattice vector. -/ -def partsAxialNormSq (q r : ℤ) : ℤ := q ^ 2 + q * r + r ^ 2 +@[expose] def partsAxialNormSq (q r : ℤ) : ℤ := q ^ 2 + q * r + r ^ 2 /-- Whether a descriptor is the common center of both patches. -/ -def PartsGadgetVertex.IsCenter (vertex : PartsGadgetVertex) : Prop := +@[expose] def PartsGadgetVertex.IsCenter (vertex : PartsGadgetVertex) : Prop := vertex.q = 0 ∧ vertex.r = 0 instance (vertex : PartsGadgetVertex) : Decidable vertex.IsCenter := by @@ -31,7 +31,7 @@ instance (vertex : PartsGadgetVertex) : Decidable vertex.IsCenter := by infer_instance /-- Arithmetic classification of every unit edge in the gadget. -/ -def PartsGadgetEdgeCase (left right : Fin 73) : Prop := +@[expose] def PartsGadgetEdgeCase (left right : Fin 73) : Prop := let leftData := partsGadgetVertex left let rightData := partsGadgetVertex right ((leftData.rotated = rightData.rotated ∨ @@ -47,7 +47,7 @@ instance (left right : Fin 73) : Decidable (PartsGadgetEdgeCase left right) := b infer_instance /-- Explicit point of the doubled triangular-lattice patch. -/ -noncomputable def partsGadgetPoint (vertex : Fin 73) : R2 := +@[expose] noncomputable def partsGadgetPoint (vertex : Fin 73) : R2 := let descriptor := partsGadgetVertex vertex partsApplyPatch descriptor.rotated (partsAxialPoint descriptor.q descriptor.r) 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..e4ce1bb5ee 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 @@ -65,6 +65,7 @@ theorem partsGadgetHardCertificates_verify (index : Fin 31) : /-- The case router covers every unblocked normalized color. -/ theorem partsGadgetHardCaseTree_verifiesRouting : partsGadgetHardCaseTree.VerifiesRouting partsGadgetHardCertificates := by - decide + cbv + simp end 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..504d59418e 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsPlaneGeometry.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsPlaneGeometry.lean @@ -15,12 +15,12 @@ distance-preserving rotations. The two exact cosines are the angles used in Parts' doubled wheel and spindle. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds /-- A point in `R²` from its two Cartesian coordinates. -/ -noncomputable def pointR2 (x y : ℝ) : R2 := +@[expose] noncomputable def pointR2 (x y : ℝ) : R2 := WithLp.toLp 2 ![x, y] @[simp] lemma pointR2_zero (x y : ℝ) : pointR2 x y 0 = x := rfl @@ -53,13 +53,13 @@ lemma partsAxialPoint_sub (q r q' r' : ℤ) : fin_cases i <;> simp [partsAxialPoint, pointR2] <;> ring private lemma partsPoint_195 : - partsPoint (195 : Fin 481) = ⟨6, 0, 6, 0⟩ := by decide + partsPoint (195 : Fin 481) = ⟨6, 0, 6, 0⟩ := by rfl private lemma partsPoint_205 : - partsPoint (205 : Fin 481) = ⟨6, 0, -6, 0⟩ := by decide + partsPoint (205 : Fin 481) = ⟨6, 0, -6, 0⟩ := by rfl private lemma partsPoint_215 : - partsPoint (215 : Fin 481) = ⟨-12, 0, 0, 0⟩ := by decide + partsPoint (215 : Fin 481) = ⟨-12, 0, 0, 0⟩ := by rfl lemma partsTriangleA_eq_axial : partsTriangleA = partsAxialPoint 1 0 := by ext i @@ -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) : @@ -252,7 +252,7 @@ lemma partsTriangleMotion_C (rotated : Bool) (centerQ centerR : ℤ) simp [partsApplyNegation, partsAxialPoint, pointR2] <;> ring /-- Pull a proper plane coloring back along any distance-preserving map. -/ -noncomputable def pullbackUnitDistanceColoring {color : Type*} +@[expose] noncomputable def pullbackUnitDistanceColoring {color : Type*} (planeColoring : unitDistanceGraph.Coloring color) (motion : R2 → R2) (hdist : ∀ p q, dist (motion p) (motion q) = dist p q) : unitDistanceGraph.Coloring color := diff --git a/LeanPool/HadwigerNelsonBounds/PartsRootDecision.lean b/LeanPool/HadwigerNelsonBounds/PartsRootDecision.lean index 565222db03..d0aebf2beb 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 @@ -41,9 +41,84 @@ def partsRootDecisionNodes : Array (Array PartsRootNode) := #[ partsRootDecisionChunk15, ] +private def partsAssignmentFieldsEq (left right : PartsAssignment) : Bool := + (left.vertex == right.vertex) && (left.color == right.color) + +private theorem partsAssignmentFieldsEq_eq (left right : PartsAssignment) : + partsAssignmentFieldsEq left right = (left == right) := by + apply Bool.eq_iff_iff.mpr + simp only [partsAssignmentFieldsEq, Bool.and_eq_true, beq_iff_eq] + constructor + · rintro ⟨hvertex, hcolor⟩ + cases left with + | mk leftVertex leftColor => + cases right with + | mk rightVertex rightColor => + cases hvertex + cases hcolor + rfl + · intro h + cases h + exact ⟨rfl, rfl⟩ + +private def partsAssignmentInPathBExplicit (path : List PartsAssignment) + (assignment : PartsAssignment) : Bool := + path.any fun current => partsAssignmentFieldsEq current assignment + +private theorem partsAssignmentInPathBExplicit_eq (path : List PartsAssignment) + (assignment : PartsAssignment) : + partsAssignmentInPathBExplicit path assignment = + PartsAssignmentInPathB path assignment := by + simp only [partsAssignmentInPathBExplicit, PartsAssignmentInPathB, + partsAssignmentFieldsEq_eq] + +private def partsRootsInPathBExplicit (path roots : List PartsAssignment) : Bool := + roots.all (partsAssignmentInPathBExplicit path) + +private theorem partsRootsInPathBExplicit_eq (path roots : List PartsAssignment) : + partsRootsInPathBExplicit path roots = PartsRootsInPathB path roots := by + simp only [partsRootsInPathBExplicit, PartsRootsInPathB] + congr 1 + funext assignment + exact partsAssignmentInPathBExplicit_eq path assignment + +private def partsRootVerifiesNodeBExplicit (nodes : Array (Array PartsRootNode)) : + Nat → List PartsAssignment → Nat → Bool + | 0, _, _ => false + | fuel + 1, path, index => + match partsRootNodeAt nodes index with + | none => false + | some (.leaf base symmetry swap) => + partsRootsInPathBExplicit path + (partsTransformPath symmetry swap (partsBaseCertificate base).roots) + | some (.branch vertex children) => + partsColors.all fun color => + PartsBlocksB path vertex color || + match partsRootChild children color with + | none => false + | some child => + partsRootVerifiesNodeBExplicit nodes fuel + (⟨vertex, color⟩ :: path) child + +private theorem partsRootVerifiesNodeBExplicit_eq (nodes : Array (Array PartsRootNode)) : + ∀ fuel path index, + partsRootVerifiesNodeBExplicit nodes fuel path index = + PartsRootVerifiesNodeB nodes fuel path index := by + intro fuel + induction fuel with + | zero => + intro path index + rfl + | succ fuel ih => + intro path index + simp only [partsRootVerifiesNodeBExplicit, PartsRootVerifiesNodeB, + partsRootsInPathBExplicit_eq, ih] + rfl + theorem partsRootDecision_verifies : PartsRootVerifiesNodeB partsRootDecisionNodes 1024 partsNormalizedRootPath 0 = true := by + rw [← partsRootVerifiesNodeBExplicit_eq] decide +kernel /-- No proper coloring of the Parts graph extends the normalized fixed root. -/ diff --git a/LeanPool/HadwigerNelsonBounds/PartsRootDecisionCore.lean b/LeanPool/HadwigerNelsonBounds/PartsRootDecisionCore.lean index 8ce236fb8b..7318a9c258 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 @@ -25,25 +25,25 @@ inductive PartsRootNode where | leaf (base : Fin 36) (symmetry : Fin 6) (swap : Bool) /-- Decode a branch's zero-sentinel child table. -/ -def partsRootChild (children : Fin 4 → Nat) (color : Fin 4) : Option Nat := +@[expose] def partsRootChild (children : Fin 4 → Nat) (color : Fin 4) : Option Nat := match children color with | 0 => none | n + 1 => some n /-- Constant-depth lookup in 64-node root-trie chunks. -/ -def partsRootNodeAt (nodes : Array (Array PartsRootNode)) (index : Nat) : +@[expose] def partsRootNodeAt (nodes : Array (Array PartsRootNode)) (index : Nat) : Option PartsRootNode := match nodes[index / 64]? with | none => none | some chunk => chunk[index % 64]? /-- Executable membership of an exact assignment in a current path. -/ -def PartsAssignmentInPathB (path : List PartsAssignment) +@[expose] def PartsAssignmentInPathB (path : List PartsAssignment) (assignment : PartsAssignment) : Bool := path.any fun current => current == assignment /-- Every selected certificate root already occurs in the root-trie path. -/ -def PartsRootsInPathB (path roots : List PartsAssignment) : Bool := +@[expose] def PartsRootsInPathB (path roots : List PartsAssignment) : Bool := roots.all (PartsAssignmentInPathB path) lemma partsRootsInPathB_sound {coloring : Fin 481 → Fin 4} {path roots} @@ -59,7 +59,7 @@ lemma partsRootsInPathB_sound {coloring : Fin 481 → Fin 4} {path roots} exact hextends assignment hcurrent /-- Executable checker for the finite root-case trie. -/ -def PartsRootVerifiesNodeB (nodes : Array (Array PartsRootNode)) : +@[expose] def PartsRootVerifiesNodeB (nodes : Array (Array PartsRootNode)) : Nat → List PartsAssignment → Nat → Bool | 0, _, _ => false | fuel + 1, path, index => @@ -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..a6e82192e1 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsRootDecisionData0.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsRootDecisionData0.lean @@ -9,12 +9,12 @@ public import LeanPool.HadwigerNelsonBounds.PartsRootDecisionCore /-! Generated root-decision chunks 0 through 3. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds /-- Root-decision data chunk 0. -/ -def partsRootDecisionChunk0 : Array PartsRootNode := #[ +@[expose] def partsRootDecisionChunk0 : Array PartsRootNode := #[ PartsRootNode.branch 210 ![0, 2, 513, 0], PartsRootNode.branch 220 ![0, 3, 240, 0], PartsRootNode.branch 200 ![0, 4, 110, 0], @@ -82,7 +82,7 @@ def partsRootDecisionChunk0 : Array PartsRootNode := #[ ] /-- Root-decision data chunk 1. -/ -def partsRootDecisionChunk1 : Array PartsRootNode := #[ +@[expose] def partsRootDecisionChunk1 : Array PartsRootNode := #[ PartsRootNode.branch 69 ![66, 0, 0, 68], PartsRootNode.branch 75 ![0, 0, 0, 67], PartsRootNode.leaf 5 1 false, @@ -150,7 +150,7 @@ def partsRootDecisionChunk1 : Array PartsRootNode := #[ ] /-- Root-decision data chunk 2. -/ -def partsRootDecisionChunk2 : Array PartsRootNode := #[ +@[expose] def partsRootDecisionChunk2 : Array PartsRootNode := #[ PartsRootNode.leaf 13 0 false, PartsRootNode.branch 75 ![131, 132, 0, 0], PartsRootNode.leaf 14 0 false, @@ -218,7 +218,7 @@ def partsRootDecisionChunk2 : Array PartsRootNode := #[ ] /-- Root-decision data chunk 3. -/ -def partsRootDecisionChunk3 : Array PartsRootNode := #[ +@[expose] def partsRootDecisionChunk3 : Array PartsRootNode := #[ PartsRootNode.leaf 33 0 false, PartsRootNode.branch 75 ![195, 196, 0, 0], PartsRootNode.leaf 34 0 false, diff --git a/LeanPool/HadwigerNelsonBounds/PartsRootDecisionData1.lean b/LeanPool/HadwigerNelsonBounds/PartsRootDecisionData1.lean index e67bf1ab3a..6b9135fba0 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsRootDecisionData1.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsRootDecisionData1.lean @@ -9,12 +9,12 @@ public import LeanPool.HadwigerNelsonBounds.PartsRootDecisionCore /-! Generated root-decision chunks 4 through 7. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds /-- Root-decision data chunk 4. -/ -def partsRootDecisionChunk4 : Array PartsRootNode := #[ +@[expose] def partsRootDecisionChunk4 : Array PartsRootNode := #[ PartsRootNode.branch 75 ![258, 0, 0, 0], PartsRootNode.leaf 20 5 false, PartsRootNode.branch 69 ![260, 262, 0, 0], @@ -82,7 +82,7 @@ def partsRootDecisionChunk4 : Array PartsRootNode := #[ ] /-- Root-decision data chunk 5. -/ -def partsRootDecisionChunk5 : Array PartsRootNode := #[ +@[expose] def partsRootDecisionChunk5 : Array PartsRootNode := #[ PartsRootNode.branch 75 ![322, 0, 0, 323], PartsRootNode.leaf 6 1 false, PartsRootNode.leaf 15 1 false, @@ -150,7 +150,7 @@ def partsRootDecisionChunk5 : Array PartsRootNode := #[ ] /-- Root-decision data chunk 6. -/ -def partsRootDecisionChunk6 : Array PartsRootNode := #[ +@[expose] def partsRootDecisionChunk6 : Array PartsRootNode := #[ PartsRootNode.leaf 24 2 true, PartsRootNode.branch 69 ![387, 390, 0, 393], PartsRootNode.branch 75 ![0, 388, 0, 389], @@ -218,7 +218,7 @@ def partsRootDecisionChunk6 : Array PartsRootNode := #[ ] /-- Root-decision data chunk 7. -/ -def partsRootDecisionChunk7 : Array PartsRootNode := #[ +@[expose] def partsRootDecisionChunk7 : Array PartsRootNode := #[ PartsRootNode.branch 75 ![0, 0, 0, 450], PartsRootNode.leaf 34 4 true, PartsRootNode.branch 75 ![0, 452, 0, 0], diff --git a/LeanPool/HadwigerNelsonBounds/PartsRootDecisionData2.lean b/LeanPool/HadwigerNelsonBounds/PartsRootDecisionData2.lean index ea129d3eb8..9d56af32b9 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsRootDecisionData2.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsRootDecisionData2.lean @@ -9,12 +9,12 @@ public import LeanPool.HadwigerNelsonBounds.PartsRootDecisionCore /-! Generated root-decision chunks 8 through 11. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds /-- Root-decision data chunk 8. -/ -def partsRootDecisionChunk8 : Array PartsRootNode := #[ +@[expose] def partsRootDecisionChunk8 : Array PartsRootNode := #[ PartsRootNode.branch 220 ![0, 514, 787, 0], PartsRootNode.branch 200 ![0, 515, 651, 0], PartsRootNode.branch 72 ![0, 516, 561, 606], @@ -82,7 +82,7 @@ def partsRootDecisionChunk8 : Array PartsRootNode := #[ ] /-- Root-decision data chunk 9. -/ -def partsRootDecisionChunk9 : Array PartsRootNode := #[ +@[expose] def partsRootDecisionChunk9 : Array PartsRootNode := #[ PartsRootNode.leaf 23 2 false, PartsRootNode.leaf 25 2 false, PartsRootNode.branch 69 ![580, 0, 582, 0], @@ -150,7 +150,7 @@ def partsRootDecisionChunk9 : Array PartsRootNode := #[ ] /-- Root-decision data chunk 10. -/ -def partsRootDecisionChunk10 : Array PartsRootNode := #[ +@[expose] def partsRootDecisionChunk10 : Array PartsRootNode := #[ PartsRootNode.leaf 6 4 false, PartsRootNode.leaf 15 4 false, PartsRootNode.branch 75 ![644, 0, 645, 0], @@ -218,7 +218,7 @@ def partsRootDecisionChunk10 : Array PartsRootNode := #[ ] /-- Root-decision data chunk 11. -/ -def partsRootDecisionChunk11 : Array PartsRootNode := #[ +@[expose] def partsRootDecisionChunk11 : Array PartsRootNode := #[ PartsRootNode.leaf 17 5 true, PartsRootNode.branch 69 ![707, 0, 709, 712], PartsRootNode.branch 75 ![0, 0, 0, 708], diff --git a/LeanPool/HadwigerNelsonBounds/PartsRootDecisionData3.lean b/LeanPool/HadwigerNelsonBounds/PartsRootDecisionData3.lean index 4bc6dd050f..e6cccefff4 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsRootDecisionData3.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsRootDecisionData3.lean @@ -9,12 +9,12 @@ public import LeanPool.HadwigerNelsonBounds.PartsRootDecisionCore /-! Generated root-decision chunks 12 through 15. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds /-- Root-decision data chunk 12. -/ -def partsRootDecisionChunk12 : Array PartsRootNode := #[ +@[expose] def partsRootDecisionChunk12 : Array PartsRootNode := #[ PartsRootNode.leaf 29 1 true, PartsRootNode.leaf 33 1 true, PartsRootNode.branch 75 ![0, 772, 0, 0], @@ -82,7 +82,7 @@ def partsRootDecisionChunk12 : Array PartsRootNode := #[ ] /-- Root-decision data chunk 13. -/ -def partsRootDecisionChunk13 : Array PartsRootNode := #[ +@[expose] def partsRootDecisionChunk13 : Array PartsRootNode := #[ PartsRootNode.branch 84 ![0, 0, 0, 834], PartsRootNode.branch 81 ![835, 841, 0, 848], PartsRootNode.branch 69 ![0, 836, 0, 839], @@ -150,7 +150,7 @@ def partsRootDecisionChunk13 : Array PartsRootNode := #[ ] /-- Root-decision data chunk 14. -/ -def partsRootDecisionChunk14 : Array PartsRootNode := #[ +@[expose] def partsRootDecisionChunk14 : Array PartsRootNode := #[ PartsRootNode.branch 84 ![0, 898, 0, 0], PartsRootNode.branch 81 ![899, 905, 0, 912], PartsRootNode.branch 69 ![0, 900, 0, 903], @@ -218,7 +218,7 @@ def partsRootDecisionChunk14 : Array PartsRootNode := #[ ] /-- Root-decision data chunk 15. -/ -def partsRootDecisionChunk15 : Array PartsRootNode := #[ +@[expose] def partsRootDecisionChunk15 : Array PartsRootNode := #[ PartsRootNode.leaf 1 0 true, PartsRootNode.branch 69 ![963, 0, 0, 965], PartsRootNode.branch 75 ![0, 0, 0, 964], 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..d00571256d 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 @@ -140,11 +140,12 @@ lemma forest_edge_formula (H : SimpleGraph V) [DecidableRel H.Adj] (hH : H.IsAcy _ = Fintype.card V := componentVerts_card H /-- An edge subset of the graph whose induced graph is acyclic. -/ -def IsGraphForest (G : SimpleGraph V) (A : Finset (Sym2 V)) : Prop := +@[expose] def IsGraphForest (G : SimpleGraph V) (A : Finset (Sym2 V)) : Prop := (A : Set (Sym2 V)) ⊆ G.edgeSet ∧ (SimpleGraph.fromEdgeSet (A : Set (Sym2 V))).IsAcyclic /-- A nonforest edge subset that becomes a forest after deleting any edge. -/ +@[expose] def IsGraphCircuit (G : SimpleGraph V) (C : Finset (Sym2 V)) : Prop := C ⊆ graphEdgeFinset G ∧ ¬IsGraphForest G C ∧ 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..9218ca0229 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 @@ -30,7 +30,7 @@ noncomputable section abbrev HardSphereForkTriple (k : Nat) := Fin k × Fin k × Fin k /-- The three vertices supporting an order-compatible fork triple. -/ -def hardSphereForkSupport {k : Nat} (f : HardSphereForkTriple k) : Finset (Fin k) := +@[expose] def hardSphereForkSupport {k : Nat} (f : HardSphereForkTriple k) : Finset (Fin k) := {f.1, f.2.1, f.2.2} /-- The event associated with an order-compatible fork triple. -/ @@ -40,6 +40,7 @@ def hardSphereForkEventOfTriple {k : Nat} [NeZero k] hardSphereForkEvent T f.1 f.2.1 f.2.2 /-- A finite family of pairwise vertex-disjoint, order-compatible forks in a tree. -/ +@[expose] def hardSphereForkPacking {k : Nat} (T : Finset (Sym2 (Fin k))) (P : Finset (HardSphereForkTriple k)) : Prop := (∀ f ∈ P, hardSphereFork T f.1 f.2.1 f.2.2) ∧ diff --git a/LeanPool/HardSphereNBC/HardSphereFork.lean b/LeanPool/HardSphereNBC/HardSphereFork.lean index 54b7ff604d..20322d1bb4 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 @@ -26,6 +26,7 @@ noncomputable section /-- An order-compatible fork `(a,b,c)` with `a < b < c`; `a` is its center and `b,c` are its two leaves. -/ +@[expose] def hardSphereFork {k : Nat} (T : Finset (Sym2 (Fin k))) (a b c : Fin k) : Prop := a < b ∧ b < c ∧ s(a, b) ∈ T ∧ s(a, c) ∈ T @@ -186,7 +187,7 @@ lemma hardSphere_nbc_region_excludes_fork_chord /-- The volume of the open unit ball in the three-dimensional position space. -/ -def hardSphereKappa : ℝ := +@[expose] def hardSphereKappa : ℝ := let : Fintype (Fin 3) := Fin.fintype 3 (volume : Measure (HSPosition 3)).real (ball (0 : HSPosition 3) 1) @@ -200,12 +201,13 @@ lemma hardSphereKappa_eq : hardSphereKappa = 4 * Real.pi / 3 := by ring /-- The hard-sphere configuration region owned by a fixed edge set. -/ -def hardSphereTreeRegion {k : Nat} [NeZero k] +@[expose] def hardSphereTreeRegion {k : Nat} [NeZero k] (T : Finset (Sym2 (Fin k))) : Set (HardSphereConfiguration k 3) := {r | ∀ e ∈ T, hardSphereActiveExact r e = true} /-- The part of a tree region where the two leaves of an order-compatible fork are also within range. -/ +@[expose] def hardSphereForkEvent {k : Nat} [NeZero k] (T : Finset (Sym2 (Fin k))) (_a b c : Fin k) : Set (HardSphereConfiguration k 3) := hardSphereTreeRegion T ∩ {r | 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..a211016130 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 @@ -112,7 +112,7 @@ lemma hardSphereSeparatedVolume_ratio_identity : ring /-- Independent unit-ball constraints on a finite product of position spaces. -/ -def hardSphereProductBallRegion (n : Nat) : +@[expose] def hardSphereProductBallRegion (n : Nat) : Set (Fin n → HSPosition 3) := {r | ∀ i, r i ∈ Metric.ball 0 1} 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..56386f0346 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 @@ -30,11 +30,11 @@ noncomputable section /-- The lexicographic key given by the smaller and larger endpoints of an edge. -/ -def hardSphereEdgeKey {k : Nat} (e : Sym2 (Fin k)) : Fin k ×ₗ Fin k := +@[expose] def hardSphereEdgeKey {k : Nat} (e : Sym2 (Fin k)) : Fin k ×ₗ Fin k := toLex (e.inf, e.sup) /-- Order unordered edges lexicographically by their sorted endpoints. -/ -@[instance_reducible] +@[instance_reducible, expose] noncomputable def hardSphereEdgeLinearOrder (k : Nat) : LinearOrder (Sym2 (Fin k)) := LinearOrder.lift' (hardSphereEdgeKey (k := k)) (by @@ -54,16 +54,17 @@ abbrev HardSphereConfiguration (k d : Nat) := Fin (k - 1) → HSPosition d /-- The zero-based coordinate index of a particle other than the anchored particle. -/ -def hardSphereFreeIndex {k : Nat} [NeZero k] +@[expose] def hardSphereFreeIndex {k : Nat} [NeZero k] (i : Fin k) (hi : i ≠ 0) : Fin (k - 1) := ⟨i.val - 1, by omega⟩ /-- The particle label corresponding to a free coordinate. -/ -def hardSphereFreeParticleIndex {k : Nat} +@[expose] def hardSphereFreeParticleIndex {k : Nat} (i : Fin (k - 1)) : Fin k := ⟨i.val + 1, by omega⟩ /-- Recover a particle position, assigning zero to the anchored particle. -/ +@[expose] def hardSpherePosition {k d : Nat} [NeZero k] (r : HardSphereConfiguration k d) (i : Fin k) : HSPosition d := if hi : i = 0 then 0 else r (hardSphereFreeIndex i hi) @@ -286,12 +287,12 @@ def hardSphereOmega {k d : Nat} [NeZero k] (mayerKernel (hardSphereActiveExact r) : ℝ) /-- The hard-sphere cluster integral normalized by the factorial of the particle count. -/ -def hardSphereBk {k d : Nat} [NeZero k] : ℝ := +@[expose] def hardSphereBk {k d : Nat} [NeZero k] : ℝ := (k.factorial : ℝ)⁻¹ * ∫ r : HardSphereConfiguration k d, hardSphereOmega r /-- The volume of configurations assigned to a fixed no-broken-circuit tree. -/ -def hardSphereNBCVolume {k d : Nat} [NeZero k] +@[expose] def hardSphereNBCVolume {k d : Nat} [NeZero k] (T : Finset (Sym2 (Fin k))) : ℝ := (volume : Measure (HardSphereConfiguration k d)).real (nbcRegion (V := Fin k) diff --git a/LeanPool/HardSphereNBC/HardSphereTree.lean b/LeanPool/HardSphereNBC/HardSphereTree.lean index e59bd70266..98f0d8d9d4 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 @@ -25,7 +25,7 @@ open scoped BigOperators ENNReal noncomputable section /-- The graph induced by a finite set of particle edges. -/ -def hardSphereTreeGraph {k : Nat} +@[expose] def hardSphereTreeGraph {k : Nat} (T : Finset (Sym2 (Fin k))) : SimpleGraph (Fin k) := SimpleGraph.fromEdgeSet (T : Set (Sym2 (Fin k))) @@ -166,7 +166,7 @@ lemma hardSphereTreeParent_index_lt {k : Nat} [NeZero k] omega) /-- The position difference along the rooted parent edge of a free particle. -/ -def hardSphereTreeDifference {k : Nat} [NeZero k] +@[expose] def hardSphereTreeDifference {k : Nat} [NeZero k] {T : Finset (Sym2 (Fin k))} (hT : T ∈ treeUniverse (V := Fin k)) (r : HardSphereConfiguration k 3) (i : Fin (k - 1)) : HSPosition 3 := diff --git a/LeanPool/HardSphereNBC/HardSphereTreeDifference.lean b/LeanPool/HardSphereNBC/HardSphereTreeDifference.lean index 1320acbf3f..59a2abf5dc 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 @@ -246,6 +246,7 @@ lemma measurePreserving_hardSphereCoordinateEquiv (k : Nat) : exact h₁.trans h₂ /-- Flattened position arrays with every three-dimensional block in the unit ball. -/ +@[expose] def hardSphereFlatProductBallRegion (n : Nat) : Set (Fin n × Fin 3 → ℝ) := {x | ∀ i, (MeasurableEquiv.toLp 2 (Fin 3 → ℝ)) (fun a => x (i, a)) ∈ @@ -381,7 +382,7 @@ lemma hardSphereFlatProductBallRegion_volume (n : Nat) : /-! ### The separated two-member block -/ /-- Pairs of unit-ball positions separated by distance at least one. -/ -def hardSphereSeparatedPairRegion : Set (HSPosition 3 × HSPosition 3) := +@[expose] def hardSphereSeparatedPairRegion : Set (HSPosition 3 × HSPosition 3) := {p | p.1 ∈ ball (0 : HSPosition 3) 1 ∧ p.2 ∈ ball (0 : HSPosition 3) 1 ∧ 1 ≤ ‖p.1 - p.2‖} @@ -551,7 +552,7 @@ lemma hardSphereSeparatedPairRegion_flatten_volume_eq_flat : rw [hardSpherePairCoordinateEquiv_image_separatedPairRegion] /-- Pairs of unit-ball positions separated by distance less than one. -/ -def hardSphereClosePairRegion : Set (HSPosition 3 × HSPosition 3) := +@[expose] def hardSphereClosePairRegion : Set (HSPosition 3 × HSPosition 3) := {p | p.1 ∈ ball (0 : HSPosition 3) 1 ∧ p.2 ∈ ball (0 : HSPosition 3) 1 ∧ ‖p.1 - p.2‖ < 1} @@ -654,7 +655,7 @@ lemma hardSphereSeparatedPairRegion_real_add_close_volume : exact h.trans htotal /-- The parent relation implementing the difference of the second position from the first. -/ -def hardSpherePairParent (q : Fin 2 × Fin 3) : Option (Fin 2 × Fin 3) := +@[expose] def hardSpherePairParent (q : Fin 2 × Fin 3) : Option (Fin 2 × Fin 3) := if q.1 = 0 then none else some (0, q.2) /-- The lexicographic order on particle and spatial indices for a pair. -/ @@ -690,7 +691,7 @@ lemma hardSpherePairParent_lt : ∀ q p, hardSpherePairParent q = some p → exact hqpos /-- The linear parent-difference map on a flattened pair of positions. -/ -def hardSpherePairDifferenceLinearMap : +@[expose] def hardSpherePairDifferenceLinearMap : ((Fin 2 × Fin 3) → ℝ) →ₗ[ℝ] ((Fin 2 × Fin 3) → ℝ) := hardSphereParentDifferenceLinearMap hardSpherePairParent @@ -700,7 +701,7 @@ lemma measurePreserving_hardSpherePairDifferenceLinearMap : hardSpherePairIndexOrder hardSpherePairParent_lt /-- The two leaf positions relative to the common center of a fork. -/ -def hardSphereForkRelativePair {k : Nat} [NeZero k] +@[expose] def hardSphereForkRelativePair {k : Nat} [NeZero k] (r : HardSphereConfiguration k 3) (a b c : Fin k) : HSPosition 3 × HSPosition 3 := (hardSpherePosition r b - hardSpherePosition r a, @@ -738,7 +739,7 @@ lemma hardSphere_nbc_region_mem_separatedPair simpa [sub_zero] using hacnorm /-- Families of separated pairs, each lying in the unit ball. -/ -def hardSphereSeparatedPairProductRegion (m : Nat) : +@[expose] def hardSphereSeparatedPairProductRegion (m : Nat) : Set (Fin m → (HSPosition 3 × HSPosition 3)) := {x | ∀ i, x i ∈ hardSphereSeparatedPairRegion} @@ -765,7 +766,7 @@ lemma hardSphereSeparatedPairProductRegion_volume (m : Nat) : simp only [Finset.prod_const, Finset.card_univ, Fintype.card_fin, Measure.real] /-- A product of separated-pair regions and unconstrained unit-ball positions. -/ -def hardSphereSeparatedBlockProductRegion (m q : Nat) : +@[expose] def hardSphereSeparatedBlockProductRegion (m q : Nat) : Set ((Fin m → (HSPosition 3 × HSPosition 3)) × (Fin q → HSPosition 3)) := hardSphereSeparatedPairProductRegion m ×ˢ hardSphereProductBallRegion q @@ -794,6 +795,7 @@ lemma hardSphereSeparatedBlockProductRegion_volume (m q : Nat) : /-! ### Canonical separated-block coordinates -/ /-- Split a position array into paired blocks and remaining single positions. -/ +@[expose] def hardSphereBlockCoordinateEquiv (m q : Nat) : (Fin (m * 2 + q) → HSPosition 3) ≃ᵐ ((Fin m → (HSPosition 3 × HSPosition 3)) × @@ -915,7 +917,7 @@ lemma hardSphereBlockCoordinateEquiv_preimage_separatedBlockProductRegion_volume hardSphereSeparatedBlockProductRegion_volume m q /-- Reindex a position array before separating paired and single blocks. -/ -def hardSphereReindexedBlockCoordinateEquiv +@[expose] def hardSphereReindexedBlockCoordinateEquiv {n m q : Nat} (e : Fin (m * 2 + q) ≃ Fin n) : (Fin n → HSPosition 3) ≃ᵐ ((Fin m → (HSPosition 3 × HSPosition 3)) × diff --git a/LeanPool/HardSphereNBC/HardSphereTreeEdges.lean b/LeanPool/HardSphereNBC/HardSphereTreeEdges.lean index 3b7adb2b11..ff31575f8b 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 @@ -27,6 +27,7 @@ open scoped BigOperators ENNReal noncomputable section /-- The tree edge selected by the rooted parent of a free vertex. -/ +@[expose] def hardSphereTreeParentEdge {k : Nat} [NeZero k] {T : Finset (Sym2 (Fin k))} (hT : T ∈ treeUniverse (V := Fin k)) @@ -62,6 +63,7 @@ lemma hardSphereTreeParentEdge_injective {k : Nat} [NeZero k] omega /-- The edges joining each free particle to its rooted-tree parent. -/ +@[expose] def hardSphereTreeParentEdgeFinset {k : Nat} [NeZero k] {T : Finset (Sym2 (Fin k))} (hT : T ∈ treeUniverse (V := Fin k)) : Finset (Sym2 (Fin k)) := diff --git a/LeanPool/HardSphereNBC/MayerNBC.lean b/LeanPool/HardSphereNBC/MayerNBC.lean index 5af3bb6fa6..49e2a0792d 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 @@ -47,11 +47,11 @@ def m (G : SimpleGraph V) : Int := ∑ A ∈ connectedEdgeSubsets G, matroidParitySign A.card /-- An edge of the complete graph marked active by the overlap data. -/ -def activeEdge (x : Sym2 V → Bool) (e : Sym2 V) : Prop := +@[expose] def activeEdge (x : Sym2 V → Bool) (e : Sym2 V) : Prop := e ∈ graphEdgeFinset (completeGraph V) ∧ x e = true /-- The finite set of active edges. -/ -noncomputable def activeEdgeFinset (x : Sym2 V → Bool) : Finset (Sym2 V) := by +@[expose] noncomputable def activeEdgeFinset (x : Sym2 V → Bool) : Finset (Sym2 V) := by classical exact Finset.univ.filter (activeEdge x) @@ -91,7 +91,7 @@ lemma matroidParitySign_eq_neg_one_pow (n : Nat) : ring /-- The Mayer bond: minus one for an active edge and zero otherwise. -/ -noncomputable def bond (x : Sym2 V → Bool) (e : Sym2 V) : Int := by +@[expose] noncomputable def bond (x : Sym2 V → Bool) (e : Sym2 V) : Int := by classical exact if activeEdge x e then -1 else 0 @@ -100,7 +100,7 @@ def completeConnectedEdgeSubsets : Finset (Finset (Sym2 V)) := connectedEdgeSubsets (completeGraph V) /-- Sum the products of Mayer bonds over connected spanning edge sets. -/ -def mayerKernel (x : Sym2 V → Bool) : Int := +@[expose] def mayerKernel (x : Sym2 V → Bool) : Int := ∑ A ∈ completeConnectedEdgeSubsets, ∏ e ∈ A, bond x e @@ -192,6 +192,7 @@ lemma mayerKernel_eq_m (x : Sym2 V → Bool) : /-! ### Concrete NBC bases of the graphic matroid -/ /-- An edge completing a broken circuit already contained in the specified edge set. -/ +@[expose] def IsGraphCircuitNBCandidate (G : SimpleGraph V) (A : Finset (Sym2 V)) (e : Sym2 V) : Prop := ∃ C : Finset (Sym2 V), @@ -199,6 +200,7 @@ def IsGraphCircuitNBCandidate (G : SimpleGraph V) ((C.erase e : Finset (Sym2 V)) : Set (Sym2 V)) ⊆ (A : Set (Sym2 V)) /-- The edge set contains a broken circuit in the circuit-based formulation. -/ +@[expose] def IsGraphCircuitNBCBad (G : SimpleGraph V) (A : Finset (Sym2 V)) : Prop := ∃ e, IsGraphCircuitNBCandidate G A e @@ -207,7 +209,7 @@ def IsExplicitNBCBase (G : SimpleGraph V) (A : Finset (Sym2 V)) : Prop := IsGraphForest G A ∧ IsGraphSpanning G A ∧ ¬IsGraphCircuitNBCBad G A /-- A connected spanning forest containing no broken circuit. -/ -def IsExplicitNBCTree (G : SimpleGraph V) (A : Finset (Sym2 V)) : Prop := +@[expose] def IsExplicitNBCTree (G : SimpleGraph V) (A : Finset (Sym2 V)) : Prop := IsGraphForest G A ∧ (SimpleGraph.fromEdgeSet (A : Set (Sym2 V))).Connected ∧ ¬IsGraphCircuitNBCBad G A @@ -412,7 +414,7 @@ lemma nbcBaseSubsets_graphic_eq_graphNBCBaseSubsets exact Finset.mem_filter.mpr ⟨hspanSub, hnotbad⟩ /-- The finite collection of spanning trees on the ambient vertex set. -/ -noncomputable def treeUniverse : Finset (Finset (Sym2 V)) := by +@[expose] noncomputable def treeUniverse : Finset (Finset (Sym2 V)) := by classical exact (graphEdgeFinset (completeGraph V)).powerset.filter (fun T : Finset (Sym2 V) => @@ -507,7 +509,7 @@ lemma m_eq_signed_NBC_of_connected /-! ### Pointwise finite tree decomposition -/ /-- Configurations whose overlap graph has the specified no-broken-circuit spanning tree. -/ -def nbcRegion {X : Type*} (active : X → Sym2 V → Bool) +@[expose] def nbcRegion {X : Type*} (active : X → Sym2 V → Bool) (T : Finset (Sym2 V)) : Set X := {x | IsExplicitNBCTree (overlapGraph (active x)) T} @@ -599,7 +601,7 @@ lemma graphNBC_zero_of_not_connected {G : SimpleGraph V} exact hG ((hA'.2).2.1.mono hle) /-- The absolute value of an integer as an extended nonnegative real. -/ -def intMagnitude (z : Int) : ℝ≥0∞ := z.natAbs +@[expose] def intMagnitude (z : Int) : ℝ≥0∞ := z.natAbs lemma intMagnitude_signed_nat (n q : Nat) : intMagnitude ((-1 : Int) ^ n * (q : Int)) = (q : ℝ≥0∞) := by @@ -729,7 +731,7 @@ theorem factorial_mul_absBk_eq_nbcVolumeSum abbrev HSPosition (d : Nat) := EuclideanSpace ℝ (Fin d) /-- Particle configurations whose distinguished particle is fixed at zero. -/ -def AnchoredHSConfiguration (k d : Nat) := +@[expose] def AnchoredHSConfiguration (k d : Nat) := {r : Fin (k + 1) → HSPosition d // r 0 = 0} /-- The overlap indicators of an explicitly anchored configuration. -/ diff --git a/LeanPool/HardSphereNBC/NBCGraph.lean b/LeanPool/HardSphereNBC/NBCGraph.lean index 8e1dc5a62c..189b8346e8 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 @@ -56,6 +56,7 @@ lemma coe_graphEdgeFinset (G : SimpleGraph V) : simp /-- The finite edge set traversed by a closed walk. -/ +@[expose] def cycleEdgeFinset {G : SimpleGraph V} {v : V} (c : G.Walk v v) : Finset (Sym2 V) := c.edges.toFinset @@ -115,7 +116,7 @@ variable [LinearOrder (Sym2 V)] graph-side comparison use the supplied linear edge order, just as the generic NBC definitions do. -/ /-- The chosen non-strict comparison of graph edges. -/ -def graphEdgeLE (a b : Sym2 V) : Prop := +@[expose] def graphEdgeLE (a b : Sym2 V) : Prop := @LE.le (Sym2 V) ((inferInstance : LinearOrder (Sym2 V)).toPartialOrder.toPreorder.toLE) a b @@ -302,7 +303,7 @@ lemma graph_candidate_toggle_of_generic /-! ### Graph-side signed cancellation -/ /-- The edge set induces the same reachability relation as the ambient graph. -/ -def IsGraphSpanning (G : SimpleGraph V) (A : Finset (Sym2 V)) : Prop := +@[expose] def IsGraphSpanning (G : SimpleGraph V) (A : Finset (Sym2 V)) : Prop := (SimpleGraph.fromEdgeSet (A : Set (Sym2 V))).Reachable = G.Reachable /-- There exists an edge witnessing a broken circuit in the given edge set. -/ @@ -310,7 +311,7 @@ def IsGraphNBCBad (G : SimpleGraph V) (A : Finset (Sym2 V)) : Prop := ∃ e, IsGraphNBCandidate G A e /-- Enumerate edge subsets preserving the graph's connected components. -/ -noncomputable def graphSpanningSubsets (G : SimpleGraph V) : +@[expose] noncomputable def graphSpanningSubsets (G : SimpleGraph V) : Finset (Finset (Sym2 V)) := by classical exact (graphEdgeFinset G).powerset.filter (IsGraphSpanning G) diff --git a/LeanPool/HardSphereNBC/NBCMatroid.lean b/LeanPool/HardSphereNBC/NBCMatroid.lean index a79598ca4d..5e70890138 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 @@ -41,7 +41,7 @@ lemma mem_matroidGround (M : Matroid α) (e : α) : simp [matroidGround] /-- An element completing a circuit whose other elements lie in the specified set. -/ -def IsNBCandidate (M : Matroid α) (A : Finset α) (e : α) : Prop := +@[expose] def IsNBCandidate (M : Matroid α) (A : Finset α) (e : α) : Prop := ∃ C : Finset α, M.IsCircuit (C : Set α) ∧ e ∈ C ∧ @@ -54,7 +54,7 @@ noncomputable def nbcCandidates (M : Matroid α) (A : Finset α) : Finset α := exact (matroidGround M).filter (IsNBCandidate M A) /-- The set has at least one broken-circuit witness. -/ -def IsNBCBad (M : Matroid α) (A : Finset α) : Prop := +@[expose] def IsNBCBad (M : Matroid α) (A : Finset α) : Prop := Finset.Nonempty (nbcCandidates M A) lemma nbcCandidate_mem_ground {M : Matroid α} {A : Finset α} {e : α} @@ -90,7 +90,7 @@ lemma leastNBCandidate_le {M : Matroid α} {A : Finset α} exact (mem_nbcCandidates.mpr ⟨nbcCandidate_mem_ground he, he⟩) /-- Remove an element if present and insert it otherwise. -/ -def toggleEdge (A : Finset α) (e : α) : Finset α := +@[expose] def toggleEdge (A : Finset α) (e : α) : Finset α := if e ∈ A then A.erase e else insert e A omit [Fintype α] [LinearOrder α] in @@ -195,7 +195,7 @@ lemma leastNBCandidate_toggle_eq {M : Matroid α} {A : Finset α} simp [e, heq] /-- The alternating sign determined by a natural-number cardinality. -/ -def matroidParitySign : Nat -> Int +@[expose] def matroidParitySign : Nat -> Int | 0 => 1 | n + 1 => -matroidParitySign n @@ -216,7 +216,7 @@ lemma toggleEdge_sign {A : Finset α} {e : α} : rw [hcard, matroidParitySign_succ] /-- Enumerate the spanning subsets of the matroid ground set. -/ -noncomputable def spanningSubsets (M : Matroid α) : Finset (Finset α) := by +@[expose] noncomputable def spanningSubsets (M : Matroid α) : Finset (Finset α) := by classical exact (matroidGround M).powerset.filter (fun A => M.Spanning (A : Set α)) @@ -371,7 +371,7 @@ lemma spanning_not_nbcBad_isIndependent {M : Matroid α} {A : Finset α} exact hbad ⟨e, mem_nbcCandidates.mpr ⟨nbcCandidate_mem_ground hc, hc⟩⟩ /-- Enumerate spanning sets with no broken circuit, which are the surviving bases. -/ -noncomputable def nbcBaseSubsets (M : Matroid α) : Finset (Finset α) := by +@[expose] noncomputable def nbcBaseSubsets (M : Matroid α) : Finset (Finset α) := by classical exact (spanningSubsets M).filter (fun A => ¬IsNBCBad M A) @@ -388,11 +388,11 @@ lemma nbcBase_isBase {M : Matroid α} {A : Finset α} (mem_spanningSubsets h.1) /-- The sum of cardinality-parity signs over all spanning subsets. -/ -noncomputable def signedSpanningSum (M : Matroid α) : Int := +@[expose] noncomputable def signedSpanningSum (M : Matroid α) : Int := ∑ A ∈ spanningSubsets M, matroidParitySign A.card /-- The sum of cardinality-parity signs over the surviving no-broken-circuit sets. -/ -noncomputable def signedNBCSum (M : Matroid α) : Int := +@[expose] noncomputable def signedNBCSum (M : Matroid α) : Int := ∑ A ∈ nbcBaseSubsets M, matroidParitySign A.card lemma badSpanningSum_zero (M : Matroid α) : 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..d91f9d12ed 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» @@ -40,6 +40,7 @@ namespace Derivation2 def cast {T : Theory L} (d : T ⊢₂ Γ) (h : Γ = Δ) : T ⊢₂ Δ := h ▸ d /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] noncomputable def _root_.LO.FirstOrder.Derivation2.Sequent.codeIn (Γ : Finset (SyntacticFormula L)) : V := ∑ φ ∈ Γ, exp (⌜φ⌝ : V) 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..16d2e68a85 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 @@ -118,7 +118,7 @@ variable {L : Language} [(k : ℕ) → Encodable (L.Func k)] [(k : ℕ) → Encodable (L.Rel k)] [DefinableLanguage L] /-- Imported declaration from the Incompleteness formalization. -/ -@[reducible] +@[expose, reducible] def singleton (φ : SyntacticFormula L) : Theory.Delta1Definable {φ} where ch := .ofZero (.mkSigma “x. x = ↑⌜φ⌝” (by simp)) _ mem_iff {ψ} := by simp @@ -723,6 +723,7 @@ section «lp_section_4» variable (T : Theory ℒₒᵣ) [T.Delta1Definable] /-- Provability predicate for arithmetic stronger than $\mathbf{R_0}$. -/ +@[expose] def _root_.LO.FirstOrder.Theory.Provableₐ (φ : V) : Prop := ((T + 𝐑₀').codeIn V).Provable φ variable {T} @@ -735,6 +736,7 @@ section «lp_section_5» variable (T) /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def _root_.LO.FirstOrder.Theory.provableₐ : Sg1.Semisentence 1 := .mkSigma “p. !(T + 𝐑₀').tDef.prv p” (by simp) diff --git a/LeanPool/Incompleteness/Arithmetization/Basic/IOpen.lean b/LeanPool/Incompleteness/Arithmetization/Basic/IOpen.lean index 5a12871dd6..6f3a37c18f 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 @@ -277,7 +277,7 @@ def rem (a b : V) : V := a - b * (a / b) /-- Imported declaration from the Incompleteness formalization. -/ scoped instance instModV : Mod V := ⟨rem⟩ -lemma mod_def (a b : V) : a % b = a - b * (a / b) := rfl +lemma mod_def (a b : V) : a % b = a - b * (a / b) := by exact rfl /-- Imported declaration from the Incompleteness formalization. -/ def _root_.LO.FirstOrder.Arith.remDef : Sg0.Semisentence 3 := @@ -539,6 +539,7 @@ section «lp_section_5» -- https://github.com/leanprover-community/mathlib4/blob/ -- b075cdd0e6ad8b5a3295e7484b2ae59e9b2ec2a7/Mathlib/Data/Nat/Pairing.lean#L37 /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def pair (a b : V) : V := if a < b then b * b + a else a * a + a + b --notation "⟪" a ", " b "⟫" => pair a b 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..14b87724a8 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 @@ -21,10 +21,11 @@ namespace Arith end Arith /-- Imported declaration from the Incompleteness formalization. -/ -def Defined {k} (R : (Fin k → V) → Prop) [Structure L V] (φ : Semisentence L k) : Prop := +@[expose] def Defined {k} (R : (Fin k → V) → Prop) [Structure L V] (φ : Semisentence L k) : Prop := ∀ v, R v ↔ Semiformula.Evalbm V v φ /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def DefinedWithParam {k} (R : (Fin k → V) → Prop) [Structure L V] (φ : Semiformula L V k) : Prop := ∀ v, R v ↔ Semiformula.Evalm V v id φ @@ -48,12 +49,13 @@ open LO.Arith variable {V : Type*} [ORingStruc V] /-- Imported declaration from the Incompleteness formalization. -/ -def Defined (R : (Fin k → V) → Prop) : {ℌ : HierarchySymbol} → ℌ.Semisentence k → Prop +@[expose] def Defined (R : (Fin k → V) → Prop) : {ℌ : HierarchySymbol} → ℌ.Semisentence k → Prop | Sg-[_], φ => FirstOrder.Defined R φ.val | Pg-[_], φ => FirstOrder.Defined R φ.val | Dlt-[_], φ => φ.ProperOn V ∧ FirstOrder.Defined R φ.val /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def DefinedWithParam (R : (Fin k → V) → Prop) : {ℌ : HierarchySymbol} → ℌ.Semiformula V k → Prop | Sg-[_], φ => FirstOrder.DefinedWithParam R φ.val | Pg-[_], φ => FirstOrder.DefinedWithParam R φ.val 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..45491e2ae7 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 @@ -99,7 +99,7 @@ variable {ξ n} namespace Semiformula /-- Imported declaration from the Incompleteness formalization. -/ -def val {Γ : HierarchySymbol} : Γ.Semiformula ξ n → Semiformula ℒₒᵣ ξ n +@[expose] def val {Γ : HierarchySymbol} : Γ.Semiformula ξ n → Semiformula ℒₒᵣ ξ n | mkSigma φ _ => φ | mkPi φ _ => φ | mkDelta φ _ => φ.val @@ -135,7 +135,7 @@ lemma pi_prop : (φ : Pg-[m].Semiformula ξ n) → Hierarchy Pg m φ.val | Pg, φ => φ.pi_prop /-- Imported declaration from the Incompleteness formalization. -/ -def sigma : Dlt-[m].Semiformula ξ n → Sg-[m].Semiformula ξ n +@[expose] def sigma : Dlt-[m].Semiformula ξ n → Sg-[m].Semiformula ξ n | mkDelta φ _ => φ @[simp] lemma sigma_mkDelta (φ : Sg-[m].Semiformula ξ n) (ψ : Pg-[m].Semiformula ξ n) : @@ -143,7 +143,7 @@ def sigma : Dlt-[m].Semiformula ξ n → Sg-[m].Semiformula ξ n rfl /-- Imported declaration from the Incompleteness formalization. -/ -def pi : Dlt-[m].Semiformula ξ n → Pg-[m].Semiformula ξ n +@[expose] def pi : Dlt-[m].Semiformula ξ n → Pg-[m].Semiformula ξ n | mkDelta _ φ => φ @[simp] lemma pi_mkDelta (φ : Sg-[m].Semiformula ξ n) (ψ : Pg-[m].Semiformula ξ n) : @@ -176,11 +176,11 @@ variable {M : Type*} [ORingStruc M] variable (M) /-- Imported declaration from the Incompleteness formalization. -/ -def ProperOn (φ : Dlt-[m].Semisentence n) : Prop := +@[expose] def ProperOn (φ : Dlt-[m].Semisentence n) : Prop := ∀ (e : Fin n → M), Semiformula.Evalbm M e φ.sigma.val ↔ Semiformula.Evalbm M e φ.pi.val /-- Imported declaration from the Incompleteness formalization. -/ -def ProperWithParamOn (φ : Dlt-[m].Semiformula M n) : Prop := +@[expose] def ProperWithParamOn (φ : Dlt-[m].Semiformula M n) : Prop := ∀ (e : Fin n → M), Semiformula.Evalm M e id φ.sigma.val ↔ Semiformula.Evalm M e id φ.pi.val /-- Imported declaration from the Incompleteness formalization. -/ @@ -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) @@ -323,12 +323,14 @@ lemma sigmaZero {Γ} (φ : Γ-[0].Semiformula ξ k) : Hierarchy Sg 0 φ.val := | Dlt => by simp [] /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def ofZero {Γ'} (φ : Γ'-[0].Semiformula ξ k) : (Γ : HierarchySymbol) → Γ.Semiformula ξ k | Sg-[_] => mkSigma φ.val φ.sigmaZero.of_zero | Pg-[_] => mkPi φ.val φ.sigmaZero.of_zero | 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)) @@ -370,6 +372,7 @@ def and : {Γ : HierarchySymbol} → Γ.Semiformula ξ n → Γ.Semiformula ξ n mkDelta (mkSigma (φ.sigma.val ⋏ ψ.sigma.val) (by simp)) (mkPi (φ.pi.val ⋏ ψ.pi.val) (by simp)) /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def or : {Γ : HierarchySymbol} → Γ.Semiformula ξ n → Γ.Semiformula ξ n → Γ.Semiformula ξ n | Sg-[m], φ, ψ => mkSigma (φ.val ⋎ ψ.val) (by simp) | Pg-[m], φ, ψ => mkPi (φ.val ⋎ ψ.val) (by simp) @@ -405,12 +408,12 @@ def bex (t : Semiterm ℒₒᵣ ξ n) : {Γ : HierarchySymbol} → Γ.Semiformul !!(Rew.bShift t)”] φ.pi.val) (by simp)) /-- Imported declaration from the Incompleteness formalization. -/ -def all (φ : Pg-[m + 1].Semiformula ξ (n + 1)) : +@[expose] def all (φ : Pg-[m + 1].Semiformula ξ (n + 1)) : Pg-[m + 1].Semiformula ξ n := mkPi (∀' φ.val) φ.pi_prop.all /-- Imported declaration from the Incompleteness formalization. -/ -def ex (φ : Sg-[m + 1].Semiformula ξ (n + 1)) : +@[expose] def ex (φ : Sg-[m + 1].Semiformula ξ (n + 1)) : Sg-[m + 1].Semiformula ξ n := mkSigma (∃' φ.val) φ.sigma_prop.ex @@ -572,7 +575,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..c35d43ef59 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» @@ -31,6 +31,7 @@ variable {V : Type*} [ORingStruc V] variable [V ⊧ₘ* 𝐈Sg1] /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def Bit (i a : V) : Prop := LenBit (exp i) a instance instMembershipVV : Membership V V := ⟨fun a i ↦ Bit i a⟩ @@ -319,7 +320,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..8919e9583c 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» @@ -483,7 +483,7 @@ end «lp_section_9» section «lp_section_10» /-- Imported declaration from the Incompleteness formalization. -/ -def IsMapping (m : V) : Prop := ∀ x ∈ domain m, ∃! y, ⟪x, y⟫ ∈ m +@[expose] def IsMapping (m : V) : Prop := ∀ x ∈ domain m, ∃! y, ⟪x, y⟫ ∈ m section «lp_section_11» @@ -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..05c626d8f7 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» @@ -27,10 +27,10 @@ def finsetArithmetizeAux : List V → V | [] => ∅ | x :: xs => insert x (finsetArithmetizeAux xs) -@[simp] lemma finsetArithmetizeAux_nil : finsetArithmetizeAux ([] : List V) = ∅ := rfl +@[simp] lemma finsetArithmetizeAux_nil : finsetArithmetizeAux ([] : List V) = ∅ := by exact rfl @[simp] lemma finsetArithmetizeAux_cons (x : V) (xs) : - finsetArithmetizeAux (x :: xs) = insert x (finsetArithmetizeAux xs) := rfl + finsetArithmetizeAux (x :: xs) = insert x (finsetArithmetizeAux xs) := by exact rfl @[simp] lemma mem_finsetArithmetizeAux_iff {x : V} {s : List V} : x ∈ finsetArithmetizeAux s ↔ x ∈ s := by induction s <;> simp [*] diff --git a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/HFS/Fixpoint.lean b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/HFS/Fixpoint.lean index 2ac0a4e769..755d69ebf3 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» @@ -104,6 +104,7 @@ lemma succ_existsUnique (s ih : V) : ⟨s + 1, fun i ↦ by rintro ⟨hi, _⟩; exact lt_succ_iff_le.mpr hi⟩ /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def succ (s ih : V) : V := Classical.choose! (c.succ_existsUnique v s ih) variable {v} @@ -146,6 +147,7 @@ lemma eval_succDef (v) : c.succ_defined.df.iff v /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def prConstruction : PR.Construction V φ.prBlueprint where zero := fun _ ↦ ∅ succ := c.succ @@ -155,6 +157,7 @@ def prConstruction : PR.Construction V φ.prBlueprint where variable (v) /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def limSeq (s : V) : V := c.prConstruction.result v s variable {v} @@ -230,6 +233,7 @@ lemma mem_limSeq_self [c.StrongFinite] {u s : V} : variable (v) /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def fixedPoint (x : V) : Prop := ∃ s, x ∈ c.limSeq v s variable {v} diff --git a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/HFS/PRF.lean b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/HFS/PRF.lean index a359eb29cb..611cf6274f 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» @@ -71,6 +71,7 @@ namespace Construction variable {k : ℕ} {p : Blueprint k} (c : Construction V p) (v : Fin k → V) /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def CSeq (s : V) : Prop := Seq s ∧ ⟪0, c.zero v⟫ ∈ s ∧ ∀ i < lh s - 1, ∀ z, ⟪i, z⟫ ∈ s → ⟪i + 1, c.succ v i z⟫ ∈ s @@ -194,6 +195,7 @@ lemma cSeq_result_existsUnique (l : V) : ∃! z, ∃ s, c.CSeq v s ∧ l + 1 = l exact Eq.symm <| Hs.unique Hs' (by simp [←h, ←h']) (show l < lh s from by simp [←h]) hz hz') /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def result (u : V) : V := Classical.choose! (c.cSeq_result_existsUnique v u) lemma result_spec (u : V) : ∃ s, c.CSeq v s ∧ u + 1 = lh s ∧ ⟪u, c.result v u⟫ ∈ s := diff --git a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/HFS/Seq.lean b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/HFS/Seq.lean index d3332a3d10..246fc02e77 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» @@ -28,6 +28,7 @@ open FirstOrder FirstOrder.Arith variable {V : Type*} [ORingStruc V] [V ⊧ₘ* 𝐈Sg1] /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def Seq (s : V) : Prop := IsMapping s ∧ ∃ l, domain s = under l /-- Imported declaration from the Incompleteness formalization. -/ @@ -166,7 +167,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..7fe2ae476e 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» @@ -188,6 +188,7 @@ instance : construction.Finite V where · exact ⟨⟪sndIdx v, i, x⟫ + 1, Or.inr ⟨v, i, x, rfl, h, by simp⟩⟩ /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def Graph : V → Prop := construction.fixedPoint ![] section «lp_section_3» @@ -606,6 +607,7 @@ section «lp_section_8» open Len /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def len (v : V) : V := construction.result ![] v @[simp] lemma len_nil : len (0 : V) = 0 := by simp [len, construction] @@ -746,6 +748,7 @@ section «lp_section_10» open ListMax /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def listMax (v : V) : V := construction.result ![] v @[simp] lemma listMax_nil : listMax (0 : V) = 0 := by simp [listMax, construction] @@ -842,6 +845,7 @@ section «lp_section_12» open TakeLast /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def takeLast (v k : V) : V := construction.result ![k] v @[simp] lemma takeLast_nil : takeLast (0 : V) k = 0 := by simp [takeLast, construction] @@ -938,6 +942,7 @@ section «lp_section_14» open Concat /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def concat (v z : V) : V := construction.result ![z] v @[simp] lemma concat_nil (z : V) : concat 0 z = ?[z] := by simp [concat, construction] @@ -1117,6 +1122,7 @@ def _root_.LO.Arith.repeatVec.construction : PR.Construction V repeatVec.bluepri succ_defined := by intro v; simp [repeatVec.blueprint] /-- `repeatVec x k = x ∷ x ∷ x ∷ ... k times ... ∷ 0` -/ +@[expose] def repeatVec (x k : V) : V := repeatVec.construction.result ![x] k @[simp] lemma repeatVec_zero (x : V) : repeatVec x 0 = 0 := by @@ -1195,6 +1201,7 @@ section «lp_section_22» open VecToSet /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def vecToSet (v : V) : V := construction.result ![] v @[simp] lemma vecToSet_nil : vecToSet (0 : V) = ∅ := by simp [vecToSet, construction] diff --git a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/CodedTheory.lean b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/CodedTheory.lean index 6677c25248..6a66731490 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] : @@ -80,6 +80,7 @@ variable {T : Theory L} [T.Delta1Definable] variable (T V) /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def codeIn : (L.codeIn V).Theory where set := T.tDef.ch.val.curve @@ -103,7 +104,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 @@ -116,14 +117,14 @@ namespace Delta1Definable open Arith.HierarchySymbol.Semiformula LO.FirstOrder.Theory /-- Imported declaration from the Incompleteness formalization. -/ -@[reducible] +@[expose, reducible] def add (dT : T.Delta1Definable) (dU : U.Delta1Definable) : (T + U).Delta1Definable where ch := T.tDef.ch ⋎ U.tDef.ch mem_iff {φ} := by simp isDelta1 := ProvablyProperOn.ofProperOn.{0} _ fun V _ _ ↦ ProperOn.or (by simp) (by simp) /-- Imported declaration from the Incompleteness formalization. -/ -@[reducible] +@[expose, reducible] def ofEq (dT : T.Delta1Definable) (h : T = U) : U.Delta1Definable where ch := dT.ch mem_iff := by rcases h; exact dT.mem_iff @@ -154,7 +155,7 @@ instance empty : Theory.Delta1Definable (∅ : Theory L) where /-! memo: This noncomputable is *not* essetial. -/ /-- Imported declaration from the Incompleteness formalization. -/ -@[reducible] +@[expose, reducible] noncomputable def singleton (φ : SyntacticFormula L) : Theory.Delta1Definable {φ} where ch := .ofZero (.mkSigma “x. x = ↑⌜φ⌝” (by simp)) _ diff --git a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Coding.lean b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Coding.lean index 79756595b4..1719bafec6 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 @@ -120,6 +120,7 @@ variable {V : Type*} [ORingStruc V] [V ⊧ₘ* 𝐈Sg1] lemma nat_cast_empty : ((∅ : ℕ) : V) = ∅ := rfl /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def finArrowToVec : {k : ℕ} → (Fin k → V) → V | 0, _ => 0 | k + 1, v => v 0 ∷ finArrowToVec (k := k) (v ·.succ) @@ -672,6 +673,7 @@ variable {n : ℕ} namespace Semiterm /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def codeIn' (t : SyntacticSemiterm L n) : (L.codeIn V).Semiterm n := ⟨⌜t⌝, by simp⟩ instance : GoedelQuote (SyntacticSemiterm L n) ((L.codeIn V).Semiterm n) := ⟨Semiterm.codeIn' V⟩ @@ -680,6 +682,7 @@ instance : GoedelQuote (SyntacticSemiterm L n) ((L.codeIn V).Semiterm n) := ⟨S (L.codeIn V).Semiterm n).val = ⌜t⌝ := rfl /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def vCodeIn' {k n} (v : Fin k → SyntacticSemiterm L n) : (L.codeIn V).SemitermVec k n := ⟨⌜fun i ↦ ⌜v i⌝⌝, by simp⟩ @@ -713,6 +716,7 @@ end Semiterm namespace Semiformula /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def codeIn' (φ : SyntacticSemiformula L n) : (L.codeIn V).Semiformula n := ⟨⌜φ⌝, by simp⟩ instance goedelQuoteSyntacticSemiformulaToCodedSemiformula : diff --git a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Formula/Basic.lean b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Formula/Basic.lean index afbd63d396..7e73e14bce 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,29 @@ 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. -/ +@[expose] 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 @@ -1167,6 +1168,7 @@ lemma exists_unique_all (p : V) : by_cases hp : L.IsUFormula p <;> simp [hp, exists_unique] /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def result (p : V) : V := Classical.choose! (c.exists_unique_all param p) lemma result_prop {p : V} (hp : L.IsUFormula p) : c.Graph param p (c.result param p) := diff --git a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Formula/Functions.lean b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Formula/Functions.lean index 7d7fe02a9e..cd88fa0912 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» @@ -195,12 +195,14 @@ end «lp_section_1» variable (L) /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def _root_.LO.Arith.Language.imp (p q : V) : V := L.neg p ^⋎ q /-- Imported declaration from the Incompleteness formalization. -/ notation:60 p:61 " ^→[" L "] " q:60 => Language.imp L p q /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def _root_.LO.Arith.Language.iff (p q : V) : V := (L.imp p q) ^⋏ (L.imp q p) variable {L} @@ -526,6 +528,7 @@ open Substs variable (L) /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def _root_.LO.Arith.Language.substs (w p : V) : V := (construction L).result w p variable {L} @@ -883,6 +886,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 +921,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 +957,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..1a72e1e3aa 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 @@ -82,7 +82,10 @@ section «lp_section_2» /-- Imported declaration from the Incompleteness formalization. -/ def _root_.LO.FirstOrder.Arith.qqConjDef : Sg1.Semisentence 2 := blueprint.resultDef -lemma qqConj_defined : Sg1-Function₁ (qqConj : V → V) via qqConjDef := construction.result_defined +lemma qqConj_defined : Sg1-Function₁ (qqConj : V → V) via qqConjDef := by + intro v + have hparam : (fun i : Fin 0 => v i.succ.succ) = ![] := Subsingleton.elim _ _ + simpa only [qqConj, qqConjDef, hparam] using construction.result_defined v @[simp] lemma eval_qqConj (v) : Semiformula.Evalbm V v qqConjDef.val ↔ v 0 = qqConj (v 1) := qqConj_defined.df.iff v @@ -155,7 +158,10 @@ section «lp_section_4» /-- Imported declaration from the Incompleteness formalization. -/ def _root_.LO.FirstOrder.Arith.qqDisjDef : Sg1.Semisentence 2 := blueprint.resultDef -lemma qqDisj_defined : Sg1-Function₁ (qqDisj : V → V) via qqDisjDef := construction.result_defined +lemma qqDisj_defined : Sg1-Function₁ (qqDisj : V → V) via qqDisjDef := by + intro v + have hparam : (fun i : Fin 0 => v i.succ.succ) = ![] := Subsingleton.elim _ _ + simpa only [qqDisj, qqDisjDef, hparam] using construction.result_defined v @[simp] lemma eval_qqDisj (v) : Semiformula.Evalbm V v qqDisjDef.val ↔ v 0 = qqDisj (v 1) := qqDisj_defined.df.iff v diff --git a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Formula/Typed.lean b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Formula/Typed.lean index c1959324ef..3379983719 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,22 +70,26 @@ 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 /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def verums (k : V) : L.Semiformula n := ⟨qqVerums k, by simp⟩ @[simp] lemma _root_.LO.Arith.Language.Semiformula.val_cast (p : L.Semiformula n) (eq : n = n') : (p.cast eq).val = p.val := by rcases eq; simp [Language.Semiformula.cast] /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def _root_.LO.Arith.Language.Semiformula.all (p : L.Semiformula (n + 1)) : L.Semiformula n := ⟨^∀ p.val, by simp⟩ /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def _root_.LO.Arith.Language.Semiformula.ex (p : L.Semiformula (n + 1)) : L.Semiformula n := ⟨^∃ p.val, by simp⟩ @@ -147,10 +151,11 @@ lemma imp_def (p q : L.Semiformula n) : p ==> q = ∼p ⋎ q := by ext; simp [im @[simp] lemma neg_neg (p : L.Semiformula n) : ∼∼p = p := by ext; simp [Language.IsUFormula.neg_neg] /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] 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 @@ -227,12 +232,15 @@ namespace Language namespace SemiformulaVec /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def conj (ps : L.SemiformulaVec n) : L.Semiformula n := ⟨^⋀ ps.val, by simpa using ps.prop⟩ /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def disj (ps : L.SemiformulaVec n) : L.Semiformula n := ⟨^⋁ ps.val, by simpa using ps.prop⟩ /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def nth (ps : L.SemiformulaVec n) (i : V) (hi : i < len ps.val) : L.Semiformula n := ⟨ps.val.[i], ps.prop i hi⟩ @@ -283,21 +291,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 Language.Theory.TDerivation /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def _root_.LO.Arith.Language.Theory.TProof (T : Language.TTheory L) (p : L.Formula) := T ⊢¹ insert p ∅ @@ -191,8 +192,7 @@ variable {T U : L.TTheory} def _root_.LO.Arith.Language.Theory.Derivable.toTDerivation (Γ : L.Sequent) (h : T.thy.Derivable Γ.val) : T ⊢¹ Γ := by - choose a ha using h; choose d hd using ha.2 - exact ⟨a, ha.1, d, hd⟩ + exact ⟨Classical.choose h, Classical.choose_spec h⟩ lemma _root_.LO.Arith.Language.Theory.TDerivation.toDerivable {Γ : L.Sequent} (d : T ⊢¹ Γ) : T.thy.Derivable Γ.val := diff --git a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Term/Basic.lean b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Term/Basic.lean index 9336861da9..6b09f40b80 100644 --- a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Term/Basic.lean +++ b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Term/Basic.lean @@ -12,7 +12,7 @@ import Mathlib.Data.Nat.Cast.Order.Basic /-! # Basic -/ -@[expose] public section +public section noncomputable section «lp_nc_section_1» @@ -29,13 +29,13 @@ variable {L : Arith.Language V} {pL : LDef} [Arith.Language.Defined L pL] section «lp_section_1» /-- Imported declaration from the Incompleteness formalization. -/ -def qqBvar (z : V) : V := ⟪0, z⟫ + 1 +@[expose] def qqBvar (z : V) : V := ⟪0, z⟫ + 1 /-- Imported declaration from the Incompleteness formalization. -/ -def qqFvar (x : V) : V := ⟪1, x⟫ + 1 +@[expose] def qqFvar (x : V) : V := ⟪1, x⟫ + 1 /-- Imported declaration from the Incompleteness formalization. -/ -def qqFunc (k f v : V) : V := ⟪2, k, f, v⟫ + 1 +@[expose] def qqFunc (k f v : V) : V := ⟪2, k, f, v⟫ + 1 /-- Imported declaration from the Incompleteness formalization. -/ scoped prefix:max "^#" => qqBvar @@ -206,6 +206,7 @@ instance isUTermDef_definable' (Γ) : Γ-[m + 1]-Predicate L.IsUTerm := L.isUTerm_definable.of_deltaOne /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def _root_.LO.Arith.Language.IsUTermVec (n w : V) : Prop := n = len w ∧ ∀ i < n, L.IsUTerm w.[i] variable {L} @@ -890,6 +891,7 @@ variable (L) def _root_.LO.Arith.Language.IsSemiterm (n t : V) : Prop := L.IsUTerm t ∧ L.termBV t ≤ n /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def _root_.LO.Arith.Language.IsSemitermVec (k n v : V) : Prop := L.IsUTermVec k v ∧ ∀ i < k, L.termBV v.[i] ≤ n 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..6d23e83ece 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» @@ -65,13 +65,16 @@ lemma _root_.LO.Arith.Language.SemitermVec.ext {v w : L.SemitermVec k n} (h : v.val = w.val) : v = w := by rcases v; rcases w; simpa using h /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def _root_.LO.Arith.Language.bvar {n : V} (z : V) (hz : z < n := by simp) : L.Semiterm n := ⟨^#z, by simp [hz]⟩ /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] 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]⟩ @@ -95,6 +98,7 @@ scoped prefix:max "&'" => fv rfl /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def _root_.LO.Arith.Language.Semiterm.cons {m n} (t : L.Semiterm n) (v : L.SemitermVec m n) : L.SemitermVec (m + 1) n := ⟨t.val ∷ v.val, by simp⟩ @@ -107,6 +111,7 @@ scoped infixr:67 " ∷ᵗ " => Language.Semiterm.cons variable (L) /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def _root_.LO.Arith.Language.SemitermVec.nil (n) : L.SemitermVec 0 n := ⟨0, by simp⟩ variable {L} @@ -122,15 +127,16 @@ 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. -/ +@[expose] 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 @@ -149,15 +155,17 @@ namespace Language namespace SemitermVec /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def shift (v : L.SemitermVec k n) : L.SemitermVec k n := ⟨L.termShiftVec k v.val, Language.IsSemitermVec.termShiftVec v.prop⟩ /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] 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 @@ -314,12 +322,15 @@ end «lp_section_2» namespace Formalized /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def typedNumeral (n m : V) : ⌜ℒₒᵣ⌝.Semiterm n := ⟨numeral m, by simp⟩ /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def add {n : V} (t u : ⌜ℒₒᵣ⌝.Semiterm n) : ⌜ℒₒᵣ⌝.Semiterm n := ⟨t.val ^+ u.val, by simp [qqAdd]⟩ /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def mul {n : V} (t u : ⌜ℒₒᵣ⌝.Semiterm n) : ⌜ℒₒᵣ⌝.Semiterm n := ⟨t.val ^* u.val, by simp [qqMul]⟩ instance (n : V) : Add (⌜ℒₒᵣ⌝.Semiterm n) := ⟨add⟩ diff --git a/LeanPool/Incompleteness/Arithmetization/ISigmaZero/Exponential/Exp.lean b/LeanPool/Incompleteness/Arithmetization/ISigmaZero/Exponential/Exp.lean index 7323db08d5..bcf578d7aa 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» @@ -93,6 +93,7 @@ def _root_.LO.Arith.Exponential.Seqₘ (x y X Y : V) : ∃ u ≤ y ^ 2, u ≠ 2 ∧ PPow2 u ∧ ext u X = x ∧ ext u Y = y /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def Exponential (x y : V) : Prop := (x = 0 ∧ y = 1) ∨ ∃ X ≤ y^4, ∃ Y ≤ y^4, Exponential.Seq₀ X Y ∧ Exponential.Seqₛ y X Y ∧ diff --git a/LeanPool/Incompleteness/Arithmetization/ISigmaZero/Exponential/Log.lean b/LeanPool/Incompleteness/Arithmetization/ISigmaZero/Exponential/Log.lean index c9f9c66b5d..43d98a2508 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» @@ -178,7 +178,7 @@ def binaryLength (a : V) : V := if 0 < a then log a + 1 else 0 /-- Imported declaration from the Incompleteness formalization. -/ scoped instance : Length V := ⟨binaryLength⟩ -lemma length_eq_binaryLength (a : V) : ‖a‖ = if 0 < a then log a + 1 else 0 := rfl +lemma length_eq_binaryLength (a : V) : ‖a‖ = if 0 < a then log a + 1 else 0 := by exact rfl @[simp] lemma length_zero : ‖(0 : V)‖ = 0 := by simp [length_eq_binaryLength] 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..b101b096ce 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 @@ -24,13 +24,13 @@ variable {σ α β : Sort*} def Graphᵥ (f : (Fin k → α) → α) : (Fin (k + 1) → α) → Prop := fun v ↦ v 0 = f (v ·.succ) /-- Imported declaration from the Incompleteness formalization. -/ -def Graph (f : α → σ) : σ → α → Prop := fun y x ↦ y = f x +@[expose] def Graph (f : α → σ) : σ → α → Prop := fun y x ↦ y = f x /-- Imported declaration from the Incompleteness formalization. -/ -def Graph₂ (f : α → β → σ) : σ → α → β → Prop := fun y x₁ x₂ ↦ y = f x₁ x₂ +@[expose] def Graph₂ (f : α → β → σ) : σ → α → β → Prop := fun y x₁ x₂ ↦ y = f x₁ x₂ /-- Imported declaration from the Incompleteness formalization. -/ -def Graph₃ (f : α → β → γ → σ) : σ → α → β → γ → Prop := fun y x₁ x₂ x₃ ↦ y = f x₁ x₂ x₃ +@[expose] def Graph₃ (f : α → β → γ → σ) : σ → α → β → γ → Prop := fun y x₁ x₂ x₃ ↦ y = f x₁ x₂ x₃ /-- Imported declaration from the Incompleteness formalization. -/ def Graph₄ (f : α → β → γ → δ → σ) : 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..4f019b4186 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⟩ @@ -185,7 +185,7 @@ namespace Polarity variable {α : Type*} [SigmaSymbol α] [PiSymbol α] /-- Imported declaration from the Incompleteness formalization. -/ -protected def coe : Polarity → α +@[expose] protected def coe : Polarity → α | Sg => Sg | Pg => Pg diff --git a/LeanPool/Incompleteness/DC/Basic.lean b/LeanPool/Incompleteness/DC/Basic.lean index 34bc3663fa..01de0f19be 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 @@ -45,7 +45,7 @@ namespace ProvabilityPredicate variable {T₀ T : Theory L} /-- Imported declaration from the Incompleteness formalization. -/ -@[coe] def pr (𝔅 : ProvabilityPredicate T₀ T) (σ : Sentence L) : Sentence L := 𝔅.prov/[⌜σ⌝] +@[expose, coe] def pr (𝔅 : ProvabilityPredicate T₀ T) (σ : Sentence L) : Sentence L := 𝔅.prov/[⌜σ⌝] instance : CoeFun (ProvabilityPredicate T₀ T) (fun _ => Sentence L → Sentence L) := ⟨pr⟩ diff --git a/LeanPool/Incompleteness/Foundation/FirstOrder/Arith/Basic.lean b/LeanPool/Incompleteness/Foundation/FirstOrder/Arith/Basic.lean index f32deff5f6..f41c0a142e 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 @@ -50,7 +50,7 @@ namespace Language variable {L : Language} [L.ORing] /-- Imported declaration from the Incompleteness formalization. -/ -def oringEmb : ℒₒᵣ →ᵥ L where +@[expose] def oringEmb : ℒₒᵣ →ᵥ L where func := fun {k} f ↦ match k, f with | _, Zero.zero => Zero.zero @@ -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..8ab03fc142 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» @@ -136,7 +136,7 @@ $\omega + 1$ (the structure of order type $\omega + 1$) is a models of $\mathsf{ namespace Countermodel /-- Imported declaration from the Incompleteness formalization. -/ -def OmegaAddOne := Option ℕ +@[expose] def OmegaAddOne := Option ℕ namespace OmegaAddOne diff --git a/LeanPool/Incompleteness/Foundation/FirstOrder/Arith/Hierarchy.lean b/LeanPool/Incompleteness/Foundation/FirstOrder/Arith/Hierarchy.lean index 48734cd843..a329a720d1 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 @@ -48,7 +48,7 @@ inductive Hierarchy : Polarity → ℕ → {n : ℕ} → Semiformula L ξ n → Hierarchy Pg (s + 1 + 1) (∃' φ) /-- Imported declaration from the Incompleteness formalization. -/ -def DeltaZero (φ : Semiformula L ξ n) : Prop := Hierarchy Sg 0 φ +@[expose] def DeltaZero (φ : Semiformula L ξ n) : Prop := Hierarchy Sg 0 φ attribute [simp] Hierarchy.verum Hierarchy.falsum Hierarchy.rel Hierarchy.nrel 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..1eb6f37fbb 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 @@ -461,6 +461,7 @@ lemma _root_.LO.FirstOrder.Arith.models_code Matrix.comp_vecCons', ←Part.eq_some_iff] using models_codeAux hc y v /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] noncomputable def _root_.LO.FirstOrder.Arith.codeOfPartrec' {k} (f : List.Vector ℕ k →. ℕ) : Semisentence ℒₒᵣ (k + 1) := code <| Classical.epsilon (fun c ↦ ∀ y v, Semiformula.Evalbm ℕ (y :> v) (code c) ↔ @@ -477,6 +478,7 @@ lemma _root_.LO.FirstOrder.Arith.codeOfPartrec'_spec exact Classical.epsilon_spec this y v /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] noncomputable def _root_.LO.FirstOrder.Arith.codeOfRePred (p : ℕ → Prop) : Semisentence ℒₒᵣ 1 := let f : ℕ →. Unit := fun a ↦ Part.assert (p a) fun _ ↦ Part.some () (codeOfPartrec' (fun v ↦ (f (v.get 0)).map fun _ ↦ 0))/[‘0’, #0] 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..5504abac37 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 @@ -25,6 +25,7 @@ open Encodable namespace Semiterm /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def toNat {n : ℕ} : Semiterm L ξ n → ℕ | #z => Nat.pair 0 z + 1 | &x => Nat.pair 1 (encode x) + 1 @@ -80,6 +81,7 @@ namespace Semiformula variable [(k : ℕ) → Encodable (L.Rel k)] /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def toNat : {n : ℕ} → Semiformula L ξ n → ℕ | _, rel (arity := arity) R v => (Nat.pair 0 <| arity.pair <| (encode R).pair <| Matrix.vecToNat fun i ↦ encode (v i)) + 1 diff --git a/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Eq.lean b/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Eq.lean index 9270602601..ca1235f27d 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 @@ -179,7 +179,7 @@ variable (L M) def eqvSetoid : Setoid M := Setoid.mk (eqv L) eqv_equivalence /-- Imported declaration from the Incompleteness formalization. -/ -def QuotEq := Quotient (eqvSetoid L M) +@[expose] def QuotEq := Quotient (eqvSetoid L M) variable {L M} @@ -368,6 +368,7 @@ instance {T : Theory L} [𝐄𝐐 wkn T] (sat : Semantics.Satisfiable (Struc.{v, ModelOfSat sat ⊧ₘ* (𝐄𝐐 : Theory L) := models_of_subtheory (ModelOfSat.models sat) /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def ModelOfSatEq {T : Theory L} [𝐄𝐐 wkn T] (sat : Semantics.Satisfiable (Struc.{v, u} L) T) : Type _ := Structure.Eq.QuotEq L (ModelOfSat sat) diff --git a/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Model.lean b/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Model.lean index 2da612d7dd..20ec0e8a95 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 @@ -87,7 +87,7 @@ section «lp_section_2» variable (F : ℕ → Type*) {M : Type*} (fF : {k : ℕ} → (f : F k) → (Fin k → M) → M) /-- Imported declaration from the Incompleteness formalization. -/ -@[reducible] +@[expose, reducible] def ofFunc : Structure (Language.ofFunc F) M where func := fun _ f v => fF f v rel := fun _ r _ => r.elim diff --git a/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Operator.lean b/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Operator.lean index d74c04e80f..ceac0ef33f 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 @@ -44,6 +44,7 @@ def equiv : Operator L n ≃ Semiterm L Empty n where right_inv := by intro _; simp /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def operator {arity : ℕ} (o : Operator L arity) (v : Fin arity → Semiterm L ξ n) : Semiterm L ξ n := Rew.substs v (Rew.emb o.term) @@ -88,6 +89,7 @@ lemma positive_operator_iff {k} {o : Operator L k} {v : Fin k → Semiterm L ξ -- f.operator ![ ... f.operator ![f.operator ![z, t 0], t 1], ... ,t (n-1)] /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def foldr (f : Operator L 2) (z : Operator L k) : List (Operator L k) → Operator L k | [] => z | o :: os => f.comp ![foldr f z os, o] @@ -101,6 +103,7 @@ def foldr (f : Operator L 2) (z : Operator L k) : List (Operator L k) → Operat simp [foldr, operator_comp, Matrix.fun_eq_vec₂] /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def iterr (f : Operator L 2) (z : Const L) : (n : ℕ) → Operator L n | 0 => z | _ + 1 => f.foldr (bvar 0) (List.ofFn fun x => bvar x.succ) @@ -199,6 +202,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) @@ -243,6 +247,7 @@ end «lp_section_1» section «lp_section_2» /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def npow (L : Language) [Operator.One L] [Operator.Mul L] (n : ℕ) : Operator L 1 := Operator.Mul.mul.foldr (One.one.comp ![]) (List.replicate n (bvar 0)) @@ -280,7 +285,7 @@ abbrev goedelNumber' (a : α) : Semiterm L ξ n := const (goedelNumber a) instance : GoedelQuote α (Semiterm L ξ n) := ⟨goedelNumber'⟩ /-- Imported declaration from the Incompleteness formalization. -/ -@[reducible] +@[expose, reducible] def ofEncodable [Operator.Zero L] [Operator.One L] [Operator.Add L] {α : Type*} [Encodable α] : GoedelNumber L α := ⟨Operator.encode L⟩ @@ -318,7 +323,7 @@ end «lp_section_3» section «lp_section_4» /-- Imported declaration from the Incompleteness formalization. -/ -def _root_.LO.FirstOrder.Semiterm.Operator.val +@[expose] def _root_.LO.FirstOrder.Semiterm.Operator.val {M : Type w} [s : Structure L M] (o : Operator L k) (v : Fin k → M) : M := Semiterm.val s v Empty.elim o.term @@ -383,7 +388,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 +414,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 +519,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 +560,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..07d4f9e679 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 @@ -244,7 +244,7 @@ namespace Structure variable (L M₁ M₂) /-- Imported declaration from the Incompleteness formalization. -/ -def ElementaryEquiv : Prop := ∀ φ : SyntacticFormula L, M₁ ⊧ₘ φ ↔ M₂ ⊧ₘ φ +@[expose] def ElementaryEquiv : Prop := ∀ φ : SyntacticFormula L, M₁ ⊧ₘ φ ↔ M₂ ⊧ₘ φ /-- Imported declaration from the Incompleteness formalization. -/ notation:50 M₁ " ≡ₑ[" L "] " M₂ => ElementaryEquiv L M₁ M₂ diff --git a/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Semantics/Semantics.lean b/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Semantics/Semantics.lean index 54059bb180..3bb46f3757 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 ε) @@ -279,6 +279,7 @@ variable {M : Type w} {s : Structure L M} variable {n : ℕ} {e : Fin n → M} {e₂ : Fin n₂ → M} {ε : ξ → M} {ε₂ : μ₂ → M} /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def EvalAux (s : Structure L M) (ε : ξ → M) : ∀ {n}, (Fin n → M) → Semiformula L ξ n → Prop | _, _, ⊤ => True | _, _, ⊥ => False @@ -294,6 +295,7 @@ def EvalAux (s : Structure L M) (ε : ξ → M) : ∀ {n}, (Fin n → M) → Sem by induction φ using rec' <;> simp [*, EvalAux, or_iff_not_imp_left] /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def Eval (s : Structure L M) (e : Fin n → M) (ε : ξ → M) : Semiformula L ξ n →ˡᶜ Prop where toTr := EvalAux s ε e map_top' := rfl 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..14fc645663 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 @@ -82,6 +82,7 @@ inductive SearchTreeAux (T : Theory L) (Γ : Sequent L) : ℕ → Sequent L → | succ : SearchTreeAux T Γ s Δ₁ → ReduxNat T s Δ₂ Δ₁ → SearchTreeAux T Γ (s + 1) Δ₂ /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def SearchTree (T : Theory L) (Γ : Sequent L) := (s : ℕ) × (Δ : Sequent L) × SearchTreeAux T Γ s Δ namespace SearchTree diff --git a/LeanPool/Incompleteness/Foundation/FirstOrder/Completeness/SubLanguage.lean b/LeanPool/Incompleteness/Foundation/FirstOrder/Completeness/SubLanguage.lean index 9465151249..ccbb35ee22 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 @@ -22,6 +22,7 @@ variable {L : Language.{u}} {L₁ : Language.{u}} {L₂ : Language.{u}} namespace Language /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def subLanguage (L : Language) (pfunc : ∀ k, L.Func k → Prop) (prel : ∀ k, L.Rel k → Prop) : Language where Func := fun k => Subtype (pfunc k) @@ -34,7 +35,7 @@ variable (L) variable {pf : (k : ℕ) → L.Func k → Prop} {pr : (k : ℕ) → L.Rel k → Prop} /-- Imported declaration from the Incompleteness formalization. -/ -def ofSubLanguage : subLanguage L pf pr →ᵥ L where +@[expose] def ofSubLanguage : subLanguage L pf pr →ᵥ L where func := Subtype.val rel := Subtype.val 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..f9c5bd5012 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 ψ @@ -194,6 +194,7 @@ end Satisfies open Satisfies /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def ValidOnModel (M : Kripke.Model) (φ : Formula ℕ) := ∀ w : M.World, w ⊧ φ namespace ValidOnModel @@ -304,7 +305,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 +395,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..a9a14e4dfd 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,10 +366,10 @@ 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 +@[expose] def Undecidable (f : F) : Prop := 𝓢 ⊬ f ∧ 𝓢 ⊬ ∼f end «lp_section_3» diff --git a/LeanPool/Incompleteness/Foundation/Logic/HilbertStyle/Basic.lean b/LeanPool/Incompleteness/Foundation/Logic/HilbertStyle/Basic.lean index 534443dab7..ae46dc3207 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..40013d2ae1 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⟩ @@ -279,16 +279,17 @@ abbrev unit : Language := constLang PUnit end «lp_section_1» /-- Imported declaration from the Incompleteness formalization. -/ -def ofFunc (F : ℕ → Type v) : Language := ⟨F, fun _ => PEmpty⟩ +@[expose] 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..89456bc3e2 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 @@ -43,6 +43,7 @@ end «lp_section_1» section «lp_section_2» /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def ModalEquivalent {M₁ M₂ : Model} (w₁ : M₁.World) (w₂ : M₂.World) : Prop := ∀ {φ}, w₁ ⊧ φ ↔ w₂ ⊧ φ /-- Imported declaration from the Incompleteness formalization. -/ infix:50 " ↭ " => ModalEquivalent @@ -95,6 +96,7 @@ def id : F →ₚ F where back := by simp; /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def TransitiveClosure (f : F₁ →ₚ F₂) (F₂_trans : IsTrans F₂.World F₂.Rel) : F₁^+ →ₚ F₂ where toFun := f.toFun forth := by @@ -149,7 +151,7 @@ def id : M →ₚ M where atomic := by simp; /-- Imported declaration from the Incompleteness formalization. -/ -def ofAtomic (f : M₁.toFrame →ₚ M₂.toFrame) (atomic : ∀ {w a}, (M₁ w a) ↔ (M₂ (f w) a)) : +@[expose] def ofAtomic (f : M₁.toFrame →ₚ M₂.toFrame) (atomic : ∀ {w a}, (M₁ w a) ↔ (M₂ (f w) a)) : M₁ →ₚ M₂ where toFun := f forth := f.forth @@ -214,6 +216,7 @@ end «lp_section_3» /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def _root_.LO.Modal.Kripke.Frame.isRooted (F : Frame) (r : F.World) : Prop := ∀ w ≠ r, r ≺ w /-- Imported declaration from the Incompleteness formalization. -/ @@ -228,7 +231,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 +283,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..08309dfa5c 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 @@ -65,6 +65,7 @@ add_decl_doc FiniteTransitiveTreeModel.toModel variable {F : Frame} {r : F.World} /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def _root_.LO.Modal.Kripke.Frame.TreeUnravelling (F : Frame) (r : F.World) : Kripke.Frame where World := { c : List F.World | [r] <+: c ∧ c.IsChain F.Rel } Rel cx cy := ∃ z, cx.1 ++ [z] = cy.1 @@ -248,6 +249,7 @@ end Model /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def _root_.LO.Modal.Kripke.Model.TransitiveTreeUnravelling (M : Kripke.Model) (r : M.World) : Kripke.Model where toFrame := M.toFrame.TransitiveTreeUnravelling r 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..36ed79c292 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) +@[expose] 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..492d9dde7b 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» @@ -26,10 +26,10 @@ variable {α : Sort u} (r : α → α → Prop) local infix:50 " ≺ " => r /-- Imported declaration from the Incompleteness formalization. -/ -def IsInfiniteDescendingChain (c : ℕ → α) : Prop := ∀ i, c (i + 1) ≺ c i +@[expose] 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..d52ae21a13 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 @@ -28,6 +28,7 @@ variable [Semiterm.Operator.GoedelNumber L (Sentence L)] namespace ProvabilityLogic /-- Mapping modal prop vars to first-order sentence -/ +@[expose] def Realization (L) := ℕ → FirstOrder.Sentence L /-- Mapping modal formulae to first-order sentence -/ 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..107633f29b 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 @@ -84,7 +84,7 @@ Ehrenfeucht–Mostowski / Skolem-hull construction over `J`. `Conditional/MorleyHanfSchemaDischarge.lean`) via the schema-completion construction — in fact without consuming the sequence's tail indiscernibility. Kept as a named `Prop` because the bridge theorems below are stated against it. -/ -def MorleySeedTailTemplateRealizable : Prop := +@[expose] def MorleySeedTailTemplateRealizable : Prop := ∀ (φ : L'.Sentenceω) (M : Type) [L'.Structure M] (a : ℕ → M) (J : Type) [LinearOrder J], Cardinal.mk M ≥ Cardinal.beth (Ordinal.omega 1) → Sentenceω.Realize φ M → @@ -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..a85b6d0162 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 @@ -52,7 +52,7 @@ noncomputable def queryEmbedding : RelQuery L ↪ ℕ := open Classical in /-- **The query code** of a structure code: the bit at coordinate `n` is the code's value at the query encoded by `n`, and `false` when `n` encodes no query. -/ -noncomputable def queryCode (c : StructureSpace L) (n : ℕ) : Bool := +@[expose] noncomputable def queryCode (c : StructureSpace L) (n : ℕ) : Bool := if h : ∃ q, queryEmbedding (L := L) q = n then c h.choose else false /-- The continuous retraction: read the structure code back off the embedded coordinates. -/ 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..adfe5b21af 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 @@ -43,7 +43,7 @@ variable {L : Language.{0, 0}} [L.IsRelational] /-! ## The class -/ /-- **The coded well-order class**: codes whose distinguished relation well-orders `ℕ`. -/ -def wellOrderClass (lt : L.Relations 2) : Set (StructureSpace L) := +@[expose] def wellOrderClass (lt : L.Relations 2) : Set (StructureSpace L) := {c | IsWellOrder ℕ fun x y : ℕ => @Structure.RelMap L ℕ c.toStructure 2 lt ![x, y]} /-- An `L`-isomorphism of decoded structures is an order isomorphism of the distinguished 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..db87e8c74e 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κ @@ -69,6 +69,7 @@ open FirstOrder Structure BoundedFormulaInf /-- `L∞ω`-equivalence at a fixed branching carrier `ι`: the structures satisfy the same sentences whose infinitary connectives branch over `ι`. The structures need not share a universe. -/ +@[expose] def InfEquivAt (L : Language.{u, v}) (ι : Type uι) (M : Type w) (N : Type w') [L.Structure M] [L.Structure N] : Prop := ∀ φ : L.SentenceInf ι, SentenceInf.Realize φ M ↔ SentenceInf.Realize φ N @@ -76,6 +77,7 @@ def InfEquivAt (L : Language.{u, v}) (ι : Type uι) (M : Type w) (N : Type w') /-- `L∞ω`-equivalence with branching carriers drawn from the structures' own universe. The quantifier over index types is here, outside the syntax, rather than inside every infinitary node. -/ +@[expose] def InfEquivW (L : Language.{u, v}) (M N : Type w) [L.Structure M] [L.Structure N] : Prop := ∀ ι : Type w, InfEquivAt L ι M N 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..7e4d512344 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 @@ -39,7 +39,7 @@ variable {L : Language.{0, 0}} {α β : Type} /-- **Signed quantifier occurrence.** `hasQuantSigned true φ` says a quantifier occurs *universally* in `φ`; `hasQuantSigned false φ` says one occurs *existentially* (a negatively occurring `all`). -/ -def hasQuantSigned : ∀ {n : ℕ}, Bool → L.BoundedFormulaω α n → Prop +@[expose] def hasQuantSigned : ∀ {n : ℕ}, Bool → L.BoundedFormulaω α n → Prop | _, _, .falsum => False | _, _, .equal _ _ => False | _, _, .rel _ _ => False @@ -169,6 +169,7 @@ open BoundedFormulaω variable {L : Language.{0, 0}} /-- A quantifier of sign `s` occurs somewhere in the set — the *source* of a separator budget. -/ +@[expose] def HasQuantSigned (s : Bool) (T : Set L.Sentenceω) : Prop := ∃ σ ∈ T, hasQuantSigned s σ /-- An existential quantifier occurs somewhere in `T`. -/ 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..3459f65b2c 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 @@ -80,7 +80,7 @@ theorem exists_strictMono_of_le (n N : ℕ) : /-- The **eventually-form template** of a sequence: a formula is true if all sufficiently deep strictly monotone tuples realize it. For a tail-indiscernible sequence this is well-defined in the sense of `tailTemplateOfSeq_truth_iff`. -/ -def tailTemplateOfSeq (a : ℕ → M) : Lomega1omegaTemplate L where +@[expose] def tailTemplateOfSeq (a : ℕ → M) : Lomega1omegaTemplate L where truth {n} φ := letI := ‹L.Structure M› ∃ N : ℕ, ∀ s : Fin n → ℕ, StrictMono s → (∀ k, N ≤ s k) → 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..e7927b6692 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 @@ -139,7 +139,7 @@ theorem symbSublang_rel_countable (F : Set (Σ n, L.Functions n)) rfl /-- Restrict a term whose function symbols lie in `F` to the two-sorted sublanguage. -/ -def Term.restrictSymbols {α : Type} {F : Set (Σ n, L.Functions n)} +@[expose] def Term.restrictSymbols {α : Type} {F : Set (Σ n, L.Functions n)} (R : Set (Σ n, L.Relations n)) : (t : L.Term α) → t.functionsIn ⊆ F → (symbSublang (L := L) F R).Term α | .var x, _ => .var x @@ -163,7 +163,7 @@ private theorem Term.onTerm_restrictSymbols {α : Type} {F : Set (Σ n, L.Functi /-- Restrict a formula whose function AND relation symbols lie in `F`/`R` to the two-sorted generated sublanguage. -/ -def BoundedFormulaω.restrictSymbols {α : Type} {F : Set (Σ n, L.Functions n)} +@[expose] def BoundedFormulaω.restrictSymbols {α : Type} {F : Set (Σ n, L.Functions n)} {R : Set (Σ n, L.Relations n)} : ∀ {n : ℕ} (φ : L.BoundedFormulaω α n), φ.functionsIn ⊆ F → φ.relationsIn ⊆ R → (symbSublang (L := L) F R).BoundedFormulaω α n 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..72fb2defaa 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 @@ -80,10 +80,10 @@ def qSetoid (hsc : HenkinComplete U S) : Setoid (L[[ℕ]].Term Empty) := ⟨qRel (S := S), by exact qRel_equiv hsc⟩ /-- The quotient term model. -/ -def QModel (hsc : HenkinComplete U S) := Quotient (qSetoid hsc) +@[expose] def QModel (hsc : HenkinComplete U S) := Quotient (qSetoid hsc) /-- The class of a closed term. -/ -def qmk (hsc : HenkinComplete U S) (t : L[[ℕ]].Term Empty) : QModel hsc := +@[expose] def qmk (hsc : HenkinComplete U S) (t : L[[ℕ]].Term Empty) : QModel hsc := Quotient.mk (qSetoid hsc) t private theorem qmk_eq_iff (hsc : HenkinComplete U S) (t u : L[[ℕ]].Term Empty) : 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..e6d38fcf1e 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 @@ -45,7 +45,7 @@ variable {L : Language.{0, 0}} {α : Type} /-- Erase a graph-language term to an `L`-term: the graph language has no function symbols, so this is variable-preserving with the function case impossible. -/ -def ungraphTerm {β : Type*} : (graphLanguage L).Term β → L.Term β +@[expose] def ungraphTerm {β : Type*} : (graphLanguage L).Term β → L.Term β | .var z => .var z | .func f _ => isEmptyElim f @@ -68,7 +68,7 @@ def ungraphTerm {β : Type*} : (graphLanguage L).Term β → L.Term β /-- Back-translate a graph-language formula to `L`: native equality stays equality (after term erasure), a base atom recovers the original relation, a graph atom `G_f(xs, y)` becomes `f(xs) = y`, and all connectives and quantifiers are structural. -/ -def backTranslateFormula : ∀ {n : ℕ}, (graphLanguage L).BoundedFormulaω α n → +@[expose] def backTranslateFormula : ∀ {n : ℕ}, (graphLanguage L).BoundedFormulaω α n → L.BoundedFormulaω α n | _, .falsum => .falsum | _, .equal t u => .equal (ungraphTerm t) (ungraphTerm u) 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..9572ebbd6a 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 : ℕ} @@ -123,6 +123,7 @@ variable {F₁ F₂ : Set (Σ n, L.Functions n)} {R₁ R₂ : Set (Σ n, L.Relat /-- **A budgeted separator of the labelled pair `(Γ, Δ)`.** Five conditions: the two entailments, the shared vocabulary, the **shared constants**, and the two quantifier permissions. -/ +@[expose] def BudgetedPairSeparates (F₁ : Set (Σ n, L.Functions n)) (R₁ : Set (Σ n, L.Relations n)) (F₂ : Set (Σ n, L.Functions n)) (R₂ : Set (Σ n, L.Relations n)) (Γ Δ : Set L[[ℕ]].Sentenceω) (θ : L[[ℕ]].Sentenceω) : Prop := @@ -134,7 +135,7 @@ def BudgetedPairSeparates (F₁ : Set (Σ n, L.Functions n)) (R₁ : Set (Σ n, (hasQuantSigned false θ → Theoryω.HasQuantSigned true Δ) /-- **The invariant**: the labelled pair admits no budgeted separator. -/ -def BudgetedPairInsep (F₁ : Set (Σ n, L.Functions n)) (R₁ : Set (Σ n, L.Relations n)) +@[expose] def BudgetedPairInsep (F₁ : Set (Σ n, L.Functions n)) (R₁ : Set (Σ n, L.Relations n)) (F₂ : Set (Σ n, L.Functions n)) (R₂ : Set (Σ n, L.Relations n)) (Γ Δ : Set L[[ℕ]].Sentenceω) : Prop := ¬ ∃ θ, BudgetedPairSeparates F₁ R₁ F₂ R₂ Γ Δ θ @@ -587,7 +588,7 @@ transfer gates below license. -/ /-- Membership in the labelled family: some finite, `GenU`-bounded, side-typed decomposition of `S` whose labelled pair is budget-inseparable. -/ -def BudgetedPairMem (r₁ r₂ : L[[ℕ]].Sentenceω) +@[expose] def BudgetedPairMem (r₁ r₂ : L[[ℕ]].Sentenceω) (F₁ : Set (Σ n, L.Functions n)) (R₁ : Set (Σ n, L.Relations n)) (F₂ : Set (Σ n, L.Functions n)) (R₂ : Set (Σ n, L.Relations n)) (S : Set L[[ℕ]].Sentenceω) : Prop := @@ -2558,7 +2559,7 @@ supports — if a field ever needs more than an application, the corresponding h /-- **The budgeted labelled-pair consistency property.** The finite labelled family over the generated universe `GenU r₁ r₂`. Root-support finiteness is consumed only by `neg_all_witness`. -/ -def budgetedPairConsistencyProperty +@[expose] def budgetedPairConsistencyProperty (F₁ : Set (Σ n, L.Functions n)) (R₁ : Set (Σ n, L.Relations n)) (F₂ : Set (Σ n, L.Functions n)) (R₂ : Set (Σ n, L.Relations n)) (r₁ r₂ : L[[ℕ]].Sentenceω) 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..ccc9928dae 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 @@ -73,14 +73,14 @@ variable {L : Language.{0, 0}} /-- Realization of a graph-language relation symbol in the graph expansion of an `L`-structure: base relations unchanged, and `G_f(xs, y)` reads `f(xs) = y` (the first `n` coordinates feed `f`, the last is its value). -/ -def graphRelMap (M : Type) [L.Structure M] : +@[expose] def graphRelMap (M : Type) [L.Structure M] : ∀ {n : ℕ}, GraphRelation L n → (Fin n → M) → Prop | _, .base r, v => Structure.RelMap r v | _, .graph f, v => Structure.funMap f (Fin.init v) = v (Fin.last _) /-- 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..26cce5a2bb 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 @@ -65,7 +65,8 @@ private theorem graphValue_unique (hAx : Sentenceω.Realize (graphAxioms F) M) { xs y (graphValue hAx f xs) hy (graphValue_spec hAx f h xs) /-- **The reconstructed `L`-structure**: functions from `graphValue`, base relations copied. -/ -@[reducible] noncomputable def reconstructStructure (F : Set (Σ n, L.Functions n)) [Countable ↥F] +@[expose, reducible] noncomputable def reconstructStructure + (F : Set (Σ n, L.Functions n)) [Countable ↥F] (hAx : Sentenceω.Realize (graphAxioms F) M) : L.Structure M where funMap f xs := graphValue hAx f xs RelMap R xs := RelMap (L := graphLanguage L) (GraphRelation.base R) xs 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..a0e9851573 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 @@ -57,7 +57,7 @@ variable {L : Language.{0, 0}} /-! ## The polarity side bound -/ /-- **Side vocabulary bound, polarity-refined.** -/ -def SentBndPol (F : Set (Σ n, L.Functions n)) (P N : Set (Σ n, L.Relations n)) : +@[expose] def SentBndPol (F : Set (Σ n, L.Functions n)) (P N : Set (Σ n, L.Relations n)) : Set L[[ℕ]].Sentenceω := {σ | σ.baseFunctionsIn ⊆ F ∧ σ.basePositiveRelations ⊆ P ∧ σ.baseNegativeRelations ⊆ N} 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..a843e7683c 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 @@ -104,7 +104,7 @@ theorem lyndonInsepAt_insert_right_of_shared_constEq_entails {φ : L[[ℕ]].Sent /-- **A polarity-refined paired family member**: a symmetrically support-budgeted, `GenU`-bounded, side-typed pair `(Γ, Δ)`, inseparable at the **flipped** intersection class `(F₁ ∩ F₂, P₁ ∩ N₂, N₁ ∩ P₂)`. -/ -def LyndonPairedMem (F₁ : Set (Σ n, L.Functions n)) (P₁ N₁ : Set (Σ n, L.Relations n)) +@[expose] def LyndonPairedMem (F₁ : Set (Σ n, L.Functions n)) (P₁ N₁ : Set (Σ n, L.Relations n)) (F₂ : Set (Σ n, L.Functions n)) (P₂ N₂ : Set (Σ n, L.Relations n)) (rL rR : L[[ℕ]].Sentenceω) (S : Set L[[ℕ]].Sentenceω) : Prop := ∃ (Γ Δ : Set L[[ℕ]].Sentenceω) (A : Finset ℕ), 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..e1c0b3647f 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 @@ -45,7 +45,7 @@ variable {L : Language.{0, 0}} /-! ## The side vocabulary predicate `SentBnd` -/ /-- **Side vocabulary bound.** A sentence whose base function/relation symbols lie in `(F, R)`. -/ -def SentBnd (F : Set (Σ n, L.Functions n)) (R : Set (Σ n, L.Relations n)) : +@[expose] def SentBnd (F : Set (Σ n, L.Functions n)) (R : Set (Σ n, L.Relations n)) : Set L[[ℕ]].Sentenceω := {σ | σ.baseFunctionsIn ⊆ F ∧ σ.baseRelationsIn ⊆ R} 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..bf5fe67060 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 @@ -54,13 +54,14 @@ def ctxLiftEmb (k : ℕ) (z : α ⊕ Fin n) : (graphLanguage L).Term (α ⊕ Fin /-- The equality atom, relationalized with **one** witness: `∃ y, termGraph(t,y) ∧ termGraph(u,y)`. -/ -def equalGraph (t u : L.Term (α ⊕ Fin n)) : (graphLanguage L).BoundedFormulaω α n := +@[expose] def equalGraph (t u : L.Term (α ⊕ Fin n)) : + (graphLanguage L).BoundedFormulaω α n := .existsBlock (k := 1) ((termGraphAux t (ctxLiftEmb 1) (graphWitnessVar n 0)).and (termGraphAux u (ctxLiftEmb 1) (graphWitnessVar n 0))) /-- The relation atom, relationalized: `∃ ys, (⋀ᵢ termGraph(tᵢ, yᵢ)) ∧ R^base(ys)`. -/ -def relGraph {k : ℕ} (R : L.Relations k) (ts : Fin k → L.Term (α ⊕ Fin n)) : +@[expose] def relGraph {k : ℕ} (R : L.Relations k) (ts : Fin k → L.Term (α ⊕ Fin n)) : (graphLanguage L).BoundedFormulaω α n := .existsBlock ((BoundedFormulaω.einf fun i => termGraphAux (ts i) (ctxLiftEmb k) (graphWitnessVar n i)).and @@ -70,7 +71,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..fb627f2976 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 @@ -74,7 +74,7 @@ the `L`-term `t` — its variables read through the embedding `ρ` into the curr the value of `y`. A variable is an equality atom; an application `f(t₀, …, t_{k-1})` extends the context by `k` witness variables, pins each argument's value with a recursive graph formula, adds the graph atom `G_f(ys, y)`, and existentially closes the witness block. -/ -def termGraphAux : ∀ {m : ℕ}, L.Term β → (β → (graphLanguage L).Term (α ⊕ Fin m)) → +@[expose] def termGraphAux : ∀ {m : ℕ}, L.Term β → (β → (graphLanguage L).Term (α ⊕ Fin m)) → (graphLanguage L).Term (α ⊕ Fin m) → (graphLanguage L).BoundedFormulaω α m | _, .var z, ρ, y => .equal (ρ z) y | m, .func f ts, ρ, y => 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..df6bca9ec4 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 @@ -88,7 +88,7 @@ private theorem Llocal_relations_countable (k m : ℕ) : Countable ((Llocal s₀ each arity are the sequential colimits of the staged symbol types along `LlocalHom`. Every `L_Γ`-symbol lives at a finite stage; in particular every family formula's existential acquires its local Skolem function at the next stage, so `L_Γ` is Skolem-complete *for the family*. -/ -def localColim : Language.{0, 0} where +@[expose] def localColim : Language.{0, 0} where Functions m := DirectedColim (fun k => (Llocal s₀ k).Functions m) (fun k x => (LlocalHom s₀ k).onFunction x) @@ -98,7 +98,7 @@ def localColim : Language.{0, 0} where /-- The cocone: the inclusion of stage `k` into the local colimit language `L_Γ`. On symbols it is the colimit inclusion `DirectedColim.incl k`. -/ -def LlocalInclusion (k : ℕ) : Llocal s₀ k →ᴸ localColim s₀ where +@[expose] def LlocalInclusion (k : ℕ) : Llocal s₀ k →ᴸ localColim s₀ where onFunction {m} f := DirectedColim.incl (F := fun j => (Llocal s₀ j).Functions m) (φ := fun j x => (LlocalHom s₀ j).onFunction x) k f @@ -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 => @@ -192,7 +192,8 @@ private theorem localStageStructure_relMap_succ {k m : ℕ} /-- The **colimit structure**: an `L_Γ`-symbol is interpreted through any stage representative, well-defined by the (definitional) stage coherence above. -/ -@[implicit_reducible] noncomputable def localColimStructure : (localColim s₀).Structure M where +@[expose, implicit_reducible] noncomputable def localColimStructure : + (localColim s₀).Structure M where funMap {m} f x := Quot.lift (fun p => @Structure.funMap (Llocal s₀ p.1) M (localStageStructure s₀ p.1) m p.2 x) @@ -232,14 +233,14 @@ 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)⟩ /-- The **colimit family** `Γ_Γ ⊆ L_Γ`-formulas: the union over all stages of the colimit images of the staged families `Γlocal s₀ k`. This is the family over which the re-based EM term model's truth lemma will run. -/ -def ΓlocalColim : Set (Σ n, (localColim s₀).BoundedFormulaω Empty n) := +@[expose] def ΓlocalColim : Set (Σ n, (localColim s₀).BoundedFormulaω Empty n) := ⋃ k, toLocalColimFormula s₀ k '' Γlocal s₀ k /-- Stage membership transports into the colimit family. -/ diff --git a/LeanPool/InfinitaryLogic/Methods/LocalEMCardinality.lean b/LeanPool/InfinitaryLogic/Methods/LocalEMCardinality.lean index 6e3213eaee..daff640794 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 @@ -39,6 +39,7 @@ variable (Λ : Language.{0, 0}) (J : Type) [LinearOrder J] /-- The located term code: compression arity, the support's increasing enumeration, and the compressed term. Unlike the orbit code, it remembers WHERE the support sits in `J`. -/ +@[expose] def LocatedTermCode : Type := Σ k : ℕ, (Fin k ↪o J) × Λ[[Fin k]].Term Empty diff --git a/LeanPool/InfinitaryLogic/Methods/LocalEMCompression.lean b/LeanPool/InfinitaryLogic/Methods/LocalEMCompression.lean index 1e9e4a3aa7..277dd53a5e 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 @@ -114,6 +114,7 @@ theorem locJRename_expand (e : J ≃o J) {k : ℕ} (s t : Fin k ↪o J) /-- The code of an `n`-tuple: a compression arity `k` together with `n` closed terms over the compressed skeleton `Fin k`. -/ +@[expose] def LocalEMTupleCode (Λ : Language.{0, 0}) (n : ℕ) : Type := Σ k : ℕ, Fin n → Λ[[Fin k]].Term Empty diff --git a/LeanPool/InfinitaryLogic/Methods/LocalEMContext.lean b/LeanPool/InfinitaryLogic/Methods/LocalEMContext.lean index eb848af252..0e594ee08e 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 @@ -89,7 +89,7 @@ variable {M : Type} [Λ.Structure M] (a : ℕ → M) interpret each `J`-constant `c_j` by the source sequence at position `d + deepRank S j` (so support constants map to a strictly-increasing deep tuple of `a`), and evaluate in `M`'s ambient `Λ`-structure. -/ -noncomputable def locDeepInterp (d : ℕ) (S : Finset J) (t : Λ[[J]].Term Empty) : M := +@[expose] noncomputable def locDeepInterp (d : ℕ) (S : Finset J) (t : Λ[[J]].Term Empty) : M := letI : (constantsOn J).Structure M := constantsOn.structure (fun j => a (d + deepRank J S j)) t.realize Empty.elim @@ -100,7 +100,7 @@ theorem locDeepInterp_func (d : ℕ) (S : Finset J) {n : ℕ} locDeepInterp Λ J a d S (.func f ts) = letI : (constantsOn J).Structure M := constantsOn.structure (fun j => a (d + deepRank J S j)) Structure.funMap f (fun i => locDeepInterp Λ J a d S (ts i)) := - rfl + by exact rfl /-- **De-substitution bridge**: the deep interpretation of a closed term equals the *de-substituted* `Λ`-term `constantsToVars t` (each skeleton constant `c_j` turned into the @@ -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 @@ -507,18 +507,18 @@ theorem LocalEMContext.func_congr (ctx : LocalEMContext Λ J (M := M)) {n : ℕ} /-- `LocalEMEq` is an equivalence relation on closed terms (refl/symm need no context; trans is `LocalEMContext.trans`). -/ -def LocalEMContext.setoid (ctx : LocalEMContext Λ J (M := M)) : +@[expose] def LocalEMContext.setoid (ctx : LocalEMContext Λ J (M := M)) : Setoid (Λ[[J]].Term Empty) where r := LocalEMEq Λ J ctx.a iseqv := ⟨fun t => LocalEMEq.refl Λ J ctx.a t, fun h => LocalEMEq.symm Λ J ctx.a h, fun h1 h2 => LocalEMContext.trans (Λ := Λ) (J := J) ctx h1 h2⟩ /-- The **local EM term-model carrier** for a context: closed `Λ[[J]]`-terms modulo `LocalEMEq`. -/ -def LocalEMContext.Carrier (ctx : LocalEMContext Λ J (M := M)) : Type := +@[expose] def LocalEMContext.Carrier (ctx : LocalEMContext Λ J (M := M)) : Type := Quotient ctx.setoid /-- A closed term as an element of the carrier. -/ -def LocalEMContext.mkClass (ctx : LocalEMContext Λ J (M := M)) (t : Λ[[J]].Term Empty) : +@[expose] def LocalEMContext.mkClass (ctx : LocalEMContext Λ J (M := M)) (t : Λ[[J]].Term Empty) : ctx.Carrier := Quotient.mk ctx.setoid t @@ -535,7 +535,8 @@ it holds in `M` on the deep interpretations for all sufficiently deep `d` (read over a common support of the arguments). Well-definedness is proved separately via the enlargement-invariance congruence engine. -/ -@[reducible] noncomputable def LocalEMContext.structure (ctx : LocalEMContext Λ J (M := M)) : +@[expose, reducible] +noncomputable def LocalEMContext.structure (ctx : LocalEMContext Λ J (M := M)) : Λ[[J]].Structure ctx.Carrier where funMap {_} f xs := Quotient.mk ctx.setoid (Term.func f fun i => Quotient.out (xs i)) RelMap {n} R xs := @@ -637,7 +638,8 @@ theorem LocalEMContext.relMap_mkClass_iff (ctx : LocalEMContext Λ J (M := M)) { /-- The **base `Λ`-structure** on the carrier: the reduct of the term-model `[[J]]`-structure along the skeleton-constant inclusion (a base function/relation symbol acts as its `Sum.inl` image). -/ -@[reducible] noncomputable def LocalEMContext.structureBase (ctx : LocalEMContext Λ J (M := M)) : +@[expose, reducible] +noncomputable def LocalEMContext.structureBase (ctx : LocalEMContext Λ J (M := M)) : Λ.Structure ctx.Carrier where funMap {n} f xs := @Structure.funMap (Λ[[J]]) ctx.Carrier ctx.structure n (Sum.inl f) xs RelMap {n} R xs := @Structure.RelMap (Λ[[J]]) ctx.Carrier ctx.structure n (Sum.inl R) xs diff --git a/LeanPool/InfinitaryLogic/Methods/LocalEMEquivariance.lean b/LeanPool/InfinitaryLogic/Methods/LocalEMEquivariance.lean index 48ba447d01..e62a3e496e 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 @@ -46,7 +46,7 @@ namespace Language variable (Λ : Language.{0, 0}) (J : Type) [LinearOrder J] /-- The skeleton-constant renaming action of an order automorphism on closed `Λ[[J]]`-terms. -/ -def locJRename (e : J ≃o J) {α : Type} (t : Λ[[J]].Term α) : Λ[[J]].Term α := +@[expose] def locJRename (e : J ≃o J) {α : Type} (t : Λ[[J]].Term α) : Λ[[J]].Term α := (Λ.lhomWithConstantsMap (e : J → J)).onTerm t /-- Renaming carries each function symbol's skeleton constant by `Finset.image e`. -/ @@ -213,8 +213,8 @@ noncomputable def LocalEMContext.carrierEquiv (ctx : LocalEMContext Λ J (M := M theorem LocalEMContext.carrierEquiv_mkClass (ctx : LocalEMContext Λ J (M := M)) (e : J ≃o J) (t : Λ[[J]].Term Empty) : - ctx.carrierEquiv e (ctx.mkClass (t := t)) = ctx.mkClass (t := locJRename Λ J e t) := - rfl + ctx.carrierEquiv e (ctx.mkClass (t := t)) = ctx.mkClass (t := locJRename Λ J e t) := by + exact rfl /-- Equivariance of function interpretation under the language renaming induced by `e`: the targeted expanded-language fact (the base-reduct automorphism consumes its `Sum.inl` case). -/ diff --git a/LeanPool/InfinitaryLogic/Methods/LocalEMFamily.lean b/LeanPool/InfinitaryLogic/Methods/LocalEMFamily.lean index e82e30af26..bcda055675 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,10 +57,11 @@ 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. -/ +@[expose] def canonEqAtoms : Set (Σ n, Λ.BoundedFormulaω Empty n) := Set.range fun p : Σ m, Λ.Term (Fin m) × Λ.Term (Fin m) => (⟨p.1, canonEqAtom Λ p.2.1 p.2.2⟩ : Σ n, Λ.BoundedFormulaω Empty n) @@ -75,12 +76,13 @@ 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 /-- The **canonical relation-atom seed**: all canonical relation atoms, over all arities and all relation symbols. -/ +@[expose] def canonRelAtoms : Set (Σ n, Λ.BoundedFormulaω Empty n) := Set.range fun q : Σ (m l : ℕ), Λ.Relations l × (Fin l → Λ.Term (Fin m)) => (⟨q.1, canonRelAtom Λ q.2.2.1 q.2.2.2⟩ : Σ n, Λ.BoundedFormulaω Empty n) @@ -98,13 +100,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 +137,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 +170,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 +188,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 +197,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 +210,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 +223,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) @@ -242,7 +245,7 @@ variable (s₀ : LocalStage) /-- **The extracted-family candidate**: the colimit family together with the full canonical atom seeds and the canonical deForm closure of the colimit family — everything the local `EMContext`'s `hind`/`atom_mem`/`rel_mem`/deForm-closure obligations will quantify over. -/ -def ΓEMlocal : Set (Σ n, (localColim s₀).BoundedFormulaω Empty n) := +@[expose] def ΓEMlocal : Set (Σ n, (localColim s₀).BoundedFormulaω Empty n) := ΓlocalColim s₀ ∪ canonEqAtoms (localColim s₀) ∪ canonRelAtoms (localColim s₀) ∪ canonDeForms (localColim s₀) (ΓlocalColim s₀) 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..5dca241659 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 @@ -83,7 +83,8 @@ The countability certificates are instance arguments; note `TailTemplateRealizab assumes only countably many *relation* symbols, so the function-symbol countability is an extra assumption of this bridge for now (a later chunk can replace `L'` by the countable sublanguage generated by `s`). -/ -@[reducible] def LocalStage.ofSeq (L' : Language.{0, 0}) [hf : Countable (Σ n, L'.Functions n)] +@[expose, reducible] +def LocalStage.ofSeq (L' : Language.{0, 0}) [hf : Countable (Σ n, L'.Functions n)] [hr : Countable (Σ n, L'.Relations n)] (s : ℕ → Σ n, L'.BoundedFormulaω Empty n) : LocalStage where Lang := L' 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..ab9cf3e83e 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 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..e2bd8d3702 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 @@ -136,6 +136,7 @@ private theorem not_mem_skolemNeed_of_all_mem {Γ : Set (Σ n, L.BoundedFormula /-- The local Skolem **witness symbol** for (the negated body of) a universal family member — the arity-`n` function symbol of `localSkolem L (skolemNeed Γ)` witnessing `∃ xₙ, ¬ψ`. -/ +@[expose] def skolemNeedSymbol {Γ : Set (Σ n, L.BoundedFormulaω Empty n)} {n : ℕ} {ψ : L.BoundedFormulaω Empty (n + 1)} (h : (⟨n, .all ψ⟩ : Σ n, L.BoundedFormulaω Empty n) ∈ Γ) : @@ -149,7 +150,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 +242,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 +256,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..fbe27738f4 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 @@ -66,8 +66,13 @@ private theorem pcClass_subset_of_invariant_superset {B W : Set (StructureSpace have hM : @Sentenceω.Realize (MidLang L) (functionalTheta L T) ℕ Mstar := by have h1 := reconstruct_realizes_functionalPCSentence side T hAx hrel rw [functionalPCSentence] at h1 - exact (BoundedFormulaω.realize_mapLanguage (sideEmb L side) (functionalTheta L T) - (Empty.elim : Empty → ℕ) Fin.elim0).mp h1 + cases side with + | left => + exact (BoundedFormulaω.realize_mapLanguage (sideEmb L .left) (functionalTheta L T) + (Empty.elim : Empty → ℕ) Fin.elim0).mp h1 + | right => + exact (BoundedFormulaω.realize_mapLanguage (sideEmb L .right) (functionalTheta L T) + (Empty.elim : Empty → ℕ) Fin.elim0).mp h1 obtain ⟨homega, hbitR, hcode, hdef, htreeR, hpathR⟩ := (realize_functionalTheta T).mp hM have hbit := (realize_bitAxiom (L := L)).mp hbitR have htree := (realize_treeDiagram (L := L) T).mp htreeR diff --git a/LeanPool/InfinitaryLogic/Methods/LopezEscobar/Disjoint.lean b/LeanPool/InfinitaryLogic/Methods/LopezEscobar/Disjoint.lean index 4897018c9a..16a65f9b0a 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 @@ -85,11 +85,14 @@ private theorem pcMem_disjoint {B : Set (StructureSpace L)} -- reconstruct the functional structure and make `N` infinite let Kstar : (KLang L).Structure N := reconstructStructure (sideFunsSet L .left) hAxN let Mstar : (MidLang L).Structure N := (sideEmb L .left).reduct N + have hExpansion : @LHom.IsExpansionOn (MidLang L) (KLang L) + (sideEmb L .left) N Mstar Kstar := LHom.isExpansionOn_reduct _ _ have hM : @Sentenceω.Realize (MidLang L) (functionalTheta L T₀) N Mstar := by have h1 := reconstruct_realizes_functionalPCSentence .left T₀ hAxN hrelN rw [functionalPCSentence] at h1 - exact (BoundedFormulaω.realize_mapLanguage (sideEmb L .left) (functionalTheta L T₀) - (Empty.elim : Empty → N) Fin.elim0).mp h1 + exact (@BoundedFormulaω.realize_mapLanguage (MidLang L) Empty 0 + (KLang L) (sideEmb L .left) N Mstar Kstar hExpansion + (functionalTheta L T₀) (Empty.elim : Empty → N) Fin.elim0).mp h1 obtain ⟨homega, -⟩ := (realize_functionalTheta T₀).mp hM have hν := numMap_bijective homega have : Infinite N := Infinite.of_injective (numMap L N) hν.injective diff --git a/LeanPool/InfinitaryLogic/Methods/LopezEscobar/FunctionalTheta.lean b/LeanPool/InfinitaryLogic/Methods/LopezEscobar/FunctionalTheta.lean index 5a5aa8f4b0..797697c54a 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 @@ -77,16 +77,19 @@ section Maps variable (L) (M : Type) [inst : (MidLang L).Structure M] /-- The interpreted successor. -/ +@[expose] def sMap (x : M) : M := @Structure.funMap (MidLang L) M inst 1 (Sum.inr WitnessFun.s) ![x] /-- The interpreted `f`. -/ +@[expose] def fMap (x : M) : M := @Structure.funMap (MidLang L) M inst 1 (Sum.inr WitnessFun.f) ![x] /-- The interpreted `g`. -/ +@[expose] def gMap (x : M) : M := @Structure.funMap (MidLang L) M inst 1 (Sum.inr WitnessFun.g) ![x] /-- The numeral map `ℕ → M`. -/ -def numMap : ℕ → M +@[expose] def numMap : ℕ → M | 0 => @Structure.funMap (MidLang L) M inst 0 (Sum.inr WitnessFun.c) Fin.elim0 | n + 1 => sMap L M (numMap n) @@ -340,7 +343,7 @@ def treeAtom (n : ℕ) (σ : Fin n → Bool) (τ : Fin n → ℕ) : (MidLang L). variable (L) in /-- The semantic tuple of a tree atom. -/ -def treeTuple (M : Type) [inst : (MidLang L).Structure M] (n : ℕ) +@[expose] def treeTuple (M : Type) [inst : (MidLang L).Structure M] (n : ℕ) (σ : Fin n → Bool) (τ : Fin n → ℕ) : Fin (2 * n) → M := fun i => if h : (i : ℕ) < n then numMap L M (cond (σ ⟨i, h⟩) 1 0) @@ -414,6 +417,7 @@ def pathAxiom : (MidLang L).Sentenceω := variable (L) in /-- The semantic path tuple at level `n`. -/ +@[expose] def pathTuple (M : Type) [inst : (MidLang L).Structure M] (n : ℕ) : Fin (2 * n) → M := fun i => if (i : ℕ) < n then fMap L M (numMap L M (i : ℕ)) diff --git a/LeanPool/InfinitaryLogic/Methods/LopezEscobar/PCMem.lean b/LeanPool/InfinitaryLogic/Methods/LopezEscobar/PCMem.lean index 5748104c7d..487ab9f1ba 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 @@ -31,7 +31,7 @@ variable {L : Language.{0, 0}} [L.IsRelational] [Countable (Σ l, L.Relations l) /-- The base embedding of `L` into the relationalized `graphLanguage (KLang L)`: functions are vacuous (`L` is relational), base relations go to their graph-language base image. -/ -def baseGraphEmb : L →ᴸ graphLanguage (KLang L) where +@[expose] def baseGraphEmb : L →ᴸ graphLanguage (KLang L) where onFunction {_} f := isEmptyElim f onRelation {_} R := GraphRelation.base (Sum.inl R) diff --git a/LeanPool/InfinitaryLogic/Methods/LopezEscobar/PCSentence.lean b/LeanPool/InfinitaryLogic/Methods/LopezEscobar/PCSentence.lean index cc48444232..b71f42ab83 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 @@ -51,25 +51,25 @@ inductive PCSide | left | right variable (L) in /-- The side embedding: base symbols in place, the witness copy tagged left or right. -/ -def sideEmb : PCSide → (MidLang L →ᴸ KLang L) +@[expose] def sideEmb : PCSide → (MidLang L →ᴸ KLang L) | .left => LHom.sumMap (LHom.id L) LHom.sumInl | .right => LHom.sumMap (LHom.id L) LHom.sumInr variable (L) in /-- That side's tagged witness function symbols. -/ -def sideWitnessFuns : PCSide → Set (Σ n, (KLang L).Functions n) +@[expose] def sideWitnessFuns : PCSide → Set (Σ n, (KLang L).Functions n) | .left => leftFuns L | .right => rightFuns L variable (L) in /-- That side's tagged witness relation symbols. -/ -def sideWitnessRels : PCSide → Set (Σ n, (KLang L).Relations n) +@[expose] def sideWitnessRels : PCSide → Set (Σ n, (KLang L).Relations n) | .left => leftRels L | .right => rightRels L variable (L) in /-- The function symbols a side may mention: base plus its witness copy. -/ -def sideFunsSet (side : PCSide) : Set (Σ n, (KLang L).Functions n) := +@[expose] def sideFunsSet (side : PCSide) : Set (Σ n, (KLang L).Functions n) := baseFuns L ∪ sideWitnessFuns L side instance [Countable (Σ n, L.Functions n)] (side : PCSide) : @@ -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..8688dcb46e 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 @@ -70,38 +70,38 @@ abbrev KLang (L : Language.{0, 0}) : Language.{0, 0} := variable (L : Language.{0, 0}) /-- The base-symbol embedding. -/ -def baseEmb : L →ᴸ KLang L := LHom.sumInl +@[expose] def baseEmb : L →ᴸ KLang L := LHom.sumInl /-- The left-witness embedding. -/ -def leftWitnessEmb : WitnessLang →ᴸ KLang L := LHom.sumInr.comp LHom.sumInl +@[expose] def leftWitnessEmb : WitnessLang →ᴸ KLang L := LHom.sumInr.comp LHom.sumInl /-- The right-witness embedding. -/ -def rightWitnessEmb : WitnessLang →ᴸ KLang L := LHom.sumInr.comp LHom.sumInr +@[expose] def rightWitnessEmb : WitnessLang →ᴸ KLang L := LHom.sumInr.comp LHom.sumInr /-! ## Tagged symbol-image sets and their disjointness -/ /-- Base function symbols inside `KLang L`. -/ -def baseFuns : Set (Σ n, (KLang L).Functions n) := +@[expose] def baseFuns : Set (Σ n, (KLang L).Functions n) := Set.range fun p : Σ n, L.Functions n => ⟨p.1, (baseEmb L).onFunction p.2⟩ /-- Base relation symbols inside `KLang L`. -/ -def baseRels : Set (Σ n, (KLang L).Relations n) := +@[expose] def baseRels : Set (Σ n, (KLang L).Relations n) := Set.range fun p : Σ n, L.Relations n => ⟨p.1, (baseEmb L).onRelation p.2⟩ /-- Left-witness function symbols inside `KLang L`. -/ -def leftFuns : Set (Σ n, (KLang L).Functions n) := +@[expose] def leftFuns : Set (Σ n, (KLang L).Functions n) := Set.range fun p : Σ n, WitnessLang.Functions n => ⟨p.1, (leftWitnessEmb L).onFunction p.2⟩ /-- Left-witness relation symbols inside `KLang L`. -/ -def leftRels : Set (Σ n, (KLang L).Relations n) := +@[expose] def leftRels : Set (Σ n, (KLang L).Relations n) := Set.range fun p : Σ n, WitnessLang.Relations n => ⟨p.1, (leftWitnessEmb L).onRelation p.2⟩ /-- Right-witness function symbols inside `KLang L`. -/ -def rightFuns : Set (Σ n, (KLang L).Functions n) := +@[expose] def rightFuns : Set (Σ n, (KLang L).Functions n) := Set.range fun p : Σ n, WitnessLang.Functions n => ⟨p.1, (rightWitnessEmb L).onFunction p.2⟩ /-- Right-witness relation symbols inside `KLang L`. -/ -def rightRels : Set (Σ n, (KLang L).Relations n) := +@[expose] def rightRels : Set (Σ n, (KLang L).Relations n) := Set.range fun p : Σ n, WitnessLang.Relations n => ⟨p.1, (rightWitnessEmb L).onRelation p.2⟩ /-- Two tagged sigma-image ranges with pointwise-clashing tags are disjoint. -/ diff --git a/LeanPool/InfinitaryLogic/Methods/MarkerStage.lean b/LeanPool/InfinitaryLogic/Methods/MarkerStage.lean index db26866356..117bba654a 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 @@ -345,6 +345,7 @@ section HenkinSubstrate variable {L'' : Language.{0, 0}} {J : Type} /-- The `n`-th Henkin witness constant of a constant expansion `L[[ℕ]]`, as a closed term. -/ +@[expose] def henkinConst {L : Language.{0, 0}} (n : ℕ) : (L[[ℕ]]).Term Empty := Term.func (Sum.inr n : (L[[ℕ]]).Functions 0) Fin.elim0 @@ -357,7 +358,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 +379,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 @@ -386,6 +387,7 @@ def termValueWith (σ : J → M) (h : ℕ → M) {β : Type} /-- Realization of an expansion formula under a skeleton interpretation `σ : J → M` and a Henkin interpretation `h : ℕ → M`. -/ +@[expose] def realizeWith (σ : J → M) (h : ℕ → M) {α : Type} {n : ℕ} (φ : ((L''[[J]])[[ℕ]]).BoundedFormulaω α n) (v : α → M) (xs : Fin n → M) : Prop := letI : (constantsOn J).Structure M := constantsOn.structure σ @@ -661,7 +663,7 @@ the source, and — for EVERY skeleton interpretation increasing on `S` into `e` SOME Henkin interpretation making every member true. The skeleton side stays universal (the EM tuples); the witness side is existential per interpretation, because quantifier witnesses vary with the tuple. The support-tracking conjuncts live in the wrapping predicates. -/ -def MarkerHenkinBody (α : Ordinal.{0}) (S : Finset J) +@[expose] def MarkerHenkinBody (α : Ordinal.{0}) (S : Finset J) (F : Set ((L''[[J]])[[ℕ]].Sentenceω)) : Prop := ∃ e : (Order.succ (Cardinal.beth α)).ord.ToType ↪o M, ∀ σ : J → M, StrictMonoOn σ ↑S → (∀ j ∈ S, σ j ∈ Set.range e) → @@ -683,6 +685,7 @@ cofinally many levels below `ω₁`. The arbitrary-set `extension` field and the uniformization of the ambient `ConsistencyPropertyEq` API are deliberately avoided: the Henkin construction consumes finite members along its enumeration, choosing disjuncts and witnesses per member (the classical Marker/Keisler shape). -/ +@[expose] def MarkerHenkinConsistent (F : Finset ((L''[[J]])[[ℕ]].Sentenceω)) : Prop := ∃ (S : Finset J) (H : Finset ℕ), (∀ τ ∈ (↑F : Set ((L''[[J]])[[ℕ]].Sentenceω)), expJConstsIn (L'' := L'') τ ⊆ ↑S) ∧ @@ -1097,6 +1100,7 @@ whether `τ` is realized). -/ /-- A sentence of finite constant support: finitely many `J`-constants and finitely many Henkin constants. The restricted universe the adapter decides over. -/ +@[expose] def HasFiniteConstSupport (τ : ((L''[[J]])[[ℕ]]).Sentenceω) : Prop := ∃ (S : Finset J) (H : Finset ℕ), expJConstsIn (L'' := L'') τ ⊆ ↑S ∧ henkinConstsIn (L'' := L'') τ ⊆ ↑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..514e5ba18a 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 @@ -234,7 +234,7 @@ variable {s₀ : LocalStage} `((localColim s₀)[[ℕ]])[[ℕ]]`: each schema sentence `templateSentence ψ t` (`⟨m, ψ⟩ ∈ ΓEMlocal`), lifted along the Henkin inclusion and packaged with its finite-support proof. This is the enumeration domain the ω-stage completion (checkpoint 3b) decides. -/ -def schemaFSentenceUniverse (s₀ : LocalStage) : +@[expose] def schemaFSentenceUniverse (s₀ : LocalStage) : Set (FSentence (L'' := localColim s₀) (J := ℕ)) := ⋃ (mφ ∈ ΓEMlocal s₀), Set.range fun t : Fin mφ.1 ↪o ℕ => (⟨(Lomega1omegaTemplate.templateSentence mφ.2 t).mapLanguage @@ -432,6 +432,7 @@ variable (ρ : ℕ → FSentence (L'' := localColim s₀) (J := ℕ)) (hM : Cardinal.beth (Ordinal.omega 1) ≤ Cardinal.mk M) /-- **The completed theory** (raw set of Marker sentences), the union of the completion stages. -/ +@[expose] def schemaCompletionTheory : Set (((localColim s₀)[[ℕ]])[[ℕ]].Sentenceω) := {τ | ∃ n, τ ∈ (schemaCompletionStage ρ hM n).1} diff --git a/LeanPool/InfinitaryLogic/Methods/SchemaLocalEMSource.lean b/LeanPool/InfinitaryLogic/Methods/SchemaLocalEMSource.lean index 7e883ecb58..ea60603f93 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 @@ -67,9 +67,18 @@ theorem schemaTerm_localSkolemUniversalForColim schemaTermStructure hM let : (localColim s₀).Structure (SchemaTermCarrier (s₀ := s₀) (M := M) hM) := (lhomWithConstants (localColim s₀) ℕ).reduct _ - have : (lhomWithConstants (localColim s₀) ℕ).IsExpansionOn - (SchemaTermCarrier (s₀ := s₀) (M := M) hM) := - LHom.isExpansionOn_reduct _ _ + let expandedStructure : + (localColim s₀)[[ℕ]].Structure (SchemaTermCarrier (s₀ := s₀) (M := M) hM) := + schemaTermStructure hM + let reductStructure : + (localColim s₀).Structure (SchemaTermCarrier (s₀ := s₀) (M := M) hM) := + (lhomWithConstants (localColim s₀) ℕ).reduct _ + have hExpansion : @LHom.IsExpansionOn (localColim s₀) ((localColim s₀)[[ℕ]]) + (lhomWithConstants (localColim s₀) ℕ) + (SchemaTermCarrier (s₀ := s₀) (M := M) hM) + reductStructure expandedStructure := + LHom.isExpansionOn_reduct (lhomWithConstants (localColim s₀) ℕ) + (SchemaTermCarrier (s₀ := s₀) (M := M) hM) refine ⟨?_⟩ intro k n ψ h xs hψw classical @@ -118,7 +127,10 @@ theorem schemaTerm_localSkolemUniversalForColim have hnegBase : (negBody.mapLanguage (LlocalInclusion s₀ (k + 1))).Realize (Empty.elim : Empty → SchemaTermCarrier (s₀ := s₀) (M := M) hM) (fun i => SchemaTermCarrier.mk hM (args i)) := - (BoundedFormulaω.realize_mapLanguage (lhomWithConstants (localColim s₀) ℕ) + (@BoundedFormulaω.realize_mapLanguage (localColim s₀) Empty _ + ((localColim s₀)[[ℕ]]) (lhomWithConstants (localColim s₀) ℕ) + (SchemaTermCarrier (s₀ := s₀) (M := M) hM) + reductStructure expandedStructure hExpansion (negBody.mapLanguage (LlocalInclusion s₀ (k + 1))) (Empty.elim : Empty → SchemaTermCarrier (s₀ := s₀) (M := M) hM) (fun i => SchemaTermCarrier.mk hM (args i))).mp hnegReal @@ -176,7 +188,10 @@ theorem schemaTerm_localSkolemUniversalForColim have hallBase : ((BoundedFormulaω.all ψ).mapLanguage (LlocalInclusion s₀ k)).Realize (Empty.elim : Empty → SchemaTermCarrier (s₀ := s₀) (M := M) hM) (fun i => SchemaTermCarrier.mk hM (ts i)) := - (BoundedFormulaω.realize_mapLanguage (lhomWithConstants (localColim s₀) ℕ) + (@BoundedFormulaω.realize_mapLanguage (localColim s₀) Empty _ + ((localColim s₀)[[ℕ]]) (lhomWithConstants (localColim s₀) ℕ) + (SchemaTermCarrier (s₀ := s₀) (M := M) hM) + reductStructure expandedStructure hExpansion ((BoundedFormulaω.all ψ).mapLanguage (LlocalInclusion s₀ k)) (Empty.elim : Empty → SchemaTermCarrier (s₀ := s₀) (M := M) hM) (fun i => SchemaTermCarrier.mk hM (ts i))).mp hall @@ -198,7 +213,7 @@ realization the Morley-seed agreement consumes. -/ /-- **The schema local-EM context** over an arbitrary target order `J`: sequence `schemaSeq`, family `ΓEMlocal`, tail indiscernibility from the full (cutoff-`0`) indiscernibility, atoms by the `ΓEMlocal` dischargers. -/ -noncomputable def schemaTermLocalEMContext +@[expose] noncomputable def schemaTermLocalEMContext (hM : Cardinal.beth (Ordinal.omega 1) ≤ Cardinal.mk M) (J : Type) [LinearOrder J] : letI : (localColim s₀).Structure M := localColimStructure s₀ letI : (localColim s₀)[[ℕ]].Structure (SchemaTermCarrier (s₀ := s₀) (M := M) hM) := 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..9c54c64db0 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 @@ -40,11 +40,13 @@ variable {s₀ : LocalStage} {M : Type} [(localColim s₀).Structure M] [LinearO [WellFoundedLT M] (hM : Cardinal.beth (Ordinal.omega 1) ≤ Cardinal.mk M) /-- The canonical finite support of an equality between two closed schema terms. -/ +@[expose] def schemaSupport (t u : (localColim s₀)[[ℕ]].Term Empty) : Finset ℕ := locJSupport (localColim s₀) ℕ t ∪ locJSupport (localColim s₀) ℕ u /-- The lifted `templateSentence` of the de-substituted equality atom `locDeEqAtom` at the canonical support — the schema-universe sentence that encodes "`t = u`". -/ +@[expose] def schemaEqSentence (t u : (localColim s₀)[[ℕ]].Term Empty) : ((localColim s₀)[[ℕ]])[[ℕ]].Sentenceω := (Lomega1omegaTemplate.templateSentence @@ -65,6 +67,7 @@ private theorem schemaEqSentence_mem_universe (t u : (localColim s₀)[[ℕ]].Te /-- **Canonical-support schema equality** on closed `(localColim s₀)[[ℕ]]` terms: `t ≈ u` iff the completed theory contains the encoded equality sentence. -/ +@[expose] def SchemaTermEq (t u : (localColim s₀)[[ℕ]].Term Empty) : Prop := schemaEqSentence t u ∈ schemaCompletionTheory (schemaEnumeration s₀) hM @@ -260,6 +263,7 @@ theorem locJSupport_subset_schemaRelSupport {l : ℕ} /-- The lifted `templateSentence` of the de-substituted relation atom `locDeRelAtom` at the canonical support — the schema-universe sentence that encodes "`R ts`". -/ +@[expose] def schemaRelSentence {l : ℕ} (R : (localColim s₀).Relations l) (ts : Fin l → (localColim s₀)[[ℕ]].Term Empty) : ((localColim s₀)[[ℕ]])[[ℕ]].Sentenceω := @@ -296,6 +300,7 @@ theorem realize_schemaRelSentence_iff (σ h : ℕ → M) {l : ℕ} (R : (localCo rw [Term.realize_relabel, Sum.elim_comp_inr, locDeTermFin_realize_constInterp_nat] /-- **Canonical-support schema relation membership** on tuples of closed schema terms. -/ +@[expose] def SchemaTermRel {l : ℕ} (R : (localColim s₀).Relations l) (ts : Fin l → (localColim s₀)[[ℕ]].Term Empty) : Prop := schemaRelSentence R ts ∈ schemaCompletionTheory (schemaEnumeration s₀) hM @@ -341,6 +346,7 @@ private theorem schemaTermRel_congr {l : ℕ} (R : (localColim s₀).Relations l /-! ### The quotient term model -/ /-- The setoid on closed schema terms induced by the completed theory. -/ +@[expose] def schemaTermSetoid : Setoid ((localColim s₀)[[ℕ]].Term Empty) where r := SchemaTermEq hM iseqv := by exact ⟨schemaTermEq_refl hM, schemaTermEq_symm hM, schemaTermEq_trans hM⟩ @@ -418,6 +424,7 @@ theorem schemaTerm_relMap_mk_iff {l : ℕ} (R : (localColim s₀).Relations l) /-- **The canonical schema sequence** in the term model: the classes of the sequence constants `d₀, d₁, …`. This is the sequence the witnessed template (`TailTemplateOmegaWitnessed`) will be established for. -/ +@[expose] noncomputable def schemaSeq (n : ℕ) : SchemaTermCarrier (s₀ := s₀) (M := M) hM := SchemaTermCarrier.mk hM (henkinConst (L := localColim s₀) n) @@ -436,7 +443,7 @@ interpretation pair, contradicting the equivalence. -/ /-- The lifted `templateSentence` of the general de-substituted formula `locDeForm` at the canonical support — the schema-universe sentence that encodes "`φ` holds on the closed terms `ts`". `schemaEqSentence`/`schemaRelSentence` are the atomic special cases of this shape. -/ -def schemaFormulaSentence {n : ℕ} (φ : (localColim s₀).BoundedFormulaω Empty n) +@[expose] def schemaFormulaSentence {n : ℕ} (φ : (localColim s₀).BoundedFormulaω Empty n) (ts : Fin n → (localColim s₀)[[ℕ]].Term Empty) : ((localColim s₀)[[ℕ]])[[ℕ]].Sentenceω := (Lomega1omegaTemplate.templateSentence diff --git a/LeanPool/InfinitaryLogic/Methods/SchemaTermTruth.lean b/LeanPool/InfinitaryLogic/Methods/SchemaTermTruth.lean index 984e4eb7eb..50f515ce9d 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 @@ -902,14 +902,27 @@ theorem schemaSeq_realize_iff_schemaLift_mem : schemaTermStructure hM let : (localColim s₀).Structure (SchemaTermCarrier (s₀ := s₀) (M := M) hM) := (lhomWithConstants (localColim s₀) ℕ).reduct _ - have : (lhomWithConstants (localColim s₀) ℕ).IsExpansionOn - (SchemaTermCarrier (s₀ := s₀) (M := M) hM) := LHom.isExpansionOn_reduct _ _ + let expandedStructure : + (localColim s₀)[[ℕ]].Structure (SchemaTermCarrier (s₀ := s₀) (M := M) hM) := + schemaTermStructure hM + let reductStructure : + (localColim s₀).Structure (SchemaTermCarrier (s₀ := s₀) (M := M) hM) := + (lhomWithConstants (localColim s₀) ℕ).reduct _ + have hExpansion : @LHom.IsExpansionOn (localColim s₀) ((localColim s₀)[[ℕ]]) + (lhomWithConstants (localColim s₀) ℕ) + (SchemaTermCarrier (s₀ := s₀) (M := M) hM) + reductStructure expandedStructure := + LHom.isExpansionOn_reduct (lhomWithConstants (localColim s₀) ℕ) + (SchemaTermCarrier (s₀ := s₀) (M := M) hM) change ψ.Realize (Empty.elim : Empty → SchemaTermCarrier (s₀ := s₀) (M := M) hM) (fun i => schemaSeq hM (t i)) ↔ schemaLift ψ t ∈ schemaCompletionTheory (schemaEnumeration s₀) hM rcases hψ with ((hcolim | heqm) | hrelm) | hdem · -- colimit members - exact (BoundedFormulaω.realize_mapLanguage (lhomWithConstants (localColim s₀) ℕ) ψ + exact (@BoundedFormulaω.realize_mapLanguage (localColim s₀) Empty _ + ((localColim s₀)[[ℕ]]) (lhomWithConstants (localColim s₀) ℕ) + (SchemaTermCarrier (s₀ := s₀) (M := M) hM) + reductStructure expandedStructure hExpansion ψ (Empty.elim : Empty → SchemaTermCarrier (s₀ := s₀) (M := M) hM) (fun i => schemaSeq hM (t i))).symm.trans ((schemaTruthLemma_colim hM hcolim (fun i => henkinConst (t i))).trans @@ -954,7 +967,10 @@ theorem schemaSeq_realize_iff_schemaLift_mem : show (fun j => (g j).realize (fun i => schemaSeq (s₀ := s₀) (M := M) hM (t i))) = fun j => SchemaTermCarrier.mk hM (schemaCloseTerm (g j) t) from funext fun j => schemaCloseTerm_reduct_realize hM (g j) t] - exact (BoundedFormulaω.realize_mapLanguage (lhomWithConstants (localColim s₀) ℕ) φ + exact (@BoundedFormulaω.realize_mapLanguage (localColim s₀) Empty _ + ((localColim s₀)[[ℕ]]) (lhomWithConstants (localColim s₀) ℕ) + (SchemaTermCarrier (s₀ := s₀) (M := M) hM) + reductStructure expandedStructure hExpansion φ (Empty.elim : Empty → SchemaTermCarrier (s₀ := s₀) (M := M) hM) (fun j => SchemaTermCarrier.mk hM (schemaCloseTerm (g j) t))).symm.trans (schemaTruthLemma_colim hM hqΓ fun j => schemaCloseTerm (g j) t) diff --git a/LeanPool/InfinitaryLogic/Methods/SkolemClosure.lean b/LeanPool/InfinitaryLogic/Methods/SkolemClosure.lean index d600c96b24..fdee1699f8 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 @@ -64,7 +64,7 @@ theorem setClosure_countable (stepOne : α → Set α) {Γ₀ : Set α} (hΓ₀ /-- Immediate subformulas and countable-connective components of a formula, over **any** language: `imp` gives both parts, `all` gives the body (one higher arity), `iSup`/`iInf` give all countably-many components, and the atomic forms give none. -/ -def bfSubformulas {Λ : Language.{0, 0}} : +@[expose] def bfSubformulas {Λ : Language.{0, 0}} : (Σ n, Λ.BoundedFormulaω Empty n) → Set (Σ n, Λ.BoundedFormulaω Empty n) | ⟨_, .imp φ ψ⟩ => {⟨_, φ⟩, ⟨_, ψ⟩} | ⟨_, .all φ⟩ => {⟨_, φ⟩} 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..dca966b55c 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,13 +43,13 @@ 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 the full positive rational diagram. Per the frozen member shape (D4), `Bφ` literally belongs to every consistency-property member. -/ -def baseDiagram (φ : L.Sentenceω) (lt : L.Relations 2) : Set L[[ℕ]].Sentenceω := +@[expose] def baseDiagram (φ : L.Sentenceω) (lt : L.Relations 2) : Set L[[ℕ]].Sentenceω := insert (φ.mapLanguage (L.lhomWithConstants ℕ)) {χ | ∃ q r : ℚ, q < r ∧ χ = ratLtAtom lt q r} theorem mapLanguage_mem_baseDiagram (φ : L.Sentenceω) (lt : L.Relations 2) : @@ -66,16 +66,16 @@ variable {M : Type} [L.Structure M] /-- An ordinal-indexed chain in `M`, strictly increasing for the interpreted relation `lt` — the raw positive form (no injectivity packaged). -/ -def RelChain (lt : L.Relations 2) (γ : Ordinal.{0}) (w : γ.ToType → M) : Prop := +@[expose] def RelChain (lt : L.Relations 2) (γ : Ordinal.{0}) (w : γ.ToType → M) : Prop := ∀ x y : γ.ToType, x < y → RelMap lt ![w x, w y] /-- A relation-preserving map from `ℚ` — the raw positive conclusion form (D2). -/ -def RelPreserving (lt : L.Relations 2) (f : ℚ → M) : Prop := +@[expose] def RelPreserving (lt : L.Relations 2) (f : ℚ → M) : Prop := ∀ q r : ℚ, q < r → RelMap lt ![f q, f r] /-- **The hypothesis form (D1)**: for every countable ordinal, a model of `φ` with an `α`-length `lt`-chain. -/ -def HasWellOrderedChains (φ : L.Sentenceω) (lt : L.Relations 2) : Prop := +@[expose] def HasWellOrderedChains (φ : L.Sentenceω) (lt : L.Relations 2) : Prop := ∀ α : Ordinal.{0}, α < (Cardinal.aleph 1).ord → ∃ (M : Type) (_ : L.Structure M) (_ : Nonempty M), Sentenceω.Realize φ M ∧ ∃ w : α.ToType → M, RelChain lt α w 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..f8a3a042dc 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 @@ -44,7 +44,7 @@ variable {L : Language.{0, 0}} /-! ## Mentioned rational constants -/ /-- The rationals whose constants are mentioned by a set of expansion sentences. -/ -def ratSupport (Γ : Set L[[ℕ]].Sentenceω) : Set ℚ := +@[expose] def ratSupport (Γ : Set L[[ℕ]].Sentenceω) : Set ℚ := {q | ∃ χ ∈ Γ, ratConstIdx q ∈ sentenceJConsts (L' := L) (J := ℕ) χ} /-! ## The star witness -/ @@ -77,7 +77,7 @@ structure StarWitness (φ : L.Sentenceω) (lt : L.Relations 2) (Γ : Set L[[ℕ] witness : @GapWitness L M inst lt α m fun i => h (ratConstIdx (mark i)) /-- **The (*) condition**: a witness exists. -/ -def StarCondition (φ : L.Sentenceω) (lt : L.Relations 2) (Γ : Set L[[ℕ]].Sentenceω) +@[expose] def StarCondition (φ : L.Sentenceω) (lt : L.Relations 2) (Γ : Set L[[ℕ]].Sentenceω) (α : Ordinal.{0}) : Prop := Nonempty (StarWitness φ lt Γ α) diff --git a/LeanPool/InfinitaryLogic/Methods/WellOrdering/SymbolCountability.lean b/LeanPool/InfinitaryLogic/Methods/WellOrdering/SymbolCountability.lean index d85280974c..efc0073de3 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 @@ -73,9 +73,15 @@ theorem exists_model_relPreserving_isRelational [L.IsRelational] have := neN let instN : L.Structure N := expandSymbStructureBase φ.functionsIn (insert ⟨2, lt⟩ φ.relationsIn) - have : (symbSublangIncl φ.functionsIn (insert ⟨2, lt⟩ φ.relationsIn)).IsExpansionOn N := by - have hred := reduct_expandSymbStructureBase (L := L) φ.functionsIn - (insert ⟨2, lt⟩ φ.relationsIn) (M := N) + have hExpansion : @LHom.IsExpansionOn + (symbSublang φ.functionsIn (insert ⟨2, lt⟩ φ.relationsIn)) L + (symbSublangIncl φ.functionsIn (insert ⟨2, lt⟩ φ.relationsIn)) + N instN₀ instN := by + have hred : + (symbSublangIncl φ.functionsIn (insert ⟨2, lt⟩ φ.relationsIn)).reduct N = + instN₀ := + reduct_expandSymbStructureBase (L := L) φ.functionsIn + (insert ⟨2, lt⟩ φ.relationsIn) (M := N) rw [← hred] exact LHom.isExpansionOn_reduct _ _ refine ⟨N, instN, neN, f, ?_, fun q r hqr => ?_⟩ @@ -85,9 +91,10 @@ theorem exists_model_relPreserving_isRelational [L.IsRelational] -- The relation and carrier are supplied explicitly: with `?R` open, `rw` must assign the -- subtype element `⟨lt, _⟩` to `?R : (symbSublang ..).Relations 2`, which fails at `implicit` -- transparency. - exact Eq.mp (LHom.map_onRelation (M := N) (n := 2) - (symbSublangIncl φ.functionsIn - (insert (⟨2, lt⟩ : Σ n, L.Relations n) φ.relationsIn)) + exact Eq.mp (@LHom.map_onRelation + (symbSublang φ.functionsIn (insert ⟨2, lt⟩ φ.relationsIn)) L + (symbSublangIncl φ.functionsIn (insert ⟨2, lt⟩ φ.relationsIn)) + N instN₀ instN hExpansion 2 ⟨lt, Set.mem_insert _ _⟩ ![f q, f r]).symm hpres end 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..b669db35ff 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 @@ -27,7 +27,7 @@ variable {L : Language.{u, v}} {L' : Language.{u', v'}} /-- **Projective-class membership**: `M` (as an `L`-structure) expands, on the same carrier, to an `L'`-structure satisfying `Θ`. No nonemptiness is built in. -/ -def PCMem (g : L →ᴸ L') (Θ : L'.Sentenceω) (M : Type*) [L.Structure M] : Prop := +@[expose] def PCMem (g : L →ᴸ L') (Θ : L'.Sentenceω) (M : Type*) [L.Structure M] : Prop := ∃ S' : L'.Structure M, @LHom.IsExpansionOn L L' g M _ S' ∧ @Sentenceω.Realize L' Θ M S' end 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/InflationTermination/PalomarSolutions/TriangleInflation.lean b/LeanPool/InflationTermination/PalomarSolutions/TriangleInflation.lean index b92ff2d6e7..a504526431 100644 --- a/LeanPool/InflationTermination/PalomarSolutions/TriangleInflation.lean +++ b/LeanPool/InflationTermination/PalomarSolutions/TriangleInflation.lean @@ -23,7 +23,7 @@ that root directory there, so a Solution under `Palomar.*` is never found (PalomarSubmission#108). -/ -@[expose] public section +public section namespace TriangleInflation diff --git a/LeanPool/InflationTermination/PalomarSolutions/TriangleInflationClassification.lean b/LeanPool/InflationTermination/PalomarSolutions/TriangleInflationClassification.lean index 3ae2dfc42f..136c4b5c4d 100644 --- a/LeanPool/InflationTermination/PalomarSolutions/TriangleInflationClassification.lean +++ b/LeanPool/InflationTermination/PalomarSolutions/TriangleInflationClassification.lean @@ -25,7 +25,7 @@ that root directory there, so a Solution under `Palomar.*` is never found (PalomarSubmission#108). -/ -@[expose] public section +public section namespace TriangleInflation.Graph diff --git a/LeanPool/InflationTermination/TriangleInflation/ConvexOrder.lean b/LeanPool/InflationTermination/TriangleInflation/ConvexOrder.lean index 4823862115..c201f2e123 100644 --- a/LeanPool/InflationTermination/TriangleInflation/ConvexOrder.lean +++ b/LeanPool/InflationTermination/TriangleInflation/ConvexOrder.lean @@ -38,7 +38,7 @@ The theorem `rate_triangle` retains its separate collision-counting proof. The s estimate below matches the current manuscript corollary, including its coefficient `1/n`. -/ -@[expose] public section +public section namespace TriangleInflation diff --git a/LeanPool/InflationTermination/TriangleInflation/Defect.lean b/LeanPool/InflationTermination/TriangleInflation/Defect.lean index cb581d82a4..237f136750 100644 --- a/LeanPool/InflationTermination/TriangleInflation/Defect.lean +++ b/LeanPool/InflationTermination/TriangleInflation/Defect.lean @@ -19,7 +19,7 @@ independence lemma for functions of disjoint coordinate sets under a product wei those proofs use. Proofs are deferred. -/ -@[expose] public section +public section namespace TriangleInflation diff --git a/LeanPool/InflationTermination/TriangleInflation/DefectLaw.lean b/LeanPool/InflationTermination/TriangleInflation/DefectLaw.lean index f03aa899d1..e215c6ddb5 100644 --- a/LeanPool/InflationTermination/TriangleInflation/DefectLaw.lean +++ b/LeanPool/InflationTermination/TriangleInflation/DefectLaw.lean @@ -26,7 +26,7 @@ splits the root bits read by `Δ_{ijk}` into four disjoint blocks — the shared remaining cells of its line — and assembles the four marginals into `Q(ε,r)`. -/ -@[expose] public section +public section namespace TriangleInflation diff --git a/LeanPool/InflationTermination/TriangleInflation/Defs.lean b/LeanPool/InflationTermination/TriangleInflation/Defs.lean index 5873bf86f5..8a5c733e8e 100644 --- a/LeanPool/InflationTermination/TriangleInflation/Defs.lean +++ b/LeanPool/InflationTermination/TriangleInflation/Defs.lean @@ -62,7 +62,7 @@ only; the statements live in `Finner.lean`, `Defect.lean`, `Main.lean`, `Fan.lea carries the hypothesis `1 ≤ t`, where the two agree. -/ -@[expose] public section +public section namespace TriangleInflation @@ -71,14 +71,17 @@ open Finset /-! ## Laws as weight functions -/ /-- A probability weight function on a finite type: nonnegative and summing to one. -/ +@[expose] def IsLaw {α : Type*} [Fintype α] (w : α → ℝ) : Prop := (∀ a, 0 ≤ w a) ∧ ∑ a, w a = 1 /-- Pushforward of a weight function along a map of finite types. -/ +@[expose] def pushforward {α β : Type*} [Fintype α] [DecidableEq β] (w : α → ℝ) (F : α → β) : β → ℝ := fun b => ∑ a : α, if F a = b then w a else 0 /-- The product of independent per-coordinate weight functions on `ι → Bool`. -/ +@[expose] def prodLaw {ι : Type*} [Fintype ι] (w : ι → Bool → ℝ) : (ι → Bool) → ℝ := fun x => ∏ i, w i (x i) @@ -94,24 +97,30 @@ inductive Party deriving DecidableEq, Repr /-- The bit that a party reads off a three-bit outcome. -/ +@[expose] def partyBit : Party → ThreeBit → Bool | .A, w => w.1 | .B, w => w.2.1 | .C, w => w.2.2 /-- `P(000)`: the all-zero atom. -/ +@[expose] def atom000 (P : ThreeBit → ℝ) : ℝ := P (false, false, false) /-- `P_A(0)`: the zero marginal of the first bit. -/ +@[expose] def margA (P : ThreeBit → ℝ) : ℝ := ∑ y : Bool, ∑ z : Bool, P (false, y, z) /-- `P_B(0)`: the zero marginal of the second bit. -/ +@[expose] def margB (P : ThreeBit → ℝ) : ℝ := ∑ x : Bool, ∑ z : Bool, P (x, false, z) /-- `P_C(0)`: the zero marginal of the third bit. -/ +@[expose] def margC (P : ThreeBit → ℝ) : ℝ := ∑ x : Bool, ∑ y : Bool, P (x, y, false) /-- The `t`-fold tensor power `P^{⊗t}`, as a law on `Fin t → ThreeBit`. -/ +@[expose] def tensorPow (t : ℕ) (P : ThreeBit → ℝ) : (Fin t → ThreeBit) → ℝ := fun v => ∏ l : Fin t, P (v l) @@ -131,6 +140,7 @@ inductive Obs (t : ℕ) abbrev Assign (t : ℕ) := Obs t → Bool /-- Which party a copied observation is a copy of. -/ +@[expose] def Obs.party {t : ℕ} : Obs t → Party | .A _ _ => .A | .B _ _ => .B @@ -145,32 +155,39 @@ inductive Latent (t : ℕ) /-- The copied latent ancestors of a copied observation: `A^{ij} ↦ {X_i, Z_j}`, `B^{ik} ↦ {X_i, Y_k}`, `C^{jk} ↦ {Z_j, Y_k}`. -/ +@[expose] def Obs.ancestors {t : ℕ} : Obs t → Finset (Latent t) | .A i j => {Latent.X i, Latent.Z j} | .B i k => {Latent.X i, Latent.Y k} | .C j k => {Latent.Z j, Latent.Y k} /-- The copied latent ancestors of a set of copied observations. -/ +@[expose] def ancestorsOf {t : ℕ} (S : Finset (Obs t)) : Finset (Latent t) := S.biUnion Obs.ancestors /-- Paper Definition 2.4: two sets of copied observations are *ancestrally independent* when their copied latent ancestors are disjoint. -/ +@[expose] def AncestrallyIndependent {t : ℕ} (S T : Finset (Obs t)) : Prop := Disjoint (ancestorsOf S) (ancestorsOf T) /-- The copied triangle `Δ_{ijk} = {A^{ij}, B^{ik}, C^{jk}}` (paper Section 2.3). -/ +@[expose] def copiedTriangle {t : ℕ} (i j k : Fin t) : Finset (Obs t) := {Obs.A i j, Obs.B i k, Obs.C j k} /-- The diagonal triangle `Δ_{lll}` (paper Section 2.3). -/ +@[expose] def diagonalTriangle {t : ℕ} (l : Fin t) : Finset (Obs t) := copiedTriangle l l l /-- The three-bit outcome that an assignment gives to the copied triangle `Δ_{ijk}`. -/ +@[expose] def readTriangle {t : ℕ} (i j k : Fin t) (ω : Assign t) : ThreeBit := (ω (Obs.A i j), ω (Obs.B i k), ω (Obs.C j k)) /-- The tuple of three-bit outcomes of the `t` diagonal triangles `(Δ_{lll})_{l ∈ [t]}`. -/ +@[expose] def readDiagonal {t : ℕ} (ω : Assign t) : Fin t → ThreeBit := fun l => readTriangle l l l ω @@ -179,6 +196,7 @@ def readDiagonal {t : ℕ} (ω : Assign t) : Fin t → ThreeBit := /-- The action of `(σ_X, σ_Z, σ_Y) ∈ S_t × S_t × S_t` on copied observations. The first component permutes `X`-copy indices, the second `Z`-copy indices, the third `Y`-copy indices, exactly as in Definition 2.3(i). -/ +@[expose] def Obs.perm {t : ℕ} (π : Equiv.Perm (Fin t) × Equiv.Perm (Fin t) × Equiv.Perm (Fin t)) : Obs t → Obs t | .A i j => .A (π.1 i) (π.2.1 j) @@ -186,11 +204,13 @@ def Obs.perm {t : ℕ} (π : Equiv.Perm (Fin t) × Equiv.Perm (Fin t) × Equiv.P | .C j k => .C (π.2.1 j) (π.2.2 k) /-- Relabelling an assignment by an index permutation. -/ +@[expose] def relabel {t : ℕ} (π : Equiv.Perm (Fin t) × Equiv.Perm (Fin t) × Equiv.Perm (Fin t)) (ω : Assign t) : Assign t := fun v => ω (Obs.perm π v) /-- Paper Definition 2.3(i): invariance under independent permutations of the three index families. -/ +@[expose] def SymmetricLaw (t : ℕ) (Γ : Assign t → ℝ) : Prop := ∀ π ω, Γ (relabel π ω) = Γ ω @@ -201,6 +221,7 @@ Paper Definition 2.4 and Appendix A. -/ /-- The primitive condition of Wolfe–Spekkens–Fritz Definition 4, specialized to the triangle: erasing copy indices is injective on the set, and any two members that are copies of variables sharing a source in the triangle agree in the copy index of that source. -/ +@[expose] def SharedAgree {t : ℕ} : Obs t → Obs t → Prop | .A i _, .B i' _ => i = i' | .B i' _, .A i _ => i = i' @@ -211,20 +232,24 @@ def SharedAgree {t : ℕ} : Obs t → Obs t → Prop | _, _ => True /-- The primitive definition of an injectable set (paper Appendix A.3). -/ +@[expose] def InjectableRaw {t : ℕ} (S : Finset (Obs t)) : Prop := (∀ u ∈ S, ∀ v ∈ S, u.party = v.party → u = v) ∧ (∀ u ∈ S, ∀ v ∈ S, SharedAgree u v) /-- Paper Definition 2.4 together with Appendix A: for the triangle the injectable sets are exactly the subsets of copied triangles. This characterization is the working definition here; `Main.injectable_iff_injectableRaw` records its equivalence with `InjectableRaw`. -/ +@[expose] def Injectable {t : ℕ} (S : Finset (Obs t)) : Prop := ∃ i j k : Fin t, S ⊆ copiedTriangle i j k /-- The restriction of an assignment to a set of copied observations. -/ +@[expose] def restrictAssign {t : ℕ} (S : Finset (Obs t)) (ω : Assign t) : S → Bool := fun v => ω v.1 /-- The outcome pattern that a three-bit law prescribes on an injectable set: each member reads the bit of the party it is a copy of. -/ +@[expose] def partyRead {t : ℕ} (S : Finset (Obs t)) (w : ThreeBit) : S → Bool := fun v => partyBit v.1.party w @@ -242,6 +267,7 @@ abbrev Root (t : ℕ) := Cell t ⊕ Obs t /-- `onLine v c` says the cell `c` lies on the line `Λ(v)` read by the observation `v`: `Λ(A^{ij}) = {(i,j,k) : k ∈ [t]}`, `Λ(B^{ik}) = {(i,j,k) : j ∈ [t]}`, `Λ(C^{jk}) = {(i,j,k) : i ∈ [t]}` (paper Section 5.1). -/ +@[expose] def onLine {t : ℕ} : Obs t → Cell t → Bool | .A i j, c => (c.1 == i) && (c.2.1 == j) | .B i k, c => (c.1 == i) && (c.2.2 == k) @@ -249,21 +275,25 @@ def onLine {t : ℕ} : Obs t → Cell t → Bool /-- The output map of paper equation (eq:outputs): an observation outputs `1` exactly when its private bit and every defect on its line are `0`. -/ +@[expose] def outputs {t : ℕ} (d : Cell t → Bool) (N : Obs t → Bool) : Assign t := fun v => decide (N v = false ∧ ∀ c : Cell t, onLine v c = true → d c = false) /-- The output map read off a joint root assignment. -/ +@[expose] def outputsOf {t : ℕ} (x : Root t → Bool) : Assign t := outputs (fun c => x (Sum.inl c)) (fun v => x (Sum.inr v)) /-- The root bits that a set of copied observations reads: the defect cells on their lines, together with their own private bits (paper Lemma 5.4, "disjoint inputs"). -/ +@[expose] def rootSupport {t : ℕ} (S : Finset (Obs t)) : Finset (Root t) := (Finset.univ.filter (fun c : Cell t => ∃ v ∈ S, onLine v c = true)).image Sum.inl ∪ S.image Sum.inr /-- `R_l`, the union of the three lines of the diagonal triangle `Δ_{lll}`: the cells with at least two coordinates equal to `l` (paper equation (eq:Rl)). -/ +@[expose] def inDiagRegion {t : ℕ} (l : Fin t) (c : Cell t) : Bool := onLine (Obs.A l l) c || onLine (Obs.B l l) c || onLine (Obs.C l l) c @@ -273,32 +303,40 @@ section /-! ## The paper's explicit laws -/ /-- `Bern(r)`, with `Bern(r)(true) = r`. -/ +@[expose] def bern (r : ℝ) : Bool → ℝ := fun b => if b then r else 1 - r /-- Paper equation (eq:Q): `Q(ε,r) = ε δ_{000} + (1-ε) Bern(r)^{⊗3}`. -/ +@[expose] def Q (ε r : ℝ) : ThreeBit → ℝ := fun w => ε * (if w = (false, false, false) then 1 else 0) + (1 - ε) * (bern r w.1 * bern r w.2.1 * bern r w.2.2) /-- `ε_t = 1/(2t³)` (paper Theorem 5.2). -/ +@[expose] def epsFam (t : ℕ) : ℝ := 1 / (2 * (t : ℝ) ^ 3) /-- `r_t = (1 - ε_t)^{t-1}` (paper Theorem 5.2). -/ +@[expose] def rFam (t : ℕ) : ℝ := (1 - epsFam t) ^ (t - 1) /-- The nontermination family `P_t = Q(ε_t, r_t)` (paper Theorem 5.2). -/ +@[expose] def Pfam (t : ℕ) : ThreeBit → ℝ := Q (epsFam t) (rFam t) /-- The divergent-rejecting-order family `P_ε = Q(ε, 1 - ε^{2/3}/2)` (paper Proposition 5.13). -/ +@[expose] def Peps (ε : ℝ) : ThreeBit → ℝ := Q ε (1 - ε ^ ((2 : ℝ) / 3) / 2) /-- `R_p = (1-p) δ_{111} + p δ_{000}` (paper Proposition 5.12). -/ +@[expose] def Rlaw (p : ℝ) : ThreeBit → ℝ := fun w => (1 - p) * (if w = (true, true, true) then 1 else 0) + p * (if w = (false, false, false) then 1 else 0) /-- `s = 1 - r/(1-ε)^{t-1}`, the private-bit parameter of paper equation (eq:s). -/ +@[expose] def sParam (t : ℕ) (ε r : ℝ) : ℝ := 1 - r / (1 - ε) ^ (t - 1) /-! ## Triangle compatibility -/ @@ -332,10 +370,12 @@ structure TriangleModel where attribute [instance] TriangleModel.fintypeX TriangleModel.fintypeY TriangleModel.fintypeZ /-- The response law of a party: probability `q` of the outcome `0 = false`. -/ +@[expose] def respMass (q : ℝ) : Bool → ℝ := fun b => if b then 1 - q else q /-- A triangle model is valid when the three source weights are laws and the three response probabilities take values in `[0,1]`. -/ +@[expose] def TriangleModel.Valid (M : TriangleModel) : Prop := IsLaw M.μX ∧ IsLaw M.μY ∧ IsLaw M.μZ ∧ (∀ p, 0 ≤ M.f p ∧ M.f p ≤ 1) ∧ (∀ p, 0 ≤ M.g p ∧ M.g p ≤ 1) ∧ @@ -343,6 +383,7 @@ def TriangleModel.Valid (M : TriangleModel) : Prop := /-- The observed law of a triangle model: the sources are independent and the responses are conditionally independent given the sources (paper Section 2.3). -/ +@[expose] def TriangleModel.law (M : TriangleModel) : ThreeBit → ℝ := fun w => ∑ x : M.X, ∑ y : M.Y, ∑ z : M.Z, M.μX x * M.μY y * M.μZ z @@ -350,6 +391,7 @@ def TriangleModel.law (M : TriangleModel) : ThreeBit → ℝ := fun w => /-- Paper Section 2.3: the triangle-compatible set `C_tri`, with the finite-latent-alphabet formalization boundary described in the file header. -/ +@[expose] def TriangleCompatible (P : ThreeBit → ℝ) : Prop := ∃ M : TriangleModel, M.Valid ∧ M.law = P @@ -358,12 +400,14 @@ def TriangleCompatible (P : ThreeBit → ℝ) : Prop := /-- Paper Definition 2.3: the Navascués–Wolfe feasible set `I^NW_t`. A law `Γ_t` on the copied observations, invariant under `S_t³`, whose diagonal law is the tensor power `P^{⊗t}`. -/ +@[expose] def NWFeasible (t : ℕ) (P : ThreeBit → ℝ) : Prop := ∃ Γ : Assign t → ℝ, IsLaw Γ ∧ SymmetricLaw t Γ ∧ pushforward Γ readDiagonal = tensorPow t P /-- The injectable-marginal prescriptions of paper Definition 2.4: every injectable set has the corresponding marginal of `P`. -/ +@[expose] def InjectableMarginals (t : ℕ) (Γ : Assign t → ℝ) (P : ThreeBit → ℝ) : Prop := ∀ S : Finset (Obs t), Injectable S → pushforward Γ (restrictAssign S) = pushforward P (partyRead S) @@ -372,6 +416,7 @@ def InjectableMarginals (t : ℕ) (Γ : Assign t → ℝ) (P : ThreeBit → ℝ) pairwise ancestrally independent injectable sets has the product of the corresponding marginals. The union is presented as a finite family, whose joint restriction law is required to factor. -/ +@[expose] def AncestralProducts (t : ℕ) (Γ : Assign t → ℝ) (P : ThreeBit → ℝ) : Prop := ∀ (n : ℕ) (S : Fin n → Finset (Obs t)), (∀ m, Injectable (S m)) → (∀ m m', m ≠ m' → AncestrallyIndependent (S m) (S m')) → @@ -380,6 +425,7 @@ def AncestralProducts (t : ℕ) (Γ : Assign t → ℝ) (P : ThreeBit → ℝ) : ∏ m : Fin n, pushforward P (partyRead (S m)) (φ m) /-- Paper Definition 2.4: the ancestral-independence feasible set `I^AI_t`. -/ +@[expose] def AIFeasible (t : ℕ) (P : ThreeBit → ℝ) : Prop := ∃ Γ : Assign t → ℝ, IsLaw Γ ∧ SymmetricLaw t Γ ∧ pushforward Γ readDiagonal = tensorPow t P ∧ @@ -388,17 +434,20 @@ def AIFeasible (t : ℕ) (P : ThreeBit → ℝ) : Prop := /-! ## The defect-cube witness -/ /-- The per-root Bernoulli weights: defects are `Bern(ε)`, private bits are `Bern(s)`. -/ +@[expose] def rootWeight (t : ℕ) (ε s : ℝ) : Root t → Bool → ℝ | Sum.inl _ => bern ε | Sum.inr _ => bern s /-- The joint law of the independent root bits of the defect cube. -/ +@[expose] def rootLaw (t : ℕ) (ε s : ℝ) : (Root t → Bool) → ℝ := prodLaw (rootWeight t ε s) /-- Paper Section 5.1: the defect-cube law `Γ_t`, the pushforward of the independent defect and private bits under the output map (eq:outputs). Unfolding `pushforward` and `prodLaw` gives the explicit finite sum of product weights of paper equation (eq:table): `Γ_t(w) = ∑_{x : outputsOf x = w} ∏_{roots} bern _ (x _)`. -/ +@[expose] def defectLaw (t : ℕ) (ε s : ℝ) : Assign t → ℝ := pushforward (rootLaw t ε s) outputsOf @@ -412,9 +461,11 @@ formalized here. Every statement about `t_min` below therefore either exhibits a order or assumes one. -/ /-- `t_min^NW(P)`, the first order of the Navascués–Wolfe hierarchy that rejects `P`. -/ +@[expose] def tminNW (P : ThreeBit → ℝ) : ℕ := sInf {t : ℕ | 1 ≤ t ∧ ¬ NWFeasible t P} /-- `t_min^AI(P)`, the first order of the ancestral-independence hierarchy that rejects `P`. -/ +@[expose] def tminAI (P : ThreeBit → ℝ) : ℕ := sInf {t : ℕ | 1 ≤ t ∧ ¬ AIFeasible t P} end diff --git a/LeanPool/InflationTermination/TriangleInflation/Exponent.lean b/LeanPool/InflationTermination/TriangleInflation/Exponent.lean index fd9eb77e51..cb1bfb2123 100644 --- a/LeanPool/InflationTermination/TriangleInflation/Exponent.lean +++ b/LeanPool/InflationTermination/TriangleInflation/Exponent.lean @@ -20,7 +20,7 @@ is the finiteness of `t_min` (which the paper quotes from the asymptotic complet Navascués–Wolfe hierarchy). Only the explicit finite bounds are stated. -/ -@[expose] public section +public section namespace TriangleInflation @@ -30,6 +30,7 @@ noncomputable section /-- `σ = ½ ε^{2/3}`, so that `P_ε = Q(ε, 1 - σ)` (paper Proposition 5.13). -/ +@[expose] def sigmaEps (ε : ℝ) : ℝ := ε ^ ((2 : ℝ) / 3) / 2 /-- `m = ε + (1-ε)σ`, the common one-variable zero marginal of `P_ε`. -/ diff --git a/LeanPool/InflationTermination/TriangleInflation/Fan.lean b/LeanPool/InflationTermination/TriangleInflation/Fan.lean index 1d535122d3..0ce26c5e38 100644 --- a/LeanPool/InflationTermination/TriangleInflation/Fan.lean +++ b/LeanPool/InflationTermination/TriangleInflation/Fan.lean @@ -16,7 +16,7 @@ Statements for paper Section 5.4: Theorem 5.11 (`thm:fan`) with its pointwise ce (`prop:Rp`). Proofs are deferred. -/ -@[expose] public section +public section namespace TriangleInflation @@ -670,7 +670,35 @@ private lemma pushforward_equiv {α β γ : Type*} [Fintype α] [Fintype β] [De private lemma obs_one_not_disjoint (u v : Obs 1) : ¬ Disjoint (Obs.ancestors u) (Obs.ancestors v) := by - revert u v; decide + have cases_one (w : Obs 1) : + w = Obs.A 0 0 ∨ w = Obs.B 0 0 ∨ w = Obs.C 0 0 := by + cases w with + | A i j => + left + have hi : i = 0 := Subsingleton.elim _ _ + have hj : j = 0 := Subsingleton.elim _ _ + subst i + subst j + rfl + | B i k => + right + left + have hi : i = 0 := Subsingleton.elim _ _ + have hk : k = 0 := Subsingleton.elim _ _ + subst i + subst k + rfl + | C j k => + right + right + have hj : j = 0 := Subsingleton.elim _ _ + have hk : k = 0 := Subsingleton.elim _ _ + subst j + subst k + rfl + rcases cases_one u with rfl | rfl | rfl <;> + rcases cases_one v with rfl | rfl | rfl <;> + simp [Obs.ancestors, Finset.disjoint_left] private lemma symmetric_one {P : ThreeBit → ℝ} : SymmetricLaw 1 (fun ω => P (assignOneEquiv ω)) := by diff --git a/LeanPool/InflationTermination/TriangleInflation/FiniteWeights.lean b/LeanPool/InflationTermination/TriangleInflation/FiniteWeights.lean index c192140990..45fec0eae4 100644 --- a/LeanPool/InflationTermination/TriangleInflation/FiniteWeights.lean +++ b/LeanPool/InflationTermination/TriangleInflation/FiniteWeights.lean @@ -18,7 +18,7 @@ positivity nor additive inverses. The original real and complex APIs specialize common toolkit while retaining their existing weight definitions. -/ -@[expose] public section +public section namespace TriangleInflation.FiniteWeights @@ -27,10 +27,12 @@ open Finset variable {R : Type*} [CommSemiring R] /-- Pushforward sums a finite weight over each fibre of a map. -/ +@[expose] def pushforward {α β : Type*} [Fintype α] [DecidableEq β] (w : α → R) (F : α → β) : β → R := fun b => ∑ a : α, if F a = b then w a else 0 /-- The product of the weights of a Boolean coordinate configuration. -/ +@[expose] def prodLaw {ι : Type*} [Fintype ι] (w : ι → Bool → R) : (ι → Bool) → R := fun x => ∏ i, w i (x i) @@ -187,6 +189,7 @@ variable {ι : Type*} [Fintype ι] [DecidableEq ι] {A : ι → Type*} [∀ i, F variable {w : ∀ i, A i → R} /-- The product weight of independent coordinates with dependent alphabets. -/ +@[expose] def dprod (w : ∀ i, A i → R) (x : ∀ i, A i) : R := ∏ i, w i (x i) /-- A product of normalized coordinate weights has total mass one. -/ @@ -195,6 +198,7 @@ theorem sum_dprod (hw : ∀ i, ∑ a, w i a = 1) : ∑ x : (∀ i, A i), dprod w exact Finset.prod_eq_one fun i _ => hw i /-- `dmix I x y` takes its `I`-coordinates from `x` and the others from `y`. -/ +@[expose] def dmix (I : Finset ι) (x y : ∀ i, A i) : ∀ i, A i := fun i => if i ∈ I then x i else y i omit [Fintype ι] [∀ i, Fintype (A i)] in diff --git a/LeanPool/InflationTermination/TriangleInflation/Finner.lean b/LeanPool/InflationTermination/TriangleInflation/Finner.lean index 3032d0e18e..7b8b418015 100644 --- a/LeanPool/InflationTermination/TriangleInflation/Finner.lean +++ b/LeanPool/InflationTermination/TriangleInflation/Finner.lean @@ -19,7 +19,7 @@ This file also collects the basic normalization facts about the weight functions `Defs.lean`, which the later files use. -/ -@[expose] public section +public section namespace TriangleInflation @@ -79,8 +79,10 @@ theorem Q_isLaw {ε r : ℝ} (hε0 : 0 ≤ ε) (hε1 : ε ≤ 1) (hr0 : 0 ≤ r) /-- `R_p` is a law for `p ∈ [0,1]` (paper Proposition 5.12). -/ theorem Rlaw_isLaw {p : ℝ} (h0 : 0 ≤ p) (h1 : p ≤ 1) : IsLaw (Rlaw p) := by refine ⟨fun w => ?_, ?_⟩ - · have h1' : (0:ℝ) ≤ 1 - p := by linarith - refine add_nonneg (mul_nonneg h1' ?_) (mul_nonneg h0 ?_) <;> (split <;> norm_num) + · dsimp [Rlaw] + apply add_nonneg + · exact mul_nonneg (by linarith) (by split <;> norm_num) + · exact mul_nonneg h0 (by split <;> norm_num) · simp only [Rlaw, Fintype.sum_prod_type, Fintype.sum_bool] norm_num diff --git a/LeanPool/InflationTermination/TriangleInflation/FinnerMeasure.lean b/LeanPool/InflationTermination/TriangleInflation/FinnerMeasure.lean index c827b25238..67b2a9f3b9 100644 --- a/LeanPool/InflationTermination/TriangleInflation/FinnerMeasure.lean +++ b/LeanPool/InflationTermination/TriangleInflation/FinnerMeasure.lean @@ -59,7 +59,7 @@ The membership half of the paper (the inflation witnesses) is untouched: it is a about finite inflation hierarchies and carries no latent-alphabet hypothesis. -/ -@[expose] public section +public section namespace TriangleInflation diff --git a/LeanPool/InflationTermination/TriangleInflation/Graph/Classification.lean b/LeanPool/InflationTermination/TriangleInflation/Graph/Classification.lean index 03e16f783f..5f430b80dd 100644 --- a/LeanPool/InflationTermination/TriangleInflation/Graph/Classification.lean +++ b/LeanPool/InflationTermination/TriangleInflation/Graph/Classification.lean @@ -21,7 +21,7 @@ named cycle and path scenarios, the fact that a target passing the order-`t` tes the total variation cost of a local flip, and the passage to a connected component. -/ -@[expose] public section +public section namespace TriangleInflation.Graph @@ -282,6 +282,7 @@ theorem exists_bad_component (Γ : PairGraph) (hnot : ¬ IsDoubleStarForest Γ.G ((SimpleGraph.ConnectedComponent.connected_toSimpleGraph _).preconnected _ _) /-- The pair-source scenario carried by one connected component. -/ +@[expose] noncomputable def componentPairGraph (Γ : PairGraph) (C : Γ.G.ConnectedComponent) : PairGraph where V := C diff --git a/LeanPool/InflationTermination/TriangleInflation/Graph/ClassificationTheorem.lean b/LeanPool/InflationTermination/TriangleInflation/Graph/ClassificationTheorem.lean index d73c0f16b6..b5fa7ff7e1 100644 --- a/LeanPool/InflationTermination/TriangleInflation/Graph/ClassificationTheorem.lean +++ b/LeanPool/InflationTermination/TriangleInflation/Graph/ClassificationTheorem.lean @@ -23,7 +23,7 @@ assembled from the cycle and five-path witnesses, transport, exhaustion, and loc Everything here is proved. -/ -@[expose] public section +public section namespace TriangleInflation.Graph diff --git a/LeanPool/InflationTermination/TriangleInflation/Graph/CycleObstruction.lean b/LeanPool/InflationTermination/TriangleInflation/Graph/CycleObstruction.lean index 11078e5535..b3431f4fa9 100644 --- a/LeanPool/InflationTermination/TriangleInflation/Graph/CycleObstruction.lean +++ b/LeanPool/InflationTermination/TriangleInflation/Graph/CycleObstruction.lean @@ -19,7 +19,7 @@ parity rigidity `CycleModelAux.quant_rigidity` (Lemma `lem:quantrigidity`). Ever is proved. -/ -@[expose] public section +public section namespace TriangleInflation.Graph @@ -58,6 +58,7 @@ section Av variable {X : Type*} [Fintype X] {μ f g : X → ℝ} /-- Weighted average of a function over a finite latent alphabet. -/ +@[expose] def av {X : Type*} [Fintype X] (μ f : X → ℝ) : ℝ := ∑ x, μ x * f x theorem av_mono (hμ : ∀ x, 0 ≤ μ x) (h : ∀ x, f x ≤ g x) : av μ f ≤ av μ g := @@ -546,6 +547,7 @@ theorem adj_of_mem_edgeFinset (hm : 3 ≤ m) {a b : Fin m} rwa [SimpleGraph.mem_edgeFinset, SimpleGraph.mem_edgeSet] at h2 /-- The edge of the cycle recorded by its lower endpoint. -/ +@[expose] def cEdge (m : ℕ) (hm : 3 ≤ m) (i : Fin m) : (cycle m hm).Edge := CycleWitnessAux.ce hm i diff --git a/LeanPool/InflationTermination/TriangleInflation/Graph/CycleWitness.lean b/LeanPool/InflationTermination/TriangleInflation/Graph/CycleWitness.lean index 61bb482fc2..5b6c2fdab2 100644 --- a/LeanPool/InflationTermination/TriangleInflation/Graph/CycleWitness.lean +++ b/LeanPool/InflationTermination/TriangleInflation/Graph/CycleWitness.lean @@ -16,7 +16,7 @@ The auxiliary-sign construction of AUDIT-NOTES A5 and Lemma `lem:cyclewitness` o `papers/inflation-nontermination/paper/sections/15-cycles.tex`. -/ -@[expose] public section +public section namespace TriangleInflation.Graph @@ -433,7 +433,7 @@ section CycleStructure variable {m : ℕ} /-- The predecessor vertex on the cycle. -/ -def cyclePrev (v : Fin m) : Fin m := ⟨(v.val + (m - 1)) % m, Nat.mod_lt _ v.pos⟩ +@[expose] def cyclePrev (v : Fin m) : Fin m := ⟨(v.val + (m - 1)) % m, Nat.mod_lt _ v.pos⟩ theorem cycleNext_cyclePrev (v : Fin m) : cycleNext (cyclePrev v) = v := by have hm : 0 < m := v.pos @@ -483,7 +483,7 @@ theorem cycleAdj_next (hm : 2 ≤ m) (v : Fin m) : (cycleAdj m).Adj v (cycleNext ⟨(cycleNext_ne hm v).symm, Or.inl rfl⟩ /-- The source of the cycle recorded by its lower endpoint: the edge `{j, j+1}`. -/ -def ce (hm : 3 ≤ m) (j : Fin m) : (cycle m hm).Edge := +@[expose] def ce (hm : 3 ≤ m) (j : Fin m) : (cycle m hm).Edge := ⟨s(j, cycleNext j), by change s(j, cycleNext j) ∈ (cycleAdj m).edgeFinset simp only [SimpleGraph.mem_edgeFinset, SimpleGraph.mem_edgeSet] @@ -602,7 +602,7 @@ variable {m t : ℕ} /-- The vertices of the cycle scenario are `Fin m`; this is that identification, written out so that equations between vertices elaborate at the type `Fin m`. -/ -def vtx (hm : 3 ≤ m) (v : (cycle m hm).V) : Fin m := v +@[expose] def vtx (hm : 3 ≤ m) (v : (cycle m hm).V) : Fin m := v theorem vtx_copyObs (hm : 3 ≤ m) (ι : (cycle m hm).Edge → Fin t) (v : Fin m) : vtx hm (copyObs ι v).1 = v := rfl diff --git a/LeanPool/InflationTermination/TriangleInflation/Graph/Cycles.lean b/LeanPool/InflationTermination/TriangleInflation/Graph/Cycles.lean index e1af4cb48a..d34659bcb3 100644 --- a/LeanPool/InflationTermination/TriangleInflation/Graph/Cycles.lean +++ b/LeanPool/InflationTermination/TriangleInflation/Graph/Cycles.lean @@ -20,7 +20,7 @@ The Walsh section is general Boolean-cube Fourier analysis (orthogonality, inver uniqueness) and is reusable by the other pair-source files. -/ -@[expose] public section +public section namespace TriangleInflation.Graph @@ -136,7 +136,7 @@ variable {m : ℕ} /-- The successor vertex on the cycle `C_m`. The edge recorded by `v` joins `v` and `cycleNext v`. -/ -def cycleNext (v : Fin m) : Fin m := ⟨(v.val + 1) % m, Nat.mod_lt _ v.pos⟩ +@[expose] def cycleNext (v : Fin m) : Fin m := ⟨(v.val + 1) % m, Nat.mod_lt _ v.pos⟩ theorem mem_cycleBoundary (F : Finset (Fin m)) (v : Fin m) : v ∈ cycleBoundary m F ↔ ¬((v ∈ F) ↔ (cycleNext v ∈ F)) := by diff --git a/LeanPool/InflationTermination/TriangleInflation/Graph/Defs.lean b/LeanPool/InflationTermination/TriangleInflation/Graph/Defs.lean index bad325dcda..9a280cf69d 100644 --- a/LeanPool/InflationTermination/TriangleInflation/Graph/Defs.lean +++ b/LeanPool/InflationTermination/TriangleInflation/Graph/Defs.lean @@ -71,7 +71,7 @@ yet proved). it assumes the conditioning cell is positive. -/ -@[expose] public section +public section namespace TriangleInflation.Graph @@ -99,6 +99,7 @@ attribute [instance] PairGraph.fintypeV PairGraph.decEqV PairGraph.decAdj abbrev PairGraph.Edge (Γ : PairGraph) := {e : Sym2 Γ.V // e ∈ Γ.G.edgeFinset} /-- The sources incident to a vertex. -/ +@[expose] def PairGraph.inc (Γ : PairGraph) (v : Γ.V) : Finset Γ.Edge := Finset.univ.filter (fun e => v ∈ (e.1 : Sym2 Γ.V)) @@ -120,15 +121,18 @@ abbrev GLatent (Γ : PairGraph) (t : ℕ) := Γ.Edge × Fin t variable {Γ : PairGraph} {t : ℕ} /-- The action of a per-source permutation of copy indices on copied observations. -/ +@[expose] def gPerm (π : Γ.Edge → Equiv.Perm (Fin t)) (o : GObs Γ t) : GObs Γ t := ⟨o.1, fun e => π e.1 (o.2 e)⟩ /-- The induced action on assignments. -/ +@[expose] def gRelabel (π : Γ.Edge → Equiv.Perm (Fin t)) (ω : GAssign Γ t) : GAssign Γ t := fun o => ω (gPerm π o) /-- Symmetry of a witness under independent permutations of the copy indices of each source (AUDIT-NOTES A1; the pair-source form of `TriangleInflation.SymmetricLaw`). -/ +@[expose] def GSymmetric (t : ℕ) (Δ : GAssign Γ t → ℝ) : Prop := ∀ (π : Γ.Edge → Equiv.Perm (Fin t)) (ω : GAssign Γ t), Δ (gRelabel π ω) = Δ ω @@ -136,19 +140,24 @@ def GSymmetric (t : ℕ) (Δ : GAssign Γ t → ℝ) : Prop := /-- The copied observation of the vertex `v` in the copy of the original scenario selected by the index vector `ι`. -/ +@[expose] def copyObs (ι : Γ.Edge → Fin t) (v : Γ.V) : GObs Γ t := ⟨v, fun e => ι e.1⟩ /-- The copied original scenario selected by `ι`: one copied observation per vertex. -/ +@[expose] def copySet (ι : Γ.Edge → Fin t) : Finset (GObs Γ t) := Finset.univ.image (copyObs ι) /-- The observed outcome that an assignment gives to the copied scenario selected by `ι`. -/ +@[expose] def readCopy (ι : Γ.Edge → Fin t) (ω : GAssign Γ t) : Γ.V → Bool := fun v => ω (copyObs ι v) /-- The `t` diagonal rows: row `r` takes the copy index `r` on every source (AUDIT-NOTES A1). -/ +@[expose] def readDiag (ω : GAssign Γ t) : Fin t → (Γ.V → Bool) := fun r => readCopy (fun _ => r) ω /-- The `t`-fold tensor power of a target law. -/ +@[expose] def gTensorPow (t : ℕ) (P : GTarget Γ) : (Fin t → (Γ.V → Bool)) → ℝ := fun v => ∏ r : Fin t, P (v r) @@ -156,15 +165,18 @@ def gTensorPow (t : ℕ) (P : GTarget Γ) : (Fin t → (Γ.V → Bool)) → ℝ /-- The copied latent ancestors of a copied observation: for each incident source, the copy selected by that observation. -/ +@[expose] def gAncestors (o : GObs Γ t) : Finset (GLatent Γ t) := (Finset.univ : Finset (Γ.inc o.1)).image (fun e => (e.1, o.2 e)) /-- The copied latent ancestors of a set of copied observations. -/ +@[expose] def gAncestorsOf (S : Finset (GObs Γ t)) : Finset (GLatent Γ t) := S.biUnion gAncestors /-- Two sets of copied observations are ancestrally independent when their copied latent ancestors are disjoint (`TriangleInflation.AncestrallyIndependent` for a general pair graph). -/ +@[expose] def GAncestrallyIndependent (S T : Finset (GObs Γ t)) : Prop := Disjoint (gAncestorsOf S) (gAncestorsOf T) @@ -176,9 +188,11 @@ def edgesOf (S : Finset (GObs Γ t)) : Finset Γ.Edge := S.biUnion (fun o => Γ. /-- The working definition of injectability: a set of copied observations lies inside one copied original scenario. -/ +@[expose] def GInjectable (S : Finset (GObs Γ t)) : Prop := ∃ ι : Γ.Edge → Fin t, S ⊆ copySet ι /-- Two copied observations agree in the copy index of every source incident to both. -/ +@[expose] def GSharedAgree (o p : GObs Γ t) : Prop := ∀ (e : Γ.Edge) (ho : e ∈ Γ.inc o.1) (hp : e ∈ Γ.inc p.1), o.2 ⟨e, ho⟩ = p.2 ⟨e, hp⟩ @@ -186,35 +200,42 @@ def GSharedAgree (o p : GObs Γ t) : Prop := erasing copy indices is injective on the set, and any two members agree in the copy index of every shared source. `Statements.gInjectable_iff_raw` records the equivalence with `GInjectable`, as `TriangleInflation.injectable_iff_injectableRaw` does for the triangle. -/ +@[expose] def GInjectableRaw (S : Finset (GObs Γ t)) : Prop := (∀ o ∈ S, ∀ p ∈ S, o.1 = p.1 → o = p) ∧ (∀ o ∈ S, ∀ p ∈ S, GSharedAgree o p) /-- The restriction of an assignment to a set of copied observations. -/ +@[expose] def gRestrict (S : Finset (GObs Γ t)) (ω : GAssign Γ t) : S → Bool := fun o => ω o.1 /-- The outcome pattern that a target law prescribes on a set of copied observations: each member reads the bit of the vertex it is a copy of. -/ +@[expose] def gPartyRead (S : Finset (GObs Γ t)) (w : Γ.V → Bool) : S → Bool := fun o => w o.1.1 /-- The restriction map between laws on nested sets of copied observations. -/ +@[expose] def subRestrict {S T : Finset (GObs Γ t)} (h : S ⊆ T) (φ : T → Bool) : S → Bool := fun o => φ ⟨o.1, h o.2⟩ /-- Reading a block inside an ambient set. When `B ⊆ S` this is `subRestrict`; the `else` branch is unreachable and is present only so that the block may be given as a bare `Finset`, without carrying the inclusion proof. -/ +@[expose] def readOnBlock (B S : Finset (GObs Γ t)) (φ : S → Bool) : B → Bool := fun o => if h : o.1 ∈ S then φ ⟨o.1, h⟩ else false /-! ## The finite inflation tests -/ /-- Every injectable set carries the corresponding marginal of the target. -/ +@[expose] def GInjectableMarginals (t : ℕ) (Δ : GAssign Γ t → ℝ) (P : GTarget Γ) : Prop := ∀ S : Finset (GObs Γ t), GInjectable S → pushforward Δ (gRestrict S) = pushforward P (gPartyRead S) /-- Every finite family of pairwise ancestrally independent injectable sets carries the product of the corresponding marginals. -/ +@[expose] def GAncestralProducts (t : ℕ) (Δ : GAssign Γ t → ℝ) (P : GTarget Γ) : Prop := ∀ (n : ℕ) (S : Fin n → Finset (GObs Γ t)), (∀ m, GInjectable (S m)) → (∀ m m', m ≠ m' → GAncestrallyIndependent (S m) (S m')) → @@ -224,10 +245,12 @@ def GAncestralProducts (t : ℕ) (Δ : GAssign Γ t → ℝ) (P : GTarget Γ) : /-- The Navascués–Wolfe feasible set of a pair-source scenario (AUDIT-NOTES A1): a symmetric law on the copied observations whose diagonal law is the tensor power of the target. -/ +@[expose] def GNWFeasible (Γ : PairGraph) (t : ℕ) (P : GTarget Γ) : Prop := ∃ Δ : GAssign Γ t → ℝ, IsLaw Δ ∧ GSymmetric t Δ ∧ pushforward Δ readDiag = gTensorPow t P /-- The ancestral-independence feasible set of a pair-source scenario (AUDIT-NOTES A1). -/ +@[expose] def GAIFeasible (Γ : PairGraph) (t : ℕ) (P : GTarget Γ) : Prop := ∃ Δ : GAssign Γ t → ℝ, IsLaw Δ ∧ GSymmetric t Δ ∧ pushforward Δ readDiag = gTensorPow t P ∧ @@ -240,11 +263,13 @@ roots, the copied observations are sinks, and the parents of a copied observatio its `gAncestors`. -/ /-- Two copied observations share a copied latent parent. -/ +@[expose] def SharesParent (o p : GObs Γ t) : Prop := ¬ Disjoint (gAncestors o) (gAncestors p) /-- A trail from `X` to `Y` that is active given `Z`: a sequence of copied observations `o₀ ∈ X`, `mid`, `o₁ ∈ Y` (so of length at least two) in which consecutive members share a copied latent parent and every internal member lies in `Z`. -/ +@[expose] def ActiveTrail (X Y Z : Finset (GObs Γ t)) (o₀ : GObs Γ t) (mid : List (GObs Γ t)) (o₁ : GObs Γ t) : Prop := o₀ ∈ X ∧ o₁ ∈ Y ∧ (∀ o ∈ mid, o ∈ Z) ∧ List.IsChain SharesParent (o₀ :: (mid ++ [o₁])) @@ -263,6 +288,7 @@ AUDIT-NOTES A2 corrects the packet's stated criterion ("no component of the shar graph on `X ∪ Y ∪ Z` meets both `X` and `Y`", which is only sufficient); this definition is the corrected trail criterion, and the component statement becomes a theorem for AI sets (`Statements.expressible_iff_ai`). -/ +@[expose] def dsep (X Y Z : Finset (GObs Γ t)) : Prop := ∀ o₀ mid o₁, ¬ ActiveTrail X Y Z o₀ mid o₁ theorem sub_left_union (X Y Z : Finset (GObs Γ t)) : X ∪ Z ⊆ X ∪ Y ∪ Z := by @@ -282,6 +308,7 @@ section `μ(x,y,z) = μ₁(x,z) μ₂(y,z) / μ_Z(z)` when the common `Z`-marginal `μ_Z(z)` is positive, and `0` otherwise. `μ_Z` is taken as the `Z`-marginal of `μ₁`; on the sets where the rule is applied the two marginals agree. -/ +@[expose] def glueLaw (X Y Z : Finset (GObs Γ t)) (μ₁ : ((X ∪ Z : Finset (GObs Γ t)) → Bool) → ℝ) (μ₂ : ((Y ∪ Z : Finset (GObs Γ t)) → Bool) → ℝ) : @@ -316,6 +343,7 @@ end /-- The recursively expressible feasible set of a pair-source scenario (paper Definition 2.3). -/ +@[expose] def GExpFeasible (Γ : PairGraph) (t : ℕ) (P : GTarget Γ) : Prop := ∃ Δ : GAssign Γ t → ℝ, IsLaw Δ ∧ GSymmetric t Δ ∧ pushforward Δ readDiag = gTensorPow t P ∧ @@ -328,12 +356,14 @@ The sets and laws that the ancestral-independence prescriptions cover. AUDIT-NOT identifies these with the recursively expressible ones. -/ /-- Connectivity in the shared-parent graph on a set of copied observations. -/ +@[expose] def sharedComponent (S : Finset (GObs Γ t)) : S → S → Prop := Relation.ReflTransGen (fun a b : S => SharesParent a.1 b.1) /-- An AI set: every connected component of the shared-parent graph on `S` is injectable (AUDIT-NOTES A2). The component of `o` is described by its membership predicate rather than constructed, so that no decidability of `sharedComponent` is needed. -/ +@[expose] def IsAISet (S : Finset (GObs Γ t)) : Prop := ∀ o : S, ∃ B : Finset (GObs Γ t), (∀ p, p ∈ B ↔ ∃ h : p ∈ S, sharedComponent S o ⟨p, h⟩) ∧ GInjectable B @@ -351,6 +381,7 @@ structure AIDecomposition (S : Finset (GObs Γ t)) where /-- The AI product law of a decomposition: the product of the injectable marginals of the blocks. -/ +@[expose] def aiProduct (S : Finset (GObs Γ t)) (D : AIDecomposition S) (P : GTarget Γ) : (S → Bool) → ℝ := fun φ => ∏ m : Fin D.n, pushforward P (gPartyRead (D.block m)) (readOnBlock (D.block m) S φ) @@ -373,23 +404,27 @@ attribute [instance] GModel.fintypeL /-- A model is valid when every source law is a law and every response probability lies in `[0,1]`. -/ +@[expose] def GModel.Valid (M : GModel Γ) : Prop := (∀ e, IsLaw (M.μ e)) ∧ (∀ v c, 0 ≤ M.resp v c ∧ M.resp v c ≤ 1) /-- The observed law of a model: the sources are independent and the responses are conditionally independent given the sources. -/ +@[expose] def GModel.law (M : GModel Γ) : GTarget Γ := fun w => ∑ x : (∀ e : Γ.Edge, M.L e), (∏ e : Γ.Edge, M.μ e (x e)) * ∏ v : Γ.V, respMass (M.resp v (fun e => x e.1)) (w v) /-- The compatible set `C_G` of a pair-source scenario, with the finite-latent-alphabet boundary described in the file header (AUDIT-NOTES D1). -/ +@[expose] def GCompatible (Γ : PairGraph) (P : GTarget Γ) : Prop := ∃ M : GModel Γ, M.Valid ∧ M.law = P /-! ## Named scenarios -/ /-- The path `P_k` on `Fin k`. -/ +@[expose] def pathAdj (k : ℕ) : SimpleGraph (Fin k) where Adj a b := a.val + 1 = b.val ∨ b.val + 1 = a.val symm := ⟨by intro a b h; tauto⟩ @@ -406,6 +441,7 @@ theorem path_no_isolated {k : ℕ} (hk : 2 ≤ k) (v : Fin k) : ∃ w, (pathAdj /-- The cycle `C_m` on `Fin m`. For `m ≥ 3` the adjacency `a ≠ b ∧ (a+1 ≡ b ∨ b+1 ≡ a)` is the `m`-cycle; the explicit `a ≠ b` makes the relation irreflexive for every `m`. -/ +@[expose] def cycleAdj (m : ℕ) : SimpleGraph (Fin m) where Adj a b := a ≠ b ∧ ((a.val + 1) % m = b.val ∨ (b.val + 1) % m = a.val) symm := ⟨by intro a b h; exact ⟨h.1.symm, h.2.symm⟩⟩ @@ -432,6 +468,7 @@ inductive DoubleStarV (p q : ℕ) open DoubleStarV in /-- Adjacency of the double star: the centre edge, and each leaf to its centre. -/ +@[expose] def doubleStarRel (p q : ℕ) : DoubleStarV p q → DoubleStarV p q → Prop | left, right => True | right, left => True @@ -462,10 +499,12 @@ theorem doubleStar_no_isolated (p q : ℕ) (v : DoubleStarV p q) : · exact ⟨DoubleStarV.right, trivial⟩ /-- The path scenario `P_k`, `k ≥ 2`. -/ +@[expose] def path (k : ℕ) (hk : 2 ≤ k) : PairGraph := ⟨Fin k, inferInstance, inferInstance, pathAdj k, inferInstance, path_no_isolated hk⟩ /-- The cycle scenario `C_m`, `m ≥ 3`. -/ +@[expose] def cycle (m : ℕ) (hm : 3 ≤ m) : PairGraph := ⟨Fin m, inferInstance, inferInstance, cycleAdj m, inferInstance, cycle_no_isolated hm⟩ @@ -475,32 +514,39 @@ def doubleStar (p q : ℕ) : PairGraph := doubleStar_no_isolated p q⟩ /-- The triangle scenario, `C₃`. -/ +@[expose] def triangleGraph : PairGraph := cycle 3 (by norm_num) /-- The square scenario, `C₄`. -/ +@[expose] def squareGraph : PairGraph := cycle 4 (by norm_num) /-- The five-observer path `P₅` (AUDIT-NOTES A4). -/ +@[expose] def fivePathGraph : PairGraph := path 5 (by norm_num) /-- A double-star forest: every connected component is a tree of diameter at most three (AUDIT-NOTES A3). Stated as acyclicity together with a diameter bound inside each component. -/ +@[expose] def IsDoubleStarForest {V : Type} (G : SimpleGraph V) : Prop := G.IsAcyclic ∧ ∀ u v : V, G.Reachable u v → G.dist u v ≤ 3 /-! ## Signs, flips and explicit laws -/ /-- The sign of a bit: `sgn false = 1`, `sgn true = -1` (AUDIT-NOTES convention). -/ +@[expose] def sgn (b : Bool) : ℝ := if b then -1 else 1 /-- The kernel of independent flips with probability `η` at every coordinate. -/ +@[expose] def flipKernel {ι : Type} [Fintype ι] (η : ℝ) (x y : ι → Bool) : ℝ := ∏ i, (if x i = y i then 1 - η else η) /-- A law after independent flips of each coordinate with probability `η`. Applied to a target on `Γ.V → Bool` it is the noisy target of AUDIT-NOTES A7; applied to a witness on `GObs Γ t → Bool` it is the local flip of every copied observation. -/ +@[expose] def flipLaw {ι : Type} [Fintype ι] [DecidableEq ι] (η : ℝ) (P : (ι → Bool) → ℝ) : (ι → Bool) → ℝ := fun y => ∑ x, P x * flipKernel η x y @@ -508,9 +554,11 @@ noncomputable section /-- The total variation distance, half the `ℓ¹` distance. -/ +@[expose] def dTV {α : Type*} [Fintype α] (P Q : α → ℝ) : ℝ := (1 / 2) * ∑ a, |P a - Q a| /-- The total variation distance from a target to the compatible set. -/ +@[expose] def distToCompatible (Γ : PairGraph) (P : GTarget Γ) : ℝ := sInf {d : ℝ | ∃ Q : GTarget Γ, GCompatible Γ Q ∧ d = dTV P Q} @@ -518,6 +566,7 @@ def distToCompatible (Γ : PairGraph) (P : GTarget Γ) : ℝ := `P_h(x,b,c,d,z) = (1/32)[1 + bcd (1+h)/4 (1 + (−1)^{x+z})]`, with vertex `0` the left endpoint `A`, vertices `1,2,3` the middle observations `B,C,D` and vertex `4` the right endpoint `E`. -/ +@[expose] def fivePathTarget (h : ℝ) : (Fin 5 → Bool) → ℝ := fun w => (1 / 32) * (1 + sgn (w 1) * sgn (w 2) * sgn (w 3) * ((1 + h) / 4) * (1 + sgn (w 0) * sgn (w 4))) @@ -525,21 +574,25 @@ def fivePathTarget (h : ℝ) : (Fin 5 → Bool) → ℝ := fun w => /-- The conditional correlator `f_{xz} = E[BCD | A = x, E = z]` of AUDIT-NOTES A4. The denominator is the conditioning cell; the value is junk `0` when that cell is null, and every statement about it assumes the cell is positive. -/ +@[expose] def fivePathCorr (P : (Fin 5 → Bool) → ℝ) (x z : Bool) : ℝ := (∑ w : Fin 5 → Bool, if w 0 = x ∧ w 4 = z then sgn (w 1) * sgn (w 2) * sgn (w 3) * P w else 0) / (∑ w : Fin 5 → Bool, if w 0 = x ∧ w 4 = z then P w else 0) /-- `I = ¼ Σ_{x,z} f_{xz}` (AUDIT-NOTES A4). -/ +@[expose] def fivePathI (P : (Fin 5 → Bool) → ℝ) : ℝ := (1 / 4) * ∑ x : Bool, ∑ z : Bool, fivePathCorr P x z /-- `J = ¼ Σ_{x,z} (−1)^{x+z} f_{xz}` (AUDIT-NOTES A4). -/ +@[expose] def fivePathJ (P : (Fin 5 → Bool) → ℝ) : ℝ := (1 / 4) * ∑ x : Bool, ∑ z : Bool, sgn x * sgn z * fivePathCorr P x z /-- The source boundary `∂F` of a set of vertices of the cycle `C_m`, encoded by its lower endpoint: the edge `{v, v+1}` is recorded by `v`, and lies in `∂F` exactly when exactly one of `v`, `v+1` lies in `F` (AUDIT-NOTES A5). -/ +@[expose] def cycleBoundary (m : ℕ) (F : Finset (Fin m)) : Finset (Fin m) := Finset.univ.filter (fun v : Fin m => (v ∈ F) ≠ (⟨(v.val + 1) % m, Nat.mod_lt _ v.pos⟩ ∈ F)) @@ -547,33 +600,39 @@ def cycleBoundary (m : ℕ) (F : Finset (Fin m)) : Finset (Fin m) := /-- The cycle target `P_{m,q}` of AUDIT-NOTES A5, given by its Fourier expansion: the character of `F ⊆ V` has moment `(−q)^{|∂F|/2}`. The boundary has even size, so the natural division is exact. -/ +@[expose] def cycleTarget (m : ℕ) (q : ℝ) : (Fin m → Bool) → ℝ := fun w => (1 / 2 : ℝ) ^ m * ∑ F : Finset (Fin m), (-q) ^ ((cycleBoundary m F).card / 2) * ∏ v ∈ F, sgn (w v) /-- The square parity target of AUDIT-NOTES B2(i): the case `m = 4` of `cycleTarget`. -/ +@[expose] def squareTarget (q : ℝ) : (Fin 4 → Bool) → ℝ := cycleTarget 4 q /-- The parity-perfect triangle target `Π(−q,−q,−q)` of AUDIT-NOTES B2(ii): supported on the even-parity triples, where it equals `(1 − q(α+β+γ))/4` with `α,β,γ` the signs of the three bits. All one- and two-point moments are `−q` and the triple moment is `1`. Stated in the three-bit type of `TriangleInflation`. -/ -def triParity (q : ℝ) : ThreeBit → ℝ := fun w => +@[expose] def triParity (q : ℝ) : ThreeBit → ℝ := fun w => if (xor (xor w.1 w.2.1) w.2.2) = false then (1 - q * (sgn w.1 + sgn w.2.1 + sgn w.2.2)) / 4 else 0 /-- `E[A]` for a three-bit law, in the sign convention. -/ +@[expose] def triMeanA (P : ThreeBit → ℝ) : ℝ := ∑ w : ThreeBit, sgn w.1 * P w /-- `E[B]` for a three-bit law. -/ +@[expose] def triMeanB (P : ThreeBit → ℝ) : ℝ := ∑ w : ThreeBit, sgn w.2.1 * P w /-- `E[C]` for a three-bit law. -/ +@[expose] def triMeanC (P : ThreeBit → ℝ) : ℝ := ∑ w : ThreeBit, sgn w.2.2 * P w /-- The transported target of AUDIT-NOTES A6: the `H`-target on the image of an induced embedding, tensored with fair bits on the remaining vertices of `G`. -/ +@[expose] def transportTarget (G H : PairGraph) (φ : H.V → G.V) (P : GTarget H) : GTarget G := fun w => P (fun u => w (φ u)) * (1 / 2 : ℝ) ^ (Fintype.card G.V - Fintype.card H.V) @@ -588,6 +647,7 @@ and `{1,2}`, the paper's `X` and `Y`) and vertex `2` is `C` (sources `{1,2}` and paper's `Y` and `Z`). -/ /-- The re-encoding of a three-bit outcome as a function on `Fin 3`. -/ +@[expose] def threeBitEquiv : (Fin 3 → Bool) ≃ ThreeBit where toFun w := (w 0, w 1, w 2) invFun x := ![x.1, x.2.1, x.2.2] diff --git a/LeanPool/InflationTermination/TriangleInflation/Graph/DoubleStar.lean b/LeanPool/InflationTermination/TriangleInflation/Graph/DoubleStar.lean index a8a8b6d235..08c6c96776 100644 --- a/LeanPool/InflationTermination/TriangleInflation/Graph/DoubleStar.lean +++ b/LeanPool/InflationTermination/TriangleInflation/Graph/DoubleStar.lean @@ -36,7 +36,7 @@ and the theorem `doubleStar_terminates` assembled from it, live in `InflationGraphOpen/DoubleStar.lean`; everything in this file is proved. -/ -@[expose] public section +public section namespace TriangleInflation.Graph @@ -65,6 +65,7 @@ theorem gRelabel_refl (ω : GAssign Γ t) : /-- Relabelling by `π` is a bijection of assignments, with inverse the relabelling by `π⁻¹`. -/ +@[expose] def gRelabelEquiv (π : Γ.Edge → Equiv.Perm (Fin t)) : GAssign Γ t ≃ GAssign Γ t where toFun := gRelabel π invFun := gRelabel (fun e => (π e)⁻¹) @@ -98,6 +99,7 @@ theorem pushforward_comp_gRelabel {β : Type*} [DecidableEq β] {Δ : GAssign Γ /-- The rows read by a table after relabelling the copy indices of each source: row `r` reads, at every vertex, the copy `π_e r` of each incident source `e`. For `π = 1` these are the `t` diagonal rows. -/ +@[expose] def gTwist (π : Γ.Edge → Equiv.Perm (Fin t)) (ω : GAssign Γ t) : Fin t → (Γ.V → Bool) := fun r v => ω ⟨v, fun e => π e.1 r⟩ @@ -669,6 +671,7 @@ def tableOf (P : GTarget Γ) (ω : GAssign Γ 2) : (Γ.V → Bool) → (Γ.V → /-- The conditioning event of the component with centre source `y`: every leaf of that component has its two copies reading the prescribed array. -/ +@[expose] def evt (P : GTarget Γ) (y : Γ.Edge) (ω : GAssign Γ 2) : Prop := ∀ ℓ ∈ D.leaves y, ∀ m : Fin 2, readDiag ω m ℓ = xarr P ℓ m diff --git a/LeanPool/InflationTermination/TriangleInflation/Graph/DoubleStarForest.lean b/LeanPool/InflationTermination/TriangleInflation/Graph/DoubleStarForest.lean index 7ba8507469..0efb12cfda 100644 --- a/LeanPool/InflationTermination/TriangleInflation/Graph/DoubleStarForest.lean +++ b/LeanPool/InflationTermination/TriangleInflation/Graph/DoubleStarForest.lean @@ -17,7 +17,7 @@ The graph-theoretic step of the double-star reconstruction (AUDIT-NOTES A3, Theo compatibility on such scenarios (`doubleStar_terminates`). Everything here is proved. -/ -@[expose] public section +public section namespace TriangleInflation.Graph @@ -364,6 +364,7 @@ theorem mate_mate {v : Γ.V} (h : v = C.A v ∨ v = C.B v) : C.mate (C.mate v) = /-- The edge that carries a vertex: its unique source when it is a leaf, the centre source of its component when it is a centre. -/ +@[expose] def edgeAt (v : Γ.V) : Γ.Edge := ⟨s(v, C.mate v), by simpa using C.mate_adj v⟩ diff --git a/LeanPool/InflationTermination/TriangleInflation/Graph/FivePath.lean b/LeanPool/InflationTermination/TriangleInflation/Graph/FivePath.lean index 9933539ca1..bca9aa6696 100644 --- a/LeanPool/InflationTermination/TriangleInflation/Graph/FivePath.lean +++ b/LeanPool/InflationTermination/TriangleInflation/Graph/FivePath.lean @@ -23,7 +23,7 @@ coordinates, and the analytic core of the bilocal inequality. Nothing in it chan seven statements below, which appear in their original form. -/ -@[expose] public section +public section namespace TriangleInflation.Graph @@ -36,6 +36,7 @@ variable {Γ : PairGraph} {t : ℕ} namespace FivePathAux /-- Identify a five-bit tuple with a Boolean assignment on five vertices. -/ +@[expose] def fiveEquiv : (Bool × Bool × Bool × Bool × Bool) ≃ (Fin 5 → Bool) where toFun p := ![p.1, p.2.1, p.2.2.1, p.2.2.2.1, p.2.2.2.2] invFun w := (w 0, w 1, w 2, w 3, w 4) @@ -163,12 +164,16 @@ theorem bilocal_core (ν : Λ → ℝ) (ν' : Λ' → ℝ) (hν : IsLaw ν) (hν /-- The source edge joining vertices zero and one. -/ +@[expose] def E01 : fivePathGraph.Edge := ⟨s((0 : Fin 5), (1 : Fin 5)), by decide⟩ /-- The source edge joining vertices one and two. -/ +@[expose] def E12 : fivePathGraph.Edge := ⟨s((1 : Fin 5), (2 : Fin 5)), by decide⟩ /-- The source edge joining vertices two and three. -/ +@[expose] def E23 : fivePathGraph.Edge := ⟨s((2 : Fin 5), (3 : Fin 5)), by decide⟩ /-- The source edge joining vertices three and four. -/ +@[expose] def E34 : fivePathGraph.Edge := ⟨s((3 : Fin 5), (4 : Fin 5)), by decide⟩ theorem edge_cases (e : fivePathGraph.Edge) : e = E01 ∨ e = E12 ∨ e = E23 ∨ e = E34 := by diff --git a/LeanPool/InflationTermination/TriangleInflation/Graph/FivePathWitness.lean b/LeanPool/InflationTermination/TriangleInflation/Graph/FivePathWitness.lean index 2cb0676adb..3861678b30 100644 --- a/LeanPool/InflationTermination/TriangleInflation/Graph/FivePathWitness.lean +++ b/LeanPool/InflationTermination/TriangleInflation/Graph/FivePathWitness.lean @@ -17,7 +17,7 @@ five-path target with `h = 1/(16t²)`, built as the inflated law of a complex-we pair-source model, and its recursively expressible form. Everything here is proved. -/ -@[expose] public section +public section namespace TriangleInflation.Graph @@ -554,6 +554,7 @@ theorem prespR_mem (v : Fin 5) (c : (e : fivePathGraph.inc v) → Bool × Bool) 0 ≤ prespR v c ∧ prespR v c ≤ 1 := pfR_mem _ _ _ _ _ /-- The five-path complex model at auxiliary amplitude `γ`. -/ +@[expose] noncomputable def PM (γ : ℝ) : CModel fivePathGraph where L := fun _ => Bool × Bool fintypeL := fun _ => inferInstance diff --git a/LeanPool/InflationTermination/TriangleInflation/Graph/Flips.lean b/LeanPool/InflationTermination/TriangleInflation/Graph/Flips.lean index 95965577cd..308540862f 100644 --- a/LeanPool/InflationTermination/TriangleInflation/Graph/Flips.lean +++ b/LeanPool/InflationTermination/TriangleInflation/Graph/Flips.lean @@ -30,7 +30,7 @@ per-coordinate flips. Three structural facts carry every statement below. flipped blocks. -/ -@[expose] public section +public section namespace TriangleInflation.Graph @@ -213,6 +213,7 @@ theorem injectable_vertex_injective {S : Finset (GObs Γ t)} (hS : GInjectable S rw [key o.1 o.2, key p.1 p.2, hop] /-- The copied observation that diagonal row `r` reads at vertex `v`. -/ +@[expose] def diagObs (Γ : PairGraph) (t : ℕ) (p : Σ _ : Fin t, Γ.V) : GObs Γ t := ⟨p.2, fun _ => p.1⟩ theorem readDiag_eq (ω : GAssign Γ t) (r : Fin t) (v : Γ.V) : diff --git a/LeanPool/InflationTermination/TriangleInflation/Graph/Linear.lean b/LeanPool/InflationTermination/TriangleInflation/Graph/Linear.lean index 3f5549df1a..82548529ac 100644 --- a/LeanPool/InflationTermination/TriangleInflation/Graph/Linear.lean +++ b/LeanPool/InflationTermination/TriangleInflation/Graph/Linear.lean @@ -27,7 +27,7 @@ and `square_linear_witness` using the pushforward of this density along the copi map together with symmetry, the diagonal law and the injectable/ancestral prescriptions. -/ -@[expose] public section +public section namespace TriangleInflation.Graph @@ -45,6 +45,7 @@ section Walsh variable {ι : Type*} [Fintype ι] [DecidableEq ι] /-- The Walsh character of a set of coordinates, in the sign convention of `sgn`. -/ +@[expose] def walsh (S : Finset ι) (w : ι → Bool) : ℝ := ∏ i ∈ S, sgn (w i) -- `sgn_mul_self` is provided by `Cycles.lean`. @@ -195,6 +196,7 @@ copy indices each. -/ abbrev TriSign (t : ℕ) := Fin 3 × Fin t /-- The complex atom `1 + i√q ε` of the Fourier density, with `ε = sgn b`. -/ +@[expose] noncomputable def triAtom (q : ℝ) (b : Bool) : ℂ := 1 + Complex.I * ((Real.sqrt q * sgn b : ℝ) : ℂ) @@ -206,11 +208,13 @@ noncomputable def triAtom (q : ℝ) (b : Bool) : ℂ := simp [triAtom] /-- `f_g(s) = ∏_i (1 + i√q s_{g,i})`, the factor of the family `g`. -/ +@[expose] noncomputable def triFactor (t : ℕ) (q : ℝ) (s : TriSign t → Bool) (g : Fin 3) : ℂ := ∏ i : Fin t, triAtom q (s (g, i)) /-- `W(s) = Re(f_x f_z f_y) + 4 ∑_g (1 − Re f_g)`, the `m = 3`, `c = 4` density of AUDIT-NOTES B2 relative to the uniform sign cube. -/ +@[expose] noncomputable def triW (t : ℕ) (q : ℝ) (s : TriSign t → Bool) : ℝ := (triFactor t q s 0 * triFactor t q s 1 * triFactor t q s 2).re + 4 * ((1 - (triFactor t q s 0).re) + (1 - (triFactor t q s 1).re) @@ -283,6 +287,7 @@ theorem triZeta_sq (q : ℝ) (hq : 0 ≤ q) : triZeta q ^ 2 = ((-q : ℝ) : ℂ) /-- The target moment of a character with `n` coordinates: `(−q)^{n/2}` for even `n` and `0` for odd `n`. -/ +@[expose] def triMom (q : ℝ) (n : ℕ) : ℝ := if n % 2 = 0 then (-q) ^ (n / 2) else 0 theorem triZeta_pow_re (q : ℝ) (hq : 0 ≤ q) (n : ℕ) : @@ -409,6 +414,7 @@ theorem sum_walsh_triOne (t : ℕ) (S : Finset (TriSign t)) : /-- The Fourier coefficient correction of AUDIT-NOTES B2 with `c = 4`: the characters that are nonempty and confined to one sign family have their moment multiplied by `1 − 4 = −3`; every other character keeps the target moment. -/ +@[expose] def triCoeff {t : ℕ} (S : Finset (TriSign t)) : ℝ := if S = ∅ then 1 else if ∃ g : Fin 3, ∀ v ∈ S, v.1 = g then -3 else 1 @@ -486,6 +492,7 @@ theorem triW_sum (t : ℕ) (q : ℝ) (hq : 0 ≤ q) : rw [h]; norm_num /-- `ρ(s) = 2^{-3t} W(s)`, the witness density on the auxiliary signs. -/ +@[expose] noncomputable def triDensity (t : ℕ) (q : ℝ) (s : TriSign t → Bool) : ℝ := (1 / 2 ^ (3 * t)) * triW t q s diff --git a/LeanPool/InflationTermination/TriangleInflation/Graph/RootSink.lean b/LeanPool/InflationTermination/TriangleInflation/Graph/RootSink.lean index 774846ae38..0b8047b961 100644 --- a/LeanPool/InflationTermination/TriangleInflation/Graph/RootSink.lean +++ b/LeanPool/InflationTermination/TriangleInflation/Graph/RootSink.lean @@ -27,7 +27,7 @@ consequences `flip_gExpFeasible` and `compatible_gExpFeasible` are proved at the file from the root-sink lemma. Everything in this file is proved. -/ -@[expose] public section +public section namespace TriangleInflation.Graph diff --git a/LeanPool/InflationTermination/TriangleInflation/Graph/Soundness.lean b/LeanPool/InflationTermination/TriangleInflation/Graph/Soundness.lean index d221b22c7d..904b07dcbc 100644 --- a/LeanPool/InflationTermination/TriangleInflation/Graph/Soundness.lean +++ b/LeanPool/InflationTermination/TriangleInflation/Graph/Soundness.lean @@ -32,7 +32,7 @@ vertex blocks) and has been removed; the vertex-block form is in `RootSink.lean` from the root-sink lemma. -/ -@[expose] public section +public section namespace TriangleInflation.Graph @@ -124,6 +124,7 @@ theorem sum_dprod (hw : ∀ i, ∑ a, w i a = 1) : ∑ x : (∀ i, A i), dprod w exact FiniteWeights.sum_dprod hw /-- `dmix I x y` takes its `I`-coordinates from `x` and the others from `y`. -/ +@[expose] def dmix (I : Finset ι) (x y : ∀ i, A i) : ∀ i, A i := fun i => if i ∈ I then x i else y i omit [Fintype ι] [∀ i, Fintype (A i)] in @@ -300,14 +301,14 @@ section Witness variable {M : GModel Γ} /-- Relabelling copy indices, as a bijection of copied latents. -/ -def gLatentPerm (π : Γ.Edge → Equiv.Perm (Fin t)) : GLatent Γ t ≃ GLatent Γ t where +@[expose] def gLatentPerm (π : Γ.Edge → Equiv.Perm (Fin t)) : GLatent Γ t ≃ GLatent Γ t where toFun l := (l.1, π l.1 l.2) invFun l := (l.1, (π l.1).symm l.2) left_inv _ := by simp right_inv _ := by simp /-- Relabelling copy indices, as a bijection of copied observations. -/ -def gObsPerm (π : Γ.Edge → Equiv.Perm (Fin t)) : GObs Γ t ≃ GObs Γ t where +@[expose] def gObsPerm (π : Γ.Edge → Equiv.Perm (Fin t)) : GObs Γ t ≃ GObs Γ t where toFun := gPerm π invFun := gPerm (fun e => (π e).symm) left_inv _ := by simp [gPerm] @@ -408,6 +409,7 @@ theorem inflLaw_injectable (hM : M.Valid) {S : Finset (GObs Γ t)} (hS : GInject /-! ## The diagonal law of the witness -/ /-- The copied observation that diagonal row `r` reads at the vertex `v`. -/ +@[expose] def diagObs (Γ : PairGraph) (t : ℕ) (p : Fin t × Γ.V) : GObs Γ t := ⟨p.2, fun _ => p.1⟩ /-- The `t · |V|` diagonal observations are distinct. -/ @@ -467,7 +469,7 @@ theorem inflLaw_diag (_hM : M.Valid) : /-! ## The ancestral-independence prescriptions -/ /-- Currying a Bool-valued function on a disjoint union of blocks. -/ -def sigCurry {n : ℕ} (S : Fin n → Finset (GObs Γ t)) : +@[expose] def sigCurry {n : ℕ} (S : Fin n → Finset (GObs Γ t)) : ((Σ m : Fin n, ↥(S m)) → Bool) ≃ (∀ m : Fin n, ↥(S m) → Bool) where toFun f := fun m o => f ⟨m, o⟩ invFun g := fun p => g p.1 p.2 @@ -661,6 +663,7 @@ def tailSel {n : ℕ} (S : Fin (n + 1) → Finset (GObs Γ t)) : (Finset.subset_biUnion_of_mem (fun m : Fin n => S m.succ) (Finset.mem_univ m)) b /-- The head block keeps its function, the tail block is split. -/ +@[expose] def headTailSel {n : ℕ} (S : Fin (n + 1) → Finset (GObs Γ t)) : ((↥(S 0) → Bool) × (↥(univ.biUnion fun m : Fin n => S m.succ) → Bool)) → ((↥(S 0) → Bool) × (∀ m : Fin n, ↥(S m.succ) → Bool)) := diff --git a/LeanPool/InflationTermination/TriangleInflation/Graph/SquareWitness.lean b/LeanPool/InflationTermination/TriangleInflation/Graph/SquareWitness.lean index 6e66f5ee2f..aea8ccc68d 100644 --- a/LeanPool/InflationTermination/TriangleInflation/Graph/SquareWitness.lean +++ b/LeanPool/InflationTermination/TriangleInflation/Graph/SquareWitness.lean @@ -24,7 +24,7 @@ pushforward of `parWit`, and the obligations are inherited from `parWit_diag`, `parWit_injectable` and `parWit_ai`, which hold for every real `q`. -/ -@[expose] public section +public section namespace TriangleInflation.Graph diff --git a/LeanPool/InflationTermination/TriangleInflation/Graph/Transport.lean b/LeanPool/InflationTermination/TriangleInflation/Graph/Transport.lean index 8f99967307..3fe5c604e3 100644 --- a/LeanPool/InflationTermination/TriangleInflation/Graph/Transport.lean +++ b/LeanPool/InflationTermination/TriangleInflation/Graph/Transport.lean @@ -25,7 +25,7 @@ namespace carries their machinery, and the `Exhaustion` namespace the graph theo rest of the library. -/ -@[expose] public section +public section namespace TriangleInflation.Graph @@ -134,6 +134,7 @@ theorem sum_pi_prod_indep {ι : Type*} [Fintype ι] [DecidableEq ι] {α : ι /-! ## The edge map of an induced embedding -/ /-- The edge map induced by an induced embedding. -/ +@[expose] def edgeMap (G H : PairGraph) (φ : H.V → G.V) (hind : ∀ u v : H.V, H.G.Adj u v ↔ G.G.Adj (φ u) (φ v)) : H.Edge → G.Edge := fun e => ⟨Sym2.map φ e.1, by @@ -245,6 +246,7 @@ theorem restrictModel_valid (G H : PairGraph) (φ : H.V → G.V) (hφ : Function /-! ## Range equivalences and counting -/ /-- An injection is an equivalence onto its image, described as a subtype. -/ +@[expose] noncomputable def imgEquiv {A B : Type*} (F : A → B) (hF : Function.Injective F) : A ≃ {b : B // ∃ a, F a = b} where toFun a := ⟨F a, a, rfl⟩ @@ -778,6 +780,7 @@ theorem transport_diag (G H : PairGraph) (φ : H.V → G.V) (hφ : Function.Inje /-! ## Symmetry -/ /-- The action of a per-source permutation of copy indices, as an equivalence. -/ +@[expose] def gPermEquiv {Γ : PairGraph} {t : ℕ} (π : Γ.Edge → Equiv.Perm (Fin t)) : GObs Γ t ≃ GObs Γ t := Equiv.sigmaCongrRight (fun _ => Equiv.piCongrRight (fun e => π e.1)) diff --git a/LeanPool/InflationTermination/TriangleInflation/Graph/Triangle.lean b/LeanPool/InflationTermination/TriangleInflation/Graph/Triangle.lean index e01c0e2efd..a614a9ecc7 100644 --- a/LeanPool/InflationTermination/TriangleInflation/Graph/Triangle.lean +++ b/LeanPool/InflationTermination/TriangleInflation/Graph/Triangle.lean @@ -16,7 +16,7 @@ Statements split from the original `Statements.lean` skeleton (one file per prov See AUDIT-NOTES for the mathematics. -/ -@[expose] public section +public section namespace TriangleInflation.Graph @@ -39,23 +39,32 @@ naming follows the file header of `InflationGraph.Defs`: the source `{0,1}` is t universe u /-- The triangle source shared by parties A and B. -/ +@[expose] def triEdgeX : triangleGraph.Edge := ⟨s((0 : Fin 3), (1 : Fin 3)), by decide⟩ /-- The triangle source shared by parties B and C. -/ +@[expose] def triEdgeY : triangleGraph.Edge := ⟨s((1 : Fin 3), (2 : Fin 3)), by decide⟩ /-- The triangle source shared by parties A and C. -/ +@[expose] def triEdgeZ : triangleGraph.Edge := ⟨s((0 : Fin 3), (2 : Fin 3)), by decide⟩ /-- Source X viewed as an edge incident to vertex 0. -/ +@[expose] def triInc0X : (triangleGraph.inc (0 : Fin 3)) := ⟨triEdgeX, by decide⟩ /-- Source Z viewed as an edge incident to vertex 0. -/ +@[expose] def triInc0Z : (triangleGraph.inc (0 : Fin 3)) := ⟨triEdgeZ, by decide⟩ /-- Source X viewed as an edge incident to vertex 1. -/ +@[expose] def triInc1X : (triangleGraph.inc (1 : Fin 3)) := ⟨triEdgeX, by decide⟩ /-- Source Y viewed as an edge incident to vertex 1. -/ +@[expose] def triInc1Y : (triangleGraph.inc (1 : Fin 3)) := ⟨triEdgeY, by decide⟩ /-- Source Z viewed as an edge incident to vertex 2. -/ +@[expose] def triInc2Z : (triangleGraph.inc (2 : Fin 3)) := ⟨triEdgeZ, by decide⟩ /-- Source Y viewed as an edge incident to vertex 2. -/ +@[expose] def triInc2Y : (triangleGraph.inc (2 : Fin 3)) := ⟨triEdgeY, by decide⟩ theorem triInc0_cases : @@ -66,6 +75,7 @@ theorem triInc2_cases : ∀ e : triangleGraph.inc (2 : Fin 3), e = triInc2Z ∨ e = triInc2Y := by decide /-- Translate a graph observation into the named triangle observation. -/ +@[expose] def triObs {t : ℕ} (o : GObs triangleGraph t) : Obs t := match o with | ⟨⟨0, _⟩, f⟩ => Obs.A (f triInc0X) (f triInc0Z) @@ -80,6 +90,7 @@ def triObsInv {t : ℕ} : Obs t → GObs triangleGraph t | Obs.C j k => ⟨(2 : Fin 3), fun e => if e = triInc2Z then j else k⟩ /-- Identify graph observations with the named triangle observations. -/ +@[expose] def triEquiv (t : ℕ) : GObs triangleGraph t ≃ Obs t where toFun := triObs invFun := triObsInv @@ -119,6 +130,7 @@ theorem triEdge_eq_Y : ∀ e : triangleGraph.Edge, ¬ e = triEdgeX → ¬ e = triEdgeZ → e = triEdgeY := by decide /-- Identify an edge-indexed latent assignment with its X, Z, Y coordinates. -/ +@[expose] def triPiEdgeEquiv (L : triangleGraph.Edge → Type u) : (∀ e, L e) ≃ (L triEdgeX × L triEdgeZ × L triEdgeY) where toFun x := (x triEdgeX, x triEdgeZ, x triEdgeY) @@ -152,6 +164,7 @@ theorem tri_partyBit {t : ℕ} (o : GObs triangleGraph t) (w : ThreeBit) : /-! ## Transport of witnesses -/ /-- The induced bijection of assignments. -/ +@[expose] def triAssignEquiv (t : ℕ) : GAssign triangleGraph t ≃ Assign t := Equiv.arrowCongr (triEquiv t) (Equiv.refl Bool) @@ -214,6 +227,7 @@ theorem tri_sym_transport {t : ℕ} (Δ : GAssign triangleGraph t → ℝ) : exact hh /-- The bijection of diagonal reads. -/ +@[expose] def triDiagEquiv (t : ℕ) : (Fin t → (triangleGraph.V → Bool)) ≃ (Fin t → ThreeBit) := Equiv.arrowCongr (Equiv.refl (Fin t)) threeBitEquiv @@ -261,16 +275,19 @@ theorem tri_diag_transport {t : ℕ} (Δ : GAssign triangleGraph t → ℝ) (P : /-! ## Sets of copied observations -/ /-- Transport finite observation sets to the named triangle representation. -/ +@[expose] def triFinsetEquiv (t : ℕ) : Finset (GObs triangleGraph t) ≃ Finset (Obs t) := Equiv.finsetCongr (triEquiv t) /-- Identify observations in a finite graph set with their triangle counterparts. -/ +@[expose] def triSubEquiv {t : ℕ} (S : Finset (GObs triangleGraph t)) : ↥S ≃ ↥((triFinsetEquiv t) S) := Equiv.subtypeEquiv (triEquiv t) (fun a => by simp [triFinsetEquiv, Equiv.finsetCongr_apply]) /-- Transport Boolean assignments on a finite observation set. -/ +@[expose] def triBoolEquiv {t : ℕ} (S : Finset (GObs triangleGraph t)) : (↥S → Bool) ≃ (↥((triFinsetEquiv t) S) → Bool) := Equiv.arrowCongr (triSubEquiv S) (Equiv.refl Bool) @@ -481,6 +498,7 @@ theorem triInc2_ne : /-- Identify the latent inputs at vertex 0 with its two named sources. -/ +@[expose] def triInc0Equiv (L : triangleGraph.Edge → Type u) : ((e : triangleGraph.inc (0:Fin 3)) → L e.1) ≃ (L triEdgeX × L triEdgeZ) where toFun c := (c triInc0X, c triInc0Z) @@ -495,6 +513,7 @@ def triInc0Equiv (L : triangleGraph.Edge → Type u) : right_inv p := rfl /-- Identify the latent inputs at vertex 1 with its two named sources. -/ +@[expose] def triInc1Equiv (L : triangleGraph.Edge → Type u) : ((e : triangleGraph.inc (1:Fin 3)) → L e.1) ≃ (L triEdgeX × L triEdgeY) where toFun c := (c triInc1X, c triInc1Y) @@ -509,6 +528,7 @@ def triInc1Equiv (L : triangleGraph.Edge → Type u) : right_inv p := rfl /-- Identify the latent inputs at vertex 2 with its two named sources. -/ +@[expose] def triInc2Equiv (L : triangleGraph.Edge → Type u) : ((e : triangleGraph.inc (2:Fin 3)) → L e.1) ≃ (L triEdgeZ × L triEdgeY) where toFun c := (c triInc2Z, c triInc2Y) @@ -624,6 +644,7 @@ def triToModel (M : GModel triangleGraph) : TriangleModel where h := fun p => M.resp (2 : Fin 3) ((triInc2Equiv M.L).symm p) /-- The latent alphabets of the triangle `GModel` of a triangle model. -/ +@[expose] def triL (A B C : Type) : triangleGraph.Edge → Type := fun e => if e = triEdgeX then A else if e = triEdgeZ then B else C diff --git a/LeanPool/InflationTermination/TriangleInflation/Graph/TriangleWitness.lean b/LeanPool/InflationTermination/TriangleInflation/Graph/TriangleWitness.lean index bf648112a9..2bc5770478 100644 --- a/LeanPool/InflationTermination/TriangleInflation/Graph/TriangleWitness.lean +++ b/LeanPool/InflationTermination/TriangleInflation/Graph/TriangleWitness.lean @@ -17,7 +17,7 @@ the ancestral-independence feasible set of the triangle module at every order `t 1/(16t)` (`triangle_linear_witness`). Everything here is proved. -/ -@[expose] public section +public section namespace TriangleInflation.Graph diff --git a/LeanPool/InflationTermination/TriangleInflation/Main.lean b/LeanPool/InflationTermination/TriangleInflation/Main.lean index 8684bc7c49..f5591e33a8 100644 --- a/LeanPool/InflationTermination/TriangleInflation/Main.lean +++ b/LeanPool/InflationTermination/TriangleInflation/Main.lean @@ -22,7 +22,7 @@ formalized; see the header of `Defs.lean`. The paper's `Q(ε,r) ∈ I^exp_t ⊆ is formalized here as its two weaker halves, membership in `I^AI_t` and in `I^NW_t`. -/ -@[expose] public section +public section namespace TriangleInflation diff --git a/LeanPool/InflationTermination/TriangleInflation/Rate.lean b/LeanPool/InflationTermination/TriangleInflation/Rate.lean index 43eb44b8bb..06694360b5 100644 --- a/LeanPool/InflationTermination/TriangleInflation/Rate.lean +++ b/LeanPool/InflationTermination/TriangleInflation/Rate.lean @@ -22,7 +22,7 @@ The general correlation-scenario result and the rejecting-order bounds expressed the infimum distance to the compatible set are beyond the scope of this module. -/ -@[expose] public section +public section namespace TriangleInflation @@ -32,6 +32,7 @@ noncomputable section /-- The squared Euclidean norm of a weight function on three bits. -/ +@[expose] def sqNorm (w : ThreeBit → ℝ) : ℝ := ∑ x : ThreeBit, w x ^ 2 /-! ## Auxiliary facts @@ -262,6 +263,7 @@ theorem marg_two {n : ℕ} {P : ThreeBit → ℝ} (hP : IsLaw P) /-! ### The empirical law of a random copied triangle -/ /-- The number of copied triangles that a deterministic assignment reads as `w`. -/ +@[expose] def triCount {n : ℕ} (ω : Assign n) (w : ThreeBit) : ℝ := ∑ c : Cell n, if readTriangle c.1 c.2.1 c.2.2 ω = w then (1:ℝ) else 0 @@ -269,6 +271,7 @@ def triCount {n : ℕ} (ω : Assign n) (w : ThreeBit) : ℝ := three copy indices uniformly and independently, and output the three bits that the assignment gives to the corresponding copied triangle. This is the law `q_ω` of the proof of paper Corollary 6.1. -/ +@[expose] def qLaw (n : ℕ) (ω : Assign n) : ThreeBit → ℝ := fun w => triCount ω w / (n : ℝ) ^ 3 private theorem triCount_nonneg {n : ℕ} (ω : Assign n) (w : ThreeBit) : 0 ≤ triCount ω w := 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 0f6fe9916a..c77e4393fd 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 6af3aed4a6..b6efebb591 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 fb97fa7351..df3d75c96d 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/KaltonPeck/KaltonPeck.lean b/LeanPool/KaltonPeck/KaltonPeck.lean index 633d9852d1..b0c9335273 100644 --- a/LeanPool/KaltonPeck/KaltonPeck.lean +++ b/LeanPool/KaltonPeck/KaltonPeck.lean @@ -29,7 +29,7 @@ This file exposes the project-level definitions and the main rank-parity and hyp obstruction theorems. -/ -@[expose] public section +public section namespace KaltonPeck diff --git a/LeanPool/KaltonPeck/KaltonPeck/Support/CanonicalPairing.lean b/LeanPool/KaltonPeck/KaltonPeck/Support/CanonicalPairing.lean index 0fc0742d33..e3854c0fe0 100644 --- a/LeanPool/KaltonPeck/KaltonPeck/Support/CanonicalPairing.lean +++ b/LeanPool/KaltonPeck/KaltonPeck/Support/CanonicalPairing.lean @@ -19,7 +19,7 @@ The unrestricted coordinate formula gives the pairing identities for the canonic Hilbert-space inclusion directly. -/ -@[expose] public section +public section namespace KaltonPeck.Support.Symplectic diff --git a/LeanPool/KaltonPeck/KaltonPeck/Support/CgpBlockExtraction.lean b/LeanPool/KaltonPeck/KaltonPeck/Support/CgpBlockExtraction.lean index 8f035bd70c..9cb4c950d2 100644 --- a/LeanPool/KaltonPeck/KaltonPeck/Support/CgpBlockExtraction.lean +++ b/LeanPool/KaltonPeck/KaltonPeck/Support/CgpBlockExtraction.lean @@ -23,7 +23,7 @@ This file extracts a successive normalized finite-support block family on which that is not upper semi-Fredholm becomes compact. -/ -@[expose] public section +public section namespace KaltonPeck.Support.CgpBlockExtraction @@ -123,6 +123,7 @@ theorem mem_l2Head_orthogonal_iff (N : ℕ) (x : CanonicalL2) : rw [inner_smul_left, hy, mul_zero] /-- Truncate a Hilbert vector after its first `m` coordinates. -/ +@[expose] def l2Trunc (m : ℕ) (x : CanonicalL2) : CanonicalL2 := ∑ k ∈ Finset.range m, lp.single 2 k (x k) diff --git a/LeanPool/KaltonPeck/KaltonPeck/Support/CgpCompactRestriction.lean b/LeanPool/KaltonPeck/KaltonPeck/Support/CgpCompactRestriction.lean index 713b9938f5..10a2b3bb47 100644 --- a/LeanPool/KaltonPeck/KaltonPeck/Support/CgpCompactRestriction.lean +++ b/LeanPool/KaltonPeck/KaltonPeck/Support/CgpCompactRestriction.lean @@ -20,7 +20,7 @@ This file develops compact-restriction machinery for failed upper semi-Fredholm the compact-perturbation argument for the canonical Kalton--Peck space. -/ -@[expose] public section +public section namespace KaltonPeck.Support.GraphFredholm @@ -36,6 +36,7 @@ open scoped ENNReal NNReal Topology lp BigOperators InnerProductSpace /-- A bounded operator is upper semi-Fredholm when its kernel is finite-dimensional and its range is closed. Blueprint label: `def:upper-semi`; audit ID `INF-UPPER-SEMI-FREDHOLM`. -/ +@[expose] def IsUpperSemiFredholm {X Y : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] [NormedAddCommGroup Y] [NormedSpace ℝ Y] (A : X →L[ℝ] Y) : Prop := by exact FiniteDimensional ℝ A.toLinearMap.ker ∧ IsClosed (A.toLinearMap.range : Set Y) @@ -108,6 +109,7 @@ theorem IsUpperSemiFredholm.not_isStrictlySingular /-- An operator has an infinite-dimensional compact restriction when its restriction to some closed infinite-dimensional subspace is compact. Blueprint label: `def:infinite-dimensional-compact-restriction`. -/ +@[expose] def HasInfiniteDimensionalCompactRestriction {X Y : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] [NormedAddCommGroup Y] [NormedSpace ℝ Y] (T : X →L[ℝ] Y) : Prop := diff --git a/LeanPool/KaltonPeck/KaltonPeck/Support/CgpStrictlySingularLifting.lean b/LeanPool/KaltonPeck/KaltonPeck/Support/CgpStrictlySingularLifting.lean index 7ad309b568..aa16adf5da 100644 --- a/LeanPool/KaltonPeck/KaltonPeck/Support/CgpStrictlySingularLifting.lean +++ b/LeanPool/KaltonPeck/KaltonPeck/Support/CgpStrictlySingularLifting.lean @@ -20,7 +20,7 @@ This file uses biorthogonal interpolation to lift strict singularity from the ca kernel and quotient to operators on the full canonical Kalton--Peck space. -/ -@[expose] public section +public section namespace KaltonPeck.Support.GraphFredholm diff --git a/LeanPool/KaltonPeck/KaltonPeck/Support/Coordinates.lean b/LeanPool/KaltonPeck/KaltonPeck/Support/Coordinates.lean index 3903ca5f95..c0d6ccfc81 100644 --- a/LeanPool/KaltonPeck/KaltonPeck/Support/Coordinates.lean +++ b/LeanPool/KaltonPeck/KaltonPeck/Support/Coordinates.lean @@ -21,7 +21,7 @@ This file develops coordinate presentations of the real Kalton--Peck space, cons canonical model and quotient map, and compares arbitrary complete presented models. -/ -@[expose] public section +public section namespace KaltonPeck.Support @@ -30,22 +30,27 @@ noncomputable section /-- A real sequence is square-summable. -/ +@[expose] def IsSquareSummable (x : ℕ → ℝ) : Prop := Summable fun n ↦ x n ^ 2 /-- The usual `ℓ₂` norm, defined on all real sequences and used on square-summable ones. -/ +@[expose] def l2Norm (x : ℕ → ℝ) : ℝ := Real.sqrt (∑' n, x n ^ 2) /-- The Kalton--Peck centralizer, with Lean's `Real.log 0 = 0` supplying the zero convention. -/ +@[expose] def centralizer (x : ℕ → ℝ) (n : ℕ) : ℝ := 2 * x n * Real.log (|x n| / l2Norm x) /-- The admissible coordinate pairs in the usual real Kalton--Peck presentation. -/ +@[expose] def IsAdmissiblePair (p : (ℕ → ℝ) × (ℕ → ℝ)) : Prop := IsSquareSummable p.2 ∧ IsSquareSummable (p.1 - centralizer p.2) /-- The standard quasi-norm used to present the real Kalton--Peck space. -/ +@[expose] def kaltonPeckQuasiNorm (p : (ℕ → ℝ) × (ℕ → ℝ)) : ℝ := l2Norm (p.1 - centralizer p.2) + l2Norm p.2 @@ -311,11 +316,13 @@ lemma kpNormalization : /-- Both coordinates of a pair have finite support. Support definition for blueprint label `thm:kp-canonical-banach`. -/ +@[expose] def IsFiniteCoordinatePair (p : (ℕ → ℝ) × (ℕ → ℝ)) : Prop := by exact Set.Finite {n | p.1 n ≠ 0} ∧ Set.Finite {n | p.2 n ≠ 0} /-- The fixed project-normalized canonical real Kalton--Peck carrier. Blueprint label: `thm:kp-canonical-banach`; audit ID `INF-KP-CANONICAL-MODEL`. -/ +@[expose] def CanonicalRealKaltonPeck : Type := by exact {p : (ℕ → ℝ) × (ℕ → ℝ) // IsAdmissiblePair p} @@ -596,6 +603,7 @@ private lemma abs_mul_log_sub_log_le_sq_add_sq (a b : ℝ) : _ ≤ a ^ 2 + b ^ 2 := by nlinarith [sq_nonneg b] /-- The linear subspace of admissible Kalton–Peck coordinate pairs. -/ +@[expose] def rawSubmodule : Submodule ℝ ((ℕ → ℝ) × (ℕ → ℝ)) where carrier := {p | IsAdmissiblePair p} zero_mem' := by exact admissible_zero @@ -984,7 +992,7 @@ private lemma modelLinear_injective : Function.Injective modelLinear := by rw [map_sub, hpq, sub_self] /-- The norm on admissible pairs induced by the coordinate-and-pairing embedding. -/ -@[reducible] noncomputable def rawNormedAddCommGroup : NormedAddCommGroup Raw := +@[expose, reducible] noncomputable def rawNormedAddCommGroup : NormedAddCommGroup Raw := NormedAddCommGroup.induced Raw (L2 × Features) modelLinear (by exact modelLinear_injective) /-- The induced normed additive structure during construction of the canonical carrier. -/ @@ -1004,7 +1012,7 @@ local instance rawTopologicalSpaceInst : TopologicalSpace Raw := rawNormedAddCommGroup.toMetricSpace.toPseudoMetricSpace.toUniformSpace.toTopologicalSpace /-- The real normed-space structure induced by the coordinate-and-pairing embedding. -/ -@[reducible] noncomputable def rawNormedSpace : NormedSpace ℝ Raw := +@[expose, reducible] noncomputable def rawNormedSpace : NormedSpace ℝ Raw := NormedSpace.induced ℝ Raw (L2 × Features) modelLinear /-- The induced real normed-space structure during construction of the canonical carrier. -/ @@ -1088,7 +1096,7 @@ private lemma quasiNorm_le_model_norm (p : Raw) : feature_norm_le_model_norm p] /-- The linear second-coordinate map on the normed admissible-pair model. -/ -def secondLinear : Raw →ₗ[ℝ] L2 where +@[expose] def secondLinear : Raw →ₗ[ℝ] L2 where toFun p := toL2 p.1.2 p.2.1 map_add' p q := by apply Subtype.ext @@ -1098,7 +1106,7 @@ def secondLinear : Raw →ₗ[ℝ] L2 where rfl /-- The bounded second-coordinate map from the admissible-pair model to Hilbert space. -/ -def secondCLM : Raw →L[ℝ] L2 := +@[expose] def secondCLM : Raw →L[ℝ] L2 := secondLinear.mkContinuous 1 fun p ↦ by rw [one_mul] change ‖toL2 p.1.2 p.2.1‖ ≤ ‖p‖ @@ -1327,7 +1335,7 @@ theorem canonicalPairingData : exact h /-- The canonical coordinate presentation with the proved two-sided norm bounds. -/ -def rawPresentation : RealKaltonPeckPresentation Raw := by +@[expose] def rawPresentation : RealKaltonPeckPresentation Raw := by let coords : Raw →ₗ[ℝ] (ℕ → ℝ) × (ℕ → ℝ) := { toFun := fun p ↦ p.1 map_add' := by intro p q; rfl @@ -1377,6 +1385,7 @@ instance instCompleteSpaceCanonicalRealKaltonPeck : /-- The coordinate presentation of the fixed canonical model. Blueprint label: `thm:kp-canonical-banach`. -/ +@[expose] def canonicalRealKaltonPeckPresentation : RealKaltonPeckPresentation CanonicalRealKaltonPeck := by exact rawPresentation @@ -1387,6 +1396,7 @@ abbrev CanonicalL2 := lp (fun _ : ℕ ↦ ℝ) 2 /-- The canonical quotient `Z₂ → ℓ₂`, given by the second coordinate. Blueprint support for `thm:kp-canonical-banach`; audit ID `EXT-CGP-UPPER-SEMI-PRIMARY`. -/ +@[expose] def canonicalL2Quotient : CanonicalRealKaltonPeck →L[ℝ] CanonicalL2 := by exact secondCLM diff --git a/LeanPool/KaltonPeck/KaltonPeck/Support/Definitions.lean b/LeanPool/KaltonPeck/KaltonPeck/Support/Definitions.lean index 31ee98f141..afce1f8a4d 100644 --- a/LeanPool/KaltonPeck/KaltonPeck/Support/Definitions.lean +++ b/LeanPool/KaltonPeck/KaltonPeck/Support/Definitions.lean @@ -20,7 +20,7 @@ This file defines continuous alternating and strong symplectic forms, together w Fredholm, finite-rank, complex-structure, and hyperplane notions used throughout the project. -/ -@[expose] public section +public section namespace KaltonPeck.Support @@ -39,6 +39,7 @@ structure ContinuousAlternatingForm (X : Type*) [NormedAddCommGroup X] [NormedSp /-- The symplectic orthogonal of a subspace for a continuous alternating form. Blueprint: `def:weak-form`; audit: `DEF-SYMPLECTIC-ORTHOGONAL`. -/ +@[expose] def ContinuousAlternatingForm.orthogonal {X : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] (b : ContinuousAlternatingForm X) (E : Submodule ℝ X) : Submodule ℝ X := by @@ -48,6 +49,7 @@ def ContinuousAlternatingForm.orthogonal {X : Type*} [NormedAddCommGroup X] /-- The radical, equivalently the kernel of the operator induced by the form. Blueprint: `def:weak-form`; audit: `DEF-RADICAL`. -/ +@[expose] def ContinuousAlternatingForm.radical {X : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] (b : ContinuousAlternatingForm X) : Submodule ℝ X := by exact b.toDual.toLinearMap.ker @@ -73,6 +75,7 @@ theorem ContinuousAlternatingForm.radical_isClosed {X : Type*} [NormedAddCommGro /-- The restriction of a continuous alternating form to a linear subspace. Blueprint: `def:weak-form`; audit: `DEF-RESTRICTED-RADICAL`. -/ +@[expose] def ContinuousAlternatingForm.restrict {X : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] (b : ContinuousAlternatingForm X) (E : Submodule ℝ X) : ContinuousAlternatingForm E := by @@ -85,6 +88,7 @@ def ContinuousAlternatingForm.restrict {X : Type*} [NormedAddCommGroup X] /-- The radical of the restriction of a continuous alternating form to a subspace. Blueprint: `def:weak-form`; audit: `DEF-RESTRICTED-RADICAL`. -/ +@[expose] def ContinuousAlternatingForm.restrictedRadical {X : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] (b : ContinuousAlternatingForm X) (E : Submodule ℝ X) : Submodule ℝ X := by @@ -100,18 +104,21 @@ structure StrongSymplecticForm (X : Type*) [NormedAddCommGroup X] [NormedSpace This is the implementation bridge into the weak-form API. Blueprint: `def:weak-form`; audit: `DEF-WEAK-ALT-FORM`, `DEF-STRONG-SYMPLECTIC`. -/ +@[expose] def StrongSymplecticForm.toContinuousAlternatingForm {X : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] (b : StrongSymplecticForm X) : ContinuousAlternatingForm X := by exact { toDual := b.toDual.toContinuousLinearMap, alternating := b.alternating } /-- The transpose of a bounded linear map between real normed spaces. -/ +@[expose] def transpose {X Y : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] [NormedAddCommGroup Y] [NormedSpace ℝ Y] (T : X →L[ℝ] Y) : StrongDual ℝ Y →L[ℝ] StrongDual ℝ X := (ContinuousLinearMap.flip (ContinuousLinearMap.compL ℝ X Y ℝ)) T /-- The adjoint of a bounded operator with respect to a strong symplectic form. -/ +@[expose] def StrongSymplecticForm.adjoint {X : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] (ω : StrongSymplecticForm X) (T : X →L[ℝ] X) : X →L[ℝ] X := ω.toDual.symm.toContinuousLinearMap.comp @@ -119,6 +126,7 @@ def StrongSymplecticForm.adjoint {X : Type*} [NormedAddCommGroup X] [NormedSpace /-- A bounded linear map is Fredholm when it has finite-dimensional kernel, closed range, and finite-dimensional cokernel. -/ +@[expose] def IsFredholm {X Y : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] [NormedAddCommGroup Y] [NormedSpace ℝ Y] (T : X →L[ℝ] Y) : Prop := FiniteDimensional ℝ T.toLinearMap.ker ∧ @@ -126,17 +134,20 @@ def IsFredholm {X Y : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] FiniteDimensional ℝ (Y ⧸ T.toLinearMap.range) /-- A bounded linear map has finite rank when its algebraic range is finite-dimensional. -/ +@[expose] def HasFiniteRank {X Y : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] [NormedAddCommGroup Y] [NormedSpace ℝ Y] (T : X →L[ℝ] Y) : Prop := FiniteDimensional ℝ T.toLinearMap.range /-- The rank of a bounded linear map, used when its range is finite-dimensional. -/ +@[expose] def operatorRank {X Y : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] [NormedAddCommGroup Y] [NormedSpace ℝ Y] (T : X →L[ℝ] Y) : ℕ := Module.finrank ℝ T.toLinearMap.range /-- The dimension of the kernel of a bounded linear map, used when the kernel is finite-dimensional. -/ +@[expose] def nullity {X Y : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] [NormedAddCommGroup Y] [NormedSpace ℝ Y] (T : X →L[ℝ] Y) : ℕ := Module.finrank ℝ T.toLinearMap.ker @@ -146,16 +157,19 @@ natural dimensions coerced to integers. It is interpreted as a dimension differe finite-dimensional hypotheses in `IsFredholm`. Blueprint: `def:fredholm-rank`; audit: `DEF-FREDHOLM-INDEX`. -/ +@[expose] def fredholmIndex {X Y : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] [NormedAddCommGroup Y] [NormedSpace ℝ Y] (T : X →L[ℝ] Y) : ℤ := by exact (nullity T : ℤ) - (Module.finrank ℝ (Y ⧸ T.toLinearMap.range) : ℤ) /-- A complex structure on a real normed space is a bounded operator squaring to `-I`. -/ +@[expose] def IsComplexStructure {X : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] (J : X →L[ℝ] X) : Prop := J ^ 2 = -1 /-- A closed codimension-one linear subspace. -/ +@[expose] def IsHyperplane {X : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] (H : Submodule ℝ X) : Prop := IsClosed (H : Set X) ∧ Module.finrank ℝ (X ⧸ H) = 1 diff --git a/LeanPool/KaltonPeck/KaltonPeck/Support/FiniteCodim.lean b/LeanPool/KaltonPeck/KaltonPeck/Support/FiniteCodim.lean index aeb204f79a..38c0a8c58d 100644 --- a/LeanPool/KaltonPeck/KaltonPeck/Support/FiniteCodim.lean +++ b/LeanPool/KaltonPeck/KaltonPeck/Support/FiniteCodim.lean @@ -22,7 +22,7 @@ This file relates symplectic orthogonals to finite codimension, constructs the r forms, and proves the finite-codimensional parity theorem. -/ -@[expose] public section +public section namespace KaltonPeck.Support.FiniteCodim diff --git a/LeanPool/KaltonPeck/KaltonPeck/Support/FiniteCodim/QuotientSum.lean b/LeanPool/KaltonPeck/KaltonPeck/Support/FiniteCodim/QuotientSum.lean index 2b7624242d..33b12bebfb 100644 --- a/LeanPool/KaltonPeck/KaltonPeck/Support/FiniteCodim/QuotientSum.lean +++ b/LeanPool/KaltonPeck/KaltonPeck/Support/FiniteCodim/QuotientSum.lean @@ -20,7 +20,7 @@ public import LeanPool.KaltonPeck.KaltonPeck.Support.FiniteParity The corresponding construction from the complete finite-codimensional symplectic reduction. -/ -@[expose] public section +public section namespace KaltonPeck.Support.FiniteCodim diff --git a/LeanPool/KaltonPeck/KaltonPeck/Support/FiniteCodim/RadicalQuotient.lean b/LeanPool/KaltonPeck/KaltonPeck/Support/FiniteCodim/RadicalQuotient.lean index 470297dd9f..167bb10c43 100644 --- a/LeanPool/KaltonPeck/KaltonPeck/Support/FiniteCodim/RadicalQuotient.lean +++ b/LeanPool/KaltonPeck/KaltonPeck/Support/FiniteCodim/RadicalQuotient.lean @@ -19,7 +19,7 @@ public import LeanPool.KaltonPeck.KaltonPeck.Support.FiniteCodim.StrongQuotient The corresponding construction from the complete finite-codimensional symplectic reduction. -/ -@[expose] public section +public section namespace KaltonPeck.Support.FiniteCodim diff --git a/LeanPool/KaltonPeck/KaltonPeck/Support/FiniteCodim/StrongQuotient.lean b/LeanPool/KaltonPeck/KaltonPeck/Support/FiniteCodim/StrongQuotient.lean index d9fb993bd6..5253bf33d4 100644 --- a/LeanPool/KaltonPeck/KaltonPeck/Support/FiniteCodim/StrongQuotient.lean +++ b/LeanPool/KaltonPeck/KaltonPeck/Support/FiniteCodim/StrongQuotient.lean @@ -20,7 +20,7 @@ public import LeanPool.KaltonPeck.KaltonPeck.Support.FiniteParity The corresponding construction from the complete finite-codimensional symplectic reduction. -/ -@[expose] public section +public section namespace KaltonPeck.Support.FiniteCodim @@ -38,6 +38,7 @@ structure FredholmQuotientStrongData {X : Type*} [NormedAddCommGroup X] /-- A Fredholm alternating form descends to a strong form on its radical quotient. Blueprint: `lem:fredholm-quotient-strong`; audit: `AUX-FREDHOLM-QUOTIENT-STRONG`. -/ +@[expose] def fredholmQuotientStrong {X : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] [CompleteSpace X] (eta : ContinuousAlternatingForm X) (hReflexive : Function.Surjective (NormedSpace.inclusionInDoubleDual ℝ X)) diff --git a/LeanPool/KaltonPeck/KaltonPeck/Support/FiniteParity.lean b/LeanPool/KaltonPeck/KaltonPeck/Support/FiniteParity.lean index a6df85002a..2b2e6b356d 100644 --- a/LeanPool/KaltonPeck/KaltonPeck/Support/FiniteParity.lean +++ b/LeanPool/KaltonPeck/KaltonPeck/Support/FiniteParity.lean @@ -20,7 +20,7 @@ This file proves the parity results for finite-dimensional alternating forms and structures that underlie the later rank-parity arguments. -/ -@[expose] public section +public section namespace KaltonPeck.Support.FiniteParity diff --git a/LeanPool/KaltonPeck/KaltonPeck/Support/Forms.lean b/LeanPool/KaltonPeck/KaltonPeck/Support/Forms.lean index 612df4b95b..f0d206f5f7 100644 --- a/LeanPool/KaltonPeck/KaltonPeck/Support/Forms.lean +++ b/LeanPool/KaltonPeck/KaltonPeck/Support/Forms.lean @@ -22,7 +22,7 @@ This file develops continuous annihilators, quotient-dual equivalences, reflexiv strong symplectic forms, and the basic algebraic API for symplectic adjoints. -/ -@[expose] public section +public section namespace KaltonPeck.Support.Forms @@ -33,6 +33,7 @@ section Blueprint support for `lem:double-annihilator` and `lem:quotient-dual`; audit: `DEF-ANNIHILATOR`. -/ +@[expose] def continuousAnnihilator {X : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] (W : Submodule ℝ X) : Submodule ℝ (StrongDual ℝ X) := by exact ((ContinuousLinearMap.compL ℝ W X ℝ).flip W.subtypeL).ker @@ -76,7 +77,7 @@ theorem continuousDoubleAnnihilator {X : Type*} [NormedAddCommGroup X] /-- Pullback along the quotient map as a continuous equivalence with the annihilator. Blueprint: `lem:quotient-dual`; audit: `AUX-CONT-QUOTIENT-DUAL-ANNIHILATOR`. -/ -def quotientDualEquivAnnihilator {X : Type*} [NormedAddCommGroup X] +@[expose] def quotientDualEquivAnnihilator {X : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] [CompleteSpace X] (W : Submodule ℝ X) [hW : IsClosed (W : Set X)] : StrongDual ℝ (X ⧸ W) ≃L[ℝ] continuousAnnihilator W := by diff --git a/LeanPool/KaltonPeck/KaltonPeck/Support/Fredholm.lean b/LeanPool/KaltonPeck/KaltonPeck/Support/Fredholm.lean index 113212ec4f..015c746941 100644 --- a/LeanPool/KaltonPeck/KaltonPeck/Support/Fredholm.lean +++ b/LeanPool/KaltonPeck/KaltonPeck/Support/Fredholm.lean @@ -22,7 +22,7 @@ This file develops quotient-by-kernel descriptions of ranges and proves invarian index, and range results for Fredholm operators. -/ -@[expose] public section +public section namespace KaltonPeck.Support.Fredholm diff --git a/LeanPool/KaltonPeck/KaltonPeck/Support/GeneralRank.lean b/LeanPool/KaltonPeck/KaltonPeck/Support/GeneralRank.lean index 4dee86c115..49f4ff0f0d 100644 --- a/LeanPool/KaltonPeck/KaltonPeck/Support/GeneralRank.lean +++ b/LeanPool/KaltonPeck/KaltonPeck/Support/GeneralRank.lean @@ -22,7 +22,7 @@ This file analyzes the kernel of a finite-rank polynomial defect, constructs the rank-parity form, and proves evenness of its restricted radical. -/ -@[expose] public section +public section namespace KaltonPeck.Support.GeneralRank diff --git a/LeanPool/KaltonPeck/KaltonPeck/Support/GraphFredholm.lean b/LeanPool/KaltonPeck/KaltonPeck/Support/GraphFredholm.lean index 7f61982090..f09187095a 100644 --- a/LeanPool/KaltonPeck/KaltonPeck/Support/GraphFredholm.lean +++ b/LeanPool/KaltonPeck/KaltonPeck/Support/GraphFredholm.lean @@ -30,7 +30,7 @@ This file combines strict singularity, block extraction, and compact-factorizati establish the main Fredholm results for canonical operators on the Kalton--Peck space. -/ -@[expose] public section +public section namespace KaltonPeck.Support.GraphFredholm diff --git a/LeanPool/KaltonPeck/KaltonPeck/Support/HilbertGlidingHump.lean b/LeanPool/KaltonPeck/KaltonPeck/Support/HilbertGlidingHump.lean index 7bef819c86..10b146418c 100644 --- a/LeanPool/KaltonPeck/KaltonPeck/Support/HilbertGlidingHump.lean +++ b/LeanPool/KaltonPeck/KaltonPeck/Support/HilbertGlidingHump.lean @@ -20,7 +20,7 @@ infinite-dimensional Hilbert subspaces and coordinatewise-null sequences, togeth signed-average estimates. -/ -@[expose] public section +public section namespace KaltonPeck.Support.HilbertGlidingHump diff --git a/LeanPool/KaltonPeck/KaltonPeck/Support/KernelNuclearCorrection.lean b/LeanPool/KaltonPeck/KaltonPeck/Support/KernelNuclearCorrection.lean index 7687166152..10b5571172 100644 --- a/LeanPool/KaltonPeck/KaltonPeck/Support/KernelNuclearCorrection.lean +++ b/LeanPool/KaltonPeck/KaltonPeck/Support/KernelNuclearCorrection.lean @@ -20,7 +20,7 @@ This file extends summable errors on the canonical Hilbert-kernel basis to a com operator whose symplectic adjoint is also compact. -/ -@[expose] public section +public section namespace KaltonPeck.Support.GraphFredholm diff --git a/LeanPool/KaltonPeck/KaltonPeck/Support/PathParity.lean b/LeanPool/KaltonPeck/KaltonPeck/Support/PathParity.lean index 9ab1a9f693..614b5148fc 100644 --- a/LeanPool/KaltonPeck/KaltonPeck/Support/PathParity.lean +++ b/LeanPool/KaltonPeck/KaltonPeck/Support/PathParity.lean @@ -21,7 +21,7 @@ This file constructs kernel splittings and local Schur reductions and proves the invariance result for paths of Fredholm alternating forms. -/ -@[expose] public section +public section namespace KaltonPeck.Support.PathParity diff --git a/LeanPool/KaltonPeck/KaltonPeck/Support/StrictlySingular.lean b/LeanPool/KaltonPeck/KaltonPeck/Support/StrictlySingular.lean index d4fe69ce8d..954b611615 100644 --- a/LeanPool/KaltonPeck/KaltonPeck/Support/StrictlySingular.lean +++ b/LeanPool/KaltonPeck/KaltonPeck/Support/StrictlySingular.lean @@ -21,7 +21,7 @@ This file defines strictly singular bounded operators and proves their basic beh composition, together with strict singularity of compact operators. -/ -@[expose] public section +public section namespace KaltonPeck.Support.StrictlySingular @@ -31,6 +31,7 @@ open Function Set Filter Topology /-- A bounded operator is strictly singular when it is not bounded below after precomposition with any bounded-below embedding of an infinite-dimensional Banach space. Blueprint label: `def:strictly-singular`. -/ +@[expose] def IsStrictlySingular {𝕜 X Y : Type*} [NontriviallyNormedField 𝕜] [NormedAddCommGroup X] [NormedSpace 𝕜 X] diff --git a/LeanPool/KaltonPeck/KaltonPeck/Support/StrictlySingularAdd.lean b/LeanPool/KaltonPeck/KaltonPeck/Support/StrictlySingularAdd.lean index aac93f49e9..e71dc5c1e9 100644 --- a/LeanPool/KaltonPeck/KaltonPeck/Support/StrictlySingularAdd.lean +++ b/LeanPool/KaltonPeck/KaltonPeck/Support/StrictlySingularAdd.lean @@ -20,7 +20,7 @@ This file constructs controlled biorthogonal sequences for strictly singular ope proves closure under addition, real scalar multiplication, and negation. -/ -@[expose] public section +public section namespace KaltonPeck.Support.StrictlySingular @@ -204,6 +204,7 @@ def BiorthogonalPrefix.nil (U : X →L[ℝ] Y) (η : ℕ → ℝ) : small := fun i => Fin.elim0 i /-- The data needed to extend a finite biorthogonal prefix. -/ +@[expose] def BiorthogonalPrefix.Extension {U : X →L[ℝ] Y} {η : ℕ → ℝ} {n : ℕ} (p : BiorthogonalPrefix U η n) : Prop := diff --git a/LeanPool/KaltonPeck/KaltonPeck/Support/StrictlySingularHilbert.lean b/LeanPool/KaltonPeck/KaltonPeck/Support/StrictlySingularHilbert.lean index d6d048b0ab..caafec3653 100644 --- a/LeanPool/KaltonPeck/KaltonPeck/Support/StrictlySingularHilbert.lean +++ b/LeanPool/KaltonPeck/KaltonPeck/Support/StrictlySingularHilbert.lean @@ -20,7 +20,7 @@ This file proves that strict singularity of bounded operators between real Hilbe preserved by, and hence invariant under, the Hilbert-space adjoint. -/ -@[expose] public section +public section namespace KaltonPeck.Support.StrictlySingular diff --git a/LeanPool/KaltonPeck/KaltonPeck/Support/StrictlySingularHilbertCompact.lean b/LeanPool/KaltonPeck/KaltonPeck/Support/StrictlySingularHilbertCompact.lean index bd780ca024..e4a0fdaf74 100644 --- a/LeanPool/KaltonPeck/KaltonPeck/Support/StrictlySingularHilbertCompact.lean +++ b/LeanPool/KaltonPeck/KaltonPeck/Support/StrictlySingularHilbertCompact.lean @@ -22,7 +22,7 @@ This file proves that every strictly singular endomorphism of the canonical real is compact by approximation with finite-dimensional compressions. -/ -@[expose] public section +public section namespace KaltonPeck.Support.StrictlySingular diff --git a/LeanPool/KaltonPeck/KaltonPeck/Support/Symplectic.lean b/LeanPool/KaltonPeck/KaltonPeck/Support/Symplectic.lean index ba23e5d025..9f64b29e24 100644 --- a/LeanPool/KaltonPeck/KaltonPeck/Support/Symplectic.lean +++ b/LeanPool/KaltonPeck/KaltonPeck/Support/Symplectic.lean @@ -23,7 +23,7 @@ This file constructs the canonical Kalton--Swanson symplectic form, transports i Kalton--Peck presentations, and develops the associated block-operator theory. -/ -@[expose] public section +public section namespace KaltonPeck.Support.Symplectic @@ -713,6 +713,7 @@ def strongFormOfData (D : StrongPairingData) : /-- The standard unit vector in the real sequence space. Support definition for blueprint label `thm:ks-primary`. -/ +@[expose] def standardBasisSequence (n : ℕ) : ℕ → ℝ := by exact fun k ↦ if k = n then 1 else 0 @@ -733,6 +734,7 @@ def canonicalFirstBasisVector (n : ℕ) : CanonicalRealKaltonPeck := by /-- The canonical vector with coordinates `(0, eₙ)`. Support definition for blueprint labels `thm:ks-primary` and `thm:block-primary`. -/ +@[expose] def canonicalSecondBasisVector (n : ℕ) : CanonicalRealKaltonPeck := by refine ⟨(0, standardBasisSequence n), ?_⟩ have hsquare : IsSquareSummable (standardBasisSequence n) := by @@ -882,6 +884,7 @@ theorem transportedKaltonSwansonForm_apply {X : Type*} [NormedAddCommGroup X] /-- A successive normalized block sequence of finitely supported real `ℓ₂` vectors. Blueprint label: `thm:block-primary`; audit ID `RES-BLOCK-OPERATOR-IDENTITIES`. -/ +@[expose] def IsSuccessiveNormalizedBlockSequence (w : ℕ → ℕ → ℝ) : Prop := by exact (∀ n, Set.Finite {k | w n k ≠ 0} ∧ Set.Nonempty {k | w n k ≠ 0}) ∧ (∀ n, l2Norm (w n) = 1) ∧ @@ -889,6 +892,7 @@ def IsSuccessiveNormalizedBlockSequence (w : ℕ → ℕ → ℝ) : Prop := by /-- Every support in one block family is disjoint from every support in the other. Blueprint labels: `thm:block-primary` and `thm:block-transport`. -/ +@[expose] def AreMutuallySupportDisjoint (w v : ℕ → ℕ → ℝ) : Prop := by exact ∀ n m, Disjoint {k | w n k ≠ 0} {k | v m k ≠ 0} diff --git a/LeanPool/KaltonPeck/KaltonPeck/Support/TargetSupport.lean b/LeanPool/KaltonPeck/KaltonPeck/Support/TargetSupport.lean index a06f6b65cd..6ce6fc35a4 100644 --- a/LeanPool/KaltonPeck/KaltonPeck/Support/TargetSupport.lean +++ b/LeanPool/KaltonPeck/KaltonPeck/Support/TargetSupport.lean @@ -19,7 +19,7 @@ This file extends a complex structure from a closed hyperplane to the ambient Ba computes the rank of the resulting square defect. -/ -@[expose] public section +public section namespace KaltonPeck.Support.TargetSupport 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 262239e305..a34143847a 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/KrohnRhodes/FactorTower.lean b/LeanPool/KrohnRhodes/FactorTower.lean index c927e4c84c..99c370c942 100644 --- a/LeanPool/KrohnRhodes/FactorTower.lean +++ b/LeanPool/KrohnRhodes/FactorTower.lean @@ -40,7 +40,7 @@ the wreath-product algebra used to assemble factor towers. * [Eilenberg, *Automata, Languages, and Machines, Vol. B*, 1976] -/ -@[expose] public section +public section namespace LeanPool.KrohnRhodes @@ -110,6 +110,7 @@ attribute [instance] KRFactor.mon KRFactor.fin namespace KRFactor /-- Build an aperiodic factor from a finite aperiodic monoid. -/ +@[expose] def ofAperiodic (A : Type u) [Monoid A] [Finite A] (hA : ∀ a : A, IsAperiodicElem a) : KRFactor.{u} where carrier := A @@ -117,6 +118,7 @@ def ofAperiodic (A : Type u) [Monoid A] [Finite A] isKind := Or.inl ⟨rfl, hA⟩ /-- Build a simple-group factor from a finite simple group. -/ +@[expose] def ofSimpleGroup (G : Type u) [g : Group G] [Finite G] [IsSimpleGroup G] : KRFactor.{u} where carrier := G @@ -152,6 +154,7 @@ end KRFactor No action-lifting or equivalence with a single iterated transformation wreath product is asserted by this definition. The intermediate base at each step has its own tower. -/ +@[expose] def DivTowerWreath : (M : Type u) → [Monoid M] → [Finite M] → List KRFactor.{u} → Prop | M, _, _, [] => SgDiv M PUnit.{u + 1} | M, _, _, (F :: rest) => @@ -506,6 +509,7 @@ theorem quotientGroup_divides {G : Type u} [Group G] (N : Subgroup G) [N.Normal] /-! ### The subquotient-faithful factor tower -/ /-- `SubFactorsDivide M factors` asserts every factor's carrier divides `M`. -/ +@[expose] def SubFactorsDivide (M : Type u) [Monoid M] (factors : List KRFactor.{u}) : Prop := ∀ F ∈ factors, MonoidDivides F.carrier M diff --git a/LeanPool/KrohnRhodes/Foundations/Cayley.lean b/LeanPool/KrohnRhodes/Foundations/Cayley.lean index 25d186adcd..7ebb997b80 100644 --- a/LeanPool/KrohnRhodes/Foundations/Cayley.lean +++ b/LeanPool/KrohnRhodes/Foundations/Cayley.lean @@ -14,7 +14,7 @@ public import Mathlib.Algebra.Group.Action.End representation `MulAction.toEndHom : N →* Function.End N` is injective. -/ -@[expose] public section +public section namespace LeanPool.KrohnRhodes diff --git a/LeanPool/KrohnRhodes/Foundations/ConstantMaps.lean b/LeanPool/KrohnRhodes/Foundations/ConstantMaps.lean index 9ca9d9799d..8975b42fb3 100644 --- a/LeanPool/KrohnRhodes/Foundations/ConstantMaps.lean +++ b/LeanPool/KrohnRhodes/Foundations/ConstantMaps.lean @@ -22,7 +22,7 @@ Convention: `Function.End Q` multiplies by composition, `(f * g) x = f (g x)`. monoids used in the decomposition genuine aperiodic factors. -/ -@[expose] public section +public section namespace LeanPool.KrohnRhodes @@ -51,10 +51,12 @@ variable {Q : Type u} /-- The constant transformation `_ ↦ q` of `Q`, as an element of the full transformation monoid `Function.End Q`. -/ +@[expose] def constEnd (q : Q) : Function.End Q := fun _ => q /-- A transformation of `Q` *is constant* if it equals `constEnd q` for some `q` — equivalently, its image has exactly one point. -/ +@[expose] def IsConstEnd (t : Function.End Q) : Prop := ∃ q : Q, t = constEnd q theorem isConstEnd_constEnd (q : Q) : IsConstEnd (constEnd q) := ⟨q, rfl⟩ diff --git a/LeanPool/KrohnRhodes/Foundations/Division.lean b/LeanPool/KrohnRhodes/Foundations/Division.lean index d40308c98f..0c46b130bc 100644 --- a/LeanPool/KrohnRhodes/Foundations/Division.lean +++ b/LeanPool/KrohnRhodes/Foundations/Division.lean @@ -22,7 +22,7 @@ public import Mathlib.Algebra.Group.PUnit semigroup homomorphism, then `S` divides `W`. -/ -@[expose] public section +public section namespace LeanPool.KrohnRhodes diff --git a/LeanPool/KrohnRhodes/Foundations/GreenRelations.lean b/LeanPool/KrohnRhodes/Foundations/GreenRelations.lean index 6382d4168e..a4c216f5e4 100644 --- a/LeanPool/KrohnRhodes/Foundations/GreenRelations.lean +++ b/LeanPool/KrohnRhodes/Foundations/GreenRelations.lean @@ -22,7 +22,7 @@ public import Mathlib.Algebra.Group.Defs * [J.-E. Pin, *Mathematical Foundations of Automata Theory*, 2022] -/ -@[expose] public section +public section namespace LeanPool.KrohnRhodes @@ -34,6 +34,7 @@ variable {M : Type*} [Monoid M] /-- Green's L-relation: `a` and `b` generate the same principal left ideal. In a monoid, `a L b` iff there exist `s, t` with `s * a = b` and `t * b = a`. -/ +@[expose] def L (a b : M) : Prop := ∃ s t : M, s * a = b ∧ t * b = a @@ -41,6 +42,7 @@ def L (a b : M) : Prop := /-- Green's R-relation: `a` and `b` generate the same principal right ideal. In a monoid, `a R b` iff there exist `s, t` with `a * s = b` and `b * t = a`. -/ +@[expose] def R (a b : M) : Prop := ∃ s t : M, a * s = b ∧ b * t = a @@ -48,6 +50,7 @@ def R (a b : M) : Prop := /-- Green's H-relation: intersection of L and R. `a H b` iff `a L b` and `a R b`. -/ +@[expose] def H (a b : M) : Prop := L a b ∧ R a b @@ -55,6 +58,7 @@ def H (a b : M) : Prop := /-- An element `a` is aperiodic if its H-class is trivial (a singleton). Equivalently, `a H b → a = b`. -/ +@[expose] def IsAperiodicElem (a : M) : Prop := ∀ b : M, H a b → a = b diff --git a/LeanPool/KrohnRhodes/Foundations/KrasnerKaloujnine.lean b/LeanPool/KrohnRhodes/Foundations/KrasnerKaloujnine.lean index 6da4aa99d5..dec5dffeaa 100644 --- a/LeanPool/KrohnRhodes/Foundations/KrasnerKaloujnine.lean +++ b/LeanPool/KrohnRhodes/Foundations/KrasnerKaloujnine.lean @@ -27,7 +27,7 @@ via `Function.surjInv`. The component `n_g(q) := s(q)⁻¹ * g * s(π(g)⁻¹ * because its image under `π` is `q⁻¹ * π(g) * π(g)⁻¹ * q = 1`. -/ -@[expose] public section +public section namespace LeanPool.KrohnRhodes @@ -52,6 +52,7 @@ theorem section_apply (q : G ⧸ N) : /-- The "left component" of the Krasner-Kaloujnine homomorphism, before showing it lands in `N`. -/ +@[expose] noncomputable def krasnerLeftRaw (g : G) (q : G ⧸ N) : G := (section_ N q)⁻¹ * g * section_ N ((QuotientGroup.mk' N g)⁻¹ * q) @@ -67,10 +68,12 @@ theorem krasnerLeftRaw_mem (g : G) (q : G ⧸ N) : exact (QuotientGroup.eq_one_iff _).mp hone /-- The "left component" of the Krasner-Kaloujnine homomorphism, valued in `N`. -/ +@[expose] noncomputable def krasnerLeft (g : G) (q : G ⧸ N) : N := ⟨krasnerLeftRaw N g q, krasnerLeftRaw_mem N g q⟩ /-- The Krasner-Kaloujnine map `G → N ≀ᵣ (G ⧸ N)` (as bare data). -/ +@[expose] noncomputable def krasnerKaloujnineFun (g : G) : N ≀ᵣ (G ⧸ N) := ⟨krasnerLeft N g, QuotientGroup.mk' N g⟩ @@ -125,6 +128,7 @@ theorem krasnerKaloujnine_map_one : exact map_one _ /-- The Krasner-Kaloujnine universal embedding `G →* N ≀ᵣ (G ⧸ N)`. -/ +@[expose] noncomputable def krasnerKaloujnineHom : G →* (N ≀ᵣ (G ⧸ N)) where toFun := krasnerKaloujnineFun N diff --git a/LeanPool/KrohnRhodes/Foundations/LocalDivisor.lean b/LeanPool/KrohnRhodes/Foundations/LocalDivisor.lean index fb5d641609..31ade7e293 100644 --- a/LeanPool/KrohnRhodes/Foundations/LocalDivisor.lean +++ b/LeanPool/KrohnRhodes/Foundations/LocalDivisor.lean @@ -23,7 +23,7 @@ public import Mathlib.Data.Fintype.EquivFin Fundamenta Informaticae 116 (2012); arXiv:1111.1585] -/ -@[expose] public section +public section namespace LeanPool.KrohnRhodes @@ -35,6 +35,7 @@ variable {α : Type u} /-- A monoid `M` divides a monoid `N` if `M` is a quotient of a submonoid of `N`. Equivalently, there exists a surjective monoid homomorphism from a submonoid of `N` onto `M`. -/ +@[expose] def MonoidDivides (M : Type*) (N : Type*) [Monoid M] [Monoid N] : Prop := ∃ (S : Submonoid N) (φ : S →* M), Function.Surjective φ @@ -77,6 +78,7 @@ submonoid `cMc ∪ {c}`. -/ /-- The carrier of the **local divisor** of a monoid `M` at `c`: the two-sided set `cM ∩ Mc = {x | (∃ a, x = c*a) ∧ (∃ b, x = b*c)}`. As a subtype of `M`. -/ +@[expose] def LocalDivisor (M : Type*) [Monoid M] (c : M) : Type _ := {x : M // (∃ a : M, x = c * a) ∧ (∃ b : M, x = b * c)} @@ -85,6 +87,7 @@ namespace LocalDivisor variable {M : Type*} [Monoid M] {c : M} /-- The underlying element of `M` of a local-divisor element. -/ +@[expose] def val (x : LocalDivisor M c) : M := x.1 @[ext] theorem ext {x y : LocalDivisor M c} (h : x.val = y.val) : x = y := Subtype.ext h diff --git a/LeanPool/KrohnRhodes/Foundations/MonoidWreathBridge.lean b/LeanPool/KrohnRhodes/Foundations/MonoidWreathBridge.lean index 12d1f1bb9f..fb33a0c27d 100644 --- a/LeanPool/KrohnRhodes/Foundations/MonoidWreathBridge.lean +++ b/LeanPool/KrohnRhodes/Foundations/MonoidWreathBridge.lean @@ -28,7 +28,7 @@ so we obtain an injective monoid homomorphism `D ≀ᵣ Q →* WreathProduct D Q - `regularWreathToMonoidWreath_injective` : injectivity of the bridge. -/ -@[expose] public section +public section namespace LeanPool.KrohnRhodes diff --git a/LeanPool/KrohnRhodes/Foundations/WreathProduct.lean b/LeanPool/KrohnRhodes/Foundations/WreathProduct.lean index c655eafb28..d0f458fa32 100644 --- a/LeanPool/KrohnRhodes/Foundations/WreathProduct.lean +++ b/LeanPool/KrohnRhodes/Foundations/WreathProduct.lean @@ -26,7 +26,7 @@ public import Mathlib.Data.Fintype.Pi * [Eilenberg, *Automata, Languages, and Machines, Vol. B*, 1976] -/ -@[expose] public section +public section namespace LeanPool.KrohnRhodes @@ -35,6 +35,7 @@ universe u v w /-! ### Semigroup division -/ /-- Semigroup `S` divides `T` if `S` is a homomorphic image of a subsemigroup of `T`. -/ +@[expose] def SgDiv (S T : Type*) [Mul S] [Mul T] : Prop := ∃ (U : Subsemigroup T) (φ : U →ₙ* S), Function.Surjective φ diff --git a/LeanPool/KrohnRhodes/PrimeDecomposition.lean b/LeanPool/KrohnRhodes/PrimeDecomposition.lean index f64b34ab40..94362d2de0 100644 --- a/LeanPool/KrohnRhodes/PrimeDecomposition.lean +++ b/LeanPool/KrohnRhodes/PrimeDecomposition.lean @@ -28,7 +28,7 @@ quantitative bounds in Theorem 4.1. See `DivTowerWreath` for the exact recursion The declarations in this file are for types in universe 0. -/ -@[expose] public section +public section namespace LeanPool.KrohnRhodes @@ -349,6 +349,7 @@ $\mathrm{act} \colon M \to^* \mathrm{End}(Q)$ and $c \in M$, the *image state se subtype $\{q \in Q \mid \exists x,\ q = \mathrm{act}(c)(x)\}$ — the set of states in the image of the transformation induced by $c$. This is the state set on which the local divisor $M_c$ acts (DKS Lemma 2.11). -/ +@[expose] def cQSet {M Q : Type} [Monoid M] (act : M →* Function.End Q) (c : M) : Type := {q : Q // ∃ x : Q, q = act c x} 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..5bb38db384 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)) @@ -494,7 +495,7 @@ the stabilizer calculation does not depend on a choice of representatives. -/ /-- Equivalence under multiplication on the right by an element of `K`. -/ -def rightCosetSetoid {P : Type w} [Group P] (K : Subgroup P) : Setoid P where +@[expose] def rightCosetSetoid {P : Type w} [Group P] (K : Subgroup P) : Setoid P where r a b := ∃ k : K, a * k = b iseqv := by refine ⟨?_, ?_, ?_⟩ @@ -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,21 +848,21 @@ 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) /-- Translate an unbundled edge by left multiplication on its group coordinate. -/ -def rawBassSerreEdgeDataAction {ι : Type v} (G : ι → Type u) +@[expose] def rawBassSerreEdgeDataAction {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (a : FreeProduct G) (e : rawBassSerreEdgeData G) : rawBassSerreEdgeData G := (a * e.1, e.2) @@ -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 @@ -926,7 +928,7 @@ theorem rawBassSerreEdgeDataOf_target {ι : Type v} (G : ι → Type u) cases e using RawBassSerreEdge.casesOn; rfl /-- Translate a Bass-Serre edge and both endpoints by a group element. -/ -def rawBassSerreEdgeAction {ι : Type v} (G : ι → Type u) +@[expose] def rawBassSerreEdgeAction {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (g : FreeProduct G) {a b : RawBassSerreVertex G} (e : a ⟶ b) : g • a ⟶ g • b := by cases e using RawBassSerreEdge.casesOn with @@ -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 @@ -2333,13 +2336,13 @@ noncomputable def treeKuroshComponentHom {ι : Type v} (G : ι → Type u) exact (kuroshFreePartHom G H).map_mul x.down y.down } /-- The homomorphism induced by the stabilizer inclusions and free-part evaluation. -/ -noncomputable def treeKuroshProductToH {ι : Type v} (G : ι → Type u) +@[expose] noncomputable def treeKuroshProductToH {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) : TreeKuroshProduct G H →* H := Monoid.CoprodI.lift (treeKuroshComponentHom G H) /-- Include a vertex stabilizer as a factor in the tree Kurosh product. -/ -noncomputable def treeKuroshVertexInclusion {ι : Type v} +@[expose] noncomputable def treeKuroshVertexInclusion {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) (a : RawBassSerreOrbitVertex G H) : treeVertexStabilizer G H a →* TreeKuroshProduct G H := @@ -2362,7 +2365,7 @@ noncomputable def treeKuroshVertexInclusion {ι : Type v} rfl } /-- Include the quotient graph's loop group as the free factor in the tree product. -/ -noncomputable def treeKuroshFreeInclusion {ι : Type v} +@[expose] noncomputable def treeKuroshFreeInclusion {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) : KuroshFreePart G H →* TreeKuroshProduct G H := { toFun := fun x => Monoid.CoprodI.of diff --git a/LeanPool/Kurosh/KuroshActive.lean b/LeanPool/Kurosh/KuroshActive.lean index c4bb3e97ab..d162b08980 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 @@ -42,7 +42,7 @@ abbrev KuroshActiveComponentIndex {ι : Type v} (G : ι → Type u) KuroshActiveVertexIndex G H ⊕ PUnit /-- The nontrivial vertex stabilizers together with the free part. -/ -def KuroshActiveComponent {ι : Type v} (G : ι → Type u) +@[expose] def KuroshActiveComponent {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) : KuroshActiveComponentIndex G H → Type (max (u + 1) (v + 1)) := Sum.elim @@ -108,7 +108,7 @@ noncomputable def treeVertexComponentToActive {ι : Type v} rfl } /-- Include an active vertex stabilizer in the product of all components. -/ -noncomputable def activeVertexComponentToTree {ι : Type v} +@[expose] noncomputable def activeVertexComponentToTree {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) (j : KuroshActiveVertexIndex G H) : KuroshActiveComponent G H (Sum.inl j) →* @@ -170,7 +170,7 @@ noncomputable def treeFreeComponentToActive {ι : Type v} rfl } /-- Include the active free component in the product of all components. -/ -noncomputable def activeFreeComponentToTree {ι : Type v} +@[expose] noncomputable def activeFreeComponentToTree {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) : KuroshActiveComponent G H (Sum.inr PUnit.unit) →* TreeKuroshProduct G H := @@ -209,7 +209,7 @@ noncomputable def treeComponentToActive {ι : Type v} | Sum.inr _ => treeFreeComponentToActive G H /-- Map an active component back into the product of all tree components. -/ -noncomputable def activeComponentToTree {ι : Type v} +@[expose] noncomputable def activeComponentToTree {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) : ∀ q : KuroshActiveComponentIndex G H, KuroshActiveComponent G H q →* TreeKuroshProduct G H @@ -223,7 +223,7 @@ noncomputable def treeProductToActive {ι : Type v} Monoid.CoprodI.lift (treeComponentToActive G H) /-- The homomorphism reinserting the active factors into the full tree product. -/ -noncomputable def activeProductToTree {ι : Type v} +@[expose] noncomputable def activeProductToTree {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) : KuroshActiveProduct G H →* TreeKuroshProduct G H := Monoid.CoprodI.lift (activeComponentToTree G H) @@ -314,7 +314,7 @@ theorem Internal.treeProductToActive_comp_activeProductToTree {ι : Type v} rfl /-- Removing trivial stabilizer factors preserves the Kurosh product up to isomorphism. -/ -noncomputable def treeProductActiveEquiv {ι : Type v} +@[expose] noncomputable def treeProductActiveEquiv {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) : @TreeKuroshProduct.{u, v, 0} ι G _ H ≃* @KuroshActiveProduct.{u, v, 0} ι G _ H := @@ -331,7 +331,7 @@ noncomputable def treeProductActiveEquiv {ι : Type v} map_mul' := (treeProductToActive G H).map_mul } /-- The factor-only Kurosh product is isomorphic to the subgroup. -/ -noncomputable def kuroshActiveEquivH {ι : Type v} +@[expose] noncomputable def kuroshActiveEquivH {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) : @KuroshActiveProduct.{u, v, 0} ι G _ H ≃* H := (treeProductActiveEquiv G H).symm.trans diff --git a/LeanPool/Kurosh/KuroshCover.lean b/LeanPool/Kurosh/KuroshCover.lean index 5d6867e991..7e761cd5e3 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,20 +58,20 @@ 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) /-- The source coset of an edge labeled by a covering-group element. -/ -def coverEdgeSource {ι : Type v} (G : ι → Type u) +@[expose] def coverEdgeSource {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) (d : CoverSource G H × CoverEdge G H) : CoverVertex G H := ⟨d.2.1, rightCosetMk (MonoidHom.range (treeKuroshVertexInclusion G H d.2.1)) d.1⟩ /-- The target coset after multiplication by the inverse edge letter. -/ -def coverEdgeTarget {ι : Type v} (G : ι → Type u) +@[expose] def coverEdgeTarget {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) (d : CoverSource G H × CoverEdge G H) : CoverVertex G H := ⟨d.2.2.1, rightCosetMk (MonoidHom.range @@ -79,7 +79,7 @@ def coverEdgeTarget {ι : Type v} (G : ι → Type u) (d.1 * (coverEdgeLetter G H d.2)⁻¹)⟩ /-- The auxiliary quiver of stabilizer cosets and labeled quotient edges. -/ -@[reducible] def coverQuiver {ι : Type v} (G : ι → Type u) +@[expose, reducible] def coverQuiver {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) : Quiver (CoverVertex G H) where Hom x y := {d : CoverSource G H × CoverEdge G H // coverEdgeSource G H d = x ∧ coverEdgeTarget G H d = y} @@ -151,7 +151,7 @@ theorem coverSource_vertexRange_smul {ι : Type v} (G : ι → Type u) exact x.property /-- Evaluate a covering coset on the chosen representative in the Bass-Serre graph. -/ -noncomputable def coverVertexMap {ι : Type v} (G : ι → Type u) +@[expose] noncomputable def coverVertexMap {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) : CoverVertex G H → RawBassSerreVertex G | ⟨a, c⟩ => Quotient.lift @@ -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 := @@ -280,7 +280,7 @@ def coverVertexMk {ι : Type v} (G : ι → Type u) (treeKuroshVertexInclusion G H a)) p⟩ /-- Bundle a quotient edge with its source and target. -/ -def coverBaseEdge {ι : Type v} (G : ι → Type u) +@[expose] def coverBaseEdge {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) {a b : RawBassSerreOrbitVertex G H} (e : a ⟶ b) : CoverEdge G H := @@ -320,7 +320,7 @@ noncomputable def coverNegativeLiftEdge {ι : Type v} (G : ι → Type u) exact Quiver.Hom.cast hsource rfl (Quiver.Hom.toNeg pos) /-- Label quotient edges in the opposite covering group to respect path composition. -/ -def coverGraphLabelPrefunctor {ι : Type v} (G : ι → Type u) +@[expose] def coverGraphLabelPrefunctor {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) : RawBassSerreOrbitVertex G H ⥤q CategoryTheory.SingleObj (CoverSource G H)ᵐᵒᵖ where @@ -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}, @@ -425,7 +425,18 @@ theorem coverPathValueOpp_pos {ι : Type v} (G : ι → Type u) unfold coverPathValueOpp rw [coverFreeGroupoidPathHom_cons, Functor.map_comp, CategoryTheory.SingleObj.comp_as_mul] - rfl + dsimp + have hs := Prefunctor.congr_hom + (Quiver.FreeGroupoid.lift_spec (coverGraphLabelPrefunctor G H)) e + have hs' : + (Quiver.FreeGroupoid.lift (coverGraphLabelPrefunctor G H)).map + ((Quiver.FreeGroupoid.of (RawBassSerreOrbitVertex G H)).map e) = + MulOpposite.op + (coverEdgeLetter G H (coverBaseEdge G H e))⁻¹ := by + simpa [coverGraphLabelPrefunctor, Quiver.homOfEq] using + congrArg (fun z => (z : (CoverSource G H)ᵐᵒᵖ)) hs + rw [hs'] + simp only [MulOpposite.op_inv] theorem coverPathValueOpp_neg {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) @@ -519,7 +530,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 +695,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..e07248677b 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 @@ -33,7 +33,7 @@ namespace GraphCoveringTheory.Kurosh open Monoid.CoprodI /-- Kill every stabilizer component and retain the free component. -/ -noncomputable def treeKuroshComponentToFreePart {ι : Type v} +@[expose] noncomputable def treeKuroshComponentToFreePart {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) (q : TreeKuroshComponentIndex G H) : TreeKuroshComponent G H q →* KuroshFreePart G H := by @@ -54,7 +54,7 @@ noncomputable def treeKuroshComponentToFreePart {ι : Type v} map_mul' := by intro x y; rfl } /-- The projection of the tree Kurosh product onto its free component. -/ -noncomputable def treeKuroshProductToFreePart {ι : Type v} +@[expose] noncomputable def treeKuroshProductToFreePart {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) : TreeKuroshProduct G H →* KuroshFreePart G H := by change FreeProduct (TreeKuroshComponent G H) →* KuroshFreePart G H @@ -115,6 +115,10 @@ theorem treeKuroshProductToH_factor_through_freePart {ι : Type v} (Monoid.CoprodI.of (show TreeKuroshComponent G H (Sum.inl a) from x))) rw [Monoid.CoprodI.lift_of] + have hprojection : + (treeKuroshComponentToFreePart G H (Sum.inl a)) x = 1 := by + rfl + rw [hprojection, map_one] change x.down.1 = 1 exact congrArg Subtype.val hx | inr q => 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..31488af828 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 @@ -159,7 +159,7 @@ theorem Internal.treeKuroshProductToH_injective {ι : Type v} _ = q := by simp /-- The tree Kurosh decomposition, induced by the actual stabilizer inclusions. -/ -noncomputable def treeKuroshProductMulEquivH {ι : Type v} +@[expose] noncomputable def treeKuroshProductMulEquivH {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) : @TreeKuroshProduct.{u, v, 0} ι G _ H ≃* H := MulEquiv.ofBijective (@treeKuroshProductToH.{u, v, 0} ι G _ H) 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..9d1fb1001b 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 @@ -28,7 +28,7 @@ universe u v namespace GraphCoveringTheory.Kurosh /-- Interpret a raw symmetrified Bass-Serre path in the path category. -/ -def rawPathToCat {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] +@[expose] def rawPathToCat {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] {a b : Quiver.Symmetrify (RawBassSerreVertex G)} (p : @Quiver.Path (Quiver.Symmetrify (RawBassSerreVertex G)) (@Quiver.symmetrifyQuiver (RawBassSerreVertex G) diff --git a/LeanPool/Kurosh/KuroshPathRelation.lean b/LeanPool/Kurosh/KuroshPathRelation.lean index 91b95c5fa2..2aae46a8aa 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 @@ -28,7 +28,7 @@ universe u v namespace GraphCoveringTheory.Kurosh /-- Recover the raw symmetrified Bass-Serre path from a path-category morphism. -/ -def catPathToRaw {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] +@[expose] def catPathToRaw {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] {a b : Quiver.Symmetrify (RawBassSerreVertex G)} (p : (CategoryTheory.Paths.of (Quiver.Symmetrify (RawBassSerreVertex G))).obj a ⟶ 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..99007f7cb3 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 @@ -77,7 +77,7 @@ def intersectionFactorInH {ι : Type v} (G : ι → Type u) (intersectionFactor G H i g).comap H.subtype /-- The subgroup factors and a free group, lifted to a common universe. -/ -def Component {ι : Type v} (G : ι → Type u) +@[expose] def Component {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) {J : Type (max u v)} (A : J → Subgroup H) (X : Type (max u v)) : (J ⊕ PUnit.{1}) → Type (max (u + 1) (v + 1)) := 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..9977bc451a 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) ⥤ @@ -1650,18 +1657,18 @@ abbrev Internal.orbitAllEdge {ι : Type v} (G : ι → Type u) (rawBassSerreOrbitQuiver.inst G H) a b /-- The union of the vertex stabilizers and the quotient-edge labels inside `H`. -/ -def Internal.treeDataGeneratorSet {ι : Type v} (G : ι → Type u) +@[expose] def Internal.treeDataGeneratorSet {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) : Set H := {h | ∃ a : RawBassSerreOrbitVertex G H, h ∈ treeVertexStabilizer G H a} ∪ {h | ∃ e : Internal.orbitAllEdge G H, h = quotientEdgeLabel G H e.2.2} /-- The subgroup generated by vertex stabilizers and quotient-edge labels. -/ -def Internal.treeDataGenerated {ι : Type v} (G : ι → Type u) +@[expose] def Internal.treeDataGenerated {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) : Subgroup H := 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..4553dd8381 100644 --- a/LeanPool/Lean4GlCoalgebras/Interpolation/Interpolants.lean +++ b/LeanPool/Lean4GlCoalgebras/Interpolation/Interpolants.lean @@ -26,14 +26,14 @@ 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 open Split /-- Get the entire underlying sequent of a finite proof. -/ -def Split.Proof.Sequent (𝕏 : Proof) [fin_X : Fintype 𝕏.X] : Sequent := +@[expose] def Split.Proof.Sequent (𝕏 : Proof) [fin_X : Fintype 𝕏.X] : Sequent := fin_X.elems.biUnion (fun x ↦ (f (r 𝕏.α x)).image (Sum.elim id id)) /-- Find `n` such that for all `m ≥ n`, `m` is not in an the variables of the proof. -/ @@ -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..8481f14b91 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ᵣ Δ _ => Δ @@ -92,7 +92,7 @@ def f {𝕏 : Split.Proof} {x : 𝕏.X} {τ : 𝕏.X → SplitSequent} : RuleApp | RuleApp.boxᵣ Δ _ _ => Δ /-- Given a RuleApp, obtain the non-principal formulas. -/ -def fₙ {𝕏 : Split.Proof} {x : 𝕏.X} {τ : 𝕏.X → SplitSequent} : +@[expose] def fₙ {𝕏 : Split.Proof} {x : 𝕏.X} {τ : 𝕏.X → SplitSequent} : RuleApp x τ → SplitSequent := fun r ↦ f r \ fₚ r /-- Relating principal formulas, non-principal formulas, and the split sequent. -/ @@ -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..f19eadd297 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)) @@ -453,7 +454,7 @@ end AntiInvolution /-- Shimura Proposition 3.8: `CommRing (𝕋 P ℤ)` from an anti-involution fixing every double coset. -/ -@[reducible] +@[expose, reducible] noncomputable def instCommRingOfAntiInvolution (ι : AntiInvolution P) (h_fix : ∀ D : HeckeCoset P, ι.onHeckeCoset D = D) : CommRing (𝕋 P ℤ) := { HeckeRing.instRing P with mul_comm := ι.mul_comm_of_antiInvolution h_fix } 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..2d38a946f5 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 @@ -998,7 +999,7 @@ theorem T_sum_mul_coprime (m n : ℕ+) (hcop : Nat.Coprime m n) : end CoprimeMultiplicativity /-- TSum extended to ℕ: agrees with `TSum` for positive arguments, zero for 0. -/ -noncomputable def TSumNat (k : ℕ) : HeckeAlgebra 2 := +@[expose] noncomputable def TSumNat (k : ℕ) : HeckeAlgebra 2 := ∑ a ∈ k.divisors, TAd a (k / a) /-- `TSumNat` agrees with `TSum` on positive naturals. -/ 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..4e0b0e58ee 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 @@ -57,7 +57,7 @@ variable (p : ℕ) (hp : p.Prime) /-- The diagonal for the k-th generator: `(1,...,1,p,...,p)` with `n-1-k` ones followed by `k+1` entries of `p`. Here `k : Fin n`, giving `n` generators. -/ -def TGenDiag (k : Fin n) : Fin n → ℕ := +@[expose] def TGenDiag (k : Fin n) : Fin n → ℕ := fun i => if (i : ℕ) < n - 1 - (k : ℕ) then 1 else p @[simp] diff --git a/LeanPool/LeanModularForms/HeckeRIngs/GLn/PrimeDecomposition.lean b/LeanPool/LeanModularForms/HeckeRIngs/GLn/PrimeDecomposition.lean index acdef97e55..029bacbab0 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 → ℕ) : @@ -165,7 +165,7 @@ section RpSubring /-- The p-local Hecke ring: subring generated by `TElem` with p-power entries. This is Shimura's `RP^{(n)}`. -/ -noncomputable def RP (p : ℕ) (hp : p.Prime) : Subring (HeckeAlgebra n) := +@[expose] noncomputable def RP (p : ℕ) (hp : p.Prime) : Subring (HeckeAlgebra n) := -- `hp` records that `p` is prime; it is consumed here so the definition carries -- this provenance even though the subring closure does not use primality directly. let _ := hp 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..dc7214ef50 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] @@ -854,7 +854,7 @@ lemma ModularForm.slash_eq_self {k : ℤ} (f : ModularForm (Gamma 1) k) (γ : SL (f : ℍ → ℂ) ∣[k] γ = f := by rw [SL_slash]; exact f.slash_action_eq' _ ⟨γ, mem_Gamma_one γ, rfl⟩ /-- The Serre derivative of a weight-k level-1 modular form is a weight-(k+2) modular form. -/ -noncomputable def serreDModularForm (k : ℤ) (f : ModularForm (Gamma 1) k) : +@[expose] noncomputable def serreDModularForm (k : ℤ) (f : ModularForm (Gamma 1) k) : ModularForm (Gamma 1) (k + 2) where toSlashInvariantForm := { toFun := serreD k f diff --git a/LeanPool/LeanModularForms/Modularforms/DimensionFormulas.lean b/LeanPool/LeanModularForms/Modularforms/DimensionFormulas.lean index 77863a2f1b..cf14c6cb87 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 @@ -68,7 +68,7 @@ lemma mul_Delta_IsCuspForm (k : ℤ) (f : ModularForm (CongruenceSubgroup.Gamma exact ⟨Delta, rfl⟩ /-- Multiplication by the discriminant `Δ` packaged as a cusp form of weight `k`. -/ -def ModformMulDelta' (k : ℤ) (f : ModularForm (CongruenceSubgroup.Gamma 1) (k - 12)) : +@[expose] def ModformMulDelta' (k : ℤ) (f : ModularForm (CongruenceSubgroup.Gamma 1) (k - 12)) : CuspForm (CongruenceSubgroup.Gamma 1) k := IsCuspFormToCuspForm _ k (mulDeltaMap k f) (mul_Delta_IsCuspForm k f) @@ -88,7 +88,7 @@ lemma Modform_mul_Delta_apply (k : ℤ) (f : ModularForm (CongruenceSubgroup.Gam /-- The linear isomorphism between weight-`k` cusp forms and weight-`(k - 12)` modular forms, given by dividing by `Δ`. -/ -def CuspFormsIsoModforms (k : ℤ) : CuspForm (CongruenceSubgroup.Gamma 1) k ≃ₗ[ℂ] +@[expose] def CuspFormsIsoModforms (k : ℤ) : CuspForm (CongruenceSubgroup.Gamma 1) k ≃ₗ[ℂ] ModularForm (CongruenceSubgroup.Gamma 1) (k - 12) where toFun f := CuspFormDivDiscriminant k f map_add' a b := CuspForm_div_Discriminant_Add k a b 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..e0a39bbd27 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 @@ -60,12 +60,12 @@ section Definitions /- The Eisenstein Series E₄ and E₆ -/ /-- The normalized weight-4 Eisenstein series `E₄`. -/ -def E₄ : ModularForm (CongruenceSubgroup.Gamma ↑1) 4 := +@[expose] def E₄ : ModularForm (CongruenceSubgroup.Gamma ↑1) 4 := (1/2 : ℂ) • eisensteinSeriesMF (by norm_num) standardcongruencecondition /-they need 1/2 for the normalization to match up (since the sum here is taken over coprime integers).-/ /-- The normalized weight-6 Eisenstein series `E₆`. -/ -def E₆ : ModularForm (CongruenceSubgroup.Gamma ↑1) 6 := +@[expose] def E₆ : ModularForm (CongruenceSubgroup.Gamma ↑1) 6 := (1/2 : ℂ) • eisensteinSeriesMF (by norm_num) standardcongruencecondition lemma E4_eq : E₄ = E 4 (by norm_num) := rfl @@ -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 @@ -655,7 +655,8 @@ lemma Delta_cuspFuntion_eq : Set.EqOn (cuspFunction 1 Delta) exact hyn0 lemma Delta_ne_zero : Delta ≠ 0 := - DFunLike.ne_iff.mpr ⟨UpperHalfPlane.I, Δ_ne_zero UpperHalfPlane.I⟩ + DFunLike.ne_iff.mpr ⟨UpperHalfPlane.I, by + simpa only [Delta_apply, zero_apply] using Δ_ne_zero UpperHalfPlane.I⟩ lemma asdf : TendstoLocallyUniformlyOn (fun n : ℕ ↦ fun y : ℂ => ∏ x ∈ Finset.range n, (1 - y ^ (x + 1))) diff --git a/LeanPool/LeanModularForms/Modularforms/EisensteinAsymptotics.lean b/LeanPool/LeanModularForms/Modularforms/EisensteinAsymptotics.lean index 34dd656613..da02c63c2e 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 @@ -145,7 +145,7 @@ lemma serre_DE₄_isBoundedAtImInfty : IsBoundedAtImInfty (serreD 4 E₄.toFun) /-! ## Construction of ModularForm from serreD -/ /-- serreD 4 E₄ is a weight-6 modular form. -/ -def serreDE₄ModularForm : ModularForm (CongruenceSubgroup.Gamma 1) 6 := +@[expose] def serreDE₄ModularForm : ModularForm (CongruenceSubgroup.Gamma 1) 6 := serreDModularForm 4 E₄ /-- serreD 6 E₆ is bounded at infinity. -/ @@ -153,7 +153,7 @@ lemma serre_DE₆_isBoundedAtImInfty : IsBoundedAtImInfty (serreD 6 E₆.toFun) serre_D_isBoundedAtImInfty_of_bounded 6 E₆.holo' E₆_isBoundedAtImInfty /-- serreD 6 E₆ is a weight-8 modular form. -/ -def serreDE₆ModularForm : ModularForm (CongruenceSubgroup.Gamma 1) 8 := +@[expose] def serreDE₆ModularForm : ModularForm (CongruenceSubgroup.Gamma 1) 8 := serreDModularForm 6 E₆ /-! ## Limit of serreD at infinity (for determining scalar) -/ @@ -207,7 +207,7 @@ lemma serre_DE₆_tendsto_atImInfty : /-- serreD 1 E₂ is a weight-4 modular form. Note: E₂ itself is NOT a modular form, but serreD 1 E₂ IS. -/ -def serreDE₂ModularForm : ModularForm (CongruenceSubgroup.Gamma 1) 4 where +@[expose] def serreDE₂ModularForm : ModularForm (CongruenceSubgroup.Gamma 1) 4 where toSlashInvariantForm := { toFun := serreD 1 E₂ slash_action_eq' := fun γ hγ => by 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..8091be01e0 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,11 +32,11 @@ 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₆`. -/ -noncomputable def evalE₄E₆ : +@[expose] noncomputable def evalE₄E₆ : MvPolynomial (Fin 2) ℂ →ₐ[ℂ] DirectSum ℤ (fun k => ModularForm (CongruenceSubgroup.Gamma 1) k) := MvPolynomial.aeval @@ -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..7cfd8e68ff 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 @@ -471,8 +471,10 @@ private lemma eval_Delta_mul_zero_imp {n : ℕ} (hn12 : 12 ≤ n) simp only [SlashInvariantForm.toFun_eq_coe, ModularForm.toSlashInvariantForm_coe, _root_.zero_apply] at hpw change (D 12) z * (S (↑(n-12))) z = 0 at hpw - exact (mul_eq_zero.mp hpw).resolve_left - (show (D 12) z ≠ 0 from evalE₄E₆_Delta_poly_grade ▸ Δ_ne_zero z) + exact (mul_eq_zero.mp hpw).resolve_left (by + rw [show D 12 = ModFormMk Γ(1) 12 Delta from evalE₄E₆_Delta_poly_grade] + have hDelta : (ModFormMk Γ(1) 12 Delta) z = Delta z := rfl + simpa only [hDelta, Delta_apply] using Δ_ne_zero z) private lemma div_Delta_poly {n : ℕ} (hn12 : 12 ≤ n) (p : MvPolynomial (Fin 2) ℂ) 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..d21ed14451 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. -/ @@ -117,7 +118,7 @@ lemma CuspForm_to_ModularForm_Fun_coe (Γ : Subgroup SL(2, ℤ)) (k : ℤ) (f : exact congr_arg (fun x ↦ x.toFun) hg /-- Build a `CuspForm` from a `SlashInvariantForm` that is holomorphic and tends to 0. -/ -noncomputable def cuspFormOfSIFTendstoZero {k : ℤ} +@[expose] noncomputable def cuspFormOfSIFTendstoZero {k : ℤ} (f_SIF : SlashInvariantForm Γ(1) k) (h_mdiff : MDifferentiable 𝓘(ℂ) 𝓘(ℂ) f_SIF.toFun) (h_zero : Tendsto f_SIF.toFun atImInfty (𝓝 0)) : CuspForm Γ(1) k where @@ -150,7 +151,7 @@ private lemma isZeroAtImInfty_of_coeffZero {k : ℤ} simp_all /-- Build a `CuspForm` from a modular form whose q-expansion has vanishing constant term. -/ -noncomputable def cuspFormOfCoeffZero {k : ℤ} +@[expose] noncomputable def cuspFormOfCoeffZero {k : ℤ} (f : ModularForm Γ(1) k) (h : (qExpansion 1 f).coeff 0 = 0) : CuspForm Γ(1) k where toSlashInvariantForm := f.toSlashInvariantForm @@ -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..5de0ca0b69 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 @@ -272,17 +272,17 @@ lemma H₄_β_action : (H₄ ∣[(2 : ℤ)] β.1) = H₄ := calc simp [sq, slash_mul, H₂_T_inv_action, H₂_S_action] /-- H₂, H₃, H₄ are modular forms of weight 2 and level Γ(2) -/ -noncomputable def H₂SIF : SlashInvariantForm (Γ 2) 2 where +@[expose] noncomputable def H₂SIF : SlashInvariantForm (Γ 2) 2 where toFun := H₂ slash_action_eq' := slashaction_generators_Γ2 H₂ (2 : ℤ) H₂_α_action H₂_β_action H₂_negI_action /-- `H₃` as a slash-invariant form of weight 2 and level `Γ(2)`. -/ -noncomputable def H₃SIF : SlashInvariantForm (Γ 2) 2 where +@[expose] noncomputable def H₃SIF : SlashInvariantForm (Γ 2) 2 where toFun := H₃ slash_action_eq' := slashaction_generators_Γ2 H₃ (2 : ℤ) H₃_α_action H₃_β_action H₃_negI_action /-- `H₄` as a slash-invariant form of weight 2 and level `Γ(2)`. -/ -noncomputable def H₄SIF : SlashInvariantForm (Γ 2) 2 where +@[expose] noncomputable def H₄SIF : SlashInvariantForm (Γ 2) 2 where toFun := H₄ slash_action_eq' := slashaction_generators_Γ2 H₄ (2 : ℤ) H₄_α_action H₄_β_action H₄_negI_action @@ -570,21 +570,21 @@ theorem isBoundedAtImInfty_H₄_slash : end H_isBoundedAtImInfty /-- `H₂` as a modular form of weight 2 and level `Γ(2)`. -/ -noncomputable def H₂MF : ModularForm (Γ 2) 2 := { +@[expose] noncomputable def H₂MF : ModularForm (Γ 2) 2 := { H₂SIF with holo' := H₂_SIF_MDifferentiable bdd_at_cusps' hc := bounded_at_cusps_of_bounded_at_infty hc isBoundedAtImInfty_H₂_slash } /-- `H₃` as a modular form of weight 2 and level `Γ(2)`. -/ -noncomputable def H₃MF : ModularForm (Γ 2) 2 := { +@[expose] noncomputable def H₃MF : ModularForm (Γ 2) 2 := { H₃SIF with holo' := H₃_SIF_MDifferentiable bdd_at_cusps' hc := bounded_at_cusps_of_bounded_at_infty hc isBoundedAtImInfty_H₃_slash } /-- `H₄` as a modular form of weight 2 and level `Γ(2)`. -/ -noncomputable def H₄MF : ModularForm (Γ 2) 2 := { +@[expose] noncomputable def H₄MF : ModularForm (Γ 2) 2 := { H₄SIF with holo' := H₄_SIF_MDifferentiable bdd_at_cusps' hc := bounded_at_cusps_of_bounded_at_infty hc isBoundedAtImInfty_H₄_slash @@ -661,7 +661,7 @@ lemma jacobi_f_SL2Z_invariant : ∀ γ : SL(2, ℤ), jacobiF ∣[(4 : ℤ)] γ = slashaction_generators_SL2Z jacobiF 4 jacobi_f_S_action jacobi_f_T_action /-- jacobiF as a SlashInvariantForm of weight 4 and level Γ(1) -/ -noncomputable def jacobiFSIF : SlashInvariantForm (CongruenceSubgroup.Gamma 1) 4 where +@[expose] noncomputable def jacobiFSIF : SlashInvariantForm (CongruenceSubgroup.Gamma 1) 4 where toFun := jacobiF slash_action_eq' := slashaction_generators_GL2R jacobiF 4 jacobi_f_S_action jacobi_f_T_action 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..c868c36782 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 @@ -63,7 +63,7 @@ noncomputable def ResToImagAxis.Pos (F : ℍ → ℂ) : Prop := Function $F : \mathbb{H} \to \mathbb{C}$ whose restriction to the imaginary axis is eventually positive, i.e. there exists $t_0 > 0$ such that for all $t \ge t_0$, $F(it)$ is real and positive. -/ -@[fun_prop] +@[fun_prop, expose] noncomputable def ResToImagAxis.EventuallyPos (F : ℍ → ℂ) : Prop := ResToImagAxis.Real F ∧ ∃ t₀ : ℝ, 0 < t₀ ∧ ∀ t : ℝ, t₀ ≤ 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..2e82445702 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 @@ -358,7 +358,7 @@ private lemma Delta_lower_bound : ∃ r > 0, ∀ z : UpperHalfPlane, have hDelta_eq : Δ z = cFDelta qz := by have := (SlashInvariantFormClass.eq_cuspFunction Delta z (by simp) one_ne_zero).symm - simp only [cFDelta] at this ⊢; exact this + simpa only [cFDelta, qz, Delta_apply] using this rw [hDelta_eq] have hq_pos : 0 < ‖qz‖ := norm_pos_iff.mpr hqz_ne have hdist := hδ hqz_ne (by rwa [dist_zero_right]) 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..9e4c53d0f2 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 @@ -198,7 +198,7 @@ theorem φ₀''_differentiableOn : DifferentiableOn ℂ φ₀'' {z : ℂ | 0 < z ((isOpen_lt continuous_const Complex.continuous_im).mem_nhds hz') have hΔ_ne : (Delta.toSlashInvariantForm ∘ UpperHalfPlane.ofComplex) z ≠ 0 := by simp only [Function.comp, UpperHalfPlane.ofComplex_apply_of_im_pos hz', - CuspForm.toSlashInvariantForm_coe, ne_eq] + CuspForm.toSlashInvariantForm_coe, Delta_apply, ne_eq] exact Δ_ne_zero ⟨z, hz'⟩ have hdiff := ((hE₂z.mul hE₄z).sub hE₆z).pow 2 |>.div hΔz hΔ_ne have hopen := (isOpen_lt continuous_const Complex.continuous_im).mem_nhds hz' @@ -207,10 +207,14 @@ theorem φ₀''_differentiableOn : DifferentiableOn ℂ φ₀'' {z : ℂ | 0 < z filter_upwards [hopen] with w hw simp only [φ₀'', hw, dite_eq_left, φ₀, Function.comp, UpperHalfPlane.ofComplex_apply_of_im_pos hw, Pi.mul_apply, Pi.sub_apply, - Pi.pow_apply, Pi.div_apply]; rfl + Pi.pow_apply, Pi.div_apply] + simp only [ModularForm.toSlashInvariantForm_coe, + CuspForm.toSlashInvariantForm_coe, Delta_apply] · simp only [φ₀'', hz', dite_eq_left, φ₀, Function.comp, UpperHalfPlane.ofComplex_apply_of_im_pos hz', Pi.mul_apply, Pi.sub_apply, - Pi.pow_apply, Pi.div_apply]; rfl + Pi.pow_apply, Pi.div_apply] + simp only [ModularForm.toSlashInvariantForm_coe, + CuspForm.toSlashInvariantForm_coe, Delta_apply] /-! ## Upper half-plane: convexity and openness -/ 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 430e030866..b328bbe428 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 @@ -234,11 +234,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. -/ @@ -250,15 +250,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 @@ -270,11 +270,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 883ec564ca..496cefe08f 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 2f91774645..48b5b5e9ab 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 5d6b2a410c..251720488b 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 : ℕ) : ℝ) : ℂ)⁻¹ @@ -268,7 +269,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. -/ @@ -298,7 +299,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. -/ @@ -315,8 +316,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 : @@ -348,7 +348,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. -/ @@ -357,7 +357,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 `|−⟩` @@ -376,6 +376,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/LiCriterion/Comparator/ChallengeDeps.lean b/LeanPool/LiCriterion/Comparator/ChallengeDeps.lean index 3e47e30744..90ac814cfa 100644 --- a/LeanPool/LiCriterion/Comparator/ChallengeDeps.lean +++ b/LeanPool/LiCriterion/Comparator/ChallengeDeps.lean @@ -30,7 +30,7 @@ and [audit guide](https://github.com/nicholasbulka/li-criterion-rh-equivalence-l Those upstream audit assets are separate from this Lean Pool import. -/ -@[expose] public section +public section noncomputable section @@ -42,6 +42,7 @@ namespace LiChallenge `Λ₀ = completedRiemannZeta₀` is Mathlib's entire completed zeta. This is an entire function whose zeros in the critical strip are exactly the nontrivial zeros of ζ. (Character-for-character `LiCriterion.riemannXi`.) -/ +@[expose] def riemannXi (s : ℂ) : ℂ := (1 / 2 : ℂ) * s * (s - 1) * completedRiemannZeta₀ s + (1 / 2 : ℂ) @@ -49,20 +50,24 @@ def riemannXi (s : ℂ) : ℂ := half-plane `Re s > 1/2`. Precomposing with it turns "all zeros on the critical line" into a statement about the unit disk, which is what makes the Li coefficients a positivity condition. (Character-for-character `LiCriterion.phi`.) -/ +@[expose] def phi (f : ℂ → ℂ) (z : ℂ) : ℂ := f (1 / (1 - z)) /-- The logarithmic derivative `f' / f`. (Character-for-character `LiCriterion.logDeriv`.) -/ +@[expose] def logDeriv (φ : ℂ → ℂ) (z : ℂ) : ℂ := deriv φ z / φ z /-- The zero-indexed analytic coefficient corresponding, for `f = riemannXi`, to Li's classical `λ_{n+1}`: the `n`-th Taylor coefficient at `0` of the logarithmic derivative of `f` precomposed with the Cayley map. These are the coefficients whose nonnegativity is Li's criterion for RH. (Character-for-character `LiCriterion.taylorCoeff`.) -/ +@[expose] def taylorCoeff (f : ℂ → ℂ) (n : ℕ) : ℂ := (deriv^[n] (logDeriv (phi f))) 0 / n.factorial /-- The nontrivial zeros of `ζ`: the zeros in the open critical strip `0 < re s < 1`. (Character-for-character `LiCriterion.NontrivialZero`.) -/ +@[expose] def NontrivialZero : Type := {ρ : ℂ // riemannZeta ρ = 0 ∧ 0 < ρ.re ∧ ρ.re < 1} end LiChallenge diff --git a/LeanPool/LiCriterion/Comparator/Solution.lean b/LeanPool/LiCriterion/Comparator/Solution.lean index 03d299554f..3c2289fd6f 100644 --- a/LeanPool/LiCriterion/Comparator/Solution.lean +++ b/LeanPool/LiCriterion/Comparator/Solution.lean @@ -43,7 +43,7 @@ STATUS: unconditional. The two order inputs of `LiCriterion.li_criterion_rh_iff both compared theorems report `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open LiChallenge diff --git a/LeanPool/LiCriterion/FunctionsOfOneComplexVariable/BorelCaratheodory.lean b/LeanPool/LiCriterion/FunctionsOfOneComplexVariable/BorelCaratheodory.lean index 60f4d80c86..78f3a9fcd7 100644 --- a/LeanPool/LiCriterion/FunctionsOfOneComplexVariable/BorelCaratheodory.lean +++ b/LeanPool/LiCriterion/FunctionsOfOneComplexVariable/BorelCaratheodory.lean @@ -31,7 +31,7 @@ public import Mathlib.Analysis.Complex.AbsMax A bound on `‖g‖` on a disk in terms of the supremum of `re g` on a larger disk. -/ -@[expose] public section +public section open Complex Real Filter Topology open scoped BigOperators ComplexConjugate @@ -41,6 +41,7 @@ noncomputable section -- Define the boundary supremum using conditionally complete lattice /-- The supremum of the real part of `g` on the circle of radius `R` centered at zero. -/ +@[expose] noncomputable def boundaryRealSup (g : ℂ → ℂ) (R : ℝ) : ℝ := sSup {x | ∃ ζ : ℂ, ‖ζ‖ = R ∧ x = (g ζ).re} diff --git a/LeanPool/LiCriterion/FunctionsOfOneComplexVariable/EntireLog.lean b/LeanPool/LiCriterion/FunctionsOfOneComplexVariable/EntireLog.lean index 870ec25fda..d02de6e6f8 100644 --- a/LeanPool/LiCriterion/FunctionsOfOneComplexVariable/EntireLog.lean +++ b/LeanPool/LiCriterion/FunctionsOfOneComplexVariable/EntireLog.lean @@ -26,7 +26,7 @@ We use: complex-differentiable. -/ -@[expose] public section +public section open Complex Filter Topology open scoped Topology diff --git a/LeanPool/LiCriterion/Hadamard/Basic.lean b/LeanPool/LiCriterion/Hadamard/Basic.lean index ff61da9b32..26c2ad4cc3 100644 --- a/LeanPool/LiCriterion/Hadamard/Basic.lean +++ b/LeanPool/LiCriterion/Hadamard/Basic.lean @@ -56,7 +56,7 @@ public import LeanPool.LiCriterion.FunctionsOfOneComplexVariable.BorelCaratheodo /-! ### Maximum modulus definition -/ -@[expose] public section +public section open Complex Real Filter Topology MeasureTheory open scoped BigOperators ComplexConjugate @@ -85,6 +85,7 @@ lemma summable_sigma_inv_norm_pow_of_weighted /-- The maximum modulus of f on the circle of radius r. M(f,r) = sup {|f(z)| : |z| = r} -/ +@[expose] noncomputable def maxModulus (f : ℂ → ℂ) (r : ℝ) : ℝ := sSup {y : ℝ | ∃ z : ℂ, ‖z‖ = r ∧ y = ‖f z‖} @@ -203,6 +204,7 @@ Lemma 1.2. Let f be an entire function of finite order. ρ(f) = lim sup_{r≥R→∞} (log log M(f,r)) / log(r) where M(f,r) = max_{|z|=r} |f(z)| -/ +@[expose] noncomputable def order (f : ℂ → ℂ) : ℝ := Filter.limsup (fun r : ℝ => if r > 0 ∧ maxModulus f r > 1 then @@ -315,6 +317,7 @@ The order of an entire function f is defined as: /-- An entire function has finite order if there exist ρ₀, R₀ such that |f(z)| < exp(|z|^ρ₀) whenever |z| ≥ R₀ -/ +@[expose] def hasFiniteOrder (f : ℂ → ℂ) : Prop := Differentiable ℂ f ∧ ∃ (ρ₀ R₀ : ℝ), ∀ z : ℂ, R₀ ≤ ‖z‖ → ‖f z‖ < Real.exp (‖z‖ ^ ρ₀) @@ -400,6 +403,7 @@ Weierstrass elementary factors where: E_p(w) = (1-w)exp(w + w²/2 + ... + w^p/p) These appear in the canonical product representation. -/ +@[expose] noncomputable def weierstrassE (p : ℕ) (w : ℂ) : ℂ := (1 - w) * Complex.exp (∑ k ∈ Finset.range p, w^(k+1) / (k+1)) diff --git a/LeanPool/LiCriterion/Hadamard/DyadicBounds.lean b/LeanPool/LiCriterion/Hadamard/DyadicBounds.lean index a6938ee26c..9e9af12333 100644 --- a/LeanPool/LiCriterion/Hadamard/DyadicBounds.lean +++ b/LeanPool/LiCriterion/Hadamard/DyadicBounds.lean @@ -19,7 +19,7 @@ Real-power identities, shell estimates, and cofinal finite-sum bounds shared by simple-zero and multiplicity-weighted Hadamard growth estimates. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/LiCriterion/Hadamard/General.lean b/LeanPool/LiCriterion/Hadamard/General.lean index 8483b72f83..84e94b9e72 100644 --- a/LeanPool/LiCriterion/Hadamard/General.lean +++ b/LeanPool/LiCriterion/Hadamard/General.lean @@ -21,7 +21,7 @@ public import LeanPool.LiCriterion.Hadamard.General.Factorization Aggregator for the general order-`≤ 1` factorization theorem. -/ -@[expose] public section +public section namespace Hadamard diff --git a/LeanPool/LiCriterion/Hadamard/General/Factorization.lean b/LeanPool/LiCriterion/Hadamard/General/Factorization.lean index 1af47354fe..1ce77c1d6a 100644 --- a/LeanPool/LiCriterion/Hadamard/General/Factorization.lean +++ b/LeanPool/LiCriterion/Hadamard/General/Factorization.lean @@ -46,7 +46,7 @@ rank-`p` variant. We introduce it here so downstream lemmas can refer to it; the genus-1 version is a special case. -/ -@[expose] public section +public section open scoped BigOperators @@ -59,6 +59,7 @@ namespace General /-- The rank-`p` canonical Weierstrass product over a `ZeroSetMultiplicity`, with each zero repeated according to its multiplicity. -/ +@[expose] noncomputable def canonicalProductZeroSetMultiplicityRank {f : ℂ → ℂ} (Z : ZeroSetMultiplicity f) (p : ℕ) (s : ℂ) : ℂ := diff --git a/LeanPool/LiCriterion/Hadamard/OrderOne/CofiniteControl.lean b/LeanPool/LiCriterion/Hadamard/OrderOne/CofiniteControl.lean index d79eb5a878..c57bdf100f 100644 --- a/LeanPool/LiCriterion/Hadamard/OrderOne/CofiniteControl.lean +++ b/LeanPool/LiCriterion/Hadamard/OrderOne/CofiniteControl.lean @@ -19,7 +19,7 @@ from summability of `1 / ‖z i‖^2` (and a nonzero hypothesis), we get that on indices have `‖z i‖ ≤ R` for any fixed `R > 0`. -/ -@[expose] public section +public section open Filter diff --git a/LeanPool/LiCriterion/Hadamard/OrderOne/LocallyUniformProduct.lean b/LeanPool/LiCriterion/Hadamard/OrderOne/LocallyUniformProduct.lean index e96f58cd9d..d457332c33 100644 --- a/LeanPool/LiCriterion/Hadamard/OrderOne/LocallyUniformProduct.lean +++ b/LeanPool/LiCriterion/Hadamard/OrderOne/LocallyUniformProduct.lean @@ -15,7 +15,7 @@ Local-uniform convergence (and hence holomorphy) of the genus‑1 Weierstrass pr and a nonzero condition on the `z i`. -/ -@[expose] public section +public section open Complex Filter open scoped BigOperators diff --git a/LeanPool/LiCriterion/Hadamard/OrderOne/LogDeriv.lean b/LeanPool/LiCriterion/Hadamard/OrderOne/LogDeriv.lean index 520f0e078c..7825f79587 100644 --- a/LeanPool/LiCriterion/Hadamard/OrderOne/LogDeriv.lean +++ b/LeanPool/LiCriterion/Hadamard/OrderOne/LogDeriv.lean @@ -19,7 +19,7 @@ The key output is a pointwise formula for the logarithmic derivative of `w ↦ ∏' i, weierstrassE 1 (w / z i)` in terms of a (provably summable) partial-fraction series. -/ -@[expose] public section +public section open Complex Filter open scoped BigOperators diff --git a/LeanPool/LiCriterion/Hadamard/OrderOne/LogDerivMultiplicity.lean b/LeanPool/LiCriterion/Hadamard/OrderOne/LogDerivMultiplicity.lean index a060bf0fef..0ede6f5d16 100644 --- a/LeanPool/LiCriterion/Hadamard/OrderOne/LogDerivMultiplicity.lean +++ b/LeanPool/LiCriterion/Hadamard/OrderOne/LogDerivMultiplicity.lean @@ -17,7 +17,7 @@ We model multiplicity by repeating each zero index `i` exactly `m i` times via t log-derivative series carries the expected multiplicity coefficient. -/ -@[expose] public section +public section open Complex Filter open scoped BigOperators diff --git a/LeanPool/LiCriterion/Hadamard/OrderOne/MultipliableFactors.lean b/LeanPool/LiCriterion/Hadamard/OrderOne/MultipliableFactors.lean index 31b1f8d804..948b05142f 100644 --- a/LeanPool/LiCriterion/Hadamard/OrderOne/MultipliableFactors.lean +++ b/LeanPool/LiCriterion/Hadamard/OrderOne/MultipliableFactors.lean @@ -17,7 +17,7 @@ This isolates the analytic input used repeatedly when building canonical product for fixed `s`, the family `i ↦ weierstrassE 1 (s / z i)` is an infinite product that converges. -/ -@[expose] public section +public section open Complex Filter open scoped BigOperators diff --git a/LeanPool/LiCriterion/Hadamard/OrderOne/OrderFromMaxModulus.lean b/LeanPool/LiCriterion/Hadamard/OrderOne/OrderFromMaxModulus.lean index a1f143720a..fc0d343dc7 100644 --- a/LeanPool/LiCriterion/Hadamard/OrderOne/OrderFromMaxModulus.lean +++ b/LeanPool/LiCriterion/Hadamard/OrderOne/OrderFromMaxModulus.lean @@ -23,7 +23,7 @@ It is used in the order-`≤ 1` Hadamard factorization proof to show the quotien `Q := f / P` has `order Q < 2`, hence is an exponential of a linear function. -/ -@[expose] public section +public section namespace Hadamard diff --git a/LeanPool/LiCriterion/Hadamard/OrderOne/QuotientCancellation.lean b/LeanPool/LiCriterion/Hadamard/OrderOne/QuotientCancellation.lean index 3287a43595..4d2036080d 100644 --- a/LeanPool/LiCriterion/Hadamard/OrderOne/QuotientCancellation.lean +++ b/LeanPool/LiCriterion/Hadamard/OrderOne/QuotientCancellation.lean @@ -20,7 +20,7 @@ This is the pointwise ingredient needed to upgrade the “simple zeros” quotie general multiplicity regime. -/ -@[expose] public section +public section open Complex Filter Topology open scoped Topology diff --git a/LeanPool/LiCriterion/Hadamard/OrderOne/SummabilityMultiplicity.lean b/LeanPool/LiCriterion/Hadamard/OrderOne/SummabilityMultiplicity.lean index b3a368b04f..ca32f4b841 100644 --- a/LeanPool/LiCriterion/Hadamard/OrderOne/SummabilityMultiplicity.lean +++ b/LeanPool/LiCriterion/Hadamard/OrderOne/SummabilityMultiplicity.lean @@ -22,7 +22,7 @@ The key input is the Jensen/divisor bound upgraded to multiplicities bound in `TailEstimates.sum_multiplicity_zeros_le_rpow`. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/LiCriterion/Hadamard/OrderOne/TailEstimates.lean b/LeanPool/LiCriterion/Hadamard/OrderOne/TailEstimates.lean index 738690e10b..7ec9afcb9d 100644 --- a/LeanPool/LiCriterion/Hadamard/OrderOne/TailEstimates.lean +++ b/LeanPool/LiCriterion/Hadamard/OrderOne/TailEstimates.lean @@ -21,7 +21,7 @@ public import LeanPool.LiCriterion.Hadamard.OrderOne.ZeroCountingBounds /-! ### Dyadic ball finsets under `∑ 1/‖z ρ‖² < ∞` -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/LiCriterion/Hadamard/OrderOne/ZeroCountingBounds.lean b/LeanPool/LiCriterion/Hadamard/OrderOne/ZeroCountingBounds.lean index bcc9aef162..8c24972d9f 100644 --- a/LeanPool/LiCriterion/Hadamard/OrderOne/ZeroCountingBounds.lean +++ b/LeanPool/LiCriterion/Hadamard/OrderOne/ZeroCountingBounds.lean @@ -19,7 +19,7 @@ This file bridges the Jensen/divisor-based counting lemma in product development. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/LiCriterion/Hadamard/Theorem.lean b/LeanPool/LiCriterion/Hadamard/Theorem.lean index 6df024d574..113e649611 100644 --- a/LeanPool/LiCriterion/Hadamard/Theorem.lean +++ b/LeanPool/LiCriterion/Hadamard/Theorem.lean @@ -16,7 +16,7 @@ This file intentionally contains no global axioms: the deep factorization theore handled elsewhere; here we only record consequences and clean lemmas that downstream files use. -/ -@[expose] public section +public section open Filter Topology Set Metric diff --git a/LeanPool/LiCriterion/Hadamard/ZeroCounting.lean b/LeanPool/LiCriterion/Hadamard/ZeroCounting.lean index 01a14b7d76..00d4cec90d 100644 --- a/LeanPool/LiCriterion/Hadamard/ZeroCounting.lean +++ b/LeanPool/LiCriterion/Hadamard/ZeroCounting.lean @@ -19,7 +19,7 @@ We express “distinct zeros” using the `MeromorphicOn.divisor` support on a c analytic function this support is exactly the set of zeros in the ball (no poles). -/ -@[expose] public section +public section open Complex Real Filter Topology MeasureTheory open scoped BigOperators diff --git a/LeanPool/LiCriterion/Hadamard/ZeroSet.lean b/LeanPool/LiCriterion/Hadamard/ZeroSet.lean index 74d2457cc1..027afabcc9 100644 --- a/LeanPool/LiCriterion/Hadamard/ZeroSet.lean +++ b/LeanPool/LiCriterion/Hadamard/ZeroSet.lean @@ -22,7 +22,7 @@ The `ZeroSet` structure packaging the zeros of an entire function together with Hadamard factorization needs, and the associated canonical product. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/LiCriterion/Hadamard/ZeroSetMultiplicity.lean b/LeanPool/LiCriterion/Hadamard/ZeroSetMultiplicity.lean index fef72e9c60..0af05348cf 100644 --- a/LeanPool/LiCriterion/Hadamard/ZeroSetMultiplicity.lean +++ b/LeanPool/LiCriterion/Hadamard/ZeroSetMultiplicity.lean @@ -23,7 +23,7 @@ public import LeanPool.LiCriterion.Hadamard.ZeroSet as a sigma type so that the factorization theorem applies without assuming simple zeros. -/ -@[expose] public section +public section open scoped BigOperators @@ -41,15 +41,18 @@ namespace ZeroSetMultiplicity variable {f : ℂ → ℂ} (Z : ZeroSetMultiplicity f) /-- Repeat each zero according to its multiplicity. -/ +@[expose] def ZeroWithMultiplicity : Type := Σ ρ : Z.Zero, Fin (Z.mult ρ) /-- The underlying complex value of a repeated zero index. -/ +@[expose] def zWithMultiplicity : Z.ZeroWithMultiplicity → ℂ := fun i => Z.z i.1 @[simp] lemma zWithMultiplicity_mk (ρ : Z.Zero) (k : Fin (Z.mult ρ)) : Z.zWithMultiplicity ⟨ρ, k⟩ = Z.z ρ := rfl /-- The genus‑1 canonical product where each zero occurs with its multiplicity. -/ +@[expose] noncomputable def canonicalProductZeroSetMultiplicity (s : ℂ) : ℂ := ∏' i : Z.ZeroWithMultiplicity, weierstrassE 1 (s / Z.zWithMultiplicity i) diff --git a/LeanPool/LiCriterion/Lc/LiCriterion/Basic.lean b/LeanPool/LiCriterion/Lc/LiCriterion/Basic.lean index 8fa662928f..5dbd1fc522 100644 --- a/LeanPool/LiCriterion/Lc/LiCriterion/Basic.lean +++ b/LeanPool/LiCriterion/Lc/LiCriterion/Basic.lean @@ -90,7 +90,7 @@ These geometric facts connect the critical line to the unit circle via the Möbius transform z ↦ 1 - 1/z. This is essential in Li's proof. -/ -@[expose] public section +public section open Complex Real Set Function Filter open scoped Topology ComplexConjugate @@ -102,6 +102,7 @@ namespace LiCriterion -- -- NOTE: this is placed near the top so it can be used by early analytic/M-test lemmas. /-- The zeros of the Riemann zeta function in the open critical strip. -/ +@[expose] noncomputable def NontrivialZero : Type := {ρ : ℂ // riemannZeta ρ = 0 ∧ 0 < ρ.re ∧ ρ.re < 1} @@ -381,6 +382,7 @@ lemma zeros_conjugate_pairs {f : ℂ → ℂ} (hf : ∀ z, f (star z) = star (f /-! ## The modified function φ and its properties -/ /-- Given an entire function f(s) = ∏(1 - s/ρ), define φ(z) = f(1/(1-z)) -/ +@[expose] noncomputable def phi (f : ℂ → ℂ) (z : ℂ) : ℂ := f (1 / (1 - z)) /-- Eta-expanded form of `phi`, for rewriting under a binder. -/ @@ -395,6 +397,7 @@ lemma phi_conj {f : ℂ → ℂ} (hf : ∀ z, f (conj z) = conj (f z)) (z : ℂ) simpa [hw] using (hf (1 / (1 - z))) /-- The logarithmic derivative of φ -/ +@[expose] noncomputable def logDeriv (φ : ℂ → ℂ) (z : ℂ) : ℂ := deriv φ z / φ z @@ -527,6 +530,7 @@ lemma logDeriv_holomorphic {f : ℂ → ℂ} (hf_entire : Differentiable ℂ f) /-! ## Taylor coefficients and their properties -/ /-- The Taylor coefficients of the logarithmic derivative -/ +@[expose] noncomputable def taylorCoeff (f : ℂ → ℂ) (n : ℕ) : ℂ := (deriv^[n] (logDeriv (phi f))) 0 / n.factorial @@ -1110,6 +1114,7 @@ lemma taylorCoeff_finite_Li (S : Finset ℂ) (hS : 0 ∉ S) (n : ℕ) /-! ## Further results -/ /-- The Riemann xi function in an entire form: ξ(s) = 1 / 2 · s(s-1) · Λ₀(s) + 1 / 2. -/ +@[expose] noncomputable def riemannXi (s : ℂ) : ℂ := (1 / 2 : ℂ) * s * (s - 1) * completedRiemannZeta₀ s + (1 / 2 : ℂ) @@ -1541,6 +1546,7 @@ lemma pairedZero_involutive : Function.Involutive pairedZero := by _ = ρ.val := by ring /-- The involutive equivalence of nontrivial zeros induced by reflection `ρ ↦ 1 - ρ`. -/ +@[expose] noncomputable def pairedZeroEquiv : NontrivialZero ≃ NontrivialZero := { toFun := pairedZero invFun := pairedZero @@ -1562,6 +1568,7 @@ noncomputable def xiE1ShiftedProd (s : ℂ) : ℂ := Hadamard.weierstrassE 1 ((s - (1 / 2 : ℂ)) / (ρ.val - (1 / 2 : ℂ))) /-- A convenient “already-centered” ξ factorization hypothesis used by the genus‑1 Li pipeline. -/ +@[expose] def xiFactorizationShiftedProd : Prop := ∃ a : ℂ, ∀ s : ℂ, riemannXi s = Complex.exp a * xiE1ShiftedProd s @@ -2483,6 +2490,7 @@ In the shifted genus‑1 Hadamard factorization `xiHadamardGenusOneShifted`, the forces the linear coefficient to vanish; see `xi_hadamard_genus_one_shifted_linear_coeff_zero`. -/ /-- The raw Li summand `Aₙ(ρ) = 1 - (1 - 1 / ρ)^{-(n+1)}`. -/ +@[expose] noncomputable def liSummand (n : ℕ) (ρ : NontrivialZero) : ℂ := (1 - (1 - 1 / (ρ.val)) ^ (-(n + 1 : ℤ))) @@ -2490,6 +2498,7 @@ noncomputable def liSummand (n : ℕ) (ρ : NontrivialZero) : ℂ := This is the genus‑1 replacement for summing `liSummand` termwise: for large `‖ρ‖` the two terms cancel to order `‖ρ‖⁻²`. -/ +@[expose] noncomputable def liPairedSummand (n : ℕ) (ρ : NontrivialZero) : ℂ := liSummand n ρ + liSummand n (pairedZero ρ) @@ -2845,6 +2854,7 @@ lemma pairedZeroWithMultiplicity_involutive : Function.Involutive pairedZeroWith · simp [pairedZeroWithMultiplicity] /-- Reflection of the indexed xi zeros, preserving each zero’s multiplicity index. -/ +@[expose] noncomputable def pairedZeroWithMultiplicityEquiv : XiZeroWithMultiplicity ≃ XiZeroWithMultiplicity := { toFun := pairedZeroWithMultiplicity @@ -2987,6 +2997,7 @@ theorem summable_weighted_Li_paired_summand_of_weighted_genus simp [Finset.card_univ, nsmul_eq_mul] /-- The multiplicity-aware genus-1 canonical product for `ξ`. -/ +@[expose] noncomputable def xiE1ProdWithMultiplicity (s : ℂ) : ℂ := ∏' i : XiZeroWithMultiplicity, Hadamard.weierstrassE 1 (s / i.1.val) @@ -3002,6 +3013,7 @@ lemma multipliable_xiE1ProdWithMultiplicity_term_of_genus_one (s : ℂ) (z := z) (hz0 := hz0) hgenus s) /-- The multiplicity-aware order-`≤ 1` Hadamard factorization hypothesis for `ξ`. -/ +@[expose] def xiFactorizationProdWithMultiplicity : Prop := ∃ a b : ℂ, ∀ s : ℂ, riemannXi s = Complex.exp (a * s + b) * xiE1ProdWithMultiplicity s diff --git a/LeanPool/LiCriterion/Lc/LiCriterion/Fidelity.lean b/LeanPool/LiCriterion/Lc/LiCriterion/Fidelity.lean index a2893f9c9e..e26a6b137b 100644 --- a/LeanPool/LiCriterion/Lc/LiCriterion/Fidelity.lean +++ b/LeanPool/LiCriterion/Lc/LiCriterion/Fidelity.lean @@ -40,7 +40,7 @@ symmetric summation convention under which Li's formula actually holds, and a symmetry of the zero multiset. -/ -@[expose] public section +public section namespace LiCriterion diff --git a/LeanPool/LiCriterion/Lc/LiCriterion/GenusOne.lean b/LeanPool/LiCriterion/Lc/LiCriterion/GenusOne.lean index e77d90f537..5772e4e42d 100644 --- a/LeanPool/LiCriterion/Lc/LiCriterion/GenusOne.lean +++ b/LeanPool/LiCriterion/Lc/LiCriterion/GenusOne.lean @@ -31,7 +31,7 @@ The core term `2 - (wᵐ + w⁻ᵐ)` and the identity pairing a zero `ρ` with ` makes the sum over zeros converge at genus 1. -/ -@[expose] public section +public section open scoped BigOperators @@ -43,6 +43,7 @@ noncomputable section def core (m : ℕ) (w : ℂ) : ℂ := (2 : ℂ) - (w ^ m + (w ^ m)⁻¹) /-- The basic Li summand written as `1 - w^{-m}` (with the exponent as a `ℤ`). -/ +@[expose] def liTerm (m : ℕ) (w : ℂ) : ℂ := (1 : ℂ) - w ^ (-(m : ℤ)) lemma liTerm_add_liTerm_inv (m : ℕ) (w : ℂ) : diff --git a/LeanPool/LiCriterion/Lc/LiCriterion/GenusOnePairedSumFormula.lean b/LeanPool/LiCriterion/Lc/LiCriterion/GenusOnePairedSumFormula.lean index 66d93c1b11..5b0bf863a1 100644 --- a/LeanPool/LiCriterion/Lc/LiCriterion/GenusOnePairedSumFormula.lean +++ b/LeanPool/LiCriterion/Lc/LiCriterion/GenusOnePairedSumFormula.lean @@ -29,7 +29,7 @@ whose canonical factors are the quadratic terms This removes the linear divergence and restores absolute convergence under the genus‑1 hypothesis `∑ 1/‖ρ‖² < ∞`. -/ -@[expose] public section +public section open Complex Real Set Function Filter open scoped Topology diff --git a/LeanPool/LiCriterion/Lc/LiCriterion/HadamardBridge.lean b/LeanPool/LiCriterion/Lc/LiCriterion/HadamardBridge.lean index 9744d2af75..ac9cc3fa79 100644 --- a/LeanPool/LiCriterion/Lc/LiCriterion/HadamardBridge.lean +++ b/LeanPool/LiCriterion/Lc/LiCriterion/HadamardBridge.lean @@ -16,13 +16,14 @@ Specializes the general genus-1 Hadamard factorization to `riemannXi`, with mult the zero set of `ξ` as a `Hadamard.ZeroSetMultiplicity`, and the resulting `E₁` product. -/ -@[expose] public section +public section open Complex namespace LiCriterion /-- The nontrivial zeros of `riemannXi`, indexed once each and weighted by their analytic order. -/ +@[expose] noncomputable def xiZeroSetMultiplicity : Hadamard.ZeroSetMultiplicity riemannXi where Zero := NontrivialZero z := fun ρ => ρ.val @@ -60,6 +61,7 @@ noncomputable instance : Countable xiZeroSetMultiplicity.Zero := by simpa [xiZeroSetMultiplicity] using (inferInstance : Countable NontrivialZero) /-- The honest genus-1 canonical product for `riemannXi`, counted with multiplicity. -/ +@[expose] noncomputable def xiMultiplicityE1Prod (s : ℂ) : ℂ := xiZeroSetMultiplicity.canonicalProductZeroSetMultiplicity s diff --git a/LeanPool/LiCriterion/Lc/LiCriterion/HadamardSummabilityBridge.lean b/LeanPool/LiCriterion/Lc/LiCriterion/HadamardSummabilityBridge.lean index 48d899afbf..ce406fac98 100644 --- a/LeanPool/LiCriterion/Lc/LiCriterion/HadamardSummabilityBridge.lean +++ b/LeanPool/LiCriterion/Lc/LiCriterion/HadamardSummabilityBridge.lean @@ -16,7 +16,7 @@ This file builds the clean bridge from Hadamard order-`≤ 1` hypotheses for `ri to the genus-one summability statements used by the Li-criterion development. -/ -@[expose] public section +public section open Complex open scoped Topology diff --git a/LeanPool/LiCriterion/Lc/LiCriterion/LogDerivPole.lean b/LeanPool/LiCriterion/Lc/LiCriterion/LogDerivPole.lean index 91e701f27e..6b27eaf688 100644 --- a/LeanPool/LiCriterion/Lc/LiCriterion/LogDerivPole.lean +++ b/LeanPool/LiCriterion/Lc/LiCriterion/LogDerivPole.lean @@ -19,7 +19,7 @@ These are used in the reverse direction of Li's criterion to turn a zero of a ho function into an unboundedness statement for its logarithmic derivative. -/ -@[expose] public section +public section open scoped Topology open Filter diff --git a/LeanPool/LiCriterion/Lc/LiCriterion/MobiusMap.lean b/LeanPool/LiCriterion/Lc/LiCriterion/MobiusMap.lean index 6c79ed30c6..fb95e13883 100644 --- a/LeanPool/LiCriterion/Lc/LiCriterion/MobiusMap.lean +++ b/LeanPool/LiCriterion/Lc/LiCriterion/MobiusMap.lean @@ -27,7 +27,7 @@ Elementary norm and real-part identities for the map carrying the critical line circle, used to turn RH into a statement about the closed unit disk. -/ -@[expose] public section +public section namespace LiCriterion diff --git a/LeanPool/LiCriterion/Lc/LiCriterion/Pringsheim.lean b/LeanPool/LiCriterion/Lc/LiCriterion/Pringsheim.lean index d2abef211b..d8b8ab450a 100644 --- a/LeanPool/LiCriterion/Lc/LiCriterion/Pringsheim.lean +++ b/LeanPool/LiCriterion/Lc/LiCriterion/Pringsheim.lean @@ -25,7 +25,7 @@ needed to reduce “nonnegativity of real parts” to “nonnegativity of coeffi that the relevant Taylor coefficients are real. -/ -@[expose] public section +public section open Complex open scoped ComplexConjugate diff --git a/LeanPool/LiCriterion/Lc/LiCriterion/RHBridge.lean b/LeanPool/LiCriterion/Lc/LiCriterion/RHBridge.lean index 26750ce4f6..8b815b7de0 100644 --- a/LeanPool/LiCriterion/Lc/LiCriterion/RHBridge.lean +++ b/LeanPool/LiCriterion/Lc/LiCriterion/RHBridge.lean @@ -20,7 +20,7 @@ This file connects the project-local Li-criterion theorems to mathlib's biconditional. -/ -@[expose] public section +public section open Complex open scoped Topology diff --git a/LeanPool/LiCriterion/Lc/LiCriterion/ReverseDirection.lean b/LeanPool/LiCriterion/Lc/LiCriterion/ReverseDirection.lean index c3ac969ab2..2b193a306d 100644 --- a/LeanPool/LiCriterion/Lc/LiCriterion/ReverseDirection.lean +++ b/LeanPool/LiCriterion/Lc/LiCriterion/ReverseDirection.lean @@ -24,7 +24,7 @@ part then `φ = ξ ∘ (z ↦ 1/(1-z))` is zero-free on the unit disk, by a Prin and the functional equation pins every nontrivial zero to the critical line. -/ -@[expose] public section +public section open Complex Real Set Function Filter open scoped Topology diff --git a/LeanPool/LiCriterion/Lc/LiCriterion/XiGrowth.lean b/LeanPool/LiCriterion/Lc/LiCriterion/XiGrowth.lean index 7275a18f7b..af826d3fdb 100644 --- a/LeanPool/LiCriterion/Lc/LiCriterion/XiGrowth.lean +++ b/LeanPool/LiCriterion/Lc/LiCriterion/XiGrowth.lean @@ -38,7 +38,7 @@ The elementary majorant `u ^ A * exp (-p u) ≤ exp (A log (A/p))` (`rpow_mul_ex work that Stirling would otherwise do; it is just `log t ≤ t - 1`. -/ -@[expose] public section +public section namespace LiCriterion.XiGrowth diff --git a/LeanPool/LiCriterion/Lc/LiCriterion/XiOrderBridge.lean b/LeanPool/LiCriterion/Lc/LiCriterion/XiOrderBridge.lean index da23f049aa..675da7dc18 100644 --- a/LeanPool/LiCriterion/Lc/LiCriterion/XiOrderBridge.lean +++ b/LeanPool/LiCriterion/Lc/LiCriterion/XiOrderBridge.lean @@ -44,7 +44,7 @@ Mellin integral against the two exponentials gives `‖ξ(s)‖ ≤ exp (O (‖s with no case split on the strip and no appeal to Stirling. See the module docstring there. -/ -@[expose] public section +public section namespace LiCriterion diff --git a/LeanPool/LiCriterion/Lc/XiZeros.lean b/LeanPool/LiCriterion/Lc/XiZeros.lean index 709bc11b42..c7696a080a 100644 --- a/LeanPool/LiCriterion/Lc/XiZeros.lean +++ b/LeanPool/LiCriterion/Lc/XiZeros.lean @@ -46,7 +46,7 @@ Substituting: = (1/2) s(s-1) Λ(s) -/ -@[expose] public section +public section open Complex open scoped BigOperators @@ -54,10 +54,12 @@ open scoped BigOperators namespace XiZeros /-- Nontrivial zeros of ζ: zeros in the critical strip 0 < Re(s) < 1 -/ +@[expose] def NontrivialZero : Type := {ρ : ℂ // riemannZeta ρ = 0 ∧ 0 < ρ.re ∧ ρ.re < 1} /-- Definition of ξ (matching LiCriterion.lean) -/ +@[expose] noncomputable def riemannXi (s : ℂ) : ℂ := (1 / 2 : ℂ) * s * (s - 1) * completedRiemannZeta₀ s + (1 / 2 : ℂ) diff --git a/LeanPool/ListEdgeColoringComplete/Basic.lean b/LeanPool/ListEdgeColoringComplete/Basic.lean index 4f692e5ae0..19f16ce4e3 100644 --- a/LeanPool/ListEdgeColoringComplete/Basic.lean +++ b/LeanPool/ListEdgeColoringComplete/Basic.lean @@ -15,15 +15,17 @@ with explicit bounds in the supporting lemmas. The combinatorial certificate is developed separately from the polynomial and graph-colouring interfaces. -/ -@[expose] public section +public section namespace LeanPool.ListEdgeColoringComplete /-- Target total outdegree at an actual edge of the complete graph. -/ +@[expose] def targetDegree (n i j : ℕ) : ℕ := if n - 1 ≤ i + j then n - 1 else n - 2 /-- Rank excluded from the extended star at vertex `i`. -/ +@[expose] def blockedRank (n i : ℕ) : ℕ := if i < n / 2 then n - 2 - i else n - 1 - i + n / 2 diff --git a/LeanPool/ListEdgeColoringComplete/Certificate.lean b/LeanPool/ListEdgeColoringComplete/Certificate.lean index 5c99b937b8..6df12f8557 100644 --- a/LeanPool/ListEdgeColoringComplete/Certificate.lean +++ b/LeanPool/ListEdgeColoringComplete/Certificate.lean @@ -45,7 +45,7 @@ The article is the source of the theorem and certificate construction; the direc rank-and-polynomial proof here is not a line-by-line formalization of its proof. -/ -@[expose] public section +public section namespace LeanPool.ListEdgeColoringComplete @@ -54,6 +54,7 @@ def diagIndex (n u v : ℕ) : ℕ := if n - 1 ≤ u + v then u + v - (n - 1) else u + v /-- `u` is the low end of the edge `{u, v}` (the endpoint receiving the small rank). -/ +@[expose] def IsLowEnd (n u v : ℕ) : Prop := (diagIndex n u v % 2 = 0 ↔ v < u) diff --git a/LeanPool/ListEdgeColoringComplete/Main.lean b/LeanPool/ListEdgeColoringComplete/Main.lean index f290f840f2..0aab0d9fa9 100644 --- a/LeanPool/ListEdgeColoringComplete/Main.lean +++ b/LeanPool/ListEdgeColoringComplete/Main.lean @@ -24,7 +24,7 @@ at actual edges are transported back. Graphs with at most one vertex have no edg are handled separately. -/ -@[expose] public section +public section namespace LeanPool.ListEdgeColoringComplete diff --git a/LeanPool/ListEdgeColoringComplete/Polynomial.lean b/LeanPool/ListEdgeColoringComplete/Polynomial.lean index b982bbc097..81be170bf7 100644 --- a/LeanPool/ListEdgeColoringComplete/Polynomial.lean +++ b/LeanPool/ListEdgeColoringComplete/Polynomial.lean @@ -24,7 +24,7 @@ coefficient of the certificate monomial is `±1` (`coeff_graphPoly_certificate`) uniqueness of the certificate (`certificate_unique`). -/ -@[expose] public section +public section namespace LeanPool.ListEdgeColoringComplete @@ -101,6 +101,7 @@ noncomputable def starPoly (f : V ≃ Fin n) (u : V) : MvPolynomial (StarVar V) C ((Equiv.Perm.sign π : ℤ) : ℚ) * ∏ k, X (starMember f u k) ^ (π k : ℕ) /-- The product of the extended-star polynomials over all vertices. -/ +@[expose] noncomputable def graphPoly [Fintype V] (f : V ≃ Fin n) : MvPolynomial (StarVar V) ℚ := ∏ u, starPoly f u @@ -172,6 +173,7 @@ theorem degree_expo [Fintype V] (f : V ≃ Fin n) (P : V → Equiv.Perm (Fin n)) simp /-- The canonical family of permutations: the rank rows of the certificate. -/ +@[expose] noncomputable def canonicalPerm (f : V ≃ Fin n) (u : V) : Equiv.Perm (Fin n) := Equiv.ofBijective (canonicalRow (f u)) (Finite.injective_iff_bijective.mp (canonicalRow_injective _)) 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 310e1968d2..d4f0c0678e 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 : ℕ) @@ -1213,7 +1213,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..5103ca699e 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 @@ -563,9 +563,9 @@ theorem not_iso_hyperbolic {α β : K} (hα : α ≠ 0) : IsEmpty (Family K α w ∈ commutator K (Hyperbolic K) := by have fe₁_repr := Basis.repr_fin_three Hyperbolic.stdBasis (f Family.e₁) rw [add_assoc, Hyperbolic.stdBasis₁, Hyperbolic.stdBasis₂, Hyperbolic.stdBasis₃] at fe₁_repr - use (Hyperbolic.stdBasis.repr (f Hyperbolic.e₁)) 0 - use ((Hyperbolic.stdBasis.repr (f Hyperbolic.e₁)) 1 • Hyperbolic.e₂ + - (Hyperbolic.stdBasis.repr (f Hyperbolic.e₁)) 2 • Hyperbolic.e₃) + use (Hyperbolic.stdBasis.repr (f Family.e₁)) 0 + use ((Hyperbolic.stdBasis.repr (f Family.e₁)) 1 • Hyperbolic.e₂ + + (Hyperbolic.stdBasis.repr (f Family.e₁)) 2 • Hyperbolic.e₃) constructor · assumption · rw [Hyperbolic.commutator_repr] diff --git a/LeanPool/LowDimSolvClassification/GeneralResults.lean b/LeanPool/LowDimSolvClassification/GeneralResults.lean index f56834d6a6..89629b6c4f 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 @@ -649,7 +650,7 @@ variable (K L : Type*) [CommRing K] [LieRing L] [LieAlgebra K L] /-- We define a Lie algebra to be two-step nilpotent if its commutator ideal is contained in the center. -/ -def IsTwoStepNilpotent : Prop := commutator K L ≤ center K L +@[expose] def IsTwoStepNilpotent : Prop := commutator K L ≤ center K L theorem isTwoStepNilpotent_iff : IsTwoStepNilpotent K L ↔ commutator K L ≤ center K L := by rfl @@ -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..c0475adcfd 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,16 @@ 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 +123,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 +144,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..edad452112 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,21 @@ 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) + unfold commutatorBasis + rw [Basis.map_apply] + change (↑((LinearEquiv.ofEq _ _ _) + ((Basis.span (B_is_li_ambient (α := α) (β := β))) 0)) : Family K α β) = e₂ + rw [LinearEquiv.coe_ofEq_apply, Basis.span_apply] + rfl 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) + unfold commutatorBasis + rw [Basis.map_apply] + change (↑((LinearEquiv.ofEq _ _ _) + ((Basis.span (B_is_li_ambient (α := α) (β := β))) 1)) : Family K α β) = e₃ + rw [LinearEquiv.coe_ofEq_apply, Basis.span_apply] + rfl 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 +1115,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 +1131,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..33727a0c59 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 @@ -1006,17 +1006,30 @@ lemma case2_coarse (dim3 : Module.finrank K L = 3) (h₂ : Module.finrank K (com · exact hXc · exact LieSubmodule.lie_mem_lie trivial trivial ) - simp only [Nat.succ_eq_add_one, Nat.reduceAdd, LieIdeal.toLieSubalgebra_toSubmodule, - SetLike.coe_sort_coe, Fin.isValue, V, B] at XcX - let XcXBasis : Basis (Fin 2) K (commutator K L) := - basisOfLinearIndependentOfCardEqFinrank XcX (by simp only [Fintype.card_fin]; rw [h₂]) + let e : (commutator K L) ≃ₗ[K] + ↥(↑((LieIdeal.toLieSubalgebra K L (commutator K L) : Submodule K L)) : Set L) := { + toFun := fun z => ⟨z.1, z.2⟩ + invFun := fun z => ⟨z.1, z.2⟩ + left_inv := by intro z; cases z; rfl + right_inv := by intro z; cases z; rfl + map_add' := by intro a b; apply Subtype.ext; rfl + map_smul' := by intro c z; apply Subtype.ext; rfl + } + have h₂' : Module.finrank K + ↥(↑((LieIdeal.toLieSubalgebra K L (commutator K L) : Submodule K L)) : Set L) = 2 := + e.finrank_eq.symm.trans h₂ + let XcXBasis := + basisOfLinearIndependentOfCardEqFinrank XcX + (by simpa only [Fintype.card_fin] using h₂'.symm) have XcXBasis0 : XcXBasis 0 = ⁅B 0, X⁆ := by - simp only [XcXBasis, basisOfLinearIndependentOfCardEqFinrank] - exact congrArg (fun x : commutator K L => x.val) (Basis.mk_apply _ _ 0) + dsimp only [XcXBasis] + rw [coe_basisOfLinearIndependentOfCardEqFinrank] + simp only [Set.map_into_subtype_apply, Matrix.cons_val_zero] have XcXBasis1 : XcXBasis 1 = X := by - simp only [XcXBasis, basisOfLinearIndependentOfCardEqFinrank] - exact congrArg (fun x : commutator K L => x.val) (Basis.mk_apply _ _ 1) - let x : commutator K L := ⟨⁅B 0, ⁅B 0, X⁆⁆, by + dsimp only [XcXBasis] + rw [coe_basisOfLinearIndependentOfCardEqFinrank] + simp only [Set.map_into_subtype_apply, Matrix.cons_val_one, Matrix.cons_val_zero] + let x : (commutator K L).toSubmodule := ⟨⁅B 0, ⁅B 0, X⁆⁆, by simp only [derivedSeriesOfIdeal_succ, derivedSeriesOfIdeal_zero, Nat.reduceAdd, Fin.isValue, V, B] exact LieSubmodule.lie_mem_lie trivial trivial @@ -1026,11 +1039,13 @@ lemma case2_coarse (dim3 : Module.finrank K L = 3) (h₂ : Module.finrank K (com symm have BnB02 : ⁅BnBasis 0, BnBasis 2⁆ = (XcXBasis.repr x) 1 • BnBasis 1 + (XcXBasis.repr x) 0 • BnBasis 2 := by - have meq := Subtype.ext_iff.mp co + have meq := congrArg + ((LieIdeal.toLieSubalgebra K L (commutator K L) : Submodule K L).subtype) co unfold x at meq - simp only [Nat.reduceAdd, Fin.isValue, LieSubmodule.coe_add, SetLike.val_smul, V, B, - ] at meq + simp only [Nat.reduceAdd, Fin.isValue, V, B, + map_add, map_smul, Submodule.subtype_apply] at meq rw [XcXBasis0,XcXBasis1] at meq + change ⁅B 0, ⁅B 0, X⁆⁆ = _ at meq rw [coe_basisOfLinearIndependentOfCardEqFinrank] dsimp [Bn] simp only [Fin.isValue, B, V] 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 2323c5bb10..fad659a0cd 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) @@ -437,9 +437,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 @@ -453,9 +455,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`. -/ @@ -514,6 +518,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/Malliavin/ClarkOconeSolution.lean b/LeanPool/Malliavin/ClarkOconeSolution.lean index c6ac28d96a..f1bedb8733 100644 --- a/LeanPool/Malliavin/ClarkOconeSolution.lean +++ b/LeanPool/Malliavin/ClarkOconeSolution.lean @@ -23,7 +23,7 @@ The explicit boundary definitions support independent statement auditing; named bridges transfer their witnesses to the shared library API. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter Topology open scoped ENNReal NNReal Real Topology InnerProductSpace @@ -67,6 +67,7 @@ noncomputable def expectationL2 Lp.const 2 P (∫ w, G w ∂P) /-- The Cameron--Martin Hilbert space. -/ +@[expose] noncomputable def CameronMartin.Space {W : Type u} [NormedAddCommGroup W] [NormedSpace ℝ W] [MeasurableSpace W] [BorelSpace W] @@ -117,6 +118,7 @@ noncomputable def inclusion (covarianceMap P).domRestrict (Space P) /-- A continuous linear functional as its centered Cameron--Martin class. -/ +@[expose] noncomputable def ofDual {W : Type u} [NormedAddCommGroup W] [NormedSpace ℝ W] [MeasurableSpace W] [BorelSpace W] @@ -146,6 +148,7 @@ noncomputable def mderiv ((fderiv ℝ F x).comp (CameronMartin.inclusion P)) /-- The rank-one `H`-valued random variable `w ↦ G(w)h`. -/ +@[expose] noncomputable def smulLp {W E : Type u} [MeasurableSpace W] [NormedAddCommGroup E] [NormedSpace ℝ E] {P : Measure W} diff --git a/LeanPool/Malliavin/Malliavin/BoundaryCheck.lean b/LeanPool/Malliavin/Malliavin/BoundaryCheck.lean index 73c2edabbc..27cee5337b 100644 --- a/LeanPool/Malliavin/Malliavin/BoundaryCheck.lean +++ b/LeanPool/Malliavin/Malliavin/BoundaryCheck.lean @@ -15,7 +15,7 @@ declaration. A changed source signature therefore breaks elaboration, while the manifest separately audits the production declaration's axioms. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter Topology open scoped ENNReal NNReal Real Topology InnerProductSpace diff --git a/LeanPool/Malliavin/Malliavin/BrownianChaos.lean b/LeanPool/Malliavin/Malliavin/BrownianChaos.lean index dfa72c8ba4..3f6048a756 100644 --- a/LeanPool/Malliavin/Malliavin/BrownianChaos.lean +++ b/LeanPool/Malliavin/Malliavin/BrownianChaos.lean @@ -17,7 +17,7 @@ defines their closed homogeneous ranges and proves that every positive range lie range of the natural Itô integral. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter Topology open scoped ENNReal NNReal InnerProductSpace @@ -83,11 +83,13 @@ theorem positiveIntegralCLM_mem_naturalItoRange (restrictToSimplex (n + 1) f) /-- The unclosed range of the canonical Brownian order-`n` multiple-integral operator. -/ +@[expose] noncomputable def brownianMultipleIntegralRange (hB : IsPreBrownianReal B P) (n : ℕ) : Submodule ℝ (RandomL2 P) := LinearMap.range (integralCLM hB n).toLinearMap /-- The canonical Brownian `n`th homogeneous subspace. -/ +@[expose] noncomputable def brownianHomogeneousChaos (hB : IsPreBrownianReal B P) (n : ℕ) : ClosedSubmodule ℝ (RandomL2 P) := (brownianMultipleIntegralRange hB n).closure diff --git a/LeanPool/Malliavin/Malliavin/BrownianChaosHilbertSum.lean b/LeanPool/Malliavin/Malliavin/BrownianChaosHilbertSum.lean index 5bebcfd063..003c987c50 100644 --- a/LeanPool/Malliavin/Malliavin/BrownianChaosHilbertSum.lean +++ b/LeanPool/Malliavin/Malliavin/BrownianChaosHilbertSum.lean @@ -15,7 +15,7 @@ gives a single canonical isometry from the external Hilbert sum of positive simp random `L²`; its range is exactly the closed supremum of the positive canonical Brownian chaoses. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter Topology open scoped ENNReal NNReal InnerProductSpace @@ -34,6 +34,7 @@ variable {W : Type*} [NormedAddCommGroup W] [NormedSpace ℝ W] omit [CompleteSpace W] [BorelSpace W] in /-- The canonical Brownian simplex integral at one positive order, bundled as a linear isometry. -/ +@[expose] noncomputable def brownianSimplexIntegralLI (hB : IsPreBrownianReal B P) (hsm : ∀ t, StronglyMeasurable (B t)) (n : ℕ) : IteratedIntegralConstruction.SimplexKernel (n + 1) →ₗᵢ[ℝ] RandomL2 P where diff --git a/LeanPool/Malliavin/Malliavin/BrownianChaosMartingaleRepresentation.lean b/LeanPool/Malliavin/Malliavin/BrownianChaosMartingaleRepresentation.lean index 99f14c2d26..9c1247b3bc 100644 --- a/LeanPool/Malliavin/Malliavin/BrownianChaosMartingaleRepresentation.lean +++ b/LeanPool/Malliavin/Malliavin/BrownianChaosMartingaleRepresentation.lean @@ -16,7 +16,7 @@ canonical Brownian multiple-integral ranges. The remaining hypothesis is exactl that concrete tower. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter Topology open scoped ENNReal NNReal InnerProductSpace @@ -33,6 +33,7 @@ variable {W : Type*} [NormedAddCommGroup W] [NormedSpace ℝ W] {B : ℝ≥0 → W → ℝ} /-- Totality of the canonical Brownian homogeneous chaos tower. -/ +@[expose] def BrownianChaosTotal (hB : IsPreBrownianReal B P) : Prop := (⨆ n : ℕ, (brownianHomogeneousChaos hB n : Submodule ℝ (RandomL2 P)) ).topologicalClosure = ⊤ diff --git a/LeanPool/Malliavin/Malliavin/BrownianChaosTotality.lean b/LeanPool/Malliavin/Malliavin/BrownianChaosTotality.lean index 94a72c43ba..43e2779fee 100644 --- a/LeanPool/Malliavin/Malliavin/BrownianChaosTotality.lean +++ b/LeanPool/Malliavin/Malliavin/BrownianChaosTotality.lean @@ -15,7 +15,7 @@ products of ordered, disjoint Brownian increments. Thus its remaining totality equivalent to a concrete dense-span statement for those products. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter Topology open scoped ENNReal NNReal InnerProductSpace @@ -32,11 +32,13 @@ variable {W : Type*} [NormedAddCommGroup W] [NormedSpace ℝ W] {B : ℝ≥0 → W → ℝ} /-- All finite products of ordered, disjoint Brownian increments, including the empty product. -/ +@[expose] def brownianOrderedChainSet (hB : IsPreBrownianReal B P) : Set (RandomL2 P) := Set.range fun a : Σ n : ℕ, OrderedBoxIndex n => chainIntegralLp hB a.2.u a.2.v /-- The algebraic span of finite ordered Brownian increment products. -/ +@[expose] def brownianOrderedChainSpan (hB : IsPreBrownianReal B P) : Submodule ℝ (RandomL2 P) := Submodule.span ℝ (brownianOrderedChainSet hB) diff --git a/LeanPool/Malliavin/Malliavin/BrownianClarkOconeCapstone.lean b/LeanPool/Malliavin/Malliavin/BrownianClarkOconeCapstone.lean index 09b8aeb3fb..2db22a69c0 100644 --- a/LeanPool/Malliavin/Malliavin/BrownianClarkOconeCapstone.lean +++ b/LeanPool/Malliavin/Malliavin/BrownianClarkOconeCapstone.lean @@ -22,7 +22,7 @@ Clark--Ocone formula, and a Brownian-compatible `ClarkOconeFamily` are all avail standing hypotheses alone, with no remaining identity-family input. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory open scoped ENNReal NNReal InnerProductSpace diff --git a/LeanPool/Malliavin/Malliavin/BrownianCylinderDensity.lean b/LeanPool/Malliavin/Malliavin/BrownianCylinderDensity.lean index c60efd9893..00a2e51ac1 100644 --- a/LeanPool/Malliavin/Malliavin/BrownianCylinderDensity.lean +++ b/LeanPool/Malliavin/Malliavin/BrownianCylinderDensity.lean @@ -16,7 +16,7 @@ This file proves that powers of finite linear combinations of Brownian coordinat ambient real `L²` space whenever the Brownian process generates the ambient measurable space. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter Topology open NormedSpace @@ -251,11 +251,13 @@ theorem memLp_two_stepSum_pow (hB : IsPreBrownianReal B P) ring /-- A polynomial generator obtained by taking a power of a finite Brownian step sum. -/ +@[expose] def brownianStepPowerLp (hB : IsPreBrownianReal B P) (v : ℝ≥0 →₀ ℝ) (n : ℕ) : RandomL2 P := (memLp_two_stepSum_pow hB v n).toLp fun w ↦ stepSum B v w ^ n /-- The algebraic space of Brownian polynomial cylinders. -/ +@[expose] def brownianPolynomialSpan (hB : IsPreBrownianReal B P) : Submodule ℝ (RandomL2 P) := Submodule.span ℝ (Set.range fun a : (ℝ≥0 →₀ ℝ) × ℕ ↦ diff --git a/LeanPool/Malliavin/Malliavin/BrownianHermite.lean b/LeanPool/Malliavin/Malliavin/BrownianHermite.lean index f023b759c4..d3eb32c845 100644 --- a/LeanPool/Malliavin/Malliavin/BrownianHermite.lean +++ b/LeanPool/Malliavin/Malliavin/BrownianHermite.lean @@ -18,7 +18,7 @@ real polynomial ring. This is the finite-dimensional algebraic half of the stan route from polynomial Brownian cylinders to Wiener--Itô chaos. -/ -@[expose] public section +public section noncomputable section @@ -83,6 +83,7 @@ theorem span_range_hermiteReal : /-- The monic Hermite family with variance parameter `variance`, characterized by `H₀ = 1`, `H₁ = X`, and `Hₙ₊₂ = X Hₙ₊₁ - (n+1) variance Hₙ`. -/ +@[expose] noncomputable def varianceHermite (variance : ℝ) : ℕ → Polynomial ℝ | 0 => 1 | 1 => Polynomial.X @@ -147,6 +148,7 @@ theorem span_range_varianceHermite (variance : ℝ) : variable {M : Type*} [AddCommMonoid M] [Module ℝ M] /-- The linear map out of `ℝ[X]` prescribed by an arbitrary sequence on the monomial basis. -/ +@[expose] noncomputable def polynomialFamilyLinearMap (xpow : ℕ → M) : Polynomial ℝ →ₗ[ℝ] M := (Polynomial.basisMonomials ℝ).constr ℝ xpow diff --git a/LeanPool/Malliavin/Malliavin/BrownianHermiteClarkOcone.lean b/LeanPool/Malliavin/Malliavin/BrownianHermiteClarkOcone.lean index 932a6d2eb3..7604eca3aa 100644 --- a/LeanPool/Malliavin/Malliavin/BrownianHermiteClarkOcone.lean +++ b/LeanPool/Malliavin/Malliavin/BrownianHermiteClarkOcone.lean @@ -17,7 +17,7 @@ hypothesis. Combining the two identifies the canonical inverse-Itô integrand w predictable Malliavin derivative and yields the concrete Clark--Ocone formula. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory open scoped ENNReal NNReal InnerProductSpace @@ -105,6 +105,7 @@ theorem sub_expectationL2_eq_naturalItoIntegral_of_hermiteMultipleIntegralIdenti /-- The Hermite/multiple-integral identity constructs the concrete natural Brownian Clark--Ocone family. -/ +@[expose] noncomputable def ClarkOconeFamily.ofHermiteMultipleIntegralIdentity (hB : IsPreBrownianReal B P) (coordinate : ℝ≥0 → StrongDual ℝ W) (coordinate_apply : ∀ t w, B t w = coordinate t w) diff --git a/LeanPool/Malliavin/Malliavin/BrownianHermiteMultipleIntegral.lean b/LeanPool/Malliavin/Malliavin/BrownianHermiteMultipleIntegral.lean index 70d4ead6eb..d9f14a1c1e 100644 --- a/LeanPool/Malliavin/Malliavin/BrownianHermiteMultipleIntegral.lean +++ b/LeanPool/Malliavin/Malliavin/BrownianHermiteMultipleIntegral.lean @@ -17,7 +17,7 @@ only concerns orders at least two. Under that hypothesis, homogeneous-chaos mem ordered-chain compatibility and hence natural martingale representation. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory open scoped ENNReal NNReal InnerProductSpace @@ -35,6 +35,7 @@ variable {W : Type*} [NormedAddCommGroup W] [NormedSpace ℝ W] /-- The genuinely higher-order Hermite/multiple-integral identity for finite Brownian step kernels. -/ +@[expose] def BrownianHigherHermiteMultipleIntegralIdentity (hB : IsPreBrownianReal B P) : Prop := ∀ v n, 2 ≤ n → diff --git a/LeanPool/Malliavin/Malliavin/BrownianIterated.lean b/LeanPool/Malliavin/Malliavin/BrownianIterated.lean index 3b53bad003..f457cb0bf4 100644 --- a/LeanPool/Malliavin/Malliavin/BrownianIterated.lean +++ b/LeanPool/Malliavin/Malliavin/BrownianIterated.lean @@ -15,7 +15,7 @@ finite chain of Brownian increments as an element of `L²(P)`. These terminal v required images of ordered-box kernels in `IteratedIntegralFamily.IsBrownian`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter open scoped ENNReal NNReal InnerProductSpace @@ -123,6 +123,7 @@ omit [NormedAddCommGroup W] [NormedSpace ℝ W] [CompleteSpace W] [BorelSpace W] [SecondCountableTopology W] [IsGaussian P] in /-- A Brownian chain whose endpoints precede `t`, bundled as an `𝓕_t`-measurable `L²` random variable. -/ +@[expose] noncomputable def adaptedChainIntegralLp (hB : IsPreBrownianReal B P) (hsm : ∀ s, StronglyMeasurable (B s)) {n : ℕ} (u v : Fin n → ℝ≥0) (t : ℝ≥0) @@ -158,6 +159,7 @@ omit [NormedAddCommGroup W] [NormedSpace ℝ W] [CompleteSpace W] [BorelSpace W] [SecondCountableTopology W] [IsGaussian P] in /-- The prefix of an ordered Brownian increment chain, bundled at the starting time of its last increment. -/ +@[expose] noncomputable def orderedChainPrefixAdapted (hB : IsPreBrownianReal B P) (hsm : ∀ s, StronglyMeasurable (B s)) {n : ℕ} (u v : Fin (n + 1) → ℝ≥0) @@ -401,6 +403,7 @@ theorem restrictedSimplexMeasure_orderedBox_ne_top {n : ℕ} (a : OrderedBoxInde omit [NormedAddCommGroup W] [NormedSpace ℝ W] [CompleteSpace W] [MeasurableSpace W] [BorelSpace W] [SecondCountableTopology W] [IsGaussian P] in /-- The indicator of an ordered box in the restricted-simplex kernel space. -/ +@[expose] noncomputable def orderedBoxSimplexKernel {n : ℕ} (a : OrderedBoxIndex n) : IteratedIntegralConstruction.SimplexKernel n := indicatorConstLp 2 (measurableSet_orderedBox a.u a.v) @@ -444,6 +447,7 @@ theorem inner_orderedBoxSimplexKernel_eq_chainIntegralLp omit [NormedAddCommGroup W] [NormedSpace ℝ W] [CompleteSpace W] [MeasurableSpace W] [BorelSpace W] [SecondCountableTopology W] [IsGaussian P] in /-- Formal finite combinations of ordered-box indicators in simplex `L²`. -/ +@[expose] noncomputable def orderedBoxToSimplexKernel (n : ℕ) : (OrderedBoxIndex n →₀ ℝ) →ₗ[ℝ] IteratedIntegralConstruction.SimplexKernel n := Finsupp.linearCombination ℝ orderedBoxSimplexKernel @@ -451,6 +455,7 @@ noncomputable def orderedBoxToSimplexKernel (n : ℕ) : omit [NormedAddCommGroup W] [NormedSpace ℝ W] [CompleteSpace W] [BorelSpace W] [SecondCountableTopology W] [IsGaussian P] in /-- The corresponding formal finite combinations of Brownian chain products. -/ +@[expose] noncomputable def orderedBoxToRandom (hB : IsPreBrownianReal B P) (n : ℕ) : (OrderedBoxIndex n →₀ ℝ) →ₗ[ℝ] RandomL2 P := Finsupp.linearCombination ℝ fun a ↦ chainIntegralLp hB a.u a.v @@ -493,6 +498,7 @@ theorem norm_orderedBoxToRandom omit [NormedAddCommGroup W] [NormedSpace ℝ W] [CompleteSpace W] [MeasurableSpace W] [BorelSpace W] [SecondCountableTopology W] [IsGaussian P] in /-- The deterministic density input needed to complete ordered-box values to the whole simplex. -/ +@[expose] def OrderedBoxDense (n : ℕ) : Prop := DenseRange (orderedBoxToSimplexKernel n) @@ -623,7 +629,7 @@ theorem restrictedSimplexMeasure_le (n : ℕ) : omit [NormedAddCommGroup W] [NormedSpace ℝ W] [CompleteSpace W] [MeasurableSpace W] [BorelSpace W] [SecondCountableTopology W] [IsGaussian P] in /-- Restriction of a full product kernel to the strict simplex. -/ -noncomputable def restrictToSimplex (n : ℕ) : +@[expose] noncomputable def restrictToSimplex (n : ℕ) : IteratedKernel n →L[ℝ] IteratedIntegralConstruction.SimplexKernel n := IteratedIntegralConstruction.restrictToSimplex n @@ -667,6 +673,7 @@ theorem norm_restrictToSimplex_le (n : ℕ) (f : IteratedKernel n) : omit [CompleteSpace W] [BorelSpace W] in /-- The positive-order Brownian integral on full product kernels, obtained by restricting to the simplex and applying the completed ordered-box map. -/ +@[expose] noncomputable def positiveIntegralCLM (hB : IsPreBrownianReal B P) (n : ℕ) : IteratedKernel (n + 1) →L[ℝ] RandomL2 P := (simplexIntegral hB (n + 1)).comp (restrictToSimplex (n + 1)) @@ -731,12 +738,14 @@ omit [NormedAddCommGroup W] [NormedSpace ℝ W] [CompleteSpace W] [MeasurableSpa [BorelSpace W] [SecondCountableTopology W] [IsGaussian P] in /-- Density of ordered boxes at every positive order. This is the sole deterministic analytic input to the completed Brownian family below. -/ +@[expose] def PositiveOrderedBoxDense : Prop := ∀ n : ℕ, OrderedBoxDense (n + 1) omit [CompleteSpace W] [BorelSpace W] in /-- The completed all-order operator: canonical constants at order zero and Brownian simplex integrals at every positive order. -/ +@[expose] noncomputable def integralCLM (hB : IsPreBrownianReal B P) : (n : ℕ) → IteratedKernel n →L[ℝ] RandomL2 P | 0 => iteratedIntegralCLM hB 0 @@ -819,6 +828,7 @@ theorem integralCLM_norm_le omit [CompleteSpace W] [BorelSpace W] in /-- A completed Brownian iterated-integral family, conditional only on ordered-box density in the restricted simplex kernel spaces. -/ +@[expose] noncomputable def family (hB : IsPreBrownianReal B P) (hsm : ∀ s, StronglyMeasurable (B s)) (hdense : PositiveOrderedBoxDense) : IteratedIntegralFamily P where diff --git a/LeanPool/Malliavin/Malliavin/BrownianMultipleIntegral.lean b/LeanPool/Malliavin/Malliavin/BrownianMultipleIntegral.lean index 81328f2292..6cdafd704d 100644 --- a/LeanPool/Malliavin/Malliavin/BrownianMultipleIntegral.lean +++ b/LeanPool/Malliavin/Malliavin/BrownianMultipleIntegral.lean @@ -16,7 +16,7 @@ constructed from Brownian increment products. Its range agrees orderwise with t operator range, so its closed ranges are the canonical Brownian homogeneous chaoses. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter Topology open scoped ENNReal NNReal InnerProductSpace @@ -35,7 +35,7 @@ variable {W : Type*} [NormedAddCommGroup W] [NormedSpace ℝ W] omit [CompleteSpace W] [BorelSpace W] in /-- The canonical Brownian multiple-integral operator `Iₙ = n! Jₙ ∘ symmetrizeL`. -/ -noncomputable def brownianMultipleIntegralCLM +@[expose] noncomputable def brownianMultipleIntegralCLM (hB : IsPreBrownianReal B P) (n : ℕ) : IteratedKernel n →L[ℝ] RandomL2 P := (n.factorial : ℝ) • (integralCLM hB n).comp diff --git a/LeanPool/Malliavin/Malliavin/BrownianMultipleIntegralBox.lean b/LeanPool/Malliavin/Malliavin/BrownianMultipleIntegralBox.lean index b4ef566fde..67ba359171 100644 --- a/LeanPool/Malliavin/Malliavin/BrownianMultipleIntegralBox.lean +++ b/LeanPool/Malliavin/Malliavin/BrownianMultipleIntegralBox.lean @@ -15,7 +15,7 @@ simplex only the identity permutation survives, so the factorial normalization i multiple-integral operator cancels that average and recovers the Brownian increment chain. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter open scoped ENNReal NNReal InnerProductSpace diff --git a/LeanPool/Malliavin/Malliavin/BrownianMultipleIntegralBoxSpan.lean b/LeanPool/Malliavin/Malliavin/BrownianMultipleIntegralBoxSpan.lean index cc08ff9426..7146a04361 100644 --- a/LeanPool/Malliavin/Malliavin/BrownianMultipleIntegralBoxSpan.lean +++ b/LeanPool/Malliavin/Malliavin/BrownianMultipleIntegralBoxSpan.lean @@ -16,7 +16,7 @@ corresponding simplex combination divided by the factorial. On the stochastic s factorial cancels and the result is the matching finite combination of Brownian increment chains. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory open scoped ENNReal NNReal InnerProductSpace @@ -126,6 +126,7 @@ theorem canonicalOrderedBoxMultipleIntegralMap_eq_orderedBoxToRandom omit [CompleteSpace W] [BorelSpace W] in /-- The algebraic range of finite ordered Brownian increment chains of one fixed order. -/ +@[expose] noncomputable def brownianOrderedBoxOrderRange (hB : IsPreBrownianReal B P) (n : ℕ) : Submodule ℝ (RandomL2 P) := LinearMap.range (orderedBoxToRandom hB n) diff --git a/LeanPool/Malliavin/Malliavin/BrownianOrderedBoxDensity.lean b/LeanPool/Malliavin/Malliavin/BrownianOrderedBoxDensity.lean index 449080385d..f83e2b3728 100644 --- a/LeanPool/Malliavin/Malliavin/BrownianOrderedBoxDensity.lean +++ b/LeanPool/Malliavin/Malliavin/BrownianOrderedBoxDensity.lean @@ -15,7 +15,7 @@ indicators lie in the range of the ordered-box linear map, so simple-function de this map has dense range at every positive order. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory open scoped ENNReal NNReal symmDiff @@ -468,7 +468,7 @@ theorem positiveOrderedBoxDense : PositiveOrderedBoxDense := /-- The canonical completed Brownian iterated-integral family, with ordered-box density discharged. -/ -noncomputable def brownianIteratedIntegralFamily +@[expose] noncomputable def brownianIteratedIntegralFamily {W : Type*} [NormedAddCommGroup W] [NormedSpace ℝ W] [MeasurableSpace W] [SecondCountableTopology W] diff --git a/LeanPool/Malliavin/Malliavin/BrownianPolynomialHermite.lean b/LeanPool/Malliavin/Malliavin/BrownianPolynomialHermite.lean index afa31d4622..41329a9823 100644 --- a/LeanPool/Malliavin/Malliavin/BrownianPolynomialHermite.lean +++ b/LeanPool/Malliavin/Malliavin/BrownianPolynomialHermite.lean @@ -18,7 +18,7 @@ those Wick values belong to the closed span of ordered, disjoint increment produ that this exact assertion implies canonical-chaos totality and natural martingale representation. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter Topology open scoped ENNReal NNReal InnerProductSpace @@ -36,6 +36,7 @@ variable {W : Type*} [NormedAddCommGroup W] [NormedSpace ℝ W] /-- The generalized Hermite value of a finite Brownian step sum, assembled from its powers. The variance parameter is the squared norm of the corresponding deterministic step kernel. -/ +@[expose] noncomputable def brownianWickPowerLp (hB : IsPreBrownianReal B P) (v : ℝ≥0 →₀ ℝ) (n : ℕ) : RandomL2 P := polynomialFamilyLinearMap (brownianStepPowerLp hB v) @@ -134,11 +135,13 @@ theorem stepToRandom_mem_orderedChainSpan (hB : IsPreBrownianReal B P) /-- The exact remaining stochastic Hermite input: every generalized Hermite value of a finite Brownian step sum is approximable by finite products of ordered, disjoint increments. -/ +@[expose] def BrownianWickChainCompatible (hB : IsPreBrownianReal B P) : Prop := ∀ v n, brownianWickPowerLp hB v n ∈ (brownianOrderedChainSpan hB).topologicalClosure /-- The genuinely higher-order part of stochastic Wick-chain compatibility. -/ +@[expose] def BrownianHigherWickChainCompatible (hB : IsPreBrownianReal B P) : Prop := ∀ v n, 2 ≤ n → brownianWickPowerLp hB v n ∈ (brownianOrderedChainSpan hB).topologicalClosure diff --git a/LeanPool/Malliavin/Malliavin/BrownianPurePowerDuality.lean b/LeanPool/Malliavin/Malliavin/BrownianPurePowerDuality.lean index 0d6c1a8614..b056742919 100644 --- a/LeanPool/Malliavin/Malliavin/BrownianPurePowerDuality.lean +++ b/LeanPool/Malliavin/Malliavin/BrownianPurePowerDuality.lean @@ -17,7 +17,7 @@ computes the pairing of a Wick power with every ordered Brownian increment chain density then identifies the Wick power with the canonical pure-power multiple integral. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter Topology open scoped ENNReal NNReal InnerProductSpace diff --git a/LeanPool/Malliavin/Malliavin/BrownianPurePowerIntegral.lean b/LeanPool/Malliavin/Malliavin/BrownianPurePowerIntegral.lean index 149921748d..453d346b8e 100644 --- a/LeanPool/Malliavin/Malliavin/BrownianPurePowerIntegral.lean +++ b/LeanPool/Malliavin/Malliavin/BrownianPurePowerIntegral.lean @@ -17,7 +17,7 @@ pure-power inner-product formula gives the usual factorial isometry. At order o operator is identified with the concrete Brownian Wick power of a finite step kernel. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory open scoped ENNReal NNReal InnerProductSpace @@ -34,6 +34,7 @@ variable {W : Type*} [NormedAddCommGroup W] [NormedSpace ℝ W] {B : ℝ≥0 → W → ℝ} /-- The genuine order-`n` Brownian multiple integral of the pure power `f^{⊗n}`. -/ +@[expose] noncomputable def brownianPurePowerIntegral (hB : IsPreBrownianReal B P) (n : ℕ) (f : Lp ℝ 2 nonnegativeLebesgueMeasure) : RandomL2 P := brownianMultipleIntegralCLM hB n (iteratedKernelPurePower n f) diff --git a/LeanPool/Malliavin/Malliavin/BrownianPurePowerRecurrence.lean b/LeanPool/Malliavin/Malliavin/BrownianPurePowerRecurrence.lean index 811c3ada58..20007789f9 100644 --- a/LeanPool/Malliavin/Malliavin/BrownianPurePowerRecurrence.lean +++ b/LeanPool/Malliavin/Malliavin/BrownianPurePowerRecurrence.lean @@ -17,7 +17,7 @@ identity is equivalent to the matching recurrence for canonical pure-power multi Thus the remaining all-order stochastic input can be stated as the usual Itô product recurrence. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory open scoped ENNReal NNReal InnerProductSpace diff --git a/LeanPool/Malliavin/Malliavin/BrownianWickIsometry.lean b/LeanPool/Malliavin/Malliavin/BrownianWickIsometry.lean index 179f53e3a6..73a3e54d18 100644 --- a/LeanPool/Malliavin/Malliavin/BrownianWickIsometry.lean +++ b/LeanPool/Malliavin/Malliavin/BrownianWickIsometry.lean @@ -15,7 +15,7 @@ The exact centered Gaussian law of each finite Brownian step sum transfers gener orthogonality to the concrete `L²` Wick powers used in the Brownian chaos reduction. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory open scoped ENNReal NNReal InnerProductSpace diff --git a/LeanPool/Malliavin/Malliavin/BrownianWickPurePowerComparison.lean b/LeanPool/Malliavin/Malliavin/BrownianWickPurePowerComparison.lean index 878210a67d..3ec4a3b67a 100644 --- a/LeanPool/Malliavin/Malliavin/BrownianWickPurePowerComparison.lean +++ b/LeanPool/Malliavin/Malliavin/BrownianWickPurePowerComparison.lean @@ -17,7 +17,7 @@ formula. This file packages that scalar endpoint and relates it to both the hig identity and the pure-power Itô recurrence. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory open scoped ENNReal NNReal InnerProductSpace diff --git a/LeanPool/Malliavin/Malliavin/CameronMartin.lean b/LeanPool/Malliavin/Malliavin/CameronMartin.lean index 87c313075f..143f28f390 100644 --- a/LeanPool/Malliavin/Malliavin/CameronMartin.lean +++ b/LeanPool/Malliavin/Malliavin/CameronMartin.lean @@ -32,7 +32,7 @@ equivalent to `μ`; using that characterization as the definition here would be * `CameronMartin.logDensity`: the log Radon--Nikodym derivative used by the next rung. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory open scoped ENNReal NNReal Real Topology @@ -180,9 +180,11 @@ section Translations variable {W : Type*} [NormedAddCommGroup W] [MeasurableSpace W] /-- Translation of the ambient space by `h`. -/ +@[expose] def translate (h : W) : W → W := fun x ↦ x + h /-- The law obtained by translating `μ` by `h`. -/ +@[expose] noncomputable def translatedMeasure (μ : Measure W) (h : W) : Measure W := μ.map (translate h) @@ -212,6 +214,7 @@ def IsAdmissibleShift (μ : Measure W) (h : W) : Prop := translatedMeasure μ h ≪ μ /-- A shift is quasi-invariant when translation preserves the measure class. -/ +@[expose] def IsQuasiInvariantShift (μ : Measure W) (h : W) : Prop := translatedMeasure μ h ≪ μ ∧ μ ≪ translatedMeasure μ h @@ -225,9 +228,11 @@ variable {W : Type*} [NormedAddCommGroup W] [NormedSpace ℝ W] (μ : Measure W) [IsGaussian μ] /-- The Bochner mean of a Gaussian measure. -/ +@[expose] noncomputable def mean : W := ∫ x, x ∂μ /-- The centered identity random variable. -/ +@[expose] noncomputable def centeredId : W → W := id - fun _ ↦ mean μ /-- Gaussian measures have a square-integrable centered identity. -/ @@ -237,10 +242,12 @@ theorem memLp_centeredId : MemLp (centeredId μ) 2 μ := by exact h_id.sub h_const /-- The centered identity as an element of `L²(μ; W)`. -/ +@[expose] noncomputable def centeredIdLp : Lp W 2 μ := (memLp_centeredId μ).toLp (centeredId μ) /-- The continuous map taking a continuous linear functional to its centered `L²(μ)` class. -/ +@[expose] noncomputable def centeredDualToLp : StrongDual ℝ W →L[ℝ] Lp ℝ 2 μ := StrongDual.toLp μ 2 - (Lp.constL 2 μ ℝ).comp (ContinuousLinearMap.apply ℝ ℝ (mean μ)) @@ -266,6 +273,7 @@ theorem centeredDualToLp_ae_eq (L : StrongDual ℝ W) : simpa [hL, hc, Function.const_apply] using hsub /-- The first Gaussian chaos: the closed span of centered continuous linear functionals. -/ +@[expose] noncomputable def firstChaos : Submodule ℝ (Lp ℝ 2 μ) := (centeredDualToLp μ).range.topologicalClosure @@ -273,6 +281,7 @@ noncomputable def firstChaos : Submodule ℝ (Lp ℝ 2 μ) := noncomputable abbrev Space := firstChaos μ /-- Continuous linear functionals give a dense family of Cameron--Martin vectors. -/ +@[expose] noncomputable def ofDual : StrongDual ℝ W →L[ℝ] Space μ := (centeredDualToLp μ).codRestrict (firstChaos μ) fun L ↦ Submodule.le_topologicalClosure _ ⟨L, rfl⟩ @@ -333,6 +342,7 @@ noncomputable def covarianceLinearMap : Lp ℝ 2 μ →ₗ[ℝ] W where /-- The covariance map is the Hölder pairing of a scalar `L²` random variable with the centered identity. Its continuity is supplied by the `L²` pairing. -/ +@[expose] noncomputable def covarianceMap : Lp ℝ 2 μ →L[ℝ] W := ((ContinuousLinearMap.lsmul ℝ ℝ (E := W)).lpPairing μ 2 2).flip (centeredIdLp μ) @@ -348,6 +358,7 @@ theorem covarianceMap_apply (f : Lp ℝ 2 μ) : rw [hx] /-- The covariance, or RKHS, embedding of the Cameron--Martin space into `W`. -/ +@[expose] noncomputable def inclusion : Space μ →L[ℝ] W := (covarianceMap μ).domRestrict (firstChaos μ) @@ -407,11 +418,13 @@ theorem exists_integrable_exp_sq : exact h_fernique /-- The translated law along a Cameron--Martin vector. -/ +@[expose] noncomputable def translated (h : Space μ) : Measure W := translatedMeasure μ (inclusion μ h) /-- Its log Radon--Nikodym derivative with respect to `μ`. The Cameron--Martin theorem will identify this almost everywhere with `h - ‖h‖² / 2`. -/ +@[expose] noncomputable def logDensity (h : Space μ) : W → ℝ := llr (translated μ h) μ diff --git a/LeanPool/Malliavin/Malliavin/CameronMartinTheorem.lean b/LeanPool/Malliavin/Malliavin/CameronMartinTheorem.lean index 171e02c265..989e76bce0 100644 --- a/LeanPool/Malliavin/Malliavin/CameronMartinTheorem.lean +++ b/LeanPool/Malliavin/Malliavin/CameronMartinTheorem.lean @@ -31,7 +31,7 @@ its measure-theoretic consequences: mutual absolute continuity, the Radon--Nikod and the almost-everywhere logarithmic density formula used by the closability rung. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter open scoped ENNReal NNReal Real Topology diff --git a/LeanPool/Malliavin/Malliavin/ChainRule.lean b/LeanPool/Malliavin/Malliavin/ChainRule.lean index 703d931a4f..2fc36e12e1 100644 --- a/LeanPool/Malliavin/Malliavin/ChainRule.lean +++ b/LeanPool/Malliavin/Malliavin/ChainRule.lean @@ -41,7 +41,7 @@ by dominated convergence (`tendsto_toLp_of_dominated`, bound `(2K)² ‖D_cl F everywhere convergent subsequence. Closedness of the graph (`mem_domD12_of_tendsto`) concludes. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter Topology open scoped ENNReal NNReal InnerProductSpace @@ -252,6 +252,7 @@ theorem norm_mderivClosure_comp_le (hφ : ContDiff ℝ 1 φ) (hK : ∀ x, ‖der exact mul_le_mul_of_nonneg_right h1 (norm_nonneg _) /-- `φ ∘ F` as an element of the submodule `D12 μ`. -/ +@[expose] noncomputable def D12.comp (hφ : ContDiff ℝ 1 φ) (hK : ∀ x, ‖deriv φ x‖₊ ≤ K) (F : D12 μ) : D12 μ := ⟨(memLp_comp_of_deriv_le μ hφ hK F).toLp _, (comp_mem_domD12 μ hφ hK F.2).1⟩ @@ -460,6 +461,7 @@ theorem norm_mderivClosure_mul_le (hG : IsSmoothBounded G) {F : Lp ℝ 2 μ} (hF exact mul_le_mul_of_nonneg_right (hD' x) (norm_nonneg _) /-- `F · G` as an element of the submodule `D12 μ`. -/ +@[expose] noncomputable def D12.mulSmooth (hG : IsSmoothBounded G) (F : D12 μ) : D12 μ := ⟨(memLp_mul_smoothBounded μ hG F).toLp _, (mul_mem_domD12 μ hG F.2).1⟩ @@ -889,6 +891,7 @@ theorem norm_mderivClosure_comp_pi_le {n : ℕ} {f : (Fin n → ℝ) → ℝ} (h rw [ENNReal.toReal_mul, toReal_enorm, Real.norm_eq_abs, abs_of_nonneg hK0, Lp.norm_def] /-- `f (F₁, …, Fₙ)` as an element of the submodule `D12 μ`. -/ +@[expose] noncomputable def D12.compPi {n : ℕ} {f : (Fin n → ℝ) → ℝ} (hf : ContDiff ℝ 1 f) {K : ℝ} (hK : ∀ y, ‖fderiv ℝ f y‖ ≤ K) (F : Fin n → D12 μ) : D12 μ := ⟨(memLp_comp_pi μ hf hK fun i ↦ (F i : Lp ℝ 2 μ)).toLp _, diff --git a/LeanPool/Malliavin/Malliavin/ChaosMartingaleRepresentation.lean b/LeanPool/Malliavin/Malliavin/ChaosMartingaleRepresentation.lean index 9404a68e0e..1eb272c583 100644 --- a/LeanPool/Malliavin/Malliavin/ChaosMartingaleRepresentation.lean +++ b/LeanPool/Malliavin/Malliavin/ChaosMartingaleRepresentation.lean @@ -15,7 +15,7 @@ This file connects the selected homogeneous Wiener chaos tower to the closed ran natural Brownian Itô integral. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter Topology open scoped ENNReal NNReal InnerProductSpace diff --git a/LeanPool/Malliavin/Malliavin/ClarkOcone.lean b/LeanPool/Malliavin/Malliavin/ClarkOcone.lean index c2c8563199..c964bd7b67 100644 --- a/LeanPool/Malliavin/Malliavin/ClarkOcone.lean +++ b/LeanPool/Malliavin/Malliavin/ClarkOcone.lean @@ -35,7 +35,7 @@ these hypotheses, the public identity and its centered/norm consequences concern contract operator rather than asserting that it is the constructed Brownian Itô integral. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter Topology open scoped ENNReal NNReal InnerProductSpace @@ -245,6 +245,7 @@ theorem measurable_fst_predictable (𝓕 : Filtration ℝ≥0 ‹MeasurableSpace /-- Pull a deterministic time integrand back to the time--sample product along `Prod.fst`. This is an isometry because `P` is a probability measure. -/ +@[expose] noncomputable def deterministicTimeEmbedding : Lp ℝ 2 nonnegativeLebesgueMeasure →ₗᵢ[ℝ] TimeProcessL2 P := Lp.compMeasurePreservingₗᵢ ℝ Prod.fst measurePreserving_fst @@ -265,6 +266,7 @@ theorem deterministicTimeEmbedding_aestronglyMeasurable /-- The linear-isometric inclusion of deterministic square-integrable time functions into predictable product-space processes. -/ +@[expose] noncomputable def deterministicPredictableEmbedding (𝓕 : Filtration ℝ≥0 ‹MeasurableSpace W›) : Lp ℝ 2 nonnegativeLebesgueMeasure →ₗᵢ[ℝ] PredictableProcessL2 𝓕 P where @@ -286,6 +288,7 @@ theorem deterministicPredictableEmbedding_coeFn /-! ### Adapted elementary processes -/ /-- Pointwise representative of the one-step process `1_(a,b] Z`. -/ +@[expose] noncomputable def elementaryRepresentative (_𝓕 : Filtration ℝ≥0 ‹MeasurableSpace W›) (a b : ℝ≥0) (Z : W → ℝ) (p : ℝ≥0 × W) : ℝ := if p.1 ∈ Set.Ioc a b then Z p.2 else 0 @@ -328,6 +331,7 @@ theorem stronglyMeasurable_elementaryRepresentative exact measurableSet_predictable_Ioc_prod a b (hZ.measurable measurableSet_Iic) /-- The scalar time indicator `1_(a,b]` as an `L²` function. -/ +@[expose] noncomputable def iocIndicator (a b : ℝ≥0) : Lp ℝ 2 nonnegativeLebesgueMeasure := indicatorConstLp 2 measurableSet_Ioc @@ -344,6 +348,7 @@ abbrev PredictableProcessL2 (𝓕 : Filtration ℝ≥0 ‹MeasurableSpace W›) /-- The predictable `L²` class represented by `(t, ω) ↦ 1_(a,b](t) Z(ω)` for an `𝓕_a`-measurable square-integrable coefficient `Z`. -/ +@[expose] noncomputable def elementaryPredictable (𝓕 : Filtration ℝ≥0 ‹MeasurableSpace W›) (a b : ℝ≥0) (Z : lpMeas ℝ ℝ (𝓕 a) 2 P) : PredictableProcessL2 𝓕 P := by @@ -409,6 +414,7 @@ omit [NormedAddCommGroup W] [NormedSpace ℝ W] [CompleteSpace W] [BorelSpace W] [SecondCountableTopology W] [IsGaussian P] in /-- The predictable `L²` class represented by `(t, ω) ↦ 1_(a,b](t) Z(ω)` for an `𝓕_a`-measurable square-integrable coefficient `Z`. -/ +@[expose] noncomputable def elementaryPredictable [SFinite P] (𝓕 : Filtration ℝ≥0 ‹MeasurableSpace W›) (a b : ℝ≥0) (Z : lpMeas ℝ ℝ (𝓕 a) 2 P) : PredictableProcessL2 𝓕 P := by @@ -469,6 +475,7 @@ theorem elementaryPredictable_coeFn [SFinite P] by_cases ht : p.1 ∈ Set.Ioc a b <;> simp [ht] /-- The constant coefficient `1`, regarded as an `𝓕_a`-measurable `L²(P)` random variable. -/ +@[expose] noncomputable def adaptedOne (𝓕 : Filtration ℝ≥0 ‹MeasurableSpace W›) (a : ℝ≥0) : lpMeas ℝ ℝ (𝓕 a) 2 P := @@ -497,6 +504,7 @@ theorem elementaryPredictable_adaptedOne /-- Orthogonal projection onto predictable time-space processes. This is Mathlib's `L²` conditional expectation with respect to the predictable sigma-algebra. -/ +@[expose] def predictableProjection (𝓕 : Filtration ℝ≥0 ‹MeasurableSpace W›) : TimeProcessL2 P →L[ℝ] PredictableProcessL2 𝓕 P := condExpL2 ℝ ℝ (predictable_le_prod 𝓕) @@ -551,6 +559,7 @@ theorem norm_filtrationCondExpL2_le norm_condExpL2_coe_le (𝓕.le t) F /-- The constant `L²` representative of the expectation of `F`. -/ +@[expose] def expectationL2 (F : RandomL2 P) : RandomL2 P := Lp.const 2 P (∫ ω, F ω ∂P) @@ -592,6 +601,7 @@ structure ClarkOconeFamily (B : ℝ≥0 → W → ℝ) (P : Measure W) [IsGaussi (mderivD12 P F))) u /-- The designated integral bundled as a linear isometry. -/ +@[expose] def ClarkOconeFamily.itoIntegralₗᵢ {𝓕 : Filtration ℝ≥0 ‹MeasurableSpace W›} (C : ClarkOconeFamily B P 𝓕) : PredictableProcessL2 𝓕 P →ₗᵢ[ℝ] RandomL2 P := @@ -604,6 +614,7 @@ theorem ClarkOconeFamily.itoIntegralₗᵢ_apply {𝓕 : Filtration ℝ≥0 ‹M rfl /-- The designated Itô integral, with codomain restricted to centered random variables. -/ +@[expose] noncomputable def ClarkOconeFamily.centeredItoIntegralₗᵢ {𝓕 : Filtration ℝ≥0 ‹MeasurableSpace W›} (C : ClarkOconeFamily B P 𝓕) : @@ -642,6 +653,7 @@ theorem ClarkOconeFamily.centeredItoIntegralₗᵢ_surjective exact hu.symm /-- Predictable square-integrable processes are linearly isometric to centered random variables. -/ +@[expose] noncomputable def ClarkOconeFamily.centeredItoEquiv {𝓕 : Filtration ℝ≥0 ‹MeasurableSpace W›} (C : ClarkOconeFamily B P 𝓕) : @@ -665,6 +677,7 @@ theorem ClarkOconeFamily.inner_itoIntegral {𝓕 : Filtration ℝ≥0 ‹Measura /-- **The time derivative of the contract is constructed, not stipulated**: the Cameron--Martin/Fubini realization `L²(P; H) → L²(ℝ≥0 × W)` of an `H`-valued random derivative as `DₜF`, obtained from `Malliavin.timeDerivative` (`TimeDerivative.lean`). -/ +@[expose] noncomputable def ClarkOconeFamily.timeDerivative {𝓕 : Filtration ℝ≥0 ‹MeasurableSpace W›} (C : ClarkOconeFamily B P 𝓕) : Lp (CameronMartin.Space P) 2 P →L[ℝ] TimeProcessL2 P := (Malliavin.timeDerivative C.isPreBrownian C.coordinate C.coordinate_apply @@ -846,6 +859,7 @@ theorem ClarkOconeFamily.elementaryIntegralValue_adaptedOne_zero /-- Brownian compatibility on all one-step adapted `L²` integrands. This is the textbook formula `∫_a^b Z dB = Z (B_b - B_a)` and is stronger than compatibility on deterministic integrands. -/ +@[expose] def ClarkOconeFamily.IsBrownianOnElementary {𝓕 : Filtration ℝ≥0 ‹MeasurableSpace W›} (C : ClarkOconeFamily B P 𝓕) : Prop := @@ -942,6 +956,7 @@ theorem ClarkOconeFamily.IsBrownianOnElementary.isBrownianOnDeterministic exact h /-- Restriction of the designated integral to deterministic predictable processes. -/ +@[expose] noncomputable def ClarkOconeFamily.deterministicIntegral {𝓕 : Filtration ℝ≥0 ‹MeasurableSpace W›} (C : ClarkOconeFamily B P 𝓕) : Lp ℝ 2 nonnegativeLebesgueMeasure →L[ℝ] RandomL2 P := @@ -1000,6 +1015,7 @@ theorem ClarkOconeFamily.IsBrownianOnDeterministic.itoIntegral_deterministic_Ioc wienerIntegral_indicatorConstLp_Ioc C.isPreBrownian hab] /-- The predictable product-space projection of the time-realized Malliavin derivative. -/ +@[expose] def predictableDerivative {𝓕 : Filtration ℝ≥0 ‹MeasurableSpace W›} (C : ClarkOconeFamily B P 𝓕) (F : D12 P) : PredictableProcessL2 𝓕 P := predictableProjection 𝓕 @@ -1015,6 +1031,7 @@ theorem aestronglyMeasurable_predictableDerivative lpMeas.aestronglyMeasurable _ /-- The designated integration operator applied to the predictable Malliavin derivative. -/ +@[expose] def clarkOconeIntegral {𝓕 : Filtration ℝ≥0 ‹MeasurableSpace W›} (C : ClarkOconeFamily B P 𝓕) (F : D12 P) : RandomL2 P := C.itoIntegral (predictableDerivative C F) diff --git a/LeanPool/Malliavin/Malliavin/ClarkOconeExamples.lean b/LeanPool/Malliavin/Malliavin/ClarkOconeExamples.lean index a9b19ff559..cc70e3f2cb 100644 --- a/LeanPool/Malliavin/Malliavin/ClarkOconeExamples.lean +++ b/LeanPool/Malliavin/Malliavin/ClarkOconeExamples.lean @@ -36,7 +36,7 @@ and for the Wick exponential `exp (B T - T / 2)` (`clarkOcone_wickExp`). The te contract. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory open scoped ENNReal NNReal InnerProductSpace @@ -105,6 +105,7 @@ theorem ClarkOconeFamily.IsBrownianOnDeterministic.duality_wienerIntegral rfl /-- The Wiener integral `∫ g dB` as an element of `𝔻₁,₂`. -/ +@[expose] noncomputable def wienerIntegralD12 (hB : IsPreBrownianReal B P) (L : ℝ≥0 → StrongDual ℝ W) (hL : ∀ t w, B t w = L t w) (hgen : IsWienerGenerated B) (g : Lp ℝ 2 nonnegativeLebesgueMeasure) : D12 P := diff --git a/LeanPool/Malliavin/Malliavin/CylindricalGrowth.lean b/LeanPool/Malliavin/Malliavin/CylindricalGrowth.lean index f744e33614..4fd41188c8 100644 --- a/LeanPool/Malliavin/Malliavin/CylindricalGrowth.lean +++ b/LeanPool/Malliavin/Malliavin/CylindricalGrowth.lean @@ -38,7 +38,7 @@ functionals and of their derivatives, and closedness of the graph (`mem_domD12_o concludes. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter Topology open scoped ENNReal NNReal InnerProductSpace diff --git a/LeanPool/Malliavin/Malliavin/DualDerivative.lean b/LeanPool/Malliavin/Malliavin/DualDerivative.lean index 4d9f57defc..0e25b21f03 100644 --- a/LeanPool/Malliavin/Malliavin/DualDerivative.lean +++ b/LeanPool/Malliavin/Malliavin/DualDerivative.lean @@ -25,7 +25,7 @@ Cameron--Martin space lies in `𝔻₁,₂` by closedness (`coe_space_mem_domD12 `Dₜ (∫ g dB) = g(t)` for every `g ∈ L²(ℝ≥0)` (`timeDerivative_mderivClosure_wienerIntegral`). -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter Topology open scoped ENNReal NNReal InnerProductSpace @@ -318,6 +318,7 @@ variable {W : Type*} [NormedAddCommGroup W] [NormedSpace ℝ W] (μ : Measure W) [IsGaussian μ] /-- The constant `H`-valued random variable `h`, as a linear isometry `H → L²(μ; H)`. -/ +@[expose] noncomputable def constLp : Space μ →ₗᵢ[ℝ] Lp (Space μ) 2 μ := ⟨(Lp.constL 2 μ ℝ : Space μ →L[ℝ] Lp (Space μ) 2 μ).toLinearMap, fun h ↦ by rw [ContinuousLinearMap.coe_coe, Lp.constL_apply] diff --git a/LeanPool/Malliavin/Malliavin/ElementaryIto.lean b/LeanPool/Malliavin/Malliavin/ElementaryIto.lean index cb03ec478f..e4bd6c7c18 100644 --- a/LeanPool/Malliavin/Malliavin/ElementaryIto.lean +++ b/LeanPool/Malliavin/Malliavin/ElementaryIto.lean @@ -23,7 +23,7 @@ construction-level Itô isometry for every adapted step process on a common part comparison theorems derive the family-level identities from these genuine Brownian values. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter Topology open scoped ENNReal NNReal InnerProductSpace @@ -224,6 +224,7 @@ theorem elementaryBrownianValue_smul /-- For a fixed interval, the genuine Brownian terminal value is a linear function of the adapted coefficient. -/ +@[expose] noncomputable def elementaryBrownianValueLinear (hB : IsPreBrownianReal B P) (hsm : ∀ t, StronglyMeasurable (B t)) {𝓕 : Filtration ℝ≥0 ‹MeasurableSpace W›} diff --git a/LeanPool/Malliavin/Malliavin/FubiniLift.lean b/LeanPool/Malliavin/Malliavin/FubiniLift.lean index bdfef01769..c22084490c 100644 --- a/LeanPool/Malliavin/Malliavin/FubiniLift.lean +++ b/LeanPool/Malliavin/Malliavin/FubiniLift.lean @@ -38,7 +38,7 @@ representatives is delicate, so we construct the map as an isometry: on the simp `L²(μ; L²(ν)) ≃ L²(ν × μ)` isometrically. -/ -@[expose] public section +public section open MeasureTheory Filter Topology Function open scoped ENNReal NNReal InnerProductSpace @@ -140,6 +140,7 @@ theorem coeFn_tensorLp [SFinite μ] (A : FiniteMeasurableSet μ) (g : Lp ℝ 2 MemLp.coeFn_toLp _ /-- The `L²(ν)`-valued indicator `1_A • g` in `L²(μ; L²(ν))`. -/ +@[expose] noncomputable def indicatorLp (A : FiniteMeasurableSet μ) (g : Lp ℝ 2 ν) : Lp (Lp ℝ 2 ν) 2 μ := indicatorConstLp 2 A.2.1 A.2.2 g @@ -254,6 +255,7 @@ theorem norm_fubiniLiftL (f : Lp (Lp ℝ 2 ν) 2 μ) : ‖fubiniLiftL f‖ = ‖ exact (sq_eq_sq₀ (norm_nonneg _) (norm_nonneg _)).mp h /-- **The Fubini lift** `L²(μ; L²(ν)) → L²(ν × μ)` as a linear isometry. -/ +@[expose] noncomputable def fubiniLift : Lp (Lp ℝ 2 ν) 2 μ →ₗᵢ[ℝ] Lp ℝ 2 (ν.prod μ) := ⟨fubiniLiftL.toLinearMap, norm_fubiniLiftL⟩ @@ -291,6 +293,7 @@ variable {Ω T : Type*} [MeasurableSpace Ω] [MeasurableSpace T] {μ : Measure variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] /-- The rank-one element `ω ↦ G ω • e` of `L²(μ; E)`, as a continuous linear map in `G`. -/ +@[expose] noncomputable def smulLp (e : E) : Lp ℝ 2 μ →L[ℝ] Lp E 2 μ := (ContinuousLinearMap.toSpanSingleton ℝ e).compLpL 2 μ @@ -420,6 +423,7 @@ theorem norm_tensor [SFinite μ] [SFinite ν] (g : Lp ℝ 2 ν) (G : Lp ℝ 2 μ exact (sq_eq_sq₀ (norm_nonneg _) (by positivity)).mp h /-- `G ↦ g ⊗ G` as a continuous linear map. -/ +@[expose] noncomputable def tensorL [SFinite μ] [SFinite ν] (g : Lp ℝ 2 ν) : Lp ℝ 2 μ →L[ℝ] Lp ℝ 2 (ν.prod μ) := LinearMap.mkContinuous @@ -769,6 +773,7 @@ theorem fubiniLift_surjective : Function.Surjective (fubiniLift (μ := μ) (ν : exact this /-- **The Fubini isomorphism** `L²(μ; L²(ν)) ≃ L²(ν × μ)`. -/ +@[expose] noncomputable def fubiniEquiv : Lp (Lp ℝ 2 ν) 2 μ ≃ₗᵢ[ℝ] Lp ℝ 2 (ν.prod μ) := LinearIsometryEquiv.ofSurjective fubiniLift fubiniLift_surjective @@ -798,6 +803,7 @@ theorem memLp_boundedSMul {G : Ω → ℝ} (hG : AEStronglyMeasurable G μ) {C : exact mul_le_mul_of_nonneg_right (hC x) (norm_nonneg _) /-- Multiplication by a bounded measurable scalar function as a linear map on `L²(μ; E)`. -/ +@[expose] noncomputable def boundedSMulₗ {G : Ω → ℝ} (hG : AEStronglyMeasurable G μ) {C : ℝ} (hC : ∀ x, |G x| ≤ C) : Lp E 2 μ →ₗ[ℝ] Lp E 2 μ where toFun U := (memLp_boundedSMul hG hC U).toLp _ @@ -823,6 +829,7 @@ theorem norm_boundedSMulₗ_le {G : Ω → ℝ} (hG : AEStronglyMeasurable G μ) /-- Multiplication by a bounded measurable scalar function as a continuous linear map on `L²(μ; E)`. -/ +@[expose] noncomputable def boundedSMul {G : Ω → ℝ} (hG : AEStronglyMeasurable G μ) {C : ℝ} (hC : ∀ x, |G x| ≤ C) : Lp E 2 μ →L[ℝ] Lp E 2 μ := LinearMap.mkContinuous (boundedSMulₗ hG hC) C (norm_boundedSMulₗ_le hG hC) diff --git a/LeanPool/Malliavin/Malliavin/GaussianHermite.lean b/LeanPool/Malliavin/Malliavin/GaussianHermite.lean index 5ba46ca8ec..ab25a04cdd 100644 --- a/LeanPool/Malliavin/Malliavin/GaussianHermite.lean +++ b/LeanPool/Malliavin/Malliavin/GaussianHermite.lean @@ -15,7 +15,7 @@ This file develops the Gaussian moment and orthogonality identities for the vari Hermite polynomials used by the Brownian chaos construction. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory open scoped NNReal diff --git a/LeanPool/Malliavin/Malliavin/IteratedIntegral.lean b/LeanPool/Malliavin/Malliavin/IteratedIntegral.lean index 810a3ba7a2..40d1fdbd9c 100644 --- a/LeanPool/Malliavin/Malliavin/IteratedIntegral.lean +++ b/LeanPool/Malliavin/Malliavin/IteratedIntegral.lean @@ -36,7 +36,7 @@ Hilbert sum. The construction selects its onto branch only when process-measura the separable ambient space, so unrelated ambient randomness is never absorbed into the tower. -/ -@[expose] public section +public section namespace Malliavin @@ -449,6 +449,7 @@ end Step /-- Product of increments along a chain `u 0 ≤ v 0 ≤ u 1 ≤ v 1 ≤ …`: the intended ordered-box value in a Brownian-linked iterated-integral family. -/ +@[expose] def chainIntegral {n : ℕ} (W : ℝ≥0 → Ω → ℝ) (u v : Fin n → ℝ≥0) : Ω → ℝ := fun x => ∏ i, (W (v i) x - W (u i) x) @@ -476,6 +477,7 @@ lemma measurableEmbedding_nnrealCoe_iterated : NNReal.isClosedEmbedding_coe.measurableEmbedding /-- Lebesgue measure on `ℝ≥0`, obtained by pulling real Lebesgue measure back along coercion. -/ +@[expose] noncomputable def nonnegativeLebesgueMeasure : Measure ℝ≥0 := Measure.comap ((↑) : ℝ≥0 → ℝ) (volume : Measure ℝ) @@ -526,6 +528,7 @@ abbrev processMeasurableSpace (B : ℝ≥0 → Ω' → ℝ) : MeasurableSpace Ω /-- Exact sigma-algebra generation by a process. This is the no-extra-randomness formulation used by downstream ambient-`L²` results; equality modulo null sets would be a weaker alternative. -/ +@[expose] def IsWienerGenerated (B : ℝ≥0 → Ω' → ℝ) : Prop := processMeasurableSpace B = ‹MeasurableSpace Ω'› @@ -685,7 +688,7 @@ lemma restrictedSimplexMeasure_le (n : ℕ) : (iteratedKernelMeasure n).restrict (simplex ℝ≥0 n) ≤ iteratedKernelMeasure n) /-- Restrict an L² kernel to the strictly ordered simplex. -/ -noncomputable def restrictToSimplex (n : ℕ) : +@[expose] noncomputable def restrictToSimplex (n : ℕ) : IteratedKernel n →L[ℝ] SimplexKernel n := by exact Lp.LpToLpOfMeasureLeSMul (p := (2 : ℝ≥0∞)) (c := 1) (by norm_num) (by exact restrictedSimplexMeasure_le n) @@ -772,6 +775,7 @@ private lemma coeFn_zeroExtendSimplex (n : ℕ) (g : SimplexKernel n) : MemLp.coeFn_toLp (memLp_zeroExtension n g) /-- Symmetrize a product kernel and then restrict it to the strict simplex. -/ +@[expose] noncomputable def symmetrizeRestrict (n : ℕ) : IteratedKernel n →L[ℝ] SimplexKernel n := by exact (restrictToSimplex n).comp @@ -1191,6 +1195,7 @@ private noncomputable def l2CongrLeft {ι κ : Type*} (e : ι ≃ κ) : (e.symm.tsum_eq (fun i ↦ ‖f i‖ ^ (2 : ℝ≥0∞).toReal)) /-- The constant-one vector in `L²(P)` for the probability measure supplied by `hB`. -/ +@[expose] noncomputable def probabilityOne (hB : IsPreBrownianReal B P) : RandomL2 P := by let _ : IsProbabilityMeasure P := hB.isGaussianProcess.isProbabilityMeasure exact indicatorConstLp 2 MeasurableSet.univ (measure_ne_top P Set.univ) (1 : ℝ) @@ -1298,6 +1303,7 @@ theorem positiveIteratedTowerLI_surjective_of_generated -- Compiles at default 200k heartbeats (override removed). /-- Insert one positive-order simplex kernel into the orthogonal sum of all positive orders. -/ +@[expose] noncomputable def singleKernelLI (n : ℕ) : SimplexKernel (n + 1) →ₗᵢ[ℝ] PositiveKernelSum where toLinearMap := lp.lsingle (𝕜 := ℝ) @@ -1306,6 +1312,7 @@ noncomputable def singleKernelLI (n : ℕ) : (p := (2 : ℝ≥0∞)) (by norm_num) n f /-- The isometric inclusion of one positive simplex order into ambient `L²(P)`. -/ +@[expose] noncomputable def simplexIntegralLI (hB : IsPreBrownianReal B P) (n : ℕ) : SimplexKernel (n + 1) →ₗᵢ[ℝ] RandomL2 P := (CenteredRandomL2 hB).subtypeₗᵢ.comp @@ -1334,6 +1341,7 @@ theorem hasSum_simplexIntegralLI (hB : IsPreBrownianReal B P) (f : PositiveKerne · rfl /-- Restrict a positive-order kernel to its simplex and apply the selected isometric tower. -/ +@[expose] noncomputable def positiveIntegralCLM (hB : IsPreBrownianReal B P) (n : ℕ) : IteratedKernel (n + 1) →L[ℝ] RandomL2 P := (simplexIntegralLI hB n).toContinuousLinearMap.comp (restrictToSimplex (n + 1)) @@ -1393,6 +1401,7 @@ private theorem norm_positiveIntegralCLM_le (hB : IsPreBrownianReal B P) (n : /-- The iterated-integral operator, using the constant kernel at order zero and simplex kernels above zero. -/ +@[expose] noncomputable def integralCLM (hB : IsPreBrownianReal B P) : (n : ℕ) → IteratedKernel n →L[ℝ] RandomL2 P | 0 => zeroIntegralCLM hB @@ -1446,6 +1455,7 @@ private theorem integralCLM_norm_le (hB : IsPreBrownianReal B P) | succ n => exact norm_positiveIntegralCLM_le hB n f /-- A law-level iterated-integral family obtained from the global positive kernel tower. -/ +@[expose] noncomputable def family (hB : IsPreBrownianReal B P) : IteratedIntegralFamily P where integral := integralCLM hB sameOrder := by exact integralCLM_sameOrder hB @@ -1461,11 +1471,13 @@ end IteratedIntegralConstruction Restriction to each simplex is a contraction. The external sum of all positive orders embeds isometrically in centered `L²(P)`. It is selected to be onto only when process-measurable `L²` exhausts a separable ambient space; order zero is the constant embedding. -/ +@[expose] noncomputable def iteratedIntegralFamily (hB : IsPreBrownianReal B P) : IteratedIntegralFamily P := IteratedIntegralConstruction.family hB /-- `Jₙ`, the selected order-`n` law-level operator, as a continuous linear map. -/ +@[expose] noncomputable def iteratedIntegralCLM (hB : IsPreBrownianReal B P) (n : ℕ) : IteratedKernel n →L[ℝ] RandomL2 P := (iteratedIntegralFamily hB).integral n diff --git a/LeanPool/Malliavin/Malliavin/IteratedKernelPurePower.lean b/LeanPool/Malliavin/Malliavin/IteratedKernelPurePower.lean index 9d9d42a198..23f6070812 100644 --- a/LeanPool/Malliavin/Malliavin/IteratedKernelPurePower.lean +++ b/LeanPool/Malliavin/Malliavin/IteratedKernelPurePower.lean @@ -17,7 +17,7 @@ square-integrability, symmetry, and Hilbert-space formulas. These are the deter for identifying generalized Hermite values with canonical Brownian multiple integrals. -/ -@[expose] public section +public section open MeasureTheory open scoped ENNReal NNReal InnerProductSpace @@ -28,6 +28,7 @@ section namespace Malliavin /-- The pointwise `n`-fold pure product of a deterministic time function. -/ +@[expose] def iteratedKernelPurePowerFun (n : ℕ) (f : ℝ≥0 → ℝ) : (Fin n → ℝ≥0) → ℝ := fun t ↦ ∏ i, f (t i) diff --git a/LeanPool/Malliavin/Malliavin/ItoConsequences.lean b/LeanPool/Malliavin/Malliavin/ItoConsequences.lean index e3ed791a0c..f973e75345 100644 --- a/LeanPool/Malliavin/Malliavin/ItoConsequences.lean +++ b/LeanPool/Malliavin/Malliavin/ItoConsequences.lean @@ -24,7 +24,7 @@ isometry. Under that hypothesis, predictable processes and centered terminal ran are linearly isometrically equivalent. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter Topology open scoped ENNReal NNReal InnerProductSpace @@ -80,6 +80,7 @@ theorem elementaryBrownianValue_adaptedOne_zero /-- Restriction of the constructed natural-filtration Itô integral to deterministic predictable processes. -/ +@[expose] noncomputable def naturalItoDeterministicIntegral (hB : IsPreBrownianReal B P) (hsm : ∀ t, StronglyMeasurable (B t)) {𝓅 : Filtration ℝ≥0 ‹MeasurableSpace W›} @@ -269,6 +270,7 @@ theorem inner_naturalItoIntegral_brownianLp /-! ## Martingale representation as surjectivity -/ /-- The martingale-representation property for the constructed natural Itô integral. -/ +@[expose] def NaturalMartingaleRepresentation (hB : IsPreBrownianReal B P) (hsm : ∀ t, StronglyMeasurable (B t)) {𝓅 : Filtration ℝ≥0 ‹MeasurableSpace W›} @@ -322,6 +324,7 @@ theorem naturalMartingaleRepresentation_iff_surjective /-- Under martingale representation, predictable processes and centered terminal variables are linearly isometrically equivalent. -/ +@[expose] noncomputable def centeredNaturalItoEquiv (hB : IsPreBrownianReal B P) (hsm : ∀ t, StronglyMeasurable (B t)) {𝓅 : Filtration ℝ≥0 ‹MeasurableSpace W›} diff --git a/LeanPool/Malliavin/Malliavin/ItoConstruction.lean b/LeanPool/Malliavin/Malliavin/ItoConstruction.lean index 46f622b54f..961e14eb35 100644 --- a/LeanPool/Malliavin/Malliavin/ItoConstruction.lean +++ b/LeanPool/Malliavin/Malliavin/ItoConstruction.lean @@ -26,7 +26,7 @@ Itô integration side no longer needs to be stipulated by `ClarkOconeFamily`; th contract concerns martingale representation and Malliavin--Itô duality. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter Topology open scoped ENNReal NNReal InnerProductSpace @@ -43,6 +43,7 @@ variable {W : Type*} [NormedAddCommGroup W] [NormedSpace ℝ W] {B : ℝ≥0 → W → ℝ} /-- Promote an adapted coefficient to a later sigma-algebra of the filtration. -/ +@[expose] noncomputable def adaptedMono (𝓕 : Filtration ℝ≥0 ‹MeasurableSpace W›) {a c : ℝ≥0} (hac : a ≤ c) (Z : lpMeas ℝ ℝ (𝓕 a) 2 P) : lpMeas ℝ ℝ (𝓕 c) 2 P := @@ -409,6 +410,7 @@ theorem denseRange_elementaryFinsuppToPredictable /-- The natural-filtration Itô integral, obtained by norm-controlled extension from formal elementary combinations. -/ +@[expose] noncomputable def naturalItoIntegral (hB : IsPreBrownianReal B P) (hsm : ∀ t, StronglyMeasurable (B t)) {𝓕 : Filtration ℝ≥0 ‹MeasurableSpace W›} @@ -481,6 +483,7 @@ theorem norm_naturalItoIntegral exact (sq_eq_sq₀ (norm_nonneg _) (norm_nonneg _)).mp h /-- The constructed natural-filtration Itô integral as a linear isometry. -/ +@[expose] noncomputable def naturalItoIntegralIsometry (hB : IsPreBrownianReal B P) (hsm : ∀ t, StronglyMeasurable (B t)) {𝓕 : Filtration ℝ≥0 ‹MeasurableSpace W›} @@ -545,6 +548,7 @@ theorem integral_naturalItoIntegral /-- The constructed natural-filtration Itô integral with codomain restricted to centered random variables. -/ +@[expose] noncomputable def centeredNaturalItoIntegralIsometry (hB : IsPreBrownianReal B P) (hsm : ∀ t, StronglyMeasurable (B t)) {𝓕 : Filtration ℝ≥0 ‹MeasurableSpace W›} @@ -590,6 +594,7 @@ theorem ClarkOconeFamily.IsBrownianOnElementary.itoIntegral_eq_naturalItoIntegra /-- Build a full `ClarkOconeFamily` using the constructed Itô integral. The only remaining analytic inputs are martingale representation and Malliavin--Itô duality. -/ +@[expose] noncomputable def ClarkOconeFamily.ofNaturalIto (hB : IsPreBrownianReal B P) (coordinate : ℝ≥0 → StrongDual ℝ W) (coordinate_apply : ∀ t w, B t w = coordinate t w) diff --git a/LeanPool/Malliavin/Malliavin/KernelIdentification.lean b/LeanPool/Malliavin/Malliavin/KernelIdentification.lean index 79d8129590..2c7a0f672d 100644 --- a/LeanPool/Malliavin/Malliavin/KernelIdentification.lean +++ b/LeanPool/Malliavin/Malliavin/KernelIdentification.lean @@ -43,7 +43,7 @@ the corresponding kernel integral of the Malliavin time derivative (`ClarkOconeFamily.predictableDerivative_ae_eq_integral_globalPredictableSectionKernel`). -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter open scoped ENNReal NNReal InnerProductSpace @@ -381,6 +381,7 @@ theorem predictableSectionKernel_horizon_consistent /-- The ceiling-selected kernel map, written as an explicit composition through the horizon index `⌈t⌉₊`. -/ +@[expose] noncomputable def globalPredictableSectionKernelFun (P : Measure W) [IsGaussian P] (𝓕 : Filtration ℝ≥0 ‹MeasurableSpace W›) : ℝ≥0 × W → Measure W := (fun q : ℕ × (ℝ≥0 × W) ↦ @@ -405,6 +406,7 @@ theorem measurable_globalPredictableSectionKernelFun (P : Measure W) [IsGaussian /-- **The global predictable-section kernel**: at time `t`, select the finite-horizon kernel with horizon `⌈t⌉₊`, giving a single jointly predictable kernel on all of `ℝ≥0 × W`. -/ +@[expose] noncomputable def globalPredictableSectionKernel (P : Measure W) [IsGaussian P] (𝓕 : Filtration ℝ≥0 ‹MeasurableSpace W›) : @Kernel (ℝ≥0 × W) W 𝓕.predictable inferInstance := diff --git a/LeanPool/Malliavin/Malliavin/LegacyProduct.lean b/LeanPool/Malliavin/Malliavin/LegacyProduct.lean index d4cfceb579..aab8a027f1 100644 --- a/LeanPool/Malliavin/Malliavin/LegacyProduct.lean +++ b/LeanPool/Malliavin/Malliavin/LegacyProduct.lean @@ -20,7 +20,7 @@ The estimates below adapt the corresponding proofs from that Mathlib revision's `MeasureTheory/Measure/Prod.lean` and `MeasureTheory/Integral/Prod.lean`. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set open scoped ENNReal diff --git a/LeanPool/Malliavin/Malliavin/MalliavinDerivative.lean b/LeanPool/Malliavin/Malliavin/MalliavinDerivative.lean index 7377706367..a323b39a84 100644 --- a/LeanPool/Malliavin/Malliavin/MalliavinDerivative.lean +++ b/LeanPool/Malliavin/Malliavin/MalliavinDerivative.lean @@ -87,7 +87,7 @@ and agreeing with `D` on smooth bounded functionals. by parts, derived from the Cameron--Martin theorem. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter Topology open scoped ENNReal NNReal InnerProductSpace @@ -396,6 +396,7 @@ variable {W : Type*} [NormedAddCommGroup W] [NormedSpace ℝ W] /-- The Malliavin derivative of `F : W → ℝ` at `x`: the Riesz representative in the Cameron--Martin space of the functional `h ↦ fderiv ℝ F x (inclusion μ h)`. It is `0` at points where `F` is not differentiable. -/ +@[expose] noncomputable def mderiv (F : W → ℝ) (x : W) : Space μ := (InnerProductSpace.toDual ℝ (Space μ)).symm ((fderiv ℝ F x).comp (inclusion μ)) @@ -609,9 +610,11 @@ theorem memLp_mul_coe (hF : IsSmoothBounded F) (g : Lp ℝ 2 μ) : (hF.memLp μ ∞).fun_mul (Lp.memLp g) /-- The `L²(μ)` class of a smooth bounded functional. -/ +@[expose] noncomputable def toLp (hF : IsSmoothBounded F) : Lp ℝ 2 μ := (hF.memLp μ 2).toLp F /-- The Malliavin derivative of a smooth bounded functional as an element of `L²(μ; H)`. -/ +@[expose] noncomputable def mderivLp (hF : IsSmoothBounded F) : Lp (Space μ) 2 μ := (hF.memLp_mderiv μ 2).toLp (mderiv μ F) @@ -654,6 +657,7 @@ theorem mderivLp_smul (hF : IsSmoothBounded F) (c : ℝ) : exact mderiv_smul μ (hF.differentiable x) c /-- The simple `H`-valued random variable `x ↦ G x • h` in `L²(μ; H)`. -/ +@[expose] noncomputable def smulLp (hG : IsSmoothBounded G) (h : Space μ) : Lp (Space μ) 2 μ := (hG.memLp_smul μ h 2).toLp (fun x ↦ G x • h) @@ -663,6 +667,7 @@ theorem memLp_divergence (hG : IsSmoothBounded G) (h : Space μ) : /-- The divergence (Skorokhod integral) of the simple process `G • h`: the `L²` class of `G · h - ⟪DG, h⟫`. It is the formal adjoint of `D` evaluated at `G • h`. -/ +@[expose] noncomputable def divergenceLp (hG : IsSmoothBounded G) (h : Space μ) : Lp ℝ 2 μ := (hG.memLp_divergence μ h).toLp (fun x ↦ G x * (h : Lp ℝ 2 μ) x - ⟪mderiv μ G x, h⟫_ℝ) @@ -1095,12 +1100,14 @@ theorem mderiv_closable (F : ℕ → {F : W → ℝ // IsSmoothBounded F}) {η : /-! ### The Sobolev space `𝔻₁,₂` and the closed extension of `D` -/ /-- `(F, η)` lies in the closure of the graph of `D` on smooth bounded functionals. -/ +@[expose] def InGraphClosure (F : Lp ℝ 2 μ) (η : Lp (Space μ) 2 μ) : Prop := ∃ Fk : ℕ → {F : W → ℝ // IsSmoothBounded F}, Tendsto (fun k ↦ (Fk k).2.toLp μ) atTop (𝓝 F) ∧ Tendsto (fun k ↦ (Fk k).2.mderivLp μ) atTop (𝓝 η) /-- The Sobolev space `𝔻₁,₂`: the domain of the closure of the Malliavin derivative. -/ +@[expose] def domD12 : Set (Lp ℝ 2 μ) := {F | ∃ η, InGraphClosure μ F η} /-- Smooth bounded functionals belong to `𝔻₁,₂`, with derivative `DF`. -/ @@ -1189,6 +1196,7 @@ theorem InGraphClosure.zero : InGraphClosure μ (0 : Lp ℝ 2 μ) 0 := by rwa [e1, e2] at h /-- `𝔻₁,₂` is a linear subspace of `L²(μ)`. -/ +@[expose] noncomputable def D12 : Submodule ℝ (Lp ℝ 2 μ) where carrier := domD12 μ add_mem' := fun ⟨η, hη⟩ ⟨ζ, hζ⟩ ↦ ⟨η + ζ, hη.add μ hζ⟩ @@ -1297,6 +1305,7 @@ theorem isClosed_graph_mderivClosure : /-! ### Bundled forms of the closed operator -/ /-- The closed Malliavin derivative as a linear map on the Sobolev space `𝔻₁,₂`. -/ +@[expose] noncomputable def mderivD12 : D12 μ →ₗ[ℝ] Lp (Space μ) 2 μ where toFun F := mderivClosure μ F map_add' F G := mderivClosure_add μ F.2 G.2 @@ -1311,6 +1320,7 @@ theorem mderivD12_toLp {F : W → ℝ} (hF : IsSmoothBounded F) : /-- The closed Malliavin derivative as a densely defined linear map on the ambient `L²(μ)` space. Its domain is exactly `D12 μ`. -/ +@[expose] noncomputable def mderivPMap : Lp ℝ 2 μ →ₗ.[ℝ] Lp (Space μ) 2 μ where domain := D12 μ @@ -1368,10 +1378,12 @@ noncomputable instance instCompleteSpaceD12Graph : CompleteSpace (D12Graph μ) : namespace D12Graph /-- The ambient `L²(μ)` coordinate on the complete graph-norm domain. -/ +@[expose] noncomputable def toLp : D12Graph μ →L[ℝ] Lp ℝ 2 μ := (ContinuousLinearMap.fst ℝ _ _).comp (D12Graph μ).subtypeL /-- The derivative coordinate on the complete graph-norm domain. -/ +@[expose] noncomputable def mderiv : D12Graph μ →L[ℝ] Lp (Space μ) 2 μ := (ContinuousLinearMap.snd ℝ _ _).comp (D12Graph μ).subtypeL @@ -1392,6 +1404,7 @@ theorem toLp_mem (F : D12Graph μ) : toLp μ F ∈ D12 μ := (mem_mderivPMap_graph_iff μ).mp F.2 |>.1 /-- Forget the derivative coordinate while retaining membership in `D12 μ`. -/ +@[expose] noncomputable def toD12 : D12Graph μ →L[ℝ] D12 μ := (toLp μ).codRestrict (D12 μ) (toLp_mem μ) diff --git a/LeanPool/Malliavin/Malliavin/MultipleIntegral.lean b/LeanPool/Malliavin/Malliavin/MultipleIntegral.lean index f793a40fd1..a23db51acd 100644 --- a/LeanPool/Malliavin/Malliavin/MultipleIntegral.lean +++ b/LeanPool/Malliavin/Malliavin/MultipleIntegral.lean @@ -26,7 +26,7 @@ operators with genuine multiple Wiener--Itô integrals additionally requires the ordered-box property; that property is not part of `IteratedIntegralFamily` itself. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory open scoped ENNReal NNReal InnerProductSpace @@ -84,6 +84,7 @@ theorem integral_inner_symmetrizeL_eq_factorial_smul_setIntegral (n : ℕ) exact integral_congr_ae hinner.restrict.symm /-- The selected law-level order-`n` multiple operator `Iₙ = n! Jₙ ∘ symmetrizeL`. -/ +@[expose] noncomputable def multipleIntegralCLM (hB : IsPreBrownianReal B P) (n : ℕ) : IteratedKernel n →L[ℝ] RandomL2 P := (n.factorial : ℝ) • (iteratedIntegralCLM hB n).comp diff --git a/LeanPool/Malliavin/Malliavin/NaturalClarkOcone.lean b/LeanPool/Malliavin/Malliavin/NaturalClarkOcone.lean index 57de7f3ff2..989fddf8e1 100644 --- a/LeanPool/Malliavin/Malliavin/NaturalClarkOcone.lean +++ b/LeanPool/Malliavin/Malliavin/NaturalClarkOcone.lean @@ -14,7 +14,7 @@ This file records exact formulations of the analytic inputs still required to co `ClarkOconeFamily` from the natural Brownian Itô integral. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter Topology open scoped ENNReal NNReal InnerProductSpace @@ -116,6 +116,7 @@ def SmoothElementaryNaturalItoDuality /-- A smooth bounded function of finitely many Brownian coordinates from times at most `a`, regarded as an `L²` coefficient measurable at time `a`. -/ +@[expose] noncomputable def pastCylinderLpMeas (_hB : IsPreBrownianReal B P) (coordinate : ℝ≥0 → StrongDual ℝ W) (coordinate_apply : ∀ t w, B t w = coordinate t w) @@ -323,6 +324,7 @@ theorem smoothElementaryNaturalItoDuality_pastCylinder /-- Fixing the time interval makes the elementary predictable construction a continuous linear map of its adapted coefficient. -/ +@[expose] noncomputable def elementaryPredictableCoefficientCLM (𝓕 : Filtration ℝ≥0 ‹MeasurableSpace W›) (a b : ℝ≥0) : lpMeas ℝ ℝ (𝓕 a) 2 P →L[ℝ] PredictableProcessL2 𝓕 P := @@ -371,6 +373,7 @@ theorem elementaryBrownianCoefficientCLM_apply naturalItoIntegral_elementaryPredictable hB hsm hnat hab Z] /-- Smooth bounded finite-coordinate Brownian cylinders available at filtration time `a`. -/ +@[expose] def pastCylinderSet (hB : IsPreBrownianReal B P) (coordinate : ℝ≥0 → StrongDual ℝ W) (coordinate_apply : ∀ t w, B t w = coordinate t w) @@ -387,6 +390,7 @@ def pastCylinderSet f hf hb hb' t a ht} /-- The algebraic span of the smooth bounded past Brownian cylinders at time `a`. -/ +@[expose] def pastCylinderSpan (hB : IsPreBrownianReal B P) (coordinate : ℝ≥0 → StrongDual ℝ W) (coordinate_apply : ∀ t w, B t w = coordinate t w) @@ -399,6 +403,7 @@ def pastCylinderSpan /-- The only remaining coefficient-density input: smooth bounded finite-coordinate Brownian cylinders are dense in every time section of the natural filtration. -/ +@[expose] def PastCylinderDense (hB : IsPreBrownianReal B P) (coordinate : ℝ≥0 → StrongDual ℝ W) (coordinate_apply : ∀ t w, B t w = coordinate t w) diff --git a/LeanPool/Malliavin/Malliavin/NaturalFiltrationLeftContinuous.lean b/LeanPool/Malliavin/Malliavin/NaturalFiltrationLeftContinuous.lean index c3f04cf909..f1c4e38444 100644 --- a/LeanPool/Malliavin/Malliavin/NaturalFiltrationLeftContinuous.lean +++ b/LeanPool/Malliavin/Malliavin/NaturalFiltrationLeftContinuous.lean @@ -25,7 +25,7 @@ claim. Combining it with `PointwiseCondExp.lean` yields the literal textbook `E[DₜF | 𝓕_t]` representative of the Clark--Ocone integrand. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter open scoped ENNReal NNReal InnerProductSpace diff --git a/LeanPool/Malliavin/Malliavin/NaturalItoDuality.lean b/LeanPool/Malliavin/Malliavin/NaturalItoDuality.lean index 44480e2f92..66f91eaaba 100644 --- a/LeanPool/Malliavin/Malliavin/NaturalItoDuality.lean +++ b/LeanPool/Malliavin/Malliavin/NaturalItoDuality.lean @@ -30,7 +30,7 @@ direct integrand identification whose final input is this textbook statement instead of an inner-product duality axiom. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter Topology open scoped ENNReal NNReal InnerProductSpace diff --git a/LeanPool/Malliavin/Malliavin/NaturalItoRange.lean b/LeanPool/Malliavin/Malliavin/NaturalItoRange.lean index 4da1b9114a..6802afdbc6 100644 --- a/LeanPool/Malliavin/Malliavin/NaturalItoRange.lean +++ b/LeanPool/Malliavin/Malliavin/NaturalItoRange.lean @@ -15,7 +15,7 @@ This packages the natural Itô terminal values as closed subspaces of ambient an representation as triviality of the corresponding orthogonal complement. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter Topology open scoped ENNReal NNReal InnerProductSpace @@ -35,6 +35,7 @@ variable {W : Type*} [NormedAddCommGroup W] [NormedSpace ℝ W] /-- The subspace of terminal `L²(P)` random variables obtained from the constructed natural Itô integral. -/ +@[expose] noncomputable def naturalItoRange (hB : IsPreBrownianReal B P) (hsm : ∀ t, StronglyMeasurable (B t)) {𝓅 : Filtration ℝ≥0 ‹MeasurableSpace W›} @@ -137,6 +138,7 @@ noncomputable def centeredNaturalItoRangeEquiv omit [CompleteSpace W] [BorelSpace W] [SecondCountableTopology W] in /-- The centered part `G - E[G]`, intrinsically regarded as an element of the expectation kernel. -/ +@[expose] noncomputable def centeredPartL2 (G : RandomL2 P) : (CameronMartin.expectationMap P).ker := ⟨G - expectationL2 G, by @@ -152,6 +154,7 @@ theorem centeredPartL2_coe (G : RandomL2 P) : /-- The canonical best predictable integrand for a centered terminal variable: orthogonally project onto the closed natural Itô range, then invert the Itô isometry on that range. -/ +@[expose] noncomputable def bestNaturalItoIntegrand (hB : IsPreBrownianReal B P) (hsm : ∀ t, StronglyMeasurable (B t)) {𝓅 : Filtration ℝ≥0 ‹MeasurableSpace W›} @@ -162,6 +165,7 @@ noncomputable def bestNaturalItoIntegrand /-- The canonical best predictable integrand of an arbitrary terminal variable, obtained by first subtracting its expectation. -/ +@[expose] noncomputable def bestNaturalItoIntegrandOfRandom (hB : IsPreBrownianReal B P) (hsm : ∀ t, StronglyMeasurable (B t)) {𝓅 : Filtration ℝ≥0 ‹MeasurableSpace W›} @@ -231,6 +235,7 @@ theorem bestNaturalItoIntegrand_centeredNaturalItoIntegral exact (centeredNaturalItoRangeEquiv hB hsm hnat).symm_apply_apply U /-- A deterministic Wiener integral intrinsically regarded as a centered terminal variable. -/ +@[expose] noncomputable def centeredWienerIntegral (hB : IsPreBrownianReal B P) (g : Lp ℝ 2 nonnegativeLebesgueMeasure) : diff --git a/LeanPool/Malliavin/Malliavin/PastCylinderDensity.lean b/LeanPool/Malliavin/Malliavin/PastCylinderDensity.lean index 6bb24209ee..b2be0b54a0 100644 --- a/LeanPool/Malliavin/Malliavin/PastCylinderDensity.lean +++ b/LeanPool/Malliavin/Malliavin/PastCylinderDensity.lean @@ -16,7 +16,7 @@ This file proves the finite-coordinate density input isolated in `Malliavin.NaturalClarkOcone`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter Topology open scoped ENNReal NNReal InnerProductSpace diff --git a/LeanPool/Malliavin/Malliavin/PointwiseCondExp.lean b/LeanPool/Malliavin/Malliavin/PointwiseCondExp.lean index 23575e39f3..698778285f 100644 --- a/LeanPool/Malliavin/Malliavin/PointwiseCondExp.lean +++ b/LeanPool/Malliavin/Malliavin/PointwiseCondExp.lean @@ -34,7 +34,7 @@ This file records the consequences for the Clark--Ocone development: `ClarkOcone.lean`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory open scoped ENNReal NNReal InnerProductSpace @@ -562,7 +562,7 @@ theorem condExp_timeSection_predictableProjection_ae _ =ᵐ[P] P[(fun ω ↦ U (t, ω)) | 𝓕 a] := hU /-- The strict-past σ-algebra `𝓕_{t⁻} = ⨆_{s < t} 𝓕 s`. -/ -@[instance_reducible] +@[instance_reducible, expose] def filtrationPred (t : ℝ≥0) : MeasurableSpace W := ⨆ (s : ℝ≥0) (_ : s < t), 𝓕 s diff --git a/LeanPool/Malliavin/Malliavin/PredictableDensity.lean b/LeanPool/Malliavin/Malliavin/PredictableDensity.lean index 9b56d83490..f7573b0d39 100644 --- a/LeanPool/Malliavin/Malliavin/PredictableDensity.lean +++ b/LeanPool/Malliavin/Malliavin/PredictableDensity.lean @@ -20,7 +20,7 @@ time; the omitted time origin is null. trimmed-measure `L²` model used by completion constructions of the Itô integral. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter Topology Function open scoped ENNReal NNReal InnerProductSpace @@ -169,6 +169,7 @@ theorem predictableTrimEquiv_ae_eq lpMeasToLpTrim_ae_eq (predictable_le_prod 𝓕) u /-- Basic rectangles generating the predictable sigma-algebra. -/ +@[expose] def predictableRectangle (𝓕 : Filtration ℝ≥0 ‹MeasurableSpace W›) : Set (Set (ℝ≥0 × W)) := {S | ∃ F₀ : Set W, MeasurableSet[𝓕 0] F₀ ∧ S = ({(0 : ℝ≥0)} ×ˢ F₀)} ∪ @@ -245,6 +246,7 @@ theorem generateFrom_predictableRectangle (MeasurableSpace.generateFrom (predictableRectangle 𝓕)) /-- An adapted indicator coefficient. -/ +@[expose] noncomputable def adaptedIndicator (𝓕 : Filtration ℝ≥0 ‹MeasurableSpace W›) (a : ℝ≥0) {F : Set W} (hF : MeasurableSet[𝓕 a] F) : @@ -347,6 +349,7 @@ lemma elementaryPredictable_mem_span end LegacyTensor /-- The algebraic span of all one-step adapted predictable processes. -/ +@[expose] def elementaryPredictableSpan [SFinite P] (𝓕 : Filtration ℝ≥0 ‹MeasurableSpace W›) : Submodule ℝ (PredictableProcessL2 𝓕 P) := diff --git a/LeanPool/Malliavin/Malliavin/PredictableKernel.lean b/LeanPool/Malliavin/Malliavin/PredictableKernel.lean index 1f8df45dcb..73f1c29ab2 100644 --- a/LeanPool/Malliavin/Malliavin/PredictableKernel.lean +++ b/LeanPool/Malliavin/Malliavin/PredictableKernel.lean @@ -26,7 +26,7 @@ natural Brownian filtration that identification — almost every time, almost ev measures — is `predictableSectionKernel_ae_eq_condExpKernel` in `KernelIdentification.lean`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter open scoped ENNReal NNReal InnerProductSpace @@ -39,6 +39,7 @@ variable {W : Type*} [NormedAddCommGroup W] [NormedSpace ℝ W] {P : Measure W} [IsGaussian P] /-- Lebesgue measure restricted to the finite time interval `Set.Iic T`. -/ +@[expose] noncomputable def finiteHorizonTimeMeasure (T : ℝ≥0) : Measure ℝ≥0 := nonnegativeLebesgueMeasure.restrict (Set.Iic T) @@ -55,6 +56,7 @@ theorem ae_pos_finiteHorizonTimeMeasure (T : ℝ≥0) : exact pos_iff_ne_zero.mpr ht /-- The finite measure obtained by restricting the time coordinate of the product measure. -/ +@[expose] noncomputable def finiteHorizonProductMeasure (P : Measure W) (T : ℝ≥0) : Measure (ℝ≥0 × W) := (finiteHorizonTimeMeasure T).prod P @@ -126,6 +128,7 @@ theorem condExpKernel_predictable_map_fst_ae This is a jointly predictable kernel indexed by `(t, ω)`. It is not definitionally the varying fixed-time kernel `condExpKernel P (𝓕 t)`. -/ +@[expose] noncomputable def predictableSectionKernel (μ : Measure (ℝ≥0 × S)) [IsFiniteMeasure μ] (𝓕 : Filtration ℝ≥0 ‹MeasurableSpace S›) : diff --git a/LeanPool/Malliavin/Malliavin/Simplex.lean b/LeanPool/Malliavin/Malliavin/Simplex.lean index 82789fa94b..9664ffeaa0 100644 --- a/LeanPool/Malliavin/Malliavin/Simplex.lean +++ b/LeanPool/Malliavin/Malliavin/Simplex.lean @@ -40,7 +40,7 @@ which is what turns `E[Jₙ(f_sym)²] = ‖f_sym‖²_{L²(Δₙ)}` into `E[Iₙ `Malliavin.integral_sq_norm_eq_factorial_smul` — its `L²` form `∫ ‖g‖² = n! • ∫_{Δₙ} ‖g‖²`. -/ -@[expose] public section +public section open MeasureTheory Finset Set open scoped ENNReal @@ -86,6 +86,7 @@ section Order variable [LinearOrder T] /-- The (open) simplex `Δₙ = {t : Fin n → T | t 0 < t 1 < ⋯ < t (n-1)}`. -/ +@[expose] def simplex (T : Type*) [LinearOrder T] (n : ℕ) : Set (Fin n → T) := {t | StrictMono t} diff --git a/LeanPool/Malliavin/Malliavin/Symmetrization.lean b/LeanPool/Malliavin/Malliavin/Symmetrization.lean index 5ef1913352..1ccd361d70 100644 --- a/LeanPool/Malliavin/Malliavin/Symmetrization.lean +++ b/LeanPool/Malliavin/Malliavin/Symmetrization.lean @@ -41,7 +41,7 @@ functions, and `symmetrize` is the projection onto them. functions (`symmetrizeL_eq_self_iff`). -/ -@[expose] public section +public section open MeasureTheory Finset open scoped ENNReal @@ -55,6 +55,7 @@ variable {T : Type*} {E : Type*} /-- A function of `n` variables is *symmetric* if it is invariant under every permutation of its arguments. -/ +@[expose] def IsSymmetric (n : ℕ) (f : (Fin n → T) → E) : Prop := ∀ (σ : Equiv.Perm (Fin n)) (t : Fin n → T), f (t ∘ σ) = f t @@ -83,6 +84,7 @@ variable [AddCommGroup E] [Module ℝ E] /-- The symmetrization of a function of `n` variables: `symmetrize n f t = (n!)⁻¹ • ∑ σ, f (t ∘ σ)`. -/ +@[expose] def symmetrize (n : ℕ) (f : (Fin n → T) → E) : (Fin n → T) → E := fun t => ((n.factorial : ℝ)⁻¹) • ∑ σ : Equiv.Perm (Fin n), f (t ∘ σ) @@ -114,6 +116,7 @@ theorem symmetrize_zero (n : ℕ) : symmetrize n (0 : (Fin n → T) → E) = 0 : simp only [symmetrize_apply, Pi.zero_apply, sum_const_zero, smul_zero] /-- `symmetrize` as an `ℝ`-linear map on functions of `n` variables. -/ +@[expose] def symmetrizeₗ (n : ℕ) : ((Fin n → T) → E) →ₗ[ℝ] ((Fin n → T) → E) where toFun := symmetrize n map_add' := symmetrize_add n diff --git a/LeanPool/Malliavin/Malliavin/TimeDerivative.lean b/LeanPool/Malliavin/Malliavin/TimeDerivative.lean index 654f72ec34..3e57568a4b 100644 --- a/LeanPool/Malliavin/Malliavin/TimeDerivative.lean +++ b/LeanPool/Malliavin/Malliavin/TimeDerivative.lean @@ -46,7 +46,7 @@ contract's `timeDerivative` unconditionally (`timeDerivative`). `Dₜ f(B t₁, …, B tₙ) = ∑ᵢ ∂ᵢ f (B t₁, …, B tₙ) · 1_{(0, tᵢ]}(t)`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory open scoped ENNReal NNReal InnerProductSpace @@ -118,6 +118,7 @@ theorem compLpₗᵢ_comp_compLpₗᵢ (e : E ≃ₗᵢ[ℝ] F) (f : Lp F 2 μ) /-- Postcomposition with a linear isometric equivalence `E ≃ F` as an equivalence `L²(μ; E) ≃ L²(μ; F)`. -/ +@[expose] noncomputable def compLpEquiv (e : E ≃ₗᵢ[ℝ] F) : Lp E 2 μ ≃ₗᵢ[ℝ] Lp F 2 μ := LinearIsometryEquiv.ofSurjective (compLpₗᵢ e.toLinearIsometry) fun f ↦ ⟨compLpₗᵢ e.symm.toLinearIsometry f, compLpₗᵢ_comp_compLpₗᵢ e f⟩ @@ -134,6 +135,7 @@ section WienerEquiv variable {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} {B : ℝ≥0 → Ω → ℝ} /-- The Wiener integral as a linear isometric equivalence `L²(ℝ≥0) ≃ firstChaos`. -/ +@[expose] noncomputable def wienerIntegralEquiv (hB : IsPreBrownianReal B P) : Lp ℝ 2 nonnegativeLebesgueMeasure ≃ₗᵢ[ℝ] firstChaos hB := (wienerIntegralₗᵢ hB).equivRange.trans (LinearIsometryEquiv.ofEq _ _ (range_wienerIntegral hB)) @@ -175,6 +177,7 @@ variable {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} {B : ℝ≥0 → Ω /-- **The time derivative** on first-chaos-valued square-integrable random variables: apply `J₁⁻¹` pointwise, then the Fubini lift. -/ +@[expose] noncomputable def timeDerivativeOfFirstChaos (hB : IsPreBrownianReal B P) : Lp (firstChaos hB) 2 P →ₗᵢ[ℝ] Lp ℝ 2 (nonnegativeLebesgueMeasure.prod P) := fubiniLift.comp (compLpₗᵢ (wienerIntegralEquiv hB).symm.toLinearIsometry) @@ -245,6 +248,7 @@ theorem firstChaos_le_space (hB : IsPreBrownianReal B P) (L : ℝ≥0 → Strong /-- **The contract's time derivative**, given the identification of the Cameron--Martin space with the first chaos: `L²(P; Space P) → L²(ℝ≥0 × W)`, an isometry. -/ +@[expose] noncomputable def timeDerivativeOfEq (hB : IsPreBrownianReal B P) (hS : Space P = firstChaos hB) : Lp (Space P) 2 P →ₗᵢ[ℝ] Lp ℝ 2 (nonnegativeLebesgueMeasure.prod P) := @@ -468,12 +472,14 @@ theorem space_eq_firstChaos (hB : IsPreBrownianReal B P) (L : ℝ≥0 → Strong /-- **The Clark--Ocone time derivative on a Brownian-generated Gaussian space** with linear-functional coordinates: an isometry `L²(P; Space P) → L²(ℝ≥0 × W)`. -/ +@[expose] noncomputable def timeDerivative (hB : IsPreBrownianReal B P) (L : ℝ≥0 → StrongDual ℝ W) (hL : ∀ t w, B t w = L t w) (hgen : IsWienerGenerated B) : Lp (Space P) 2 P →ₗᵢ[ℝ] Lp ℝ 2 (nonnegativeLebesgueMeasure.prod P) := timeDerivativeOfEq hB (space_eq_firstChaos hB L hL hgen) /-- **The time derivative is an isometric equivalence** `L²(P; Space P) ≃ L²(ℝ≥0 × W)`. -/ +@[expose] noncomputable def timeDerivativeEquiv (hB : IsPreBrownianReal B P) (L : ℝ≥0 → StrongDual ℝ W) (hL : ∀ t w, B t w = L t w) (hgen : IsWienerGenerated B) : Lp (Space P) 2 P ≃ₗᵢ[ℝ] Lp ℝ 2 (nonnegativeLebesgueMeasure.prod P) := diff --git a/LeanPool/Malliavin/Malliavin/TimewiseCondExp.lean b/LeanPool/Malliavin/Malliavin/TimewiseCondExp.lean index f4beb85f62..3d0b7b042f 100644 --- a/LeanPool/Malliavin/Malliavin/TimewiseCondExp.lean +++ b/LeanPool/Malliavin/Malliavin/TimewiseCondExp.lean @@ -30,7 +30,7 @@ a general filtration this issue is substantive at filtration jumps: the predicta left-continuity or usual-augmentation result for the natural filtration is assumed here. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter open scoped ENNReal NNReal InnerProductSpace diff --git a/LeanPool/Malliavin/Malliavin/WienerChaos.lean b/LeanPool/Malliavin/Malliavin/WienerChaos.lean index 11da4bda0a..dd59494ae2 100644 --- a/LeanPool/Malliavin/Malliavin/WienerChaos.lean +++ b/LeanPool/Malliavin/Malliavin/WienerChaos.lean @@ -32,7 +32,7 @@ global simplex tower use its onto branch. Order zero supplies constants, and `IsHilbertSum.mkInternal` packages the resulting total orthogonal family. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory open scoped ENNReal NNReal InnerProductSpace Topology symmDiff @@ -216,6 +216,7 @@ theorem homogeneousChaos_orthogonalFamily (hB : IsPreBrownianReal B P) : exact homogeneousChaos_isOrtho hB hmn /-- The closed subspace of (almost-everywhere) constant random variables. -/ +@[expose] def constantRandomVariables (P : Measure Ω) [IsFiniteMeasure P] : Submodule ℝ (RandomL2 P) := (MeasureTheory.Lp.constL 2 P ℝ : ℝ →L[ℝ] RandomL2 P).range.topologicalClosure diff --git a/LeanPool/Malliavin/Malliavin/WienerIntegral.lean b/LeanPool/Malliavin/Malliavin/WienerIntegral.lean index 867a2abb8d..74f556b9a2 100644 --- a/LeanPool/Malliavin/Malliavin/WienerIntegral.lean +++ b/LeanPool/Malliavin/Malliavin/WienerIntegral.lean @@ -55,7 +55,7 @@ along the dense map `stepToLp` to the Wiener integral `wienerIntegral hB`. value as the corresponding product of increments. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter Topology open scoped ENNReal NNReal InnerProductSpace @@ -263,6 +263,7 @@ theorem ae_eq_zero_of_forall_setIntegral_Ioc {g : ℝ≥0 → ℝ} exact hs ⌈s⌉₊ (Nat.le_ceil s) /-- The indicator of the interval `(0, t]` as an element of `L²(ℝ≥0)`. -/ +@[expose] noncomputable def intervalIndicator (t : ℝ≥0) : Lp ℝ 2 nonnegativeLebesgueMeasure := indicatorConstLp 2 measurableSet_Ioc (nonnegativeLebesgueMeasure_Ioc_ne_top 0 t) (1 : ℝ) @@ -331,6 +332,7 @@ noncomputable def stepToLp : (ℝ≥0 →₀ ℝ) →ₗ[ℝ] Lp ℝ 2 nonnegati Finsupp.linearCombination ℝ intervalIndicator /-- The formal linear combination `v ↦ ∑ₜ vₜ B t` in `L²(P)`. -/ +@[expose] noncomputable def stepToRandom (hB : IsPreBrownianReal B P) : (ℝ≥0 →₀ ℝ) →ₗ[ℝ] Lp ℝ 2 P := Finsupp.linearCombination ℝ (brownianLp hB) @@ -362,6 +364,7 @@ theorem denseRange_stepToLp : DenseRange stepToLp := by /-- **The Wiener integral** `J₁ : L²(ℝ≥0) → L²(P)` of a pre-Brownian process: the continuous linear extension of `1_{(0, t]} ↦ B t`. -/ +@[expose] noncomputable def wienerIntegral (hB : IsPreBrownianReal B P) : Lp ℝ 2 nonnegativeLebesgueMeasure →L[ℝ] Lp ℝ 2 P := (stepToRandom hB).extendOfNorm stepToLp @@ -414,6 +417,7 @@ theorem norm_wienerIntegral (hB : IsPreBrownianReal B P) exact (sq_eq_sq₀ (norm_nonneg _) (norm_nonneg _)).mp h /-- The Wiener integral as a linear isometry. -/ +@[expose] noncomputable def wienerIntegralₗᵢ (hB : IsPreBrownianReal B P) : Lp ℝ 2 nonnegativeLebesgueMeasure →ₗᵢ[ℝ] Lp ℝ 2 P := ⟨(wienerIntegral hB).toLinearMap, norm_wienerIntegral hB⟩ @@ -459,6 +463,7 @@ laws; it is the order-one level of any Brownian family. -/ section BrownianLink /-- The ordered box `∏ᵢ (u i, v i]` in `Fin n → ℝ≥0`. -/ +@[expose] def orderedBox {n : ℕ} (u v : Fin n → ℝ≥0) : Set (Fin n → ℝ≥0) := Set.univ.pi fun i ↦ Set.Ioc (u i) (v i) @@ -472,6 +477,7 @@ theorem iteratedKernelMeasure_orderedBox_ne_top {n : ℕ} (u v : Fin n → ℝ exact ENNReal.prod_ne_top fun i _ ↦ nonnegativeLebesgueMeasure_Ioc_ne_top _ _ /-- The indicator of an ordered box as an order-`n` kernel. -/ +@[expose] noncomputable def boxKernel {n : ℕ} (u v : Fin n → ℝ≥0) : IteratedKernel n := indicatorConstLp 2 (measurableSet_orderedBox u v) (iteratedKernelMeasure_orderedBox_ne_top u v) (1 : ℝ) @@ -564,10 +570,12 @@ theorem measurePreserving_funUnique_symm_nnreal : (measurePreserving_funUnique nonnegativeLebesgueMeasure (Fin 1)).symm _ /-- Order-one kernels as square-integrable functions of one time variable. -/ +@[expose] noncomputable def kernelToLine : IteratedKernel 1 →ₗᵢ[ℝ] Lp ℝ 2 nonnegativeLebesgueMeasure := Lp.compMeasurePreservingₗᵢ ℝ _ measurePreserving_funUnique_symm_nnreal /-- The genuine order-one iterated Itô integral on `IteratedKernel 1`. -/ +@[expose] noncomputable def wienerIntegralKernel (hB : IsPreBrownianReal B P) : IteratedKernel 1 →L[ℝ] RandomL2 P := (wienerIntegral hB).comp kernelToLine.toContinuousLinearMap @@ -857,6 +865,7 @@ section Gaussian open CameronMartin /-- The pointwise formal step sum `∑ₜ vₜ B t`. -/ +@[expose] def stepSum (B : ℝ≥0 → Ω → ℝ) (v : ℝ≥0 →₀ ℝ) : Ω → ℝ := fun ω ↦ v.sum fun t c ↦ c * B t ω @@ -939,6 +948,7 @@ section FirstChaos /-- The genuine Gaussian first chaos of the process: the closed span of the Brownian coordinates. It is not identified here with the selected order-one range of `iteratedIntegralFamily`. -/ +@[expose] noncomputable def firstChaos (hB : IsPreBrownianReal B P) : Submodule ℝ (RandomL2 P) := (Submodule.span ℝ (Set.range (brownianLp hB))).topologicalClosure diff --git a/LeanPool/Malliavin/Solution.lean b/LeanPool/Malliavin/Solution.lean index 83e5338da6..153fa3f8be 100644 --- a/LeanPool/Malliavin/Solution.lean +++ b/LeanPool/Malliavin/Solution.lean @@ -20,7 +20,7 @@ boundary definitions remain explicit for independent statement auditing; `IsSmoothBounded.toMalliavin` transfers their witnesses to the shared library API. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter Topology open scoped ENNReal NNReal Real Topology InnerProductSpace @@ -65,6 +65,7 @@ noncomputable def centeredIdLp (memLp_centeredId μ).toLp (centeredId μ) /-- The covariance map from scalar `L²(μ)` into the ambient Banach space. -/ +@[expose] noncomputable def covarianceMap {W : Type*} [NormedAddCommGroup W] [NormedSpace ℝ W] [CompleteSpace W] [MeasurableSpace W] [BorelSpace W] @@ -74,6 +75,7 @@ noncomputable def covarianceMap (centeredIdLp μ) /-- The covariance embedding of the Cameron–Martin space into `W`. -/ +@[expose] noncomputable def inclusion {W : Type*} [NormedAddCommGroup W] [NormedSpace ℝ W] [CompleteSpace W] [MeasurableSpace W] [BorelSpace W] @@ -95,6 +97,7 @@ end CameronMartin /-- The Malliavin derivative as the Riesz representative of differentiation along the Cameron–Martin covariance embedding. -/ +@[expose] noncomputable def mderiv {W : Type*} [NormedAddCommGroup W] [NormedSpace ℝ W] [CompleteSpace W] [MeasurableSpace W] [BorelSpace W] @@ -170,6 +173,7 @@ noncomputable def toLp /-- The Malliavin derivative of a smooth bounded functional as an element of L²(μ; H), where H is the Cameron–Martin space. -/ +@[expose] noncomputable def mderivLp {W : Type*} [NormedAddCommGroup W] [NormedSpace ℝ W] [CompleteSpace W] [MeasurableSpace W] [BorelSpace W] diff --git a/LeanPool/MarkovProcess/MarkovProcess/Analysis/ExpPrimitive.lean b/LeanPool/MarkovProcess/MarkovProcess/Analysis/ExpPrimitive.lean index af0b2dccf6..a3edcecb4b 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Analysis/ExpPrimitive.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Analysis/ExpPrimitive.lean @@ -25,7 +25,7 @@ Main results: `intervalIntegral.integral_mul_exp_primitive`, No probabilistic structure is used or asserted. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Analysis/PaleyZygmund.lean b/LeanPool/MarkovProcess/MarkovProcess/Analysis/PaleyZygmund.lean index c35cf85f77..c5000b6c6b 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Analysis/PaleyZygmund.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Analysis/PaleyZygmund.lean @@ -29,7 +29,7 @@ supplied by the second moment through the Cauchy--Schwarz inequality Everything is stated for `ℝ≥0∞`-valued functions and carries no integrability side condition. -/ -@[expose] public section +public section open scoped ENNReal NNReal diff --git a/LeanPool/MarkovProcess/MarkovProcess/Continuity/DenseTimeContinuousExtension.lean b/LeanPool/MarkovProcess/MarkovProcess/Continuity/DenseTimeContinuousExtension.lean index d01fb828a8..9a099ebea2 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Continuity/DenseTimeContinuousExtension.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Continuity/DenseTimeContinuousExtension.lean @@ -22,7 +22,7 @@ No probability law is shown to be supported on this image, and no continuous mod stochastic-process association, or path-regularity claim is made here. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -37,6 +37,7 @@ namespace ContinuousPath variable {alpha : Type*} [TopologicalSpace alpha] /-- Restriction of a continuous path to the fixed dense time carrier. -/ +@[expose] def denseRestriction (omega : ContinuousPath alpha) : DenseTime → alpha := fun q ↦ omega (DenseTime.castOrderEmbedding q) diff --git a/LeanPool/MarkovProcess/MarkovProcess/Continuity/DenseTimeContinuousLaw.lean b/LeanPool/MarkovProcess/MarkovProcess/Continuity/DenseTimeContinuousLaw.lean index f852b68e98..a73084a0c9 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Continuity/DenseTimeContinuousLaw.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Continuity/DenseTimeContinuousLaw.lean @@ -16,7 +16,7 @@ This file transports a kernel on dense-time trajectories to ordinary continuous explicit support-on-the-continuous-range hypothesis. It does not prove that support hypothesis. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -35,6 +35,7 @@ variable [StandardBorelSpace (ContinuousPath alpha)] [MeasurableSpace.CountablySeparated (DenseTime → alpha)] /-- A dense-time kernel is almost surely supported on restrictions of continuous paths. -/ +@[expose] def IsSupportedOnContinuousPaths (κ : Kernel β (DenseTime → alpha)) : Prop := ∀ x, ∀ᵐ path ∂κ x, path ∈ Set.range (ContinuousPath.denseRestriction (alpha := alpha)) diff --git a/LeanPool/MarkovProcess/MarkovProcess/Continuity/DenseTimeContinuousSupport.lean b/LeanPool/MarkovProcess/MarkovProcess/Continuity/DenseTimeContinuousSupport.lean index ce726b3db4..91b832d6b9 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Continuity/DenseTimeContinuousSupport.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Continuity/DenseTimeContinuousSupport.lean @@ -21,7 +21,7 @@ argument of `Continuity/GlobalDyadicFloorModification.lean`, applied to dense-ti kernels in `Continuity/KolmogorovDenseTimeContinuousSupport.lean`. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Continuity/DyadicChaining.lean b/LeanPool/MarkovProcess/MarkovProcess/Continuity/DyadicChaining.lean index 2c62ba51c1..53bae54086 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Continuity/DyadicChaining.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Continuity/DyadicChaining.lean @@ -19,7 +19,7 @@ This file merges the following former modules, one section each: * `DyadicAncestorTail`: Uniform tail bounds for finite dyadic ancestor chains -/ -@[expose] public section +public section namespace MarkovProcess @@ -91,6 +91,7 @@ variable {Ω E : Type*} {mΩ : MeasurableSpace Ω} [PseudoEMetricSpace E] /-- The canonical inclusion of the level-`n` unit dyadic grid into level `n + 1`. Its value is twice the old grid index. -/ +@[expose] def unitDyadicRefineIndex (n : ℕ) (i : Fin (2 ^ n + 1)) : Fin (2 ^ (n + 1) + 1) := ⟨2 * i.val, by have hi : i.val ≤ 2 ^ n := Nat.le_of_lt_succ i.isLt @@ -112,6 +113,7 @@ theorem unitDyadicGrid_refineIndex (n : ℕ) (i : Fin (2 ^ n + 1)) : /-- The canonical level-`n` parent of a point on the level-`n + 1` unit dyadic grid. It is obtained by rounding the fine-grid index down after division by two. -/ +@[expose] def unitDyadicParentIndex (n : ℕ) (i : Fin (2 ^ (n + 1) + 1)) : Fin (2 ^ n + 1) := ⟨i.val / 2, by have hi : i.val ≤ 2 ^ (n + 1) := Nat.le_of_lt_succ i.isLt @@ -201,6 +203,7 @@ open scoped ENNReal NNReal variable {Ω E : Type*} {mΩ : MeasurableSpace Ω} [PseudoEMetricSpace E] /-- The canonical level-`n` ancestor of a point lying `r` dyadic refinements above it. -/ +@[expose] def unitDyadicAncestorIndex (n : ℕ) : (r : ℕ) → Fin (2 ^ (n + r) + 1) → Fin (2 ^ n + 1) | 0, i => i diff --git a/LeanPool/MarkovProcess/MarkovProcess/Continuity/DyadicFloor.lean b/LeanPool/MarkovProcess/MarkovProcess/Continuity/DyadicFloor.lean index 603f82ee44..d62dc2de3f 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Continuity/DyadicFloor.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Continuity/DyadicFloor.lean @@ -27,7 +27,7 @@ This file merges the following former modules, one section each: * `DyadicFloorUnitModification`: A continuous modification on the unit interval -/ -@[expose] public section +public section noncomputable section PortComputability @@ -39,6 +39,7 @@ section DyadicFloorApproximation section /-- The index of the left endpoint of the level-`n` dyadic cell containing `t ∈ [0, 1]`. -/ +@[expose] def unitDyadicFloorIndex (n : ℕ) (t : Set.Icc (0 : ℝ) 1) : Fin (2 ^ n + 1) := ⟨⌊(2 ^ n : ℝ) * t.1⌋₊, by have hnonneg : 0 ≤ (2 ^ n : ℝ) * t.1 := @@ -294,6 +295,7 @@ section DyadicFloorDenseTime section /-- A point of the level-`n` unit dyadic grid, regarded as a real time in `[0, 1]`. -/ +@[expose] def unitDyadicGridTime (n : ℕ) (i : Fin (2 ^ n + 1)) : Set.Icc (0 : ℝ) 1 := ⟨(unitDyadicGrid n i : ℝ), by constructor @@ -613,6 +615,7 @@ open scoped ENNReal NNReal variable {Ω E : Type*} {mΩ : MeasurableSpace Ω} [PseudoEMetricSpace E] /-- A nonnegative rational bounded by one, embedded in the real unit interval. -/ +@[expose] def unitIccOfNNRat (t : NNRat) (ht : t ≤ 1) : Set.Icc (0 : ℝ) 1 := ⟨(t : ℝ), by positivity, by exact_mod_cast ht⟩ diff --git a/LeanPool/MarkovProcess/MarkovProcess/Continuity/DyadicIncrements.lean b/LeanPool/MarkovProcess/MarkovProcess/Continuity/DyadicIncrements.lean index 8980c1df8e..90663130c4 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Continuity/DyadicIncrements.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Continuity/DyadicIncrements.lean @@ -21,7 +21,7 @@ This file merges the following former modules, one section each: * `DyadicThresholdTail`: Geometric tails of dyadic increment thresholds -/ -@[expose] public section +public section namespace MarkovProcess diff --git a/LeanPool/MarkovProcess/MarkovProcess/Continuity/DyadicPathChaining.lean b/LeanPool/MarkovProcess/MarkovProcess/Continuity/DyadicPathChaining.lean index a8c108fd32..ceaa08f218 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Continuity/DyadicPathChaining.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Continuity/DyadicPathChaining.lean @@ -35,7 +35,7 @@ Everything here is a statement about a fixed function of time. No measure, no p and no continuity of `f` is used or asserted. -/ -@[expose] public section +public section open Filter Topology open scoped ENNReal NNReal @@ -94,6 +94,7 @@ section Chaining variable {E : Type*} [PseudoEMetricSpace E] /-- Every adjacent increment of `f` on the level-`m` subdivision of `[0, T]` is at most `e`. -/ +@[expose] def HasDyadicAdjacentBound (f : ℝ≥0 → E) (T : ℝ≥0) (m : ℕ) (e : ℝ≥0∞) : Prop := ∀ i < 2 ^ m, edist (f (dyadicTime T m i)) (f (dyadicTime T m (i + 1))) ≤ e diff --git a/LeanPool/MarkovProcess/MarkovProcess/Continuity/GlobalDyadicFloorModification.lean b/LeanPool/MarkovProcess/MarkovProcess/Continuity/GlobalDyadicFloorModification.lean index 74a4f2b5dc..0950aa01f7 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Continuity/GlobalDyadicFloorModification.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Continuity/GlobalDyadicFloorModification.lean @@ -23,7 +23,7 @@ No measurability of the path-valued map, path-space law, Markov property, or Hun asserted here. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Continuity/KolmogorovDenseTimeContinuousSupport.lean b/LeanPool/MarkovProcess/MarkovProcess/Continuity/KolmogorovDenseTimeContinuousSupport.lean index 6f716bfa44..644d5610e7 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Continuity/KolmogorovDenseTimeContinuousSupport.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Continuity/KolmogorovDenseTimeContinuousSupport.lean @@ -21,7 +21,7 @@ No measurability of the totalized modification as a path-valued map, PDE increme Markov property of the resulting paths, or Hunt-process assertion is made here. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Continuity/KolmogorovTimeShift.lean b/LeanPool/MarkovProcess/MarkovProcess/Continuity/KolmogorovTimeShift.lean index 8333edebd7..4b770134b6 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Continuity/KolmogorovTimeShift.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Continuity/KolmogorovTimeShift.lean @@ -21,7 +21,7 @@ No global path is glued here, and no measurability of the canonical limit or mod assertion is made. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -33,6 +33,7 @@ namespace MarkovProcess variable {Ω E : Type*} /-- Translate a dense-time process by a nonnegative rational time. -/ +@[expose] def timeShift (k : NNRat) (X : NNRat → Ω → E) : NNRat → Ω → E := fun q ω ↦ X (k + q) ω @@ -61,6 +62,7 @@ theorem IsKolmogorovProcess.timeShift /-- The level-`n` dyadic time in the unit interval, translated to the interval beginning at `k`. -/ +@[expose] noncomputable def shiftedUnitDyadicFloorValue (k : NNRat) (n : ℕ) (t : Set.Icc (0 : ℝ) 1) : NNRat := k + unitDyadicFloorValue n t @@ -78,6 +80,7 @@ variable [PseudoMetricSpace E] /-- The canonical unit-interval dyadic-floor limit of the process translated by `k`. Its time parameter represents the original interval `[k, k + 1]`. -/ +@[expose] def shiftedUnitDyadicFloorLimit (k : NNRat) (X : NNRat → Ω → E) (ω : Ω) : Set.Icc (0 : ℝ) 1 → E := unitDyadicFloorLimit (timeShift k X) ω diff --git a/LeanPool/MarkovProcess/MarkovProcess/Continuity/PathModulus.lean b/LeanPool/MarkovProcess/MarkovProcess/Continuity/PathModulus.lean index 5a9fff0e59..e2dcf0f365 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Continuity/PathModulus.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Continuity/PathModulus.lean @@ -34,7 +34,7 @@ Nothing here constructs a law, asserts a Hölder exponent for individual paths, tightness; tightness is assembled from this estimate elsewhere. -/ -@[expose] public section +public section open Filter MeasureTheory ProbabilityTheory Topology open scoped ENNReal NNReal @@ -47,6 +47,7 @@ variable {alpha : Type*} [PseudoEMetricSpace alpha] /-- The paths whose oscillation over `[0, T]` at scale `delta` is at most `r`: any two times of `[0, T]` within `delta` of each other carry values within `r` of each other. -/ +@[expose] def modulusSet (T : ℝ≥0) (delta r : ℝ≥0∞) : Set (ContinuousPath alpha) := {omega | ∀ s t : ℝ≥0, s ≤ T → t ≤ T → edist s t ≤ delta → edist (omega s) (omega t) ≤ r} diff --git a/LeanPool/MarkovProcess/MarkovProcess/Continuity/PathTightness.lean b/LeanPool/MarkovProcess/MarkovProcess/Continuity/PathTightness.lean index 7241c4bc35..de2708b4a5 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Continuity/PathTightness.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Continuity/PathTightness.lean @@ -41,7 +41,7 @@ Nothing here constructs a law, and no compactness theorem for measures (Prokhoro proved or used. -/ -@[expose] public section +public section open Filter MeasureTheory Metric Topology open scoped ENNReal NNReal diff --git a/LeanPool/MarkovProcess/MarkovProcess/Continuity/ShiftedUnitModification.lean b/LeanPool/MarkovProcess/MarkovProcess/Continuity/ShiftedUnitModification.lean index cde09476c3..f0f839fc67 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Continuity/ShiftedUnitModification.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Continuity/ShiftedUnitModification.lean @@ -20,7 +20,7 @@ No global path is glued here, and no path-space measurability, law, or Hunt-proc asserted. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/DenseTime/CanonicalDiscreteLaw.lean b/LeanPool/MarkovProcess/MarkovProcess/DenseTime/CanonicalDiscreteLaw.lean index f7bba6e8bb..d3a4c3065a 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/DenseTime/CanonicalDiscreteLaw.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/DenseTime/CanonicalDiscreteLaw.lean @@ -18,7 +18,7 @@ records exact finite-prefix and coordinate marginal identities. No conditional-expectation Markov property is asserted here. -/ -@[expose] public section +public section open MeasureTheory open ProbabilityTheory diff --git a/LeanPool/MarkovProcess/MarkovProcess/DenseTime/CanonicalDiscretePath.lean b/LeanPool/MarkovProcess/MarkovProcess/DenseTime/CanonicalDiscretePath.lean index 435c116c15..40c26d779e 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/DenseTime/CanonicalDiscretePath.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/DenseTime/CanonicalDiscretePath.lean @@ -23,7 +23,7 @@ assert any Markov property. * `DiscretePath.canonicalFiltration`: the natural filtration of the coordinate process. -/ -@[expose] public section +public section open MeasureTheory open TopologicalSpace @@ -38,10 +38,12 @@ namespace DiscretePath variable {α : Type*} /-- Evaluation of a discrete path at time `n`. -/ +@[expose] def coordinate (n : ℕ) (ω : DiscretePath α) : α := ω n /-- The canonical coordinate process on discrete path space. -/ +@[expose] def coordinateProcess : ℕ → DiscretePath α → α := fun n => coordinate n @@ -93,6 +95,7 @@ theorem stronglyMeasurable_coordinateProcess (n : ℕ) : /-- The canonical filtration on discrete path space, defined as the natural filtration generated by the coordinate process. -/ +@[expose] def canonicalFiltration : Filtration ℕ (inferInstance : MeasurableSpace (DiscretePath α)) := Filtration.natural coordinateProcess stronglyMeasurable_coordinateProcess diff --git a/LeanPool/MarkovProcess/MarkovProcess/DenseTime/CemeteryDenseTimeMarginals.lean b/LeanPool/MarkovProcess/MarkovProcess/DenseTime/CemeteryDenseTimeMarginals.lean index 94e1b606cb..9079e644b0 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/DenseTime/CemeteryDenseTimeMarginals.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/DenseTime/CemeteryDenseTimeMarginals.lean @@ -17,7 +17,7 @@ at any dense-time coordinate when started from a live state. This is a finite-c it does not assert that a dense-time path has a continuous lifetime-path extension. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/DenseTime/CemeteryExtension.lean b/LeanPool/MarkovProcess/MarkovProcess/DenseTime/CemeteryExtension.lean index 54a6a4571b..1ed1c92a7b 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/DenseTime/CemeteryExtension.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/DenseTime/CemeteryExtension.lean @@ -18,7 +18,7 @@ extends one sub-Markov kernel to a Markov kernel. It deliberately makes no claim about preservation of kernel composition or semigroup laws. -/ -@[expose] public section +public section open MeasureTheory open ProbabilityTheory @@ -49,6 +49,7 @@ variable [MeasurableSpace α] /-- The conservative extension of a sub-Markov kernel obtained by sending its missing mass to the cemetery state and making that state absorbing. -/ +@[expose] noncomputable def cemeteryExtension (κ : ProbabilityTheory.Kernel α α) : ProbabilityTheory.Kernel (Cemetery α) (Cemetery α) where toFun := Sum.elim diff --git a/LeanPool/MarkovProcess/MarkovProcess/DenseTime/CemeterySemigroup.lean b/LeanPool/MarkovProcess/MarkovProcess/DenseTime/CemeterySemigroup.lean index 294ff2cafe..698ff04ae2 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/DenseTime/CemeterySemigroup.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/DenseTime/CemeterySemigroup.lean @@ -18,7 +18,7 @@ extension at every time turns any sub-Markov kernel semigroup into a conservative semigroup on the cemetery state space. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -167,6 +167,7 @@ end Kernel namespace SubMarkovKernelSemigroup /-- The conservative cemetery extension of a sub-Markov kernel semigroup. -/ +@[expose] noncomputable def cemeterySemigroup (P : SubMarkovKernelSemigroup α) : SubMarkovKernelSemigroup (Cemetery α) where kernel t := Kernel.cemeteryExtension (P t) diff --git a/LeanPool/MarkovProcess/MarkovProcess/DenseTime/ConditionalKernel.lean b/LeanPool/MarkovProcess/MarkovProcess/DenseTime/ConditionalKernel.lean index aa3a79ccff..4c941a314d 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/DenseTime/ConditionalKernel.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/DenseTime/ConditionalKernel.lean @@ -17,7 +17,7 @@ This file augments finite prefix laws by their starting point and disintegrates a prefix and its next observation. It makes no infinite-process or path-regularity claim. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -31,6 +31,7 @@ section variable {D α : Type*} [MeasurableSpace α] /-- The law of a finite history, including the deterministic starting point. -/ +@[expose] def augmentedPrefixKernel (P : SubMarkovKernelSemigroup α) (e : ℕ ≃ D) (ι : D ↪ NNReal) (n : ℕ) : Kernel α (DenseTimeHistory α n) := Kernel.mapOfMeasurable @@ -55,6 +56,7 @@ theorem augmentedPrefixKernel_map_historyEquiv (P : SubMarkovKernelSemigroup α) · exact (DenseTimeHistory.historyEquiv n).measurable /-- The joint law of an `n`-prefix and the next enumerated observation. -/ +@[expose] def nextObservationJoint (P : SubMarkovKernelSemigroup α) (e : ℕ ≃ D) (ι : D ↪ NNReal) (n : ℕ) : Kernel α ((Fin n → α) × α) := Kernel.mapOfMeasurable (denseTimePrefixKernel P e ι (n + 1)) @@ -126,6 +128,7 @@ theorem compProd_observationCondKernel (P : SubMarkovKernelSemigroup α) exact Kernel.disintegrate _ _ /-- The conditional next-observation law, viewed as a kernel on finite histories. -/ +@[expose] def denseStep (P : SubMarkovKernelSemigroup α) (hP : P.IsConservative) (e : ℕ ≃ D) (ι : D ↪ NNReal) (n : ℕ) : Kernel (DenseTimeHistory α n) α := Kernel.comap (observationCondKernel P hP e ι n) diff --git a/LeanPool/MarkovProcess/MarkovProcess/DenseTime/PhysicalCompactTestTransport.lean b/LeanPool/MarkovProcess/MarkovProcess/DenseTime/PhysicalCompactTestTransport.lean index ced5bb65e7..93408fe677 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/DenseTime/PhysicalCompactTestTransport.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/DenseTime/PhysicalCompactTestTransport.lean @@ -19,7 +19,7 @@ corresponding dense times. It pulls compactly supported tests back across this h rewrites integrals against mapped finite-set kernels. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory open scoped NNReal CompactlySupported diff --git a/LeanPool/MarkovProcess/MarkovProcess/DenseTime/PhysicalReindex.lean b/LeanPool/MarkovProcess/MarkovProcess/DenseTime/PhysicalReindex.lean index 9d0ef2ce00..7aa2d71b98 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/DenseTime/PhysicalReindex.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/DenseTime/PhysicalReindex.lean @@ -16,7 +16,7 @@ file records the induced measurable path reindexing and its compatibility with c evaluation. No probability-law or Markov claim is made. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -29,6 +29,7 @@ namespace DenseTime open SubMarkovKernelSemigroup /-- Casting identifies a finite dense-time set with its image in physical nonnegative-real time. -/ +@[expose] def physicalSetEquiv (I : Finset DenseTime) : I ≃ denseTimePhysicalSet I := Equiv.ofBijective (fun t ↦ ⟨castOrderEmbedding t, by @@ -59,6 +60,7 @@ open SubMarkovKernelSemigroup variable {alpha : Type*} /-- Reindex a finite path labelled by physical rational times back to dense-time labels. -/ +@[expose] def pullbackPhysicalSet (I : Finset DenseTime) (path : denseTimePhysicalSet I → alpha) : I → alpha := fun t ↦ path (DenseTime.physicalSetEquiv I t) diff --git a/LeanPool/MarkovProcess/MarkovProcess/DenseTime/PrefixKernel.lean b/LeanPool/MarkovProcess/MarkovProcess/DenseTime/PrefixKernel.lean index cae49e933e..e6b34040ff 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/DenseTime/PrefixKernel.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/DenseTime/PrefixKernel.lean @@ -17,7 +17,7 @@ enumeration, with coordinates retained in enumeration order. The enumeration nee the order of physical time. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -31,6 +31,7 @@ section variable {D α : Type*} [MeasurableSpace α] /-- The physical times occurring in the first `n` positions of an enumeration. -/ +@[expose] def denseTimePhysicalPrefix (e : ℕ ≃ D) (ι : D ↪ NNReal) (n : ℕ) : Finset NNReal := (CountableEnumeration.prefix e n).map ι @@ -49,6 +50,7 @@ private theorem denseTime_mem_physicalPrefix (e : ℕ ≃ D) (ι : D ↪ NNReal) exact i.isLt, rfl⟩ /-- Reindex a path on the physical prefix by its enumeration positions. -/ +@[expose] def denseTimePrefixReindex (e : ℕ ≃ D) (ι : D ↪ NNReal) (n : ℕ) (path : denseTimePhysicalPrefix e ι n → α) : Fin n → α := fun i ↦ path ⟨ι (e i), by exact denseTime_mem_physicalPrefix e ι n i⟩ diff --git a/LeanPool/MarkovProcess/MarkovProcess/DenseTime/PrefixRecursion.lean b/LeanPool/MarkovProcess/MarkovProcess/DenseTime/PrefixRecursion.lean index 8a973fae15..9976e43484 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/DenseTime/PrefixRecursion.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/DenseTime/PrefixRecursion.lean @@ -16,7 +16,7 @@ This file identifies the result of adjoining one conditionally sampled observati augmented finite history. It makes no infinite-process or path-regularity claim. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -82,6 +82,7 @@ namespace DenseTimeHistory variable {α : Type*} [MeasurableSpace α] /-- Adjoin one observation at the end of a finite dense-time history. -/ +@[expose] def append (n : ℕ) : DenseTimeHistory α n × α → DenseTimeHistory α (n + 1) := fun hx ↦ (historyEquiv (n + 1)).symm ((historyEquiv n hx.1).1, (splitLast n).symm ((historyEquiv n hx.1).2, hx.2)) diff --git a/LeanPool/MarkovProcess/MarkovProcess/DenseTime/Shift.lean b/LeanPool/MarkovProcess/MarkovProcess/DenseTime/Shift.lean index d1f667502e..bff5d58207 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/DenseTime/Shift.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/DenseTime/Shift.lean @@ -17,7 +17,7 @@ induced shift of dense-time paths. Restriction of a continuous path commutes wi No probability law or Markov property is asserted. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -28,6 +28,7 @@ section namespace DenseTime /-- Addition by a fixed dense time as an order embedding of the dense time carrier. -/ +@[expose] def addOrderEmbedding (s : DenseTime) : DenseTime ↪o DenseTime := OrderEmbedding.ofStrictMono (fun t ↦ s + t) fun _ _ h ↦ by simpa only [add_comm] using add_lt_add_left h s @@ -49,6 +50,7 @@ namespace DenseTimePath variable {alpha : Type*} /-- Shift a dense-time path by a fixed nonnegative rational time. -/ +@[expose] def shift (s : DenseTime) (path : DenseTime → alpha) : DenseTime → alpha := path ∘ DenseTime.addOrderEmbedding s diff --git a/LeanPool/MarkovProcess/MarkovProcess/DenseTime/Trajectory.lean b/LeanPool/MarkovProcess/MarkovProcess/DenseTime/Trajectory.lean index 38e3894482..d9f1a0ce88 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/DenseTime/Trajectory.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/DenseTime/Trajectory.lean @@ -17,7 +17,7 @@ Mathlib's Ionescu--Tulcea construction, starts the resulting trajectory at a det and reindexes its positive coordinates by a countable dense-time enumeration. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -316,6 +316,7 @@ theorem enumeratedDenseTimeTrajectory_map_prefix · exact measurable_enumeratedDenseTimePrefix n /-- Restrict a dense-time-labelled trajectory to the first `n` labels of an enumeration. -/ +@[expose] def denseTimeTrajectoryPrefix (e : ℕ ≃ D) (n : ℕ) (path : D → α) : Fin n → α := fun i ↦ path (e i) diff --git a/LeanPool/MarkovProcess/MarkovProcess/DenseTime/TrajectoryMarginals.lean b/LeanPool/MarkovProcess/MarkovProcess/DenseTime/TrajectoryMarginals.lean index 407b560fcb..a8e4c72c19 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/DenseTime/TrajectoryMarginals.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/DenseTime/TrajectoryMarginals.lean @@ -15,7 +15,7 @@ This file identifies every coordinate marginal of the dense-time trajectory kern corresponding transition kernel. The result is derived from the exact finite-prefix identity. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/DenseTime/TwoPointMarginals.lean b/LeanPool/MarkovProcess/MarkovProcess/DenseTime/TwoPointMarginals.lean index 967b021581..7706eed38d 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/DenseTime/TwoPointMarginals.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/DenseTime/TwoPointMarginals.lean @@ -28,7 +28,7 @@ No continuity, modification, Markov-property, or path-regularity statement is pr the two-point law and the moment estimate it transports. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Examples/BrownianMotion.lean b/LeanPool/MarkovProcess/MarkovProcess/Examples/BrownianMotion.lean index a6ddc1efe3..c2ace4ce1b 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Examples/BrownianMotion.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Examples/BrownianMotion.lean @@ -42,7 +42,7 @@ marginals and independent increments, not through a projective family. Only one Levy characterization, quadratic variation, or stochastic integral is asserted. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -107,6 +107,7 @@ end MarkovProperty section Increments /-- The increments of a finite coordinate path, the first one measured from a base point. -/ +@[expose] def incrementsMap : {n : ℕ} → ℝ → (Fin n → ℝ) → (Fin n → ℝ) | 0, _, _ => fun i ↦ i.elim0 | _ + 1, x, path => Fin.cons (path 0 - x) (incrementsMap (path 0) (Fin.tail path)) @@ -161,6 +162,7 @@ theorem measurable_incrementsMap {n : ℕ} : /-- The successive time increments of a finite family of times, the first one measured from time zero. -/ +@[expose] def timeIncrements : {n : ℕ} → (Fin n → NNReal) → (Fin n → NNReal) | 0, _ => fun i ↦ i.elim0 | _ + 1, s => Fin.cons (s 0) (timeIncrements (fun i ↦ s i.succ - s 0)) diff --git a/LeanPool/MarkovProcess/MarkovProcess/Examples/Drift.lean b/LeanPool/MarkovProcess/MarkovProcess/Examples/Drift.lean index c2fc018140..9d13131112 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Examples/Drift.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Examples/Drift.lean @@ -22,7 +22,7 @@ theorem are satisfiable by a semigroup that genuinely moves. Nothing here is cl semigroup with a nonzero diffusion part; for that see `MarkovProcess.Examples.HeatSemigroup`. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -46,6 +46,7 @@ theorem measurable_driftTranslate (v : E) (t : NNReal) : /-- The deterministic drift semigroup with velocity `v`: at time `t` it moves every point by `t • v`. -/ +@[expose] def driftSemigroup (v : E) : SubMarkovKernelSemigroup E where kernel := fun t ↦ Kernel.deterministic (fun x ↦ x + (t : ℝ) • v) (measurable_driftTranslate v t) measurable_kernel := by @@ -183,6 +184,7 @@ theorem existsUnique_continuousProcess_driftSemigroup (v : E) : (driftSemigroup v) (isConservative_driftSemigroup v) (hasKolmogorovMoments_driftSemigroup v) /-- The straight line started at `x` with velocity `v`, as a continuous path. -/ +@[expose] def driftPath (v : E) (x : E) : ContinuousPath E where toFun := fun t ↦ x + (t : ℝ) • v continuous_toFun := by fun_prop diff --git a/LeanPool/MarkovProcess/MarkovProcess/Examples/HeatGenerator.lean b/LeanPool/MarkovProcess/MarkovProcess/Examples/HeatGenerator.lean index 0b75a0e436..d48a03db99 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Examples/HeatGenerator.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Examples/HeatGenerator.lean @@ -46,7 +46,7 @@ contained), and nothing is claimed in dimension greater than one or for a functi stated smoothness class. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Examples/HeatOnePoint.lean b/LeanPool/MarkovProcess/MarkovProcess/Examples/HeatOnePoint.lean index 6602b5d9a4..8bd8e713d2 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Examples/HeatOnePoint.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Examples/HeatOnePoint.lean @@ -28,7 +28,7 @@ process started at a live point almost surely never reaches the added point (`ae_exitTime_eq_top_heatResolvent`). -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Examples/HeatSemigroup.lean b/LeanPool/MarkovProcess/MarkovProcess/Examples/HeatSemigroup.lean index bb8b5528a2..e0b86296a1 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Examples/HeatSemigroup.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Examples/HeatSemigroup.lean @@ -37,7 +37,7 @@ Nothing in this file asserts independence of increments; that is proved in `MarkovProcess.Examples.BrownianMotion`. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -360,6 +360,7 @@ theorem isFellerKernelSemigroup_heatSemigroup : ⟨mapsC0_heatSemigroup, hasContinuousC0Orbits_heatSemigroup⟩ /-- The positive contractive `C₀` resolvent obtained from the heat semigroup. -/ +@[expose] noncomputable def heatResolvent : PositiveC0ContractiveResolvent ℝ := isFellerKernelSemigroup_heatSemigroup.positiveC0ContractiveResolvent @@ -501,6 +502,7 @@ theorem existsUnique_continuousProcess_heatSemigroup : /-- **Brownian motion on the line**, as a Markov kernel from the starting point to continuous paths: the continuous-path process of the heat semigroup. -/ +@[expose] def brownianMotion : Kernel ℝ (ContinuousPath ℝ) := SubMarkovKernelSemigroup.IsConservative.continuousProcess heatSemigroup isConservative_heatSemigroup diff --git a/LeanPool/MarkovProcess/MarkovProcess/Examples/Identity.lean b/LeanPool/MarkovProcess/MarkovProcess/Examples/Identity.lean index 4278974ba5..9b58d36f8e 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Examples/Identity.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Examples/Identity.lean @@ -22,7 +22,7 @@ nothing about any other semigroup, and it makes no claim about a semigroup that (see `MarkovProcess.Examples.Drift` for that). -/ -@[expose] public section +public section noncomputable section PortComputability @@ -39,6 +39,7 @@ variable {alpha : Type*} [MeasurableSpace alpha] /-- The identity kernel semigroup: the transition kernel at every time is the identity kernel, so the associated process never moves. -/ +@[expose] def idSemigroup : SubMarkovKernelSemigroup alpha where kernel := fun _ ↦ Kernel.id measurable_kernel := (Kernel.id : Kernel alpha alpha).measurable.comp measurable_snd diff --git a/LeanPool/MarkovProcess/MarkovProcess/Feller/BackwardC0Convergence.lean b/LeanPool/MarkovProcess/MarkovProcess/Feller/BackwardC0Convergence.lean index 8ae6fc4a23..47ab22aed0 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Feller/BackwardC0Convergence.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Feller/BackwardC0Convergence.lean @@ -29,7 +29,7 @@ The factors and the observation times are fixed; nothing is asserted when they v filter as well, and no rate of convergence is claimed. -/ -@[expose] public section +public section open Filter MeasureTheory Topology open scoped NNReal ZeroAtInfty BigOperators diff --git a/LeanPool/MarkovProcess/MarkovProcess/Feller/BackwardC0Integral.lean b/LeanPool/MarkovProcess/MarkovProcess/Feller/BackwardC0Integral.lean index c7d135aeb4..1045cba898 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Feller/BackwardC0Integral.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Feller/BackwardC0Integral.lean @@ -21,7 +21,7 @@ measures, which suffice for bounded integrability. This is an analytic identifi statement about path space is proved here, and the process itself is built in `Trajectory/`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory open scoped NNReal ProbabilityTheory ZeroAtInfty diff --git a/LeanPool/MarkovProcess/MarkovProcess/Feller/BackwardC0Recursion.lean b/LeanPool/MarkovProcess/MarkovProcess/Feller/BackwardC0Recursion.lean index 1e2a8377a4..45425bc7e2 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Feller/BackwardC0Recursion.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Feller/BackwardC0Recursion.lean @@ -22,7 +22,7 @@ integral against a finite-time kernel is in `Feller/BackwardC0Integral.lean`; no path space is proved here. -/ -@[expose] public section +public section open Filter Topology open scoped NNReal ZeroAtInfty @@ -34,6 +34,7 @@ variable {alpha : Type*} [TopologicalSpace alpha] [MeasurableSpace alpha] [BorelSpace alpha] [LocallyCompactSpace alpha] [T2Space alpha] /-- Backward semigroup recursion for a nonempty ordered family of coordinatewise `C₀` factors. -/ +@[expose] noncomputable def IsFellerKernelSemigroup.backwardC0 {P : SubMarkovKernelSemigroup alpha} (hP : P.IsFellerKernelSemigroup) : {n : ℕ} → FiniteOrderedTimes (n + 1) → diff --git a/LeanPool/MarkovProcess/MarkovProcess/Feller/CoordinatePolynomialContinuity.lean b/LeanPool/MarkovProcess/MarkovProcess/Feller/CoordinatePolynomialContinuity.lean index d008b793f1..8bfa71f4ff 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Feller/CoordinatePolynomialContinuity.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Feller/CoordinatePolynomialContinuity.lean @@ -20,7 +20,7 @@ This file handles only explicit finite coordinate polynomials. The passage to a compactly supported continuous tests is in `Feller/FiniteTimeCompactTestContinuity.lean`. -/ -@[expose] public section +public section open Filter MeasureTheory ProbabilityTheory Topology open scoped NNReal ZeroAtInfty BigOperators diff --git a/LeanPool/MarkovProcess/MarkovProcess/Feller/CoordinateProductContinuity.lean b/LeanPool/MarkovProcess/MarkovProcess/Feller/CoordinateProductContinuity.lean index d223b21fba..68c4440e65 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Feller/CoordinateProductContinuity.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Feller/CoordinateProductContinuity.lean @@ -23,7 +23,7 @@ it never attempts to construct a constant-one element of `C₀`. This is finite analytic infrastructure; no statement about path space is proved here. -/ -@[expose] public section +public section open Filter MeasureTheory ProbabilityTheory Topology open scoped NNReal ZeroAtInfty BigOperators diff --git a/LeanPool/MarkovProcess/MarkovProcess/Feller/DensePhysicalFiniteSetContinuity.lean b/LeanPool/MarkovProcess/MarkovProcess/Feller/DensePhysicalFiniteSetContinuity.lean index b1fedaf5db..afa529c687 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Feller/DensePhysicalFiniteSetContinuity.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Feller/DensePhysicalFiniteSetContinuity.lean @@ -21,7 +21,7 @@ This is finite-dimensional analytic infrastructure; no statement about path spac here. The continuous-path process is built in `Trajectory/`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory open scoped NNReal CompactlySupported ZeroAtInfty diff --git a/LeanPool/MarkovProcess/MarkovProcess/Feller/FiniteDenseApproximationContinuity.lean b/LeanPool/MarkovProcess/MarkovProcess/Feller/FiniteDenseApproximationContinuity.lean index f0c5e2867e..487d22018f 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Feller/FiniteDenseApproximationContinuity.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Feller/FiniteDenseApproximationContinuity.lean @@ -22,7 +22,7 @@ This is finite-dimensional infrastructure. No path-space Markov property is asse Markov and strong Markov statements are in `MarkovProcess/Main.lean`. -/ -@[expose] public section +public section open Filter MeasureTheory ProbabilityTheory Topology open scoped NNReal CompactlySupported diff --git a/LeanPool/MarkovProcess/MarkovProcess/Feller/FiniteSetCompactTestContinuity.lean b/LeanPool/MarkovProcess/MarkovProcess/Feller/FiniteSetCompactTestContinuity.lean index 4f9704c0f7..082d51e447 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Feller/FiniteSetCompactTestContinuity.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Feller/FiniteSetCompactTestContinuity.lean @@ -21,7 +21,7 @@ This is finite-dimensional analytic infrastructure; no statement about path spac here. The continuous-path process is built in `Trajectory/`. -/ -@[expose] public section +public section open MeasureTheory open scoped NNReal CompactlySupported diff --git a/LeanPool/MarkovProcess/MarkovProcess/Feller/FiniteSetConvergence.lean b/LeanPool/MarkovProcess/MarkovProcess/Feller/FiniteSetConvergence.lean index 9bb600d664..76623fc8d3 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Feller/FiniteSetConvergence.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Feller/FiniteSetConvergence.lean @@ -30,7 +30,7 @@ The set of observation times is fixed; nothing is asserted about joint convergen and the semigroups. -/ -@[expose] public section +public section open Filter MeasureTheory ProbabilityTheory Topology open scoped BoundedContinuousFunction CompactlySupported NNReal ZeroAtInfty diff --git a/LeanPool/MarkovProcess/MarkovProcess/Feller/FiniteTimeCompactTestContinuity.lean b/LeanPool/MarkovProcess/MarkovProcess/Feller/FiniteTimeCompactTestContinuity.lean index 6aa9e60439..6ea3200ee5 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Feller/FiniteTimeCompactTestContinuity.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Feller/FiniteTimeCompactTestContinuity.lean @@ -22,7 +22,7 @@ coordinate-polynomial approximants instead of adding that extra assumption. This finite-dimensional analytic infrastructure; no statement about path space is proved here. -/ -@[expose] public section +public section open Filter MeasureTheory ProbabilityTheory Topology open scoped NNReal ZeroAtInfty BigOperators CompactlySupported diff --git a/LeanPool/MarkovProcess/MarkovProcess/Feller/FiniteTimeContinuityBase.lean b/LeanPool/MarkovProcess/MarkovProcess/Feller/FiniteTimeContinuityBase.lean index 8c59317f03..796a73bf9f 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Feller/FiniteTimeContinuityBase.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Feller/FiniteTimeContinuityBase.lean @@ -18,7 +18,7 @@ integrals as the observation time varies. This is the base case for a recursive continuity argument; no higher-dimensional continuity is asserted here. -/ -@[expose] public section +public section open Filter MeasureTheory Topology open scoped NNReal ZeroAtInfty diff --git a/LeanPool/MarkovProcess/MarkovProcess/Feller/FiniteTimeConvergence.lean b/LeanPool/MarkovProcess/MarkovProcess/Feller/FiniteTimeConvergence.lean index 6c83336c69..2e2f4229d2 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Feller/FiniteTimeConvergence.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Feller/FiniteTimeConvergence.lean @@ -37,7 +37,7 @@ bounded and continuous, which needs the tightness of the limiting law and is the uniform in the starting point. -/ -@[expose] public section +public section open Filter MeasureTheory ProbabilityTheory Topology open scoped NNReal ZeroAtInfty BigOperators CompactlySupported diff --git a/LeanPool/MarkovProcess/MarkovProcess/Feller/FiniteTimeJointCompactTestContinuity.lean b/LeanPool/MarkovProcess/MarkovProcess/Feller/FiniteTimeJointCompactTestContinuity.lean index 64e820b137..713b1d6ad9 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Feller/FiniteTimeJointCompactTestContinuity.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Feller/FiniteTimeJointCompactTestContinuity.lean @@ -19,7 +19,7 @@ This is finite-dimensional analytic infrastructure; no statement about path spac here. The continuous-path process is built in `Trajectory/`. -/ -@[expose] public section +public section open Filter MeasureTheory ProbabilityTheory Topology open scoped NNReal ZeroAtInfty BigOperators CompactlySupported diff --git a/LeanPool/MarkovProcess/MarkovProcess/Feller/FiniteTimeKernelContinuity.lean b/LeanPool/MarkovProcess/MarkovProcess/Feller/FiniteTimeKernelContinuity.lean index 8bf0fccf3c..303e145902 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Feller/FiniteTimeKernelContinuity.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Feller/FiniteTimeKernelContinuity.lean @@ -21,7 +21,7 @@ The extension from product tests to arbitrary compactly supported tests on a fin not asserted here. -/ -@[expose] public section +public section open Filter MeasureTheory Topology open scoped NNReal ZeroAtInfty diff --git a/LeanPool/MarkovProcess/MarkovProcess/Feller/Resolvent.lean b/LeanPool/MarkovProcess/MarkovProcess/Feller/Resolvent.lean index aa9900b7ff..988ab911ab 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Feller/Resolvent.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Feller/Resolvent.lean @@ -41,7 +41,7 @@ The bridge to `SubMarkovKernelSemigroup.kernelResolvent` is pointwise on nonnega no kernel-valued resolvent is constructed. -/ -@[expose] public section +public section open Filter MeasureTheory ProbabilityTheory Set open scoped NNReal ZeroAtInfty diff --git a/LeanPool/MarkovProcess/MarkovProcess/Feller/Semigroup.lean b/LeanPool/MarkovProcess/MarkovProcess/Feller/Semigroup.lean index 43432eff46..e950411930 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Feller/Semigroup.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Feller/Semigroup.lean @@ -18,7 +18,7 @@ packages those operators as a strongly continuous contraction semigroup. Spatial No stochastic process or Hunt process is constructed here. -/ -@[expose] public section +public section open Topology open scoped ZeroAtInfty @@ -31,12 +31,14 @@ variable {α : Type*} [TopologicalSpace α] [MeasurableSpace α] [BorelSpace α] /-- The `C₀` kernel operators have continuous time orbits in the `C₀` norm. This is an additional hypothesis beyond the spatial `MapsC0` property. -/ +@[expose] def HasContinuousC0Orbits (P : SubMarkovKernelSemigroup α) (hC0 : P.MapsC0) : Prop := ∀ f : C₀(α, ℝ), Continuous fun t : NNReal ↦ P.c0Operator hC0 t f /-- A sub-Markov kernel semigroup on a locally compact Hausdorff space has the `C₀` Feller-semigroup properties when it maps `C₀` into itself and its resulting `C₀` operator orbits are continuous in time. Conservativity is not part of this predicate. -/ +@[expose] def IsFellerKernelSemigroup (P : SubMarkovKernelSemigroup α) : Prop := ∃ hC0 : P.MapsC0, P.HasContinuousC0Orbits hC0 @@ -44,6 +46,7 @@ def IsFellerKernelSemigroup (P : SubMarkovKernelSemigroup α) variable (P : SubMarkovKernelSemigroup α) (hC0 : P.MapsC0) /-- Package the kernel action on `C₀` as a strongly continuous contraction semigroup. -/ +@[expose] noncomputable def c0Semigroup (hTime : P.HasContinuousC0Orbits hC0) : Semigroup.StronglyContinuousContractionSemigroup C₀(α, ℝ) where operator := P.c0Operator hC0 @@ -86,6 +89,7 @@ theorem IsFellerKernelSemigroup.hasContinuousC0Orbits {P : SubMarkovKernelSemigr hP.choose_spec /-- The strongly continuous contraction semigroup selected by the combined Feller predicate. -/ +@[expose] noncomputable def IsFellerKernelSemigroup.c0Semigroup {P : SubMarkovKernelSemigroup α} (hP : P.IsFellerKernelSemigroup) : Semigroup.StronglyContinuousContractionSemigroup C₀(α, ℝ) := diff --git a/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/CoordinateProductActiveReduction.lean b/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/CoordinateProductActiveReduction.lean index e99f0ab8b0..06bc52d4ac 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/CoordinateProductActiveReduction.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/CoordinateProductActiveReduction.lean @@ -22,7 +22,7 @@ product is one. No constant-one element of `C₀` is constructed. This is pure finite-product infrastructure: it involves no measure and no kernel. -/ -@[expose] public section +public section open scoped CompactlySupported ZeroAtInfty BigOperators @@ -92,6 +92,7 @@ theorem normalizedCoordinateFactors_evaluation_active /-- Scalar evaluation of a normalized term on only its active coordinates. For an empty active set this is the coefficient times the empty scalar product, hence just the coefficient. -/ +@[expose] def CoordinateProductTerm.activeEvaluation (t : CoordinateProductTerm (Fin n) alpha) (y : Fin (activeCoordinates t.factors).card → alpha) : ℝ := diff --git a/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/CoordinateProductNormalization.lean b/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/CoordinateProductNormalization.lean index 84f6b64f97..3ed643af3b 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/CoordinateProductNormalization.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/CoordinateProductNormalization.lean @@ -23,7 +23,7 @@ recursions that branch only over active coordinates. This is purely algebraic finite-product infrastructure: it involves no measure and no kernel. -/ -@[expose] public section +public section open scoped CompactlySupported ZeroAtInfty BigOperators @@ -44,6 +44,7 @@ def normalizedCoordinateFactors (factors : List (Fin n × C₀(alpha, ℝ))) : (fun _ ↦ none) /-- Scalar evaluation of an optional normalized factor; inactivity contributes scalar one. -/ +@[expose] def evalOptionalFactor (x : alpha) : Option C₀(alpha, ℝ) → ℝ | none => 1 | some f => f x @@ -98,6 +99,7 @@ theorem normalizedCoordinateFactors_evaluation rw [hEvalUpdate, prod_update_mul] /-- Active coordinates of a normalized coordinate product. -/ +@[expose] def activeCoordinates (factors : List (Fin n × C₀(alpha, ℝ))) : Finset (Fin n) := Finset.univ.filter fun i ↦ (normalizedCoordinateFactors factors i).isSome diff --git a/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/DenseTimeFiniteSetKernelShift.lean b/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/DenseTimeFiniteSetKernelShift.lean index 4eeff33a1c..d2865e18e1 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/DenseTimeFiniteSetKernelShift.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/DenseTimeFiniteSetKernelShift.lean @@ -16,7 +16,7 @@ This file transports the finite-set kernel translation law from physical nonnega to finite sets of dense times, using the canonical coordinate reindexings. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/DenseTimeFiniteShift.lean b/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/DenseTimeFiniteShift.lean index 0cc9f6bd26..bbc3de9d3f 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/DenseTimeFiniteShift.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/DenseTimeFiniteShift.lean @@ -16,7 +16,7 @@ provides the resulting coordinate equivalence and relates restriction after shif path to restriction on the translated finite set. It makes no probability-law or Markov claim. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -27,6 +27,7 @@ section namespace DenseTime /-- The image of a finite dense-time set under addition by `s`. -/ +@[expose] def addFinset (s : DenseTime) (I : Finset DenseTime) : Finset DenseTime := I.map (addOrderEmbedding s).toEmbedding @@ -41,6 +42,7 @@ theorem mem_addFinset (s : DenseTime) (I : Finset DenseTime) (t : DenseTime) : exact ⟨r, hr, hrt⟩ /-- Addition by `s` identifies a finite dense-time set with its translated image. -/ +@[expose] def addFinsetEquiv (s : DenseTime) (I : Finset DenseTime) : I ≃ addFinset s I := Equiv.ofBijective (fun t ↦ ⟨s + t, (mem_addFinset s I (s + t)).mpr ⟨t, t.property, rfl⟩⟩) @@ -66,6 +68,7 @@ namespace DenseTimePath variable {alpha : Type*} /-- Reindex a path on a translated finite dense-time set back to the original coordinates. -/ +@[expose] def pullbackAddFinset (s : DenseTime) (I : Finset DenseTime) (path : DenseTime.addFinset s I → alpha) : I → alpha := fun t ↦ path (DenseTime.addFinsetEquiv s I t) diff --git a/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/FiniteProductCompactSupportApproximation.lean b/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/FiniteProductCompactSupportApproximation.lean index 359b3d5818..20eb7d4c9a 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/FiniteProductCompactSupportApproximation.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/FiniteProductCompactSupportApproximation.lean @@ -16,7 +16,7 @@ whole product. The key device is a product of one-coordinate compactly supporte coordinate cutoff is one on the corresponding projection of the target's compact support. -/ -@[expose] public section +public section open Topology open scoped CompactlySupported ZeroAtInfty diff --git a/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/FiniteProductCoordinateNormalForm.lean b/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/FiniteProductCoordinateNormalForm.lean index 081e44e46e..f7ce4bfb1b 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/FiniteProductCoordinateNormalForm.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/FiniteProductCoordinateNormalForm.lean @@ -18,7 +18,7 @@ the constant function `1`; in particular the representation treats constants and coordinate type without exceptional cases. -/ -@[expose] public section +public section open scoped CompactlySupported ZeroAtInfty @@ -51,6 +51,7 @@ theorem CoordinateProductTerm.toContinuousMap_apply exact congrArg (fun z ↦ p.2 (x p.1) * z) ih /-- Evaluate a finite list of coordinate-product terms by summing its terms. -/ +@[expose] def coordinatePolynomial (terms : List (CoordinateProductTerm I α)) : C(I → α, ℝ) := (terms.map CoordinateProductTerm.toContinuousMap).sum diff --git a/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/FiniteProductStoneWeierstrass.lean b/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/FiniteProductStoneWeierstrass.lean index 7303bc333f..c5a9072638 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/FiniteProductStoneWeierstrass.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/FiniteProductStoneWeierstrass.lean @@ -28,7 +28,7 @@ whole product. Accordingly, `coordinateC0Subalgebra` is a subalgebra of continu `C₀` designation records its one-coordinate generators, not its ambient carrier. -/ -@[expose] public section +public section open Topology open scoped ZeroAtInfty @@ -38,6 +38,7 @@ namespace MarkovProcess.PiContinuousMap variable {I α : Type*} [TopologicalSpace α] /-- Pull a continuous function on one factor back along a coordinate projection. -/ +@[expose] def coordinate (i : I) (f : C(α, ℝ)) : C(I → α, ℝ) := f.comp ⟨fun x ↦ x i, continuous_apply i⟩ @@ -55,6 +56,7 @@ theorem coordinate_mem_coordinateSubalgebra (i : I) (f : C(α, ℝ)) : Algebra.subset_adjoin ⟨i, f, rfl⟩ /-- The algebra generated by coordinate pullbacks of functions vanishing at infinity. -/ +@[expose] def coordinateC0Subalgebra : Subalgebra ℝ C(I → α, ℝ) := Algebra.adjoin ℝ {g | ∃ (i : I) (f : C₀(α, ℝ)), g = coordinate i (f : C(α, ℝ))} diff --git a/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/FiniteSetKernelCompactTestTransport.lean b/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/FiniteSetKernelCompactTestTransport.lean index b1666c0294..edf5b72711 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/FiniteSetKernelCompactTestTransport.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/FiniteSetKernelCompactTestTransport.lean @@ -24,7 +24,7 @@ product. These declarations are finite-dimensional infrastructure; no statement is proved here. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory open scoped NNReal CompactlySupported diff --git a/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/FiniteSetKernelShift.lean b/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/FiniteSetKernelShift.lean index b57636ddc4..17dd2731a6 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/FiniteSetKernelShift.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/FiniteSetKernelShift.lean @@ -19,7 +19,7 @@ for conservative transition-kernel semigroups. It is finite-dimensional kernel it does not assert a path-space Markov property. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -41,6 +41,7 @@ theorem mem_finiteSetTranslate (s : NNReal) (I : Finset NNReal) (t : NNReal) : rfl /-- Translation identifies the original finite time set with its translated image. -/ +@[expose] def finiteSetTranslateEquiv (s : NNReal) (I : Finset NNReal) : I ≃ finiteSetTranslate s I := Equiv.ofBijective (fun t ↦ ⟨s + t, (mem_finiteSetTranslate s I (s + t)).mpr ⟨t, t.property, rfl⟩⟩) @@ -59,6 +60,7 @@ theorem finiteSetTranslateEquiv_apply (s : NNReal) (I : Finset NNReal) (t : I) : rfl /-- Reindex a path on translated times back to the original finite set. -/ +@[expose] def pullbackFiniteSetTranslate {alpha : Type*} (s : NNReal) (I : Finset NNReal) (path : finiteSetTranslate s I → alpha) : I → alpha := fun t ↦ path (finiteSetTranslateEquiv s I t) diff --git a/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/Kernel.lean b/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/Kernel.lean index 78ccd6b13c..08e714cea2 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/Kernel.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/Kernel.lean @@ -23,7 +23,7 @@ This file constructs finite-dimensional kernels only. It makes no path-space, p conservativity, or stochastic-process existence claim beyond the explicitly stated results. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory open scoped ProbabilityTheory @@ -46,6 +46,7 @@ namespace SubMarkovKernelSemigroup variable {α : Type*} [MeasurableSpace α] /-- The finite-time kernel obtained by recursively sampling a strictly ordered family of times. -/ +@[expose] noncomputable def finiteTimeKernel (P : SubMarkovKernelSemigroup α) : {n : ℕ} → FiniteOrderedTimes n → Kernel α (Fin n → α) | 0, _ => Kernel.const α (Measure.dirac (FiniteOrderedTimes.emptyPath α)) @@ -90,6 +91,7 @@ theorem IsConservative.isMarkovKernel_finiteTimeKernel exact Kernel.IsMarkovKernel.map _ measurable_finCons /-- The finite-time law at a starting state. -/ +@[expose] noncomputable def finiteTimeLaw (P : SubMarkovKernelSemigroup α) {n : ℕ} (times : FiniteOrderedTimes n) (x : α) : Measure (Fin n → α) := finiteTimeKernel P times x diff --git a/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/KernelConcatenation.lean b/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/KernelConcatenation.lean index 72a4e5aac6..207b2dfecc 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/KernelConcatenation.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/KernelConcatenation.lean @@ -19,7 +19,7 @@ from the terminal coordinate of the past. This is finite-dimensional kernel inf does not assert a path-space or conditional Markov theorem. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory open scoped ProbabilityTheory @@ -28,17 +28,20 @@ namespace MarkovProcess /-- Reassociate the cardinality of a split finite path so recursion removes its first point definitionally while the coordinate order remains past-then-future. -/ +@[expose] def cutIndexOrderIso (m n : ℕ) : Fin ((m + 1) + n) ≃o Fin (n + (m + 1)) := Fin.castOrderIso (Nat.add_comm (m + 1) n) namespace FiniteOrderedTimes /-- Restrict an ordered family to the coordinates at or before a designated cut. -/ +@[expose] def initialSegment {m n : ℕ} (times : FiniteOrderedTimes (n + (m + 1))) : FiniteOrderedTimes (m + 1) := times.restrict ((Fin.castAddOrderEmb n).trans (cutIndexOrderIso m n).toOrderEmbedding) /-- Times after the cut, measured relative to the time at the cut. -/ +@[expose] def relativeFinalSegment {m n : ℕ} (times : FiniteOrderedTimes (n + (m + 1))) : FiniteOrderedTimes n := OrderEmbedding.ofStrictMono @@ -98,6 +101,7 @@ private theorem relativeFinalSegment_relativeTail {m n : ℕ} simp [cutIndexOrderIso] /-- Separate a finite path into its coordinates at or before the cut and those after the cut. -/ +@[expose] def splitFinitePath {m n : ℕ} (path : Fin (n + (m + 1)) → alpha) : (Fin (m + 1) → alpha) × (Fin n → alpha) := (fun i ↦ path (cutIndexOrderIso m n (Fin.castAdd n i)), @@ -140,6 +144,7 @@ private theorem splitFinitePath_cons {m n : ℕ} rw [hidx, Fin.cons_succ] /-- The terminal state of the first component of a split finite path. -/ +@[expose] def splitPastTerminal {m : ℕ} (z : alpha × (Fin (m + 1) → alpha)) : alpha := z.2 (Fin.last m) diff --git a/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/KernelDeletion.lean b/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/KernelDeletion.lean index 371b8a305d..9d3a211a5a 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/KernelDeletion.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/KernelDeletion.lean @@ -18,7 +18,7 @@ gives the law on the remaining ordered times. This is finite-dimensional kernel it does not construct a path-space law or a stochastic process. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory open scoped ProbabilityTheory diff --git a/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/KernelEquivariance.lean b/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/KernelEquivariance.lean index ff2eba29ac..7ad9c1c475 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/KernelEquivariance.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/KernelEquivariance.lean @@ -32,7 +32,7 @@ Kolmogorov moment criterion also transfers, with the constant multiplied by `c ^ (`IsRescaledConjugate.hasKolmogorovMoments`). -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory open scoped NNReal ProbabilityTheory @@ -43,6 +43,7 @@ namespace FiniteOrderedTimes /-- Multiply every time of a finite ordered family by a fixed positive factor. Positivity of the factor is what keeps the family strictly increasing. -/ +@[expose] def rescale {n : ℕ} (c : NNReal) (hc : 0 < c) (times : FiniteOrderedTimes n) : FiniteOrderedTimes n := OrderEmbedding.ofStrictMono (fun i ↦ c * times i) fun _ _ hij ↦ @@ -82,6 +83,7 @@ theorem relativeTail_rescale {n : ℕ} (c : NNReal) (hc : 0 < c) exact (mul_tsub c (times i.succ) (times 0)).symm /-- Apply a map of the state space to every coordinate of a coordinate path. -/ +@[expose] def mapPath {ι alpha beta : Type*} (e : alpha → beta) (path : ι → alpha) : ι → beta := fun i ↦ e (path i) @@ -177,6 +179,7 @@ variable {alpha beta : Type*} [TopologicalSpace alpha] [MeasurableSpace alpha] [ /-- `P'` is the *rescaled conjugate* of `P` by the homeomorphism `e` and the time factor `c`: started at `x`, the state of `P'` at time `t` is the image under `e` of the state of `P` at the sped-up time `c * t` started at `e.symm x`. -/ +@[expose] def IsRescaledConjugate (P : SubMarkovKernelSemigroup alpha) (P' : SubMarkovKernelSemigroup beta) (e : alpha ≃ₜ beta) (c : NNReal) : Prop := diff --git a/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/KernelMixedPullback.lean b/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/KernelMixedPullback.lean index 53d5a7ce35..eee7206de9 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/KernelMixedPullback.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/KernelMixedPullback.lean @@ -20,7 +20,7 @@ The result is pure finite-dimensional Chapman--Kolmogorov algebra. In particula continuity, density, path-space, or Feller hypothesis. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory diff --git a/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/KernelRestriction.lean b/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/KernelRestriction.lean index 953d76f8ae..429b3831b6 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/KernelRestriction.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/KernelRestriction.lean @@ -17,7 +17,7 @@ gives the finite-time kernel at the selected times. This is finite-dimensional k infrastructure and does not construct a path-space law or a stochastic process. -/ -@[expose] public section +public section open ProbabilityTheory diff --git a/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/KernelShift.lean b/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/KernelShift.lean index 977c69e40c..0dd0c3144e 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/KernelShift.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/KernelShift.lean @@ -16,7 +16,7 @@ This file proves the finite-dimensional translation identity for a conservative semigroup. It is ordinary kernel infrastructure and makes no path-space or process-existence claim. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory open scoped ProbabilityTheory diff --git a/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/MeasureFiniteRestrictionIdentification.lean b/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/MeasureFiniteRestrictionIdentification.lean index 0ba00f92bf..66ea7eb2de 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/MeasureFiniteRestrictionIdentification.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/MeasureFiniteRestrictionIdentification.lean @@ -18,7 +18,7 @@ unequal mass cannot satisfy the hypothesis. This is generic measure-theoretic infrastructure and requires no topology. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/ProjectiveFamily.lean b/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/ProjectiveFamily.lean index ff5ef1f84e..cc9965cec2 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/ProjectiveFamily.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/FiniteTime/ProjectiveFamily.lean @@ -17,7 +17,7 @@ This file reindexes the ordered finite-time kernels by finite sets of times and Mathlib-native projectivity. It does not assert or construct a projective-limit measure. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory @@ -27,10 +27,12 @@ namespace SubMarkovKernelSemigroup variable {α : Type*} [MeasurableSpace α] /-- The increasing enumeration of a finite set of nonnegative times. -/ +@[expose] noncomputable def finiteSetTimes (I : Finset NNReal) : FiniteOrderedTimes I.card := I.orderEmbOfFin rfl /-- Reindex an ordered coordinate path by its finite set of times. -/ +@[expose] noncomputable def orderedPathToFiniteSet (I : Finset NNReal) (path : Fin I.card → α) : I → α := fun t ↦ path ((I.orderIsoOfFin rfl).symm t) diff --git a/LeanPool/MarkovProcess/MarkovProcess/Kernel/Basic.lean b/LeanPool/MarkovProcess/MarkovProcess/Kernel/Basic.lean index dc7f7292fd..7dc1ceb0cc 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Kernel/Basic.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Kernel/Basic.lean @@ -16,7 +16,7 @@ not define transition families or connect kernels to operator semigroups or stochastic processes. -/ -@[expose] public section +public section open MeasureTheory open scoped ENNReal ProbabilityTheory @@ -26,6 +26,7 @@ namespace MarkovProcess variable {α β γ : Type*} [MeasurableSpace α] [MeasurableSpace β] [MeasurableSpace γ] /-- A kernel is sub-Markov if each of its measures has total mass at most one. -/ +@[expose] def IsSubMarkovKernel (κ : ProbabilityTheory.Kernel α β) : Prop := ∀ x, κ x Set.univ ≤ 1 diff --git a/LeanPool/MarkovProcess/MarkovProcess/Kernel/C0.lean b/LeanPool/MarkovProcess/MarkovProcess/Kernel/C0.lean index 6e84f42177..83b8d9d0e1 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Kernel/C0.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Kernel/C0.lean @@ -20,7 +20,7 @@ raw integral as a contractive continuous linear map on `C₀(α, ℝ)`. It make continuity in time or the existence of an associated stochastic process. -/ -@[expose] public section +public section open Filter MeasureTheory ProbabilityTheory Topology open scoped ENNReal ZeroAtInfty @@ -33,6 +33,7 @@ variable {α : Type*} [TopologicalSpace α] [MeasurableSpace α] /-- A kernel semigroup maps `C₀(α, ℝ)` into itself when its raw kernel integral is continuous and vanishes at infinity at every time. -/ +@[expose] def MapsC0 (P : SubMarkovKernelSemigroup α) : Prop := ∀ t (f : C₀(α, ℝ)), Continuous (kernelIntegral (P t) f) ∧ @@ -41,6 +42,7 @@ def MapsC0 (P : SubMarkovKernelSemigroup α) : Prop := variable (P : SubMarkovKernelSemigroup α) (hC0 : P.MapsC0) /-- The exact `C₀` representative obtained by integrating against `P t`. -/ +@[expose] noncomputable def c0KernelIntegral (t : NNReal) (f : C₀(α, ℝ)) : C₀(α, ℝ) where toFun := kernelIntegral (P t) f continuous_toFun := (hC0 t f).1 @@ -77,6 +79,7 @@ private theorem norm_c0KernelIntegral_le (t : NNReal) (f : C₀(α, ℝ)) : rw [one_mul, ZeroAtInftyContinuousMap.norm_toBCF_eq_norm] /-- The kernel integral as a contraction on real continuous functions vanishing at infinity. -/ +@[expose] noncomputable def c0Operator (t : NNReal) : C₀(α, ℝ) →L[ℝ] C₀(α, ℝ) := LinearMap.mkContinuous { toFun := P.c0KernelIntegral hC0 t diff --git a/LeanPool/MarkovProcess/MarkovProcess/Kernel/C0SemigroupJoint.lean b/LeanPool/MarkovProcess/MarkovProcess/Kernel/C0SemigroupJoint.lean index ba547a8f53..eebee2a679 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Kernel/C0SemigroupJoint.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Kernel/C0SemigroupJoint.lean @@ -22,7 +22,7 @@ This is a generic functional-analytic API. It makes no representation claim about the semigroup. -/ -@[expose] public section +public section open scoped ZeroAtInfty diff --git a/LeanPool/MarkovProcess/MarkovProcess/Kernel/CompProdReindex.lean b/LeanPool/MarkovProcess/MarkovProcess/Kernel/CompProdReindex.lean index 0b66eb7aaa..efa2aa9e14 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Kernel/CompProdReindex.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Kernel/CompProdReindex.lean @@ -16,7 +16,7 @@ product. They are measure-kernel infrastructure and make no assertion about a s process. -/ -@[expose] public section +public section open MeasureTheory open scoped ProbabilityTheory diff --git a/LeanPool/MarkovProcess/MarkovProcess/Kernel/ConservativeResolvent.lean b/LeanPool/MarkovProcess/MarkovProcess/Kernel/ConservativeResolvent.lean index 7f38554ea0..ef30a54002 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Kernel/ConservativeResolvent.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Kernel/ConservativeResolvent.lean @@ -30,7 +30,7 @@ equivalence and not merely a sufficient condition. No topology on the state space is used. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Kernel/ConservativityAE.lean b/LeanPool/MarkovProcess/MarkovProcess/Kernel/ConservativityAE.lean index 763b5b320a..4935095c43 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Kernel/ConservativityAE.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Kernel/ConservativityAE.lean @@ -19,7 +19,7 @@ transition mass and positivity of the reference measure on nonempty open sets upgrade it to pointwise conservativity. -/ -@[expose] public section +public section open MeasureTheory open ProbabilityTheory diff --git a/LeanPool/MarkovProcess/MarkovProcess/Kernel/FiniteRestrictionIdentification.lean b/LeanPool/MarkovProcess/MarkovProcess/Kernel/FiniteRestrictionIdentification.lean index 4402f31420..370e3ae0cb 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Kernel/FiniteRestrictionIdentification.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Kernel/FiniteRestrictionIdentification.lean @@ -17,7 +17,7 @@ pushforwards. The proof applies uniqueness of finite projective limits pointwis parameter. No topology, time order, path regularity, or Markov property is used. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Kernel/Integral.lean b/LeanPool/MarkovProcess/MarkovProcess/Kernel/Integral.lean index 1918bb5c70..efd26f3fef 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Kernel/Integral.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Kernel/Integral.lean @@ -18,7 +18,7 @@ kernel. Subinvariance of a measure makes this operator independent, almost everywhere, of the chosen representative of its input. -/ -@[expose] public section +public section open MeasureTheory open ProbabilityTheory @@ -28,6 +28,7 @@ namespace MarkovProcess variable {α : Type*} [MeasurableSpace α] /-- The raw real-valued integral of `f` against the measure `κ x`. -/ +@[expose] noncomputable def kernelIntegral (κ : Kernel α α) (f : α → ℝ) (x : α) : ℝ := ∫ y, f y ∂κ x diff --git a/LeanPool/MarkovProcess/MarkovProcess/Kernel/KernelSemigroup.lean b/LeanPool/MarkovProcess/MarkovProcess/Kernel/KernelSemigroup.lean index ed2418e487..65ee24c0bc 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Kernel/KernelSemigroup.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Kernel/KernelSemigroup.lean @@ -19,7 +19,7 @@ Conservativity is deliberately a separate predicate. A killed transition family has mass at most one, while a conservative family has mass exactly one. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -117,6 +117,7 @@ theorem measure_le_one (t : NNReal) (x : α) (s : Set α) : P t x s ≤ 1 := (P.isSubMarkovKernel t).measure_le_one x s /-- A transition-kernel semigroup is conservative when no mass is lost. -/ +@[expose] def IsConservative : Prop := ∀ t x, P t x univ = 1 diff --git a/LeanPool/MarkovProcess/MarkovProcess/Kernel/KolmogorovMoments.lean b/LeanPool/MarkovProcess/MarkovProcess/Kernel/KolmogorovMoments.lean index dda79b50f1..2ba6cfbc00 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Kernel/KolmogorovMoments.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Kernel/KolmogorovMoments.lean @@ -22,7 +22,7 @@ continuity, or stochastic-process claim; the transport of this bound to the cano dense-time coordinate process is proved elsewhere. -/ -@[expose] public section +public section open MeasureTheory open scoped ENNReal NNReal @@ -40,6 +40,7 @@ Kolmogorov--Chentsov threshold `(q - 1) / p` is a positive Hölder exponent. The bound is demanded for every time `h ≥ 0`, not only for small `h`; this is stronger than the local criterion the Kolmogorov--Chentsov theorem needs, and it is what the bridge to `KolmogorovRegular` consumes. -/ +@[expose] def HasKolmogorovMoments (P : SubMarkovKernelSemigroup alpha) (p q : ℝ) (M : ℝ≥0) : Prop := 0 < p ∧ 1 < q ∧ ∀ (h : ℝ≥0) (y : alpha), ∫⁻ z, edist z y ^ p ∂(P h y) ≤ M * (h : ℝ≥0∞) ^ q diff --git a/LeanPool/MarkovProcess/MarkovProcess/Kernel/Lp.lean b/LeanPool/MarkovProcess/MarkovProcess/Kernel/Lp.lean index fee4cefe4e..c4cf6186e8 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Kernel/Lp.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Kernel/Lp.lean @@ -17,7 +17,7 @@ This file packages the raw kernel integral as continuous linear contractions on finite-exponent and infinite-exponent real `Lᵖ` spaces. -/ -@[expose] public section +public section open MeasureTheory open ProbabilityTheory diff --git a/LeanPool/MarkovProcess/MarkovProcess/Kernel/LpConsistency.lean b/LeanPool/MarkovProcess/MarkovProcess/Kernel/LpConsistency.lean index bb57e22c59..8e758dc6d5 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Kernel/LpConsistency.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Kernel/LpConsistency.lean @@ -17,7 +17,7 @@ whenever their inputs do, even when the inputs and outputs inhabit different `Lp` types. -/ -@[expose] public section +public section open MeasureTheory open ProbabilityTheory diff --git a/LeanPool/MarkovProcess/MarkovProcess/Kernel/LpFinite.lean b/LeanPool/MarkovProcess/MarkovProcess/Kernel/LpFinite.lean index b59f93035f..ec901ee583 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Kernel/LpFinite.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Kernel/LpFinite.lean @@ -18,7 +18,7 @@ This file proves the scalar subprobability estimate behind contraction of a sub-Markov kernel on finite `Lᵖ` spaces, and its fibrewise integrated form. -/ -@[expose] public section +public section open MeasureTheory open ProbabilityTheory diff --git a/LeanPool/MarkovProcess/MarkovProcess/Kernel/LpTop.lean b/LeanPool/MarkovProcess/MarkovProcess/Kernel/LpTop.lean index 8b22b7b72d..2d99dd35d2 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Kernel/LpTop.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Kernel/LpTop.lean @@ -18,7 +18,7 @@ itself is packaged as a continuous linear map by `kernelLpTop` in `Kernel/Lp.lean`. -/ -@[expose] public section +public section open MeasureTheory open ProbabilityTheory diff --git a/LeanPool/MarkovProcess/MarkovProcess/Kernel/MeasurableRadonFamily.lean b/LeanPool/MarkovProcess/MarkovProcess/Kernel/MeasurableRadonFamily.lean index 67ed11c7ee..66b4d5ff68 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Kernel/MeasurableRadonFamily.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Kernel/MeasurableRadonFamily.lean @@ -22,7 +22,7 @@ supremum of measurable test integrals, then applies Mathlib's Giry The compact exhaustion and cutoff choices are private implementation details. -/ -@[expose] public section +public section open scoped CompactlySupported ENNReal NNReal Topology open Set MeasureTheory TopologicalSpace diff --git a/LeanPool/MarkovProcess/MarkovProcess/Kernel/OnePointConservative.lean b/LeanPool/MarkovProcess/MarkovProcess/Kernel/OnePointConservative.lean index 354b7d64d8..941f0b602e 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Kernel/OnePointConservative.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Kernel/OnePointConservative.lean @@ -26,7 +26,7 @@ The regularity data of the compactification are an explicit hypothesis, as every continuous-path process is formed. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Kernel/OnePointExtension.lean b/LeanPool/MarkovProcess/MarkovProcess/Kernel/OnePointExtension.lean index 03366a6cbf..4a8bbce497 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Kernel/OnePointExtension.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Kernel/OnePointExtension.lean @@ -30,7 +30,7 @@ This construction does not assert a Kolmogorov moment bound or construct a conti process. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -126,6 +126,7 @@ variable {X : Type*} [TopologicalSpace X] [T2Space X] [LocallyCompactSpace X] [SecondCountableTopology X] /-- The part of a function on the one-point compactification which vanishes at infinity. -/ +@[expose] noncomputable def onePointRemainder (g : C₀(OnePoint X, ℝ)) : C₀(X, ℝ) where toFun x := g (x : OnePoint X) - g OnePoint.infty continuous_toFun := @@ -230,6 +231,7 @@ variable [MeasurableSpace X] [BorelSpace X] variable (R : PositiveC0ContractiveResolvent X) /-- Extend the generated semigroup action by fixing the value at infinity. -/ +@[expose] noncomputable def onePointSemigroupAction (t : NNReal) (g : C₀(OnePoint X, ℝ)) : C₀(OnePoint X, ℝ) := onePointAssemble @@ -304,6 +306,7 @@ private theorem norm_onePointSemigroupAction_le (t : NNReal) (g : C₀(OnePoint _ = ‖g‖ := by ring /-- The compactified semigroup action, bundled as a linear map. -/ +@[expose] noncomputable def onePointSemigroupLinearMap (t : NNReal) : C₀(OnePoint X, ℝ) →ₗ[ℝ] C₀(OnePoint X, ℝ) where toFun := R.onePointSemigroupAction t @@ -328,6 +331,7 @@ noncomputable def onePointSemigroupLinearMap (t : NNReal) : ring /-- The contraction on the compactified function space induced at time `t`. -/ +@[expose] noncomputable def onePointSemigroupOperator (t : NNReal) : C₀(OnePoint X, ℝ) →L[ℝ] C₀(OnePoint X, ℝ) := (R.onePointSemigroupLinearMap t).mkContinuous 1 fun g ↦ by @@ -395,6 +399,7 @@ private theorem onePointSemigroupAction_eq (t : NNReal) (g : C₀(OnePoint X, ring /-- The generated semigroup on the one-point compactification. -/ +@[expose] noncomputable def onePointSemigroup : Semigroup.StronglyContinuousContractionSemigroup C₀(OnePoint X, ℝ) where operator := R.onePointSemigroupOperator @@ -538,6 +543,7 @@ theorem onePointResolvent_operator (mu : Semigroup.PositiveShift) exact (onePointAssemble_remainder _).symm /-- The Feller kernel semigroup represented by the compactified resolvent. -/ +@[expose] noncomputable def onePointKernelSemigroup : SubMarkovKernelSemigroup (OnePoint X) := R.onePointResolvent.kernelSemigroup diff --git a/LeanPool/MarkovProcess/MarkovProcess/Kernel/OnePointKilled.lean b/LeanPool/MarkovProcess/MarkovProcess/Kernel/OnePointKilled.lean index ff5c9b2ac0..56428bc177 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Kernel/OnePointKilled.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Kernel/OnePointKilled.lean @@ -21,7 +21,7 @@ This file identifies the continuous process of the one-point extension of a posi `C₀`-contractive resolvent with the process killed on leaving its live part. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -245,6 +245,7 @@ private instance instCompactSpaceOnePointExhaustion infer_instance /-- The original space is homeomorphic to the live part of its one-point compactification. -/ +@[expose] noncomputable def onePointLiveHomeomorph : X ≃ₜ Set.range ((↑) : X → OnePoint X) := OnePoint.isOpenEmbedding_coe.isEmbedding.toHomeomorph @@ -607,6 +608,7 @@ theorem killedKernel_onePointLive_eq_map exact and_iff_left ⟨y, rfl⟩ /-- Extend a nonnegative observable on the live space by zero at infinity. -/ +@[expose] def onePointLiveExtension (f : X → ℝ≥0∞) : OnePoint X → ℝ≥0∞ := OnePoint.rec 0 f diff --git a/LeanPool/MarkovProcess/MarkovProcess/Kernel/OnePointKolmogorov.lean b/LeanPool/MarkovProcess/MarkovProcess/Kernel/OnePointKolmogorov.lean index 60b8bafacc..e9c3fa055a 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Kernel/OnePointKolmogorov.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Kernel/OnePointKolmogorov.lean @@ -27,7 +27,7 @@ The tail bounds and their scalar integral budget remain hypotheses for the consu estimate for a particular semigroup is asserted here. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -42,6 +42,7 @@ variable {X : Type*} [MetricSpace X] /-- The explicit distance on the one-point compactification associated with a positive exhaustion function. -/ +@[expose] def exhaustionDist (rho : X → ℝ) : OnePoint X → OnePoint X → ℝ | ∞, ∞ => 0 | ∞, (y : X) => rho y @@ -227,7 +228,7 @@ private theorem isOpen_iff_exhaustionDist {rho : X → ℝ} (hrho_cont : Continu /-- The explicit metric on the one-point compactification determined by a positive Lipschitz exhaustion function with compact positive superlevel sets. -/ -@[implicit_reducible] +@[implicit_reducible, expose] noncomputable def exhaustionMetricSpace (rho : X → ℝ) (hrho_cont : Continuous rho) (hrho_pos : ∀ x, 0 < rho x) (hrho_lipschitz : LipschitzWith 1 rho) (hrho_compact : ∀ epsilon > 0, IsCompact {x | epsilon ≤ rho x}) : @@ -295,6 +296,7 @@ variable {alpha : Type*} [PseudoEMetricSpace alpha] [MeasurableSpace alpha] /-- A Kolmogorov moment estimate required only for time increments at most one, together with a uniform bound for all displacements. On a compact metric space the latter bound is automatic. -/ +@[expose] def HasLocalKolmogorovMoments (P : SubMarkovKernelSemigroup alpha) (p q : ℝ) (M B : ℝ≥0) : Prop := 0 < p ∧ 1 < q ∧ diff --git a/LeanPool/MarkovProcess/MarkovProcess/Kernel/Operator.lean b/LeanPool/MarkovProcess/MarkovProcess/Kernel/Operator.lean index ef7886fa98..182e1b725d 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Kernel/Operator.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Kernel/Operator.lean @@ -17,7 +17,7 @@ canonical contractive operator families on real `Lᵖ`. It deliberately makes no claim here about the operator semigroup laws or strong continuity. -/ -@[expose] public section +public section open MeasureTheory open ProbabilityTheory @@ -33,6 +33,7 @@ variable (P : SubMarkovKernelSemigroup α) /-- The time-space kernel obtained from the jointly measurable transition measures of `P`. -/ +@[expose] def jointKernel : Kernel (NNReal × α) α where toFun p := P p.1 p.2 measurable' := P.measurable_kernel @@ -54,6 +55,7 @@ theorem measurable_kernelIntegral {f : α → ℝ} (hf : Measurable f) : /-- A measure is subinvariant for `P` when it dominates its image under every transition kernel. -/ +@[expose] def IsSubInvariant (μ : Measure α) : Prop := ∀ t, P t ∘ₘ μ ≤ μ @@ -73,12 +75,14 @@ noncomputable def operatorTop (μ : Measure α) (hμ : P.IsSubInvariant μ) : /-- A finite-exponent operator family is associated with `P` when each output is represented by the corresponding raw kernel integral. -/ +@[expose] def IsAssociatedFinite (μ : Measure α) (p : NNReal) [Fact (1 ≤ p)] (T : NNReal → Lp ℝ (p : ℝ≥0∞) μ →L[ℝ] Lp ℝ (p : ℝ≥0∞) μ) : Prop := ∀ t f, T t f =ᵐ[μ] kernelIntegral (P t) f /-- An infinite-exponent operator family is associated with `P` when each output is represented by the corresponding raw kernel integral. -/ +@[expose] def IsAssociatedTop (μ : Measure α) (T : NNReal → Lp ℝ ∞ μ →L[ℝ] Lp ℝ ∞ μ) : Prop := ∀ t f, T t f =ᵐ[μ] kernelIntegral (P t) f diff --git a/LeanPool/MarkovProcess/MarkovProcess/Kernel/OperatorSemigroup.lean b/LeanPool/MarkovProcess/MarkovProcess/Kernel/OperatorSemigroup.lean index a6646f637c..cf973be017 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Kernel/OperatorSemigroup.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Kernel/OperatorSemigroup.lean @@ -15,7 +15,7 @@ This file proves only the algebraic zero- and add-time laws for the canonical real `Lᵖ` operator families. It makes no strong-continuity claim. -/ -@[expose] public section +public section open MeasureTheory open ProbabilityTheory diff --git a/LeanPool/MarkovProcess/MarkovProcess/Kernel/PositiveC0OperatorKernel.lean b/LeanPool/MarkovProcess/MarkovProcess/Kernel/PositiveC0OperatorKernel.lean index de051390df..c5709eed47 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Kernel/PositiveC0OperatorKernel.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Kernel/PositiveC0OperatorKernel.lean @@ -18,7 +18,7 @@ A positive contraction on real continuous functions vanishing at infinity determ sub-Markov kernel. Its values are the pointwise Riesz measures of the evaluation functionals. -/ -@[expose] public section +public section open CompactlySupported Filter MeasureTheory ProbabilityTheory Set open scoped ZeroAtInfty @@ -65,6 +65,7 @@ private lemma exists_compactlySupported_norm_sub_le (f : C₀(α, ℝ)) {ε : exact (houtside (mem_compl hx)).le /-- The kernel whose value at `x` is the Riesz measure representing evaluation of `T` at `x`. -/ +@[expose] noncomputable def kernel (hT_norm : ‖T‖ ≤ 1) : Kernel α α := by letI : ∀ x, IsFiniteMeasure (PositiveC0OperatorMeasure.measure T hT x) := fun x ↦ PositiveC0OperatorMeasure.isFiniteMeasure_measure T hT hT_norm x diff --git a/LeanPool/MarkovProcess/MarkovProcess/Kernel/PositiveC0OperatorMass.lean b/LeanPool/MarkovProcess/MarkovProcess/Kernel/PositiveC0OperatorMass.lean index b2843774c9..f730bd37b1 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Kernel/PositiveC0OperatorMass.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Kernel/PositiveC0OperatorMass.lean @@ -19,7 +19,7 @@ This file proves only a pointwise total-mass bound and finiteness. It does not or prove any regularity in the evaluation point. -/ -@[expose] public section +public section open CompactlySupported MeasureTheory open scoped ZeroAtInfty diff --git a/LeanPool/MarkovProcess/MarkovProcess/Kernel/PositiveC0OperatorMeasure.lean b/LeanPool/MarkovProcess/MarkovProcess/Kernel/PositiveC0OperatorMeasure.lean index 3e96f07c83..368b30fd35 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Kernel/PositiveC0OperatorMeasure.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Kernel/PositiveC0OperatorMeasure.lean @@ -22,7 +22,7 @@ measurably on the evaluation point, have bounded total mass, form a kernel, or s semigroup or stochastic-process law. -/ -@[expose] public section +public section open CompactlySupported MeasureTheory open scoped ZeroAtInfty @@ -32,6 +32,7 @@ namespace MarkovProcess variable {α : Type*} [TopologicalSpace α] /-- Evaluation at a point, as a bounded linear functional on `C₀(α, ℝ)`. -/ +@[expose] noncomputable def c0EvalCLM (x : α) : C₀(α, ℝ) →L[ℝ] ℝ := LinearMap.mkContinuous { toFun := fun f ↦ f x @@ -48,6 +49,7 @@ theorem c0EvalCLM_apply (x : α) (f : C₀(α, ℝ)) : c0EvalCLM x f = f x := namespace PositiveC0OperatorMeasure /-- Pointwise preservation of nonnegative functions by an operator on `C₀(α, ℝ)`. -/ +@[expose] def IsPositive (T : C₀(α, ℝ) →L[ℝ] C₀(α, ℝ)) : Prop := ∀ f : C₀(α, ℝ), (∀ x, 0 ≤ f x) → ∀ x, 0 ≤ T f x @@ -62,6 +64,7 @@ theorem apply_le_apply_of_isPositive exact sub_nonneg.mp h /-- The canonical real-linear inclusion of compactly supported continuous functions into `C₀`. -/ +@[expose] noncomputable def compactlySupportedToC0LinearMap : C_c(α, ℝ) →ₗ[ℝ] C₀(α, ℝ) where toFun f := f map_add' f g := by @@ -80,6 +83,7 @@ variable (T : C₀(α, ℝ) →L[ℝ] C₀(α, ℝ)) (hT : IsPositive T) /-- Evaluation at `x` after applying `T`, restricted from `C₀(α, ℝ)` to compactly supported continuous functions, as a positive linear functional. -/ +@[expose] noncomputable def functional (x : α) : C_c(α, ℝ) →ₚ[ℝ] ℝ := PositiveLinearMap.mk₀ { toFun := fun f ↦ T (compactlySupportedToC0LinearMap f) x @@ -101,6 +105,7 @@ theorem functional_apply (x : α) (f : C_c(α, ℝ)) : variable [T2Space α] [LocallyCompactSpace α] [MeasurableSpace α] [BorelSpace α] /-- The regular Riesz measure representing point evaluation after applying `T`. -/ +@[expose] noncomputable def measure (x : α) : Measure α := RealRMK.rieszMeasure (functional T hT x) diff --git a/LeanPool/MarkovProcess/MarkovProcess/Kernel/PositiveC0Resolvent.lean b/LeanPool/MarkovProcess/MarkovProcess/Kernel/PositiveC0Resolvent.lean index 5dc1317ca6..cc15947177 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Kernel/PositiveC0Resolvent.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Kernel/PositiveC0Resolvent.lean @@ -20,7 +20,7 @@ The package in this file starts from the resolvent identity, the Hille--Yosida b and positivity of the actual shifted resolvents. It assumes neither a semigroup nor a kernel. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -98,6 +98,7 @@ variable [T2Space X] [LocallyCompactSpace X] [SecondCountableTopology X] [MeasurableSpace X] [BorelSpace X] /-- The sub-Markov kernel semigroup represented by the canonical positive `C₀` semigroup. -/ +@[expose] noncomputable def kernelSemigroup : SubMarkovKernelSemigroup X := PositiveC0SemigroupKernel.kernelSemigroup R.toContractiveResolvent.generatedSemigroup R.isPositive_generatedSemigroup diff --git a/LeanPool/MarkovProcess/MarkovProcess/Kernel/PositiveC0SemigroupFeller.lean b/LeanPool/MarkovProcess/MarkovProcess/Kernel/PositiveC0SemigroupFeller.lean index 46b4112e0c..fd066486e5 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Kernel/PositiveC0SemigroupFeller.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Kernel/PositiveC0SemigroupFeller.lean @@ -17,7 +17,7 @@ recovers the original operators on `C₀` and therefore satisfies the existing F This file makes no conservativity, stochastic-process, or Hunt-process claim. -/ -@[expose] public section +public section open Filter MeasureTheory ProbabilityTheory Topology open scoped ZeroAtInfty diff --git a/LeanPool/MarkovProcess/MarkovProcess/Kernel/PositiveC0SemigroupKernel.lean b/LeanPool/MarkovProcess/MarkovProcess/Kernel/PositiveC0SemigroupKernel.lean index 0bc436ccf0..8404c05ab2 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Kernel/PositiveC0SemigroupKernel.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Kernel/PositiveC0SemigroupKernel.lean @@ -19,7 +19,7 @@ A strongly continuous semigroup of positive contractions on real continuous func at infinity determines a jointly measurable sub-Markov kernel semigroup. -/ -@[expose] public section +public section open CompactlySupported MeasureTheory ProbabilityTheory open scoped ENNReal ZeroAtInfty @@ -105,6 +105,7 @@ theorem kernel_add (s t : NNReal) : _ = ∫ z, f₀ z ∂(Kt.comp Ks) x := (Kernel.integral_comp hf_comp).symm /-- The sub-Markov kernel semigroup represented by a positive contraction semigroup on `C₀`. -/ +@[expose] noncomputable def kernelSemigroup : SubMarkovKernelSemigroup α where kernel t := PositiveC0OperatorKernel.kernel (S t) (hS t) (S.norm_operator_le_one t) measurable_kernel := measurable_kernel S hS diff --git a/LeanPool/MarkovProcess/MarkovProcess/Kernel/Resolvent.lean b/LeanPool/MarkovProcess/MarkovProcess/Kernel/Resolvent.lean index bab022e571..1dfc0fc915 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Kernel/Resolvent.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Kernel/Resolvent.lean @@ -22,7 +22,7 @@ Main definitions: `SubMarkovKernelSemigroup.kernelResolvent` and No conservativity, topology, or finiteness of the resolvent is asserted. -/ -@[expose] public section +public section open Filter MeasureTheory ProbabilityTheory Set open scoped ENNReal NNReal @@ -32,6 +32,7 @@ namespace MarkovProcess.SubMarkovKernelSemigroup variable {alpha : Type*} [MeasurableSpace alpha] /-- The kernel resolvent on nonnegative extended-real observables. -/ +@[expose] noncomputable def kernelResolvent (P : SubMarkovKernelSemigroup alpha) (lam : ℝ) (f : alpha → ℝ≥0∞) (x : alpha) : ℝ≥0∞ := ∫⁻ t in Ioi (0 : ℝ), ENNReal.ofReal (Real.exp (-lam * t)) * @@ -39,6 +40,7 @@ noncomputable def kernelResolvent (P : SubMarkovKernelSemigroup alpha) (lam : /-- The kernel resolvent on real-valued observables. Finiteness is established separately for bounded observables at positive shifts. -/ +@[expose] noncomputable def kernelResolventReal (P : SubMarkovKernelSemigroup alpha) (lam : ℝ) (f : alpha → ℝ) (x : alpha) : ℝ := ∫ t in Ioi (0 : ℝ), Real.exp (-lam * t) * diff --git a/LeanPool/MarkovProcess/MarkovProcess/Kernel/ResolventUniqueness.lean b/LeanPool/MarkovProcess/MarkovProcess/Kernel/ResolventUniqueness.lean index 66447f7936..08787baf7c 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Kernel/ResolventUniqueness.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Kernel/ResolventUniqueness.lean @@ -22,7 +22,7 @@ Main results: `perturbed_unique`, `resolventFamily_eq_of_eventually`, and The operators are plain maps on functions; no Banach-space carrier or continuity is asserted. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Kernel/WeakConvergence.lean b/LeanPool/MarkovProcess/MarkovProcess/Kernel/WeakConvergence.lean index 7f5028a0a2..1b0207a8bc 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Kernel/WeakConvergence.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Kernel/WeakConvergence.lean @@ -29,7 +29,7 @@ Nothing is asserted for families that are not probability measures: for sub-prob the conclusion is false, since mass may escape to infinity. -/ -@[expose] public section +public section open Filter MeasureTheory Topology open scoped BoundedContinuousFunction CompactlySupported diff --git a/LeanPool/MarkovProcess/MarkovProcess/Killed/ExitTimeIdentification.lean b/LeanPool/MarkovProcess/MarkovProcess/Killed/ExitTimeIdentification.lean index d908d83feb..27360d90fa 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Killed/ExitTimeIdentification.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Killed/ExitTimeIdentification.lean @@ -35,7 +35,7 @@ The consumer-supplied resolvent and its limit are `ℝ≥0∞`-valued, so no int hypothesis appears; a consumer working with real-valued solutions bridges with `ENNReal.ofReal`. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Killed/GluingC0.lean b/LeanPool/MarkovProcess/MarkovProcess/Killed/GluingC0.lean index 47a2d40c88..2c79c3cd0c 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Killed/GluingC0.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Killed/GluingC0.lean @@ -34,7 +34,7 @@ the compactified process started at any point almost surely never reaches the ad space is produced from that statement. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -66,6 +66,7 @@ variable (T : Semigroup.PositiveShift → C₀(alpha, ℝ) → C₀(alpha, ℝ)) /-- **The `C₀` operator of the supremum resolvent** at a positive shift: the value supplied by the analytic hypothesis `hT`, packaged as a continuous linear map by additivity, real homogeneity, and the uniform bound `1 / lam`. -/ +@[expose] def minimalC0Operator (hemb : ∀ m, MeasurableEmbedding (emb m)) (hmono : ∀ nu > 0, ∀ {h : alpha → ℝ≥0∞}, Measurable h → ∀ y, Monotone fun m ↦ localResolvent R emb m nu h y) diff --git a/LeanPool/MarkovProcess/MarkovProcess/Killed/GluingLinearity.lean b/LeanPool/MarkovProcess/MarkovProcess/Killed/GluingLinearity.lean index 556bd457c2..3950341631 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Killed/GluingLinearity.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Killed/GluingLinearity.lean @@ -29,7 +29,7 @@ suprema once the family is monotone in the index (`minimalResolvent_comm`). Nothing here uses the part-process identity; monotonicity in the index is a bare hypothesis. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Killed/GluingLocal.lean b/LeanPool/MarkovProcess/MarkovProcess/Killed/GluingLocal.lean index 741393140f..aecf0aec09 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Killed/GluingLocal.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Killed/GluingLocal.lean @@ -30,7 +30,7 @@ The regularity data are an explicit hypothesis: positivity, contractivity and th identity do not by themselves give the compactified semigroup a continuous-path process. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -75,7 +75,7 @@ namespace OnePointRegular variable {R : PositiveC0ContractiveResolvent X} /-- The metric on the compactification determined by the exhaustion function. -/ -@[implicit_reducible] +@[expose, implicit_reducible] noncomputable def metricSpace (h : R.OnePointRegular) : MetricSpace (OnePoint X) := OnePoint.exhaustionMetricSpace h.rho h.continuous_rho h.rho_pos h.lipschitz_rho h.isCompact_superlevel @@ -148,6 +148,7 @@ section Embedding variable {X₀ X₁ : Type*} /-- The embedding of a smaller live space into the compactification of a larger one. -/ +@[expose] def compactifiedEmbedding (iota : X₀ → X₁) (y : X₀) : OnePoint X₁ := ((iota y : X₁) : OnePoint X₁) /-- The embedding of a smaller live space into the compactification, unfolded. -/ diff --git a/LeanPool/MarkovProcess/MarkovProcess/Killed/GluingMeasure.lean b/LeanPool/MarkovProcess/MarkovProcess/Killed/GluingMeasure.lean index 2b2de869bb..ba4fe02cb4 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Killed/GluingMeasure.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Killed/GluingMeasure.lean @@ -23,7 +23,7 @@ to all nonnegative measurable observables through the two potential measures. Monotonicity of the transported resolvents in the index is a bare hypothesis throughout. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Killed/GluingMinimal.lean b/LeanPool/MarkovProcess/MarkovProcess/Killed/GluingMinimal.lean index 5d1bf12af8..9c6826f41d 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Killed/GluingMinimal.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Killed/GluingMinimal.lean @@ -41,7 +41,7 @@ No transition semigroup, no process on the ambient space, and no conservativity here. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -164,6 +164,7 @@ end Compatible /-- **The minimal resolvent** of a family of local resolvents: the pointwise supremum of the transported local kernel resolvents. Monotonicity in `m`, under which the supremum is an increasing limit, is the content of `localResolvent_le_succ`. -/ +@[expose] noncomputable def minimalResolvent (lam : ℝ) (f : alpha → ℝ≥0∞) (x : alpha) : ℝ≥0∞ := ⨆ m, localResolvent R emb m lam f x diff --git a/LeanPool/MarkovProcess/MarkovProcess/Killed/GluingPotential.lean b/LeanPool/MarkovProcess/MarkovProcess/Killed/GluingPotential.lean index ccefb9c40e..68d16b8daf 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Killed/GluingPotential.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Killed/GluingPotential.lean @@ -36,7 +36,7 @@ homogeneous on measurable observables (`SubMarkovKernelSemigroup.kernelResolvent No resolvent identity and no topology on the state space are used here. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Killed/GluingRealResolvent.lean b/LeanPool/MarkovProcess/MarkovProcess/Killed/GluingRealResolvent.lean index 23735008fe..9d312db134 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Killed/GluingRealResolvent.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Killed/GluingRealResolvent.lean @@ -28,7 +28,7 @@ Additivity, and with it the resolvent equation, is available exactly when the tr resolvents are monotone in the index; that monotonicity is a bare hypothesis here. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Killed/GluingResolventEquation.lean b/LeanPool/MarkovProcess/MarkovProcess/Killed/GluingResolventEquation.lean index 499e29ddf5..7856da34e8 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Killed/GluingResolventEquation.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Killed/GluingResolventEquation.lean @@ -36,7 +36,7 @@ Main results: `expWeight_convolution`, `SubMarkovKernelSemigroup.kernelResolvent_resolventEquation`. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Killed/GluingTransfer.lean b/LeanPool/MarkovProcess/MarkovProcess/Killed/GluingTransfer.lean index 0a6540554b..5e306a8a6e 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Killed/GluingTransfer.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Killed/GluingTransfer.lean @@ -30,7 +30,7 @@ No topology on the target space is used, and no relation between the two measure tested identity is assumed. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -46,6 +46,7 @@ section Topological variable {X : Type*} [TopologicalSpace X] /-- A continuous observable with compact support, read as an observable vanishing at infinity. -/ +@[expose] noncomputable def compactlySupportedToZeroAtInfty (f : C_c(X, ℝ)) : C₀(X, ℝ) where toContinuousMap := f.toContinuousMap zero_at_infty' := HasCompactSupport.is_zero_at_infty f.hasCompactSupport' diff --git a/LeanPool/MarkovProcess/MarkovProcess/Killed/Kernel.lean b/LeanPool/MarkovProcess/MarkovProcess/Killed/Kernel.lean index 5187520d2d..46f1013e33 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Killed/Kernel.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Killed/Kernel.lean @@ -34,7 +34,7 @@ the identity only on `U` (it is `0` off `U`); the semigroup structure on the car separate packaging. No Feller property of the killed family is claimed. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory open scoped ENNReal NNReal @@ -46,6 +46,7 @@ namespace ContinuousPath variable {alpha : Type*} [PseudoMetricSpace alpha] /-- The event that a path is still inside `U` at time `t` and sits in `B` at time `t`. -/ +@[expose] def killedEvent (U : Set alpha) (t : NNReal) (B : Set alpha) : Set (ContinuousPath alpha) := {omega | (t : ℝ≥0∞) < exitTime U omega ∧ omega t ∈ B} diff --git a/LeanPool/MarkovProcess/MarkovProcess/Killed/KillAtExit.lean b/LeanPool/MarkovProcess/MarkovProcess/Killed/KillAtExit.lean index d939ed6f99..cade9153b3 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Killed/KillAtExit.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Killed/KillAtExit.lean @@ -28,7 +28,7 @@ lifetime-path measurable structure generated by the lifetime and the coordinates This file constructs no probability law. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -58,6 +58,7 @@ variable {alpha : Type*} [PseudoMetricSpace alpha] /-- The continuous path `omega` killed when it leaves `U`: the lifetime path whose lifetime is the exit time of `U` and whose live path is `omega`, read as a path in the carrier `U`. -/ +@[expose] def killAtExit (U : Set alpha) (omega : ContinuousPath alpha) : LifetimePath U where lifetime := exitTime U omega livePath := fun t ↦ ⟨omega (t : NNReal), mem_of_lt_exitTime U omega (t : NNReal) t.property⟩ diff --git a/LeanPool/MarkovProcess/MarkovProcess/Killed/Marginals.lean b/LeanPool/MarkovProcess/MarkovProcess/Killed/Marginals.lean index d7b42bb97a..3ffefe1b56 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Killed/Marginals.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Killed/Marginals.lean @@ -38,7 +38,7 @@ No Feller property, strong continuity, or regularity of the killed semigroup is statement here covers a random time. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory open scoped ENNReal NNReal diff --git a/LeanPool/MarkovProcess/MarkovProcess/Killed/Minimal.lean b/LeanPool/MarkovProcess/MarkovProcess/Killed/Minimal.lean index 52c831f69d..4fe27beeba 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Killed/Minimal.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Killed/Minimal.lean @@ -28,7 +28,7 @@ The killed kernels are monotone in the open set (`killedKernel_mono`); no other used. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter open scoped ENNReal NNReal diff --git a/LeanPool/MarkovProcess/MarkovProcess/Killed/Nested.lean b/LeanPool/MarkovProcess/MarkovProcess/Killed/Nested.lean index 95acc44158..1e34e0285b 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Killed/Nested.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Killed/Nested.lean @@ -38,7 +38,7 @@ the statements here compare them through the inclusion of `U` in `V` rather than two killed processes as laws on a common carrier. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory open scoped ENNReal NNReal diff --git a/LeanPool/MarkovProcess/MarkovProcess/Killed/Process.lean b/LeanPool/MarkovProcess/MarkovProcess/Killed/Process.lean index 9e1639d57e..3a493c951e 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Killed/Process.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Killed/Process.lean @@ -29,7 +29,7 @@ No finite-dimensional distribution of the killed process is identified here, and regularity property of the killed family is claimed. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory open scoped ENNReal NNReal diff --git a/LeanPool/MarkovProcess/MarkovProcess/Killed/Resolvent.lean b/LeanPool/MarkovProcess/MarkovProcess/Killed/Resolvent.lean index e38baf10c8..a5f2c9e203 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Killed/Resolvent.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Killed/Resolvent.lean @@ -32,7 +32,7 @@ antitone in the shift (`IsConservative.killedResolvent_antitone`), because a lar discounts the future more. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter open scoped ENNReal NNReal @@ -47,6 +47,7 @@ variable (U : Set alpha) (hU : IsOpen U) /-- The killed resolvent at the shift `lam`, applied to a nonnegative extended function: the Laplace transform in time of the killed kernels. -/ +@[expose] noncomputable def IsConservative.killedResolvent (lam : ℝ) (f : alpha → ℝ≥0∞) (x : alpha) : ℝ≥0∞ := ∫⁻ t in Set.Ioi (0 : ℝ), ENNReal.ofReal (Real.exp (-lam * t)) * diff --git a/LeanPool/MarkovProcess/MarkovProcess/Killed/Semigroup.lean b/LeanPool/MarkovProcess/MarkovProcess/Killed/Semigroup.lean index 0803cf350b..62d8b896c4 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Killed/Semigroup.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Killed/Semigroup.lean @@ -28,7 +28,7 @@ No Feller property, strong continuity, or regularity of the killed semigroup is process is not identified with the cemetery-extended process on lifetime paths. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory open scoped ENNReal NNReal @@ -158,6 +158,7 @@ theorem IsConservative.killedKernelOn_add (hFeller : P.IsFellerKernelSemigroup) /-- **The killed semigroup on the domain `U`**: the process of `P` killed when it leaves `U`, as a sub-Markov kernel semigroup on the carrier `U`. -/ +@[expose] noncomputable def IsConservative.killedSemigroup (hFeller : P.IsFellerKernelSemigroup) (hK : P.KolmogorovRegular hP) : SubMarkovKernelSemigroup U where kernel := IsConservative.killedKernelOn P hP U hU diff --git a/LeanPool/MarkovProcess/MarkovProcess/Lifetime/Basic.lean b/LeanPool/MarkovProcess/MarkovProcess/Lifetime/Basic.lean index 7c827847ac..5c9de3c609 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Lifetime/Basic.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Lifetime/Basic.lean @@ -20,7 +20,7 @@ The canonical measurable structure is generated by the lifetime and all fixed-ti No countable-generation or standard-Borel claim for the lifetime-path carrier is made here. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -143,6 +143,7 @@ theorem measurable_coordinate [MeasurableSpace α] (t : NNReal) : MeasurableSpace.comap (coordinate s) inferInstance) t) /-- An ordinary continuous path regarded as a lifetime path with infinite lifetime. -/ +@[expose] def ofContinuousPath (ω : C(NNReal, α)) : LifetimePath α where lifetime := ∞ livePath := fun t ↦ ω t diff --git a/LeanPool/MarkovProcess/MarkovProcess/Lifetime/CountablySeparated.lean b/LeanPool/MarkovProcess/MarkovProcess/Lifetime/CountablySeparated.lean index 0b96ea279c..aa5e4cc79b 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Lifetime/CountablySeparated.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Lifetime/CountablySeparated.lean @@ -16,7 +16,7 @@ Lifetime and the coordinates at the fixed countable dense time set separate cont paths. Their measurable coding therefore gives a countable separating family. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Lifetime/ExitTime.lean b/LeanPool/MarkovProcess/MarkovProcess/Lifetime/ExitTime.lean index 6122d52c83..a065832f81 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Lifetime/ExitTime.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Lifetime/ExitTime.lean @@ -19,7 +19,7 @@ Only deterministic order properties are proved here. No measurability or stoppin made. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -35,6 +35,7 @@ namespace LifetimePath variable {alpha : Type*} [TopologicalSpace alpha] /-- The first time at which a lifetime path is not a live point of `U`. -/ +@[expose] def exitTime (U : Set alpha) (omega : LifetimePath alpha) : ENNReal := sInf {s : ENNReal | ∃ t : NNReal, s = (t : ENNReal) ∧ coordinate t omega ∉ Cemetery.alive '' U} @@ -77,6 +78,7 @@ namespace ContinuousPath variable {alpha : Type*} [TopologicalSpace alpha] /-- The first time at which an ordinary continuous path leaves `U`. -/ +@[expose] def exitTime (U : Set alpha) (omega : ContinuousPath alpha) : ENNReal := sInf {s : ENNReal | ∃ t : NNReal, s = (t : ENNReal) ∧ omega t ∉ U} diff --git a/LeanPool/MarkovProcess/MarkovProcess/Lifetime/ExitTimeStopping.lean b/LeanPool/MarkovProcess/MarkovProcess/Lifetime/ExitTimeStopping.lean index c16313839b..6633a5b91d 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Lifetime/ExitTimeStopping.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Lifetime/ExitTimeStopping.lean @@ -12,7 +12,7 @@ public import LeanPool.MarkovProcess.MarkovProcess.Lifetime.Filtration /-! # Exit times as stopping times -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Lifetime/Filtration.lean b/LeanPool/MarkovProcess/MarkovProcess/Lifetime/Filtration.lean index ba30b8b7c0..03258bedc9 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Lifetime/Filtration.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Lifetime/Filtration.lean @@ -17,7 +17,7 @@ The lifetime is a stopping time because death by time `t` is exactly the event t coordinate is the cemetery state. -/ -@[expose] public section +public section open MeasureTheory open scoped ENNReal @@ -37,6 +37,7 @@ theorem coordinate_eq_delta_iff (omega : LifetimePath alpha) (t : NNReal) : · exact coordinate_of_le omega t /-- The raw canonical filtration generated by lifetime-path coordinates up to time `t`. -/ +@[expose] noncomputable def canonicalFiltration : Filtration NNReal (instMeasurableSpace (α := alpha)) where seq t := ⨆ s : Set.Iic t, diff --git a/LeanPool/MarkovProcess/MarkovProcess/Lifetime/Killing.lean b/LeanPool/MarkovProcess/MarkovProcess/Lifetime/Killing.lean index 9b4e939c9c..ba8c95a17a 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Lifetime/Killing.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Lifetime/Killing.lean @@ -16,7 +16,7 @@ killing time itself is the cemetery state, so this operation is distinct from en stopping. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -30,6 +30,7 @@ section variable {α : Type*} [TopologicalSpace α] /-- Kill a lifetime path at the deterministic time `T`. -/ +@[expose] def killAt (T : NNReal) (ω : LifetimePath α) : LifetimePath α where lifetime := min ω.lifetime (T : ENNReal) livePath := fun t ↦ ω.livePath ⟨t, lt_of_lt_of_le t.property (min_le_left _ _)⟩ diff --git a/LeanPool/MarkovProcess/MarkovProcess/Lifetime/Law.lean b/LeanPool/MarkovProcess/MarkovProcess/Lifetime/Law.lean index 7d2f83c4b6..03a14b5001 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Lifetime/Law.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Lifetime/Law.lean @@ -17,7 +17,7 @@ embedding. It records the resulting nonexplosion and coordinate identities witho that any particular dense-time or PDE law has continuous paths. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -35,6 +35,7 @@ variable {beta alpha : Type*} [MeasurableSpace beta] [TopologicalSpace alpha] /-- A kernel on lifetime paths is nonexplosive when its lifetime is almost surely infinite from every starting point. -/ +@[expose] def IsNonexplosive (kappa : Kernel beta (LifetimePath alpha)) : Prop := ∀ x, ∀ᵐ omega ∂kappa x, omega.lifetime = ∞ diff --git a/LeanPool/MarkovProcess/MarkovProcess/Lifetime/Nonexplosion.lean b/LeanPool/MarkovProcess/MarkovProcess/Lifetime/Nonexplosion.lean index 27dea1408c..74e2d96105 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Lifetime/Nonexplosion.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Lifetime/Nonexplosion.lean @@ -17,7 +17,7 @@ almost-sure coordinate statements. This is the measure-theoretic reduction later conservativity of transition laws into nonexplosion. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Lifetime/NonexplosiveTransport.lean b/LeanPool/MarkovProcess/MarkovProcess/Lifetime/NonexplosiveTransport.lean index 7eba5f904a..8087e94e15 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Lifetime/NonexplosiveTransport.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Lifetime/NonexplosiveTransport.lean @@ -16,7 +16,7 @@ lifetime paths whose lifetime is almost surely infinite therefore gives a canoni ordinary continuous paths, independent of the off-support default. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Lifetime/Shift.lean b/LeanPool/MarkovProcess/MarkovProcess/Lifetime/Shift.lean index 43f1956722..4135c45091 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Lifetime/Shift.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Lifetime/Shift.lean @@ -15,7 +15,7 @@ This file shifts a lifetime path forward by a fixed finite time. A shift beyond lifetime produces a path with zero lifetime, hence with cemetery state at every coordinate. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -29,6 +29,7 @@ section variable {α : Type*} [TopologicalSpace α] /-- Shift a lifetime path forward by the deterministic time `S`. -/ +@[expose] def shift (S : NNReal) (ω : LifetimePath α) : LifetimePath α where lifetime := ω.lifetime - (S : ENNReal) livePath := fun t ↦ ω.livePath ⟨S + t, by diff --git a/LeanPool/MarkovProcess/MarkovProcess/Main.lean b/LeanPool/MarkovProcess/MarkovProcess/Main.lean index bcfb8e8627..12c1f82b1f 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Main.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Main.lean @@ -37,7 +37,7 @@ Nothing here asserts a Hunt-process property, and no statement covers a stopping infinite. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -134,6 +134,7 @@ with an admissible Hölder exponent. This is the hypothesis under which the dense-time trajectory of `P` admits a continuous modification, and every statement about `continuousProcess P hP` carries it. -/ +@[expose] def KolmogorovRegular : Prop := ∀ x, ∃ p q gamma : ℝ, ∃ M : ℝ≥0, IsKolmogorovProcess (fun r omega ↦ omega r) @@ -145,6 +146,7 @@ def KolmogorovRegular : Prop := continuous trajectory kernel, with the fallback path of the underlying measurable extension fixed once and for all. Under `P.KolmogorovRegular hP` the choice of fallback is immaterial, by `continuousProcess_eq_continuousPathTrajectory`. -/ +@[expose] def IsConservative.continuousProcess : Kernel alpha (ContinuousPath alpha) := continuousPathTrajectory P hP (ContinuousMap.const NNReal (Classical.arbitrary alpha)) diff --git a/LeanPool/MarkovProcess/MarkovProcess/Parameterized/Annealed.lean b/LeanPool/MarkovProcess/MarkovProcess/Parameterized/Annealed.lean index cc45ef9323..f120b0f374 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Parameterized/Annealed.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Parameterized/Annealed.lean @@ -29,7 +29,7 @@ The annealed process is in general not Markov in the probabilistic sense (the av not have the Markov property); nothing of that kind is claimed. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter open scoped ENNReal NNReal diff --git a/LeanPool/MarkovProcess/MarkovProcess/Parameterized/CemeteryDenseTimeMarginals.lean b/LeanPool/MarkovProcess/MarkovProcess/Parameterized/CemeteryDenseTimeMarginals.lean index ce05d90f8b..aa0849eb5b 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Parameterized/CemeteryDenseTimeMarginals.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Parameterized/CemeteryDenseTimeMarginals.lean @@ -16,7 +16,7 @@ This file proves a one-time marginal identity. It makes no simultaneous path-su lifetime claim. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Parameterized/CemeteryDenseTimeSupport.lean b/LeanPool/MarkovProcess/MarkovProcess/Parameterized/CemeteryDenseTimeSupport.lean index d478b622f3..b57c773c12 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Parameterized/CemeteryDenseTimeSupport.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Parameterized/CemeteryDenseTimeSupport.lean @@ -18,7 +18,7 @@ This is only a statement about the countable trajectory. It makes no continuous- lifetime-path, or spatial support claim. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Parameterized/CemeterySemigroup.lean b/LeanPool/MarkovProcess/MarkovProcess/Parameterized/CemeterySemigroup.lean index 7b71bc307b..50b7ddd898 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Parameterized/CemeterySemigroup.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Parameterized/CemeterySemigroup.lean @@ -16,7 +16,7 @@ This file extends a jointly measurable family of sub-Markov semigroups by one ab cemetery state. The construction is jointly measurable in the parameter, time, and state. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -32,6 +32,7 @@ variable {Theta alpha : Type*} [MeasurableSpace Theta] [MeasurableSpace alpha] /-- The jointly measurable conservative cemetery extension of a parameterized sub-Markov kernel semigroup. -/ +@[expose] def cemeterySemigroup (P : ParameterizedSubMarkovKernelSemigroup Theta alpha) : ParameterizedSubMarkovKernelSemigroup Theta (Cemetery alpha) where kernel theta t := Kernel.cemeteryExtension (P theta t) diff --git a/LeanPool/MarkovProcess/MarkovProcess/Parameterized/ContinuousProcess.lean b/LeanPool/MarkovProcess/MarkovProcess/Parameterized/ContinuousProcess.lean index 51517ce880..97e2451496 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Parameterized/ContinuousProcess.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Parameterized/ContinuousProcess.lean @@ -33,7 +33,7 @@ No Markov, strong Markov, Feller, equivariance, annealed or killed statement is of those is a separate transport through the fibre identity. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -52,6 +52,7 @@ variable {Theta alpha : Type*} [MeasurableSpace Theta] [MeasurableSpace alpha] /-- Fibrewise conservativity of a measurably parameterized sub-Markov kernel semigroup: every parameter slice is a conservative sub-Markov kernel semigroup, so that no mass is lost at any time from any state for any parameter. -/ +@[expose] def IsConservative (P : ParameterizedSubMarkovKernelSemigroup Theta alpha) : Prop := ∀ theta, (P.toSubMarkovKernelSemigroup theta).IsConservative @@ -65,6 +66,7 @@ variable {Theta alpha : Type*} [MeasurableSpace Theta] [PseudoEMetricSpace alpha /-- Fibrewise Kolmogorov moment bounds with parameter-independent constants: every parameter slice satisfies the intrinsic displacement estimate `∫ edist z y ^ p ∂(P theta h y) ≤ M * h ^ q`, with the same exponents `p`, `q` and the same constant `M` for every parameter. -/ +@[expose] def HasKolmogorovMoments (P : ParameterizedSubMarkovKernelSemigroup Theta alpha) (p q : ℝ) (M : ℝ≥0) : Prop := ∀ theta, (P.toSubMarkovKernelSemigroup theta).HasKolmogorovMoments p q M @@ -141,6 +143,7 @@ variable (P : ParameterizedSubMarkovKernelSemigroup Theta alpha) (hP : P.IsConse that parameter's semigroup satisfies a Kolmogorov--Chentsov moment bound with an admissible Hölder exponent at every starting point. The exponents and constants may depend on the parameter and on the starting point. -/ +@[expose] def KolmogorovRegular : Prop := ∀ theta, (P.toSubMarkovKernelSemigroup theta).KolmogorovRegular (hP theta) @@ -157,6 +160,7 @@ used by the unparameterized `continuousProcess`. Joint measurability in the parameter and the starting state is carried by the kernel structure. Under `P.KolmogorovRegular hP` the choice of fallback is immaterial, by `continuousProcess_eq`. -/ +@[expose] def IsConservative.continuousProcess : Kernel (Theta × alpha) (ContinuousPath alpha) := Kernel.toContinuousPathKernel (P.parameterizedDenseTimeTrajectory hP DenseTime.enumeration diff --git a/LeanPool/MarkovProcess/MarkovProcess/Parameterized/ContinuousProcessProperties.lean b/LeanPool/MarkovProcess/MarkovProcess/Parameterized/ContinuousProcessProperties.lean index 179b6702b8..6495a6eff3 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Parameterized/ContinuousProcessProperties.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Parameterized/ContinuousProcessProperties.lean @@ -31,7 +31,7 @@ form `continuousProcess_map_eval_zero'`), `continuousProcess_map_finiteEvaluatio `continuousProcess_condExp_shift_countableStoppingTime`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory open scoped NNReal diff --git a/LeanPool/MarkovProcess/MarkovProcess/Parameterized/DenseTimeConditionalKernel.lean b/LeanPool/MarkovProcess/MarkovProcess/Parameterized/DenseTimeConditionalKernel.lean index 468117dd1b..28df0a87cf 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Parameterized/DenseTimeConditionalKernel.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Parameterized/DenseTimeConditionalKernel.lean @@ -18,7 +18,7 @@ observation. The resulting conditional kernel is one jointly measurable version. with separately chosen fixed-parameter conditional versions is asserted. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -32,6 +32,7 @@ section variable {Theta D alpha : Type*} [MeasurableSpace Theta] [MeasurableSpace alpha] /-- The jointly parameterized law of an `n`-prefix and its next enumerated observation. -/ +@[expose] def parameterizedNextObservationJoint (P : ParameterizedSubMarkovKernelSemigroup Theta alpha) (e : ℕ ≃ D) (iota : D ↪ NNReal) (n : ℕ) : diff --git a/LeanPool/MarkovProcess/MarkovProcess/Parameterized/DenseTimePrefixKernel.lean b/LeanPool/MarkovProcess/MarkovProcess/Parameterized/DenseTimePrefixKernel.lean index e85884d48c..8bbced4ae7 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Parameterized/DenseTimePrefixKernel.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Parameterized/DenseTimePrefixKernel.lean @@ -17,7 +17,7 @@ enumeration. Coordinates remain in enumeration order; the enumeration need not b physical time. Fiberwise conservativity is used only for Markovness and prefix consistency. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Parameterized/DenseTimeTrajectory.lean b/LeanPool/MarkovProcess/MarkovProcess/Parameterized/DenseTimeTrajectory.lean index 95c5f295b4..d0ab52c3d1 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Parameterized/DenseTimeTrajectory.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Parameterized/DenseTimeTrajectory.lean @@ -12,7 +12,7 @@ public import Mathlib.Probability.Kernel.IonescuTulcea.Traj /-! # Parameterized trajectories on countable dense time -/ -@[expose] public section +public section noncomputable section PortComputability @@ -29,6 +29,7 @@ variable {Theta : Type uTheta} {D : Type*} {alpha : Type uAlpha} [MeasurableSpace Theta] [MeasurableSpace alpha] [StandardBorelSpace alpha] [Nonempty alpha] /-- The initial parameter and state at zero, followed by lifted state observations. -/ +@[expose] def trajectoryCoordinate : ℕ → Type (max uTheta uAlpha) | 0 => ULift.{max uTheta uAlpha} (Theta × alpha) | _ + 1 => ULift.{max uTheta uAlpha} alpha diff --git a/LeanPool/MarkovProcess/MarkovProcess/Parameterized/DenseTimeTrajectoryMarginals.lean b/LeanPool/MarkovProcess/MarkovProcess/Parameterized/DenseTimeTrajectoryMarginals.lean index 9938237d00..4ddce4cfb9 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Parameterized/DenseTimeTrajectoryMarginals.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Parameterized/DenseTimeTrajectoryMarginals.lean @@ -16,7 +16,7 @@ This file identifies every coordinate marginal of the jointly measurable paramet trajectory kernel. No standard-Borel assumption is imposed on the parameter space. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Parameterized/Equivariance.lean b/LeanPool/MarkovProcess/MarkovProcess/Parameterized/Equivariance.lean index 8ff12374c2..9ef97af9de 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Parameterized/Equivariance.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Parameterized/Equivariance.lean @@ -35,7 +35,7 @@ No scaling limit and no ergodic statement is asserted: the environment map `g`, and both families are given in advance, and nothing is claimed about the law of the environment. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Parameterized/FiniteTimeKernel.lean b/LeanPool/MarkovProcess/MarkovProcess/Parameterized/FiniteTimeKernel.lean index 56362916aa..bd4eeb2613 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Parameterized/FiniteTimeKernel.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Parameterized/FiniteTimeKernel.lean @@ -22,7 +22,7 @@ nonparameterized finite-time kernel of the fixed-parameter semigroup. No path-sp stochastic-process existence claim is made here. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory open scoped ProbabilityTheory @@ -48,6 +48,7 @@ private theorem measurable_finCons_snd {n : ℕ} : (Theta × alpha) × (Fin n → alpha) → Fin n → alpha)) /-- The jointly measurable finite-time kernel for a parameterized semigroup. -/ +@[expose] noncomputable def parameterizedFiniteTimeKernel (P : ParameterizedSubMarkovKernelSemigroup Theta alpha) : {n : ℕ} → FiniteOrderedTimes n → Kernel (Theta × alpha) (Fin n → alpha) diff --git a/LeanPool/MarkovProcess/MarkovProcess/Parameterized/FiniteTimeProjectiveFamily.lean b/LeanPool/MarkovProcess/MarkovProcess/Parameterized/FiniteTimeProjectiveFamily.lean index cd242b2b19..8f5440fb2a 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Parameterized/FiniteTimeProjectiveFamily.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Parameterized/FiniteTimeProjectiveFamily.lean @@ -18,7 +18,7 @@ derives projectivity under fiberwise conservativity. It does not construct a pro measure or a stochastic process. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory diff --git a/LeanPool/MarkovProcess/MarkovProcess/Parameterized/Killed.lean b/LeanPool/MarkovProcess/MarkovProcess/Parameterized/Killed.lean index e24c4d74dc..fa8bbebd51 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Parameterized/Killed.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Parameterized/Killed.lean @@ -25,7 +25,7 @@ parameterized continuous-path process through the fibre identity. The killed process on lifetime paths (with a cemetery state) is not constructed here. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory open scoped ENNReal NNReal @@ -77,6 +77,7 @@ variable [LocallyCompactSpace alpha] /-- **The killed parameterized family**: the processes of the fibres killed when they leave the open set `U`, as a measurably parameterized family of sub-Markov kernel semigroups on the carrier `U`. -/ +@[expose] noncomputable def IsConservative.killedFamily (hFeller : ∀ theta, (P.toSubMarkovKernelSemigroup theta).IsFellerKernelSemigroup) (hK : P.KolmogorovRegular hP) : ParameterizedSubMarkovKernelSemigroup Theta U where diff --git a/LeanPool/MarkovProcess/MarkovProcess/Parameterized/OrderedGrid.lean b/LeanPool/MarkovProcess/MarkovProcess/Parameterized/OrderedGrid.lean index c01451c043..d6c108e3d4 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Parameterized/OrderedGrid.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Parameterized/OrderedGrid.lean @@ -21,7 +21,7 @@ The result is a path-law kernel on `Theta × alpha` with values in measures on ` It is not a continuous-time path law and does not assert measurability in the grid. -/ -@[expose] public section +public section open MeasureTheory open ProbabilityTheory @@ -40,6 +40,7 @@ def lastIndex (n : ℕ) : Finset.Iic n := ⟨n, Finset.mem_Iic.mpr le_rfl⟩ /-- The jointly measurable transition kernel at one fixed time increment. -/ +@[expose] def parameterStateKernel (t : NNReal) : Kernel (Theta × alpha) alpha := P.jointKernel.comap (fun q : Theta × alpha ↦ (q.1, (t, q.2))) (measurable_fst.prodMk (measurable_const.prodMk measurable_snd)) @@ -50,6 +51,7 @@ theorem parameterStateKernel_apply (t : NNReal) (theta : Theta) (x : alpha) : rfl /-- The augmented transition preserves the parameter deterministically and samples the state. -/ +@[expose] noncomputable def augmentedKernel (t : NNReal) : Kernel (Theta × alpha) (Theta × alpha) := Kernel.deterministic Prod.fst measurable_fst ×ₖ P.parameterStateKernel t diff --git a/LeanPool/MarkovProcess/MarkovProcess/Parameterized/Semigroup.lean b/LeanPool/MarkovProcess/MarkovProcess/Parameterized/Semigroup.lean index 57aa00b792..cd8c1304d2 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Parameterized/Semigroup.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Parameterized/Semigroup.lean @@ -20,7 +20,7 @@ No parameter family is selected here, and no concrete coefficient, domain, Felle or stochastic-process assertion is made. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -76,6 +76,7 @@ theorem ext {P Q : ParameterizedSubMarkovKernelSemigroup Theta alpha} variable (P : ParameterizedSubMarkovKernelSemigroup Theta alpha) /-- The jointly measurable kernel with input ordered as parameter, then time and state. -/ +@[expose] def jointKernel : Kernel (Theta × (NNReal × alpha)) alpha where toFun q := P q.1 q.2.1 q.2.2 measurable' := P.measurable_kernel @@ -98,6 +99,7 @@ theorem measurable_measure {s : Set alpha} (hs : MeasurableSet s) : (Measure.measurable_coe hs).comp P.measurable_kernel /-- The ordinary sub-Markov kernel semigroup at one fixed parameter. -/ +@[expose] def toSubMarkovKernelSemigroup (theta : Theta) : SubMarkovKernelSemigroup alpha where kernel := P theta measurable_kernel := by diff --git a/LeanPool/MarkovProcess/MarkovProcess/Path/Basic.lean b/LeanPool/MarkovProcess/MarkovProcess/Path/Basic.lean index f795bbc3de..a44197ba70 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Path/Basic.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Path/Basic.lean @@ -17,7 +17,7 @@ coordinate process, and the filtration generated by coordinates up to each time. no probability law and makes no stochastic-process association or path-regularity claim. -/ -@[expose] public section +public section open MeasureTheory @@ -37,6 +37,7 @@ instance instMeasurableSpace : MeasurableSpace (ContinuousPath alpha) := borel _ instance instBorelSpace : BorelSpace (ContinuousPath alpha) := ⟨rfl⟩ /-- Evaluation of a continuous path at a fixed nonnegative time. -/ +@[expose] def eval (t : NNReal) : ContinuousPath alpha → alpha := fun omega => omega t @[simp] @@ -47,6 +48,7 @@ theorem continuous_eval (t : NNReal) : Continuous (eval (alpha := alpha) t) := continuous_eval_const t /-- The coordinate process on canonical continuous-path space. -/ +@[expose] def coordinateProcess (t : NNReal) (omega : ContinuousPath alpha) : alpha := omega t @[simp] @@ -70,6 +72,7 @@ theorem ext {omega eta : ContinuousPath alpha} (h : ∀ t, omega t = eta t) : om ContinuousMap.ext h /-- The canonical filtration generated by coordinates at times `s ≤ t`. -/ +@[expose] def canonicalFiltration [MeasurableSpace alpha] [BorelSpace alpha] : Filtration NNReal (borel (ContinuousPath alpha)) where seq t := ⨆ s : Set.Iic t, diff --git a/LeanPool/MarkovProcess/MarkovProcess/Path/ClosedSetDetection.lean b/LeanPool/MarkovProcess/MarkovProcess/Path/ClosedSetDetection.lean index 84b067929c..58ce5bdceb 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Path/ClosedSetDetection.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Path/ClosedSetDetection.lean @@ -12,7 +12,7 @@ public import Mathlib.Topology.MetricSpace.HausdorffDistance /-! # Detecting closed sets from countably many path coordinates -/ -@[expose] public section +public section noncomputable section PortComputability @@ -27,6 +27,7 @@ namespace ContinuousPath variable {alpha : Type*} [PseudoMetricSpace alpha] /-- The positive thresholds used to detect zero distance to a closed set. -/ +@[expose] def detectionThreshold (n : ℕ) : ℝ := 1 / (n + 1 : ℝ) private theorem detectionThreshold_pos (n : ℕ) : 0 < detectionThreshold n := by @@ -34,6 +35,7 @@ private theorem detectionThreshold_pos (n : ℕ) : 0 < detectionThreshold n := b /-- A countable test for whether a path on `[0, t]` meets `F`. The endpoint `t` is included separately, while all earlier samples use the fixed enumeration of nonnegative rational times. -/ +@[expose] def DetectsClosedSetOnIic (t : NNReal) (F : Set alpha) (f : C(Set.Iic t, alpha)) : Prop := F.Nonempty ∧ ∀ n : ℕ, Metric.infDist (f ⟨t, Set.mem_Iic.mpr le_rfl⟩) F < detectionThreshold n ∨ @@ -143,6 +145,7 @@ private theorem closedSetDetectionThreshold_pos (n : ℕ) : exact one_div_pos.mpr (Nat.cast_add_one_pos n) /-- A countable test for whether a continuous map on `[u, t]` meets `F`. -/ +@[expose] def DetectsClosedSetOnIcc (u t : NNReal) (hut : u ≤ t) (F : Set alpha) (f : C(Set.Icc u t, alpha)) : Prop := F.Nonempty ∧ ∀ n : ℕ, @@ -250,11 +253,13 @@ theorem detectsClosedSetOnIcc_iff (lt_of_le_of_ne s.property.2 hst) (closedSetDetectionThreshold_pos n) hzero /-- Restrict an ordinary continuous path to a compact initial time interval. -/ +@[expose] def restrictIic (t : NNReal) (omega : ContinuousPath alpha) : C(Set.Iic t, alpha) where toFun s := omega s continuous_toFun := omega.continuous.comp continuous_subtype_val /-- The event that a continuous path meets `F` at or before time `t`. -/ +@[expose] def hitsSetBy (t : NNReal) (F : Set alpha) : Set (ContinuousPath alpha) := {omega | ∃ s : Set.Iic t, omega s ∈ F} diff --git a/LeanPool/MarkovProcess/MarkovProcess/Path/DenseFiltration.lean b/LeanPool/MarkovProcess/MarkovProcess/Path/DenseFiltration.lean index a971f684fd..25cab946ac 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Path/DenseFiltration.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Path/DenseFiltration.lean @@ -17,7 +17,7 @@ fact is the filtration bridge needed to extend finite-cylinder restart identitie events. No probability law or Markov property is asserted here. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -40,6 +40,7 @@ def denseCanonicalFiltration (S : DenseTime) : MeasurableSpace (ContinuousPath a inferInstance /-- Restrict a continuous path to the rational times at most `S`. -/ +@[expose] def densePastRestriction (S : DenseTime) (omega : ContinuousPath alpha) : Set.Iic S → alpha := fun r ↦ coordinateProcess (alpha := alpha) (DenseTime.castOrderEmbedding r) omega diff --git a/LeanPool/MarkovProcess/MarkovProcess/Path/DenseRestrictionIntegral.lean b/LeanPool/MarkovProcess/MarkovProcess/Path/DenseRestrictionIntegral.lean index fcefc549c8..150966d59b 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Path/DenseRestrictionIntegral.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Path/DenseRestrictionIntegral.lean @@ -17,7 +17,7 @@ continuous-path space is integrating the composed test against the measure itsel change-of-variables identity with no probabilistic content. -/ -@[expose] public section +public section open MeasureTheory open scoped CompactlySupported diff --git a/LeanPool/MarkovProcess/MarkovProcess/Path/Exhaustion.lean b/LeanPool/MarkovProcess/MarkovProcess/Path/Exhaustion.lean index 962a108101..11230c7a2b 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Path/Exhaustion.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Path/Exhaustion.lean @@ -20,7 +20,7 @@ interval for every `n ≥ N` (`tendsto_exitTime_atTop`). Exit times are monoton This is the path-space fact behind nonexplosion arguments: no probability law is involved here. -/ -@[expose] public section +public section open Filter Topology open scoped ENNReal NNReal diff --git a/LeanPool/MarkovProcess/MarkovProcess/Path/ExitTime.lean b/LeanPool/MarkovProcess/MarkovProcess/Path/ExitTime.lean index e64bb687ac..f058333870 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Path/ExitTime.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Path/ExitTime.lean @@ -31,7 +31,7 @@ This file constructs no probability law and proves no probabilistic statement; i does not claim that the exit time is almost surely finite for any process. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -174,6 +174,7 @@ section WithTopValue /-- The exit time of a continuous path from `U`, read in `WithTop ℝ≥0`: this is the same value as `ContinuousPath.exitTime U`, presented in the type Mathlib's `IsStoppingTime` expects. -/ +@[expose] def exitTimeTop (U : Set alpha) (omega : ContinuousPath alpha) : WithTop NNReal := exitTime U omega diff --git a/LeanPool/MarkovProcess/MarkovProcess/Path/ExitTimeShift.lean b/LeanPool/MarkovProcess/MarkovProcess/Path/ExitTimeShift.lean index e3677cf0ae..8855721ac7 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Path/ExitTimeShift.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Path/ExitTimeShift.lean @@ -26,7 +26,7 @@ shift `ContinuousPath.shift t`, and the measurability of the survival events the Nothing here involves a probability law. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal NNReal diff --git a/LeanPool/MarkovProcess/MarkovProcess/Path/KernelIdentification.lean b/LeanPool/MarkovProcess/MarkovProcess/Path/KernelIdentification.lean index 5f0f5ca5d9..980086e8b2 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Path/KernelIdentification.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Path/KernelIdentification.lean @@ -18,7 +18,7 @@ deterministic property of continuous paths; it makes no stochastic-process, Mark claim. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Path/MeasureIdentification.lean b/LeanPool/MarkovProcess/MarkovProcess/Path/MeasureIdentification.lean index 006e8d6031..61fdcda028 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Path/MeasureIdentification.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Path/MeasureIdentification.lean @@ -16,7 +16,7 @@ carrier. This is the measure-level counterpart of continuous-path kernel identif deterministic property of continuous paths. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Path/MixedFiniteMarginals.lean b/LeanPool/MarkovProcess/MarkovProcess/Path/MixedFiniteMarginals.lean index 4d3251b2e1..6fa3b47303 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Path/MixedFiniteMarginals.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Path/MixedFiniteMarginals.lean @@ -22,7 +22,7 @@ This is a finite-dimensional law identity. The conditional factorization of tha the state at `S` is in `Restart/RationalRestart.lean`. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Path/OptionalStopping.lean b/LeanPool/MarkovProcess/MarkovProcess/Path/OptionalStopping.lean index 7fdea02348..5b25812bd2 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Path/OptionalStopping.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Path/OptionalStopping.lean @@ -38,7 +38,7 @@ a filtration indexed by `ℝ≥0`. No optional-stopping result for unbounded st asserted. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Path/Polish.lean b/LeanPool/MarkovProcess/MarkovProcess/Path/Polish.lean index a8d9f88ff5..fd84a3ebc0 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Path/Polish.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Path/Polish.lean @@ -21,7 +21,7 @@ With the Borel sigma-algebra the path space is therefore a standard Borel space. This is ordinary topological infrastructure. It proves no probabilistic statement. -/ -@[expose] public section +public section namespace MarkovProcess namespace ContinuousPath diff --git a/LeanPool/MarkovProcess/MarkovProcess/Path/RandomShiftMeasurability.lean b/LeanPool/MarkovProcess/MarkovProcess/Path/RandomShiftMeasurability.lean index 21417aef5e..af39c647e5 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Path/RandomShiftMeasurability.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Path/RandomShiftMeasurability.lean @@ -22,7 +22,7 @@ expectation formula; those are in `Trajectory/FellerStoppingRestart.lean` and `Trajectory/FellerStoppingConditional.lean`. -/ -@[expose] public section +public section open MeasureTheory diff --git a/LeanPool/MarkovProcess/MarkovProcess/Path/RandomTimeCompactTestConvergence.lean b/LeanPool/MarkovProcess/MarkovProcess/Path/RandomTimeCompactTestConvergence.lean index aa9aaf28b2..f75dd181ff 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Path/RandomTimeCompactTestConvergence.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Path/RandomTimeCompactTestConvergence.lean @@ -19,7 +19,7 @@ continuous-path space; no Markov or kernel assumption is used. The deterministi versions are in `ContinuousPathShiftCompactTestConvergence.lean`. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Path/RelativeHitting.lean b/LeanPool/MarkovProcess/MarkovProcess/Path/RelativeHitting.lean index 35753df545..1e852387b5 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Path/RelativeHitting.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Path/RelativeHitting.lean @@ -23,7 +23,7 @@ Public declarations: * `ContinuousPath.measurableSet_hitsSetBetween`. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Path/Sampling.lean b/LeanPool/MarkovProcess/MarkovProcess/Path/Sampling.lean index 0e12341a6b..25bbb664cb 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Path/Sampling.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Path/Sampling.lean @@ -29,7 +29,7 @@ No lattice, no covering family and no discrete geometry appears here: the sampli metric. -/ -@[expose] public section +public section open Set open scoped ENNReal NNReal diff --git a/LeanPool/MarkovProcess/MarkovProcess/Path/Shift.lean b/LeanPool/MarkovProcess/MarkovProcess/Path/Shift.lean index a179fb8312..eaf0cda5ee 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Path/Shift.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Path/Shift.lean @@ -18,7 +18,7 @@ records the corresponding deterministic relation between the canonical filtratio No random-time shift, Markov property, strong Markov property, or Hunt-process assertion is made. -/ -@[expose] public section +public section open MeasureTheory @@ -28,6 +28,7 @@ namespace ContinuousPath variable {alpha : Type*} [TopologicalSpace alpha] /-- Translation of nonnegative time by `S`, as a continuous self-map of `NNReal`. -/ +@[expose] def timeTranslation (S : NNReal) : C(NNReal, NNReal) where toFun t := S + t continuous_toFun := continuous_const.add continuous_id @@ -36,6 +37,7 @@ def timeTranslation (S : NNReal) : C(NNReal, NNReal) where theorem timeTranslation_apply (S t : NNReal) : timeTranslation S t = S + t := rfl /-- Shift a continuous path forward by the deterministic time `S`. -/ +@[expose] def shift (S : NNReal) (omega : ContinuousPath alpha) : ContinuousPath alpha := omega.comp (timeTranslation S) diff --git a/LeanPool/MarkovProcess/MarkovProcess/Path/ShiftCompactTestConvergence.lean b/LeanPool/MarkovProcess/MarkovProcess/Path/ShiftCompactTestConvergence.lean index 4a3db448a2..501e9d5a2e 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Path/ShiftCompactTestConvergence.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Path/ShiftCompactTestConvergence.lean @@ -16,7 +16,7 @@ dense times. The measure is any finite measure on continuous-path space; no Mark assumption is used. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Path/StoppedValueMeasurability.lean b/LeanPool/MarkovProcess/MarkovProcess/Path/StoppedValueMeasurability.lean index 71f8473c62..f5e848481d 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Path/StoppedValueMeasurability.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Path/StoppedValueMeasurability.lean @@ -23,7 +23,7 @@ expectation formula; those are in `Trajectory/FellerStoppingRestart.lean` and `Trajectory/FellerStoppingConditional.lean`. -/ -@[expose] public section +public section open MeasureTheory diff --git a/LeanPool/MarkovProcess/MarkovProcess/Path/Stopping.lean b/LeanPool/MarkovProcess/MarkovProcess/Path/Stopping.lean index 6ac88939e9..07bf4915ea 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Path/Stopping.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Path/Stopping.lean @@ -16,7 +16,7 @@ topological and Borel-measurability properties of this operation; it introduces times or stochastic laws. -/ -@[expose] public section +public section namespace MarkovProcess @@ -25,6 +25,7 @@ namespace ContinuousPath variable {alpha : Type*} [TopologicalSpace alpha] /-- Clamp nonnegative time at the fixed deterministic time `T`. -/ +@[expose] def clampTime (T : NNReal) : C(NNReal, NNReal) where toFun t := min t T continuous_toFun := continuous_id.min continuous_const @@ -33,6 +34,7 @@ def clampTime (T : NNReal) : C(NNReal, NNReal) where theorem clampTime_apply (T t : NNReal) : clampTime T t = min t T := rfl /-- A continuous path stopped at the fixed deterministic time `T`. -/ +@[expose] def stoppedPath (T : NNReal) (omega : ContinuousPath alpha) : ContinuousPath alpha := omega.comp (clampTime T) diff --git a/LeanPool/MarkovProcess/MarkovProcess/Path/StoppingTimeDyadicCeiling.lean b/LeanPool/MarkovProcess/MarkovProcess/Path/StoppingTimeDyadicCeiling.lean index 488d300561..f6960456ae 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Path/StoppingTimeDyadicCeiling.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Path/StoppingTimeDyadicCeiling.lean @@ -19,7 +19,7 @@ infrastructure and proves no restart identity; the restart identity obtained fro approximation is in `Trajectory/FellerStoppingRestart.lean`. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -31,6 +31,7 @@ namespace MarkovProcess section /-- The level-`n` dyadic ceiling of a nonnegative real time. -/ +@[expose] def dyadicCeiling (n : ℕ) (t : NNReal) : NNReal := ⟨(⌈(2 ^ n : ℝ) * (t : ℝ)⌉₊ : ℝ) / 2 ^ n, by positivity⟩ @@ -122,9 +123,11 @@ theorem tendsto_dyadicCeiling (t : NNReal) : (fun n ↦ le_dyadicCeiling n t) (fun n ↦ dyadicCeiling_le_add n t) /-- The level-`n` dyadic grid point with index `k`. -/ +@[expose] def dyadicGrid (n k : ℕ) : NNReal := ⟨(k : ℝ) / 2 ^ n, by positivity⟩ /-- The grid index of the level-`n` dyadic ceiling. -/ +@[expose] def dyadicCeilingIndex (n : ℕ) (t : NNReal) : ℕ := ⌈(2 ^ n : ℝ) * (t : ℝ)⌉₊ diff --git a/LeanPool/MarkovProcess/MarkovProcess/Restart/ConditionalExpectation.lean b/LeanPool/MarkovProcess/MarkovProcess/Restart/ConditionalExpectation.lean index cc0a329a41..88c219c7f9 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Restart/ConditionalExpectation.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Restart/ConditionalExpectation.lean @@ -20,7 +20,7 @@ only an unconditional distributional identity and is not enough for this conclus No stochastic process, Markov property, or path-space construction is asserted here. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Restart/ConditionalMarkov.lean b/LeanPool/MarkovProcess/MarkovProcess/Restart/ConditionalMarkov.lean index aa2f186264..ca48e83c96 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Restart/ConditionalMarkov.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Restart/ConditionalMarkov.lean @@ -21,7 +21,7 @@ The theorem is a conditional API: it does not prove its restricted restart-law h not by itself associate a Markov or Hunt process with a transition semigroup. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Restart/CountableStoppingRestart.lean b/LeanPool/MarkovProcess/MarkovProcess/Restart/CountableStoppingRestart.lean index 28d13097e5..538bc46971 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Restart/CountableStoppingRestart.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Restart/CountableStoppingRestart.lean @@ -19,7 +19,7 @@ infrastructure: the deterministic-time restart identity is a hypothesis here, pr continuous-path process in `Trajectory/FellerRestrictedRestart.lean`. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Restart/CountableStoppingRestartMeasure.lean b/LeanPool/MarkovProcess/MarkovProcess/Restart/CountableStoppingRestartMeasure.lean index 0deb703b9a..5caddde693 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Restart/CountableStoppingRestartMeasure.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Restart/CountableStoppingRestartMeasure.lean @@ -22,7 +22,7 @@ This is ordinary conditional infrastructure. The restart hypothesis is an assum is proved for the continuous-path process in `Trajectory/FellerRestrictedRestart.lean`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory open scoped NNReal diff --git a/LeanPool/MarkovProcess/MarkovProcess/Restart/FinitePastRestart.lean b/LeanPool/MarkovProcess/MarkovProcess/Restart/FinitePastRestart.lean index 508bf4f07b..f23a54b633 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Restart/FinitePastRestart.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Restart/FinitePastRestart.lean @@ -19,7 +19,7 @@ joint-law factorization. It does not assert that any particular stochastic proc finite-dimensional identities. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -38,6 +38,7 @@ variable [StandardBorelSpace (ContinuousPath alpha)] /-- Encode a finite-coordinate past and the dense restriction of a continuous future as one path indexed by the disjoint union of the past and future coordinate types. -/ +@[expose] def finitePastDenseFuture (z : (index → alpha) × ContinuousPath alpha) : index ⊕ DenseTime → alpha | Sum.inl i => z.1 i diff --git a/LeanPool/MarkovProcess/MarkovProcess/Restart/MixedPastFuture.lean b/LeanPool/MarkovProcess/MarkovProcess/Restart/MixedPastFuture.lean index 894244e2be..8bae56d455 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Restart/MixedPastFuture.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Restart/MixedPastFuture.lean @@ -23,7 +23,7 @@ This file merges the following former modules, one section each: rational cut -/ -@[expose] public section +public section noncomputable section PortComputability @@ -39,11 +39,13 @@ section namespace MixedPastFuture /-- Past labels occurring in a finite mixed-coordinate set, viewed as dense absolute times. -/ +@[expose] def pastFinset (S : DenseTime) (I : Finset (Set.Iic S ⊕ DenseTime)) : Finset DenseTime := I.toLeft.map ⟨(fun r ↦ r.1), fun _ _ h ↦ Subtype.ext h⟩ /-- Future labels occurring in a finite mixed-coordinate set. -/ +@[expose] def futureFinset (S : DenseTime) (I : Finset (Set.Iic S ⊕ DenseTime)) : Finset DenseTime := I.toRight @@ -66,6 +68,7 @@ theorem mem_futureFinset (S : DenseTime) (I : Finset (Set.Iic S ⊕ DenseTime)) exact Finset.mem_toRight /-- The finite set of absolute dense times observed by a mixed past/future coordinate set. -/ +@[expose] def absoluteFinset (S : DenseTime) (I : Finset (Set.Iic S ⊕ DenseTime)) : Finset DenseTime := pastFinset S I ∪ DenseTime.addFinset S (futureFinset S I) @@ -80,6 +83,7 @@ theorem mem_absoluteFinset (S : DenseTime) (I : Finset (Set.Iic S ⊕ DenseTime) /-- Send a mixed label to the absolute dense time which it observes. This map need not be injective: the terminal past label and future zero both map to `S`. -/ +@[expose] def absoluteTime (S : DenseTime) : Set.Iic S ⊕ DenseTime → DenseTime | Sum.inl r => r.1 | Sum.inr t => S + t @@ -99,6 +103,7 @@ theorem absoluteTime_terminal_eq_zeroFuture (S : DenseTime) : simp only [absoluteTime_inl, absoluteTime_inr, add_zero] /-- Every label in `I` has its absolute time in `absoluteFinset S I`. -/ +@[expose] def absoluteIndex (S : DenseTime) (I : Finset (Set.Iic S ⊕ DenseTime)) (i : I) : absoluteFinset S I := by refine ⟨absoluteTime S i, ?_⟩ @@ -120,11 +125,13 @@ theorem absoluteIndex_val (S : DenseTime) (I : Finset (Set.Iic S ⊕ DenseTime)) (absoluteIndex S I i : DenseTime) = absoluteTime S i := rfl /-- The physical nonnegative-real times corresponding to a finite mixed-coordinate set. -/ +@[expose] def absolutePhysicalFinset (S : DenseTime) (I : Finset (Set.Iic S ⊕ DenseTime)) : Finset NNReal := SubMarkovKernelSemigroup.denseTimePhysicalSet (absoluteFinset S I) /-- The physical-time coordinate selected by a mixed label. -/ +@[expose] def absolutePhysicalIndex (S : DenseTime) (I : Finset (Set.Iic S ⊕ DenseTime)) (i : I) : absolutePhysicalFinset S I := DenseTime.physicalSetEquiv (absoluteFinset S I) (absoluteIndex S I i) @@ -137,6 +144,7 @@ theorem absolutePhysicalIndex_val (S : DenseTime) /-- Pull physical absolute-time coordinates back to their mixed labels. This merely duplicates a coordinate when past terminal time and future zero both occur. -/ +@[expose] def pullbackAbsolutePhysical {alpha : Type*} (S : DenseTime) (I : Finset (Set.Iic S ⊕ DenseTime)) (path : absolutePhysicalFinset S I → alpha) : I → alpha := @@ -166,6 +174,7 @@ variable {alpha : Type*} [TopologicalSpace alpha] /-- The rational past through `S` and the rational coordinates of the future shifted at `S`, combined into a single sum-indexed path. -/ +@[expose] def mixedPastShiftedCoordinates (S : DenseTime) (omega : ContinuousPath alpha) : Set.Iic S ⊕ DenseTime → alpha | Sum.inl r => omega (DenseTime.castOrderEmbedding r) @@ -263,6 +272,7 @@ private theorem sort_union_eq_append {beta : Type*} [LinearOrder beta] simp only [Finset.mem_sort, Finset.mem_union, List.mem_append] /-- Past observation times with the cut inserted, whether or not the mixed labels observe it. -/ +@[expose] def pastWithTerminalFinset (S : DenseTime) (I : Finset (Set.Iic S ⊕ DenseTime)) : Finset DenseTime := pastFinset S I ∪ {S} @@ -277,6 +287,7 @@ theorem mem_pastWithTerminalFinset (S : DenseTime) /-- Strictly positive elapsed future times. Future zero is represented by the terminal past coordinate instead of a second coordinate in the ordered concatenation. -/ +@[expose] def positiveFutureFinset (S : DenseTime) (I : Finset (Set.Iic S ⊕ DenseTime)) : Finset DenseTime := (futureFinset S I).filter (0 < ·) @@ -288,6 +299,7 @@ theorem mem_positiveFutureFinset (S : DenseTime) simp only [positiveFutureFinset, Finset.mem_filter, mem_futureFinset] /-- The absolute observation set after inserting the cut. -/ +@[expose] def absoluteFinsetWithTerminal (S : DenseTime) (I : Finset (Set.Iic S ⊕ DenseTime)) : Finset DenseTime := absoluteFinset S I ∪ {S} @@ -363,16 +375,19 @@ theorem card_pastWithTerminalFinset (S : DenseTime) Finset.mem_union_right _ (Finset.mem_singleton_self S)⟩) /-- Physical-time version of the cut-augmented absolute set. -/ +@[expose] def absolutePhysicalFinsetWithTerminal (S : DenseTime) (I : Finset (Set.Iic S ⊕ DenseTime)) : Finset NNReal := SubMarkovKernelSemigroup.denseTimePhysicalSet (absoluteFinsetWithTerminal S I) /-- Physical coordinates of the cut-augmented past. -/ +@[expose] def pastPhysicalFinsetWithTerminal (S : DenseTime) (I : Finset (Set.Iic S ⊕ DenseTime)) : Finset NNReal := SubMarkovKernelSemigroup.denseTimePhysicalSet (pastWithTerminalFinset S I) /-- Absolute physical coordinates of the strictly positive future. -/ +@[expose] def positiveFutureAbsolutePhysicalFinset (S : DenseTime) (I : Finset (Set.Iic S ⊕ DenseTime)) : Finset NNReal := SubMarkovKernelSemigroup.denseTimePhysicalSet @@ -410,6 +425,7 @@ theorem card_absolutePhysicalFinsetWithTerminal (S : DenseTime) card_absoluteFinsetWithTerminal, card_pastWithTerminalFinset] /-- Reindex the cut cardinality by the cardinality of the augmented absolute physical set. -/ +@[expose] def cutOrderEmbedding (S : DenseTime) (I : Finset (Set.Iic S ⊕ DenseTime)) : Fin ((positiveFutureFinset S I).card + (pastPredecessorCard S I + 1)) ↪o @@ -418,6 +434,7 @@ def cutOrderEmbedding (S : DenseTime) /-- Increasing physical times of the cut-augmented mixed set, cast to the cardinal convention expected by finite-time concatenation. -/ +@[expose] def cutOrderedPhysicalTimes (S : DenseTime) (I : Finset (Set.Iic S ⊕ DenseTime)) : FiniteOrderedTimes @@ -427,6 +444,7 @@ def cutOrderedPhysicalTimes (S : DenseTime) /-- Sorted physical coordinates of the augmented past, with its cardinality written as a successor. -/ +@[expose] def cutPastOrderedPhysicalTimes (S : DenseTime) (I : Finset (Set.Iic S ⊕ DenseTime)) : FiniteOrderedTimes (pastPredecessorCard S I + 1) := @@ -437,6 +455,7 @@ def cutPastOrderedPhysicalTimes (S : DenseTime) (SubMarkovKernelSemigroup.finiteSetTimes (pastPhysicalFinsetWithTerminal S I)) /-- Sorted physical elapsed times of the strictly positive future. -/ +@[expose] def positiveFutureOrderedPhysicalTimes (S : DenseTime) (I : Finset (Set.Iic S ⊕ DenseTime)) : FiniteOrderedTimes (positiveFutureFinset S I).card := @@ -595,6 +614,7 @@ theorem cutOrderedPhysicalTimes_relativeFinalSegment (S : DenseTime) rw [DenseTime.castOrderEmbedding_add, add_tsub_cancel_left] /-- Position of an augmented-past coordinate in the initial ordered block. -/ +@[expose] def pastCutOrderIndex (S : DenseTime) (I : Finset (Set.Iic S ⊕ DenseTime)) (r : pastWithTerminalFinset S I) : Fin (pastPredecessorCard S I + 1) := Fin.cast (by @@ -605,6 +625,7 @@ def pastCutOrderIndex (S : DenseTime) (I : Finset (Set.Iic S ⊕ DenseTime)) (DenseTime.physicalSetEquiv (pastWithTerminalFinset S I) r)) /-- Position of a positive relative-future coordinate in the final ordered block. -/ +@[expose] def positiveFutureOrderIndex (S : DenseTime) (I : Finset (Set.Iic S ⊕ DenseTime)) (t : positiveFutureFinset S I) : Fin (positiveFutureFinset S I).card := @@ -651,6 +672,7 @@ theorem positiveFutureOrderedPhysicalTimes_positiveFutureOrderIndex DenseTime.physicalSetEquiv_apply] using! hx /-- Reindex a split ordered path by augmented-past and positive-future dense labels. -/ +@[expose] def orderedSplitToCutCoordinates {alpha : Type*} (S : DenseTime) (I : Finset (Set.Iic S ⊕ DenseTime)) (z : (Fin (pastPredecessorCard S I + 1) → alpha) × @@ -671,6 +693,7 @@ theorem measurable_orderedSplitToCutCoordinates {alpha : Type*} [MeasurableSpace exact (measurable_pi_apply (positiveFutureOrderIndex S I t)).comp measurable_snd /-- A past label as a coordinate of the cut-augmented past set. -/ +@[expose] def pastCutIndex (S : DenseTime) (I : Finset (Set.Iic S ⊕ DenseTime)) (r : I.toLeft) : pastWithTerminalFinset S I := ⟨r.1.1, (mem_pastWithTerminalFinset S I r).mpr @@ -698,6 +721,7 @@ theorem futureCutIndex_eq_none_iff (S : DenseTime) variable {alpha : Type*} /-- Select the augmented-past or strict-future coordinate represented by a mixed label. -/ +@[expose] def cutCoordinateIndex (S : DenseTime) (I : Finset (Set.Iic S ⊕ DenseTime)) (i : I) : pastWithTerminalFinset S I ⊕ positiveFutureFinset S I := by cases hi : i.1 with @@ -713,6 +737,7 @@ def cutCoordinateIndex (S : DenseTime) (I : Finset (Set.Iic S ⊕ DenseTime)) (i /-- Pull coordinates indexed by the augmented past and the strictly positive relative future back to the original mixed labels. -/ +@[expose] def pullbackCutCoordinates (S : DenseTime) (I : Finset (Set.Iic S ⊕ DenseTime)) (z : (pastWithTerminalFinset S I → alpha) × (positiveFutureFinset S I → alpha)) : I → alpha := fun i ↦ Sum.elim z.1 z.2 (cutCoordinateIndex S I i) @@ -733,6 +758,7 @@ theorem measurable_pullbackCutCoordinates (S : DenseTime) ((measurable_pi_apply t).comp measurable_snd) /-- Include an original absolute physical coordinate into the cut-augmented set. -/ +@[expose] def includeAbsolutePhysical (S : DenseTime) (I : Finset (Set.Iic S ⊕ DenseTime)) (t : absolutePhysicalFinset S I) : absolutePhysicalFinsetWithTerminal S I := ⟨t, by @@ -747,6 +773,7 @@ def restrictAugmentedAbsolute {alpha : Type*} (S : DenseTime) /-- Read the augmented absolute path as an augmented past and a strictly positive relative future. -/ +@[expose] def splitAugmentedAbsolute {alpha : Type*} (S : DenseTime) (I : Finset (Set.Iic S ⊕ DenseTime)) (path : absolutePhysicalFinsetWithTerminal S I → alpha) : diff --git a/LeanPool/MarkovProcess/MarkovProcess/Restart/RationalRestart.lean b/LeanPool/MarkovProcess/MarkovProcess/Restart/RationalRestart.lean index 20303afdf4..d35187ecf3 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Restart/RationalRestart.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Restart/RationalRestart.lean @@ -23,7 +23,7 @@ This file merges the following former modules, one section each: * `RationalJointLaw`: Rational-time joint restart law -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Restart/RationalRestrictedRestart.lean b/LeanPool/MarkovProcess/MarkovProcess/Restart/RationalRestrictedRestart.lean index 87b4074c37..990a26b92f 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Restart/RationalRestrictedRestart.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Restart/RationalRestrictedRestart.lean @@ -19,7 +19,7 @@ factorization remains an explicit input; proving it from the finite-dimensional next process-construction step. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -34,6 +34,7 @@ variable {alpha : Type*} [MetricSpace alpha] [MeasurableSpace alpha] [BorelSpace alpha] /-- Evaluation of a rational past at its terminal coordinate. -/ +@[expose] def densePastTerminal (S : DenseTime) (history : Set.Iic S → alpha) : alpha := history ⟨S, Set.mem_Iic.mpr le_rfl⟩ diff --git a/LeanPool/MarkovProcess/MarkovProcess/Restart/RestrictedRestartOfJoint.lean b/LeanPool/MarkovProcess/MarkovProcess/Restart/RestrictedRestartOfJoint.lean index 2fe68160c3..2258848d8a 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Restart/RestrictedRestartOfJoint.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Restart/RestrictedRestartOfJoint.lean @@ -19,7 +19,7 @@ restriction to any event measurable with respect to the conditioning variable. No stochastic process or Markov property is asserted here. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/Basic.lean b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/Basic.lean index 9bc1ab1587..8d78a0efe8 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/Basic.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/Basic.lean @@ -15,7 +15,7 @@ This file provides a small reusable interface for strongly continuous contractio semigroups on real normed spaces, parametrized by nonnegative real time. -/ -@[expose] public section +public section open Filter Topology diff --git a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/CompactStrongConvergence.lean b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/CompactStrongConvergence.lean index 4855385ca3..043cebd72f 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/CompactStrongConvergence.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/CompactStrongConvergence.lean @@ -22,7 +22,7 @@ Neither completeness of the spaces nor countable generation of the index filter nothing is asserted about convergence in the operator norm, which is strictly stronger. -/ -@[expose] public section +public section open Filter Topology diff --git a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/ContractiveResolvent.lean b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/ContractiveResolvent.lean index 4fa2eaf8d0..876ddee2a4 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/ContractiveResolvent.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/ContractiveResolvent.lean @@ -16,7 +16,7 @@ This module packages the elementary resolvent identity, the Hille--Yosida bound, and dense range, then derives normalization at large positive shifts. -/ -@[expose] public section +public section open Filter Topology @@ -41,6 +41,7 @@ namespace ContractiveResolvent variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] /-- The normalized resolvent `α R_α`. -/ +@[expose] def scaledOperator (R : ContractiveResolvent E) (α : PositiveShift) : E →L[ℝ] E := (α : ℝ) • R.operator α diff --git a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/DenseCoreConvergence.lean b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/DenseCoreConvergence.lean index c1259ffd37..f892bdf17d 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/DenseCoreConvergence.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/DenseCoreConvergence.lean @@ -15,7 +15,7 @@ This module extends pointwise convergence of uniformly contractive continuous linear maps from the range of a dense map to the whole ambient space. -/ -@[expose] public section +public section open Filter Topology diff --git a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/Duhamel.lean b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/Duhamel.lean index b5e738bed5..050d71fcb8 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/Duhamel.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/Duhamel.lean @@ -19,7 +19,7 @@ exponentials of commuting bounded generators. The identity is oriented as estimate is immediately applicable to Yosida approximants. -/ -@[expose] public section +public section open MeasureTheory NormedSpace Set diff --git a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/ExponentialBounds.lean b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/ExponentialBounds.lean index eaf36c43aa..3d821f21fe 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/ExponentialBounds.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/ExponentialBounds.lean @@ -16,7 +16,7 @@ This file records elementary estimates for the exponential in a real Banach alge contraction estimate is tailored to exponentials of bounded Yosida-type generators. -/ -@[expose] public section +public section namespace MarkovProcess.Semigroup diff --git a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/ExponentialComparison.lean b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/ExponentialComparison.lean index cc49256479..da7b019836 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/ExponentialComparison.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/ExponentialComparison.lean @@ -24,7 +24,7 @@ Public declarations: No comparison for indicators of arbitrary measurable sets is asserted. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/Generation.lean b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/Generation.lean index e436d945d5..aa6ae65f9e 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/Generation.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/Generation.lean @@ -18,7 +18,7 @@ as a strongly continuous contraction semigroup. Strong continuity at zero is first proved on the range of one resolvent and then extended by density. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -82,6 +82,7 @@ theorem tendsto_yosidaStrongLimit_apply_zero /-- The strongly continuous contraction semigroup generated canonically by a contractive resolvent through its Yosida approximations. -/ +@[expose] def generatedSemigroup (R : ContractiveResolvent E) : StronglyContinuousContractionSemigroup E := StronglyContinuousContractionSemigroup.ofTendstoZero diff --git a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/Generator.lean b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/Generator.lean index 09c2397063..4af848cda8 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/Generator.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/Generator.lean @@ -37,7 +37,7 @@ Times are `NNReal` throughout the library; the real-variable statements read the `Real.toNNReal s`. The fundamental identity is what Dynkin's formula consumes. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -54,6 +54,7 @@ variable (S : StronglyContinuousContractionSemigroup E) section DifferenceQuotient /-- The difference quotient `t⁻¹ • (S t f - f)` of the orbit of `f` at time zero. -/ +@[expose] def differenceQuotient (f : E) (t : NNReal) : E := (t : ℝ)⁻¹ • (S t f - f) /-- The difference quotient, unfolded. -/ @@ -393,6 +394,7 @@ private theorem tendsto_slope_add_of_hasDerivAt {F : ℝ → E} {F' : E} {u : /-- The orbit integral `∫₀ᵘ S s f ds` of a vector `f`, as a function of the real upper limit `u` (the semigroup is read at `Real.toNNReal s`). -/ +@[expose] def orbitIntegral (f : E) (u : ℝ) : E := ∫ s in (0 : ℝ)..u, S (Real.toNNReal s) f /-- The orbit integral, unfolded. -/ diff --git a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/GeneratorClosed.lean b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/GeneratorClosed.lean index 8333156f4d..98dbbb8b2b 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/GeneratorClosed.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/GeneratorClosed.lean @@ -27,7 +27,7 @@ Nothing is asserted about the domain beyond closedness of the graph; density is `Semigroup/Generator.lean`. -/ -@[expose] public section +public section open Filter Topology open scoped NNReal diff --git a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/GeneratorInjectivity.lean b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/GeneratorInjectivity.lean index 23fb491495..f25e3e1459 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/GeneratorInjectivity.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/GeneratorInjectivity.lean @@ -24,7 +24,7 @@ Since `S` is contractive, an eigenvalue `μ > 0` therefore forces `f = 0` `(μ - L)⁻¹` is a well-defined operator. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/GeneratorResolvent.lean b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/GeneratorResolvent.lean index 62be264435..eaf6aea4f1 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/GeneratorResolvent.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/GeneratorResolvent.lean @@ -34,7 +34,7 @@ canonical shifts by dominated convergence gives `S t x - x = ∫₀ᵗ S s (μ x `R_μ`, and time averages of the orbit then produce the difference quotient at `t = 0`. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/GeneratorUniqueness.lean b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/GeneratorUniqueness.lean index 9aef292889..aae930915c 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/GeneratorUniqueness.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/GeneratorUniqueness.lean @@ -28,7 +28,7 @@ and the two difference quotients on the right converge to the common value of th and `T t f`. Density of the generator domain extends the identity to the whole space. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/InvariantSet.lean b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/InvariantSet.lean index d37cb1bf4c..f697da4e8f 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/InvariantSet.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/InvariantSet.lean @@ -19,7 +19,7 @@ Poisson-series argument transferring the latter invariance to each exponential approximant is in `Semigroup/PoissonInvariant.lean`. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -30,6 +30,7 @@ section namespace MarkovProcess.Semigroup /-- A map preserves a set if it sends every member of the set back into it. -/ +@[expose] def PreservesSet {E F : Type*} (T : E → F) (C : Set E) (D : Set F) : Prop := ∀ ⦃x⦄, x ∈ C → T x ∈ D diff --git a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/OrbitContinuity.lean b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/OrbitContinuity.lean index d288b66c81..9f295b4a36 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/OrbitContinuity.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/OrbitContinuity.lean @@ -18,7 +18,7 @@ strong continuity to joint continuity in the time and the vector, in the form `continuous_operator_apply`. -/ -@[expose] public section +public section open Filter Topology @@ -89,6 +89,7 @@ theorem continuous_operator_apply (S : StronglyContinuousContractionSemigroup E) /-- Construct a strongly continuous contraction semigroup by checking strong convergence to the identity only at time zero. -/ +@[expose] def ofTendstoZero (T : NNReal → E →L[ℝ] E) (hzero : T 0 = ContinuousLinearMap.id ℝ E) diff --git a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/OrbitProductRule.lean b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/OrbitProductRule.lean index f1afecef24..2c22abc6c8 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/OrbitProductRule.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/OrbitProductRule.lean @@ -28,7 +28,7 @@ Times are read from the real line at `Real.toNNReal`, as elsewhere in the librar asserted about the two-sided derivative, which for a general curve fails at `s = 0`. -/ -@[expose] public section +public section open Filter Topology open scoped NNReal diff --git a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/PoissonInvariant.lean b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/PoissonInvariant.lean index 2ca8ccdaae..adaf3bd7d5 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/PoissonInvariant.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/PoissonInvariant.lean @@ -15,7 +15,7 @@ This file proves the uniformization argument: a normalized resolvent preserving a closed convex set containing zero has Yosida exponentials preserving that set. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -110,6 +110,7 @@ theorem exp_smul_sub_id_apply_eq_tsum [CompleteSpace E] ring /-- The Poisson coefficients with parameter `c`. -/ +@[expose] def poissonWeight (c : ℝ) (n : ℕ) : ℝ := Real.exp (-c) * (c ^ n / n.factorial) diff --git a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/PositiveShift.lean b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/PositiveShift.lean index 617cb13ddb..7b3a2c3c73 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/PositiveShift.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/PositiveShift.lean @@ -16,7 +16,7 @@ parameters and a filter-generic criterion that turns a vanishing square bound into convergence to zero. -/ -@[expose] public section +public section namespace MarkovProcess.Semigroup diff --git a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/Resolvent.lean b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/Resolvent.lean index 71a250b340..e67e46892b 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/Resolvent.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/Resolvent.lean @@ -44,7 +44,7 @@ The shift `μ` is a positive real; nothing is asserted for complex shifts or for generator beyond the half-line `(0, ∞)`. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -62,6 +62,7 @@ section Integrand /-- The integrand of the Laplace transform of the orbit of `x` at the shift `μ`, read in the real time variable. -/ +@[expose] def laplaceIntegrand (μ : ℝ) (x : E) (t : ℝ) : E := Real.exp (-μ * t) • S (Real.toNNReal t) x omit [CompleteSpace E] in @@ -147,6 +148,7 @@ section Resolvent /-- **The resolvent of the semigroup** at the positive shift `μ`: the Laplace transform of the orbits, `R_μ x = ∫₀^∞ e^{-μ t} S t x dt`, as a bounded operator. -/ +@[expose] def resolvent (μ : PositiveShift) : E →L[ℝ] E := LinearMap.mkContinuous { toFun := fun x ↦ ∫ t in Ioi (0 : ℝ), S.laplaceIntegrand μ x t @@ -303,6 +305,7 @@ theorem denseRange_resolvent (μ : PositiveShift) : DenseRange (S.resolvent μ) /-- **The resolvent family of a strongly continuous contraction semigroup is a contractive resolvent.** -/ +@[expose] def toContractiveResolvent : ContractiveResolvent E where operator := S.resolvent resolvent_identity := S.resolvent_sub_resolvent diff --git a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/ResolventComparison.lean b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/ResolventComparison.lean index 6a8c6d2e78..df241330fd 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/ResolventComparison.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/ResolventComparison.lean @@ -36,7 +36,7 @@ Both semigroups are read at the same shift `μ`; nothing is asserted when the tw taken at different shifts, and no relation between the two generators is assumed. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/ResolventGeneration.lean b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/ResolventGeneration.lean index 17ae99cf88..0d487aa5ed 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/ResolventGeneration.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/ResolventGeneration.lean @@ -33,7 +33,7 @@ Nothing is asserted about resolvents that do not come from a semigroup; for thos generation theorem of `Semigroup/Generation.lean` is the statement. -/ -@[expose] public section +public section open scoped NNReal diff --git a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/StrongOperatorLimit.lean b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/StrongOperatorLimit.lean index 2284d8a9e7..2cca02cf22 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/StrongOperatorLimit.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/StrongOperatorLimit.lean @@ -16,7 +16,7 @@ contractions on a complete real normed space and records the small convergence API needed to pass algebraic identities to the limit. -/ -@[expose] public section +public section open Filter Topology diff --git a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/TrotterKato.lean b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/TrotterKato.lean index cccff0edde..8e0893fe36 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/TrotterKato.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/TrotterKato.lean @@ -44,7 +44,7 @@ about convergence in the operator norm, nor about families that are merely unifo rather than contractive. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/YosidaApproximation.lean b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/YosidaApproximation.lean index 2e483fac44..699deb3af3 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/YosidaApproximation.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/YosidaApproximation.lean @@ -18,7 +18,7 @@ For a contractive resolvent `R`, this file defines the bounded generator records commutation and the exact formula on the range of a fixed resolvent. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -43,6 +43,7 @@ private instance cacheAlgebraCLM : Algebra ℝ (E →L[ℝ] E) := inferInstance private instance cacheIsTopologicalRingCLM : IsTopologicalRing (E →L[ℝ] E) := inferInstance /-- The bounded Yosida generator `G_α = α (α R_α - I)`. -/ +@[expose] def yosidaGenerator (R : ContractiveResolvent E) (α : PositiveShift) : E →L[ℝ] E := (α : ℝ) • (R.scaledOperator α - ContinuousLinearMap.id ℝ E) @@ -63,6 +64,7 @@ instance normedAlgebraRatEnd : NormedAlgebra ℚ (E →L[ℝ] E) := NormedAlgebra.restrictScalars ℚ ℝ (E →L[ℝ] E) /-- The exponential of the bounded Yosida generator at nonnegative time. -/ +@[expose] def yosidaOperator (R : ContractiveResolvent E) (α : PositiveShift) (t : NNReal) : E →L[ℝ] E := exp ((t : ℝ) • R.yosidaGenerator α) @@ -100,6 +102,7 @@ theorem continuous_yosidaOperator_apply (R : ContractiveResolvent E) fun_prop /-- The exponential Yosida approximation as a strongly continuous contraction semigroup. -/ +@[expose] def yosidaSemigroup (R : ContractiveResolvent E) (α : PositiveShift) : StronglyContinuousContractionSemigroup E where operator := R.yosidaOperator α diff --git a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/YosidaStrongLimit.lean b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/YosidaStrongLimit.lean index c018d174c9..8cd3ddfb17 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Semigroup/YosidaStrongLimit.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Semigroup/YosidaStrongLimit.lean @@ -19,7 +19,7 @@ orbits is proved in `Semigroup/Generation.lean`, from the criterion of `Semigroup/OrbitContinuity.lean`. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -30,6 +30,7 @@ section namespace MarkovProcess.Semigroup /-- The canonical sequence of positive shifts, `n + 1`. -/ +@[expose] def naturalShift (n : ℕ) : PositiveShift := ⟨(n : ℝ) + 1, by change 0 < (n : ℝ) + 1 @@ -130,6 +131,7 @@ theorem cauchySeq_yosidaOperatorSequence_apply (R.cauchySeq_yosidaOperator_naturalShift_apply_operator one t) x /-- The canonical strong limit of the Yosida exponential approximants. -/ +@[expose] def yosidaStrongLimit (R : ContractiveResolvent E) (t : NNReal) : E →L[ℝ] E := strongOperatorLimit (R.yosidaOperatorSequence t) (R.norm_yosidaOperatorSequence_le_one t) diff --git a/LeanPool/MarkovProcess/MarkovProcess/Time/CountableDenseTime.lean b/LeanPool/MarkovProcess/MarkovProcess/Time/CountableDenseTime.lean index db03eb4af4..1d66e3a3f6 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Time/CountableDenseTime.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Time/CountableDenseTime.lean @@ -22,7 +22,7 @@ not increasing. No probability law, projective limit, stochastic process, contin regularity is constructed here. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -106,6 +106,7 @@ noncomputable def measurableEquivFinPrefix (e : ℕ ≃ D) (n : ℕ) (α : Type* MeasurableEquiv.piCongrLeft (fun _ : «prefix» e n ↦ α) (finEquivPrefix e n) /-- Measurable reindexing between paths on `ℕ` and paths on the enumerated type. -/ +@[expose] def measurableEquivPath (e : ℕ ≃ D) (α : Type*) [MeasurableSpace α] : (ℕ → α) ≃ᵐ (D → α) := MeasurableEquiv.piCongrLeft (fun _ : D ↦ α) e @@ -118,6 +119,7 @@ abbrev DenseTime := NNRat namespace DenseTime /-- The order embedding of nonnegative rational times into nonnegative real times. -/ +@[expose] noncomputable def castOrderEmbedding : DenseTime ↪o NNReal := NNRat.castOrderEmbedding diff --git a/LeanPool/MarkovProcess/MarkovProcess/Time/DenseTimeApproximationFromAbove.lean b/LeanPool/MarkovProcess/MarkovProcess/Time/DenseTimeApproximationFromAbove.lean index 787302ebf7..a6ae6b7597 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Time/DenseTimeApproximationFromAbove.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Time/DenseTimeApproximationFromAbove.lean @@ -19,7 +19,7 @@ cuts. This is deterministic order-topological infrastructure and makes no stochastic-process claim. -/ -@[expose] public section +public section open Filter Topology open scoped NNReal diff --git a/LeanPool/MarkovProcess/MarkovProcess/Time/DenseTimeHistory.lean b/LeanPool/MarkovProcess/MarkovProcess/Time/DenseTimeHistory.lean index 4bc372ebe9..998327791a 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Time/DenseTimeHistory.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Time/DenseTimeHistory.lean @@ -15,7 +15,7 @@ This file provides measurable coordinate equivalences for histories indexed by a segment of the natural numbers. It makes no probability-law, kernel, or stochastic-process claim. -/ -@[expose] public section +public section namespace MarkovProcess @@ -27,6 +27,7 @@ namespace DenseTimeHistory variable {α : Type*} [MeasurableSpace α] /-- The value-preserving equivalence from natural numbers at most `n` to `Fin (n + 1)`. -/ +@[expose] def iicEquivFin (n : ℕ) : Set.Iic n ≃ Fin (n + 1) where toFun i := ⟨i, Nat.lt_succ_iff.mpr i.property⟩ invFun i := ⟨i, Nat.le_of_lt_succ i.isLt⟩ @@ -43,6 +44,7 @@ theorem iicEquivFin_symm_apply_val (n : ℕ) (i : Fin (n + 1)) : rfl /-- Split a history into its time-zero value and its positive-time coordinates. -/ +@[expose] def historyEquiv (n : ℕ) : DenseTimeHistory α n ≃ᵐ α × (Fin n → α) := (MeasurableEquiv.piCongrLeft (fun _ : Fin (n + 1) ↦ α) (iicEquivFin n)).trans (MeasurableEquiv.piFinSuccAbove (fun _ : Fin (n + 1) ↦ α) 0) @@ -67,6 +69,7 @@ theorem historyEquiv_symm_apply_succ (n : ℕ) (x : α) (path : Fin n → α) (i rfl /-- Split a finite path into its proper prefix and its last coordinate. -/ +@[expose] def splitLast (n : ℕ) : (Fin (n + 1) → α) ≃ᵐ (Fin n → α) × α := (MeasurableEquiv.piFinSuccAbove (fun _ : Fin (n + 1) ↦ α) (Fin.last n)).trans MeasurableEquiv.prodComm diff --git a/LeanPool/MarkovProcess/MarkovProcess/Time/FiniteDenseApproximationOrdered.lean b/LeanPool/MarkovProcess/MarkovProcess/Time/FiniteDenseApproximationOrdered.lean index 1792e8b84a..bf1425c4db 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Time/FiniteDenseApproximationOrdered.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Time/FiniteDenseApproximationOrdered.lean @@ -19,7 +19,7 @@ The construction also covers `I = ∅`. In that case the ordered time family and coordinate types are empty. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -32,6 +32,7 @@ section /-- The physical times of a finite dense approximation, listed in the increasing order inherited from the original finite set. For an empty finite set this is the empty ordered family. -/ +@[expose] def finiteDenseApproximationOrderedTimes {I : Finset NNReal} (q : I ↪o DenseTime) : FiniteOrderedTimes I.card := ((I.orderIsoOfFin rfl).toOrderEmbedding.trans q).trans DenseTime.castOrderEmbedding diff --git a/LeanPool/MarkovProcess/MarkovProcess/Time/FiniteGridIncrement.lean b/LeanPool/MarkovProcess/MarkovProcess/Time/FiniteGridIncrement.lean index 3534064586..b761709e2b 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Time/FiniteGridIncrement.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Time/FiniteGridIncrement.lean @@ -17,7 +17,7 @@ independent of a particular dyadic-grid encoding: a later specialization only ha distance between adjacent grid times. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory open scoped ENNReal NNReal @@ -28,6 +28,7 @@ variable {Ω E : Type*} {mΩ : MeasurableSpace Ω} [PseudoEMetricSpace E] /-- The event that at least one adjacent increment of a finite time grid has `p`-th power at least `ε ^ p`. -/ +@[expose] def finiteGridBadIncrement {T : Type*} {N : ℕ} (X : T → Ω → E) (grid : Fin (N + 1) → T) (p : ℝ) (ε : ℝ≥0∞) : Set Ω := ⋃ i : Fin N, @@ -67,6 +68,7 @@ theorem IsKolmogorovProcess.measure_finiteGridBadIncrement_le _ = N * (M * δ ^ q / ε ^ p) := by simp /-- The dyadic grid of mesh `2⁻ⁿ` on the unit time interval. -/ +@[expose] def unitDyadicGrid (n : ℕ) : Fin (2 ^ n + 1) → NNRat := fun i ↦ (i : ℕ) / (2 ^ n : NNRat) diff --git a/LeanPool/MarkovProcess/MarkovProcess/Time/FiniteOrderEmbedding.lean b/LeanPool/MarkovProcess/MarkovProcess/Time/FiniteOrderEmbedding.lean index f54e270e5c..7bed1d328b 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Time/FiniteOrderEmbedding.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Time/FiniteOrderEmbedding.lean @@ -17,7 +17,7 @@ the range of an order embedding. It is ordinary combinatorial infrastructure and probability-law or stochastic-process claim. -/ -@[expose] public section +public section namespace MarkovProcess diff --git a/LeanPool/MarkovProcess/MarkovProcess/Time/FiniteOrderedTimes.lean b/LeanPool/MarkovProcess/MarkovProcess/Time/FiniteOrderedTimes.lean index b138f284af..f56b043105 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Time/FiniteOrderedTimes.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Time/FiniteOrderedTimes.lean @@ -19,7 +19,7 @@ for restricting such families and their coordinate paths along order embeddings. ordinary finite-dimensional API and makes no probability-law or stochastic-process claim. -/ -@[expose] public section +public section namespace MarkovProcess @@ -29,6 +29,7 @@ abbrev FiniteOrderedTimes (n : ℕ) := Fin n ↪o NNReal namespace FiniteOrderedTimes /-- The times after the first one, shifted so that the first time becomes zero. -/ +@[expose] def relativeTail {n : ℕ} (times : FiniteOrderedTimes (n + 1)) : FiniteOrderedTimes n := OrderEmbedding.ofStrictMono (fun i ↦ times i.succ - times 0) fun _ _ hij ↦ tsub_lt_tsub_right_of_le (times.monotone (Fin.zero_le _)) @@ -40,6 +41,7 @@ theorem relativeTail_apply {n : ℕ} (times : FiniteOrderedTimes (n + 1)) (i : F rfl /-- Translate every time in a finite ordered family by the same nonnegative amount. -/ +@[expose] def translate {n : ℕ} (s : NNReal) (times : FiniteOrderedTimes n) : FiniteOrderedTimes n := OrderEmbedding.ofStrictMono (fun i ↦ s + times i) fun _ _ hij ↦ by simpa only [add_comm] using add_lt_add_left (times.strictMono hij) s @@ -79,6 +81,7 @@ theorem translate_translate {n : ℕ} (s r : NNReal) (times : FiniteOrderedTimes exact (add_assoc s r (times i)).symm /-- Restrict a finite ordered time family along an order embedding of its indices. -/ +@[expose] def restrict {m n : ℕ} (times : FiniteOrderedTimes n) (e : Fin m ↪o Fin n) : FiniteOrderedTimes m := e.trans times @@ -102,6 +105,7 @@ theorem restrict_trans {k m n : ℕ} (times : FiniteOrderedTimes n) rfl /-- Restrict a coordinate path along an embedding of finite index sets. -/ +@[expose] def restrictPath {m n : ℕ} (e : Fin m ↪o Fin n) {α : Type*} (path : Fin n → α) : Fin m → α := fun i ↦ path (e i) diff --git a/LeanPool/MarkovProcess/MarkovProcess/Time/OrderedGrid.lean b/LeanPool/MarkovProcess/MarkovProcess/Time/OrderedGrid.lean index 5f4c9e648f..2132c51321 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Time/OrderedGrid.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Time/OrderedGrid.lean @@ -17,7 +17,7 @@ kernel semigroup on one fixed nondecreasing `NNReal`-valued time grid. The result is only a discrete trajectory law on `ℕ → α` for that grid. -/ -@[expose] public section +public section open MeasureTheory open ProbabilityTheory @@ -42,6 +42,7 @@ def increment (grid : OrderedGrid) (n : ℕ) : NNReal := end OrderedGrid /-- The singleton history at index zero determined by a starting state. -/ +@[expose] def initialHistory (x : α) : Finset.Iic 0 → α := fun _ => x diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/AllTimeFiniteMarginals.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/AllTimeFiniteMarginals.lean index 56b1f35995..09dac71b34 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/AllTimeFiniteMarginals.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/AllTimeFiniteMarginals.lean @@ -24,7 +24,7 @@ their strictly ordered time coordinates. No continuous-time Markov or Hunt prop or asserted. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -88,6 +88,7 @@ theorem exists_denseTime_finset_seq_tendsto (I : Finset NNReal) : namespace ContinuousPath /-- Evaluate a continuous path at a finite family of times. -/ +@[expose] def finiteEvaluation {ι α : Type*} [TopologicalSpace α] (τ : ι → NNReal) : ContinuousPath α → (ι → α) := fun path i ↦ path (τ i) @@ -221,11 +222,13 @@ theorem Kernel.map_finiteEvaluation_eq_of_integral_tendsto namespace SubMarkovKernelSemigroup /-- The rational index set used by one finite ordered rational approximation. -/ +@[expose] def finiteDenseApproximationIndexSet {I : Finset NNReal} (q : I ↪o DenseTime) : Finset DenseTime := Finset.univ.map q.toEmbedding /-- The corresponding finite set of physical nonnegative-real times. -/ +@[expose] def finiteDenseApproximationPhysicalSet {I : Finset NNReal} (q : I ↪o DenseTime) : Finset NNReal := denseTimePhysicalSet (finiteDenseApproximationIndexSet q) @@ -239,6 +242,7 @@ private theorem finiteDenseApproximation_mem {I : Finset NNReal} (q : I ↪o Den exact ⟨t, Finset.mem_univ t, rfl⟩ /-- Reindex a path on an approximating physical-time set by the original finite set. -/ +@[expose] def finiteDenseApproximationReindex {γ : Type*} {I : Finset NNReal} (q : I ↪o DenseTime) : (finiteDenseApproximationPhysicalSet q → γ) → I → γ := @@ -257,6 +261,7 @@ theorem measurable_finiteDenseApproximationReindex /-- The candidate finite law at one rational approximation, transported back to the fixed coordinate type indexed by the original time set. -/ +@[expose] noncomputable def finiteDenseApproximationKernel (P : SubMarkovKernelSemigroup α) {I : Finset NNReal} (q : I ↪o DenseTime) : Kernel α (I → α) := diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/AllTimeMarginals.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/AllTimeMarginals.lean index e8cb4d0030..4e515b9121 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/AllTimeMarginals.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/AllTimeMarginals.lean @@ -25,7 +25,7 @@ and Feller `C₀`-orbit continuity on the other. No continuous-time Markov, strong Markov, or Hunt-process assertion is made here. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/Basic.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/Basic.lean index ab27d2c25a..c5ed8438db 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/Basic.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/Basic.lean @@ -21,7 +21,7 @@ No continuous-time Markov property, strong Markov property, Hunt-process asserti increment estimate is claimed. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -40,6 +40,7 @@ variable {alpha : Type*} [MetricSpace alpha] [CompleteSpace alpha] /-- The canonical dense-time trajectory transported through the measurable continuous-extension map. Under the Kolmogorov hypothesis used below, its law is independent of `default`. -/ +@[expose] def continuousPathTrajectory (P : SubMarkovKernelSemigroup alpha) (hP : P.IsConservative) (default : ContinuousPath alpha) : Kernel alpha (ContinuousPath alpha) := diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/ClampedCoordinate.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/ClampedCoordinate.lean index 28663bacb9..0977ac7d0d 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/ClampedCoordinate.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/ClampedCoordinate.lean @@ -20,7 +20,7 @@ Main result: `ContinuousPath.measurable_clampedCoordinate`. No stochastic-process law or stopping-time identity is asserted. -/ -@[expose] public section +public section open MeasureTheory open scoped NNReal diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/Convergence.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/Convergence.lean index 58e6e1d6d1..5b5972467e 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/Convergence.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/Convergence.lean @@ -32,7 +32,7 @@ Convergence of the finite-dimensional distributions is not convergence on path s in addition a tightness estimate for the family of laws; that is not asserted here. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/CylinderAlgebra.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/CylinderAlgebra.lean index 4293e16ff4..e614e17b14 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/CylinderAlgebra.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/CylinderAlgebra.lean @@ -37,7 +37,7 @@ Main results: Nothing here mentions a probability law, and no continuity in a starting point is asserted. -/ -@[expose] public section +public section open scoped BoundedContinuousFunction NNReal ZeroAtInfty @@ -51,11 +51,13 @@ variable {alpha : Type*} [TopologicalSpace alpha] /-- A functional of a continuous path that reads finitely many times and applies a bounded continuous function to the values read. -/ +@[expose] def IsBoundedCylinder (G : ContinuousPath alpha → ℝ) : Prop := ∃ (I : Finset ℝ≥0) (g : (I → alpha) →ᵇ ℝ), ∀ omega, G omega = g (finsetEvaluation I omega) /-- Restriction of a family of states indexed by a finite set of times to a smaller set. -/ +@[expose] def finsetRestrict {I J : Finset ℝ≥0} (hIJ : I ⊆ J) : C(J → alpha, I → alpha) := ⟨fun path i ↦ path ⟨(i : ℝ≥0), hIJ i.2⟩, continuous_pi fun i ↦ continuous_apply (⟨(i : ℝ≥0), hIJ i.2⟩ : J)⟩ diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/DenseRestrictionIntegral.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/DenseRestrictionIntegral.lean index 25bcdda827..c9b7d91bb2 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/DenseRestrictionIntegral.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/DenseRestrictionIntegral.lean @@ -23,7 +23,7 @@ stopping-time statement is proved here; those are in `Trajectory/FellerCondition `Trajectory/FellerStoppingConditional.lean`. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/DenseRestrictionMarginals.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/DenseRestrictionMarginals.lean index 1de0a16de2..5f1fb34473 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/DenseRestrictionMarginals.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/DenseRestrictionMarginals.lean @@ -16,7 +16,7 @@ are the existing finite-set kernels, reindexed from physical time back to ration file makes no shift, Markov, strong Markov, or Hunt-process assertion. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/DenseStoppingRestart.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/DenseStoppingRestart.lean index 0927542643..e055bf6c64 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/DenseStoppingRestart.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/DenseStoppingRestart.lean @@ -23,7 +23,7 @@ in `Trajectory/FellerStoppingConditional.lean`, and a stopping time that may be `Trajectory/StoppingLtTop.lean`. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/DiscountedDynkin.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/DiscountedDynkin.lean index c35a3398cd..196b26ebfc 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/DiscountedDynkin.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/DiscountedDynkin.lean @@ -33,7 +33,7 @@ Main results: `IsFellerKernelSemigroup.discountedDynkinProcess`, No assertion is made at an unbounded stopping time or about passage to an infinite horizon. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -52,6 +52,7 @@ variable {P : SubMarkovKernelSemigroup alpha} section ProcessDefinition /-- The discounted Dynkin process associated with a generator-domain function. -/ +@[expose] def IsFellerKernelSemigroup.discountedDynkinProcess (hFeller : P.IsFellerKernelSemigroup) (f : hFeller.c0Semigroup.generatorDomain) (lam : ℝ) (t : NNReal) (omega : ContinuousPath alpha) : ℝ := diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/Dynkin.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/Dynkin.lean index ad0c44b056..36edcc1bfe 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/Dynkin.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/Dynkin.lean @@ -29,7 +29,7 @@ integral in `C₀` to a pointwise integral; `evalC0CLM` is the same functional u name, kept for consumers. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter open scoped ENNReal NNReal ZeroAtInfty @@ -41,6 +41,7 @@ section Eval variable {alpha : Type*} [TopologicalSpace alpha] /-- Evaluation at a point, as a continuous linear functional on `C₀(α, ℝ)`. -/ +@[expose] noncomputable def evalC0CLM (x : alpha) : C₀(alpha, ℝ) →L[ℝ] ℝ := LinearMap.mkContinuous { toFun := fun f ↦ f x diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/DynkinMartingale.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/DynkinMartingale.lean index 07843c0546..22c6c051ef 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/DynkinMartingale.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/DynkinMartingale.lean @@ -44,7 +44,7 @@ The exponentially discounted extension is developed in `Trajectory/DiscountedDyn its zero-discount process is identified with this one by `discountedDynkinProcess_zero`. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -77,6 +77,7 @@ section Definition `f (omega t)` corrected by the time integral `∫₀ᵗ (L f) (omega s) ds` of the generator along the path. Under the continuous-path process of `P` this is a martingale (`martingale_dynkinProcess`). -/ +@[expose] def IsFellerKernelSemigroup.dynkinProcess (hFeller : P.IsFellerKernelSemigroup) (f : hFeller.c0Semigroup.generatorDomain) (t : NNReal) (omega : ContinuousPath alpha) : ℝ := (f : C₀(alpha, ℝ)) (omega t) - diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/DynkinStopping.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/DynkinStopping.lean index ae196ae103..698e7531df 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/DynkinStopping.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/DynkinStopping.lean @@ -39,7 +39,7 @@ The progressive-measurability and optional-stopping statements below are the zer specializations of the corresponding results in `Trajectory/DiscountedDynkin.lean`. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/Equivariance.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/Equivariance.lean index 9f4e6c6c6a..e8361d7e5b 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/Equivariance.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/Equivariance.lean @@ -38,7 +38,7 @@ No scaling limit is asserted: `c` is a fixed positive factor and both semigroups advance. The two state spaces may coincide; the degenerate corollaries are stated on one space. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -55,6 +55,7 @@ variable {alpha beta gamma : Type*} [TopologicalSpace alpha] [TopologicalSpace b [TopologicalSpace gamma] /-- Multiplication of nonnegative time by a fixed factor, as a continuous self-map of `NNReal`. -/ +@[expose] def timeScaling (c : NNReal) : C(NNReal, NNReal) where toFun t := c * t continuous_toFun := continuous_const.mul continuous_id @@ -65,6 +66,7 @@ theorem timeScaling_apply (c t : NNReal) : timeScaling c t = c * t := rfl /-- Speed a continuous path up by the factor `c` and conjugate its state by the homeomorphism `e`. -/ +@[expose] def rescale (e : alpha ≃ₜ beta) (c : NNReal) (omega : ContinuousPath alpha) : ContinuousPath beta := (e : C(alpha, beta)).comp (omega.comp (timeScaling c)) diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/ExcessiveStopping.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/ExcessiveStopping.lean index 75b74ce97b..11c5396cad 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/ExcessiveStopping.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/ExcessiveStopping.lean @@ -31,7 +31,7 @@ Main results: `IsFellerKernelSemigroup.resolvent_isLambdaExcessive`, No converse characterization of excessive functions is asserted. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/ExitLaw.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/ExitLaw.lean index 4107f2a9bc..2c64e89afb 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/ExitLaw.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/ExitLaw.lean @@ -30,7 +30,7 @@ The harmonic representation of `Trajectory/HarmonicRepresentation.lean` reads, i (`integral_exitLawTrunc_eq_of_generator_eq_zero`). -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter open scoped ENNReal NNReal ZeroAtInfty diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/ExitTimeExponentialMoment.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/ExitTimeExponentialMoment.lean index 4a98af30c9..75e54ecacf 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/ExitTimeExponentialMoment.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/ExitTimeExponentialMoment.lean @@ -44,7 +44,7 @@ Every statement is an inequality of `ℝ≥0∞`-valued integrals; no integrabil no real-valued restatement appears. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/ExitTimeLaplace.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/ExitTimeLaplace.lean index f6f4f531d4..2a8d160b4c 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/ExitTimeLaplace.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/ExitTimeLaplace.lean @@ -24,7 +24,7 @@ Main results: `IsConservative.lintegral_exp_neg_exitTime` and No moment bound or almost-sure finiteness of the exit time is asserted. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/ExpectedExitTime.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/ExpectedExitTime.lean index 1b1752ef2c..c9de029839 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/ExpectedExitTime.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/ExpectedExitTime.lean @@ -28,7 +28,7 @@ It also records that the truncated exit time of `Path/ExitTime.lean` is the gene `ContinuousPath.iSup_exitTimeTrunc : ⨆ n, exitTimeTrunc U n ω = exitTime U ω`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter open scoped ENNReal NNReal ZeroAtInfty diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FellerConditional.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FellerConditional.lean index 63de9f1cf3..4e7f6d1c90 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FellerConditional.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FellerConditional.lean @@ -22,7 +22,7 @@ The time here is deterministic. The corresponding statement at a finite stoppin `Trajectory/StoppingLtTop.lean`. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FellerCountableStoppingRestart.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FellerCountableStoppingRestart.lean index 19e589dbd4..af7c4d8cc0 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FellerCountableStoppingRestart.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FellerCountableStoppingRestart.lean @@ -23,7 +23,7 @@ The stopping time here has countable range. An arbitrary finite stopping time i `Trajectory/StoppingLtTop.lean`. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FellerFiniteMarginals.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FellerFiniteMarginals.lean index 51e06a8a93..5f095263e5 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FellerFiniteMarginals.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FellerFiniteMarginals.lean @@ -20,7 +20,7 @@ The theorem is stated for an arbitrary such semigroup; no particular semigroup i and no Hunt-process property is asserted. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FellerRestrictedRestart.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FellerRestrictedRestart.lean index d09e7ace47..0a660b0ffb 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FellerRestrictedRestart.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FellerRestrictedRestart.lean @@ -27,7 +27,7 @@ The time here is deterministic. The strong Markov property at a finite stopping `Trajectory/FellerStoppingRestart.lean`. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FellerShift.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FellerShift.lean index 4004e8c57b..de979273aa 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FellerShift.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FellerShift.lean @@ -24,7 +24,7 @@ This is an unconditional kernel-law identity. The conditional form is in `Trajectory/FellerStoppingRestart.lean`; no Hunt-process property is asserted. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FellerStoppingConditional.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FellerStoppingConditional.lean index eabcdbde74..3d86303a94 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FellerStoppingConditional.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FellerStoppingConditional.lean @@ -24,7 +24,7 @@ infinite is covered, on the event where it is finite, in `Trajectory/StoppingLtT Hunt-process property is asserted. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FellerStoppingRestart.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FellerStoppingRestart.lean index fcda179460..b4e91cd71d 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FellerStoppingRestart.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FellerStoppingRestart.lean @@ -28,7 +28,7 @@ infinite is covered, on the event where it is finite, in `Trajectory/StoppingLtT Hunt-process property is asserted. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FeynmanKacFunctional.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FeynmanKacFunctional.lean index 1b8ddc6766..ac03f9b58a 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FeynmanKacFunctional.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FeynmanKacFunctional.lean @@ -29,7 +29,7 @@ Main results: `feynmanKacAdditiveFunctional`, The resolvent and perturbation identities are developed in `Trajectory/FeynmanKacResolvent.lean`. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -43,6 +43,7 @@ section variable {alpha : Type*} [MetricSpace alpha] [MeasurableSpace alpha] [BorelSpace alpha] /-- The accumulated potential along a continuous path up to time `t`. -/ +@[expose] def feynmanKacAdditiveFunctional (q : alpha → ℝ) (t : NNReal) (omega : ContinuousPath alpha) : ℝ := ∫ s in (0 : ℝ)..t, q (omega (Real.toNNReal s)) @@ -299,6 +300,7 @@ variable [CompleteSpace alpha] [Nonempty alpha] [LocallyCompactSpace alpha] variable (P : SubMarkovKernelSemigroup alpha) (hP : P.IsConservative) /-- The real-valued Feynman--Kac operator associated with a potential. -/ +@[expose] def IsConservative.feynmanKac (q : alpha → ℝ) (t : NNReal) (f : alpha → ℝ) (x : alpha) : ℝ := ∫ omega, Real.exp (-feynmanKacAdditiveFunctional q t omega) * f (omega t) @@ -390,6 +392,7 @@ theorem IsConservative.feynmanKac_one_le_one {q : alpha → ℝ} (hq0 : ∀ y, 0 IsConservative.feynmanKac_le P hP hq0 (fun _ ↦ zero_le_one) (fun _ ↦ le_rfl) x /-- The nonnegative-extended-real Feynman--Kac operator. -/ +@[expose] def IsConservative.feynmanKacENNReal (q : alpha → ℝ) (t : NNReal) (f : alpha → ℝ≥0∞) (x : alpha) : ℝ≥0∞ := ∫⁻ omega, ENNReal.ofReal (Real.exp (-feynmanKacAdditiveFunctional q t omega)) * diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FeynmanKacRealResolvent.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FeynmanKacRealResolvent.lean index 000a745af1..fde13f7efb 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FeynmanKacRealResolvent.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FeynmanKacRealResolvent.lean @@ -29,7 +29,7 @@ Feynman--Kac resolvent among bounded measurable resolvent families solving the s equation at all sufficiently large shifts. No model-specific realization is assumed. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FeynmanKacResolvent.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FeynmanKacResolvent.lean index 05d73ec576..8020f8d6a5 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FeynmanKacResolvent.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FeynmanKacResolvent.lean @@ -29,7 +29,7 @@ Main results: `IsConservative.feynmanKacResolvent`, No uniqueness statement for the associated resolvent equation is asserted. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -47,6 +47,7 @@ variable {alpha : Type*} [MetricSpace alpha] [MeasurableSpace alpha] [BorelSpace variable (P : SubMarkovKernelSemigroup alpha) (hP : P.IsConservative) /-- The Feynman--Kac resolvent, obtained by Laplace-transforming the extended-real operators. -/ +@[expose] def IsConservative.feynmanKacResolvent (q : alpha → ℝ) (lam : ℝ) (f : alpha → ℝ≥0∞) (x : alpha) : ℝ≥0∞ := ∫⁻ t in Ioi (0 : ℝ), ENNReal.ofReal (Real.exp (-lam * t)) * diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FiniteMarginals.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FiniteMarginals.lean index 1e9cde23cd..513fa1a597 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FiniteMarginals.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/FiniteMarginals.lean @@ -19,7 +19,7 @@ No assertion is made at irrational times or about a Markov, strong Markov, or Hu the continuous-path law. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -32,6 +32,7 @@ namespace SubMarkovKernelSemigroup section /-- The finite set of physical nonnegative-real times represented by rational times in `I`. -/ +@[expose] def denseTimePhysicalSet (I : Finset DenseTime) : Finset NNReal := I.map DenseTime.castOrderEmbedding.toEmbedding diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/HarmonicRepresentation.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/HarmonicRepresentation.lean index d1d07d7bc8..e45473e5b2 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/HarmonicRepresentation.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/HarmonicRepresentation.lean @@ -30,7 +30,7 @@ The integrand of Dynkin's formula is only ever evaluated strictly before the exi path is inside `U`; this is the observation behind all three statements. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter open scoped ENNReal NNReal ZeroAtInfty diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/PathModulus.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/PathModulus.lean index 6262234364..e0fb65ab01 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/PathModulus.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/PathModulus.lean @@ -37,7 +37,7 @@ Main results: No tightness, weak continuity, or Hölder-path statement is proved here. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/PathTightness.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/PathTightness.lean index 3e44527735..a7c30ed882 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/PathTightness.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/PathTightness.lean @@ -40,7 +40,7 @@ No compactness theorem for measures (Prokhorov's theorem) is proved or used, and convergence statement is made here. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/PenalizationDomination.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/PenalizationDomination.lean index f5a69bb5b5..d9d47a432f 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/PenalizationDomination.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/PenalizationDomination.lean @@ -20,7 +20,7 @@ Polish space. Main result: `IsFellerKernelSemigroup.killedResolvent_le_of_perturbed_resolventFamily`. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/RationalConditional.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/RationalConditional.lean index 6363a63cd2..73646c5db8 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/RationalConditional.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/RationalConditional.lean @@ -23,7 +23,7 @@ The times here are rational. The strong Markov property at an arbitrary finite is in `Trajectory/FellerStoppingRestart.lean`. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/RationalShift.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/RationalShift.lean index 2a0212401c..dcd2e626ab 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/RationalShift.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/RationalShift.lean @@ -21,7 +21,7 @@ uniqueness on the dense product path space and injectivity of dense restriction. unconditional law identity; conditional and strong Markov statements require additional work. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/ResolventExitDecomposition.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/ResolventExitDecomposition.lean index 0a69590b8a..94830af2a2 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/ResolventExitDecomposition.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/ResolventExitDecomposition.lean @@ -26,7 +26,7 @@ Main definitions and results: `ContinuousPath.pathResolvent`, No integrability or almost-sure finiteness of the exit time is asserted. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -44,6 +44,7 @@ variable {alpha : Type*} [MetricSpace alpha] [CompleteSpace alpha] [LocallyCompactSpace alpha] /-- The discounted occupation of a nonnegative extended observable along one continuous path. -/ +@[expose] def pathResolvent (lam : ℝ) (f : alpha → ℝ≥0∞) (omega : ContinuousPath alpha) : ℝ≥0∞ := ∫⁻ t in Set.Ioi (0 : ℝ), ENNReal.ofReal (Real.exp (-lam * t)) * diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/StartingPointContinuity.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/StartingPointContinuity.lean index f616db5f2e..29b8fd94cd 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/StartingPointContinuity.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/StartingPointContinuity.lean @@ -43,7 +43,7 @@ space; that needs tightness on path space itself, which is not proved here. No a stopping time that can be infinite. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/StoppingLtTop.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/StoppingLtTop.lean index ca004df470..70b2a77398 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/StoppingLtTop.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/StoppingLtTop.lean @@ -37,7 +37,7 @@ Nothing is asserted about the event `{tau = ⊤}`: on it the shifted path is the neither statement constrains it. No Hunt-process property is claimed. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -148,6 +148,7 @@ variable {Omega : Type*} {mOmega : MeasurableSpace Omega} /-- A `WithTop ℝ≥0`-valued time truncated at the deterministic horizon `K`: the finite, `ℝ≥0`-valued time equal to `tau omega` when that is at most `K`, and to `K` otherwise. -/ +@[expose] def truncTime (tau : Omega → WithTop NNReal) (K : NNReal) (omega : Omega) : NNReal := (min (tau omega) (K : WithTop NNReal)).untopD 0 diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/WeakContinuity.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/WeakContinuity.lean index d4d50912c1..7083768a42 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/WeakContinuity.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/WeakContinuity.lean @@ -41,7 +41,7 @@ Nothing here asserts relative compactness of a family of laws, and no convergenc of semigroups is treated. -/ -@[expose] public section +public section noncomputable section PortComputability @@ -183,6 +183,7 @@ theorem IsFellerKernelSemigroup.continuous_integral_continuousProcess linarith [htri1, htri2, h1, h2', hxnear] /-- The law of the continuous-path process, read as a probability measure on path space. -/ +@[expose] def IsConservative.pathLaw (x : alpha) : ProbabilityMeasure (ContinuousPath alpha) := ⟨continuousProcess P hP x, inferInstance⟩ diff --git a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/WeakConvergence.lean b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/WeakConvergence.lean index 5d95f393b0..76255e46bb 100644 --- a/LeanPool/MarkovProcess/MarkovProcess/Trajectory/WeakConvergence.lean +++ b/LeanPool/MarkovProcess/MarkovProcess/Trajectory/WeakConvergence.lean @@ -43,7 +43,7 @@ when the constants are allowed to vary, nor for a family whose limit is not itse a Feller semigroup. -/ -@[expose] public section +public section noncomputable section PortComputability diff --git a/LeanPool/MarshallHall.lean b/LeanPool/MarshallHall.lean index 2d3c8c86c9..707e1f59fc 100644 --- a/LeanPool/MarshallHall.lean +++ b/LeanPool/MarshallHall.lean @@ -44,4 +44,4 @@ Tags: group-theory MSC: 20E07, 20F65, 05C25 -/ -@[expose] public section +public section diff --git a/LeanPool/MarshallHall/LERFSolution.lean b/LeanPool/MarshallHall/LERFSolution.lean index 2a259e0171..8443e577a5 100644 --- a/LeanPool/MarshallHall/LERFSolution.lean +++ b/LeanPool/MarshallHall/LERFSolution.lean @@ -17,7 +17,7 @@ the Challenge boundary so the Comparator sees the explicit finite action, not only its finite-index stabilizer corollary. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MarshallHall/MarshallHall.lean b/LeanPool/MarshallHall/MarshallHall.lean index 37f93ae350..6cbb3ef793 100644 --- a/LeanPool/MarshallHall/MarshallHall.lean +++ b/LeanPool/MarshallHall/MarshallHall.lean @@ -29,7 +29,7 @@ free-group Grushko rank calculations, and the factorwise infrastructure for the arbitrary-factor theorem. -/ -@[expose] public section +public section diff --git a/LeanPool/MarshallHall/MarshallHall/Completion.lean b/LeanPool/MarshallHall/MarshallHall/Completion.lean index 5d9fea815f..9907555ac2 100644 --- a/LeanPool/MarshallHall/MarshallHall/Completion.lean +++ b/LeanPool/MarshallHall/MarshallHall/Completion.lean @@ -19,7 +19,7 @@ left-coset action. The resulting graph is the finite core used in the completion argument. -/ -@[expose] public section +public section open Set Function open CategoryTheory CategoryTheory.ActionCategory CategoryTheory.SingleObj Quiver FreeGroup @@ -33,12 +33,14 @@ variable {α : Type u} [DecidableEq α] /-- The group element underlying a morphism in the action groupoid. -/ +@[expose] def actionScalar {O : Type u} [MulAction (FreeGroup α) O] {a b : ActionCategory (FreeGroup α) O} (f : Functor.Elements.Hom (F := actionAsFunctor (FreeGroup α) O) a b) : FreeGroup α := f.hom /-- A generator edge whose scalar action agrees with the prescribed map to left cosets. -/ +@[expose] def goodGeneratorEdge (H : Subgroup (FreeGroup α)) {O : Type u} [MulAction (FreeGroup α) O] [IsFreeGroupoid (ActionCategory (FreeGroup α) O)] @@ -49,6 +51,7 @@ def goodGeneratorEdge (H : Subgroup (FreeGroup α)) {O : Type u} a.back) = q b.back /-- The coset-compatibility condition for a generator edge or its formal reverse. -/ +@[expose] def goodSymmetricEdge (H : Subgroup (FreeGroup α)) {O : Type u} [MulAction (FreeGroup α) O] [IsFreeGroupoid (ActionCategory (FreeGroup α) O)] @@ -60,6 +63,7 @@ def goodSymmetricEdge (H : Subgroup (FreeGroup α)) {O : Type u} (fun f => goodGeneratorEdge H q f) /-- The wide subquiver consisting of coset-compatible edges and their formal reverses. -/ +@[expose] def goodSymmetricSubquiver (H : Subgroup (FreeGroup α)) {O : Type u} [MulAction (FreeGroup α) O] [IsFreeGroupoid (ActionCategory (FreeGroup α) O)] @@ -72,6 +76,7 @@ def goodSymmetricSubquiver (H : Subgroup (FreeGroup α)) {O : Type u} to the full edge type so that it can be used by the explicit Schreier basis. -/ /-- The shortest-path tree of a rooted subquiver, viewed as edges of the ambient quiver. -/ +@[expose] def flatGeodesicSubtree {V : Type u} [Quiver V] (P : WideSubquiver V) (r : P) [RootedConnected r] : WideSubquiver V := @@ -101,6 +106,7 @@ instance flatGeodesicArborescence {V : Type u} [Quiver V] · exact Or.inr ⟨_, ⟨e.1, ⟨e.2, p, hp⟩⟩⟩ /-- Every action state of every tail of the word maps to a coset in the chosen core. -/ +@[expose] def coreCondition {H : Subgroup (FreeGroup α)} (A : Set (LeftCosetQuotient H)) (u : List (α × Bool)) : Prop := ∀ v ∈ List.tails u, ∀ x ∈ actionStates v, diff --git a/LeanPool/MarshallHall/MarshallHall/CoreSupport.lean b/LeanPool/MarshallHall/MarshallHall/CoreSupport.lean index 20fad9566a..9f71053e3a 100644 --- a/LeanPool/MarshallHall/MarshallHall/CoreSupport.lean +++ b/LeanPool/MarshallHall/MarshallHall/CoreSupport.lean @@ -17,7 +17,7 @@ finite set of generator edges. The lemmas below make that geometric fact visible in the free basis supplied by a spanning tree. -/ -@[expose] public section +public section open Set Function open CategoryTheory CategoryTheory.SingleObj Quiver FreeGroup @@ -33,6 +33,7 @@ variable {G : Type u} [Groupoid.{u} G] [IsFreeGroupoid G] /-- Evaluate a path of generators and formal inverses as a morphism of the free groupoid. -/ +@[expose] def symPathHom {a : Symmetrify (IsFreeGroupoid.Generators G)} : ∀ {b : Symmetrify (IsFreeGroupoid.Generators G)}, Path a b → ((show G from a) ⟶ b) @@ -48,6 +49,7 @@ theorem symPathHom_nil {a : Symmetrify (IsFreeGroupoid.Generators G)} : symPathHom (Path.nil : Path a a) = 𝟙 (show G from a) := rfl /-- The non-tree basis edges that lie in a prescribed set of generator edges. -/ +@[expose] def basisSupport {T : WideSubquiver (Symmetrify (IsFreeGroupoid.Generators G))} (P : Set (Quiver.Total (IsFreeGroupoid.Generators G))) : Set ((wideSubquiverEquivSetTotal (wideSubquiverSymmetrify T))ᶜ : @@ -55,6 +57,7 @@ def basisSupport {T : WideSubquiver (Symmetrify (IsFreeGroupoid.Generators G))} {e | e.1 ∈ P} /-- View a path in a wide subquiver as a path in the ambient quiver. -/ +@[expose] def forgetSubquiverPath {V : Type u} [Quiver V] {P : WideSubquiver V} {a b : P} : @Path P P.quiver a b → @Path V inferInstance (a : V) (b : V) | Path.nil => Path.nil @@ -86,6 +89,7 @@ theorem symPathHom_forget_cast_apply rfl /-- The underlying positive generator edge of a symmetrified edge, forgetting its orientation. -/ +@[expose] def positiveEdgeOfSym {a b : Symmetrify (IsFreeGroupoid.Generators G)} (e : a ⟶ b) : Quiver.Total (IsFreeGroupoid.Generators G) := match e with @@ -93,6 +97,7 @@ def positiveEdgeOfSym {a b : Symmetrify (IsFreeGroupoid.Generators G)} | Sum.inr f => ⟨b, a, f⟩ /-- Retract an element onto the subgroup generated by a chosen subset of a free basis. -/ +@[expose] def retractBasisElement {X K : Type u} [Group K] (B : FreeGroupBasis X K) (Y : Set X) (z : K) : K := subsetBasisHom B Y (basisRetraction Y (B.repr z)) diff --git a/LeanPool/MarshallHall/MarshallHall/FiniteCore.lean b/LeanPool/MarshallHall/MarshallHall/FiniteCore.lean index 86e02367b3..43ee84d14e 100644 --- a/LeanPool/MarshallHall/MarshallHall/FiniteCore.lean +++ b/LeanPool/MarshallHall/MarshallHall/FiniteCore.lean @@ -18,7 +18,7 @@ that appears in the usual folded covering-graph proof, but expressed directly in the free group. -/ -@[expose] public section +public section open Function @@ -34,15 +34,18 @@ variable [DecidableEq α] /-- The free-group element represented by a letter, with `true` denoting the positive sign. -/ +@[expose] def signedLetter (x : α × Bool) : FreeGroup α := if x.2 then FreeGroup.of x.1 else (FreeGroup.of x.1)⁻¹ /-- The product in the free group represented by a list of signed letters. -/ +@[expose] def wordValue : List (α × Bool) → FreeGroup α | [] => 1 | x :: w => signedLetter x * wordValue w /-- The successive states obtained by evaluating the word from its rightmost letter. -/ +@[expose] def actionStates : List (α × Bool) → List (FreeGroup α) | [] => [1] | x :: w => actionStates w ++ [signedLetter x * wordValue w] @@ -147,6 +150,7 @@ the finitely many words under consideration. -/ /-- The finite core containing action states of the subgroup generators and the separating word. -/ +@[expose] def corePoints [DecidableEq (FreeGroup α)] (S : Finset (FreeGroup α)) (g : FreeGroup α) : Finset (FreeGroup α) := S.biUnion (fun s => (allActionStates s.toWord)) ∪ allActionStates g.toWord diff --git a/LeanPool/MarshallHall/MarshallHall/FreeFactor.lean b/LeanPool/MarshallHall/MarshallHall/FreeFactor.lean index acda8cb24d..5de2d37955 100644 --- a/LeanPool/MarshallHall/MarshallHall/FreeFactor.lean +++ b/LeanPool/MarshallHall/MarshallHall/FreeFactor.lean @@ -19,7 +19,7 @@ for the free-factor conclusion: the left coproduct injection must be the subgroup inclusion itself. -/ -@[expose] public section +public section universe u @@ -59,6 +59,7 @@ structure MarshallHallWitness {F : Type u} [Group F] (H : Subgroup F) where inclusion : ∀ h : H, equiv (Monoid.Coprod.inl h) = ⟨h.1, hHK h.2⟩ /-- Identify a subgroup with its pullback along the inclusion of an overgroup. -/ +@[expose] def subgroupComapEquiv {F : Type u} [Group F] (H K : Subgroup F) (hHK : H ≤ K) : H ≃* Subgroup.comap K.subtype H := @@ -89,22 +90,26 @@ def FreeFactorWitness.pullback /-- The subgroup admits a complementary group giving an inclusion-compatible free-product decomposition. -/ +@[expose] def IsFreeFactor {K : Type u} [Group K] (H : Subgroup K) : Prop := Nonempty (FreeFactorWitness H) /-- The subgroup generated by a chosen subset of a free basis. -/ +@[expose] def generatedByBasis {X K : Type u} [Group K] (B : FreeGroupBasis X K) (Y : Set X) : Subgroup K := Subgroup.closure (B '' Y) /-- The canonical homomorphism from the free group on the selected basis elements to their generated subgroup. -/ +@[expose] def subsetBasisHom {X K : Type u} [Group K] (B : FreeGroupBasis X K) (Y : Set X) : FreeGroup Y →* generatedByBasis B Y := FreeGroup.lift (fun y => ⟨B y, Subgroup.subset_closure ⟨y, y.2, rfl⟩⟩) /-- The free-group retraction that keeps selected generators and sends all other generators to the identity. -/ +@[expose] def basisRetraction {X : Type u} (Y : Set X) : FreeGroup X →* FreeGroup Y := by classical diff --git a/LeanPool/MarshallHall/MarshallHall/GraphBasis.lean b/LeanPool/MarshallHall/MarshallHall/GraphBasis.lean index f30e7f189b..fb5ed4e29d 100644 --- a/LeanPool/MarshallHall/MarshallHall/GraphBasis.lean +++ b/LeanPool/MarshallHall/MarshallHall/GraphBasis.lean @@ -19,7 +19,7 @@ the core construction uses; the generic Nielsen--Schreier instance instead uses the whole free group as a generator synonym. -/ -@[expose] public section +public section open Set Function open CategoryTheory CategoryTheory.ActionCategory CategoryTheory.SingleObj Quiver FreeGroup @@ -35,7 +35,7 @@ abbrev CoverVertex (α : Type u) (A : Type u) [MulAction (FreeGroup α) A] := ActionCategory (FreeGroup α) A /-- The generator-labelled covering quiver, supplied explicitly to preserve categorical arrows. -/ -@[instance_reducible] +@[instance_reducible, expose] def coverQuiver (α : Type u) (A : Type u) [MulAction (FreeGroup α) A] : Quiver (CoverVertex α A) where Hom x y := {e : α // FreeGroup.of e • x.back = y.back} @@ -43,7 +43,7 @@ def coverQuiver (α : Type u) (A : Type u) [MulAction (FreeGroup α) A] : /-! The action groupoid is free for this explicit labelled generating quiver. -/ /-- The free-group action groupoid is free on its generator-labelled covering quiver. -/ -@[reducible] +@[reducible, expose] def freeActionGroupoidIsFree (α : Type u) (A : Type u) [MulAction (FreeGroup α) A] : IsFreeGroupoid (ActionCategory (FreeGroup α) A) where @@ -110,6 +110,7 @@ but keeps the edge type explicit for later core-support statements. -/ /-- The root of a spanning tree, viewed as an object of the underlying groupoid. -/ +@[expose] def spanningTreeRoot {G : Type u} [Groupoid.{u} G] [IsFreeGroupoid G] (T : WideSubquiver (Symmetrify (IsFreeGroupoid.Generators G))) [Arborescence T] : G := root T diff --git a/LeanPool/MarshallHall/MarshallHall/Grushko.lean b/LeanPool/MarshallHall/MarshallHall/Grushko.lean index fa91f2a2ef..a05571ca29 100644 --- a/LeanPool/MarshallHall/MarshallHall/Grushko.lean +++ b/LeanPool/MarshallHall/MarshallHall/Grushko.lean @@ -23,7 +23,7 @@ calculation is obtained from abelianization, so the result is not merely a cardinality calculation transported through an unproved presentation. -/ -@[expose] public section +public section universe u @@ -150,6 +150,7 @@ theorem binaryFreeProductEquiv_inl {α β : Type u} (x : FreeGroup α) : exact congrArg (fun f : FreeGroup α →* FreeGroup (α ⊕ β) => f x) hmap /-- The image of a free-group element in the free abelian group on its generators. -/ +@[expose] def abelianizedValue {α : Type u} (x : FreeGroup α) : FreeAbelianGroup α := Additive.ofMul (Abelianization.of x) diff --git a/LeanPool/MarshallHall/MarshallHall/GrushkoEdge.lean b/LeanPool/MarshallHall/MarshallHall/GrushkoEdge.lean index 0e22c90cb7..766bddf5b7 100644 --- a/LeanPool/MarshallHall/MarshallHall/GrushkoEdge.lean +++ b/LeanPool/MarshallHall/MarshallHall/GrushkoEdge.lean @@ -19,7 +19,7 @@ argument, including the cardinality bound needed to pad a terminal marking back to its original length. -/ -@[expose] public section +public section @@ -41,6 +41,7 @@ variable {G H : Type u} [Group G] [Group H] /-- Reversal has no fixed oriented edge. Rose and fold constructions will provide this property explicitly; keeping it as a hypothesis avoids silently identifying a self-reversing quiver arrow with a geometric edge pair. -/ +@[expose] def ReverseFree : Prop := ∀ e : AllArrow (V := V), allArrowReverse e ≠ e @@ -60,6 +61,7 @@ noncomputable def allArrowIndex (e : AllArrow (V := V)) : Fintype.equivFin (AllArrow (V := V)) e /-- The orientation of each edge with the smaller index than its reverse. -/ +@[expose] def EdgeRepresentative := {e : AllArrow (V := V) // (allArrowIndex e).val < diff --git a/LeanPool/MarshallHall/MarshallHall/GrushkoFold.lean b/LeanPool/MarshallHall/MarshallHall/GrushkoFold.lean index 66e98b3eb2..202b22d118 100644 --- a/LeanPool/MarshallHall/MarshallHall/GrushkoFold.lean +++ b/LeanPool/MarshallHall/MarshallHall/GrushkoFold.lean @@ -18,7 +18,7 @@ argument. The proof is deliberately phrased using `List.splitBy`, so the maximality and the alternating boundary conditions are explicit. -/ -@[expose] public section +public section open Function Monoid.Coprod diff --git a/LeanPool/MarshallHall/MarshallHall/GrushkoFoldStep.lean b/LeanPool/MarshallHall/MarshallHall/GrushkoFoldStep.lean index fbd1fcd0bf..b33e4b926c 100644 --- a/LeanPool/MarshallHall/MarshallHall/GrushkoFoldStep.lean +++ b/LeanPool/MarshallHall/MarshallHall/GrushkoFoldStep.lean @@ -19,7 +19,7 @@ construction at the type level. The path substitution and its label theorem will be added on top of these finite quotient and deletion primitives. -/ -@[expose] public section +public section @@ -35,6 +35,7 @@ universe u v variable {V : Type u} [Fintype V] /-- The equivalence relation generated by identifying two vertices. -/ +@[expose] def foldSetoid (a b : V) : Setoid V := Relation.EqvGen.setoid (fun x y => x = a ∧ y = b) @@ -63,6 +64,7 @@ theorem foldQuotient_card_lt {a b : V} (hab : a ≠ b) : /-- Remove both orientations of one geometric edge from a finite oriented edge type. -/ +@[expose] def deletedEdge (E : Type v) (e₀ e₀' : E) := {e : E // e ≠ e₀ ∧ e ≠ e₀'} @@ -166,17 +168,21 @@ noncomputable instance allArrowFintype : Fintype (AllArrow (V := V)) := by infer_instance /-- Packages an arrow together with its source and target. -/ +@[expose] def allArrowOf {a b : V} (e : a ⟶ b) : AllArrow (V := V) := ⟨a, b, e⟩ /-- The source vertex of a packaged arrow. -/ +@[expose] def allArrowSource : AllArrow (V := V) → V | ⟨a, _b, _e⟩ => a /-- The target vertex of a packaged arrow. -/ +@[expose] def allArrowTarget : AllArrow (V := V) → V | ⟨_a, b, _e⟩ => b /-- The underlying arrow between the packaged source and target. -/ +@[expose] def allArrowHom (e : AllArrow (V := V)) : allArrowSource e ⟶ allArrowTarget e := e.2.2 @@ -200,6 +206,7 @@ theorem allArrowHom_of {a b : V} (e : a ⟶ b) : rfl /-- Reverses an arrow and exchanges its packaged endpoints. -/ +@[expose] def allArrowReverse : AllArrow (V := V) → AllArrow (V := V) | ⟨a, b, e⟩ => ⟨b, a, Quiver.reverse e⟩ @@ -237,6 +244,7 @@ theorem allArrowReverse_injective : Function.Injective simpa using congrArg (allArrowReverse (V := V)) h /-- The vertex quotient identifying the two vertices involved in a fold. -/ +@[expose] def foldVertex (a b : V) := Quotient (foldSetoid a b) noncomputable instance foldVertexFintype (a b : V) : Fintype (foldVertex a b) := by @@ -245,6 +253,7 @@ noncomputable instance foldVertexFintype (a b : V) : Fintype (foldVertex a b) := /-- Codes the identified vertices by `none` and every other vertex by its surviving representative. -/ +@[expose] noncomputable def foldCode (a b v : V) : Option (deletedEdge V a b) := by classical exact if h : v = a ∨ v = b then none @@ -295,6 +304,7 @@ theorem foldCode_eq_some_iff {a b v : V} (e : deletedEdge V a b) : exact congrArg (fun z : deletedEdge V a b => some z) hev' /-- The vertex code descended to the quotient defining a fold. -/ +@[expose] noncomputable def foldCodeQuotient (a b : V) : foldVertex a b → Option (deletedEdge V a b) := Quotient.lift (foldCode a b) (by @@ -377,21 +387,24 @@ abbrev FoldEdge (e₀ : AllArrow (V := V)) := deletedEdge (AllArrow (V := V)) e₀ (allArrowReverse e₀) /-- The canonical map from original vertices to folded vertices. -/ +@[expose] def foldVertexMk {a b : V} (v : V) : foldVertex a b := Quotient.mk (foldSetoid a b) v /-- The source of a surviving arrow in the folded vertex quotient. -/ +@[expose] def foldEdgeSource {a b : V} (e₀ : AllArrow (V := V)) (e : FoldEdge e₀) : foldVertex a b := foldVertexMk (a := a) (b := b) (allArrowSource e.1) /-- The target of a surviving arrow in the folded vertex quotient. -/ +@[expose] def foldEdgeTarget {a b : V} (e₀ : AllArrow (V := V)) (e : FoldEdge e₀) : foldVertex a b := foldVertexMk (a := a) (b := b) (allArrowTarget e.1) /-- The quiver on folded vertices whose arrows are the surviving original arrows. -/ -@[reducible] +@[reducible, expose] def foldQuiver {a b : V} (e₀ : AllArrow (V := V)) : Quiver (foldVertex a b) where Hom x y := {e : FoldEdge e₀ // @@ -520,7 +533,7 @@ def foldReverseArrow {a b : V} (e₀ : AllArrow (V := V)) {x y : foldVertex a b} exact e.2.1 /-- The involutive reversal operation inherited by the folded quiver. -/ -@[instance_reducible] +@[instance_reducible, expose] def foldHasReverse {a b : V} (e₀ : AllArrow (V := V)) : @Quiver.HasInvolutiveReverse (foldVertex a b) (foldQuiver (V := V) (a := a) (b := b) e₀) := @@ -554,6 +567,7 @@ theorem fold_allArrow_reverse_ne {a b : V} (e₀ : AllArrow (V := V)) exact he' /-- Reads the factor label of a packaged arrow. -/ +@[expose] def allArrowLabel (L : BinaryLabelling (G := G) (H := H) (V := V)) (e : AllArrow (V := V)) : Sum G H := L.label (allArrowHom e) @@ -619,6 +633,7 @@ theorem exists_separated_generators_of_markedGraph {n : ℕ} exact allArrowLabels_closure_eq_top_of_markedGraph M hgen /-- The original factor labelling restricted to the arrows surviving a fold. -/ +@[expose] def foldLabelling (L : BinaryLabelling (G := G) (H := H) (V := V)) {a b : V} (e₀ : AllArrow (V := V)) : @BinaryLabelling G H (foldVertex a b) _ _ @@ -637,6 +652,7 @@ def foldLabelling (L : BinaryLabelling (G := G) (H := H) (V := V)) /-! ### Substitution of the deleted edge by a complementary path -/ /-- A path avoids the two orientations of the edge being deleted. -/ +@[expose] def foldPathAvoid (e₀ : AllArrow (V := V)) : ∀ {x y : V}, @Quiver.Path V _ x y → Prop | _, _, Path.nil => True @@ -645,6 +661,7 @@ def foldPathAvoid (e₀ : AllArrow (V := V)) : allArrowOf e ≠ allArrowReverse e₀ /-- Maps an original arrow outside the deleted pair to its folded arrow. -/ +@[expose] def foldOrdinaryEdge {a b : V} (e₀ : AllArrow (V := V)) {x y : V} (e : x ⟶ y) (he₀ : allArrowOf e ≠ e₀) (her : allArrowOf e ≠ allArrowReverse e₀) : @@ -654,6 +671,7 @@ def foldOrdinaryEdge {a b : V} (e₀ : AllArrow (V := V)) ⟨⟨allArrowOf e, he₀, her⟩, rfl, rfl⟩ /-- Maps a path avoiding the deleted reversal pair into the folded quiver. -/ +@[expose] def foldOrdinaryPath {a b : V} (e₀ : AllArrow (V := V)) : ∀ {x y : V} (p : @Quiver.Path V _ x y), foldPathAvoid e₀ p → @@ -752,6 +770,7 @@ theorem foldOrdinaryPath_read {a b : V} (L : BinaryLabelling (G := G) from the target of the chosen edge back to its source, so `q.reverse` is the replacement for the chosen orientation and `q` is the replacement for its reverse. -/ +@[expose] def foldEdgePath {a b : V} (e₀ : AllArrow (V := V)) (ha : allArrowSource e₀ = a) {x y : V} (e : x ⟶ y) (q : @Quiver.Path V _ (allArrowTarget e₀) b) @@ -810,6 +829,7 @@ def foldEdgePath {a b : V} (e₀ : AllArrow (V := V)) (foldOrdinaryEdge (a := a) (b := b) e₀ e h h') /-- Maps arbitrary paths through a fold by replacing the deleted arrow with the specified detour. -/ +@[expose] def foldMapPath {a b : V} (e₀ : AllArrow (V := V)) (ha : allArrowSource e₀ = a) (q : @Quiver.Path V _ (allArrowTarget e₀) b) @@ -878,6 +898,7 @@ def foldSymmPath {a b : V} (e₀ : AllArrow (V := V)) /-- Forgets the formal orientation of a symmetrized arrow and records its underlying original arrow. -/ +@[expose] def symmAllArrow {x y : Symmetrify V} (e : @Quiver.Hom (Symmetrify V) (@Quiver.symmetrifyQuiver V qV) x y) : AllArrow (V := V) := @@ -905,7 +926,7 @@ theorem symmAllArrow_reverse {x y : Symmetrify V} /-- The oriented graph edge represented by a symmetrized arrow. Unlike `symmAllArrow`, this remembers whether the arrow is forward or backward. -/ -@[reducible] +@[reducible, expose] def symmOrientedArrow {x y : Symmetrify V} (e : @Quiver.Hom (Symmetrify V) (@Quiver.symmetrifyQuiver V qV) x y) : AllArrow (V := V) := @@ -953,6 +974,7 @@ theorem symmLabel_eq_allArrowLabel_oriented exact (L.reverse_label f).symm /-- A symmetrized path avoids both orientations of the deleted edge. -/ +@[expose] def foldSymmPathAvoid (e₀ : AllArrow (V := V)) : ∀ {x y : Symmetrify V}, @Quiver.Path (Symmetrify V) (@Quiver.symmetrifyQuiver V qV) x y → Prop @@ -966,6 +988,7 @@ def foldSymmPathAvoid (e₀ : AllArrow (V := V)) : /-- The underlying geometric edges traversed by a symmetrized path. The orientation is deliberately forgotten, so an edge and its reverse have the same entry. -/ +@[expose] def symmPathEdges {a : Symmetrify V} : ∀ {b : Symmetrify V}, @Quiver.Path (Symmetrify V) (@Quiver.symmetrifyQuiver V qV) a b → @@ -1094,6 +1117,7 @@ theorem foldSymmPathAvoid_cast {e₀ : AllArrow (V := V)} rfl /-- Maps a symmetrized arrow outside the deleted reversal pair into the folded quiver. -/ +@[expose] def foldSymmOrdinaryArrowPath {a b : V} (e₀ : AllArrow (V := V)) {x y : Symmetrify V} (e : @Quiver.Hom (Symmetrify V) (@Quiver.symmetrifyQuiver V qV) x y) @@ -1355,6 +1379,7 @@ def foldSymmEdgePath {a b : V} (e₀ : AllArrow (V := V)) · exact foldSymmOrdinaryArrowPath e₀ (Sum.inr f) h h' /-- Maps symmetrized paths through a fold with the chosen symmetrized detour. -/ +@[expose] def foldSymmMapPath {a b : V} (e₀ : AllArrow (V := V)) (ha : allArrowSource e₀ = a) (q : @Quiver.Path (Symmetrify V) (@Quiver.symmetrifyQuiver V qV) @@ -1611,6 +1636,7 @@ theorem foldMapPath_read {a b : V} (L : BinaryLabelling (G := G) /-! ### Marked graphs after one safe fold -/ /-- The marked graph obtained by folding and transporting its marking paths. -/ +@[expose] def foldedMarkedGraph {n : ℕ} (M : MarkedBinaryGraph (G := G) (H := H) (V := V) n) {a b : V} (e₀ : AllArrow (V := V)) @@ -1669,6 +1695,7 @@ path. The marked loops are first viewed in the symmetrized quiver, then mapped edge-by-edge through the fold. -/ /-- The marked graph obtained by folding with a symmetrized replacement path. -/ +@[expose] def foldedMarkedGraphSymm {n : ℕ} (M : MarkedBinaryGraph (G := G) (H := H) (V := V) n) {a b : V} (e₀ : AllArrow (V := V)) diff --git a/LeanPool/MarshallHall/MarshallHall/GrushkoFull.lean b/LeanPool/MarshallHall/MarshallHall/GrushkoFull.lean index 78db0e41f0..1731821a14 100644 --- a/LeanPool/MarshallHall/MarshallHall/GrushkoFull.lean +++ b/LeanPool/MarshallHall/MarshallHall/GrushkoFull.lean @@ -18,7 +18,7 @@ the change-of-basepoint transport used when the monochromatic run begins away from the marked base. -/ -@[expose] public section +public section @@ -141,6 +141,61 @@ private theorem null_path_tail_read rw [L.symmPathRead_toPath] at hq simpa [symmLabel_eq_allArrowLabel_oriented] using hq +private theorem package_removed_marked_graph + {W : Type} [Fintype W] [qW : Quiver.{0, 0} W] + [hW : HasInvolutiveReverse W] + [hHomW : ∀ a b : W, Fintype (@Quiver.Hom W qW a b)] + {n bound : ℕ} + (N : MarkedBinaryGraph (G := G) (H := H) (V := W) n) + {w : W} (hbase : N.base ≠ w) (color : Bool) + (hmono : MonochromaticVertex N.labeling w color) + (hcard : Fintype.card (RemovedVertex w) < bound) + (hrem : HasRemovedMarkedGraph N hbase color hmono) : + ∃ U : Type, + ∃ hFU : Fintype U, + ∃ qU : Quiver.{0, 0} U, + ∃ hU : @HasInvolutiveReverse U qU, + ∃ hHomU : ∀ a b : U, Fintype (@Quiver.Hom U qU a b), + letI : Fintype U := hFU + letI : Quiver U := qU + letI : HasInvolutiveReverse U := hU + letI (a b : U) : Fintype (a ⟶ b) := hHomU a b + ∃ N' : @MarkedBinaryGraph G H U _ _ qU hU n, + Fintype.card U < bound ∧ + @ReverseFree U qU hU ∧ + @MarkedBinaryGraph.IsGenerating n G H U _ _ qU hU N' ∧ + @MarkedBinaryGraph.WeaklyConnected n G H U _ _ qU hU N' ∧ + Fintype.card (@AllArrow U qU) ≤ + 2 * (n + Fintype.card U - 1) := by + unfold HasRemovedMarkedGraph at hrem + obtain ⟨eₐ, haₐ, hnₐ, hdata⟩ := hrem + obtain ⟨hgenₐ, hconnₐ, hfreeₐ, hEulerₐ, _⟩ := hdata + refine ⟨RemovedVertex w, removedVertexFintype w, + removeQuiver eₐ hnₐ, removeHasReverse eₐ hnₐ, + (fun x y => removeQuiverHomFintype eₐ hnₐ x y), ?_⟩ + refine ⟨removedMarkedGraph N hbase eₐ haₐ hnₐ color hmono, + ?_, ?_, ?_, ?_, ?_⟩ + · exact hcard + · exact hfreeₐ + · exact hgenₐ + · exact hconnₐ + · have hcardEdges : + @Fintype.card (@AllArrow (RemovedVertex w) (removeQuiver eₐ hnₐ)) + (@allArrowFintype (RemovedVertex w) (removedVertexFintype w) + (removeQuiver eₐ hnₐ) + (fun a b => removeQuiverHomFintype eₐ hnₐ a b)) = + @Fintype.card (@AllArrow (RemovedVertex w) (removeQuiver eₐ hnₐ)) + (removedAllArrowFintype eₐ hnₐ) := by + exact @Fintype.card_congr + (@AllArrow (RemovedVertex w) (removeQuiver eₐ hnₐ)) + (@AllArrow (RemovedVertex w) (removeQuiver eₐ hnₐ)) + (@allArrowFintype (RemovedVertex w) (removedVertexFintype w) + (removeQuiver eₐ hnₐ) + (fun a b => removeQuiverHomFintype eₐ hnₐ a b)) + (removedAllArrowFintype eₐ hnₐ) + (Equiv.refl _) + exact hcardEdges.le.trans hEulerₐ + theorem exists_reduced_graph_of_minimal_null_path {V : Type} [Fintype V] [qV : Quiver.{0, 0} V] [hV : HasInvolutiveReverse V] @@ -289,11 +344,7 @@ theorem exists_reduced_graph_of_minimal_null_path foldQuiverHomFintype e₁ x y have hrem := exists_removed_of_unfold_fold (M := Mroot) e₀ ha₀ hb₀ e₁ hfree hEuler - dsimp only at hrem have hrem' := hrem ha₁ q₁ hq₁ hgen₁ hconn₁ - unfold HasRemovedMarkedGraph at hrem' - obtain ⟨eₐ, haₐ, hnₐ, hdata⟩ := hrem' - obtain ⟨hgenₐ, hconnₐ, hfreeₐ, hEulerₐ, hcardₐ⟩ := hdata let vFold : foldVertex (unfoldNew (allArrowSource e₀)) (unfoldVertexAt Mroot.labeling (allArrowSource e₀) e₀ (show V from r.target) (unfoldEdgeColor Mroot.labeling e₀)) := @@ -305,11 +356,7 @@ theorem exists_reduced_graph_of_minimal_null_path (unfoldVertexAt Mroot.labeling (allArrowSource e₀) e₀ (show V from r.target) (unfoldEdgeColor Mroot.labeling e₀))) < Fintype.card (UnfoldVertex (allArrowSource e₀)) := hcard₁ - have hremoved : Fintype.card (RemovedVertex vFold) < - Fintype.card (foldVertex (unfoldNew (allArrowSource e₀)) - (unfoldVertexAt Mroot.labeling (allArrowSource e₀) e₀ - (show V from r.target) (unfoldEdgeColor Mroot.labeling e₀))) := - hcardₐ + have hremoved := removedVertex_card_add_one vFold omega have holdb : unfoldOld (allArrowSource e₀) ≠ unfoldVertexAt Mroot.labeling (allArrowSource e₀) e₀ @@ -330,15 +377,17 @@ theorem exists_reduced_graph_of_minimal_null_path apply unfoldNew_ne_old (allArrowSource e₀) exact foldVertexMk_eq_of_not_eq h (unfoldOld_ne_new (allArrowSource e₀)) holdb - refine ⟨RemovedVertex vFold, removedVertexFintype vFold, - removeQuiver eₐ hnₐ, removeHasReverse eₐ hnₐ, - (fun x y => removeQuiverHomFintype eₐ hnₐ x y), ?_⟩ - refine ⟨removedMarkedGraph Nfold hbaseFold eₐ haₐ hnₐ - (unfoldEdgeColor Mroot.labeling e₀) - (by - intro e he - exact foldedUnfoldOld_incident_color Mroot e₀ ha₀ hb₀ e₁ e he), - hcardU, hfreeₐ, hgenₐ, hconnₐ, hEulerₐ⟩ + have hmonoFold : MonochromaticVertex Nfold.labeling vFold + (unfoldEdgeColor Mroot.labeling e₀) := by + intro e he + dsimp [Nfold, vFold] + exact foldedUnfoldOld_incident_color Mroot e₀ ha₀ hb₀ e₁ e he + have hremFold : HasRemovedMarkedGraph Nfold hbaseFold + (unfoldEdgeColor Mroot.labeling e₀) hmonoFold := by + exact hrem' + exact package_removed_marked_graph (N := Nfold) (w := vFold) + (bound := Fintype.card V) hbaseFold + (unfoldEdgeColor Mroot.labeling e₀) hmonoFold hcardU hremFold theorem hasReducedNullFold : HasReducedNullFold (G := G) (H := H) := by diff --git a/LeanPool/MarshallHall/MarshallHall/GrushkoGeneral.lean b/LeanPool/MarshallHall/MarshallHall/GrushkoGeneral.lean index 7df2404745..c21bfa75b1 100644 --- a/LeanPool/MarshallHall/MarshallHall/GrushkoGeneral.lean +++ b/LeanPool/MarshallHall/MarshallHall/GrushkoGeneral.lean @@ -26,7 +26,7 @@ Grushko-specific step is to reduce an arbitrary generating tuple to this separated form without increasing its length. -/ -@[expose] public section +public section @@ -93,6 +93,7 @@ theorem rank_coprod_le_add [Group.FG G] [Group.FG H] : /-! ### The lower bound for separated generating tuples -/ /-- The natural embedding of a tagged factor element into the free product. -/ +@[expose] def separatedMap : Sum G H → G ∗ H := fun x => match x with | Sum.inl g => inl g | Sum.inr h => inr h @@ -335,6 +336,7 @@ theorem nielsenStep_closure_eq {A : Type*} [Group A] {n : ℕ} exact Subgroup.subset_closure ⟨k, rfl⟩ /-- Finite sequences of elementary Nielsen moves. -/ +@[expose] def NielsenEquivalent {A : Type*} [Group A] {n : ℕ} (x y : Fin n → A) : Prop := Relation.ReflTransGen (fun u v : Fin n → A => NielsenStep u v) x y @@ -362,6 +364,7 @@ tuple can be replaced, with the same number of entries, by a tuple whose entries lie in the two original factors. The fold/Nielsen argument is the substantive theorem still to be supplied; this definition keeps its exact interface separate from the rank bookkeeping. -/ +@[expose] def HasSeparatedReduction : Prop := ∀ (n : ℕ) (x : Fin n → G ∗ H), Subgroup.closure (Set.range x) = ⊤ → @@ -463,6 +466,7 @@ factor elements have length at most one, and multiplication is subadditive. /-- Evaluation of a finite alternating-free word in the binary free product. The list is not required to be reduced; `factorWordLength` takes the minimum over all such representatives. -/ +@[expose] def factorWordProd : List (Sum G H) → G ∗ H | [] => 1 | x :: xs => separatedMap x * factorWordProd xs @@ -490,6 +494,7 @@ theorem factorWordProd_surjective : simp [factorWordProd, separatedMap, hu] /-- An element has a factor-word representation of the specified length. -/ +@[expose] def factorWordRepresented (x : G ∗ H) (n : ℕ) : Prop := ∃ u : List (Sum G H), u.length = n ∧ factorWordProd u = x diff --git a/LeanPool/MarshallHall/MarshallHall/GrushkoGraph.lean b/LeanPool/MarshallHall/MarshallHall/GrushkoGraph.lean index 5576a08bd8..6b1a372a3b 100644 --- a/LeanPool/MarshallHall/MarshallHall/GrushkoGraph.lean +++ b/LeanPool/MarshallHall/MarshallHall/GrushkoGraph.lean @@ -21,7 +21,7 @@ therefore use these operations without introducing a second, informal notion of path evaluation. -/ -@[expose] public section +public section @@ -89,15 +89,18 @@ namespace BinaryLabelling variable (L : BinaryLabelling (G := G) (H := H) (V := V)) /-- The factor-label list read along a directed path. -/ +@[expose] def pathLabels {a : V} : ∀ {b : V}, Path a b → List (Sum G H) | _, Path.nil => [] | _, Path.cons p e => pathLabels p ++ [L.label e] /-- The element of the free product read along a directed path. -/ +@[expose] def pathRead {a : V} {b : V} (p : Path a b) : G ∗ H := factorWordProd (G := G) (H := H) (pathLabels L p) /-- A path is monochromatic when all of its edge labels come from one factor. -/ +@[expose] def IsMonochromatic {a b : V} (p : Path a b) (color : Bool) : Prop := ∀ z ∈ L.pathLabels p, binarySumIndex (G := G) (H := H) z = color @@ -156,6 +159,7 @@ theorem pathRead_comp {a b : V} (p : Path a b) : /-! ### Reading paths in the symmetrized graph -/ /-- Extends edge labels to symmetrized arrows by inverting the label on a formal reverse. -/ +@[expose] def symmLabel {a b : Symmetrify V} (e : @Quiver.Hom (Symmetrify V) (@Quiver.symmetrifyQuiver V _) a b) : Sum G H := @@ -164,6 +168,7 @@ def symmLabel {a b : Symmetrify V} | Sum.inr f => factorWordInv (L.label f) /-- The ordered list of factor labels along a symmetrized path. -/ +@[expose] def symmPathLabels {a : Symmetrify V} : ∀ {b : Symmetrify V}, @Quiver.Path (Symmetrify V) (@Quiver.symmetrifyQuiver V _) a b → @@ -172,6 +177,7 @@ def symmPathLabels {a : Symmetrify V} : | _, Path.cons p e => symmPathLabels p ++ [L.symmLabel e] /-- The free-product element read along a symmetrized path. -/ +@[expose] def symmPathRead {a b : Symmetrify V} (p : @Quiver.Path (Symmetrify V) (@Quiver.symmetrifyQuiver V _) a b) : G ∗ H := @@ -274,6 +280,7 @@ theorem symmPathRead_map_of {a b : V} rfl /-- Every label along the symmetrized path belongs to the specified factor. -/ +@[expose] def symmIsMonochromatic {a b : Symmetrify V} (p : @Quiver.Path (Symmetrify V) (@Quiver.symmetrifyQuiver V _) a b) (color : Bool) : Prop := @@ -771,6 +778,7 @@ def LoopNielsenEquivalent {b : V} {n : ℕ} Relation.ReflTransGen (fun u v : Fin n → Path b b => LoopNielsenStep u v) x y /-- Reads a tuple of based loops as a tuple of free-product elements. -/ +@[expose] def loopRead {b : V} {n : ℕ} (x : Fin n → Path b b) : Fin n → G ∗ H := fun i => L.pathRead (x i) @@ -841,14 +849,17 @@ namespace MarkedBinaryGraph variable (M : MarkedBinaryGraph (G := G) (H := H) (V := V) n) /-- The free-product elements read along the marking loops. -/ +@[expose] def read : Fin n → G ∗ H := M.labeling.loopRead M.loops /-- The marking loops read a generating tuple of the free product. -/ +@[expose] def IsGenerating : Prop := Subgroup.closure (Set.range M.read) = ⊤ /-- Every vertex can be reached from the base after allowing formal reverse edges. -/ +@[expose] def WeaklyConnected : Prop := ∀ v : V, Nonempty (@Path (Symmetrify V) _ M.base v) diff --git a/LeanPool/MarshallHall/MarshallHall/GrushkoInvariant.lean b/LeanPool/MarshallHall/MarshallHall/GrushkoInvariant.lean index ee35ef9612..6b8c5ae961 100644 --- a/LeanPool/MarshallHall/MarshallHall/GrushkoInvariant.lean +++ b/LeanPool/MarshallHall/MarshallHall/GrushkoInvariant.lean @@ -22,7 +22,7 @@ This file establishes that bound for the initial rose and records the exact cardinalities needed to transport it through a fold. -/ -@[expose] public section +public section diff --git a/LeanPool/MarshallHall/MarshallHall/GrushkoReduction.lean b/LeanPool/MarshallHall/MarshallHall/GrushkoReduction.lean index de51a61e9a..9d1681bc9c 100644 --- a/LeanPool/MarshallHall/MarshallHall/GrushkoReduction.lean +++ b/LeanPool/MarshallHall/MarshallHall/GrushkoReduction.lean @@ -18,7 +18,7 @@ reduction argument. In particular, the reduced-word object below is tied to the actual inclusions `Monoid.Coprod.inl` and `Monoid.Coprod.inr`. -/ -@[expose] public section +public section @@ -197,6 +197,7 @@ theorem binaryToIndexed_factorWordProd (u : List (Sum G H)) : /-! Reversing an oriented labelled path reverses the order and inverts every label. This is the algebraic operation used by the graph-fold bookkeeping. -/ /-- Inverts a letter while retaining its factor tag. -/ +@[expose] def factorWordInv : Sum G H → Sum G H | Sum.inl g => Sum.inl g⁻¹ | Sum.inr h => Sum.inr h⁻¹ @@ -286,6 +287,7 @@ theorem word_length_mul_left_le {b : Bool} (a : binaryFamily G H b) (Nat.add_le_add_right htail' 1) /-- The number of letters in the reduced free-product normal form. -/ +@[expose] def binaryReducedLength (x : G ∗ H) : ℕ := (binaryReducedWord (G := G) (H := H) x).toList.length @@ -334,6 +336,7 @@ theorem binaryReducedLength_factorWordProd_le (u : List (Sum G H)) : (Nat.succ_le_succ ih) /-- Converts a Boolean-indexed factor element to a disjoint-union label. -/ +@[expose] def binarySigmaToSum : Sigma (binaryFamily G H) → Sum G H | ⟨false, g⟩ => Sum.inl g | ⟨true, h⟩ => Sum.inr h @@ -347,6 +350,7 @@ theorem binaryLetterToIndexed_sigma (z : Sigma (binaryFamily G H)) : cases b <;> rfl /-- The reduced normal form as a list of factor-tagged letters. -/ +@[expose] def binaryReducedLetters (x : G ∗ H) : List (Sum G H) := (binaryReducedWord (G := G) (H := H) x).toList.map binarySigmaToSum @@ -408,6 +412,7 @@ theorem factorWordLength_eq_binaryReducedLength (x : G ∗ H) : /-- The factor index of a binary letter, expressed in the index type used by the indexed free-product normal form. -/ +@[expose] def binarySumIndex : Sum G H → Bool | Sum.inl _ => false | Sum.inr _ => true @@ -685,6 +690,7 @@ theorem word_length_factor_mul_eq_tail_add_one_of_mul_ne_one {b : Bool} simp [Monoid.CoprodI.Word.cons] /-- Converts a disjoint-union label to a Boolean-indexed factor element. -/ +@[expose] def sumToSigma : Sum G H → Sigma (binaryFamily G H) | Sum.inl g => ⟨false, g⟩ | Sum.inr h => ⟨true, h⟩ diff --git a/LeanPool/MarshallHall/MarshallHall/GrushkoReductionChain.lean b/LeanPool/MarshallHall/MarshallHall/GrushkoReductionChain.lean index 5d68b2ef7c..f4a8d5ee11 100644 --- a/LeanPool/MarshallHall/MarshallHall/GrushkoReductionChain.lean +++ b/LeanPool/MarshallHall/MarshallHall/GrushkoReductionChain.lean @@ -19,7 +19,7 @@ remaining combinatorial issue is isolated precisely to the unfold case of the classical proof. -/ -@[expose] public section +public section @@ -170,6 +170,7 @@ theorem safe_null_fold_step {n : ℕ} /-- Every generating connected marked graph with a reduced null run admits the required reducing fold. -/ +@[expose] def HasReducedNullFold : Prop := ∀ (n : ℕ) (W : Type) [Fintype W] [qW : Quiver.{0, 0} W] [_hW : HasInvolutiveReverse W] diff --git a/LeanPool/MarshallHall/MarshallHall/GrushkoRemove.lean b/LeanPool/MarshallHall/MarshallHall/GrushkoRemove.lean index 505718b469..782c890329 100644 --- a/LeanPool/MarshallHall/MarshallHall/GrushkoRemove.lean +++ b/LeanPool/MarshallHall/MarshallHall/GrushkoRemove.lean @@ -18,7 +18,7 @@ binary labelling format. This is the marking-preserving contraction used in the unsafe source-unfold branch of the Grushko proof. -/ -@[expose] public section +public section @@ -213,7 +213,7 @@ def removeEdgeTarget {v : V} (e₀ : AllArrow (V := V)) removeEndpoint (removeAnchorTarget e₀ hn) (allArrowTarget e.1) /-- The quiver obtained by deleting a vertex and its anchor edge and redirecting incident edges. -/ -@[reducible] +@[reducible, expose] def removeQuiver {v : V} (e₀ : AllArrow (V := V)) (hn : allArrowTarget e₀ ≠ v) : Quiver (RemovedVertex v) where @@ -269,7 +269,7 @@ def removeReverseArrow {v : V} (e₀ : AllArrow (V := V)) exact e.2.1 /-- The involutive reversal inherited by the quiver after vertex removal. -/ -@[instance_reducible] +@[instance_reducible, expose] def removeHasReverse {v : V} (e₀ : AllArrow (V := V)) (hn : allArrowTarget e₀ ≠ v) : @Quiver.HasInvolutiveReverse (RemovedVertex v) @@ -364,6 +364,7 @@ theorem removedVertex_card_add_one (v : V) : /-! ### The marking-preserving label slide -/ /-- Every edge incident to the vertex has its label in the specified factor. -/ +@[expose] def MonochromaticVertex (L : BinaryLabelling (G := G) (H := H) (V := V)) (v : V) (color : Bool) : Prop := ∀ e : AllArrow (V := V), diff --git a/LeanPool/MarshallHall/MarshallHall/GrushkoRose.lean b/LeanPool/MarshallHall/MarshallHall/GrushkoRose.lean index 6bdb3bc9dd..a2ad2e9208 100644 --- a/LeanPool/MarshallHall/MarshallHall/GrushkoRose.lean +++ b/LeanPool/MarshallHall/MarshallHall/GrushkoRose.lean @@ -19,7 +19,7 @@ later induction can use it as a genuine finite marked graph rather than as a picture of a word. -/ -@[expose] public section +public section diff --git a/LeanPool/MarshallHall/MarshallHall/GrushkoUnfold.lean b/LeanPool/MarshallHall/MarshallHall/GrushkoUnfold.lean index 35ab8b34ed..e01beead8a 100644 --- a/LeanPool/MarshallHall/MarshallHall/GrushkoUnfold.lean +++ b/LeanPool/MarshallHall/MarshallHall/GrushkoUnfold.lean @@ -24,7 +24,7 @@ contraction. The main certified fact here is that the old copy is monochromatic, exactly the invariant needed by that contraction. -/ -@[expose] public section +public section @@ -53,9 +53,11 @@ noncomputable instance unfoldVertexFintype (a : V) : Fintype (UnfoldVertex a) := infer_instance /-- The original copy of the vertex split by unfolding. -/ +@[expose] def unfoldOld (a : V) : UnfoldVertex a := Sum.inr false /-- The new copy of the vertex created by unfolding. -/ +@[expose] def unfoldNew (a : V) : UnfoldVertex a := Sum.inr true omit [Fintype V] [Quiver.HasInvolutiveReverse V] [(a b : V) → Fintype (a ⟶ b)] in @@ -70,6 +72,7 @@ theorem unfoldNew_ne_old (a : V) : unfoldNew a ≠ unfoldOld a := by exact (unfoldOld_ne_new a).symm /-- The factor containing an edge's label. -/ +@[expose] def unfoldEdgeColor (L : BinaryLabelling (G := G) (H := H) (V := V)) (e : AllArrow (V := V)) : Bool := binarySumIndex (G := G) (H := H) (allArrowLabel L e) @@ -206,7 +209,7 @@ theorem unfoldEdgeTarget_reverse | inr b => cases b <;> rfl /-- The quiver obtained by splitting a vertex and duplicating the selected edge. -/ -@[reducible] +@[reducible, expose] def unfoldQuiver (L : BinaryLabelling (G := G) (H := H) (V := V)) (e₀ : AllArrow (V := V)) : @@ -270,6 +273,7 @@ def unfoldHasReverse exact unfoldEdgeReverse_reverse e.1) /-- The label of an unfolded edge, using the selected edge's label for its duplicate. -/ +@[expose] def unfoldEdgeLabel (L : BinaryLabelling (G := G) (H := H) (V := V)) (e₀ : AllArrow (V := V)) : UnfoldEdge (V := V) → Sum G H @@ -293,6 +297,7 @@ theorem unfoldEdgeLabel_reverse factorWordInv_factorWordInv] /-- The factor labelling on the unfolded graph. -/ +@[expose] def unfoldLabelling (L : BinaryLabelling (G := G) (H := H) (V := V)) (e₀ : AllArrow (V := V)) : @@ -308,6 +313,7 @@ def unfoldLabelling /-! ### The old copy is monochromatic -/ /-- An unfolded arrow is incident to the original copy of the split vertex. -/ +@[expose] def unfoldOldIncident (L : BinaryLabelling (G := G) (H := H) (V := V)) (e₀ : AllArrow (V := V)) @@ -1589,6 +1595,7 @@ theorem unfoldDuplicateFoldPath_target_eq_old (allArrowSource e₀) (unfoldEdgeColor L e₀)).mpr ⟨rfl, rfl⟩ /-- The unfolded marked graph based at the original copy of its split base vertex. -/ +@[expose] def unfoldedMarkedGraph {n : ℕ} (M : MarkedBinaryGraph (G := G) (H := H) (V := V) n) (e₀ : AllArrow (V := V)) @@ -1752,6 +1759,7 @@ theorem unfoldedMarkedGraph_weaklyConnected {n : ℕ} /-! ### Rerooting the unfolded marking at the new source -/ /-- The unfolded marked graph rerooted at the new copy of its split base vertex. -/ +@[expose] def unfoldedMarkedGraphNew {n : ℕ} (M : MarkedBinaryGraph (G := G) (H := H) (V := V) n) (e₀ : AllArrow (V := V)) diff --git a/LeanPool/MarshallHall/MarshallHall/GrushkoUnsafe.lean b/LeanPool/MarshallHall/MarshallHall/GrushkoUnsafe.lean index c87226388b..e4fa72a9f3 100644 --- a/LeanPool/MarshallHall/MarshallHall/GrushkoUnsafe.lean +++ b/LeanPool/MarshallHall/MarshallHall/GrushkoUnsafe.lean @@ -19,7 +19,7 @@ monochromatic vertex and can be contracted explicitly. This file contains the bridge from that local construction to the removal operation. -/ -@[expose] public section +public section @@ -114,6 +114,7 @@ theorem exists_nonloop_incident_of_symm_path (symmOrientedArrow_target e)), hloop⟩ /-- A generating connected marked graph admits the prescribed removal of a monochromatic vertex. -/ +@[expose] def HasRemovedMarkedGraph {n : ℕ} (M : MarkedBinaryGraph (G := G) (H := H) (V := V) n) {v : V} (hbase : M.base ≠ v) (color : Bool) diff --git a/LeanPool/MarshallHall/MarshallHall/Hall.lean b/LeanPool/MarshallHall/MarshallHall/Hall.lean index 277995aa41..67307c5964 100644 --- a/LeanPool/MarshallHall/MarshallHall/Hall.lean +++ b/LeanPool/MarshallHall/MarshallHall/Hall.lean @@ -12,7 +12,7 @@ public import LeanPool.MarshallHall.MarshallHall.Separation /-! The finite-core completion argument. Its conclusion records the actual inclusion of the original subgroup into the finite-index subgroup. -/ -@[expose] public section +public section open Set Function open CategoryTheory CategoryTheory.ActionCategory CategoryTheory.SingleObj Quiver FreeGroup diff --git a/LeanPool/MarshallHall/MarshallHall/PartialAction.lean b/LeanPool/MarshallHall/MarshallHall/PartialAction.lean index f6915b126d..55d9b69995 100644 --- a/LeanPool/MarshallHall/MarshallHall/PartialAction.lean +++ b/LeanPool/MarshallHall/MarshallHall/PartialAction.lean @@ -19,7 +19,7 @@ available even when the subgroup is not normal. We record it explicitly because this is the finite-state action used by the Hall construction. -/ -@[expose] public section +public section open Function @@ -42,6 +42,7 @@ abbrev LeftCosetQuotient (H : Subgroup G) := Quotient (QuotientGroup.leftRel H) /-- Left multiplication acting on left cosets of a subgroup. -/ +@[expose] def leftMul (H : Subgroup G) (a : G) : LeftCosetQuotient H → LeftCosetQuotient H := Quotient.lift (fun x : G => Quotient.mk'' (a * x)) (by intro x y hxy @@ -55,6 +56,7 @@ theorem leftMul_mk (H : Subgroup G) (a x : G) : leftMul H a (Quotient.mk'' x) = Quotient.mk'' (a * x) := rfl /-- Left multiplication as a permutation of the left-coset space. -/ +@[expose] def leftMulEquiv (H : Subgroup G) (a : G) : LeftCosetQuotient H ≃ LeftCosetQuotient H where toFun := leftMul H a @@ -114,6 +116,7 @@ variable {Q : Type u} (A : Set Q) (e : Q ≃ Q) /-- The equivalence between points whose image remains in a subset and their image within that subset. -/ +@[expose] def restrictedEquiv : {x : A // e x.1 ∈ A} ≃ {y : A // ∃ x : A, e x.1 ∈ A ∧ e x.1 = y.1} where @@ -141,6 +144,7 @@ theorem restrictedEquiv_apply (x : {x : A // e x.1 ∈ A}) : end Restricted /-- Right multiplication acting on right cosets of a subgroup. -/ +@[expose] def rightMul (H : Subgroup G) (a : G) : RightCosetQuotient H → RightCosetQuotient H := Quotient.lift (fun x : G => Quotient.mk'' (x * a)) (by intro x y hxy @@ -154,6 +158,7 @@ theorem rightMul_mk (H : Subgroup G) (a x : G) : rightMul H a (Quotient.mk'' x) = Quotient.mk'' (x * a) := rfl /-- Right multiplication as a permutation of the right-coset space. -/ +@[expose] def rightMulEquiv (H : Subgroup G) (a : G) : RightCosetQuotient H ≃ RightCosetQuotient H where toFun := rightMul H a diff --git a/LeanPool/MarshallHall/MarshallHall/Separation.lean b/LeanPool/MarshallHall/MarshallHall/Separation.lean index 30b05fee01..e588a659ae 100644 --- a/LeanPool/MarshallHall/MarshallHall/Separation.lean +++ b/LeanPool/MarshallHall/MarshallHall/Separation.lean @@ -11,7 +11,7 @@ public import Mathlib.GroupTheory.Finiteness /-! The finite state set used in the separation argument. -/ -@[expose] public section +public section open Set Function @@ -26,6 +26,7 @@ variable {α : Type u} /-- The finite-core points viewed as states in the subgroup's left-coset space. -/ +@[expose] def coreStateSet [DecidableEq α] (H : Subgroup (FreeGroup α)) (S : Finset (FreeGroup α)) (g : FreeGroup α) : Set (LeftCosetQuotient H) := diff --git a/LeanPool/MarshallHall/Solution.lean b/LeanPool/MarshallHall/Solution.lean index 5b024c4772..29bda1cb6a 100644 --- a/LeanPool/MarshallHall/Solution.lean +++ b/LeanPool/MarshallHall/Solution.lean @@ -16,7 +16,7 @@ Its proof is supplied by the finite labelled-graph reduction in `MarshallHall.GrushkoFull`. -/ -@[expose] public section +public section noncomputable section 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 685f869835..e90201c97f 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..d7a487f785 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 @@ -404,6 +404,7 @@ structure Flow (Net : Network N) where conserved : ∀ u, u ≠ Net.s → u ≠ Net.t → ∑ v, f u v = 0 /-- The value of a flow: net flow out of the source. -/ +@[expose] def Flow.value {Net : Network N} (F : Flow Net) : ℝ := ∑ v, F.f Net.s v /-- An s–t cut: a set of nodes containing the source but not the sink. -/ @@ -414,6 +415,7 @@ structure Cut (Net : Network N) where ht : Net.t ∉ S /-- The capacity of a cut: total capacity of edges leaving `S`. -/ +@[expose] def Cut.capacity {Net : Network N} (C : Cut Net) : ℝ := ∑ u ∈ C.S, ∑ v ∈ (Finset.univ \ C.S), Net.cap u v 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..cfc06eb519 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 @@ -190,7 +190,7 @@ theorem simultaneousHarmonicProjection_eq_zero_iff_gramIdeal (r := r) (n := n) (m := m) p /-- The harmonic branch of highest weight seed used in the spherical-code argument. -/ -def harmonicBranchOfHighestWeightSeed +@[expose] def harmonicBranchOfHighestWeightSeed {E : Type*} [AddCommGroup E] [Module ℝ E] {r n : ℕ} (lam : Fin (r + 1) → ℕ) (seed : E →ₗ[ℝ] @@ -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*} @@ -1052,7 +1052,7 @@ open MetricCodes.Spherical.HigherChannel abbrev BoxVertex (r m : ℕ) := Fin (r + 1) → Fin (m + 1) /-- The next vertex used in the spherical-code argument. -/ -def nextVertex {r m : ℕ} (v : BoxVertex r m) +@[expose] def nextVertex {r m : ℕ} (v : BoxVertex r m) (i : Fin (r + 1)) (h : (v i).val < m) : BoxVertex r m := Function.update v i ⟨(v i).val + 1, by omega⟩ @@ -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⟩ @@ -1960,7 +1960,7 @@ open MetricCodes.Spherical.HigherHierarchyBoxSpectral abbrev Vertex (r m : ℕ) := BoxVertex r m /-- The signature used in the spherical-code argument. -/ -def signature {r m : ℕ} +@[expose] def signature {r m : ℕ} (a : Fin (r + 1) → ℝ) (n : ℕ) (v : Vertex r m) : Fin (r + 1) → ℕ := fun i => flooredCoordinates a n i + (v i).val @@ -2019,7 +2019,7 @@ theorem matrix_nonneg {r m : ℕ} split_ifs <;> first | exact edgeWeight_nonneg a b n w i | exact le_rfl /-- The grid used in the spherical-code argument. -/ -def grid (r m : ℕ) : SimpleGraph (Vertex r m) where +@[expose] def grid (r m : ℕ) : SimpleGraph (Vertex r m) where Adj v w := ∃ i : Fin (r + 1), (∃ h : (v i).val < m, w = nextVertex v i h) ∨ @@ -2228,20 +2228,20 @@ open MetricCodes.Spherical.HigherHierarchyBoxSpectral open MetricCodes.Spherical.HigherHierarchyTrueGridAdjacency /-- The plus edge used in the spherical-code argument. -/ -def plusEdge {r m : ℕ} +@[expose] def plusEdge {r m : ℕ} (a : Fin (r + 1) → ℝ) (b : Fin r → ℝ) (n : ℕ) (v : Vertex r m) (i : Fin (r + 1)) : ℝ := plusProbability n (signature a n v) (flooredCoordinates b n) i /-- The minus edge used in the spherical-code argument. -/ -def minusEdge {r m : ℕ} +@[expose] def minusEdge {r m : ℕ} (a : Fin (r + 1) → ℝ) (b : Fin r → ℝ) (n : ℕ) (v : Vertex r m) (i : Fin (r + 1)) : ℝ := minusProbability n (raiseWeight (signature a n v) i) (flooredCoordinates b n) i /-- The probability used in the spherical-code argument. -/ -def probability {r m : ℕ} +@[expose] def probability {r m : ℕ} (a : Fin (r + 1) → ℝ) (b : Fin r → ℝ) (n : ℕ) (v w : Vertex r m) : ℝ := forwardMatrix (plusEdge (m := m) a b n) v w + @@ -3087,7 +3087,7 @@ abbrev YoungCoordinateAmbient {I : Type*} SpherePacking.Euclidean n ⊗[ℝ] YoungAmbient n lam /-- The tensor-product inclusion of one Young vertex into the full coordinate ambient space. -/ -def coordinateInclusion {I : Type*} [Fintype I] [DecidableEq I] +@[expose] def coordinateInclusion {I : Type*} [Fintype I] [DecidableEq I] {r n : ℕ} (lam : I → Fin (r + 1) → ℕ) (i : I) : (SpherePacking.Euclidean n ⊗[ℝ] YoungVertex (n := n) lam i) →ₗᵢ[ℝ] YoungCoordinateAmbient n lam := @@ -3175,7 +3175,7 @@ theorem coordinateInclusion_orthogonal /-- The ambient channel obtained by projecting to a source vertex and including the target tensor space. -/ -def liftChannel {I : Type*} [Fintype I] [DecidableEq I] +@[expose] def liftChannel {I : Type*} [Fintype I] [DecidableEq I] {r n : ℕ} (lam : I → Fin (r + 1) → ℕ) (target source : I) (T : YoungVertex (n := n) lam source →ₗᵢ[ℝ] (SpherePacking.Euclidean n ⊗[ℝ] YoungVertex (n := n) lam target)) : @@ -3372,7 +3372,7 @@ def actualYoungChannel /-- The realized Hilbert graph assembled from Young vertex fibres and their isometric edge channels. -/ -def actualYoungHilbertGraph +@[expose] def actualYoungHilbertGraph {I : Type*} [Fintype I] [DecidableEq I] {r n : ℕ} {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] @@ -3503,7 +3503,7 @@ def actualYoungHilbertGraph eigenvector_equation := heigenvector_equation /-- The actual young indexed hierarchy graph used in the spherical-code argument. -/ -def actualYoungIndexedHierarchyGraph +@[expose] def actualYoungIndexedHierarchyGraph {k r n : ℕ} {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] @@ -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 @@ -3622,7 +3622,7 @@ abbrev BoxStabilizer {r : ℕ} (n : ℕ) (b : Fin (r + 1) → ℝ) := HarmonicYoungSpace (n := n - 1) (Weyl.flooredWeight b n) /-- The box probability used in the spherical-code argument. -/ -def boxProbability {r m : ℕ} +@[expose] def boxProbability {r m : ℕ} (a : Fin (r + 1) → ℝ) (b : Fin r → ℝ) (n : ℕ) (target source : BoxIndex r m) : ℝ := HigherHierarchyBoxChannels.probability a b n @@ -3703,7 +3703,7 @@ theorem BoxRepresentationData.detailed_balance {r m n : ℕ} (RectangularVertices.Vertex (r + 1) m)).symm source) /-- The box eigenvector reindexed by the canonical finite enumeration of rectangular vertices. -/ -def indexedEigenvector {r m : ℕ} +@[expose] def indexedEigenvector {r m : ℕ} (x : RectangularVertices.Vertex r m → ℝ) (i : BoxIndex r m) : ℝ := x ((Fintype.equivFin (RectangularVertices.Vertex r m)).symm i) @@ -3772,7 +3772,7 @@ structure BoxPerronData {r m n : ℕ} eigenvector w) = eigenvalue * eigenvector v /-- The to hilbert graph used in the spherical-code argument. -/ -def BoxRepresentationData.toHilbertGraph {r m n : ℕ} +@[expose] def BoxRepresentationData.toHilbertGraph {r m n : ℕ} {a : Fin (r + 2) → ℝ} {b : Fin (r + 1) → ℝ} (A : BoxRepresentationData (m := m) (n := n) a b) (hstable : ∀ v : RectangularVertices.Vertex (r + 1) m, @@ -3933,7 +3933,7 @@ open MetricCodes.Spherical.HigherHarmonicYoung.GelfandTsetlin open MetricCodes.Spherical.HigherYoungProjectedRaiseInjectivity /-- The preceding rows used in the spherical-code argument. -/ -def precedingRows {r : ℕ} (row : Fin (r + 1)) : Finset (Fin (r + 1)) := +@[expose] def precedingRows {r : ℕ} (row : Fin (r + 1)) : Finset (Fin (r + 1)) := Finset.univ.filter (fun i => i < row) @[simp] theorem mem_precedingRows {r : ℕ} @@ -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,17 +4291,17 @@ 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) /-- The gram prior ideal used in the spherical-code argument. -/ -def gramPriorIdeal (r n k : ℕ) : Ideal (PolynomialSpace r n) := +@[expose] def gramPriorIdeal (r n k : ℕ) : Ideal (PolynomialSpace r n) := Ideal.ofList ((gramQuadraticList r n).take k) theorem mem_ideal_smul_top_iff {R : Type*} [CommRing R] @@ -4337,7 +4337,7 @@ theorem gramQuadraticList_weaklyRegular_iff_saturation simpa only [gramPriorIdeal, smul_eq_mul, Ideal.mul_top, Fin.getElem_fin] using hp /-- The gram pivot used in the spherical-code argument. -/ -def gramPivot {r n : ℕ} (hn : 2 * r < n) +@[expose] def gramPivot {r n : ℕ} (hn : 2 * r < n) (z : UpperGramPair r) : Fin n := ⟨z.val.1.val + z.val.2.val, by have hi := z.val.1.isLt @@ -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)} @@ -4522,14 +4522,14 @@ open Finsupp open scoped MonomialOrder /-- A copy of exponent vectors carrying the weighted lexicographic ordering. -/ -def YoungWeightedLex {σ : Type*} (_w : σ → ℕ) := σ →₀ ℕ +@[expose] def YoungWeightedLex {σ : Type*} (_w : σ → ℕ) := σ →₀ ℕ /-- The identity equivalence from exponent vectors to their weighted-lexicographic copy. -/ -def toYoungWeightedLex {σ : Type*} (w : σ → ℕ) : +@[expose] def toYoungWeightedLex {σ : Type*} (w : σ → ℕ) : (σ →₀ ℕ) ≃ YoungWeightedLex w := Equiv.refl _ /-- The identity equivalence from the weighted-lexicographic copy back to exponent vectors. -/ -def ofYoungWeightedLex {σ : Type*} (w : σ → ℕ) : +@[expose] def ofYoungWeightedLex {σ : Type*} (w : σ → ℕ) : YoungWeightedLex w ≃ (σ →₀ ℕ) := Equiv.refl _ namespace YoungWeightedLex @@ -5820,7 +5820,7 @@ theorem finsupp_le_add_of_disjoint_support /-- The leading-degree condition that every nonzero ideal element has degree above some generator. -/ -def IsLeadingGroebnerFamily +@[expose] def IsLeadingGroebnerFamily {σ K : Type*} [Field K] (m : MonomialOrder σ) (fs : List (MvPolynomial σ K)) : Prop := ∀ p : MvPolynomial σ K, p ∈ Ideal.ofList fs → p ≠ 0 → @@ -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) @@ -6496,7 +6496,7 @@ theorem arbitraryRowPathWeight_reverseInterlacingRowSchedule {r : ℕ} exact foldl_reverseInterlacingRowSchedule_eq_target h /-- The reverse interlacing polynomial seed used in the spherical-code argument. -/ -def reverseInterlacingPolynomialSeed +@[expose] def reverseInterlacingPolynomialSeed {r n : ℕ} (lam : Fin (r + 2) → ℕ) (mu : Fin (r + 1) → ℕ) : HarmonicYoungSpace (n := n) mu →ₗ[ℝ] diff --git a/LeanPool/MetricCodes/Conclusion.lean b/LeanPool/MetricCodes/Conclusion.lean index f93fcccccd..8aacfbd3df 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 @@ -1318,7 +1318,7 @@ theorem gtTransverseEuclideanIsometry_orthogonal_last /-- The tensor isometry combining the transverse Euclidean inclusion with a canonical Gelfand–Tsetlin fibre. -/ -def gtTransverseTensorEmbedding +@[expose] def gtTransverseTensorEmbedding {r n : ℕ} (lam : Fin (r + 2) → ℕ) (nu : Fin (r + 1) → ℕ) (h : Interlaces lam nu) @@ -1900,7 +1900,7 @@ theorem gtTransverseNegativeSector_gram_pos /-- The transverse negative-sector map normalized by its positive Gram scalar to a linear isometry. -/ -def normalizedGTTransverseNegativeSector +@[expose] def normalizedGTTransverseNegativeSector {r n : ℕ} (lam : Fin (r + 2) → ℕ) (mu : Fin (r + 1) → ℕ) (kappa : Fin r → ℕ) (row : Fin (r + 1)) @@ -1993,7 +1993,7 @@ theorem gtTransversePositiveSector_gram_pos /-- The transverse positive-sector map normalized by its positive Gram scalar to a linear isometry. -/ -def normalizedGTTransversePositiveSector +@[expose] def normalizedGTTransversePositiveSector {r n : ℕ} (lam : Fin (r + 2) → ℕ) (mu nu : Fin (r + 1) → ℕ) (row : Fin (r + 1)) (hmunu : mu = raiseWeight nu row) @@ -3514,7 +3514,7 @@ open MetricCodes.Spherical.HigherRepresentationGraph (Interlaces) open MetricCodes.Spherical.HigherYoungMixedGapAxisProbability /-- The transverse wall-sector map normalized by its positive Gram scalar to a linear isometry. -/ -def normalizedGTTransverseWallSector +@[expose] def normalizedGTTransverseWallSector {r n : ℕ} (lam : Fin (r + 2) → ℕ) (mu : Fin (r + 1) → ℕ) (h : Interlaces lam mu) (hn : 2 * (r + 1) + 5 ≤ n + 1) @@ -3824,7 +3824,7 @@ open MetricCodes.Spherical.HigherYoungAllRankCanonicalGelfandTsetlinCompleteness /-- The tensor isometry induced by a canonical full-branch fibre while retaining the Euclidean tensor factor. -/ -def gtFullTransverseInternalEmbedding {r n : ℕ} +@[expose] def gtFullTransverseInternalEmbedding {r n : ℕ} (lam : Fin (r + 1) → ℕ) (hn : 2 * r + 5 ≤ n + 1) (mu : FullBranchWeight lam) : (SpherePacking.Euclidean n ⊗[ℝ] @@ -4041,7 +4041,7 @@ theorem euclidean_eq_gtTransverse_add_last_axis {n : ℕ} mul_zero, add_zero] /-- The isometry sending a harmonic Young vector to its tensor with the last coordinate axis. -/ -def gtFullAxisAmbientInclusion {r n : ℕ} +@[expose] def gtFullAxisAmbientInclusion {r n : ℕ} (lam : Fin (r + 1) → ℕ) : HarmonicYoungSpace (n := n + 1) lam →ₗᵢ[ℝ] (SpherePacking.Euclidean (n + 1) ⊗[ℝ] @@ -4092,7 +4092,7 @@ theorem gtFullAxisAmbientInclusion_sup_transverse_range_eq_top /-- The isometry obtained by embedding a full-branch fibre and tensoring with the last coordinate axis. -/ -def gtFullAxisEmbedding {r n : ℕ} +@[expose] def gtFullAxisEmbedding {r n : ℕ} (lam : Fin (r + 1) → ℕ) (hn : 2 * r + 5 ≤ n + 1) (mu : FullBranchWeight lam) : HarmonicYoungSpace (n := n) (fullBranchSignature mu) →ₗᵢ[ℝ] diff --git a/LeanPool/MetricCodes/Foundations.lean b/LeanPool/MetricCodes/Foundations.lean index 9d0177b01f..b6cef19df9 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 (κ × ι) ρ ℝ := @@ -4349,7 +4351,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 : ℕ) @@ -4714,7 +4716,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 @@ -4726,7 +4728,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 : ℕ) : @@ -5471,11 +5473,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) : @@ -5650,7 +5652,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) : @@ -5701,7 +5703,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) @@ -6998,7 +7000,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 : ℕ) : ℝ)) @@ -7065,7 +7067,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 @@ -7141,7 +7143,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 : ℕ) : ℝ))) * @@ -7316,7 +7318,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 @@ -7330,7 +7332,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 : ℕ) : @@ -7963,7 +7965,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) : ℝ) / @@ -8068,7 +8070,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 @@ -8121,7 +8123,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 / @@ -8337,11 +8339,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 * γ) @@ -8476,16 +8478,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 α β γ @@ -8629,16 +8631,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} @@ -8649,7 +8651,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 : ℝ} @@ -8658,7 +8660,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 @@ -8686,7 +8688,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 * δ) @@ -8872,7 +8874,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..a383e11bf3 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 @@ -903,7 +903,7 @@ namespace Fischer abbrev MultiIndex (n : ℕ) := Fin n →₀ ℕ /-- The degree indices used in the spherical-code argument. -/ -def degreeIndices (n m : ℕ) : Finset (MultiIndex n) := +@[expose] def degreeIndices (n m : ℕ) : Finset (MultiIndex n) := Finset.finsuppAntidiag (Finset.univ : Finset (Fin n)) m /-- The degree index used in the spherical-code argument. -/ @@ -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 @@ -1349,7 +1349,7 @@ theorem harmonicCoefficientEmbedding_injective (n m : ℕ) : MvPolynomial.homogeneousSubmodule (Fin n) ℝ m from inf_le_left)) /-- The homogeneous inner used in the spherical-code argument. -/ -def homogeneousInner (n m : ℕ) +@[expose] def homogeneousInner (n m : ℕ) (p q : Homogeneous n m) : ℝ := @inner ℝ (CoefficientSpace n m) _ (coefficientEmbedding n m p) (coefficientEmbedding n m q) @@ -1416,7 +1416,7 @@ theorem homogeneousInner_eq_polynomialInner (n m : ℕ) ring /-- The homogeneous inner core used in the spherical-code argument. -/ -@[implicit_reducible] def homogeneousInnerCore (n m : ℕ) : +@[expose, implicit_reducible] def homogeneousInnerCore (n m : ℕ) : InnerProductSpace.Core ℝ (Homogeneous n m) where inner p q := homogeneousInner n m p q conj_inner_symm p q := by @@ -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) @@ -1518,7 +1518,7 @@ theorem harmonicInner_eq_polynomialInner (n m : ℕ) exact homogeneousInner_eq_polynomialInner n m hp hq /-- The embedding inner core used in the spherical-code argument. -/ -@[implicit_reducible] def embeddingInnerCore +@[expose, implicit_reducible] def embeddingInnerCore {F E : Type*} [AddCommGroup F] [Module ℝ F] [NormedAddCommGroup E] [InnerProductSpace ℝ E] (f : F →ₗ[ℝ] E) (hf : Function.Injective f) : @@ -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 @@ -7738,7 +7738,7 @@ theorem adjoint_comp_self_of_inner rw [LinearMap.adjoint_inner_right, h, real_inner_smul_right] /-- The normalized channel isometry used in the spherical-code argument. -/ -def normalizedChannelIsometry +@[expose] def normalizedChannelIsometry {E F : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [NormedAddCommGroup F] [InnerProductSpace ℝ F] diff --git a/LeanPool/MetricCodes/Hierarchy.lean b/LeanPool/MetricCodes/Hierarchy.lean index 45b1bba569..09b45316f2 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 @@ -7345,7 +7345,7 @@ theorem sphericalCodeRate_le_of_eventually_exponential exact hcomparison.trans_eq hconstant.limsup_eq /-- The fixed level hierarchy code bound used in the spherical-code argument. -/ -def FixedLevelHierarchyCodeBound : Prop := +@[expose] def FixedLevelHierarchyCodeBound : Prop := ∀ {r : ℕ} {s R : ℝ}, 0 < s → s < 1 → ∀ (a : Fin (r + 1) → ℝ) (b : Fin r → ℝ), diff --git a/LeanPool/MetricCodes/HighestWeights.lean b/LeanPool/MetricCodes/HighestWeights.lean index 489894c1c3..2218777137 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 @@ -173,7 +173,7 @@ open MetricCodes.Spherical.HigherHarmonicYoung.ArbitraryRowSameAxisDiamondGapShi /-- The lowering polarization path followed by multiplication by its starting coordinate variable. -/ -def diamondPathOperator {r n : ℕ} +@[expose] def diamondPathOperator {r n : ℕ} (target : Fin (r + 1)) (k : Fin n) (S : Finset (Fin (r + 1))) : PolynomialSpace r n →ₗ[ℝ] PolynomialSpace r n := @@ -670,7 +670,7 @@ open MetricCodes.Spherical.HigherHarmonicYoung.ArbitraryRowSameAxisDiamondPathCo /-- The paired diamond-path commutator residual after subtracting the shifted omitted-path terms. -/ -def diamondPairResidual {r n : ℕ} +@[expose] def diamondPairResidual {r n : ℕ} (lam : Fin (r + 1) → ℕ) (target raised : Fin (r + 1)) (k : Fin n) (S : Finset (Fin (r + 1))) : @@ -835,7 +835,7 @@ theorem polarization_axialCoordinate_mul_lowerPolarizationPath_sub /-- A lowering polarization path followed by multiplication by the chosen starting axis coordinate. -/ -def axialCoordinateLowerPath +@[expose] def axialCoordinateLowerPath {r n : ℕ} (start : Fin (r + 1)) (k : Fin n) (path : List (Fin (r + 1))) : PolynomialSpace r n →ₗ[ℝ] PolynomialSpace r n := @@ -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) @@ -4092,7 +4092,7 @@ open MetricCodes.Spherical.HigherHarmonicYoung.MixedSignature open MetricCodes.Spherical.HigherYoungMixedGapLieGram /-- The polynomial complexification used in the spherical-code argument. -/ -def polynomialComplexification {r n : ℕ} : +@[expose] def polynomialComplexification {r n : ℕ} : PolynomialSpace r n →ₗ[ℝ] MvPolynomial (Fin ((r + 1) * n)) ℂ where toFun := MvPolynomial.map Complex.ofRealHom @@ -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) @@ -4419,7 +4419,7 @@ theorem youngComplexPolynomialSpan_inf_orthogonal_eq_bot {r n : ℕ} (youngRealPolynomialImage_inf_orthogonal_eq_bot lam W) /-- The root operator word used in the spherical-code argument. -/ -def rootOperatorWord {K V I : Type*} [Semiring K] +@[expose] def rootOperatorWord {K V I : Type*} [Semiring K] [AddCommMonoid V] [Module K V] (E : I → V →ₗ[K] V) : List I → V →ₗ[K] V | [] => LinearMap.id @@ -4461,14 +4461,14 @@ 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 := Submodule.span K (Set.range (fun w : List I => rootOperatorWord R w v)) /-- The sum of the operator-word cyclic submodules generated by two vectors. -/ -def operatorWordPairSpan +@[expose] def operatorWordPairSpan {K V I : Type*} [Semiring K] [AddCommMonoid V] [Module K V] (R : I → V →ₗ[K] V) (v w : V) : Submodule K V := @@ -4549,7 +4549,7 @@ theorem symmetric_eq_smul_id_of_complex_cyclic_eigenvector hcyclic /-- The dominant highest real vector used in the spherical-code argument. -/ -def dominantHighestRealVector {r n : ℕ} +@[expose] def dominantHighestRealVector {r n : ℕ} (hn : 2 * (r + 1) ≤ n) (lam : Fin (r + 1) → ℕ) (hdom : Antitone lam) : HarmonicYoungSpace (n := n) lam := @@ -4558,7 +4558,7 @@ def dominantHighestRealVector {r n : ℕ} (dominantHighestWeightWitness hn lam hdom).realPart_mem⟩ /-- The dominant highest imaginary vector used in the spherical-code argument. -/ -def dominantHighestImaginaryVector {r n : ℕ} +@[expose] def dominantHighestImaginaryVector {r n : ℕ} (hn : 2 * (r + 1) ≤ n) (lam : Fin (r + 1) → ℕ) (hdom : Antitone lam) : HarmonicYoungSpace (n := n) lam := @@ -4583,7 +4583,7 @@ theorem dominantHighestRealVector_ne_zero_or_imaginary_ne_zero exact congrArg Subtype.val hzero /-- The dominant highest rotation word span used in the spherical-code argument. -/ -def dominantHighestRotationWordSpan {r n : ℕ} +@[expose] def dominantHighestRotationWordSpan {r n : ℕ} (hn : 2 * (r + 1) ≤ n) (lam : Fin (r + 1) → ℕ) (hdom : Antitone lam) : Submodule ℝ (HarmonicYoungSpace (n := n) lam) := @@ -4731,7 +4731,7 @@ theorem youngClebschRaise_gram_scalar_of_dominantCyclicHighest · exact hcyclic /-- The arbitrary row raising gram scalar used in the spherical-code argument. -/ -def arbitraryRowRaisingGramScalar {r n : ℕ} +@[expose] def arbitraryRowRaisingGramScalar {r n : ℕ} (high : Fin (r + 1) → ℕ) (row : Fin (r + 1)) : ℝ := internalRowLowerGramScalar high row * (Module.finrank ℝ (HarmonicYoungSpace (n := n) high) : ℝ) / @@ -5851,7 +5851,7 @@ open MetricCodes.Spherical.HigherYoungCyclicHighestSchur open MetricCodes.Spherical.HigherYoungTwoRowLieIrreducibility /-- The young endomorphism highest polynomial used in the spherical-code argument. -/ -def youngEndomorphismHighestPolynomial +@[expose] def youngEndomorphismHighestPolynomial {r n : ℕ} (hn : 2 * (r + 1) ≤ n) (mu : Fin (r + 1) → ℕ) (hdom : Antitone mu) (A : HarmonicYoungSpace (n := n) mu →ₗ[ℝ] @@ -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 * @@ -6635,7 +6635,7 @@ open MetricCodes.Spherical.HigherHarmonicYoung open MetricCodes.Spherical.HigherHarmonicYoung.DeterminantVectors /-- The ambient pair index used in the spherical-code argument. -/ -def ambientPairIndex {r n : ℕ} +@[expose] def ambientPairIndex {r n : ℕ} (a : Fin n) (ha : a.val < 2 * (r + 1)) : Fin (r + 1) := ⟨a.val / 2, by omega⟩ @@ -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..89197fab5e 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) @@ -3155,7 +3155,7 @@ open MetricCodes.Spherical.HigherRepresentationGraph /-- The reverse interlacing polynomial seed bundled as a map to homogeneous highest-weight space. -/ -def reverseInterlacingHighestWeightSeed +@[expose] def reverseInterlacingHighestWeightSeed {r n : ℕ} (lam : Fin (r + 2) → ℕ) (mu : Fin (r + 1) → ℕ) (h : Interlaces lam mu) : HarmonicYoungSpace (n := n) mu →ₗ[ℝ] @@ -3176,7 +3176,7 @@ def reverseInterlacingHighestWeightSeed exact map_smul (reverseInterlacingPolynomialSeed lam mu) c p /-- The reverse interlacing harmonic branch used in the spherical-code argument. -/ -def reverseInterlacingHarmonicBranch +@[expose] def reverseInterlacingHarmonicBranch {r n : ℕ} (lam : Fin (r + 2) → ℕ) (mu : Fin (r + 1) → ℕ) (h : Interlaces lam mu) : HarmonicYoungSpace (n := n) mu →ₗ[ℝ] @@ -3236,7 +3236,7 @@ open SpherePacking.HarmonicCoordinateOperators /-- The reverse interlacing harmonic branch normalized to an isometry using its positive Gram scalar. -/ -def normalizedGelfandTsetlinFibre +@[expose] def normalizedGelfandTsetlinFibre {r n : ℕ} (lam : Fin (r + 2) → ℕ) (mu : Fin (r + 1) → ℕ) (h : Interlaces lam mu) (c : ℝ) (hc : 0 < c) @@ -3371,7 +3371,7 @@ theorem ambientCoordinateDerivation_X {r n : ℕ} not_false_eq_true, Pi.single_eq_of_ne, mul_zero, Finset.sum_const_zero, h, ↓reduceIte] /-- The ambient rotation used in the spherical-code argument. -/ -def ambientRotation {r n : ℕ} (a b : Fin n) : +@[expose] def ambientRotation {r n : ℕ} (a b : Fin n) : Derivation ℝ (PolynomialSpace r n) (PolynomialSpace r n) := ambientCoordinateDerivation (r := r) a b - ambientCoordinateDerivation (r := r) b a @@ -3557,7 +3557,7 @@ theorem ambientRotation_mem_harmonicYoungSubmodule {r n : ℕ} map_zero] /-- The young ambient rotation used in the spherical-code argument. -/ -def youngAmbientRotation {r n : ℕ} +@[expose] def youngAmbientRotation {r n : ℕ} (lam : Fin (r + 1) → ℕ) (a b : Fin n) : HarmonicYoungSpace (n := n) lam →ₗ[ℝ] HarmonicYoungSpace (n := n) lam where @@ -3718,7 +3718,7 @@ namespace ClebschRotation open MetricCodes.Spherical.HigherHarmonicYoung.MixedSignature /-- The euclidean ambient rotation used in the spherical-code argument. -/ -def euclideanAmbientRotation {n : ℕ} (a b : Fin n) : +@[expose] def euclideanAmbientRotation {n : ℕ} (a b : Fin n) : SpherePacking.Euclidean n →ₗ[ℝ] SpherePacking.Euclidean n where toFun v := v b • EuclideanSpace.basisFun (Fin n) ℝ a - @@ -3810,7 +3810,7 @@ theorem ambientRotation_rowAxisPolynomial {r n : ℕ} MvPolynomial.algebraMap_eq] /-- The tensor ambient rotation used in the spherical-code argument. -/ -def tensorAmbientRotation {r n : ℕ} +@[expose] def tensorAmbientRotation {r n : ℕ} (mu : Fin (r + 1) → ℕ) (a b : Fin n) : (SpherePacking.Euclidean n ⊗[ℝ] HarmonicYoungSpace (n := n) mu) →ₗ[ℝ] @@ -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 : ℝ)) @@ -4967,7 +4967,7 @@ open scoped BigOperators InnerProductSpace TensorProduct open MetricCodes.Spherical.HigherChannel /-- The adjacent casimir eigenvalue used in the spherical-code argument. -/ -def adjacentCasimirEigenvalue {r : ℕ} +@[expose] def adjacentCasimirEigenvalue {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) : ℝ := ∑ row : Fin (r + 1), (lam row : ℝ) * @@ -5009,7 +5009,7 @@ theorem adjacentCasimirEigenvalue_raiseWeight {r : ℕ} ring /-- The predicate asserting all rank one box neighbor. -/ -def IsAllRankOneBoxNeighbor {r : ℕ} +@[expose] def IsAllRankOneBoxNeighbor {r : ℕ} (target source : Fin (r + 1) → ℕ) : Prop := ∃ row : Fin (r + 1), source = raiseWeight target row ∨ target = raiseWeight source row @@ -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 @@ -6132,7 +6132,7 @@ open MetricCodes.Spherical.HigherHarmonicYoung.MixedSignature open MetricCodes.Spherical.HigherYoungMixedGapBranching /-- The predicate asserting rotation invariant. -/ -def IsRotationInvariant {V I : Type*} [AddCommGroup V] [Module ℝ V] +@[expose] def IsRotationInvariant {V I : Type*} [AddCommGroup V] [Module ℝ V] (R : I → V →ₗ[ℝ] V) (W : Submodule ℝ V) : Prop := ∀ (i : I) (v : V), v ∈ W → R i v ∈ W @@ -6196,7 +6196,7 @@ theorem symmetricRotationIntertwiner_eq_smul_id exact Module.End.mem_eigenspace_iff.mp hv /-- The young rotation family used in the spherical-code argument. -/ -def youngRotationFamily {r n : ℕ} +@[expose] def youngRotationFamily {r n : ℕ} (lam : Fin (r + 1) → ℕ) : Fin n × Fin n → HarmonicYoungSpace (n := n) lam →ₗ[ℝ] @@ -6537,7 +6537,7 @@ theorem positiveGelfandTsetlinFischerGram_of_irreducible _ = c * ⟪q, t⟫_ℝ := real_inner_smul_left q t c /-- The canonical gelfand tsetlin fibre used in the spherical-code argument. -/ -def canonicalGelfandTsetlinFibre +@[expose] def canonicalGelfandTsetlinFibre {r n : ℕ} (lam : Fin (r + 2) → ℕ) (mu : Fin (r + 1) → ℕ) (h : Interlaces lam mu) (hgram : PositiveGelfandTsetlinFischerGram (n := n) lam mu h) : @@ -6626,7 +6626,7 @@ theorem canonicalGelfandTsetlinFibre_channel_apply channel coefficient haxis p /-- The canonical box gelfand tsetlin fibre used in the spherical-code argument. -/ -def canonicalBoxGelfandTsetlinFibre {r m n : ℕ} +@[expose] def canonicalBoxGelfandTsetlinFibre {r m n : ℕ} (a : Fin (r + 2) → ℝ) (b : Fin (r + 1) → ℝ) (hstable : ∀ v : RectangularVertices.Vertex (r + 1) m, FiniteInterlacing n (RectangularVertices.signature a n v) @@ -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..8111ff3d50 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) @@ -419,7 +419,7 @@ theorem variableIndex_injective {r n : ℕ} : exact finProdFinEquiv.injective /-- The row euler used in the spherical-code argument. -/ -def rowEuler (r n : ℕ) (i : Fin (r + 1)) : +@[expose] def rowEuler (r n : ℕ) (i : Fin (r + 1)) : PolynomialSpace r n →ₗ[ℝ] PolynomialSpace r n := ∑ j : Fin n, (LinearMap.mulLeft ℝ (MvPolynomial.X (variableIndex i j))).comp @@ -435,7 +435,7 @@ def rowEuler (r n : ℕ) (i : Fin (r + 1)) : Finset.sum_apply, Function.comp_apply, LinearMap.mulLeft_apply] /-- The trace operator used in the spherical-code argument. -/ -def traceOperator (r n : ℕ) (i j : Fin (r + 1)) : +@[expose] def traceOperator (r n : ℕ) (i j : Fin (r + 1)) : PolynomialSpace r n →ₗ[ℝ] PolynomialSpace r n := ∑ k : Fin n, (MvPolynomial.pderiv (variableIndex i k)).toLinearMap.comp @@ -462,7 +462,7 @@ theorem traceOperator_comm (variableIndex i k) (variableIndex j k) p /-- The polarization used in the spherical-code argument. -/ -def polarization (r n : ℕ) (i j : Fin (r + 1)) : +@[expose] def polarization (r n : ℕ) (i j : Fin (r + 1)) : PolynomialSpace r n →ₗ[ℝ] PolynomialSpace r n := ∑ k : Fin n, (LinearMap.mulLeft ℝ (MvPolynomial.X (variableIndex i k))).comp @@ -495,7 +495,7 @@ def rowWeightSubmodule {r n : ℕ} (lam : Fin (r + 1) → ℕ) : rowEuler_apply, LinearMap.smul_apply, LinearMap.id_coe, id_eq, sub_eq_zero] /-- The trace free submodule used in the spherical-code argument. -/ -def traceFreeSubmodule (r n : ℕ) : +@[expose] def traceFreeSubmodule (r n : ℕ) : Submodule ℝ (PolynomialSpace r n) := ⨅ i : Fin (r + 1), ⨅ j : Fin (r + 1), (traceOperator r n i j).ker @@ -519,7 +519,7 @@ def highestWeightSubmodule (r n : ℕ) : simp only [highestWeightSubmodule, Submodule.mem_iInf, LinearMap.mem_ker, polarization_apply] /-- The harmonic young submodule used in the spherical-code argument. -/ -def harmonicYoungSubmodule {r n : ℕ} (lam : Fin (r + 1) → ℕ) : +@[expose] def harmonicYoungSubmodule {r n : ℕ} (lam : Fin (r + 1) → ℕ) : Submodule ℝ (PolynomialSpace r n) := MvPolynomial.homogeneousSubmodule (Fin ((r + 1) * n)) ℝ (∑ i, lam i) ⊓ @@ -833,7 +833,7 @@ section open scoped BigOperators InnerProductSpace /-- The young homogeneous embedding used in the spherical-code argument. -/ -def youngHomogeneousEmbedding {r n : ℕ} +@[expose] def youngHomogeneousEmbedding {r n : ℕ} (lam : Fin (r + 1) → ℕ) : HarmonicYoungSpace (n := n) lam →ₗ[ℝ] SpherePacking.Fischer.Homogeneous ((r + 1) * n) (∑ i, lam i) := @@ -849,7 +849,7 @@ theorem youngHomogeneousEmbedding_injective {r n : ℕ} (z : PolynomialSpace r n)) h /-- The Fischer coefficient embedding restricted to the harmonic Young space of weight `lam`. -/ -def youngCoefficientEmbedding {r n : ℕ} +@[expose] def youngCoefficientEmbedding {r n : ℕ} (lam : Fin (r + 1) → ℕ) : HarmonicYoungSpace (n := n) lam →ₗ[ℝ] SpherePacking.Fischer.CoefficientSpace @@ -866,7 +866,7 @@ theorem youngCoefficientEmbedding_injective {r n : ℕ} (youngHomogeneousEmbedding_injective lam) /-- The Fischer inner product of harmonic Young polynomials through their homogeneous embedding. -/ -def youngFischerInner {r n : ℕ} +@[expose] def youngFischerInner {r n : ℕ} (lam : Fin (r + 1) → ℕ) (p q : HarmonicYoungSpace (n := n) lam) : ℝ := SpherePacking.Fischer.homogeneousInner @@ -887,7 +887,7 @@ theorem youngFischerInner_eq_polynomialInner {r n : ℕ} /-- The inner product core on the harmonic Young space induced by its injective coefficient embedding. -/ -@[implicit_reducible] def youngFischerCore {r n : ℕ} +@[expose, implicit_reducible] def youngFischerCore {r n : ℕ} (lam : Fin (r + 1) → ℕ) : InnerProductSpace.Core ℝ (HarmonicYoungSpace (n := n) lam) := SpherePacking.Fischer.embeddingInnerCore @@ -943,7 +943,7 @@ section open scoped BigOperators InnerProductSpace /-- The row axis polynomial used in the spherical-code argument. -/ -def rowAxisPolynomial {r n : ℕ} (i : Fin (r + 1)) +@[expose] def rowAxisPolynomial {r n : ℕ} (i : Fin (r + 1)) (v : SpherePacking.Euclidean n) : PolynomialSpace r n := SpherePacking.axisPolynomial ((r + 1) * n) (rowVector i v) @@ -1188,7 +1188,7 @@ def youngProjection {r n : ℕ} (youngCoefficientRange lam).isCompl_orthogonal p /-- The young homogeneous projection used in the spherical-code argument. -/ -def youngHomogeneousProjection {r n : ℕ} +@[expose] def youngHomogeneousProjection {r n : ℕ} (lam : Fin (r + 1) → ℕ) : SpherePacking.Fischer.Homogeneous ((r + 1) * n) (∑ i, lam i) →ₗ[ℝ] @@ -1198,7 +1198,7 @@ def youngHomogeneousProjection {r n : ℕ} ((r + 1) * n) (∑ i, lam i)) /-- The row axis homogeneous used in the spherical-code argument. -/ -def rowAxisHomogeneous {r n : ℕ} +@[expose] def rowAxisHomogeneous {r n : ℕ} (mu lam : Fin (r + 1) → ℕ) (hdeg : (∑ i, mu i) = (∑ i, lam i) + 1) (i : Fin (r + 1)) (v : SpherePacking.Euclidean n) : @@ -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) : @@ -1229,7 +1229,7 @@ def projectedCoordinateRaise {r n : ℕ} (rowAxisHomogeneous mu lam hdeg i v) /-- The row directional homogeneous used in the spherical-code argument. -/ -def rowDirectionalHomogeneous {r n : ℕ} +@[expose] def rowDirectionalHomogeneous {r n : ℕ} (mu lam : Fin (r + 1) → ℕ) (hdeg : (∑ i, lam i) = (∑ i, mu i) + 1) (i : Fin (r + 1)) (v : SpherePacking.Euclidean n) : @@ -1251,7 +1251,7 @@ def rowDirectionalHomogeneous {r n : ℕ} simpa only [SpherePacking.directionalDerivative_apply, add_tsub_cancel_right] using hp) /-- The projected coordinate lower used in the spherical-code argument. -/ -def projectedCoordinateLower {r n : ℕ} +@[expose] def projectedCoordinateLower {r n : ℕ} (mu lam : Fin (r + 1) → ℕ) (hdeg : (∑ i, lam i) = (∑ i, mu 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 : ℝ)⌋₊ @@ -2163,12 +2163,12 @@ abbrev AmbientWeight (r : ℕ) := Fin (r + 1) → ℕ abbrev StabilizerWeight (r : ℕ) := Fin r → ℕ /-- The interlaces used in the spherical-code argument. -/ -def Interlaces {r : ℕ} +@[expose] def Interlaces {r : ℕ} (lam : AmbientWeight r) (μ : StabilizerWeight r) : Prop := ∀ i : Fin r, μ i ≤ lam i.castSucc ∧ lam i.succ ≤ μ i /-- The strict interlaces used in the spherical-code argument. -/ -def StrictInterlaces {r : ℕ} +@[expose] def StrictInterlaces {r : ℕ} (lam : AmbientWeight r) (μ : StabilizerWeight r) : Prop := ∀ i : Fin r, μ i < lam i.castSucc ∧ lam i.succ < μ i @@ -2258,7 +2258,7 @@ open scoped BigOperators open MetricCodes.Spherical.TwoRowYoungBidegreeDecomposition /-- The row exponent used in the spherical-code argument. -/ -def rowExponent {r n : ℕ} +@[expose] def rowExponent {r n : ℕ} (d : Fin ((r + 1) * n) →₀ ℕ) (i : Fin (r + 1)) : Fin n →₀ ℕ := Finsupp.equivFunOnFinite.symm fun j => d (variableIndex i j) @@ -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 @@ -2431,7 +2431,7 @@ theorem card_youngMultihomogeneousExponents {r n : ℕ} exact card_rowDegreeFamilies lam /-- The young multihomogeneous submodule used in the spherical-code argument. -/ -def youngMultihomogeneousSubmodule {r : ℕ} (n : ℕ) +@[expose] def youngMultihomogeneousSubmodule {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) : Submodule ℝ (PolynomialSpace r n) := MvPolynomial.restrictSupport ℝ (youngMultihomogeneousExponents n lam : @@ -3278,7 +3278,7 @@ private theorem coordinateMatrix_id_metriccodes2_851911c7 {T : Type*} exact LinearMap.toMatrix_id (euclideanBasis T).toBasis /-- The to finite data used in the spherical-code argument. -/ -def toFiniteData (G : RealizedHilbertGraph I X E V F) : +@[expose] def toFiniteData (G : RealizedHilbertGraph I X E V F) : MetricCodes.HigherProjectionGraph.Data I X (Module.finrank ℝ V) (Module.finrank ℝ E) (Module.finrank ℝ F) where @@ -3488,7 +3488,7 @@ omit [∀ i, FiniteDimensional ℝ (V i)] in vertexInclusion_apply_self, IsEmpty.forall_iff] /-- The vertex projection used in the spherical-code argument. -/ -def vertexProjection (i : I) : VertexAmbient V →ₗ[ℝ] VertexAmbient V := +@[expose] def vertexProjection (i : I) : VertexAmbient V →ₗ[ℝ] VertexAmbient V := (vertexInclusion V i).toLinearMap.comp (vertexInclusion V i).adjoint @[simp] theorem vertexProjection_apply_self (i : I) @@ -3562,7 +3562,7 @@ open MetricCodes.Spherical.HigherYoungGraphAssembly open MetricCodes.Spherical.HigherProjectionInstantiation /-- The moving young fibre used in the spherical-code argument. -/ -def movingYoungFibre {r n : ℕ} {E : Type*} +@[expose] def movingYoungFibre {r n : ℕ} {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] (lam : Fin (r + 1) → ℕ) (o : SpherePoint n) @@ -3579,7 +3579,7 @@ abbrev YoungVertex {I : Type*} {r n : ℕ} HarmonicYoungSpace (n := n) (lam i) /-- The moving young block fibre used in the spherical-code argument. -/ -def movingYoungBlockFibre {I : Type*} [Fintype I] [DecidableEq I] +@[expose] def movingYoungBlockFibre {I : Type*} [Fintype I] [DecidableEq I] {r n : ℕ} {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] (lam : I → Fin (r + 1) → ℕ) @@ -3639,7 +3639,7 @@ theorem movingYoungBlockFibre_support movingYoungBlockFibre_apply_ne lam o base i j hji] /-- The axis tensor used in the spherical-code argument. -/ -def axisTensor {n : ℕ} {V : Type*} +@[expose] def axisTensor {n : ℕ} {V : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] (x : SpherePoint n) : V →ₗ[ℝ] (SpherePacking.Euclidean n ⊗[ℝ] V) := @@ -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) * @@ -3792,7 +3792,7 @@ theorem rowPairingPolynomial_isHomogeneous {r n : ℕ} (variableIndex j k)) /-- The homogeneous row pairing multiplication used in the spherical-code argument. -/ -def homogeneousRowPairingMultiplication {r n : ℕ} +@[expose] def homogeneousRowPairingMultiplication {r n : ℕ} (i j : Fin (r + 1)) (m : ℕ) : SpherePacking.Fischer.Homogeneous ((r + 1) * n) m →ₗ[ℝ] SpherePacking.Fischer.Homogeneous ((r + 1) * n) (m + 2) := @@ -3823,7 +3823,7 @@ theorem traceOperator_isHomogeneous {r n m : ℕ} (hp.pderiv (i := variableIndex j k)).pderiv (i := variableIndex i k) /-- The homogeneous row trace used in the spherical-code argument. -/ -def homogeneousRowTrace {r n : ℕ} +@[expose] def homogeneousRowTrace {r n : ℕ} (i j : Fin (r + 1)) (m : ℕ) : SpherePacking.Fischer.Homogeneous ((r + 1) * n) (m + 2) →ₗ[ℝ] SpherePacking.Fischer.Homogeneous ((r + 1) * n) m := @@ -4195,7 +4195,7 @@ def simultaneousHarmonicCoefficientProjection (r n m : ℕ) : (S.projectionOnto Sᗮ S.isCompl_orthogonal) /-- The simultaneous harmonic projection used in the spherical-code argument. -/ -def simultaneousHarmonicProjection (r n m : ℕ) : +@[expose] def simultaneousHarmonicProjection (r n m : ℕ) : SpherePacking.Fischer.Homogeneous ((r + 1) * n) m →ₗ[ℝ] homogeneousTraceFreeSubmodule r n m := (simultaneousHarmonicCoefficientProjection r n m).comp @@ -4302,7 +4302,7 @@ theorem polarization_isHomogeneous_harmonicLift {r n m : ℕ} j k)) /-- The row polarization operator restricted to homogeneous degree `m`. -/ -def homogeneousPolarization (r n m : ℕ) +@[expose] def homogeneousPolarization (r n m : ℕ) (i j : Fin (r + 1)) : SpherePacking.Fischer.Homogeneous ((r + 1) * n) m →ₗ[ℝ] SpherePacking.Fischer.Homogeneous ((r + 1) * n) m := @@ -4506,7 +4506,7 @@ def homogeneousYoungHighestWeightSubmodule {r n : ℕ} mem_highestWeightSubmodule] /-- The harmonic young highest weight embedding used in the spherical-code argument. -/ -def harmonicYoungHighestWeightEmbedding {r n : ℕ} +@[expose] def harmonicYoungHighestWeightEmbedding {r n : ℕ} (lam : Fin (r + 1) → ℕ) : HarmonicYoungSpace (n := n) lam →ₗ[ℝ] homogeneousYoungHighestWeightSubmodule (n := n) lam where @@ -4526,7 +4526,7 @@ def harmonicYoungHighestWeightEmbedding {r n : ℕ} exact map_smul (youngHomogeneousEmbedding lam) c p /-- The young harmonic lift used in the spherical-code argument. -/ -def youngHarmonicLift {r n : ℕ} +@[expose] def youngHarmonicLift {r n : ℕ} (lam : Fin (r + 1) → ℕ) : homogeneousYoungHighestWeightSubmodule (n := n) lam →ₗ[ℝ] HarmonicYoungSpace (n := n) lam where @@ -4782,7 +4782,7 @@ open MetricCodes.Spherical.HigherYoungGraphAssembly open MetricCodes.Spherical.MixedTensorRepresentations /-- The full branch weight used in the spherical-code argument. -/ -def FullBranchWeight {r : ℕ} (lam : Fin (r + 1) → ℕ) := +@[expose] def FullBranchWeight {r : ℕ} (lam : Fin (r + 1) → ℕ) := { mu : (∀ i : Fin (r + 1), Fin (lam i + 1)) // ∀ i : Fin r, lam i.succ ≤ (mu i.castSucc).val } @@ -4797,7 +4797,7 @@ noncomputable instance fullBranchWeightDecidableEq {r : ℕ} Classical.decEq _ /-- The full branch signature used in the spherical-code argument. -/ -def fullBranchSignature {r : ℕ} +@[expose] def fullBranchSignature {r : ℕ} {lam : Fin (r + 1) → ℕ} (mu : FullBranchWeight lam) : Fin (r + 1) → ℕ := fun i => (mu.val i).val @@ -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, @@ -4887,14 +4887,14 @@ section open scoped BigOperators /-- The polynomial real part used in the spherical-code argument. -/ -def polynomialRealPart {σ : Type*} : +@[expose] def polynomialRealPart {σ : Type*} : MvPolynomial σ ℂ →ₗ[ℝ] MvPolynomial σ ℝ := (AddMonoidAlgebra.coeffLinearEquiv ℝ).symm.toLinearMap.comp ((Finsupp.mapRange.linearMap Complex.reLm).comp (AddMonoidAlgebra.coeffLinearEquiv ℝ).toLinearMap) /-- The polynomial imaginary part used in the spherical-code argument. -/ -def polynomialImaginaryPart {σ : Type*} : +@[expose] def polynomialImaginaryPart {σ : Type*} : MvPolynomial σ ℂ →ₗ[ℝ] MvPolynomial σ ℝ := (AddMonoidAlgebra.coeffLinearEquiv ℝ).symm.toLinearMap.comp ((Finsupp.mapRange.linearMap Complex.imLm).comp @@ -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 @@ -5332,7 +5332,7 @@ theorem complexTraceOperator_nullSubstitution {r m n : ℕ} rw [hnull, zero_mul] /-- The source polarization used in the spherical-code argument. -/ -def sourcePolarization {r m : ℕ} (i j : Fin (r + 1)) +@[expose] def sourcePolarization {r m : ℕ} (i j : Fin (r + 1)) (q : MvPolynomial (Fin (r + 1) × Fin m) ℂ) : MvPolynomial (Fin (r + 1) × Fin m) ℂ := ∑ a : Fin m, MvPolynomial.X (i, a) * MvPolynomial.pderiv (j, a) q @@ -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)) @@ -5901,12 +5901,12 @@ theorem eval_leadingMinor {r n : ℕ} rw [hmatrix, Matrix.det_one] /-- The highest weight polynomial used in the spherical-code argument. -/ -def highestWeightPolynomial {r n : ℕ} (h : 2 * (r + 1) ≤ n) +@[expose] def highestWeightPolynomial {r n : ℕ} (h : 2 * (r + 1) ≤ n) (e : Fin (r + 1) → ℕ) : MvPolynomial (Fin ((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 @@ -6112,7 +6112,7 @@ theorem determinantWeight_signatureExponent {r : ℕ} exact hdom (Fin.castSucc_lt_succ.le) /-- The dominant highest weight witness used in the spherical-code argument. -/ -def dominantHighestWeightWitness {r n : ℕ} +@[expose] def dominantHighestWeightWitness {r n : ℕ} (h : 2 * (r + 1) ≤ n) (lam : Fin (r + 1) → ℕ) (hdom : Antitone lam) : ComplexHighestWeightWitness (n := n) lam where @@ -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)) - @@ -6180,7 +6180,7 @@ theorem pderiv_odd_isotropicVariable {r n : ℕ} MvPolynomial.derivation_C, add_zero, zero_add] /-- The ambient positive root used in the spherical-code argument. -/ -def ambientPositiveRoot {r n : ℕ} +@[expose] def ambientPositiveRoot {r n : ℕ} (h : 2 * (r + 1) ≤ n) (p q : Fin (r + 1)) : Derivation ℂ (MvPolynomial (Fin ((r + 1) * n)) ℂ) (MvPolynomial (Fin ((r + 1) * n)) ℂ) := @@ -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)) ℂ) := @@ -6498,7 +6498,7 @@ theorem pderiv_outside_isotropicVariable {r n : ℕ} MvPolynomial.derivation_C, add_zero] /-- The ambient short positive root used in the spherical-code argument. -/ -def ambientShortPositiveRoot {r n : ℕ} +@[expose] def ambientShortPositiveRoot {r n : ℕ} (h : 2 * (r + 1) ≤ n) (p : Fin (r + 1)) (t : Fin n) : Derivation ℂ (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)) ℂ) := @@ -6715,23 +6715,23 @@ open scoped BigOperators namespace HigherChannel /-- The finite interlacing used in the spherical-code argument. -/ -def FiniteInterlacing {r : ℕ} (n : ℕ) +@[expose] def FiniteInterlacing {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) (mu : Fin r → ℕ) : Prop := 2 * r + 4 ≤ 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, @@ -7322,7 +7322,7 @@ theorem transversePolynomial_mem_harmonicYoung {r n : ℕ} hp.2.2.2 i j hij', map_zero] /-- Embed harmonic Young space by appending a zero weight and adding a transverse coordinate. -/ -def appendZeroYoungEmbedding {r n : ℕ} +@[expose] def appendZeroYoungEmbedding {r n : ℕ} (mu : Fin (r + 1) → ℕ) : HarmonicYoungSpace (n := n) mu →ₗ[ℝ] HarmonicYoungSpace (n := n + 1) (appendZeroWeight mu) where @@ -7340,7 +7340,7 @@ def appendZeroYoungEmbedding {r n : ℕ} (p : PolynomialSpace r n) /-- The transverse embedding with an appended zero weight, bundled as a linear isometry. -/ -def appendZeroYoungIsometry {r n : ℕ} +@[expose] def appendZeroYoungIsometry {r n : ℕ} (mu : Fin (r + 1) → ℕ) : HarmonicYoungSpace (n := n) mu →ₗᵢ[ℝ] HarmonicYoungSpace (n := n + 1) (appendZeroWeight mu) := @@ -7390,7 +7390,7 @@ theorem zeroRowVariableIndex_injective {r n : ℕ} : · exact congrArg (fun z : Fin (r + 2) × Fin n => z.2) hpair /-- The zero row polynomial used in the spherical-code argument. -/ -def zeroRowPolynomial {r : ℕ} (n : ℕ) : +@[expose] def zeroRowPolynomial {r : ℕ} (n : ℕ) : PolynomialSpace r n →ₐ[ℝ] PolynomialSpace (r + 1) n := MvPolynomial.rename (zeroRowVariableIndex (r := r) (n := n)) @@ -7547,7 +7547,7 @@ theorem zeroRowPolynomial_mem_harmonicYoung_iff {r n : ℕ} /-- Embed harmonic Young space by appending a zero row weight while retaining the coordinate dimension. -/ -def appendZeroRowEmbedding {r n : ℕ} +@[expose] def appendZeroRowEmbedding {r n : ℕ} (mu : Fin (r + 1) → ℕ) : HarmonicYoungSpace (n := n) mu →ₗ[ℝ] HarmonicYoungSpace (n := n) (appendZeroWeight mu) where @@ -7616,7 +7616,7 @@ theorem appendZeroRowEmbedding_surjective {r n : ℕ} exact hq' /-- The embedding that appends a zero row weight, bundled as a linear isometry. -/ -def appendZeroRowIsometry {r n : ℕ} +@[expose] def appendZeroRowIsometry {r n : ℕ} (mu : Fin (r + 1) → ℕ) : HarmonicYoungSpace (n := n) mu →ₗᵢ[ℝ] HarmonicYoungSpace (n := n) (appendZeroWeight mu) := @@ -7639,7 +7639,7 @@ def appendZeroRowIsometry {r n : ℕ} _ = ⟪p, q⟫_ℝ := (young_inner_eq_polynomialInner mu p q).symm) /-- The append zero row isometry equiv used in the spherical-code argument. -/ -def appendZeroRowIsometryEquiv {r n : ℕ} +@[expose] def appendZeroRowIsometryEquiv {r n : ℕ} (mu : Fin (r + 1) → ℕ) : HarmonicYoungSpace (n := n) mu ≃ₗᵢ[ℝ] HarmonicYoungSpace (n := n) (appendZeroWeight mu) := @@ -7686,7 +7686,7 @@ theorem fullBranchOfInterlaces_signature_eq_appendZeroWeight rw [fullBranchOfInterlaces_signature, appendZeroWeight_eq_snoc] /-- The terminal zero selected branch isometry used in the spherical-code argument. -/ -def terminalZeroSelectedBranchIsometry {r n : ℕ} +@[expose] def terminalZeroSelectedBranchIsometry {r n : ℕ} (mu : Fin (r + 1) → ℕ) : HarmonicYoungSpace (n := n) mu →ₗᵢ[ℝ] HarmonicYoungSpace (n := n + 1) (appendZeroWeight mu) := @@ -7769,7 +7769,7 @@ theorem projectedCoordinateLower_axis_smul {r n : ℕ} smul_smul] /-- The projected coordinate lower axis used in the spherical-code argument. -/ -def projectedCoordinateLowerAxis {r n : ℕ} +@[expose] def projectedCoordinateLowerAxis {r n : ℕ} (mu lam : Fin (r + 1) → ℕ) (hdeg : (∑ i, lam i) = (∑ i, mu i) + 1) (row : Fin (r + 1)) @@ -7831,7 +7831,7 @@ theorem projectedCoordinateRaise_axis_smul {r n : ℕ} (real_inner_smul_left _ _ _).symm /-- The projected coordinate raise axis used in the spherical-code argument. -/ -def projectedCoordinateRaiseAxis {r n : ℕ} +@[expose] def projectedCoordinateRaiseAxis {r n : ℕ} (mu lam : Fin (r + 1) → ℕ) (hdeg : (∑ i, mu i) = (∑ i, lam i) + 1) (row : Fin (r + 1)) @@ -7843,7 +7843,7 @@ def projectedCoordinateRaiseAxis {r n : ℕ} map_smul' c v := projectedCoordinateRaise_axis_smul mu lam hdeg row c v p /-- The young clebsch raise used in the spherical-code argument. -/ -def youngClebschRaise {r n : ℕ} +@[expose] def youngClebschRaise {r n : ℕ} (mu lam : Fin (r + 1) → ℕ) (hdeg : (∑ i, mu i) = (∑ i, lam i) + 1) (row : Fin (r + 1)) : @@ -7873,7 +7873,7 @@ def youngClebschRaise {r n : ℕ} (EuclideanSpace.basisFun (Fin n) ℝ j) p := rfl /-- The young clebsch lower used in the spherical-code argument. -/ -def youngClebschLower {r n : ℕ} +@[expose] def youngClebschLower {r n : ℕ} (mu lam : Fin (r + 1) → ℕ) (hdeg : (∑ i, lam i) = (∑ i, mu i) + 1) (row : Fin (r + 1)) : @@ -8123,7 +8123,7 @@ section open scoped BigOperators /-- The joint harmonic weight submodule used in the spherical-code argument. -/ -def jointHarmonicWeightSubmodule {r : ℕ} +@[expose] def jointHarmonicWeightSubmodule {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) : Submodule ℝ (youngMultihomogeneousSubmodule n lam) := (traceFreeSubmodule r n).comap @@ -8149,7 +8149,7 @@ instance jointHarmonicWeightSpace_finiteDimensional /-- Regard a joint harmonic weight polynomial as homogeneous of degree equal to the sum of its row weights. -/ -def jointHarmonicWeightHomogeneousEmbedding {r : ℕ} +@[expose] def jointHarmonicWeightHomogeneousEmbedding {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) : JointHarmonicWeightSpace n lam →ₗ[ℝ] SpherePacking.Fischer.Homogeneous ((r + 1) * n) (∑ i, lam i) where @@ -8377,7 +8377,7 @@ theorem youngClebschRaiseLower_trace {r n : ℕ} (EuclideanSpace.basisFun (Fin n) ℝ j))).symm /-- The normalized young clebsch raise used in the spherical-code argument. -/ -def normalizedYoungClebschRaise {r n : ℕ} +@[expose] def normalizedYoungClebschRaise {r n : ℕ} (mu lam : Fin (r + 1) → ℕ) (hdeg : (∑ i, mu i) = (∑ i, lam i) + 1) (row : Fin (r + 1)) (c : ℝ) (hc : 0 < c) @@ -8392,7 +8392,7 @@ def normalizedYoungClebschRaise {r n : ℕ} (youngClebschRaise mu lam hdeg row) c hc hgram /-- The normalized young clebsch lower used in the spherical-code argument. -/ -def normalizedYoungClebschLower {r n : ℕ} +@[expose] def normalizedYoungClebschLower {r n : ℕ} (mu lam : Fin (r + 1) → ℕ) (hdeg : (∑ i, lam i) = (∑ i, mu i) + 1) (row : Fin (r + 1)) (c : ℝ) (hc : 0 < c) @@ -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 @@ -8492,7 +8492,7 @@ abbrev YoungGramRadialWeightQuotient {r : ℕ} youngGramRadialWeightSubmodule n lam /-- Regard a polynomial of the prescribed row multidegrees as homogeneous of their total degree. -/ -def youngMultihomogeneousHomogeneousEmbedding {r : ℕ} +@[expose] def youngMultihomogeneousHomogeneousEmbedding {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) : youngMultihomogeneousSubmodule n lam →ₗ[ℝ] SpherePacking.Fischer.Homogeneous diff --git a/LeanPool/MetricCodes/Rigidity.lean b/LeanPool/MetricCodes/Rigidity.lean index 14a77c8278..acb9e56c91 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 @@ -2194,7 +2194,7 @@ theorem fullRootExteriorUpperPolynomialAction_contraction_commute split_ifs <;> simp /-- The upper polynomial action composed with exterior creation of the same root. -/ -def fullRootExteriorUpperActionAtom (r n : ℕ) (α : PositiveRoot r) : +@[expose] def fullRootExteriorUpperActionAtom (r n : ℕ) (α : PositiveRoot r) : Module.End ℝ (FullRootExteriorPolynomialChain r n) := fullRootExteriorUpperPolynomialAction r n α * actualExteriorRootCreation (PolynomialSpace r n) α diff --git a/LeanPool/MetricCodes/RootComplex.lean b/LeanPool/MetricCodes/RootComplex.lean index f2d4738df1..3854c3e3d1 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 @@ -47,7 +47,7 @@ inductive OrthogonalPositiveRoot (r n : ℕ) where (_ : 2 * (r + 1) ≤ t.val) /-- The orthogonal positive root derivation used in the spherical-code argument. -/ -def orthogonalPositiveRootDerivation {r n : ℕ} +@[expose] def orthogonalPositiveRootDerivation {r n : ℕ} (h : 2 * (r + 1) ≤ n) : OrthogonalPositiveRoot r n → Derivation ℂ (MvPolynomial (Fin ((r + 1) * n)) ℂ) @@ -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 : ℝ) @@ -1982,7 +1982,7 @@ instance positiveRootLinearOrder (r : ℕ) : LinearOrder (PositiveRoot r) := Subtype.ext ((finProdFinEquiv (m := r + 1) (n := r + 1)).injective h)) /-- The root wedge insert used in the spherical-code argument. -/ -def rootWedgeInsert {r k : ℕ} (T : RootWedge r k) +@[expose] def rootWedgeInsert {r k : ℕ} (T : RootWedge r k) (α : PositiveRoot r) (hα : α ∉ T.val) : RootWedge r (k + 1) := ⟨insert α T.val, by simp only [hα, not_false_eq_true, Finset.card_insert_of_notMem, T.property]⟩ @@ -1991,12 +1991,12 @@ 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 : ℝ) /-- The root action boundary used in the spherical-code argument. -/ -def rootActionBoundary (r n k : ℕ) : +@[expose] def rootActionBoundary (r n k : ℕ) : RootPolynomialChain r n (k + 1) →ₗ[ℝ] RootPolynomialChain r n k where toFun f T := @@ -2118,7 +2118,7 @@ theorem rootTransferTarget_eq {r : ℕ} not_false_eq_true, Function.update_of_ne] /-- The weighted positive root operator used in the spherical-code argument. -/ -def weightedPositiveRootOperator {r : ℕ} (n : ℕ) +@[expose] def weightedPositiveRootOperator {r : ℕ} (n : ℕ) (μ : Fin (r + 1) → ℕ) (α : PositiveRoot r) (hμ : 0 < μ (positiveRootFirst α)) : JointHarmonicWeightSpace n μ →ₗ[ℝ] @@ -2150,7 +2150,7 @@ def weightedPositiveRootOperator {r : ℕ} (n : ℕ) (p.val : PolynomialSpace r n) /-- The weighted positive root operator star used in the spherical-code argument. -/ -def weightedPositiveRootOperatorStar {r : ℕ} (n : ℕ) +@[expose] def weightedPositiveRootOperatorStar {r : ℕ} (n : ℕ) (μ : Fin (r + 1) → ℕ) (α : PositiveRoot r) (hμ : 0 < μ (positiveRootFirst α)) : JointHarmonicWeightSpace n (lowerRootWeight μ α) →ₗ[ℝ] @@ -2244,7 +2244,7 @@ open scoped BigOperators open MetricCodes.Spherical.HigherHarmonicYoung /-- The root admissible insert used in the spherical-code argument. -/ -def rootAdmissibleInsert {r k : ℕ} +@[expose] def rootAdmissibleInsert {r k : ℕ} (lam : Fin (r + 1) → ℕ) (T : AdmissibleRootWedge lam k) (α : PositiveRoot r) (hα : α ∉ T.val.val) @@ -2320,7 +2320,7 @@ def jointHarmonicWeightCast {r : ℕ} (n : ℕ) rfl /-- The weighted exterior root edge used in the spherical-code argument. -/ -def weightedExteriorRootEdge {r k : ℕ} +@[expose] def weightedExteriorRootEdge {r k : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) (T : AdmissibleRootWedge lam k) (α : PositiveRoot r) (hα : α ∉ T.val.val) @@ -2338,7 +2338,7 @@ def weightedExteriorRootEdge {r k : ℕ} (rootAdmissibleInsert_first_pos lam T α hα hadm)) /-- The weighted exterior action differential used in the spherical-code argument. -/ -def weightedExteriorActionDifferential {r : ℕ} +@[expose] def weightedExteriorActionDifferential {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) (k : ℕ) : RootJointHarmonicChain n lam (k + 1) →ₗ[ℝ] RootJointHarmonicChain n lam k where @@ -2401,7 +2401,7 @@ open ArbitraryRankMixedTraceRegularity attribute [local instance] MvPolynomial.weightedGradedAlgebra /-- The ideal generated by the first `k` Gram quadratic relations. -/ -def youngGramPrefixIdeal (r n k : ℕ) : Ideal (PolynomialSpace r n) := +@[expose] def youngGramPrefixIdeal (r n k : ℕ) : Ideal (PolynomialSpace r n) := Ideal.ofList ((gramQuadraticList r n).take k) /-- The multihomogeneous weight submodule lying in the ideal of the first `k` Gram relations. -/ @@ -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 ℝ @@ -3650,7 +3650,7 @@ open scoped BigOperators open scoped InnerProductSpace /-- The inner product core on a finite product, obtained by summing the component Fischer cores. -/ -@[implicit_reducible] +@[expose, implicit_reducible] def finitePiFischerCore {ι : Type*} [Fintype ι] (V : ι → Type*) [∀ i, AddCommGroup (V i)] [∀ i, Module ℝ (V i)] @@ -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 α) @@ -3806,7 +3806,7 @@ def activeRootRaisedWeight {r : ℕ} (activeRootBaseWeight lam α (positiveRootFirst α.val) + 1) /-- The active positive root raise used in the spherical-code argument. -/ -def activePositiveRootRaise {r : ℕ} +@[expose] def activePositiveRootRaise {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) (α : ActivePositiveRoot lam) : JointHarmonicWeightSpace n lam →ₗ[ℝ] @@ -3835,7 +3835,7 @@ def activePositiveRootRaise {r : ℕ} (positiveRootSecond α.val)) c (p.val : PolynomialSpace r n) /-- The active positive root lower used in the spherical-code argument. -/ -def activePositiveRootLower {r : ℕ} +@[expose] def activePositiveRootLower {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) (α : ActivePositiveRoot lam) : JointHarmonicWeightSpace n (activeRootRaisedWeight lam α) →ₗ[ℝ] @@ -3994,7 +3994,7 @@ open scoped BigOperators open MetricCodes.Spherical.HigherHarmonicYoung /-- The root joint harmonic chain fischer core component. -/ -@[implicit_reducible] +@[expose, implicit_reducible] def rootJointHarmonicChainFischerCore {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) (k : ℕ) : InnerProductSpace.Core ℝ (RootJointHarmonicChain n lam k) := @@ -4041,7 +4041,7 @@ theorem rootWedgeWeight_degree_zero {r : ℕ} Int.toNat_natCast] /-- The root joint harmonic degree zero equiv used in the spherical-code argument. -/ -def rootJointHarmonicDegreeZeroEquiv {r : ℕ} +@[expose] def rootJointHarmonicDegreeZeroEquiv {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) : RootJointHarmonicChain n lam 0 ≃ₗ[ℝ] JointHarmonicWeightSpace n lam := @@ -4053,7 +4053,7 @@ def rootJointHarmonicDegreeZeroEquiv {r : ℕ} (JointHarmonicWeightSpace n lam)) /-- The root degree zero positive cochain used in the spherical-code argument. -/ -def rootDegreeZeroPositiveCochain {r : ℕ} +@[expose] def rootDegreeZeroPositiveCochain {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) : RootJointHarmonicChain n lam 0 →ₗ[ℝ] (∀ α : ActivePositiveRoot lam, @@ -4918,14 +4918,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 * @@ -5036,7 +5036,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 @@ -5145,7 +5145,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 α, @@ -5161,7 +5161,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. -/ @@ -5198,7 +5198,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 @@ -5416,7 +5416,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..3b9d020a1b 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 @@ -1665,7 +1665,7 @@ theorem sum_det_eq_det_rowSum /-- A Jacobi–Trudi row evaluated at an allowed branching coordinate using the coefficients in ambient dimension `n`. -/ -def branchJacobiTrudiRow {r : ℕ} (n : ℕ) +@[expose] def branchJacobiTrudiRow {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) (i : Fin (r + 1)) (x : {a : Fin (lam i + 1) // branchLower lam i ≤ a.val}) (j : Fin (r + 1)) : ℤ := @@ -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)) @@ -2969,7 +2969,7 @@ theorem signedAmbientCharacteristic_derivative_eval_neg {r : ℕ} simpa only [hnode] using signedNode_denominator_neg_eq_active L row /-- The gt channel characteristic polynomial used in the spherical-code argument. -/ -def gtChannelCharacteristicPolynomial {r : ℕ} +@[expose] def gtChannelCharacteristicPolynomial {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) : Polynomial ℝ := signedAmbientCharacteristic (ambientShift n lam) @@ -3151,7 +3151,7 @@ open MetricCodes.Spherical.HigherChannel open MetricCodes.Spherical.HigherYoungAllRankGTCharacteristicResidue /-- The Lagrange interpolation polynomial for node `i`, evaluated at the endomorphism `T`. -/ -def cartanCharacteristicInterpolationProjector +@[expose] def cartanCharacteristicInterpolationProjector {ι V : Type*} [Fintype ι] [DecidableEq ι] [AddCommGroup V] [Module ℝ V] (nodes : ι → ℝ) (T : Module.End ℝ V) (i : ι) : @@ -3257,7 +3257,7 @@ theorem gtTensorCasimir_channel {r n : ℕ} Pi.smul_apply, id_eq, map_smul] using h /-- The gt relative casimir used in the spherical-code argument. -/ -def gtRelativeCasimir {r n : ℕ} (lam : Fin (r + 1) → ℕ) : +@[expose] def gtRelativeCasimir {r n : ℕ} (lam : Fin (r + 1) → ℕ) : Module.End ℝ (SpherePacking.Euclidean n ⊗[ℝ] HarmonicYoungSpace (n := n) lam) := (2 : ℝ)⁻¹ • (gtTensorCasimir lam - @@ -3341,7 +3341,7 @@ theorem gtRelativeCasimir_lower_channel {r n : ℕ} rfl /-- The gt characteristic projector used in the spherical-code argument. -/ -def gtCharacteristicProjector {r n : ℕ} +@[expose] def gtCharacteristicProjector {r n : ℕ} (target : Fin (r + 1) → ℕ) (z : Fin (r + 1) × Bool) : Module.End ℝ (SpherePacking.Euclidean n ⊗[ℝ] HarmonicYoungSpace (n := n) target) := @@ -3368,7 +3368,7 @@ open MetricCodes.Spherical.HigherRepresentationGraph open MetricCodes.Spherical.HigherYoungAllRankGTCharacteristicResidue /-- The canonical gelfand tsetlin axis tensor used in the spherical-code argument. -/ -def canonicalGelfandTsetlinAxisTensor +@[expose] def canonicalGelfandTsetlinAxisTensor {r n : ℕ} (lam : Fin (r + 2) → ℕ) (mu : Fin (r + 1) → ℕ) (h : Interlaces lam mu) (hgram : PositiveGelfandTsetlinFischerGram (n := n) lam mu h) : @@ -3404,7 +3404,7 @@ theorem canonicalGelfandTsetlinAxisTensor_inner rfl /-- The signed characteristic projector used in the spherical-code argument. -/ -def signedCharacteristicProjector {r : ℕ} +@[expose] def signedCharacteristicProjector {r : ℕ} {V : Type*} [AddCommGroup V] [Module ℝ V] (L : Fin (r + 1) → ℝ) (T : Module.End ℝ V) (i : Fin (r + 1) × Bool) : Module.End ℝ V := @@ -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) := @@ -3626,7 +3626,7 @@ open MetricCodes.Spherical.HigherHarmonicYoung.ArbitraryRowMickelssonWeightHomog open MetricCodes.Spherical.HigherHarmonicYoung.MixedSignature /-- The all rank cartan characteristic projector used in the spherical-code argument. -/ -def allRankCartanCharacteristicProjector {r n : ℕ} +@[expose] def allRankCartanCharacteristicProjector {r n : ℕ} (target : Fin (r + 1) → ℕ) (channel : Fin (r + 1) × Bool) : Module.End ℝ (SpherePacking.Euclidean n ⊗[ℝ] HarmonicYoungSpace (n := n) target) := @@ -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) @@ -3973,7 +3973,7 @@ open MetricCodes.Spherical.HigherYoungPenultimateRowProjectedLower open MetricCodes.Spherical.HigherRepresentationGraph /-- The linear map sending a harmonic Young vector `p` to the pure tensor `axis ⊗ₜ p`. -/ -def gtYoungAxisTensor {r n : ℕ} +@[expose] def gtYoungAxisTensor {r n : ℕ} (lam : Fin (r + 1) → ℕ) (axis : SpherePacking.Euclidean n) : HarmonicYoungSpace (n := n) lam →ₗ[ℝ] (SpherePacking.Euclidean n ⊗[ℝ] @@ -5310,7 +5310,7 @@ open MetricCodes.Spherical.HigherHarmonicYoung.MixedSignature open MetricCodes.Spherical.HigherYoungPenultimateRowProjectedLower /-- The padded pieri raise row used in the spherical-code argument. -/ -def PaddedPieriRaiseRow {r : ℕ} (lam : Fin (r + 1) → ℕ) := +@[expose] def PaddedPieriRaiseRow {r : ℕ} (lam : Fin (r + 1) → ℕ) := {i : Fin (r + 1) // Antitone (raiseWeight lam i)} noncomputable instance paddedPieriRaiseRowFintype {r : ℕ} @@ -5320,7 +5320,7 @@ noncomputable instance paddedPieriRaiseRowFintype {r : ℕ} infer_instance /-- The padded pieri lower row used in the spherical-code argument. -/ -def PaddedPieriLowerRow {r : ℕ} (lam : Fin (r + 1) → ℕ) := +@[expose] def PaddedPieriLowerRow {r : ℕ} (lam : Fin (r + 1) → ℕ) := {i : Fin (r + 1) // 0 < lam i ∧ Antitone (loweredInternalYoungWeight lam i)} @@ -5331,7 +5331,7 @@ noncomputable instance paddedPieriLowerRowFintype {r : ℕ} infer_instance /-- The padded pieri channel used in the spherical-code argument. -/ -def PaddedPieriChannel {r : ℕ} (lam : Fin (r + 1) → ℕ) := +@[expose] def PaddedPieriChannel {r : ℕ} (lam : Fin (r + 1) → ℕ) := PaddedPieriRaiseRow lam ⊕ PaddedPieriLowerRow lam noncomputable instance paddedPieriChannelFintype {r : ℕ} @@ -5340,7 +5340,7 @@ noncomputable instance paddedPieriChannelFintype {r : ℕ} infer_instance /-- The padded pieri source used in the spherical-code argument. -/ -def paddedPieriSource {r : ℕ} (lam : Fin (r + 1) → ℕ) : +@[expose] def paddedPieriSource {r : ℕ} (lam : Fin (r + 1) → ℕ) : PaddedPieriChannel lam → Fin (r + 1) → ℕ := Sum.elim (fun i : PaddedPieriRaiseRow lam => raiseWeight lam i.val) @@ -5453,7 +5453,7 @@ open MetricCodes.Spherical.HigherYoungArbitraryRowLoweringProjectedAxisWitness open MetricCodes.Spherical.HigherYoungPenultimateRowProjectedLower /-- The normalized padded pieri lower used in the spherical-code argument. -/ -def normalizedPaddedPieriLower +@[expose] def normalizedPaddedPieriLower {r n : ℕ} (target : Fin (r + 1) → ℕ) (hdominant : Antitone target) (row : Fin (r + 1)) @@ -6362,7 +6362,7 @@ open MetricCodes.Spherical.HigherHarmonicYoung.AllRankTensorClebschCompleteness open MetricCodes.Spherical.HigherYoungAllRankOrthogonalTensorPieriSourceSignatureInjectivity /-- The padded orthogonal tensor pieri channel used in the spherical-code argument. -/ -def paddedOrthogonalTensorPieriChannel +@[expose] def paddedOrthogonalTensorPieriChannel {r n : ℕ} (hn : 2 * r + 4 ≤ n) (target : Fin (r + 1) → ℕ) (hdom : Antitone target) : (i : PaddedPieriChannel target) → @@ -6454,7 +6454,7 @@ open MetricCodes.Spherical.ThreeRowYoungBranching zero_add, Fin.val_last, Nat.cast_add, Nat.cast_one, zero_mul, add_zero] /-- The zero row tensor isometry equiv used in the spherical-code argument. -/ -def zeroRowTensorIsometryEquiv {r n : ℕ} +@[expose] def zeroRowTensorIsometryEquiv {r n : ℕ} (lam : Fin (r + 1) → ℕ) : (SpherePacking.Euclidean n ⊗[ℝ] HarmonicYoungSpace (n := n) lam) ≃ₗᵢ[ℝ] @@ -6575,7 +6575,7 @@ open MetricCodes.Spherical.ThreeRowYoungBranching simp only [ambientShift, appendZeroWeight_castSucc, Fin.val_castSucc] /-- The retained padded pieri channel used in the spherical-code argument. -/ -def retainedPaddedPieriChannel {r : ℕ} +@[expose] def retainedPaddedPieriChannel {r : ℕ} (lam : Fin (r + 1) → ℕ) : PaddedPieriChannel (appendZeroWeight lam) → Prop | Sum.inl row => row.val ≠ Fin.last (r + 1) @@ -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 @@ -6634,7 +6634,7 @@ def retainedPaddedPieriSignedNode {r : ℕ} ⟨row.val.castPred (paddedPieriLowerRow_ne_last lam row), false⟩ /-- The retained padded pieri physical source used in the spherical-code argument. -/ -def retainedPaddedPieriPhysicalSource {r : ℕ} +@[expose] def retainedPaddedPieriPhysicalSource {r : ℕ} (lam : Fin (r + 1) → ℕ) : {i : PaddedPieriChannel (appendZeroWeight lam) // retainedPaddedPieriChannel lam i} → Fin (r + 1) → ℕ @@ -6734,7 +6734,7 @@ theorem signedNode_appendZeroWeight_retained_lower _ = _ := ambientShift_appendZeroWeight_castSucc lam _ /-- The zero row transport padded pieri channel used in the spherical-code argument. -/ -def zeroRowTransportPaddedPieriChannel +@[expose] def zeroRowTransportPaddedPieriChannel {r n : ℕ} (lam : Fin (r + 1) → ℕ) {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] (A : E →ₗᵢ[ℝ] @@ -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))) @@ -7580,7 +7580,7 @@ open MetricCodes.Spherical.HigherYoungAllRankOrthogonalTensorPieriSourceSignatur open MetricCodes.Spherical.HigherYoungPenultimateRowProjectedLower /-- The padded pieri signed channel used in the spherical-code argument. -/ -def paddedPieriSignedChannel {r : ℕ} (lam : Fin (r + 1) → ℕ) : +@[expose] def paddedPieriSignedChannel {r : ℕ} (lam : Fin (r + 1) → ℕ) : PaddedPieriChannel lam → Fin (r + 1) × Bool | Sum.inl row => (row.val, true) | Sum.inr row => (row.val, false) @@ -7708,7 +7708,7 @@ open MetricCodes.Spherical.HigherYoungAllRankOrthogonalTensorPieriSourceSignatur open MetricCodes.Spherical.ThreeRowYoungBranching /-- The physical padded pieri channel used in the spherical-code argument. -/ -def physicalPaddedPieriChannel {r n : ℕ} +@[expose] def physicalPaddedPieriChannel {r n : ℕ} (hn : 2 * (r + 1) + 4 ≤ n) (lam : Fin (r + 1) → ℕ) (hdom : Antitone (appendZeroWeight lam)) @@ -8266,7 +8266,7 @@ open MetricCodes.Spherical.HigherYoungAllRankZeroRowRotationEquivariance open MetricCodes.Spherical.ThreeRowYoungBranching /-- The appended full branch pieri lower used in the spherical-code argument. -/ -def appendedFullBranchPieriLower +@[expose] def appendedFullBranchPieriLower {r n : ℕ} (lam : Fin (r + 2) → ℕ) (hdominant : Antitone (appendZeroWeight lam)) (hsource : Antitone @@ -8371,7 +8371,7 @@ private theorem appendZeroWeight_antitone_metriccodes2_17c0be6a {r : ℕ} simpa only [appendZeroWeight_castSucc, ge_iff_le] using hdom hle /-- The original padded selected axis tensor used in the spherical-code argument. -/ -def originalPaddedSelectedAxisTensor +@[expose] def originalPaddedSelectedAxisTensor {r n : ℕ} (lam : Fin (r + 2) → ℕ) (mu : Fin (r + 1) → ℕ) (h : Interlaces lam mu) (hgram : PositiveGelfandTsetlinFischerGram (n := n) lam mu h) : diff --git a/LeanPool/MetricCodes/Weyl.lean b/LeanPool/MetricCodes/Weyl.lean index 53e6dd79ad..739001aba2 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 @@ -311,7 +311,7 @@ open scoped BigOperators open MetricCodes.Spherical.HigherHarmonicYoung /-- Erase a root from an admissible wedge when the resulting signed weight remains nonnegative. -/ -def rootAdmissibleErase {r k : ℕ} +@[expose] def rootAdmissibleErase {r k : ℕ} (lam : Fin (r + 1) → ℕ) (S : AdmissibleRootWedge lam (k + 1)) (α : PositiveRoot r) (hα : α ∈ S.val.val) @@ -856,7 +856,7 @@ private theorem degreeZero_realExteriorRootSign_singleton_metriccodes2_89cbd172 lt_self_iff_false, ↓reduceIte, Finset.card_empty, pow_zero, Int.cast_one] /-- The admissible singleton wedge associated with an active positive root. -/ -def activeAdmissibleRootWedge {r : ℕ} +@[expose] def activeAdmissibleRootWedge {r : ℕ} (lam : Fin (r + 1) → ℕ) (α : ActivePositiveRoot lam) : AdmissibleRootWedge lam 1 := by refine ⟨rootWedgeSingleton α.val, ?_⟩ @@ -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 α) @@ -3476,7 +3476,7 @@ open scoped BigOperators open MetricCodes.Spherical.HigherHarmonicYoung /-- The root admissible swap used in the spherical-code argument. -/ -def rootAdmissibleSwap {r k : ℕ} +@[expose] def rootAdmissibleSwap {r k : ℕ} (lam : Fin (r + 1) → ℕ) (S : AdmissibleRootWedge lam k) (α β : PositiveRoot r) @@ -4482,7 +4482,7 @@ theorem includedDescendingPositiveRootFischerLaplacian_energy_ge_self The root joint harmonic included descending fischer laplacian used in the spherical-code argument. -/ -def rootJointHarmonicIncludedDescendingFischerLaplacian {r : ℕ} +@[expose] def rootJointHarmonicIncludedDescendingFischerLaplacian {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) (k : ℕ) : RootJointHarmonicChain n lam k →ₗ[ℝ] RootJointHarmonicChain n lam k := @@ -4621,7 +4621,7 @@ def includedNondescendingPositiveRootFischerLaplacian (includedNondescendingPositiveRootOperatorStar n lam S) /-- The active raising operator for a root absent from the wedge. -/ -def excludedActivePositiveRootOperator +@[expose] def excludedActivePositiveRootOperator {r k : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) (S : AdmissibleRootWedge lam k) (α : ExcludedActivePositiveRoot lam S) : @@ -4633,7 +4633,7 @@ def excludedActivePositiveRootOperator ⟨α.val, α.property.2⟩ /-- The Fischer adjoint lowering operator for an active root absent from the wedge. -/ -def excludedActivePositiveRootOperatorStar +@[expose] def excludedActivePositiveRootOperatorStar {r k : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) (S : AdmissibleRootWedge lam k) (α : ExcludedActivePositiveRoot lam S) : @@ -4678,7 +4678,7 @@ def excludedActivePositiveRootFischerLaplacian (excludedActivePositiveRootOperatorStar n lam S) /-- The root joint harmonic hodge diagonal used in the spherical-code argument. -/ -def rootJointHarmonicHodgeDiagonal {r : ℕ} +@[expose] def rootJointHarmonicHodgeDiagonal {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) (k : ℕ) : RootJointHarmonicChain n lam k →ₗ[ℝ] RootJointHarmonicChain n lam k := @@ -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 @@ -5583,7 +5583,7 @@ open scoped BigOperators open MetricCodes.Spherical.HigherHarmonicYoung /-- The positive root order code used in the spherical-code argument. -/ -def positiveRootOrderCode {r : ℕ} (α : PositiveRoot r) : +@[expose] def positiveRootOrderCode {r : ℕ} (α : PositiveRoot r) : Fin ((r + 1) * (r + 1)) := (finProdFinEquiv (m := r + 1) (n := r + 1)) α.val @@ -5661,7 +5661,7 @@ theorem realExteriorRootSign_mul_self (S : Finset ι) (a : ι) : norm_num /-- The actual exterior root contraction used in the spherical-code argument. -/ -def actualExteriorRootContraction (M : Type*) +@[expose] def actualExteriorRootContraction (M : Type*) [AddCommGroup M] [Module ℝ M] (a : ι) : Module.End ℝ (Finset ι → M) where toFun f S := @@ -5675,7 +5675,7 @@ def actualExteriorRootContraction (M : Type*) by_cases h : a ∈ S <;> simp [h, smul_smul, mul_comm] /-- The actual exterior root creation used in the spherical-code argument. -/ -def actualExteriorRootCreation (M : Type*) +@[expose] def actualExteriorRootCreation (M : Type*) [AddCommGroup M] [Module ℝ M] (a : ι) : Module.End ℝ (Finset ι → M) where toFun f S := @@ -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 : ι, @@ -7072,7 +7072,7 @@ abbrev FullRootExteriorPolynomialChain (r n : ℕ) := Finset (PositiveRoot r) → PolynomialSpace r n /-- The full root exterior polynomial action used in the spherical-code argument. -/ -def fullRootExteriorPolynomialAction (r n : ℕ) (α : PositiveRoot r) : +@[expose] def fullRootExteriorPolynomialAction (r n : ℕ) (α : PositiveRoot r) : Module.End ℝ (FullRootExteriorPolynomialChain r n) where toFun f S := positiveRootOperator n α (f S) map_add' f g := by @@ -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, @@ -7286,7 +7286,7 @@ open scoped BigOperators open MetricCodes.Spherical.HigherHarmonicYoung /-- Erase a specified member of a root wedge, reducing its cardinality by one. -/ -def rootWedgeErase {r k : ℕ} +@[expose] def rootWedgeErase {r k : ℕ} (S : RootWedge r (k + 1)) (α : PositiveRoot r) (hα : α ∈ S.val) : RootWedge r k := by refine ⟨S.val.erase α, ?_⟩ @@ -7554,7 +7554,7 @@ theorem rootActionCoboundary_eq_exteriorCreation_zeroExtension map_zero, ] /-- The full root exterior upper polynomial action used in the spherical-code argument. -/ -def fullRootExteriorUpperPolynomialAction (r n : ℕ) (α : PositiveRoot r) : +@[expose] def fullRootExteriorUpperPolynomialAction (r n : ℕ) (α : PositiveRoot r) : Module.End ℝ (Finset (PositiveRoot r) → PolynomialSpace r n) where toFun f S := positiveRootUpperOperator n α (f S) map_add' f g := by @@ -7572,7 +7572,7 @@ def fullRootExteriorUpperPolynomialAction (r n : ℕ) (α : PositiveRoot r) : positiveRootUpperOperator n α (f S) := rfl /-- The full root exterior action coboundary used in the spherical-code argument. -/ -def fullRootExteriorActionCoboundary (r n : ℕ) : +@[expose] def fullRootExteriorActionCoboundary (r n : ℕ) : Module.End ℝ (Finset (PositiveRoot r) → PolynomialSpace r n) := ∑ α : PositiveRoot r, fullRootExteriorUpperPolynomialAction r n α * @@ -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) := @@ -7975,7 +7975,7 @@ section open MetricCodes.Spherical.HigherHarmonicYoung /-- The root polynomial bracket action mixed used in the spherical-code argument. -/ -def rootPolynomialBracketActionMixed (r n k : ℕ) : +@[expose] def rootPolynomialBracketActionMixed (r n k : ℕ) : RootPolynomialChain r n (k + 1) →ₗ[ℝ] RootPolynomialChain r n (k + 1) := (rootBracketCoboundary r n k).comp (rootActionBoundary r n k) + @@ -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 480ad0e947..fb87a348ab 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..56e68f7454 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₂] : @@ -145,12 +148,16 @@ variable {𝕜 E₁ E₂ : Type*} [RCLike 𝕜] [NormedAddCommGroup E₁] [Inner [NormedAddCommGroup E₂] [InnerProductSpace 𝕜 E₂] @[simp] -theorem rankOne_apply {x : E₁} {y : E₂} (z : E₂) : rankOne 𝕜 x y z = ⟪y,z⟫_𝕜 • x := -rfl +theorem rankOne_apply_apply_apply (x : E₁) (y z : E₂) : + rankOne 𝕜 x y z = ⟪y,z⟫_𝕜 • x := by rfl + +theorem rankOne_apply {x : E₁} {y : E₂} (z : E₂) : + rankOne 𝕜 x y z = ⟪y,z⟫_𝕜 • x := +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..07ca0ac1fc 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 @@ -31,7 +31,7 @@ variable {R m n : Type _} [CommSemiring R] [Fintype m] [Fintype n] [DecidableEq [DecidableEq n] /-- Convert a tensor of square matrices into its Kronecker-product matrix. -/ -noncomputable def TensorProduct.toKronecker : +@[expose] noncomputable def TensorProduct.toKronecker : Matrix m m R ⊗[R] Matrix n n R →ₗ[R] Matrix (m × n) (m × n) R := (kroneckerLinearEquiv m m n n R).toLinearMap @@ -40,7 +40,7 @@ theorem TensorProduct.toKronecker_apply (x : Matrix m m R) (y : Matrix n n R) : exact kroneckerLinearEquiv_tmul x y /-- Convert a Kronecker-product matrix back to the tensor of matrix algebras. -/ -noncomputable def Matrix.kroneckerToTensorProduct : +@[expose] noncomputable def Matrix.kroneckerToTensorProduct : Matrix (m × n) (m × n) R →ₗ[R] Matrix m m R ⊗[R] Matrix n n R := (kroneckerLinearEquiv m m n n R).symm.toLinearMap @@ -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..bf17c0cf35 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,13 +71,14 @@ 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 → 𝕜 := fun i => hx.scalar • hx.matrix_isHermitian.eigenvalues i /-- Multiset of eigenvalues for an almost-Hermitian matrix. -/ -noncomputable def _root_.Matrix.IsAlmostHermitian.spectra {A : Matrix n n 𝕜} +@[expose] noncomputable def _root_.Matrix.IsAlmostHermitian.spectra {A : Matrix n n 𝕜} (hA : A.IsAlmostHermitian) : Multiset 𝕜 := Finset.univ.val.map fun i => hA.eigenvalues i 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..3900320a68 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] : @@ -670,7 +672,7 @@ theorem Pi.Qam.Nontracial.delta_ne_zero [Nonempty k] [∀ i, Nontrivial (s i)] { exact Qam.Nontracial.delta_pos /-- The delta-form quantum-set structure for a single matrix algebra. -/ -@[reducible] +@[reducible, expose] noncomputable def Matrix.quantumSetDeltaForm [Nonempty n] {φ : Module.Dual ℂ (Matrix n n ℂ)} [hφ : φ.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..168ce24a81 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, @@ -295,7 +322,6 @@ variable [(i : ι₁) → FiniteDimensional 𝕜 (M₁ i)] omit [(i : ι₁) → FiniteDimensional 𝕜 (M₁ i)] [(i : ι₂) → FiniteDimensional 𝕜 (M₂ i)] in -@[simp] theorem PiLpTensorEquiv_norm_map (x : (PiLp 2 M₁ ⊗[𝕜] PiLp 2 M₂)) : ‖(PiLpTensorEquiv x : PiLp 2 (fun i : ι₁ × ι₂ => M₁ i.1 ⊗[𝕜] M₂ i.2))‖ = ‖x‖ := by @@ -307,13 +333,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 +376,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 +387,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..36862bd83b 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 @@ -304,7 +304,7 @@ theorem InnerAut.reflIdempotent [hφ : φ.IsFaithfulPosMap] exact Qam.reflIdempotent_starAlgEquiv_conj hU _ _) /-- Isomorphism relation between two matrix quantum adjacency maps. -/ -def Qam.Iso (A B : l((Matrix n n ℂ))) : Prop := +@[expose] def Qam.Iso (A B : l((Matrix n n ℂ))) : Prop := ∃ f : (Matrix n n ℂ) ≃⋆ₐ[ℂ] (Matrix n n ℂ), A ∘ₗ f.toLinearMap = f.toLinearMap ∘ₗ B ∧ f φ.matrix = φ.matrix diff --git a/LeanPool/Monlib4/QuantumGraph/Matrix.lean b/LeanPool/Monlib4/QuantumGraph/Matrix.lean index 1aba7aaae6..89125bfbc9 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 @@ -726,7 +726,8 @@ lemma Pi.eq_sum_single_proj (R : Type*) {ι : Type*} [Semiring R] rfl /-- Swap the two equal blocks of a `Fin 2`-indexed `PiMat` as a star-algebra equivalence. -/ -noncomputable def PiMatFinTwoSameSwapStarAlgEquiv {n : Type*} [Fintype n] [DecidableEq n] : +@[expose] noncomputable def PiMatFinTwoSameSwapStarAlgEquiv + {n : Type*} [Fintype n] [DecidableEq n] : PiMat ℂ (Fin 2) (PiFinTwoSame n) ≃⋆ₐ[ℂ] PiMat ℂ (Fin 2) (PiFinTwoSame n) := StarAlgEquiv.ofAlgEquiv (PiMatFinTwoSameSwapAlgEquiv (n := n)) (fun x => by 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..fbbd6d3fbc 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,15 @@ 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] + have hkronecker + (z : Matrix (p₁ i.1) (p₁ i.1) ℂ ⊗[ℂ] Matrix (p₂ i.2) (p₂ i.2) ℂ) : + (tensorToKronecker (R := ℂ) (m := p₁ i.1) (n := p₂ i.2)) z = + TensorProduct.toKronecker z := by + rw [← tensorToKronecker_toLinearMap_eq] + rfl + simp only [hkronecker] rw [TensorProduct.toKronecker_star] congr 1 obtain ⟨S, rfl⟩ := TensorProduct.exists_finset x @@ -182,7 +189,7 @@ noncomputable abbrev PiMat.traceLinearMap : Matrix.traceLinearMap _ _ _ ∘ₗ Matrix.blockDiagonal'AlgHom.toLinearMap /-- Coalgebra structure on a finite product of matrix blocks. -/ -@[reducible] +@[expose, reducible] noncomputable def PiMat.finiteDimensionalHilbertCoalgebraStruct : CoalgebraStruct ℂ (PiMat ℂ ι p) := by withPiQuantumCtx[φ] @@ -551,7 +558,7 @@ theorem QuantumGraph.Real.PiMat_isOrthogonalProjection : (quantumGraphReal_iff_Psi_isIdempotentElem_and_isSelfAdjoint.mp hA).2.star_eq, and_self] /-- Block submodules associated to a real `PiMat` quantum graph. -/ -noncomputable def QuantumGraph.Real.PiMatSubmodule : +@[expose] noncomputable def QuantumGraph.Real.PiMatSubmodule : withPiQuantum[φ] ∀ {A : PiMat ℂ ι p →ₗ[ℂ] PiMat ℂ ι p}, QuantumGraph.Real (PiMat ℂ ι p) A → @@ -1099,6 +1106,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 +1166,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] omit [Fintype ι] [DecidableEq ι] in theorem unitaryTensorEuclidean_apply' {U : (i : ι) → Matrix.unitaryGroup (p i) ℂ} (i : @@ -1704,6 +1714,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 +1737,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..1b4d51b14e 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 @@ -67,6 +67,7 @@ macro_rules /-- The algebra equivalence between a two-block product of matrix algebras and the matching `PiMat`. -/ +@[expose] def MatProdAlgEquivPiMat (n' : Fin 2 → Type*) [Π i, Fintype (n' i)] [Π i, DecidableEq (n' i)] : (Matrix (n' 0) (n' 0) ℂ × Matrix (n' 1) (n' 1) ℂ) ≃ₐ[ℂ] @@ -90,7 +91,7 @@ fun i => by split_ifs <;> infer_instance /-- The swapped product-to-`PiMat` equivalence for two matrix blocks. -/ -def MatProdAlgEquivPiMatSwap (n' : Fin 2 → Type*) [Π i, Fintype (n' i)] [Π i, +@[expose] def MatProdAlgEquivPiMatSwap (n' : Fin 2 → Type*) [Π i, Fintype (n' i)] [Π i, DecidableEq (n' i)] : (Matrix (n' 1) (n' 1) ℂ × Matrix (n' 0) (n' 0) ℂ) ≃ₐ[ℂ] @@ -98,7 +99,7 @@ def MatProdAlgEquivPiMatSwap (n' : Fin 2 → Type*) [Π i, Fintype (n' i)] [Π i MatProdAlgEquivPiMat (PiFinTwo.swap n') /-- Swap the two factors of a product as an algebra equivalence. -/ -@[simps] +@[expose, simps] def Prod.swapAlgEquiv (α β : Type*) [Semiring α] [Semiring β] [Algebra ℂ α] [Algebra ℂ β] : (α × β) ≃ₐ[ℂ] (β × α) where @@ -111,7 +112,7 @@ def Prod.swapAlgEquiv commutes' _ := by simp /-- Swap the two blocks of a `PiMat` indexed by `Fin 2`. -/ -def PiMatFinTwoSwapAlgEquiv +@[expose] def PiMatFinTwoSwapAlgEquiv {n' : Fin 2 → Type*} [Π i, Fintype (n' i)] [Π i, DecidableEq (n' i)] : PiMat ℂ (Fin 2) n' ≃ₐ[ℂ] PiMat ℂ (Fin 2) (PiFinTwo.swap n') := (MatProdAlgEquivPiMat n').symm.trans ((Prod.swapAlgEquiv _ _).trans @@ -141,7 +142,7 @@ lemma PiFinTwoSame_swap {n : Type*} : by ext; simp only [ite_self, Fin.isValue] /-- Swap the two identical matrix blocks of a `PiMat` indexed by `Fin 2`. -/ -def PiMatFinTwoSameSwapAlgEquiv +@[expose] def PiMatFinTwoSameSwapAlgEquiv {n : Type*} [Fintype n] [DecidableEq n] : PiMat ℂ (Fin 2) (PiFinTwoSame n) ≃ₐ[ℂ] PiMat ℂ (Fin 2) (PiFinTwoSame n) := (MatProdAlgEquivPiMat (PiFinTwoSame n)).symm.trans ((Prod.swapAlgEquiv _ _).trans @@ -182,12 +183,10 @@ theorem AlgEquiv.toPiMat_finTwo_same_inner_of_matrix_prod_inner (MatProdAlgEquivPiMat (PiFinTwoSame n)))).IsInner := by obtain ⟨U, hU, rfl⟩ := hf use ((MatProdAlgEquivPiMat _) U), MatProdAlgEquivPiMatSameInvertibleOf hU - ext1 - simp only [Fin.isValue, MatProdAlgEquivPiMat, symm_symm, trans_apply, - matrixPiFinTwoAlgEquivProd_apply, Algebra.autInner_apply, map_mul] - congr - simp only [PiMat.ext_iff, Fin.forall_fin_two] - trivial + ext1 x + simp only [AlgEquiv.trans_apply, Algebra.autInner_apply, + map_mul, AlgEquiv.apply_symm_apply] + rw [map_invOf (ifr := MatProdAlgEquivPiMatSameInvertibleOf hU)] theorem AlgEquiv.PiMat_finTwo_same (f : PiMat ℂ (Fin 2) (PiFinTwoSame n) ≃ₐ[ℂ] PiMat ℂ (Fin 2) (PiFinTwoSame n)) : @@ -222,13 +221,22 @@ theorem AlgEquiv.PiMat_finTwo_same ((g₁.prodMap g₂).trans (MatProdAlgEquivPiMat (PiFinTwoSame n))), hg' rw [funext_iff] at hg simp only [Fin.isValue, AlgEquiv.coe_trans, Function.comp_apply, - AlgEquiv.prodMap_apply, Prod.swap, Prod.map_apply, f', + AlgEquiv.prodMap_apply, Prod.swap, f', AlgEquiv.symm_apply_eq] at hg ext1 x specialize hg ((MatProdAlgEquivPiMat _).symm x) simp only [AlgEquiv.apply_symm_apply] at hg rw [hg] - rfl + rcases hpair : (MatProdAlgEquivPiMat (PiFinTwoSame n)).symm x with ⟨a, b⟩ + have hx : x = (MatProdAlgEquivPiMat (PiFinTwoSame n)) (a, b) := by + calc + x = (MatProdAlgEquivPiMat (PiFinTwoSame n)) + ((MatProdAlgEquivPiMat (PiFinTwoSame n)).symm x) := + ((MatProdAlgEquivPiMat (PiFinTwoSame n)).apply_symm_apply x).symm + _ = (MatProdAlgEquivPiMat (PiFinTwoSame n)) (a, b) := by rw [hpair] + rw [hx] + simp only [AlgEquiv.trans_apply, PiMatFinTwoSameSwapAlgEquiv_apply, + AlgEquiv.symm_apply_apply, AlgEquiv.prodMap_apply] variable {ι : Type*} {p : ι → Type*} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (p i)] [(i : ι) → DecidableEq (p i)] @@ -535,7 +543,7 @@ theorem QuantumGraph.Real.piFinTwo_same_exists_matrix_map_eq_map_of_adjoint_and_ · exact Or.inr hf /-- Projection from a dependent product as an algebra homomorphism. -/ -def AlgHom.proj +@[expose] def AlgHom.proj (R : Type*) {ι : Type*} [CommSemiring R] {φ : ι → Type*} [(i : ι) → Semiring (φ i)] [(i : ι) → Algebra R (φ i)] (i : ι) : (Π i, φ i) →ₐ[R] φ i where @@ -560,7 +568,7 @@ theorem AlgHom.proj_toLinearMap rfl /-- Insert one component into a dependent product as a non-unital algebra homomorphism. -/ -def NonUnitalAlgHom.single (R : Type*) {ι : Type*} [CommSemiring R] +@[expose] def NonUnitalAlgHom.single (R : Type*) {ι : Type*} [CommSemiring R] [DecidableEq ι] (φ : ι → Type*) [(i : ι) → Ring (φ i)] [(i : ι) → Module R (φ i)] (i : ι) : @@ -960,7 +968,7 @@ theorem PiMat_finTwo_same_swap_swap (x : PiMat ℂ (Fin 2) (PiFinTwoSame n)) : PiMatFinTwoSameSwapAlgEquiv (PiMatFinTwoSameSwapAlgEquiv x) = x := -by simp [PiMatFinTwoSameSwapAlgEquiv] +by simp [PiMatFinTwoSameSwapAlgEquiv, Prod.swapAlgEquiv] theorem PiMatFinTwoSameSwapAlgEquiv_apply_piSingle_zero (x : Matrix n n ℂ) : PiMatFinTwoSameSwapAlgEquiv (Pi.single 0 x) = diff --git a/LeanPool/Monlib4/QuantumGraph/QamA.lean b/LeanPool/Monlib4/QuantumGraph/QamA.lean index 9899aa1c40..6f8f586d3b 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] @@ -68,7 +68,7 @@ local notation "τ⁻¹" => (LinearEquiv.symm (TensorProduct.lid ℂ ℍ) : ℍ local notation "id" => (1 : ℍ →ₗ[ℂ] ℍ) /-- The rank-one quantum adjacency map associated to a nonzero matrix. -/ -noncomputable def qamA (hφ : φ.IsFaithfulPosMap) +@[expose] noncomputable def qamA (hφ : φ.IsFaithfulPosMap) (x : { x : ℍ // x ≠ 0 }) :--(hx : x ≠ 0) : ℍ →ₗ[ℂ] ℍ := by diff --git a/LeanPool/Monlib4/QuantumGraph/QamAExample.lean b/LeanPool/Monlib4/QuantumGraph/QamAExample.lean index e07579f23b..46a0d3b351 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 @@ -212,7 +212,7 @@ theorem spectra_fin_two_ext {α : Type _} (α₁ α₂ β₁ β₂ : α) : simp only [exists_eq_right_right, and_true, eq_comm] simp_rw [and_comm] -@[reducible, instance] +@[reducible, instance, expose] def Multiset.hasSmul {α : Type _} [SMul ℂ α] : SMul ℂ (Multiset α) where smul a s := s.map ((· • ·) a) @@ -237,12 +237,12 @@ theorem Matrix.IsAlmostHermitian.trace {x : Matrix n n ℂ} (hx : x.IsAlmostHerm simp [Matrix.IsAlmostHermitian.eigenvalues, Finset.mul_sum] /-- The unitary eigenvector matrix chosen for an almost-Hermitian matrix. -/ -@[reducible] +@[reducible, expose] noncomputable def Matrix.IsAlmostHermitian.eigenvectorUnitary {x : Matrix n n ℂ} (hx : x.IsAlmostHermitian) : unitaryGroup n ℂ := hx.matrix_isHermitian.eigenvectorUnitary /-- The eigenvector matrix chosen for an almost-Hermitian matrix. -/ -@[reducible] +@[reducible, expose] noncomputable def Matrix.IsAlmostHermitian.eigenvectorMatrix {x : Matrix n n ℂ} (hx : x.IsAlmostHermitian) : Matrix n n ℂ := hx.matrix_isHermitian.eigenvectorMatrix diff --git a/LeanPool/Monlib4/QuantumGraph/ToProjections.lean b/LeanPool/Monlib4/QuantumGraph/ToProjections.lean index b56cca4e5b..9598dda6b4 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)] @@ -168,7 +168,7 @@ theorem toMatrix_mulLeft_mulRight_adjoint {φ : ∀ i, Module.Dual ℂ (Matrix ( rfl /-- Apply a linear map between dependent products to a selected input and output component. -/ -@[simps] +@[expose, simps] def Pi.LinearMap.apply {ι₁ ι₂ : Type _} {E₁ : ι₁ → Type _} [DecidableEq ι₁] [∀ i, AddCommMonoid (E₁ i)] [∀ i, Module ℂ (E₁ i)] {E₂ : ι₂ → Type _} [∀ i, AddCommMonoid (E₂ i)] [∀ i, Module ℂ (E₂ i)] (i : ι₁) (j : ι₂) : @@ -352,7 +352,8 @@ theorem Matrix.star_transpose_eq_star_transpose {R n : Type _} [Star R] (A : Mat -- Star preservation for this tensor-product algebra equivalence requires deep instance search. /-- Star algebra equivalence between a matrix tensor product and matrices on product indices. -/ -noncomputable def oneMapTranspose : ℍ ⊗[ℂ] ℍᵐᵒᵖ ≃⋆ₐ[ℂ] Matrix (p × p) (p × p) ℂ := +@[expose] noncomputable def oneMapTranspose : + ℍ ⊗[ℂ] ℍᵐᵒᵖ ≃⋆ₐ[ℂ] Matrix (p × p) (p × p) ℂ := StarAlgEquiv.ofAlgEquiv ((AlgEquiv.TensorProduct.map (1 : ℍ ≃ₐ[ℂ] ℍ) (transposeAlgEquiv p ℂ ℂ).symm).trans tensorToKronecker) 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..fc6d3912f8 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] : @@ -346,12 +346,11 @@ end Algebra namespace AlgEquiv /-- An algebra automorphism is inner if it is conjugation by an invertible element. -/ -def IsInner {R E : Type*} [CommSemiring R] [Semiring E] +@[expose] def IsInner {R E : Type*} [CommSemiring R] [Semiring E] [Algebra R E] (f : E ≃ₐ[R] E) : Prop := ∃ (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*} @@ -818,7 +838,7 @@ theorem matrixPiFinAlgEquivPiFinTwo_symm_apply {𝕜 : Type*} [CommSemiring 𝕜 aesop /-- Identify a two-term dependent product of matrix algebras with a binary product. -/ -def matrixPiFinTwoAlgEquivProd {𝕜 : Type*} [CommSemiring 𝕜] +@[expose] def matrixPiFinTwoAlgEquivProd {𝕜 : Type*} [CommSemiring 𝕜] {n : Fin 2 → Type*} [∀ i, Fintype (n i)] [∀ i, DecidableEq (n i)] : (Π i : Fin 2, Mat 𝕜 (n i)) ≃ₐ[𝕜] (Mat 𝕜 (n 0) × Mat 𝕜 (n 1)) where @@ -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 ef5fe153f1..1cfb8ca273 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 /- @@ -1798,7 +1800,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 890bde3853..905572fb9e 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/MovingSofa/Development/Geometry/Applications/Development001.lean b/LeanPool/MovingSofa/Development/Geometry/Applications/Development001.lean index 6d691edd82..c4e4fe02d0 100644 --- a/LeanPool/MovingSofa/Development/Geometry/Applications/Development001.lean +++ b/LeanPool/MovingSofa/Development/Geometry/Applications/Development001.lean @@ -35,7 +35,7 @@ public import LeanPool.MovingSofa.Development.Geometry.Foundations.Development00 * `Polygon.Applications.Development001`. -/ -@[expose] public section +public section noncomputable section @@ -53,7 +53,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Area.Middle`. -/ -@[expose] public section +public section noncomputable section @@ -83,7 +83,7 @@ niche, because the roof point vertically above it exhibits a time whose open inw contains it. -/ -@[expose] public section +public section noncomputable section @@ -91,6 +91,7 @@ namespace MovingSofa /-- The middle area bound obtained from cap area, endpoint segments and the corner-path integral. -/ +@[expose] def upperBoundMiddle (K : SpecialCapSpace) : ℝ := ClassicalResults.area (K.val.val : Set Point) + segmentArea (distinguishedCapSides K.val).2.fanPoint @@ -645,7 +646,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Area.Mamikon.Properties`. -/ -@[expose] public section +public section noncomputable section @@ -661,7 +662,7 @@ Authors: Dean Cureton # Area / Mamikon / Properties -/ -@[expose] public section +public section noncomputable section @@ -1260,7 +1261,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Area.Mamikon.Tails`. -/ -@[expose] public section +public section noncomputable section @@ -1276,13 +1277,14 @@ Authors: Dean Cureton # Area / Mamikon / Tails -/ -@[expose] public section +public section noncomputable section namespace MovingSofa /-- The signed area between a convex boundary arc and its endpoint tangent segments. -/ +@[expose] def tangentMamikonValue (K : ConvexBody Point) (a b : ℝ) : ℝ := segmentArea (edgeVertices K (a : Real.Angle)).1 (supportingIntersection K (a : Real.Angle) (b : Real.Angle)) + @@ -1290,10 +1292,12 @@ def tangentMamikonValue (K : ConvexBody Point) (a b : ℝ) : ℝ := (edgeVertices K (b : Real.Angle)).2 - convexArcArea K a b /-- The Mamikon value of the right tail on its Gerver angle interval. -/ +@[expose] def rightTailMamikon (B : ConvexBody Point) : ℝ := tangentMamikonValue B (Real.pi + paperGerverConstants.2.1) (3 * Real.pi / 2) /-- The Mamikon value of the left tail on its Gerver angle interval. -/ +@[expose] def leftTailMamikon (D : ConvexBody Point) : ℝ := tangentMamikonValue D (3 * Real.pi / 2) (3 * Real.pi / 2 + paperGerverConstants.2.2) @@ -1543,7 +1547,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Cap.UpperBoundary.Polygon`. -/ -@[expose] public section +public section noncomputable section @@ -1559,7 +1563,7 @@ Authors: Dean Cureton # Cap / Polyline Boundary -/ -@[expose] public section +public section noncomputable section @@ -2381,7 +2385,7 @@ Authors: Dean Cureton # Cap / Polyline Definition -/ -@[expose] public section +public section noncomputable section @@ -2494,7 +2498,7 @@ Authors: Dean Cureton # Cap / Polyline -/ -@[expose] public section +public section noncomputable section @@ -2505,6 +2509,7 @@ def polygonCapPolyline {Θ : AngleSet} (K : PolygonCapSpace Θ) : XMonotonePolyl (polygonCap_polyline K).choose /-- Sum the lengths of polyline edges perpendicular to a prescribed wall direction. -/ +@[expose] def polygonCapPolylineLength {Θ : AngleSet} (K : PolygonCapSpace Θ) (t : angleDomain Θ) : ℝ := by classical @@ -2515,6 +2520,7 @@ def polygonCapPolylineLength {Θ : AngleSet} (K : PolygonCapSpace Θ) dist (p.vertices i.castSucc) (p.vertices i.succ) else 0 /-- The cap’s surface measure at each wall direction equals the corresponding polyline length. -/ +@[expose] def IsBalancedPolygonCap {Θ : AngleSet} (K : PolygonCapSpace Θ) : Prop := ∀ t : angleDomain Θ, surfaceAreaMeasure K.val.val {(t.val : Real.Angle)} = ENNReal.ofReal (polygonCapPolylineLength K t) @@ -2538,7 +2544,7 @@ Authors: Dean Cureton # Cap / Upper Boundary / Polygon -/ -@[expose] public section +public section noncomputable section @@ -2925,7 +2931,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Gerver.Area`. -/ -@[expose] public section +public section noncomputable section @@ -2953,7 +2959,7 @@ coordinate dictionary `fromPlane_paperGerverContacts`. `contactZ_sound` and /-! ### The contact evaluator -/ -@[expose] public section +public section noncomputable section @@ -3480,7 +3486,7 @@ encloses that sum (`capDoubledZ_sound`), and its kernel-checked numeric conclusi /-! ### Elementary geometry of the outer cap -/ -@[expose] public section +public section noncomputable section @@ -3813,11 +3819,11 @@ theorem gerverOuterCap_area_certified_lower_bound : obtain ⟨hlo, -⟩ := capDoubledZ_sound rw [hS] at hfan rw [hS, hz] at hlo - have hOK : 2 * 28609 * M ≤ 10000 * capDoubledZ.lo := by + have hOK : 2 * 28609 * M ≤ 10000 * z := by have h := capOK_true unfold capOK at h + rw [hz] at h exact of_decide_eq_true h - rw [hz] at hOK have hOK' : (2 * 28609 * (M : ℝ)) ≤ 10000 * (z : ℝ) := by exact_mod_cast hOK have hM : (0 : ℝ) < (M : ℝ) := SI.Mpos have hkey : 2 * 28609 ≤ 10000 * S := by nlinarith only [hlo, hOK', hM] @@ -3850,7 +3856,7 @@ niche by `7 * NN` coordinate rectangles whose widths and heights the certificate `GerverAreaCert.nicheOK_true` bounds the total rectangle area, hence `|N₀| ≤ 3301 / 5000`. -/ -@[expose] public section +public section noncomputable section @@ -4360,7 +4366,7 @@ certificate `MovingSofa.Gerver.AreaCertificate` through the fan bound of `11 / 5 ≤ |G|` (`gerver_area_lower_bound`). -/ -@[expose] public section +public section noncomputable section @@ -4557,7 +4563,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Gerver.VelocityAndCapArea`. -/ -@[expose] public section +public section noncomputable section @@ -4573,7 +4579,7 @@ Authors: Dean Cureton # Gerver / Cap Identification -/ -@[expose] public section +public section noncomputable section @@ -5231,7 +5237,7 @@ Authors: Dean Cureton # Gerver / Niche / Identification -/ -@[expose] public section +public section noncomputable section @@ -5364,7 +5370,7 @@ the certified parameters. /-! ### Coordinate transport of derivatives -/ -@[expose] public section +public section noncomputable section @@ -6339,7 +6345,7 @@ Authors: Dean Cureton # Gerver / Velocity And Cap Area -/ -@[expose] public section +public section noncomputable section @@ -6656,7 +6662,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Polygon.EdgeNormals`. -/ -@[expose] public section +public section noncomputable section @@ -6672,7 +6678,7 @@ Authors: Dean Cureton # Polygon / Balanced Containment -/ -@[expose] public section +public section noncomputable section @@ -6840,18 +6846,20 @@ Authors: Dean Cureton # Polygon / Polyline / Length / Basic -/ -@[expose] public section +public section noncomputable section namespace MovingSofa /-- Extend the directional polyline-length function by zero outside the angle domain. -/ +@[expose] def polygonPolylineLengthAt {Θ : AngleSet} (K : PolygonCapSpace Θ) (t : ℝ) : ℝ := by classical exact if ht : t ∈ angleDomain Θ then polygonCapPolylineLength K ⟨t, ht⟩ else 0 /-- The one-dimensional Hausdorff measure of the niche frontier inside a specified set. -/ +@[expose] def nicheBoundaryLength {Θ : AngleSet} (K : PolygonCapSpace Θ) (S : Set Point) : ℝ := (MeasureTheory.Measure.hausdorffMeasure 1 (frontier (polygonNiche Θ K.val) ∩ S)).toReal @@ -6874,7 +6882,7 @@ Authors: Dean Cureton # Polygon / Polyline / Length / Boundary -/ -@[expose] public section +public section noncomputable section @@ -9106,7 +9114,7 @@ Authors: Dean Cureton # Polygon / Polyline / Length -/ -@[expose] public section +public section noncomputable section @@ -9235,7 +9243,7 @@ Authors: Dean Cureton # Polygon / Balancing / Coefficients -/ -@[expose] public section +public section noncomputable section namespace MovingSofa @@ -9370,7 +9378,7 @@ Authors: Dean Cureton # Polygon / Balancing / Estimate -/ -@[expose] public section +public section noncomputable section @@ -9769,7 +9777,7 @@ Authors: Dean Cureton # Polygon / Balancing -/ -@[expose] public section +public section noncomputable section @@ -9874,7 +9882,7 @@ both facts in the form used by the discrete estimates on polygon caps: polygon cap is carried by its proper edge normals. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/Development/Geometry/Applications/Development002.lean b/LeanPool/MovingSofa/Development/Geometry/Applications/Development002.lean index a4c274c9cd..e977886457 100644 --- a/LeanPool/MovingSofa/Development/Geometry/Applications/Development002.lean +++ b/LeanPool/MovingSofa/Development/Geometry/Applications/Development002.lean @@ -42,7 +42,7 @@ public import LeanPool.MovingSofa.Development.Geometry.Foundations.Development00 * `Area.Applications.Development004`. -/ -@[expose] public section +public section noncomputable section @@ -62,7 +62,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Bounds.WedgeGap.Limit`. -/ -@[expose] public section +public section noncomputable section @@ -78,7 +78,7 @@ Authors: Dean Cureton # Bounds / Arm / Estimates -/ -@[expose] public section +public section noncomputable section @@ -1051,7 +1051,7 @@ Authors: Dean Cureton # Bounds / Wedge Gap / Infimum -/ -@[expose] public section +public section noncomputable section @@ -1061,6 +1061,7 @@ open scoped Topology namespace MovingSofa /-- The two infima of the wedge-gap components over interior rotation angles. -/ +@[expose] def wedgeGapInfimum {ω : ℝ} (K : CapSpace ω) : ℝ × ℝ := (sInf ((fun t ↦ (wedgeGaps K t).1) '' Set.Ioo 0 ω), sInf ((fun t ↦ (wedgeGaps K t).2) '' Set.Ioo 0 ω)) @@ -1427,7 +1428,7 @@ Authors: Dean Cureton # Bounds / Wedge Gap / Limit -/ -@[expose] public section +public section noncomputable section @@ -1696,7 +1697,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Cap.BalancedExistence`. -/ -@[expose] public section +public section noncomputable section @@ -1712,7 +1713,7 @@ Authors: Dean Cureton # Cap / Balanced Existence -/ -@[expose] public section +public section noncomputable section @@ -2567,7 +2568,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Polygon.BalancedInequalities`. -/ -@[expose] public section +public section noncomputable section @@ -2583,7 +2584,7 @@ Authors: Dean Cureton # Polygon / Balanced Inequalities -/ -@[expose] public section +public section noncomputable section @@ -3880,7 +3881,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Cap.Interpolation`. -/ -@[expose] public section +public section noncomputable section @@ -3911,7 +3912,7 @@ On the first arc the domination inequality also bounds the density: the real den /-! ### A continuous section of the angular projection -/ -@[expose] public section +public section noncomputable section @@ -4314,7 +4315,7 @@ interpolation, so that it applies both to the cap produced by `isCap_convexBodyC and to an interpolated cap obtained by choice. -/ -@[expose] public section +public section noncomputable section @@ -4461,7 +4462,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Bounds.Lower.Sequence`. -/ -@[expose] public section +public section noncomputable section @@ -4494,7 +4495,7 @@ length functions of a nondegenerate cap are nonnegative, and the right one has i `f_K(0) = 1`. -/ -@[expose] public section +public section noncomputable section @@ -4743,7 +4744,7 @@ Authors: Dean Cureton # Bounds / Lower / Sequence -/ -@[expose] public section +public section noncomputable section @@ -5166,7 +5167,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Cap.Injectivity`. -/ -@[expose] public section +public section noncomputable section @@ -5190,7 +5191,7 @@ The theorem lives downstream of `MovingSofa/Cap/Regularity.lean` because its inp `balancedMaximumCap_hasDensities` and `balancedMaximumCap_arm_gt_one` depend on that module. -/ -@[expose] public section +public section noncomputable section @@ -5242,7 +5243,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Gerver.Injectivity`. -/ -@[expose] public section +public section noncomputable section @@ -5258,7 +5259,7 @@ Authors: Dean Cureton # Gerver / Injectivity -/ -@[expose] public section +public section noncomputable section @@ -5339,7 +5340,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Cap.Tail.Interpolation`. -/ -@[expose] public section +public section noncomputable section @@ -5355,7 +5356,7 @@ Authors: Dean Cureton # Cap / Special / Domain -/ -@[expose] public section +public section noncomputable section @@ -5467,7 +5468,7 @@ Authors: Dean Cureton # Cap / Special / Area Variation -/ -@[expose] public section +public section noncomputable section @@ -5556,7 +5557,7 @@ Authors: Dean Cureton # Cap / Tail / Interpolation -/ -@[expose] public section +public section noncomputable section @@ -5565,6 +5566,7 @@ open scoped unitInterval namespace MovingSofa /-- The cap and both tail bodies are the corresponding convex body combinations. -/ +@[expose] def IsCapTailCombination (t : I) (X Y Z : CapTailSpace) : Prop := Z.cap.val.val = convexBodyCombination t X.cap.val.val Y.cap.val.val ∧ Z.rightBody = convexBodyCombination t X.rightBody Y.rightBody ∧ @@ -5698,7 +5700,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Cap.UpperBoundaryTracing`. -/ -@[expose] public section +public section noncomputable section @@ -5729,7 +5731,7 @@ separately. /-! ### The middle window -/ -@[expose] public section +public section noncomputable section @@ -6088,7 +6090,7 @@ inner corner, hence convex-linear in `K` as well. /-! ### The outer corner path on the middle window -/ -@[expose] public section +public section noncomputable section @@ -6274,7 +6276,7 @@ Authors: Dean Cureton # Cap / Tail / Area Bounds -/ -@[expose] public section +public section noncomputable section @@ -6494,7 +6496,7 @@ area agrees with the sum of the four arc areas modulo convex-linear functionals (`MovingSofa.specialCapArea_equivalent_upper_arcs`). -/ -@[expose] public section +public section noncomputable section @@ -6749,7 +6751,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Area.QVariation`. -/ -@[expose] public section +public section noncomputable section @@ -6784,7 +6786,7 @@ corner, so the two segments cancel (`middleMamikon_segments_cancel_left`). What the three comparisons of `cornerArea_equivalent_modulo_linear`, the last of them reversed. -/ -@[expose] public section +public section noncomputable section @@ -7092,7 +7094,7 @@ supporting line at its own path parameter. Mamikon convexity therefore makes th does the same for `tangentMamikonValue`. -/ -@[expose] public section +public section noncomputable section @@ -7186,7 +7188,7 @@ Authors: Dean Cureton # Area / Mamikon / Sofa Convex -/ -@[expose] public section +public section noncomputable section @@ -7340,7 +7342,7 @@ the horizontal axis. What survives is `qVariationIntegral`: the cap surface int inner-corner integral, and the two tail integrals rewritten in opposite-angle coordinates. -/ -@[expose] public section +public section noncomputable section @@ -7349,6 +7351,7 @@ open MeasureTheory namespace MovingSofa /-- The support-function variation integral for the cap and its two tail bodies. -/ +@[expose] def qVariationIntegral (X Y : CapTailSpace) : ℝ := (∫ t in (fun s : ℝ ↦ (s : Real.Angle)) '' Set.Icc 0 Real.pi, (supportValue Y.cap.val.val t - supportValue X.cap.val.val t) diff --git a/LeanPool/MovingSofa/Development/Geometry/Applications/Development003.lean b/LeanPool/MovingSofa/Development/Geometry/Applications/Development003.lean index d611810911..eae2a70951 100644 --- a/LeanPool/MovingSofa/Development/Geometry/Applications/Development003.lean +++ b/LeanPool/MovingSofa/Development/Geometry/Applications/Development003.lean @@ -40,7 +40,7 @@ public import LeanPool.MovingSofa.Development.Geometry.Foundations.Development00 * `Main`. -/ -@[expose] public section +public section noncomputable section @@ -65,7 +65,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Gerver.QVariation`. -/ -@[expose] public section +public section noncomputable section @@ -100,7 +100,7 @@ inclusion for the fourth boundary piece: every interior point of the base segmen the niche (`gerver_bottom_segment_mem_gerverLiteralNiche`). -/ -@[expose] public section +public section noncomputable section @@ -1063,7 +1063,7 @@ walls, the closed-interval velocity signs `paperGerverVelocityComponents_fst_non `hasDerivWithinAt_paperGerverContacts_three_pos_smul`. -/ -@[expose] public section +public section noncomputable section @@ -1237,7 +1237,7 @@ containment of the contact curves in the tails and the injectivity of the two parametrizations. The support sums are the cut identity `h_L (s + π) = -m s`. -/ -@[expose] public section +public section noncomputable section @@ -2016,7 +2016,7 @@ window that is closed on the right, so the only atom to compute is the one at th endpoint `t₃` of the `B` arc. -/ -@[expose] public section +public section noncomputable section @@ -2558,7 +2558,7 @@ computation at the included stage endpoints is needed: a single parameter is Leb the four measures are only ever evaluated through their densities. -/ -@[expose] public section +public section noncomputable section @@ -3114,7 +3114,7 @@ sum, which is `≤ 1 - 1 = 0` by the cap-tail constraints. /-! ### The angular phase windows are measurable -/ -@[expose] public section +public section noncomputable section @@ -3669,7 +3669,7 @@ of `Q`'s connector segments, whose signed areas therefore vanish. /-! ## The four-piece traversal of the niche boundary -/ -@[expose] public section +public section noncomputable section @@ -3914,7 +3914,7 @@ The variation integral is therefore the sum of the eight phase contributions windows while the competitor's are at most `1`. -/ -@[expose] public section +public section noncomputable section @@ -4041,7 +4041,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Bounds.Upper.Properties`. -/ -@[expose] public section +public section noncomputable section @@ -4057,7 +4057,7 @@ Authors: Dean Cureton # Bounds / Upper / Properties -/ -@[expose] public section +public section noncomputable section @@ -4278,7 +4278,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Sofa.BalancedConsumed`. -/ -@[expose] public section +public section noncomputable section @@ -4294,7 +4294,7 @@ Authors: Dean Cureton # Sofa / Balanced -/ -@[expose] public section +public section noncomputable section @@ -4355,7 +4355,7 @@ Authors: Dean Cureton # Sofa / Balanced Consumed -/ -@[expose] public section +public section noncomputable section @@ -4844,7 +4844,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Motion.RotationAngle`. -/ -@[expose] public section +public section noncomputable section @@ -4860,7 +4860,7 @@ Authors: Dean Cureton # Motion / Rotation Angle -/ -@[expose] public section +public section noncomputable section @@ -5768,7 +5768,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Sofa.BalancedRightAngle`. -/ -@[expose] public section +public section noncomputable section @@ -5784,7 +5784,7 @@ Authors: Dean Cureton # Sofa / Balanced Right Angle -/ -@[expose] public section +public section noncomputable section @@ -5835,7 +5835,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Sofa.Maximum`. -/ -@[expose] public section +public section noncomputable section @@ -5860,7 +5860,7 @@ triple in the cap-tail space; the area functional is then bounded by `Q`, which is maximized by Gerver's triple and matches the area functional there. -/ -@[expose] public section +public section noncomputable section @@ -5934,7 +5934,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Motion.CanonicalUpperBound`. -/ -@[expose] public section +public section noncomputable section @@ -5955,7 +5955,7 @@ set is a paper moving sofa, and admissible sets are compact, so the comparison o comparison of Lebesgue measures. -/ -@[expose] public section +public section noncomputable section @@ -6004,7 +6004,7 @@ The imported development proves uniqueness of Gerver's defining parameters in with the proved area upper bound `MovingSofa.areaUpperBound`. -/ -@[expose] public section +public section namespace MovingSofa diff --git a/LeanPool/MovingSofa/Development/Geometry/Foundations/Development001.lean b/LeanPool/MovingSofa/Development/Geometry/Foundations/Development001.lean index 95d69b668c..1c6e5cfc7d 100644 --- a/LeanPool/MovingSofa/Development/Geometry/Foundations/Development001.lean +++ b/LeanPool/MovingSofa/Development/Geometry/Foundations/Development001.lean @@ -127,7 +127,7 @@ public import Mathlib.Topology.UniformSpace.Compact * `Infrastructure.Geometry.Foundations.Development002`. -/ -@[expose] public section +public section noncomputable section @@ -145,7 +145,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Analysis.Foundations.Development001`. -/ -@[expose] public section +public section noncomputable section @@ -163,7 +163,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Analysis.BoundedDensity`. -/ -@[expose] public section +public section noncomputable section @@ -179,7 +179,7 @@ Authors: Dean Cureton # Analysis / Bounded Density -/ -@[expose] public section +public section noncomputable section @@ -359,7 +359,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Classical.Foundations.Development001`. -/ -@[expose] public section +public section noncomputable section @@ -377,7 +377,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Classical.Area`. -/ -@[expose] public section +public section noncomputable section @@ -395,7 +395,7 @@ Authors: Dean Cureton The real-valued Lebesgue area of a planar set, and its invariance under translation. -/ -@[expose] public section +public section noncomputable section @@ -407,6 +407,7 @@ namespace MovingSofa.ClassicalResults abbrev Plane := EuclideanSpace ℝ (Fin 2) /-- The real-valued Lebesgue area of a planar set. -/ +@[expose] def area (s : Set Plane) : ℝ := (volume s).toReal /-- Planar area is invariant under translation. -/ @@ -461,7 +462,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `ForMathlib.MeasureTheory.Foundations.Development002`. -/ -@[expose] public section +public section noncomputable section @@ -480,7 +481,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `ForMathlib.Algebra.Order.Fin`. -/ -@[expose] public section +public section noncomputable section @@ -504,7 +505,7 @@ and `Fin.sum_sum_eq_sum_triangle_add` the `Fin` analogue; neither applies to a g of a plain `LinearOrder`. -/ -@[expose] public section +public section namespace Finset @@ -550,7 +551,7 @@ Authors: Dean Cureton # For Mathlib / Algebra / Order / Fin -/ -@[expose] public section +public section noncomputable section @@ -627,7 +628,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `ForMathlib.Analysis.SpecialFunctions.Trigonometric`. -/ -@[expose] public section +public section noncomputable section @@ -646,7 +647,7 @@ Authors: Dean Cureton function; this file records the converse implication, packaged as an `Iff`. -/ -@[expose] public section +public section /-- A derivative at a shifted base point is the derivative of the shifted function. -/ theorem hasDerivAt_comp_add_const_iff {𝕜 : Type*} [NontriviallyNormedField 𝕜] {F : Type*} @@ -674,7 +675,7 @@ A continuous real function that starts strictly below a level and reaches it has time at which it attains that level, and its derivative there is nonnegative. -/ -@[expose] public section +public section /-- A continuous function below a level at the left end has a first return to that level. -/ theorem exists_first_return {g : ℝ → ℝ} {a b c : ℝ} (hab : a < b) @@ -731,7 +732,7 @@ Authors: Dean Cureton # For Mathlib / Analysis / Calculus / Interval -/ -@[expose] public section +public section open Set @@ -820,7 +821,7 @@ at `a` are generated by `1` and by `-1`, which turns that statement into the two one-sided derivative tests at a one-sided minimum. -/ -@[expose] public section +public section /-- The forward direction belongs to the positive tangent cone of a right half-line. -/ theorem one_mem_posTangentConeAt_Ici (a : ℝ) : (1 : ℝ) ∈ posTangentConeAt (Set.Ici a) a := @@ -859,7 +860,7 @@ Authors: Dean Cureton # For Mathlib / Analysis / Complex / Disk Integral -/ -@[expose] public section +public section noncomputable section @@ -1192,7 +1193,7 @@ Authors: Dean Cureton # For Mathlib / Analysis / Convex / Basic -/ -@[expose] public section +public section namespace Convex @@ -1227,7 +1228,7 @@ Authors: Dean Cureton # For Mathlib / Analysis / Convex / Deriv -/ -@[expose] public section +public section open Filter Set open scoped Topology @@ -1311,7 +1312,7 @@ Authors: Dean Cureton # For Mathlib / Analysis / Convex / Gauge -/ -@[expose] public section +public section open Set open scoped Topology NNReal @@ -1435,7 +1436,7 @@ Authors: Dean Cureton # For Mathlib / Analysis / Convex / Gauge Rescale -/ -@[expose] public section +public section open Set open scoped Topology NNReal Pointwise @@ -1572,7 +1573,7 @@ ending at a boundary point, and that boundary point is unique. These are the fac radial decomposition of a convex body into cones over its boundary. -/ -@[expose] public section +public section open Set open scoped Topology Pointwise @@ -1681,7 +1682,7 @@ Authors: Dean Cureton # For Mathlib / Analysis / Finite Envelope -/ -@[expose] public section +public section noncomputable section @@ -1744,7 +1745,7 @@ Authors: Dean Cureton # For Mathlib / Analysis / Inner Product Space / Box -/ -@[expose] public section +public section namespace EuclideanSpace @@ -1789,7 +1790,7 @@ Authors: Dean Cureton half-space convexity lemmas `convex_halfSpace_le` and `convex_halfSpace_ge` consume. -/ -@[expose] public section +public section /-- `x ↦ ⟪x, v⟫` is a linear map of a real inner product space. -/ theorem isLinearMap_inner_left {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] @@ -1811,7 +1812,7 @@ Authors: Dean Cureton # For Mathlib / Analysis / Normed / Affine / Continuous Affine Map -/ -@[expose] public section +public section namespace ContinuousAffineMap @@ -1855,7 +1856,7 @@ Authors: Dean Cureton # For Mathlib / Analysis / Special Functions / Angle -/ -@[expose] public section +public section namespace Real.Angle @@ -1892,7 +1893,7 @@ Authors: Dean Cureton # For Mathlib / Analysis / Special Functions / Angle Lift -/ -@[expose] public section +public section namespace Real @@ -1932,7 +1933,7 @@ Authors: Dean Cureton first-order approximation `arctan s ≈ s` near the origin. -/ -@[expose] public section +public section namespace Real @@ -2036,7 +2037,7 @@ for the stride-two factorial quotients `x ^ (2 * n + a) / (2 * n + a)!` that the series of the trigonometric functions produce. -/ -@[expose] public section +public section /-- The stride-two factorial quotients `x ^ (2 * n + a) / (2 * n + a)!` are antitone as soon as `x ^ 2 ≤ (a + 1) * (a + 2)`, i.e. as soon as the first term ratio is at most one. -/ @@ -2109,7 +2110,7 @@ Authors: Dean Cureton # For Mathlib / Analysis / Special Functions / Trigonometric -/ -@[expose] public section +public section /-- The tangent of half a complementary angle is secant minus tangent on the first quadrant. -/ theorem Real.tan_pi_div_two_sub_div_two (ω : ℝ) (hω : ω ∈ Set.Ico 0 (Real.pi / 2)) : @@ -2256,7 +2257,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `ForMathlib.BoundedVariation`. -/ -@[expose] public section +public section noncomputable section @@ -2272,7 +2273,7 @@ Authors: Dean Cureton # For Mathlib / Bounded Variation -/ -@[expose] public section +public section /-- The variation of a sum is at most the sum of the variations. -/ theorem eVariationOn.add_le {α E : Type*} [LinearOrder α] @@ -2475,7 +2476,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `ForMathlib.Convex.Translation`. -/ -@[expose] public section +public section noncomputable section @@ -2491,7 +2492,7 @@ Authors: Dean Cureton # For Mathlib / Convex / Body / Boundary Measure -/ -@[expose] public section +public section noncomputable section @@ -2712,7 +2713,7 @@ Authors: Dean Cureton # For Mathlib / Convex / Body / Hausdorff -/ -@[expose] public section +public section open Filter open scoped Topology @@ -2754,7 +2755,7 @@ Authors: Dean Cureton # For Mathlib / Convex / Collinear -/ -@[expose] public section +public section open Module @@ -2815,7 +2816,7 @@ Authors: Dean Cureton # For Mathlib / Convex / Body / Segment -/ -@[expose] public section +public section noncomputable section @@ -2909,7 +2910,7 @@ Authors: Dean Cureton # For Mathlib / Convex / Function -/ -@[expose] public section +public section /-- A convex function stays below a bound before the right endpoint if the left endpoint is strictly below the bound and the right endpoint is at most the bound. -/ @@ -2947,7 +2948,7 @@ Authors: Dean Cureton # For Mathlib / Convex / Hausdorff -/ -@[expose] public section +public section open Filter TopologicalSpace open scoped Topology @@ -2999,7 +3000,7 @@ Authors: Dean Cureton # For Mathlib / Convex / Support -/ -@[expose] public section +public section open scoped ENNReal @@ -3172,9 +3173,10 @@ Authors: Dean Cureton # For Mathlib / Convex / Translation -/ -@[expose] public section +public section /-- Translation of a convex body by a vector. -/ +@[expose] def ConvexBody.translate {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] (K : ConvexBody E) (v : E) : ConvexBody E where carrier := (fun p ↦ p + v) '' (K : Set E) @@ -3205,7 +3207,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `ForMathlib.Geometry.Euclidean.Segment`. -/ -@[expose] public section +public section noncomputable section @@ -3221,7 +3223,7 @@ Authors: Dean Cureton # For Mathlib / Geometry / Euclidean / Segment -/ -@[expose] public section +public section open MeasureTheory @@ -3390,7 +3392,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `ForMathlib.MeasureTheory.Volume`. -/ -@[expose] public section +public section noncomputable section @@ -3406,7 +3408,7 @@ Authors: Dean Cureton # For Mathlib / Measure Theory / Euclidean Space -/ -@[expose] public section +public section open MeasureTheory @@ -3470,7 +3472,7 @@ for finite measures. This file supplies the missing open-set inequality for fini combining the closed-set inequality on the complement with the convergence of the total masses. -/ -@[expose] public section +public section noncomputable section @@ -3567,7 +3569,7 @@ Authors: Dean Cureton # For Mathlib / Measure Theory / Finite Measure / Restriction -/ -@[expose] public section +public section noncomputable section @@ -3769,7 +3771,7 @@ Authors: Dean Cureton # For Mathlib / Measure Theory / Angle -/ -@[expose] public section +public section noncomputable section @@ -4034,7 +4036,7 @@ Authors: Dean Cureton # For Mathlib / Measure Theory / Hausdorff / Arclength -/ -@[expose] public section +public section noncomputable section @@ -4522,7 +4524,7 @@ Authors: Dean Cureton # For Mathlib / Measure Theory / Hausdorff / Graph -/ -@[expose] public section +public section noncomputable section @@ -4648,7 +4650,7 @@ Authors: Dean Cureton # For Mathlib / Measure Theory / Hausdorff / Planar Graph -/ -@[expose] public section +public section noncomputable section @@ -4878,7 +4880,7 @@ Authors: Dean Cureton # For Mathlib / Measure Theory / Integral / Atomic Bounds -/ -@[expose] public section +public section noncomputable section @@ -4917,7 +4919,7 @@ Authors: Dean Cureton # For Mathlib / Measure Theory / Integral / Interval Exhaustion -/ -@[expose] public section +public section noncomputable section @@ -5017,7 +5019,7 @@ Authors: Dean Cureton # For Mathlib / Measure Theory / Integral / Moving Intervals -/ -@[expose] public section +public section noncomputable section @@ -5131,7 +5133,7 @@ Authors: Dean Cureton # For Mathlib / Measure Theory / Integral / Translation -/ -@[expose] public section +public section noncomputable section @@ -5218,7 +5220,7 @@ Authors: Dean Cureton # For Mathlib / Measure Theory / Measure / Atoms -/ -@[expose] public section +public section noncomputable section @@ -5377,7 +5379,7 @@ This file records the two convenient forms used when a planar region is exhauste up to the rays through finitely many vertices. -/ -@[expose] public section +public section open MeasureTheory open scoped Pointwise @@ -5446,7 +5448,7 @@ Authors: Dean Cureton # For Mathlib / Measure Theory / Measure / Map -/ -@[expose] public section +public section namespace MeasureTheory.Measure @@ -5477,7 +5479,7 @@ Authors: Dean Cureton # For Mathlib / Measure Theory / Measure / With Density -/ -@[expose] public section +public section open Set open scoped ENNReal @@ -5529,7 +5531,7 @@ Authors: Dean Cureton # For Mathlib / Measure Theory / Region Between -/ -@[expose] public section +public section open EuclideanSpace MeasureTheory Set @@ -5705,7 +5707,7 @@ Authors: Dean Cureton # Planar trapezoids with horizontal parallel sides -/ -@[expose] public section +public section namespace EuclideanSpace @@ -5833,7 +5835,7 @@ standard right triangle, whose area is computed by integration, along the linear the coordinate basis to the two edge vectors. -/ -@[expose] public section +public section open MeasureTheory Set open scoped Pointwise @@ -6020,7 +6022,7 @@ Authors: Dean Cureton # For Mathlib / Measure Theory / Stieltjes Density -/ -@[expose] public section +public section open MeasureTheory Set @@ -6067,7 +6069,7 @@ Authors: Dean Cureton # For Mathlib / Measure Theory / Vector Measure / Interval -/ -@[expose] public section +public section noncomputable section @@ -6125,7 +6127,7 @@ Authors: Dean Cureton # For Mathlib / Measure Theory / Vector Measure / With Density -/ -@[expose] public section +public section noncomputable section @@ -6236,7 +6238,7 @@ Authors: Dean Cureton # For Mathlib / Measure Theory / Volume -/ -@[expose] public section +public section open scoped Pointwise @@ -6278,7 +6280,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `ForMathlib.Order.IntervalPartition`. -/ -@[expose] public section +public section noncomputable section @@ -6294,7 +6296,7 @@ Authors: Dean Cureton # For Mathlib / Order / Infimum -/ -@[expose] public section +public section open Set @@ -6333,7 +6335,7 @@ Authors: Dean Cureton # For Mathlib / Order / Interval Partition -/ -@[expose] public section +public section open Set @@ -6382,7 +6384,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `ForMathlib.Topology.Order.IntervalExtension`. -/ -@[expose] public section +public section noncomputable section @@ -6398,7 +6400,7 @@ Authors: Dean Cureton # For Mathlib / Topology / Angle -/ -@[expose] public section +public section open scoped unitInterval @@ -6430,7 +6432,7 @@ Authors: Dean Cureton # For Mathlib / Topology / Order / Compact -/ -@[expose] public section +public section /-- A positive continuous function has a positive uniform lower bound on a nonempty compact set. -/ theorem IsCompact.exists_pos_forall_le {X : Type*} [TopologicalSpace X] @@ -6455,11 +6457,12 @@ Authors: Dean Cureton # For Mathlib / Topology / Order / Concatenation -/ -@[expose] public section +public section namespace Function /-- Concatenate two functions on `[0, 1]` on the interval `[0, 2]`. -/ +@[expose] noncomputable def concatUnitIntervals {E : Type*} (x y : Set.Icc (0 : ℝ) 1 → E) (t : Set.Icc (0 : ℝ) 2) : E := if (t : ℝ) ≤ 1 then x (Set.projIcc 0 1 (by norm_num) t) @@ -6664,7 +6667,7 @@ Authors: Dean Cureton # For Mathlib / Topology / Order / Interval -/ -@[expose] public section +public section namespace Set @@ -6674,6 +6677,7 @@ instance instCompactIccSpaceIcc (a b : ℝ) : CompactIccSpace (Icc a b) := end Set /-- Reverse a closed real interval about its midpoint. -/ +@[expose] def Set.Icc.reverse {a b : ℝ} (_hab : a ≤ b) : Set.Icc a b → Set.Icc a b := fun t ↦ ⟨a + b - t, by linarith [t.property.2], by linarith [t.property.1]⟩ @@ -6863,7 +6867,7 @@ Authors: Dean Cureton # For Mathlib / Topology / Order / Interval Extension -/ -@[expose] public section +public section noncomputable section namespace OrderIso @@ -6968,7 +6972,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `ForMathlib.MeasureTheory.VectorMeasure.LocallyConstant`. -/ -@[expose] public section +public section noncomputable section @@ -6984,7 +6988,7 @@ Authors: Dean Cureton # For Mathlib / Measure Theory / Stieltjes Transport -/ -@[expose] public section +public section noncomputable section @@ -7286,7 +7290,7 @@ Authors: Dean Cureton # For Mathlib / Measure Theory / Vector Measure / Locally Constant -/ -@[expose] public section +public section noncomputable section @@ -7360,7 +7364,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Polygon.Foundations.Development001`. -/ -@[expose] public section +public section noncomputable section @@ -7386,7 +7390,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Geometry.FrameCalculus`. -/ -@[expose] public section +public section noncomputable section @@ -7402,7 +7406,7 @@ Authors: Dean Cureton # Geometry / Plane -/ -@[expose] public section +public section namespace MovingSofa @@ -7445,13 +7449,14 @@ Authors: Dean Cureton # Geometry / Basic -/ -@[expose] public section +public section noncomputable section namespace MovingSofa /-- The normal and positively oriented tangent at an angular direction. -/ +@[expose] def frame (t : Real.Angle) : Point × Point := (!₂[t.cos, t.sin], !₂[-t.sin, t.cos]) @@ -7462,14 +7467,17 @@ abbrev normalVector (t : Real.Angle) : Point := (frame t).1 abbrev tangentVector (t : Real.Angle) : Point := (frame t).2 /-- The support value; geometric results require a nonempty compact set. -/ +@[expose] def supportValue (s : Set Point) (t : Real.Angle) : ℝ := sSup ((fun p ↦ inner ℝ p (normalVector t)) '' s) /-- The line with the given unit normal and signed offset. -/ +@[expose] def normalLine (t : Real.Angle) (h : ℝ) : Set Point := {p | inner ℝ p (normalVector t) = h} /-- A normal half-plane: `upper` chooses the greater side, `strict` its open version. -/ +@[expose] def normalHalfPlane (t : Real.Angle) (h : ℝ) (upper strict : Bool) : Set Point := {p | if upper then if strict then h < inner ℝ p (normalVector t) else h ≤ inner ℝ p (normalVector t) @@ -7502,6 +7510,7 @@ theorem convex_normalHalfPlane_open (t : Real.Angle) (h : ℝ) (upper : Bool) : · exact convex_halfSpace_gt hlin h /-- The supporting line and closed containing half-plane of a nonempty compact set. -/ +@[expose] def supportingLineHalfPlane (s : Set Point) (t : Real.Angle) : Set Point × Set Point := (normalLine t (supportValue s t), normalHalfPlane t (supportValue s t) false false) @@ -7533,7 +7542,7 @@ Authors: Dean Cureton # Geometry / Frame -/ -@[expose] public section +public section noncomputable section @@ -7773,7 +7782,7 @@ Authors: Dean Cureton # Geometry / Normal Lines -/ -@[expose] public section +public section noncomputable section @@ -7881,7 +7890,7 @@ Authors: Dean Cureton # Geometry / Quadrant Bounds -/ -@[expose] public section +public section namespace MovingSofa @@ -7940,7 +7949,7 @@ closed region is the closure of either smaller region (`closure_openSubgraph`, `closure_strictSubgraph`) and the open region is its interior (`interior_closedSubgraph`). -/ -@[expose] public section +public section noncomputable section @@ -7952,14 +7961,17 @@ theorem Point.eq_vecNotation (z : Point) : z = !₂[z 0, z 1] := by fin_cases i <;> simp /-- The closed region between the base and the graph of `f` over `[a, b]`. -/ +@[expose] def closedSubgraph (a b : ℝ) (f : ℝ → ℝ) : Set Point := {q | a ≤ q 0 ∧ q 0 ≤ b ∧ 0 ≤ q 1 ∧ q 1 ≤ f (q 0)} /-- The region under the graph of `f` over `[a, b]`, including the base but not the graph. -/ +@[expose] def strictSubgraph (a b : ℝ) (f : ℝ → ℝ) : Set Point := {q | a ≤ q 0 ∧ q 0 ≤ b ∧ 0 ≤ q 1 ∧ q 1 < f (q 0)} /-- The open region strictly between the base and the graph of `f` over `(a, b)`. -/ +@[expose] def openSubgraph (a b : ℝ) (f : ℝ → ℝ) : Set Point := {q | a < q 0 ∧ q 0 < b ∧ 0 < q 1 ∧ q 1 < f (q 0)} @@ -8166,7 +8178,7 @@ Authors: Dean Cureton # Geometry / Support -/ -@[expose] public section +public section noncomputable section @@ -8297,23 +8309,26 @@ Authors: Dean Cureton # Geometry / Contacts -/ -@[expose] public section +public section noncomputable section namespace MovingSofa /-- The exposed edge at a normal direction, including singleton edges. -/ +@[expose] def exposedEdge (K : ConvexBody Point) (t : Real.Angle) : Set Point := (K : Set Point) ∩ (supportingLineHalfPlane K t).1 /-- The positive and negative tangent endpoints of an exposed edge. -/ +@[expose] def edgeVertices (K : ConvexBody Point) (t : Real.Angle) : Point × Point := let heights := (fun p ↦ inner ℝ p (tangentVector t)) '' exposedEdge K t (supportValue K t • normalVector t + sSup heights • tangentVector t, supportValue K t • normalVector t + sInf heights • tangentVector t) /-- The intersection point of two supporting lines at nonparallel normal directions. -/ +@[expose] def supportingIntersection (K : ConvexBody Point) (a b : Real.Angle) : Point := supportValue K a • normalVector a + ((supportValue K b - supportValue K a * (b - a).cos) / (b - a).sin) • tangentVector a @@ -8858,7 +8873,7 @@ Authors: Dean Cureton # Geometry / Frame Calculus -/ -@[expose] public section +public section noncomputable section @@ -9009,7 +9024,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Cap.Area`. -/ -@[expose] public section +public section noncomputable section @@ -9025,27 +9040,31 @@ Authors: Dean Cureton # Cap / Basic -/ -@[expose] public section +public section noncomputable section namespace MovingSofa /-- The two real intervals of upper cap normals. -/ +@[expose] def capUpperAngles (ω : ℝ) : Set ℝ := Set.Icc 0 ω ∪ Set.Icc (Real.pi / 2) (ω + Real.pi / 2) /-- The normal directions of the two lower strip boundaries. -/ +@[expose] def capLowerNormals (ω : ℝ) : Set Real.Angle := {((ω + Real.pi : ℝ) : Real.Angle), ((3 * Real.pi / 2 : ℝ) : Real.Angle)} /-- A set represented by closed lower half-planes with allowed normal directions. -/ +@[expose] def HasHalfPlaneRepresentation (s : Set Point) (normals : Set Real.Angle) : Prop := ∃ constraints : Set (Real.Angle × ℝ), (∀ c ∈ constraints, c.1 ∈ normals) ∧ s = ⋂ c ∈ constraints, normalHalfPlane c.1 c.2 false false /-- The normalized cap conditions, including its nonzero rotation-angle domain. -/ +@[expose] def IsCap (ω : ℝ) (K : ConvexBody Point) : Prop := 0 < ω ∧ ω ≤ Real.pi / 2 ∧ supportValue K (ω : Real.Angle) = 1 ∧ @@ -9056,6 +9075,7 @@ def IsCap (ω : ℝ) (K : ConvexBody Point) : Prop := (((fun t : ℝ ↦ (t : Real.Angle)) '' capUpperAngles ω) ∪ capLowerNormals ω) /-- The space of caps at a fixed rotation angle. -/ +@[expose] def CapSpace (ω : ℝ) := {K : ConvexBody Point // IsCap ω K} /-- A nonempty finite set of angles strictly between zero and its rotation angle. -/ @@ -9070,17 +9090,20 @@ structure AngleSet where interior : ∀ t ∈ directions, t ∈ Set.Ioo 0 angle /-- The finite upper-normal domain associated with an angle set. -/ +@[expose] def angleDomain (Θ : AngleSet) : Set ℝ := (Θ.directions : Set ℝ) ∪ ((fun t ↦ t + Real.pi / 2) '' (Θ.directions : Set ℝ)) ∪ {Θ.angle, Real.pi / 2} /-- Polygon caps whose upper normals belong to the specified angle domain. -/ +@[expose] def PolygonCapSpace (Θ : AngleSet) := {K : CapSpace Θ.angle // HasHalfPlaneRepresentation (K.1 : Set Point) (((fun t : ℝ ↦ (t : Real.Angle)) '' angleDomain Θ) ∪ capLowerNormals Θ.angle)} /-- The fan above both lower strip boundaries. -/ +@[expose] def capFan (ω : ℝ) : Set Point := normalHalfPlane (ω : Real.Angle) 0 true false ∩ normalHalfPlane ((Real.pi / 2 : ℝ) : Real.Angle) 0 true false @@ -9090,6 +9113,7 @@ theorem convex_capFan (ω : ℝ) : Convex ℝ (capFan ω) := (convex_normalHalfPlane _ _ _).inter (convex_normalHalfPlane _ _ _) /-- The open inward quadrant of the supporting hallway, in support coordinates. -/ +@[expose] def innerQuadrant (s : Set Point) (t : ℝ) : Set Point := normalHalfPlane (t : Real.Angle) (supportValue s (t : Real.Angle) - 1) false true ∩ normalHalfPlane ((t + Real.pi / 2 : ℝ) : Real.Angle) @@ -9100,10 +9124,12 @@ theorem convex_innerQuadrant (s : Set Point) (t : ℝ) : Convex ℝ (innerQuadra (convex_normalHalfPlane_open _ _ _).inter (convex_normalHalfPlane_open _ _ _) /-- The niche is the union of inward quadrants clipped by the fan. -/ +@[expose] def capNiche {ω : ℝ} (K : CapSpace ω) : Set Point := capFan ω ∩ ⋃ t ∈ Set.Ioo 0 ω, innerQuadrant (K.1 : Set Point) t /-- The finite-angle niche uses the same fan clipping as the continuous niche. -/ +@[expose] def polygonNiche (Θ : AngleSet) (K : CapSpace Θ.angle) : Set Point := capFan Θ.angle ∩ ⋃ t ∈ Θ.directions, innerQuadrant (K.1 : Set Point) t @@ -9145,7 +9171,7 @@ Authors: Dean Cureton # Cap / Angle Domain -/ -@[expose] public section +public section noncomputable section @@ -9184,13 +9210,14 @@ Authors: Dean Cureton # Cap / Area -/ -@[expose] public section +public section noncomputable section namespace MovingSofa /-- Cap area minus niche area, with real Lebesgue area as in the classical interface. -/ +@[expose] def capAreaFunctional {ω : ℝ} (K : CapSpace ω) : ℝ := ClassicalResults.area (K.1 : Set Point) - ClassicalResults.area (capNiche K) @@ -9198,6 +9225,7 @@ def capAreaFunctional {ω : ℝ} (K : CapSpace ω) : ℝ := abbrev RightAngleCapSpace := CapSpace (Real.pi / 2) /-- The sofa area functional on the right-angle cap space. -/ +@[expose] def rightAngleAreaFunctional (K : RightAngleCapSpace) : ℝ := capAreaFunctional K end MovingSofa @@ -9241,7 +9269,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Polygon.Polyline.Projection`. -/ -@[expose] public section +public section noncomputable section @@ -9257,7 +9285,7 @@ Authors: Dean Cureton # Polygon / Angle Set -/ -@[expose] public section +public section noncomputable section @@ -9267,6 +9295,7 @@ open scoped Topology namespace MovingSofa /-- The interior points of the uniform angular grid. -/ +@[expose] def uniformAngleSet (ω : ℝ) (hω : 0 < ω) (hω' : ω ≤ Real.pi / 2) (n : ℕ) (hn : 2 ≤ n) : AngleSet where angle := ω @@ -9381,7 +9410,7 @@ Authors: Dean Cureton # Polygon / Boolean Functions -/ -@[expose] public section +public section namespace MovingSofa @@ -9389,6 +9418,7 @@ namespace MovingSofa abbrev BooleanFunction (n : ℕ) := (Fin n → Bool) → Bool /-- Changing inputs from false to true cannot change a true output to false. -/ +@[expose] def IsMonotoneBooleanFunction {n : ℕ} (E : BooleanFunction n) : Prop := ∀ P Q, (∀ i, P i = true → Q i = true) → E P = true → E Q = true @@ -9428,43 +9458,50 @@ Authors: Dean Cureton # Polygon / Height / Space -/ -@[expose] public section +public section noncomputable section namespace MovingSofa /-- Point sets obtained by translating a polygonal cap with the fixed angle data. -/ +@[expose] def PolygonCapTranslateSpace (Θ : AngleSet) := {S : Set Point // ∃ (K : PolygonCapSpace Θ) (q : Point), S = (fun p ↦ p + q) '' (K.val.val : Set Point)} /-- Real wall heights indexed by the finite angle domain. -/ +@[expose] def PolygonHeightSpace (Θ : AngleSet) := angleDomain Θ → ℝ /-- Extend a wall-height function by zero outside its angle domain. -/ +@[expose] def polygonHeightValue {Θ : AngleSet} (h : PolygonHeightSpace Θ) (t : ℝ) : ℝ := by classical exact if ht : t ∈ angleDomain Θ then h ⟨t, ht⟩ else 0 /-- Intersect the two endpoint strips of unit width determined by the height data. -/ +@[expose] def polygonHeightParallelogram {Θ : AngleSet} (h : PolygonHeightSpace Θ) : Set Point := ⋂ t ∈ ({Θ.angle, Real.pi / 2} : Set ℝ), normalHalfPlane (t : Real.Angle) (polygonHeightValue h t) false false ∩ normalHalfPlane (t : Real.Angle) (polygonHeightValue h t - 1) true false /-- Cut the endpoint parallelogram by all upper wall half-planes. -/ +@[expose] def polygonHeightCap {Θ : AngleSet} (h : PolygonHeightSpace Θ) : Set Point := polygonHeightParallelogram h ∩ ⋂ t ∈ (Θ.directions : Set ℝ) ∪ ((fun t : ℝ ↦ t + Real.pi / 2) '' Θ.directions), normalHalfPlane (t : Real.Angle) (polygonHeightValue h t) false false /-- Intersect the lower half-planes at the two endpoint directions. -/ +@[expose] def polygonHeightFan {Θ : AngleSet} (h : PolygonHeightSpace Θ) : Set Point := ⋂ t ∈ ({Θ.angle, Real.pi / 2} : Set ℝ), normalHalfPlane (t : Real.Angle) (polygonHeightValue h t - 1) true false /-- Intersect the endpoint fan with the union of forbidden inner corners. -/ +@[expose] def polygonHeightNiche {Θ : AngleSet} (h : PolygonHeightSpace Θ) : Set Point := polygonHeightFan h ∩ ⋃ t ∈ Θ.directions, normalHalfPlane (t : Real.Angle) (polygonHeightValue h t - 1) false true ∩ @@ -9472,6 +9509,7 @@ def polygonHeightNiche {Θ : AngleSet} (h : PolygonHeightSpace Θ) : Set Point : (polygonHeightValue h (t + Real.pi / 2) - 1) false true /-- The real area of the cap minus the real area of its niche. -/ +@[expose] def polygonHeightArea {Θ : AngleSet} (h : PolygonHeightSpace Θ) : ℝ := ClassicalResults.area (polygonHeightCap h) - ClassicalResults.area (polygonHeightNiche h) @@ -9482,10 +9520,12 @@ def polygonHeightExtensions {Θ : AngleSet} (h : PolygonHeightSpace Θ) : polygonHeightNiche h, polygonHeightArea h) /-- Take support values of a translated cap in the prescribed directions. -/ +@[expose] def polygonTranslateHeight {Θ : AngleSet} (K : PolygonCapTranslateSpace Θ) : PolygonHeightSpace Θ := fun t ↦ supportValue K.val (t.val : Real.Angle) /-- The niche and area functional associated with a translated cap. -/ +@[expose] def polygonTranslateExtensions {Θ : AngleSet} (K : PolygonCapTranslateSpace Θ) : Set Point × ℝ := (polygonHeightNiche (polygonTranslateHeight K), polygonHeightArea (polygonTranslateHeight K)) @@ -9509,7 +9549,7 @@ Authors: Dean Cureton # Polygon / Height / Bounds -/ -@[expose] public section +public section namespace MovingSofa @@ -9621,13 +9661,14 @@ Authors: Dean Cureton # Polygon / Height / Raised Support -/ -@[expose] public section +public section noncomputable section namespace MovingSofa /-- Increase one selected support height by the prescribed amount. -/ +@[expose] def raisedPolygonSupport {Θ : AngleSet} (K : PolygonCapSpace Θ) (t : angleDomain Θ) (ε : ℝ) : PolygonHeightSpace Θ := by classical @@ -9653,7 +9694,7 @@ Authors: Dean Cureton # Polygon / Nef / Basic -/ -@[expose] public section +public section noncomputable section @@ -9671,14 +9712,17 @@ structure PlanarHalfPlaneData where strict : Bool /-- The half-plane defined by the recorded normal, threshold and conventions. -/ +@[expose] def PlanarHalfPlaneData.carrier (H : PlanarHalfPlaneData) : Set Point := normalHalfPlane H.angle H.height H.upper H.strict /-- The line where the normal scalar product equals the recorded height. -/ +@[expose] def PlanarHalfPlaneData.boundaryLine (H : PlanarHalfPlaneData) : Set Point := normalLine H.angle H.height /-- Evaluate a Boolean function on the point’s memberships in a finite family of sets. -/ +@[expose] def booleanSet {n : ℕ} (E : BooleanFunction n) (H : Fin n → Set Point) : Set Point := by classical exact {p | E (fun i ↦ decide (p ∈ H i)) = true} @@ -9689,6 +9733,7 @@ def IsNefPolygon (X : Set Point) : Prop := X = booleanSet E (fun i ↦ (H i).carrier) /-- A monotone Boolean representation uses the supplied walls with distinct boundary lines. -/ +@[expose] def IsSimpleNefPolygonWith {n : ℕ} (X : Set Point) (H : Fin n → PlanarHalfPlaneData) : Prop := Function.Injective (fun i ↦ (H i).boundaryLine) ∧ @@ -9714,13 +9759,14 @@ Authors: Dean Cureton # Polygon / Nef / Cap Construction -/ -@[expose] public section +public section noncomputable section namespace MovingSofa /-- The upper walls and two lower endpoint walls defining the polygonal cap. -/ +@[expose] def polygonCapWalls {Θ : AngleSet} (h : PolygonHeightSpace Θ) : Set PlanarHalfPlaneData := (fun t : ℝ ↦ (⟨(t : Real.Angle), polygonHeightValue h t, false, false⟩ : PlanarHalfPlaneData)) '' angleDomain Θ ∪ @@ -9728,6 +9774,7 @@ def polygonCapWalls {Θ : AngleSet} (h : PolygonHeightSpace Θ) : Set PlanarHalf PlanarHalfPlaneData)) '' {Θ.angle, Real.pi / 2} /-- The strict inner walls and two lower endpoint walls defining the polygonal niche. -/ +@[expose] def polygonNicheWalls {Θ : AngleSet} (h : PolygonHeightSpace Θ) : Set PlanarHalfPlaneData := (fun t : ℝ ↦ (⟨(t : Real.Angle), polygonHeightValue h t - 1, false, true⟩ : PlanarHalfPlaneData)) '' @@ -10171,7 +10218,7 @@ Authors: Dean Cureton # Polygon / Nef / Cells -/ -@[expose] public section +public section noncomputable section @@ -10258,6 +10305,7 @@ def booleanCell {n : ℕ} (H : Fin n → Set Point) (P : Fin n → Bool) : Set P ⋂ j, if P j then H j else (H j)ᶜ /-- The vector of membership decisions for a point in a finite set family. -/ +@[expose] def setMembershipPattern {n : ℕ} (H : Fin n → Set Point) (p : Point) : Fin n → Bool := by classical exact fun j ↦ decide (p ∈ H j) @@ -10300,6 +10348,7 @@ lemma booleanSet_eq_iUnion_booleanCell {n : ℕ} (E : BooleanFunction n) _ = true := hEP /-- Intersect the closed sides of each wall selected by the Boolean pattern. -/ +@[expose] def closedBooleanCell {n : ℕ} (H : Fin n → PlanarHalfPlaneData) (P : Fin n → Bool) : Set Point := ⋂ j, normalHalfPlane (H j).angle (H j).height @@ -10327,18 +10376,21 @@ lemma mem_booleanCell_iff_mem_closedBooleanCell_of_ne {n : ℕ} Set.mem_compl_iff, Set.mem_ofPred_eq] at hj ⊢ <;> linarith /-- Switching the selected input from false to true switches the output to true. -/ +@[expose] def IsActiveBooleanPattern {n : ℕ} (E : BooleanFunction n) (i : Fin n) (P : Fin n → Bool) : Prop := E (Function.update P i false) = false ∧ E (Function.update P i true) = true /-- All input patterns for which the selected Boolean variable is active. -/ +@[expose] def activeBooleanPatterns {n : ℕ} (E : BooleanFunction n) (i : Fin n) : Finset (Fin n → Bool) := by classical exact Finset.univ.filter (IsActiveBooleanPattern E i) /-- The set gained by making the selected wall universally true rather than false. -/ +@[expose] def activeBooleanRegion {n : ℕ} (E : BooleanFunction n) (H : Fin n → PlanarHalfPlaneData) (i : Fin n) : Set Point := booleanSet E (Function.update (fun j ↦ (H j).carrier) i Set.univ) \ @@ -10489,13 +10541,14 @@ Authors: Dean Cureton # Polygon / Nef / Height -/ -@[expose] public section +public section noncomputable section namespace MovingSofa /-- Change one wall’s height by `δ` in a Boolean half-plane representation. -/ +@[expose] def perturbNefHeight {n : ℕ} (E : BooleanFunction n) (H : Fin n → PlanarHalfPlaneData) (i : Fin n) (δ : ℝ) : Set Point := booleanSet E (fun j ↦ @@ -10653,13 +10706,14 @@ Authors: Dean Cureton # Polygon / Perturbation Bounds -/ -@[expose] public section +public section noncomputable section namespace MovingSofa /-- The polygonal cap with independently specified upper and lower wall heights. -/ +@[expose] def independentWallCap {Θ : AngleSet} (upper lower : PolygonHeightSpace Θ) : Set Point := (⋂ t ∈ ({Θ.angle, Real.pi / 2} : Set ℝ), normalHalfPlane (t : Real.Angle) (polygonHeightValue upper t) false false ∩ @@ -10668,6 +10722,7 @@ def independentWallCap {Θ : AngleSet} (upper lower : PolygonHeightSpace Θ) : S normalHalfPlane (t : Real.Angle) (polygonHeightValue upper t) false false /-- The polygonal niche determined by independently specified lower wall heights. -/ +@[expose] def independentWallNiche {Θ : AngleSet} (lower : PolygonHeightSpace Θ) : Set Point := (⋂ t ∈ ({Θ.angle, Real.pi / 2} : Set ℝ), normalHalfPlane (t : Real.Angle) (polygonHeightValue lower t) true false) ∩ @@ -10768,7 +10823,7 @@ Authors: Dean Cureton # Polygon / Polyline / Basic -/ -@[expose] public section +public section namespace MovingSofa @@ -10781,6 +10836,7 @@ structure XMonotonePolylineData where increasing : StrictMono (fun i ↦ vertices i 0) /-- The union of the segments between consecutive vertices. -/ +@[expose] def XMonotonePolylineData.carrier (p : XMonotonePolylineData) : Set Point := ⋃ i : Fin p.edges, segment ℝ (p.vertices i.castSucc) (p.vertices i.succ) @@ -10805,7 +10861,7 @@ Authors: Dean Cureton # Polygon / Polyline / Displacement -/ -@[expose] public section +public section noncomputable section @@ -10927,16 +10983,18 @@ Authors: Dean Cureton # Polygon / Polyline / Graph -/ -@[expose] public section +public section noncomputable section namespace MovingSofa /-- The point on the graph of a real-valued function above a given abscissa. -/ +@[expose] def pointOnGraph (f : ℝ → ℝ) (x : ℝ) : Point := !₂[x, f x] /-- Evaluation of the affine function with slope-intercept pair `c`. -/ +@[expose] def affineValue (c : ℝ × ℝ) (x : ℝ) : ℝ := c.1 * x + c.2 /-- An affine real-valued function is continuous. -/ @@ -10977,6 +11035,7 @@ private theorem finite_affineCrossings (L : Finset (ℝ × ℝ)) : rfl /-- The closed vertical epigraph of a real-valued function. -/ +@[expose] def verticalEpigraph (f : ℝ → ℝ) : Set Point := {p | f (p 0) ≤ p 1} @@ -11406,7 +11465,7 @@ Authors: Dean Cureton # Polygon / Polyline / Measure -/ -@[expose] public section +public section noncomputable section @@ -11532,7 +11591,7 @@ Authors: Dean Cureton # Polygon / Polyline / Projection -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/Development/Geometry/Foundations/Development002.lean b/LeanPool/MovingSofa/Development/Geometry/Foundations/Development002.lean index d4a5780132..6c2846ded7 100644 --- a/LeanPool/MovingSofa/Development/Geometry/Foundations/Development002.lean +++ b/LeanPool/MovingSofa/Development/Geometry/Foundations/Development002.lean @@ -69,7 +69,7 @@ public import Mathlib.Topology.Order.IntermediateValue * `Infrastructure.Geometry.Foundations.Development004`. -/ -@[expose] public section +public section noncomputable section @@ -87,7 +87,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Analysis.Foundations.Development002`. -/ -@[expose] public section +public section noncomputable section @@ -126,7 +126,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Analysis.SurfaceMeasure.SegmentGraph`. -/ -@[expose] public section +public section noncomputable section @@ -142,13 +142,14 @@ Authors: Dean Cureton # Analysis / Bounded Variation -/ -@[expose] public section +public section noncomputable section namespace MovingSofa /-- Bounded variation for a real function on its actual closed-interval domain. -/ +@[expose] def IsIntervalBoundedVariation (a b : ℝ) (f : Set.Icc a b → ℝ) : Prop := BoundedVariationOn f Set.univ @@ -166,6 +167,7 @@ private theorem intervalBV_add {a b : ℝ} {f g : Set.Icc a b → ℝ} _ ≤ _ := add_le_add (eVariationOn.sum_le hu hus) (eVariationOn.sum_le hu hus) /-- The submodule of continuous planar interval functions with coordinatewise finite variation. -/ +@[expose] def continuousBVSubmodule (a b : ℝ) : Submodule ℝ (Set.Icc a b → Point) where carrier := {f | Continuous f ∧ ∀ i : Fin 2, IsIntervalBoundedVariation a b (fun t ↦ f t i)} @@ -224,7 +226,7 @@ Authors: Dean Cureton # Analysis / Measure Products -/ -@[expose] public section +public section noncomputable section @@ -256,6 +258,7 @@ def functionMeasureDot {X : Type*} [MeasurableSpace X] functionMeasureMul f.1 μ.1 + functionMeasureMul f.2 μ.2 /-- The oriented planar determinant `p₀ q₁ - p₁ q₀`. -/ +@[expose] def planeCrossProduct (p q : Point) : ℝ := p 0 * q 1 - p 1 * q 0 @@ -403,7 +406,7 @@ Authors: Dean Cureton # Analysis / Stieltjes / Integral -/ -@[expose] public section +public section noncomputable section @@ -439,11 +442,13 @@ theorem RightContinuousIntervalBV.exists_norm_bound {a b : ℝ} (hab : a ≤ b) f.boundedVariation.dist_le (Set.mem_univ t) (Set.mem_univ ⟨a, le_rfl, hab⟩) /-- The finite signed Stieltjes measure on the interval, with zero initial atom. -/ +@[expose] def intervalStieltjesMeasure {a b : ℝ} (f : RightContinuousIntervalBV a b) : SignedMeasure (Set.Icc a b) := f.boundedVariation.vectorMeasure /-- The Stieltjes integral, used for bounded measurable integrands and Borel subsets. -/ +@[expose] def intervalStieltjesIntegral {a b : ℝ} (f : RightContinuousIntervalBV a b) (g : Set.Icc a b → ℝ) (X : Set (Set.Icc a b)) : ℝ := ∫ᵛ t in X, g t ∂[ContinuousLinearMap.mul ℝ ℝ; intervalStieltjesMeasure f] @@ -475,7 +480,7 @@ Authors: Dean Cureton # Analysis / Stieltjes / Absolute Continuity -/ -@[expose] public section +public section noncomputable section @@ -634,7 +639,7 @@ Authors: Dean Cureton # Analysis / Stieltjes / Calculus -/ -@[expose] public section +public section noncomputable section @@ -862,7 +867,7 @@ Authors: Dean Cureton # Analysis / Stieltjes / Density Integration -/ -@[expose] public section +public section noncomputable section @@ -981,7 +986,7 @@ Authors: Dean Cureton # Analysis / Stieltjes / Linearity -/ -@[expose] public section +public section noncomputable section @@ -1062,7 +1067,7 @@ Authors: Dean Cureton # Analysis / Stieltjes / Inner Product -/ -@[expose] public section +public section noncomputable section @@ -1115,7 +1120,7 @@ Authors: Dean Cureton # Analysis / Stieltjes / Smooth -/ -@[expose] public section +public section noncomputable section @@ -1229,7 +1234,7 @@ Authors: Dean Cureton # Analysis / Stieltjes / Frame -/ -@[expose] public section +public section noncomputable section @@ -1301,7 +1306,7 @@ Authors: Dean Cureton # Analysis / Stieltjes / Transport -/ -@[expose] public section +public section noncomputable section @@ -1518,7 +1523,7 @@ Authors: Dean Cureton # Analysis / Stieltjes / Continuous -/ -@[expose] public section +public section noncomputable section @@ -1641,7 +1646,7 @@ Authors: Dean Cureton # Analysis / Stieltjes / Affine -/ -@[expose] public section +public section noncomputable section @@ -1785,7 +1790,7 @@ integral of a continuous integrand against a continuous BV integrator, uniformly mesh of the partition. -/ -@[expose] public section +public section noncomputable section @@ -1982,7 +1987,7 @@ Authors: Dean Cureton # Analysis / Stieltjes / Shift -/ -@[expose] public section +public section noncomputable section @@ -2074,7 +2079,7 @@ Authors: Dean Cureton # Analysis / Surface Measure / Basic -/ -@[expose] public section +public section noncomputable section @@ -2087,24 +2092,29 @@ instance angleMeasurableSpace : MeasurableSpace Real.Angle := borel Real.Angle instance angleBorelSpace : BorelSpace Real.Angle := ⟨rfl⟩ /-- An exterior normal direction at a point of a convex body. -/ +@[expose] def IsExteriorNormal (K : ConvexBody Point) (p : Point) (a : Real.Angle) : Prop := ∀ q ∈ (K : Set Point), inner ℝ (q - p) (normalVector a) ≤ 0 /-- Boundary points with exactly one exterior unit normal. -/ +@[expose] def regularBoundary (K : ConvexBody Point) : Set Point := {p | p ∈ frontier (K : Set Point) ∧ ∃! a, IsExteriorNormal K p a} /-- The unique exterior normal at regular points, extended by zero elsewhere. -/ +@[expose] def exteriorNormalAngle (K : ConvexBody Point) (p : Point) : Real.Angle := by classical exact if h : ∃! a, IsExteriorNormal K p a then h.exists.choose else 0 /-- A nontrivial segment presentation and a perpendicular angular direction. -/ +@[expose] def IsSegmentPresentation (K : ConvexBody Point) (d : Point × Point × Real.Angle) : Prop := d.1 ≠ d.2.1 ∧ (K : Set Point) = segment ℝ d.1 d.2.1 ∧ inner ℝ (d.2.1 - d.1) (normalVector d.2.2) = 0 /-- Surface measure in angular coordinates, including point and segment bodies. -/ +@[expose] def surfaceAreaMeasure (K : ConvexBody Point) : Measure Real.Angle := by classical exact if (K : Set Point).Subsingleton then 0 @@ -2135,7 +2145,7 @@ Authors: Dean Cureton # Analysis / Surface Measure / Exterior Normal -/ -@[expose] public section +public section noncomputable section @@ -2211,28 +2221,32 @@ Authors: Dean Cureton # Analysis / Surface Measure / Graph Definitions -/ -@[expose] public section +public section noncomputable section namespace MovingSofa /-- Project the convex body horizontally after translating and changing orthonormal frame. -/ +@[expose] def horizontalProjection (K : ConvexBody Point) (o : Point) (e : Point ≃ₗᵢ[ℝ] Point) : Set ℝ := (fun p : Point ↦ e (p - o) 0) '' (K : Set Point) /-- The infimum and supremum of the body’s horizontal projection in the chosen frame. -/ +@[expose] def horizontalBounds (K : ConvexBody Point) (o : Point) (e : Point ≃ₗᵢ[ℝ] Point) : ℝ × ℝ := (sInf (horizontalProjection K o e), sSup (horizontalProjection K o e)) /-- The supremum of the body’s vertical section at a given horizontal coordinate. -/ +@[expose] def upperGraphHeight (K : ConvexBody Point) (o : Point) (e : Point ≃ₗᵢ[ℝ] Point) (x : ℝ) : ℝ := sSup {y : ℝ | o + e.symm !₂[x, y] ∈ (K : Set Point)} /-- The argument of a planar vector, viewed as an angle modulo a full turn. -/ +@[expose] def vectorNormalAngle (p : Point) : Real.Angle := (Complex.arg ⟨p 0, p 1⟩ : ℝ) @@ -2260,6 +2274,7 @@ theorem normalVector_vectorNormalAngle {p : Point} (hp : p ≠ 0) : Complex.sin_arg z /-- Weight the upper graph by its normal direction and arc-length Jacobian. -/ +@[expose] def upperGraphSurfaceIntegrand (K : ConvexBody Point) (o : Point) (e : Point ≃ₗᵢ[ℝ] Point) (ψ : Real.Angle → ℝ) (x : ℝ) : ℝ := ψ (vectorNormalAngle (e.symm !₂[-deriv (upperGraphHeight K o e) x, 1])) * @@ -2284,7 +2299,7 @@ Authors: Dean Cureton # Analysis / Surface Measure / Regularity -/ -@[expose] public section +public section noncomputable section @@ -2484,7 +2499,7 @@ Authors: Dean Cureton # Analysis / Surface Measure / Segment -/ -@[expose] public section +public section noncomputable section @@ -2623,7 +2638,7 @@ Authors: Dean Cureton # Analysis / Surface Measure / Segment Faces -/ -@[expose] public section +public section noncomputable section @@ -2814,7 +2829,7 @@ Authors: Dean Cureton # Analysis / Surface Measure / Segment Graph -/ -@[expose] public section +public section noncomputable section @@ -3229,7 +3244,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Curve.Foundations.Development001`. -/ -@[expose] public section +public section noncomputable section @@ -3270,7 +3285,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Curve.StieltjesChainRule`. -/ -@[expose] public section +public section noncomputable section @@ -3286,18 +3301,20 @@ Authors: Dean Cureton # Curve / Area -/ -@[expose] public section +public section noncomputable section namespace MovingSofa /-- The constant planar path, as a continuous path of bounded variation. -/ +@[expose] def constBVPath (a b : ℝ) (p : Point) : ContinuousBVPaths a b := ⟨fun _ ↦ p, continuous_const, fun i ↦ by simp [IsIntervalBoundedVariation, BoundedVariationOn, eVariationOn]⟩ /-- View one coordinate of a continuous BV path as a right-continuous BV function. -/ +@[expose] def continuousBVCoordinate {a b : ℝ} (x : ContinuousBVPaths a b) (i : Fin 2) : RightContinuousIntervalBV a b where toFun t := x.val t i @@ -3306,6 +3323,7 @@ def continuousBVCoordinate {a b : ℝ} (x : ContinuousBVPaths a b) (i : Fin 2) : ((PiLp.continuous_apply 2 _ i).comp x.property.1).continuousAt.continuousWithinAt /-- Half the difference of the two coordinate Stieltjes integrals, giving signed area. -/ +@[expose] def curveAreaFunctional {a b : ℝ} (x : ContinuousBVPaths a b) : ℝ := (intervalStieltjesIntegral (continuousBVCoordinate x 1) (fun t ↦ x.val t 0) Set.univ - intervalStieltjesIntegral (continuousBVCoordinate x 0) (fun t ↦ x.val t 1) Set.univ) / 2 @@ -3329,7 +3347,7 @@ Authors: Dean Cureton # Curve / Area Transport -/ -@[expose] public section +public section noncomputable section @@ -3554,7 +3572,7 @@ Authors: Dean Cureton # Curve / Concatenation -/ -@[expose] public section +public section noncomputable section @@ -3572,6 +3590,7 @@ structure RectifiablePathData where /-- An ordered interval partition identifies the path with a nonempty list of parametrized pieces. -/ +@[expose] def IsPathConcatenation (Γ : RectifiablePathData) {n : ℕ} (pieces : Fin n → RectifiablePathData) : Prop := 0 < n ∧ ∃ cuts : Fin (n + 1) → Set.Icc Γ.a Γ.b, @@ -3637,7 +3656,7 @@ Authors: Dean Cureton # Curve / Area Additivity -/ -@[expose] public section +public section noncomputable section @@ -3734,7 +3753,7 @@ Authors: Dean Cureton # Curve / Cyclic Rotation -/ -@[expose] public section +public section noncomputable section @@ -3743,6 +3762,7 @@ namespace MovingSofa open MeasureTheory Set /-- Restrict a continuous BV path to a closed subinterval. -/ +@[expose] def ContinuousBVPaths.restrict {a b : ℝ} (x : ContinuousBVPaths a b) (l u : Set.Icc a b) (_hlu : l ≤ u) : ContinuousBVPaths (l : ℝ) u := let ι : Set.Icc (l : ℝ) u → Set.Icc a b := fun t ↦ @@ -4145,16 +4165,18 @@ Authors: Dean Cureton # Curve / Jordan / Basic -/ -@[expose] public section +public section namespace MovingSofa /-- The set is the range of an injective continuous map from a closed real interval. -/ +@[expose] def IsJordanArc (Γ : Set Point) : Prop := ∃ (a b : ℝ) (_ : a ≤ b) (x : Set.Icc a b → Point), Continuous x ∧ Function.Injective x ∧ Set.range x = Γ /-- The set is the range of an injective continuous map from the circle. -/ +@[expose] def IsJordanCurve (Γ : Set Point) : Prop := ∃ x : Circle → Point, Continuous x ∧ Function.Injective x ∧ Set.range x = Γ @@ -4163,6 +4185,7 @@ def jordanSets : (Set Point → Prop) × (Set Point → Prop) := (IsJordanArc, IsJordanCurve) /-- A Jordan arc admits a parametrization with the specified starting and ending points. -/ +@[expose] def IsOrientedJordanArc (Γ : Set Point) (p q : Point) : Prop := ∃ (a b : ℝ) (hab : a ≤ b) (x : Set.Icc a b → Point), Continuous x ∧ Function.Injective x ∧ Set.range x = Γ ∧ @@ -4195,17 +4218,19 @@ Authors: Dean Cureton # Curve / Jordan / Orientation -/ -@[expose] public section +public section noncomputable section namespace MovingSofa /-- Points outside the curve whose connected component in its complement is bounded. -/ +@[expose] def jordanInterior (Γ : Set Point) : Set Point := {p | p ∉ Γ ∧ Bornology.IsBounded (connectedComponentIn Γᶜ p)} /-- A continuous real angle lifts the normalized displacement from the specified point. -/ +@[expose] def IsCurveAngleLift {a b : ℝ} (x : Set.Icc a b → Point) (p : Point) (θ : Set.Icc a b → ℝ) : Prop := Continuous θ ∧ ∀ t, @@ -4213,6 +4238,7 @@ def IsCurveAngleLift {a b : ℝ} (x : Set.Icc a b → Point) (p : Point) Real.sin (θ t) = (x t - p) 1 / ‖x t - p‖ /-- The angle-lift increment divided by `2π`, with value zero if no lift exists. -/ +@[expose] def curveWinding {a b : ℝ} (hab : a ≤ b) (x : Set.Icc a b → Point) (p : Point) : ℝ := by classical exact if h : ∃ θ, IsCurveAngleLift x p θ then @@ -4220,6 +4246,7 @@ def curveWinding {a b : ℝ} (hab : a ≤ b) (x : Set.Icc a b → Point) (p : Po else 0 /-- A simple closed parametrization with the specified winding sign on the interior. -/ +@[expose] def IsOrientedJordanParametrization {a b : ℝ} (hab : a ≤ b) (Γ : Set Point) (counterclockwise : Bool) (x : Set.Icc a b → Point) : Prop := a < b ∧ IsJordanCurve Γ ∧ Continuous x ∧ Set.range x = Γ ∧ @@ -4260,7 +4287,7 @@ Authors: Dean Cureton # Curve / Jordan / Area -/ -@[expose] public section +public section noncomputable section @@ -4300,6 +4327,7 @@ abbrev RectifiableOrientedCurve := {Γ : OrientedJordanCurve // Nonempty (ClosedBVParametrization Γ)} /-- The signed Stieltjes area of a chosen BV parametrization of the oriented arc. -/ +@[expose] def jordanArcArea (Γ : RectifiableOrientedArc) : ℝ := curveAreaFunctional (Classical.choice Γ.property).path @@ -4330,7 +4358,7 @@ Authors: Dean Cureton # Curve / Jordan / Arc Area -/ -@[expose] public section +public section noncomputable section @@ -4443,7 +4471,7 @@ Authors: Dean Cureton # Curve / Jordan / Parametrization -/ -@[expose] public section +public section noncomputable section @@ -4476,6 +4504,7 @@ theorem intervalToRange_surjective {a b : ℝ} (x : Set.Icc a b → Point) : exact ⟨t, rfl⟩ /-- The carrier of a closed parametrized loop with its basepoint removed. -/ +@[expose] def puncturedLoopRangeSet {a b : ℝ} (hab : a ≤ b) (x : Set.Icc a b → Point) : Set (Set.range x) := {p | (p : Point) ≠ x ⟨a, le_rfl, hab⟩} @@ -4901,7 +4930,7 @@ Authors: Dean Cureton # Curve / Jordan / Unit Sphere -/ -@[expose] public section +public section noncomputable section namespace MovingSofa @@ -4982,7 +5011,7 @@ Authors: Dean Cureton # Curve / Jordan / Winding -/ -@[expose] public section +public section noncomputable section @@ -5074,7 +5103,7 @@ Authors: Dean Cureton # Curve / Jordan / Radial Winding -/ -@[expose] public section +public section noncomputable section namespace MovingSofa @@ -5121,7 +5150,7 @@ Authors: Dean Cureton # Curve / Jordan / Winding Concatenation -/ -@[expose] public section +public section noncomputable section @@ -5212,7 +5241,7 @@ Authors: Dean Cureton # Curve / Jordan / Cyclic Rotation -/ -@[expose] public section +public section noncomputable section namespace MovingSofa @@ -5325,7 +5354,7 @@ Authors: Dean Cureton # Curve / Jordan / Winding Kernel -/ -@[expose] public section +public section noncomputable section @@ -5334,6 +5363,7 @@ open MeasureTheory namespace MovingSofa /-- The inverse-distance vector kernel based at `z`. -/ +@[expose] def windingKernel (z p : Point) : Point := (‖z - p‖ ^ 2)⁻¹ • (z - p) @@ -5564,7 +5594,7 @@ Authors: Dean Cureton # Curve / Jordan / Winding Local Constancy -/ -@[expose] public section +public section noncomputable section @@ -5877,7 +5907,7 @@ Authors: Dean Cureton # Curve / Jordan / Winding Lifts -/ -@[expose] public section +public section noncomputable section @@ -6075,7 +6105,7 @@ compact initial subarc has finite Hausdorff length, hence vanishing Hausdorff `2 and a rational exhaustion together with the terminal point covers the whole range. -/ -@[expose] public section +public section noncomputable section @@ -6139,13 +6169,14 @@ Authors: Dean Cureton # Curve / Segment Area -/ -@[expose] public section +public section noncomputable section namespace MovingSofa /-- Half the oriented determinant of the two endpoints. -/ +@[expose] def segmentArea (p q : Point) : ℝ := planeCrossProduct p q / 2 /-- The signed segment area is antisymmetric in its two endpoints. -/ @@ -6208,7 +6239,7 @@ Authors: Dean Cureton # Curve / Segment Area / Parametrization -/ -@[expose] public section +public section noncomputable section @@ -6217,6 +6248,7 @@ namespace MovingSofa open MeasureTheory Set /-- The affine segment from `p` to `q`, bundled as a continuous BV path. -/ +@[expose] def lineSegmentBVPath (p q : Point) : ContinuousBVPaths 0 1 where val := Path.segment p q property := by @@ -6300,7 +6332,7 @@ Authors: Dean Cureton # Curve / Smooth Interval Paths -/ -@[expose] public section +public section noncomputable section @@ -6308,6 +6340,7 @@ namespace MovingSofa /-- A continuously differentiable planar path on a compact interval has continuous bounded-variation coordinates. -/ +@[expose] def continuousBVOfContDiffOn {a b : ℝ} (f : ℝ → Point) (hf : ContDiffOn ℝ 1 f (Set.Icc a b)) : ContinuousBVPaths a b := by refine ⟨fun t ↦ f t, continuousOn_iff_continuous_domRestrict.mp hf.continuousOn, ?_⟩ @@ -6326,6 +6359,7 @@ def continuousBVOfContDiffOn {a b : ℝ} (f : ℝ → Point) exact (EuclideanSpace.proj (𝕜 := ℝ) i).lipschitzWith.comp_boundedVariationOn hpath /-- A Lipschitz planar path on a compact interval has continuous bounded-variation coordinates. -/ +@[expose] def continuousBVOfLipschitz {a b : ℝ} (f : Set.Icc a b → Point) {C : NNReal} (hf : LipschitzWith C f) : ContinuousBVPaths a b := by refine ⟨f, hf.continuous, ?_⟩ @@ -6373,6 +6407,7 @@ theorem boundedVariationOn_coord_Icc_of_contDiffOn {a b : ℝ} (g : Set.Icc a b /-- Gluing two continuously differentiable pieces along a shared endpoint gives a continuous path of bounded variation. -/ +@[expose] def continuousBVOfContDiffOnIccUnionIcc {a b c : ℝ} (f : ℝ → Point) (hab : a ≤ b) (hbc : b ≤ c) (h₁ : ContDiffOn ℝ 1 f (Set.Icc a b)) (h₂ : ContDiffOn ℝ 1 f (Set.Icc b c)) : ContinuousBVPaths a c := by @@ -6406,12 +6441,13 @@ Authors: Dean Cureton # Curve / Jordan / Radial Loop -/ -@[expose] public section +public section noncomputable section namespace MovingSofa /-- A Lipschitz map on the unit circle induces a continuous BV loop in increasing angular order. -/ +@[expose] def radialBVLoop (f : {u : Point | ‖u‖ = 1} → Point) {C : NNReal} (hf : LipschitzWith C f) : ContinuousBVPaths 0 (2 * Real.pi) := by let n : Set.Icc (0 : ℝ) (2 * Real.pi) → {u : Point | ‖u‖ = 1} := @@ -6498,7 +6534,7 @@ This is what a locally defined argument branch supplies: no single plane functio named, and no constant is needed across a branch cut. -/ -@[expose] public section +public section noncomputable section @@ -6568,7 +6604,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Area.Foundations.Development002`. -/ -@[expose] public section +public section noncomputable section @@ -6587,7 +6623,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Area.ThreePieceRoof`. -/ -@[expose] public section +public section noncomputable section @@ -6603,7 +6639,7 @@ Authors: Dean Cureton # Area / Monotone Roof -/ -@[expose] public section +public section noncomputable section @@ -7112,7 +7148,7 @@ bounds it, and `area_region_under_roof_le` compares that area with the areas of set containing the rest of the open region. -/ -@[expose] public section +public section noncomputable section @@ -7633,7 +7669,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Convex.Foundations.Development001`. -/ -@[expose] public section +public section noncomputable section @@ -7662,7 +7698,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Convex.Space`. -/ -@[expose] public section +public section noncomputable section @@ -7678,7 +7714,7 @@ Authors: Dean Cureton # Convex / Boundary Variation -/ -@[expose] public section +public section noncomputable section @@ -7857,7 +7893,7 @@ Authors: Dean Cureton # Convex / Boundary Approximation -/ -@[expose] public section +public section noncomputable section @@ -7999,7 +8035,7 @@ Authors: Dean Cureton # Convex / Combination -/ -@[expose] public section +public section noncomputable section @@ -8010,17 +8046,20 @@ universe u v w namespace MovingSofa /-- A barycentric operation has an injective realization as convex combinations in a real space. -/ +@[expose] def IsConvexDomain {α : Type u} (c : I → α → α → α) : Prop := ∃ (V : ModuleCat.{v} ℝ) (e : α → V), Function.Injective e ∧ Convex ℝ (Set.range e) ∧ ∀ (t : I) x y, e (c t x y) = (1 - (t : ℝ)) • e x + (t : ℝ) • e y /-- Preservation of the specified barycentric operations. -/ +@[expose] def IsConvexLinear {α : Type u} {β : Type v} (cα : I → α → α → α) (cβ : I → β → β → β) (f : α → β) : Prop := ∀ t x y, f (cα t x y) = cβ t (f x) (f y) /-- Separate preservation of barycentric combinations in both variables. -/ +@[expose] def IsConvexBilinear {α : Type u} {β : Type v} {γ : Type w} (cα : I → α → α → α) (cβ : I → β → β → β) (cγ : I → γ → γ → γ) (g : α → β → γ) : Prop := @@ -8028,24 +8067,29 @@ def IsConvexBilinear {α : Type u} {β : Type v} {γ : Type w} ∀ y, IsConvexLinear cα cγ (fun x ↦ g x y) /-- The usual barycentric combination of real numbers. -/ +@[expose] def realCombination (t : I) (x y : ℝ) : ℝ := (1 - (t : ℝ)) * x + (t : ℝ) * y /-- A quadratic functional is the diagonal of a separately convex-linear real map. -/ +@[expose] def IsQuadraticFunctional {α : Type u} (c : I → α → α → α) (f : α → ℝ) : Prop := ∃ g : α → α → ℝ, IsConvexBilinear c c realCombination g ∧ ∀ x, f x = g x x /-- Concavity or convexity according to the direction of the barycentric inequality. -/ +@[expose] def IsConvexFunctional {α : Type u} (c : I → α → α → α) (f : α → ℝ) (concave : Bool) : Prop := ∀ t x y, if concave then realCombination t (f x) (f y) ≤ f (c t x y) else f (c t x y) ≤ realCombination t (f x) (f y) /-- The segment function, extended by zero outside its parameter interval. -/ +@[expose] def segmentFunctional {α : Type u} (c : I → α → α → α) (f : α → ℝ) (x y : α) (t : ℝ) : ℝ := if ht : t ∈ Set.Icc (0 : ℝ) 1 then f (c ⟨t, ht⟩ x y) else 0 /-- The right derivative along the barycentric segment; used for quadratic functionals. -/ +@[expose] def convexDirectionalDerivative {α : Type u} (c : I → α → α → α) (f : α → ℝ) (x y : α) : ℝ := derivWithin (segmentFunctional c f x y) (Set.Icc 0 1) 0 @@ -8073,7 +8117,7 @@ Authors: Dean Cureton # Convex / Area Superlevel -/ -@[expose] public section +public section noncomputable section @@ -8164,7 +8208,7 @@ two endpoints. Neither statement needs any topology or differentiability: the tw functions are literally equal. -/ -@[expose] public section +public section noncomputable section @@ -8247,7 +8291,7 @@ off that null set and monotonicity give the bound. Repeated contacts, zero conta collinear consecutive rays are allowed: a degenerate triangle simply has vanishing area. -/ -@[expose] public section +public section noncomputable section @@ -8432,7 +8476,7 @@ Authors: Dean Cureton # Convex / Exposed Faces -/ -@[expose] public section +public section noncomputable section @@ -8543,7 +8587,7 @@ Authors: Dean Cureton # Convex / Limits -/ -@[expose] public section +public section noncomputable section @@ -8553,6 +8597,7 @@ open scoped Topology namespace MovingSofa /-- The supremum of scalar products with a specified direction vector. -/ +@[expose] def vectorSupport (S : Set Point) (u : Point) : ℝ := sSup ((fun x ↦ inner ℝ x u) '' S) /-- Support values in a unit direction vary by at most the Hausdorff distance. -/ @@ -8926,7 +8971,7 @@ Authors: Dean Cureton # Convex / Support Embedding -/ -@[expose] public section +public section noncomputable section @@ -9000,7 +9045,7 @@ Authors: Dean Cureton # Convex / Combination Properties -/ -@[expose] public section +public section noncomputable section @@ -9142,7 +9187,7 @@ one-sided derivatives of `s ↦ ⟪z, u_s⟫ - m s` at `t`: `p` with one endpoint vertex of the face at the two boundary parameters. -/ -@[expose] public section +public section noncomputable section @@ -9271,7 +9316,7 @@ Authors: Dean Cureton # Convex / Space -/ -@[expose] public section +public section open scoped unitInterval Pointwise @@ -9327,7 +9372,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Area.Foundations.Development001`. -/ -@[expose] public section +public section noncomputable section @@ -9346,7 +9391,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Area.Quadratic`. -/ -@[expose] public section +public section noncomputable section @@ -9362,7 +9407,7 @@ Authors: Dean Cureton # Area / Modulo Linear -/ -@[expose] public section +public section noncomputable section @@ -9373,6 +9418,7 @@ universe u namespace MovingSofa /-- The difference of two functionals preserves the specified convex combinations. -/ +@[expose] def EquivalentModuloConvexLinear {α : Type u} (c : I → α → α → α) (f g : α → ℝ) : Prop := IsConvexLinear c realCombination (fun x ↦ f x - g x) @@ -9396,7 +9442,7 @@ Authors: Dean Cureton # Area / Quadratic -/ -@[expose] public section +public section noncomputable section @@ -9669,7 +9715,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Geometry.Foundations.Development002`. -/ -@[expose] public section +public section noncomputable section @@ -9688,7 +9734,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Geometry.RadialBoundary`. -/ -@[expose] public section +public section noncomputable section @@ -9704,7 +9750,7 @@ Authors: Dean Cureton # Geometry / Convex / Frontier Interior -/ -@[expose] public section +public section open Set open scoped Topology @@ -9816,7 +9862,7 @@ Authors: Dean Cureton # Geometry / Radial Boundary -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/Development/Geometry/Foundations/Development003.lean b/LeanPool/MovingSofa/Development/Geometry/Foundations/Development003.lean index 088d3191f6..df5a3a5993 100644 --- a/LeanPool/MovingSofa/Development/Geometry/Foundations/Development003.lean +++ b/LeanPool/MovingSofa/Development/Geometry/Foundations/Development003.lean @@ -49,7 +49,7 @@ public import Mathlib.Topology.Separation.Hausdorff * `Infrastructure.Curves.Foundations.Development002`. -/ -@[expose] public section +public section noncomputable section @@ -81,7 +81,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `TauCeti.Topology.JordanCurve.Path`. -/ -@[expose] public section +public section noncomputable section @@ -117,7 +117,7 @@ Main deliverables: closed arc `≃ₜ unitInterval`. -/ -@[expose] public section +public section namespace JordanCurve.Arcs @@ -130,11 +130,13 @@ abbrev Plane := EuclideanSpace ℝ (Fin 2) /-- A linear isometry equivalence `ℂ ≃ₗᵢ[ℝ] Plane`, from the standard orthonormal basis of `EuclideanSpace ℝ (Fin 2)`. -/ +@[expose] noncomputable def complexLIE : ℂ ≃ₗᵢ[ℝ] Plane := Complex.isometryOfOrthonormal (EuclideanSpace.basisFun (Fin 2) ℝ) /-- The underlying `Equiv` between Mathlib's `Circle` and the unit sphere of the plane, induced by `complexLIE`. -/ +@[expose] noncomputable def circleEquivSphere : Circle ≃ sphere (0 : Plane) 1 where toFun z := ⟨complexLIE z, by rw [mem_sphere_zero_iff_norm, complexLIE.norm_map]; exact z.norm_coe⟩ @@ -146,6 +148,7 @@ noncomputable def circleEquivSphere : Circle ≃ sphere (0 : Plane) 1 where right_inv w := by ext; simp [complexLIE.apply_symm_apply] /-- **Circle model bridge.** `Circle ≃ₜ sphere (0:Plane) 1`. -/ +@[expose] noncomputable def circleHomeoSphere : Circle ≃ₜ sphere (0 : Plane) 1 := Continuous.homeoOfEquivCompactToT2 (f := circleEquivSphere) <| by apply Continuous.subtype_mk @@ -582,7 +585,7 @@ point theorem, in four phases: * **Phase 4** — the general convex/compact/nonempty statement `brouwerFPT`. -/ -@[expose] public section +public section namespace JordanCurve.Brouwer @@ -599,10 +602,12 @@ theorem cover : IsCoveringMap ((↑) : ℝ → AddCircle (1 : ℝ)) := AddCircle.isCoveringMap_coe 1 /-- The once-around loop `t ↦ ↑t` in `AddCircle 1`. -/ +@[expose] noncomputable def acLoop : C(I, AddCircle (1 : ℝ)) := ⟨fun t => ((t : ℝ) : AddCircle (1 : ℝ)), cover.continuous.comp continuous_subtype_val⟩ /-- The lift of `acLoop` to `ℝ` starting at `0`: the identity `t ↦ ↑t`. -/ +@[expose] noncomputable def idLift : C(I, ℝ) := ⟨fun t => (t : ℝ), continuous_subtype_val⟩ @[simp] lemma acLoop_apply (t : I) : acLoop t = ((t : ℝ) : AddCircle (1 : ℝ)) := rfl @@ -630,6 +635,7 @@ theorem acLoop_not_homotopic : /-! ## Phase 1.5 — transport to the geometric circle `sphere (0 : ℝ²) 1` -/ /-- The homeomorphism `AddCircle 1 ≃ₜ sphere (0 : ℝ²) 1`, via `Circle`. -/ +@[expose] noncomputable def acToSphere : AddCircle (1 : ℝ) ≃ₜ sphere (0 : Plane) 1 := (AddCircle.homeomorphCircle (one_ne_zero)).trans Arcs.circleHomeoSphere @@ -637,6 +643,7 @@ noncomputable def acToSphere : AddCircle (1 : ℝ) ≃ₜ sphere (0 : Plane) 1 : noncomputable def sBase : sphere (0 : Plane) 1 := acToSphere 0 /-- The once-around loop on the geometric circle `sphere (0 : ℝ²) 1`. -/ +@[expose] noncomputable def sLoop : C(I, sphere (0 : Plane) 1) := (⟨acToSphere, acToSphere.continuous⟩ : C(AddCircle (1 : ℝ), sphere (0 : Plane) 1)).comp acLoop @@ -1071,7 +1078,7 @@ the two components. This file provides: classes of subtype points with equality of `connectedComponentIn`. -/ -@[expose] public section +public section namespace JordanCurve.Counting @@ -1146,7 +1153,7 @@ sorry-free, with `#print axioms JordanCurve.jordan_curve` reporting only `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section namespace JordanCurve @@ -3912,7 +3919,7 @@ Original authors: The Tau Ceti contributors, Archon Horizon (claude+codex), Axel Chunlei Liu, Jinxuan Chen, Wanxu Yang, Zekun Sheng, Yuxuan Liao, Jie Xu. -/ -@[expose] public section +public section open Filter Set MeasureTheory open scoped ENNReal NNReal Topology @@ -4169,7 +4176,7 @@ This is a prerequisite of the planar-separation step of the `ConformalMapping` r * Ch. Pommerenke, *Boundary Behaviour of Conformal Maps*, Ch. 2. -/ -@[expose] public section +public section namespace TauCeti @@ -4246,7 +4253,7 @@ than open here. half-space is unbounded. -/ -@[expose] public section +public section namespace TauCeti @@ -4321,7 +4328,7 @@ This file transfers eventual upper bounds on the total variations of a family of a family of maps bounds the total variation of a pointwise limit by the `liminf` of the bounds. -/ -@[expose] public section +public section open Filter open scoped ENNReal @@ -4367,7 +4374,7 @@ The modules from Mathlib, lean-pool, TauCeti and jordan_pick that the developmen own files, collected in one place. -/ -@[expose] public section +public section end @@ -4462,7 +4469,7 @@ alone a holomorphic map. closure of a subset exactly where it meets that subset's frontier. -/ -@[expose] public section +public section namespace TauCeti @@ -4633,7 +4640,7 @@ separation, or any other regularity of `K`. lies in the filled hull, with no connectivity asked of it. -/ -@[expose] public section +public section namespace TauCeti @@ -4792,7 +4799,7 @@ used, and the separation argument is the general Hahn–Banach one. different components, at least one lies in the filled hull (dimension at least two). -/ -@[expose] public section +public section namespace TauCeti @@ -4984,7 +4991,7 @@ Carathéodory's continuity theorem. That application is in topology is locally connected. This is the quotient-map result applied below. -/ -@[expose] public section +public section namespace TauCeti @@ -5102,7 +5109,7 @@ preserved by continuous images, so it is proved here from * Ch. Pommerenke, *Boundary Behaviour of Conformal Maps*, Ch. 2. -/ -@[expose] public section +public section namespace TauCeti @@ -5424,7 +5431,7 @@ coincident-end specialization is in `TauCeti/Analysis/Complex/Conformal/Crosscut the distinct-end one in `TauCeti/Analysis/Complex/Conformal/Crosscut/Arc.lean`. -/ -@[expose] public section +public section namespace TauCeti @@ -5572,7 +5579,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Curve.Foundations.Development003`. -/ -@[expose] public section +public section noncomputable section @@ -5600,7 +5607,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Curve.Jordan.SubarcArea`. -/ -@[expose] public section +public section noncomputable section @@ -5616,7 +5623,7 @@ Authors: Dean Cureton # Curve / Jordan / Separation -/ -@[expose] public section +public section namespace MovingSofa @@ -5706,7 +5713,7 @@ Authors: Dean Cureton # Curve / Jordan / Interior -/ -@[expose] public section +public section namespace MovingSofa @@ -5763,7 +5770,7 @@ Authors: Dean Cureton # Curve / Jordan / Orientation Transport -/ -@[expose] public section +public section noncomputable section namespace MovingSofa @@ -5829,7 +5836,7 @@ Authors: Dean Cureton # Curve / Jordan / Area Transport -/ -@[expose] public section +public section namespace MovingSofa @@ -5901,7 +5908,7 @@ Authors: Dean Cureton # Curve / Jordan / Closed Area -/ -@[expose] public section +public section noncomputable section @@ -5970,7 +5977,7 @@ Authors: Dean Cureton # Curve / Jordan / Signed Area -/ -@[expose] public section +public section noncomputable section @@ -6333,7 +6340,7 @@ Authors: Dean Cureton # Curve / Jordan / Supporting Orientation -/ -@[expose] public section +public section noncomputable section @@ -7121,7 +7128,7 @@ Authors: Dean Cureton # Curve / Jordan / Subarc -/ -@[expose] public section +public section noncomputable section @@ -7943,7 +7950,7 @@ Authors: Dean Cureton # Curve / Reparametrization -/ -@[expose] public section +public section namespace MovingSofa @@ -7992,7 +7999,7 @@ Authors: Dean Cureton # Curve / Segment Area Properties -/ -@[expose] public section +public section noncomputable section @@ -8118,7 +8125,7 @@ Authors: Dean Cureton # Curve / Jordan / Subarc Area -/ -@[expose] public section +public section noncomputable section @@ -8527,7 +8534,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Curve.PositiveGraphRegion`. -/ -@[expose] public section +public section noncomputable section @@ -8550,7 +8557,7 @@ Jordan parametrization whose bounded complementary component is the open subgrap `{p | a < p 0 ∧ p 0 < b ∧ 0 < p 1 ∧ p 1 < f (p 0)}`. -/ -@[expose] public section +public section noncomputable section @@ -9015,7 +9022,7 @@ the resulting description of the closed subgraph: the loop traces exactly the fr region, and the closed subgraph is the open one together with that frontier. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/Development/Geometry/Foundations/Development004.lean b/LeanPool/MovingSofa/Development/Geometry/Foundations/Development004.lean index a88cdcdf21..ecfce9ff9b 100644 --- a/LeanPool/MovingSofa/Development/Geometry/Foundations/Development004.lean +++ b/LeanPool/MovingSofa/Development/Geometry/Foundations/Development004.lean @@ -13,7 +13,7 @@ public import LeanPool.MovingSofa.Development.Geometry.Foundations.Development00 * `Gerver.Foundations.Development001`. -/ -@[expose] public section +public section noncomputable section @@ -32,7 +32,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Gerver.Area.TrigEnclosure`. -/ -@[expose] public section +public section noncomputable section @@ -64,7 +64,7 @@ The kernel accelerates `Int` arithmetic but not `Rat` arithmetic, so the whole f calculation is carried out on pairs of integers denoting the interval `[lo / M, hi / M]`. -/ -@[expose] public section +public section namespace MovingSofa.GerverAreaCert @@ -90,15 +90,18 @@ def imax (a b : ℤ) : ℤ := if a ≤ b then b else a def ratI (a b : ℤ) : SI := ⟨(a * M) / b, -((-(a * M)) / b)⟩ /-- The exact interval `[0, 0]`. -/ +@[expose] def zero : SI := ⟨0, 0⟩ /-- The exact interval `[1, 1]`. -/ def one : SI := ⟨M, M⟩ /-- Interval addition. -/ +@[expose] def add (x y : SI) : SI := ⟨x.lo + y.lo, x.hi + y.hi⟩ /-- Interval negation. -/ def neg (x : SI) : SI := ⟨-x.hi, -x.lo⟩ /-- Interval subtraction. -/ +@[expose] def sub (x y : SI) : SI := ⟨x.lo - y.hi, x.hi - y.lo⟩ /-- Interval multiplication: the extreme endpoint products, rounded outward. -/ @@ -111,6 +114,7 @@ def mul (x y : SI) : SI := -((-(imax (imax p₁ p₂) (imax p₃ p₄))) / M)⟩ /-- Division by a positive integer. -/ +@[expose] def divn (x : SI) (b : ℤ) : SI := ⟨x.lo / b, -((-x.hi) / b)⟩ /-- Multiplication by an integer. -/ @@ -120,6 +124,7 @@ def imul (k : ℤ) (x : SI) : SI := /-! #### Real semantics and soundness -/ /-- `z` denotes the real interval `[z.lo / M, z.hi / M]`. -/ +@[expose] def Contains (z : SI) (x : ℝ) : Prop := (z.lo : ℝ) ≤ (M : ℝ) * x ∧ (M : ℝ) * x ≤ (z.hi : ℝ) @@ -354,14 +359,17 @@ def e1Z : SI := ⟨1210322422072688751416085718500, 1210322422072688751416285718 /-- Enclosure of the direct parameter `e₂`. -/ def e2Z : SI := ⟨249999999999999999999900000000, 250000000000000000000100000000⟩ /-- Enclosure of the first stage angle `φ`. -/ +@[expose] def phiZ : SI := ⟨39177364790083641863217874980, 39177364790083641863217875500⟩ /-- Enclosure of the second stage angle `θ`. -/ +@[expose] def thetaZ : SI := ⟨681301509382724894473855754540, 681301509382724894473855759660⟩ /-- The integer enclosure of `π`, from the certified Machin arctangent sums. -/ def piZ : SI := ⟨3141592653589793238462643383279, 3141592653589793238462643383280⟩ /-- The integer enclosure of `π / 2`. -/ +@[expose] def piHalfZ : SI := divn piZ 2 /-! #### The parameter enclosures are the certified box rows -/ @@ -495,9 +503,11 @@ def trigZ (t : SI) : SI × SI := /-! ### Stage endpoints and the uniform grid -/ /-- Number of subintervals per analytic stage. -/ +@[expose] def NN : ℕ := 64 /-- Integer enclosures of the six stage endpoints `0, φ, θ, η, τ, π / 2`, constant past `5`. -/ +@[expose] def endZ : ℕ → SI | 0 => zero | 1 => phiZ @@ -507,16 +517,19 @@ def endZ : ℕ → SI | _ => piHalfZ /-- The `m`-th grid angle, `0 ≤ m ≤ 5 * NN`. -/ +@[expose] def ttZ (m : ℕ) : SI := divn (add (imul ((NN - m % NN : ℕ) : ℤ) (endZ (m / NN))) (imul ((m % NN : ℕ) : ℤ) (endZ (m / NN + 1)))) (NN : ℤ) /-- The analytic branch that the piecewise definitions select at the `m`-th grid angle. -/ +@[expose] def stageOf (m : ℕ) : ℕ := if m % NN = 0 then max 1 (m / NN) else m / NN + 1 /-! ### The five phase formulas and the four contact curves -/ /-- `kind`: `0` the path, `1` `A`, `2` `B`, `3` `C`, `4` `D`. -/ +@[expose] def evalZ (stage : ℕ) (t : SI) (kind : ℕ) : SI × SI := let sc := trigZ t let s := sc.1 @@ -565,38 +578,47 @@ def evalZ (stage : ℕ) (t : SI) (kind : ℕ) : SI × SI := (if kind = 3 then sub x3 s else x3, if kind = 3 then add y3 c else y3) /-- The contact point at grid index `m`, evaluated on the branch the definitions select. -/ +@[expose] def contactZ (m kind : ℕ) : SI × SI := evalZ (stageOf m) (ttZ m) kind /-! ### Cap: the ordered support contacts and their fan shoelace sum -/ /-- Number of listed support contacts feeding the fan, excluding the anchor. -/ +@[expose] def fanCount : ℕ := 10 * NN /-- Contact kind at fan position `i`: `A` for `i ≤ 5 * NN`, otherwise `C`. -/ +@[expose] def fanKind (i : ℕ) : ℕ := if i ≤ 5 * NN then 1 else 3 /-- Grid index at fan position `i`. -/ +@[expose] def fanIdx (i : ℕ) : ℕ := if i ≤ 5 * NN then i else i - 5 * NN /-- Both coordinates of the contact listed at fan position `i`. -/ +@[expose] def fanZ (i : ℕ) : SI × SI := contactZ (fanIdx i) (fanKind i) /-- The fan anchor `L = C (π / 2)`. -/ +@[expose] def anchorZ : SI × SI := contactZ (5 * NN) 3 /-- The `i`-th fan determinant over the anchor. -/ +@[expose] def crossZ (i : ℕ) : SI := sub (mul (sub (fanZ i).1 anchorZ.1) (sub (fanZ (i + 1)).2 anchorZ.2)) (mul (sub (fanZ i).2 anchorZ.2) (sub (fanZ (i + 1)).1 anchorZ.1)) /-- Twice the signed area of the fan polygon: the shoelace sum of the listed contacts over the anchor. -/ +@[expose] def capDoubledZ : SI := (List.range (fanCount - 1)).foldl (fun acc i => add acc (crossZ i)) zero /-! ### Niche: the seven roof pieces and their covering rectangles -/ /-- The seven roof pieces as `(kind, stage, traversed forwards?)`. -/ +@[expose] def rowData : ℕ → ℕ × ℕ × Bool | 0 => (4, 1, true) | 1 => (4, 2, true) @@ -607,47 +629,59 @@ def rowData : ℕ → ℕ × ℕ × Bool | _ => (2, 5, true) /-- Contact kind traced by roof piece `r`. -/ +@[expose] def rowKind (r : ℕ) : ℕ := (rowData r).1 /-- Analytic stage traced by roof piece `r`. -/ +@[expose] def rowStage (r : ℕ) : ℕ := (rowData r).2.1 /-- Whether roof piece `r` is traversed in increasing time. -/ +@[expose] def rowFwd (r : ℕ) : Bool := (rowData r).2.2 /-- Grid index of the left end of the `j`-th subinterval of row `r`. -/ +@[expose] def rowBase (r j : ℕ) : ℕ := (rowStage r - 1) * NN + j /-- Left horizontal bound of the covering rectangle of `(r, j)`. -/ +@[expose] def rectLoZ (r j : ℕ) : ℤ := if rowFwd r then (contactZ (rowBase r j) (rowKind r)).1.lo else (contactZ (rowBase r j + 1) (rowKind r)).1.lo /-- Right horizontal bound of the covering rectangle of `(r, j)`. -/ +@[expose] def rectHiZ (r j : ℕ) : ℤ := if rowFwd r then (contactZ (rowBase r j + 1) (rowKind r)).1.hi else (contactZ (rowBase r j) (rowKind r)).1.hi /-- Height bound of the covering rectangle of `(r, j)`: the branch evaluation over the whole subinterval, widened to cover the left endpoint, which sits on the previous branch. -/ +@[expose] def rectHZ (r j : ℕ) : ℤ := imax (evalZ (stageOf (rowBase r j + 1)) ⟨(ttZ (rowBase r j)).lo, (ttZ (rowBase r j + 1)).hi⟩ (rowKind r)).2.hi (contactZ (rowBase r j) (rowKind r)).2.hi /-- Area of the covering rectangle of `(r, j)`, in units of `1 / M ^ 2`. -/ +@[expose] def rectAreaZ (r j : ℕ) : ℤ := imax 0 (rectHiZ r j - rectLoZ r j) * imax 0 (rectHZ r j) /-- Total covering area of row `r`, in units of `1 / M ^ 2`. -/ +@[expose] def rowSumZ (r : ℕ) : ℤ := (List.range NN).foldl (fun acc j => acc + rectAreaZ r j) 0 /-- Total covering area of the `7 * NN` rectangles, in units of `1 / M ^ 2`. -/ +@[expose] def nicheSumZ : ℤ := (List.range 7).foldl (fun acc r => acc + rowSumZ r) 0 /-! ### The two decidable numeric conclusions -/ /-- The closed numeric cap check: `2 * 28609 / 10000 ≤ capDoubledZ.lo / M`. -/ +@[expose] def capOK : Bool := 2 * 28609 * M ≤ 10000 * capDoubledZ.lo /-- The closed numeric niche check: `nicheSumZ / M ^ 2 ≤ 3301 / 5000`. -/ +@[expose] def nicheOK : Bool := 5000 * nicheSumZ ≤ 3301 * M * M /-- The niche check passes, by kernel reduction. -/ @@ -683,7 +717,7 @@ one-unit widening. /-! ### Sine and cosine enclosures -/ -@[expose] public section +public section namespace MovingSofa diff --git a/LeanPool/MovingSofa/Development/Geometry/Foundations/Development005.lean b/LeanPool/MovingSofa/Development/Geometry/Foundations/Development005.lean index af9f766413..90bb58a519 100644 --- a/LeanPool/MovingSofa/Development/Geometry/Foundations/Development005.lean +++ b/LeanPool/MovingSofa/Development/Geometry/Foundations/Development005.lean @@ -34,7 +34,7 @@ public import Mathlib.Tactic.Positivity * `Cap.Foundations.Development003`. -/ -@[expose] public section +public section noncomputable section @@ -53,7 +53,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Canonical.GerverDefinitions`. -/ -@[expose] public section +public section noncomputable section @@ -91,7 +91,7 @@ The definitions of `MovingSofaSubmission/Challenge.lean`, copied from certificate in GerverSofaLean, so that Gerver's constants are defined from a proved statement. -/ -@[expose] public section +public section noncomputable section @@ -115,12 +115,15 @@ open Topology open scoped Real unitInterval EuclideanGeometry /-- The **horizontal side** of the hallway is $(-\infty, 1] \times [0, 1]$. -/ +@[expose] def horizontalHallway : Set ℝ² := {!₂[x, y] | (x) (y) (_ : x ≤ 1 ∧ 0 ≤ y ∧ y ≤ 1)} /-- The **vertical side** of the hallway is $[0, 1] \times (-\infty, 1]$. -/ +@[expose] def verticalHallway : Set ℝ² := {!₂[x, y] | (x) (y) (_ : 0 ≤ x ∧ x ≤ 1 ∧ y ≤ 1)} /-- The **hallway** is the union of its horizontal and vertical sides. -/ +@[expose] def hallway : Set ℝ² := horizontalHallway ∪ verticalHallway /-- The affine isometry group of the Euclidean plane. -/ @@ -150,6 +153,7 @@ structure IsMovingSofa (s : Set ℝ²) (m : I → E(2)) : Prop where The rigid motion that translates by $p$ and then rotates counterclockwise by $\alpha$. Note that [Ge92] used this definition while [Ro18] used rotation first and then translation. -/ +@[expose] def rotateTranslate (α : Real.Angle) (p : ℝ²) : E(2) := (AffineIsometryEquiv.vaddConst ℝ p).trans (EuclideanGeometry.o.rotation α).toAffineIsometryEquiv @@ -160,6 +164,7 @@ intersection over $\alpha \in [0, \pi/2]$ of hallways each translated by $p(\alp rotated by $\alpha$, with the special cases that the hallway at $0$ is the horizontal side and the hallway at $\pi/2$ is the vertical side. -/ +@[expose] def sofaOfRotateTranslatePath (p : ℝ → ℝ²) : Set ℝ² := rotateTranslate 0 (p 0) '' horizontalHallway ∩ rotateTranslate ↑(π / 2) (p (π / 2)) '' verticalHallway ∩ @@ -176,6 +181,7 @@ This section follows Theorem 2 of Gerver's paper [Ge92]. /-- Eq. 1-4 of [Ro18], which specifies the constants $A$, $B$, $\varphi$, and $\theta$ of [Ge92]. -/ +@[expose] def ABφθSpec (A B φ θ : ℝ) : Prop := 0 ≤ φ ∧ φ ≤ θ ∧ θ ≤ π / 4 ∧ 0 ≤ A ∧ 0 ≤ B ∧ A * (θ.cos - φ.cos) - 2 * B * φ.sin @@ -191,16 +197,21 @@ theorem ABφθSpec.existsUnique : ∃! ABφθ : ℝ × ℝ × ℝ × ℝ, GerverSofa.PartF.Parameters.existsUnique /-- Gerver's constant $A$: the first component of the unique solution of `ABφθSpec`. -/ +@[expose] def A : ℝ := ABφθSpec.existsUnique.choose.1 /-- Gerver's constant $B$: the second component of the unique solution of `ABφθSpec`. -/ +@[expose] def B : ℝ := ABφθSpec.existsUnique.choose.2.1 /-- Gerver's angle $\varphi$: the third component of the unique solution of `ABφθSpec`. -/ +@[expose] def φ : ℝ := ABφθSpec.existsUnique.choose.2.2.1 /-- Gerver's angle $\theta$: the fourth component of the unique solution of `ABφθSpec`. -/ +@[expose] def θ : ℝ := ABφθSpec.existsUnique.choose.2.2.2 /-- The integral-path auxiliary function $r$, with break points $\varphi$, $\theta$, $\pi/2 - \theta$ and $\pi/2 - \varphi$. The functions `x` and `y` are integrals of it. -/ +@[expose] def r (α : ℝ) : ℝ := if α ≤ φ then 1 / 2 @@ -215,16 +226,19 @@ def r (α : ℝ) : ℝ := /-- $y(\alpha) = \int_\alpha^{\pi/2 - \varphi} r(t) \sin t \, dt$, used in the canonical integral-path definition. -/ +@[expose] def y (α : ℝ) : ℝ := ∫ t in α..π / 2 - φ, r t * t.sin /-- $x(\alpha) = 1 - \int_\alpha^{\pi/2 - \varphi} r(t) \cos t \, dt$, used in the canonical integral-path definition. -/ +@[expose] def x (α : ℝ) : ℝ := 1 - ∫ t in α..π / 2 - φ, r t * t.cos /-- The rotation path of Gerver's sofa: `p α` is the translation applied to the hallway before it is rotated by the angle $\alpha \in [0, \pi/2]$, in the convention of `rotateTranslate`. -/ +@[expose] def p (α : ℝ) : ℝ² := !₂[if α ≤ φ then α.cos - 1 @@ -236,6 +250,7 @@ def p (α : ℝ) : ℝ² := end GerversSofa /-- Gerver's sofa is the sofa according to the rotation path `GerversSofa.p`. -/ +@[expose] def gerversSofa : Set ℝ² := sofaOfRotateTranslatePath GerversSofa.p @@ -243,6 +258,7 @@ open MeasureTheory open scoped ENNReal /-- The **sofa constant** is the maximal area of a moving sofa. -/ +@[expose] def sofaConstant : ℝ≥0∞ := ⨆ (s : Set ℝ²) (_ : ∃ m, IsMovingSofa s m), volume s end MovingSofa @@ -294,7 +310,7 @@ for its own copy of the moving sofa definitions. This file identifies that copy definitions of `MovingSofa.Canonical.Definitions`. -/ -@[expose] public section +public section noncomputable section open scoped unitInterval @@ -350,6 +366,7 @@ theorem sofaOfRotateTranslatePath_eq_bodySofa (p : ℝ → Plane) : /-- The reduced parameter tuple corresponding to the canonical choice of the unique angle solution. -/ +@[expose] def selected : Reduced.Params := PartE.tupleEquiv MovingSofa.GerversSofa.ABφθSpec.existsUnique.choose @@ -412,7 +429,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Geometry.SupportingHallway`. -/ -@[expose] public section +public section noncomputable section @@ -428,23 +445,26 @@ Authors: Dean Cureton # Geometry / Hallway -/ -@[expose] public section +public section noncomputable section namespace MovingSofa /-- Counterclockwise rotation about the origin. -/ +@[expose] def rotationMap (t : Real.Angle) (p : Point) : Point := (EuclideanGeometry.o.rotation t) p /-- The horizontal, vertical and rotated vertical strips. -/ +@[expose] def strips (ω : ℝ) : Set Point × Set Point × Set Point := let H : Set Point := {p | 0 ≤ p 1 ∧ p 1 ≤ 1} let V : Set Point := {p | 0 ≤ p 0 ∧ p 0 ≤ 1} (H, V, rotationMap (ω : Real.Angle) '' V) /-- The intersection of strips and its two distinguished points. -/ +@[expose] def stripParallelogram (ω : ℝ) : Set Point × Point × Point := ((strips ω).1 ∩ (strips ω).2.2, 0, !₂[Real.tan (Real.pi / 4 - ω / 2), 1]) @@ -472,6 +492,7 @@ structure HallwayParts where innerQuadrant : Set Point /-- The named parts of the fixed hallway. -/ +@[expose] def hallwayParts : HallwayParts where innerCorner := 0 outerCorner := !₂[1, 1] @@ -485,15 +506,18 @@ def hallwayParts : HallwayParts where innerQuadrant := {p | p 0 < 0 ∧ p 1 < 0} /-- Rotation followed by the support-determined translation. -/ +@[expose] def supportingPlacement (s : Set Point) (t : Real.Angle) (p : Point) : Point := rotationMap t p + (supportValue s t - 1) • normalVector t + (supportValue s (t + ((Real.pi / 2 : ℝ) : Real.Angle)) - 1) • tangentVector t /-- The supporting hallway of a nonempty compact set. -/ +@[expose] def supportingHallway (s : Set Point) (t : Real.Angle) : Set Point := supportingPlacement s t '' hallway /-- The images of all named hallway parts under its supporting placement. -/ +@[expose] def rotatingHallwayParts (s : Set Point) (t : Real.Angle) : HallwayParts where innerCorner := supportingPlacement s t hallwayParts.innerCorner outerCorner := supportingPlacement s t hallwayParts.outerCorner @@ -525,7 +549,7 @@ Authors: Dean Cureton # Geometry / Hallway Parts -/ -@[expose] public section +public section noncomputable section @@ -677,7 +701,7 @@ Authors: Dean Cureton # Geometry / Hallway Parts Properties -/ -@[expose] public section +public section noncomputable section @@ -804,7 +828,7 @@ Authors: Dean Cureton # Geometry / Hallway Ray -/ -@[expose] public section +public section noncomputable section @@ -1075,7 +1099,7 @@ Authors: Dean Cureton # Geometry / Hallway Support -/ -@[expose] public section +public section noncomputable section @@ -1145,7 +1169,7 @@ Authors: Dean Cureton # Geometry / Parallelogram -/ -@[expose] public section +public section noncomputable section @@ -1245,7 +1269,7 @@ Authors: Dean Cureton # Geometry / Parallelogram Gap -/ -@[expose] public section +public section noncomputable section @@ -1360,13 +1384,14 @@ Authors: Dean Cureton # Geometry / Path Half Plane Cap -/ -@[expose] public section +public section noncomputable section namespace MovingSofa /-- The set satisfying the horizontal base and all upper support constraints of a path. -/ +@[expose] def outerPathConstraintSet (x : Set.Icc (0 : ℝ) (Real.pi / 2) → Point) : Set Point := {q | 0 ≤ q 1 ∧ ∀ t, inner ℝ q (normalVector (t.val : Real.Angle)) ≤ @@ -1501,13 +1526,14 @@ Authors: Dean Cureton # Geometry / Reflection -/ -@[expose] public section +public section noncomputable section namespace MovingSofa /-- Exchange the two coordinates of the Euclidean plane. -/ +@[expose] def coordinateSwap : Point ≃ₗᵢ[ℝ] Point := LinearIsometryEquiv.piLpCongrLeft 2 ℝ ℝ (Equiv.swap 0 1) @@ -1531,6 +1557,7 @@ theorem capReflection_apply_one (ω : ℝ) (p : Point) : simp [coordinateSwap] /-- Reflection across the line through the upper vertex of the cap strip. -/ +@[expose] def stripTopReflection (ω : ℝ) (p : Point) : Point := (2 * inner ℝ p (stripParallelogram ω).2.2 / inner ℝ (stripParallelogram ω).2.2 (stripParallelogram ω).2.2) • @@ -1640,6 +1667,7 @@ theorem capReflection_involutive (ω : ℝ) (p : Point) : linear_combination (p 1) * (Real.sin_sq_add_cos_sq ω) /-- Reflection of a normal angle across the cap-reflection axis. -/ +@[expose] def reflectedAngle (ω : ℝ) (a : Real.Angle) : Real.Angle := ((ω + Real.pi / 2 : ℝ) : Real.Angle) - a @@ -1790,7 +1818,7 @@ Authors: Dean Cureton # Geometry / Supporting Hallway -/ -@[expose] public section +public section noncomputable section @@ -1889,7 +1917,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Analysis.SurfaceMeasure.WeightedBoundary`. -/ -@[expose] public section +public section noncomputable section @@ -1905,7 +1933,7 @@ Authors: Dean Cureton # Analysis / Surface Measure / Upper Graph -/ -@[expose] public section +public section noncomputable section @@ -2574,7 +2602,7 @@ value: each exposed face lies on the boundary, and, when the body has interior, point lies on some exposed face. -/ -@[expose] public section +public section noncomputable section @@ -2644,7 +2672,7 @@ Authors: Dean Cureton # Analysis / Surface Measure / Regular Boundary Helpers -/ -@[expose] public section +public section noncomputable section @@ -2740,7 +2768,7 @@ Authors: Dean Cureton # Analysis / Surface Measure / Graph Integral -/ -@[expose] public section +public section noncomputable section @@ -3223,7 +3251,7 @@ Authors: Dean Cureton # Analysis / Surface Measure / Construction -/ -@[expose] public section +public section noncomputable section @@ -3345,7 +3373,7 @@ Authors: Dean Cureton # Analysis / Surface Measure / Graph Convergence -/ -@[expose] public section +public section noncomputable section @@ -3975,7 +4003,7 @@ Authors: Dean Cureton # Analysis / Surface Measure / Properties -/ -@[expose] public section +public section noncomputable section @@ -4141,7 +4169,7 @@ Authors: Dean Cureton # Analysis / Surface Measure / Boundary Extension -/ -@[expose] public section +public section noncomputable section @@ -4279,7 +4307,7 @@ Authors: Dean Cureton # Analysis / Surface Measure / Opposite -/ -@[expose] public section +public section noncomputable section @@ -4288,6 +4316,7 @@ open MeasureTheory namespace MovingSofa /-- The opposite-angle surface measure and support function. -/ +@[expose] def oppositeSurfaceData (K : ConvexBody Point) : Measure Real.Angle × (Real.Angle → ℝ) := (Measure.map (fun t ↦ t - ((Real.pi : ℝ) : Real.Angle)) (surfaceAreaMeasure K), @@ -4364,7 +4393,7 @@ Authors: Dean Cureton # Analysis / Surface Measure / Weak Convergence -/ -@[expose] public section +public section noncomputable section @@ -4482,7 +4511,7 @@ Authors: Dean Cureton # Analysis / Surface Measure / Atom Limits -/ -@[expose] public section +public section noncomputable section @@ -4550,7 +4579,7 @@ Authors: Dean Cureton # Analysis / Surface Measure / Weighted Boundary -/ -@[expose] public section +public section noncomputable section @@ -4979,7 +5008,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Cap.Vertical`. -/ -@[expose] public section +public section noncomputable section @@ -4995,22 +5024,25 @@ Authors: Dean Cureton # Cap / Contacts -/ -@[expose] public section +public section noncomputable section namespace MovingSofa /-- Width in a normal direction, for geometric use on nonempty compact sets. -/ +@[expose] def directionalWidth (s : Set Point) (t : Real.Angle) : ℝ := supportValue s t + supportValue s (t + ((Real.pi : ℝ) : Real.Angle)) /-- The positive/negative contacts at the two outer supporting walls. -/ +@[expose] def capVertices {ω : ℝ} (K : CapSpace ω) (t : ℝ) : (Point × Point) × (Point × Point) := (edgeVertices K.1 (t : Real.Angle), edgeVertices K.1 ((t + Real.pi / 2 : ℝ) : Real.Angle)) /-- The positive/negative right and left tangent arm lengths of a right-angle cap. -/ +@[expose] def tangentArmLengths (K : RightAngleCapSpace) (t : ℝ) : (ℝ × ℝ) × (ℝ × ℝ) := let y := (rotatingHallwayParts (K.1 : Set Point) (t : Real.Angle)).outerCorner let v := capVertices K t @@ -5020,22 +5052,26 @@ def tangentArmLengths (K : RightAngleCapSpace) (t : ℝ) : (ℝ × ℝ) × (ℝ inner ℝ (y - v.2.2) (normalVector (t : Real.Angle)))) /-- The open inner quadrant clipped by the fan. -/ +@[expose] def capWedge {ω : ℝ} (K : CapSpace ω) (t : ℝ) : Set Point := capFan ω ∩ (rotatingHallwayParts (K.1 : Set Point) (t : Real.Angle)).innerQuadrant /-- The two inner-wall intersections with the lower fan boundary lines. -/ +@[expose] def wedgeEndpoints {ω : ℝ} (K : CapSpace ω) (t : ℝ) : Point × Point := (((supportValue K.1 (t : Real.Angle) - 1) / Real.cos t) • normalVector 0, ((supportValue K.1 ((t + Real.pi / 2 : ℝ) : Real.Angle) - 1) / Real.cos (ω - t)) • tangentVector (ω : Real.Angle)) /-- Signed right and left gaps between the wedge endpoints and bottom cap contacts. -/ +@[expose] def wedgeGaps {ω : ℝ} (K : CapSpace ω) (t : ℝ) : ℝ × ℝ := (inner ℝ ((capVertices K 0).1.2 - (wedgeEndpoints K t).1) (normalVector 0), inner ℝ ((capVertices K ω).2.1 - (wedgeEndpoints K t).2) (tangentVector (ω : Real.Angle))) /-- The selected short boundary arc, including only the specified endpoints. -/ +@[expose] def convexBoundaryArc (K : ConvexBody Point) (a b : ℝ) : Set Point := {(edgeVertices K (a : Real.Angle)).1} ∪ (⋃ t ∈ Set.Ioo a b, exposedEdge K (t : Real.Angle)) ∪ @@ -5111,7 +5147,7 @@ Authors: Dean Cureton # Cap / Arm Coordinates -/ -@[expose] public section +public section noncomputable section @@ -5163,7 +5199,7 @@ Authors: Dean Cureton # Cap / Contact Identities -/ -@[expose] public section +public section noncomputable section @@ -5289,7 +5325,7 @@ Authors: Dean Cureton # Cap / Half Planes -/ -@[expose] public section +public section noncomputable section @@ -5700,7 +5736,7 @@ Authors: Dean Cureton # Cap / Fan Projection -/ -@[expose] public section +public section noncomputable section @@ -5959,7 +5995,7 @@ Authors: Dean Cureton # Cap / Hallway Quadrant -/ -@[expose] public section +public section noncomputable section @@ -6000,7 +6036,7 @@ semicircle only the bottom normal `3π / 2` is left, so an integrand vanishing t to zero (`MovingSofa.CapSpace.setIntegral_compl_image_Icc_zero_pi_eq_zero`). -/ -@[expose] public section +public section noncomputable section @@ -6158,13 +6194,14 @@ Authors: Dean Cureton # Cap / Reflection Geometry -/ -@[expose] public section +public section noncomputable section namespace MovingSofa /-- Image of a convex body under the cap reflection. -/ +@[expose] def reflectedBody (ω : ℝ) (K : ConvexBody Point) : ConvexBody Point where carrier := capReflection ω '' (K : Set Point) convex' := K.convex.linear_image (capReflection ω).toLinearEquiv.toLinearMap @@ -6439,7 +6476,7 @@ Authors: Dean Cureton # Cap / Support Intersections -/ -@[expose] public section +public section noncomputable section @@ -6579,7 +6616,7 @@ Authors: Dean Cureton # Cap / Top Corner -/ -@[expose] public section +public section noncomputable section @@ -6708,7 +6745,7 @@ Authors: Dean Cureton # Cap / Vertical -/ -@[expose] public section +public section noncomputable section @@ -6756,7 +6793,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Analysis.SurfaceMeasure.ArcConvergence`. -/ -@[expose] public section +public section noncomputable section @@ -6772,7 +6809,7 @@ Authors: Dean Cureton # Analysis / Surface Measure / Arc Convergence -/ -@[expose] public section +public section noncomputable section @@ -6854,7 +6891,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Convex.OuterCornerPath`. -/ -@[expose] public section +public section noncomputable section @@ -6870,7 +6907,7 @@ Authors: Dean Cureton # Convex / Curve Cut -/ -@[expose] public section +public section noncomputable section @@ -7538,7 +7575,7 @@ Authors: Dean Cureton # Convex / Arc Cut Area -/ -@[expose] public section +public section noncomputable section @@ -7623,7 +7660,7 @@ every compact interval of angles; and it is convex-linear in `K` because support These are the two hypotheses of Mamikon convexity for the middle summand of the sofa area. -/ -@[expose] public section +public section noncomputable section @@ -7713,7 +7750,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Geometry.Convex.HorizontalExtrema`. -/ -@[expose] public section +public section noncomputable section @@ -7729,7 +7766,7 @@ Authors: Dean Cureton # Geometry / Convex / Horizontal Extrema -/ -@[expose] public section +public section noncomputable section @@ -7870,7 +7907,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Gerver.Niche.RoofProperties`. -/ -@[expose] public section +public section noncomputable section @@ -7909,7 +7946,7 @@ SOFTWARE. /-! Adapted from GerverSofaLean v1.1.0, F07UpstreamMotion (MIT). -/ -@[expose] public section +public section noncomputable section open MeasureTheory @@ -7963,7 +8000,7 @@ statements mention `toPlane`, which `Geometry/Basic.lean` does not import; this lowest module that sees both the vendor coordinates and `MovingSofa.frame`. -/ -@[expose] public section +public section noncomputable section @@ -7972,6 +8009,7 @@ open scoped ContDiff namespace MovingSofa /-- The certified direct five-phase Gerver path, taking the earlier branch at each switch. -/ +@[expose] def paperGerverPath (t : ℝ) : Point := GerverSofa.PartF.Coordinates.toPlane (GerverSofa.Romik.path GerverSofa.PartB.params t) @@ -8118,13 +8156,14 @@ Authors: Dean Cureton # Gerver / Paper Set -/ -@[expose] public section +public section noncomputable section namespace MovingSofa /-- Gerver's paper-frame set, cut out by the explicit path of rotated hallways. -/ +@[expose] def paperGerverSofa : Set Point := (strips (Real.pi / 2)).1 ∩ (strips (Real.pi / 2)).2.2 ∩ ⋂ t ∈ Set.Icc (0 : ℝ) (Real.pi / 2), @@ -8149,30 +8188,35 @@ Authors: Dean Cureton # Gerver / Parameters -/ -@[expose] public section +public section noncomputable section namespace MovingSofa /-- The two Gerver switching angles and the right/left distinguished angles. -/ +@[expose] def paperGerverConstants : (ℝ × ℝ) × (ℝ × ℝ) := ((GerversSofa.φ, GerversSofa.θ), (GerversSofa.φ, Real.pi / 2 - GerversSofa.φ)) /-- The six endpoints of the five Gerver stages. -/ +@[expose] def gerverStageTimes : Fin 6 → ℝ := ![0, GerversSofa.φ, GerversSofa.θ, Real.pi / 2 - GerversSofa.θ, Real.pi / 2 - GerversSofa.φ, Real.pi / 2] /-- The five closed stage intervals in their source order. -/ +@[expose] def gerverStageIntervals (i : Fin 5) : Set ℝ := Set.Icc (gerverStageTimes i.castSucc) (gerverStageTimes i.succ) /-- The exact direct 22-equation Gerver system, with the certified phase-map convention. -/ +@[expose] def gerverDirectEquations (p : GerverSofa.Romik.Params) : Prop := GerverSofa.Romik.Equations p /-- The exact closed rational box for the direct Gerver parameters. -/ +@[expose] def gerverDirectBox : Set GerverSofa.Romik.Params := GerverSofa.Romik.box /-- The exact box bounds the second-stage linear coefficient `b₁` from below by `-53/100`. -/ @@ -8210,7 +8254,7 @@ Authors: Dean Cureton # Gerver / Parameter Dictionary -/ -@[expose] public section +public section noncomputable section @@ -8241,7 +8285,7 @@ Authors: Dean Cureton # Gerver / Partition -/ -@[expose] public section +public section noncomputable section @@ -8289,7 +8333,7 @@ Authors: Dean Cureton # Gerver / Reverse Physical Domain -/ -@[expose] public section +public section noncomputable section @@ -8367,7 +8411,7 @@ there, endpoints included. /-! ### Differential interface for the five direct branches -/ -@[expose] public section +public section noncomputable section @@ -8883,13 +8927,14 @@ Authors: Dean Cureton # Gerver / Literal Sets -/ -@[expose] public section +public section noncomputable section namespace MovingSofa /-- The outer cap defined by all upper path support constraints and the horizontal base. -/ +@[expose] def gerverOuterCap : Set Point := {q | 0 ≤ q 1 ∧ ∀ t ∈ Set.Icc (0 : ℝ) (Real.pi / 2), inner ℝ q (normalVector (t : Real.Angle)) ≤ @@ -8899,12 +8944,14 @@ def gerverOuterCap : Set Point := /-- The union of strict forbidden inner corners above the horizontal base along the Gerver path. -/ +@[expose] def gerverLiteralNiche : Set Point := {q | 0 ≤ q 1 ∧ ∃ t ∈ Set.Ioo (0 : ℝ) (Real.pi / 2), inner ℝ (q - paperGerverPath t) (normalVector (t : Real.Angle)) < 0 ∧ inner ℝ (q - paperGerverPath t) (tangentVector (t : Real.Angle)) < 0} /-- The literal Gerver sofa obtained by removing its niche from its outer cap. -/ +@[expose] def gerverLiteralSofa : Set Point := gerverOuterCap \ gerverLiteralNiche /-- Bundle the literal niche and sofa sets for comparison with the canonical definitions. -/ @@ -9080,7 +9127,7 @@ Authors: Dean Cureton # Gerver / Literal Connected -/ -@[expose] public section +public section noncomputable section @@ -9168,7 +9215,7 @@ Authors: Dean Cureton # Gerver / Parameter Identification -/ -@[expose] public section +public section noncomputable section @@ -9310,7 +9357,7 @@ Authors: Dean Cureton # Gerver / Contacts -/ -@[expose] public section +public section noncomputable section @@ -9319,11 +9366,13 @@ open scoped ContDiff namespace MovingSofa /-- Resolve the Gerver path derivative into its normal and tangent frame components. -/ +@[expose] def paperGerverVelocityComponents (t : ℝ) : ℝ × ℝ := (inner ℝ (deriv paperGerverPath t) (normalVector (t : Real.Angle)), inner ℝ (deriv paperGerverPath t) (tangentVector (t : Real.Angle))) /-- The four standard support-contact points determined by the Gerver path and its derivative. -/ +@[expose] def paperGerverContacts (t : ℝ) : Fin 4 → Point := ![paperGerverPath t + (paperGerverVelocityComponents t).1 • tangentVector (t : Real.Angle) + normalVector (t : Real.Angle), @@ -9337,6 +9386,7 @@ def paperGerverContactData : (ℝ → ℝ × ℝ) × (ℝ → Fin 4 → Point) : (paperGerverVelocityComponents, paperGerverContacts) /-- The explicit body-frame velocity coefficients on a selected Romik branch. -/ +@[expose] def gerverBranchVelocityComponents (i : Fin 5) (t : ℝ) : ℝ × ℝ := ![GerverSofa.Romik.alphaBeta1 GerverSofa.PartB.params t, GerverSofa.Romik.alphaBeta2 GerverSofa.PartB.params t, @@ -9579,7 +9629,7 @@ function of an unrestricted real parameter and `gerverNicheRoof` its restriction rotation interval; `gerverRoofCurve_eq` relates the two. -/ -@[expose] public section +public section noncomputable section @@ -9588,6 +9638,7 @@ namespace MovingSofa /-- The affine reversal of the middle roof stage: it maps `gerverStageTimes 2` to `gerverStageTimes 4` and `gerverStageTimes 3` to `gerverStageTimes 1`, so it reparametrizes the central part of the direct path backwards. -/ +@[expose] def gerverRoofReverseTime (s : ℝ) : ℝ := gerverStageTimes 4 - (gerverStageTimes 4 - gerverStageTimes 1) / (gerverStageTimes 3 - gerverStageTimes 2) * (s - gerverStageTimes 2) @@ -9595,12 +9646,14 @@ def gerverRoofReverseTime (s : ℝ) : ℝ := /-- The Gerver niche roof as a curve of an unrestricted real parameter. On the rotation interval it agrees with `gerverNicheRoof` (`gerverRoofCurve_eq`); the unrestricted form is what the intermediate value theorem and `continuous_if_le` consume. -/ +@[expose] def gerverRoofCurve (s : ℝ) : Point := if s ≤ gerverStageTimes 2 then paperGerverContacts s 3 else if s ≤ gerverStageTimes 3 then paperGerverPath (gerverRoofReverseTime s) else paperGerverContacts s 1 /-- The three-branch roof of the Gerver niche, using two contact arcs and the reversed path. -/ +@[expose] def gerverNicheRoof (s : Set.Icc (0 : ℝ) (Real.pi / 2)) : Point := if s.val ≤ gerverStageTimes 2 then paperGerverContacts s.val 3 else if s.val ≤ gerverStageTimes 3 then paperGerverPath (gerverRoofReverseTime s.val) @@ -9625,13 +9678,14 @@ Authors: Dean Cureton # Gerver / ODEs -/ -@[expose] public section +public section noncomputable section namespace MovingSofa /-- Tangential components of the four contact-curve derivatives on a selected stage. -/ +@[expose] def gerverStageContactDerivatives (i : Fin 5) (t : ℝ) : Fin 4 → ℝ := ![inner ℝ (derivWithin (fun s ↦ paperGerverContacts s 0) (gerverStageIntervals i) t) (tangentVector (t : Real.Angle)), @@ -9911,7 +9965,7 @@ Authors: Dean Cureton # Gerver / Outer Contacts -/ -@[expose] public section +public section noncomputable section @@ -9976,7 +10030,7 @@ the stage the two inner contact curves are strictly monotone on each stage (`strictAntiOn_inner_paperGerverContacts_three`, `strictMonoOn_inner_paperGerverContacts_one`). -/ -@[expose] public section +public section noncomputable section @@ -10059,6 +10113,7 @@ theorem contDiffOn_paperGerverContact (i : Fin 4) (j : Fin 5) : /-- The second Gerver contact curve, on the two stages `[t₃, t₅]` where it is an inner contact of the cap, as a continuous path of bounded variation. -/ +@[expose] def gerverRightContactBV : ContinuousBVPaths (gerverStageTimes 3) (gerverStageTimes 5) := continuousBVOfContDiffOnIccUnionIcc (fun t ↦ paperGerverContacts t 1) (gerverStageTimes_strictMono (show (3 : Fin 6) < 4 by decide)).le @@ -10067,6 +10122,7 @@ def gerverRightContactBV : ContinuousBVPaths (gerverStageTimes 3) (gerverStageTi /-- The fourth Gerver contact curve, on the two stages `[t₀, t₂]` where it is an inner contact of the cap, as a continuous path of bounded variation. -/ +@[expose] def gerverLeftContactBV : ContinuousBVPaths (gerverStageTimes 0) (gerverStageTimes 2) := continuousBVOfContDiffOnIccUnionIcc (fun t ↦ paperGerverContacts t 3) (gerverStageTimes_strictMono (show (0 : Fin 6) < 1 by decide)).le @@ -10399,7 +10455,7 @@ branch that the piecewise definitions select at the `m`-th angle. The soundness real quantities; the remaining lemmas are the order facts the evaluator needs. -/ -@[expose] public section +public section noncomputable section @@ -10408,15 +10464,18 @@ namespace MovingSofa open GerverAreaCert /-- The six stage endpoints indexed by a natural number, constant past `5`. -/ +@[expose] def gerverStageTime (s : ℕ) : ℝ := gerverStageTimes ⟨min 5 s, by omega⟩ /-- The real grid angle at index `m`, mirroring `GerverAreaCert.ttZ`. -/ +@[expose] def gerverGridTime (m : ℕ) : ℝ := (((NN - m % NN : ℕ) : ℝ) * gerverStageTime (m / NN) + ((m % NN : ℕ) : ℝ) * gerverStageTime (m / NN + 1)) / (NN : ℝ) /-- The curve selected by a certificate `kind`: `0` the path, `1` `A`, `2` `B`, `3` `C`, `4` `D`. -/ +@[expose] def gerverContactPoint : ℕ → ℝ → Point | 0 => paperGerverPath | 1 => fun t ↦ paperGerverContacts t 0 @@ -10704,7 +10763,7 @@ private, is the roof-specific part of the dictionary: the reverse-time reparamet and the identification of `gerverNicheRoof` with the certified upper arc. -/ -@[expose] public section +public section noncomputable section @@ -10910,6 +10969,7 @@ theorem gerver_niche_roof_membership : exact toPlane_mem_gerverOuterCap (hB t ht) /-- The strict region between the wall and the graph of `f` over the parameter set `I`. -/ +@[expose] def strictVerticalFill (f : ℝ → Point) (I : Set ℝ) : Set Point := {q | ∃ t ∈ I, q 0 = f t 0 ∧ 0 ≤ q 1 ∧ q 1 < f t 1} @@ -10998,7 +11058,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Cap.Tail.Canonical`. -/ -@[expose] public section +public section noncomputable section @@ -11014,7 +11074,7 @@ Authors: Dean Cureton # Cap / Tail / Arcs -/ -@[expose] public section +public section noncomputable section @@ -11030,6 +11090,7 @@ structure DirectedArcData where endPoint : Point /-- The directed convex boundary arcs used for the right and left tail bodies. -/ +@[expose] def rightLeftTailArcs (B D : ConvexBody Point) : DirectedArcData × DirectedArcData := (⟨convexBoundaryArc B (Real.pi + paperGerverConstants.2.1) (3 * Real.pi / 2), (edgeVertices B ((Real.pi + paperGerverConstants.2.1 : ℝ) : Real.Angle)).1, @@ -11057,7 +11118,7 @@ Authors: Dean Cureton # Cap / Tail / Space -/ -@[expose] public section +public section noncomputable section @@ -11067,10 +11128,12 @@ open scoped NNReal ENNReal namespace MovingSofa /-- The real-angle inner-corner path of a cap. -/ +@[expose] def capInnerCorner (K : RightAngleCapSpace) (t : ℝ) : Point := (rotatingHallwayParts (K.1 : Set Point) (t : Real.Angle)).innerCorner /-- The two surface densities on the upper half-circle, with the top atom excluded. -/ +@[expose] def HasCapDensities (K : RightAngleCapSpace) (r s : ℝ → ℝ≥0) : Prop := Measurable r ∧ Measurable s ∧ (surfaceAreaMeasure K.1).restrict @@ -11083,6 +11146,7 @@ def HasCapDensities (K : RightAngleCapSpace) (r s : ℝ → ℝ≥0) : Prop := ((volume.restrict (Set.Ioc 0 (Real.pi / 2))).withDensity (fun t ↦ (s t : ℝ≥0∞))) /-- The density, corner regularity and strict interior signs of the injectivity condition. -/ +@[expose] def SatisfiesInjectivityCondition (K : RightAngleCapSpace) : Prop := (∃ r s : ℝ → ℝ≥0, HasCapDensities K r s ∧ ∀ r' s', HasCapDensities K r' s' → @@ -11096,6 +11160,7 @@ def SatisfiesInjectivityCondition (K : RightAngleCapSpace) : Prop := (tangentVector (t : Real.Angle)) /-- Right-angle caps satisfying injectivity and the cap-area threshold. -/ +@[expose] def SpecialCapSpace := {K : RightAngleCapSpace // SatisfiesInjectivityCondition K ∧ (11 : ℝ) / 5 ≤ ClassicalResults.area (K.1 : Set Point)} @@ -11142,7 +11207,7 @@ Authors: Dean Cureton # Cap / Corner Measure -/ -@[expose] public section +public section noncomputable section @@ -11151,6 +11216,7 @@ open MeasureTheory namespace MovingSofa /-- The normal and tangent components of the inner-corner path derivative. -/ +@[expose] def capVelocityCoefficients (K : SpecialCapSpace) (t : ℝ) : ℝ × ℝ := (inner ℝ (derivWithin (capInnerCorner K.val) (Set.Icc 0 (Real.pi / 2)) t) (normalVector (t : Real.Angle)), @@ -11158,6 +11224,7 @@ def capVelocityCoefficients (K : SpecialCapSpace) (t : ℝ) : ℝ × ℝ := (tangentVector (t : Real.Angle))) /-- The density formed by joining the two signed corner-velocity components over `[0, π]`. -/ +@[expose] def capCornerDensity (K : SpecialCapSpace) (s : ℝ) : ℝ := if 0 < s ∧ s ≤ Real.pi / 2 then (capVelocityCoefficients K s).2 else if Real.pi / 2 < s ∧ s ≤ Real.pi then @@ -11165,11 +11232,13 @@ def capCornerDensity (K : SpecialCapSpace) (s : ℝ) : ℝ := else 0 /-- The measure on the real angle interval defined by the nonnegative corner density. -/ +@[expose] def capCornerMeasure (K : SpecialCapSpace) : Measure ℝ := (volume.restrict (Set.Icc 0 Real.pi)).withDensity (fun s ↦ ENNReal.ofReal (capCornerDensity K s)) /-- Push the corner-density measure to angles modulo a full turn. -/ +@[expose] def capCornerAngleMeasure (K : SpecialCapSpace) : Measure Real.Angle := Measure.map (fun s : ℝ ↦ (s : Real.Angle)) (capCornerMeasure K) @@ -11281,18 +11350,20 @@ Authors: Dean Cureton # Cap / Corner Paths -/ -@[expose] public section +public section noncomputable section namespace MovingSofa /-- The inner-corner path restricted and bundled as a continuous BV path. -/ +@[expose] def capCornerBV (K : SpecialCapSpace) {a b : ℝ} (h : Set.Icc a b ⊆ Set.Icc 0 (Real.pi / 2)) : ContinuousBVPaths a b := continuousBVOfContDiffOn (capInnerCorner K.val) (K.property.1.2.1.mono h) /-- The corner BV path between the two reflected Gerver switching angles. -/ +@[expose] def capMiddleBV (K : SpecialCapSpace) : ContinuousBVPaths paperGerverConstants.2.1 paperGerverConstants.2.2 := capCornerBV K (by @@ -11320,19 +11391,21 @@ Authors: Dean Cureton # Cap / Tail / Canonical -/ -@[expose] public section +public section noncomputable section namespace MovingSofa /-- The closed half-planes above the right and left inner supporting walls. -/ +@[expose] def innerWallUpperHalfPlanes (K : RightAngleCapSpace) (t : ℝ) : Set Point × Set Point := (normalHalfPlane (t : Real.Angle) (supportValue K.1 (t : Real.Angle) - 1) true false, normalHalfPlane ((t + Real.pi / 2 : ℝ) : Real.Angle) (supportValue K.1 ((t + Real.pi / 2 : ℝ) : Real.Angle) - 1) true false) /-- The right and left canonical tail sets, before bundling their convex-body proofs. -/ +@[expose] def canonicalTailSets (K : SpecialCapSpace) : Set Point × Set Point := ((K.1.1 : Set Point) ∩ ⋂ t ∈ Set.Icc paperGerverConstants.2.1 (Real.pi / 2), diff --git a/LeanPool/MovingSofa/Development/Geometry/Foundations/Development006.lean b/LeanPool/MovingSofa/Development/Geometry/Foundations/Development006.lean index a2aed17cf5..ce8fb1ead6 100644 --- a/LeanPool/MovingSofa/Development/Geometry/Foundations/Development006.lean +++ b/LeanPool/MovingSofa/Development/Geometry/Foundations/Development006.lean @@ -47,7 +47,7 @@ public import Mathlib.Topology.Order.IntermediateValue * `Motion.Foundations.Development003`. -/ -@[expose] public section +public section noncomputable section @@ -73,7 +73,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Motion.StandardPosition`. -/ -@[expose] public section +public section noncomputable section @@ -89,7 +89,7 @@ Authors: Dean Cureton # Motion / Basic -/ -@[expose] public section +public section noncomputable section @@ -98,6 +98,7 @@ open scoped unitInterval namespace MovingSofa /-- A paper motion permits an initial translation and preserves orientation at every time. -/ +@[expose] def IsPaperMotion (s : Set Point) (m : I → Point ≃ᵃⁱ[ℝ] Point) : Prop := IsConnected s ∧ IsClosed s ∧ Continuous m ∧ (∃ q : Point, ∀ p, m 0 p = p + q) ∧ @@ -106,35 +107,42 @@ def IsPaperMotion (s : Set Point) (m : I → Point ≃ᵃⁱ[ℝ] Point) : Prop (∀ t, m t '' s ⊆ hallway) ∧ m 1 '' s ⊆ verticalHallway /-- Movability in the paper's translation-invariant convention. -/ +@[expose] def IsPaperMovingSofa (s : Set Point) : Prop := ∃ m, IsPaperMotion s m /-- Clockwise rotation angle of a particular admissible lifted motion witness. -/ +@[expose] def HasRotationAngle (s : Set Point) (ω : ℝ) : Prop := ∃ (m : I → Point ≃ᵃⁱ[ℝ] Point), IsPaperMotion s m ∧ ∃ α : I → ℝ, Continuous α ∧ α 0 = 0 ∧ α 1 = -ω ∧ ∀ t p, m t p = rotationMap (α t : Real.Angle) p + m t 0 /-- Standard position for a compact moving sofa with the specified rotation angle. -/ +@[expose] def IsStandardPosition (s : Set Point) (ω : ℝ) : Prop := IsCompact s ∧ HasRotationAngle s ω ∧ 0 < ω ∧ ω ≤ Real.pi / 2 ∧ supportValue s (ω : Real.Angle) = 1 ∧ supportValue s ((Real.pi / 2 : ℝ) : Real.Angle) = 1 /-- The cap set constructed from all supporting outer quadrants. -/ +@[expose] def capOfSofa (s : Set Point) (ω : ℝ) : Set Point := (stripParallelogram ω).1 ∩ ⋂ t ∈ Set.Icc 0 ω, (rotatingHallwayParts s (t : Real.Angle)).outerQuadrant /-- The intersection of supporting hallways used for monotonization. -/ +@[expose] def monotonization (s : Set Point) (ω : ℝ) : Set Point := (stripParallelogram ω).1 ∩ ⋂ t ∈ Set.Icc 0 ω, supportingHallway s (t : Real.Angle) /-- A monotone sofa is the monotonization of a sofa in standard position. -/ +@[expose] def IsMonotoneSofa (s : Set Point) : Prop := ∃ (s₀ : Set Point) (ω : ℝ), IsStandardPosition s₀ ω ∧ s = monotonization s₀ ω /-- The finite-angle outer approximation to a cap. -/ +@[expose] def angleCap (Θ : AngleSet) (K : CapSpace Θ.angle) : Set Point := (stripParallelogram Θ.angle).1 ∩ ⋂ t ∈ Θ.directions, (rotatingHallwayParts (K.1 : Set Point) (t : Real.Angle)).outerQuadrant @@ -158,7 +166,7 @@ Authors: Dean Cureton # Motion / Common Subset -/ -@[expose] public section +public section noncomputable section @@ -397,7 +405,7 @@ Authors: Dean Cureton # Motion / Compactness -/ -@[expose] public section +public section noncomputable section @@ -541,7 +549,7 @@ Authors: Dean Cureton # Motion / Rotation -/ -@[expose] public section +public section noncomputable section @@ -701,7 +709,7 @@ Authors: Dean Cureton # Motion / Angle Lift -/ -@[expose] public section +public section noncomputable section @@ -776,7 +784,7 @@ Authors: Dean Cureton # Motion / Rotation Angle Calculation -/ -@[expose] public section +public section noncomputable section @@ -790,6 +798,7 @@ def rotationCalculationMinimum (ω : RotationCalculationAngle) : ℝ := if ω.val < Real.arctan (11 / 5 : ℝ) then 5 / 4 else 11 / 10 /-- Auxiliary radii and points determined by an admissible rotation angle and distance. -/ +@[expose] def rotationCalculationValues (ω : RotationCalculationAngle) (d : Set.Icc (rotationCalculationMinimum ω) (Real.tan ω.val)) : ℝ × ℝ × Point × Point := @@ -1083,7 +1092,7 @@ Authors: Dean Cureton # Motion / Supporting Hallways -/ -@[expose] public section +public section noncomputable section open Set @@ -1240,7 +1249,7 @@ Authors: Dean Cureton # Motion / Translation -/ -@[expose] public section +public section noncomputable section @@ -1329,7 +1338,7 @@ Authors: Dean Cureton # Motion / Standard Position -/ -@[expose] public section +public section noncomputable section @@ -1453,7 +1462,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Bounds.WedgeContainment`. -/ -@[expose] public section +public section noncomputable section @@ -1469,7 +1478,7 @@ Authors: Dean Cureton # Bounds / Wedge Containment -/ -@[expose] public section +public section noncomputable section @@ -1860,7 +1869,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Cap.UpperBoundary`. -/ -@[expose] public section +public section noncomputable section @@ -1876,7 +1885,7 @@ Authors: Dean Cureton # Cap / Balanced -/ -@[expose] public section +public section noncomputable section @@ -1886,15 +1895,18 @@ open scoped Topology namespace MovingSofa /-- The polygonal cap area minus the area of its polygonal niche. -/ +@[expose] def polygonAreaFunctional (Θ : AngleSet) (K : CapSpace Θ.angle) : ℝ := ClassicalResults.area (angleCap Θ K) - ClassicalResults.area (polygonNiche Θ K) /-- A cap containing the distinguished fan point maximizes the polygonal area functional. -/ +@[expose] def IsMaximumPolygonCap (Θ : AngleSet) (K : PolygonCapSpace Θ) : Prop := (stripParallelogram Θ.angle).2.2 ∈ (K.val.val : Set Point) ∧ ∀ L : PolygonCapSpace Θ, polygonAreaFunctional Θ L.val ≤ polygonAreaFunctional Θ K.val /-- The cap is a Hausdorff limit of polygonal maxima on increasingly fine dyadic meshes. -/ +@[expose] def IsBalancedMaximumCap {ω : ℝ} (K : CapSpace ω) : Prop := ∃ (n : ℕ → ℕ) (hn : ∀ i, 2 ≤ n i), StrictMono n ∧ (∀ i, ∃ k : ℕ, n i = 2 ^ k) ∧ @@ -1922,7 +1934,7 @@ Authors: Dean Cureton # Cap / Clipped / Estimates -/ -@[expose] public section +public section noncomputable section @@ -2043,7 +2055,7 @@ Authors: Dean Cureton # Cap / Clipped -/ -@[expose] public section +public section noncomputable section @@ -2052,6 +2064,7 @@ namespace MovingSofa open MeasureTheory Set /-- Clip the strip parallelogram by the two additional symmetric wall constraints. -/ +@[expose] def clippedCap (ω d : ℝ) : Set Point := (stripParallelogram ω).1 ∩ normalHalfPlane 0 (d + Real.tan ((Real.pi / 2 - ω) / 2)) false false ∩ @@ -2460,7 +2473,7 @@ Authors: Dean Cureton # Cap / Densities -/ -@[expose] public section +public section noncomputable section @@ -2559,6 +2572,7 @@ theorem capDensities_edgeVertices_eq (K : RightAngleCapSpace) rwa [show t - Real.pi / 2 + Real.pi / 2 = t from by ring] at h' /-- The two cap contact paths and their scalar density functions on the quarter-turn interval. -/ +@[expose] def nondegenerateCapData (K : RightAngleCapSpace) (_hK : ∃ r s, HasCapDensities K r s) : ((Set.Icc (0 : ℝ) (Real.pi / 2) → Point) × @@ -2592,13 +2606,14 @@ Authors: Dean Cureton # Cap / Upper Boundary -/ -@[expose] public section +public section noncomputable section namespace MovingSofa /-- The union of exposed cap edges over the upper range of normal directions. -/ +@[expose] def capUpperBoundary {ω : ℝ} (K : CapSpace ω) : Set Point := ⋃ t ∈ Set.Icc 0 (ω + Real.pi / 2), exposedEdge K.val (t : Real.Angle) @@ -2829,7 +2844,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Bounds.Niche`. -/ -@[expose] public section +public section noncomputable section @@ -2845,7 +2860,7 @@ Authors: Dean Cureton # Bounds / Niche -/ -@[expose] public section +public section noncomputable section @@ -2855,13 +2870,16 @@ open scoped Topology namespace MovingSofa /-- The infimum of the set’s horizontal coordinates. -/ +@[expose] def horizontalMin (S : Set Point) : ℝ := sInf ((fun p ↦ p 0) '' S) /-- The supremum of the set’s horizontal coordinates. -/ +@[expose] def horizontalMax (S : Set Point) : ℝ := sSup ((fun p ↦ p 0) '' S) /-- The niche is measurable, finite-area and enclosed by the specified horizontal-span rectangle. -/ +@[expose] def HasNicheRectangleBounds (S N : Set Point) : Prop := MeasurableSet N ∧ N ⊆ {p | horizontalMin S < p 0 ∧ p 0 < horizontalMax S ∧ @@ -3207,7 +3225,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Geometry.ContactGeometry`. -/ -@[expose] public section +public section noncomputable section @@ -3223,7 +3241,7 @@ Authors: Dean Cureton # Geometry / Contact Geometry -/ -@[expose] public section +public section noncomputable section @@ -3545,7 +3563,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Analysis.SurfaceMeasure.OppositeDensity`. -/ -@[expose] public section +public section noncomputable section @@ -3561,7 +3579,7 @@ Authors: Dean Cureton # Analysis / Stieltjes / Convex Boundary -/ -@[expose] public section +public section noncomputable section @@ -3717,7 +3735,7 @@ Authors: Dean Cureton # Analysis / Surface Measure / Polygon -/ -@[expose] public section +public section noncomputable section @@ -4380,7 +4398,7 @@ Authors: Dean Cureton # Analysis / Surface Measure / Boundary Limit -/ -@[expose] public section +public section noncomputable section @@ -4458,7 +4476,7 @@ Authors: Dean Cureton # Analysis / Surface Measure / Discrete Bounds -/ -@[expose] public section +public section noncomputable section @@ -4633,7 +4651,7 @@ Authors: Dean Cureton # Analysis / Surface Measure / Integrals -/ -@[expose] public section +public section noncomputable section @@ -4741,7 +4759,7 @@ Authors: Dean Cureton # Analysis / Surface Measure / Vertex Boundary -/ -@[expose] public section +public section noncomputable section @@ -4804,7 +4822,7 @@ since they only use additivity and the injectivity of the angular projection on most one turn. -/ -@[expose] public section +public section noncomputable section @@ -5078,7 +5096,7 @@ Authors: Dean Cureton # Analysis / Surface Measure / Frame Products -/ -@[expose] public section +public section noncomputable section @@ -5276,7 +5294,7 @@ Authors: Dean Cureton # Analysis / Surface Measure / Boundary -/ -@[expose] public section +public section noncomputable section @@ -5430,7 +5448,7 @@ Authors: Dean Cureton # Analysis / Surface Measure / Linearity -/ -@[expose] public section +public section noncomputable section @@ -5595,7 +5613,7 @@ The two variants `oppositeSurfaceData_angleImage_eq_withDensity_of_openLeft` and window from the other side with `measure_angleImage_eq_of_iUnion`. -/ -@[expose] public section +public section noncomputable section @@ -5808,7 +5826,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Convex.TangentLinePath`. -/ -@[expose] public section +public section noncomputable section @@ -5830,7 +5848,7 @@ arbitrary body by polygon approximation and weak convergence of surface measures integral, taken with the two bodies decoupled, is convex-bilinear. -/ -@[expose] public section +public section noncomputable section @@ -6870,7 +6888,7 @@ Authors: Dean Cureton # Convex / Linearity -/ -@[expose] public section +public section noncomputable section @@ -6941,7 +6959,7 @@ Minkowski segment `λ ↦ |(1 - λ) K + λ L|` is therefore the quadratic The symmetry itself is `MovingSofa.supportIntegral_symm` in `MovingSofa.Convex.SupportArea`. -/ -@[expose] public section +public section noncomputable section @@ -7021,7 +7039,7 @@ Authors: Dean Cureton # Convex / Tangent Line Path -/ -@[expose] public section +public section noncomputable section @@ -7031,11 +7049,13 @@ open scoped Topology namespace MovingSofa /-- Trace intersections with a fixed supporting line, ending at its exposed-edge endpoint. -/ +@[expose] def tangentLinePath (K : ConvexBody Point) (t : ℝ) (s : Set.Ioc (t - Real.pi) t) : Point := if s.val < t then supportingIntersection K (s.val : Real.Angle) (t : Real.Angle) else (edgeVertices K (t : Real.Angle)).2 /-- Restrict the tangent-line path to a closed interval of supporting directions. -/ +@[expose] def tangentLineRestriction (K : ConvexBody Point) (t a b : ℝ) (ha : a ∈ Set.Ioc (t - Real.pi) t) (hb : b ∈ Set.Ioc (t - Real.pi) t) (s : Set.Icc a b) : Point := @@ -7406,7 +7426,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Convex.ArcRegionArea`. -/ -@[expose] public section +public section noncomputable section @@ -7422,7 +7442,7 @@ Authors: Dean Cureton # Convex / Arc Cut Boundary -/ -@[expose] public section +public section noncomputable section @@ -7879,7 +7899,7 @@ Authors: Dean Cureton # Convex / Arc Area -/ -@[expose] public section +public section noncomputable section @@ -8631,7 +8651,7 @@ Authors: Dean Cureton # Convex / Arc Bilinear -/ -@[expose] public section +public section noncomputable section @@ -8811,7 +8831,7 @@ Authors: Dean Cureton # Convex / Arc Jordan -/ -@[expose] public section +public section noncomputable section @@ -9575,7 +9595,7 @@ private theorem arcUnitPath_range {A : OrientedJordanArc} private theorem isJordanCurve_of_tau {Γ : Set Point} (hΓ : TauCeti.IsJordanCurve Γ) : IsJordanCurve Γ := by - obtain ⟨e⟩ := hΓ + obtain ⟨e⟩ := TauCeti.isJordanCurve_iff.mp hΓ refine ⟨fun z ↦ (e.symm z : Point), continuous_subtype_val.comp e.symm.continuous, fun z w h ↦ e.symm.injective (Subtype.ext h), ?_⟩ apply Set.Subset.antisymm @@ -9615,7 +9635,7 @@ private theorem convexArc_broken_isJordanCurve private theorem jordanInterior_subset_closedConvexHull {Γ : Set Point} (hΓ : Γ.Nonempty) : jordanInterior Γ ⊆ closedConvexHull ℝ Γ := by intro p hp - exact TauCeti.filledHull_subset_closedConvexHull hΓ hp.2 + exact TauCeti.filledHull_subset_closedConvexHull hΓ (TauCeti.mem_filledHull_iff.mpr hp.2) /-- The region enclosed by a loop inside a closed convex set stays inside that set. -/ theorem jordanInterior_subset_of_subset_closed_convex @@ -10238,7 +10258,7 @@ those tangents. The single result here bounds that region's signed area by the set that receives it. -/ -@[expose] public section +public section noncomputable section @@ -10375,7 +10395,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Area.Variation`. -/ -@[expose] public section +public section noncomputable section @@ -10391,13 +10411,14 @@ Authors: Dean Cureton # Area / Mamikon / Basic -/ -@[expose] public section +public section noncomputable section namespace MovingSofa /-- The signed area between the convex boundary arc and a path on its supporting lines. -/ +@[expose] def mamikonFunctional (K : ConvexBody Point) (a b : ℝ) (hab : a < b) (_hba : b < a + Real.pi) (z : ContinuousBVPaths a b) (_hz : ∀ t : Set.Icc a b, @@ -10428,7 +10449,7 @@ Authors: Dean Cureton # Area / Variation -/ -@[expose] public section +public section noncomputable section @@ -10438,6 +10459,7 @@ open scoped unitInterval namespace MovingSofa /-- Coordinatewise convex combination of two pairs of planar points. -/ +@[expose] def pointPairCombination (t : I) (x y : Point × Point) : Point × Point := ((1 - (t : ℝ)) • x.1 + (t : ℝ) • y.1, (1 - (t : ℝ)) • x.2 + (t : ℝ) • y.2) @@ -10464,6 +10486,7 @@ theorem segmentArea_variation : ring /-- The pointwise convex combination of two continuous BV paths. -/ +@[expose] def bvPathCombination {a b : ℝ} (t : I) (x y : ContinuousBVPaths a b) : ContinuousBVPaths a b := (1 - (t : ℝ)) • x + (t : ℝ) • y @@ -10696,7 +10719,7 @@ Authors: Dean Cureton is itself a moving sofa, the bound gives `sofaConstant = volume gerversSofa`. -/ -@[expose] public section +public section namespace MovingSofa @@ -10705,6 +10728,7 @@ open scoped EuclideanGeometry unitInterval /-- Every moving sofa has area at most that of Gerver's sofa. This is the upper bound proved in Baek's paper; together with the fact that Gerver's sofa is a moving sofa it gives optimality. -/ +@[expose] def AreaUpperBound : Prop := ∀ (s : Set ℝ²) (m : I → E(2)), IsMovingSofa s m → volume s ≤ volume gerversSofa @@ -10736,7 +10760,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Motion.CanonicalBridge`. -/ -@[expose] public section +public section noncomputable section @@ -10752,7 +10776,7 @@ Authors: Dean Cureton # Motion / Canonical Bridge -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/Development/Geometry/Foundations/Development007.lean b/LeanPool/MovingSofa/Development/Geometry/Foundations/Development007.lean index 1febd02c61..6a7455ce23 100644 --- a/LeanPool/MovingSofa/Development/Geometry/Foundations/Development007.lean +++ b/LeanPool/MovingSofa/Development/Geometry/Foundations/Development007.lean @@ -42,7 +42,7 @@ public import Mathlib.Topology.Order.ProjIcc * `Sofa.Foundations.Development002`. -/ -@[expose] public section +public section noncomputable section @@ -75,7 +75,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Polygon.Height.PositiveIncrement`. -/ -@[expose] public section +public section noncomputable section @@ -91,7 +91,7 @@ Authors: Dean Cureton # Polygon / Approximation -/ -@[expose] public section +public section noncomputable section @@ -378,7 +378,7 @@ Authors: Dean Cureton # Polygon / Cap Width Bound -/ -@[expose] public section +public section noncomputable section @@ -571,27 +571,31 @@ Authors: Dean Cureton # Polygon / Discrete Cap Data -/ -@[expose] public section +public section noncomputable section namespace MovingSofa /-- The uniformly spaced interior directions for a right-angle polygonal approximation. -/ +@[expose] def rightAngleSet (n : ℕ) (hn : 2 ≤ n) : AngleSet := uniformAngleSet (Real.pi / 2) (by positivity) le_rfl n hn /-- The angular mesh size `π/(2n)`. -/ +@[expose] def polygonStepSize (n : ℕ) : ℝ := (Real.pi / 2) / n /-- The cap maximizes the polygonal functional on a uniform mesh with a power-of-two step count. -/ +@[expose] def IsMaximumPolygonCapSteps (n : ℕ) (K : RightAngleCapSpace) : Prop := ∃ hn : 2 ≤ n, (∃ k : ℕ, n = 2 ^ k) ∧ ∃ P : PolygonCapSpace (rightAngleSet n hn), P.val = K ∧ IsMaximumPolygonCap (rightAngleSet n hn) P /-- The two piecewise scalar functions used in the arm-length inequalities. -/ +@[expose] def magicFunctions : (NNReal → ℝ) × (NNReal → ℝ) := (fun x ↦ max |(x : ℝ) - 1| ((|(x : ℝ) - 1| + 1) / 2), fun x ↦ (x : ℝ) - max |(x : ℝ) - 1| ((|(x : ℝ) - 1| + 1) / 2)) @@ -625,7 +629,7 @@ Authors: Dean Cureton # Polygon / Height / Properties -/ -@[expose] public section +public section noncomputable section @@ -840,7 +844,7 @@ Authors: Dean Cureton # Polygon / Nef / Slices -/ -@[expose] public section +public section noncomputable section @@ -1413,7 +1417,7 @@ Authors: Dean Cureton # Polygon / Nef / Variation / Local Slices -/ -@[expose] public section +public section noncomputable section @@ -1792,7 +1796,7 @@ Authors: Dean Cureton # Polygon / Nef / Variation / Area -/ -@[expose] public section +public section noncomputable section @@ -2012,7 +2016,7 @@ Authors: Dean Cureton # Polygon / Nef / Variation / Boundary -/ -@[expose] public section +public section noncomputable section @@ -2336,7 +2340,7 @@ Authors: Dean Cureton # Polygon / Nef / Variation -/ -@[expose] public section +public section noncomputable section @@ -2414,7 +2418,7 @@ Authors: Dean Cureton # Polygon / Nef / Signed Variation -/ -@[expose] public section +public section noncomputable section namespace MovingSofa @@ -2526,7 +2530,7 @@ Authors: Dean Cureton # Polygon / Height / Wall Variation -/ -@[expose] public section +public section noncomputable section namespace MovingSofa @@ -3244,7 +3248,7 @@ Authors: Dean Cureton # Polygon / Right Angle Grid -/ -@[expose] public section +public section noncomputable section @@ -3403,7 +3407,7 @@ Authors: Dean Cureton # Polygon / Translation -/ -@[expose] public section +public section noncomputable section @@ -3600,7 +3604,7 @@ Authors: Dean Cureton # Polygon / Height / Reconstruction -/ -@[expose] public section +public section noncomputable section @@ -3775,7 +3779,7 @@ Authors: Dean Cureton # Polygon / Height / Positive Increment / Contacts -/ -@[expose] public section +public section noncomputable section @@ -4680,7 +4684,7 @@ Authors: Dean Cureton # Polygon / Height / Positive Increment -/ -@[expose] public section +public section noncomputable section @@ -4725,7 +4729,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Bounds.NicheLimits`. -/ -@[expose] public section +public section noncomputable section @@ -4741,7 +4745,7 @@ Authors: Dean Cureton # Bounds / Leg Computation -/ -@[expose] public section +public section noncomputable section @@ -5235,13 +5239,14 @@ Authors: Dean Cureton # Bounds / Lower / Profile -/ -@[expose] public section +public section noncomputable section namespace MovingSofa /-- Integrate the reflected arm profile through the second magic function and add one. -/ +@[expose] def armIntegralOperator (f : C(Set.Icc (0 : ℝ) (Real.pi / 2), NNReal)) : C(Set.Icc (0 : ℝ) (Real.pi / 2), ℝ) where toFun x := 1 + ∫ u in (0 : ℝ)..(x : ℝ), @@ -5258,6 +5263,7 @@ def armIntegralOperator (f : C(Set.Icc (0 : ℝ) (Real.pi / 2), NNReal)) : /-- Iteratively improve the nonnegative arm lower bound by taking the maximum with its integral update. -/ +@[expose] def armLowerBoundSequence : ℕ → C(Set.Icc (0 : ℝ) (Real.pi / 2), NNReal) | 0 => ⟨fun _ ↦ 0, continuous_const⟩ | n + 1 => @@ -5268,6 +5274,7 @@ def armLowerBoundSequence : ℕ → C(Set.Icc (0 : ℝ) (Real.pi / 2), NNReal) n)).continuous)⟩ /-- The continuous profile `max (1 - x) c` on the quarter-turn interval. -/ +@[expose] def lowerBoundProfile (c : Set.Icc (0 : ℝ) 1) : C(Set.Icc (0 : ℝ) (Real.pi / 2), ℝ) where toFun x := max (1 - (x : ℝ)) (c : ℝ) @@ -5292,7 +5299,7 @@ Authors: Dean Cureton # Bounds / Niche Limits -/ -@[expose] public section +public section noncomputable section @@ -5697,7 +5704,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Cap.Reflection`. -/ -@[expose] public section +public section noncomputable section @@ -5713,7 +5720,7 @@ Authors: Dean Cureton # Cap / Niche Limit -/ -@[expose] public section +public section noncomputable section @@ -5772,19 +5779,21 @@ Authors: Dean Cureton # Cap / Reflection -/ -@[expose] public section +public section noncomputable section namespace MovingSofa /-- Reflect about the line through the origin and the distinguished parallelogram point. -/ +@[expose] def mirrorReflection (ω : ℝ) (p : Point) : Point := (2 * inner ℝ p (stripParallelogram ω).2.2 / inner ℝ (stripParallelogram ω).2.2 (stripParallelogram ω).2.2) • (stripParallelogram ω).2.2 - p /-- Reflect every interior wall direction about half the terminal angle. -/ +@[expose] def reflectedAngleSet (Θ : AngleSet) : AngleSet where angle := Θ.angle angle_pos := Θ.angle_pos @@ -6078,7 +6087,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Sofa.Cap`. -/ -@[expose] public section +public section noncomputable section @@ -6094,7 +6103,7 @@ Authors: Dean Cureton # Sofa / Support -/ -@[expose] public section +public section noncomputable section @@ -6209,7 +6218,7 @@ Authors: Dean Cureton # Sofa / Cap -/ -@[expose] public section +public section noncomputable section @@ -6736,7 +6745,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Cap.MirrorFeatures`. -/ -@[expose] public section +public section noncomputable section @@ -6752,7 +6761,7 @@ Authors: Dean Cureton # Cap / Connectedness -/ -@[expose] public section +public section noncomputable section @@ -7438,7 +7447,7 @@ Authors: Dean Cureton # Cap / Mirror Features -/ -@[expose] public section +public section noncomputable section @@ -8253,7 +8262,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Bounds.Arm.Geometry`. -/ -@[expose] public section +public section noncomputable section @@ -8269,7 +8278,7 @@ Authors: Dean Cureton # Bounds / Arm / Geometry -/ -@[expose] public section +public section noncomputable section @@ -8585,7 +8594,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Cap.Tail.Separation`. -/ -@[expose] public section +public section noncomputable section @@ -8601,7 +8610,7 @@ Authors: Dean Cureton # Cap / Regularity -/ -@[expose] public section +public section noncomputable section @@ -8880,7 +8889,7 @@ upper boundary avoids the niche; that inference fails for the stated class of ca `NOTES.md`). -/ -@[expose] public section +public section noncomputable section @@ -9407,7 +9416,7 @@ Authors: Dean Cureton # Cap / Tail / Bodies -/ -@[expose] public section +public section noncomputable section @@ -9425,6 +9434,7 @@ structure DistinguishedCapSide where corner : Point /-- The right and left cap geometry at the two distinguished Gerver angles. -/ +@[expose] def distinguishedCapSides (K : RightAngleCapSpace) : DistinguishedCapSide × DistinguishedCapSide := let r := paperGerverConstants.2.1 let l := paperGerverConstants.2.2 @@ -9703,7 +9713,7 @@ Authors: Dean Cureton # Cap / Tail / Extension -/ -@[expose] public section +public section noncomputable section @@ -9745,7 +9755,7 @@ Authors: Dean Cureton # Cap / Tail / Separation -/ -@[expose] public section +public section noncomputable section @@ -9875,7 +9885,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Area.NicheDecomposition`. -/ -@[expose] public section +public section noncomputable section @@ -9891,7 +9901,7 @@ Authors: Dean Cureton # Area / Niche Decomposition -/ -@[expose] public section +public section noncomputable section @@ -9980,7 +9990,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Bounds.WedgeEndpoints`. -/ -@[expose] public section +public section noncomputable section @@ -10001,7 +10011,7 @@ wall `b(t)`; symmetrically on `[0, π/2 - φ)` for the left side. Intersecting with the fan gives the two wedge forms. -/ -@[expose] public section +public section noncomputable section @@ -10376,7 +10386,7 @@ Authors: Dean Cureton # Bounds / Wedge Endpoints -/ -@[expose] public section +public section noncomputable section @@ -10699,7 +10709,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Bounds.Upper.Q`. -/ -@[expose] public section +public section noncomputable section @@ -10715,7 +10725,7 @@ Authors: Dean Cureton # Bounds / Upper / Q -/ -@[expose] public section +public section noncomputable section @@ -10723,6 +10733,7 @@ namespace MovingSofa /-- The cap-tail upper-bound functional Q assembled from cap area, tail arcs and endpoint segments. -/ +@[expose] def upperBoundQ (T : CapTailSpace) : ℝ := ClassicalResults.area (T.cap.val.val : Set Point) + convexArcArea T.leftBody (3 * Real.pi / 2) @@ -10761,7 +10772,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Motion.Monotonization`. -/ -@[expose] public section +public section noncomputable section @@ -10777,7 +10788,7 @@ Authors: Dean Cureton # Motion / Monotonization -/ -@[expose] public section +public section noncomputable section open Set @@ -10879,7 +10890,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Sofa.Area`. -/ -@[expose] public section +public section noncomputable section @@ -10895,7 +10906,7 @@ Authors: Dean Cureton # Sofa / Area -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/Development/Geometry/Foundations/Development008.lean b/LeanPool/MovingSofa/Development/Geometry/Foundations/Development008.lean index c4cd73f620..444536ca55 100644 --- a/LeanPool/MovingSofa/Development/Geometry/Foundations/Development008.lean +++ b/LeanPool/MovingSofa/Development/Geometry/Foundations/Development008.lean @@ -13,7 +13,7 @@ public import LeanPool.MovingSofa.Development.Geometry.Foundations.Development00 * `Cap.Foundations.Development008`. -/ -@[expose] public section +public section noncomputable section @@ -31,7 +31,7 @@ Authors: Dean Cureton, The Moving Sofa contributors * `Cap.Monotone`. -/ -@[expose] public section +public section noncomputable section @@ -47,7 +47,7 @@ Authors: Dean Cureton # Cap / Monotone -/ -@[expose] public section +public section noncomputable section namespace MovingSofa diff --git a/LeanPool/MovingSofa/Development/IntervalArithmetic/Foundations/Development001.lean b/LeanPool/MovingSofa/Development/IntervalArithmetic/Foundations/Development001.lean index 7b3e22770f..e6b311a1e8 100644 --- a/LeanPool/MovingSofa/Development/IntervalArithmetic/Foundations/Development001.lean +++ b/LeanPool/MovingSofa/Development/IntervalArithmetic/Foundations/Development001.lean @@ -79,7 +79,7 @@ public import Mathlib.Topology.Order.Basic * `LeanCert.Engine.AD.DomainChecked`. -/ -@[expose] public section +public section noncomputable section @@ -115,7 +115,7 @@ The derivative of sinc at 0 can be computed using Taylor expansion: - `sinc'(0) = 0` -/ -@[expose] public section +public section open Filter Topology open scoped Topology @@ -564,7 +564,7 @@ They're designed to be composable with the chain rule for AD correctness proofs. /-! ### Exp derivative intervals -/ -@[expose] public section +public section namespace LeanCert.Core.DerivativeIntervals @@ -878,7 +878,7 @@ For interval arithmetic, we use directed rounding: This ensures mathematical soundness even when truncating precision. -/ -@[expose] public section +public section namespace LeanCert.Core @@ -917,6 +917,7 @@ def hasLowBits (m : Int) (n : Nat) : Bool := For non-negative exponents: `mantissa * 2^exponent` For negative exponents: `mantissa / 2^(-exponent)` -/ +@[expose] def toRat (d : Dyadic) : ℚ := if d.exponent ≥ 0 then d.mantissa * (pow2Nat d.exponent.toNat : ℤ) @@ -926,6 +927,7 @@ def toRat (d : Dyadic) : ℚ := instance : Coe Dyadic ℚ where coe := toRat /-- Equality of represented values, ignoring noncanonical mantissa/exponent pairs. -/ +@[expose] def ValueEq (d₁ d₂ : Dyadic) : Prop := d₁.toRat = d₂.toRat instance (d₁ d₂ : Dyadic) : Decidable (d₁.ValueEq d₂) := @@ -953,6 +955,7 @@ structure CanonicalKey where deriving Repr, DecidableEq, BEq, Hashable /-- Convert a dyadic value to its canonical identity key. -/ +@[expose] def canonicalKey (d : Dyadic) : CanonicalKey := ⟨d.toRat⟩ @[simp] theorem canonicalKey_value (d : Dyadic) : d.canonicalKey.value = d.toRat := rfl @@ -980,6 +983,7 @@ def ofInt (i : Int) : Dyadic := ⟨i, 0⟩ def pow2 (n : Int) : Dyadic := ⟨1, n⟩ /-- Zero as a Dyadic -/ +@[expose] def zero : Dyadic := ⟨0, 0⟩ /-- One as a Dyadic -/ @@ -1954,7 +1958,7 @@ Since Mathlib doesn't provide `Real.atanh`, we define it here using the standard formula: `atanh x = (1/2) * log((1+x)/(1-x))` for `|x| < 1`. -/ -@[expose] public section +public section namespace LeanCert.Core @@ -2019,6 +2023,7 @@ theorem Real.atanh_mono {x y : ℝ} (hx : |x| < 1) (hy : |y| < 1) (hxy : x ≤ y /-- The error function: erf(x) = (2/√π) ∫₀ˣ exp(-t²) dt. Essential for statistical and financial modeling (normal distribution CDF). Uses interval integral notation (∫ t in 0..x) which handles negative x correctly. -/ +@[expose] noncomputable def Real.erf (x : ℝ) : ℝ := (2 / Real.sqrt Real.pi) * ∫ t in (0:ℝ)..x, Real.exp (-(t^2)) @@ -2165,6 +2170,7 @@ inductive MathConst where deriving Repr, DecidableEq, Inhabited /-- The real value of a named mathematical constant. -/ +@[expose] noncomputable def MathConst.toReal : MathConst → ℝ | .pi => Real.pi | .eulerMascheroni => Real.eulerMascheroniConstant @@ -2241,6 +2247,7 @@ def pow (e : Expr) : Nat → Expr def abs (e : Expr) : Expr := sqrt (mul e e) /-- Evaluate an expression given a variable assignment ρ : Nat → ℝ -/ +@[expose] noncomputable def eval (ρ : Nat → ℝ) : Expr → ℝ | const q => (q : ℝ) | var idx => ρ idx @@ -2264,6 +2271,7 @@ noncomputable def eval (ρ : Nat → ℝ) : Expr → ℝ | namedConst c => c.toReal /-- Update variable assignment at a specific index -/ +@[expose] def updateVar (ρ : Nat → ℝ) (idx : Nat) (x : ℝ) : Nat → ℝ := fun i => if i = idx then x else ρ i @@ -2670,7 +2678,7 @@ This file collects lemmas and abstractions useful for verified numerics. /-! ### Interval membership and operations -/ -@[expose] public section +public section namespace LeanCert.Core @@ -2768,7 +2776,7 @@ All operations maintain the invariant `lo ≤ hi`. Domain restrictions for parti operations (like `inv`) are encoded via separate types or explicit hypotheses. -/ -@[expose] public section +public section namespace LeanCert.Core @@ -2779,7 +2787,17 @@ structure IntervalRat where /-- Upper endpoint of the interval. -/ hi : ℚ le : lo ≤ hi - deriving Repr, DecidableEq + deriving Repr + +@[expose, instance_reducible, instance] +def instDecidableEqIntervalRat : DecidableEq IntervalRat := fun a b => + if hlo : a.lo = b.lo then + if hhi : a.hi = b.hi then + isTrue (by cases a; cases b; cases hlo; cases hhi; rfl) + else + isFalse (by intro hab; exact hhi (congrArg IntervalRat.hi hab)) + else + isFalse (by intro hab; exact hlo (congrArg IntervalRat.lo hab)) /-- Default interval [0, 0] for unsupported expression branches -/ instance : Inhabited IntervalRat where @@ -2814,6 +2832,7 @@ theorem exists_mem_iff_exists_Icc {P : ℝ → Prop} (I : IntervalRat) : hx, hp⟩ /-- Create an interval from a single rational -/ +@[expose] def singleton (q : ℚ) : IntervalRat := ⟨q, q, le_refl q⟩ theorem mem_singleton (q : ℚ) : (q : ℝ) ∈ singleton q := by @@ -2848,6 +2867,7 @@ theorem midpoint_mem (I : IntervalRat) : (I.midpoint : ℝ) ∈ I := by /-! ### Interval addition -/ /-- Add two intervals -/ +@[expose] def add (I J : IntervalRat) : IntervalRat where lo := I.lo + J.lo hi := I.hi + J.hi @@ -2863,6 +2883,7 @@ theorem mem_add {x y : ℝ} {I J : IntervalRat} (hx : x ∈ I) (hy : y ∈ J) : /-! ### Interval negation -/ /-- Negate an interval -/ +@[expose] def neg (I : IntervalRat) : IntervalRat where lo := -I.hi hi := -I.lo @@ -2877,6 +2898,7 @@ theorem mem_neg {x : ℝ} {I : IntervalRat} (hx : x ∈ I) : -x ∈ neg I := by /-! ### Interval subtraction -/ /-- Subtract two intervals -/ +@[expose] def sub (I J : IntervalRat) : IntervalRat := add I (neg J) /-- FTIA for subtraction -/ @@ -2888,9 +2910,11 @@ theorem mem_sub {x y : ℝ} {I J : IntervalRat} (hx : x ∈ I) (hy : y ∈ J) : /-! ### Interval multiplication -/ /-- Helper: minimum of four rationals -/ +@[expose] def min4 (a b c d : ℚ) : ℚ := min (min a b) (min c d) /-- Helper: maximum of four rationals -/ +@[expose] def max4 (a b c d : ℚ) : ℚ := max (max a b) (max c d) theorem min4_le_all (a b c d : ℚ) : @@ -2920,6 +2944,7 @@ theorem max4_le_iff (x a b c d : ℚ) : simp only [max4, max_le_iff, and_assoc] /-- Multiply two intervals -/ +@[expose] def mul (I J : IntervalRat) : IntervalRat where lo := min4 (I.lo * J.lo) (I.lo * J.hi) (I.hi * J.lo) (I.hi * J.hi) hi := max4 (I.lo * J.lo) (I.lo * J.hi) (I.hi * J.lo) (I.hi * J.hi) @@ -3169,6 +3194,7 @@ theorem mem_mulFast {x y : ℝ} {I J : IntervalRat} (hx : x ∈ I) (hy : y ∈ J /-! ### Interval containing zero check -/ /-- Check if an interval contains zero -/ +@[expose] def containsZero (I : IntervalRat) : Prop := I.lo ≤ 0 ∧ 0 ≤ I.hi /-- Decidable containsZero -/ @@ -3237,6 +3263,7 @@ theorem mem_invNonzero {x : ℝ} {I : IntervalRatNonzero} (hx : x ∈ I.toInterv /-! ### Scalar operations -/ /-- Scale an interval by a rational -/ +@[expose] def scale (q : ℚ) (I : IntervalRat) : IntervalRat := if hq : 0 ≤ q then { lo := q * I.lo @@ -3347,6 +3374,7 @@ theorem mem_default (x : ℝ) : x ∈ (default : IntervalRat) ↔ x = 0 := by /-! ### Interval intersection -/ /-- Intersect two intervals. Returns none if they don't intersect. -/ +@[expose] def intersect (I J : IntervalRat) : Option IntervalRat := let lo := max I.lo J.lo let hi := min I.hi J.hi @@ -3445,7 +3473,7 @@ For m ∈ [1/2, 2], we have (m-1)/(m+1) ∈ [-1/3, 1/3], where atanh converges v /-! ### Argument Reduction -/ -@[expose] public section +public section namespace LeanCert.Core.LogReduction @@ -3711,7 +3739,7 @@ etc. For computable versions, see `IntervalRat.Taylor`. /-! ### Rational enclosure of real intervals -/ -@[expose] public section +public section namespace LeanCert.Core @@ -3744,6 +3772,7 @@ theorem mem_ofRealEndpoints {x lo hi : ℝ} (hle : lo ≤ hi) (hx : lo ≤ x ∧ /-- Interval bound for exp on rational intervals. Since exp is strictly increasing, exp([a,b]) ⊆ [⌊exp(a)⌋, ⌈exp(b)⌉]. This uses Real.exp and floor/ceil to get rational bounds. -/ +@[expose] noncomputable def expInterval (I : IntervalRat) : IntervalRat := ofRealEndpoints (Real.exp I.lo) (Real.exp I.hi) (Real.exp_le_exp.mpr (by exact_mod_cast I.le)) @@ -3761,6 +3790,7 @@ theorem mem_expInterval {x : ℝ} {I : IntervalRat} (hx : x ∈ I) : /-! ### Positive interval check -/ /-- Check if an interval is strictly positive (lo > 0) -/ +@[expose] def isPositive (I : IntervalRat) : Prop := 0 < I.lo /-- Decidable isPositive -/ @@ -4427,7 +4457,7 @@ floor/ceil bounds, which requires noncomputability. /-! ### Core supported expression subset (computable) -/ -@[expose] public section +public section namespace LeanCert.Core @@ -4622,7 +4652,7 @@ with Mathlib's calculus lemmas. /-! ### Taylor approximation structure -/ -@[expose] public section +public section namespace LeanCert.Core @@ -5566,13 +5596,14 @@ The proofs connect these to the real-valued functions via Taylor's theorem. /-! ### Computable Taylor series helpers -/ -@[expose] public section +public section namespace LeanCert.Core namespace IntervalRat /-- Compute n! as a Rational -/ +@[expose] def ratFactorial (n : ℕ) : ℚ := (Nat.factorial n : ℚ) /-- Compute the integer power of an interval using exponentiation by squaring. @@ -5599,12 +5630,14 @@ def absInterval (I : IntervalRat) : IntervalRat := linarith⟩ /-- Maximum absolute value of an interval -/ +@[expose] def maxAbs (I : IntervalRat) : ℚ := max (|I.lo|) (|I.hi|) /-- Evaluate Taylor series ∑_{i=0}^{n} c_i * x^i at interval I using Horner's method. Computes c₀ + I * (c₁ + I * (c₂ + ... + I * cₙ)), which is mathematically equivalent to the direct sum but uses fewer operations and often gives tighter bounds by reducing the dependency problem in interval arithmetic. -/ +@[expose] def evalTaylorSeries (coeffs : List ℚ) (I : IntervalRat) : IntervalRat := coeffs.foldr (fun c acc => add (singleton c) (mul acc I)) (singleton 0) @@ -5765,6 +5798,7 @@ theorem mem_hull_right {x : ℝ} {I J : IntervalRat} (hx : x ∈ J) : x ∈ hull which is tighter than direct Taylor evaluation due to interval widening. This is fully computable using only rational arithmetic. -/ +@[expose] def expComputable (I : IntervalRat) (n : ℕ := 10) : IntervalRat := if I.hi ≤ 0 ∨ 0 ≤ I.lo then -- Interval doesn't cross 0: use endpoint evaluation for tighter bounds @@ -5796,6 +5830,7 @@ theorem expComputableWithCoeffs_eq (I : IntervalRat) (n : ℕ) : /-! ### Computable sin via Taylor series -/ /-- Taylor coefficients for sin: 0, 1, 0, -1/6, 0, 1/120, ... -/ +@[expose] def sinTaylorCoeffs (n : ℕ) : List ℚ := (List.range (n + 1)).map (fun i => if i % 2 = 1 then -- odd terms only @@ -5804,6 +5839,7 @@ def sinTaylorCoeffs (n : ℕ) : List ℚ := /-- Computable sin remainder bound. Since |sin^{(k)}(x)| ≤ 1 for all k, x, the remainder is bounded by |x|^{n+1}/(n+1)! -/ +@[expose] def sinRemainderBoundComputable (I : IntervalRat) (n : ℕ) : IntervalRat := let r := maxAbs I let R := r ^ (n + 1) / ratFactorial (n + 1) @@ -5821,6 +5857,7 @@ def sinRemainderBoundComputable (I : IntervalRat) (n : ℕ) : IntervalRat := where |R| ≤ |x|^{n+1}/(n+1)! since all derivatives of sin are bounded by 1. We intersect with [-1, 1] for tighter bounds on small intervals. -/ +@[expose] def sinComputable (I : IntervalRat) (n : ℕ := 10) : IntervalRat := let coeffs := sinTaylorCoeffs n let polyVal := evalTaylorSeries coeffs I @@ -5849,6 +5886,7 @@ theorem sinComputableWithCoeffs_eq (I : IntervalRat) (n : ℕ) : /-! ### Computable cos via Taylor series -/ /-- Taylor coefficients for cos: 1, 0, -1/2, 0, 1/24, 0, ... -/ +@[expose] def cosTaylorCoeffs (n : ℕ) : List ℚ := (List.range (n + 1)).map (fun i => if i % 2 = 0 then -- even terms only @@ -5857,6 +5895,7 @@ def cosTaylorCoeffs (n : ℕ) : List ℚ := /-- Computable cos remainder bound. Since |cos^{(k)}(x)| ≤ 1 for all k, x, the remainder is bounded by |x|^{n+1}/(n+1)! -/ +@[expose] def cosRemainderBoundComputable (I : IntervalRat) (n : ℕ) : IntervalRat := let r := maxAbs I let R := r ^ (n + 1) / ratFactorial (n + 1) @@ -5874,6 +5913,7 @@ def cosRemainderBoundComputable (I : IntervalRat) (n : ℕ) : IntervalRat := where |R| ≤ |x|^{n+1}/(n+1)! since all derivatives of cos are bounded by 1. We intersect with [-1, 1] for tighter bounds on small intervals. -/ +@[expose] def cosComputable (I : IntervalRat) (n : ℕ := 10) : IntervalRat := let coeffs := cosTaylorCoeffs n let polyVal := evalTaylorSeries coeffs I @@ -5947,6 +5987,7 @@ theorem coshPointComputable_lo_ge_one (q : ℚ) (n : ℕ) : 1 ≤ (coshPointComp sinh(x) = (exp(x) - exp(-x)) / 2 Since sinh is strictly monotone increasing, sinh([a,b]) = [sinh(a), sinh(b)]. We use endpoint evaluation for tight bounds. -/ +@[expose] def sinhComputable (I : IntervalRat) (n : ℕ := 10) : IntervalRat := -- sinh is strictly monotone increasing, so evaluate at endpoints let sinhLo := sinhPointComputable I.lo n @@ -5961,6 +6002,7 @@ def sinhComputable (I : IntervalRat) (n : ℕ := 10) : IntervalRat := - cosh is increasing on [0, ∞) We use endpoint evaluation with monotonicity for tight bounds. -/ +@[expose] def coshComputable (I : IntervalRat) (n : ℕ := 10) : IntervalRat := let coshLo := coshPointComputable I.lo n let coshHi := coshPointComputable I.hi n @@ -7794,7 +7836,7 @@ All operations maintain the invariant `lo ≤ hi`. Domain restrictions for parti operations (like `inv`) are encoded via separate types or explicit hypotheses. -/ -@[expose] public section +public section end @@ -7839,7 +7881,7 @@ In v1.1, with `precision = -10`, the denominator stays fixed at 2^10 = 1024. The result is slightly less tight but computed significantly faster. -/ -@[expose] public section +public section namespace LeanCert.Core @@ -7873,6 +7915,7 @@ theorem mem_def (x : ℝ) (I : IntervalDyadic) : /-! ### Conversion to IntervalRat -/ /-- Convert to IntervalRat for verification with existing theorems -/ +@[expose] def toIntervalRat (I : IntervalDyadic) : IntervalRat := ⟨I.lo.toRat, I.hi.toRat, I.le⟩ @@ -7884,6 +7927,7 @@ theorem mem_toIntervalRat {x : ℝ} {I : IntervalDyadic} : /-! ### Construction -/ /-- Create a singleton interval from a Dyadic -/ +@[expose] def singleton (d : Dyadic) : IntervalDyadic := ⟨d, d, le_refl _⟩ /-- A Dyadic value is in its singleton interval -/ @@ -8071,6 +8115,7 @@ theorem mem_add {x y : ℝ} {I J : IntervalDyadic} (hx : x ∈ I) (hy : y ∈ J) constructor <;> linarith /-- Add with precision control -/ +@[expose] def addRounded (I J : IntervalDyadic) (prec : Int := -53) : IntervalDyadic := (add I J).roundOut prec @@ -8369,6 +8414,7 @@ theorem mem_mulFast {x y : ℝ} {I J : IntervalDyadic} (hx : x ∈ I) (hy : y · rw [mulFast_hi]; exact (mem_mul hx hy).2 /-- Multiply with precision control (outward rounding) -/ +@[expose] def mulRounded (I J : IntervalDyadic) (prec : Int := -53) : IntervalDyadic := (mul I J).roundOut prec @@ -8643,7 +8689,7 @@ Typical workflow: 3. Use mathlib's analysis lemmas directly on real intervals -/ -@[expose] public section +public section namespace LeanCert.Core @@ -9075,7 +9121,7 @@ Taylor-model trigonometric evaluators. /-! ### Rational approximations of π and 2π -/ -@[expose] public section +public section namespace LeanCert.Core.TrigReduction @@ -9242,7 +9288,7 @@ faster since |x - 2πk| ≤ π ≈ 3.14. /-! ### Shared range-reduction API -/ -@[expose] public section +public section namespace LeanCert.Core.IntervalRat @@ -9380,7 +9426,7 @@ For inv: computes bounds using `invInterval`, but correctness is not covered by `evalIntervalCore_correct`. Use `evalIntervalOption` for inv. -/ -@[expose] public section +public section namespace LeanCert.Engine @@ -9396,6 +9442,7 @@ export LeanCert.Core (ExprSupportedCore ADSupported) /-- Simple interval bound for sin. Since |sin x| ≤ 1 for all x, we use the global bound [-1, 1]. This is sound but not tight. -/ +@[expose] def sinInterval (_I : IntervalRat) : IntervalRat := ⟨-1, 1, by norm_num⟩ @@ -9411,6 +9458,7 @@ theorem mem_sinInterval {x : ℝ} {I : IntervalRat} (_hx : x ∈ I) : /-- Simple interval bound for cos. Since |cos x| ≤ 1 for all x, we use the global bound [-1, 1]. This is sound but not tight. -/ +@[expose] def cosInterval (_I : IntervalRat) : IntervalRat := ⟨-1, 1, by norm_num⟩ @@ -9426,6 +9474,7 @@ theorem mem_cosInterval {x : ℝ} {I : IntervalRat} (_hx : x ∈ I) : /-- Simple interval bound for atan. Since atan x ∈ (-π/2, π/2) for all x, we use the global bound [-2, 2]. This is sound but not tight (π/2 ≈ 1.57). -/ +@[expose] def atanInterval (_I : IntervalRat) : IntervalRat := ⟨-2, 2, by norm_num⟩ @@ -9623,6 +9672,7 @@ theorem mem_erfInterval {x : ℝ} {I : IntervalRat} (hx : x ∈ I) (n : ℕ := 1 /-- Simple interval bound for arsinh. arsinh is unbounded, so we use a very rough linear bound. We use max(|lo|, |hi|) + 1 as a safe bound that always works. -/ +@[expose] def arsinhInterval (I : IntervalRat) : IntervalRat := let bound := max (abs I.lo) (abs I.hi) + 1 ⟨-bound, bound, by @@ -9737,6 +9787,7 @@ theorem mem_tanhInterval {x : ℝ} {I : IntervalRat} (_hx : x ∈ I) : /-- Interval enclosure for π. Uses tight bounds from Mathlib's pi_gt_d20 and pi_lt_d20 which give 20 decimal digits. 3.14159265358979323846 < π < 3.14159265358979323847 -/ +@[expose] def piInterval : IntervalRat := -- Use rational approximation: 31415926535897932/10000000000000000 ≤ pi ≤ -- 31415926535897933/10000000000000000 @@ -9861,6 +9912,7 @@ open LeanCert.Engine /-- Centralized interval lookup for named mathematical constants. Extending this table is the ONLY change needed to add a new constant. -/ +@[expose] def interval : MathConst → IntervalRat | .pi => piInterval | .eulerMascheroni => eulerMascheroniInterval @@ -9879,12 +9931,14 @@ open LeanCert.Core /-- Interval bound for sinh using computable Taylor series for exp. sinh(x) = (exp(x) - exp(-x)) / 2, and sinh is strictly monotonic. This computes tight bounds using the verified exp implementation. -/ +@[expose] def sinhInterval (I : IntervalRat) (taylorDepth : ℕ := 10) : IntervalRat := IntervalRat.sinhComputable I taylorDepth /-- Interval bound for cosh using computable Taylor series for exp. cosh(x) = (exp(x) + exp(-x)) / 2, with minimum 1 at x = 0. This computes tight bounds using the verified exp implementation. -/ +@[expose] def coshInterval (I : IntervalRat) (taylorDepth : ℕ := 10) : IntervalRat := IntervalRat.coshComputable I taylorDepth @@ -10110,6 +10164,7 @@ namespace LeanCert.Engine open LeanCert.Core /-- A real environment is contained in an interval environment -/ +@[expose] def envMem (ρ_real : Nat → ℝ) (ρ_int : IntervalEnv) : Prop := ∀ i, ρ_real i ∈ ρ_int i @@ -10144,6 +10199,7 @@ def evalDomainValid (e : Expr) (ρ : IntervalEnv) (cfg : EvalConfig := {}) : Pro | Expr.namedConst _ => True /-- Single-variable domain validity -/ +@[expose] def evalDomainValid1 (e : Expr) (I : IntervalRat) (cfg : EvalConfig := {}) : Prop := evalDomainValid e (fun _ => I) cfg @@ -10519,7 +10575,7 @@ instead of substituting a finite sentinel that could be mistaken for an enclosure. -/ -@[expose] public section +public section namespace LeanCert.Engine @@ -10580,7 +10636,7 @@ When it returns `some I`, correctness is guaranteed. /-! ### Extended interval evaluation (noncomputable, supports exp) -/ -@[expose] public section +public section namespace LeanCert.Engine @@ -11144,7 +11200,7 @@ The extended lemmas use the noncomputable evaluator with floor/ceil bounds. /-! ### Tactic-facing lemmas for interval bounds (core, computable) -/ -@[expose] public section +public section namespace LeanCert.Engine @@ -11353,7 +11409,7 @@ The evaluators are split by computability: - Both are fully verified (no sorry, no axioms) -/ -@[expose] public section +public section namespace LeanCert.Engine @@ -11391,7 +11447,7 @@ automatic differentiation using interval arithmetic. * `DualInterval.neg` - Negation -/ -@[expose] public section +public section namespace LeanCert.Engine @@ -11412,6 +11468,7 @@ instance : Inhabited DualInterval where namespace DualInterval /-- Dual interval for a constant (derivative is zero) -/ +@[expose] def const (q : ℚ) : DualInterval := { val := IntervalRat.singleton q der := IntervalRat.singleton 0 } @@ -11427,26 +11484,31 @@ def eulerMascheroniConst : DualInterval := der := IntervalRat.singleton 0 } /-- Dual interval for a named mathematical constant (derivative is zero) -/ +@[expose] def ofMathConst (c : MathConst) : DualInterval := { val := c.interval der := IntervalRat.singleton 0 } /-- Dual interval for the variable we're differentiating with respect to -/ +@[expose] def varActive (I : IntervalRat) : DualInterval := { val := I der := IntervalRat.singleton 1 } /-- Dual interval for a passive variable -/ +@[expose] def varPassive (I : IntervalRat) : DualInterval := { val := I der := IntervalRat.singleton 0 } /-- Add two dual intervals -/ +@[expose] def add (d₁ d₂ : DualInterval) : DualInterval := { val := IntervalRat.add d₁.val d₂.val der := IntervalRat.add d₁.der d₂.der } /-- Multiply two dual intervals (product rule) -/ +@[expose] def mul (d₁ d₂ : DualInterval) : DualInterval := { val := IntervalRat.mul d₁.val d₂.val -- d(f*g) = f'*g + f*g' @@ -11455,6 +11517,7 @@ def mul (d₁ d₂ : DualInterval) : DualInterval := (IntervalRat.mul d₁.val d₂.der) } /-- Negate a dual interval -/ +@[expose] def neg (d : DualInterval) : DualInterval := { val := IntervalRat.neg d.val der := IntervalRat.neg d.der } @@ -11510,7 +11573,7 @@ implementing the chain rule for each. * `DualInterval.sqrt?` - Square root with tight bounds (requires positive) -/ -@[expose] public section +public section namespace LeanCert.Engine @@ -11519,16 +11582,19 @@ open LeanCert.Core namespace DualInterval /-- Dual for sin (chain rule: d(sin f) = cos(f) * f') -/ +@[expose] def sin (d : DualInterval) : DualInterval := { val := sinInterval d.val der := IntervalRat.mul (cosInterval d.val) d.der } /-- Dual for cos (chain rule: d(cos f) = -sin(f) * f') -/ +@[expose] def cos (d : DualInterval) : DualInterval := { val := cosInterval d.val der := IntervalRat.mul (IntervalRat.neg (sinInterval d.val)) d.der } /-- Dual for exp (chain rule: d(exp f) = exp(f) * f') -/ +@[expose] noncomputable def exp (d : DualInterval) : DualInterval := { val := IntervalRat.expInterval d.val der := IntervalRat.mul (IntervalRat.expInterval d.val) d.der } @@ -11562,6 +11628,7 @@ theorem arsinh_deriv_factor_mem_unitInterval (y : ℝ) : · exact inv_le_one_of_one_le₀ hsqrt_ge_one /-- Dual for atan (chain rule: d(atan f) = f' / (1 + f²)) -/ +@[expose] def atan (d : DualInterval) : DualInterval := { val := atanInterval d.val -- d(atan f) = f' / (1 + f²) @@ -11569,6 +11636,7 @@ def atan (d : DualInterval) : DualInterval := der := IntervalRat.mul d.der unitInterval } /-- Dual for arsinh (chain rule: d(arsinh f) = f' / √(1 + f²)) -/ +@[expose] def arsinh (d : DualInterval) : DualInterval := { val := arsinhInterval d.val -- d(arsinh f) = f' / √(1 + f²) @@ -11576,12 +11644,14 @@ def arsinh (d : DualInterval) : DualInterval := der := IntervalRat.mul d.der unitInterval } /-- Dual for sinh (chain rule: d(sinh f) = cosh(f) * f') -/ +@[expose] def sinh (d : DualInterval) : DualInterval := { val := sinhInterval d.val -- sinh'(x) = cosh(x), so d(sinh f) = cosh(f) * f' der := IntervalRat.mul (coshInterval d.val) d.der } /-- Dual for cosh (chain rule: d(cosh f) = sinh(f) * f') -/ +@[expose] def cosh (d : DualInterval) : DualInterval := { val := coshInterval d.val -- cosh'(x) = sinh(x), so d(cosh f) = sinh(f) * f' @@ -11595,11 +11665,13 @@ def tanh (d : DualInterval) : DualInterval := der := IntervalRat.mul d.der unitInterval } /-- Interval containing 2/√π ≈ 1.128379... -/ +@[expose] def twoDivSqrtPi : IntervalRat := ⟨1128/1000, 1129/1000, by norm_num⟩ /-- Dual for erf (chain rule: d(erf f) = (2/√π) * exp(-f²) * f') erf'(x) = (2/√π) * exp(-x²), which is always positive and bounded by 2/√π ≈ 1.13 -/ +@[expose] noncomputable def erf (d : DualInterval) : DualInterval := { val := ⟨-1, 1, by norm_num⟩ -- erf is bounded in [-1, 1] der := @@ -11630,11 +11702,13 @@ def sqrt (d : DualInterval) : DualInterval := der := IntervalRat.mul d.der ⟨-100, 100, by norm_num⟩ } /-- Conservative derivative bound [-1, 1] for sinc derivative -/ +@[expose] def sincDerivBound : IntervalRat := ⟨-1, 1, by norm_num⟩ /-- Dual for sinc (chain rule: d(sinc f) = sinc'(f) * f') sinc'(x) = (x cos x - sin x) / x² for x ≠ 0, limit 0 at x = 0. We use conservative bound: |sinc'(x)| ≤ 1 for all x. -/ +@[expose] def sinc (d : DualInterval) : DualInterval := { val := ⟨-1, 1, by norm_num⟩ -- sinc is bounded in [-1, 1] -- sinc'(x) ∈ [-1, 1] (conservative bound), so d(sinc f) = sinc'(f) * f' @@ -11665,6 +11739,7 @@ noncomputable def atanhOption (d : DualInterval) : Option DualInterval := /-- Partial dual for inv (chain rule: d(1/f) = -f'/f²) Returns None if the value interval contains zero. -/ +@[expose] def inv? (d : DualInterval) : Option DualInterval := if h : IntervalRat.containsZero d.val then none @@ -11677,6 +11752,7 @@ def inv? (d : DualInterval) : Option DualInterval := /-- Partial dual for log (chain rule: d(log f) = f'/f) Returns None if the value interval is not strictly positive. -/ +@[expose] noncomputable def logOption (d : DualInterval) : Option DualInterval := if h : IntervalRat.isPositive d.val then let log_val := IntervalRat.logInterval ⟨d.val, h⟩ @@ -11695,6 +11771,7 @@ noncomputable def logOption (d : DualInterval) : Option DualInterval := Uses the fact that: - For 0 < lo ≤ 1: sqrt(lo) ≥ lo, so 1/(2*sqrt(lo)) ≤ 1/(2*lo) - For lo > 1: sqrt(lo) > 1, so 1/(2*sqrt(lo)) < 1/2 -/ +@[expose] def sqrtDerivCoefBound (lo : ℚ) (hpos : 0 < lo) : IntervalRat := if lo ≤ 1 then ⟨0, 1 / (2 * lo), by @@ -11756,6 +11833,7 @@ theorem sqrtDerivCoef_bound {x lo : ℝ} (hlo_pos : 0 < lo) (hx_ge : lo ≤ x) : /-- Partial dual for sqrt (chain rule: d(sqrt f) = f' / (2 * sqrt(f))) Returns None if the value interval is not strictly positive. -/ +@[expose] noncomputable def sqrt? (d : DualInterval) : Option DualInterval := if h : IntervalRat.isPositive d.val then let sqrt_val := IntervalRat.sqrtInterval d.val @@ -11801,7 +11879,7 @@ mapping expressions to dual intervals. /-! ### Dual evaluation -/ -@[expose] public section +public section namespace LeanCert.Engine @@ -11867,6 +11945,7 @@ open LeanCert.Core Option-returning evaluator deliberately keeps `tanh` disabled until the `evalDualOption`-specific value/differentiability/derivative correctness path is wired for that constructor. -/ +@[expose] noncomputable def evalDualOption (e : Expr) (ρ : DualEnv) : Option DualInterval := match e with | Expr.const q => some (DualInterval.const q) @@ -11944,12 +12023,14 @@ noncomputable def evalDualOption (e : Expr) (ρ : DualEnv) : Option DualInterval | Expr.namedConst c => some (DualInterval.ofMathConst c) /-- Single-variable version of evalDualOption -/ +@[expose] noncomputable def evalDualOption1 (e : Expr) (I : IntervalRat) : Option DualInterval := evalDualOption e (fun _ => DualInterval.varActive I) /-! ### Single variable differentiation -/ /-- Create dual environment for differentiating with respect to variable `idx` -/ +@[expose] def mkDualEnv (ρ : IntervalEnv) (idx : Nat) : DualEnv := fun i => if i = idx then DualInterval.varActive (ρ i) else DualInterval.varPassive (ρ i) @@ -11962,6 +12043,7 @@ noncomputable def derivInterval (e : Expr) (ρ : IntervalEnv) (idx : Nat) : Inte (evalWithDeriv e ρ idx).der /-- Evaluate and differentiate a single-variable expression -/ +@[expose] noncomputable def evalWithDeriv1 (e : Expr) (I : IntervalRat) : DualInterval := LeanCert.Internal.AD.evalUnchecked e (fun _ => DualInterval.varActive I) @@ -12001,7 +12083,7 @@ The correctness relies on the chain rule for each supported operation. /-! ### Correctness -/ -@[expose] public section +public section namespace LeanCert.Engine @@ -12617,7 +12699,7 @@ approximations for transcendental functions. This enables `native_decide` for derivative-based bound checking. -/ -@[expose] public section +public section namespace LeanCert.Engine @@ -12627,17 +12709,20 @@ open scoped Topology namespace DualInterval /-- Computable dual for exp using Taylor series (chain rule: d(exp f) = exp(f) * f') -/ +@[expose] def expCore (d : DualInterval) (n : ℕ := 10) : DualInterval := let expVal := IntervalRat.expComputable d.val n { val := expVal der := IntervalRat.mul expVal d.der } /-- Computable dual for sin using Taylor series -/ +@[expose] def sinCore (d : DualInterval) (n : ℕ := 10) : DualInterval := { val := IntervalRat.sinComputable d.val n der := IntervalRat.mul (IntervalRat.cosComputable d.val n) d.der } /-- Computable dual for cos using Taylor series -/ +@[expose] def cosCore (d : DualInterval) (n : ℕ := 10) : DualInterval := { val := IntervalRat.cosComputable d.val n der := IntervalRat.mul (IntervalRat.neg (IntervalRat.sinComputable d.val n)) d.der } @@ -12683,6 +12768,7 @@ open LeanCert.Core LeanCert.Engine `evalDualDyadicChecked`; they validate the actual input box before exposing this total kernel's result. Correctness is not claimed for unchecked partial-operation branches here. -/ +@[expose] def evalTotalCore (e : Expr) (ρ : DualEnv) (cfg : EvalConfig := {}) : DualInterval := match e with | Expr.const q => DualInterval.const q @@ -12725,6 +12811,7 @@ def derivIntervalCore (e : Expr) (I : IntervalRat) (cfg : EvalConfig := {}) : In /-- Domain validity for dual evaluation. This is defined directly in terms of LeanCert.Internal.AD.evalTotalCore to ensure compatibility. For log, we require the argument interval to have positive lower bound. -/ +@[expose] def evalDomainValidDual (e : Expr) (ρ : DualEnv) (cfg : EvalConfig := {}) : Prop := match e with | Expr.const _ => True @@ -12996,7 +13083,7 @@ the domain-free fast path. Here, successful evaluation itself certifies both syntactic support and every partial-domain side condition. -/ -@[expose] public section +public section namespace LeanCert.Engine diff --git a/LeanPool/MovingSofa/Development/IntervalArithmetic/Foundations/Development002.lean b/LeanPool/MovingSofa/Development/IntervalArithmetic/Foundations/Development002.lean index f1b0bd6235..c6a5fee777 100644 --- a/LeanPool/MovingSofa/Development/IntervalArithmetic/Foundations/Development002.lean +++ b/LeanPool/MovingSofa/Development/IntervalArithmetic/Foundations/Development002.lean @@ -38,7 +38,7 @@ public import Mathlib.Topology.MetricSpace.Contracting * `LeanCert.Engine.RootFinding.Krawczyk`. -/ -@[expose] public section +public section noncomputable section @@ -73,7 +73,7 @@ constraints (nonzero for inv, positive for log) are satisfied. /-! ### Correctness of partial dual evaluator -/ -@[expose] public section +public section namespace LeanCert.Engine @@ -1027,7 +1027,7 @@ gaining the performance benefits of Dyadic for polynomial operations. /-! ### Configuration -/ -@[expose] public section +public section namespace LeanCert.Engine @@ -1408,6 +1408,7 @@ structure PreparedContext where deriving Repr /-- Deterministically prepare all configuration-dependent numerical data. -/ +@[expose] def prepareContext (cfg : DyadicConfig) : PreparedContext := { cfg ln2 := IntervalRat.ln2Computable cfg.taylorDepth @@ -2044,7 +2045,7 @@ logarithm domains, and positive rounding precisions return `EvalError` rather than a finite interval. -/ -@[expose] public section +public section namespace LeanCert.Engine @@ -2769,7 +2770,7 @@ expressions All theorems are FULLY PROVED with no sorry or axioms. -/ -@[expose] public section +public section end @@ -2810,7 +2811,7 @@ for out-of-bounds indices. /-! ### Box type and basic operations -/ -@[expose] public section +public section namespace LeanCert.Engine.Optimization @@ -3117,7 +3118,7 @@ Branch-and-bound with the following pruning rules: /-! ### Optimization result -/ -@[expose] public section +public section namespace LeanCert.Engine @@ -3175,6 +3176,7 @@ Returns an interval [lo, hi] such that: - lo ≤ min_{x ∈ I} f(x) - hi ≥ min_{x ∈ I} f(x) -/ +@[expose] noncomputable def minimizeInterval (e : Expr) (I : IntervalRat) (varIdx : Nat) (maxDepth : ℕ) : OptResult := go I maxDepth @@ -3628,6 +3630,7 @@ Returns an interval [lo, hi] such that for any ρ_real with ρ_real i ∈ ρ i: - lo ≤ min_{t ∈ ρ idx} evalAlong e ρ_real idx t - hi ≥ min_{t ∈ ρ idx} evalAlong e ρ_real idx t -/ +@[expose] noncomputable def minimizeIntervalIdx (e : Expr) (ρ : IntervalEnv) (idx : Nat) (maxDepth : ℕ) : OptResult := go (ρ idx) maxDepth @@ -3956,7 +3959,7 @@ when xᵢ = B[i].lo. We can shrink the box in that dimension to a point. /-! ### Gradient computation -/ -@[expose] public section +public section namespace LeanCert.Engine.Optimization @@ -3976,16 +3979,19 @@ noncomputable def gradientIntervalN (e : Expr) (B : Box) (n : Nat) : List Interv /-- Create dual environment for differentiating with respect to variable `idx` (computable). Active variable gets der = 1, passive variables get der = 0. -/ +@[expose] def mkDualEnvCore (ρ : IntervalEnv) (idx : Nat) : DualEnv := fun i => if i = idx then DualInterval.varActive (ρ i) else DualInterval.varPassive (ρ i) /-- Evaluate with derivative with respect to variable `idx` (computable version) -/ +@[expose] def evalWithDerivCore (e : Expr) (ρ : IntervalEnv) (idx : Nat) (cfg : EvalConfig := {}) : DualInterval := LeanCert.Internal.AD.evalTotalCore e (mkDualEnvCore ρ idx) cfg /-- Computable derivative interval for multi-variable expressions. Computes the interval containing ∂f/∂xᵢ over the box. -/ +@[expose] def derivIntervalCoreN (e : Expr) (ρ : IntervalEnv) (idx : Nat) (cfg : EvalConfig := {}) : IntervalRat := (evalWithDerivCore e ρ idx cfg).der @@ -4826,7 +4832,7 @@ The golden theorem `krawczykCheck_sound` turns a successful Boolean check into existence and uniqueness of a real root in the supplied box. -/ -@[expose] public section +public section namespace LeanCert.Engine open LeanCert.Core @@ -4857,10 +4863,12 @@ local instance : AddCommMonoid IntervalRat := rfl (fun _ _ => rfl) (fun _ _ => rfl) /-- Extend a finite real coordinate vector to an expression environment with zero defaults. -/ +@[expose] noncomputable def finEnv {n : Nat} (x : Fin n → ℝ) : Nat → ℝ := fun i => if h : i < n then x ⟨i, h⟩ else 0 /-- Evaluate an expression in the environment of a finite real coordinate vector. -/ +@[expose] noncomputable def evalFin {n : Nat} (e : Expr) (x : Fin n → ℝ) : ℝ := Expr.eval (finEnv x) e @@ -4930,6 +4938,7 @@ theorem fderiv_single_eq_deriv_evalAlong {n : Nat} (e : Expr) (h : ADSupported e exact hcomp.deriv.symm /-- Evaluate all coordinate expressions of a finite system. -/ +@[expose] noncomputable def systemEval {n : Nat} (F : Fin n → Expr) (x : Fin n → ℝ) : Fin n → ℝ := fun i => evalFin (F i) x @@ -4940,6 +4949,7 @@ theorem systemEval_differentiable {n : Nat} (F : Fin n → Expr) exact evalFin_differentiable (F i) (h i) /-- The matrix of coordinate partial derivatives of an expression system. -/ +@[expose] noncomputable def jacobianAt {n : Nat} (F : Fin n → Expr) (x : Fin n → ℝ) : Matrix (Fin n) (Fin n) ℝ := LinearMap.toMatrix' (fderiv ℝ (systemEval F) x).toLinearMap @@ -4957,14 +4967,17 @@ theorem jacobianAt_apply {n : Nat} (F : Fin n → Expr) (h : ∀ i, ADSupported exact fderiv_single_eq_deriv_evalAlong (F i) (h i) x j /-- Extend a finite interval box to the evaluator’s indexed environment. -/ +@[expose] def finBoxEnv {n : Nat} (X : Fin n → IntervalRat) : IntervalEnv := fun i => if h : i < n then X ⟨i, h⟩ else IntervalRat.singleton 0 /-- Coordinatewise membership of a real vector in a rational interval box. -/ +@[expose] def FinBoxMem {n : Nat} (x : Fin n → ℝ) (X : Fin n → IntervalRat) : Prop := ∀ i, x i ∈ X i /-- Enclose the Jacobian entries by interval automatic differentiation. -/ +@[expose] def intervalJacobian {n : Nat} (F : Fin n → Expr) (X : Fin n → IntervalRat) (cfg : EvalConfig := {}) : Matrix (Fin n) (Fin n) IntervalRat := fun i j => Optimization.derivIntervalCoreN (F i) (finBoxEnv X) j.val cfg @@ -4986,11 +4999,13 @@ theorem jacobianAt_mem_intervalJacobian {n : Nat} (F : Fin n → Expr) simpa only [finBoxEnv, j.isLt, dite_true] using hx j) cfg /-- Interpret a real matrix as a continuous linear map on finite coordinate vectors. -/ +@[expose] noncomputable def matrixCLM {n : Nat} (A : Matrix (Fin n) (Fin n) ℝ) : (Fin n → ℝ) →L[ℝ] (Fin n → ℝ) := ContinuousLinearMap.mk (Matrix.mulVecLin A) /-- The preconditioned Newton map `x ↦ x - Y (F x)`. -/ +@[expose] noncomputable def newtonMap {n : Nat} (Y : Matrix (Fin n) (Fin n) ℝ) (F : Fin n → Expr) (x : Fin n → ℝ) : Fin n → ℝ := x - Matrix.mulVec Y (systemEval F x) @@ -5030,6 +5045,7 @@ theorem newtonMap_fderiv_matrix {n : Nat} (Y : Matrix (Fin n) (Fin n) ℝ) rfl /-- The set of real vectors lying coordinatewise in the interval box. -/ +@[expose] def finBoxSet {n : Nat} (X : Fin n → IntervalRat) : Set (Fin n → ℝ) := {x | FinBoxMem x X} @@ -5100,15 +5116,18 @@ theorem contraction_unique_fixedPoint_in_finBox {n : Nat} open scoped Matrix.Norms.Operator /-- The identity matrix represented by singleton rational intervals. -/ +@[expose] def intervalIdentity {n : Nat} : Matrix (Fin n) (Fin n) IntervalRat := fun i j => IntervalRat.singleton (if i = j then 1 else 0) /-- Multiply a rational matrix by an interval matrix using interval sums. -/ +@[expose] def ratMulInterval {n : Nat} (Y : Matrix (Fin n) (Fin n) ℚ) (J : Matrix (Fin n) (Fin n) IntervalRat) : Matrix (Fin n) (Fin n) IntervalRat := fun i j => ∑ k, IntervalRat.scale (Y i k) (J k j) /-- The interval matrix `I - Y J` enclosing the Newton-map derivative. -/ +@[expose] def preconditionedJacobian {n : Nat} (Y : Matrix (Fin n) (Fin n) ℚ) (J : Matrix (Fin n) (Fin n) IntervalRat) : Matrix (Fin n) (Fin n) IntervalRat := fun i j => IntervalRat.sub (intervalIdentity i j) (ratMulInterval Y J i j) @@ -5152,13 +5171,16 @@ theorem mem_preconditionedJacobian {n : Nat} (Y : Matrix (Fin n) (Fin n) ℚ) · exact mem_ratMulInterval Y Jreal J hJ i j /-- The larger absolute endpoint, bounding absolute values in the interval. -/ +@[expose] def intervalAbsBound (I : IntervalRat) : ℚ := max |I.lo| |I.hi| /-- The sum of absolute interval bounds in a selected matrix row. -/ +@[expose] def intervalMatrixRowBound {n : Nat} (A : Matrix (Fin n) (Fin n) IntervalRat) (i : Fin n) : ℚ := ∑ j, intervalAbsBound (A i j) /-- The maximum interval row sum, bounding the matrix’s sup-norm operator norm. -/ +@[expose] def intervalMatrixBound {n : Nat} (A : Matrix (Fin n) (Fin n) IntervalRat) : ℚ := (List.ofFn fun i => intervalMatrixRowBound A i).foldl max 0 @@ -5241,6 +5263,7 @@ theorem newtonMap_fderiv_norm_le {n : Nat} (Y : Matrix (Fin n) (Fin n) ℚ) (jacobianAt_mem_intervalJacobian F h X x hx cfg) /-- Represent a rational center by singleton intervals in the evaluation environment. -/ +@[expose] def pointIntervalEnv {n : Nat} (m : Fin n → ℚ) : IntervalEnv := fun i => if h : i < n then IntervalRat.singleton (m ⟨i, h⟩) else IntervalRat.singleton 0 @@ -5289,10 +5312,12 @@ theorem newtonMap_center_mem {n : Nat} (F : Fin n → Expr) (systemEval_mem_pointEvalIntervals F h m cfg j)) /-- The greater endpoint distance from the center in a selected coordinate. -/ +@[expose] def coordinateRadius {n : Nat} (X : Fin n → IntervalRat) (m : Fin n → ℚ) (i : Fin n) : ℚ := max (m i - (X i).lo) ((X i).hi - m i) /-- The maximum coordinate radius of the box around the chosen center. -/ +@[expose] def boxRadius {n : Nat} (X : Fin n → IntervalRat) (m : Fin n → ℚ) : ℚ := (List.ofFn fun i => coordinateRadius X m i).foldl max 0 @@ -5333,6 +5358,7 @@ theorem norm_sub_center_le_boxRadius {n : Nat} {X : Fin n → IntervalRat} · exact_mod_cast boxRadius_nonneg X m /-- The rational interval with endpoints `-d` and `d`. -/ +@[expose] def symmetricInterval (d : ℚ) : IntervalRat := { lo := -|d| hi := |d| @@ -5347,6 +5373,7 @@ def newtonImageEnclosure {n : Nat} (F : Fin n → Expr) (X : Fin n → IntervalR fun i => IntervalRat.add (newtonCenterInterval F m Y cfg i) (symmetricInterval (q * r)) /-- Test whether both endpoints lie strictly inside another interval. -/ +@[expose] def intervalStrictInside (I X : IntervalRat) : Bool := X.lo < I.lo && I.hi < X.hi theorem intervalStrictInside_sound {I X : IntervalRat} (h : intervalStrictInside I X = true) : @@ -5407,6 +5434,7 @@ structure KrawczykCert (n : Nat) where preconditioner : Matrix (Fin n) (Fin n) ℚ /-- Coordinatewise containment of the rational center in the interval box. -/ +@[expose] def centerInside {n : Nat} (X : Fin n → IntervalRat) (m : Fin n → ℚ) : Prop := ∀ i, (X i).lo ≤ m i ∧ m i ≤ (X i).hi @@ -5428,6 +5456,7 @@ def krawczykCheck {n : Nat} (F : Fin n → Expr) (X : Fin n → IntervalRat) (newtonImageEnclosure F X cert.center cert.preconditioner cfg i) (X i) = true) /-- Every expression in the finite system evaluates to zero at the given point. -/ +@[expose] def SystemZero {n : Nat} (F : Fin n → Expr) (x : Fin n → ℝ) : Prop := ∀ i, evalFin (F i) x = 0 diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/Core/Bundle001.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/Core/Bundle001.lean index ca67023775..641f8840e9 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/Core/Bundle001.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/Core/Bundle001.lean @@ -26,7 +26,7 @@ public import Mathlib.Topology.Instances.Real.Lemmas * `GerverSofa.Foundation.Batch001`. -/ -@[expose] public section +public section noncomputable section @@ -47,7 +47,7 @@ Authors: Dawid Trela * `ExactReplay`. -/ -@[expose] public section +public section noncomputable section @@ -60,7 +60,7 @@ This file fixes the exact hallway convention used by the manuscript. The inner quadrant is open, so contact with an inner wall is allowed. -/ -@[expose] public section +public section namespace GerverSofa @@ -68,22 +68,27 @@ namespace GerverSofa abbrev Point := ℝ × ℝ /-- Horizontal unit-width arm `(-∞,1] × [0,1]`. -/ +@[expose] def horizontalArm : Set Point := {p | p.1 ≤ 1 ∧ 0 ≤ p.2 ∧ p.2 ≤ 1} /-- Vertical unit-width arm `[0,1] × (-∞,1]`. -/ +@[expose] def verticalArm : Set Point := {p | 0 ≤ p.1 ∧ p.1 ≤ 1 ∧ p.2 ≤ 1} /-- Closed outer quarter-plane `(-∞,1]²`. -/ +@[expose] def outerQuarter : Set Point := {p | p.1 ≤ 1 ∧ p.2 ≤ 1} /-- Open inner quarter-plane `(-∞,0)²`. -/ +@[expose] def innerQuarter : Set Point := {p | p.1 < 0 ∧ p.2 < 0} /-- The standard unit right-angled hallway. -/ +@[expose] def hallway : Set Point := horizontalArm ∪ verticalArm /-- Quarter-plane presentation of the standard hallway. -/ @@ -133,7 +138,7 @@ Taylor bounds for `sin`/`cos`, a certified interval Jacobian and the general Krawczyk theorem. No global axiom is introduced here. -/ -@[expose] public section +public section namespace GerverSofa @@ -154,6 +159,7 @@ theorem CertifiedUniqueSolution.unique {α : Type*} {P : α → Prop} {X : Set abbrev Vec (n : Nat) := Fin n → ℝ /-- A unique zero of a vector-valued function in a set. -/ +@[expose] def CertifiedUniqueZero {n : Nat} (F : Vec n → Vec n) (X : Set (Vec n)) := CertifiedUniqueSolution (fun x => F x = 0) X @@ -174,7 +180,7 @@ transcendental expression is enclosed; that analytic soundness is a distinct proof obligation. -/ -@[expose] public section +public section namespace GerverSofa @@ -184,7 +190,17 @@ structure RatInterval where lo : ℚ /-- Upper endpoint of the interval. -/ hi : ℚ - deriving Repr, DecidableEq + deriving Repr + +@[expose, instance_reducible, instance] +def instDecidableEqRatInterval : DecidableEq RatInterval := fun a b => + if hlo : a.lo = b.lo then + if hhi : a.hi = b.hi then + isTrue (by cases a; cases b; cases hlo; cases hhi; rfl) + else + isFalse (by intro hab; exact hhi (congrArg RatInterval.hi hab)) + else + isFalse (by intro hab; exact hlo (congrArg RatInterval.lo hab)) namespace RatInterval @@ -193,20 +209,25 @@ def strictInsideB (x outer : RatInterval) : Bool := decide (outer.lo < x.lo ∧ x.hi < outer.hi) /-- Point interval. -/ +@[expose] def point (x : ℚ) : RatInterval := ⟨x, x⟩ /-- Exact interval addition. -/ +@[expose] def add (x y : RatInterval) : RatInterval := ⟨x.lo + y.lo, x.hi + y.hi⟩ /-- Exact interval negation. -/ +@[expose] def neg (x : RatInterval) : RatInterval := ⟨-x.hi, -x.lo⟩ /-- Exact interval subtraction. -/ +@[expose] def sub (x y : RatInterval) : RatInterval := add x (neg y) /-- Product hull of two rational intervals. -/ +@[expose] def mul (x y : RatInterval) : RatInterval := let p₁ := x.lo * y.lo let p₂ := x.lo * y.hi @@ -217,6 +238,7 @@ def mul (x y : RatInterval) : RatInterval := /-! ## Real semantics -/ /-- Semantic membership of a real number in a rational interval. -/ +@[expose] def Contains (z : RatInterval) (x : ℝ) : Prop := (z.lo : ℝ) ≤ x ∧ x ≤ (z.hi : ℝ) @@ -403,24 +425,28 @@ those proof obligations are represented separately in `KrawczykSpec.lean` and `GerverCertificate.lean`. -/ -@[expose] public section +public section namespace GerverSofa.CertificateManifest open GerverSofa /-- Reconstruct a natural number from base-10³⁵ chunks to share decimal elaboration. -/ +@[expose] def naturalFromChunks (chunks : List ℕ) : ℕ := chunks.foldl (fun n part ↦ n * 10 ^ 35 + part) 0 /-- Construct an exact rational number from its integer numerator and natural denominator. -/ +@[expose] def q (n : Int) (d : Nat) : ℚ := (n : ℚ) / (d : ℚ) /-- The frozen rational enclosure of π used by the certificate manifest. -/ +@[expose] def declaredPi : RatInterval := ⟨q 31415926535897932384626433832795028841971693993751 10000000000000000000000000000000000000000000000000, q 39269908169872415480783042290993786052464617492189 12500000000000000000000000000000000000000000000000⟩ /-- The frozen interval obtained from the manifest’s Machin-formula computation. -/ +@[expose] def machinPi : RatInterval := ⟨q (naturalFromChunks [295505634309898, 38894826843310944618692683285957161, 54840908697424127783146795390704820, 62285304765520132090285996624652812, 88395258878959894304877191976978068]) (naturalFromChunks @@ -431,6 +457,7 @@ def machinPi : RatInterval := ⟨q (naturalFromChunks [295505634309898, [1074587268220657145, 16687904540832335376340782508534865, 44974883186326861534485086372601111, 18916938440811867648599426576863646, 86497881848481483757495880126953125])⟩ /-- The four rational intervals specifying the reduced parameter box. -/ +@[expose] def x4 : List RatInterval := [ ⟨q 1888531216873 20000000000000, q 4721328042183 50000000000000⟩, ⟨q 69960186366677 50000000000000, q 34980093183339 25000000000000⟩, @@ -438,6 +465,7 @@ def x4 : List RatInterval := [ ⟨q 2129067216821 3125000000000, q 68130150938273 100000000000000⟩ ] /-- The twenty-two rational intervals specifying the full Romik parameter box. -/ +@[expose] def z22 : List RatInterval := [ ⟨q (-21032242207268875141628571849) 100000000000000000000000000000, q (-21032242207268875141608571849) 100000000000000000000000000000⟩, @@ -493,6 +521,7 @@ hours. Here the proof path uses the already frozen rational certificate and checks it in bounded, independent chunks. The expensive executable replay is still retained in `ExactReplay.lean` as a diagnostic cross-check, but it is not recomputed while building the trusted certificate. -/ +@[expose] def piCheck : Bool := RatInterval.strictInsideB machinPi declaredPi theorem piCheck_eq_true : piCheck = true := by @@ -516,7 +545,7 @@ intervals enclose the real `sin` and `cos`, and the abstract Krawczyk theorem, remain separate proof obligations; the arithmetic replay itself is decidable. -/ -@[expose] public section +public section namespace GerverSofa.ExactReplay @@ -525,56 +554,56 @@ open RatInterval open scoped BigOperators /-- Construct an exact rational number from its integer numerator and natural denominator. -/ -def q (n : Int) (d : Nat := 1) : ℚ := (n : ℚ) / (d : ℚ) +@[expose] def q (n : Int) (d : Nat := 1) : ℚ := (n : ℚ) / (d : ℚ) /-- The singleton rational interval at zero. -/ -def zeroI : RatInterval := point 0 +@[expose] def zeroI : RatInterval := point 0 /-- The singleton rational interval at one. -/ -def oneI : RatInterval := point 1 +@[expose] def oneI : RatInterval := point 1 private def midpoint (x : RatInterval) : ℚ := (x.lo + x.hi) / 2 /-- Multiply an interval by a rational singleton using exact interval arithmetic. -/ -def scale (a : ℚ) (x : RatInterval) : RatInterval := +@[expose] def scale (a : ℚ) (x : RatInterval) : RatInterval := mul (point a) x /-- A factorial interpreted as an exact rational number. -/ -def factorialQ (n : Nat) : ℚ := (Nat.factorial n : ℚ) +@[expose] def factorialQ (n : Nat) : ℚ := (Nat.factorial n : ℚ) /-- An alternating Taylor term with the specified power and factorial denominator. -/ -def signedTerm (k : Nat) (x : ℚ) (power : Nat) : ℚ := +@[expose] def signedTerm (k : Nat) (x : ℚ) (power : Nat) : ℚ := let z := x ^ power / factorialQ power if k % 2 = 0 then z else -z /-- The finite odd-power Taylor sum for sine at a rational argument. -/ -def sinPartial (x : ℚ) (terms : Nat) : ℚ := +@[expose] def sinPartial (x : ℚ) (terms : Nat) : ℚ := Finset.sum (Finset.range terms) (fun k => signedTerm k x (2 * k + 1)) /-- The finite even-power Taylor sum for cosine at a rational argument. -/ -def cosPartial (x : ℚ) (terms : Nat) : ℚ := +@[expose] def cosPartial (x : ℚ) (terms : Nat) : ℚ := Finset.sum (Finset.range terms) (fun k => signedTerm k x (2 * k)) /-- The interval between the nineteen- and twenty-term sine Taylor sums. -/ -def sinBound (x : ℚ) : RatInterval := +@[expose] def sinBound (x : ℚ) : RatInterval := let a := sinPartial x 19 let b := sinPartial x 20 ⟨min a b, max a b⟩ /-- The interval between the nineteen- and twenty-term cosine Taylor sums. -/ -def cosBound (x : ℚ) : RatInterval := +@[expose] def cosBound (x : ℚ) : RatInterval := let a := cosPartial x 19 let b := cosPartial x 20 ⟨min a b, max a b⟩ /-- The rational π enclosure used for trigonometric argument reduction. -/ -def piI : RatInterval := +@[expose] def piI : RatInterval := ⟨q 157079632679489661923132169163975144209858469968755 50000000000000000000000000000000000000000000000000, q 78539816339744830961566084581987572104929234984378 25000000000000000000000000000000000000000000000000⟩ /-- A finite alternating rational Taylor sum for arctangent. -/ -def atanPartial (x : ℚ) (terms : Nat) : ℚ := +@[expose] def atanPartial (x : ℚ) (terms : Nat) : ℚ := Finset.sum (Finset.range terms) (fun k => if k % 2 = 0 then x ^ (2 * k + 1) / ((2 * k + 1 : Nat) : ℚ) @@ -582,58 +611,58 @@ def atanPartial (x : ℚ) (terms : Nat) : ℚ := -(x ^ (2 * k + 1) / ((2 * k + 1 : Nat) : ℚ))) /-- The interval between two specified arctangent Taylor sums. -/ -def atanBound (x : ℚ) (lowTerms highTerms : Nat) : RatInterval := +@[expose] def atanBound (x : ℚ) (lowTerms highTerms : Nat) : RatInterval := let a := atanPartial x lowTerms let b := atanPartial x highTerms ⟨min a b, max a b⟩ /-- Evaluate the Machin expression `16 atan(1/5) - 4 atan(1/239)` by rational intervals. -/ -def machinPi : RatInterval := +@[expose] def machinPi : RatInterval := sub (scale 16 (atanBound (1 / 5) 43 44)) (scale 4 (atanBound (1 / 239) 13 14)) /-- Exact downward rounding to a fixed number of decimal places. -/ -def floorDecimal (x : ℚ) (digits : Nat := 60) : ℚ := +@[expose] def floorDecimal (x : ℚ) (digits : Nat := 60) : ℚ := let scale : ℚ := (10 : ℚ) ^ digits ((⌊x * scale⌋ : ℤ) : ℚ) / scale /-- Exact upward rounding to a fixed number of decimal places. -/ -def ceilDecimal (x : ℚ) (digits : Nat := 60) : ℚ := +@[expose] def ceilDecimal (x : ℚ) (digits : Nat := 60) : ℚ := let scale : ℚ := (10 : ℚ) ^ digits ((⌈x * scale⌉ : ℤ) : ℚ) / scale /-- The same 60-decimal outward rounding used by the submitted verifier. -/ -def outwardDecimal (z : RatInterval) : RatInterval := +@[expose] def outwardDecimal (z : RatInterval) : RatInterval := ⟨floorDecimal z.lo, ceilDecimal z.hi⟩ /-- Evaluate the small-argument sine enclosure with outward decimal rounding. -/ -def sinSmall (x : RatInterval) : RatInterval := +@[expose] def sinSmall (x : RatInterval) : RatInterval := outwardDecimal ⟨(sinBound x.lo).lo, (sinBound x.hi).hi⟩ /-- Evaluate the small-argument cosine enclosure with outward decimal rounding. -/ -def cosSmall (x : RatInterval) : RatInterval := +@[expose] def cosSmall (x : RatInterval) : RatInterval := outwardDecimal ⟨(cosBound x.hi).lo, (cosBound x.lo).hi⟩ /-- Clamp an interval to the physical angular range used by the Gerver certificate. If `x ∈ [0, π/2]` and `x` is enclosed by the input interval, then `x` is still enclosed after clamping once `piI` has been proved to contain `Real.pi`. -/ -def physicalClamp (x : RatInterval) : RatInterval := +@[expose] def physicalClamp (x : RatInterval) : RatInterval := ⟨max 0 x.lo, min (piI.hi / 2) x.hi⟩ /-- A fail-closed enclosure used only when an externally supplied interval is too wide for the small-argument Taylor/range-reduction evaluator. Every certified Gerver call remains in one of the two sharp branches below, so this fallback does not alter the frozen replay. -/ -def universalTrigInterval : RatInterval := ⟨-1, 1⟩ +@[expose] def universalTrigInterval : RatInterval := ⟨-1, 1⟩ /-- Complementary interval for the identity `sin x = cos (π/2-x)` and `cos x = sin (π/2-x)`. -/ -def complementInterval (x : RatInterval) : RatInterval := +@[expose] def complementInterval (x : RatInterval) : RatInterval := ⟨max 0 (piI.lo / 2 - x.hi), piI.hi / 2 - x.lo⟩ /-- Evaluate sine by small-argument bounds and complementary-angle reduction. -/ -def sinI (x : RatInterval) : RatInterval := +@[expose] def sinI (x : RatInterval) : RatInterval := let z := physicalClamp x if z.hi ≤ 9 / 10 then sinSmall z else @@ -641,7 +670,7 @@ def sinI (x : RatInterval) : RatInterval := if y.hi ≤ 9 / 10 then cosSmall y else universalTrigInterval /-- Evaluate cosine by small-argument bounds and complementary-angle reduction. -/ -def cosI (x : RatInterval) : RatInterval := +@[expose] def cosI (x : RatInterval) : RatInterval := let z := physicalClamp x if z.hi ≤ 9 / 10 then cosSmall z else @@ -659,44 +688,44 @@ structure D where namespace D /-- A constant interval with zero partial derivatives in every coordinate. -/ -def const (v : RatInterval) (n : Nat) : D := +@[expose] def const (v : RatInterval) (n : Nat) : D := ⟨v, List.replicate n zeroI⟩ /-- A rational singleton with zero partial derivatives. -/ -def pointConst (v : ℚ) (n : Nat) : D := const (point v) n +@[expose] def pointConst (v : ℚ) (n : Nat) : D := const (point v) n /-- An interval variable with the selected coordinate derivative equal to one. -/ -def varD (v : RatInterval) (j n : Nat) : D := +@[expose] def varD (v : RatInterval) (j n : Nat) : D := ⟨v, (List.range n).map (fun k => point (if k = j then 1 else 0))⟩ /-- Addition with interval propagation of all coordinate derivatives. -/ -def addD (x y : D) : D := +@[expose] def addD (x y : D) : D := ⟨add x.val y.val, List.zipWith add x.der y.der⟩ /-- Negation with interval propagation of all coordinate derivatives. -/ -def negD (x : D) : D := +@[expose] def negD (x : D) : D := ⟨neg x.val, x.der.map neg⟩ /-- Subtraction with interval propagation of all coordinate derivatives. -/ -def subD (x y : D) : D := addD x (negD y) +@[expose] def subD (x y : D) : D := addD x (negD y) /-- Multiplication with interval propagation of all coordinate derivatives. -/ -def mulD (x y : D) : D := +@[expose] def mulD (x y : D) : D := ⟨mul x.val y.val, List.zipWith (fun dx dy => add (mul dx y.val) (mul x.val dy)) x.der y.der⟩ /-- Rational scaling with interval propagation of all coordinate derivatives. -/ -def scaleD (a : ℚ) (x : D) : D := +@[expose] def scaleD (a : ℚ) (x : D) : D := ⟨scale a x.val, x.der.map (scale a)⟩ /-- Sine with interval propagation of all coordinate derivatives. -/ -def sinD (x : D) : D := +@[expose] def sinD (x : D) : D := let sv := sinI x.val let cv := cosI x.val ⟨sv, x.der.map (mul cv)⟩ /-- Cosine with interval propagation of all coordinate derivatives. -/ -def cosD (x : D) : D := +@[expose] def cosD (x : D) : D := let sv := sinI x.val let cv := cosI x.val ⟨cv, x.der.map (fun z => neg (mul sv z))⟩ @@ -710,13 +739,13 @@ instance : HMul ℚ D D := ⟨scaleD⟩ end D /-- Read an interval coordinate, returning the zero interval outside the list. -/ -def getI (xs : List RatInterval) (i : Nat) : RatInterval := +@[expose] def getI (xs : List RatInterval) (i : Nat) : RatInterval := xs.getD i zeroI /-- Read a rational coordinate, returning zero outside the list. -/ -def getQ (xs : List ℚ) (i : Nat) : ℚ := xs.getD i 0 +@[expose] def getQ (xs : List ℚ) (i : Nat) : ℚ := xs.getD i 0 /-- Read a rational matrix row, returning the empty row outside the list. -/ -def getRow (m : List (List ℚ)) (i : Nat) : List ℚ := m.getD i [] +@[expose] def getRow (m : List (List ℚ)) (i : Nat) : List ℚ := m.getD i [] /-! ## Reduced 4D system -/ @@ -792,16 +821,16 @@ cross-checking and provenance. -/ def declaredPiInterval : RatInterval := piI /-- Public wrapper around the executable sine enclosure. -/ -def sineInterval (x : RatInterval) : RatInterval := sinI x +@[expose] def sineInterval (x : RatInterval) : RatInterval := sinI x /-- Public wrapper around the executable cosine enclosure. -/ -def cosineInterval (x : RatInterval) : RatInterval := cosI x +@[expose] def cosineInterval (x : RatInterval) : RatInterval := cosI x /-- Frozen reduced input box used by the trusted certificate. -/ -def reducedInputBox : List RatInterval := CertificateManifest.x4 +@[expose] def reducedInputBox : List RatInterval := CertificateManifest.x4 /-- Frozen direct-system input box used by the trusted certificate. -/ -def fullInputBox : List RatInterval := CertificateManifest.z22 +@[expose] def fullInputBox : List RatInterval := CertificateManifest.z22 end GerverSofa.ExactReplay diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/Core/Bundle002.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/Core/Bundle002.lean index e3f0fb9275..ee6a143bff 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/Core/Bundle002.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/Core/Bundle002.lean @@ -40,7 +40,7 @@ public import Mathlib.Topology.Instances.Real.Lemmas * `GerverSofa.KernelOnly.PartF.Semantics.Batch001`. -/ -@[expose] public section +public section noncomputable section @@ -61,7 +61,7 @@ Authors: Dawid Trela * `Geometry`. -/ -@[expose] public section +public section noncomputable section @@ -75,7 +75,7 @@ part is the rotation matrix `[[c,-s],[s,c]]`, hence every value is an element of `SE(2)` and not an arbitrary affine equivalence. -/ -@[expose] public section +public section namespace GerverSofa @@ -94,11 +94,13 @@ structure SE2 where namespace SE2 /-- Action of an orientation-preserving rigid motion on the plane. -/ +@[expose] def act (g : SE2) (p : Point) : Point := (g.c * p.1 - g.s * p.2 + g.tx, g.s * p.1 + g.c * p.2 + g.ty) /-- Identity element. -/ +@[expose] def one : SE2 where c := 1 s := 0 @@ -107,6 +109,7 @@ def one : SE2 where unit := by norm_num /-- Inverse orientation-preserving rigid motion. -/ +@[expose] def inv (g : SE2) : SE2 where c := g.c s := -g.s @@ -138,6 +141,7 @@ def inv (g : SE2) : SE2 where /-- Componentwise continuity is the topology-free representation of a path in `SE(2)` used by the formal moving-sofa definition. -/ +@[expose] def ContinuousPath (g : ℝ → SE2) : Prop := Continuous (fun t => (g t).c) ∧ Continuous (fun t => (g t).s) ∧ @@ -165,11 +169,12 @@ section # Supporting hallway and inverse motion -/ -@[expose] public section +public section namespace GerverSofa /-- World-frame hallway obtained from the standard hallway by `frame`. -/ +@[expose] def supportingHallway (frame : SE2) : Set Point := frame.act '' hallway @@ -207,7 +212,7 @@ These are direct Lean transcriptions of equations (F1)--(F4) and of the independent equations (27)--(39), (41), (43) used by the companion verifier. -/ -@[expose] public section +public section namespace GerverSofa @@ -227,6 +232,7 @@ structure Params where theta : ℝ /-- Four-dimensional reduced switching system. -/ +@[expose] def system (p : Params) : Fin 4 → ℝ := let cp := Real.cos p.phi let sp := Real.sin p.phi @@ -242,6 +248,7 @@ def system (p : Params) : Fin 4 → ℝ := ] /-- The proposition that all four reduced equations vanish. -/ +@[expose] def Equations (p : Params) : Prop := system p = 0 end Reduced @@ -296,14 +303,17 @@ structure Params where theta : ℝ /-- Rotation of a body-frame vector into the world frame. -/ +@[expose] def rot (t : ℝ) (z : Point) : Point := (Real.cos t * z.1 - Real.sin t * z.2, Real.sin t * z.1 + Real.cos t * z.2) /-- Translate a point by the two specified coordinate offsets. -/ +@[expose] def addK (r : Point) (kx ky : ℝ) : Point := (r.1 + kx, r.2 + ky) /-- Phase 1 of the five-phase Gerver path. -/ +@[expose] def path1 (p : Params) (t : ℝ) : Point := let z : Point := (p.a1 * Real.cos t + p.a2 * Real.sin t - 1, @@ -311,6 +321,7 @@ def path1 (p : Params) (t : ℝ) : Point := addK (rot t z) p.k11 p.k12 /-- Phase 2 of the five-phase Gerver path. -/ +@[expose] def path2 (p : Params) (t : ℝ) : Point := let z : Point := (-(1 / 4 : ℝ) * t * t + p.b1 * t + p.b2, @@ -318,10 +329,12 @@ def path2 (p : Params) (t : ℝ) : Point := addK (rot t z) p.k21 p.k22 /-- Phase 3 of the five-phase Gerver path. -/ +@[expose] def path3 (p : Params) (t : ℝ) : Point := addK (rot t (p.c1 - t, p.c2 + t)) p.k31 p.k32 /-- Phase 4 of the five-phase Gerver path. -/ +@[expose] def path4 (p : Params) (t : ℝ) : Point := let z : Point := (-(1 / 2 : ℝ) * t + p.d1 - 1, @@ -329,6 +342,7 @@ def path4 (p : Params) (t : ℝ) : Point := addK (rot t z) p.k41 p.k42 /-- Phase 5 of the five-phase Gerver path. -/ +@[expose] def path5 (p : Params) (t : ℝ) : Point := let z : Point := (p.e1 * Real.cos t + p.e2 * Real.sin t - 1 / 2, @@ -336,40 +350,50 @@ def path5 (p : Params) (t : ℝ) : Point := addK (rot t z) p.k51 p.k52 /-- Body-frame derivative coefficients `(alpha,beta)` on phase 1. -/ +@[expose] def alphaBeta1 (p : Params) (t : ℝ) : Point := (-2 * p.a1 * Real.sin t + 2 * p.a2 * Real.cos t + 1 / 2, 2 * p.a1 * Real.cos t + 2 * p.a2 * Real.sin t - 1) /-- Body-frame velocity coordinates for phase 2. -/ +@[expose] def alphaBeta2 (p : Params) (t : ℝ) : Point := (1 + 2 * p.b1 - t, -(1 / 4 : ℝ) * t * t + p.b1 * t + p.b2 + 1 / 2) /-- Body-frame velocity coordinates for phase 3. -/ +@[expose] def alphaBeta3 (p : Params) (t : ℝ) : Point := (-1 - p.c2 - t, 1 + p.c1 - t) /-- Body-frame velocity coordinates for phase 4. -/ +@[expose] def alphaBeta4 (p : Params) (t : ℝ) : Point := ((1 / 4 : ℝ) * t * t - p.d1 * t - p.d2 - 1 / 2, 2 * p.d1 - 1 - t) /-- Body-frame velocity coordinates for phase 5. -/ +@[expose] def alphaBeta5 (p : Params) (t : ℝ) : Point := (1 - 2 * p.e1 * Real.sin t + 2 * p.e2 * Real.cos t, 2 * p.e1 * Real.cos t + 2 * p.e2 * Real.sin t - 1 / 2) /-- Rotate body-frame velocity coordinates into the world frame. -/ +@[expose] def pathPrimeFromAB (t : ℝ) (ab : Point) : Point := rot t ab /-- World-frame velocity formula for phase 1. -/ +@[expose] def pathPrime1 (p : Params) (t : ℝ) : Point := pathPrimeFromAB t (alphaBeta1 p t) /-- World-frame velocity formula for phase 2. -/ +@[expose] def pathPrime2 (p : Params) (t : ℝ) : Point := pathPrimeFromAB t (alphaBeta2 p t) /-- World-frame velocity formula for phase 3. -/ +@[expose] def pathPrime3 (p : Params) (t : ℝ) : Point := pathPrimeFromAB t (alphaBeta3 p t) /-- Romik's 22 independent scalar equations. -/ +@[expose] def system (p : Params) : Fin 22 → ℝ := let halfPi := Real.pi / 2 let quarterPi := Real.pi / 4 @@ -417,11 +441,13 @@ def system (p : Params) : Fin 22 → ℝ := ] /-- The proposition that all 22 independent equations vanish. -/ +@[expose] def Equations (p : Params) : Prop := system p = 0 /-- The physical five-phase path on `[0,π/2]`. At a switching angle either adjacent formula may be chosen; the certified matching equations prove they coincide. -/ +@[expose] def path (p : Params) (t : ℝ) : Point := let eta := Real.pi / 2 - p.theta let tau := Real.pi / 2 - p.phi @@ -432,9 +458,11 @@ def path (p : Params) (t : ℝ) : Point := else path5 p t /-- Linear normalization from unit time to physical rotation angle. -/ +@[expose] def angle (u : ℝ) : ℝ := u * (Real.pi / 2) /-- Standard-to-world frame `q ↦ x(t)+R_t q` for normalized time. -/ +@[expose] def frame (p : Params) (u : ℝ) : SE2 := let t := angle u let x := path p t @@ -607,18 +635,20 @@ Every endpoint is written as an exact integer quotient. There are no binary floating-point constants in these definitions. -/ -@[expose] public section +public section noncomputable section namespace GerverSofa /-- Interpret an integer numerator and natural denominator as a real quotient. -/ +@[expose] def qR (n : Int) (d : Nat) : ℝ := (n : ℝ) / (d : ℝ) namespace Reduced /-- Input box `X_a × X_b × X_phi × X_theta`. -/ +@[expose] def box : Set Params := {p | qR 1888531216873 20000000000000 ≤ p.a ∧ p.a ≤ qR 4721328042183 50000000000000 ∧ @@ -631,6 +661,7 @@ end Reduced namespace Romik /-- The direct 22-dimensional box `Y × Phi × Theta`. -/ +@[expose] def box : Set Params := {p | qR (-21032242207268875141628571849) 100000000000000000000000000000 ≤ p.k11 ∧ p.k11 ≤ qR @@ -777,56 +808,68 @@ half-plane definitions; it does not use the numerical certificate or Baek's cap theory. -/ -@[expose] public section +public section noncomputable section namespace GerverSofa /-- Euclidean scalar product in the fixed coordinate representation. -/ +@[expose] def dot (p q : Point) : ℝ := p.1 * q.1 + p.2 * q.2 /-- Rotating outer-wall normals. -/ +@[expose] def u (t : ℝ) : Point := (Real.cos t, Real.sin t) /-- The vertical unit vector rotated counterclockwise through angle `t`. -/ +@[expose] def v (t : ℝ) : Point := (-Real.sin t, Real.cos t) /-- The lower fan in the manuscript normalisation. -/ +@[expose] def capFan : Set Point := {q | 0 ≤ q.2} /-- First rotating supporting half-plane. -/ +@[expose] def supportHalfU (p : Romik.Params) (t : ℝ) : Set Point := {q | dot q (u t) ≤ dot (Romik.path p t) (u t) + 1} /-- Second rotating supporting half-plane. -/ +@[expose] def supportHalfV (p : Romik.Params) (t : ℝ) : Set Point := {q | dot q (v t) ≤ dot (Romik.path p t) (v t) + 1} /-- The cap `K₀` reconstructed from the five-phase path. -/ +@[expose] def Romik.K0 (p : Romik.Params) : Set Point := {q | 0 ≤ q.2 ∧ ∀ t ∈ Set.Icc (0 : ℝ) (Real.pi / 2), q ∈ supportHalfU p t ∩ supportHalfV p t} /-- Open inner quadrant of the supporting hallway at physical angle `t`. -/ +@[expose] def Romik.innerQuadrantAt (p : Romik.Params) (t : ℝ) : Set Point := let x := Romik.path p t {q | dot (q.1 - x.1, q.2 - x.2) (u t) < 0 ∧ dot (q.1 - x.1, q.2 - x.2) (v t) < 0} /-- Union of all forbidden inner quadrants at interior rotation times. -/ +@[expose] def Romik.innerUnion (p : Romik.Params) : Set Point := {q | ∃ t ∈ Set.Ioo (0 : ℝ) (Real.pi / 2), q ∈ Romik.innerQuadrantAt p t} /-- The niche removed from the cap. -/ +@[expose] def Romik.niche (p : Romik.Params) : Set Point := capFan ∩ Romik.innerUnion p /-- The fixed Gerver candidate `G = K₀ \ N(K₀)`. -/ +@[expose] def Romik.sofa (p : Romik.Params) : Set Point := Romik.K0 p \ Romik.niche p /-- Physical supporting hallway at normalized time `s`. -/ +@[expose] def Romik.hallwayAt (p : Romik.Params) (s : ℝ) : Set Point := supportingHallway (Romik.frame p s) @@ -1165,7 +1208,7 @@ Authors: Dawid Trela * `KernelOnly.FullADSoundness`. -/ -@[expose] public section +public section noncomputable section @@ -1180,7 +1223,7 @@ used only on arguments in `[0, 1]`; the range-reduction layer proves this precondition before calling these results. -/ -@[expose] public section +public section noncomputable section @@ -1190,10 +1233,12 @@ open scoped BigOperators open Filter Finset /-- Real magnitude of the `n`th sine-series term. -/ +@[expose] def sinMagnitude (x : ℝ) (n : ℕ) : ℝ := x ^ (2 * n + 1) / (Nat.factorial (2 * n + 1) : ℝ) /-- Real magnitude of the `n`th cosine-series term. -/ +@[expose] def cosMagnitude (x : ℝ) (n : ℕ) : ℝ := x ^ (2 * n) / (Nat.factorial (2 * n) : ℝ) @@ -1368,7 +1413,7 @@ layer uses named parameter records. These equivalences are the explicit, kernel-checked bridge between the two representations. -/ -@[expose] public section +public section noncomputable section @@ -1430,6 +1475,7 @@ end Reduced namespace Romik /-- Named Romik parameters as a 22-vector in verifier order. -/ +@[expose] def coordEquiv : Params ≃ Vec 22 where toFun p := ![ p.k11, p.k12, p.k21, p.k22, p.k31, p.k32, p.k41, p.k42, p.k51, p.k52, @@ -1467,10 +1513,12 @@ def coordEquiv : Params ≃ Vec 22 where fin_cases i <;> rfl /-- Direct Romik system expressed in finite-vector coordinates. -/ +@[expose] def vectorSystem (x : Vec 22) : Vec 22 := system (coordEquiv.symm x) /-- The direct Romik box expressed in finite-vector coordinates. -/ +@[expose] def vectorBox : Set (Vec 22) := {x | coordEquiv.symm x ∈ box} @@ -1528,7 +1576,7 @@ one large proof term. /-! ## Exact parameter consequences of equations 27--34 -/ -@[expose] public section +public section noncomputable section @@ -1798,7 +1846,7 @@ literal definitions and the two endpoint normalisations; the eighteen-piece boundary statement remains a separate field of `FullArticleCertificate`. -/ -@[expose] public section +public section noncomputable section @@ -1806,6 +1854,7 @@ namespace GerverSofa.Romik /-- Romik's fixed-frame reconstruction: initial arm, every supporting hallway, and the final transported vertical arm. -/ +@[expose] def reconstructedSet (p : Params) : Set Point := {q | q ∈ horizontalArm ∧ (∀ s ∈ Set.Icc (0 : ℝ) 1, q ∈ hallwayAt p s) ∧ @@ -1934,7 +1983,7 @@ The latter remains available under `ExactReplay.executable*` for independent diagnostic comparison. -/ -@[expose] public section +public section namespace GerverSofa.CertificateManifest theorem machin_inside_declared : @@ -1959,7 +2008,7 @@ for these interfaces are the remaining analytic part of the end-to-end certificate; no axiom is declared here. -/ -@[expose] public section +public section noncomputable section @@ -1968,6 +2017,7 @@ namespace GerverSofa open RatInterval /-- A rational interval list encloses a finite real vector coordinatewise. -/ +@[expose] def EnclosesVec {n : Nat} (box : List RatInterval) (x : Vec n) : Prop := box.length = n ∧ ∀ i : Fin n, Contains (box.getD i.1 (point 0)) (x i) @@ -2027,7 +2077,7 @@ No project axiom and no floating-point literal occurs in this file. /-! ## Partial-sum interval consequences -/ -@[expose] public section +public section noncomputable section @@ -2363,7 +2413,7 @@ constructor theorems. /-! ## Smooth scalar models -/ -@[expose] public section +public section noncomputable section @@ -2388,6 +2438,7 @@ structure ScalarModel (n : Nat) where namespace ScalarModel /-- Constant scalar model. -/ +@[expose] def const (n : Nat) (c : ℝ) : ScalarModel n where value := fun _ => c gradient := fun _ _ => 0 @@ -2397,6 +2448,7 @@ def const (n : Nat) (c : ℝ) : ScalarModel n where (hasDerivAt_const (x j) c).tendsto_slope_zero /-- Coordinate projection. -/ +@[expose] def var (n : Nat) (k : Fin n) : ScalarModel n where value := fun x => x k gradient := fun _ j => if j = k then 1 else 0 @@ -2413,6 +2465,7 @@ def var (n : Nat) (k : Fin n) : ScalarModel n where smul_eq_mul] using (hasDerivAt_const (x j) (x k)).tendsto_slope_zero /-- Pointwise addition. -/ +@[expose] def add {n : Nat} (f g : ScalarModel n) : ScalarModel n where value := fun x => f.value x + g.value x gradient := fun x j => f.gradient x j + g.gradient x j @@ -2434,6 +2487,7 @@ def add {n : Nat} (f g : ScalarModel n) : ScalarModel n where (hfh.fun_add hgh).tendsto_slope_zero /-- Pointwise negation. -/ +@[expose] def neg {n : Nat} (f : ScalarModel n) : ScalarModel n where value := fun x => -f.value x gradient := fun x j => -f.gradient x j @@ -2449,10 +2503,12 @@ def neg {n : Nat} (f : ScalarModel n) : ScalarModel n where hfh.fun_neg.tendsto_slope_zero /-- Pointwise subtraction. -/ +@[expose] def sub {n : Nat} (f g : ScalarModel n) : ScalarModel n := add f (neg g) /-- Pointwise multiplication. -/ +@[expose] def mul {n : Nat} (f g : ScalarModel n) : ScalarModel n where value := fun x => f.value x * g.value x gradient := fun x j => @@ -2477,6 +2533,7 @@ def mul {n : Nat} (f g : ScalarModel n) : ScalarModel n where (hfh.fun_mul hgh).tendsto_slope_zero /-- Rational scaling. -/ +@[expose] def scale {n : Nat} (a : ℚ) (f : ScalarModel n) : ScalarModel n where value := fun x => (a : ℝ) * f.value x gradient := fun x j => (a : ℝ) * f.gradient x j @@ -2492,6 +2549,7 @@ def scale {n : Nat} (a : ℚ) (f : ScalarModel n) : ScalarModel n where simpa only [RealDerivativeAt, smul_eq_mul] using hs.tendsto_slope_zero /-- Sine composition. -/ +@[expose] def sin {n : Nat} (f : ScalarModel n) : ScalarModel n where value := fun x => Real.sin (f.value x) gradient := fun x j => Real.cos (f.value x) * f.gradient x j @@ -2509,6 +2567,7 @@ def sin {n : Nat} (f : ScalarModel n) : ScalarModel n where hfh.sin.tendsto_slope_zero /-- Cosine composition. -/ +@[expose] def cos {n : Nat} (f : ScalarModel n) : ScalarModel n where value := fun x => Real.cos (f.value x) gradient := fun x j => -Real.sin (f.value x) * f.gradient x j @@ -2837,7 +2896,7 @@ This module instantiates the constructor-level AD theorem with equations and identifies the four smooth scalar models with `Reduced.vectorSystem`. -/ -@[expose] public section +public section noncomputable section @@ -2873,6 +2932,7 @@ theorem inputBox_exact (x : Vec 4) : aesop /-- Scalar models matching the four reduced equations. -/ +@[expose] def models : Fin 4 → ScalarModel 4 := let a := ScalarModel.var 4 (0 : Fin 4) let b := ScalarModel.var 4 (1 : Fin 4) @@ -2936,7 +2996,7 @@ chunked: expanding all 44 rational endpoint inequalities in one `simp` call exhausts the default heartbeat budget even though every coordinate identity is individually trivial. -/ -@[expose] public section +public section noncomputable section @@ -3192,51 +3252,61 @@ namespace SoundDual variable {n : Nat} {X : Set (Vec n)} /-- A constant scalar model with a certified interval enclosure. -/ +@[expose] def const (z : RatInterval) (c : ℝ) (h : Contains z c) : SoundDual n X := ⟨ExactReplay.D.const z n, ScalarModel.const n c, DSoundOn.const h⟩ /-- A rational constant represented by a singleton interval and zero gradient. -/ +@[expose] def pointConst (q : ℚ) : SoundDual n X := ⟨ExactReplay.D.pointConst q n, ScalarModel.const n (q : ℝ), DSoundOn.pointConst q⟩ /-- A coordinate projection with its certified input interval. -/ +@[expose] def var (input : RatInterval) (k : Fin n) (h : ∀ x ∈ X, Contains input (x k)) : SoundDual n X := ⟨ExactReplay.D.varD input k.1 n, ScalarModel.var n k, DSoundOn.varD input k h⟩ /-- Addition with certified interval value and gradient enclosures. -/ +@[expose] def add (a b : SoundDual n X) : SoundDual n X := ⟨ExactReplay.D.addD a.d b.d, ScalarModel.add a.model b.model, a.sound.add b.sound⟩ /-- Negation with certified interval value and gradient enclosures. -/ +@[expose] def neg (a : SoundDual n X) : SoundDual n X := ⟨ExactReplay.D.negD a.d, ScalarModel.neg a.model, a.sound.neg⟩ /-- Subtraction with certified interval value and gradient enclosures. -/ +@[expose] def sub (a b : SoundDual n X) : SoundDual n X := ⟨ExactReplay.D.subD a.d b.d, ScalarModel.sub a.model b.model, a.sound.sub b.sound⟩ /-- Multiplication with certified interval value and gradient enclosures. -/ +@[expose] def mul (a b : SoundDual n X) : SoundDual n X := ⟨ExactReplay.D.mulD a.d b.d, ScalarModel.mul a.model b.model, a.sound.mul b.sound⟩ /-- Rational scaling with certified interval value and gradient enclosures. -/ +@[expose] def scale (q : ℚ) (a : SoundDual n X) : SoundDual n X := ⟨ExactReplay.D.scaleD q a.d, ScalarModel.scale q a.model, DSoundOn.scale q a.sound⟩ /-- Sine with certified interval value and gradient enclosures. -/ +@[expose] def sin (a : SoundDual n X) (h : ∀ x ∈ X, 0 ≤ a.model.value x ∧ a.model.value x ≤ Real.pi / 2) : SoundDual n X := ⟨ExactReplay.D.sinD a.d, ScalarModel.sin a.model, a.sound.sin h⟩ /-- Cosine with certified interval value and gradient enclosures. -/ +@[expose] def cos (a : SoundDual n X) (h : ∀ x ∈ X, 0 ≤ a.model.value x ∧ a.model.value x ≤ Real.pi / 2) : SoundDual n X := @@ -3300,10 +3370,12 @@ namespace AngleDual variable {n : Nat} {X : Set (Vec n)} /-- Sine with certified interval value and gradient enclosures. -/ +@[expose] def sin (t : AngleDual n X) : SoundDual n X := SoundDual.sin t.dual t.physical /-- Cosine with certified interval value and gradient enclosures. -/ +@[expose] def cos (t : AngleDual n X) : SoundDual n X := SoundDual.cos t.dual t.physical @@ -3359,6 +3431,7 @@ structure FullVars (X : Set (Vec 22)) where e2 : SoundDual 22 X /-- The 22 coordinate variables equipped with their input-enclosure proofs. -/ +@[expose] def inputDual (i : Fin 22) : SoundDual 22 vectorBox := SoundDual.var (ExactReplay.getI ExactReplay.fullInputBox i.1) i (by intro x hx @@ -3368,6 +3441,7 @@ def inputDual (i : Fin 22) : SoundDual 22 vectorBox := (inputDual i).model.value x = x i := rfl /-- Named first twenty variables in verifier order. -/ +@[expose] def fullVars : FullVars vectorBox where k11 := inputDual 0 k12 := inputDual 1 @@ -3391,6 +3465,7 @@ def fullVars : FullVars vectorBox where e2 := inputDual 19 /-- Exact proof-carrying π constant. -/ +@[expose] def piDual : SoundDual 22 vectorBox := SoundDual.const ExactReplay.piI Real.pi ExactReplay.piI_contains_pi @@ -3398,6 +3473,7 @@ def piDual : SoundDual 22 vectorBox := piDual.model.value x = Real.pi := rfl /-- First switching angle. -/ +@[expose] def phiDual : AngleDual 22 vectorBox where dual := inputDual 20 physical := by @@ -3409,6 +3485,7 @@ def phiDual : AngleDual 22 vectorBox where phiDual.dual.model.value x = x 20 := rfl /-- Second switching angle. -/ +@[expose] def thetaDual : AngleDual 22 vectorBox where dual := inputDual 21 physical := by @@ -3425,6 +3502,7 @@ private theorem eta_raw_model_value (x : Vec 22) : simp; ring /-- Reflected third switching angle `π/2-θ`. -/ +@[expose] def etaDual : AngleDual 22 vectorBox where dual := (1 / 2 : ℚ) * piDual - thetaDual.dual physical := by @@ -3442,6 +3520,7 @@ private theorem tau_raw_model_value (x : Vec 22) : simp; ring /-- Reflected fourth switching angle `π/2-φ`. -/ +@[expose] def tauDual : AngleDual 22 vectorBox where dual := (1 / 2 : ℚ) * piDual - phiDual.dual physical := by @@ -3454,6 +3533,7 @@ def tauDual : AngleDual 22 vectorBox where exact tau_raw_model_value x /-- Rotation of a proof-carrying body-frame vector. -/ +@[expose] def rotDual (t : AngleDual 22 vectorBox) (z1 z2 : SoundDual 22 vectorBox) : SoundDual 22 vectorBox × SoundDual 22 vectorBox := @@ -3462,6 +3542,7 @@ def rotDual (t : AngleDual 22 vectorBox) (ct * z1 - st * z2, st * z1 + ct * z2) /-- One proof-carrying path piece. -/ +@[expose] def pathPieceDual (j : Nat) (t : AngleDual 22 vectorBox) (p : FullVars vectorBox := fullVars) : SoundDual 22 vectorBox × SoundDual 22 vectorBox := @@ -3494,6 +3575,7 @@ def pathPieceDual (j : Nat) (t : AngleDual 22 vectorBox) (rr.1 + data.2.2.1, rr.2 + data.2.2.2) /-- Body-frame derivative coefficients for one phase. -/ +@[expose] def alphaBetaDual (j : Nat) (t : AngleDual 22 vectorBox) (p : FullVars vectorBox := fullVars) : SoundDual 22 vectorBox × SoundDual 22 vectorBox := @@ -3518,6 +3600,7 @@ def alphaBetaDual (j : Nat) (t : AngleDual 22 vectorBox) (2 : ℚ) * p.e1 * ct + (2 : ℚ) * p.e2 * st - half) /-- World-frame derivative piece. -/ +@[expose] def pathPrimeDual (j : Nat) (t : AngleDual 22 vectorBox) (p : FullVars vectorBox := fullVars) : SoundDual 22 vectorBox × SoundDual 22 vectorBox := @@ -3525,6 +3608,7 @@ def pathPrimeDual (j : Nat) (t : AngleDual 22 vectorBox) rotDual t ab.1 ab.2 /-- The complete proof-carrying direct system in manuscript order. -/ +@[expose] def fullDualOutput : List (SoundDual 22 vectorBox) := let p := fullVars let halfPi := (1 / 2 : ℚ) * piDual @@ -3822,7 +3906,7 @@ Authors: Dawid Trela * `KernelOnly.PartF.F06FullReconstruction`. -/ -@[expose] public section +public section noncomputable section @@ -3837,7 +3921,7 @@ is used. Both application conventions and the conversion between them are proved for an arbitrary linear isometry equivalence. -/ -@[expose] public section +public section noncomputable section @@ -3863,10 +3947,12 @@ instance rigidTopology : TopologicalSpace Rigid := .induced (fun e => e.toAffineIsometry.toContinuousAffineMap) inferInstance /-- The composition currently implemented upstream: `q ↦ R q + p`. -/ +@[expose] def rotateThenTranslate (R : Plane ≃ₗᵢ[ℝ] Plane) (p : Plane) : Rigid := R.toAffineIsometryEquiv.trans (AffineIsometryEquiv.vaddConst ℝ p) /-- The documented composition: `q ↦ R (q + p)`. -/ +@[expose] def translateThenRotate (R : Plane ≃ₗᵢ[ℝ] Plane) (p : Plane) : Rigid := (AffineIsometryEquiv.vaddConst ℝ p).trans R.toAffineIsometryEquiv @@ -3886,14 +3972,17 @@ theorem translateThenRotate_eq_rotateThenTranslate simp only [translateThenRotate_apply, rotateThenTranslate_apply, map_add] /-- Counterclockwise rotation of the oriented plane through angle `t`. -/ +@[expose] def rotation (t : ℝ) : Plane ≃ₗᵢ[ℝ] Plane := EuclideanGeometry.o.rotation (t : Real.Angle) /-- Translate by the body-frame offset and then rotate through `t`. -/ +@[expose] def bodyFrame (t : ℝ) (p : Plane) : Rigid := translateThenRotate (rotation t) p /-- Rotate through `t` and then translate by the world position. -/ +@[expose] def worldFrame (t : ℝ) (x : Plane) : Rigid := rotateThenTranslate (rotation t) x @@ -3925,12 +4014,13 @@ equals it, and identifying `dictionary d` with the certified 22D tuple, remain separate obligations. No such equality is assumed here. -/ -@[expose] public section +public section noncomputable section namespace GerverSofa.PartF.Phases /-- The terminal rotation angle π/2. -/ +@[expose] def T : ℝ := Real.pi / 2 /-- The auxiliary height parameter `(a + θ - φ - 1) / 2`. -/ def hStar (d : Reduced.Params) : ℝ := (d.a + d.theta - d.phi - 1) / 2 @@ -3947,6 +4037,7 @@ def U3 (d : Reduced.Params) : ℝ := def V3 (d : Reduced.Params) : ℝ := V4 d + 1 / 2 * Real.cos d.theta + hStar d * Real.sin d.theta /-- Phase 2 integration constant for the vertical primitive. -/ +@[expose] def U2 (d : Reduced.Params) : ℝ := U4 d /-- Phase 2 integration constant for the horizontal primitive. -/ def V2 (d : Reduced.Params) : ℝ := @@ -3958,6 +4049,7 @@ def U1 (d : Reduced.Params) : ℝ := def V1 (d : Reduced.Params) : ℝ := V2 d + d.a / 2 * Real.sin d.phi + 1 / 2 * Real.cos d.phi /-- The first-phase offset determined by `4 V1 - 2`. -/ +@[expose] def ell (d : Reduced.Params) : ℝ := 4 * V1 d - 2 theorem U1_eq_half (d : Reduced.Params) (hd : Reduced.Equations d) : @@ -3987,6 +4079,7 @@ theorem ell_eq_two_V3 (d : Reduced.Params) (hd : Reduced.Equations d) : ring /-- Express all twenty-two Romik parameters in terms of the four reduced parameters. -/ +@[expose] def dictionary (d : Reduced.Params) : Romik.Params where k11 := 1 - 3 / 2 * (1 - V1 d) k12 := 1 / 4 @@ -4015,34 +4108,41 @@ def dictionary (d : Reduced.Params) : Romik.Params where @[simp] theorem dictionary_theta (d : Reduced.Params) : (dictionary d).theta = d.theta := rfl /-- The polynomial profile for phase 2 of the path. -/ +@[expose] def g2 (d : Reduced.Params) (t : ℝ) : ℝ := (1 + d.a + t - d.phi) / 2 /-- The polynomial profile for phase 3 of the path. -/ +@[expose] def g3 (d : Reduced.Params) (t : ℝ) : ℝ := d.a + t - d.phi /-- The polynomial profile for phase 4 of the path. -/ def g4 (d : Reduced.Params) (t : ℝ) : ℝ := d.b + 1 / 2 - (T - d.phi - t) * (1 + d.a) / 2 - (T - d.phi - t)^2 / 4 /-- The closed rotation-path formula for phase 1. -/ +@[expose] def closed1 (d : Reduced.Params) (t : ℝ) : Point := (Real.cos t - 1, -1 / 2 + 1 / 2 * Real.cos t + (V1 d - ell d) * Real.sin t) /-- The closed rotation-path formula for phase 2. -/ +@[expose] def closed2 (d : Reduced.Params) (t : ℝ) : Point := (g4 d (T - t) + U4 d * Real.sin t + V4 d * Real.cos t - 1, g2 d t + U4 d * Real.cos t + (V2 d - ell d) * Real.sin t - 1) /-- The closed rotation-path formula for phase 3. -/ +@[expose] def closed3 (d : Reduced.Params) (t : ℝ) : Point := (g3 d (T - t) + U3 d * Real.sin t + V3 d * Real.cos t - 1, g3 d t + U3 d * Real.cos t + (V3 d - ell d) * Real.sin t - 1) /-- The closed rotation-path formula for phase 4. -/ +@[expose] def closed4 (d : Reduced.Params) (t : ℝ) : Point := (g2 d (T - t) + U4 d * Real.sin t + V2 d * Real.cos t - 1, g4 d t + U4 d * Real.cos t + (V4 d - ell d) * Real.sin t - 1) /-- The closed rotation-path formula for phase 5. -/ +@[expose] def closed5 (d : Reduced.Params) (t : ℝ) : Point := (-1 / 2 + V1 d * Real.cos t + 1 / 2 * Real.sin t, (1 - ell d) * Real.sin t - 1) @@ -4094,6 +4194,7 @@ theorem phase5 (d : Reduced.Params) (t : ℝ) : linear_combination (1 / 4 : ℝ) * Real.sin_sq_add_cos_sq t /-- The five-branch closed formula for the rotation path. -/ +@[expose] def closedPath (d : Reduced.Params) (t : ℝ) : Point := if t ≤ d.phi then closed1 d t else if t ≤ d.theta then closed2 d t @@ -4149,7 +4250,7 @@ importing upstream conjectures with unfinished proof terms. Its concrete instantiation for the integral Gerver path still needs the analytic bridge. -/ -@[expose] public section +public section noncomputable section open scoped unitInterval @@ -4157,19 +4258,23 @@ open scoped unitInterval namespace GerverSofa.PartF /-- Intersect the endpoint hallway arms and all intermediate moving hallways. -/ +@[expose] def frameIntersection (F : I → Rigid) (H V L : Set Plane) : Set Plane := F 0 '' H ∩ F 1 '' V ∩ ⋂ s, F s '' L /-- The hallway intersection parametrized by angles from zero to π/2. -/ +@[expose] def angleIntersection (F : ℝ → Rigid) (H V L : Set Plane) : Set Plane := F 0 '' H ∩ F (Real.pi / 2) '' V ∩ ⋂ t ∈ Set.Icc 0 (Real.pi / 2), F t '' L /-- The hallway intersection generated by a path in body-frame coordinates. -/ +@[expose] def bodySofa (p : ℝ → Plane) (H V L : Set Plane) : Set Plane := angleIntersection (fun t => bodyFrame t (p t)) H V L /-- The hallway intersection generated by a path in world-frame coordinates. -/ +@[expose] def worldSofa (x : ℝ → Plane) (H V L : Set Plane) : Set Plane := angleIntersection (fun t => worldFrame t (x t)) H V L @@ -4225,10 +4330,13 @@ theorem angleIntersection_eq_frameIntersection namespace Model /-- The horizontal unit-width hallway arm extending to the left. -/ +@[expose] def horizontalHallway : Set Plane := {q | q 0 ≤ 1 ∧ 0 ≤ q 1 ∧ q 1 ≤ 1} /-- The vertical unit-width hallway arm extending downwards. -/ +@[expose] def verticalHallway : Set Plane := {q | 0 ≤ q 0 ∧ q 0 ≤ 1 ∧ q 1 ≤ 1} /-- The union of the two perpendicular unit-width hallway arms. -/ +@[expose] def hallway : Set Plane := horizontalHallway ∪ verticalHallway /-- A nonempty closed connected set moving continuously between the hallway arms. -/ @@ -4262,16 +4370,18 @@ the coordinate identification below is a linear equivalence and a homeomorphism. Euclidean isometries are constructed separately. -/ -@[expose] public section +public section noncomputable section namespace GerverSofa.PartF.Coordinates /-- Convert a pair of real coordinates to a Euclidean vector. -/ +@[expose] def toPlane (q : Point) : Plane := WithLp.toLp 2 ![q.1, q.2] /-- Extract the two real coordinates of a Euclidean vector. -/ +@[expose] def fromPlane (q : Plane) : Point := (q 0, q 1) @[simp] theorem toPlane_zero_coord (q : Point) : toPlane q 0 = q.1 := rfl @@ -4295,6 +4405,7 @@ theorem toPlane_smul (c : ℝ) (q : Point) : toPlane (c • q) = c • toPlane q exact plane_ext rfl rfl /-- The coordinate equivalence, without any assertion that the two norms agree. -/ +@[expose] def linearEquiv : Point ≃ₗ[ℝ] Plane where toFun := toPlane invFun := fromPlane @@ -4367,7 +4478,7 @@ The phase boundaries are preserved. Integrating across the jumps will use equality on open intervals, not an incorrect global continuity assertion for r. -/ -@[expose] public section +public section noncomputable section open MeasureTheory @@ -4376,10 +4487,13 @@ namespace GerverSofa.PartF.Integrals open Phases /-- The reflected second switching angle `π/2 - θ`. -/ +@[expose] def eta (d : Reduced.Params) : ℝ := T - d.theta /-- The reflected first switching angle `π/2 - φ`. -/ +@[expose] def tau (d : Reduced.Params) : ℝ := T - d.phi /-- The switching-angle condition `0 ≤ φ ≤ θ ≤ π/4`. -/ +@[expose] def Ordered (d : Reduced.Params) : Prop := 0 ≤ d.phi ∧ d.phi ≤ d.theta ∧ d.theta ≤ Real.pi / 4 @@ -4391,16 +4505,21 @@ theorem ordered_knots (d : Reduced.Params) (ho : Ordered d) : exact ⟨h0, h1, by linarith, by linarith, by linarith⟩ /-- The integrand profile on phase 1. -/ +@[expose] def r1 (_d : Reduced.Params) (_t : ℝ) : ℝ := 1 / 2 /-- The integrand profile on phase 2. -/ +@[expose] def r2 (d : Reduced.Params) (t : ℝ) : ℝ := g2 d t /-- The integrand profile on phase 3. -/ +@[expose] def r3 (d : Reduced.Params) (t : ℝ) : ℝ := g3 d t /-- The integrand profile on phase 4. -/ +@[expose] def r4 (d : Reduced.Params) (t : ℝ) : ℝ := d.b - (T - t - d.phi) * (1 + d.a) / 2 - (T - t - d.phi) ^ 2 / 4 /-- The piecewise phase profile used in the integral representation. -/ +@[expose] def r (d : Reduced.Params) (t : ℝ) : ℝ := if t ≤ d.phi then r1 d t else if t ≤ d.theta then r2 d t @@ -4409,13 +4528,16 @@ def r (d : Reduced.Params) (t : ℝ) : ℝ := else 0 /-- One minus the cosine-weighted profile integral from `t` to the last switching angle. -/ +@[expose] def xi (d : Reduced.Params) (t : ℝ) : ℝ := 1 - ∫ s in t..tau d, r d s * Real.cos s /-- The sine-weighted profile integral from `t` to the last switching angle. -/ +@[expose] def zeta (d : Reduced.Params) (t : ℝ) : ℝ := ∫ s in t..tau d, r d s * Real.sin s /-- The rotation path expressed using the two profile integrals. -/ +@[expose] def path (d : Reduced.Params) (t : ℝ) : Point := (if t ≤ d.phi then Real.cos t - 1 else xi d (T - t) * Real.cos t + zeta d (T - t) * Real.sin t - 1, @@ -4641,7 +4763,7 @@ the discontinuous integrand is required only on the open interval. Adjacent integrals are then added, using the proved matching values at every switch. -/ -@[expose] public section +public section noncomputable section open MeasureTheory @@ -4865,6 +4987,7 @@ theorem xi_zero (d : Reduced.Params) (ho : Ordered d) simpa [X1, primitiveX] using h /-- The projection `ξ sin t + ζ cos t` used in the integral identities. -/ +@[expose] def W (d : Reduced.Params) (t : ℝ) : ℝ := xi d t * Real.sin t + zeta d t * Real.cos t @@ -4925,7 +5048,7 @@ They do not identify the dictionary with the independently certified 22D root. The module is independent of the F04 integral evaluation. -/ -@[expose] public section +public section noncomputable section namespace GerverSofa.PartF.Phases @@ -5109,6 +5232,7 @@ theorem dictionary_equations (d : Reduced.Params) (hd : Reduced.Equations d) : ((d.b) * (Real.sin d.phi) + (Real.sin d.phi) + (1 / 4 : ℝ)) * hcphi /-- Read back the four free parameters from the 22D representation. -/ +@[expose] def undictionary (p : Romik.Params) : Reduced.Params where a := p.phi - 1 - 2 * p.b1 b := p.b2 + 1 / 2 - (1 + (p.phi - 1 - 2 * p.b1)) * p.phi / 2 + p.phi ^ 2 / 4 @@ -5138,7 +5262,7 @@ This direction uses velocity matching and the two contact equations. It does not assume membership in either numerical box or any strict angle inequality. -/ -@[expose] public section +public section noncomputable section namespace GerverSofa.PartF.Phases @@ -5309,7 +5433,7 @@ Velocity matching determines the shape coefficients. Positional matching then determines each successive translation. No numerical enclosure is used. -/ -@[expose] public section +public section noncomputable section namespace GerverSofa.PartF.Phases diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/Core/Bundle003.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/Core/Bundle003.lean index 7954bf2c24..0dc01a23f5 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/Core/Bundle003.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/Core/Bundle003.lean @@ -18,7 +18,7 @@ public import Mathlib.Tactic.FinCases * `GerverSofa.KernelOnly.PartB.Semantics.Batch002`. -/ -@[expose] public section +public section noncomputable section @@ -36,7 +36,7 @@ Authors: Dawid Trela * `KernelOnly.PartB.CellCache`. -/ -@[expose] public section +public section noncomputable section @@ -50,7 +50,7 @@ It contains only exact rational interval data, so all 64 diagnostic and production rows can be kernel-reduced without rebuilding semantic layers. -/ -@[expose] public section +public section namespace GerverSofa namespace PartB @@ -58,29 +58,35 @@ namespace PartB open RatInterval /-- Exact target `0.171` used by the continuum theorem. -/ +@[expose] def targetQ : ℚ := 171 / 1000 /-- The 64 closed mesh cells determined by the 65 nodes `iπ/128`. -/ abbrev Cell := Fin 64 /-- Exact rational mesh coefficient. -/ +@[expose] def nodeCoeff (i : Nat) : ℚ := (i : ℚ) / 128 /-- Hull of two rational intervals. -/ +@[expose] def intervalHull (a b : RatInterval) : RatInterval := ⟨min a.lo b.lo, max a.hi b.hi⟩ /-- Componentwise hull of two planar interval boxes. -/ +@[expose] def pointHull (a b : RatInterval × RatInterval) : RatInterval × RatInterval := (intervalHull a.1 b.1, intervalHull a.2 b.2) /-- Exact interval enclosure of one physical time cell. -/ +@[expose] def cellTimeInterval (i : Cell) : RatInterval := intervalHull (ExactReplay.scale (nodeCoeff i.1) ExactReplay.piI) (ExactReplay.scale (nodeCoeff (i.1 + 1)) ExactReplay.piI) /-- Exact interval evaluation of one path phase on one complete mesh cell. -/ +@[expose] def cellPieceInterval (j : Nat) (i : Cell) : RatInterval × RatInterval := let t := cellTimeInterval i let k11 := ExactReplay.getI ExactReplay.fullInputBox 0 @@ -149,6 +155,7 @@ def cellPieceInterval (j : Nat) (i : Cell) : RatInterval × RatInterval := /-- The path enclosure for a cell. Four cells contain a switching angle and therefore take the hull of the two adjacent analytic phases. -/ +@[expose] def cellPathInterval (i : Cell) : RatInterval × RatInterval := if i.1 = 0 then cellPieceInterval 1 i else if i.1 = 1 then pointHull (cellPieceInterval 1 i) (cellPieceInterval 2 i) @@ -161,6 +168,7 @@ def cellPathInterval (i : Cell) : RatInterval × RatInterval := else cellPieceInterval 5 i /-- Exact interval image of `Gu` on one product cell. -/ +@[expose] def guCellInterval (i j : Cell) : RatInterval := let xi := cellPathInterval i let xj := cellPathInterval j @@ -173,6 +181,7 @@ def guCellInterval (i j : Cell) : RatInterval := (RatInterval.mul dy s) /-- Exact interval image of `Gv` on one product cell. -/ +@[expose] def gvCellInterval (i j : Cell) : RatInterval := let xi := cellPathInterval i let xj := cellPathInterval j @@ -201,15 +210,17 @@ Each table is checked against the original evaluator by the Lean kernel. Sharing these evaluations avoids repeating the same Taylor computations in every row. -/ -@[expose] public section +public section namespace GerverSofa.PartB /-- Reconstruct a natural number from base-10³⁵ chunks to share decimal elaboration. -/ +@[expose] def naturalFromChunks (chunks : List ℕ) : ℕ := chunks.foldl (fun value digit => value * 10 ^ 35 + digit) 0 /-- The exact cached path-coordinate pair for cell 0, sharing kernel reduction. -/ +@[expose] def cachedPath00 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -260,6 +271,7 @@ def cachedPath00 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 1, sharing kernel reduction. -/ +@[expose] def cachedPath01 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -315,6 +327,7 @@ def cachedPath01 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 2, sharing kernel reduction. -/ +@[expose] def cachedPath02 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -370,6 +383,7 @@ def cachedPath02 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 3, sharing kernel reduction. -/ +@[expose] def cachedPath03 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -425,6 +439,7 @@ def cachedPath03 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 4, sharing kernel reduction. -/ +@[expose] def cachedPath04 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -480,6 +495,7 @@ def cachedPath04 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 5, sharing kernel reduction. -/ +@[expose] def cachedPath05 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -535,6 +551,7 @@ def cachedPath05 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 6, sharing kernel reduction. -/ +@[expose] def cachedPath06 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -590,6 +607,7 @@ def cachedPath06 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 7, sharing kernel reduction. -/ +@[expose] def cachedPath07 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -645,6 +663,7 @@ def cachedPath07 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 8, sharing kernel reduction. -/ +@[expose] def cachedPath08 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -700,6 +719,7 @@ def cachedPath08 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 9, sharing kernel reduction. -/ +@[expose] def cachedPath09 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -755,6 +775,7 @@ def cachedPath09 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 10, sharing kernel reduction. -/ +@[expose] def cachedPath10 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -810,6 +831,7 @@ def cachedPath10 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 11, sharing kernel reduction. -/ +@[expose] def cachedPath11 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -865,6 +887,7 @@ def cachedPath11 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 12, sharing kernel reduction. -/ +@[expose] def cachedPath12 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -920,6 +943,7 @@ def cachedPath12 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 13, sharing kernel reduction. -/ +@[expose] def cachedPath13 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -975,6 +999,7 @@ def cachedPath13 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 14, sharing kernel reduction. -/ +@[expose] def cachedPath14 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -1030,6 +1055,7 @@ def cachedPath14 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 15, sharing kernel reduction. -/ +@[expose] def cachedPath15 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -1085,6 +1111,7 @@ def cachedPath15 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 16, sharing kernel reduction. -/ +@[expose] def cachedPath16 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -1140,6 +1167,7 @@ def cachedPath16 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 17, sharing kernel reduction. -/ +@[expose] def cachedPath17 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -1195,6 +1223,7 @@ def cachedPath17 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 18, sharing kernel reduction. -/ +@[expose] def cachedPath18 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -1250,6 +1279,7 @@ def cachedPath18 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 19, sharing kernel reduction. -/ +@[expose] def cachedPath19 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -1305,6 +1335,7 @@ def cachedPath19 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 20, sharing kernel reduction. -/ +@[expose] def cachedPath20 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -1360,6 +1391,7 @@ def cachedPath20 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 21, sharing kernel reduction. -/ +@[expose] def cachedPath21 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -1415,6 +1447,7 @@ def cachedPath21 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 22, sharing kernel reduction. -/ +@[expose] def cachedPath22 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -1470,6 +1503,7 @@ def cachedPath22 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 23, sharing kernel reduction. -/ +@[expose] def cachedPath23 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -1525,6 +1559,7 @@ def cachedPath23 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 24, sharing kernel reduction. -/ +@[expose] def cachedPath24 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -1580,6 +1615,7 @@ def cachedPath24 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 25, sharing kernel reduction. -/ +@[expose] def cachedPath25 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -1635,6 +1671,7 @@ def cachedPath25 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 26, sharing kernel reduction. -/ +@[expose] def cachedPath26 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -1690,6 +1727,7 @@ def cachedPath26 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 27, sharing kernel reduction. -/ +@[expose] def cachedPath27 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -1737,6 +1775,7 @@ def cachedPath27 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 28, sharing kernel reduction. -/ +@[expose] def cachedPath28 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -1784,6 +1823,7 @@ def cachedPath28 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 29, sharing kernel reduction. -/ +@[expose] def cachedPath29 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -1831,6 +1871,7 @@ def cachedPath29 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 30, sharing kernel reduction. -/ +@[expose] def cachedPath30 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -1878,6 +1919,7 @@ def cachedPath30 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 31, sharing kernel reduction. -/ +@[expose] def cachedPath31 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -1925,6 +1967,7 @@ def cachedPath31 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 32, sharing kernel reduction. -/ +@[expose] def cachedPath32 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -1972,6 +2015,7 @@ def cachedPath32 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 33, sharing kernel reduction. -/ +@[expose] def cachedPath33 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -2019,6 +2063,7 @@ def cachedPath33 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 34, sharing kernel reduction. -/ +@[expose] def cachedPath34 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -2066,6 +2111,7 @@ def cachedPath34 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 35, sharing kernel reduction. -/ +@[expose] def cachedPath35 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -2113,6 +2159,7 @@ def cachedPath35 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 36, sharing kernel reduction. -/ +@[expose] def cachedPath36 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -2168,6 +2215,7 @@ def cachedPath36 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 37, sharing kernel reduction. -/ +@[expose] def cachedPath37 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -2223,6 +2271,7 @@ def cachedPath37 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 38, sharing kernel reduction. -/ +@[expose] def cachedPath38 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -2278,6 +2327,7 @@ def cachedPath38 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 39, sharing kernel reduction. -/ +@[expose] def cachedPath39 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -2333,6 +2383,7 @@ def cachedPath39 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 40, sharing kernel reduction. -/ +@[expose] def cachedPath40 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -2388,6 +2439,7 @@ def cachedPath40 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 41, sharing kernel reduction. -/ +@[expose] def cachedPath41 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -2443,6 +2495,7 @@ def cachedPath41 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 42, sharing kernel reduction. -/ +@[expose] def cachedPath42 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -2498,6 +2551,7 @@ def cachedPath42 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 43, sharing kernel reduction. -/ +@[expose] def cachedPath43 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -2553,6 +2607,7 @@ def cachedPath43 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 44, sharing kernel reduction. -/ +@[expose] def cachedPath44 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -2608,6 +2663,7 @@ def cachedPath44 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 45, sharing kernel reduction. -/ +@[expose] def cachedPath45 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -2663,6 +2719,7 @@ def cachedPath45 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 46, sharing kernel reduction. -/ +@[expose] def cachedPath46 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -2718,6 +2775,7 @@ def cachedPath46 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 47, sharing kernel reduction. -/ +@[expose] def cachedPath47 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -2773,6 +2831,7 @@ def cachedPath47 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 48, sharing kernel reduction. -/ +@[expose] def cachedPath48 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -2828,6 +2887,7 @@ def cachedPath48 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 49, sharing kernel reduction. -/ +@[expose] def cachedPath49 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -2883,6 +2943,7 @@ def cachedPath49 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 50, sharing kernel reduction. -/ +@[expose] def cachedPath50 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -2938,6 +2999,7 @@ def cachedPath50 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 51, sharing kernel reduction. -/ +@[expose] def cachedPath51 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -2993,6 +3055,7 @@ def cachedPath51 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 52, sharing kernel reduction. -/ +@[expose] def cachedPath52 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -3048,6 +3111,7 @@ def cachedPath52 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 53, sharing kernel reduction. -/ +@[expose] def cachedPath53 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -3103,6 +3167,7 @@ def cachedPath53 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 54, sharing kernel reduction. -/ +@[expose] def cachedPath54 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -3158,6 +3223,7 @@ def cachedPath54 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 55, sharing kernel reduction. -/ +@[expose] def cachedPath55 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -3213,6 +3279,7 @@ def cachedPath55 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 56, sharing kernel reduction. -/ +@[expose] def cachedPath56 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -3268,6 +3335,7 @@ def cachedPath56 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 57, sharing kernel reduction. -/ +@[expose] def cachedPath57 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -3323,6 +3391,7 @@ def cachedPath57 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 58, sharing kernel reduction. -/ +@[expose] def cachedPath58 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -3378,6 +3447,7 @@ def cachedPath58 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 59, sharing kernel reduction. -/ +@[expose] def cachedPath59 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -3433,6 +3503,7 @@ def cachedPath59 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 60, sharing kernel reduction. -/ +@[expose] def cachedPath60 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -3488,6 +3559,7 @@ def cachedPath60 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 61, sharing kernel reduction. -/ +@[expose] def cachedPath61 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -3543,6 +3615,7 @@ def cachedPath61 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 62, sharing kernel reduction. -/ +@[expose] def cachedPath62 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -3598,6 +3671,7 @@ def cachedPath62 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for cell 63, sharing kernel reduction. -/ +@[expose] def cachedPath63 : RatInterval × RatInterval := (⟨(ExactReplay.q (-((naturalFromChunks [ @@ -3649,6 +3723,7 @@ def cachedPath63 : RatInterval × RatInterval := 0]))⟩) /-- The exact cached path-coordinate pair for the selected angle cell. -/ +@[expose] def cachedPath (i : Cell) : RatInterval × RatInterval := match i.val with | 0 => cachedPath00 @@ -3717,6 +3792,7 @@ def cachedPath (i : Cell) : RatInterval × RatInterval := | _ => cachedPath63 /-- The exact cached cosine interval for cell 0, sharing kernel reduction. -/ +@[expose] def cachedCosine00 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -3730,6 +3806,7 @@ def cachedCosine00 : RatInterval := 1)⟩ /-- The exact cached cosine interval for cell 1, sharing kernel reduction. -/ +@[expose] def cachedCosine01 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -3747,6 +3824,7 @@ def cachedCosine01 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 2, sharing kernel reduction. -/ +@[expose] def cachedCosine02 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -3764,6 +3842,7 @@ def cachedCosine02 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 3, sharing kernel reduction. -/ +@[expose] def cachedCosine03 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -3781,6 +3860,7 @@ def cachedCosine03 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 4, sharing kernel reduction. -/ +@[expose] def cachedCosine04 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -3798,6 +3878,7 @@ def cachedCosine04 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 5, sharing kernel reduction. -/ +@[expose] def cachedCosine05 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -3815,6 +3896,7 @@ def cachedCosine05 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 6, sharing kernel reduction. -/ +@[expose] def cachedCosine06 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -3832,6 +3914,7 @@ def cachedCosine06 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 7, sharing kernel reduction. -/ +@[expose] def cachedCosine07 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -3849,6 +3932,7 @@ def cachedCosine07 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 8, sharing kernel reduction. -/ +@[expose] def cachedCosine08 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -3866,6 +3950,7 @@ def cachedCosine08 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 9, sharing kernel reduction. -/ +@[expose] def cachedCosine09 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -3883,6 +3968,7 @@ def cachedCosine09 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 10, sharing kernel reduction. -/ +@[expose] def cachedCosine10 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -3900,6 +3986,7 @@ def cachedCosine10 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 11, sharing kernel reduction. -/ +@[expose] def cachedCosine11 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -3917,6 +4004,7 @@ def cachedCosine11 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 12, sharing kernel reduction. -/ +@[expose] def cachedCosine12 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -3934,6 +4022,7 @@ def cachedCosine12 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 13, sharing kernel reduction. -/ +@[expose] def cachedCosine13 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -3951,6 +4040,7 @@ def cachedCosine13 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 14, sharing kernel reduction. -/ +@[expose] def cachedCosine14 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -3968,6 +4058,7 @@ def cachedCosine14 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 15, sharing kernel reduction. -/ +@[expose] def cachedCosine15 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -3985,6 +4076,7 @@ def cachedCosine15 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 16, sharing kernel reduction. -/ +@[expose] def cachedCosine16 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4002,6 +4094,7 @@ def cachedCosine16 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 17, sharing kernel reduction. -/ +@[expose] def cachedCosine17 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4019,6 +4112,7 @@ def cachedCosine17 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 18, sharing kernel reduction. -/ +@[expose] def cachedCosine18 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4036,6 +4130,7 @@ def cachedCosine18 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 19, sharing kernel reduction. -/ +@[expose] def cachedCosine19 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4053,6 +4148,7 @@ def cachedCosine19 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 20, sharing kernel reduction. -/ +@[expose] def cachedCosine20 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4070,6 +4166,7 @@ def cachedCosine20 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 21, sharing kernel reduction. -/ +@[expose] def cachedCosine21 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4087,6 +4184,7 @@ def cachedCosine21 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 22, sharing kernel reduction. -/ +@[expose] def cachedCosine22 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4104,6 +4202,7 @@ def cachedCosine22 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 23, sharing kernel reduction. -/ +@[expose] def cachedCosine23 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4121,6 +4220,7 @@ def cachedCosine23 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 24, sharing kernel reduction. -/ +@[expose] def cachedCosine24 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4138,6 +4238,7 @@ def cachedCosine24 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 25, sharing kernel reduction. -/ +@[expose] def cachedCosine25 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4155,6 +4256,7 @@ def cachedCosine25 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 26, sharing kernel reduction. -/ +@[expose] def cachedCosine26 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4172,6 +4274,7 @@ def cachedCosine26 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 27, sharing kernel reduction. -/ +@[expose] def cachedCosine27 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4189,6 +4292,7 @@ def cachedCosine27 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 28, sharing kernel reduction. -/ +@[expose] def cachedCosine28 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4206,6 +4310,7 @@ def cachedCosine28 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 29, sharing kernel reduction. -/ +@[expose] def cachedCosine29 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4223,6 +4328,7 @@ def cachedCosine29 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 30, sharing kernel reduction. -/ +@[expose] def cachedCosine30 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4240,6 +4346,7 @@ def cachedCosine30 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 31, sharing kernel reduction. -/ +@[expose] def cachedCosine31 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4257,6 +4364,7 @@ def cachedCosine31 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 32, sharing kernel reduction. -/ +@[expose] def cachedCosine32 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4274,6 +4382,7 @@ def cachedCosine32 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 33, sharing kernel reduction. -/ +@[expose] def cachedCosine33 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4291,6 +4400,7 @@ def cachedCosine33 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 34, sharing kernel reduction. -/ +@[expose] def cachedCosine34 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4308,6 +4418,7 @@ def cachedCosine34 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 35, sharing kernel reduction. -/ +@[expose] def cachedCosine35 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4325,6 +4436,7 @@ def cachedCosine35 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 36, sharing kernel reduction. -/ +@[expose] def cachedCosine36 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4342,6 +4454,7 @@ def cachedCosine36 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 37, sharing kernel reduction. -/ +@[expose] def cachedCosine37 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4359,6 +4472,7 @@ def cachedCosine37 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 38, sharing kernel reduction. -/ +@[expose] def cachedCosine38 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4376,6 +4490,7 @@ def cachedCosine38 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 39, sharing kernel reduction. -/ +@[expose] def cachedCosine39 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4393,6 +4508,7 @@ def cachedCosine39 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 40, sharing kernel reduction. -/ +@[expose] def cachedCosine40 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4410,6 +4526,7 @@ def cachedCosine40 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 41, sharing kernel reduction. -/ +@[expose] def cachedCosine41 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4427,6 +4544,7 @@ def cachedCosine41 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 42, sharing kernel reduction. -/ +@[expose] def cachedCosine42 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4444,6 +4562,7 @@ def cachedCosine42 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 43, sharing kernel reduction. -/ +@[expose] def cachedCosine43 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4461,6 +4580,7 @@ def cachedCosine43 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 44, sharing kernel reduction. -/ +@[expose] def cachedCosine44 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4478,6 +4598,7 @@ def cachedCosine44 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 45, sharing kernel reduction. -/ +@[expose] def cachedCosine45 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4495,6 +4616,7 @@ def cachedCosine45 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 46, sharing kernel reduction. -/ +@[expose] def cachedCosine46 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4512,6 +4634,7 @@ def cachedCosine46 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 47, sharing kernel reduction. -/ +@[expose] def cachedCosine47 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4529,6 +4652,7 @@ def cachedCosine47 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 48, sharing kernel reduction. -/ +@[expose] def cachedCosine48 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4546,6 +4670,7 @@ def cachedCosine48 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 49, sharing kernel reduction. -/ +@[expose] def cachedCosine49 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4563,6 +4688,7 @@ def cachedCosine49 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 50, sharing kernel reduction. -/ +@[expose] def cachedCosine50 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4580,6 +4706,7 @@ def cachedCosine50 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 51, sharing kernel reduction. -/ +@[expose] def cachedCosine51 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4597,6 +4724,7 @@ def cachedCosine51 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 52, sharing kernel reduction. -/ +@[expose] def cachedCosine52 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4614,6 +4742,7 @@ def cachedCosine52 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 53, sharing kernel reduction. -/ +@[expose] def cachedCosine53 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4631,6 +4760,7 @@ def cachedCosine53 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 54, sharing kernel reduction. -/ +@[expose] def cachedCosine54 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4648,6 +4778,7 @@ def cachedCosine54 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 55, sharing kernel reduction. -/ +@[expose] def cachedCosine55 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4665,6 +4796,7 @@ def cachedCosine55 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 56, sharing kernel reduction. -/ +@[expose] def cachedCosine56 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4682,6 +4814,7 @@ def cachedCosine56 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 57, sharing kernel reduction. -/ +@[expose] def cachedCosine57 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4699,6 +4832,7 @@ def cachedCosine57 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 58, sharing kernel reduction. -/ +@[expose] def cachedCosine58 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4716,6 +4850,7 @@ def cachedCosine58 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 59, sharing kernel reduction. -/ +@[expose] def cachedCosine59 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4733,6 +4868,7 @@ def cachedCosine59 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 60, sharing kernel reduction. -/ +@[expose] def cachedCosine60 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4750,6 +4886,7 @@ def cachedCosine60 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 61, sharing kernel reduction. -/ +@[expose] def cachedCosine61 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4767,6 +4904,7 @@ def cachedCosine61 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 62, sharing kernel reduction. -/ +@[expose] def cachedCosine62 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4784,6 +4922,7 @@ def cachedCosine62 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for cell 63, sharing kernel reduction. -/ +@[expose] def cachedCosine63 : RatInterval := ⟨(ExactReplay.q 0 @@ -4797,6 +4936,7 @@ def cachedCosine63 : RatInterval := 0]))⟩ /-- The exact cached cosine interval for the selected angle cell. -/ +@[expose] def cachedCosine (i : Cell) : RatInterval := match i.val with | 0 => cachedCosine00 @@ -4865,6 +5005,7 @@ def cachedCosine (i : Cell) : RatInterval := | _ => cachedCosine63 /-- The exact cached sine interval for cell 0, sharing kernel reduction. -/ +@[expose] def cachedSine00 : RatInterval := ⟨(ExactReplay.q 0 @@ -4878,6 +5019,7 @@ def cachedSine00 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 1, sharing kernel reduction. -/ +@[expose] def cachedSine01 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4895,6 +5037,7 @@ def cachedSine01 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 2, sharing kernel reduction. -/ +@[expose] def cachedSine02 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4912,6 +5055,7 @@ def cachedSine02 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 3, sharing kernel reduction. -/ +@[expose] def cachedSine03 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4929,6 +5073,7 @@ def cachedSine03 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 4, sharing kernel reduction. -/ +@[expose] def cachedSine04 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4946,6 +5091,7 @@ def cachedSine04 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 5, sharing kernel reduction. -/ +@[expose] def cachedSine05 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4963,6 +5109,7 @@ def cachedSine05 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 6, sharing kernel reduction. -/ +@[expose] def cachedSine06 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4980,6 +5127,7 @@ def cachedSine06 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 7, sharing kernel reduction. -/ +@[expose] def cachedSine07 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -4997,6 +5145,7 @@ def cachedSine07 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 8, sharing kernel reduction. -/ +@[expose] def cachedSine08 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5014,6 +5163,7 @@ def cachedSine08 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 9, sharing kernel reduction. -/ +@[expose] def cachedSine09 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5031,6 +5181,7 @@ def cachedSine09 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 10, sharing kernel reduction. -/ +@[expose] def cachedSine10 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5048,6 +5199,7 @@ def cachedSine10 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 11, sharing kernel reduction. -/ +@[expose] def cachedSine11 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5065,6 +5217,7 @@ def cachedSine11 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 12, sharing kernel reduction. -/ +@[expose] def cachedSine12 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5082,6 +5235,7 @@ def cachedSine12 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 13, sharing kernel reduction. -/ +@[expose] def cachedSine13 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5099,6 +5253,7 @@ def cachedSine13 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 14, sharing kernel reduction. -/ +@[expose] def cachedSine14 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5116,6 +5271,7 @@ def cachedSine14 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 15, sharing kernel reduction. -/ +@[expose] def cachedSine15 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5133,6 +5289,7 @@ def cachedSine15 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 16, sharing kernel reduction. -/ +@[expose] def cachedSine16 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5150,6 +5307,7 @@ def cachedSine16 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 17, sharing kernel reduction. -/ +@[expose] def cachedSine17 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5167,6 +5325,7 @@ def cachedSine17 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 18, sharing kernel reduction. -/ +@[expose] def cachedSine18 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5184,6 +5343,7 @@ def cachedSine18 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 19, sharing kernel reduction. -/ +@[expose] def cachedSine19 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5201,6 +5361,7 @@ def cachedSine19 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 20, sharing kernel reduction. -/ +@[expose] def cachedSine20 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5218,6 +5379,7 @@ def cachedSine20 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 21, sharing kernel reduction. -/ +@[expose] def cachedSine21 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5235,6 +5397,7 @@ def cachedSine21 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 22, sharing kernel reduction. -/ +@[expose] def cachedSine22 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5252,6 +5415,7 @@ def cachedSine22 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 23, sharing kernel reduction. -/ +@[expose] def cachedSine23 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5269,6 +5433,7 @@ def cachedSine23 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 24, sharing kernel reduction. -/ +@[expose] def cachedSine24 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5286,6 +5451,7 @@ def cachedSine24 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 25, sharing kernel reduction. -/ +@[expose] def cachedSine25 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5303,6 +5469,7 @@ def cachedSine25 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 26, sharing kernel reduction. -/ +@[expose] def cachedSine26 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5320,6 +5487,7 @@ def cachedSine26 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 27, sharing kernel reduction. -/ +@[expose] def cachedSine27 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5337,6 +5505,7 @@ def cachedSine27 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 28, sharing kernel reduction. -/ +@[expose] def cachedSine28 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5354,6 +5523,7 @@ def cachedSine28 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 29, sharing kernel reduction. -/ +@[expose] def cachedSine29 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5371,6 +5541,7 @@ def cachedSine29 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 30, sharing kernel reduction. -/ +@[expose] def cachedSine30 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5388,6 +5559,7 @@ def cachedSine30 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 31, sharing kernel reduction. -/ +@[expose] def cachedSine31 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5405,6 +5577,7 @@ def cachedSine31 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 32, sharing kernel reduction. -/ +@[expose] def cachedSine32 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5422,6 +5595,7 @@ def cachedSine32 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 33, sharing kernel reduction. -/ +@[expose] def cachedSine33 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5439,6 +5613,7 @@ def cachedSine33 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 34, sharing kernel reduction. -/ +@[expose] def cachedSine34 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5456,6 +5631,7 @@ def cachedSine34 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 35, sharing kernel reduction. -/ +@[expose] def cachedSine35 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5473,6 +5649,7 @@ def cachedSine35 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 36, sharing kernel reduction. -/ +@[expose] def cachedSine36 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5490,6 +5667,7 @@ def cachedSine36 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 37, sharing kernel reduction. -/ +@[expose] def cachedSine37 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5507,6 +5685,7 @@ def cachedSine37 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 38, sharing kernel reduction. -/ +@[expose] def cachedSine38 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5524,6 +5703,7 @@ def cachedSine38 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 39, sharing kernel reduction. -/ +@[expose] def cachedSine39 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5541,6 +5721,7 @@ def cachedSine39 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 40, sharing kernel reduction. -/ +@[expose] def cachedSine40 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5558,6 +5739,7 @@ def cachedSine40 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 41, sharing kernel reduction. -/ +@[expose] def cachedSine41 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5575,6 +5757,7 @@ def cachedSine41 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 42, sharing kernel reduction. -/ +@[expose] def cachedSine42 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5592,6 +5775,7 @@ def cachedSine42 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 43, sharing kernel reduction. -/ +@[expose] def cachedSine43 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5609,6 +5793,7 @@ def cachedSine43 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 44, sharing kernel reduction. -/ +@[expose] def cachedSine44 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5626,6 +5811,7 @@ def cachedSine44 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 45, sharing kernel reduction. -/ +@[expose] def cachedSine45 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5643,6 +5829,7 @@ def cachedSine45 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 46, sharing kernel reduction. -/ +@[expose] def cachedSine46 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5660,6 +5847,7 @@ def cachedSine46 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 47, sharing kernel reduction. -/ +@[expose] def cachedSine47 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5677,6 +5865,7 @@ def cachedSine47 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 48, sharing kernel reduction. -/ +@[expose] def cachedSine48 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5694,6 +5883,7 @@ def cachedSine48 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 49, sharing kernel reduction. -/ +@[expose] def cachedSine49 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5711,6 +5901,7 @@ def cachedSine49 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 50, sharing kernel reduction. -/ +@[expose] def cachedSine50 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5728,6 +5919,7 @@ def cachedSine50 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 51, sharing kernel reduction. -/ +@[expose] def cachedSine51 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5745,6 +5937,7 @@ def cachedSine51 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 52, sharing kernel reduction. -/ +@[expose] def cachedSine52 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5762,6 +5955,7 @@ def cachedSine52 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 53, sharing kernel reduction. -/ +@[expose] def cachedSine53 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5779,6 +5973,7 @@ def cachedSine53 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 54, sharing kernel reduction. -/ +@[expose] def cachedSine54 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5796,6 +5991,7 @@ def cachedSine54 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 55, sharing kernel reduction. -/ +@[expose] def cachedSine55 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5813,6 +6009,7 @@ def cachedSine55 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 56, sharing kernel reduction. -/ +@[expose] def cachedSine56 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5830,6 +6027,7 @@ def cachedSine56 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 57, sharing kernel reduction. -/ +@[expose] def cachedSine57 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5847,6 +6045,7 @@ def cachedSine57 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 58, sharing kernel reduction. -/ +@[expose] def cachedSine58 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5864,6 +6063,7 @@ def cachedSine58 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 59, sharing kernel reduction. -/ +@[expose] def cachedSine59 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5881,6 +6081,7 @@ def cachedSine59 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 60, sharing kernel reduction. -/ +@[expose] def cachedSine60 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5898,6 +6099,7 @@ def cachedSine60 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 61, sharing kernel reduction. -/ +@[expose] def cachedSine61 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5915,6 +6117,7 @@ def cachedSine61 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 62, sharing kernel reduction. -/ +@[expose] def cachedSine62 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5932,6 +6135,7 @@ def cachedSine62 : RatInterval := 0]))⟩ /-- The exact cached sine interval for cell 63, sharing kernel reduction. -/ +@[expose] def cachedSine63 : RatInterval := ⟨(ExactReplay.q (naturalFromChunks [ @@ -5945,6 +6149,7 @@ def cachedSine63 : RatInterval := 1)⟩ /-- The exact cached sine interval for the selected angle cell. -/ +@[expose] def cachedSine (i : Cell) : RatInterval := match i.val with | 0 => cachedSine00 @@ -6063,7 +6268,7 @@ Authors: Dawid Trela * `KernelOnly.PartB.CellRows.Row63`. -/ -@[expose] public section +public section noncomputable section @@ -6074,7 +6279,7 @@ Independent exact product-cell lower bounds for row 48. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_48 : @@ -6097,7 +6302,7 @@ Independent exact product-cell lower bounds for row 49. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_49 : @@ -6120,7 +6325,7 @@ Independent exact product-cell lower bounds for row 50. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_50 : @@ -6143,7 +6348,7 @@ Independent exact product-cell lower bounds for row 51. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_51 : @@ -6166,7 +6371,7 @@ Independent exact product-cell lower bounds for row 52. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_52 : @@ -6189,7 +6394,7 @@ Independent exact product-cell lower bounds for row 53. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_53 : @@ -6212,7 +6417,7 @@ Independent exact product-cell lower bounds for row 54. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_54 : @@ -6235,7 +6440,7 @@ Independent exact product-cell lower bounds for row 55. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_55 : @@ -6258,7 +6463,7 @@ Independent exact product-cell lower bounds for row 56. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_56 : @@ -6281,7 +6486,7 @@ Independent exact product-cell lower bounds for row 57. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_57 : @@ -6304,7 +6509,7 @@ Independent exact product-cell lower bounds for row 58. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_58 : @@ -6327,7 +6532,7 @@ Independent exact product-cell lower bounds for row 59. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_59 : @@ -6350,7 +6555,7 @@ Independent exact product-cell lower bounds for row 60. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_60 : @@ -6373,7 +6578,7 @@ Independent exact product-cell lower bounds for row 61. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_61 : @@ -6396,7 +6601,7 @@ Independent exact product-cell lower bounds for row 62. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_62 : @@ -6419,7 +6624,7 @@ Independent exact product-cell lower bounds for row 63. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_63 : @@ -6469,7 +6674,7 @@ Authors: Dawid Trela * `KernelOnly.PartB.CellRows.Row47`. -/ -@[expose] public section +public section noncomputable section @@ -6480,7 +6685,7 @@ Independent exact product-cell lower bounds for row 32. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_32 : @@ -6503,7 +6708,7 @@ Independent exact product-cell lower bounds for row 33. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_33 : @@ -6526,7 +6731,7 @@ Independent exact product-cell lower bounds for row 34. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_34 : @@ -6549,7 +6754,7 @@ Independent exact product-cell lower bounds for row 35. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_35 : @@ -6572,7 +6777,7 @@ Independent exact product-cell lower bounds for row 36. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_36 : @@ -6595,7 +6800,7 @@ Independent exact product-cell lower bounds for row 37. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_37 : @@ -6618,7 +6823,7 @@ Independent exact product-cell lower bounds for row 38. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_38 : @@ -6641,7 +6846,7 @@ Independent exact product-cell lower bounds for row 39. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_39 : @@ -6664,7 +6869,7 @@ Independent exact product-cell lower bounds for row 40. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_40 : @@ -6687,7 +6892,7 @@ Independent exact product-cell lower bounds for row 41. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_41 : @@ -6710,7 +6915,7 @@ Independent exact product-cell lower bounds for row 42. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_42 : @@ -6733,7 +6938,7 @@ Independent exact product-cell lower bounds for row 43. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_43 : @@ -6756,7 +6961,7 @@ Independent exact product-cell lower bounds for row 44. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_44 : @@ -6779,7 +6984,7 @@ Independent exact product-cell lower bounds for row 45. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_45 : @@ -6802,7 +7007,7 @@ Independent exact product-cell lower bounds for row 46. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_46 : @@ -6825,7 +7030,7 @@ Independent exact product-cell lower bounds for row 47. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_47 : @@ -6875,7 +7080,7 @@ Authors: Dawid Trela * `KernelOnly.PartB.CellRows.Row31`. -/ -@[expose] public section +public section noncomputable section @@ -6886,7 +7091,7 @@ Independent exact product-cell lower bounds for row 16. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_16 : @@ -6909,7 +7114,7 @@ Independent exact product-cell lower bounds for row 17. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_17 : @@ -6932,7 +7137,7 @@ Independent exact product-cell lower bounds for row 18. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_18 : @@ -6955,7 +7160,7 @@ Independent exact product-cell lower bounds for row 19. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_19 : @@ -6978,7 +7183,7 @@ Independent exact product-cell lower bounds for row 20. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_20 : @@ -7001,7 +7206,7 @@ Independent exact product-cell lower bounds for row 21. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_21 : @@ -7024,7 +7229,7 @@ Independent exact product-cell lower bounds for row 22. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_22 : @@ -7047,7 +7252,7 @@ Independent exact product-cell lower bounds for row 23. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_23 : @@ -7070,7 +7275,7 @@ Independent exact product-cell lower bounds for row 24. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_24 : @@ -7093,7 +7298,7 @@ Independent exact product-cell lower bounds for row 25. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_25 : @@ -7116,7 +7321,7 @@ Independent exact product-cell lower bounds for row 26. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_26 : @@ -7139,7 +7344,7 @@ Independent exact product-cell lower bounds for row 27. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_27 : @@ -7162,7 +7367,7 @@ Independent exact product-cell lower bounds for row 28. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_28 : @@ -7185,7 +7390,7 @@ Independent exact product-cell lower bounds for row 29. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_29 : @@ -7208,7 +7413,7 @@ Independent exact product-cell lower bounds for row 30. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_30 : @@ -7231,7 +7436,7 @@ Independent exact product-cell lower bounds for row 31. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_31 : @@ -7281,7 +7486,7 @@ Authors: Dawid Trela * `KernelOnly.PartB.CellRows.Row15`. -/ -@[expose] public section +public section noncomputable section @@ -7292,7 +7497,7 @@ Independent exact product-cell lower bounds for row 00. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_00 : @@ -7315,7 +7520,7 @@ Independent exact product-cell lower bounds for row 01. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_01 : @@ -7338,7 +7543,7 @@ Independent exact product-cell lower bounds for row 02. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_02 : @@ -7361,7 +7566,7 @@ Independent exact product-cell lower bounds for row 03. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_03 : @@ -7384,7 +7589,7 @@ Independent exact product-cell lower bounds for row 04. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_04 : @@ -7407,7 +7612,7 @@ Independent exact product-cell lower bounds for row 05. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_05 : @@ -7430,7 +7635,7 @@ Independent exact product-cell lower bounds for row 06. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_06 : @@ -7453,7 +7658,7 @@ Independent exact product-cell lower bounds for row 07. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_07 : @@ -7476,7 +7681,7 @@ Independent exact product-cell lower bounds for row 08. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_08 : @@ -7499,7 +7704,7 @@ Independent exact product-cell lower bounds for row 09. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_09 : @@ -7522,7 +7727,7 @@ Independent exact product-cell lower bounds for row 10. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_10 : @@ -7545,7 +7750,7 @@ Independent exact product-cell lower bounds for row 11. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_11 : @@ -7568,7 +7773,7 @@ Independent exact product-cell lower bounds for row 12. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_12 : @@ -7591,7 +7796,7 @@ Independent exact product-cell lower bounds for row 13. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_13 : @@ -7614,7 +7819,7 @@ Independent exact product-cell lower bounds for row 14. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_14 : @@ -7637,7 +7842,7 @@ Independent exact product-cell lower bounds for row 15. Build all 64 row modules sequentially before the final Part B assembly. -/ -@[expose] public section +public section namespace GerverSofa.PartB theorem cell_row_15 : @@ -7672,7 +7877,7 @@ Authors: Dawid Trela * `KernelOnly.PartB.AllRows`. -/ -@[expose] public section +public section noncomputable section @@ -7680,7 +7885,7 @@ section /-! Assembly of the 64 independently kernel-checked product-cell rows. -/ -@[expose] public section +public section namespace GerverSofa.PartB diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/Core/Bundle004.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/Core/Bundle004.lean index 71ed7fbab2..d41a85714a 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/Core/Bundle004.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/Core/Bundle004.lean @@ -15,7 +15,7 @@ public import Mathlib.LinearAlgebra.FiniteDimensional.Basic * `GerverSofa.KernelOnly.Foundation.Batch002`. -/ -@[expose] public section +public section noncomputable section @@ -37,7 +37,7 @@ Authors: Dawid Trela * `KernelOnly.LeanCertGerverNumericsCore`. -/ -@[expose] public section +public section noncomputable section @@ -60,7 +60,7 @@ rational data already used by `ExactReplay`. This avoids exposing private helpers during simplification. -/ -@[expose] public section +public section noncomputable section @@ -71,9 +71,11 @@ open LeanCert.Core open LeanCert.Engine /-- Construct an exact rational from an integer numerator and natural denominator. -/ +@[expose] def q (n : Int) (d : Nat) : ℚ := (n : ℚ) / (d : ℚ) /-- The rational preconditioner table for the four reduced equations. -/ +@[expose] def reducedCData : List (List ℚ) := [ [q (-6807128249614081174405751646233895883477) 10000000000000000000000000000000000000000, q (-1668645298254898823756872685901589912999) 5000000000000000000000000000000000000000, q @@ -94,6 +96,7 @@ def reducedCData : List (List ℚ) := [ ] /-- The rational preconditioner table for the twenty-two full equations. -/ +@[expose] def fullCData : List (List ℚ) := [ [q 97524664435861749 500000000000000000000000000000000000, q 0 1, q 0 1, q 0 1, q 101771747759019027 100000000000000000, q 1 1, q 0 1, q 63813611575753437 50000000000000000, q @@ -263,16 +266,19 @@ def fullCData : List (List ℚ) := [ ] /-- Interpret rational row lists as a square matrix, using zero for missing entries. -/ +@[expose] def listMatrix {n : Nat} (rows : List (List ℚ)) : Matrix (Fin n) (Fin n) ℚ := fun i j => ExactReplay.getQ (ExactReplay.getRow rows i.1) j.1 /-- The rational midpoint of a selected interval coordinate. -/ +@[expose] def boxMid (box : List RatInterval) (i : Nat) : ℚ := let z := ExactReplay.getI box i (z.lo + z.hi) / 2 /-- Half the width of a selected rational interval coordinate. -/ +@[expose] def boxRad (box : List RatInterval) (i : Nat) : ℚ := let z := ExactReplay.getI box i (z.hi - z.lo) / 2 @@ -288,6 +294,7 @@ def normalizeToBox {n : Nat} (box : List RatInterval) fun i => (x i - (boxMid box i.1 : ℝ)) / (boxRad box i.1 : ℝ) /-- The coordinate box with interval `[-1, 1]` in every dimension. -/ +@[expose] def unitBox {n : Nat} : Fin n → IntervalRat := fun _ => { lo := -1 @@ -295,19 +302,23 @@ def unitBox {n : Nat} : Fin n → IntervalRat := le := by norm_num } /-- The rational origin used as the normalized Newton center. -/ +@[expose] def zeroCenter {n : Nat} : Fin n → ℚ := fun _ => 0 /-- Rescale each preconditioner row by the inverse box radius. -/ +@[expose] def scaledPreconditioner {n : Nat} (box : List RatInterval) (rows : List (List ℚ)) : Matrix (Fin n) (Fin n) ℚ := fun i j => (boxRad box i.1)⁻¹ * listMatrix rows i j /-- The preconditioner for the normalized four-dimensional system. -/ +@[expose] def reducedY : Matrix (Fin 4) (Fin 4) ℚ := scaledPreconditioner ExactReplay.reducedInputBox reducedCData /-- The preconditioner for the normalized twenty-two-dimensional system. -/ +@[expose] def fullY : Matrix (Fin 22) (Fin 22) ℚ := scaledPreconditioner ExactReplay.fullInputBox fullCData @@ -327,6 +338,7 @@ def reducedNormalize : (Fin 4 → ℝ) → Fin 4 → ℝ := The legacy exact bounds are ~5.2e-13 (4D) and ~8.6e-11 (22D), so `1/100` leaves many orders of magnitude of slack while keeping the normalized self-map well inside the unit box. -/ +@[expose] def qTarget : ℚ := 1 / 100 end PartALeanCert @@ -356,7 +368,7 @@ matrix norm machinery, Newton map, and contraction theorem unchanged. No interval arithmetic is reimplemented here. -/ -@[expose] public section +public section noncomputable section @@ -383,6 +395,7 @@ inductive ADConstSupported : Expr → Prop where | namedConst (c : MathConst) : ADConstSupported (.namedConst c) /-- Computable recognition of the exact fragment used by the Gerver models. -/ +@[expose] def checkADConstSupported : Expr → Bool | .const _ | .var _ | .namedConst _ => true | .add a b | .mul a b => checkADConstSupported a && checkADConstSupported b @@ -746,7 +759,7 @@ named mathematical constants. `LeanCertNamedConstAD` supplies the one missing soundness case for `namedConst` (derivative zero). -/ -@[expose] public section +public section noncomputable section @@ -760,34 +773,34 @@ open LeanCert.Engine abbrev E := Expr /-- A rational constant expression. -/ -def ec (r : ℚ) : E := .const r +@[expose] def ec (r : ℚ) : E := .const r /-- An indexed variable expression. -/ -def ev (i : Nat) : E := .var i +@[expose] def ev (i : Nat) : E := .var i /-- Construct the sum of two expressions. -/ -def eadd (a b : E) : E := .add a b +@[expose] def eadd (a b : E) : E := .add a b /-- Construct the negation of an expression. -/ -def eneg (a : E) : E := .neg a +@[expose] def eneg (a : E) : E := .neg a /-- Construct a difference using addition and negation. -/ -def esub (a b : E) : E := .add a (.neg b) +@[expose] def esub (a b : E) : E := .add a (.neg b) /-- Construct the product of two expressions. -/ -def emul (a b : E) : E := .mul a b +@[expose] def emul (a b : E) : E := .mul a b /-- Multiply an expression by a rational constant. -/ -def escale (r : ℚ) (a : E) : E := .mul (.const r) a +@[expose] def escale (r : ℚ) (a : E) : E := .mul (.const r) a /-- Apply sine in the expression syntax. -/ -def esin (a : E) : E := .sin a +@[expose] def esin (a : E) : E := .sin a /-- Apply cosine in the expression syntax. -/ -def ecos (a : E) : E := .cos a +@[expose] def ecos (a : E) : E := .cos a /-- The named π constant in the expression syntax. -/ -def epi : E := .namedConst .pi +@[expose] def epi : E := .namedConst .pi /-- An expression for a box coordinate in terms of its normalized variable. -/ -def scaledVar (box : List RatInterval) (i : Nat) : E := +@[expose] def scaledVar (box : List RatInterval) (i : Nat) : E := eadd (ec (boxMid box i)) (emul (ec (boxRad box i)) (ev i)) /-! ## Reduced 4D -/ /-- The four reduced equations encoded as evaluator expressions. -/ -def reducedExprList : List E := +@[expose] def reducedExprList : List E := let a := scaledVar ExactReplay.reducedInputBox 0 let b := scaledVar ExactReplay.reducedInputBox 1 let phi := scaledVar ExactReplay.reducedInputBox 2 @@ -841,32 +854,32 @@ def reducedExprList : List E := List.cons f1 (List.cons f2 (List.cons f3 (List.cons f4 List.nil))) /-- Select an equation from the reduced four-dimensional expression system. -/ -def reducedExpr (i : Fin 4) : E := +@[expose] def reducedExpr (i : Fin 4) : E := reducedExprList.getD i.1 (ec 0) /-! ## Direct 22D -/ /-- A full Romik parameter encoded as a normalized variable expression. -/ -def fv (i : Nat) : E := scaledVar ExactReplay.fullInputBox i +@[expose] def fv (i : Nat) : E := scaledVar ExactReplay.fullInputBox i /-- The expression for the first switching angle φ. -/ -def phiE : E := fv 20 +@[expose] def phiE : E := fv 20 /-- The expression for the second switching angle θ. -/ -def thetaE : E := fv 21 +@[expose] def thetaE : E := fv 21 /-- The expression for the reflected angle `π/2 - θ`. -/ -def etaE : E := esub (escale (1 / 2) epi) thetaE +@[expose] def etaE : E := esub (escale (1 / 2) epi) thetaE /-- The expression for the reflected angle `π/2 - φ`. -/ -def tauE : E := esub (escale (1 / 2) epi) phiE +@[expose] def tauE : E := esub (escale (1 / 2) epi) phiE /-- Rotate a pair of coordinate expressions by an angle expression. -/ -def rotE (t z1 z2 : E) : E × E := +@[expose] def rotE (t z1 z2 : E) : E × E := let ct := ecos t let st := esin t (esub (emul ct z1) (emul st z2), eadd (emul st z1) (emul ct z2)) /-- Encode a selected closed path branch as two coordinate expressions. -/ -def pathPieceE (j : Nat) (t : E) : E × E := +@[expose] def pathPieceE (j : Nat) (t : E) : E × E := let one := ec 1 let half := ec (1 / 2) let quarter := ec (1 / 4) @@ -895,7 +908,7 @@ def pathPieceE (j : Nat) (t : E) : E × E := (eadd rr.1 data.2.2.1, eadd rr.2 data.2.2.2) /-- Encode the body-frame velocity of a selected path branch. -/ -def alphaBetaE (j : Nat) (t : E) : E × E := +@[expose] def alphaBetaE (j : Nat) (t : E) : E × E := let one := ec 1 let half := ec (1 / 2) let quarter := ec (1 / 4) @@ -924,12 +937,12 @@ def alphaBetaE (j : Nat) (t : E) : E × E := (emul (escale 2 (fv 19)) st)) half) /-- Encode the world-frame derivative of a selected path branch. -/ -def pathPrimeE (j : Nat) (t : E) : E × E := +@[expose] def pathPrimeE (j : Nat) (t : E) : E × E := let ab := alphaBetaE j t rotE t ab.1 ab.2 /-- The twenty-two full equations encoded as evaluator expressions. -/ -def fullExprList : List E := +@[expose] def fullExprList : List E := let halfPi := escale (1 / 2) epi let quarterPi := escale (1 / 4) epi let one := ec 1 @@ -966,7 +979,7 @@ def fullExprList : List E := List.cons (esub lhs.1 be.1) (List.cons (esub lhs.2 be.2) List.nil) /-- Select one equation from the full Romik expression system. -/ -def fullExpr (i : Fin 22) : E := +@[expose] def fullExpr (i : Fin 22) : E := fullExprList.getD i.1 (ec 0) /-- Purely syntactic support checks for the Gerver expression fragment. -/ @@ -997,7 +1010,7 @@ section # Gerver Sofa / Kernel Only / Lean Cert Gerver Correspondence -/ -@[expose] public section +public section noncomputable section @@ -1666,7 +1679,7 @@ this one finite sum by structural recursion on `Fin n`. Mathlib's existing `Fin.sum_univ_succ` is the semantic bridge to the ordinary real finite sum. -/ -@[expose] public section +public section noncomputable section @@ -1678,6 +1691,7 @@ open LeanCert.Engine /-- A finite interval sum that reduces by structural recursion, with no `AddCommMonoid IntervalRat` instance involved in computation. -/ +@[expose] def kernelIntervalFinSum : {n : Nat} → (Fin n → IntervalRat) → IntervalRat | 0, _ => IntervalRat.singleton 0 | n + 1, f => @@ -1703,6 +1717,7 @@ theorem mem_kernelIntervalFinSum : (fun j => h j.succ)) /-- Kernel-reducible exact interval matrix-vector product. -/ +@[expose] def kernelIntervalRatMatVec {n : Nat} (Y : Matrix (Fin n) (Fin n) ℚ) (v : Fin n → IntervalRat) : Fin n → IntervalRat := @@ -1736,6 +1751,7 @@ its named-constant machinery does not always normalize far enough for closed `decide +kernel` comparisons. Reusing the project's already-certified exact rational π endpoints removes only that reduction bottleneck; it does not change the represented real constant or weaken any enclosure. -/ +@[expose] def kernelPiInterval : IntervalRat := { lo := ExactReplay.piI.lo hi := ExactReplay.piI.hi @@ -1750,6 +1766,7 @@ theorem real_pi_mem_kernelPiInterval : Real.pi ∈ kernelPiInterval := by /-- Named constants for the point evaluator. π takes the specialized kernel-reducible path; every other LeanCert named constant keeps LeanCert's public certified interval unchanged. -/ +@[expose] def kernelNamedConstInterval (c : MathConst) : IntervalRat := if c = .pi then kernelPiInterval else c.interval @@ -1757,6 +1774,7 @@ def kernelNamedConstInterval (c : MathConst) : IntervalRat := Unsupported constructors are deliberately mapped to `{0}`; the soundness lemma below is only stated for `ADConstSupported`, whose constructors are all handled explicitly. -/ +@[expose] def kernelPointEvalCore (e : Expr) (ρ : IntervalEnv) (depth : Nat) : IntervalRat := match e with @@ -1826,10 +1844,12 @@ exact-rational replay of all strictly inside the unit box. It materially reduces kernel rational size compared with depth 27/34 while leaving the Jacobian evaluator and its already-passing certificates untouched. -/ +@[expose] def kernelCenterTaylorDepth (n : Nat) : Nat := if n ≤ 4 then 20 else 26 /-- Point-value enclosures for a square system at a rational center. -/ +@[expose] def pointEvalIntervalsKernel {n : Nat} (F : Fin n → Expr) (m : Fin n → ℚ) (_cfg : EvalConfig := {}) : Fin n → IntervalRat := @@ -1851,6 +1871,7 @@ theorem systemEval_mem_pointEvalIntervalsKernel_const {n : Nat} (finEnv_ratCast_mem_pointIntervalEnv m) (kernelCenterTaylorDepth n) /-- Kernel-reducible version of LeanCert's Newton-center enclosure. -/ +@[expose] def kernelNewtonCenterInterval {n : Nat} (F : Fin n → Expr) (m : Fin n → ℚ) (Y : Matrix (Fin n) (Fin n) ℚ) @@ -1879,6 +1900,7 @@ theorem newtonMap_center_mem_kernel_const {n : Nat} /-- Same checked self-map enclosure as before, now with a kernel-reducible finite interval sum at the Newton center. -/ +@[expose] def imageEnclosureWithQ {n : Nat} (F : Fin n → Expr) (X : Fin n → IntervalRat) (m : Fin n → ℚ) (Y : Matrix (Fin n) (Fin n) ℚ) @@ -2084,6 +2106,7 @@ by a kernel proof that the corresponding real system value lies in it. -/ /-- Endpoint inclusion between two rational intervals. -/ +@[expose] def intervalContained (I J : IntervalRat) : Prop := J.lo ≤ I.lo ∧ I.hi ≤ J.hi @@ -2099,6 +2122,7 @@ theorem mem_of_intervalContained {x : ℝ} {I J : IntervalRat} /-- Newton-center enclosure from externally supplied, proof-carrying point value intervals. -/ +@[expose] def kernelNewtonCenterIntervalWithValues {n : Nat} (m : Fin n → ℚ) (Y : Matrix (Fin n) (Fin n) ℚ) (V : Fin n → IntervalRat) : Fin n → IntervalRat := @@ -2124,6 +2148,7 @@ theorem newtonMap_center_mem_kernel_values {n : Nat} (fun j => IntervalRat.mem_scale (Y i j) (hV j)) /-- Self-map enclosure built from independently certified center values. -/ +@[expose] def imageEnclosureWithValuesQ {n : Nat} (X : Fin n → IntervalRat) (m : Fin n → ℚ) (Y : Matrix (Fin n) (Fin n) ℚ) (V : Fin n → IntervalRat) @@ -2256,7 +2281,7 @@ Only shared definitions and lightweight list lemmas live here. The expensive 22D kernel checks are split into one Lake module per row. -/ -@[expose] public section +public section noncomputable section @@ -2267,14 +2292,17 @@ open LeanCert.Core open LeanCert.Engine /-- The default evaluation configuration used for the numerical certificates. -/ +@[expose] def cfg : EvalConfig := {} /-- The interval enclosure of the normalized reduced Newton-map derivative. -/ +@[expose] def reducedPJ : Matrix (Fin 4) (Fin 4) IntervalRat := preconditionedJacobian reducedY (intervalJacobian reducedExpr (unitBox (n := 4)) cfg) /-- The interval enclosure of the normalized full Newton-map derivative. -/ +@[expose] def fullPJ : Matrix (Fin 22) (Fin 22) IntervalRat := preconditionedJacobian fullY (intervalJacobian fullExpr (unitBox (n := 22)) cfg) @@ -2315,6 +2343,7 @@ leave a large self-map margin. Each coordinate is checked independently in a separate module before it is used by the final contraction theorem. -/ /-- Cached interval evaluations of the full system at the normalized center. -/ +@[expose] def fullPointCacheList : List IntervalRat := [ ⟨q (-1) 100000000000000000000000000000, q 1 100000000000000000000000000000, by norm_num [q]⟩, ⟨q (-1) 100000000000000000000000000000, q 1 100000000000000000000000000000, by norm_num [q]⟩, @@ -2341,15 +2370,18 @@ def fullPointCacheList : List IntervalRat := [ ] /-- Select a cached center evaluation of a full-system equation. -/ +@[expose] def fullPointCache (i : Fin 22) : IntervalRat := fullPointCacheList.getD i.1 (IntervalRat.singleton 0) /-- The full Newton image enclosure computed with cached center evaluations. -/ +@[expose] def fullImageCachedQ (i : Fin 22) : IntervalRat := imageEnclosureWithValuesQ (unitBox (n := 22)) (zeroCenter (n := 22)) fullY fullPointCache qTarget i /-- The reduced Newton image enclosure on the normalized unit box. -/ +@[expose] def reducedImageQ (i : Fin 4) : IntervalRat := imageEnclosureWithQ reducedExpr (unitBox (n := 4)) (zeroCenter (n := 4)) reducedY cfg qTarget i diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/Core/Bundle005.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/Core/Bundle005.lean index cde177c757..4cf5c1b558 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/Core/Bundle005.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/Core/Bundle005.lean @@ -28,7 +28,7 @@ public import Mathlib.Tactic.Ring * `GerverSofa.KernelOnly.PartB.Semantics.Batch003`. -/ -@[expose] public section +public section noncomputable section @@ -46,7 +46,7 @@ Authors: Dawid Trela * `KernelOnly.LeanCertGerverNumericsReduced`. -/ -@[expose] public section +public section noncomputable section @@ -59,7 +59,7 @@ The kernel verifies every matrix entry against the original automatic differenti evaluator. Matrix row bounds can then reuse the certified entries. -/ -@[expose] public section +public section namespace GerverSofa.PartALeanCert open LeanCert.Core LeanCert.Engine @@ -4056,7 +4056,7 @@ section # Gerver Sofa / Kernel Only / Lean Cert Gerver Numerics Reduced -/ -@[expose] public section +public section noncomputable section @@ -4167,7 +4167,7 @@ Authors: Dawid Trela * `KernelOnly.LeanCertNumericsRows.Full05`. -/ -@[expose] public section +public section noncomputable section @@ -4182,7 +4182,7 @@ only one expensive closed kernel proposition at a time instead of launching all 22 rows concurrently and exhausting RAM. -/ -@[expose] public section +public section noncomputable section @@ -4215,7 +4215,7 @@ The expensive transcendental evaluation is checked once for this single coordinate and then replaced by a small rational cache interval downstream. -/ -@[expose] public section +public section noncomputable section @@ -4258,7 +4258,7 @@ checks one heavy proposition and then releases its memory before the next module in the serial chain begins. -/ -@[expose] public section +public section noncomputable section @@ -4291,7 +4291,7 @@ only one expensive closed kernel proposition at a time instead of launching all 22 rows concurrently and exhausting RAM. -/ -@[expose] public section +public section noncomputable section @@ -4324,7 +4324,7 @@ The expensive transcendental evaluation is checked once for this single coordinate and then replaced by a small rational cache interval downstream. -/ -@[expose] public section +public section noncomputable section @@ -4367,7 +4367,7 @@ checks one heavy proposition and then releases its memory before the next module in the serial chain begins. -/ -@[expose] public section +public section noncomputable section @@ -4400,7 +4400,7 @@ only one expensive closed kernel proposition at a time instead of launching all 22 rows concurrently and exhausting RAM. -/ -@[expose] public section +public section noncomputable section @@ -4433,7 +4433,7 @@ The expensive transcendental evaluation is checked once for this single coordinate and then replaced by a small rational cache interval downstream. -/ -@[expose] public section +public section noncomputable section @@ -4476,7 +4476,7 @@ checks one heavy proposition and then releases its memory before the next module in the serial chain begins. -/ -@[expose] public section +public section noncomputable section @@ -4509,7 +4509,7 @@ only one expensive closed kernel proposition at a time instead of launching all 22 rows concurrently and exhausting RAM. -/ -@[expose] public section +public section noncomputable section @@ -4542,7 +4542,7 @@ The expensive transcendental evaluation is checked once for this single coordinate and then replaced by a small rational cache interval downstream. -/ -@[expose] public section +public section noncomputable section @@ -4585,7 +4585,7 @@ checks one heavy proposition and then releases its memory before the next module in the serial chain begins. -/ -@[expose] public section +public section noncomputable section @@ -4618,7 +4618,7 @@ only one expensive closed kernel proposition at a time instead of launching all 22 rows concurrently and exhausting RAM. -/ -@[expose] public section +public section noncomputable section @@ -4651,7 +4651,7 @@ The expensive transcendental evaluation is checked once for this single coordinate and then replaced by a small rational cache interval downstream. -/ -@[expose] public section +public section noncomputable section @@ -4694,7 +4694,7 @@ checks one heavy proposition and then releases its memory before the next module in the serial chain begins. -/ -@[expose] public section +public section noncomputable section @@ -4727,7 +4727,7 @@ only one expensive closed kernel proposition at a time instead of launching all 22 rows concurrently and exhausting RAM. -/ -@[expose] public section +public section noncomputable section @@ -4785,7 +4785,7 @@ Authors: Dawid Trela * `KernelOnly.LeanCertNumericsRows.FullPoint10`. -/ -@[expose] public section +public section noncomputable section @@ -4798,7 +4798,7 @@ The expensive transcendental evaluation is checked once for this single coordinate and then replaced by a small rational cache interval downstream. -/ -@[expose] public section +public section noncomputable section @@ -4841,7 +4841,7 @@ checks one heavy proposition and then releases its memory before the next module in the serial chain begins. -/ -@[expose] public section +public section noncomputable section @@ -4874,7 +4874,7 @@ only one expensive closed kernel proposition at a time instead of launching all 22 rows concurrently and exhausting RAM. -/ -@[expose] public section +public section noncomputable section @@ -4907,7 +4907,7 @@ The expensive transcendental evaluation is checked once for this single coordinate and then replaced by a small rational cache interval downstream. -/ -@[expose] public section +public section noncomputable section @@ -4950,7 +4950,7 @@ checks one heavy proposition and then releases its memory before the next module in the serial chain begins. -/ -@[expose] public section +public section noncomputable section @@ -4983,7 +4983,7 @@ only one expensive closed kernel proposition at a time instead of launching all 22 rows concurrently and exhausting RAM. -/ -@[expose] public section +public section noncomputable section @@ -5016,7 +5016,7 @@ The expensive transcendental evaluation is checked once for this single coordinate and then replaced by a small rational cache interval downstream. -/ -@[expose] public section +public section noncomputable section @@ -5059,7 +5059,7 @@ checks one heavy proposition and then releases its memory before the next module in the serial chain begins. -/ -@[expose] public section +public section noncomputable section @@ -5092,7 +5092,7 @@ only one expensive closed kernel proposition at a time instead of launching all 22 rows concurrently and exhausting RAM. -/ -@[expose] public section +public section noncomputable section @@ -5125,7 +5125,7 @@ The expensive transcendental evaluation is checked once for this single coordinate and then replaced by a small rational cache interval downstream. -/ -@[expose] public section +public section noncomputable section @@ -5168,7 +5168,7 @@ checks one heavy proposition and then releases its memory before the next module in the serial chain begins. -/ -@[expose] public section +public section noncomputable section @@ -5201,7 +5201,7 @@ only one expensive closed kernel proposition at a time instead of launching all 22 rows concurrently and exhausting RAM. -/ -@[expose] public section +public section noncomputable section @@ -5234,7 +5234,7 @@ The expensive transcendental evaluation is checked once for this single coordinate and then replaced by a small rational cache interval downstream. -/ -@[expose] public section +public section noncomputable section @@ -5277,7 +5277,7 @@ checks one heavy proposition and then releases its memory before the next module in the serial chain begins. -/ -@[expose] public section +public section noncomputable section @@ -5310,7 +5310,7 @@ only one expensive closed kernel proposition at a time instead of launching all 22 rows concurrently and exhausting RAM. -/ -@[expose] public section +public section noncomputable section @@ -5343,7 +5343,7 @@ The expensive transcendental evaluation is checked once for this single coordinate and then replaced by a small rational cache interval downstream. -/ -@[expose] public section +public section noncomputable section @@ -5410,7 +5410,7 @@ Authors: Dawid Trela * `KernelOnly.LeanCertNumericsRows.FullImage15`. -/ -@[expose] public section +public section noncomputable section @@ -5424,7 +5424,7 @@ checks one heavy proposition and then releases its memory before the next module in the serial chain begins. -/ -@[expose] public section +public section noncomputable section @@ -5457,7 +5457,7 @@ only one expensive closed kernel proposition at a time instead of launching all 22 rows concurrently and exhausting RAM. -/ -@[expose] public section +public section noncomputable section @@ -5490,7 +5490,7 @@ The expensive transcendental evaluation is checked once for this single coordinate and then replaced by a small rational cache interval downstream. -/ -@[expose] public section +public section noncomputable section @@ -5533,7 +5533,7 @@ checks one heavy proposition and then releases its memory before the next module in the serial chain begins. -/ -@[expose] public section +public section noncomputable section @@ -5566,7 +5566,7 @@ only one expensive closed kernel proposition at a time instead of launching all 22 rows concurrently and exhausting RAM. -/ -@[expose] public section +public section noncomputable section @@ -5599,7 +5599,7 @@ The expensive transcendental evaluation is checked once for this single coordinate and then replaced by a small rational cache interval downstream. -/ -@[expose] public section +public section noncomputable section @@ -5642,7 +5642,7 @@ checks one heavy proposition and then releases its memory before the next module in the serial chain begins. -/ -@[expose] public section +public section noncomputable section @@ -5675,7 +5675,7 @@ only one expensive closed kernel proposition at a time instead of launching all 22 rows concurrently and exhausting RAM. -/ -@[expose] public section +public section noncomputable section @@ -5708,7 +5708,7 @@ The expensive transcendental evaluation is checked once for this single coordinate and then replaced by a small rational cache interval downstream. -/ -@[expose] public section +public section noncomputable section @@ -5751,7 +5751,7 @@ checks one heavy proposition and then releases its memory before the next module in the serial chain begins. -/ -@[expose] public section +public section noncomputable section @@ -5784,7 +5784,7 @@ only one expensive closed kernel proposition at a time instead of launching all 22 rows concurrently and exhausting RAM. -/ -@[expose] public section +public section noncomputable section @@ -5817,7 +5817,7 @@ The expensive transcendental evaluation is checked once for this single coordinate and then replaced by a small rational cache interval downstream. -/ -@[expose] public section +public section noncomputable section @@ -5860,7 +5860,7 @@ checks one heavy proposition and then releases its memory before the next module in the serial chain begins. -/ -@[expose] public section +public section noncomputable section @@ -5893,7 +5893,7 @@ only one expensive closed kernel proposition at a time instead of launching all 22 rows concurrently and exhausting RAM. -/ -@[expose] public section +public section noncomputable section @@ -5926,7 +5926,7 @@ The expensive transcendental evaluation is checked once for this single coordinate and then replaced by a small rational cache interval downstream. -/ -@[expose] public section +public section noncomputable section @@ -5969,7 +5969,7 @@ checks one heavy proposition and then releases its memory before the next module in the serial chain begins. -/ -@[expose] public section +public section noncomputable section @@ -6026,7 +6026,7 @@ Authors: Dawid Trela * `KernelOnly.LeanCertNumericsRows.Full21`. -/ -@[expose] public section +public section noncomputable section @@ -6040,7 +6040,7 @@ only one expensive closed kernel proposition at a time instead of launching all 22 rows concurrently and exhausting RAM. -/ -@[expose] public section +public section noncomputable section @@ -6073,7 +6073,7 @@ The expensive transcendental evaluation is checked once for this single coordinate and then replaced by a small rational cache interval downstream. -/ -@[expose] public section +public section noncomputable section @@ -6116,7 +6116,7 @@ checks one heavy proposition and then releases its memory before the next module in the serial chain begins. -/ -@[expose] public section +public section noncomputable section @@ -6149,7 +6149,7 @@ only one expensive closed kernel proposition at a time instead of launching all 22 rows concurrently and exhausting RAM. -/ -@[expose] public section +public section noncomputable section @@ -6182,7 +6182,7 @@ The expensive transcendental evaluation is checked once for this single coordinate and then replaced by a small rational cache interval downstream. -/ -@[expose] public section +public section noncomputable section @@ -6225,7 +6225,7 @@ checks one heavy proposition and then releases its memory before the next module in the serial chain begins. -/ -@[expose] public section +public section noncomputable section @@ -6258,7 +6258,7 @@ only one expensive closed kernel proposition at a time instead of launching all 22 rows concurrently and exhausting RAM. -/ -@[expose] public section +public section noncomputable section @@ -6291,7 +6291,7 @@ The expensive transcendental evaluation is checked once for this single coordinate and then replaced by a small rational cache interval downstream. -/ -@[expose] public section +public section noncomputable section @@ -6334,7 +6334,7 @@ checks one heavy proposition and then releases its memory before the next module in the serial chain begins. -/ -@[expose] public section +public section noncomputable section @@ -6367,7 +6367,7 @@ only one expensive closed kernel proposition at a time instead of launching all 22 rows concurrently and exhausting RAM. -/ -@[expose] public section +public section noncomputable section @@ -6400,7 +6400,7 @@ The expensive transcendental evaluation is checked once for this single coordinate and then replaced by a small rational cache interval downstream. -/ -@[expose] public section +public section noncomputable section @@ -6443,7 +6443,7 @@ checks one heavy proposition and then releases its memory before the next module in the serial chain begins. -/ -@[expose] public section +public section noncomputable section @@ -6476,7 +6476,7 @@ only one expensive closed kernel proposition at a time instead of launching all 22 rows concurrently and exhausting RAM. -/ -@[expose] public section +public section noncomputable section @@ -6509,7 +6509,7 @@ The expensive transcendental evaluation is checked once for this single coordinate and then replaced by a small rational cache interval downstream. -/ -@[expose] public section +public section noncomputable section @@ -6552,7 +6552,7 @@ checks one heavy proposition and then releases its memory before the next module in the serial chain begins. -/ -@[expose] public section +public section noncomputable section @@ -6585,7 +6585,7 @@ only one expensive closed kernel proposition at a time instead of launching all 22 rows concurrently and exhausting RAM. -/ -@[expose] public section +public section noncomputable section @@ -6629,7 +6629,7 @@ Authors: Dawid Trela * `KernelOnly.LeanCertNumericsRows.FullImage21`. -/ -@[expose] public section +public section noncomputable section @@ -6642,7 +6642,7 @@ The expensive transcendental evaluation is checked once for this single coordinate and then replaced by a small rational cache interval downstream. -/ -@[expose] public section +public section noncomputable section @@ -6685,7 +6685,7 @@ checks one heavy proposition and then releases its memory before the next module in the serial chain begins. -/ -@[expose] public section +public section noncomputable section @@ -6728,7 +6728,7 @@ Authors: Dawid Trela * `KernelOnly.ConcreteUniqueZeros`. -/ -@[expose] public section +public section noncomputable section @@ -6742,7 +6742,7 @@ ending at `FullImage21`. This module only assembles them into the global norm/self-map facts and the unique-root theorem. -/ -@[expose] public section +public section noncomputable section @@ -6863,7 +6863,7 @@ section # Gerver Sofa / Kernel Only / Concrete Unique Zeros -/ -@[expose] public section +public section noncomputable section @@ -6989,7 +6989,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.E24PhiBelowKernelHL`. -/ -@[expose] public section +public section noncomputable section @@ -7009,7 +7009,7 @@ The enclosure target is a proposition passed as an ordinary theorem argument. E01 does not claim that the global exclusion step has already been proved. -/ -@[expose] public section +public section noncomputable section @@ -7017,15 +7017,18 @@ namespace GerverSofa namespace PartE /-- Reduced parameters assembled in the order `(A, B, phi, theta)`. -/ +@[expose] def reducedParams (A B phi theta : ℝ) : Reduced.Params := { a := A, b := B, phi := phi, theta := theta } /-- The physical domain appearing in DeepMind's `ABφθSpec`. -/ +@[expose] def PhysicalDomain (p : Reduced.Params) : Prop := 0 ≤ p.phi ∧ p.phi ≤ p.theta ∧ p.theta ≤ Real.pi / 4 ∧ 0 ≤ p.a ∧ 0 ≤ p.b /-- The four displayed equations in DeepMind's `ABφθSpec`. -/ +@[expose] def DeepMindEquations (A B phi theta : ℝ) : Prop := A * (Real.cos theta - Real.cos phi) - 2 * B * Real.sin phi + (theta - phi - 1) * Real.cos theta - Real.sin theta @@ -7039,6 +7042,7 @@ def DeepMindEquations (A B phi theta : ℝ) : Prop := - (B - (theta - phi) * (1 + A) / 2 - (theta - phi) ^ 2 / 4) = 0 /-- A local mirror of DeepMind's complete four-constant specification. -/ +@[expose] def DeepMindABPhiThetaSpec (A B phi theta : ℝ) : Prop := PhysicalDomain (reducedParams A B phi theta) ∧ DeepMindEquations A B phi theta @@ -7167,6 +7171,7 @@ def GlobalEnclosureTarget : Prop := /-- Coordinate equivalence between DeepMind's nested tuple and the named reduced-parameter record. -/ +@[expose] def tupleEquiv : (ℝ × ℝ × ℝ × ℝ) ≃ Reduced.Params where toFun x := reducedParams x.1 x.2.1 x.2.2.1 x.2.2.2 invFun p := (p.a, p.b, p.phi, p.theta) @@ -7237,7 +7242,7 @@ The remaining enclosure target quantifies only over does not declare the interval branch-and-bound conclusion as an axiom. -/ -@[expose] public section +public section noncomputable section @@ -7570,7 +7575,7 @@ lie in that rectangle. E03 intentionally does not postulate a global cover; the finite branch-and-bound cover is the next data layer. -/ -@[expose] public section +public section noncomputable section @@ -7725,6 +7730,7 @@ theorem scaledResidualEnclosureTarget_iff_twoAngleEnclosureTarget : /-- LeanCert AST for the two division-free residuals. Variable 0 is `phi` and variable 1 is `theta`. -/ +@[expose] def scaledResidualExprList : List Expr := let phi := ev 0 let theta := ev 1 @@ -7771,6 +7777,7 @@ def scaledResidualExprList : List Expr := r1 :: r2 :: [] /-- Select one of the two scaled residual expressions for the angle system. -/ +@[expose] def scaledResidualExpr (i : Fin 2) : Expr := scaledResidualExprList.getD i.1 (ec 0) @@ -7796,12 +7803,14 @@ theorem scaledResidualExpr_eval_one (phi theta : ℝ) : evalFin, finEnv]; ring /-- Rational interval environment for the two angle variables. -/ +@[expose] def angleIntervalEnv (phiI thetaI : IntervalRat) : IntervalEnv | 0 => phiI | 1 => thetaI | _ => default /-- Executable test that an interval lies strictly on one side of zero. -/ +@[expose] def intervalExcludesZero (I : IntervalRat) : Bool := decide (I.hi < 0 ∨ 0 < I.lo) @@ -7850,7 +7859,7 @@ checks the complete path from rational cell data through LeanCert interval evaluation to the no-common-zero theorem before the large cover is generated. -/ -@[expose] public section +public section noncomputable section @@ -7864,6 +7873,7 @@ open PartALeanCert /-- Kernel-reducible interval evaluation for one smooth residual. This uses the already certified project-specialized interval for `pi`, avoiding the generic named-constant normalization bottleneck in closed `decide` replays. -/ +@[expose] def scaledResidualKernelInterval (i : Fin 2) (phiI thetaI : IntervalRat) (cfg : EvalConfig := {}) : IntervalRat := kernelPointEvalCore (scaledResidualExpr i) @@ -7909,6 +7919,7 @@ def Contains (cell : AngleCell) (phi theta : ℝ) : Prop := phi ∈ cell.phiI ∧ theta ∈ cell.thetaI /-- Executable E03 rejection test for a complete angle cell. -/ +@[expose] def rejected (cell : AngleCell) (cfg : EvalConfig := {}) : Bool := intervalExcludesZero (scaledResidualKernelInterval (0 : Fin 2) cell.phiI cell.thetaI cfg) || @@ -7976,7 +7987,7 @@ theorem therefore needs interval rejection only outside this wide local box. /-! ## Concrete two-dimensional contraction data -/ -@[expose] public section +public section noncomputable section @@ -7990,7 +8001,7 @@ open PartALeanCert /-- Local angle box containing the complete unresolved E20 tail and the exact angle projection of `Reduced.box`. E21F narrows the exploratory E21 box to the region actually required by the recorded E20 extrema. -/ -def localAngleX : Fin 2 → IntervalRat := ![ +@[expose] def localAngleX : Fin 2 → IntervalRat := ![ ⟨391 / 10000, 157 / 4000, by norm_num⟩, ⟨68113 / 100000, 34069 / 50000, by norm_num⟩ ] @@ -8075,7 +8086,7 @@ theorem localAngle_unique_scaled : /-! ## Semantic bridge to named angles and the Part A solution -/ /-- The two-angle cell corresponding to the certified local interval box. -/ -def localAngleCell : AngleCell := +@[expose] def localAngleCell : AngleCell := ⟨localAngleX (0 : Fin 2), localAngleX (1 : Fin 2)⟩ /-- Package the two switching angles as a two-coordinate real vector. -/ @@ -8270,7 +8281,7 @@ the depth-18 Boolean certificate in sixty-four independent depth-15 modules; `ParallelAdaptiveGlobalCoverClosure` recombines them without recomputation. -/ -@[expose] public section +public section noncomputable section @@ -8280,43 +8291,50 @@ namespace PartE open LeanCert.Core /-- The rational midpoint of an angle interval. -/ +@[expose] def angleMid (i : IntervalRat) : ℚ := (i.lo + i.hi) / 2 /-- The closed lower half of a rational interval. -/ +@[expose] def intervalLow (i : IntervalRat) : IntervalRat := ⟨i.lo, angleMid i, by dsimp [angleMid] linarith [i.le]⟩ /-- The closed upper half of a rational interval. -/ +@[expose] def intervalHigh (i : IntervalRat) : IntervalRat := ⟨angleMid i, i.hi, by dsimp [angleMid] linarith [i.le]⟩ /-- Bisect both angle intervals and select the lower φ half and lower θ half. -/ +@[expose] def childLL (cell : AngleCell) : AngleCell := ⟨intervalLow cell.phiI, intervalLow cell.thetaI⟩ /-- Bisect both angle intervals and select the lower φ half and upper θ half. -/ +@[expose] def childLH (cell : AngleCell) : AngleCell := ⟨intervalLow cell.phiI, intervalHigh cell.thetaI⟩ /-- Bisect both angle intervals and select the upper φ half and lower θ half. -/ +@[expose] def childHL (cell : AngleCell) : AngleCell := ⟨intervalHigh cell.phiI, intervalLow cell.thetaI⟩ /-- Bisect both angle intervals and select the upper φ half and upper θ half. -/ +@[expose] def childHH (cell : AngleCell) : AngleCell := ⟨intervalHigh cell.phiI, intervalHigh cell.thetaI⟩ /-- A rational cell lies strictly above the physical half-plane `phi ≤ theta`. The strict comparison deliberately keeps all cells touching the diagonal. -/ -def physicallyIrrelevant (cell : AngleCell) : Bool := +@[expose] def physicallyIrrelevant (cell : AngleCell) : Bool := decide (cell.thetaI.hi < cell.phiI.lo) /-- Every point of the rational cell lies in the wide E21 local box. -/ -def cellInsideLocal (cell : AngleCell) : Bool := +@[expose] def cellInsideLocal (cell : AngleCell) : Bool := decide ( localAngleCell.phiI.lo ≤ cell.phiI.lo ∧ cell.phiI.hi ≤ localAngleCell.phiI.hi ∧ @@ -8325,7 +8343,7 @@ def cellInsideLocal (cell : AngleCell) : Bool := /-- Adaptive four-way replay. A node closes when it is irrelevant, local, or rejected. Otherwise all four rational midpoint children must close. -/ -def adaptiveCoverCheck : Nat → AngleCell → Bool +@[expose] def adaptiveCoverCheck : Nat → AngleCell → Bool | 0, cell => if physicallyIrrelevant cell = true then true else if cellInsideLocal cell = true then true @@ -8518,7 +8536,7 @@ wide E21 local angle cell. Their union covers every point of the global physical angle root that is not in the local cell. -/ -@[expose] public section +public section noncomputable section @@ -8526,21 +8544,25 @@ namespace GerverSofa namespace PartE /-- The exclusion root cell below the local φ interval, with `φ ≤ 391/10000`. -/ +@[expose] def e24PhiBelowRoot : AngleCell := ⟨⟨0, 391 / 10000, by norm_num⟩, ⟨0, 4 / 5, by norm_num⟩⟩ /-- The exclusion root cell above the local φ interval, with `157/4000 ≤ φ`. -/ +@[expose] def e24PhiAboveRoot : AngleCell := ⟨⟨157 / 4000, 4 / 5, by norm_num⟩, ⟨0, 4 / 5, by norm_num⟩⟩ /-- The exclusion root cell below the local θ interval, with `θ ≤ 68113/100000`. -/ +@[expose] def e24ThetaBelowRoot : AngleCell := ⟨⟨0, 4 / 5, by norm_num⟩, ⟨0, 68113 / 100000, by norm_num⟩⟩ /-- The exclusion root cell above the local θ interval, with `34069/50000 ≤ θ`. -/ +@[expose] def e24ThetaAboveRoot : AngleCell := ⟨⟨0, 4 / 5, by norm_num⟩, ⟨34069 / 50000, 4 / 5, by norm_num⟩⟩ @@ -8565,7 +8587,7 @@ physical triangle and turns four Boolean adaptive-cover certificates into the terminal DeepMind-shaped uniqueness theorem. -/ -@[expose] public section +public section noncomputable section @@ -8715,7 +8737,7 @@ These lemmas lift a primitive terminal fact to an `adaptiveCoverCheck` fact at arbitrary remaining depth without asking the kernel to explore the subtree. -/ -@[expose] public section +public section noncomputable section @@ -8751,7 +8773,7 @@ section /-! E24 kernel child certificate: PhiBelow/HL, remaining depth 13. -/ -@[expose] public section +public section noncomputable section @@ -9309,7 +9331,7 @@ Authors: Dawid Trela * `KernelOnly.PartB.Continuum`. -/ -@[expose] public section +public section noncomputable section @@ -9323,7 +9345,7 @@ parameter vector and the two real support functions whose continuum lower bounds are established by the exact cell certificate. -/ -@[expose] public section +public section noncomputable section @@ -9337,13 +9359,16 @@ def params : Romik.Params := Romik.coordEquiv.symm PartALeanCert.fullRoot /-- The physical parameter interval. -/ +@[expose] def physicalInterval : Set ℝ := Set.Icc (0 : ℝ) (Real.pi / 2) /-- The two global support functions used in the manuscript's grid lemma. -/ +@[expose] def Gu (s t : ℝ) : ℝ := 1 + dot (Romik.path params s - Romik.path params t) (u s) /-- The vertical support slack between two path positions in the frame at `s`. -/ +@[expose] def Gv (s t : ℝ) : ℝ := 1 + dot (Romik.path params s - Romik.path params t) (v s) @@ -9351,13 +9376,16 @@ def Gv (s t : ℝ) : ℝ := def target : ℝ := (targetQ : ℝ) /-- Physical mesh node `iπ/128`. -/ +@[expose] def nodeTime (i : Nat) : ℝ := (nodeCoeff i : ℝ) * Real.pi /-- Physical closed cell. -/ +@[expose] def cellSet (i : Cell) : Set ℝ := Set.Icc (nodeTime i.1) (nodeTime (i.1 + 1)) /-- Semantic containment in a planar interval box. -/ +@[expose] def PointContains (z : RatInterval × RatInterval) (p : Point) : Prop := RatInterval.Contains z.1 p.1 ∧ RatInterval.Contains z.2 p.2 @@ -9379,7 +9407,7 @@ Every theorem in this file is a direct consequence of the concrete Part A unique zero. No numerical computation is repeated. -/ -@[expose] public section +public section noncomputable section @@ -9473,7 +9501,7 @@ independently. /-! ## Hull and time-cell semantics -/ -@[expose] public section +public section noncomputable section @@ -9669,7 +9697,7 @@ section /-! Semantic enclosure for analytic path phase 1. -/ -@[expose] public section +public section noncomputable section @@ -9718,7 +9746,7 @@ section /-! Semantic enclosure for analytic path phase 2. -/ -@[expose] public section +public section noncomputable section @@ -9769,7 +9797,7 @@ section /-! Semantic enclosure for analytic path phase 3. -/ -@[expose] public section +public section noncomputable section @@ -9811,7 +9839,7 @@ section /-! Semantic enclosure for analytic path phase 4. -/ -@[expose] public section +public section noncomputable section @@ -9863,7 +9891,7 @@ section /-! Semantic enclosure for analytic path phase 5. -/ -@[expose] public section +public section noncomputable section @@ -9919,7 +9947,7 @@ soundness of the two product-cell support expressions. /-! ## Switches lie in exactly four mesh cells -/ -@[expose] public section +public section noncomputable section @@ -10237,7 +10265,7 @@ section # Coverage by the 64 exact mesh cells -/ -@[expose] public section +public section noncomputable section @@ -10290,7 +10318,7 @@ The 64×64 cell certificate is now transported to every pair of physical angles. This is the semantic conclusion needed from Part B. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/Core/Bundle006.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/Core/Bundle006.lean index 41591796f3..eb4e83cec2 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/Core/Bundle006.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/Core/Bundle006.lean @@ -27,7 +27,7 @@ public import Mathlib.Topology.Separation.Hausdorff * `GerverSofa.KernelOnly.PartC.Semantics.Batch001`. -/ -@[expose] public section +public section noncomputable section @@ -75,7 +75,7 @@ Authors: Dawid Trela * `KernelOnly.PartC.Stage4.FinalTopologyClosure`. -/ -@[expose] public section +public section noncomputable section @@ -90,7 +90,7 @@ closed Parts A and B. No alternative parameter vector or geometric set is introduced here. -/ -@[expose] public section +public section noncomputable section @@ -101,11 +101,14 @@ namespace PartC abbrev params : Romik.Params := PartB.params /-- Physical terminal angle. -/ +@[expose] def T : ℝ := Real.pi / 2 /-- Reflected switching angles. -/ +@[expose] def eta : ℝ := T - params.theta /-- The reflected switching angle `π/2 - φ` for the certified parameters. -/ +@[expose] def tau : ℝ := T - params.phi /-- The concrete cap, fixed sofa, reconstructed Romik set and frame. -/ @@ -118,11 +121,13 @@ abbrev Sx : Set Point := Romik.reconstructedSet params abbrev frame : ℝ → SE2 := Romik.frame params /-- Endpoint support point used for the direct nonemptiness proof. -/ +@[expose] def anchor : Point := (1, 0) /-- Piecewise body-frame derivative coefficients. This definition is local to Part C so that the geometric layer does not import the later Part D article claims. -/ +@[expose] def alphaBetaAt (t : ℝ) : Point := if t ≤ params.phi then Romik.alphaBeta1 params t else if t ≤ params.theta then Romik.alphaBeta2 params t @@ -131,11 +136,14 @@ def alphaBetaAt (t : ℝ) : Point := else Romik.alphaBeta5 params t /-- The horizontal body-frame velocity coefficient. -/ +@[expose] def alpha (t : ℝ) : ℝ := (alphaBetaAt t).1 /-- The vertical body-frame velocity coefficient. -/ +@[expose] def beta (t : ℝ) : ℝ := (alphaBetaAt t).2 /-- The four standard contact curves. -/ +@[expose] def A (t : ℝ) : Point := let x := Romik.path params t let a := alpha t @@ -143,6 +151,7 @@ def A (t : ℝ) : Point := x.2 + a * (v t).2 + (u t).2) /-- The inner contact curve `x + α v`. -/ +@[expose] def B (t : ℝ) : Point := let x := Romik.path params t let a := alpha t @@ -150,6 +159,7 @@ def B (t : ℝ) : Point := x.2 + a * (v t).2) /-- The outer contact curve `x - β u + v`. -/ +@[expose] def C (t : ℝ) : Point := let x := Romik.path params t let b := beta t @@ -157,6 +167,7 @@ def C (t : ℝ) : Point := x.2 - b * (u t).2 + (v t).2) /-- The inner contact curve `x - β u`. -/ +@[expose] def D (t : ℝ) : Point := let x := Romik.path params t let b := beta t @@ -195,7 +206,7 @@ section # Frozen parameter and endpoint consequences for Part C -/ -@[expose] public section +public section noncomputable section @@ -255,7 +266,7 @@ that the relevant contact points belong to the cap and that no hidden crossing changes the boundary envelope. -/ -@[expose] public section +public section noncomputable section @@ -310,7 +321,7 @@ half-plane inequality. This is one of the main bridges from Part B into the global geometry of Part C. -/ -@[expose] public section +public section noncomputable section @@ -382,7 +393,7 @@ numerical replay. They are collected here for the concrete certified parameter vector. -/ -@[expose] public section +public section noncomputable section @@ -423,7 +434,7 @@ set-theoretic obligations. A later concrete proof must construct a value of `TopologyCertificate`; until then Part C cannot close. -/ -@[expose] public section +public section noncomputable section @@ -461,7 +472,7 @@ hidden inside an arbitrary `connected` field: contact support, the two no-hidden-crossing inequalities, and the claimed boundary of the niche. -/ -@[expose] public section +public section noncomputable section @@ -525,7 +536,7 @@ Part C contact and no-hidden-crossing certificates can reuse the exact 64-cell mesh without depending on private declarations. -/ -@[expose] public section +public section noncomputable section @@ -700,7 +711,7 @@ nonpositive scalar multiple of `u`. The scalar coefficients below are the five exact algebraic pieces. No numerical root is recomputed here. -/ -@[expose] public section +public section noncomputable section @@ -709,6 +720,7 @@ namespace PartC namespace Stage2 /-- Phasewise scalar multiplying `v(t)` in the derivative of `A`. -/ +@[expose] def rhoA (t : ℝ) : ℝ := if t ≤ params.phi then 0 else if t ≤ params.theta then @@ -721,6 +733,7 @@ def rhoA (t : ℝ) : ℝ := 1 / 2 /-- Phasewise nonnegative scalar for `C'(t) = -rhoC(t) * u(t)`. -/ +@[expose] def rhoC (t : ℝ) : ℝ := if t ≤ params.phi then 1 / 2 else if t ≤ params.theta then @@ -961,7 +974,7 @@ sound Part B intervals `Gu` and `Gv`. The only analytic remainder after all cell, named `SameCellU` and `SameCellV` below. -/ -@[expose] public section +public section noncomputable section @@ -1000,7 +1013,7 @@ shape from the start. The proof remains organized in body coordinates and the accompanying runner forces a fresh build of this module. -/ -@[expose] public section +public section noncomputable section @@ -1009,42 +1022,52 @@ namespace PartC namespace Stage2 /-- Phase-local outer `A` contact, written in vector form. -/ +@[expose] def phaseA1 (t : ℝ) : Point := Romik.path1 params t + (Romik.alphaBeta1 params t).1 • v t + u t /-- The phase 2 formula for the outer A contact curve. -/ +@[expose] def phaseA2 (t : ℝ) : Point := Romik.path2 params t + (Romik.alphaBeta2 params t).1 • v t + u t /-- The phase 3 formula for the outer A contact curve. -/ +@[expose] def phaseA3 (t : ℝ) : Point := Romik.path3 params t + (Romik.alphaBeta3 params t).1 • v t + u t /-- The phase 4 formula for the outer A contact curve. -/ +@[expose] def phaseA4 (t : ℝ) : Point := Romik.path4 params t + (Romik.alphaBeta4 params t).1 • v t + u t /-- The phase 5 formula for the outer A contact curve. -/ +@[expose] def phaseA5 (t : ℝ) : Point := Romik.path5 params t + (Romik.alphaBeta5 params t).1 • v t + u t /-- Phase-local outer `C` contact, written in vector form. -/ +@[expose] def phaseC1 (t : ℝ) : Point := Romik.path1 params t - (Romik.alphaBeta1 params t).2 • u t + v t /-- The phase 2 formula for the outer C contact curve. -/ +@[expose] def phaseC2 (t : ℝ) : Point := Romik.path2 params t - (Romik.alphaBeta2 params t).2 • u t + v t /-- The phase 3 formula for the outer C contact curve. -/ +@[expose] def phaseC3 (t : ℝ) : Point := Romik.path3 params t - (Romik.alphaBeta3 params t).2 • u t + v t /-- The phase 4 formula for the outer C contact curve. -/ +@[expose] def phaseC4 (t : ℝ) : Point := Romik.path4 params t - (Romik.alphaBeta4 params t).2 • u t + v t /-- The phase 5 formula for the outer C contact curve. -/ +@[expose] def phaseC5 (t : ℝ) : Point := Romik.path5 params t - (Romik.alphaBeta5 params t).2 • u t + v t @@ -1550,7 +1573,7 @@ monotonicity across the four certified switching times. It does not require a globally differentiable contact parametrisation at the speed-change junctions. -/ -@[expose] public section +public section noncomputable section @@ -2754,7 +2777,7 @@ exactly the six substantive topology/no-hidden facts; no additional certificate wrapper is introduced. -/ -@[expose] public section +public section noncomputable section @@ -2801,7 +2824,7 @@ Source-clean phase derivatives of the five Gerver path pieces. These are provided here as compatibility wrappers around the shared Stage 2 proofs. -/ -@[expose] public section +public section noncomputable section @@ -2862,7 +2885,7 @@ Part B cell enclosure instead of being reproved by a large transcendental `nlinarith` call. -/ -@[expose] public section +public section noncomputable section @@ -4103,7 +4126,7 @@ section # Gerver Sofa / Kernel Only / Part C / Stage4 / No Hidden Match Facts -/ -@[expose] public section +public section namespace GerverSofa namespace PartC @@ -4223,7 +4246,7 @@ This file turns the five exact coefficient matching statements into a public continuity interface for `alphaBetaAt`, `alpha`, `beta`, `B`, and `D`. -/ -@[expose] public section +public section noncomputable section @@ -4363,7 +4386,7 @@ section # Gerver Sofa / Kernel Only / Part C / Stage4 / No Hidden Sign Facts -/ -@[expose] public section +public section namespace GerverSofa namespace PartC @@ -4594,7 +4617,7 @@ These phasewise facts are the analytic input for the remaining one-turn chord argument; they do not assert the no-hidden conclusion by themselves. -/ -@[expose] public section +public section namespace GerverSofa namespace PartC @@ -4745,7 +4768,7 @@ derivatives themselves need not match at a switch. Consequently the fixed projection is proved antitone phase by phase and then glued order-theoretically. -/ -@[expose] public section +public section noncomputable section @@ -5376,7 +5399,7 @@ The affine reflection is derived phase by phase from the certified matching equations. No global symmetry hypothesis is introduced. -/ -@[expose] public section +public section noncomputable section @@ -5660,7 +5683,7 @@ The first inequality follows from concavity and the two endpoint values. The second is its exact phase-derived horizontal reflection. -/ -@[expose] public section +public section noncomputable section @@ -5751,7 +5774,7 @@ section # Gerver Sofa / Kernel Only / Part C / Stage4 / Niche Envelope Support -/ -@[expose] public section +public section noncomputable section @@ -6797,7 +6820,7 @@ This module separates the already direct cap geometry from the later theorem that removing the downward niche preserves connectedness. -/ -@[expose] public section +public section noncomputable section @@ -6891,7 +6914,7 @@ upper-envelope/frontier equality. It can therefore be kernel-built even while the boundary module is still under repair. -/ -@[expose] public section +public section noncomputable section @@ -6902,10 +6925,12 @@ namespace Stage4 open Set /-- Vertical fill below a parametrized graph. -/ +@[expose] def verticalFill (f : ℝ → Point) (I : Set ℝ) : Set Point := {q | ∃ t ∈ I, q.1 = (f t).1 ∧ 0 ≤ q.2 ∧ q.2 < (f t).2} /-- The three certified upper-envelope pieces as strict vertical fills. -/ +@[expose] def certifiedNicheRegion : Set Point := verticalFill D (Icc (0 : ℝ) params.theta) ∪ verticalFill (Romik.path params) (Icc params.phi tau) ∪ @@ -7078,7 +7103,7 @@ section # Part C Stage 4: inner-wall graph identities -/ -@[expose] public section +public section noncomputable section @@ -7155,7 +7180,7 @@ literal niche with its certified vertical-fill region. They are proved from the literal open-quadrant definition, not assumed through a Stage 2 API. -/ -@[expose] public section +public section noncomputable section @@ -7358,7 +7383,7 @@ vertical subgraph directly. /-! ## The three Gerver roof arcs are graphs over horizontal position -/ -@[expose] public section +public section noncomputable section @@ -7814,6 +7839,7 @@ theorem core_path_fst_strictAnti : /-- The affine reversal which runs through the core path from `tau` to `phi` while the auxiliary parameter runs from `theta` to `eta`. -/ +@[expose] def coreReverseTime (s : ℝ) : ℝ := tau - ((tau - params.phi) / (eta - params.theta)) * (s - params.theta) @@ -7851,6 +7877,7 @@ private theorem coreReverseTime_continuous : Continuous coreReverseTime := by fun_prop /-- A single continuous parametrization of the complete upper niche arc. -/ +@[expose] def nicheTopArc (s : ℝ) : Point := if s ≤ params.theta then D s else if s ≤ eta then Romik.path params (coreReverseTime s) @@ -8830,7 +8857,7 @@ three-piece region. Once the boundary layer identifies that region with the literal niche, connectedness is immediate. -/ -@[expose] public section +public section noncomputable section @@ -8869,7 +8896,7 @@ point. Thus the horizontal projections of the cap and sofa agree. A compact map with connected fibres over that connected projection closes connectedness. -/ -@[expose] public section +public section noncomputable section @@ -9273,7 +9300,7 @@ No new certificate structure is introduced here. This file is intended to close the two literal topology fields left by `RemainingTopologyTarget`. -/ -@[expose] public section +public section noncomputable section @@ -9374,7 +9401,7 @@ This is the only terminal assembly for Part C. It contains no payload and no new certificate interface. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/Core/Bundle007.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/Core/Bundle007.lean index 145884a738..e4f70d748b 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/Core/Bundle007.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/Core/Bundle007.lean @@ -12,7 +12,7 @@ public import LeanPool.MovingSofa.GerverSofa.KernelOnly.Core.Bundle005 * `GerverSofa.KernelOnly.PartE.Semantics.Batch002`. -/ -@[expose] public section +public section noncomputable section @@ -30,7 +30,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.E24PhiBelowKernelLL`. -/ -@[expose] public section +public section noncomputable section @@ -38,7 +38,7 @@ section /-! E24 kernel child certificate: PhiBelow/LH, remaining depth 13. -/ -@[expose] public section +public section noncomputable section @@ -1246,7 +1246,7 @@ section /-! E24 kernel child certificate: PhiBelow/LL, remaining depth 13. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/Core/Bundle008.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/Core/Bundle008.lean index 21f4ca8b07..d8c8dbb296 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/Core/Bundle008.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/Core/Bundle008.lean @@ -16,7 +16,7 @@ public import Mathlib.Analysis.Normed.Affine.ContinuousAffineMap * `GerverSofa.KernelOnly.PartF.Semantics.Batch002`. -/ -@[expose] public section +public section noncomputable section @@ -40,7 +40,7 @@ Authors: Dawid Trela * `KernelOnly.PartF.F06IntegralMotion`. -/ -@[expose] public section +public section noncomputable section @@ -56,7 +56,7 @@ the existing `ℝ × ℝ` coordinate model, not to an unproved isometry between the product norm and the Euclidean norm. -/ -@[expose] public section +public section noncomputable section @@ -107,7 +107,7 @@ certified reduced solution. No identification with the full 22D tuple is claimed by this module. -/ -@[expose] public section +public section noncomputable section @@ -115,6 +115,7 @@ namespace GerverSofa.PartF.Parameters /-- The nonnegative parameter and ordered-angle equations used by the upstream canonical definition. -/ +@[expose] def upstreamSpec (A B φ θ : ℝ) : Prop := 0 ≤ φ ∧ φ ≤ θ ∧ θ ≤ Real.pi / 4 ∧ 0 ≤ A ∧ 0 ≤ B ∧ A * (θ.cos - φ.cos) - 2 * B * φ.sin @@ -133,6 +134,7 @@ theorem upstreamSpec_iff (A B φ θ : ℝ) : tauto /-- Package the upstream four-parameter specification as a predicate on a nested tuple. -/ +@[expose] def TupleSpec (q : ℝ × ℝ × ℝ × ℝ) : Prop := upstreamSpec q.1 q.2.1 q.2.2.1 q.2.2.2 @@ -140,6 +142,7 @@ theorem existsUnique : ∃! q, TupleSpec q := by simpa only [TupleSpec, upstreamSpec_iff] using PartE.deepMindABPhiTheta_existsUnique /-- The certified reduced solution converted to the upstream four-parameter tuple. -/ +@[expose] def certified : ℝ × ℝ × ℝ × ℝ := PartE.tupleEquiv.symm PartALeanCert.reducedCertifiedUniqueSolution.solution @@ -180,7 +183,7 @@ definition. Its rotation matrices are explicit; their comparison with `F01.rotation` and the integral representation are separate bridge steps. -/ -@[expose] public section +public section noncomputable section open scoped unitInterval @@ -189,6 +192,7 @@ namespace GerverSofa.PartF.EuclideanMotion open Coordinates /-- The standard rotation matrix associated with an existing `SE2` value. -/ +@[expose] def linearPart (g : SE2) : Plane ≃ₗ[ℝ] Plane where toFun := fun q => toPlane (g.c * q 0 - g.s * q 1, g.s * q 0 + g.c * q 1) invFun := fun q => toPlane (g.c * q 0 + g.s * q 1, -g.s * q 0 + g.c * q 1) @@ -245,11 +249,13 @@ theorem linearPart_norm (g : SE2) (q : Plane) : ‖linearPart g q‖ = ‖q‖ : (sq_eq_sq₀ (norm_nonneg _) (norm_nonneg _)).mp (linearPart_norm_sq g q) /-- The linear isometry determined by the rotation coefficients of an SE2 motion. -/ +@[expose] def linearIsometry (g : SE2) : Plane ≃ₗᵢ[ℝ] Plane where toLinearEquiv := linearPart g norm_map' := linearPart_norm g /-- A genuine Euclidean affine isometry with the original coordinate action. -/ +@[expose] def ofSE2 (g : SE2) : Rigid := rotateThenTranslate (linearIsometry g) (toPlane (g.tx, g.ty)) @@ -381,7 +387,7 @@ area form, then its right-angle rotation, before comparing rotation matrices. No replacement orientation or additional orientation hypothesis is introduced. -/ -@[expose] public section +public section noncomputable section namespace GerverSofa.PartF.CanonicalRotation @@ -480,7 +486,7 @@ the outstanding path/dictionary equalities explicitly. They do not prove the literal integral representation or identify the certified 22D tuple. -/ -@[expose] public section +public section noncomputable section open scoped unitInterval @@ -568,7 +574,7 @@ as F01. The final identification with PartC.params still requires the 22D dictionary theorem; it remains an explicit hypothesis in the two last results. -/ -@[expose] public section +public section noncomputable section namespace GerverSofa.PartF.Integrals @@ -714,6 +720,7 @@ theorem integral_sofa_eq_worldSofa (d : Reduced.Params) (ho : Ordered d) exact (integral_rotation d ho hd t ht).symm /-- The reduced parameters selected by the concrete uniqueness certificate. -/ +@[expose] def certified : Reduced.Params := PartALeanCert.reducedCertifiedUniqueSolution.solution theorem certified_ordered : Ordered certified := by @@ -758,7 +765,7 @@ The full algebraic reconstruction closes the 22D identity without a new Krawczyk run or a forward enclosure into the narrow full box. -/ -@[expose] public section +public section noncomputable section namespace GerverSofa.PartF.Parameters @@ -833,7 +840,7 @@ canonical Euclidean orientation. It does not silently replace the current upstream rotateTranslate definition discussed in issue #5270. -/ -@[expose] public section +public section noncomputable section namespace GerverSofa.PartF.Integrals diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle001.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle001.lean index 41448d2064..6886dfe669 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle001.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle001.lean @@ -14,7 +14,7 @@ public import LeanPool.MovingSofa.GerverSofa.KernelOnly.Core.Bundle005 * `GerverSofa.KernelOnly.PartE.Certificates.Batch004`. -/ -@[expose] public section +public section noncomputable section @@ -4823,7 +4823,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.E24KC4BatchPhiAboveF9C1LLRLL0009`. -/ -@[expose] public section +public section noncomputable section @@ -4831,7 +4831,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30000 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -4864,7 +4864,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30001 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -4897,7 +4897,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30002 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -4930,7 +4930,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30003 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -4963,7 +4963,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30010 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -4996,7 +4996,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30011 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -5029,7 +5029,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30012 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -5062,7 +5062,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30013 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -5095,7 +5095,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30020 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -5128,7 +5128,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30021 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -5161,7 +5161,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30022 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -5194,7 +5194,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30023 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -5227,7 +5227,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30030 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -5260,7 +5260,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30031 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -5293,7 +5293,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30032 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -5326,7 +5326,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30033 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -5360,7 +5360,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30100 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -5412,7 +5412,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30101 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -5464,7 +5464,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30102 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -5516,7 +5516,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30103 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -5567,7 +5567,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30110 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -5600,7 +5600,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30111 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -5634,7 +5634,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30112 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -5685,7 +5685,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30113 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -5719,7 +5719,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30120 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -5771,7 +5771,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30121 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -5823,7 +5823,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30122 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -5875,7 +5875,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30123 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -5927,7 +5927,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30130 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -5978,7 +5978,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30131 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -6012,7 +6012,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30132 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -6064,7 +6064,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30133 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -6115,7 +6115,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30200 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -6148,7 +6148,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30201 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -6181,7 +6181,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30202 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -6214,7 +6214,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30203 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -6247,7 +6247,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30210 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -6281,7 +6281,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30211 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -6332,7 +6332,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30212 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -6366,7 +6366,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30213 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -6417,7 +6417,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30220 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -6450,7 +6450,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30221 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -6483,7 +6483,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30222 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -6516,7 +6516,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30223 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -6549,7 +6549,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30230 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -6583,7 +6583,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30231 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -6634,7 +6634,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30232 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -6668,7 +6668,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30233 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -6720,7 +6720,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30300 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -6772,7 +6772,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30301 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -6824,7 +6824,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30302 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -6876,7 +6876,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30303 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -6928,7 +6928,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30310 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -6980,7 +6980,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30311 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -7032,7 +7032,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30312 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -7084,7 +7084,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30313 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -7136,7 +7136,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30320 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -7188,7 +7188,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30321 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -7240,7 +7240,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30322 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -7292,7 +7292,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30323 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -7344,7 +7344,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30330 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -7422,7 +7422,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30331 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -7487,7 +7487,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30332 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -7565,7 +7565,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=30333 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -7655,7 +7655,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31000 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -7688,7 +7688,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31001 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -7721,7 +7721,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31002 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -7754,7 +7754,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31003 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -7787,7 +7787,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31010 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -7820,7 +7820,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31011 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -7853,7 +7853,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31012 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -7886,7 +7886,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31013 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -7919,7 +7919,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31020 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -7952,7 +7952,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31021 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -7985,7 +7985,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31022 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -8018,7 +8018,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31023 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -8051,7 +8051,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31030 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -8084,7 +8084,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31031 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -8117,7 +8117,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31032 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -8150,7 +8150,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31033 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -8183,7 +8183,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=3110 remaining=10 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -8216,7 +8216,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=3111 remaining=10 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -8249,7 +8249,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31120 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -8282,7 +8282,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31121 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -8315,7 +8315,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31122 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -8348,7 +8348,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31123 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -8381,7 +8381,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=3113 remaining=10 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -8415,7 +8415,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31200 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -8466,7 +8466,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31201 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -8500,7 +8500,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31202 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -8552,7 +8552,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31203 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -8603,7 +8603,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31210 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -8636,7 +8636,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31211 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -8669,7 +8669,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31212 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -8702,7 +8702,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31213 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -8736,7 +8736,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31220 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -8788,7 +8788,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31221 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -8840,7 +8840,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31222 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -8892,7 +8892,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31223 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -8943,7 +8943,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31230 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -8976,7 +8976,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31231 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -9010,7 +9010,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31232 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -9061,7 +9061,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31233 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -9094,7 +9094,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31300 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -9127,7 +9127,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31301 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -9160,7 +9160,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31302 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -9193,7 +9193,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31303 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -9226,7 +9226,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31310 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -9259,7 +9259,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31311 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -9292,7 +9292,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31312 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -9325,7 +9325,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31313 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -9358,7 +9358,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31320 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -9391,7 +9391,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31321 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -9424,7 +9424,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31322 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -9457,7 +9457,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31323 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -9490,7 +9490,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31330 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -9523,7 +9523,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31331 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -9556,7 +9556,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31332 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -9589,7 +9589,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=31333 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -9622,7 +9622,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=32000 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -9655,7 +9655,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=32001 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -9688,7 +9688,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=32002 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -9721,7 +9721,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=32003 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -9754,7 +9754,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=32010 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -9788,7 +9788,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=32011 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -9839,7 +9839,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=32012 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -9873,7 +9873,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=32013 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -9924,7 +9924,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=32020 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -9957,7 +9957,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=32021 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -9990,7 +9990,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=32022 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -10023,7 +10023,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=32023 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -10056,7 +10056,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=32030 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -10090,7 +10090,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=32031 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -10141,7 +10141,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=32032 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -10175,7 +10175,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=32033 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -10227,7 +10227,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=32100 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -10279,7 +10279,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=32101 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -10331,7 +10331,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=32102 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -10383,7 +10383,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=32103 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -10435,7 +10435,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=32110 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -10513,7 +10513,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=32111 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -10617,7 +10617,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=32112 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -10695,7 +10695,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=32113 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -10799,7 +10799,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=32120 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -10851,7 +10851,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=32121 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -10903,7 +10903,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=32122 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -10955,7 +10955,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=32123 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -11007,7 +11007,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=32130 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -11085,7 +11085,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=32131 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -11189,7 +11189,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=32132 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -11280,7 +11280,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=32133 remaining=9 kind=F reason=ADAPTIVE. -/ -@[expose] public section +public section noncomputable section @@ -11383,7 +11383,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=32200 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -11416,7 +11416,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=32201 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -11449,7 +11449,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=32202 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -11482,7 +11482,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=32203 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -11515,7 +11515,7 @@ section /-! Generated E24KC2 kernel leaf. Discovery claim: PB path=32210 remaining=9 kind=T reason=R. -/ -@[expose] public section +public section noncomputable section @@ -11548,7 +11548,7 @@ section /-! E24KC4 auto-tuned batched kernel certificates. -/ -@[expose] public section +public section noncomputable section @@ -12208,7 +12208,7 @@ section /-! E24KC4 auto-tuned batched kernel certificates. -/ -@[expose] public section +public section noncomputable section @@ -12274,7 +12274,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.E24KC5TerminalBatchT665600016`. -/ -@[expose] public section +public section noncomputable section @@ -12282,7 +12282,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -14886,7 +14886,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.E24KC5FrontierBatchF96R00465`. -/ -@[expose] public section +public section noncomputable section @@ -14894,7 +14894,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -15007,7 +15007,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle002.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle002.lean index c7fcc8a3ed..76ac44d836 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle002.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle002.lean @@ -13,7 +13,7 @@ public import LeanPool.MovingSofa.GerverSofa.KernelOnly.Core.Bundle005 * `GerverSofa.KernelOnly.PartE.Certificates.Batch014`. -/ -@[expose] public section +public section noncomputable section @@ -5086,7 +5086,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.E24KC5FrontierBatchF24RR00226`. -/ -@[expose] public section +public section noncomputable section @@ -5094,7 +5094,7 @@ section /-! E24KC4 auto-tuned batched kernel certificates. -/ -@[expose] public section +public section noncomputable section @@ -5900,7 +5900,7 @@ section /-! E24KC4 auto-tuned batched kernel certificates. -/ -@[expose] public section +public section noncomputable section @@ -6295,7 +6295,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -6346,7 +6346,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -6397,7 +6397,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -6448,7 +6448,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -6499,7 +6499,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -7166,7 +7166,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -7533,7 +7533,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -7662,7 +7662,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -7921,7 +7921,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -7972,7 +7972,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -8332,7 +8332,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -8692,7 +8692,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -9000,7 +9000,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -9308,7 +9308,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -9616,7 +9616,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -9924,7 +9924,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -10260,7 +10260,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.E24KC5TerminalBatchT563200014`. -/ -@[expose] public section +public section noncomputable section @@ -10268,7 +10268,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle003.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle003.lean index 0079b266b1..9b98188a9e 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle003.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle003.lean @@ -13,7 +13,7 @@ public import LeanPool.MovingSofa.GerverSofa.KernelOnly.Core.Bundle005 * `GerverSofa.KernelOnly.PartE.Certificates.Batch012`. -/ -@[expose] public section +public section noncomputable section @@ -5032,7 +5032,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.E24KC5FrontierBatchF96LLR00463`. -/ -@[expose] public section +public section noncomputable section @@ -5040,7 +5040,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -5681,7 +5681,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -5945,7 +5945,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -6339,7 +6339,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -6746,7 +6746,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -7361,7 +7361,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -7638,7 +7638,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -7868,7 +7868,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -8166,7 +8166,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -8412,7 +8412,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -8554,7 +8554,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -8644,7 +8644,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -8994,7 +8994,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -9328,7 +9328,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -9457,7 +9457,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -9768,7 +9768,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -9819,7 +9819,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -9870,7 +9870,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -9921,7 +9921,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -10203,7 +10203,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -10269,7 +10269,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.E24KC5TerminalBatchT512000013`. -/ -@[expose] public section +public section noncomputable section @@ -10277,7 +10277,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle004.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle004.lean index 9ccd225f1d..fd15fd69c7 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle004.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle004.lean @@ -13,7 +13,7 @@ public import LeanPool.MovingSofa.GerverSofa.KernelOnly.Core.Bundle005 * `GerverSofa.KernelOnly.PartE.Certificates.Batch027`. -/ -@[expose] public section +public section noncomputable section @@ -1530,7 +1530,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.E24KC5TerminalBatchT000001`. -/ -@[expose] public section +public section noncomputable section @@ -1538,7 +1538,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -4157,7 +4157,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.E24KC6ProofBatchB39d17cf54d27511`. -/ -@[expose] public section +public section noncomputable section @@ -4165,7 +4165,7 @@ section /-! E24KC6 explicit proof-producing certificate batch. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle005.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle005.lean index 0108fe293b..3864bb3bb0 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle005.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle005.lean @@ -13,7 +13,7 @@ public import LeanPool.MovingSofa.GerverSofa.KernelOnly.Core.Bundle005 * `GerverSofa.KernelOnly.PartE.Certificates.Batch028`. -/ -@[expose] public section +public section noncomputable section @@ -2474,7 +2474,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.E24KC5TerminalBatchT102400005`. -/ -@[expose] public section +public section noncomputable section @@ -2482,7 +2482,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -5085,7 +5085,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.E24KC6ProofBatchC0ea1b4a6af3d1dc`. -/ -@[expose] public section +public section noncomputable section @@ -5093,7 +5093,7 @@ section /-! E24KC6 explicit proof-producing certificate batch. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle006.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle006.lean index 18d5f1e746..929d07909d 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle006.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle006.lean @@ -13,7 +13,7 @@ public import LeanPool.MovingSofa.GerverSofa.KernelOnly.Core.Bundle005 * `GerverSofa.KernelOnly.PartE.Certificates.Batch023`. -/ -@[expose] public section +public section noncomputable section @@ -1430,7 +1430,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.E24KC5TerminalBatchT153600006`. -/ -@[expose] public section +public section noncomputable section @@ -1438,7 +1438,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -4041,7 +4041,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.E24KC6ProofBatch6018780a0c691fa2`. -/ -@[expose] public section +public section noncomputable section @@ -4049,7 +4049,7 @@ section /-! E24KC6 explicit proof-producing certificate batch. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle007.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle007.lean index f330744d18..3874bc89cd 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle007.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle007.lean @@ -13,7 +13,7 @@ public import LeanPool.MovingSofa.GerverSofa.KernelOnly.Core.Bundle005 * `GerverSofa.KernelOnly.PartE.Certificates.Batch026`. -/ -@[expose] public section +public section noncomputable section @@ -1123,7 +1123,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.E24KC5TerminalBatchT256000008`. -/ -@[expose] public section +public section noncomputable section @@ -1131,7 +1131,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -3719,7 +3719,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -6322,7 +6322,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.E24KC6ProofBatchAf2b60d8e2cf09a4`. -/ -@[expose] public section +public section noncomputable section @@ -6330,7 +6330,7 @@ section /-! E24KC6 explicit proof-producing certificate batch. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle008.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle008.lean index a3e302e6f0..a03c05fc2c 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle008.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle008.lean @@ -13,7 +13,7 @@ public import LeanPool.MovingSofa.GerverSofa.KernelOnly.Core.Bundle005 * `GerverSofa.KernelOnly.PartE.Certificates.Batch024`. -/ -@[expose] public section +public section noncomputable section @@ -1094,7 +1094,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.E24KC5TerminalBatchT307200009`. -/ -@[expose] public section +public section noncomputable section @@ -1102,7 +1102,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -3706,7 +3706,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.E24KC6ProofBatchAad74ad127e30429`. -/ -@[expose] public section +public section noncomputable section @@ -3714,7 +3714,7 @@ section /-! E24KC6 explicit proof-producing certificate batch. -/ -@[expose] public section +public section noncomputable section @@ -9928,7 +9928,7 @@ section /-! E24KC6 explicit proof-producing certificate batch. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle009.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle009.lean index 58e6a751d0..7acb2a0f60 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle009.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle009.lean @@ -13,7 +13,7 @@ public import LeanPool.MovingSofa.GerverSofa.KernelOnly.Core.Bundle005 * `GerverSofa.KernelOnly.PartE.Certificates.Batch029`. -/ -@[expose] public section +public section noncomputable section @@ -1974,7 +1974,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.E24KC5TerminalBatchT358400010`. -/ -@[expose] public section +public section noncomputable section @@ -1982,7 +1982,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -4585,7 +4585,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.E24KC6ProofBatchDeeff549d6afce41`. -/ -@[expose] public section +public section noncomputable section @@ -4593,7 +4593,7 @@ section /-! E24KC6 explicit proof-producing certificate batch. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle010.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle010.lean index 7fed58f069..cf3f412807 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle010.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle010.lean @@ -13,7 +13,7 @@ public import LeanPool.MovingSofa.GerverSofa.KernelOnly.Core.Bundle005 * `GerverSofa.KernelOnly.PartE.Certificates.Batch013`. -/ -@[expose] public section +public section noncomputable section @@ -1315,7 +1315,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.E24KC5TerminalBatchT460800012`. -/ -@[expose] public section +public section noncomputable section @@ -1323,7 +1323,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -3911,7 +3911,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -6514,7 +6514,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.E24KC5TerminalBatchT51200004`. -/ -@[expose] public section +public section noncomputable section @@ -6522,7 +6522,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle011.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle011.lean index c85ad293eb..98682e7488 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle011.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle011.lean @@ -13,7 +13,7 @@ public import LeanPool.MovingSofa.GerverSofa.KernelOnly.Core.Bundle005 * `GerverSofa.KernelOnly.PartE.Certificates.Batch019`. -/ -@[expose] public section +public section noncomputable section @@ -1034,7 +1034,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.E24KC5TerminalBatchT614400015`. -/ -@[expose] public section +public section noncomputable section @@ -1042,7 +1042,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -3655,7 +3655,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.E24KC6ProofBatch11b2bedf1dcd3516`. -/ -@[expose] public section +public section noncomputable section @@ -3663,7 +3663,7 @@ section /-! E24KC6 explicit proof-producing certificate batch. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle012.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle012.lean index 2ca6c09200..a8b4cabcec 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle012.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle012.lean @@ -13,7 +13,7 @@ public import LeanPool.MovingSofa.GerverSofa.KernelOnly.Core.Bundle005 * `GerverSofa.KernelOnly.PartE.Certificates.Batch021`. -/ -@[expose] public section +public section noncomputable section @@ -3426,7 +3426,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.E24KC5TerminalBatchT716800017`. -/ -@[expose] public section +public section noncomputable section @@ -3434,7 +3434,7 @@ section /-! E24KC5 checkpoint-aware kernel batch. -/ -@[expose] public section +public section noncomputable section @@ -5192,7 +5192,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.E24KC6ProofBatch38ee6acacaee22e4`. -/ -@[expose] public section +public section noncomputable section @@ -5200,7 +5200,7 @@ section /-! E24KC6 explicit proof-producing certificate batch. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle013.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle013.lean index f8f6bcab7e..7c3c9010d1 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle013.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle013.lean @@ -13,7 +13,7 @@ public import LeanPool.MovingSofa.GerverSofa.KernelOnly.Core.Bundle005 * `GerverSofa.KernelOnly.PartE.Certificates.Batch044`. -/ -@[expose] public section +public section noncomputable section @@ -3562,7 +3562,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.E24KC6ProofBatch0bae0a82ed09fca0`. -/ -@[expose] public section +public section noncomputable section @@ -3570,7 +3570,7 @@ section /-! E24KC6 explicit proof-producing certificate batch. -/ -@[expose] public section +public section noncomputable section @@ -8971,7 +8971,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.ThetaAbove.Leaf00665`. -/ -@[expose] public section +public section noncomputable section @@ -8982,7 +8982,7 @@ section Leaf0000220020_c1_c1_c0_6_00642 -/ -@[expose] public section +public section noncomputable section @@ -9062,7 +9062,7 @@ section Leaf0000220020_c1_c1_c1_6_00643 -/ -@[expose] public section +public section noncomputable section @@ -9142,7 +9142,7 @@ section Leaf0000220020_c1_c1_c2_c0_c0_4_00646 -/ -@[expose] public section +public section noncomputable section @@ -9274,7 +9274,7 @@ section Leaf0000220020_c1_c1_c2_c0_c1_4_00647 -/ -@[expose] public section +public section noncomputable section @@ -9406,7 +9406,7 @@ section Leaf0000220020_c1_c1_c2_c0_c2_4_00648 -/ -@[expose] public section +public section noncomputable section @@ -9616,7 +9616,7 @@ section Leaf0000220020_c1_c1_c2_c0_c3_4_00649 -/ -@[expose] public section +public section noncomputable section @@ -9826,7 +9826,7 @@ section Leaf0000220020_c1_c1_c2_c1_c0_4_00652 -/ -@[expose] public section +public section noncomputable section @@ -9958,7 +9958,7 @@ section Leaf0000220020_c1_c1_c2_c1_c1_4_00653 -/ -@[expose] public section +public section noncomputable section @@ -10090,7 +10090,7 @@ section Leaf0000220020_c1_c1_c2_c1_c2_4_00654 -/ -@[expose] public section +public section noncomputable section @@ -10300,7 +10300,7 @@ section Leaf0000220020_c1_c1_c2_c1_c3_4_00655 -/ -@[expose] public section +public section noncomputable section @@ -10510,7 +10510,7 @@ section Leaf0000220020_c1_c1_c2_c2_5_00657 -/ -@[expose] public section +public section noncomputable section @@ -10564,7 +10564,7 @@ section Leaf0000220020_c1_c1_c2_c3_5_00658 -/ -@[expose] public section +public section noncomputable section @@ -10618,7 +10618,7 @@ section Leaf0000220020_c1_c1_c3_c0_c0_4_00662 -/ -@[expose] public section +public section noncomputable section @@ -10750,7 +10750,7 @@ section Leaf0000220020_c1_c1_c3_c0_c1_4_00663 -/ -@[expose] public section +public section noncomputable section @@ -10882,7 +10882,7 @@ section Leaf0000220020_c1_c1_c3_c0_c2_4_00664 -/ -@[expose] public section +public section noncomputable section @@ -11092,7 +11092,7 @@ section Leaf0000220020_c1_c1_c3_c0_c3_4_00665 -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle014.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle014.lean index bb9633bce3..17ebb0ef63 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle014.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle014.lean @@ -12,7 +12,7 @@ public import LeanPool.MovingSofa.GerverSofa.KernelOnly.Core.Bundle005 * `GerverSofa.KernelOnly.PartE.Certificates.Batch020`. -/ -@[expose] public section +public section noncomputable section @@ -2953,7 +2953,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.E24KC6ProofBatch32fd0d2bad1c3ab1`. -/ -@[expose] public section +public section noncomputable section @@ -2961,7 +2961,7 @@ section /-! E24KC6 explicit proof-producing certificate batch. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle015.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle015.lean index 407e2b379b..32395e6dda 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle015.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle015.lean @@ -12,7 +12,7 @@ public import LeanPool.MovingSofa.GerverSofa.KernelOnly.Core.Bundle005 * `GerverSofa.KernelOnly.PartE.Certificates.Batch022`. -/ -@[expose] public section +public section noncomputable section @@ -261,7 +261,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.E24KC6ProofBatch3b6d17fd8ecf6129`. -/ -@[expose] public section +public section noncomputable section @@ -269,7 +269,7 @@ section /-! E24KC6 explicit proof-producing certificate batch. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle016.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle016.lean index 61a95aa6e6..63d8d17419 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle016.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle016.lean @@ -12,7 +12,7 @@ public import LeanPool.MovingSofa.GerverSofa.KernelOnly.Core.Bundle005 * `GerverSofa.KernelOnly.PartE.Certificates.Batch025`. -/ -@[expose] public section +public section noncomputable section @@ -3937,7 +3937,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.E24KC6ProofBatchAeb87c7b95a29e08`. -/ -@[expose] public section +public section noncomputable section @@ -3945,7 +3945,7 @@ section /-! E24KC6 explicit proof-producing certificate batch. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle017.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle017.lean index bf2391e38d..3aae76c880 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle017.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle017.lean @@ -12,7 +12,7 @@ public import LeanPool.MovingSofa.GerverSofa.KernelOnly.Core.Bundle005 * `GerverSofa.KernelOnly.PartE.Certificates.Batch030`. -/ -@[expose] public section +public section noncomputable section @@ -3225,7 +3225,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.E24KC6ProofBatchE7cbedc8143c8e9f`. -/ -@[expose] public section +public section noncomputable section @@ -3233,7 +3233,7 @@ section /-! E24KC6 explicit proof-producing certificate batch. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle018.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle018.lean index c6fffa5fd9..f384c2d383 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle018.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle018.lean @@ -12,7 +12,7 @@ public import LeanPool.MovingSofa.GerverSofa.KernelOnly.Core.Bundle005 * `GerverSofa.KernelOnly.PartE.Certificates.Batch031`. -/ -@[expose] public section +public section noncomputable section @@ -1054,7 +1054,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.E24KC6R4Subtree001eda2c378d570b`. -/ -@[expose] public section +public section noncomputable section @@ -1062,7 +1062,7 @@ section /-! E24KC6 explicit proof-producing certificate batch. -/ -@[expose] public section +public section noncomputable section @@ -7796,7 +7796,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle019.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle019.lean index 849bcc3ca6..69a9daf6d0 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle019.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle019.lean @@ -12,7 +12,7 @@ public import LeanPool.MovingSofa.GerverSofa.KernelOnly.Core.Bundle005 * `GerverSofa.KernelOnly.PartE.Certificates.Batch032`. -/ -@[expose] public section +public section noncomputable section @@ -2454,7 +2454,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.E24KC6R4Subtree7ae79e99a9b79eaf`. -/ -@[expose] public section +public section noncomputable section @@ -2462,7 +2462,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -3077,7 +3077,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -3124,7 +3124,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -3171,7 +3171,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -3830,7 +3830,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -4129,7 +4129,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -4176,7 +4176,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -4580,7 +4580,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -5239,7 +5239,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -5322,7 +5322,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -5401,7 +5401,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -5452,7 +5452,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -6111,7 +6111,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -6158,7 +6158,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -6237,7 +6237,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -6918,7 +6918,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -7001,7 +7001,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -7084,7 +7084,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -7135,7 +7135,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -7378,7 +7378,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -7517,7 +7517,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -7600,7 +7600,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -7647,7 +7647,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -7730,7 +7730,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -8368,7 +8368,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -8857,7 +8857,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -9126,7 +9126,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -9599,7 +9599,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -9678,7 +9678,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -9757,7 +9757,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle020.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle020.lean index 14911cdd02..40d58e95d9 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle020.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle020.lean @@ -14,7 +14,7 @@ public import LeanPool.MovingSofa.GerverSofa.KernelOnly.Core.Bundle005 * `GerverSofa.KernelOnly.PartE.Certificates.Batch043`. -/ -@[expose] public section +public section noncomputable section @@ -5037,7 +5037,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.E24KC6R4Join0f0434a94ae699a2`. -/ -@[expose] public section +public section noncomputable section @@ -5045,7 +5045,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -5566,7 +5566,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -5885,7 +5885,7 @@ section /-! KC6R4 pure logical subtree join. -/ -@[expose] public section +public section noncomputable section @@ -5919,7 +5919,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -6368,7 +6368,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -7111,7 +7111,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -7194,7 +7194,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -7273,7 +7273,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -7356,7 +7356,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -7407,7 +7407,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -7458,7 +7458,7 @@ section /-! KC6R4 pure logical subtree join. -/ -@[expose] public section +public section noncomputable section @@ -7551,7 +7551,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.ThetaAbove.Leaf00638`. -/ -@[expose] public section +public section noncomputable section @@ -7562,7 +7562,7 @@ section Leaf0000220020_c0_c1_c2_c0_c2_4_00567 -/ -@[expose] public section +public section noncomputable section @@ -7772,7 +7772,7 @@ section Leaf0000220020_c0_c1_c2_c0_c3_4_00568 -/ -@[expose] public section +public section noncomputable section @@ -7904,7 +7904,7 @@ section Leaf0000220020_c0_c1_c2_c1_c0_c0_3_00572 -/ -@[expose] public section +public section noncomputable section @@ -7938,7 +7938,7 @@ section Leaf0000220020_c0_c1_c2_c1_c0_c1_3_00573 -/ -@[expose] public section +public section noncomputable section @@ -7972,7 +7972,7 @@ section Leaf0000220020_c0_c1_c2_c1_c0_c2_3_00574 -/ -@[expose] public section +public section noncomputable section @@ -8182,7 +8182,7 @@ section Leaf0000220020_c0_c1_c2_c1_c0_c3_3_00575 -/ -@[expose] public section +public section noncomputable section @@ -8327,7 +8327,7 @@ section Leaf0000220020_c0_c1_c2_c1_c1_4_00577 -/ -@[expose] public section +public section noncomputable section @@ -8563,7 +8563,7 @@ section Leaf0000220020_c0_c1_c2_c1_c2_4_00578 -/ -@[expose] public section +public section noncomputable section @@ -8695,7 +8695,7 @@ section Leaf0000220020_c0_c1_c2_c1_c3_4_00579 -/ -@[expose] public section +public section noncomputable section @@ -8827,7 +8827,7 @@ section Leaf0000220020_c0_c1_c2_c2_5_00581 -/ -@[expose] public section +public section noncomputable section @@ -8881,7 +8881,7 @@ section Leaf0000220020_c0_c1_c2_c3_5_00582 -/ -@[expose] public section +public section noncomputable section @@ -8935,7 +8935,7 @@ section Leaf0000220020_c0_c1_c3_c0_c0_4_00586 -/ -@[expose] public section +public section noncomputable section @@ -9106,7 +9106,7 @@ section Leaf0000220020_c0_c1_c3_c0_c1_4_00587 -/ -@[expose] public section +public section noncomputable section @@ -9238,7 +9238,7 @@ section Leaf0000220020_c0_c1_c3_c0_c2_4_00588 -/ -@[expose] public section +public section noncomputable section @@ -9370,7 +9370,7 @@ section Leaf0000220020_c0_c1_c3_c0_c3_4_00589 -/ -@[expose] public section +public section noncomputable section @@ -9502,7 +9502,7 @@ section Leaf0000220020_c0_c1_c3_c1_c0_4_00592 -/ -@[expose] public section +public section noncomputable section @@ -9634,7 +9634,7 @@ section Leaf0000220020_c0_c1_c3_c1_c1_4_00593 -/ -@[expose] public section +public section noncomputable section @@ -9766,7 +9766,7 @@ section Leaf0000220020_c0_c1_c3_c1_c2_4_00594 -/ -@[expose] public section +public section noncomputable section @@ -9898,7 +9898,7 @@ section Leaf0000220020_c0_c1_c3_c1_c3_4_00595 -/ -@[expose] public section +public section noncomputable section @@ -10030,7 +10030,7 @@ section Leaf0000220020_c0_c1_c3_c2_5_00597 -/ -@[expose] public section +public section noncomputable section @@ -10084,7 +10084,7 @@ section Leaf0000220020_c0_c1_c3_c3_5_00598 -/ -@[expose] public section +public section noncomputable section @@ -10137,7 +10137,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Theta Above Leaf0000220020_c0_c2_7_00601 -/ -@[expose] public section +public section noncomputable section @@ -10216,7 +10216,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Theta Above Leaf0000220020_c0_c3_7_00602 -/ -@[expose] public section +public section noncomputable section @@ -10296,7 +10296,7 @@ section Leaf0000220020_c1_c0_c0_6_00606 -/ -@[expose] public section +public section noncomputable section @@ -10376,7 +10376,7 @@ section Leaf0000220020_c1_c0_c1_6_00607 -/ -@[expose] public section +public section noncomputable section @@ -10456,7 +10456,7 @@ section Leaf0000220020_c1_c0_c2_c0_c0_4_00610 -/ -@[expose] public section +public section noncomputable section @@ -10588,7 +10588,7 @@ section Leaf0000220020_c1_c0_c2_c0_c1_4_00611 -/ -@[expose] public section +public section noncomputable section @@ -10720,7 +10720,7 @@ section Leaf0000220020_c1_c0_c2_c0_c2_4_00612 -/ -@[expose] public section +public section noncomputable section @@ -10852,7 +10852,7 @@ section Leaf0000220020_c1_c0_c2_c0_c3_4_00613 -/ -@[expose] public section +public section noncomputable section @@ -10984,7 +10984,7 @@ section Leaf0000220020_c1_c0_c2_c1_c0_4_00616 -/ -@[expose] public section +public section noncomputable section @@ -11116,7 +11116,7 @@ section Leaf0000220020_c1_c0_c2_c1_c1_4_00617 -/ -@[expose] public section +public section noncomputable section @@ -11248,7 +11248,7 @@ section Leaf0000220020_c1_c0_c2_c1_c2_4_00618 -/ -@[expose] public section +public section noncomputable section @@ -11380,7 +11380,7 @@ section Leaf0000220020_c1_c0_c2_c1_c3_4_00619 -/ -@[expose] public section +public section noncomputable section @@ -11551,7 +11551,7 @@ section Leaf0000220020_c1_c0_c2_c2_5_00621 -/ -@[expose] public section +public section noncomputable section @@ -11605,7 +11605,7 @@ section Leaf0000220020_c1_c0_c2_c3_5_00622 -/ -@[expose] public section +public section noncomputable section @@ -11659,7 +11659,7 @@ section Leaf0000220020_c1_c0_c3_c0_c0_4_00626 -/ -@[expose] public section +public section noncomputable section @@ -11791,7 +11791,7 @@ section Leaf0000220020_c1_c0_c3_c0_c1_4_00627 -/ -@[expose] public section +public section noncomputable section @@ -11923,7 +11923,7 @@ section Leaf0000220020_c1_c0_c3_c0_c2_4_00628 -/ -@[expose] public section +public section noncomputable section @@ -12107,7 +12107,7 @@ section Leaf0000220020_c1_c0_c3_c0_c3_4_00629 -/ -@[expose] public section +public section noncomputable section @@ -12291,7 +12291,7 @@ section Leaf0000220020_c1_c0_c3_c1_c0_4_00632 -/ -@[expose] public section +public section noncomputable section @@ -12423,7 +12423,7 @@ section Leaf0000220020_c1_c0_c3_c1_c1_4_00633 -/ -@[expose] public section +public section noncomputable section @@ -12555,7 +12555,7 @@ section Leaf0000220020_c1_c0_c3_c1_c2_4_00634 -/ -@[expose] public section +public section noncomputable section @@ -12739,7 +12739,7 @@ section Leaf0000220020_c1_c0_c3_c1_c3_4_00635 -/ -@[expose] public section +public section noncomputable section @@ -12936,7 +12936,7 @@ section Leaf0000220020_c1_c0_c3_c2_5_00637 -/ -@[expose] public section +public section noncomputable section @@ -12990,7 +12990,7 @@ section Leaf0000220020_c1_c0_c3_c3_5_00638 -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle021.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle021.lean index 8078acacaf..299670e9f9 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle021.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle021.lean @@ -15,7 +15,7 @@ public import LeanPool.MovingSofa.GerverSofa.KernelOnly.Core.Bundle005 * `GerverSofa.KernelOnly.PartE.Certificates.Batch034`. -/ -@[expose] public section +public section noncomputable section @@ -2523,7 +2523,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.E24KC6R4Join459e5b5f3815ebd2`. -/ -@[expose] public section +public section noncomputable section @@ -2531,7 +2531,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -3222,7 +3222,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -3305,7 +3305,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -3356,7 +3356,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -3439,7 +3439,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -3522,7 +3522,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -4247,7 +4247,7 @@ section /-! KC6R4 pure logical subtree join. -/ -@[expose] public section +public section noncomputable section @@ -4281,7 +4281,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -4940,7 +4940,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -5023,7 +5023,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -5070,7 +5070,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -5153,7 +5153,7 @@ section /-! KC6R4 pure logical subtree join. -/ -@[expose] public section +public section noncomputable section @@ -5187,7 +5187,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -5455,7 +5455,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -5580,7 +5580,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -6323,7 +6323,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -6374,7 +6374,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -6421,7 +6421,7 @@ section /-! KC6R4 pure logical subtree join. -/ -@[expose] public section +public section noncomputable section @@ -6455,7 +6455,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -6594,7 +6594,7 @@ section /-! KC6R4 pure logical subtree join. -/ -@[expose] public section +public section noncomputable section @@ -6628,7 +6628,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -6711,7 +6711,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -6794,7 +6794,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -7337,7 +7337,7 @@ section /-! KC6R4 pure logical subtree join. -/ -@[expose] public section +public section noncomputable section @@ -7371,7 +7371,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -7608,7 +7608,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -8186,7 +8186,7 @@ section /-! KC6R4 pure logical subtree join. -/ -@[expose] public section +public section noncomputable section @@ -8220,7 +8220,7 @@ section /-! KC6R4 pure logical subtree join. -/ -@[expose] public section +public section noncomputable section @@ -8254,7 +8254,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -8301,7 +8301,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -9044,7 +9044,7 @@ section /-! KC6R4 pure logical subtree join. -/ -@[expose] public section +public section noncomputable section @@ -9078,7 +9078,7 @@ section /-! KC6R4 pure logical subtree join. -/ -@[expose] public section +public section noncomputable section @@ -9112,7 +9112,7 @@ section /-! KC6R4 pure logical subtree join. -/ -@[expose] public section +public section noncomputable section @@ -9146,7 +9146,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -9193,7 +9193,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -9431,7 +9431,7 @@ section /-! KC6R4 pure logical subtree join. -/ -@[expose] public section +public section noncomputable section @@ -9465,7 +9465,7 @@ section /-! KC6R4 pure logical subtree join. -/ -@[expose] public section +public section noncomputable section @@ -9499,7 +9499,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -10158,7 +10158,7 @@ section /-! KC6R4 pure logical subtree join. -/ -@[expose] public section +public section noncomputable section @@ -10192,7 +10192,7 @@ section /-! KC6R4 pure logical subtree join. -/ -@[expose] public section +public section noncomputable section @@ -10226,7 +10226,7 @@ section /-! KC6R4 pure logical subtree join. -/ -@[expose] public section +public section noncomputable section @@ -10260,7 +10260,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -10307,7 +10307,7 @@ section /-! KC6R4 pure logical subtree join. -/ -@[expose] public section +public section noncomputable section @@ -10341,7 +10341,7 @@ section /-! KC6R4 explicit terminal-certificate subtree. No adaptive search. -/ -@[expose] public section +public section noncomputable section @@ -10850,7 +10850,7 @@ section /-! KC6R4 pure logical subtree join. -/ -@[expose] public section +public section noncomputable section @@ -10884,7 +10884,7 @@ section /-! KC6R4 pure logical subtree join. -/ -@[expose] public section +public section noncomputable section @@ -10918,7 +10918,7 @@ section /-! KC6R4 pure logical subtree join. -/ -@[expose] public section +public section noncomputable section @@ -10952,7 +10952,7 @@ section /-! KC6R4 pure logical subtree join. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle022.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle022.lean index 62de062094..c75530dfee 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle022.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle022.lean @@ -12,7 +12,7 @@ public import LeanPool.MovingSofa.GerverSofa.KernelOnly.Core.Bundle005 * `GerverSofa.KernelOnly.PartE.Certificates.Batch035`. -/ -@[expose] public section +public section noncomputable section @@ -3179,7 +3179,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.PhiAbove.Leaf00081`. -/ -@[expose] public section +public section noncomputable section @@ -3189,7 +3189,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101101_c0_c0_c0_c0_5_00025 -/ -@[expose] public section +public section noncomputable section @@ -3320,7 +3320,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101101_c0_c0_c0_c1_5_00026 -/ -@[expose] public section +public section noncomputable section @@ -3555,7 +3555,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101101_c0_c0_c0_c2_5_00027 -/ -@[expose] public section +public section noncomputable section @@ -3608,7 +3608,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101101_c0_c0_c0_c3_5_00028 -/ -@[expose] public section +public section noncomputable section @@ -3662,7 +3662,7 @@ section Leaf1101101_c0_c0_c1_c0_c0_4_00032 -/ -@[expose] public section +public section noncomputable section @@ -3846,7 +3846,7 @@ section Leaf1101101_c0_c0_c1_c0_c1_4_00033 -/ -@[expose] public section +public section noncomputable section @@ -4082,7 +4082,7 @@ section Leaf1101101_c0_c0_c1_c0_c2_4_00034 -/ -@[expose] public section +public section noncomputable section @@ -4136,7 +4136,7 @@ section Leaf1101101_c0_c0_c1_c0_c3_4_00035 -/ -@[expose] public section +public section noncomputable section @@ -4190,7 +4190,7 @@ section Leaf1101101_c0_c0_c1_c1_c0_4_00038 -/ -@[expose] public section +public section noncomputable section @@ -4387,7 +4387,7 @@ section Leaf1101101_c0_c0_c1_c1_c1_4_00039 -/ -@[expose] public section +public section noncomputable section @@ -4597,7 +4597,7 @@ section Leaf1101101_c0_c0_c1_c1_c2_4_00040 -/ -@[expose] public section +public section noncomputable section @@ -4651,7 +4651,7 @@ section Leaf1101101_c0_c0_c1_c1_c3_4_00041 -/ -@[expose] public section +public section noncomputable section @@ -4704,7 +4704,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101101_c0_c0_c1_c2_5_00043 -/ -@[expose] public section +public section noncomputable section @@ -4757,7 +4757,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101101_c0_c0_c1_c3_5_00044 -/ -@[expose] public section +public section noncomputable section @@ -4810,7 +4810,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101101_c0_c0_c2_6_00046 -/ -@[expose] public section +public section noncomputable section @@ -4863,7 +4863,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101101_c0_c0_c3_6_00047 -/ -@[expose] public section +public section noncomputable section @@ -4917,7 +4917,7 @@ section Leaf1101101_c0_c1_c0_c0_c0_4_00052 -/ -@[expose] public section +public section noncomputable section @@ -5127,7 +5127,7 @@ section Leaf1101101_c0_c1_c0_c0_c1_4_00053 -/ -@[expose] public section +public section noncomputable section @@ -5337,7 +5337,7 @@ section Leaf1101101_c0_c1_c0_c0_c2_4_00054 -/ -@[expose] public section +public section noncomputable section @@ -5391,7 +5391,7 @@ section Leaf1101101_c0_c1_c0_c0_c3_4_00055 -/ -@[expose] public section +public section noncomputable section @@ -5445,7 +5445,7 @@ section Leaf1101101_c0_c1_c0_c1_c0_4_00058 -/ -@[expose] public section +public section noncomputable section @@ -5668,7 +5668,7 @@ section Leaf1101101_c0_c1_c0_c1_c1_4_00059 -/ -@[expose] public section +public section noncomputable section @@ -5878,7 +5878,7 @@ section Leaf1101101_c0_c1_c0_c1_c2_4_00060 -/ -@[expose] public section +public section noncomputable section @@ -5932,7 +5932,7 @@ section Leaf1101101_c0_c1_c0_c1_c3_4_00061 -/ -@[expose] public section +public section noncomputable section @@ -5985,7 +5985,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101101_c0_c1_c0_c2_5_00063 -/ -@[expose] public section +public section noncomputable section @@ -6038,7 +6038,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101101_c0_c1_c0_c3_5_00064 -/ -@[expose] public section +public section noncomputable section @@ -6091,7 +6091,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101101_c0_c1_c1_c0_5_00067 -/ -@[expose] public section +public section noncomputable section @@ -6313,7 +6313,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101101_c0_c1_c1_c1_5_00068 -/ -@[expose] public section +public section noncomputable section @@ -6574,7 +6574,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101101_c0_c1_c1_c2_5_00069 -/ -@[expose] public section +public section noncomputable section @@ -6627,7 +6627,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101101_c0_c1_c1_c3_5_00070 -/ -@[expose] public section +public section noncomputable section @@ -6680,7 +6680,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101101_c0_c1_c2_6_00072 -/ -@[expose] public section +public section noncomputable section @@ -6733,7 +6733,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101101_c0_c1_c3_6_00073 -/ -@[expose] public section +public section noncomputable section @@ -6786,7 +6786,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101101_c0_c2_7_00075 -/ -@[expose] public section +public section noncomputable section @@ -6839,7 +6839,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101101_c0_c3_7_00076 -/ -@[expose] public section +public section noncomputable section @@ -6892,7 +6892,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101101_c1_c0_c0_c0_5_00081 -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle023.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle023.lean index d2f714e2ab..5103a11077 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle023.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle023.lean @@ -12,7 +12,7 @@ public import LeanPool.MovingSofa.GerverSofa.KernelOnly.Core.Bundle005 * `GerverSofa.KernelOnly.PartE.Certificates.Batch036`. -/ -@[expose] public section +public section noncomputable section @@ -4218,7 +4218,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.PhiAbove.Leaf00158`. -/ -@[expose] public section +public section noncomputable section @@ -4228,7 +4228,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101101_c1_c0_c0_c1_5_00082 -/ -@[expose] public section +public section noncomputable section @@ -4489,7 +4489,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101101_c1_c0_c0_c2_5_00083 -/ -@[expose] public section +public section noncomputable section @@ -4542,7 +4542,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101101_c1_c0_c0_c3_5_00084 -/ -@[expose] public section +public section noncomputable section @@ -4595,7 +4595,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101101_c1_c0_c1_c0_5_00087 -/ -@[expose] public section +public section noncomputable section @@ -4856,7 +4856,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101101_c1_c0_c1_c1_5_00088 -/ -@[expose] public section +public section noncomputable section @@ -5104,7 +5104,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101101_c1_c0_c1_c2_5_00089 -/ -@[expose] public section +public section noncomputable section @@ -5170,7 +5170,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101101_c1_c0_c1_c3_5_00090 -/ -@[expose] public section +public section noncomputable section @@ -5249,7 +5249,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101101_c1_c0_c2_6_00092 -/ -@[expose] public section +public section noncomputable section @@ -5302,7 +5302,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101101_c1_c0_c3_6_00093 -/ -@[expose] public section +public section noncomputable section @@ -5355,7 +5355,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101101_c1_c1_c0_c0_5_00097 -/ -@[expose] public section +public section noncomputable section @@ -5512,7 +5512,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101101_c1_c1_c0_c1_5_00098 -/ -@[expose] public section +public section noncomputable section @@ -5617,7 +5617,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101101_c1_c1_c0_c2_5_00099 -/ -@[expose] public section +public section noncomputable section @@ -5696,7 +5696,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101101_c1_c1_c0_c3_5_00100 -/ -@[expose] public section +public section noncomputable section @@ -5775,7 +5775,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101101_c1_c1_c1_6_00102 -/ -@[expose] public section +public section noncomputable section @@ -6036,7 +6036,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101101_c1_c1_c2_6_00103 -/ -@[expose] public section +public section noncomputable section @@ -6089,7 +6089,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101101_c1_c1_c3_6_00104 -/ -@[expose] public section +public section noncomputable section @@ -6142,7 +6142,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101101_c1_c2_7_00106 -/ -@[expose] public section +public section noncomputable section @@ -6195,7 +6195,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101101_c1_c3_7_00107 -/ -@[expose] public section +public section noncomputable section @@ -6248,7 +6248,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101101_c2_8_00109 -/ -@[expose] public section +public section noncomputable section @@ -6301,7 +6301,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101101_c3_8_00110 -/ -@[expose] public section +public section noncomputable section @@ -6354,7 +6354,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101110_c0_c0_c0_6_00118 -/ -@[expose] public section +public section noncomputable section @@ -6615,7 +6615,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101110_c0_c0_c1_6_00119 -/ -@[expose] public section +public section noncomputable section @@ -6889,7 +6889,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101110_c0_c0_c2_6_00120 -/ -@[expose] public section +public section noncomputable section @@ -6942,7 +6942,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101110_c0_c0_c3_6_00121 -/ -@[expose] public section +public section noncomputable section @@ -7021,7 +7021,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101110_c0_c1_c0_c0_5_00125 -/ -@[expose] public section +public section noncomputable section @@ -7126,7 +7126,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101110_c0_c1_c0_c1_5_00126 -/ -@[expose] public section +public section noncomputable section @@ -7231,7 +7231,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101110_c0_c1_c0_c2_5_00127 -/ -@[expose] public section +public section noncomputable section @@ -7336,7 +7336,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101110_c0_c1_c0_c3_5_00128 -/ -@[expose] public section +public section noncomputable section @@ -7441,7 +7441,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101110_c0_c1_c1_6_00130 -/ -@[expose] public section +public section noncomputable section @@ -7702,7 +7702,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101110_c0_c1_c2_6_00131 -/ -@[expose] public section +public section noncomputable section @@ -7781,7 +7781,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101110_c0_c1_c3_6_00132 -/ -@[expose] public section +public section noncomputable section @@ -7860,7 +7860,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101110_c0_c2_7_00134 -/ -@[expose] public section +public section noncomputable section @@ -7913,7 +7913,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101110_c0_c3_7_00135 -/ -@[expose] public section +public section noncomputable section @@ -7966,7 +7966,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101110_c1_c0_7_00138 -/ -@[expose] public section +public section noncomputable section @@ -8253,7 +8253,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101110_c1_c1_7_00139 -/ -@[expose] public section +public section noncomputable section @@ -8514,7 +8514,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101110_c1_c2_7_00140 -/ -@[expose] public section +public section noncomputable section @@ -8567,7 +8567,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101110_c1_c3_7_00141 -/ -@[expose] public section +public section noncomputable section @@ -8620,7 +8620,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101110_c2_8_00143 -/ -@[expose] public section +public section noncomputable section @@ -8673,7 +8673,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101110_c3_8_00144 -/ -@[expose] public section +public section noncomputable section @@ -8726,7 +8726,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101111_c0_c0_7_00150 -/ -@[expose] public section +public section noncomputable section @@ -8987,7 +8987,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101111_c0_c1_c0_6_00152 -/ -@[expose] public section +public section noncomputable section @@ -9092,7 +9092,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101111_c0_c1_c1_6_00153 -/ -@[expose] public section +public section noncomputable section @@ -9197,7 +9197,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101111_c0_c1_c2_6_00154 -/ -@[expose] public section +public section noncomputable section @@ -9302,7 +9302,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101111_c0_c1_c3_6_00155 -/ -@[expose] public section +public section noncomputable section @@ -9407,7 +9407,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101111_c0_c2_7_00157 -/ -@[expose] public section +public section noncomputable section @@ -9486,7 +9486,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101111_c0_c3_7_00158 -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle024.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle024.lean index 32c18f00e4..5f5d74a84a 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle024.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle024.lean @@ -12,7 +12,7 @@ public import LeanPool.MovingSofa.GerverSofa.KernelOnly.Core.Bundle005 * `GerverSofa.KernelOnly.PartE.Certificates.Batch037`. -/ -@[expose] public section +public section noncomputable section @@ -4024,7 +4024,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.PhiBelow.Leaf00259`. -/ -@[expose] public section +public section noncomputable section @@ -4034,7 +4034,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101111_c1_c0_7_00161 -/ -@[expose] public section +public section noncomputable section @@ -4334,7 +4334,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101111_c1_c1_7_00162 -/ -@[expose] public section +public section noncomputable section @@ -4595,7 +4595,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101111_c1_c2_7_00163 -/ -@[expose] public section +public section noncomputable section @@ -4674,7 +4674,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101111_c1_c3_7_00164 -/ -@[expose] public section +public section noncomputable section @@ -4753,7 +4753,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101111_c2_8_00166 -/ -@[expose] public section +public section noncomputable section @@ -4806,7 +4806,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1101111_c3_8_00167 -/ -@[expose] public section +public section noncomputable section @@ -4859,7 +4859,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1110000_c0_c0_7_00174 -/ -@[expose] public section +public section noncomputable section @@ -5042,7 +5042,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1110000_c0_c1_7_00175 -/ -@[expose] public section +public section noncomputable section @@ -5147,7 +5147,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1110000_c0_c2_7_00176 -/ -@[expose] public section +public section noncomputable section @@ -5226,7 +5226,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1110000_c0_c3_7_00177 -/ -@[expose] public section +public section noncomputable section @@ -5305,7 +5305,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1110000_c1_8_00179 -/ -@[expose] public section +public section noncomputable section @@ -5566,7 +5566,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1110000_c2_8_00180 -/ -@[expose] public section +public section noncomputable section @@ -5619,7 +5619,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1110000_c3_8_00181 -/ -@[expose] public section +public section noncomputable section @@ -5672,7 +5672,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1110001_c0_8_00187 -/ -@[expose] public section +public section noncomputable section @@ -5946,7 +5946,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1110001_c1_8_00188 -/ -@[expose] public section +public section noncomputable section @@ -6259,7 +6259,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1110001_c2_8_00189 -/ -@[expose] public section +public section noncomputable section @@ -6338,7 +6338,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1110001_c3_8_00190 -/ -@[expose] public section +public section noncomputable section @@ -6417,7 +6417,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1110010_c0_8_00196 -/ -@[expose] public section +public section noncomputable section @@ -6704,7 +6704,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1110010_c1_8_00197 -/ -@[expose] public section +public section noncomputable section @@ -6965,7 +6965,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1110010_c2_8_00198 -/ -@[expose] public section +public section noncomputable section @@ -7044,7 +7044,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1110010_c3_8_00199 -/ -@[expose] public section +public section noncomputable section @@ -7123,7 +7123,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1110011_c0_8_00204 -/ -@[expose] public section +public section noncomputable section @@ -7384,7 +7384,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1110011_c1_8_00205 -/ -@[expose] public section +public section noncomputable section @@ -7567,7 +7567,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1110011_c2_8_00206 -/ -@[expose] public section +public section noncomputable section @@ -7646,7 +7646,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Above Leaf1110011_c3_8_00207 -/ -@[expose] public section +public section noncomputable section @@ -7725,7 +7725,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33203_c0_8_00242 -/ -@[expose] public section +public section noncomputable section @@ -7830,7 +7830,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33203_c1_8_00243 -/ -@[expose] public section +public section noncomputable section @@ -7974,7 +7974,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33203_c2_8_00244 -/ -@[expose] public section +public section noncomputable section @@ -8079,7 +8079,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33203_c3_8_00245 -/ -@[expose] public section +public section noncomputable section @@ -8288,7 +8288,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33221_c0_8_00256 -/ -@[expose] public section +public section noncomputable section @@ -8393,7 +8393,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33221_c1_8_00257 -/ -@[expose] public section +public section noncomputable section @@ -8628,7 +8628,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33221_c2_8_00258 -/ -@[expose] public section +public section noncomputable section @@ -8733,7 +8733,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33221_c3_8_00259 -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle025.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle025.lean index 793c240b01..6cb96cc93a 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle025.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle025.lean @@ -12,7 +12,7 @@ public import LeanPool.MovingSofa.GerverSofa.KernelOnly.Core.Bundle005 * `GerverSofa.KernelOnly.PartE.Certificates.Batch038`. -/ -@[expose] public section +public section noncomputable section @@ -4302,7 +4302,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.PhiBelow.Leaf00323`. -/ -@[expose] public section +public section noncomputable section @@ -4312,7 +4312,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33223_c0_8_00265 -/ -@[expose] public section +public section noncomputable section @@ -4417,7 +4417,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33223_c1_8_00266 -/ -@[expose] public section +public section noncomputable section @@ -4665,7 +4665,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33223_c2_8_00267 -/ -@[expose] public section +public section noncomputable section @@ -4757,7 +4757,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33223_c3_8_00268 -/ -@[expose] public section +public section noncomputable section @@ -4875,7 +4875,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33230_c0_8_00271 -/ -@[expose] public section +public section noncomputable section @@ -5188,7 +5188,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33230_c1_8_00272 -/ -@[expose] public section +public section noncomputable section @@ -5345,7 +5345,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33230_c2_c0_7_00274 -/ -@[expose] public section +public section noncomputable section @@ -5450,7 +5450,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33230_c2_c1_7_00275 -/ -@[expose] public section +public section noncomputable section @@ -5568,7 +5568,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33230_c2_c2_7_00276 -/ -@[expose] public section +public section noncomputable section @@ -5673,7 +5673,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33230_c2_c3_7_00277 -/ -@[expose] public section +public section noncomputable section @@ -5830,7 +5830,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33230_c3_c0_7_00280 -/ -@[expose] public section +public section noncomputable section @@ -5948,7 +5948,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33230_c3_c1_7_00281 -/ -@[expose] public section +public section noncomputable section @@ -6040,7 +6040,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33230_c3_c2_7_00282 -/ -@[expose] public section +public section noncomputable section @@ -6301,7 +6301,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33230_c3_c3_7_00283 -/ -@[expose] public section +public section noncomputable section @@ -6406,7 +6406,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33232_c0_c0_7_00290 -/ -@[expose] public section +public section noncomputable section @@ -6511,7 +6511,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33232_c0_c1_7_00291 -/ -@[expose] public section +public section noncomputable section @@ -6668,7 +6668,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33232_c0_c2_7_00292 -/ -@[expose] public section +public section noncomputable section @@ -6773,7 +6773,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33232_c0_c3_7_00293 -/ -@[expose] public section +public section noncomputable section @@ -6969,7 +6969,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33232_c1_c0_c0_6_00297 -/ -@[expose] public section +public section noncomputable section @@ -7074,7 +7074,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33232_c1_c0_c1_6_00298 -/ -@[expose] public section +public section noncomputable section @@ -7179,7 +7179,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33232_c1_c0_c2_6_00299 -/ -@[expose] public section +public section noncomputable section @@ -7284,7 +7284,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33232_c1_c0_c3_6_00300 -/ -@[expose] public section +public section noncomputable section @@ -7389,7 +7389,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33232_c1_c1_7_00302 -/ -@[expose] public section +public section noncomputable section @@ -7624,7 +7624,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33232_c1_c2_c0_6_00304 -/ -@[expose] public section +public section noncomputable section @@ -7729,7 +7729,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33232_c1_c2_c1_6_00305 -/ -@[expose] public section +public section noncomputable section @@ -7834,7 +7834,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33232_c1_c2_c2_6_00306 -/ -@[expose] public section +public section noncomputable section @@ -7939,7 +7939,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33232_c1_c2_c3_6_00307 -/ -@[expose] public section +public section noncomputable section @@ -8044,7 +8044,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33232_c1_c3_c0_6_00310 -/ -@[expose] public section +public section noncomputable section @@ -8162,7 +8162,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33232_c1_c3_c1_6_00311 -/ -@[expose] public section +public section noncomputable section @@ -8267,7 +8267,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33232_c1_c3_c2_6_00312 -/ -@[expose] public section +public section noncomputable section @@ -8424,7 +8424,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33232_c1_c3_c3_6_00313 -/ -@[expose] public section +public section noncomputable section @@ -8646,7 +8646,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33232_c2_8_00316 -/ -@[expose] public section +public section noncomputable section @@ -8985,7 +8985,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33232_c3_c0_7_00318 -/ -@[expose] public section +public section noncomputable section @@ -9298,7 +9298,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33232_c3_c1_c0_6_00320 -/ -@[expose] public section +public section noncomputable section @@ -9481,7 +9481,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33232_c3_c1_c1_c0_5_00322 -/ -@[expose] public section +public section noncomputable section @@ -9586,7 +9586,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33232_c3_c1_c1_c1_5_00323 -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle026.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle026.lean index 51c152e716..9c8fa3b26c 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle026.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle026.lean @@ -12,7 +12,7 @@ public import LeanPool.MovingSofa.GerverSofa.KernelOnly.Core.Bundle005 * `GerverSofa.KernelOnly.PartE.Certificates.Batch039`. -/ -@[expose] public section +public section noncomputable section @@ -4147,7 +4147,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.PhiBelow.Leaf00387`. -/ -@[expose] public section +public section noncomputable section @@ -4157,7 +4157,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33232_c3_c1_c1_c2_5_00324 -/ -@[expose] public section +public section noncomputable section @@ -4262,7 +4262,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33232_c3_c1_c1_c3_5_00325 -/ -@[expose] public section +public section noncomputable section @@ -4367,7 +4367,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33232_c3_c1_c2_6_00327 -/ -@[expose] public section +public section noncomputable section @@ -4576,7 +4576,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33232_c3_c1_c3_c0_5_00329 -/ -@[expose] public section +public section noncomputable section @@ -4681,7 +4681,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33232_c3_c1_c3_c1_5_00330 -/ -@[expose] public section +public section noncomputable section @@ -4786,7 +4786,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33232_c3_c1_c3_c2_5_00331 -/ -@[expose] public section +public section noncomputable section @@ -4891,7 +4891,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33232_c3_c1_c3_c3_5_00332 -/ -@[expose] public section +public section noncomputable section @@ -4996,7 +4996,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33232_c3_c2_7_00335 -/ -@[expose] public section +public section noncomputable section @@ -5231,7 +5231,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33232_c3_c3_c0_6_00337 -/ -@[expose] public section +public section noncomputable section @@ -5427,7 +5427,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33232_c3_c3_c1_c0_5_00339 -/ -@[expose] public section +public section noncomputable section @@ -5532,7 +5532,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33232_c3_c3_c1_c1_5_00340 -/ -@[expose] public section +public section noncomputable section @@ -5637,7 +5637,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33232_c3_c3_c1_c2_5_00341 -/ -@[expose] public section +public section noncomputable section @@ -5742,7 +5742,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33232_c3_c3_c1_c3_5_00342 -/ -@[expose] public section +public section noncomputable section @@ -5847,7 +5847,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33232_c3_c3_c2_6_00344 -/ -@[expose] public section +public section noncomputable section @@ -5965,7 +5965,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33232_c3_c3_c3_6_00345 -/ -@[expose] public section +public section noncomputable section @@ -6239,7 +6239,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c0_c0_7_00354 -/ -@[expose] public section +public section noncomputable section @@ -6344,7 +6344,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c0_c1_7_00355 -/ -@[expose] public section +public section noncomputable section @@ -6436,7 +6436,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c0_c2_7_00356 -/ -@[expose] public section +public section noncomputable section @@ -6645,7 +6645,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c0_c3_7_00357 -/ -@[expose] public section +public section noncomputable section @@ -6750,7 +6750,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c1_8_00359 -/ -@[expose] public section +public section noncomputable section @@ -6868,7 +6868,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c0_c0_6_00362 -/ -@[expose] public section +public section noncomputable section @@ -7051,7 +7051,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c0_c1_6_00363 -/ -@[expose] public section +public section noncomputable section @@ -7156,7 +7156,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c0_c2_c0_5_00365 -/ -@[expose] public section +public section noncomputable section @@ -7261,7 +7261,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c0_c2_c1_5_00366 -/ -@[expose] public section +public section noncomputable section @@ -7366,7 +7366,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c0_c2_c2_5_00367 -/ -@[expose] public section +public section noncomputable section @@ -7510,7 +7510,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c0_c2_c3_5_00368 -/ -@[expose] public section +public section noncomputable section @@ -7654,7 +7654,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c0_c3_6_00370 -/ -@[expose] public section +public section noncomputable section @@ -7824,7 +7824,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c1_7_00372 -/ -@[expose] public section +public section noncomputable section @@ -8007,7 +8007,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c2_c0_c0_5_00375 -/ -@[expose] public section +public section noncomputable section @@ -8190,7 +8190,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c2_c0_c1_5_00376 -/ -@[expose] public section +public section noncomputable section @@ -8464,7 +8464,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c2_c0_c2_5_00377 -/ -@[expose] public section +public section noncomputable section @@ -8673,7 +8673,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c2_c0_c3_c0_4_00379 -/ -@[expose] public section +public section noncomputable section @@ -8778,7 +8778,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c2_c0_c3_c1_4_00380 -/ -@[expose] public section +public section noncomputable section @@ -8883,7 +8883,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c2_c0_c3_c2_4_00381 -/ -@[expose] public section +public section noncomputable section @@ -8988,7 +8988,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c2_c0_c3_c3_4_00382 -/ -@[expose] public section +public section noncomputable section @@ -9093,7 +9093,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c2_c1_c0_5_00386 -/ -@[expose] public section +public section noncomputable section @@ -9211,7 +9211,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c2_c1_c1_5_00387 -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle027.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle027.lean index 6d4b1387d1..acd37f1066 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle027.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle027.lean @@ -12,7 +12,7 @@ public import LeanPool.MovingSofa.GerverSofa.KernelOnly.Core.Bundle005 * `GerverSofa.KernelOnly.PartE.Certificates.Batch040`. -/ -@[expose] public section +public section noncomputable section @@ -4224,7 +4224,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.PhiBelow.Leaf00443`. -/ -@[expose] public section +public section noncomputable section @@ -4234,7 +4234,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c2_c1_c2_5_00388 -/ -@[expose] public section +public section noncomputable section @@ -4508,7 +4508,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c2_c1_c3_5_00389 -/ -@[expose] public section +public section noncomputable section @@ -4626,7 +4626,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c2_c2_c0_5_00392 -/ -@[expose] public section +public section noncomputable section @@ -4848,7 +4848,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c2_c2_c1_c0_4_00394 -/ -@[expose] public section +public section noncomputable section @@ -4953,7 +4953,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c2_c2_c1_c1_4_00395 -/ -@[expose] public section +public section noncomputable section @@ -5058,7 +5058,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c2_c2_c1_c2_4_00396 -/ -@[expose] public section +public section noncomputable section @@ -5163,7 +5163,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c2_c2_c1_c3_4_00397 -/ -@[expose] public section +public section noncomputable section @@ -5268,7 +5268,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c2_c2_c2_5_00399 -/ -@[expose] public section +public section noncomputable section @@ -5438,7 +5438,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c2_c2_c3_5_00400 -/ -@[expose] public section +public section noncomputable section @@ -5751,7 +5751,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c2_c3_c0_c0_4_00404 -/ -@[expose] public section +public section noncomputable section @@ -5895,7 +5895,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c2_c3_c0_c1_4_00405 -/ -@[expose] public section +public section noncomputable section @@ -6039,7 +6039,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c2_c3_c0_c2_4_00406 -/ -@[expose] public section +public section noncomputable section @@ -6222,7 +6222,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c2_c3_c0_c3_4_00407 -/ -@[expose] public section +public section noncomputable section @@ -6509,7 +6509,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c2_c3_c1_5_00409 -/ -@[expose] public section +public section noncomputable section @@ -6783,7 +6783,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c2_c3_c2_c0_4_00411 -/ -@[expose] public section +public section noncomputable section @@ -6993,7 +6993,7 @@ section Leaf33233_c2_c2_c3_c2_c1_c0_3_00413 -/ -@[expose] public section +public section noncomputable section @@ -7099,7 +7099,7 @@ section Leaf33233_c2_c2_c3_c2_c1_c1_3_00414 -/ -@[expose] public section +public section noncomputable section @@ -7205,7 +7205,7 @@ section Leaf33233_c2_c2_c3_c2_c1_c2_c0_c0_1_00417 -/ -@[expose] public section +public section noncomputable section @@ -7239,7 +7239,7 @@ section Leaf33233_c2_c2_c3_c2_c1_c2_c0_c1_1_00418 -/ -@[expose] public section +public section noncomputable section @@ -7273,7 +7273,7 @@ section Leaf33233_c2_c2_c3_c2_c1_c2_c0_c2_1_00419 -/ -@[expose] public section +public section noncomputable section @@ -7307,7 +7307,7 @@ section Leaf33233_c2_c2_c3_c2_c1_c2_c0_c3_1_00420 -/ -@[expose] public section +public section noncomputable section @@ -7341,7 +7341,7 @@ section Leaf33233_c2_c2_c3_c2_c1_c2_c1_2_00422 -/ -@[expose] public section +public section noncomputable section @@ -7395,7 +7395,7 @@ section Leaf33233_c2_c2_c3_c2_c1_c2_c2_2_00423 -/ -@[expose] public section +public section noncomputable section @@ -7449,7 +7449,7 @@ section Leaf33233_c2_c2_c3_c2_c1_c2_c3_2_00424 -/ -@[expose] public section +public section noncomputable section @@ -7503,7 +7503,7 @@ section Leaf33233_c2_c2_c3_c2_c1_c3_3_00426 -/ -@[expose] public section +public section noncomputable section @@ -7608,7 +7608,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c2_c3_c2_c2_4_00428 -/ -@[expose] public section +public section noncomputable section @@ -7831,7 +7831,7 @@ section Leaf33233_c2_c2_c3_c2_c3_c0_3_00430 -/ -@[expose] public section +public section noncomputable section @@ -7937,7 +7937,7 @@ section Leaf33233_c2_c2_c3_c2_c3_c1_3_00431 -/ -@[expose] public section +public section noncomputable section @@ -8043,7 +8043,7 @@ section Leaf33233_c2_c2_c3_c2_c3_c2_3_00432 -/ -@[expose] public section +public section noncomputable section @@ -8149,7 +8149,7 @@ section Leaf33233_c2_c2_c3_c2_c3_c3_3_00433 -/ -@[expose] public section +public section noncomputable section @@ -8254,7 +8254,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c2_c3_c3_c0_4_00437 -/ -@[expose] public section +public section noncomputable section @@ -8528,7 +8528,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c2_c3_c3_c1_4_00438 -/ -@[expose] public section +public section noncomputable section @@ -8647,7 +8647,7 @@ section Leaf33233_c2_c2_c3_c3_c2_c0_3_00440 -/ -@[expose] public section +public section noncomputable section @@ -8792,7 +8792,7 @@ section Leaf33233_c2_c2_c3_c3_c2_c1_3_00441 -/ -@[expose] public section +public section noncomputable section @@ -8937,7 +8937,7 @@ section Leaf33233_c2_c2_c3_c3_c2_c2_3_00442 -/ -@[expose] public section +public section noncomputable section @@ -9095,7 +9095,7 @@ section Leaf33233_c2_c2_c3_c3_c2_c3_3_00443 -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle028.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle028.lean index df46e5e903..ae3022b6db 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle028.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle028.lean @@ -13,7 +13,7 @@ public import LeanPool.MovingSofa.GerverSofa.KernelOnly.Core.Bundle007 * `GerverSofa.KernelOnly.PartE.Certificates.Batch041`. -/ -@[expose] public section +public section noncomputable section @@ -4074,7 +4074,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.ThetaAbove.Leaf00503`. -/ -@[expose] public section +public section noncomputable section @@ -4084,7 +4084,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c2_c3_c3_c3_4_00445 -/ -@[expose] public section +public section noncomputable section @@ -4358,7 +4358,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c3_c0_6_00450 -/ -@[expose] public section +public section noncomputable section @@ -4502,7 +4502,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c3_c1_6_00451 -/ -@[expose] public section +public section noncomputable section @@ -4607,7 +4607,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c3_c2_c0_5_00453 -/ -@[expose] public section +public section noncomputable section @@ -4712,7 +4712,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c3_c2_c1_5_00454 -/ -@[expose] public section +public section noncomputable section @@ -4804,7 +4804,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c3_c2_c2_5_00455 -/ -@[expose] public section +public section noncomputable section @@ -5039,7 +5039,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c3_c2_c3_5_00456 -/ -@[expose] public section +public section noncomputable section @@ -5144,7 +5144,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c2_c3_c3_6_00458 -/ -@[expose] public section +public section noncomputable section @@ -5288,7 +5288,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Phi Below Leaf33233_c3_8_00461 -/ -@[expose] public section +public section noncomputable section @@ -5641,7 +5641,7 @@ section Leaf0000220020_c1_c1_c3_c1_c0_4_00009 -/ -@[expose] public section +public section noncomputable section @@ -5773,7 +5773,7 @@ section Leaf0000220020_c1_c1_c3_c1_c1_4_00010 -/ -@[expose] public section +public section noncomputable section @@ -5905,7 +5905,7 @@ section Leaf0000220020_c1_c1_c3_c1_c2_c0_3_00012 -/ -@[expose] public section +public section noncomputable section @@ -6011,7 +6011,7 @@ section Leaf0000220020_c1_c1_c3_c1_c2_c1_3_00013 -/ -@[expose] public section +public section noncomputable section @@ -6117,7 +6117,7 @@ section Leaf0000220020_c1_c1_c3_c1_c2_c2_3_00014 -/ -@[expose] public section +public section noncomputable section @@ -6171,7 +6171,7 @@ section Leaf0000220020_c1_c1_c3_c1_c2_c3_3_00015 -/ -@[expose] public section +public section noncomputable section @@ -6225,7 +6225,7 @@ section Leaf0000220020_c1_c1_c3_c1_c3_c0_3_00018 -/ -@[expose] public section +public section noncomputable section @@ -6331,7 +6331,7 @@ section Leaf0000220020_c1_c1_c3_c1_c3_c1_3_00019 -/ -@[expose] public section +public section noncomputable section @@ -6437,7 +6437,7 @@ section Leaf0000220020_c1_c1_c3_c1_c3_c2_3_00020 -/ -@[expose] public section +public section noncomputable section @@ -6491,7 +6491,7 @@ section Leaf0000220020_c1_c1_c3_c1_c3_c3_3_00021 -/ -@[expose] public section +public section noncomputable section @@ -6545,7 +6545,7 @@ section Leaf0000220020_c1_c1_c3_c2_5_00024 -/ -@[expose] public section +public section noncomputable section @@ -6599,7 +6599,7 @@ section Leaf0000220020_c1_c1_c3_c3_5_00025 -/ -@[expose] public section +public section noncomputable section @@ -6652,7 +6652,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Theta Above Leaf0000220020_c1_c2_7_00028 -/ -@[expose] public section +public section noncomputable section @@ -6731,7 +6731,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Direct_e24KC2Theta Above Leaf0000220020_c1_c3_7_00029 -/ -@[expose] public section +public section noncomputable section @@ -6811,7 +6811,7 @@ section Leaf0000220020_c0_c0_c0_6_00475 -/ -@[expose] public section +public section noncomputable section @@ -6891,7 +6891,7 @@ section Leaf0000220020_c0_c0_c1_6_00476 -/ -@[expose] public section +public section noncomputable section @@ -6971,7 +6971,7 @@ section Leaf0000220020_c0_c0_c2_c0_c0_c0_3_00480 -/ -@[expose] public section +public section noncomputable section @@ -7025,7 +7025,7 @@ section Leaf0000220020_c0_c0_c2_c0_c0_c1_3_00481 -/ -@[expose] public section +public section noncomputable section @@ -7079,7 +7079,7 @@ section Leaf0000220020_c0_c0_c2_c0_c0_c2_3_00482 -/ -@[expose] public section +public section noncomputable section @@ -7289,7 +7289,7 @@ section Leaf0000220020_c0_c0_c2_c0_c0_c3_3_00483 -/ -@[expose] public section +public section noncomputable section @@ -7499,7 +7499,7 @@ section Leaf0000220020_c0_c0_c2_c0_c1_c0_3_00486 -/ -@[expose] public section +public section noncomputable section @@ -7553,7 +7553,7 @@ section Leaf0000220020_c0_c0_c2_c0_c1_c1_3_00487 -/ -@[expose] public section +public section noncomputable section @@ -7607,7 +7607,7 @@ section Leaf0000220020_c0_c0_c2_c0_c1_c2_3_00488 -/ -@[expose] public section +public section noncomputable section @@ -7817,7 +7817,7 @@ section Leaf0000220020_c0_c0_c2_c0_c1_c3_3_00489 -/ -@[expose] public section +public section noncomputable section @@ -8027,7 +8027,7 @@ section Leaf0000220020_c0_c0_c2_c0_c2_4_00491 -/ -@[expose] public section +public section noncomputable section @@ -8159,7 +8159,7 @@ section Leaf0000220020_c0_c0_c2_c0_c3_4_00492 -/ -@[expose] public section +public section noncomputable section @@ -8343,7 +8343,7 @@ section Leaf0000220020_c0_c0_c2_c1_c0_c0_3_00496 -/ -@[expose] public section +public section noncomputable section @@ -8397,7 +8397,7 @@ section Leaf0000220020_c0_c0_c2_c1_c0_c1_3_00497 -/ -@[expose] public section +public section noncomputable section @@ -8451,7 +8451,7 @@ section Leaf0000220020_c0_c0_c2_c1_c0_c2_3_00498 -/ -@[expose] public section +public section noncomputable section @@ -8661,7 +8661,7 @@ section Leaf0000220020_c0_c0_c2_c1_c0_c3_3_00499 -/ -@[expose] public section +public section noncomputable section @@ -8871,7 +8871,7 @@ section Leaf0000220020_c0_c0_c2_c1_c1_c0_3_00502 -/ -@[expose] public section +public section noncomputable section @@ -8925,7 +8925,7 @@ section Leaf0000220020_c0_c0_c2_c1_c1_c1_3_00503 -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle029.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle029.lean index 334f934a27..e1f513f0ab 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle029.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle029.lean @@ -12,7 +12,7 @@ public import LeanPool.MovingSofa.GerverSofa.KernelOnly.Core.Bundle005 * `GerverSofa.KernelOnly.PartE.Certificates.Batch042`. -/ -@[expose] public section +public section noncomputable section @@ -4470,7 +4470,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.ThetaAbove.Leaf00565`. -/ -@[expose] public section +public section noncomputable section @@ -4481,7 +4481,7 @@ section Leaf0000220020_c0_c0_c2_c1_c1_c2_3_00504 -/ -@[expose] public section +public section noncomputable section @@ -4691,7 +4691,7 @@ section Leaf0000220020_c0_c0_c2_c1_c1_c3_3_00505 -/ -@[expose] public section +public section noncomputable section @@ -4901,7 +4901,7 @@ section Leaf0000220020_c0_c0_c2_c1_c2_4_00507 -/ -@[expose] public section +public section noncomputable section @@ -5137,7 +5137,7 @@ section Leaf0000220020_c0_c0_c2_c1_c3_4_00508 -/ -@[expose] public section +public section noncomputable section @@ -5373,7 +5373,7 @@ section Leaf0000220020_c0_c0_c2_c2_5_00510 -/ -@[expose] public section +public section noncomputable section @@ -5427,7 +5427,7 @@ section Leaf0000220020_c0_c0_c2_c3_5_00511 -/ -@[expose] public section +public section noncomputable section @@ -5481,7 +5481,7 @@ section Leaf0000220020_c0_c0_c3_c0_c0_c0_3_00516 -/ -@[expose] public section +public section noncomputable section @@ -5535,7 +5535,7 @@ section Leaf0000220020_c0_c0_c3_c0_c0_c1_3_00517 -/ -@[expose] public section +public section noncomputable section @@ -5589,7 +5589,7 @@ section Leaf0000220020_c0_c0_c3_c0_c0_c2_3_00518 -/ -@[expose] public section +public section noncomputable section @@ -5799,7 +5799,7 @@ section Leaf0000220020_c0_c0_c3_c0_c0_c3_3_00519 -/ -@[expose] public section +public section noncomputable section @@ -6009,7 +6009,7 @@ section Leaf0000220020_c0_c0_c3_c0_c1_c0_3_00522 -/ -@[expose] public section +public section noncomputable section @@ -6063,7 +6063,7 @@ section Leaf0000220020_c0_c0_c3_c0_c1_c1_3_00523 -/ -@[expose] public section +public section noncomputable section @@ -6117,7 +6117,7 @@ section Leaf0000220020_c0_c0_c3_c0_c1_c2_3_00524 -/ -@[expose] public section +public section noncomputable section @@ -6327,7 +6327,7 @@ section Leaf0000220020_c0_c0_c3_c0_c1_c3_3_00525 -/ -@[expose] public section +public section noncomputable section @@ -6537,7 +6537,7 @@ section Leaf0000220020_c0_c0_c3_c0_c2_4_00527 -/ -@[expose] public section +public section noncomputable section @@ -6773,7 +6773,7 @@ section Leaf0000220020_c0_c0_c3_c0_c3_4_00528 -/ -@[expose] public section +public section noncomputable section @@ -7009,7 +7009,7 @@ section Leaf0000220020_c0_c0_c3_c1_c0_c0_3_00532 -/ -@[expose] public section +public section noncomputable section @@ -7063,7 +7063,7 @@ section Leaf0000220020_c0_c0_c3_c1_c0_c1_3_00533 -/ -@[expose] public section +public section noncomputable section @@ -7097,7 +7097,7 @@ section Leaf0000220020_c0_c0_c3_c1_c0_c2_3_00534 -/ -@[expose] public section +public section noncomputable section @@ -7307,7 +7307,7 @@ section Leaf0000220020_c0_c0_c3_c1_c0_c3_3_00535 -/ -@[expose] public section +public section noncomputable section @@ -7517,7 +7517,7 @@ section Leaf0000220020_c0_c0_c3_c1_c1_c0_3_00538 -/ -@[expose] public section +public section noncomputable section @@ -7551,7 +7551,7 @@ section Leaf0000220020_c0_c0_c3_c1_c1_c1_3_00539 -/ -@[expose] public section +public section noncomputable section @@ -7585,7 +7585,7 @@ section Leaf0000220020_c0_c0_c3_c1_c1_c2_3_00540 -/ -@[expose] public section +public section noncomputable section @@ -7795,7 +7795,7 @@ section Leaf0000220020_c0_c0_c3_c1_c1_c3_3_00541 -/ -@[expose] public section +public section noncomputable section @@ -8005,7 +8005,7 @@ section Leaf0000220020_c0_c0_c3_c1_c2_4_00543 -/ -@[expose] public section +public section noncomputable section @@ -8241,7 +8241,7 @@ section Leaf0000220020_c0_c0_c3_c1_c3_4_00544 -/ -@[expose] public section +public section noncomputable section @@ -8477,7 +8477,7 @@ section Leaf0000220020_c0_c0_c3_c2_5_00546 -/ -@[expose] public section +public section noncomputable section @@ -8531,7 +8531,7 @@ section Leaf0000220020_c0_c0_c3_c3_5_00547 -/ -@[expose] public section +public section noncomputable section @@ -8585,7 +8585,7 @@ section Leaf0000220020_c0_c1_c0_6_00551 -/ -@[expose] public section +public section noncomputable section @@ -8665,7 +8665,7 @@ section Leaf0000220020_c0_c1_c1_6_00552 -/ -@[expose] public section +public section noncomputable section @@ -8745,7 +8745,7 @@ section Leaf0000220020_c0_c1_c2_c0_c0_c0_3_00556 -/ -@[expose] public section +public section noncomputable section @@ -8779,7 +8779,7 @@ section Leaf0000220020_c0_c1_c2_c0_c0_c1_3_00557 -/ -@[expose] public section +public section noncomputable section @@ -8813,7 +8813,7 @@ section Leaf0000220020_c0_c1_c2_c0_c0_c2_3_00558 -/ -@[expose] public section +public section noncomputable section @@ -9023,7 +9023,7 @@ section Leaf0000220020_c0_c1_c2_c0_c0_c3_3_00559 -/ -@[expose] public section +public section noncomputable section @@ -9233,7 +9233,7 @@ section Leaf0000220020_c0_c1_c2_c0_c1_c0_3_00562 -/ -@[expose] public section +public section noncomputable section @@ -9267,7 +9267,7 @@ section Leaf0000220020_c0_c1_c2_c0_c1_c1_3_00563 -/ -@[expose] public section +public section noncomputable section @@ -9301,7 +9301,7 @@ section Leaf0000220020_c0_c1_c2_c0_c1_c2_3_00564 -/ -@[expose] public section +public section noncomputable section @@ -9511,7 +9511,7 @@ section Leaf0000220020_c0_c1_c2_c0_c1_c3_3_00565 -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle030.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle030.lean index 39a05442cf..d5264f5175 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle030.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle030.lean @@ -57,7 +57,7 @@ public import LeanPool.MovingSofa.GerverSofa.KernelOnly.Core.Bundle007 * `GerverSofa.KernelOnly.PartE.Certificates.Reconstruction`. -/ -@[expose] public section +public section noncomputable section @@ -2663,7 +2663,7 @@ This module combines them using the adaptive-cover soundness lemmas. * `KernelOnly.PartE.E24KC6ProofBatch9b503cfa8ccc3ab1`. -/ -@[expose] public section +public section noncomputable section @@ -2673,7 +2673,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC6Theta Below Reconstruct -/ -@[expose] public section +public section noncomputable section @@ -5285,7 +5285,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Above Leaf1101101_c0_c0_c0_6_00029 -/ -@[expose] public section +public section noncomputable section @@ -5321,7 +5321,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Above Leaf1101101_c0_c0_c1_c0_5_00036 -/ -@[expose] public section +public section noncomputable section @@ -5357,7 +5357,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Above Leaf1101101_c0_c0_c1_c1_5_00042 -/ -@[expose] public section +public section noncomputable section @@ -5393,7 +5393,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Above Leaf1101101_c0_c0_c1_6_00045 -/ -@[expose] public section +public section noncomputable section @@ -5429,7 +5429,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Above Leaf1101101_c0_c0_7_00048 -/ -@[expose] public section +public section noncomputable section @@ -5465,7 +5465,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Above Leaf1101101_c0_c1_c0_c0_5_00056 -/ -@[expose] public section +public section noncomputable section @@ -5501,7 +5501,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Above Leaf1101101_c0_c1_c0_c1_5_00062 -/ -@[expose] public section +public section noncomputable section @@ -5537,7 +5537,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Above Leaf1101101_c0_c1_c0_6_00065 -/ -@[expose] public section +public section noncomputable section @@ -5573,7 +5573,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Above Leaf1101101_c0_c1_c1_6_00071 -/ -@[expose] public section +public section noncomputable section @@ -5609,7 +5609,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Above Leaf1101101_c0_c1_7_00074 -/ -@[expose] public section +public section noncomputable section @@ -5645,7 +5645,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Above Leaf1101101_c0_8_00077 -/ -@[expose] public section +public section noncomputable section @@ -5681,7 +5681,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Above Leaf1101101_c1_c0_c0_6_00085 -/ -@[expose] public section +public section noncomputable section @@ -5717,7 +5717,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Above Leaf1101101_c1_c0_c1_6_00091 -/ -@[expose] public section +public section noncomputable section @@ -5753,7 +5753,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Above Leaf1101101_c1_c0_7_00094 -/ -@[expose] public section +public section noncomputable section @@ -5789,7 +5789,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Above Leaf1101101_c1_c1_c0_6_00101 -/ -@[expose] public section +public section noncomputable section @@ -5825,7 +5825,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Above Leaf1101101_c1_c1_7_00105 -/ -@[expose] public section +public section noncomputable section @@ -5861,7 +5861,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Above Leaf1101101_c1_8_00108 -/ -@[expose] public section +public section noncomputable section @@ -5897,7 +5897,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Above Leaf1101101_9_00111 -/ -@[expose] public section +public section noncomputable section @@ -5933,7 +5933,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Above Leaf1101110_c0_c0_7_00122 -/ -@[expose] public section +public section noncomputable section @@ -5969,7 +5969,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Above Leaf1101110_c0_c1_c0_6_00129 -/ -@[expose] public section +public section noncomputable section @@ -6005,7 +6005,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Above Leaf1101110_c0_c1_7_00133 -/ -@[expose] public section +public section noncomputable section @@ -6041,7 +6041,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Above Leaf1101110_c0_8_00136 -/ -@[expose] public section +public section noncomputable section @@ -6077,7 +6077,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Above Leaf1101110_c1_8_00142 -/ -@[expose] public section +public section noncomputable section @@ -6113,7 +6113,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Above Leaf1101110_9_00145 -/ -@[expose] public section +public section noncomputable section @@ -6149,7 +6149,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Above Leaf1101111_c0_c1_7_00156 -/ -@[expose] public section +public section noncomputable section @@ -6185,7 +6185,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Above Leaf1101111_c0_8_00159 -/ -@[expose] public section +public section noncomputable section @@ -6221,7 +6221,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Above Leaf1101111_c1_8_00165 -/ -@[expose] public section +public section noncomputable section @@ -6257,7 +6257,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Above Leaf1101111_9_00168 -/ -@[expose] public section +public section noncomputable section @@ -6293,7 +6293,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Above Leaf1110000_c0_8_00178 -/ -@[expose] public section +public section noncomputable section @@ -6329,7 +6329,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Above Leaf1110000_9_00182 -/ -@[expose] public section +public section noncomputable section @@ -6365,7 +6365,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Above Leaf1110001_9_00191 -/ -@[expose] public section +public section noncomputable section @@ -6401,7 +6401,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Above Leaf1110010_9_00200 -/ -@[expose] public section +public section noncomputable section @@ -6437,7 +6437,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Above Leaf1110011_9_00208 -/ -@[expose] public section +public section noncomputable section @@ -6473,7 +6473,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC6Phi Above Reconstruct -/ -@[expose] public section +public section noncomputable section @@ -7192,7 +7192,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Below Leaf33203_9_00246 -/ -@[expose] public section +public section noncomputable section @@ -7228,7 +7228,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Below Leaf33221_9_00260 -/ -@[expose] public section +public section noncomputable section @@ -7264,7 +7264,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Below Leaf33223_9_00269 -/ -@[expose] public section +public section noncomputable section @@ -7300,7 +7300,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Below Leaf33230_c2_8_00278 -/ -@[expose] public section +public section noncomputable section @@ -7336,7 +7336,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Below Leaf33230_c3_8_00284 -/ -@[expose] public section +public section noncomputable section @@ -7372,7 +7372,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Below Leaf33230_9_00285 -/ -@[expose] public section +public section noncomputable section @@ -7408,7 +7408,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Below Leaf33232_c0_8_00294 -/ -@[expose] public section +public section noncomputable section @@ -7444,7 +7444,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Below Leaf33232_c1_c0_7_00301 -/ -@[expose] public section +public section noncomputable section @@ -7480,7 +7480,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Below Leaf33232_c1_c2_7_00308 -/ -@[expose] public section +public section noncomputable section @@ -7516,7 +7516,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Below Leaf33232_c1_c3_7_00314 -/ -@[expose] public section +public section noncomputable section @@ -7552,7 +7552,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Below Leaf33232_c1_8_00315 -/ -@[expose] public section +public section noncomputable section @@ -7588,7 +7588,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Below Leaf33232_c3_c1_c1_6_00326 -/ -@[expose] public section +public section noncomputable section @@ -7624,7 +7624,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Below Leaf33232_c3_c1_c3_6_00333 -/ -@[expose] public section +public section noncomputable section @@ -7660,7 +7660,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Below Leaf33232_c3_c1_7_00334 -/ -@[expose] public section +public section noncomputable section @@ -7696,7 +7696,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Below Leaf33232_c3_c3_c1_6_00343 -/ -@[expose] public section +public section noncomputable section @@ -7732,7 +7732,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Below Leaf33232_c3_c3_7_00346 -/ -@[expose] public section +public section noncomputable section @@ -7768,7 +7768,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Below Leaf33232_c3_8_00347 -/ -@[expose] public section +public section noncomputable section @@ -7804,7 +7804,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Below Leaf33232_9_00348 -/ -@[expose] public section +public section noncomputable section @@ -7840,7 +7840,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Below Leaf33233_c0_8_00358 -/ -@[expose] public section +public section noncomputable section @@ -7876,7 +7876,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Below Leaf33233_c2_c0_c2_6_00369 -/ -@[expose] public section +public section noncomputable section @@ -7912,7 +7912,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Below Leaf33233_c2_c0_7_00371 -/ -@[expose] public section +public section noncomputable section @@ -7948,7 +7948,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Below Leaf33233_c2_c2_c0_c3_5_00383 -/ -@[expose] public section +public section noncomputable section @@ -7984,7 +7984,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Below Leaf33233_c2_c2_c0_6_00384 -/ -@[expose] public section +public section noncomputable section @@ -8020,7 +8020,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Below Leaf33233_c2_c2_c1_6_00390 -/ -@[expose] public section +public section noncomputable section @@ -8056,7 +8056,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Below Leaf33233_c2_c2_c2_c1_5_00398 -/ -@[expose] public section +public section noncomputable section @@ -8092,7 +8092,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Below Leaf33233_c2_c2_c2_6_00401 -/ -@[expose] public section +public section noncomputable section @@ -8128,7 +8128,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Below Leaf33233_c2_c2_c3_c0_5_00408 -/ -@[expose] public section +public section noncomputable section @@ -8165,7 +8165,7 @@ section Leaf33233_c2_c2_c3_c2_c1_c2_c0_2_00421 -/ -@[expose] public section +public section noncomputable section @@ -8204,7 +8204,7 @@ section Leaf33233_c2_c2_c3_c2_c1_c2_3_00425 -/ -@[expose] public section +public section noncomputable section @@ -8240,7 +8240,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Below Leaf33233_c2_c2_c3_c2_c1_4_00427 -/ -@[expose] public section +public section noncomputable section @@ -8276,7 +8276,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Below Leaf33233_c2_c2_c3_c2_c3_4_00434 -/ -@[expose] public section +public section noncomputable section @@ -8312,7 +8312,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Below Leaf33233_c2_c2_c3_c2_5_00435 -/ -@[expose] public section +public section noncomputable section @@ -8348,7 +8348,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Below Leaf33233_c2_c2_c3_c3_c2_4_00444 -/ -@[expose] public section +public section noncomputable section @@ -8384,7 +8384,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Below Leaf33233_c2_c2_c3_c3_5_00446 -/ -@[expose] public section +public section noncomputable section @@ -8420,7 +8420,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Below Leaf33233_c2_c2_c3_6_00447 -/ -@[expose] public section +public section noncomputable section @@ -8456,7 +8456,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Below Leaf33233_c2_c2_7_00448 -/ -@[expose] public section +public section noncomputable section @@ -8492,7 +8492,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Below Leaf33233_c2_c3_c2_6_00457 -/ -@[expose] public section +public section noncomputable section @@ -8528,7 +8528,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Below Leaf33233_c2_c3_7_00459 -/ -@[expose] public section +public section noncomputable section @@ -8564,7 +8564,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Below Leaf33233_c2_8_00460 -/ -@[expose] public section +public section noncomputable section @@ -8600,7 +8600,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Phi Below Leaf33233_9_00462 -/ -@[expose] public section +public section noncomputable section @@ -8636,7 +8636,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC6Phi Below Reconstruct -/ -@[expose] public section +public section noncomputable section @@ -9086,7 +9086,7 @@ section Leaf0000220020_c1_c1_c3_c1_c2_4_00016 -/ -@[expose] public section +public section noncomputable section @@ -9125,7 +9125,7 @@ section Leaf0000220020_c1_c1_c3_c1_c3_4_00022 -/ -@[expose] public section +public section noncomputable section @@ -9164,7 +9164,7 @@ section Leaf0000220020_c1_c1_c3_c1_5_00023 -/ -@[expose] public section +public section noncomputable section @@ -9201,7 +9201,7 @@ section Leaf0000220020_c0_c0_c2_c0_c0_4_00484 -/ -@[expose] public section +public section noncomputable section @@ -9240,7 +9240,7 @@ section Leaf0000220020_c0_c0_c2_c0_c1_4_00490 -/ -@[expose] public section +public section noncomputable section @@ -9279,7 +9279,7 @@ section Leaf0000220020_c0_c0_c2_c0_5_00493 -/ -@[expose] public section +public section noncomputable section @@ -9316,7 +9316,7 @@ section Leaf0000220020_c0_c0_c2_c1_c0_4_00500 -/ -@[expose] public section +public section noncomputable section @@ -9355,7 +9355,7 @@ section Leaf0000220020_c0_c0_c2_c1_c1_4_00506 -/ -@[expose] public section +public section noncomputable section @@ -9394,7 +9394,7 @@ section Leaf0000220020_c0_c0_c2_c1_5_00509 -/ -@[expose] public section +public section noncomputable section @@ -9430,7 +9430,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Theta Above Leaf0000220020_c0_c0_c2_6_00512 -/ -@[expose] public section +public section noncomputable section @@ -9467,7 +9467,7 @@ section Leaf0000220020_c0_c0_c3_c0_c0_4_00520 -/ -@[expose] public section +public section noncomputable section @@ -9506,7 +9506,7 @@ section Leaf0000220020_c0_c0_c3_c0_c1_4_00526 -/ -@[expose] public section +public section noncomputable section @@ -9545,7 +9545,7 @@ section Leaf0000220020_c0_c0_c3_c0_5_00529 -/ -@[expose] public section +public section noncomputable section @@ -9582,7 +9582,7 @@ section Leaf0000220020_c0_c0_c3_c1_c0_4_00536 -/ -@[expose] public section +public section noncomputable section @@ -9621,7 +9621,7 @@ section Leaf0000220020_c0_c0_c3_c1_c1_4_00542 -/ -@[expose] public section +public section noncomputable section @@ -9660,7 +9660,7 @@ section Leaf0000220020_c0_c0_c3_c1_5_00545 -/ -@[expose] public section +public section noncomputable section @@ -9696,7 +9696,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Theta Above Leaf0000220020_c0_c0_c3_6_00548 -/ -@[expose] public section +public section noncomputable section @@ -9732,7 +9732,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Theta Above Leaf0000220020_c0_c0_7_00549 -/ -@[expose] public section +public section noncomputable section @@ -9769,7 +9769,7 @@ section Leaf0000220020_c0_c1_c2_c0_c0_4_00560 -/ -@[expose] public section +public section noncomputable section @@ -9808,7 +9808,7 @@ section Leaf0000220020_c0_c1_c2_c0_c1_4_00566 -/ -@[expose] public section +public section noncomputable section @@ -9847,7 +9847,7 @@ section Leaf0000220020_c0_c1_c2_c0_5_00569 -/ -@[expose] public section +public section noncomputable section @@ -9884,7 +9884,7 @@ section Leaf0000220020_c0_c1_c2_c1_c0_4_00576 -/ -@[expose] public section +public section noncomputable section @@ -9923,7 +9923,7 @@ section Leaf0000220020_c0_c1_c2_c1_5_00580 -/ -@[expose] public section +public section noncomputable section @@ -9959,7 +9959,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Theta Above Leaf0000220020_c0_c1_c2_6_00583 -/ -@[expose] public section +public section noncomputable section @@ -9996,7 +9996,7 @@ section Leaf0000220020_c0_c1_c3_c0_5_00590 -/ -@[expose] public section +public section noncomputable section @@ -10033,7 +10033,7 @@ section Leaf0000220020_c0_c1_c3_c1_5_00596 -/ -@[expose] public section +public section noncomputable section @@ -10069,7 +10069,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Theta Above Leaf0000220020_c0_c1_c3_6_00599 -/ -@[expose] public section +public section noncomputable section @@ -10105,7 +10105,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Theta Above Leaf0000220020_c0_c1_7_00600 -/ -@[expose] public section +public section noncomputable section @@ -10141,7 +10141,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Theta Above Leaf0000220020_c0_8_00603 -/ -@[expose] public section +public section noncomputable section @@ -10178,7 +10178,7 @@ section Leaf0000220020_c1_c0_c2_c0_5_00614 -/ -@[expose] public section +public section noncomputable section @@ -10215,7 +10215,7 @@ section Leaf0000220020_c1_c0_c2_c1_5_00620 -/ -@[expose] public section +public section noncomputable section @@ -10251,7 +10251,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Theta Above Leaf0000220020_c1_c0_c2_6_00623 -/ -@[expose] public section +public section noncomputable section @@ -10288,7 +10288,7 @@ section Leaf0000220020_c1_c0_c3_c0_5_00630 -/ -@[expose] public section +public section noncomputable section @@ -10325,7 +10325,7 @@ section Leaf0000220020_c1_c0_c3_c1_5_00636 -/ -@[expose] public section +public section noncomputable section @@ -10361,7 +10361,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Theta Above Leaf0000220020_c1_c0_c3_6_00639 -/ -@[expose] public section +public section noncomputable section @@ -10397,7 +10397,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Theta Above Leaf0000220020_c1_c0_7_00640 -/ -@[expose] public section +public section noncomputable section @@ -10434,7 +10434,7 @@ section Leaf0000220020_c1_c1_c2_c0_5_00650 -/ -@[expose] public section +public section noncomputable section @@ -10471,7 +10471,7 @@ section Leaf0000220020_c1_c1_c2_c1_5_00656 -/ -@[expose] public section +public section noncomputable section @@ -10507,7 +10507,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Theta Above Leaf0000220020_c1_c1_c2_6_00659 -/ -@[expose] public section +public section noncomputable section @@ -10544,7 +10544,7 @@ section Leaf0000220020_c1_c1_c3_c0_5_00666 -/ -@[expose] public section +public section noncomputable section @@ -10580,7 +10580,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Theta Above Leaf0000220020_c1_c1_c3_6_00026 -/ -@[expose] public section +public section noncomputable section @@ -10616,7 +10616,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC5Join_e24KC2Theta Above Leaf0000220020_c1_c1_7_00027 -/ -@[expose] public section +public section noncomputable section @@ -10650,7 +10650,7 @@ section /-! E24KC6 explicit proof-producing certificate batch. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle031.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle031.lean index 352247b91f..03afcc6b33 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle031.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle031.lean @@ -12,7 +12,7 @@ public import LeanPool.MovingSofa.GerverSofa.KernelOnly.PartE.Certificates.Bundl * `GerverSofa.KernelOnly.PartE.Certificates.Batch045`. -/ -@[expose] public section +public section noncomputable section @@ -2865,7 +2865,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.ThetaAbove.ReconstructionBase`. -/ -@[expose] public section +public section noncomputable section @@ -2875,7 +2875,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC6Theta Above Reconstruct -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle032.lean b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle032.lean index d895be5ff0..e1a9db0130 100644 --- a/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle032.lean +++ b/LeanPool/MovingSofa/GerverSofa/KernelOnly/PartE/Certificates/Bundle032.lean @@ -15,7 +15,7 @@ public import LeanPool.MovingSofa.GerverSofa.KernelOnly.PartE.Certificates.Bundl * `GerverSofa.KernelOnly.PartE.Certificates.Batch046`. -/ -@[expose] public section +public section noncomputable section @@ -34,7 +34,7 @@ Authors: Dawid Trela * `KernelOnly.PartE.E24KC6KernelFinalClosure`. -/ -@[expose] public section +public section noncomputable section @@ -44,7 +44,7 @@ section # Intermediate reconstruction of the upper theta cover -/ -@[expose] public section +public section noncomputable section @@ -5564,7 +5564,7 @@ section # Reconstruction of the upper theta cover -/ -@[expose] public section +public section noncomputable section @@ -9645,7 +9645,7 @@ section # Gerver Sofa / Kernel Only / Part E / E24KC6Kernel Final Closure -/ -@[expose] public section +public section noncomputable section 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/NandakumarRamanaRao.lean b/LeanPool/NandakumarRamanaRao.lean index 380d96757b..b9d6859050 100644 --- a/LeanPool/NandakumarRamanaRao.lean +++ b/LeanPool/NandakumarRamanaRao.lean @@ -398,4 +398,4 @@ Tags: convex-geometry, equivariant-topology, partitions MSC: 52A10, 55M20 -/ -@[expose] public section +public section diff --git a/LeanPool/NandakumarRamanaRao/HumanVerification.lean b/LeanPool/NandakumarRamanaRao/HumanVerification.lean index 565bea5dda..8406faf7fd 100644 --- a/LeanPool/NandakumarRamanaRao/HumanVerification.lean +++ b/LeanPool/NandakumarRamanaRao/HumanVerification.lean @@ -16,4 +16,4 @@ public import LeanPool.NandakumarRamanaRao.HumanVerification.Transfer /-! Supporting modules for Equal-area and equal-perimeter convex partitions. -/ -@[expose] public section +public section diff --git a/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton.lean b/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton.lean index b25c169af6..d9addec111 100644 --- a/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton.lean +++ b/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton.lean @@ -19,4 +19,4 @@ public import LeanPool.NandakumarRamanaRao.HumanVerification.CauchyCrofton.Theor /-! Supporting modules for Equal-area and equal-perimeter convex partitions. -/ -@[expose] public section +public section diff --git a/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/Basic.lean b/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/Basic.lean index f75ec42993..7b20d21817 100644 --- a/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/Basic.lean +++ b/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/Basic.lean @@ -24,7 +24,7 @@ It records their behaviour under translations and positive dilations and an elem squeeze lemma in `ℝ≥0∞`. -/ -@[expose] public section +public section open Set MeasureTheory open scoped ENNReal NNReal Pointwise @@ -39,11 +39,11 @@ abbrev Point2 := NRR.HumanExport.Plane abbrev Body := NRR.Geometry.ConvexBody Point2 /-- Hausdorff perimeter: the one-dimensional Hausdorff measure of the topological boundary. -/ -def hPerimeter (K : Body) : ENNReal := +@[expose] def hPerimeter (K : Body) : ENNReal := (μH[1] : Measure Point2) (frontier (K : Set Point2)) /-- The project's real-valued Cauchy perimeter, coerced to `ℝ≥0∞`. -/ -def cPerimeter (K : Body) : ENNReal := +@[expose] def cPerimeter (K : Body) : ENNReal := ENNReal.ofReal (NRR.Geometry.ConvexBody.perimeter K) theorem hPerimeter_def (K : Body) : diff --git a/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/CyclicPolygon.lean b/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/CyclicPolygon.lean index 2057fda7d5..1a28e99188 100644 --- a/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/CyclicPolygon.lean +++ b/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/CyclicPolygon.lean @@ -27,7 +27,7 @@ The cyclic ordering of the vertices is therefore supplied by the construction; n combinatorial analysis of an arbitrary finite planar point set is needed. -/ -@[expose] public section +public section open Set MeasureTheory NRR.Geometry open scoped ENNReal NNReal Pointwise @@ -139,16 +139,16 @@ end AngleSystem variable (K : Body) (A : AngleSystem) /-- The `j`-th vertex: the radial boundary point of `K` at angle `A.θ j`. -/ -def vtx (j : ℤ) : Point2 := radPt K (A.θ j) +@[expose] def vtx (j : ℤ) : Point2 := radPt K (A.θ j) /-- The vertex set of the polygon, together with the origin. -/ -def polyVerts : Set Point2 := insert 0 (Set.range fun j : Fin A.m => vtx K A (j : ℤ)) +@[expose] def polyVerts : Set Point2 := insert 0 (Set.range fun j : Fin A.m => vtx K A (j : ℤ)) /-- The inscribed polygon attached to `K` and the angle system `A`. -/ -def polySet : Set Point2 := convexHull ℝ (polyVerts K A) +@[expose] def polySet : Set Point2 := convexHull ℝ (polyVerts K A) /-- The `j`-th edge. -/ -def edge (j : ℤ) : Set Point2 := segment ℝ (vtx K A j) (vtx K A (j + 1)) +@[expose] def edge (j : ℤ) : Set Point2 := segment ℝ (vtx K A j) (vtx K A (j + 1)) /-- Outward normal of the `j`-th edge. -/ def nrm (j : ℤ) : Point2 := rot (vtx K A j - vtx K A (j + 1)) @@ -577,6 +577,7 @@ theorem zero_mem_interior_polySet (h0 : (0 : Point2) ∈ interior (K : Set Point exact mem_interior.2 ⟨Metric.ball 0 ε, hsub, Metric.isOpen_ball, Metric.mem_ball_self hε⟩ /-- The polygon, as a convex body. -/ +@[expose] def polyBody (K : Body) (A : AngleSystem) (h0 : (0 : Point2) ∈ interior (K : Set Point2)) : Body where carrier := polySet K A diff --git a/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/CyclicSum.lean b/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/CyclicSum.lean index 58ce0d27a0..72a720fcc6 100644 --- a/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/CyclicSum.lean +++ b/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/CyclicSum.lean @@ -25,7 +25,7 @@ steps are pairwise disjoint (two of them would produce two up-crossings of a com they cover the range interval `[N, M)` up to the single point `0`. -/ -@[expose] public section +public section open MeasureTheory Set diff --git a/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/HausdorffMonotonicity.lean b/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/HausdorffMonotonicity.lean index f9dc1ab1ec..c2bf639b67 100644 --- a/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/HausdorffMonotonicity.lean +++ b/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/HausdorffMonotonicity.lean @@ -20,7 +20,7 @@ outwards along a supporting direction until it hits the boundary of `L`), so one-dimensional Hausdorff measure. -/ -@[expose] public section +public section open Set MeasureTheory open scoped ENNReal NNReal Topology diff --git a/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/NearestProjection.lean b/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/NearestProjection.lean index d8f690f3a1..83428b5949 100644 --- a/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/NearestProjection.lean +++ b/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/NearestProjection.lean @@ -11,7 +11,7 @@ public import Mathlib.Analysis.InnerProductSpace.Projection.Minimal /-! # Nearest Projection -/ -@[expose] public section +public section open Set MeasureTheory open scoped ENNReal NNReal diff --git a/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/PolygonApproximation.lean b/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/PolygonApproximation.lean index e432d84bc6..00df9cdf41 100644 --- a/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/PolygonApproximation.lean +++ b/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/PolygonApproximation.lean @@ -27,7 +27,7 @@ vertices is immediate. The inclusion `r⁻¹ • K ⊆ P` follows from two elem `L * cos (δ / 2)`, where `δ` is the angle subtended by the chord. -/ -@[expose] public section +public section open Set MeasureTheory NRR.Geometry open scoped ENNReal NNReal Pointwise @@ -37,7 +37,7 @@ noncomputable section namespace HumanVerification.CauchyCrofton /-- The uniform angle system with `M` directions. -/ -def uniformAngles (M : ℕ) (hM : 5 ≤ M) : AngleSystem where +@[expose] def uniformAngles (M : ℕ) (hM : 5 ≤ M) : AngleSystem where m := M θ := fun j => (j : ℝ) * (2 * Real.pi / M) strictMono := by diff --git a/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/PolygonCauchy.lean b/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/PolygonCauchy.lean index cfcbc81c75..b20c285a89 100644 --- a/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/PolygonCauchy.lean +++ b/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/PolygonCauchy.lean @@ -25,7 +25,7 @@ Integrating this identity over the circle and using `∫₀^{2π} |⟪e, circleV identifies the Cauchy perimeter of the polygon with the sum of its edge lengths. -/ -@[expose] public section +public section open Set MeasureTheory NRR.Geometry open scoped ENNReal NNReal Pointwise diff --git a/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/PolygonHausdorff.lean b/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/PolygonHausdorff.lean index 250ed2aa9b..f65b26352b 100644 --- a/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/PolygonHausdorff.lean +++ b/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/PolygonHausdorff.lean @@ -17,7 +17,7 @@ segment is the distance between its endpoints. Hence the Hausdorff perimeter of the sum of its edge lengths. -/ -@[expose] public section +public section open Set MeasureTheory NRR.Geometry open scoped ENNReal NNReal Pointwise @@ -29,7 +29,7 @@ namespace HumanVerification.CauchyCrofton variable {K : Body} {A : AngleSystem} /-- The cyclic sum of edge lengths of the inscribed polygon. -/ -def edgeLengthSum (K : Body) (A : AngleSystem) : ℝ := +@[expose] def edgeLengthSum (K : Body) (A : AngleSystem) : ℝ := ∑ j ∈ Finset.range A.m, dist (vtx K A (j : ℤ)) (vtx K A ((j : ℤ) + 1)) theorem edgeLengthSum_nonneg (K : Body) (A : AngleSystem) : 0 ≤ edgeLengthSum K A := diff --git a/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/Radial.lean b/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/Radial.lean index d81369b1c0..818e4f99ad 100644 --- a/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/Radial.lean +++ b/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/Radial.lean @@ -26,7 +26,7 @@ We also record the planar cross product and the trigonometric identity expressin lying between two others as a nonnegative combination of them. -/ -@[expose] public section +public section open Set MeasureTheory NRR.Geometry open scoped ENNReal NNReal Pointwise @@ -38,7 +38,7 @@ namespace HumanVerification.CauchyCrofton /-! ### Planar cross product -/ /-- The planar cross product. -/ -def cross (x y : Point2) : ℝ := x 0 * y 1 - x 1 * y 0 +@[expose] def cross (x y : Point2) : ℝ := x 0 * y 1 - x 1 * y 0 /-- Rotation by a quarter turn. -/ def rot (x : Point2) : Point2 := !₂[-x 1, x 0] @@ -219,7 +219,7 @@ def radSet (K : Body) (θ : ℝ) : Set ℝ := def rad (K : Body) (θ : ℝ) : ℝ := sSup (radSet K θ) /-- The radial boundary point of `K` in direction `circleVec θ`. -/ -def radPt (K : Body) (θ : ℝ) : Point2 := rad K θ • circleVec θ +@[expose] def radPt (K : Body) (θ : ℝ) : Point2 := rad K θ • circleVec θ theorem radPt_eq (K : Body) (θ : ℝ) : radPt K θ = rad K θ • circleVec θ := rfl diff --git a/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/Theorem.lean b/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/Theorem.lean index a4ad99c3f6..da51380d03 100644 --- a/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/Theorem.lean +++ b/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCrofton/Theorem.lean @@ -30,7 +30,7 @@ a squeeze as `r ↓ 1` gives the Cauchy–Crofton identity for every planar compact convex body with nonempty interior. -/ -@[expose] public section +public section open Set MeasureTheory NRR.Geometry open scoped ENNReal NNReal Pointwise diff --git a/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCroftonStatement.lean b/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCroftonStatement.lean index be85080156..b4c624143d 100644 --- a/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCroftonStatement.lean +++ b/LeanPool/NandakumarRamanaRao/HumanVerification/CauchyCroftonStatement.lean @@ -10,7 +10,7 @@ public import LeanPool.NandakumarRamanaRao.HumanVerification.InternalModel /-! # Cauchy Crofton Statement -/ -@[expose] public section +public section open Set MeasureTheory @@ -19,7 +19,7 @@ noncomputable section namespace HumanVerification /-- The exact general planar Cauchy--Crofton bridge needed by the wrapper. -/ -def CauchyCroftonStatement : Prop := +@[expose] def CauchyCroftonStatement : Prop := ∀ K : NRR.Geometry.ConvexBody NRR.HumanExport.Plane, (μH[1] : Measure NRR.HumanExport.Plane) (frontier (K : Set NRR.HumanExport.Plane)) = diff --git a/LeanPool/NandakumarRamanaRao/HumanVerification/Check.lean b/LeanPool/NandakumarRamanaRao/HumanVerification/Check.lean index b7e64da39d..a5acc69fff 100644 --- a/LeanPool/NandakumarRamanaRao/HumanVerification/Check.lean +++ b/LeanPool/NandakumarRamanaRao/HumanVerification/Check.lean @@ -10,7 +10,7 @@ public import LeanPool.NandakumarRamanaRao.HumanVerification.Main /-! # Check -/ -@[expose] public section +public section /-- The public plane is definitionally the standard two-dimensional Euclidean space. -/ example : diff --git a/LeanPool/NandakumarRamanaRao/HumanVerification/EqualAreaEqualPerimeterPartitionWrapper.lean b/LeanPool/NandakumarRamanaRao/HumanVerification/EqualAreaEqualPerimeterPartitionWrapper.lean index d117ee0868..4759846049 100644 --- a/LeanPool/NandakumarRamanaRao/HumanVerification/EqualAreaEqualPerimeterPartitionWrapper.lean +++ b/LeanPool/NandakumarRamanaRao/HumanVerification/EqualAreaEqualPerimeterPartitionWrapper.lean @@ -11,7 +11,7 @@ public import LeanPool.NandakumarRamanaRao.HumanVerification.CauchyCrofton.Theor /-! # Equal Area Equal Perimeter Partition Wrapper -/ -@[expose] public section +public section open Set MeasureTheory diff --git a/LeanPool/NandakumarRamanaRao/HumanVerification/InternalModel.lean b/LeanPool/NandakumarRamanaRao/HumanVerification/InternalModel.lean index 0d831696ef..584782c375 100644 --- a/LeanPool/NandakumarRamanaRao/HumanVerification/InternalModel.lean +++ b/LeanPool/NandakumarRamanaRao/HumanVerification/InternalModel.lean @@ -16,7 +16,7 @@ public import LeanPool.NandakumarRamanaRao.NRR.FairPartition.Predicates /-! # Internal Model -/ -@[expose] public section +public section open Set MeasureTheory @@ -50,7 +50,7 @@ namespace ConvexFigureModel variable {α : Type} [ConvexFigureModel α] /-- Convert any model value into the convex-body type used by NRR. -/ -def toBody (F : α) : NRR.Geometry.ConvexBody Plane where +@[expose] def toBody (F : α) : NRR.Geometry.ConvexBody Plane where carrier := ConvexFigureModel.carrier F convex' := ConvexFigureModel.isConvex F isCompact' := ConvexFigureModel.isCompact F diff --git a/LeanPool/NandakumarRamanaRao/HumanVerification/Main.lean b/LeanPool/NandakumarRamanaRao/HumanVerification/Main.lean index 99dd51ab85..4a86f59ad0 100644 --- a/LeanPool/NandakumarRamanaRao/HumanVerification/Main.lean +++ b/LeanPool/NandakumarRamanaRao/HumanVerification/Main.lean @@ -11,7 +11,7 @@ public import LeanPool.NandakumarRamanaRao.HumanVerification.EqualAreaEqualPerim /-! # Main -/ -@[expose] public section +public section noncomputable section @@ -31,6 +31,7 @@ structure ConvexFigure where namespace ConvexFigure /-- Convert a public figure to the solid convex-body type used by the proof. -/ +@[expose] def toBody (F : ConvexFigure) : NRR.Geometry.ConvexBody Plane where carrier := F.carrier convex' := F.isConvex @@ -38,6 +39,7 @@ def toBody (F : ConvexFigure) : NRR.Geometry.ConvexBody Plane where interior_nonempty' := F.hasNonemptyInterior /-- Present an internal solid convex body as a public figure. -/ +@[expose] def ofBody (K : NRR.Geometry.ConvexBody Plane) : ConvexFigure where carrier := K isConvex := K.convex @@ -75,11 +77,11 @@ instance instConvexFigureModel : NRR.HumanExport.ConvexFigureModel ConvexFigure carrier_ofBody := by exact ofBody_carrier /-- Lebesgue area of the figure's carrier. -/ -def area (F : ConvexFigure) : ENNReal := +@[expose] def area (F : ConvexFigure) : ENNReal := MeasureTheory.volume F.carrier /-- One-dimensional Hausdorff measure of the figure's boundary. -/ -def perimeter (F : ConvexFigure) : ENNReal := +@[expose] def perimeter (F : ConvexFigure) : ENNReal := (MeasureTheory.Measure.hausdorffMeasure (1 : ℝ) : MeasureTheory.Measure Plane) (frontier F.carrier) @@ -87,7 +89,7 @@ def perimeter (F : ConvexFigure) : ENNReal := end ConvexFigure /-- A finite family covers the figure and has pairwise disjoint interiors. -/ -def IsConvexPartition {n : ℕ} +@[expose] def IsConvexPartition {n : ℕ} (F : ConvexFigure) (pieces : Fin n → ConvexFigure) : Prop := F.carrier = ⋃ i, (pieces i).carrier ∧ ∀ i j, i ≠ j → diff --git a/LeanPool/NandakumarRamanaRao/HumanVerification/Transfer.lean b/LeanPool/NandakumarRamanaRao/HumanVerification/Transfer.lean index eb9309f193..a0a9f379dd 100644 --- a/LeanPool/NandakumarRamanaRao/HumanVerification/Transfer.lean +++ b/LeanPool/NandakumarRamanaRao/HumanVerification/Transfer.lean @@ -11,7 +11,7 @@ public import LeanPool.NandakumarRamanaRao.NRR.AAK.MainTheoremAffinePullback /-! # Transfer -/ -@[expose] public section +public section open Set MeasureTheory diff --git a/LeanPool/NandakumarRamanaRao/NRR.lean b/LeanPool/NandakumarRamanaRao/NRR.lean index 6178b5da5a..245ff36087 100644 --- a/LeanPool/NandakumarRamanaRao/NRR.lean +++ b/LeanPool/NandakumarRamanaRao/NRR.lean @@ -14,4 +14,4 @@ public import LeanPool.NandakumarRamanaRao.NRR.AAK.MainTheoremAffinePullback Public entry point for the Nandakumar-Ramana Rao formalization. -/ -@[expose] public section +public section diff --git a/LeanPool/NandakumarRamanaRao/NRR/AAK.lean b/LeanPool/NandakumarRamanaRao/NRR/AAK.lean index f5a6ecf2c0..3854d0b57b 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/AAK.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/AAK.lean @@ -12,4 +12,4 @@ public import LeanPool.NandakumarRamanaRao.NRR.AAK.SimplestRouteS6Refined /-! Supporting modules for Equal-area and equal-perimeter convex partitions. -/ -@[expose] public section +public section diff --git a/LeanPool/NandakumarRamanaRao/NRR/AAK/MainTheoremAffinePullback.lean b/LeanPool/NandakumarRamanaRao/NRR/AAK/MainTheoremAffinePullback.lean index 25d3a29c4c..d64462dba3 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/AAK/MainTheoremAffinePullback.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/AAK/MainTheoremAffinePullback.lean @@ -17,7 +17,7 @@ by the refined S6 route. This module provides the final adapter and exports the `n` fair-partition theorem without a theorem-provider argument. -/ -@[expose] public section +public section namespace NRR namespace AAK diff --git a/LeanPool/NandakumarRamanaRao/NRR/AAK/SimplestRoute.lean b/LeanPool/NandakumarRamanaRao/NRR/AAK/SimplestRoute.lean index 2b22c4a0e5..6f9250610a 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/AAK/SimplestRoute.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/AAK/SimplestRoute.lean @@ -26,7 +26,7 @@ compact glued configuration model, while the top cycle is defined by the genuine incidence sum. -/ -@[expose] public section +public section namespace NRR namespace AAK @@ -86,6 +86,7 @@ open Geometry /-- The exact analytic/topological theorem needed after the finite cellular and affine stages. Its output is a locally constant orbit obstruction on the complement of the projected zero set. -/ +@[expose] def SimplestRouteObstructionTheorem : Prop := ∀ (p : Nat) (hp : Nat.Prime p) (K : Geometry.ConvexBody Plane) (A : Real) (hA : 0 < A) diff --git a/LeanPool/NandakumarRamanaRao/NRR/AAK/SimplestRouteS6Refined.lean b/LeanPool/NandakumarRamanaRao/NRR/AAK/SimplestRouteS6Refined.lean index 59410f506c..2f5c9fcc28 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/AAK/SimplestRouteS6Refined.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/AAK/SimplestRouteS6Refined.lean @@ -21,7 +21,7 @@ reference endpoint is discharged explicitly at level zero by the reference-map s transversality theorem. -/ -@[expose] public section +public section namespace NRR namespace AAK diff --git a/LeanPool/NandakumarRamanaRao/NRR/AreaPerimeter.lean b/LeanPool/NandakumarRamanaRao/NRR/AreaPerimeter.lean index dfd33f3a9b..ab0b81127a 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/AreaPerimeter.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/AreaPerimeter.lean @@ -24,7 +24,7 @@ for explicitly parameterized convex-body families with jointly continuous angle- No topology on the type of all convex bodies is assumed. -/ -@[expose] public section +public section open NRR open scoped RealInnerProductSpace @@ -33,7 +33,7 @@ namespace NRR.Geometry.ConvexBody /-- **Perimeter** of a planar convex body, defined by Cauchy's mean-width formula: an alias of the implemented `NRR.Geometry.planarPerimeter`. -/ -noncomputable def perimeter (K : ConvexBody Plane) : ℝ := +@[expose] noncomputable def perimeter (K : ConvexBody Plane) : ℝ := NRR.Geometry.planarPerimeter K /-- Definitional unfolding of `perimeter`. -/ diff --git a/LeanPool/NandakumarRamanaRao/NRR/BodySpace.lean b/LeanPool/NandakumarRamanaRao/NRR/BodySpace.lean index a659288cb7..a5b6feb293 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/BodySpace.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/BodySpace.lean @@ -38,4 +38,4 @@ The metric is Mathlib's Hausdorff distance on nonempty compact planar sets, tran pointwise membership stability under Hausdorff convergence. -/ -@[expose] public section +public section diff --git a/LeanPool/NandakumarRamanaRao/NRR/BodySpace/AreaContinuity.lean b/LeanPool/NandakumarRamanaRao/NRR/BodySpace/AreaContinuity.lean index 5cda946658..f93e5b3094 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/BodySpace/AreaContinuity.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/BodySpace/AreaContinuity.lean @@ -26,7 +26,7 @@ theorem, with the constant parent indicator as an integrable dominating function * `ConvexSubbody.continuous_area` — the area functional is continuous. -/ -@[expose] public section +public section open MeasureTheory open Filter Topology diff --git a/LeanPool/NandakumarRamanaRao/NRR/BodySpace/AreaRigidity.lean b/LeanPool/NandakumarRamanaRao/NRR/BodySpace/AreaRigidity.lean index a51a050f33..7c74a60477 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/BodySpace/AreaRigidity.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/BodySpace/AreaRigidity.lean @@ -24,7 +24,7 @@ The set-level argument is elementary: a point of `interior D` lies outside the c inside `D` and misses `C`, contributing strictly positive extra area. -/ -@[expose] public section +public section open MeasureTheory Metric diff --git a/LeanPool/NandakumarRamanaRao/NRR/BodySpace/Basic.lean b/LeanPool/NandakumarRamanaRao/NRR/BodySpace/Basic.lean index ef6c41fc0c..f887bfff19 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/BodySpace/Basic.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/BodySpace/Basic.lean @@ -26,7 +26,7 @@ The area of a subbody is the real-valued Lebesgue measure of its carrier, matchi of `Geometry.ConvexBody.area`. -/ -@[expose] public section +public section open MeasureTheory @@ -36,7 +36,7 @@ namespace NRR /-- A **convex subbody** of a fixed solid parent body `K`: a compact, nonempty, convex Mathlib body whose carrier is contained in `K`. Elements may be lower-dimensional. -/ -def ConvexSubbody (K : Geometry.ConvexBody Plane) := +@[expose] def ConvexSubbody (K : Geometry.ConvexBody Plane) := {C : _root_.ConvexBody Plane // (C : Set Plane) ⊆ (K : Set Plane)} namespace ConvexSubbody @@ -44,7 +44,7 @@ namespace ConvexSubbody variable {K : Geometry.ConvexBody Plane} /-- The underlying Mathlib convex body of a subbody. -/ -def body (C : ConvexSubbody K) : _root_.ConvexBody Plane := C.1 +@[expose] def body (C : ConvexSubbody K) : _root_.ConvexBody Plane := C.1 /-- Coercion of a subbody to its underlying carrier set. The `ConvexSubbody` wrapper is a `def` over a subtype, so the subtype/root-body coercion chain does not fire automatically; this instance @@ -57,7 +57,7 @@ theorem subset_parent (C : ConvexSubbody K) : C.2 /-- **Area** of a subbody: the real-valued Lebesgue measure of its carrier. -/ -noncomputable def area (C : ConvexSubbody K) : ℝ := +@[expose] noncomputable def area (C : ConvexSubbody K) : ℝ := (volume (C.body : Set Plane)).toReal @[simp] theorem body_carrier (C : ConvexSubbody K) : @@ -99,7 +99,7 @@ theorem area_lt_top (C : ConvexSubbody K) : end ConvexSubbody /-- The **lower-area subspace**: subbodies of `K` whose area is at least `A`. -/ -def BodySpace (K : Geometry.ConvexBody Plane) (A : ℝ) := +@[expose] def BodySpace (K : Geometry.ConvexBody Plane) (A : ℝ) := {C : ConvexSubbody K // A ≤ C.area} end NRR diff --git a/LeanPool/NandakumarRamanaRao/NRR/BodySpace/BoundaryNull.lean b/LeanPool/NandakumarRamanaRao/NRR/BodySpace/BoundaryNull.lean index 2753cf155d..4b1112cd35 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/BodySpace/BoundaryNull.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/BodySpace/BoundaryNull.lean @@ -22,7 +22,7 @@ lemma required by membership stability and area continuity: almost every point o the frontier of a given subbody. -/ -@[expose] public section +public section open MeasureTheory diff --git a/LeanPool/NandakumarRamanaRao/NRR/BodySpace/Compactness.lean b/LeanPool/NandakumarRamanaRao/NRR/BodySpace/Compactness.lean index c5d6a3dd2c..9504228eeb 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/BodySpace/Compactness.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/BodySpace/Compactness.lean @@ -28,7 +28,7 @@ that embedding yields compactness of `Set.univ` in `ConvexSubbody K`, hence the compactness is grounded in the fixed compact parent rather than in an unproved Blaschke selection. -/ -@[expose] public section +public section open MeasureTheory Metric TopologicalSpace Filter Topology diff --git a/LeanPool/NandakumarRamanaRao/NRR/BodySpace/ConvexClosed.lean b/LeanPool/NandakumarRamanaRao/NRR/BodySpace/ConvexClosed.lean index 90bfd489e4..a6e3c71e53 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/BodySpace/ConvexClosed.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/BodySpace/ConvexClosed.lean @@ -32,7 +32,7 @@ endpoints of a segment and passing the convex combinations to the limit; closedn (`isClosed_convex_nonemptyCompacts`) is the sequential packaging of this fact. -/ -@[expose] public section +public section open MeasureTheory Metric Filter Topology EMetric diff --git a/LeanPool/NandakumarRamanaRao/NRR/BodySpace/FullBody.lean b/LeanPool/NandakumarRamanaRao/NRR/BodySpace/FullBody.lean index c506f342a2..affa5899c2 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/BodySpace/FullBody.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/BodySpace/FullBody.lean @@ -12,7 +12,7 @@ public import LeanPool.NandakumarRamanaRao.NRR.BodySpace.PositiveArea # The full parent body as a hyperspace point -/ -@[expose] public section +public section namespace NRR @@ -22,7 +22,7 @@ namespace BodySpace /-- The parent body itself, regarded as an element of `BodySpace K A` whenever the threshold is at most the parent's area. -/ -noncomputable def parentAt +@[expose] noncomputable def parentAt (K : Geometry.ConvexBody Plane) {A : ℝ} (hAK : A ≤ K.area) : BodySpace K A := ⟨⟨K.toMathlib, subset_rfl⟩, hAK⟩ @@ -38,7 +38,7 @@ theorem parentAt_body_carrier rfl /-- The parent body itself, regarded as an element of `BodySpace K K.area`. -/ -noncomputable def full (K : Geometry.ConvexBody Plane) : BodySpace K K.area := +@[expose] noncomputable def full (K : Geometry.ConvexBody Plane) : BodySpace K K.area := parentAt K le_rfl theorem full_body_carrier (K : Geometry.ConvexBody Plane) : diff --git a/LeanPool/NandakumarRamanaRao/NRR/BodySpace/MembershipStability.lean b/LeanPool/NandakumarRamanaRao/NRR/BodySpace/MembershipStability.lean index cab6481372..9283d47945 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/BodySpace/MembershipStability.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/BodySpace/MembershipStability.lean @@ -33,7 +33,7 @@ from a compact convex set by a unit normal, packaged as the auxiliary set lemmas `exists_separating_unit` and `mem_of_hausdorffDist_lt`. -/ -@[expose] public section +public section open MeasureTheory Metric Filter Topology open scoped RealInnerProductSpace diff --git a/LeanPool/NandakumarRamanaRao/NRR/BodySpace/PerimeterContinuity.lean b/LeanPool/NandakumarRamanaRao/NRR/BodySpace/PerimeterContinuity.lean index 07fad7f54d..c1ed133fbc 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/BodySpace/PerimeterContinuity.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/BodySpace/PerimeterContinuity.lean @@ -24,7 +24,7 @@ composed with `Geometry.ConvexBody.area`) and perimeter both vary continuously o lower-area hyperspace `BodySpace K A`. -/ -@[expose] public section +public section open Filter Topology diff --git a/LeanPool/NandakumarRamanaRao/NRR/BodySpace/PositiveArea.lean b/LeanPool/NandakumarRamanaRao/NRR/BodySpace/PositiveArea.lean index 593c9a8ddc..c028586259 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/BodySpace/PositiveArea.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/BodySpace/PositiveArea.lean @@ -34,7 +34,7 @@ area is at least `A`. with the continuous projection `BodySpace.body`. -/ -@[expose] public section +public section open MeasureTheory Metric Filter Topology @@ -57,7 +57,7 @@ instance instT2Space : T2Space (BodySpace K A) := inferInstanceAs (T2Space {C : ConvexSubbody K // A ≤ C.area}) /-- The underlying convex subbody of an element of `BodySpace K A`. -/ -def body (C : BodySpace K A) : ConvexSubbody K := C.1 +@[expose] def body (C : BodySpace K A) : ConvexSubbody K := C.1 /-- The area lower bound satisfied by every element of `BodySpace K A`. -/ theorem area_lower (C : BodySpace K A) : @@ -95,7 +95,7 @@ theorem area_pos /-- **Positive-area solid bridge.** When `A > 0`, an element of `BodySpace K A` repackages as a solid geometry body: its carrier is convex and compact (from the underlying subbody) and has nonempty interior (from positive area). -/ -noncomputable def toGeometryConvexBody +@[expose] noncomputable def toGeometryConvexBody (C : BodySpace K A) (hA : 0 < A) : Geometry.ConvexBody Plane where carrier := (C.body : Set Plane) diff --git a/LeanPool/NandakumarRamanaRao/NRR/BodySpace/SupportWidthContinuity.lean b/LeanPool/NandakumarRamanaRao/NRR/BodySpace/SupportWidthContinuity.lean index 5db2855778..7e00695c83 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/BodySpace/SupportWidthContinuity.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/BodySpace/SupportWidthContinuity.lean @@ -47,7 +47,7 @@ follow from the core reusable lemma applied to the continuous bridge `BodySpace.continuous_toGeometryConvexBody`. -/ -@[expose] public section +public section open MeasureTheory Metric Filter Topology @@ -132,7 +132,7 @@ variable {K : Geometry.ConvexBody Plane} /-- **Support function of a convex subbody.** The supremum of `⟪x, u⟫` over the (compact, nonempty) carrier of `C`. This is the same formula as `Geometry.ConvexBody.supportFunction`, valid for a possibly-degenerate carrier; it agrees with the geometry support function on solid subbodies. -/ -noncomputable def supportFunction (C : ConvexSubbody K) (u : Plane) : ℝ := +@[expose] noncomputable def supportFunction (C : ConvexSubbody K) (u : Plane) : ℝ := sSup ((fun x : Plane => (inner ℝ x u : ℝ)) '' (C.body : Set Plane)) /-- Unfolding lemma for the subbody support function. -/ @@ -173,7 +173,7 @@ theorem supportFunction_eq_geometry (C : ConvexSubbody K) (G : Geometry.ConvexBo rw [supportFunction_eq_sSup, Geometry.ConvexBody.supportFunction_eq_sSup, h] /-- **Width function of a convex subbody**: `w_C(u) = h_C(u) + h_C(-u)`. -/ -noncomputable def widthFunction (C : ConvexSubbody K) (u : Plane) : ℝ := +@[expose] noncomputable def widthFunction (C : ConvexSubbody K) (u : Plane) : ℝ := C.supportFunction u + C.supportFunction (-u) /-- Unfolding lemma for the subbody width function. -/ diff --git a/LeanPool/NandakumarRamanaRao/NRR/BodySpace/Topology.lean b/LeanPool/NandakumarRamanaRao/NRR/BodySpace/Topology.lean index 0f657df65f..06909320d7 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/BodySpace/Topology.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/BodySpace/Topology.lean @@ -28,7 +28,7 @@ No new metric, hyperspace topology, or convex-body type is introduced: everythin from the root Mathlib body and its Hausdorff metric. -/ -@[expose] public section +public section open MeasureTheory Metric TopologicalSpace Filter Topology @@ -52,7 +52,7 @@ instance instT2Space : T2Space (ConvexSubbody K) := inferInstance /-- The forgetful map to the hyperspace of **nonempty compact sets**: a subbody is sent to its carrier, together with its compactness and nonemptiness witnesses. -/ -def toNonemptyCompacts (C : ConvexSubbody K) : TopologicalSpace.NonemptyCompacts Plane := +@[expose] def toNonemptyCompacts (C : ConvexSubbody K) : TopologicalSpace.NonemptyCompacts Plane := ⟨⟨(C.body : Set Plane), C.isCompact⟩, C.nonempty⟩ @[simp] theorem toNonemptyCompacts_carrier (C : ConvexSubbody K) : diff --git a/LeanPool/NandakumarRamanaRao/NRR/ConfigurationSpace.lean b/LeanPool/NandakumarRamanaRao/NRR/ConfigurationSpace.lean index ab6bff9af2..714060372c 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/ConfigurationSpace.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/ConfigurationSpace.lean @@ -16,19 +16,19 @@ public import LeanPool.NandakumarRamanaRao.NRR.ConvexBody map, and permutations act by precomposition with `σ.symm`. The action is continuous and free. -/ -@[expose] public section +public section open NRR namespace NRR /-- **Configuration space** of `n` distinct labelled points in the plane. -/ -def Config (n : ℕ) : Type := {p : Fin n → E2 // Function.Injective p} +@[expose] def Config (n : ℕ) : Type := {p : Fin n → E2 // Function.Injective p} namespace Config /-- The underlying point map of a configuration. -/ -def pts {n : ℕ} (p : Config n) : Fin n → E2 := p.1 +@[expose] def pts {n : ℕ} (p : Config n) : Fin n → E2 := p.1 end Config @@ -48,7 +48,7 @@ theorem topology_eq_induced (n : ℕ) : /-- The underlying point map of a configuration, as a bundled function. Compatibility alias of `Config.pts`. -/ -def toFun {n : ℕ} (s : Config n) : Fin n → E2 := s.pts +@[expose] def toFun {n : ℕ} (s : Config n) : Fin n → E2 := s.pts @[simp] theorem toFun_apply {n : ℕ} (s : Config n) (i : Fin n) : s.toFun i = s.pts i := rfl @@ -69,7 +69,7 @@ theorem continuous_pts {n : ℕ} : Continuous fun s : Config n => s.pts := configuration `s : Config n`, the relabelled configuration `Config.relabel σ s` is obtained by precomposing the point map with `σ.symm`, i.e. `(Config.relabel σ s).pts i = s.pts (σ.symm i)`. This `σ.symm` convention is fixed for the remainder of the current development. -/ -def relabel {n : ℕ} (σ : Equiv.Perm (Fin n)) (s : Config n) : Config n := +@[expose] def relabel {n : ℕ} (σ : Equiv.Perm (Fin n)) (s : Config n) : Config n := ⟨fun i => s.pts (σ.symm i), s.injective_pts.comp σ.symm.injective⟩ @[simp] theorem relabel_pts {n : ℕ} (σ : Equiv.Perm (Fin n)) (s : Config n) (i : Fin n) : diff --git a/LeanPool/NandakumarRamanaRao/NRR/ConvexBody.lean b/LeanPool/NandakumarRamanaRao/NRR/ConvexBody.lean index b1841fe538..258ffb0cee 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/ConvexBody.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/ConvexBody.lean @@ -38,7 +38,7 @@ Every geometry `ConvexBody` is already solid, so `IsSolid`/`SolidConvexBody` are downstream compatibility rather than as genuine extra data. -/ -@[expose] public section +public section open MeasureTheory @@ -59,6 +59,7 @@ namespace NRR.Geometry.ConvexBody /-- The **forgetful map** from a solid geometry convex body to Mathlib's root `ConvexBody`, dropping the solidity (nonempty-interior) witness and keeping only compactness, convexity, and nonemptiness. This names the map inducing the Hausdorff-metric topology below. -/ +@[expose] def toMathlib {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] (K : NRR.Geometry.ConvexBody E) : @@ -87,6 +88,7 @@ namespace NRR.Geometry.ConvexBody open MeasureTheory /-- **Area** of a planar convex body: the (real‑valued) Lebesgue measure of its carrier. -/ +@[expose] noncomputable def area (K : ConvexBody Plane) : ℝ := (volume (K : Set Plane)).toReal @@ -136,6 +138,7 @@ structure SolidConvexBody where namespace SolidConvexBody /-- Bundle any geometry convex body as a `SolidConvexBody`: geometry bodies are always solid. -/ +@[expose] def ofConvexBody (K : Geometry.ConvexBody Geometry.Plane) : SolidConvexBody := ⟨K, K.isSolid⟩ diff --git a/LeanPool/NandakumarRamanaRao/NRR/EMP.lean b/LeanPool/NandakumarRamanaRao/NRR/EMP.lean index eeaf9560a6..4e7b303fb8 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/EMP.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/EMP.lean @@ -28,4 +28,4 @@ public import LeanPool.NandakumarRamanaRao.NRR.EMP.WeightSpace /-! Supporting modules for Equal-area and equal-perimeter convex partitions. -/ -@[expose] public section +public section diff --git a/LeanPool/NandakumarRamanaRao/NRR/EMP/AreaVectorTarget.lean b/LeanPool/NandakumarRamanaRao/NRR/EMP/AreaVectorTarget.lean index 63a2e6b5c4..c947ba9fed 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/EMP/AreaVectorTarget.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/EMP/AreaVectorTarget.lean @@ -46,7 +46,7 @@ No existence of equal‑area weights and no topological‑degree/obstruction arg proved here. -/ -@[expose] public section +public section open NRR NRR.Geometry NRR.Geometry.ConvexBody @@ -58,13 +58,13 @@ namespace EMP /-- **Target equal‑area vector.** The constant vector whose every component is the average area `K.area / n`. -/ -noncomputable def equalAreaTarget +@[expose] noncomputable def equalAreaTarget (K : Geometry.ConvexBody Plane) (n : ℕ) : Fin n → ℝ := fun _ => K.area / n /-- **Zero‑sum deviation map.** The difference between the area vector and the equal‑area target; for distinct sites its components sum to zero. -/ -noncomputable def areaDeviation +@[expose] noncomputable def areaDeviation (K : Geometry.ConvexBody Plane) (s : Fin n → Plane) (w : Fin n → ℝ) : Fin n → ℝ := fun i => EMP.areaVec K s w i - EMP.equalAreaTarget K n i diff --git a/LeanPool/NandakumarRamanaRao/NRR/EMP/EqualAreaWeightCellRigidity.lean b/LeanPool/NandakumarRamanaRao/NRR/EMP/EqualAreaWeightCellRigidity.lean index a5bf81668e..38fc3f8404 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/EMP/EqualAreaWeightCellRigidity.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/EMP/EqualAreaWeightCellRigidity.lean @@ -26,7 +26,7 @@ global uniqueness step is to propagate equality of the maximal difference across adjacency graph. -/ -@[expose] public section +public section open NRR NRR.Geometry MeasureTheory diff --git a/LeanPool/NandakumarRamanaRao/NRR/EMP/EqualAreaWeightCoercivity.lean b/LeanPool/NandakumarRamanaRao/NRR/EMP/EqualAreaWeightCoercivity.lean index 1ab5c4f412..00a8c19660 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/EMP/EqualAreaWeightCoercivity.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/EMP/EqualAreaWeightCoercivity.lean @@ -21,7 +21,7 @@ A continuous homogeneous gauge detects both components. Its restriction to the Euclidean unit sphere has a positive minimum, giving a uniform outward radius. -/ -@[expose] public section +public section noncomputable section @@ -159,7 +159,7 @@ theorem exists_positive_gauge_lower_bound_on_sphere exact hx0.2 (by simpa [Metric.mem_sphere, dist_eq_norm] using hx) /-- The augmented deviation field on the full Euclidean weight space. -/ -noncomputable def augmentedAreaDeviation +@[expose] noncomputable def augmentedAreaDeviation (K : Geometry.ConvexBody Plane) (s : Fin n → Plane) (w : WeightE n) : WeightE n := (WithLp.equiv 2 (Fin n → Real)).symm fun i => diff --git a/LeanPool/NandakumarRamanaRao/NRR/EMP/EqualAreaWeightMaxUnion.lean b/LeanPool/NandakumarRamanaRao/NRR/EMP/EqualAreaWeightMaxUnion.lean index 73b463021d..1f51315be1 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/EMP/EqualAreaWeightMaxUnion.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/EMP/EqualAreaWeightMaxUnion.lean @@ -27,7 +27,7 @@ This supplies the global propagation step needed for uniqueness of equal-area we introducing a separate adjacency graph for the power diagram. -/ -@[expose] public section +public section open NRR NRR.Geometry MeasureTheory diff --git a/LeanPool/NandakumarRamanaRao/NRR/EMP/EqualAreaWeightOutward.lean b/LeanPool/NandakumarRamanaRao/NRR/EMP/EqualAreaWeightOutward.lean index f8443b78d1..e072c5128f 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/EMP/EqualAreaWeightOutward.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/EMP/EqualAreaWeightOutward.lean @@ -22,7 +22,7 @@ body/site bound. Consequently the scalar pairing of the weight vector with its vector is at least `(M - C) * K.area`. -/ -@[expose] public section +public section open NRR NRR.Geometry MeasureTheory @@ -105,7 +105,7 @@ lemma areaVec_nonneg simp [EMP.areaVec, PowerDiagram.areaVec, PowerDiagram.bodyCellArea] /-- Pairing of weights with the area-deviation vector. -/ -noncomputable def deviationPairing +@[expose] noncomputable def deviationPairing (K : Geometry.ConvexBody Plane) (s : Fin n → Plane) (w : Fin n → Real) : Real := ∑ i, w i * EMP.areaDeviation K s w i diff --git a/LeanPool/NandakumarRamanaRao/NRR/EMP/EqualAreaWeights.lean b/LeanPool/NandakumarRamanaRao/NRR/EMP/EqualAreaWeights.lean index 39c708526f..e1ca9aad88 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/EMP/EqualAreaWeights.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/EMP/EqualAreaWeights.lean @@ -64,7 +64,7 @@ theorem EMP.equalArea_weights_unique ``` -/ -@[expose] public section +public section open NRR NRR.Geometry NRR.Geometry.ConvexBody @@ -76,7 +76,7 @@ namespace EMP /-- **Equal‑area (power‑cell) area vector.** A thin alias of the fixed‑site restricted power‑cell area vector `PowerDiagram.areaVec K s w`. -/ -noncomputable def areaVec +@[expose] noncomputable def areaVec (K : Geometry.ConvexBody Plane) (s : Fin n → Plane) (w : Fin n → ℝ) : Fin n → ℝ := NRR.PowerDiagram.areaVec K s w @@ -88,7 +88,7 @@ noncomputable def areaVec /-- **Equal‑area weight.** The weights `w` are *equal‑area* for the sites `s` in `K` if every restricted power cell has exactly the average area `K.area / n`. The count `n : ℕ` is coerced to `ℝ` via `Nat.cast`. -/ -def IsEqualAreaWeight +@[expose] def IsEqualAreaWeight (K : Geometry.ConvexBody Plane) (s : Fin n → Plane) (w : Fin n → ℝ) : Prop := ∀ i, areaVec K s w i = K.area / (n : ℝ) diff --git a/LeanPool/NandakumarRamanaRao/NRR/EMP/EqualAreaWeightsExistence.lean b/LeanPool/NandakumarRamanaRao/NRR/EMP/EqualAreaWeightsExistence.lean index 5064195d65..7ef1f12b2f 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/EMP/EqualAreaWeightsExistence.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/EMP/EqualAreaWeightsExistence.lean @@ -38,7 +38,7 @@ the core theorem exactly, and the nondegeneracy hypotheses (`hn`, `hs`) are the justified in `OptimalTransportCore`. -/ -@[expose] public section +public section open NRR NRR.Geometry NRR.Geometry.ConvexBody diff --git a/LeanPool/NandakumarRamanaRao/NRR/EMP/EqualAreaWeightsUniqueness.lean b/LeanPool/NandakumarRamanaRao/NRR/EMP/EqualAreaWeightsUniqueness.lean index 2607b1170d..3c7c889e05 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/EMP/EqualAreaWeightsUniqueness.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/EMP/EqualAreaWeightsUniqueness.lean @@ -22,7 +22,7 @@ cell area and null pairwise overlap force every index to be maximal. Normalizat the common additive constant. -/ -@[expose] public section +public section open NRR NRR.Geometry NRR.Geometry.ConvexBody diff --git a/LeanPool/NandakumarRamanaRao/NRR/EMP/NormalizedAreaDeviation.lean b/LeanPool/NandakumarRamanaRao/NRR/EMP/NormalizedAreaDeviation.lean index 2a1c3ed20d..438d420f84 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/EMP/NormalizedAreaDeviation.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/EMP/NormalizedAreaDeviation.lean @@ -23,7 +23,7 @@ This is the finite-dimensional map to which the eventual degree / outward-pointi for existence of equal-area power weights is applied. -/ -@[expose] public section +public section open NRR NRR.Geometry NRR.Geometry.ConvexBody @@ -45,7 +45,7 @@ namespace NormalizedWeightSpace Subtype.ext h /-- The zero weight vector belongs to the normalized weight hyperplane. -/ -noncomputable def zero (n : ℕ) : EMP.NormalizedWeightSpace n := +@[expose] noncomputable def zero (n : ℕ) : EMP.NormalizedWeightSpace n := ⟨fun _ => 0, EMP.weightSum_zero⟩ @[simp] theorem coe_zero : @@ -55,7 +55,7 @@ noncomputable def zero (n : ℕ) : EMP.NormalizedWeightSpace n := end NormalizedWeightSpace /-- The area-deviation vector, regarded as a self-map of the normalized weight hyperplane. -/ -noncomputable def normalizedAreaDeviation +@[expose] noncomputable def normalizedAreaDeviation (K : Geometry.ConvexBody Plane) (s : Fin n → Plane) (hn : 0 < n) (hs : Function.Injective s) (w : EMP.NormalizedWeightSpace n) : EMP.NormalizedWeightSpace n := diff --git a/LeanPool/NandakumarRamanaRao/NRR/EMP/NormalizedWeightSelection.lean b/LeanPool/NandakumarRamanaRao/NRR/EMP/NormalizedWeightSelection.lean index 3cf5dd2ff6..53603d54b4 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/EMP/NormalizedWeightSelection.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/EMP/NormalizedWeightSelection.lean @@ -32,7 +32,7 @@ theorem. * `EMP.normalizedWeight_unique` — any equal‑area normalized weight equals the selected one. -/ -@[expose] public section +public section open NRR NRR.Geometry NRR.Geometry.ConvexBody @@ -59,7 +59,7 @@ both equal‑area for the sites `s` in `K` and normalized (`∑ i, w i = 0`), ob `Classical.choice` from the existence theorem `EMP.exists_normalized_equalArea_weight` (the existing existence theorem). By `EMP.normalized_equalArea_weight_subsingleton` this choice is in fact unique. -/ -noncomputable def EMP.normalizedWeight +@[expose] noncomputable def EMP.normalizedWeight (K : Geometry.ConvexBody Plane) (s : Fin n → Plane) (hn : 0 < n) (hs : Function.Injective s) : Fin n → ℝ := (Classical.choice (EMP.exists_normalized_equalArea_weight K s hn hs)).val diff --git a/LeanPool/NandakumarRamanaRao/NRR/EMP/NormalizedWeights.lean b/LeanPool/NandakumarRamanaRao/NRR/EMP/NormalizedWeights.lean index 87ed717c5d..9d9cdee760 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/EMP/NormalizedWeights.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/EMP/NormalizedWeights.lean @@ -38,7 +38,7 @@ exist. existence theorem `EMP.exists_equalArea_weights` with the two facts above. -/ -@[expose] public section +public section open NRR NRR.Geometry NRR.Geometry.ConvexBody @@ -50,7 +50,7 @@ namespace EMP /-- **Normalized equal‑area weight.** A weight vector that is both equal‑area for the sites `s` in `K` and normalized (`∑ i, w i = 0`). -/ -def NormalizedEqualAreaWeight +@[expose] def NormalizedEqualAreaWeight (K : Geometry.ConvexBody Plane) (s : Fin n → Plane) := {w : Fin n → ℝ // EMP.IsEqualAreaWeight K s w ∧ EMP.WeightNormalized w} diff --git a/LeanPool/NandakumarRamanaRao/NRR/EMP/OptimalTransportCore.lean b/LeanPool/NandakumarRamanaRao/NRR/EMP/OptimalTransportCore.lean index a4329d0c17..b3ddf688dc 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/EMP/OptimalTransportCore.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/EMP/OptimalTransportCore.lean @@ -65,7 +65,7 @@ outward-field zero theorem. It is consumed by `NRR.EMP.exists_equalArea_weights` `continuous_EMP_areaVec_weights`. -/ -@[expose] public section +public section open NRR NRR.Geometry NRR.Geometry.ConvexBody diff --git a/LeanPool/NandakumarRamanaRao/NRR/EMP/PartitionFromPowerDiagram.lean b/LeanPool/NandakumarRamanaRao/NRR/EMP/PartitionFromPowerDiagram.lean index 66433d0d1a..6a4dcf0d1c 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/EMP/PartitionFromPowerDiagram.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/EMP/PartitionFromPowerDiagram.lean @@ -34,7 +34,7 @@ The three partition obligations are discharged from the set‑level power‑diag * `EMP.powerPartition_nullOverlap` — distinct pieces overlap only on a null set. -/ -@[expose] public section +public section open NRR NRR.Geometry MeasureTheory @@ -46,7 +46,7 @@ variable {n : ℕ} normalized equal‑area weight `EMP.normalizedWeight K s.pts hn s.injective_pts`, bundled as a `ConvexPartition K n`. Covering comes from `PowerDiagram.iUnion_bodyCellSet`; null overlap of distinct pieces comes from `PowerDiagram.bodyCellSet_inter_null` via `Config` site injectivity. -/ -noncomputable def EMP.powerPartition +@[expose] noncomputable def EMP.powerPartition (K : Geometry.ConvexBody Plane) (s : Config n) (hn : 0 < n) (hK : 0 < K.area) : ConvexPartition K n where piece i := EMP.powerPartitionPiece K s hn hK i diff --git a/LeanPool/NandakumarRamanaRao/NRR/EMP/PowerCellPositiveArea.lean b/LeanPool/NandakumarRamanaRao/NRR/EMP/PowerCellPositiveArea.lean index 7e1eb54a5f..d2be69e21b 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/EMP/PowerCellPositiveArea.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/EMP/PowerCellPositiveArea.lean @@ -28,7 +28,7 @@ Equal area means each cell carries exactly the average area `K.area / n`; the co `n : ℕ ↦ (n : ℝ)` is via `Nat.cast`, so positivity follows from `0 < K.area` and `0 < n`. -/ -@[expose] public section +public section open NRR NRR.Geometry MeasureTheory diff --git a/LeanPool/NandakumarRamanaRao/NRR/EMP/PowerPartitionPerimeter.lean b/LeanPool/NandakumarRamanaRao/NRR/EMP/PowerPartitionPerimeter.lean index 1c081a4586..6843857010 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/EMP/PowerPartitionPerimeter.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/EMP/PowerPartitionPerimeter.lean @@ -33,7 +33,7 @@ The power-partition parameter profile is the one fixed in the project: No continuity, equivariance, or test-map material is introduced here. -/ -@[expose] public section +public section open NRR NRR.Geometry NRR.Geometry.ConvexBody @@ -42,7 +42,7 @@ namespace NRR variable {n : ℕ} /-- The **perimeter vector** of the canonical equal-area power partition. -/ -noncomputable def EMP.powerPartitionPerimeterVec +@[expose] noncomputable def EMP.powerPartitionPerimeterVec (K : Geometry.ConvexBody Plane) (s : Config n) (hn : 0 < n) (hK : 0 < K.area) : Fin n → ℝ := (EMP.powerPartition K s hn hK).perimeterVec diff --git a/LeanPool/NandakumarRamanaRao/NRR/EMP/PowerPartitionPieces.lean b/LeanPool/NandakumarRamanaRao/NRR/EMP/PowerPartitionPieces.lean index 1dfd846988..4c53bf8066 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/EMP/PowerPartitionPieces.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/EMP/PowerPartitionPieces.lean @@ -33,7 +33,7 @@ equal‑area (`EMP.normalizedWeight_isEqualArea`). The full partition (disjointness / covering of `K`) is out of scope here. -/ -@[expose] public section +public section open NRR NRR.Geometry MeasureTheory @@ -45,6 +45,7 @@ variable {n : ℕ} normalized equal‑area weight `EMP.normalizedWeight K s.pts hn s.injective_pts`, bundled as a `Geometry.ConvexBody`. Nonempty interior is provided by `PowerDiagram.bodyCellSet_interior_nonempty_of_equalArea` (the existing theorem). -/ +@[expose] noncomputable def EMP.powerPartitionPiece (K : Geometry.ConvexBody Plane) (s : Config n) (hn : 0 < n) (hK : 0 < K.area) (i : Fin n) : Geometry.ConvexBody Plane := diff --git a/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody.lean b/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody.lean index 2ab71e484e..6267cfde5f 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody.lean @@ -54,4 +54,4 @@ compact. The proofs go through the equal-area existence and uniqueness cores rea `EMP.normalizedWeight`, and do not invoke `EMP.continuous_normalizedWeight_core`. -/ -@[expose] public section +public section diff --git a/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/AreaVector.lean b/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/AreaVector.lean index 402c15464f..02ed598bae 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/AreaVector.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/AreaVector.lean @@ -24,7 +24,7 @@ an equal-area weight assigns to every cell. * `continuous_targetArea` — continuity of the average area in the parent subbody. -/ -@[expose] public section +public section open NRR NRR.Geometry NRR.Geometry.ConvexBody @@ -34,7 +34,7 @@ variable {K : Geometry.ConvexBody Plane} {A : ℝ} {n : ℕ} /-- The **area vector** of the variable body `C` for sites `s` and weights `w`: the vector whose `i`-th component is the area of the restricted power cell of site `i`. -/ -noncomputable def areaVec +@[expose] noncomputable def areaVec (hA : 0 < A) (C : BodySpace K A) (s : Config n) (w : Fin n → ℝ) : Fin n → ℝ := @@ -42,7 +42,7 @@ noncomputable def areaVec /-- The **target area** for an equal-area partition of the variable body `C` into `n` cells: the average cell area `C.body.area / n`. -/ -noncomputable def targetArea +@[expose] noncomputable def targetArea (C : BodySpace K A) (n : ℕ) : ℝ := C.body.area / (n : ℝ) diff --git a/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/Basic.lean b/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/Basic.lean index 13875e282b..b1edc233eb 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/Basic.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/Basic.lean @@ -24,7 +24,7 @@ normalized-weight APIs to the solid body `C.toGeometryConvexBody hA`. No new pow configuration space, weight selection, or convex-body topology is introduced. -/ -@[expose] public section +public section open NRR NRR.Geometry NRR.Geometry.ConvexBody @@ -32,14 +32,14 @@ namespace NRR.EMP.VariableBody /-- The **solid body** of a positive-area subbody parameter: the fixed-body geometry body obtained from `C : BodySpace K A` via the positive-area body bridge. -/ -noncomputable def solidBody +@[expose] noncomputable def solidBody {K : Geometry.ConvexBody Plane} {A : ℝ} (hA : 0 < A) (C : BodySpace K A) : Geometry.ConvexBody Plane := C.toGeometryConvexBody hA /-- The **restricted power cell** of site `i` inside the variable body `C`, as a set. -/ -def cellSet +@[expose] def cellSet {K : Geometry.ConvexBody Plane} {A : ℝ} {n : ℕ} (hA : 0 < A) (C : BodySpace K A) (s : Config n) (w : Fin n → ℝ) (i : Fin n) : @@ -47,7 +47,7 @@ def cellSet PowerDiagram.bodyCellSet (solidBody hA C) s.pts w i /-- The **area** of the restricted power cell of site `i` inside the variable body `C`. -/ -noncomputable def cellArea +@[expose] noncomputable def cellArea {K : Geometry.ConvexBody Plane} {A : ℝ} {n : ℕ} (hA : 0 < A) (C : BodySpace K A) (s : Config n) (w : Fin n → ℝ) (i : Fin n) : @@ -56,7 +56,7 @@ noncomputable def cellArea /-- `w` is an **equal-area weight** for the sites `s` inside the variable body `C`: every restricted power cell has the average area `C.area / n`. -/ -def IsEqualAreaWeight +@[expose] def IsEqualAreaWeight {K : Geometry.ConvexBody Plane} {A : ℝ} {n : ℕ} (hA : 0 < A) (C : BodySpace K A) (s : Config n) (w : Fin n → ℝ) : Prop := @@ -64,7 +64,7 @@ def IsEqualAreaWeight /-- `w` is a **normalized equal-area weight**: equal-area for `s` in `C` and normalized (`∑ i, w i = 0`). -/ -def IsNormalizedEqualAreaWeight +@[expose] def IsNormalizedEqualAreaWeight {K : Geometry.ConvexBody Plane} {A : ℝ} {n : ℕ} (hA : 0 < A) (C : BodySpace K A) (s : Config n) (w : Fin n → ℝ) : Prop := @@ -72,7 +72,7 @@ def IsNormalizedEqualAreaWeight /-- The **canonical normalized equal-area weight** for the sites `s` inside the variable body `C`, selected by the fixed-body existence/uniqueness core applied to `solidBody hA C`. -/ -noncomputable def normalizedWeight +@[expose] noncomputable def normalizedWeight {K : Geometry.ConvexBody Plane} {A : ℝ} {n : ℕ} (hA : 0 < A) (hn : 0 < n) (C : BodySpace K A) (s : Config n) : diff --git a/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/CanonicalCell.lean b/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/CanonicalCell.lean index bfe8b12b34..642e3ca4ac 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/CanonicalCell.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/CanonicalCell.lean @@ -28,7 +28,7 @@ gives it positive area (indeed nonempty interior). The cell area equals the targ `z.1.body.area / n`. -/ -@[expose] public section +public section open NRR NRR.Geometry NRR.Geometry.ConvexBody @@ -53,6 +53,7 @@ theorem canonicalCell_interior_nonempty /-- The **canonical variable-body power cell** of site `i`: the restricted power cell computed with the canonical normalized equal-area weight, bundled as a convex subbody of the fixed parent `K`. -/ +@[expose] noncomputable def canonicalCell (sites : SiteFamily X n) (hA : 0 < A) (hn : 0 < n) (z : BodySpace K A × X) (i : Fin n) : diff --git a/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/CanonicalCellContinuity.lean b/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/CanonicalCellContinuity.lean index fa1897797d..6a353cfad3 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/CanonicalCellContinuity.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/CanonicalCellContinuity.lean @@ -32,7 +32,7 @@ compact closed-graph criterion `continuous_of_isClosed_graph_of_compact` (both t family continuity from `continuous_pi`. -/ -@[expose] public section +public section open NRR NRR.Geometry NRR.Geometry.ConvexBody open Filter Topology diff --git a/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/CanonicalCellGraph.lean b/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/CanonicalCellGraph.lean index 421f2b9042..e58b14f16a 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/CanonicalCellGraph.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/CanonicalCellGraph.lean @@ -30,7 +30,7 @@ and the selected weight, through `continuous_normalizedWeight_compactFamily`) to closedness of `≤`. Hence `y` lies in the limiting cell. -/ -@[expose] public section +public section open NRR NRR.Geometry NRR.Geometry.ConvexBody open scoped RealInnerProductSpace @@ -58,6 +58,7 @@ theorem mem_canonicalCell_iff /-- The **one-sided (lower) canonical-cell graph**: parameter–subbody pairs `(z, D)` where the subbody `D` is contained in the canonical power cell of site `i` at `z`. -/ +@[expose] def CanonicalCellLowerGraph (sites : SiteFamily X n) (hA : 0 < A) (hn : 0 < n) (i : Fin n) : diff --git a/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/CellAreaContinuity.lean b/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/CellAreaContinuity.lean index 22cbf30ec6..5366cc1c26 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/CellAreaContinuity.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/CellAreaContinuity.lean @@ -25,7 +25,7 @@ dominating function. `sites : C(X, Config n)`, needing only continuity of `X`, not compactness. -/ -@[expose] public section +public section open MeasureTheory Filter Topology open NRR NRR.Geometry NRR.Geometry.ConvexBody diff --git a/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/Children.lean b/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/Children.lean index 77c0ae27c9..3b01a0bdbd 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/Children.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/Children.lean @@ -25,7 +25,7 @@ as a genuine element of the lower-area hyperspace `BodySpace K (A / (n : ℝ))`. a direct composition through the solid bridge `BodySpace.toGeometryConvexBody`. -/ -@[expose] public section +public section open NRR NRR.Geometry NRR.Geometry.ConvexBody open Filter Topology @@ -46,6 +46,7 @@ theorem child_lower_bound_pos (hA : 0 < A) (hn : 0 < n) : an element of the lower-area hyperspace `BodySpace K (A / (n : ℝ))`. The lower-area condition follows from `A ≤ z.1.body.area`, `0 < n`, and `canonicalCell.area = z.1.body.area / n`. -/ +@[expose] noncomputable def child (z : BodySpace K A × X) (i : Fin n) : BodySpace K (A / (n : ℝ)) := diff --git a/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/ClosedGraph.lean b/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/ClosedGraph.lean index 4d9a367965..95cdf1e546 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/ClosedGraph.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/ClosedGraph.lean @@ -27,7 +27,7 @@ The compactness of both the domain and the codomain is essential: the closed-gra for continuity without it. -/ -@[expose] public section +public section namespace NRR.EMP.VariableBody diff --git a/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/CompactSiteFamily.lean b/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/CompactSiteFamily.lean index 0265739d52..70fd62089a 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/CompactSiteFamily.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/CompactSiteFamily.lean @@ -21,7 +21,7 @@ variable-body power partition: they let one work inside a fixed ball and with a independently of the parameter. -/ -@[expose] public section +public section open NRR NRR.Geometry diff --git a/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/EqualAreaRelation.lean b/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/EqualAreaRelation.lean index 23c2f1dd6c..f89d480132 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/EqualAreaRelation.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/EqualAreaRelation.lean @@ -23,7 +23,7 @@ site family yields the closed normalized-weight graph over any topological param site family. -/ -@[expose] public section +public section open NRR NRR.Geometry NRR.Geometry.ConvexBody @@ -97,7 +97,7 @@ theorem isClosed_isNormalizedEqualAreaWeight /-- The **normalized-weight graph** over a topological parameter space `X` carrying a continuous site family `sites : C(X, Config n)`: the set of pairs `((C, x), w)` for which `w` is a normalized equal-area weight for the sites `sites x` inside the variable body `C`. -/ -def NormalizedWeightGraph +@[expose] def NormalizedWeightGraph {X : Type*} [TopologicalSpace X] (sites : C(X, Config n)) (hA : 0 < A) : Set ((BodySpace K A × X) × (Fin n → ℝ)) := diff --git a/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/HalfspaceCoefficients.lean b/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/HalfspaceCoefficients.lean index fc029d0b12..dff623525c 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/HalfspaceCoefficients.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/HalfspaceCoefficients.lean @@ -31,7 +31,7 @@ intersected with the intersection of these halfspaces, both over all `j` and ove later indicator-convergence arguments apply the subbody membership-stability theorem directly. -/ -@[expose] public section +public section open NRR NRR.Geometry NRR.Geometry.ConvexBody open scoped RealInnerProductSpace @@ -42,12 +42,12 @@ variable {K : Geometry.ConvexBody Plane} {A : ℝ} {n : ℕ} (hA : 0 < A) /-- The **separating normal** of the pair `(i, j)` for a configuration `s`, as the fixed-site separating normal `PowerDiagram.sepNormal` evaluated at the sites `s.pts`. -/ -noncomputable def sepNormal (s : Config n) (i j : Fin n) : Plane := +@[expose] noncomputable def sepNormal (s : Config n) (i j : Fin n) : Plane := PowerDiagram.sepNormal s.pts i j /-- The **separating offset** of the pair `(i, j)` for a configuration `s` and weights `w`, as the fixed-site separating offset `PowerDiagram.sepOffset` evaluated at the sites `s.pts`. -/ -noncomputable def sepOffset (s : Config n) (w : Fin n → ℝ) (i j : Fin n) : ℝ := +@[expose] noncomputable def sepOffset (s : Config n) (w : Fin n → ℝ) (i j : Fin n) : ℝ := PowerDiagram.sepOffset s.pts w i j /-- The separating normal varies continuously with the configuration. -/ diff --git a/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/IndicatorStability.lean b/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/IndicatorStability.lean index 097daf02bc..43e62753a6 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/IndicatorStability.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/IndicatorStability.lean @@ -39,7 +39,7 @@ This module uses no compactness of `Config n` and no continuity of the normalize input to area continuity, not the reverse. -/ -@[expose] public section +public section open MeasureTheory Filter Topology open NRR NRR.Geometry NRR.Geometry.ConvexBody diff --git a/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/NormalizedWeightContinuity.lean b/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/NormalizedWeightContinuity.lean index 5b20985125..f3468a71db 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/NormalizedWeightContinuity.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/NormalizedWeightContinuity.lean @@ -35,7 +35,7 @@ continuity core. * `continuous_areaVec_normalizedWeight_compactFamily` — continuity of the selected area vector. -/ -@[expose] public section +public section open NRR NRR.Geometry NRR.Geometry.ConvexBody @@ -46,7 +46,7 @@ variable {K : Geometry.ConvexBody Plane} {A : ℝ} /-- The **boxed selected weight**: the canonical normalized equal-area weight, packaged with its uniform coordinate bound as an element of the compact weight box. -/ -noncomputable def normalizedWeightBox +@[expose] noncomputable def normalizedWeightBox (sites : SiteFamily X n) (hA : 0 < A) (hn : 0 < n) (z : BodySpace K A × X) : WeightBox n (weightBound K sites) := diff --git a/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/Partition.lean b/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/Partition.lean index dd991c58e3..15e7154921 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/Partition.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/Partition.lean @@ -31,7 +31,7 @@ dependent `partition` field is *not* asserted to be continuous, and no topology as consumed by the prime-refinement layer. -/ -@[expose] public section +public section open NRR NRR.Geometry NRR.Geometry.ConvexBody MeasureTheory @@ -45,6 +45,7 @@ omit [CompactSpace X] /-- The **canonical equal-area power partition** of the variable solid body `solidBody hA z.1`, computed with the site configuration `sites z.2`. A thin wrapper around `EMP.powerPartition`. -/ +@[expose] noncomputable def partition (z : BodySpace K A × X) : ConvexPartition (solidBody hA z.1) n := @@ -125,6 +126,7 @@ structure Witness /-- The **canonical partition witness** at `z`, built from the existing variable-body partition and its canonical children. No partition proof is duplicated: every field reuses the corresponding `partition_*` fact. -/ +@[expose] noncomputable def witness (z : BodySpace K A × X) : Witness sites hA hn z where diff --git a/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/Phase1Interface.lean b/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/Phase1Interface.lean index 08815cdcc5..87b6ecffd1 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/Phase1Interface.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/Phase1Interface.lean @@ -35,7 +35,7 @@ Continuity results are stated over a compact metric parameter space `X` carrying family `sites : C(X, Config n)`. The configuration space `Config n` itself is not assumed compact. -/ -@[expose] public section +public section open MeasureTheory Filter Topology diff --git a/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/WeightBounds.lean b/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/WeightBounds.lean index eb289119ec..0ab605e9af 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/WeightBounds.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/WeightBounds.lean @@ -33,7 +33,7 @@ coordinate bound follows from normalization `∑ j, w j = 0` and the triangle in sum `(n : ℝ) * w i = ∑ j, (w i - w j)`. -/ -@[expose] public section +public section open NRR NRR.Geometry NRR.PowerDiagram diff --git a/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/WeightBox.lean b/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/WeightBox.lean index ba3fb995b7..8b334ec1dd 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/WeightBox.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/EMP/VariableBody/WeightBox.lean @@ -29,7 +29,7 @@ This compact box is the intended codomain for the equal-area weight selection, w together with uniqueness will yield continuity of the selection. -/ -@[expose] public section +public section namespace NRR.EMP.VariableBody @@ -63,6 +63,7 @@ noncomputable instance instCompactSpace : CompactSpace (WeightBox n M) := isCompact_iff_compactSpace.mp isCompact_setOf /-- The coordinate projection of the weight box as a bundled continuous map. -/ +@[expose] def valContinuous (n : ℕ) (M : ℝ) : C(WeightBox n M, Fin n → ℝ) := ⟨fun w => (w : Fin n → ℝ), continuous_subtype_val⟩ diff --git a/LeanPool/NandakumarRamanaRao/NRR/EMP/WeightShift.lean b/LeanPool/NandakumarRamanaRao/NRR/EMP/WeightShift.lean index b51ca1e54f..7c5cf284b2 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/EMP/WeightShift.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/EMP/WeightShift.lean @@ -36,7 +36,7 @@ No equal‑area existence, no normalization, and no variation of sites is used: are held fixed throughout and every result is a pure algebraic cancellation of the constant. -/ -@[expose] public section +public section open NRR NRR.Geometry NRR.PowerDiagram @@ -47,7 +47,7 @@ variable {n : ℕ} namespace EMP /-- **Constant shift of a weight vector**: add the fixed constant `c` to every weight. -/ -def addConstWeight (w : Fin n → ℝ) (c : ℝ) : Fin n → ℝ := +@[expose] def addConstWeight (w : Fin n → ℝ) (c : ℝ) : Fin n → ℝ := fun i => w i + c @[simp] theorem addConstWeight_apply (w : Fin n → ℝ) (c : ℝ) (i : Fin n) : diff --git a/LeanPool/NandakumarRamanaRao/NRR/EMP/WeightSpace.lean b/LeanPool/NandakumarRamanaRao/NRR/EMP/WeightSpace.lean index f259add55a..e2b42e167c 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/EMP/WeightSpace.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/EMP/WeightSpace.lean @@ -39,7 +39,7 @@ the vocabulary used to pin down the additive‑constant freedom in equal‑area This file must not depend on optimal transport; it imports only `Mathlib`. -/ -@[expose] public section +public section namespace NRR @@ -48,21 +48,21 @@ variable {n : ℕ} namespace EMP /-- **Weight sum.** The total `∑ i, w i` of a weight vector. -/ -noncomputable def weightSum (w : Fin n → ℝ) : ℝ := +@[expose] noncomputable def weightSum (w : Fin n → ℝ) : ℝ := ∑ i, w i /-- **Normalized weights.** The affine normalization `∑ i, w i = 0`, used to remove the additive‑constant freedom in the weights. -/ -def WeightNormalized (w : Fin n → ℝ) : Prop := +@[expose] def WeightNormalized (w : Fin n → ℝ) : Prop := EMP.weightSum w = 0 /-- **Weight mean.** The arithmetic mean `(∑ i, w i) / n` of a weight vector. -/ -noncomputable def weightMean (w : Fin n → ℝ) : ℝ := +@[expose] noncomputable def weightMean (w : Fin n → ℝ) : ℝ := EMP.weightSum w / n /-- **Mean‑subtraction normalization.** Subtract the mean from every weight, producing a zero‑sum weight vector. -/ -noncomputable def normalizeWeight (w : Fin n → ℝ) : Fin n → ℝ := +@[expose] noncomputable def normalizeWeight (w : Fin n → ℝ) : Fin n → ℝ := fun i => w i - EMP.weightMean w @[simp] theorem normalizeWeight_apply (w : Fin n → ℝ) (i : Fin n) : diff --git a/LeanPool/NandakumarRamanaRao/NRR/FairPartition.lean b/LeanPool/NandakumarRamanaRao/NRR/FairPartition.lean index eb6859b1fe..443a77a0a6 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/FairPartition.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/FairPartition.lean @@ -10,4 +10,4 @@ public import LeanPool.NandakumarRamanaRao.NRR.FairPartition.Predicates /-! Supporting modules for Equal-area and equal-perimeter convex partitions. -/ -@[expose] public section +public section diff --git a/LeanPool/NandakumarRamanaRao/NRR/FairPartition/Predicates.lean b/LeanPool/NandakumarRamanaRao/NRR/FairPartition/Predicates.lean index 512cf0f061..2aff2707b2 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/FairPartition/Predicates.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/FairPartition/Predicates.lean @@ -34,7 +34,7 @@ No new partition structure is introduced and `ConvexPartition` is not redefined. * `ConvexPartition.IsFair.mk'` — build `IsFair` from the two components. -/ -@[expose] public section +public section namespace NRR @@ -43,6 +43,7 @@ namespace ConvexPartition variable {K : Body} {n : ℕ} /-- A **fair** partition: all pieces have equal area and all pieces have equal perimeter. -/ +@[expose] def IsFair (P : ConvexPartition K n) : Prop := P.IsEqualArea ∧ P.HasEqualPerimeter diff --git a/LeanPool/NandakumarRamanaRao/NRR/Geometry.lean b/LeanPool/NandakumarRamanaRao/NRR/Geometry.lean index b1a36a024d..658c149d9d 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Geometry.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Geometry.lean @@ -11,4 +11,4 @@ public import LeanPool.NandakumarRamanaRao.NRR.Geometry.HalfspaceFiniteIntersect /-! Supporting modules for Equal-area and equal-perimeter convex partitions. -/ -@[expose] public section +public section diff --git a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody.lean b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody.lean index 47485d4f22..680f367801 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody.lean @@ -31,4 +31,4 @@ public import LeanPool.NandakumarRamanaRao.NRR.Geometry.ConvexBody.WidthIdentiti /-! Supporting modules for Equal-area and equal-perimeter convex partitions. -/ -@[expose] public section +public section diff --git a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/AffineOps.lean b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/AffineOps.lean index cb0b2bff00..070776f964 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/AffineOps.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/AffineOps.lean @@ -44,7 +44,7 @@ Following the library-wide policy, `Basic.lean` already pulls in `import Mathlib imports are required here. -/ -@[expose] public section +public section namespace NRR.Geometry @@ -56,6 +56,7 @@ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] /-- The translate of a convex body by a vector `v`, as a convex body with carrier `(fun x => v + x) '' K`. Translation is a homeomorphism, so solidity is preserved. -/ +@[expose] def translate (K : ConvexBody E) (v : E) : ConvexBody E where carrier := (fun x => v + x) '' (K : Set E) convex' := K.convex.translate v @@ -96,6 +97,7 @@ theorem translate_translate (K : ConvexBody E) (v w : E) : /-- The positive scaling of a convex body by `r > 0`, as a convex body with carrier `(fun x => r • x) '' K`. Scaling by a nonzero scalar is a homeomorphism, so solidity is preserved. -/ +@[expose] def scalePos (K : ConvexBody E) (r : ℝ) (hr : 0 < r) : ConvexBody E where carrier := (fun x => r • x) '' (K : Set E) convex' := by diff --git a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/Basic.lean b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/Basic.lean index 86deb3432c..76d3b65fd7 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/Basic.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/Basic.lean @@ -59,7 +59,7 @@ uses the whole-library `import Mathlib`. The concrete dependencies are lightweig (`Convex`, `IsCompact`, `interior`, `Set` membership/extensionality). -/ -@[expose] public section +public section namespace NRR.Geometry diff --git a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/HalfspaceCut.lean b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/HalfspaceCut.lean index 3ef1c9e4ad..ee0e4d8f8a 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/HalfspaceCut.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/HalfspaceCut.lean @@ -56,7 +56,7 @@ Following the library-wide policy, `Basic.lean` already pulls in `import Mathlib imports are required here. -/ -@[expose] public section +public section namespace NRR.Geometry @@ -65,11 +65,11 @@ variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] /-! ### Closed halfspaces -/ /-- The closed **lower** halfspace with normal `u` and threshold `t`: `{x | inner ℝ u x ≤ t}`. -/ -def lowerClosedHalfspace (u : E) (t : ℝ) : Set E := +@[expose] def lowerClosedHalfspace (u : E) (t : ℝ) : Set E := {x | inner ℝ u x ≤ t} /-- The closed **upper** halfspace with normal `u` and threshold `t`: `{x | t ≤ inner ℝ u x}`. -/ -def upperClosedHalfspace (u : E) (t : ℝ) : Set E := +@[expose] def upperClosedHalfspace (u : E) (t : ℝ) : Set E := {x | t ≤ inner ℝ u x} @[simp] theorem mem_lowerClosedHalfspace (u : E) (t : ℝ) (x : E) : @@ -127,6 +127,7 @@ theorem inter_upperClosedHalfspace_isCompact /-- The cut of a convex body `K` by the closed lower halfspace `{x | inner ℝ u x ≤ t}`, as a `ConvexBody`. Solidity is **not** automatic, so the nonempty-interior hypothesis `hInt` is required explicitly. -/ +@[expose] def cutLowerClosed (K : ConvexBody E) (u : E) (t : ℝ) (hInt : (interior ((K : Set E) ∩ lowerClosedHalfspace u t)).Nonempty) : @@ -139,6 +140,7 @@ def cutLowerClosed /-- The cut of a convex body `K` by the closed upper halfspace `{x | t ≤ inner ℝ u x}`, as a `ConvexBody`. Solidity is **not** automatic, so the nonempty-interior hypothesis `hInt` is required explicitly. -/ +@[expose] def cutUpperClosed (K : ConvexBody E) (u : E) (t : ℝ) (hInt : (interior ((K : Set E) ∩ upperClosedHalfspace u t)).Nonempty) : diff --git a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/Interior.lean b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/Interior.lean index b52f63048f..212e5fc3b9 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/Interior.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/Interior.lean @@ -31,7 +31,7 @@ imports are required here; the metric lemmas used (`mem_interior_iff_mem_nhds`, `interior_mono`) are all available transitively. -/ -@[expose] public section +public section namespace NRR.Geometry diff --git a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/LinearImage.lean b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/LinearImage.lean index df0ff38c7d..a81dc350bd 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/LinearImage.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/LinearImage.lean @@ -50,7 +50,7 @@ Following the library-wide policy, `Basic.lean` already pulls in `import Mathlib imports are required here. -/ -@[expose] public section +public section namespace NRR.Geometry @@ -72,6 +72,7 @@ theorem continuousLinearEquiv_image_interior (e : E ≃L[ℝ] F) (s : Set E) : /-- The image of a convex body under a continuous linear equivalence, as a convex body with carrier `e '' K`. Solidity is preserved because a continuous linear equivalence is a homeomorphism. -/ +@[expose] def imageLinearEquiv (K : ConvexBody E) (e : E ≃L[ℝ] F) : ConvexBody F where carrier := e '' (K : Set E) convex' := K.convex.linear_image (e : E →ₗ[ℝ] F) diff --git a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/PlanarCircle.lean b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/PlanarCircle.lean index 896e033d8c..834879381d 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/PlanarCircle.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/PlanarCircle.lean @@ -40,7 +40,7 @@ unit-sphere subtype), we parameterize directions by the interval `[0, 2π]` via The width-function continuity API and interval-integrability lemmas are imported directly. -/ -@[expose] public section +public section namespace NRR.Geometry @@ -52,7 +52,7 @@ abbrev Plane := EuclideanSpace ℝ (Fin 2) /-- The angle parameterization of the unit circle: `circleVec θ = (cos θ, sin θ)` as a point of the Euclidean plane. -/ -noncomputable def circleVec (θ : ℝ) : Plane := !₂[Real.cos θ, Real.sin θ] +@[expose] noncomputable def circleVec (θ : ℝ) : Plane := !₂[Real.cos θ, Real.sin θ] /-- First coordinate of `circleVec θ` is `cos θ`. -/ @[simp] theorem circleVec_zero_coord (θ : ℝ) : diff --git a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/PlanarPerimeter.lean b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/PlanarPerimeter.lean index 0e98caa84c..8267f6584e 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/PlanarPerimeter.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/PlanarPerimeter.lean @@ -44,7 +44,7 @@ Only `PlanarCircle.lean` is imported; it transitively provides all of Mathlib to `circleVec` and width-function APIs. No extra imports are required. -/ -@[expose] public section +public section namespace NRR.Geometry @@ -53,6 +53,7 @@ open Real MeasureTheory ConvexBody /-- The **planar perimeter** of a convex body `K`, defined by Cauchy's width formula as the normalized interval integral of the width function along the angle parameterization `circleVec` over `[0, 2π]`. -/ +@[expose] noncomputable def planarPerimeter (K : ConvexBody Plane) : ℝ := (1 / 2 : ℝ) * ∫ θ in 0..(2 * Real.pi), widthFunction K (circleVec θ) diff --git a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/PlanarPerimeterBasic.lean b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/PlanarPerimeterBasic.lean index d89d4a2c47..58e8069a8a 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/PlanarPerimeterBasic.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/PlanarPerimeterBasic.lean @@ -28,7 +28,7 @@ Only `PlanarPerimeter.lean` is imported; it transitively provides all of Mathlib the `planarPerimeter`, `widthFunction`, and `circleVec` APIs. No extra imports are required. -/ -@[expose] public section +public section namespace NRR.Geometry diff --git a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/PlanarPerimeterContinuity.lean b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/PlanarPerimeterContinuity.lean index 2170cc8c31..55deb33a83 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/PlanarPerimeterContinuity.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/PlanarPerimeterContinuity.lean @@ -58,7 +58,7 @@ reparameterisation `(a, θ) ↦ (a, circleVec θ)`), and holds for constant fami pull in `import Mathlib`, so no extra imports are required. -/ -@[expose] public section +public section namespace NRR.Geometry diff --git a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/PlanarPerimeterMonotonicity.lean b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/PlanarPerimeterMonotonicity.lean index 1c776ba586..8730299939 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/PlanarPerimeterMonotonicity.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/PlanarPerimeterMonotonicity.lean @@ -34,7 +34,7 @@ Only `PlanarPerimeter.lean` and `Width.lean` are imported; they transitively pro Mathlib together with the perimeter and width APIs. No extra imports are required. -/ -@[expose] public section +public section namespace NRR.Geometry diff --git a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/PlanarPerimeterTransform.lean b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/PlanarPerimeterTransform.lean index 4ed4ef4802..3ab8d9d117 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/PlanarPerimeterTransform.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/PlanarPerimeterTransform.lean @@ -46,7 +46,7 @@ all of Mathlib together with the perimeter, width and support-function APIs. No required. -/ -@[expose] public section +public section namespace NRR.Geometry diff --git a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/PositiveAreaInterior.lean b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/PositiveAreaInterior.lean index 8612882006..7fa5b1f742 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/PositiveAreaInterior.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/PositiveAreaInterior.lean @@ -27,7 +27,7 @@ is not actually needed for the proof (only convexity and finite-dimensionality of the plane are used). -/ -@[expose] public section +public section open scoped RealInnerProductSpace open MeasureTheory diff --git a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/SupportFunction.lean b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/SupportFunction.lean index fe842a2153..c6cd165672 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/SupportFunction.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/SupportFunction.lean @@ -45,7 +45,7 @@ imports are required here. The decisive Mathlib results used are `IsCompact.exis `IsGreatest.csSup_eq`, `le_csSup`, `csSup_le`, and continuity of the inner product. -/ -@[expose] public section +public section namespace NRR.Geometry @@ -56,6 +56,7 @@ variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] /-- The **support function** of a convex body `K` in direction `u`: `h_K(u) = sup { ⟪x, u⟫ | x ∈ K }`. For compact nonempty `K` the supremum is finite and attained (see `exists_supportPoint`). -/ +@[expose] noncomputable def supportFunction (K : ConvexBody E) (u : E) : ℝ := sSup ((fun x : E => (inner ℝ x u : ℝ)) '' (K : Set E)) diff --git a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/SupportFunctionBasic.lean b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/SupportFunctionBasic.lean index d74dcd092e..fcf8d6e772 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/SupportFunctionBasic.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/SupportFunctionBasic.lean @@ -46,7 +46,7 @@ domain and codomain to be complete (so that the adjoint exists); this is automat dimensions. -/ -@[expose] public section +public section namespace NRR.Geometry diff --git a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/SupportFunctionContinuity.lean b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/SupportFunctionContinuity.lean index 3014cf5cf2..9297994b82 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/SupportFunctionContinuity.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/SupportFunctionContinuity.lean @@ -36,7 +36,7 @@ so the map is `R`-Lipschitz. This is more robust than a compact-maximum-with-par and yields the strongest downstream API. -/ -@[expose] public section +public section namespace NRR.Geometry diff --git a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/SupportFunctionParametric.lean b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/SupportFunctionParametric.lean index 4e1835d171..d2f07461da 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/SupportFunctionParametric.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/SupportFunctionParametric.lean @@ -62,7 +62,7 @@ We therefore take the two-pronged approach the design allows: * `supportFunction_continuous_family_on_unit_directions` -/ -@[expose] public section +public section namespace NRR.Geometry @@ -124,7 +124,7 @@ variable {α : Type*} [TopologicalSpace α] /-- A family of convex bodies `K : α → ConvexBody E` is a *support-function continuous family* if the map `(t, u) ↦ h_{K_t}(u)` is (jointly) continuous. This is the abstraction downstream perimeter / partition-cell continuity arguments consume. -/ -def SupportFunctionContinuousFamily (K : α → ConvexBody E) : Prop := +@[expose] def SupportFunctionContinuousFamily (K : α → ConvexBody E) : Prop := Continuous fun p : α × E => supportFunction (K p.1) p.2 /-- **Evaluation.** Unfolding the predicate: joint continuity of `(t, u) ↦ h_{K_t}(u)`. -/ diff --git a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/SupportFunctionTransform.lean b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/SupportFunctionTransform.lean index 8b2a65e3c5..3c4c2b777e 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/SupportFunctionTransform.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/SupportFunctionTransform.lean @@ -61,7 +61,7 @@ Only `SupportFunctionBasic` is imported; it transitively provides the whole `Con support-function, `AffineOps` and `LinearImage` API (and, through `Basic`, `import Mathlib`). -/ -@[expose] public section +public section namespace NRR.Geometry @@ -92,6 +92,7 @@ theorem supportFunction_scalePos_body /-- The **reflection** `-K` of a convex body through the origin, as a convex body with carrier `(-·) '' K = -K`. Implemented as the image under the negation linear isometry equivalence, so solidity is preserved. -/ +@[expose] def neg (K : ConvexBody E) : ConvexBody E where carrier := Neg.neg '' (K : Set E) convex' := by @@ -140,6 +141,7 @@ theorem mem_neg (K : ConvexBody E) (x : E) : /-- The image of a convex body under a **linear isometry equivalence** `e : E ≃ₗᵢ[ℝ] F`, as a convex body with carrier `e '' K`. Implemented as the image under the underlying continuous linear equivalence `e.toContinuousLinearEquiv`. -/ +@[expose] def imageLinearIsometryEquiv (K : ConvexBody E) (e : E ≃ₗᵢ[ℝ] F) : ConvexBody F := K.imageLinearEquiv e.toContinuousLinearEquiv diff --git a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/Topology.lean b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/Topology.lean index e21bfecb1b..df6b8e6488 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/Topology.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/Topology.lean @@ -28,7 +28,7 @@ imports are required here; the topological lemmas used `interior_subset`) are all available transitively. -/ -@[expose] public section +public section namespace NRR.Geometry diff --git a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/Width.lean b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/Width.lean index 4f89fcf99d..1619bc0b14 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/Width.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/Width.lean @@ -39,7 +39,7 @@ normals `u` and `-u`, scaled by `‖u‖`). are required here. -/ -@[expose] public section +public section namespace NRR.Geometry @@ -49,6 +49,7 @@ variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] /-- The **width function** of a convex body `K` in direction `u`: `w_K(u) = h_K(u) + h_K(-u)`. Defined for all vectors `u`, not only unit vectors. -/ +@[expose] noncomputable def widthFunction (K : ConvexBody E) (u : E) : ℝ := supportFunction K u + supportFunction K (-u) diff --git a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/WidthContinuity.lean b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/WidthContinuity.lean index ed89b88e14..f49659f660 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/WidthContinuity.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/WidthContinuity.lean @@ -38,7 +38,7 @@ function estimate to `u, v` and to `-u, -v`, and adds; the two `‖·‖` terms `import Mathlib`, so no extra imports are required here. -/ -@[expose] public section +public section namespace NRR.Geometry diff --git a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/WidthFamilies.lean b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/WidthFamilies.lean index dc63c06195..4b5bd0aed2 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/WidthFamilies.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/WidthFamilies.lean @@ -50,7 +50,7 @@ No structure internals or `sSup` are unfolded here. transitively via `Basic.lean`) already pull in `import Mathlib`, so no extra imports are required. -/ -@[expose] public section +public section namespace NRR.Geometry @@ -62,7 +62,7 @@ variable {α : Type*} [TopologicalSpace α] /-- A family of convex bodies `K : α → ConvexBody E` is a *width continuous family* if the map `(t, u) ↦ w_{K_t}(u)` is (jointly) continuous. This is the width-function analogue of `SupportFunctionContinuousFamily`. -/ -def WidthContinuousFamily (K : α → ConvexBody E) : Prop := +@[expose] def WidthContinuousFamily (K : α → ConvexBody E) : Prop := Continuous fun p : α × E => widthFunction (K p.1) p.2 /-- **Evaluation.** Unfolding the predicate: joint continuity of `(t, u) ↦ w_{K_t}(u)`. -/ diff --git a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/WidthIdentities.lean b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/WidthIdentities.lean index 3b95e89dbd..036c37d562 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/WidthIdentities.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Geometry/ConvexBody/WidthIdentities.lean @@ -38,7 +38,7 @@ No structure internals or `sSup` are unfolded here. pull in `import Mathlib`, so no extra imports are required here. -/ -@[expose] public section +public section namespace NRR.Geometry diff --git a/LeanPool/NandakumarRamanaRao/NRR/Geometry/HalfspaceFiniteIntersectionAreaContinuity.lean b/LeanPool/NandakumarRamanaRao/NRR/Geometry/HalfspaceFiniteIntersectionAreaContinuity.lean index 9f7fca1dff..3e96af90c7 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Geometry/HalfspaceFiniteIntersectionAreaContinuity.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Geometry/HalfspaceFiniteIntersectionAreaContinuity.lean @@ -56,7 +56,7 @@ Continuity for an arbitrary topological domain `α` is then obtained by composin continuous offset map `c : α → ι → ℝ`, so no first-countability hypothesis on `α` is needed. -/ -@[expose] public section +public section open MeasureTheory open scoped RealInnerProductSpace @@ -67,12 +67,12 @@ variable {ι : Type*} /-- The intersection of a convex body `K` with the finitely many closed lower halfspaces with normals `u i` and offsets `c i`. Kept purely as a `Set Plane`. -/ -def finiteHalfspaceIntersection +@[expose] def finiteHalfspaceIntersection (K : ConvexBody Plane) (u : ι → Plane) (c : ι → ℝ) : Set Plane := (K : Set Plane) ∩ ⋂ i, Geometry.lowerClosedHalfspace (u i) (c i) /-- The real-valued Lebesgue area of a finite fixed-normal halfspace intersection. -/ -noncomputable def finiteHalfspaceIntersectionArea +@[expose] noncomputable def finiteHalfspaceIntersectionArea (K : ConvexBody Plane) (u : ι → Plane) (c : ι → ℝ) : ℝ := (volume (finiteHalfspaceIntersection K u c)).toReal diff --git a/LeanPool/NandakumarRamanaRao/NRR/HalfSpace.lean b/LeanPool/NandakumarRamanaRao/NRR/HalfSpace.lean index 67ae1678c7..ce931bade7 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/HalfSpace.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/HalfSpace.lean @@ -19,7 +19,7 @@ Provides the set-theoretic lower and upper halfspaces used throughout the cut an layers. Measure-theoretic and continuity results live in the dedicated halfspace-cut modules. -/ -@[expose] public section +public section open NRR open scoped RealInnerProductSpace @@ -29,7 +29,7 @@ namespace NRR.Halfspace /-- The public closed half‑space with inner normal `u` and offset `c`, defined as a direct wrapper around the implemented geometry half‑space `Geometry.lowerClosedHalfspace u c`, i.e. `{x : E2 | ⟪u, x⟫ ≤ c}`. (`E2` is a definitional alias of `Geometry.Plane`.) -/ -def of (u : E2) (c : ℝ) : Set E2 := +@[expose] def of (u : E2) (c : ℝ) : Set E2 := Geometry.lowerClosedHalfspace u c @[simp] theorem of_eq_lowerClosedHalfspace (u : E2) (c : ℝ) : @@ -95,7 +95,7 @@ a compact convex set; when it retains nonempty interior it is again a (solid) co This bundles the intersection as a `ConvexBody`, requiring the nonempty‑interior hypothesis `hInt` explicitly (solidity is not automatic). It is a thin wrapper around the geometry primitive `ConvexBody.cutLowerClosed`. -/ -noncomputable def interHalfspace +@[expose] noncomputable def interHalfspace (K : ConvexBody Plane) (u : Plane) (c : ℝ) (hInt : (interior ((K : Set Plane) ∩ NRR.Halfspace.of u c)).Nonempty) : ConvexBody Plane := diff --git a/LeanPool/NandakumarRamanaRao/NRR/HalfSpaceCutArea.lean b/LeanPool/NandakumarRamanaRao/NRR/HalfSpaceCutArea.lean index cf785c0a25..a578f0aa06 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/HalfSpaceCutArea.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/HalfSpaceCutArea.lean @@ -19,7 +19,7 @@ Defines lower and upper halfspace-cut areas for a planar convex body and proves monotonicity and endpoint properties. The compatibility name `cutArea` denotes the lower cut area. -/ -@[expose] public section +public section open MeasureTheory open scoped RealInnerProductSpace @@ -27,12 +27,12 @@ open scoped RealInnerProductSpace namespace NRR.Geometry.ConvexBody /-- **Lower cut area**: the real-valued Lebesgue measure of `K ∩ {x | ⟪u, x⟫ ≤ c}`. -/ -noncomputable def cutAreaLower +@[expose] noncomputable def cutAreaLower (K : ConvexBody Plane) (u : Plane) (c : ℝ) : ℝ := (volume ((K : Set Plane) ∩ Geometry.lowerClosedHalfspace u c)).toReal /-- **Upper cut area**: the real-valued Lebesgue measure of `K ∩ {x | c ≤ ⟪u, x⟫}`. -/ -noncomputable def cutAreaUpper +@[expose] noncomputable def cutAreaUpper (K : ConvexBody Plane) (u : Plane) (c : ℝ) : ℝ := (volume ((K : Set Plane) ∩ Geometry.upperClosedHalfspace u c)).toReal diff --git a/LeanPool/NandakumarRamanaRao/NRR/HalfSpaceCutAreaContinuity.lean b/LeanPool/NandakumarRamanaRao/NRR/HalfSpaceCutAreaContinuity.lean index eadde294b2..5e97850d13 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/HalfSpaceCutAreaContinuity.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/HalfSpaceCutAreaContinuity.lean @@ -44,7 +44,7 @@ and continuity in `c` follows from `MeasureTheory.continuousAt_of_dominated`: slice `{x ∈ K | ⟪u, x⟫ = c₀}`, which is null by `lowerCut_boundary_null` (needs `u ≠ 0`). -/ -@[expose] public section +public section open MeasureTheory open scoped RealInnerProductSpace diff --git a/LeanPool/NandakumarRamanaRao/NRR/Multivalued.lean b/LeanPool/NandakumarRamanaRao/NRR/Multivalued.lean index c92502c6d2..d03e219488 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Multivalued.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Multivalued.lean @@ -39,4 +39,4 @@ meets the carrier. Over a nonempty metric base, signed distance converts such a continuous pullback. -/ -@[expose] public section +public section diff --git a/LeanPool/NandakumarRamanaRao/NRR/Multivalued/ChildEvaluation.lean b/LeanPool/NandakumarRamanaRao/NRR/Multivalued/ChildEvaluation.lean index ec75c59437..1284b40675 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Multivalued/ChildEvaluation.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Multivalued/ChildEvaluation.lean @@ -29,7 +29,7 @@ The output is kept in `Fin n → ℝ`; no projection to a zero-sum representatio and no common zero, equivariance, or obstruction result is assumed. -/ -@[expose] public section +public section open NRR.Geometry @@ -43,6 +43,7 @@ variable {X : Type*} [MetricSpace X] [CompactSpace X] /-- The **child evaluation** of a nice multivalued function `φ` at parameter `z = ((C, x), t)` and site index `i`: evaluate `φ` at the canonical child `child sites hA hn (C, x) i` and the signed interval coordinate `t`. -/ +@[expose] noncomputable def childEval (sites : EMP.VariableBody.SiteFamily X n) (hA : 0 < A) (hn : 0 < n) diff --git a/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Nice.lean b/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Nice.lean index b022915d92..847c04a1b4 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Nice.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Nice.lean @@ -21,7 +21,7 @@ provides the evaluation projection, its continuity, extensionality reducing equa equality, the endpoint sign lemmas, and a constructor from an unbundled continuous function. -/ -@[expose] public section +public section namespace NRR @@ -41,6 +41,7 @@ structure NiceMV (X : Type*) [TopologicalSpace X] where namespace NiceMV /-- Evaluate a nice multivalued function at a base point and a signed-interval coordinate. -/ +@[expose] def eval (φ : NiceMV X) (x : X) (y : SignedInterval) : ℝ := φ.evalMap (x, y) @@ -91,6 +92,7 @@ theorem eval_right_pos /-- Build a nice multivalued function from an unbundled continuous function with the required strict endpoint signs. -/ +@[expose] def ofFunction (f : X → SignedInterval → ℝ) (hf : Continuous fun z : X × SignedInterval => f z.1 z.2) diff --git a/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Operations.lean b/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Operations.lean index c7a17130c6..a6fdbf245b 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Operations.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Operations.lean @@ -26,13 +26,14 @@ and continuity lemmas. Each operation records its evaluation law and the corresp zero-set/zero relation identity. -/ -@[expose] public section +public section namespace NRR namespace SignedInterval /-- Negation on the signed interval: reflection `t ↦ -t` through the center `0`. -/ +@[expose] def neg (t : SignedInterval) : SignedInterval := ⟨-(t : ℝ), by constructor @@ -61,6 +62,7 @@ variable {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] /-- Pull back a nice multivalued function `φ` on `X` along a continuous map `f : Y → X`, giving a nice multivalued function on `Y` evaluated by `(φ.pullback f).eval y t = φ.eval (f y) t`. -/ +@[expose] def pullback (φ : NiceMV X) (f : C(Y, X)) : NiceMV Y := @@ -83,6 +85,7 @@ theorem pullback_zeroSet /-- The canonical nice multivalued function attached to a bounded continuous observable `f` with `|f x| < 1`: it evaluates by `(t : ℝ) - f x`, so its zero set is the graph `t = f x`. -/ +@[expose] def ofObservable (f : C(X, ℝ)) (hbound : ∀ x, |f x| < 1) : @@ -109,6 +112,7 @@ theorem ofObservable_zero_iff /-- Rescale a nice multivalued function by a strictly positive constant `c`; scaling preserves the strict endpoint signs, hence yields a nice multivalued function evaluated by `c * φ.eval x t`. -/ +@[expose] def scale (φ : NiceMV X) (c : ℝ) (hc : 0 < c) : NiceMV X := @@ -131,6 +135,7 @@ theorem scale_zeroSet /-- Reflect a nice multivalued function through interval negation: `reflect` negates both the observable and the interval coordinate. It preserves the zero relation under `SignedInterval.neg`, so it reverses the sign convention without changing the represented zero relation. -/ +@[expose] def reflect (φ : NiceMV X) : NiceMV X := diff --git a/LeanPool/NandakumarRamanaRao/NRR/Multivalued/PerimeterObservable.lean b/LeanPool/NandakumarRamanaRao/NRR/Multivalued/PerimeterObservable.lean index b74fb369d6..e46b9ba49b 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Multivalued/PerimeterObservable.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Multivalued/PerimeterObservable.lean @@ -26,7 +26,7 @@ normalizedPerimeter C`, following the fixed sign convention (negative at `-1`, p zero relation is exactly `(t : ℝ) = normalizedPerimeter C`. -/ -@[expose] public section +public section open NRR.Geometry @@ -37,6 +37,7 @@ variable {K : Geometry.ConvexBody Plane} {A : ℝ} /-- The **normalized perimeter** observable on `BodySpace K A` (`A > 0`): the planar perimeter of the solid bridge divided by the strictly positive constant `1 + K.perimeter`. It is continuous, as the perimeter of the solid bridge is continuous and the denominator is a positive constant. -/ +@[expose] noncomputable def normalizedPerimeter (K : Geometry.ConvexBody Plane) (A : ℝ) (hA : 0 < A) : C(BodySpace K A, ℝ) := @@ -82,6 +83,7 @@ theorem abs_normalizedPerimeter_lt_one /-- The **nice multivalued function representing perimeter** on `BodySpace K A`, obtained from the normalized perimeter observable via the canonical constructor. It evaluates by `(t : ℝ) - normalizedPerimeter C`, so its zero set is the graph `(t : ℝ) = normalizedPerimeter C`. -/ +@[expose] noncomputable def perimeterNiceMV (K : Geometry.ConvexBody Plane) (A : ℝ) (hA : 0 < A) : NiceMV (BodySpace K A) := diff --git a/LeanPool/NandakumarRamanaRao/NRR/Multivalued/PhaseInterfaces.lean b/LeanPool/NandakumarRamanaRao/NRR/Multivalued/PhaseInterfaces.lean index 3234acd252..1c3d3a62e5 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Multivalued/PhaseInterfaces.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Multivalued/PhaseInterfaces.lean @@ -33,4 +33,4 @@ alias is required; downstream separator modules import this file rather than rea individual prerequisite modules. -/ -@[expose] public section +public section diff --git a/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Separator.lean b/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Separator.lean index 098bbd3870..fbf3ce83e2 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Separator.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Separator.lean @@ -16,4 +16,4 @@ public import LeanPool.NandakumarRamanaRao.NRR.Multivalued.Separator.ToNiceMV /-! Supporting modules for Equal-area and equal-perimeter convex partitions. -/ -@[expose] public section +public section diff --git a/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Separator/Basic.lean b/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Separator/Basic.lean index 2ee4f9b667..b740e9325f 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Separator/Basic.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Separator/Basic.lean @@ -25,18 +25,20 @@ that membership in a side excludes membership in the carrier, that a point outsi in exactly one side, and that the two boundaries never meet the carrier. -/ -@[expose] public section +public section namespace NRR /-- The bottom boundary: points of `X × SignedInterval` whose interval coordinate is the left endpoint `-1`. -/ +@[expose] def signedBottom (X : Type*) : Set (X × SignedInterval) := {z | z.2 = SignedInterval.left} /-- The top boundary: points of `X × SignedInterval` whose interval coordinate is the right endpoint `1`. -/ +@[expose] def signedTop (X : Type*) : Set (X × SignedInterval) := {z | z.2 = SignedInterval.right} diff --git a/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Separator/Complement.lean b/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Separator/Complement.lean index 645c66166f..ea0120a4f2 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Separator/Complement.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Separator/Complement.lean @@ -17,7 +17,7 @@ the carrier is obtained independently as the projection of a compact zero set: c closedness, while a cobordism or intersection-number argument supplies the complement data. -/ -@[expose] public section +public section namespace NRR @@ -51,6 +51,7 @@ variable {X : Type*} [TopologicalSpace X] variable {carrier : Set (X × SignedInterval)} /-- Add a closedness proof to complement data, obtaining a top--bottom separator. -/ +@[expose] def toSeparator (D : TopBottomComplement X carrier) (hcarrier : IsClosed carrier) : diff --git a/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Separator/Distance.lean b/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Separator/Distance.lean index cf2bcb8c41..5848cc7f35 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Separator/Distance.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Separator/Distance.lean @@ -21,7 +21,7 @@ All results are stated for a general metric space; no compactness is assumed. Po both closedness and nonemptiness of the set. -/ -@[expose] public section +public section namespace NRR.MetricTools diff --git a/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Separator/Fibers.lean b/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Separator/Fibers.lean index 4b58c3e797..dd0ddf107a 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Separator/Fibers.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Separator/Fibers.lean @@ -22,7 +22,7 @@ the vertical path through any point meets the carrier. Nonemptiness of the carri derived rather than assumed, so no separate nonemptiness field is needed. -/ -@[expose] public section +public section namespace NRR diff --git a/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Separator/ObstructionValue.lean b/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Separator/ObstructionValue.lean index 20874a5fca..183aad5386 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Separator/ObstructionValue.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Separator/ObstructionValue.lean @@ -19,7 +19,7 @@ open regions required by `TopBottomComplement`. This construction avoids any local path-connectedness assumption on the base hyperspace. -/ -@[expose] public section +public section namespace NRR @@ -149,6 +149,7 @@ def toTopBottomComplement : TopBottomComplement X carrier where top_subset_upper := D.top_subset_upper /-- Adding closedness of the carrier gives a top--bottom separator. -/ +@[expose] def toTopBottomSeparator (hcarrier : IsClosed carrier) : TopBottomSeparator X := D.toTopBottomComplement.toSeparator hcarrier diff --git a/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Separator/SignedDistance.lean b/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Separator/SignedDistance.lean index 3ee5609258..04f641f7d0 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Separator/SignedDistance.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Separator/SignedDistance.lean @@ -28,7 +28,7 @@ by the separator structure; these two facts drive the sign laws through the `Met wrappers. -/ -@[expose] public section +public section namespace NRR @@ -154,6 +154,7 @@ theorem continuous_signedDistance (by simpa [S.signedDistance_eq_zero_of_mem hzc] using h_abs) /-- The signed distance packaged as a bundled continuous map. -/ +@[expose] noncomputable def signedDistanceMap (S : TopBottomSeparator X) : C(X × SignedInterval, ℝ) := diff --git a/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Separator/ToNiceMV.lean b/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Separator/ToNiceMV.lean index 2a707d039a..68569ec8c3 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Separator/ToNiceMV.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Multivalued/Separator/ToNiceMV.lean @@ -26,7 +26,7 @@ multivalued function, even though the two signed distances are computed in diffe and need not agree pointwise. -/ -@[expose] public section +public section namespace NRR @@ -38,6 +38,7 @@ variable {X : Type*} [MetricSpace X] [Nonempty X] /-- The nice multivalued function attached to a top–bottom separator: its scalar observable is the signed distance to the carrier, so its zero set is exactly the carrier. -/ +@[expose] noncomputable def toNiceMV (S : TopBottomSeparator X) : NiceMV X where @@ -73,6 +74,7 @@ variable {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] /-- Pull back a top–bottom separator `S` on `X` along a continuous base map `f : Y → X` through the product map `(y, t) ↦ (f y, t)`. Carrier, lower, and upper regions are pulled back by preimage. -/ +@[expose] def pullback (S : TopBottomSeparator X) (f : C(Y, X)) : TopBottomSeparator Y where diff --git a/LeanPool/NandakumarRamanaRao/NRR/Multivalued/SignedInterval.lean b/LeanPool/NandakumarRamanaRao/NRR/Multivalued/SignedInterval.lean index d9eaacee94..2c67096ba9 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Multivalued/SignedInterval.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Multivalued/SignedInterval.lean @@ -21,7 +21,7 @@ This module provides the endpoint elements (`left`, `center`, `right`), the coor `vertical` used to build separator fibers. -/ -@[expose] public section +public section namespace NRR @@ -31,18 +31,22 @@ abbrev SignedInterval := Set.Icc (-1 : ℝ) 1 namespace SignedInterval /-- The left endpoint `-1`, at which a nice multivalued observable is negative. -/ +@[expose] def left : SignedInterval := ⟨-1, by constructor <;> norm_num⟩ /-- The right endpoint `1`, at which a nice multivalued observable is positive. -/ +@[expose] def right : SignedInterval := ⟨1, by constructor <;> norm_num⟩ /-- The center point `0`. -/ +@[expose] def center : SignedInterval := ⟨0, by constructor <;> norm_num⟩ /-- The coordinate projection sending a signed-interval point to its underlying real number. -/ +@[expose] def coord : SignedInterval → ℝ := fun y => y.1 instance : Nonempty SignedInterval := ⟨center⟩ @@ -90,6 +94,7 @@ theorem preconnected_univ : IsPreconnected (Set.univ : Set SignedInterval) := theorem connectedSpace : ConnectedSpace SignedInterval := inferInstance /-- The vertical embedding `y ↦ (x, y)` used to build separator fibers. -/ +@[expose] def vertical (X : Type*) (x : X) : SignedInterval → X × SignedInterval := fun y => (x, y) diff --git a/LeanPool/NandakumarRamanaRao/NRR/Multivalued/ZeroSet.lean b/LeanPool/NandakumarRamanaRao/NRR/Multivalued/ZeroSet.lean index 9718ea8d85..88df1f028c 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Multivalued/ZeroSet.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Multivalued/ZeroSet.lean @@ -22,7 +22,7 @@ and the signed interval is connected, so the continuous image contains `0`. No z introduced; only existence is proved. Zeros never occur at either endpoint, by the strict signs. -/ -@[expose] public section +public section namespace NRR @@ -31,10 +31,12 @@ variable {X : Type*} [TopologicalSpace X] namespace NiceMV /-- A point `(x, y)` is a zero of `φ` when the observable vanishes there. -/ +@[expose] def Zero (φ : NiceMV X) (x : X) (y : SignedInterval) : Prop := φ.eval x y = 0 /-- The total zero set (graph) of `φ` inside `X × SignedInterval`. -/ +@[expose] def zeroSet (φ : NiceMV X) : Set (X × SignedInterval) := {z | φ.Zero z.1 z.2} diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree.lean index 52b6417845..1cfe5668f4 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree.lean @@ -35,4 +35,4 @@ public import LeanPool.NandakumarRamanaRao.NRR.OddSphereDegree.UnconditionalDegr /-! Supporting modules for Equal-area and equal-perimeter convex partitions. -/ -@[expose] public section +public section diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology.lean index c9e5f609b0..782ef66e70 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology.lean @@ -69,4 +69,4 @@ public import LeanPool.NandakumarRamanaRao.NRR.OddSphereDegree.AlgebraicTopology /-! Supporting modules for Equal-area and equal-perimeter convex partitions. -/ -@[expose] public section +public section diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/AffineBarycentricSubdivision.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/AffineBarycentricSubdivision.lean index b47a623ec6..6eb9060117 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/AffineBarycentricSubdivision.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/AffineBarycentricSubdivision.lean @@ -34,7 +34,7 @@ This deliberately does **not** claim the chain-level boundary identity or the subdivision chain homotopy. Those are separate later files. -/ -@[expose] public section +public section open scoped BigOperators open Finset @@ -48,7 +48,7 @@ abbrev Delta (n : ℕ) := ↑(SphereOddDegree.finiteSimplex ℝ (Fin (n + 1))) /-- The `k`-prefix vertex map associated to a permutation of the vertices of `Δ^n`. It sends `0,...,k` into `Fin (n+1)` by the permuted order `π`. -/ -def prefixVertex (n : ℕ) (π : Equiv.Perm (Fin (n + 1))) (k : Fin (n + 1)) : +@[expose] def prefixVertex (n : ℕ) (π : Equiv.Perm (Fin (n + 1))) (k : Fin (n + 1)) : Fin (k.val + 1) → Fin (n + 1) := fun i => π ⟨i.val, by have hi : i.val < k.val + 1 := i.isLt @@ -60,7 +60,7 @@ viewed as a point of the ambient simplex `Δ^n`. This uses Mathlib's existing `SphereOddDegree.FiniteSimplex.barycenter` and `SphereOddDegree.FiniteSimplex.map`, avoiding a hand proof that the coordinates are nonnegative and have total mass `1`. -/ -noncomputable def prefixBarycenter (n : ℕ) (π : Equiv.Perm (Fin (n + 1))) +@[expose] noncomputable def prefixBarycenter (n : ℕ) (π : Equiv.Perm (Fin (n + 1))) (k : Fin (n + 1)) : Delta n := SphereOddDegree.FiniteSimplex.map (S := ℝ) (prefixVertex n π k) (SphereOddDegree.FiniteSimplex.barycenter (X := Fin (k.val + 1)) (𝕜 := ℝ)) @@ -78,7 +78,7 @@ theorem prefixBarycenter_def (n : ℕ) (π : Equiv.Perm (Fin (n + 1))) /-- The coordinate function of the affine map attached to the permutation `π`. It is the convex combination of the prefix barycenters with weights given by `x`. -/ -noncomputable def affineSubdivMapFun (n : ℕ) (π : Equiv.Perm (Fin (n + 1))) +@[expose] noncomputable def affineSubdivMapFun (n : ℕ) (π : Equiv.Perm (Fin (n + 1))) (x : Delta n) : Fin (n + 1) → ℝ := fun j => ∑ k : Fin (n + 1), (x k) * (prefixBarycenter n π k j) @@ -106,6 +106,7 @@ theorem affineSubdivMapFun_sum_eq_one (n : ℕ) (π : Equiv.Perm (Fin (n + 1))) /-- The affine self-map of `Δ^n` associated to a permutation `π`; this is the geometric simplex appearing as one signed summand in barycentric subdivision. -/ +@[expose] noncomputable def affineSubdivMap (n : ℕ) (π : Equiv.Perm (Fin (n + 1))) : Delta n → Delta n := fun x => ⟨affineSubdivMapFun n π x, diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/AffineInternalSwapFace.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/AffineInternalSwapFace.lean index 7a1702c778..2893ff4fcb 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/AffineInternalSwapFace.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/AffineInternalSwapFace.lean @@ -26,7 +26,7 @@ No chain-level boundary statement is asserted here. This is only the affine face identity needed before the sign-cancellation proof. -/ -@[expose] public section +public section open scoped BigOperators open Finset diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/AffineInternalSwapLemmas.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/AffineInternalSwapLemmas.lean index 755bfe8c74..cb85518ed6 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/AffineInternalSwapLemmas.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/AffineInternalSwapLemmas.lean @@ -24,7 +24,7 @@ The proof is deliberately stated in terms of reindexing of the prefix domain; this is the right form for the later face-map proof. -/ -@[expose] public section +public section open scoped BigOperators open Finset diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/AffineLastFaceIdentity.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/AffineLastFaceIdentity.lean index a1f3463edb..2a963b33e0 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/AffineLastFaceIdentity.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/AffineLastFaceIdentity.lean @@ -31,7 +31,7 @@ one instantiates `ι` with the ordinary order-preserving injection missing `π last`, and `ρ` with the induced ordering of the remaining vertices. -/ -@[expose] public section +public section open scoped BigOperators open Finset diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/AlexanderWhitney.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/AlexanderWhitney.lean index 349a4043a4..273e91dbe4 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/AlexanderWhitney.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/AlexanderWhitney.lean @@ -74,7 +74,7 @@ of the diagonal. space (`awPair_naturality`). -/ -@[expose] public section +public section open CategoryTheory MonoidalCategory AlgebraicTopology Simplicial SimplexCategory @@ -85,14 +85,14 @@ namespace SphereOddDegree.AlexanderWhitney /-- The **front `p`-face inclusion** `⦋p⦌ ⟶ ⦋p+q⦌` in `SimplexCategory`, sending vertex `i` to `i` — the inclusion of the initial segment `{0,…,p}` of `{0,…,p+q}`. -/ -def frontFace (p q : ℕ) : (⦋p⦌ : SimplexCategory) ⟶ ⦋p + q⦌ := +@[expose] def frontFace (p q : ℕ) : (⦋p⦌ : SimplexCategory) ⟶ ⦋p + q⦌ := SimplexCategory.mkHom ⟨fun i => Fin.castLE (by lia) i, fun a b h => by simpa [Fin.castLE] using h⟩ /-- The **back `q`-face inclusion** `⦋q⦌ ⟶ ⦋p+q⦌` in `SimplexCategory`, sending vertex `i` to `i + p` — the inclusion of the final segment `{p,…,p+q}` of `{0,…,p+q}`. -/ -def backFace (p q : ℕ) : (⦋q⦌ : SimplexCategory) ⟶ ⦋p + q⦌ := +@[expose] def backFace (p q : ℕ) : (⦋q⦌ : SimplexCategory) ⟶ ⦋p + q⦌ := SimplexCategory.mkHom ⟨fun i => ⟨i.val + p, by have := i.isLt; lia⟩, fun a b h => by simp only [Fin.mk_le_mk]; exact Nat.add_le_add_right h p⟩ @@ -183,14 +183,14 @@ maps yields its front `p`-face and back `q`-face, the two tensor factors of the /-- The **front `p`-face of a singular `(p+q)`-simplex** `σ`, obtained by restricting `σ` along `frontFace p q`. -/ -noncomputable def frontSimplex (X : TopCat.{0}) (p q : ℕ) +@[expose] noncomputable def frontSimplex (X : TopCat.{0}) (p q : ℕ) (σ : (TopCat.toSSet.obj X).obj (Opposite.op (⦋p + q⦌ : SimplexCategory))) : (TopCat.toSSet.obj X).obj (Opposite.op (⦋p⦌ : SimplexCategory)) := (TopCat.toSSet.obj X).map (frontFace p q).op σ /-- The **back `q`-face of a singular `(p+q)`-simplex** `σ`, obtained by restricting `σ` along `backFace p q`. -/ -noncomputable def backSimplex (X : TopCat.{0}) (p q : ℕ) +@[expose] noncomputable def backSimplex (X : TopCat.{0}) (p q : ℕ) (σ : (TopCat.toSSet.obj X).obj (Opposite.op (⦋p + q⦌ : SimplexCategory))) : (TopCat.toSSet.obj X).obj (Opposite.op (⦋q⦌ : SimplexCategory)) := (TopCat.toSSet.obj X).map (backFace p q).op σ diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/AlexanderWhitneyChainMap.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/AlexanderWhitneyChainMap.lean index 61c83b34ae..a9e0a02bea 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/AlexanderWhitneyChainMap.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/AlexanderWhitneyChainMap.lean @@ -49,7 +49,7 @@ degree equality via the cochain degree cast `cochainCast`. * `aw_cochain_leibniz_zmod2` — the Leibniz / chain-map identity over `ZMod 2`. -/ -@[expose] public section +public section open CategoryTheory MonoidalCategory AlgebraicTopology Simplicial SimplexCategory open SphereOddDegree.AlexanderWhitney @@ -61,6 +61,7 @@ namespace SphereOddDegree /-- The free `R`-module simplicial object whose alternating face map complex is the singular chain complex `C_•(Z; R)`. Its value in degree `n` is the coproduct `∐_{σ : n-simplex} R`. -/ +@[expose] noncomputable def singularChainSimplicialModule (R : Type) [CommRing R] (Z : TopCat.{0}) : SimplicialObject (ModuleCat.{0} R) := ((Limits.sigmaConst ⋙ SimplicialObject.whiskering (Type 0) (ModuleCat.{0} R)).obj @@ -101,7 +102,7 @@ theorem singularChainSimplicialModule_δ_generator (R : Type) [CommRing R] (Z : /-- The **cochain coboundary** `δ = d^p : C^p(Z; R) → C^{p+1}(Z; R)`, the differential of the singular cochain complex. By construction it is precomposition with the singular chain boundary. -/ -noncomputable def cochainCoboundary (R : Type) [CommRing R] (Z : TopCat.{0}) (p : ℕ) +@[expose] noncomputable def cochainCoboundary (R : Type) [CommRing R] (Z : TopCat.{0}) (p : ℕ) (φ : singularCochainGroup R Z p) : singularCochainGroup R Z (p + 1) := (((singularCochainComplexFunctor R (ModuleCat.of R R)).obj (Opposite.op Z)).d p (p + 1)).hom φ @@ -146,7 +147,7 @@ theorem cochainCoboundary_eval (R : Type) [CommRing R] (Z : TopCat.{0}) (n : ℕ /-- The **cochain degree cast** transporting a cochain along an equality of degrees `m = m'`. Needed because `(p+1)+q` and `(p+q)+1` are only propositionally equal. -/ -noncomputable def cochainCast {R : Type} [CommRing R] {Z : TopCat.{0}} {m m' : ℕ} +@[expose] noncomputable def cochainCast {R : Type} [CommRing R] {Z : TopCat.{0}} {m m' : ℕ} (h : m = m') (φ : singularCochainGroup R Z m) : singularCochainGroup R Z m' := (eqToHom (by rw [h]) : (((singularChainComplexFunctor (ModuleCat.{0} R)).obj (ModuleCat.of R R)).obj Z).X m' @@ -168,20 +169,21 @@ theorem cochainCast_eval_awCastSimplex (R : Type) [CommRing R] (X : TopCat.{0}) (χ : singularCochainGroup R X (p + 1 + q)) (σ : singularSimplices X (p + q + 1)) : cochainEval (p + q + 1) (cochainCast (aw_degree_left_succ p q) χ) σ = cochainEval (p + 1 + q) χ (awCastSimplex X p q σ) := by - have hgen := singularChainSimplicialModule_map_generator R X (p + 1 + q) (p + q + 1) - ((awCastLeft p q).op) σ - have hmap : ((singularChainSimplicialModule R X).map (awCastLeft p q).op) - = (eqToHom (by rw [aw_degree_left_succ p q]) : - (((singularChainComplexFunctor (ModuleCat.{0} R)).obj (ModuleCat.of R R)).obj X).X (p - + q + 1) ⟶ - (((singularChainComplexFunctor (ModuleCat.{0} R)).obj (ModuleCat.of R R)).obj X).X (p - + 1 + q)) := by - dsimp [awCastLeft] - rw [eqToHom_op, eqToHom_map] + have hcast : ∀ {m m' : ℕ} (h : m = m') + (φ : singularCochainGroup R X m) (τ : singularSimplices X m'), + cochainEval m' (cochainCast h φ) τ = + cochainEval m φ ((TopCat.toSSet.obj X).map + (eqToHom (congrArg SimplexCategory.mk h)).op τ) := by + intro m m' h φ τ + cases h + simp [cochainCast] + have hmap : awCastLeft p q = + eqToHom (congrArg SimplexCategory.mk (aw_degree_left_succ p q)) := by + ext x : 3 + apply Fin.ext + rw [awCastLeft_val, SimplexCategory.eqToHom_toOrderHom] rfl - dsimp [cochainEval, cochainCast, awCastSimplex] - rw [← hmap] - exact congrArg (ModuleCat.Hom.hom χ) hgen + simpa only [awCastSimplex, hmap] using hcast (aw_degree_left_succ p q) χ σ /-- **Evaluation of the right (definitional) degree cast.** Since `p+(q+1)` is definitionally `(p+q)+1`, the `φ ⌣ δψ` cast is the identity. -/ diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/AlexanderWhitneyFaceMaps.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/AlexanderWhitneyFaceMaps.lean index 5e652baecb..160634ad69 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/AlexanderWhitneyFaceMaps.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/AlexanderWhitneyFaceMaps.lean @@ -65,7 +65,7 @@ only at the cochain coboundary level. Over `ZMod 2` all signs are extra work. -/ -@[expose] public section +public section open CategoryTheory MonoidalCategory AlgebraicTopology Simplicial SimplexCategory @@ -256,7 +256,7 @@ the project by applying `(TopCat.toSSet.obj X).map` to the morphism identities o /-- The **`k`-th boundary face** of a singular `(n+1)`-simplex `σ`, obtained by restricting `σ` along `SimplexCategory.δ k`. -/ -noncomputable def faceSimplex (X : TopCat.{0}) (n : ℕ) (k : Fin (n + 2)) +@[expose] noncomputable def faceSimplex (X : TopCat.{0}) (n : ℕ) (k : Fin (n + 2)) (σ : (TopCat.toSSet.obj X).obj (Opposite.op (⦋n + 1⦌ : SimplexCategory))) : (TopCat.toSSet.obj X).obj (Opposite.op (⦋n⦌ : SimplexCategory)) := (TopCat.toSSet.obj X).map (SimplexCategory.δ k).op σ diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/Backports.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/Backports.lean index 08087542e8..f6f587a3a7 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/Backports.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/Backports.lean @@ -14,4 +14,4 @@ public import LeanPool.NandakumarRamanaRao.NRR.OddSphereDegree.AlgebraicTopology /-! Supporting modules for Equal-area and equal-perimeter convex partitions. -/ -@[expose] public section +public section diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/Backports/PrismSimplicialHomotopy.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/Backports/PrismSimplicialHomotopy.lean index 2e56b5e0d5..961978c541 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/Backports/PrismSimplicialHomotopy.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/Backports/PrismSimplicialHomotopy.lean @@ -21,7 +21,7 @@ consumed by the backported algebraic prism `CategoryTheory.SimplicialObject.Homotopy.toChainHomotopy`. -/ -@[expose] public section +public section open CategoryTheory Simplicial Limits AlgebraicTopology SSet diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/Backports/SimplexCategoryToMkOne.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/Backports/SimplexCategoryToMkOne.lean index 40d4998d5c..b5689a0f9f 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/Backports/SimplexCategoryToMkOne.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/Backports/SimplexCategoryToMkOne.lean @@ -10,4 +10,4 @@ public import Mathlib.AlgebraicTopology.SimplexCategory.ToMkOne /-! # Simplex Category To Mk One -/ -@[expose] public section +public section diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/Backports/SimplicialObjectChainHomotopy.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/Backports/SimplicialObjectChainHomotopy.lean index 07d845972f..3da46f6ca3 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/Backports/SimplicialObjectChainHomotopy.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/Backports/SimplicialObjectChainHomotopy.lean @@ -10,4 +10,4 @@ public import Mathlib.AlgebraicTopology.SimplicialObject.Homotopy /-! # Simplicial Object Chain Homotopy -/ -@[expose] public section +public section diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/Backports/SimplicialObjectHomotopy.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/Backports/SimplicialObjectHomotopy.lean index b0c76e4180..009642aee6 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/Backports/SimplicialObjectHomotopy.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/Backports/SimplicialObjectHomotopy.lean @@ -10,4 +10,4 @@ public import Mathlib.AlgebraicTopology.SimplicialObject.Homotopy /-! # Simplicial Object Homotopy -/ -@[expose] public section +public section diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/Backports/StdSimplexOne.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/Backports/StdSimplexOne.lean index 30031d00da..d52bfc1ce1 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/Backports/StdSimplexOne.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/Backports/StdSimplexOne.lean @@ -10,4 +10,4 @@ public import Mathlib.AlgebraicTopology.SimplicialSet.StdSimplexOne /-! # Std Simplex One -/ -@[expose] public section +public section diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricBoundaryCancellation.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricBoundaryCancellation.lean index 3e75f15230..5869a67c3d 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricBoundaryCancellation.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricBoundaryCancellation.lean @@ -62,7 +62,7 @@ Splitting the inner face index `i` into internal faces `i = castSucc i'` sum onto `sd (∂ σ)`. -/ -@[expose] public section +public section open scoped BigOperators open CategoryTheory AlgebraicTopology Simplicial SimplexCategory Limits @@ -90,7 +90,7 @@ theorem toSSetObjEquiv_map_op_naturality (X : TopCat.{0}) (n m : ℕ) /-- The topological coface map `Δⁿ → Δⁿ⁺¹` deleting the `k`-th vertex, as the affine inclusion sending vertex `t` to vertex `k.succAbove t`. -/ -noncomputable def cofaceTop (n : ℕ) (k : Fin (n + 2)) : C(Delta n, Delta (n + 1)) := +@[expose] noncomputable def cofaceTop (n : ℕ) (k : Fin (n + 2)) : C(Delta n, Delta (n + 1)) := ⟨SphereOddDegree.FiniteSimplex.map (S := ℝ) (Fin.succAbove k), SphereOddDegree.FiniteSimplex.continuous_map _⟩ @@ -259,7 +259,7 @@ theorem faceSimplex_last_eq_subdiv_faceData (X : TopCat.{0}) (n : ℕ) /-- The map underlying the last-face decomposition equivalence: `(j, ρ) ↦ (extendLastPerm ρ).trans (insertLastPerm j)`. -/ -noncomputable def lastFaceMap (n : ℕ) : +@[expose] noncomputable def lastFaceMap (n : ℕ) : (Fin (n + 2) × Equiv.Perm (Fin (n + 1))) → Equiv.Perm (Fin (n + 2)) := fun p => (extendLastPerm p.2).trans (insertLastPerm p.1) @@ -283,6 +283,7 @@ theorem lastFaceMap_injective (n : ℕ) : Function.Injective (lastFaceMap n) := /-- The last-face decomposition equivalence `(Fin (n+2) × Perm (Fin (n+1))) ≃ Perm (Fin (n+2))`. -/ +@[expose] noncomputable def lastFaceEquiv (n : ℕ) : (Fin (n + 2) × Equiv.Perm (Fin (n + 1))) ≃ Equiv.Perm (Fin (n + 2)) := Equiv.ofBijective (lastFaceMap n) (by diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricBoundaryChainMap.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricBoundaryChainMap.lean index 33b07f3aa2..58e4aafad7 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricBoundaryChainMap.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricBoundaryChainMap.lean @@ -39,7 +39,7 @@ permutations. The commutation identity below relates `singularBoundary R X n ≫ barycentricSubdivisionLinearMap R X n`. -/ -@[expose] public section +public section open scoped BigOperators open CategoryTheory AlgebraicTopology Simplicial SimplexCategory Limits diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricFiniteCancellation.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricFiniteCancellation.lean index 5240ab2197..3f4fe455fe 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricFiniteCancellation.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricFiniteCancellation.lean @@ -28,7 +28,7 @@ independent of any singular-chain or face-map API: No chain-level boundary statement is asserted here. -/ -@[expose] public section +public section open scoped BigOperators open Finset diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricSubdivisionChainHomotopy.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricSubdivisionChainHomotopy.lean index 66ffba5e6c..13d8316ddf 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricSubdivisionChainHomotopy.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricSubdivisionChainHomotopy.lean @@ -12,7 +12,7 @@ public import Mathlib.Tactic /-! # Barycentric Subdivision Chain Homotopy -/ -@[expose] public section +public section open scoped BigOperators open CategoryTheory AlgebraicTopology Simplicial SimplexCategory Limits diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricSubdivisionChainMap.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricSubdivisionChainMap.lean index 5ff1ab2ee5..08d1bb00c8 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricSubdivisionChainMap.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricSubdivisionChainMap.lean @@ -30,7 +30,7 @@ The chain-map condition is exactly the boundary-commutation identity `barycentricSubdivisionGenerator R X n σ`. -/ -@[expose] public section +public section open scoped BigOperators open CategoryTheory AlgebraicTopology Simplicial SimplexCategory Limits @@ -51,7 +51,7 @@ noncomputable abbrev singularChainComplex (R : Type) [CommRing R] (X : TopCat.{0 complexes `singularChainComplex R X ⟶ singularChainComplex R X`. The chain-map condition is the boundary commutation `barycentricSubdivisionLinearMap_commutes_boundary`. -/ -noncomputable def barycentricSubdivisionChainMap +@[expose] noncomputable def barycentricSubdivisionChainMap (R : Type) [CommRing R] (X : TopCat.{0}) : singularChainComplex R X ⟶ singularChainComplex R X where f n := barycentricSubdivisionLinearMap R X n diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricSubdivisionCone.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricSubdivisionCone.lean index 53f88c4b52..6142bfb7e0 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricSubdivisionCone.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricSubdivisionCone.lean @@ -14,7 +14,7 @@ public import Mathlib.Topology.GDelta.MetrizableSpace /-! # Barycentric Subdivision Cone -/ -@[expose] public section +public section open scoped BigOperators open CategoryTheory AlgebraicTopology Simplicial SimplexCategory Limits @@ -47,7 +47,7 @@ theorem coneTailFun_mem {k : ℕ} (x : Delta (k + 1)) rw [← Finset.sum_div, h_sum, div_self (sub_ne_zero_of_ne (Ne.symm hx))] /-- The normalized base point of a cone simplex, choosing the first vertex at the apex. -/ -noncomputable def coneTail {k : ℕ} (x : Delta (k + 1)) : Delta k := +@[expose] noncomputable def coneTail {k : ℕ} (x : Delta (k + 1)) : Delta k := if h : (x : Fin (k + 1 + 1) → ℝ) 0 = 1 then SphereOddDegree.FiniteSimplex.vertex (0 : Fin (k + 1)) else ⟨coneTailFun x, coneTailFun_mem x h⟩ @@ -63,7 +63,7 @@ theorem coneTail_apply {k : ℕ} (x : Delta (k + 1)) /-! ## 2. The affine cone map -/ /-- Barycentric coordinates of the cone from a vertex over a simplex map. -/ -noncomputable def affineConeMapFun {n k : ℕ} (v : Delta n) (τ : Delta k → Delta n) +@[expose] noncomputable def affineConeMapFun {n k : ℕ} (v : Delta n) (τ : Delta k → Delta n) (x : Delta (k + 1)) : Fin (n + 1) → ℝ := fun j => (x : Fin (k + 1 + 1) → ℝ) 0 * (v : Fin (n + 1) → ℝ) j + (1 - (x : Fin (k + 1 + 1) → ℝ) 0) * ((τ (coneTail x)) : Fin (n + 1) → ℝ) j @@ -81,7 +81,7 @@ theorem affineConeMapFun_mem {n k : ℕ} (v : Delta n) (τ : Delta k → Delta n ring /-- The simplex map obtained by coning a given map to the chosen vertex. -/ -noncomputable def affineConeMap {n k : ℕ} (v : Delta n) (τ : Delta k → Delta n) : +@[expose] noncomputable def affineConeMap {n k : ℕ} (v : Delta n) (τ : Delta k → Delta n) : Delta (k + 1) → Delta n := fun x => ⟨affineConeMapFun v τ x, affineConeMapFun_mem v τ x⟩ @@ -195,6 +195,7 @@ theorem continuous_affineConeMap {n k : ℕ} (v : Delta n) (τ : C(Delta k, Delt exact hA_cont.add hB_cont /-- The affine cone construction bundled as a continuous map. -/ +@[expose] noncomputable def affineConeContinuousMap {n k : ℕ} (v : Delta n) (τ : C(Delta k, Delta n)) : C(Delta (k + 1), Delta n) := ⟨affineConeMap v (⇑τ), continuous_affineConeMap v τ⟩ diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricSubdivisionDiameter.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricSubdivisionDiameter.lean index 4d20d57469..fbcaf5639d 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricSubdivisionDiameter.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricSubdivisionDiameter.lean @@ -56,7 +56,7 @@ The geometric simplex is the convex hull of the vertex tuple, and subdivision of `Δⁿ` has diameter `< ε`. -/ -@[expose] public section +public section open scoped BigOperators open Finset Metric @@ -95,7 +95,7 @@ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] /-- One barycentric subdivision step applied to a vertex tuple `V`, ordered by the permutation `π`. The `k`-th new vertex is the barycenter of the first `k+1` old vertices in the order `π`. -/ -noncomputable def stepVertices (n : ℕ) (V : Fin (n + 1) → E) +@[expose] noncomputable def stepVertices (n : ℕ) (V : Fin (n + 1) → E) (π : Equiv.Perm (Fin (n + 1))) : Fin (n + 1) → E := fun k => ((k.val + 1 : ℝ))⁻¹ • ∑ j ∈ Finset.Iic k, V (π j) @@ -193,6 +193,7 @@ theorem stepVertices_diam_le (n : ℕ) (V : Fin (n + 1) → E) exact dist_step_step_le n V π a b /-- Iterate barycentric subdivision of a vertex family along a permutation word. -/ +@[expose] noncomputable def iterVertices (n : ℕ) : (N : ℕ) → (Fin N → Equiv.Perm (Fin (n + 1))) → (Fin (n + 1) → E) → (Fin (n + 1) → E) | 0, _, V => V @@ -231,7 +232,7 @@ end Normed /-- The tuple of `n+1` standard basis vertices of `Δⁿ`, as points of `Fin (n+1) → ℝ`. -/ -noncomputable def stdVerts (n : ℕ) : Fin (n + 1) → (Fin (n + 1) → ℝ) := +@[expose] noncomputable def stdVerts (n : ℕ) : Fin (n + 1) → (Fin (n + 1) → ℝ) := fun k => Pi.single k 1 /- diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricSubdivisionHomotopyFormula.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricSubdivisionHomotopyFormula.lean index 9d8fc27c84..a7793c6169 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricSubdivisionHomotopyFormula.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricSubdivisionHomotopyFormula.lean @@ -12,7 +12,7 @@ public import Mathlib.Tactic /-! # Barycentric Subdivision Homotopy Formula -/ -@[expose] public section +public section open scoped BigOperators open CategoryTheory AlgebraicTopology Simplicial SimplexCategory Limits @@ -175,7 +175,7 @@ theorem barycentricHomotopyUniversal_succ_eq (R : Type) [CommRing R] (m : ℕ) : /-! ## 5. The boundary term and the chain-homotopy formula -/ /-- Apply the subdivision homotopy to the boundary of a chain, using zero in degree zero. -/ -noncomputable def homotopyBoundaryTerm (R : Type) [CommRing R] (X : TopCat.{0}) (n : ℕ) +@[expose] noncomputable def homotopyBoundaryTerm (R : Type) [CommRing R] (X : TopCat.{0}) (n : ℕ) (c : singularChainGroup R X n) : singularChainGroup R X n := match n with | 0 => 0 diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricSubdivisionHomotopyOperator.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricSubdivisionHomotopyOperator.lean index 21eb084a36..64fb4d9c10 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricSubdivisionHomotopyOperator.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricSubdivisionHomotopyOperator.lean @@ -16,7 +16,7 @@ public import Mathlib.Tactic /-! # Barycentric Subdivision Homotopy Operator -/ -@[expose] public section +public section open scoped BigOperators open CategoryTheory AlgebraicTopology Simplicial SimplexCategory Limits @@ -28,13 +28,13 @@ namespace AffineBarycentricSubdivision /-! ## 1. Pushforward of singular chains along a continuous map -/ /-- The degreewise singular-chain map induced by a continuous map. -/ -noncomputable def singularChainMap (R : Type) [CommRing R] {X Y : TopCat.{0}} +@[expose] noncomputable def singularChainMap (R : Type) [CommRing R] {X Y : TopCat.{0}} (f : X ⟶ Y) (n : ℕ) : singularChainGroup R X n ⟶ singularChainGroup R Y n := (((singularChainComplexFunctor (ModuleCat.{0} R)).obj (ModuleCat.of R R)).map f).f n /-- Postcompose a singular simplex with a continuous map. -/ -noncomputable def pushSimplex {X Y : TopCat.{0}} (f : X ⟶ Y) (n : ℕ) +@[expose] noncomputable def pushSimplex {X Y : TopCat.{0}} (f : X ⟶ Y) (n : ℕ) (σ : singularSimplices X n) : singularSimplices Y n := (TopCat.toSSet.map f).app (Opposite.op (SimplexCategory.mk n)) σ @@ -66,11 +66,11 @@ theorem singularChainMap_boundary (R : Type) [CommRing R] {X Y : TopCat.{0}} /-! ## 2. The barycenter and the identity singular simplex of `Δⁿ` -/ /-- The barycenter of the standard real simplex. -/ -noncomputable def deltaBarycenter (n : ℕ) : Delta n := +@[expose] noncomputable def deltaBarycenter (n : ℕ) : Delta n := SphereOddDegree.FiniteSimplex.barycenter (X := Fin (n + 1)) (𝕜 := ℝ) /-- The identity map of the standard simplex viewed as a singular simplex. -/ -noncomputable def stdSimplexIdSingularSimplex (n : ℕ) : +@[expose] noncomputable def stdSimplexIdSingularSimplex (n : ℕ) : singularSimplices (TopCat.of (Delta n)) n := continuousMapAsSingularSimplex (TopCat.of (Delta n)) n (ContinuousMap.id (Delta n)) @@ -114,6 +114,7 @@ theorem homotopyFromUniversal_generator (R : Type) [CommRing R] (X : TopCat.{0}) /-! ## 4. The universal homotopy chain `T_n(ι_n)` -/ /-- The recursively coned universal chain witnessing homotopy to barycentric subdivision. -/ +@[expose] noncomputable def barycentricHomotopyUniversal (R : Type) [CommRing R] (n : ℕ) : singularChainGroup R (TopCat.of (Delta n)) (n + 1) := match n with @@ -137,6 +138,7 @@ noncomputable def barycentricHomotopyUniversal (R : Type) [CommRing R] (n : ℕ) /-! ## 5. The degree-wise homotopy operator -/ /-- The degree-raising chain homotopy map induced by the universal subdivision chain. -/ +@[expose] noncomputable def barycentricSubdivisionHomotopyLinearMap (R : Type) [CommRing R] (X : TopCat.{0}) (n : ℕ) : singularChainGroup R X n ⟶ singularChainGroup R X (n + 1) := diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricSubdivisionIter.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricSubdivisionIter.lean index a2fe985b2f..b900a1cb5e 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricSubdivisionIter.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricSubdivisionIter.lean @@ -11,7 +11,7 @@ public import Mathlib.Tactic /-! # Barycentric Subdivision Iter -/ -@[expose] public section +public section open scoped BigOperators open CategoryTheory AlgebraicTopology Simplicial SimplexCategory Limits @@ -20,7 +20,7 @@ namespace SphereOddDegree namespace AffineBarycentricSubdivision /-- The `N`-fold barycentric subdivision chain map `sd^N`, defined by `sd^0 = 𝟙` and `sd^(N+1) = sd ≫ sd^N`. -/ -noncomputable def barycentricSubdivisionIterChainMap +@[expose] noncomputable def barycentricSubdivisionIterChainMap (R : Type) [CommRing R] (X : TopCat.{0}) (N : ℕ) : singularChainComplex R X ⟶ singularChainComplex R X := match N with @@ -37,7 +37,7 @@ theorem barycentricSubdivisionIterChainMap_succ = barycentricSubdivisionChainMap R X ≫ barycentricSubdivisionIterChainMap R X N := rfl /-- The degree-`n` component of `sd^N` as an `R`-linear map. -/ -noncomputable def barycentricSubdivisionIterLinearMap +@[expose] noncomputable def barycentricSubdivisionIterLinearMap (R : Type) [CommRing R] (X : TopCat.{0}) (N n : ℕ) : singularChainGroup R X n →ₗ[R] singularChainGroup R X n := ((barycentricSubdivisionIterChainMap R X N).f n).hom @@ -69,7 +69,7 @@ theorem barycentricSubdivisionIterLinearMap_commutes_boundary /-- The explicit accumulated homotopy operator `H^(N) = Σ_{r=0}^{N-1} (sd^r) ∘ H`, defined by `H^(0) = 0` and `H^(N+1)_n = H^(N)_n + (sd^N)_{n+1} ∘ H_n`. -/ -noncomputable def barycentricSubdivisionIterHomotopyLinearMap +@[expose] noncomputable def barycentricSubdivisionIterHomotopyLinearMap (R : Type) [CommRing R] (X : TopCat.{0}) (N n : ℕ) : singularChainGroup R X n →ₗ[R] singularChainGroup R X (n + 1) := match N with @@ -93,7 +93,7 @@ theorem barycentricSubdivisionIterHomotopyLinearMap_succ `0` it is `0`; in degree `m+1` it is `H^(N)_m (∂_m c)`. This matches the library's index convention `∂ : C_{n+1} → C_n = singularBoundary R X n`, exactly as `homotopyBoundaryTerm` did for the one-step formula. -/ -noncomputable def barycentricSubdivisionIterHomotopyBoundaryTerm +@[expose] noncomputable def barycentricSubdivisionIterHomotopyBoundaryTerm (R : Type) [CommRing R] (X : TopCat.{0}) (N n : ℕ) (c : singularChainGroup R X n) : singularChainGroup R X n := match n with diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricSubdivisionOperator.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricSubdivisionOperator.lean index fbde787bd2..2255d46139 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricSubdivisionOperator.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/BarycentricSubdivisionOperator.lean @@ -45,7 +45,7 @@ boundary. The required boundary theorem is the face/sign calculation Only after that theorem is proved should one package `sd` as a genuine chain map. -/ -@[expose] public section +public section open scoped BigOperators open CategoryTheory AlgebraicTopology Simplicial SimplexCategory Limits @@ -72,7 +72,7 @@ theorem continuous_affineSubdivMap (n : ℕ) (π : Equiv.Perm (Fin (n + 1))) : exact continuous_pi fun j => continuous_affineSubdivMapFun_coord n π j /-- The affine subdivision simplex as a bundled continuous self-map of `Δⁿ`. -/ -noncomputable def affineSubdivContinuousMap (n : ℕ) +@[expose] noncomputable def affineSubdivContinuousMap (n : ℕ) (π : Equiv.Perm (Fin (n + 1))) : C(Delta n, Delta n) := ⟨affineSubdivMap n π, continuous_affineSubdivMap n π⟩ @@ -83,7 +83,7 @@ noncomputable def affineSubdivContinuousMap (n : ℕ) /-! ## 2. Singular-simplex summands -/ /-- Coordinate realization of Mathlib's intrinsic simplex. -/ -noncomputable def intrinsicSimplexCoordinates (n : ℕ) : +@[expose] noncomputable def intrinsicSimplexCoordinates (n : ℕ) : Convexity.StdSimplex ℝ (Fin (n + 1)) ≃ₜ Delta n where toFun x := ⟨x.weights, x.nonneg, by simp⟩ invFun x := @@ -102,14 +102,14 @@ noncomputable def intrinsicSimplexCoordinates (n : ℕ) : /-- Convert a singular simplex, represented as a simplex of `TopCat.toSSet.obj X`, to the corresponding bundled continuous map out of the topological standard simplex. -/ -noncomputable def singularSimplexAsContinuousMap (X : TopCat.{0}) (n : ℕ) +@[expose] noncomputable def singularSimplexAsContinuousMap (X : TopCat.{0}) (n : ℕ) (σ : singularSimplices X n) : C(Delta n, X) := ((X.toSSetObjEquiv (Opposite.op (⦋n⦌ : SimplexCategory))) σ).comp ⟨(intrinsicSimplexCoordinates n).symm, (intrinsicSimplexCoordinates n).symm.continuous⟩ /-- Convert a bundled continuous map out of the standard simplex into the corresponding simplex of the singular simplicial set. -/ -noncomputable def continuousMapAsSingularSimplex (X : TopCat.{0}) (n : ℕ) +@[expose] noncomputable def continuousMapAsSingularSimplex (X : TopCat.{0}) (n : ℕ) (σ : C(Delta n, X)) : singularSimplices X n := (X.toSSetObjEquiv (Opposite.op (⦋n⦌ : SimplexCategory))).symm (σ.comp ⟨intrinsicSimplexCoordinates n, (intrinsicSimplexCoordinates n).continuous⟩) @@ -129,7 +129,7 @@ noncomputable def continuousMapAsSingularSimplex (X : TopCat.{0}) (n : ℕ) /-- The `π`-summand of barycentric subdivision of a singular simplex: precompose `σ : Δⁿ → X` with the affine subdivision simplex `a_π : Δⁿ → Δⁿ`. -/ -noncomputable def barycentricSubdivSimplex (X : TopCat.{0}) (n : ℕ) +@[expose] noncomputable def barycentricSubdivSimplex (X : TopCat.{0}) (n : ℕ) (π : Equiv.Perm (Fin (n + 1))) (σ : singularSimplices X n) : singularSimplices X n := continuousMapAsSingularSimplex X n @@ -153,19 +153,19 @@ noncomputable abbrev singularChainGroup (R : Type) [CommRing R] (X : TopCat.{0}) (((singularChainComplexFunctor (ModuleCat.{0} R)).obj (ModuleCat.of R R)).obj X).X n /-- The basis chain associated to a singular simplex. -/ -noncomputable def chainGenerator (R : Type) [CommRing R] (X : TopCat.{0}) (n : ℕ) +@[expose] noncomputable def chainGenerator (R : Type) [CommRing R] (X : TopCat.{0}) (n : ℕ) (σ : singularSimplices X n) : singularChainGroup R X n := ((Sigma.ι (fun (_ : singularSimplices X n) => ModuleCat.of R R) σ).hom (1 : R)) /-- The sign of a finite permutation, interpreted in a coefficient ring. For `R = ℤ` this is `±1`; for `R = ZMod 2` both signs become `1`. -/ -noncomputable def permSignCoeff (R : Type) [CommRing R] {n : ℕ} +@[expose] noncomputable def permSignCoeff (R : Type) [CommRing R] {n : ℕ} (π : Equiv.Perm (Fin (n + 1))) : R := ((Equiv.Perm.sign π : ℤ) : R) /-- The barycentric subdivision of a basis singular simplex as a chain in the same degree. -/ -noncomputable def barycentricSubdivisionGenerator (R : Type) [CommRing R] +@[expose] noncomputable def barycentricSubdivisionGenerator (R : Type) [CommRing R] (X : TopCat.{0}) (n : ℕ) (σ : singularSimplices X n) : singularChainGroup R X n := ∑ π : Equiv.Perm (Fin (n + 1)), permSignCoeff R π • chainGenerator R X n (barycentricSubdivSimplex X n π σ) @@ -243,7 +243,7 @@ theorem barycentricSubdivisionLinearMap_smul (R : Type) [CommRing R] /-- The singular boundary map `∂ : C_{n+1}(X; R) → C_n(X; R)`, i.e. the differential of the singular chain complex with coefficients in `R`. -/ -noncomputable def singularBoundary (R : Type) [CommRing R] (X : TopCat.{0}) (n : ℕ) : +@[expose] noncomputable def singularBoundary (R : Type) [CommRing R] (X : TopCat.{0}) (n : ℕ) : singularChainGroup R X (n + 1) ⟶ singularChainGroup R X n := (((singularChainComplexFunctor (ModuleCat.{0} R)).obj (ModuleCat.of R R)).obj X).d (n + 1) n diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/CochainCupLeibniz.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/CochainCupLeibniz.lean index bce59ab815..e140ab3bc8 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/CochainCupLeibniz.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/CochainCupLeibniz.lean @@ -50,7 +50,7 @@ cochain degree cast `cochainCast` (with `p+(q+1) = (p+q)+1` definitional and `(p+1)+q = (p+q)+1` propositional via `aw_degree_left_succ`). -/ -@[expose] public section +public section open CategoryTheory open SphereOddDegree.AlexanderWhitney diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/CohomologyCupProduct.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/CohomologyCupProduct.lean index c0519274db..d9c80da011 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/CohomologyCupProduct.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/CohomologyCupProduct.lean @@ -43,7 +43,7 @@ of the classes of two cocycles is the class of their cochain cup. The module exports the cohomology-level product and its functoriality laws. -/ -@[expose] public section +public section open CategoryTheory Limits AlgebraicTopology SphereOddDegree.AlexanderWhitney @@ -71,7 +71,7 @@ theorem cochainCx_next (n : ℕ) : (ComplexShape.up ℕ).next n = n + 1 := /-- The cohomology class of a cocycle `φ` (a `p`-cochain with `δφ = 0`): `homologyπ` applied to the cycle `cyclesMk φ`. -/ -def cocycleClass (X : TopCat.{0}) (n : ℕ) (φ : singularCochainGroup (ZMod 2) X n) +@[expose] def cocycleClass (X : TopCat.{0}) (n : ℕ) (φ : singularCochainGroup (ZMod 2) X n) (hφ : cochainCoboundary (ZMod 2) X n φ = 0) : cohomologyZMod2 X n := ((cochainCxZMod2 X).homologyπ n).hom ((cochainCxZMod2 X).cyclesMk φ (n + 1) (cochainCx_next n) hφ) @@ -181,7 +181,7 @@ theorem cocycleClass_cast_coboundary_zero (X : TopCat.{0}) (m m' : ℕ) (h : m + /-! ## 2. Cup with a fixed cocycle on the left -/ /-- The cochain map `φ ↦ φ ⌣ ψ` as a `ModuleCat` morphism `C^p ⟶ C^{p+q}`. -/ -def cupRightMor (X : TopCat.{0}) (p q : ℕ) (ψ : singularCochainGroup (ZMod 2) X q) : +@[expose] def cupRightMor (X : TopCat.{0}) (p q : ℕ) (ψ : singularCochainGroup (ZMod 2) X q) : (cochainCxZMod2 X).X p ⟶ (cochainCxZMod2 X).X (p + q) := ModuleCat.ofHom { toFun := fun φ => cochainCup p q φ ψ @@ -193,7 +193,7 @@ def cupRightMor (X : TopCat.{0}) (p q : ℕ) (ψ : singularCochainGroup (ZMod 2) (cupRightMor X p q ψ).hom φ = cochainCup p q φ ψ := rfl /-- The cochain map `ψ ↦ φ ⌣ ψ` as a `ModuleCat` morphism `C^q ⟶ C^{p+q}`. -/ -def cupLeftFixedMor (X : TopCat.{0}) (p q : ℕ) (φ : singularCochainGroup (ZMod 2) X p) : +@[expose] def cupLeftFixedMor (X : TopCat.{0}) (p q : ℕ) (φ : singularCochainGroup (ZMod 2) X p) : (cochainCxZMod2 X).X q ⟶ (cochainCxZMod2 X).X (p + q) := ModuleCat.ofHom { toFun := fun ψ => cochainCup p q φ ψ @@ -528,7 +528,7 @@ theorem cupZMod2_mk {X : TopCat.{0}} {p q : ℕ} /-- The pullback `f^* : H^n(Y; F₂) ⟶ H^n(X; F₂)` of a continuous map `f : X ⟶ Y`, as the action of the singular cohomology functor. -/ -def cohPullback {X Y : TopCat.{0}} (f : X ⟶ Y) (n : ℕ) : +@[expose] def cohPullback {X Y : TopCat.{0}} (f : X ⟶ Y) (n : ℕ) : cohomologyZMod2 Y n ⟶ cohomologyZMod2 X n := (singularCohomologyZMod2 n).map f.op @@ -611,7 +611,7 @@ def oneZMod2 (X : TopCat.{0}) : cohomologyZMod2 X 0 := cocycleClass X 0 (cochainOne (R := ZMod 2) (Z := X)) (cochainCoboundary_cochainOne X) /-- The `n`-th cup power `a^n ∈ H^n(X; F₂)` of a degree-one class `a ∈ H^1(X; F₂)`. -/ -def cupPowZMod2 {X : TopCat.{0}} (a : cohomologyZMod2 X 1) : (n : ℕ) → cohomologyZMod2 X n +@[expose] def cupPowZMod2 {X : TopCat.{0}} (a : cohomologyZMod2 X 1) : (n : ℕ) → cohomologyZMod2 X n | 0 => oneZMod2 X | (n + 1) => cupZMod2 (cupPowZMod2 a n) a diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/CoordinateProjection.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/CoordinateProjection.lean index fca38369cd..15a28243b4 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/CoordinateProjection.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/CoordinateProjection.lean @@ -11,7 +11,7 @@ public import Mathlib.Tactic /-! # Coordinate Projection -/ -@[expose] public section +public section open CategoryTheory AlgebraicTopology Limits open SphereOddDegree.AffineBarycentricSubdivision @@ -20,7 +20,7 @@ namespace SphereOddDegree variable {R : Type} [CommRing R] {X : TopCat.{0}} /-- The chain projection that retains exactly the singular generators satisfying a predicate. -/ -noncomputable def keepHom (R : Type) [CommRing R] (X : TopCat.{0}) {n : ℕ} +@[expose] noncomputable def keepHom (R : Type) [CommRing R] (X : TopCat.{0}) {n : ℕ} (P : singularSimplices X n → Prop) [DecidablePred P] : singularChainGroup R X n ⟶ singularChainGroup R X n := Sigma.desc fun σ => diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/CupProduct.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/CupProduct.lean index 203965a5c4..ea23ca4041 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/CupProduct.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/CupProduct.lean @@ -59,7 +59,7 @@ Everything is stated for a general `CommRing R`, with coefficients in `R` itself abbreviations; over `ZMod 2` the Koszul sign in the Leibniz rule is trivial. -/ -@[expose] public section +public section open CategoryTheory AlgebraicTopology Limits SphereOddDegree.AlexanderWhitney @@ -84,7 +84,7 @@ abbrev singularCochainGroup (R : Type) [CommRing R] (Z : TopCat.{0}) (p : ℕ) : /-- Evaluate a singular `p`-cochain `φ` on a singular `p`-simplex `τ`, i.e. on the basis chain `τ` (the image of `1 ∈ R` under the coproduct inclusion at `τ`). -/ -noncomputable def cochainEval {R : Type} [CommRing R] {Z : TopCat.{0}} (p : ℕ) +@[expose] noncomputable def cochainEval {R : Type} [CommRing R] {Z : TopCat.{0}} (p : ℕ) (φ : singularCochainGroup R Z p) (τ : singularSimplices Z p) : R := φ.hom ((Sigma.ι (fun (_ : singularSimplices Z p) => ModuleCat.of R R) τ).hom (1 : R)) @@ -194,7 +194,7 @@ theorem cochainCup_smul_right {R : Type} [CommRing R] {Z : TopCat.{0}} (p q : /-- The pullback `f^*` of a singular `p`-cochain along a continuous map `f : X ⟶ Y`, i.e. precomposition with the induced singular chain map. -/ -noncomputable def cochainPullback {R : Type} [CommRing R] {X Y : TopCat.{0}} +@[expose] noncomputable def cochainPullback {R : Type} [CommRing R] {X Y : TopCat.{0}} (f : X ⟶ Y) (p : ℕ) (φ : singularCochainGroup R Y p) : singularCochainGroup R X p := (((singularCochainComplexFunctor R (ModuleCat.of R R)).map f.op).f p).hom φ @@ -275,7 +275,7 @@ noncomputable def cochainOne {R : Type} [CommRing R] {Z : TopCat.{0}} : /-- The `n`-th cup power `φ^{⌣ n} ∈ C^n(Z; R)` of a degree-one cochain `φ ∈ C^1(Z; R)`, defined by `φ^0 = 1` and `φ^{n+1} = φ^n ⌣ φ`. This is the cochain-level scaffolding for the powers `αⁿ` of a degree-one cohomology class. -/ -noncomputable def cochainPow {R : Type} [CommRing R] {Z : TopCat.{0}} +@[expose] noncomputable def cochainPow {R : Type} [CommRing R] {Z : TopCat.{0}} (φ : singularCochainGroup R Z 1) : (n : ℕ) → singularCochainGroup R Z n | 0 => cochainOne | (n + 1) => cochainCup n 1 (cochainPow φ n) φ diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/CupProductPowers.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/CupProductPowers.lean index 2953297d23..7ac7ef28f8 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/CupProductPowers.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/CupProductPowers.lean @@ -16,7 +16,7 @@ realization. The cohomology-level cup product and power naturality are implement `CohomologyCupProduct.lean`; `InducedOnRPCohomology.lean` specializes them to maps of `RP n`. -/ -@[expose] public section +public section open CategoryTheory AlgebraicTopology @@ -81,6 +81,7 @@ variable {A : ℕ → Type*} /-- The `n`-th cup power `xⁿ ∈ A n` of a degree-one element `x ∈ A 1`, by `x⁰ = one` and `xⁿ⁺¹ = xⁿ ⌣ x`. -/ +@[expose] def pow (G : GradedCupPullback A) (x : A 1) : (n : ℕ) → A n | 0 => G.one | (n + 1) => G.cup (G.pow x n) x diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/CupProductScaffolding.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/CupProductScaffolding.lean index 77973da19b..f7b116829d 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/CupProductScaffolding.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/CupProductScaffolding.lean @@ -20,7 +20,7 @@ Alexander–Whitney and cup-product modules; the diagonal itself is constructed in those later modules rather than in this file. -/ -@[expose] public section +public section open CategoryTheory MonoidalCategory Limits namespace SphereOddDegree diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/Degree.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/Degree.lean index fa8d9274f3..737f8bf48d 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/Degree.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/Degree.lean @@ -22,7 +22,7 @@ chosen orientation isomorphism. Unconditional orientation data is supplied by later sphere-homology modules. -/ -@[expose] public section +public section noncomputable section open CategoryTheory @@ -66,7 +66,7 @@ theorem det_ambientNeg (n : ℕ) : /-- Transport a continuous self-map of the raw sphere model `Sphere n` to a self-morphism of Mathlib's categorical sphere `TopCat.sphere n`, by conjugating with the bridge isomorphism `topCatSphereIso`. -/ -def toTopCatSphereSelfMap {n : ℕ} (f : C(Sphere n, Sphere n)) : +@[expose] def toTopCatSphereSelfMap {n : ℕ} (f : C(Sphere n, Sphere n)) : TopCat.sphere.{0} n ⟶ TopCat.sphere.{0} n := (topCatSphereIso n).hom ≫ TopCat.ofHom f ≫ (topCatSphereIso n).inv @@ -89,7 +89,7 @@ theorem toTopCatSphereSelfMap_comp {n : ℕ} (f g : C(Sphere n, Sphere n)) : /-- The endomorphism of `Hₙ(TopCat.sphere n; ℤ)` induced by a continuous self-map of `Sphere n`, through the model transport and the integral singular homology functor. -/ -def inducedOnTopHomology {n : ℕ} (f : C(Sphere n, Sphere n)) : +@[expose] def inducedOnTopHomology {n : ℕ} (f : C(Sphere n, Sphere n)) : End ((singularHomologyℤ n).obj (TopCat.sphere.{0} n)) := (singularHomologyℤ n).map (toTopCatSphereSelfMap f) @@ -148,7 +148,7 @@ theorem evalAtOneℤ_bijective : Function.Bijective evalAtOneℤ := by /-- Given an isomorphism `e : M ≅ ℤ` of `ℤ`-modules, the ring homomorphism `End M →+* ℤ` extracting the integer scalar by which an endomorphism acts: conjugate `End M` into `End ℤ = (ℤ →ₗ[ℤ] ℤ)` and evaluate at `1`. -/ -def degreeRingHomOfIso (M : ModuleCat.{0} ℤ) (e : M ≅ ModuleCat.of ℤ ℤ) : +@[expose] def degreeRingHomOfIso (M : ModuleCat.{0} ℤ) (e : M ≅ ModuleCat.of ℤ ℤ) : End M →+* ℤ := evalAtOneℤ.comp <| ((LinearEquiv.conjRingEquiv e.toLinearEquiv).toRingHom).comp @@ -157,7 +157,7 @@ def degreeRingHomOfIso (M : ModuleCat.{0} ℤ) (e : M ≅ ModuleCat.of ℤ ℤ) /-- `degreeRingHomOfIso` is in fact a ring isomorphism `End M ≃+* ℤ`: every component (the endomorphism-ring equivalence, the conjugation, and evaluation at `1`) is a bijection. -/ -def degreeRingEquivOfIso (M : ModuleCat.{0} ℤ) (e : M ≅ ModuleCat.of ℤ ℤ) : +@[expose] def degreeRingEquivOfIso (M : ModuleCat.{0} ℤ) (e : M ≅ ModuleCat.of ℤ ℤ) : End M ≃+* ℤ := ((ModuleCat.endRingEquiv M).trans (LinearEquiv.conjRingEquiv e.toLinearEquiv)).trans (RingEquiv.ofBijective evalAtOneℤ evalAtOneℤ_bijective) @@ -173,7 +173,7 @@ theorem degreeRingEquivOfIso_apply (M : ModuleCat.{0} ℤ) /-- The integer **degree of `f` relative to a chosen isomorphism** `e : Hₙ(Sⁿ; ℤ) ≅ ℤ`. Later modules supply a canonical positive-dimensional isomorphism and expose an unconditional orientation-based degree. -/ -def degreeOfIso {n : ℕ} +@[expose] def degreeOfIso {n : ℕ} (e : (singularHomologyℤ n).obj (TopCat.sphere.{0} n) ≅ ModuleCat.of ℤ ℤ) (f : C(Sphere n, Sphere n)) : ℤ := degreeRingHomOfIso _ e (inducedOnTopHomology f) diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/DegreeHomotopyInvariance.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/DegreeHomotopyInvariance.lean index 17484e269b..2b17c4e7b1 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/DegreeHomotopyInvariance.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/DegreeHomotopyInvariance.lean @@ -19,7 +19,7 @@ algebraic prism and the library cylinder), the homotopy-invariance wrappers of **unconditional**. -/ -@[expose] public section +public section open CategoryTheory AlgebraicTopology diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/FiniteSimplex.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/FiniteSimplex.lean index 4b58384f79..1ab94b8f80 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/FiniteSimplex.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/FiniteSimplex.lean @@ -18,14 +18,14 @@ space. The equivalence below identifies these coordinates with Mathlib's finitely supported simplex without changing their pointwise values. -/ -@[expose] public section +public section open Set Convexity namespace SphereOddDegree /-- Nonnegative finite coordinate functions whose coordinates sum to one. -/ -def finiteSimplex (R X : Type*) [Semiring R] [PartialOrder R] [Fintype X] : Set (X → R) := +@[expose] def finiteSimplex (R X : Type*) [Semiring R] [PartialOrder R] [Fintype X] : Set (X → R) := {f | (∀ x, 0 ≤ f x) ∧ ∑ x, f x = 1} namespace FiniteSimplex @@ -46,7 +46,7 @@ instance : FunLike (finiteSimplex S X) X S where Subtype.ext h /-- Conversion to finitely supported weights preserves every coordinate. -/ -noncomputable def equivalence : finiteSimplex S X ≃ StdSimplex S X where +@[expose] noncomputable def equivalence : finiteSimplex S X ≃ StdSimplex S X where toFun s := { weights := Finsupp.equivFunOnFinite.symm s.val nonneg x := by simpa using s.property.1 x @@ -93,7 +93,7 @@ theorem image_linearMap (f : X → Y) : exact Finset.sum_fiberwise Finset.univ f s /-- Push a finite simplex point forward by summing weights over each fiber. -/ -noncomputable def map (f : X → Y) (s : finiteSimplex S X) : finiteSimplex S Y := +@[expose] noncomputable def map (f : X → Y) (s : finiteSimplex S X) : finiteSimplex S Y := ⟨FunOnFinite.linearMap S S f s, image_linearMap f ⟨s, s.property, rfl⟩⟩ /-- The underlying coordinate function is the finite fiber-sum linear map. -/ @@ -139,7 +139,7 @@ variable {𝕜 X : Type*} [Field 𝕜] [LinearOrder 𝕜] [IsStrictOrderedRing [Fintype X] [Nonempty X] /-- The finite simplex point assigning the same mass to every coordinate. -/ -def barycenter : finiteSimplex 𝕜 X := +@[expose] def barycenter : finiteSimplex 𝕜 X := ⟨fun _ => (Fintype.card X : 𝕜)⁻¹, by simp [finiteSimplex]⟩ /-- Every barycenter coordinate is the reciprocal of the number of vertices. -/ @@ -206,7 +206,7 @@ theorem bounded_finiteSimplex (X : Type*) [Fintype X] : /-- The one-dimensional finite coordinate simplex is the unit interval. -/ -noncomputable def FiniteSimplex.homeomorphUnitInterval : +@[expose] noncomputable def FiniteSimplex.homeomorphUnitInterval : finiteSimplex ℝ (Fin 2) ≃ₜ unitInterval where toFun s := ⟨s.val 1, s.2.1 1, FiniteSimplex.le_one s 1⟩ invFun t := ⟨![1 - t, t], Fin.forall_fin_two.2 diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/H1ClassifierZMod2.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/H1ClassifierZMod2.lean index f0840c7b49..db408406eb 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/H1ClassifierZMod2.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/H1ClassifierZMod2.lean @@ -62,7 +62,7 @@ producing a class `α ∈ H¹(RPⁿ; F₂)` from the monodromy character, togeth degree-one Hurewicz comparison `π₁(X)ᵃᵇ ≅ H₁(X; ℤ)`). -/ -@[expose] public section +public section open CategoryTheory AlgebraicTopology Limits @@ -228,7 +228,7 @@ theorem kroneckerFunctional_iCycles_smul (X : TopCat.{0}) (n : ℕ) (s : ZMod 2) rfl /-- Evaluate cocycles on homology classes through the Kronecker pairing. -/ -def kroneckerCyclesMap (X : TopCat.{0}) (n : ℕ) : +@[expose] def kroneckerCyclesMap (X : TopCat.{0}) (n : ℕ) : (cochainCxZMod2 X).cycles n ⟶ homologyDualZMod2 X n := ModuleCat.ofHom { toFun := fun c => diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/HomotopyInvariance.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/HomotopyInvariance.lean index 22e102f0fb..e309a28710 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/HomotopyInvariance.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/HomotopyInvariance.lean @@ -18,7 +18,7 @@ invariance statements for integral singular homology from it. A concrete proof i reusable conditional API. -/ -@[expose] public section +public section open CategoryTheory AlgebraicTopology @@ -36,7 +36,7 @@ topological half is built in `PrismOperator.lean` as `cylinder`). It is phrased as a `Prop` (using `Nonempty` of the chain-homotopy data) so it can be assumed cleanly as a hypothesis; this suffices for every homology-level *equality* below, which are propositions. -/ -def SingularPrismOperator : Prop := +@[expose] def SingularPrismOperator : Prop := ∀ {X Y : TopCat.{0}} {f g : X ⟶ Y}, ContinuousMap.Homotopy f.hom g.hom → Nonempty (Homotopy (singularChainℤ.map f) (singularChainℤ.map g)) diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/HomotopyInvarianceWrappers.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/HomotopyInvarianceWrappers.lean index 7fe3610458..c3a48a8bb4 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/HomotopyInvarianceWrappers.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/HomotopyInvarianceWrappers.lean @@ -16,7 +16,7 @@ Composition, symmetry, and homotopy-equivalence wrappers around particular construction of the singular prism operator. -/ -@[expose] public section +public section open CategoryTheory AlgebraicTopology diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/HomotopyToChainHomotopy.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/HomotopyToChainHomotopy.lean index d5a406d4ec..e1bfd0411a 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/HomotopyToChainHomotopy.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/HomotopyToChainHomotopy.lean @@ -18,7 +18,7 @@ functors. The theorem consumes an explicit chain homotopy; the prism-operator mo that chain homotopy from a topological homotopy. -/ -@[expose] public section +public section open CategoryTheory AlgebraicTopology diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/InducedOnRPCohomology.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/InducedOnRPCohomology.lean index fbc5f53760..9aedfa8830 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/InducedOnRPCohomology.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/InducedOnRPCohomology.lean @@ -61,7 +61,7 @@ These are the functorial pullback / double-cover-compatibility / descended-map naturality facts independent of the cup-product ring computation. -/ -@[expose] public section +public section noncomputable section @@ -72,18 +72,19 @@ namespace SphereOddDegree /-- The `k`-th singular cohomology of `RP n` with `ZMod 2` coefficients, as an object of `ModuleCat (ZMod 2)`. This is a genuine object: the constructed functor `singularCohomologyZMod2 k` applied to the genuine space `TopCat.of (RP n)`. -/ -noncomputable def rpCohomology (n k : ℕ) : ModuleCat.{0} (ZMod 2) := +@[expose] noncomputable def rpCohomology (n k : ℕ) : ModuleCat.{0} (ZMod 2) := (singularCohomologyZMod2 k).obj (Opposite.op (TopCat.of (RP n))) /-- The `k`-th singular cohomology of `S^n` with `ZMod 2` coefficients, as an object of `ModuleCat (ZMod 2)`. -/ -noncomputable def sphereCohomology (n k : ℕ) : ModuleCat.{0} (ZMod 2) := +@[expose] noncomputable def sphereCohomology (n k : ℕ) : ModuleCat.{0} (ZMod 2) := (singularCohomologyZMod2 k).obj (Opposite.op (TopCat.of (Sphere n))) /-- The pullback `fbar^* : H^k(RP n; F₂) → H^k(RP n; F₂)` of the descended odd map `fbar = inducedOnRP f hf`. This is the functor's action on the opposite of the `TopCat` morphism `TopCat.ofHom (inducedOnRP f hf)`; naturality is structural. -/ +@[expose] noncomputable def inducedOnRPPullback {n : ℕ} (f : C(Sphere n, Sphere n)) (hf : IsOddMap f) (k : ℕ) : rpCohomology n k ⟶ rpCohomology n k := (singularCohomologyZMod2 k).map (TopCat.ofHom (inducedOnRP f hf)).op @@ -95,7 +96,7 @@ noncomputable def projPullback (n k : ℕ) : rpCohomology n k ⟶ sphereCohomolo /-- The pullback `f^* : H^k(S^n; F₂) → H^k(S^n; F₂)` of a self-map `f` of the sphere. -/ -noncomputable def spherePullback {n : ℕ} (f : C(Sphere n, Sphere n)) (k : ℕ) : +@[expose] noncomputable def spherePullback {n : ℕ} (f : C(Sphere n, Sphere n)) (k : ℕ) : sphereCohomology n k ⟶ sphereCohomology n k := (singularCohomologyZMod2 k).map (TopCat.ofHom f).op diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/IteratedSubdivisionHomotopySmall.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/IteratedSubdivisionHomotopySmall.lean index be202404f4..c33f3ee08e 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/IteratedSubdivisionHomotopySmall.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/IteratedSubdivisionHomotopySmall.lean @@ -74,7 +74,7 @@ of the small boundary `z`), which is exactly what the project require; we do not state the (false) claim that `H^(N)(c)` is small for arbitrary `c`. -/ -@[expose] public section +public section open scoped BigOperators open CategoryTheory AlgebraicTopology Limits diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/IteratedSubdivisionSmallChains.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/IteratedSubdivisionSmallChains.lean index 76253ba468..b5250c4579 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/IteratedSubdivisionSmallChains.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/IteratedSubdivisionSmallChains.lean @@ -11,7 +11,7 @@ public import Mathlib.Tactic /-! # Iterated Subdivision Small Chains -/ -@[expose] public section +public section open scoped BigOperators open CategoryTheory AlgebraicTopology Limits diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/IteratedSubdivisionSmallSimplex.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/IteratedSubdivisionSmallSimplex.lean index 7f4be8fc5b..f793640c2f 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/IteratedSubdivisionSmallSimplex.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/IteratedSubdivisionSmallSimplex.lean @@ -47,7 +47,7 @@ and the whole chain to lie in the small-chain submodule. `sdᴺ([σ])` lies in `smallChainSubmodule`. -/ -@[expose] public section +public section open scoped BigOperators open CategoryTheory AlgebraicTopology Finset @@ -62,7 +62,7 @@ namespace AffineBarycentricSubdivision /-- The affine subdivision map associated to a permutation `π`, packaged as a genuine `ℝ`-linear self-map of `Fin (n+1) → ℝ`. On the standard simplex it restricts to `affineSubdivMap n π`. -/ -noncomputable def affineSubdivLinear (n : ℕ) (π : Equiv.Perm (Fin (n + 1))) : +@[expose] noncomputable def affineSubdivLinear (n : ℕ) (π : Equiv.Perm (Fin (n + 1))) : (Fin (n + 1) → ℝ) →ₗ[ℝ] (Fin (n + 1) → ℝ) where toFun x := fun j => ∑ k : Fin (n + 1), x k * (prefixBarycenter n π k).val j map_add' := by @@ -120,7 +120,7 @@ theorem affineSubdivLinear_stdVerts (n : ℕ) (π : Equiv.Perm (Fin (n + 1))) exact congr_fun ( prefixBarycenter_val_eq_stepVertices n π k ) j /-- Compose the barycentric subdivision linear maps selected by a permutation word. -/ -noncomputable def affineCompLinear (n : ℕ) : +@[expose] noncomputable def affineCompLinear (n : ℕ) : (N : ℕ) → (Fin N → Equiv.Perm (Fin (n + 1))) → ((Fin (n + 1) → ℝ) →ₗ[ℝ] (Fin (n + 1) → ℝ)) | 0, _ => LinearMap.id @@ -153,7 +153,7 @@ theorem affineCompLinear_stdVerts (n N : ℕ) (ρs : Fin N → Equiv.Perm (Fin ( simp_rw [ih] /-- The continuous simplex self-map associated with an iterated subdivision word. -/ -noncomputable def affineCompMap (n : ℕ) : +@[expose] noncomputable def affineCompMap (n : ℕ) : (N : ℕ) → (Fin N → Equiv.Perm (Fin (n + 1))) → C(Delta n, Delta n) | 0, _ => ContinuousMap.id _ | (N + 1), ρs => diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/KroneckerNaturality.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/KroneckerNaturality.lean index 6d1297ab1c..d098c92896 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/KroneckerNaturality.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/KroneckerNaturality.lean @@ -39,7 +39,7 @@ degree-`n` universal coefficient theorem over `F₂` for the library's own singu * `kroneckerEquiv X n` — the universal coefficient isomorphism over `F₂`. -/ -@[expose] public section +public section open CategoryTheory AlgebraicTopology Limits @@ -61,7 +61,7 @@ noncomputable def homologyPushZMod2 (f : X ⟶ Y) (n : ℕ) : /-- The dual / precomposition map `Hom(Hₙ(Y; F₂), F₂) ⟶ Hom(Hₙ(X; F₂), F₂)` of the homology pushforward. -/ -noncomputable def homologyDualMap (f : X ⟶ Y) (n : ℕ) : +@[expose] noncomputable def homologyDualMap (f : X ⟶ Y) (n : ℕ) : homologyDualZMod2 Y n ⟶ homologyDualZMod2 X n := ModuleCat.ofHom (LinearMap.lcomp (ZMod 2) (ZMod 2) (homologyPushZMod2 f n).hom) diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/MayerVietoris.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/MayerVietoris.lean index b49ddce4d1..0776763a2a 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/MayerVietoris.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/MayerVietoris.lean @@ -53,7 +53,7 @@ small-chain homology `H_*(C_*^{U,V}(X))` by the singular homology `H_*(X)`. H_n(U ∩ V)`, the sphere-ready corollary. -/ -@[expose] public section +public section open CategoryTheory Limits TopologicalSpace ShortComplex open SphereOddDegree.AffineBarycentricSubdivision diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/MayerVietorisSES.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/MayerVietorisSES.lean index 16d7b56e87..d7b09d66b9 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/MayerVietorisSES.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/MayerVietorisSES.lean @@ -15,7 +15,7 @@ public import LeanPool.NandakumarRamanaRao.NRR.OddSphereDegree.AlgebraicTopology /-! # Mayer Vietoris SES -/ -@[expose] public section +public section open CategoryTheory AlgebraicTopology Limits TopologicalSpace open SphereOddDegree.AffineBarycentricSubdivision @@ -52,20 +52,20 @@ theorem twoSetCover_memV (U V : Opens X) (hUV : U ⊔ V = ⊤) : open Classical in /-- The chain complex generated by simplices small for the two-set open cover. -/ -noncomputable def twoOpenCoverSmallChains (R : Type) [CommRing R] +@[expose] noncomputable def twoOpenCoverSmallChains (R : Type) [CommRing R] {X : TopCat.{0}} (U V : Opens X) (hUV : U ⊔ V = ⊤) : ChainComplex (ModuleCat.{0} R) ℕ := smallChainComplex R X (twoSetCover U V hUV) open Classical in /-- Include chains supported in the intersection into chains supported in the first open set. -/ -noncomputable def mvInclUVU (U V : Opens X) : +@[expose] noncomputable def mvInclUVU (U V : Opens X) : subChainComplex R X ((U : Set X) ∩ (V : Set X)) ⟶ subChainComplex R X (U : Set X) := subChainInclusion _ _ Set.inter_subset_left open Classical in /-- Include chains supported in the intersection into chains supported in the second open set. -/ -noncomputable def mvInclUVV (U V : Opens X) : +@[expose] noncomputable def mvInclUVV (U V : Opens X) : subChainComplex R X ((U : Set X) ∩ (V : Set X)) ⟶ subChainComplex R X (V : Set X) := subChainInclusion _ _ Set.inter_subset_right @@ -95,7 +95,7 @@ theorem mvIncl_comp_eq (U V : Opens X) (hUV : U ⊔ V = ⊤) : open Classical in /-- The signed pair of inclusions from the intersection into the two open sets. -/ -noncomputable def mvLeftChainMap (U V : Opens X) : +@[expose] noncomputable def mvLeftChainMap (U V : Opens X) : subChainComplex R X ((U : Set X) ∩ (V : Set X)) ⟶ subChainComplex R X (U : Set X) ⊞ subChainComplex R X (V : Set X) := biprod.lift (mvInclUVU R U V) (-(mvInclUVV R U V)) @@ -115,7 +115,7 @@ theorem mvLeft_comp_mvRight (U V : Opens X) (hUV : U ⊔ V = ⊤) : open Classical in /-- The Mayer–Vietoris short complex of intersection, component, and small chains. -/ -noncomputable def mvShortComplex (U V : Opens X) (hUV : U ⊔ V = ⊤) : +@[expose] noncomputable def mvShortComplex (U V : Opens X) (hUV : U ⊔ V = ⊤) : ShortComplex (ChainComplex (ModuleCat.{0} R) ℕ) where X₁ := subChainComplex R X ((U : Set X) ∩ (V : Set X)) X₂ := subChainComplex R X (U : Set X) ⊞ subChainComplex R X (V : Set X) @@ -183,6 +183,7 @@ theorem keepHom_V_mem_UV (U V : Opens X) (k : ℕ) open Classical in /-- Restrict a generator-retaining projection to specified source and target submodules. -/ +@[expose] noncomputable def restrictKeep {n : ℕ} (P : singularSimplices X n → Prop) [DecidablePred P] (p q : Submodule R (singularChainGroup R X n)) (hmaps : ∀ c ∈ p, (keepHom R X P).hom c ∈ q) : diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/PermSignAdjacentSwap.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/PermSignAdjacentSwap.lean index 38b56259c5..bf1dbb0ee0 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/PermSignAdjacentSwap.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/PermSignAdjacentSwap.lean @@ -21,7 +21,7 @@ coefficient-ring sign convention used by `permSignCoeff` in `BarycentricSubdivisionOperator.lean`. -/ -@[expose] public section +public section namespace SphereOddDegree namespace AffineBarycentricSubdivision diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/PermSignLastFaceFinished.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/PermSignLastFaceFinished.lean index 8f5b48086c..f570f1bda1 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/PermSignLastFaceFinished.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/PermSignLastFaceFinished.lean @@ -35,7 +35,7 @@ then proves This module proves the permutation-sign identity used by the boundary-chain theorem. -/ -@[expose] public section +public section open scoped BigOperators open Equiv Equiv.Perm @@ -44,7 +44,7 @@ namespace SphereOddDegree namespace AffineBarycentricSubdivision /-- The last vertex of `Fin (n+2)`. -/ -def lastVertex (n : ℕ) : Fin (n + 2) := +@[expose] def lastVertex (n : ℕ) : Fin (n + 2) := ⟨n + 1, by omega⟩ @[simp] theorem lastVertex_val (n : ℕ) : (lastVertex n).val = n + 1 := rfl @@ -54,7 +54,7 @@ def lastVertex (n : ℕ) : Fin (n + 2) := This uses Mathlib's `viaFintypeEmbedding`, so its sign is exactly the sign of `ρ`. -/ -noncomputable def extendLastPerm {n : ℕ} +@[expose] noncomputable def extendLastPerm {n : ℕ} (ρ : Equiv.Perm (Fin (n + 1))) : Equiv.Perm (Fin (n + 2)) := ρ.viaFintypeEmbedding (Fin.castSuccOrderEmb.toEmbedding) diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/PrismOperator.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/PrismOperator.lean index 10f6cff38a..b90572df15 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/PrismOperator.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/PrismOperator.lean @@ -22,7 +22,7 @@ construction to the algebraic simplicial-homotopy and chain-homotopy machinery used by the singular-homology homotopy-invariance proof. -/ -@[expose] public section +public section open CategoryTheory Limits AlgebraicTopology Simplicial namespace SphereOddDegree @@ -51,7 +51,7 @@ noncomputable def edge : Δ[1] ⟶ TopCat.toSSet.obj unitI := ((unitI.toSSetObjEquiv (Opposite.op (SimplexCategory.mk 1))).symm edgeCM) /-- The const-valued simplicial map onto the `j`-th vertex of `Δ[1]`. -/ -noncomputable def vtx (Z : SSet.{0}) (j : Fin 2) : Z ⟶ Δ[1] := +@[expose] noncomputable def vtx (Z : SSet.{0}) (j : Fin 2) : Z ⟶ Δ[1] := SSet.const (SSet.stdSimplex.obj₀Equiv.symm j) /-- A `ContinuousMap.Homotopy` between `f.hom` and `g.hom`, repackaged as a @@ -78,7 +78,7 @@ noncomputable def cylinder {X Y : TopCat.{0}} {f g : X ⟶ Y} TopCat.toSSet.map (homotopyMap H) /-- The `j`-th endpoint section `Sing X ⟶ Sing X × Δ[1]`. -/ -noncomputable def sect (X : TopCat.{0}) (j : Fin 2) : +@[expose] noncomputable def sect (X : TopCat.{0}) (j : Fin 2) : TopCat.toSSet.obj X ⟶ TopCat.toSSet.obj X ⨯ Δ[1] := Limits.prod.lift (𝟙 (TopCat.toSSet.obj X)) (vtx (TopCat.toSSet.obj X) j) diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SingularCohomology.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SingularCohomology.lean index fe19791fc4..df853195a9 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SingularCohomology.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SingularCohomology.lean @@ -78,7 +78,7 @@ coefficient theorem, any cohomology computation, or the cup product; those remai downstream work. -/ -@[expose] public section +public section open CategoryTheory AlgebraicTopology @@ -92,7 +92,7 @@ It sends a space `X` (as an object of `TopCatᵒᵖ`) to the cochain complex map in the opposite direction. The codomain `CochainComplex (ModuleCat R) ℕ` is definitionally `HomologicalComplex (ModuleCat R) (ComplexShape.down ℕ).symm`, since `(ComplexShape.down ℕ).symm = ComplexShape.up ℕ`. -/ -noncomputable def singularCochainComplexFunctor (R : Type) [CommRing R] +@[expose] noncomputable def singularCochainComplexFunctor (R : Type) [CommRing R] (M : ModuleCat.{0} R) : TopCat.{0}ᵒᵖ ⥤ CochainComplex (ModuleCat.{0} R) ℕ := ((singularChainComplexFunctor (ModuleCat.{0} R)).obj M).op @@ -106,7 +106,7 @@ homology of the singular cochain complex `Hom(C_•(X), M)`. Contravariance in the space is structural: a continuous map `f` induces the pullback `f^* : Hⁿ(Y; M) → Hⁿ(X; M)` via the functor's action on `(TopCat.ofHom f).op`. -/ -noncomputable def singularCohomologyFunctor (R : Type) [CommRing R] +@[expose] noncomputable def singularCohomologyFunctor (R : Type) [CommRing R] (M : ModuleCat.{0} R) (n : ℕ) : TopCat.{0}ᵒᵖ ⥤ ModuleCat.{0} R := singularCochainComplexFunctor R M ⋙ HomologicalComplex.homologyFunctor _ _ n diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SingularCohomologyHomotopyInvariance.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SingularCohomologyHomotopyInvariance.lean index 379475ac7e..4a202a1fac 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SingularCohomologyHomotopyInvariance.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SingularCohomologyHomotopyInvariance.lean @@ -53,7 +53,7 @@ topological homotopy ──singularChainHomotopyOfHomotopyModule──▶ chain ``` -/ -@[expose] public section +public section open CategoryTheory AlgebraicTopology HomologicalComplex Opposite Limits diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SingularH0.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SingularH0.lean index 29c581c064..fd309d93b7 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SingularH0.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SingularH0.lean @@ -12,7 +12,7 @@ public import LeanPool.NandakumarRamanaRao.NRR.OddSphereDegree.AlgebraicTopology /-! # Singular H0 -/ -@[expose] public section +public section open CategoryTheory AlgebraicTopology Limits open SphereOddDegree diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SingularH0PathConnected.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SingularH0PathConnected.lean index 12a5798fed..391fdaeac4 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SingularH0PathConnected.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SingularH0PathConnected.lean @@ -15,7 +15,7 @@ public import Mathlib.Tactic /-! # Singular H0Path Connected -/ -@[expose] public section +public section open CategoryTheory AlgebraicTopology Limits open SphereOddDegree @@ -33,7 +33,7 @@ theorem aug_comp_boundary_eq_zero (Y : TopCat.{0}) : exact aug_boundary c /-- The augmentation induced on zeroth singular homology. -/ -def H0aug (Y : TopCat.{0}) : (singularChainComplex ℤ Y).homology 0 ⟶ ModuleCat.of ℤ ℤ := +@[expose] def H0aug (Y : TopCat.{0}) : (singularChainComplex ℤ Y).homology 0 ⟶ ModuleCat.of ℤ ℤ := (singularChainComplex ℤ Y).homologyι 0 ≫ (singularChainComplex ℤ Y).descOpcycles (aug Y) 1 prev_zero (aug_comp_boundary_eq_zero Y) @@ -157,7 +157,7 @@ theorem surjective_H0aug (Y : TopCat.{0}) [Nonempty ↑Y] : erw [ModuleCat.hom_comp, LinearMap.comp_apply, hx, h_eval] /-- The zeroth-homology augmentation for chains supported in a subset. -/ -def subH0aug (X : TopCat.{0}) (S : Set X) : +@[expose] def subH0aug (X : TopCat.{0}) (S : Set X) : (subChainComplex ℤ X S).homology 0 ⟶ ModuleCat.of ℤ ℤ := (subspaceHomologyIso S 0).hom ≫ H0aug (TopCat.of S) diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SingularHomologyFunctorAPI.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SingularHomologyFunctorAPI.lean index a397bde669..833d0991ab 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SingularHomologyFunctorAPI.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SingularHomologyFunctorAPI.lean @@ -45,7 +45,7 @@ defined in `HomotopyToChainHomotopy.lean`. `HomotopyToChainHomotopy.lean`). -/ -@[expose] public section +public section open CategoryTheory AlgebraicTopology diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SingularHomologyHomotopyInvariance.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SingularHomologyHomotopyInvariance.lean index 9e1291dbd4..455240d1e3 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SingularHomologyHomotopyInvariance.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SingularHomologyHomotopyInvariance.lean @@ -28,7 +28,7 @@ Integer coefficients (`ModuleCat.{0} ℤ`), the case relevant to the topological degree of sphere maps. -/ -@[expose] public section +public section open CategoryTheory AlgebraicTopology diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SingularSimplexLebesgueNumber.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SingularSimplexLebesgueNumber.lean index 67c71be789..e5b486e004 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SingularSimplexLebesgueNumber.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SingularSimplexLebesgueNumber.lean @@ -33,7 +33,7 @@ diameter-shrinking theorem of the project: once a refined affine simplex has domain diameter `< ε`, its image under `σ` lies in some `U ∈ 𝒰`. -/ -@[expose] public section +public section open CategoryTheory AlgebraicTopology open SphereOddDegree.AffineBarycentricSubdivision diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SmallChainComplex.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SmallChainComplex.lean index d7fea859c6..44c6831f2a 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SmallChainComplex.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SmallChainComplex.lean @@ -51,7 +51,7 @@ C_*^𝒰(X; R) ⟶ C_*(X; R). We do **not** prove here that `smallChainsInclusion` is a quasi-isomorphism. -/ -@[expose] public section +public section open CategoryTheory AlgebraicTopology open SphereOddDegree.AffineBarycentricSubdivision @@ -65,7 +65,7 @@ variable {R : Type} [CommRing R] {X : TopCat.{0}} /-- The restriction of the singular boundary `∂ : C_{n+1}(X; R) → C_n(X; R)` to the small-chain submodules. Well-defined by `singularBoundary_maps_smallChainSubmodule`. -/ -noncomputable def smallBoundary (R : Type) [CommRing R] (X : TopCat.{0}) +@[expose] noncomputable def smallBoundary (R : Type) [CommRing R] (X : TopCat.{0}) (𝒰 : OpenCoverData X) (n : ℕ) : ModuleCat.of R (smallChainSubmodule R X 𝒰 (n + 1)) ⟶ ModuleCat.of R (smallChainSubmodule R X 𝒰 n) := @@ -98,7 +98,7 @@ theorem smallBoundary_comp_smallBoundary /-- **The small-chain complex** `C_*^𝒰(X; R)`. In degree `n` the object is the small-chain submodule `smallChainSubmodule R X 𝒰 n`; the differential is the restricted singular boundary `smallBoundary`. -/ -noncomputable def smallChainComplex (R : Type) [CommRing R] (X : TopCat.{0}) +@[expose] noncomputable def smallChainComplex (R : Type) [CommRing R] (X : TopCat.{0}) (𝒰 : OpenCoverData X) : ChainComplex (ModuleCat.{0} R) ℕ := ChainComplex.of (fun n => ModuleCat.of R (smallChainSubmodule R X 𝒰 n)) (fun n => smallBoundary R X 𝒰 n) @@ -120,7 +120,7 @@ noncomputable def smallChainComplex (R : Type) [CommRing R] (X : TopCat.{0}) /-- The small generator associated to a `𝒰`-small singular simplex `σ`, as an element of the degree-`n` small-chain submodule. -/ -noncomputable def smallGenerator {𝒰 : OpenCoverData X} {n : ℕ} +@[expose] noncomputable def smallGenerator {𝒰 : OpenCoverData X} {n : ℕ} (σ : singularSimplices X n) (hσ : IsSmallSimplex 𝒰 σ) : smallChainSubmodule R X 𝒰 n := ⟨chainGenerator R X n σ, chainGenerator_mem_smallChainSubmodule hσ⟩ @@ -134,7 +134,7 @@ noncomputable def smallGenerator {𝒰 : OpenCoverData X} {n : ℕ} /-- **The inclusion chain map** `C_*^𝒰(X; R) ⟶ C_*(X; R)`. Degreewise it is the natural inclusion of the small-chain submodule into the singular chain group. -/ -noncomputable def smallChainsInclusion (R : Type) [CommRing R] (X : TopCat.{0}) +@[expose] noncomputable def smallChainsInclusion (R : Type) [CommRing R] (X : TopCat.{0}) (𝒰 : OpenCoverData X) : smallChainComplex R X 𝒰 ⟶ singularChainComplex R X where f n := ModuleCat.ofHom (smallChainSubmodule R X 𝒰 n).subtype comm' i j hij := by diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SmallChains.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SmallChains.lean index 996f5bf127..d32db446e9 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SmallChains.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SmallChains.lean @@ -38,7 +38,7 @@ are exactly what is needed to assemble the small singular chains into a subcomplex of the singular chain complex. -/ -@[expose] public section +public section open CategoryTheory AlgebraicTopology open SphereOddDegree.AffineBarycentricSubdivision @@ -51,7 +51,7 @@ variable {R : Type} [CommRing R] {X : TopCat.{0}} /-- The `R`-submodule `C_n^𝒰(X; R) ⊆ C_n(X; R)` of singular chains generated by the basis chains `chainGenerator R X n σ` for `𝒰`-small singular simplices `σ`. -/ -noncomputable def smallChainSubmodule +@[expose] noncomputable def smallChainSubmodule (R : Type) [CommRing R] (X : TopCat.{0}) (𝒰 : OpenCoverData X) (n : ℕ) : Submodule R (singularChainGroup R X n) := diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SmallChainsHomologyInjectivity.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SmallChainsHomologyInjectivity.lean index 683bdfcf87..641501b006 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SmallChainsHomologyInjectivity.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SmallChainsHomologyInjectivity.lean @@ -14,7 +14,7 @@ public import LeanPool.NandakumarRamanaRao.NRR.OddSphereDegree.AlgebraicTopology public import LeanPool.NandakumarRamanaRao.NRR.OddSphereDegree.AlgebraicTopology.SmallChainsHomologySurjectivity /-! # Small Chains Homology Injectivity -/ -@[expose] public section +public section open CategoryTheory Limits AlgebraicTopology open SphereOddDegree.AffineBarycentricSubdivision diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SmallChainsHomologySurjectivity.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SmallChainsHomologySurjectivity.lean index f3c6cb1507..12fb5e1d37 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SmallChainsHomologySurjectivity.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SmallChainsHomologySurjectivity.lean @@ -15,7 +15,7 @@ public import LeanPool.NandakumarRamanaRao.NRR.OddSphereDegree.AlgebraicTopology /-! # Small Chains Homology Surjectivity -/ -@[expose] public section +public section open CategoryTheory AlgebraicTopology open SphereOddDegree.AffineBarycentricSubdivision @@ -25,7 +25,7 @@ namespace SphereOddDegree variable {R : Type} [CommRing R] {X : TopCat.{0}} /-- The induced map on degree-`n` homology of a chain map, packaged as a function on the underlying homology modules. -/ -noncomputable def homologyMapInDegree {K L : ChainComplex (ModuleCat.{0} R) ℕ} +@[expose] noncomputable def homologyMapInDegree {K L : ChainComplex (ModuleCat.{0} R) ℕ} (f : K ⟶ L) (n : ℕ) : K.homology n → L.homology n := ⇑(HomologicalComplex.homologyMap f n).hom diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SmallChainsQuasiIso.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SmallChainsQuasiIso.lean index 29832d0c1a..6421d0a601 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SmallChainsQuasiIso.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SmallChainsQuasiIso.lean @@ -44,7 +44,7 @@ an isomorphism of `ModuleCat`-modules, hence the chain map is a quasi-isomorphis theorem**: `smallChainsInclusion R X 𝒰` is a quasi-isomorphism. -/ -@[expose] public section +public section open CategoryTheory AlgebraicTopology open SphereOddDegree.AffineBarycentricSubdivision diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SmallSimplices.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SmallSimplices.lean index 19b3d0adaa..99120ed937 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SmallSimplices.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SmallSimplices.lean @@ -42,7 +42,7 @@ This file deliberately does **not** prove smallness of barycentric subdivision; that belongs to downstream modules. -/ -@[expose] public section +public section open CategoryTheory AlgebraicTopology open SphereOddDegree.AffineBarycentricSubdivision @@ -72,7 +72,7 @@ noncomputable abbrev mvSimplexMap {X : TopCat.{0}} {n : ℕ} (σ : singularSimpl /-- A singular `n`-simplex `σ` is **small** with respect to an open cover `𝒰` if its image is contained in one of the open sets of the cover. -/ -def IsSmallSimplex {X : TopCat.{0}} (𝒰 : OpenCoverData X) {n : ℕ} +@[expose] def IsSmallSimplex {X : TopCat.{0}} (𝒰 : OpenCoverData X) {n : ℕ} (σ : singularSimplices X n) : Prop := ∃ U ∈ 𝒰.sets, Set.range (mvSimplexMap σ) ⊆ U diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SphereHomologyMVStep.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SphereHomologyMVStep.lean index 9faea4708a..39c905c04b 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SphereHomologyMVStep.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SphereHomologyMVStep.lean @@ -25,7 +25,7 @@ positive homology vanishes, and the Mayer–Vietoris connecting isomorphism `Hₙ(Sⁿ)`. -/ -@[expose] public section +public section open CategoryTheory AlgebraicTopology Limits Metric open SphereOddDegree.AffineBarycentricSubdivision @@ -63,10 +63,10 @@ theorem northPole_ne_southPole : northPole n ≠ southPole n := by norm_num at hnorm /-- The upper punctured sphere `Sⁿ⁺¹ \ {north}`. -/ -def upperPunctured : Set (Sphere (n + 1)) := {northPole n}ᶜ +@[expose] def upperPunctured : Set (Sphere (n + 1)) := {northPole n}ᶜ /-- The lower punctured sphere `Sⁿ⁺¹ \ {south}`. -/ -def lowerPunctured : Set (Sphere (n + 1)) := {southPole n}ᶜ +@[expose] def lowerPunctured : Set (Sphere (n + 1)) := {southPole n}ᶜ theorem isOpen_upperPunctured : IsOpen (upperPunctured n) := isOpen_compl_singleton @@ -82,7 +82,7 @@ theorem upper_union_lower : upperPunctured n ∪ lowerPunctured n = Set.univ := exact northPole_ne_southPole n (hx1 ▸ hx2) /-- The equatorial band `Sⁿ⁺¹ \ {north, south}`. -/ -def sphereBand : Set (Sphere (n + 1)) := upperPunctured n ∩ lowerPunctured n +@[expose] def sphereBand : Set (Sphere (n + 1)) := upperPunctured n ∩ lowerPunctured n /-! ## Contractibility of the punctured spheres -/ @@ -381,11 +381,11 @@ def sphereBandHomotopyEquiv : ContinuousMap.HomotopyEquiv (sphereBand n) (Sphere abbrev sphereSpace : TopCat.{0} := TopCat.of (Sphere (n + 1)) /-- The upper punctured sphere as an open set of `Sⁿ⁺¹`. -/ -def upperOpens : TopologicalSpace.Opens (sphereSpace n) := +@[expose] def upperOpens : TopologicalSpace.Opens (sphereSpace n) := ⟨upperPunctured n, isOpen_upperPunctured n⟩ /-- The lower punctured sphere as an open set of `Sⁿ⁺¹`. -/ -def lowerOpens : TopologicalSpace.Opens (sphereSpace n) := +@[expose] def lowerOpens : TopologicalSpace.Opens (sphereSpace n) := ⟨lowerPunctured n, isOpen_lowerPunctured n⟩ instance contractible_upperOpens : diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SphereHomologyS1BaseMV.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SphereHomologyS1BaseMV.lean index aab01dc2ff..333cca8d2b 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SphereHomologyS1BaseMV.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SphereHomologyS1BaseMV.lean @@ -41,7 +41,7 @@ The result `sphereTopHomologyIsoOne : SphereTopHomologyIso 1` supplies the `base` field of `SphereSuspensionTower`. -/ -@[expose] public section +public section open CategoryTheory AlgebraicTopology Limits TopologicalSpace open SphereOddDegree.AffineBarycentricSubdivision diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SphereOrientationPosFromMV.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SphereOrientationPosFromMV.lean index eb6e1f1663..21c4aa5d54 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SphereOrientationPosFromMV.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SphereOrientationPosFromMV.lean @@ -33,7 +33,7 @@ positive-dimensional `SphereOrientationPos`. The construction is assembled from the Mayer–Vietoris results. -/ -@[expose] public section +public section noncomputable section @@ -45,7 +45,7 @@ This is the stable export of the Branch 1 construction: a genuine, non-vacuous `SphereOrientationPos` built entirely from the unconditional Mayer–Vietoris suspension tower `sphereSuspensionTowerFromMV` (no Branch 1 hypothesis is assumed). -/ -def sphereOrientationPosUnconditional : SphereOrientationPos := +@[expose] def sphereOrientationPosUnconditional : SphereOrientationPos := sphereOrientationPosFromMV /-- The unconditional positive-dimensional orientation agrees with the @@ -56,13 +56,13 @@ theorem sphereOrientationPos_unconditional_eq : /-- **Stable projection.** The integral top-homology identification `Hₙ(Sⁿ; ℤ) ≅ ℤ` for every dimension `n ≥ 1`, read off the unconditional positive-dimensional orientation. -/ -def sphereTopHomologyIsoUnconditional (n : ℕ) (hn : 1 ≤ n) : +@[expose] def sphereTopHomologyIsoUnconditional (n : ℕ) (hn : 1 ≤ n) : SphereTopHomologyIso n := sphereOrientationPosUnconditional.iso n hn /-- Alias for `sphereTopHomologyIsoUnconditional`: the positive-dimensional top-homology identification `Hₙ(Sⁿ; ℤ) ≅ ℤ` (`n ≥ 1`). -/ -def sphereTopHomologyIsoOfPos (n : ℕ) (hn : 1 ≤ n) : +@[expose] def sphereTopHomologyIsoOfPos (n : ℕ) (hn : 1 ≤ n) : SphereTopHomologyIso n := sphereTopHomologyIsoUnconditional n hn diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SphereSuspensionTowerFromMV.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SphereSuspensionTowerFromMV.lean index 9405c27c05..93d9fdd74a 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SphereSuspensionTowerFromMV.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SphereSuspensionTowerFromMV.lean @@ -29,7 +29,7 @@ import this file and use `sphereSuspensionTowerFromMV` (or its aliases) to obtai the full positive-dimensional sphere top-homology family and orientation data. -/ -@[expose] public section +public section open CategoryTheory diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SubChainSubspaceBridge.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SubChainSubspaceBridge.lean index 1f648352c6..21c51587c0 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SubChainSubspaceBridge.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SubChainSubspaceBridge.lean @@ -12,7 +12,7 @@ public import LeanPool.NandakumarRamanaRao.NRR.OddSphereDegree.BallBoundaryLES /-! # Sub Chain Subspace Bridge -/ -@[expose] public section +public section open scoped BigOperators open CategoryTheory AlgebraicTopology Simplicial SimplexCategory Limits open SphereOddDegree.AffineBarycentricSubdivision @@ -24,7 +24,7 @@ namespace SphereOddDegree variable {R : Type} [CommRing R] {X : TopCat.{0}} /-- The continuous inclusion of a subspace into the ambient space. -/ -def sInclusion (S : Set X) : TopCat.of S ⟶ X := +@[expose] def sInclusion (S : Set X) : TopCat.of S ⟶ X := TopCat.ofHom ⟨Subtype.val, continuous_subtype_val⟩ @[simp] theorem sInclusion_hom_apply (S : Set X) (x : S) : @@ -82,7 +82,7 @@ theorem singularChainMap_sInclusion_mem (S : Set X) (n : ℕ) exact hc /-- Corestrict the subspace singular-chain map to the subcomplex of supported chains. -/ -def subChainCorestrict (R : Type) [CommRing R] (X : TopCat.{0}) (S : Set X) : +@[expose] def subChainCorestrict (R : Type) [CommRing R] (X : TopCat.{0}) (S : Set X) : ((singularChainComplexFunctor (ModuleCat.{0} R)).obj (ModuleCat.of R R)).obj (TopCat.of S) ⟶ subChainComplex R X S where f n := ModuleCat.ofHom @@ -186,14 +186,14 @@ instance subChainCorestrict_isIso (S : Set X) : HomologicalComplex.Hom.isIso_of_components _ /-- Identify homology of supported chains with singular homology of the subspace. -/ -def subspaceHomologyIso (S : Set X) (n : ℕ) : +@[expose] def subspaceHomologyIso (S : Set X) (n : ℕ) : (subChainComplex R X S).homology n ≅ (((singularChainComplexFunctor (ModuleCat.{0} R)).obj (ModuleCat.of R R)).obj (TopCat.of S)).homology n := ((HomologicalComplex.homologyFunctor _ _ n).mapIso (asIso (subChainCorestrict R X S))).symm /-- The subspace homology identification with integer coefficients. -/ -def subspaceHomologyIsoℤ (X : TopCat.{0}) (S : Set X) (n : ℕ) : +@[expose] def subspaceHomologyIsoℤ (X : TopCat.{0}) (S : Set X) (n : ℕ) : (subChainComplex ℤ X S).homology n ≅ (singularHomologyℤ n).obj (TopCat.of S) := subspaceHomologyIso S n diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SubordinateChains.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SubordinateChains.lean index bc8a4a255f..e5a3cf635b 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SubordinateChains.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AlgebraicTopology/SubordinateChains.lean @@ -32,7 +32,7 @@ and `subChainComplex R X (↑U ∩ ↑V)` are the singular chains supported in ` `V` and `U ∩ V` respectively. -/ -@[expose] public section +public section open CategoryTheory AlgebraicTopology open SphereOddDegree.AffineBarycentricSubdivision @@ -45,7 +45,7 @@ variable {R : Type} [CommRing R] {X : TopCat.{0}} /-- A singular `n`-simplex `σ` is **subordinate to** the subset `S ⊆ X` if its image is contained in `S`. -/ -def IsSubordinate (S : Set X) {n : ℕ} (σ : singularSimplices X n) : Prop := +@[expose] def IsSubordinate (S : Set X) {n : ℕ} (σ : singularSimplices X n) : Prop := Set.range (mvSimplexMap σ) ⊆ S /-- Subordination is monotone in the set. -/ @@ -83,7 +83,7 @@ theorem IsSubordinate.isSmallSimplex {𝒰 : OpenCoverData X} {S : Set X} /-- The `R`-submodule `C_n^S(X; R) ⊆ C_n(X; R)` of singular chains generated by the basis chains `chainGenerator R X n σ` for simplices `σ` subordinate to `S`. -/ -noncomputable def subChainSubmodule +@[expose] noncomputable def subChainSubmodule (R : Type) [CommRing R] (X : TopCat.{0}) (S : Set X) (n : ℕ) : Submodule R (singularChainGroup R X n) := Submodule.span R @@ -154,7 +154,7 @@ theorem singularBoundary_maps_subChainSubmodule /-- The restriction of the singular boundary to the subordinate-chain submodules. -/ -noncomputable def subBoundary (R : Type) [CommRing R] (X : TopCat.{0}) +@[expose] noncomputable def subBoundary (R : Type) [CommRing R] (X : TopCat.{0}) (S : Set X) (n : ℕ) : ModuleCat.of R (subChainSubmodule R X S (n + 1)) ⟶ ModuleCat.of R (subChainSubmodule R X S n) := @@ -182,7 +182,7 @@ theorem subBoundary_comp_subBoundary exact happ /-- **The subordinate-chain complex** `C_*^S(X; R)`. -/ -noncomputable def subChainComplex (R : Type) [CommRing R] (X : TopCat.{0}) +@[expose] noncomputable def subChainComplex (R : Type) [CommRing R] (X : TopCat.{0}) (S : Set X) : ChainComplex (ModuleCat.{0} R) ℕ := ChainComplex.of (fun n => ModuleCat.of R (subChainSubmodule R X S n)) (fun n => subBoundary R X S n) @@ -203,7 +203,7 @@ noncomputable def subChainComplex (R : Type) [CommRing R] (X : TopCat.{0}) /-! ## 5. Inclusion chain maps -/ /-- The inclusion chain map `C_*^S(X; R) ⟶ C_*^T(X; R)` for `S ⊆ T`. -/ -noncomputable def subChainInclusion (S T : Set X) (h : S ⊆ T) : +@[expose] noncomputable def subChainInclusion (S T : Set X) (h : S ⊆ T) : subChainComplex R X S ⟶ subChainComplex R X T where f n := ModuleCat.ofHom (Submodule.inclusion (subChainSubmodule_mono h n)) comm' i j hij := by @@ -221,7 +221,7 @@ theorem subChainInclusion_f_apply /-- The inclusion chain map `C_*^S(X; R) ⟶ C_*^𝒰(X; R)` of the subordinate chains for a cover member `S` into the small-chain complex. -/ -noncomputable def subChainToSmall (𝒰 : OpenCoverData X) (S : Set X) (hS : S ∈ 𝒰.sets) : +@[expose] noncomputable def subChainToSmall (𝒰 : OpenCoverData X) (S : Set X) (hS : S ∈ 𝒰.sets) : subChainComplex R X S ⟶ smallChainComplex R X 𝒰 where f n := ModuleCat.ofHom (Submodule.inclusion (subChainSubmodule_le_smallChainSubmodule hS n)) comm' i j hij := by diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/Antipodal.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/Antipodal.lean index b5b4f6ce43..8276caf6e8 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/Antipodal.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/Antipodal.lean @@ -23,14 +23,14 @@ belong to the topological-degree support layer, not the point-set foundation) live in `Degree.lean`. -/ -@[expose] public section +public section noncomputable section namespace SphereOddDegree /-- The antipodal map on `S^n`, bundled as a continuous self-map. -/ -def antipodal (n : ℕ) : C(Sphere n, Sphere n) where +@[expose] def antipodal (n : ℕ) : C(Sphere n, Sphere n) where toFun := fun x => -x continuous_toFun := continuous_neg @@ -70,7 +70,7 @@ theorem antipodal_comp_antipodal (n : ℕ) : /-- The antipodal map as a self-homeomorphism of the sphere. It is its own inverse, since the antipodal map is an involution. -/ -def antipodalHomeomorph (n : ℕ) : Sphere n ≃ₜ Sphere n where +@[expose] def antipodalHomeomorph (n : ℕ) : Sphere n ≃ₜ Sphere n where toFun := antipodal n invFun := antipodal n left_inv := antipodal_involutive n diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AntipodalDegree.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AntipodalDegree.lean index 061512753a..7d02eb5c9d 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AntipodalDegree.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/AntipodalDegree.lean @@ -18,7 +18,7 @@ antipodal map with ambient negation. The exact integer formula determinant. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/BallBoundaryLES.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/BallBoundaryLES.lean index 6a22cc3854..3918a5a362 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/BallBoundaryLES.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/BallBoundaryLES.lean @@ -21,7 +21,7 @@ route; the unconditional sphere top-homology theorem used by the public API is o the Mayer--Vietoris suspension construction. -/ -@[expose] public section +public section open CategoryTheory AlgebraicTopology Limits @@ -37,7 +37,7 @@ singular homology, by the library's unconditional homotopy invariance. The two maps are the homologies of `e.toFun` and `e.invFun`; the round-trip identities hold because `e.invFun ∘ e.toFun` (resp. `e.toFun ∘ e.invFun`) is homotopic to the identity. -/ -noncomputable def singularHomologyℤIsoOfHomotopyEquivSpace (k : ℕ) +@[expose] noncomputable def singularHomologyℤIsoOfHomotopyEquivSpace (k : ℕ) {X Y : Type} [TopologicalSpace X] [TopologicalSpace Y] (e : ContinuousMap.HomotopyEquiv X Y) : (singularHomologyℤ k).obj (TopCat.of X) ≅ (singularHomologyℤ k).obj (TopCat.of Y) where diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/Basic.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/Basic.lean index 9d42cec523..c453b35bbe 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/Basic.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/Basic.lean @@ -17,7 +17,7 @@ The definitions here should eventually be aligned with whichever sphere API is most convenient for the full formalization, possibly `TopCat.sphere n`. -/ -@[expose] public section +public section noncomputable section @@ -30,7 +30,7 @@ abbrev Sphere (n : ℕ) : Type := ↥(Metric.sphere (0 : EuclideanSpace ℝ (Fin (n + 1))) (1 : ℝ)) /-- An odd map between spheres is equivariant for the antipodal map. -/ -def IsOddMap {n : ℕ} (f : C(Sphere n, Sphere n)) : Prop := +@[expose] def IsOddMap {n : ℕ} (f : C(Sphere n, Sphere n)) : Prop := ∀ x : Sphere n, f (-x) = - f x /-- `IsOddMap f` unfolds to the pointwise oddness condition `f (-x) = - f x`. diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/ConstructRPAlpha.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/ConstructRPAlpha.lean index 13451b4ec2..d816cca4bb 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/ConstructRPAlpha.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/ConstructRPAlpha.lean @@ -20,7 +20,7 @@ homology functional and its invariance property. The canonical instance used by the final proof is constructed later in `RPnMonodromyFunctional`. -/ -@[expose] public section +public section open CategoryTheory AlgebraicTopology noncomputable section @@ -79,7 +79,7 @@ structure MonodromyFunctional (n : ℕ) where /-- **The canonical degree-one class** `α ∈ H¹(RPⁿ; F₂)` associated to the canonical double cover, built from the monodromy functional `m`. It is a genuine element of `rpCohomology n 1`. -/ -noncomputable def rpAlpha (n : ℕ) (m : MonodromyFunctional n) : rpCohomology n 1 := +@[expose] noncomputable def rpAlpha (n : ℕ) (m : MonodromyFunctional n) : rpCohomology n 1 := rpAlphaOfFunctional n m.g /-- `rpAlpha n m` is the class produced by the universal coefficient surjection diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/Covering.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/Covering.lean index 9369353437..f61186c13a 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/Covering.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/Covering.lean @@ -56,7 +56,7 @@ typeclass resolution downstream), and the supporting `abbrev`/lemmas are `proj_isCoveringMap` and `proj_isLocalHomeomorph`. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/DegreeAPIStrengthening.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/DegreeAPIStrengthening.lean index 91deadd05b..2785ce99f7 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/DegreeAPIStrengthening.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/DegreeAPIStrengthening.lean @@ -18,7 +18,7 @@ chosen top-homology isomorphism or orientation; later modules supply the uncondi positive-dimensional orientation. -/ -@[expose] public section +public section noncomputable section @@ -36,7 +36,7 @@ of the conditional degree: it consumes a raw categorical morphism, and the raw /-- The integer **degree of a `TopCat.sphere n` self-morphism `g`** relative to a chosen identification `e : Hₙ(Sⁿ; ℤ) ≅ ℤ`. The raw `Sphere n` degree is the special case `g = toTopCatSphereSelfMap f` (see `degreeOfIso_eq_degreeOfIsoTop`). -/ -def degreeOfIsoTop {n : ℕ} (e : SphereTopHomologyIso n) +@[expose] def degreeOfIsoTop {n : ℕ} (e : SphereTopHomologyIso n) (g : TopCat.sphere.{0} n ⟶ TopCat.sphere.{0} n) : ℤ := degreeRingHomOfIso _ e ((singularHomologyℤ n).map g) diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/DegreeFunctorialityAndHomotopy.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/DegreeFunctorialityAndHomotopy.lean index c4615d86b0..aea81fd224 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/DegreeFunctorialityAndHomotopy.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/DegreeFunctorialityAndHomotopy.lean @@ -44,7 +44,7 @@ Every statement is conditional only on the explicit identification `e` (resp. a the honest set of hypotheses. None of them is a disguised unconditional theorem. -/ -@[expose] public section +public section noncomputable section @@ -74,7 +74,7 @@ underlying `degreeOfIsoTop`: it sends the identity to `1` and respects the monoi product of `End (TopCat.sphere n)` (categorical composition). This is the functorial composite of `Functor.mapEnd` for the homology functor with the scalar ring homomorphism `degreeRingHomOfIso`. -/ -def degreeMonoidHomTop {n : ℕ} (e : SphereTopHomologyIso n) : +@[expose] def degreeMonoidHomTop {n : ℕ} (e : SphereTopHomologyIso n) : End (TopCat.sphere.{0} n) →* ℤ := (degreeRingHomOfIso _ e).toMonoidHom.comp ((singularHomologyℤ n).mapEnd (TopCat.sphere.{0} n)) @@ -127,7 +127,7 @@ variable (o : SphereOrientation) /-- The oriented `TopCat`-degree of a self-morphism of `TopCat.sphere n`, read off the supplied identification `o.iso n`. -/ -def degreeTop {n : ℕ} (g : TopCat.sphere.{0} n ⟶ TopCat.sphere.{0} n) : ℤ := +@[expose] def degreeTop {n : ℕ} (g : TopCat.sphere.{0} n ⟶ TopCat.sphere.{0} n) : ℤ := degreeOfIsoTop (o.iso n) g /-- The oriented `TopCat`-degree of the identity is `1`. -/ diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/DegreePositiveIntegration.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/DegreePositiveIntegration.lean index e058923296..0df9e221ca 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/DegreePositiveIntegration.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/DegreePositiveIntegration.lean @@ -20,7 +20,7 @@ results from that bundle. Later sphere-homology modules construct the unconditional orientation used by the public final theorem. -/ -@[expose] public section +public section noncomputable section open CategoryTheory AlgebraicTopology @@ -36,7 +36,7 @@ orientation `o : SphereOrientationPos`. This is `degreeOfIso` of `Degree.lean` evaluated at the orientation's chosen identification `o.iso n hn : Hₙ(Sⁿ; ℤ) ≅ ℤ`; in particular it carries no free per-dimension `SphereTopHomologyIso n` argument — only the bundled `o`. -/ -def degreePos (o : SphereOrientationPos) {n : ℕ} (hn : 1 ≤ n) +@[expose] def degreePos (o : SphereOrientationPos) {n : ℕ} (hn : 1 ≤ n) (f : C(Sphere n, Sphere n)) : ℤ := degreeOfIso (o.iso n hn) f diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/DoubleCoverClass.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/DoubleCoverClass.lean index 1fe58ac5c5..6f594ca103 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/DoubleCoverClass.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/DoubleCoverClass.lean @@ -67,7 +67,7 @@ therefore stops exactly at the last formalized object before `α`, plus the fundamental-group form of the eventual `fbar^*(α) = α`. -/ -@[expose] public section +public section noncomputable section @@ -208,7 +208,7 @@ theorem permToZMod2_eq_one_iff {α : Type*} [Finite α] (h : Nat.card α = 2) This is choice-free (no labelling of the two points is needed): it is the canonical reason a `ZMod 2`-valued monodromy character exists for the double cover, since each fibre of `proj n` is a two-element set. -/ -noncomputable def permTwoMulEquivZMod2 {α : Type*} [Finite α] (h : Nat.card α = 2) : +@[expose] noncomputable def permTwoMulEquivZMod2 {α : Type*} [Finite α] (h : Nat.card α = 2) : Equiv.Perm α ≃* Multiplicative (ZMod 2) := by classical letI := Fintype.ofFinite α @@ -235,7 +235,7 @@ sheets of the cover. This is the genuine covering-theoretic datum from which the canonical class `α ∈ H¹(RP n; F₂)` is obtained, via a degree-one cohomological classifier `H¹(X; F₂) ≅ Hom(π₁(X)ᵃᵇ, F₂)`. It is a proved homomorphism out of `π₁(RP n, x)`. -/ -noncomputable def classifyingHom (n : ℕ) (x : RP n) : +@[expose] noncomputable def classifyingHom (n : ℕ) (x : RP n) : FundamentalGroup (RP n) x →* Multiplicative (ZMod 2) := permToZMod2.comp (projMonodromyHom n x) @@ -306,6 +306,7 @@ theorem inducedOnRPFiberMap_bijective (n : ℕ) (f : C(Sphere n, Sphere n)) (hf /-- The fibrewise map of an odd map `f`, packaged as an equivalence between the two-element fibre over `q` and the fibre over the descended image `inducedOnRP f hf q`. -/ +@[expose] noncomputable def inducedOnRPFiberEquiv (n : ℕ) (f : C(Sphere n, Sphere n)) (hf : IsOddMap f) (q : RP n) : (proj n ⁻¹' {q}) ≃ (proj n ⁻¹' {inducedOnRP f hf q}) := Equiv.ofBijective _ (inducedOnRPFiberMap_bijective n f hf q) diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/FinalOddMapComparison.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/FinalOddMapComparison.lean index 50fe0f1391..17fa7de088 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/FinalOddMapComparison.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/FinalOddMapComparison.lean @@ -20,7 +20,7 @@ are used by later assembly modules; the stable public theorem is the uncondition `SphereOddDegree.Final`. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/ModTwoDegreeComparison.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/ModTwoDegreeComparison.lean index aec46ba01b..f9fd511ebb 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/ModTwoDegreeComparison.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/ModTwoDegreeComparison.lean @@ -17,7 +17,7 @@ oriented degree API. Native coefficient-reduction and sphere top-class construct by the dedicated coefficient-reduction modules. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/Monodromy.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/Monodromy.lean index 1a57637d1e..cd93d5f3dc 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/Monodromy.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/Monodromy.lean @@ -53,7 +53,7 @@ These declarations provide the monodromy permutation action. The associated clas homomorphism and degree-one cohomology class are developed in the downstream modules. -/ -@[expose] public section +public section noncomputable section @@ -72,7 +72,7 @@ theorem proj_exists_path_lifts (n : ℕ) (γ : C(unitInterval, RP n)) (e : Spher /-- The monodromy action of the double cover `proj n`: a homotopy class of paths from `x` to `y` in `RP n` sends a lift of `x` to the endpoint of the lifted path, giving a map between the fibres over `x` and `y`. -/ -def projMonodromy (n : ℕ) {x y : RP n} (γ : Path.Homotopic.Quotient x y) : +@[expose] def projMonodromy (n : ℕ) {x y : RP n} (γ : Path.Homotopic.Quotient x y) : (proj n ⁻¹' {x}) → (proj n ⁻¹' {y}) := (proj_isCoveringMap n).monodromy γ @@ -121,7 +121,7 @@ theorem projMonodromy_map (n : ℕ) {a b : Sphere n} (γ : Path.Homotopic.Quotie packaged as a permutation of the two-element fibre over `x`. This is the action of `π₁(RP n, x)` on the fibre by permutations; it preserves the fibre over the base point by construction. -/ -def projMonodromyPerm (n : ℕ) {x : RP n} (γ : Path.Homotopic.Quotient x x) : +@[expose] def projMonodromyPerm (n : ℕ) {x : RP n} (γ : Path.Homotopic.Quotient x x) : Equiv.Perm (proj n ⁻¹' {x}) := Equiv.ofBijective _ (projMonodromy_bijective n γ) @@ -165,7 +165,7 @@ variable (n : ℕ) (γ : C(unitInterval, RP n)) (e : Sphere n) (h : γ 0 = proj /-- The canonical lift to `S^n` of a path `γ` in `RP n`, starting at a chosen lift `e` of its start point. Specialises `IsCoveringMap.liftPath` to the double cover `proj n`. -/ -def projLiftPath : C(unitInterval, Sphere n) := +@[expose] def projLiftPath : C(unitInterval, Sphere n) := (proj_isCoveringMap n).liftPath γ e h /-- `projLiftPath` is a lift of `γ`: composing with `proj n` recovers `γ`. -/ @@ -229,7 +229,7 @@ laws, and `projMonodromyEquiv_symm` identifies the inverse equivalence. -/ /-- The monodromy of a homotopy class of paths from `x` to `y`, packaged as a bundled equivalence between the two fibres of the double cover. This refines `projMonodromy_bijective`; on loops it specialises to `projMonodromyPerm`. -/ -def projMonodromyEquiv (n : ℕ) {x y : RP n} (γ : Path.Homotopic.Quotient x y) : +@[expose] def projMonodromyEquiv (n : ℕ) {x y : RP n} (γ : Path.Homotopic.Quotient x y) : (proj n ⁻¹' {x}) ≃ (proj n ⁻¹' {y}) := Equiv.ofBijective _ (projMonodromy_bijective n γ) @@ -291,7 +291,7 @@ two-element fibre over `x`, as a genuine group homomorphism `projMonodromyPerm_refl` and its `map_mul` is `projMonodromyPerm_trans`; the order-reversal of the `End`-multiplication cancels the order-reversal of monodromy under path concatenation, so this is a covariant homomorphism. -/ -def projMonodromyHom (n : ℕ) (x : RP n) : +@[expose] def projMonodromyHom (n : ℕ) (x : RP n) : FundamentalGroup (RP n) x →* Equiv.Perm (proj n ⁻¹' {x}) where toFun a := projMonodromyPerm n (FundamentalGroup.toPath a) map_one' := projMonodromyPerm_refl n x @@ -310,7 +310,7 @@ two-element fibre of the double cover, obtained by transporting the canonical fundamental-group action that *Route A* toward `H¹(RPⁿ; F₂)` requires; it is provided as a `def` (not a global `instance`) so as not to pollute typeclass resolution. -/ -@[instance_reducible] +@[expose, instance_reducible] def projMonodromyMulAction (n : ℕ) (x : RP n) : MulAction (FundamentalGroup (RP n) x) (proj n ⁻¹' {x}) := MulAction.compHom _ (projMonodromyHom n x) @@ -335,7 +335,7 @@ the monodromy-naturality of the descended odd map. -/ /-- The fibrewise map induced by the odd map `f`: it sends the fibre over `q` to the fibre over the descended image `inducedOnRP f hf q`. This is the bundled form of `inducedOnRP_mapsTo_fiber`. -/ -def inducedOnRPFiberMap (n : ℕ) (f : C(Sphere n, Sphere n)) (hf : IsOddMap f) +@[expose] def inducedOnRPFiberMap (n : ℕ) (f : C(Sphere n, Sphere n)) (hf : IsOddMap f) {q : RP n} (e : proj n ⁻¹' {q}) : proj n ⁻¹' {inducedOnRP f hf q} := ⟨f e.1, by have he : proj n e.1 = q := e.2 diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/MonodromyCharacter.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/MonodromyCharacter.lean index fbd785de56..7156ce5ab5 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/MonodromyCharacter.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/MonodromyCharacter.lean @@ -48,7 +48,7 @@ degree-one cohomological classifier. trivially on the abelianized character, the `H₁`-level form of `fbar^*(α) = α`. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/MonodromyNontrivial.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/MonodromyNontrivial.lean index e025e0af14..ddec5f8ea9 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/MonodromyNontrivial.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/MonodromyNontrivial.lean @@ -42,7 +42,7 @@ monodromy sends the sheet `e` to the other sheet `-e`. * `classifyingHom_surjective` — for `n ≥ 1`, `classifyingHom n x` is surjective. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/RPnCohomologyRingBridge.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/RPnCohomologyRingBridge.lean index 12015aa2e3..8e9b7f2f2e 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/RPnCohomologyRingBridge.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/RPnCohomologyRingBridge.lean @@ -19,7 +19,7 @@ an intermediate model-comparison API; the final unconditional odd-degree proof u cohomology-dimension-vanishing route. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/RPnCohomologyRingModel.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/RPnCohomologyRingModel.lean index 462ae50a3c..221e6f6b21 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/RPnCohomologyRingModel.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/RPnCohomologyRingModel.lean @@ -52,7 +52,7 @@ transport to `H^*(RPⁿ; F₂)`. -/ -@[expose] public section +public section open Polynomial @@ -65,7 +65,7 @@ This is the right-hand side of the classical isomorphism `H^*(RPⁿ; F₂) ≅ F₂[α]/(αⁿ⁺¹)`. The isomorphism itself to topological cohomology is *not* asserted here (it remains open); only the model and its internal structure are built. -/ -noncomputable def RPnCohomologyRingModel (n : ℕ) : Type := +@[expose] noncomputable def RPnCohomologyRingModel (n : ℕ) : Type := (ZMod 2)[X] ⧸ (Ideal.span {(X : (ZMod 2)[X]) ^ (n + 1)}) noncomputable instance (n : ℕ) : CommRing (RPnCohomologyRingModel n) := by diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/RPnLowDimensional.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/RPnLowDimensional.lean index c435d883dc..d49f127f1a 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/RPnLowDimensional.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/RPnLowDimensional.lean @@ -39,7 +39,7 @@ in this packaged form, so that step is the recorded next concrete theorem (see cohomology computation is introduced. -/ -@[expose] public section +public section open CategoryTheory AlgebraicTopology diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/RPnTopClassAlphaPower.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/RPnTopClassAlphaPower.lean index 635fd7897a..e85d7fac59 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/RPnTopClassAlphaPower.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/RPnTopClassAlphaPower.lean @@ -19,7 +19,7 @@ descended odd sphere map. Later modules identify the actual projective cohomology generator and its powers with this model. -/ -@[expose] public section +public section noncomputable section open CategoryTheory AlgebraicTopology @@ -30,9 +30,10 @@ namespace SphereOddDegree /-- The **top mod-two cohomology** `Hⁿ(RPⁿ; F₂)` of real projective `n`-space, the target group of the top class `αⁿ`. A genuine object: `rpCohomology n n`. -/ -noncomputable def rpTopCohomology (n : ℕ) : ModuleCat.{0} (ZMod 2) := rpCohomology n n +@[expose] noncomputable def rpTopCohomology (n : ℕ) : ModuleCat.{0} (ZMod 2) := rpCohomology n n /-- The **top mod-two cohomology** `Hⁿ(Sⁿ; F₂)` of the `n`-sphere. -/ +@[expose] noncomputable def sphereTopCohomology (n : ℕ) : ModuleCat.{0} (ZMod 2) := sphereCohomology n n theorem rpTopCohomology_eq (n : ℕ) : rpTopCohomology n = rpCohomology n n := rfl @@ -65,7 +66,7 @@ instance (n : ℕ) : Nontrivial (RPnCohomologyRingModel n) := /-- The **model top class** `αⁿ ∈ F₂[α]/(αⁿ⁺¹)` — the model-side avatar of the top class of `Hⁿ(RPⁿ; F₂)`. -/ -noncomputable def modelTopClass (n : ℕ) : RPnCohomologyRingModel n := modelAlpha n ^ n +@[expose] noncomputable def modelTopClass (n : ℕ) : RPnCohomologyRingModel n := modelAlpha n ^ n theorem modelTopClass_eq (n : ℕ) : modelTopClass n = modelAlpha n ^ n := rfl diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/RealProjectiveSpace.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/RealProjectiveSpace.lean index 6314b7073a..83916b32bb 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/RealProjectiveSpace.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/RealProjectiveSpace.lean @@ -32,7 +32,7 @@ Implemented here: they live here next to the quotient rather than in `Covering.lean`. -/ -@[expose] public section +public section noncomputable section @@ -41,6 +41,7 @@ namespace SphereOddDegree /-- The antipodal relation on the sphere: `x ~ y` iff `x = y` or `x = -y`. -/ +@[expose] def AntipodalRel {n : ℕ} (x y : Sphere n) : Prop := x = y ∨ x = -y @@ -81,7 +82,7 @@ abbrev RP (n : ℕ) : Type := Quotient (AntipodalSetoid n) /-- The quotient projection `S^n -> RP n`. -/ -def proj (n : ℕ) : C(Sphere n, RP n) where +@[expose] def proj (n : ℕ) : C(Sphere n, RP n) where toFun := Quotient.mk' continuous_toFun := continuous_quotient_mk' @@ -219,7 +220,7 @@ Map on projective space induced by an odd sphere self-map. This is the formal version of the descent `f` to `bar f` along the quotient `S^n -> RP n`. -/ -def inducedOnRP +@[expose] def inducedOnRP {n : ℕ} (f : C(Sphere n, Sphere n)) (hf : IsOddMap f) : diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/ReducedToUnreducedSphereTopHomology.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/ReducedToUnreducedSphereTopHomology.lean index 473c35bdc0..868999ef45 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/ReducedToUnreducedSphereTopHomology.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/ReducedToUnreducedSphereTopHomology.lean @@ -69,7 +69,7 @@ Mathlib. Consequently `SphereSuspensionTower.step` is **not** fillable from this choice`, `Quot.sound`). -/ -@[expose] public section +public section open CategoryTheory Limits AlgebraicTopology diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/SphereTopHomology.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/SphereTopHomology.lean index f1515d782b..ee48c4eb67 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/SphereTopHomology.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/SphereTopHomology.lean @@ -17,7 +17,7 @@ to a selected top-homology isomorphism. Positive-dimensional unconditional insta from the Mayer--Vietoris suspension computation and re-exported by the final API. -/ -@[expose] public section +public section open CategoryTheory AlgebraicTopology @@ -118,7 +118,7 @@ variable (o : SphereOrientation) /-- The integer **degree** of a self-map of `Sphere n`, read off the supplied top-homology identification `o.iso n`. Honest and unconditional once a `SphereOrientation` is provided. -/ -def degree {n : ℕ} (f : C(Sphere n, Sphere n)) : ℤ := +@[expose] def degree {n : ℕ} (f : C(Sphere n, Sphere n)) : ℤ := degreeOfIso (o.iso n) f /-- The degree of the identity map is `1`. -/ diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/SphereTopHomologyReduction.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/SphereTopHomologyReduction.lean index eb13d1415f..19bb1bf341 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/SphereTopHomologyReduction.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/SphereTopHomologyReduction.lean @@ -18,7 +18,7 @@ concrete suspension tower and the resulting unconditional orientation are constr Mayer--Vietoris sphere-homology modules. -/ -@[expose] public section +public section open CategoryTheory AlgebraicTopology @@ -55,12 +55,12 @@ structural recursion on `k`: the base case `k = 0` is `T.base`, and each success composes the suspension isomorphism `T.step` with the identification one dimension lower. (`Nat.le_induction` only eliminates into `Prop`, so the data-valued family is built on the shifted index instead.) -/ -def isoSucc (k : ℕ) : SphereTopHomologyIso (k + 1) := +@[expose] def isoSucc (k : ℕ) : SphereTopHomologyIso (k + 1) := Nat.rec T.base (fun j ih => (T.step (j + 1) (by omega)) ≪≫ ih) k /-- From a suspension tower, the top-homology identification `Hₙ(Sⁿ; ℤ) ≅ ℤ` for every `n ≥ 1`. -/ -def iso : ∀ n : ℕ, 1 ≤ n → SphereTopHomologyIso n +@[expose] def iso : ∀ n : ℕ, 1 ≤ n → SphereTopHomologyIso n | (k + 1), _ => T.isoSucc k @[simp] @@ -88,7 +88,7 @@ variable (o : SphereOrientationPos) /-- The integer **degree** of a self-map of `Sphere n` (`n ≥ 1`), read off the supplied top-homology identification `o.iso n hn`. Honest and unconditional once a `SphereOrientationPos` is provided. -/ -def degree {n : ℕ} (hn : 1 ≤ n) (f : C(Sphere n, Sphere n)) : ℤ := +@[expose] def degree {n : ℕ} (hn : 1 ≤ n) (f : C(Sphere n, Sphere n)) : ℤ := degreeOfIso (o.iso n hn) f /-- The degree of the identity map is `1`. -/ @@ -117,7 +117,7 @@ theorem degree_eq_of_homotopic (prism : SingularPrismOperator) {n : ℕ} (hn : 1 end SphereOrientationPos /-- A suspension tower yields a genuine (non-vacuous) positive orientation. -/ -def SphereSuspensionTower.orientation (T : SphereSuspensionTower) : +@[expose] def SphereSuspensionTower.orientation (T : SphereSuspensionTower) : SphereOrientationPos := ⟨T.iso⟩ diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/TopCatBridge.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/TopCatBridge.lean index 7c9e9147ad..66c3903d30 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/TopCatBridge.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/TopCatBridge.lean @@ -19,7 +19,7 @@ homeomorphism and categorical isomorphism, and transports continuous maps between the models with identity and composition laws. -/ -@[expose] public section +public section noncomputable section open CategoryTheory @@ -36,7 +36,7 @@ theorem topCatSphere_carrier_eq (n : ℕ) : /-- `TopCat.sphere n` is homeomorphic to the raw subtype model `Sphere n`. The homeomorphism is simply the universe-lift equivalence `Homeomorph.ulift`, witnessing that the two models differ only by a `ULift` wrapper. -/ -noncomputable def topCatSphereHomeomorph (n : ℕ) : +@[expose] noncomputable def topCatSphereHomeomorph (n : ℕ) : (TopCat.sphere.{u} n : Type u) ≃ₜ Sphere n := Homeomorph.ulift @@ -48,7 +48,7 @@ carries no mathematical content beyond the universe-lifting `ULift` wrapper. Use this to transport `TopCat`-phrased algebraic-topology constructions (e.g. categorical (co)homology of `TopCat.sphere n`) onto the library's working model `Sphere n`. -/ -noncomputable def topCatSphereIso (n : ℕ) : +@[expose] noncomputable def topCatSphereIso (n : ℕ) : TopCat.sphere.{0} n ≅ TopCat.of (Sphere n) := TopCat.isoOfHomeo (topCatSphereHomeomorph n) @@ -111,7 +111,7 @@ original map through the homeomorphisms /-- Transport a continuous map `Sphere n → Sphere m` to a morphism of the categorical sphere objects `TopCat.sphere n ⟶ TopCat.sphere m`, by conjugating with the bridge isomorphism `topCatSphereIso`. -/ -noncomputable def toTopCatSphereMap {n m : ℕ} (f : C(Sphere n, Sphere m)) : +@[expose] noncomputable def toTopCatSphereMap {n m : ℕ} (f : C(Sphere n, Sphere m)) : TopCat.sphere.{0} n ⟶ TopCat.sphere.{0} m := (topCatSphereIso n).hom ≫ TopCat.ofHom f ≫ (topCatSphereIso m).inv diff --git a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/UnconditionalDegree.lean b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/UnconditionalDegree.lean index 3a0eff42bf..db149f0fd9 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/UnconditionalDegree.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/OddSphereDegree/UnconditionalDegree.lean @@ -18,7 +18,7 @@ invariance APIs from that setup. Unconditional instances of both fields are cons and re-exported through `SphereOddDegree.Final`. -/ -@[expose] public section +public section noncomputable section @@ -56,7 +56,7 @@ variable (S : SphereDegreeSetup) /-- The integer **degree** of a self-map `f : C(Sphere n, Sphere n)` (`n ≥ 1`), read off the setup's top-homology orientation. Honest and unconditional *given* the setup `S`. -/ -def degree {n : ℕ} (hn : 1 ≤ n) (f : C(Sphere n, Sphere n)) : ℤ := +@[expose] def degree {n : ℕ} (hn : 1 ≤ n) (f : C(Sphere n, Sphere n)) : ℤ := S.orientation.degree hn f /-- **Compatibility with the conditional API.** The setup degree is the conditional @@ -102,7 +102,7 @@ theorem not_homotopic_of_degree_ne {n : ℕ} (hn : 1 ≤ n) /-- The integer **degree of a `TopCat.sphere n` self-morphism** `g`, read off the setup's orientation. the library-sphere degree is its value on the model transport (`degree_eq_degreeTopCat`). -/ -def degreeTopCat {n : ℕ} (hn : 1 ≤ n) +@[expose] def degreeTopCat {n : ℕ} (hn : 1 ≤ n) (g : TopCat.sphere.{0} n ⟶ TopCat.sphere.{0} n) : ℤ := degreeOfIsoTop (S.orientation.iso n hn) g @@ -187,7 +187,7 @@ end SphereDegreeSetup /-- A `SphereSuspensionTower` and a `SingularPrismOperator` assemble a full `SphereDegreeSetup`. -/ -def SphereSuspensionTower.degreeSetup (T : SphereSuspensionTower) +@[expose] def SphereSuspensionTower.degreeSetup (T : SphereSuspensionTower) (prism : SingularPrismOperator) : SphereDegreeSetup where orientation := T.orientation prism := prism diff --git a/LeanPool/NandakumarRamanaRao/NRR/Partition.lean b/LeanPool/NandakumarRamanaRao/NRR/Partition.lean index d5de5e2d35..0271d0cc31 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Partition.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Partition.lean @@ -11,4 +11,4 @@ public import LeanPool.NandakumarRamanaRao.NRR.Partition.PerimeterVector /-! Supporting modules for Equal-area and equal-perimeter convex partitions. -/ -@[expose] public section +public section diff --git a/LeanPool/NandakumarRamanaRao/NRR/Partition/ConvexPartition.lean b/LeanPool/NandakumarRamanaRao/NRR/Partition/ConvexPartition.lean index 186dbe63be..7ed43a7dcf 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Partition/ConvexPartition.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Partition/ConvexPartition.lean @@ -41,7 +41,7 @@ what finite measure additivity needs and what power/Voronoi partitions actually Area additivity itself is intentionally *not* proved here. -/ -@[expose] public section +public section open MeasureTheory @@ -65,7 +65,7 @@ structure ConvexPartition (K : Body) (n : ℕ) where namespace ConvexPartition /-- All pieces have equal area. -/ -def IsEqualArea {K : Body} {n : ℕ} (P : ConvexPartition K n) : Prop := +@[expose] def IsEqualArea {K : Body} {n : ℕ} (P : ConvexPartition K n) : Prop := ∀ i j, (P.piece i).area = (P.piece j).area /-- The pieces of a convex partition union (as sets) to the whole body `K`. -/ diff --git a/LeanPool/NandakumarRamanaRao/NRR/Partition/PerimeterVector.lean b/LeanPool/NandakumarRamanaRao/NRR/Partition/PerimeterVector.lean index 5df625f813..561750fed3 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Partition/PerimeterVector.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Partition/PerimeterVector.lean @@ -29,7 +29,7 @@ No equal-area assumption, test map, or continuity statement is introduced here: purely the definitional perimeter API. -/ -@[expose] public section +public section namespace NRR @@ -41,16 +41,16 @@ variable {K : Body} {n : ℕ} /-- The **perimeter vector** of a convex partition: the `i`-th entry is the perimeter of the `i`-th piece. -/ -noncomputable def perimeterVec (P : ConvexPartition K n) : Fin n → ℝ := +@[expose] noncomputable def perimeterVec (P : ConvexPartition K n) : Fin n → ℝ := fun i => perimeter (P.piece i) /-- The **total perimeter** of a convex partition: the sum of the piece perimeters. -/ -noncomputable def totalPerimeter (P : ConvexPartition K n) : ℝ := +@[expose] noncomputable def totalPerimeter (P : ConvexPartition K n) : ℝ := ∑ i, P.perimeterVec i /-- The **average perimeter** of a convex partition: the total perimeter divided by `(n : ℝ)`. The division is explicitly by the real cast `(n : ℝ)`. -/ -noncomputable def averagePerimeter (P : ConvexPartition K n) : ℝ := +@[expose] noncomputable def averagePerimeter (P : ConvexPartition K n) : ℝ := P.totalPerimeter / (n : ℝ) @[simp] theorem perimeterVec_apply (P : ConvexPartition K n) (i : Fin n) : @@ -64,11 +64,11 @@ theorem averagePerimeter_eq (P : ConvexPartition K n) : /-- The **perimeter-deviation vector** of a convex partition: the `i`-th entry is the deviation of the `i`-th piece perimeter from the average perimeter. -/ -noncomputable def perimeterDeviation (P : ConvexPartition K n) : Fin n → ℝ := +@[expose] noncomputable def perimeterDeviation (P : ConvexPartition K n) : Fin n → ℝ := fun i => P.perimeterVec i - P.averagePerimeter /-- All pieces have equal perimeter. -/ -def HasEqualPerimeter (P : ConvexPartition K n) : Prop := +@[expose] def HasEqualPerimeter (P : ConvexPartition K n) : Prop := ∀ i j, perimeter (P.piece i) = perimeter (P.piece j) @[simp] theorem perimeterDeviation_apply (P : ConvexPartition K n) (i : Fin n) : diff --git a/LeanPool/NandakumarRamanaRao/NRR/PowerDiagram.lean b/LeanPool/NandakumarRamanaRao/NRR/PowerDiagram.lean index bc35d521d0..7059f0df55 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PowerDiagram.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PowerDiagram.lean @@ -27,7 +27,7 @@ The proved continuity API is intentionally fixed-site: `continuous_bodyCellArea_ continuity in moving sites and weights is not claimed. -/ -@[expose] public section +public section open NRR NRR.Geometry NRR.Geometry.ConvexBody MeasureTheory diff --git a/LeanPool/NandakumarRamanaRao/NRR/PowerDiagram/BodyCellPartition.lean b/LeanPool/NandakumarRamanaRao/NRR/PowerDiagram/BodyCellPartition.lean index fb4e8790ba..a77770e59d 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PowerDiagram/BodyCellPartition.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PowerDiagram/BodyCellPartition.lean @@ -37,7 +37,7 @@ No nonemptiness of restricted cells is assumed, no `ConvexPartition` is bundled, equal‑area properties are proved here. -/ -@[expose] public section +public section open NRR NRR.Geometry MeasureTheory diff --git a/LeanPool/NandakumarRamanaRao/NRR/PowerDiagram/BodyCells.lean b/LeanPool/NandakumarRamanaRao/NRR/PowerDiagram/BodyCells.lean index 59dd513703..b846512f97 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PowerDiagram/BodyCells.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PowerDiagram/BodyCells.lean @@ -30,7 +30,7 @@ restricted cell can be empty or lower‑dimensional, so it need not be a solid c Partition properties of the family `i ↦ bodyCellSet K s w i` are out of scope here. -/ -@[expose] public section +public section open NRR NRR.Geometry MeasureTheory @@ -40,12 +40,14 @@ variable {n : ℕ} /-- **Restricted power cell** as a set: the intersection of the body `K` with the power cell of site `i`. Kept at the set level (no bundling, no nondegeneracy hypothesis). -/ +@[expose] def bodyCellSet (K : Geometry.ConvexBody Plane) (s : Fin n → Plane) (w : Fin n → ℝ) (i : Fin n) : Set Plane := (K : Set Plane) ∩ cell s w i /-- **Area** of a restricted power cell: the real‑valued Lebesgue measure of `bodyCellSet`. Defined unconditionally (no nonempty‑interior hypothesis). -/ +@[expose] noncomputable def bodyCellArea (K : Geometry.ConvexBody Plane) (s : Fin n → Plane) (w : Fin n → ℝ) (i : Fin n) : ℝ := (volume (bodyCellSet K s w i)).toReal @@ -76,6 +78,7 @@ theorem bodyCellSet_isCompact (K : Geometry.ConvexBody Plane) (s : Fin n → Pla /-- **Bundled** restricted power cell, requiring explicit nonempty‑interior evidence `hInt`. The carrier is `bodyCellSet K s w i`; convexity and compactness are automatic, and solidity is exactly the supplied hypothesis. -/ +@[expose] noncomputable def bodyCellBody (K : Geometry.ConvexBody Plane) (s : Fin n → Plane) (w : Fin n → ℝ) (i : Fin n) (hInt : (interior (bodyCellSet K s w i)).Nonempty) : Geometry.ConvexBody Plane where diff --git a/LeanPool/NandakumarRamanaRao/NRR/PowerDiagram/CellAlgebra.lean b/LeanPool/NandakumarRamanaRao/NRR/PowerDiagram/CellAlgebra.lean index 9c71018cfc..b975691829 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PowerDiagram/CellAlgebra.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PowerDiagram/CellAlgebra.lean @@ -29,7 +29,7 @@ matching the (always true) inequality `powerDist s w i x ≤ powerDist s w i x`. This yields the exact intersection‑of‑half‑spaces representation of each power cell. -/ -@[expose] public section +public section open NRR open scoped RealInnerProductSpace @@ -41,12 +41,12 @@ variable {n : ℕ} /-- **Separating normal** for the pair `(i, j)`: the inner normal of the closed half‑space whose boundary is the radical axis of sites `i` and `j`. Chosen as `2 • (sⱼ - sᵢ)` so that `powerDist s w i x ≤ powerDist s w j x ↔ ⟪sepNormal s i j, x⟫ ≤ sepOffset s w i j`. -/ -noncomputable def sepNormal (s : Fin n → E2) (i j : Fin n) : E2 := +@[expose] noncomputable def sepNormal (s : Fin n → E2) (i j : Fin n) : E2 := (2 : ℝ) • (s j - s i) /-- **Separating offset** for the pair `(i, j)`: the offset of the closed half‑space bounding the power cell of `i` against `j`, equal to `‖sⱼ‖² - ‖sᵢ‖² - wⱼ + wᵢ`. -/ -noncomputable def sepOffset (s : Fin n → E2) (w : Fin n → ℝ) (i j : Fin n) : ℝ := +@[expose] noncomputable def sepOffset (s : Fin n → E2) (w : Fin n → ℝ) (i j : Fin n) : ℝ := ‖s j‖ ^ 2 - ‖s i‖ ^ 2 - w j + w i /-- The pairwise power‑distance inequality is exactly membership in the closed half‑space with diff --git a/LeanPool/NandakumarRamanaRao/NRR/PowerDiagram/CellAreaContinuityWeights.lean b/LeanPool/NandakumarRamanaRao/NRR/PowerDiagram/CellAreaContinuityWeights.lean index 798fbddf74..d57ab22516 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PowerDiagram/CellAreaContinuityWeights.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PowerDiagram/CellAreaContinuityWeights.lean @@ -46,7 +46,7 @@ harmless, which is why the diagonal is exempted (only the off‑diagonal normals nonzero). -/ -@[expose] public section +public section open NRR NRR.Geometry NRR.Geometry.ConvexBody MeasureTheory open scoped RealInnerProductSpace diff --git a/LeanPool/NandakumarRamanaRao/NRR/PowerDiagram/CellAreaVector.lean b/LeanPool/NandakumarRamanaRao/NRR/PowerDiagram/CellAreaVector.lean index 9d899488c1..0eb81c1bf3 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PowerDiagram/CellAreaVector.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PowerDiagram/CellAreaVector.lean @@ -47,7 +47,7 @@ Sites are held fixed throughout; nothing here assumes cells are nonempty, and no statement is proved. -/ -@[expose] public section +public section open NRR NRR.Geometry NRR.Geometry.ConvexBody MeasureTheory @@ -57,7 +57,7 @@ variable {n : ℕ} /-- **Restricted power‑cell area vector.** With sites `s` and weights `w`, the `i`‑th component is the restricted‑cell area `bodyCellArea K s w i`. -/ -noncomputable def areaVec +@[expose] noncomputable def areaVec (K : Geometry.ConvexBody Plane) (s : Fin n → Plane) (w : Fin n → ℝ) : Fin n → ℝ := fun i => bodyCellArea K s w i diff --git a/LeanPool/NandakumarRamanaRao/NRR/PowerDiagram/CellGeometry.lean b/LeanPool/NandakumarRamanaRao/NRR/PowerDiagram/CellGeometry.lean index 998371cfb4..d3fa7bc40d 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PowerDiagram/CellGeometry.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PowerDiagram/CellGeometry.lean @@ -18,7 +18,7 @@ Proves convexity, closedness, and covering of the ambient space by power cells. in `NRR.PowerDiagram.Defs`, and the halfspace representation is in `CellAlgebra`. -/ -@[expose] public section +public section open NRR open scoped RealInnerProductSpace diff --git a/LeanPool/NandakumarRamanaRao/NRR/PowerDiagram/CellOverlap.lean b/LeanPool/NandakumarRamanaRao/NRR/PowerDiagram/CellOverlap.lean index 13280781ff..fc2b214412 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PowerDiagram/CellOverlap.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PowerDiagram/CellOverlap.lean @@ -34,7 +34,7 @@ The ambient type is the library alias `E2 = Geometry.Plane = EuclideanSpace ℝ (this is the `Plane` referred to in the design). -/ -@[expose] public section +public section open NRR MeasureTheory open scoped RealInnerProductSpace diff --git a/LeanPool/NandakumarRamanaRao/NRR/PowerDiagram/Defs.lean b/LeanPool/NandakumarRamanaRao/NRR/PowerDiagram/Defs.lean index 7ff5dd17e8..c8df71ce82 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PowerDiagram/Defs.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PowerDiagram/Defs.lean @@ -26,7 +26,7 @@ Given `n` sites `s : Fin n → E2` and weights `w : Fin n → ℝ`, the power ce `{x : ∀ j, ‖x - sᵢ‖² - wᵢ ≤ ‖x - sⱼ‖² - wⱼ}`. -/ -@[expose] public section +public section open NRR MeasureTheory @@ -35,11 +35,11 @@ namespace NRR.PowerDiagram variable {n : ℕ} /-- **Power (Laguerre) distance** of `x` to site `i` with weight `w i`. -/ -noncomputable def powerDist (s : Fin n → E2) (w : Fin n → ℝ) (i : Fin n) (x : E2) : ℝ := +@[expose] noncomputable def powerDist (s : Fin n → E2) (w : Fin n → ℝ) (i : Fin n) (x : E2) : ℝ := ‖x - s i‖ ^ 2 - w i /-- **Power cell** of site `i`: the points closer (in power distance) to `i` than to any `j`. -/ -noncomputable def cell (s : Fin n → E2) (w : Fin n → ℝ) (i : Fin n) : Set E2 := +@[expose] noncomputable def cell (s : Fin n → E2) (w : Fin n → ℝ) (i : Fin n) : Set E2 := {x | ∀ j, powerDist s w i x ≤ powerDist s w j x} end NRR.PowerDiagram diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimeModel.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimeModel.lean index d475518150..6cccc6f945 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimeModel.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimeModel.lean @@ -32,4 +32,4 @@ It does not assert existence of the concrete polyhedral model and does not conta transversality, orbit-count, or separation theorem. -/ -@[expose] public section +public section diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/Actions.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/Actions.lean index 4af0cf0dea..aecc2f761f 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/Actions.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/Actions.lean @@ -14,7 +14,7 @@ public import LeanPool.NandakumarRamanaRao.NRR.PrimeModel.PrimeSymmetry All actions use the established relabelling convention `v i = old (σ.symm i)`. -/ -@[expose] public section +public section namespace NRR diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/AugmentedReference.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/AugmentedReference.lean index 2fd78a83d8..cf6aa5e8f0 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/AugmentedReference.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/AugmentedReference.lean @@ -15,7 +15,7 @@ The reference map is scaled pointwise by an invariant positive factor derived fr `(-1/2, 1/2)`. Adding the signed-interval coordinate then gives strict endpoint orthant signs. -/ -@[expose] public section +public section namespace NRR @@ -83,6 +83,7 @@ theorem abs_reference_le_l1 (Finset.mem_univ i) /-- The scaled reference vector. -/ +@[expose] noncomputable def scaledReference (M : PrimeConfigurationModel hp) : C(M.Point, ZeroSum p) where toFun x := ⟨fun i => M.referenceScale x * M.reference x i, by diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/BoundaryOrthants.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/BoundaryOrthants.lean index b37539e5f4..aa568cee13 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/BoundaryOrthants.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/BoundaryOrthants.lean @@ -15,7 +15,7 @@ The strict endpoint signs of a nice multivalued function place the child test ma orthant at `-1` and the positive orthant at `1`. -/ -@[expose] public section +public section namespace NRR @@ -24,10 +24,12 @@ open Geometry variable {p : ℕ} /-- Strictly negative coordinate orthant. -/ +@[expose] def negativeOrthant (p : ℕ) : Set (Fin p → ℝ) := {v | ∀ i, v i < 0} /-- Strictly positive coordinate orthant. -/ +@[expose] def positiveOrthant (p : ℕ) : Set (Fin p → ℝ) := {v | ∀ i, 0 < v i} diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/ChildEquivariance.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/ChildEquivariance.lean index 674b043786..1d0abfc3ce 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/ChildEquivariance.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/ChildEquivariance.lean @@ -16,7 +16,7 @@ by the same convention, and extensionality lifts carrier equality to `ConvexSubb `BodySpace`. -/ -@[expose] public section +public section namespace NRR diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/ChildTestMap.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/ChildTestMap.lean index d02c99db98..d1e1d68f80 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/ChildTestMap.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/ChildTestMap.lean @@ -15,7 +15,7 @@ An arbitrary nice multivalued function is evaluated on all equal-area children. coordinate vector is continuous and transforms by coordinate relabelling. -/ -@[expose] public section +public section namespace NRR @@ -27,6 +27,7 @@ variable {K : Geometry.ConvexBody Plane} {A : ℝ} namespace PrimeConfigurationModel /-- Evaluate the multivalued observable on every equal-area child body and interval parameter. -/ +@[expose] noncomputable def childTestMap (M : PrimeConfigurationModel hp) (hA : 0 < A) @@ -58,6 +59,7 @@ theorem childTestMap_smul rw [M.child_smul hA C g x i] /-- The simultaneous child-zero set. -/ +@[expose] def allChildrenZeroSet (M : PrimeConfigurationModel hp) (hA : 0 < A) diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/CoordinateDecomposition.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/CoordinateDecomposition.lean index e34bffef97..60670261cc 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/CoordinateDecomposition.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/CoordinateDecomposition.lean @@ -9,14 +9,14 @@ module public import LeanPool.NandakumarRamanaRao.NRR.PrimeModel.ZeroSumAlgebra /-! # Mean/deviation decomposition -/ -@[expose] public section +public section namespace NRR open scoped BigOperators variable {n : ℕ} /-- The linear functional taking the mean of a coordinate vector, with value zero in dimension zero. -/ -noncomputable def coordinateMean (n : ℕ) : +@[expose] noncomputable def coordinateMean (n : ℕ) : (Fin n → ℝ) →ₗ[ℝ] ℝ where toFun v := (∑ i, v i) / (n : ℝ) map_add' u v := by @@ -31,6 +31,7 @@ noncomputable def coordinateMean (n : ℕ) : coordinateMean n v = (∑ i, v i) / (n : ℝ) := rfl /-- Subtract the coordinate mean to obtain a vector in the zero-sum representation. -/ +@[expose] noncomputable def coordinateDeviation (hn : 0 < n) : (Fin n → ℝ) →ₗ[ℝ] ZeroSum n where toFun v := ⟨fun i => v i - coordinateMean n v, by @@ -62,6 +63,7 @@ noncomputable def coordinateDeviation (hn : 0 < n) : rfl /-- Reconstruct coordinates from a zero-sum vector and a constant. -/ +@[expose] def reconstructCoordinates (n : ℕ) : ZeroSum n × ℝ →ₗ[ℝ] (Fin n → ℝ) where toFun z i := z.1 i + z.2 diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/EquivariantMap.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/EquivariantMap.lean index e0bbe6ea83..a2f2e1c45c 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/EquivariantMap.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/EquivariantMap.lean @@ -15,7 +15,7 @@ This file deliberately stays below the PL and obstruction-theory layers. It reco pointwise equations needed by the configuration-model construction. -/ -@[expose] public section +public section namespace NRR @@ -23,6 +23,7 @@ variable {p : ℕ} {hp : Nat.Prime p} variable {X Y Z P : Type*} /-- A map commuting with the selected prime-symmetry actions. -/ +@[expose] def IsPrimeEquivariant [MulAction (PrimeSymmetry p) X] [MulAction (PrimeSymmetry p) Y] @@ -56,6 +57,7 @@ theorem IsPrimeEquivariant.const_zero exact (hzero g).symm /-- Invariance of a subset under the selected action. -/ +@[expose] def IsPrimeInvariant [MulAction (PrimeSymmetry p) X] (S : Set X) : Prop := @@ -85,6 +87,7 @@ theorem IsPrimeEquivariant.zeroSet_invariant exact hzero g /-- Trivial action on a parameter and the existing action on the second factor. -/ +@[expose] def PrimeSymmetry.smulParamProd [MulAction (PrimeSymmetry p) X] (g : PrimeSymmetry p) (z : P × X) : P × X := diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/FixedVectors.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/FixedVectors.lean index d4f35b7920..de2f01b37d 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/FixedVectors.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/FixedVectors.lean @@ -15,7 +15,7 @@ Transitivity of the label action forces fixed coordinate vectors to be constant. fixed subspace with the zero-sum representation leaves only the origin. -/ -@[expose] public section +public section namespace NRR diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/Model.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/Model.lean index ca9959e526..a15d75fb99 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/Model.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/Model.lean @@ -16,7 +16,7 @@ structure records only compact topological and equivariant data; it does not pos or separation theorem. -/ -@[expose] public section +public section namespace NRR diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/ModelSites.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/ModelSites.lean index 47c2bf1c11..7c8204fa7b 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/ModelSites.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/ModelSites.lean @@ -15,7 +15,7 @@ The body and signed-interval coordinates are fixed; only the model point is move symmetry group. Named maps are used instead of global product-action instances. -/ -@[expose] public section +public section namespace NRR @@ -28,6 +28,7 @@ namespace PrimeConfigurationModel /-- The model configuration map as the compact site family used by the variable-body partition construction. -/ +@[expose] def sites (M : PrimeConfigurationModel hp) : EMP.VariableBody.SiteFamily M.Point p := M.toConfig @@ -46,6 +47,7 @@ def smulBodyPoint (z.1, g • z.2) /-- Action on a body/model-point/interval parameter, fixing body and interval. -/ +@[expose] def smulBodyPointInterval (M : PrimeConfigurationModel hp) (g : PrimeSymmetry p) diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/PhaseInterfaces.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/PhaseInterfaces.lean index ff299ffb70..a2ad3b8c1f 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/PhaseInterfaces.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/PhaseInterfaces.lean @@ -21,7 +21,7 @@ no new mathematical assertion; later `PrimeModel` modules import this file rathe implementation details of the hyperspace, variable-body, or multivalued-function developments. -/ -@[expose] public section +public section namespace NRR diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/PrimeSymmetry.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/PrimeSymmetry.lean index f798abd9d7..b7843790a9 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/PrimeSymmetry.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/PrimeSymmetry.lean @@ -15,7 +15,7 @@ it is the alternating group. The prime configuration model uses this constructio cardinality. -/ -@[expose] public section +public section namespace NRR @@ -25,6 +25,7 @@ variable {p : ℕ} /-- The permutation subgroup used for prime symmetry: all permutations for two labels and even permutations otherwise. -/ +@[expose] def primeSymmetrySubgroup (p : ℕ) : Subgroup (Equiv.Perm (Fin p)) := by classical @@ -34,6 +35,7 @@ def primeSymmetrySubgroup (p : ℕ) : abbrev PrimeSymmetry (p : ℕ) := primeSymmetrySubgroup p /-- Faithful inclusion of the selected subgroup into all label permutations. -/ +@[expose] def PrimeSymmetry.toPerm (p : ℕ) : PrimeSymmetry p →* Equiv.Perm (Fin p) := (primeSymmetrySubgroup p).subtype diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/ZeroSumAlgebra.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/ZeroSumAlgebra.lean index 56d182f182..1dfd30a522 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/ZeroSumAlgebra.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimeModel/ZeroSumAlgebra.lean @@ -16,7 +16,7 @@ zero. This module equips it with the pointwise additive and real-linear structur coordinate-sum linear map. -/ -@[expose] public section +public section namespace NRR @@ -25,6 +25,7 @@ open scoped BigOperators variable {n : ℕ} /-- Sum of all coordinates, as a linear map. -/ +@[expose] def coordinateSum (n : ℕ) : (Fin n → ℝ) →ₗ[ℝ] ℝ where toFun v := ∑ i, v i map_add' u v := by simp [Finset.sum_add_distrib] @@ -36,6 +37,7 @@ def coordinateSum (n : ℕ) : (Fin n → ℝ) →ₗ[ℝ] ℝ where namespace ZeroSum /-- Identify zero-sum coordinate vectors with the kernel of coordinate summation. -/ +@[expose] def equivKernel (n : ℕ) : ZeroSum n ≃ LinearMap.ker (coordinateSum n) where toFun v := ⟨fun i => v i, v.sum_coe⟩ @@ -86,6 +88,7 @@ instance instContinuousSMul : ContinuousSMul ℝ (ZeroSum n) where ((continuous_apply i).comp (continuous_induced_dom.comp continuous_snd)) /-- The inclusion of the zero-sum representation into the full coordinate space. -/ +@[expose] def coeLinearMap : ZeroSum n →ₗ[ℝ] (Fin n → ℝ) where toFun v := fun i => v i map_add' _ _ := rfl diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron.lean index 5c54825bbc..cbd0604f55 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron.lean @@ -11,4 +11,4 @@ public import LeanPool.NandakumarRamanaRao.NRR.PrimePolyhedron.FoxNeuwirth /-! Supporting modules for Equal-area and equal-perimeter convex partitions. -/ -@[expose] public section +public section diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FiniteCells.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FiniteCells.lean index 74385d051b..68965fb3fd 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FiniteCells.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FiniteCells.lean @@ -19,13 +19,14 @@ This module defines standard simplex coordinates as nonnegative weights summing with their induced topology and relative interior. -/ -@[expose] public section +public section namespace NRR open scoped BigOperators /-- Barycentric coordinates of the standard `d`-simplex. -/ +@[expose] def StandardSimplex (d : ℕ) := {w : Fin (d + 1) → ℝ // (∀ i, 0 ≤ w i) ∧ ∑ i, w i = 1} @@ -46,6 +47,7 @@ instance (d : ℕ) : CoeFun (StandardSimplex d) (fun _ => Fin (d + 1) → ℝ) : w.2.2 /-- The relative interior of the standard simplex. -/ +@[expose] def IsInterior {d : ℕ} (w : StandardSimplex d) : Prop := ∀ i, 0 < w i diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth.lean index 879ceacf34..cd348280d7 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth.lean @@ -114,4 +114,4 @@ boundary relations, the order-complex skeleton, modulo-prime orbit cancellation, reference-zero orbit count. -/ -@[expose] public section +public section diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ActualCellularBoundary.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ActualCellularBoundary.lean index a7c838d22c..14cc198296 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ActualCellularBoundary.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ActualCellularBoundary.lean @@ -22,7 +22,7 @@ prime cycle theorem reduces to the concrete shuffle-cardinality statement for co cells. -/ -@[expose] public section +public section namespace NRR @@ -47,6 +47,7 @@ noncomputable def topExtensionMultiplicity (a : BarredPermutation p) : Nat := (topExtensions a).card /-- The actual coefficient of `a` in the boundary of the oriented top-cell sum. -/ +@[expose] noncomputable def actualTopBoundaryCoefficient (a : BarredPermutation p) : ZMod p := ∑ c : BarredPermutation.TopCell p, @@ -141,6 +142,7 @@ theorem bars_eq_singleton_facetBar (Finset.card_eq_one.mp (bars_card_eq_one_of_codimOne hp a ha)) /-- Size of the first ordered block of a codimension-one cell. -/ +@[expose] noncomputable def facetLeftSize (hp : Nat.Prime p) (a : BarredPermutation p) (ha : a.dualDimension = p - 2) : Nat := @@ -161,6 +163,7 @@ noncomputable def facetLeftSize omega /-- Labels in the first ordered block, expressed directly by their rank before the unique bar. -/ +@[expose] def FirstBlockLabel (hp : Nat.Prime p) (a : BarredPermutation p) (ha : a.dualDimension = p - 2) := @@ -173,6 +176,7 @@ noncomputable instance (hp : Nat.Prime p) (a : BarredPermutation p) exact Fintype.ofFinite _ /-- The first block has the expected finite cardinality. -/ +@[expose] noncomputable def firstBlockEquivFin (hp : Nat.Prime p) (a : BarredPermutation p) (ha : a.dualDimension = p - 2) : @@ -195,6 +199,7 @@ noncomputable def firstBlockEquivFin rw [Fintype.card_congr (firstBlockEquivFin hp a ha), Fintype.card_fin] /-- Top-cell extensions as a finite subtype. -/ +@[expose] def TopExtension (a : BarredPermutation p) := {c : BarredPermutation.TopCell p // a.IsFacet (c : BarredPermutation p)} @@ -216,7 +221,7 @@ noncomputable instance (a : BarredPermutation p) : DecidableEq (TopExtension a) rw [topExtensionMultiplicity, Fintype.card_congr e, Fintype.card_coe] /-- Positions occupied by the first block inside a candidate top-cell order. -/ -noncomputable def firstBlockPositions +@[expose] noncomputable def firstBlockPositions (hp : Nat.Prime p) (a : BarredPermutation p) (ha : a.dualDimension = p - 2) (c : BarredPermutation.TopCell p) : Finset (Fin p) := @@ -237,6 +242,7 @@ noncomputable def firstBlockPositions exact (c : BarredPermutation p).rank.injective hij /-- Canonical map sending a top-cell extension to the positions occupied by the first block. -/ +@[expose] noncomputable def topExtensionToShuffle (hp : Nat.Prime p) (a : BarredPermutation p) (ha : a.dualDimension = p - 2) : @@ -253,6 +259,7 @@ def FacetShuffleCardinality (p : Nat) : Prop := topExtensionMultiplicity a = p.choose k /-- Concrete bijectivity statement for the canonical extension-to-shuffle map. -/ +@[expose] def FacetShuffleBijection (hp : Nat.Prime p) : Prop := ∀ (a : BarredPermutation p) (ha : a.dualDimension = p - 2), Function.Bijective (topExtensionToShuffle hp a ha) diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/AffineBarycentricSubdivisionCarrier.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/AffineBarycentricSubdivisionCarrier.lean index ea990b8d4f..95da23c5a0 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/AffineBarycentricSubdivisionCarrier.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/AffineBarycentricSubdivisionCarrier.lean @@ -23,7 +23,7 @@ is determined by the image point itself. These are the algebraic carrier facts piecewise-affine interpolation agrees on overlapping barycentric-subdivision simplices. -/ -@[expose] public section +public section open scoped BigOperators open Finset diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/AffinePositiveRayBoundary.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/AffinePositiveRayBoundary.lean index 9e9284764b..7fcde4847b 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/AffinePositiveRayBoundary.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/AffinePositiveRayBoundary.lean @@ -28,7 +28,7 @@ endpoints with the alternating facet determinants. The full-origin avoidance hy coordinate mean have a constant sign along the interval. -/ -@[expose] public section +public section namespace NRR @@ -46,55 +46,61 @@ structure VertexMap (p : Nat) where namespace VertexMap /-- Full affine interpolation. -/ -noncomputable def affineValue +@[expose] noncomputable def affineValue (V : VertexMap p) (w : StandardSimplex p) : Fin p → Real := fun r => ∑ i : Fin (p + 1), w i * V.value i r /-- Fixed difference coordinate. -/ +@[expose] noncomputable def deviation (hp : Nat.Prime p) (y : Fin p → Real) (r : Fin (p - 1)) : Real := y (FoxNeuwirthOrderComplex.ReferenceAffineOrbitCount.coordinateLabel hp r) - y (FoxNeuwirthOrderComplex.ReferenceAffineOrbitCount.lastLabel hp) /-- Mean coordinate. -/ +@[expose] noncomputable def mean (p : Nat) (y : Fin p → Real) : Real := coordinateMean p y /-- Restriction to the facet omitting vertex `k`. -/ +@[expose] noncomputable def facetValue (V : VertexMap p) (k : Fin (p + 1)) (i : Fin p) : Fin p → Real := V.value (k.succAbove i) /-- Reindex the `p` augmented rows as the `p - 1` deviation rows followed by the constant row. -/ +@[expose] def augmentedRowEquiv (hp : Nat.Prime p) : Fin p ≃ Fin (p - 1 + 1) := (Fin.castOrderIso (Nat.sub_add_cancel hp.pos).symm).toEquiv /-- Augmented deviation matrix of an oriented facet. -/ -noncomputable def facetMatrix +@[expose] noncomputable def facetMatrix (hp : Nat.Prime p) (V : VertexMap p) (k : Fin (p + 1)) : Matrix (Fin p) (Fin p) Real := fun r i => Fin.lastCases (1 : Real) (fun q => deviation hp (facetValue V k i) q) (augmentedRowEquiv hp r) /-- Facet determinant. -/ -noncomputable def facetDeterminant +@[expose] noncomputable def facetDeterminant (hp : Nat.Prime p) (V : VertexMap p) (k : Fin (p + 1)) : Real := Matrix.det (facetMatrix hp V k) /-- Canonical embedding of the `p` facet-vertex indices into the coordinate type of `StandardSimplex (p - 1)`. For positive `p` this is an equivalence; the inclusion form keeps `facetAffineValue` meaningful without adding a positivity hypothesis to its public API. -/ +@[expose] def facetCoordinateIndex (i : Fin p) : Fin ((p - 1) + 1) := Fin.castLE (by omega) i /-- Full-coordinate affine interpolation on a facet. -/ -noncomputable def facetAffineValue +@[expose] noncomputable def facetAffineValue (V : VertexMap p) (k : Fin (p + 1)) (w : StandardSimplex (p - 1)) : Fin p → Real := fun r => ∑ i : Fin p, w (facetCoordinateIndex i) * facetValue V k i r /-- A relative-interior intersection of a facet with the positive diagonal ray. -/ +@[expose] def FacetHasPositiveRayIntersection (hp : Nat.Prime p) (V : VertexMap p) (k : Fin (p + 1)) : Prop := ∃ w : StandardSimplex (p - 1), @@ -108,6 +114,7 @@ noncomputable instance facetHasPositiveRayIntersectionDecidable Classical.propDecidable _ /-- Signed positive-ray intersection number of one oriented facet. -/ +@[expose] noncomputable def facetIndex (hp : Nat.Prime p) (V : VertexMap p) (k : Fin (p + 1)) : ZMod p := if FacetHasPositiveRayIntersection hp V k then @@ -117,16 +124,19 @@ noncomputable def facetIndex else 0 /-- The affine simplex avoids the full origin. -/ +@[expose] def AvoidsOrigin (V : VertexMap p) : Prop := ∀ w : StandardSimplex p, affineValue V w ≠ 0 /-- Facet transversality. -/ +@[expose] def FacetRegular (hp : Nat.Prime p) (V : VertexMap p) : Prop := ∀ k : Fin (p + 1), facetDeterminant hp V k ≠ 0 /-- The deviation-zero affine line does not meet a codimension-two face of the simplex. This is the general-position condition needed to rule out a ray endpoint at the intersection of two facets. Facet regularity alone does not imply this condition. -/ +@[expose] def AvoidsCodimTwoDeviationZero (hp : Nat.Prime p) (V : VertexMap p) : Prop := ∀ (w : StandardSimplex p) (i j : Fin (p + 1)), i ≠ j → (∀ r : Fin (p - 1), deviation hp (affineValue V w) r = 0) → @@ -134,6 +144,7 @@ def AvoidsCodimTwoDeviationZero (hp : Nat.Prime p) (V : VertexMap p) : Prop := /-- Positive-ray-relative codimension-two avoidance. Degenerate deviation-zero points with negative mean are irrelevant to the open positive ray and are intentionally permitted. -/ +@[expose] def AvoidsPositiveRayCodimTwo (hp : Nat.Prime p) (V : VertexMap p) : Prop := ∀ (w : StandardSimplex p) (i j : Fin (p + 1)), i ≠ j → (∀ r : Fin (p - 1), deviation hp (affineValue V w) r = 0) → @@ -514,6 +525,7 @@ noncomputable def lineCoordinate /-- Parameters for which the cofactor line remains in the standard simplex. The barycentric sum is automatic because the cofactor direction has coordinate sum zero, so feasibility consists only of the coordinatewise nonnegativity inequalities. -/ +@[expose] def LineFeasible (hp : Nat.Prime p) (V : VertexMap p) (w : StandardSimplex p) (t : Real) : Prop := @@ -863,6 +875,7 @@ theorem upperEndpoint_coordinate_eq_zero field_simp [hc]; ring /-- A feasible line parameter gives a barycentric point of the standard simplex. -/ +@[expose] noncomputable def lineSimplexPoint (hp : Nat.Prime p) (V : VertexMap p) (w : StandardSimplex p) (t : Real) (ht : LineFeasible hp V w t) : StandardSimplex p := @@ -1452,6 +1465,7 @@ def facetIndexEquiv (hp : Nat.Prime p) : Fin ((p - 1) + 1) ≃ Fin p := /-- Restrict a simplex point whose `k`-th coordinate vanishes to barycentric coordinates on the facet omitting vertex `k`. -/ +@[expose] noncomputable def facetCoordinates (hp : Nat.Prime p) (w : StandardSimplex p) (k : Fin (p + 1)) (hk : w k = 0) : StandardSimplex (p - 1) := @@ -1692,6 +1706,7 @@ theorem fullSimplexOfFacet_positiveRayData fullSimplexOfFacet_mean_pos hp V k u hmean⟩ /-- The simplex point at the lower feasible parameter. -/ +@[expose] noncomputable def lowerEndpointSimplexPoint (hp : Nat.Prime p) (V : VertexMap p) (hregular : FacetRegular hp V) (w : StandardSimplex p) : StandardSimplex p := @@ -1699,6 +1714,7 @@ noncomputable def lowerEndpointSimplexPoint (lowerParameter_feasible hp V hregular w) /-- The simplex point at the upper feasible parameter. -/ +@[expose] noncomputable def upperEndpointSimplexPoint (hp : Nat.Prime p) (V : VertexMap p) (hregular : FacetRegular hp V) (w : StandardSimplex p) : StandardSimplex p := diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/AffinePrismObstruction.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/AffinePrismObstruction.lean index d61e7f2f39..2b5cd362a4 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/AffinePrismObstruction.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/AffinePrismObstruction.lean @@ -31,7 +31,7 @@ upper-end prism from the S5 reference map. It does not contain a separator or a constancy as a field. -/ -@[expose] public section +public section namespace NRR @@ -65,6 +65,7 @@ structure CoordinateAffineVertexMap (p : Nat) where namespace CoordinateAffineVertexMap /-- Affine interpolation of the full coordinate vector on one maximal simplex. -/ +@[expose] noncomputable def value (F : CoordinateAffineVertexMap p) (s : Simplex p (p - 1)) @@ -73,7 +74,7 @@ noncomputable def value /-- Global piecewise-affine coordinate map on the barycentric realization. -/ -noncomputable def globalValue +@[expose] noncomputable def globalValue (F : CoordinateAffineVertexMap p) (x : Realization p) : Fin p → Real := fun i => ∑ c : BarredPermutation p, x c * F.vertexValue c i @@ -95,7 +96,7 @@ theorem continuous_globalValue ((continuous_apply c).comp continuous_subtype_val).mul continuous_const /-- Fixed difference-coordinate representation of the zero-sum/deviation part. -/ -noncomputable def deviation +@[expose] noncomputable def deviation (hp : Nat.Prime p) (F : CoordinateAffineVertexMap p) : AffineVertexMap p (p - 1) where vertexValue c r := @@ -103,7 +104,7 @@ noncomputable def deviation F.vertexValue c (ReferenceAffineOrbitCount.lastLabel hp) /-- Mean of the affine coordinate vector. -/ -noncomputable def mean +@[expose] noncomputable def mean (p : Nat) (F : CoordinateAffineVertexMap p) (s : Simplex p (p - 1)) @@ -124,6 +125,7 @@ theorem deviation_value_apply /-- A positive zero is a relative-interior zero of the deviation map at which the common coordinate mean is positive. -/ +@[expose] def HasPositiveInteriorZero (hp : Nat.Prime p) (F : CoordinateAffineVertexMap p) @@ -141,7 +143,7 @@ noncomputable instance hasPositiveInteriorZeroDecidable Classical.propDecidable _ /-- Signed local contribution of a positive deviation zero. -/ -noncomputable def positiveLocalZeroIndex +@[expose] noncomputable def positiveLocalZeroIndex (hp : Nat.Prime p) (F : CoordinateAffineVertexMap p) (s : Simplex p (p - 1)) : ZMod p := @@ -247,7 +249,7 @@ namespace AffinePrismObstruction open CoordinateAffineVertexMap /-- Positive local-index cochain on the S4 top-orbit representatives. -/ -noncomputable def positiveIndex +@[expose] noncomputable def positiveIndex (hp : Nat.Prime p) (F : CoordinateAffineVertexMap p) : PrimeOrbitCycle.TopOrbit hp → ZMod p := diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/AffineSubdivisionDeterminant.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/AffineSubdivisionDeterminant.lean index 631dad5c1b..4ebf52ba00 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/AffineSubdivisionDeterminant.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/AffineSubdivisionDeterminant.lean @@ -13,7 +13,7 @@ public import Mathlib.LinearAlgebra.Matrix.Permutation /-! # Affine Subdivision Determinant -/ -@[expose] public section +public section open scoped BigOperators open SphereOddDegree @@ -23,13 +23,13 @@ open SphereOddDegree.BarycentricSubdivisionDiameter namespace NRR namespace AffineSubdivisionDeterminant /-- Matrix whose columns are the vertices of one barycentric subdivision simplex. -/ -noncomputable def stepVertexMatrix +@[expose] noncomputable def stepVertexMatrix (n : Nat) (pi : Equiv.Perm (Fin (n + 1))) : Matrix (Fin (n + 1)) (Fin (n + 1)) Real := fun r k => (prefixBarycenter n pi k).val r /-- Lower triangular prefix-average matrix before permutation of coordinates. -/ -noncomputable def prefixAverageMatrix (n : Nat) : +@[expose] noncomputable def prefixAverageMatrix (n : Nat) : Matrix (Fin (n + 1)) (Fin (n + 1)) Real := fun r k => if r.1 ≤ k.1 then (k.1 + 1 : Real)⁻¹ else 0 @@ -98,6 +98,7 @@ theorem det_stepVertexMatrix_ne_zero exact mul_ne_zero hsign hprod /-- Vertex matrix of an iterated affine subdivision simplex. -/ +@[expose] noncomputable def iterVertexMatrix (n N : Nat) (rho : Fin N → Equiv.Perm (Fin (n + 1))) : Matrix (Fin (n + 1)) (Fin (n + 1)) Real := diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/BarredPermutation.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/BarredPermutation.lean index b12dd3f80d..4359e92ce8 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/BarredPermutation.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/BarredPermutation.lean @@ -21,7 +21,7 @@ The dual Fox--Neuwirth cell has dimension `p - blockCount`. Thus one-block symb dual cells of dimension `p - 1`, while the all-singleton symbols index vertices. -/ -@[expose] public section +public section namespace NRR @@ -52,11 +52,11 @@ namespace BarredPermutation simp_all /-- Number of bars strictly before the rank of a label. This is the zero-based block number. -/ -def blockIndex (c : BarredPermutation p) (i : Fin p) : ℕ := +@[expose] def blockIndex (c : BarredPermutation p) (i : Fin p) : ℕ := (c.bars.filter fun k => k.1 < (c.rank i).1).card /-- Two labels lie on the same vertical line in the represented stratum. -/ -def SameBlock (c : BarredPermutation p) (i j : Fin p) : Prop := +@[expose] def SameBlock (c : BarredPermutation p) (i j : Fin p) : Prop := c.blockIndex i = c.blockIndex j instance (c : BarredPermutation p) : DecidableRel c.SameBlock := @@ -71,7 +71,7 @@ def dualDimension (c : BarredPermutation p) : ℕ := p - c.blockCount /-- One-block symbols are the top-dimensional dual cells. -/ -def IsTop (c : BarredPermutation p) : Prop := +@[expose] def IsTop (c : BarredPermutation p) : Prop := c.bars = ∅ instance isTopDecidable (c : BarredPermutation p) : Decidable c.IsTop := by @@ -79,10 +79,11 @@ instance isTopDecidable (c : BarredPermutation p) : Decidable c.IsTop := by infer_instance /-- All-singleton symbols are vertices of the dual complex. -/ -def IsVertex (c : BarredPermutation p) : Prop := +@[expose] def IsVertex (c : BarredPermutation p) : Prop := c.bars = Finset.univ /-- Relabel a symbol by precomposition with `σ.symm`, matching `Config.relabel`. -/ +@[expose] def relabel (σ : Equiv.Perm (Fin p)) (c : BarredPermutation p) : BarredPermutation p where rank := σ.symm.trans c.rank @@ -151,6 +152,7 @@ theorem relabel_mul `a.IsFace b` means that the stratum symbol `a` is a refinement of `b`: ordered blocks of `a` may be merged, but never reordered, and the vertical order inside every block of `a` is preserved. The final conjunct records the corresponding dual-dimension inequality explicitly. -/ +@[expose] def IsFace (a b : BarredPermutation p) : Prop := (∀ i j, a.blockIndex i ≤ a.blockIndex j → b.blockIndex i ≤ b.blockIndex j) ∧ @@ -192,6 +194,7 @@ theorem isFace_relabel exact h.2.1 (σ.symm i) (σ.symm j) hij /-- Codimension-one face relation. -/ +@[expose] def IsFacet (a b : BarredPermutation p) : Prop := a.IsFace b ∧ a.dualDimension + 1 = b.dualDimension diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/CanonicalConfiguration.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/CanonicalConfiguration.lean index b3e9722e30..4c3694e212 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/CanonicalConfiguration.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/CanonicalConfiguration.lean @@ -17,7 +17,7 @@ block number and the second coordinate is the permutation rank. This realizes e Fox--Neuwirth symbol by an actual collision-free configuration and is equivariant for relabelling. -/ -@[expose] public section +public section namespace NRR @@ -54,6 +54,7 @@ theorem canonicalPoint_injective (c : BarredPermutation p) : exact_mod_cast hy /-- Concrete configuration representing the stratum symbol. -/ +@[expose] noncomputable def canonicalConfig (c : BarredPermutation p) : Config p := ⟨c.canonicalPoint, c.canonicalPoint_injective⟩ diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/CellAtlas.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/CellAtlas.lean index c019d3ef3a..91c566a741 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/CellAtlas.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/CellAtlas.lean @@ -16,7 +16,7 @@ records the closed and open cell components, their compactness, and the explicit The later mod-`p` cycle construction replaces this disjoint atlas by the invariant glued chain. -/ -@[expose] public section +public section namespace NRR @@ -35,6 +35,7 @@ def cellInterior (c : FoxNeuwirthTopCell p) : {z | z.1 = c ∧ ∀ i, 0 < z.2 i} /-- Standard simplex chart for one component. -/ +@[expose] def cellParam (c : FoxNeuwirthTopCell p) : FoxNeuwirthWeights p → FoxNeuwirthTopCellModelPoint p := fun w => (c, w) @@ -95,6 +96,7 @@ theorem cellCarrier_cover : simp [cellCarrier] /-- The declared dimension of every maximal component. -/ +@[expose] def cellDimension (p : Nat) (_c : FoxNeuwirthTopCell p) : ℕ := p - 1 diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ChartMapCollarRepresentation.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ChartMapCollarRepresentation.lean index f66bd6bff5..3fe88abede 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ChartMapCollarRepresentation.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ChartMapCollarRepresentation.lean @@ -18,7 +18,7 @@ coordinate. It therefore passes through collar composition and interval reversa assignments representing the same chart map agree automatically on a composition seam. -/ -@[expose] public section +public section namespace NRR namespace FoxNeuwirthOrderComplex @@ -39,6 +39,7 @@ variable {hp : Nat.Prime p} /-- Every decorated local occurrence is evaluated through one chart of `K` at the represented spatial point. -/ +@[expose] def Represents (C : RelativeAffineCellSystem hp A B M L) (K : ChartMap hp N) diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ChildMapLocalHomotopy.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ChildMapLocalHomotopy.lean index fde07411ca..7ce43a22ef 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ChildMapLocalHomotopy.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ChildMapLocalHomotopy.lean @@ -19,7 +19,7 @@ estimate. Consequently, outside the projected full-zero set, nearby frozen chil by a zero-free straight-line homotopy. -/ -@[expose] public section +public section namespace NRR @@ -32,6 +32,7 @@ namespace EquivariantCoordinateHomotopy variable {p : Nat} /-- Joint child coordinate map, with the parent/interval parameter left variable. -/ +@[expose] noncomputable def childFamilyMap {K : Geometry.ConvexBody Plane} {A : Real} (hp : Nat.Prime p) (hA : 0 < A) diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ChildReferenceHomotopy.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ChildReferenceHomotopy.lean index c280f91a1a..1db0b9bb8d 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ChildReferenceHomotopy.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ChildReferenceHomotopy.lean @@ -16,7 +16,7 @@ coordinate is positive. Hence the straight-line segments to the corresponding s reference lifts remain in the negative and positive orthants, respectively. -/ -@[expose] public section +public section namespace NRR diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/CompatibleChartMapOneStep.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/CompatibleChartMapOneStep.lean index 81845d2fd9..b7682a7191 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/CompatibleChartMapOneStep.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/CompatibleChartMapOneStep.lean @@ -22,7 +22,7 @@ identifies the local affine interpolation with evaluation of the same chart map image of the cell, so zero-freeness is inherited without a new estimate. -/ -@[expose] public section +public section namespace NRR namespace FoxNeuwirthOrderComplex @@ -133,6 +133,7 @@ noncomputable abbrev Cells (hp : Nat.Prime p) (N : Nat) := /-- Spatial coordinate, in the current top-simplex chart, represented by one local cylinder vertex. -/ +@[expose] noncomputable def localSpatialWeight (hp : Nat.Prime p) (N : Nat) (s : (Cells hp N).VertexSlot) : StandardSimplex (p - 1) := @@ -141,13 +142,13 @@ noncomputable def localSpatialWeight (S := Real) s.2)).1 /-- Local value supplied by a compatible chart map. -/ -noncomputable def localVector +@[expose] noncomputable def localVector (hp : Nat.Prime p) {N : Nat} (K : ChartMap hp N) (s : (Cells hp N).VertexSlot) : Fin p → Real := K.value s.1.1 (localSpatialWeight hp N s) /-- Prime-decorated local value. -/ -noncomputable def decoratedVector +@[expose] noncomputable def decoratedVector (hp : Nat.Prime p) {N : Nat} (K : ChartMap hp N) (s : CoverVertexSlot hp (Cells hp N)) : Fin p → Real := s.1 • localVector hp K s.2 @@ -168,6 +169,7 @@ theorem decoratedVector_eq_of_coverPoint_eq EquivariantPrismVertexParameters.CylinderPoint.ofProd] using hspatial /-- Global vector obtained by quotient descent. -/ +@[expose] noncomputable def globalVector (hp : Nat.Prime p) {N : Nat} (K : ChartMap hp N) : GlobalVertex hp (Cells hp N) → Fin p → Real := @@ -190,6 +192,7 @@ theorem globalVector_smul rfl /-- Canonical one-step assignment associated with a compatible chart map. -/ +@[expose] noncomputable def assignment (hp : Nat.Prime p) {N : Nat} (K : ChartMap hp N) : Assignment hp (Cells hp N) := diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/CompatibleRefinedChartHomotopy.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/CompatibleRefinedChartHomotopy.lean index d0e5779102..25a8065351 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/CompatibleRefinedChartHomotopy.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/CompatibleRefinedChartHomotopy.lean @@ -24,7 +24,7 @@ so no global quotient-map construction is required. Decorated compatibility is condition needed for those samples to descend to global collar vertices. -/ -@[expose] public section +public section namespace NRR namespace FoxNeuwirthOrderComplex @@ -82,16 +82,19 @@ structure ChartHomotopy zeroFree : forall q w t, value q w t ≠ 0 /-- Prefix top cell of a chart after `k` additional subdivision stages. -/ +@[expose] noncomputable def ancestorTopCell (hp : Nat.Prime p) (N k : Nat) (q : TopCell hp (N + k)) : TopCell hp N := (q.1, (splitRefinementWord N k q.2).1) /-- Tail subdivision word of a chart after splitting off its first `N` stages. -/ +@[expose] noncomputable def ancestorTail {hp : Nat.Prime p} (N k : Nat) (q : TopCell hp (N + k)) : RefinementWord p k := (splitRefinementWord N k q.2).2 /-- Pull a standard-simplex coordinate back to the ancestor chart. -/ +@[expose] noncomputable def ancestorWeight {hp : Nat.Prime p} (N k : Nat) (q : TopCell hp (N + k)) (w : StandardSimplex (p - 1)) : StandardSimplex (p - 1) := @@ -134,6 +137,7 @@ theorem continuous_ancestorWeight continuous_toDelta) /-- Further spatial refinement of a compatible chart map. -/ +@[expose] noncomputable def ChartMap.refine {hp : Nat.Prime p} {N : Nat} (K : ChartMap hp N) (k : Nat) : ChartMap hp (N + k) where @@ -168,6 +172,7 @@ noncomputable def ChartHomotopy.refine zeroFree := by intro q w t; exact J.zeroFree _ _ _ /-- The affine interpolation stored by one regular approximation, as a compatible chart map. -/ +@[expose] noncomputable def baseOriginalPLMap (hp : Nat.Prime p) {F : ContinuousCoordinateMap p} @@ -190,6 +195,7 @@ noncomputable def baseOriginalPLMap simpa using h /-- The same original PL interpolation represented on a further subdivision. -/ +@[expose] noncomputable def originalPLMap (hp : Nat.Prime p) {F : ContinuousCoordinateMap p} @@ -416,6 +422,7 @@ noncomputable def globalToOriginalPL (originalPLToGlobal hp F A k).symm /-- Transport a compatible chart map along an equality of subdivision levels. -/ +@[expose] noncomputable def ChartMap.castLevel {hp : Nat.Prime p} {N M : Nat} (h : N = M) (K : ChartMap hp N) : ChartMap hp M := h ▸ K @@ -435,6 +442,7 @@ noncomputable def ChartHomotopy.castLevel exact J /-- Canonical common spatial level used by the PL-ended middle homotopy. -/ +@[expose] def baseCommonLevel {hp : Nat.Prime p} {F0 F1 : ZeroFreeMap hp} (A0 : StableRegularApproximation hp F0.map) diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/CompatibleRefinedChartHomotopyPrism.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/CompatibleRefinedChartHomotopyPrism.lean index 5e9613e8a1..f6eaa98631 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/CompatibleRefinedChartHomotopyPrism.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/CompatibleRefinedChartHomotopyPrism.lean @@ -23,7 +23,7 @@ interpolation of the samples remain within half that margin. The resulting midd assignment is origin-free and its two horizontal boundaries are the exact endpoint chart maps. -/ -@[expose] public section +public section namespace NRR namespace FoxNeuwirthOrderComplex @@ -145,6 +145,7 @@ noncomputable def localVector (StandardSimplex.ofDelta (SphereOddDegree.FiniteSimplex.vertex (S := Real) s.2)) /-- Prime-decorated local prism sample. -/ +@[expose] noncomputable def decoratedVector (hp : Nat.Prime p) {N : Nat} {K0 K1 : ChartMap hp N} (J : ChartHomotopy hp N K0 K1) @@ -196,6 +197,7 @@ theorem decoratedVector_eq_of_coverPoint_eq za.1 zb.1 za.2 hzspatial /-- Global prism vector by quotient descent. -/ +@[expose] noncomputable def globalVector (hp : Nat.Prime p) {N : Nat} {K0 K1 : ChartMap hp N} (J : ChartHomotopy hp N K0 K1) (L : Nat) : @@ -215,6 +217,7 @@ theorem globalVector_smul rfl /-- Compatible assignment obtained from chart-homotopy samples. -/ +@[expose] noncomputable def assignment (hp : Nat.Prime p) {N : Nat} {K0 K1 : ChartMap hp N} (J : ChartHomotopy hp N K0 K1) (L : Nat) : diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/CoordinateEquivariance.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/CoordinateEquivariance.lean index 21e4ef7510..8eb779bac8 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/CoordinateEquivariance.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/CoordinateEquivariance.lean @@ -12,7 +12,7 @@ public import LeanPool.NandakumarRamanaRao.NRR.PrimePolyhedron.FoxNeuwirth.Refin # Prime-equivariant coordinate maps -/ -@[expose] public section +public section namespace NRR namespace FoxNeuwirthOrderComplex @@ -20,6 +20,7 @@ namespace FoxNeuwirthOrderComplex variable {p : Nat} /-- Prime-equivariance of a continuous full-coordinate map. -/ +@[expose] def IsEquivariantCoordinateMap (p : Nat) (F : RefinedAffineMap.ContinuousCoordinateMap p) : Prop := diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EndpointFaceRefinement.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EndpointFaceRefinement.lean index 974b11aa90..e335bc5591 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EndpointFaceRefinement.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EndpointFaceRefinement.lean @@ -18,7 +18,7 @@ permutations and proves the affine compatibility identity used by both the stabl interpolant and the explicit middle collar. -/ -@[expose] public section +public section namespace NRR @@ -116,6 +116,7 @@ theorem affineCompMap_extendSpatialRefinementWord_lastFace /-- Lift a refinement permutation of one boundary face to an ambient permutation whose final facet is that boundary face. -/ +@[expose] noncomputable def liftFacePermutation (n : Nat) (j : Fin (n + 2)) (pi : Equiv.Perm (Fin (n + 1))) : Equiv.Perm (Fin (n + 2)) := @@ -204,6 +205,7 @@ theorem affineCompMap_liftFaceRefinementWord /-- Last-face lifting for a boundary face of `Fin (p + 1)`, without exposing predecessor casts in subsequent definitions. -/ +@[expose] noncomputable def liftBoundaryPermutation {p : Nat} (j : Fin (p + 1)) (pi : Equiv.Perm (Fin p)) : Equiv.Perm (Fin (p + 1)) := match p with @@ -220,6 +222,7 @@ noncomputable def liftBoundaryRefinementWord (fun r => extendSpatialPermutation (eta r.succ)) /-- Facet omitted by a canonical endpoint occurrence. -/ +@[expose] def endpointOmittedPrime (L : Nat) (j : Fin (p + 1)) : Fin (p + 1) := match L with @@ -260,12 +263,14 @@ theorem affineCompMap_liftBoundaryRefinementWord exact affineCompMap_liftFaceRefinementWord n L j eta x /-- Split a refinement word of length `N + L` into its prefix and tail. -/ +@[expose] def splitRefinementWord (N L : Nat) (rho : RefinementWord p (N + L)) : RefinementWord p N × RefinementWord p L := (fun i => rho (Fin.castAdd L i), fun i => rho (Fin.natAdd N i)) /-- Concatenate two refinement words. -/ +@[expose] def appendRefinementWord (N L : Nat) (rho : RefinementWord p N) (eta : RefinementWord p L) : RefinementWord p (N + L) := @@ -350,6 +355,7 @@ theorem affineCompMap_append simp [splitRefinementWord, appendRefinementWord] /-- Reindex a horizontal endpoint simplex as a top cell at the combined refinement level. -/ +@[expose] noncomputable def endpointTopCell (hp : Nat.Prime p) (N L : Nat) (q : TopCell hp N) (eta : RefinementWord p L) : diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EndpointStackAffinePullbackCore.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EndpointStackAffinePullbackCore.lean index d388d9d9c0..76849bca1a 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EndpointStackAffinePullbackCore.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EndpointStackAffinePullbackCore.lean @@ -26,7 +26,7 @@ This file proves the complete simplex-local statement. Global iteration only ne face-gluing theorem saying that the parent PL values agree on shared refined faces. -/ -@[expose] public section +public section namespace NRR namespace FoxNeuwirthOrderComplex @@ -42,14 +42,17 @@ open RefinedAffineMap variable {p d n : Nat} /-- The identity correspondence between parent vertex indices. -/ +@[expose] def parentIndex (p : Nat) : Fin (p - 1 + 1) → Fin (p - 1 + 1) := id /-- Cast cylinder vertex indices to the dimension convention for the endpoint stack. -/ +@[expose] def cylinderIndex (hp : Nat.Prime p) : Fin (p + 1) → Fin (p - 1 + 2) := Fin.cast (by have := hp.pos; omega) /-- Evaluate parent-simplex affine vertex data at the spatial point of one local cylinder vertex. -/ +@[expose] noncomputable def pullbackVertexValue (d : Nat) (q : RelativeSubdivisionCylinderCombinatorics.Cell d) (V : Fin (d + 1) → Fin n → Real) diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EndpointStackAffinePullbackDescent.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EndpointStackAffinePullbackDescent.lean index 282205994e..41f8950c4c 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EndpointStackAffinePullbackDescent.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EndpointStackAffinePullbackDescent.lean @@ -24,7 +24,7 @@ The upper values are the ordinary PL values at the next barycentric-subdivision vertices. Hence this convention is seam-compatible under iteration. -/ -@[expose] public section +public section namespace NRR namespace FoxNeuwirthOrderComplex @@ -154,6 +154,7 @@ theorem oneStepAffinePullbackCompatible (localSpatialWeight hp A.level b.2) hchart /-- Compatible affine-pullback values descend to global collar vertices. -/ +@[expose] noncomputable def globalPullbackVector (hp : Nat.Prime p) {F : ContinuousCoordinateMap p} diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EndpointStackGlobalDescent.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EndpointStackGlobalDescent.lean index c6601de9b6..d142897546 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EndpointStackGlobalDescent.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EndpointStackGlobalDescent.lean @@ -22,7 +22,7 @@ recovers the local cell values and cellwise origin avoidance. No compatibility hidden: the required compatibility theorem is `OneStepLastVertexCompatible`. -/ -@[expose] public section +public section namespace NRR namespace FoxNeuwirthOrderComplex @@ -127,6 +127,7 @@ theorem oneStepLastVertexCompatible_of_pointCompatible exact congrArg A.map (hpoint a b hab) /-- Under the exact overlap theorem, the selected vectors descend to global collar vertices. -/ +@[expose] noncomputable def globalSelectedVector (hp : Nat.Prime p) {F : ContinuousCoordinateMap p} diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EndpointStackIteratedAffinePullback.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EndpointStackIteratedAffinePullback.lean index 0327870d6d..f69e0d046f 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EndpointStackIteratedAffinePullback.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EndpointStackIteratedAffinePullback.lean @@ -22,7 +22,7 @@ approximation. Reversing an upper stack therefore supplies the exact upper hori the final collar. -/ -@[expose] public section +public section namespace NRR namespace FoxNeuwirthOrderComplex @@ -52,6 +52,7 @@ theorem chartMap_refine_zero rfl /-- A nonempty forward stack with `k+1` one-step layers. -/ +@[expose] noncomputable def positiveWitness (hp : Nat.Prime p) (N : Nat) : (k : Nat) → Witness hp N (N + (k + 1)) @@ -144,6 +145,7 @@ structure Data open ExplicitAffineRelativeCollarComposeDescribed in /-- Construct the full positive stack by induction on the number of additional layers. -/ +@[expose] noncomputable def build (hp : Nat.Prime p) {F : ContinuousCoordinateMap p} diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EndpointStackLastVertexCore.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EndpointStackLastVertexCore.lean index f2bbd9cfbe..1eae48cd77 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EndpointStackLastVertexCore.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EndpointStackLastVertexCore.lean @@ -25,7 +25,7 @@ geometric stack vertex in different refined top cells. This overlap compatibilit `Assignment` on the quotient of global collar vertices. -/ -@[expose] public section +public section namespace NRR namespace FoxNeuwirthOrderComplex diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantCoordinateHomotopy.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantCoordinateHomotopy.lean index 4936f4e02f..cdc08f1333 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantCoordinateHomotopy.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantCoordinateHomotopy.lean @@ -23,7 +23,7 @@ avoiding zero only in the deviation representation. The projected simultaneous- exactly the locus where the full coordinate map meets the origin. -/ -@[expose] public section +public section namespace NRR @@ -155,6 +155,7 @@ end ZeroFreeHomotopy /-- A coordinate map obtained by freezing the parent-body/interval parameter in the child test map. -/ +@[expose] noncomputable def childMap {K : Geometry.ConvexBody Plane} {A : Real} (hp : Nat.Prime p) (hA : 0 < A) @@ -190,6 +191,7 @@ theorem childMap_zeroFree exact ⟨x, hx⟩ /-- The child map as a bundled zero-free equivariant map. -/ +@[expose] noncomputable def childZeroFreeMap {K : Geometry.ConvexBody Plane} {A : Real} (hp : Nat.Prime p) (hA : 0 < A) diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantPrismGenericPerturbation.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantPrismGenericPerturbation.lean index c64b1d8b81..a532d7502b 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantPrismGenericPerturbation.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantPrismGenericPerturbation.lean @@ -31,7 +31,7 @@ retains half of that margin, while polynomial nonvanishing gives facet regularit codimension-two avoidance on every refined prism simplex. -/ -@[expose] public section +public section namespace NRR @@ -54,6 +54,7 @@ variable {p : Nat} /-! ## A genuinely small generic multivariate perturbation -/ /-- Pointwise coordinate closeness of two finite parameter assignments. -/ +@[expose] def AssignmentClose {J : Type*} (a b : J → Real) (eps : Real) : Prop := ∀ j, |a j - b j| < eps @@ -277,6 +278,7 @@ theorem local_regular_and_avoidsCodimTwo_of_generic /-- A coordinate witness for a lower bound on the sup norm of every affine value. For the finite function space `Fin p → Real`, this is the concrete form needed to retain a zero-free norm margin under coordinatewise perturbation. -/ +@[expose] def LocalAffineCoordinateNormMargin (hp : Nat.Prime p) (N L : Nat) (a : Assignment hp N L) (m : Real) : Prop := diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantPrismGenericityNonzero.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantPrismGenericityNonzero.lean index 5ff22a6c99..556691b067 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantPrismGenericityNonzero.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantPrismGenericityNonzero.lean @@ -24,7 +24,7 @@ identity deviation matrix. Evaluation at the corresponding assignments proves t polynomial families, and hence the combined family, are nonzero. -/ -@[expose] public section +public section namespace NRR @@ -465,6 +465,7 @@ theorem prism_vertex_orbit_injective /-! ## Local scalar-site independence and assignment realization -/ /-- Parameter represented by one scalar coordinate at one local prism vertex. -/ +@[expose] noncomputable def localParameter (hp : Nat.Prime p) (N L : Nat) (q : PrismCell hp N L) (i : Fin (p + 1)) (j : Fin p) : Parameter hp N L := diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantPrismGenericityPolynomials.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantPrismGenericityPolynomials.lean index 9909c5bd9b..f820d26d0c 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantPrismGenericityPolynomials.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantPrismGenericityPolynomials.lean @@ -30,7 +30,7 @@ assignment. A final sum type packages the two finite families for direct use wi `FiniteMultivariateGenericPerturbation.exists_small_positive_generic`. -/ -@[expose] public section +public section namespace NRR @@ -80,6 +80,7 @@ noncomputable def deviationPolynomial y (ReferenceAffineOrbitCount.lastLabel hp) /-- The real vertex map reconstructed on one refined prism simplex. -/ +@[expose] noncomputable def localVertexMap (hp : Nat.Prime p) (N L : Nat) (a : Assignment hp N L) (q : PrismCell hp N L) : @@ -87,6 +88,7 @@ noncomputable def localVertexMap value i := localVertexValue hp N L a q i /-- Evaluation at a parameter assignment, bundled as a ring homomorphism. -/ +@[expose] noncomputable def assignmentEvalHom (hp : Nat.Prime p) (N L : Nat) (a : Assignment hp N L) : PolynomialRing hp N L →+* Real := @@ -191,11 +193,13 @@ instance codimTwoFaceFintype (p : Nat) : Fintype (CodimTwoFace p) := inferInstan instance codimTwoFaceDecidableEq (p : Nat) : DecidableEq (CodimTwoFace p) := inferInstance /-- The second omission index, cast to the syntactic successor form needed by `Fin.succAbove`. -/ +@[expose] def secondOmissionIndex (hp : Nat.Prime p) (f : CodimTwoFace p) : Fin ((p - 1) + 1) := Fin.cast (by have := hp.pos; omega) f.2 /-- The vertex retained in an ordered codimension-two face after the two omissions. -/ +@[expose] def codimTwoVertex (hp : Nat.Prime p) (f : CodimTwoFace p) (i : Fin (p - 1)) : Fin (p + 1) := f.1.succAbove @@ -223,6 +227,7 @@ noncomputable def codimTwoMinorPolynomial Matrix.det (codimTwoDeviationMatrixPolynomial hp N L q f) /-- The corresponding real deviation matrix reconstructed from an assignment. -/ +@[expose] noncomputable def codimTwoDeviationMatrix (hp : Nat.Prime p) (N L : Nat) (a : Assignment hp N L) (q : PrismCell hp N L) (f : CodimTwoFace p) : @@ -263,6 +268,7 @@ noncomputable instance genericityIndexDecidableEq (hp : Nat.Prime p) (N L : Nat) : DecidableEq (GenericityIndex hp N L) := inferInstance /-- The combined finite polynomial family used by the generic perturbation theorem. -/ +@[expose] noncomputable def genericityPolynomial (hp : Nat.Prime p) (N L : Nat) : GenericityIndex hp N L → PolynomialRing hp N L diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantPrismGlobalCancellation.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantPrismGlobalCancellation.lean index f85587c7a1..9ef74c97d2 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantPrismGlobalCancellation.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantPrismGlobalCancellation.lean @@ -26,7 +26,7 @@ and the nonhorizontal part. The endpoint module proves vanishing of the nonhoriz and identifies the horizontal sums with the endpoint refined counts. -/ -@[expose] public section +public section namespace NRR @@ -53,7 +53,7 @@ variable {p : Nat} /-- Positive-ray index of an oriented facet before multiplication by its alternating boundary sign. -/ -noncomputable def unsignedFacetIndex +@[expose] noncomputable def unsignedFacetIndex (hp : Nat.Prime p) (V : VertexMap p) (k : Fin (p + 1)) : ZMod p := if FacetHasPositiveRayIntersection hp V k then FoxNeuwirthOrderComplex.AffineVertexMap.determinantIndex @@ -61,6 +61,7 @@ noncomputable def unsignedFacetIndex else 0 /-- Transport an omitted facet vertex to the face-index type used by the simplicial boundary. -/ +@[expose] def facetFaceIndex (hp : Nat.Prime p) (k : Fin (p + 1)) : Fin ((p - 1) + 2) := Fin.cast (by have := hp.two_le; omega) k @@ -129,6 +130,7 @@ theorem unsignedFacetIndex_eq_of_facetValue_eq rw [ite_eq_right hV, ite_eq_right hW] /-- Relabel every output coordinate vector of a local affine simplex by a prime symmetry. -/ +@[expose] noncomputable def primeSmulVertexMap (p : Nat) (g : PrimeSymmetry p) (V : VertexMap p) : VertexMap p where value i := g • V.value i @@ -491,6 +493,7 @@ noncomputable instance (hp : Nat.Prime p) (N L : Nat) : /-- Ordered global vertices of one induced prism facet. Equality of signatures means equality as an ordered sampled facet, which is the correct relation for oriented boundary cancellation. -/ +@[expose] noncomputable def facetSignature (hp : Nat.Prime p) (N L : Nat) (o : FacetOccurrence hp N L) : Fin p → GlobalVertex hp N L := @@ -564,6 +567,7 @@ theorem signatureWeight_facetSignature /-- Coefficient of one fully refined prism simplex. It combines the original orbit-cycle coefficient, the spatial barycentric-subdivision sign, the staircase sign, and the further prism subdivision sign. -/ +@[expose] noncomputable def prismCoefficient (hp : Nat.Prime p) (N L : Nat) (q : PrismCell hp N L) : ZMod p := @@ -572,6 +576,7 @@ noncomputable def prismCoefficient (prismSign q : ZMod p) /-- Signed incidence coefficient of one facet occurrence in the global refined prism chain. -/ +@[expose] noncomputable def occurrenceCoefficient (hp : Nat.Prime p) (N L : Nat) (o : FacetOccurrence hp N L) : ZMod p := @@ -579,14 +584,14 @@ noncomputable def occurrenceCoefficient SimplicialChain.faceSign (R := ZMod p) (d := p - 1) (facetFaceIndex hp o.2) /-- Total signed boundary coefficient of one ordered global facet signature. -/ -noncomputable def signatureBoundaryCoefficient +@[expose] noncomputable def signatureBoundaryCoefficient (hp : Nat.Prime p) (N L : Nat) (s : FacetSignature hp N L) : ZMod p := ∑ o : FacetOccurrence hp N L, if facetSignature hp N L o = s then occurrenceCoefficient hp N L o else 0 /-- Expanded global signed positive-ray boundary sum over all local facet occurrences. -/ -noncomputable def globalSignedFacetSum +@[expose] noncomputable def globalSignedFacetSum (hp : Nat.Prime p) (N L : Nat) (a : Assignment hp N L) : ZMod p := ∑ o : FacetOccurrence hp N L, @@ -716,18 +721,21 @@ theorem Result.signature_weighted_boundary_sum_eq_zero /-! ## Horizontal and nonhorizontal decomposition -/ /-- Time coordinate of one vertex in an ordered global facet signature. -/ +@[expose] noncomputable def signatureTime (hp : Nat.Prime p) (N L : Nat) (s : FacetSignature hp N L) (i : Fin p) : Real := (globalPoint hp N L (s i)).time.1 /-- A facet signature lies in the lower horizontal layer. -/ +@[expose] def IsLowerHorizontal (hp : Nat.Prime p) (N L : Nat) (s : FacetSignature hp N L) : Prop := ∀ i : Fin p, signatureTime hp N L s i = 0 /-- A facet signature lies in the upper horizontal layer. -/ +@[expose] def IsUpperHorizontal (hp : Nat.Prime p) (N L : Nat) (s : FacetSignature hp N L) : Prop := @@ -744,7 +752,7 @@ noncomputable instance isUpperHorizontalDecidable Classical.propDecidable _ /-- Lower horizontal contribution to the global signed facet sum. -/ -noncomputable def lowerHorizontalContribution +@[expose] noncomputable def lowerHorizontalContribution (hp : Nat.Prime p) (N L : Nat) (a : Assignment hp N L) : ZMod p := ∑ s : FacetSignature hp N L, @@ -753,7 +761,7 @@ noncomputable def lowerHorizontalContribution else 0 /-- Upper horizontal contribution to the global signed facet sum. -/ -noncomputable def upperHorizontalContribution +@[expose] noncomputable def upperHorizontalContribution (hp : Nat.Prime p) (N L : Nat) (a : Assignment hp N L) : ZMod p := ∑ s : FacetSignature hp N L, @@ -762,7 +770,7 @@ noncomputable def upperHorizontalContribution else 0 /-- Contribution of every signature not wholly contained in either horizontal layer. -/ -noncomputable def nonhorizontalContribution +@[expose] noncomputable def nonhorizontalContribution (hp : Nat.Prime p) (N L : Nat) (a : Assignment hp N L) : ZMod p := ∑ s : FacetSignature hp N L, diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantPrismHorizontalEndpointIdentification.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantPrismHorizontalEndpointIdentification.lean index 45ef589630..feb84ff576 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantPrismHorizontalEndpointIdentification.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantPrismHorizontalEndpointIdentification.lean @@ -17,7 +17,7 @@ reindexes each horizontal contribution as the positive-ray count on the correspo triangulation. -/ -@[expose] public section +public section namespace NRR @@ -41,6 +41,7 @@ open RefinedAffineMap variable {p : Nat} /-- Interpret a spatial refinement word on the definitionally different simplex-index type. -/ +@[expose] noncomputable def endpointRefinementWord (hp : Nat.Prime p) (L : Nat) (eta : RefinementWord p L) : Fin L → Equiv.Perm (Fin (p - 1 + 1)) := by @@ -112,6 +113,7 @@ theorem endpoint_iterated_weighted_boundary /-- The spatial simplex obtained by applying the final `L` barycentric refinements to an already level-`N` refined top cell. -/ +@[expose] noncomputable def endpointSpatialMap (hp : Nat.Prime p) (N L : Nat) (q : TopCell hp N) @@ -132,7 +134,7 @@ theorem endpointSpatialMap_succ /-- Positive-ray count represented by the lower horizontal boundary of a compatible prism assignment. -/ -noncomputable def lowerEndpointRefinedCount +@[expose] noncomputable def lowerEndpointRefinedCount (hp : Nat.Prime p) (N L : Nat) (a : Assignment hp N L) : ZMod p := ∑ q : TopCell hp N, @@ -144,7 +146,7 @@ noncomputable def lowerEndpointRefinedCount /-- Positive-ray count represented by the upper horizontal boundary of a compatible prism assignment. -/ -noncomputable def upperEndpointRefinedCount +@[expose] noncomputable def upperEndpointRefinedCount (hp : Nat.Prime p) (N L : Nat) (a : Assignment hp N L) : ZMod p := ∑ q : TopCell hp N, @@ -533,6 +535,7 @@ theorem refinedSidePrismMap_not_upperHorizontal /-! ## Endpoint pairing for an arbitrary affine-facet weight -/ /-- Restrict an arbitrary facet-map weight to the lower horizontal faces. -/ +@[expose] noncomputable def weightedLowerMapWeight (W : (Delta (p - 1) → Realization p × Set.Icc (0 : Real) 1) → ZMod p) (tau : Delta (p - 1) → Realization p × Set.Icc (0 : Real) 1) : ZMod p := by @@ -540,6 +543,7 @@ noncomputable def weightedLowerMapWeight exact if MapIsLowerHorizontal tau then W tau else 0 /-- Restrict an arbitrary facet-map weight to the upper horizontal faces. -/ +@[expose] noncomputable def weightedUpperMapWeight (W : (Delta (p - 1) → Realization p × Set.Icc (0 : Real) 1) → ZMod p) (tau : Delta (p - 1) → Realization p × Set.Icc (0 : Real) 1) : ZMod p := by @@ -547,14 +551,14 @@ noncomputable def weightedUpperMapWeight exact if MapIsUpperHorizontal tau then W tau else 0 /-- The occurrence sum of an arbitrary facet-map weight. -/ -noncomputable def weightedOccurrencePairing +@[expose] noncomputable def weightedOccurrencePairing (hp : Nat.Prime p) (N L : Nat) (W : (Delta (p - 1) → Realization p × Set.Icc (0 : Real) 1) → ZMod p) : ZMod p := ∑ o : FacetOccurrence hp N L, occurrenceCoefficient hp N L o * W (occurrenceFacetMap hp N L o) /-- The lower endpoint pairing of an arbitrary facet-map weight. -/ -noncomputable def weightedLowerEndpointPairing +@[expose] noncomputable def weightedLowerEndpointPairing (hp : Nat.Prime p) (N L : Nat) (W : (Delta (p - 1) → Realization p × Set.Icc (0 : Real) 1) → ZMod p) : ZMod p := ∑ q : TopCell hp N, @@ -564,7 +568,7 @@ noncomputable def weightedLowerEndpointPairing W (lowerEndpointMap (endpointSpatialMap hp N L q eta)) /-- The upper endpoint pairing of an arbitrary facet-map weight. -/ -noncomputable def weightedUpperEndpointPairing +@[expose] noncomputable def weightedUpperEndpointPairing (hp : Nat.Prime p) (N L : Nat) (W : (Delta (p - 1) → Realization p × Set.Icc (0 : Real) 1) → ZMod p) : ZMod p := ∑ q : TopCell hp N, diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantPrismNonhorizontalCancellation.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantPrismNonhorizontalCancellation.lean index 20f274c1a6..dcef6ff944 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantPrismNonhorizontalCancellation.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantPrismNonhorizontalCancellation.lean @@ -32,7 +32,7 @@ the result is a consequence of the explicit subdivision signs, staircase signs, proved orbit-cycle boundary identity. -/ -@[expose] public section +public section namespace NRR @@ -58,11 +58,12 @@ variable {p : Nat} /-! ## Weighted boundary of iterated barycentric subdivision -/ /-- Insert a zero barycentric coordinate at `k`. -/ -noncomputable def cofacePoint +@[expose] noncomputable def cofacePoint (n : Nat) (k : Fin (n + 2)) (x : Delta n) : Delta (n + 1) := SphereOddDegree.FiniteSimplex.map (S := Real) k.succAbove x /-- Transport a standard-simplex point across an equality of dimensions. -/ +@[expose] noncomputable def deltaCast {m n : Nat} (h : m = n) : Delta m → Delta n := fun x => h ▸ x @@ -118,6 +119,7 @@ theorem fin_succAbove_val {n : Nat} (k : Fin (n + 1)) (i : Fin n) : omega /-- Product of the orientation signs in an iterated subdivision word. -/ +@[expose] noncomputable def iteratedSign (R : Type) [CommRing R] (N : Nat) (rho : Fin N -> Equiv.Perm (Fin (n + 1))) : R := @@ -130,6 +132,7 @@ noncomputable def iteratedSign simp [iteratedSign] /-- The induced facet map of one simplex in an iterated subdivision. -/ +@[expose] noncomputable def iteratedFacetMap {X : Type} (n N : Nat) (sigma : Delta (n + 1) -> X) (rho : Fin N -> Equiv.Perm (Fin (n + 2))) @@ -137,6 +140,7 @@ noncomputable def iteratedFacetMap fun x => sigma (affineCompMap (n + 1) N rho (cofacePoint n k x)) /-- The iterated subdivision of an original boundary face. -/ +@[expose] noncomputable def iteratedBoundaryMap {X : Type} (n N : Nat) (sigma : Delta (n + 1) -> X) (k : Fin (n + 2)) @@ -489,6 +493,7 @@ theorem iterated_weighted_boundary /-! ## Staircase prism boundary -/ /-- Generic staircase time coordinate for a spatial `n`-simplex. -/ +@[expose] def genericStaircaseTime (k : Fin (n + 1)) (j : Fin (n + 2)) : Fin 2 := if j.1 <= k.1 then 0 else 1 @@ -534,6 +539,7 @@ noncomputable def genericStaircaseSpatialPoint _ = 1 := w.2.2 /-- Interval barycentric point in the generic staircase simplex. -/ +@[expose] noncomputable def genericStaircaseIntervalPoint (n : Nat) (k : Fin (n + 1)) (w : Delta (n + 1)) : Set.Icc (0 : Real) 1 := by refine ⟨∑ j : Fin (n + 2), @@ -554,6 +560,7 @@ noncomputable def genericStaircaseIntervalPoint _ = 1 := w.2.2 /-- Generic staircase prism simplex over a spatial simplex map. -/ +@[expose] noncomputable def staircasePrismMap {X : Type} (n : Nat) (sigma : Delta n -> X) (k : Fin (n + 1)) : Delta (n + 1) -> X × Set.Icc (0 : Real) 1 := @@ -561,16 +568,19 @@ noncomputable def staircasePrismMap genericStaircaseIntervalPoint n k w) /-- Lower endpoint copy of a spatial simplex map. -/ +@[expose] def lowerEndpointMap {X : Type} (sigma : Delta n -> X) : Delta n -> X × Set.Icc (0 : Real) 1 := fun x => (sigma x, ⟨0, by constructor <;> norm_num⟩) /-- Upper endpoint copy of a spatial simplex map. -/ +@[expose] def upperEndpointMap {X : Type} (sigma : Delta n -> X) : Delta n -> X × Set.Icc (0 : Real) 1 := fun x => (sigma x, ⟨1, by constructor <;> norm_num⟩) /-- A side staircase simplex over an original spatial face. -/ +@[expose] noncomputable def sidePrismMap {X : Type} (n : Nat) (sigma : Delta n -> X) (r : Fin (n + 1)) (h : Fin n) : @@ -1221,6 +1231,7 @@ noncomputable def occurrenceFacetMap simp [occurrenceFacetMap, SubdivisionPrismCharts.vertex] /-- Ordered cylinder vertices of an arbitrary affine facet map. -/ +@[expose] def mapVertexSignature (tau : Delta (p - 1) -> Realization p × Set.Icc (0 : Real) 1) : Fin p -> CylinderPoint p := @@ -1228,6 +1239,7 @@ def mapVertexSignature (tau (SphereOddDegree.FiniteSimplex.vertex (S := Real) (facetCoordinateIndex i))) /-- Prime translation of an affine facet map. -/ +@[expose] def translateFacetMap (p : Nat) (g : PrimeSymmetry p) (tau : Delta (p - 1) -> Realization p × Set.Icc (0 : Real) 1) : @@ -1243,6 +1255,7 @@ def translateFacetMap rfl /-- Ordered cylinder vertices of one actual facet occurrence. -/ +@[expose] noncomputable def occurrencePointSignature (hp : Nat.Prime p) (N L : Nat) (o : FacetOccurrence hp N L) : Fin p -> CylinderPoint p := @@ -1380,12 +1393,14 @@ theorem realizedFacetWeight_translateFacetMap rw [dite_eq_right hleft, dite_eq_right hright] /-- A facet map is lower horizontal when every one of its vertices has time zero. -/ +@[expose] def MapIsLowerHorizontal (tau : Delta (p - 1) -> Realization p × Set.Icc (0 : Real) 1) : Prop := ∀ i : Fin p, (tau (SphereOddDegree.FiniteSimplex.vertex (S := Real) (facetCoordinateIndex i))).2.1 = 0 /-- A facet map is upper horizontal when every one of its vertices has time one. -/ +@[expose] def MapIsUpperHorizontal (tau : Delta (p - 1) -> Realization p × Set.Icc (0 : Real) 1) : Prop := ∀ i : Fin p, @@ -1540,10 +1555,12 @@ theorem nonhorizontalMapWeight_smul /-- Transport from the ambient prime-cardinality index to the face index of a `(p - 2)`-simplex. -/ +@[expose] def orbitFacetEquiv (hp : Nat.Prime p) : Fin p ≃ Fin (p - 2 + 2) := finCongr (by have := hp.two_le; omega) /-- The face index corresponding to a labelled facet of a prime orbit. -/ +@[expose] noncomputable def orbitFacetIndex (hp : Nat.Prime p) (k : Fin p) : Fin (p - 2 + 2) := orbitFacetEquiv hp k @@ -1925,6 +1942,7 @@ theorem realizationPoint_prime_smul_any /-! ## Shared spatial-side bridge -/ /-- Weight of a staircase side simplex for any affine-facet weight. -/ +@[expose] noncomputable def genericSpatialSideWeight {n : Nat} (hp : Nat.Prime (n + 1)) (L : Nat) (V : (Delta n → Realization (n + 1) × Set.Icc (0 : Real) 1) → ZMod (n + 1)) diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantPrismStableRelativeBoundary.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantPrismStableRelativeBoundary.lean index 5670192a4f..fbf64eaded 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantPrismStableRelativeBoundary.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantPrismStableRelativeBoundary.lean @@ -30,7 +30,7 @@ triangulation level. The original generic prism assignment is then a relative p those two boundary maps fixed by construction; no second generic perturbation is required. -/ -@[expose] public section +public section namespace NRR @@ -71,6 +71,7 @@ instance : Fintype EndpointSide where namespace EndpointSide /-- Numerical time attached to an endpoint side. -/ +@[expose] def time : EndpointSide → Real | lower => 0 | upper => 1 @@ -474,6 +475,7 @@ theorem endpointInterpolant_regular /-- Strong skeleton transversality: no deviation-zero point lies on the boundary of a refined top simplex, without imposing a sign condition on the common coordinate mean. -/ +@[expose] def DeviationSkeletonFree (hp : Nat.Prime p) (N : Nat) (F : ContinuousCoordinateMap p) : Prop := ∀ (q : TopCell hp N) (w : StandardSimplex (p - 1)), @@ -666,6 +668,7 @@ noncomputable def Result.upperStableApproximation /-- An assignment is relative to two endpoint approximations when its horizontal samples agree exactly with their sampled maps. -/ +@[expose] def BoundaryFixed (hp : Nat.Prime p) (N L : Nat) {F₀ F₁ : ZeroFreeMap hp} diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantPrismSubdivisionMargin.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantPrismSubdivisionMargin.lean index 66e0fa5c95..d8386aee90 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantPrismSubdivisionMargin.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantPrismSubdivisionMargin.lean @@ -30,7 +30,7 @@ refinement level `L` must subsequently be increased. This permits later argumen common spatial subdivision for endpoint data first and then refine the entire homotopy prism. -/ -@[expose] public section +public section namespace NRR @@ -51,6 +51,7 @@ open SubdivisionPrismCharts variable {p : Nat} /-- The unrefined staircase chart over one fixed spatially refined top simplex. -/ +@[expose] noncomputable def basePrismChart (hp : Nat.Prime p) (N : Nat) (q : BasePrismCell hp N) : C(Delta p, Realization p × Set.Icc (0 : Real) 1) where diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantPrismVertexParameters.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantPrismVertexParameters.lean index e44230aff4..7fd4b48a1e 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantPrismVertexParameters.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantPrismVertexParameters.lean @@ -32,7 +32,7 @@ Later genericity modules only need to define their determinant and codimension-t this finite type. -/ -@[expose] public section +public section namespace NRR @@ -57,10 +57,12 @@ structure CylinderPoint (p : Nat) where namespace CylinderPoint /-- Convert the product representation used by the homotopy and prism charts. -/ +@[expose] def ofProd (z : Realization p × Set.Icc (0 : Real) 1) : CylinderPoint p := ⟨z.1, z.2⟩ /-- Convert back to the product representation used by the homotopy. -/ +@[expose] def toProd (z : CylinderPoint p) : Realization p × Set.Icc (0 : Real) 1 := (z.spatial, z.time) @@ -107,6 +109,7 @@ noncomputable instance (hp : Nat.Prime p) (N L : Nat) : DecidableEq (VertexSlot inferInstance /-- A local prism vertex occurrence as an actual point of the realization cylinder. -/ +@[expose] noncomputable def slotPoint (hp : Nat.Prime p) (N L : Nat) (s : VertexSlot hp N L) : CylinderPoint p := CylinderPoint.ofProd (SubdivisionPrismCharts.vertex hp N L s.1 s.2) @@ -122,12 +125,14 @@ noncomputable instance (hp : Nat.Prime p) (N L : Nat) : DecidableEq (CoverVertex inferInstance /-- Geometric point represented by one symmetry-decorated local vertex occurrence. -/ +@[expose] noncomputable def coverPoint (hp : Nat.Prime p) (N L : Nat) (s : CoverVertexSlot hp N L) : CylinderPoint p := s.1 • slotPoint hp N L s.2 /-- Two decorated local slots represent the same global sampled vertex when their cylinder points are equal. -/ +@[expose] noncomputable def coverVertexSetoid (hp : Nat.Prime p) (N L : Nat) : Setoid (CoverVertexSlot hp N L) where r a b := coverPoint hp N L a = coverPoint hp N L b @@ -147,6 +152,7 @@ noncomputable instance globalVertexDecidableEq Classical.decEq _ /-- Left multiplication on the symmetry decoration. -/ +@[expose] def actCoverVertex {hp : Nat.Prime p} (g : PrimeSymmetry p) (s : CoverVertexSlot hp N L) : CoverVertexSlot hp N L := (g * s.1, s.2) @@ -181,6 +187,7 @@ noncomputable instance globalVertexAction simp [mul_smul] /-- Actual cylinder point represented by a global sampled vertex. -/ +@[expose] noncomputable def globalPoint (hp : Nat.Prime p) (N L : Nat) : GlobalVertex hp N L → CylinderPoint p := Quotient.lift (coverPoint hp N L) (by @@ -201,6 +208,7 @@ noncomputable def globalPoint exact coverPoint_actCoverVertex hp N L g s /-- The global sampled vertex represented by an undecorated local slot. -/ +@[expose] noncomputable def sampleVertex (hp : Nat.Prime p) (N L : Nat) (s : VertexSlot hp N L) : GlobalVertex hp N L := Quotient.mk _ ((1 : PrimeSymmetry p), s) @@ -247,12 +255,14 @@ abbrev Assignment (hp : Nat.Prime p) (N L : Nat) := Parameter hp N L → Real /-- Scalar value reconstructed at a sampled global vertex and coordinate label. -/ +@[expose] noncomputable def scalarValue (hp : Nat.Prime p) (N L : Nat) (a : Assignment hp N L) (x : GlobalVertex hp N L) (j : Fin p) : Real := a (Quotient.mk _ (x, j)) /-- Full coordinate vector reconstructed at a sampled global vertex. -/ +@[expose] noncomputable def vectorValue (hp : Nat.Prime p) (N L : Nat) (a : Assignment hp N L) (x : GlobalVertex hp N L) : Fin p → Real := @@ -291,6 +301,7 @@ theorem vectorValue_smul exact congrArg a hsite /-- Vector value attached to one local prism vertex occurrence. -/ +@[expose] noncomputable def localVertexValue (hp : Nat.Prime p) (N L : Nat) (a : Assignment hp N L) (q : PrismCell hp N L) (i : Fin (p + 1)) : diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantReferenceCoordinateMap.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantReferenceCoordinateMap.lean index ebe3ca7fab..7a30ac1907 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantReferenceCoordinateMap.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/EquivariantReferenceCoordinateMap.lean @@ -18,7 +18,7 @@ label recovers exactly the S5 map. Relabelling acts by the same coordinate perm lift is genuinely prime-equivariant. -/ -@[expose] public section +public section namespace NRR namespace AAK diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ExplicitAffineRelativeCollar.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ExplicitAffineRelativeCollar.lean index cc5a59160f..07d0538709 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ExplicitAffineRelativeCollar.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ExplicitAffineRelativeCollar.lean @@ -34,7 +34,7 @@ codimension-two minors are governed by stable endpoint transversality rather tha genericity family. -/ -@[expose] public section +public section namespace NRR @@ -57,6 +57,7 @@ open AffinePositiveRayBoundary variable {p : Nat} /-- A cylinder point belongs to one of the two fixed horizontal boundary layers. -/ +@[expose] def IsHorizontalPoint (z : CylinderPoint p) : Prop := z.time.1 = 0 ∨ z.time.1 = 1 @@ -120,10 +121,12 @@ instance facetOccurrenceFintype : Fintype C.FacetOccurrence := inferInstance instance facetOccurrenceDecidableEq : DecidableEq C.FacetOccurrence := inferInstance /-- Geometric point at a local cell vertex occurrence. -/ +@[expose] def slotPoint (s : C.VertexSlot) : CylinderPoint p := C.vertex s.1 s.2 /-- Ordered geometric vertex tuple of the facet obtained by omitting `o.2`. -/ +@[expose] def facetSignature (o : C.FacetOccurrence) : Fin p → CylinderPoint p := fun i => C.vertex o.1 (o.2.succAbove i) @@ -131,6 +134,7 @@ def facetSignature (o : C.FacetOccurrence) : Fin p → CylinderPoint p := geometric signature is the simultaneous prime translate of the other. This is the facet-orbit relation required by the Fox--Neuwirth orbit cycle: spatial side faces cancel after passage to the prime quotient, not necessarily as identical facets of the chosen top-cell representatives. -/ +@[expose] noncomputable def facetSetoid : Setoid C.FacetOccurrence where r a b := ∃ g : PrimeSymmetry p, (fun i => g • C.facetSignature a i) = C.facetSignature b @@ -159,28 +163,33 @@ noncomputable instance facetFintype : Fintype C.Facet := Fintype.ofFinite _ noncomputable instance facetDecidableEq : DecidableEq C.Facet := Classical.decEq _ /-- Quotient facet represented by a local occurrence. -/ +@[expose] noncomputable def facetClass (o : C.FacetOccurrence) : C.Facet := Quotient.mk _ o /-- Alternating boundary sign attached to an omitted local vertex. -/ +@[expose] def alternatingSign (k : Fin (p + 1)) : ZMod p := (-1 : ZMod p) ^ k.1 /-- Total signed incidence coefficient of one ordered prime-orbit facet. -/ -noncomputable def facetIncidence (s : C.Facet) : ZMod p := +@[expose] noncomputable def facetIncidence (s : C.Facet) : ZMod p := ∑ o : C.FacetOccurrence, if C.facetClass o = s then C.coefficient o.1 * alternatingSign o.2 else 0 /-- A local facet occurrence lies in the fixed lower horizontal boundary. -/ +@[expose] def IsLowerFacetOccurrence (o : C.FacetOccurrence) : Prop := ∀ i : Fin p, (C.facetSignature o i).time.1 = 0 /-- A local facet occurrence lies in the fixed upper horizontal boundary. -/ +@[expose] def IsUpperFacetOccurrence (o : C.FacetOccurrence) : Prop := ∀ i : Fin p, (C.facetSignature o i).time.1 = 1 /-- Lower-horizontal status is well-defined on ordered quotient-facet classes because prime symmetry preserves the interval coordinate. -/ +@[expose] noncomputable def IsLowerFacet : C.Facet → Prop := Quotient.lift C.IsLowerFacetOccurrence (by intro a b hab @@ -201,6 +210,7 @@ noncomputable def IsLowerFacet : C.Facet → Prop := /-- Upper-horizontal status is well-defined on ordered quotient-facet classes because prime symmetry preserves the interval coordinate. -/ +@[expose] noncomputable def IsUpperFacet : C.Facet → Prop := Quotient.lift C.IsUpperFacetOccurrence (by intro a b hab @@ -220,6 +230,7 @@ noncomputable def IsUpperFacet : C.Facet → Prop := exact hb i) /-- A geometric facet is horizontal when it belongs to either fixed endpoint boundary. -/ +@[expose] def IsHorizontalFacet (s : C.Facet) : Prop := C.IsLowerFacet s ∨ C.IsUpperFacet s @@ -267,10 +278,12 @@ end FoxNeuwirthRelativeAffineCollar /-! ## Exact endpoint identification -/ /-- Embed a realization point in the lower horizontal boundary of the cylinder. -/ +@[expose] def lowerCylinderPoint (x : Realization p) : CylinderPoint p := ⟨x, ⟨0, by simp⟩⟩ /-- Embed a realization point in the upper horizontal boundary of the cylinder. -/ +@[expose] def upperCylinderPoint (x : Realization p) : CylinderPoint p := ⟨x, ⟨1, by simp⟩⟩ @@ -343,6 +356,7 @@ end EndpointIdentifiedRelativeAffineCollar /-- Existence proposition for the genuine relative affine collar. In contrast with the previous raw interface, this proposition cannot be inhabited by an empty cell family or by a collar whose horizontal boundary is unrelated to the supplied Fox--Neuwirth subdivision levels. -/ +@[expose] def RelativeAffineCollarExists (hp : Nat.Prime p) (N₀ N₁ M L : Nat) : Prop := Nonempty (EndpointIdentifiedRelativeAffineCollar hp N₀ N₁ M L) @@ -362,10 +376,12 @@ noncomputable instance coverVertexSlotFintype : Fintype (CoverVertexSlot hp C) : instance coverVertexSlotDecidableEq : DecidableEq (CoverVertexSlot hp C) := inferInstance /-- Geometric point represented by a decorated local occurrence. -/ +@[expose] def coverPoint (s : CoverVertexSlot hp C) : CylinderPoint p := s.1 • C.slotPoint s.2 /-- Equality of geometric cylinder points identifies duplicate local occurrences. -/ +@[expose] noncomputable def coverVertexSetoid : Setoid (CoverVertexSlot hp C) where r a b := coverPoint hp C a = coverPoint hp C b iseqv := ⟨fun _ => rfl, fun h => h.symm, fun h₁ h₂ => h₁.trans h₂⟩ @@ -380,6 +396,7 @@ noncomputable instance globalVertexDecidableEq : DecidableEq (GlobalVertex hp C) Classical.decEq _ /-- Left multiplication on the symmetry decoration. -/ +@[expose] def actCoverVertex (g : PrimeSymmetry p) (s : CoverVertexSlot hp C) : CoverVertexSlot hp C := (g * s.1, s.2) @@ -412,6 +429,7 @@ noncomputable instance globalVertexAction : simp [mul_smul] /-- Actual geometric point represented by a global vertex. -/ +@[expose] noncomputable def globalPoint : GlobalVertex hp C → CylinderPoint p := Quotient.lift (coverPoint hp C) (by intro a b hab @@ -429,6 +447,7 @@ noncomputable def globalPoint : GlobalVertex hp C → CylinderPoint p := exact coverPoint_actCoverVertex hp C g s /-- Global vertex represented by an undecorated local slot. -/ +@[expose] noncomputable def sampleVertex (s : C.VertexSlot) : GlobalVertex hp C := Quotient.mk _ ((1 : PrimeSymmetry p), s) @@ -457,6 +476,7 @@ noncomputable instance parameterFintype : Fintype (Parameter hp C) := Fintype.of noncomputable instance parameterDecidableEq : DecidableEq (Parameter hp C) := Classical.decEq _ /-- A global vertex is frozen precisely on one of the two horizontal boundaries. -/ +@[expose] def IsFrozenVertex (x : GlobalVertex hp C) : Prop := IsHorizontalPoint (globalPoint hp C x) @@ -466,6 +486,7 @@ def IsFrozenVertex (x : GlobalVertex hp C) : Prop := simp [IsFrozenVertex, IsHorizontalPoint] /-- Frozen status is well-defined on diagonal parameter orbits. -/ +@[expose] noncomputable def IsFrozenParameter : Parameter hp C → Prop := Quotient.lift (fun s : ScalarSite hp C => IsFrozenVertex hp C s.1) @@ -492,6 +513,7 @@ noncomputable instance movableParameterFintype : Fintype (MovableParameter hp C) abbrev Assignment := Parameter hp C → Real /-- Replace only movable values, retaining the horizontal boundary assignment literally. -/ +@[expose] noncomputable def replaceMovable (base : Assignment hp C) (move : MovableParameter hp C → Real) : Assignment hp C := by classical @@ -555,11 +577,13 @@ theorem eval_restrictPolynomial rw [hhom] /-- Scalar value reconstructed at a global vertex. -/ +@[expose] noncomputable def scalarValue (a : Assignment hp C) (x : GlobalVertex hp C) (j : Fin p) : Real := a (Quotient.mk _ (x, j)) /-- Vector value reconstructed at a global vertex. -/ +@[expose] noncomputable def vectorValue (a : Assignment hp C) (x : GlobalVertex hp C) : Fin p → Real := fun j => scalarValue hp C a x j @@ -750,6 +774,7 @@ noncomputable def deviationPolynomial y (ReferenceAffineOrbitCount.lastLabel hp) /-- Real local vertex map reconstructed from an assignment. -/ +@[expose] noncomputable def localVertexMap (a : Assignment hp C) (q : C.Cell) : VertexMap p where value i := vectorValue hp C a (sampleVertex hp C (q, i)) @@ -834,6 +859,7 @@ abbrev CodimTwoFace (p : Nat) := EquivariantPrismGenericityPolynomials.CodimTwoFace p /-- Retained local vertex after the two ordered omissions. -/ +@[expose] def codimTwoVertex (f : CodimTwoFace p) (i : Fin (p - 1)) : Fin (p + 1) := EquivariantPrismGenericityPolynomials.codimTwoVertex hp f i @@ -851,6 +877,7 @@ noncomputable def codimTwoMinorPolynomial Matrix.det (codimTwoDeviationMatrixPolynomial hp C q f) /-- Corresponding real deviation matrix. -/ +@[expose] noncomputable def codimTwoDeviationMatrix (a : Assignment hp C) (q : C.Cell) (f : CodimTwoFace p) : Matrix (Fin (p - 1)) (Fin (p - 1)) Real := @@ -909,16 +936,19 @@ theorem eval_restrictedCodimTwoMinorPolynomial exact eval_codimTwoMinorPolynomial hp C (replaceMovable hp C base move) q f /-- An ordered codimension-two face is purely lower horizontal. -/ +@[expose] def IsLowerHorizontalCodimTwo (q : C.Cell) (f : CodimTwoFace p) : Prop := ∀ i : Fin (p - 1), (C.vertex q (codimTwoVertex hp f i)).time.1 = 0 /-- An ordered codimension-two face is purely upper horizontal. -/ +@[expose] def IsUpperHorizontalCodimTwo (q : C.Cell) (f : CodimTwoFace p) : Prop := ∀ i : Fin (p - 1), (C.vertex q (codimTwoVertex hp f i)).time.1 = 1 /-- Purely horizontal codimension-two faces are excluded from the movable full-minor family. -/ +@[expose] def IsPurelyHorizontalCodimTwo (q : C.Cell) (f : CodimTwoFace p) : Prop := IsLowerHorizontalCodimTwo hp C q f ∨ IsUpperHorizontalCodimTwo hp C q f @@ -953,6 +983,7 @@ noncomputable def restrictedGenericityPolynomial | Sum.inr qf => restrictedCodimTwoMinorPolynomial hp C base qf.1.1 qf.1.2 /-- Real determinant family corresponding to a full boundary-relative assignment. -/ +@[expose] noncomputable def genericityValue (a : Assignment hp C) : RelativeGenericityIndex hp C → Real | Sum.inl qk => VertexMap.facetDeterminant hp (localVertexMap hp C a qk.1) qk.2 diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ExplicitAffineRelativeCollarAssignmentCompose.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ExplicitAffineRelativeCollarAssignmentCompose.lean index 48e98cd200..b3400b2801 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ExplicitAffineRelativeCollarAssignmentCompose.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ExplicitAffineRelativeCollarAssignmentCompose.lean @@ -24,7 +24,7 @@ cell. Consequently any cellwise property stated only in terms of `localVertexMa origin avoidance, is transported without a new geometric proof. -/ -@[expose] public section +public section namespace NRR namespace FoxNeuwirthOrderComplex @@ -42,6 +42,7 @@ variable {p N₀ Nmid N₁ M₀ M₁ L₀ L₁ : Nat} variable {hp : Nat.Prime p} /-- Construct a scalar quotient assignment from an equivariant vector value on global vertices. -/ +@[expose] noncomputable def assignmentOfEquivariantVector {A B M L : Nat} (C : RelativeAffineCellSystem hp A B M L) @@ -97,6 +98,7 @@ def rightCoverVertex /-- Seam compatibility for two vector assignments. It is stated directly on geometric cover occurrences so it applies before either component is embedded into the combined quotient. -/ +@[expose] def SeamCompatible (VC : GlobalVertex hp C → Fin p → Real) (VD : GlobalVertex hp D → Fin p → Real) : Prop := @@ -105,6 +107,7 @@ def SeamCompatible VC (Quotient.mk _ a) = VD (Quotient.mk _ b) /-- Piecewise vector value on decorated local occurrences of the combined collar. -/ +@[expose] noncomputable def combinedCoverVector (VC : GlobalVertex hp C → Fin p → Real) (VD : GlobalVertex hp D → Fin p → Real) : @@ -167,6 +170,7 @@ theorem combinedCoverVector_eq_of_coverPoint_eq exact hab /-- Global combined vector obtained by descent from the piecewise cover value. -/ +@[expose] noncomputable def combinedGlobalVector (VC : GlobalVertex hp C → Fin p → Real) (VD : GlobalVertex hp D → Fin p → Real) @@ -234,6 +238,7 @@ theorem combinedGlobalVector_smul exact hD g (Quotient.mk _ (h, (q, i))) /-- Compose two assignments whose vector values agree on every combined seam vertex. -/ +@[expose] noncomputable def combinedAssignment (a : Assignment hp C) (b : Assignment hp D) diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ExplicitAffineRelativeCollarAssignmentReverse.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ExplicitAffineRelativeCollarAssignmentReverse.lean index 657838f256..41683511bb 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ExplicitAffineRelativeCollarAssignmentReverse.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ExplicitAffineRelativeCollarAssignmentReverse.lean @@ -18,7 +18,7 @@ to reversed global vertices. Local vertex maps are unchanged, so origin avoidan literally. -/ -@[expose] public section +public section namespace NRR namespace FoxNeuwirthOrderComplex @@ -37,6 +37,7 @@ variable {p N₀ N₁ M L : Nat} variable {hp : Nat.Prime p} /-- A reversed local occurrence, viewed as the corresponding original occurrence. -/ +@[expose] def originalCoverVertex (C : RelativeAffineCellSystem hp N₀ N₁ M L) (s : CoverVertexSlot hp (reverseCells C)) : CoverVertexSlot hp C := @@ -51,12 +52,14 @@ def originalCoverVertex rfl /-- The original global vertex represented by a reversed local occurrence. -/ +@[expose] noncomputable def originalGlobalVertex (C : RelativeAffineCellSystem hp N₀ N₁ M L) (s : CoverVertexSlot hp (reverseCells C)) : GlobalVertex hp C := Quotient.mk _ (originalCoverVertex C s) /-- Piecewise value used for descent to reversed global vertices. -/ +@[expose] noncomputable def reverseCoverVector (C : RelativeAffineCellSystem hp N₀ N₁ M L) (a : Assignment hp C) @@ -77,6 +80,7 @@ theorem reverseCoverVector_eq_of_coverPoint_eq simpa [coverPoint_reverse] using hst /-- Descended vector assignment on the reversed collar. -/ +@[expose] noncomputable def reverseGlobalVector (C : RelativeAffineCellSystem hp N₀ N₁ M L) (a : Assignment hp C) : @@ -113,6 +117,7 @@ theorem reverseGlobalVector_smul exact vectorValue_smul hp C a g (Quotient.mk _ (h, (q, i))) /-- Assignment transported to the reversed cell system. -/ +@[expose] noncomputable def reverseAssignment (C : RelativeAffineCellSystem hp N₀ N₁ M L) (a : Assignment hp C) : Assignment hp (reverseCells C) := diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ExplicitAffineRelativeCollarCompose.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ExplicitAffineRelativeCollarCompose.lean index 698cbb080b..f440f228fb 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ExplicitAffineRelativeCollarCompose.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ExplicitAffineRelativeCollarCompose.lean @@ -18,7 +18,7 @@ pairing of the first collar and lower boundary pairing of the second collar are Fox--Neuwirth chain, hence cancel pointwise after regrouping by combined quotient facets. -/ -@[expose] public section +public section namespace NRR namespace FoxNeuwirthOrderComplex @@ -197,6 +197,7 @@ noncomputable def relativeCollar : D)).toFoxNeuwirthRelativeAffineCollar /-- Composition of endpoint-identified relative affine collars. -/ +@[expose] noncomputable def endpointIdentifiedCollar : EndpointIdentifiedRelativeAffineCollar hp N₀ N₁ (max M₀ M₁) (L₀ + L₁ + 1) := ExplicitAffineRelativeCollarComposeDescribed.endpointIdentifiedCollar diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ExplicitAffineRelativeCollarComposeCells.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ExplicitAffineRelativeCollarComposeCells.lean index bf7c1d6c73..e6125c6096 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ExplicitAffineRelativeCollarComposeCells.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ExplicitAffineRelativeCollarComposeCells.lean @@ -18,7 +18,7 @@ pairing of the first collar and lower boundary pairing of the second collar are Fox--Neuwirth chain, hence cancel pointwise after regrouping by combined quotient facets. -/ -@[expose] public section +public section namespace NRR namespace FoxNeuwirthOrderComplex @@ -44,10 +44,12 @@ theorem cylinderPoint_ext {z w : CylinderPoint p} exact Subtype.ext ht /-- Place a cylinder point in the lower half-cylinder. -/ +@[expose] noncomputable def leftPoint (z : CylinderPoint p) : CylinderPoint p := ⟨z.spatial, ⟨z.time.1 / 2, by constructor <;> linarith [z.time.2.1, z.time.2.2]⟩⟩ /-- Place a cylinder point in the upper half-cylinder. -/ +@[expose] noncomputable def rightPoint (z : CylinderPoint p) : CylinderPoint p := ⟨z.spatial, ⟨(1 + z.time.1) / 2, by constructor <;> linarith [z.time.2.1, z.time.2.2]⟩⟩ @@ -114,6 +116,7 @@ noncomputable def middlePoint (x : Realization p) : CylinderPoint p := simp [rightPoint, upperCylinderPoint] /-- Combined affine cell system. -/ +@[expose] noncomputable def combinedCells (C : RelativeAffineCellSystem hp N₀ Nmid M₀ L₀) (D : RelativeAffineCellSystem hp Nmid N₁ M₁ L₁) : @@ -200,10 +203,12 @@ variable (D : RelativeAffineCellSystem hp Nmid N₁ M₁ L₁) /-- Embed a left local facet occurrence into the combined cell family. -/ +@[expose] def leftOccurrence (o : C.FacetOccurrence) : (combinedCells C D).FacetOccurrence := (Sum.inl o.1, o.2) /-- Embed a right local facet occurrence into the combined cell family. -/ +@[expose] def rightOccurrence (o : D.FacetOccurrence) : (combinedCells C D).FacetOccurrence := (Sum.inr o.1, o.2) @@ -216,6 +221,7 @@ def rightOccurrence (o : D.FacetOccurrence) : (combinedCells C D).FacetOccurrenc fun i => rightPoint (D.facetSignature o i) := rfl /-- Push a left quotient facet into the combined quotient. -/ +@[expose] noncomputable def leftFacet (s : C.Facet) : (combinedCells C D).Facet := Quotient.map (leftOccurrence C D) (by intro a b hab @@ -223,6 +229,7 @@ noncomputable def leftFacet (s : C.Facet) : (combinedCells C D).Facet := exact ⟨g, by funext i; simpa using congrArg leftPoint (congrFun hg i)⟩) s /-- Push a right quotient facet into the combined quotient. -/ +@[expose] noncomputable def rightFacet (s : D.Facet) : (combinedCells C D).Facet := Quotient.map (rightOccurrence C D) (by intro a b hab @@ -262,11 +269,13 @@ theorem rightFacet_injective : Function.Injective (rightFacet C D) := by simpa using congrFun hg i /-- Kronecker weight for the image of one combined quotient facet. -/ +@[expose] noncomputable def leftIndicator (s : (combinedCells C D).Facet) (t : C.Facet) : ZMod p := if leftFacet C D t = s then 1 else 0 /-- Kronecker weight for the right image. -/ +@[expose] noncomputable def rightIndicator (s : (combinedCells C D).Facet) (t : D.Facet) : ZMod p := if rightFacet C D t = s then 1 else 0 diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ExplicitAffineRelativeCollarComposeDescribed.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ExplicitAffineRelativeCollarComposeDescribed.lean index 2f013a2b1c..770a8c9946 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ExplicitAffineRelativeCollarComposeDescribed.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ExplicitAffineRelativeCollarComposeDescribed.lean @@ -23,7 +23,7 @@ between two genuine endpoint stacks without assuming an unproved middle-prism ex lemma. -/ -@[expose] public section +public section namespace NRR namespace FoxNeuwirthOrderComplex @@ -70,6 +70,7 @@ structure EndpointDescribedRelativeAffineCollar namespace EndpointDescribedRelativeAffineCollar /-- Forget only endpoint-facet exhaustiveness. -/ +@[expose] noncomputable def ofEndpointIdentified (C : EndpointIdentifiedRelativeAffineCollar hp N₀ N₁ M₀ L₀) : EndpointDescribedRelativeAffineCollar hp N₀ N₁ M₀ L₀ where @@ -315,6 +316,7 @@ theorem upperFacetOccurrenceVertex_eq congrArg rightPoint (hg i) /-- Composition preserving all endpoint data used by a later seam. -/ +@[expose] noncomputable def describedCollar : EndpointDescribedRelativeAffineCollar hp N₀ N₁ (max M₀ M₁) (L₀ + L₁ + 1) where toFoxNeuwirthRelativeAffineCollar := { @@ -393,6 +395,7 @@ theorem upperFacet_exhaustive_of_right /-- Package a described composition as a genuine endpoint-identified collar when only the two external endpoint families are exhaustive. -/ +@[expose] noncomputable def endpointIdentifiedCollar (hC : ∀ s, C.cells.IsLowerFacet s → ∃ q, C.lowerFacet q = s) (hD : ∀ s, D.cells.IsUpperFacet s → ∃ q, D.upperFacet q = s) : diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ExplicitAffineRelativeCollarGenericity.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ExplicitAffineRelativeCollarGenericity.lean index 1d434bf030..04d1215302 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ExplicitAffineRelativeCollarGenericity.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ExplicitAffineRelativeCollarGenericity.lean @@ -27,7 +27,7 @@ that closeness there gives closeness of the reconstructed full assignment while horizontal boundary literally. -/ -@[expose] public section +public section namespace NRR @@ -93,6 +93,7 @@ def RequiresMovableGenericityWitness | Sum.inr _ => True /-- Restrict a full assignment to its movable parameter subtype. -/ +@[expose] noncomputable def movableRestriction (base : Assignment hp C) : MovableParameter hp C → Real := fun q => base q.1 @@ -471,6 +472,7 @@ assignment exactly. -/ · simp [replaceMovable, movableRestriction, hq] /-- The full parameter represented by one local vertex coordinate. -/ +@[expose] noncomputable def localParameter (q : C.Cell) (i : Fin (p + 1)) (j : Fin p) : Parameter hp C := Quotient.mk _ (sampleVertex hp C (q, i), j) @@ -481,6 +483,7 @@ noncomputable def localParameter (localVertexMap hp C a q).value i j = a (localParameter hp C q i j) := rfl /-- A coordinate witness for a uniform lower bound on every local affine value. -/ +@[expose] def LocalAffineCoordinateNormMargin (a : Assignment hp C) (m : Real) : Prop := ∀ (q : C.Cell) (w : StandardSimplex p), diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ExplicitAffineRelativeCollarReverse.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ExplicitAffineRelativeCollarReverse.lean index 65bd1a7f4b..b256e9c026 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ExplicitAffineRelativeCollarReverse.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ExplicitAffineRelativeCollarReverse.lean @@ -17,7 +17,7 @@ performs that construction at the level of explicit affine cells, quotient facet incidence, and endpoint-chain identification. -/ -@[expose] public section +public section namespace NRR namespace FoxNeuwirthOrderComplex @@ -33,6 +33,7 @@ variable {p N₀ N₁ M L : Nat} variable {hp : Nat.Prime p} /-- Reflection of the realization cylinder in its interval coordinate. -/ +@[expose] def reflectPoint (z : CylinderPoint p) : CylinderPoint p := ⟨z.spatial, ⟨1 - z.time.1, by constructor <;> linarith [z.time.2.1, z.time.2.2]⟩⟩ @@ -123,6 +124,7 @@ theorem reverse_facetSetoid_iff simpa [reverse_facetSignature] using congrArg reflectPoint (congrFun h i) /-- Canonical equivalence between reflected and original quotient facets. -/ +@[expose] noncomputable def facetEquiv (C : RelativeAffineCellSystem hp N₀ N₁ M L) : (reverseCells C).Facet ≃ C.Facet := @@ -179,6 +181,7 @@ theorem reverse_isUpper_iff_isLower · linarith [h i] /-- Reverse a pointwise relative affine collar. -/ +@[expose] noncomputable def reverseCollar (C : FoxNeuwirthRelativeAffineCollar hp N₀ N₁ M L) : FoxNeuwirthRelativeAffineCollar hp N₁ N₀ M L where @@ -215,6 +218,7 @@ noncomputable def reverseCollar simp [reflectPoint, lowerCylinderPoint, upperCylinderPoint] /-- Reverse an endpoint-identified collar. -/ +@[expose] noncomputable def reverseEndpointCollar (C : EndpointIdentifiedRelativeAffineCollar hp N₀ N₁ M L) : EndpointIdentifiedRelativeAffineCollar hp N₁ N₀ M L where diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ExplicitAffineRelativeCollarStokes.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ExplicitAffineRelativeCollarStokes.lean index 841668a1d2..766b3d2b2f 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ExplicitAffineRelativeCollarStokes.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ExplicitAffineRelativeCollarStokes.lean @@ -28,7 +28,7 @@ this finite Stokes theorem. It requires the boundary assignment to equal the tw endpoint maps on all frozen horizontal vertices. -/ -@[expose] public section +public section namespace NRR @@ -280,11 +280,13 @@ end FoxNeuwirthRelativeAffineCollar /-- Canonical identification of the `p` facet vertices with the vertex index type used by a `(p - 1)`-simplex. Keeping this transport named prevents repeated dependent casts. -/ +@[expose] def refinedVertexEquiv (hp : Nat.Prime p) : Fin p ≃ Fin (p - 1 + 1) := augmentedRowEquiv hp /-- The corresponding transported refined vertex index. -/ +@[expose] def refinedVertexIndex (hp : Nat.Prime p) (i : Fin p) : Fin (p - 1 + 1) := refinedVertexEquiv hp i diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/FacetShuffleEquiv.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/FacetShuffleEquiv.lean index 745607ffe0..990c23266a 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/FacetShuffleEquiv.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/FacetShuffleEquiv.lean @@ -18,7 +18,7 @@ proves the resulting equivalence with `ShuffleIndex`, and closes the genuine cel calculation modulo a prime. -/ -@[expose] public section +public section namespace NRR diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/FiniteAffineZeroCount.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/FiniteAffineZeroCount.lean index 0197bcacb7..09a13445c5 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/FiniteAffineZeroCount.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/FiniteAffineZeroCount.lean @@ -30,7 +30,7 @@ that an ordinary simplicial cycle produces a finite incidence cycle. The later instantiate the same interface with orbit representatives and quotient incidences. -/ -@[expose] public section +public section namespace NRR @@ -66,11 +66,11 @@ namespace FiniteIncidenceCycle variable (C : FiniteIncidenceCycle R) /-- Incidence coboundary of a facet function. -/ -def coboundary (h : C.Facet → R) : C.TopCell → R := +@[expose] def coboundary (h : C.Facet → R) : C.TopCell → R := fun c => ∑ f : C.Facet, C.incidence f c * h f /-- Pairing of the cycle coefficient vector with a local-index function. -/ -def zeroCount (index : C.TopCell → R) : R := +@[expose] def zeroCount (index : C.TopCell → R) : R := ∑ c : C.TopCell, C.coefficient c * index c @[simp] theorem zeroCount_zero : C.zeroCount 0 = 0 := by @@ -159,7 +159,7 @@ variable {p d : Nat} namespace SimplicialIncidence /-- Alternating incidence coefficient between a simplex and one of its codimension-one faces. -/ -noncomputable def incidence +@[expose] noncomputable def incidence (target : Simplex p d) (source : Simplex p (d + 1)) : R := ∑ k : Fin (d + 2), if source.restrict (FaceMap.delete k) = target then @@ -210,6 +210,7 @@ structure AffineVertexMap (p d : Nat) where namespace AffineVertexMap /-- Affine extension of vertex values over one order-complex simplex. -/ +@[expose] noncomputable def value (f : AffineVertexMap p d) (s : Simplex p d) @@ -218,37 +219,41 @@ noncomputable def value /-- Augmented affine matrix. Its columns are the target values of the simplex vertices and its last row consists of ones. -/ +@[expose] def augmentedMatrix (f : AffineVertexMap p d) (s : Simplex p d) : Matrix (Fin (d + 1)) (Fin (d + 1)) ℝ := fun r i => Fin.lastCases (1 : ℝ) (fun q => f.vertexValue (s i) q) r /-- Determinant controlling regularity and the local orientation of the affine map. -/ -noncomputable def determinant +@[expose] noncomputable def determinant (f : AffineVertexMap p d) (s : Simplex p d) : ℝ := Matrix.det (f.augmentedMatrix s) /-- The affine restriction has a zero in the relative interior of the simplex. -/ +@[expose] def HasInteriorZero (f : AffineVertexMap p d) (s : Simplex p d) : Prop := ∃ w : StandardSimplex d, StandardSimplex.IsInterior w ∧ ∀ r, f.value s w r = 0 /-- The restriction is regular when its augmented affine matrix is nonsingular. -/ +@[expose] def IsRegularOn (f : AffineVertexMap p d) (s : Simplex p d) : Prop := f.determinant s ≠ 0 /-- Global finite regularity on all top-dimensional simplices. -/ +@[expose] def IsRegular (f : AffineVertexMap p d) : Prop := ∀ s : Simplex p d, f.IsRegularOn s /-- Sign of a real determinant, reduced to the coefficient field `ZMod p`. -/ -noncomputable def determinantIndex (x : ℝ) : ZMod p := +@[expose] noncomputable def determinantIndex (x : ℝ) : ZMod p := if 0 < x then 1 else if x < 0 then -1 else 0 /-- Local signed zero index of one affine simplex. -/ -noncomputable def localZeroIndex +@[expose] noncomputable def localZeroIndex (f : AffineVertexMap p d) (s : Simplex p d) : ZMod p := by classical exact if f.HasInteriorZero s then determinantIndex (p := p) (f.determinant s) else 0 diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/FiniteGenericPerturbation.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/FiniteGenericPerturbation.lean index e4a15d566d..cc6df73b93 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/FiniteGenericPerturbation.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/FiniteGenericPerturbation.lean @@ -21,7 +21,7 @@ only genericity input needed by the S6 subdivision argument: the perturbation di globally, so face compatibility and prime equivariance are preserved automatically. -/ -@[expose] public section +public section namespace NRR namespace FiniteGenericPerturbation diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/FiniteMultivariateGenericPerturbation.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/FiniteMultivariateGenericPerturbation.lean index e800d591d1..41c73ec765 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/FiniteMultivariateGenericPerturbation.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/FiniteMultivariateGenericPerturbation.lean @@ -25,7 +25,7 @@ then becomes a nonzero univariate polynomial because its value at parameter one small positive parameter avoiding the finitely many roots gives the required perturbation. -/ -@[expose] public section +public section namespace NRR namespace FiniteMultivariateGenericPerturbation diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/FiniteSimplexDoubleBoundary.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/FiniteSimplexDoubleBoundary.lean index f29e2fa8c6..66cb680d36 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/FiniteSimplexDoubleBoundary.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/FiniteSimplexDoubleBoundary.lean @@ -18,7 +18,7 @@ vertex in the remaining ordered set. Reindexing by the corresponding ordered pai original vertices makes the cancellation involution simply swap the two vertices. -/ -@[expose] public section +public section namespace NRR namespace FoxNeuwirthOrderComplex @@ -31,6 +31,7 @@ open SphereOddDegree.AffineBarycentricSubdivision open EquivariantPrismNonhorizontalCancellation /-- Ordered pairs of distinct vertices of an `(n+2)`-simplex. -/ +@[expose] def DeletedVertexPair (n : Nat) := {z : Fin (n + 3) × Fin (n + 3) // z.1 ≠ z.2} diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/MaximalFlagBridge.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/MaximalFlagBridge.lean index 9962836032..5a400477f0 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/MaximalFlagBridge.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/MaximalFlagBridge.lean @@ -34,7 +34,7 @@ The two internal pairings act transparently on this model: Consequently the paired maximal flags have literally equal deleted faces. -/ -@[expose] public section +public section namespace NRR @@ -46,10 +46,12 @@ namespace FoxNeuwirthOrderComplex namespace MaximalFlagCode /-- Bars already removed before stage `j`. -/ +@[expose] def removedBefore (z : Code p) (j : Fin p) : Finset (Fin (p - 1)) := Finset.univ.filter fun r => (z.removal.symm r).1 < j.1 /-- Bars still present at stage `j`. -/ +@[expose] def retainedBars (z : Code p) (j : Fin p) : Finset (Fin (p - 1)) := Finset.univ \ removedBefore z j @@ -59,10 +61,11 @@ def retainedBars (z : Code p) (j : Fin p) : Finset (Fin (p - 1)) := simp [retainedBars, removedBefore] /-- Zero-based block number at one stage, computed in the bottom singleton order. -/ -def stageBlock (z : Code p) (j : Fin p) (x : Fin p) : Nat := +@[expose] def stageBlock (z : Code p) (j : Fin p) (x : Fin p) : Nat := ((retainedBars z j).filter fun r => r.1 < (z.bottom x).1).card /-- Lexicographic key used to order labels at a stage. -/ +@[expose] def stageKey (z : Code p) (j : Fin p) (x : Fin p) : Nat ×ₗ Nat := toLex (stageBlock z j x, (z.top x).1) @@ -92,6 +95,7 @@ theorem ordinalRankNat_lt (key : Fin p → Nat ×ₗ Nat) (x : Fin p) : simpa [ordinalRankNat] using Finset.card_lt_card hssub /-- Fin-valued ordinal rank. -/ +@[expose] def ordinalRankFin (key : Fin p → Nat ×ₗ Nat) (x : Fin p) : Fin p := ⟨ordinalRankNat key x, ordinalRankNat_lt key x⟩ @@ -130,6 +134,7 @@ theorem ordinalRankFin_injective · exact (Fin.ne_of_lt (ordinalRankFin_lt_of_lt hgt)) hxy.symm /-- The ordinal-rank permutation associated with a code stage. -/ +@[expose] noncomputable def stageRank (z : Code p) (j : Fin p) : Equiv.Perm (Fin p) := Equiv.ofBijective (ordinalRankFin (stageKey z j)) (by rw [Fintype.bijective_iff_injective_and_card] @@ -258,7 +263,7 @@ theorem retainedCut_lt_stageRank_iff omega /-- The stage cell represented by a maximal-flag code. -/ -noncomputable def stageCell (z : Code p) (j : Fin p) : BarredPermutation p where +@[expose] noncomputable def stageCell (z : Code p) (j : Fin p) : BarredPermutation p where rank := stageRank z j bars := retainedBars z j @@ -394,10 +399,12 @@ theorem stageCell_properFace omega /-- Cast a maximal-simplex vertex index to the stage index `Fin p`. -/ +@[expose] def stageIndex (hp : Nat.Prime p) (i : Fin (p - 1 + 1)) : Fin p := FoxNeuwirthChain.maximalIndexCast hp i /-- Explicit strict flag associated with a maximal-flag code. -/ +@[expose] noncomputable def toSimplex (hp : Nat.Prime p) (z : Code p) : Simplex p (p - 1) := ⟨fun i => stageCell z (stageIndex hp i), by intro i j hij diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/MaximalFlagClassification.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/MaximalFlagClassification.lean index 7c3aae3a08..43f5c2d9f8 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/MaximalFlagClassification.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/MaximalFlagClassification.lean @@ -22,7 +22,7 @@ cell: the bottom rank fixes the block order and the final rank fixes the order i This yields the explicit inverse `simplexToCode` and proves that `toSimplex` is bijective. -/ -@[expose] public section +public section namespace NRR @@ -42,10 +42,12 @@ theorem mem_rankPrefix {c : BarredPermutation p} {r : Fin (p - 1)} {x : Fin p} : Using an explicit constructor avoids relying on the non-definitional arithmetic identity `p - 1 + 1 = p`. -/ +@[expose] def barLeft (r : Fin (p - 1)) : Fin p := ⟨r.1, by have := r.2; omega⟩ /-- The displayed position immediately to the right of a bar. -/ +@[expose] def barRight (r : Fin (p - 1)) : Fin p := ⟨r.1 + 1, by have := r.2; omega⟩ @@ -409,6 +411,7 @@ theorem removedBarAt_injective exact hiNot (hsub hjMem) /-- Canonical removal permutation recovered from a maximal strict flag. -/ +@[expose] noncomputable def decodedRemoval (hp : Nat.Prime p) (s : Simplex p (p - 1)) : Equiv.Perm (Fin (p - 1)) := diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/MaximalFlagCode.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/MaximalFlagCode.lean index fa9bc42068..3a4c8e1b98 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/MaximalFlagCode.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/MaximalFlagCode.lean @@ -33,7 +33,7 @@ uses the explicit reindexing equivalence `eQ hp : Fin (p - 2 + 1) ≃ Fin (p - 1 first-cut labels use `ePp hp : Fin (p - 1 + 1) ≃ Fin p`. -/ -@[expose] public section +public section namespace NRR @@ -56,38 +56,44 @@ structure Code (p : Nat) where deriving Fintype, DecidableEq /-- Integer sign of a finite permutation. -/ -noncomputable def permSignInt {n : Nat} (sigma : Equiv.Perm (Fin n)) : Int := +@[expose] noncomputable def permSignInt {n : Nat} (sigma : Equiv.Perm (Fin n)) : Int := ((Equiv.Perm.sign sigma : ℤˣ) : ℤ) /-- Canonical sign of a maximal-flag code. -/ -noncomputable def coefficient (z : Code p) : Int := +@[expose] noncomputable def coefficient (z : Code p) : Int := permSignInt z.bottom * permSignInt z.removal /-- First bar-removal step; prime cardinality guarantees that `Fin (p - 1)` is nonempty. -/ +@[expose] def firstRemovalStep (hp : Nat.Prime p) : Fin (p - 1) := ⟨0, by have := hp.two_le omega⟩ /-- Bottom vertex index in a maximal flag. -/ +@[expose] def bottomDeletionIndex (hp : Nat.Prime p) : Fin p := ⟨0, hp.pos⟩ /-- Reindexing equivalence `Fin (p - 1 + 1) ≃ Fin p`, used to view a bar-adjacent position as a bottom label position. -/ +@[expose] def ePp (hp : Nat.Prime p) : Fin (p - 1 + 1) ≃ Fin p := finCongr (by have := hp.two_le; omega) /-- Reindexing equivalence `Fin (p - 2 + 1) ≃ Fin (p - 1)`, used to view an internal removal-step index as a bar position. -/ +@[expose] def eQ (hp : Nat.Prime p) : Fin (p - 2 + 1) ≃ Fin (p - 1) := finCongr (by have := hp.two_le; omega) /-- Label occupying the position immediately before the first removed bar. -/ +@[expose] def firstCutLeftLabel (hp : Nat.Prime p) (z : Code p) : Fin p := z.bottom.symm (ePp hp (z.removal (firstRemovalStep hp)).castSucc) /-- Label occupying the position immediately after the first removed bar. -/ +@[expose] def firstCutRightLabel (hp : Nat.Prime p) (z : Code p) : Fin p := z.bottom.symm (ePp hp (z.removal (firstRemovalStep hp)).succ) @@ -102,6 +108,7 @@ theorem firstCutLabels_ne /-- Pairing for deletion of the bottom vertex: swap the two labels which become identified after removing the first bar. -/ +@[expose] def bottomPartner (hp : Nat.Prime p) (z : Code p) : Code p where bottom := (Equiv.swap (firstCutLeftLabel hp z) (firstCutRightLabel hp z)).trans z.bottom @@ -189,6 +196,7 @@ theorem coefficient_bottomPartner /-- Pairing for a positive internal deleted position: swap the adjacent bar-removal steps on the left and right of that position. -/ +@[expose] def removalPartner (hp : Nat.Prime p) (i : Fin (p - 2)) (z : Code p) : Code p where bottom := z.bottom @@ -247,6 +255,7 @@ theorem coefficient_removalPartner `MaximalFlagSourceCancellation`. -/ /-- The order-preserving face map that deletes a chosen maximal-flag vertex. -/ +@[expose] def deleteFace (hp : Nat.Prime p) (k : Fin (p - 1 + 1)) : FaceMap (p - 2) (p - 1) where toFun i := k.succAbove (Fin.cast (by have := hp.two_le; omega) i) @@ -256,6 +265,7 @@ def deleteFace (hp : Nat.Prime p) (k : Fin (p - 1 + 1)) : simpa using hab /-- Bottom-partner flag codes represent the same simplex face after the bottom deletion. -/ +@[expose] def BottomFaceCompatibility (hp : Nat.Prime p) (toSimplex : Code p → Simplex p (p - 1)) : Prop := ∀ z, @@ -265,6 +275,7 @@ def BottomFaceCompatibility (hp : Nat.Prime p) (deleteFace hp (Fin.cast (by have := hp.two_le; omega) (bottomDeletionIndex hp))) /-- Removal-partner flag codes represent the same simplex face at the chosen internal deletion. -/ +@[expose] def RemovalFaceCompatibility (hp : Nat.Prime p) (toSimplex : Code p → Simplex p (p - 1)) : Prop := ∀ (i : Fin (p - 2)) (z : Code p), diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/MaximalFlagEncodingStepOne.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/MaximalFlagEncodingStepOne.lean index 7dc853c2cc..8a16fed715 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/MaximalFlagEncodingStepOne.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/MaximalFlagEncodingStepOne.lean @@ -30,7 +30,7 @@ identities, and packages the requested equivalence with all maximal strict flags coefficient, or cancellation statement is included in that classification hypothesis. -/ -@[expose] public section +public section namespace NRR @@ -40,12 +40,15 @@ namespace FoxNeuwirthOrderComplex namespace MaximalFlagCode /-- The first (bottom) stage index, in `Fin p`. -/ +@[expose] def firstStage (hp : Nat.Prime p) : Fin p := ⟨0, hp.pos⟩ /-- The last (top) stage index, in `Fin p`. -/ +@[expose] def lastStage (hp : Nat.Prime p) : Fin p := ⟨p - 1, by have := hp.pos; omega⟩ /-- Cast a stage index back to the arithmetic index used by a maximal simplex. -/ +@[expose] def simplexIndex (hp : Nat.Prime p) (j : Fin p) : Fin (p - 1 + 1) := Fin.cast (FoxNeuwirthChain.maximalIndex_eq hp).symm j @@ -262,6 +265,7 @@ theorem toSimplex_injective (hp : Nat.Prime p) : simpa [toSimplex_apply, stageCell_last hp] using hlast /-- Maximal strict flags produced by the explicit stage construction. -/ +@[expose] def EncodedSimplex (hp : Nat.Prime p) := {s : Simplex p (p - 1) // s ∈ Set.range (toSimplex hp)} @@ -302,6 +306,7 @@ noncomputable def codeEquivEncodedSimplex exact toSimplex_encodedSimplexToCode hp s /-- The classification statement for Step 1: every maximal strict flag is encoded. -/ +@[expose] def EveryMaximalFlagEncoded (hp : Nat.Prime p) : Prop := Function.Surjective (toSimplex hp : Code p → Simplex p (p - 1)) diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/MaximalFlagEncodingStepTwo.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/MaximalFlagEncodingStepTwo.lean index d4a274e4d1..11fc6d1beb 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/MaximalFlagEncodingStepTwo.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/MaximalFlagEncodingStepTwo.lean @@ -23,7 +23,7 @@ the rank-two cancellation theorem, and proves that the top-flag subdivision chai mod-`p` simplicial cycle. -/ -@[expose] public section +public section namespace NRR diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/MaximalFlagSourceCancellation.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/MaximalFlagSourceCancellation.lean index 202a2d232a..737521b21f 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/MaximalFlagSourceCancellation.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/MaximalFlagSourceCancellation.lean @@ -32,7 +32,7 @@ type of `TopFlagSubdivision.deletionCoefficient`. Restriction of a `(p - 1)`-di `(p - 2) + 2` vs `p - 1 + 1` reindexing. -/ -@[expose] public section +public section namespace NRR diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ModPOrbitCycle.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ModPOrbitCycle.lean index 82efde6307..3f026f6bfc 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ModPOrbitCycle.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ModPOrbitCycle.lean @@ -23,7 +23,7 @@ It does not identify the disjoint simplex atlas with the glued Blagojevic--Ziegl regular-cell realization and the subsequent separator construction are separate topological steps. -/ -@[expose] public section +public section namespace NRR @@ -32,6 +32,7 @@ variable {p : Nat} namespace FoxNeuwirth /-- A proper split of `p` labels into two nonempty consecutive blocks. -/ +@[expose] def ProperSplit (p : Nat) := {k : Nat // 0 < k ∧ k < p} namespace ProperSplit diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/NegativeReferenceCoordinateMap.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/NegativeReferenceCoordinateMap.lean index 9c429883d5..d54c0c79b7 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/NegativeReferenceCoordinateMap.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/NegativeReferenceCoordinateMap.lean @@ -15,7 +15,7 @@ negative lift is used as the lower-end comparison map in S6. Its positive-ray c while its deviation map remains the regular S5 reference map. -/ -@[expose] public section +public section namespace NRR namespace AAK diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/OrbitIncidenceQuotient.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/OrbitIncidenceQuotient.lean index 913689ae71..fce4028542 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/OrbitIncidenceQuotient.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/OrbitIncidenceQuotient.lean @@ -22,7 +22,7 @@ The construction does not divide by the group order. This is essential in chara where the prime symmetry group has order divisible by `p`. -/ -@[expose] public section +public section namespace NRR @@ -62,20 +62,23 @@ noncomputable instance facetOrbitDecidableEq : DecidableEq (FacetOrbit (G := G) Classical.decEq _ /-- Canonical representative selected by `Quotient.out`. -/ +@[expose] noncomputable def topRepresentative (q : TopOrbit (G := G) C) : C.TopCell := Quotient.out q /-- Canonical facet representative selected by `Quotient.out`. -/ +@[expose] noncomputable def facetRepresentative (q : FacetOrbit (G := G) C) : C.Facet := Quotient.out q /-- One coefficient per top-cell orbit. -/ +@[expose] noncomputable def orbitCoefficient (q : TopOrbit (G := G) C) : R := C.coefficient (topRepresentative (G := G) C q) /-- Incidence from a facet orbit to a top orbit, obtained by summing the covering incidences over that top orbit. -/ -noncomputable def orbitIncidence +@[expose] noncomputable def orbitIncidence (qf : FacetOrbit (G := G) C) (qt : TopOrbit (G := G) C) : R := by classical exact ∑ c : qt.orbit, C.incidence (facetRepresentative (G := G) C qf) c @@ -126,6 +129,7 @@ theorem orbitBoundary_eq_coveringBoundary rfl /-- Orbit quotient of an equivariant finite incidence cycle. -/ +@[expose] noncomputable def orbitQuotient (E : EquivariantData (G := G) C) : FiniteIncidenceCycle R where TopCell := TopOrbit (G := G) C diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/OrbitRepresentatives.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/OrbitRepresentatives.lean index baeff7e4cb..8f8cc0c3c6 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/OrbitRepresentatives.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/OrbitRepresentatives.lean @@ -17,7 +17,7 @@ by the group order. This module records chosen representatives together with ex uniqueness up to the acting group. -/ -@[expose] public section +public section namespace NRR diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/OrderComplex.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/OrderComplex.lean index 58781d21e0..15a16daf62 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/OrderComplex.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/OrderComplex.lean @@ -27,7 +27,7 @@ with chain support. Compactness, simplex charts, the prime action on that carri collision-free map into configuration space are the associated geometric constructions. -/ -@[expose] public section +public section namespace NRR @@ -38,6 +38,7 @@ namespace FoxNeuwirthOrderComplex noncomputable section /-- Dimension-increasing proper face relation used by the order complex. -/ +@[expose] def ProperFace (a b : BarredPermutation p) : Prop := a.IsFace b ∧ a.dualDimension < b.dualDimension @@ -111,6 +112,7 @@ theorem vertex_injective (s : Simplex p d) : · exact (s.properFace hgt).ne hij.symm /-- Every barred permutation gives a vertex of the order complex. -/ +@[expose] def ofCell (c : BarredPermutation p) : Simplex p 0 := ⟨fun _ => c, by intro i j hij @@ -121,6 +123,7 @@ def ofCell (c : BarredPermutation p) : Simplex p 0 := rfl /-- Relabel every vertex in a simplex. -/ +@[expose] def relabel (sigma : Equiv.Perm (Fin p)) (s : Simplex p d) : Simplex p d := ⟨fun i => (s i).relabel sigma, by @@ -181,6 +184,7 @@ end Simplex /-- A barycentric weight has chain support when every two distinct nonzero coordinates are comparable by the proper-face relation. -/ +@[expose] def ChainSupported (weight : BarredPermutation p → ℝ) : Prop := ∀ ⦃a b : BarredPermutation p⦄, weight a ≠ 0 → weight b ≠ 0 → a ≠ b → @@ -191,6 +195,7 @@ def ChainSupported (weight : BarredPermutation p → ℝ) : Prop := Using coordinates indexed by all barred permutations identifies shared faces automatically: a point belongs to a simplex precisely when its nonzero coordinate support is contained in the corresponding strict chain. -/ +@[expose] def Realization (p : Nat) := {weight : BarredPermutation p → ℝ // (∀ c, 0 ≤ weight c) ∧ @@ -233,11 +238,13 @@ def support (x : Realization p) : Finset (BarredPermutation p) := simp [support] /-- Coordinate vector of a vertex. -/ +@[expose] def vertexWeight (c : BarredPermutation p) : BarredPermutation p → ℝ := fun d => if d = c then 1 else 0 /-- Every barred permutation is a vertex of the global realization. -/ +@[expose] def vertex (c : BarredPermutation p) : Realization p := ⟨vertexWeight c, by refine ⟨?_, ?_, ?_⟩ @@ -292,6 +299,7 @@ instance : CoeFun (FaceMap m d) (fun _ => Fin (m + 1) → Fin (d + 1)) := ⟨FaceMap.toFun⟩ /-- Identity face map. -/ +@[expose] def id (d : Nat) : FaceMap d d where toFun := fun i => i strictMono := by @@ -299,6 +307,7 @@ def id (d : Nat) : FaceMap d d where exact hij /-- Composition of face maps. -/ +@[expose] def comp (f : FaceMap m d) (g : FaceMap l m) : FaceMap l d where toFun := fun i => f (g i) strictMono := by @@ -319,6 +328,7 @@ end FaceMap namespace Simplex /-- Restrict a simplex along an increasing vertex map. This is the abstract face operation. -/ +@[expose] def restrict (s : Simplex p d) (f : FaceMap m d) : Simplex p m := ⟨fun i => s (f i), by intro i j hij diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/OrderComplexChain.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/OrderComplexChain.lean index ee5313df1d..b39e30a866 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/OrderComplexChain.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/OrderComplexChain.lean @@ -24,7 +24,7 @@ and is handled by the boundary-cancellation theorems. -/ -@[expose] public section +public section noncomputable section @@ -39,6 +39,7 @@ namespace FoxNeuwirthOrderComplex namespace FaceMap /-- The coface map that omits vertex `k`. -/ +@[expose] def delete (k : Fin (d + 2)) : FaceMap d (d + 1) where toFun := k.succAbove strictMono := (Fin.succAboveOrderEmb k).strictMono @@ -61,11 +62,12 @@ section variable {R : Type*} [CommRing R] /-- The alternating sign of the face obtained by deleting vertex `k`. -/ +@[expose] def faceSign (k : Fin (d + 2)) : R := (-1 : R) ^ k.1 /-- Coefficient contributed by one simplex and one deleted vertex. -/ -def faceContribution +@[expose] def faceContribution (chain : SimplicialChain R p (d + 1)) (target : Simplex p d) (source : Simplex p (d + 1)) @@ -76,6 +78,7 @@ def faceContribution /-- Simplicial boundary, written as a finite double sum over source simplices and deleted vertices. -/ +@[expose] def boundary (chain : SimplicialChain R p (d + 1)) : SimplicialChain R p d := fun target => @@ -141,6 +144,7 @@ def single (s : Simplex p d) : SimplicialChain R p d := simp [single, h] /-- Relabel a simplicial chain by precomposition with the inverse vertex action. -/ +@[expose] def relabel (sigma : Equiv.Perm (Fin p)) (chain : SimplicialChain R p d) : SimplicialChain R p d := fun s => chain (s.relabel sigma.symm) @@ -203,6 +207,7 @@ theorem maximalIndex_eq (hp : Nat.Prime p) : p - 1 + 1 = p := by omega /-- Cast a maximal-simplex index to a label index. -/ +@[expose] def maximalIndexCast (hp : Nat.Prime p) (i : Fin (p - 1 + 1)) : Fin p := Fin.cast (maximalIndex_eq hp) i @@ -236,6 +241,7 @@ def affineBlockDeterminant /-- Fox--Neuwirth top chain on maximal flags. The coefficient orients each barycentric simplex by its affine block-coordinate determinant. -/ +@[expose] def topChain (hp : Nat.Prime p) : SimplicialChain (ZMod p) p (p - 1) := fun s => (affineBlockDeterminant hp s : ZMod p) diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/OrderComplexRealization.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/OrderComplexRealization.lean index 7a26ad2089..ba2a794125 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/OrderComplexRealization.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/OrderComplexRealization.lean @@ -28,7 +28,7 @@ strict at the chosen cell. If they are in the same block, their common block pe rank order persists strictly. The barycentric average therefore cannot identify the labels. -/ -@[expose] public section +public section namespace NRR @@ -39,6 +39,7 @@ variable {p : Nat} namespace FoxNeuwirthOrderComplex /-- Relabelling is an equivalence of the finite barred-permutation vertex set. -/ +@[expose] def relabelEquiv (sigma : Equiv.Perm (Fin p)) : BarredPermutation p ≃ BarredPermutation p where toFun c := c.relabel sigma @@ -187,6 +188,7 @@ noncomputable instance instCompactSpace : CompactSpace (Realization p) := isCompact_iff_compactSpace.mp isCompact_realizationCarrier /-- The coordinate permutation induced by relabelling. -/ +@[expose] def relabel (sigma : Equiv.Perm (Fin p)) (x : Realization p) : Realization p := ⟨fun c => x (c.relabel sigma.symm), by refine ⟨?_, ?_, ?_⟩ @@ -408,6 +410,7 @@ theorem site_injective (x : Realization p) : exact (ne_of_lt hs) he /-- The order-complex realization maps to the labelled configuration space. -/ +@[expose] noncomputable def toConfig (x : Realization p) : Config p := ⟨x.site, x.site_injective⟩ @@ -530,6 +533,7 @@ theorem reference_smul end Realization /-- The compact equivariant prime configuration model carried by the glued order complex. -/ +@[expose] noncomputable def orderComplexModel (hp : Nat.Prime p) : PrimeConfigurationModel hp := by letI : NeZero p := ⟨hp.ne_zero⟩ diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/Orientation.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/Orientation.lean index 1fe6dd26af..515561663d 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/Orientation.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/Orientation.lean @@ -21,7 +21,7 @@ under an arbitrary change of chosen cell orientations; it is covariant by the pr transport signs. This is the correct datum needed by the later cellular mod-`p` argument. -/ -@[expose] public section +public section namespace NRR @@ -66,7 +66,7 @@ theorem orientationSign_eq_one_or_neg_one (c : BarredPermutation p) : · simp [h] /-- Sign comparing the chosen orientation before and after relabelling. -/ -def orientationTransport +@[expose] def orientationTransport (sigma : Equiv.Perm (Fin p)) (c : BarredPermutation p) : Int := (c.relabel sigma).orientationSign * c.orientationSign diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/OrientedBoundary.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/OrientedBoundary.lean index 84501c560a..2c79ee3716 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/OrientedBoundary.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/OrientedBoundary.lean @@ -20,7 +20,7 @@ This module records the oriented cell model and its boundary relation. The cycle cancellation results are proved in the chain modules. -/ -@[expose] public section +public section namespace NRR @@ -133,6 +133,7 @@ theorem boundarySupport_eq_facets (b : BarredPermutation p) : simp [boundarySupport, facets, signedIncidence_ne_zero_iff] /-- Formal cellular boundary of one oriented cell. -/ +@[expose] def cellularBoundary (b : BarredPermutation p) : BarredPermutation p → Int := fun a => signedIncidence a b diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/Phase5Complete.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/Phase5Complete.lean index 5aa33ce0cd..3df7cf2bdd 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/Phase5Complete.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/Phase5Complete.lean @@ -20,7 +20,7 @@ The signed cellular cycle, orientation comparison, and nonzero orbit count are n They provide the finite model used by the obstruction argument. -/ -@[expose] public section +public section namespace NRR diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/PositiveReferenceCoordinateMap.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/PositiveReferenceCoordinateMap.lean index b40a62853a..cdb3b180ae 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/PositiveReferenceCoordinateMap.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/PositiveReferenceCoordinateMap.lean @@ -17,7 +17,7 @@ order-complex realization. This gives a manifestly zero-free straight-line homo upper child map to the reference obstruction map. -/ -@[expose] public section +public section namespace NRR namespace AAK diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/PrimeBoundary.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/PrimeBoundary.lean index dc90806f7b..48c9b87858 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/PrimeBoundary.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/PrimeBoundary.lean @@ -18,7 +18,7 @@ prime `p` and `0 < k < p`, this coefficient is divisible by `p`; this is the ari sum of the top dual cells is a cycle modulo `p`. -/ -@[expose] public section +public section namespace NRR @@ -28,6 +28,7 @@ namespace FoxNeuwirth /-- A shuffle is encoded by the positions occupied by the first block. -/ +@[expose] def ShuffleIndex (p k : ℕ) := {s : Finset (Fin p) // s.card = k} diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/PrimeOrbitCycle.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/PrimeOrbitCycle.lean index 2b01a42815..f25f6f95d5 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/PrimeOrbitCycle.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/PrimeOrbitCycle.lean @@ -24,7 +24,7 @@ unconditional top-flag cycle. The resulting finite incidence cycle has one top per prime-symmetry orbit and is the correct input for orbit-level zero counts. -/ -@[expose] public section +public section namespace NRR @@ -188,6 +188,7 @@ theorem coveringEquivariantData exact simplicialIncidence_smul p g f s /-- Prime-symmetry orbit quotient of the unconditional top-flag cycle. -/ +@[expose] noncomputable def orbitCycle (hp : Nat.Prime p) : FiniteIncidenceCycle (ZMod p) := FiniteIncidenceCycle.orbitQuotient (G := PrimeSymmetry p) (coveringCycle hp) (coveringEquivariantData hp) @@ -208,6 +209,7 @@ abbrev FacetOrbit (hp : Nat.Prime p) := (orbitCycle hp).Facet /-- Canonical representative of a top orbit. -/ +@[expose] noncomputable def topRepresentative (hp : Nat.Prime p) (q : TopOrbit hp) : (coveringCycle hp).TopCell := @@ -215,7 +217,7 @@ noncomputable def topRepresentative (G := PrimeSymmetry p) (coveringCycle hp) q /-- Canonical representative of a facet orbit. -/ -noncomputable def facetRepresentative +@[expose] noncomputable def facetRepresentative (hp : Nat.Prime p) (q : FacetOrbit hp) : (coveringCycle hp).Facet := FiniteIncidenceCycle.facetRepresentative diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ReferenceAffineOrbitCount.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ReferenceAffineOrbitCount.lean index f23b251405..4ee57d46f8 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ReferenceAffineOrbitCount.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ReferenceAffineOrbitCount.lean @@ -32,7 +32,7 @@ regular affine reference map whose orbit zero count is the previously computed n `FoxNeuwirth.referenceSignedOrbitCount p`. -/ -@[expose] public section +public section namespace NRR @@ -49,10 +49,12 @@ open MaximalFlagCode TopFlagSubdivision PrimeOrbitCycle (stageIndex hp i).1 = i.1 := rfl /-- The fixed label omitted from the difference-coordinate model of the diagonal quotient. -/ +@[expose] def lastLabel (hp : Nat.Prime p) : Fin p := ⟨p - 1, by have := hp.pos; omega⟩ /-- Embed a target coordinate into the label set. -/ +@[expose] def coordinateLabel (hp : Nat.Prime p) (r : Fin (p - 1)) : Fin p := ⟨r.1, by have := hp.two_le; omega⟩ @@ -93,6 +95,7 @@ theorem sum_if_one_zero_eq_card simp /-- Block-index vector modulo the diagonal, in the fixed difference coordinates. -/ +@[expose] def blockDifference (hp : Nat.Prime p) (c : BarredPermutation p) (r : Fin (p - 1)) : Int := (c.blockIndex (coordinateLabel hp r) : Int) - @@ -100,6 +103,7 @@ def blockDifference /-- Generic direction at a top-cell vertex. In the final rank order its adjacent gaps are `1,2,...,p-1`. -/ +@[expose] def topDirection (hp : Nat.Prime p) (c : BarredPermutation p) (r : Fin (p - 1)) : Int := (triangular (c.rank (coordinateLabel hp r)).1 : Int) - @@ -117,6 +121,7 @@ def liftedVertexValue (c.blockIndex x : Real) /-- Piecewise-affine reference map with perturbation parameter `epsilon`. -/ +@[expose] noncomputable def mapAt (hp : Nat.Prime p) (epsilon : Real) : AffineVertexMap p (p - 1) where vertexValue c r := @@ -140,6 +145,7 @@ theorem mapAt_vertexValue_eq_lifted_sub /-- The selected maximal flag over a top permutation: bottom and top ranks agree, and bars are removed in their natural order. -/ +@[expose] def selectedCode (sigma : Equiv.Perm (Fin p)) : Code p where bottom := sigma removal := 1 @@ -897,6 +903,7 @@ theorem determinant_sign_preserved (determinant_zero_ne_zero hp))).2 s /-- The chosen affine reference map is regular on every maximal simplex. -/ +@[expose] noncomputable def referenceMap (hp : Nat.Prime p) : AffineVertexMap p (p - 1) := mapAt hp (epsilon hp) @@ -1487,6 +1494,7 @@ theorem coveringTopCell_eq (hp : Nat.Prime p) : omega /-- Canonical top-orbit representative, cast to the dimension `p - 1` used by the reference map. -/ +@[expose] noncomputable def topRepr (hp : Nat.Prime p) (q : PrimeOrbitCycle.TopOrbit hp) : Simplex p (p - 1) := (coveringTopCell_eq hp) ▸ PrimeOrbitCycle.topRepresentative hp q @@ -1709,7 +1717,7 @@ theorem card_selectedOrbit exact Nat.card_congr e /-- The local zero index of the reference map on each selected orbit representative. -/ -noncomputable def referenceIndex +@[expose] noncomputable def referenceIndex (hp : Nat.Prime p) : PrimeOrbitCycle.TopOrbit hp → ZMod p := fun q => (referenceMap hp).localZeroIndex (topRepr hp q) diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ReferenceCoordinateLift.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ReferenceCoordinateLift.lean index ea8404cb2e..0b0f4d6d31 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ReferenceCoordinateLift.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ReferenceCoordinateLift.lean @@ -15,7 +15,7 @@ whose value is fixed, producing a coordinate-valued affine map with exactly the map and the same positive local-index cochain. -/ -@[expose] public section +public section namespace NRR namespace AAK diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ReferenceSubdivisionRegular.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ReferenceSubdivisionRegular.lean index 94b03a8bec..bb823f6411 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ReferenceSubdivisionRegular.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ReferenceSubdivisionRegular.lean @@ -18,7 +18,7 @@ refined simplex its augmented difference matrix is the original augmented matrix barycentric vertex matrix of the subdivision chart. Both factors have nonzero determinant. -/ -@[expose] public section +public section namespace NRR diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ReferenceZero.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ReferenceZero.lean index 543b300c68..3685fcb4c3 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ReferenceZero.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ReferenceZero.lean @@ -22,7 +22,7 @@ and two orbits for odd primes, because the chosen group is respectively `S_2` an each orbit local coefficient `1` produces the nonzero reference count used in the prime argument. -/ -@[expose] public section +public section namespace NRR @@ -33,6 +33,7 @@ variable {p : Nat} namespace FoxNeuwirth /-- Uniform barycentric weights on the `p` labels. -/ +@[expose] noncomputable def uniformWeights (hp : Nat.Prime p) : FoxNeuwirthWeights p where val := fun _ => 1 / (p : Real) property := by @@ -132,6 +133,7 @@ theorem reference_zero_in_full_permutation_orbit uniformWeights_relabel hp sigma] using hw /-- Number of prime-symmetry orbits obtained by restricting a full permutation torsor. -/ +@[expose] noncomputable def referenceOrbitMultiplicity (p : Nat) : Nat := (primeSymmetrySubgroup p).index @@ -162,6 +164,7 @@ theorem referenceOrbitMultiplicity_eq_two exact alternatingGroup.index_eq_two /-- Signed reference orbit count with local coefficient `1` on each restricted orbit. -/ +@[expose] noncomputable def referenceSignedOrbitCount (p : Nat) : ZMod p := (referenceOrbitMultiplicity p : ZMod p) diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ReferenceZeroFreeMaps.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ReferenceZeroFreeMaps.lean index 6b5339a609..a900135b11 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ReferenceZeroFreeMaps.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/ReferenceZeroFreeMaps.lean @@ -17,7 +17,7 @@ count. Keeping these definitions in a neutral module separates the stable obstr raw-count homotopy interface. -/ -@[expose] public section +public section namespace NRR @@ -33,6 +33,7 @@ open EquivariantCoordinateHomotopy open RefinedAffineMap /-- Continuous coordinate map associated with an original affine vertex map. -/ +@[expose] noncomputable def affineZeroFreeMap (hp : Nat.Prime p) (F : CoordinateAffineVertexMap p) (heq : ∀ (g : PrimeSymmetry p) (x : Realization p), @@ -43,6 +44,7 @@ noncomputable def affineZeroFreeMap zeroFree := hzero /-- The globally positive equivariant S5 reference lift is zero-free. -/ +@[expose] noncomputable def positiveReferenceZeroFreeMap (hp : Nat.Prime p) : ZeroFreeMap hp := affineZeroFreeMap hp (AAK.positiveEquivariantReferenceCoordinateMap hp) @@ -53,6 +55,7 @@ noncomputable def positiveReferenceZeroFreeMap exact (ne_of_gt (hpos ⟨0, hp.pos⟩)) (by simpa using hi)) /-- The globally negative equivariant S5 reference lift is zero-free. -/ +@[expose] noncomputable def negativeReferenceZeroFreeMap (hp : Nat.Prime p) : ZeroFreeMap hp := affineZeroFreeMap hp (AAK.negativeEquivariantReferenceCoordinateMap hp) diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RefinedAffineMap.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RefinedAffineMap.lean index 6aad95bccf..c662339e75 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RefinedAffineMap.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RefinedAffineMap.lean @@ -21,7 +21,7 @@ representative together with a word of barycentric-subdivision permutations. A coordinate map is sampled at the vertices of that refined simplex and extended affinely. -/ -@[expose] public section +public section namespace NRR @@ -42,7 +42,7 @@ noncomputable instance (hp : Nat.Prime p) (N : Nat) : Fintype (TopCell hp N) := noncomputable instance (hp : Nat.Prime p) (N : Nat) : DecidableEq (TopCell hp N) := inferInstance /-- Sign of an iterated barycentric-subdivision summand. -/ -noncomputable def subdivisionSign (N : Nat) (rho : RefinementWord p N) : ZMod p := +@[expose] noncomputable def subdivisionSign (N : Nat) (rho : RefinementWord p N) : ZMod p := ∏ r : Fin N, ((Equiv.Perm.sign (rho r) : ℤ) : ZMod p) /-- Integer version of the subdivision sign. -/ @@ -53,31 +53,33 @@ noncomputable def subdivisionSignInt (N : Nat) (rho : RefinementWord p N) : Int abbrev ContinuousCoordinateMap (p : Nat) := C(Realization p, Fin p → Real) /-- Refined chart attached to a top-orbit representative and a subdivision word. -/ -noncomputable def chart +@[expose] noncomputable def chart (hp : Nat.Prime p) (N : Nat) (q : TopCell hp N) : C(Delta (p - 1), Realization p) := (ReferenceAffineOrbitCount.topRepr hp q.1).refinedContinuousMap N q.2 /-- Vertices of a refined top simplex. -/ +@[expose] noncomputable def vertex (hp : Nat.Prime p) (N : Nat) (q : TopCell hp N) (i : Fin (p - 1 + 1)) : Realization p := chart hp N q (SphereOddDegree.FiniteSimplex.vertex (S := Real) i) /-- Vertex samples of a continuous coordinate map on one refined simplex. -/ -noncomputable def vertexValue +@[expose] noncomputable def vertexValue (hp : Nat.Prime p) (N : Nat) (F : ContinuousCoordinateMap p) (q : TopCell hp N) (i : Fin (p - 1 + 1)) (j : Fin p) : Real := F (vertex hp N q i) j /-- Affine interpolation of the sampled full coordinate vector. -/ -noncomputable def value +@[expose] noncomputable def value (hp : Nat.Prime p) (N : Nat) (F : ContinuousCoordinateMap p) (q : TopCell hp N) (w : StandardSimplex (p - 1)) : Fin p → Real := fun j => ∑ i : Fin (p - 1 + 1), w i * vertexValue hp N F q i j /-- Difference-coordinate vertex samples. -/ +@[expose] noncomputable def deviationVertexValue (hp : Nat.Prime p) (N : Nat) (F : ContinuousCoordinateMap p) (q : TopCell hp N) @@ -86,6 +88,7 @@ noncomputable def deviationVertexValue vertexValue hp N F q i (ReferenceAffineOrbitCount.lastLabel hp) /-- Augmented matrix controlling affine regularity on a refined simplex. -/ +@[expose] noncomputable def augmentedMatrix (hp : Nat.Prime p) (N : Nat) (F : ContinuousCoordinateMap p) (q : TopCell hp N) : @@ -94,12 +97,13 @@ noncomputable def augmentedMatrix (fun k => deviationVertexValue hp N F q i k) r /-- Refined-simplex determinant. -/ -noncomputable def determinant +@[expose] noncomputable def determinant (hp : Nat.Prime p) (N : Nat) (F : ContinuousCoordinateMap p) (q : TopCell hp N) : Real := Matrix.det (augmentedMatrix hp N F q) /-- Relative-interior positive-ray intersection on a refined top simplex. -/ +@[expose] def HasPositiveInteriorZero (hp : Nat.Prime p) (N : Nat) (F : ContinuousCoordinateMap p) (q : TopCell hp N) : Prop := @@ -117,7 +121,7 @@ noncomputable instance hasPositiveInteriorZeroDecidable Classical.propDecidable _ /-- Signed local positive-ray index on one refined simplex. -/ -noncomputable def localIndex +@[expose] noncomputable def localIndex (hp : Nat.Prime p) (N : Nat) (F : ContinuousCoordinateMap p) (q : TopCell hp N) : ZMod p := if HasPositiveInteriorZero hp N F q then @@ -125,16 +129,18 @@ noncomputable def localIndex else 0 /-- Coefficient of a refined top cell: original orbit-cycle coefficient times subdivision sign. -/ +@[expose] noncomputable def coefficient (hp : Nat.Prime p) (N : Nat) (q : TopCell hp N) : ZMod p := (PrimeOrbitCycle.orbitCycle hp).coefficient q.1 * subdivisionSign N q.2 /-- Refined positive orbit count. -/ -noncomputable def zeroCount +@[expose] noncomputable def zeroCount (hp : Nat.Prime p) (N : Nat) (F : ContinuousCoordinateMap p) : ZMod p := ∑ q : TopCell hp N, coefficient hp N q * localIndex hp N F q /-- Straight-line combination of two continuous coordinate maps. -/ +@[expose] noncomputable def segment (F G : ContinuousCoordinateMap p) (t : Real) : ContinuousCoordinateMap p where toFun x := (1 - t) • F x + t • G x @@ -150,6 +156,7 @@ noncomputable def segment simp [segment] /-- A continuous map obtained from an original affine vertex map. -/ +@[expose] noncomputable def ofCoordinateAffineVertexMap (F : CoordinateAffineVertexMap p) : ContinuousCoordinateMap p where toFun := F.globalValue diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RefinedChartCarrierCore.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RefinedChartCarrierCore.lean index 978e3eb7c4..822f7ec9cf 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RefinedChartCarrierCore.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RefinedChartCarrierCore.lean @@ -26,7 +26,7 @@ them to the outputs of two iterated affine-subdivision maps, the compatibility s barycentric subdivisions of one standard simplex. -/ -@[expose] public section +public section namespace NRR namespace FoxNeuwirthOrderComplex @@ -146,6 +146,7 @@ open RefinedAffineMap variable {p : Nat} /-- Transport a label-indexed refinement word to the maximal-simplex vertex index type. -/ +@[expose] noncomputable def maximalRefinementWord (N : Nat) (rho : RefinementWord p N) : Fin N → Equiv.Perm (Fin (p - 1 + 1)) := diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RefinedChartCarrierEquivariant.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RefinedChartCarrierEquivariant.lean index 048cec270a..8b536f09b4 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RefinedChartCarrierEquivariant.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RefinedChartCarrierEquivariant.lean @@ -18,7 +18,7 @@ when two decorated refined charts represent the same global realization point, t affine interpolants of one equivariant sampling map are related by the same decorations. -/ -@[expose] public section +public section namespace NRR namespace FoxNeuwirthOrderComplex diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RefinedReferenceApproximation.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RefinedReferenceApproximation.lean index eef13521a2..62a40214df 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RefinedReferenceApproximation.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RefinedReferenceApproximation.lean @@ -20,7 +20,7 @@ lifts. The positive lift has exactly the S5 orbit count; the negative lift has intersections. -/ -@[expose] public section +public section namespace NRR @@ -218,6 +218,7 @@ theorem negativeReference_zeroCount_zero simp /-- Explicit regular approximation of the positive reference lift. -/ +@[expose] noncomputable def positiveReferenceApproximation (hp : Nat.Prime p) : RegularApproximation hp @@ -245,6 +246,7 @@ noncomputable def positiveReferenceApproximation exact (ne_of_gt (hpos ⟨0, hp.pos⟩)) hi /-- Explicit regular approximation of the negative reference lift. -/ +@[expose] noncomputable def negativeReferenceApproximation (hp : Nat.Prime p) : RegularApproximation hp diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RegularApproximationStability.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RegularApproximationStability.lean index 564fe3d8d5..7817ff631e 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RegularApproximationStability.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RegularApproximationStability.lean @@ -19,7 +19,7 @@ This module introduces the transversality condition required by the endpoint-com Existence and comparison are established by the downstream collar modules. -/ -@[expose] public section +public section namespace NRR @@ -33,6 +33,7 @@ variable {p : Nat} /-- The sampled affine map has no positive-ray intersection on the boundary of any refined top simplex. Equivalently, every positive deviation-zero barycentric point is in the relative interior. -/ +@[expose] def PositiveRaySkeletonFree (hp : Nat.Prime p) (N : Nat) (F : ContinuousCoordinateMap p) : Prop := ∀ (q : TopCell hp N) (w : StandardSimplex (p - 1)), @@ -55,7 +56,7 @@ namespace StableRegularApproximation /-- The stable count is the existing refined count; stability is supplied by the additional transversality field, not by changing the numerical definition. -/ -noncomputable def zeroCount +@[expose] noncomputable def zeroCount {hp : Nat.Prime p} {F : ContinuousCoordinateMap p} (A : StableRegularApproximation hp F) : ZMod p := A.toRegularApproximation.zeroCount @@ -83,6 +84,7 @@ end StableRegularApproximation /-- Finite-PL endpoint comparison proposition. This proposition requires boundary-transverse endpoint approximations. -/ +@[expose] def StableHomotopyInvarianceTheorem : Prop := ∀ {p : Nat} (hp : Nat.Prime p) (F₀ F₁ : EquivariantCoordinateHomotopy.ZeroFreeMap hp) diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeCollarMiddlePrism.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeCollarMiddlePrism.lean index 426ab747b8..7614dc9ae6 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeCollarMiddlePrism.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeCollarMiddlePrism.lean @@ -26,7 +26,7 @@ module identifies its horizontal facet quotient with `RefinedAffineMap.TopCell h packages the exact signed incidence formula. -/ -@[expose] public section +public section namespace NRR @@ -65,12 +65,14 @@ noncomputable def defaultPrismCell ((defaultTopCell hp N, ⟨0, hp.pos⟩), fun _ => Equiv.refl _) /-- The geometric cylinder vertex of one fully refined middle-prism cell. -/ +@[expose] noncomputable def vertex (hp : Nat.Prime p) (N L : Nat) (q : PrismCell hp N L) (i : Fin (p + 1)) : CylinderPoint p := CylinderPoint.ofProd (SubdivisionPrismCharts.vertex hp N L q i) /-- The geometric affine chart of one fully refined middle-prism cell. -/ +@[expose] noncomputable def chart (hp : Nat.Prime p) (N L : Nat) (q : PrismCell hp N L) (w : Delta p) : CylinderPoint p := diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeCollarMiddlePrismBoundary.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeCollarMiddlePrismBoundary.lean index 83618a6c67..0e4acaf822 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeCollarMiddlePrismBoundary.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeCollarMiddlePrismBoundary.lean @@ -24,7 +24,7 @@ required pointwise incidence formula. The resulting object is a genuine `FoxNeuwirthRelativeAffineCollar` at the common endpoint level `N + L`. -/ -@[expose] public section +public section namespace NRR @@ -61,6 +61,7 @@ def mapVertexSignature ((AffinePositiveRayBoundary.VertexMap.facetIndexEquiv hp).symm i))) /-- Prime translation of an affine facet map. -/ +@[expose] def translateFacetMap (p : Nat) (g : PrimeSymmetry p) (tau : Delta (p - 1) → Realization p × Set.Icc (0 : Real) 1) : @@ -235,19 +236,20 @@ theorem lower_add_upper_add_side · simp [hl, hu] /-- Expanded occurrence pairing for an arbitrary facet-map weight. -/ +@[expose] noncomputable def occurrencePairing (hp : Nat.Prime p) (N L : Nat) (W : (Delta (p - 1) → Realization p × Set.Icc (0 : Real) 1) → ZMod p) : ZMod p := weightedOccurrencePairing hp N L W /-- Lower endpoint pairing at the combined spatial level. -/ -noncomputable def lowerEndpointPairing +@[expose] noncomputable def lowerEndpointPairing (hp : Nat.Prime p) (N L : Nat) (W : (Delta (p - 1) → Realization p × Set.Icc (0 : Real) 1) → ZMod p) : ZMod p := weightedLowerEndpointPairing hp N L W /-- Upper endpoint pairing at the combined spatial level. -/ -noncomputable def upperEndpointPairing +@[expose] noncomputable def upperEndpointPairing (hp : Nat.Prime p) (N L : Nat) (W : (Delta (p - 1) → Realization p × Set.Icc (0 : Real) 1) → ZMod p) : ZMod p := weightedUpperEndpointPairing hp N L W @@ -663,13 +665,13 @@ theorem occurrencePairing_eq_upper_sub_lower /-! ## Pointwise middle-prism collar -/ /-- Lower boundary coefficient of one middle-prism facet orbit. -/ -noncomputable def lowerBoundaryCoefficient +@[expose] noncomputable def lowerBoundaryCoefficient (hp : Nat.Prime p) (N L : Nat) (s : (Cells hp N L).Facet) : ZMod p := lowerEndpointPairing hp N L (facetOrbitIndicator hp N L s) /-- Upper boundary coefficient of one middle-prism facet orbit. -/ -noncomputable def upperBoundaryCoefficient +@[expose] noncomputable def upperBoundaryCoefficient (hp : Nat.Prime p) (N L : Nat) (s : (Cells hp N L).Facet) : ZMod p := upperEndpointPairing hp N L (facetOrbitIndicator hp N L s) @@ -811,6 +813,7 @@ theorem upperBoundaryCoefficient_zero_of_not_upper /-- The common-level staircase prism, with its boundary understood pointwise on prime-orbit facets. -/ +@[expose] noncomputable def collar (hp : Nat.Prime p) (N L : Nat) : FoxNeuwirthRelativeAffineCollar hp (N + L) (N + L) (N + L) L where diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeCollarMiddlePrismEndpoints.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeCollarMiddlePrismEndpoints.lean index af7aa9d900..ab5b93a9ba 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeCollarMiddlePrismEndpoints.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeCollarMiddlePrismEndpoints.lean @@ -18,7 +18,7 @@ under the split refinement word. These are the endpoint maps needed by the chai interface; no choice of a unique quotient-facet representative is made. -/ -@[expose] public section +public section namespace NRR @@ -50,6 +50,7 @@ open RefinedAffineMap variable {p : Nat} /-- Split a combined-level top cell into its level-`N` prefix and length-`L` refinement tail. -/ +@[expose] noncomputable def splitTopCellEquiv (hp : Nat.Prime p) (N L : Nat) : TopCell hp (N + L) ≃ TopCell hp N × RefinementWord p L where diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeCollarMiddlePrismEndpointsCore.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeCollarMiddlePrismEndpointsCore.lean index 74fdd14f2f..b905a8956e 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeCollarMiddlePrismEndpointsCore.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeCollarMiddlePrismEndpointsCore.lean @@ -17,7 +17,7 @@ independent of the stable endpoint interpolation and global Stokes modules, so b endpoint cells without an import cycle. -/ -@[expose] public section +public section namespace NRR @@ -41,6 +41,7 @@ open SubdivisionPrismCharts variable {p : Nat} /-- Final staircase simplex. Its final facet is the lower horizontal copy. -/ +@[expose] def lowerStaircaseIndex (hp : Nat.Prime p) : Fin p := ⟨p - 1, by have hp0 := hp.pos @@ -110,6 +111,7 @@ theorem upperStaircaseFacet_indices exact ⟨hk, rfl⟩ /-- Refined prism cell whose endpoint face is the lower boundary simplex. -/ +@[expose] noncomputable def lowerPrismCell (hp : Nat.Prime p) (N L : Nat) (q : TopCell hp N) (eta : RefinementWord p L) : PrismCell hp N L := @@ -117,12 +119,14 @@ noncomputable def lowerPrismCell liftBoundaryRefinementWord L (Fin.last p) eta) /-- Refined prism cell whose endpoint face is the upper boundary simplex. -/ +@[expose] noncomputable def upperPrismCell (hp : Nat.Prime p) (N L : Nat) (q : TopCell hp N) (eta : RefinementWord p L) : PrismCell hp N L := ((q, (⟨0, hp.pos⟩ : Fin p)), liftBoundaryRefinementWord L 0 eta) /-- Canonical lower horizontal facet occurrence. -/ +@[expose] noncomputable def lowerOccurrence (hp : Nat.Prime p) (N L : Nat) (q : TopCell hp N) (eta : RefinementWord p L) : @@ -130,6 +134,7 @@ noncomputable def lowerOccurrence (lowerPrismCell hp N L q eta, endpointOmittedPrime L (Fin.last p)) /-- Canonical upper horizontal facet occurrence. -/ +@[expose] noncomputable def upperOccurrence (hp : Nat.Prime p) (N L : Nat) (q : TopCell hp N) (eta : RefinementWord p L) : diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeCollarThinSlabs.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeCollarThinSlabs.lean index 59cd3ecd14..b56ea48948 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeCollarThinSlabs.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeCollarThinSlabs.lean @@ -24,7 +24,7 @@ collects quotient-facet incidences: side facets cancel inside each slab, adjacen cancel between consecutive slabs, and only the first lower and final upper boundary remain. -/ -@[expose] public section +public section namespace NRR @@ -44,6 +44,7 @@ open RelativeCollarMiddlePrism variable {p : Nat} /-- Affine rescaling of the unit interval onto slab `r` of a positive `m`-slab partition. -/ +@[expose] noncomputable def slabTime (m : Nat) (hm : 0 < m) (r : Fin m) (t : Set.Icc (0 : Real) 1) : Set.Icc (0 : Real) 1 := by @@ -66,6 +67,7 @@ noncomputable def slabTime rfl /-- Embed one cylinder point into a specified thin time slab. -/ +@[expose] noncomputable def slabPoint (m : Nat) (hm : 0 < m) (r : Fin m) (z : CylinderPoint p) : CylinderPoint p where spatial := z.spatial @@ -129,6 +131,7 @@ noncomputable def defaultCell (⟨0, hm⟩, RelativeCollarMiddlePrism.defaultPrismCell hp N 0) /-- Geometric vertex of a thin-stack cell. -/ +@[expose] noncomputable def vertex (hp : Nat.Prime p) (N m : Nat) (hm : 0 < m) (q : Cell hp N m) (i : Fin (p + 1)) : CylinderPoint p := @@ -150,6 +153,7 @@ noncomputable def chart simp [chart, vertex] /-- The thin stack is a genuine affine cell system with unchanged spatial endpoint level `N`. -/ +@[expose] noncomputable def cellSystem (hp : Nat.Prime p) (N m : Nat) (hm : 0 < m) : RelativeAffineCellSystem hp N N N m where diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeCollarThinSlabsBoundary.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeCollarThinSlabsBoundary.lean index 0d51cb3394..7c22c3d174 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeCollarThinSlabsBoundary.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeCollarThinSlabsBoundary.lean @@ -19,7 +19,7 @@ prism. The upper endpoint term of slab `r` is literally the lower endpoint term the finite sum telescopes. Only time zero and time one remain. -/ -@[expose] public section +public section namespace NRR @@ -54,6 +54,7 @@ noncomputable abbrev StackCells (hp : Nat.Prime p) (N m : Nat) (hm : 0 < m) := RelativeCollarThinSlabs.cellSystem hp N m hm /-- Apply the affine time rescaling of slab `r` to an arbitrary facet map. -/ +@[expose] noncomputable def slabFacetMap (m : Nat) (hm : 0 < m) (r : Fin m) (tau : Delta (p - 1) → Realization p × Set.Icc (0 : Real) 1) : @@ -86,6 +87,7 @@ theorem slabFacetMap_translate rfl /-- Embed one base-prism facet occurrence into slab `r`. -/ +@[expose] def stackOccurrence (hp : Nat.Prime p) (N m : Nat) (hm : 0 < m) (r : Fin m) (o : (BaseCells hp N).FacetOccurrence) : @@ -306,6 +308,7 @@ theorem facetIncidence_eq_sum_slabOccurrencePairing /-! ## Mesh endpoint terms and telescoping -/ /-- The `k`-th time node of the uniform `m`-slab mesh. -/ +@[expose] noncomputable def meshTime (m : Nat) (hm : 0 < m) (k : Fin (m + 1)) : Set.Icc (0 : Real) 1 := by refine ⟨(k.1 : Real) / (m : Real), ?_, ?_⟩ @@ -320,6 +323,7 @@ noncomputable def meshTime rfl /-- Place a spatial facet map on one node of the uniform time mesh. -/ +@[expose] noncomputable def meshEndpointMap (m : Nat) (hm : 0 < m) (k : Fin (m + 1)) (sigma : Delta (p - 1) → Realization p) : @@ -352,7 +356,7 @@ theorem slabFacetMap_upperEndpointMap /-- Pair the spatial Fox--Neuwirth chain at level `N` with one stack quotient facet on a fixed mesh node. -/ -noncomputable def meshEndpointPairing +@[expose] noncomputable def meshEndpointPairing (hp : Nat.Prime p) (N m : Nat) (hm : 0 < m) (s : (StackCells hp N m hm).Facet) (k : Fin (m + 1)) : ZMod p := ∑ q : TopCell hp N, @@ -479,12 +483,14 @@ theorem facetIncidence_eq_last_sub_first_mesh exact sum_fin_succ_sub m (meshEndpointPairing hp N m hm s) /-- External lower boundary coefficient of a thin stack. -/ +@[expose] noncomputable def lowerBoundaryCoefficient (hp : Nat.Prime p) (N m : Nat) (hm : 0 < m) (s : (StackCells hp N m hm).Facet) : ZMod p := meshEndpointPairing hp N m hm s 0 /-- External upper boundary coefficient of a thin stack. -/ +@[expose] noncomputable def upperBoundaryCoefficient (hp : Nat.Prime p) (N m : Nat) (hm : 0 < m) (s : (StackCells hp N m hm).Facet) : ZMod p := @@ -571,6 +577,7 @@ theorem upperBoundaryCoefficient_zero_of_not_upper rw [hindicator, mul_zero] /-- The complete thin-time stack as a pointwise Fox--Neuwirth relative affine collar. -/ +@[expose] noncomputable def collar (hp : Nat.Prime p) (N m : Nat) (hm : 0 < m) : FoxNeuwirthRelativeAffineCollar hp N N N m where diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeCollarThinSlabsEndpoints.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeCollarThinSlabsEndpoints.lean index eca346146c..e74710d48a 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeCollarThinSlabsEndpoints.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeCollarThinSlabsEndpoints.lean @@ -18,7 +18,7 @@ pairing identities, exhaustiveness, and representative geometry required by `EndpointIdentifiedRelativeAffineCollar`. -/ -@[expose] public section +public section namespace NRR @@ -44,6 +44,7 @@ open RefinedAffineMap variable {p : Nat} /-- First slab of a positive stack. -/ +@[expose] def firstSlab (m : Nat) (hm : 0 < m) : Fin m := ⟨0, hm⟩ diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeSubdivisionCellParameters.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeSubdivisionCellParameters.lean index 9b139cab11..eb63daed9d 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeSubdivisionCellParameters.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeSubdivisionCellParameters.lean @@ -36,7 +36,7 @@ specific Fox--Neuwirth orbit cycle and identify their horizontal chains with the approximations. -/ -@[expose] public section +public section namespace NRR @@ -61,6 +61,7 @@ section FiniteSupport variable {R : Type} [CommRing R] {X : TopCat.{0}} {n : Nat} /-- Value of a finite list of coefficient/simplex terms in the singular chain group. -/ +@[expose] noncomputable def expansionValue (terms : List (R × singularSimplices X n)) : singularChainGroup R X n := terms.foldr @@ -282,6 +283,7 @@ noncomputable instance globalVertexAction : simp [mul_smul] /-- Actual cylinder point represented by a global relative-collar vertex. -/ +@[expose] noncomputable def globalPoint : GlobalVertex p B → CylinderPoint p := Quotient.lift (coverPoint p B) (by intro a b hab diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeSubdivisionCylinderBoundary.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeSubdivisionCylinderBoundary.lean index 8b315c5b80..ae4119607e 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeSubdivisionCylinderBoundary.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeSubdivisionCylinderBoundary.lean @@ -27,7 +27,7 @@ to be the characteristic function of one quotient-facet class gives the pointwis identity needed by the global Fox--Neuwirth collar. -/ -@[expose] public section +public section namespace NRR namespace FoxNeuwirthOrderComplex @@ -41,6 +41,7 @@ open EquivariantPrismStableRelativeBoundary.FiniteSimplexDoubleBoundary /-- Delete one entry from an ordered vertex tuple. -/ +@[expose] def deleteTuple {X : Type} {n : Nat} (v : Fin (n + 2) → X) (j : Fin (n + 2)) : Fin (n + 1) → X := @@ -53,13 +54,14 @@ def coneTuple Fin.cases a v /-- Ordered full facet of one recursive cylinder cell. -/ +@[expose] noncomputable def facetTuple (d : Nat) (q : RelativeSubdivisionCylinderCombinatorics.Cell d) (j : Fin (d + 2)) : Fin (d + 1) → Delta d × Set.Icc (0 : Real) 1 := deleteTuple (RelativeSubdivisionCylinderCombinatorics.vertex d q) j /-- Alternating weighted boundary of the complete recursive cylinder chain. -/ -noncomputable def fullBoundaryPairing +@[expose] noncomputable def fullBoundaryPairing (R : Type) [CommRing R] (d : Nat) (W : (Fin (d + 1) → Delta d × Set.Icc (0 : Real) 1) → R) : R := ∑ q : RelativeSubdivisionCylinderCombinatorics.Cell d, @@ -68,7 +70,7 @@ noncomputable def fullBoundaryPairing SimplicialChain.faceSign j * W (facetTuple d q j) /-- Weighted cone-base chain. -/ -noncomputable def basePairing +@[expose] noncomputable def basePairing (R : Type) [CommRing R] (d : Nat) (W : (Fin (d + 1) → Delta d × Set.Icc (0 : Real) 1) → R) : R := ∑ q : RelativeSubdivisionCylinderCombinatorics.Cell d, diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeSubdivisionCylinderCombinatorics.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeSubdivisionCylinderCombinatorics.lean index f36bf72c4e..6a73be6321 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeSubdivisionCylinderCombinatorics.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeSubdivisionCylinderCombinatorics.lean @@ -22,7 +22,7 @@ all barycentric top simplices, and recursively triangulated side cylinders. Ever is then coned to the central point `(barycenter, 1 / 2)`. -/ -@[expose] public section +public section namespace NRR namespace FoxNeuwirthOrderComplex @@ -33,7 +33,7 @@ open SphereOddDegree open SphereOddDegree.AffineBarycentricSubdivision /-- Top cells of the recursive cone triangulation of `Delta d x I`. -/ -def Cell : Nat → Type +@[expose] def Cell : Nat → Type | 0 => Unit ⊕ Equiv.Perm (Fin 1) | d + 1 => Unit ⊕ (Equiv.Perm (Fin (d + 2)) ⊕ (Fin (d + 2) × Cell d)) @@ -51,17 +51,19 @@ noncomputable instance cellFintype : (d : Nat) → Fintype (Cell d) infer_instance /-- The cell coned from the coarse lower simplex. -/ +@[expose] def lowerCell : (d : Nat) → Cell d | 0 => Sum.inl () | _ + 1 => Sum.inl () /-- The cell coned from one top barycentric simplex. -/ +@[expose] def upperCell : (d : Nat) → Equiv.Perm (Fin (d + 1)) → Cell d | 0, pi => Sum.inr pi | _ + 1, pi => Sum.inr (Sum.inl pi) /-- A cell coned from a recursively triangulated side face. -/ -def sideCell (d : Nat) (k : Fin (d + 2)) (q : Cell d) : Cell (d + 1) := +@[expose] def sideCell (d : Nat) (k : Fin (d + 2)) (q : Cell d) : Cell (d + 1) := Sum.inr (Sum.inr (k, q)) /-- The central cone point. -/ @@ -69,18 +71,20 @@ noncomputable def apex (d : Nat) : Delta d × Set.Icc (0 : Real) 1 := (deltaBarycenter d, ⟨(1 : Real) / 2, by constructor <;> norm_num⟩) /-- Coarse lower-boundary vertex. -/ +@[expose] noncomputable def lowerBoundaryVertex (d : Nat) (i : Fin (d + 1)) : Delta d × Set.Icc (0 : Real) 1 := (SphereOddDegree.FiniteSimplex.vertex (S := Real) i, ⟨0, by norm_num⟩) /-- Barycentric upper-boundary vertex. -/ +@[expose] noncomputable def upperBoundaryVertex (d : Nat) (pi : Equiv.Perm (Fin (d + 1))) (i : Fin (d + 1)) : Delta d × Set.Icc (0 : Real) 1 := (prefixBarycenter d pi i, ⟨1, by norm_num⟩) /-- Embed a point of a lower-dimensional cylinder into the side opposite `k`. -/ -noncomputable def sidePoint +@[expose] noncomputable def sidePoint (d : Nat) (k : Fin (d + 2)) (z : Delta d × Set.Icc (0 : Real) 1) : Delta (d + 1) × Set.Icc (0 : Real) 1 := @@ -110,7 +114,7 @@ noncomputable def sidePoint exact (Fin.succAbove_ne k i (Finset.mem_filter.mp hi).2).elim /-- Ordered vertices of a recursive cylinder cell. -/ -noncomputable def vertex : +@[expose] noncomputable def vertex : (d : Nat) → Cell d → Fin (d + 2) → Delta d × Set.Icc (0 : Real) 1 | 0, q, i => Fin.cases (apex 0) @@ -148,7 +152,7 @@ noncomputable def vertex : rfl /-- Spatial barycentric interpolation of a recursive cylinder cell. -/ -noncomputable def spatialPoint +@[expose] noncomputable def spatialPoint (d : Nat) (q : Cell d) (w : Delta (d + 1)) : Delta d := ⟨fun c => ∑ i : Fin (d + 2), w i * (vertex d q i).1 c, by constructor @@ -172,7 +176,7 @@ noncomputable def spatialPoint _ = 1 := SphereOddDegree.FiniteSimplex.sum_eq_one w⟩ /-- Time barycentric interpolation of a recursive cylinder cell. -/ -noncomputable def timePoint +@[expose] noncomputable def timePoint (d : Nat) (q : Cell d) (w : Delta (d + 1)) : Set.Icc (0 : Real) 1 := ⟨∑ i : Fin (d + 2), w i * (vertex d q i).2.1, by constructor @@ -188,7 +192,7 @@ noncomputable def timePoint _ = 1 := by simp [SphereOddDegree.FiniteSimplex.sum_eq_one w]⟩ /-- Affine chart of one recursive one-step cylinder cell. -/ -noncomputable def chart +@[expose] noncomputable def chart (d : Nat) (q : Cell d) (w : Delta (d + 1)) : Delta d × Set.Icc (0 : Real) 1 := (spatialPoint d q w, timePoint d q w) @@ -576,7 +580,7 @@ namespace Oriented open SphereOddDegree.AffineBarycentricSubdivision /-- Integral orientation coefficient of a recursive cylinder top cell. -/ -def coefficientInt : (d : Nat) → Cell d → Int +@[expose] def coefficientInt : (d : Nat) → Cell d → Int | 0, Sum.inl _ => -1 | 0, Sum.inr pi => Equiv.Perm.sign pi | _d + 1, Sum.inl _ => -1 @@ -585,7 +589,7 @@ def coefficientInt : (d : Nat) → Cell d → Int -((-1 : Int) ^ k.1) * coefficientInt d q /-- Orientation coefficient with values in an arbitrary commutative ring. -/ -noncomputable def coefficient +@[expose] noncomputable def coefficient (R : Type) [CommRing R] : (d : Nat) → Cell d → R | 0, Sum.inl _ => -1 | 0, Sum.inr pi => permSignCoeff R pi @@ -626,6 +630,7 @@ noncomputable def coefficient -((-1 : R) ^ k.1) * coefficient R d q := rfl /-- Ordered vertex signature of the cone-base facet. -/ +@[expose] noncomputable def baseFacetVertex (d : Nat) (q : Cell d) (i : Fin (d + 1)) : Delta d × Set.Icc (0 : Real) 1 := @@ -648,21 +653,21 @@ noncomputable def baseFacetVertex vertex_succ_side d k q i /-- Weighted pairing with the triangulated boundary simplex opposite the cone apex. -/ -noncomputable def baseFacetPairing +@[expose] noncomputable def baseFacetPairing (R : Type) [CommRing R] (d : Nat) (W : (Fin (d + 1) → Delta d × Set.Icc (0 : Real) 1) → R) : R := ∑ q : Cell d, coefficient R d q * W (baseFacetVertex d q) /-- The lower coarse boundary contribution. -/ -noncomputable def lowerPairing +@[expose] noncomputable def lowerPairing (R : Type) [CommRing R] (d : Nat) (W : (Fin (d + 1) → Delta d × Set.Icc (0 : Real) 1) → R) : R := -W (lowerBoundaryVertex d) /-- The upper barycentric-subdivision boundary contribution. -/ -noncomputable def upperPairing +@[expose] noncomputable def upperPairing (R : Type) [CommRing R] (d : Nat) (W : (Fin (d + 1) → Delta d × Set.Icc (0 : Real) 1) → R) : R := @@ -670,7 +675,7 @@ noncomputable def upperPairing permSignCoeff R pi * W (upperBoundaryVertex d pi) /-- Recursive side-boundary contribution in positive dimension. -/ -noncomputable def sidePairing +@[expose] noncomputable def sidePairing (R : Type) [CommRing R] (d : Nat) (W : (Fin (d + 2) → Delta (d + 1) × Set.Icc (0 : Real) 1) → R) : R := diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeSubdivisionEndpointCollar.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeSubdivisionEndpointCollar.lean index 452d030074..c340eb4f1e 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeSubdivisionEndpointCollar.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeSubdivisionEndpointCollar.lean @@ -18,7 +18,7 @@ upper endpoint. Composing the lower stack with that reversed upper stack gives a endpoint-identified affine collar for any two subdivision levels. -/ -@[expose] public section +public section namespace NRR namespace FoxNeuwirthOrderComplex @@ -48,6 +48,7 @@ noncomputable def identityWitness collar := RelativeCollarThinSlabsEndpoints.endpointIdentifiedCollar hp N 1 (by omega) /-- One-step subdivision witness. -/ +@[expose] noncomputable def oneStepWitness (hp : Nat.Prime p) (N : Nat) : Witness hp N (N + 1) where commonLevel := N + 1 @@ -63,6 +64,7 @@ noncomputable def reverseWitness collar := reverseEndpointCollar C.collar /-- Compose two existential collar witnesses. -/ +@[expose] noncomputable def composeWitness {hp : Nat.Prime p} {N₀ Nmid N₁ : Nat} (C : Witness hp N₀ Nmid) (D : Witness hp Nmid N₁) : diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeSubdivisionOneStepBoundary.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeSubdivisionOneStepBoundary.lean index 62161fa264..1858aff4ac 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeSubdivisionOneStepBoundary.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeSubdivisionOneStepBoundary.lean @@ -24,7 +24,7 @@ and prime invariance of the quotient-facet characteristic weight lets `orbit_boundary_pairing_eq_zero` apply. -/ -@[expose] public section +public section namespace NRR namespace FoxNeuwirthOrderComplex @@ -274,6 +274,7 @@ theorem facetIncidence_eq_localBase rw [NRR.FoxNeuwirthOrderComplex.RelativeSubdivisionCylinderBoundary.fullBoundaryPairing_eq_base] /-- Quotient-facet Kronecker delta. -/ +@[expose] noncomputable def quotientIndicator {hp : Nat.Prime p} (s t : (RelativeSubdivisionOneStepCells.cellSystem hp N).Facet) : ZMod p := if t = s then 1 else 0 @@ -854,13 +855,13 @@ theorem sideBasePairing_eq_zero /-! ## Pointwise collar boundary -/ /-- Lower boundary coefficient of one quotient facet. -/ -noncomputable def lowerBoundaryCoefficient +@[expose] noncomputable def lowerBoundaryCoefficient (hp : Nat.Prime p) (N : Nat) (s : (RelativeSubdivisionOneStepCells.cellSystem hp N).Facet) : ZMod p := RelativeSubdivisionOneStepBoundaryBase.lowerEndpointPairing hp N (quotientIndicator s) /-- Upper boundary coefficient of one quotient facet. -/ -noncomputable def upperBoundaryCoefficient +@[expose] noncomputable def upperBoundaryCoefficient (hp : Nat.Prime p) (N : Nat) (s : (RelativeSubdivisionOneStepCells.cellSystem hp N).Facet) : ZMod p := RelativeSubdivisionOneStepBoundaryBase.upperEndpointPairing hp N (quotientIndicator s) diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeSubdivisionOneStepBoundaryBase.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeSubdivisionOneStepBoundaryBase.lean index 942d07827c..3500e35558 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeSubdivisionOneStepBoundaryBase.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeSubdivisionOneStepBoundaryBase.lean @@ -23,7 +23,7 @@ The radial-facet cancellation and the recursive-side vanishing over the Fox--Neu are proved in the boundary-cancellation module. -/ -@[expose] public section +public section namespace NRR namespace FoxNeuwirthOrderComplex @@ -40,12 +40,14 @@ open RefinedAffineMap variable {p : Nat} /-- The base facet occurrence of a coned top cell. -/ +@[expose] noncomputable def baseOccurrence (hp : Nat.Prime p) (N : Nat) (q : RelativeSubdivisionOneStepCells.Cell hp N) : (RelativeSubdivisionOneStepCells.cellSystem hp N).FacetOccurrence := (q, 0) /-- Pairing of all cone-base facets against an arbitrary quotient-facet weight. -/ +@[expose] noncomputable def basePairing (hp : Nat.Prime p) (N : Nat) (W : (RelativeSubdivisionOneStepCells.cellSystem hp N).Facet → ZMod p) : ZMod p := @@ -54,6 +56,7 @@ noncomputable def basePairing W ((RelativeSubdivisionOneStepCells.cellSystem hp N).facetClass (baseOccurrence hp N q)) /-- A local base cell belongs to one of the two external horizontal boundaries. -/ +@[expose] def IsEndpointCell (hp : Nat.Prime p) (q : RelativeSubdivisionCylinderCombinatorics.Cell (p - 1)) : Prop := q = RelativeSubdivisionCylinderCombinatorics.lowerCell (p - 1) ∨ @@ -76,7 +79,7 @@ noncomputable def endpointBasePairing else 0 /-- Recursive spatial-side part of the cone-base pairing. -/ -noncomputable def sideBasePairing +@[expose] noncomputable def sideBasePairing (hp : Nat.Prime p) (N : Nat) (W : (RelativeSubdivisionOneStepCells.cellSystem hp N).Facet → ZMod p) : ZMod p := ∑ q : RelativeSubdivisionOneStepCells.Cell hp N, @@ -97,6 +100,7 @@ theorem basePairing_eq_endpoint_add_side by_cases h : IsEndpointCell hp q.2 <;> simp [h] /-- The lower endpoint contribution of the cone-base chain. -/ +@[expose] noncomputable def lowerEndpointPairing (hp : Nat.Prime p) (N : Nat) (W : (RelativeSubdivisionOneStepCells.cellSystem hp N).Facet → ZMod p) : ZMod p := @@ -104,6 +108,7 @@ noncomputable def lowerEndpointPairing RefinedAffineMap.coefficient hp N q * W (RelativeSubdivisionOneStepEndpoints.lowerFacet hp N q) /-- The upper endpoint contribution of the cone-base chain. -/ +@[expose] noncomputable def upperEndpointPairing (hp : Nat.Prime p) (N : Nat) (W : (RelativeSubdivisionOneStepCells.cellSystem hp N).Facet → ZMod p) : ZMod p := diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeSubdivisionOneStepCells.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeSubdivisionOneStepCells.lean index f43746a9c8..43f05ec802 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeSubdivisionOneStepCells.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeSubdivisionOneStepCells.lean @@ -22,7 +22,7 @@ the genuine cells and prove all nondegeneracy and prime-orbit separation fields `RelativeAffineCellSystem`. -/ -@[expose] public section +public section namespace NRR namespace FoxNeuwirthOrderComplex @@ -51,29 +51,33 @@ noncomputable instance (hp : Nat.Prime p) (N : Nat) : DecidableEq (Cell hp N) := /-- Reinterpret a `Delta p` coordinate as the domain `Delta ((p - 1) + 1)` of the local cylinder. Primality gives `0 < p`, hence `(p - 1) + 1 = p`. -/ +@[expose] noncomputable def localWeight (hp : Nat.Prime p) (w : Delta p) : Delta ((p - 1) + 1) := by rw [Nat.sub_add_cancel hp.pos] exact w /-- Local recursive-cylinder point represented by a global source barycentric coordinate. -/ -noncomputable def localPoint +@[expose] noncomputable def localPoint (hp : Nat.Prime p) (q : RelativeSubdivisionCylinderCombinatorics.Cell (p - 1)) (w : Delta p) : Delta (p - 1) × Set.Icc (0 : Real) 1 := RelativeSubdivisionCylinderCombinatorics.chart (p - 1) q (localWeight hp w) /-- Lift a local cylinder point through one refined Fox--Neuwirth chart. -/ +@[expose] noncomputable def liftPoint (hp : Nat.Prime p) (N : Nat) (q : TopCell hp N) (z : Delta (p - 1) × Set.Icc (0 : Real) 1) : CylinderPoint p := CylinderPoint.ofProd (RefinedAffineMap.chart hp N q z.1, z.2) /-- Affine chart of one global one-step subdivision-cylinder cell. -/ +@[expose] noncomputable def chart (hp : Nat.Prime p) (N : Nat) (q : Cell hp N) (w : Delta p) : CylinderPoint p := liftPoint hp N q.1 (localPoint hp q.2 w) /-- Geometric vertices are defined by restriction of the global affine chart. -/ +@[expose] noncomputable def vertex (hp : Nat.Prime p) (N : Nat) (q : Cell hp N) (i : Fin (p + 1)) : CylinderPoint p := chart hp N q (SphereOddDegree.FiniteSimplex.vertex (S := Real) i) @@ -233,12 +237,14 @@ theorem vertex_orbit_injective /-- Coefficient of a lifted top cell: the refined orbit-cycle coefficient times the recursive one-step-cylinder orientation coefficient. -/ +@[expose] noncomputable def coefficient (hp : Nat.Prime p) (N : Nat) (q : Cell hp N) : ZMod p := RefinedAffineMap.coefficient hp N q.1 * RelativeSubdivisionCylinderCombinatorics.Oriented.coefficient (ZMod p) (p - 1) q.2 /-- Explicit finite affine one-step cylinder between refinement levels `N` and `N + 1`. -/ +@[expose] noncomputable def cellSystem (hp : Nat.Prime p) (N : Nat) : RelativeAffineCellSystem hp N (N + 1) (N + 1) 0 where diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeSubdivisionOneStepCollar.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeSubdivisionOneStepCollar.lean index c74571dc5c..b918ce1bd3 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeSubdivisionOneStepCollar.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeSubdivisionOneStepCollar.lean @@ -16,7 +16,7 @@ The pointwise boundary identity from `RelativeSubdivisionOneStepBoundary` is pac level-`N+1` refined Fox--Neuwirth chains. -/ -@[expose] public section +public section namespace NRR namespace FoxNeuwirthOrderComplex @@ -153,6 +153,7 @@ theorem upperBoundaryPairing_eq simp /-- The genuine one-step affine collar from refinement level `N` to level `N+1`. -/ +@[expose] noncomputable def relativeCollar (hp : Nat.Prime p) (N : Nat) : FoxNeuwirthRelativeAffineCollar hp N (N + 1) (N + 1) 0 where @@ -164,6 +165,7 @@ noncomputable def relativeCollar incidence_eq_boundary := RelativeSubdivisionOneStepBoundary.incidence_eq_boundary hp N /-- The one-step collar has exactly the independently refined Fox--Neuwirth endpoint chains. -/ +@[expose] noncomputable def endpointIdentifiedCollar (hp : Nat.Prime p) (N : Nat) : EndpointIdentifiedRelativeAffineCollar hp N (N + 1) (N + 1) 0 where diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeSubdivisionOneStepEndpoints.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeSubdivisionOneStepEndpoints.lean index 5f013f9a75..1f0a30ba52 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeSubdivisionOneStepEndpoints.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RelativeSubdivisionOneStepEndpoints.lean @@ -21,7 +21,7 @@ quotient-facet level, while the geometric theorems are stated for arbitrary repr canonical occurrences. The signed boundary formula is supplied in the following module. -/ -@[expose] public section +public section namespace NRR namespace FoxNeuwirthOrderComplex @@ -83,6 +83,7 @@ private theorem localPoint_upper_vertex (RelativeSubdivisionCylinderCombinatorics.vertex_succ_upper n pi i) /-- Split a level-`N + 1` top cell into its level-`N` prefix and final subdivision permutation. -/ +@[expose] noncomputable def splitTopCellEquiv (hp : Nat.Prime p) (N : Nat) : TopCell hp (N + 1) ≃ TopCell hp N × Equiv.Perm (Fin p) where @@ -117,6 +118,7 @@ theorem coefficient_snoc ring /-- Canonical lower horizontal occurrence over a level-`N` top cell. -/ +@[expose] noncomputable def lowerOccurrence (hp : Nat.Prime p) (N : Nat) (q : TopCell hp N) : (RelativeSubdivisionOneStepCells.cellSystem hp N).FacetOccurrence := @@ -124,6 +126,7 @@ noncomputable def lowerOccurrence /-- Canonical upper horizontal occurrence over a level-`N` cell and one final subdivision permutation. -/ +@[expose] noncomputable def upperOccurrenceBase (hp : Nat.Prime p) (N : Nat) (q : TopCell hp N) (pi : Equiv.Perm (Fin p)) : @@ -132,6 +135,7 @@ noncomputable def upperOccurrenceBase simpa [Nat.sub_add_cancel hp.pos] using pi)), 0) /-- Canonical upper horizontal occurrence indexed by a level-`N + 1` top cell. -/ +@[expose] noncomputable def upperOccurrence (hp : Nat.Prime p) (N : Nat) (q : TopCell hp (N + 1)) : (RelativeSubdivisionOneStepCells.cellSystem hp N).FacetOccurrence := @@ -139,12 +143,14 @@ noncomputable def upperOccurrence upperOccurrenceBase hp N data.1 data.2 /-- Canonical lower quotient facet. -/ +@[expose] noncomputable def lowerFacet (hp : Nat.Prime p) (N : Nat) (q : TopCell hp N) : (RelativeSubdivisionOneStepCells.cellSystem hp N).Facet := (RelativeSubdivisionOneStepCells.cellSystem hp N).facetClass (lowerOccurrence hp N q) /-- Canonical upper quotient facet. -/ +@[expose] noncomputable def upperFacet (hp : Nat.Prime p) (N : Nat) (q : TopCell hp (N + 1)) : (RelativeSubdivisionOneStepCells.cellSystem hp N).Facet := diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBAffineFibers.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBAffineFibers.lean index 9248ad6ca8..30e700b600 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBAffineFibers.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBAffineFibers.lean @@ -23,7 +23,7 @@ coefficient is nonzero, the bad fiber is contained in a singleton and therefore has Lebesgue measure zero. -/ -@[expose] public section +public section namespace NRR @@ -46,6 +46,7 @@ variable (hp : Nat.Prime p) variable (C : RelativeAffineCellSystem hp N₀ N₁ M L) /-- The movable parameter selected by a mixed-face case. -/ +@[expose] noncomputable def MixedFaceCase.selectedParameter (κ : MixedFaceCase hp C) : MovableParameter hp C := ⟨localParameter hp C κ.cell κ.retained κ.coordinate, κ.movable⟩ diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBBadSetNullity.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBBadSetNullity.lean index 92b41d6fad..ad3e8b57a3 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBBadSetNullity.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBBadSetNullity.lean @@ -35,7 +35,7 @@ system of deviation equations (or an equivalent nonzero elimination polynomial), rather than only one fixed-witness scalar equation. -/ -@[expose] public section +public section namespace NRR diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBCanonicalCoordinateSplit.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBCanonicalCoordinateSplit.lean index 5b42280998..c6d3a971ed 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBCanonicalCoordinateSplit.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBCanonicalCoordinateSplit.lean @@ -22,7 +22,7 @@ This construction requires no additional coordinate-equivalence hypothesis. -/ -@[expose] public section +public section namespace NRR @@ -45,6 +45,7 @@ namespace MixedFaceCase /-- Predicate selecting precisely the `p` movable scalar-orbit parameters of one retained local vertex. -/ +@[expose] def IsSelectedVectorParameter (κ : MixedFaceCase hp C) (q : MovableParameter hp C) : Prop := q ∈ Set.range (κ.vectorParameter hp C) @@ -63,6 +64,7 @@ abbrev RemainingMovableParameter (κ : MixedFaceCase hp C) := {q : MovableParameter hp C // ¬ κ.IsSelectedVectorParameter hp C q} /-- The coordinate map is an equivalence from `Fin p` onto the selected range. -/ +@[expose] noncomputable def vectorParameterEquiv (κ : MixedFaceCase hp C) : Fin p ≃ κ.SelectedVectorParameter hp C := @@ -75,6 +77,7 @@ noncomputable def vectorParameterEquiv /-- Canonical measurable coordinate split into the selected block and its complement. -/ +@[expose] noncomputable def parameterSplit (κ : MixedFaceCase hp C) : MovableParameterSpace hp C ≃ᵐ diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBEndpointFacetTargets.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBEndpointFacetTargets.lean index 2729c1913d..c8f1e1f59b 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBEndpointFacetTargets.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBEndpointFacetTargets.lean @@ -20,7 +20,7 @@ remaining movable columns with the missing coarse-simplex values makes the selec permutation of the regular endpoint matrix. -/ -@[expose] public section +public section namespace NRR open FoxNeuwirthOrderComplex @@ -329,6 +329,7 @@ theorem oneStepLowerFacetTarget_respects_lower Finset.sum_ite_eq'] /-- Lower-relative facet target property used by stack composition. -/ +@[expose] def LowerFacetTargets (hp : Nat.Prime p) {N₀ N₁ M L : Nat} diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBFacetTargetComposition.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBFacetTargetComposition.lean index 8d4b487125..ce6216f4b9 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBFacetTargetComposition.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBFacetTargetComposition.lean @@ -18,7 +18,7 @@ triangular facet witness. Reversal gives upper-relative targets. A final lower then produces targets respecting the exact frozen-parameter predicate. -/ -@[expose] public section +public section namespace NRR open FoxNeuwirthOrderComplex diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBFacetWitnessRealization.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBFacetWitnessRealization.lean index 985a0c7a79..c1e86f6bac 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBFacetWitnessRealization.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBFacetWitnessRealization.lean @@ -18,7 +18,7 @@ that target by one global movable-parameter assignment. This is the algebraic a concrete endpoint-stack facet witnesses. -/ -@[expose] public section +public section namespace NRR open FoxNeuwirthOrderComplex @@ -40,6 +40,7 @@ variable (C : RelativeAffineCellSystem hp N₀ N₁ M L) /-- A local target respects the relative boundary when it agrees with the base assignment at every frozen local scalar site. -/ +@[expose] def LocalTargetRespectsFrozen (base : Assignment hp C) (q : C.Cell) (target : Fin (p + 1) → Fin p → Real) : Prop := diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBFiniteAvoidance.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBFiniteAvoidance.lean index 54aaf01dc8..e647ee276e 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBFiniteAvoidance.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBFiniteAvoidance.lean @@ -20,7 +20,7 @@ Once every individual geometric bad set has been proved null, the theorem positive-measure perturbation ball which avoids all of them simultaneously. -/ -@[expose] public section +public section namespace NRR namespace FoxNeuwirthOrderComplex diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBFrozenSupportGeometry.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBFrozenSupportGeometry.lean index 460c135403..1749189a03 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBFrozenSupportGeometry.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBFrozenSupportGeometry.lean @@ -18,7 +18,7 @@ Collar composition then converts those two one-sided statements into the global condition because the two half-cylinder embeddings have no other horizontal points. -/ -@[expose] public section +public section namespace NRR diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBFullBadSetNullity.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBFullBadSetNullity.lean index 381b39c193..6f18e79b70 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBFullBadSetNullity.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBFullBadSetNullity.lean @@ -22,7 +22,7 @@ the measure-preserving coordinate split give nullity of the original complete bad set, including its existential simplex witness. -/ -@[expose] public section +public section namespace NRR diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBMixedFaceBadSetMeasurable.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBMixedFaceBadSetMeasurable.lean index 0cbb1889fb..6f5b75d64e 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBMixedFaceBadSetMeasurable.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBMixedFaceBadSetMeasurable.lean @@ -20,7 +20,7 @@ projection is closed because the simplex is compact. Hence the complete bad set is a countable union of closed sets. -/ -@[expose] public section +public section namespace NRR diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBMixedFaceIncidence.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBMixedFaceIncidence.lean index b2095112cc..8ae4c1610a 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBMixedFaceIncidence.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBMixedFaceIncidence.lean @@ -16,7 +16,7 @@ coefficient is positive. The next stages will prove that each resulting bad parameter set is null. -/ -@[expose] public section +public section namespace NRR @@ -77,6 +77,7 @@ noncomputable instance mixedFaceCaseDecidableEq : DecidableEq (MixedFaceCase hp Classical.decEq _ /-- The bad set attached to one distinguished positive movable vertex. -/ +@[expose] def mixedFaceBadSet (base : Assignment hp C) (κ : MixedFaceCase hp C) : Set (MovableParameterSpace hp C) := @@ -97,6 +98,7 @@ def mixedFaceBadSet /-- A positive-ray incidence on a codimension-two face has a positive movable witness when at least one retained vertex with positive barycentric weight has a movable local scalar parameter. -/ +@[expose] def HasPositiveMovableWitness (q : C.Cell) (w : StandardSimplex p) (i j : Fin (p + 1)) : Prop := diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBMovableParameterSpace.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBMovableParameterSpace.lean index a74aa033df..5b88400a12 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBMovableParameterSpace.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBMovableParameterSpace.lean @@ -18,7 +18,7 @@ coordinate-replacement and reconstruction lemmas needed by the incidence argument. -/ -@[expose] public section +public section namespace NRR namespace FoxNeuwirthOrderComplex @@ -38,12 +38,14 @@ variable (C : RelativeAffineCellSystem hp N₀ N₁ M L) abbrev MovableParameterSpace := MovableParameter hp C → Real /-- Movable coordinates extracted from a full assignment. -/ +@[expose] noncomputable def baseMovableParameters (base : Assignment hp C) : MovableParameterSpace hp C := movableRestriction hp C base /-- Reconstruct the full equivariant assignment while retaining every frozen horizontal coordinate literally. -/ +@[expose] noncomputable def assignmentOfMovableParameters (base : Assignment hp C) (x : MovableParameterSpace hp C) : Assignment hp C := replaceMovable hp C base x @@ -66,6 +68,7 @@ noncomputable def assignmentOfMovableParameters replaceMovable_movableRestriction hp C base /-- Replace one movable scalar orbit and leave every other movable orbit fixed. -/ +@[expose] noncomputable def replaceCoordinate (x : MovableParameterSpace hp C) (q : MovableParameter hp C) (r : Real) : MovableParameterSpace hp C := diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBSelectedVectorBlock.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBSelectedVectorBlock.lean index 562903b7f8..ff6da25bf8 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBSelectedVectorBlock.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBSelectedVectorBlock.lean @@ -21,7 +21,7 @@ The proof uses the `vertex_orbit_injective` field of without justification. -/ -@[expose] public section +public section namespace NRR @@ -93,6 +93,7 @@ namespace MixedFaceCase /-- The complete movable `p`-coordinate block belonging to the retained local vertex selected by a mixed-face case. -/ +@[expose] noncomputable def vectorParameter (κ : MixedFaceCase hp C) (j : Fin p) : MovableParameter hp C := ⟨localParameter hp C κ.cell κ.retained j, diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBSmallGenericPerturbation.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBSmallGenericPerturbation.lean index 38a848d21c..a029175c64 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBSmallGenericPerturbation.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBSmallGenericPerturbation.lean @@ -23,7 +23,7 @@ The incidence analysis is organized by positive support: Step 5 supplies the bad-set nullity certificates internally. -/ -@[expose] public section +public section namespace NRR @@ -89,6 +89,7 @@ def AllCellsFacetRegular /-- Support-level endpoint safety. It is invoked only when every vertex with positive barycentric weight is frozen. Zero-weight nonhorizontal vertices do not affect this condition. -/ +@[expose] def FrozenPositiveSupportRaySafe (a : Assignment hp C) : Prop := ∀ (q : C.Cell) (w : StandardSimplex p) @@ -199,6 +200,7 @@ def AllRestrictedFacetPolynomialsNonzero /-- Geometric form of facet-polynomial nontriviality. Different local facets may use different movable assignments. -/ +@[expose] def AllFacetRegularityWitnesses (base : Assignment hp C) : Prop := ∀ (q : C.Cell) (k : Fin (p + 1)), diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBStepsOneToSix.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBStepsOneToSix.lean index 70df28ae23..332f3e6ad0 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBStepsOneToSix.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBStepsOneToSix.lean @@ -27,4 +27,4 @@ The imported development contains: frozen-support safety, and facet-neighborhood inputs. -/ -@[expose] public section +public section diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBVectorFiberElimination.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBVectorFiberElimination.lean index 15d0dee6ca..860b2f90e8 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBVectorFiberElimination.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/RouteBVectorFiberElimination.lean @@ -32,7 +32,7 @@ vector-block geometry and coordinate transport are provided by the downstream construction. -/ -@[expose] public section +public section namespace NRR diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableCollarComparison.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableCollarComparison.lean index 8c7c0f72c1..cdec18bb0e 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableCollarComparison.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableCollarComparison.lean @@ -22,7 +22,7 @@ collar for arbitrary endpoint triangulations is deliberately separated as leaves both endpoint triangulations unchanged. -/ -@[expose] public section +public section namespace NRR @@ -90,6 +90,7 @@ end StableCollar /-- Proposition asserting that every pair of stable endpoint approximations admits a finite boundary-fixed generic collar. This is the relative-triangulation existence statement used with the finite Stokes theorem. -/ +@[expose] def StableCollarExistenceTheorem : Prop := ∀ {p : Nat} (hp : Nat.Prime p) (F₀ F₁ : ZeroFreeMap hp) diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableCollarExistenceAudit.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableCollarExistenceAudit.lean index 5dd13d9eab..fe50a3d839 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableCollarExistenceAudit.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableCollarExistenceAudit.lean @@ -29,7 +29,7 @@ prism complex with independent lower and upper triangulations, and a boundary ve affine theorem requiring only positive-ray skeleton transversality. -/ -@[expose] public section +public section namespace NRR diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableCollarRelativeSubdivision.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableCollarRelativeSubdivision.lean index d31b551b38..938dff6481 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableCollarRelativeSubdivision.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableCollarRelativeSubdivision.lean @@ -36,7 +36,7 @@ cells. The fixed horizontal boundaries require only the `PositiveRaySkeletonFre already carried by `StableRegularApproximation`. -/ -@[expose] public section +public section namespace NRR @@ -316,6 +316,7 @@ noncomputable def ofRelativeGeneric move hgeneric hhorizontal havoid /-- The actual compatible assignment represented by a geometric stable-collar certificate. -/ +@[expose] noncomputable def assignment {hp : Nat.Prime p} {F₀ F₁ : ZeroFreeMap hp} diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableCollarRelativeSubdivisionExact.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableCollarRelativeSubdivisionExact.lean index d338c66c2c..134706bcf4 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableCollarRelativeSubdivisionExact.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableCollarRelativeSubdivisionExact.lean @@ -22,7 +22,7 @@ No discontinuous endpoint-adjusted sampler and no unnecessary codimension-two de part of the certificate. -/ -@[expose] public section +public section namespace NRR @@ -172,6 +172,7 @@ noncomputable def toExactRelativeStableCollarData end ExactRelativeStableCollarGeneralPositionData /-- Existence proposition for the geometric construction. -/ +@[expose] def ExactRelativeStableCollarConstructionTheorem : Prop := ∀ {p : Nat} (hp : Nat.Prime p) (F₀ F₁ : ZeroFreeMap hp) diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableEndpointBridges.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableEndpointBridges.lean index 7ce35b69f5..42677d21c9 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableEndpointBridges.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableEndpointBridges.lean @@ -35,7 +35,7 @@ Thus every `StableRegularApproximation` canonically determines the `ZeroFreeEndpointInterpolant` required by the exact relative-collar interface. -/ -@[expose] public section +public section namespace NRR diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableExactRelativeCollarConstructionAffinePullback.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableExactRelativeCollarConstructionAffinePullback.lean index 2043a0796a..303c2e88e9 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableExactRelativeCollarConstructionAffinePullback.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableExactRelativeCollarConstructionAffinePullback.lean @@ -24,7 +24,7 @@ The construction uses the focused Route B API rather than repeating the perturba * inhabit `ExactRelativeStableCollarConstructionTheorem`. -/ -@[expose] public section +public section namespace NRR namespace FoxNeuwirthOrderComplex diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableFullCollarConstructionAffinePullback.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableFullCollarConstructionAffinePullback.lean index 415350274c..6b5fe58009 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableFullCollarConstructionAffinePullback.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableFullCollarConstructionAffinePullback.lean @@ -30,7 +30,7 @@ stacks are transported with `castEndpointCollar`; `castEndpoint_property` moves a collar together with its assignment across such a transport. -/ -@[expose] public section +public section namespace NRR namespace FoxNeuwirthOrderComplex @@ -66,6 +66,7 @@ section LevelTransport variable {hp : Nat.Prime p} /-- Transport an endpoint-identified collar along equalities of its two endpoint levels. -/ +@[expose] noncomputable def castEndpointCollar {N₀ N₀' N₁ N₁' M T : Nat} (h₀ : N₀ = N₀') (h₁ : N₁ = N₁') (C : EndpointIdentifiedRelativeAffineCollar hp N₀ N₁ M T) : @@ -134,6 +135,7 @@ theorem upper_boundary_represents_base_cast /-! ### The three collar regions -/ /-- Base level at which the PL-ended chart homotopy is defined. -/ +@[expose] def baseLevel {hp : Nat.Prime p} {F0 F1 : ZeroFreeMap hp} (A0 : StableRegularApproximation hp F0.map) @@ -210,6 +212,7 @@ theorem middleRefinement_avoidsOrigin (exists_refinement_avoidsOrigin hp (middleHomotopy hp F0 F1 H A0 A1)) /-- Lower endpoint stack, transported to the common middle level. -/ +@[expose] noncomputable def lowerCollar (hp : Nat.Prime p) {F0 F1 : ZeroFreeMap hp} @@ -227,6 +230,7 @@ noncomputable def lowerCollar (lowerStackIndex A1 L)).collar /-- Upper endpoint stack, reversed and transported from the common middle level. -/ +@[expose] noncomputable def upperCollar (hp : Nat.Prime p) {F0 F1 : ZeroFreeMap hp} @@ -245,6 +249,7 @@ noncomputable def upperCollar (upperStackIndex A0 L)).collar) /-- The transported lower stack assignment. -/ +@[expose] noncomputable def lowerAssignment (hp : Nat.Prime p) {F0 F1 : ZeroFreeMap hp} @@ -258,6 +263,7 @@ noncomputable def lowerAssignment (build hp A0.toRegularApproximation (lowerStackIndex A1 L)).assignment /-- The transported reversed upper stack assignment. -/ +@[expose] noncomputable def upperAssignment (hp : Nat.Prime p) {F0 F1 : ZeroFreeMap hp} @@ -422,6 +428,7 @@ theorem lowerSeam (middle_represents_lower hp F0 F1 H A0 A1 L) /-- The lower stack composed with the middle prism. -/ +@[expose] noncomputable def lowerMiddleCollar (hp : Nat.Prime p) {F0 F1 : ZeroFreeMap hp} @@ -441,6 +448,7 @@ noncomputable def lowerMiddleCollar (middleCollar hp A0 A1 L) /-- The assignment of the lower two regions. -/ +@[expose] noncomputable def lowerMiddleAssignment (hp : Nat.Prime p) (F0 F1 : ZeroFreeMap hp) @@ -506,6 +514,7 @@ theorem upperDescribed_upperFacet_exhaustive (upperCollar hp A0 A1 L).upperFacet_exhaustive /-- The complete three-region collar. -/ +@[expose] noncomputable def fullCollar (hp : Nat.Prime p) {F0 F1 : ZeroFreeMap hp} @@ -532,6 +541,7 @@ noncomputable def fullCollar (upperDescribed_upperFacet_exhaustive hp A0 A1 L) /-- The complete three-region assignment. -/ +@[expose] noncomputable def fullAssignment (hp : Nat.Prime p) (F0 F1 : ZeroFreeMap hp) @@ -721,6 +731,7 @@ theorem full_upperFixed (upper_upperFixed hp A0 A1 L) /-- Concrete full fine-collar data. -/ +@[expose] noncomputable def fineFullCollarData (hp : Nat.Prime p) (F0 F1 : ZeroFreeMap hp) diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableFullCollarOriginMargin.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableFullCollarOriginMargin.lean index e54737ff56..a8721417a2 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableFullCollarOriginMargin.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableFullCollarOriginMargin.lean @@ -23,7 +23,7 @@ the lower and upper subdivision stacks together with the controlled middle prism this file are theorem-level consequences of that data. -/ -@[expose] public section +public section namespace NRR @@ -72,6 +72,7 @@ structure FineFullCollarData /-- Item 4, expressed as the exact construction proposition still required from the endpoint-stack geometry. This is a named target, not an assumed theorem and not a field of the final AAK result. -/ +@[expose] def FineFullCollarConstructionTheorem : Prop := ∀ {p : Nat} (hp : Nat.Prime p) (F₀ F₁ : ZeroFreeMap hp) @@ -98,6 +99,7 @@ namespace FullCollarOriginMarginData /-- Every finite full-collar assignment which avoids the origin cellwise has a single positive coordinate margin valid on all cells. -/ +@[expose] noncomputable def ofFineFullCollarData {hp : Nat.Prime p} {F₀ F₁ : ZeroFreeMap hp} diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableFullCollarOriginMarginAffinePullback.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableFullCollarOriginMarginAffinePullback.lean index 34cd84547b..9f41215ba0 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableFullCollarOriginMarginAffinePullback.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableFullCollarOriginMarginAffinePullback.lean @@ -16,7 +16,7 @@ This file instantiates the generic compactness theorem of `StableFullCollarConstructionAffinePullback`. -/ -@[expose] public section +public section namespace NRR namespace FoxNeuwirthOrderComplex @@ -32,6 +32,7 @@ variable {p : Nat} /-- Concrete quantitative origin-margin data attached to the affine-pullback full collar. -/ +@[expose] noncomputable def fullCollarOriginMarginDataAffinePullback (hp : Nat.Prime p) (F₀ F₁ : ZeroFreeMap hp) diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableFullCollarRelativeMesh.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableFullCollarRelativeMesh.lean index 23a0c61663..88996daa9d 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableFullCollarRelativeMesh.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableFullCollarRelativeMesh.lean @@ -31,7 +31,7 @@ the stated patched-sample representation. No overlap or seam assumption is hidden in the adapter. -/ -@[expose] public section +public section namespace NRR diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableFullCollarRouteB.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableFullCollarRouteB.lean index 845443a1d7..dcaaeef96a 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableFullCollarRouteB.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableFullCollarRouteB.lean @@ -23,7 +23,7 @@ The latter is converted internally into a genuine positive-radius facet-regular `RouteB.exists_safePerturbationBall`. -/ -@[expose] public section +public section namespace NRR diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableFullCollarRouteBComplete.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableFullCollarRouteBComplete.lean index 94aaf5be80..5db4d6c057 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableFullCollarRouteBComplete.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableFullCollarRouteBComplete.lean @@ -23,7 +23,7 @@ theorem then produces a small, frozen-boundary-preserving, prime-equivariant per positive-ray general position while retaining half of the Step 5 origin margin. -/ -@[expose] public section +public section namespace NRR namespace FoxNeuwirthOrderComplex diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableFullCollarRouteBFacetGeometry.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableFullCollarRouteBFacetGeometry.lean index f63695cbeb..6e9c379a16 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableFullCollarRouteBFacetGeometry.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableFullCollarRouteBFacetGeometry.lean @@ -17,7 +17,7 @@ so universal triangular targets suffice there. The two composition steps theref frozen-relative targets for every final cell and facet. -/ -@[expose] public section +public section namespace NRR namespace FoxNeuwirthOrderComplex diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableFullCollarRouteBGeometry.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableFullCollarRouteBGeometry.lean index 3460d996dc..76fbc32666 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableFullCollarRouteBGeometry.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableFullCollarRouteBGeometry.lean @@ -19,7 +19,7 @@ safe. The final half-cylinder composition therefore satisfies Route B's exact f condition. -/ -@[expose] public section +public section namespace NRR namespace FoxNeuwirthOrderComplex diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableFullCollarRouteBInstantiation.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableFullCollarRouteBInstantiation.lean index 028dc67584..5cb424d1c7 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableFullCollarRouteBInstantiation.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableFullCollarRouteBInstantiation.lean @@ -24,7 +24,7 @@ needed by downstream collar/Stokes constructions: origin avoidance, and full positive-ray general position. -/ -@[expose] public section +public section namespace NRR namespace FoxNeuwirthOrderComplex @@ -66,6 +66,7 @@ noncomputable def routeBPerturbation /-- The full collar assignment obtained by replacing exactly the movable parameters with the selected Route B perturbation. -/ +@[expose] noncomputable def perturbedAssignment (hp : Nat.Prime p) (F0 F1 : ZeroFreeMap hp) diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableHomotopyInvarianceAffinePullback.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableHomotopyInvarianceAffinePullback.lean index 5c92f48092..88cc9761db 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableHomotopyInvarianceAffinePullback.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableHomotopyInvarianceAffinePullback.lean @@ -17,7 +17,7 @@ zero-free equivariant homotopy. The pointwise equality is then packaged into th `StableHomotopyInvarianceTheorem` interface. -/ -@[expose] public section +public section namespace NRR namespace FoxNeuwirthOrderComplex diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableObstructionCount.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableObstructionCount.lean index 5b4719c9f4..13363030a7 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableObstructionCount.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StableObstructionCount.lean @@ -24,7 +24,7 @@ nonzero orbit count. This obligation is strictly smaller than, and does not imp homotopy-invariance proposition. -/ -@[expose] public section +public section namespace NRR diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StablePatchedHomotopyBoundary.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StablePatchedHomotopyBoundary.lean index 625ade725c..1faf19cff4 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StablePatchedHomotopyBoundary.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StablePatchedHomotopyBoundary.lean @@ -21,7 +21,7 @@ actual value of the continuous patched homotopy; this follows from endpoint iden prime equivariance, and the refined-vertex interpolation theorem. -/ -@[expose] public section +public section namespace NRR diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StablePatchedHomotopyFineMargin.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StablePatchedHomotopyFineMargin.lean index 68ad7d28d2..a00560b375 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StablePatchedHomotopyFineMargin.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/StablePatchedHomotopyFineMargin.lean @@ -28,7 +28,7 @@ The lower and upper relative subdivision stacks require their separate endpoint- that assembly is intentionally not hidden in the middle-prism theorem below. -/ -@[expose] public section +public section namespace NRR diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/Strata.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/Strata.lean index b7881f9f8c..8607b7dfec 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/Strata.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/Strata.lean @@ -16,7 +16,7 @@ Labels in one block have equal first coordinate and occur in the recorded vertic in different blocks occur in the recorded left-to-right order. -/ -@[expose] public section +public section namespace NRR diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/SubdivisionCharts.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/SubdivisionCharts.lean index 5d13f911f4..ba35397b21 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/SubdivisionCharts.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/SubdivisionCharts.lean @@ -23,7 +23,7 @@ global barycentric carrier. Precomposing this chart with an iterated affine sub the refined simplex charts used in the S6 approximation theorem. -/ -@[expose] public section +public section namespace NRR @@ -39,11 +39,12 @@ namespace StandardSimplex /-- The project standard simplex and Mathlib's topological standard simplex have the same coordinate predicate. -/ +@[expose] def toDelta (w : StandardSimplex d) : Delta d := ⟨w.1, w.2⟩ /-- Conversion back from the topological standard simplex. -/ -def ofDelta (w : Delta d) : StandardSimplex d := +@[expose] def ofDelta (w : Delta d) : StandardSimplex d := ⟨w.1, w.2⟩ @[simp] theorem ofDelta_toDelta (w : StandardSimplex d) : ofDelta (toDelta w) = w := rfl @@ -61,7 +62,7 @@ end StandardSimplex namespace Simplex /-- Coordinate weight of a point in the affine chart of a strict chain. -/ -noncomputable def chartWeight +@[expose] noncomputable def chartWeight (s : Simplex p d) (w : StandardSimplex d) (c : BarredPermutation p) : Real := ∑ i : Fin (d + 1), if s i = c then w i else 0 @@ -77,6 +78,7 @@ theorem exists_vertex_of_chartWeight_ne_zero simp [chartWeight, hnone] /-- Affine chart of an order-complex simplex into the global barycentric realization. -/ +@[expose] noncomputable def realizationPoint (s : Simplex p d) (w : StandardSimplex d) : Realization p := ⟨s.chartWeight w, by @@ -158,6 +160,7 @@ theorem continuous_realizationPoint (s : Simplex p d) : Continuous (fun _ : StandardSimplex d => (0 : Real))) /-- Bundled continuous simplex chart. -/ +@[expose] noncomputable def realizationContinuousMap (s : Simplex p d) : C(Delta d, Realization p) where toFun w := s.realizationPoint (StandardSimplex.ofDelta w) @@ -176,6 +179,7 @@ variable (s : Simplex p (p - 1)) /-- Convert a label permutation to the simplex-index permutation. For `p = 0`, the source permutation is vacuous and the target is the identity. -/ +@[expose] noncomputable def refinementIndexPerm (sigma : Equiv.Perm (Fin p)) : Equiv.Perm (Fin (p - 1 + 1)) := by by_cases hp0 : 0 < p @@ -186,6 +190,7 @@ noncomputable def refinementIndexPerm (sigma : Equiv.Perm (Fin p)) : /-- Refined chart obtained by precomposing a maximal-chain chart with an iterated affine barycentric subdivision map. -/ +@[expose] noncomputable def refinedContinuousMap (N : Nat) (rho : RefinementWord p N) : C(Delta (p - 1), Realization p) := s.realizationContinuousMap.comp @@ -193,12 +198,14 @@ noncomputable def refinedContinuousMap (fun k => refinementIndexPerm (rho k))) /-- Pointwise form of a refined chart. -/ +@[expose] noncomputable def refinedPoint (N : Nat) (rho : RefinementWord p N) (w : StandardSimplex (p - 1)) : Realization p := s.refinedContinuousMap N rho (StandardSimplex.toDelta w) /-- Vertices of a refined simplex. -/ +@[expose] noncomputable def refinedVertex (N : Nat) (rho : RefinementWord p N) (i : Fin p) : Realization p := by have hp0 : 0 < p := Nat.pos_of_ne_zero (by intro h; subst p; exact Fin.elim0 i) diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/SubdivisionPrismAffine.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/SubdivisionPrismAffine.lean index c195ebfbb2..e5b15d2de5 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/SubdivisionPrismAffine.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/SubdivisionPrismAffine.lean @@ -21,7 +21,7 @@ These formulas are used by the concrete common-level middle-prism constructor fo relative collar. -/ -@[expose] public section +public section namespace NRR @@ -93,6 +93,7 @@ noncomputable def maximalCoordinateReindexLinear /-- One coordinate of the realization chart of a strict simplex, as a linear functional of its barycentric coordinates. -/ +@[expose] noncomputable def realizationCoordinateLinear (s : Simplex p (p - 1)) (c : BarredPermutation p) : (Fin (p - 1 + 1) → Real) →ₗ[Real] Real where diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/SubdivisionPrismCharts.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/SubdivisionPrismCharts.lean index dfaba152f7..8d5b497d01 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/SubdivisionPrismCharts.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/SubdivisionPrismCharts.lean @@ -17,7 +17,7 @@ For a refined `(p-1)`-simplex, its product with the unit interval is triangulate barycentric refinement. These charts are the finite domain on which the S6 PL homotopy is sampled. -/ -@[expose] public section +public section namespace NRR @@ -31,11 +31,13 @@ namespace SubdivisionPrismCharts variable {p : Nat} /-- The interval coordinate attached to a staircase vertex. -/ +@[expose] def staircaseTime (k : Fin p) (j : Fin (p + 1)) : Fin 2 := if j.1 ≤ k.1 then 0 else 1 /-- Spatial vertex attached to a staircase vertex. Vertices `k` and `k+1` project to the same spatial vertex and lie at the two interval endpoints. -/ +@[expose] def staircaseSpatial (p : Nat) (k : Fin p) (j : Fin (p + 1)) : Fin p := if h : j.1 ≤ k.1 then ⟨j.1, lt_of_le_of_lt h k.2⟩ @@ -54,18 +56,20 @@ def staircaseSpatial (p : Nat) (k : Fin p) (j : Fin (p + 1)) : Fin p := staircaseTime k j = 1 := by simp [staircaseTime, Nat.not_le.mpr h] /-- Spatial barycentric coordinate induced by one staircase simplex. -/ -noncomputable def spatialWeight +@[expose] noncomputable def spatialWeight (hp : Nat.Prime p) (k : Fin p) (w : StandardSimplex p) (i : Fin (p - 1 + 1)) : Real := ∑ j : Fin (p + 1), if Fin.cast (Nat.sub_add_cancel hp.pos).symm (staircaseSpatial p k j) = i then w j else 0 /-- The staircase interval coordinate. -/ +@[expose] noncomputable def intervalWeight (k : Fin p) (w : StandardSimplex p) : Real := ∑ j : Fin (p + 1), if staircaseTime k j = 1 then w j else 0 /-- The spatial weights form a standard `(p-1)`-simplex. -/ +@[expose] noncomputable def spatialPoint (hp : Nat.Prime p) (k : Fin p) (w : StandardSimplex p) : StandardSimplex (p - 1) := @@ -81,6 +85,7 @@ noncomputable def spatialPoint simp [w.sum_eq_one]⟩ /-- The interval weight lies in the unit interval. -/ +@[expose] noncomputable def intervalPoint (k : Fin p) (w : StandardSimplex p) : Set.Icc (0 : Real) 1 := ⟨intervalWeight k w, by @@ -100,6 +105,7 @@ noncomputable def intervalPoint _ = 1 := w.sum_eq_one⟩ /-- One staircase chart from the `p`-simplex to `Δ^(p-1) × I`. -/ +@[expose] noncomputable def staircasePoint (hp : Nat.Prime p) (k : Fin p) (w : StandardSimplex p) : StandardSimplex (p - 1) × Set.Icc (0 : Real) 1 := @@ -123,6 +129,7 @@ noncomputable instance (hp : Nat.Prime p) (N L : Nat) : DecidableEq (PrismCell h inferInstance /-- Refined prism chart into the realization cylinder. -/ +@[expose] noncomputable def chart (hp : Nat.Prime p) (N L : Nat) (q : PrismCell hp N L) : C(Delta p, Realization p × Set.Icc (0 : Real) 1) where @@ -169,15 +176,18 @@ noncomputable def chart · exact hinterval /-- Vertices of a refined prism cell. -/ +@[expose] noncomputable def vertex (hp : Nat.Prime p) (N L : Nat) (q : PrismCell hp N L) (i : Fin (p + 1)) : Realization p × Set.Icc (0 : Real) 1 := chart hp N L q (SphereOddDegree.FiniteSimplex.vertex (S := Real) i) /-- Orientation sign of a staircase simplex. -/ +@[expose] noncomputable def staircaseSign (k : Fin p) : Int := (-1 : Int) ^ k.1 /-- Orientation sign of a fully refined prism simplex. -/ +@[expose] noncomputable def prismSign {hp : Nat.Prime p} (q : PrismCell hp N L) : Int := staircaseSign q.1.2 * (∏ r : Fin L, (Equiv.Perm.sign (q.2 r) : Int)) diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/SubdivisionZeroFreeApproximation.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/SubdivisionZeroFreeApproximation.lean index 034071414b..2e0c82ce67 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/SubdivisionZeroFreeApproximation.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/SubdivisionZeroFreeApproximation.lean @@ -27,7 +27,7 @@ The perturbation direction is a single global continuous map. Consequently valu shared refined face and prime-symmetry equivariance is preserved. -/ -@[expose] public section +public section namespace NRR @@ -204,7 +204,7 @@ structure RegularApproximation namespace RegularApproximation /-- Positive orbit count represented by a regular refined approximation. -/ -noncomputable def zeroCount +@[expose] noncomputable def zeroCount {hp : Nat.Prime p} {F : ContinuousCoordinateMap p} (A : RegularApproximation hp F) : ZMod p := RefinedAffineMap.zeroCount hp A.level A.map diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/TopCellModel.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/TopCellModel.lean index 2b4c8ed11f..fb55209640 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/TopCellModel.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/TopCellModel.lean @@ -26,7 +26,7 @@ the finite model. The oriented mod-`p` cycle obtained by gluing boundary faces i the chain modules. -/ -@[expose] public section +public section namespace NRR @@ -40,6 +40,7 @@ abbrev FoxNeuwirthTopCell (p : ℕ) := BarredPermutation.TopCell p namespace FoxNeuwirthTopCell /-- The identity order with no bars. -/ +@[expose] def identity (p : ℕ) : FoxNeuwirthTopCell p := ⟨⟨1, ∅⟩, rfl⟩ @@ -52,6 +53,7 @@ noncomputable instance : MetricSpace (FoxNeuwirthTopCell p) := inferInstance /-- Relabelling preserves the one-block condition. -/ +@[expose] def relabel (σ : Equiv.Perm (Fin p)) (c : FoxNeuwirthTopCell p) : FoxNeuwirthTopCell p := ⟨c.1.relabel σ, by simpa using c.2⟩ @@ -82,6 +84,7 @@ theorem relabel_mul end FoxNeuwirthTopCell /-- Barycentric coordinates on a top-dimensional Fox--Neuwirth cell. -/ +@[expose] def FoxNeuwirthWeights (p : ℕ) := ↥(SphereOddDegree.finiteSimplex ℝ (Fin p)) @@ -102,6 +105,7 @@ instance : CoeFun (FoxNeuwirthWeights p) (fun _ => Fin p → ℝ) := w.2.2 /-- Relabel barycentric coordinates by the established `σ.symm` convention. -/ +@[expose] def relabel (σ : Equiv.Perm (Fin p)) (w : FoxNeuwirthWeights p) : FoxNeuwirthWeights p := ⟨fun i => w (σ.symm i), by @@ -154,6 +158,7 @@ theorem continuous_relabel (σ : Equiv.Perm (Fin p)) : end FoxNeuwirthWeights /-- Concrete finite polyhedron used as the prime configuration model. -/ +@[expose] def FoxNeuwirthTopCellModelPoint (p : ℕ) := FoxNeuwirthTopCell p × FoxNeuwirthWeights p @@ -216,6 +221,7 @@ theorem site_injective (z : FoxNeuwirthTopCellModelPoint p) : exact_mod_cast hy /-- Embedded labelled configuration. -/ +@[expose] noncomputable def toConfig (z : FoxNeuwirthTopCellModelPoint p) : Config p := ⟨z.site, z.site_injective⟩ @@ -259,6 +265,7 @@ theorem continuous_toConfig : ((c.1.rank i).1 : ℝ)).comp continuous_fst) /-- Equivariant reference map: first-coordinate vector with its diagonal part removed. -/ +@[expose] noncomputable def reference (hp : Nat.Prime p) (z : FoxNeuwirthTopCellModelPoint p) : ZeroSum p := diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/TopCells.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/TopCells.lean index 31e5f0e4eb..725c804d02 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/TopCells.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/TopCells.lean @@ -16,7 +16,7 @@ canonically equivalent to the full permutation group. The prime symmetry action restriction of relabelling on this permutation torsor. -/ -@[expose] public section +public section namespace NRR @@ -25,11 +25,13 @@ variable {p : ℕ} namespace BarredPermutation /-- Top-dimensional dual Fox--Neuwirth symbols. -/ +@[expose] def TopCell (p : ℕ) := {c : BarredPermutation p // c.IsTop} namespace TopCell /-- A permutation determines the unique top symbol with that vertical order. -/ +@[expose] def ofPerm (σ : Equiv.Perm (Fin p)) : TopCell p := ⟨⟨σ, ∅⟩, rfl⟩ @@ -42,6 +44,7 @@ def ofPerm (σ : Equiv.Perm (Fin p)) : TopCell p := rfl /-- Top symbols are canonically the permutation torsor. -/ +@[expose] def equivPerm : TopCell p ≃ Equiv.Perm (Fin p) where toFun c := c.1.rank invFun := ofPerm diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/TopFlagSubdivision.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/TopFlagSubdivision.lean index bbd0182403..074bb8f870 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/TopFlagSubdivision.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/TopFlagSubdivision.lean @@ -30,7 +30,7 @@ The local boundary theorem is rank-two internal cancellation. It is isolated be explicit finite statement about the actual chain, rather than hidden in a geometric certificate. -/ -@[expose] public section +public section namespace NRR @@ -42,6 +42,7 @@ namespace FoxNeuwirthOrderComplex namespace TopFlagSubdivision /-- Integer indicator of a bar position. -/ +@[expose] def barIndicator (c : BarredPermutation p) (r : Fin (p - 1)) : Int := if r ∈ c.bars then 1 else 0 @@ -56,12 +57,13 @@ def barIndicator (c : BarredPermutation p) (r : Fin (p - 1)) : Int := simp [barIndicator, hr] /-- Matrix of successive bar-removal vectors along a maximal strict flag. -/ +@[expose] def barDifferenceMatrix (s : Simplex p (p - 1)) : Matrix (Fin (p - 1)) (Fin (p - 1)) Int := fun r k => barIndicator (s k.castSucc) r - barIndicator (s k.succ) r /-- Orientation of the order in which bars disappear along a maximal flag. -/ -def barRemovalDeterminant (s : Simplex p (p - 1)) : Int := +@[expose] def barRemovalDeterminant (s : Simplex p (p - 1)) : Int := Matrix.det (barDifferenceMatrix s) /-- Canonical permutation orientation of a Fox--Neuwirth cell. @@ -69,15 +71,15 @@ def barRemovalDeterminant (s : Simplex p (p - 1)) : Int := This is the Mathlib permutation sign of the displayed rank. It is the same parity orientation used by `BarredPermutation.orientationSign`, but using the library sign directly avoids carrying a second inversion-parity implementation into the subdivision determinant calculation. -/ -def permutationOrientationSign (c : BarredPermutation p) : Int := +@[expose] def permutationOrientationSign (c : BarredPermutation p) : Int := ((Equiv.Perm.sign c.rank : ℤˣ) : ℤ) /-- Integral coefficient of a maximal flag in the subdivision chain. -/ -def integralCoefficient (s : Simplex p (p - 1)) : Int := +@[expose] def integralCoefficient (s : Simplex p (p - 1)) : Int := permutationOrientationSign (s 0) * barRemovalDeterminant s /-- The concrete top-flag subdivision chain over `ZMod p`. -/ -def chain : SimplicialChain (ZMod p) p (p - 1) := +@[expose] def chain : SimplicialChain (ZMod p) p (p - 1) := fun s => (integralCoefficient s : ZMod p) @[simp] theorem chain_apply (s : Simplex p (p - 1)) : @@ -85,6 +87,7 @@ def chain : SimplicialChain (ZMod p) p (p - 1) := rfl /-- The actual simplicial boundary of the top-flag subdivision chain. -/ +@[expose] noncomputable def boundary (hp : Nat.Prime p) : SimplicialChain (ZMod p) p (p - 2) := by have hdim : p - 1 = (p - 2) + 1 := by @@ -93,7 +96,7 @@ noncomputable def boundary (hp : Nat.Prime p) : exact SimplicialChain.boundary (d := p - 2) (hdim ▸ chain) /-- Contribution obtained by deleting one fixed position from a maximal flag. -/ -noncomputable def deletionCoefficient +@[expose] noncomputable def deletionCoefficient (hp : Nat.Prime p) (target : Simplex p (p - 2)) (k : Fin ((p - 2) + 2)) : ZMod p := by @@ -113,11 +116,13 @@ theorem boundary_apply_eq_sum_deletionCoefficient rw [Finset.sum_comm] /-- Internal deletion positions, including deletion of the bottom vertex, cancel locally. -/ +@[expose] def InternalCancellation (hp : Nat.Prime p) : Prop := ∀ (target : Simplex p (p - 2)) (k : Fin ((p - 2) + 2)), k.1 < p - 1 → deletionCoefficient hp target k = 0 /-- The terminal deletion removes the final top-dimensional cell. -/ +@[expose] def TerminalCancellation (hp : Nat.Prime p) : Prop := ∀ (target : Simplex p (p - 2)) (k : Fin ((p - 2) + 2)), k.1 = p - 1 → deletionCoefficient hp target k = 0 @@ -178,11 +183,13 @@ theorem integralCoefficient_eq_of_init_eq_of_final_top /-- The exact internal combinatorics: every nonterminal deleted face has total signed extension coefficient zero. This is a finite rank-two interval statement for ordered partitions. -/ +@[expose] def RankTwoCancellationTheorem : Prop := ∀ {p : Nat} (hp : Nat.Prime p), InternalCancellation hp /-- The exact terminal reindexing statement. The coefficient independence theorem above reduces this to the already proved facet--shuffle multiplicity. -/ +@[expose] def TerminalMultiplicityTheorem : Prop := ∀ {p : Nat} (hp : Nat.Prime p), TerminalCancellation hp diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/TopFlagTerminalCancellation.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/TopFlagTerminalCancellation.lean index e677797914..6e0db1b988 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/TopFlagTerminalCancellation.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/TopFlagTerminalCancellation.lean @@ -21,7 +21,7 @@ The proof is deliberately separated from the internal rank-two cancellation. No of rank-two intervals is used here. -/ -@[expose] public section +public section namespace NRR @@ -117,6 +117,7 @@ theorem maximal_last_dualDimension · simpa using Simplex.index_le_dualDimension s (Fin.last (p - 1)) /-- The terminal deletion index in the arithmetic presentation used by `deletionCoefficient`. -/ +@[expose] def terminalIndex (hp : Nat.Prime p) : Fin ((p - 2) + 2) := ⟨p - 1, by have := hp.two_le @@ -135,6 +136,7 @@ theorem terminalIndex_eq_last (hp : Nat.Prime p) : omega /-- Maximal flags whose terminal face is a fixed codimension-one flag. -/ +@[expose] def TerminalSource (hp : Nat.Prime p) (target : Simplex p (p - 2)) := {source : Simplex p ((p - 2) + 1) // source.restrict (FaceMap.delete (terminalIndex hp)) = target} diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/TopIncidenceComplex.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/TopIncidenceComplex.lean index 95490fcc07..12e8f8e3b9 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/TopIncidenceComplex.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimePolyhedron/FoxNeuwirth/TopIncidenceComplex.lean @@ -21,7 +21,7 @@ Fox--Neuwirth incidences. The nontrivial statement is that the oriented top cha kernel of the genuine top-to-facet incidence map; this is supplied by the facet--shuffle theorem. -/ -@[expose] public section +public section namespace NRR @@ -42,12 +42,14 @@ abbrev FacetChain (p : Nat) (R : Type*) := BarredPermutation p → R /-- The genuine top-to-facet incidence map. -/ +@[expose] noncomputable def topIncidenceBoundary (chain : TopCellChain p R) : FacetChain p R := fun a => ∑ c : BarredPermutation.TopCell p, (signedIncidence a (c : BarredPermutation p) : R) * chain c /-- The next differential in the minimal two-term obstruction complex. -/ +@[expose] def zeroFacetBoundary (_chain : FacetChain p R) : PUnit.{0} → R := fun _ => 0 @@ -66,6 +68,7 @@ theorem zeroFacetBoundary_comp_topIncidenceBoundary rfl /-- The oriented sum of all top cells. -/ +@[expose] noncomputable def orientedTopChain (p : Nat) : TopCellChain p (ZMod p) := fun c => orientedTopCoefficient (c : BarredPermutation p) diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimeRefinement.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimeRefinement.lean index 93e8d3a6ab..55dd35be5e 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimeRefinement.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimeRefinement.lean @@ -21,4 +21,4 @@ This aggregator exposes the exact separator contract and the fully proved conver separator certificate to the next nice multivalued function and its canonical partition witness. -/ -@[expose] public section +public section diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimeRefinement/Core.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimeRefinement/Core.lean index 28a43dd311..4b8aaec802 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimeRefinement/Core.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimeRefinement/Core.lean @@ -17,7 +17,7 @@ public import LeanPool.NandakumarRamanaRao.NRR.PrimePolyhedron.FoxNeuwirth This file derives the functional prime-refinement consequences from that proposition. -/ -@[expose] public section +public section namespace NRR diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimeRefinement/FlexibleCore.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimeRefinement/FlexibleCore.lean index 96f7ea8b25..5f9daa6652 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimeRefinement/FlexibleCore.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimeRefinement/FlexibleCore.lean @@ -16,7 +16,7 @@ The recursive partition construction uses only that model's site family and the property, independently of a particular top-cell atlas. -/ -@[expose] public section +public section namespace NRR @@ -36,6 +36,7 @@ structure FlexiblePrimeRefinementStep certificate : PrimeRefinementSeparator model hA phi /-- Model-independent prime-refinement theorem. -/ +@[expose] def FlexiblePrimeRefinementTheorem : Prop := ∀ (p : Nat) (hp : Nat.Prime p) (K : Geometry.ConvexBody Plane) (A : Real) (hA : 0 < A) diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimeRefinement/FlexibleIteration.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimeRefinement/FlexibleIteration.lean index 5378e47c16..5078607e38 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimeRefinement/FlexibleIteration.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimeRefinement/FlexibleIteration.lean @@ -14,7 +14,7 @@ The shared iteration and partition assembly live in `Iteration`. This module ret model-independent public implication interface used by the obstruction proof. -/ -@[expose] public section +public section open MeasureTheory diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimeRefinement/IndexedPartition.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimeRefinement/IndexedPartition.lean index a6308a68d7..0a3948f049 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimeRefinement/IndexedPartition.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimeRefinement/IndexedPartition.lean @@ -16,7 +16,7 @@ an index-polymorphic version of `ConvexPartition` and a canonical conversion bac `Fin n`-indexed structure. -/ -@[expose] public section +public section open MeasureTheory @@ -38,10 +38,12 @@ namespace IndexedConvexPartition variable {K L : Body} {ι κ : Type*} /-- All indexed pieces have equal area. -/ +@[expose] def IsEqualArea (P : IndexedConvexPartition K ι) : Prop := ∀ i j, (P.piece i).area = (P.piece j).area /-- All indexed pieces have equal perimeter. -/ +@[expose] def HasEqualPerimeter (P : IndexedConvexPartition K ι) : Prop := ∀ i j, (P.piece i).perimeter = (P.piece j).perimeter @@ -54,6 +56,7 @@ def ofConvexPartition {n : ℕ} (P : ConvexPartition K n) : nullOverlap := P.nullOverlap /-- The singleton indexed partition. -/ +@[expose] noncomputable def singleton (K : Body) : IndexedConvexPartition K Unit where piece := fun _ => K subset := fun _ => subset_rfl diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimeRefinement/Iteration.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimeRefinement/Iteration.lean index edf646c06d..19a252a281 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimeRefinement/Iteration.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimeRefinement/Iteration.lean @@ -19,7 +19,7 @@ It flattens the resulting nested power partitions and derives the arbitrary-numb theorem. The fixed Fox--Neuwirth interface specializes that same construction. -/ -@[expose] public section +public section open MeasureTheory @@ -35,6 +35,7 @@ def primeFactorProduct (ps : List PrimeFactor) : ℕ := (ps.map Subtype.val).prod /-- The nested finite index type generated by successive prime refinements. -/ +@[expose] def PrimeRefinementIndex : List PrimeFactor → Type | [] => Unit | p :: ps => Fin p.1 × PrimeRefinementIndex ps diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimeRefinement/ProjectedZeroSet.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimeRefinement/ProjectedZeroSet.lean index 2d66f846e6..9024ac8bf0 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimeRefinement/ProjectedZeroSet.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimeRefinement/ProjectedZeroSet.lean @@ -20,7 +20,7 @@ construction. The cobordism theorem establishes the required lower and upper reg complement. -/ -@[expose] public section +public section namespace NRR @@ -32,6 +32,7 @@ variable {K : Geometry.ConvexBody Plane} {A : ℝ} namespace PrimeConfigurationModel /-- Projection of the simultaneous child-zero locus to the parent-body/parameter cylinder. -/ +@[expose] def projectedAllChildrenZeroSet (M : PrimeConfigurationModel hp) (hA : 0 < A) diff --git a/LeanPool/NandakumarRamanaRao/NRR/PrimeRefinement/SeparatorCertificate.lean b/LeanPool/NandakumarRamanaRao/NRR/PrimeRefinement/SeparatorCertificate.lean index 97f9479414..05b0d8ce6c 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/PrimeRefinement/SeparatorCertificate.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/PrimeRefinement/SeparatorCertificate.lean @@ -24,7 +24,7 @@ prime-refinement theorem that constructs such a certificate. Once a certificate conversion to a new nice multivalued function is formal and is proved here directly. -/ -@[expose] public section +public section namespace NRR diff --git a/LeanPool/NandakumarRamanaRao/NRR/Representation.lean b/LeanPool/NandakumarRamanaRao/NRR/Representation.lean index 1d39522f48..98c1161a5e 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Representation.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Representation.lean @@ -10,4 +10,4 @@ public import LeanPool.NandakumarRamanaRao.NRR.Representation.ZeroSum /-! Supporting modules for Equal-area and equal-perimeter convex partitions. -/ -@[expose] public section +public section diff --git a/LeanPool/NandakumarRamanaRao/NRR/Representation/ZeroSum.lean b/LeanPool/NandakumarRamanaRao/NRR/Representation/ZeroSum.lean index 156162e47a..874972f319 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Representation/ZeroSum.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Representation/ZeroSum.lean @@ -23,7 +23,7 @@ obstruction theory, or quotient spaces, and it does not make `AddCommGroup`/`Mod structure mandatory. -/ -@[expose] public section +public section namespace NRR @@ -31,6 +31,7 @@ variable {n : ℕ} /-- **Zero-sum real-valued target type.** A function `Fin n → ℝ` whose coordinates sum to zero. -/ +@[expose] def ZeroSum (n : ℕ) : Type := {v : Fin n → ℝ // ∑ i, v i = 0} @@ -69,6 +70,7 @@ def ZeroSum.mk' (v : Fin n → ℝ) (hv : ∑ i, v i = 0) : ZeroSum n := zero-sum vector `v : ZeroSum n`, the relabelled vector `ZeroSum.relabel σ v` is obtained by precomposing the underlying function with `σ.symm`, i.e. `(ZeroSum.relabel σ v) i = v (σ.symm i)`. This `σ.symm` convention matches `Config.relabel`. -/ +@[expose] def ZeroSum.relabel (σ : Equiv.Perm (Fin n)) (v : ZeroSum n) : ZeroSum n := { val := fun i => v (σ.symm i) property := by @@ -88,8 +90,8 @@ theorem ZeroSum.relabel_mul (σ τ : Equiv.Perm (Fin n)) (v : ZeroSum n) : ZeroSum.relabel σ (ZeroSum.relabel τ v) := by apply ZeroSum.ext intro i - simp [ZeroSum.relabel_apply] - rfl + simp only [ZeroSum.relabel_apply, ← Equiv.Perm.inv_def, mul_inv_rev, + Equiv.Perm.mul_apply] /-- The `Sₙ`-action `σ • v := ZeroSum.relabel σ v` on the zero-sum target type, by relabelling via precomposition with `σ.symm` (matching the `Config` action convention). -/ diff --git a/LeanPool/NandakumarRamanaRao/NRR/SupportFunction.lean b/LeanPool/NandakumarRamanaRao/NRR/SupportFunction.lean index b93b3d818e..9216a14657 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/SupportFunction.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/SupportFunction.lean @@ -22,17 +22,19 @@ This compatibility module re-exports the implemented convex-body support functio stable public names. All substantive proofs live under `NRR.Geometry.ConvexBody`. -/ -@[expose] public section +public section open scoped RealInnerProductSpace namespace NRR.Geometry.ConvexBody /-- **Support function** (compatibility alias). `supportFn K u = h_K(u) = ⨆ x ∈ K, ⟪x, u⟫`. -/ +@[expose] noncomputable def supportFn (K : ConvexBody Plane) (u : Plane) : ℝ := supportFunction K u /-- **Width** (compatibility alias). `width K u = w_K(u) = h_K(u) + h_K(-u)`. -/ +@[expose] noncomputable def width (K : ConvexBody Plane) (u : Plane) : ℝ := widthFunction K u diff --git a/LeanPool/NandakumarRamanaRao/NRR/TestMap.lean b/LeanPool/NandakumarRamanaRao/NRR/TestMap.lean index 7cfc20464d..2e4998d0a6 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/TestMap.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/TestMap.lean @@ -10,4 +10,4 @@ public import LeanPool.NandakumarRamanaRao.NRR.TestMap.EquivarianceCore /-! Supporting modules for Equal-area and equal-perimeter convex partitions. -/ -@[expose] public section +public section diff --git a/LeanPool/NandakumarRamanaRao/NRR/TestMap/EquivarianceCore.lean b/LeanPool/NandakumarRamanaRao/NRR/TestMap/EquivarianceCore.lean index 570cd9fc96..297b8eec5a 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/TestMap/EquivarianceCore.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/TestMap/EquivarianceCore.lean @@ -17,7 +17,7 @@ This module proves that the canonical normalized weights, power-partition pieces and perimeter deviation commute with relabelling of sites. -/ -@[expose] public section +public section open NRR NRR.Geometry NRR.Geometry.ConvexBody diff --git a/LeanPool/NandakumarRamanaRao/NRR/Topology.lean b/LeanPool/NandakumarRamanaRao/NRR/Topology.lean index 7b567d3af9..b84af031e0 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Topology.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Topology.lean @@ -10,4 +10,4 @@ public import LeanPool.NandakumarRamanaRao.NRR.Topology.OutwardFieldZero /-! Supporting modules for Equal-area and equal-perimeter convex partitions. -/ -@[expose] public section +public section diff --git a/LeanPool/NandakumarRamanaRao/NRR/Topology/OutwardFieldZero.lean b/LeanPool/NandakumarRamanaRao/NRR/Topology/OutwardFieldZero.lean index 9fc63856e1..676839967e 100644 --- a/LeanPool/NandakumarRamanaRao/NRR/Topology/OutwardFieldZero.lean +++ b/LeanPool/NandakumarRamanaRao/NRR/Topology/OutwardFieldZero.lean @@ -25,7 +25,7 @@ closed ball to its boundary. Its restriction to the boundary is both nullhomoto strictly outward scalar-product condition), contradicting degree. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NandakumarRamanaRao/Solution.lean b/LeanPool/NandakumarRamanaRao/Solution.lean index b48232cc67..53aa7d0b56 100644 --- a/LeanPool/NandakumarRamanaRao/Solution.lean +++ b/LeanPool/NandakumarRamanaRao/Solution.lean @@ -10,4 +10,4 @@ public import LeanPool.NandakumarRamanaRao.HumanVerification.Main /-! # Solution -/ -@[expose] public section +public section diff --git a/LeanPool/NashEmbedding/NashEmbedding/Compact/AmbientMetric.lean b/LeanPool/NashEmbedding/NashEmbedding/Compact/AmbientMetric.lean index bc88ce48a6..2349f68daf 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Compact/AmbientMetric.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Compact/AmbientMetric.lean @@ -54,7 +54,7 @@ a smooth expression in `L_tilde x` and `g_tilde x` (leaves L1–L4 for `pinv`). Leaves L1–L7 and the assembly L8 were proved by Aristotle (project 6f927eaf, 2026-08-30). -/ -@[expose] public section +public section open scoped Manifold ContDiff Topology InnerProduct open Set Function ContinuousLinearMap Bundle @@ -175,15 +175,15 @@ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimension {E' : Type*} [NormedAddCommGroup E'] [NormedSpace ℝ E'] /-- The differential `mfderiv u x`, read as a map `E →L E'` (definitional cast). -/ -def diff (u : M → E') (x : M) : E →L[ℝ] E' := mfderiv I 𝓘(ℝ, E') u x +@[expose] def diff (u : M → E') (x : M) : E →L[ℝ] E' := mfderiv I 𝓘(ℝ, E') u x /-- The metric at `x`, read as a bilinear form on `E` (definitional cast). -/ -def metricAt (g : ContMDiffRiemannianMetric I ∞ E (TangentSpace I : M → Type _)) (x : M) : +@[expose] def metricAt (g : ContMDiffRiemannianMetric I ∞ E (TangentSpace I : M → Type _)) (x : M) : E →L[ℝ] E →L[ℝ] ℝ := g.inner x /-- Coordinate change from the model fibre to `T_xM ≅ E`, in the trivialization at `x₀` (definitional cast of `symmL`). -/ -def tcoord (I : ModelWithCorners ℝ E H) [IsManifold I ∞ M] (x₀ x : M) : E →L[ℝ] E := +@[expose] def tcoord (I : ModelWithCorners ℝ E H) [IsManifold I ∞ M] (x₀ x : M) : E →L[ℝ] E := (trivializationAt E (TangentSpace I) x₀).symmL ℝ x omit [FiniteDimensional ℝ E] in @@ -255,7 +255,7 @@ end Coordinates /-- The Euclidean inner product of `E'` as a real bilinear form (over `ℝ` the conjugate linearity of `innerSL` is trivial). -/ -def innerBilin (E' : Type*) [NormedAddCommGroup E'] [InnerProductSpace ℝ E'] : +@[expose] def innerBilin (E' : Type*) [NormedAddCommGroup E'] [InnerProductSpace ℝ E'] : E' →L[ℝ] E' →L[ℝ] ℝ := innerSL ℝ diff --git a/LeanPool/NashEmbedding/NashEmbedding/Compact/Main.lean b/LeanPool/NashEmbedding/NashEmbedding/Compact/Main.lean index a6f158991d..fbe1bbae5d 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Compact/Main.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Compact/Main.lean @@ -48,7 +48,7 @@ proved by Aristotle (projects 564db993, 6f927eaf, bf61e09c, 7856eea9; 2026-08-30 closed embedding and an immersion. -/ -@[expose] public section +public section open scoped Manifold ContDiff Topology open Bundle Set Function Matrix @@ -61,7 +61,7 @@ namespace NashEmbedding /-- Forget the base point of a tangent vector to Euclidean space: the tangent space `TangentSpace 𝓘(ℝ, ℝᵠ) y` is definitionally `ℝᵠ`, but does not carry the inner-product instance, so we transport explicitly. -/ -def toEuclid {q : ℕ} {y : EuclideanSpace ℝ (Fin q)} +@[expose] def toEuclid {q : ℕ} {y : EuclideanSpace ℝ (Fin q)} (v : TangentSpace 𝓘(ℝ, EuclideanSpace ℝ (Fin q)) y) : EuclideanSpace ℝ (Fin q) := v @@ -97,6 +97,7 @@ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimension /-- `w : M → ℝᵠ` pulls the Euclidean metric back to `g`: `g_x(v, v') = ⟨dw_x v, dw_x v'⟩` for all `x` and tangent vectors `v, v'`. -/ +@[expose] def PullsBackEuclidean (g : ContMDiffRiemannianMetric I ∞ E (TangentSpace I : M → Type _)) {q : ℕ} (w : M → EuclideanSpace ℝ (Fin q)) : Prop := ∀ (x : M) (v v' : TangentSpace I x), diff --git a/LeanPool/NashEmbedding/NashEmbedding/Compact/Periodization.lean b/LeanPool/NashEmbedding/NashEmbedding/Compact/Periodization.lean index 7e3b3194d4..d979a29f27 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Compact/Periodization.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Compact/Periodization.lean @@ -38,7 +38,7 @@ Wassermann §13): All leaves were proved by Aristotle (project bf61e09c, 2026-08-30). -/ -@[expose] public section +public section open scoped BigOperators ContDiff Manifold Topology open Matrix NashEmbedding.Sobolev Set @@ -202,7 +202,7 @@ theorem contDiff_symmetrize : /-! ## C. Real and matrix periodization -/ /-- The open cube `(-π, π)ᴺ`. -/ -def openCube (N : ℕ) : Set (Fin N → ℝ) := {x | ∀ j, |x j| < Real.pi} +@[expose] def openCube (N : ℕ) : Set (Fin N → ℝ) := {x | ∀ j, |x j| < Real.pi} /-- Real-valued periodic extension, via the complex one. -/ def periodicExtR (N : ℕ) (φ : (Fin N → ℝ) → ℝ) (x : Fin N → ℝ) : ℝ := @@ -331,7 +331,7 @@ lemma euclideanSpace_eq_sum_single (a : EuclideanSpace ℝ (Fin N)) : simp [Pi.single_apply] /-- The matrix `B (eᵢ) (eⱼ)` of a bilinear form on `ℝᴺ`. -/ -def formMatrix (B : EuclideanSpace ℝ (Fin N) →L[ℝ] EuclideanSpace ℝ (Fin N) →L[ℝ] ℝ) : +@[expose] def formMatrix (B : EuclideanSpace ℝ (Fin N) →L[ℝ] EuclideanSpace ℝ (Fin N) →L[ℝ] ℝ) : Matrix (Fin N) (Fin N) ℝ := Matrix.of fun i j => B (EuclideanSpace.single i 1) (EuclideanSpace.single j 1) diff --git a/LeanPool/NashEmbedding/NashEmbedding/Examples/FlatTorus.lean b/LeanPool/NashEmbedding/NashEmbedding/Examples/FlatTorus.lean index 2e2a847f8f..d5c12fd1ef 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Examples/FlatTorus.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Examples/FlatTorus.lean @@ -43,7 +43,7 @@ assembly `torus2_matches_nashTorus` is by hand. L7 is a general reusable fact (`Realizes u g` + pointwise `PosDef g` ⇒ `HasFullRankDeriv u`). -/ -@[expose] public section +public section open scoped Manifold ContDiff Topology open Bundle Function ContinuousLinearMap Complex Matrix diff --git a/LeanPool/NashEmbedding/NashEmbedding/Examples/Negative.lean b/LeanPool/NashEmbedding/NashEmbedding/Examples/Negative.lean index b3552d789a..d2dd208200 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Examples/Negative.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Examples/Negative.lean @@ -22,7 +22,7 @@ Euclidean space cannot pull the Euclidean inner product back to a Riemannian met its differential is zero, so the pullback is degenerate. -/ -@[expose] public section +public section open scoped Manifold ContDiff open Bundle Function diff --git a/LeanPool/NashEmbedding/NashEmbedding/Examples/Sphere.lean b/LeanPool/NashEmbedding/NashEmbedding/Examples/Sphere.lean index 026f1b69b5..46ec35bd62 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Examples/Sphere.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Examples/Sphere.lean @@ -23,7 +23,7 @@ Every unit sphere `Sⁿ ⊂ ℝⁿ⁺¹` with its round metric, and every produc `nashCompact`. -/ -@[expose] public section +public section open scoped Manifold ContDiff EuclideanSpace open Bundle Function Metric diff --git a/LeanPool/NashEmbedding/NashEmbedding/Riemannian/Induced.lean b/LeanPool/NashEmbedding/NashEmbedding/Riemannian/Induced.lean index 9a229a15ea..2e8954cdbb 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Riemannian/Induced.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Riemannian/Induced.lean @@ -28,7 +28,7 @@ Leaves L1–L4 (symmetry, positivity, von Neumann boundedness, section smoothnes proved by Aristotle (project c61ad094, 2026-08-30); `inducedMetric` packages them. -/ -@[expose] public section +public section open scoped Manifold ContDiff Topology open Bundle Function ContinuousLinearMap Bornology Metric @@ -46,6 +46,7 @@ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimension {E' : Type*} [NormedAddCommGroup E'] [InnerProductSpace ℝ E'] [FiniteDimensional ℝ E'] /-- The induced bilinear form at `x`, on the model space `E`: `(v, w) ↦ ⟪du_x v, du_x w⟫`. -/ +@[expose] def inducedForm (u : M → E') (x : M) : E →L[ℝ] E →L[ℝ] ℝ := (innerBilin E').bilinearComp (diff (I := I) u x) (diff (I := I) u x) @@ -149,6 +150,7 @@ theorem inducedForm_contMDiff {u : M → E'} (hu : ContMDiff I 𝓘(ℝ, E') ∞ rfl /-- The induced Riemannian metric of a smooth immersion `u : M → E'`. -/ +@[expose] def inducedMetric {u : M → E'} (hu : ContMDiff I 𝓘(ℝ, E') ∞ u) (hinj : ∀ x, Injective (mfderiv I 𝓘(ℝ, E') u x)) : ContMDiffRiemannianMetric I ∞ E (TangentSpace I : M → Type _) where diff --git a/LeanPool/NashEmbedding/NashEmbedding/Riemannian/Pullback.lean b/LeanPool/NashEmbedding/NashEmbedding/Riemannian/Pullback.lean index f00ef97eed..ea24df5a55 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Riemannian/Pullback.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Riemannian/Pullback.lean @@ -34,7 +34,7 @@ Applications: the flat torus `Circle × Circle` (so `nashCompact` can be compare carry metrics. -/ -@[expose] public section +public section open scoped Manifold ContDiff Topology open Bundle Function ContinuousLinearMap Bornology Metric @@ -58,6 +58,7 @@ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimension def mdiff (f : M → N) (x : M) : E →L[ℝ] F := mfderiv I J f x /-- The pullback form at `x`, on the model space `E`: `(v, w) ↦ h_{f x}(df_x v, df_x w)`. -/ +@[expose] def pullbackForm (f : M → N) (h : ContMDiffRiemannianMetric J ∞ F (TangentSpace J : N → Type _)) (x : M) : E →L[ℝ] E →L[ℝ] ℝ := @@ -226,6 +227,7 @@ theorem pullbackForm_contMDiff {f : M → N} rw [tcoord_tcoordInv hfx, tcoord_tcoordInv hfx] /-- The pullback metric `f^*h` of a smooth immersion `f : M → N`. -/ +@[expose] def pullbackMetric {f : M → N} (h : ContMDiffRiemannianMetric J ∞ F (TangentSpace J : N → Type _)) (hf : ContMDiff I J ∞ f) (hinj : ∀ x, Injective (mfderiv I J f x)) : diff --git a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Basic.lean b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Basic.lean index a6bb85351e..5fbaad52e1 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Basic.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Basic.lean @@ -35,7 +35,7 @@ exponential functions eₘ. * `NashEmbedding.Sobolev.fourierExp n m θ` — the exponential `eₘ(θ)` -/ -@[expose] public section +public section open scoped BigOperators ComplexConjugate ContDiff open Complex Real @@ -51,7 +51,7 @@ variable {n : ℕ} /-- The weight function `(1 + |m|²)^s` for `m : Fin n → ℤ`. Here `|m|²` is the sum of squares of coordinates, viewed as real numbers. -/ -def weight (n : ℕ) (s : ℝ) (m : Fin n → ℤ) : ℝ := +@[expose] def weight (n : ℕ) (s : ℝ) (m : Fin n → ℤ) : ℝ := (1 + ∑ i : Fin n, ((m i : ℝ) ^ 2)) ^ s lemma weight_pos (s : ℝ) (m : Fin n → ℤ) : 0 < weight n s m := by @@ -101,11 +101,11 @@ lemma weight_le_one_of_nonpos {s : ℝ} (hs : s ≤ 0) (m : Fin n → ℤ) : /-- A sequence `a : (Fin n → ℤ) → ℂ` belongs to `ℓ²_(s)(ℤⁿ)` iff `∑ₘ (1 + |m|²)^s |aₘ|² < ∞`. -/ -def MemSobolev (n : ℕ) (s : ℝ) (a : (Fin n → ℤ) → ℂ) : Prop := +@[expose] def MemSobolev (n : ℕ) (s : ℝ) (a : (Fin n → ℤ) → ℂ) : Prop := Summable (fun m => weight n s m * ‖a m‖ ^ 2) /-- The squared Sobolev norm `‖a‖²_(s) = ∑ₘ (1 + |m|²)^s |aₘ|²`. -/ -def sobolevNormSq (n : ℕ) (s : ℝ) (a : (Fin n → ℤ) → ℂ) : ℝ := +@[expose] def sobolevNormSq (n : ℕ) (s : ℝ) (a : (Fin n → ℤ) → ℂ) : ℝ := ∑' m, weight n s m * ‖a m‖ ^ 2 /-- The Sobolev inner product `⟨a, b⟩_(s) = ∑ₘ (1 + |m|²)^s conj(aₘ) bₘ`. -/ @@ -151,7 +151,7 @@ lemma hasDerivAt_update_of_hasFDerivAt /-- The Fourier exponential `eₘ(θ) = exp(i ∑ⱼ mⱼ θⱼ)` for `m : Fin n → ℤ` and `θ : Fin n → ℝ`. -/ -def fourierExp (n : ℕ) (m : Fin n → ℤ) (θ : Fin n → ℝ) : ℂ := +@[expose] def fourierExp (n : ℕ) (m : Fin n → ℤ) (θ : Fin n → ℝ) : ℂ := Complex.exp (Complex.I * ↑(∑ j : Fin n, (m j : ℝ) * θ j)) /- diff --git a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/CoeffTransport.lean b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/CoeffTransport.lean index d4231fb108..db646b4057 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/CoeffTransport.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/CoeffTransport.lean @@ -35,7 +35,7 @@ stated): * `IsRapidDecay` is closed under all the momentum-side operations of the Günther operator. -/ -@[expose] public section +public section open scoped BigOperators ComplexConjugate ContDiff open Complex diff --git a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/CompactInclusion.lean b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/CompactInclusion.lean index 6266b0d32b..91997ba26d 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/CompactInclusion.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/CompactInclusion.lean @@ -30,7 +30,7 @@ In this file we state the result in the following concrete form: any sequence in the unit ball of `ℓ²_(t)` has a subsequence that converges in `ℓ²_(s)`. -/ -@[expose] public section +public section open scoped BigOperators open NashEmbedding.Sobolev diff --git a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Convolution.lean b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Convolution.lean index dc707de9c9..e491f51653 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Convolution.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Convolution.lean @@ -39,7 +39,7 @@ mollifier convergence theorem: `φ_ε * u → (∫ φ) · u` in `H^s` as `ε → * `mollifier_convergence` — mollifier convergence theorem. -/ -@[expose] public section +public section open scoped BigOperators ComplexConjugate open Complex Real NashEmbedding.Sobolev MeasureTheory @@ -56,7 +56,7 @@ variable {n : ℕ} /-- The Fourier transform of `φ : ℝⁿ → ℂ` at `ξ ∈ ℝⁿ`: `φ̂(ξ) = ∫ φ(y) e^{-iξ·y} dy` (no `(2π)^{-n}` factor). -/ -def ftRn (n : ℕ) (φ : (Fin n → ℝ) → ℂ) (ξ : Fin n → ℝ) : ℂ := +@[expose] def ftRn (n : ℕ) (φ : (Fin n → ℝ) → ℂ) (ξ : Fin n → ℝ) : ℂ := ∫ y, φ y * exp (-(I * ↑(∑ j : Fin n, ξ j * y j))) /- @@ -89,7 +89,7 @@ lemma continuous_ftRn (φ : (Fin n → ℝ) → ℂ) (hφ : Integrable φ) : /-- The convolution `φ * u` of a function `φ` with a distribution `u ∈ X_n^*`, defined via Fourier coefficients: `(φ * u)^(m) = φ̂(m) · û(m)`. -/ -def convDistrib (n : ℕ) (φ : (Fin n → ℝ) → ℂ) (u : TrigPolyDual n) : TrigPolyDual n := +@[expose] def convDistrib (n : ℕ) (φ : (Fin n → ℝ) → ℂ) (u : TrigPolyDual n) : TrigPolyDual n := seqToDual n (fun m => ftRn n φ (fun j => (m j : ℝ)) * fourierCoeffDistrib u m) /-- The Fourier coefficient of the convolution. -/ @@ -165,7 +165,7 @@ theorem convDistrib_smul (φ : (Fin n → ℝ) → ℂ) (c : ℂ) (u : TrigPolyD /-! ## Rescaling (Definition) -/ /-- The rescaled function `φ_ε(x) = ε^{-n} φ(x/ε)` for `ε > 0`. -/ -def rescale (n : ℕ) (φ : (Fin n → ℝ) → ℂ) (ε : ℝ) (x : Fin n → ℝ) : ℂ := +@[expose] def rescale (n : ℕ) (φ : (Fin n → ℝ) → ℂ) (ε : ℝ) (x : Fin n → ℝ) : ℂ := (((ε⁻¹) ^ n : ℝ) : ℂ) * φ (ε⁻¹ • x) /- diff --git a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/ConvolutionAlgebra.lean b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/ConvolutionAlgebra.lean index 1e39a07131..b75e7b6358 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/ConvolutionAlgebra.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/ConvolutionAlgebra.lean @@ -37,7 +37,7 @@ The Günther operator is built from these operations, so it preserves `conjRefle sequences; this is how the fixed point of Theorem B is seen to be real (`ℝᴺ`-valued). -/ -@[expose] public section +public section open scoped BigOperators ComplexConjugate open Complex @@ -128,7 +128,7 @@ lemma seqConv_finset_sum_left {ι : Type*} {s : ℝ} (hn : 0 < n) (hs : (n : ℝ /-- `conjReflect a m = conj (a (-m))`. The coefficient sequence of a function `f` is `conjReflect`-fixed iff `f` is real-valued. -/ -def conjReflect (a : (Fin n → ℤ) → ℂ) (m : Fin n → ℤ) : ℂ := conj (a (-m)) +@[expose] def conjReflect (a : (Fin n → ℤ) → ℂ) (m : Fin n → ℤ) : ℂ := conj (a (-m)) lemma conjReflect_conjReflect (a : (Fin n → ℤ) → ℂ) : conjReflect (conjReflect a) = a := by funext m; simp [conjReflect] diff --git a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Differentiation.lean b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Differentiation.lean index 407936eb67..1a0cb758b4 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Differentiation.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Differentiation.lean @@ -26,7 +26,7 @@ If `∑ |bₘ| < ∞` and `∑ |mⱼ| |bₘ| < ∞`, then the Fourier series `∂f/∂θⱼ(θ) = ∑ i mⱼ bₘ eₘ(θ)`. -/ -@[expose] public section +public section open scoped BigOperators open NashEmbedding.Sobolev Complex @@ -40,7 +40,7 @@ variable {n : ℕ} /-- The formal partial derivative coefficients: for direction `j`, the coefficient of `eₘ` in `∂f/∂θⱼ` is `i · mⱼ · bₘ`. -/ -def partialCoeff (j : Fin n) (b : (Fin n → ℤ) → ℂ) (m : Fin n → ℤ) : ℂ := +@[expose] def partialCoeff (j : Fin n) (b : (Fin n → ℤ) → ℂ) (m : Fin n → ℤ) : ℂ := Complex.I * (m j : ℂ) * b m /- diff --git a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Distribution.lean b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Distribution.lean index 7fea9c9998..60fa6f61b6 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Distribution.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Distribution.lean @@ -58,7 +58,7 @@ from `ℓ²_(s)`. * `sobolev_embedding_factorization` — `ι(ε(φ)) = φ` in `X_n^*` -/ -@[expose] public section +public section open scoped BigOperators ComplexConjugate open Complex Real NashEmbedding.Sobolev @@ -86,7 +86,7 @@ lemma starRingEnd_fourierExp (m : Fin n → ℤ) (θ : Fin n → ℝ) : /-- The standard Fourier coefficient of a function `f`: `f̂ₘ = (2π)^{-n} ∫_{[0,2π]^n} f(θ) · e_{-m}(θ) dθ`. -/ -def stdFourierCoeff (n : ℕ) (f : (Fin n → ℝ) → ℂ) (m : Fin n → ℤ) : ℂ := +@[expose] def stdFourierCoeff (n : ℕ) (f : (Fin n → ℝ) → ℂ) (m : Fin n → ℤ) : ℂ := (((2 * π : ℝ) ^ n : ℝ) : ℂ)⁻¹ * ∫ θ in Set.Icc (0 : Fin n → ℝ) (2 * π • (1 : Fin n → ℝ)), f θ * fourierExp n (-m) θ @@ -126,12 +126,12 @@ abbrev TrigPolyDual (n : ℕ) := TrigPoly n →ₗ[ℂ] ℂ /-- The Fourier coefficient `φ̂ₘ := φ(e_{-m})` of a distribution `φ ∈ X_n^*`. The sign inversion ensures compatibility with the standard Fourier coefficient convention for functions via the integration embedding. -/ -def fourierCoeffDistrib (φ : TrigPolyDual n) (m : Fin n → ℤ) : ℂ := +@[expose] def fourierCoeffDistrib (φ : TrigPolyDual n) (m : Fin n → ℤ) : ℂ := φ (Finsupp.single (-m) 1) /-- Reconstruct a distribution from a sequence `a : ℤⁿ → ℂ`. The linear functional sends the basis element `eₘ` to `a(-m)`, extended by linearity. -/ -def seqToDual (n : ℕ) (a : (Fin n → ℤ) → ℂ) : TrigPolyDual n := +@[expose] def seqToDual (n : ℕ) (a : (Fin n → ℤ) → ℂ) : TrigPolyDual n := Finsupp.linearCombination ℂ (fun m => a (-m)) /-- `fourierCoeffDistrib` and `seqToDual` are inverses (forward direction): @@ -166,12 +166,12 @@ def dualEquivSeq (n : ℕ) : TrigPolyDual n ≃ₗ[ℂ] ((Fin n → ℤ) → ℂ /-- A distribution `φ ∈ X_n^*` belongs to `H^s_{2πℤⁿ}(ℝⁿ)` iff its Fourier coefficient sequence `φ̂` belongs to `ℓ²_(s)(ℤⁿ)`. -/ -def MemSobolevDistrib (n : ℕ) (s : ℝ) (φ : TrigPolyDual n) : Prop := +@[expose] def MemSobolevDistrib (n : ℕ) (s : ℝ) (φ : TrigPolyDual n) : Prop := MemSobolev n s (fourierCoeffDistrib φ) /-- The squared Sobolev norm of a distribution, pulled back from `ℓ²_(s)`: `‖φ‖²_{(s)} = ∑ₘ (1 + |m|²)^s |φ̂ₘ|²`. -/ -def sobolevNormSqDistrib (n : ℕ) (s : ℝ) (φ : TrigPolyDual n) : ℝ := +@[expose] def sobolevNormSqDistrib (n : ℕ) (s : ℝ) (φ : TrigPolyDual n) : ℝ := sobolevNormSq n s (fourierCoeffDistrib φ) /-! ## Continuous inclusion -/ @@ -228,7 +228,7 @@ distribution in `X_n^*` defined by We construct this via the canonical identification `X_n^* ≅ ℂ^{ℤⁿ}`: the Fourier coefficient sequence of `ι(f)` is the standard Fourier coefficient sequence of `f`. -/ -def integrationEmbed (n : ℕ) (f : (Fin n → ℝ) → ℂ) : TrigPolyDual n := +@[expose] def integrationEmbed (n : ℕ) (f : (Fin n → ℝ) → ℂ) : TrigPolyDual n := seqToDual n (stdFourierCoeff n f) /-- The Fourier coefficients of the integration embedding are the standard diff --git a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/FourierSynthesis.lean b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/FourierSynthesis.lean index 9615ad1e8d..2b7894315f 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/FourierSynthesis.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/FourierSynthesis.lean @@ -31,7 +31,7 @@ We prove a concrete bound: for each multi-index `α` with `|α| ≤ k`, `sup_θ |∂^α a_check(θ)| ≤ C · ‖a‖_(s+k)`, where `C` depends only on `n`, `s`, `k`. -/ -@[expose] public section +public section open scoped BigOperators Real open NashEmbedding.Sobolev Complex @@ -45,7 +45,7 @@ namespace NashEmbedding.Sobolev variable {n : ℕ} /-- The Fourier synthesis map: `a_check(θ) = ∑ aₘ eₘ(θ)`. -/ -def fourierSynthesis (n : ℕ) (a : (Fin n → ℤ) → ℂ) (θ : Fin n → ℝ) : ℂ := +@[expose] def fourierSynthesis (n : ℕ) (a : (Fin n → ℤ) → ℂ) (θ : Fin n → ℝ) : ℂ := ∑' m : Fin n → ℤ, a m * fourierExp n m θ /-- For a multi-index `α : Fin n → ℕ`, the monomial `m^α = ∏ mⱼ^{αⱼ}`. -/ diff --git a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Inequalities.lean b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Inequalities.lean index dea099daef..617205a86f 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Inequalities.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Inequalities.lean @@ -26,7 +26,7 @@ not specific to any particular construction (mollifier, Riemann sum, etc.). -/ -@[expose] public section +public section open scoped BigOperators open Complex Real MeasureTheory diff --git a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/IntegrationByParts.lean b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/IntegrationByParts.lean index f9bea18ed2..f8e850fff7 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/IntegrationByParts.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/IntegrationByParts.lean @@ -45,7 +45,7 @@ estimate used in `cinfty_rapidDecay` (Bridge Lemma 1 for the assembly). `memSobolev_of_rapid_decay`. -/ -@[expose] public section +public section open scoped BigOperators ContDiff open Complex Real MeasureTheory diff --git a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Limits.lean b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Limits.lean index 490a07cade..27f506080c 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Limits.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Limits.lean @@ -35,7 +35,7 @@ The last two replace Rellich compactness in the regularity argument for Theorem iterates are bounded in every `H^k`, hence so is their coefficientwise limit. -/ -@[expose] public section +public section open scoped BigOperators open Filter Topology diff --git a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Mollifier.lean b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Mollifier.lean index 25aabfc5d7..84483b2ad7 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Mollifier.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Mollifier.lean @@ -38,7 +38,7 @@ Smooth compactly supported infrastructure on ℝⁿ: `φ` is integrable and `u ∈ H^s_*`. -/ -@[expose] public section +public section open scoped BigOperators ContDiff open Complex Real MeasureTheory diff --git a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Multiplication.lean b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Multiplication.lean index 82277860fa..d87c7d55cd 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Multiplication.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Multiplication.lean @@ -36,7 +36,7 @@ coefficient sequences). * `sobolev_mul_dist` — First multiplication theorem (distribution side) -/ -@[expose] public section +public section open scoped BigOperators ComplexConjugate open Complex Real NashEmbedding.Sobolev diff --git a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/MultiplicationBootstrap.lean b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/MultiplicationBootstrap.lean index 982e05ed80..4d527e1d04 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/MultiplicationBootstrap.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/MultiplicationBootstrap.lean @@ -33,7 +33,7 @@ bootstrap inequality used in Nash's isometric embedding theorem. * `third_multiplication_theorem` — distribution-side result -/ -@[expose] public section +public section open scoped BigOperators ComplexConjugate open Complex Real NashEmbedding.Sobolev @@ -49,23 +49,23 @@ variable {n : ℕ} /-! ## Definitions -/ /-- Sum of inverse Sobolev weights controlling the zeroth-order embedding term. -/ -noncomputable def mt3KSq (n : Nat) (r : Real) : Real := +@[expose] noncomputable def mt3KSq (n : Nat) (r : Real) : Real := tsum (fun (j : Fin n → Int) => weight n (-r) j) /-- Sum of weights controlling the first-derivative embedding term. -/ -noncomputable def mt3LSq (n : Nat) (r : Real) : Real := +@[expose] noncomputable def mt3LSq (n : Nat) (r : Real) : Real := tsum (fun (j : Fin n → Int) => weight n (1 - r) j) /-- Polynomial and exponential factor in the higher-order multiplication estimate. -/ -noncomputable def mt3BStar (k : Nat) : Real := +@[expose] noncomputable def mt3BStar (k : Nat) : Real := 64 * (k : Real) ^ 2 * ((2 : Real) ^ (2 * (k : Real) - 1) - 2) /-- Squared leading constant in the third Sobolev multiplication theorem. -/ -noncomputable def mt3AConstSq (n : Nat) (r : Real) : Real := +@[expose] noncomputable def mt3AConstSq (n : Nat) (r : Real) : Real := 8 * mt3KSq n r /-- Squared lower-order constant in the third Sobolev multiplication theorem. -/ -noncomputable def mt3BConstSq (n : Nat) (k : Nat) (r : Real) : Real := +@[expose] noncomputable def mt3BConstSq (n : Nat) (k : Nat) (r : Real) : Real := 4 * mt3BStar k * mt3LSq n r /-! ## Basic properties of constants -/ diff --git a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/MultiplicationSharp.lean b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/MultiplicationSharp.lean index 79ff2d0b3c..91a339c0ec 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/MultiplicationSharp.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/MultiplicationSharp.lean @@ -35,7 +35,7 @@ multiplication when 2s > n, with the norm bound * `second_multiplication_theorem` — distribution-side result -/ -@[expose] public section +public section open scoped BigOperators ComplexConjugate open Complex Real NashEmbedding.Sobolev @@ -51,20 +51,20 @@ variable {n : ℕ} /-! ## Definitions -/ /-- Convolution of two sequences on ℤⁿ. -/ -noncomputable def seqConv +@[expose] noncomputable def seqConv (a b : (Fin n → ℤ) → ℂ) (m : Fin n → ℤ) : ℂ := ∑' i, a i * b (m - i) /-- Product of two distributions via Fourier coefficient convolution. -/ -noncomputable def sobolevMulDistrib (u v : TrigPolyDual n) : TrigPolyDual n := +@[expose] noncomputable def sobolevMulDistrib (u v : TrigPolyDual n) : TrigPolyDual n := seqToDual n (seqConv (fourierCoeffDistrib u) (fourierCoeffDistrib v)) /-- The squared Sobolev embedding constant C²_{n,s} = ∑_j (1+|j|²)^{-s}. -/ -noncomputable def sobolevEmbedConstSq (n : ℕ) (s : ℝ) : ℝ := +@[expose] noncomputable def sobolevEmbedConstSq (n : ℕ) (s : ℝ) : ℝ := ∑' (j : Fin n → ℤ), weight n (-s) j /-- The constant K_tilde_{n,s} = 4 · 2^{2s} · C²_{n,s}. -/ -noncomputable def mt2Const (n : ℕ) (s : ℝ) : ℝ := +@[expose] noncomputable def mt2Const (n : ℕ) (s : ℝ) : ℝ := 4 * (2 : ℝ) ^ (2 * s) * sobolevEmbedConstSq n s /-! ## Helper lemmas -/ diff --git a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Parseval.lean b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Parseval.lean index ecea947c2f..ad0f48ce78 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Parseval.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Parseval.lean @@ -28,7 +28,7 @@ with the torus integral of `|f|²`, which `integral_periodCube_eq_torus` convert cube integral. -/ -@[expose] public section +public section open scoped BigOperators open Real MeasureTheory diff --git a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Periodicity.lean b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Periodicity.lean index 598ff0fe35..a8a7f1ccf0 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Periodicity.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Periodicity.lean @@ -24,7 +24,7 @@ position-space analytic toolkit (mollifier theory, Riemann-sum position form) and by the NashEmbedding smooth-metric structures. -/ -@[expose] public section +public section open scoped BigOperators open Real @@ -35,12 +35,12 @@ section namespace NashEmbedding.Sobolev /-- The periodic shift `2πk : ℝⁿ` for `k : Fin n → ℤ`. -/ -def periodicShift (n : ℕ) (k : Fin n → ℤ) : Fin n → ℝ := +@[expose] def periodicShift (n : ℕ) (k : Fin n → ℤ) : Fin n → ℝ := fun i => 2 * Real.pi * (k i : ℝ) /-- A function `f : ℝⁿ → V` is `2πℤⁿ`-periodic if `f(x + 2πk) = f(x)` for all `x` and integer vectors `k`. -/ -def IsPeriodic2Pi {n : ℕ} {V : Type*} (f : (Fin n → ℝ) → V) : Prop := +@[expose] def IsPeriodic2Pi {n : ℕ} {V : Type*} (f : (Fin n → ℝ) → V) : Prop := ∀ (x : Fin n → ℝ) (k : Fin n → ℤ), f (x + periodicShift n k) = f x end NashEmbedding.Sobolev diff --git a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Periodization.lean b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Periodization.lean index 54ce982356..ecda388705 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Periodization.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Periodization.lean @@ -63,7 +63,7 @@ on ℝⁿ to the momentum-side Sobolev structures of `DistributionSobolev`. in every `MemSobolevDistrib n s`. -/ -@[expose] public section +public section open scoped BigOperators ContDiff open Complex Real MeasureTheory @@ -81,7 +81,7 @@ variable {n : ℕ} `φ^per(x) = ∑_{k ∈ ℤⁿ} φ(x + 2πk)`. For `φ` with `supp(φ) ⊂ (-π, π)ⁿ`, at most one term is nonzero at each `x`. -/ -def periodicExtension (n : ℕ) (φ : (Fin n → ℝ) → ℂ) (x : Fin n → ℝ) : ℂ := +@[expose] def periodicExtension (n : ℕ) (φ : (Fin n → ℝ) → ℂ) (x : Fin n → ℝ) : ℂ := ∑' k : Fin n → ℤ, φ (x + periodicShift n k) /-! ## Smoothness and periodicity of the periodic extension -/ @@ -208,7 +208,7 @@ lemma periodicExtension_im_zero {φ : (Fin n → ℝ) → ℂ} /-! ## Partial derivatives of periodic functions -/ /-- The partial derivative `∂ⱼ g (θ) = Dg(θ)[eⱼ]`. -/ -def partialDeriv (j : Fin n) (g : (Fin n → ℝ) → ℂ) (θ : Fin n → ℝ) : ℂ := +@[expose] def partialDeriv (j : Fin n) (g : (Fin n → ℝ) → ℂ) (θ : Fin n → ℝ) : ℂ := fderiv ℝ g θ (Pi.single j 1) lemma partialDeriv_contDiff {g : (Fin n → ℝ) → ℂ} (hg : ContDiff ℝ ∞ g) (j : Fin n) : @@ -388,7 +388,7 @@ theorem stdFourierCoeff_partialDeriv (hn : 0 < n) {g : (Fin n → ℝ) → ℂ} /-! ## The Laplacian and iterated Fourier multipliers -/ /-- The (flat) Laplacian `Δg = ∑ⱼ ∂ⱼ∂ⱼ g`. -/ -def laplacian (g : (Fin n → ℝ) → ℂ) : (Fin n → ℝ) → ℂ := +@[expose] def laplacian (g : (Fin n → ℝ) → ℂ) : (Fin n → ℝ) → ℂ := fun θ => ∑ j, partialDeriv j (partialDeriv j g) θ lemma laplacian_contDiff {g : (Fin n → ℝ) → ℂ} (hg : ContDiff ℝ ∞ g) : @@ -613,7 +613,8 @@ lemma mFourier_toUnitTorus (m : Fin n → ℤ) (θ : Fin n → ℝ) : /-- The descent of a `2πℤⁿ`-periodic function to the unit torus `(ℝ/ℤ)ⁿ`, via `Quotient.out` representatives and the rescaling `x ↦ 2πx`. -/ -def toUnitTorusFun (n : ℕ) (f : (Fin n → ℝ) → ℂ) (z : UnitAddTorus (Fin n)) : ℂ := +@[expose] def toUnitTorusFun (n : ℕ) (f : (Fin n → ℝ) → ℂ) + (z : UnitAddTorus (Fin n)) : ℂ := f (fun i => 2 * π * Quotient.out (z i)) lemma toUnitTorusFun_toUnitTorus {f : (Fin n → ℝ) → ℂ} (hper : IsPeriodic2Pi f) @@ -638,7 +639,8 @@ lemma continuous_toUnitTorusFun {f : (Fin n → ℝ) → ℂ} (hf : Continuous f exact hf.comp (continuous_const_smul (2 * π)) /-- The descent as a continuous map on the unit torus. -/ -def toUnitTorusCM (n : ℕ) (f : (Fin n → ℝ) → ℂ) (hf : Continuous f) (hper : IsPeriodic2Pi f) : +@[expose] def toUnitTorusCM (n : ℕ) (f : (Fin n → ℝ) → ℂ) + (hf : Continuous f) (hper : IsPeriodic2Pi f) : C(UnitAddTorus (Fin n), ℂ) := ⟨toUnitTorusFun n f, continuous_toUnitTorusFun hf hper⟩ diff --git a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/PositionSpace.lean b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/PositionSpace.lean index 47099aff02..6b55dc0aa6 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/PositionSpace.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/PositionSpace.lean @@ -43,7 +43,7 @@ its smoothness, periodicity, and non-negativity properties. `convexComboScalar_nonneg` — properties of the scalar coefficient. -/ -@[expose] public section +public section open scoped BigOperators ContDiff open Complex Real MeasureTheory @@ -60,7 +60,7 @@ variable {n : ℕ} /-- The position-space Riemann-sum operator `r_M^φ u(x) = δⁿ ∑_z φ^per(x - z) · u_check(z)`, where `δ = 2π/M` and `u_check` is the continuous representative of `u`. -/ -def positionSpaceRiemann (n : ℕ) (φ : (Fin n → ℝ) → ℂ) +@[expose] def positionSpaceRiemann (n : ℕ) (φ : (Fin n → ℝ) → ℂ) (u : TrigPolyDual n) (M : ℕ) (x : Fin n → ℝ) : ℂ := let δ := (2 * Real.pi / (M : ℝ)) ((δ ^ n : ℝ) : ℂ) * ∑ k : Fin n → Fin M, @@ -219,7 +219,7 @@ lemma riemannSumDistrib_memSobolevDistrib {φ : (Fin n → ℝ) → ℂ} `f_k` is non-negative, smooth, and `2πℤⁿ`-periodic — yielding the scalar weights in the convex-combination approximation of smooth metrics. -/ -def convexComboScalar (n : ℕ) (φ : (Fin n → ℝ) → ℂ) (M : ℕ) +@[expose] def convexComboScalar (n : ℕ) (φ : (Fin n → ℝ) → ℂ) (M : ℕ) (k : Fin n → Fin M) (x : Fin n → ℝ) : ℝ := (2 * Real.pi / (M : ℝ)) ^ n * (periodicExtension n φ (fun j => x j - meshPoint n M k j)).re diff --git a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Resolvent.lean b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Resolvent.lean index 228e8e4166..2beb0020d4 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Resolvent.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Resolvent.lean @@ -27,7 +27,7 @@ isometry `ℓ²_(s) → ℓ²_(s+2)` and commutes with the formal derivatives fixed-point operator in Theorem B. -/ -@[expose] public section +public section open scoped BigOperators open NashEmbedding.Sobolev @@ -40,11 +40,11 @@ namespace NashEmbedding.Sobolev variable {n : ℕ} /-- The (positive) Laplacian on coefficients: `(Δa)ₘ = |m|² aₘ`. -/ -def laplacianCoeff (a : (Fin n → ℤ) → ℂ) (m : Fin n → ℤ) : ℂ := +@[expose] def laplacianCoeff (a : (Fin n → ℤ) → ℂ) (m : Fin n → ℤ) : ℂ := ((∑ i : Fin n, ((m i : ℝ) ^ 2) : ℝ) : ℂ) * a m /-- The resolvent `(I + Δ)⁻¹` on coefficients: `aₘ / (1 + |m|²)`. -/ -def resolventCoeff (a : (Fin n → ℤ) → ℂ) (m : Fin n → ℤ) : ℂ := +@[expose] def resolventCoeff (a : (Fin n → ℤ) → ℂ) (m : Fin n → ℤ) : ℂ := a m / ((1 + ∑ i : Fin n, ((m i : ℝ) ^ 2) : ℝ) : ℂ) lemma weight_one (m : Fin n → ℤ) : weight n 1 m = 1 + ∑ i : Fin n, ((m i : ℝ) ^ 2) := by diff --git a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/RiemannSum.lean b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/RiemannSum.lean index 0d737b6e89..bbe09da48f 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/RiemannSum.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/RiemannSum.lean @@ -37,7 +37,7 @@ its convergence to the convolution `φ * u` in `H^s_{2πℤⁿ}(ℝⁿ)` as `M * `riemannSum_convergence` — `R^φ_M u → φ * u` in `H^s` as `M → ∞` -/ -@[expose] public section +public section open scoped BigOperators ComplexConjugate open Complex Real NashEmbedding.Sobolev MeasureTheory @@ -61,7 +61,7 @@ def meshPoint (n : ℕ) (M : ℕ) (k : Fin n → Fin M) : Fin n → ℝ := /-- The discrete Fourier coefficient `K_M(m) = (2π/M)ⁿ ∑_k u_check(z_k) e^{-im·z_k}` where `u_check = fourierSynthesis n (fourierCoeffDistrib u)`. -/ -def riemannK (n : ℕ) (u : TrigPolyDual n) (M : ℕ) (m : Fin n → ℤ) : ℂ := +@[expose] def riemannK (n : ℕ) (u : TrigPolyDual n) (M : ℕ) (m : Fin n → ℤ) : ℂ := (((2 * π / (M : ℝ)) ^ n : ℝ) : ℂ) * ∑ k : Fin n → Fin M, fourierSynthesis n (fourierCoeffDistrib u) (meshPoint n M k) * @@ -73,7 +73,7 @@ def riemannK (n : ℕ) (u : TrigPolyDual n) (M : ℕ) (m : Fin n → ℤ) : ℂ `(R^φ_M u)^(m) = (2π)^{-n} · φ̂(m) · K_M(m)`. When `supp(φ) ⊂ (-π,π)ⁿ`, this equals `integrationEmbed n (r^φ_δ u)` where `r^φ_δ u(x) = δⁿ ∑_z φ^per(x-z) u_check(z)`. -/ -def riemannSumDistrib (n : ℕ) (φ : (Fin n → ℝ) → ℂ) +@[expose] def riemannSumDistrib (n : ℕ) (φ : (Fin n → ℝ) → ℂ) (u : TrigPolyDual n) (M : ℕ) : TrigPolyDual n := seqToDual n (fun m => (((2 * π : ℝ) ^ n : ℝ) : ℂ)⁻¹ * @@ -93,7 +93,7 @@ lemma fourierCoeffDistrib_riemannSumDistrib (φ : (Fin n → ℝ) → ℂ) /-- The condition that `φ̂|_{ℤⁿ}` has rapid decay: lies in `ℓ²_{(s)}` for every `s`. This holds for `φ ∈ C_c^∞(ℝⁿ; ℂ)` by iterated integration by parts. -/ -def FTRapidDecay (n : ℕ) (φ : (Fin n → ℝ) → ℂ) : Prop := +@[expose] def FTRapidDecay (n : ℕ) (φ : (Fin n → ℝ) → ℂ) : Prop := ∀ s : ℝ, Summable (fun m : Fin n → ℤ => weight n s m * ‖ftRn n φ (fun j => (m j : ℝ))‖ ^ 2) diff --git a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Summability.lean b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Summability.lean index 6581d59e13..1820b5d192 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Summability.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/Summability.lean @@ -29,7 +29,7 @@ This file contains: * Absolute and uniform convergence of Fourier series under ℓ¹ summability. -/ -@[expose] public section +public section open scoped BigOperators open NashEmbedding.Sobolev diff --git a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/SynthesisRegularity.lean b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/SynthesisRegularity.lean index d42e603dc2..89a926794e 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Sobolev/SynthesisRegularity.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Sobolev/SynthesisRegularity.lean @@ -42,7 +42,7 @@ Conventions: `fourierSynthesis n a θ = ∑' m, a m * fourierExp n m θ` with smoothness is `ContDiff ℝ ∞` (`open scoped ContDiff`), never `⊤`. -/ -@[expose] public section +public section open scoped BigOperators ContDiff open NashEmbedding.Sobolev Complex @@ -57,7 +57,7 @@ variable {n : ℕ} /-- A coefficient sequence is *rapidly decaying* if it lies in every weighted `ℓ²_(s)`, `s ∈ ℝ`. This is the momentum-space image of `C^∞(𝕋ⁿ)` (cf. `smooth_periodic_memSobolevDistrib`). -/ -def IsRapidDecay (n : ℕ) (a : (Fin n → ℤ) → ℂ) : Prop := +@[expose] def IsRapidDecay (n : ℕ) (a : (Fin n → ℤ) → ℂ) : Prop := ∀ s : ℝ, MemSobolev n s a /-! ## Elementary consequences of rapid decay -/ diff --git a/LeanPool/NashEmbedding/NashEmbedding/Torus/Approximation/BumpConstruction.lean b/LeanPool/NashEmbedding/NashEmbedding/Torus/Approximation/BumpConstruction.lean index e7379dc386..0fab1e0fa8 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Torus/Approximation/BumpConstruction.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Torus/Approximation/BumpConstruction.lean @@ -39,7 +39,7 @@ matrix `∫ ∂ᵢψ ∂ⱼψ` (diagonal, explicit). `∫ dil β · (dil β)' = 0`. -/ -@[expose] public section +public section open scoped BigOperators ContDiff open MeasureTheory Real @@ -270,7 +270,7 @@ lemma fderiv_prodBump_single (β : Fin n → ℝ) (y : Fin n → ℝ) (i : Fin n /-! ## The Gram matrix -/ /-- The Gram matrix `∫ ∂ᵢχ ∂ⱼχ` of a real function on `ℝⁿ`. -/ -def gram (χ : (Fin n → ℝ) → ℝ) (i j : Fin n) : ℝ := +@[expose] def gram (χ : (Fin n → ℝ) → ℝ) (i j : Fin n) : ℝ := ∫ x, fderiv ℝ χ x (Pi.single i 1) * fderiv ℝ χ x (Pi.single j 1) /-- The Gram matrix of the product bump is diagonal with explicit entries. -/ diff --git a/LeanPool/NashEmbedding/NashEmbedding/Torus/Approximation/RealizeMetric.lean b/LeanPool/NashEmbedding/NashEmbedding/Torus/Approximation/RealizeMetric.lean index 626e0e392f..1ac52c20a2 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Torus/Approximation/RealizeMetric.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Torus/Approximation/RealizeMetric.lean @@ -33,7 +33,7 @@ positive-definite smooth metric is an `H^s`-limit of realizable ones. * `realizable_approx_all_s` — Theorem A for every `s` (the form used by `nashTorus`). -/ -@[expose] public section +public section open scoped BigOperators ContDiff open MeasureTheory Real Matrix @@ -490,6 +490,7 @@ lemma ftRn_cplx_zero {F : (Fin n → ℝ) → ℝ} : /-! ## Realization of `f · B` -/ /-- Entrywise Sobolev discrepancy between the Gram of `U` and a target matrix function. -/ +@[expose] def gramDefect (n : ℕ) {N : ℕ} (U : (Fin n → ℝ) → (Fin N → ℝ)) (G : (Fin n → ℝ) → Matrix (Fin n) (Fin n) ℝ) (i j : Fin n) : NashEmbedding.Sobolev.TrigPolyDual n := diff --git a/LeanPool/NashEmbedding/NashEmbedding/Torus/Approximation/SmoothMetricApprox.lean b/LeanPool/NashEmbedding/NashEmbedding/Torus/Approximation/SmoothMetricApprox.lean index 909dc4da3e..a12868cf5f 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Torus/Approximation/SmoothMetricApprox.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Torus/Approximation/SmoothMetricApprox.lean @@ -46,7 +46,7 @@ real-imaginary decomposition of `periodicExtension`, linearity of `integrationEmbed`, and `sobolevNormSqDistrib_triangle`). -/ -@[expose] public section +public section open scoped BigOperators ContDiff open Complex Real NashEmbedding.Sobolev MeasureTheory Matrix diff --git a/LeanPool/NashEmbedding/NashEmbedding/Torus/Assembly.lean b/LeanPool/NashEmbedding/NashEmbedding/Torus/Assembly.lean index 572397b7ab..2818d09034 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Torus/Assembly.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Torus/Assembly.lean @@ -32,7 +32,7 @@ Theorem B's smallness measure `hSize`, and the metric-splitting step of Wasserma `posDefSmoothMetric_stability`). -/ -@[expose] public section +public section open scoped BigOperators ContDiff open NashEmbedding.Sobolev Matrix @@ -67,6 +67,7 @@ lemma hSize_smul (c : ℝ) (h : (Fin n → ℝ) → Matrix (Fin n) (Fin n) ℝ) /-! ## Gram matrices -/ /-- The Gram matrix `∂ᵢu · ∂ⱼu` of a map. -/ +@[expose] def gramMetric (u : (Fin n → ℝ) → (Fin N → ℝ)) : (Fin n → ℝ) → Matrix (Fin n) (Fin n) ℝ := fun x i j => pderiv i u x ⬝ᵥ pderiv j u x diff --git a/LeanPool/NashEmbedding/NashEmbedding/Torus/Basic.lean b/LeanPool/NashEmbedding/NashEmbedding/Torus/Basic.lean index 101b8cad5d..7022ce0b0f 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Torus/Basic.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Torus/Basic.lean @@ -26,7 +26,7 @@ Periodicity, smooth periodic functions, smooth metrics, realizable metrics, injective embeddings, flat torus embedding. -/ -@[expose] public section +public section open scoped BigOperators ContDiff open Matrix NashEmbedding.Sobolev @@ -80,19 +80,19 @@ lemma IsPosDefSmoothMetric.toIsSmoothMetric {n : ℕ} /-- The partial derivative of `u : ℝⁿ → ℝᴺ` with respect to the `i`-th coordinate, defined as the Fréchet derivative applied to the `i`-th standard basis vector. -/ -def partialDeriv {n N : ℕ} (i : Fin n) (u : (Fin n → ℝ) → (Fin N → ℝ)) +@[expose] def partialDeriv {n N : ℕ} (i : Fin n) (u : (Fin n → ℝ) → (Fin N → ℝ)) (x : Fin n → ℝ) : Fin N → ℝ := fderiv ℝ u x (Pi.single i 1) /-- `u` realizes `g` if `∂ᵢu(x) · ∂ⱼu(x) = g(x)ᵢⱼ` for all `x, i, j`. -/ -def Realizes {n N : ℕ} (u : (Fin n → ℝ) → (Fin N → ℝ)) +@[expose] def Realizes {n N : ℕ} (u : (Fin n → ℝ) → (Fin N → ℝ)) (g : (Fin n → ℝ) → Matrix (Fin n) (Fin n) ℝ) : Prop := ∀ (x : Fin n → ℝ) (i j : Fin n), dotProduct (partialDeriv i u x) (partialDeriv j u x) = g x i j /-- A smooth metric `g` is realizable if there exist `N` and a smooth periodic `u : ℝⁿ → ℝᴺ` realizing it. -/ -def IsRealizable {n : ℕ} (g : (Fin n → ℝ) → Matrix (Fin n) (Fin n) ℝ) : Prop := +@[expose] def IsRealizable {n : ℕ} (g : (Fin n → ℝ) → Matrix (Fin n) (Fin n) ℝ) : Prop := ∃ (N : ℕ) (u : (Fin n → ℝ) → (Fin N → ℝ)), SmoothPeriodic u ∧ Realizes u g @@ -104,19 +104,19 @@ def concat {n N₁ N₂ : ℕ} (u₁ : (Fin n → ℝ) → (Fin N₁ → ℝ)) fun x => Fin.append (u₁ x) (u₂ x) /-- Translation of a function: `(τ_y f)(x) = f(x - y)`. -/ -def translate {n : ℕ} {V : Type*} (y : Fin n → ℝ) (f : (Fin n → ℝ) → V) : +@[expose] def translate {n : ℕ} {V : Type*} (y : Fin n → ℝ) (f : (Fin n → ℝ) → V) : (Fin n → ℝ) → V := fun x => f (x - y) /-! ## Injective embeddings -/ /-- Injectivity modulo `2πℤⁿ`: `u(x) = u(y)` implies `x - y ∈ 2πℤⁿ`. -/ -def IsInjectiveMod2Pi {n N : ℕ} (u : (Fin n → ℝ) → (Fin N → ℝ)) : Prop := +@[expose] def IsInjectiveMod2Pi {n N : ℕ} (u : (Fin n → ℝ) → (Fin N → ℝ)) : Prop := ∀ (x y : Fin n → ℝ), u x = u y → ∃ k : Fin n → ℤ, x - y = periodicShift n k /-- Full-rank derivative: the partial derivatives `{∂ᵢu(x)}` are linearly independent in `ℝᴺ` at every `x`. -/ -def HasFullRankDeriv {n N : ℕ} (u : (Fin n → ℝ) → (Fin N → ℝ)) : Prop := +@[expose] def HasFullRankDeriv {n N : ℕ} (u : (Fin n → ℝ) → (Fin N → ℝ)) : Prop := ∀ (x : Fin n → ℝ), LinearIndependent ℝ (fun i : Fin n => partialDeriv i u x) /-- An injective embedding: smooth periodic, injective modulo `2πℤⁿ`, @@ -129,7 +129,7 @@ structure IsInjectiveEmbedding {n N : ℕ} /-- A smooth metric `g` is injectively realizable if there exist `N` and an injective embedding `u` realizing it. -/ -def IsInjRealizable {n : ℕ} +@[expose] def IsInjRealizable {n : ℕ} (g : (Fin n → ℝ) → Matrix (Fin n) (Fin n) ℝ) : Prop := ∃ (N : ℕ) (u : (Fin n → ℝ) → (Fin N → ℝ)), IsInjectiveEmbedding u ∧ Realizes u g @@ -147,18 +147,18 @@ lemma IsInjRealizable.toIsRealizable {n : ℕ} `u_flat(x) = (cos x₁, sin x₁, cos x₂, sin x₂, …, cos xₙ, sin xₙ)`. For `k : Fin (2n)`, the component is `cos(x_{k/2})` if `k` is even, and `sin(x_{k/2})` if `k` is odd. -/ -def flatTorusEmb (n : ℕ) : (Fin n → ℝ) → (Fin (2 * n) → ℝ) := +@[expose] def flatTorusEmb (n : ℕ) : (Fin n → ℝ) → (Fin (2 * n) → ℝ) := fun x k => let i : Fin n := ⟨k.val / 2, by omega⟩ if k.val % 2 = 0 then Real.cos (x i) else Real.sin (x i) /-- The flat metric `g_flat = Iₙ` (the identity matrix). -/ -def flatMetric (n : ℕ) : (Fin n → ℝ) → Matrix (Fin n) (Fin n) ℝ := +@[expose] def flatMetric (n : ℕ) : (Fin n → ℝ) → Matrix (Fin n) (Fin n) ℝ := fun _ => 1 /-- The operator norm of a matrix, defined as the norm of the associated continuous linear map on `ℝⁿ` (with the sup norm on `Fin n → ℝ`). -/ -def matOpNorm {n : ℕ} (A : Matrix (Fin n) (Fin n) ℝ) : ℝ := +@[expose] def matOpNorm {n : ℕ} (A : Matrix (Fin n) (Fin n) ℝ) : ℝ := ‖A.toLin'.toContinuousLinearMap‖ end NashEmbedding diff --git a/LeanPool/NashEmbedding/NashEmbedding/Torus/FreeEmbedding.lean b/LeanPool/NashEmbedding/NashEmbedding/Torus/FreeEmbedding.lean index f23226a935..f805317f73 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Torus/FreeEmbedding.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Torus/FreeEmbedding.lean @@ -31,7 +31,7 @@ vanish. The map is defined on a structured index type and transported to `Fin N` `Fintype.equivFin`. -/ -@[expose] public section +public section open scoped BigOperators ContDiff open NashEmbedding.Sobolev Matrix @@ -54,7 +54,7 @@ def freeEmb₀ (n : ℕ) (x : Fin n → ℝ) : FreeIdx n → ℝ | Sum.inr (Sum.inr (Sum.inr p)) => Real.sin (x p.1.1 + x p.1.2) /-- The dimension `N = |FreeIdx n|`. -/ -def freeDim (n : ℕ) : ℕ := Fintype.card (FreeIdx n) +@[expose] def freeDim (n : ℕ) : ℕ := Fintype.card (FreeIdx n) /-- The free embedding `ℝⁿ → ℝᴺ`, `2πℤⁿ`-periodic. -/ def freeEmb (n : ℕ) : (Fin n → ℝ) → (Fin (freeDim n) → ℝ) := diff --git a/LeanPool/NashEmbedding/NashEmbedding/Torus/Main.lean b/LeanPool/NashEmbedding/NashEmbedding/Torus/Main.lean index ff7d3bb88d..11cdbea046 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Torus/Main.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Torus/Main.lean @@ -44,7 +44,7 @@ The injective piece comes from adjoining a `√δ'`-scaled flat-torus embedding. `2πℤⁿ`-periodic metric is injectively realizable. -/ -@[expose] public section +public section open scoped BigOperators ContDiff open NashEmbedding.Sobolev Matrix diff --git a/LeanPool/NashEmbedding/NashEmbedding/Torus/Perturbation/DualFrame.lean b/LeanPool/NashEmbedding/NashEmbedding/Torus/Perturbation/DualFrame.lean index 362490d465..42d39b065e 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Torus/Perturbation/DualFrame.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Torus/Perturbation/DualFrame.lean @@ -32,7 +32,7 @@ In Theorem B (Günther's perturbation theorem) this is applied to the frame is solved pointwise. Periodicity of the dual frame is inherited pointwise. -/ -@[expose] public section +public section open scoped BigOperators ContDiff open NashEmbedding.Sobolev Matrix @@ -82,7 +82,7 @@ def gramMatrix (e : ι → (Fin n → ℝ) → (Fin N → ℝ)) (x : Fin n → /-- A family of vector fields is *pointwise linearly independent* if the vectors `e i x`, `i : ι`, are linearly independent for every `x`. -/ -def IsPointwiseLinIndep (e : ι → (Fin n → ℝ) → (Fin N → ℝ)) : Prop := +@[expose] def IsPointwiseLinIndep (e : ι → (Fin n → ℝ) → (Fin N → ℝ)) : Prop := ∀ x, LinearIndependent ℝ (fun i => e i x) /-- The Gram determinant of a pointwise linearly independent family never vanishes. -/ diff --git a/LeanPool/NashEmbedding/NashEmbedding/Torus/Perturbation/GuntherIdentity.lean b/LeanPool/NashEmbedding/NashEmbedding/Torus/Perturbation/GuntherIdentity.lean index 3d4100d7e7..55f37e4afd 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Torus/Perturbation/GuntherIdentity.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Torus/Perturbation/GuntherIdentity.lean @@ -35,7 +35,7 @@ target so that scalar and vector-valued maps are handled uniformly; `NashEmbedding.partialDeriv` is its specialisation to `Fin N → ℝ`. -/ -@[expose] public section +public section open scoped BigOperators ContDiff Matrix open Matrix @@ -48,7 +48,7 @@ namespace NashEmbedding variable {n : ℕ} /-- Coordinate partial derivative `∂ᵢ f (x) = Df(x)(eᵢ)` for maps into any normed space. -/ -def pderiv {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] +@[expose] def pderiv {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] (i : Fin n) (f : (Fin n → ℝ) → V) (x : Fin n → ℝ) : V := fderiv ℝ f x (Pi.single i 1) @@ -56,7 +56,7 @@ lemma pderiv_eq_partialDeriv {N : ℕ} (i : Fin n) (u : (Fin n → ℝ) → (Fin pderiv i u = partialDeriv i u := rfl /-- The sum-of-squares operator `L f = ∑ₖ ∂ₖ∂ₖ f` (so `Δ = -L`). -/ -def sumSqDeriv {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] +@[expose] def sumSqDeriv {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] (f : (Fin n → ℝ) → V) : (Fin n → ℝ) → V := fun x => ∑ k : Fin n, pderiv k (pderiv k f) x diff --git a/LeanPool/NashEmbedding/NashEmbedding/Torus/Perturbation/GuntherIdentitySeq.lean b/LeanPool/NashEmbedding/NashEmbedding/Torus/Perturbation/GuntherIdentitySeq.lean index f81882b4eb..2a6006ef08 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Torus/Perturbation/GuntherIdentitySeq.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Torus/Perturbation/GuntherIdentitySeq.lean @@ -35,7 +35,7 @@ ansatz of Theorem B. The dictionary between real maps `ℝⁿ → ℝᴺ` and ve (`vcoeff`, `vsynth`) is set up here as well. -/ -@[expose] public section +public section open scoped BigOperators ContDiff open NashEmbedding.Sobolev Matrix @@ -50,13 +50,15 @@ variable {n N : ℕ} /-! ## Real maps ↔ vector sequences -/ /-- Componentwise rapid decay. -/ -def VRapid (n N : ℕ) (v : VecSeq n N) : Prop := ∀ α, IsRapidDecay n (v α) +@[expose] def VRapid (n N : ℕ) (v : VecSeq n N) : Prop := + ∀ α, IsRapidDecay n (v α) /-- Componentwise `conjReflect`-fixed: the coefficients of a real-valued map. -/ -def VReal (v : VecSeq n N) : Prop := ∀ α, conjReflect (v α) = v α +@[expose] def VReal (v : VecSeq n N) : Prop := + ∀ α, conjReflect (v α) = v α /-- The coefficient sequences of a real map `u : ℝⁿ → ℝᴺ`. -/ -def vcoeff (n : ℕ) (u : (Fin n → ℝ) → (Fin N → ℝ)) : VecSeq n N := +@[expose] def vcoeff (n : ℕ) (u : (Fin n → ℝ) → (Fin N → ℝ)) : VecSeq n N := fun α => stdFourierCoeff n (fun x => ((u x α : ℝ) : ℂ)) /-- The (real) synthesis of a vector sequence. -/ diff --git a/LeanPool/NashEmbedding/NashEmbedding/Torus/Perturbation/GuntherIteration.lean b/LeanPool/NashEmbedding/NashEmbedding/Torus/Perturbation/GuntherIteration.lean index 1ccd2b5818..4032e07d92 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Torus/Perturbation/GuntherIteration.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Torus/Perturbation/GuntherIteration.lean @@ -42,7 +42,7 @@ Rellich compactness is not used. This is the analytic core of Theorem B; the con Günther operator is shown to satisfy (E1), (E2) in `GuntherOperator.lean`. -/ -@[expose] public section +public section open scoped BigOperators open Filter Topology NashEmbedding.Sobolev diff --git a/LeanPool/NashEmbedding/NashEmbedding/Torus/Perturbation/GuntherOperator.lean b/LeanPool/NashEmbedding/NashEmbedding/Torus/Perturbation/GuntherOperator.lean index 8403825bd8..8bafedc67b 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Torus/Perturbation/GuntherOperator.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Torus/Perturbation/GuntherOperator.lean @@ -49,7 +49,7 @@ iteration (`GuntherIteration.lean`): All constants are explicit `def`s; no attempt is made to optimize them. -/ -@[expose] public section +public section open scoped BigOperators open Filter Topology NashEmbedding.Sobolev @@ -67,19 +67,21 @@ abbrev Seq (n : ℕ) := (Fin n → ℤ) → ℂ /-! ## Operations on vector sequences -/ /-- Componentwise `∂ᵢ`. -/ -def vpartial (i : Fin n) (v : VecSeq n N) : VecSeq n N := fun α => partialCoeff i (v α) +@[expose] def vpartial (i : Fin n) (v : VecSeq n N) : VecSeq n N := fun α => partialCoeff i (v α) /-- Componentwise `L = ∑ₖ ∂ₖ² = -Δ`, i.e. the multiplier `-|m|²`. -/ -def vlap (v : VecSeq n N) : VecSeq n N := fun α m => -(laplacianCoeff (v α) m) +@[expose] def vlap (v : VecSeq n N) : VecSeq n N := + fun α m => -(laplacianCoeff (v α) m) /-- Componentwise `R = (I - L)⁻¹ = (I + Δ)⁻¹`. -/ def vresolvent (v : VecSeq n N) : VecSeq n N := fun α => resolventCoeff (v α) /-- The dot product of two vector sequences: `∑ α, (v α) ⊛ (w α)`. -/ -def dotConv (v w : VecSeq n N) : Seq n := fun m => ∑ α, seqConv (v α) (w α) m +@[expose] def dotConv (v w : VecSeq n N) : Seq n := + fun m => ∑ α, seqConv (v α) (w α) m /-- Multiplication of a vector sequence by a scalar sequence: `(f ⊛ a α)_α`. -/ -def smulSeq (f : Seq n) (a : VecSeq n N) : VecSeq n N := fun α => seqConv f (a α) +@[expose] def smulSeq (f : Seq n) (a : VecSeq n N) : VecSeq n N := fun α => seqConv f (a α) /-- The lower-order bucket of the tame estimate at level `k`: `‖v‖²_(k-1)‖w‖²_(r) + ‖v‖²_(r)‖w‖²_(k-1) + ‖v‖²_(r)‖w‖²_(r)`. -/ @@ -923,19 +925,20 @@ theorem scalarTame_resolvent_dotConv (hn : 0 < n) {r : ℕ} (hr : 1 + (n : ℝ) /-! ## The Günther operator -/ /-- Polarized `Fᵢ`: `Fb i v w = -R(Lv · ∂ᵢw)`. -/ -def Fb (i : Fin n) (v w : VecSeq n N) : Seq n := +@[expose] def Fb (i : Fin n) (v w : VecSeq n N) : Seq n := fun m => -(resolventCoeff (dotConv (vlap v) (vpartial i w)) m) /-- Polarized `Uᵢⱼ`: `Ub i j v w = R(∂ᵢv · ∂ⱼw) + 2 R(Lv · ∂ᵢ∂ⱼw) - 2 R(∑ₖ ∂ᵢ∂ₖv · ∂ⱼ∂ₖw)`. -/ -def Ub (i j : Fin n) (v w : VecSeq n N) : Seq n := +@[expose] def Ub (i j : Fin n) (v w : VecSeq n N) : Seq n := fun m => resolventCoeff (dotConv (vpartial i v) (vpartial j w)) m + (2 : ℂ) * resolventCoeff (dotConv (vlap v) (vpartial i (vpartial j w))) m - (2 : ℂ) * ∑ k, resolventCoeff (dotConv (vpartial i (vpartial k v)) (vpartial j (vpartial k w))) m /-- The index set of the second-derivative frame: pairs `p ≤ q`. -/ -def pairs (n : ℕ) : Finset (Fin n × Fin n) := Finset.univ.filter fun pq => pq.1 ≤ pq.2 +@[expose] def pairs (n : ℕ) : Finset (Fin n × Fin n) := + Finset.univ.filter fun pq => pq.1 ≤ pq.2 /-- The data of the Günther operator on the momentum side: the dual frame `a i`, `b p q` (only `p ≤ q` is used) and the metric perturbation `h p q`, all as coefficient sequences. -/ @@ -948,12 +951,12 @@ structure GuntherData (n N : ℕ) where h : Fin n → Fin n → Seq n /-- The bilinear part: `B v w = -∑ᵢ Fb i v w · aᵢ + ∑_{p≤q} ½ Ub p q v w · b_{pq}`. -/ -def gB (d : GuntherData n N) (v w : VecSeq n N) : VecSeq n N := +@[expose] def gB (d : GuntherData n N) (v w : VecSeq n N) : VecSeq n N := -(∑ i, smulSeq (Fb i v w) (d.a i)) + ∑ pq ∈ pairs n, smulSeq (fun m => (1 / 2 : ℂ) * Ub pq.1 pq.2 v w m) (d.b pq.1 pq.2) /-- The constant part: `c = -∑_{p≤q} ½ h_{pq} · b_{pq}`. -/ -def gC (d : GuntherData n N) : VecSeq n N := +@[expose] def gC (d : GuntherData n N) : VecSeq n N := -(∑ pq ∈ pairs n, smulSeq (fun m => (1 / 2 : ℂ) * d.h pq.1 pq.2 m) (d.b pq.1 pq.2)) /-- `T v = c + B v v`. -/ @@ -1022,12 +1025,12 @@ theorem scalarTame_Ub (hn : 0 < n) {r : ℕ} (hr : 1 + (n : ℝ) / 2 < (r : ℝ) exact h /-- Tame constants of `gB` (generous). -/ -def gBTop (n N r : ℕ) (d : GuntherData n N) : ℝ := +@[expose] def gBTop (n N r : ℕ) (d : GuntherData n N) : ℝ := 2 * (n * ∑ i, smulTopConst n N r (d.a i) (FbTop n N r) + (pairs n).card * ∑ pq ∈ pairs n, smulTopConst n N r (d.b pq.1 pq.2) ((1 / 2) ^ 2 * UbTop n N r)) /-- Lower-order tame constant for the complete bilinear Günther operator. -/ -def gBLow (n N r : ℕ) (d : GuntherData n N) (k : ℕ) : ℝ := +@[expose] def gBLow (n N r : ℕ) (d : GuntherData n N) (k : ℕ) : ℝ := 2 * (n * ∑ i, smulLowConst n N r (d.a i) (FbTop n N r) (FbLow n N r) k + (pairs n).card * ∑ pq ∈ pairs n, smulLowConst n N r (d.b pq.1 pq.2) ((1 / 2) ^ 2 * UbTop n N r) (fun k => (1 / 2) ^ 2 * @@ -1090,7 +1093,8 @@ lemma gC_mem (hn : 0 < n) {r : ℕ} (hr : 1 + (n : ℝ) / 2 < r) (d : GuntherDat /-- The `E1` constant derived from the tame estimate at level `r`: `‖B v w‖²_(r) ≤ (2 A' + 3 Bᵣ) ‖v‖²_(r) ‖w‖²_(r)`. -/ -def gA (n N r : ℕ) (d : GuntherData n N) : ℝ := 2 * gBTop n N r d + 3 * gBLow n N r d r +@[expose] def gA (n N r : ℕ) (d : GuntherData n N) : ℝ := + 2 * gBTop n N r d + 3 * gBLow n N r d r /-- **The Günther operator satisfies the hypotheses of the abstract iteration.** -/ theorem gunther_iterHyp (hn : 0 < n) {r : ℕ} (hr : 1 + (n : ℝ) / 2 < (r : ℝ) - 2) diff --git a/LeanPool/NashEmbedding/NashEmbedding/Torus/Perturbation/Main.lean b/LeanPool/NashEmbedding/NashEmbedding/Torus/Perturbation/Main.lean index 47494b53c5..68b59d7398 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Torus/Perturbation/Main.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Torus/Perturbation/Main.lean @@ -44,7 +44,7 @@ Proof shape: * `gunther_perturbation` — Günther's perturbation theorem (Wassermann's Theorem B). -/ -@[expose] public section +public section open scoped BigOperators ContDiff open Filter Topology NashEmbedding.Sobolev Matrix @@ -62,12 +62,12 @@ variable {n N : ℕ} abbrev FrameIdx (n : ℕ) := Fin n ⊕ {pq : Fin n × Fin n // pq.1 ≤ pq.2} /-- The frame `{∂ᵢu} ∪ {∂ₚ∂_q u}_{p ≤ q}` of a map `u`. -/ -def frame (u : (Fin n → ℝ) → (Fin N → ℝ)) : FrameIdx n → (Fin n → ℝ) → (Fin N → ℝ) +@[expose] def frame (u : (Fin n → ℝ) → (Fin N → ℝ)) : FrameIdx n → (Fin n → ℝ) → (Fin N → ℝ) | Sum.inl i => pderiv i u | Sum.inr pq => pderiv pq.1.1 (pderiv pq.1.2 u) /-- A map is *free* if its frame is linearly independent at every point. -/ -def IsFree (u : (Fin n → ℝ) → (Fin N → ℝ)) : Prop := IsPointwiseLinIndep (frame u) +@[expose] def IsFree (u : (Fin n → ℝ) → (Fin N → ℝ)) : Prop := IsPointwiseLinIndep (frame u) lemma frame_smoothPeriodic {u : (Fin n → ℝ) → (Fin N → ℝ)} (hu : SmoothPeriodic u) : ∀ k, SmoothPeriodic (frame u k) @@ -103,13 +103,13 @@ attribute [irreducible] bLevel /-- The `H^r` size of a matrix-valued perturbation: the sum over entries of the squared `H^r` norms of the coefficient sequences. -/ -def hSize (n : ℕ) (h : (Fin n → ℝ) → Matrix (Fin n) (Fin n) ℝ) : ℝ := +@[expose] def hSize (n : ℕ) (h : (Fin n → ℝ) → Matrix (Fin n) (Fin n) ℝ) : ℝ := ∑ i, ∑ j, sobolevNormSq n (bLevel n) (stdFourierCoeff n (fun x => ((h x i j : ℝ) : ℂ))) /-! ## The momentum-side data -/ /-- The Günther data of `u₀` and `h`: coefficients of the dual frame and of `h`. -/ -def bData (n : ℕ) (u₀ : (Fin n → ℝ) → (Fin N → ℝ)) +@[expose] def bData (n : ℕ) (u₀ : (Fin n → ℝ) → (Fin N → ℝ)) (h : (Fin n → ℝ) → Matrix (Fin n) (Fin n) ℝ) : GuntherData n N where a i := vcoeff n (dualA u₀ i) b p q := vcoeff n (dualB u₀ p q) diff --git a/LeanPool/NashEmbedding/NashEmbedding/Torus/Perturbation/SeqVector.lean b/LeanPool/NashEmbedding/NashEmbedding/Torus/Perturbation/SeqVector.lean index ee6d429f25..731391db59 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Torus/Perturbation/SeqVector.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Torus/Perturbation/SeqVector.lean @@ -27,7 +27,7 @@ This file lifts the scalar facts of `SobolevLimits` (quasi-triangle inequalities Cauchy limits) to vector sequences. They are consumed by the abstract Günther iteration. -/ -@[expose] public section +public section open scoped BigOperators open Filter Topology NashEmbedding.Sobolev @@ -43,10 +43,11 @@ abbrev VecSeq (n N : ℕ) := Fin N → (Fin n → ℤ) → ℂ variable {n N : ℕ} /-- Componentwise membership in `H^s`. -/ -def VMem (n N : ℕ) (s : ℝ) (v : VecSeq n N) : Prop := ∀ α, MemSobolev n s (v α) +@[expose] def VMem (n N : ℕ) (s : ℝ) (v : VecSeq n N) : Prop := + ∀ α, MemSobolev n s (v α) /-- Componentwise squared `H^s` norm: `∑ α, ‖v α‖²_(s)`. -/ -def vecNormSq (n N : ℕ) (s : ℝ) (v : VecSeq n N) : ℝ := ∑ α, sobolevNormSq n s (v α) +@[expose] def vecNormSq (n N : ℕ) (s : ℝ) (v : VecSeq n N) : ℝ := ∑ α, sobolevNormSq n s (v α) lemma vecNormSq_nonneg (s : ℝ) (v : VecSeq n N) : 0 ≤ vecNormSq n N s v := Finset.sum_nonneg fun α _ => sobolevNormSq_nonneg s (v α) diff --git a/LeanPool/NashEmbedding/NashEmbedding/Torus/RealizableMetrics.lean b/LeanPool/NashEmbedding/NashEmbedding/Torus/RealizableMetrics.lean index 813ff059e9..809d98798f 100644 --- a/LeanPool/NashEmbedding/NashEmbedding/Torus/RealizableMetrics.lean +++ b/LeanPool/NashEmbedding/NashEmbedding/Torus/RealizableMetrics.lean @@ -25,7 +25,7 @@ Closure properties, injective realization, flat torus, positive-definite metric and stability under perturbation. -/ -@[expose] public section +public section open scoped BigOperators ContDiff open Matrix NashEmbedding.Sobolev diff --git a/LeanPool/NashEmbedding/NashEmbeddingTest/Encoding.lean b/LeanPool/NashEmbedding/NashEmbeddingTest/Encoding.lean index f0bdfe6c10..f857859fcc 100644 --- a/LeanPool/NashEmbedding/NashEmbeddingTest/Encoding.lean +++ b/LeanPool/NashEmbedding/NashEmbeddingTest/Encoding.lean @@ -36,7 +36,7 @@ witnesses (zero, `flatTorusEmb`, `flatMetric`) all of which happen to be analytic. -/ -@[expose] public section +public section open scoped ContDiff open NashEmbedding NashEmbedding.Sobolev diff --git a/LeanPool/NashEmbedding/NashEmbeddingTest/MollifierConvergence.lean b/LeanPool/NashEmbedding/NashEmbeddingTest/MollifierConvergence.lean index af1d08f42f..a2ff645549 100644 --- a/LeanPool/NashEmbedding/NashEmbeddingTest/MollifierConvergence.lean +++ b/LeanPool/NashEmbedding/NashEmbeddingTest/MollifierConvergence.lean @@ -26,7 +26,7 @@ momentum-space delta `δ_{m₀}`: - **W3** — `mollifier_convergence` invoked on `δ_{m₀}`. -/ -@[expose] public section +public section open scoped BigOperators open NashEmbedding.Sobolev MeasureTheory diff --git a/LeanPool/NashEmbedding/NashEmbeddingTest/NashCompact.lean b/LeanPool/NashEmbedding/NashEmbeddingTest/NashCompact.lean index 29705687e0..12ea09ca77 100644 --- a/LeanPool/NashEmbedding/NashEmbeddingTest/NashCompact.lean +++ b/LeanPool/NashEmbedding/NashEmbeddingTest/NashCompact.lean @@ -32,7 +32,7 @@ Axiom guards for the top-level results live in `scripts/axioms.lean`; this file has no `#print axioms` blocks. -/ -@[expose] public section +public section open scoped Manifold ContDiff diff --git a/LeanPool/NashEmbedding/NashEmbeddingTest/NashTorus.lean b/LeanPool/NashEmbedding/NashEmbeddingTest/NashTorus.lean index 9c415f2011..5822a1a158 100644 --- a/LeanPool/NashEmbedding/NashEmbeddingTest/NashTorus.lean +++ b/LeanPool/NashEmbedding/NashEmbeddingTest/NashTorus.lean @@ -40,7 +40,7 @@ Tests are grouped by what they discriminate: - N6: the flat metric is realized by the expected explicit map. -/ -@[expose] public section +public section open scoped BigOperators ContDiff open NashEmbedding NashEmbedding.Sobolev Matrix diff --git a/LeanPool/NashEmbedding/NashEmbeddingTest/RealizableMetrics.lean b/LeanPool/NashEmbedding/NashEmbeddingTest/RealizableMetrics.lean index 6ab2757909..c1b606c648 100644 --- a/LeanPool/NashEmbedding/NashEmbeddingTest/RealizableMetrics.lean +++ b/LeanPool/NashEmbedding/NashEmbeddingTest/RealizableMetrics.lean @@ -26,7 +26,7 @@ Concrete witness checks for `NashEmbedding/Torus/RealizableMetrics.lean` and - **TN4** — `convex_combination_approx` invocation on the flat metric. -/ -@[expose] public section +public section open scoped BigOperators ContDiff open NashEmbedding NashEmbedding.Sobolev Matrix diff --git a/LeanPool/NashEmbedding/Solution.lean b/LeanPool/NashEmbedding/Solution.lean index d669ff0a83..b9727a485d 100644 --- a/LeanPool/NashEmbedding/Solution.lean +++ b/LeanPool/NashEmbedding/Solution.lean @@ -26,7 +26,7 @@ The underlying `NashEmbedding` development was substantially formalized by Aristotle (Harmonic); see the repository provenance record. -/ -@[expose] public section +public section open scoped Manifold ContDiff open Bundle 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..e185338326 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 @@ -112,6 +113,7 @@ theorem Data.lower_atOrder {T : ℝ} (A : Data period T) (q : ℕ) : /-- A single actual inverse-metric budget applies to every finite realization of the same coefficient field. -/ +@[expose] def Data.metricBudget {T : ℝ} (A : Data period T) (hT : 0 ≤ T) (K : MetricBudget period T hT (A.atOrder period 1)) (q : ℕ) : MetricBudget period T hT (A.atOrder period (q+1)) where 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..02f74f1176 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 @@ -48,6 +48,7 @@ variable (period : ℝ) [Fact (0 < period)] variable {T : ℝ} {hT : 0 < T} {A : Data period T} /-- The canonical pointwise nonlinear raw source of the actual common correction. -/ +@[expose] def FiniteFamily.pointRawSource (F : FiniteFamily period hT A) (t : Icc (0 : ℝ) T) (x : LiftDomain period) : Vector3 := pointEvaluation period x (restrictOperator period (by omega : 3 ≤ 6) @@ -111,7 +112,7 @@ end end -@[expose] public section +public section noncomputable section @@ -136,6 +137,7 @@ theorem Budget.solution_compatible (B : Budget period hT A) (q : ℕ) (hq : 6 (B.family period).compatible period (B.comparisonData period) q hq /-- The common continuous L² correction constructed by the small-drift solver. -/ +@[expose] def Budget.commonPath (B : Budget period hT A) : C(Icc (0 : ℝ) T, LiftL2 period) := (B.family period).commonPath period @@ -170,12 +172,13 @@ def Budget.commonJet (B : Budget period hT A) (n : ℕ) (t : Icc (0 : ℝ) T) : (B.family period).commonJet period (B.comparisonData period) n t /-- The common correction, with genuine continuous Sobolev realizations at all orders. -/ +@[expose] def Budget.fieldTower (B : Budget period hT A) : FieldTower period T := (B.family period).fieldTower period (B.comparisonData period) /-- The tower's underlying field is exactly the constructed common correction. -/ theorem Budget.fieldTower_field (B : Budget period hT A) : - (B.fieldTower period).field = B.commonPath period := rfl + (B.fieldTower period).field = B.commonPath period := by rfl /-- Every Sobolev realization of the common correction has zero initial data. -/ theorem Budget.fieldTower_initial (B : Budget period hT A) (q : ℕ) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftEquation.lean b/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftEquation.lean index 426cf4a79e..3557a22327 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 @@ -58,6 +58,7 @@ structure ApproximationResidual (hT : 0 < T) (A : Data period T) where (pressure.realization q ⟨t, ht.1.le, ht.2.le⟩)) t /-- The approximation plus the actually constructed correction, in every order. -/ +@[expose] def Budget.correctedFieldTower (B : Budget period hT A) : FieldTower period T where field := A.approximation.field + B.commonPath period realization q := A.approximation.realization q + (B.fieldTower period).realization q @@ -70,6 +71,7 @@ def Budget.correctedFieldTower (B : Budget period hT A) : FieldTower period T wh /-- The total pressure is the given approximate pressure plus the constructed signed correction pressure, with no independent choice at different orders. -/ +@[expose] def Budget.correctedPressureTower (B : Budget period hT A) (R : ApproximationResidual period hT A) : FieldTower period T where field := R.pressure.field + (B.pressureTower period).field diff --git a/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftFieldDecomposition.lean b/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftFieldDecomposition.lean index 376034f1ca..85b5298dc2 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 @@ -27,10 +27,10 @@ variable (P : ℝ) [Fact (0 < P)] {T : ℝ} {hT : 0 < T} {A : Data P T} (B : Budget P hT A) theorem Budget.correctedFieldTower_eq : - B.correctedFieldTower P = A.approximation.add (B.fieldTower P) := rfl + B.correctedFieldTower P = A.approximation.add (B.fieldTower P) := by rfl theorem Budget.correctedPressureTower_eq (R : ApproximationResidual P hT A) : - B.correctedPressureTower P R = R.pressure.add (B.pressureTower P) := rfl + B.correctedPressureTower P R = R.pressure.add (B.pressureTower P) := by rfl theorem Budget.correctedFieldTower_pointField (t : Icc (0 : ℝ) T) (x : LiftDomain P) : (B.correctedFieldTower P).pointField t x = diff --git a/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftFinite.lean b/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftFinite.lean index 9d42bc21cc..bd2a25d2b8 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 @@ -147,6 +147,7 @@ theorem finite_exists {T : ℝ} (hT : 0 < T) (A : Data period T) (B : Budget per exact (valueOperator period q).hasFDerivAt.comp_hasDerivAt t hs /-- The genuine finite solution chosen from the proved drift-aware construction. -/ +@[expose] def Budget.solution {T : ℝ} {hT : 0 < T} {A : Data period T} (B : Budget period hT A) (q : ℕ) (hq : 6 ≤ q) : C(Icc (0 : ℝ) T, SobolevSpace period (q+1)) := Classical.choose (finite_exists period hT A B q hq) @@ -163,6 +164,7 @@ theorem Budget.solution_energy {T : ℝ} {hT : 0 < T} {A : Data period T} (B : B /-- Actual drift-aware data construct the complete finite correction family; no finite-existence hypothesis is supplied. -/ +@[expose] def Budget.family {T : ℝ} {hT : 0 < T} {A : Data period T} (B : Budget period hT A) : FiniteFamily period hT A where solution := B.solution period 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..7d89007e97 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 @@ -30,6 +30,7 @@ variable (period : ℝ) [Fact (0 < period)] variable {T : ℝ} {hT : 0 < T} {A : Data period T} /-- The actual signed L² pressure of the family constructed from drift-aware budgets. -/ +@[expose] def Budget.commonPressure (B : Budget period hT A) : C(Icc (0 : ℝ) T, LiftL2 period) := (B.family period).commonPressure period @@ -47,6 +48,7 @@ theorem Budget.commonPressure_gradient (B : Budget period hT A) (t : Icc (0 : (B.family period).commonPressure_gradient period t /-- Actual continuous Sobolev realizations at every order of the same constructed pressure. -/ +@[expose] def Budget.pressureTower (B : Budget period hT A) : FieldTower period T := (B.family period).pressureTower period (B.comparisonData period) diff --git a/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftPressureBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftPressureBounds.lean index f7017fc09c..aba0438d50 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 @@ -59,21 +59,25 @@ def Budget.sourceSize (B : Budget period hT A) (q : ℕ) (hq : 6 ≤ q) : ℝ := (B.correctionSize period) ((8/B.initialRadius)*B.correctionSize period) /-- The factor in the correction bound after removing the common delta. -/ +@[expose] def Budget.baseCorrectionSize (B : Budget period hT A) : ℝ := metricAmplification B.metric.c/2 /-- An explicit source constant involving only the prescribed norm budgets and the reciprocal initial radius; it is independent of delta. -/ +@[expose] def Budget.sourceCost (B : Budget period hT A) (q : ℕ) (hq : 6 ≤ q) : ℝ := let S := (B.spatial q hq).full sourceBound period S.B0 S.B1 S.A0 S.A2 1 (B.baseCorrectionSize period) ((8/B.initialRadius)*B.baseCorrectionSize period) /-- Pressure cost, given by `2*(B.spatial q hq).full.M*B.sourceCost period q hq`. -/ +@[expose] def Budget.pressureCost (B : Budget period hT A) (q : ℕ) (hq : 6 ≤ q) : ℝ := 2*(B.spatial q hq).full.M*B.sourceCost period q hq /-- Time derivative cost, given by `(1+2*(B.spatial q hq).full.M*(448*(B.spatial q hq).full.B+1))*B.sourceCost period q hq`. -/ +@[expose] def Budget.timeDerivativeCost (B : Budget period hT A) (q : ℕ) (hq : 6 ≤ q) : ℝ := (1+2*(B.spatial q hq).full.M*(448*(B.spatial q hq).full.B+1))*B.sourceCost period q hq diff --git a/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftRadiusBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftRadiusBounds.lean index d495684644..890dc15a4b 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 @@ -26,10 +26,11 @@ variable (period : ℝ) [Fact (0 < period)] variable {T : ℝ} {hT : 0 < T} {A : Data period T} /-- The fixed radius retained for the correction, its pressure, and its time derivative. -/ +@[expose] 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..a37902eacf 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 @@ -32,7 +32,7 @@ synthesis. -/ local instance asymmetricSpace (q : ℕ) : NormedSpace ℝ (SobolevSpace period q) := inferInstance /-- Actual transport Hs×H^(s+1)→Hs; the coefficient velocity needs no extra derivative. -/ -def asymmetricTransport {s : ℕ} (hs : 6 ≤ s) +@[expose] def asymmetricTransport {s : ℕ} (hs : 6 ≤ s) (L : Fin 4 → Vector3 →L[ℝ] ℝ) (hL : ∀ i, ‖L i‖ ≤ 1) : SobolevSpace period s →L[ℝ] SobolevSpace period (s+1) →L[ℝ] SobolevSpace period s := ∑ i : Fin 4, (productHqBilinear period hs (L i) (hL i)).bilinearComp diff --git a/LeanPool/NavierStokesAndEuler/Euler/BaseEulerGuards.lean b/LeanPool/NavierStokesAndEuler/Euler/BaseEulerGuards.lean index 1a3ee1a5f3..e0a754d3d0 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 @@ -177,6 +177,7 @@ open Set InnerProductSpace ContinuousLinearMap EulerSmoothLimit EulerPacketFirstPressureSign EulerTimeIntervalRestriction /-- Coefficient cost, given by `27*(frameAmplitude K)^2*gradientAmplitude K`. -/ +@[expose] def coefficientCost (K : ℝ) : ℝ := 27*(frameAmplitude K)^2*gradientAmplitude K theorem coefficientCost_nonneg (K : ℝ) : 0 ≤ coefficientCost K := by @@ -185,6 +186,7 @@ theorem coefficientCost_nonneg (K : ℝ) : 0 ≤ coefficientCost K := by /-- Guard time, given by `min T (min 1 (1/(4*(1+coefficientCost K + firstSignRate (coefficientCost K) (coefficientCost K)))))`. -/ +@[expose] def guardTime (T K : ℝ) : ℝ := min T (min 1 (1/(4*(1+coefficientCost K + firstSignRate (coefficientCost K) (coefficientCost K))))) @@ -294,9 +296,18 @@ def lowBoundsOn (S : ℝ) (hS : 0 < S) (hST : S ≤ G.T) /-- Low bounds, given by `lowBoundsOn L _ _ _ (guardTime_le_one G.T L.K) (guardTime_small G.T L.K).1`. -/ +@[expose] def lowBounds : LowBounds (G.restrictTime (guardTime G.T L.K) (guardTime_pos G.T L.K G.T_pos) (guardTime_le G.T L.K)) := lowBoundsOn L _ _ _ (guardTime_le_one G.T L.K) (guardTime_small G.T L.K).1 +theorem lowBounds_scalar_values : + (lowBounds L).Be = coefficientCost L.K ∧ + (lowBounds L).Bc = 0 ∧ + (lowBounds L).L = 0 ∧ + (lowBounds L).r = 0 ∧ + (lowBounds L).K = coefficientCost L.K := by + exact ⟨rfl, rfl, rfl, rfl, rfl⟩ + end EulerBaseEulerGuards diff --git a/LeanPool/NavierStokesAndEuler/Euler/BaseEulerSign.lean b/LeanPool/NavierStokesAndEuler/Euler/BaseEulerSign.lean index 44b84ee383..b67e230315 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 @@ -82,11 +82,11 @@ theorem source_numerator_pos_on (T : ℝ) (hT : 0 < T) (hTG : T ≤ G.T) exact h0 · have hh := (mul_le_mul_of_nonneg_left hguard (coefficientCost_nonneg L.K)).trans (guardTime_small G.T L.K).1 - exact hh.trans (by norm_num) + exact hh.trans (show (1 / 4 : ℝ) ≤ 1 / 2 by norm_num) · have hr : 0 ≤ firstSignRate (coefficientCost L.K) (coefficientCost L.K) := by unfold firstSignRate positivity [coefficientCost_nonneg L.K] have hh := (mul_le_mul_of_nonneg_left hguard hr).trans (guardTime_small G.T L.K).2 - exact hh.trans (by norm_num) + exact hh.trans (show (1 / 4 : ℝ) ≤ 1 / 2 by norm_num) end EulerBaseEulerGuards diff --git a/LeanPool/NavierStokesAndEuler/Euler/BaseEulerState.lean b/LeanPool/NavierStokesAndEuler/Euler/BaseEulerState.lean index 249a60a8b1..1828f866e9 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 @@ -203,6 +203,7 @@ def tower (T : ℝ) (A : Space →L[ℝ] Space) : CoefficientTower P T where /-- Data, bundling `κ`, `direction`, `scale_bound`, `direction_bound` and the required compatibility proofs. -/ +@[expose] def data {T : ℝ} (F R : FieldTower P T) : EulerAllOrderCorrectionData.Data P T where κ := 1 direction := 0 @@ -286,7 +287,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 @@ -313,6 +314,7 @@ variable {P} {T : ℝ} {raw : VectorField} (G : Field P T raw) def residual (ε : ℝ) := (G.smul ε).spatialTransport (G.smul ε) /-- Input, given by `data P (G.smul ε).toFieldTower (residual G ε).toFieldTower`. -/ +@[expose] def input (ε : ℝ) : Data P T := data P (G.smul ε).toFieldTower (residual G ε).toFieldTower @@ -379,7 +381,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 +492,7 @@ end end -@[expose] public section +public section noncomputable section @@ -631,7 +633,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 @@ -663,6 +665,7 @@ theorem embeddedOrbit_smooth : ContDiff ℝ ∞ (fun a : LiftTangent => translat exact (embedding P).contDiff.comp (spatialOrbit_smooth u) /-- Field, constructed using `Field.ofLifted`. -/ +@[expose] def field : Field P T (fun z => u.field z.2.1) := Field.ofLifted (ContinuousMap.const (Icc (0 : ℝ) T) (embedding P u.toLp)) (constantPath_orbit_contDiff P _ (embeddedOrbit_smooth P u)) @@ -672,7 +675,8 @@ def field : Field P T (fun z => u.field z.2.1) := (fun _ _ _ => rfl) @[simp] theorem field_path : - (field P T u).path=ContinuousMap.const (Icc (0 : ℝ) T) (embedding P u.toLp) := rfl + (field P T u).path=ContinuousMap.const (Icc (0 : ℝ) T) (embedding P u.toLp) := by + rfl theorem field_time (hT : 0 ≤ T) : TimeDerivative hT (field P T u) (Field.zero P T) := by intro t @@ -749,7 +753,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 +837,7 @@ end end -@[expose] public section +public section noncomputable section @@ -845,8 +849,10 @@ open Set EulerSmoothLimit EulerLiftedGradientSpace EulerParameterWordGevrey variable (P : ℝ) [Fact (0 < P)] /-- Mixed radius, given by `sobolevCoefficientRadius (Fin 4) R`. -/ +@[expose] def mixedRadius (R : ℝ) : ℝ := sobolevCoefficientRadius (Fin 4) R /-- Mixed amplitude, given by `Real.sqrt P*sobolevCoefficientAmplitude (Fin 4) 6 R C`. -/ +@[expose] def mixedAmplitude (C R : ℝ) : ℝ := Real.sqrt P*sobolevCoefficientAmplitude (Fin 4) 6 R C theorem mixedRadius_nonneg (R : ℝ) (hR : 0 ≤ R) : 0 ≤ mixedRadius R := @@ -858,6 +864,7 @@ theorem mixedAmplitude_nonneg (C R : ℝ) (hC : 0 ≤ C) (hR : 0 ≤ R) : 0 ≤ /-- Scales, given by `scale P _ _ _ (mixedAmplitude_nonneg P C R hC hR) (mixedRadius_nonneg R hR) (residualCost_pos P _ _ (mixedRadius_nonneg R hR))`. -/ +@[expose] def scales (C R : ℝ) (hC : 0 ≤ C) (hR : 0 ≤ R) : Scale P (mixedAmplitude P C R) (mixedRadius R) (residualCost P (mixedAmplitude P C R) (mixedRadius R)) := @@ -865,6 +872,7 @@ def scales (C R : ℝ) (hC : 0 ≤ C) (hR : 0 ≤ R) : (residualCost_pos P _ _ (mixedRadius_nonneg R hR)) /-- Amplitude, given by `(scales P C R hC hR).value`. -/ +@[expose] def amplitude (C R : ℝ) (hC : 0 ≤ C) (hR : 0 ≤ R) : ℝ := (scales P C R hC hR).value theorem amplitude_pos (C R : ℝ) (hC : 0 ≤ C) (hR : 0 ≤ R) : 0 < amplitude P C R hC hR := @@ -877,9 +885,11 @@ variable (u : SmoothL2Field Space) (C R : ℝ) (hC : 0 ≤ C) (hR : 0 ≤ R) (hu : u.HasJetBound C R) (hdiv : ∀ x, divergence u.field x = 0) /-- Input data, given by `input (EulerStaticCylinder.field P 1 u) (amplitude P C R hC hR)`. -/ +@[expose] def inputData := input (EulerStaticCylinder.field P 1 u) (amplitude P C R hC hR) /-- Correction budget, constructed using `budget`. -/ +@[expose] def correctionBudget : Budget P (by norm_num : (0 : ℝ) < 1) (inputData P u C R hC hR) := budget (EulerStaticCylinder.field P 1 u) (EulerStaticCylinder.field_wordBound P 1 u 6 C R hC hR @@ -913,7 +923,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 @@ -939,7 +949,8 @@ local instance instConstantEulerGraph4 : NormedSpace ℝ LiftTangent := inferIns def inclusion : (ℝ × Space) →L[ℝ] (ℝ × LiftTangent) := (ContinuousLinearMap.id ℝ ℝ).prodMap (ContinuousLinearMap.inl ℝ Space ℝ) -@[simp] theorem inclusion_apply (t : ℝ) (x : Space) : inclusion (t,x)=(t,(x,0)) := rfl +@[simp] theorem inclusion_apply (t : ℝ) (x : Space) : inclusion (t,x)=(t,(x,0)) := by + rfl variable {P T : ℝ} [Fact (0 < P)] {hT : 0 < T} {F R : FieldTower P T} {B : Budget P hT (data P F R)} (S : ExactLiftedPacket P hT (data P F R) B) @@ -1016,6 +1027,7 @@ theorem momentum (t : ℝ) (ht : t ∈ Ioo 0 T) (x : Space) : exact h /-- Field, bundling `field`, `smooth`, `integrable`. -/ +@[expose] def field (t : Icc (0 : ℝ) T) : SmoothL2Field Space where field := S.velocity.physicalPointField 1 0 t smooth := S.velocity.physicalPointField_smooth 1 0 t @@ -1062,7 +1074,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 @@ -1079,7 +1091,8 @@ def coordinates (ε : ℝ) : (ℝ × E) →L[ℝ] (ℝ × E) := omit [CompleteSpace E] in @[simp] theorem coordinates_apply (ε : ℝ) (q : ℝ × E) : - coordinates ε q=(ε⁻¹*q.1,q.2) := rfl + coordinates ε q=(ε⁻¹*q.1,q.2) := by + rfl /-- Velocity, given by `ε⁻¹ • u (coordinates ε q)`. -/ def velocity (ε : ℝ) (u : ℝ × E → E) (q : ℝ × E) : E := @@ -1165,7 +1178,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 @@ -1304,6 +1317,7 @@ theorem localPressure_zero (t : ℝ) : localPressure P u C R hC hR hu hdiv (t,0) erw [EulerConstantEuler.pressure_zero,mul_zero] /-- Local field, constructed using `SmoothL2Field.mapField`. -/ +@[expose] def localField (t : Icc (0 : ℝ) (amplitude P C R hC hR)) : SmoothL2Field Space := SmoothL2Field.mapField ((amplitude P C R hC hR)⁻¹ • ContinuousLinearMap.id ℝ Space) (EulerConstantEuler.field (exactPacket P u C R hC hR hu hdiv) @@ -1354,7 +1368,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 +1432,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 @@ -1439,6 +1453,7 @@ def unitVelocityCoefficient : SmoothTimeField (Icc (0 : ℝ) 1) Space Space := (ContinuousLinearMap.inl ℝ Space ℝ) /-- Unit derivative coefficient as an element of `SmoothTimeField (Icc (0 : ℝ) 1) Space Space`. -/ +@[expose] def unitDerivativeCoefficient : SmoothTimeField (Icc (0 : ℝ) 1) Space Space := ((correctionBudget P u C R hC hR hu hdiv).packetDerivativeCoefficient P ((Field.zero P 1).smul (amplitude P C R hC hR))).precompLinear @@ -1521,7 +1536,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 @@ -1588,13 +1603,16 @@ variable (u : SmoothL2Field Space) (C R : ℝ) (hC : 0 ≤ C) (hR : 0 ≤ R) (hu : u.HasJetBound C R) (hdiv : ∀ x, divergence u.field x = 0) theorem budget_retainedRadius : - (correctionBudget P u C R hC hR hu hdiv).reducedRadius P=retainedRadius R := rfl + (correctionBudget P u C R hC hR hu hdiv).reducedRadius P=retainedRadius R := by + rfl theorem budget_staticTimeCost (q : ℕ) (hq : 6 ≤ q) : - (correctionBudget P u C R hC hR hu hdiv).timeDerivativeCost P q hq=staticTimeCost P R := rfl + (correctionBudget P u C R hC hR hu hdiv).timeDerivativeCost P q hq=staticTimeCost P R := by + rfl theorem budget_staticPressureCost (q : ℕ) (hq : 6 ≤ q) : - (correctionBudget P u C R hC hR hu hdiv).pressureCost P q hq=staticPressureCost P R := rfl + (correctionBudget P u C R hC hR hu hdiv).pressureCost P q hq=staticPressureCost P R := by + rfl theorem correction_weighted (n : ℕ) (t : Icc (0 : ℝ) 1) : weightedNorm P 6 n (retainedRadius R) @@ -1652,7 +1670,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 +1734,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1750,6 +1768,7 @@ local instance instStaticEulerGevrey6 (n : ℕ) : NormedSpace ℝ (Space →ᵇ inferInstance /-- Cover radius, given by `‖coordinateEquiv.symm.toContinuousLinearMap‖*(retainedRadius R)⁻¹`. -/ +@[expose] def coverRadius (R : ℝ) : ℝ := ‖coordinateEquiv.symm.toContinuousLinearMap‖*(retainedRadius R)⁻¹ /-- Output radius, given by `1+4*coverRadius R`. -/ @@ -1996,7 +2015,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 @@ -2050,6 +2069,7 @@ variable (I : Input) /-- Displacement, given by `displacementCoefficient I.T I.T_pos.le I.field I.B I.R I.B_nonneg I.R_pos I.small I.bound`. -/ +@[expose] def displacement : SmoothTimeField (Icc (0 : ℝ) I.T) Space Space := displacementCoefficient I.T I.T_pos.le I.field I.B I.R I.B_nonneg I.R_pos I.small I.bound @@ -2064,7 +2084,8 @@ def acceleration : SmoothTimeField (Icc (0 : ℝ) I.T) Space Space := I.derivative @[simp] theorem displacement_apply (t : Icc (0 : ℝ) I.T) (x : Space) : - I.displacement.field t x=(flowData I.T I.T_pos.le I.field).forward t x-x := rfl + I.displacement.field t x=(flowData I.T I.T_pos.le I.field).forward t x-x := by + rfl @[simp] theorem velocity_apply (t : Icc (0 : ℝ) I.T) (x : Space) : I.velocity.field t x=velocityFamily I.T I.T_pos.le I.field x t := by @@ -2110,6 +2131,7 @@ theorem displacement_det (t : Icc (0 : ℝ) I.T) (x : Space) : exact forward_det_one I.T I.T_pos.le I.field I.divergence t x /-- Parent, bundling `T`, `T_pos`, `ell`, `ell_pos` and the required compatibility proofs. -/ +@[expose] def parent (ell : ℝ) (hell : 0 < ell) (hell1 : ell ≤ 1) : Parent where T := I.T T_pos := I.T_pos @@ -2159,6 +2181,7 @@ theorem parent_velocity (ell : ℝ) (hell : 0 < ell) (hell1 : ell ≤ 1) end Input /-- Horizon, given by `min T (1/(8*(1+B*R)))`. -/ +@[expose] def horizon (T B R : ℝ) : ℝ := min T (1/(8*(1+B*R))) theorem horizon_pos (T B R : ℝ) (hT : 0 < T) (hB : 0 ≤ B) (hR : 0 ≤ R) : @@ -2179,6 +2202,7 @@ theorem horizon_small (T B R : ℝ) (hT : 0 < T) (hB : 0 ≤ B) (hR : 0 ≤ R) : /-- Of interval, bundling `T`, `T_pos`, `field`, `derivative` and the required compatibility proofs. -/ +@[expose] def ofInterval (T : ℝ) (hT : 0 < T) (A A₁ : SmoothTimeField (Icc (0 : ℝ) T) Space Space) (htime : SmoothTimeField.TimeDerivative T hT.le A A₁) @@ -2216,7 +2240,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 +2501,7 @@ end end -@[expose] public section +public section noncomputable section @@ -2576,7 +2600,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 +2647,7 @@ end end -@[expose] public section +public section noncomputable section @@ -2732,7 +2756,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 +2818,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 +2843,7 @@ end end -@[expose] public section +public section noncomputable section @@ -2833,6 +2857,7 @@ variable (P : ℝ) [Fact (0 < P)] /-- Base time, given by `EulerBaseEulerParent.horizon (amplitude P C R hC hR) (outputVelocitySize P C R) (outputRadius R)`. -/ +@[expose] def baseTime (C R : ℝ) (hC : 0 ≤ C) (hR : 0 ≤ R) : ℝ := EulerBaseEulerParent.horizon (amplitude P C R hC hR) (outputVelocitySize P C R) (outputRadius R) @@ -2869,6 +2894,7 @@ variable (u : SmoothL2Field Space) (C R : ℝ) (hC : 0 ≤ C) (hR : 0 ≤ R) (hu : u.HasJetBound C R) (hdiv : ∀ x, divergence u.field x = 0) /-- Base input, constructed using `EulerBaseEulerParent.ofInterval`. -/ +@[expose] def baseInput : EulerBaseEulerParent.Input := EulerBaseEulerParent.ofInterval (amplitude P C R hC hR) (amplitude_pos P C R hC hR) (velocityCoefficient P u C R hC hR hu hdiv) @@ -2917,14 +2943,17 @@ def baseL2Data : EulerBaseEulerParent.L2Data (baseInput P u C R hC hR hu hdiv) w variable (ell : ℝ) (hell : 0 < ell) (hell1 : ell ≤ 1) /-- Base parent, given by `(baseInput P u C R hC hR hu hdiv).parent ell hell hell1`. -/ +@[expose] def baseParent : Parent := (baseInput P u C R hC hR hu hdiv).parent ell hell hell1 /-- Base label data, given by `(baseL2Data P u C R hC hR hu hdiv).labelData ell hell hell1`. -/ +@[expose] def baseLabelData : LabelData (baseParent P u C R hC hR hu hdiv ell hell hell1) := (baseL2Data P u C R hC hR hu hdiv).labelData ell hell hell1 theorem baseLabelData_constant : - (baseLabelData P u C R hC hR hu hdiv ell hell hell1).K=baseLabelConstant P C R hC hR := rfl + (baseLabelData P u C R hC hR hu hdiv ell hell hell1).K=baseLabelConstant P C R hC hR := by + rfl include u hu hdiv ell hell hell1 in theorem baseLabelConstant_one : 1 ≤ baseLabelConstant P C R hC hR := @@ -2999,7 +3028,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 @@ -3022,6 +3051,7 @@ theorem potential_support (L : Space →L[ℝ] Space) (i : Fin 3) : tsupport_mul_subset_left.trans outerCutoff_support /-- Velocity, given by `curl (potential L)`. -/ +@[expose] def velocity (L : Space →L[ℝ] Space) : Space → Space := curl (potential L) theorem velocity_smooth (L : Space →L[ℝ] Space) : ContDiff ℝ ∞ (velocity L) := @@ -3064,6 +3094,7 @@ theorem velocity_fderiv_plateau (L : Space →L[ℝ] Space) exact he.fderiv_eq.trans L.fderiv /-- Field, bundling `field`, `smooth`, `integrable`. -/ +@[expose] def field (L : Space →L[ℝ] Space) : SmoothL2Field Space where field := velocity L smooth := velocity_smooth L @@ -3080,11 +3111,13 @@ theorem field_solenoidal (L : Space →L[ℝ] Space) : /-- Linear, given by `(EuclideanSpace.proj 1).smulRight (EuclideanSpace.single 0 1+β • EuclideanSpace.single 2 1)`. -/ +@[expose] def linear (β : ℝ) : Space →L[ℝ] Space := (EuclideanSpace.proj 1).smulRight (EuclideanSpace.single 0 1+β • EuclideanSpace.single 2 1) @[simp] theorem linear_apply (β : ℝ) (x : Space) : - linear β x=x 1 • (EuclideanSpace.single 0 1+β • EuclideanSpace.single 2 1) := rfl + linear β x=x 1 • (EuclideanSpace.single 0 1+β • EuclideanSpace.single 2 1) := by + rfl theorem linear_trace (β : ℝ) : LinearMap.trace ℝ Space (linear β).toLinearMap=0 := by rw [← coordinateTrace_eq_linearTrace] @@ -3118,7 +3151,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 +3227,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 +3261,7 @@ end end -@[expose] public section +public section noncomputable section @@ -3419,7 +3452,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 +3546,7 @@ end end -@[expose] public section +public section noncomputable section @@ -3525,6 +3558,7 @@ local instance instBaseEulerInput1 : Fact (0 < (1 : ℝ)) := ⟨zero_lt_one⟩ /-- Solution time, given by `EulerStaticEuler.baseTime 1 uniformL2Amplitude 1024 uniformL2Amplitude_nonneg (by norm_num)`. -/ +@[expose] def solutionTime : ℝ := EulerStaticEuler.baseTime 1 uniformL2Amplitude 1024 uniformL2Amplitude_nonneg (by norm_num) @@ -3533,6 +3567,7 @@ theorem solutionTime_pos : 0 < solutionTime := /-- Solution label constant, given by `EulerStaticEuler.baseLabelConstant 1 uniformL2Amplitude 1024 uniformL2Amplitude_nonneg (by norm_num)`. -/ +@[expose] def solutionLabelConstant : ℝ := EulerStaticEuler.baseLabelConstant 1 uniformL2Amplitude 1024 uniformL2Amplitude_nonneg (by norm_num) @@ -3540,12 +3575,14 @@ def solutionLabelConstant : ℝ := variable (β : ℝ) (hβ : |β| ≤ 1) (ell : ℝ) (hell : 0 < ell) (hell1 : ell ≤ 1) /-- Solution parent, constructed using `EulerStaticEuler.baseParent`. -/ +@[expose] def solutionParent : Parent := EulerStaticEuler.baseParent 1 (field (linear β)) uniformL2Amplitude 1024 uniformL2Amplitude_nonneg (by norm_num) (field_uniform_jet β hβ) (velocity_divergence (linear β)) ell hell hell1 /-- Solution label data, constructed using `EulerStaticEuler.baseLabelData`. -/ +@[expose] def solutionLabelData : LabelData (solutionParent β hβ ell hell hell1) := EulerStaticEuler.baseLabelData 1 (field (linear β)) uniformL2Amplitude 1024 uniformL2Amplitude_nonneg (by norm_num) (field_uniform_jet β hβ) @@ -3563,10 +3600,12 @@ def solutionEvolution : Evolution (solutionParent β hβ ell hell hell1) := uniformL2Amplitude_nonneg (by norm_num) (field_uniform_jet β hβ) (velocity_divergence (linear β)) ell hell hell1 -theorem solutionParent_time : (solutionParent β hβ ell hell hell1).T=solutionTime := rfl +theorem solutionParent_time : (solutionParent β hβ ell hell hell1).T=solutionTime := by + rfl theorem solutionLabelData_constant : - (solutionLabelData β hβ ell hell hell1).K=solutionLabelConstant := rfl + (solutionLabelData β hβ ell hell hell1).K=solutionLabelConstant := by + rfl theorem solutionOddData : OddData (solutionParent β hβ ell hell hell1) := EulerStaticEuler.baseOddData 1 (field (linear β)) uniformL2Amplitude 1024 @@ -3618,7 +3657,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 +3713,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 +3761,7 @@ end end -@[expose] public section +public section noncomputable section @@ -3732,6 +3771,7 @@ open Set InnerProductSpace ContinuousLinearMap EulerSmoothLimit EulerParentPacketFrames EulerBaseEulerGuards EulerTransverseFrameCoordinates /-- Initial time, given by `guardTime solutionTime solutionLabelConstant`. -/ +@[expose] def initialTime : ℝ := guardTime solutionTime solutionLabelConstant theorem initialTime_pos : 0 < initialTime := @@ -3742,6 +3782,7 @@ theorem initialTime_le : initialTime ≤ solutionTime := guardTime_le _ _ theorem initialTime_le_one : initialTime ≤ 1 := guardTime_le_one _ _ /-- Initial coefficient cost, given by `coefficientCost solutionLabelConstant`. -/ +@[expose] def initialCoefficientCost : ℝ := coefficientCost solutionLabelConstant theorem initialCoefficientCost_nonneg : 0 ≤ initialCoefficientCost := coefficientCost_nonneg _ @@ -3756,11 +3797,13 @@ variable (β : ℝ) (hβ : |β| ≤ 1) (ell : ℝ) (hell : 0 < ell) (hell1 : ell /-- Initial parent, given by `(solutionParent β hβ ell hell hell1).restrictTime initialTime initialTime_pos initialTime_le`. -/ +@[expose] def initialParent : Parent := (solutionParent β hβ ell hell hell1).restrictTime initialTime initialTime_pos initialTime_le /-- Initial label data, given by `(solutionLabelData β hβ ell hell hell1).restrictTime initialTime initialTime_pos initialTime_le`. -/ +@[expose] def initialLabelData : LabelData (initialParent β hβ ell hell hell1) := (solutionLabelData β hβ ell hell hell1).restrictTime initialTime initialTime_pos initialTime_le @@ -3782,22 +3825,53 @@ def initialSobolevData : SobolevData (initialEvolution β hβ ell hell hell1) := theorem initialOddData : OddData (initialParent β hβ ell hell hell1) := (solutionOddData β hβ ell hell hell1).restrictTime initialTime initialTime_pos initialTime_le +theorem initialParent_from_label : + (solutionParent β hβ ell hell hell1).restrictTime + (guardTime (solutionParent β hβ ell hell hell1).T + (solutionLabelData β hβ ell hell hell1).K) + (guardTime_pos _ _ (solutionParent β hβ ell hell hell1).T_pos) + (guardTime_le _ _) = initialParent β hβ ell hell hell1 := by + simp only [initialParent, initialTime, solutionParent_time, + solutionLabelData_constant] + +private theorem lowBounds_cast_values {G H : Parent} (h : G = H) + (b : LowBounds G) : + (Eq.mp (congrArg LowBounds h) b).Be = b.Be ∧ + (Eq.mp (congrArg LowBounds h) b).Bc = b.Bc ∧ + (Eq.mp (congrArg LowBounds h) b).L = b.L ∧ + (Eq.mp (congrArg LowBounds h) b).r = b.r ∧ + (Eq.mp (congrArg LowBounds h) b).K = b.K := by + cases h + exact ⟨rfl, rfl, rfl, rfl, rfl⟩ + /-- Initial low bounds, given by `lowBounds (solutionLabelData β hβ ell hell hell1)`. -/ +@[expose] def initialLowBounds : LowBounds (initialParent β hβ ell hell hell1) := - lowBounds (solutionLabelData β hβ ell hell hell1) + Eq.mp (congrArg LowBounds (initialParent_from_label β hβ ell hell hell1)) + (lowBounds (solutionLabelData β hβ ell hell hell1)) theorem initialLowBounds_values : (initialLowBounds β hβ ell hell hell1).Be=initialCoefficientCost ∧ (initialLowBounds β hβ ell hell hell1).Bc=0 ∧ (initialLowBounds β hβ ell hell hell1).L=0 ∧ (initialLowBounds β hβ ell hell hell1).r=0 ∧ - (initialLowBounds β hβ ell hell hell1).K=initialCoefficientCost := - ⟨rfl,rfl,rfl,rfl,rfl⟩ - -theorem initialParent_time : (initialParent β hβ ell hell hell1).T=initialTime := rfl + (initialLowBounds β hβ ell hell hell1).K=initialCoefficientCost := by + have h := lowBounds_cast_values (initialParent_from_label β hβ ell hell hell1) + (lowBounds (solutionLabelData β hβ ell hell hell1)) + rcases h with ⟨hBe, hBc, hL, hr, hK⟩ + dsimp only [initialLowBounds] + rcases lowBounds_scalar_values (solutionLabelData β hβ ell hell hell1) with + ⟨vBe, vBc, vL, vr, vK⟩ + rw [hBe, hBc, hL, hr, hK, vBe, vBc, vL, vr, vK] + simp only [solutionLabelData_constant, initialCoefficientCost] + exact ⟨True.intro, True.intro, True.intro, True.intro, True.intro⟩ + +theorem initialParent_time : (initialParent β hβ ell hell hell1).T=initialTime := by + rfl theorem initialLabelData_constant : - (initialLabelData β hβ ell hell hell1).K=solutionLabelConstant := rfl + (initialLabelData β hβ ell hell hell1).K=solutionLabelConstant := by + rfl theorem initial_velocity (x : Space) : (initialParent β hβ ell hell hell1).velocity.field ⟨0,le_rfl,initialTime_pos.le⟩ x = 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..3b8b4224be 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 @@ -53,7 +53,8 @@ theorem initial_support : have hd := A.exactForwardPacket_initial_increment_support H firstNormal firstNormal_unit firstFrame support compact δ hδ firstCoordinate (subset_refl _) (δ*hchild) (truncation k) F.hn k hk.four F.Q S.evolution.inverse - rfl (subset_halfBall.trans Metric.ball_subset_closedBall) S.evolution.velocity + (packetBase_boundary_zero β hβ ell hell hell1 T hT hTB) + (subset_halfBall.trans Metric.ball_subset_closedBall) S.evolution.velocity change tsupport ((fun x => F.state.evolution.velocity (0,x)) - (fun x => S.evolution.velocity (0,x))) ⊆ Metric.closedBall 0 (ell/2) at hd exact support_of_difference (fun x => S.evolution.velocity (0,x)) diff --git a/LeanPool/NavierStokesAndEuler/Euler/BaseInductionStage.lean b/LeanPool/NavierStokesAndEuler/Euler/BaseInductionStage.lean index 88c1026776..e0f3984e9c 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 @@ -79,7 +79,7 @@ variable (δ hchild : ℝ) (ξ : U) (hδ : 0 < δ) (hδ1 : δ ≤ 1) (hhchild : /-- The exact source (20) errors, expressed on the same normalized packet that defines the physical child. These are precisely the two errors supplied by the same-Q packet choice. -/ -def HomogeneousSourceErrors (ev ep : ℝ) : Prop := +@[expose] def HomogeneousSourceErrors (ev ep : ℝ) : Prop := ∀ (t : Icc (0 : ℝ) A.T) (x : Space), ‖fderiv ℝ (A.normalizedPacketVelocity m hm J support hSupport B residual k E.inverse t) x - shearTerm (δ*hchild) (deriv (profile δ) (k*⟪m,E.inverse.normalized t x⟫_ℝ)) @@ -174,7 +174,7 @@ end end -@[expose] public section +public section noncomputable section @@ -205,7 +205,7 @@ variable {A : Parent} (E : Evolution A) (H : LowBounds A) /-- First child low bounds as an element of `LowBounds (A.child G k m hgraph nextEll hnext hnext1)`. -/ -def firstChildLowBounds (hL : H.L = 0) (hquarter : A.ell ≤ 1 / 4) +@[expose] def firstChildLowBounds (hL : H.L = 0) (hquarter : A.ell ≤ 1 / 4) (hSupportBall : support ⊆ Metric.closedBall 0 (1 / 2 : ℝ)) (ev ep CM CH : ℝ) (herr : E.HomogeneousSourceErrors m hm J support hSupport Q @@ -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 @@ -301,7 +301,7 @@ variable (β : ℝ) (hβ : |β| ≤ 1) (ell : ℝ) (hell : 0 < ell) (hell1 : ell /-- First packet data, given by `(packetBaseParent β hβ ell hell hell1 T hT hTB).transverseData firstNormal firstNormal_unit firstFrame support compact`. -/ -def firstPacketData : EulerTransversePacketProvider.Data FirstPlane := +@[expose] def firstPacketData : EulerTransversePacketProvider.Data FirstPlane := (packetBaseParent β hβ ell hell hell1 T hT hTB).transverseData firstNormal firstNormal_unit firstFrame support compact @@ -362,7 +362,7 @@ end end -@[expose] public section +public section noncomputable section @@ -382,14 +382,16 @@ theorem packetBaseParent_time : (packetBaseParent β hβ ell hell hell1 T hT hTB).T = T := rfl theorem packetBaseLowBounds_pressure : - (packetBaseLowBounds β hβ ell hell hell1 T hT hTB).K = initialCoefficientCost := rfl + (packetBaseLowBounds β hβ ell hell hell1 T hT hTB).K = initialCoefficientCost := by + change (initialLowBounds β hβ ell hell hell1).K = initialCoefficientCost + exact (initialLowBounds_values β hβ ell hell hell1).2.2.2.2 -- Preserve the abstract parent while constructing the first packet data. attribute [local irreducible] initialParent /-- First packet mean data, given by `(packetBaseParent β hβ ell hell hell1 T hT hTB).meanData (packetBaseLowBounds β hβ ell hell hell1 T hT hTB)`. -/ -def firstPacketMeanData : EulerMeanPacketProvider.Data := +@[expose] def firstPacketMeanData : EulerMeanPacketProvider.Data := (packetBaseParent β hβ ell hell hell1 T hT hTB).meanData (packetBaseLowBounds β hβ ell hell hell1 T hT hTB) @@ -417,7 +419,7 @@ variable (δ : ℝ) (hδ : 0 < δ) (hchild : ℝ) /-- First packet state as an element of `SmoothState ((packetBaseParent β hβ ell hell hell1 T hT hTB).child G k firstNormal hgraph nextEll hnext hnext1)`. -/ -def firstPacketState +@[expose] def firstPacketState (labels : LabelData ((packetBaseParent β hβ ell hell hell1 T hT hTB).child G k firstNormal hgraph nextEll hnext hnext1)) : SmoothState ((packetBaseParent β hβ ell hell hell1 T hT hTB).child @@ -430,7 +432,7 @@ def firstPacketState /-- First packet low bounds as an element of `LowBounds ((packetBaseParent β hβ ell hell hell1 T hT hTB).child G k firstNormal hgraph nextEll hnext hnext1)`. -/ -def firstPacketLowBounds (hquarter : ell ≤ 1 / 4) (hδ1 : δ ≤ 1) (hhchild : 0 ≤ hchild) +@[expose] def firstPacketLowBounds (hquarter : ell ≤ 1 / 4) (hδ1 : δ ≤ 1) (hhchild : 0 ≤ hchild) (ev ep : ℝ) (herr : (packetBaseState β hβ ell hell hell1 T hT hTB).evolution.HomogeneousSourceErrors firstNormal firstNormal_unit firstFrame support compact Q @@ -451,7 +453,8 @@ def firstPacketLowBounds (hquarter : ell ≤ 1 / 4) (hδ1 : δ ≤ 1) (hhchild : (packetBaseLowBounds β hβ ell hell hell1 T hT hTB) firstNormal firstNormal_unit firstFrame support compact δ hδ hδ1 hchild hhchild firstCoordinate (subset_refl _) N hN k hk Q G hcoefficient hgraph nextEll hnext hnext1 - rfl (by simpa only [packetBaseParent_scale] using hquarter) + (packetBase_boundary_zero β hβ ell hell hell1 T hT hTB) + (by simpa only [packetBaseParent_scale] using hquarter) (subset_halfBall.trans Metric.ball_subset_closedBall) ev ep initialCoefficientCost initialCoefficientCost herrors (firstPacket_primary_size β hβ ell hell hell1 T hT hTB) @@ -468,7 +471,7 @@ end end -@[expose] public section +public section noncomputable section @@ -533,13 +536,15 @@ theorem exists_firstPacketChoice (hδ1 : δ ≤ 1) (hh : 0 < hchild) let S := packetBaseState β hβ ell hell hell1 T hT hTB let H := packetBaseLowBounds β hβ ell hell hell1 T hT hTB let J := firstPacketInputs β hβ ell hell hell1 T hT hTB + have hSK : S.labels.K ≤ k := by + simpa only [S, packetBase_label_constant] using hKk have hp := firstPacket_uniform_primitives β hβ ell hell hell1 T hT hTB δ hδ hδ1 hchild hh.le obtain ⟨hn,Q,G,hgraph,hG,herror,hdisplacement,LC,hLC⟩ := S.labels.forward_uniform_child S.evolution.inverse H firstNormal firstNormal_unit firstFrame support compact J δ hδ hδ1 firstCoordinate (subset_refl _) (δ*hchild) (mul_pos hδ hh) (profileEnvelope (firstParameterSize T δ hchild)) hp.1 hp.2.1 - k hk hfrequency hKk hinv nextEll hnext hnext1 + k hk hfrequency hSK hinv nextEll hnext hnext1 refine ⟨⟨hn,Q,G,hgraph,hG,LC,hLC,hdisplacement,?_⟩⟩ intro t x dsimp only [firstPacketMeanData, firstPacketData] @@ -564,18 +569,18 @@ variable (F : FirstPacketChoice β hβ ell hell hell1 T hT hTB δ hδ hchild k h /-- Parent, given by `(packetBaseParent β hβ ell hell hell1 T hT hTB).child F.G k firstNormal F.graph nextEll hnext hnext1`. -/ -def parent : Parent := (packetBaseParent β hβ ell hell hell1 T hT hTB).child +@[expose] def parent : Parent := (packetBaseParent β hβ ell hell hell1 T hT hTB).child F.G k firstNormal F.graph nextEll hnext hnext1 /-- State, constructed using `firstPacketState`. -/ -def state : SmoothState F.parent := +@[expose] def state : SmoothState F.parent := firstPacketState β hβ ell hell hell1 T hT hTB δ hδ hchild (truncation k) F.hn k hk.four F.Q F.G F.coefficient F.graph nextEll hnext hnext1 F.labels theorem state_label_constant : F.state.labels.K=k^80 := F.label_constant /-- Low bounds, constructed using `firstPacketLowBounds`. -/ -def lowBounds (hquarter : ell ≤ 1 / 4) (hδ1 : δ ≤ 1) (hh : 0 ≤ hchild) +@[expose] def lowBounds (hquarter : ell ≤ 1 / 4) (hδ1 : δ ≤ 1) (hh : 0 ≤ hchild) (hsmall : (initialCoefficientCost + 2 * initialCoefficientCost * δ * (hchild * firstRatio) + k ^ (-(1 / 4 : ℝ))) * (T ^ 2 / 2) + initialCoefficientCost * T + boundaryLocalizationC2 * (initialCoefficientCost + hchild * firstRatio + k ^ (-(1 / @@ -604,7 +609,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 +680,7 @@ end end -@[expose] public section +public section noncomputable section @@ -766,8 +771,10 @@ theorem physical_bounds (hδ1 : δ ≤ 1) (hh : 0 ≤ hchild) (firstPacket_primary_flux β hβ ell hell hell1 T hT hTB) t x (packetBase_physical_strain β hβ ell hell hell1 T hT hTB t x) (packetBase_physical_force β hβ ell hell hell1 T hT hTB t x) - (S.evolution.force_quadratic_upper_of_lowBounds (packetBaseLowBounds β hβ ell hell hell1 T hT - hTB) t x) + (by + have hq := S.evolution.force_quadratic_upper_of_lowBounds + (packetBaseLowBounds β hβ ell hell hell1 T hT hTB) t x + simpa only [packetBaseLowBounds_pressure] using hq) dsimp only [S, res, firstPacketMeanData, firstPacketData] at h constructor · dsimp only [state, firstPacketState, SmoothState.forwardChild, @@ -820,7 +827,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 +925,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 @@ -971,20 +978,20 @@ def packet (hJ : 1 ≤ J) : H.source_frequency H.label_frequency H.radius_frequency) /-- Parent, given by `(H.packet hJ).parent`. -/ -def parent (hJ : 1 ≤ J) : Parent := (H.packet hJ).parent +@[expose] def parent (hJ : 1 ≤ J) : Parent := (H.packet hJ).parent /-- State, given by `(H.packet hJ).state`. -/ -def state (hJ : 1 ≤ J) : SmoothState (H.parent hJ) := (H.packet hJ).state +@[expose] def state (hJ : 1 ≤ J) : SmoothState (H.parent hJ) := (H.packet hJ).state theorem state_label (hJ : 1 ≤ J) : (H.state hJ).labels.K=(X^D)^80 := (H.packet hJ).state_label_constant -theorem parent_time (hJ : 1 ≤ J) : (H.parent hJ).T=baseHorizon J X := rfl +theorem parent_time (hJ : 1 ≤ J) : (H.parent hJ).T=baseHorizon J X := by rfl -theorem parent_scale (hJ : 1 ≤ J) : (H.parent hJ).ell=supportScale J X 0 := rfl +theorem parent_scale (hJ : 1 ≤ J) : (H.parent hJ).ell=supportScale J X 0 := by rfl /-- Low bounds, constructed using `FirstPacketChoice.lowBounds`. -/ -def lowBounds (hJ : 1 ≤ J) : LowBounds (H.parent hJ) := +@[expose] def lowBounds (hJ : 1 ≤ J) : LowBounds (H.parent hJ) := FirstPacketChoice.lowBounds (X^(-2 : ℝ)) H.tilt_bound (baseRadius X) H.core_pos H.core_one (baseHorizon J X) (H.time_pos hJ) H.local_time (X^(-1010 : ℝ)) H.spike_pos (X^1000) (X^D) H.frequency @@ -998,8 +1005,11 @@ theorem lowBounds_values (hJ : 1 ≤ J) : (H.lowBounds hJ).r=baseRadius X ∧ (H.lowBounds hJ).K=initialCoefficientCost+literalInitialPressureCost D X := by refine ⟨rfl,rfl,rfl,?_⟩ - change initialCoefficientCost+2*initialCoefficientCost*X^(-1010 : ℝ)*(X^1000*firstRatio) + + change (packetBaseLowBounds (X^(-2 : ℝ)) H.tilt_bound (baseRadius X) H.core_pos + H.core_one (baseHorizon J X) (H.time_pos hJ) H.local_time).K + + 2*initialCoefficientCost*X^(-1010 : ℝ)*(X^1000*firstRatio) + (X^D)^(-(1/4 : ℝ))=initialCoefficientCost+literalInitialPressureCost D X + rw [packetBaseLowBounds_pressure] unfold literalInitialPressureCost literalInitialError ring @@ -1015,7 +1025,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 +1086,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1094,7 +1104,7 @@ attribute [local irreducible] initialParent variable {c B : ℝ} (S : Scales c B) /-- First stage as an element of `Stage S 0`. -/ -def firstStage : Stage S 0 := by +@[expose] def firstStage : Stage S 0 := by let F := S.first.packet S.j_one let P := F.initialFrame firstNormal firstNormal_unit firstFrame support compact have hparam := F.initialFrame_parameters firstNormal firstNormal_unit firstFrame support compact @@ -1173,9 +1183,9 @@ def firstStage : Stage S 0 := by rw [htilt] norm_num -theorem firstStage_time : S.firstStage.time=0 := rfl +theorem firstStage_time : S.firstStage.time=0 := by rfl -theorem firstStage_horizon : S.firstStage.parent.T=baseHorizon S.J S.X := rfl +theorem firstStage_horizon : S.firstStage.parent.T=baseHorizon S.J S.X := by rfl theorem firstStage_coupling : S.firstStage.frame.a=1 := ((S.first.packet S.j_one).initialFrame_parameters firstNormal firstNormal_unit firstFrame diff --git a/LeanPool/NavierStokesAndEuler/Euler/BasePacketSetup.lean b/LeanPool/NavierStokesAndEuler/Euler/BasePacketSetup.lean index f6887230c4..3d577c60cf 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 @@ -28,6 +28,7 @@ namespace EulerBaseDatum open EulerParentPacketFrames /-- Initial state, bundling `evolution`, `regularity`, `labels`, `odd`. -/ +@[expose] def initialState (β : ℝ) (hβ : |β| ≤ 1) (ell : ℝ) (hell : 0 < ell) (hell1 : ell ≤ 1) : SmoothState (initialParent β hβ ell hell hell1) where @@ -43,7 +44,7 @@ end end -@[expose] public section +public section noncomputable section @@ -52,7 +53,7 @@ namespace EulerPacketSupport open Set EulerSmoothLimit EulerSpatialCutoffs /-- Support, given by `tsupport innerCutoff`. -/ -def support : Set Space := tsupport innerCutoff +@[expose] def support : Set Space := tsupport innerCutoff theorem compact : IsCompact support := innerCutoff_compactSupport @@ -79,7 +80,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] @@ -87,9 +88,11 @@ theorem firstNormal_unit : ‖firstNormal‖=1 := by simp [firstNormal] abbrev FirstPlane := referencePlane firstNormal /-- First frame, given by `LinearIsometryEquiv.refl ℝ _`. -/ +@[expose] def firstFrame : FirstPlane ≃ₗᵢ[ℝ] referencePlane firstNormal := LinearIsometryEquiv.refl ℝ _ /-- First coordinate as an element of `FirstPlane`. -/ +@[expose] def firstCoordinate : FirstPlane := ⟨EuclideanSpace.single 1 1,by rw [Submodule.mem_orthogonal_singleton_iff_inner_right] simp [firstNormal,EuclideanSpace.inner_single_left]⟩ @@ -104,23 +107,30 @@ variable (β : ℝ) (hβ : |β| ≤ 1) (ell : ℝ) (hell : 0 < ell) (hell1 : ell (T : ℝ) (hT : 0 < T) (hTB : T ≤ initialTime) /-- Packet base parent, given by `(initialParent β hβ ell hell hell1).restrictTime T hT hTB`. -/ +@[expose] def packetBaseParent : Parent := (initialParent β hβ ell hell hell1).restrictTime T hT hTB /-- Packet base state, given by `(initialState β hβ ell hell hell1).restrictTime T hT hTB`. -/ +@[expose] def packetBaseState : SmoothState (packetBaseParent β hβ ell hell hell1 T hT hTB) := (initialState β hβ ell hell hell1).restrictTime T hT hTB /-- Packet base low bounds, given by `(initialLowBounds β hβ ell hell hell1).restrictTime T hT hTB`. -/ +@[expose] def packetBaseLowBounds : LowBounds (packetBaseParent β hβ ell hell hell1 T hT hTB) := (initialLowBounds β hβ ell hell hell1).restrictTime T hT hTB theorem packetBase_label_constant : - (packetBaseState β hβ ell hell hell1 T hT hTB).labels.K=solutionLabelConstant := rfl + (packetBaseState β hβ ell hell hell1 T hT hTB).labels.K=solutionLabelConstant := by + change (initialLabelData β hβ ell hell hell1).K = solutionLabelConstant + exact initialLabelData_constant β hβ ell hell hell1 theorem packetBase_boundary_zero : - (packetBaseLowBounds β hβ ell hell hell1 T hT hTB).L=0 := rfl + (packetBaseLowBounds β hβ ell hell hell1 T hT hTB).L=0 := by + change (initialLowBounds β hβ ell hell hell1).L = 0 + exact (initialLowBounds_values β hβ ell hell hell1).2.2.1 include hTB in theorem packetBase_short : initialCoefficientCost*T ≤ 1/2 := @@ -161,6 +171,7 @@ theorem packetBase_initialStrain (x : Space) (hx : x ∈ support) : nlinarith only [hb,hx'] /-- First packet inputs used in base packet setup. -/ +@[expose] def firstPacketInputs : ForwardInputs ((packetBaseParent β hβ ell hell hell1 T hT hTB).meanData @@ -191,7 +202,9 @@ theorem firstPacket_pressure_numerator (t : Icc (0 : ℝ) T) firstNormal firstNormal_unit firstFrame support compact firstCoordinate firstCoordinate_norm x · rw [packetBase_initialStrain β hβ ell hell hell1 T hT hTB x hx,firstCoordinate_map,linear_q] simp [firstNormal,EuclideanSpace.inner_single_left,PiLp.add_apply,PiLp.smul_apply] - · exact packetBase_short T hTB - · exact packetBase_sign_short T hTB + · simpa only [packetBase_label_constant, packetBaseParent, Parent.restrictTime, + initialCoefficientCost] using packetBase_short T hTB + · simpa only [packetBase_label_constant, packetBaseParent, Parent.restrictTime, + initialCoefficientCost] using packetBase_sign_short T hTB end EulerBaseDatum diff --git a/LeanPool/NavierStokesAndEuler/Euler/BasePacketUniformCosts.lean b/LeanPool/NavierStokesAndEuler/Euler/BasePacketUniformCosts.lean index 269281544f..56c5ea0bbf 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 < δ) @@ -195,6 +195,10 @@ theorem firstPacket_uniform_primitives (δ : ℝ) (hδ : 0 < δ) (hδ1 : δ ≤ frequencyConstant*X^frequencyPower := by let X := firstParameterSize T δ hchild obtain ⟨hX,hK,hTi,h2,hd,hhX⟩ := firstParameterSize_bounds T δ hchild hT hδ hh + have hK' : (L).K ≤ X := by + simpa only [packetBase_label_constant] using hK + have hL : (H).L ≤ X := by + simpa only [packetBase_boundary_zero] using (zero_le_one.trans hX) have hr := (L).shortForward_radius_primitives H firstNormal firstNormal_unit firstFrame support compact initialCoefficientCost initialCoefficientCost_nonneg @@ -202,8 +206,8 @@ theorem firstPacket_uniform_primitives (δ : ℝ) (hδ : 0 < δ) (hδ1 : δ ≤ (packetBase_short T hTB) (Metric.ball 0 (1/2 : ℝ)) Metric.isOpen_ball.measurableSet Metric.isOpen_ball subset_halfBall (fun x hx => le_of_lt (by simpa only [Metric.mem_ball,dist_zero_right] using hx)) - T⁻¹ (hTB.trans initialTime_le_one) le_rfl δ firstCoordinate X hK hTi h2 - (zero_le_one.trans hX) hd (by simpa only [firstCoordinate_norm] using hX) + T⁻¹ (hTB.trans initialTime_le_one) le_rfl δ firstCoordinate X hK' hTi h2 + hL hd (by simpa only [firstCoordinate_norm] using hX) have hSX : X ≤ sourceEnvelope X := (inputEnvelope_bounds X X hX le_rfl).2.1.trans (EulerPacketSourceRadius.le_sourceRadiusEnvelope _ 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..195bcae740 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 @@ -69,7 +69,7 @@ theorem flow_joint_continuous : /-- Flow homeomorph, bundling `toFun`, `invFun`, `left_inv`, `right_inv` and the required compatibility proofs. -/ -def flowHomeomorph (s t : ℝ) : E ≃ₜ E where +@[expose] def flowHomeomorph (s t : ℝ) : E ≃ₜ E where toFun := V.flow s t invFun := V.flow t s left_inv := V.flow_inverse s t @@ -80,10 +80,10 @@ def flowHomeomorph (s t : ℝ) : E ≃ₜ E where (continuous_const.prodMk (continuous_const.prodMk continuous_id)) /-- Forward, given by `V.flow 0 t x`. -/ -def forward (t : ℝ) (x : E) : E := V.flow 0 t x +@[expose] def forward (t : ℝ) (x : E) : E := V.flow 0 t x /-- Backward, given by `V.flow t 0 x`. -/ -def backward (t : ℝ) (x : E) : E := V.flow t 0 x +@[expose] def backward (t : ℝ) (x : E) : E := V.flow t 0 x @[simp] theorem backward_forward (t : ℝ) (x : E) : V.backward t (V.forward t x) = x := V.flow_inverse 0 t x 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..b28e3fe987 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 @@ -61,7 +61,7 @@ theorem curve_exists (s : ℝ) (x : E) : simpa only [Function.comp_def, id_eq, sub_add_cancel, one_smul] using h /-- Flow, given by `(V.curve_exists s x).choose t`. -/ -def flow (s t : ℝ) (x : E) : E := (V.curve_exists s x).choose t +@[expose] def flow (s t : ℝ) (x : E) : E := (V.curve_exists s x).choose t @[simp] theorem flow_initial (s : ℝ) (x : E) : V.flow s s x = x := (V.curve_exists s x).choose_spec.1 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..42c57390db 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,16 +133,18 @@ 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`. -/ +@[expose] 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`. -/ +@[expose] def amplitude : ℝ := G.K+G.amp+9*G.firstAmplitude*G.amp+9*G.secondAmplitude*G.amp^2 theorem K_nonneg : 0 ≤ G.K := le_trans zero_le_one G.K_one @@ -312,13 +314,16 @@ theorem accelerationTerm_bound : /-- Child displacement, given by `addField (G.parentComposed G.parentDisplacement G.parentDisplacement_bound) G.displacement`. -/ +@[expose] def childDisplacement : SmoothL2Field Space := addField (G.parentComposed G.parentDisplacement G.parentDisplacement_bound) G.displacement /-- Child velocity, constructed using `addField`. -/ +@[expose] def childVelocity : SmoothL2Field Space := addField (addField (G.parentComposed G.parentVelocity G.parentVelocity_bound) G.velocity) (G.firstTerm G.parentDisplacement G.parentDisplacement_bound) /-- Child acceleration, constructed using `addField`. -/ +@[expose] def childAcceleration : SmoothL2Field Space := addField (addField (addField (addField (addField (G.parentComposed G.parentAcceleration G.parentAcceleration_bound) @@ -358,12 +363,14 @@ theorem childAcceleration_bound : G.childAcceleration.HasJetBound G.amplitude G. exact h theorem childDisplacement_apply (x : Space) : - G.childDisplacement.field x = G.parentDisplacement.field (G.inner x)+G.displacement.field x := - rfl + G.childDisplacement.field x = + G.parentDisplacement.field (G.inner x)+G.displacement.field x := by + rfl theorem childVelocity_apply (x : Space) : G.childVelocity.field x = G.parentVelocity.field (G.inner x)+G.velocity.field x + - fderiv ℝ G.parentDisplacement.field (G.inner x) (G.velocity.field x) := rfl + fderiv ℝ G.parentDisplacement.field (G.inner x) (G.velocity.field x) := by + rfl theorem childAcceleration_apply (x : Space) : G.childAcceleration.field x = G.parentAcceleration.field (G.inner x) + @@ -372,7 +379,8 @@ theorem childAcceleration_apply (x : Space) : fderiv ℝ (fderiv ℝ G.parentDisplacement.field) (G.inner x) (G.velocity.field x) (G.velocity.field x) + G.acceleration.field x+fderiv ℝ G.parentDisplacement.field (G.inner x) (G.acceleration.field - x) := rfl + x) := by + rfl theorem child_label_bounds (K : ℝ) (ha : EulerParameterWordGevrey.sobolevCoefficientAmplitude (Fin 3) 6 G.radius G.amplitude ≤ K) 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..5c707021b6 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 @@ -71,7 +71,7 @@ theorem coefficientOrbit_fderiv_apply (A : C(K, Space →ᵇ V)) coefficientOrbit_iteratedFDeriv_apply A hA 1 a t x (fun _ => v) /-- The derivative is itself an actual continuous path of bounded fields. -/ -def orbitDerivativePath (A : C(K, Space →ᵇ V)) (v : Space) : C(K, Space →ᵇ V) := +@[expose] def orbitDerivativePath (A : C(K, Space →ᵇ V)) (v : Space) : C(K, Space →ᵇ V) := fderiv ℝ (translateCoefficientPath A) 0 v theorem orbitDerivativePath_apply (A : C(K, Space →ᵇ V)) diff --git a/LeanPool/NavierStokesAndEuler/Euler/CoefficientPathSmooth.lean b/LeanPool/NavierStokesAndEuler/Euler/CoefficientPathSmooth.lean index 1b2f2e325f..999ddb1f11 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 @@ -104,6 +104,7 @@ variable (P : ℝ) [Fact (0 < P)] /-- Smooth coefficient, bundling `coefficient`, `smooth`, `bound`, `norm_bound` and the required compatibility proofs. -/ +@[expose] def smoothCoefficient (t : K) : SmoothCoefficient P where coefficient x := A t x.1 smooth x := (coefficientOrbit_smooth A hA t).comp (contDiff_const.add contDiff_fst) @@ -120,13 +121,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 +138,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 +158,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..c32b0d7a63 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 @@ -35,6 +35,7 @@ open Set Filter EulerSmoothLimit open scoped Topology /-- Embed the shifted time interval into the original evolution interval. -/ +@[expose] def shiftTimeMap (S T a : ℝ) (ha : 0 ≤ a) (haT : a + T ≤ S) : C(Icc (0 : ℝ) T, Icc (0 : ℝ) S) where toFun t := ⟨a + t, add_nonneg ha t.property.1, @@ -42,13 +43,14 @@ def shiftTimeMap (S T a : ℝ) (ha : 0 ≤ a) (haT : a + T ≤ S) : continuous_toFun := (continuous_subtype_val.const_add a).subtype_mk _ @[simp] theorem shiftTimeMap_val (S T a : ℝ) (ha : 0 ≤ a) (haT : a + T ≤ S) - (t : Icc (0 : ℝ) T) : ((shiftTimeMap S T a ha haT t) : ℝ) = a + t := rfl + (t : Icc (0 : ℝ) T) : ((shiftTimeMap S T a ha haT t) : ℝ) = a + t := by rfl namespace Evolution variable {S : ℝ} {hS : 0 ≤ S} /-- Restart an evolution at time `a`, retaining its next `T` units of time. -/ +@[expose] def shiftTime (U : Evolution S hS) (a : ℝ) (ha : 0 ≤ a) (T : ℝ) (hT : 0 ≤ T) (haT : a + T ≤ S) : Evolution T hT where velocity t := U.velocity (shiftTimeMap S T a ha haT t) @@ -75,12 +77,12 @@ def shiftTime (U : Evolution S hS) (a : ℝ) (ha : 0 ≤ a) @[simp] theorem shiftTime_velocity (U : Evolution S hS) (a : ℝ) (ha : 0 ≤ a) (T : ℝ) (hT : 0 ≤ T) (haT : a + T ≤ S) (t : Icc (0 : ℝ) T) : (U.shiftTime a ha T hT haT).velocity t = - U.velocity (shiftTimeMap S T a ha haT t) := rfl + U.velocity (shiftTimeMap S T a ha haT t) := by rfl @[simp] theorem shiftTime_pressureForce (U : Evolution S hS) (a : ℝ) (ha : 0 ≤ a) (T : ℝ) (hT : 0 ≤ T) (haT : a + T ≤ S) (t : Icc (0 : ℝ) T) : (U.shiftTime a ha T hT haT).pressureForce t = - U.pressureForce (shiftTimeMap S T a ha haT t) := rfl + U.pressureForce (shiftTimeMap S T a ha haT t) := by rfl theorem shiftTime_initial (U : Evolution S hS) (a : ℝ) (ha : 0 ≤ a) (T : ℝ) (hT : 0 ≤ T) (haT : a + T ≤ S) : @@ -104,7 +106,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 +162,7 @@ end end -@[expose] public section +public section noncomputable section @@ -183,6 +185,7 @@ def HasLocalEvolutionAtCompactCurl (v : Space → ℝ → Space) : Prop := /-- The reusable analytic conversion obligation, before any uniqueness argument: compact initial vorticity gives a short ordinary realization. -/ +@[expose] def CompactCurlLocalUpgrade : Prop := ∀ (u₀ : Space → Space) (v : Space → ℝ → Space) (p : Space → ℝ → ℝ), EulerExistenceAndSmoothnessR3 u₀ v p → HasCompactSupport (vectorCurl u₀) → 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..f253a6347c 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 @@ -72,7 +72,7 @@ def flowData : EulerBoundedLipschitzFlow.Data E := EulerSmoothBanachFlow.flowData T hT (reverseField A T hT1) /-- Backward flow homeomorphisms, clamped outside the chosen interval. -/ -def homeomorph (s : ℝ) : E ≃ₜ E := +@[expose] def homeomorph (s : ℝ) : E ≃ₜ E := (flowData A T hT hT1).flowHomeomorph 0 (projIcc 0 T hT s) /-- The globally defined, endpoint-extended backward coefficient. -/ @@ -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..ed2c589cfe 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 @@ -494,6 +494,7 @@ variable {u₀ : Space → Space} {v : Space → ℝ → Space} {p : Space → /-- Actual ordinary smooth-L² velocity slices recovered from a common compact vorticity support. The fields are definitionally the Comparator velocity. -/ +@[expose] def recoveredVelocity (h : EulerExistenceAndSmoothnessR3 u₀ v p) (T : ℝ) (K : Set Space) (hK : IsCompact K) (hsupport : ∀ t ∈ Icc (0 : ℝ) T, tsupport (vectorCurl (v · t)) ⊆ K) : @@ -508,7 +509,7 @@ def recoveredVelocity (h : EulerExistenceAndSmoothnessR3 u₀ v p) (T : ℝ) (K : Set Space) (hK : IsCompact K) (hsupport : ∀ t ∈ Icc (0 : ℝ) T, tsupport (vectorCurl (v · t)) ⊆ K) (t : Icc (0 : ℝ) T) : - (recoveredVelocity h T K hK hsupport t).field = (v · (t : ℝ)) := rfl + (recoveredVelocity h T K hK hsupport t).field = (v · (t : ℝ)) := by rfl /-- All genuine spatial L² tensor norms are uniformly bounded on the common compact-vorticity interval. No time regularity of these norms is assumed. -/ 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..264a74ebb3 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 @@ -327,19 +327,19 @@ variable {K V : Type*} [TopologicalSpace K] [CompactSpace K] [NormedAddCommGroup V] [NormedSpace ℝ V] /-- Ordinary translation applied to every value of an actual continuous L² path. -/ -def translate (a : Space) (f : C(K, L2Space V)) : C(K,L2Space V) := +@[expose] def translate (a : Space) (f : C(K, L2Space V)) : C(K,L2Space V) := (EulerLpTranslation.translation a).toContinuousLinearMap.compLeftContinuous ℝ K f 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)) (f : C(K, L2Space V)) (hf : ∀ t, f t = (A t).toLp) /-- The original ordinary spatial jet, as a genuine continuous L² path. -/ -def spatialJetPath (n : ℕ) : C(K,L2Space (Space [×n]→L[ℝ] V)) := +@[expose] def spatialJetPath (n : ℕ) : C(K,L2Space (Space [×n]→L[ℝ] V)) := ⟨fun t => (A t).jetLp n, hA n⟩ /-- The actual translation jets form a continuous path because they are 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..aa22ad383d 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 @@ -166,7 +166,7 @@ open scoped Topology variable (period : ℝ) [Fact (0 < period)] /-- Reflection of a derivative array includes the sign of each derivative word. -/ -def reflectionArrayOperator (q : ℕ) : +@[expose] def reflectionArrayOperator (q : ℕ) : SobolevSpace period q →L[ℝ] (SobolevWord q → LiftL2 period) := ContinuousLinearMap.pi fun w => ((-1 : ℝ) ^ w.1.val) • ((reflection period).toContinuousLinearMap.comp (wordOperator period w)) @@ -191,13 +191,14 @@ theorem reflectionArray_mem (q : ℕ) (u : SobolevSpace period q) : rfl /-- Joint pullback reflection as a genuine bounded map of the complete Sobolev space. -/ -def sobolevReflection (q : ℕ) : SobolevSpace period q →L[ℝ] SobolevSpace period q := +@[expose] def sobolevReflection (q : ℕ) : SobolevSpace period q →L[ℝ] SobolevSpace period q := (reflectionArrayOperator period q).codRestrict (sobolevSubspace period q).toSubmodule (reflectionArray_mem period q) /-- The derivative coordinates of reflection have exactly the alternating signs. -/ @[simp] theorem sobolevReflection_apply {q : ℕ} (u : SobolevSpace period q) (w : SobolevWord q) : - (sobolevReflection period q u).val w = (-1 : ℝ) ^ w.1.val • reflection period (u.val w) := rfl + (sobolevReflection period q u).val w = + (-1 : ℝ) ^ w.1.val • reflection period (u.val w) := by rfl /-- The underlying field is the actual L² pullback by joint negation. -/ @[simp] theorem value_sobolevReflection {q : ℕ} (u : SobolevSpace period q) : @@ -256,12 +257,12 @@ theorem derivative_reflection {q : ℕ} (i : Fin 4) (u : SobolevSpace period (q simp only [pow_succ, mul_smul, neg_one_smul, smul_neg] /-- The symmetry whose fixed points are odd velocity fields. -/ -def oddReflection (q : ℕ) : SobolevSpace period q →L[ℝ] SobolevSpace period q := +@[expose] def oddReflection (q : ℕ) : SobolevSpace period q →L[ℝ] SobolevSpace period q := -sobolevReflection period q /-- Odd reflection is represented by minus the field at the reflected point. -/ @[simp] theorem oddReflection_apply {q : ℕ} (u : SobolevSpace period q) : - oddReflection period q u = -sobolevReflection period q u := rfl + oddReflection period q u = -sobolevReflection period q u := by rfl /-- The signed reflection is involutive. -/ theorem oddReflection_involutive {q : ℕ} (u : SobolevSpace period q) : @@ -296,7 +297,7 @@ section /-! Reflection covariance of the literal Sobolev product, transport and pressure operators. -/ -@[expose] public section +public section noncomputable section @@ -512,7 +513,7 @@ end end -@[expose] public section +public section noncomputable section @@ -685,7 +686,7 @@ section /-! Odd parity of actual inviscid correction solutions, proved by genuine PDE uniqueness. -/ -@[expose] public section +public section noncomputable section @@ -780,7 +781,7 @@ section /-! Genuine continuous Sobolev realizations of the assembled correction and its actual pressure at every order. -/ -@[expose] public section +public section noncomputable section @@ -793,6 +794,7 @@ variable {T : ℝ} {hT : 0 < T} {A : Data period T} /-- The assembled correction as one actual L² field with continuous Sobolev realizations at every order. -/ +@[expose] def FiniteFamily.fieldTower (F : FiniteFamily period hT A) (C : ComparisonData period hT A) : FieldTower period T where field := F.commonPath period @@ -802,6 +804,7 @@ def FiniteFamily.fieldTower (F : FiniteFamily period hT A) (C : ComparisonData p /-- The actual signed pressure as one L² field with continuous Sobolev realizations at every order. -/ +@[expose] def FiniteFamily.pressureTower (F : FiniteFamily period hT A) (C : ComparisonData period hT A) : FieldTower period T where field := F.commonPressure period @@ -838,7 +841,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..4c1a52b840 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 @@ -37,6 +37,7 @@ variable (period : ℝ) [Fact (0 < period)] variable {T : ℝ} {hT : 0 < T} {A : Data period T} /-- The actual common continuous L² path, defined from the base finite correction. -/ +@[expose] def FiniteFamily.commonPath (F : FiniteFamily period hT A) : C(Icc (0 : ℝ) T, LiftL2 period) := (valueOperator period 7).compLeftContinuous ℝ (Icc (0 : ℝ) T) (F.solution 6 le_rfl) @@ -91,7 +92,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 +139,7 @@ end end -@[expose] public section +public section noncomputable section @@ -153,12 +154,13 @@ variable (period : ℝ) [Fact (0 < period)] variable {T : ℝ} {hT : 0 < T} {A : Data period T} /-- The actual continuous nonlinear raw source of each finite correction. -/ +@[expose] def FiniteFamily.rawSourcePath (F : FiniteFamily period hT A) (q : ℕ) (hq : 6 ≤ q) : C(Icc (0 : ℝ) T, SobolevSpace period q) := rawPath period hq (A.atOrder period q) (F.solution q hq) /-- The actual signed coercive pressure of each finite correction. -/ -def FiniteFamily.signedPressurePath (F : FiniteFamily period hT A) (q : ℕ) (hq : 6 ≤ q) : +@[expose] def FiniteFamily.signedPressurePath (F : FiniteFamily period hT A) (q : ℕ) (hq : 6 ≤ q) : C(Icc (0 : ℝ) T, SobolevSpace period q) := pressurePath period hq (A.atOrder period q) (F.solution q hq) @@ -210,6 +212,7 @@ theorem FiniteFamily.signedPressurePath_value_base (F : FiniteFamily period hT A (fun n hn ih => (F.signedPressurePath_value_succ period C n hn t).trans ih) q hq /-- The actual common signed correction pressure is a continuous L² path. -/ +@[expose] def FiniteFamily.commonPressure (F : FiniteFamily period hT A) : C(Icc (0 : ℝ) T, LiftL2 period) := (valueOperator period 6).compLeftContinuous ℝ (Icc (0 : ℝ) T) (F.signedPressurePath period 6 le_rfl) 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..03812aa992 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 @@ -34,6 +34,7 @@ variable {T : ℝ} {hT : 0 < T} {A : Data period T} /-- Bounded evaluation of the actual finite pressure fixes a canonical common pressure representative. -/ +@[expose] def FiniteFamily.pointPressure (F : FiniteFamily period hT A) (t : Icc (0 : ℝ) T) (x : LiftDomain period) : Vector3 := pointEvaluation period x (restrictOperator period (by omega : 3 ≤ 6) @@ -67,7 +68,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) @@ -90,6 +91,7 @@ theorem FiniteFamily.graphPressure_has_potential (F : FiniteFamily period hT A) (F.pointPressure period t) (F.pointPressure_ae period t) (F.pointPressure_smooth period C t) /-- The actual graph pressure reconstructed by a canonical radial integral based at the origin. -/ +@[expose] def FiniteFamily.normalizedGraphPotential (F : FiniteFamily period hT A) (k : ℝ) (t : Icc (0 : ℝ) T) (x : Vector3) : ℝ := radialPotential (F.graphPressure period k t) 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..f788f9a7b4 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 @@ -27,14 +27,14 @@ open scoped Topology variable (period : ℝ) [Fact (0 < period)] /-- Restrict the actual spatial coefficient and its jet along a continuous parameter map. -/ -def CoefficientPath.comp {q : ℕ} {T U : Type*} [TopologicalSpace T] [TopologicalSpace U] +@[expose] def CoefficientPath.comp {q : ℕ} {T U : Type*} [TopologicalSpace T] [TopologicalSpace U] (A : CoefficientPath period q T) (f : C(U, T)) : CoefficientPath period q U where coefficient t := A.coefficient (f t) jet t := A.jet (f t) continuous := A.continuous.comp f.continuous /-- Restrict every actual coefficient, background field, and residual along the same time map. -/ -def CorrectionData.comp {q : ℕ} {T U : Type*} [TopologicalSpace T] [TopologicalSpace U] +@[expose] def CorrectionData.comp {q : ℕ} {T U : Type*} [TopologicalSpace T] [TopologicalSpace U] (D : CorrectionData period q T) (f : C(U, T)) : CorrectionData period q U where κ := D.κ direction := D.direction @@ -54,7 +54,7 @@ theorem CorrectionData.comp_source {q : ℕ} {T U : Type*} [TopologicalSpace T] (D : CorrectionData period q T) (f : C(U, T)) (hq : 6 ≤ q) (t : U) (u : SobolevSpace period (q + 1)) : ((D.comp period f).coefficients period hq).apply t u = - (D.coefficients period hq).apply (f t) u := rfl + (D.coefficients period hq).apply (f t) u := by rfl /-- Restricting the concrete data gives precisely the same nonlinear mild equation on a shorter interval. -/ @@ -65,7 +65,7 @@ theorem CorrectionData.comp_quadraticDuhamel {q : ℕ} (hq : 6 ≤ q) (t : Icc (0 : ℝ) T) : quadraticDuhamel period ν hν hT le_rfl ((D.comp period (timeInclusion hTS)).coefficients period hq) u₀ u t = - quadraticDuhamel period ν hν hT hTS (D.coefficients period hq) u₀ u t := rfl + quadraticDuhamel period ν hν hT hTS (D.coefficients period hq) u₀ u t := by rfl end EulerCorrectionOperators @@ -74,7 +74,7 @@ end end -@[expose] public section +public section noncomputable section @@ -111,6 +111,7 @@ theorem hasDerivAt_restriction {E : Type*} [NormedAddCommGroup E] [NormedSpace variable (period : ℝ) [Fact (0 < period)] /-- Every concrete spatial budget restricts with exactly the same numerical constants. -/ +@[expose] def SpatialBudget.restrict {q : ℕ} {T S : ℝ} {hq : 6 ≤ q + 1} {D : CorrectionData period (q + 1) (Icc (0 : ℝ) S)} {N : ℕ} {R : C(Icc (0 : ℝ) S, ℝ)} (B : SpatialBudget period hq D N R) (hTS : T ≤ S) : @@ -145,6 +146,7 @@ def SpatialBudget.restrict {q : ℕ} {T S : ℝ} {hq : 6 ≤ q + 1} /-- The actual inverse metric and its genuine derivative restrict with unchanged numerical budgets. -/ +@[expose] def MetricBudget.restrict {q : ℕ} {T S : ℝ} {hS : 0 ≤ S} {D : CorrectionData period (q + 1) (Icc (0 : ℝ) S)} (K : MetricBudget period S hS D) (hT : 0 ≤ T) (hTS : T ≤ S) : 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..65d4816fff 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 @@ -220,7 +220,7 @@ def baseMetricJet {q : ℕ} (hq : 6 ≤ q + 1) {T : ℝ} EulerH6Pressure.CoefficientJet.restrict (D.metric.jet t) 6 hq /-- The actual metric budget determines its concrete continuous L² multiplier path. -/ -def MetricBudget.operatorPath {q : ℕ} {T : ℝ} {hT : 0 ≤ T} +@[expose] def MetricBudget.operatorPath {q : ℕ} {T : ℝ} {hT : 0 ≤ T} {D : CorrectionData period (q + 1) (Icc (0 : ℝ) T)} (K : MetricBudget period T hT D) : C(Icc (0 : ℝ) T, LiftL2 period →L[ℝ] LiftL2 period) := metricOperatorPath period T K.metric K.continuous @@ -243,7 +243,7 @@ theorem SpatialBudget.base_bound {q : ℕ} {T : ℝ} {hq : 6 ≤ q + 1} exact S.metric_base t r hr /-- The fixed constant part of the actual metric-growth majorant. -/ -def MetricBudget.growth0 {q : ℕ} {T : ℝ} {hT : 0 ≤ T} +@[expose] def MetricBudget.growth0 {q : ℕ} {T : ℝ} {hT : 0 ≤ T} {D : CorrectionData period (q + 1) (Icc (0 : ℝ) T)} (K : MetricBudget period T hT D) (B0 : ℝ) : ℝ := @@ -251,11 +251,12 @@ def MetricBudget.growth0 {q : ℕ} {T : ℝ} {hT : 0 ≤ T} period 6*B0 /-- The fixed linear part of the actual metric-growth majorant. -/ -def MetricBudget.growth1 {q : ℕ} {T : ℝ} {hT : 0 ≤ T} +@[expose] def MetricBudget.growth1 {q : ℕ} {T : ℝ} {hT : 0 ≤ T} {D : CorrectionData period (q + 1) (Icc (0 : ℝ) T)} (K : MetricBudget period T hT D) : ℝ := growthBudgetSlope K.c K.first*sobolevEmbeddingConstant period 6*metricAmplification K.c /-- The fixed coefficient multiplying the actual forcing norm. -/ +@[expose] def MetricBudget.multiplier {q : ℕ} {T : ℝ} {hT : 0 ≤ T} {D : CorrectionData period (q + 1) (Icc (0 : ℝ) T)} (K : MetricBudget period T hT D) : ℝ := K.bound/K.c diff --git a/LeanPool/NavierStokesAndEuler/Euler/CorrectionEnergyMajorants.lean b/LeanPool/NavierStokesAndEuler/Euler/CorrectionEnergyMajorants.lean index a9b557eb1d..fc74da767a 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 @@ -83,6 +83,7 @@ theorem velocity_divergenceFree {q : ℕ} {T : ℝ} (divergenceFreeSpace period D.κ D.direction).add_mem (hz t) (he t) /-- The fixed affine continuous majorant of actual metric growth. -/ +@[expose] def growthPath {q : ℕ} {T : ℝ} {hq : 6 ≤ q + 1} {D : CorrectionData period (q + 1) (Icc (0 : ℝ) T)} {N : ℕ} {R : C(Icc (0 : ℝ) T, ℝ)} (S : SpatialBudget period hq D N R) (hN : N + 6 ≤ q + 1) {hT : 0 ≤ T} (K : MetricBudget period @@ -95,11 +96,13 @@ def growthPath {q : ℕ} {T : ℝ} {hq : 6 ≤ q + 1} e).continuous)⟩ /-- The signed radius derivative divided by the actual positive radius. -/ +@[expose] def radiusLossPath {T : ℝ} (R Rdot : C(Icc (0 : ℝ) T, ℝ)) (hR : ∀ t, 0 < R t) : C(Icc (0 : ℝ) T, ℝ) := ⟨fun t => Rdot t/R t, Rdot.continuous.div R.continuous (fun t => (hR t).ne')⟩ /-- The literal continuous nonlinear forcing majorant. -/ +@[expose] def forcingMajorant {q : ℕ} {T : ℝ} {hq : 6 ≤ q + 1} {D : CorrectionData period (q + 1) (Icc (0 : ℝ) T)} {N : ℕ} {R : C(Icc (0 : ℝ) T, ℝ)} (S : SpatialBudget period hq D N R) (hN : N + 6 ≤ q + 1) {hT : 0 ≤ T} (K : MetricBudget period @@ -149,6 +152,7 @@ theorem forcingMajorant_bound {q : ℕ} {T : ℝ} {hq : 6 ≤ q + 1} (K.operator_coercive period) /-- The explicit cutoff-independent constant in the scalar shrinking-radius estimate. -/ +@[expose] def combinedConstant {q : ℕ} {T : ℝ} {hq : 6 ≤ q + 1} {D : CorrectionData period (q + 1) (Icc (0 : ℝ) T)} {N : ℕ} {R : C(Icc (0 : ℝ) T, ℝ)} (S : SpatialBudget period hq D N R) {hT : 0 ≤ T} (K : MetricBudget period T hT D) : ℝ := 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..804d49e56a 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 @@ -397,13 +397,14 @@ local instance correctionTimeGroup (q : ℕ) : NormedAddCommGroup (SobolevSpace local instance correctionTimeSpace (q : ℕ) : NormedSpace ℝ (SobolevSpace period q) := inferInstance /-- The actual continuous background-plus-error velocity at the energy level. -/ -def velocityPath {q : ℕ} {T : ℝ} (D : CorrectionData period (q + 1) (Icc (0 : ℝ) T)) +@[expose] def velocityPath {q : ℕ} {T : ℝ} (D : CorrectionData period (q + 1) (Icc (0 : ℝ) T)) (e : C(Icc (0 : ℝ) T, SobolevSpace period (q + 1))) : C(Icc (0 : ℝ) T, SobolevSpace period (q+1)) := (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 @@ -414,7 +415,7 @@ def lowerOrderPath {q : ℕ} (hq : 6 ≤ q + 1) {T : ℝ} (D : CorrectionData pe D.linear.operatorPath (fun i => (D.quadratic i).operatorPath) D.approximation D.residual e /-- The genuine full energy-order nonlinear raw time field, constructed using maximal regularity. -/ -def rawTime {q : ℕ} (hq : 6 ≤ q + 1) (T : ℝ) (hT : 0 ≤ T) +@[expose] def rawTime {q : ℕ} (hq : 6 ≤ q + 1) (T : ℝ) (hT : 0 ≤ T) (D : CorrectionData period (q + 1) (Icc (0 : ℝ) T)) (e : C(Icc (0 : ℝ) T, SobolevSpace period (q + 1))) (U : TimeLp T (SobolevSpace period (2 + q))) : @@ -425,7 +426,7 @@ def rawTime {q : ℕ} (hq : 6 ≤ q + 1) (T : ℝ) (hT : 0 ≤ T) (reindexMaximalTime period q T U) /-- The actual full energy-order projected nonlinear forcing belongs to Bochner L² time. -/ -def sourceTime {q : ℕ} (hq : 6 ≤ q + 1) (T : ℝ) (hT : 0 ≤ T) +@[expose] def sourceTime {q : ℕ} (hq : 6 ≤ q + 1) (T : ℝ) (hT : 0 ≤ T) (D : CorrectionData period (q + 1) (Icc (0 : ℝ) T)) (e : C(Icc (0 : ℝ) T, SobolevSpace period (q + 1))) (U : TimeLp T (SobolevSpace period (2 + q))) : @@ -434,7 +435,7 @@ def sourceTime {q : ℕ} (hq : 6 ≤ q + 1) (T : ℝ) (hT : 0 ≤ T) (rawTime period hq T hT D e U) /-- The actual signed coercive pressure has full energy-order Bochner regularity. -/ -def signedPressureTime {q : ℕ} (hq : 6 ≤ q + 1) (T : ℝ) (hT : 0 ≤ T) +@[expose] def signedPressureTime {q : ℕ} (hq : 6 ≤ q + 1) (T : ℝ) (hT : 0 ≤ T) (D : CorrectionData period (q + 1) (Icc (0 : ℝ) T)) (e : C(Icc (0 : ℝ) T, SobolevSpace period (q + 1))) (U : TimeLp T (SobolevSpace period (2 + q))) : @@ -444,6 +445,7 @@ def signedPressureTime {q : ℕ} (hq : 6 ≤ q + 1) (T : ℝ) (hT : 0 ≤ T) /-- The actual limiting weighted word forcing constructed from the genuine correction time fields. -/ +@[expose] def weightedCorrectionForcing {q : ℕ} (hq : 6 ≤ q + 1) (T : ℝ) (hT : 0 ≤ T) (D : CorrectionData period (q + 1) (Icc (0 : ℝ) T)) (hG : Continuous (fun t => (D.metric.coefficient t).operator)) @@ -459,7 +461,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..ced5d7c2c6 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)) @@ -182,7 +182,7 @@ def lowerData {q : ℕ} {T : ℝ} (D : CorrectionData period (q + 1) (Icc (0 : residual := (truncateOperator period q).compLeftContinuous ℝ (Icc (0 : ℝ) T) D.residual /-- The actual nonlinear raw source along a continuous Sobolev path is continuous. -/ -def rawPath {q : ℕ} (hq : 6 ≤ q) {T : ℝ} (D : CorrectionData period q (Icc (0 : ℝ) T)) +@[expose] def rawPath {q : ℕ} (hq : 6 ≤ q) {T : ℝ} (D : CorrectionData period q (Icc (0 : ℝ) T)) (e : C(Icc (0 : ℝ) T, SobolevSpace period (q + 1))) : C(Icc (0 : ℝ) T, SobolevSpace period q) := ⟨fun t => D.rawSource period hq t (e t), (((D.coefficients period hq).forcing.continuous.add @@ -191,13 +191,14 @@ def rawPath {q : ℕ} (hq : 6 ≤ q) {T : ℝ} (D : CorrectionData period q (Icc e.continuous))⟩ /-- The actual projected nonlinear mild forcing along the continuous solution. -/ -def forcingPath {q : ℕ} (hq : 6 ≤ q) {T : ℝ} (D : CorrectionData period q (Icc (0 : ℝ) T)) +@[expose] def forcingPath {q : ℕ} (hq : 6 ≤ q) {T : ℝ} (D : CorrectionData period q (Icc (0 : ℝ) T)) (e : C(Icc (0 : ℝ) T, SobolevSpace period (q + 1))) : C(Icc (0 : ℝ) T, SobolevSpace period q) := ⟨fun t => (D.coefficients period hq).apply t (e t), ((D.coefficients period hq).projection.continuous.clm_apply (rawPath period hq D e).continuous).neg⟩ /-- The actual signed coercive pressure along the continuous solution is continuous. -/ +@[expose] def pressurePath {q : ℕ} (hq : 6 ≤ q) {T : ℝ} (D : CorrectionData period q (Icc (0 : ℝ) T)) (e : C(Icc (0 : ℝ) T, SobolevSpace period (q + 1))) : C(Icc (0 : ℝ) T, SobolevSpace period q) := ⟨fun t => D.pressure period hq t (e t), diff --git a/LeanPool/NavierStokesAndEuler/Euler/CorrectionMildEnergy.lean b/LeanPool/NavierStokesAndEuler/Euler/CorrectionMildEnergy.lean index 49d7562a99..2b9beea7f2 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 @@ -37,6 +37,7 @@ open scoped Topology variable (period : ℝ) [Fact (0 < period)] /-- The actual continuous scalar right-hand side of the nonlinear correction energy estimate. -/ +@[expose] def correctionRhs {q : ℕ} {T : ℝ} {hq : 6 ≤ q + 1} {D : CorrectionData period (q + 1) (Icc (0 : ℝ) T)} {N : ℕ} {R : C(Icc (0 : ℝ) T, ℝ)} (S : SpatialBudget period hq D N R) (hN : N + 6 ≤ q + 1) {hT : 0 ≤ T} (K : MetricBudget period diff --git a/LeanPool/NavierStokesAndEuler/Euler/CorrectionOperators.lean b/LeanPool/NavierStokesAndEuler/Euler/CorrectionOperators.lean index 7c87addc67..99e522e4a1 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 @@ -29,18 +29,18 @@ variable {X Y : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] [NormedAddCommGroup Y] [NormedSpace ℝ Y] /-- Postcompose an actual continuous bilinear map by an actual bounded operator. -/ -def postcompose (A : Y →L[ℝ] Y) (B : X →L[ℝ] X →L[ℝ] Y) : X →L[ℝ] X →L[ℝ] Y := +@[expose] def postcompose (A : Y →L[ℝ] Y) (B : X →L[ℝ] X →L[ℝ] Y) : X →L[ℝ] X →L[ℝ] Y := (ContinuousLinearMap.compL ℝ X Y Y A).comp B @[simp] theorem postcompose_apply (A : Y →L[ℝ] Y) (B : X →L[ℝ] X →L[ℝ] Y) (u v : X) : - postcompose A B u v = A (B u v) := rfl + postcompose A B u v = A (B u v) := by rfl /-- Linearization of a quadratic term about the actual approximate solution. -/ def linearize (B : X →L[ℝ] X →L[ℝ] Y) (C : X →L[ℝ] Y) (z : X) : X →L[ℝ] Y := B z + B.flip z + C @[simp] theorem linearize_apply (B : X →L[ℝ] X →L[ℝ] Y) (C : X →L[ℝ] Y) (z e : X) : - linearize B C z e = B z e + B e z + C e := rfl + linearize B C z e = B z e + B e z + C e := by rfl /-- The correction source is exactly the difference of the full quadratic equations. -/ theorem quadratic_correction_identity (B : X →L[ℝ] X →L[ℝ] Y) (C : X →L[ℝ] Y) (z e : X) : @@ -72,7 +72,7 @@ local instance sobolevBilinearGroup (q : ℕ) : SeminormedAddCommGroup inferInstance /-- The actual derivative-free coordinate product on the input Sobolev level. -/ -def coordinateProduct {q : ℕ} (hq : 6 ≤ q) (i : Fin 3) : +@[expose] def coordinateProduct {q : ℕ} (hq : 6 ≤ q) (i : Fin 3) : SobolevSpace period (q+1) →L[ℝ] SobolevSpace period (q+1) →L[ℝ] SobolevSpace period q := (productHqBilinear period hq (coordinate 3 i) (coordinate_norm_le 3 i)).bilinearComp (truncateOperator period q) (truncateOperator period q) @@ -81,10 +81,11 @@ def coordinateProduct {q : ℕ} (hq : 6 ≤ q) (i : Fin 3) : (u v : SobolevSpace period (q + 1)) : coordinateProduct period hq i u v = productHq period hq (coordinate 3 i) (coordinate_norm_le 3 i) - (truncateOperator period q u) (truncateOperator period q v) := rfl + (truncateOperator period q u) (truncateOperator period q v) := by + simp only [coordinateProduct, ContinuousLinearMap.bilinearComp_apply, productHqBilinear_apply] /-- The actual order-zero quadratic coefficient terms, Σ Cᵢ(uᵢ v). -/ -def algebraicBilinear {q : ℕ} (hq : 6 ≤ q) +@[expose] def algebraicBilinear {q : ℕ} (hq : 6 ≤ q) (C : Fin 3 → SobolevSpace period q →L[ℝ] SobolevSpace period q) : SobolevSpace period (q+1) →L[ℝ] SobolevSpace period (q+1) →L[ℝ] SobolevSpace period q := ∑ i : Fin 3, postcompose (C i) (coordinateProduct period hq i) @@ -96,7 +97,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 := @@ -128,9 +129,7 @@ theorem algebraicBilinear_ae {q : ℕ} (hq : 6 ≤ q) hv] with x h1 h2 h3 h4 rw [h1] - change (C i).coefficient x (value period (productHq period hq (coordinate 3 i) - (coordinate_norm_le 3 i) - (truncateOperator period q u) (truncateOperator period q v)) x) = _ + rw [coordinateProduct_apply] rw [h2, value_truncateOperator, value_truncateOperator, h3, h4, map_smul] rfl filter_upwards [Lp.coeFn_finsetSum Finset.univ (fun i : Fin 3 => value period diff --git a/LeanPool/NavierStokesAndEuler/Euler/CorrectionResidualCancellation.lean b/LeanPool/NavierStokesAndEuler/Euler/CorrectionResidualCancellation.lean index 5215ab0396..2d0390fe78 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 @@ -33,7 +33,7 @@ local instance residualSobolevGroup (q : ℕ) : NormedAddCommGroup (SobolevSpace local instance residualSobolevSpace (q : ℕ) : NormedSpace ℝ (SobolevSpace period q) := inferInstance /-- The actual linear coefficient plus the full transport-and-algebraic quadratic nonlinearity. -/ -def nonlinearity {q : ℕ} {T : Type*} [TopologicalSpace T] +@[expose] def nonlinearity {q : ℕ} {T : Type*} [TopologicalSpace T] (D : CorrectionData period q T) (hq : 6 ≤ q) (t : T) (u : SobolevSpace period (q + 1)) : SobolevSpace period q := coefficientSobolevOperator period (D.linear.jet t) (truncateOperator period q u) + 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..fce684d2f6 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,15 +26,15 @@ 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. -/ -def defectConstant (Kb R : ℝ) : ℝ := (Kb*(4*R))^2 +@[expose] def defectConstant (Kb R : ℝ) : ℝ := (Kb*(4*R))^2 variable (period : ℝ) [Fact (0 < period)] 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..eb1b9125fd 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 @@ -37,7 +37,7 @@ theorem angleCurve_continuous (u : CylinderL2 P V) : Continuous (angleCurve P u) (translate_continuous P u).comp (continuous_const.prodMk continuous_id) /-- Average integral, given by `P⁻¹ • (∫ s in (0 : ℝ)..P, angleCurve P u s)`. -/ -def averageIntegral (u : CylinderL2 P V) : CylinderL2 P V := +@[expose] def averageIntegral (u : CylinderL2 P V) : CylinderL2 P V := P⁻¹ • (∫ s in (0 : ℝ)..P, angleCurve P u s) omit [CompleteSpace V] in @@ -79,20 +79,26 @@ theorem averageIntegral_norm (u : CylinderL2 P V) : ‖averageIntegral P u‖ _ = ‖u‖ := by field_simp /-- Average linear, bundling `toFun`, `map_add`, `map_smul`. -/ -def averageLinear : CylinderL2 P V →ₗ[ℝ] CylinderL2 P V where +@[expose] def averageLinear : CylinderL2 P V →ₗ[ℝ] CylinderL2 P V where toFun := averageIntegral P map_add' := averageIntegral_add P map_smul' := averageIntegral_smul P /-- The Bochner average of genuine angular translations. -/ -def average : CylinderL2 P V →L[ℝ] CylinderL2 P V := +@[expose] def average : CylinderL2 P V →L[ℝ] CylinderL2 P V := (averageLinear P).mkContinuous 1 (fun u => by change ‖averageIntegral P u‖ ≤ (1 : ℝ)*‖u‖ simpa only [one_mul] using averageIntegral_norm P u) 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 := @@ -117,12 +123,12 @@ theorem average_translation (a : LiftTangent) (u : CylinderL2 P V) : variable {K : Type*} [TopologicalSpace K] [CompactSpace K] /-- Path average, given by `(average P).compLeftContinuous ℝ K`. -/ -def pathAverage : C(K,CylinderL2 P V) →L[ℝ] C(K,CylinderL2 P V) := +@[expose] def pathAverage : C(K,CylinderL2 P V) →L[ℝ] C(K,CylinderL2 P V) := (average P).compLeftContinuous ℝ K 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 @@ -212,12 +219,12 @@ theorem average_mem (u : Supported P V S hS) : /-- Supported average, given by `((average P).comp (Supported P V S hS).subtypeL).codRestrict (Supported P V S hS) (average_mem P S hS)`. -/ -def supportedAverage : Supported P V S hS →L[ℝ] Supported P V S hS := +@[expose] def supportedAverage : Supported P V S hS →L[ℝ] Supported P V S hS := ((average P).comp (Supported P V S hS).subtypeL).codRestrict (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..fb46f68729 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 @@ -33,9 +33,13 @@ theorem average_full_translation (a : LiftDomain P) (u : LiftL2 P) : exact translations_commute P a (coveringMap P (0,s)) v /-- Sobolev average, given by `liftOperator P q (average P) (average_full_translation P)`. -/ -def sobolevAverage (q : ℕ) : SobolevSpace P q →L[ℝ] SobolevSpace P q := +@[expose] 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,12 +52,14 @@ 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)) rw [map_smul, ← (valueOperator P q).intervalIntegral_comp_comm ((sobolevAngleCurve_continuous P u).intervalIntegrable 0 P)] - rfl + rw [average_eq_integral] + congr 1 theorem pointEvaluation_average_kernel (u : SobolevSpace P 3) (x : LiftDomain P) : pointEvaluation P x (sobolevAverage P 3 u) = P⁻¹ • (∫ s in (0 : ℝ)..P, @@ -92,6 +98,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 +112,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..1d9cdc53b2 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,21 +24,22 @@ 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) := continuous_id.smul ((translation_continuous P u).comp (angleShift_continuous P)) /-- Kernel integral, given by `P⁻¹ • (∫ s in (0 : ℝ)..P, kernelCurve P u s)`. -/ -def kernelIntegral (u : LiftL2 P) : LiftL2 P := P⁻¹ • (∫ s in (0 : ℝ)..P, kernelCurve P u s) +@[expose] def kernelIntegral (u : LiftL2 P) : LiftL2 P := + P⁻¹ • (∫ s in (0 : ℝ)..P, kernelCurve P u s) theorem kernelIntegral_add (u v : LiftL2 P) : kernelIntegral P (u+v) = kernelIntegral P u+kernelIntegral P v := by @@ -80,16 +81,16 @@ theorem kernelIntegral_norm (u : LiftL2 P) : ‖kernelIntegral P u‖ ≤ P*‖u _ = P*‖u‖ := by field_simp /-- Primitive linear, bundling `toFun`, `map_add`, `map_smul`. -/ -def primitiveLinear : LiftL2 P →ₗ[ℝ] LiftL2 P where +@[expose] def primitiveLinear : LiftL2 P →ₗ[ℝ] LiftL2 P where toFun := kernelIntegral P map_add' := kernelIntegral_add P map_smul' := kernelIntegral_smul P /-- Primitive, given by `(primitiveLinear P).mkContinuous P (kernelIntegral_norm P)`. -/ -def primitive : LiftL2 P →L[ℝ] LiftL2 P := +@[expose] 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 +115,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..b8005253f6 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,14 @@ 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] + all_goals + congr 1 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 +101,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 +150,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..15cc3a3e69 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 @@ -42,7 +42,7 @@ synthesis. -/ local instance instCylinderBoundedCover4 : NormedSpace ℝ (LiftTangent →ᵇ Space) := inferInstance /-- Cover, constructed using `BoundedContinuousFunction.ofNormedAddCommGroup`. -/ -def cover (u : SobolevSpace P 3) : LiftTangent →ᵇ Space := +@[expose] def cover (u : SobolevSpace P 3) : LiftTangent →ᵇ Space := BoundedContinuousFunction.ofNormedAddCommGroup (fun x => EulerSobolevPointEvaluation.pointEvaluation P (coveringMap P x) u) ((EulerSobolevPointEvaluation.representative_continuous P u).comp @@ -51,7 +51,7 @@ def cover (u : SobolevSpace P 3) : LiftTangent →ᵇ Space := (fun x => EulerSobolevPointEvaluation.representative_bound P u (coveringMap P x)) @[simp] theorem cover_apply (u : SobolevSpace P 3) (x : LiftTangent) : - cover P u x = EulerSobolevPointEvaluation.pointEvaluation P (coveringMap P x) u := rfl + cover P u x = EulerSobolevPointEvaluation.pointEvaluation P (coveringMap P x) u := by rfl theorem cover_norm_le (u : SobolevSpace P 3) : ‖cover P u‖ ≤ sobolevEmbeddingConstant P 3 * ‖u‖ := by @@ -61,7 +61,7 @@ theorem cover_norm_le (u : SobolevSpace P 3) : exact EulerSobolevPointEvaluation.representative_bound P u (coveringMap P x) /-- Cover linear, bundling `toFun`, `map_add`, `map_smul`. -/ -def coverLinear : SobolevSpace P 3 →ₗ[ℝ] (LiftTangent →ᵇ Space) where +@[expose] def coverLinear : SobolevSpace P 3 →ₗ[ℝ] (LiftTangent →ᵇ Space) where toFun := cover P map_add' u v := by apply BoundedContinuousFunction.ext @@ -73,7 +73,7 @@ def coverLinear : SobolevSpace P 3 →ₗ[ℝ] (LiftTangent →ᵇ Space) where exact (EulerSobolevPointEvaluation.pointEvaluation P (coveringMap P x)).map_smul c u /-- Cover map, bundling `toLinearMap`, `cont`. -/ -def coverMap : SobolevSpace P 3 →L[ℝ] (LiftTangent →ᵇ Space) where +@[expose] def coverMap : SobolevSpace P 3 →L[ℝ] (LiftTangent →ᵇ Space) where toLinearMap := coverLinear P cont := AddMonoidHomClass.continuous_of_bound (coverLinear P) (sobolevEmbeddingConstant P 3) (cover_norm_le P) @@ -100,7 +100,7 @@ synthesis. -/ local instance instCylinderBoundedCover8 : NormedSpace ℝ C(K, LiftTangent →ᵇ Space) := inferInstance /-- Cover path map, given by `(coverMap P).compLeftContinuous ℝ K`. -/ -def coverPathMap : C(K, SobolevSpace P 3) →L[ℝ] C(K, LiftTangent →ᵇ Space) := +@[expose] def coverPathMap : C(K, SobolevSpace P 3) →L[ℝ] C(K, LiftTangent →ᵇ Space) := (coverMap P).compLeftContinuous ℝ K theorem coverPathMap_norm_le : @@ -114,6 +114,7 @@ theorem coverPathMap_norm_le : (mul_le_mul_of_nonneg_left (p.norm_coe_le_norm t) (sobolevEmbeddingConstant_nonneg P 3)) /-- Cover path, given by `coverPathMap P (sobolevPath P 3 p hp)`. -/ +@[expose] def coverPath (p : C(K, LiftL2 P)) (hp : ContDiff ℝ ∞ (fun a : LiftTangent => pathTranslate P a p)) : C(K, LiftTangent →ᵇ Space) := coverPathMap P (sobolevPath P 3 p hp) @@ -121,7 +122,7 @@ def coverPath (p : C(K, LiftL2 P)) @[simp] theorem coverPath_apply (p : C(K, LiftL2 P)) (hp : ContDiff ℝ ∞ (fun a : LiftTangent => pathTranslate P a p)) (t : K) (x : LiftTangent) : - coverPath P p hp t x = pointField P p hp t (coveringMap P x) := rfl + coverPath P p hp t x = pointField P p hp t (coveringMap P x) := by rfl /-- Cover orbit, given by `coverPathMap P (sobolevOrbit P 3 p hp a)`. -/ def coverOrbit (p : C(K, LiftL2 P)) 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..5626a0ff5c 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 @@ -26,7 +26,7 @@ variable (period : ℝ) [Fact (0 < period)] [NormedAddCommGroup F] [NormedSpace ℝ F] [NormedAddCommGroup G] [NormedSpace ℝ G] /-- Map, given by `L.compLpL 2 (liftMeasure period)`. -/ -def map (L : E →L[ℝ] F) : CylinderL2 period E →L[ℝ] CylinderL2 period F := +@[expose] def map (L : E →L[ℝ] F) : CylinderL2 period E →L[ℝ] CylinderL2 period F := L.compLpL 2 (liftMeasure period) theorem map_ae (L : E →L[ℝ] F) (u : CylinderL2 period E) : @@ -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..eb89f7da1c 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 @@ -73,19 +73,21 @@ namespace Coefficients variable (P : ℝ) [Fact (0 < P)] {T : ℝ} (D : Coefficients T U E) /-- Frame, given by `fullPathMap P D.Q`. -/ -def frame : C(Icc (0 : ℝ) T,CylinderL2 P U →L[ℝ] CylinderL2 P E) := fullPathMap P D.Q +@[expose] def frame : C(Icc (0 : ℝ) T,CylinderL2 P U →L[ℝ] CylinderL2 P E) := fullPathMap P D.Q /-- Frame derivative, given by `fullPathMap P D.Q₁`. -/ -def frameDerivative : C(Icc (0 : ℝ) T,CylinderL2 P U →L[ℝ] CylinderL2 P E) := fullPathMap P D.Q₁ +@[expose] def frameDerivative : C(Icc (0 : ℝ) T,CylinderL2 P U →L[ℝ] CylinderL2 P E) := + fullPathMap P D.Q₁ /-- Frame second, given by `fullPathMap P D.Q₂`. -/ def frameSecond : C(Icc (0 : ℝ) T,CylinderL2 P U →L[ℝ] CylinderL2 P E) := fullPathMap P D.Q₂ /-- Hessian, given by `fullPathMap P D.H`. -/ -def hessian : C(Icc (0 : ℝ) T,CylinderL2 P E →L[ℝ] CylinderL2 P E) := fullPathMap P D.H +@[expose] def hessian : C(Icc (0 : ℝ) T,CylinderL2 P E →L[ℝ] CylinderL2 P E) := fullPathMap P D.H 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,61 +103,66 @@ 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. -/ -def coordinateSolver : TimeLp T (CylinderL2 P E) →L[ℝ] +@[expose] def coordinateSolver : TimeLp T (CylinderL2 P E) →L[ℝ] zeroTraceDerivatives (U := CylinderL2 P U) T D.time_pos.le := fixedFrameSolver T D.time_pos.le (D.frame P) (D.frameDerivative P) (D.hessian P) D.lower D.lower_pos (D.frame_lower P) (D.frame_derivative P) D.potential D.potential_nonneg (D.hessian_upper P) D.small /-- Velocity Lᵖ, constructed using `EulerTransverseFixedEvolution.velocityLp`. -/ -def velocityLp : TimeLp T (CylinderL2 P E) →L[ℝ] TimeLp T (CylinderL2 P U) := +@[expose] def velocityLp : TimeLp T (CylinderL2 P E) →L[ℝ] TimeLp T (CylinderL2 P U) := EulerTransverseFixedEvolution.velocityLp T D.time_pos.le (D.frame P) (D.frameDerivative P) (D.hessian P) D.lower D.lower_pos (D.frame_lower P) (D.frame_derivative P) D.potential D.potential_nonneg (D.hessian_upper P) D.small /-- Acceleration Lᵖ, constructed using `EulerTransverseFixedEvolution.accelerationLp`. -/ -def accelerationLp : TimeLp T (CylinderL2 P E) →L[ℝ] TimeLp T (CylinderL2 P U) := +@[expose] def accelerationLp : TimeLp T (CylinderL2 P E) →L[ℝ] TimeLp T (CylinderL2 P U) := EulerTransverseFixedEvolution.accelerationLp T D.time_pos.le (D.frame P) (D.frameDerivative P) (D.hessian P) D.lower D.lower_pos (D.frame_lower P) (D.frame_derivative P) D.potential D.potential_nonneg (D.hessian_upper P) D.small /-- Velocity path, constructed using `EulerTransverseFixedEvolution.velocityPath`. -/ -def velocityPath : TimeLp T (CylinderL2 P E) →L[ℝ] C(Icc (0 : ℝ) T,CylinderL2 P U) := +@[expose] def velocityPath : TimeLp T (CylinderL2 P E) →L[ℝ] C(Icc (0 : ℝ) T,CylinderL2 P U) := EulerTransverseFixedEvolution.velocityPath T D.time_pos.le (D.frame P) (D.frameDerivative P) (D.hessian P) D.lower D.lower_pos (D.frame_lower P) (D.frame_derivative P) D.potential D.potential_nonneg (D.hessian_upper P) D.small /-- Acceleration path, constructed using `EulerTransverseFixedEvolution.classicalAcceleration`. -/ -def accelerationPath (f : C(Icc (0 : ℝ) T, CylinderL2 P E)) : C(Icc (0 : ℝ) T,CylinderL2 P U) := +@[expose] def accelerationPath (f : C(Icc (0 : ℝ) T, CylinderL2 P E)) : + C(Icc (0 : ℝ) T,CylinderL2 P U) := EulerTransverseFixedEvolution.classicalAcceleration T D.time_pos.le (D.frame P) (D.frameDerivative P) (D.hessian P) D.lower D.lower_pos (D.frame_lower P) (D.frame_derivative P) D.potential D.potential_nonneg (D.hessian_upper P) D.small f /-- Displacement path, constructed using `EulerTransverseFixedEvolution.displacementPath`. -/ -def displacementPath (f : TimeLp T (CylinderL2 P E)) : C(Icc (0 : ℝ) T,CylinderL2 P U) := +@[expose] def displacementPath (f : TimeLp T (CylinderL2 P E)) : + C(Icc (0 : ℝ) T,CylinderL2 P U) := EulerTransverseFixedEvolution.displacementPath T D.time_pos.le (D.frame P) (D.frameDerivative P) (D.hessian P) D.lower D.lower_pos (D.frame_lower P) (D.frame_derivative P) D.potential D.potential_nonneg (D.hessian_upper P) D.small f /-- Physical velocity, constructed using `EulerTransverseFixedEvolution.physicalVelocityPath`. -/ -def physicalVelocity (f : C(Icc (0 : ℝ) T, CylinderL2 P E)) : C(Icc (0 : ℝ) T,CylinderL2 P E) := +@[expose] def physicalVelocity (f : C(Icc (0 : ℝ) T, CylinderL2 P E)) : + C(Icc (0 : ℝ) T,CylinderL2 P E) := EulerTransverseFixedEvolution.physicalVelocityPath T D.time_pos.le (D.frame P) (D.frameDerivative P) (D.hessian P) D.lower D.lower_pos (D.frame_lower P) (D.frame_derivative P) @@ -163,7 +170,8 @@ def physicalVelocity (f : C(Icc (0 : ℝ) T, CylinderL2 P E)) : C(Icc (0 : ℝ) /-- Physical derivative, constructed using `EulerTransverseFixedEvolution.physicalDerivativePath`. -/ -def physicalDerivative (f : C(Icc (0 : ℝ) T, CylinderL2 P E)) : C(Icc (0 : ℝ) T,CylinderL2 P E) := +@[expose] def physicalDerivative (f : C(Icc (0 : ℝ) T, CylinderL2 P E)) : + C(Icc (0 : ℝ) T,CylinderL2 P E) := EulerTransverseFixedEvolution.physicalDerivativePath T D.time_pos.le (D.frame P) (D.frameDerivative P) (D.hessian P) D.lower D.lower_pos (D.frame_lower P) (D.frame_derivative P) 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..80f852a0a4 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 @@ -68,7 +68,7 @@ def zeroTraceMap (A : U →L[ℝ] V) : rw [initialTrace_timeLift,hu,map_zero]) @[simp] theorem zeroTraceMap_coe (A : U →L[ℝ] V) (u : zeroTraceDerivatives (U := U) T hT) : - (zeroTraceMap T hT A u : TimeLp T V) = timeLift T A (u : TimeLp T U) := rfl + (zeroTraceMap T hT A u : TimeLp T V) = timeLift T A (u : TimeLp T U) := by rfl theorem zeroTraceMap_norm (A : U →L[ℝ] V) : ‖zeroTraceMap T hT A‖ ≤ ‖A‖ := by apply opNorm_le_bound _ (norm_nonneg A) @@ -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..89c9b36bb2 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 @@ -29,7 +29,7 @@ variable (P : ℝ) [Fact (0 < P)] {V : Type*} /-- Spatial cutoff, given by `cutoffOperator (liftMeasure P) (spatialSet P S) (spatialSet_measurable P S hS)`. -/ -def spatialCutoff : CylinderL2 P V →L[ℝ] CylinderL2 P V := +@[expose] def spatialCutoff : CylinderL2 P V →L[ℝ] CylinderL2 P V := cutoffOperator (liftMeasure P) (spatialSet P S) (spatialSet_measurable P S hS) theorem spatialCutoff_norm : ‖spatialCutoff (V := V) P S hS‖ ≤ 1 := by 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..1449f29e75 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 @@ -56,7 +56,7 @@ variable {T : ℝ} {U E : Type*} /-- The actual translated coefficient fields, with their inherited pointwise time derivatives and unchanged coercivity constants. -/ -def shifted (a : Space) : Coefficients T U E where +@[expose] def shifted (a : Space) : Coefficients T U E where time_pos := D.time_pos Q := translateCoefficientPath D.Q a Q₁ := translateCoefficientPath D.Q₁ a diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointBudget.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointBudget.lean index 1a5e866edb..314d10ed11 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 +@[expose] 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..0b02cc07ef 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 @@ -41,7 +41,7 @@ variable {U E : Type*} (P : ℝ) [Fact (0 < P)] {T : ℝ} (D : Coefficients T U E) /-- The genuine zero-trace correction to the affine terminal lift. -/ -def endpointCorrection : CylinderL2 P U →L[ℝ] +@[expose] def endpointCorrection : CylinderL2 P U →L[ℝ] zeroTraceDerivatives (U := CylinderL2 P U) T D.time_pos.le := fixedEndpointCorrection T D.time_pos.le (D.frame P) (D.frameDerivative P) (D.hessian P) D.lower D.lower_pos (D.frame_lower P) (D.frame_derivative P) @@ -49,16 +49,17 @@ def endpointCorrection : CylinderL2 P U →L[ℝ] (affineTrial T D.time_pos.le (D.frame P) (D.frameDerivative P)) /-- The actual coordinate derivative in L² time. -/ -def endpointSlope : CylinderL2 P U →L[ℝ] TimeLp T (CylinderL2 P U) := +@[expose] def endpointSlope : CylinderL2 P U →L[ℝ] TimeLp T (CylinderL2 P U) := coordinateSlope T D.time_pos.le (D.frame P) (D.frameDerivative P) (D.hessian P) D.lower D.lower_pos (D.frame_lower P) (D.frame_derivative P) D.potential D.potential_nonneg (D.hessian_upper P) D.small /-- The actual coordinate displacement with prescribed terminal trace. -/ -def endpointDisplacement : CylinderL2 P U →L[ℝ] C(Icc (0 : ℝ) T,CylinderL2 P U) := +@[expose] def endpointDisplacement : CylinderL2 P U →L[ℝ] C(Icc (0 : ℝ) T,CylinderL2 P U) := (initialPrimitive T D.time_pos.le).comp (D.endpointSlope P) /-- Bounded H¹ reconstruction of the stationary coordinate velocity. -/ +@[expose] def endpointCoordinate : CylinderL2 P U →L[ℝ] C(Icc (0 : ℝ) T,CylinderL2 P U) := continuousCoordinateVelocity T D.time_pos.le (D.frame P) (D.frameDerivative P) (D.hessian P) D.lower D.lower_pos (D.frame_lower P) (D.frame_derivative P) @@ -71,11 +72,11 @@ def endpointAcceleration : CylinderL2 P U →L[ℝ] C(Icc (0 : ℝ) T,CylinderL2 (D.endpointCoordinate P) /-- The physical history velocity, with a genuine L² terminal datum. -/ -def endpointVelocity : CylinderL2 P U →L[ℝ] C(Icc (0 : ℝ) T,CylinderL2 P E) := +@[expose] def endpointVelocity : CylinderL2 P U →L[ℝ] C(Icc (0 : ℝ) T,CylinderL2 P E) := (EulerContinuousTimeIntegral.multiplier (D.frame P)).comp (D.endpointCoordinate P) /-- The product-rule expression for the actual physical time derivative. -/ -def endpointDerivative : CylinderL2 P U →L[ℝ] C(Icc (0 : ℝ) T,CylinderL2 P E) := +@[expose] def endpointDerivative : CylinderL2 P U →L[ℝ] C(Icc (0 : ℝ) T,CylinderL2 P E) := (EulerContinuousTimeIntegral.multiplier (D.frameDerivative P)).comp (D.endpointCoordinate P) + (EulerContinuousTimeIntegral.multiplier (D.frame P)).comp (D.endpointAcceleration P) 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..fb75abdaba 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 @@ -64,7 +64,7 @@ def affineAcceleration (Y : U) : C(Icc (0 : ℝ) T,E) := omit [CompleteSpace U] [CompleteSpace E] in /-- The genuine affine forcing, as a bounded linear function of terminal data. -/ -def affineForcing : U →L[ℝ] C(Icc (0 : ℝ) T,E) := +@[expose] def affineForcing : U →L[ℝ] C(Icc (0 : ℝ) T,E) := (2 : ℝ) • (multiplier Q₁).comp ((ContinuousLinearMap.const ℝ (Icc (0 : ℝ) T)).comp (T⁻¹ • ContinuousLinearMap.id ℝ U)) @@ -181,7 +181,7 @@ end end -@[expose] public section +public section noncomputable section @@ -200,12 +200,12 @@ variable {U E : Type*} (P : ℝ) [Fact (0 < P)] {T : ℝ} (D : Coefficients T U E) /-- The exact forcing of the affine endpoint correction. -/ -def endpointForcing : CylinderL2 P U →L[ℝ] C(Icc (0 : ℝ) T,CylinderL2 P E) := +@[expose] def endpointForcing : CylinderL2 P U →L[ℝ] C(Icc (0 : ℝ) T,CylinderL2 P E) := affineForcing T (D.frameDerivative P) omit [CompleteSpace U] [CompleteSpace E] in theorem endpointForcing_apply (Y : CylinderL2 P U) (t : Icc (0 : ℝ) T) : - D.endpointForcing P Y t = (2 : ℝ) • D.frameDerivative P t (T⁻¹ • Y) := rfl + D.endpointForcing P Y t = (2 : ℝ) • D.frameDerivative P t (T⁻¹ • Y) := by rfl /-- Equality of the genuinely constructed corrections, not a new solution assumption. -/ theorem endpointCorrection_eq_forced (Y : CylinderL2 P U) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointLabels.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointLabels.lean index 49f2c9bd68..f56c63cd8e 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 @@ -29,13 +29,14 @@ variable {T : ℝ} {U E : Type*} (D : Coefficients T U E) /-- Label frame, given by `pathEvaluation x D.Q`. -/ -def labelFrame (x : Space) : C(Icc (0 : ℝ) T,U →L[ℝ] E) := pathEvaluation x D.Q +@[expose] def labelFrame (x : Space) : C(Icc (0 : ℝ) T,U →L[ℝ] E) := pathEvaluation x D.Q /-- Label frame derivative, given by `pathEvaluation x D.Q₁`. -/ -def labelFrameDerivative (x : Space) : C(Icc (0 : ℝ) T,U →L[ℝ] E) := pathEvaluation x D.Q₁ +@[expose] def labelFrameDerivative (x : Space) : C(Icc (0 : ℝ) T,U →L[ℝ] E) := + pathEvaluation x D.Q₁ /-- Label frame second, given by `pathEvaluation x D.Q₂`. -/ def labelFrameSecond (x : Space) : C(Icc (0 : ℝ) T,U →L[ℝ] E) := pathEvaluation x D.Q₂ /-- Label hessian, given by `pathEvaluation x D.H`. -/ -def labelHessian (x : Space) : C(Icc (0 : ℝ) T,E →L[ℝ] E) := pathEvaluation x D.H +@[expose] def labelHessian (x : Space) : C(Icc (0 : ℝ) T,E →L[ℝ] E) := pathEvaluation x D.H omit [CompleteSpace U] [CompleteSpace E] in theorem labelFrame_lower (x : Space) (t : Icc (0 : ℝ) T) (v : U) : @@ -71,13 +72,13 @@ theorem labelHessian_upper (x : Space) (t : Icc (0 : ℝ) T) (v : E) : /-- The already constructed finite-dimensional stationary history, at this label, applied to an ordinary terminal coordinate. -/ -def labelCoordinate (x : Space) : U →L[ℝ] C(Icc (0 : ℝ) T,U) := +@[expose] def labelCoordinate (x : Space) : U →L[ℝ] C(Icc (0 : ℝ) T,U) := continuousCoordinateVelocity T D.time_pos.le (D.labelFrame x) (D.labelFrameDerivative x) (D.labelHessian x) D.lower D.lower_pos (D.labelFrame_lower x) (D.labelFrame_derivative x) D.potential D.potential_nonneg (D.labelHessian_upper x) D.small /-- Label velocity, constructed using `historyVelocity`. -/ -def labelVelocity (x : Space) : U →L[ℝ] C(Icc (0 : ℝ) T,E) := +@[expose] def labelVelocity (x : Space) : U →L[ℝ] C(Icc (0 : ℝ) T,E) := historyVelocity T D.time_pos.le (D.labelFrame x) (D.labelFrameDerivative x) (D.labelHessian x) D.lower D.lower_pos (D.labelFrame_lower x) (D.labelFrame_derivative x) D.potential D.potential_nonneg (D.labelHessian_upper x) D.small 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..d01c2c826b 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 @@ -139,6 +139,9 @@ theorem integral_translate (p : C(Icc (0 : ℝ) T, CylinderL2 P V)) (a : LiftTan integral T hT (pathTranslate P a p) = pathTranslate P a (integral T hT p) := by apply ContinuousMap.ext intro t + simp only [pathTranslate_apply, EulerContinuousTimeIntegral.integral_apply] + change (∫ s in (0 : ℝ)..(t : ℝ), translate P a (extendPath T hT p s)) = + translate P a (∫ s in (0 : ℝ)..(t : ℝ), extendPath T hT p s) exact (translate P a).intervalIntegral_comp_comm (extendPath T hT p) theorem integral_orbit_contDiff (p : C(Icc (0 : ℝ) T, CylinderL2 P V)) @@ -172,7 +175,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..d74f0fdb8c 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 @@ -33,7 +33,7 @@ variable {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] /-- Reflection, given by `Lp.compMeasurePreservingₗᵢ ℝ (fun x : LiftDomain P => -x) (EulerCylinderReflection.measurePreserving_reflection P)`. -/ -def reflection : CylinderL2 P V →ₗᵢ[ℝ] CylinderL2 P V := +@[expose] def reflection : CylinderL2 P V →ₗᵢ[ℝ] CylinderL2 P V := Lp.compMeasurePreservingₗᵢ ℝ (fun x : LiftDomain P => -x) (EulerCylinderReflection.measurePreserving_reflection P) @@ -73,12 +73,12 @@ theorem representative_of_reflection (u : CylinderL2 P V) (f : LiftDomain P → variable {K : Type*} [TopologicalSpace K] [CompactSpace K] /-- Path reflection, given by `(reflection P).toContinuousLinearMap.compLeftContinuous ℝ K`. -/ -def pathReflection : C(K,CylinderL2 P V) →L[ℝ] C(K,CylinderL2 P V) := +@[expose] def pathReflection : C(K,CylinderL2 P V) →L[ℝ] C(K,CylinderL2 P V) := (reflection P).toContinuousLinearMap.compLeftContinuous ℝ K 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 @@ -122,23 +123,24 @@ theorem reflection_mem (u : Supported P V S hS) : exact hx ((hSym x.1).mp hn) /-- Supported reflection as an element of `Supported P V S hS →L[ℝ] Supported P V S hS`. -/ -def supportedReflection : Supported P V S hS →L[ℝ] Supported P V S hS := +@[expose] def supportedReflection : Supported P V S hS →L[ℝ] Supported P V S hS := ((reflection P).toContinuousLinearMap.comp (Supported P V S hS).subtypeL).codRestrict (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] /-- Supported path reflection, given by `(supportedReflection P S hS hSym).compLeftContinuous ℝ K`. -/ -def supportedPathReflection : C(K,Supported P V S hS) →L[ℝ] C(K,Supported P V S hS) := +@[expose] def supportedPathReflection : C(K,Supported P V S hS) →L[ℝ] C(K,Supported P V S hS) := (supportedReflection P S hS hSym).compLeftContinuous ℝ K 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..fc98cba8df 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 @@ -39,7 +39,7 @@ theorem cover_periodic (f : LiftDomain P → V) (c : AddSubgroup.zmultiples P) ( congrArg f (EulerCylinderMeasureDescent.coveringMap_deck P c z) /-- Tensor, given by `jetSeries P (fun z => f (coveringMap P z)) q n`. -/ -def tensor (f : LiftDomain P → V) (n : ℕ) (q : LiftDomain P) : LiftTangent [×n]→L[ℝ] V := +@[expose] def tensor (f : LiftDomain P → V) (n : ℕ) (q : LiftDomain P) : LiftTangent [×n]→L[ℝ] V := jetSeries P (fun z => f (coveringMap P z)) q n theorem tensor_continuous (f : LiftDomain P → V) 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..41254f68c1 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 @@ -35,7 +35,7 @@ variable (P : ℝ) [Fact (0 < P)] {K : Type*} [TopologicalSpace K] [CompactSpace (i : Fin 4) /-- The continuous L² path for one factor times an actual spatial or angular derivative. -/ -def scalarDerivativeProductPath : C(K,LiftL2 P) := +@[expose] def scalarDerivativeProductPath : C(K,LiftL2 P) := scalarProductPath P L hL p (derivativePath P q i) hp (derivativePath_orbit P q hq i) theorem scalarDerivativeProductPath_orbit : @@ -79,7 +79,7 @@ end end -@[expose] public section +public section noncomputable section @@ -105,7 +105,7 @@ variable (P : ℝ) [Fact (0 < P)] {K : Type*} [TopologicalSpace K] [CompactSpace (hq : ContDiff ℝ ∞ (fun a : LiftTangent => pathTranslate P a q)) /-- The actual path representing p·∇q, where the derivative is spatial and the angle is retained. -/ -def advectionPath : C(K,LiftL2 P) := +@[expose] def advectionPath : C(K,LiftL2 P) := ∑ i : Fin 3, scalarDerivativeProductPath P (component i) (component_norm i) p q hp hq i.succ theorem advectionPath_orbit : diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderPathProduct.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderPathProduct.lean index 077a678dc7..6cc6fb7041 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 @@ -65,11 +65,11 @@ synthesis. -/ local instance instCylinderPathProduct10 : NormedSpace ℝ (C(K,F) →L[ℝ] C(K,G)) := inferInstance /-- A genuine bounded bilinear map acts pointwise on continuous paths. -/ -def pathBilinear (B : E →L[ℝ] F →L[ℝ] G) : C(K,E) →L[ℝ] C(K,F) →L[ℝ] C(K,G) := +@[expose] def pathBilinear (B : E →L[ℝ] F →L[ℝ] G) : C(K,E) →L[ℝ] C(K,F) →L[ℝ] C(K,G) := coefficientMap.comp (B.compLeftContinuous ℝ K) @[simp] theorem pathBilinear_apply (B : E →L[ℝ] F →L[ℝ] G) - (p : C(K, E)) (q : C(K, F)) (t : K) : pathBilinear B p q t = B (p t) (q t) := rfl + (p : C(K, E)) (q : C(K, F)) (t : K) : pathBilinear B p q t = B (p t) (q t) := by rfl theorem pathBilinear_norm (B : E →L[ℝ] F →L[ℝ] G) : ‖pathBilinear (K := K) B‖ ≤ ‖B‖ := @@ -91,7 +91,7 @@ variable (P : ℝ) [Fact (0 < P)] (L : Space →L[ℝ] ℝ) (hL : ‖L‖ ≤ 1) (hq : ContDiff ℝ ∞ (fun a : LiftTangent => pathTranslate P a q)) /-- The actual continuous L² product, constructed in the complete H6 algebra. -/ -def scalarProductPath : C(K,LiftL2 P) := +@[expose] def scalarProductPath : C(K,LiftL2 P) := (valueOperator P 6).compLeftContinuous ℝ K (pathBilinear (productHqBilinear P (by norm_num : 6 ≤ 6) L hL) (sobolevPath P 6 p hp) (sobolevPath P 6 q hq)) diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderPathProductBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderPathProductBounds.lean index aad0b73fb5..10c8037576 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 @@ -359,7 +359,7 @@ variable (P : ℝ) [Fact (0 < P)] {K : Type*} [TopologicalSpace K] [CompactSpace /-- Bilinear term, given by `pathMap P (B (basisVector i)) (scalarProductPath P (component i) (component_norm i) p q hp hq)`. -/ -def bilinearTerm (i : Fin 3) : C(K,LiftL2 P) := +@[expose] def bilinearTerm (i : Fin 3) : C(K,LiftL2 P) := pathMap P (B (basisVector i)) (scalarProductPath P (component i) (component_norm i) p q hp hq) @@ -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..d595f9011d 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 @@ -83,12 +83,12 @@ local instance instCylinderAngleWordBounds4 : NormedSpace ℝ (C(K,LiftL2 P) → inferInstance /-- Path primitive, given by `(primitive P).compLeftContinuous ℝ K`. -/ -def pathPrimitive : C(K,LiftL2 P) →L[ℝ] C(K,LiftL2 P) := +@[expose] def pathPrimitive : C(K,LiftL2 P) →L[ℝ] C(K,LiftL2 P) := (primitive P).compLeftContinuous ℝ K 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 : @@ -244,7 +243,7 @@ theorem potentialPath_orbit : /-- Potential field, given by `pointField P (potentialPath P B p) (potentialPath_orbit P B hB p hp) t`. -/ -def potentialField (t : K) : LiftDomain P → Space := +@[expose] def potentialField (t : K) : LiftDomain P → Space := pointField P (potentialPath P B p) (potentialPath_orbit P B hB p hp) t theorem potentialPath_ae (t : K) : 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..d1fe1c365e 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 @@ -33,7 +33,7 @@ theorem measurePreserving_reflection : (Measure.measurePreserving_neg (volume : Measure (AddCircle period))) /-- Pullback by joint spatial and angular reflection, as an actual L² isometry. -/ -def reflection : LiftL2 period →ₗᵢ[ℝ] LiftL2 period := +@[expose] def reflection : LiftL2 period →ₗᵢ[ℝ] LiftL2 period := Lp.compMeasurePreservingₗᵢ ℝ (fun x : LiftDomain period => -x) (measurePreserving_reflection period) 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..6c9c4d5945 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 @@ -35,6 +35,7 @@ theorem scalarAngle_periodic (y : Space) : Function.Periodic (fun s : ℝ => f ( rw [AddCircle.coe_add_period] /-- The normalized integral descended to the actual periodic cylinder. -/ +@[expose] def classicalPrimitive (x : LiftDomain P) : ℝ := (EulerAngleMeanZeroPrimitive.primitive_periodic P (fun s => f (x.1,(s : AddCircle P))) (hf.comp (continuous_const.prodMk (AddCircle.continuous_mk' P))) 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..c2dd5005d1 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 @@ -124,7 +125,7 @@ local instance instCylinderScalarPrimitive4 : NormedSpace ℝ C(K,CylinderL2 per inferInstance /-- Path primitive, given by `(primitive period).compLeftContinuous ℝ K`. -/ -def pathPrimitive : C(K,CylinderL2 period ℝ) →L[ℝ] C(K,CylinderL2 period ℝ) := +@[expose] def pathPrimitive : C(K,CylinderL2 period ℝ) →L[ℝ] C(K,CylinderL2 period ℝ) := (primitive period).compLeftContinuous ℝ K theorem pathPrimitive_norm : ‖pathPrimitive (K := K) 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..2d0f152c9c 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 @@ -30,6 +30,7 @@ variable (P : ℝ) [Fact (0 < P)] /-- A fixed norm-one embedding lets the existing bounded H3 evaluation recover the genuine scalar field without making a new representative choice. -/ +@[expose] def scalarPointField (t : K) (x : LiftDomain P) : ℝ := scalarProject (pointField P (pathMap P scalarEmbed p) (pathMap_orbit_contDiff P scalarEmbed p hp) t x) 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..571eee568e 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 @@ -43,13 +43,13 @@ synthesis. -/ local instance instPacketCurlCoordinates2 : NormedSpace ℝ (Space →L[ℝ] Space) := inferInstance /-- The coefficient of one genuine spatial derivative in the slow curl. -/ -def curlCoefficient (i : Fin 3) : (Space →L[ℝ] Space) →L[ℝ] (Space →L[ℝ] Space) := +@[expose] def curlCoefficient (i : Fin 3) : (Space →L[ℝ] Space) →L[ℝ] (Space →L[ℝ] Space) := crossOperator.comp ((ContinuousLinearMap.apply ℝ Space (EuclideanSpace.single i 1)).comp (ContinuousLinearMap.adjoint.toContinuousLinearEquiv.toContinuousLinearMap : (Space →L[ℝ] Space) →L[ℝ] (Space →L[ℝ] Space))) @[simp] theorem curlCoefficient_apply (i : Fin 3) (G : Space →L[ℝ] Space) : - curlCoefficient i G = crossLeft (G.adjoint (EuclideanSpace.single i 1)) := rfl + curlCoefficient i G = crossLeft (G.adjoint (EuclideanSpace.single i 1)) := by rfl theorem curlCoefficient_norm (i : Fin 3) : ‖curlCoefficient i‖ ≤ 1 := by apply opNorm_le_bound _ zero_le_one @@ -104,14 +104,14 @@ local instance instPacketCurlCoordinates4 : NormedSpace ℝ (Space →ᵇ Space /-- Curl coefficient path, given by `((curlCoefficient i).compLeftContinuousBounded Space).compLeftContinuous ℝ K`. -/ -def curlCoefficientPath (i : Fin 3) : +@[expose] def curlCoefficientPath (i : Fin 3) : C(K,Space →ᵇ Space →L[ℝ] Space) →L[ℝ] C(K,Space →ᵇ Space →L[ℝ] Space) := ((curlCoefficient i).compLeftContinuousBounded Space).compLeftContinuous ℝ K omit [CompactSpace K] in @[simp] theorem curlCoefficientPath_apply (i : Fin 3) (G : C(K, Space →ᵇ Space →L[ℝ] Space)) (t : K) (y : Space) : - curlCoefficientPath i G t y = curlCoefficient i (G t y) := rfl + curlCoefficientPath i G t y = curlCoefficient i (G t y) := by rfl theorem curlCoefficientPath_norm (i : Fin 3) : ‖curlCoefficientPath (K := K) i‖ ≤ 1 := by apply opNorm_le_bound _ zero_le_one @@ -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 : @@ -267,7 +267,7 @@ theorem path_ae (t : K) : exact Finset.sum_congr rfl (fun i _ => ht i) /-- Field, given by `pointField P (path P G p) (path_orbit P G hG p hp) t`. -/ -def field (t : K) : LiftDomain P → Space := +@[expose] def field (t : K) : LiftDomain P → Space := pointField P (path P G p) (path_orbit P G hG p hp) t /-- The reconstructed L² path is exactly the classical curl used in the packet. -/ 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..6cc57d070f 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 @@ -21,17 +21,17 @@ open EulerLiftedGradientSpace EulerPressureSpatialRegularity EulerCylinderSobole open scoped Topology /-- An old word viewed in the next Sobolev order. -/ -def truncateIndex {q : ℕ} (w : SobolevWord q) : SobolevWord (q + 1) := +@[expose] 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 @@ -41,7 +41,7 @@ def truncateOperator (q : ℕ) : SobolevSpace period (q + 1) →L[ℝ] SobolevSp exact word_hasDerivAt period u (Nat.lt_succ_of_lt e.1.isLt) e.2.1 e.2.2) /-- A coordinate derivative is a bounded map from H^(q+1) to H^q. -/ -def derivativeOperator (q : ℕ) (i : Fin 4) : +@[expose] def derivativeOperator (q : ℕ) (i : Fin 4) : SobolevSpace period (q + 1) →L[ℝ] SobolevSpace period q := ((ContinuousLinearMap.pi (fun w : SobolevWord q => ContinuousLinearMap.proj (derivativeIndex i w))).comp (arrayOperator period (q + @@ -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..87f5cf6d8e 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 @@ -116,12 +116,12 @@ variable (P : ℝ) [Fact (0 < P)] {K : Type*} [TopologicalSpace K] [CompactSpace /-- Sobolev path translate, given by `(sobolevTranslation P q (coveringMap P a)).compLeftContinuous ℝ K`. -/ -def sobolevPathTranslate (q : ℕ) (a : LiftTangent) : +@[expose] def sobolevPathTranslate (q : ℕ) (a : LiftTangent) : C(K,SobolevSpace P q) →L[ℝ] C(K,SobolevSpace P q) := (sobolevTranslation P q (coveringMap P a)).compLeftContinuous ℝ K /-- Sobolev orbit, given by `sobolevPathTranslate P q a (sobolevPath P q p hp)`. -/ -def sobolevOrbit (q : ℕ) (p : C(K, LiftL2 P)) +@[expose] def sobolevOrbit (q : ℕ) (p : C(K, LiftL2 P)) (hp : ContDiff ℝ ∞ (fun a : LiftTangent => pathTranslate P a p)) (a : LiftTangent) : C(K,SobolevSpace P q) := sobolevPathTranslate P q a (sobolevPath P q p hp) 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..85f8225b27 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 @@ -37,7 +37,7 @@ theorem lifted_memLp (u : SpatialL2 V) : (Lp.memLp u).comp_fst (volume : Measure (AddCircle P)) /-- Lift, given by `(lifted_memLp P u).toLp (fun z : LiftDomain P => u z.1)`. -/ -def lift (u : SpatialL2 V) : CylinderL2 P V := +@[expose] def lift (u : SpatialL2 V) : CylinderL2 P V := (lifted_memLp P u).toLp (fun z : LiftDomain P => u z.1) omit [NormedSpace ℝ V] in @@ -95,16 +95,16 @@ theorem lift_norm_le (u : SpatialL2 V) : ‖lift P u‖ ≤ Real.sqrt P*‖u‖ exact le_of_eq (lift_norm_sq P u) /-- Embedding linear, bundling `toFun`, `map_add`, `map_smul`. -/ -def embeddingLinear : SpatialL2 V →ₗ[ℝ] CylinderL2 P V where +@[expose] def embeddingLinear : SpatialL2 V →ₗ[ℝ] CylinderL2 P V where toFun := lift P map_add' := lift_add P map_smul' := lift_smul P /-- Embedding, given by `(embeddingLinear P).mkContinuous (Real.sqrt P) (lift_norm_le P)`. -/ -def embedding : SpatialL2 V →L[ℝ] CylinderL2 P V := +@[expose] 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..3cf94bf5db 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 @@ -42,10 +42,10 @@ theorem embedding_translate (a : LiftTangent) (u : SpatialL2 V) : rfl /-- Mean, given by `P⁻¹ • (embedding P).adjoint`. -/ -def mean : CylinderL2 P V →L[ℝ] SpatialL2 V := P⁻¹ • (embedding P).adjoint +@[expose] 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..72ddf4d177 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 @@ -49,16 +49,16 @@ local instance instCylinderSpatialMeanPath6 : NormedSpace ℝ (C(K,CylinderL2 P C(K,SpatialL2 V)) := inferInstance /-- Path mean, given by `(mean P).compLeftContinuous ℝ K`. -/ -def pathMean : C(K,CylinderL2 P V) →L[ℝ] C(K,SpatialL2 V) := +@[expose] def pathMean : C(K,CylinderL2 P V) →L[ℝ] C(K,SpatialL2 V) := (mean P).compLeftContinuous ℝ K omit [CompactSpace K] in @[simp] theorem pathMean_apply (p : C(K, CylinderL2 P V)) (t : K) : - pathMean P p t = mean P (p t) := rfl + pathMean P p t = mean P (p t) := by rfl /-- 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..6e3125d75c 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 @@ -39,6 +39,7 @@ structure Budget {q : ℕ} {T : ℝ} (hq : 6 ≤ q + 1) (velocityMap (velocityComponents D.κ D.direction)) (D.approximation t) ≤ drift /-- Restricting the time interval preserves both actual norm bounds and all constants. -/ +@[expose] def Budget.restrict {q : ℕ} {T S : ℝ} {hq : 6 ≤ q + 1} {D : CorrectionData period (q + 1) (Icc (0 : ℝ) S)} {N : ℕ} {R : C(Icc (0 : ℝ) S, ℝ)} 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..e9352dfaaf 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 @@ -44,6 +44,7 @@ open scoped Topology variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] /-- Glue, with branches according to `t ≤ τ`. -/ +@[expose] def glue (τ : ℝ) (f g : ℝ → E) (t : ℝ) : E := if t ≤ τ then f t else g t omit [NormedAddCommGroup E] [NormedSpace ℝ E] in @@ -147,7 +148,7 @@ end end -@[expose] public section +public section noncomputable section @@ -182,6 +183,7 @@ theorem matching_values (S τ : ℝ) (hτ0 : 0 ≤ τ) (hτS : τ ≤ S) exact sub_eq_zero.mp h /-- Glue path as an element of `C(Icc (0 : ℝ) S,E)`. -/ +@[expose] def gluePath (S τ : ℝ) (hτ0 : 0 ≤ τ) (hτS : τ ≤ S) (u : Matching (E := E) S τ hτ0 hτS) : C(Icc (0 : ℝ) S,E) := ⟨fun t => glue τ (fun r => u.val.1 (projIcc 0 τ hτ0 r)) @@ -248,7 +250,7 @@ section /-! Matching time paths glue without any external-word or fixed-Sobolev loss. -/ -@[expose] public section +public section noncomputable section @@ -264,7 +266,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 +327,7 @@ end end -@[expose] public section +public section noncomputable section @@ -440,7 +442,7 @@ section /-! The actual affine time shift used by the forward transverse solve. -/ -@[expose] public section +public section noncomputable section @@ -464,8 +466,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 +497,7 @@ end end -@[expose] public section +public section noncomputable section @@ -513,13 +516,14 @@ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] /-- Pair, given by `⟨(u,shiftPath S τ v),by change u ⟨τ,hτ0,le_rfl⟩-shiftPath S τ v ⟨τ,le_rfl,hτS⟩ = 0 rw [shiftPath_initial S τ hτS,hmatch,sub_self]⟩`. -/ +@[expose] def pair : Matching (E := E) S τ hτ0 hτS := ⟨(u,shiftPath S τ v),by change u ⟨τ,hτ0,le_rfl⟩-shiftPath S τ v ⟨τ,le_rfl,hτS⟩ = 0 rw [shiftPath_initial S τ hτS,hmatch,sub_self]⟩ /-- Join, given by `gluePath S τ hτ0 hτS (pair S τ hτ0 hτS u v hmatch)`. -/ -def join : C(Icc (0 : ℝ) S,E) := gluePath S τ hτ0 hτS (pair S τ hτ0 hτS u v hmatch) +@[expose] def join : C(Icc (0 : ℝ) S,E) := gluePath S τ hτ0 hτS (pair S τ hτ0 hτS u v hmatch) theorem join_eq_projection : join S τ hτ0 hτS u v hmatch = gluePath S τ hτ0 hτS (matchingProjection S τ hτ0 hτS (u,shiftPath S τ v)) := by 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..953b77553e 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 @@ -37,6 +37,7 @@ variable (S τ : ℝ) (hτ0 : 0 ≤ τ) (hτS : τ ≤ S) (hg0 : g ⟨0, le_rfl, sub_nonneg.mpr hτS⟩ = 1) /-- The literal piecewise profile; no differentiability of it is required. -/ +@[expose] def profile : C(Icc (0 : ℝ) S,ℝ) := join S τ hτ0 hτS (ContinuousMap.const _ 1) g hg0.symm 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..0f6ec12953 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 @@ -32,6 +32,7 @@ open scoped Topology variable (period : ℝ) [Fact (0 < period)] /-- The genuine finite Gevrey metric energy along an actual continuous Sobolev solution. -/ +@[expose] def energyPath {q : ℕ} (N : ℕ) (hN : N + 6 ≤ q + 1) (T : ℝ) (R : C(Icc (0 : ℝ) T, ℝ)) (K : C(Icc (0 : ℝ) T, LiftL2 period →L[ℝ] LiftL2 period)) (e : C(Icc (0 : ℝ) T, SobolevSpace period (q + 1))) : C(Icc (0 : ℝ) T, ℝ) := @@ -39,6 +40,7 @@ def energyPath {q : ℕ} (N : ℕ) (hN : N + 6 ≤ q + 1) (T : ℝ) (energyValueFamily period energyLength energyWord (energyLength_le hN) T e) /-- The genuine radius-loss metric quantity along the same actual solution. -/ +@[expose] def lossPath {q : ℕ} (N : ℕ) (hN : N + 6 ≤ q + 1) (T : ℝ) (R : C(Icc (0 : ℝ) T, ℝ)) (K : C(Icc (0 : ℝ) T, LiftL2 period →L[ℝ] LiftL2 period)) (e : C(Icc (0 : ℝ) T, SobolevSpace period (q + 1))) : C(Icc (0 : ℝ) T, ℝ) := diff --git a/LeanPool/NavierStokesAndEuler/Euler/EnergyWordCoordinates.lean b/LeanPool/NavierStokesAndEuler/Euler/EnergyWordCoordinates.lean index d4dfe1e6ce..7b04bc2d65 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 @@ -40,7 +40,7 @@ theorem wordAtLevel_word {s : ℕ} (q n : ℕ) (w : Fin n → Fin 4) (h : n + q /-- Bounded word blocks and the spatial-estimate word-at-level operator are the same genuine map. -/ theorem boundedWordBlock_eq_wordAtLevel {s : ℕ} (q n : ℕ) (h : q + n ≤ s) (w : Fin n → Fin 4) : - boundedWordBlock period q n h w = wordAtLevel period q n w (by omega : n+q ≤ s) := rfl + boundedWordBlock period q n h w = wordAtLevel period q n w (by omega : n+q ≤ s) := by rfl /-- Two actual Sobolev word blocks compose by literal word concatenation. -/ theorem wordAtLevel_comp {s p q n m : ℕ} (w : Fin n → Fin 4) (v : Fin m → Fin 4) @@ -52,10 +52,11 @@ theorem wordAtLevel_comp {s p q n m : ℕ} (w : Fin n → Fin 4) (v : Fin m → wordAtLevel_value, toJet_word period _ (by omega : m+n ≤ s)] /-- The total derivative length in one external/base energy component. -/ -def energyLength {N q : ℕ} (I : ExternalWord N) (a : BaseWord q) : ℕ := a.1.val+I.1.val +@[expose] def energyLength {N q : ℕ} (I : ExternalWord N) (a : BaseWord q) : ℕ := a.1.val+I.1.val /-- The literal base-then-external concatenated derivative word of an energy component. -/ -def energyWord {N q : ℕ} (I : ExternalWord N) (a : BaseWord q) : Fin (energyLength I a) → Fin 4 := +@[expose] def energyWord {N q : ℕ} (I : ExternalWord N) (a : BaseWord q) : + Fin (energyLength I a) → Fin 4 := Fin.append a.2 I.2 /-- Every total energy word stays below the advertised external-plus-base cutoff. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/EulerC1Breakdown.lean b/LeanPool/NavierStokesAndEuler/Euler/EulerC1Breakdown.lean index cc6710808a..05a02c1258 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 @@ -146,13 +146,13 @@ open Set EulerSmoothLimit EulerLpTranslation EulerLpTranslation.SmoothL2Field variable {A : SmoothL2Field Space} (L : FiniteLifespan A) /-- Maximal velocity norm, given by `‖finiteField (L.maximalField t)‖`. -/ -def maximalVelocityNorm (t : L.Time) : ℝ := ‖finiteField (L.maximalField t)‖ +@[expose] def maximalVelocityNorm (t : L.Time) : ℝ := ‖finiteField (L.maximalField t)‖ /-- Maximal gradient norm, given by `‖finiteField (L.maximalField t).derivative‖`. -/ -def maximalGradientNorm (t : L.Time) : ℝ := ‖finiteField (L.maximalField t).derivative‖ +@[expose] def maximalGradientNorm (t : L.Time) : ℝ := ‖finiteField (L.maximalField t).derivative‖ /-- Maximal C1 norm, given by `L.maximalVelocityNorm t+L.maximalGradientNorm t`. -/ -def maximalC1Norm (t : L.Time) : ℝ := L.maximalVelocityNorm t+L.maximalGradientNorm t +@[expose] def maximalC1Norm (t : L.Time) : ℝ := L.maximalVelocityNorm t+L.maximalGradientNorm t theorem maximalVelocityNorm_nonneg (t : L.Time) : 0 ≤ L.maximalVelocityNorm t := norm_nonneg _ @@ -214,6 +214,7 @@ open scoped ContDiff abbrev MaximalTime : Type := lifespan.Time /-- Maximal velocity, given by `lifespan.maximalVelocity t`. -/ +@[expose] def maximalVelocity (t : MaximalTime) : Space → Space := lifespan.maximalVelocity t /-- Maximal pressure, given by `lifespan.maximalPressure t`. -/ @@ -223,9 +224,11 @@ def maximalPressure (t : MaximalTime) : Space → ℝ := lifespan.maximalPressur def maximalVelocityNorm (t : MaximalTime) : ℝ := lifespan.maximalVelocityNorm t /-- Maximal gradient norm, given by `lifespan.maximalGradientNorm t`. -/ +@[expose] def maximalGradientNorm (t : MaximalTime) : ℝ := lifespan.maximalGradientNorm t /-- Maximal C1 norm, given by `lifespan.maximalC1Norm t`. -/ +@[expose] def maximalC1Norm (t : MaximalTime) : ℝ := lifespan.maximalC1Norm t theorem initialDatum_no_endpoint : ¬ HasSmoothEulerSolution initialDatum.field lifespan.duration := diff --git a/LeanPool/NavierStokesAndEuler/Euler/EulerC1Limsup.lean b/LeanPool/NavierStokesAndEuler/Euler/EulerC1Limsup.lean index e046dbf2d0..59594b2581 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 @@ -26,7 +26,7 @@ open scoped Topology ENNReal variable {A : SmoothL2Field Space} (L : FiniteLifespan A) /-- Endpoint filter, given by `Filter.comap (fun t : L.Time => (t : ℝ)) (𝓝[<] L.duration)`. -/ -def endpointFilter : Filter L.Time := +@[expose] def endpointFilter : Filter L.Time := Filter.comap (fun t : L.Time => (t : ℝ)) (𝓝[<] L.duration) theorem endpointFilter_eq_atTop : L.endpointFilter=(atTop : Filter L.Time) := diff --git a/LeanPool/NavierStokesAndEuler/Euler/EulerCorrectionEquation.lean b/LeanPool/NavierStokesAndEuler/Euler/EulerCorrectionEquation.lean index 3b130a960a..34f9f86980 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 @@ -39,7 +39,7 @@ synthesis. -/ local instance equationSobolevSpace (q : ℕ) : NormedSpace ℝ (SobolevSpace period q) := inferInstance /-- The actual non-pressure residual and nonlinear increment in equation (17). -/ -def CorrectionData.rawSource {q : ℕ} {T : Type*} [TopologicalSpace T] +@[expose] def CorrectionData.rawSource {q : ℕ} {T : Type*} [TopologicalSpace T] (D : CorrectionData period q T) (hq : 6 ≤ q) (t : T) (e : SobolevSpace period (q + 1)) : SobolevSpace period q := (D.coefficients period hq).forcing t + (D.coefficients period hq).linear t e + @@ -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..3d87fad359 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 @@ -270,7 +270,7 @@ theorem eulerBilinear_continuous {q : ℕ} (hq : 6 ≤ q) exact ht.add (algebraicBilinear_continuous period hq C hC) /-- The actual Sobolev pressure projection as a continuous coefficient path. -/ -def pressureProjectionPath {q : ℕ} +@[expose] def pressureProjectionPath {q : ℕ} (G : T → SmoothCoefficient period) (K : ∀ t, CoefficientJet period standardDirection q (G t)) (κ : ℝ) (m : Vector3) (c : ℝ) (hc : 0 < c) (hpos : ∀ t x v, c * ‖v‖ ^ 2 ≤ ⟪(G t).coefficient x v, v⟫_ℝ) @@ -282,7 +282,7 @@ def pressureProjectionPath {q : ℕ} /-- Concrete coefficient data for equation (17): actual pressure, actual transport, and actual order-zero coefficient multipliers. -/ -def correctionCoefficients {q : ℕ} (hq : 6 ≤ q) +@[expose] def correctionCoefficients {q : ℕ} (hq : 6 ≤ q) (G : T → SmoothCoefficient period) (K : ∀ t, CoefficientJet period standardDirection q (G t)) (κ : ℝ) (m : Vector3) (c : ℝ) (hc : 0 < c) (hpos : ∀ t x v, c * ‖v‖ ^ 2 ≤ ⟪(G t).coefficient x v, v⟫_ℝ) @@ -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⟩ @@ -465,7 +465,7 @@ structure CorrectionData (q : ℕ) (T : Type*) [TopologicalSpace T] where residual : C(T, SobolevSpace period q) /-- The actual pressure-projected nonlinear correction source generated by the concrete data. -/ -def CorrectionData.coefficients {q : ℕ} {T : Type*} [TopologicalSpace T] +@[expose] def CorrectionData.coefficients {q : ℕ} {T : Type*} [TopologicalSpace T] (D : CorrectionData period q T) (hq : 6 ≤ q) : Coefficients T (SobolevSpace period (q+1)) (SobolevSpace period q) := correctionCoefficients period hq D.metric.coefficient D.metric.jet D.κ D.direction D.coercivity diff --git a/LeanPool/NavierStokesAndEuler/Euler/EulerSingularity.lean b/LeanPool/NavierStokesAndEuler/Euler/EulerSingularity.lean index 65ff884006..7e214a0df2 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 @@ -101,7 +101,7 @@ open Set EulerSmoothLimit EulerLpTranslation EulerLpTranslation.SmoothL2Field /-- Scalar-pressure Euler on the closed interval `[0,T]`, with the ordinary all-order spatial and strong time regularity. No pressure-force path or pressure norm is prescribed. The maximal solution itself is on `[0,T*)`. -/ -def HasScalarEulerEvolution (A : SmoothL2Field Space) (T : ℝ) : Prop := +@[expose] def HasScalarEulerEvolution (A : SmoothL2Field Space) (T : ℝ) : Prop := ∃ hT : 0 < T, ∃ u : Icc (0 : ℝ) T → SmoothL2Field Space, IsSmoothScalarEuler (hT := hT.le) u ∧ u ⟨0,le_rfl,hT.le⟩=A diff --git a/LeanPool/NavierStokesAndEuler/Euler/ExactLiftedGraphPressure.lean b/LeanPool/NavierStokesAndEuler/Euler/ExactLiftedGraphPressure.lean index ac29fd68df..ea8fc451f6 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 : ℝ) : @@ -106,6 +106,7 @@ theorem graphPressure_has_potential (k : ℝ) (hk : k * A.κ = 1) (t : Icc (0 : (S.pressure.pointField_ae t) (S.pressure.pointField_smooth t) /-- Graph potential, given by `radialPotential (S.graphPressure k t)`. -/ +@[expose] def graphPotential (k : ℝ) (t : Icc (0 : ℝ) T) : Vector3 → ℝ := radialPotential (S.graphPressure k t) @@ -131,7 +132,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..845b97df3b 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 @@ -257,7 +258,7 @@ open scoped ContDiff ENNReal Topology variable (period : ℝ) [Fact (0 < period)] /-- The sum of H⁵ norms of the four actual first derivatives. -/ -def gradientFiveNorm {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] +@[expose] def gradientFiveNorm {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] (f : LiftDomain period → F) : ℝ := ∑ i : Fin 4, liftSobolevNorm period 5 (fieldDerivative period (standardDirection i) f) @@ -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,15 +572,15 @@ 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 /-- The literal external transport commutator D^w(b·∇e)−b·∇D^w e. -/ -def transportCommutator {n : ℕ} (w : Fin n → Fin 4) +@[expose] def transportCommutator {n : ℕ} (w : Fin n → Fin 4) (b : LiftDomain period → Domain 4) (e : LiftDomain period → Vector3) : LiftDomain period → Vector3 := iteratedFieldDerivative period w (transportField period 3 b e) - @@ -602,8 +607,8 @@ theorem transportCommutator_eq_sum {n : ℕ} (w : Fin n → Fin 4) rfl /-- Sum of the actual H⁶ norms of all external transport commutators at one order. -/ -def transportCommutatorNorm (n : ℕ) (b : LiftDomain period → Domain 4) (e : LiftDomain period → - Vector3) : ℝ := +@[expose] def transportCommutatorNorm (n : ℕ) (b : LiftDomain period → Domain 4) + (e : LiftDomain period → Vector3) : ℝ := ∑ w : Fin n → Fin 4, liftSobolevNorm period 6 (transportCommutator period w b e) /-- Positivity allows monotonicity of the coefficient sequence in the genuine commutator diff --git a/LeanPool/NavierStokesAndEuler/Euler/FieldTowerAlgebra.lean b/LeanPool/NavierStokesAndEuler/Euler/FieldTowerAlgebra.lean index c32976a6c7..c132ca775b 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 @@ -24,6 +24,7 @@ open Set MeasureTheory EulerLiftedGradientSpace EulerCylinderSobolevSpace variable {P T : ℝ} [Fact (0 < P)] (A B : EulerAllOrderCorrectionData.FieldTower P T) /-- Add, bundling `field`, `realization`, `value_eq`. -/ +@[expose] def add : EulerAllOrderCorrectionData.FieldTower P T where field := A.field+B.field realization q := A.realization q+B.realization q 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..2c44780ac4 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 @@ -89,6 +89,7 @@ local instance instFieldTowerGraphGevrey14 (n : ℕ) : NormedAddCommGroup C(Icc Space)) := inferInstance /-- Zero graph field, bundling `field`, `smooth`, `integrable`. -/ +@[expose] def zeroGraphField (t : Icc (0 : ℝ) T) : SmoothL2Field Space where field := A.physicalPointField 1 0 t smooth := A.physicalPointField_smooth 1 0 t @@ -96,6 +97,7 @@ def zeroGraphField (t : Icc (0 : ℝ) T) : SmoothL2Field Space where /-- Zero graph coefficient, given by `A.toSmoothTimeField.precompLinear (ContinuousLinearMap.inl ℝ Space ℝ)`. -/ +@[expose] def zeroGraphCoefficient : SmoothTimeField (Icc (0 : ℝ) T) Space Space := A.toSmoothTimeField.precompLinear (ContinuousLinearMap.inl ℝ Space ℝ) diff --git a/LeanPool/NavierStokesAndEuler/Euler/FieldTowerJetLp.lean b/LeanPool/NavierStokesAndEuler/Euler/FieldTowerJetLp.lean index 6c7ee4cdc5..a75027fe4f 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 @@ -90,6 +90,14 @@ theorem coverTensor_weighted (n : ℕ) (ρ C : ℝ) (hρ : 0 < ρ) theorem toSmoothTimeField_jetSeries (n : ℕ) (t : Icc (0 : ℝ) T) : (fun q => jetSeries P (A.toSmoothTimeField.field t : LiftTangent → Vector3) q n) = - tensor P (A.pointField t) n := rfl + tensor P (A.pointField t) n := by + have he : (fun z : LiftTangent => A.toSmoothTimeField.field t z) = + fun z => A.pointField t (coveringMap P z) := by + funext z + exact A.toSmoothTimeField_apply t z + funext q + change jetSeries P (fun z : LiftTangent => A.toSmoothTimeField.field t z) q n = + jetSeries P (fun z : LiftTangent => A.pointField t (coveringMap P z)) q n + rw [he] end EulerAllOrderCorrectionData.FieldTower diff --git a/LeanPool/NavierStokesAndEuler/Euler/FieldTowerPhysicalContinuity.lean b/LeanPool/NavierStokesAndEuler/Euler/FieldTowerPhysicalContinuity.lean index 57e2bc760c..c6521c1bf2 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 @@ -125,6 +125,7 @@ theorem physicalTensorValue_continuous (n : ℕ) : /-- The physical tensor path is constructed from the actual graph field; continuity is a theorem rather than an additional packet hypothesis. -/ +@[expose] def physicalTensorPath (n : ℕ) : C(Icc (0 : ℝ) T,Lp (Vector3 [×n]→L[ℝ] Vector3) 2 (volume : Measure Vector3)) := ⟨A.physicalTensorValue k m n,A.physicalTensorValue_continuous k m n⟩ diff --git a/LeanPool/NavierStokesAndEuler/Euler/FieldTowerPhysicalL2.lean b/LeanPool/NavierStokesAndEuler/Euler/FieldTowerPhysicalL2.lean index e8dcb1e262..6ecb1657ec 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) : @@ -66,6 +66,7 @@ theorem physicalTensor_memLp (n : ℕ) (t : Icc (0 : ℝ) T) : w t) /-- Physical tensor value, constructed using `physicalTensorLp`. -/ +@[expose] def physicalTensorValue (n : ℕ) (t : Icc (0 : ℝ) T) : Lp (Vector3 [×n]→L[ℝ] Vector3) 2 (volume : Measure Vector3) := physicalTensorLp P k m (A.pointField t) (A.pointField_smooth t) n 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..b163452981 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 @@ -36,7 +36,7 @@ def spatialJet (q : ℕ) (t : Icc (0 : ℝ) T) : A.value_eq q t ▸ toJet P (A.realization q t) /-- Point field, given by `pointEvaluation P x (A.realization 3 t)`. -/ -def pointField (t : Icc (0 : ℝ) T) (x : LiftDomain P) : Vector3 := +@[expose] def pointField (t : Icc (0 : ℝ) T) (x : LiftDomain P) : Vector3 := pointEvaluation P x (A.realization 3 t) theorem pointField_ae (t : Icc (0 : ℝ) T) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/FieldTowerSmoothTimeField.lean b/LeanPool/NavierStokesAndEuler/Euler/FieldTowerSmoothTimeField.lean index 17f297fe39..637e746fe5 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 @@ -133,7 +133,7 @@ variable {K E V ι : Type u} [TopologicalSpace K] [CompactSpace K] [Fintype ι] [NormedAddCommGroup V] [NormedSpace ℝ V] [FiniteDimensional ℝ V] /-- Of coordinate jets, bundling `field`, `smooth`, `jet`, `jet_eq`. -/ -def ofCoordinateJets (b : Module.Basis ι ℝ E) (f : C(K, E →ᵇ V)) +@[expose] def ofCoordinateJets (b : Module.Basis ι ℝ E) (f : C(K, E →ᵇ V)) (hf : ∀ t, ContDiff ℝ ∞ (f t : E → V)) (u : (n : ℕ) → (Fin n → ι) → C(K, E →ᵇ V)) (hu : ∀ n w t x, u n w t x = iteratedFDeriv ℝ n (f t : E → V) x (fun i => b (w i))) : @@ -150,7 +150,7 @@ end end -@[expose] public section +public section noncomputable section @@ -200,11 +200,11 @@ local instance instFieldTowerSmoothTimeField6 (n : ℕ) : NormedSpace ℝ (LiftTangent →ᵇ (LiftTangent [×n]→L[ℝ] Space)) := inferInstance /-- Bounded cover, given by `coverPathMap P (A.realization 3)`. -/ -def boundedCover : C(Icc (0 : ℝ) T, LiftTangent →ᵇ Space) := +@[expose] def boundedCover : C(Icc (0 : ℝ) T, LiftTangent →ᵇ Space) := coverPathMap P (A.realization 3) @[simp] theorem boundedCover_apply (t : Icc (0 : ℝ) T) (x : LiftTangent) : - A.boundedCover t x = A.pointField t (coveringMap P x) := rfl + A.boundedCover t x = A.pointField t (coveringMap P x) := by rfl /-- Bounded word, given by `coverPathMap P ((wordAtLevel P 3 n w (le_refl (n+3))).compLeftContinuous ℝ (Icc (0 : ℝ) T) (A.realization (n+3)))`. -/ @@ -229,13 +229,13 @@ theorem boundedWord_tensor (n : ℕ) (w : Fin n → Fin 4) rfl /-- To smooth time field, constructed using `SmoothTimeField.ofCoordinateJets`. -/ -def toSmoothTimeField : SmoothTimeField (Icc (0 : ℝ) T) LiftTangent Space := +@[expose] def toSmoothTimeField : SmoothTimeField (Icc (0 : ℝ) T) LiftTangent Space := SmoothTimeField.ofCoordinateJets coverBasis A.boundedCover (fun t => coverField_contDiff P (A.pointField t) (A.pointField_smooth t)) A.boundedWord A.boundedWord_tensor @[simp] theorem toSmoothTimeField_apply (t : Icc (0 : ℝ) T) (x : LiftTangent) : - A.toSmoothTimeField.field t x = A.pointField t (coveringMap P x) := rfl + A.toSmoothTimeField.field t x = A.pointField t (coveringMap P x) := by rfl theorem toSmoothTimeField_timeDerivative (B : EulerAllOrderCorrectionData.FieldTower P T) (hT : 0 ≤ T) diff --git a/LeanPool/NavierStokesAndEuler/Euler/FiniteEnergyTruncation.lean b/LeanPool/NavierStokesAndEuler/Euler/FiniteEnergyTruncation.lean index 84a084c81e..8ea67c11ec 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) @@ -442,7 +442,7 @@ theorem truncationCutoff_eventually_one (R : ℝ) (hR : 0 < R) (x : Space) NavierStokesAndEuler.SmoothCutoff.cutoff_eventuallyEq_one hR hx /-- The truncation family used by the finite-energy flow argument. -/ -def finiteEnergyTruncation (u : Space → Space) (R : ℝ) : Space → Space := +@[expose] def finiteEnergyTruncation (u : Space → Space) (R : ℝ) : Space → Space := potentialTruncation u (truncationCutoff R) theorem finiteEnergyTruncation_smooth 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..a29d714a08 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 @@ -106,7 +106,7 @@ def tensorPathLinear (n : ℕ) : ContinuousMap.smul_apply, RingHom.id_apply] /-- Tensor path map, bundling `toLinearMap`, `cont`, `1`. -/ -def tensorPathMap (n : ℕ) : +@[expose] def tensorPathMap (n : ℕ) : (E [×n]→L[ℝ] C(K,V)) →L[ℝ] C(K, E [×n]→L[ℝ] V) where toLinearMap := tensorPathLinear n cont := AddMonoidHomClass.continuous_of_bound (tensorPathLinear (K := K) (E := E) (V := V) n) 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..a84841f48a 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 @@ -44,6 +44,7 @@ theorem initialPrimitive_pathLp (f : C(Icc (0 : ℝ) T, E)) : apply ContinuousMap.ext intro t rw [initialPrimitive_apply,initialRealPrimitive_eq_integral] + rw [EulerContinuousTimeIntegral.integral_apply] change (∫ s in (0 : ℝ)..(t : ℝ), zeroExtension T (pathLp T hT f) s) = ∫ s in (0 : ℝ)..(t : ℝ), extendPath T hT f s rw [intervalIntegral.integral_of_le t.property.1,intervalIntegral.integral_of_le t.property.1] @@ -132,7 +133,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 +208,7 @@ end end -@[expose] public section +public section noncomputable section @@ -342,7 +343,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..1e841ee7ad 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 @@ -55,6 +55,7 @@ variable {K E : Type*} [TopologicalSpace K] [NormedAddCommGroup E] (hY : Continuous (Function.uncurry Y)) (hdet : ∀ t x, (F t x).det = 1) /-- Inverse path, given by `(⟨Function.uncurry Y,hY⟩ : C(K × Vector3,Vector3)).curry`. -/ +@[expose] def inversePath : C(K,C(Vector3,Vector3)) := (⟨Function.uncurry Y,hY⟩ : C(K × Vector3,Vector3)).curry 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..80db77a10f 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 @@ -23,7 +23,7 @@ open scoped ContDiff ENNReal NNReal Topology SchwartzMap /-- Euclidean coordinate zero is the angle; coordinates one through three are spatial. -/ -noncomputable def coordinateLinearEquiv : Domain 4 ≃ₗ[ℝ] LiftTangent where +@[expose] noncomputable def coordinateLinearEquiv : Domain 4 ≃ₗ[ℝ] LiftTangent where toFun z := (WithLp.toLp 2 (fun i : Fin 3 => z i.succ), z 0) invFun p := WithLp.toLp 2 (Fin.cons p.2 (fun i => p.1 i)) left_inv z := by @@ -46,14 +46,14 @@ noncomputable def coordinateLinearEquiv : Domain 4 ≃ₗ[ℝ] LiftTangent where · simp /-- The coordinate isomorphism, continuous in both directions. -/ -noncomputable def coordinateEquiv : Domain 4 ≃L[ℝ] LiftTangent := +@[expose] 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..78e4b4c8e4 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 @@ -28,7 +28,7 @@ variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteS /-- The unforced Euler momentum residual, with space-time derivative and the canonical real gradient. -/ -def momentumResidual (u : ℝ × E → E) (p : ℝ × E → ℝ) (z : ℝ × E) : E := +@[expose] def momentumResidual (u : ℝ × E → E) (p : ℝ × E → ℝ) (z : ℝ × E) : E := fderiv ℝ u z (1, u z) + gradient (fun x => p (z.1, x)) z.2 omit [CompleteSpace E] in 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..3b9ccb6246 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⁻¹ @@ -447,7 +447,7 @@ namespace SpatialJet variable {period} {directions : Fin 4 → LiftTangent} /-- Construct a genuine pressure Sobolev jet at every finite order. -/ -def solvePressure {n : ℕ} {A : SmoothCoefficient period} {f : LiftL2 period} +@[expose] def solvePressure {n : ℕ} {A : SmoothCoefficient period} {f : LiftL2 period} (K : CoefficientJet period directions n A) (κ : ℝ) (m : Vector3) (c : ℝ) (hc : 0 < c) (hpos : ∀ x v, c * ‖v‖ ^ 2 ≤ ⟪A.coefficient x v, v⟫_ℝ) (J : SpatialJet period directions n f) : @@ -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..8cad3cc20d 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) @@ -145,6 +145,7 @@ theorem odd_curl_of_even (ψ : Fin 3 → Space → ℝ) ring /-- The vector potential `-x × (L x) / 3` in cyclic coordinates. -/ +@[expose] def linearPotential (L : Space →L[ℝ] Space) (i : Fin 3) (x : Space) : ℝ := (-1 / 3 : ℝ) * (x (i + 1) * (L x) (i + 2) - x (i + 2) * (L x) (i + 1)) 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..6330ee74a3 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 @@ -26,12 +26,12 @@ open MeasureTheory EulerSobolev EulerLiftedGradientSpace EulerMetricTransport open scoped ContDiff ENNReal Topology /-- Assemble the four actual cylinder-velocity components as a bounded linear map. -/ -def velocityMap (L : Fin 4 → Vector3 →L[ℝ] ℝ) : Vector3 →L[ℝ] Domain 4 := +@[expose] def velocityMap (L : Fin 4 → Vector3 →L[ℝ] ℝ) : Vector3 →L[ℝ] Domain 4 := (EuclideanSpace.equiv (𝕜 := ℝ) (ι := Fin 4)).symm.toContinuousLinearMap.comp (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..e61c3176cc 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 @@ -32,7 +32,7 @@ theorem truncate_injective (q : ℕ) : Function.Injective (truncateOperator peri exact congrArg (value period (q := q)) h /-- The genuine heat-plus-gained-Duhamel construction as an actual continuous Sobolev path. -/ -def mildPath (q : ℕ) (ν : ℝ) (hν : 0 < ν) (T : ℝ) (hT : 0 ≤ T) +@[expose] def mildPath (q : ℕ) (ν : ℝ) (hν : 0 < ν) (T : ℝ) (hT : 0 ≤ T) (u₀ : SobolevSpace period (q + 1)) (f : C(Icc (0 : ℝ) T, SobolevSpace period q)) : C(Icc (0 : ℝ) T, SobolevSpace period (q+1)) := freeHeatPath period (q+1) ν T u₀ + 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..455a85ce47 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 @@ -52,7 +53,8 @@ theorem heatList_smul (directions : List LiftTangent) (v : ℝ≥0) (c : ℝ) (f | cons a tail ih => simp only [heatList, ih, lineHeat_smul] /-- Heat list operator, constructed using `LinearMap.mkContinuous`. -/ -def heatListOperator (directions : List LiftTangent) (v : ℝ≥0) : LiftL2 period →L[ℝ] LiftL2 period +@[expose] def heatListOperator (directions : List LiftTangent) (v : ℝ≥0) : + LiftL2 period →L[ℝ] LiftL2 period := LinearMap.mkContinuous { toFun := heatList period directions v @@ -62,7 +64,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 +101,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 +154,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..8d43e887c3 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 @@ -288,7 +288,7 @@ synthesis. -/ local instance baseCommSpace (q : ℕ) : NormedSpace ℝ (SobolevSpace period q) := inferInstance /-- The actual base derivative commutator, evaluated in L² on its genuine H⁷ domain. -/ -def baseCommutator (r : ℕ) (hr : r ≤ 6) (w : Fin r → Fin 4) +@[expose] def baseCommutator (r : ℕ) (hr : r ≤ 6) (w : Fin r → Fin 4) (L : Fin 4 → Vector3 →L[ℝ] ℝ) (hL : ∀ i, ‖L i‖ ≤ 1) : SobolevSpace period 7 →L[ℝ] SobolevSpace period 7 →L[ℝ] LiftL2 period := ((ContinuousLinearMap.compL ℝ (SobolevSpace period 7) (SobolevSpace period 6) (LiftL2 period) @@ -306,7 +306,7 @@ theorem baseCommutator_apply (r : ℕ) (hr : r ≤ 6) (w : Fin r → Fin 4) value period (wordAtLevel period 0 r w (by omega : r+0 ≤ 6) (transportBilinear period (by norm_num : 6 ≤ 6) L hL u v)) - transportL2Bilinear period (by - norm_num : 3 ≤ 7) L u (wordAtLevel period 1 r w (by omega : r+1 ≤ 7) v) := rfl + norm_num : 3 ≤ 7) L u (wordAtLevel period 1 r w (by omega : r+1 ≤ 7) v) := by rfl /-- Its actual L² representative is the literal classical base derivative commutator. -/ theorem baseCommutator_ae (r : ℕ) (hr : r ≤ 6) (w : Fin r → Fin 4) @@ -399,7 +399,7 @@ section /-! Summation of the actual base transport commutators with no external-cutoff constant. -/ -@[expose] public section +public section noncomputable section @@ -452,7 +452,7 @@ theorem weighted_word_sums {s : ℕ} (q N : ℕ) (hN : N + q ≤ s) (ρ : ℝ) ( rw [sumNorm_wordAtLevel] /-- The literal base transport forcing at every external and base derivative word. -/ -def baseTransportForcing {s : ℕ} (N : ℕ) (hN : N + 6 ≤ s) +@[expose] def baseTransportForcing {s : ℕ} (N : ℕ) (hN : N + 6 ≤ s) (L : Fin 4 → Vector3 →L[ℝ] ℝ) (hL : ∀ i, ‖L i‖ ≤ 1) (u v : SobolevSpace period (s + 1)) : ExternalWord N → BaseWord 6 → LiftL2 period := fun I a => baseCommutator period a.1.val (by have := a.1.isLt; omega) a.2 L hL @@ -520,7 +520,7 @@ section /-! Literal differentiated forcing arrays and their actual finite Gevrey norms. -/ -@[expose] public section +public section noncomputable section @@ -570,7 +570,7 @@ theorem sourceForcing_weighted_bound {s : ℕ} (N : ℕ) (hN : N + 6 ≤ s) (ρ exact h.trans_eq (he.trans (weighted_word_sums period 6 N hN ρ f)) /-- The literal base derivatives of the external transport commutator. -/ -def externalTransportForcing {s : ℕ} (hs : 6 ≤ s) (N : ℕ) (hN : N + 6 ≤ s) +@[expose] def externalTransportForcing {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)) : ExternalWord N → BaseWord 6 → LiftL2 period := fun I => baseWordValues period (toJet period (externalCommutator period hs I.1.val I.2 (by @@ -590,7 +590,7 @@ theorem externalTransportForcing_bound {s : ℕ} (hs : 6 ≤ s) (N : ℕ) (hN : exact h.trans_eq (by simp only [Fintype.sum_sigma, weightedCommutatorNorm, Finset.mul_sum]) /-- The literal base derivatives of the actual external coefficient-pressure commutator. -/ -def externalPressureForcing {s : ℕ} {A : SmoothCoefficient period} +@[expose] def externalPressureForcing {s : ℕ} {A : SmoothCoefficient period} (K : EulerSpatialSobolevInverse.CoefficientJet period standardDirection s A) (N : ℕ) (hN : N + 6 ≤ s) (p : SobolevSpace period s) : ExternalWord N → BaseWord 6 → LiftL2 period := fun I => @@ -623,7 +623,7 @@ theorem sobolevSize_order_zero (f : LiftL2 period) : exact sobolevSize_eq period (EulerSpatialSobolevInverse.SpatialJet.zero f) /-- The literal base derivative commutator of G with each external pressure derivative. -/ -def basePressureForcing {s : ℕ} {A : SmoothCoefficient period} +@[expose] def basePressureForcing {s : ℕ} {A : SmoothCoefficient period} (K : EulerSpatialSobolevInverse.CoefficientJet period standardDirection 6 A) (N : ℕ) (hN : N + 6 ≤ s) (p : SobolevSpace period s) : ExternalWord N → BaseWord 6 → LiftL2 period := fun I a => @@ -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..51cfd15f93 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 @@ -48,7 +48,7 @@ theorem algebraicAt_eq {s : ℕ} (hs : 6 ≤ s) algebraicAt period hs C (truncateOperator period s u) (truncateOperator period s v) = algebraicBilinear period hs C u v := by rw [algebraicBilinear_apply] - rfl + simp only [algebraicAt, coordinateProduct_apply] /-- The order-zero background transport is exactly e·D z_a in the mild solver. -/ theorem backgroundDrift_eq {s : ℕ} (hs : 6 ≤ s) diff --git a/LeanPool/NavierStokesAndEuler/Euler/GevreyDifferentiatedEquation.lean b/LeanPool/NavierStokesAndEuler/Euler/GevreyDifferentiatedEquation.lean index 2cd197b191..17ebaedd87 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 @@ -33,6 +33,7 @@ synthesis. -/ local instance diffEqSpace (q : ℕ) : NormedSpace ℝ (SobolevSpace period q) := inferInstance /-- The actual continuous linear map taking one external and one base derivative word. -/ +@[expose] def energyWordOperator {s : ℕ} (q N : ℕ) (hN : N + q ≤ s) (I : ExternalWord N) (a : BaseWord q) : SobolevSpace period s →L[ℝ] LiftL2 period := ((valueOperator period 0).comp @@ -69,7 +70,7 @@ theorem energyValues_sub {s : ℕ} (q N : ℕ) (hN : N + q ≤ s) (u v : Sobolev simp only [← energyWordOperator_apply, map_sub, Pi.sub_apply] /-- The literal undifferentiated transport acting on the final external/base derivative. -/ -def topTransport {s : ℕ} (N : ℕ) (hN : N + 6 ≤ s) +@[expose] def topTransport {s : ℕ} (N : ℕ) (hN : N + 6 ≤ s) (L : Fin 4 → Vector3 →L[ℝ] ℝ) (u v : SobolevSpace period (s + 1)) : ExternalWord N → BaseWord 6 → LiftL2 period := fun I a => transportL2Bilinear period (by norm_num : 3 ≤ 7) L 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..86b5fbd119 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 @@ -34,6 +34,7 @@ abbrev BaseWord (s : ℕ) := Σ n : Fin (s + 1), Fin n.val → Fin 4 variable (period : ℝ) [Fact (0 < period)] /-- The finite family of actual strong derivatives indexed by all base Sobolev words. -/ +@[expose] def baseWordValues {s : ℕ} {f : LiftL2 period} (J : SpatialJet period standardDirection s f) : BaseWord s → LiftL2 period := fun w => J.word w.2 @@ -51,7 +52,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 +88,7 @@ end end -@[expose] public section +public section noncomputable section @@ -106,7 +107,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..15c38409ee 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 @@ -106,7 +106,7 @@ theorem metric_polynomial_conversion (S0 S1 S2 D R B a E Y X Z H : ℝ) _ = _ := by ring /-- A concrete pointwise velocity bound determined by the actual metric energy. -/ -def metricVelocityBound (c B X : ℝ) : NNReal := +@[expose] def metricVelocityBound (c B X : ℝ) : NNReal := (sobolevEmbeddingConstant period 6*(B+metricAmplification c*X)).toNNReal /-- The actual background-plus-error velocity satisfies the fixed-order bound used by the metric PDE 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..044c04169e 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 @@ -251,7 +251,7 @@ open Set EulerLiftedGradientSpace EulerCylinderSobolevSpace EulerGevreyMetricCom EulerWeightedCylinderEnergy EulerFiniteMetricEnergy EulerPacketWeights EulerBaseWordMetric /-- The literal inclusion of external words into a larger cutoff. -/ -def externalWordInclusion {N M : ℕ} (hNM : N ≤ M) (I : ExternalWord N) : ExternalWord M := +@[expose] def externalWordInclusion {N M : ℕ} (hNM : N ≤ M) (I : ExternalWord N) : ExternalWord M := ⟨Fin.castLE (Nat.succ_le_succ hNM) I.1,I.2⟩ /-- Increasing the cutoff does not identify distinct derivative words. -/ @@ -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..7c1f3ebf1b 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 @@ -298,7 +298,7 @@ local instance shiftedTransportSpace (q : ℕ) : NormedSpace ℝ (SobolevSpace p inferInstance /-- The shifted actual H⁶ pressure sum stops one derivative below the velocity cutoff. -/ -def shiftedPressureNorm {s : ℕ} (N : ℕ) (ρ : ℝ) (p : SobolevSpace period s) : ℝ := +@[expose] def shiftedPressureNorm {s : ℕ} (N : ℕ) (ρ : ℝ) (p : SobolevSpace period s) : ℝ := ∑ n ∈ Finset.range (N+1), ((n+1 : ℕ) : ℝ)*weight ρ (n+1)*blockNorm period (toJet period p) 6 n /-- Continuity on the genuine Sobolev domain of the shifted pressure norm. -/ 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..a2457fffe0 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 @@ -60,7 +60,7 @@ theorem heatRegularizer_heat {q : ℕ} (n : ℕ) (v : ℝ≥0) (u : SobolevSpace cylinderHeat_semigroup, cylinderHeat_semigroup, add_comm] /-- Heat acting pointwise on a continuous Sobolev time path. -/ -def pathHeat (q : ℕ) (T : ℝ) (v : ℝ≥0) (u : C(Icc (0 : ℝ) T, SobolevSpace period q)) : +@[expose] def pathHeat (q : ℕ) (T : ℝ) (v : ℝ≥0) (u : C(Icc (0 : ℝ) T, SobolevSpace period q)) : C(Icc (0 : ℝ) T, SobolevSpace period q) := mapPath period T (heatOperator period q v) u /-- Strong heat continuity is uniform over every compact continuous time path. -/ 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..ab28ccb9db 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 @@ -34,11 +34,11 @@ open scoped ContDiff /-- Transport linear, given by `(κ • ContinuousLinearMap.id ℝ Vector3).prod (toDual ℝ Vector3 m)`. -/ -def transportLinear (κ : ℝ) (m : Vector3) : Vector3 →L[ℝ] LiftTangent := +@[expose] def transportLinear (κ : ℝ) (m : Vector3) : Vector3 →L[ℝ] LiftTangent := (κ • ContinuousLinearMap.id ℝ Vector3).prod (toDual ℝ Vector3 m) @[simp] theorem transportLinear_apply (κ : ℝ) (m v : Vector3) : - transportLinear κ m v = transportDirection κ m v := rfl + transportLinear κ m v = transportDirection κ m v := by rfl theorem transportLinear_single (κ : ℝ) (m : Vector3) (i : Fin 3) : transportLinear κ m (EuclideanSpace.single i 1) = coordinateDirection κ m i := by @@ -60,6 +60,7 @@ theorem trace_transportLinear (κ : ℝ) (m : Vector3) (L : LiftTangent →L[ℝ variable (P κ : ℝ) (m : Vector3) (g : LiftDomain P → Vector3) /-- Cover velocity, given by `transportDirection κ m (g (coveringMap P z))`. -/ +@[expose] def coverVelocity (z : LiftTangent) : LiftTangent := transportDirection κ m (g (coveringMap P z)) @@ -98,7 +99,7 @@ end end -@[expose] public section +public section noncomputable section @@ -199,11 +200,12 @@ local instance instLiftedSmoothTimeField8 (n : ℕ) : NormedSpace ℝ (E →ᵇ := inferInstance /-- Lift, given by `A.map (transportLinear κ m)`. -/ -def lift (A : SmoothTimeField K E Space) (κ : ℝ) (m : Space) : SmoothTimeField K E LiftTangent := +@[expose] def lift (A : SmoothTimeField K E Space) (κ : ℝ) (m : Space) : + SmoothTimeField K E LiftTangent := A.map (transportLinear κ m) @[simp] theorem lift_apply (A : SmoothTimeField K E Space) (κ : ℝ) (m : Space) (t : K) (x : E) : - (lift A κ m).field t x = (κ • A.field t x, inner ℝ m (A.field t x)) := rfl + (lift A κ m).field t x = (κ • A.field t x, inner ℝ m (A.field t x)) := by rfl theorem lift_jet_norm_le (A : SmoothTimeField K E Space) (κ : ℝ) (m : Space) (n : ℕ) : ‖(lift A κ m).jet n‖ ≤ |κ| * ‖A.jet n‖ + ‖(A.map (normalComponentMap m)).jet n‖ := by 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..84040ad731 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 @@ -345,11 +345,11 @@ open Set ContinuousLinearMap EulerContinuousTimeIntegral EulerContinuousTimeWeig open scoped ContDiff /-- The once-enlarged coefficient amplitude for the frozen equation at fixed base order. -/ -def forwardSobolevAmplitude (ι : Type*) [Fintype ι] (q : ℕ) (T C CB Rc : ℝ) : ℝ := +@[expose] 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..0e504531c5 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 @@ -185,7 +185,7 @@ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E (T : ℝ) (hT : 0 ≤ T) (B : C(Icc (0 : ℝ) T, E →L[ℝ] E)) /-- A homogeneous evolution constructed for an arbitrary continuous operator coefficient. -/ -def constructedEvolution : Evolution T hT B where +@[expose] def constructedEvolution : Evolution T hT B where forward := (fundamentalPath T hT B).forward backward := (fundamentalPath T hT B).backward forward_backward := (fundamentalPath T hT B).forward_backward 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..6d4edb9f02 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 @@ -77,7 +77,8 @@ local instance instLpCylinderCoefficients8 : NormedRing (Supported period V S hS inferInstance /-- The actual cylinder operator of a spatial coefficient. -/ -def liftedOperator (A : Space →ᵇ V →L[ℝ] V) : Supported period V S hS →L[ℝ] Supported period V S hS +@[expose] def liftedOperator (A : Space →ᵇ V →L[ℝ] V) : + Supported period V S hS →L[ℝ] Supported period V S hS := operator (liftMeasure period) (spatialSet period S) (spatialSet_measurable period S hS) (fieldLift period A) @@ -111,7 +112,7 @@ theorem operator_intertwines (Ω : Set Space) (hΩ : MeasurableSet Ω) variable (T : ℝ) /-- The entire coefficient time path, acting on the supported cylinder. -/ -def liftedOperatorPath (A : C(Icc (0 : ℝ) T, Space →ᵇ V →L[ℝ] V)) : +@[expose] def liftedOperatorPath (A : C(Icc (0 : ℝ) T, Space →ᵇ V →L[ℝ] V)) : C(Icc (0 : ℝ) T,Supported period V S hS →L[ℝ] Supported period V S hS) := operatorPath (liftMeasure period) (spatialSet period S) (spatialSet_measurable period S hS) T (fieldPathLift period A) @@ -128,7 +129,7 @@ theorem liftedOperatorPath_norm (A : C(Icc (0 : ℝ) T, Space →ᵇ V →L[ℝ] (fun x _ => (A t).norm_coe_le_norm x.1)).trans (A.norm_coe_le_norm t) /-- The literal linear map underlying coefficient-path lifting. -/ -def liftedOperatorPathLinear : C(Icc (0 : ℝ) T,Space →ᵇ V →L[ℝ] V) →ₗ[ℝ] +@[expose] def liftedOperatorPathLinear : C(Icc (0 : ℝ) T,Space →ᵇ V →L[ℝ] V) →ₗ[ℝ] C(Icc (0 : ℝ) T,Supported period V S hS →L[ℝ] Supported period V S hS) where toFun := liftedOperatorPath period S hS T map_add' A D := by @@ -145,7 +146,7 @@ def liftedOperatorPathLinear : C(Icc (0 : ℝ) T,Space →ᵇ V →L[ℝ] V) → r (fieldLift period (A t)) /-- Lifting spatial coefficient paths to actual cylinder operators is a linear contraction. -/ -def liftedOperatorPathMap : C(Icc (0 : ℝ) T,Space →ᵇ V →L[ℝ] V) →L[ℝ] +@[expose] def liftedOperatorPathMap : C(Icc (0 : ℝ) T,Space →ᵇ V →L[ℝ] V) →L[ℝ] C(Icc (0 : ℝ) T,Supported period V S hS →L[ℝ] Supported period V S hS) := (liftedOperatorPathLinear period S hS T).mkContinuous 1 (fun A => by change ‖liftedOperatorPath period S hS T A‖ ≤ 1*‖A‖ @@ -153,7 +154,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 +207,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..003b67bde1 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 @@ -73,7 +73,7 @@ typeclass synthesis. -/ local instance instLpCylinderPaths8 : NormedSpace ℝ C(K,Supported period V S hS) := inferInstance /-- Inclusion of a supported path into the genuine ordinary L² path space. -/ -def includePath : C(K,Supported period V S hS) →L[ℝ] C(K,CylinderL2 period V) := +@[expose] def includePath : C(K,Supported period V S hS) →L[ℝ] C(K,CylinderL2 period V) := (Supported period V S hS).subtypeL.compLeftContinuous ℝ K /-- Projection of each ordinary L² value to the fixed supported subspace. -/ @@ -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..2feecaf497 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 @@ -108,14 +108,14 @@ theorem supported_smul (r : ℝ) (A : α →ᵇ E →L[ℝ] F) : rfl /-- The literal linear dependence of the supported multiplier on its coefficient. -/ -def supportedLinear : (α →ᵇ E →L[ℝ] F) →ₗ[ℝ] +@[expose] def supportedLinear : (α →ᵇ E →L[ℝ] F) →ₗ[ℝ] (supportedSpace (V := E) μ S hS →L[ℝ] supportedSpace (V := F) μ S hS) where toFun := supported μ S hS map_add' := supported_add μ S hS map_smul' := supported_smul μ S hS /-- The real coefficient-to-L²-operator map on the supported spaces. -/ -def supportedMap : (α →ᵇ E →L[ℝ] F) →L[ℝ] +@[expose] def supportedMap : (α →ᵇ E →L[ℝ] F) →L[ℝ] (supportedSpace (V := E) μ S hS →L[ℝ] supportedSpace (V := F) μ S hS) where toLinearMap := supportedLinear μ S hS cont := AddMonoidHomClass.continuous_of_bound (supportedLinear μ S hS) 1 (fun A => by @@ -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 @@ -355,14 +356,14 @@ theorem fullPathMap_norm : ‖fullPathMap (K := K) (E := E) (F := F) period‖ (by simpa only [one_mul] using A.norm_coe_le_norm t)) /-- The actual coefficient-to-multiplication map on continuous cylinder paths. -/ -def fullMultiplierMap : C(K,Space →ᵇ E →L[ℝ] F) →L[ℝ] +@[expose] def fullMultiplierMap : C(K,Space →ᵇ E →L[ℝ] F) →L[ℝ] (C(K,CylinderL2 period E) →L[ℝ] C(K,CylinderL2 period F)) := (EulerContinuousPathCalculus.coefficientMap (K := K) (E := CylinderL2 period E) (F := CylinderL2 period F)).comp (fullPathMap period) @[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) @@ -475,7 +476,7 @@ local instance instLpCylinderRectangular36 : NormedSpace ℝ (C(K,Supported peri hS)) := inferInstance /-- Restriction to the closed spatial-support subspaces. -/ -def supportedOperatorMap : (Space →ᵇ E →L[ℝ] F) →L[ℝ] +@[expose] def supportedOperatorMap : (Space →ᵇ E →L[ℝ] F) →L[ℝ] (Supported period E S hS →L[ℝ] Supported period F S hS) := (EulerLpOperatorField.supportedMap (E := E) (F := F) (liftMeasure period) (spatialSet period S) (spatialSet_measurable period S hS)).comp (fieldLift @@ -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,17 +494,17 @@ 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`. -/ -def supportedPathMap : C(K,Space →ᵇ E →L[ℝ] F) →L[ℝ] +@[expose] def supportedPathMap : C(K,Space →ᵇ E →L[ℝ] F) →L[ℝ] C(K,Supported period E S hS →L[ℝ] Supported period F S hS) := (supportedOperatorMap (E := E) (F := F) period S hS).compLeftContinuous ℝ K /-- Supported multiplier map as an element of `C(K,Space →ᵇ E →L[ℝ] F) →L[ℝ] (C(K,Supported period E S hS) →L[ℝ] C(K,Supported period F S hS))`. -/ -def supportedMultiplierMap : C(K,Space →ᵇ E →L[ℝ] F) →L[ℝ] +@[expose] def supportedMultiplierMap : C(K,Space →ᵇ E →L[ℝ] F) →L[ℝ] (C(K,Supported period E S hS) →L[ℝ] C(K,Supported period F S hS)) := (EulerContinuousPathCalculus.coefficientMap (K := K) (E := Supported period E S hS) (F := Supported period F S hS)).comp (supportedPathMap period S @@ -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..a9675286da 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 @@ -182,7 +182,11 @@ theorem weighted_solution_translation (a : LiftTangent) (ha : shiftedSet a.1 K rw [he] apply ContinuousMap.ext intro t - rfl + simp only [includePath_apply, compLeftContinuous_apply, pathTranslate_apply] + change (L ((U.weightedSolution g hg f a₀) t) : CylinderL2 period V) = + translate period a (((U.weightedSolution g hg f a₀) t : Supported period V K hK) : + CylinderL2 period V) + exact EulerLpCylinderTranslation.intoLarger_coe period a K Ω hK hΩ ha _ /-- Normalization preserves the exact local translation identification. -/ theorem weighted_solution_translation_eventually @@ -210,7 +214,7 @@ end end -@[expose] public section +public section noncomputable section @@ -270,16 +274,17 @@ local instance instLpCylinderRegularForward10 : NormedSpace ℝ C(Icc (0 : ℝ) hΩ) := inferInstance /-- The actual multiplication coefficient on the one fixed supported space. -/ -def coefficientFamily (a : LiftTangent) : +@[expose] def coefficientFamily (a : LiftTangent) : C(Icc (0 : ℝ) T,Supported period V Ω hΩ →L[ℝ] Supported period V Ω hΩ) := liftedOperatorPath period Ω hΩ T (translateCoefficientPath B a.1) /-- Its homogeneous evolution is constructed, not assumed. -/ +@[expose] def evolutionFamily (a : LiftTangent) : Evolution T hT (coefficientFamily period T Ω hΩ B a) := constructedEvolution period Ω hΩ T hT (translateCoefficientPath B a.1) /-- The genuine profile-normalized forced solution in this fixed space. -/ -def solutionFamily (g : C(Icc (0 : ℝ) T, ℝ)) (hg : ∀ t, 0 < g t) +@[expose] def solutionFamily (g : C(Icc (0 : ℝ) T, ℝ)) (hg : ∀ t, 0 < g t) (f : C(Icc (0 : ℝ) T, CylinderL2 period V)) (a₀ : CylinderL2 period V) (a : LiftTangent) : C(Icc (0 : ℝ) T,Supported period V Ω hΩ) := (evolutionFamily period T hT Ω hΩ B a).weightedSolution g hg 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..aa02abb995 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 @@ -57,11 +57,12 @@ theorem tupleLp_ae (u : ι → Lp V 2 μ) : end Tuple /-- Coordinate directions in the ordinary spatial domain. -/ +@[expose] 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..51aabf8471 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 @@ -69,14 +69,14 @@ theorem apply_memLp (A : α →ᵇ (E →L[ℝ] F)) (u : Lp E 2 μ) : (mul_le_mul_of_nonneg_right (A.norm_coe_le_norm x) (norm_nonneg _))) /-- Actual application to a Bochner L² class. -/ -def applyField (A : α →ᵇ (E →L[ℝ] F)) (u : Lp E 2 μ) : Lp F 2 μ := +@[expose] def applyField (A : α →ᵇ (E →L[ℝ] F)) (u : Lp E 2 μ) : Lp F 2 μ := (apply_memLp μ A u).toLp (fun x => A x (u x)) theorem applyField_ae (A : α →ᵇ (E →L[ℝ] F)) (u : Lp E 2 μ) : applyField μ A u =ᵐ[μ] fun x => A x (u x) := (apply_memLp μ A u).coeFn_toLp /-- Full linear, bundling `toFun`, `map_add`, `map_smul`. -/ -def fullLinear (A : α →ᵇ (E →L[ℝ] F)) : Lp E 2 μ →ₗ[ℝ] Lp F 2 μ where +@[expose] def fullLinear (A : α →ᵇ (E →L[ℝ] F)) : Lp E 2 μ →ₗ[ℝ] Lp F 2 μ where toFun := applyField μ A map_add' u v := by apply Lp.ext @@ -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..7463dc2ff0 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 @@ -64,14 +64,14 @@ theorem product_memLp (A : SmoothCoefficientPath K (V →L[ℝ] W)) (t : K) _) /-- Product, bundling `field`, `smooth`, `integrable`. -/ -def product (A : SmoothCoefficientPath K (V →L[ℝ] W)) (t : K) +@[expose] def product (A : SmoothCoefficientPath K (V →L[ℝ] W)) (t : K) (f : SmoothL2Field V) : SmoothL2Field W where field x := A.field t x (f.field x) smooth := (A.smooth t).clm_apply f.smooth 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..7d79c78369 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 @@ -62,7 +62,7 @@ theorem jetLp_mapField (L : V →L[ℝ] W) (A : SmoothL2Field V) (n : ℕ) : ((congrArg (jetPostcompose L n) h₃).symm.trans h₂.symm)) /-- Add field, bundling `field`, `smooth`, `integrable`. -/ -def addField (A B : SmoothL2Field V) : SmoothL2Field V where +@[expose] def addField (A B : SmoothL2Field V) : SmoothL2Field V where field := A.field+B.field smooth := A.smooth.add B.smooth integrable n := ((A.integrable n).add (B.integrable n)).ae_eq @@ -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 @@ -89,6 +89,7 @@ theorem jetLp_addField (A B : SmoothL2Field V) (n : ℕ) : h₄.symm)) /-- Zero field, bundling `field`, `smooth`, `integrable`. -/ +@[expose] def zeroField : SmoothL2Field V where field := 0 smooth := contDiff_const @@ -114,11 +115,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..d85ceff1b9 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 @@ -41,7 +41,7 @@ variable {α V : Type*} [TopologicalSpace α] [MeasurableSpace α] [BorelSpace abbrev Field := α →ᵇ (V →L[ℝ] V) /-- The ordinary full-space L² coefficient multiplier. -/ -def full (A : Field (α := α) (V := V)) : Lp V 2 μ →L[ℝ] Lp V 2 μ := +@[expose] def full (A : Field (α := α) (V := V)) : Lp V 2 μ →L[ℝ] Lp V 2 μ := coefficientOperator A A.continuous.aestronglyMeasurable_of_secondCountable ‖A‖₊ A.norm_coe_le_norm /-- Its representative is actual pointwise multiplication. -/ @@ -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..ca1f349c3c 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 @@ -32,7 +32,7 @@ variable {α V : Type*} [MeasurableSpace α] (μ : Measure α) (S : Set α) (hS : MeasurableSet S) /-- The actual measurable-set cutoff on a Bochner L² function. -/ -def cutoff (u : Lp V 2 μ) : Lp V 2 μ := +@[expose] def cutoff (u : Lp V 2 μ) : Lp V 2 μ := ((Lp.memLp u).indicator hS).toLp (S.indicator u) omit [InnerProductSpace ℝ V] in @@ -52,7 +52,7 @@ theorem cutoff_norm (u : Lp V 2 μ) : ‖cutoff μ S hS u‖ ≤ ‖u‖ := by exact norm_nonneg _ /-- The actual cutoff is linear. -/ -def cutoffLinear : Lp V 2 μ →ₗ[ℝ] Lp V 2 μ where +@[expose] def cutoffLinear : Lp V 2 μ →ₗ[ℝ] Lp V 2 μ where toFun := cutoff μ S hS map_add' u v := by apply Lp.ext @@ -75,13 +75,17 @@ def cutoffLinear : Lp V 2 μ →ₗ[ℝ] Lp V 2 μ where · simp only [indicator_of_notMem hs, smul_zero] /-- The supported-set projection as a genuine bounded linear map. -/ -def cutoffOperator : Lp V 2 μ →L[ℝ] Lp V 2 μ := +@[expose] def cutoffOperator : Lp V 2 μ →L[ℝ] Lp V 2 μ := (cutoffLinear μ S hS).mkContinuous 1 (fun u => by 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 μ) := +@[expose] def supportedSpace : Submodule ℝ (Lp V 2 μ) := (ContinuousLinearMap.id ℝ (Lp V 2 μ) - cutoffOperator μ S hS).ker /-- Membership is fixedness under actual measurable-set projection. -/ 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..7ff25190d4 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 @@ -51,14 +51,14 @@ variable {T : ℝ} {hT : 0 ≤ T} (s : StrongMeanEvolution T hT FInv F F₁ A L u f) /-- The original coordinate velocity is continuous on the closed time interval. -/ -def coordinateVelocityPath : C(Icc (0 : ℝ) T, solenoidalSpace) := +@[expose] def coordinateVelocityPath : C(Icc (0 : ℝ) T, solenoidalSpace) := ⟨fun t => s.velocity t, by have hc : ContinuousOn s.velocity (Icc (0 : ℝ) T) := by simpa only [uIcc_of_le hT] using s.velocity_ac.continuousOn 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..7a649ccc27 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‖ @@ -234,6 +235,7 @@ theorem classicalBaseSize_eq (directions : ι → Space) (q : ℕ) (u : L2) (hu /-- Sum of actual classical Hq sizes of the external derivative fields. `representative_word` identifies those fields with derivatives of the original representative. -/ +@[expose] def classicalBlockSize (directions : ι → Space) (q : ℕ) (u : L2) (hu : SmoothOrbit u) (n : ℕ) : ℝ := ∑ w : Fin n → ι, classicalBaseSize directions q (ordinaryWord directions u w) (ordinaryWord_smooth 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..da111a0a12 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 @@ -35,7 +35,7 @@ variable {T : ℝ} {hT : 0 ≤ T} (s : StrongMeanEvolution T hT FInv F F₁ A L u f) /-- The continuous time path constructed from the actual B and B_t. -/ -def continuousVelocity : C(Icc (0 : ℝ) T, L2) := +@[expose] def continuousVelocity : C(Icc (0 : ℝ) T, L2) := reconstruction T hT (s.velocityField, s.velocityDerivative) /-- This reconstruction is exactly the physical representative, at every time. -/ 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..e655ca4191 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 @@ -81,7 +81,7 @@ def meanTransportEquiv continuous_invFun := (meanBackward T hT FInv F F₁ hInv).continuous /-- Explicit polynomial transport cost for the mean fixed-space formulation. -/ -def meanTransportCost : ℝ := +@[expose] def meanTransportCost : ℝ := transportCost T (solenoidalFrame T F) (solenoidalFrame T F₁) (meanFrameCoercivity T FInv) include hT in diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanFixedSpaceInverse.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanFixedSpaceInverse.lean index b9a433fe91..279cc74343 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)) @@ -116,7 +116,7 @@ variable (FInv : C(Icc (0 : ℝ) T, L2 →L[ℝ] L2)) HasDerivWithinAt (extendPath T hT F) (F₁ t) (Icc (0 : ℝ) T) t) /-- An explicit positive coercivity constant from the proved mean transport bound. -/ -def fixedMeanCoercivity : ℝ := (meanTransportCost T FInv F F₁)⁻¹^2 / 2 +@[expose] def fixedMeanCoercivity : ℝ := (meanTransportCost T FInv F F₁)⁻¹^2 / 2 include hT in /-- The fixed-space coercivity constant is positive. -/ @@ -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..e622c21394 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 @@ -149,6 +150,7 @@ theorem test_memLp (f : Test) : MemLp (f : Space → Space) 2 volume := f.smooth.continuous.memLp_of_hasCompactSupport f.compact /-- Test value, given by `(test_memLp f).toLp (f : Space → Space)`. -/ +@[expose] def testValue (f : Test) : L2 := (test_memLp f).toLp (f : Space → Space) theorem testValue_ae (f : Test) : testValue f =ᵐ[volume] (f : Space → Space) := @@ -317,7 +319,7 @@ end end -@[expose] public section +public section noncomputable section @@ -329,7 +331,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..f68bf002e4 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 @@ -85,7 +85,8 @@ theorem ordinarySpatialJet_word (n q : ℕ) (hn : n ≤ q) (u : EulerMeanSolenoi exact Fin.snoc_init_self _ /-- A concrete element of the previously constructed complete cylinder Sobolev space. -/ -def ordinarySobolev (q : ℕ) (u : EulerMeanSolenoidal.L2) (hu : SmoothOrbit u) : SobolevSpace 1 q := +@[expose] def ordinarySobolev (q : ℕ) (u : EulerMeanSolenoidal.L2) + (hu : SmoothOrbit u) : SobolevSpace 1 q := ofJet 1 (ordinarySpatialJet q u hu) @[simp] theorem ordinarySobolev_value (q : ℕ) (u : EulerMeanSolenoidal.L2) (hu : SmoothOrbit u) : @@ -95,8 +96,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..d585e59892 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 @@ -2044,17 +2044,20 @@ variable {D : Data} {ι : Type*} [Fintype ι] {q : ℕ} {R : ℝ} /-- Velocity amplitude, given by `3*sobolevCoefficientAmplitude ι q E.Rc E.CF*coordinateTraceCost D.T`. -/ +@[expose] def velocityAmplitude : ℝ := 3*sobolevCoefficientAmplitude ι q E.Rc E.CF*coordinateTraceCost D.T /-- Derivative amplitude, given by `3*(sobolevCoefficientAmplitude ι q E.Rc E.CF₁*coordinateTraceCost D.T + sobolevCoefficientAmplitude ι q E.Rc E.CF)`. -/ +@[expose] def derivativeAmplitude : ℝ := 3*(sobolevCoefficientAmplitude ι q E.Rc E.CF₁*coordinateTraceCost D.T + sobolevCoefficientAmplitude ι q E.Rc E.CF) /-- Pressure amplitude, given by `E.Cf+3*sobolevCoefficientAmplitude ι q E.Rc E.CF + 6*sobolevCoefficientAmplitude ι q E.Rc E.CF₁*coordinateTraceCost D.T`. -/ +@[expose] def pressureAmplitude : ℝ := E.Cf+3*sobolevCoefficientAmplitude ι q E.Rc E.CF + 6*sobolevCoefficientAmplitude ι q E.Rc E.CF₁*coordinateTraceCost D.T @@ -2123,7 +2126,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 +2248,7 @@ section /-! Zero forcing produces the actual zero velocity, derivative, and pressure force. -/ -@[expose] public section +public section noncomputable section @@ -2288,7 +2291,7 @@ end end -@[expose] public section +public section noncomputable section @@ -2397,7 +2400,7 @@ section /-! Exact parameter restriction and injective subalphabet bounds for genuine derivative words. -/ -@[expose] public section +public section noncomputable section @@ -2461,7 +2464,7 @@ end end -@[expose] public section +public section noncomputable section @@ -2608,7 +2611,7 @@ section /-! A single uniform-time forcing bound suffices for the normalized mean estimates. -/ -@[expose] public section +public section noncomputable section @@ -2646,11 +2649,15 @@ theorem path_envelope_bounds (E : SobolevData D ι q R) (mul_le_mul_of_nonneg_left (hb n a) (Real.sqrt_nonneg D.T)) have hm := mul_nonneg hA (majorant_nonneg R E.radius_nonneg d n) have hc := mul_le_mul_of_nonneg_right hCfT hm - exact h.trans (by nlinarith) + exact h.trans (hc.trans_eq (by ring)) · intro n a have hm := mul_nonneg hA (majorant_nonneg R E.radius_nonneg d n) have hc := mul_le_mul_of_nonneg_right hCf1 hm - exact (hb n a).trans (by nlinarith) + calc + _ ≤ A * majorant R d n := hb n a + _ = 1 * (A * majorant R d n) := by ring + _ ≤ E.Cf * (A * majorant R d n) := hc + _ = A * (E.Cf * majorant R d n) := by ring end EulerMeanPacketProvider.SobolevData @@ -2659,7 +2666,7 @@ end end -@[expose] public section +public section noncomputable section @@ -2690,7 +2697,7 @@ variable {D : Data} {raw : VectorField} (G : Forcing D raw) (P : ℝ) [Fact (0 < P)] /-- Pressure force cylinder field, given by `G.pressureForceForcing.toCylinderField P`. -/ -def pressureForceCylinderField : EulerPacketCylinderField.Field P D.T G.pressureForce := +@[expose] def pressureForceCylinderField : EulerPacketCylinderField.Field P D.T G.pressureForce := G.pressureForceForcing.toCylinderField P /-- This witness represents the literal spatial gradient encoded by the @@ -2726,13 +2733,14 @@ namespace Budget variable {D : Data} {q : ℕ} {R : ℝ} (B : Budget D q R) /-- Velocity cost, given by `B.toSobolevData.velocityAmplitude`. -/ -def velocityCost : ℝ := B.toSobolevData.velocityAmplitude +@[expose] def velocityCost : ℝ := B.toSobolevData.velocityAmplitude /-- Derivative cost, given by `B.toSobolevData.derivativeAmplitude`. -/ -def derivativeCost : ℝ := B.toSobolevData.derivativeAmplitude +@[expose] def derivativeCost : ℝ := B.toSobolevData.derivativeAmplitude /-- Pressure force cost, given by `B.toSobolevData.pressureAmplitude`. -/ -def pressureForceCost : ℝ := B.toSobolevData.pressureAmplitude +@[expose] def pressureForceCost : ℝ := B.toSobolevData.pressureAmplitude /-- Pressure gradient cost, given by `3*sobolevCoefficientAmplitude (Fin 4) q B.Rc B.CF*B.pressureForceCost`. -/ +@[expose] def pressureGradientCost : ℝ := 3*sobolevCoefficientAmplitude (Fin 4) q B.Rc B.CF*B.pressureForceCost diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanPacketConstraints.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanPacketConstraints.lean index 70cf868348..3cb75e0999 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 @@ -35,7 +35,7 @@ open scoped ContDiff variable {D : Data} {raw : VectorField} (G : Forcing D raw) /-- The actual solenoidal coordinate velocity, regarded in ordinary L². -/ -def coordinateOrdinaryPath : C(Icc (0 : ℝ) D.T,L2) := +@[expose] def coordinateOrdinaryPath : C(Icc (0 : ℝ) D.T,L2) := (solenoidalSpace.subtypeL.compLeftContinuous ℝ (Icc (0 : ℝ) D.T)) G.solution.coordinateVelocityPath 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..c6174ec4e4 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 @@ -52,7 +52,7 @@ local instance instMeanPacketCylinderFields4 : NormedSpace ℝ C(Icc (0 : ℝ) T /-- Spatial embedding path, given by `(embedding (V := Space) P).compLeftContinuous ℝ (Icc (0 : ℝ) T)`. -/ -def spatialEmbeddingPath : C(Icc (0 : ℝ) T,L2) →L[ℝ] C(Icc (0 : ℝ) T,LiftL2 P) := +@[expose] def spatialEmbeddingPath : C(Icc (0 : ℝ) T,L2) →L[ℝ] C(Icc (0 : ℝ) T,LiftL2 P) := (embedding (V := Space) P).compLeftContinuous ℝ (Icc (0 : ℝ) T) @[simp] theorem spatialEmbeddingPath_apply (p : C(Icc (0 : ℝ) T, L2)) @@ -85,7 +85,7 @@ namespace Forcing variable {T} {D : Data} {raw : VectorField} (G : Forcing D raw) /-- Literal smooth mean forcing becomes an actual cylinder witness with no angular dependence. -/ -def toCylinderField : Field P D.T raw := +@[expose] def toCylinderField : Field P D.T raw := Field.ofLifted (spatialEmbeddingPath P D.T G.path) (spatialEmbeddingPath_orbit P D.T G.path G.path_orbit) (fun t z => (G.slices t).field z.1) @@ -104,10 +104,10 @@ def toCylinderField : Field P D.T raw := (G.toCylinderField P).path = spatialEmbeddingPath P D.T G.path := rfl /-- Vector cylinder field, given by `G.vectorForcing.toCylinderField P`. -/ -def vectorCylinderField : Field P D.T G.vector := G.vectorForcing.toCylinderField P +@[expose] def vectorCylinderField : Field P D.T G.vector := G.vectorForcing.toCylinderField P /-- Vector derivative cylinder field, given by `G.vectorDerivativeForcing.toCylinderField P`. -/ -def vectorDerivativeCylinderField : Field P D.T G.vectorDerivative := +@[expose] def vectorDerivativeCylinderField : Field P D.T G.vectorDerivative := G.vectorDerivativeForcing.toCylinderField P theorem vectorCylinderField_time : diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanPacketData.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanPacketData.lean index abc89fdda4..92b6d40508 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 @@ -267,7 +267,7 @@ theorem opCurvature_upper : ∀ t v, ⟪D.opH t v,v⟫_ℝ ≤ D.K*‖v‖^2 := operatorPath_quadratic_upper D.T D.H.field D.K D.curvature_upper /-- The actual source weak inverse with the harmonic boundary estimate discharged. -/ -def solver : TimeLp D.T L2 →L[ℝ] meanDerivatives D.T D.T_pos.le D.opInv := +@[expose] def solver : TimeLp D.T L2 →L[ℝ] meanDerivatives D.T D.T_pos.le D.opInv := sourceMeanSolver D.T D.T_pos.le D.ℓ D.ℓ_pos D.M0.field D.M0.field.continuous.aestronglyMeasurable ‖D.M0.field‖₊ D.M0.field.norm_coe_le_norm D.Be D.Bc D.L D.r D.Be_nonneg D.Bc_nonneg D.L_lower D.r_nonneg D.r_le_quarter D.exterior_lower D.core_lower diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanPacketForcing.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanPacketForcing.lean index 76391c6545..0c452d8a78 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 @@ -139,7 +139,8 @@ theorem hasFDerivAt_value (A : SmoothFamily μ P V) (a : P) : theorem fderiv_value (A : SmoothFamily μ P V) : fderiv ℝ A.value = fun a => derivativeBundling μ (A.derivative.value a) := - funext (fun a => (A.hasFDerivAt_value a).fderiv) + funext (fun a => by + simpa only [derivativeBundling_apply] using (A.hasFDerivAt_value a).fderiv) end SmoothFamily @@ -154,7 +155,7 @@ section /-! All-order L² parameter regularity with the original square-integrable derivative bounds. -/ -@[expose] public section +public section noncomputable section @@ -228,7 +229,7 @@ end end -@[expose] public section +public section noncomputable section @@ -324,7 +325,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 +362,7 @@ end end -@[expose] public section +public section noncomputable section @@ -407,7 +408,7 @@ namespace Forcing variable {D : Data} {raw : VectorField} (G : Forcing D raw) /-- The genuine Bochner L² class of the prescribed forcing. -/ -def lp : TimeLp D.T L2 := pathLp D.T D.T_pos.le G.path +@[expose] def lp : TimeLp D.T L2 := pathLp D.T D.T_pos.le G.path theorem lp_rep : (G.lp : ℝ → L2) =ᵐ[timeMeasure D.T] extendPath D.T D.T_pos.le G.path := pathLp_ae D.T D.T_pos.le G.path 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..a5319c81c9 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 @@ -35,7 +35,7 @@ namespace Forcing variable {D : Data} {raw : VectorField} /-- Actual path-orbit regularity is converted into literal spatial derivative data. -/ -def ofOrbitPath (p : C(Icc (0 : ℝ) D.T, L2)) +@[expose] def ofOrbitPath (p : C(Icc (0 : ℝ) D.T, L2)) (hp : ContDiff ℝ ∞ (fun a : Space => pathTranslation D.T a p)) (heq : ∀ (t : Icc (0 : ℝ) D.T) x θ, raw (t,(x,θ)) = representative (p t) (pathTranslation_evaluation_contDiff D.T p hp t) x) : @@ -51,23 +51,23 @@ def ofOrbitPath (p : C(Icc (0 : ℝ) D.T, L2)) simpa only [Data.clamp_coe, smoothL2Field_field] using heq t x θ /-- The output velocity of the genuine source mean solve can be used as the next forcing input. -/ -def vectorForcing (G : Forcing D raw) : Forcing D G.vector := +@[expose] def vectorForcing (G : Forcing D raw) : Forcing D G.vector := ofOrbitPath G.velocityPath G.velocityPath_orbit (fun t x θ => by simp only [vector, pathRepresentative, Data.clamp_coe]) /-- Its true continuous time derivative has the same literal spatial admissibility. -/ -def vectorDerivativeForcing (G : Forcing D raw) : Forcing D G.vectorDerivative := +@[expose] def vectorDerivativeForcing (G : Forcing D raw) : Forcing D G.vectorDerivative := ofOrbitPath G.derivativePath G.derivativePath_orbit (fun t x θ => by simp only [vectorDerivative, pathRepresentative, Data.clamp_coe]) /-- 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². -/ -def pressureForceForcing (G : Forcing D raw) : Forcing D G.pressureForce := +@[expose] def pressureForceForcing (G : Forcing D raw) : Forcing D G.pressureForce := ofOrbitPath G.pressureForcePath G.pressureForcePath_orbit (fun t x θ => by simp only [pressureForce, pathRepresentative, Data.clamp_coe]) 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..58806e5491 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 @@ -24,7 +24,7 @@ open Set EulerSmoothLimit EulerMeanCoefficients EulerMeanScalarPressure variable {D : Data} {raw : VectorField} (G : Forcing D raw) /-- Scalar gradient, defined pointwise by `gradient (fun x => G.scalar (z.1,(x,z.2.2))) z.2.1`. -/ -def scalarGradient : VectorField := fun z => +@[expose] def scalarGradient : VectorField := fun z => gradient (fun x => G.scalar (z.1,(x,z.2.2))) z.2.1 theorem scalarGradient_eq (t : Icc (0 : ℝ) D.T) (x : Space) (θ : ℝ) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanPacketProvider.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanPacketProvider.lean index 079de2e5a8..e1a171819e 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) @@ -118,7 +118,7 @@ variable (T : ℝ) (hT : 0 ≤ T) (hR : ContDiff ℝ ∞ (fun a : Space => pathTranslation T a (s.pressurePath c hc hLower fC))) /-- The concrete normalized scalar mean pressure, constructed by a radial integral. -/ -def pressureScalar (t : Icc (0 : ℝ) T) : Space → ℝ := +@[expose] def pressureScalar (t : Icc (0 : ℝ) T) : Space → ℝ := radialPotential (fun x => (F.field t x).adjoint (pathRepresentative T (s.pressurePath c hc hLower fC) hR t x)) @@ -188,7 +188,7 @@ end end -@[expose] public section +public section noncomputable section @@ -205,16 +205,17 @@ 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`. -/ +@[expose] def strain (D : Data) (z : Domain) : Space →L[ℝ] Space := D.M.field (D.clamp z.1) z.2.1 @@ -225,15 +226,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..ff0f12dd7d 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 @@ -47,7 +47,7 @@ open Set MeasureTheory InnerProductSpace ContinuousLinearMap EulerMeanSolenoidal EulerTimeLp EulerTerminalTimePrimitive EulerTimeLpBoundedMap /-- Reflection restricted to the actual ordinary solenoidal subspace. -/ -def solenoidalReflection : solenoidalSpace →ₗᵢ[ℝ] solenoidalSpace where +@[expose] def solenoidalReflection : solenoidalSpace →ₗᵢ[ℝ] solenoidalSpace where toLinearMap := (reflection.toLinearMap.comp solenoidalSpace.subtype).codRestrict solenoidalSpace (fun u => reflection_solenoidal_mem u.property) norm_map' := fun u => reflection.norm_map (u : L2) @@ -131,7 +131,7 @@ end end -@[expose] public section +public section noncomputable section @@ -170,7 +170,7 @@ local instance instMeanOperatorReflection8 (T : ℝ) : InnerProductSpace ℝ (Ti := inferInstance /-- Reflection invariant, given by `∀ u, A (reflection u) = reflection (A u)`. -/ -def ReflectionInvariant (A : L2 →L[ℝ] L2) : Prop := +@[expose] def ReflectionInvariant (A : L2 →L[ℝ] L2) : Prop := ∀ u, A (reflection u) = reflection (A u) theorem timeMultiplier_reflection (T : ℝ) (hT : 0 ≤ T) @@ -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 @@ -413,7 +413,7 @@ namespace Data variable (D : Data) /-- The actual source coordinate solve as a bounded linear operator. -/ -def coordinateSolver : TimeLp D.T L2 →L[ℝ] TimeLp D.T solenoidalSpace := +@[expose] def coordinateSolver : TimeLp D.T L2 →L[ℝ] TimeLp D.T solenoidalSpace := sourceCoordinateSolver D.T D.T_pos.le D.ℓ D.ℓ_pos D.F D.F₁ D.H D.M0 D.opInv D.Be D.Bc D.L D.r D.Be_nonneg D.Bc_nonneg D.L_lower D.r_nonneg D.r_le_quarter D.exterior_lower D.core_lower D.opInv_left D.opF_time D.K D.K_nonneg D.opInv_initial 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..e34d77a314 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 @@ -23,7 +23,7 @@ open MeasureTheory InnerProductSpace EulerSmoothLimit EulerGevrey open scoped ContDiff /-- Scaled cutoff, bundling `field`, `smooth`, `compact`. -/ -def scaledCutoff (ℓ : ℝ) (hℓ : 0 < ℓ) : Cutoff where +@[expose] def scaledCutoff (ℓ : ℝ) (hℓ : 0 < ℓ) : Cutoff where field := fun x => EulerSpatialCutoffs.outerCutoff (ℓ • x) smooth := EulerSpatialCutoffs.outerCutoff_contDiff.comp (contDiff_id.const_smul ℓ) compact := EulerSpatialCutoffs.outerCutoff_compactSupport.comp_smul hℓ.ne' 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..cb90842360 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 @@ -76,12 +76,12 @@ variable (T : ℝ) (hT : 0 ≤ T) (ℓ : ℝ) (hℓ : 0 < ℓ) (hsmall : K * (T ^ 2 / 2) + Be * T + boundaryLocalizationC2 * Bc * r ^ 3 * T ≤ 1 / 2) /-- The actual full source form on fixed solenoidal derivative coordinates. -/ -def sourceFixedForm : TimeLp T solenoidalSpace →L[ℝ] TimeLp T solenoidalSpace := +@[expose] def sourceFixedForm : TimeLp T solenoidalSpace →L[ℝ] TimeLp T solenoidalSpace := fixedMeanOperator T hT (operatorPath T F.field) (operatorPath T F₁.field) (operatorPath T H.field) (multiplier M0.field) (boundaryOperator (scaledCutoff ℓ hℓ)) L /-- The positive source coercivity constant uses the actual inverse-frame bound. -/ -def sourceFixedCoercivity : ℝ := +@[expose] def sourceFixedCoercivity : ℝ := fixedMeanCoercivity T (operatorPath T F.field) (operatorPath T F₁.field) FInv include hT in @@ -102,7 +102,7 @@ theorem sourceFixedForm_coercive (v : TimeLp T solenoidalSpace) : (source_smallness T K Be Bc r hsmall) v /-- The fixed coordinate source solver is constructed from the proved coercive form. -/ -def sourceCoordinateSolver : TimeLp T L2 →L[ℝ] TimeLp T solenoidalSpace := +@[expose] def sourceCoordinateSolver : TimeLp T L2 →L[ℝ] TimeLp T solenoidalSpace := (coerciveInverse (sourceFixedForm T hT ℓ hℓ F F₁ H M0 L) (sourceFixedCoercivity T F F₁ FInv) (sourceFixedCoercivity_pos T hT F F₁ FInv) (sourceFixedForm_coercive T hT ℓ hℓ F F₁ H M0 FInv Be Bc L r hBe hBc hL hr hrquarter 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..12672f1736 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 @@ -68,12 +68,13 @@ variable (T : ℝ) (hT : 0 ≤ T) (hcoercive : ∀ v, c * ‖v‖ ^ 2 ≤ ⟪fixedMeanOperator T hT F F₁ H M0 A L v, v⟫_ℝ) /-- The genuine inverse of the translated fixed mean operator. -/ +@[expose] def translatedMeanInverse (a : Space) : TimeLp T solenoidalSpace →L[ℝ] TimeLp T solenoidalSpace := coerciveInverse (translatedMeanOperator T hT a F F₁ H M0 A L) c hc (translatedMeanOperator_coercive T hT a F F₁ H M0 A L c hcoercive) /-- The actual translated forcing-to-coordinate-derivative solver. -/ -def translatedMeanSolver (a : Space) : TimeLp T L2 →L[ℝ] TimeLp T solenoidalSpace := +@[expose] def translatedMeanSolver (a : Space) : TimeLp T L2 →L[ℝ] TimeLp T solenoidalSpace := (translatedMeanInverse T hT F F₁ H M0 A L c hc hcoercive a).comp (-(translatedMeanPrimitive T hT a F F₁).adjoint) @@ -151,7 +152,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..8aac229109 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 @@ -212,7 +218,7 @@ variable (T : ℝ) (hT : 0 ≤ T) (hsmall : K * (T ^ 2 / 2) + B * T ≤ 1 / 2) /-- The mean forcing-to-displacement-derivative map is constructed by Lax--Milgram. -/ -def meanSolver : TimeLp T L2 →L[ℝ] meanDerivatives T hT FInv := +@[expose] def meanSolver : TimeLp T L2 →L[ℝ] meanDerivatives T hT FInv := EulerMeanVariationalOperator.meanSolver (meanPrimitive T hT FInv) (meanTrace T hT FInv) (timeMultiplier T hT H) (M0+L • A) (T^2/2) T K B hK hB (meanPrimitive_norm_sq T hT FInv) (meanTrace_norm_sq T hT FInv) 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..ffeb8c9fd1 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 @@ -57,6 +57,7 @@ theorem metricPath_tendsto (T : ℝ) (K : C(Icc (0 : ℝ) T, H →L[ℝ] H)) (metricPath_continuous T K).continuousAt.tendsto.comp hu /-- A finite weighted sum of actual metric-root paths. -/ +@[expose] def weightedMetricPath {A : Type*} [Fintype A] (T : ℝ) (w : A → C(Icc (0 : ℝ) T, ℝ)) (K : C(Icc (0 : ℝ) T, H →L[ℝ] H)) (u : A → C(Icc (0 : ℝ) T, I → H)) : C(Icc (0 : ℝ) T, ℝ) := 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..b63f0e98f7 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 @@ -57,7 +57,7 @@ theorem mild_of_truncated_formula (ν : ℝ) (hν : 0 < ν) (T : ℝ) (hT : 0 exact congrArg (fun x : SobolevSpace period 0 => value period x) h /-- A genuine bounded derivative block with an arbitrary available Sobolev margin. -/ -def boundedWordBlock (p n : ℕ) {q : ℕ} (h : p + n ≤ q) (w : Fin n → Fin 4) : +@[expose] def boundedWordBlock (p n : ℕ) {q : ℕ} (h : p + n ≤ q) (w : Fin n → Fin 4) : SobolevSpace period q →L[ℝ] SobolevSpace period p := (wordBlock period p n w).comp (restrictOperator period h) diff --git a/LeanPool/NavierStokesAndEuler/Euler/MildWordEquation.lean b/LeanPool/NavierStokesAndEuler/Euler/MildWordEquation.lean index 0eb90f3a2e..0088e93a97 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 @@ -30,7 +30,7 @@ open scoped Topology NNReal variable (period : ℝ) [Fact (0 < period)] /-- Applying a bounded linear spatial map to an actual continuous Sobolev time path. -/ -def mapPath {p q : ℕ} (T : ℝ) (A : SobolevSpace period q →L[ℝ] SobolevSpace period p) +@[expose] def mapPath {p q : ℕ} (T : ℝ) (A : SobolevSpace period q →L[ℝ] SobolevSpace period p) (u : C(Icc (0 : ℝ) T, SobolevSpace period q)) : C(Icc (0 : ℝ) T, SobolevSpace period p) := ⟨fun t => A (u t), A.continuous.comp u.continuous⟩ diff --git a/LeanPool/NavierStokesAndEuler/Euler/NonlinearEnergyConstants.lean b/LeanPool/NavierStokesAndEuler/Euler/NonlinearEnergyConstants.lean index 4d3c99d66e..edd1bcff78 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 @@ -153,6 +153,7 @@ local instance boundTimeGroup (q : ℕ) : NormedAddCommGroup (SobolevSpace perio local instance boundTimeSpace (q : ℕ) : NormedSpace ℝ (SobolevSpace period q) := inferInstance /-- The explicit scalar majorant for the genuine seven-term nonlinear metric forcing. -/ +@[expose] def forcingPolynomial (B M B0 B1 A0 A2 residual cM Rc ρ X Y : ℝ) : ℝ := sourceConstant B M*residual + ((sourceConstant B M*(productConstant period 3*B1+A0+2*A2*productConstant period @@ -208,6 +209,7 @@ theorem correctionArray_bound {q : ℕ} (hq : 6 ≤ q + 1) {T : ℝ} /-- The literal polynomial majorant is continuous along the positive radius and actual continuous metric energies. -/ +@[expose] def forcingBoundPath {q : ℕ} (N : ℕ) (hN : N + 6 ≤ q + 1) (T : ℝ) (R : C(Icc (0 : ℝ) T, ℝ)) (hR : ∀ t, 0 < R t) (K : C(Icc (0 : ℝ) T, LiftL2 period →L[ℝ] LiftL2 period)) @@ -270,7 +272,7 @@ end end -@[expose] public section +public section noncomputable section @@ -282,21 +284,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..456f6b7d77 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 @@ -61,6 +61,7 @@ theorem ordinarySobolev_norm_le_tensor (A : SmoothL2Field Space) (q : ℕ) : variable {T : ℝ} /-- Field path, given by `⟨fun t => (A t).toLp,continuous_toLp A (hA 0)⟩`. -/ +@[expose] def fieldPath (A : Icc (0 : ℝ) T → SmoothL2Field Space) (hA : ∀ n, Continuous (fun t => (A t).jetLp n)) : C(Icc (0 : ℝ) T,EulerMeanSolenoidal.L2) := ⟨fun t => (A t).toLp,continuous_toLp A (hA 0)⟩ 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..84a53d4209 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 @@ -36,6 +36,7 @@ open Set EulerSmoothLimit EulerLpTranslation EulerLpTranslation.SmoothL2Field variable {T : ℝ} {hT : 0 ≤ T} /-- Is smooth projected euler as an element of `Prop`. -/ +@[expose] def IsSmoothProjectedEuler (A : Icc (0 : ℝ) T → SmoothL2Field Space) : Prop := (∀ n, Continuous (fun t => (A t).jetLp n)) ∧ (∀ t, (A t).toLp ∈ solenoidalSpace) ∧ @@ -101,7 +102,7 @@ end end -@[expose] public section +public section noncomputable section @@ -217,7 +218,7 @@ variable (A B : Icc (0 : ℝ) T → SmoothL2Field Space) 0) theorem evolutionOfScalarEuler_velocity : - (evolutionOfScalarEuler A B hA hd p hdiv hp he).velocity=A := rfl + (evolutionOfScalarEuler A B hA hd p hdiv hp he).velocity=A := by rfl include hB in theorem evolutionOfScalarEuler_derivative (hpos : 0 < T) (t : Icc (0 : ℝ) T) : @@ -297,7 +298,7 @@ all-order spatial paths represent `C H^m` for every finite `m`. A single strong L² time law and the continuous all-order derivative paths imply the strong time law in every Sobolev order by `sobolev_derivative_of_l2`. No norm, time regularity, or normalization is imposed on the scalar pressure. -/ -def IsSmoothScalarEuler (A : Icc (0 : ℝ) T → SmoothL2Field Space) : Prop := +@[expose] def IsSmoothScalarEuler (A : Icc (0 : ℝ) T → SmoothL2Field Space) : Prop := (∀ n, Continuous (fun t => (A t).jetLp n)) ∧ ∃ (B : Icc (0 : ℝ) T → SmoothL2Field Space) (p : ℝ → Space → ℝ), (∀ n, Continuous (fun t => (B t).jetLp n)) ∧ 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..468898756c 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,10 +235,11 @@ 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)`. -/ +@[expose] def pressureDifference (U V : Evolution T hT) (t : Icc (0 : ℝ) T) : SmoothL2Field Space := fieldSub (V.pressureForce t) (U.pressureForce t) @@ -279,6 +280,7 @@ theorem difference_time_law (U V : Evolution T hT) : /-- Energy path, given by `⟨fun t => wordEnergy 3 (U.difference V t),wordEnergy_continuous _ (U.difference_continuous V) 3⟩`. -/ +@[expose] def energyPath (U V : Evolution T hT) : C(Icc (0 : ℝ) T,ℝ) := ⟨fun t => wordEnergy 3 (U.difference V t),wordEnergy_continuous _ (U.difference_continuous V) 3⟩ diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerGradientControl.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerGradientControl.lean index b5c3f40056..5b0ba46934 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 @@ -405,6 +405,7 @@ open Set MeasureTheory EulerSmoothLimit EulerLpTranslation variable {T : ℝ} {hT : 0 ≤ T} /-- Gradient norm path as an element of `C(Icc (0 : ℝ) T,ℝ)`. -/ +@[expose] def gradientNormPath (U : Evolution T hT) : C(Icc (0 : ℝ) T,ℝ) := ⟨fun t => ‖finiteField (U.velocity t).derivative‖, (continuous_finiteField (fun t => (U.velocity t).derivative) @@ -427,7 +428,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) : @@ -488,6 +489,7 @@ theorem h3_energy_gradient_bound (U : Evolution T hT) (K : ℝ) /-- Gradient H3 bound, given by `Real.sqrt (wordEnergy 3 (U.velocity ⟨0,le_rfl,hT⟩)*Real.exp (gradientEnergyConstant*G))`. -/ +@[expose] def gradientH3Bound (U : Evolution T hT) (G : ℝ) : ℝ := Real.sqrt (wordEnergy 3 (U.velocity ⟨0,le_rfl,hT⟩)*Real.exp (gradientEnergyConstant*G)) diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerHigherEnergy.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerHigherEnergy.lean index d903e1293d..b55a69dd54 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 @@ -30,6 +30,7 @@ open Set MeasureTheory InnerProductSpace ContinuousLinearMap EulerSmoothLimit open scoped ContDiff Topology /-- Word count, given by `∑ n ∈ range (m+1), (3 : ℝ)^n`. -/ +@[expose] def wordCount (m : ℕ) : ℝ := ∑ n ∈ range (m+1), (3 : ℝ)^n theorem wordCount_nonneg (m : ℕ) : 0 ≤ wordCount m := sum_nonneg (fun _ _ => by positivity) @@ -51,11 +52,12 @@ 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 t)`. -/ +@[expose] def integerEnergyDerivative (U : Evolution T hT) (m : ℕ) (t : Icc (0 : ℝ) T) : ℝ := integerEnergyProduction m (U.velocity t) (U.derivative t) 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..a3fd11738b 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 @@ -91,6 +91,7 @@ def l2EnergyPath (U V : Evolution T hT) : C(Icc (0 : ℝ) T,ℝ) := /-- L2 energy derivative, given by `2*⟪(U.difference V t).toLp,(U.differenceDerivative V t).toLp⟫_ℝ`. -/ +@[expose] def l2EnergyDerivative (U V : Evolution T hT) (t : Icc (0 : ℝ) T) : ℝ := 2*⟪(U.difference V t).toLp,(U.differenceDerivative V t).toLp⟫_ℝ diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerLifespan.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerLifespan.lean index 878b5f9072..5fa312ffc2 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 @@ -73,6 +73,7 @@ theorem exists_smooth_endpoint (T : ℝ) (hT : 0 < T) (A : SmoothL2Field Space) (congrArg (scaleField (endpointScale n)) (hinit n)) let M := gradientTensorBound (tensorNorm 3 A) G have hb (n : ℕ) (t : Icc (0 : ℝ) T) : tensorNorm 3 ((V n).velocity t) ≤ M := by + simp only [V, Evolution.rescale_velocity] apply (tensorNorm_scaleField_le (endpointScale n) (endpointScale_pos n).le (endpointScale_lt_one n).le _ 3).trans apply (U n).h3_tensorNorm_gradient_uniform (tensorNorm 3 A) G _ (hgrad n) @@ -124,7 +125,7 @@ end end -@[expose] public section +public section noncomputable section @@ -134,6 +135,7 @@ open Set EulerSmoothLimit EulerLpTranslation EulerLpTranslation.SmoothL2Field /-- Has euler evolution, given by `∃ hT : 0 < T, ∃ U : Evolution T hT.le, U.velocity ⟨0,le_rfl,hT.le⟩=A`. -/ +@[expose] def HasEulerEvolution (A : SmoothL2Field Space) (T : ℝ) : Prop := ∃ hT : 0 < T, ∃ U : Evolution T hT.le, U.velocity ⟨0,le_rfl,hT.le⟩=A 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..5895c27dae 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 @@ -117,7 +117,7 @@ def lift (q : ℕ) : L2 →L[ℝ] SobolevSpace 1 q := exact tendsto_nhds_unique hl hr) @[simp] theorem lift_apply (q : ℕ) (u : L2) : - S.lift q u=ordinarySobolev q (S.op u) (S.smooth u) := rfl + S.lift q u=ordinarySobolev q (S.op u) (S.smooth u) := by rfl /-- Jet map, given by `(ordinaryTensorOperator n).comp (S.lift n)`. -/ def jetMap (n : ℕ) : L2 →L[ℝ] Lp (Space [×n]→L[ℝ] Space) 2 (volume : Measure Space) := @@ -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 @@ -419,14 +419,14 @@ def advection : L2 →L[ℝ] L2 →L[ℝ] L2 := S.advectionLinear.mkContinuous₂ S.advectionCost S.advectionLinear_bound @[simp] theorem advection_apply (u v : L2) : - S.advection u v=(advectionField (S.field u) (S.field v)).toLp := rfl + S.advection u v=(advectionField (S.field u) (S.field v)).toLp := by rfl /-- Quadratic, given by `(ContinuousLinearMap.compL ℝ L2 L2 L2 (-S.op)).comp S.advection`. -/ def quadratic : L2 →L[ℝ] L2 →L[ℝ] L2 := (ContinuousLinearMap.compL ℝ L2 L2 L2 (-S.op)).comp S.advection @[simp] theorem quadratic_apply (u v : L2) : - S.quadratic u v= -S.op (advectionField (S.field u) (S.field v)).toLp := rfl + S.quadratic u v= -S.op (advectionField (S.field u) (S.field v)).toLp := by rfl theorem field_divergence (u : L2) (x : Space) : divergence (S.field u).field x=0 := solenoidal_representative_divergence _ (S.solenoidal u) _ (S.field u).smooth @@ -449,7 +449,7 @@ end end -@[expose] public section +public section noncomputable section @@ -543,11 +543,13 @@ theorem exists_smooth (A : SmoothL2Field Space) (hA : A.toLp ∈ solenoidalSpace exact (hu (s : ℝ)).hasDerivWithinAt) t have hi : integral T hT ((-S.op).compLeftContinuous ℝ (Icc (0 : ℝ) T) a) t = S.op (z t) := by + rw [EulerContinuousTimeIntegral.integral_apply] change (∫ r in (0 : ℝ)..(t : ℝ), (-S.op) (extendPath T hT a r))=S.op (z t) rw [(-S.op).intervalIntegral_comp_comm ((extendPath_continuous T hT a).intervalIntegrable 0 t)] - change -S.op (realIntegral T hT a t)=S.op (-realIntegral T hT a t) - rw [map_neg] + change (-S.op) (realIntegral T hT a t)=S.op (-integral T hT a t) + rw [EulerContinuousTimeIntegral.integral_apply,map_neg] + simp only [neg_apply] have he' := he.trans (congrArg₂ (fun x y : L2 => x + y) hu0 hi) simpa only [v,toLp_addField,field_toLp] using he'.symm have hvcont : ∀ n, Continuous (fun t => (v t).jetLp n) := @@ -588,7 +590,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 +622,7 @@ end end -@[expose] public section +public section noncomputable section @@ -707,7 +709,7 @@ def mollifier (n : ℕ) : L2 →L[ℝ] L2 := change ‖mollify n u‖ ≤ 1*‖u‖ simpa only [one_mul] using mollify_norm_le n u) -@[simp] theorem mollifier_apply (n : ℕ) (u : L2) : mollifier n u=mollify n u := rfl +@[simp] theorem mollifier_apply (n : ℕ) (u : L2) : mollifier n u=mollify n u := by rfl theorem mollify_translation (n : ℕ) (a : Space) (u : L2) : translation a (mollify n u)=mollify n (translation a u) := by @@ -796,7 +798,7 @@ end end -@[expose] public section +public section noncomputable section @@ -821,7 +823,7 @@ def regularizerMap (n : ℕ) : L2 →L[ℝ] L2 := solenoidalProjection.comp ((mollifier n).comp solenoidalProjection) @[simp] theorem regularizerMap_apply (n : ℕ) (u : L2) : - regularizerMap n u=solenoidalProjection (mollify n (solenoidalProjection u)) := rfl + regularizerMap n u=solenoidalProjection (mollify n (solenoidalProjection u)) := by rfl theorem regularizerMap_translation (n : ℕ) (a : Space) (u : L2) : EulerMeanSolenoidal.translation a (regularizerMap n u) = @@ -916,7 +918,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 +1015,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 +1100,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1207,7 +1209,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 +1264,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1439,7 +1441,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..a5e70c7b92 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 @@ -31,6 +31,7 @@ variable {A : SmoothL2Field Space} (L : FiniteLifespan A) abbrev Time : Type := Ico (0 : ℝ) L.duration /-- Initial time, given by `⟨0,le_rfl,L.duration_pos⟩`. -/ +@[expose] def initialTime : L.Time := ⟨0,le_rfl,L.duration_pos⟩ /-- Intermediate horizon, given by `((t : ℝ)+L.duration)/2`. -/ @@ -54,15 +55,18 @@ theorem intermediateHorizon_lt (t : L.Time) : L.intermediateHorizon t < L.durati linarith /-- Intermediate time, given by `⟨t,t.property.1,(L.time_lt_intermediateHorizon t).le⟩`. -/ +@[expose] def intermediateTime (t : L.Time) : Icc (0 : ℝ) (L.intermediateHorizon t) := ⟨t,t.property.1,(L.time_lt_intermediateHorizon t).le⟩ /-- Shorter time, given by `⟨t,t.property.1,t.property.2.trans_lt hSL⟩`. -/ +@[expose] def shorterTime (S : ℝ) (hSL : S < L.duration) (t : Icc (0 : ℝ) S) : L.Time := ⟨t,t.property.1,t.property.2.trans_lt hSL⟩ /-- Maximal field, given by `(L.evolution (L.intermediateHorizon t) (L.intermediateHorizon_pos t) (L.intermediateHorizon_lt t)).velocity (L.intermediateTime t)`. -/ +@[expose] def maximalField (t : L.Time) : SmoothL2Field Space := (L.evolution (L.intermediateHorizon t) (L.intermediateHorizon_pos t) (L.intermediateHorizon_lt t)).velocity (L.intermediateTime t) @@ -157,6 +161,7 @@ theorem maximalPressureField_gradient (t : L.Time) : (L.intermediateHorizon_lt t)).gradient (L.intermediateTime t) /-- Maximal velocity, given by `(L.maximalField t).field`. -/ +@[expose] def maximalVelocity (t : L.Time) : Space → Space := (L.maximalField t).field /-- Maximal pressure, given by `EulerCanonicalGraphPotential.radialPotential diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerRescaling.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerRescaling.lean index e25e5bdd35..eb63a4dfc2 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 @@ -31,7 +31,7 @@ def scaleTimeMap (S T c : ℝ) (hc : 0 ≤ c) (hct : c * T ≤ S) : continuous_toFun := (continuous_subtype_val.const_mul c).subtype_mk _ @[simp] theorem scaleTimeMap_val (S T c : ℝ) (hc : 0 ≤ c) (hct : c * T ≤ S) - (t : Icc (0 : ℝ) T) : ((scaleTimeMap S T c hc hct t) : ℝ)=c*t := rfl + (t : Icc (0 : ℝ) T) : ((scaleTimeMap S T c hc hct t) : ℝ)=c*t := by rfl namespace Evolution @@ -89,7 +89,7 @@ def rescale (U : Evolution S hS) (T : ℝ) (hT : 0 ≤ T) @[simp] theorem rescale_velocity (U : Evolution S hS) (T : ℝ) (hT : 0 ≤ T) (c : ℝ) (hc : 0 < c) (hct : c * T ≤ S) (t : Icc (0 : ℝ) T) : (U.rescale T hT c hc hct).velocity t = - scaleField c (U.velocity (scaleTimeMap S T c hc.le hct t)) := rfl + scaleField c (U.velocity (scaleTimeMap S T c hc.le hct t)) := by rfl theorem rescale_initial (U : Evolution S hS) (T : ℝ) (hT : 0 ≤ T) (c : ℝ) (hc : 0 < c) (hct : c * T ≤ S) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerRestriction.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerRestriction.lean index 05811dfea4..7de0e1cb24 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 @@ -28,6 +28,7 @@ variable {T : ℝ} {hT : 0 ≤ T} (U : Evolution T hT) /-- Restrict time, bundling `velocity`, `pressureForce`, `velocity_continuous`, `pressure_continuous` and the required compatibility proofs. -/ +@[expose] def restrictTime : Evolution S hS where velocity t := U.velocity (initialInclusion T S hST t) pressureForce t := U.pressureForce (initialInclusion T S hST t) @@ -45,10 +46,10 @@ def restrictTime : Evolution S hS where rfl theorem restrictTime_velocity (t : Icc (0 : ℝ) S) : - (U.restrictTime S hS hST).velocity t=U.velocity (initialInclusion T S hST t) := rfl + (U.restrictTime S hS hST).velocity t=U.velocity (initialInclusion T S hST t) := by rfl theorem restrictTime_initial : - (U.restrictTime S hS hST).velocity ⟨0,le_rfl,hS⟩=U.velocity ⟨0,le_rfl,hT⟩ := rfl + (U.restrictTime S hS hST).velocity ⟨0,le_rfl,hS⟩=U.velocity ⟨0,le_rfl,hT⟩ := by rfl theorem restrictTime_referenceWordBound (t : Icc (0 : ℝ) S) : WordBound 4 U.referenceSize ((U.restrictTime S hS hST).velocity t) := 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..ae539de3c3 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 _ @@ -61,6 +61,7 @@ variable {T : ℝ} {hT : 0 ≤ T} (U : Evolution T hT) /-- Vorticity norm path, given by `⟨fun t => vorticityNorm (U.velocity t),vorticityNorm_continuous U.velocity U.velocity_continuous⟩`. -/ +@[expose] def vorticityNormPath : C(Icc (0 : ℝ) T,ℝ) := ⟨fun t => vorticityNorm (U.velocity t),vorticityNorm_continuous U.velocity U.velocity_continuous⟩ @@ -76,6 +77,7 @@ theorem pointwise_vorticity_le (t : Icc (0 : ℝ) T) (x : Space) : (U.vorticityNormPath_le_iff t _).mp le_rfl x /-- Vorticity integral, given by `realIntegral T hT U.vorticityNormPath t`. -/ +@[expose] def vorticityIntegral (t : Icc (0 : ℝ) T) : ℝ := realIntegral T hT U.vorticityNormPath t theorem vorticityIntegral_nonneg (t : Icc (0 : ℝ) T) : 0 ≤ U.vorticityIntegral t := diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryFieldAlgebra.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryFieldAlgebra.lean index 6ce606fba9..f30ca544a5 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 @@ -31,7 +31,7 @@ variable {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] /-- Sum field, bundling `field`, `smooth`, `integrable`, `have` and the required compatibility proofs. -/ -def sumField {ι : Type*} (I : Finset ι) (A : ι → SmoothL2Field V) : SmoothL2Field V where +@[expose] def sumField {ι : Type*} (I : Finset ι) (A : ι → SmoothL2Field V) : SmoothL2Field V where field x := ∑ i ∈ I, (A i).field x smooth := ContDiff.sum (fun i _ => (A i).smooth) integrable n := by @@ -41,7 +41,8 @@ def sumField {ι : Type*} (I : Finset ι) (A : ι → SmoothL2Field V) : SmoothL (iteratedFDeriv_fun_sum_apply (fun i _ => (A i).smooth.contDiffAt.of_le (by simp))).symm)) @[simp] theorem sumField_field {ι : Type*} (I : Finset ι) (A : ι → SmoothL2Field V) (x : Space) : - (sumField I A).field x = ∑ i ∈ I, (A i).field x := rfl + (sumField I A).field x = ∑ i ∈ I, (A i).field x := by + rfl theorem toLp_sumField {ι : Type*} (I : Finset ι) (A : ι → SmoothL2Field V) : (sumField I A).toLp = ∑ i ∈ I, (A i).toLp := by @@ -65,13 +66,15 @@ theorem wordField_sum {ι : Type*} (I : Finset ι) (A : ι → SmoothL2Field V) simp only [_root_.sum_apply] /-- Field neg, given by `mapField (-(ContinuousLinearMap.id ℝ V)) A`. -/ +@[expose] def fieldNeg (A : SmoothL2Field V) : SmoothL2Field V := mapField (-(ContinuousLinearMap.id ℝ V)) A @[simp] theorem fieldNeg_field (A : SmoothL2Field V) (x : Space) : - (fieldNeg A).field x = -A.field x := rfl + (fieldNeg A).field x = -A.field x := by + 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 +132,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 @@ -141,6 +145,7 @@ def coordinateProduct (i : Fin 3) (A : SmoothL2Field Space) (B : SmoothL2Field V /-- Advection field, given by `sumField univ (fun i : Fin 3 => coordinateProduct i A (B.directionalField (axis i)))`. -/ +@[expose] def advectionField (A : SmoothL2Field Space) (B : SmoothL2Field V) : SmoothL2Field V := sumField univ (fun i : Fin 3 => coordinateProduct i A (B.directionalField (axis i))) diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryFieldScaling.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryFieldScaling.lean index f24319b6fd..3151e0d39a 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 @@ -31,7 +31,8 @@ def scaleField (c : ℝ) (A : SmoothL2Field V) : SmoothL2Field V := mapField (c • ContinuousLinearMap.id ℝ V) A @[simp] theorem scaleField_field (c : ℝ) (A : SmoothL2Field V) (x : Space) : - (scaleField c A).field x=c • A.field x := rfl + (scaleField c A).field x=c • A.field x := by + rfl theorem scaleField_toLp (c : ℝ) (A : SmoothL2Field V) : (scaleField c A).toLp=c • A.toLp := by 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..f8bdb7db3c 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 @@ -34,6 +34,7 @@ theorem advection_directional (A B : SmoothL2Field Space) (v : Space) : /-- Transport commutator, given by `fieldSub (wordField (advectionField A B) w) (advectionField A (wordField B w))`. -/ +@[expose] def transportCommutator (A B : SmoothL2Field Space) {n : ℕ} (w : Fin n → Fin 3) : SmoothL2Field Space := fieldSub (wordField (advectionField A B) w) (advectionField A (wordField B w)) diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryH3Energy.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryH3Energy.lean index 3bac57fcd8..68d23a94f2 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 @@ -119,6 +119,7 @@ theorem differenceRhs_word_bound (U W P : SmoothL2Field Space) (M X : ℝ) /-- Energy production, given by `2*(∑ n ∈ range 4, ∑ w : Fin n → Fin 3, ⟪(wordField W w).toLp,(wordField Q w).toLp⟫_ℝ)`. -/ +@[expose] def energyProduction (W Q : SmoothL2Field Space) : ℝ := 2*(∑ n ∈ range 4, ∑ w : Fin n → Fin 3, ⟪(wordField W w).toLp,(wordField Q w).toLp⟫_ℝ) 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..afa6fe5628 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 @@ -59,7 +59,7 @@ theorem vorticityIntegral_agrees_at (S T : ℝ) (hS : 0 < S) (hT : 0 < T) · exact (L.vorticityIntegral_agrees T S hT hS hTL hSL hTS ⟨t,ht0,htT⟩).symm /-- Maximal vorticity norm, given by `vorticityNorm (L.maximalField t)`. -/ -def maximalVorticityNorm (t : L.Time) : ℝ := vorticityNorm (L.maximalField t) +@[expose] def maximalVorticityNorm (t : L.Time) : ℝ := vorticityNorm (L.maximalField t) theorem maximalVorticityNorm_nonneg (t : L.Time) : 0 ≤ L.maximalVorticityNorm t := vorticityNorm_nonneg _ @@ -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..1cbbfe20aa 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 @@ -32,6 +32,7 @@ local instance instOrdinarySmoothLimit1 : Fact (0 < (1 : ℝ)) := ⟨by norm_num variable {T : ℝ} /-- Jet path, given by `⟨fun t => (A t).jetLp n,hA n⟩`. -/ +@[expose] def jetPath (A : Icc (0 : ℝ) T → SmoothL2Field Space) (hA : ∀ n, Continuous (fun t => (A t).jetLp n)) (n : ℕ) : C(Icc (0 : ℝ) T,Lp (Space [×n]→L[ℝ] Space) 2 (volume : Measure Space)) := diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinarySmoothWords.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinarySmoothWords.lean index 7a799d8a2a..d4483f6f5e 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] @@ -43,12 +43,12 @@ theorem field_ext {A B : SmoothL2Field V} (h : A.field = B.field) : A = B := by /-- Word field as an element of `{n : ℕ} → (Fin n → Fin 3) → SmoothL2Field V | 0, _ => A | _+1, w => (wordField A (Fin.tail w)).directionalField (axis (w 0))`. -/ -def wordField (A : SmoothL2Field V) : {n : ℕ} → (Fin n → Fin 3) → SmoothL2Field V +@[expose] def wordField (A : SmoothL2Field V) : {n : ℕ} → (Fin n → Fin 3) → SmoothL2Field V | 0, _ => A | _+1, w => (wordField A (Fin.tail w)).directionalField (axis (w 0)) @[simp] theorem wordField_zero (A : SmoothL2Field V) (w : Fin 0 → Fin 3) : - wordField A w = A := rfl + wordField A w = A := by rfl @[simp] theorem wordField_cons (A : SmoothL2Field V) {n : ℕ} (w : Fin n → Fin 3) (i : Fin 3) : @@ -109,11 +109,11 @@ 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`. -/ -def WordBound (s : ℕ) (M : ℝ) (A : SmoothL2Field V) : Prop := +@[expose] def WordBound (s : ℕ) (M : ℝ) (A : SmoothL2Field V) : Prop := ∀ n ≤ s, ∀ w : Fin n → Fin 3, ‖(wordField A w).toLp‖ ≤ M theorem wordEnergy_nonneg (s : ℕ) (A : SmoothL2Field V) : 0 ≤ wordEnergy s A := 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..2dee948291 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 @@ -77,6 +77,7 @@ theorem tame_transportCommutator (A : SmoothL2Field Space) (m : ℕ) (hm : 3 ≤ (by simpa only [Nat.add_zero] using hn) w Fin.elim0 /-- Euler rhs, given by `fieldNeg (addField (advectionField A A) P)`. -/ +@[expose] def eulerRhs (A P : SmoothL2Field Space) : SmoothL2Field Space := fieldNeg (addField (advectionField A A) P) @@ -111,7 +112,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..103d6171ad 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 @@ -31,7 +31,7 @@ def componentField (A : SmoothL2Field Space) (j : Fin 3) : SmoothL2Field ℝ := mapField (EuclideanSpace.proj j) A @[simp] theorem componentField_apply (A : SmoothL2Field Space) (j : Fin 3) (x : Space) : - (componentField A j).field x=A.field x j := rfl + (componentField A j).field x=A.field x j := by rfl theorem componentField_toLp_norm (A : SmoothL2Field Space) (j : Fin 3) : ‖(componentField A j).toLp‖ ≤ ‖A.toLp‖ := 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..bc5defa963 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 @@ -29,6 +29,7 @@ open scoped ContDiff /-- Word maximum, given by `(univ : Finset (Fin n → Fin 3)).sup' univ_nonempty (fun w => ‖(wordField A w).toLp‖)`. -/ +@[expose] def wordMaximum (n : ℕ) (A : SmoothL2Field Space) : ℝ := (univ : Finset (Fin n → Fin 3)).sup' univ_nonempty (fun w => ‖(wordField A w).toLp‖) 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..9f2767e0a3 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 @@ -43,6 +43,7 @@ variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] /-- Activated data, given by `D.activation ⟨τ,hτ.le,hτT.le⟩ (cross (unit (m τ)) (unit (v τ))) (activation_cross_ne_zero _ _ hm hv hmv)`. -/ +@[expose] def activatedData (m v : ℝ → Space) (hm : m τ ≠ 0) (hv : v τ ≠ 0) (hmv : ⟪m τ, v τ⟫_ℝ = 0) : Data (referencePlane (activationDirection (D.deformationEquiv ⟨τ,hτ.le,hτT.le⟩ 0) diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketActivationInitial.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketActivationInitial.lean index 47c8e53814..32ebff5ac9 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 @@ -533,7 +533,9 @@ theorem exists_activated_primary ⟪B.coefficients.labelVelocity 0 ξ ⟨τ,hτ.le,le_rfl⟩,unit (m τ)⟫_ℝ := by convert! hplo using 1 ring - have hvinit := activation_scaled_velocity (a := a) hε hplo' hphi hpw hqw + have hvinit := activation_scaled_velocity + (m := m) (v := v) (w := fun s => uncutVelocity τ hτ hτT B ξ s 0) + (t₀ := τ) (a := a) hε hplo' hphi hpw hqw refine ⟨hvinit.1,hvinit.2.1,?_,hvinit.2.2.1,hvinit.2.2.2⟩ apply hξnorm.trans apply div_le_div_of_nonneg_right _ hh.le diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketActivationLipschitz.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketActivationLipschitz.lean index 9e4d63d37c..21918e04d7 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 @@ -114,17 +114,20 @@ local instance instPacketActivationLipschitz18 : NormedSpace ℝ C(Icc (0 : ℝ) inferInstance /-- History transport cost as an element of `ℝ`. -/ +@[expose] def historyTransportCost : ℝ := 1+((2*(D.frameLower⁻¹)^2*‖D.frame.field‖^2*‖D.frameDerivative.field‖+ D.frameLower⁻¹*‖D.frameDerivative.field‖)*D.T+D.frameLower⁻¹*‖D.frame.field‖) /-- History label size cost, constructed using `historyCost`. -/ +@[expose] def historyLabelSizeCost : ℝ := historyCost D.T D.frameLower ‖D.frame.field‖ ‖D.frameDerivative.field‖ (D.T*‖D.frameDerivative.field‖+‖D.frame.field‖) (1+D.T^2*‖B.H.field‖) (historyTransportCost (D := D)) /-- History label difference cost, constructed using `historyDifferenceCost`. -/ +@[expose] def historyLabelDifferenceCost : ℝ := historyDifferenceCost D.T D.frameLower ‖D.frame.field‖ ‖D.frameDerivative.field‖ (D.T*‖D.frameDerivative.field‖+‖D.frame.field‖) (1+D.T^2*‖B.H.field‖) 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..40be3260fa 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 @@ -27,7 +27,7 @@ variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] /-- Reframe, bundling `T`, `T_pos`, `support`, `support_compact` and the required compatibility proofs. -/ -def Data.reframe (D : Data U) (m : Space) (hm : ‖m‖ = 1) : Data (referencePlane m) where +@[expose] def Data.reframe (D : Data U) (m : Space) (hm : ‖m‖ = 1) : Data (referencePlane m) where T := D.T T_pos := D.T_pos support := D.support @@ -46,6 +46,7 @@ def Data.reframe (D : Data U) (m : Space) (hm : ‖m‖ = 1) : Data (referencePl /-- Reframe, bundling `H`, `jacobi`, `potential`, `potential_nonneg` and the required compatibility proofs. -/ +@[expose] def HistoryData.reframe {D : Data U} (B : HistoryData D) (m : Space) (hm : ‖m‖ = 1) : HistoryData (D.reframe m hm) where H := B.H @@ -57,7 +58,7 @@ def HistoryData.reframe {D : Data U} (B : HistoryData D) (m : Space) (hm : ‖m /-- Activation, given by `D.reframe (activationDirection (D.deformationEquiv t₀ 0) n) (activationDirection_unit _ hn)`. -/ -def Data.activation (D : Data U) (t₀ : Icc (0 : ℝ) D.T) (n : Space) (hn : n ≠ 0) : +@[expose] def Data.activation (D : Data U) (t₀ : Icc (0 : ℝ) D.T) (n : Space) (hn : n ≠ 0) : Data (referencePlane (activationDirection (D.deformationEquiv t₀ 0) n)) := D.reframe (activationDirection (D.deformationEquiv t₀ 0) n) (activationDirection_unit _ hn) 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..5820299e01 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 @@ -23,7 +23,7 @@ namespace EulerPacketCylinderField open Set EulerPacketProfileRecursion EulerPacketTimeProfile /-- Time profile change, given by `h ▸ g`. -/ -def timeProfileChange {T T' : ℝ} (g : C(Icc (0 : ℝ) T, ℝ)) (h : T = T') : +@[expose] def timeProfileChange {T T' : ℝ} (g : C(Icc (0 : ℝ) T, ℝ)) (h : T = T') : C(Icc (0 : ℝ) T',ℝ) := h ▸ g theorem timeProfileChange_pos {T T' : ℝ} (g : C(Icc (0 : ℝ) T, ℝ)) (hg : ∀ t, 0 < g t) @@ -73,6 +73,7 @@ namespace EulerPacketTimeProfile.Scales open Set EulerPacketCylinderField /-- Change time, given by `h ▸ S`. -/ +@[expose] def changeTime {T T' : ℝ} (S : Scales (Icc (0 : ℝ) T)) (h : T = T') : Scales (Icc (0 : ℝ) T') := h ▸ S diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketChildFieldMatch.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketChildFieldMatch.lean index 25a586849d..bd4058afec 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)`. -/ @@ -91,6 +91,7 @@ variable (A : Parent) /-- Normalized packet velocity, constructed using `κ`. -/ +@[expose] def normalizedPacketVelocity (t : Icc (0 : ℝ) A.T) (x : Space) : Space := κ • A.frame.field t (I.normalized t x) ((exactPacketOfResidual P B residual).velocity.pointField t @@ -98,6 +99,7 @@ def normalizedPacketVelocity (t : Icc (0 : ℝ) A.T) (x : Space) : Space := /-- Normalized packet pressure, given by `(exactPacketOfResidual P B residual).graphPotential k t ∘ I.normalized t`. -/ +@[expose] def normalizedPacketPressure (t : Icc (0 : ℝ) A.T) : Space → ℝ := (exactPacketOfResidual P B residual).graphPotential k t ∘ I.normalized t @@ -219,7 +221,8 @@ theorem normalizedPacketVelocity_initialized (t : Icc (0 : ℝ) A.T) : (A.sourceAgreement m hm J support hSupport H) N hN k hk) k I t = initializedExactPhysicalVelocity (A.meanData H) (A.transverseData m hm J support hSupport) rfl τ hτ hτT (A.historyOn H m hm J support hSupport τ hτ hτT) δ hδ ξ hs α - (A.sourceAgreement m hm J support hSupport H) N hN k hk Q t (I.normalized t) := rfl + (A.sourceAgreement m hm J support hSupport H) N hN k hk Q t (I.normalized t) := by + rfl theorem normalizedPacketPressure_initialized (t : Icc (0 : ℝ) A.T) : A.normalizedPacketPressure m hm J support hSupport Q @@ -229,6 +232,7 @@ theorem normalizedPacketPressure_initialized (t : Icc (0 : ℝ) A.T) : (A.sourceAgreement m hm J support hSupport H) N hN k hk) k I t = initializedExactPhysicalPressure (A.meanData H) (A.transverseData m hm J support hSupport) rfl τ hτ hτT (A.historyOn H m hm J support hSupport τ hτ hτT) δ hδ ξ hs α - (A.sourceAgreement m hm J support hSupport H) N hN k hk Q t (I.normalized t) := rfl + (A.sourceAgreement m hm J support hSupport H) N hN k hk Q t (I.normalized t) := by + rfl end EulerParentPacketFrames.Parent diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketChildLowBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketChildLowBounds.lean index ed885bb520..344c1109c8 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 @@ -115,7 +115,7 @@ variable {τ : ℝ} {hτ : 0 < τ} {hτT : τ < A.T} /-- The exact source (20) errors, expressed on the same normalized packet that defines the physical child. These are precisely the two errors supplied by the same-Q packet choice. -/ -def SourceErrors (ev ep : ℝ) : Prop := +@[expose] def SourceErrors (ev ep : ℝ) : Prop := ∀ (t : Icc (0 : ℝ) A.T) (x : Space), ‖fderiv ℝ (A.normalizedPacketVelocity m hm J support hSupport B residual k E.inverse t) x - shearTerm (G.primaryAmplitude hball) (deriv (profile G.δ) (k*⟪m,E.inverse.normalized t x⟫_ℝ)) 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..6435215283 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 @@ -150,7 +150,7 @@ variable (P : ℝ) [Fact (0 < P)] (hA : ContDiff ℝ ∞ (translateCoefficientPath A)) /-- Sobolev operator, given by `coefficientSobolevOperator P (coefficientJet P A hA q t)`. -/ -def sobolevOperator (q : ℕ) (t : K) : SobolevSpace P q →L[ℝ] SobolevSpace P q := +@[expose] def sobolevOperator (q : ℕ) (t : K) : SobolevSpace P q →L[ℝ] SobolevSpace P q := coefficientSobolevOperator P (coefficientJet P A hA q t) @[simp] theorem sobolevOperator_value (q : ℕ) (t : K) (u : SobolevSpace P q) : @@ -230,7 +230,7 @@ end end -@[expose] public section +public section noncomputable section @@ -243,7 +243,7 @@ open Set EulerSmoothLimit EulerLiftedGradientSpace EulerCylinderSobolevSpace variable (P : ℝ) [Fact (0 < P)] {T : ℝ} {raw : Domain → Space →L[ℝ] Space} /-- To coefficient tower, bundling `coefficient`, `jet`, `continuous`. -/ -def toCoefficientTower (A : MatrixCoefficient T raw) : +@[expose] def toCoefficientTower (A : MatrixCoefficient T raw) : EulerAllOrderCorrectionData.CoefficientTower P T where coefficient := smoothCoefficient P A.path A.orbit jet q t := coefficientJet P A.path A.orbit q t @@ -251,7 +251,7 @@ def toCoefficientTower (A : MatrixCoefficient T raw) : @[simp] theorem toCoefficientTower_coefficient (A : MatrixCoefficient T raw) (t : Icc (0 : ℝ) T) (x : LiftDomain P) : - ((A.toCoefficientTower P).coefficient t).coefficient x = A.path t x.1 := rfl + ((A.toCoefficientTower P).coefficient t).coefficient x = A.path t x.1 := by rfl theorem toCoefficientTower_raw (A : MatrixCoefficient T raw) (t : Icc (0 : ℝ) T) (x : Space) (θ : ℝ) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCofactorOperator.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCofactorOperator.lean index fad0e364e4..0403efa08c 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 @@ -142,7 +142,7 @@ theorem cofactorBilinear_norm : ‖cofactorBilinear‖ ≤ 3 := cofactorLinear.mkContinuous₂_norm_le (by norm_num) cofactorValue_norm /-- Adjugate, given by `cofactorBilinear A A`. -/ -def adjugate (A : EndSpace) : EndSpace := cofactorBilinear A A +@[expose] def adjugate (A : EndSpace) : EndSpace := cofactorBilinear A A theorem adjugate_norm (A : EndSpace) : ‖adjugate A‖ ≤ 3*‖A‖^2 := by change ‖cofactorValue A A‖ ≤ 3*‖A‖^2 diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCommonRadius.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCommonRadius.lean index d252d195fd..12192741bf 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 @@ -25,6 +25,7 @@ variable {D : Data} {q : ℕ} {R : ℝ} (M : Budget D q R) /-- Only the three upper-radius guards change. Every coefficient, inverse constant, and actual source solver is preserved. -/ +@[expose] def enlargeRadius (R' : ℝ) (h : R ≤ R') : Budget D q R' where toSobolevData := { M.toSobolevData with radius_budget := M.radius_budget.trans h @@ -34,13 +35,13 @@ def enlargeRadius (R' : ℝ) (h : R ≤ R') : Budget D q R' where forcing_time := M.forcing_time @[simp] theorem enlargeRadius_velocityCost (R' : ℝ) (h : R ≤ R') : - (M.enlargeRadius R' h).velocityCost = M.velocityCost := rfl + (M.enlargeRadius R' h).velocityCost = M.velocityCost := by rfl @[simp] theorem enlargeRadius_derivativeCost (R' : ℝ) (h : R ≤ R') : - (M.enlargeRadius R' h).derivativeCost = M.derivativeCost := rfl + (M.enlargeRadius R' h).derivativeCost = M.derivativeCost := by rfl @[simp] theorem enlargeRadius_pressureGradientCost (R' : ℝ) (h : R ≤ R') : - (M.enlargeRadius R' h).pressureGradientCost = M.pressureGradientCost := rfl + (M.enlargeRadius R' h).pressureGradientCost = M.pressureGradientCost := by rfl end EulerMeanPacketProvider.Budget @@ -54,6 +55,7 @@ variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteS /-- The homogeneous propagator, time profile and all source constants are unchanged. The five external-radius inequalities are monotone. -/ +@[expose] def Budget.enlargeRadius (L : Budget D τ hτ hτT B ι q) (R' : ℝ) (h : L.R ≤ R') : Budget D τ hτ hτT B ι q := { L with @@ -65,16 +67,17 @@ def Budget.enlargeRadius (L : Budget D τ hτ hτT B ι q) (R' : ℝ) (h : L.R forward_radius := L.forward_radius.trans h } @[simp] theorem Budget.enlargeRadius_R (L : Budget D τ hτ hτT B ι q) - (R' : ℝ) (h : L.R ≤ R') : (L.enlargeRadius R' h).R = R' := rfl + (R' : ℝ) (h : L.R ≤ R') : (L.enlargeRadius R' h).R = R' := by rfl @[simp] theorem Budget.enlargeRadius_fullProfile (L : Budget D τ hτ hτT B ι q) - (R' : ℝ) (h : L.R ≤ R') : (L.enlargeRadius R' h).fullProfile = L.fullProfile := rfl + (R' : ℝ) (h : L.R ≤ R') : (L.enlargeRadius R' h).fullProfile = L.fullProfile := by rfl @[simp] theorem Budget.enlargeRadius_commonCost (L : Budget D τ hτ hτT B ι q) - (R' : ℝ) (h : L.R ≤ R') : (L.enlargeRadius R' h).commonCost = L.commonCost := rfl + (R' : ℝ) (h : L.R ≤ R') : (L.enlargeRadius R' h).commonCost = L.commonCost := by rfl /-- The normal inverse radius and the actual inverse-frame/strain jets stay fixed; only the target radius of their multiplier bound is enlarged. -/ +@[expose] def NormalBudget.enlargeRadius {R : ℝ} (N : NormalBudget D q R) (R' : ℝ) (h : R ≤ R') : NormalBudget D q R' := { N with radius := N.radius.trans h } @@ -83,15 +86,15 @@ variable {P : ℝ} @[simp] theorem Budget.enlargeRadius_pressureAmplitude (R' : ℝ) (h : L.R ≤ R') : (L.enlargeRadius R' h).pressureAmplitude (P := P) (N.enlargeRadius R' h) = - L.pressureAmplitude (P := P) N := rfl + L.pressureAmplitude (P := P) N := by rfl @[simp] theorem Budget.enlargeRadius_correctorAmplitude (R' : ℝ) (h : L.R ≤ R') : (L.enlargeRadius R' h).correctorAmplitude (P := P) (N.enlargeRadius R' h) = - L.correctorAmplitude (P := P) N := rfl + L.correctorAmplitude (P := P) N := by rfl @[simp] theorem Budget.enlargeRadius_correctorTimeAmplitude (R' : ℝ) (h : L.R ≤ R') : (L.enlargeRadius R' h).correctorTimeAmplitude (P := P) (N.enlargeRadius R' h) = - L.correctorTimeAmplitude (P := P) N := rfl + L.correctorTimeAmplitude (P := P) N := by rfl end EulerTransversePacketJoin @@ -147,7 +150,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..8a155aeb62 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 @@ -43,21 +43,21 @@ variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] (D : Data U) /-- Coordinate, defined pointwise by `k • rawInverse D z (W z)`. -/ -def coordinate (k : ℝ) (W : VectorField) : VectorField := +@[expose] def coordinate (k : ℝ) (W : VectorField) : VectorField := fun z => k • rawInverse D z (W z) /-- Inverse time, given by `D.inverseDerivative (D.clamp z.1) z.2.1`. -/ -def inverseTime (z : Domain) : Space →L[ℝ] Space := +@[expose] def inverseTime (z : Domain) : Space →L[ℝ] Space := D.inverseDerivative (D.clamp z.1) z.2.1 /-- Inverse time coefficient, bundling `path`, `orbit`, `raw_eq`. -/ -def inverseTimeCoefficient : MatrixCoefficient D.T (inverseTime D) where +@[expose] def inverseTimeCoefficient : MatrixCoefficient D.T (inverseTime D) where path := D.inverseDerivative orbit := D.inverseDerivative_orbit raw_eq t x θ := by simp only [inverseTime,Data.clamp_coe] /-- Coordinate time, defined pointwise by `k • (inverseTime D z (W z) + rawInverse D z (Wt z))`. -/ -def coordinateTime (k : ℝ) (W Wt : VectorField) : VectorField := +@[expose] def coordinateTime (k : ℝ) (W Wt : VectorField) : VectorField := fun z => k • (inverseTime D z (W z) + rawInverse D z (Wt z)) theorem coordinateTime_formula (k : ℝ) (W Wt : VectorField) (z : Domain) : @@ -106,12 +106,12 @@ variable {P : ℝ} [Fact (0 < P)] {W Wt : VectorField} (G : Field P D.T W) (Gt : Field P D.T Wt) /-- Coordinate field, given by `((inverseCoefficient D).multiply G).smul k`. -/ -def coordinateField (k : ℝ) : Field P D.T (coordinate D k W) := +@[expose] def coordinateField (k : ℝ) : Field P D.T (coordinate D k W) := ((inverseCoefficient D).multiply G).smul k /-- Coordinate time field, given by `(((inverseTimeCoefficient D).multiply G).add ((inverseCoefficient D).multiply Gt)).smul k`. -/ -def coordinateTimeField (k : ℝ) : Field P D.T (coordinateTime D k W Wt) := +@[expose] def coordinateTimeField (k : ℝ) : Field P D.T (coordinateTime D k W Wt) := (((inverseTimeCoefficient D).multiply G).add ((inverseCoefficient D).multiply Gt)).smul k theorem coordinateField_time (k : ℝ) (hW : TimeDerivative D.T_pos.le G Gt) : @@ -165,7 +165,7 @@ end end -@[expose] public section +public section noncomputable section @@ -186,16 +186,16 @@ variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] (D : Data U) /-- Transport, given by `fderiv ℝ (fun y => Z (z.1,y)) z.2 (κ • Z z,⟪D.m₀,Z z⟫_ℝ)`. -/ -def transport (κ : ℝ) (Z : VectorField) (z : Domain) : Space := +@[expose] 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..312e864f70 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 @@ -170,6 +170,7 @@ open scoped ContDiff BoundedContinuousFunction /-- Normalized coefficient radius, given by `max 1 (sobolevCoefficientAmplitude (Fin 4) q Rc C) * sobolevCoefficientRadius (Fin 4) Rc`. -/ +@[expose] def normalizedCoefficientRadius (q : ℕ) (Rc C : ℝ) : ℝ := max 1 (sobolevCoefficientAmplitude (Fin 4) q Rc C) * sobolevCoefficientRadius (Fin 4) Rc @@ -252,7 +253,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 +317,7 @@ section /-! Quantitative bounds for the actual packet coefficient towers. -/ -@[expose] public section +public section noncomputable section @@ -370,7 +371,7 @@ end end -@[expose] public section +public section noncomputable section @@ -419,28 +420,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)) @@ -469,6 +470,7 @@ include hR hC0 hC1 hCI hF hF1 hFI /-- All coefficient hypotheses of the correction energy estimate, derived from genuine source spatial jets. The radius condition is the same one used by the projected inverse, rather than a separate cutoff-dependent restriction. -/ +@[expose] def correctionCoefficientBudget : CorrectionCoefficientBudget D P where Rc := correctionCoefficientRadius R CI M := correctionPressureEnvelope D.normalLower R CI 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..27bfdfe5e5 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 @@ -20,14 +20,16 @@ namespace EulerPacketCorrectionConstants open EulerPacketCylinderField /-- Velocity, given by `C*(fixedVelocityGradeCost R H 1+fixedVelocityGradeCost R H 2+1)`. -/ +@[expose] def velocity (R H C : ℝ) : ℝ := C*(fixedVelocityGradeCost R H 1+fixedVelocityGradeCost R H 2+1) /-- Normal, given by `C*(fixedVelocityGradeCost R H 2+2)`. -/ +@[expose] 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..e3c027107c 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 @@ -44,7 +44,8 @@ theorem growthCoefficient_eq (B0 B1 κ : ℝ) (hκ : |κ| ≤ 1) energyConstant P ((sourceMetricBudget D P κ hκ Z G q).growth0 P B0) ((sourceMetricBudget D P κ hκ Z G q).growth1 P) ((sourceMetricBudget D P κ hκ Z G q).multiplier P) - Kc.B Kc.M B0 B1 Kc.A0 Kc.A2 (sourceMetricBudget D P κ hκ Z G q).c := rfl + Kc.B Kc.M B0 B1 Kc.A0 Kc.A2 (sourceMetricBudget D P κ hκ Z G q).c := by + rfl theorem growthCoefficient_pos (B0 B1 : ℝ) (hB0 : 0 ≤ B0) (hB1 : 0 ≤ B1) : 0 < growthCoefficient D P Kc B0 B1 := by diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionMetricBudget.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionMetricBudget.lean index fae5146f09..c6a0afad4f 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 @@ -52,20 +52,21 @@ variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] /-- Raw inverse metric time, given by `(rawFrameTime D z).adjoint.comp (rawFrame D z) + (rawFrame D z).adjoint.comp (rawFrameTime D z)`. -/ -def rawInverseMetricTime (z : Domain) : Space →L[ℝ] Space := +@[expose] def rawInverseMetricTime (z : Domain) : Space →L[ℝ] Space := (rawFrameTime D z).adjoint.comp (rawFrame D z) + (rawFrame D z).adjoint.comp (rawFrameTime D z) /-- Inverse metric time coefficient, given by `((frameTimeCoefficient D).adjoint.comp (frameCoefficient D)).add ((frameCoefficient D).adjoint.comp (frameTimeCoefficient D))`. -/ -def inverseMetricTimeCoefficient : MatrixCoefficient D.T (rawInverseMetricTime D) := +@[expose] def inverseMetricTimeCoefficient : MatrixCoefficient D.T (rawInverseMetricTime D) := ((frameTimeCoefficient D).adjoint.comp (frameCoefficient D)).add ((frameCoefficient D).adjoint.comp (frameTimeCoefficient D)) @[simp] theorem inverseMetricTimeCoefficient_apply (t : Icc (0 : ℝ) D.T) (x : Space) : (inverseMetricTimeCoefficient D).path t x = (D.F₁.field t x).adjoint.comp (D.F.field t x) + - (D.F.field t x).adjoint.comp (D.F₁.field t x) := rfl + (D.F.field t x).adjoint.comp (D.F₁.field t x) := by + rfl theorem inverseMetric_field_hasDerivWithinAt (t : ℝ) (ht : t ∈ Icc (0 : ℝ) D.T) (x : Space) : @@ -119,7 +120,7 @@ end end -@[expose] public section +public section noncomputable section @@ -169,15 +170,15 @@ theorem inverseMetric_operator_hasDerivAt (t : ℝ) (ht : t ∈ Ioo 0 D.T) : simpa only [extendPath,projIcc_of_mem D.T_pos.le ⟨ht.1.le,ht.2.le⟩] using h /-- Inverse metric bound, given by `‖(inverseMetricCoefficient D).path‖`. -/ -def inverseMetricBound : ℝ := ‖(inverseMetricCoefficient D).path‖ +@[expose] 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‖`. -/ -def inverseMetricTimeBound : ℝ := ‖(inverseMetricTimeCoefficient D).path‖ +@[expose] def inverseMetricTimeBound : ℝ := ‖(inverseMetricTimeCoefficient D).path‖ theorem inverseMetricBound_le : inverseMetricBound D ≤ ‖D.F.field‖^2 := by apply (ContinuousMap.norm_le _ (sq_nonneg ‖D.F.field‖)).2 @@ -221,7 +222,7 @@ theorem inverseMetricTimeBound_le : /-- The actual source inverse metric supplies every field of the metric budget at every finite Sobolev order. -/ -def sourceMetricBudget (κ : ℝ) (hκ : |κ| ≤ 1) +@[expose] def sourceMetricBudget (κ : ℝ) (hκ : |κ| ≤ 1) (Z G : FieldTower P D.T) (q : ℕ) : MetricBudget P D.T D.T_pos.le ((correctionData D P κ hκ Z G).atOrder P (q+1)) where metric := (inverseMetricTower D P).coefficient @@ -245,6 +246,7 @@ def sourceMetricBudget (κ : ℝ) (hκ : |κ| ≤ 1) /-- Source metric budget of fields, given by `sourceMetricBudget D P κ hκ Z.toFieldTower G.toFieldTower q`. -/ +@[expose] def sourceMetricBudgetOfFields (κ : ℝ) (hκ : |κ| ≤ 1) {z r : VectorField} (Z : Field P D.T z) (G : Field P D.T r) (q : ℕ) : MetricBudget P D.T D.T_pos.le @@ -253,15 +255,18 @@ def sourceMetricBudgetOfFields (κ : ℝ) (hκ : |κ| ≤ 1) @[simp] theorem sourceMetricBudget_metric (κ : ℝ) (hκ : |κ| ≤ 1) (Z G : FieldTower P D.T) (q : ℕ) : - (sourceMetricBudget D P κ hκ Z G q).metric = (inverseMetricTower D P).coefficient := rfl + (sourceMetricBudget D P κ hκ Z G q).metric = (inverseMetricTower D P).coefficient := by + rfl @[simp] theorem sourceMetricBudget_derivative (κ : ℝ) (hκ : |κ| ≤ 1) (Z G : FieldTower P D.T) (q : ℕ) : - (sourceMetricBudget D P κ hκ Z G q).derivative = inverseMetricDerivativePath D P := rfl + (sourceMetricBudget D P κ hκ Z G q).derivative = inverseMetricDerivativePath D P := by + rfl @[simp] theorem sourceMetricBudget_c (κ : ℝ) (hκ : |κ| ≤ 1) (Z G : FieldTower P D.T) (q : ℕ) : - (sourceMetricBudget D P κ hκ Z G q).c = D.inverseBound⁻¹ := rfl + (sourceMetricBudget D P κ hκ Z G q).c = D.inverseBound⁻¹ := by + rfl theorem sourceMetricBudget_bound_le (κ : ℝ) (hκ : |κ| ≤ 1) (Z G : FieldTower P D.T) (q : ℕ) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionOutputPolynomial.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionOutputPolynomial.lean index 65b4f19b0e..581caf17e5 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,17 +33,20 @@ 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`. -/ +@[expose] def correctionSourceCost (R H C : ℝ) : ℝ := sourceBound P (2*velocity R H C) (12*velocity R H C*(4*R)) Kc.A0 Kc.A2 1 (correctionBase D) ((8/initialRadius R Kc.M Kc.Rc)*correctionBase D) /-- Correction pressure cost, given by `2*Kc.M*correctionSourceCost D P Kc R H C`. -/ +@[expose] def correctionPressureCost (R H C : ℝ) : ℝ := 2*Kc.M*correctionSourceCost D P Kc R H C /-- Correction time cost, given by `(1+2*Kc.M*(448*Kc.B+1))*correctionSourceCost D P Kc R H C`. -/ +@[expose] def correctionTimeCost (R H C : ℝ) : ℝ := (1+2*Kc.M*(448*Kc.B+1))*correctionSourceCost D P Kc R H C @@ -54,7 +57,7 @@ end end -@[expose] public section +public section noncomputable section @@ -77,6 +80,7 @@ def sourceEnvelope (X : ℝ) : ℝ := /-- Output envelope, given by `1+baseEnvelope X+2*X*sourceEnvelope P X+(1+2*X*(448*X+1))*sourceEnvelope P X`. -/ +@[expose] def outputEnvelope (X : ℝ) : ℝ := 1+baseEnvelope X+2*X*sourceEnvelope P X+(1+2*X*(448*X+1))*sourceEnvelope P X 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..51b9453fb3 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 @@ -25,23 +25,27 @@ open EulerParameterWordGevrey EulerCoefficientJetPressureBounds EulerPacketCorrectionCoefficients EulerPolynomialCost EulerCylinderPathProduct /-- Metric envelope, given by `correctionMetricEnvelope X X`. -/ +@[expose] def metricEnvelope (X : ℝ) : ℝ := correctionMetricEnvelope X X /-- Linear envelope, given by `correctionLinearEnvelope X X X`. -/ +@[expose] def linearEnvelope (X : ℝ) : ℝ := correctionLinearEnvelope X X X /-- Quadratic envelope, given by `correctionQuadraticEnvelope X X X`. -/ +@[expose] 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`. -/ +@[expose] 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..58daa2f6ec 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,14 @@ 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)`. -/ +@[expose] 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 _ @@ -90,6 +91,7 @@ theorem radius_decay (C T D ρ0 k X : ℝ) (hk : 0 < k) /-- Radius, given by `⟨fun t => ρ0-2*C*(D/k+delta X)*t.val, continuous_const.sub (continuous_const.mul continuous_subtype_val)⟩`. -/ +@[expose] def radius (T C D ρ0 k X : ℝ) : C(Icc (0 : ℝ) T,ℝ) := ⟨fun t => ρ0-2*C*(D/k+delta X)*t.val, continuous_const.sub (continuous_const.mul continuous_subtype_val)⟩ diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionSourceData.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionSourceData.lean index e18feb39c2..98f83b9139 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 @@ -147,7 +147,7 @@ variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] /-- Correction data, bundling `κ`, `direction`, `scale_bound`, `direction_bound` and the required compatibility proofs. -/ -def correctionData (κ : ℝ) (hκ : |κ| ≤ 1) +@[expose] def correctionData (κ : ℝ) (hκ : |κ| ≤ 1) (approximation residual : FieldTower P D.T) : Data P D.T where κ := κ direction := D.m₀ @@ -164,27 +164,27 @@ 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 @[simp] theorem correctionDataOfFields_approximation (κ : ℝ) (hκ : |κ| ≤ 1) {z r : VectorField} (Z : Field P D.T z) (G : Field P D.T r) : - (correctionDataOfFields D P κ hκ Z G).approximation.field = Z.path := rfl + (correctionDataOfFields D P κ hκ Z G).approximation.field = Z.path := by rfl @[simp] theorem correctionDataOfFields_residual (κ : ℝ) (hκ : |κ| ≤ 1) {z r : VectorField} (Z : Field P D.T z) (G : Field P D.T r) : - (correctionDataOfFields D P κ hκ Z G).residual.field = G.path := rfl + (correctionDataOfFields D P κ hκ Z G).residual.field = G.path := by rfl @[simp] theorem correctionData_metric (κ : ℝ) (hκ : |κ| ≤ 1) (Z G : FieldTower P D.T) (t : Icc (0 : ℝ) D.T) (x : LiftDomain P) : (((correctionData D P κ hκ Z G).metric).coefficient t).coefficient x = - (D.FInv.field t x.1).comp (D.FInv.field t x.1).adjoint := rfl + (D.FInv.field t x.1).comp (D.FInv.field t x.1).adjoint := by rfl @[simp] theorem correctionData_linear (κ : ℝ) (hκ : |κ| ≤ 1) (Z G : FieldTower P D.T) (t : Icc (0 : ℝ) D.T) (x : LiftDomain P) : (((correctionData D P κ hκ Z G).linear).coefficient t).coefficient x = - (2 : ℝ) • (D.FInv.field t x.1).comp (D.F₁.field t x.1) := rfl + (2 : ℝ) • (D.FInv.field t x.1).comp (D.F₁.field t x.1) := by rfl theorem correctionData_quadratic (κ : ℝ) (hκ : |κ| ≤ 1) (Z G : FieldTower P D.T) (i : Fin 3) (t : Icc (0 : ℝ) D.T) (x : LiftDomain P) : 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..9e3ed7a03b 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 @@ -62,7 +62,7 @@ namespace VectorCoefficient variable {T : ℝ} {raw : VectorField} (N : VectorCoefficient T raw) /-- Normal matrix, bundling `path`, `orbit`, `raw_eq`. -/ -def normalMatrix : MatrixCoefficient T (fun z => normalComponentMap (raw z)) where +@[expose] def normalMatrix : MatrixCoefficient T (fun z => normalComponentMap (raw z)) where path := normalComponentPath N.path orbit := normalComponentPath_orbit N.path N.orbit raw_eq t x θ := by rw [N.raw_eq]; rfl diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderCoefficientData.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderCoefficientData.lean index 6db61e05c2..adfd9f3eb6 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 @@ -59,13 +59,13 @@ namespace MatrixCoefficient variable {P T : ℝ} [Fact (0 < P)] {coef : Domain → Space →L[ℝ] Space} {raw : VectorField} /-- Multiply, given by `G.multiply A.path A.orbit coef A.raw_eq`. -/ -def multiply (A : MatrixCoefficient T coef) (G : Field P T raw) : +@[expose] def multiply (A : MatrixCoefficient T coef) (G : Field P T raw) : Field P T (fun z => coef z (raw z)) := G.multiply A.path A.orbit coef A.raw_eq /-- Adjoint, bundling `path`, `orbit`, `translateCoefficientPath`, `exact` and the required compatibility proofs. -/ -def adjoint (A : MatrixCoefficient T coef) : +@[expose] def adjoint (A : MatrixCoefficient T coef) : MatrixCoefficient T (fun z => (coef z).adjoint) where path := pathAdjointMap A.path orbit := by 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..5a0ec6e685 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 @@ -50,7 +50,7 @@ local instance instPacketCylinderFieldAdvection6 : NormedSpace ℝ (Space →ᵇ inferInstance /-- Embed the actual normal component into a fixed unit vector. -/ -def normalComponentMap : Space →L[ℝ] Space →L[ℝ] Space := +@[expose] def normalComponentMap : Space →L[ℝ] Space →L[ℝ] Space := ((ContinuousLinearMap.compL ℝ Space ℝ Space) scalarEmbed).comp (toDual ℝ Space).toContinuousLinearMap @@ -64,7 +64,7 @@ theorem normalComponentMap_project (m v : Space) : variable {K : Type*} [TopologicalSpace K] [CompactSpace K] /-- Normal component path, given by `mapCoefficientPath normalComponentMap N`. -/ -def normalComponentPath (N : C(K, Space →ᵇ Space)) : C(K,Space →ᵇ Space →L[ℝ] Space) := +@[expose] def normalComponentPath (N : C(K, Space →ᵇ Space)) : C(K,Space →ᵇ Space →L[ℝ] Space) := mapCoefficientPath normalComponentMap N theorem normalComponentPath_orbit (N : C(K, Space →ᵇ Space)) @@ -86,7 +86,7 @@ namespace Field variable {P T : ℝ} [Fact (0 < P)] {raw raw' : VectorField} /-- Spatial transport expressed directly in the full raw covering derivative. -/ -def spatialTransport (G : Field P T raw) (H : Field P T raw') : +@[expose] def spatialTransport (G : Field P T raw) (H : Field P T raw') : Field P T (fun z => fderiv ℝ (fun y => raw' (z.1,y)) z.2 (raw z,0)) where path := advectionPath P G.path H.path G.orbit H.orbit orbit := advectionPath_orbit P G.path H.path G.orbit H.orbit @@ -96,7 +96,7 @@ def spatialTransport (G : Field P T raw) (H : Field P T raw') : /-- The normal factor is a real coefficient operation; no L² integrability of the normal itself is needed. -/ -def angularTransport (G : Field P T raw) (H : Field P T raw') +@[expose] def angularTransport (G : Field P T raw) (H : Field P T raw') (N : C(Icc (0 : ℝ) T, Space →ᵇ Space)) (hN : ContDiff ℝ ∞ (translateCoefficientPath N)) (m : VectorField) (hm : ∀ (t : Icc (0 : ℝ) T) x θ, m (t, (x, θ)) = N t x) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderFieldAlgebra.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderFieldAlgebra.lean index 9f3e49e04e..d9c2f17380 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 @@ -66,7 +66,7 @@ def add (G : Field P T raw) (H : Field P T raw') : Field P T (raw+raw') := (fun t x θ => by simp only [Pi.add_apply,G.raw_eq,H.raw_eq]) /-- Neg, constructed using `ofLifted`. -/ -def neg (G : Field P T raw) : Field P T (-raw) := +@[expose] def neg (G : Field P T raw) : Field P T (-raw) := ofLifted (-G.path) (by simpa only [map_neg] using G.orbit.neg) (fun t x => -pointField P G.path G.orbit t x) (fun t => (smoothField_continuous P _ (pointField_smooth P G.path G.orbit t)).neg) @@ -76,11 +76,11 @@ def neg (G : Field P T raw) : Field P T (-raw) := (fun t x θ => by simp only [Pi.neg_apply,G.raw_eq]) /-- Sub, given by `(G.add H.neg).congr (fun t x θ => by simp only [sub_eq_add_neg])`. -/ -def sub (G : Field P T raw) (H : Field P T raw') : Field P T (raw-raw') := +@[expose] 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..7ba3a5b1b6 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 @@ -240,6 +240,7 @@ open scoped ContDiff variable {P T : ℝ} [Fact (0 < P)] {raw : VectorField} /-- Its path is the genuine average operator, and its raw field is exactly the angular integral. -/ +@[expose] def angleMean (G : Field P T raw) : Field P T (EulerPacketProfileRecursion.angleMean P raw) := ofLifted (pathAverage P G.path) (pathAverage_orbit_contDiff P G.path G.orbit) (fun t x => rawMean P (pointField P G.path G.orbit t) x.1) @@ -264,11 +265,12 @@ 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 @[simp] theorem angleMean_path (G : Field P T raw) : - G.angleMean.path = pathAverage P G.path := rfl + G.angleMean.path = pathAverage P G.path := by rfl /-- The same actual angular integral is admissible for the constructed ordinary-space mean solver. -/ 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..69fe798821 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 @@ -29,7 +29,7 @@ open scoped ContDiff BoundedContinuousFunction variable {P T : ℝ} [Fact (0 < P)] {raw raw' : VectorField} /-- Map, constructed using `ofLifted`. -/ -def map (G : Field P T raw) (L : Space →L[ℝ] Space) : +@[expose] def map (G : Field P T raw) (L : Space →L[ℝ] Space) : Field P T (fun z => L (raw z)) := ofLifted (pathMap P L G.path) (pathMap_orbit_contDiff P L G.path G.orbit) (fun t x => L (pointField P G.path G.orbit t x)) @@ -40,7 +40,7 @@ def map (G : Field P T raw) (L : Space →L[ℝ] Space) : (fun t x θ => congrArg L (G.raw_eq t x θ)) /-- The literal mixed derivative is represented by the actual derivative path. -/ -def derivative (G : Field P T raw) (i : Fin 4) : +@[expose] def derivative (G : Field P T raw) (i : Fin 4) : Field P T (fun z => fderiv ℝ (fun y => raw (z.1,y)) z.2 (standardDirection i)) where path := derivativePath P G.path i orbit := derivativePath_orbit P G.path G.orbit i @@ -49,7 +49,7 @@ def derivative (G : Field P T raw) (i : Fin 4) : exact (pointField_derivativePath P G.path G.orbit i t (x,(θ : AddCircle P))).symm /-- Scalar product, bundling `path`, `orbit`, `raw_eq`. -/ -def scalarProduct (G : Field P T raw) (H : Field P T raw') +@[expose] def scalarProduct (G : Field P T raw) (H : Field P T raw') (L : Space →L[ℝ] ℝ) (hL : ‖L‖ ≤ 1) : Field P T (fun z => L (raw z) • raw' z) where path := scalarProductPath P L hL G.path H.path G.orbit H.orbit orbit := scalarProductPath_orbit P L hL G.path H.path G.orbit H.orbit @@ -59,7 +59,7 @@ def scalarProduct (G : Field P T raw) (H : Field P T raw') P))).symm /-- Bilinear, bundling `path`, `orbit`, `raw_eq`. -/ -def bilinear (G : Field P T raw) (H : Field P T raw') +@[expose] def bilinear (G : Field P T raw) (H : Field P T raw') (B : Space →L[ℝ] Space →L[ℝ] Space) : Field P T (fun z => B (raw z) (raw' z)) where path := bilinearProductPath P B G.path H.path G.orbit H.orbit orbit := bilinearProductPath_orbit P B G.path H.path G.orbit H.orbit @@ -98,7 +98,7 @@ local instance instPacketCylinderFieldProducts4 : NormedSpace ℝ (Space →ᵇ inferInstance /-- A genuine smooth coefficient path multiplies a raw field without a new regularity premise. -/ -def multiply (G : Field P T raw) (A : C(Icc (0 : ℝ) T, Space →ᵇ Space →L[ℝ] Space)) +@[expose] def multiply (G : Field P T raw) (A : C(Icc (0 : ℝ) T, Space →ᵇ Space →L[ℝ] Space)) (hA : ContDiff ℝ ∞ (translateCoefficientPath A)) (coef : EulerPacketPointJets.Domain → Space →L[ℝ] Space) (hcoef : ∀ (t : Icc (0 : ℝ) T) x θ, coef (t, (x, θ)) = A t x) : 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..8d50c30ab9 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 @@ -45,7 +45,7 @@ open scoped ContDiff variable {P T : ℝ} [Fact (0 < P)] {raw : VectorField} (G : Field P T raw) /-- Weighted, constructed using `ofLifted`. -/ -def weighted (hT : 0 ≤ T) (g : C(Icc (0 : ℝ) T, ℝ)) : +@[expose] def weighted (hT : 0 ≤ T) (g : C(Icc (0 : ℝ) T, ℝ)) : Field P T (fun z => g (projIcc 0 T hT z.1) • raw z) := ofLifted (weight g G.path) (weighted_orbit P g G.path G.orbit) (fun t x => g t • pointField P G.path G.orbit t x) @@ -57,15 +57,15 @@ def weighted (hT : 0 ≤ T) (g : C(Icc (0 : ℝ) T, ℝ)) : (fun t x θ => by rw [projIcc_of_mem hT t.property,G.raw_eq]) /-- Normalized, given by `G.weighted hT (reciprocal g hg)`. -/ -def normalized (hT : 0 ≤ T) (g : C(Icc (0 : ℝ) T, ℝ)) (hg : ∀ t, 0 < g t) : +@[expose] def normalized (hT : 0 ≤ T) (g : C(Icc (0 : ℝ) T, ℝ)) (hg : ∀ t, 0 < g t) : Field P T (fun z => (g (projIcc 0 T hT z.1))⁻¹ • raw z) := G.weighted hT (reciprocal g hg) @[simp] theorem weighted_path (hT : 0 ≤ T) (g : C(Icc (0 : ℝ) T, ℝ)) : - (G.weighted hT g).path = weight g G.path := rfl + (G.weighted hT g).path = weight g G.path := by rfl @[simp] theorem normalized_path (hT : 0 ≤ T) (g : C(Icc (0 : ℝ) T, ℝ)) (hg : ∀ t, 0 < g t) : - (G.normalized hT g hg).path = normalize g hg G.path := rfl + (G.normalized hT g hg).path = normalize g hg G.path := by rfl theorem derivative_weighted_path (hT : 0 ≤ T) (g : C(Icc (0 : ℝ) T, ℝ)) (i : Fin 4) : ((G.weighted hT g).derivative i).path = ((G.derivative i).weighted hT g).path := 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..cc26d861c4 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 @@ -32,6 +32,7 @@ variable (P : ℝ) [Fact (0 < P)] {K : Type*} [TopologicalSpace K] [CompactSpace (S : Set Space) (hS : MeasurableSet S) /-- Retain the actual values of a continuous path that already has the stated support. -/ +@[expose] def supportedPath (p : C(K, LiftL2 P)) (h : ∀ t, p t ∈ Supported P Space S hS) : C(K,Supported P Space S hS) := ⟨fun t => ⟨p t,h t⟩, p.continuous.subtype_mk h⟩ @@ -105,7 +106,7 @@ end end -@[expose] public section +public section noncomputable section @@ -119,6 +120,7 @@ variable {P : ℝ} [Fact (0 < P)] {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteSpace U] /-- Only actual support and literal mean zero are added to the existing field witness. -/ +@[expose] def transverseForcing (D : EulerTransversePacketProvider.Data U) {raw : VectorField} (G : Field P D.T raw) (hs : ∀ t, G.path t ∈ Supported P Space D.support D.support_measurable) @@ -131,6 +133,7 @@ def transverseForcing (D : EulerTransversePacketProvider.Data U) {raw : VectorFi mean_zero t := G.average_zero_of_raw_integral hm t /-- A literal compact-support proof may be used directly, without selecting a new representative. -/ +@[expose] def transverseForcingOfRaw (D : EulerTransversePacketProvider.Data U) {raw : VectorField} (G : Field P D.T raw) (hs : ∀ (t : Icc (0 : ℝ) D.T) x, x ∉ D.support → ∀ θ : ℝ, raw (t,(x,θ)) = 0) 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..7b0b880a5f 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 @@ -30,7 +30,7 @@ variable {P T : ℝ} [Fact (0 < P)] {J K : Domain → VectorJet} /-- Slow advection as an element of `Field P T (fun z => EulerPacketPointJets.slowAdvection (inverse z) (J z) (K z))`. -/ -def slowAdvection {inverse : Domain → Space →L[ℝ] Space} +@[expose] def slowAdvection {inverse : Domain → Space →L[ℝ] Space} (A : MatrixCoefficient T inverse) (G : SpatialJetField P T J) (H : SpatialJetField P T K) : Field P T (fun z => EulerPacketPointJets.slowAdvection (inverse z) (J z) (K z)) := ((A.multiply G.field).spatialTransport H.field).congr (fun t x θ => by @@ -41,7 +41,7 @@ def slowAdvection {inverse : Domain → Space →L[ℝ] Space} /-- Fast advection as an element of `Field P T (fun z => EulerPacketPointJets.fastAdvection (normal z) (J z) (K z))`. -/ -def fastAdvection {normal : VectorField} (N : VectorCoefficient T normal) +@[expose] def fastAdvection {normal : VectorField} (N : VectorCoefficient T normal) (G : SpatialJetField P T J) (H : SpatialJetField P T K) : Field P T (fun z => EulerPacketPointJets.fastAdvection (normal z) (J z) (K z)) := (G.field.angularTransport H.field N.path N.orbit normal N.raw_eq).congr (fun t x θ => by @@ -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 @@ -63,13 +63,13 @@ namespace Field variable {P T : ℝ} [Fact (0 < P)] /-- Slow pressure, given by `(A.adjoint.multiply G).congr (fun _ _ _ => rfl)`. -/ -def slowPressure {inverse : Domain → Space →L[ℝ] Space} +@[expose] def slowPressure {inverse : Domain → Space →L[ℝ] Space} (A : MatrixCoefficient T inverse) (p : ScalarField) (G : Field P T (pressureGradient p)) : Field P T (fun z => EulerPacketPointJets.slowPressure (inverse z) (pressureJet p z)) := (A.adjoint.multiply G).congr (fun _ _ _ => rfl) /-- The linear time term uses a genuine L² time derivative of the old corrector. -/ -def linearPart {strain : Domain → Space →L[ℝ] Space} +@[expose] def linearPart {strain : Domain → Space →L[ℝ] Space} (A : MatrixCoefficient T strain) {raw raw_t : VectorField} (G : Field P T raw) (H : Field P T raw_t) (hT : 0 < T) (hd : TimeDerivative hT.le G H) (s : Set ℝ) (hs : s = Icc (0 : ℝ) T) : 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..b162a055c2 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 @@ -61,6 +61,8 @@ theorem rawCorrector_eq_lifted ((fderiv ℝ (fun y : LiftTangent => D.rawPotential P raw (t,y)) (x,θ)).comp ((ContinuousLinearMap.inl ℝ Space ℝ).comp (D.FInv.field (D.clamp t) x))) = _ rw [EulerTransversePacketProvider.Data.clamp_coe,hQ,coverField_fderiv] + simp only [EulerPacketConstructedPiola.corrector, + EulerTransversePacketProvider.Data.deformationEquiv_normal] rfl end EulerPacketCylinderField diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderPiolaPair.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderPiolaPair.lean index 5b11cf2bb1..3535c8525c 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 @@ -38,6 +38,7 @@ def packetInverseCoefficient : MatrixCoefficient D.T /-- Piola pair raw, defined pointwise by `D.FInv.field (D.clamp z.1) z.2.1 (κ^p • raw z+κ^(p+1) • D.curlCorrector P raw z)`. -/ +@[expose] def piolaPairRaw (κ : ℝ) (raw : VectorField) (p : ℕ) : VectorField := fun z => D.FInv.field (D.clamp z.1) z.2.1 (κ^p • raw z+κ^(p+1) • D.curlCorrector P raw z) 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..ce7b89e05e 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 @@ -26,12 +26,12 @@ open scoped ContDiff /-- Profile ratio, given by `⟨fun t => g t/b t,g.continuous.div b.continuous (fun t => (hb t).ne')⟩`. -/ -def profileRatio {K : Type*} [TopologicalSpace K] +@[expose] def profileRatio {K : Type*} [TopologicalSpace K] (g b : C(K, ℝ)) (hb : ∀ t, 0 < b t) : C(K,ℝ) := ⟨fun t => g t/b t,g.continuous.div b.continuous (fun t => (hb t).ne')⟩ @[simp] theorem profileRatio_apply {K : Type*} [TopologicalSpace K] - (g b : C(K, ℝ)) (hb : ∀ t, 0 < b t) (t : K) : profileRatio g b hb t = g t/b t := rfl + (g b : C(K, ℝ)) (hb : ∀ t, 0 < b t) (t : K) : profileRatio g b hb t = g t/b t := by rfl theorem profileRatio_abs_le {K : Type*} [TopologicalSpace K] (g b : C(K, ℝ)) (hg : ∀ t, 0 ≤ g t) (hb : ∀ t, 0 < b t) diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderRecursiveAdmissibility.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderRecursiveAdmissibility.lean index 8f0b9f6915..7f491d9b38 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 @@ -121,7 +121,7 @@ open Set MeasureTheory EulerSmoothLimit EulerPacketPointJets EulerPacketProfileR variable {P T : ℝ} [Fact (0 < P)] /-- Change time, given by `h ▸ G`. -/ -def Field.changeTime {raw : VectorField} {T' : ℝ} (G : Field P T raw) (h : T = T') : +@[expose] def Field.changeTime {raw : VectorField} {T' : ℝ} (G : Field P T raw) (h : T = T') : Field P T' raw := h ▸ G theorem Field.changeTime_derivative {raw raw_t : VectorField} {T' : ℝ} diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderScalarGradient.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderScalarGradient.lean index acb562dd00..f7f5fb2470 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 @@ -55,7 +55,7 @@ variable {P T : ℝ} [Fact (0 < P)] (raw : ScalarField) raw (t, (x, θ)) = scalarPointField P p hp t (x, (θ : AddCircle P))) /-- A norm-one scalar embedding retains the actual continuous L² path. -/ -def scalarEmbeddingField : Field P T (fun z => scalarEmbed (raw z)) := +@[expose] def scalarEmbeddingField : Field P T (fun z => scalarEmbed (raw z)) := Field.ofLifted (pathMap P scalarEmbed p) (pathMap_orbit_contDiff P scalarEmbed p hp) (fun t x => scalarEmbed (scalarPointField P p hp t x)) (fun t => scalarEmbed.continuous.comp (scalarPointField_continuous P p hp t)) @@ -74,7 +74,7 @@ theorem scalarRaw_smooth (t : Icc (0 : ℝ) T) : exact coverField_contDiff P _ (scalarPointField_smooth P p hp t) /-- This witness is the spatial gradient used by `pressureJet`; it needs no time derivative. -/ -def scalarGradientField : Field P T (pressureGradient raw) := +@[expose] def scalarGradientField : Field P T (pressureGradient raw) := (Field.finsetSum (univ : Finset (Fin 3)) (fun i z => gradientComponent i (fderiv ℝ (fun y => scalarEmbed (raw (z.1,y))) z.2 (standardDirection i.succ))) diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderScalarGradientBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderScalarGradientBounds.lean index 4d1c9bfbcf..5f3002d4c7 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 @@ -103,7 +103,7 @@ variable {T : ℝ} (raw : ScalarField) (p : C(Icc (0 : ℝ) T, CylinderL2 P ℝ) raw (t, (x, θ)) = scalarPointField P p hp t (x, (θ : AddCircle P))) theorem scalarGradientField_path : - (scalarGradientField raw p hp he).path = scalarGradientPath p := rfl + (scalarGradientField raw p hp he).path = scalarGradientPath p := by rfl theorem scalarGradientField_block_bound (q n : ℕ) (a : LiftTangent) : block standardDirection q 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..18b41e2df6 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 @@ -40,7 +40,7 @@ namespace SpatialJetField variable {P T : ℝ} [Fact (0 < P)] {J K J' : Domain → VectorJet} /-- Of field, bundling `raw`, `field`, `value_eq`, `spatial_eq`. -/ -def ofField {raw : VectorField} (s : Set ℝ) (G : Field P T raw) : +@[expose] def ofField {raw : VectorField} (s : Set ℝ) (G : Field P T raw) : SpatialJetField P T (slicedJet s raw) where raw := raw field := G 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..a87ac5ffb2 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 @@ -29,13 +29,13 @@ open scoped ContDiff /-- Product profile ratio, given by `⟨fun t => g t*h t/b t,(g.continuous.mul h.continuous).div b.continuous (fun t => (hb t).ne')⟩`. -/ -def productProfileRatio {K : Type*} [TopologicalSpace K] +@[expose] def productProfileRatio {K : Type*} [TopologicalSpace K] (g h b : C(K, ℝ)) (hb : ∀ t, 0 < b t) : C(K,ℝ) := ⟨fun t => g t*h t/b t,(g.continuous.mul h.continuous).div b.continuous (fun t => (hb t).ne')⟩ @[simp] theorem productProfileRatio_apply {K : Type*} [TopologicalSpace K] (g h b : C(K, ℝ)) (hb : ∀ t, 0 < b t) (t : K) : - productProfileRatio g h b hb t = g t*h t/b t := rfl + productProfileRatio g h b hb t = g t*h t/b t := by rfl theorem productProfileRatio_abs_le {K : Type*} [TopologicalSpace K] (g h b : C(K, ℝ)) (hg : ∀ t, 0 ≤ g t) (hh : ∀ t, 0 ≤ h t) @@ -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..2e0612128b 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 @@ -46,6 +46,7 @@ variable (M : EulerMeanPacketProvider.Data) /-- Initialized exact physical pressure, given by `(initializedExactPacket M D hTime τ hτ hτT B δ hδ ξ hs α Cagree N hN k hk Q).graphPotential k t ∘ Y`. -/ +@[expose] def initializedExactPhysicalPressure (t : Icc (0 : ℝ) D.T) (Y : Space → Space) : Space → ℝ := (initializedExactPacket M D hTime τ hτ hτT B δ hδ ξ hs α Cagree N hN k hk Q).graphPotential k t ∘ Y diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketExactShearError.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketExactShearError.lean index 7b568c031a..c4527e8c5a 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 @@ -42,6 +42,7 @@ variable (M : EulerMeanPacketProvider.Data) (initializedCorrectionData M D hTime τ hτ hτT B δ hδ ξ hs α Cagree N hN k hk)) /-- Initialized exact physical velocity as an element of `Space`. -/ +@[expose] def initializedExactPhysicalVelocity (t : Icc (0 : ℝ) D.T) (Y : Space → Space) (x : Space) : Space := k⁻¹ • D.F.field t (Y x) 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..511995d5aa 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,12 +31,12 @@ 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 /-- Jet polynomial, given by `∑ n ∈ range (m+1), R^n*(n.factorial : ℝ)^2`. -/ -def jetPolynomial (R : ℝ) (m : ℕ) : ℝ := +@[expose] def jetPolynomial (R : ℝ) (m : ℕ) : ℝ := ∑ n ∈ range (m+1), R^n*(n.factorial : ℝ)^2 theorem jetPolynomial_nonneg (R : ℝ) (hR : 0 ≤ R) (m : ℕ) : @@ -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..e4e1891ce0 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 @@ -26,15 +26,15 @@ variable {P T : ℝ} [Fact (0 < P)] {raw raw_t : VectorField} /-- No Sobolev realizations are hypothesized: each is constructed from the genuine mixed translation orbit of the prescribed field. -/ -def toFieldTower (G : Field P T raw) : EulerAllOrderCorrectionData.FieldTower P T where +@[expose] def toFieldTower (G : Field P T raw) : EulerAllOrderCorrectionData.FieldTower P T where field := G.path realization q := sobolevPath P q G.path G.orbit value_eq q t := sobolevPath_value P q G.path G.orbit t -@[simp] theorem toFieldTower_field (G : Field P T raw) : G.toFieldTower.field = G.path := rfl +@[simp] theorem toFieldTower_field (G : Field P T raw) : G.toFieldTower.field = G.path := by rfl @[simp] theorem toFieldTower_realization (G : Field P T raw) (q : ℕ) : - G.toFieldTower.realization q = sobolevPath P q G.path G.orbit := rfl + G.toFieldTower.realization q = sobolevPath P q G.path G.orbit := by rfl theorem toFieldTower_value (G : Field P T raw) (q : ℕ) (t : Icc (0 : ℝ) T) : value P (G.toFieldTower.realization q t) = G.path t := G.toFieldTower.value_eq q t 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..cf76a2b1e9 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 @@ -27,21 +27,21 @@ variable {P T : ℝ} [Fact (0 < P)] namespace Field /-- Truncate family as an element of `Field P T (truncate M f n)`. -/ -def truncateFamily (M : ℕ) (f : ℕ → VectorField) +@[expose] def truncateFamily (M : ℕ) (f : ℕ → VectorField) (G : ∀ i, i ≤ M → Field P T (f i)) (n : ℕ) : Field P T (truncate M f n) := by by_cases hn : n ≤ M · exact (G n hn).congr (fun _ _ _ => by rw [truncate_of_le M n f hn]) · exact (Field.zero P T).congr (fun _ _ _ => by rw [truncate_of_gt M n f (by omega)]) /-- Assemble family used in packet finite field algebra. -/ -def assembleFamily (M : ℕ) (f c : ℕ → VectorField) +@[expose] def assembleFamily (M : ℕ) (f c : ℕ → VectorField) (G : ∀ i, i ≤ M → Field P T (f i)) (H : ∀ i, i ≤ M → Field P T (c i)) : (n : ℕ) → Field P T (assemble M f c n) | 0 => (truncateFamily M f G 0).congr (fun _ _ _ => by simp only [assemble,shiftUp,add_zero]) | n+1 => (truncateFamily M f G (n+1)).add (truncateFamily M c H n) /-- Evaluate family as an element of `Field P T (fieldSum M κ f)`. -/ -def evaluateFamily (M : ℕ) (κ : ℝ) (f : ℕ → VectorField) (G : ∀ i, Field P T (f i)) : +@[expose] def evaluateFamily (M : ℕ) (κ : ℝ) (f : ℕ → VectorField) (G : ∀ i, Field P T (f i)) : Field P T (fieldSum M κ f) := (Field.finsetSum (range (M+1)) (fun i => κ^i • f i) (fun i => (G i).smul (κ^i))).congr (fun _ _ _ => by simp only [fieldSum,evaluate,Finset.sum_apply,Pi.smul_apply]) 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..696c2a9ca4 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 @@ -125,7 +125,7 @@ open Set Filter EulerSmoothLimit EulerLpTranslation EulerLpTranslation.SmoothL2F open scoped Topology /-- Initial datum, given by `Stage.initialDataLimit packets le_rfl le_rfl`. -/ -def initialDatum : SmoothL2Field Space := Stage.initialDataLimit packets le_rfl le_rfl +@[expose] def initialDatum : SmoothL2Field Space := Stage.initialDataLimit packets le_rfl le_rfl theorem initialDatum_Hm (s : ℕ) : Tendsto (fun n => derivativeSum s 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..0bdd304d53 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,14 +24,14 @@ 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)] /-- Time derivative field, given by `H.congr (fun t x θ => (G.raw_hasDerivWithinAt hT.le H ht t x θ).derivWithin ((uniqueDiffOn_Icc hT) _ t.property))`. -/ -def Field.timeDerivativeField {raw raw_t : VectorField} (G : Field P T raw) (hT : 0 < T) +@[expose] def Field.timeDerivativeField {raw raw_t : VectorField} (G : Field P T raw) (hT : 0 < T) (H : Field P T raw_t) (ht : TimeDerivative hT.le G H) : Field P T (rawTimeDerivative T raw) := H.congr (fun t x θ => (G.raw_hasDerivWithinAt hT.le H ht t x θ).derivWithin @@ -47,17 +47,18 @@ variable {N : ℕ} {a : ℕ → Profile} {support : Set Space} (hT : 0 < T) (G : ∀ i, i ≤ N → ProfileRegularity P T hT.le support (a i)) /-- Velocity grade field, constructed using `Field.assembleFamily`. -/ -def velocityGradeField (i : ℕ) : Field P T (assembledVelocity N a i) := +@[expose] def velocityGradeField (i : ℕ) : Field P T (assembledVelocity N a i) := Field.assembleFamily N (fun j => (a j).high+(a j).mean) (fun j => (a j).corrector) (fun j hj => (G j hj).high.add (G j hj).mean) (fun j hj => (G j hj).corrector) i /-- Velocity time coefficients, given by `assemble N (fun i => rawTimeDerivative T ((a i).high+(a i).mean)) (fun i => rawTimeDerivative T (a i).corrector)`. -/ -def velocityTimeCoefficients : ℕ → VectorField := +@[expose] def velocityTimeCoefficients : ℕ → VectorField := assemble N (fun i => rawTimeDerivative T ((a i).high+(a i).mean)) (fun i => rawTimeDerivative T (a i).corrector) /-- Velocity grade derivative field, constructed using `Field.assembleFamily`. -/ +@[expose] def velocityGradeDerivativeField (i : ℕ) : Field P T (velocityTimeCoefficients (T := T) (N := N) (a := a) i) := Field.assembleFamily N (fun j => rawTimeDerivative T ((a j).high+(a j).mean)) @@ -75,12 +76,12 @@ theorem velocityGrade_time (i : ℕ) : (fun j hj => (G j hj).corrector_time) i /-- Velocity field, given by `Field.evaluateFamily (N+1) κ _ (velocityGradeField hT G)`. -/ -def velocityField (κ : ℝ) : Field P T (fieldSum (N+1) κ (assembledVelocity N a)) := +@[expose] def velocityField (κ : ℝ) : Field P T (fieldSum (N+1) κ (assembledVelocity N a)) := Field.evaluateFamily (N+1) κ _ (velocityGradeField hT G) /-- Velocity derivative field, given by `Field.evaluateFamily (N+1) κ _ (velocityGradeDerivativeField hT G)`. -/ -def velocityDerivativeField (κ : ℝ) : +@[expose] def velocityDerivativeField (κ : ℝ) : Field P T (fieldSum (N+1) κ (velocityTimeCoefficients (T := T) (N := N) (a := a))) := Field.evaluateFamily (N+1) κ _ (velocityGradeDerivativeField hT G) 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..f3d29ca95c 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 @@ -42,12 +42,14 @@ theorem mean_le_forwardInitializedRadius : Rm ≤ forwardInitializedRadius LM L /-- Forward initialized linear budget, given by `L.enlargeRadius (forwardInitializedRadius LM L NB BC δ ξ) (forward_le_initializedRadius LM L NB BC δ ξ)`. -/ +@[expose] def forwardInitializedLinearBudget : EulerTransversePacketForward.Budget D (Fin 4) 6 := L.enlargeRadius (forwardInitializedRadius LM L NB BC δ ξ) (forward_le_initializedRadius LM L NB BC δ ξ) /-- Forward initialized normal budget, given by `NB.enlargeRadius (forwardInitializedRadius LM L NB BC δ ξ) (forward_le_initializedRadius LM L NB BC δ ξ)`. -/ +@[expose] def forwardInitializedNormalBudget : EulerTransversePacketJoin.NormalBudget D 6 (forwardInitializedRadius LM L NB BC δ ξ) := NB.enlargeRadius (forwardInitializedRadius LM L NB BC δ ξ) diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardChildLowBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardChildLowBounds.lean index 66d0aa7a33..00db16ff7c 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 @@ -71,7 +71,7 @@ variable {F : ParentFrame (A.transverseData m hm J support hSupport) 0} /-- The exact source (20) errors, expressed on the same normalized packet that defines the physical child. These are precisely the two errors supplied by the same-Q packet choice. -/ -def ForwardSourceErrors (ev ep : ℝ) : Prop := +@[expose] def ForwardSourceErrors (ev ep : ℝ) : Prop := ∀ (t : Icc (0 : ℝ) A.T) (x : Space), ‖fderiv ℝ (A.normalizedPacketVelocity m hm J support hSupport B residual k E.inverse t) x - shearTerm (G.primaryAmplitude hball) (deriv (profile G.δ) (k*⟪m,E.inverse.normalized t x⟫_ℝ)) diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardCoefficientBudgets.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardCoefficientBudgets.lean index de1f4b226a..69ca022b96 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 @@ -30,6 +30,7 @@ variable (P : ℝ) [Fact (0 < P)] (M : EulerMeanPacketProvider.Data) /-- Forward coefficient budget, given by `sourceCoefficientBudget P M D (InitialData.zero P D) hTime NB.Rc NB.C NB.Rc_nonneg NB.C_nonneg NB.inverse_bound NB.strain_bound`. -/ +@[expose] def forwardCoefficientBudget {R : ℝ} (NB : EulerTransversePacketJoin.NormalBudget D 6 R) : CoefficientBudget (sourceCoefficientData P M D (InitialData.zero P D) hTime) := sourceCoefficientBudget P M D (InitialData.zero P D) hTime NB.Rc NB.C @@ -47,6 +48,7 @@ variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteS (NB : EulerTransversePacketJoin.NormalBudget D 6 L.R) /-- Correction coefficients, constructed using `correctionCoefficientBudget`. -/ +@[expose] def correctionCoefficients (P : ℝ) [Fact (0 < P)] : CorrectionCoefficientBudget D P := correctionCoefficientBudget D P (max L.Rc NB.Rc) L.C₀ L.C₁ NB.C (L.Rc_nonneg.trans (le_max_left _ _)) L.C₀_nonneg L.C₁_nonneg NB.C_nonneg 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..192c29c62f 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 @@ -45,6 +45,7 @@ variable (M : EulerMeanPacketProvider.Data) /-- Forward initialized exact packet, given by `exactPacketOfResidual period Q (forwardInitializedApproximationResidual M D hTime δ hδ ξ hs α Cagree N hN k hk)`. -/ +@[expose] def forwardInitializedExactPacket (Cagree : SourceCoefficientAgreement M D) (N : ℕ) (hN : 1 ≤ N) (k : ℝ) (hk : 4 ≤ k) (Q : Budget period D.T_pos @@ -106,7 +107,7 @@ end end -@[expose] public section +public section noncomputable section @@ -130,6 +131,7 @@ variable (M : EulerMeanPacketProvider.Data) (forwardInitializedCorrectionData M D hTime δ hδ ξ hs α Cagree N hN k hk)) /-- Forward initialized exact physical velocity as an element of `Space`. -/ +@[expose] def forwardInitializedExactPhysicalVelocity (t : Icc (0 : ℝ) D.T) (Y : Space → Space) (x : Space) : Space := k⁻¹ • D.F.field t (Y x) @@ -190,6 +192,7 @@ theorem forwardInitializedExactPhysicalVelocity_fderiv (t : Icc (0 : ℝ) D.T) /-- Forward initialized exact physical pressure, given by `(forwardInitializedExactPacket M D hTime δ hδ ξ hs α Cagree N hN k hk Q).graphPotential k t ∘ Y`. -/ +@[expose] def forwardInitializedExactPhysicalPressure (t : Icc (0 : ℝ) D.T) (Y : Space → Space) : Space → ℝ := (forwardInitializedExactPacket M D hTime δ hδ ξ hs α Cagree N hN k hk Q).graphPotential k t ∘ Y 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..cd692aebf3 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 @@ -77,11 +77,12 @@ theorem vector_homogeneous_time (t : Icc (0 : ℝ) D.T) (x : Space) (θ : ℝ) : end General /-- Uncut velocity, given by `physical D ⟨0,le_rfl,D.T_pos.le⟩ x ξ t`. -/ +@[expose] 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..a8411b7c08 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`, @@ -117,6 +117,7 @@ variable [CompleteSpace U] /-- Source velocity, given by `EulerPacketForwardFactorization.uncutVelocity D G.initialCoordinate t x`. -/ +@[expose] def sourceVelocity (x : Space) (t : ℝ) : Space := EulerPacketForwardFactorization.uncutVelocity D G.initialCoordinate t x diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardGeometryLowBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardGeometryLowBounds.lean index f4219ca35f..869d7d6878 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 @@ -41,6 +41,7 @@ theorem error_le_scaled_error : P.forwardError G.radius ≤ linarith only [he,hbase] /-- Geometry data, bundling `center`, `B`, `B₁`, `M` and the required compatibility proofs. -/ +@[expose] def geometryData (Ω : Set Space) (h0 : 0 ∈ Ω) (hΩ : ∀ x ∈ Ω, ‖x‖ ≤ G.radius) : PhysicalGeometryData {x : Space // x ∈ Ω} where center := ⟨0,h0⟩ @@ -166,7 +167,7 @@ end end -@[expose] public section +public section noncomputable section @@ -182,10 +183,12 @@ variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteS /-- Low geometry, given by `G.geometryData {x | ‖x‖ ≤ (1/2 : ℝ)} (by norm_num) (fun _ hx => hx.trans hball)`. -/ +@[expose] def lowGeometry : PhysicalGeometryData {x : Space // ‖x‖ ≤ (1/2 : ℝ)} := G.geometryData {x | ‖x‖ ≤ (1/2 : ℝ)} (by norm_num) (fun _ hx => hx.trans hball) /-- Primary amplitude, given by `(G.lowGeometry hball).amplitude`. -/ +@[expose] def primaryAmplitude : ℝ := (G.lowGeometry hball).amplitude theorem primaryAmplitude_nonneg : 0 ≤ G.primaryAmplitude hball := @@ -193,7 +196,7 @@ theorem primaryAmplitude_nonneg : 0 ≤ G.primaryAmplitude hball := /-- Early ratio, given by `cutoffBound*(8232*Real.exp 9*P.horizon^5*Real.exp (-(1/(4*P.sigma))))`. -/ -def earlyRatio (_G : ForwardGuards P) : ℝ := +@[expose] def earlyRatio (_G : ForwardGuards P) : ℝ := cutoffBound*(8232*Real.exp 9*P.horizon^5*Real.exp (-(1/(4*P.sigma)))) omit [CompleteSpace U] in diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardHessianError.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardHessianError.lean index 180b519890..1dc70e823c 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 @@ -596,6 +596,7 @@ open scoped ContDiff variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteSpace U] /-- Forward initialized pressure hessian cost, constructed using `fastHessianCost`. -/ +@[expose] def forwardInitializedPressureHessianCost {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) + diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitialSupport.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitialSupport.lean index 92651f090d..98de177411 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 @@ -33,13 +33,13 @@ variable (M : EulerMeanPacketProvider.Data) /-- Forward initialized initial high, given by `scale M.ℓ (fun x => EulerPacketInitial.high N k⁻¹ 0 (forwardInitializedProfiles M D δ hδ ξ hs α) (0,(x,k*inner ℝ D.m₀ x)))`. -/ -def forwardInitializedInitialHigh (N : ℕ) (k : ℝ) : Space → Space := +@[expose] def forwardInitializedInitialHigh (N : ℕ) (k : ℝ) : Space → Space := scale M.ℓ (fun x => EulerPacketInitial.high N k⁻¹ 0 (forwardInitializedProfiles M D δ hδ ξ hs α) (0,(x,k*inner ℝ D.m₀ x))) /-- Forward initialized initial mean, given by `scale M.ℓ (fun x => EulerPacketInitial.mean N k⁻¹ 0 (forwardInitializedProfiles M D δ hδ ξ hs α) (0,(x,k*inner ℝ D.m₀ x)))`. -/ -def forwardInitializedInitialMean (N : ℕ) (k : ℝ) : Space → Space := +@[expose] def forwardInitializedInitialMean (N : ℕ) (k : ℝ) : Space → Space := scale M.ℓ (fun x => EulerPacketInitial.mean N k⁻¹ 0 (forwardInitializedProfiles M D δ hδ ξ hs α) (0,(x,k*inner ℝ D.m₀ x))) diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitializedAllOrderBudget.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitializedAllOrderBudget.lean index c389ac4f89..7e3b09f468 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 @@ -146,6 +146,7 @@ variable (M : EulerMeanPacketProvider.Data) (N : ℕ) (hN : 1 ≤ N) (k : ℝ) (hk : 4 ≤ k) /-- Forward initialized metric budget, constructed using `sourceMetricBudgetOfFields`. -/ +@[expose] def forwardInitializedMetricBudget (q : ℕ) : MetricBudget period D.T D.T_pos.le ((forwardInitializedCorrectionData M D hTime δ hδ ξ hs α Cagree N hN k hk).atOrder period @@ -178,6 +179,7 @@ variable /-- All four field estimates and all coefficient estimates are actual properties of the initialized source data at this finite Sobolev order. -/ +@[expose] def forwardInitializedSpatialBudget (q : ℕ) (hq : 6 ≤ q) : SpatialBudget period (by omega : 6 ≤ (q+1)+1) ((forwardInitializedCorrectionData M D hTime δ hδ ξ hs α Cagree N hN k hk).atOrder period @@ -226,6 +228,7 @@ def forwardInitializedSpatialBudget (q : ℕ) (hq : 6 ≤ q) : X hcoef hX hNX ((q+1)+1) (q-4) (by omega) (ρ t) (hρ t) (hpacket t) t /-- The small drift envelope is kept separate from the full background. -/ +@[expose] def forwardInitializedDriftBudget (q : ℕ) (hq : 6 ≤ q) : EulerDriftCorrectionBudget.Budget period (by omega : 6 ≤ (q+1)+1) ((forwardInitializedCorrectionData M D hTime δ hδ ξ hs α Cagree N hN k hk).atOrder period @@ -252,7 +255,7 @@ theorem forwardInitializedDriftBudget_growth (q : ℕ) (hq : 6 ≤ q) : period D.T_pos.le (forwardInitializedMetricBudget M D hTime δ hδ ξ hs α Cagree N hN k hk 0) (q+1)) = growthCoefficient D period Kc (2*velocity L.R S.H0 BC.multiplierCost) - (12*velocity L.R S.H0 BC.multiplierCost*(4*L.R)) := rfl + (12*velocity L.R S.H0 BC.multiplierCost*(4*L.R)) := by rfl end EulerPacketTerminalDatum @@ -266,7 +269,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 +322,7 @@ end end -@[expose] public section +public section noncomputable section @@ -358,6 +361,7 @@ local notation "ρg" => initialRadius L.R Kc.M Kc.Rc /-- Explicit scalar guards suffice because every analytic input to the all-order correction theorem is supplied by the constructed packet. -/ +@[expose] def forwardInitializedAllOrderBudget (k : ℝ) (hk : 4 ≤ k) (hX : 64 ≤ expansion k) (hlog : 1 ≤ Real.log k) (htail : tailPolynomialConstant L.R S.H0 BC.termCost ≤ smallPower k) 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..3ca9836339 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 @@ -46,12 +46,14 @@ variable (M : EulerMeanPacketProvider.Data) /-- Forward initialized packet field, given by `sourcePacketPullbackField period M D hTime (InitialData.zero period D) (initialData D δ hδ (α • ξ) hs) N κ`. -/ +@[expose] def forwardInitializedPacketField (N : ℕ) (κ : ℝ) := sourcePacketPullbackField period M D hTime (InitialData.zero period D) (initialData D δ hδ (α • ξ) hs) N κ /-- Forward initialized residual field, given by `sourceResidualField period M D hTime (InitialData.zero period D) (initialData D δ hδ (α • ξ) hs) Cagree N hN κ hκ`. -/ +@[expose] def forwardInitializedResidualField (Cagree : SourceCoefficientAgreement M D) (N : ℕ) (hN : 1 ≤ N) (κ : ℝ) (hκ : κ ≠ 0) := sourceResidualField period M D hTime (InitialData.zero period D) @@ -113,7 +115,7 @@ end end -@[expose] public section +public section noncomputable section @@ -131,11 +133,13 @@ variable (M : EulerMeanPacketProvider.Data) /-- Forward initialized normalized field, given by `((forwardInitializedPacketField M D hTime δ hδ ξ hs α N k⁻¹).smul k).changeTime hTime`. -/ +@[expose] def forwardInitializedNormalizedField (N : ℕ) (k : ℝ) := ((forwardInitializedPacketField M D hTime δ hδ ξ hs α N k⁻¹).smul k).changeTime hTime /-- Forward initialized normalized residual field used in packet forward initialized correction data. -/ +@[expose] def forwardInitializedNormalizedResidualField (Cagree : SourceCoefficientAgreement M D) (N : ℕ) (hN : 1 ≤ N) (k : ℝ) (hk : 4 ≤ k) := (((sourceCoefficientData period M D (InitialData.zero period D) hTime).inverse.multiply @@ -144,7 +148,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..05650ddbfe 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,11 +33,12 @@ 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 (InitialData.zero period D) (initialData D δ hδ (α • ξ) hs) p`. -/ +@[expose] def forwardInitializedProfileWitness (p : ℕ) : ProfileRegularity period M.T M.T_pos.le D.support (forwardInitializedProfiles M D δ hδ ξ hs α p) := 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..87e539383f 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 @@ -150,6 +150,7 @@ variable (M : EulerMeanPacketProvider.Data) /-- Forward initialized pressure, given by `fieldSum (N+1) κ (assembledPressure N (forwardInitializedProfiles M D δ hδ ξ hs α))`. -/ +@[expose] def forwardInitializedPressure (N : ℕ) (κ : ℝ) : ScalarField := fieldSum (N+1) κ (assembledPressure N (forwardInitializedProfiles M D δ hδ ξ hs α)) @@ -162,6 +163,7 @@ def forwardInitializedPressureWitness (N : ℕ) (κ : ℝ) : /-- Forward initialized coordinate pressure field, given by `pressureField D k hk ((forwardInitializedPressureWitness M D hTime δ hδ ξ hs α N k⁻¹).changeTime hTime)`. -/ +@[expose] def forwardInitializedCoordinatePressureField (N : ℕ) (k : ℝ) (hk : k ≠ 0) : Field period D.T (coordinatePressure D k (forwardInitializedPressure M D δ hδ ξ hs α N k⁻¹)) := @@ -181,7 +183,7 @@ end end -@[expose] public section +public section noncomputable section @@ -214,11 +216,12 @@ 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 (forwardInitializedVelocity M D δ hδ ξ hs α N κ)`. -/ +@[expose] def forwardInitializedVelocityField (N : ℕ) (κ : ℝ) : Field period D.T (forwardInitializedVelocity M D δ hδ ξ hs α N κ) := (ProfileRegularity.velocityField M.T_pos @@ -226,12 +229,14 @@ def forwardInitializedVelocityField (N : ℕ) (κ : ℝ) : hTime /-- Forward initialized velocity derivative, constructed using `fieldSum`. -/ +@[expose] def forwardInitializedVelocityDerivative (N : ℕ) (κ : ℝ) : VectorField := fieldSum (N+1) κ (ProfileRegularity.velocityTimeCoefficients (T := M.T) (N := N) (a := forwardInitializedProfiles M D δ hδ ξ hs α)) /-- Forward initialized velocity derivative field as an element of `Field period D.T (forwardInitializedVelocityDerivative M D δ hδ ξ hs α N κ)`. -/ +@[expose] def forwardInitializedVelocityDerivativeField (N : ℕ) (κ : ℝ) : Field period D.T (forwardInitializedVelocityDerivative M D δ hδ ξ hs α N κ) := (ProfileRegularity.velocityDerivativeField M.T_pos @@ -296,6 +301,7 @@ theorem forwardInitializedCorrectionData_eq_coordinate (Cagree : SourceCoefficie /-- The actual finite pressure and every-order residual identity, with no assumed pressure field, approximation derivative or residual cancellation. -/ +@[expose] def forwardInitializedApproximationResidual (Cagree : SourceCoefficientAgreement M D) (N : ℕ) (hN : 1 ≤ N) (k : ℝ) (hk : 4 ≤ k) : ApproximationResidual period D.T_pos diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardOutputCosts.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardOutputCosts.lean index 94ad5e4d6e..9bc21e74d2 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 @@ -45,6 +45,7 @@ open Set InnerProductSpace ContinuousLinearMap EulerSmoothLimit EulerSpatialCuto open scoped ContDiff /-- Forward initialized global shear cost as an element of `ℝ`. -/ +@[expose] def forwardInitializedGlobalShearCost (R H0 C : ℝ) : ℝ := ‖coordinateEquiv.symm.toContinuousLinearMap‖* (sobolevEmbeddingConstant period 3*fixedVelocityGradeCost R H0 1*(4*R))*C + @@ -174,7 +175,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..105c50dbe6 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 @@ -52,9 +52,11 @@ theorem forcing_path_zero : (forcing (P := P) D).path = 0 := by rfl /-- Profile, given by `homogeneousPrimary D Y O`. -/ +@[expose] def profile (O : Operators) : Profile := homogeneousPrimary D Y O /-- Regularity, given by `homogeneousPrimaryRegularity D Y O hcorrector`. -/ +@[expose] def regularity (O : Operators) (hcorrector : O.curlCorrector = D.curlCorrector P) : ProfileRegularity P D.T D.T_pos.le D.support (profile D Y O) := homogeneousPrimaryRegularity D Y O hcorrector @@ -98,11 +100,13 @@ variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteS (hs : tsupport innerCutoff ⊆ D.support) /-- Forward primary, given by `EulerPacketForwardPrimary.profile D (initialData D δ hδ ξ hs) O`. -/ +@[expose] def forwardPrimary (O : Operators) : Profile := EulerPacketForwardPrimary.profile D (initialData D δ hδ ξ hs) O /-- Forward primary regularity, given by `EulerPacketForwardPrimary.regularity D (initialData D δ hδ ξ hs) O hcorrector`. -/ +@[expose] def forwardPrimaryRegularity (O : Operators) (hcorrector : O.curlCorrector = D.curlCorrector period) : ProfileRegularity period D.T D.T_pos.le D.support (forwardPrimary D δ hδ ξ hs O) := 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..7a6f03b9fe 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 @@ -126,6 +126,7 @@ variable {M : EulerMeanPacketProvider.Data} {Rm Tc : ℝ} {O : Operators} /-- Canonical radius, given by `EulerPacketForwardCommonRadius.commonRadius LM L N BC (wordCost (Fin 4) 6 δ*‖ξ‖) (wordRadius (Fin 4) δ)`. -/ +@[expose] def canonicalRadius : ℝ := EulerPacketForwardCommonRadius.commonRadius LM L N BC (wordCost (Fin 4) 6 δ*‖ξ‖) (wordRadius (Fin 4) δ) diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardRemainder.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardRemainder.lean index a1808a0b48..2d2eb2b2e9 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) @@ -121,6 +121,7 @@ theorem forwardInitializedPrimaryRemainder_physical_fderiv (N : ℕ) (hN : 1 ≤ omit 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. -/ +@[expose] def forwardInitializedRemainderDerivativeCost (R H0 : ℝ) : ℝ := 8*‖coordinateEquiv.symm.toContinuousLinearMap‖*sobolevEmbeddingConstant period 3 * R*(fixedVelocityGradeCost R H0 2+2) 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/PacketForwardSuccessor.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardSuccessor.lean index 001fb94ef4..dbffe41b27 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardSuccessor.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardSuccessor.lean @@ -123,23 +123,44 @@ theorem forwardPhysicalBounds (t : Icc (0 : ℝ) (F).parent.T) (x : Space) : /-- The forward choice's parent, state, low bounds, physical bounds and renewed frame, with the guards' shear, spike and `earlyRatio`. -/ -@[expose] def forwardStep : P.Step where +@[expose] def forwardStep (hq : requiredExponent ≤ q) + (hB : commonThreshold gradientConstant hessianConstant ≤ B) : P.Step where parent := P.forwardParent hq hB state := P.forwardState hq hB - targetShear := (G).hchild - spikeAmplitude := (G).δ - errorRatio := (G).earlyRatio - errorRatio_nonneg := (G).earlyRatio_nonneg + targetShear := (P.forwardGuards hq hB).hchild + spikeAmplitude := (P.forwardGuards hq hB).δ + errorRatio := (P.forwardGuards hq hB).earlyRatio + errorRatio_nonneg := (P.forwardGuards hq hB).earlyRatio_nonneg targetShear_eq := P.forwardGuards_shear hq hB parent_horizon := rfl parent_scale := rfl - label_eq := (F).label_constant + label_eq := (P.chooseForward hq hB).label_constant low := P.forwardLow hq hB - low_exterior := rfl - low_core := rfl - low_pressure := rfl - low_boundary := rfl - low_radius := rfl + low_exterior := by + have h := (P.chooseForward hq hB).lowBounds_values _ _ + P.restricted_gradient_bound P.restricted_hessian_bound + (P.forward_smallness hq hB) + exact h.1 + low_core := by + have h := (P.chooseForward hq hB).lowBounds_values _ _ + P.restricted_gradient_bound P.restricted_hessian_bound + (P.forward_smallness hq hB) + exact h.2.1 + low_pressure := by + have h := (P.chooseForward hq hB).lowBounds_values _ _ + P.restricted_gradient_bound P.restricted_hessian_bound + (P.forward_smallness hq hB) + exact h.2.2.1 + low_boundary := by + have h := (P.chooseForward hq hB).lowBounds_values _ _ + P.restricted_gradient_bound P.restricted_hessian_bound + (P.forward_smallness hq hB) + exact h.2.2.2.2 + low_radius := by + have h := (P.chooseForward hq hB).lowBounds_values _ _ + P.restricted_gradient_bound P.restricted_hessian_bound + (P.forward_smallness hq hB) + exact h.2.2.2.1.trans P.restrictedLow_radius physical_bounds := P.forwardPhysicalBounds hq hB bad_cost := P.forward_bad_cost hq hB pressure_cost := P.forward_pressure_cost hq hB @@ -147,7 +168,7 @@ frame, with the guards' shear, spike and `earlyRatio`. -/ geometry_targetTime := P.forwardGeometry_targetTime hq hB geometry_coupling := P.forwardFrame_a geometry_y := rfl - geometry_delta_pos := (I).delta_pos + geometry_delta_pos := (P.forwardInput hq hB).delta_pos geometry_shear := rfl renewal_errors := P.forward_renewal_errors hq hB renewal := P.forwardRenewal hq hB @@ -156,7 +177,9 @@ frame, with the guards' shear, spike and `earlyRatio`. -/ renewal_error := rfl /-- Assemble the forward packet using the shared successor invariant. -/ -@[expose] def forwardNext : Stage S 1 := P.next (P.forwardStep hq hB) +@[expose] def forwardNext (hq : requiredExponent ≤ q) + (hB : commonThreshold gradientConstant hessianConstant ≤ B) : Stage S 1 := + P.next (P.forwardStep hq hB) theorem forwardNext_time : (P.forwardNext hq hB).time=P.nextTime := rfl diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardUniformBudget.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardUniformBudget.lean index 47b403e797..b4b6266fc8 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 @@ -49,6 +49,7 @@ variable (M : EulerMeanPacketProvider.Data) (hdet : ∀ t x, (EulerPacketPiola.operatorMatrix (D.F.field t x)).det = 1) /-- Forward uniform budget used in packet forward uniform budget. -/ +@[expose] def forwardUniformBudget : EulerAllOrderDriftCorrection.Budget period D.T_pos (forwardInitializedCorrectionData M D hTime δ hδ ξ hs α Cagree (truncation k) (truncation_bounds k (by linarith)).1 k hk) := by @@ -74,14 +75,14 @@ def forwardUniformBudget : EulerAllOrderDriftCorrection.Budget period D.T_pos theorem forwardUniformBudget_delta : (forwardUniformBudget M D hTime δ hδ hδ1 ξ hs α hα L NB LM Cagree - W hW hprofile k hk hX hlog hfrequency Ξ hΞ hF hdet).delta=delta (expansion k) := rfl + W hW hprofile k hk hX hlog hfrequency Ξ hΞ hF hdet).delta=delta (expansion k) := by rfl theorem forwardUniformBudget_initialRadius : (forwardUniformBudget M D hTime δ hδ hδ1 ξ hs α hα L NB LM Cagree W hW hprofile k hk hX hlog hfrequency Ξ hΞ hF hdet).initialRadius = initialRadius (forwardInitializedRadius LM L NB (forwardCoefficientBudget period M D hTime NB) δ ξ) - (L.correctionCoefficients NB period).M (L.correctionCoefficients NB period).Rc := rfl + (L.correctionCoefficients NB period).M (L.correctionCoefficients NB period).Rc := by rfl open EulerPacketCorrectionOutput EulerSobolevGevreyOperators EulerAllOrderDriftCorrection 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..2c2ecb5c2c 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 @@ -251,6 +251,7 @@ variable (P : ℝ) [Fact (0 < P)] (M : EulerMeanPacketProvider.Data) /-- Forward source primary witness, given by `(homogeneousPrimaryRegularity D Y (sourceOperators P M D (InitialData.zero P D)) rfl).changeTime hTime.symm M.T_pos.le`. -/ +@[expose] def forwardSourcePrimaryWitness : ProfileRegularity P M.T M.T_pos.le D.support (homogeneousPrimary D Y (sourceOperators P M D (InitialData.zero P D))) := diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketFrameCoefficients.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketFrameCoefficients.lean index 5254c109b1..1b66044537 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 @@ -136,6 +136,7 @@ theorem frameMatrixRate_abs_le (B B₁ : Space →L[ℝ] Space) (p q : Space) nlinarith only [h1, h2, h3, h4, h5, hB₁j, hBr] /-- Primary shear, given by `c*(‖m t‖*‖v t‖)`. -/ +@[expose] def primaryShear (c : ℝ) (m v : ℝ → Space) (t : ℝ) : ℝ := c*(‖m t‖*‖v t‖) /-- In particular, the logarithmic shear law in source (23) holds for the 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..4dd0bfd0cf 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 @@ -33,6 +33,7 @@ namespace EulerPacketMovingFrame open Set Real EulerSmoothLimit EulerPacketGrowth /-- Primary amplitude, given by `δ*hchild/(‖r t‖*‖w t‖)`. -/ +@[expose] def primaryAmplitude (δ hchild : ℝ) (r w : ℝ → Space) (t : ℝ) : ℝ := δ*hchild/(‖r t‖*‖w t‖) @@ -100,7 +101,7 @@ end end -@[expose] public section +public section noncomputable section @@ -210,57 +211,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..74543efedb 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] @@ -96,10 +96,12 @@ variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteS /-- Low geometry, given by `A.geometryData {x | ‖x‖ ≤ (1/2 : ℝ)} (by norm_num) (fun _ hx => hx.trans hball)`. -/ +@[expose] def lowGeometry : PhysicalGeometryData {x : Space // ‖x‖ ≤ (1/2 : ℝ)} := A.geometryData {x | ‖x‖ ≤ (1/2 : ℝ)} (by norm_num) (fun _ hx => hx.trans hball) /-- Primary amplitude, given by `(A.lowGeometry hball).amplitude`. -/ +@[expose] def primaryAmplitude : ℝ := (A.lowGeometry hball).amplitude theorem primaryAmplitude_nonneg : 0 ≤ A.primaryAmplitude hball := @@ -217,7 +219,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..eb53644e42 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 @@ -30,6 +30,7 @@ variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] {F F₁ Z Z₁ : ℝ → ℝ} (H : PhysicalGeometryConclusion G F F₁ Z Z₁) /-- Growth profile, bundling `toFun`, `continuous_toFun`. -/ +@[expose] def growthProfile : C(Icc (0 : ℝ) D.T,ℝ) where toFun t := Z ((G.a/G.ε)*t) continuous_toFun := (continuous_iff_continuousAt.mpr @@ -52,6 +53,7 @@ theorem growthProfile_pos (hhorizon : G.time G.H = G.t₀ + D.T) exact ⟨by linarith [t.property.1],by linarith [t.property.2]⟩ /-- Growth constant, given by `560*G.Θ^10/G.ε`. -/ +@[expose] def growthConstant : ℝ := 560*G.Θ^10/G.ε theorem growthConstant_pos : 0 < growthConstant G := by diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketGevreyProfileChoice.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketGevreyProfileChoice.lean index 7b1589c5eb..365fc9a3fa 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 @@ -45,7 +45,7 @@ theorem high_timeProfile_eq {T T' : ℝ} (S : Scales (Icc (0 : ℝ) T)) /-- Of time profile, given by `ofGrowth (α • timeProfileChange g h) (fun t => mul_pos hα (timeProfileChange_pos g hg h t))`. -/ -def ofTimeProfile {T T' : ℝ} (g : C(Icc (0 : ℝ) T, ℝ)) (hg : ∀ t, 0 < g t) +@[expose] def ofTimeProfile {T T' : ℝ} (g : C(Icc (0 : ℝ) T, ℝ)) (hg : ∀ t, 0 < g t) (h : T = T') (α : ℝ) (hα : 0 < α) : Scales (Icc (0 : ℝ) T') := ofGrowth (α • timeProfileChange g h) (fun t => mul_pos hα (timeProfileChange_pos g hg h t)) 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..38b2f8a61f 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 @@ -231,7 +231,7 @@ open Real Filter EulerScale EulerBaseDatum EulerPacketLowConstants open scoped Topology /-- Geometry constant, given by `neighborStabilityConstant*frameConstant^2`. -/ -def geometryConstant : ℝ := neighborStabilityConstant*frameConstant^2 +@[expose] def geometryConstant : ℝ := neighborStabilityConstant*frameConstant^2 theorem geometryConstant_one : 1 ≤ geometryConstant := by have hn : 1 ≤ neighborStabilityConstant := by @@ -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/PacketInfiniteConstruction.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketInfiniteConstruction.lean index 300b57f4f4..9a99458ad3 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketInfiniteConstruction.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketInfiniteConstruction.lean @@ -132,23 +132,44 @@ theorem joinedPhysicalBounds (t : Icc (0 : ℝ) (F).parent.T) (x : Space) : /-- The joined choice's parent, state, low bounds, physical bounds and renewed frame, with the guards' shear, spike and `badRatio`. -/ -@[expose] def joinedStep : P.Step where +@[expose] def joinedStep (hn : n ≠ 0) (hq : requiredExponent ≤ q) + (hB : commonThreshold gradientConstant hessianConstant ≤ B) : P.Step where parent := P.joinedParent hn hq hB state := P.joinedState hn hq hB - targetShear := (G).hchild - spikeAmplitude := (G).δ - errorRatio := (G).badRatio - errorRatio_nonneg := (G).badRatio_nonneg + targetShear := (P.joinedGuards hn hq hB).hchild + spikeAmplitude := (P.joinedGuards hn hq hB).δ + errorRatio := (P.joinedGuards hn hq hB).badRatio + errorRatio_nonneg := (P.joinedGuards hn hq hB).badRatio_nonneg targetShear_eq := P.joinedGuards_shear hn hq hB parent_horizon := rfl parent_scale := rfl - label_eq := (F).label_constant + label_eq := (P.chooseJoined hn hq hB).label_constant low := P.joinedLow hn hq hB - low_exterior := rfl - low_core := rfl - low_pressure := rfl - low_boundary := rfl - low_radius := rfl + low_exterior := by + have h := (P.chooseJoined hn hq hB).lowBounds_values _ _ + P.restricted_gradient_bound P.restricted_hessian_bound + (P.joined_smallness hn hq hB) + exact h.1 + low_core := by + have h := (P.chooseJoined hn hq hB).lowBounds_values _ _ + P.restricted_gradient_bound P.restricted_hessian_bound + (P.joined_smallness hn hq hB) + exact h.2.1 + low_pressure := by + have h := (P.chooseJoined hn hq hB).lowBounds_values _ _ + P.restricted_gradient_bound P.restricted_hessian_bound + (P.joined_smallness hn hq hB) + exact h.2.2.1 + low_boundary := by + have h := (P.chooseJoined hn hq hB).lowBounds_values _ _ + P.restricted_gradient_bound P.restricted_hessian_bound + (P.joined_smallness hn hq hB) + exact h.2.2.2.2 + low_radius := by + have h := (P.chooseJoined hn hq hB).lowBounds_values _ _ + P.restricted_gradient_bound P.restricted_hessian_bound + (P.joined_smallness hn hq hB) + exact h.2.2.2.1.trans P.restrictedLow_radius physical_bounds := P.joinedPhysicalBounds hn hq hB bad_cost := P.joined_bad_cost hn hq hB pressure_cost := P.joined_pressure_cost hn hq hB @@ -156,7 +177,7 @@ frame, with the guards' shear, spike and `badRatio`. -/ geometry_targetTime := P.joinedGeometry_targetTime hn hq hB geometry_coupling := P.joinedFrame_a hn geometry_y := rfl - geometry_delta_pos := (I).delta_pos + geometry_delta_pos := (P.joinedInput hn hq hB).delta_pos geometry_shear := rfl renewal_errors := P.joined_renewal_errors hn hq hB renewal := P.joinedRenewal hn hq hB @@ -165,7 +186,9 @@ frame, with the guards' shear, spike and `badRatio`. -/ renewal_error := rfl /-- Assemble the joined packet using the shared successor invariant. -/ -@[expose] def joinedNext : Stage S (n+1) := P.next (P.joinedStep hn hq hB) +@[expose] def joinedNext (hn : n ≠ 0) (hq : requiredExponent ≤ q) + (hB : commonThreshold gradientConstant hessianConstant ≤ B) : Stage S (n+1) := + P.next (P.joinedStep hn hq hB) theorem joinedNext_time : (P.joinedNext hn hq hB).time=P.nextTime := rfl diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketInitialFields.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketInitialFields.lean index a0b443ff75..f0bfac8e34 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 @@ -33,11 +33,11 @@ variable {K E : Type*} [TopologicalSpace K] [CompactSpace K] [NormedAddCommGroup E] [NormedSpace ℝ E] /-- Freeze path, given by `(ContinuousLinearMap.const ℝ K).comp (ContinuousMap.evalCLM ℝ t)`. -/ -def freezePath (t : K) : C(K,E) →L[ℝ] C(K,E) := +@[expose] def freezePath (t : K) : C(K,E) →L[ℝ] C(K,E) := (ContinuousLinearMap.const ℝ K).comp (ContinuousMap.evalCLM ℝ t) omit [CompactSpace K] in -@[simp] theorem freezePath_apply (t s : K) (p : C(K, E)) : freezePath t p s = p t := rfl +@[simp] theorem freezePath_apply (t s : K) (p : C(K, E)) : freezePath t p s = p t := by rfl theorem freezePath_norm (t : K) : ‖freezePath (E := E) t‖ ≤ 1 := by apply ContinuousLinearMap.opNorm_le_bound _ zero_le_one @@ -65,7 +65,7 @@ theorem freezePath_translate (t : Icc (0 : ℝ) T) (p : C(Icc (0 : ℝ) T, LiftL rfl /-- Freeze, constructed using `ofLifted`. -/ -def freeze (G : Field P T raw) (t : Icc (0 : ℝ) T) : +@[expose] def freeze (G : Field P T raw) (t : Icc (0 : ℝ) T) : Field P T (fun z => raw (t,z.2)) := ofLifted (freezePath t G.path) (by @@ -81,7 +81,7 @@ def freeze (G : Field P T raw) (t : Icc (0 : ℝ) T) : (fun _ x θ => G.raw_eq t x θ) @[simp] theorem freeze_path (G : Field P T raw) (t : Icc (0 : ℝ) T) : - (G.freeze t).path = freezePath t G.path := rfl + (G.freeze t).path = freezePath t G.path := by rfl theorem WordBound.freeze {G : Field P T raw} {q d : ℕ} {R A : ℝ} (hG : G.WordBound q R A d) (t : Icc (0 : ℝ) T) : @@ -147,7 +147,7 @@ end end -@[expose] public section +public section noncomputable section @@ -157,23 +157,24 @@ 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)`. -/ +@[expose] 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)`. -/ -def high (N : ℕ) (κ t : ℝ) (a : ℕ → Profile) : VectorField := +@[expose] def high (N : ℕ) (κ t : ℝ) (a : ℕ → Profile) : VectorField := fieldSum (N+1) κ (highGrade N t a) /-- Mean, given by `fieldSum (N+1) κ (meanGrade N t a)`. -/ -def mean (N : ℕ) (κ t : ℝ) (a : ℕ → Profile) : VectorField := +@[expose] def mean (N : ℕ) (κ t : ℝ) (a : ℕ → Profile) : VectorField := fieldSum (N+1) κ (meanGrade N t a) theorem high_eq (N : ℕ) (κ t : ℝ) (a : ℕ → Profile) : @@ -206,24 +207,24 @@ variable {P T : ℝ} [Fact (0 < P)] {hT : 0 ≤ T} {N : ℕ} /-- High grade field, given by `Field.assembleFamily N _ _ (fun i hi => (G i hi).high.freeze t) (fun i hi => (G i hi).corrector.freeze t) n`. -/ -def highGradeField (G : ∀ i, i ≤ N → ProfileRegularity P T hT support (a i)) +@[expose] def highGradeField (G : ∀ i, i ≤ N → ProfileRegularity P T hT support (a i)) (t : Icc (0 : ℝ) T) (n : ℕ) : Field P T (highGrade N t a n) := Field.assembleFamily N _ _ (fun i hi => (G i hi).high.freeze t) (fun i hi => (G i hi).corrector.freeze t) n /-- Mean grade field, given by `Field.truncateFamily N _ (fun i hi => (G i hi).mean.freeze t) n`. -/ -def meanGradeField (G : ∀ i, i ≤ N → ProfileRegularity P T hT support (a i)) +@[expose] def meanGradeField (G : ∀ i, i ≤ N → ProfileRegularity P T hT support (a i)) (t : Icc (0 : ℝ) T) (n : ℕ) : Field P T (meanGrade N t a n) := Field.truncateFamily N _ (fun i hi => (G i hi).mean.freeze t) n /-- High field, given by `Field.evaluateFamily (N+1) κ _ (highGradeField G t)`. -/ -def highField (G : ∀ i, i ≤ N → ProfileRegularity P T hT support (a i)) +@[expose] def highField (G : ∀ i, i ≤ N → ProfileRegularity P T hT support (a i)) (t : Icc (0 : ℝ) T) (κ : ℝ) : Field P T (high N κ t a) := Field.evaluateFamily (N+1) κ _ (highGradeField G t) /-- Mean field, given by `Field.evaluateFamily (N+1) κ _ (meanGradeField G t)`. -/ -def meanField (G : ∀ i, i ≤ N → ProfileRegularity P T hT support (a i)) +@[expose] def meanField (G : ∀ i, i ≤ N → ProfileRegularity P T hT support (a i)) (t : Icc (0 : ℝ) T) (κ : ℝ) : Field P T (mean N κ t a) := Field.evaluateFamily (N+1) κ _ (meanGradeField G t) 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..3da52a4977 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 @@ -357,13 +357,13 @@ variable (M : EulerMeanPacketProvider.Data) /-- Initialized initial high, given by `scale M.ℓ (fun x => EulerPacketInitial.high N k⁻¹ 0 (initializedProfiles M D τ hτ hτT B δ hδ ξ hs α) (0,(x,k*inner ℝ D.m₀ x)))`. -/ -def initializedInitialHigh (N : ℕ) (k : ℝ) : Space → Space := +@[expose] def initializedInitialHigh (N : ℕ) (k : ℝ) : Space → Space := scale M.ℓ (fun x => EulerPacketInitial.high N k⁻¹ 0 (initializedProfiles M D τ hτ hτT B δ hδ ξ hs α) (0,(x,k*inner ℝ D.m₀ x))) /-- Initialized initial mean, given by `scale M.ℓ (fun x => EulerPacketInitial.mean N k⁻¹ 0 (initializedProfiles M D τ hτ hτT B δ hδ ξ hs α) (0,(x,k*inner ℝ D.m₀ x)))`. -/ -def initializedInitialMean (N : ℕ) (k : ℝ) : Space → Space := +@[expose] def initializedInitialMean (N : ℕ) (k : ℝ) : Space → Space := scale M.ℓ (fun x => EulerPacketInitial.mean N k⁻¹ 0 (initializedProfiles M D τ hτ hτT B δ hδ ξ hs α) (0,(x,k*inner ℝ D.m₀ x))) @@ -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 @@ -1157,7 +1157,7 @@ variable (M : EulerMeanPacketProvider.Data) (δ : ℝ) (hδ : 0 < δ) (ξ : U) (hs : tsupport innerCutoff ⊆ D.support) (α : ℝ) /-- Initialized initial high field, bundling `field`, `smooth`, `let`, `integrable`. -/ -def initializedInitialHighField (N : ℕ) (k : ℝ) : SmoothL2Field Space where +@[expose] def initializedInitialHighField (N : ℕ) (k : ℝ) : SmoothL2Field Space where field := initializedInitialHigh M D τ hτ hτT B δ hδ ξ hs α N k smooth := by let G := EulerPacketInitial.highField @@ -1167,7 +1167,7 @@ def initializedInitialHighField (N : ℕ) (k : ℝ) : SmoothL2Field Space where integrable n := initializedInitialHigh_memLp M D hTime τ hτ hτT B δ hδ ξ hs α N n k /-- Initialized initial mean field, bundling `field`, `smooth`, `let`, `integrable`. -/ -def initializedInitialMeanField (N : ℕ) (k : ℝ) : SmoothL2Field Space where +@[expose] def initializedInitialMeanField (N : ℕ) (k : ℝ) : SmoothL2Field Space where field := initializedInitialMean M D τ hτ hτT B δ hδ ξ hs α N k smooth := by let G := EulerPacketInitial.meanField @@ -1191,7 +1191,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1264,37 +1264,39 @@ abbrev history : HistoryData (A.data.initial A.historyTime A.history_pos A.histo A.historyTime A.history_pos A.history_lt /-- Parameter size, constructed using `A.label.geometryParameterSize`. -/ -def parameterSize : ℝ := A.label.geometryParameterSize A.low A.normal A.normal_unit A.coordinates +@[expose] def parameterSize : ℝ := + A.label.geometryParameterSize A.low A.normal A.normal_unit A.coordinates A.support A.support_compact A.historyTime A.history_pos A.history_lt A.frame A.geometry A.historyTime⁻¹ A.parent.T⁻¹ A.terminal /-- Alpha, given by `A.geometry.primaryAmplitude A.halfBall`. -/ -def alpha : ℝ := A.geometry.primaryAmplitude A.halfBall +@[expose] def alpha : ℝ := A.geometry.primaryAmplitude A.halfBall theorem alpha_pos : 0 < A.alpha := A.geometry.primaryAmplitude_pos A.halfBall A.delta_pos A.child_pos /-- Frequency guard, given by `frequencyConstant*A.parameterSize^frequencyPower ≤ smallPower k`. -/ -def frequencyGuard (k : ℝ) : Prop := frequencyConstant*A.parameterSize^frequencyPower ≤ smallPower k +@[expose] def frequencyGuard (k : ℝ) : Prop := + frequencyConstant*A.parameterSize^frequencyPower ≤ smallPower k /-- High, constructed using `initializedInitialHigh`. -/ -def high (k : ℝ) : Space → Space := +@[expose] def high (k : ℝ) : Space → Space := initializedInitialHigh A.meanData A.data A.historyTime A.history_pos A.history_lt A.history A.geometry.δ A.delta_pos A.terminal A.cutoff_support A.alpha (truncation k) k /-- Mean, constructed using `initializedInitialMean`. -/ -def mean (k : ℝ) : Space → Space := +@[expose] def mean (k : ℝ) : Space → Space := initializedInitialMean A.meanData A.data A.historyTime A.history_pos A.history_lt A.history A.geometry.δ A.delta_pos A.terminal A.cutoff_support A.alpha (truncation k) k /-- High field, constructed using `initializedInitialHighField`. -/ -def highField (k : ℝ) : SmoothL2Field Space := +@[expose] def highField (k : ℝ) : SmoothL2Field Space := initializedInitialHighField A.meanData A.data rfl A.historyTime A.history_pos A.history_lt A.history A.geometry.δ A.delta_pos A.terminal A.cutoff_support A.alpha (truncation k) k /-- Mean field, constructed using `initializedInitialMeanField`. -/ -def meanField (k : ℝ) : SmoothL2Field Space := +@[expose] def meanField (k : ℝ) : SmoothL2Field Space := initializedInitialMeanField A.meanData A.data rfl A.historyTime A.history_pos A.history_lt A.history A.geometry.δ A.delta_pos A.terminal A.cutoff_support A.alpha (truncation k) k 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..1ad26ad8a1 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 @@ -109,7 +109,7 @@ variable {U : Type} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteSp /-- Increment, given by `addField (A.highField k) (A.meanField k)`. -/ def increment (k : ℝ) : SmoothL2Field Space := addField (A.highField k) (A.meanField k) -theorem increment_field (k : ℝ) : (A.increment k).field=A.high k+A.mean k := rfl +theorem increment_field (k : ℝ) : (A.increment k).field=A.high k+A.mean k := by rfl theorem increment_norm_le (k : ℝ) (s : ℕ) : tensorNorm s (A.increment k) ≤ derivativeSum s (A.high k)+derivativeSum s (A.mean k) := by @@ -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 : ℕ) : @@ -175,7 +175,7 @@ theorem initialLimit_compact : HasCompactSupport (V).field := (initialLimit_support A J hJ C c hC hc p q X hX hparameter hscale hσ hk hfrequency) /-- Full initial limit, given by `addField base V`. -/ -def fullInitialLimit (base : SmoothL2Field Space) : SmoothL2Field Space := addField base V +@[expose] def fullInitialLimit (base : SmoothL2Field Space) : SmoothL2Field Space := addField base V theorem fullInitialLimit_Hm (base : SmoothL2Field Space) (s : ℕ) : Tendsto (fun N => derivativeSum s ((base.field+initialPartial A J X 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..6201cb90fa 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 @@ -149,6 +149,7 @@ variable (M : EulerMeanPacketProvider.Data) (N : ℕ) (hN : 1 ≤ N) (k : ℝ) (hk : 4 ≤ k) /-- Initialized metric budget, constructed using `sourceMetricBudgetOfFields`. -/ +@[expose] def initializedMetricBudget (q : ℕ) : MetricBudget period D.T D.T_pos.le ((initializedCorrectionData M D hTime τ hτ hτT B δ hδ ξ hs α Cagree N hN k hk).atOrder period @@ -182,6 +183,7 @@ variable /-- All four field estimates and all coefficient estimates are actual properties of the initialized source data at this finite Sobolev order. -/ +@[expose] def initializedSpatialBudget (q : ℕ) (hq : 6 ≤ q) : SpatialBudget period (by omega : 6 ≤ (q+1)+1) ((initializedCorrectionData M D hTime τ hτ hτT B δ hδ ξ hs α Cagree N hN k hk).atOrder period @@ -230,6 +232,7 @@ def initializedSpatialBudget (q : ℕ) (hq : 6 ≤ q) : X hcoef hX hNX ((q+1)+1) (q-4) (by omega) (ρ t) (hρ t) (hpacket t) t /-- The small drift envelope is kept separate from the full background. -/ +@[expose] def initializedDriftBudget (q : ℕ) (hq : 6 ≤ q) : EulerDriftCorrectionBudget.Budget period (by omega : 6 ≤ (q+1)+1) ((initializedCorrectionData M D hTime τ hτ hτT B δ hδ ξ hs α Cagree N hN k hk).atOrder period @@ -256,7 +259,7 @@ theorem initializedDriftBudget_growth (q : ℕ) (hq : 6 ≤ q) : period D.T_pos.le (initializedMetricBudget M D hTime τ hτ hτT B δ hδ ξ hs α Cagree N hN k hk 0) (q+1)) = growthCoefficient D period Kc (2*velocity L.R S.H0 BC.multiplierCost) - (12*velocity L.R S.H0 BC.multiplierCost*(4*L.R)) := rfl + (12*velocity L.R S.H0 BC.multiplierCost*(4*L.R)) := by rfl end EulerPacketTerminalDatum @@ -270,7 +273,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 +332,7 @@ end end -@[expose] public section +public section noncomputable section @@ -342,6 +345,7 @@ variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] (Kc : CorrectionCoefficientBudget D P) /-- Growth, given by `growthCoefficient D P Kc (2*velocity R H C) (12*velocity R H C*(4*R))`. -/ +@[expose] def growth (R H C : ℝ) : ℝ := growthCoefficient D P Kc (2*velocity R H C) (12*velocity R H C*(4*R)) @@ -388,6 +392,7 @@ local notation "ρg" => initialRadius L.R Kc.M Kc.Rc /-- Explicit scalar guards suffice because every analytic input to the all-order correction theorem is supplied by the constructed packet. -/ +@[expose] def initializedAllOrderBudget (k : ℝ) (hk : 4 ≤ k) (hX : 64 ≤ expansion k) (hlog : 1 ≤ Real.log k) (htail : tailPolynomialConstant L.R S.H0 BC.termCost ≤ smallPower k) 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..e2e295b35c 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 @@ -148,6 +148,7 @@ variable (P : ℝ) [Fact (0 < P)] (M : EulerMeanPacketProvider.Data) (primary : Profile) (hprimary : ProfileRegularity P M.T M.T_pos.le D.support primary) /-- Joined packet pullback field used in packet joined source solenoidal. -/ +@[expose] def joinedPacketPullbackField (N : ℕ) (κ : ℝ) : Field P M.T (fun z => (joinedSourceOperators P M D τ hτ hτT B).inverseFrame z (fieldSum (N+1) κ (assembledVelocity N (joinedSourceProfiles P M D τ hτ hτT B primary)) z)) @@ -183,7 +184,8 @@ def joinedPacketPullbackField (N : ℕ) (κ : ℝ) : theorem joinedPacketPullbackField_path (N : ℕ) (κ : ℝ) : (joinedPacketPullbackField P M D hT τ hτ hτT B primary hprimary N κ).path = ∑ i ∈ range N, ((joinedPairField P M D hT τ hτ hτT B primary hprimary κ (i+1)).path + - κ^(i+1) • (joinedMeanPullbackField P M D hT τ hτ hτT B primary hprimary (i+1)).path) := rfl + κ^(i+1) • (joinedMeanPullbackField P M D hT τ hτ hτT B primary hprimary (i+1)).path) := by + rfl theorem joinedPacketPullbackField_mem (hmean : primary.mean = 0) @@ -231,7 +233,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 +313,7 @@ end end -@[expose] public section +public section noncomputable section @@ -350,9 +352,10 @@ def joinedLiteralTailGradeField (N n : ℕ) (hn : N + 1 ≤ n) : theorem joinedLiteralTailGradeField_path (N n : ℕ) (hn : N + 1 ≤ n) : (joinedLiteralTailGradeField P M D hT τ hτ hτT B primary hprimary N n hn).path = - (joinedTailGradeField P M D hT τ hτ hτT B primary hprimary N n hn).path := rfl + (joinedTailGradeField P M D hT τ hτ hτT B primary hprimary N n hn).path := by rfl /-- Joined tail sum field, constructed using `ProfileRegularity.tailSumField`. -/ +@[expose] def joinedTailSumField (N : ℕ) (κ : ℝ) : Field P M.T (fun z => ∑ n ∈ Ico (N+1) (2*N+3), κ^n • recursiveGrade (joinedSourceOperators P M D τ hτ hτT B) N @@ -363,6 +366,7 @@ def joinedTailSumField (N : ℕ) (κ : ℝ) : omit primary hprimary in /-- Joined residual field used in packet joined residual fields. -/ +@[expose] def joinedResidualField (A : VectorField) (π : ScalarField) (hprimary : ProfileRegularity P M.T M.T_pos.le D.support (primaryProfile (joinedSourceOperators P M D τ hτ hτT B) A π)) @@ -395,7 +399,7 @@ section /-! Exponential residual bounds for the actual recursively solved joined packet. -/ -@[expose] public section +public section noncomputable section @@ -485,7 +489,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 +568,7 @@ end end -@[expose] public section +public section noncomputable section @@ -582,12 +586,14 @@ variable (M : EulerMeanPacketProvider.Data) (hs : tsupport innerCutoff ⊆ D.support) (α : ℝ) /-- Initialized packet field, constructed using `joinedPacketPullbackField`. -/ +@[expose] def initializedPacketField (N : ℕ) (κ : ℝ) := joinedPacketPullbackField period M D hTime τ hτ hτT B (joinedTerminalPrimary period M D τ hτ hτT B (initialData D δ hδ (α • ξ) hs)) (joinedTerminalPrimaryWitness period M D hTime τ hτ hτT B (initialData D δ hδ (α • ξ) hs)) N κ /-- Initialized residual field, constructed using `joinedResidualField`. -/ +@[expose] def initializedResidualField (Cagree : SourceCoefficientAgreement M D) (N : ℕ) (hN : 1 ≤ N) (κ : ℝ) (hκ : κ ≠ 0) := joinedResidualField period M D hTime τ hτ hτT B @@ -668,7 +674,7 @@ end end -@[expose] public section +public section noncomputable section @@ -687,10 +693,12 @@ variable (M : EulerMeanPacketProvider.Data) /-- Initialized normalized field, given by `((initializedPacketField M D hTime τ hτ hτT B δ hδ ξ hs α N k⁻¹).smul k).changeTime hTime`. -/ +@[expose] def initializedNormalizedField (N : ℕ) (k : ℝ) := ((initializedPacketField M D hTime τ hτ hτT B δ hδ ξ hs α N k⁻¹).smul k).changeTime hTime /-- Initialized normalized residual field used in packet initialized correction data. -/ +@[expose] def initializedNormalizedResidualField (Cagree : SourceCoefficientAgreement M D) (N : ℕ) (hN : 1 ≤ N) (k : ℝ) (hk : 4 ≤ k) := (((joinedSourceCoefficientData period M D τ hτ hτT B hTime).inverse.multiply @@ -699,7 +707,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⁻¹ @@ -738,7 +746,10 @@ theorem initializedNormalizedField_normal_bound (N : ℕ) (hN : 1 ≤ N) (k : (normalComponentMap D.m₀)).WordBound 6 (4*L.R) (normal L.R S.H0 BC.multiplierCost/k) 0 := by have hh := (initializedPacket_normal_bound M D hTime τ hτ hτT B δ hδ ξ hs α L H NB W LM WM BC hRc hcost hδ1 hα hR WP S hgrowth N hN k hk hbase).changeTime hTime - exact hh.ofRawEq _ (fun _ _ _ => rfl) + exact hh.ofRawEq + ((initializedNormalizedField M D hTime τ hτ hτT B δ hδ ξ hs α N k).map + (normalComponentMap D.m₀)) + (fun _ _ _ => rfl) theorem initializedNormalizedResidualField_bound (Cagree : SourceCoefficientAgreement M D) (N : ℕ) (hN : 1 ≤ N) (k X : ℝ) (hk : 4 ≤ 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..827c7a27fd 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 @@ -55,6 +55,7 @@ variable {hT A} /-- Exact packet of residual, bundling `velocity`, `pressure`, `zero_initial_correction`, `divergence` and the required compatibility proofs. -/ +@[expose] def exactPacketOfResidual (B : Budget P hT A) (R : ApproximationResidual P hT A) : ExactLiftedPacket P hT A B where velocity := B.correctedFieldTower P @@ -90,6 +91,7 @@ variable (M : EulerMeanPacketProvider.Data) /-- Initialized exact packet, given by `exactPacketOfResidual period Q (initializedApproximationResidual M D hTime τ hτ hτT B δ hδ ξ hs α Cagree N hN k hk)`. -/ +@[expose] def initializedExactPacket (Cagree : SourceCoefficientAgreement M D) (N : ℕ) (hN : 1 ≤ N) (k : ℝ) (hk : 4 ≤ k) (Q : Budget period D.T_pos 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..e1dc80a67a 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,11 +36,12 @@ 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)) /-- Initialized profile witness, constructed using `joinedSourceProfileWitness`. -/ +@[expose] def initializedProfileWitness (p : ℕ) : ProfileRegularity period M.T M.T_pos.le D.support (initializedProfiles M D τ hτ hτT B δ hδ ξ hs α p) := diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedRadiusPolynomial.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedRadiusPolynomial.lean index d60dd0ba9c..929b0cff35 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 @@ -55,6 +55,7 @@ abbrev primaryRadiusNormal := NB.enlargeRadius (primaryRadiusBudget L δ).R abbrev primaryRadiusPrimary := EulerTransversePacketPrimary.requiredBudget L (wordRadius (Fin 4) δ) /-- Initialized radius, constructed using `max`. -/ +@[expose] def initializedRadius : ℝ := max (EulerPacketCommonRadius.commonRadius LM (primaryRadiusBudget L δ) (primaryRadiusNormal L NB δ) BC) @@ -74,6 +75,7 @@ theorem mean_le_initializedRadius : Rm ≤ initializedRadius LM L NB BC δ ξ := /-- Initialized joined budget, given by `(primaryRadiusBudget L δ).enlargeRadius (initializedRadius LM L NB BC δ ξ) (primary_le_initializedRadius LM L NB BC δ ξ)`. -/ +@[expose] def initializedJoinedBudget : EulerTransversePacketJoin.Budget D τ hτ hτT B (Fin 4) 6 := (primaryRadiusBudget L δ).enlargeRadius (initializedRadius LM L NB BC δ ξ) (primary_le_initializedRadius LM L NB BC δ ξ) @@ -85,7 +87,7 @@ theorem initializedPrimaryBudget : EulerTransversePacketPrimary.Budget /-- Initialized normal budget, given by `(primaryRadiusNormal L NB δ).enlargeRadius (initializedRadius LM L NB BC δ ξ) (primary_le_initializedRadius LM L NB BC δ ξ)`. -/ -def initializedNormalBudget : EulerTransversePacketJoin.NormalBudget D 6 +@[expose] def initializedNormalBudget : EulerTransversePacketJoin.NormalBudget D 6 (initializedRadius LM L NB BC δ ξ) := (primaryRadiusNormal L NB δ).enlargeRadius (initializedRadius LM L NB BC δ ξ) (primary_le_initializedRadius LM L NB BC δ ξ) @@ -97,10 +99,10 @@ def initializedMeanBudget : EulerMeanPacketProvider.Budget M 6 LM.enlargeRadius (initializedRadius LM L NB BC δ ξ) (mean_le_initializedRadius LM L NB BC δ ξ) @[simp] theorem initializedJoinedBudget_radius : - (initializedJoinedBudget LM L NB BC δ ξ).R=initializedRadius LM L NB BC δ ξ := rfl + (initializedJoinedBudget LM L NB BC δ ξ).R=initializedRadius LM L NB BC δ ξ := by rfl @[simp] theorem initializedJoinedBudget_profile : - (initializedJoinedBudget LM L NB BC δ ξ).fullProfile=L.fullProfile := rfl + (initializedJoinedBudget LM L NB BC δ ξ).fullProfile=L.fullProfile := by rfl /-- All the actual constructed budgets use the named canonical radius. The profile and every coefficient cost are unchanged by enlargement. -/ @@ -131,7 +133,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..3821cbc80c 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 @@ -175,6 +175,7 @@ variable (M : EulerMeanPacketProvider.Data) /-- Initialized pressure, given by `fieldSum (N+1) κ (assembledPressure N (initializedProfiles M D τ hτ hτT B δ hδ ξ hs α))`. -/ +@[expose] def initializedPressure (N : ℕ) (κ : ℝ) : ScalarField := fieldSum (N+1) κ (assembledPressure N (initializedProfiles M D τ hτ hτT B δ hδ ξ hs α)) @@ -191,6 +192,7 @@ def initializedPressureWitness (N : ℕ) (κ : ℝ) : /-- The actual pressure-gradient input Pa for the normalized coordinate equation. The factor k² is the same as in the literal residual identity. -/ +@[expose] def initializedCoordinatePressureField (N : ℕ) (k : ℝ) (hk : k ≠ 0) : Field period D.T (coordinatePressure D k (initializedPressure M D τ hτ hτT B δ hδ ξ hs α N k⁻¹)) := @@ -210,7 +212,7 @@ end end -@[expose] public section +public section noncomputable section @@ -244,25 +246,25 @@ 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τ hτT B δ hδ ξ hs α N κ)`. -/ -def initializedVelocityField (N : ℕ) (κ : ℝ) : +@[expose] def initializedVelocityField (N : ℕ) (κ : ℝ) : Field period D.T (initializedVelocity M D τ hτ hτT B δ hδ ξ hs α N κ) := (ProfileRegularity.velocityField M.T_pos (fun i (_ : i ≤ N) => initializedProfileWitness M D hTime τ hτ hτT B δ hδ ξ hs α i) κ).changeTime hTime /-- Initialized velocity derivative, constructed using `fieldSum`. -/ -def initializedVelocityDerivative (N : ℕ) (κ : ℝ) : VectorField := +@[expose] def initializedVelocityDerivative (N : ℕ) (κ : ℝ) : VectorField := fieldSum (N+1) κ (ProfileRegularity.velocityTimeCoefficients (T := M.T) (N := N) (a := initializedProfiles M D τ hτ hτT B δ hδ ξ hs α)) /-- Initialized velocity derivative field as an element of `Field period D.T (initializedVelocityDerivative M D τ hτ hτT B δ hδ ξ hs α N κ)`. -/ -def initializedVelocityDerivativeField (N : ℕ) (κ : ℝ) : +@[expose] def initializedVelocityDerivativeField (N : ℕ) (κ : ℝ) : Field period D.T (initializedVelocityDerivative M D τ hτ hτT B δ hδ ξ hs α N κ) := (ProfileRegularity.velocityDerivativeField M.T_pos (fun i (_ : i ≤ N) => initializedProfileWitness M D hTime τ hτ hτT B δ hδ ξ hs α i) @@ -326,6 +328,7 @@ theorem initializedCorrectionData_eq_coordinate (Cagree : SourceCoefficientAgree /-- The actual finite pressure and every-order residual identity, with no assumed pressure field, approximation derivative or residual cancellation. -/ +@[expose] def initializedApproximationResidual (Cagree : SourceCoefficientAgreement M D) (N : ℕ) (hN : 1 ≤ N) (k : ℝ) (hk : 4 ≤ k) : ApproximationResidual period D.T_pos diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedUniformBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedUniformBounds.lean index 9bc3ff0d9f..0d79cc895d 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 @@ -57,6 +57,7 @@ variable (M : EulerMeanPacketProvider.Data) (hdet : ∀ t x, (EulerPacketPiola.operatorMatrix (D.F.field t x)).det = 1) /-- Initialized uniform budget used in packet initialized uniform budget. -/ +@[expose] def initializedUniformBudget : EulerAllOrderDriftCorrection.Budget period D.T_pos (initializedCorrectionData M D hTime τ hτ hτT B δ hδ ξ hs α Cagree (truncation k) (truncation_bounds k (by linarith)).1 k hk) := by @@ -83,14 +84,14 @@ def initializedUniformBudget : EulerAllOrderDriftCorrection.Budget period D.T_po theorem initializedUniformBudget_delta : (initializedUniformBudget M D hTime τ hτ hτT B δ hδ hδ1 ξ hs α hα L NB LM Cagree - W hW hprofile k hk hX hlog hfrequency Ξ hΞ hF hdet).delta=delta (expansion k) := rfl + W hW hprofile k hk hX hlog hfrequency Ξ hΞ hF hdet).delta=delta (expansion k) := by rfl theorem initializedUniformBudget_initialRadius : (initializedUniformBudget M D hTime τ hτ hτT B δ hδ hδ1 ξ hs α hα L NB LM Cagree W hW hprofile k hk hX hlog hfrequency Ξ hΞ hF hdet).initialRadius = initialRadius (initializedRadius LM L NB (joinedCoefficientBudget period M D hTime τ hτ hτT B NB) δ ξ) - (L.correctionCoefficients NB period).M (L.correctionCoefficients NB period).Rc := rfl + (L.correctionCoefficients NB period).M (L.correctionCoefficients NB period).Rc := by rfl end EulerPacketTerminalDatum @@ -99,7 +100,7 @@ end end -@[expose] public section +public section noncomputable section @@ -108,7 +109,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..9c4ebecec9 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 @@ -31,6 +31,7 @@ variable (P : ℝ) [Fact (0 < P)] (M : EulerMeanPacketProvider.Data) /-- Joined coefficient budget as an element of `CoefficientBudget (joinedSourceCoefficientData P M D τ hτ hτT B hTime)`. -/ +@[expose] def joinedCoefficientBudget {R : ℝ} (NB : EulerTransversePacketJoin.NormalBudget D 6 R) : CoefficientBudget (joinedSourceCoefficientData P M D τ hτ hτT B hTime) := (sourceCoefficientBudget P M D (InitialData.zero P D) hTime NB.Rc NB.C @@ -52,6 +53,7 @@ variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteS /-- No additional coefficient-bound hypothesis is needed by correction: the source frame, frame derivative and inverse bounds already suffice. -/ +@[expose] def correctionCoefficients (P : ℝ) [Fact (0 < P)] : CorrectionCoefficientBudget D P := correctionCoefficientBudget D P (max L.Rc NB.Rc) L.C₀ L.C₁ NB.C (L.Rc_nonneg.trans (le_max_left _ _)) L.C₀_nonneg L.C₁_nonneg NB.C_nonneg 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..3d635cb554 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 @@ -28,6 +28,7 @@ variable (P : ℝ) [Fact (0 < P)] (M : EulerMeanPacketProvider.Data) /-- Joined source operators, bundling `interval`, `period`, `inverseFrame`, `strain` and the required compatibility proofs. -/ +@[expose] def joinedSourceOperators : Operators where interval := Icc (0 : ℝ) M.T period := P diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketJoinedSourceProfiles.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketJoinedSourceProfiles.lean index 9efc314882..51e043d0ae 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,11 +279,12 @@ 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 (joinedSourceCoefficientData P M D τ hτ hτT B hT) rfl rfl rfl primary hprimary p`. -/ +@[expose] def joinedSourceProfileWitness (p : ℕ) : ProfileRegularity P M.T M.T_pos.le D.support (joinedSourceProfiles P M D τ hτ hτT B primary p) := 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..43701780b6 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 @@ -82,7 +82,7 @@ theorem piece (hR : 0 ≤ R) (k : KnownPiece) (i : ℕ) : theorem pieceJet (hR : 0 ≤ R) (O : Operators) (k : KnownPiece) (i : ℕ) : ((F.pieceJet O k i).field.normalized hT (k.profile S i) (k.profile_pos S i)).WordBound 6 R 1 - (k.shift i) := B.piece hR k i + (k.shift i) := by exact B.piece hR k i end PrefixBound end EulerPacketCylinderField diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketKnownPieceScales.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketKnownPieceScales.lean index 4f51cc19d6..78218075d8 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 @@ -22,7 +22,7 @@ namespace EulerPacketCylinderField.KnownPiece open EulerPacketTimeProfile EulerPacketShiftArithmetic /-- Shift as an element of `ℕ`. -/ -def shift (k : KnownPiece) (i : ℕ) : ℕ := +@[expose] def shift (k : KnownPiece) (i : ℕ) : ℕ := match k with | .high => highShift i | .mean => meanShift i @@ -31,13 +31,14 @@ def shift (k : KnownPiece) (i : ℕ) : ℕ := variable {K : Type*} [TopologicalSpace K] /-- Profile as an element of `C(K,ℝ)`. -/ -def profile (k : KnownPiece) (S : Scales K) (i : ℕ) : C(K,ℝ) := +@[expose] def profile (k : KnownPiece) (S : Scales K) (i : ℕ) : C(K,ℝ) := match k with | .high => S.high i | .mean => S.mean i | .corrector => S.high (i-1) /-- Envelope as an element of `C(K,ℝ)`. -/ +@[expose] def envelope (k : KnownPiece) (S : Scales K) (i : ℕ) : C(K,ℝ) := match k with | .high | .corrector => S.high i diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketKnownPieces.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketKnownPieces.lean index fe5d42346a..dbe5637b39 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 @@ -102,7 +102,7 @@ theorem knownJets_eq_pieces (O : Operators) (p : ℕ) (hp : 2 ≤ p) variable {P T : ℝ} [Fact (0 < P)] {O : Operators} {p : ℕ} {a : ℕ → Profile} /-- Each masked component remains an actual field from the strict prefix. -/ -def PrefixFields.piece (F : PrefixFields P T p a) (k : KnownPiece) (i : ℕ) : +@[expose] def PrefixFields.piece (F : PrefixFields P T p a) (k : KnownPiece) (i : ℕ) : Field P T (k.raw p a i) := by by_cases hi : k.active p i · cases k with @@ -116,6 +116,7 @@ def PrefixFields.piece (F : PrefixFields P T p a) (k : KnownPiece) (i : ℕ) : · exact (Field.zero P T).congr (fun _ _ _ => by simp only [KnownPiece.raw, hi, ite_false]) /-- Piece jet, given by `SpatialJetField.ofField O.interval (F.piece k i)`. -/ +@[expose] def PrefixFields.pieceJet (F : PrefixFields P T p a) (O : Operators) (k : KnownPiece) (i : ℕ) : SpatialJetField P T (fun z => k.jet O p a z i) := SpatialJetField.ofField O.interval (F.piece k i) 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..c8503f821b 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 @@ -296,6 +296,7 @@ theorem coverPath_smooth (t : K) : exact he ▸ hc /-- Of path, bundling `field`, `smooth`, `jet`, `jet_eq`. -/ +@[expose] def ofPath : SmoothTimeField K LiftTangent Space where field := coverPath P p hp smooth := coverPath_smooth P p hp @@ -303,7 +304,7 @@ def ofPath : SmoothTimeField K LiftTangent Space where jet_eq := coverJet_eq P p hp @[simp] theorem ofPath_apply (t : K) (x : LiftTangent) : - (ofPath P p hp).field t x = pointField P p hp t (coveringMap P x) := rfl + (ofPath P p hp).field t x = pointField P p hp t (coveringMap P x) := by rfl theorem ofPath_jet_norm_le (n : ℕ) (C : ℝ) (hC : 0 ≤ C) (hb : ∀ (t : K) (x : LiftTangent), @@ -323,7 +324,7 @@ end end -@[expose] public section +public section noncomputable section @@ -354,6 +355,7 @@ local instance instPacketFieldSmoothTimeField4 (n : ℕ) : NormedSpace ℝ (LiftTangent →ᵇ (LiftTangent [×n]→L[ℝ] Space)) := inferInstance /-- To smooth time field, given by `ofPath P G.path G.orbit`. -/ +@[expose] def toSmoothTimeField (G : Field P T raw) : SmoothTimeField (Icc (0 : ℝ) T) LiftTangent Space := ofPath P G.path G.orbit @@ -399,7 +401,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 @@ -429,11 +431,13 @@ local instance instCorrectionSmoothTimeField4 (n : ℕ) : NormedSpace ℝ (LiftTangent →ᵇ (LiftTangent [×n]→L[ℝ] Vector3)) := inferInstance /-- Correction coefficient, given by `(B.fieldTower P).toSmoothTimeField`. -/ +@[expose] def Budget.correctionCoefficient (B : Budget P hT A) : SmoothTimeField (Icc (0 : ℝ) T) LiftTangent Vector3 := (B.fieldTower P).toSmoothTimeField /-- Correction derivative coefficient, given by `(B.timeDerivativeTower P).toSmoothTimeField`. -/ +@[expose] def Budget.correctionDerivativeCoefficient (B : Budget P hT A) : SmoothTimeField (Icc (0 : ℝ) T) LiftTangent Vector3 := (B.timeDerivativeTower P).toSmoothTimeField @@ -472,7 +476,7 @@ end end -@[expose] public section +public section noncomputable section @@ -487,23 +491,27 @@ variable (P : ℝ) [Fact (0 < P)] {T : ℝ} {hT : 0 < T} {A : Data P T} (B : Budget P hT A) {raw raw_t : VectorField} /-- Packet coefficient, given by `G.toSmoothTimeField.add (B.correctionCoefficient P)`. -/ +@[expose] def Budget.packetCoefficient (G : Field P T raw) : SmoothTimeField (Icc (0 : ℝ) T) LiftTangent Space := G.toSmoothTimeField.add (B.correctionCoefficient P) /-- Packet derivative coefficient, given by `H.toSmoothTimeField.add (B.correctionDerivativeCoefficient P)`. -/ +@[expose] def Budget.packetDerivativeCoefficient (H : Field P T raw_t) : SmoothTimeField (Icc (0 : ℝ) T) LiftTangent Space := H.toSmoothTimeField.add (B.correctionDerivativeCoefficient P) /-- Lifted packet coefficient, given by `lift (B.packetCoefficient P G) A.κ A.direction`. -/ +@[expose] def Budget.liftedPacketCoefficient (G : Field P T raw) : SmoothTimeField (Icc (0 : ℝ) T) LiftTangent LiftTangent := lift (B.packetCoefficient P G) A.κ A.direction /-- Lifted packet derivative coefficient, given by `lift (B.packetDerivativeCoefficient P H) A.κ A.direction`. -/ +@[expose] def Budget.liftedPacketDerivativeCoefficient (H : Field P T raw_t) : SmoothTimeField (Icc (0 : ℝ) T) LiftTangent LiftTangent := lift (B.packetDerivativeCoefficient P H) A.κ A.direction 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..bb66a118c2 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) @@ -269,6 +269,7 @@ variable (P : ℝ) [Fact (0 < P)] {T : ℝ} {hT : 0 < T} {A : EulerAllOrderCorre (B : Budget P hT A) {raw raw_t : VectorField} /-- Physical flow data as an element of `EulerPhysicalGraphFlowBounds.Data P T`. -/ +@[expose] def Budget.physicalFlowData (G : Field P T raw) (H : Field P T raw_t) (hGfield : A.approximation = G.toFieldTower) (htime : TimeDerivative hT.le G H) (k R Rt ρ C0 Cn Ch Ev Et : ℝ) @@ -346,7 +347,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 +364,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 +469,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 @@ -484,6 +485,7 @@ open Set InnerProductSpace ContinuousLinearMap EulerSmoothLimit EulerSpatialCuto open scoped ContDiff /-- Initialized global shear cost as an element of `ℝ`. -/ +@[expose] def initializedGlobalShearCost (R H0 C : ℝ) : ℝ := ‖coordinateEquiv.symm.toContinuousLinearMap‖* (sobolevEmbeddingConstant period 3*fixedVelocityGradeCost R H0 1*(4*R))*C + @@ -614,7 +616,7 @@ end end -@[expose] public section +public section noncomputable section @@ -628,6 +630,7 @@ open EulerSmoothLimit EulerPacketTerminalDatum EulerPacketProfileRecursion EulerParameterWordGevrey /-- Coordinate cost, given by `‖coordinateEquiv.symm.toContinuousLinearMap‖`. -/ +@[expose] def coordinateCost : ℝ := ‖coordinateEquiv.symm.toContinuousLinearMap‖ /-- Physical envelope, given by `3*X*((1+18*X^2*X)*(9*X^2*(X+coordinateCost*2*S)+2))`. -/ @@ -646,24 +649,29 @@ 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) /-- Radius envelope, given by `1+coordinateCost*(4*X+4*inverseRadiusEnvelope X)`. -/ +@[expose] def radiusEnvelope (X : ℝ) : ℝ := 1+coordinateCost*(4*X+4*inverseRadiusEnvelope X) /-- 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`. -/ +@[expose] 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 X)*sobolevEmbeddingConstant period 3 * outputEnvelope period X`. -/ +@[expose] def weightedErrorEnvelope (X : ℝ) : ℝ := (1+9*X)*physicalEnvelope X (4*inverseRadiusEnvelope X)*sobolevEmbeddingConstant period 3 * outputEnvelope period X 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..5d392ee3a0 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 @@ -43,7 +43,7 @@ local instance instPacketMatrixCoefficientAlgebra4 : NormedSpace ℝ (Space → variable {T : ℝ} {a b : Domain → Space →L[ℝ] Space} /-- Comp, bundling `path`, `orbit`, `fun`, `B` and the required compatibility proofs. -/ -def comp (A : MatrixCoefficient T a) (B : MatrixCoefficient T b) : +@[expose] def comp (A : MatrixCoefficient T a) (B : MatrixCoefficient T b) : MatrixCoefficient T (fun z => (a z).comp (b z)) where path := pathCompositionMap A.path B.path orbit := by @@ -61,7 +61,7 @@ def comp (A : MatrixCoefficient T a) (B : MatrixCoefficient T b) : raw_eq t x θ := by rw [A.raw_eq,B.raw_eq]; rfl /-- Add, bundling `path`, `orbit`, `raw_eq`. -/ -def add (A : MatrixCoefficient T a) (B : MatrixCoefficient T b) : +@[expose] def add (A : MatrixCoefficient T a) (B : MatrixCoefficient T b) : MatrixCoefficient T (a+b) where path := A.path+B.path orbit := by @@ -75,7 +75,7 @@ def add (A : MatrixCoefficient T a) (B : MatrixCoefficient T b) : raw_eq t x θ := by change a (t,(x,θ))+b (t,(x,θ)) = _; rw [A.raw_eq,B.raw_eq]; rfl /-- Smul, bundling `path`, `orbit`, `raw_eq`. -/ -def smul (A : MatrixCoefficient T a) (c : ℝ) : MatrixCoefficient T (c • a) where +@[expose] def smul (A : MatrixCoefficient T a) (c : ℝ) : MatrixCoefficient T (c • a) where path := c • A.path orbit := by convert A.orbit.const_smul c using 1 @@ -89,7 +89,7 @@ def smul (A : MatrixCoefficient T a) (c : ℝ) : MatrixCoefficient T (c • a) w /-- Spatial derivative, bundling `path`, `orbit`, `raw_eq`, `have` and the required compatibility proofs. -/ -def spatialDerivative (A : MatrixCoefficient T a) (v : Space) : +@[expose] def spatialDerivative (A : MatrixCoefficient T a) (v : Space) : MatrixCoefficient T (fun z => fderiv ℝ (fun x => a (z.1,(x,z.2.2))) z.2.1 v) where path := orbitDerivativePath A.path v orbit := orbitDerivativePath_orbit A.path A.orbit v 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..3ef0596736 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 @@ -202,6 +202,7 @@ variable {P : ℝ} [Fact (0 < P)] (k : ℝ) (hk : k ≠ 0) {p : ScalarField} /-- Pressure field as an element of `Field P D.T (coordinatePressure D k p)`. -/ +@[expose] def pressureField (G : GradientWitness P D.T k⁻¹ D.m₀ p) : Field P D.T (coordinatePressure D k p) := (G.field.smul (k^2)).congr (fun t x θ => by @@ -230,7 +231,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 +318,7 @@ end end -@[expose] public section +public section noncomputable section @@ -390,7 +391,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 @@ -448,6 +449,7 @@ variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] /-- Normalized residual, given by `k • rawInverse D z (slicedMomentumResidual (Icc (0 : ℝ) D.T) k⁻¹ (rawInverse D z) (D.strain z) (D.normalField z) W p z)`. -/ +@[expose] def normalizedResidual (k : ℝ) (W : VectorField) (p : ScalarField) (z : Domain) : Space := k • rawInverse D z (slicedMomentumResidual (Icc (0 : ℝ) D.T) k⁻¹ (rawInverse D z) (D.strain z) (D.normalField z) W p z) @@ -497,7 +499,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..fc2151a1e0 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,11 +25,11 @@ 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`. -/ -def activationTime (J : ℕ) (X : ℝ) (a β : ℕ → ℝ) (n : ℕ) : ℝ := +@[expose] def activationTime (J : ℕ) (X : ℝ) (a β : ℕ → ℝ) (n : ℕ) : ℝ := ∑ i ∈ range n, stepLength J X a β i /-- Horizon time, given by `activationTime J X a β n+2*timeWidth J X n`. -/ 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..c9d486f6a4 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) @@ -61,6 +61,7 @@ synthesis. -/ local instance instPacketParentForwardBudget2 : NormedRing (Space →ᵇ U →L[ℝ] U) := inferInstance /-- Source forward budget as an element of `EulerTransversePacketForward.Budget D (Fin 4) q`. -/ +@[expose] def sourceForwardBudget (D : Data U) (q : ℕ) (R C C₁ Cp : ℝ) (hR : 0 ≤ R) (hC : 0 ≤ C) (hC₁ : 0 ≤ C₁) (hCp : 0 ≤ Cp) (hdet : ∀ t x, (operatorMatrix (D.F.field t x)).det = 1) diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketParentLabelBudgets.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketParentLabelBudgets.lean index 5b6c1660a6..f801163ca9 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 @@ -27,7 +27,7 @@ open Set MeasureTheory ContinuousLinearMap EulerSmoothLimit EulerMeanCoefficient open scoped ContDiff BoundedContinuousFunction /-- The individual component of the literal three-field bound in (21). -/ -def HasLabelBound (K : ℝ) (A : SmoothL2Field Space) : Prop := +@[expose] def HasLabelBound (K : ℝ) (A : SmoothL2Field Space) : Prop := ∀ n, classicalBlockSize direction 6 A.toLp A.translation_contDiff n ≤ K^(n+1)*(n.factorial : ℝ)^2 @@ -68,6 +68,7 @@ open scoped ContDiff BoundedContinuousFunction /-- The full normal/pressure/corrector multiplier budget follows from the actual parent displacement and velocity in physical initial labels. -/ +@[expose] def normalBudget {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] (D : EulerTransversePacketProvider.Data U) (q : ℕ) (A V : Icc (0 : ℝ) D.T → SmoothL2Field Space) @@ -89,6 +90,7 @@ def normalBudget {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] /-- The actual mean variational inverse budget is constructed from the three literal parent fields in (21), det F=1, and the inverse time length. -/ +@[expose] def meanBudget (D : EulerMeanPacketProvider.Data) (q : ℕ) (A V W : Icc (0 : ℝ) D.T → SmoothL2Field Space) (Ti K : ℝ) (hT : D.T ≤ 1) (hTi : D.T⁻¹ ≤ Ti) (hK : 0 ≤ K) 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..e30deb9694 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,32 +28,33 @@ 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₁) /-- Gram cost, given by `inverseBlockCost (Fin 4) q (gramInverseEnvelope C) R (3*C^2) (accelerationBlockAmplitude (Fin 4) q R C C₁ 1 V)`. -/ +@[expose] def gramCost (q : ℕ) (R C C₁ V : ℝ) : ℝ := inverseBlockCost (Fin 4) q (gramInverseEnvelope C) R (3*C^2) (accelerationBlockAmplitude (Fin 4) q R C C₁ 1 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) @@ -120,6 +121,7 @@ variable (D : EulerMeanPacketProvider.Data) (q : ℕ) (Ti R C C₁ C₂ : ℝ) /-- Source mean budget as an element of `EulerMeanPacketProvider.Budget D q (radius q D.T Ti R C C₁ C₂ D.L)`. -/ +@[expose] def sourceMeanBudget : EulerMeanPacketProvider.Budget D q (radius q D.T Ti R C C₁ C₂ D.L) := by have hR0 : 0 ≤ R := (by norm_num : (0 : ℝ) ≤ 1024).trans hR have hTi0 : 0 ≤ Ti := (inv_nonneg.mpr D.T_pos.le).trans hTi diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketParentMeanCoercivity.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketParentMeanCoercivity.lean index 3f18edd97b..a24c36466f 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,15 +44,15 @@ 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`. -/ -def inverseEnvelope (C C₁ : ℝ) : ℝ := 2*(transportEnvelope C C₁)^2 +@[expose] def inverseEnvelope (C C₁ : ℝ) : ℝ := 2*(transportEnvelope C C₁)^2 theorem transportEnvelope_nonneg (C C₁ : ℝ) (hC : 0 ≤ C) (hC₁ : 0 ≤ C₁) : 0 ≤ transportEnvelope C C₁ := by unfold transportEnvelope gramInverseEnvelope; positivity diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketParentNormalBudget.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketParentNormalBudget.lean index 1df4ca30d8..5e070c57ae 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 @@ -69,6 +69,7 @@ theorem inverse_guard : /-- Source normal budget, bundling `Rc`, `C`, `Ri`, `Rc_nonneg` and the required compatibility proofs. -/ +@[expose] def sourceNormalBudget (q : ℕ) : EulerTransversePacketJoin.NormalBudget D q (radius R C C₁) where Rc := R C := amplitude C C₁ diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketParentPhysicalBudgets.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketParentPhysicalBudgets.lean index 9b9cb1c49a..5a7d639da1 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 @@ -102,6 +102,7 @@ synthesis. -/ local instance instPacketParentJoinedBudget2 : NormedRing (Space →ᵇ U →L[ℝ] U) := inferInstance /-- Source joined budget as an element of `Budget D τ hτ hτT B (Fin 4) q`. -/ +@[expose] def sourceJoinedBudget (D : Data U) (τ : ℝ) (hτ : 0 < τ) (hτT : τ < D.T) (B : HistoryData (D.initial τ hτ hτT.le)) (q : ℕ) (Ti R C C₁ C₂ Cp : ℝ) (hτ1 : τ ≤ 1) (hTi : τ⁻¹ ≤ Ti) @@ -212,7 +213,7 @@ end end -@[expose] public section +public section noncomputable section @@ -226,10 +227,11 @@ open scoped ContDiff BoundedContinuousFunction variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteSpace U] /-- Half ball, given by `{x | ‖x‖ ≤ (1/2 : ℝ)}`. -/ +@[expose] 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 @@ -238,6 +240,7 @@ theorem physicalCost_nonneg (K Cp : ℝ) (hCp : 0 ≤ Cp) : 0 ≤ physicalCost K /-- At a zero-history stage the real label bounds and physical propagator construct the complete source forward budget, before any forcing is chosen. -/ +@[expose] def forwardBudget (D : Data U) (q : ℕ) (A V : Icc (0 : ℝ) D.T → SmoothL2Field Space) (ℓ K Cp : ℝ) (hℓ : 0 ≤ ℓ) (hℓ1 : ℓ ≤ 1) (hK : 0 ≤ K) (hCp : 0 ≤ Cp) @@ -271,6 +274,7 @@ def forwardBudget (D : Data U) (q : ℕ) /-- Positive history uses the actual acceleration in (21) and its true within-time derivative identity. Jacobi and determinant one then supply the Hessian multiplier bound needed by the joined variational inverse. -/ +@[expose] def joinedBudget (D : Data U) (τ : ℝ) (hτ : 0 < τ) (hτT : τ < D.T) (B : HistoryData (D.initial τ hτ hτT.le)) (q : ℕ) (A V : Icc (0 : ℝ) D.T → SmoothL2Field Space) diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketParentTransverseCosts.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketParentTransverseCosts.lean index 83489dc861..9107ad7296 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 @@ -30,9 +30,10 @@ open EulerParameterWordGevrey EulerTransverseGevreyInverse EulerSourceCylinderForwardSobolev EulerLinearDuhamel 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₂ /-- History cost, constructed using `inverseBlockCost`. -/ +@[expose] def historyCost (q : ℕ) (T R C C₁ C₂ : ℝ) : ℝ := inverseBlockCost (Fin 4) q (inverseEnvelope C C₁) R (formCost T C C₁ (curvatureAmplitude C C₂)) @@ -40,22 +41,24 @@ def historyCost (q : ℕ) (T R C C₁ C₂ : ℝ) : ℝ := /-- Acceleration cost, given by `inverseBlockCost (Fin 4) q (gramInverseEnvelope C) R (3*C^2) (accelerationBlockAmplitude (Fin 4) q R C C₁ 1 V)`. -/ +@[expose] def accelerationCost (q : ℕ) (R C C₁ V : ℝ) : ℝ := inverseBlockCost (Fin 4) q (gramInverseEnvelope C) R (3*C^2) (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`. -/ +@[expose] def forwardCost (q : ℕ) (S Ti R C C₁ Cp : ℝ) : ℝ := forwardSobolevCost (Fin 4) q S Cp (Ti+2) (EulerSourceCylinderForwardSobolev.forcingCost (Fin 4) q (inverseRadius R C) C) (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..e748d45f63 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 @@ -95,11 +95,12 @@ variable (X Y : Icc (0 : ℝ) D.T → Space → Space) (hdet : ∀ t x, (operatorMatrix (D.F.field t x)).det = 1) /-- Physical reconstruction, given by `graphReconstruction D P κ k e t (Y t x)`. -/ +@[expose] 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..ffe46b135e 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 @@ -28,11 +28,12 @@ open InnerProductSpace ContinuousLinearMap EulerSmoothLimit EulerPeriodicProfile abbrev Matrix := Space →L[ℝ] Space /-- Shear term, given by `(amp*slope) • rankOne ℝ w r`. -/ +@[expose] 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..3d903a6637 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 @@ -632,7 +632,7 @@ variable (period : ℝ) /-- Lifted slow curl, given by `curlMatrix ((fieldFDeriv period Q x).comp ((ContinuousLinearMap.inl ℝ Space ℝ).comp (F x.1).symm.toContinuousLinearMap))`. -/ -def liftedSlowCurl (F : Space → Space ≃L[ℝ] Space) (Q : LiftDomain period → Space) +@[expose] def liftedSlowCurl (F : Space → Space ≃L[ℝ] Space) (Q : LiftDomain period → Space) (x : LiftDomain period) : Space := curlMatrix ((fieldFDeriv period Q x).comp ((ContinuousLinearMap.inl ℝ Space ℝ).comp (F x.1).symm.toContinuousLinearMap)) 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..ae864938b2 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) @@ -80,7 +80,7 @@ theorem potentialMultiplier_contDiff (m : X → Space) (hm : ContDiff ℝ ∞ m) /-- Potential multiplier derivative, given by `(2*⟪m,mt⟫_ℝ/(‖m‖^2)^2) • crossLeft m - ((‖m‖^2)⁻¹) • crossLeft mt`. -/ -def potentialMultiplierDerivative (m mt : Space) : Space →L[ℝ] Space := +@[expose] def potentialMultiplierDerivative (m mt : Space) : Space →L[ℝ] Space := (2*⟪m,mt⟫_ℝ/(‖m‖^2)^2) • crossLeft m - ((‖m‖^2)⁻¹) • crossLeft mt /-- The derivative formula is valid for a time curve on its actual time set. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketPotentialRegularity.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketPotentialRegularity.lean index 231863f040..18e714524c 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 @@ -25,15 +25,16 @@ open EulerSmoothLimit EulerPacketCrossProduct EulerPacketAngularPotential open scoped ContDiff /-- Curl linear, bundling `toFun`, `map_add`, `map_smul`. -/ -def curlLinear : (Space →L[ℝ] Space) →ₗ[ℝ] Space where +@[expose] def curlLinear : (Space →L[ℝ] Space) →ₗ[ℝ] Space where toFun := curlMatrix map_add' := curlMatrix_add map_smul' := curlMatrix_smul /-- Curl operator, given by `curlLinear.toContinuousLinearMap`. -/ -def curlOperator : (Space →L[ℝ] Space) →L[ℝ] Space := curlLinear.toContinuousLinearMap +@[expose] 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..e70bdbe026 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,20 +29,21 @@ 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`. -/ +@[expose] def covectorGrades (N : ℕ) (m : Space) (a : ℕ → Profile) : ℕ → VectorField := assemble N (fun i => pressureGradient (a i).meanPressure+angularPressure m (a i).highPressure) (fun i => pressureGradient (a i).highPressure) /-- Gradient linear, bundling `toFun`, `map_add`, `map_smul`. -/ -def gradientLinear : ScalarJet →ₗ[ℝ] Space where +@[expose] def gradientLinear : ScalarJet →ₗ[ℝ] Space where toFun J := (toDual ℝ Space).symm (J.2.comp spatialInjection) map_add' J K := by simp [add_comp] map_smul' c J := by simp [smul_comp] diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketPressureFastBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketPressureFastBounds.lean index c36dfa312f..ac743e4a65 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) @@ -98,6 +98,7 @@ variable (D) {raw : VectorField} (G : Field P D.T raw) /-- Physical covector, given by `(D.FInv.field t (Y t x)).adjoint (raw (t,(Y t x,k*⟪D.m₀,Y t x⟫_ℝ)))`. -/ +@[expose] def physicalCovector (_G : Field P D.T raw) (k : ℝ) (Y : Icc (0 : ℝ) D.T → Space → Space) (t : Icc (0 : ℝ) D.T) (x : Space) : Space := (D.FInv.field t (Y t x)).adjoint (raw (t,(Y t x,k*⟪D.m₀,Y t x⟫_ℝ))) @@ -146,7 +147,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 +224,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..dff052bf20 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 @@ -284,6 +284,7 @@ open Real Filter EulerScale EulerPacketSourceScales EulerPacketSourceTime open scoped Topology /-- Bad coefficient, given by `1+2*CM*badConstant*(4+CMn+CHn)^degree*(2*Cθ)^5`. -/ +@[expose] def badCoefficient (Cθ CM CMn CHn : ℝ) : ℝ := 1+2*CM*badConstant*(4+CMn+CHn)^degree*(2*Cθ)^5 @@ -294,11 +295,13 @@ theorem badCoefficient_pos (Cθ CM CMn CHn : ℝ) (hθ : 0 ≤ Cθ) /-- Bad cost, given by `monomialCost J 1 4 0 (1/8) ((degree : ℝ)*c+2) (badCoefficient Cθ CM CMn CHn) 10 10 x n`. -/ +@[expose] def badCost (J : ℕ) (Cθ CM CMn CHn c : ℝ) (x : ℕ → ℝ) (n : ℕ) : ℝ := monomialCost J 1 4 0 (1/8) ((degree : ℝ)*c+2) (badCoefficient Cθ CM CMn CHn) 10 10 x n /-- Bad cost spec, bundling `d`, `B`, `N`, `a` and the required compatibility proofs. -/ +@[expose] def badCostSpec (Cθ CM CMn CHn c : ℝ) (hθ : 0 ≤ Cθ) (hM : 0 ≤ CM) (hMn : 0 ≤ CMn) (hHn : 0 ≤ CHn) : CostSpec where d := 1 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..2854c4065c 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))))) @@ -74,6 +74,7 @@ theorem extra_le_requiredRadius (extra : ℝ) : extra ≤ requiredRadius L extra /-- Enlarge for primary, given by `L.enlargeRadius (requiredRadius L extra) (le_requiredRadius L extra)`. -/ +@[expose] def enlargeForPrimary (extra : ℝ) : EulerTransversePacketJoin.Budget D τ hτ hτT B ι q := L.enlargeRadius (requiredRadius L extra) (le_requiredRadius L extra) @@ -111,7 +112,7 @@ end end -@[expose] public section +public section noncomputable section @@ -128,7 +129,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..ae060d15e6 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 @@ -38,6 +38,7 @@ local instance instPacketPrimaryFactorization2 : NormedSpace ℝ Space := inferI variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] /-- Physical generator, bundling `toFun`, `continuous_toFun`, `have`, `have`. -/ +@[expose] def physicalGenerator (D : Data U) (x : Space) : C(Icc (0 : ℝ) D.T,Space →L[ℝ] Space) where toFun t := -(D.M.field t x)+(2/‖D.normal.field t x‖^2) • ((rankOne ℝ (D.normal.field t x) (D.normal.field t x)).comp (D.M.field t x)) @@ -133,7 +134,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 +186,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..c6caf6d747 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 @@ -474,17 +474,18 @@ theorem derivativeCost_nonneg : 0 ≤ H.derivativeCost := by positivity /-- Common cost, given by `H.velocityCost+H.derivativeCost`. -/ +@[expose] 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 +640,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..bb64b9b950 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 @@ -27,6 +27,7 @@ open Set MeasureTheory EulerSmoothLimit EulerPacketPointJets EulerPacketProfileR variable {P T : ℝ} [Fact (0 < P)] /-- Change time as an element of `ProfileRegularity P T' hT' S a`. -/ +@[expose] def ProfileRegularity.changeTime {T' : ℝ} {hT : 0 ≤ T} {S : Set Space} {a : Profile} (G : ProfileRegularity P T hT S a) (h : T = T') (hT' : 0 ≤ T') : ProfileRegularity P T' hT' S a := by @@ -38,6 +39,7 @@ variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteS /-- Primary, bundling `high`, `mean`, `corrector`, `pressure` and the required compatibility proofs. -/ +@[expose] def ProfileRegularity.primary (G : EulerTransversePacketProvider.Forcing P D raw) (I : EulerTransversePacketProvider.InitialData P D) (O : Operators) (hcorrector : O.curlCorrector = D.curlCorrector P) : @@ -66,19 +68,21 @@ def ProfileRegularity.primary (G : EulerTransversePacketProvider.Forcing P D raw mean_angle _ _ _ := rfl /-- Zero forcing is an actual supported smooth cylinder path with zero angular integral. -/ +@[expose] def homogeneousForcing (D : EulerTransversePacketProvider.Data U) : EulerTransversePacketProvider.Forcing P D (0 : VectorField) := (Field.zero P D.T).transverseForcingOfRaw D (fun _ _ _ _ => rfl) (fun _ _ => by simp) /-- 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) /-- Homogeneous primary regularity, given by `ProfileRegularity.primary (homogeneousForcing D) I O hcorrector`. -/ +@[expose] def homogeneousPrimaryRegularity (D : EulerTransversePacketProvider.Data U) (I : EulerTransversePacketProvider.InitialData P D) (O : Operators) (hcorrector : O.curlCorrector = D.curlCorrector P) : 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..34a05593c2 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 @@ -31,6 +31,7 @@ variable {P : ℝ} [Fact (0 < P)] /-- This primary is constructed from the terminal history and its genuine forward continuation, including its actual pressure and slow curl. -/ +@[expose] def profileRegularity : ProfileRegularity P D.T D.T_pos.le D.support (primaryProfile O (vector τ hτ hτT B Y) (scalar τ hτ hτT B Y)) where high := vectorField τ hτ hτT B Y diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryUncut.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryUncut.lean index 2be7c0d849..d80a87628d 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 @@ -95,6 +95,7 @@ variable {D : Data U} (τ : ℝ) (hτ : 0 < τ) (hτT : τ < D.T) /-- Uncut velocity, given by `physical D ⟨0,le_rfl,D.T_pos.le⟩ x (B.coefficients.labelCoordinate x ξ ⟨0,le_rfl,hτ.le⟩) t`. -/ +@[expose] def uncutVelocity (t : ℝ) (x : Space) : Space := physical D ⟨0,le_rfl,D.T_pos.le⟩ x (B.coefficients.labelCoordinate x ξ ⟨0,le_rfl,hτ.le⟩) t 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..e8d526215d 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)`. -/ +@[expose] def meanResult (O : Operators) (p : ℕ) (a : ℕ → Profile) : VectorField × ScalarField := 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) /-- Step, given by `let b := meanResult O p a let h := O.highSolve (highForce O p a) ⟨h.1,b.1,O.curlCorrector h.1,h.2,b.2⟩`. -/ +@[expose] def step (O : Operators) (p : ℕ) (a : ℕ → Profile) : Profile := let b := meanResult O p a let h := O.highSolve (highForce O p a) diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketProfileRegularity.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketProfileRegularity.lean index fec94e1905..7679b7973f 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 @@ -102,7 +102,7 @@ def zero (P T : ℝ) [Fact (0 < P)] (hT : 0 ≤ T) (S : Set Space) : mean_angle _ _ _ := rfl /-- Prefix fields, bundling `high`, `mean`, `corrector`. -/ -def prefixFields {p : ℕ} {a : ℕ → Profile} +@[expose] def prefixFields {p : ℕ} {a : ℕ → Profile} (G : ∀ i, i < p → ProfileRegularity P T hT S (a i)) : PrefixFields P T p a where high i hi := (G i hi).high mean i hi := (G i hi).mean 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..7b4b5f3d5f 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,75 +80,76 @@ 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) /-- Strong envelope, given by `inverseBlockCost (Fin 4) 6 W W (3*W^2) (3*coeff W W*(endpointEnvelope W+6*coeff W W*(2*W+2)))`. -/ +@[expose] def strongEnvelope (W : ℝ) : ℝ := inverseBlockCost (Fin 4) 6 W W (3*W^2) (3*coeff W W*(endpointEnvelope W+6*coeff W W*(2*W+2))) /-- 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..0bda85b721 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 @@ -84,6 +84,7 @@ open Set EulerSmoothLimit EulerPacketPointJets EulerPacketProfileRecursion variable {P T : ℝ} [Fact (0 < P)] {O : Operators} {N : ℕ} {a : ℕ → Profile} {S : Set Space} /-- Literal tail grade field used in packet residual tail actual. -/ +@[expose] def literalTailGradeField (hT : 0 < T) (G : ∀ i, i ≤ N → ProfileRegularity P T hT.le S (a i)) (C : CoefficientData P T O) (ha : a 0 = 0) (n : ℕ) (hn : N + 1 ≤ n) : @@ -107,6 +108,6 @@ def literalTailGradeField (hT : 0 < T) theorem literalTailGradeField_path (hT : 0 < T) (G : ∀ i, i ≤ N → ProfileRegularity P T hT.le S (a i)) (C : CoefficientData P T O) (ha : a 0 = 0) (n : ℕ) (hn : N + 1 ≤ n) : - (literalTailGradeField hT G C ha n hn).path = (tailGradeField hT G C ha n hn).path := rfl + (literalTailGradeField hT G C ha n hn).path = (tailGradeField hT G C ha n hn).path := by rfl end EulerPacketCylinderField.ProfileRegularity diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketResidualTailFields.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketResidualTailFields.lean index 7a6792b059..41cb7952fe 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 @@ -133,6 +133,7 @@ variable {P T : ℝ} [Fact (0 < P)] {O : Operators} {N : ℕ} {a : ℕ → Profi /-- Tail nonlinear field as an element of `Field P T (fun z => nonlinearGrade (N+1) n (O.inverseFrame z) (O.normal z) (knownJets O (N+1) a z))`. -/ +@[expose] def PrefixFields.tailNonlinearField (F : PrefixFields P T (N + 1) a) (C : CoefficientData P T O) (n : ℕ) : Field P T (fun z => nonlinearGrade (N+1) n (O.inverseFrame z) (O.normal z) @@ -148,6 +149,7 @@ def PrefixFields.tailNonlinearField (F : PrefixFields P T (N + 1) a) exact (S.add H).congr (fun _ _ _ => rfl) /-- Tail linear field used in packet residual tail fields. -/ +@[expose] def PrefixFields.tailLinearField (F : PrefixFields P T (N + 1) a) (C : CoefficientData P T O) (hT : 0 < T) {correctorT : VectorField} (Ct : Field P T correctorT) @@ -163,7 +165,7 @@ def PrefixFields.tailLinearField (F : PrefixFields P T (N + 1) a) · exact (Field.zero P T).congr (fun _ _ _ => by simp [hn]) /-- Tail grade field as an element of `Field P T (fun z => recursiveGrade O N a z n)`. -/ -def PrefixFields.tailGradeField (F : PrefixFields P T (N + 1) a) +@[expose] def PrefixFields.tailGradeField (F : PrefixFields P T (N + 1) a) (C : CoefficientData P T O) (hT : 0 < T) {correctorT : VectorField} (Ct : Field P T correctorT) (hCt : TimeDerivative hT.le (F.corrector N (Nat.lt_succ_self N)) Ct) @@ -183,6 +185,7 @@ theorem PrefixFields.tailGradeField_path (F : PrefixFields P T (N + 1) a) (F.tailLinearField C hT Ct hCt pressure n).path + (F.tailNonlinearField C n).path := rfl /-- Tail grades, given by `Ico (N+1) (2*N+3)`. -/ +@[expose] def tailGrades (N : ℕ) : Finset ℕ := Ico (N+1) (2*N+3) theorem tailGrades_card (N : ℕ) : (tailGrades N).card = N+2 := by @@ -191,6 +194,7 @@ theorem tailGrades_card (N : ℕ) : (tailGrades N).card = N+2 := by /-- Tail sum field as an element of `Field P T (fun z => ∑ n ∈ tailGrades N, κ^n • recursiveGrade O N a z n)`. -/ +@[expose] def PrefixFields.tailSumField (F : PrefixFields P T (N + 1) a) (C : CoefficientData P T O) (hT : 0 < T) {correctorT : VectorField} (Ct : Field P T correctorT) @@ -214,11 +218,13 @@ namespace ProfileRegularity variable {S : Set Space} /-- Prefix through, given by `prefixFields (fun i hi => G i (by omega))`. -/ +@[expose] def prefixThrough (hT : 0 < T) (G : ∀ i, i ≤ N → ProfileRegularity P T hT.le S (a i)) : PrefixFields P T (N+1) a := prefixFields (fun i hi => G i (by omega)) /-- Tail grade field as an element of `Field P T (fun z => recursiveGrade O N a z n)`. -/ +@[expose] def tailGradeField (hT : 0 < T) (G : ∀ i, i ≤ N → ProfileRegularity P T hT.le S (a i)) (C : CoefficientData P T O) (ha : a 0 = 0) (n : ℕ) (hn : N + 1 ≤ n) : @@ -228,6 +234,7 @@ def tailGradeField (hT : 0 < T) /-- Tail sum field, given by `(prefixThrough hT G).tailSumField C hT (G N le_rfl).correctorDerivative (G N le_rfl).corrector_time (G N le_rfl).pressure ha κ`. -/ +@[expose] def tailSumField (hT : 0 < T) (G : ∀ i, i ≤ N → ProfileRegularity P T hT.le S (a i)) (C : CoefficientData P T O) (ha : a 0 = 0) (κ : ℝ) : 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..876e317106 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 @@ -63,6 +63,7 @@ variable (p : ScalarField) (q : C(Icc (0 : ℝ) T, CylinderL2 P ℝ)) /-- Angular gradient field as an element of `Field P T (fun z => (pressureJet p z).2 angleDirection • m)`. -/ +@[expose] def angularGradientField (m : Space) : Field P T (fun z => (pressureJet p z).2 angleDirection • m) := (((scalarEmbeddingField p q hq he).derivative 0).map 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..eb3868d302 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 @@ -74,6 +74,7 @@ local instance instPacketShortTimePhysicalGrowth2 : NormedRing (Space →ᵇ U /-- A low strain bound on the H3 ball suffices for the entire source forward budget. The coordinate propagation cost is the polynomial 6 C³. -/ +@[expose] def shortPhysicalForwardBudget (q : ℕ) (R C C₁ CM : ℝ) (hR : 0 ≤ R) (hC : 0 ≤ C) (hC₁ : 0 ≤ C₁) (hCM : 0 ≤ CM) (hdet : ∀ t x, (operatorMatrix (D.F.field t x)).det = 1) 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..6bea7642ad 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 @@ -48,6 +48,7 @@ theorem VectorCoefficient.path_eq_of_raw_eq {T : ℝ} {raw raw' : VectorField} /-- Changing the solver fields of the packet operators does not change the coefficient budget when the three actual coefficients agree on the interval. -/ +@[expose] def CoefficientBudget.ofRawEq {P T : ℝ} {O O' : Operators} {G : CoefficientData P T O} (B : CoefficientBudget G) (H : CoefficientData P T O') @@ -95,6 +96,7 @@ variable (P : ℝ) [Fact (0 < P)] (M : EulerMeanPacketProvider.Data) /-- Uniform compact-time translation bounds for the literal source coefficients. Only the original inverse-frame and strain jets are inputs; in particular the normal has no independent bound and there is no loss in radius or amplitude. -/ +@[expose] def sourceCoefficientBudget (Rc C : ℝ) (hRc : 0 ≤ Rc) (hC : 0 ≤ C) (hI : ∀ n t x, ‖iteratedFDeriv ℝ n (D.FInv.field t : Space → Space →L[ℝ] Space) x‖ ≤ 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..0224331714 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,85 +29,86 @@ 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`. -/ -def frameCoefficient : MatrixCoefficient D.T (rawFrame D) where +@[expose] def frameCoefficient : MatrixCoefficient D.T (rawFrame D) where path := D.F.field orbit := D.F.translation_contDiff raw_eq t x θ := by simp only [rawFrame,EulerTransversePacketProvider.Data.clamp_coe] /-- Frame time coefficient, bundling `path`, `orbit`, `raw_eq`. -/ -def frameTimeCoefficient : MatrixCoefficient D.T (rawFrameTime D) where +@[expose] def frameTimeCoefficient : MatrixCoefficient D.T (rawFrameTime D) where path := D.F₁.field orbit := D.F₁.translation_contDiff raw_eq t x θ := by simp only [rawFrameTime,EulerTransversePacketProvider.Data.clamp_coe] /-- Inverse coefficient, bundling `path`, `orbit`, `raw_eq`. -/ -def inverseCoefficient : MatrixCoefficient D.T (rawInverse D) where +@[expose] def inverseCoefficient : MatrixCoefficient D.T (rawInverse D) where path := D.FInv.field orbit := D.FInv.translation_contDiff raw_eq t x θ := by simp only [rawInverse,EulerTransversePacketProvider.Data.clamp_coe] /-- Raw metric, given by `(rawInverse D z).comp (rawInverse D z).adjoint`. -/ -def rawMetric (z : Domain) : Space →L[ℝ] Space := +@[expose] def rawMetric (z : Domain) : Space →L[ℝ] Space := (rawInverse D z).comp (rawInverse D z).adjoint /-- Raw inverse metric, given by `(rawFrame D z).adjoint.comp (rawFrame D z)`. -/ -def rawInverseMetric (z : Domain) : Space →L[ℝ] Space := +@[expose] 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)) /-- Metric coefficient, given by `(inverseCoefficient D).comp (inverseCoefficient D).adjoint`. -/ -def metricCoefficient : MatrixCoefficient D.T (rawMetric D) := +@[expose] def metricCoefficient : MatrixCoefficient D.T (rawMetric D) := (inverseCoefficient D).comp (inverseCoefficient D).adjoint /-- Inverse metric coefficient, given by `(frameCoefficient D).adjoint.comp (frameCoefficient D)`. -/ -def inverseMetricCoefficient : MatrixCoefficient D.T (rawInverseMetric D) := +@[expose] def inverseMetricCoefficient : MatrixCoefficient D.T (rawInverseMetric D) := (frameCoefficient D).adjoint.comp (frameCoefficient 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 D).spatialDerivative (EuclideanSpace.single i 1))).smul κ`. -/ +@[expose] def quadraticCoefficient (κ : ℝ) (i : Fin 3) : MatrixCoefficient D.T (rawQuadratic D κ i) := ((inverseCoefficient D).comp ((frameCoefficient D).spatialDerivative (EuclideanSpace.single i 1))).smul κ @[simp] theorem metricCoefficient_apply (t : Icc (0 : ℝ) D.T) (x : Space) : (metricCoefficient D).path t x = - (D.FInv.field t x).comp (D.FInv.field t x).adjoint := rfl + (D.FInv.field t x).comp (D.FInv.field t x).adjoint := by rfl @[simp] theorem inverseMetricCoefficient_apply (t : Icc (0 : ℝ) D.T) (x : Space) : (inverseMetricCoefficient D).path t x = - (D.F.field t x).adjoint.comp (D.F.field t x) := rfl + (D.F.field t x).adjoint.comp (D.F.field t x) := by rfl @[simp] theorem linearCoefficient_apply (t : Icc (0 : ℝ) D.T) (x : Space) : (linearCoefficient D).path t x = - (2 : ℝ) • (D.FInv.field t x).comp (D.F₁.field t x) := rfl + (2 : ℝ) • (D.FInv.field t x).comp (D.F₁.field t x) := by rfl theorem quadraticCoefficient_apply (κ : ℝ) (i : Fin 3) (t : Icc (0 : ℝ) D.T) (x : Space) : @@ -123,32 +124,32 @@ theorem quadraticCoefficient_apply (κ : ℝ) (i : Fin 3) variable (P : ℝ) [Fact (0 < P)] /-- Metric tower, given by `(metricCoefficient D).toCoefficientTower P`. -/ -def metricTower : CoefficientTower P D.T := +@[expose] def metricTower : CoefficientTower P D.T := (metricCoefficient D).toCoefficientTower P /-- Inverse metric tower, given by `(inverseMetricCoefficient D).toCoefficientTower P`. -/ -def inverseMetricTower : CoefficientTower P D.T := +@[expose] def inverseMetricTower : CoefficientTower P D.T := (inverseMetricCoefficient D).toCoefficientTower P /-- Linear tower, given by `(linearCoefficient D).toCoefficientTower P`. -/ -def linearTower : CoefficientTower P D.T := +@[expose] 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) : ((metricTower D P).coefficient t).coefficient x = - (D.FInv.field t x.1).comp (D.FInv.field t x.1).adjoint := rfl + (D.FInv.field t x.1).comp (D.FInv.field t x.1).adjoint := by rfl @[simp] theorem inverseMetricTower_apply (t : Icc (0 : ℝ) D.T) (x : LiftDomain P) : ((inverseMetricTower D P).coefficient t).coefficient x = - (D.F.field t x.1).adjoint.comp (D.F.field t x.1) := rfl + (D.F.field t x.1).adjoint.comp (D.F.field t x.1) := by rfl @[simp] theorem linearTower_apply (t : Icc (0 : ℝ) D.T) (x : LiftDomain P) : ((linearTower D P).coefficient t).coefficient x = - (2 : ℝ) • (D.FInv.field t x.1).comp (D.F₁.field t x.1) := rfl + (2 : ℝ) • (D.FInv.field t x.1).comp (D.F₁.field t x.1) := by rfl theorem quadraticTower_apply (κ : ℝ) (i : Fin 3) (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..bb1fb62fd4 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 @@ -358,6 +359,7 @@ namespace Guards variable (A : Guards hτ hτT P H) /-- Source velocity, given by `uncutVelocity τ hτ hτT H A.terminal t x`. -/ +@[expose] def sourceVelocity (x : Space) (t : ℝ) : Space := uncutVelocity τ hτ hτT H A.terminal t x omit [CompleteSpace U] in @@ -483,6 +485,7 @@ theorem error_le_scaled_error : P.totalError hτ hτT H A.CM A.CH A.radius ≤ /-- Every new analytic component is the actual source field or the selected stationary/forward primary. The parent input and scalar guard record contain none of this record's new-field conclusions. -/ +@[expose] def geometryData (Ω : Set Space) (h0 : 0 ∈ Ω) (hΩ : ∀ x ∈ Ω, ‖x‖ ≤ A.radius) : PhysicalGeometryData {x : Space // x ∈ Ω} where center := ⟨0,h0⟩ @@ -556,15 +559,15 @@ def geometryData (Ω : Set Space) (h0 : 0 ∈ Ω) (hΩ : ∀ x ∈ Ω, ‖x‖ theorem geometryData_matrix (Ω : Set Space) (h0 : 0 ∈ Ω) (hΩ : ∀ x ∈ Ω, ‖x‖ ≤ A.radius) (x : {x : Space // x ∈ Ω}) (t : ℝ) : - (A.geometryData Ω h0 hΩ).M x t=D.M.field (D.clamp t) x := rfl + (A.geometryData Ω h0 hΩ).M x t=D.M.field (D.clamp t) x := by rfl theorem geometryData_ray (Ω : Set Space) (h0 : 0 ∈ Ω) (hΩ : ∀ x ∈ Ω, ‖x‖ ≤ A.radius) (x : {x : Space // x ∈ Ω}) (t : ℝ) : - (A.geometryData Ω h0 hΩ).r x t=D.normal.field (D.clamp t) x := rfl + (A.geometryData Ω h0 hΩ).r x t=D.normal.field (D.clamp t) x := by rfl theorem geometryData_velocity (Ω : Set Space) (h0 : 0 ∈ Ω) (hΩ : ∀ x ∈ Ω, ‖x‖ ≤ A.radius) (x : {x : Space // x ∈ Ω}) (t : ℝ) : - (A.geometryData Ω h0 hΩ).w x t=uncutVelocity τ hτ hτT H A.terminal t x := rfl + (A.geometryData Ω h0 hΩ).w x t=uncutVelocity τ hτ hτT H A.terminal t x := by rfl end Guards end EulerPacketSourceGeometry diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceGeometryData.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceGeometryData.lean index 01115ad94d..5c35cd62c6 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,37 @@ 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 τ`. -/ +@[expose] 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 τ)))`. -/ +@[expose] 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..6603e265f2 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 @@ -22,11 +22,11 @@ namespace EulerPacketCylinderField open Set EulerSmoothLimit EulerMeanCoefficients EulerPacketPointJets EulerPacketProfileRecursion /-- Change time, given by `h ▸ G`. -/ -def MatrixCoefficient.changeTime {T T' : ℝ} {raw : Domain → Space →L[ℝ] Space} +@[expose] def MatrixCoefficient.changeTime {T T' : ℝ} {raw : Domain → Space →L[ℝ] Space} (G : MatrixCoefficient T raw) (h : T = T') : MatrixCoefficient T' raw := h ▸ G /-- Change time, given by `h ▸ G`. -/ -def VectorCoefficient.changeTime {T T' : ℝ} {raw : VectorField} +@[expose] def VectorCoefficient.changeTime {T T' : ℝ} {raw : VectorField} (G : VectorCoefficient T raw) (h : T = T') : VectorCoefficient T' raw := h ▸ G variable (P : ℝ) [Fact (0 < P)] (M : EulerMeanPacketProvider.Data) @@ -34,7 +34,7 @@ variable (P : ℝ) [Fact (0 < P)] (M : EulerMeanPacketProvider.Data) (D : EulerTransversePacketProvider.Data U) (I : EulerTransversePacketProvider.InitialData P D) /-- Every linear solve and the curl corrector is the concrete source construction. -/ -def sourceOperators : Operators where +@[expose] def sourceOperators : Operators where interval := Icc (0 : ℝ) M.T period := P inverseFrame z := D.FInv.field (D.clamp z.1) z.2.1 @@ -45,6 +45,7 @@ def sourceOperators : Operators where curlCorrector := D.curlCorrector P /-- No regularity of a solved field or abstract operator family is an input here. -/ +@[expose] def sourceCoefficientData (hT : M.T = D.T) : CoefficientData P M.T (sourceOperators P M D I) where period_eq := rfl interval_eq := rfl 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..6af9b14c96 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 @@ -102,6 +102,7 @@ variable (P : ℝ) [Fact (0 < P)] (M : EulerMeanPacketProvider.Data) (I Iprimary : EulerTransversePacketProvider.InitialData P D) /-- Source time, given by `⟨t,by rw [← hT]; exact t.property⟩`. -/ +@[expose] def sourceTime (t : Icc (0 : ℝ) M.T) : Icc (0 : ℝ) D.T := ⟨t,by rw [← hT]; exact t.property⟩ @@ -162,7 +163,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..381d532da1 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,11 +86,12 @@ 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 (sourceCoefficientData P M D I hT) rfl rfl rfl p`. -/ +@[expose] def sourceProfileWitness (p : ℕ) : ProfileRegularity P M.T M.T_pos.le D.support (sourceProfiles P M D I Iprimary p) := constructedProfileWitness M D hT I Iprimary (sourceCoefficientData P M D I hT) rfl rfl rfl p diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketSourcePropagator.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketSourcePropagator.lean index ce0970f6b0..21dd72e825 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 @@ -65,7 +65,7 @@ abbrev fundamental := fundamentalPath D.T D.T_pos.le (sourceGenerator D.frame D.frameDerivative D.frameLower D.frameLower_pos D.frame_lower) /-- Propagator, given by `((fundamental D).forward t x).comp ((fundamental D).backward s x)`. -/ -def propagator (t s : Icc (0 : ℝ) D.T) (x : Space) : U →L[ℝ] U := +@[expose] def propagator (t s : Icc (0 : ℝ) D.T) (x : Space) : U →L[ℝ] U := ((fundamental D).forward t x).comp ((fundamental D).backward s x) /-- Coordinate, given by `extendPath D.T D.T_pos.le (fundamental D).forward t x ((fundamental @@ -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 @@ -134,9 +134,8 @@ theorem physical_hasDerivWithinAt (s t : Icc (0 : ℝ) D.T) (x : Space) (v : U) exact (not_le_of_gt D.normalLower_pos) hn have he : gram (D.frame.field t x) b = (D.frame.field t x).adjoint (0-(2 : ℝ) • D.frameDerivative.field t x a) := by - change gram (D.frame.field t x) ((-2 : ℝ) • - gramInverse (D.frame.field t x) D.frameLower D.frameLower_pos (D.frame_lower t x) - ((D.frame.field t x).adjoint (D.frameDerivative.field t x a))) = _ + simp only [b, sourceGenerator, EulerBoundedFieldForwardGenerator.generatorPath_apply, + smul_apply, comp_apply] rw [map_smul,gram_inverse_apply,map_sub,map_zero,map_smul] module have hb := physical_velocity_balance (D.frame.field t x) (D.frameDerivative.field t x) @@ -151,7 +150,7 @@ theorem physical_hasDerivWithinAt (s t : Icc (0 : ℝ) D.T) (x : Space) (v : U) /-- A physical growth assertion is tested only on genuine solutions of the literal tangent ODE, with the actual transported normal. -/ -def PhysicalGrowth (S : Set Space) (g : Icc (0 : ℝ) D.T → ℝ) (C : ℝ) : Prop := +@[expose] def PhysicalGrowth (S : Set Space) (g : Icc (0 : ℝ) D.T → ℝ) (C : ℝ) : Prop := ∀ x ∈ S, ∀ w : ℝ → Space, (∀ t : Icc (0 : ℝ) D.T, HasDerivWithinAt w (physicalRhs D t x (w t)) (Icc (0 : ℝ) D.T) t) → ⟪D.normal.field ⟨0,le_rfl,D.T_pos.le⟩ x,w 0⟫_ℝ = 0 → diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceRadiusPolynomial.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceRadiusPolynomial.lean index 82d2e29997..fe74b19910 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 @@ -47,6 +47,7 @@ def primitiveLift (W : ℝ) : ℝ := /-- Source radius envelope, given by `let V := primitiveLift W 1+V+6*weakEnvelope V*(16*V+1)+64*V+2*forwardEnvelope V*(64*V+1)`. -/ +@[expose] def sourceRadiusEnvelope (W : ℝ) : ℝ := let V := primitiveLift W 1+V+6*weakEnvelope V*(16*V+1)+64*V+2*forwardEnvelope V*(64*V+1) 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..3bc1569d28 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 @@ -97,6 +97,7 @@ variable (P : ℝ) [Fact (0 < P)] (M : EulerMeanPacketProvider.Data) (I Iprimary : EulerTransversePacketProvider.InitialData P D) /-- Source tail grade field, constructed using `ProfileRegularity.tailGradeField`. -/ +@[expose] def sourceTailGradeField (N n : ℕ) (hn : N + 1 ≤ n) : Field P M.T (fun z => recursiveGrade (sourceOperators P M D I) N (sourceProfiles P M D I Iprimary) z n) := @@ -106,6 +107,7 @@ def sourceTailGradeField (N n : ℕ) (hn : N + 1 ≤ n) : /-- Source literal tail grade field, constructed using `ProfileRegularity.literalTailGradeField`. -/ +@[expose] def sourceLiteralTailGradeField (N n : ℕ) (hn : N + 1 ≤ n) : Field P M.T (fun z => slicedMomentumGrade (Icc (0 : ℝ) M.T) (N+1) ((sourceOperators P M D I).inverseFrame z) @@ -119,9 +121,10 @@ def sourceLiteralTailGradeField (N n : ℕ) (hn : N + 1 ≤ n) : theorem sourceLiteralTailGradeField_path (N n : ℕ) (hn : N + 1 ≤ n) : (sourceLiteralTailGradeField P M D hT I Iprimary N n hn).path = - (sourceTailGradeField P M D hT I Iprimary N n hn).path := rfl + (sourceTailGradeField P M D hT I Iprimary N n hn).path := by rfl /-- Source tail sum field, constructed using `ProfileRegularity.tailSumField`. -/ +@[expose] def sourceTailSumField (N : ℕ) (κ : ℝ) : Field P M.T (fun z => ∑ n ∈ Ico (N+1) (2*N+3), κ^n • recursiveGrade (sourceOperators P M D I) N (sourceProfiles P M D I Iprimary) z n) := @@ -131,6 +134,7 @@ def sourceTailSumField (N : ℕ) (κ : ℝ) : /-- Source residual field, given by `(sourceTailSumField P M D hT I Iprimary N κ).congr (source_residual_tail P M D hT I Iprimary Cagree N hN κ hκ)`. -/ +@[expose] def sourceResidualField (Cagree : SourceCoefficientAgreement M D) (N : ℕ) (hN : 1 ≤ N) (κ : ℝ) (hκ : κ ≠ 0) : Field P M.T (fun z => slicedMomentumResidual (Icc (0 : ℝ) M.T) κ 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..01b3515e86 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 @@ -133,7 +133,7 @@ theorem actualGoodCost_le (J : ℕ) (hJ : 1 ≤ J) (X : ℝ) (mul_nonneg (exp_pos _).le (exp_pos _).le) /-- Actual extra time, given by `2*sqrt (a*previousShear J X n)*timeWidth J X (n+1)`. -/ -def actualExtraTime (J : ℕ) (X a : ℝ) (n : ℕ) : ℝ := +@[expose] def actualExtraTime (J : ℕ) (X a : ℝ) (n : ℕ) : ℝ := 2*sqrt (a*previousShear J X n)*timeWidth J X (n+1) theorem actualExtraTime_small (J D : ℕ) (hJ : 3 ≤ J) (C c X δ : ℝ) @@ -196,10 +196,10 @@ 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 +@[expose] def horizon (J : ℕ) (X a β : ℝ) (n : ℕ) : ℝ := targetTime J X β n+actualExtraTime J X a n /-- Stage guards data, collecting `epsilon_pos`, `epsilon_small`, `sigma_pos`, `sigma_small`, `reciprocal_pos`, `reciprocal_small` and their compatibility conditions. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceScaleSequence.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceScaleSequence.lean index 9b35338936..faed3ac343 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 @@ -1119,7 +1119,7 @@ instance : Fintype SourceCost where complete c := by cases c <;> simp /-- Source cost spec used in packet source scale choice. -/ -def sourceCostSpec (C c : ℝ) (hC : 1 ≤ C) (A : ℕ) : SourceCost → CostSpec +@[expose] def sourceCostSpec (C c : ℝ) (hC : 1 ≤ C) (A : ℕ) : SourceCost → CostSpec | .shear => { d := 2, B := 9, N := 7, a := 7, b := 1/2, c := 2, C := 128*(2*C)^(A+1), p := 2*(A+1), q := 2*(A+1), @@ -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..ffdf3ed126 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 @@ -35,6 +35,7 @@ variable (P : ℝ) [Fact (0 < P)] (M : EulerMeanPacketProvider.Data) /-- Source packet pullback field as an element of `Field P M.T (fun z => (sourceOperators P M D I).inverseFrame z (fieldSum (N+1) κ (assembledVelocity N (sourceProfiles P M D I Iprimary)) z))`. -/ +@[expose] def sourcePacketPullbackField (N : ℕ) (κ : ℝ) : Field P M.T (fun z => (sourceOperators P M D I).inverseFrame z (fieldSum (N+1) κ (assembledVelocity N (sourceProfiles P M D I Iprimary)) z)) := by @@ -68,7 +69,7 @@ def sourcePacketPullbackField (N : ℕ) (κ : ℝ) : theorem sourcePacketPullbackField_path (N : ℕ) (κ : ℝ) : (sourcePacketPullbackField P M D hT I Iprimary N κ).path = ∑ i ∈ range N, ((sourcePairField P M D hT I Iprimary κ (i+1)).path + - κ^(i+1) • (sourceMeanPullbackField P M D hT I Iprimary (i+1)).path) := rfl + κ^(i+1) • (sourceMeanPullbackField P M D hT I Iprimary (i+1)).path) := by rfl theorem sourcePacketPullbackField_mem (A : SourceCoefficientAgreement M D) (N : ℕ) (κ : ℝ) (t : Icc (0 : ℝ) M.T) diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceUniformEnvelope.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceUniformEnvelope.lean index 68cc608ff1..c82f2002b6 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 @@ -27,7 +27,7 @@ namespace EulerPacketUniformSource open EulerParentInitializedRadius EulerPolynomialCost /-- Profile envelope, given by `1+sourceEnvelope X+8*Real.exp 6*X*(1+sourceEnvelope X)`. -/ -def profileEnvelope (X : ℝ) : ℝ := +@[expose] def profileEnvelope (X : ℝ) : ℝ := 1+sourceEnvelope X+8*Real.exp 6*X*(1+sourceEnvelope X) /-- Profile polynomial, given by `1+sourcePolynomial+Polynomial.C (8*Real.exp 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..693827a828 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 @@ -62,7 +62,7 @@ variable {A : Parent} {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ (m' : Space) (hm' : ‖m'‖ = 1) (R' : V ≃ₗᵢ[ℝ] referencePlane m') /-- Reframe, bundling `B`, `B₁`, `m`, `v` and the required compatibility proofs. -/ -def reframe : ParentFrame (A.transverseData m' hm' R' S hS) τ where +@[expose] def reframe : ParentFrame (A.transverseData m' hm' R' S hS) τ where B := P.B B₁ := P.B₁ m := P.m @@ -128,7 +128,7 @@ end end -@[expose] public section +public section noncomputable section @@ -144,7 +144,7 @@ variable {A : Parent} {U : Type} [NormedAddCommGroup U] [InnerProductSpace ℝ U (P : ParentFrame (A.transverseData m hm R S hS) τ) /-- Cross direction, given by `cross (unit (P.m τ)) (unit (P.v τ))`. -/ -def crossDirection : Space := cross (unit (P.m τ)) (unit (P.v τ)) +@[expose] def crossDirection : Space := cross (unit (P.m τ)) (unit (P.v τ)) theorem crossDirection_unit (hτT : τ ≤ A.T) : ‖P.crossDirection‖=1 := by exact (frame_orthonormal (unit (P.m τ)) (unit (P.v τ)) @@ -162,7 +162,7 @@ variable (hτ : 0 < τ) (hτT : τ < A.T) /-- Activation normal, given by `activationDirection ((A.transverseData m hm R S hS).deformationEquiv ⟨τ,hτ.le,hτT.le⟩ 0) P.crossDirection`. -/ -def activationNormal : Space := +@[expose] def activationNormal : Space := activationDirection ((A.transverseData m hm R S hS).deformationEquiv ⟨τ,hτ.le,hτT.le⟩ 0) P.crossDirection @@ -170,12 +170,12 @@ theorem activationNormal_unit : ‖P.activationNormal hτ hτT‖=1 := activationDirection_unit _ (P.crossDirection_ne_zero hτT.le) /-- Activation data, constructed using `A.transverseData`. -/ -def activationData : Data (referencePlane (P.activationNormal hτ hτT)) := +@[expose] def activationData : Data (referencePlane (P.activationNormal hτ hτT)) := A.transverseData (P.activationNormal hτ hτT) (P.activationNormal_unit hτ hτT) (LinearIsometryEquiv.refl ℝ (referencePlane (P.activationNormal hτ hτT))) S hS /-- Activation frame, constructed using `P.reframe`. -/ -def activationFrame : ParentFrame (P.activationData hτ hτT) τ := +@[expose] def activationFrame : ParentFrame (P.activationData hτ hτT) τ := P.reframe (P.activationNormal hτ hτT) (P.activationNormal_unit hτ hτT) (LinearIsometryEquiv.refl ℝ (referencePlane (P.activationNormal hτ hτT))) @@ -210,7 +210,7 @@ theorem activation_scaled_ray : (P.tangent τ ⟨le_rfl,hτT.le⟩) (P.activation_normal_choice hτ hτT) /-- Activation history, constructed using `A.historyOn`. -/ -def activationHistory (H : LowBounds A) : +@[expose] def activationHistory (H : LowBounds A) : HistoryData ((P.activationData hτ hτT).initial τ hτ hτT.le) := A.historyOn H (P.activationNormal hτ hτT) (P.activationNormal_unit hτ hτT) (LinearIsometryEquiv.refl ℝ (referencePlane (P.activationNormal hτ hτT))) S hS τ hτ hτT @@ -234,13 +234,13 @@ variable {A : Parent} {U : Type} [NormedAddCommGroup U] [InnerProductSpace ℝ U (P : ParentFrame (A.transverseData m hm R S hS) 0) /-- Forward data, constructed using `A.transverseData`. -/ -def forwardData : Data (referencePlane P.crossDirection) := +@[expose] def forwardData : Data (referencePlane P.crossDirection) := A.transverseData P.crossDirection (P.crossDirection_unit A.T_pos.le) (LinearIsometryEquiv.refl ℝ (referencePlane P.crossDirection)) S hS /-- Forward frame, given by `P.reframe P.crossDirection (P.crossDirection_unit A.T_pos.le) (LinearIsometryEquiv.refl ℝ (referencePlane P.crossDirection))`. -/ -def forwardFrame : ParentFrame P.forwardData 0 := +@[expose] def forwardFrame : ParentFrame P.forwardData 0 := P.reframe P.crossDirection (P.crossDirection_unit A.T_pos.le) (LinearIsometryEquiv.refl ℝ (referencePlane P.crossDirection)) @@ -273,7 +273,7 @@ end end -@[expose] public section +public section noncomputable section @@ -368,7 +368,7 @@ theorem history_layer (hn : n ≠ 0) : 1 ≤ previousShear S.J S.X n*P.time := b /-- Joined normal, given by `P.restrictedFrame.activationNormal (P.time_pos hn) P.time_lt_nextHorizon`. -/ -def joinedNormal (hn : n ≠ 0) : Space := +@[expose] def joinedNormal (hn : n ≠ 0) : Space := P.restrictedFrame.activationNormal (P.time_pos hn) P.time_lt_nextHorizon theorem joinedNormal_unit (hn : n ≠ 0) : ‖P.joinedNormal hn‖=1 := @@ -376,17 +376,17 @@ theorem joinedNormal_unit (hn : n ≠ 0) : ‖P.joinedNormal hn‖=1 := /-- Joined data, given by `P.restrictedFrame.activationData (P.time_pos hn) P.time_lt_nextHorizon`. -/ -def joinedData (hn : n ≠ 0) : Data (referencePlane (P.joinedNormal hn)) := +@[expose] def joinedData (hn : n ≠ 0) : Data (referencePlane (P.joinedNormal hn)) := P.restrictedFrame.activationData (P.time_pos hn) P.time_lt_nextHorizon /-- Joined frame, given by `P.restrictedFrame.activationFrame (P.time_pos hn) P.time_lt_nextHorizon`. -/ -def joinedFrame (hn : n ≠ 0) : ParentFrame (P.joinedData hn) P.time := +@[expose] def joinedFrame (hn : n ≠ 0) : ParentFrame (P.joinedData hn) P.time := P.restrictedFrame.activationFrame (P.time_pos hn) P.time_lt_nextHorizon /-- Joined history, given by `P.restrictedFrame.activationHistory (P.time_pos hn) P.time_lt_nextHorizon P.restrictedLow`. -/ -def joinedHistory (hn : n ≠ 0) : +@[expose] def joinedHistory (hn : n ≠ 0) : HistoryData ((P.joinedData hn).initial P.time (P.time_pos hn) P.time_lt_nextHorizon.le) := P.restrictedFrame.activationHistory (P.time_pos hn) P.time_lt_nextHorizon P.restrictedLow @@ -441,20 +441,20 @@ section ForwardData variable {c B : ℝ} {S : Scales c B} (P : Stage S 0) /-- Zero frame, given by `P.restrictedFrame.changeActivation (P.time_zero rfl)`. -/ -def zeroFrame : ParentFrame (frameData P.restrictedParent) 0 := +@[expose] def zeroFrame : ParentFrame (frameData P.restrictedParent) 0 := P.restrictedFrame.changeActivation (P.time_zero rfl) /-- Forward normal, given by `P.zeroFrame.crossDirection`. -/ -def forwardNormal : Space := P.zeroFrame.crossDirection +@[expose] def forwardNormal : Space := P.zeroFrame.crossDirection theorem forwardNormal_unit : ‖P.forwardNormal‖=1 := P.zeroFrame.crossDirection_unit P.restrictedParent.T_pos.le /-- Forward data, given by `P.zeroFrame.forwardData`. -/ -def forwardData : Data (referencePlane P.forwardNormal) := P.zeroFrame.forwardData +@[expose] def forwardData : Data (referencePlane P.forwardNormal) := P.zeroFrame.forwardData /-- Forward frame, given by `P.zeroFrame.forwardFrame`. -/ -def forwardFrame : ParentFrame P.forwardData 0 := P.zeroFrame.forwardFrame +@[expose] def forwardFrame : ParentFrame P.forwardData 0 := P.zeroFrame.forwardFrame @[simp] theorem forwardFrame_a : P.forwardFrame.a=P.frame.a := P.zeroFrame.forward_parameters.1.trans @@ -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 @@ -671,7 +671,7 @@ theorem forwardError_bound (ρ E N : ℝ) (hρ : 0 ≤ ρ) (hE : P.error ≤ E) hρ).trans hN) /-- Forward geometry guards of stage as an element of `ForwardGuards P`. -/ -def forwardGeometryGuardsOfStage +@[expose] def forwardGeometryGuardsOfStage (J D : ℕ) (C c X : ℝ) (a β : ℕ → ℝ) (n : ℕ) (CF : ℝ) (hCF : 1 ≤ CF) (stage : StageGuards J D C c X (neighborStabilityConstant * CF ^ 2) a β n) @@ -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 @@ -1070,6 +1070,7 @@ theorem joined_neighbor : P.label_eq.le htime hcost hq (degree_le_requiredExponent.trans hq) P.scale_eq.le /-- Joined guards, constructed using `P.restrictedState.labels.geometryGuardsOfStage`. -/ +@[expose] def joinedGuards : Guards (P.time_pos hn) P.time_lt_nextHorizon (P.joinedFrame hn) (P.joinedHistory hn) := P.restrictedState.labels.geometryGuardsOfStage @@ -1116,7 +1117,7 @@ theorem joined_source_neighbor : /-- Joined geometry, given by `(P.joinedGuards hn hq hB).lowGeometry (by rw [P.joinedGuards_radius]; norm_num)`. -/ -def joinedGeometry : PhysicalGeometryData {x : Space // ‖x‖ ≤ (1/2 : ℝ)} := +@[expose] def joinedGeometry : PhysicalGeometryData {x : Space // ‖x‖ ≤ (1/2 : ℝ)} := (P.joinedGuards hn hq hB).lowGeometry (by rw [P.joinedGuards_radius]; norm_num) theorem joinedGeometry_targetTime : (P.joinedGeometry hn hq hB).targetTime=P.nextTime := by @@ -1142,7 +1143,7 @@ theorem forward_neighbor : P.restrictedState.labels.strainDifferenceCost*P.restr ((forwardThreshold_le_common _ _).trans (hB.trans (S.previous_floor 0))) hq P.scale_eq.le /-- Forward guards, constructed using `P.restrictedState.labels.forwardGeometryGuardsOfStage`. -/ -def forwardGuards : ForwardGuards P.forwardFrame := +@[expose] def forwardGuards : ForwardGuards P.forwardFrame := P.restrictedState.labels.forwardGeometryGuardsOfStage P.forwardNormal P.forwardNormal_unit (LinearIsometryEquiv.refl ℝ (referencePlane P.forwardNormal)) support compact P.forwardFrame S.J S.D 4 (q : ℝ) S.X (fun _ => P.frame.a) (fun _ => P.frame.sigma^2) 0 @@ -1169,7 +1170,7 @@ theorem forward_source_neighbor : /-- Forward geometry, given by `(P.forwardGuards hq hB).lowGeometry (by rw [P.forwardGuards_radius]; norm_num)`. -/ -def forwardGeometry : PhysicalGeometryData {x : Space // ‖x‖ ≤ (1/2 : ℝ)} := +@[expose] def forwardGeometry : PhysicalGeometryData {x : Space // ‖x‖ ≤ (1/2 : ℝ)} := (P.forwardGuards hq hB).lowGeometry (by rw [P.forwardGuards_radius]; norm_num) theorem forwardGeometry_targetTime : (P.forwardGeometry hq hB).targetTime=P.nextTime := by diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketStageInitialLimit.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketStageInitialLimit.lean index 368b8a56a6..41c896b8c7 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 @@ -193,10 +193,11 @@ theorem initialTail_frequency (i : ℕ) : (A i).frequencyGuard (frequency J X i) exact (P (1+i)).joinedInput_frequency (by omega) hq hB /-- Initial base, given by `(P 1).state.regularity.velocity (P 1).parent.zeroTime`. -/ +@[expose] def initialBase : SmoothL2Field Space := (P 1).state.regularity.velocity (P 1).parent.zeroTime /-- Initial data limit, constructed using `EulerPacketInitial.fullInitialLimit`. -/ -def initialDataLimit : SmoothL2Field Space := +@[expose] def initialDataLimit : SmoothL2Field Space := EulerPacketInitial.fullInitialLimit A J (by have h := S.stage_large; omega) (sourceConstant 4) 320 (sourceConstant_pos 4) (by norm_num) 20 1000 X (S.sequence_one 1) (initialTail_parameter P hq hB) (initialTail_scale P hq hB) (initialTail_sigma P hq hB) diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketStageInputs.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketStageInputs.lean index 49457a0591..1ac127bc3a 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 @@ -116,7 +116,7 @@ variable {q : ℕ} {B : ℝ} {S : Scales (q : ℝ) B} {n : ℕ} (P : Stage S n) /-- Joined input, bundling `parent`, `label`, `low`, `normal` and the required compatibility proofs. -/ -def joinedInput : EulerPacketInitial.Input (referencePlane (P.joinedNormal hn)) where +@[expose] def joinedInput : EulerPacketInitial.Input (referencePlane (P.joinedNormal hn)) where parent := P.restrictedParent label := P.restrictedState.labels low := P.restrictedLow @@ -192,7 +192,7 @@ variable {q : ℕ} {B : ℝ} {S : Scales (q : ℝ) B} (P : Stage S 0) /-- Forward input, bundling `parent`, `label`, `low`, `normal` and the required compatibility proofs. -/ -def forwardInput : GeometryForwardInput (referencePlane P.forwardNormal) where +@[expose] def forwardInput : GeometryForwardInput (referencePlane P.forwardNormal) where parent := P.restrictedParent label := P.restrictedState.labels low := P.restrictedLow 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..8d2610064e 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 @@ -39,6 +39,7 @@ variable {A : Parent} {U : Type} [NormedAddCommGroup U] [InnerProductSpace ℝ U (S : ℝ) (hS : 0 < S) (hST : S ≤ A.T) (hτ : 0 ≤ τ) /-- Restrict time, bundling `B`, `B₁`, `m`, `v` and the required compatibility proofs. -/ +@[expose] def restrictTime : ParentFrame ((A.restrictTime S hS hST).transverseData m hm R support hSupport) τ where B := P.B @@ -73,14 +74,14 @@ def restrictTime : ParentFrame ((A.restrictTime S hS hST).transverseData m hm R A.restrictTime_strain S hS hST ts 0] exact h -@[simp] theorem restrictTime_a : (P.restrictTime S hS hST hτ).a=P.a := rfl -@[simp] theorem restrictTime_sigma : (P.restrictTime S hS hST hτ).sigma=P.sigma := rfl -@[simp] theorem restrictTime_shear : (P.restrictTime S hS hST hτ).shear=P.shear := rfl -@[simp] theorem restrictTime_epsilon : (P.restrictTime S hS hST hτ).epsilon=P.epsilon := rfl -@[simp] theorem restrictTime_G : (P.restrictTime S hS hST hτ).G=P.G := rfl -@[simp] theorem restrictTime_error : (P.restrictTime S hS hST hτ).error=P.error := rfl +@[simp] theorem restrictTime_a : (P.restrictTime S hS hST hτ).a=P.a := by rfl +@[simp] theorem restrictTime_sigma : (P.restrictTime S hS hST hτ).sigma=P.sigma := by rfl +@[simp] theorem restrictTime_shear : (P.restrictTime S hS hST hτ).shear=P.shear := by rfl +@[simp] theorem restrictTime_epsilon : (P.restrictTime S hS hST hτ).epsilon=P.epsilon := by rfl +@[simp] theorem restrictTime_G : (P.restrictTime S hS hST hτ).G=P.G := by rfl +@[simp] theorem restrictTime_error : (P.restrictTime S hS hST hτ).error=P.error := by rfl @[simp] theorem restrictTime_horizon : - (P.restrictTime S hS hST hτ).horizon=P.a*(S-τ)/P.epsilon := rfl + (P.restrictTime S hS hST hτ).horizon=P.a*(S-τ)/P.epsilon := by rfl end EulerPacketSourceGeometry.ParentFrame @@ -161,7 +162,7 @@ end end -@[expose] public section +public section noncomputable section @@ -182,7 +183,7 @@ def step : ℝ := def nextTime : ℝ := P.time+P.step /-- Next horizon, given by `P.nextTime+2*timeWidth S.J S.X (n+1)`. -/ -def nextHorizon : ℝ := P.nextTime+2*timeWidth S.J S.X (n+1) +@[expose] def nextHorizon : ℝ := P.nextTime+2*timeWidth S.J S.X (n+1) theorem step_bounds : timeWidth S.J S.X n/6 ≤ P.step ∧ P.step ≤ 2*timeWidth S.J S.X n/3 := @@ -243,40 +244,40 @@ theorem physical_target_eq_nextTime : /-- Restricted parent, given by `P.parent.restrictTime P.nextHorizon P.nextHorizon_pos P.nextHorizon_le`. -/ -def restrictedParent : Parent := +@[expose] def restrictedParent : Parent := P.parent.restrictTime P.nextHorizon P.nextHorizon_pos P.nextHorizon_le /-- Restricted state, given by `P.state.restrictTime P.nextHorizon P.nextHorizon_pos P.nextHorizon_le`. -/ -def restrictedState : SmoothState P.restrictedParent := +@[expose] def restrictedState : SmoothState P.restrictedParent := P.state.restrictTime P.nextHorizon P.nextHorizon_pos P.nextHorizon_le /-- Restricted low, given by `P.low.restrictTime P.nextHorizon P.nextHorizon_pos P.nextHorizon_le`. -/ -def restrictedLow : LowBounds P.restrictedParent := +@[expose] def restrictedLow : LowBounds P.restrictedParent := P.low.restrictTime P.nextHorizon P.nextHorizon_pos P.nextHorizon_le /-- Restricted frame, given by `P.frame.restrictTime P.nextHorizon P.nextHorizon_pos P.nextHorizon_le P.time_nonneg`. -/ -def restrictedFrame : ParentFrame (frameData P.restrictedParent) P.time := +@[expose] def restrictedFrame : ParentFrame (frameData P.restrictedParent) P.time := P.frame.restrictTime P.nextHorizon P.nextHorizon_pos P.nextHorizon_le P.time_nonneg -@[simp] theorem restrictedParent_time : P.restrictedParent.T=P.nextHorizon := rfl -@[simp] theorem restrictedParent_scale : P.restrictedParent.ell=P.parent.ell := rfl -@[simp] theorem restrictedState_label : P.restrictedState.labels.K=P.state.labels.K := rfl -@[simp] theorem restrictedLow_exterior : P.restrictedLow.Be=P.low.Be := rfl -@[simp] theorem restrictedLow_core : P.restrictedLow.Bc=P.low.Bc := rfl -@[simp] theorem restrictedLow_pressure : P.restrictedLow.K=P.low.K := rfl -@[simp] theorem restrictedLow_boundary : P.restrictedLow.L=P.low.L := rfl -@[simp] theorem restrictedLow_radius : P.restrictedLow.r=P.low.r := rfl -@[simp] theorem restrictedFrame_a : P.restrictedFrame.a=P.frame.a := rfl -@[simp] theorem restrictedFrame_sigma : P.restrictedFrame.sigma=P.frame.sigma := rfl -@[simp] theorem restrictedFrame_shear : P.restrictedFrame.shear=P.frame.shear := rfl -@[simp] theorem restrictedFrame_G : P.restrictedFrame.G=P.frame.G := rfl -@[simp] theorem restrictedFrame_error : P.restrictedFrame.error=P.frame.error := rfl -@[simp] theorem restrictedFrame_B : P.restrictedFrame.B=P.frame.B := rfl -@[simp] theorem restrictedFrame_m : P.restrictedFrame.m=P.frame.m := rfl -@[simp] theorem restrictedFrame_v : P.restrictedFrame.v=P.frame.v := rfl +@[simp] theorem restrictedParent_time : P.restrictedParent.T=P.nextHorizon := by rfl +@[simp] theorem restrictedParent_scale : P.restrictedParent.ell=P.parent.ell := by rfl +@[simp] theorem restrictedState_label : P.restrictedState.labels.K=P.state.labels.K := by rfl +@[simp] theorem restrictedLow_exterior : P.restrictedLow.Be=P.low.Be := by rfl +@[simp] theorem restrictedLow_core : P.restrictedLow.Bc=P.low.Bc := by rfl +@[simp] theorem restrictedLow_pressure : P.restrictedLow.K=P.low.K := by rfl +@[simp] theorem restrictedLow_boundary : P.restrictedLow.L=P.low.L := by rfl +@[simp] theorem restrictedLow_radius : P.restrictedLow.r=P.low.r := by rfl +@[simp] theorem restrictedFrame_a : P.restrictedFrame.a=P.frame.a := by rfl +@[simp] theorem restrictedFrame_sigma : P.restrictedFrame.sigma=P.frame.sigma := by rfl +@[simp] theorem restrictedFrame_shear : P.restrictedFrame.shear=P.frame.shear := by rfl +@[simp] theorem restrictedFrame_G : P.restrictedFrame.G=P.frame.G := by rfl +@[simp] theorem restrictedFrame_error : P.restrictedFrame.error=P.frame.error := by rfl +@[simp] theorem restrictedFrame_B : P.restrictedFrame.B=P.frame.B := by rfl +@[simp] theorem restrictedFrame_m : P.restrictedFrame.m=P.frame.m := by rfl +@[simp] theorem restrictedFrame_v : P.restrictedFrame.v=P.frame.v := by rfl theorem restrictedFrame_horizon : P.restrictedFrame.horizon=EulerPacketSourceScaleGuards.horizon S.J S.X 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..e7cfed0249 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 @@ -112,13 +112,13 @@ variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteS (hs : tsupport innerCutoff ⊆ D.support) /-- Initial data, bundling `value`, `orbit`, `mean_zero`. -/ -def initialData : InitialData period D where +@[expose] def initialData : InitialData period D where value := ⟨terminal δ hδ ξ,terminal_supported δ hδ ξ D.support D.support_measurable hs⟩ orbit := terminal_orbit_contDiff δ hδ ξ mean_zero := terminal_average_zero δ hδ ξ theorem initialData_value : ((initialData D δ hδ ξ hs).value : CylinderL2 period U) = - terminal δ hδ ξ := rfl + terminal δ hδ ξ := by rfl theorem initialData_bound {ι : Type*} [Fintype ι] (directions : ι → LiftTangent) (hd : ∀ i, ‖directions i‖ ≤ 1) (q : ℕ) 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..037fd45d3e 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 @@ -165,7 +165,7 @@ namespace Scales variable {K} /-- Compactness supplies the single grade-independent upper scale. -/ -def ofGrowth [CompactSpace K] (g : C(K, ℝ)) (hg : ∀ t, 0 < g t) : Scales K where +@[expose] def ofGrowth [CompactSpace K] (g : C(K, ℝ)) (hg : ∀ t, 0 < g t) : Scales K where growth := g growth_pos := hg H0 := max 1 ‖g‖ @@ -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..a8bd6af83e 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,12 +27,12 @@ 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)) /-- Frequency cost spec, bundling `d`, `B`, `N`, `a` and the required compatibility proofs. -/ -def frequencyCostSpec (A C c : ℝ) (hA : 0 < A) (hC : 0 < C) +@[expose] def frequencyCostSpec (A C c : ℝ) (hA : 0 < A) (hC : 0 < C) (p q N : ℕ) (θ : ℝ) (hθ : 0 < θ) : CostSpec where d := 1 B := 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..ff948da752 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 @@ -80,6 +80,7 @@ variable {P : ℝ} [Fact (0 < P)] {κ : ℝ} {hκ : |κ| ≤ 1} hSupport) P κ hκ Z R)) /-- Exact packet force, constructed using `force`. -/ +@[expose] def exactPacketForce (k : ℝ) (Y force : Icc (0 : ℝ) A.T → Space → Space) (t : Icc (0 : ℝ) A.T) (x : Space) : Space := force t x + A.ell • (A.inverse.field t (A.ell⁻¹ • Y t x)).adjoint @@ -169,7 +170,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 +301,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 +375,7 @@ end end -@[expose] public section +public section noncomputable section @@ -401,7 +402,7 @@ variable {A : Parent} (E : Evolution A) /-- Child, bundling `inverse`, `velocity`, `pressure`, `force` and the required compatibility proofs. -/ -def child : Evolution (A.child G k m hgraph nextEll hnext hnext1) where +@[expose] def child : Evolution (A.child G k m hgraph nextEll hnext hnext1) where inverse := E.inverse.child G k m hgraph nextEll hnext hnext1 velocity := A.exactPacketVelocity m hm J support hSupport B residual k E.inverse.field E.velocity pressure := A.exactPacketPressure m hm J support hSupport B residual k E.inverse.field E.pressure @@ -434,15 +435,18 @@ def child : Evolution (A.child G k m hgraph nextEll hnext hnext1) where @[simp] theorem child_velocity : (E.child m hm J support hSupport B residual V hV G hG k hk hgraph nextEll hnext hnext1).velocity = - A.exactPacketVelocity m hm J support hSupport B residual k E.inverse.field E.velocity := rfl + A.exactPacketVelocity m hm J support hSupport B residual k E.inverse.field E.velocity := by + rfl @[simp] theorem child_pressure : (E.child m hm J support hSupport B residual V hV G hG k hk hgraph nextEll hnext hnext1).pressure = - A.exactPacketPressure m hm J support hSupport B residual k E.inverse.field E.pressure := rfl + A.exactPacketPressure m hm J support hSupport B residual k E.inverse.field E.pressure := by + rfl @[simp] theorem child_force : (E.child m hm J support hSupport B residual V hV G hG k hk hgraph nextEll hnext hnext1).force = - A.exactPacketForce m hm J support hSupport B residual k E.inverse.field E.force := rfl + A.exactPacketForce m hm J support hSupport B residual k E.inverse.field E.force := by + rfl end EulerParentPacketFrames.Evolution diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentEulerLowBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentEulerLowBounds.lean index 49b39245a5..3d01f8917c 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 @@ -70,7 +70,7 @@ theorem initial_gradient_lower_core (H : LowBounds A) (x : Space) simpa only [smul_smul,mul_inv_cancel₀ A.ell_pos.ne',one_smul] using h /-- Low bounds from physical, constructed using `A.lowBoundsOfPhysical`. -/ -def lowBoundsFromPhysical (Be Bc L r K : ℝ) +@[expose] def lowBoundsFromPhysical (Be Bc L r K : ℝ) (hBe : 0 ≤ Be) (hBc : 0 ≤ Bc) (hL : boundaryLocalizationC1 * Bc ≤ L) (hr : 0 ≤ r) (hrq : r ≤ 1 / 4) (hK : 0 ≤ K) (hexterior : ∀ x, r ≤ ‖x‖ → ∀ z : Space, @@ -87,7 +87,7 @@ def lowBoundsFromPhysical (Be Bc L r K : ℝ) hexterior hcore hpressure hsmall /-- Update low bounds, constructed using `F.lowBoundsFromPhysical`. -/ -def updateLowBounds {N : Parent} (F : Evolution N) (H : LowBounds A) +@[expose] def updateLowBounds {N : Parent} (F : Evolution N) (H : LowBounds A) (e K : ℝ) (he : 0 ≤ e) (hK : 0 ≤ K) (herror : ∀ x, ‖fderiv ℝ (fun y => F.velocity (0, y)) x - fderiv ℝ (fun y => E.velocity (0, y)) x‖ ≤ e) 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..c099204c6e 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 @@ -130,6 +130,7 @@ theorem curvature_eq (t : Icc (0 : ℝ) A.T) (x : Space) : /-- Restrict time, bundling `inverse`, `velocity`, `pressure`, `force` and the required compatibility proofs. -/ +@[expose] def restrictTime (S : ℝ) (hS : 0 < S) (hST : S ≤ A.T) : Evolution (A.restrictTime S hS hST) where inverse := E.inverse.restrictTime S hS hST diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentForwardGeometryInput.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentForwardGeometryInput.lean index c2f8c71781..58cf3248cb 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 @@ -27,6 +27,7 @@ variable {U : Type} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteSp {D : Data U} {P : ParentFrame D 0} (G : ForwardGuards P) (hball : (1 / 2 : ℝ) ≤ G.radius) /-- Source growth profile, given by `(G.halfBall_controlledGrowth hball).choose`. -/ +@[expose] def sourceGrowthProfile : C(Icc (0 : ℝ) D.T,ℝ) := (G.halfBall_controlledGrowth hball).choose theorem sourceGrowthProfile_positive (t : Icc (0 : ℝ) D.T) : 0 < G.sourceGrowthProfile hball t := @@ -71,6 +72,7 @@ variable {A : Parent} (L : LabelData A) (H : LowBounds A) (hsub : support ⊆ Ω) (hΩball : ∀ x ∈ Ω, ‖x‖ ≤ (1 / 2 : ℝ)) /-- Geometry forward raw, constructed using `EulerPacketParentPhysicalBudgets.forwardBudget`. -/ +@[expose] def geometryForwardRaw : EulerTransversePacketForward.Budget (A.transverseData m hm J support hSupport) (Fin 4) 6 := EulerPacketParentPhysicalBudgets.forwardBudget (A.transverseData m hm J support hSupport) 6 @@ -83,6 +85,7 @@ def geometryForwardRaw : /-- Geometry forward inputs as an element of `ForwardInputs (A.meanData H) (A.transverseData m hm J support hSupport)`. -/ +@[expose] def geometryForwardInputs (Ti : ℝ) (hT1 : A.T ≤ 1) (hTi : A.T⁻¹ ≤ Ti) : ForwardInputs (A.meanData H) (A.transverseData m hm J support hSupport) := by let V := L.geometryForwardRaw m hm J support hSupport P G hball Ω hΩ hΩo hsub hΩball @@ -100,6 +103,7 @@ def geometryForwardInputs (Ti : ℝ) (hT1 : A.T ≤ 1) (hTi : A.T⁻¹ ≤ Ti) : theorem geometryForwardInputs_growth (Ti : ℝ) (hT1 : A.T ≤ 1) (hTi : A.T⁻¹ ≤ Ti) : (L.geometryForwardInputs H m hm J support hSupport P G hball Ω hΩ hΩo hsub hΩball - Ti hT1 hTi).linear.g=G.sourceGrowthProfile hball := rfl + Ti hT1 hTi).linear.g=G.sourceGrowthProfile hball := by + rfl end EulerParentPacketFrames.LabelData diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentForwardInitialSupport.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentForwardInitialSupport.lean index 1e1a270c9c..555c9cd6fb 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 @@ -58,7 +58,8 @@ theorem normalizedPacketVelocity_forwardInitialized (t : Icc (0 : ℝ) A.T) : forwardInitializedExactPhysicalVelocity (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 Q t (I.normalized t) := rfl + (A.sourceAgreement m hm J support hSupport H) N hN k hk Q t (I.normalized t) := by + rfl theorem normalizedPacketPressure_forwardInitialized (t : Icc (0 : ℝ) A.T) : A.normalizedPacketPressure m hm J support hSupport Q @@ -69,7 +70,8 @@ theorem normalizedPacketPressure_forwardInitialized (t : Icc (0 : ℝ) A.T) : forwardInitializedExactPhysicalPressure (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 Q t (I.normalized t) := rfl + (A.sourceAgreement m hm J support hSupport H) N hN k hk Q t (I.normalized t) := by + rfl theorem exactForwardPacket_initial_increment_support (hL : H.L = 0) diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentForwardUniformCosts.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentForwardUniformCosts.lean index ecde3e24df..76f4c70b53 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 @@ -183,7 +183,7 @@ local notation "BC" => forwardCoefficientBudget period (G.meanData H) /-- Geometry forward parameter size, given by `parameterSize L.K 0 Ti (560*P.horizon^10/P.epsilon) H.L J.δ ‖ξ‖+J.hchild`. -/ -def geometryForwardParameterSize (ξ : U) : ℝ := +@[expose] def geometryForwardParameterSize (ξ : U) : ℝ := parameterSize L.K 0 Ti (560*P.horizon^10/P.epsilon) H.L J.δ ‖ξ‖+J.hchild theorem geometryForward_uniform_primitives (ξ : U) (hδ : 0 < J.δ) (hδ1 : J.δ ≤ 1) : 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..bafa9a6e70 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 @@ -100,11 +100,11 @@ namespace GeometryForwardInput variable (I : GeometryForwardInput U) /-- High, constructed using `forwardInitializedInitialHigh`. -/ -def high (k : ℝ) : Space → Space := forwardInitializedInitialHigh I.meanData I.data +@[expose] def high (k : ℝ) : Space → Space := forwardInitializedInitialHigh I.meanData I.data I.geometry.δ I.delta_pos I.geometry.initialCoordinate I.cutoff_support I.alpha (truncation k) k /-- Mean, constructed using `forwardInitializedInitialMean`. -/ -def mean (k : ℝ) : Space → Space := forwardInitializedInitialMean I.meanData I.data +@[expose] def mean (k : ℝ) : Space → Space := forwardInitializedInitialMean I.meanData I.data I.geometry.δ I.delta_pos I.geometry.initialCoordinate I.cutoff_support I.alpha (truncation k) k /-- Exact initial, constructed using `scale`. -/ 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..51ba1b795f 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 @@ -68,7 +68,7 @@ variable (CM CH K error : ℝ) (hCM : 0 ≤ CM) (hK : 1 ≤ K) (he : 0 ≤ error /-- The next actual frame, using exactly the forward source primary and its target-normalized amplitude. -/ -def forwardTargetRenewal : ParentFrame DNext tNext := +@[expose] def forwardTargetRenewal : ParentFrame DNext tNext := S.forwardRenewal T hTime m hm J support hSupport mNext hmNext JNext supportNext hSupportNext tNext ((G.lowGeometry hball).target_time_mem).1 CM CH K error @@ -170,7 +170,7 @@ variable (CM CH K error : ℝ) (hCM : 0 ≤ CM) (hK : 1 ≤ K) (he : 0 ≤ error /-- The joined renewal retains the activation-selected endpoint and its actual stationary-history initial trace. -/ -def joinedTargetRenewal : ParentFrame DNext tNext := +@[expose] def joinedTargetRenewal : ParentFrame DNext tNext := S.joinedRenewal T hTime m hm J support hSupport mNext hmNext JNext supportNext hSupportNext tNext (hs.le.trans ((G.lowGeometry hball).target_time_mem).1) CM CH K error @@ -251,7 +251,7 @@ end end -@[expose] public section +public section noncomputable section @@ -297,7 +297,7 @@ variable {U : Type} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteSp (support : Set Space) (hSupport : IsCompact support) /-- Renewal, constructed using `S.forwardTargetRenewal`. -/ -def renewal : ParentFrame (F.parent.transverseData m hm R support hSupport) +@[expose] def renewal : ParentFrame (F.parent.transverseData m hm R support hSupport) (I.geometry.lowGeometry I.halfBall).targetTime := S.forwardTargetRenewal (state I S k hk nextEll hnext hnext1 F hSym) rfl I.normal I.normal_unit I.coordinates I.support I.support_compact @@ -356,7 +356,7 @@ variable {U : Type} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteSp (support : Set Space) (hSupport : IsCompact support) /-- Renewal, constructed using `S.joinedTargetRenewal`. -/ -def renewal : ParentFrame (F.parent.transverseData m hm R support hSupport) +@[expose] def renewal : ParentFrame (F.parent.transverseData m hm R support hSupport) (I.geometry.lowGeometry I.halfBall).targetTime := S.joinedTargetRenewal (state I S k hk nextEll hnext hnext1 F hSym) rfl I.normal I.normal_unit I.coordinates I.support I.support_compact diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentGeometryForwardChoice.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentGeometryForwardChoice.lean index 1f0bc1b6ee..f9d38618a3 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 @@ -82,7 +82,7 @@ abbrev agreement : SourceCoefficientAgreement I.meanData I.data := I.parent.sourceAgreement I.normal I.normal_unit I.coordinates I.support I.support_compact I.low /-- Parameter size, constructed using `I.label.geometryForwardParameterSize`. -/ -def parameterSize : ℝ := I.label.geometryForwardParameterSize I.low I.normal I.normal_unit +@[expose] def parameterSize : ℝ := I.label.geometryForwardParameterSize I.low I.normal I.normal_unit I.coordinates I.support I.support_compact I.frame I.geometry I.parent.T⁻¹ I.geometry.initialCoordinate @@ -93,6 +93,7 @@ theorem alpha_pos : 0 < I.alpha := I.geometry.primaryAmplitude_pos I.halfBall I. I.child_pos /-- Frequency guard, given by `frequencyConstant*I.parameterSize^frequencyPower ≤ smallPower k`. -/ +@[expose] def frequencyGuard (k : ℝ) : Prop := frequencyConstant*I.parameterSize^frequencyPower ≤ smallPower k /-- Correction budget type used in parent geometry forward choice. -/ @@ -173,10 +174,10 @@ namespace GeometryForwardChoice variable (F : GeometryForwardChoice I S k hk nextEll hnext hnext1) /-- Parent, given by `I.parent.child F.flow k I.normal F.graph nextEll hnext hnext1`. -/ -def parent : Parent := I.parent.child F.flow k I.normal F.graph nextEll hnext hnext1 +@[expose] def parent : Parent := I.parent.child F.flow k I.normal F.graph nextEll hnext hnext1 /-- State, constructed using `S.forwardChild`. -/ -def state (hSym : ∀ x, -x ∈ I.support ↔ x ∈ I.support) : SmoothState F.parent := +@[expose] def state (hSym : ∀ x, -x ∈ I.support ↔ x ∈ I.support) : SmoothState F.parent := S.forwardChild I.low I.normal I.normal_unit I.coordinates I.support I.support_compact hSym I.geometry.δ I.delta_pos I.geometry.initialCoordinate I.cutoff_support I.alpha (truncation k) F.hn k hk.four F.Q F.flow F.coefficient F.graph nextEll hnext hnext1 F.labels diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentGeometryJoinedChoice.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentGeometryJoinedChoice.lean index fac6a00956..b9c25827a8 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 @@ -134,9 +134,12 @@ theorem initializedNormalizedDerivativeField_bound (N : ℕ) (hN : 1 ≤ N) (k : have hh := (ha.add hb).ofRawEq (initializedNormalizedDerivativeField M D hTime τ hτ hτT B δ hδ ξ hs α N k) (fun _ _ _ => smul_add _ _ _) - convert hh using 1 + have hR : 0 ≤ 4*L.R := by + have := L.radius_bounds.1 + linarith + apply hh.mono_amplitude hR dsimp [EulerTransversePacketJoin.NormalBudget.blockAmplitude] - ring + ring_nf; exact le_rfl end EulerPacketTerminalDatum @@ -151,7 +154,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 +396,7 @@ end end -@[expose] public section +public section noncomputable section @@ -532,7 +535,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 +630,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 +655,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 +715,7 @@ end end -@[expose] public section +public section noncomputable section @@ -797,10 +801,10 @@ namespace GeometryJoinedChoice variable (F : GeometryJoinedChoice I S k hk nextEll hnext hnext1) /-- Parent, given by `I.parent.child F.flow k I.normal F.graph nextEll hnext hnext1`. -/ -def parent : Parent := I.parent.child F.flow k I.normal F.graph nextEll hnext hnext1 +@[expose] def parent : Parent := I.parent.child F.flow k I.normal F.graph nextEll hnext hnext1 /-- State, constructed using `S.joinedChild`. -/ -def state (hSym : ∀ x, -x ∈ I.support ↔ x ∈ I.support) : SmoothState F.parent := +@[expose] def state (hSym : ∀ x, -x ∈ I.support ↔ x ∈ I.support) : SmoothState F.parent := S.joinedChild I.low I.normal I.normal_unit I.coordinates I.support I.support_compact hSym I.geometry.δ I.delta_pos I.terminal I.cutoff_support I.alpha (truncation k) F.hn k hk.four I.historyTime I.history_pos I.history_lt F.Q F.flow F.coefficient F.graph nextEll hnext hnext1 diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentHistoryCostPolynomial.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentHistoryCostPolynomial.lean index 72a1a2aa75..84bb752dcd 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 @@ -25,6 +25,7 @@ open EulerPacketParentLabelBounds EulerPacketParentMeanCoercivity EulerTransverseHistoryBounds EulerTransverseEndpointDifference EulerPolynomialCost /-- Label history envelope, constructed using `parentDifferenceEnvelope`. -/ +@[expose] def labelHistoryEnvelope (K Ti : ℝ) : ℝ := parentDifferenceEnvelope Ti (frameAmplitude K) (gradientAmplitude K) (27*(frameAmplitude K)^2*gradientAmplitude K) (coefficientRadius K) diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentInitializedRadiusPolynomial.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentInitializedRadiusPolynomial.lean index 5605e181df..20dd59915b 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 @@ -37,9 +37,11 @@ open EulerPacketParentLabelBounds EulerPacketParentMeanCoercivity /-- Radius ceiling, given by `1024+4*K`. -/ def radiusCeiling (K : ℝ) : ℝ := 1024+4*K /-- Curvature ceiling, given by `27*(frameAmplitude K)^2*gradientAmplitude K`. -/ +@[expose] def curvatureCeiling (K : ℝ) : ℝ := 27*(frameAmplitude K)^2*gradientAmplitude K /-- Normal amplitude, given by `EulerPacketParentNormalBudget.amplitude (frameAmplitude K) (gradientAmplitude K)`. -/ +@[expose] def normalAmplitude (K : ℝ) : ℝ := EulerPacketParentNormalBudget.amplitude (frameAmplitude K) (gradientAmplitude K) /-- Normal inverse, given by `EulerPacketParentNormalBudget.inverseRadius (radiusCeiling K) @@ -167,7 +169,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 +234,7 @@ end end -@[expose] public section +public section noncomputable section @@ -292,6 +294,7 @@ theorem inputEnvelope_bounds (K X : ℝ) (hK : 1 ≤ K) (hKX : K ≤ X) : linarith only [hX0,ha0] /-- Source envelope, given by `sourceRadiusEnvelope (inputEnvelope X)`. -/ +@[expose] def sourceEnvelope (X : ℝ) : ℝ := sourceRadiusEnvelope (inputEnvelope X) /-- Source polynomial, given by `sourceRadiusPolynomial.comp inputPolynomial`. -/ @@ -314,7 +317,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) @@ -329,6 +332,7 @@ theorem parameterSize_bounds (K Ti TiTotal Cp B δ N : ℝ) linarith,by linarith,by linarith,by linarith,by linarith,by linarith,by linarith,by linarith⟩ /-- Full envelope, given by `radiusEnvelope (sourceEnvelope X)`. -/ +@[expose] def fullEnvelope (X : ℝ) : ℝ := radiusEnvelope (sourceEnvelope X) /-- Full polynomial, given by `radiusPolynomial.comp (sourceRadiusPolynomial.comp diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentInitializedState.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentInitializedState.lean index fada209564..b8d7b82de0 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)) @@ -56,7 +56,7 @@ def forwardChild G hG k (mul_inv_cancel₀ (by linarith : k ≠ 0)) hgraph nextEll hnext hnext1 labels /-- Joined child, constructed using `S.packetChild`. -/ -def joinedChild (τ : ℝ) (hτ : 0 < τ) (hτT : τ < A.T) +@[expose] def joinedChild (τ : ℝ) (hτ : 0 < τ) (hτT : τ < A.T) (Q : Budget period A.T_pos (initializedCorrectionData (A.meanData H) (A.transverseData m hm J support hSupport) rfl τ hτ hτT (A.historyOn H m hm J support hSupport τ hτ hτT) δ hδ ξ hs α diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentInitializedUniformCosts.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentInitializedUniformCosts.lean index 42affbe827..8297b78c12 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 @@ -39,6 +39,7 @@ variable {U : Type} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteSp (hsub : S ⊆ Ω) (hΩball : ∀ x ∈ Ω, ‖x‖ ≤ (1 / 2 : ℝ)) /-- Geometry inputs, constructed using `L.joinedInputs`. -/ +@[expose] def geometryInputs : JoinedInputs (G.meanData H) (G.transverseData m hm R S hS) τ hτ hτT (G.historyOn H m hm R S hS τ hτ hτT) := @@ -58,7 +59,7 @@ end end -@[expose] public section +public section noncomputable section @@ -88,7 +89,7 @@ local notation "BC" => joinedCoefficientBudget period (G.meanData H) /-- Geometry parameter size, given by `parameterSize L.K Ti TiTotal (560*P.horizon^10/P.epsilon) H.L J.δ ‖ξ‖+J.hchild`. -/ -def geometryParameterSize (ξ : U) : ℝ := +@[expose] def geometryParameterSize (ξ : U) : ℝ := parameterSize L.K Ti TiTotal (560*P.horizon^10/P.epsilon) H.L J.δ ‖ξ‖+J.hchild theorem geometry_uniform_primitives (ξ : U) (hδ : 0 < J.δ) (hδ1 : J.δ ≤ 1) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentNormalPacketParameters.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentNormalPacketParameters.lean index 3779c0af47..c8a96f3664 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 @@ -242,7 +242,7 @@ open Real EulerPacketLowConstants EulerParentPacketParameterCaps def terminalCap : ℝ := 1+terminalConstant gradientConstant hessianConstant /-- Source constant, given by `EulerPacketParameterEnvelope.boundConstant C (boundaryConstant gradientConstant) terminalCap`. -/ -def sourceConstant (C : ℝ) : ℝ := +@[expose] def sourceConstant (C : ℝ) : ℝ := EulerPacketParameterEnvelope.boundConstant C (boundaryConstant gradientConstant) terminalCap theorem terminalCap_one : 1 ≤ terminalCap := by @@ -255,10 +255,11 @@ theorem sourceConstant_pos (C : ℝ) : 0 < sourceConstant C := (boundaryConstant_pos gradientConstant gradient_nonneg).le (zero_le_one.trans terminalCap_one) /-- Envelope, given by `parameterEnvelope J (sourceConstant C) 320 20 1000 X n`. -/ -def envelope (J : ℕ) (C X : ℝ) (n : ℕ) : ℝ := parameterEnvelope J (sourceConstant C) 320 20 1000 X n +@[expose] def envelope (J : ℕ) (C X : ℝ) (n : ℕ) : ℝ := + parameterEnvelope J (sourceConstant C) 320 20 1000 X n /-- Frequency spec, constructed using `frequencyCostSpec`. -/ -def frequencySpec (C : ℝ) : CostSpec := +@[expose] def frequencySpec (C : ℝ) : CostSpec := frequencyCostSpec (1+frequencyConstant) (sourceConstant C) 320 (by have h := frequencyConstant_pos; linarith) (sourceConstant_pos C) 20 1000 (frequencyPower+1) (theta/100) (by norm_num [theta]) diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentNormalizedGeometry.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentNormalizedGeometry.lean index 36a08d61c7..6e90558b34 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 @@ -150,13 +150,14 @@ variable (A : EulerParentPacketFrames.Parent) (B : EulerAllOrderDriftCorrection.Budget P A.T_pos C) /-- Corrected packet velocity, constructed using `u`. -/ +@[expose] def correctedPacketVelocity (k : ℝ) (Y u : Icc (0 : ℝ) A.T → Space → Space) (t : Icc (0 : ℝ) A.T) (x : Space) : Space := u t x + A.ell • (C.κ • A.frame.field t (A.ell⁻¹ • Y t x) ((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 +228,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 +326,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 +375,7 @@ end end -@[expose] public section +public section noncomputable section @@ -543,6 +544,7 @@ def frameEquiv (t : Icc (0 : ℝ) A.T) (x : Space) : Space ≃L[ℝ] Space := /-- Packet lift, given by `(q.1,A.packetPosition q)`. -/ def packetLift (q : ℝ × Space) : ℝ × Space := (q.1,A.packetPosition q) /-- Packet inverse lift, given by `(q.1,A.packetInverse Y q)`. -/ +@[expose] def packetInverseLift (Y : Icc (0 : ℝ) A.T → Space → Space) (q : ℝ × Space) : ℝ × Space := (q.1,A.packetInverse Y q) diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentOrdinaryEvolution.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentOrdinaryEvolution.lean index a121e8e2a4..78e4eeeb74 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 @@ -52,7 +52,7 @@ theorem velocity_solenoidal (t : Icc (0 : ℝ) A.T) : (S.velocity t).toLp ∈ so /-- Ordinary evolution, bundling `velocity`, `pressureForce`, `velocity_continuous`, `pressure_continuous` and the required compatibility proofs. -/ -def ordinaryEvolution : EulerOrdinarySobolev.Evolution A.T A.T_pos.le where +@[expose] def ordinaryEvolution : EulerOrdinarySobolev.Evolution A.T A.T_pos.le where velocity := S.velocity pressureForce := S.force velocity_continuous := S.velocity_continuous diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketExactEuler.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketExactEuler.lean index c4bdc1f314..db53c56956 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 @@ -34,6 +34,7 @@ variable {E : Type} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSp /-- Coordinates, given by `(fst ℝ ℝ E).prod ((ell⁻¹ • ContinuousLinearMap.id ℝ E).comp (snd ℝ ℝ E))`. -/ +@[expose] def coordinates (ell : ℝ) : (ℝ × E) →L[ℝ] (ℝ × E) := (fst ℝ ℝ E).prod ((ell⁻¹ • ContinuousLinearMap.id ℝ E).comp (snd ℝ ℝ E)) @@ -42,10 +43,12 @@ omit [CompleteSpace E] in coordinates ell q=(q.1,ell⁻¹ • q.2) := rfl /-- Velocity, given by `ell • u (coordinates ell q)`. -/ +@[expose] def velocity (ell : ℝ) (u : ℝ × E → E) (q : ℝ × E) : E := ell • u (coordinates ell q) /-- Pressure, given by `ell^2*p (coordinates ell q)`. -/ +@[expose] def pressure (ell : ℝ) (p : ℝ × E → ℝ) (q : ℝ × E) : ℝ := ell^2*p (coordinates ell q) @@ -119,7 +122,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 @@ -131,10 +134,12 @@ open scoped Topology variable (A : EulerParentPacketFrames.Parent) /-- Normalized velocity, given by `EulerSpatialRescaling.velocity A.ell⁻¹ u`. -/ +@[expose] def normalizedVelocity (u : ℝ × Space → Space) : ℝ × Space → Space := EulerSpatialRescaling.velocity A.ell⁻¹ u /-- Normalized pressure, given by `EulerSpatialRescaling.pressure A.ell⁻¹ p`. -/ +@[expose] def normalizedPressure (p : ℝ × Space → ℝ) : ℝ × Space → ℝ := EulerSpatialRescaling.pressure A.ell⁻¹ p @@ -208,7 +213,7 @@ end end -@[expose] public section +public section noncomputable section @@ -222,6 +227,7 @@ open scoped ContDiff Topology variable (A : EulerParentPacketFrames.Parent) /-- Packet frame, given by `A.frame.realField A.T A.T_pos.le q.1 q.2`. -/ +@[expose] def packetFrame (q : ℝ × Space) : Space →L[ℝ] Space := A.frame.realField A.T A.T_pos.le q.1 q.2 @@ -253,6 +259,7 @@ variable {P : ℝ} [Fact (0 < P)] {κ : ℝ} {hκ : |κ| ≤ 1} hSupport) P κ hκ Z R)) /-- Normalized exact velocity, constructed using `A.normalizedVelocity`. -/ +@[expose] def normalizedExactVelocity (k : ℝ) (Y : Icc (0 : ℝ) A.T → Space → Space) (u : ℝ × Space → Space) (q : ℝ × Space) : Space := A.normalizedVelocity u q + physicalVelocity κ k m A.packetFrame ((exactPacketOfResidual P B @@ -260,6 +267,7 @@ def normalizedExactVelocity (k : ℝ) (Y : Icc (0 : ℝ) A.T → Space → Space /-- Normalized exact pressure, given by `A.normalizedPressure p q + physicalPressure (((exactPacketOfResidual P B residual)).rawGraphPotential k) (A.packetInverse Y) q`. -/ +@[expose] def normalizedExactPressure (k : ℝ) (Y : Icc (0 : ℝ) A.T → Space → Space) (p : ℝ × Space → ℝ) (q : ℝ × Space) : ℝ := A.normalizedPressure p q + physicalPressure (((exactPacketOfResidual P B @@ -267,6 +275,7 @@ def normalizedExactPressure (k : ℝ) (Y : Icc (0 : ℝ) A.T → Space → Space /-- Exact packet velocity, given by `EulerSpatialRescaling.velocity A.ell (A.normalizedExactVelocity m hm J support hSupport B residual k Y u)`. -/ +@[expose] def exactPacketVelocity (k : ℝ) (Y : Icc (0 : ℝ) A.T → Space → Space) (u : ℝ × Space → Space) : ℝ × Space → Space := EulerSpatialRescaling.velocity A.ell @@ -274,6 +283,7 @@ def exactPacketVelocity (k : ℝ) (Y : Icc (0 : ℝ) A.T → Space → Space) (u /-- Exact packet pressure, given by `EulerSpatialRescaling.pressure A.ell (A.normalizedExactPressure m hm J support hSupport B residual k Y p)`. -/ +@[expose] def exactPacketPressure (k : ℝ) (Y : Icc (0 : ℝ) A.T → Space → Space) (p : ℝ × Space → ℝ) : ℝ × Space → ℝ := EulerSpatialRescaling.pressure A.ell diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketForwardInput.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketForwardInput.lean index a649c4d4a7..2274ee25c3 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 @@ -46,6 +46,7 @@ variable {G : Parent} (L : LabelData G) (H : LowBounds G) (hshort : CM * G.T ≤ 1 / 2) /-- Forward raw, constructed using `shortPhysicalForwardBudget`. -/ +@[expose] def forwardRaw : EulerTransversePacketForward.Budget (G.transverseData m hm R S hS) (Fin 4) 6 := shortPhysicalForwardBudget (G.transverseData m hm R S hS) 6 L.scaledRadius (frameAmplitude L.K) (gradientAmplitude L.K) CM L.scaledRadius_nonneg @@ -54,6 +55,7 @@ def forwardRaw : EulerTransversePacketForward.Budget (G.transverseData m hm R S /-- Forward inputs as an element of `ForwardInputs (G.meanData H) (G.transverseData m hm R S hS)`. -/ +@[expose] def forwardInputs (Ti : ℝ) (hT1 : G.T ≤ 1) (hTi : G.T⁻¹ ≤ Ti) : ForwardInputs (G.meanData H) (G.transverseData m hm R S hS) := by let A := L.forwardRaw m hm R S hS CM hCM hM Ω hΩ hΩo hsub hΩball hshort @@ -71,7 +73,7 @@ def forwardInputs (Ti : ℝ) (hT1 : G.T ≤ 1) (hTi : G.T⁻¹ ≤ Ti) : theorem forwardInputs_growth (Ti : ℝ) (hT1 : G.T ≤ 1) (hTi : G.T⁻¹ ≤ Ti) : (L.forwardInputs H m hm R S hS CM hCM hM Ω hΩ hΩo hsub hΩball hshort Ti hT1 hTi).linear.g=1 := - rfl + by rfl end LabelData end EulerParentPacketFrames diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketFrames.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketFrames.lean index a299292726..0ecdc45333 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,33 +57,39 @@ 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`. -/ +@[expose] def frame : SmoothTimeField (Icc (0 : ℝ) G.T) Space EndSpace := (SmoothTimeField.boundConstant (ContinuousLinearMap.id ℝ Space)).add (G.displacement.derivative.precompLinear (G.ell • ContinuousLinearMap.id ℝ Space)) /-- First, given by `G.velocity.derivative.precompLinear (G.ell • ContinuousLinearMap.id ℝ Space)`. -/ +@[expose] def first : SmoothTimeField (Icc (0 : ℝ) G.T) Space EndSpace := G.velocity.derivative.precompLinear (G.ell • ContinuousLinearMap.id ℝ Space) /-- Second, given by `G.acceleration.derivative.precompLinear (G.ell • ContinuousLinearMap.id ℝ Space)`. -/ +@[expose] def second : SmoothTimeField (Icc (0 : ℝ) G.T) Space EndSpace := G.acceleration.derivative.precompLinear (G.ell • ContinuousLinearMap.id ℝ Space) /-- Inverse, given by `SmoothTimeField.bilinear cofactorBilinear G.frame G.frame`. -/ +@[expose] def inverse : SmoothTimeField (Icc (0 : ℝ) G.T) Space EndSpace := SmoothTimeField.bilinear cofactorBilinear G.frame G.frame /-- Strain, given by `SmoothTimeField.bilinear (compL ℝ Space Space Space) G.first G.inverse`. -/ +@[expose] def strain : SmoothTimeField (Icc (0 : ℝ) G.T) Space EndSpace := SmoothTimeField.bilinear (compL ℝ Space Space Space) G.first G.inverse /-- Curvature, given by `(SmoothTimeField.bilinear (compL ℝ Space Space Space) G.second G.inverse).map (-ContinuousLinearMap.id ℝ EndSpace)`. -/ +@[expose] def curvature : SmoothTimeField (Icc (0 : ℝ) G.T) Space EndSpace := (SmoothTimeField.bilinear (compL ℝ Space Space Space) G.second G.inverse).map (-ContinuousLinearMap.id ℝ EndSpace) @@ -103,13 +109,13 @@ def curvature : SmoothTimeField (Icc (0 : ℝ) G.T) Space EndSpace := G.acceleration.derivativeField_eq t (G.ell • x) @[simp] theorem inverse_apply (t : Icc (0 : ℝ) G.T) (x : Space) : - G.inverse.field t x = adjugate (G.frame.field t x) := rfl + G.inverse.field t x = adjugate (G.frame.field t x) := by rfl @[simp] theorem strain_apply (t : Icc (0 : ℝ) G.T) (x : Space) : - G.strain.field t x = (G.first.field t x).comp (G.inverse.field t x) := rfl + G.strain.field t x = (G.first.field t x).comp (G.inverse.field t x) := by rfl @[simp] theorem curvature_apply (t : Icc (0 : ℝ) G.T) (x : Space) : - G.curvature.field t x = -((G.second.field t x).comp (G.inverse.field t x)) := rfl + G.curvature.field t x = -((G.second.field t x).comp (G.inverse.field t x)) := by rfl theorem frame_det (t : Icc (0 : ℝ) G.T) (x : Space) : (operatorMatrix (G.frame.field t x)).det=1 := by @@ -157,6 +163,7 @@ theorem second_equation (t : Icc (0 : ℝ) G.T) (x v : Space) : rw [G.curvature_apply,neg_apply,comp_apply,G.inverse_left,neg_neg] /-- Initial strain, bundling `field`, `smooth`, `bounded`. -/ +@[expose] def initialStrain : BoundedSmoothField EndSpace where field := G.first.field G.zeroTime smooth := G.first.smooth G.zeroTime @@ -165,7 +172,7 @@ def initialStrain : BoundedSmoothField EndSpace where exact (G.first.jet n G.zeroTime).norm_coe_le_norm x⟩ @[simp] theorem initialStrain_apply (x : Space) : - G.initialStrain.field x = G.first.field G.zeroTime x := rfl + G.initialStrain.field x = G.first.field G.zeroTime x := by rfl end Parent end EulerParentPacketFrames diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketGeometryFrame.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketGeometryFrame.lean index 0ef2f59351..7bff27a801 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 @@ -72,6 +72,7 @@ variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteS /-- Source velocity, given by `EulerPacketForwardFactorization.uncutVelocity (G.transverseData m hm R S hS) η t 0`. -/ +@[expose] def sourceVelocity (η : U) (t : ℝ) : Space := EulerPacketForwardFactorization.uncutVelocity (G.transverseData m hm R S hS) η t 0 @@ -112,7 +113,7 @@ after inserting their constructed initial coordinate. -/ theorem joined_sourceVelocity (s : ℝ) (hs : 0 < s) (hsT : s < G.T) (B : HistoryData ((G.transverseData m hm R S hS).initial s hs hsT.le)) (ξ : U) (t : ℝ) : G.sourceVelocity m hm R S hS (B.coefficients.labelCoordinate 0 ξ ⟨0,le_rfl,hs.le⟩) t = - EulerPacketPrimaryFactorization.uncutVelocity s hs hsT B ξ t 0 := rfl + EulerPacketPrimaryFactorization.uncutVelocity s hs hsT B ξ t 0 := by rfl theorem joined_initialCoordinate_ne_zero (s : ℝ) (hs : 0 < s) (hsT : s < G.T) (B : HistoryData ((G.transverseData m hm R S hS).initial s hs hsT.le)) (ξ : U) (hξ : ξ ≠ 0) : @@ -133,7 +134,7 @@ variable {V : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] /-- The only error input is the literal center derivative estimate for the already constructed perturbation. No ray, velocity or matrix ODE is supplied as a hypothesis. -/ -def geometryFrameOfCenterExpansion (η : U) (hη : η ≠ 0) +@[expose] def geometryFrameOfCenterExpansion (η : U) (hη : η ≠ 0) (w : ℝ → Space → Space) (c CM CH K error : ℝ) (hCM : 0 ≤ CM) (hK : 1 ≤ K) (he : 0 ≤ error) (hMK : CM ≤ K) (hHK : CM ^ 2 + CH ≤ K ^ 2) diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketGeometryGuards.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketGeometryGuards.lean index f7da3b3039..e4d7ea1f96 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 @@ -112,7 +112,7 @@ theorem history_hessian_norm (x : Space) : /-- Apply the manuscript's scalar stage bounds to the literal source coefficients. The remaining inputs are older-stage center data, the chosen normal, and scalar comparisons with explicit source costs. -/ -def geometryGuardsOfStage +@[expose] def geometryGuardsOfStage (P : ParentFrame (G.transverseData m hm R S hS) τ) (p : Icc (0 : ℝ) G.T → Space → ℝ) (hp : ∀ t, ContDiff ℝ ∞ (p t)) (hacc : ∀ t x, G.acceleration.field t x = -(gradient (p t) (G.position t x))) 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..4543f069f4 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 @@ -83,6 +83,7 @@ theorem initial_curvature_derivative_norm : /-- The coefficient of the label scale in the actual history difference bound. All zeroth norms belong to the restricted source coefficients. -/ +@[expose] def initialHistoryDifferenceScaleCost : ℝ := let D := (G.transverseData m hm R S hS).initial τ hτ hτT.le let B := G.historyOn H m hm R S hS τ hτ hτT @@ -109,7 +110,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..2e73045a82 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 @@ -45,12 +45,14 @@ variable (G : Parent) (H : LowBounds G) (S : Set Space) (hS : IsCompact S) (τ : ℝ) (hτ : 0 < τ) (hτT : τ < G.T) /-- History on, given by `(G.historyData m hm R S hS H).initial τ hτ hτT.le`. -/ +@[expose] def historyOn : HistoryData ((G.transverseData m hm R S hS).initial τ hτ hτT.le) := (G.historyData m hm R S hS H).initial τ hτ hτT.le omit [CompleteSpace U] in /-- Second initial, given by `G.second.toSmoothCoefficientPath.comp (initialInclusion G.T τ hτT.le)`. -/ +@[expose] def secondInitial : SmoothCoefficientPath (Icc (0 : ℝ) τ) (Space →L[ℝ] Space) := G.second.toSmoothCoefficientPath.comp (initialInclusion G.T τ hτT.le) @@ -80,6 +82,7 @@ variable {G : Parent} (L : LabelData G) (H : LowBounds G) EulerPacketParentPhysicalBudgets.halfBall g Cp) /-- Joined raw, constructed using `EulerPacketParentPhysicalBudgets.joinedBudget`. -/ +@[expose] def joinedRaw : EulerTransversePacketJoin.Budget (G.transverseData m hm R S hS) τ hτ hτT (G.historyOn H m hm R S hS τ hτ hτT) (Fin 4) 6 := EulerPacketParentPhysicalBudgets.joinedBudget (G.transverseData m hm R S hS) τ hτ hτT @@ -94,6 +97,7 @@ def joinedRaw : EulerTransversePacketJoin.Budget (G.transverseData m hm R S hS) /-- Joined inputs as an element of `JoinedInputs (G.meanData H) (G.transverseData m hm R S hS) τ hτ hτT (G.historyOn H m hm R S hS τ hτ hτT)`. -/ +@[expose] def joinedInputs (TiTotal : ℝ) (hT1 : G.T ≤ 1) (hTiTotal : G.T⁻¹ ≤ TiTotal) : JoinedInputs (G.meanData H) (G.transverseData m hm R S hS) τ hτ hτT (G.historyOn H m hm R S hS τ hτ hτT) := by diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketLabelData.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketLabelData.lean index 2637d2e1c5..fde0085d36 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 @@ -61,6 +61,7 @@ theorem second_match (t : Icc (0 : ℝ) G.T) (x : Space) : rw [G.second_apply,← funext (L.acceleration_match t)] /-- Normal budget, constructed using `EulerPacketParentLabelBudgets.normalBudget`. -/ +@[expose] def normalBudget {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] (m : Space) (hm : ‖m‖ = 1) (R : U ≃ₗᵢ[ℝ] EulerTransverseFrameCoordinates.referencePlane m) (S : Set Space) (hS : IsCompact S) (q : ℕ) : @@ -72,6 +73,7 @@ def normalBudget {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] L.displacement_bound L.velocity_bound L.frame_match L.first_match G.frame_det /-- Mean budget, constructed using `EulerPacketParentLabelBudgets.meanBudget`. -/ +@[expose] def meanBudget (H : LowBounds G) (q : ℕ) (Ti : ℝ) (hT : G.T ≤ 1) (hTi : G.T⁻¹ ≤ Ti) : EulerMeanPacketProvider.Budget (G.meanData H) q (EulerPacketParentMeanBudget.radius q G.T Ti (coefficientRadius L.K) @@ -99,6 +101,7 @@ variable {P : ℝ} [Fact (0 < P)] (B : EulerPhysicalGraphFlowBounds.Data P G.T) (hw : ∀ t, (E t).acceleration = B.accelerationFieldL2 k m G.ell G.ell_pos t) /-- Child as an element of `LabelData (G.child B k m hgraph nextEll hnext hnext1)`. -/ +@[expose] def child (K : ℝ) (hK : 1 ≤ K) (hb : ∀ t n, classicalBlockSize direction 6 (E t).childDisplacement.toLp (E 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..170e582537 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 @@ -26,12 +26,12 @@ open EulerPacketParentLabelBounds EulerParentHistoryCost EulerPolynomialCost EulerTransverseActivationSelection /-- Formula, given by `27*F^2*V*R+27*F^2*R*(1+F)*Ei + 16*Hist*(5+64*CM^2+2*CH)*(1+3*F^2)*Hi*Ei`. -/ -def formula (F V R Hist Ei Hi CM CH : ℝ) : ℝ := +@[expose] def formula (F V R Hist Ei Hi CM CH : ℝ) : ℝ := 27*F^2*V*R+27*F^2*R*(1+F)*Ei + 16*Hist*(5+64*CM^2+2*CH)*(1+3*F^2)*Hi*Ei /-- Envelope, constructed using `formula`. -/ -def envelope (K Ti Ei Hi CM CH : ℝ) : ℝ := +@[expose] def envelope (K Ti Ei Hi CM CH : ℝ) : ℝ := formula (frameAmplitude K) (gradientAmplitude K) (coefficientRadius K) (labelHistoryConstant*(1+K+Ti)^labelHistoryPower) Ei Hi CM CH 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..63f192ab2e 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 @@ -98,7 +98,7 @@ theorem initialStrain_physical (x : Space) : /-- The source low-order hypotheses follow from the actual physical gradient at time zero and the actual physical pressure-force derivative. -/ -def lowBoundsOfPhysical (Be Bc L r K : ℝ) +@[expose] def lowBoundsOfPhysical (Be Bc L r K : ℝ) (hBe : 0 ≤ Be) (hBc : 0 ≤ Bc) (hL : boundaryLocalizationC1 * Bc ≤ L) (hr : 0 ≤ r) (hrq : r ≤ 1 / 4) (hK : 0 ≤ K) (hexterior : ∀ x, r ≤ ‖x‖ → ∀ v : Space, diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketRestriction.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketRestriction.lean index 3580094fd2..bc917a659d 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 @@ -28,6 +28,7 @@ variable (G : Parent) (S : ℝ) (hS : 0 < S) (hST : S ≤ G.T) /-- Restrict time, bundling `T`, `T_pos`, `ell`, `ell_pos` and the required compatibility proofs. -/ +@[expose] def restrictTime : Parent where T := S T_pos := hS @@ -61,12 +62,35 @@ theorem restrictTime_inverse (t : Icc (0 : ℝ) S) (x : Space) : theorem restrictTime_strain (t : Icc (0 : ℝ) S) (x : Space) : (G.restrictTime S hS hST).strain.field t x=G.strain.field (initialInclusion G.T S hST t) x := by - erw [strain_apply] + calc + (G.restrictTime S hS hST).strain.field t x = + ((G.restrictTime S hS hST).first.field t x).comp + ((G.restrictTime S hS hST).inverse.field t x) := + (G.restrictTime S hS hST).strain_apply t x + _ = (G.first.field (initialInclusion G.T S hST t) x).comp + (G.inverse.field (initialInclusion G.T S hST t) x) := by + exact congrArg₂ (fun f g : Space →L[ℝ] Space => f.comp g) + (G.restrictTime_first S hS hST t x) + (G.restrictTime_inverse S hS hST t x) + _ = G.strain.field (initialInclusion G.T S hST t) x := + (G.strain_apply (initialInclusion G.T S hST t) x).symm theorem restrictTime_curvature (t : Icc (0 : ℝ) S) (x : Space) : (G.restrictTime S hS hST).curvature.field t x=G.curvature.field (initialInclusion G.T S hST t) x := by - erw [curvature_apply] + calc + (G.restrictTime S hS hST).curvature.field t x = + -(((G.restrictTime S hS hST).second.field t x).comp + ((G.restrictTime S hS hST).inverse.field t x)) := + (G.restrictTime S hS hST).curvature_apply t x + _ = -((G.second.field (initialInclusion G.T S hST t) x).comp + (G.inverse.field (initialInclusion G.T S hST t) x)) := by + exact congrArg (fun z : Space →L[ℝ] Space => -z) + (congrArg₂ (fun f g : Space →L[ℝ] Space => f.comp g) + (G.restrictTime_second S hS hST t x) + (G.restrictTime_inverse S hS hST t x)) + _ = G.curvature.field (initialInclusion G.T S hST t) x := + (G.curvature_apply (initialInclusion G.T S hST t) x).symm theorem restrictTime_initialStrain (x : Space) : (G.restrictTime S hS hST).initialStrain.field x=G.initialStrain.field x := by @@ -80,6 +104,7 @@ variable {G : Parent} (L : LabelData G) (S : ℝ) (hS : 0 < S) (hST : S ≤ G.T) /-- Restrict time, bundling `K`, `K_one`, `displacement`, `velocity` and the required compatibility proofs. -/ +@[expose] def restrictTime : LabelData (G.restrictTime S hS hST) where K := L.K K_one := L.K_one @@ -100,6 +125,7 @@ namespace LowBounds variable {G : Parent} (H : LowBounds G) (S : ℝ) (hS : 0 < S) (hST : S ≤ G.T) /-- Restrict time, bundling `Be`, `Bc`, `L`, `r` and the required compatibility proofs. -/ +@[expose] def restrictTime : LowBounds (G.restrictTime S hS hST) where Be := H.Be Bc := H.Bc 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..b3df232fcd 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 @@ -31,14 +31,15 @@ variable {K V : Type} [TopologicalSpace K] [CompactSpace K] [NormedAddCommGroup V] [NormedSpace ℝ V] /-- To smooth coefficient path, given by `⟨A.field,A.smooth,A.jet,A.jet_eq⟩`. -/ +@[expose] def toSmoothCoefficientPath (A : SmoothTimeField K Space V) : SmoothCoefficientPath K V := ⟨A.field,A.smooth,A.jet,A.jet_eq⟩ @[simp] theorem toSmoothCoefficientPath_field (A : SmoothTimeField K Space V) : - A.toSmoothCoefficientPath.field = A.field := rfl + A.toSmoothCoefficientPath.field = A.field := by rfl @[simp] theorem toSmoothCoefficientPath_jet (A : SmoothTimeField K Space V) (n : ℕ) : - A.toSmoothCoefficientPath.jet n = A.jet n := rfl + A.toSmoothCoefficientPath.jet n = A.jet n := by rfl end SmoothTimeField @@ -47,7 +48,7 @@ end end -@[expose] public section +public section noncomputable section @@ -101,6 +102,7 @@ theorem first_within (t : ℝ) (ht : t ∈ Icc (0 : ℝ) G.T) (x : Space) : using G.first_time ⟨t,ht⟩ x /-- Mean data, bundling `T`, `T_pos`, `ℓ`, `ℓ_pos` and the required compatibility proofs. -/ +@[expose] def meanData (H : LowBounds G) : EulerMeanPacketProvider.Data where T := G.T T_pos := G.T_pos @@ -144,6 +146,7 @@ variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] /-- Transverse data, bundling `T`, `T_pos`, `support`, `support_compact` and the required compatibility proofs. -/ +@[expose] def transverseData : EulerTransversePacketProvider.Data U where T := G.T T_pos := G.T_pos @@ -181,6 +184,7 @@ theorem history_small (H : LowBounds G) : H.K*(G.T^2/2) ≤ 1/2 := by /-- History data, bundling `H`, `jacobi`, `have`, `potential` and the required compatibility proofs. -/ +@[expose] def historyData (H : LowBounds G) : EulerTransversePacketProvider.HistoryData (G.transverseData m hm R S hS) where H := G.curvature.toSmoothCoefficientPath diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketStrainEvolution.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketStrainEvolution.lean index 928c969f1e..17edf945da 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 @@ -36,7 +36,7 @@ def inverseDerivative : SmoothTimeField (Icc (0 : ℝ) G.T) Space EndSpace := @[simp] theorem inverseDerivative_apply (t : Icc (0 : ℝ) G.T) (x : Space) : G.inverseDerivative.field t x = - -((G.inverse.field t x).comp ((G.first.field t x).comp (G.inverse.field t x))) := rfl + -((G.inverse.field t x).comp ((G.first.field t x).comp (G.inverse.field t x))) := by rfl theorem inverse_time : SmoothTimeField.TimeDerivative G.T G.T_pos.le G.inverse G.inverseDerivative := by @@ -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..f92ab3b3b2 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 @@ -239,6 +239,7 @@ variable {n : ℕ} /-- Partition coefficient, given by `(c.compAlongOrderedFinpartitionL ℝ Vector3 Vector3 Vector3).flipMultilinear (fun i => iteratedFDeriv ℝ (c.partSize i) (Y t) x)`. -/ +@[expose] def partitionCoefficient (c : OrderedFinpartition n) (t : K) (x : Vector3) : Tensor c.length →L[ℝ] Tensor n := (c.compAlongOrderedFinpartitionL ℝ Vector3 Vector3 Vector3).flipMultilinear @@ -355,7 +356,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 +461,7 @@ end end -@[expose] public section +public section noncomputable section @@ -564,7 +565,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 +630,7 @@ end end -@[expose] public section +public section noncomputable section @@ -714,7 +715,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 +806,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 +871,7 @@ end end -@[expose] public section +public section noncomputable section @@ -988,7 +989,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 +1041,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1106,7 +1107,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 +1202,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 +1262,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1286,6 +1287,7 @@ namespace SmoothState variable {A : Parent} (S : SmoothState A) /-- Restrict time, bundling `evolution`, `regularity`, `labels`, `odd`. -/ +@[expose] def restrictTime (T : ℝ) (hT : 0 < T) (hTA : T ≤ A.T) : SmoothState (A.restrictTime T hT hTA) where evolution := S.evolution.restrictTime T hT hTA @@ -1309,7 +1311,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..da2b2f76fc 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 @@ -90,7 +90,7 @@ variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteS from the two physical velocity identities. The remaining quantitative inputs are the preceding packet's center shear error and parent low norm bounds, as used by the geometric induction. -/ -def geometryFrameOfPhysicalUpdate (τ : ℝ) (hτ : 0 ≤ τ) +@[expose] def geometryFrameOfPhysicalUpdate (τ : ℝ) (hτ : 0 ≤ τ) (η : U) (hη : η ≠ 0) (c CM CH K error : ℝ) (hCM : 0 ≤ CM) (hK : 1 ≤ K) (he : 0 ≤ error) (hMK : CM ≤ K) (hHK : CM ^ 2 + CH ≤ K ^ 2) @@ -113,7 +113,7 @@ end end -@[expose] public section +public section noncomputable section @@ -183,7 +183,7 @@ variable (N : Parent) (hTime : N.T = G.T) /-- Forward geometry frame as an element of `ParentFrame (N.transverseData mNew hmNew RNew SNew hSNew) τ`. -/ -def forwardGeometryFrame (η : U) (hη : η ≠ 0) +@[expose] def forwardGeometryFrame (η : U) (hη : η ≠ 0) (hsource20 : ∀ t : Icc (0 : ℝ) G.T, τ ≤ (t : ℝ) → ‖fderiv ℝ (w t) 0-(α*deriv (profile δ) (k*⟪m,Y t 0⟫_ℝ)) • rankOne ℝ (EulerPacketForwardFactorization.canonicalVelocity @@ -201,7 +201,7 @@ def forwardGeometryFrame (η : U) (hη : η ≠ 0) /-- Joined geometry frame as an element of `ParentFrame (N.transverseData mNew hmNew RNew SNew hSNew) τ`. -/ -def joinedGeometryFrame +@[expose] def joinedGeometryFrame (s : ℝ) (hs : 0 < s) (hsT : s < G.T) (B : HistoryData ((G.transverseData m hm R S hS).initial s hs hsT.le)) (ξ : U) (hξ : ξ ≠ 0) (hcut : tsupport innerCutoff ⊆ S) @@ -230,7 +230,7 @@ end end -@[expose] public section +public section noncomputable section @@ -244,7 +244,7 @@ open scoped ContDiff variable {A N : Parent} (S : SmoothState A) (T : SmoothState N) (hTime : N.T = A.T) /-- Velocity increment, given by `T.evolution.velocity (t,x)-S.evolution.velocity (t,x)`. -/ -def velocityIncrement (t : ℝ) (x : Space) : Space := +@[expose] def velocityIncrement (t : ℝ) (x : Space) : Space := T.evolution.velocity (t,x)-S.evolution.velocity (t,x) include hTime in @@ -279,7 +279,7 @@ variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteS (δ : ℝ) (hδ : 0 < δ) (α k : ℝ) /-- Forward renewal, constructed using `A.forwardGeometryFrame`. -/ -def forwardRenewal (ξ : U) (hξ : ξ ≠ 0) +@[expose] def forwardRenewal (ξ : U) (hξ : ξ ≠ 0) (hsource : ∀ t : Icc (0 : ℝ) A.T, τ ≤ (t : ℝ) → ‖fderiv ℝ (S.velocityIncrement T t) 0 - (α*deriv (profile δ) (k*⟪m,S.evolution.inverse.normalized t 0⟫_ℝ)) • @@ -297,7 +297,7 @@ def forwardRenewal (ξ : U) (hξ : ξ ≠ 0) S.evolution.inverse.normalized S.normalized_inverse_zero δ hδ α k ξ hξ hsource /-- Joined renewal, constructed using `A.joinedGeometryFrame`. -/ -def joinedRenewal (s : ℝ) (hs : 0 < s) (hsT : s < A.T) +@[expose] def joinedRenewal (s : ℝ) (hs : 0 < s) (hsT : s < A.T) (H : HistoryData ((A.transverseData m hm J support hSupport).initial s hs hsT.le)) (ξ : U) (hξ : ξ ≠ 0) (hcut : tsupport innerCutoff ⊆ support) (hsource : ∀ t : Icc (0 : ℝ) A.T, τ ≤ (t : ℝ) → 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..1cb3695948 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 @@ -109,6 +109,7 @@ def accelerationCoefficient : SmoothTimeField (Icc (0 : ℝ) T) E E := /-- Deformation coefficient, given by `(SmoothTimeField.boundConstant (ContinuousLinearMap.id ℝ E)).add (displacementCoefficient T hT A B R hB hR hsmall hb).derivative`. -/ +@[expose] def deformationCoefficient : SmoothTimeField (Icc (0 : ℝ) T) E (E →L[ℝ] E) := (SmoothTimeField.boundConstant (ContinuousLinearMap.id ℝ E)).add (displacementCoefficient T hT A B R hB hR hsmall hb).derivative @@ -179,7 +180,7 @@ end end -@[expose] public section +public section noncomputable section @@ -205,7 +206,8 @@ def coverAccelerationCoefficient : SmoothTimeField (Icc (0 : ℝ) T) LiftTangent accelerationCoefficient T G.time_nonneg G.A G.B G.R G.B_nonneg G.R_pos G.small G.sup_bound G.A₁ @[simp] theorem coverDisplacementCoefficient_apply (t : Icc (0 : ℝ) T) (x : LiftTangent) : - G.coverDisplacementCoefficient.field t x = (flowData T G.time_nonneg G.A).forward t x-x := rfl + G.coverDisplacementCoefficient.field t x = (flowData T G.time_nonneg G.A).forward t x-x := by + rfl @[simp] theorem coverVelocityCoefficient_apply (t : Icc (0 : ℝ) T) (x : LiftTangent) : G.coverVelocityCoefficient.field t x = velocityFamily T G.time_nonneg G.A x t := by @@ -241,6 +243,7 @@ theorem coverVelocityCoefficient_time : SmoothTimeField.TimeDerivative T G.time_ /-- Physical displacement coefficient, given by `physicalCoefficient k m T G.coverDisplacementCoefficient ell`. -/ +@[expose] def physicalDisplacementCoefficient (k : ℝ) (m : Vector3) (ell : ℝ) : SmoothTimeField (Icc (0 : ℝ) T) Vector3 Vector3 := physicalCoefficient k m T G.coverDisplacementCoefficient ell @@ -309,7 +312,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 @@ -332,6 +335,7 @@ def secondTerm (P D V : SmoothTimeField K E E) : SmoothTimeField K E E := applyField (applyField (P.derivative.derivative.compDisplacement D) V) V /-- Displacement, given by `(P.compDisplacement D).add D`. -/ +@[expose] def displacement (P D : SmoothTimeField K E E) : SmoothTimeField K E E := (P.compDisplacement D).add D @@ -359,7 +363,8 @@ def acceleration (P P₁ P₂ D D₁ D₂ : SmoothTimeField K E E) : SmoothTimeF rw [he] @[simp] theorem displacement_apply (P D : SmoothTimeField K E E) (t : K) (x : E) : - (displacement P D).field t x = P.field t (x+D.field t x)+D.field t x := rfl + (displacement P D).field t x = P.field t (x+D.field t x)+D.field t x := by + rfl @[simp] theorem velocity_apply (P P₁ D D₁ : SmoothTimeField K E E) (t : K) (x : E) : (velocity P P₁ D D₁).field t x = P₁.field t (x+D.field t x)+D₁.field t x + @@ -426,7 +431,7 @@ section /-! Exact Jacobian composition for the child displacement. -/ -@[expose] public section +public section noncomputable section @@ -471,7 +476,7 @@ end end -@[expose] public section +public section noncomputable section @@ -545,7 +550,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 +660,7 @@ end end -@[expose] public section +public section noncomputable section @@ -679,6 +684,7 @@ variable {P : ℝ} [Fact (0 < P)] (G : EulerPhysicalGraphFlowBounds.Data P A.T) (nextEll : ℝ) (hnext : 0 < nextEll) (hnext1 : nextEll ≤ 1) /-- Child, bundling `T`, `T_pos`, `ell`, `ell_pos` and the required compatibility proofs. -/ +@[expose] def child : EulerParentPacketFrames.Parent where T := A.T T_pos := A.T_pos 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..9b844d80fd 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 @@ -69,19 +69,21 @@ namespace EulerGraphInvariantFlow open Set InnerProductSpace ContinuousLinearMap EulerLiftedGradientSpace EulerMetricTransport /-- Graph linear, given by `(ContinuousLinearMap.id ℝ Vector3).prod (k • toDual ℝ Vector3 m)`. -/ -def graphLinear (k : ℝ) (m : Vector3) : Vector3 →L[ℝ] LiftTangent := +@[expose] def graphLinear (k : ℝ) (m : Vector3) : Vector3 →L[ℝ] LiftTangent := (ContinuousLinearMap.id ℝ Vector3).prod (k • toDual ℝ Vector3 m) @[simp] theorem graphLinear_apply (k : ℝ) (m x : Vector3) : - graphLinear k m x = (x,k*inner ℝ m x) := rfl + graphLinear k m x = (x,k*inner ℝ m x) := by + rfl /-- Graph constraint, given by `snd ℝ Vector3 ℝ - k • (toDual ℝ Vector3 m).comp (fst ℝ Vector3 ℝ)`. -/ -def graphConstraint (k : ℝ) (m : Vector3) : LiftTangent →L[ℝ] ℝ := +@[expose] def graphConstraint (k : ℝ) (m : Vector3) : LiftTangent →L[ℝ] ℝ := snd ℝ Vector3 ℝ - k • (toDual ℝ Vector3 m).comp (fst ℝ Vector3 ℝ) @[simp] theorem graphConstraint_apply (k : ℝ) (m : Vector3) (z : LiftTangent) : - graphConstraint k m z = z.2-k*inner ℝ m z.1 := rfl + graphConstraint k m z = z.2-k*inner ℝ m z.1 := by + rfl theorem graphConstraint_graph (k : ℝ) (m x : Vector3) : graphConstraint k m (graphLinear k m x)=0 := by simp @@ -161,7 +163,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 +215,7 @@ end end -@[expose] public section +public section noncomputable section @@ -226,11 +228,12 @@ variable (k : ℝ) (m : Vector3) (T : ℝ) (hT : 0 ≤ T) (A : SmoothTimeField (Icc (0 : ℝ) T) LiftTangent LiftTangent) /-- Graph coefficient, given by `(A.precompLinear (graphLinear k m)).map (fst ℝ Vector3 ℝ)`. -/ -def graphCoefficient : SmoothTimeField (Icc (0 : ℝ) T) Vector3 Vector3 := +@[expose] def graphCoefficient : SmoothTimeField (Icc (0 : ℝ) T) Vector3 Vector3 := (A.precompLinear (graphLinear k m)).map (fst ℝ Vector3 ℝ) @[simp] theorem graphCoefficient_apply (t : Icc (0 : ℝ) T) (x : Vector3) : - (graphCoefficient k m T A).field t x = (A.field t (graphLinear k m x)).1 := rfl + (graphCoefficient k m T A).field t x = (A.field t (graphLinear k m x)).1 := by + rfl theorem graphCoefficient_timeDerivative (A₁ : SmoothTimeField (Icc (0 : ℝ) T) LiftTangent LiftTangent) @@ -325,7 +328,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 @@ -339,11 +342,12 @@ variable {E : Type} [NormedAddCommGroup E] [NormedSpace ℝ E] /-- Scaled coefficient, given by `(A.precompLinear (ell⁻¹ • ContinuousLinearMap.id ℝ E)).map (ell • ContinuousLinearMap.id ℝ E)`. -/ -def scaledCoefficient : SmoothTimeField (Icc (0 : ℝ) T) E E := +@[expose] def scaledCoefficient : SmoothTimeField (Icc (0 : ℝ) T) E E := (A.precompLinear (ell⁻¹ • ContinuousLinearMap.id ℝ E)).map (ell • ContinuousLinearMap.id ℝ E) @[simp] theorem scaledCoefficient_apply (t : Icc (0 : ℝ) T) (x : E) : - (scaledCoefficient T A ell).field t x = ell • A.field t (ell⁻¹ • x) := rfl + (scaledCoefficient T A ell).field t x = ell • A.field t (ell⁻¹ • x) := by + rfl theorem scaledCoefficient_timeDerivative (A₁ : SmoothTimeField (Icc (0 : ℝ) T) E E) @@ -436,7 +440,7 @@ end end -@[expose] public section +public section noncomputable section @@ -490,12 +494,13 @@ theorem graph_materialAcceleration_eq (t : Icc (0 : ℝ) T) (x : Vector3) : rfl /-- Physical coefficient, given by `scaledCoefficient T (graphCoefficient k m T A) ell`. -/ -def physicalCoefficient (ell : ℝ) : SmoothTimeField (Icc (0 : ℝ) T) Vector3 Vector3 := +@[expose] def physicalCoefficient (ell : ℝ) : SmoothTimeField (Icc (0 : ℝ) T) Vector3 Vector3 := scaledCoefficient T (graphCoefficient k m T A) ell @[simp] theorem physicalCoefficient_apply (ell : ℝ) (t : Icc (0 : ℝ) T) (x : Vector3) : (physicalCoefficient k m T A ell).field t x = ell • (A.field t (graphLinear k m (ell⁻¹ • x))).1 - := rfl + := by + rfl theorem physicalCoefficient_timeDerivative (ell : ℝ) (htime : SmoothTimeField.TimeDerivative T hT A A₁) : @@ -579,7 +584,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 +607,7 @@ end end -@[expose] public section +public section noncomputable section @@ -691,7 +696,7 @@ end end -@[expose] public section +public section noncomputable section @@ -782,7 +787,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 +881,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 +1043,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1125,7 +1130,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 +1290,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 +1343,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1467,7 +1472,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1541,11 +1546,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 @@ -1631,6 +1636,7 @@ theorem acceleration_cylinder_bound (t : Icc (0 : ℝ) T) (n : ℕ) : G.small G.sup_bound G.integrable G.lp_bound G.integrable_time G.lp_bound_time n t /-- Displacement field, constructed using `physicalField`. -/ +@[expose] def displacementField (k : ℝ) (m : Vector3) (ell : ℝ) (hell : 0 < ell) (t : Icc (0 : ℝ) T) : SmoothL2Field Vector3 := physicalField P (displacement T G.time_nonneg G.A t) @@ -1642,6 +1648,7 @@ def displacementField (k : ℝ) (m : Vector3) (ell : ℝ) (hell : 0 < ell) (t : ell hell (fst ℝ Vector3 ℝ) /-- Velocity field, constructed using `physicalField`. -/ +@[expose] def velocityField (k : ℝ) (m : Vector3) (ell : ℝ) (hell : 0 < ell) (t : Icc (0 : ℝ) T) : SmoothL2Field Vector3 := physicalField P (materialVelocity T G.time_nonneg G.A t) (G.velocity_periodic t) @@ -1651,6 +1658,7 @@ def velocityField (k : ℝ) (m : Vector3) (ell : ℝ) (hell : 0 < ell) (t : Icc ell hell (fst ℝ Vector3 ℝ) /-- Acceleration field L², constructed using `physicalField`. -/ +@[expose] def accelerationFieldL2 (k : ℝ) (m : Vector3) (ell : ℝ) (hell : 0 < ell) (t : Icc (0 : ℝ) T) : SmoothL2Field Vector3 := physicalField P (materialAcceleration T G.time_nonneg G.A G.A₁ t) diff --git a/LeanPool/NavierStokesAndEuler/Euler/PhysicalGraphGevrey.lean b/LeanPool/NavierStokesAndEuler/Euler/PhysicalGraphGevrey.lean index b6392c16de..e710f4c4bd 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 @@ -46,13 +46,13 @@ theorem HasJetBound.map_contracting {A : SmoothL2Field V} {C R : ℝ} (by simpa only [one_mul] using h n)) /-- Scale field, bundling `field`, `smooth`, `integrable`. -/ -def scaleField (ell : ℝ) (hell : 0 < ell) (A : SmoothL2Field V) : SmoothL2Field V where +@[expose] def scaleField (ell : ℝ) (hell : 0 < ell) (A : SmoothL2Field V) : SmoothL2Field V where field := scale ell A.field smooth := scale_contDiff ell A.field A.smooth integrable n := scale_jet_memLp ell hell A.field A.smooth n (A.integrable n) @[simp] theorem scaleField_apply (ell : ℝ) (hell : 0 < ell) (A : SmoothL2Field V) (x : Space) : - (scaleField ell hell A).field x = ell • A.field (ell⁻¹ • x) := rfl + (scaleField ell hell A).field x = ell • A.field (ell⁻¹ • x) := by rfl theorem norm_jetLp_scale_le (ell : ℝ) (hell : 0 < ell) (hell1 : ell ≤ 1) (A : SmoothL2Field V) (n : ℕ) : @@ -105,7 +105,7 @@ variable {V W : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] [CompleteSpace C * R ^ n * (n.factorial : ℝ) ^ 2) /-- Graph field, bundling `field`, `smooth`, `integrable`. -/ -def graphField : SmoothL2Field V where +@[expose] def graphField : SmoothL2Field V where field := f ∘ graphMap k m smooth := hf.comp (graphMap k m).contDiff integrable n := (graph_Lp_bound P f hperiod hf k m C R hC hR hLp hn n).1 @@ -119,12 +119,12 @@ theorem graphField_bound : /-- Physical field, given by `scaleField ell hell (mapField L (graphField P f hperiod hf k m C R hC hR hLp hn))`. -/ -def physicalField (ell : ℝ) (hell : 0 < ell) (L : V →L[ℝ] W) : SmoothL2Field W := +@[expose] def physicalField (ell : ℝ) (hell : 0 < ell) (L : V →L[ℝ] W) : SmoothL2Field W := scaleField ell hell (mapField L (graphField P f hperiod hf k m C R hC hR hLp hn)) @[simp] theorem physicalField_apply (ell : ℝ) (hell : 0 < ell) (L : V →L[ℝ] W) (x : Vector3) : (physicalField P f hperiod hf k m C R hC hR hLp hn ell hell L).field x = - ell • L (f (graphMap k m (ell⁻¹ • x))) := rfl + ell • L (f (graphMap k m (ell⁻¹ • x))) := by rfl theorem physicalField_bound (ell : ℝ) (hell : 0 < ell) (hell1 : ell ≤ 1) (L : V →L[ℝ] W) (hL : ‖L‖ ≤ 1) : 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..1d33604a4c 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 @@ -24,7 +24,7 @@ open MeasureTheory Set EulerCylinderSobolevSpace EulerSobolevHeat open scoped Topology /-- Inclusion of a shorter initial time interval into a prescribed positive interval. -/ -def timeInclusion {T S : ℝ} (hTS : T ≤ S) : C(Icc (0 : ℝ) T, Icc (0 : ℝ) S) where +@[expose] def timeInclusion {T S : ℝ} (hTS : T ≤ S) : C(Icc (0 : ℝ) T, Icc (0 : ℝ) S) where toFun t := ⟨t.val, t.property.1, t.property.2.trans hTS⟩ continuous_toFun := continuous_subtype_val.subtype_mk _ @@ -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..4f4d8d5eb9 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 @@ -36,7 +36,7 @@ open MeasureTheory Set EulerCylinderSobolevSpace EulerSobolevHeat EulerQuadratic open scoped Topology /-- A translated compact time window inside the prescribed coefficient interval. -/ -def timeWindow {S : ℝ} (a T : ℝ) (ha : 0 ≤ a) (haT : a + T ≤ S) : +@[expose] def timeWindow {S : ℝ} (a T : ℝ) (ha : 0 ≤ a) (haT : a + T ≤ S) : C(Icc (0 : ℝ) T, Icc (0 : ℝ) S) where toFun t := ⟨a+t.val, by linarith [t.property.1], by linarith [t.property.2]⟩ continuous_toFun := (continuous_const.add continuous_subtype_val).subtype_mk _ @@ -97,7 +97,7 @@ end end -@[expose] public section +public section noncomputable section @@ -111,7 +111,7 @@ variable {X Y : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] [NormedAddCommGroup Y] [NormedSpace ℝ Y] /-- The actual nonlinear forcing evaluated along a solution on a translated compact time window. -/ -def windowSource {S : ℝ} (C : Coefficients (Icc (0 : ℝ) S) X Y) +@[expose] def windowSource {S : ℝ} (C : Coefficients (Icc (0 : ℝ) S) X Y) (a T : ℝ) (ha : 0 ≤ a) (haT : a + T ≤ S) (u : C(Icc (0 : ℝ) T, X)) : C(Icc (0 : ℝ) T, Y) := ⟨fun t => C.apply (timeWindow a T ha haT t) (u t), C.continuous.comp ((timeWindow a T ha haT).continuous.prodMk u.continuous)⟩ @@ -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..edba6632d8 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 @@ -25,7 +25,7 @@ variable {X Y : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] [NormedAddCommGroup Y] [NormedSpace ℝ Y] /-- The literal quadratic source evaluated along an actual continuous state path. -/ -def sourcePath {T : ℝ} (C : Coefficients (Icc (0 : ℝ) T) X Y) (u : C(Icc (0 : ℝ) T, X)) : +@[expose] def sourcePath {T : ℝ} (C : Coefficients (Icc (0 : ℝ) T) X Y) (u : C(Icc (0 : ℝ) T, X)) : C(Icc (0 : ℝ) T,Y) := pathNonlinearity T C.apply C.continuous u /-- The actual nonlinear source map obeys the proved ball Lipschitz bound in uniform path norm. -/ 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..9af756bef7 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 @@ -37,7 +37,7 @@ open EulerLiftedGradientSpace EulerCylinderSobolevSpace variable (period : ℝ) [Fact (0 < period)] /-- The genuine orthogonal lifted gradient projection acting on the complete Sobolev scale. -/ -def sobolevGradientProjection (q : ℕ) (κ : ℝ) (m : Vector3) : +@[expose] def sobolevGradientProjection (q : ℕ) (κ : ℝ) (m : Vector3) : SobolevSpace period q →L[ℝ] SobolevSpace period q := liftOperator period q (gradientProjection period κ m) (fun a f => (gradientProjection_translation period κ m a f).symm) @@ -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 @@ -120,7 +120,7 @@ variable (period : ℝ) [Fact (0 < period)] /-- A genuinely regularized derivative word as a bounded map from the source Sobolev space into H². -/ -def regularizedWordBlock {q m : ℕ} (hm : m ≤ q + 1) (n : ℕ) (w : Fin m → Fin 4) : +@[expose] def regularizedWordBlock {q m : ℕ} (hm : m ≤ q + 1) (n : ℕ) (w : Fin m → Fin 4) : SobolevSpace period q →L[ℝ] SobolevSpace period 2 := (boundedWordBlock period 2 m (by omega : 2+m ≤ q+3) w).comp (heatRegularizer period q n) @@ -146,7 +146,7 @@ theorem regularizedWordBlock_value {q m : ℕ} (hm : m ≤ q + 1) (n : ℕ) (w : exact heatRegularizer_word period n hm w u /-- The actual regularized energy-order word path. -/ -def regularizedWordPath {q m : ℕ} (hm : m ≤ q + 1) (n : ℕ) (w : Fin m → Fin 4) +@[expose] def regularizedWordPath {q m : ℕ} (hm : m ≤ q + 1) (n : ℕ) (w : Fin m → Fin 4) (T : ℝ) (u : C(Icc (0 : ℝ) T, SobolevSpace period (q + 1))) : C(Icc (0 : ℝ) T, SobolevSpace period 2) := mapPath period T ((regularizedWordBlock period hm n w).comp (truncateOperator period q)) u @@ -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 @@ -283,7 +283,7 @@ theorem field_heat_timeLp_tendsto (T : ℝ) (u : TimeLp T (LiftL2 period)) : /-- An actual regularized energy-order derivative of a continuous low-order source, as an L² time path. -/ -def sourceWordPath {q m : ℕ} (hm : m ≤ q + 1) (n : ℕ) (w : Fin m → Fin 4) +@[expose] def sourceWordPath {q m : ℕ} (hm : m ≤ q + 1) (n : ℕ) (w : Fin m → Fin 4) (T : ℝ) (f : C(Icc (0 : ℝ) T, SobolevSpace period q)) : C(Icc (0 : ℝ) T, LiftL2 period) := ((valueOperator period 2).comp (regularizedWordBlock period hm n w)).compLeftContinuous ℝ (Icc (0 : ℝ) T) f @@ -367,7 +367,7 @@ section /-! Continuous time-path application and its exact Bochner compatibility. -/ -@[expose] public section +public section noncomputable section @@ -380,7 +380,7 @@ variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] /-- The actual pointwise action of a continuous operator path on a continuous field path. -/ -def timePathApply (T : ℝ) (A : C(Icc (0 : ℝ) T, E →L[ℝ] F)) +@[expose] def timePathApply (T : ℝ) (A : C(Icc (0 : ℝ) T, E →L[ℝ] F)) (u : C(Icc (0 : ℝ) T, E)) : C(Icc (0 : ℝ) T, F) := ⟨fun t => A t (u t), A.continuous.clm_apply u.continuous⟩ @@ -407,7 +407,7 @@ end end -@[expose] public section +public section noncomputable section @@ -421,7 +421,7 @@ open scoped Topology variable (period : ℝ) [Fact (0 < period)] /-- The actual transport-pressure forcing in the regularized energy-word PDE. -/ -def forcingWordPath {q m : ℕ} (hm : m ≤ q + 1) (n : ℕ) (w : Fin m → Fin 4) (T : ℝ) +@[expose] def forcingWordPath {q m : ℕ} (hm : m ≤ q + 1) (n : ℕ) (w : Fin m → Fin 4) (T : ℝ) (A : C(Icc (0 : ℝ) T, SobolevSpace period 1 →L[ℝ] LiftL2 period)) (G : C(Icc (0 : ℝ) T, LiftL2 period →L[ℝ] LiftL2 period)) (u : C(Icc (0 : ℝ) T, SobolevSpace period (q + 1))) @@ -479,7 +479,7 @@ theorem regularized_word_hasDerivAt_clamped {q m : ℕ} (hm : m ≤ q + 1) (n : exact h /-- The literal forcing obtained from full energy-order source, state, and pressure time fields. -/ -def forcingWordTime {q m : ℕ} (hm : m ≤ q + 1) (w : Fin m → Fin 4) (T : ℝ) (hT : 0 ≤ T) +@[expose] def forcingWordTime {q m : ℕ} (hm : m ≤ q + 1) (w : Fin m → Fin 4) (T : ℝ) (hT : 0 ≤ T) (A : C(Icc (0 : ℝ) T, SobolevSpace period 1 →L[ℝ] LiftL2 period)) (G : C(Icc (0 : ℝ) T, LiftL2 period →L[ℝ] LiftL2 period)) (U : TimeLp T (SobolevSpace period (2 + q))) (F P : TimeLp T (SobolevSpace period (q + 1))) : @@ -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 @@ -539,7 +539,7 @@ open scoped Topology variable (period : ℝ) [Fact (0 < period)] /-- The unregularized energy-order word retained as an actual H⁰ time path. -/ -def energyWordPath {q m : ℕ} (hm : m ≤ q + 1) (w : Fin m → Fin 4) +@[expose] def energyWordPath {q m : ℕ} (hm : m ≤ q + 1) (w : Fin m → Fin 4) (T : ℝ) (u : C(Icc (0 : ℝ) T, SobolevSpace period (q + 1))) : C(Icc (0 : ℝ) T, SobolevSpace period 0) := mapPath period T (boundedWordBlock period 0 m (by omega : 0+m ≤ q+1) w) u @@ -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 @@ -623,7 +623,7 @@ open scoped Topology variable {I E : Type*} [Fintype I] [NormedAddCommGroup E] [NormedSpace ℝ E] /-- A finite family of continuous time paths as the actual continuous family-valued path. -/ -def familyPath (T : ℝ) (u : I → C(Icc (0 : ℝ) T, E)) : C(Icc (0 : ℝ) T, I → E) := +@[expose] def familyPath (T : ℝ) (u : I → C(Icc (0 : ℝ) T, E)) : C(Icc (0 : ℝ) T, I → E) := ⟨fun t i => u i t, continuous_pi (fun i => (u i).continuous)⟩ omit [Fintype I] [NormedSpace ℝ E] in @@ -688,7 +688,7 @@ end end -@[expose] public section +public section noncomputable section @@ -712,7 +712,7 @@ def regularizedFamily (d : α → β → ℕ) (w : ∀ i j, Fin (d i j) → Fin familyPath T (fun j => regularizedWordPath period (hd i j) n (w i j) T u) /-- The genuine L² values of the regularized energy-word family. -/ -def regularizedValueFamily (d : α → β → ℕ) (w : ∀ i j, Fin (d i j) → Fin 4) +@[expose] def regularizedValueFamily (d : α → β → ℕ) (w : ∀ i j, Fin (d i j) → Fin 4) (hd : ∀ i j, d i j ≤ q + 1) (n : ℕ) (T : ℝ) (u : C(Icc (0 : ℝ) T, SobolevSpace period (q + 1))) (i : α) : C(Icc (0 : ℝ) T, β → LiftL2 period) := @@ -720,7 +720,7 @@ def regularizedValueFamily (d : α → β → ℕ) (w : ∀ i j, Fin (d i j) → (regularizedWordPath period (hd i j) n (w i j) T u)) /-- The actual original energy-order derivative family as a continuous L² path. -/ -def energyValueFamily (d : α → β → ℕ) (w : ∀ i j, Fin (d i j) → Fin 4) +@[expose] def energyValueFamily (d : α → β → ℕ) (w : ∀ i j, Fin (d i j) → Fin 4) (hd : ∀ i j, d i j ≤ q + 1) (T : ℝ) (u : C(Icc (0 : ℝ) T, SobolevSpace period (q + 1))) (i : α) : C(Icc (0 : ℝ) T, β → LiftL2 period) := @@ -738,7 +738,7 @@ theorem regularizedValueFamily_tendsto (d : α → β → ℕ) (w : ∀ i j, Fin familyPath_tendsto T _ _ (fun j => regularizedWordPath_value_tendsto period (hd i j) (w i j) T u) /-- The actual finite family of regularized forcing words in the differentiated PDE. -/ -def regularizedForcingFamily (d : α → β → ℕ) (w : ∀ i j, Fin (d i j) → Fin 4) +@[expose] def regularizedForcingFamily (d : α → β → ℕ) (w : ∀ i j, Fin (d i j) → Fin 4) (hd : ∀ i j, d i j ≤ q + 1) (n : ℕ) (T : ℝ) (A : C(Icc (0 : ℝ) T, SobolevSpace period 1 →L[ℝ] LiftL2 period)) (G : C(Icc (0 : ℝ) T, LiftL2 period →L[ℝ] LiftL2 period)) @@ -748,7 +748,7 @@ def regularizedForcingFamily (d : α → β → ℕ) (w : ∀ i j, Fin (d i j) familyPath T (fun j => forcingWordPath period (hd i j) n (w i j) T A G u f p) /-- The limiting actual finite forcing family represented in Bochner L² time. -/ -def forcingFamilyTime (d : α → β → ℕ) (w : ∀ i j, Fin (d i j) → Fin 4) +@[expose] def forcingFamilyTime (d : α → β → ℕ) (w : ∀ i j, Fin (d i j) → Fin 4) (hd : ∀ i j, d i j ≤ q + 1) (T : ℝ) (hT : 0 ≤ T) (A : C(Icc (0 : ℝ) T, SobolevSpace period 1 →L[ℝ] LiftL2 period)) (G : C(Icc (0 : ℝ) T, LiftL2 period →L[ℝ] LiftL2 period)) diff --git a/LeanPool/NavierStokesAndEuler/Euler/RegularizedMetricPaths.lean b/LeanPool/NavierStokesAndEuler/Euler/RegularizedMetricPaths.lean index 0a8a7f151e..040dbcddd0 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 @@ -29,7 +29,7 @@ open scoped Topology variable (period : ℝ) [Fact (0 < period)] /-- A genuine continuous path of L² multipliers from the given actual smooth coefficient family. -/ -def metricOperatorPath (T : ℝ) (K : Icc (0 : ℝ) T → SmoothCoefficient period) +@[expose] def metricOperatorPath (T : ℝ) (K : Icc (0 : ℝ) T → SmoothCoefficient period) (hK : Continuous (fun t => (K t).operator)) : C(Icc (0 : ℝ) T, LiftL2 period →L[ℝ] LiftL2 period) := ⟨fun t => (K t).operator, hK⟩ diff --git a/LeanPool/NavierStokesAndEuler/Euler/RegularizedMildEquation.lean b/LeanPool/NavierStokesAndEuler/Euler/RegularizedMildEquation.lean index 20d46ddf6e..36ea6f78d5 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 @@ -65,13 +65,13 @@ open scoped Topology NNReal variable (period : ℝ) [Fact (0 < period)] /-- The actual three-derivative heat regularization of an H¹ mild state. -/ -def regularizedState (T : ℝ) (n : ℕ) (u : C(Icc (0 : ℝ) T, SobolevSpace period 1)) : +@[expose] def regularizedState (T : ℝ) (n : ℕ) (u : C(Icc (0 : ℝ) T, SobolevSpace period 1)) : C(Icc (0 : ℝ) T, SobolevSpace period 3) := mapPath period T ((heatRegularizer period 0 n).comp (truncateOperator period 0)) u /-- The same genuine heat regularization of the source, retained at the gradient-energy source order. -/ -def regularizedForcing (T : ℝ) (n : ℕ) (f : C(Icc (0 : ℝ) T, SobolevSpace period 0)) : +@[expose] def regularizedForcing (T : ℝ) (n : ℕ) (f : C(Icc (0 : ℝ) T, SobolevSpace period 0)) : C(Icc (0 : ℝ) T, SobolevSpace period 1) := mapPath period T ((restrictOperator period (by norm_num : 1 ≤ 3)).comp (heatRegularizer period 0 n)) f @@ -129,7 +129,8 @@ theorem regularizedForcing_value_tendsto (T : ℝ) (f : C(Icc (0 : ℝ) T, Sobol simpa only [regularizedForcing_value_eq, Function.comp_def] using hv /-- The first derivative of the genuine regularizer, as a bounded heat-commuting block. -/ -def regularizerFirst (n : ℕ) (i : Fin 4) : SobolevSpace period 0 →L[ℝ] SobolevSpace period 2 := +@[expose] def regularizerFirst (n : ℕ) (i : Fin 4) : + SobolevSpace period 0 →L[ℝ] SobolevSpace period 2 := (derivativeOperator period 2 i).comp (heatRegularizer period 0 n) /-- The regularized first-derivative block commutes with actual heat. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/RegularizedTopBlocks.lean b/LeanPool/NavierStokesAndEuler/Euler/RegularizedTopBlocks.lean index 08351f6c07..0eb35d5422 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 @@ -36,7 +36,7 @@ theorem heatRegularizer_word {q m : ℕ} (n : ℕ) (hm : m ≤ q) (w : Fin m → exact h /-- The actual regularized state, retained at the full maximal-regularity spatial order. -/ -def maximalApproximation (q : ℕ) (T : ℝ) (n : ℕ) +@[expose] def maximalApproximation (q : ℕ) (T : ℝ) (n : ℕ) (u : C(Icc (0 : ℝ) T, SobolevSpace period (q + 1))) : C(Icc (0 : ℝ) T, SobolevSpace period (2+q)) := mapPath period T ((restrictOperator period (by omega : 2+q ≤ q+3)).comp diff --git a/LeanPool/NavierStokesAndEuler/Euler/ScalarEulerVorticity.lean b/LeanPool/NavierStokesAndEuler/Euler/ScalarEulerVorticity.lean index a277b2987e..2e07554278 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 @@ -475,7 +475,7 @@ def unitSqrtTime : C(Icc (0 : ℝ) 1, Icc (0 : ℝ) 1) where continuous_toFun := (Real.continuous_sqrt.comp continuous_subtype_val).subtype_mk _ @[simp] theorem unitSqrtTime_apply (t : Icc (0 : ℝ) 1) : - (unitSqrtTime t : ℝ) = Real.sqrt t := rfl + (unitSqrtTime t : ℝ) = Real.sqrt t := by rfl end Euler.ComparatorBridge @@ -486,7 +486,7 @@ variable {u₀ : Space → Space} {v : Space → ℝ → Space} {p : Space → /-- The square-time parametrization is jointly smooth and uniformly supported, so all its spatial jets form continuous bounded time paths. -/ -def finiteEnergyTruncationSquareTimeField (R : ℝ) (hR : 0 < R) : +@[expose] def finiteEnergyTruncationSquareTimeField (R : ℝ) (hR : 0 < R) : SmoothTimeField (Icc (0 : ℝ) 1) Space Space := SmoothTimeField.ofContDiffOnCompactSupport (Icc (0 : ℝ) 1) (fun tx : ℝ × Space => finiteEnergyTruncation (fun y => v y (tx.1 ^ 2)) R tx.2) @@ -496,6 +496,11 @@ def finiteEnergyTruncationSquareTimeField (R : ℝ) (hR : 0 < R) : (Metric.closedBall 0 (2 * R)) (isCompact_closedBall _ _) (fun t _ht => finiteEnergyTruncation_support (fun y => v y (t ^ 2)) R hR) +@[simp] theorem finiteEnergyTruncationSquareTimeField_apply (R : ℝ) (hR : 0 < R) + (t : Icc (0 : ℝ) 1) (x : Space) : + (h.finiteEnergyTruncationSquareTimeField R hR).field t x = + finiteEnergyTruncation (fun y => v y ((t : ℝ) ^ 2)) R x := by rfl + /-- Reparametrizing by square root recovers the exact physical-time truncation, while retaining continuity of every bounded spatial jet. -/ def finiteEnergyTruncationTimeField (R : ℝ) (hR : 0 < R) : @@ -506,7 +511,8 @@ def finiteEnergyTruncationTimeField (R : ℝ) (hR : 0 < R) : (t : Icc (0 : ℝ) 1) (x : Space) : (h.finiteEnergyTruncationTimeField R hR).field t x = finiteEnergyTruncation (v · (t : ℝ)) R x := by - change finiteEnergyTruncation (fun y => v y ((Real.sqrt (t : ℝ)) ^ 2)) R x = _ + simp only [finiteEnergyTruncationTimeField, SmoothTimeField.reparametrize_apply, + finiteEnergyTruncationSquareTimeField_apply, unitSqrtTime_apply] rw [Real.sq_sqrt t.property.1] theorem finiteEnergyTruncationTimeField_field (R : ℝ) (hR : 0 < R) 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..95ab2c80c4 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 @@ -43,7 +43,7 @@ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] /-- Of time interval, bundling `velocity`, `continuous`, `lipschitzConstant`, `lipschitz` and the required compatibility proofs. -/ -def ofTimeInterval (T : ℝ) (hT : 0 ≤ T) +@[expose] def ofTimeInterval (T : ℝ) (hT : 0 ≤ T) (u : C(Icc (0 : ℝ) T, E →ᵇ E)) (K : ℝ≥0) (hLip : ∀ t, LipschitzWith K (u t)) : Data E where velocity t x := u (projIcc 0 T hT t) x @@ -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..5de752ba58 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 @@ -53,14 +53,14 @@ local instance instSmoothCoefficientTimeRestriction4 (n : ℕ) : NormedSpace ℝ namespace SmoothCoefficientPath /-- Actual time precomposition, including every spatial jet. -/ -def comp (A : SmoothCoefficientPath K V) (φ : C(L, K)) : SmoothCoefficientPath L V where +@[expose] def comp (A : SmoothCoefficientPath K V) (φ : C(L, K)) : SmoothCoefficientPath L V where field := A.field.comp φ smooth t := A.smooth (φ t) jet n := (A.jet n).comp φ 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,22 +107,23 @@ 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 _⟩ /-- Initial path, given by `ContinuousMap.compCLM ℝ V (initialInclusion S τ hτS)`. -/ -def initialPath (S τ : ℝ) (hτS : τ ≤ S) : C(Icc (0 : ℝ) S,V) →L[ℝ] C(Icc (0 : ℝ) τ,V) := +@[expose] def initialPath (S τ : ℝ) (hτS : τ ≤ S) : + C(Icc (0 : ℝ) S,V) →L[ℝ] C(Icc (0 : ℝ) τ,V) := ContinuousMap.compCLM ℝ V (initialInclusion S τ hτS) /-- Tail path, given by `ContinuousMap.compCLM ℝ V (tailInclusion S τ hτ)`. -/ -def tailPath (S τ : ℝ) (hτ : 0 ≤ τ) : C(Icc (0 : ℝ) S,V) →L[ℝ] C(Icc (0 : ℝ) (S-τ),V) := +@[expose] def tailPath (S τ : ℝ) (hτ : 0 ≤ τ) : C(Icc (0 : ℝ) S,V) →L[ℝ] C(Icc (0 : ℝ) (S-τ),V) := ContinuousMap.compCLM ℝ V (tailInclusion S τ hτ) theorem initialPath_norm (S τ : ℝ) (hτS : τ ≤ S) : ‖initialPath (V := V) S τ hτS‖ ≤ 1 := by 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..36978dd5b9 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 @@ -55,7 +55,7 @@ theorem continuous_sobolev (A : K → SmoothL2Field Space) /-- Sobolev path, given by `⟨fun t => ordinarySobolev q (A t).toLp (A t).translation_contDiff,continuous_sobolev A hA q⟩`. -/ -def sobolevPath (A : K → SmoothL2Field Space) +@[expose] def sobolevPath (A : K → SmoothL2Field Space) (hA : ∀ n, Continuous (fun t => (A t).jetLp n)) (q : ℕ) : C(K,SobolevSpace 1 q) := ⟨fun t => ordinarySobolev q (A t).toLp (A t).translation_contDiff,continuous_sobolev A hA q⟩ @@ -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..824337fadb 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 @@ -336,6 +336,7 @@ theorem forward_joint_contDiffAt_two omit [FiniteDimensional ℝ E] in /-- Time lift equiv, constructed using `ContinuousLinearEquiv.equivOfInverse`. -/ +@[expose] def timeLiftEquiv (J : E ≃L[ℝ] E) (v : E) : (ℝ × E) ≃L[ℝ] (ℝ × E) := ContinuousLinearEquiv.equivOfInverse ((ContinuousLinearMap.fst ℝ ℝ E).prod @@ -424,7 +425,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 @@ -445,6 +446,7 @@ variable {X V : Type*} [TopologicalSpace X] /-- Bounded slice, given by `BoundedContinuousFunction.ofNormedAddCommGroup (fun x => f x t) ((ContinuousMap.evalCLM ℝ t).continuous.comp hf) C (hC t)`. -/ +@[expose] def boundedSlice (t : Icc (0 : ℝ) T) : X →ᵇ V := BoundedContinuousFunction.ofNormedAddCommGroup (fun x => f x t) ((ContinuousMap.evalCLM ℝ t).continuous.comp hf) C (hC t) @@ -468,12 +470,13 @@ theorem boundedSlice_lipschitz : dist_eq_norm, Subtype.dist_eq] using h /-- Bounded path, bundling `toFun`, `continuous_toFun`. -/ +@[expose] def boundedPath : C(Icc (0 : ℝ) T,X →ᵇ V) where toFun := boundedSlice T f hf C hC continuous_toFun := (boundedSlice_lipschitz T hT f q hf C D hC hD hq hd).continuous @[simp] theorem boundedPath_apply (t : Icc (0 : ℝ) T) (x : X) : - boundedPath T hT f q hf C D hC hD hq hd t x = f x t := rfl + boundedPath T hT f q hf C D hC hD hq hd t x = f x t := by rfl theorem boundedPath_norm (hCnonneg : 0 ≤ C) : ‖boundedPath T hT f q hf C D hC hD hq hd‖ ≤ C := by @@ -488,7 +491,7 @@ end end -@[expose] public section +public section noncomputable section @@ -537,6 +540,7 @@ theorem derivativeBound_nonneg (n : ℕ) : 0 ≤ D n := /-- Of path family, bundling `field`, `smooth`, `change`, `jet` and the required compatibility proofs. -/ +@[expose] def ofPathFamily : SmoothTimeField (Icc (0 : ℝ) T) E V where field := boundedPath T hT f q hf.continuous (C 0) (D 0) (value_bound T f C hC) (derivativeBound_nonneg T hT q D hD 0) @@ -550,10 +554,12 @@ def ofPathFamily : SmoothTimeField (Icc (0 : ℝ) T) E V where (derivativeBound_nonneg T hT q D hD n) (fun t x => by rw [jetFamily_apply T q hq]; exact hD n t x) (jetFamily_hasDerivWithinAt T hT f q hf hq hd n) - jet_eq n t x := jetFamily_apply T f hf n x t + jet_eq n t x := by + rw [boundedPath_apply, jetFamily_apply T f hf n x t] + congr 1 @[simp] theorem ofPathFamily_apply (t : Icc (0 : ℝ) T) (x : E) : - (ofPathFamily T hT f q hf hq hd C D hC hD).field t x = f x t := rfl + (ofPathFamily T hT f q hf hq hd C D hC hD).field t x = f x t := by rfl @[simp] theorem ofPathFamily_jet_apply (n : ℕ) (t : Icc (0 : ℝ) T) (x : E) : (ofPathFamily T hT f q hf hq hd C D hC hD).jet n t x = @@ -586,7 +592,7 @@ end end -@[expose] public section +public section noncomputable section @@ -645,6 +651,7 @@ theorem velocityFamily_jet_bound (n : ℕ) (t : Icc (0 : ℝ) T) (x : E) : materialVelocity_bound T hT A B R hB hR hsmall hb n t x /-- Displacement coefficient, constructed using `SmoothTimeField.ofPathFamily`. -/ +@[expose] def displacementCoefficient : SmoothTimeField (Icc (0 : ℝ) T) E E := SmoothTimeField.ofPathFamily T hT (displacementFamily T hT A) (velocityFamily T hT A) @@ -657,7 +664,7 @@ def displacementCoefficient : SmoothTimeField (Icc (0 : ℝ) T) E E := @[simp] theorem displacementCoefficient_apply (t : Icc (0 : ℝ) T) (x : E) : (displacementCoefficient T hT A B R hB hR hsmall hb).field t x = - (flowData T hT A).forward t x-x := rfl + (flowData T hT A).forward t x-x := by rfl theorem displacementCoefficient_jet_norm (n : ℕ) : ‖(displacementCoefficient T hT A B R hB hR hsmall hb).jet n‖ ≤ @@ -679,6 +686,7 @@ theorem accelerationFamily_jet_bound (n : ℕ) (t : Icc (0 : ℝ) T) (x : E) : exact materialAcceleration_bound T hT A A₁ B R B₁ R₁ hB hR hB₁ hR₁ hsmall hb hb₁ n t x /-- Velocity coefficient, constructed using `SmoothTimeField.ofPathFamily`. -/ +@[expose] def velocityCoefficient : SmoothTimeField (Icc (0 : ℝ) T) E E := SmoothTimeField.ofPathFamily T hT (velocityFamily T hT A) (accelerationFamily T hT A A₁) @@ -691,7 +699,7 @@ def velocityCoefficient : SmoothTimeField (Icc (0 : ℝ) T) E E := @[simp] theorem velocityCoefficient_apply (t : Icc (0 : ℝ) T) (x : E) : (velocityCoefficient T hT A B R hB hR hsmall hb A₁ htime B₁ R₁ hB₁ hR₁ hb₁).field t x = - A.field t ((flowData T hT A).forward t x) := rfl + A.field t ((flowData T hT A).forward t x) := by rfl theorem velocityCoefficient_jet_norm (n : ℕ) : ‖(velocityCoefficient T hT A B R hB hR hsmall hb A₁ htime B₁ R₁ hB₁ hR₁ hb₁).jet n‖ ≤ 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..1b3541d2fe 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 @@ -37,7 +37,7 @@ variable {E : Type} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] /-- Jacobian evolution, given by `constructedEvolution T hT (A.derivative.superposition (pathFamily T hT A x))`. -/ -def jacobianEvolution (x : E) : +@[expose] def jacobianEvolution (x : E) : Evolution T hT (A.derivative.superposition (pathFamily T hT A x)) := constructedEvolution T hT (A.derivative.superposition (pathFamily T hT A x)) @@ -95,7 +95,7 @@ theorem forward_fderiv (t : Icc (0 : ℝ) T) (x : E) : (forward_hasFDerivAt_label T hT A t x).fderiv /-- Jacobian equiv, constructed using `ContinuousLinearEquiv.equivOfInverse`. -/ -def jacobianEquiv (t : Icc (0 : ℝ) T) (x : E) : E ≃L[ℝ] E := +@[expose] def jacobianEquiv (t : Icc (0 : ℝ) T) (x : E) : E ≃L[ℝ] E := ContinuousLinearEquiv.equivOfInverse ((jacobianEvolution T hT A x).forward t) ((jacobianEvolution T hT A x).backward t) (fun v => congrArg (fun L : E →L[ℝ] E => L v) diff --git a/LeanPool/NavierStokesAndEuler/Euler/SmoothFlowJets.lean b/LeanPool/NavierStokesAndEuler/Euler/SmoothFlowJets.lean index 2f334b5990..215aee2645 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 @@ -37,7 +37,7 @@ variable {E : Type} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensiona (T : ℝ) (hT : 0 ≤ T) (A : SmoothTimeField (Icc (0 : ℝ) T) E E) /-- Velocity family, given by `A.superposition (pathFamily T hT A x)`. -/ -def velocityFamily (x : E) : C(Icc (0 : ℝ) T,E) := +@[expose] def velocityFamily (x : E) : C(Icc (0 : ℝ) T,E) := A.superposition (pathFamily T hT A x) theorem velocityFamily_contDiff : ContDiff ℝ ∞ (velocityFamily T hT A) := @@ -45,7 +45,7 @@ theorem velocityFamily_contDiff : ContDiff ℝ ∞ (velocityFamily T hT A) := /-- Displacement family, given by `pathFamily T hT A x - (ContinuousLinearMap.const ℝ (Icc (0 : ℝ) T)) x`. -/ -def displacementFamily (x : E) : C(Icc (0 : ℝ) T,E) := +@[expose] def displacementFamily (x : E) : C(Icc (0 : ℝ) T,E) := pathFamily T hT A x - (ContinuousLinearMap.const ℝ (Icc (0 : ℝ) T)) x theorem displacementFamily_contDiff : ContDiff ℝ ∞ (displacementFamily T hT A) := by @@ -65,12 +65,12 @@ def jetPath (n : ℕ) (x : E) : C(Icc (0 : ℝ) T,E [×n]→L[ℝ] E) := /-- Velocity jet path, given by `tensorPathMap n (iteratedFDeriv ℝ n (velocityFamily T hT A) x)`. -/ -def velocityJetPath (n : ℕ) (x : E) : C(Icc (0 : ℝ) T,E [×n]→L[ℝ] E) := +@[expose] def velocityJetPath (n : ℕ) (x : E) : C(Icc (0 : ℝ) T,E [×n]→L[ℝ] E) := tensorPathMap n (iteratedFDeriv ℝ n (velocityFamily T hT A) x) /-- Displacement jet path, given by `tensorPathMap n (iteratedFDeriv ℝ n (displacementFamily T hT A) x)`. -/ -def displacementJetPath (n : ℕ) (x : E) : C(Icc (0 : ℝ) T,E [×n]→L[ℝ] E) := +@[expose] def displacementJetPath (n : ℕ) (x : E) : C(Icc (0 : ℝ) T,E [×n]→L[ℝ] E) := tensorPathMap n (iteratedFDeriv ℝ n (displacementFamily T hT A) x) theorem jetPath_apply (n : ℕ) (x : E) (t : Icc (0 : ℝ) T) : @@ -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..7c78980089 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 @@ -57,7 +57,7 @@ def jetField (n : ℕ) {V : Type u} [NormedAddCommGroup V] [NormedSpace ℝ V] (A : SmoothL2Field V) : jetField 0 A = mapField (V := V) (W := Space [×0]→L[ℝ] V) (continuousMultilinearCurryFin0 ℝ Space V).symm.toContinuousLinearEquiv.toContinuousLinearMap - A := rfl + A := by rfl @[simp] theorem jetField_succ {V : Type u} [NormedAddCommGroup V] [NormedSpace ℝ V] (A : SmoothL2Field V) (n : ℕ) : @@ -65,7 +65,7 @@ def jetField (n : ℕ) {V : Type u} [NormedAddCommGroup V] [NormedSpace ℝ V] (V := Space [×n]→L[ℝ] (Space →L[ℝ] V)) (W := Space [×(n+1)]→L[ℝ] V) (continuousMultilinearCurryRightEquiv' ℝ n Space V).symm.toContinuousLinearEquiv.toContinuousLinearMap - (jetField n A.derivative) := rfl + (jetField n A.derivative) := by rfl private theorem jetField_field_aux (n : ℕ) : ∀ (V : Type u) [NormedAddCommGroup V] [NormedSpace ℝ V] (A : SmoothL2Field V) (x : Space), @@ -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..83dc86ce8a 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 @@ -28,7 +28,7 @@ open scoped ContDiff variable {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] /-- Has jet bound, given by `∀ n, ‖A.jetLp n‖ ≤ C*R^n*(n.factorial : ℝ)^2`. -/ -def HasJetBound (A : SmoothL2Field V) (C R : ℝ) : Prop := +@[expose] def HasJetBound (A : SmoothL2Field V) (C R : ℝ) : Prop := ∀ n, ‖A.jetLp n‖ ≤ C*R^n*(n.factorial : ℝ)^2 theorem norm_jetLp (A : SmoothL2Field V) (n : ℕ) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/SmoothL2GevreyCalculus.lean b/LeanPool/NavierStokesAndEuler/Euler/SmoothL2GevreyCalculus.lean index ec9e40e530..d4b005b1ae 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 @@ -33,7 +33,7 @@ variable {E V W : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup V] [NormedSpace ℝ V] [NormedAddCommGroup W] [NormedSpace ℝ W] /-- Has sup bound, given by `∀ n x, ‖iteratedFDeriv ℝ n f x‖ ≤ C*R^n*(n.factorial : ℝ)^2`. -/ -def HasSupBound (f : E → V) (C R : ℝ) : Prop := +@[expose] def HasSupBound (f : E → V) (C R : ℝ) : Prop := ∀ n x, ‖iteratedFDeriv ℝ n f x‖ ≤ C*R^n*(n.factorial : ℝ)^2 theorem HasSupBound.mono {f : E → V} {C R D S : ℝ} @@ -112,7 +112,7 @@ theorem compose_memLp_and_bound (n : ℕ) : (fun j _ => by simpa only [← norm_jetLp] using ha j) (fun j hj _ => hfb j hj) /-- Compose field, bundling `field`, `smooth`, `integrable`. -/ -def composeField : SmoothL2Field V where +@[expose] def composeField : SmoothL2Field V where field := A.field ∘ f smooth := A.smooth.comp hf integrable n := (compose_memLp_and_bound f hf hmp B R hB hR hfb A C S hC hS ha n).1 @@ -125,7 +125,7 @@ theorem composeField_bound : omit f hf hmp B R hB hR hfb A C S hC hS ha in /-- Product field, bundling `field`, `smooth`, `integrable`. -/ -def productField (g : Space → V →L[ℝ] W) (hg : ContDiff ℝ ∞ g) (A : SmoothL2Field V) +@[expose] def productField (g : Space → V →L[ℝ] W) (hg : ContDiff ℝ ∞ g) (A : SmoothL2Field V) (B C R : ℝ) (hB : 0 ≤ B) (hC : 0 ≤ C) (hR : 0 ≤ R) (hgb : HasSupBound g B R) (hab : A.HasJetBound C R) : SmoothL2Field W where field x := g x (A.field x) diff --git a/LeanPool/NavierStokesAndEuler/Euler/SmoothL2ScalingContinuity.lean b/LeanPool/NavierStokesAndEuler/Euler/SmoothL2ScalingContinuity.lean index abe3031f66..68e6bc3247 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 @@ -27,7 +27,7 @@ open scoped ContDiff Topology variable {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] /-- Sub field, bundling `field`, `smooth`, `integrable`. -/ -def subField (A B : SmoothL2Field V) : SmoothL2Field V where +@[expose] def subField (A B : SmoothL2Field V) : SmoothL2Field V where field := A.field-B.field smooth := A.smooth.sub B.smooth integrable n := ((A.integrable n).sub (B.integrable n)).ae_eq @@ -35,7 +35,8 @@ def subField (A B : SmoothL2Field V) : SmoothL2Field V where (A.smooth.contDiffAt.of_le (by simp)) (B.smooth.contDiffAt.of_le (by simp))).symm)) @[simp] theorem subField_apply (A B : SmoothL2Field V) (x : Space) : - (subField A B).field x=A.field x-B.field x := rfl + (subField A B).field x=A.field x-B.field x := by + rfl theorem jetLp_subField (A B : SmoothL2Field V) (n : ℕ) : (subField A B).jetLp n=A.jetLp n-B.jetLp n := by 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..1dc6d4cae9 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 @@ -36,6 +36,7 @@ variable {E V : Type*} (hf : ContDiff ℝ ∞ f) (hq : ContDiff ℝ ∞ q) /-- Jet family, given by `tensorPathMap n (iteratedFDeriv ℝ n f x)`. -/ +@[expose] def jetFamily (n : ℕ) (x : E) : C(Icc (0 : ℝ) T,E [×n]→L[ℝ] V) := tensorPathMap n (iteratedFDeriv ℝ n f x) 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..c15ea2c38f 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 @@ -43,7 +43,7 @@ variable {V : Type u} [NormedAddCommGroup V] [NormedSpace ℝ V] /-- Bound constant, bundling `field`, `smooth`, `jet`, `jet_eq` and the required compatibility proofs. -/ -def boundConstant (v : V) : SmoothTimeField K E V where +@[expose] def boundConstant (v : V) : SmoothTimeField K E V where field := ContinuousMap.const K (BoundedContinuousFunction.const E v) smooth _ := contDiff_const jet n := ContinuousMap.const K (BoundedContinuousFunction.const E @@ -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 @@ -101,14 +101,14 @@ local instance instSmoothTimeFieldBilinear10 (n : ℕ) : NormedSpace ℝ (E → Z))) := inferInstance /-- Bilinear path as an element of `C(K,E →ᵇ Z)`. -/ -def bilinearPath (B : V →L[ℝ] W →L[ℝ] Z) +@[expose] def bilinearPath (B : V →L[ℝ] W →L[ℝ] Z) (A : SmoothTimeField K E V) (C : SmoothTimeField K E W) : C(K,E →ᵇ Z) := ⟨fun t => bilinearMap B (A.field t) (C.field t), ((bilinearMap (α := E) B).continuous.comp A.field.continuous).clm_apply C.field.continuous⟩ @[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 @@ -160,7 +161,7 @@ theorem exists_bilinear_jet (B : V →L[ℝ] W →L[ℝ] Z) simp))).symm /-- Bilinear, bundling `field`, `smooth`, `jet`, `jet_eq`. -/ -def bilinear (B : V →L[ℝ] W →L[ℝ] Z) +@[expose] def bilinear (B : V →L[ℝ] W →L[ℝ] Z) (A : SmoothTimeField K E V) (C : SmoothTimeField K E W) : SmoothTimeField K E Z where field := bilinearPath B A C smooth t := (B.contDiff.comp (A.smooth t)).clm_apply (C.smooth t) @@ -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..3cdd25939a 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 @@ -38,13 +38,14 @@ variable {K E V W : Type} [TopologicalSpace K] [CompactSpace K] [NormedAddCommGroup W] [NormedSpace ℝ W] /-- Apply field, given by `bilinear (ContinuousLinearMap.id ℝ (V →L[ℝ] W)) A B`. -/ +@[expose] def applyField (A : SmoothTimeField K E (V →L[ℝ] W)) (B : SmoothTimeField K E V) : SmoothTimeField K E W := bilinear (ContinuousLinearMap.id ℝ (V →L[ℝ] W)) A B @[simp] theorem applyField_apply (A : SmoothTimeField K E (V →L[ℝ] W)) (B : SmoothTimeField K E V) (t : K) (x : E) : - (applyField A B).field t x = A.field t x (B.field t x) := rfl + (applyField A B).field t x = A.field t x (B.field t x) := by rfl end Application diff --git a/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldComposition.lean b/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldComposition.lean index f26d647bfa..f16313a2c9 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 @@ -33,13 +33,13 @@ namespace EulerBoundedFieldPullback variable {E V : Type*} [NormedAddCommGroup E] [NormedAddCommGroup V] /-- Pullback, constructed using `BoundedContinuousFunction.ofNormedAddCommGroup`. -/ -def pullback (A : E →ᵇ V) (d : E →ᵇ E) : E →ᵇ V := +@[expose] def pullback (A : E →ᵇ V) (d : E →ᵇ E) : E →ᵇ V := BoundedContinuousFunction.ofNormedAddCommGroup (fun x => A (x+d x)) (A.continuous.comp (continuous_id.add d.continuous)) ‖A‖ (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‖ := @@ -81,13 +81,13 @@ theorem continuous_pullback (A : C(K, E →ᵇ V)) (d : C(K, E →ᵇ E)) exact hzero /-- Path pullback, given by `⟨fun t => pullback (A t) (d t), continuous_pullback A d L hL⟩`. -/ -def pathPullback (A : C(K, E →ᵇ V)) (d : C(K, E →ᵇ E)) +@[expose] def pathPullback (A : C(K, E →ᵇ V)) (d : C(K, E →ᵇ E)) (L : ℝ≥0) (hL : ∀ t, LipschitzWith L (A t)) : C(K,E →ᵇ V) := ⟨fun t => pullback (A t) (d t), continuous_pullback A d L hL⟩ @[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 @@ -339,7 +339,7 @@ theorem partitionJet_apply (A : SmoothTimeField K E V) (D : SmoothTimeField K E /-- Comp displacement, bundling `field`, `smooth`, `jet`, `jet_eq` and the required compatibility proofs. -/ -def compDisplacement (A : SmoothTimeField K E V) (D : SmoothTimeField K E E) : +@[expose] def compDisplacement (A : SmoothTimeField K E V) (D : SmoothTimeField K E E) : SmoothTimeField K E V where field := pathPullback A.field D.field ‖A.jet 1‖₊ A.field_lipschitz smooth t := (A.smooth t).comp (contDiff_id.add (D.smooth t)) @@ -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..4f7a1b154a 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 @@ -34,7 +34,7 @@ theorem sumNorm_ofJet {q : ℕ} {f : LiftL2 period} (J : SpatialJet period stand period J) /-- An L² operator with a genuine derivative-jet construction acts on the complete Sobolev space. -/ -def jetLift {q : ℕ} (A : LiftL2 period →L[ℝ] LiftL2 period) +@[expose] def jetLift {q : ℕ} (A : LiftL2 period →L[ℝ] LiftL2 period) (Jmap : ∀ {f : LiftL2 period}, SpatialJet period standardDirection q f → SpatialJet period standardDirection q (A f)) (u : SobolevSpace period q) : SobolevSpace period q := ofJet period (Jmap (toJet period u)) @@ -61,7 +61,7 @@ theorem jetLift_bound {q : ℕ} (A : LiftL2 period →L[ℝ] LiftL2 period) (mul_assoc _ _ _).symm) /-- Uniqueness of derivative arrays makes a genuine L² jet lift linear. -/ -def jetLiftLinearMap (q : ℕ) (A : LiftL2 period →L[ℝ] LiftL2 period) +@[expose] def jetLiftLinearMap (q : ℕ) (A : LiftL2 period →L[ℝ] LiftL2 period) (Jmap : ∀ {f : LiftL2 period}, SpatialJet period standardDirection q f → SpatialJet period standardDirection q (A f)) : SobolevSpace period q →ₗ[ℝ] SobolevSpace period q where @@ -81,7 +81,7 @@ def jetLiftLinearMap (q : ℕ) (A : LiftL2 period →L[ℝ] LiftL2 period) exact map_smul A r _ /-- The bounded continuous lift of an actual L² operator with proved derivative-jet estimates. -/ -def jetLiftOperator (q : ℕ) (A : LiftL2 period →L[ℝ] LiftL2 period) +@[expose] def jetLiftOperator (q : ℕ) (A : LiftL2 period →L[ℝ] LiftL2 period) (Jmap : ∀ {f : LiftL2 period}, SpatialJet period standardDirection q f → SpatialJet period standardDirection q (A f)) (C : ℝ) (hC : 0 ≤ C) (hJ : ∀ {f : LiftL2 period} (J : SpatialJet period standardDirection q f), @@ -91,7 +91,7 @@ def jetLiftOperator (q : ℕ) (A : LiftL2 period →L[ℝ] LiftL2 period) (jetLift_bound period A Jmap C hC hJ) /-- Actual multiplication by a smooth bounded coefficient, as a Sobolev continuous linear map. -/ -def coefficientSobolevOperator {q : ℕ} {A : SmoothCoefficient period} +@[expose] def coefficientSobolevOperator {q : ℕ} {A : SmoothCoefficient period} (K : CoefficientJet period standardDirection q A) : SobolevSpace period q →L[ℝ] SobolevSpace period q := jetLiftOperator period q A.operator (SpatialJet.multiply K) K.productConstant @@ -107,6 +107,7 @@ theorem coefficientSobolevOperator_value {q : ℕ} {A : SmoothCoefficient period jetLift_value period A.operator (SpatialJet.multiply K) u /-- The existing Lax–Milgram pressure inverse as an ambient L² continuous linear map. -/ +@[expose] def pressureL2Operator (A : SmoothCoefficient period) (κ : ℝ) (m : Vector3) (c : ℝ) (hc : 0 < c) (hpos : ∀ x v, c * ‖v‖ ^ 2 ≤ ⟪A.coefficient x v, v⟫_ℝ) : LiftL2 period →L[ℝ] LiftL2 period := @@ -120,11 +121,11 @@ 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. -/ -def pressureSobolevOperator {q : ℕ} {A : SmoothCoefficient period} +@[expose] def pressureSobolevOperator {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 := @@ -153,7 +154,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..5ac44507ad 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 @@ -35,18 +35,18 @@ def driftWordOperator {s : ℕ} (L : Vector3 →L[ℝ] Domain 4) (w : SobolevWor (L.compLpL 2 (liftMeasure period)).comp (wordOperator period w) /-- The exact sum of L² norms of drift derivatives at one total derivative order. -/ -def driftLevelNorm {s : ℕ} (n : ℕ) (L : Vector3 →L[ℝ] Domain 4) +@[expose] def driftLevelNorm {s : ℕ} (n : ℕ) (L : Vector3 →L[ℝ] Domain 4) (u : SobolevSpace period s) : ℝ := ∑ w : Fin n → Fin 4, ‖L.compLpL 2 (liftMeasure period) ((toJet period u).word w)‖ /-- 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..a3ee4ff499 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,15 +41,16 @@ 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. -/ -def gevreyWeightPath (T : ℝ) (ρ : C(Icc (0 : ℝ) T, ℝ)) (n : ℕ) : C(Icc (0 : ℝ) T, ℝ) := +@[expose] def gevreyWeightPath (T : ℝ) (ρ : C(Icc (0 : ℝ) T, ℝ)) (n : ℕ) : C(Icc (0 : ℝ) T, ℝ) := ⟨fun t => weight (ρ t) n, (ρ.continuous.pow n).div_const ((n.factorial : ℝ)^2)⟩ omit [Fact (0 < period)] in /-- The actual radius-loss weight along the same radius path. -/ +@[expose] def gevreyLossWeightPath (T : ℝ) (ρ : C(Icc (0 : ℝ) T, ℝ)) (n : ℕ) : C(Icc (0 : ℝ) T, ℝ) := (n : ℝ) • gevreyWeightPath T ρ n 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..bc36ec3d5b 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 @@ -590,6 +592,7 @@ open scoped Topology NNReal variable (period : ℝ) [Fact (0 < period)] /-- The actual spatial Laplacian evaluated as a bounded map from Hq to L², q≥2. -/ +@[expose] def laplacianEvaluation (q : ℕ) (hq : 2 ≤ q) : SobolevSpace period q →L[ℝ] LiftL2 period := ∑ i : Fin 4, wordOperator period (⟨⟨2, Nat.lt_succ_of_le hq⟩, fun _ : Fin 2 => i⟩ : SobolevWord q) @@ -630,17 +633,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 +654,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 +715,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..732c4e0cfe 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 @@ -58,8 +58,8 @@ theorem heatKernel_joint_continuous (q : ℕ) (ν : ℝ) (hν : 0 < ν) : rfl /-- The free viscous heat evolution is an actual continuous path in every Sobolev space. -/ -def freeHeatPath (q : ℕ) (ν T : ℝ) (u₀ : SobolevSpace period q) : C(Icc (0 : ℝ) T, SobolevSpace - period q) where +@[expose] def freeHeatPath (q : ℕ) (ν T : ℝ) (u₀ : SobolevSpace period q) : + C(Icc (0 : ℝ) T, SobolevSpace period q) where toFun t := heatOperator period q (2 * ν * t.val).toNNReal u₀ continuous_toFun := (heatOperator_continuous period u₀).comp (continuous_real_toNNReal.comp (continuous_const.mul continuous_subtype_val)) 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..32ad5abae2 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 @@ -110,14 +110,12 @@ theorem scalarProduct_hasDerivAt (L : Vector3 →L[ℝ] ℝ) (i : Fin 4) (scalarProduct period (le_refl 3) L (truncateOperator period 3 u) v' + scalarProduct period (le_refl 3) L (derivativeOperator period 3 i u) v) 0 := by let B := scalarProductBilinear period (le_refl 3) L - have hU := sobolevTranslation_hasDerivAt period i u + have hU := sobolevTranslation_hasDerivAt (q := 3) period i u have h := B.hasDerivAt_of_bilinear (fun _ => hU) (fun _ => hv) 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,17 +123,25 @@ 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 _ _ _ - change HasDerivAt (fun t => B (sobolevTranslation period 3 (translationPath period - (standardDirection i) t) - (truncateOperator period 3 u)) (translation period (translationPath period (standardDirection - i) t) v)) - (B (sobolevTranslation period 3 (translationPath period (standardDirection i) 0) - (truncateOperator period 3 u)) v' + - 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 + scalarProduct_translation period (le_refl 3) L _ _ _ + have hzeroV : translation period (translationPath period (standardDirection i) 0) v = v := by + rw [translationPath_zero, translation_zero] + have hderiv : + B (sobolevTranslation period 3 (translationPath period (standardDirection i) 0) + (truncateOperator period 3 u)) v' + + B (derivativeOperator period 3 i u) + (translation period (translationPath period (standardDirection i) 0) v) = + B (truncateOperator period 3 u) v' + B (derivativeOperator period 3 i u) v := by + rw [hzero, hzeroV] + have hproduct : + B (truncateOperator period 3 u) v' + B (derivativeOperator period 3 i u) v = + scalarProduct period (le_refl 3) L (truncateOperator period 3 u) v' + + scalarProduct period (le_refl 3) L (derivativeOperator period 3 i u) v := by + simp only [B, scalarProductBilinear_apply] + have h1 := h.congr_of_eventuallyEq + (Filter.Eventually.of_forall (fun t => congrFun he.symm t)) + exact h1.congr_deriv (hderiv.trans hproduct) /-- 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 +161,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 +199,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 +324,7 @@ end end -@[expose] public section +public section noncomputable section @@ -385,7 +388,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 +458,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 +472,7 @@ section /-! Cauchy convergence of actual smooth cylinder products in the complete Sobolev space. -/ -@[expose] public section +public section noncomputable section @@ -614,7 +615,7 @@ end end -@[expose] public section +public section noncomputable section @@ -638,13 +639,16 @@ 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 [productApprox, productHighLow_value] + change scalarProductBilinear period (by omega : 3 ≤ q) L (U n) + (value period (sobolevMollifier period q n v)) = + value period (productHighLow period L (smoothApprox period q n u) + (sobolevMollifier period q n v)) + conv_lhs => rw [scalarProductBilinear_apply] + conv_rhs => rw [productHighLow_value] exact scalarProduct_of_value_eq period (by omega : 3 ≤ q) (le_refl 3) L _ _ rfl _ /-- The actual pointwise product lies in Hq and satisfies the proved fixed-order algebra bound. -/ @@ -661,7 +665,7 @@ theorem exists_sobolev_product {q : ℕ} (hq : 6 ≤ q) hq n L hL u v)) /-- The genuine product in the complete Sobolev space, uniquely determined by its L² value. -/ -def productHq {q : ℕ} (hq : 6 ≤ q) (L : Vector3 →L[ℝ] ℝ) (hL : ‖L‖ ≤ 1) +@[expose] def productHq {q : ℕ} (hq : 6 ≤ q) (L : Vector3 →L[ℝ] ℝ) (hL : ‖L‖ ≤ 1) (u v : SobolevSpace period q) : SobolevSpace period q := Classical.choose (exists_sobolev_product period hq L hL u v) @@ -723,7 +727,7 @@ theorem productHq_smul_right {q : ℕ} (hq : 6 ≤ q) (L : Vector3 →L[ℝ] ℝ exact scalarProduct_smul_right period (by omega : 3 ≤ q) L u r (value period v) /-- Multiplication by a Sobolev scalar component, as an actual bounded Sobolev operator. -/ -def productHqRight {q : ℕ} (hq : 6 ≤ q) (L : Vector3 →L[ℝ] ℝ) (hL : ‖L‖ ≤ 1) +@[expose] def productHqRight {q : ℕ} (hq : 6 ≤ q) (L : Vector3 →L[ℝ] ℝ) (hL : ‖L‖ ≤ 1) (u : SobolevSpace period q) : SobolevSpace period q →L[ℝ] SobolevSpace period q := LinearMap.mkContinuous { toFun := productHq period hq L hL u @@ -739,7 +743,7 @@ theorem productHqRight_norm {q : ℕ} (hq : 6 ≤ q) (L : Vector3 →L[ℝ] ℝ) (productHq_norm period hq L hL u) /-- The actual complete Sobolev algebra multiplication is a continuous bilinear map. -/ -def productHqBilinear {q : ℕ} (hq : 6 ≤ q) (L : Vector3 →L[ℝ] ℝ) (hL : ‖L‖ ≤ 1) : +@[expose] def productHqBilinear {q : ℕ} (hq : 6 ≤ q) (L : Vector3 →L[ℝ] ℝ) (hL : ‖L‖ ≤ 1) : SobolevSpace period q →L[ℝ] SobolevSpace period q →L[ℝ] SobolevSpace period q := LinearMap.mkContinuous { toFun := productHqRight period hq L hL @@ -757,6 +761,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..ea42ed9fd2 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 @@ -21,13 +21,14 @@ open EulerLiftedGradientSpace EulerPressureSpatialRegularity EulerCylinderSobole open scoped Topology /-- The same derivative word at a larger Sobolev order. -/ -def restrictIndex {p q : ℕ} (h : q ≤ p) (w : SobolevWord q) : SobolevWord p := +@[expose] def restrictIndex {p q : ℕ} (h : q ≤ p) (w : SobolevWord q) : SobolevWord p := ⟨⟨w.1.val, Nat.lt_of_lt_of_le w.1.isLt (Nat.succ_le_succ h)⟩, w.2⟩ 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..13a64cd3e6 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 @@ -27,7 +27,7 @@ open scoped Topology ContDiff NNReal variable (period : ℝ) [Fact (0 < period)] /-- Three successive genuine heat smoothing steps. -/ -def heatGainThree (q : ℕ) (v : ℝ≥0) (hv : 0 < v) : +@[expose] def heatGainThree (q : ℕ) (v : ℝ≥0) (hv : 0 < v) : SobolevSpace period q →L[ℝ] SobolevSpace period (q+3) := (heatGain period (q+2) v hv).comp ((heatGain period (q+1) v hv).comp (heatGain period q v hv)) @@ -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..e581cd03df 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 @@ -59,7 +59,7 @@ theorem externalCommutator_apply {s : ℕ} (hs : 6 ≤ s) (n : ℕ) (w : Fin n wordAtLevel period 6 n w hn (transportBilinear period hs L hL u v) - transportBilinear period (by norm_num : 6 ≤ 6) L hL (restrictOperator period (by omega : 7 ≤ s+1) u) - (wordAtLevel period 7 n w (by omega : n+7 ≤ s+1) v) := rfl + (wordAtLevel period 7 n w (by omega : n+7 ≤ s+1) v) := by rfl omit [Fact (0 < period)] in /-- Classical transport of smooth cylinder fields is smooth. -/ 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..0feba03370 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 @@ -29,7 +29,7 @@ open scoped ContDiff Topology variable (period : ℝ) [Fact (0 < period)] /-- A genuine derivative word followed by restriction to its prescribed target Sobolev level. -/ -def wordAtLevel {s : ℕ} (q n : ℕ) (w : Fin n → Fin 4) (h : n + q ≤ s) : +@[expose] def wordAtLevel {s : ℕ} (q n : ℕ) (w : Fin n → Fin 4) (h : n + q ≤ s) : SobolevSpace period s →L[ℝ] SobolevSpace period q := (wordBlock period q n w).comp (restrictOperator period (by omega : q+n ≤ s)) @@ -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..4810b418a1 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 @@ -60,7 +60,7 @@ open ContDiff Set InnerProductSpace MeasureTheory namespace Euler /-- The divergence of a vector field, computed as the trace of its derivative. -/ -noncomputable def divergence (v : ℝ³ → ℝ³) (x : ℝ³) : ℝ := +@[expose] noncomputable def divergence (v : ℝ³ → ℝ³) (x : ℝ³) : ℝ := (fderiv ℝ v x).trace ℝ ℝ³ local notation "∇⬝" => divergence @@ -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 @@ -137,17 +137,17 @@ structure EulerSobolevExistenceAndSmoothnessR3On (I : Set ℝ) /-- The ordinary curl of a velocity field, expressed through its spatial derivative. Indices in `Fin 3` are cyclic. -/ -noncomputable def vorticity (v : ℝ³ → ℝ³) (x : ℝ³) : ℝ³ := +@[expose] noncomputable def vorticity (v : ℝ³ → ℝ³) (x : ℝ³) : ℝ³ := WithLp.toLp 2 (fun i : Fin 3 => (fderiv ℝ v x (EuclideanSpace.single (i + 1) 1)) (i + 2) - (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..ccedc66b83 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 @@ -62,20 +62,20 @@ local instance instSourceCylinderEquation4 : NormedSpace ℝ (Supported period E inferInstance /-- The actual unnormalized coordinate solution; no regularity of a profile g is needed. -/ -def coordinates : C(Icc (0 : ℝ) T,Supported period U S hS) := +@[expose] def coordinates : C(Icc (0 : ℝ) T,Supported period U S hS) := (evolution period T hT Q Q₁ c hc hQ S hS).solution (projectedForcing period S hS Q c hc hQ f) a₀ /-- Its actual ordinary right side. -/ -def coordinateDerivative : C(Icc (0 : ℝ) T,Supported period U S hS) := +@[expose] def coordinateDerivative : C(Icc (0 : ℝ) T,Supported period U S hS) := supportedMultiplierMap period S hS (sourceGenerator Q Q₁ c hc hQ) (coordinates period S hS T hT Q Q₁ c hc hQ f a₀) + projectedForcing period S hS Q c hc hQ f /-- The physical transverse velocity A=Q a. -/ -def velocity : C(Icc (0 : ℝ) T,Supported period E S hS) := +@[expose] def velocity : C(Icc (0 : ℝ) T,Supported period E S hS) := physicalVelocity period S hS Q (coordinates period S hS T hT Q Q₁ c hc hQ f a₀) /-- Its literal product-rule expression, proved below to be the time derivative. -/ -def velocityDerivative : C(Icc (0 : ℝ) T,Supported period E S hS) := +@[expose] def velocityDerivative : C(Icc (0 : ℝ) T,Supported period E S hS) := supportedMultiplierMap period S hS Q₁.field (coordinates period S hS T hT Q Q₁ c hc hQ f a₀) + supportedMultiplierMap period S hS Q.field (coordinateDerivative period S hS T hT Q Q₁ c hc hQ f a₀) @@ -140,6 +140,9 @@ theorem coordinate_equation_ae (t : Icc (0 : ℝ) T) : rw [hs] simp only [Pi.add_apply,fullOperatorMap_apply] rw [hB,hP] + simp only [fieldLift_apply, B, P, sourceGenerator, sourceForcing, + EulerBoundedFieldForwardGenerator.generatorPath_apply, + EulerBoundedFieldForwardGenerator.leftInversePath_apply, smul_apply, comp_apply] change gram (Q.field t x.1) ((-2 : ℝ) • gramInverse (Q.field t x.1) c hc (hQ t x.1) ((Q.field t x.1).adjoint (Q₁.field t x.1 ((u : CylinderL2 period U) x))) + gramInverse (Q.field t x.1) c hc (hQ t x.1) ((Q.field t x.1).adjoint ((f t : CylinderL2 period diff --git a/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderForcing.lean b/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderForcing.lean index 1a865254d9..007313a762 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,11 +43,11 @@ 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. -/ -def physicalVelocity (u : C(K, Supported period U S hS)) : C(K,Supported period E S hS) := +@[expose] def physicalVelocity (u : C(K, Supported period U S hS)) : C(K,Supported period E S hS) := supportedMultiplierMap period S hS Q.field u theorem projectedForcing_contDiff (f : C(K, Supported period E S hS)) diff --git a/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderForward.lean b/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderForward.lean index 8c1ee26d89..c4defff59a 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 @@ -51,7 +51,7 @@ synthesis. -/ local instance instSourceCylinderForward2 : NormedRing (Space →ᵇ U →L[ℝ] U) := inferInstance /-- Actual homogeneous evolution from the source Gram generator. -/ -def evolution (S : Set Space) (hS : MeasurableSet S) := +@[expose] def evolution (S : Set Space) (hS : MeasurableSet S) := constructedEvolution period S hS T hT (sourceGenerator Q Q₁ c hc hQ) /-- The source coefficient automatically has the translated regularity needed by the solver. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderForwardSobolev.lean b/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderForwardSobolev.lean index af1f00110b..589e7396e2 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 @@ -50,16 +50,16 @@ synthesis. -/ local instance instSourceCylinderForwardSobolev2 : NormedRing (Space →ᵇ U →L[ℝ] U) := inferInstance /-- Actual profile-normalized coordinates with physical forcing as input. -/ -def normalizedCoordinates : C(Icc (0 : ℝ) T,Supported period U S hS) := +@[expose] def normalizedCoordinates : C(Icc (0 : ℝ) T,Supported period U S hS) := (evolution period T hT Q Q₁ c hc hQ S hS).weightedSolution g hg (projectedForcing period S hS Q c hc hQ f) a₀ /-- The corresponding actual profile-normalized physical velocity. -/ -def normalizedVelocity : C(Icc (0 : ℝ) T,Supported period E S hS) := +@[expose] 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..80c224172e 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 @@ -79,16 +79,17 @@ local instance instCylinderAngleAverageEvolution6 : NormedSpace ℝ (C(K,Support inferInstance /-- Supported path average, given by `(supportedAverage P S hS).compLeftContinuous ℝ K`. -/ -def supportedPathAverage : C(K,Supported P V S hS) →L[ℝ] C(K,Supported P V S hS) := +@[expose] def supportedPathAverage : C(K,Supported P V S hS) →L[ℝ] C(K,Supported P V S hS) := (supportedAverage P S hS).compLeftContinuous ℝ K omit [CompactSpace K] in @[simp] theorem supportedPathAverage_apply (p : C(K, Supported P V S hS)) (t : K) : - supportedPathAverage P S hS p t = supportedAverage P S hS (p t) := rfl + supportedPathAverage P S hS p t = supportedAverage P S hS (p t) := by rfl omit [CompactSpace K] in theorem include_supportedPathAverage (p : C(K, Supported P V S hS)) : - includePath P S hS (supportedPathAverage P S hS p) = pathAverage P (includePath P S hS p) := rfl + includePath P S hS (supportedPathAverage P S hS p) = + pathAverage P (includePath P S hS p) := by rfl theorem supportedPathAverage_norm : ‖supportedPathAverage (K := K) (V := V) P S hS‖ ≤ 1 := by apply opNorm_le_bound _ zero_le_one @@ -151,7 +152,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..3c7f680665 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,12 +206,12 @@ 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 /-- The reconstructed actual product-rule time derivative. -/ -def derivativeField (t : Icc (0 : ℝ) T) (x : LiftDomain period) : Space := +@[expose] def derivativeField (t : Icc (0 : ℝ) T) (x : LiftDomain period) : Space := pointField period (includePath period S hS (velocityDerivative period S hS T hT Q Q₁ c hc hQ f a₀)) (velocityDerivative_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 @@ -465,7 +465,7 @@ variable (period : ℝ) [Fact (0 < period)] (cm : ℝ) (hcm : 0 < cm) (hm : ∀ t x, cm ≤ ‖m.field t x‖ ^ 2) /-- A genuine supported scalar path representing the right side of ∂θπ in (11). -/ -def pressureSource : C(Icc (0 : ℝ) T,Supported period ℝ S hS) := +@[expose] def pressureSource : C(Icc (0 : ℝ) T,Supported period ℝ S hS) := supportedMultiplierMap (K := Icc (0 : ℝ) T) (E := Space) (F := ℝ) period S hS (normalFunctional m cm hcm hm) (f - (2 : ℝ) • supportedMultiplierMap (K := Icc (0 : ℝ) T) (E := Space) (F := Space) @@ -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 @@ -665,7 +665,7 @@ variable (P : ℝ) [Fact (0 < P)] (cm : ℝ) (hcm : 0 < cm) (hm : ∀ t x, cm ≤ ‖m.field t x‖ ^ 2) /-- The actual bounded angular inverse applied to the solved scalar source. -/ -def pressurePath : C(Icc (0 : ℝ) T,CylinderL2 P ℝ) := +@[expose] def pressurePath : C(Icc (0 : ℝ) T,CylinderL2 P ℝ) := pathPrimitive P (includePath P S hS (pressureSource P S hS T hT Q Q₁ c hc hQ f a₀ M m cm hcm hm)) @@ -702,6 +702,7 @@ variable (P : ℝ) [Fact (0 < P)] (ha₀zero : average P (a₀ : CylinderL2 P U) = 0) /-- The literal normalized periodic pressure for the actual forward solution. -/ +@[expose] def pressureField (t : Icc (0 : ℝ) T) : LiftDomain P → ℝ := classicalPrimitive P (normalResidual P S hS hSc T hT Q Q₁ c hc hQ f a₀ hf ha₀ M m t) diff --git a/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderPressureWeight.lean b/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderPressureWeight.lean index 6c40b8f256..e8f6364fc8 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 @@ -82,7 +82,7 @@ variable (P : ℝ) [Fact (0 < P)] theorem pressurePath_eq_sourcePressure : pressurePath P S hS T hT Q Q₁ c hc hQ f a₀ M m cm hcm hm = sourcePressure P M m cm hcm hm (includePath P S hS f) - (includePath P S hS (velocity P S hS T hT Q Q₁ c hc hQ f a₀)) := rfl + (includePath P S hS (velocity P S hS T hT Q Q₁ c hc hQ f a₀)) := by rfl variable (g : C(Icc (0 : ℝ) T, ℝ)) (hg : ∀ t, 0 < g t) diff --git a/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderTimeBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderTimeBounds.lean index 58180694fb..c5860b96ff 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 @@ -49,13 +49,13 @@ variable (P : ℝ) [Fact (0 < P)] /-- Coordinate rhs, given by `supportedMultiplierMap P S hS (sourceGenerator Q Q₁ c hc hQ) a + projectedForcing P S hS Q c hc hQ f`. -/ -def coordinateRhs : C(K,Supported P U S hS) := +@[expose] def coordinateRhs : C(K,Supported P U S hS) := supportedMultiplierMap P S hS (sourceGenerator Q Q₁ c hc hQ) a + projectedForcing P S hS Q c hc hQ f /-- Physical rhs, given by `supportedMultiplierMap P S hS Q₁.field a + supportedMultiplierMap P S hS Q.field (coordinateRhs P S hS Q Q₁ c hc hQ f a)`. -/ -def physicalRhs : C(K,Supported P E S hS) := +@[expose] def physicalRhs : C(K,Supported P E S hS) := supportedMultiplierMap P S hS Q₁.field a + supportedMultiplierMap P S hS Q.field (coordinateRhs P S hS Q Q₁ c hc hQ f a) @@ -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 @@ -124,8 +124,10 @@ theorem coordinateRhs_block_bound (projectedForcing P S hS Q c hc hQ f))) (supported_product_orbit_contDiff P B hB S hS a ha) (projectedForcing_contDiff P S hS Q c hc hQ f hf) n 0 + simp only [include_supportedMultiplier] at hsum have hbound := hsum.trans (add_le_add hfirst hsecond) - simpa only [coordinateRhs,coordinateCost,B,map_add,Pi.add_def,add_mul] using hbound + simpa only [coordinateRhs,coordinateCost,B,map_add,Pi.add_def,add_mul, + include_supportedMultiplier] using hbound theorem physicalRhs_block_bound (directions : ι → LiftTangent) (hd : ∀ i, ‖directions i‖ ≤ 1) (q : ℕ) @@ -180,8 +182,10 @@ theorem physicalRhs_block_bound (supportedMultiplierMap P S hS Q.field (coordinateRhs P S hS Q Q₁ c hc hQ f a)))) (supported_product_orbit_contDiff P Q₁.field Q₁.translation_contDiff S hS a ha) (supported_product_orbit_contDiff P Q.field Q.translation_contDiff S hS _ hcoord) n 0 + simp only [include_supportedMultiplier] at hsum have hbound := hsum.trans (add_le_add hfirst hsecond) - simpa only [physicalRhs,physicalCost,map_add,Pi.add_def,add_mul] using hbound + simpa only [physicalRhs,physicalCost,map_add,Pi.add_def,add_mul, + include_supportedMultiplier] using hbound theorem coordinateRhs_weight (g : C(K, ℝ)) : coordinateRhs P S hS Q Q₁ c hc hQ (weight g f) (weight g a) = 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..de30c8efa0 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 @@ -513,25 +513,26 @@ local instance instForwardPathDistribSMul : DistribSMul ℝ C(K, α →ᵇ U → inferInstance /-- The actual projected-forcing coefficient field. -/ -def leftInversePath (c : ℝ) (hc : 0 < c) (Q : C(K, α →ᵇ U →L[ℝ] E)) +@[expose] def leftInversePath (c : ℝ) (hc : 0 < c) (Q : C(K, α →ᵇ U →L[ℝ] E)) (hQ : ∀ t x v, c * ‖v‖ ^ 2 ≤ ‖Q t x v‖ ^ 2) : C(K,α →ᵇ E →L[ℝ] U) := pathCompositionMap (α := α) (K := K) (U := E) (E := U) (F := U) (inversePath c hc Q hQ) (pathAdjointMap (α := α) (K := K) (U := U) (E := E) Q) /-- The actual ordinary coefficient in source equation (12). -/ -def generatorPath (c : ℝ) (hc : 0 < c) (Q Q₁ : C(K, α →ᵇ U →L[ℝ] E)) +@[expose] def generatorPath (c : ℝ) (hc : 0 < c) (Q Q₁ : C(K, α →ᵇ U →L[ℝ] E)) (hQ : ∀ t x v, c * ‖v‖ ^ 2 ≤ ‖Q t x v‖ ^ 2) : C(K,α →ᵇ U →L[ℝ] U) := (-2 : ℝ) • pathCompositionMap (α := α) (K := K) (U := U) (E := E) (F := U) (leftInversePath c hc Q hQ) Q₁ @[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..7c78b284a4 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 @@ -35,13 +35,13 @@ variable {K E : Type*} [TopologicalSpace K] [CompactSpace K] (m : SmoothCoefficientPath K E) /-- The normal vector as a genuine scalar-to-vector coefficient path. -/ -def normalColumn : SmoothCoefficientPath K (ℝ →L[ℝ] E) := +@[expose] def normalColumn : SmoothCoefficientPath K (ℝ →L[ℝ] E) := SmoothCoefficientPath.map (ContinuousLinearMap.toSpanSingletonLIE ℝ E).toLinearIsometry.toContinuousLinearMap m 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) @@ -53,7 +53,7 @@ theorem normalColumn_lower (c : ℝ) (hm : ∀ t x, c ≤ ‖m.field t x‖ ^ 2) variable (c : ℝ) (hc : 0 < c) (hm : ∀ t x, c ≤ ‖m.field t x‖ ^ 2) /-- The actual scalar coefficient used by the pressure in equation (11). -/ -def normalFunctional : C(K,Space →ᵇ E →L[ℝ] ℝ) := +@[expose] def normalFunctional : C(K,Space →ᵇ E →L[ℝ] ℝ) := sourceForcing (normalColumn m) c hc (normalColumn_lower m c hm) /-- The constructed Gram left inverse is precisely the literal normal quotient. -/ @@ -62,9 +62,13 @@ 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, + EulerBoundedFieldForwardGenerator.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..02e78f0eda 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 @@ -46,7 +46,7 @@ variable (period : ℝ) [Fact (0 < period)] (f v : C(K, CylinderL2 period E)) /-- The actual scalar coefficient of the normal residual, as a cylinder L² path. -/ -def normalResidualPath : C(K,CylinderL2 period ℝ) := +@[expose] def normalResidualPath : C(K,CylinderL2 period ℝ) := fullMultiplierMap period N (f - (2 : ℝ) • fullMultiplierMap period M v) theorem normalResidualPath_contDiff @@ -116,7 +116,7 @@ end end -@[expose] public section +public section noncomputable section @@ -135,11 +135,11 @@ variable (P : ℝ) [Fact (0 < P)] (f v : C(K, CylinderL2 P Space)) /-- Source residual, given by `normalResidualPath P (normalFunctional m cm hcm hm) M.field f v`. -/ -def sourceResidual : C(K,CylinderL2 P ℝ) := +@[expose] 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..0bfa39dde6 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)) @@ -298,7 +298,7 @@ def orderZeroPath {s : ℕ} (hs : 6 ≤ s) (T : ℝ) /-- The genuine energy-order raw correction source uses the constructed higher derivative only in its top transport. -/ -def rawSourceTime {s : ℕ} (hs : 6 ≤ s) (T : ℝ) (hT : 0 ≤ T) +@[expose] def rawSourceTime {s : ℕ} (hs : 6 ≤ s) (T : ℝ) (hT : 0 ≤ 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)) @@ -372,7 +372,7 @@ theorem restrict_raw_source {q : ℕ} (hq : 6 ≤ q) L hL A0 KP0 KQ0 A KP KQ z r e)) /-- The actual positive coercive pressure operator is a continuous energy-order time path. -/ -def positivePressurePath {s : ℕ} (T : ℝ) (G : CoefficientPath period s (Icc (0 : ℝ) T)) +@[expose] def positivePressurePath {s : ℕ} (T : ℝ) (G : CoefficientPath period s (Icc (0 : ℝ) T)) (κ : ℝ) (m : Vector3) (c : ℝ) (hc : 0 < c) (hpos : ∀ t x v, c * ‖v‖ ^ 2 ≤ ⟪(G.coefficient t).coefficient x v, v⟫_ℝ) : C(Icc (0 : ℝ) T, SobolevSpace period s →L[ℝ] SobolevSpace period s) := @@ -381,6 +381,7 @@ def positivePressurePath {s : ℕ} (T : ℝ) (G : CoefficientPath period s (Icc G.jet κ m c hc hpos t G.continuous.continuousAt)⟩ /-- The actual signed PDE pressure belongs to the full energy-order Bochner space. -/ +@[expose] def pressureTime {s : ℕ} (T : ℝ) (hT : 0 ≤ T) (G : CoefficientPath period s (Icc (0 : ℝ) T)) (κ : ℝ) (m : Vector3) (c : ℝ) (hc : 0 < c) (hpos : ∀ t x v, c * ‖v‖ ^ 2 ≤ ⟪(G.coefficient t).coefficient x v, v⟫_ℝ) @@ -388,6 +389,7 @@ def pressureTime {s : ℕ} (T : ℝ) (hT : 0 ≤ T) (G : CoefficientPath period -(timeMultiplier T hT (positivePressurePath period T G κ m c hc hpos) F) /-- The actual projected mild forcing belongs to the full energy-order Bochner space. -/ +@[expose] def projectedTime {s : ℕ} (T : ℝ) (hT : 0 ≤ T) (G : CoefficientPath period s (Icc (0 : ℝ) T)) (κ : ℝ) (m : Vector3) (c : ℝ) (hc : 0 < c) (hpos : ∀ t x v, c * ‖v‖ ^ 2 ≤ ⟪(G.coefficient t).coefficient x v, v⟫_ℝ) 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..eda9f93af7 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 @@ -98,9 +98,13 @@ theorem productDerivative_norm_sq_lower (v : TimeLp T U) : /-- The fixed Hilbert space of coordinate derivatives with zero initial trace. Terminal zero is already supplied by the primitive. -/ -def zeroTraceDerivatives (T : ℝ) (hT : 0 ≤ T) : Submodule ℝ (TimeLp T U) := +@[expose] 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..b7ea6e2a44 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,19 +38,19 @@ 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. -/ -def valuePart (T : ℝ) (hT : 0 ≤ T) : TimeLp T E →L[ℝ] C(Icc (0 : ℝ) T, E) := +@[expose] def valuePart (T : ℝ) (hT : 0 ≤ T) : TimeLp T E →L[ℝ] C(Icc (0 : ℝ) T, E) := (ContinuousLinearMap.const ℝ (Icc (0 : ℝ) T)).comp (mean T hT) /-- The mean-zero primitive part of the reconstruction. -/ -def derivativePart (T : ℝ) (hT : 0 ≤ T) : TimeLp T E →L[ℝ] C(Icc (0 : ℝ) T, E) := +@[expose] def derivativePart (T : ℝ) (hT : 0 ≤ T) : TimeLp T E →L[ℝ] C(Icc (0 : ℝ) T, E) := 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..8f891bdd46 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 @@ -52,6 +52,7 @@ theorem subinterval_forcing_bound (T : ℝ) (hT : 0 ≤ T) (s t : ℝ) exact h.trans_eq he /-- The actual continuous scalar right-hand side after an almost-everywhere forcing estimate. -/ +@[expose] def scalarEnergyRhs (T : ℝ) (a b k X Y F : C(Icc (0 : ℝ) T, ℝ)) : C(Icc (0 : ℝ) T, ℝ) := a*X+b*Y+k*F diff --git a/LeanPool/NavierStokesAndEuler/Euler/TimePathGluing.lean b/LeanPool/NavierStokesAndEuler/Euler/TimePathGluing.lean index 76a00039c3..ec1464567b 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 @@ -23,7 +23,7 @@ open scoped Topology variable {E : Type*} [NormedAddCommGroup E] /-- The literal adjacent-interval pasting of two actual clamped paths. -/ -def glueFunction (a b : ℝ) (ha : 0 ≤ a) (hb : 0 ≤ b) +@[expose] def glueFunction (a b : ℝ) (ha : 0 ≤ a) (hb : 0 ≤ b) (u : C(Icc (0 : ℝ) a, E)) (v : C(Icc (0 : ℝ) b, E)) (t : ℝ) : E := if t ≤ a then extendPath a ha u t else extendPath b hb v (t-a) @@ -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..04a7476306 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 @@ -53,7 +53,7 @@ variable (T : ℝ) (hT : 0 ≤ T) (hsmall : K * (T ^ 2 / 2) ≤ 1 / 2) /-- The actual derivative of the fixed terminal-coordinate solution. -/ -def coordinateSlope : U →L[ℝ] TimeLp T U := +@[expose] def coordinateSlope : U →L[ℝ] TimeLp T U := (constantFieldOperator T hT).comp (T⁻¹ • ContinuousLinearMap.id ℝ U) - (zeroTraceDerivatives (U := U) T hT).subtypeL.comp (fixedEndpointCorrection T hT Q Q₁ H c hc hQ hd K hK hH hsmall (affineTrial T hT Q Q₁)) @@ -103,17 +103,17 @@ theorem coordinateSlope_ae (hTpos : 0 < T) (ξ : U) : (affineTrial_tangent T hT Q Q₁ hd m hm) ξ t) /-- The literal right side of equation (10), in Bochner L². -/ -def coordinateAcceleration : U →L[ℝ] TimeLp T U := +@[expose] def coordinateAcceleration : U →L[ℝ] TimeLp T U := (timeMultiplier T hT (generator T Q Q₁ c hc hQ)).comp (coordinateSlope T hT Q Q₁ H c hc hQ hd K hK hH hsmall) /-- Bounded time reconstruction of the actual coordinate history. -/ -def continuousCoordinateVelocity : U →L[ℝ] C(Icc (0 : ℝ) T, U) := +@[expose] def continuousCoordinateVelocity : U →L[ℝ] C(Icc (0 : ℝ) T, U) := (valuePart T hT).comp (coordinateSlope T hT Q Q₁ H c hc hQ hd K hK hH hsmall) + (derivativePart T hT).comp (coordinateAcceleration T hT Q Q₁ H c hc hQ hd K hK hH hsmall) /-- The source history velocity `Q ξ_t` with the fixed terminal coordinate. -/ -def historyVelocity : U →L[ℝ] C(Icc (0 : ℝ) T, E) := +@[expose] def historyVelocity : U →L[ℝ] C(Icc (0 : ℝ) T, E) := (multiplier Q).comp (continuousCoordinateVelocity T hT Q Q₁ H c hc hQ hd K hK hH hsmall) section Regularity diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransverseEndpointEnergy.lean b/LeanPool/NavierStokesAndEuler/Euler/TransverseEndpointEnergy.lean index 0fbc790ee4..61381fbe22 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 @@ -47,11 +47,12 @@ def correction : E →L[ℝ] S := (projectedInverse S A c hc hA).comp (S.orthogonalProjectionOnto.comp A) /-- Subtract the solved zero-trace correction from any trial extension. -/ +@[expose] 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 @@ -117,6 +118,7 @@ theorem stationaryPart_minimizes (hAs : A.IsSymmetric) (x : E) : variable [CompleteSpace E] /-- A prescribed bounded trial lift followed by the actual stationary projection. -/ +@[expose] def endpointExtension (L : U →L[ℝ] E) : U →L[ℝ] E := (stationaryPart S A c hc hA).comp L @@ -174,7 +176,7 @@ end end -@[expose] public section +public section noncomputable section @@ -193,7 +195,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 +246,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 @@ -260,12 +264,14 @@ variable (K : ℝ) (hK : 0 ≤ K) (hsmall : K * (T ^ 2 / 2) ≤ 1 / 2) /-- Solve the zero-endpoint variation problem for an explicit terminal trial lift. -/ +@[expose] def endpointDerivative (L : U →L[ℝ] TimeLp T E) : U →L[ℝ] TimeLp T E := endpointExtension (transverseDerivatives T hT m) (energyOperator T hT H) (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 +315,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..7ee4e7269e 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] @@ -75,7 +76,7 @@ theorem fixedFrame_energy (u v : zeroTraceDerivatives (U := U) T hT) : rfl /-- Fixed endpoint correction as an element of `V →L[ℝ] zeroTraceDerivatives (U := U) T hT`. -/ -def fixedEndpointCorrection (L : V →L[ℝ] TimeLp T E) : +@[expose] def fixedEndpointCorrection (L : V →L[ℝ] TimeLp T E) : V →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) @@ -84,7 +85,7 @@ def fixedEndpointCorrection (L : V →L[ℝ] TimeLp T E) : /-- Fixed endpoint derivative, given by `L - (fixedFrameDerivative T hT Q Q₁).comp (fixedEndpointCorrection T hT Q Q₁ H c hc hQ hd K hK hH hsmall L)`. -/ -def fixedEndpointDerivative (L : V →L[ℝ] TimeLp T E) : V →L[ℝ] TimeLp T E := +@[expose] def fixedEndpointDerivative (L : V →L[ℝ] TimeLp T E) : V →L[ℝ] TimeLp T E := L - (fixedFrameDerivative T hT Q Q₁).comp (fixedEndpointCorrection T hT Q Q₁ H c hc hQ hd K hK hH hsmall L) @@ -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..771ee527e2 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,22 +44,22 @@ 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 /-- Displacement path, given by `terminalPrimitive T hT (velocityLp T hT Q Q₁ H c hc hQ hd K hK hH hsmall f)`. -/ -def displacementPath (f : TimeLp T E) : C(Icc (0 : ℝ) T,U) := +@[expose] def displacementPath (f : TimeLp T E) : C(Icc (0 : ℝ) T,U) := terminalPrimitive T hT (velocityLp T hT Q Q₁ H c hc hQ hd K hK hH hsmall f) /-- 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..62068acc84 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 @@ -442,12 +443,13 @@ open scoped ContDiff /-- Forcing block amplitude, given by `3*sobolevCoefficientAmplitude ι q Rc (T*derivativeCost T C₀ C₁)*Cf`. -/ +@[expose] def forcingBlockAmplitude (ι : Type*) [Fintype ι] (q : ℕ) (T Rc C₀ C₁ Cf : ℝ) : ℝ := 3*sobolevCoefficientAmplitude ι q Rc (T*derivativeCost T 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..193ccb4289 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 @@ -344,7 +344,9 @@ theorem fixedAffineEndpoint_sub_norm_le (d a r : ℝ) P P₁ G hP hp hG d a r hD hD' hA hA' hr hr') (energyOperator_sub_norm_le T hT H G) (affineTrial_sub_norm_le T hT Q Q₁ P P₁) - exact h.trans_eq (by unfold endpointDifferenceCost; ring) + refine h.trans_eq ?_ + simp only [endpointDifferenceCost] + ring variable (m n : Icc (0 : ℝ) T → E) (hm : ∀ t v, ⟪m t, Q t v⟫_ℝ = 0) (hn : ∀ t v, ⟪n t, P t v⟫_ℝ = 0) @@ -378,7 +380,7 @@ section /-! Polynomial size and coefficient sensitivity of the actual source (10) generator. -/ -@[expose] public section +public section noncomputable section @@ -438,7 +440,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 +498,7 @@ section /-! Uniform-time polynomial bounds from an actual L² value and generator derivative. -/ -@[expose] public section +public section noncomputable section @@ -519,7 +521,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 +613,7 @@ end end -@[expose] public section +public section noncomputable section @@ -639,11 +641,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 : ℝ) @@ -707,11 +709,12 @@ theorem coordinateSlope_sub_norm_le (d a r : ℝ) (by unfold slopeDifferenceCost derivativeDistance; ring)) /-- History cost, given by `q * traceCost T (2*c⁻¹*q*q₁) * slopeCost T d a r`. -/ +@[expose] 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..b9211a13de 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 @@ -21,6 +21,7 @@ namespace EulerTransverseHistoryBounds open EulerPacketParentMeanCoercivity /-- Scalar transport, given by `1+((2*(c⁻¹)^2*q^2*q1+c⁻¹*q1)*T+c⁻¹*q)`. -/ +@[expose] def scalarTransport (T c q q1 : ℝ) : ℝ := 1+((2*(c⁻¹)^2*q^2*q1+c⁻¹*q1)*T+c⁻¹*q) 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..481307afc0 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 @@ -118,6 +118,7 @@ variable {D τ hτ hτT B ι q} (L : Budget D τ hτ hτT B ι q) /-- Full profile, given by `EulerElapsedTimePathGluing.profile D.T τ hτ.le hτT.le L.g L.initial_one`. -/ +@[expose] def fullProfile : C(Icc (0 : ℝ) D.T,ℝ) := EulerElapsedTimePathGluing.profile D.T τ hτ.le hτT.le L.g L.initial_one @@ -130,12 +131,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..c09a14fbef 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 @@ -115,11 +115,11 @@ theorem fullVelocityPath_time (t : Icc (0 : ℝ) D.T) : /-- Potential path, given by `EulerCylinderPotential.potentialPath P D.potentialCoefficientPath (G.fullVelocityPath I)`. -/ -def potentialPath : C(Icc (0 : ℝ) D.T,LiftL2 P) := +@[expose] def potentialPath : C(Icc (0 : ℝ) D.T,LiftL2 P) := EulerCylinderPotential.potentialPath P D.potentialCoefficientPath (G.fullVelocityPath I) /-- Potential time path, constructed using `EulerCylinderPotential.potentialDerivative`. -/ -def potentialTimePath : C(Icc (0 : ℝ) D.T,LiftL2 P) := +@[expose] def potentialTimePath : C(Icc (0 : ℝ) D.T,LiftL2 P) := EulerCylinderPotential.potentialDerivative P D.T D.potentialCoefficientPath D.potentialDerivative (G.fullVelocityPath I) (G.fullDerivativePath I) @@ -145,12 +145,12 @@ theorem potentialPath_time (t : Icc (0 : ℝ) D.T) : D.potentialCoefficientPath_time (G.fullVelocityPath_time I) t /-- Corrector path, given by `EulerCylinderSlowCurl.path P D.FInv.field (G.potentialPath I)`. -/ -def correctorPath : C(Icc (0 : ℝ) D.T,LiftL2 P) := +@[expose] def correctorPath : C(Icc (0 : ℝ) D.T,LiftL2 P) := EulerCylinderSlowCurl.path P D.FInv.field (G.potentialPath I) /-- Corrector time path, given by `EulerCylinderSlowCurl.derivative P D.T D.FInv.field D.inverseDerivative (G.potentialPath I) (G.potentialTimePath I)`. -/ -def correctorTimePath : C(Icc (0 : ℝ) D.T,LiftL2 P) := +@[expose] def correctorTimePath : C(Icc (0 : ℝ) D.T,LiftL2 P) := EulerCylinderSlowCurl.derivative P D.T D.FInv.field D.inverseDerivative (G.potentialPath I) (G.potentialTimePath I) @@ -176,13 +176,13 @@ theorem correctorPath_time (t : Icc (0 : ℝ) D.T) : /-- Corrector, defined pointwise by `pointField P (G.correctorPath I) (G.correctorPath_orbit I) (D.clamp z.1) (z.2.1,(z.2.2 : AddCircle P))`. -/ -def corrector : VectorField := fun z => +@[expose] def corrector : VectorField := fun z => pointField P (G.correctorPath I) (G.correctorPath_orbit I) (D.clamp z.1) (z.2.1,(z.2.2 : AddCircle P)) /-- Corrector derivative, defined pointwise by `pointField P (G.correctorTimePath I) (G.correctorTimePath_orbit I) (D.clamp z.1) (z.2.1,(z.2.2 : AddCircle P))`. -/ -def correctorDerivative : VectorField := fun z => +@[expose] def correctorDerivative : VectorField := fun z => pointField P (G.correctorTimePath I) (G.correctorTimePath_orbit I) (D.clamp z.1) (z.2.1,(z.2.2 : AddCircle P)) 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..bdc8174d52 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 @@ -28,7 +28,7 @@ variable {P : ℝ} [Fact (0 < P)] {D : Data U} {raw : VectorField} (G : Forcing P D raw) (I : InitialData P D) /-- Vector field, bundling `path`, `orbit`, `raw_eq`. -/ -def vectorField : Field P D.T (G.vector I) where +@[expose] def vectorField : Field P D.T (G.vector I) where path := G.fullVelocityPath I orbit := G.velocityPath_orbit I raw_eq t x θ := by @@ -37,7 +37,7 @@ def vectorField : Field P D.T (G.vector I) where rw [Data.clamp_coe] /-- Vector derivative field, bundling `path`, `orbit`, `raw_eq`. -/ -def vectorDerivativeField : Field P D.T (G.vectorDerivative I) where +@[expose] def vectorDerivativeField : Field P D.T (G.vectorDerivative I) where path := G.fullDerivativePath I orbit := G.derivativePath_orbit I raw_eq t x θ := by @@ -50,7 +50,7 @@ theorem vectorField_time : TimeDerivative D.T_pos.le (G.vectorField I) (G.vector G.fullVelocityPath_time I /-- Corrector field, bundling `path`, `orbit`, `raw_eq`. -/ -def correctorField : Field P D.T (G.corrector I) where +@[expose] def correctorField : Field P D.T (G.corrector I) where path := G.correctorPath I orbit := G.correctorPath_orbit I raw_eq t x θ := by @@ -59,7 +59,7 @@ def correctorField : Field P D.T (G.corrector I) where rw [Data.clamp_coe] /-- Corrector derivative field, bundling `path`, `orbit`, `raw_eq`. -/ -def correctorDerivativeField : Field P D.T (G.correctorDerivative I) where +@[expose] def correctorDerivativeField : Field P D.T (G.correctorDerivative I) where path := G.correctorTimePath I orbit := G.correctorTimePath_orbit I raw_eq t x θ := by diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketData.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketData.lean index 302b2a128d..4cda46d700 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 @@ -63,13 +63,13 @@ theorem restriction_norm : ‖referenceRestriction m₀ R‖ ≤ 1 := by variable {K : Type*} [TopologicalSpace K] [CompactSpace K] /-- The actual source F R⊥, including all its uniformly continuous spatial jets. -/ -def coefficient (F : SmoothCoefficientPath K (Space →L[ℝ] Space)) : +@[expose] def coefficient (F : SmoothCoefficientPath K (Space →L[ℝ] Space)) : SmoothCoefficientPath K (U →L[ℝ] Space) := SmoothCoefficientPath.map (referenceRestriction m₀ R) F @[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 @@ -136,12 +136,13 @@ open scoped BoundedContinuousFunction ContDiff variable (m₀ : Space) /-- The fixed linear operation sending F⁻¹ to F⁻ᵀm₀. -/ -def normalMap : (Space →L[ℝ] Space) →L[ℝ] Space := +@[expose] def normalMap : (Space →L[ℝ] Space) →L[ℝ] Space := (ContinuousLinearMap.apply ℝ Space m₀).comp (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 @@ -154,11 +155,12 @@ theorem normalMap_norm (hm₀ : ‖m₀‖ = 1) : ‖normalMap m₀‖ ≤ 1 := variable {K : Type*} [TopologicalSpace K] [CompactSpace K] /-- The normal has the genuine spatial jets inherited from the inverse deformation. -/ -def normalCoefficient (FInv : SmoothCoefficientPath K (Space →L[ℝ] Space)) : +@[expose] 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 @@ -282,13 +284,13 @@ abbrev frameDerivative := coefficient D.m₀ D.R D.F₁ abbrev normal := normalCoefficient D.m₀ D.FInv /-- Inverse bound, given by `1+‖D.FInv.field‖`. -/ -def inverseBound : ℝ := 1+‖D.FInv.field‖ +@[expose] def inverseBound : ℝ := 1+‖D.FInv.field‖ /-- Frame bound, given by `1+‖D.F.field‖`. -/ -def frameBound : ℝ := 1+‖D.F.field‖ +@[expose] def frameBound : ℝ := 1+‖D.F.field‖ /-- Frame lower, given by `D.inverseBound⁻¹^2`. -/ -def frameLower : ℝ := D.inverseBound⁻¹^2 +@[expose] def frameLower : ℝ := D.inverseBound⁻¹^2 /-- Normal lower, given by `D.frameBound⁻¹^2`. -/ -def normalLower : ℝ := D.frameBound⁻¹^2 +@[expose] def normalLower : ℝ := D.frameBound⁻¹^2 theorem inverseBound_pos : 0 < D.inverseBound := by unfold inverseBound diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketEndpoint.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketEndpoint.lean index bbf2de675c..50f0fafac2 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 @@ -42,6 +42,7 @@ def displacementPath : C(Icc (0 : ℝ) D.T,CylinderL2 P U) := B.coefficients.endpointDisplacement P (Y.value : CylinderL2 P U) /-- Coordinate path, given by `B.coefficients.endpointCoordinate P (Y.value : CylinderL2 P U)`. -/ +@[expose] def coordinatePath : C(Icc (0 : ℝ) D.T,CylinderL2 P U) := B.coefficients.endpointCoordinate P (Y.value : CylinderL2 P U) @@ -51,10 +52,12 @@ def coordinateDerivativePath : C(Icc (0 : ℝ) D.T,CylinderL2 P U) := B.coefficients.endpointAcceleration P (Y.value : CylinderL2 P U) /-- Velocity path, given by `B.coefficients.endpointVelocity P (Y.value : CylinderL2 P U)`. -/ +@[expose] def velocityPath : C(Icc (0 : ℝ) D.T,CylinderL2 P Space) := B.coefficients.endpointVelocity P (Y.value : CylinderL2 P U) /-- Derivative path, given by `B.coefficients.endpointDerivative P (Y.value : CylinderL2 P U)`. -/ +@[expose] def derivativePath : C(Icc (0 : ℝ) D.T,CylinderL2 P Space) := B.coefficients.endpointDerivative P (Y.value : CylinderL2 P U) @@ -127,7 +130,7 @@ theorem derivativePath_mean_zero (t : Icc (0 : ℝ) D.T) : B.coefficients.endpointDerivative_mean_zero P Y.value Y.mean_zero t /-- Terminal initial, bundling `value`, `orbit`, `mean_zero`. -/ -def terminalInitial : InitialData P D where +@[expose] def terminalInitial : InitialData P D where value := ⟨coordinatePath B Y ⟨D.T,D.T_pos.le,le_rfl⟩, coordinatePath_supported B Y _⟩ orbit := (ContinuousMap.evalCLM ℝ ⟨D.T,D.T_pos.le,le_rfl⟩ : diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketForcing.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketForcing.lean index ca910d6eaf..83a857aea5 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 @@ -53,7 +53,7 @@ structure InitialData (D : Data U) where mean_zero : average P (value : CylinderL2 P U) = 0 /-- Zero, bundling `value`, `orbit`, `mean_zero`. -/ -def InitialData.zero (D : Data U) : InitialData P D where +@[expose] def InitialData.zero (D : Data U) : InitialData P D where value := 0 orbit := by simpa only [Submodule.coe_zero, map_zero] using @@ -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..bdd4d074f6 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 @@ -61,7 +61,7 @@ variable (P : ℝ) [Fact (0 < P)] theorem velocityDerivative_eq_physicalRhs : velocityDerivative P S hS T hT Q Q₁ c hc hQ f a₀ = - physicalRhs P S hS Q Q₁ c hc hQ f (coordinates P S hS T hT Q Q₁ c hc hQ f a₀) := rfl + physicalRhs P S hS Q Q₁ c hc hQ f (coordinates P S hS T hT Q Q₁ c hc hQ f a₀) := by rfl variable (g : C(Icc (0 : ℝ) T, ℝ)) (hg : ∀ t, 0 < g t) @@ -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..62bd25621d 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,13 +95,14 @@ 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`. -/ +@[expose] def enlargeRadius (R' : ℝ) (hR : L.R ≤ R') : Budget D ι q := { L with R := R' 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..bdfabe7afb 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 @@ -152,7 +152,7 @@ abbrev forcingPath := includePath P D.support D.support_measurable G.path /-- Coordinate path, given by `B.coefficients.velocityPath P (pathLp D.T D.T_pos.le (forcingPath G))`. -/ -def coordinatePath : C(Icc (0 : ℝ) D.T,CylinderL2 P U) := +@[expose] def coordinatePath : C(Icc (0 : ℝ) D.T,CylinderL2 P U) := B.coefficients.velocityPath P (pathLp D.T D.T_pos.le (forcingPath G)) /-- Coordinate derivative path, given by `B.coefficients.accelerationPath P (forcingPath G)`. -/ @@ -160,16 +160,16 @@ def coordinateDerivativePath : C(Icc (0 : ℝ) D.T,CylinderL2 P U) := B.coefficients.accelerationPath P (forcingPath G) /-- Velocity path, given by `B.coefficients.physicalVelocity P (forcingPath G)`. -/ -def velocityPath : C(Icc (0 : ℝ) D.T,CylinderL2 P Space) := +@[expose] def velocityPath : C(Icc (0 : ℝ) D.T,CylinderL2 P Space) := B.coefficients.physicalVelocity P (forcingPath G) /-- Derivative path, given by `B.coefficients.physicalDerivative P (forcingPath G)`. -/ -def derivativePath : C(Icc (0 : ℝ) D.T,CylinderL2 P Space) := +@[expose] def derivativePath : C(Icc (0 : ℝ) D.T,CylinderL2 P Space) := B.coefficients.physicalDerivative P (forcingPath G) /-- Pressure path, given by `sourcePressure P D.M D.normal D.normalLower D.normalLower_pos D.normal_lower (forcingPath G) (B.velocityPath G)`. -/ -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 (forcingPath G) (B.velocityPath G) @@ -229,11 +229,11 @@ theorem derivativePath_mean_zero (t : Icc (0 : ℝ) D.T) : average P (B.derivati B.coefficients.physicalDerivative_mean_zero P (forcingPath G) G.mean_zero t /-- Field, given by `pointField P (B.velocityPath G) (B.velocityPath_orbit G) t`. -/ -def field (t : Icc (0 : ℝ) D.T) : LiftDomain P → Space := +@[expose] def field (t : Icc (0 : ℝ) D.T) : LiftDomain P → Space := pointField P (B.velocityPath G) (B.velocityPath_orbit G) t /-- Derivative field, given by `pointField P (B.derivativePath G) (B.derivativePath_orbit G) t`. -/ -def derivativeField (t : Icc (0 : ℝ) D.T) : LiftDomain P → Space := +@[expose] def derivativeField (t : Icc (0 : ℝ) D.T) : LiftDomain P → Space := pointField P (B.derivativePath G) (B.derivativePath_orbit G) t theorem field_smooth (t : Icc (0 : ℝ) D.T) (x : LiftDomain P) : 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..55c2bf7d06 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 @@ -86,7 +86,7 @@ def frameSecond : C(Icc (0 : ℝ) D.T,Space →ᵇ U →L[ℝ] Space) := -pathCompositionMap B.H.field D.frame.field @[simp] theorem frameSecond_apply (t : Icc (0 : ℝ) D.T) (x : Space) (v : U) : - B.frameSecond t x v = -(B.H.field t x (D.frame.field t x v)) := rfl + B.frameSecond t x v = -(B.H.field t x (D.frame.field t x v)) := by rfl theorem frameSecond_derivative (t : ℝ) (ht : t ∈ Icc (0 : ℝ) D.T) (x : Space) : HasDerivWithinAt (fun s => extendPath D.T D.T_pos.le D.frameDerivative.field s x) @@ -99,7 +99,7 @@ theorem frameSecond_derivative (t : ℝ) (ht : t ∈ Icc (0 : ℝ) D.T) (x : Spa /-- The genuine spatial-angular L² inverse data, with uniform coercivity derived from the actual inverse deformation. -/ -def coefficients : EulerCylinderDirichlet.Coefficients D.T U Space where +@[expose] def coefficients : EulerCylinderDirichlet.Coefficients D.T U Space where time_pos := D.T_pos Q := D.frame.field Q₁ := D.frameDerivative.field @@ -117,10 +117,10 @@ def coefficients : EulerCylinderDirichlet.Coefficients D.T U Space where small := B.small theorem coefficient_frame (t : Icc (0 : ℝ) D.T) (x : Space) (v : U) : - B.coefficients.Q t x v = D.F.field t x (D.R v : Space) := rfl + B.coefficients.Q t x v = D.F.field t x (D.R v : Space) := by rfl theorem coefficient_hessian (t : Icc (0 : ℝ) D.T) (x : Space) : - B.coefficients.H t x = B.H.field t x := rfl + B.coefficients.H t x = B.H.field t x := by rfl end HistoryData diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketHistoryPressure.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketHistoryPressure.lean index 5222d4a4af..12ebc1f41a 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 @@ -47,13 +47,14 @@ abbrev forceField (t : Icc (0 : ℝ) D.T) := pointField P (forcingPath G) G.path /-- Normal residual, given by `(⟪D.normal.field t x.1,forceField G t x⟫_ℝ - 2*⟪D.normal.field t x.1,D.M.field t x.1 (B.field G t x)⟫_ℝ)/‖D.normal.field t x.1‖^2`. -/ +@[expose] def normalResidual (t : Icc (0 : ℝ) D.T) (x : LiftDomain P) : ℝ := (⟪D.normal.field t x.1,forceField G t x⟫_ℝ - 2*⟪D.normal.field t x.1,D.M.field t x.1 (B.field G t x)⟫_ℝ)/‖D.normal.field t x.1‖^2 /-- Residual path, given by `sourceResidual P D.M D.normal D.normalLower D.normalLower_pos D.normal_lower (forcingPath G) (B.velocityPath G)`. -/ -def residualPath : C(Icc (0 : ℝ) D.T,CylinderL2 P ℝ) := +@[expose] def residualPath : C(Icc (0 : ℝ) D.T,CylinderL2 P ℝ) := sourceResidual P D.M D.normal D.normalLower D.normalLower_pos D.normal_lower (forcingPath G) (B.velocityPath G) @@ -138,6 +139,7 @@ theorem normalResidual_mean_zero (t : Icc (0 : ℝ) D.T) (y : Space) : (B.residualPath_average_zero G t) y /-- The actual mean-zero periodic angular integral. -/ +@[expose] def pressureField (t : Icc (0 : ℝ) D.T) : LiftDomain P → ℝ := classicalPrimitive P (B.normalResidual G t) (B.normalResidual_continuous G t) (B.normalResidual_mean_zero G t) diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketHomogeneity.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketHomogeneity.lean index 4a25ff609d..a6d82bbd87 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 @@ -134,6 +134,7 @@ variable {P : ℝ} [Fact (0 < P)] {D : Data U} {raw raw' : VectorField} /-- Scalar multiplication of the literal forcing, with its genuine path witness. -/ +@[expose] def smul (G : Forcing P D raw) (a : ℝ) : Forcing P D (a • raw) where path := a • G.path path_orbit := by simpa only [map_smul] using G.path_orbit.const_smul a @@ -209,11 +210,17 @@ theorem join_smul {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] a • join S τ hτ hτS u v hm := by apply ContinuousMap.ext intro t - change (if (t : ℝ) ≤ τ then a • u (projIcc 0 τ hτ t) - else a • v (elapsedTime S τ (projIcc τ S hτS t))) = - a • (if (t : ℝ) ≤ τ then u (projIcc 0 τ hτ t) - else v (elapsedTime S τ (projIcc τ S hτS t))) - split <;> rfl + by_cases ht : (t : ℝ) ≤ τ + · let s : Icc (0 : ℝ) τ := ⟨t, t.property.1, ht⟩ + have hs : (⟨s, s.property.1, s.property.2.trans hτS⟩ : Icc (0 : ℝ) S) = t := + Subtype.ext rfl + rw [← hs] + simp only [ContinuousMap.smul_apply, join_left] + · let s : Icc τ S := ⟨t, (lt_of_not_ge ht).le, t.property.2⟩ + have hs : (⟨s, hτ.trans s.property.1, s.property.2⟩ : Icc (0 : ℝ) S) = t := + Subtype.ext rfl + rw [← hs] + simp only [ContinuousMap.smul_apply, join_right] end EulerElapsedTimePathGluing 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..b7a1e60fd0 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 @@ -53,7 +53,7 @@ namespace Data variable (D : Data U) /-- The prescribed source fields on [0,τ]. -/ -def initial (τ : ℝ) (hτ : 0 < τ) (hτT : τ ≤ D.T) : Data U where +@[expose] def initial (τ : ℝ) (hτ : 0 < τ) (hτT : τ ≤ D.T) : Data U where T := τ T_pos := hτ support := D.support @@ -74,7 +74,7 @@ def initial (τ : ℝ) (hτ : 0 < τ) (hτT : τ ≤ D.T) : Data U where strain_equation t x v := D.strain_equation (initialInclusion D.T τ hτT t) x v /-- The prescribed source fields on [τ,T], with elapsed time starting at zero. -/ -def tail (τ : ℝ) (hτ : 0 ≤ τ) (hτT : τ < D.T) : Data U where +@[expose] def tail (τ : ℝ) (hτ : 0 ≤ τ) (hτT : τ < D.T) : Data U where T := D.T-τ T_pos := sub_pos.mpr hτT support := D.support @@ -121,6 +121,7 @@ namespace HistoryData variable {D : Data U} (B : HistoryData D) /-- The source Jacobi law and positivity remain valid on the actual history interval. -/ +@[expose] def initial (τ : ℝ) (hτ : 0 < τ) (hτT : τ ≤ D.T) : HistoryData (D.initial τ hτ hτT) where H := B.H.comp (initialInclusion D.T τ hτT) jacobi t ht x := diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketIntervalForcing.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketIntervalForcing.lean index 72af2e595f..9e40335e0b 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 @@ -105,6 +105,7 @@ variable {P : ℝ} [Fact (0 < P)] {D : Data U} {raw : VectorField} /-- Shifted raw, defined pointwise by `raw (τ+z.1,z.2)`. -/ +@[expose] def shiftedRaw (τ : ℝ) (raw : VectorField) : VectorField := fun z => raw (τ+z.1,z.2) namespace Forcing @@ -112,7 +113,8 @@ namespace Forcing variable (G : Forcing P D raw) /-- Restriction keeps the literal original forcing on the history interval. -/ -def initial (τ : ℝ) (hτ : 0 < τ) (hτT : τ ≤ D.T) : Forcing P (D.initial τ hτ hτT) raw where +@[expose] def initial (τ : ℝ) (hτ : 0 < τ) (hτT : τ ≤ D.T) : + Forcing P (D.initial τ hτ hτT) raw where path := G.path.comp (initialInclusion D.T τ hτT) path_orbit := timeComp_orbit_contDiff P (includePath P D.support D.support_measurable G.path) G.path_orbit (initialInclusion D.T τ hτT) @@ -125,7 +127,7 @@ def initial (τ : ℝ) (hτ : 0 < τ) (hτT : τ ≤ D.T) : Forcing P (D.initial mean_zero t := G.mean_zero (initialInclusion D.T τ hτT t) /-- The forward forcing uses elapsed time s and the literal source time τ+s. -/ -def tail (τ : ℝ) (hτ : 0 ≤ τ) (hτT : τ < D.T) : +@[expose] def tail (τ : ℝ) (hτ : 0 ≤ τ) (hτT : τ < D.T) : Forcing P (D.tail τ hτ hτT) (shiftedRaw τ raw) where path := G.path.comp (tailInclusion D.T τ hτ) path_orbit := timeComp_orbit_contDiff P @@ -146,7 +148,7 @@ variable (B : HistoryData D) (G : Forcing P D raw) /-- The genuine terminal coordinate velocity of the history problem, with its actual support, mixed smoothness, and zero angular mean. -/ -def terminalInitial : InitialData P D where +@[expose] def terminalInitial : InitialData P D where value := ⟨B.coordinatePath G ⟨D.T,D.T_pos.le,le_rfl⟩, B.coordinatePath_supported G ⟨D.T,D.T_pos.le,le_rfl⟩⟩ orbit := (ContinuousMap.evalCLM ℝ ⟨D.T,D.T_pos.le,le_rfl⟩ : @@ -155,7 +157,7 @@ def terminalInitial : InitialData P D where /-- The history trace in the same fixed reference-plane coordinates is the actual initial datum passed to the forward interval. -/ -def forwardInitial (τ : ℝ) (hτ : 0 < τ) (hτT : τ < D.T) : +@[expose] def forwardInitial (τ : ℝ) (hτ : 0 < τ) (hτT : τ < D.T) : InitialData P (D.tail τ hτ.le hτT) where value := ((B.initial τ hτ hτT.le).terminalInitial (G.initial τ hτ hτT.le)).value orbit := ((B.initial τ hτ hτT.le).terminalInitial (G.initial τ hτ hτT.le)).orbit @@ -163,7 +165,7 @@ def forwardInitial (τ : ℝ) (hτ : 0 < τ) (hτT : τ < D.T) : theorem forwardInitial_eq (τ : ℝ) (hτ : 0 < τ) (hτT : τ < D.T) : ((B.forwardInitial G τ hτ hτT).value : CylinderL2 P U) = - (B.initial τ hτ hτT.le).coordinatePath (G.initial τ hτ hτT.le) ⟨τ,hτ.le,le_rfl⟩ := rfl + (B.initial τ hτ hτT.le).coordinatePath (G.initial τ hτ hτT.le) ⟨τ,hτ.le,le_rfl⟩ := by rfl end HistoryData end EulerTransversePacketProvider 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..665cb750d9 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 @@ -40,10 +40,12 @@ variable {P : ℝ} [Fact (0 < P)] /-- Potential path, given by `EulerCylinderPotential.potentialPath P D.potentialCoefficientPath (velocityPath τ hτ hτT B G)`. -/ +@[expose] def potentialPath : C(Icc (0 : ℝ) D.T,LiftL2 P) := EulerCylinderPotential.potentialPath P D.potentialCoefficientPath (velocityPath τ hτ hτT B G) /-- Potential time path, constructed using `EulerCylinderPotential.potentialDerivative`. -/ +@[expose] def potentialTimePath : C(Icc (0 : ℝ) D.T,LiftL2 P) := EulerCylinderPotential.potentialDerivative P D.T D.potentialCoefficientPath D.potentialDerivative (velocityPath τ hτ hτT B G) (derivativePath τ hτ hτT B G) @@ -72,10 +74,12 @@ theorem potentialPath_time (t : Icc (0 : ℝ) D.T) : /-- Corrector path, given by `EulerCylinderSlowCurl.path P D.FInv.field (potentialPath τ hτ hτT B G)`. -/ +@[expose] def correctorPath : C(Icc (0 : ℝ) D.T,LiftL2 P) := EulerCylinderSlowCurl.path P D.FInv.field (potentialPath τ hτ hτT B G) /-- Corrector time path, constructed using `EulerCylinderSlowCurl.derivative`. -/ +@[expose] def correctorTimePath : C(Icc (0 : ℝ) D.T,LiftL2 P) := EulerCylinderSlowCurl.derivative P D.T D.FInv.field D.inverseDerivative (potentialPath τ hτ hτT B G) (potentialTimePath τ hτ hτT B G) @@ -102,12 +106,14 @@ theorem correctorPath_time (t : Icc (0 : ℝ) D.T) : /-- Corrector, defined pointwise by `pointField P (correctorPath τ hτ hτT B G) (correctorPath_orbit τ hτ hτT B G) (D.clamp z.1) (z.2.1,(z.2.2 : AddCircle P))`. -/ +@[expose] def corrector : VectorField := fun z => pointField P (correctorPath τ hτ hτT B G) (correctorPath_orbit τ hτ hτT B G) (D.clamp z.1) (z.2.1,(z.2.2 : AddCircle P)) /-- Corrector derivative, defined pointwise by `pointField P (correctorTimePath τ hτ hτT B G) (correctorTimePath_orbit τ hτ hτT B G) (D.clamp z.1) (z.2.1,(z.2.2 : AddCircle P))`. -/ +@[expose] def correctorDerivative : VectorField := fun z => pointField P (correctorTimePath τ hτ hτT B G) (correctorTimePath_orbit τ hτ hτT B G) (D.clamp z.1) (z.2.1,(z.2.2 : AddCircle P)) @@ -154,6 +160,7 @@ theorem curlCorrector_eq (t : Icc (0 : ℝ) D.T) (x : Space) (θ : ℝ) : rw [Data.curlCorrector,Data.clamp_coe,he,coverField_fderiv,corrector_formula τ hτ hτT B G t x θ] /-- Corrector field, bundling `path`, `orbit`, `raw_eq`. -/ +@[expose] def correctorField : Field P D.T (D.curlCorrector P (vector τ hτ hτT B G)) where path := correctorPath τ hτ hτT B G orbit := correctorPath_orbit τ hτ hτT B G @@ -161,6 +168,7 @@ def correctorField : Field P D.T (D.curlCorrector P (vector τ hτ hτT B G)) wh simp only [corrector,Data.clamp_coe]) /-- Corrector derivative field, bundling `path`, `orbit`, `raw_eq`. -/ +@[expose] def correctorDerivativeField : Field P D.T (correctorDerivative τ hτ hτT B G) where path := correctorTimePath τ hτ hτT B G orbit := correctorTimePath_orbit τ hτ hτT B G 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..e97fc9f53d 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 @@ -40,29 +40,34 @@ variable {P : ℝ} [Fact (0 < P)] /-- Vector, defined pointwise by `pointField P (velocityPath τ hτ hτT B G) (velocityPath_orbit τ hτ hτT B G) (D.clamp z.1) (z.2.1,(z.2.2 : AddCircle P))`. -/ +@[expose] def vector : VectorField := fun z => pointField P (velocityPath τ hτ hτT B G) (velocityPath_orbit τ hτ hτT B G) (D.clamp z.1) (z.2.1,(z.2.2 : AddCircle P)) /-- Vector derivative, defined pointwise by `pointField P (derivativePath τ hτ hτT B G) (derivativePath_orbit τ hτ hτT B G) (D.clamp z.1) (z.2.1,(z.2.2 : AddCircle P))`. -/ +@[expose] def vectorDerivative : VectorField := fun z => pointField P (derivativePath τ hτ hτT B G) (derivativePath_orbit τ hτ hτT B G) (D.clamp z.1) (z.2.1,(z.2.2 : AddCircle P)) /-- Scalar, defined pointwise by `scalarPointField P (pressurePath τ hτ hτT B G) (pressurePath_orbit τ hτ hτT B G) (D.clamp z.1) (z.2.1,(z.2.2 : AddCircle P))`. -/ +@[expose] def scalar : ScalarField := fun z => scalarPointField P (pressurePath τ hτ hτT B G) (pressurePath_orbit τ hτ hτT B G) (D.clamp z.1) (z.2.1,(z.2.2 : AddCircle P)) /-- Vector field, bundling `path`, `orbit`, `raw_eq`. -/ +@[expose] def vectorField : Field P D.T (vector τ hτ hτT B G) where path := velocityPath τ hτ hτT B G orbit := velocityPath_orbit τ hτ hτT B G raw_eq t x θ := by simp only [vector,Data.clamp_coe] /-- Vector derivative field, bundling `path`, `orbit`, `raw_eq`. -/ +@[expose] def vectorDerivativeField : Field P D.T (vectorDerivative τ hτ hτT B G) where path := derivativePath τ hτ hτT B G orbit := derivativePath_orbit τ hτ hτT B G @@ -83,6 +88,7 @@ theorem scalar_eq_pointField (t : Icc (0 : ℝ) D.T) (x : Space) (θ : ℝ) : t (x,(θ : AddCircle P)) := by simp only [scalar,Data.clamp_coe] /-- Scalar gradient field, constructed using `EulerPacketCylinderField.scalarGradientField`. -/ +@[expose] def scalarGradientField : Field P D.T (pressureGradient (scalar τ hτ hτT B G)) := EulerPacketCylinderField.scalarGradientField (scalar τ hτ hτT B G) (pressurePath τ hτ hτT B G) (pressurePath_orbit τ hτ hτT B G) 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..757ed6f06a 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 @@ -40,12 +40,14 @@ variable {P : ℝ} [Fact (0 < P)] /-- Velocity path, given by `join D.T τ hτ.le hτT.le (pastVelocity τ hτ hτT B G) (futureVelocity τ hτ hτT B G) (velocity_match τ hτ hτT B G)`. -/ +@[expose] def velocityPath : C(Icc (0 : ℝ) D.T,LiftL2 P) := join D.T τ hτ.le hτT.le (pastVelocity τ hτ hτT B G) (futureVelocity τ hτ hτT B G) (velocity_match τ hτ hτT B G) /-- Derivative path, given by `join D.T τ hτ.le hτT.le (pastDerivative τ hτ hτT B G) (futureDerivative τ hτ hτT B G) (derivative_match τ hτ hτT B G)`. -/ +@[expose] def derivativePath : C(Icc (0 : ℝ) D.T,LiftL2 P) := join D.T τ hτ.le hτT.le (pastDerivative τ hτ hτT B G) (futureDerivative τ hτ hτT B G) (derivative_match τ hτ hτT B G) diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketJoinedPressure.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketJoinedPressure.lean index d9058641bf..d5241c4b91 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 @@ -56,7 +56,8 @@ theorem pressurePath_eq_source : pressurePath τ hτ hτT B G = intro x apply ContinuousLinearMap.ext intro v - erw [normalFunctional_apply] + erw [normalFunctional_apply,normalFunctional_apply] + all_goals rfl rw [pressurePath_left τ hτ hτT B G th] change primitive P (fullOperatorMap P (normalFunctional Dh.normal Dh.normalLower Dh.normalLower_pos Dh.normal_lower th) 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..5518382aff 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 @@ -27,6 +27,7 @@ open EulerSmoothLimit EulerPacketPiola EulerPacketPeriodicPotential EulerPacketC open scoped ContDiff /-- Normal, given by `(F y).symm.toContinuousLinearMap.adjoint m₀`. -/ +@[expose] def normal (F : Space → Space ≃L[ℝ] Space) (m₀ : Space) (y : Space) : Space := (F y).symm.toContinuousLinearMap.adjoint m₀ @@ -43,7 +44,7 @@ theorem normal_ne_zero (F : Space → Space ≃L[ℝ] Space) (m₀ : Space) (hm variable (P : ℝ) [Fact (0 < P)] /-- Corrector, given by `liftedSlowCurl P F (field P (normal F m₀) A)`. -/ -def corrector (F : Space → Space ≃L[ℝ] Space) (m₀ : Space) (A : LiftDomain P → Space) : +@[expose] def corrector (F : Space → Space ≃L[ℝ] Space) (m₀ : Space) (A : LiftDomain P → Space) : LiftDomain P → Space := liftedSlowCurl P F (field P (normal F m₀) A) variable (κ : ℝ) (m₀ : Space) (Ξ : Space → Space) (A : LiftDomain P → Space) @@ -85,7 +86,7 @@ end end -@[expose] public section +public section noncomputable section @@ -99,18 +100,18 @@ variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] /-- Deformation equiv, given by `ContinuousLinearEquiv.equivOfInverse (D.F.field t x) (D.FInv.field t x) (D.inverse_left t x) (D.inverse_right t x)`. -/ -def deformationEquiv (t : Icc (0 : ℝ) D.T) (x : Space) : Space ≃L[ℝ] Space := +@[expose] def deformationEquiv (t : Icc (0 : ℝ) D.T) (x : Space) : Space ≃L[ℝ] Space := ContinuousLinearEquiv.equivOfInverse (D.F.field t x) (D.FInv.field t x) (D.inverse_left t x) (D.inverse_right t x) @[simp] theorem deformationEquiv_coe (t : Icc (0 : ℝ) D.T) (x : Space) : - (D.deformationEquiv t x).toContinuousLinearMap = D.F.field t x := rfl + (D.deformationEquiv t x).toContinuousLinearMap = D.F.field t x := by rfl @[simp] theorem deformationEquiv_symm_coe (t : Icc (0 : ℝ) D.T) (x : Space) : - (D.deformationEquiv t x).symm.toContinuousLinearMap = D.FInv.field t x := rfl + (D.deformationEquiv t x).symm.toContinuousLinearMap = D.FInv.field t x := by rfl @[simp] theorem deformationEquiv_normal (t : Icc (0 : ℝ) D.T) : - EulerPacketConstructedPiola.normal (D.deformationEquiv t) D.m₀ = D.normal.field t := rfl + EulerPacketConstructedPiola.normal (D.deformationEquiv t) D.m₀ = D.normal.field t := by rfl theorem initialNormal_ne_zero : D.m₀ ≠ 0 := by intro h diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPressureGradient.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPressureGradient.lean index a2610688c8..b95eccfb94 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 @@ -88,6 +88,7 @@ theorem scalar_eq_pointField (t : Icc (0 : ℝ) D.T) (x : Space) (θ : ℝ) : D.normalLower_pos D.normal_lower G.mean_zero I.mean_zero t) (x,(θ : AddCircle P)) /-- The next known-force pressure term comes from the constructed scalar pressure itself. -/ +@[expose] def scalarGradientField : Field P D.T (pressureGradient (G.scalar I)) := EulerPacketCylinderField.scalarGradientField (G.scalar I) (G.pressurePath I) (G.pressurePath_orbit I) (G.scalar_eq_pointField I) @@ -100,6 +101,7 @@ variable (P : ℝ) [Fact (0 < P)] (h : Nonempty (Forcing P D raw)) /-- The total high operator has the required pressure-gradient witness on admissible forcing. -/ +@[expose] def highSolvePressureGradientField : Field P D.T (pressureGradient (highSolve P D I raw).2) := ((Classical.choice h).scalarGradientField I).congr (fun _ _ _ => by rw [highSolve_of_admissible D I raw h]) 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..c37d55b3ff 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 @@ -63,6 +63,7 @@ namespace Budget variable {L} (H : Budget L) /-- Endpoint budget, bundling `Rc`, `C₀`, `C₁`, `CH` and the required compatibility proofs. -/ +@[expose] def endpointBudget : EndpointBudget B.coefficients ι q where Rc := L.Rc C₀ := L.C₀ @@ -94,10 +95,12 @@ def endpointBudget : EndpointBudget B.coefficients ι q where /-- Velocity cost, given by `H.endpointBudget.velocityCost + 3*sobolevCoefficientAmplitude ι q L.Rc L.C₀`. -/ +@[expose] def velocityCost : ℝ := H.endpointBudget.velocityCost + 3*sobolevCoefficientAmplitude ι q L.Rc L.C₀ /-- Derivative cost, given by `H.endpointBudget.derivativeCost + physicalCost ι q L.Ri L.C₀ L.C₁ 0 1`. -/ +@[expose] def derivativeCost : ℝ := H.endpointBudget.derivativeCost + physicalCost ι q L.Ri L.C₀ L.C₁ 0 1 theorem velocityCost_nonneg : 0 ≤ H.velocityCost := by diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPrimaryCorrector.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPrimaryCorrector.lean index eab2259ee7..bf7fc5a2c3 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 @@ -45,10 +45,12 @@ variable {P : ℝ} [Fact (0 < P)] /-- Potential path, given by `EulerCylinderPotential.potentialPath P D.potentialCoefficientPath (velocityPath τ hτ hτT B Y)`. -/ +@[expose] def potentialPath : C(Icc (0 : ℝ) D.T,LiftL2 P) := EulerCylinderPotential.potentialPath P D.potentialCoefficientPath (velocityPath τ hτ hτT B Y) /-- Potential time path, constructed using `EulerCylinderPotential.potentialDerivative`. -/ +@[expose] def potentialTimePath : C(Icc (0 : ℝ) D.T,LiftL2 P) := EulerCylinderPotential.potentialDerivative P D.T D.potentialCoefficientPath D.potentialDerivative (velocityPath τ hτ hτT B Y) (derivativePath τ hτ hτT B Y) @@ -77,10 +79,12 @@ theorem potentialPath_time (t : Icc (0 : ℝ) D.T) : /-- Corrector path, given by `EulerCylinderSlowCurl.path P D.FInv.field (potentialPath τ hτ hτT B Y)`. -/ +@[expose] def correctorPath : C(Icc (0 : ℝ) D.T,LiftL2 P) := EulerCylinderSlowCurl.path P D.FInv.field (potentialPath τ hτ hτT B Y) /-- Corrector time path, constructed using `EulerCylinderSlowCurl.derivative`. -/ +@[expose] def correctorTimePath : C(Icc (0 : ℝ) D.T,LiftL2 P) := EulerCylinderSlowCurl.derivative P D.T D.FInv.field D.inverseDerivative (potentialPath τ hτ hτT B Y) (potentialTimePath τ hτ hτT B Y) @@ -159,6 +163,7 @@ theorem curlCorrector_eq (t : Icc (0 : ℝ) D.T) (x : Space) (θ : ℝ) : rw [Data.curlCorrector,Data.clamp_coe,he,coverField_fderiv,corrector_formula τ hτ hτT B Y t x θ] /-- Corrector field, bundling `path`, `orbit`, `raw_eq`. -/ +@[expose] def correctorField : Field P D.T (D.curlCorrector P (vector τ hτ hτT B Y)) where path := correctorPath τ hτ hτT B Y orbit := correctorPath_orbit τ hτ hτT B Y @@ -166,6 +171,7 @@ def correctorField : Field P D.T (D.curlCorrector P (vector τ hτ hτT B Y)) wh simp only [corrector,Data.clamp_coe]) /-- Corrector derivative field, bundling `path`, `orbit`, `raw_eq`. -/ +@[expose] def correctorDerivativeField : Field P D.T (correctorDerivative τ hτ hτT B Y) where path := correctorTimePath τ hτ hτT B Y orbit := correctorTimePath_orbit τ hτ hτT B Y 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..8b8484fc6c 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 @@ -132,29 +132,34 @@ variable {P : ℝ} [Fact (0 < P)] /-- Vector, defined pointwise by `pointField P (velocityPath τ hτ hτT B Y) (velocityPath_orbit τ hτ hτT B Y) (D.clamp z.1) (z.2.1,(z.2.2 : AddCircle P))`. -/ +@[expose] def vector : VectorField := fun z => pointField P (velocityPath τ hτ hτT B Y) (velocityPath_orbit τ hτ hτT B Y) (D.clamp z.1) (z.2.1,(z.2.2 : AddCircle P)) /-- Vector derivative, defined pointwise by `pointField P (derivativePath τ hτ hτT B Y) (derivativePath_orbit τ hτ hτT B Y) (D.clamp z.1) (z.2.1,(z.2.2 : AddCircle P))`. -/ +@[expose] def vectorDerivative : VectorField := fun z => pointField P (derivativePath τ hτ hτT B Y) (derivativePath_orbit τ hτ hτT B Y) (D.clamp z.1) (z.2.1,(z.2.2 : AddCircle P)) /-- Scalar, defined pointwise by `scalarPointField P (pressurePath τ hτ hτT B Y) (pressurePath_orbit τ hτ hτT B Y) (D.clamp z.1) (z.2.1,(z.2.2 : AddCircle P))`. -/ +@[expose] def scalar : ScalarField := fun z => scalarPointField P (pressurePath τ hτ hτT B Y) (pressurePath_orbit τ hτ hτT B Y) (D.clamp z.1) (z.2.1,(z.2.2 : AddCircle P)) /-- Vector field, bundling `path`, `orbit`, `raw_eq`. -/ +@[expose] def vectorField : Field P D.T (vector τ hτ hτT B Y) where path := velocityPath τ hτ hτT B Y orbit := velocityPath_orbit τ hτ hτT B Y raw_eq t x θ := by simp only [vector,Data.clamp_coe] /-- Vector derivative field, bundling `path`, `orbit`, `raw_eq`. -/ +@[expose] def vectorDerivativeField : Field P D.T (vectorDerivative τ hτ hτT B Y) where path := derivativePath τ hτ hτT B Y orbit := derivativePath_orbit τ hτ hτT B Y @@ -175,6 +180,7 @@ theorem scalar_eq_pointField (t : Icc (0 : ℝ) D.T) (x : Space) (θ : ℝ) : t (x,(θ : AddCircle P)) := by simp only [scalar,Data.clamp_coe] /-- Scalar gradient field, constructed using `EulerPacketCylinderField.scalarGradientField`. -/ +@[expose] def scalarGradientField : Field P D.T (pressureGradient (scalar τ hτ hτT B Y)) := EulerPacketCylinderField.scalarGradientField (scalar τ hτ hτT B Y) (pressurePath τ hτ hτT B Y) (pressurePath_orbit τ hτ hτT B Y) 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..9b0b68e0a2 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 @@ -24,6 +24,7 @@ variable {P : ℝ} [Fact (0 < P)] {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] {D : Data U} /-- Smul, bundling `value`, `orbit`, `mean_zero`. -/ +@[expose] def smul (Y : InitialData P D) (a : ℝ) : InitialData P D where value := a • Y.value orbit := by simpa only [Submodule.coe_smul_of_tower,map_smul] using Y.orbit.const_smul a diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPrimaryPaths.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPrimaryPaths.lean index 256886b1d6..e0711d74e3 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 @@ -48,6 +48,7 @@ variable {P : ℝ} [Fact (0 < P)] {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteSpace U] /-- Zero forcing, bundling `path`, `path_orbit`, `raw_eq`, `mean_zero`. -/ +@[expose] def zeroForcing (D : Data U) : Forcing P D (0 : VectorField) where path := 0 path_orbit := by @@ -60,12 +61,14 @@ variable {D : Data U} (τ : ℝ) (hτ : 0 < τ) (hτT : τ < D.T) (B : HistoryData (D.initial τ hτ hτT.le)) (Y : InitialData P D) /-- Endpoint data, bundling `value`, `orbit`, `mean_zero`. -/ +@[expose] def endpointData : InitialData P (D.initial τ hτ hτT.le) where value := Y.value orbit := Y.orbit mean_zero := Y.mean_zero /-- Forward initial, bundling `value`, `orbit`, `mean_zero`. -/ +@[expose] def forwardInitial : InitialData P (D.tail τ hτ.le hτT) where value := (EulerTransversePacketEndpoint.terminalInitial B (endpointData τ hτ hτT Y)).value orbit := (EulerTransversePacketEndpoint.terminalInitial B (endpointData τ hτ hτT Y)).orbit @@ -73,22 +76,26 @@ def forwardInitial : InitialData P (D.tail τ hτ.le hτT) where /-- Past velocity, given by `EulerTransversePacketEndpoint.velocityPath B (endpointData τ hτ hτT Y)`. -/ +@[expose] def pastVelocity : C(Icc (0 : ℝ) τ,LiftL2 P) := EulerTransversePacketEndpoint.velocityPath B (endpointData τ hτ hτT Y) /-- Past derivative, given by `EulerTransversePacketEndpoint.derivativePath B (endpointData τ hτ hτT Y)`. -/ +@[expose] def pastDerivative : C(Icc (0 : ℝ) τ,LiftL2 P) := EulerTransversePacketEndpoint.derivativePath B (endpointData τ hτ hτT Y) /-- Future velocity, given by `includePath P D.support D.support_measurable ((zeroForcing (D.tail τ hτ.le hτT)).velocityPath (forwardInitial τ hτ hτT B Y))`. -/ +@[expose] def futureVelocity : C(Icc (0 : ℝ) (D.T-τ),LiftL2 P) := includePath P D.support D.support_measurable ((zeroForcing (D.tail τ hτ.le hτT)).velocityPath (forwardInitial τ hτ hτT B Y)) /-- Future derivative, given by `includePath P D.support D.support_measurable ((zeroForcing (D.tail τ hτ.le hτT)).derivativePath (forwardInitial τ hτ hτT B Y))`. -/ +@[expose] def futureDerivative : C(Icc (0 : ℝ) (D.T-τ),LiftL2 P) := includePath P D.support D.support_measurable ((zeroForcing (D.tail τ hτ.le hτT)).derivativePath (forwardInitial τ hτ hτT B Y)) @@ -192,7 +199,7 @@ end end -@[expose] public section +public section noncomputable section @@ -211,19 +218,21 @@ variable {P : ℝ} [Fact (0 < P)] /-- Velocity path, given by `join D.T τ hτ.le hτT.le (pastVelocity τ hτ hτT B Y) (futureVelocity τ hτ hτT B Y) (velocity_match τ hτ hτT B Y)`. -/ +@[expose] def velocityPath : C(Icc (0 : ℝ) D.T,LiftL2 P) := join D.T τ hτ.le hτT.le (pastVelocity τ hτ hτT B Y) (futureVelocity τ hτ hτT B Y) (velocity_match τ hτ hτT B Y) /-- Derivative path, given by `join D.T τ hτ.le hτT.le (pastDerivative τ hτ hτT B Y) (futureDerivative τ hτ hτT B Y) (derivative_match τ hτ hτT B Y)`. -/ +@[expose] def derivativePath : C(Icc (0 : ℝ) D.T,LiftL2 P) := join D.T τ hτ.le hτT.le (pastDerivative τ hτ hτT B Y) (futureDerivative τ hτ hτT B Y) (derivative_match τ hτ hτT B Y) /-- 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..8b81e332c0 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 @@ -41,6 +41,7 @@ variable {P : ℝ} [Fact (0 < P)] (B : HistoryData (D.initial τ hτ hτT.le)) (Y : InitialData P D) /-- Normal residual as an element of `ℝ`. -/ +@[expose] def normalResidual (t : Icc (0 : ℝ) D.T) (x : LiftDomain P) : ℝ := -(2*⟪D.normal.field t x.1,D.M.field t x.1 (pointField P (velocityPath τ hτ hτT B Y) (velocityPath_orbit τ hτ hτT B Y) t x)⟫_ℝ)/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketProvider.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketProvider.lean index 1cc8002b8e..9eae90c66d 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,19 +41,19 @@ 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)) /-- Vector derivative as an element of `VectorField`. -/ -def vectorDerivative : VectorField := fun z => +@[expose] def vectorDerivative : VectorField := fun z => derivativeField 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)) /-- 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..4a0829b15f 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 @@ -43,14 +43,14 @@ Space) (E := ℝ))`. -/ def normalVector : (Space →L[ℝ] ℝ) →L[ℝ] Space := (ContinuousLinearMap.apply ℝ Space (1 : ℝ)).comp (realAdjoint (U := Space) (E := ℝ)) -@[simp] theorem normalVector_apply (N : Space →L[ℝ] ℝ) : normalVector N = N.adjoint 1 := rfl +@[simp] theorem normalVector_apply (N : Space →L[ℝ] ℝ) : normalVector N = N.adjoint 1 := by rfl /-- Normal potential map, given by `-(crossOperator.comp normalVector)`. -/ def normalPotentialMap : (Space →L[ℝ] ℝ) →L[ℝ] (Space →L[ℝ] Space) := -(crossOperator.comp normalVector) @[simp] theorem normalPotentialMap_apply (N : Space →L[ℝ] ℝ) : - normalPotentialMap N = -crossLeft (N.adjoint 1) := rfl + normalPotentialMap N = -crossLeft (N.adjoint 1) := by rfl theorem normalPotentialMap_norm : ‖normalPotentialMap‖ ≤ 1 := by apply ContinuousLinearMap.opNorm_le_bound _ zero_le_one @@ -88,7 +88,7 @@ section /-! The literal vector-potential multiplier inherits the source normal coefficient bounds. -/ -@[expose] public section +public section noncomputable section @@ -135,7 +135,7 @@ def potentialPathMap : C(K,NormalField) →L[ℝ] C(K,PotentialField) := omit [CompactSpace K] in @[simp] theorem potentialPathMap_apply (N : C(K, NormalField)) (t : K) (x : Space) : - potentialPathMap N t x = normalPotentialMap (N t x) := rfl + potentialPathMap N t x = normalPotentialMap (N t x) := by rfl theorem potentialPathMap_norm : ‖potentialPathMap (K := K)‖ ≤ 1 := by apply opNorm_le_bound _ zero_le_one @@ -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 @@ -368,7 +368,7 @@ def timeNormalPath (N : C(K, NormalField)) (Q₁ : C(K, Space →ᵇ ℝ →L[ (pathCompositionMap (E := Space) (F := ℝ) (U := ℝ) N Q₁) N theorem timeNormalPath_apply (N : C(K, NormalField)) (Q₁ : C(K, Space →ᵇ ℝ →L[ℝ] Space)) - (t : K) (y : Space) : timeNormalPath N Q₁ t y = normalTimeMap (N t y) (Q₁ t y) := rfl + (t : K) (y : Space) : timeNormalPath N Q₁ t y = normalTimeMap (N t y) (Q₁ t y) := by rfl theorem timeNormalPath_translation (N : C(K, NormalField)) (Q₁ : C(K, Space →ᵇ ℝ →L[ℝ] Space)) (a : Space) : translateCoefficientPath (timeNormalPath N Q₁) a = @@ -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 @@ -569,7 +569,7 @@ variable (m : SmoothCoefficientPath K Space) (m₁ : C(K, Space →ᵇ Space)) /-- Potential time path, given by `potentialPathMap (timeNormalPath (normalFunctional m c hc hm) (columnPath m₁))`. -/ -def potentialTimePath : C(K,PotentialField) := +@[expose] def potentialTimePath : C(K,PotentialField) := potentialPathMap (timeNormalPath (normalFunctional m c hc hm) (columnPath m₁)) theorem potentialTimePath_apply (t : K) (y : Space) : @@ -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 @@ -788,7 +788,7 @@ local instance instTransversePacketTimeData10 : NormedSpace ℝ C(Icc (0 : ℝ) inferInstance /-- The derivative of the inverse is constructed from the original fields. -/ -def inverseDerivative : C(Icc (0 : ℝ) D.T,Space →ᵇ Space →L[ℝ] Space) := +@[expose] def inverseDerivative : C(Icc (0 : ℝ) D.T,Space →ᵇ Space →L[ℝ] Space) := -pathCompositionMap (α := Space) (K := Icc (0 : ℝ) D.T) (E := Space) (F := Space) (U := Space) D.FInv.field D.M.field @@ -797,7 +797,7 @@ def normalDerivative : C(Icc (0 : ℝ) D.T,Space →ᵇ Space) := mapCoefficientPath (normalMap D.m₀) D.inverseDerivative @[simp] theorem inverseDerivative_apply (t : Icc (0 : ℝ) D.T) (x : Space) : - D.inverseDerivative t x = -((D.FInv.field t x).comp (D.M.field t x)) := rfl + D.inverseDerivative t x = -((D.FInv.field t x).comp (D.M.field t x)) := by rfl @[simp] theorem normalDerivative_apply (t : Icc (0 : ℝ) D.T) (x : Space) : D.normalDerivative t x = -((D.M.field t x).adjoint (D.normal.field t x)) := by @@ -912,7 +912,7 @@ theorem normalDerivative_bound (R CI CM : ℝ) (hR : 0 ≤ R) (hCI : 0 ≤ CI) ( (D.inverseDerivative_bound R CI CM hR hCI hCM hI hM) n a /-- The actual time coefficient for the periodic-potential multiplier. -/ -def potentialDerivative : C(Icc (0 : ℝ) D.T,PotentialField) := +@[expose] def potentialDerivative : C(Icc (0 : ℝ) D.T,PotentialField) := potentialTimePath D.normal D.normalDerivative D.normalLower D.normalLower_pos D.normal_lower theorem potentialDerivative_orbit : ContDiff ℝ ∞ (translateCoefficientPath D.potentialDerivative) := diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketTraceMatching.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketTraceMatching.lean index 6fa93dffab..c0c14d3b24 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 @@ -43,14 +43,14 @@ variable {P : ℝ} [Fact (0 < P)] (B : HistoryData (D.initial τ hτ hτT.le)) {raw : VectorField} (G : Forcing P D raw) /-- The terminal coordinate of the actual local history, used as forward data. -/ -def forwardInitial : InitialData P (D.tail τ hτ.le hτT) where +@[expose] def forwardInitial : InitialData P (D.tail τ hτ.le hτT) where value := (B.terminalInitial (G.initial τ hτ hτT.le)).value orbit := (B.terminalInitial (G.initial τ hτ hτT.le)).orbit mean_zero := (B.terminalInitial (G.initial τ hτ hτT.le)).mean_zero theorem forwardInitial_eq : ((forwardInitial τ hτ hτT B G).value : CylinderL2 P U) = - B.coordinatePath (G.initial τ hτ hτT.le) ⟨τ,hτ.le,le_rfl⟩ := rfl + B.coordinatePath (G.initial τ hτ hτT.le) ⟨τ,hτ.le,le_rfl⟩ := by rfl end EulerTransversePacketJoin @@ -59,7 +59,7 @@ end end -@[expose] public section +public section noncomputable section @@ -78,31 +78,31 @@ variable {P : ℝ} [Fact (0 < P)] (B : HistoryData (D.initial τ hτ hτT.le)) {raw : VectorField} (G : Forcing P D raw) /-- Past velocity, given by `B.velocityPath (G.initial τ hτ hτT.le)`. -/ -def pastVelocity : C(Icc (0 : ℝ) τ,LiftL2 P) := +@[expose] def pastVelocity : C(Icc (0 : ℝ) τ,LiftL2 P) := B.velocityPath (G.initial τ hτ hτT.le) /-- 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)) /-- Past derivative, given by `B.derivativePath (G.initial τ hτ hτT.le)`. -/ -def pastDerivative : C(Icc (0 : ℝ) τ,LiftL2 P) := +@[expose] def pastDerivative : C(Icc (0 : ℝ) τ,LiftL2 P) := B.derivativePath (G.initial τ hτ hτT.le) /-- 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)) /-- Past pressure, given by `B.pressurePath (G.initial τ hτ hτT.le)`. -/ -def pastPressure : C(Icc (0 : ℝ) τ,CylinderL2 P ℝ) := +@[expose] def pastPressure : C(Icc (0 : ℝ) τ,CylinderL2 P ℝ) := B.pressurePath (G.initial τ hτ hτT.le) /-- Future pressure, given by `(G.tail τ hτ.le hτT).pressurePath (forwardInitial τ hτ hτT B G)`. -/ -def futurePressure : C(Icc (0 : ℝ) (D.T-τ),CylinderL2 P ℝ) := +@[expose] def futurePressure : C(Icc (0 : ℝ) (D.T-τ),CylinderL2 P ℝ) := (G.tail τ hτ.le hτT).pressurePath (forwardInitial τ hτ hτT B G) theorem pastVelocity_orbit : @@ -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..2374f0d202 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 @@ -54,7 +54,7 @@ variable {U E : Type*} variable (m₀ : E) (R : U ≃ₗᵢ[ℝ] referencePlane m₀) /-- The fixed orthonormal reference-plane embedding. -/ -def referenceEmbedding : U →L[ℝ] E := +@[expose] def referenceEmbedding : U →L[ℝ] E := (referencePlane m₀).subtypeL.comp R.toContinuousLinearEquiv.toContinuousLinearMap /-- Applying the source deformation to the fixed orthonormal reference plane. -/ @@ -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..fb1335b069 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 @@ -43,7 +43,7 @@ theorem viscositySequence_tendsto : Filter.Tendsto viscositySequence Filter.atTo variable (period : ℝ) [Fact (0 < period)] /-- The literal viscosity times the spatial Laplacian, as a continuous L² time path. -/ -def viscousDefect {q : ℕ} (hq : 2 ≤ q) (ν T : ℝ) +@[expose] def viscousDefect {q : ℕ} (hq : 2 ≤ q) (ν T : ℝ) (e : C(Icc (0 : ℝ) T, SobolevSpace period q)) : C(Icc (0 : ℝ) T,LiftL2 period) := ν • (laplacianEvaluation period q hq).compLeftContinuous ℝ (Icc (0 : ℝ) T) e diff --git a/LeanPool/NavierStokesAndEuler/Euler/ViscousSourcePathLimit.lean b/LeanPool/NavierStokesAndEuler/Euler/ViscousSourcePathLimit.lean index 9662e88550..100d94efbd 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 @@ -36,7 +36,7 @@ local instance sourceLimitSpace (s : ℕ) : NormedSpace ℝ (SobolevSpace period /-- The literal continuous viscous right-hand side with the source evaluated one Sobolev order lower. -/ -def viscousSourcePath {q : ℕ} (hq : 2 ≤ (q + 1) + 1) (ν T : ℝ) +@[expose] def viscousSourcePath {q : ℕ} (hq : 2 ≤ (q + 1) + 1) (ν T : ℝ) (C : Coefficients (Icc (0 : ℝ) T) (SobolevSpace period (q + 1)) (SobolevSpace period q)) (u : C(Icc (0 : ℝ) T, SobolevSpace period ((q + 1) + 1))) : C(Icc (0 : ℝ) T,LiftL2 period) := 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..c2fc5fc4b7 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 @@ -59,6 +59,7 @@ theorem velocity_test_pairing_continuousOn simp [image_eq_zero_of_notMem_tsupport hx] /-- The natural velocity path in the Hilbert space `L²`. -/ +@[expose] def velocityLp (t : Ici (0 : ℝ)) : Lp ℝ³ 2 (volume : Measure ℝ³) := (h.velocity_memLp t t.property).toLp (v · t) 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..ddbad7858e 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 @@ -112,6 +112,7 @@ theorem scalarTimeMultiplier_ae (T : ℝ) (hT : 0 ≤ T) (w : C(Icc (0 : ℝ) T, C(Icc (0 : ℝ) T, ℝ →L[ℝ] ℝ)) u /-- The genuine finite weighted sum of actual forcing norms represented in L² time. -/ +@[expose] def weightedForcingTime (T : ℝ) (hT : 0 ≤ T) (w : A → C(Icc (0 : ℝ) T, ℝ)) (F : A → TimeLp T (I → H)) : TimeLp T ℝ := ∑ i, scalarTimeMultiplier T hT (w i) (familyNormTime T (F i)) 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..ca66971092 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 @@ -337,8 +337,10 @@ theorem normalizedConeGap_edge_positive {r : ℝ} (hr : r ≠ 0) (v dP dv dJ : positivity /-- The actual cone coordinates formed from two stock coordinates and a shear ratio. -/ +@[expose] noncomputable def stockProjection (p q t : ℝ) : ℝ := p + q * t /-- Stock cross, given by `q - p * t`. -/ +@[expose] noncomputable def stockCross (p q t : ℝ) : ℝ := q - p * t /-- Projection error, given by `dA + dB * (B / A) * (1 + z * dR) + (B ^ 2 / A) * dR`. -/ @@ -459,33 +461,33 @@ theorem shearSize_eq (T : ℝ) {κ X0 : ℝ} (hκ : κ ∈ Ioc (0 : ℝ) 1) (hX0 /-- Activated stock one, given by `ActivationStocks.logViewOne h X0 (activatedAngular T κ L) (logHistory X0 initial (activatedAngular T κ L) (controlled T κ U))`. -/ -noncomputable def activatedStockOne (h X0 : ℝ) (initial : HistoryRow → ℝ → ℝ) +@[expose] noncomputable def activatedStockOne (h X0 : ℝ) (initial : HistoryRow → ℝ → ℝ) (L U : Field) (T κ : ℝ) : Field := ActivationStocks.logViewOne h X0 (activatedAngular T κ L) (logHistory X0 initial (activatedAngular T κ L) (controlled T κ U)) /-- Activated stock two, constructed using `ActivationStocks.logViewTwo`. -/ -noncomputable def activatedStockTwo (h X0 : ℝ) (initial : HistoryRow → ℝ → ℝ) +@[expose] noncomputable def activatedStockTwo (h X0 : ℝ) (initial : HistoryRow → ℝ → ℝ) (L U : Field) (T κ : ℝ) : Field := ActivationStocks.logViewTwo h X0 (activatedAngular T κ L) (controlled T κ U) (logHistory X0 initial (activatedAngular T κ L) (controlled T κ U)) /-- Activated projection, defined pointwise by `stockProjection (activatedStockOne h X0 initial L U T κ p) (activatedStockTwo h X0 initial L U T κ p) (shearSlope T κ X0 L U p)`. -/ -noncomputable def activatedProjection (h X0 : ℝ) (initial : HistoryRow → ℝ → ℝ) +@[expose] noncomputable def activatedProjection (h X0 : ℝ) (initial : HistoryRow → ℝ → ℝ) (L U : Field) (T κ : ℝ) : Field := fun p => stockProjection (activatedStockOne h X0 initial L U T κ p) (activatedStockTwo h X0 initial L U T κ p) (shearSlope T κ X0 L U p) /-- Activated cross, defined pointwise by `stockCross (activatedStockOne h X0 initial L U T κ p) (activatedStockTwo h X0 initial L U T κ p) (shearSlope T κ X0 L U p)`. -/ -noncomputable def activatedCross (h X0 : ℝ) (initial : HistoryRow → ℝ → ℝ) +@[expose] noncomputable def activatedCross (h X0 : ℝ) (initial : HistoryRow → ℝ → ℝ) (L U : Field) (T κ : ℝ) : Field := fun p => stockCross (activatedStockOne h X0 initial L U T κ p) (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..b6d5f2c61d 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) : @@ -2902,16 +2902,18 @@ variable {h j σ Λ C : ℝ} {P0 : ℝ → ℝ} /-- Reference, given by `TransitionRamp.ofNatural F hΛ hsmall r.refTime_pos r.refTime_bound hP0`. -/ +@[expose] noncomputable def reference : TransitionRamp.StockReference ReferencePath.parameterInterval := TransitionRamp.ofNatural F hΛ hsmall r.refTime_pos r.refTime_bound hP0 /-- Profiles, constructed using `TransitionRamp.physicalProfiles`. -/ +@[expose] noncomputable def profiles : Profiles (ReferencePath.Input.ofNatural hΛ F).radialDomain := TransitionRamp.physicalProfiles F hΛ hsmall r.refTime_pos r.refTime_bound hP0 (κ := r.kappa) r.actTime_pos r.before_big r.widthU_pos r.widthA_pos /-- Start radius, given by `radius r.reference.radius0 r.actTime`. -/ -noncomputable def startRadius : ℝ := radius r.reference.radius0 r.actTime +@[expose] noncomputable def startRadius : ℝ := radius r.reference.radius0 r.actTime /-- Hold time, given by `r.reference.bigTime + r.widthU + r.widthA`. -/ noncomputable def holdTime : ℝ := r.reference.bigTime + r.widthU + r.widthA /-- Hold radius, given by `radius r.reference.radius0 r.holdTime`. -/ @@ -3012,7 +3014,7 @@ end RampParameters /-- The initial collar estimate is retained for the very same chosen activation width and damping, not for a separately chosen profile. -/ -noncomputable def InitialActivationBound {h j σ Λ C : ℝ} {P0 : ℝ → ℝ} +@[expose] noncomputable def InitialActivationBound {h j σ Λ C : ℝ} {P0 : ℝ → ℝ} {d : AnalyticInputs h j σ P0} {F : NaturalProfile.ProfileFamily d Λ C} {hΛ : 0 < Λ} {hsmall : NaturalAxisData.SmallParameters h j} {hP0 : ContDiff ℝ ∞ P0} (r : RampParameters F hΛ hsmall hP0) : Prop := @@ -3411,11 +3413,13 @@ variable {h j σ Λ C : ℝ} {P0 : ℝ → ℝ} {hP0 : ContDiff ℝ ∞ P0} (r : RampParameters F hΛ hsmall hP0) /-- Endpoint axial, given by `r.reference.endpointU r.actTime r.kappa r.widthU`. -/ +@[expose] noncomputable def endpointAxial : ℝ → ℝ := r.reference.endpointU r.actTime r.kappa r.widthU /-- Endpoint logarithm, given by `r.reference.endpointLog r.actTime r.kappa r.widthU r.widthA C`. -/ +@[expose] noncomputable def endpointLogarithm : ℝ → ℝ := r.reference.endpointLog r.actTime r.kappa r.widthU r.widthA C diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActivationStocks.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActivationStocks.lean index 9dfc7760a7..b7f32a9d19 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 @@ -116,13 +116,14 @@ end ParameterFactor abbrev ScaledPoint := (ℝ × ℝ) × Point /-- Scaled domain, given by `univ ×ˢ (univ ×ˢ J)`. -/ +@[expose] noncomputable def scaledDomain (J : Set ℝ) : Set ScaledPoint := univ ×ˢ (univ ×ˢ J) 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 +133,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 +208,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 +226,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 +772,7 @@ end end -@[expose] public section +public section noncomputable section @@ -781,34 +782,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 : ℝ) @@ -968,11 +969,13 @@ theorem etaD_eq_parameterPartial {D : RadialDomain} {F : Field} (parameterPartial_hasDerivAt D hF hp).deriv /-- Log view one, constructed using `stockOne`. -/ +@[expose] noncomputable def logViewOne (h X0 : ℝ) (f : Field) (H : HistoryRow → Field) (p : Point) : ℝ := stockOne h (radius X0 p.1) p.2 (f p) (H .mass p) (etaD (H .mass) p) (H .angular p) (etaD (H .angular) p) (H .transport p) (etaD (H .transport) p) /-- Log view two, constructed using `stockTwo`. -/ +@[expose] noncomputable def logViewTwo (h X0 : ℝ) (f U : Field) (H : HistoryRow → Field) (p : Point) : ℝ := stockTwo h (radius X0 p.1) p.2 (f p) (U p) (H .mass p) (etaD (H .mass) p) (H .energy p) (etaD (H .energy) p) (H .pressure p) (etaD (H .pressure) p) @@ -1435,7 +1438,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 +1693,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 +1716,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..574cb09193 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 @@ -277,6 +279,7 @@ structure EdgeFactor (K : Set E) (c : ℝ) (T : E × ℝ → V) where T (p,x) = (FlatCutoff.edge c x / x ^ order) • coefficient (p,x) /-- Exact local equality transports an edge model to a joined stress. -/ +@[expose] noncomputable def EdgeFactor.transfer {K : Set E} {c : ℝ} {T S : E × ℝ → V} (F : EdgeFactor K c T) {w : ℝ} (hw : 0 < w) (hww : w ≤ F.width) (he : ∀ p ∈ K, ∀ x : ℝ, 0 < x → x < w → S (p,x) = T (p,x)) : @@ -358,9 +361,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 +587,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 @@ -667,6 +670,7 @@ theorem radial_lower_bound {K : Set E} {a b c m : ℝ} {T : E × ℝ → V} ⟨(Real.lt_log_iff_exp_lt hXp).2 hX.1,(Real.log_lt_iff_lt_exp hXp).2 hX.2⟩ /-- The complete estimates in both fixed profile charts. -/ +@[expose] noncomputable def WeightedBounds (K : Set E) (c a b : ℝ) (T : E × ℝ → V) : Prop := (∃ m : ℝ, 0 < m ∧ ∀ p ∈ K, ∀ y ∈ Ioo a b, m * weight c a b y ≤ ‖T (p,y)‖) ∧ (∀ n : ℕ, ∃ C : ℝ, 0 < C ∧ ∃ N : ℕ, ∀ i ≤ n, ∀ p ∈ K, @@ -695,7 +699,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 +794,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 : ℝ) : @@ -880,6 +885,7 @@ theorem EdgeFactor.aligned_collar {K : Set E} (hK : IsCompact K) {c : ℝ} /-- A smooth extension of the actual unit direction, with strict margins for the true homogeneous cone inequalities on a full closed edge collar. -/ +@[expose] noncomputable def HasStrictDirectionCollar (K : Set E) (T B : E × ℝ → ℝ × ℝ) (v s : E × ℝ → ℝ) (width : ℝ) : Prop := ∃ d ε : ℝ, ∃ W : Set (E × ℝ), 0 < d ∧ d < width ∧ 0 < ε ∧ IsOpen W ∧ @@ -895,6 +901,7 @@ noncomputable def HasStrictDirectionCollar (K : Set E) (T B : E × ℝ → ℝ /-- The directional certificate together with the speed condition `v_s > 2` on one common positive-width collar. -/ +@[expose] noncomputable def HasTrueDirectionCollar (K : Set E) (T B : E × ℝ → ℝ × ℝ) (v s : E × ℝ → ℝ) (width : ℝ) : Prop := HasStrictDirectionCollar K T B v s width ∧ @@ -1218,6 +1225,7 @@ open TerminalEdgeFactor OutgoingTail /-- The actual terminal stress uses coefficient `4` and inverse-cubic order. The smooth factor is defined through the closed parameter endpoints. -/ +@[expose] noncomputable def terminalEdgeFactor {C : ℝ} (hC : 0 < C) (d : TailData) (y0 w : ℝ) (hw : 0 < w) : EdgeFactor (Icc (-1 : ℝ) 1) 4 (profileStress C d y0) where coefficient := profileStressFactor C d y0 diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualBaseResidual.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualBaseResidual.lean index 0f39335c1b..6deb9fd135 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 @@ -129,9 +129,11 @@ theorem graphResidual_invariant (θ : Full) (ε : ℝ) (R : Full → ℝ) /-- Domain, given by `{x | 0 < x.1.1 ∧ 0 < x.1.2.1.1}`. -/ +@[expose] noncomputable def domain : Set Full := {x | 0 < x.1.1 ∧ 0 < x.1.2.1.1} /-- Time domain, given by `{x | 0 < x.1.2.1.1}`. -/ +@[expose] noncomputable def timeDomain : Set Full := {x | 0 < x.1.2.1.1} theorem domain_open : IsOpen domain := @@ -167,7 +169,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 +196,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) := @@ -377,6 +379,7 @@ noncomputable def profileAtScale (h Q : ℝ) (x : Point) : AxisymmetricFields.Pr (1 - Q * x.2.1.1, (Q * x.1 ^ 2 / 2, Q ^ CoordinateAlgebra.D h * x.2.1.2)) /-- Profile jacobian as an element of `Point →L[ℝ] AxisymmetricFields.ProfilePoint`. -/ +@[expose] noncomputable def profileJacobian (h Q : ℝ) (x : Point) : Point →L[ℝ] AxisymmetricFields.ProfilePoint := ((-Q) • (ContinuousLinearMap.fst ℝ ℝ ℝ).comp @@ -509,17 +512,19 @@ variable {F : OutgoingProfile.Profile} {W : NominalProfile.Witness F} (upper : ℝ) (B : ℕ) /-- The normalized pressure of the actual summed base, at arbitrary positive scale. -/ +@[expose] noncomputable def pressureAtScale (Q : ℝ) (x : Full) : ℝ := Q ^ (2 * CoordinateAlgebra.A F.data.h) * 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 /-- Velocity at scale as an element of `Fin 3 → ℝ`. -/ +@[expose] noncomputable def velocityAtScale (Q : ℝ) (x : Full) : Fin 3 → ℝ := fun i => Q ^ CoordinateAlgebra.A F.data.h * CylindricalResidual.frame (-x.2) @@ -532,11 +537,12 @@ noncomputable def stressAtScale (Q : ℝ) (x : Full) : Fin 3 → ℝ := fun i => (FinalSlowBase.stressForce H v upper B (physicalPoint F.data.h Q x)) i /-- Base pressure, given by `pressureAtScale H v upper B (ChartScales.Q n)`. -/ +@[expose] 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) : @@ -877,6 +883,7 @@ theorem baseError_band (n m k : ℕ) (x : Point) (theta : ℝ) (i : Fin 3) : /-- Error state, bundling `mean`, `pressure`, `oscillation`, `oscillatoryPressure` and the required compatibility proofs. -/ +@[expose] noncomputable def errorState : CorrectionState.State Point where mean := ⟨0, 0, 0⟩ pressure := 0 diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCandidateAssembly.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCandidateAssembly.lean index 15d98b761a..d82ffcda73 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 @@ -60,15 +60,18 @@ abbrev Point := CorrectionStep.CyclePoint abbrev Full := Point × ℝ /-- Parameters, given by `ActualCycleParameters.fixedParameters B N0`. -/ +@[expose] noncomputable def parameters (B N0 : ℕ) : CycleParameters (Index B N0) := ActualCycleParameters.fixedParameters B N0 /-- Parameter sequence, defined pointwise by `parameters B N0`. -/ +@[expose] noncomputable def parameterSequence (B N0 : ℕ) : ℕ → CycleParameters (Index B N0) := fun _ => parameters B N0 /-- Cycle, given by `CycleState.iterate (parameterSequence B N0) (commonContext B) (ActualInitialization.initialCycleState B N0)`. -/ +@[expose] noncomputable def cycle (B N0 : ℕ) : ℕ → CycleState (Index B N0) := CycleState.iterate (parameterSequence B N0) (commonContext B) (ActualInitialization.initialCycleState B N0) @@ -191,6 +194,7 @@ theorem firstBand_ge (B N0 : ℕ) : N0 ≤ firstBand B N0 := (ActualCycleParameters.bandFloor_ge B N0).trans (firstBand_ge_choice B N0) /-- Qbig, given by `ChartScales.Q (firstBand B N0)`. -/ +@[expose] noncomputable def qbig (B N0 : ℕ) : ℝ := ChartScales.Q (firstBand B N0) theorem qbig_pos (B N0 : ℕ) : 0 < qbig B N0 := ChartScales.Q_pos _ @@ -226,6 +230,7 @@ theorem nativeScale_lt_qbig (B N0 n : ℕ) (hn : residualBand B N0 ≤ n) _ = qbig B N0 := by rw [mul_comm, twice_residual_scale] /-- Physical domain, given by `CutStageEstimates.physicalSublevel h (qbig B N0)`. -/ +@[expose] noncomputable def physicalDomain (B N0 : ℕ) : Set SpaceTime := CutStageEstimates.physicalSublevel h (qbig B N0) @@ -275,6 +280,7 @@ theorem selected_initial_meanHypotheses : /-- Graph, given by `PhysicalResidualBridge.commonGraph (ChartScales.Q n) h (CorrectionInitialization.CommonWindow.index h n)`. -/ +@[expose] noncomputable def graph (n : ℕ) : PhysicalResidualBridge.ScaledGraph := PhysicalResidualBridge.commonGraph (ChartScales.Q n) h (CorrectionInitialization.CommonWindow.index h n) @@ -302,18 +308,21 @@ noncomputable def chartVelocityStages (B N0 : ℕ) (a : ℝ) (i : PolarCharts.In (ActualInitialization.initialCycleState B N0) a i (graph n) n /-- Chart pressure stages, constructed using `CyclePhysicalPrefixes.pressureStages`. -/ +@[expose] noncomputable def chartPressureStages (B N0 : ℕ) (a : ℝ) (i : PolarCharts.Index) (n : ℕ) : ℕ → PressureField := CyclePhysicalPrefixes.pressureStages (parameterSequence B N0) (commonContext B) (ActualInitialization.initialCycleState B N0) a i (graph n) n (basePressure B n) /-- Chart potential parts, constructed using `CyclePhysicalPrefixes.potentialParts`. -/ +@[expose] noncomputable def chartPotentialParts (B N0 : ℕ) (a : ℝ) (i : PolarCharts.Index) (n : ℕ) : ℕ → VelocityField := CyclePhysicalPrefixes.potentialParts (parameterSequence B N0) (commonContext B) (ActualInitialization.initialCycleState B N0) a i (graph n) n /-- Chart direct stages, constructed using `CyclePhysicalPrefixes.directStages`. -/ +@[expose] noncomputable def chartDirectStages (B N0 : ℕ) (a : ℝ) (i : PolarCharts.Index) (n : ℕ) : ℕ → VelocityField := CyclePhysicalPrefixes.directStages (parameterSequence B N0) (commonContext B) @@ -415,11 +424,13 @@ Consequently sums and differences retain the original absolute mean and pressure; no new integration constant or choice enters a later stage. -/ /-- Mean atlas, given by `ActualMeanPhysicalData.initialAtlas (firstBand B N0)`. -/ +@[expose] noncomputable def meanAtlas (B N0 : ℕ) := ActualMeanPhysicalData.initialAtlas (firstBand B N0) /-- Mean field, given by `(meanAtlas B N0).physical standardRegion.carrier degree f ∘ PhysicalMeanJetBounds.physicalPoint h`. -/ +@[expose] noncomputable def meanField (B N0 : ℕ) (degree : ℝ) (f : ActualMeanPhysicalData.Scalar) : PressureField := (meanAtlas B N0).physical standardRegion.carrier degree f ∘ @@ -427,6 +438,7 @@ noncomputable def meanField (B N0 : ℕ) (degree : ℝ) /-- Mean angular field, defined pointwise by `meanField B N0 degree f w • PhysicalMeanJetBounds.angularVector (PhysicalGraphBounds.radialProjection w)`. -/ +@[expose] noncomputable def meanAngularField (B N0 : ℕ) (degree : ℝ) (f : ActualMeanPhysicalData.Scalar) : VelocityField := fun w => meanField B N0 degree f w • @@ -457,23 +469,27 @@ theorem meanAngularField_sub (B N0 : ℕ) (degree : ℝ) (f g : ActualMeanPhysic simp only [meanAngularField, meanField_sub, Pi.sub_apply, sub_smul] /-- Angular native stages as an element of `ℕ → ActualMeanPhysicalData.Scalar`. -/ +@[expose] noncomputable def angularNativeStages (B N0 : ℕ) : ℕ → ActualMeanPhysicalData.Scalar := fun k => Nat.casesOn k (cycle B N0 0).state.mean.angular (fun j => (cycle B N0 (j + 1)).state.mean.angular - (cycle B N0 j).state.mean.angular) /-- Pressure native stages, defined pointwise by `Nat.casesOn k (cycle B N0 0).state.pressure (fun j => (cycle B N0 (j + 1)).state.pressure - (cycle B N0 j).state.pressure)`. -/ +@[expose] noncomputable def pressureNativeStages (B N0 : ℕ) : ℕ → ActualMeanPhysicalData.Scalar := fun k => Nat.casesOn k (cycle B N0 0).state.pressure (fun j => (cycle B N0 (j + 1)).state.pressure - (cycle B N0 j).state.pressure) /-- Angular mean stages, defined pointwise by `meanAngularField B N0 (CoordinateAlgebra.A h) (angularNativeStages B N0 j)`. -/ +@[expose] noncomputable def angularMeanStages (B N0 : ℕ) : ℕ → VelocityField := fun j => meanAngularField B N0 (CoordinateAlgebra.A h) (angularNativeStages B N0 j) /-- Pressure mean stages, defined pointwise by `meanField B N0 (2 * CoordinateAlgebra.A h) (pressureNativeStages B N0 j)`. -/ +@[expose] noncomputable def pressureMeanStages (B N0 : ℕ) : ℕ → PressureField := fun j => meanField B N0 (2 * CoordinateAlgebra.A h) (pressureNativeStages B N0 j) @@ -525,6 +541,7 @@ theorem pressureMeanStages_prefix (B N0 J : ℕ) : abel /-- Temporal native, constructed using `VariableGaugeMean.temporalPotential`. -/ +@[expose] noncomputable def temporalNative (B N0 j : ℕ) : ActualMeanPhysicalData.Scalar := VariableGaugeMean.temporalPotential (parameters B N0).gauge (parameters B N0).timeExponent (parameters B N0).commonIndex (commonContext B) @@ -532,12 +549,14 @@ noncomputable def temporalNative (B N0 j : ℕ) : ActualMeanPhysicalData.Scalar (commonContext B) (cycle B N0 j).state) /-- Rank native, constructed using `VariableGaugeMean.rankPotential`. -/ +@[expose] noncomputable def rankNative (B N0 j : ℕ) : ActualMeanPhysicalData.Scalar := VariableGaugeMean.rankPotential (parameters B N0).gauge (parameters B N0).rank (commonContext B) ((parameters B N0).afterTemporal (cycle B N0 j).coefficients (commonContext B) (cycle B N0 j).state) /-- Stream native stages as an element of `ℕ → ActualMeanPhysicalData.Scalar`. -/ +@[expose] noncomputable def streamNativeStages (B N0 : ℕ) : ℕ → ActualMeanPhysicalData.Scalar := fun k => Nat.casesOn k (ActualMeanPhysicalData.initialTemporalScalar B N0 + ActualMeanPhysicalData.initialRankScalar B @@ -546,6 +565,7 @@ noncomputable def streamNativeStages (B N0 : ℕ) : ℕ → ActualMeanPhysicalDa /-- Stream mean stages, defined pointwise by `meanAngularField B N0 (CoordinateAlgebra.A h - 1 / 2) (streamNativeStages B N0 j)`. -/ +@[expose] noncomputable def streamMeanStages (B N0 : ℕ) : ℕ → VelocityField := fun j => meanAngularField B N0 (CoordinateAlgebra.A h - 1 / 2) (streamNativeStages B N0 j) @@ -584,12 +604,14 @@ theorem pressureMeanStages_succ {B N0 : ℕ} (H : MeanCycleInput B N0) (j : ℕ) ((ActualMeanPhysicalData.initialCycleData H).pressureIncrementFamily j).field := rfl /-- Chart mean pressure parts, constructed using `CyclePhysicalPrefixes.polarPressureMap`. -/ +@[expose] noncomputable def chartMeanPressureParts (B N0 : ℕ) (a : ℝ) (i : PolarCharts.Index) (n j : ℕ) : PressureField := CyclePhysicalPrefixes.polarPressureMap a i (CyclePhysicalPrefixes.pressureMap (graph n) (fun x => pressureNativeStages B N0 j n x.1)) /-- Chart stream parts as an element of `ℕ → VelocityField`. -/ +@[expose] noncomputable def chartStreamParts (B N0 : ℕ) (a : ℝ) (i : PolarCharts.Index) (n : ℕ) : ℕ → VelocityField := fun k => Nat.casesOn k @@ -675,6 +697,7 @@ theorem streamMeanStages_curl_on_chart {B N0 : ℕ} (H : MeanCycleInput B N0) (j | succ j => exact ActualMeanPhysicalData.cycleStream_curl H j n hn ha i ht hu hw /-- Chart base velocity, constructed using `CyclePhysicalPrefixes.polarVelocityMap`. -/ +@[expose] noncomputable def chartBaseVelocity (B : ℕ) (a : ℝ) (i : PolarCharts.Index) (n : ℕ) : VelocityField := CyclePhysicalPrefixes.polarVelocityMap a i (CyclePhysicalPrefixes.velocityMap (graph n) @@ -688,6 +711,7 @@ noncomputable def chartBasePressure (B : ℕ) (a : ℝ) (i : PolarCharts.Index) (basePressure B n)) /-- Chart wave parts as an element of `ℕ → VelocityField`. -/ +@[expose] noncomputable def chartWaveParts (B N0 : ℕ) (a : ℝ) (i : PolarCharts.Index) (n : ℕ) : ℕ → VelocityField := fun k => Nat.casesOn k @@ -701,6 +725,7 @@ noncomputable def chartWaveParts (B N0 : ℕ) (a : ℝ) (i : PolarCharts.Index) (commonContext B) (cycle B N0 j).state n))) /-- Chart wave pressure parts as an element of `ℕ → PressureField`. -/ +@[expose] noncomputable def chartWavePressureParts (B N0 : ℕ) (a : ℝ) (i : PolarCharts.Index) (n : ℕ) : ℕ → PressureField := fun k => Nat.casesOn k @@ -1048,6 +1073,7 @@ theorem pressureMeanStages_shrinkingSupport {B N0 : ℕ} (H : MeanCycleInput B N supply these records; the mean field is fixed by the same cycle above. -/ /-- Initial potential stage, bundling `waveCount`, `waves`, `streamCount`, `streams`. -/ +@[expose] noncomputable def initialPotentialStage (B N0 : ℕ) (wave : MixedAxisPreservation.CopyPotential.{u} h) : MixedAxisPreservation.PotentialStage.{u} h (MixedAxisPreservation.localDomain h (qbig B N0)) @@ -1058,6 +1084,7 @@ noncomputable def initialPotentialStage (B N0 : ℕ) streams _ := ActualMeanStageData.initialStreamSupport B N0 (firstBand B N0) (qbig B N0) le_rfl /-- Positive potential stage, bundling `waveCount`, `waves`, `streamCount`, `streams`. -/ +@[expose] noncomputable def positivePotentialStage {B N0 : ℕ} (H : MeanCycleInput B N0) (j : ℕ) (particular signed : MixedAxisPreservation.CopyPotential.{u} h) : MixedAxisPreservation.PotentialStage.{u} h (MixedAxisPreservation.localDomain h (qbig B N0)) @@ -1104,7 +1131,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 @@ -1132,6 +1159,7 @@ variable {DA DP : Type} [NormedAddCommGroup DA] [NormedSpace ℝ DA] [NormedAddCommGroup DP] [NormedSpace ℝ DP] {IA KA IP KP : Type*} /-- The exact base and bounded finite initial potential correction. -/ +@[expose] noncomputable def initialPotentialModel (B N0 N : ℕ) (hN : 4 ≤ N) (WA : PhysicalStageBounds.WaveData h DA IA KA (Fin 3)) : VelocityField := ActualPhysicalStageBounds.initialPotential certificate modulation upper B WA @@ -1145,6 +1173,7 @@ noncomputable def initialDirectModel (B N0 N : ℕ) : VelocityField := /-- The pressure of the same summed base and the actual finite initial wave and mean-pressure correction. -/ +@[expose] noncomputable def initialPressureModel (B N0 N : ℕ) (hN : 4 ≤ N) (WP : PhysicalStageBounds.WaveData h DP IP KP Unit) : PressureField := fun w => FinalSlowBase.pressure certificate modulation upper B w + @@ -1396,7 +1425,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 +1906,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 +2201,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 +2410,7 @@ end end -@[expose] public section +public section noncomputable section @@ -2651,11 +2680,13 @@ theorem initialPotential_axisZeroOn (B N0 : ℕ) : /-- Zeroth potential, given by `TailGaugePotential.finalPotential certificate modulation upper B + initialPotential B N0`. -/ +@[expose] noncomputable def zerothPotential (B N0 : ℕ) : VelocityField := TailGaugePotential.finalPotential certificate modulation upper B + initialPotential B N0 /-- Zeroth pressure, given by `FinalSlowBase.pressure certificate modulation upper B + initialPressure B N0`. -/ +@[expose] noncomputable def zerothPressure (B N0 : ℕ) : PressureField := FinalSlowBase.pressure certificate modulation upper B + initialPressure B N0 @@ -2691,11 +2722,13 @@ converted by `ActualCycleParameters.particularState` inside the producer. /-- Particular potential, given by `ActualValidBandWaves.potential (ActualCandidateConstruction.cycle B N0 j) (ActualCandidateConstruction.firstBand B N0)`. -/ +@[expose] noncomputable def particularPotential (B N0 j : ℕ) : VelocityField := ActualValidBandWaves.potential (ActualCandidateConstruction.cycle B N0 j) (ActualCandidateConstruction.firstBand B N0) /-- Particular pressure, constructed using `ActualValidBandWaves.pressure`. -/ +@[expose] noncomputable def particularPressure (B N0 j : ℕ) : PressureField := ActualValidBandWaves.pressure (ActualCandidateConstruction.cycle B N0 j) (ActualCandidateConstruction.firstBand B N0) @@ -2977,6 +3010,7 @@ noncomputable def signedPressure (B N0 : ℕ) /-- Positive potential, given by `particularPotential B N0 j + signedPotential B N0 hN j + ActualCandidateConstruction.streamMeanStages B N0 (j + 1)`. -/ +@[expose] noncomputable def positivePotential (B N0 : ℕ) (hN : ActualCarrierGeometry.geometricThreshold ≤ N0) (j : ℕ) : VelocityField := particularPotential B N0 j + signedPotential B N0 hN j + @@ -2984,6 +3018,7 @@ noncomputable def positivePotential (B N0 : ℕ) /-- Positive pressure, given by `particularPressure B N0 j + signedPressure B N0 hN j + ActualCandidateConstruction.pressureMeanStages B N0 (j + 1)`. -/ +@[expose] noncomputable def positivePressure (B N0 : ℕ) (hN : ActualCarrierGeometry.geometricThreshold ≤ N0) (j : ℕ) : PressureField := particularPressure B N0 j + signedPressure B N0 hN j + @@ -2998,6 +3033,7 @@ noncomputable def directData (B N0 : ℕ) /-- Potential stages, given by `GermCandidateAssembly.potentialStages certificate modulation upper B (initialPotential B N0) (positivePotential B N0 hN)`. -/ +@[expose] noncomputable def potentialStages (B N0 : ℕ) (hN : ActualCarrierGeometry.geometricThreshold ≤ N0) : ℕ → VelocityField := GermCandidateAssembly.potentialStages certificate modulation upper B @@ -3010,6 +3046,7 @@ noncomputable def directStages (B N0 : ℕ) /-- Pressure stages, given by `MixedCandidateAssembly.pressureStages certificate modulation upper B (initialPressure B N0) (positivePressure B N0 hN)`. -/ +@[expose] noncomputable def pressureStages (B N0 : ℕ) (hN : ActualCarrierGeometry.geometricThreshold ≤ N0) : ℕ → PressureField := MixedCandidateAssembly.pressureStages certificate modulation upper B @@ -3612,6 +3649,7 @@ theorem endpoints (B N0 : ℕ) /-- The output retains the actual three sums, the smooth force, and the strong consequences for this same velocity and pressure. -/ +@[expose] def Witness (B N0 : ℕ) (hN : ActualCarrierGeometry.geometricThreshold ≤ N0) : Prop := ∃ a : ℕ → ℕ, MixedCandidateWitness.SelectedSchedule h (ActualCandidateConstruction.qbig B N0) 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..fa616b7ede 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 @@ -37,11 +37,13 @@ abbrev Point := LocalSignedRequest.Point abbrev Index (B N0 : ℕ) := ActualInitialization.Index B N0 /-- Radial ratio, given by `x.1 / VariableGaugeMean.qLength (2 * ActualPrimary.h) x.2.1`. -/ +@[expose] noncomputable def radialRatio (x : Point) : ℝ := x.1 / VariableGaugeMean.qLength (2 * ActualPrimary.h) x.2.1 /-- This is the original label's native similarity scale, not the scale in the current chart. -/ +@[expose] noncomputable def nativeQ {B N0 : ℕ} (l : Index B N0) (n : ℕ) (x : Point) : ℝ := SimilarityHomogeneity.chartQ ActualPrimary.h (ActualPrimary.nativeSlow l.1 (ActualPrimary.toAbsolute n x)) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCurrentParticularBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCurrentParticularBounds.lean index 8be4b1b9e3..eac8836467 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 @@ -51,11 +51,13 @@ abbrev FullPoint := ActualPrimary.FullPoint variable {B N0 : ℕ} /-- The actual common phase in the current free-angle native coordinates. -/ +@[expose] noncomputable def phase (l : Label B N0) (n : ℕ) (z : Native) : ℝ := (ActualPrimary.chartCoefficients l.1 l.2).phase n (ActualParticularBackground.nativeToFull z) /-- The same phase with the actual base carrier already included. -/ +@[expose] noncomputable def weightedPhase (l : Label B N0) (n : ℕ) (z : Native) : ℝ := ActualPhaseJetBounds.weightedPhase l n (ActualParticularBackground.nativeToFull z) @@ -240,7 +242,7 @@ end end -@[expose] public section +public section noncomputable section @@ -623,7 +625,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) @@ -888,6 +890,7 @@ theorem native_closed_mem_closure {z : Native} (PrimaryTargetBounds.rightRadius CorrectionInitialization.ActualPrimary.nominal)) nativeStrip.domain := by intro r hrr + rw [nativeStrip, ActualParticularStageControls.nativeStrip_eq] apply ActualCurrentParticularPhysical.nativeStrip_mem (show g r ∈ ActualCurrentParticularPhysical.nativeDomain from hz) change ell * r / ell ∈ Ioo _ _ @@ -1173,7 +1176,7 @@ theorem current_potential_mode_bound (H : ActualParticularCycleData.Invariant σ CurrentModeGeometry.chartInner_pos chart hchart) m] convert! he using 1 congr 2 - unfold currentLoss + simp only [currentLoss] ring · have hsupport := (ActualCurrentWaveSupport.current_mode_annulus hN y l (H.inputSupport (l.2,l.1)) j 0).1 diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCurrentParticularPhysical.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCurrentParticularPhysical.lean index c56e360f82..f14a98f102 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 @@ -40,6 +40,7 @@ abbrev Native := PhysicalParticularWave.WaveSpace variable {B N0 : ℕ} /-- The literal current solve, with the canonical geometry already fixed. -/ +@[expose] noncomputable def copyData (x : CycleState (Label B N0)) (l : Label B N0) (j : ℤ) := (ActualParticularStageControls.canonicalParameters l).copyData (ActualParticularStageControls.assembly x l).context @@ -56,7 +57,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 +65,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 +80,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 +99,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,18 +107,20 @@ 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) (cylindricalPotential x l j n (cylinderPoint w))) /-- Local pressure mode, given by `cylindricalPressure x l j n (cylinderPoint w)`. -/ +@[expose] noncomputable def localPressureMode (x : CycleState (Label B N0)) (l : Label B N0) (j : ℤ) (n : ℕ) (w : SpaceTime) : ℝ := cylindricalPressure x l j n (cylinderPoint w) /-- The actual finite active-label and nonzero-harmonic sum at band `n`. -/ +@[expose] noncomputable def localPotential (x : CycleState (Label B N0)) (n : ℕ) : VelocityField := fun w => ∑ l ∈ x.coefficients.labels n, ∑ j ∈ ParticularWaveAssembly.modes x.coefficients.residualBand, @@ -125,6 +128,7 @@ noncomputable def localPotential (x : CycleState (Label B N0)) (n : ℕ) : Veloc /-- Local pressure, defined pointwise by `∑ l ∈ x.coefficients.labels n, ∑ j ∈ ParticularWaveAssembly.modes x.coefficients.residualBand, localPressureMode x l j n w`. -/ +@[expose] noncomputable def localPressure (x : CycleState (Label B N0)) (n : ℕ) : PressureField := fun w => ∑ l ∈ x.coefficients.labels n, ∑ j ∈ ParticularWaveAssembly.modes x.coefficients.residualBand, @@ -367,6 +371,7 @@ theorem localPressureMode_germ_chart (x : CycleState (Label B N0)) (l : Label B /-- Native domain, given by `ActualWaveRegularity.nativeDomain ActualWaveRegularity.particularChart CorrectionInitialization.ActualPrimary.standardRegion`. -/ +@[expose] noncomputable def nativeDomain : Set Native := ActualWaveRegularity.nativeDomain ActualWaveRegularity.particularChart CorrectionInitialization.ActualPrimary.standardRegion @@ -525,15 +530,23 @@ theorem native_smooth_of_current_source (x : CycleState (Label B N0)) have ha := (ActualParticularStageControls.native_wave_to_weighted hc.1).each l have hp := (ActualParticularStageControls.native_wave_to_weighted hc.2.2.1).each l have he := copyData_eq_actual x l j (ActualParticularStageControls.preserves_frequency hx l) + rw [ActualParticularStageControls.nativeStrip_eq, + ← ActualWaveRegularityData.particularFullStrip_eq] at ha hp have ha' : WeightedClasses.MemClass ActualWaveRegularityData.particularFullStrip (fun _ z => Real.sqrt (ActualWaveRegularityData.particularFullStrip.zeta z)) α (copyData x l j).common.amplitude := by rw [he] + change WeightedClasses.MemClass ActualWaveRegularityData.particularFullStrip + (fun _ z => Real.sqrt (ActualWaveRegularityData.particularFullStrip.zeta z)) α + (ActualParticularCoherence.copyData x l j).common.amplitude at ha exact ha have hp' : WeightedClasses.MemClass ActualWaveRegularityData.particularFullStrip (fun _ z => Real.sqrt (ActualWaveRegularityData.particularFullStrip.zeta z)) (α + 1/2) (copyData x l j).common.pressure := by rw [he] + change WeightedClasses.MemClass ActualWaveRegularityData.particularFullStrip + (fun _ z => Real.sqrt (ActualWaveRegularityData.particularFullStrip.zeta z)) (α + 1/2) + (ActualParticularCoherence.copyData x l j).common.pressure at hp exact hp exact ⟨nativePotential_contDiffOn x l j (copyData_phase hx l j) ha' hz n, nativePressure_re_contDiffOn x l j (copyData_phase hx l j) hp' hz n⟩ @@ -650,6 +663,7 @@ theorem localFields_contDiffAt_of_invariant /-! ## The complete corrected coefficient is the actual native curl -/ /-- Native velocity, constructed using `vectorMode`. -/ +@[expose] noncomputable def nativeVelocity (x : CycleState (Label B N0)) (l : Label B N0) (j : ℤ) (n : ℕ) : Native → ComplexVector := vectorMode ((copyData x l j).background.frequency n) ((copyData x l j).background.phase n) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCurrentWaveSupport.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCurrentWaveSupport.lean index b565080230..9a564380cb 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 @@ -42,6 +42,7 @@ abbrev Index (B N0 : ℕ) := ActualInitialization.Index B N0 /-- The profile radius in physical coordinates, independent of the valid dyadic chart used to evaluate a wave. -/ +@[expose] noncomputable def profileRadius (h : ℝ) (w : SpaceTime) : ℝ := AnnularEndpoint.radius w / Real.sqrt (PhysicalWaveSum.physicalQ h w) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCycleAssembly.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCycleAssembly.lean index d76c827af2..a0b9e218aa 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 @@ -38,6 +38,7 @@ abbrev Point := ActualInitialization.Point abbrev Index (B N0 : ℕ) := ActualInitialization.Index B N0 /-- The same label map used by the actual primary covariance. -/ +@[expose] noncomputable def label {B N0 : ℕ} (_n : ℕ) (l : Index B N0) : SlotColoring.Label := ActualPrimaryCovariance.signedLabelOf l @@ -1080,6 +1081,7 @@ theorem primary_tangent_band (l : Index B N0) : (ActualInitialization.tangentBlo /-- The family is the literal cycle constructor, using the current coefficients and the fixed primary choice. -/ +@[expose] noncomputable def family : LabelSumBounds.SignedFamily ActualInitialization.geometry.strip P (1/2) (17/25) (1/2+σ-κ) (1+σ-2*κ) := @@ -1132,6 +1134,7 @@ theorem particular_supported_of_inputSupport : /-- The geometric record uses the same fixed slots and the current finite label set. The particular support adapter is supplied below. -/ +@[expose] noncomputable def assemblyOfParticularSupport : SignedMeanGain.Assembly (family x H hσ hpart htangent hcurl hP0 hP1) where width := CoordinateAlgebra.D ActualPrimary.h @@ -1173,6 +1176,7 @@ theorem assemblyOfParticularSupport_labels : /-- The actual geometric constructor. Incoming primitive support is transported through the particular solve; signed support is proved above. -/ +@[expose] noncomputable def assembly : SignedMeanGain.Assembly (family x H hσ hpart htangent hcurl hP0 hP1) := assemblyOfParticularSupport x H hσ hpart htangent hcurl hP0 hP1 hN hcarrier diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCycleCoherence.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCycleCoherence.lean index 7b7d148510..c640bafb52 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 @@ -321,6 +321,7 @@ abbrev overlap := ActualInitialCoherence.overlap /-- Every comparison is on the intersection of the two actual normalized slow charts; the radial and torus fibers are unrestricted. -/ +@[expose] def StateCoherent (u : State Point) : Prop := ∀ n m k, CommonWindow.index h n + k = CommonWindow.index h m → StateOn (PhysicalMeanDomain.slowDomain (overlap n m)) @@ -547,6 +548,7 @@ theorem signed_wave_on {B N0 : ℕ} (l : Index B N0) (u : State Point) ActualSignedGaussianCoherence.gaussianBlock_transport l u H hfixed n m k hi HS⟩ /-- Particular point, given by `ParticularWaveAssembly.angleShuffle (cycleAssoc z, 0)`. -/ +@[expose] noncomputable def particularPoint (z : Point) : PhysicalParticularWave.WaveSpace := ParticularWaveAssembly.angleShuffle (cycleAssoc z, 0) @@ -1115,6 +1117,7 @@ end Step /-! ## The fixed actual recurrence and the mean atlas input -/ /-- State, constructed using `CycleState.iterate`. -/ +@[expose] noncomputable def state (B N0 : ℕ) : ℕ → CycleState (Index B N0) := CycleState.iterate (fun _ => ActualCycleParameters.fixedParameters B N0) (commonContext B) (ActualInitialization.initialCycleState B N0) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCycleExcluded.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCycleExcluded.lean index 9a5386d8cb..a580bc0bce 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 @@ -67,12 +67,14 @@ structure SimilarityData where /-- Strip, given by `GaugeExcludedBounds.actualStrip (b := d.outer) d.region d.inner_pos d.left_pos d.right_pos d.h_pos d.slow d.slow_one`. -/ +@[expose] noncomputable def SimilarityData.strip (d : SimilarityData) : StripData Point := GaugeExcludedBounds.actualStrip (b := d.outer) d.region d.inner_pos d.left_pos d.right_pos d.h_pos d.slow d.slow_one /-- Gauge, given by `GaugeExcludedBounds.actualGauge d.h d.inner d.outer d.baseScale d.inner_lt_outer d.index`. -/ +@[expose] noncomputable def SimilarityData.gauge (d : SimilarityData) : GaugeData TorusInverse.Plane := GaugeExcludedBounds.actualGauge d.h d.inner d.outer d.baseScale d.inner_lt_outer d.index diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCycleParameters.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCycleParameters.lean index 4a349f03e0..91e57fd460 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 @@ -47,6 +47,7 @@ abbrev Point := ActualInitialization.Point /-- Initialization supplies all numerical hypotheses of the similarity estimates, including the actual finite-window common index. -/ +@[expose] noncomputable def similarityData : ActualCycleExcluded.SimilarityData where h := ActualPrimary.h h_pos := ActualPrimary.outgoing.data.h_pos @@ -148,7 +149,7 @@ end end -@[expose] public section +public section noncomputable section @@ -161,7 +162,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 +171,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 @@ -178,6 +179,7 @@ noncomputable def reindexState {ι κ : Type} (e : κ ≃ ι) /-- Reindex parameters, bundling `gauge`, `strip`, `patch`, `coordinate` and the required compatibility proofs. -/ +@[expose] noncomputable def reindexParameters {ι κ : Type} (e : κ ≃ ι) (p : CycleParameters ι) : CycleParameters κ where gauge := p.gauge @@ -265,6 +267,7 @@ abbrev Index (B N0 : ℕ) := ActualInitialization.Index B N0 abbrev ParticularIndex (B N0 : ℕ) := ActualParticularStageControls.Label B N0 /-- Swap, given by `Equiv.prodComm _ _`. -/ +@[expose] noncomputable def swap (B N0 : ℕ) : Index B N0 ≃ ParticularIndex B N0 := Equiv.prodComm _ _ @@ -274,7 +277,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)) : @@ -306,6 +309,7 @@ theorem particularState_roundtrip {B N0 : ℕ} (x : CycleState (Index B N0)) : /-! ## The actual four-stage parameter constructor -/ /-- Parameters, constructed using `CycleParameters.ofGeometry`. -/ +@[expose] noncomputable def parameters {B N0 : ℕ} (x : CycleState (Index B N0)) : CycleParameters (Index B N0) := CycleParameters.ofGeometry ActualInitialization.geometry ActualPrimary.h @@ -315,6 +319,7 @@ noncomputable def parameters {B N0 : ℕ} (x : CycleState (Index B N0)) : /-- The same literal builder expressed in the particular solver's label order. This has no additional geometric or analytic choices. -/ +@[expose] noncomputable def parametersInParticularOrder {B N0 : ℕ} (x : CycleState (ParticularIndex B N0)) : CycleParameters (ParticularIndex B N0) := CycleParameters.ofGeometry ActualInitialization.geometry ActualPrimary.h @@ -379,6 +384,7 @@ choice and does not change with the current correction state. -/ noncomputable def bandFloor (B N0 : ℕ) : ℕ := (ActualPrimary.choice B N0).prepared.N /-- Source band, given by `BaseChartJets.cellBand l.1`. -/ +@[expose] noncomputable def sourceBand {B N0 : ℕ} (l : Index B N0) : ℕ := BaseChartJets.cellBand l.1 theorem bandFloor_ge (B N0 : ℕ) : N0 ≤ bandFloor B N0 := ActualPrimary.threshold B N0 @@ -559,6 +565,7 @@ theorem initial_signed_carrier (B N0 : ℕ) (l : Index B N0) : /-! ## The same fixed primitives at every valid state -/ /-- Fixed parameters, constructed using `CycleParameters.ofGeometry`. -/ +@[expose] noncomputable def fixedParameters (B N0 : ℕ) : CycleParameters (Index B N0) := CycleParameters.ofGeometry ActualInitialization.geometry ActualPrimary.h (CommonWindow.index ActualPrimary.h) ActualInitialization.axial diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCyclePeriodicity.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCyclePeriodicity.lean index 7545be6d86..5cfb05ee26 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 @@ -48,10 +48,12 @@ abbrev Index (B N0 : ℕ) := ActualInitialization.Index B N0 abbrev Frequency := TorusInverse.Frequency /-- Point deck, given by `(0, (0, TorusAverages.latticePoint k))`. -/ +@[expose] noncomputable def pointDeck (k : Frequency) : Point := (0, (0, TorusAverages.latticePoint k)) /-- Native section, given by `ActualWaveRegularity.particularChart (x, 0)`. -/ +@[expose] noncomputable def nativeSection (x : Point) : ActualWaveRegularity.ParticularSpace := ActualWaveRegularity.particularChart (x, 0) @@ -270,7 +272,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 @@ -285,6 +287,7 @@ variable {B N0 : ℕ} /-- The deck shift on the full free lift, leaving radius and slow variables unchanged. This is definitionally the shift used by the seed continuation. -/ +@[expose] noncomputable def pointDeck (k : TorusInverse.Frequency) : Point := (ActualPrimaryCoherence.chartDeck k).1 @@ -386,7 +389,7 @@ end end -@[expose] public section +public section noncomputable section @@ -410,6 +413,7 @@ section TranslationCalculus variable {D : Type} [NormedAddCommGroup D] [NormedSpace ℝ D] /-- Coefficients translation, given by `∀ j, TranslationOn U v (a j)`. -/ +@[expose] def CoefficientsTranslation (U : Set D) (v : D) (a : HarmonicFields.Coefficients D) : Prop := ∀ j, TranslationOn U v (a j) @@ -801,6 +805,7 @@ end CurrentSource /-! The literal source, with the associator used by the particular solver. -/ /-- Copies, constructed using `ActualWaveRegularityData.particularCopies`. -/ +@[expose] noncomputable def copies {B N0 : ℕ} (x : CycleState (Index B N0)) (l : Index B N0) (j : ℤ) := ActualWaveRegularityData.particularCopies (l.2, l.1) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCyclePreservation.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCyclePreservation.lean index 0513fe9ce6..1095054ead 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 @@ -118,20 +118,24 @@ noncomputable def velocityScale (L : Label B N0) (n : ℕ) : ℝ := L)) /-- Common matrix, given by `covariance B N0 L (nativePoint n x L)`. -/ +@[expose] noncomputable def commonMatrix (L : Label B N0) (n : ℕ) (x : Point) : Mat2 := covariance B N0 L (nativePoint n x L) /-- Reference target, defined pointwise by `PrimaryTargetBounds.actualTarget modulation (nativePoint n x L) i`. -/ +@[expose] noncomputable def referenceTarget (L : Label B N0) (n : ℕ) (x : Point) : Vec2 := fun i => PrimaryTargetBounds.actualTarget modulation (nativePoint n x L) i /-- Common target, given by `(ActualSignedStageControls.coefficientScale (L, (0 : Fin 2)) n) ^ 2 • referenceTarget L n x`. -/ +@[expose] noncomputable def commonTarget (L : Label B N0) (n : ℕ) (x : Point) : Vec2 := (ActualSignedStageControls.coefficientScale (L, (0 : Fin 2)) n) ^ 2 • referenceTarget L n x /-- Signed ratio, constructed using `SignedCovariance.increment`. -/ +@[expose] noncomputable def signedRatio (request : ℕ → FullPoint → Vec2) (L : Label B N0) (n : ℕ) (x : Point) (j : Fin 2) : ℝ := SignedCovariance.increment (commonMatrix L n x) (commonTarget L n x) (request n (x, 0)) j / @@ -376,6 +380,7 @@ theorem primary_diagonal_average (n : ℕ) {x : Point} /-! ## The literal requested field and its finite covariance sum -/ /-- Actual request, constructed using `LocalSignedRequest.fullRequest`. -/ +@[expose] noncomputable def actualRequest (c : CorrectionState.Context Point) (u : CorrectionState.State Point) : ℕ → FullPoint → Vec2 := LocalSignedRequest.fullRequest ActualInitialization.geometry.strip @@ -383,6 +388,7 @@ noncomputable def actualRequest (c : CorrectionState.Context Point) /-- Actual signed block, given by `(ActualSignedStageControls.parameters l).tangentBlock ActualInitialization.geometry.strip (actualRequest c u)`. -/ +@[expose] noncomputable def actualSignedBlock (c : CorrectionState.Context Point) (u : CorrectionState.State Point) (l : Label B N0 × Fin 2) := (ActualSignedStageControls.parameters l).tangentBlock ActualInitialization.geometry.strip @@ -584,6 +590,7 @@ open CorrectionStep CorrectionState /-- This is the actual cycle constructor with its particular solver left as a parameter. Both fixed and state-dependent actual particular solvers use this very signed subsystem. -/ +@[expose] noncomputable def cycleParameters (particular : (Label B N0 × Fin 2) → ParticularParameters CycleSlow) : CycleParameters (Label B N0 × Fin 2) := @@ -788,7 +795,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 @@ -801,6 +808,7 @@ open scoped ContDiff Topology BigOperators variable {B N0 : ℕ} /-- Copies, given by `(parameters l).copyData ActualPrimaryBounds.strip request`. -/ +@[expose] noncomputable def copies (request : ℕ → FullPoint → SignedWaveUpdate.Vec2) (l : SignedLabel B N0) : PeriodizedWaveBounds.CopyData FullPoint Frequency := (parameters l).copyData ActualPrimaryBounds.strip request @@ -965,7 +973,13 @@ theorem localGaussian_wave_jets {σ : ℝ} LocalizedWaveBounds.LocalClass.zero (fun n i x hx => hw i.1 n x hx) have hfast : BandBound fullStrip 0 (directions B).fastScale := (ActualPrimaryBounds.actual_local_inputs (B := B) (N0 := N0)).fast_scale - exact LocalizedGaussianBounds.indexedCutoffError_wave_class (directions B) hψ hfast hu hf + refine (LocalizedGaussianBounds.indexedCutoffError_wave_class + (directions B) hψ hfast hu hf).congr ?_ + intro n i x + rw [localGaussian_formula] + unfold LocalizedGaussianBounds.indexedCutoffError + simp only [smul_zero, add_zero] + simp only [PeriodizedWaveBounds.CopyData.raw, copies] /-- All joint jets of the literal local Gaussian error have every epsilon exponent, with exactly the square-root edge weight. -/ @@ -1086,7 +1100,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 +1298,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1413,6 +1427,7 @@ theorem step_labels {B N0 : ℕ} (x : CycleState (Index B N0)) : x.coefficients.labels := rfl /-- State, constructed using `CycleState.iterate`. -/ +@[expose] noncomputable def state (B N0 : ℕ) : ℕ → CycleState (Index B N0) := CycleState.iterate (fun _ => ActualCycleParameters.fixedParameters B N0) (ActualPrimary.commonContext B) (ActualInitialization.initialCycleState B N0) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCycleResidualBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCycleResidualBounds.lean index 2e1e0bb66a..9a420a9ebb 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 @@ -182,6 +182,7 @@ end FixedSchedule /-! ## The joint past filter at the physical origin -/ /-- Origin past, given by `𝓝[SpacetimeEndpoint.openPast 1] ((1 : ℝ), (0 : Space))`. -/ +@[expose] noncomputable def originPast : Filter SpaceTime := 𝓝[SpacetimeEndpoint.openPast 1] ((1 : ℝ), (0 : Space)) @@ -274,7 +275,7 @@ end end -@[expose] public section +public section noncomputable section @@ -293,7 +294,7 @@ abbrev Cylinder := Point × ℝ abbrev Index := ActualInitialization.Index /-- Label carrier, given by `ActualInitialExcluded.labelCarrier (l.2, l.1) n`. -/ -noncomputable def labelCarrier {B N0 : ℕ} (l : Index B N0) (n : ℕ) : Set Point := +@[expose] noncomputable def labelCarrier {B N0 : ℕ} (l : Index B N0) (n : ℕ) : Set Point := ActualInitialExcluded.labelCarrier (l.2, l.1) n theorem labelCarrier_closed {B N0 : ℕ} (l : Index B N0) (n : ℕ) : IsClosed (labelCarrier l n) := @@ -790,6 +791,7 @@ theorem realization_native_smooth {h : ℝ} {N : ℕ} {gap : ℕ → ℕ} {U : S /-! ## The fixed exterior base and the full physical endpoint -/ /-- Active as an element of `Set ProblemStatement.SpaceTime`. -/ +@[expose] noncomputable def active : Set ProblemStatement.SpaceTime := {w | (SlowBorelBase.cartesianChart ActualPrimary.h w).2.1 ∈ Icc (NominalConeAssembly.activeLeft ActualPrimary.nominal) @@ -1327,11 +1329,13 @@ theorem selected_residual_jetRate {a b h gain β : ℝ} {N Δ : ℕ} {gap : ℕ /-- Actual gap, given by `ChartScales.nativeIndex ActualPrimary.h n - CommonWindow.index ActualPrimary.h n`. -/ +@[expose] noncomputable def actualGap (n : ℕ) : ℕ := ChartScales.nativeIndex ActualPrimary.h n - CommonWindow.index ActualPrimary.h n /-- Actual band graph, given by `PhysicalResidualBridge.commonGraph (ChartScales.Q n) ActualPrimary.h (CommonWindow.index ActualPrimary.h n)`. -/ +@[expose] noncomputable def actualBandGraph (n : ℕ) : PhysicalResidualBridge.ScaledGraph := PhysicalResidualBridge.commonGraph (ChartScales.Q n) ActualPrimary.h (CommonWindow.index ActualPrimary.h n) @@ -1354,6 +1358,7 @@ theorem actual_bandGraph (n : ℕ) : bandGraph ActualPrimary.h n (actualGap n) = /-- Actual base pressure, given by `ActualBaseResidual.basePressure ActualPrimary.certificate ActualPrimary.modulation ActualPrimary.upper B n`. -/ +@[expose] noncomputable def actualBasePressure (B n : ℕ) : Cylinder → ℝ := ActualBaseResidual.basePressure ActualPrimary.certificate ActualPrimary.modulation ActualPrimary.upper B n @@ -1504,6 +1509,7 @@ abbrev PhysicalData (B N : ℕ) (s : State Point) (u : VelocityField) (P : Press PhysicalFields B N ActualPolarCoverage.nativeDomain s u P /-- Fixed loss, given by `physicalLoss ActualPrimary.h (2 * ActualPrimary.h) m`. -/ +@[expose] noncomputable def fixedLoss (m : ℕ) : ℝ := physicalLoss ActualPrimary.h (2 * ActualPrimary.h) m theorem fixedLoss_eq_ledger (m : ℕ) : diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualGaussianCoverage.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualGaussianCoverage.lean index 128c073301..1a1dbe69c1 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 @@ -369,6 +369,7 @@ variable {D I L : Type} [NormedAddCommGroup D] [NormedSpace ℝ D] /-- Indexed cutoff error, given by `d.Dfast (fun n => ψ n i) n x • u n i x + (1 - ψ n i x) • f n i x`. -/ +@[expose] noncomputable def indexedCutoffError (d : GraphDirections D) (ψ : ℕ → I → D → ℝ) (u f : ℕ → I → D → ComplexVector) (n : ℕ) (i : I) (x : D) : ComplexVector := @@ -595,7 +596,7 @@ end end -@[expose] public section +public section noncomputable section @@ -660,7 +661,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 : ℝ) : @@ -735,12 +736,14 @@ end PathGerms /-! ## The separate Gaussian cutoff and its genuine outer padding -/ /-- Padding, given by `min r L / 16`. -/ +@[expose] noncomputable def padding (r L : ℝ) : ℝ := min r L / 16 theorem padding_pos {r L : ℝ} (hr : 0 < r) (hL : 0 < L) : 0 < padding r L := div_pos (lt_min hr hL) (by norm_num) /-- Reference window, bundling `lower`, `upper`, `padding`, `padding_pos`. -/ +@[expose] noncomputable def referenceWindow (r L : ℝ) (hr : 0 < r) (hL : 0 < L) : PeriodicPhaseAssembly.ClockWindow where lower := (-r, 0) @@ -753,18 +756,20 @@ 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) /-- Outer cell, given by `Icc (-r - 2 * padding r L) (r + 2 * padding r L) ×ˢ Icc ((-2 * padding r L) / c) ((L + 2 * padding r L) / c)`. -/ +@[expose] noncomputable def outerCell (r L c : ℝ) : Set Plane := Icc (-r - 2 * padding r L) (r + 2 * padding r L) ×ˢ Icc ((-2 * padding r L) / c) ((L + 2 * padding r L) / c) /-- The support inherited from a Gaussian slot profile has a strict temporal margin at both ends of the full Volterra integration interval. -/ +@[expose] noncomputable def sourceCell (r L c : ℝ) : Set Plane := Icc (-r) r ×ˢ Icc ((L / c) / 6) (5 * (L / c) / 6) @@ -888,6 +893,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) @@ -961,15 +967,18 @@ variable {Label P : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] /-- Cutoff family, given by `nativeCutoff (r l n) (F.L (l,n)) (hr l n) (F.L_pos (l,n)) (clock.value l n)`. -/ +@[expose] noncomputable def cutoffFamily (l : Label) (n : ℕ) : Plane → ℝ := nativeCutoff (r l n) (F.L (l,n)) (hr l n) (F.L_pos (l,n)) (clock.value l n) /-- Outer family, given by `outerCell (r l n) (F.L (l,n)) (clock.value l n)`. -/ +@[expose] noncomputable def outerFamily (l : Label) (n : ℕ) : Set Plane := outerCell (r l n) (F.L (l,n)) (clock.value l n) /-- Source regions, given by `sourceRegion (S l n) (ScaledActualParticularControl.geometry reference gap clock l n) (r l n) (F.L (l,n)) (clock.value l n)`. -/ +@[expose] noncomputable def sourceRegions (S : Label → ℕ → Set P) (l : Label) (n : ℕ) : Set (P × Plane) := sourceRegion (S l n) (ScaledActualParticularControl.geometry reference gap clock l n) (r l n) (F.L (l,n)) (clock.value l n) @@ -990,6 +999,7 @@ variable (base : Label → LinearWaveBounds.WaveCoefficients ((P × ℝ) × Plan /-- The same actual complex solve as the correction step, with entry zero, exit `Lref/clock`, and a single transported Gaussian-times-padding cutoff. -/ +@[expose] noncomputable def data (l : Label) : CopyData ((P × ℝ) × Plane) Frequency := complexCopyData (base l) (tangent l) (ParticularWaveAssembly.sourceFamily ctx u (b l) (G l) (A l) j) @@ -1386,6 +1396,7 @@ variable {Label P : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] (r : Label → ℕ → ℝ) (hr : ∀ l n, 0 < r l n) /-- Field envelope, constructed using `ActualParticularControl.groupedEnvelope`. -/ +@[expose] noncomputable def fieldEnvelope : Label → ℕ → (P × ℝ) × Plane → ℝ := ActualParticularControl.groupedEnvelope (ScaledActualParticularControl.geometry reference gap clock) r @@ -1412,6 +1423,7 @@ theorem fieldEnvelope_eq (s : StripData P) (χ : P →L[ℝ] PhaseCalculus.Slow) (fun l n => reference_outer_separated _ (hr l n) (F.L_pos (l,n)) (hinj l n)) hx /-- Cells, constructed using `nativeCells`. -/ +@[expose] noncomputable def cells (hinj : ∀ l n, InjOn TorusAverages.quotientPoint ((fun z => (reference l n).center + (reference l n).basis z) '' @@ -1568,6 +1580,7 @@ end CurrentSourceJets /-- Reference cutoff, given by `(referenceWindow r L hr hL).cutoff z * GaussianTailFlat.slotCutoff L z.2`. -/ +@[expose] noncomputable def referenceCutoff (r L : ℝ) (hr : 0 < r) (hL : 0 < L) (z : Plane) : ℝ := (referenceWindow r L hr hL).cutoff z * GaussianTailFlat.slotCutoff L z.2 @@ -1654,6 +1667,7 @@ theorem prepared_gaussian_rate_pos : 0 < gaussianRate a.M⁻¹ a.u := /-- The closed slow support is the actual one-mesh primary mask. Its inclusion in the two-mesh analytic phase cell has a genuine margin. -/ +@[expose] noncomputable def actualSlowCore (L : PrimaryGeometryAssembly.Index W a.N) : Set PhaseCalculus.Slow := tsupport (PrimaryRepresentatives.nativeMask (BaseChartJets.cellBand L) @@ -1669,7 +1683,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..918f1c9a80 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 @@ -40,6 +40,7 @@ abbrev Point := PressureStream.Lift Plane /-- Pieces, defined pointwise by `CorrectionInitialization.ActualPrimary.piece CorrectionInitialization.ActualPrimary.standardRegion l.2 l.1`. -/ +@[expose] noncomputable def pieces (B N0 : ℕ) : CorrectionInitialization.ActualPrimary.Label B N0 × Fin 2 → CorrectionInitialization.PrimaryPiece (Point × ℝ) := @@ -47,18 +48,19 @@ noncomputable def pieces (B N0 : ℕ) : CorrectionInitialization.ActualPrimary.standardRegion l.2 l.1 /-- Base error, constructed using `ActualBaseResidual.baseError`. -/ +@[expose] noncomputable def baseError (B : ℕ) : Oscillation Point := ActualBaseResidual.baseError CorrectionInitialization.ActualPrimary.certificate CorrectionInitialization.ActualPrimary.modulation 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) @@ -66,6 +68,7 @@ noncomputable def primary (B N0 : ℕ) : State Point := CorrectionInitialization.ActualPrimary.standardRegion B N0) (pieces B N0) (baseError B) /-- Temporal, constructed using `CorrectionInitialization.GaugeInitialization.temporalBands`. -/ +@[expose] noncomputable def temporal (B N0 : ℕ) : State Point := CorrectionInitialization.GaugeInitialization.temporalBands CorrectionInitialization.ActualPrimary.commonGauge CorrectionInitialization.ActualPrimary.h @@ -75,6 +78,7 @@ noncomputable def temporal (B N0 : ℕ) : State Point := CorrectionInitialization.ActualPrimary.standardRegion B N0) (pieces B N0) (baseError B) /-- Ranked, constructed using `CorrectionInitialization.GaugeInitialization.rankBands`. -/ +@[expose] noncomputable def ranked (B N0 : ℕ) : State Point := CorrectionInitialization.GaugeInitialization.rankBands CorrectionInitialization.ActualPrimary.commonGauge @@ -87,6 +91,7 @@ noncomputable def ranked (B N0 : ℕ) : State Point := /-- Initialized, constructed using `CorrectionInitialization.GaugeInitialization.initializedBands`. -/ +@[expose] noncomputable def initialized (B N0 : ℕ) : State Point := CorrectionInitialization.GaugeInitialization.initializedBands CorrectionInitialization.ActualPrimary.commonGauge @@ -644,19 +649,22 @@ open CorrectionInitialization CorrectionInitialization.ActualPrimary GaugeStateC variable {B N0 : ℕ} /-- Phase, given by `(pieces B N0 l).coefficients.phase n (x, 0)`. -/ +@[expose] noncomputable def phase (l : Label B N0 × Fin 2) (n : ℕ) (x : Point) : ℝ := (pieces B N0 l).coefficients.phase n (x, 0) /-- Angular mode, given by `PrimaryGeometryAssembly.angularMode certificate modulation (choice B N0).prepared l.2 l.1`. -/ +@[expose] 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)`. -/ +@[expose] noncomputable def gaussianBlock (l : Label B N0 × Fin 2) : HarmonicBlock Point := (pieces B N0 l).excludedBlock (phase l) (angularMode l) @@ -875,6 +883,7 @@ theorem initialized_band (B N0 n m k : ℕ) /-- Overlap, given by `standardRegion.carrier ∩ (bandSlowEquiv h n m) ⁻¹' standardRegion.carrier`. -/ +@[expose] noncomputable def overlap (n m : ℕ) : Set Plane := standardRegion.carrier ∩ (bandSlowEquiv h n m) ⁻¹' standardRegion.carrier diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualInitialExcluded.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualInitialExcluded.lean index fb97b0f333..999ccb03ce 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 @@ -52,10 +52,12 @@ abbrev Index (B N0 : ℕ) := ActualPrimary.Label B N0 × Fin 2 /-- Strip, given by `BaseContextAssembly.nativeStrip ActualPrimary.nominal ActualPrimary.standardRegion`. -/ +@[expose] noncomputable def strip : StripData Point := BaseContextAssembly.nativeStrip ActualPrimary.nominal ActualPrimary.standardRegion /-- Slow strip, constructed using `PhysicalMeanDomain.localSlowStripData`. -/ +@[expose] noncomputable def slowStrip : StripData TorusInverse.Plane := PhysicalMeanDomain.localSlowStripData ActualPrimary.standardRegion.carrier ActualPrimary.standardRegion.isOpen (ChartScales.epsilon ActualPrimary.h) @@ -64,46 +66,55 @@ noncomputable def slowStrip : StripData TorusInverse.Plane := BaseContextAssembly.one_le_slowScale /-- Primary piece, given by `ActualPrimary.piece ActualPrimary.standardRegion l.2 l.1`. -/ +@[expose] noncomputable def primaryPiece {B N0 : ℕ} (l : Index B N0) : PrimaryPiece (Point × ℝ) := ActualPrimary.piece ActualPrimary.standardRegion l.2 l.1 /-- Base error, given by `ActualBaseResidual.baseError ActualPrimary.certificate ActualPrimary.modulation ActualPrimary.upper B`. -/ +@[expose] noncomputable def baseError (B : ℕ) : Oscillation Point := ActualBaseResidual.baseError ActualPrimary.certificate ActualPrimary.modulation ActualPrimary.upper B /-- Seed, given by `bandSeed (ActualPrimary.activeLabels ActualPrimary.standardRegion B N0) primaryPiece (baseError B)`. -/ +@[expose] noncomputable def seed (B N0 : ℕ) : State Point := bandSeed (ActualPrimary.activeLabels ActualPrimary.standardRegion B N0) primaryPiece (baseError B) /-- Axial, given by `((0, 1), 0)`. -/ +@[expose] noncomputable def axial : TorusInverse.Plane × TorusInverse.Plane := ((0, 1), 0) /-- Primary, given by `VariableGaugeMean.reconstructState ActualPrimary.commonGauge (ActualPrimary.commonContext B) (seed B N0)`. -/ +@[expose] noncomputable def primary (B N0 : ℕ) : State Point := VariableGaugeMean.reconstructState ActualPrimary.commonGauge (ActualPrimary.commonContext B) (seed B N0) /-- Temporal, constructed using `VariableGaugeMean.temporalStageState`. -/ +@[expose] noncomputable def temporal (B N0 : ℕ) : State Point := VariableGaugeMean.temporalStageState ActualPrimary.commonGauge ActualPrimary.h (CommonWindow.index ActualPrimary.h) axial (ActualPrimary.commonContext B) (primary B N0) /-- Ranked, constructed using `VariableGaugeMean.rankStageState`. -/ +@[expose] noncomputable def ranked (B N0 : ℕ) : State Point := VariableGaugeMean.rankStageState ActualPrimary.commonGauge ActualPrimary.rankData axial (ActualPrimary.commonContext B) (temporal B N0) /-- Initialized, constructed using `GaugeInitialization.initializedBands`. -/ +@[expose] noncomputable def initialized (B N0 : ℕ) : State Point := GaugeInitialization.initializedBands ActualPrimary.commonGauge ActualPrimary.rankData ActualPrimary.h (CommonWindow.index ActualPrimary.h) axial (ActualPrimary.commonContext B) (ActualPrimary.activeLabels ActualPrimary.standardRegion B N0) primaryPiece (baseError B) /-- Initial alias, constructed using `VariableGaugeMean.temporalAliasState`. -/ +@[expose] noncomputable def initialAlias (B N0 : ℕ) (n : ℕ) (x : Point) : Fin 3 → ℝ := VariableGaugeMean.temporalAliasState ActualPrimary.commonGauge ActualPrimary.h (CommonWindow.index ActualPrimary.h) (ActualPrimary.commonContext B) (primary B N0) n (x, 0) + @@ -247,7 +258,9 @@ theorem tangent_amplitude_uniform : have hh := ActualPrimaryBounds.chart_cut_amplitude_uniform (B := B) (N0 := N0) change LabelSumBounds.UniformClass (HarmonicWaveInteraction.productStrip strip) (fun l n x => Real.sqrt (strip.zeta x.1) * ActualPrimaryBounds.meanEnvelope l n x.1) - (1 / 2) _ at hh + (1 / 2) (fun l : ActualPrimaryBounds.SignedLabel B N0 => fun n x => + ((ActualPrimary.chartCoefficients l.1 l.2).withCutoff + (ActualPrimary.chartCutoff l.1 l.2)).amplitude n x) at hh have hr : LabelSumBounds.UniformWaveClass strip ActualPrimaryBounds.meanEnvelope (1 / 2) (fun l : ActualPrimaryBounds.SignedLabel B N0 => fun n x => ((ActualPrimary.chartCoefficients l.1 l.2).withCutoff @@ -465,6 +478,7 @@ end CovarianceInputs fields of the initialization estimates. -/ /-- Primary data, constructed using `MovingInitialization.PrimaryMeanData`. -/ +@[expose] noncomputable def PrimaryData (B N0 : ℕ) : Prop := MovingInitialization.PrimaryMeanData (cL := FinalSlowBase.edgeExponent ActualPrimary.nominal / 4) (cR := 1) @@ -603,7 +617,12 @@ theorem curl_amplitude_uniform {B N0 : ℕ} : have hh := ActualPrimaryBounds.chart_curl_uniform (B := B) (N0 := N0) change LabelSumBounds.UniformClass (HarmonicWaveInteraction.productStrip strip) (fun l n x => Real.sqrt (strip.zeta x.1) * ActualPrimaryBounds.meanEnvelope l n x.1) - (1 - ChartScales.kappa) _ at hh + (1 - ChartScales.kappa) + (fun l : ActualPrimaryBounds.SignedLabel B N0 => fun n x => + ((ActualPrimary.chartCoefficients l.1 l.2).withCutoff + (ActualPrimary.chartCutoff l.1 l.2)).curlCorrection + (HarmonicWaveInteraction.productStrip strip) + (PrimaryResidualClass.directions (ActualPrimary.commonContext B)) n x) at hh have hr : LabelSumBounds.UniformWaveClass strip ActualPrimaryBounds.meanEnvelope (1 - ChartScales.kappa) (fun l : ActualPrimaryBounds.SignedLabel B N0 => fun n x => @@ -745,7 +764,9 @@ theorem initialized_formula (B N0 : ℕ) : (ActualPrimary.activeLabels ActualPrimary.standardRegion B N0) (fun l => ActualPrimary.piece ActualPrimary.standardRegion l.2 l.1) (ActualBaseResidual.baseError ActualPrimary.certificate ActualPrimary.modulation - ActualPrimary.upper B) := rfl + ActualPrimary.upper B) := by + simp only [initialized, axial, baseError] + congr 1 end NavierStokes.ActualInitialMean @@ -754,7 +775,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1375,6 +1396,7 @@ theorem gaussianLength_near (l : SignedLabel B N0) (n : ℕ) (hn : near l n) : /-- Outside the active finite band window the copied field is identically zero. The auxiliary length merely makes the global index bookkeeping total. -/ +@[expose] noncomputable def gaussianLength (l : SignedLabel B N0) (n : ℕ) : ℝ := max ((ActualPrimary.phases B N0 0).L l.2) (gaussianLengthLower * ChartScales.S n) @@ -1488,6 +1510,7 @@ variable {B N0 : ℕ} /-- The original label's actual slow mask and Gaussian source rectangle, on the common torus lift. The harmonic index does not change this set. -/ +@[expose] noncomputable def labelCarrier (l : SignedLabel B N0) (n : ℕ) : Set Point := {x | ∃ k : TorusInverse.Frequency, (ActualPrimary.nativeSlow l.2 (ActualPrimary.toAbsolute n x), @@ -1576,6 +1599,7 @@ open CorrectionInitialization ActualPrimaryBounds variable {B N0 : ℕ} /-- Chart gaussian, constructed using `LinearWaveBounds.excludedSlotError`. -/ +@[expose] noncomputable def chartGaussian (l : SignedLabel B N0) : ℕ → ActualPrimary.FullPoint → HarmonicCalculus.ComplexVector := LinearWaveBounds.excludedSlotError (PrimaryResidualClass.directions (ActualPrimary.commonContext @@ -1847,6 +1871,7 @@ theorem chartCarrier_smooth (l : SignedLabel B N0) (n : ℕ) : /-- Gaussian field, given by `(ActualPrimary.piece ActualPrimary.standardRegion l.1 l.2).excluded`. -/ +@[expose] noncomputable def gaussianField (l : SignedLabel B N0) : ℕ → ActualPrimary.FullPoint → Fin 3 → ℝ := (ActualPrimary.piece ActualPrimary.standardRegion l.1 l.2).excluded diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualInitialMeanEquation.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualInitialMeanEquation.lean index 8aaee8d056..f3ab24de6d 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 @@ -36,6 +36,7 @@ abbrev Point := PressureStream.Lift PressureStream.Plane abbrev Full := Point × ℝ /-- Strip, given by `BaseContextAssembly.nativeStrip nominal standardRegion`. -/ +@[expose] noncomputable def strip : WeightedClasses.StripData Point := BaseContextAssembly.nativeStrip nominal standardRegion diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualInitialization.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualInitialization.lean index 297b261df3..2e4882c90e 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,23 +38,26 @@ 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`. -/ +@[expose] noncomputable def angularMode (l : Index B N0) (_n : ℕ) : ℤ := PrimaryGeometryAssembly.angularMode ActualPrimary.certificate ActualPrimary.modulation (ActualPrimary.choice B N0).prepared l.2 l.1 /-- Primary block, given by `(primaryPiece l).harmonicBlock (phase l) (angularMode l)`. -/ +@[expose] noncomputable def primaryBlock (l : Index B N0) : HarmonicBlock Point := (primaryPiece l).harmonicBlock (phase l) (angularMode l) /-- Tangent block, given by `(primaryPiece l).tangentBlock (phase l) (angularMode l)`. -/ +@[expose] noncomputable def tangentBlock (l : Index B N0) : HarmonicBlock Point := (primaryPiece l).tangentBlock (phase l) (angularMode l) @@ -63,6 +66,7 @@ noncomputable def curlBlock (l : Index B N0) : HarmonicBlock Point := (primaryPiece l).differenceBlock (phase l) (angularMode l) /-- Gaussian block, given by `(primaryPiece l).excludedBlock (phase l) (angularMode l)`. -/ +@[expose] noncomputable def gaussianBlock (l : Index B N0) : HarmonicBlock Point := (primaryPiece l).excludedBlock (phase l) (angularMode l) @@ -153,6 +157,7 @@ theorem gaussianBlock_band (l : Index B N0) : (gaussianBlock l).BandLimited 1 := /-- Coefficients, bundling `labels`, `blocks`, `gaussian`, `aliasCoefficients` and the required compatibility proofs. -/ +@[expose] noncomputable def coefficients (B N0 : ℕ) : CorrectionStep.CycleCoefficients (Index B N0) where labels := ActualPrimary.activeLabels ActualPrimary.standardRegion B N0 blocks := primaryBlock @@ -179,40 +184,43 @@ theorem gaussian_coefficientField (l : Index B N0) : /-- Base error, given by `ActualBaseResidual.baseError ActualPrimary.certificate ActualPrimary.modulation ActualPrimary.upper B`. -/ +@[expose] noncomputable def baseError (B : ℕ) : Oscillation Point := ActualBaseResidual.baseError ActualPrimary.certificate ActualPrimary.modulation 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) /-- Axial, given by `((0, 1), 0)`. -/ +@[expose] 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) /-- Initial alias as an element of `CorrectionStep.AxisymmetricAlias`. -/ +@[expose] noncomputable def initialAlias (B N0 : ℕ) : CorrectionStep.AxisymmetricAlias := fun n x i => VariableGaugeMean.temporalAliasState ActualPrimary.commonGauge ActualPrimary.h (CommonWindow.index ActualPrimary.h) (ActualPrimary.commonContext B) (primaryState B N0) n @@ -222,6 +230,7 @@ noncomputable def initialAlias (B N0 : ℕ) : CorrectionStep.AxisymmetricAlias : /-- The initial state and its actual harmonic data are constructed together; all later iterations retain these physical labels. -/ +@[expose] noncomputable def initialCycleState (B N0 : ℕ) : CorrectionStep.CycleState (Index B N0) where state := initialState B N0 coefficients := coefficients B N0 @@ -233,6 +242,35 @@ theorem initialState_eq_bands (B N0 : ℕ) : ActualPrimary.h (CommonWindow.index ActualPrimary.h) axial (ActualPrimary.commonContext B) (coefficients B N0).labels primaryPiece (baseError B) := rfl +theorem sourceState_eq_mean_seed (B N0 : ℕ) : + sourceState B N0 = ActualInitialMean.seed B N0 := by + rfl + +theorem primaryState_eq_mean_primary (B N0 : ℕ) : + primaryState B N0 = ActualInitialMean.primary B N0 := by + rw [primaryState, ActualInitialMean.primary, sourceState_eq_mean_seed] + +theorem temporalState_eq_mean_temporal (B N0 : ℕ) : + temporalState B N0 = ActualInitialMean.temporal B N0 := by + rw [temporalState, ActualInitialMean.temporal, primaryState_eq_mean_primary] + rfl + +theorem rankState_eq_mean_ranked (B N0 : ℕ) : + rankState B N0 = ActualInitialMean.ranked B N0 := by + rw [rankState, ActualInitialMean.ranked, temporalState_eq_mean_temporal] + rfl + +theorem initialAlias_eq_mean_alias (B N0 : ℕ) : + initialAlias B N0 = ActualInitialMean.initialAlias B N0 := by + funext n x i + simp only [initialAlias, ActualInitialMean.initialAlias, Pi.add_apply, + primaryState_eq_mean_primary, rankState_eq_mean_ranked] + +theorem initialState_eq_mean_initialized (B N0 : ℕ) : + initialState B N0 = ActualInitialMean.initialized B N0 := by + rw [initialState_eq_bands] + rfl + theorem initialState_error_components (B N0 : ℕ) : (initialState B N0).errors.base = baseError B ∧ (initialState B N0).errors.gaussian = @@ -427,10 +465,12 @@ open scoped ContDiff Topology BigOperators /-- Strip, given by `BaseContextAssembly.nativeStrip ActualPrimary.nominal ActualPrimary.standardRegion`. -/ +@[expose] noncomputable def strip : StripData Point := BaseContextAssembly.nativeStrip ActualPrimary.nominal ActualPrimary.standardRegion /-- Slow strip, constructed using `PhysicalMeanDomain.localSlowStripData`. -/ +@[expose] noncomputable def slowStrip : StripData TorusInverse.Plane := PhysicalMeanDomain.localSlowStripData ActualPrimary.standardRegion.carrier ActualPrimary.standardRegion.isOpen (ChartScales.epsilon ActualPrimary.h) @@ -439,6 +479,7 @@ noncomputable def slowStrip : StripData TorusInverse.Plane := BaseContextAssembly.one_le_slowScale /-- Envelope, given by `ActualPrimaryBounds.meanEnvelope (l.2,l.1)`. -/ +@[expose] noncomputable def envelope {B N0 : ℕ} (l : Index B N0) : ℕ → Point → ℝ := ActualPrimaryBounds.meanEnvelope (l.2,l.1) @@ -688,6 +729,7 @@ open Set Function Filter WeightedClasses CorrectionState CorrectionInitializatio open scoped ContDiff Topology /-- The signed request uses the same active annulus and reserved mean patch. -/ +@[expose] noncomputable def patch : SignedStressPrimitive.Patch where a := PrimaryTargetBounds.leftRadius ActualPrimary.nominal b := PrimaryTargetBounds.rightRadius ActualPrimary.nominal @@ -699,6 +741,7 @@ noncomputable def patch : SignedStressPrimitive.Patch where right_lt_b := ActualPrimary.rank_before_active_right /-- All stages use one moving strip, common index, and pressure gauge. -/ +@[expose] noncomputable def geometry : SignedMeanGain.Geometry where coord := 2 * ActualPrimary.h region := ActualPrimary.standardRegion @@ -805,8 +848,33 @@ theorem exact_pressure_smooth_full {B N0 : ℕ} (l : Index B N0) (n : ℕ) : theorem initial_meanGood (B N0 n : ℕ) {x : Point} (hT : 0 < x.2.1.1) (i : Fin 3) : (initialState B N0).meanGoodResidual (ActualPrimary.commonContext B) n x i = (initialState B N0).reducedMeanResidual (ActualPrimary.commonContext B) n x i - - initialAlias B N0 n x i := - ActualInitialMean.initialized_meanGood B N0 n hT i + initialAlias B N0 n x i := by + obtain ⟨hb, hg, ha⟩ := initialState_error_components B N0 + have hbc : Continuous (fun theta : ℝ => (initialState B N0).errors.base n (x, theta) i) := by + rw [hb] + exact ActualBaseResidual.baseError_angular_continuous ActualPrimary.certificate + ActualPrimary.modulation ActualPrimary.upper B n hT i + have hgc : Continuous (fun theta : ℝ => + (initialState B N0).errors.gaussian n (x, theta) i) := by + rw [hg] + exact continuous_finsetSum _ (fun l _ => gaussian_angularContinuous l n x i) + have hac : Continuous (fun theta : ℝ => + (initialState B N0).errors.aliasError n (x, theta) i) := by + rw [ha] + change Continuous (fun _ : ℝ => initialAlias B N0 n x i) + exact continuous_const + rw [ActualInitialMean.meanGoodResidual_at _ _ n x i hbc hgc hac] + have hgz : HarmonicResidual.realAngularMean + (fun theta => (initialState B N0).errors.gaussian n (x, theta) i) = 0 := by + change CorrectionStep.angularMeanVector (initialState B N0).errors.gaussian n x i = 0 + rw [hg, angularMeanVector_fieldSum _ _ + (fun n l _ x i => gaussian_angularContinuous l n x i)] + simp only [gaussian_mean_zero, Pi.zero_apply, Finset.sum_const_zero] + rw [hgz, sub_zero] + congr 1 + rw [ha] + change HarmonicResidual.realAngularMean (fun _ : ℝ => initialAlias B N0 n x i) = _ + exact HarmonicResidual.realAngularMean_const _ theorem initialAlias_radial (B N0 n : ℕ) (x : Point) : initialAlias B N0 n x 0 = VariableGaugeMean.pressureAliasState ActualPrimary.commonGauge @@ -1087,6 +1155,7 @@ open scoped ContDiff Topology /-- Mean control cell, given by `{x | ∃ k : TorusInverse.Frequency, (x,0) ∈ ActualPrimaryBounds.controlCell n ((l.2,l.1), k)}`. -/ +@[expose] noncomputable def meanControlCell {B N0 : ℕ} (n : ℕ) (l : Index B N0) : Set Point := {x | ∃ k : TorusInverse.Frequency, (x,0) ∈ ActualPrimaryBounds.controlCell n ((l.2,l.1), k)} @@ -1220,6 +1289,7 @@ open Set Function Filter WeightedClasses CorrectionState CorrectionInitializatio open scoped ContDiff Topology /-- Label carrier, given by `ActualInitialExcluded.labelCarrier (l.2, l.1) n`. -/ +@[expose] noncomputable def labelCarrier {B N0 : ℕ} (l : Index B N0) (n : ℕ) : Set Point := ActualInitialExcluded.labelCarrier (l.2, l.1) n @@ -1482,28 +1552,33 @@ open Set Function Filter WeightedClasses CorrectionState CorrectionInitializatio open HarmonicWaveInteraction UniformHarmonicInteraction open scoped ContDiff Topology BigOperators -theorem initial_cumulative (B N0 : ℕ) : CumulativeBounds strip (initialState B N0) := - ActualInitialMean.initial_cumulative_bounds B N0 +theorem initial_cumulative (B N0 : ℕ) : CumulativeBounds strip (initialState B N0) := by + rw [initialState_eq_mean_initialized] + exact ActualInitialMean.initial_cumulative_bounds B N0 theorem initial_mean (B N0 : ℕ) : - MeanResidualBounds strip (1/5) (ActualPrimary.commonContext B) (initialState B N0) := - ActualInitialMean.initial_mean_bounds B N0 + MeanResidualBounds strip (1/5) (ActualPrimary.commonContext B) (initialState B N0) := by + rw [initialState_eq_mean_initialized] + exact ActualInitialMean.initial_mean_bounds B N0 theorem initial_debt (B N0 : ℕ) : - DefectBounds slowStrip (1/5) (ActualPrimary.commonContext B) (initialState B N0) := - ActualInitialMean.initial_debt_bounds B N0 + DefectBounds slowStrip (1/5) (ActualPrimary.commonContext B) (initialState B N0) := by + rw [initialState_eq_mean_initialized] + exact ActualInitialMean.initial_debt_bounds B N0 theorem initial_zeroMasses (B N0 : ℕ) : - GaugeMassPreservation.ZeroMassesOn geometry.region.carrier (initialState B N0) := - ActualInitialMean.initial_zeroMasses B N0 + GaugeMassPreservation.ZeroMassesOn geometry.region.carrier (initialState B N0) := by + rw [initialState_eq_mean_initialized] + exact ActualInitialMean.initial_zeroMasses B N0 theorem initial_covariance (B N0 : ℕ) (i j : Fin 3) : MeanClass strip 1 ((initialState B N0).covariance i j) := by - rw [initialState_covariance] + rw [initialState_covariance, sourceState_eq_mean_seed] exact (ActualInitialMean.covariance_bounds B N0).1 i j -theorem initial_axis_flat (B N0 : ℕ) (beta : ℝ) : MeanClass strip beta (initialAlias B N0) := - ActualInitialExcluded.initialAlias_all_gains B N0 beta +theorem initial_axis_flat (B N0 : ℕ) (beta : ℝ) : MeanClass strip beta (initialAlias B N0) := by + rw [initialAlias_eq_mean_alias] + exact ActualInitialExcluded.initialAlias_all_gains B N0 beta theorem initial_meanHypotheses (B N0 : ℕ) : LiftedMeanResidual.MeanHypotheses strip.domain (ActualPrimary.commonContext B) (initialState B diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualIterationLedger.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualIterationLedger.lean index 1669ea1a8d..e0eb38325a 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 @@ -30,6 +30,7 @@ open scoped Topology ContDiff namespace NavierStokes.ActualIterationLedger /-- Accuracy of the state after this many correction cycles. -/ +@[expose] noncomputable def sigma (J : ℕ) : ℝ := ExponentLedger.stageParameter J /-- The input accuracy used to construct a positive physical increment. @@ -143,14 +144,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`. -/ @@ -250,6 +251,7 @@ theorem fixed_offset_inequalities {h κ : ℝ} (hh : 0 ≤ h) (hκ : κ ≤ 1 / /-! ## Residual indexing after a finite number of cycles -/ /-- Residual wave, given by `ExponentLedger.waveExponent (sigma J)`. -/ +@[expose] noncomputable def residualWave (J : ℕ) : ℝ := ExponentLedger.waveExponent (sigma J) /-- Residual mean, given by `ExponentLedger.meanExponent (sigma J)`. -/ noncomputable def residualMean (J : ℕ) : ℝ := ExponentLedger.meanExponent (sigma J) @@ -309,6 +311,7 @@ theorem gain_after_cycle {h : ℝ} (hh : 0 ≤ h) (n : ℕ) : /-- The full-phase derivative cost is a fixed parameter `beta`, not a stage-dependent loss. -/ +@[expose] noncomputable def residualLoss (h beta : ℝ) (m : ℕ) : ℝ := PhysicalGraphBounds.graphLoss m + 1 + (2 * CoordinateAlgebra.A h + 1 / 2) + beta * m diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualMeanPhysicalData.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualMeanPhysicalData.lean index 2644a6d39a..31c9f34e7b 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 @@ -84,6 +84,7 @@ noncomputable def Geometry.gauge (G : Geometry) : VariableGaugeMean.GaugeData Pl /-- Rank, given by `RankStateBounds.normalizedData (2 * G.h) (CoordinateAlgebra.A G.h) G.rankAmplitude G.rankShape G.rankInner G.rankOuter`. -/ +@[expose] noncomputable def Geometry.rank (G : Geometry) : CorrectionState.RankData Plane := RankStateBounds.normalizedData (2 * G.h) (CoordinateAlgebra.A G.h) G.rankAmplitude G.rankShape G.rankInner G.rankOuter @@ -105,17 +106,20 @@ structure Realizes {ι : Type} (G : Geometry) (p : CycleParameters ι) (c : Cont /-- State band, given by `StateOn (PhysicalMeanDomain.slowDomain V) (bandChartEquiv G.h n m k) (bandVelocityScale G.h n m) (bandScale n m) u u n m`. -/ +@[expose] def StateBand (G : Geometry) (V : Set Plane) (n m k : ℕ) (u : State Point) : Prop := StateOn (PhysicalMeanDomain.slowDomain V) (bandChartEquiv G.h n m k) (bandVelocityScale G.h n m) (bandScale n m) u u n m /-- Context band, given by `ContextOn (PhysicalMeanDomain.slowDomain V) (bandChartEquiv G.h n m k) (bandVelocityScale G.h n m) (bandScale n m) c c n m`. -/ +@[expose] def ContextBand (G : Geometry) (V : Set Plane) (n m k : ℕ) (c : Context Point) : Prop := ContextOn (PhysicalMeanDomain.slowDomain V) (bandChartEquiv G.h n m k) (bandVelocityScale G.h n m) (bandScale n m) c c n m /-- Axis band as an element of `Prop`. -/ +@[expose] def AxisBand (G : Geometry) (V : Set Plane) (n m k : ℕ) (a : AxisymmetricAlias) : Prop := ∀ x ∈ PhysicalMeanDomain.slowDomain V, ∀ i, a n x i = (bandVelocityScale G.h n m * bandVelocityScale G.h n m * bandScale n m) * @@ -775,7 +779,7 @@ end end -@[expose] public section +public section noncomputable section @@ -800,6 +804,7 @@ structure Atlas (h : ℝ) (N Δ : ℕ) where gap_le : ∀ n ≥ N, ChartScales.nativeIndex h n - index n ≤ Δ /-- Gap, given by `ChartScales.nativeIndex h n - A.index n`. -/ +@[expose] noncomputable def Atlas.gap {h : ℝ} {N Δ : ℕ} (A : Atlas h N Δ) (n : ℕ) : ℕ := ChartScales.nativeIndex h n - A.index n @@ -808,6 +813,7 @@ theorem Atlas.index_eq {h : ℝ} {N Δ : ℕ} (A : Atlas h N Δ) {n : ℕ} (hn : Nat.sub_sub_self (A.index_le n hn) /-- Common atlas, bundling `index`, `index_le`, `gap_le`. -/ +@[expose] noncomputable def commonAtlas (h : ℝ) (hh : 0 ≤ h) (N : ℕ) : Atlas h N (CorrectionInitialization.CommonWindow.gap h) where index := CorrectionInitialization.CommonWindow.index h @@ -815,10 +821,12 @@ noncomputable def commonAtlas (h : ℝ) (hh : 0 ≤ h) (N : ℕ) : gap_le n _ := CorrectionInitialization.CommonWindow.gap_le h hh n /-- Chart, given by `VariableGaugeMean.physicalToChartTZ h n (A.index n)`. -/ +@[expose] noncomputable def Atlas.chart {h : ℝ} {N Δ : ℕ} (A : Atlas h N Δ) (n : ℕ) : Point →L[ℝ] Point := VariableGaugeMean.physicalToChartTZ h n (A.index n) /-- Overlap, given by `U ∩ (bandSlowEquiv h n m) ⁻¹' U`. -/ +@[expose] noncomputable def overlap (h : ℝ) (U : Set Plane) (n m : ℕ) : Set Plane := U ∩ (bandSlowEquiv h n m) ⁻¹' U @@ -866,6 +874,7 @@ def Atlas.OverlapLaw {h : ℝ} {N Δ : ℕ} (A : Atlas h N Δ) f n x = (ChartScales.Q n / ChartScales.Q m) ^ degree * f m (bandChartEquiv h n m k x) /-- Valid, given by `N ≤ n ∧ 0 < z.2.1.1 ∧ (A.chart n z).2.1 ∈ U`. -/ +@[expose] def Atlas.Valid {h : ℝ} {N Δ : ℕ} (A : Atlas h N Δ) (U : Set Plane) (z : Point) (n : ℕ) : Prop := N ≤ n ∧ 0 < z.2.1.1 ∧ (A.chart n z).2.1 ∈ U @@ -896,6 +905,7 @@ theorem Atlas.values_eq {h degree : ℝ} {N Δ : ℕ} (A : Atlas h N Δ) · exact (A.values_eq_ordered H hm hn hi).symm /-- Physical, choosing the witness provided by `hz`. -/ +@[expose] noncomputable def Atlas.physical {h : ℝ} {N Δ : ℕ} (A : Atlas h N Δ) (U : Set Plane) (degree : ℝ) (f : Scalar) (z : Point) : ℝ := by classical @@ -915,6 +925,7 @@ theorem Atlas.physical_eq {h degree : ℝ} {N Δ : ℕ} (A : Atlas h N Δ) /-- The physical field is constructed from overlapping valid bands. No reference band is evaluated outside its original slow strip. -/ +@[expose] noncomputable def Atlas.family {h degree : ℝ} {N Δ : ℕ} (A : Atlas h N Δ) {U : Set Plane} {f : Scalar} (H : A.OverlapLaw U degree f) : PhysicalMeanJetBounds.CoherentFamily h degree N Δ U ℝ where @@ -931,6 +942,7 @@ noncomputable def Atlas.family {h degree : ℝ} {N Δ : ℕ} (A : Atlas h N Δ) /-! ## Extracting scalar families from actual state overlap -/ /-- State overlap as an element of `Prop`. -/ +@[expose] def Atlas.StateOverlap {h : ℝ} {N Δ : ℕ} (A : Atlas h N Δ) (U : Set Plane) (u : CorrectionState.State Point) : Prop := ∀ n ≥ N, ∀ m ≥ N, ∀ k, A.index n + k = A.index m → @@ -968,19 +980,23 @@ theorem Atlas.StateOverlap.pressure {h : ℝ} {N Δ : ℕ} {A : Atlas h N Δ} simpa only [velocityScale_square] using (H n hn m hm k hk).pressure x hx /-- Radial family, given by `A.family H.radial`. -/ +@[expose] noncomputable def Atlas.radialFamily {h : ℝ} {N Δ : ℕ} (A : Atlas h N Δ) {U : Set Plane} {u : CorrectionState.State Point} (H : A.StateOverlap U u) := A.family H.radial /-- Angular family, given by `A.family H.angular`. -/ +@[expose] noncomputable def Atlas.angularFamily {h : ℝ} {N Δ : ℕ} (A : Atlas h N Δ) {U : Set Plane} {u : CorrectionState.State Point} (H : A.StateOverlap U u) := A.family H.angular /-- Axial family, given by `A.family H.axial`. -/ +@[expose] noncomputable def Atlas.axialFamily {h : ℝ} {N Δ : ℕ} (A : Atlas h N Δ) {U : Set Plane} {u : CorrectionState.State Point} (H : A.StateOverlap U u) := A.family H.axial /-- Pressure family, given by `A.family H.pressure /-! ## The literal initialized mean and pressure -/ open CorrectionInitialization.ActualPrimary`. -/ +@[expose] noncomputable def Atlas.pressureFamily {h : ℝ} {N Δ : ℕ} (A : Atlas h N Δ) {U : Set Plane} {u : CorrectionState.State Point} (H : A.StateOverlap U u) := A.family H.pressure @@ -990,6 +1006,7 @@ noncomputable def Atlas.pressureFamily {h : ℝ} {N Δ : ℕ} (A : Atlas h N Δ) open CorrectionInitialization.ActualPrimary /-- Initial atlas, given by `commonAtlas h outgoing.data.h_pos.le N`. -/ +@[expose] noncomputable def initialAtlas (N : ℕ) := commonAtlas h outgoing.data.h_pos.le N theorem initialized_overlap (B N0 N : ℕ) : @@ -1000,20 +1017,24 @@ theorem initialized_overlap (B N0 N : ℕ) : /-- Initial radial family, given by `(initialAtlas N).radialFamily (initialized_overlap B N0 N)`. -/ +@[expose] noncomputable def initialRadialFamily (B N0 N : ℕ) := (initialAtlas N).radialFamily (initialized_overlap B N0 N) /-- Initial angular family, given by `(initialAtlas N).angularFamily (initialized_overlap B N0 N)`. -/ +@[expose] noncomputable def initialAngularFamily (B N0 N : ℕ) := (initialAtlas N).angularFamily (initialized_overlap B N0 N) /-- Initial axial family, given by `(initialAtlas N).axialFamily (initialized_overlap B N0 N)`. -/ +@[expose] noncomputable def initialAxialFamily (B N0 N : ℕ) := (initialAtlas N).axialFamily (initialized_overlap B N0 N) /-- Initial pressure family, given by `(initialAtlas N).pressureFamily (initialized_overlap B N0 N)`. -/ +@[expose] noncomputable def initialPressureFamily (B N0 N : ℕ) := (initialAtlas N).pressureFamily (initialized_overlap B N0 N) @@ -1245,12 +1266,14 @@ theorem initial_temporalState_overlap (B N0 N : ℕ) : (ActualInitialCoherence.seed_band B N0 n m k hk inter_subset_left (fun _ hx => hx.2)) /-- Initial temporal scalar, constructed using `VariableGaugeMean.temporalPotential`. -/ +@[expose] noncomputable def initialTemporalScalar (B N0 : ℕ) : Scalar := VariableGaugeMean.temporalPotential commonGauge h (CorrectionInitialization.CommonWindow.index h) (commonContext B) (ActualInitialCoherence.primary B N0) /-- Initial rank scalar, given by `VariableGaugeMean.rankPotential commonGauge rankData (commonContext B) (ActualInitialCoherence.temporal B N0)`. -/ +@[expose] noncomputable def initialRankScalar (B N0 : ℕ) : Scalar := VariableGaugeMean.rankPotential commonGauge rankData (commonContext B) (ActualInitialCoherence.temporal B N0) @@ -1278,10 +1301,12 @@ theorem initialRank_overlap (B N0 N : ℕ) : /-- Initial temporal family, given by `(initialAtlas N).family (initialTemporal_overlap B N0 N)`. -/ +@[expose] noncomputable def initialTemporalFamily (B N0 N : ℕ) := (initialAtlas N).family (initialTemporal_overlap B N0 N) /-- Initial rank family, given by `(initialAtlas N).family (initialRank_overlap B N0 N)`. -/ +@[expose] noncomputable def initialRankFamily (B N0 N : ℕ) := (initialAtlas N).family (initialRank_overlap B N0 N) @@ -1491,19 +1516,23 @@ theorem stage_transport (j : ℕ) (n : ℕ) (hn : N ≤ n) (m : ℕ) (hm : N ≤ /-- Radial family, given by `D.atlas.radialFamily (D.state_overlap j)`. -/ noncomputable def radialFamily (j : ℕ) := D.atlas.radialFamily (D.state_overlap j) /-- Angular family, given by `D.atlas.angularFamily (D.state_overlap j)`. -/ +@[expose] noncomputable def angularFamily (j : ℕ) := D.atlas.angularFamily (D.state_overlap j) /-- Axial family, given by `D.atlas.axialFamily (D.state_overlap j)`. -/ noncomputable def axialFamily (j : ℕ) := D.atlas.axialFamily (D.state_overlap j) /-- Pressure family, given by `D.atlas.pressureFamily (D.state_overlap j)`. -/ +@[expose] noncomputable def pressureFamily (j : ℕ) := D.atlas.pressureFamily (D.state_overlap j) /-- Temporal scalar, constructed using `VariableGaugeMean.temporalPotential`. -/ +@[expose] noncomputable def temporalScalar (_D : CycleData G N Δ p c seed U) (j : ℕ) : Scalar := VariableGaugeMean.temporalPotential (p j).gauge (p j).timeExponent (p j).commonIndex c ((p j).afterSigned (CycleState.iterate p c seed j).coefficients c (CycleState.iterate p c seed j).state) /-- Rank scalar, constructed using `VariableGaugeMean.rankPotential`. -/ +@[expose] noncomputable def rankScalar (_D : CycleData G N Δ p c seed U) (j : ℕ) : Scalar := VariableGaugeMean.rankPotential (p j).gauge (p j).rank c ((p j).afterTemporal (CycleState.iterate p c seed j).coefficients c (CycleState.iterate p c @@ -1541,8 +1570,10 @@ theorem rankScalar_overlap (j : ℕ) : (D.stage_primitives j).rankGeometry /-- Temporal family, given by `D.atlas.family (D.temporalScalar_overlap j)`. -/ +@[expose] noncomputable def temporalFamily (j : ℕ) := D.atlas.family (D.temporalScalar_overlap j) /-- Rank family, given by `D.atlas.family (D.rankScalar_overlap j)`. -/ +@[expose] noncomputable def rankFamily (j : ℕ) := D.atlas.family (D.rankScalar_overlap j) theorem temporal_moving (j : ℕ) : @@ -1589,6 +1620,7 @@ end CycleData /-- Initial geometry, bundling `h`, `inner`, `outer`, `frequency` and the required compatibility proofs. -/ +@[expose] noncomputable def initialGeometry : CycleStateCoherence.Geometry where h := h inner := PrimaryTargetBounds.leftRadius nominal @@ -1654,6 +1686,7 @@ structure InitialCycleInput (B N0 N : ℕ) /-- Initial cycle data, bundling `atlas`, `index_eq`, `realizes`, `context` and the required compatibility proofs. -/ +@[expose] noncomputable def initialCycleData {B N0 N : ℕ} {p : ℕ → CycleParameters (ActualInitialization.Index B N0)} (H : InitialCycleInput B N0 N p) : CycleData initialGeometry N (CorrectionInitialization.CommonWindow.gap h) p (commonContext B) @@ -1715,6 +1748,7 @@ theorem Atlas.physical_sub {h : ℝ} {N Δ : ℕ} (A : Atlas h N Δ) /-- Initial stream family, given by `(initialAtlas N).family ((initialTemporal_overlap B N0 N).add (initialRank_overlap B N0 N))`. -/ +@[expose] noncomputable def initialStreamFamily (B N0 N : ℕ) := (initialAtlas N).family ((initialTemporal_overlap B N0 N).add (initialRank_overlap B N0 N)) @@ -1737,16 +1771,19 @@ variable {ι : Type} {G : CycleStateCoherence.Geometry} {N Δ : ℕ} /-- Stream family, given by `D.atlas.family ((D.temporalScalar_overlap j).add (D.rankScalar_overlap j))`. -/ +@[expose] noncomputable def streamFamily (j : ℕ) := D.atlas.family ((D.temporalScalar_overlap j).add (D.rankScalar_overlap j)) /-- Angular increment family, given by `D.atlas.family (((D.state_overlap (j+1)).angular).sub ((D.state_overlap j).angular))`. -/ +@[expose] noncomputable def angularIncrementFamily (j : ℕ) := D.atlas.family (((D.state_overlap (j+1)).angular).sub ((D.state_overlap j).angular)) /-- Pressure increment family, given by `D.atlas.family (((D.state_overlap (j+1)).pressure).sub ((D.state_overlap j).pressure))`. -/ +@[expose] noncomputable def pressureIncrementFamily (j : ℕ) := D.atlas.family (((D.state_overlap (j+1)).pressure).sub ((D.state_overlap j).pressure)) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualMeanPotentialRealization.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualMeanPotentialRealization.lean index be352546b3..65b3d754a2 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 @@ -35,10 +35,11 @@ abbrev Cylinder := PhysicalResidualTZ.Cylinder abbrev ScaledGraph := PhysicalResidualBridge.ScaledGraph /-- Axial, given by `((0, 1), 0)`. -/ +@[expose] 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 +221,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..633bbc5dc6 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 @@ -182,6 +182,7 @@ theorem coefficient_vanishes (D : PhysicalMeanJetBounds.CoherentFamily h degree /-- Coherent angular data, bundling `scalar`, `smooth`, `inner`, `inner_continuous` and the required compatibility proofs. -/ +@[expose] noncomputable def coherentAngularData (D : PhysicalMeanJetBounds.CoherentFamily h degree N Δ U ℝ) (hh : 0 < h) (hh1 : h < 1 / 2) {a b : ℝ} (ha : 0 < a) (hab : a < b) (hU : IsOpen U) @@ -228,6 +229,7 @@ theorem nativeSupport_of_moving fun n _ z hz hne => Hm.supported n z hz hne /-- Actual angular data, constructed using `coherentAngularData`. -/ +@[expose] noncomputable def actualAngularData (D : PhysicalMeanJetBounds.CoherentFamily h degree N Δ standardRegion.carrier ℝ) (Hm : GaugeMomentBalances.MovingField standardRegion commonGauge.radial.inner diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualParticularCoherence.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualParticularCoherence.lean index 10abf14413..f4d99117b3 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 @@ -690,6 +690,7 @@ abbrev Cylinder := PhysicalParticularWave.Cylinder /-- The full native change of variables, conjugate to the actual cylindrical change of band and common cover. -/ +@[expose] noncomputable def waveChange (h Q Qr : ℝ) (gap : ℕ) : WaveSpace →L[ℝ] WaveSpace := PhysicalParticularWave.waveEquiv.toContinuousLinearEquiv.toContinuousLinearMap.comp ((PhysicalParticularWave.cylinderChange h Q Qr gap).comp @@ -1105,7 +1106,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 +1355,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1371,7 +1372,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 @@ -1381,6 +1382,7 @@ noncomputable def copyData (x : CorrectionStep.CycleState (Label B N0)) (ActualParticularStageControls.assembly x l).aliasInput j /-- Corrected, constructed using `ActualParticularRealization.corrected`. -/ +@[expose] noncomputable def corrected (x : CorrectionStep.CycleState (Label B N0)) (l : Label B N0) (j : ℤ) : LinearWaveBounds.WaveCoefficients WaveSpace := ActualParticularRealization.corrected (ActualParticularStageControls.assembly x l) @@ -1918,6 +1920,7 @@ theorem parameter_cutoff_support (x : CorrectionStep.CycleState (Label B N0)) exact hh /-- Source, constructed using `ParticularWaveAssembly.residualSource`. -/ +@[expose] noncomputable def source (x : CorrectionStep.CycleState (Label B N0)) (l : Label B N0) (j : ℤ) (n : ℕ) : Parameter × Plane → ComplexVector := ParticularWaveAssembly.residualSource (ActualParticularStageControls.assembly x l).context @@ -2366,6 +2369,7 @@ theorem raw_outputs (x : CorrectionStep.CycleState (Label B N0)) (l : Label B N0 gaussian_zero x l j n z.1.1 hn, gaussian_zero x l j m _ hm, smul_zero, and_self] /-- Wave domain, given by `{z | z.1.1.2 ∈ V}`. -/ +@[expose] noncomputable def waveDomain (V : Set Plane) : Set WaveSpace := {z | z.1.1.2 ∈ V} theorem waveDomain_open {V : Set Plane} (hV : IsOpen V) : IsOpen (waveDomain V) := diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualParticularCycleData.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualParticularCycleData.lean index 4613ea76a0..235725da0f 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 @@ -162,6 +162,7 @@ open scoped ContDiff Topology InnerProductSpace BigOperators variable {B N0 : ℕ} /-- Primary carrier as an element of `HarmonicBlock CyclePoint`. -/ +@[expose] noncomputable def primaryCarrier (l : Label B N0) : HarmonicBlock CyclePoint := (ActualPrimary.piece ActualPrimary.standardRegion l.1 l.2).tangentBlock (fun n x => (ActualPrimary.chartCoefficients l.1 l.2).phase n (x,0)) @@ -221,6 +222,7 @@ theorem normalWeight_eq (l : Label B N0) (n : ℕ) (j : ℤ) (hj : j ≠ 0) : ActualPrimaryDynamics.radialScale_eq] /-- Data used in actual particular dynamics. -/ +@[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 @@ -962,10 +964,20 @@ theorem controlPatch_geometry (x : CycleState (Label B N0)) (l : Label B N0) N0).prepared.N).carrier l.2 ∧ (referencePoint l n k z).2.2 ∈ Ioo 0 ((ActualPrimary.phases B N0 l.1).L l.2) ∧ (referencePoint l n k z).2 ∈ (ActualPrimary.clockWindow l.2).core := by + have hnative : z ∈ (ParticularParameters.nativeStrip associatedStrip).domain := by + rw [← ActualParticularStageControls.nativeStrip_eq] + change z.1.1 ∈ slowStrip.domain + exact hz.2.1.1 have hp := ActualPrimaryCoherence.piece_domain_positive ActualPrimary.standardRegion (show nativeToFull z ∈ (HarmonicWaveInteraction.productStrip (BaseContextAssembly.nativeStrip ActualPrimary.nominal ActualPrimary.standardRegion)).domain - from hz.2.1.1) + from by + rw [native_strip_eq] at hnative + change nativeToFull z ∈ + (HarmonicWaveInteraction.productStrip + (BaseContextAssembly.nativeStrip ActualPrimary.nominal + ActualPrimary.standardRegion)).domain at hnative + exact hnative) have hslow : (referencePoint l n k z).1 ∈ (PrimaryGeometryAssembly.domain ActualPrimary.nominal (ActualPrimary.choice B N0).prepared.N).carrier l.2 := @@ -1174,6 +1186,7 @@ theorem SupportData.localized_alternative {x : CycleState (Label B N0)} · exact Or.inr (localized_zero_of_fields _ ha hp) /-- Actual wave used in actual particular dynamics. -/ +@[expose] noncomputable def actualWave (x : CycleState (Label B N0)) (l : Label B N0) (j : ℤ) := (parameters x l).wave associatedStrip (assembly x l).context (assembly x l).state (assembly x l).carrierBlock (assembly x l).gaussianInput (assembly x l).aliasInput j @@ -1275,7 +1288,9 @@ theorem common_smooth {x : CycleState (Label B N0)} (Hc : PreservesCarriers x) rcases S.localized_alternative hz hk with hc | ⟨_,hp⟩ · have hr := (ActualParticularStageControls.raw_jets x (carrier_frequency Hc) j hj Hs).2 exact (Complex.ofRealCLM.contDiff.contDiffAt.comp z - (native_cutoff_smooth x l j n k).contDiffAt).mul (hr.smooth l n k z hz hc) + (native_cutoff_smooth x l j n k).contDiffAt).mul + (hr.smooth l n k z (by + simpa only [ActualParticularStageControls.nativeStrip_eq] using hz) hc) · exact contDiffAt_const.congr_of_eventuallyEq hp exact hn.congr_of_eventuallyEq ((data x l j).common_pressure_germ S.cells S.cutoff_support n hk) @@ -1441,7 +1456,8 @@ noncomputable def supportData (x : CycleState (Label B N0)) SupportData x l j where cells := ActualParticularStageControls.carrierCells l cutoff_support := ActualParticularStageControls.data_cutoff_support x l j - cover n k _ hz hk := ActualParticularStageControls.data_control_alternative x hs hN l j n k hz hk + cover n k _ hz hk := ActualParticularStageControls.data_control_alternative x hs hN l j n k + (by simpa only [ActualParticularStageControls.nativeStrip_eq] using hz) hk theorem source_phase_smooth {x : CycleState (Label B N0)} (Hc : PreservesCarriers x) (l : Label B N0) (n : ℕ) : @@ -1894,7 +1910,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 @@ -1909,6 +1925,7 @@ variable {B N0 : ℕ} /-- Native strip, given by `CommonCoverClass.sourceStrip (ActualParticularControl.angleStrip slowStrip)`. -/ +@[expose] noncomputable def nativeStrip : StripData Native := CommonCoverClass.sourceStrip (ActualParticularControl.angleStrip slowStrip) @@ -2139,6 +2156,18 @@ theorem gaussianBlock_all_gains (x : CycleState (Label B N0)) (assembly x l).carrierBlock (assembly x l).gaussianInput (assembly x l).aliasInput N).velocity n i m z) := by + have hstrip : nativeStrip = UniformBlockBounds.nativeStrip associatedStrip := by + rw [nativeStrip, ActualParticularStageControls.nativeStrip_eq] + rfl + have hζ (z : Parameter × TorusInverse.Plane) : + nativeStrip.zeta (ParticularWaveAssembly.angleShuffle (z, 0)) = + associatedStrip.zeta z := by + rw [hstrip] + have he := congrArg (fun s : StripData (Parameter × TorusInverse.Plane) => s.zeta z) + (UniformBlockBounds.sectionStrip_nativeStrip associatedStrip) + change (UniformBlockBounds.nativeStrip associatedStrip).zeta + (ParticularWaveAssembly.angleShuffle (z, 0)) = associatedStrip.zeta z at he + exact he have hh := UniformBlockBounds.native_assembledBlock_original_uniform (s := associatedStrip) (w := fun (_ : Label B N0) (_ : ℕ) z => Real.sqrt (nativeStrip.zeta z)) @@ -2149,10 +2178,22 @@ theorem gaussianBlock_all_gains (x : CycleState (Label B N0)) (v := fun l j => (data x l j).globalGaussian (directions (B := B))) (p := fun _ _ _ _ => (0 : ℂ)) (fun _ _ _ _ => Real.sqrt_nonneg _) - (fun j hj => globalGaussian_all_gains x hfrequency hs hN j - ((ParticularWaveAssembly.mem_modes N j).mp hj).1 (H j hj) β) + (fun j hj => by + rw [← hstrip] + exact globalGaussian_all_gains x hfrequency hs hN j + ((ParticularWaveAssembly.mem_modes N j).mp hj).1 (H j hj) β) (fun _ _ => LabelSumBounds.UniformClass.zero (fun _ _ _ _ => Real.sqrt_nonneg _)) - exact hh.1 i m + have hw : + (fun (_ : Label B N0) (_ : ℕ) z => + Real.sqrt (nativeStrip.zeta (ParticularWaveAssembly.angleShuffle (z, 0)))) = + (fun (_ : Label B N0) (_ : ℕ) z => Real.sqrt (associatedStrip.zeta z)) := by + funext l n z + exact congrArg Real.sqrt (hζ z) + have h := hh.1 i m + rw [hw] at h + have hdir (l : Label B N0) : (parameters x l).directions = directions (B := B) := by + rfl + simpa only [ParticularParameters.gaussianBlock, ActualParticularStageControls.data, hdir] using h end NavierStokes.ActualParticularGaussian @@ -2161,7 +2202,7 @@ end end -@[expose] public section +public section noncomputable section @@ -2260,6 +2301,7 @@ section NativeData variable {B N0 : ℕ} {σ : ℝ} {x : CycleState (Index B N0)} /-- Native data used in actual particular cycle data. -/ +@[expose] noncomputable def nativeData (x : CycleState (Index B N0)) (l : Index B N0) (j : ℤ) := (ActualParticularStageControls.canonicalParameters (l.2,l.1)).copyData (StateReindex.context cycleAssoc.symm (ActualPrimary.commonContext B)) @@ -2477,6 +2519,8 @@ theorem native_raw_class (H : Invariant σ x) (hN : ActualCarrierGeometry.geomet have ha := (ActualParticularStageControls.common_bounds _ (preservesCarriers H) (native_inputSupport H) hN j hj (native_source_class H j hj)).1.each (l.2,l.1) rw [← nativeData_eq_data H l j] at ha + rw [ActualParticularStageControls.nativeStrip_eq, + ← ActualWaveRegularityData.particularFullStrip_eq] at ha exact ha.mono_weight (fun _ _ _ => Real.sqrt_nonneg _) (fun n z _ => mul_le_of_le_one_right (Real.sqrt_nonneg _) (native_envelope_le_one l n z)) @@ -2489,6 +2533,8 @@ theorem native_pressure_class (H : Invariant σ x) (hN : ActualCarrierGeometry.g have hp := (ActualParticularStageControls.common_bounds _ (preservesCarriers H) (native_inputSupport H) hN j hj (native_source_class H j hj)).2.2.1.each (l.2,l.1) rw [← nativeData_eq_data H l j] at hp + rw [ActualParticularStageControls.nativeStrip_eq, + ← ActualWaveRegularityData.particularFullStrip_eq] at hp exact hp.mono_weight (fun _ _ _ => Real.sqrt_nonneg _) (fun n z _ => mul_le_of_le_one_right (Real.sqrt_nonneg _) (native_envelope_le_one l n z)) @@ -2502,7 +2548,15 @@ theorem native_gaussian_class (H : Invariant σ x) (hN : ActualCarrierGeometry.g have hg := (ActualParticularGaussian.globalGaussian_all_gains _ (fun l => ActualCycleParameters.current_frequency x (l.2,l.1) (H.carrier (l.2,l.1))) (native_inputSupport H) hN j hj (native_source_class H j hj) β).each (l.2,l.1) - rwa [← nativeData_eq_data H l j] at hg + rw [← nativeData_eq_data H l j, + ActualParticularGaussian.nativeStrip, + ActualParticularStageControls.nativeStrip_eq, + ← ActualWaveRegularityData.particularFullStrip_eq] at hg + have hdir : + (ActualParticularStageControls.canonicalParameters (l.2, l.1)).directions = + ActualParticularStageControls.directions := rfl + rw [hdir] + exact hg theorem native_raw_smooth (H : Invariant σ x) (hN : ActualCarrierGeometry.geometricThreshold ≤ N0) (l : Index B N0) (j : ℤ) (hj : j ≠ 0) (n : ℕ) : @@ -2563,6 +2617,7 @@ theorem native_source_periodic (H : Invariant σ x) (T : ActualCyclePeriodicity. (fun l n hn j _ hz => source_inactive H l n hn j hz) l j n z hz /-- Native mode, constructed using `ActualWaveRegularity.modeOscillation`. -/ +@[expose] noncomputable def nativeMode (x : CycleState (Index B N0)) (l : Index B N0) (j : ℤ) := ActualWaveRegularity.modeOscillation (nativeData x l j) ActualWaveRegularityData.particularFullStrip @@ -2591,14 +2646,45 @@ theorem native_mode_periodic (H : Invariant σ x) (T : ActualCyclePeriodicity.Pe theorem block_eq_modes (H : Invariant σ x) (l : Index B N0) : (block x l).oscillation = LabelSumBounds.fieldSum - (fun _ => ParticularWaveAssembly.modes x.coefficients.residualBand) (nativeMode x l) := - ActualWaveRegularity.particularBlock_eq_modes (parameters B N0) x.coefficients + (fun _ => ParticularWaveAssembly.modes x.coefficients.residualBand) (nativeMode x l) := by + have hcopy (j : ℤ) : + ActualWaveRegularity.particularCopyData (parameters B N0) x.coefficients + (ActualPrimary.commonContext B) x.state l j = nativeData x l j := by + unfold ActualWaveRegularity.particularCopyData nativeData + rw [ActualCycleParameters.fixedParameters_particular] + have hstrip : + ActualWaveRegularity.particularStrip (parameters B N0) = + ActualWaveRegularityData.particularFullStrip := by + rw [ActualWaveRegularity.particularStrip, + ActualCycleParameters.fixedParameters_strip, + ActualInitialization.geometry_strip, + ActualWaveRegularityData.particularFullStrip_eq] + rfl + have hdir : + ((parameters B N0).particular l).directions = + (ActualParticularStageControls.canonicalParameters (l.2, l.1)).directions := by + rw [ActualCycleParameters.fixedParameters_particular] + have hmode : + (fun j => ActualWaveRegularity.modeOscillation + (ActualWaveRegularity.particularCopyData (parameters B N0) x.coefficients + (ActualPrimary.commonContext B) x.state l j) + (ActualWaveRegularity.particularStrip (parameters B N0)) + ((parameters B N0).particular l).directions + ActualWaveRegularity.particularChart) = nativeMode x l := by + funext j + unfold nativeMode + rw [hcopy j, hstrip, hdir] + change ((parameters B N0).particularBlock x.coefficients + (ActualPrimary.commonContext B) x.state l).oscillation = _ + refine (ActualWaveRegularity.particularBlock_eq_modes (parameters B N0) x.coefficients (ActualPrimary.commonContext B) x.state l (fun n => (ActualParticularDynamics.native_angular (ActualCycleParameters.particularState x) (l.2,l.1) 1 n 0).radius) (fun n => (ActualParticularDynamics.native_angular (ActualCycleParameters.particularState x) (l.2,l.1) 1 n 0).radial_field) - (H.frequency l) + (H.frequency l)).trans ?_ + exact congrArg (LabelSumBounds.fieldSum + (fun _ => ParticularWaveAssembly.modes x.coefficients.residualBand)) hmode theorem block_regular (H : Invariant σ x) (T : ActualCyclePeriodicity.Periodic x) (hN : ActualCarrierGeometry.geometricThreshold ≤ N0) (l : Index B N0) : @@ -2773,6 +2859,7 @@ theorem block_eq_output (H : Invariant σ x) (l : Index B N0) : /-- Good block, given by `ActualParticularStageControls.outputGood (ActualCycleParameters.particularState x) x.coefficients.residualBand (l.2,l.1)`. -/ +@[expose] noncomputable def goodBlock (x : CycleState (Index B N0)) (l : Index B N0) := ActualParticularStageControls.outputGood (ActualCycleParameters.particularState x) x.coefficients.residualBand (l.2,l.1) 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..4507f287c4 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 @@ -89,6 +89,7 @@ theorem realizedCoefficient_phase_germ {Φ Ψ : E → ℝ} {x : E} (hΦ : Φ = end Reindex /-- Raw as an element of `LinearWaveBounds.WaveCoefficients WaveSpace`. -/ +@[expose] noncomputable def raw (D : AssemblyData Parameter) (h : ℝ) (gap : ℕ → ℕ) (j : ℤ) : LinearWaveBounds.WaveCoefficients WaveSpace := ((CorrectionStep.ParticularParameters.fromReference D h gap).copyData @@ -96,6 +97,7 @@ noncomputable def raw (D : AssemblyData Parameter) (h : ℝ) (gap : ℕ → ℕ) /-- Corrected, given by `(CorrectionStep.ParticularParameters.fromReference D h gap).wave s D.context D.state D.carrierBlock D.gaussianInput D.aliasInput j`. -/ +@[expose] noncomputable def corrected (D : AssemblyData Parameter) (s : WeightedClasses.StripData Associated) (h : ℝ) (gap : ℕ → ℕ) (j : ℤ) : LinearWaveBounds.WaveCoefficients WaveSpace := (CorrectionStep.ParticularParameters.fromReference D h gap).wave s @@ -259,6 +261,7 @@ end Band /-! ## The literal finite harmonic block -/ /-- Block as an element of `HarmonicBlock Associated`. -/ +@[expose] noncomputable def block (D : AssemblyData Parameter) (s : WeightedClasses.StripData Associated) (h : ℝ) (gap : ℕ → ℕ) (N : ℕ) : HarmonicBlock Associated := (CorrectionStep.ParticularParameters.fromReference D h gap).updateBlock s @@ -266,6 +269,7 @@ noncomputable def block (D : AssemblyData Parameter) (s : WeightedClasses.StripD /-- Cylindrical coordinates with the cycle's slow-coordinate order and the association used by the harmonic coefficient block. -/ +@[expose] noncomputable def associatedCylinder : Cylinder ≃ₗᵢ[ℝ] (Associated × ℝ) := StateReindex.cylinder PhysicalResidualNaturality.associatedToLift.symm @@ -518,6 +522,7 @@ end Physical /-! ## The cycle's actual coordinate layout -/ /-- Cycle block, given by `StateReindex.block CorrectionStep.cycleAssoc (block D s h gap N)`. -/ +@[expose] noncomputable def cycleBlock (D : AssemblyData Parameter) (s : WeightedClasses.StripData Associated) (h : ℝ) (gap : ℕ → ℕ) (N : ℕ) : HarmonicBlock CorrectionStep.CyclePoint := StateReindex.block CorrectionStep.cycleAssoc (block D s h gap N) @@ -816,6 +821,7 @@ theorem liftCoefficient_smooth : /-- The same reference corrected wave as a function of all free lifted variables. No graph evaluation occurs in this definition. -/ +@[expose] noncomputable def referenceLiftVelocity (D : AssemblyData Parameter) (h Qr : ℝ) (I : ℕ) (j : ℤ) : Cylinder → ComplexVector := vectorMode (referenceFrequency D j) (liftPhase D j) @@ -895,6 +901,7 @@ theorem bandVelocity_eq_reference {x : Cylinder} (hx : x ∈ bandDomain D h Q Qr end FullBand /-- Reference lift pressure, constructed using `mode`. -/ +@[expose] noncomputable def referenceLiftPressure (D : AssemblyData Parameter) (j : ℤ) : Cylinder → ℂ := mode (PhysicalParticularWave.referenceFrequency D j) (PhysicalParticularWave.liftPhase D j) (fun x => PhysicalParticularWave.referenceRawPressure D j (PhysicalParticularWave.waveEquiv x)) @@ -1003,7 +1010,8 @@ theorem block_velocity_eq_reference {N : ℕ} {α κ : ℝ} (C : D.controls N α (gap n) x)) k := by rw [block_velocity_represents D s h gap (fun j hj => hstrip ▸ (C j hj).background) hf] rw [(AssemblyData.update_represents C).1] - change (∑ j ∈ modes N, _) = _ * (∑ j ∈ modes N, _) + change (∑ j ∈ modes N, (_ : ℝ)) = + (_ : ℝ) * (∑ j ∈ modes N, (_ : ℝ)) rw [Finset.mul_sum] apply Finset.sum_congr rfl intro j hj @@ -1025,7 +1033,8 @@ theorem block_pressure_eq_reference {N : ℕ} {α κ : ℝ} (C : D.controls N α (gap n) x)) := by rw [block_pressure_represents D s h gap (fun j hj => (C j hj).harmonic_ne) hf] rw [(AssemblyData.update_represents C).2] - change (∑ j ∈ modes N, _) = _ * (∑ j ∈ modes N, _) + change (∑ j ∈ modes N, (_ : ℝ)) = + (_ : ℝ) * (∑ j ∈ modes N, (_ : ℝ)) rw [Finset.mul_sum] apply Finset.sum_congr rfl intro j hj diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualParticularStageControls.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualParticularStageControls.lean index 3f61bdaf9b..469fc1fe77 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 @@ -141,6 +141,7 @@ theorem inputBounds_reindex (e : D ≃ₗᵢ[ℝ] E) {s : StripData E} /-- This operation changes only the harmonic frequency and sets the two unknown coefficients to zero. In particular its actual normal and defect are unchanged. -/ +@[expose] noncomputable def zeroRescale (q : ℝ) (a : WaveFamily D I) : WaveFamily D I := { a with amplitude := fun _ _ _ => 0 @@ -203,6 +204,7 @@ abbrev Native := (Parameter × ℝ) × TorusInverse.Plane /-- Native to full, given by `ParticularWaveAssembly.angleShuffle.symm.trans (StateReindex.cylinder cycleAssoc.symm)`. -/ +@[expose] noncomputable def nativeToFull : Native ≃ₗᵢ[ℝ] ActualPrimary.FullPoint := ParticularWaveAssembly.angleShuffle.symm.trans (StateReindex.cylinder cycleAssoc.symm) @@ -221,6 +223,7 @@ noncomputable def directions (B : ℕ) : GraphDirections Native := ParticularWaveBounds.reindexDirections nativeToFull (ActualPrimaryBounds.directions B) /-- Primary block as an element of `HarmonicBlock CyclePoint`. -/ +@[expose] noncomputable def primaryBlock {B N0 : ℕ} (l : Label B N0) : HarmonicBlock CyclePoint := (ActualPrimary.piece ActualPrimary.standardRegion l.1 l.2).tangentBlock (fun n z => (ActualPrimary.chartCoefficients l.1 l.2).phase n (z, 0)) @@ -228,6 +231,7 @@ noncomputable def primaryBlock {B N0 : ℕ} (l : Label B N0) : HarmonicBlock Cyc (ActualPrimary.choice B N0).prepared l.1 l.2) /-- Carrier, constructed using `ParticularWaveAssembly.actualCarrier`. -/ +@[expose] noncomputable def carrier {B N0 : ℕ} (b : Label B N0 → HarmonicBlock CyclePoint) (j : ℤ) (l : Label B N0) : WaveCoefficients Native := ParticularWaveAssembly.actualCarrier @@ -237,6 +241,7 @@ noncomputable def carrier {B N0 : ℕ} (b : Label B N0 → HarmonicBlock CyclePo /-- Background family, given by `WaveFamily.ofCoefficients (fun i => ParticularWaveBounds.zeroAmplitudes (carrier b j i.1))`. -/ +@[expose] noncomputable def backgroundFamily {B N0 : ℕ} (b : Label B N0 → HarmonicBlock CyclePoint) (j : ℤ) : WaveFamily Native (CopyIndex B N0) := WaveFamily.ofCoefficients (fun i => ParticularWaveBounds.zeroAmplitudes (carrier b j i.1)) @@ -385,7 +390,7 @@ end end -@[expose] public section +public section noncomputable section @@ -399,6 +404,7 @@ open scoped Topology ContDiff variable {B N0 : ℕ} /-- Padded cell as an element of `Set ActualPrimary.FullPoint`. -/ +@[expose] noncomputable def paddedCell (n : ℕ) (i : CopyIndex B N0) : Set ActualPrimary.FullPoint := {x | near i.1 n ∧ (fullCopy i.1 n i.2 x).1 ∈ @@ -407,6 +413,7 @@ noncomputable def paddedCell (n : ℕ) (i : CopyIndex B N0) : Set ActualPrimary. (fullCopy i.1 n i.2 x).2 ∈ (ActualPrimary.clockWindow i.1.2).core} /-- Cells, given by `ActualParticularBackground.nativeToFull ⁻¹' paddedCell n i`. -/ +@[expose] noncomputable def cells (n : ℕ) (i : CopyIndex B N0) : Set ActualParticularBackground.Native := ActualParticularBackground.nativeToFull ⁻¹' paddedCell n i @@ -759,7 +766,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 @@ -840,6 +847,7 @@ section NativeCoordinates variable {P : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] /-- Argument, given by `(χ x.1, (g.coordinates k x.2).2)`. -/ +@[expose] noncomputable def argument (χ : P →L[ℝ] Slow) (g : Geometry) (k : Frequency) (x : P × Plane) : Slow × ℝ := (χ x.1, (g.coordinates k x.2).2) @@ -896,6 +904,7 @@ variable {Label P : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] /-- Tangent, given by `PrimaryCopyBridge.frameTangentData (nativeFrame (ScaledActualParticularControl.frame F φ clock normal (l,n)) χ) j (source l n)`. -/ +@[expose] noncomputable def tangent (source : Label → ℕ → P × Plane → Space) (j : ℤ) (l : Label) (n : ℕ) : TangentData P Space := PrimaryCopyBridge.frameTangentData @@ -1065,7 +1074,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 @@ -1088,18 +1097,22 @@ abbrev Index (B N0 : ℕ) := ActualPrimary.Label B N0 × Fin 2 variable {B N0 : ℕ} /-- Domain, given by `PhysicalMeanDomain.slowDomain standardRegion.carrier`. -/ +@[expose] noncomputable def domain : Set Point := PhysicalMeanDomain.slowDomain standardRegion.carrier /-- Label carrier, given by `ActualInitialExcluded.labelCarrier (l.2,l.1) n`. -/ +@[expose] noncomputable def labelCarrier (l : Index B N0) (n : ℕ) : Set Point := ActualInitialExcluded.labelCarrier (l.2,l.1) n /-- Associated point, given by `CorrectionStep.cycleAssoc.symm (p, Y)`. -/ +@[expose] noncomputable def associatedPoint (p : Parameter) (Y : Plane) : Point := CorrectionStep.cycleAssoc.symm (p, Y) /-- Parameter domain, given by `{p | p.2 ∈ standardRegion.carrier}`. -/ +@[expose] noncomputable def parameterDomain : Set Parameter := {p | p.2 ∈ standardRegion.carrier} @@ -1112,6 +1125,7 @@ noncomputable def Ordered (l : Index B N0) (n : ℕ) : Prop := CommonWindow.index h n ≤ ChartScales.nativeIndex h (BaseChartJets.cellBand l.1) /-- Slow map, given by `nativeSlow l.1 (toAbsolute n (associatedPoint p 0))`. -/ +@[expose] noncomputable def slowMap (l : Index B N0) (n : ℕ) (p : Parameter) : PhaseCalculus.Slow := nativeSlow l.1 (toAbsolute n (associatedPoint p 0)) @@ -1133,7 +1147,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 := @@ -1141,6 +1155,7 @@ theorem referenceLength_pos (l : Index B N0) : 0 < referenceLength l := /-- Clock, given by `PhysicalParticularWave.clockWeight h (ChartScales.Q n) (ChartScales.Q (BaseChartJets.cellBand l.1))`. -/ +@[expose] noncomputable def clock (l : Index B N0) (n : ℕ) : ℝ := PhysicalParticularWave.clockWeight h (ChartScales.Q n) (ChartScales.Q (BaseChartJets.cellBand l.1)) @@ -1150,21 +1165,24 @@ theorem clock_pos (l : Index B N0) (n : ℕ) : 0 < clock l n := /-- Spatial label, given by `PartitionedCovariance.signedLabel (PrimaryGeometryAssembly.label nominal l.1) l.2`. -/ +@[expose] noncomputable def spatialLabel (l : Index B N0) : SlotColoring.Label := PartitionedCovariance.signedLabel (PrimaryGeometryAssembly.label nominal l.1) l.2 /-- Reference geometry, given by `ActualSignedGeometry.slotGeometry slots vectors_det (spatialLabel l) 0`. -/ +@[expose] noncomputable def referenceGeometry (l : Index B N0) : Geometry := ActualSignedGeometry.slotGeometry slots vectors_det (spatialLabel l) 0 /-- 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) 0 (clock l n) (clock_pos l n).ne'`. -/ +@[expose] noncomputable def geometry (l : Index B N0) (n : ℕ) : Geometry := CopySolveCompatibility.transportGeometry (referenceGeometry l) (gap l n) 0 (clock l n) (clock_pos l n).ne' @@ -1304,6 +1322,7 @@ theorem activeSlowCore_closed (l : Index B N0) (n : ℕ) : IsClosed (activeSlowC /-- Canonical source region, given by `ActualGaussianCoverage.sourceRegion (activeSlowCore l n) (geometry l n) slots.radius (referenceLength l) (clock l n)`. -/ +@[expose] noncomputable def canonicalSourceRegion (l : Index B N0) (n : ℕ) : Set (Parameter × Plane) := ActualGaussianCoverage.sourceRegion (activeSlowCore l n) (geometry l n) slots.radius (referenceLength l) (clock l n) @@ -1327,6 +1346,7 @@ theorem labelCarrier_iff_canonicalSourceRegion activeSlowCore, ite_eq_right hn, mem_inter_iff, mem_preimage, mem_empty_iff_false, false_and] /-- Cutoff as an element of `Plane → ℝ`. -/ +@[expose] noncomputable def cutoff (l : Index B N0) (n : ℕ) : Plane → ℝ := (fun z => (clockWindow l.1).cutoff z * GaussianTailFlat.slotCutoff (referenceLength l) z.2) ∘ @@ -1376,7 +1396,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 +1418,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)) @@ -1421,6 +1441,7 @@ variable ActualGaussianCoverage.outerCell (r n) (L n) (rate n))) /-- Scalar cells, constructed using `nativeCells`. -/ +@[expose] noncomputable def scalarCells : Cells ((P × ℝ) × Plane) Frequency := nativeCells g (fun n => ActualGaussianCoverage.outerCell (r n) (L n) (rate n)) (fun _ => ActualGaussianCoverage.outerCell_compact _ _ _) hinj @@ -1519,7 +1540,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 @@ -1536,6 +1557,7 @@ variable {Label P : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] (r : Label → ℕ → ℝ) (hr : ∀ l n, 0 < r l n) /-- The literal cutoff, before placing it in any particular-solve record. -/ +@[expose] noncomputable def literalCutoff (l : Label) (n : ℕ) (k : Frequency) (x : P × Plane) : ℝ := (ActualGaussianCoverage.referenceWindow (r l n) (F.L (l,n)) @@ -1621,7 +1643,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1648,6 +1670,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) @@ -1655,6 +1678,7 @@ noncomputable def reindexDomain {ι κ : Type} (D : Domain ι Slow) (e : κ → one_le_scale i := D.one_le_scale (e i) /-- Reindex phase, bundling `epsilon`, `p`, `pz`, `x0` and the required compatibility proofs. -/ +@[expose] noncomputable def reindexPhase {ι κ : Type} (F : PhaseFamily ι) (e : κ → ι) : PhaseFamily κ where epsilon i := F.epsilon (e i) p i := F.p (e i) @@ -1666,6 +1690,7 @@ noncomputable def reindexPhase {ι κ : Type} (F : PhaseFamily ι) (e : κ → /-- Reindex construction, bundling `phase`, `V`, `openV`, `lam` and the required compatibility proofs. -/ +@[expose] noncomputable def reindexConstruction {ι κ : Type} {D : Domain ι Slow} (F : PhaseConstruction D) (e : κ → ι) : PhaseConstruction (reindexDomain D e) where phase := reindexPhase F.phase e @@ -1728,17 +1753,19 @@ variable {B N0 : ℕ} /-- Spatial label, given by `PartitionedCovariance.signedLabel (PrimaryGeometryAssembly.label nominal l.2) l.1`. -/ +@[expose] noncomputable def spatialLabel (l : Label B N0) : SlotColoring.Label := PartitionedCovariance.signedLabel (PrimaryGeometryAssembly.label nominal l.2) l.1 /-- Reference geometry, given by `ActualSignedGeometry.slotGeometry slots vectors_det (spatialLabel l) 0`. -/ +@[expose] noncomputable def referenceGeometry (l : Label B N0) : Geometry := ActualSignedGeometry.slotGeometry slots vectors_det (spatialLabel l) 0 /-- 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 : ℕ) : @@ -1751,6 +1778,7 @@ theorem reference_refine (l : Label B N0) (n : ℕ) : /-- Reference cutoff, given by `(clockWindow l.2).cutoff z * GaussianTailFlat.slotCutoff ((phases B N0 l.1).L l.2) z.2`. -/ +@[expose] noncomputable def referenceCutoff (l : Label B N0) (z : Plane) : ℝ := (clockWindow l.2).cutoff z * GaussianTailFlat.slotCutoff ((phases B N0 l.1).L l.2) z.2 @@ -1759,6 +1787,7 @@ theorem referenceCutoff_compact (l : Label B N0) : HasCompactSupport (referenceC /-- Reference, bundling `band`, `geometry`, `length`, `length_pos` and the required compatibility proofs. -/ +@[expose] noncomputable def reference (l : Label B N0) : ParticularWaveAssembly.Reference Parameter where band := BaseChartJets.cellBand l.2 geometry := referenceGeometry l @@ -1773,32 +1802,35 @@ noncomputable def reference (l : Label B N0) : ParticularWaveAssembly.Reference /-- Native to full, given by `ParticularWaveAssembly.angleShuffle.symm.trans (StateReindex.cylinder cycleAssoc.symm)`. -/ +@[expose] noncomputable def nativeToFull : Native ≃ₗᵢ[ℝ] AP := ParticularWaveAssembly.angleShuffle.symm.trans (StateReindex.cylinder cycleAssoc.symm) /-- 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) /-- Assembly, bundling `reference`, `charts`, `parameter`, `gap` and the required compatibility proofs. -/ +@[expose] noncomputable def assembly (x : CycleState (Label B N0)) (l : Label B N0) : ParticularWaveAssembly.AssemblyData Parameter where reference := reference l @@ -1819,6 +1851,7 @@ noncomputable def assembly (x : CycleState (Label B N0)) (l : Label B N0) : directions := directions (B := B) /-- Parameters, given by `ParticularParameters.fromReference (assembly x l) h (gap l)`. -/ +@[expose] noncomputable def parameters (x : CycleState (Label B N0)) (l : Label B N0) : ParticularParameters Parameter := ParticularParameters.fromReference (assembly x l) h (gap l) @@ -1835,6 +1868,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)) @@ -1870,6 +1904,7 @@ theorem parameters_eq_canonical (x : CycleState (Label B N0)) (l : Label B N0) /-! The sign combination is proved before specializing the constructed profile. -/ /-- Signed phase, bundling `epsilon`, `p`, `pz`, `x0` and the required compatibility proofs. -/ +@[expose] noncomputable def signedPhase {ι : Type} {D : Domain ι Slow} (F : Fin 2 → PhaseConstruction D) : PhaseFamily (Fin 2 × ι) where epsilon l := (F l.1).phase.epsilon l.2 @@ -1882,6 +1917,7 @@ noncomputable def signedPhase {ι : Type} {D : Domain ι Slow} /-- Signed construction, bundling `phase`, `V`, `openV`, `lam` and the required compatibility proofs. -/ +@[expose] noncomputable def signedConstruction {ι : Type} {D : Domain ι Slow} (F : Fin 2 → PhaseConstruction D) (hr : ∀ j, (F j).r = (F 0).r) (hb : ∀ j, (F j).b = (F 0).b) @@ -1971,6 +2007,7 @@ noncomputable def signedConstruction {ι : Type} {D : Domain ι Slow} /-- Joint domain, given by `reindexDomain (PrimaryGeometryAssembly.domain nominal (choice B N0).prepared.N) Prod.snd`. -/ +@[expose] noncomputable def jointDomain : Domain (Label B N0) Slow := reindexDomain (PrimaryGeometryAssembly.domain nominal (choice B N0).prepared.N) Prod.snd @@ -2001,6 +2038,7 @@ theorem phase_axial_eq (j : Fin 2) : (phases B N0 j).phase.G = (phases B N0 0).p (choice B N0).prepared slots.radius_pos 0 L).symm /-- Joint construction, constructed using `signedConstruction`. -/ +@[expose] noncomputable def jointConstruction : PhaseConstruction (jointDomain (B := B) (N0 := N0)) := signedConstruction (phases B N0) (fun j => (phase_common_bounds j).1) @@ -2062,6 +2100,7 @@ noncomputable def slowInsert : Parameter →L[ℝ] CyclePoint where /-- Slow strip, given by `HarmonicWaveInteraction.pullbackStrip (BaseContextAssembly.nativeStrip nominal standardRegion) slowInsert`. -/ +@[expose] noncomputable def slowStrip : StripData Parameter := HarmonicWaveInteraction.pullbackStrip (BaseContextAssembly.nativeStrip nominal standardRegion) slowInsert @@ -2076,21 +2115,25 @@ theorem nativeStrip_eq : /-- Pulse envelope, given by `PrimaryPulseBounds.referenceP ((phases B N0 l.1).lam l.2) ((phases B N0 l.1).u l.2) ((phases B N0 l.1).L l.2)`. -/ +@[expose] noncomputable def pulseEnvelope (l : Label B N0) : ℝ → ℝ := PrimaryPulseBounds.referenceP ((phases B N0 l.1).lam l.2) ((phases B N0 l.1).u l.2) ((phases B N0 l.1).L l.2) /-- Envelope, given by `WaveEnvelopeTransport.copyEnvelope (chartGeometry n l.1 l.2) slots.radius ((phases B N0 l.1).L l.2) (pulseEnvelope l) z.2`. -/ +@[expose] noncomputable def envelope (l : Label B N0) (n : ℕ) (z : Parameter × Plane) : ℝ := WaveEnvelopeTransport.copyEnvelope (chartGeometry n l.1 l.2) slots.radius ((phases B N0 l.1).L l.2) (pulseEnvelope l) z.2 /-- Mean envelope, given by `envelope l n (cycleAssoc z)`. -/ +@[expose] noncomputable def meanEnvelope (l : Label B N0) (n : ℕ) (z : CyclePoint) : ℝ := envelope l n (cycleAssoc z) /-- Native envelope, given by `envelope l n (z.1.1,z.2)`. -/ +@[expose] noncomputable def nativeEnvelope (l : Label B N0) (n : ℕ) (z : Native) : ℝ := envelope l n (z.1.1,z.2) @@ -2099,6 +2142,7 @@ theorem envelope_nonneg (l : Label B N0) (n : ℕ) (z : Parameter × Plane) : 0 (fun t => (PrimaryPulseBounds.referenceP_pos _ _ _ t).le) _ /-- Active, given by `1 ≤ n ∧ BaseChartJets.cellBand l.2 ∈ CommonWindow.levels n`. -/ +@[expose] noncomputable def Active (l : Label B N0) (n : ℕ) : Prop := 1 ≤ n ∧ BaseChartJets.cellBand l.2 ∈ CommonWindow.levels n @@ -2110,23 +2154,28 @@ section Selected variable (e : ℕ → ActivePair B N0) /-- Selected label, given by `(e n).val.1`. -/ +@[expose] noncomputable def selectedLabel (n : ℕ) : Label B N0 := (e n).val.1 /-- Selected band, given by `(e n).val.2`. -/ +@[expose] noncomputable def selectedBand (n : ℕ) : ℕ := (e n).val.2 /-- Selected construction, given by `reindexConstruction (jointConstruction (B := B) (N0 := N0)) (fun i : Unit × ℕ => selectedLabel e i.2)`. -/ +@[expose] noncomputable def selectedConstruction := reindexConstruction (jointConstruction (B := B) (N0 := N0)) (fun i : Unit × ℕ => selectedLabel e i.2) /-- Selected strip, given by `UniformPrimaryWeights.reindexedStrip slowStrip (fun n => (selectedBand e n, ()))`. -/ +@[expose] noncomputable def selectedStrip : StripData Parameter := UniformPrimaryWeights.reindexedStrip slowStrip (fun n => (selectedBand e n, ())) /-- Selected slot, given by `spatialLabel (selectedLabel e n)`. -/ +@[expose] noncomputable def selectedSlot (_ : Unit) (n : ℕ) : SlotColoring.Label := spatialLabel (selectedLabel e n) @@ -2137,6 +2186,7 @@ theorem selected_near (u : Unit) (n : ℕ) : /-- Selected clock, given by `ActualSignedGeometry.clockScale (selectedBand e) (fun u n => (selectedSlot e u n).1) (selected_near e) h`. -/ +@[expose] noncomputable def selectedClock := ActualSignedGeometry.clockScale (selectedBand e) (fun u n => (selectedSlot e u n).1) (selected_near e) h @@ -2148,9 +2198,11 @@ noncomputable def selectedNormal := (selected_near e) outgoing.data.h_pos.le /-- Selected gap, given by `gap (selectedLabel e n) (selectedBand e n)`. -/ +@[expose] noncomputable def selectedGap (_ : Unit) (n : ℕ) : ℕ := gap (selectedLabel e n) (selectedBand e n) /-- Selected geometry, constructed using `ScaledActualParticularControl.geometry`. -/ +@[expose] noncomputable def selectedGeometry := ScaledActualParticularControl.geometry (ScaledActualParticularControl.slotReference slots vectors_det (selectedSlot e)) @@ -2158,11 +2210,13 @@ noncomputable def selectedGeometry := /-- Selected length, given by `ScaledActualParticularControl.length (selectedConstruction e) (selectedClock e)`. -/ +@[expose] noncomputable def selectedLength := ScaledActualParticularControl.length (selectedConstruction e) (selectedClock e) /-- Selected pulse envelope, given by `ScaledActualParticularControl.envelope (selectedConstruction e) (selectedClock e)`. -/ +@[expose] noncomputable def selectedPulseEnvelope := ScaledActualParticularControl.envelope (selectedConstruction e) (selectedClock e) @@ -2233,6 +2287,7 @@ theorem associated_residual_class (x : CycleState (Label B N0)) {α : ℝ} x.coefficients.blocks x.coefficients.gaussian x.coefficients.aliasCoefficients H /-- Current source, constructed using `ParticularWaveAssembly.sourceFamily`. -/ +@[expose] noncomputable def currentSource (x : CycleState (Label B N0)) (j : ℤ) (l : Label B N0) : ℕ → Native → HarmonicCalculus.ComplexVector := ParticularWaveAssembly.sourceFamily (assembly x l).context (assembly x l).state @@ -2411,15 +2466,18 @@ theorem selected_tangent_eq (x : CycleState (Label B N0)) exact he /-- Selected source, given by `currentSource x j (selectedLabel e n) (selectedBand e n)`. -/ +@[expose] noncomputable def selectedSource (x : CycleState (Label B N0)) (j : ℤ) (_ : Unit) (n : ℕ) := currentSource x j (selectedLabel e n) (selectedBand e n) /-- Selected tangent, given by `(parameters x (selectedLabel e n)).nativeTangent j (selectedBand e n)`. -/ +@[expose] noncomputable def selectedTangent (x : CycleState (Label B N0)) (j : ℤ) (_ : Unit) (n : ℕ) := (parameters x (selectedLabel e n)).nativeTangent j (selectedBand e n) /-- Selected background, constructed using `ParticularCopyBounds.reindexedBase`. -/ +@[expose] noncomputable def selectedBackground (x : CycleState (Label B N0)) (j : ℤ) (_ : Unit) := ParticularCopyBounds.reindexedBase (fun l => ((parameters x l).copyData (assembly x l).context (assembly x l).state @@ -2482,12 +2540,13 @@ 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 /-- The active phase patch includes the transverse boundary. Its time coordinate is the actual transported clock. -/ +@[expose] noncomputable def controlPatch (l : Label B N0) (n : ℕ) (k : Frequency) : Set Native := {z | Active l n ∧ (z.1.1 ∈ slowStrip.domain ∧ @@ -2528,6 +2587,7 @@ section RawSelected variable (e : ℕ → ActivePair B N0) /-- Selected weight, constructed using `ActualParticularControl.groupedEnvelope`. -/ +@[expose] noncomputable def selectedWeight : Unit → ℕ → Native → ℝ := ActualParticularControl.groupedEnvelope (selectedGeometry e) (fun _ _ => slots.radius) (selectedLength e) (selectedPulseEnvelope e) @@ -2696,7 +2756,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 : ℕ) : @@ -2740,6 +2800,7 @@ theorem data_scalar_eq (x : CycleState (Label B N0)) (l : Label B N0) (j : ℤ) · rfl /-- Carrier cells, constructed using `ScalarParticularSupport.scalarCells`. -/ +@[expose] noncomputable def carrierCells (l : Label B N0) : PeriodizedWaveBounds.Cells Native Frequency := ScalarParticularSupport.scalarCells (P := Parameter) (ActualCarrierTransportBase.geometry (supportLabel l)) (fun _ => slots.radius) @@ -3128,12 +3189,14 @@ 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 (assembly x l).carrierBlock (assembly x l).gaussianInput (assembly x l).aliasInput N /-- Associated good as an element of `HarmonicBlock (Parameter × Plane)`. -/ +@[expose] noncomputable def associatedGood (x : CycleState (Label B N0)) (N : ℕ) (l : Label B N0) : HarmonicBlock (Parameter × Plane) := (parameters x l).goodBlock associatedStrip (assembly x l).context (assembly x l).state @@ -3162,10 +3225,11 @@ 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)`. -/ +@[expose] noncomputable def outputGood (x : CycleState (Label B N0)) (N : ℕ) (l : Label B N0) : HarmonicBlock CyclePoint := StateReindex.block cycleAssoc (associatedGood x N l) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPeriodizedSignedRealization.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPeriodizedSignedRealization.lean index cb2fe95d87..861449ae9a 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 @@ -64,6 +64,7 @@ namespace Layout variable (l : Layout) /-- Native mask, given by `l.cutoff n ((l.geometry n).coordinates k Y)`. -/ +@[expose] noncomputable def nativeMask (n : ℕ) (k : Frequency) (Y : Plane) : ℝ := l.cutoff n ((l.geometry n).coordinates k Y) @@ -76,13 +77,16 @@ noncomputable def clock (n : ℕ) (Y : Plane) : ℝ := PeriodicPhaseAssembly.periodicClock (l.geometry n) (l.window n).cutoff Y / l.length n /-- Native clock, given by `((l.geometry n).coordinates k Y).2 / l.length n`. -/ +@[expose] noncomputable def nativeClock (n : ℕ) (k : Frequency) (Y : Plane) : ℝ := ((l.geometry n).coordinates k Y).2 / l.length n /-- Gaussian, given by `GaussianTailFlat.profile (l.clock n Y)`. -/ +@[expose] noncomputable def gaussian (n : ℕ) (Y : Plane) : ℝ := GaussianTailFlat.profile (l.clock n Y) /-- Native gaussian, given by `GaussianTailFlat.profile (l.nativeClock n k Y)`. -/ +@[expose] noncomputable def nativeGaussian (n : ℕ) (k : Frequency) (Y : Plane) : ℝ := GaussianTailFlat.profile (l.nativeClock n k Y) @@ -177,7 +181,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 : ℂ) @@ -230,6 +234,7 @@ variable {U : PhaseJetBounds.Domain ℕ PhaseCalculus.Slow} /-- Periodized primary, given by `{B with coordinate := fun n x => ((B.coordinate n x).1, l.clock n x.1.2.2) mask := fun n x => B.mask n x * l.mask n x.1.2.2}`. -/ +@[expose] noncomputable def periodizedPrimary : PhysicalSignedWave.PrimaryData U := {B with coordinate := fun n x => ((B.coordinate n x).1, l.clock n x.1.2.2) @@ -240,7 +245,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 @@ -261,6 +266,7 @@ noncomputable def views {reference : ℕ} (V : B.Views reference) : /-- Reuse the actual current state, reference state, and their full-fiber coherence. There is no second signed choice or request. -/ +@[expose] noncomputable def stateData {reference : ℕ} {V : B.Views reference} (D : V.StateData) : (views B l V).StateData where patch := D.patch @@ -294,22 +300,25 @@ 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`. -/ +@[expose] noncomputable def totalMask (n : ℕ) (x : Cylinder) : ℝ := sharedMask B V n x * l.mask reference (V.map n x).1.2.2 /-- Copy mask, given by `sharedMask B V n x * l.nativeMask reference k (V.map n x).1.2.2`. -/ +@[expose] noncomputable def copyMask (k : Frequency) (n : ℕ) (x : Cylinder) : ℝ := sharedMask B V n x * l.nativeMask reference k (V.map n x).1.2.2 /-- Common unit, given by `(periodizedPrimary B l).fundamental j reference (V.map n x)`. -/ +@[expose] 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 +331,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 +349,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) @@ -436,6 +446,7 @@ theorem view_pressure (request : ℕ → Cylinder → Vec2) (j : Fin 2) (n : ℕ /-- Every lattice copy is built by the actual native signed quotient and projected homogeneous pressure; the cutoff is applied before summation. -/ +@[expose] noncomputable def copyData (request : ℕ → Cylinder → Vec2) (j : Fin 2) : PeriodizedWaveBounds.CopyData Cylinder Frequency where background := (periodizedPrimary B l).viewBase V.background V.frequency (fun n => V.map n) @@ -494,6 +505,7 @@ theorem commonCorrected_eq (request : ℕ → Cylinder → Vec2) (j : Fin 2) : /-! ## The literal current-state request and one physical reference -/ /-- The native copies use the current state's actual signed request. -/ +@[expose] noncomputable def actualCopyData (D : V.StateData) (j : Fin 2) : PeriodizedWaveBounds.CopyData Cylinder Frequency := copyData B l V D.request j @@ -539,14 +551,17 @@ theorem actual_pressure_transport (D : V.StateData) (j : Fin 2) (n : ℕ) /-- One genuine periodized Cartesian potential, retaining the same pulse, reference state, scales, and integer covers as the native copies. -/ +@[expose] noncomputable def physicalPotential (D : V.StateData) (j : Fin 2) (delta : ℝ) : VelocityField := (views B l V).physicalPotential D.referenceRequest j delta /-- Physical velocity, given by `SpatialCurl.spatialCurl (physicalPotential B l V D j delta)`. -/ +@[expose] noncomputable def physicalVelocity (D : V.StateData) (j : Fin 2) (delta : ℝ) : VelocityField := SpatialCurl.spatialCurl (physicalPotential B l V D j delta) /-- Physical pressure, given by `(views B l V).physicalPressure D.referenceRequest j delta`. -/ +@[expose] noncomputable def physicalPressure (D : V.StateData) (j : Fin 2) (delta : ℝ) : PressureField := (views B l V).physicalPressure D.referenceRequest j delta @@ -619,6 +634,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 +649,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..ca4ae9f051 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 @@ -378,6 +378,7 @@ open CorrectionInitialization CorrectionInitialization.ActualPrimary variable {B N0 : ℕ} /-- Native copy, constructed using `ActualSignedGeometry.copyPoint`. -/ +@[expose] noncomputable def nativeCopy (j : Fin 2) (L : Label B N0) (n : ℕ) (k : TorusInverse.Frequency) (x : FullPoint) : Slow × Plane := ActualSignedGeometry.copyPoint slots vectors_det @@ -446,7 +447,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 @@ -589,6 +590,7 @@ theorem chart_defect_germ (j : Fin 2) (L : Label B N0) (n : ℕ) exact congrArg (fun z : ℝ => _ * z) hy /-- Reduced expression as an element of `ℝ`. -/ +@[expose] noncomputable def reducedExpression (j : Fin 2) (L : Label B N0) (n : ℕ) (k : TorusInverse.Frequency) (x : FullPoint) : ℝ := let z := nativeCopy j L n k x @@ -679,7 +681,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) @@ -759,6 +761,7 @@ theorem active_materialWeight_bound (L : Label B N0) (n : ℕ) /-- Padded region, bundling `carrier`, `isOpen`, `have`, `coord_pos` and the required compatibility proofs. -/ +@[expose] noncomputable def paddedRegion : LocalSignedRequest.SlowRegion (2*h) where carrier := {z | 0 < z.1 ∧ SimilarityCoordinates.coordinateQ (2*h) z ∈ Ioo (1/4 : ℝ) 4} isOpen := by @@ -789,6 +792,7 @@ theorem padded_slow_mem {p : Slow} (hT : 0 < p.2.2) · exact hq.2.trans_lt (by norm_num) /-- Reduced slow domain, bundling `scale`, `carrier`, `isOpen`, `one_le_scale`. -/ +@[expose] noncomputable def reducedSlowDomain (U : LocalSignedRequest.SlowRegion (2 * h)) : PhaseJetBounds.Domain (Fin 2 × Label B N0) Slow where scale i := ChartScales.S (BaseChartJets.cellBand i.2) @@ -801,12 +805,14 @@ noncomputable def reducedSlowDomain (U : LocalSignedRequest.SlowRegion (2 * h)) /-- Reduced jet domain, given by `(reducedSlowDomain U).slot (fun i => (phases B N0 i.1).V i.2) (fun i => (phases B N0 i.1).openV i.2)`. -/ +@[expose] noncomputable def reducedJetDomain (U : LocalSignedRequest.SlowRegion (2 * h)) : PhaseJetBounds.Domain (Fin 2 × Label B N0) (Slow × ℝ) := (reducedSlowDomain U).slot (fun i => (phases B N0 i.1).V i.2) (fun i => (phases B N0 i.1).openV i.2) /-- Native reduced, constructed using `PrimaryMaterialDefect.expression`. -/ +@[expose] noncomputable def nativeReduced (i : Fin 2 × Label B N0) (z : Slow × ℝ) : ℝ := PrimaryMaterialDefect.expression 1 ((phases B N0 i.1).phase.p i.2) ((phases B N0 i.1).phase.pz i.2) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPhaseJetBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPhaseJetBounds.lean index 3c015e8d81..ac55832e0b 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 @@ -159,6 +159,7 @@ abbrev CopyIndex (B N0 : ℕ) := SignedLabel B N0 × TorusInverse.Frequency /-- Only the genuine analytic cell and clock core are required. In particular, this also allows the larger geometric source window. -/ +@[expose] noncomputable def phaseCell (n : ℕ) (i : CopyIndex B N0) : Set ActualPrimary.FullPoint := {x | ActualPrimaryBounds.near i.1 n ∧ (ActualPrimaryBounds.fullCopy i.1 n i.2 x).1 ∈ @@ -433,7 +434,7 @@ theorem localPhase_positive_jets (m : ℕ) : _ = _ := by ring /-- The full frequency-weighted phase, with the literal chosen carrier. -/ -noncomputable def weightedPhase (l : SignedLabel B N0) (n : ℕ) +@[expose] noncomputable def weightedPhase (l : SignedLabel B N0) (n : ℕ) (x : ActualPrimary.FullPoint) : ℝ := (ActualPrimary.chartCoefficients l.1 l.2).frequency n * (ActualPrimary.chartCoefficients l.1 l.2).phase n x diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPhysicalPrefixFields.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPhysicalPrefixFields.lean index 7907d01f18..e3e502b214 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 @@ -40,6 +40,7 @@ open Set Filter ProblemStatement PhysicalWaveSum CorrectionInitialization open scoped Topology BigOperators /-- The open physical exterior on which the raw stages are constructed. -/ +@[expose] noncomputable def exteriorDomain (Nr : ℕ) : Set SpaceTime := {w | w ∈ preterminal ∧ w ∉ ActualPolarCoverage.active} ∩ CutStageEstimates.physicalSublevel ActualPrimary.h (ChartScales.Q Nr) @@ -195,7 +196,7 @@ end end -@[expose] public section +public section noncomputable section @@ -463,11 +464,13 @@ open CorrectionInitialization.ActualPrimary /-- Source, given by `PhysicalResidualTZ.graphSourceTZ (ActualCycleResidualBounds.actualBandGraph n) ActualPolarCoverage.nativeDomain`. -/ +@[expose] noncomputable def source (n : ℕ) : Set SpaceTime := PhysicalResidualTZ.graphSourceTZ (ActualCycleResidualBounds.actualBandGraph n) ActualPolarCoverage.nativeDomain /-- Cartesian chart domain, constructed using `CutStageEstimates.physicalSublevel`. -/ +@[expose] noncomputable def cartesianChartDomain (qbig : ℝ) (n : ℕ) (a : ℝ) (i : PolarCharts.Index) : Set SpaceTime := CutStageEstimates.physicalSublevel h qbig ∩ diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPhysicalStageBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPhysicalStageBounds.lean index 07fbbbeca0..4712a67631 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 @@ -46,7 +46,7 @@ namespace NavierStokes.ActualBaseVelocityBounds open ProblemStatement SlowBorelBase BaseResidual DiagonalResidual /-- Endpoint, given by `𝓝[SpacetimeEndpoint.openPast 1] (1, (0 : Space))`. -/ -noncomputable def endpoint : Filter SpaceTime := +@[expose] noncomputable def endpoint : Filter SpaceTime := 𝓝[SpacetimeEndpoint.openPast 1] (1, (0 : Space)) theorem endpoint_past : ∀ᶠ z in endpoint, z.1 < 1 := by @@ -69,6 +69,7 @@ theorem endpoint_q_small {h : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) : exact ⟨PhysicalWaveSum.physicalQ_pos hh hh1 hz, hq.le⟩ /-- Physical energy, given by `AxisymmetricFields.radialEnergy z.2`. -/ +@[expose] noncomputable def physicalEnergy (z : SpaceTime) : ℝ := AxisymmetricFields.radialEnergy z.2 @@ -631,7 +632,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 @@ -740,6 +741,7 @@ theorem mixed_background {l : Filter SpaceTime} {q : SpaceTime → ℝ} exact hc.add hb hU hlU hsCurl hsB /-- Stage velocity, defined pointwise by `SpatialCurl.spatialCurl (A j) x + B j x`. -/ +@[expose] noncomputable def stageVelocity (A B : ℕ → VelocityField) (j : ℕ) : VelocityField := fun x => SpatialCurl.spatialCurl (A j) x + B j x @@ -772,7 +774,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 +824,7 @@ end end -@[expose] public section +public section noncomputable section @@ -843,7 +845,7 @@ noncomputable def seedDirectLoss (h meanAlpha : ℝ) (m : ℕ) : ℝ := /-- This loss depends only on fixed initialization data and derivative order. It has no later correction-stage parameter. -/ -noncomputable def initialLoss (h waveAlpha waveShift potentialAlpha directAlpha : ℝ) +@[expose] noncomputable def initialLoss (h waveAlpha waveShift potentialAlpha directAlpha : ℝ) (m : ℕ) : ℝ := max (ActualBaseVelocityBounds.heatLoss m) (max (seedPotentialLoss h waveAlpha waveShift potentialAlpha (m + 1)) @@ -927,6 +929,7 @@ variable {F : OutgoingProfile.Profile} {W : NominalProfile.Witness F} /-- Initialized potential, defined pointwise by `TailGaugePotential.finalPotential H v upper B w + potentialIncrement WA MA w`. -/ +@[expose] noncomputable def initializedPotential (upper : ℝ) (B : ℕ) (WA : WaveData F.data.h D I K (Fin 3)) (MA : MeanData F.data.h (CoordinateAlgebra.A F.data.h - 1 / 2)) : VelocityField := @@ -934,6 +937,7 @@ noncomputable def initializedPotential (upper : ℝ) (B : ℕ) /-- Literal curl of the initialized potential plus the direct angular initialization. The latter is not differentiated as a potential. -/ +@[expose] noncomputable def initializedVelocity (upper : ℝ) (B : ℕ) (WA : WaveData F.data.h D I K (Fin 3)) (MA : MeanData F.data.h (CoordinateAlgebra.A F.data.h - 1 / 2)) @@ -1051,6 +1055,13 @@ theorem uncutVelocity_zero_eq_initialized (upper : ℝ) (B : ℕ) (directStages MB) 0 = initializedVelocity H v upper B (WA 0) (MA 0) (MB 0) := by rw [MixedFiniteBackground.uncutVelocity_zero] + change (fun x => SpatialCurl.spatialCurl + (potentialStages (TailGaugePotential.finalPotential H v upper B) WA MA 0) x + + (directStages MB 0) x) = + (fun x => SpatialCurl.spatialCurl + (initializedPotential H v upper B (WA 0) (MA 0)) x + + (MB 0).family.angularField x) + rw [potentialStages_zero] rfl /-- Direct input for `MixedFiniteBackground.mixed_background_from_initial`, @@ -1142,7 +1153,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1152,6 +1163,7 @@ open Set Function Filter ProblemStatement DiagonalResidual open scoped Topology ContDiff BigOperators /-- Region, given by `PhysicalMeanDomain.normalizedSlowDomain (2 * h) (1 / 2) 2`. -/ +@[expose] noncomputable def region (h : ℝ) : Set PhysicalGraphBounds.Plane := PhysicalMeanDomain.normalizedSlowDomain (2 * h) (1 / 2) 2 @@ -1186,7 +1198,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) @@ -1312,6 +1324,7 @@ variable {h : ℝ} [NormedAddCommGroup DS] [NormedSpace ℝ DS] {IP KP IS KS : Type*} /-- The four actual potential contributions of one cycle. -/ +@[expose] noncomputable def potentialIncrement (WP : PhysicalStageBounds.WaveData h DP IP KP (Fin 3)) (WS : PhysicalStageBounds.WaveData h DS IS KS (Fin 3)) @@ -1320,6 +1333,7 @@ noncomputable def potentialIncrement /-- Pressure increment, defined pointwise by `WP.pressure w + WS.pressure w + MP.family.field w`. -/ +@[expose] noncomputable def pressureIncrement (WP : PhysicalStageBounds.WaveData h DP IP KP Unit) (WS : PhysicalStageBounds.WaveData h DS IS KS Unit) @@ -1457,15 +1471,15 @@ variable {h : ℝ} /-- Potential, given by `potentialIncrement (D.particularPotential k) (D.signedPotential k) (D.temporal k) (D.rank k)`. -/ -noncomputable def potential (k : ℕ) : VelocityField := +@[expose] noncomputable def potential (k : ℕ) : VelocityField := potentialIncrement (D.particularPotential k) (D.signedPotential k) (D.temporal k) (D.rank k) /-- Direct, given by `(D.angular k).family.angularField`. -/ -noncomputable def direct (k : ℕ) : VelocityField := (D.angular k).family.angularField +@[expose] noncomputable def direct (k : ℕ) : VelocityField := (D.angular k).family.angularField /-- Pressure field, given by `pressureIncrement (D.particularPressure k) (D.signedPressure k) (D.pressure k)`. -/ -noncomputable def pressureField (k : ℕ) : PressureField := +@[expose] noncomputable def pressureField (k : ℕ) : PressureField := pressureIncrement (D.particularPressure k) (D.signedPressure k) (D.pressure k) /-- Cycle `k` contributes physical stage `k+1`. These are native exponent @@ -1663,6 +1677,7 @@ variable {h : ℝ} {D : Type} [NormedAddCommGroup D] [NormedSpace ℝ D] {I K : /-- Initial increment, defined pointwise by `W.vector w + MT.family.angularField w + MR.family.angularField w`. -/ +@[expose] noncomputable def initialIncrement (W : PhysicalStageBounds.WaveData h D I K (Fin 3)) (MT MR : MeanInput h (CoordinateAlgebra.A h - 1 / 2)) : VelocityField := fun w => W.vector w + MT.family.angularField w + MR.family.angularField w @@ -1725,6 +1740,7 @@ theorem initialIncrement_rate (W : PhysicalStageBounds.WaveData h D I K (Fin 3)) /-- The finite pressure inserted at initialization, apart from the actual base pressure. Both terms retain their original native class exponents. -/ +@[expose] noncomputable def initialPressureIncrement (W : PhysicalStageBounds.WaveData h D I K Unit) (M : MeanInput h (2 * CoordinateAlgebra.A h)) : PressureField := fun w => W.pressure w + M.family.field w @@ -1799,6 +1815,7 @@ variable {F : OutgoingProfile.Profile} {W : NominalProfile.Witness F} /-- Initial potential, defined pointwise by `TailGaugePotential.finalPotential H v upper B w + initialIncrement WA MT MR w`. -/ +@[expose] noncomputable def initialPotential (upper : ℝ) (B : ℕ) (WA : PhysicalStageBounds.WaveData F.data.h D I K (Fin 3)) (MT MR : MeanInput F.data.h (CoordinateAlgebra.A F.data.h - 1 / 2)) : VelocityField := @@ -2040,32 +2057,91 @@ 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) : - MeanInput h (CoordinateAlgebra.A h - 1 / 2) := - MeanInput.ofMoving standardRegion rfl (initialTemporalFamily B N0 N) hN +@[expose] noncomputable def actualInitialTemporalInput (B N0 N : ℕ) (hN : 4 ≤ N) : + MeanInput h (CoordinateAlgebra.A h - 1 / 2) := by + have hInner : commonGauge.radial.inner = PrimaryTargetBounds.leftRadius nominal := by rfl + have hOuter : commonGauge.radial.outer = PrimaryTargetBounds.rightRadius nominal := by rfl + have hNative : (initialTemporalFamily B N0 N).native = initialTemporalScalar B N0 := by rfl + have hMoving : GaugeMomentBalances.MovingField standardRegion + (PrimaryTargetBounds.leftRadius nominal) (PrimaryTargetBounds.rightRadius nominal) + (initialTemporalFamily B N0 N).native := by + simpa only [hInner, hOuter, hNative] using initialTemporal_moving B N0 + have hJets : PhysicalMeanJetBounds.NativeJets N standardRegion.carrier + (h * (1 - ChartScales.kappa)) (initialTemporalFamily B N0 N).native := + initialTemporal_nativeJets B N0 N (by omega) + exact MeanInput.ofMoving (h := h) (degree := CoordinateAlgebra.A h - 1 / 2) + (a := PrimaryTargetBounds.leftRadius nominal) + (b := PrimaryTargetBounds.rightRadius nominal) (α := 1 - ChartScales.kappa) + (N := N) (Δ := CorrectionInitialization.CommonWindow.gap h) + 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)) + hMoving hJets /-- Actual initial rank input, constructed using `MeanInput.ofMoving`. -/ -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 +@[expose] noncomputable def actualInitialRankInput (B N0 N : ℕ) (hN : 4 ≤ N) : + MeanInput h (CoordinateAlgebra.A h - 1 / 2) := by + have hInner : commonGauge.radial.inner = PrimaryTargetBounds.leftRadius nominal := by rfl + have hOuter : commonGauge.radial.outer = PrimaryTargetBounds.rightRadius nominal := by rfl + have hNative : (initialRankFamily B N0 N).native = initialRankScalar B N0 := by rfl + have hMoving : GaugeMomentBalances.MovingField standardRegion + (PrimaryTargetBounds.leftRadius nominal) (PrimaryTargetBounds.rightRadius nominal) + (initialRankFamily B N0 N).native := by + simpa only [hInner, hOuter, hNative] using initialRank_moving B N0 + have hJets : PhysicalMeanJetBounds.NativeJets N standardRegion.carrier + (h * (1 - ChartScales.kappa)) (initialRankFamily B N0 N).native := + initialRank_nativeJets B N0 N (by omega) + exact MeanInput.ofMoving (h := h) (degree := CoordinateAlgebra.A h - 1 / 2) + (a := PrimaryTargetBounds.leftRadius nominal) + (b := PrimaryTargetBounds.rightRadius nominal) (α := 1 - ChartScales.kappa) + (N := N) (Δ := CorrectionInitialization.CommonWindow.gap h) + 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)) + hMoving hJets /-- Actual initial angular input, constructed using `MeanInput.ofMoving`. -/ -noncomputable def actualInitialAngularInput (B N0 N : ℕ) (hN : 4 ≤ N) : - MeanInput h (CoordinateAlgebra.A h) := - MeanInput.ofMoving standardRegion rfl (initialAngularFamily B N0 N) hN +@[expose] noncomputable def actualInitialAngularInput (B N0 N : ℕ) (hN : 4 ≤ N) : + MeanInput h (CoordinateAlgebra.A h) := by + have hInner : commonGauge.radial.inner = PrimaryTargetBounds.leftRadius nominal := by rfl + have hOuter : commonGauge.radial.outer = PrimaryTargetBounds.rightRadius nominal := by rfl + have hNative : (initialAngularFamily B N0 N).native = + (ActualInitialCoherence.initialized B N0).mean.angular := by rfl + have hMoving : GaugeMomentBalances.MovingField standardRegion + (PrimaryTargetBounds.leftRadius nominal) (PrimaryTargetBounds.rightRadius nominal) + (initialAngularFamily B N0 N).native := by + simpa only [hInner, hOuter, hNative] using (initial_mean_moving B N0).angular + have hJets : PhysicalMeanJetBounds.NativeJets N standardRegion.carrier + (h * (9 / 10)) (initialAngularFamily B N0 N).native := + initialAngular_nativeJets B N0 N (by omega) + exact MeanInput.ofMoving (h := h) (degree := CoordinateAlgebra.A h) + (a := PrimaryTargetBounds.leftRadius nominal) + (b := PrimaryTargetBounds.rightRadius nominal) (α := 9 / 10) + (N := N) (Δ := CorrectionInitialization.CommonWindow.gap h) + standardRegion rfl (initialAngularFamily B N0 N) hN (PrimaryTargetBounds.leftRadius_pos nominal) (PrimaryTargetBounds.radii_ordered nominal) - (initial_mean_moving B N0).angular (initialAngular_nativeJets B N0 N (by omega)) + hMoving hJets /-- Actual initial pressure input, constructed using `MeanInput.ofMoving`. -/ +@[expose] noncomputable def actualInitialPressureInput (B N0 N : ℕ) (hN : 4 ≤ N) : - MeanInput h (2 * CoordinateAlgebra.A h) := - MeanInput.ofMoving standardRegion rfl (initialPressureFamily B N0 N) hN + MeanInput h (2 * CoordinateAlgebra.A h) := by + have hInner : commonGauge.radial.inner = PrimaryTargetBounds.leftRadius nominal := by rfl + have hOuter : commonGauge.radial.outer = PrimaryTargetBounds.rightRadius nominal := by rfl + have hNative : (initialPressureFamily B N0 N).native = + (ActualInitialCoherence.initialized B N0).pressure := by rfl + have hMoving : GaugeMomentBalances.MovingField standardRegion + (PrimaryTargetBounds.leftRadius nominal) (PrimaryTargetBounds.rightRadius nominal) + (initialPressureFamily B N0 N).native := by + simpa only [hInner, hOuter, hNative] using initial_pressure_moving B N0 + have hJets : PhysicalMeanJetBounds.NativeJets N standardRegion.carrier + (h * (9 / 10)) (initialPressureFamily B N0 N).native := + initialPressure_nativeJets B N0 N (by omega) + exact MeanInput.ofMoving (h := h) (degree := 2 * CoordinateAlgebra.A h) + (a := PrimaryTargetBounds.leftRadius nominal) + (b := PrimaryTargetBounds.rightRadius nominal) (α := 9 / 10) + (N := N) (Δ := CorrectionInitialization.CommonWindow.gap h) + standardRegion rfl (initialPressureFamily B N0 N) hN (PrimaryTargetBounds.leftRadius_pos nominal) (PrimaryTargetBounds.radii_ordered nominal) - (initial_pressure_moving B N0) (initialPressure_nativeJets B N0 N (by omega)) + hMoving hJets @[simp] theorem actualInitialTemporalInput_family (B N0 N : ℕ) (hN : 4 ≤ N) : (actualInitialTemporalInput B N0 N hN).family = initialTemporalFamily B N0 N := rfl @@ -2101,7 +2177,7 @@ variable {B N0 N : ℕ} {p : ℕ → CycleParameters (ActualInitialization.Index /-- These four cycle adapters retain the literal families of the actual iterate. Their quantitative hypotheses are native source, debt, or mean classes; physical derivative bounds are conclusions of the earlier API. -/ -noncomputable def actualCycleTemporalInput (H : InitialCycleInput B N0 N p) +@[expose] noncomputable def actualCycleTemporalInput (H : InitialCycleInput B N0 N p) (j : ℕ) (hN : 4 ≤ N) {α : ℝ} (HC : WeightedClasses.MeanClass ActualInitialMean.strip α (((p j).afterSigned @@ -2115,7 +2191,7 @@ noncomputable def actualCycleTemporalInput (H : InitialCycleInput B N0 N p) ((initialCycleData H).temporal_moving j) (cycleTemporal_nativeJets H j (by omega) HC) /-- Actual cycle rank input, constructed using `MeanInput.ofMoving`. -/ -noncomputable def actualCycleRankInput (H : InitialCycleInput B N0 N p) +@[expose] noncomputable def actualCycleRankInput (H : InitialCycleInput B N0 N p) (j : ℕ) (hN : 4 ≤ N) {α : ℝ} (HC : WeightedClasses.UnweightedClass ActualInitialMean.slowStrip α (CorrectionState.debt (commonContext B) @@ -2130,7 +2206,7 @@ noncomputable def actualCycleRankInput (H : InitialCycleInput B N0 N p) ((initialCycleData H).rank_moving j) (cycleRank_nativeJets H j (by omega) HC) /-- Actual cycle angular input, constructed using `MeanInput.ofMoving`. -/ -noncomputable def actualCycleAngularInput (H : InitialCycleInput B N0 N p) +@[expose] noncomputable def actualCycleAngularInput (H : InitialCycleInput B N0 N p) (j : ℕ) (hN : 4 ≤ N) {α : ℝ} (HT : MeanIncrementBounds.IncrementBounds ActualInitialMean.strip α ((p j).temporalIncrement @@ -2151,7 +2227,7 @@ noncomputable def actualCycleAngularInput (H : InitialCycleInput B N0 N p) omega) HT HR) /-- Actual cycle pressure input as an element of `MeanInput h (2 * CoordinateAlgebra.A h)`. -/ -noncomputable def actualCyclePressureInput (H : InitialCycleInput B N0 N p) +@[expose] noncomputable def actualCyclePressureInput (H : InitialCycleInput B N0 N p) (j : ℕ) (hN : 4 ≤ N) {α : ℝ} (HC : WeightedClasses.MeanClass ActualInitialMean.strip α ((CycleState.iterate p (commonContext B) (ActualInitialization.initialCycleState B N0) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPolarCoverage.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPolarCoverage.lean index 50f406a852..bdc0928fb7 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 @@ -132,6 +132,7 @@ noncomputable def vectorMap : Components →L[ℝ] Space := fin_cases i <;> simp [vectorMap, coordinateVector] /-- Residual degree, given by `2 * CoordinateAlgebra.A h + 1 / 2`. -/ +@[expose] noncomputable def residualDegree (h : ℝ) : ℝ := 2 * CoordinateAlgebra.A h + 1 / 2 /-- Invert the actual residual scaling and cylindrical frame. -/ @@ -682,6 +683,7 @@ theorem NativeBounds.pull_linear {D E F ι : Type} [NormedAddCommGroup D] [Norme /-- Full phase, given by `(j : ℝ) * (b.frequency n * b.phase n x.1 + (b.angularFrequency n : ℝ) * x.2)`. -/ +@[expose] noncomputable def fullPhase (b : CorrectionState.HarmonicBlock Point) (j : ℤ) (n : ℕ) (x : Cylinder) : ℝ := (j : ℝ) * (b.frequency n * b.phase n x.1 + (b.angularFrequency n : ℝ) * x.2) @@ -764,6 +766,7 @@ theorem state_nativeBounds {ι : Type} {N : ℕ} {V : Set Point} /-! ## One physical residual, selected comparable bands, and the base patch -/ /-- Residual, defined pointwise by `navierStokesResidual u p w.1 w.2`. -/ +@[expose] noncomputable def residual (u : VelocityField) (p : PressureField) : SpaceTime → Space := fun w => navierStokesResidual u p w.1 w.2 @@ -786,6 +789,7 @@ theorem residual_germ_off_changedSupport {u u₀ : VelocityField} {p p₀ : Pres /-- The loss contains the actual physical residual degree, graph derivative loss, one polynomial-in-band absorption, and the fixed phase loss. -/ +@[expose] noncomputable def physicalLoss (h β : ℝ) (m : ℕ) : ℝ := PhysicalMeanJetBounds.loss (residualDegree h) m + β * m @@ -914,7 +918,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 +1125,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1137,21 +1141,23 @@ 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)} /-- Inner, given by `PrimaryTargetBounds.leftRadius ActualPrimary.nominal / 4`. -/ +@[expose] 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 ∩ {x : Point | 0 < x.1})`. -/ +@[expose] noncomputable def nativeDomain : Set Cylinder := HarmonicResidual.liftDomain (ActualInitialization.geometry.domain ∩ {x : Point | 0 < x.1}) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPrimaryBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPrimaryBounds.lean index d1c4357dab..a4082a20c5 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 @@ -36,15 +36,18 @@ abbrev Point := LocalSignedRequest.Point /-- Region, given by `ActualSignedGeometry.standardSlowRegion ActualPrimary.outgoing.data.h_pos ActualPrimary.outgoing.data.h_lt_half`. -/ +@[expose] noncomputable def region : LocalSignedRequest.SlowRegion (2 * ActualPrimary.h) := ActualSignedGeometry.standardSlowRegion ActualPrimary.outgoing.data.h_pos ActualPrimary.outgoing.data.h_lt_half /-- Strip, given by `BaseContextAssembly.nativeStrip ActualPrimary.nominal region`. -/ +@[expose] noncomputable def strip : StripData Point := BaseContextAssembly.nativeStrip ActualPrimary.nominal region /-- Native strip, given by `ActualSignedGeometry.viewStrip ActualPrimary.nominal region id`. -/ +@[expose] noncomputable def nativeStrip : StripData Native := ActualSignedGeometry.viewStrip ActualPrimary.nominal region id @@ -147,6 +150,7 @@ variable {B N0 : ℕ} /-- Spatial label, given by `PartitionedCovariance.signedLabel (PrimaryGeometryAssembly.label ActualPrimary.nominal l.2) l.1`. -/ +@[expose] noncomputable def spatialLabel (l : SignedLabel B N0) : SlotColoring.Label := PartitionedCovariance.signedLabel (PrimaryGeometryAssembly.label ActualPrimary.nominal l.2) l.1 @@ -154,6 +158,7 @@ theorem label_large (l : SignedLabel B N0) : 4 ≤ (spatialLabel l).1 := ((ActualPrimary.choice B N0).prepared.large _ l.2.property).four_le /-- Near, given by `1 ≤ n ∧ BaseChartJets.cellBand l.2 ∈ CommonWindow.levels n`. -/ +@[expose] noncomputable def near (l : SignedLabel B N0) (n : ℕ) : Prop := 1 ≤ n ∧ BaseChartJets.cellBand l.2 ∈ CommonWindow.levels n @@ -174,6 +179,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) @@ -220,6 +226,7 @@ theorem copyLinear_bound {l : SignedLabel B N0} {n : ℕ} (hn : near l n) : hn.1 (label_large l) (near_distance hn).1 (near_distance hn).2 /-- Copy cells, constructed using `PeriodizedWaveBounds.nativeCells`. -/ +@[expose] noncomputable def copyCells (l : SignedLabel B N0) : PeriodizedWaveBounds.Cells Native TorusInverse.Frequency := PeriodizedWaveBounds.nativeCells (fun n => ActualPrimary.chartGeometry n l.1 l.2) @@ -234,11 +241,13 @@ noncomputable def copyCells (l : SignedLabel B N0) : _).core_subset_outer)) /-- Pulse envelope, constructed using `PrimaryPulseBounds.referenceP`. -/ +@[expose] noncomputable def pulseEnvelope (l : SignedLabel B N0) : ℝ → ℝ := PrimaryPulseBounds.referenceP ((ActualPrimary.phases B N0 l.1).lam l.2) ((ActualPrimary.phases B N0 l.1).u l.2) ((ActualPrimary.phases B N0 l.1).L l.2) /-- Envelope, constructed using `WaveEnvelopeTransport.copyEnvelope`. -/ +@[expose] noncomputable def envelope (l : SignedLabel B N0) (n : ℕ) (x : Native) : ℝ := WaveEnvelopeTransport.copyEnvelope (ActualPrimary.chartGeometry n l.1 l.2) ActualPrimary.slots.radius @@ -359,6 +368,7 @@ noncomputable def nativeWeight (α : ℝ) (l : SignedLabel B N0) (x : Native) : /-- Coefficient scale, given by `PhysicalParticularWave.ratioPower (ChartScales.Q n) (ChartScales.Q (BaseChartJets.cellBand l.2)) a`. -/ +@[expose] noncomputable def coefficientScale (a : ℝ) (l : SignedLabel B N0) (n : ℕ) : ℝ := PhysicalParticularWave.ratioPower (ChartScales.Q n) (ChartScales.Q (BaseChartJets.cellBand l.2)) a @@ -367,7 +377,7 @@ theorem coefficientScale_pos (a : ℝ) (l : SignedLabel B N0) (n : ℕ) : (ChartScales.Q_pos _) _ /-- Copied as an element of `E`. -/ -noncomputable def copied {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] +@[expose] noncomputable def copied {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] (a : ℝ) (f : SignedLabel B N0 → Native → E) (l : SignedLabel B N0) (n : ℕ) (k : TorusInverse.Frequency) (x : Native) : E := by classical @@ -547,7 +557,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) @@ -754,6 +764,7 @@ theorem uniform_lift {D E ι : Type} [NormedAddCommGroup D] [NormedSpace ℝ D] hj) /-- Full envelope, given by `envelope l n (ActualSignedGeometry.meanEquiv.symm x.1)`. -/ +@[expose] noncomputable def fullEnvelope (l : SignedLabel B N0) (n : ℕ) (x : ActualPrimary.FullPoint) : ℝ := envelope l n (ActualSignedGeometry.meanEquiv.symm x.1) @@ -796,6 +807,7 @@ section GaussianCutoff variable {B N0 : ℕ} /-- Time projection as an element of `Native →L[ℝ] ℝ`. -/ +@[expose] noncomputable def timeProjection (L : ActualPrimary.Label B N0) : Native →L[ℝ] ℝ := (((ActualPrimary.phases B N0 0).L L)⁻¹) • ((ContinuousLinearMap.snd ℝ ℝ ℝ).comp (ContinuousLinearMap.snd ℝ PhaseCalculus.Slow @@ -841,14 +853,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 : @@ -1014,16 +1026,17 @@ theorem fullEnvelope_le_one (l : SignedLabel B N0) (n : ℕ) (x : ActualPrimary. fullEnvelope l n x ≤ 1 := envelope_le_one l n _ /-- Mean envelope, given by `fullEnvelope l n (x, 0)`. -/ +@[expose] 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,11 +1063,12 @@ 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) /-- Control cell as an element of `Set ActualPrimary.FullPoint`. -/ +@[expose] noncomputable def controlCell (n : ℕ) (i : CopyIndex B N0) : Set ActualPrimary.FullPoint := {x | near i.1 n ∧ (fullCopy i.1 n i.2 x).1 ∈ @@ -1064,12 +1078,14 @@ noncomputable def controlCell (n : ℕ) (i : CopyIndex B N0) : Set ActualPrimary SimilarityHomogeneity.chartQ ActualPrimary.h (fullCopy i.1 n i.2 x).1 ∈ Icc (1 / 2 : ℝ) 2} /-- Full strip, given by `HarmonicWaveInteraction.productStrip strip`. -/ +@[expose] noncomputable def fullStrip : StripData ActualPrimary.FullPoint := HarmonicWaveInteraction.productStrip strip /-- Native of full, given by `ActualSignedGeometry.meanEquiv.symm.toContinuousLinearEquiv.toContinuousLinearMap.comp (ContinuousLinearMap.fst ℝ Point ℝ)`. -/ +@[expose] noncomputable def nativeOfFull : ActualPrimary.FullPoint →L[ℝ] Native := ActualSignedGeometry.meanEquiv.symm.toContinuousLinearEquiv.toContinuousLinearMap.comp (ContinuousLinearMap.fst ℝ Point ℝ) @@ -1082,6 +1098,7 @@ theorem nativeOfFull_norm : ‖nativeOfFull‖ ≤ 1 := by exact norm_fst_le x /-- Slot of native as an element of `Native →L[ℝ] (PhaseCalculus.Slow × ℝ)`. -/ +@[expose] noncomputable def slotOfNative : Native →L[ℝ] (PhaseCalculus.Slow × ℝ) := (ContinuousLinearMap.fst ℝ PhaseCalculus.Slow TorusInverse.Plane).prod ((ContinuousLinearMap.snd ℝ ℝ ℝ).comp (ContinuousLinearMap.snd ℝ PhaseCalculus.Slow @@ -1095,6 +1112,7 @@ theorem slotOfNative_norm : ‖slotOfNative‖ ≤ 1 := by exact max_le (norm_fst_le x) ((norm_snd_le x.2).trans (norm_snd_le x)) /-- Slot linear, given by `slotOfNative.comp ((copyLinear l n).comp nativeOfFull)`. -/ +@[expose] noncomputable def slotLinear (l : SignedLabel B N0) (n : ℕ) : ActualPrimary.FullPoint →L[ℝ] (PhaseCalculus.Slow × ℝ) := slotOfNative.comp ((copyLinear l n).comp nativeOfFull) @@ -1180,6 +1198,7 @@ theorem polynomial_on_control {E : Type*} [NormedAddCommGroup E] [NormedSpace ring /-- Joint phase, bundling `epsilon`, `p`, `pz`, `x0` and the required compatibility proofs. -/ +@[expose] noncomputable def jointPhase : PhaseFamily (SignedLabel B N0) where epsilon l := (ActualPrimary.phases B N0 l.1).phase.epsilon l.2 p l := (ActualPrimary.phases B N0 l.1).phase.p l.2 @@ -1270,6 +1289,7 @@ theorem context_normal_swap rfl /-- Normal scale, constructed using `PhysicalParticularWave.normalWeight`. -/ +@[expose] noncomputable def normalScale (l : SignedLabel B N0) (n : ℕ) : ℝ := PhysicalParticularWave.normalWeight (ChartScales.Q n) (ChartScales.Q (BaseChartJets.cellBand l.2)) (ChartScales.carrier ActualPrimary.h n) (ChartScales.carrier ActualPrimary.h @@ -1277,7 +1297,7 @@ noncomputable def normalScale (l : SignedLabel B N0) (n : ℕ) : ℝ := /-- Chart normal, given by `(ActualPrimary.chartCoefficients l.1 l.2).normal fullStrip (PrimaryResidualClass.directions (ActualPrimary.commonContext B)) n`. -/ -noncomputable def chartNormal (l : SignedLabel B N0) (n : ℕ) : ActualPrimary.FullPoint → +@[expose] noncomputable def chartNormal (l : SignedLabel B N0) (n : ℕ) : ActualPrimary.FullPoint → ProblemStatement.Space := (ActualPrimary.chartCoefficients l.1 l.2).normal fullStrip (PrimaryResidualClass.directions (ActualPrimary.commonContext B)) n @@ -1419,10 +1439,12 @@ theorem chart_normal_local : LocalizedWaveBounds.LocalUnweighted fullStrip (cont /-- Normal floor, given by `normalLower * min (ActualPrimary.phases B N0 0).b (ActualPrimary.phases B N0 1).b`. -/ +@[expose] noncomputable def normalFloor (B N0 : ℕ) : ℝ := normalLower * min (ActualPrimary.phases B N0 0).b (ActualPrimary.phases B N0 1).b /-- Normal ceiling, constructed using `normalUpper`. -/ +@[expose] noncomputable def normalCeiling (B N0 : ℕ) : ℝ := normalUpper * max ((ActualPrimary.phases B N0 0).M ^ 2 + 3 * (ActualPrimary.phases B N0 0).M) ((ActualPrimary.phases B N0 1).M ^ 2 + 3 * (ActualPrimary.phases B N0 1).M) @@ -1503,17 +1525,19 @@ 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) /-- Directions, given by `PrimaryResidualClass.directions (ActualPrimary.commonContext B)`. -/ +@[expose] noncomputable def directions (B : ℕ) := PrimaryResidualClass.directions (ActualPrimary.commonContext B) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPrimaryCoherence.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPrimaryCoherence.lean index e1ad6ddb5b..70f8cd6b17 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 @@ -118,6 +118,7 @@ abbrev Absolute := AbsolutePoint × ℝ /-- Absolute chart, bundling `toFun`, `invFun`, `left_inv`, `right_inv` and the required compatibility proofs. -/ +@[expose] noncomputable def absoluteChart (n : ℕ) : ChartPoint ≃L[ℝ] Absolute where toFun x := (toAbsolute n x.1, x.2) invFun x := (fromAbsolute n x.1, x.2) @@ -136,19 +137,22 @@ noncomputable def absoluteChart (n : ℕ) : ChartPoint ≃L[ℝ] Absolute where (absoluteChart n).symm x = (fromAbsolute n x.1, x.2) := rfl /-- Absolute radius, given by `x.1.1.1`. -/ +@[expose] noncomputable def absoluteRadius (x : Absolute) : ℝ := x.1.1.1 /-- Absolute radial, given by `(((1,(0,0)), RadialPullback.radialJacobian (ChartScales.radialExponent h) x.1.1.1 • radialVector), 0)`. -/ +@[expose] noncomputable def absoluteRadial (x : Absolute) : Absolute := (((1,(0,0)), RadialPullback.radialJacobian (ChartScales.radialExponent h) x.1.1.1 • 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)`. -/ +@[expose] noncomputable def absoluteFast (_ : Absolute) : Absolute := (((0,(0,0)),temporalVector),0) theorem cover_inverse_radial (i : ℕ) (a : ℝ) : @@ -256,11 +260,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) @@ -455,12 +461,16 @@ theorem piece_excluded_band (U : LocalSignedRequest.SlowRegion (2 * h)) /-! ## Ordinary regularity before restricting to a bounded strip -/ /-- Positive chart, given by `{x | 0 < x.1.2.1.1}`. -/ +@[expose] noncomputable def positiveChart : Set ChartPoint := {x | 0 < x.1.2.1.1} /-- Positive radial chart, given by `{x | 0 < x.1.1 ∧ 0 < x.1.2.1.1}`. -/ +@[expose] noncomputable def positiveRadialChart : Set ChartPoint := {x | 0 < x.1.1 ∧ 0 < x.1.2.1.1} /-- Positive absolute, given by `{x | 0 < x.1.1.2.2}`. -/ +@[expose] noncomputable def positiveAbsolute : Set Absolute := {x | 0 < x.1.1.2.2} /-- Positive radial absolute, given by `{x | 0 < x.1.1.1 ∧ 0 < x.1.1.2.2}`. -/ +@[expose] noncomputable def positiveRadialAbsolute : Set Absolute := {x | 0 < x.1.1.1 ∧ 0 < x.1.1.2.2} theorem positiveChart_open : IsOpen positiveChart := @@ -632,6 +642,7 @@ theorem absoluteVelocity_smooth_radial (j : Fin 2) (L : Label B N0) : (contDiffOn_pi.mp (absoluteExactAmplitude_smooth j L) i)) /-- Amplitude radius, given by `PrimaryTargetBounds.profileRadius h (nativeSlow L x.1)`. -/ +@[expose] noncomputable def amplitudeRadius (L : Label B N0) (x : Absolute) : ℝ := PrimaryTargetBounds.profileRadius h (nativeSlow L x.1) @@ -951,7 +962,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] @@ -1421,10 +1432,12 @@ theorem piece_cutAmplitude_tangent (U : LocalSignedRequest.SlowRegion (2 * h)) /-- Chart radius linear, given by `(ContinuousLinearMap.fst ℝ ℝ _).comp (ContinuousLinearMap.fst ℝ _ ℝ)`. -/ +@[expose] noncomputable def chartRadiusLinear : ChartPoint →L[ℝ] ℝ := (ContinuousLinearMap.fst ℝ ℝ _).comp (ContinuousLinearMap.fst ℝ _ ℝ) /-- Chart radial curve, constructed using `PhysicalResidualTZ.swapCylinder`. -/ +@[expose] noncomputable def chartRadialCurve (n : ℕ) (r : ℝ) : ChartPoint := PhysicalResidualTZ.swapCylinder (PhysicalCurlCovariance.ScaledGraph.radialCurve @@ -1605,6 +1618,7 @@ theorem piece_full_divergence (U : LocalSignedRequest.SlowRegion (2 * h)) piece_complex_divergence U j L n hx, map_zero] /-- The absolute free lift evaluated on the actual physical cylindrical graph. -/ +@[expose] noncomputable def physicalLift (z : ProblemStatement.SpaceTime) : Absolute := (((z.2 0, (z.2 2, 1-z.1)), (z.2 0)^ChartScales.radialExponent h • PhysicalGraphBounds.radialDirection + @@ -1626,6 +1640,7 @@ theorem absoluteChart_physical (n : ℕ) {z : ProblemStatement.SpaceTime} (hr : ext <;> ring /-- Physical phase, defined pointwise by `absolutePhase j L (physicalLift z)`. -/ +@[expose] noncomputable def physicalPhase (j : Fin 2) (L : Label B N0) : ProblemStatement.SpaceTime → ℝ := fun z => absolutePhase j L (physicalLift z) @@ -1636,11 +1651,13 @@ noncomputable def physicalAmplitude (j : Fin 2) (L : Label B N0) : ProblemStatem /-- Lifted phase, defined pointwise by `(chartCoefficients j L).phase n (PhysicalResidualTZ.swapCylinder x)`. -/ +@[expose] noncomputable def liftedPhase (j : Fin 2) (L : Label B N0) (n : ℕ) : ChartPoint → ℝ := fun x => (chartCoefficients j L).phase n (PhysicalResidualTZ.swapCylinder x) /-- Lifted amplitude, defined pointwise by `((chartCoefficients j L).withCutoff (chartCutoff j L)).amplitude n (PhysicalResidualTZ.swapCylinder x)`. -/ +@[expose] noncomputable def liftedAmplitude (j : Fin 2) (L : Label B N0) (n : ℕ) : ChartPoint → ComplexVector := fun x => ((chartCoefficients j L).withCutoff (chartCutoff j L)).amplitude n @@ -1733,7 +1750,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 : ℝ) : @@ -1757,6 +1774,7 @@ theorem physicalAmplitude_angular (j : Fin 2) (L : Label B N0) : /-- Physical potential, given by `PhysicalCurlCovariance.referencePotential 1 (physicalPhase j L) (physicalAmplitude j L)`. -/ +@[expose] noncomputable def physicalPotential (j : Fin 2) (L : Label B N0) : ProblemStatement.SpaceTime → ComplexVector := PhysicalCurlCovariance.referencePotential 1 (physicalPhase j L) (physicalAmplitude j L) @@ -2009,11 +2027,13 @@ theorem physicalPotential_smooth (j : Fin 2) (L : Label B N0) : /-- No band index occurs in this Cartesian potential. The cutoff is the original periodic Gaussian, and the polar chart is chosen from its full-turn-compatible values. -/ +@[expose] noncomputable def cartesianPotential (j : Fin 2) (L : Label B N0) : ProblemStatement.VelocityField := PhysicalCurlCovariance.globalCartesianPotential (physicalAxisRadius L) (physicalPotential j L) /-- Cartesian velocity, given by `SpatialCurl.spatialCurl (cartesianPotential j L)`. -/ +@[expose] noncomputable def cartesianVelocity (j : Fin 2) (L : Label B N0) : ProblemStatement.VelocityField := SpatialCurl.spatialCurl (cartesianPotential j L) @@ -2062,6 +2082,7 @@ theorem piece_cartesian_velocity (U : LocalSignedRequest.SlowRegion (2 * h)) exact hc /-- Physical pressure, defined pointwise by `absolutePressureMode j L (physicalLift z)`. -/ +@[expose] noncomputable def physicalPressure (j : Fin 2) (L : Label B N0) : ProblemStatement.SpaceTime → ℝ := fun z => absolutePressureMode j L (physicalLift z) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPrimaryCovariance.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPrimaryCovariance.lean index 3082091e83..8fcd249656 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) : @@ -236,6 +236,7 @@ theorem nativePoint_reference (n : ℕ) {x : Point} · exact hm /-- Unsigned labels as an element of `Finset (Label B N0)`. -/ +@[expose] noncomputable def unsignedLabels (B N0 n : ℕ) : Finset (Label B N0) := by classical exact (CorrectionInitialization.CommonWindow.labels (CoordinateAlgebra.D h) @@ -262,6 +263,7 @@ theorem active_cover_le (n : ℕ) {L : Label B N0} (hL : L ∈ unsignedLabels B exact CorrectionInitialization.CommonWindow.index_le hm /-- Signed label of, given by `signedLabel (PrimaryGeometryAssembly.label nominal l.1) l.2`. -/ +@[expose] noncomputable def signedLabelOf (l : Label B N0 × Fin 2) : SlotColoring.Label := signedLabel (PrimaryGeometryAssembly.label nominal l.1) l.2 @@ -279,7 +281,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 @@ -413,7 +415,7 @@ noncomputable def physicalLeading (n : ℕ) (x : Point) (i : Fin 2) : ℝ := /-- Partition factor, given by `∑ L ∈ unsignedLabels B N0 n, spatialMask L (nativePoint n x L) ^ 2`. -/ -noncomputable def partitionFactor (B N0 n : ℕ) (x : Point) : ℝ := +@[expose] noncomputable def partitionFactor (B N0 n : ℕ) (x : Point) : ℝ := ∑ L ∈ unsignedLabels B N0 n, spatialMask L (nativePoint n x L) ^ 2 theorem viewSum_covariance_factor (B N0 n : ℕ) {x : Point} @@ -579,13 +581,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 @@ -1065,6 +1067,7 @@ theorem slotAmplitude_supported {D h : ℝ} {vr vt : Plane} /-- Absolute auxiliary, given by `(CommonCoverSolve.coverPower (CorrectionInitialization.CommonWindow.index h n)).symm x.2.2`. -/ +@[expose] noncomputable def absoluteAuxiliary (n : ℕ) (x : Point) : Plane := (CommonCoverSolve.coverPower (CorrectionInitialization.CommonWindow.index h n)).symm x.2.2 @@ -1075,6 +1078,7 @@ theorem absoluteAuxiliary_continuous (n : ℕ) : Continuous (absoluteAuxiliary n /-- Physical window, given by `(SquaredPartition.logCoordinate (physicalScale n x), physicalPosition n x)`. -/ +@[expose] noncomputable def physicalWindow (n : ℕ) (x : Point) : LabelSumBounds.WindowPoint := (SquaredPartition.logCoordinate (physicalScale n x), physicalPosition n x) @@ -1105,7 +1109,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..5b31b578d7 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 @@ -246,6 +246,7 @@ theorem geometry_temporal (j : Fin 2) (L : Label B N0) : mul_left_comm] /-- Absolute native linear, bundling `toFun`, `map_add`, `map_smul`, `cont`. -/ +@[expose] noncomputable def absoluteNativeLinear (j : Fin 2) (L : Label B N0) : ActualPrimaryCoherence.Absolute →L[ℝ] Native where toFun x := (nativeSlow L x.1, (geometry j L).coordinateLinear x.1.2) @@ -258,12 +259,13 @@ noncomputable def absoluteNativeLinear (j : Fin 2) (L : Label B N0) : /-- Copy linear, given by `(absoluteNativeLinear j L).comp (ActualPrimaryCoherence.absoluteChart n).toContinuousLinearMap`. -/ +@[expose] noncomputable def copyLinear (j : Fin 2) (L : Label B N0) (n : ℕ) : FullPoint →L[ℝ] Native := (absoluteNativeLinear j L).comp (ActualPrimaryCoherence.absoluteChart n).toContinuousLinearMap /-- 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 +292,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 @@ -326,6 +328,7 @@ theorem copyPoint_fast_line (j : Fin 2) (L : Label B N0) (n : ℕ) all_goals ring /-- Slot linear as an element of `FullPoint →L[ℝ] PhaseCalculus.Slot`. -/ +@[expose] noncomputable def slotLinear (j : Fin 2) (L : Label B N0) (n : ℕ) : FullPoint →L[ℝ] PhaseCalculus.Slot := ((ContinuousLinearMap.fst ℝ PhaseCalculus.Slow TorusInverse.Plane).comp (copyLinear j L n)).prod @@ -335,7 +338,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 +462,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 : ℕ) : @@ -468,6 +471,7 @@ theorem coefficientPoint_smooth (L : Label B N0) (n : ℕ) : (((toAbsolute_smooth n).comp contDiff_fst).snd) /-- Native phase, constructed using `PhaseCalculus.phase`. -/ +@[expose] noncomputable def nativePhase (j : Fin 2) (L : Label B N0) : PhaseCalculus.Slot → ℝ := PhaseCalculus.phase ((phases B N0 j).phase.epsilon L) ((phases B N0 j).phase.p L) ((phases B N0 j).phase.pz L) ((phases B N0 j).phase.x0 L) @@ -519,13 +523,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 +647,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..ef775e17cc 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 @@ -424,6 +424,7 @@ noncomputable def pullState (e : D ≃L[ℝ] E) (u : State E) : State D where /-- Pull coefficients, given by `AddMonoidAlgebra.ofCoeff (Finsupp.mapRange (fun f : E → ℂ => fun x => f (e x)) rfl a.coeff)`. -/ +@[expose] noncomputable def pullCoefficients (e : D ≃L[ℝ] E) (a : Coefficients E) : Coefficients D := AddMonoidAlgebra.ofCoeff (Finsupp.mapRange (fun f : E → ℂ => fun x => f (e x)) rfl a.coeff) @@ -452,6 +453,7 @@ theorem pullCoefficients_field (e : D ≃L[ℝ] E) (a : Coefficients E) /-- Pull block, bundling `velocity`, `pressure`, `frequency`, `phase` and the required compatibility proofs. -/ +@[expose] noncomputable def pullBlock (e : D ≃L[ℝ] E) (b : HarmonicBlock E) : HarmonicBlock D where velocity n i := pullCoefficients e (b.velocity n i) pressure n := pullCoefficients e (b.pressure n) @@ -557,6 +559,7 @@ noncomputable def pullStrip (e : D ≃L[ℝ] E) (s : StripData E) : StripData D /-- Pull wave, bundling `radius`, `radialBase`, `frequencyBase`, `axialBase` and the required compatibility proofs. -/ +@[expose] noncomputable def pullWave (e : D ≃L[ℝ] E) (a : LinearWaveBounds.WaveCoefficients E) : LinearWaveBounds.WaveCoefficients D where radius n x := a.radius n (e x) @@ -570,6 +573,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 +603,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) : @@ -611,6 +615,7 @@ noncomputable def inverseCover (k : ℕ) : (P × Plane) ≃L[ℝ] (P × Plane) : /-- All fields, all directions and the complete source are expressed in the native fast coordinate. This assembly is only a reference view; the target solver keeps its original common-cover data. -/ +@[expose] noncomputable def rebaseAssembly (D : ParticularWaveAssembly.AssemblyData P) (k : ℕ) : ParticularWaveAssembly.AssemblyData P where reference := D.reference @@ -653,6 +658,7 @@ variable {B N0 : ℕ} /-- Reference residual source as an element of `PhysicalResidualNaturality.Associated → ComplexVector`. -/ +@[expose] noncomputable def referenceResidualSource (x : CorrectionStep.CycleState (ActualParticularStageControls.Label B N0)) (l : ActualParticularStageControls.Label B N0) (j : ℤ) : @@ -668,6 +674,7 @@ noncomputable def referenceResidualSource /-- Native assembly, given by `rebaseAssembly (ActualParticularStageControls.assembly x l) (ActualParticularStageControls.gap l (BaseChartJets.cellBand l.2))`. -/ +@[expose] noncomputable def nativeAssembly (x : CorrectionStep.CycleState (ActualParticularStageControls.Label B N0)) (l : ActualParticularStageControls.Label B N0) : ParticularWaveAssembly.AssemblyData Parameter @@ -929,6 +936,7 @@ end FiberLocality /-- Common reference chart as an element of `PhysicalResidualNaturality.Associated ≃L[ℝ] PhysicalResidualNaturality.Associated`. -/ +@[expose] noncomputable def commonReferenceChart (l : ActualParticularStageControls.Label B N0) (n : ℕ) : PhysicalResidualNaturality.Associated ≃L[ℝ] PhysicalResidualNaturality.Associated := (PhysicalResidualNaturality.associatedChart h (ChartScales.Q_pos n) @@ -1051,6 +1059,7 @@ theorem source_forward /-! The reference operator identities hold on the entire free lift. -/ /-- Angle embed, given by `((v.1, 0), v.2)`. -/ +@[expose] noncomputable def angleEmbed (v : PhysicalResidualNaturality.Associated) : WaveSpace := ((v.1, 0), v.2) @@ -1289,7 +1298,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..4b3ff062c1 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 @@ -41,10 +41,12 @@ variable {B N0 : ℕ} /-- Full strip, given by `HarmonicWaveInteraction.productStrip ActualInitialization.geometry.strip`. -/ +@[expose] noncomputable def fullStrip : StripData FullPoint := HarmonicWaveInteraction.productStrip ActualInitialization.geometry.strip /-- Request, constructed using `LocalSignedRequest.fullRequest`. -/ +@[expose] noncomputable def request (B : ℕ) (u : CorrectionState.State Point) : ℕ → FullPoint → SignedWaveUpdate.Vec2 := LocalSignedRequest.fullRequest ActualInitialization.geometry.strip @@ -52,6 +54,7 @@ noncomputable def request (B : ℕ) (u : CorrectionState.State Point) : /-- Copies, given by `(ActualSignedStageControls.parameters l).copyData ActualInitialization.geometry.strip (request B u)`. -/ +@[expose] noncomputable def copies (l : SignedLabel B N0) (u : CorrectionState.State Point) : PeriodizedWaveBounds.CopyData FullPoint TorusInverse.Frequency := (ActualSignedStageControls.parameters l).copyData ActualInitialization.geometry.strip (request B @@ -59,6 +62,7 @@ noncomputable def copies (l : SignedLabel B N0) (u : CorrectionState.State Point /-- Chart, bundling `toFun`, `invFun`, `left_inv`, `right_inv` and the required compatibility proofs. -/ +@[expose] noncomputable def chart (n m k : ℕ) : FullPoint ≃L[ℝ] FullPoint where toFun x := (bandChartEquiv h n m k x.1, x.2) invFun x := ((bandChartEquiv h n m k).symm x.1, x.2) 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..fb165d475d 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 @@ -39,25 +39,27 @@ abbrev Space := ProblemStatement.Space variable {B N0 : ℕ} /-- The actual unweighted unit, before choosing a periodic copy. -/ +@[expose] noncomputable def nativeUnit (j : Fin 2) (L : Label B N0) (x : Native) : Space := PrimaryPulseBounds.normalizedPulse ((phases B N0 j).frame L) ((phases B N0 j).lam L) ((phases B N0 j).u L) ((phases B N0 j).L L) (pulseCoordinates L x) /-- The selected native unit transported to the full free lift. -/ +@[expose] noncomputable def unitPulse (j : Fin 2) (L : Label B N0) (n : ℕ) (k : TorusInverse.Frequency) (x : FullPoint) : Space := nativeUnit j L (copyPoint j L n k x) /-- 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..51bf4dfd95 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 _⟩ @@ -72,6 +72,7 @@ theorem singleton_label_val (L : NativeLabel f.active) congrArg Subtype.val (Set.mem_singleton_iff.mp K.mem) /-- Singleton payload as an element of `(f.primary L).Views K.val.1, V.StateData`. -/ +@[expose] noncomputable def singletonPayload (L : NativeLabel f.active) (K : NativeLabel ({(L : BandLabel)} : Set BandLabel)) : Σ V : (f.primary L).Views K.val.1, V.StateData := by @@ -81,7 +82,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 +119,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 +143,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 @@ -154,6 +155,7 @@ noncomputable def zeroCopies : CopyFamily H K where /-- Zero cells, bundling `cells`, `carrier`, `closed`, `locallyFinite` and the required compatibility proofs. -/ +@[expose] noncomputable def zeroCells : SupportCells (zeroCopies : CopyFamily H K) where cells _ := { carrier := fun _ _ => ∅ @@ -178,7 +180,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 @@ -204,6 +206,7 @@ theorem diagonal_sum (f : BandLabel → CopyFamily H K) (a h r0 : ℝ) (w : Spac (diagonal f).sum a h r0 w = ∑ᶠ I : WaveIndex H, (f I.1).periodized a h r0 I w := rfl /-- Diagonal cells, bundling `cells`, `support`. -/ +@[expose] noncomputable def diagonalCells (f : BandLabel → CopyFamily H K) (c : ∀ L, SupportCells (f L)) : SupportCells (diagonal f) where cells L := (c L).cells L @@ -254,7 +257,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 +274,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 +289,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 @@ -329,6 +332,7 @@ variable {D h : ℝ} /-- The exact native source belonging to a primary label. Uniform bounds must hold jointly over this label and the native source index. -/ +@[expose] noncomputable def potentialSource (L : BandLabel) : ActualSignedPhysicalData.SourceIndex → ℕ → ActualSignedPhysicalData.Native → HarmonicCalculus.ComplexVector := @@ -336,6 +340,7 @@ noncomputable def potentialSource (L : BandLabel) : /-- Pressure source, given by `f.valueAt (fun L => ActualSignedPhysicalData.nativePressureSource sys hh (f.singleton L)) L`. -/ +@[expose] noncomputable def pressureSource (L : BandLabel) : ActualSignedPhysicalData.SourceIndex → ℕ → ActualSignedPhysicalData.Native → ℂ := f.valueAt (fun L => ActualSignedPhysicalData.nativePressureSource sys hh (f.singleton L)) L @@ -352,13 +357,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 @@ -421,6 +426,7 @@ variable {E : Type} [NormedAddCommGroup E] [NormedSpace ℝ E] {ι : BandLabel → Type*} /-- Joint source, defined pointwise by `source I.1 I.2`. -/ +@[expose] noncomputable def jointSource {V : Type*} (source : (L : BandLabel) → ι L → ℕ → E → V) : (Σ L, ι L) → ℕ → E → V := fun I => source I.1 I.2 @@ -444,6 +450,7 @@ theorem localSourceBounds_slice {V : Type} [NormedAddCommGroup V] [NormedSpace /-- Diagonal chart, bundling `sourceIndex`, `map`, `domain`, `open_domain` and the required compatibility proofs. -/ +@[expose] noncomputable def diagonalChart (f : BandLabel → CopyFamily H K) (c : ∀ L, SupportCells (f L)) {a b h r0 σ : ℝ} (source : (L : BandLabel) → ι L → ℕ → E → ℂ) @@ -572,6 +579,7 @@ variable {J : Type*} {a b h r0 Z P0 α σ : ℝ} {Δ : ℕ} /-- The physical factory is applied once to all labels. Its source and phase bounds are jointly quantified; individual physical bounds are not inputs to this constructor. -/ +@[expose] noncomputable def waveData : PhysicalStageBounds.WaveData h E (Σ L, ι L) K J where lowerRadius := a upperRadius := b @@ -626,7 +634,7 @@ end end -@[expose] public section +public section noncomputable section @@ -643,6 +651,7 @@ variable {B N0 : ℕ} /-- Active, given by `ActualPolarCoverage.active /-! ## The normalized radial coordinate does not depend on the band -/`. -/ +@[expose] noncomputable def active : Set SpaceTime := ActualPolarCoverage.active /-! ## The normalized radial coordinate does not depend on the band -/ @@ -710,6 +719,7 @@ theorem primary_mask_or_target_zero (l : Label B N0) (n m : ℕ) /-- Band label, given by `⟨ActualSignedPhysicalBinding.spatialLabel l, ActualPrimaryBounds.label_large (l.2, l.1)⟩`. -/ +@[expose] noncomputable def bandLabel (l : Label B N0) : BandLabel := ⟨ActualSignedPhysicalBinding.spatialLabel l, ActualPrimaryBounds.label_large (l.2, l.1)⟩ @@ -728,16 +738,19 @@ theorem bandLabel_injective : Injective (bandLabel (B := B) (N0 := N0)) := by simpa only [bandLabel, ActualSignedPhysicalBinding.spatialLabel, hfirst] using he /-- Labels, given by `range (bandLabel (B := B) (N0 := N0))`. -/ +@[expose] noncomputable def labels (B N0 : ℕ) : Set BandLabel := range (bandLabel (B := B) (N0 := N0)) /-- Native label, given by `⟨ActualSignedPhysicalBinding.spatialLabel l, ActualPrimaryBounds.label_large (l.2, l.1), Set.mem_range_self l⟩`. -/ +@[expose] noncomputable def nativeLabel (l : Label B N0) : ActualSignedPhysicalData.NativeLabel (labels B N0) := ⟨ActualSignedPhysicalBinding.spatialLabel l, ActualPrimaryBounds.label_large (l.2, l.1), Set.mem_range_self l⟩ /-- Actual label, given by `Classical.choose L.mem`. -/ +@[expose] noncomputable def actualLabel (L : ActualSignedPhysicalData.NativeLabel (labels B N0)) : Label B N0 := Classical.choose L.mem @@ -772,6 +785,7 @@ theorem actualLabel_reference (L : ActualSignedPhysicalData.NativeLabel (labels congrArg (fun L : BandLabel => L.val.1) (bandLabel_actualLabel L) /-- Reband payload, given by `he ▸ ⟨V, s⟩`. -/ +@[expose] noncomputable def rebandPayload {U : PhaseJetBounds.Domain ℕ PhaseCalculus.Slow} {P : PhysicalSignedWave.PrimaryData U} {n m : ℕ} (he : n = m) (V : P.Views n) (s : V.StateData) : Σ W : P.Views m, W.StateData := @@ -786,6 +800,7 @@ theorem rebandPayload_referenceRequest {U : PhaseJetBounds.Domain ℕ PhaseCalcu /-- Payload, given by `rebandPayload (actualLabel_reference L) (ActualSignedPhysicalBinding.nativeViews (actualLabel L)) (s (actualLabel L))`. -/ +@[expose] noncomputable def payload (s : ∀ l : Label B N0, (ActualSignedPhysicalBinding.nativeViews l).StateData) (L : ActualSignedPhysicalData.NativeLabel (labels B N0)) : @@ -795,7 +810,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 +935,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 @@ -984,6 +999,7 @@ variable (x : CorrectionStep.CycleState (Label B N0)) x.coefficients (commonContext B) x.state).pressure) /-- Cycle native states, constructed using `ActualSignedPhysicalBinding.nativeStateData`. -/ +@[expose] noncomputable def cycleNativeStates (l : Label B N0) : (ActualSignedPhysicalBinding.nativeViews l).StateData := ActualSignedPhysicalBinding.nativeStateData l ActualInitialization.patch @@ -991,13 +1007,16 @@ noncomputable def cycleNativeStates (l : Label B N0) : x.coefficients (commonContext B) x.state) H hp /-- Cycle family, given by `family (cycleNativeStates x H hp)`. -/ +@[expose] noncomputable def cycleFamily : DependentSignedPhysicalFamily.Family := family (cycleNativeStates x H hp) /-- Cycle potential, given by `potential (cycleNativeStates x H hp)`. -/ +@[expose] noncomputable def cyclePotential : VelocityField := potential (cycleNativeStates x H hp) /-- Cycle pressure, given by `pressure (cycleNativeStates x H hp)`. -/ +@[expose] noncomputable def cyclePressure : PressureField := pressure (cycleNativeStates x H hp) /-- The exterior statement concerns the signed request of the literal diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedGeometry.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedGeometry.lean index a0c2866d87..113f7ffbc2 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 @@ -214,6 +214,7 @@ variable {s : StripData X} {V : JetDomain ι D} {ζ : ι → D → ℝ} {K : Λ → ℕ → I → Set X} (c : CopyChart s V ζ K) /-- Pull, given by `affineCopy f c.index c.linear c.shift`. -/ +@[expose] noncomputable def pull (f : ι → D → E) : Λ → ℕ → I → X → E := affineCopy f c.index c.linear c.shift @@ -297,14 +298,17 @@ variable {H₀ v₀} (c : PreparedChart H₀ v₀ a D) /-- Target, defined pointwise by `PrimaryTargetBounds.actualTarget v₀ (c.coordinate L x).1 k`. -/ +@[expose] noncomputable def target : PrimaryGeometryAssembly.Index W₀ a.N → D → Vec2 := fun L x k => PrimaryTargetBounds.actualTarget v₀ (c.coordinate L x).1 k /-- Weight, defined pointwise by `PrimaryTargetBounds.movingWeight W₀ (c.coordinate L x).1`. -/ +@[expose] noncomputable def weight : PrimaryGeometryAssembly.Index W₀ a.N → D → ℝ := fun L x => PrimaryTargetBounds.movingWeight W₀ (c.coordinate L x).1 /-- Mask as an element of `PrimaryGeometryAssembly.Index W₀ a.N → D → ℝ`. -/ +@[expose] noncomputable def mask : PrimaryGeometryAssembly.Index W₀ a.N → D → ℝ := fun L x => PrimaryRepresentatives.nativeMask (PrimaryGeometryAssembly.label W₀ L).1 (PrimaryGeometryAssembly.label W₀ L).2 (c.coordinate L x).1 @@ -427,6 +431,7 @@ theorem square_bandBound (s : StripData X) : pow_zero, mul_one] using pow_le_pow_left₀ (a.value_pos l n).le (a.bounds l n).2 2 /-- Mul, bundling `value`, `lower`, `upper`, `lower_pos` and the required compatibility proofs. -/ +@[expose] noncomputable def mul : PositiveScale Λ where value l n := a.value l n * b.value l n lower := a.lower * b.lower @@ -848,7 +853,7 @@ end end -@[expose] public section +public section noncomputable section @@ -871,6 +876,7 @@ private theorem nat_le_infty (n : ℕ) : (n : WithTop ℕ∞) ≤ ∞ := /-- Standard slow region, bundling `carrier`, `isOpen`, `have`, `coord_pos` and the required compatibility proofs. -/ +@[expose] noncomputable def standardSlowRegion {h : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) : LocalSignedRequest.SlowRegion (2 * h) where carrier := {z | 0 < z.1 ∧ SimilarityCoordinates.coordinateQ (2 * h) z ∈ Ioo (1 / 2 : ℝ) 2} @@ -902,6 +908,7 @@ abbrev Label := PrimaryGeometryAssembly.Index W a.N /-- Native slow, bundling `scale`, `carrier`, `isOpen`, `one_le_scale` and the required compatibility proofs. -/ +@[expose] noncomputable def nativeSlow : PrimaryCopyBounds.JetDomain (Label H v a) Slow where scale L := ChartScales.S (BaseChartJets.cellBand L) carrier L := (PrimaryGeometryAssembly.domain W a.N).carrier L ∩ @@ -918,6 +925,7 @@ noncomputable def nativeSlow : PrimaryCopyBounds.JetDomain (Label H v a) Slow wh /-- Native domain, bundling `scale`, `carrier`, `isOpen`, `one_le_scale` and the required compatibility proofs. -/ +@[expose] noncomputable def nativeDomain : PrimaryCopyBounds.JetDomain (Label H v a) Native where scale L := ChartScales.S (BaseChartJets.cellBand L) carrier L := (nativeSlow H v a).carrier L ×ˢ @@ -929,7 +937,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} @@ -1064,6 +1072,7 @@ theorem nativeSlow_inverse_edge (L : Label H v a) {p : Slow} /-- This is the native chart of the supplied prepared family. All its coordinate, growth, annular and positive-reference fields are proved. -/ +@[expose] noncomputable def preparedChart (hr0 : 0 < r0) : ActualSignedControl.PreparedChart H v a Native where native := nativeDomain H v a @@ -1191,6 +1200,7 @@ variable {Λ : Type} (chart : ℕ → ℕ) (reference : Λ → ℕ → ℕ) /-- Band power scale, bundling `value`, `lower`, `upper`, `lower_pos` and the required compatibility proofs. -/ +@[expose] noncomputable def bandPowerScale (exponent : ℝ) : ActualSignedControl.PositiveScale Λ where value l n := PhysicalParticularWave.ratioPower (ChartScales.Q (chart n)) (ChartScales.Q (reference l n)) exponent @@ -1202,11 +1212,13 @@ noncomputable def bandPowerScale (exponent : ℝ) : ActualSignedControl.Positive dyadic_ratioPower_le (hnear l n).1 (hnear l n).2 _⟩ /-- Velocity scale, given by `bandPowerScale chart reference hnear (CoordinateAlgebra.A h)`. -/ +@[expose] noncomputable def velocityScale (h : ℝ) : ActualSignedControl.PositiveScale Λ := bandPowerScale chart reference hnear (CoordinateAlgebra.A h) /-- Clock scale, given by `bandPowerScale chart reference hnear (CoordinateAlgebra.A h + 1 / 2)`. -/ +@[expose] noncomputable def clockScale (h : ℝ) : ActualSignedControl.PositiveScale Λ := bandPowerScale chart reference hnear (CoordinateAlgebra.A h + 1 / 2) @@ -1231,11 +1243,13 @@ 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) /-- Clock window, bundling `lower`, `upper`, `padding`, `padding_pos`. -/ +@[expose] noncomputable def clockWindow (m : ℕ) : PeriodicPhaseAssembly.ClockWindow where lower := (-sys.radius, 0) upper := (sys.radius, ChartScales.slotLength sys.radius h m) @@ -1329,6 +1343,7 @@ end Slots /-! ## The exact physical change of slow variables and the copy affine map -/ /-- Slow change as an element of `Slow →L[ℝ] Slow`. -/ +@[expose] noncomputable def slowChange (h Q Qr : ℝ) : Slow →L[ℝ] Slow := (PhysicalParticularWave.ratioPower Q Qr (1 / 2) • ContinuousLinearMap.fst ℝ ℝ Plane).prod (((PhysicalParticularWave.ratioPower Q Qr (CoordinateAlgebra.D h) • @@ -1422,6 +1437,7 @@ theorem norm_slowChange_le (h : ℝ) {n m : ℕ} (hnm : n ≤ m + 4) (hmn : m /-- Mean equiv, given by `(ParticularWaveBounds.liftAssoc Plane).symm.trans PhysicalResidualTZ.swapSlow`. -/ +@[expose] noncomputable def meanEquiv : Native ≃ₗᵢ[ℝ] LocalSignedRequest.Point := (ParticularWaveBounds.liftAssoc Plane).symm.trans PhysicalResidualTZ.swapSlow @@ -1429,6 +1445,7 @@ noncomputable def meanEquiv : Native ≃ₗᵢ[ℝ] LocalSignedRequest.Point := rfl /-- View strip, constructed using `ParticularWaveBounds.reindexStrip`. -/ +@[expose] noncomputable def viewStrip {F : OutgoingProfile.Profile} (W : NominalProfile.Witness F) (U : LocalSignedRequest.SlowRegion (2 * F.data.h)) (chart : ℕ → ℕ) : StripData Native := ParticularWaveBounds.reindexStrip meanEquiv @@ -1467,12 +1484,13 @@ 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) /-- Copy linear as an element of `Native →L[ℝ] Native`. -/ +@[expose] noncomputable def copyLinear (l : SlotColoring.Label) (chart common : ℕ) : Native →L[ℝ] Native := (slowChange h (ChartScales.Q chart) (ChartScales.Q l.1)).prodMap (slotGeometry sys hdet l (ChartScales.nativeIndex h l.1 - common)).coordinateLinear @@ -1566,6 +1584,7 @@ variable {Λ : Type} (chart : ℕ → ℕ) (reference : Λ → ℕ → ℕ) /-- Coefficient scale, given by `(velocityScale chart reference hnear h).mul (bandPowerScale chart reference hnear (-(h / 2)))`. -/ +@[expose] noncomputable def coefficientScale (h : ℝ) : ActualSignedControl.PositiveScale Λ := (velocityScale chart reference hnear h).mul (bandPowerScale chart reference hnear (-(h / 2))) @@ -1583,6 +1602,7 @@ theorem coefficientScale_value (h : ℝ) (l : Λ) (n : ℕ) : /-- Carrier ratio scale, bundling `value`, `lower`, `upper`, `lower_pos` and the required compatibility proofs. -/ +@[expose] noncomputable def carrierRatioScale {h : ℝ} (hh : 0 ≤ h) : ActualSignedControl.PositiveScale Λ where value l n := roundedCarrier h (reference l n) / roundedCarrier h (chart n) lower := 1 / 2 @@ -1597,6 +1617,7 @@ noncomputable def carrierRatioScale {h : ℝ} (hh : 0 ≤ h) : ActualSignedContr /-- Normal scale, given by `(carrierRatioScale chart reference hh).mul (bandPowerScale chart reference hnear (h / 2 + 1 / 2))`. -/ +@[expose] noncomputable def normalScale {h : ℝ} (hh : 0 ≤ h) : ActualSignedControl.PositiveScale Λ := (carrierRatioScale chart reference hh).mul (bandPowerScale chart reference hnear (h / 2 + 1 / 2)) @@ -1705,6 +1726,7 @@ theorem copy_growth_le /-- The copy chart is assembled from the actual dyadic and slot maps. The only indexing restrictions are the active four-level window and the chosen common-cover budget; all analytic comparisons are derived. -/ +@[expose] noncomputable def copyChart (hr0 : 0 < r0) (hchart : ∀ n, 1 ≤ chart n) (hnear : ∀ l n, chart n ≤ BaseChartJets.cellBand (reference l n) + 4 ∧ @@ -1777,8 +1799,10 @@ end PreparedCopies abbrev Cylinder := PhysicalResidualBridge.Cylinder /-- Radial vector, given by `TorusInverse.vector .radial`. -/ +@[expose] noncomputable def radialVector : Plane := TorusInverse.vector .radial /-- Temporal vector, given by `TorusInverse.vector .temporal`. -/ +@[expose] noncomputable def temporalVector : Plane := TorusInverse.vector .temporal theorem vectors_det : radialVector.1 * temporalVector.2 - radialVector.2 * temporalVector.1 ≠ 0 := @@ -1787,6 +1811,7 @@ theorem vectors_det : radialVector.1 * temporalVector.2 - radialVector.2 * tempo nlinarith [sq_nonneg (Real.sqrt 2 - 1)] /-- Slot linear, bundling `toFun`, `map_add`, `map_smul`, `cont`. -/ +@[expose] noncomputable def slotLinear (g : CommonCoverSolve.Geometry) : Cylinder →L[ℝ] PhaseCalculus.Slot where toFun x := ((x.1.1, x.1.2.1), (x.2, (g.coordinateLinear x.1.2.2).2)) @@ -1796,6 +1821,7 @@ noncomputable def slotLinear (g : CommonCoverSolve.Geometry) : Cylinder →L[ℝ (continuous_snd.prodMk ((g.coordinateLinear.continuous.comp continuous_fst.snd.snd).snd)) /-- Slot coordinates, given by `((x.1.1, x.1.2.1), (x.2, (g.coordinates k x.1.2.2).2))`. -/ +@[expose] noncomputable def slotCoordinates (g : CommonCoverSolve.Geometry) (k : TorusInverse.Frequency) (x : Cylinder) : PhaseCalculus.Slot := ((x.1.1, x.1.2.1), (x.2, (g.coordinates k x.1.2.2).2)) @@ -1857,7 +1883,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, @@ -2029,6 +2055,7 @@ theorem slot_coordinates_from_zero (l : SlotColoring.Label) (gap : ℕ) exact (CopySolveCompatibility.coordinates_refine _ _ _ _).symm /-- Cylinder native, given by `((x.1.1, x.1.2.1), x.1.2.2)`. -/ +@[expose] noncomputable def cylinderNative (x : Cylinder) : Native := ((x.1.1, x.1.2.1), x.1.2.2) theorem copyPoint_eq_reference_view (l : SlotColoring.Label) (n common : ℕ) @@ -2065,13 +2092,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 @@ -2225,6 +2253,7 @@ noncomputable def activeReference (_ : Unit) (q : ℕ) : Label H v a := (activeEnumeration H v a reference chart q).val.2 /-- Active chart, given by `chart (activeEnumeration H v a reference chart q).val.2`. -/ +@[expose] noncomputable def activeChart (q : ℕ) : ℕ := chart (activeEnumeration H v a reference chart q).val.2 @@ -2260,6 +2289,7 @@ end ActiveCopies /-! ## The angle coordinate is retained when making harmonic blocks -/ /-- Cylinder native linear as an element of `Cylinder →L[ℝ] Native`. -/ +@[expose] noncomputable def cylinderNativeLinear : Cylinder →L[ℝ] Native := (ParticularWaveBounds.liftAssoc Plane).toContinuousLinearEquiv.toContinuousLinearMap.comp (ContinuousLinearMap.fst ℝ PhysicalResidualBridge.Lift ℝ) @@ -2275,12 +2305,14 @@ theorem norm_cylinderNativeLinear : ‖cylinderNativeLinear‖ ≤ 1 := by exact norm_fst_le x /-- Cylinder strip, constructed using `ParticularWaveBounds.reindexStrip`. -/ +@[expose] noncomputable def cylinderStrip (s : StripData Native) : StripData Cylinder := ParticularWaveBounds.reindexStrip (StateReindex.cylinder (ParticularWaveBounds.liftAssoc Plane)) (HarmonicWaveInteraction.productStrip s) /-- Cylinder copy chart, bundling `index`, `linear`, `shift`, `maps` and the required compatibility proofs. -/ +@[expose] noncomputable def cylinderCopyChart {Λ I i : Type} {s : StripData Native} {V : JetDomain i Native} {weight : i → Native → ℝ} {K : Λ → ℕ → I → Set Native} (c : ActualSignedControl.CopyChart s V weight K) : @@ -2325,7 +2357,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 +2448,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 @@ -2429,6 +2461,7 @@ noncomputable def swapParameter : Slow ≃ₗᵢ[ℝ] Slow where /-- Parameter linear, constructed using `swapParameter.toContinuousLinearEquiv.toContinuousLinearMap.comp`. -/ +@[expose] noncomputable def parameterLinear (h Q Qr : ℝ) : Slow →L[ℝ] Slow := swapParameter.toContinuousLinearEquiv.toContinuousLinearMap.comp ((slowChange h Q Qr).comp swapParameter.toContinuousLinearEquiv.toContinuousLinearMap) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedOutputBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedOutputBounds.lean index 7fcb0137b0..492f874a30 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,15 +30,17 @@ 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 /-- Joint cell, given by `phaseCell i.1 n i.2`. -/ +@[expose] noncomputable def jointCell (n : ℕ) (i : SignedLabel B N0 × Frequency) : Set FullPoint := phaseCell i.1 n i.2 /-- Primary index, given by `((i.1.2, i.1.1), i.2)`. -/ +@[expose] noncomputable def primaryIndex (i : SignedLabel B N0 × Frequency) : ActualPrimaryBounds.CopyIndex B N0 := ((i.1.2, i.1.1), i.2) @@ -226,6 +228,7 @@ theorem actual_common_bounds (G : SignedMeanGain.Geometry) simpa only [show α - 1 + 1 / 2 = α - 1 / 2 by ring] using common_bounds hr' /-- Mean envelope, given by `envelope l n (x, 0)`. -/ +@[expose] noncomputable def meanEnvelope (l : SignedLabel B N0) (n : ℕ) (x : Point) : ℝ := envelope l n (x, 0) @@ -302,7 +305,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..bb3112eae4 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 @@ -56,6 +56,7 @@ section Freeze variable {D : Type} [NormedAddCommGroup D] [NormedSpace ℝ D] /-- Freeze strip as an element of `StripData D`. -/ +@[expose] noncomputable def freezeStrip (s : StripData D) (m : ℕ) : StripData D := { s with epsilon := fun _ => s.epsilon m @@ -65,12 +66,14 @@ noncomputable def freezeStrip (s : StripData D) (m : ℕ) : StripData D := one_le_slow := fun _ => s.one_le_slow m } /-- Freeze triple, given by `⟨fun _ => v.radial m, fun _ => v.angular m, fun _ => v.axial m⟩`. -/ +@[expose] noncomputable def freezeTriple (v : MeanIncrementBounds.Triple D) (m : ℕ) : MeanIncrementBounds.Triple D := ⟨fun _ => v.radial m, fun _ => v.angular m, fun _ => v.axial m⟩ /-- Freeze context, bundling `operators`, `epsilon`, `radialFrequency`, `fastCoefficient` and the required compatibility proofs. -/ +@[expose] noncomputable def freezeContext (c : Context D) (m : ℕ) : Context D where operators := { c.operators with epsilon := fun _ => c.operators.epsilon m @@ -82,6 +85,7 @@ noncomputable def freezeContext (c : Context D) (m : ℕ) : Context D where /-- Freeze state, bundling `mean`, `pressure`, `oscillation`, `oscillatoryPressure` and the required compatibility proofs. -/ +@[expose] noncomputable def freezeState (u : State D) (m : ℕ) : State D where mean := freezeTriple u.mean m pressure := fun _ => u.pressure m @@ -92,6 +96,7 @@ noncomputable def freezeState (u : State D) (m : ℕ) : State D where /-- Freeze wave, bundling `radius`, `radialBase`, `frequencyBase`, `axialBase` and the required compatibility proofs. -/ +@[expose] noncomputable def freezeWave (a : LinearWaveBounds.WaveCoefficients D) (m : ℕ) : LinearWaveBounds.WaveCoefficients D where radius := fun _ => a.radius m @@ -179,7 +184,8 @@ theorem stateRequest_freeze (s sr : StripData Cylinder) (P : SignedStressPrimiti (hepsilon : sr.epsilon n = s.epsilon m) (x : Cylinder) : PhysicalSignedWave.stateRequest sr P h (freezeContext c m) (freezeState u m) n x = PhysicalSignedWave.stateRequest s P h c u m x := by - change (sr.epsilon n)⁻¹ • _ = (s.epsilon m)⁻¹ • _ + change (sr.epsilon n)⁻¹ • (_ : SignedWaveUpdate.Vec2) = + (s.epsilon m)⁻¹ • (_ : SignedWaveUpdate.Vec2) rw [hepsilon] rfl @@ -188,7 +194,8 @@ theorem stateRequest_freeze_full (s : StripData Point) (sr : StripData Cylinder) (hepsilon : sr.epsilon n = s.epsilon m) (x : Cylinder) : PhysicalSignedWave.stateRequest sr P h (freezeContext c m) (freezeState u m) n x = LocalSignedRequest.fullRequest s P (2 * h) c u m (PhysicalResidualTZ.swapCylinder x) := by - change (sr.epsilon n)⁻¹ • _ = (s.epsilon m)⁻¹ • _ + change (sr.epsilon n)⁻¹ • (_ : SignedWaveUpdate.Vec2) = + (s.epsilon m)⁻¹ • (_ : SignedWaveUpdate.Vec2) rw [hepsilon] rfl @@ -219,6 +226,7 @@ variable {U : PhaseJetBounds.Domain ℕ PhaseCalculus.Slow} /-- The dummy band index repeats one physical scale and one native cover. Every coordinate change is the identity; the supplied primary is retained. -/ +@[expose] noncomputable def identityViews (B : PhysicalSignedWave.PrimaryData U) (m : ℕ) (h Q : ℝ) (cover : ℕ) (hQ : 0 < Q) (hfrequency : B.base.frequency m ≠ 0) : B.Views m where exponent := h @@ -263,6 +271,7 @@ variable (B : PhysicalSignedWave.PrimaryData U) (m : ℕ) /-- Both stored states and both contexts are the same frozen common objects. Only their dummy band index is changed. The native primary is left intact. Residual regularity and periodicity are derived from the primitive data. -/ +@[expose] noncomputable def stateData : (identityViews B m h Q cover hQ hfrequency).StateData where patch := P context := freezeContext c m @@ -344,7 +353,7 @@ end end -@[expose] public section +public section noncomputable section @@ -372,16 +381,18 @@ open CorrectionInitialization CorrectionInitialization.ActualPrimary variable {B N0 : ℕ} /-- Reference, given by `BaseChartJets.cellBand l.1`. -/ +@[expose] 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) /-- Pulse, given by `ActualParticularStageControls.reindexConstruction (phases B N0 j) (fun _ => l.1)`. -/ +@[expose] noncomputable def pulse (l : Label B N0) (j : Fin 2) : PrimaryPulseBounds.PhaseConstruction (domain l) := ActualParticularStageControls.reindexConstruction (phases B N0 j) (fun _ => l.1) @@ -391,10 +402,11 @@ 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`. -/ +@[expose] noncomputable def geometry (l : Label B N0) : CommonCoverSolve.Geometry := ActualSignedGeometry.slotGeometry slots vectors_det (spatialLabel l) 0 @@ -404,6 +416,7 @@ noncomputable def nativeClock (l : Label B N0) (Y : Plane) : ℝ := PeriodicPhaseAssembly.periodicClock (geometry l) (clockWindow l.1).cutoff Y /-- Native free coordinates mapped to the actual common reference lift. -/ +@[expose] noncomputable def toCommon (l : Label B N0) : Point ≃L[ℝ] Point := (CorrectionStep.cycleAssoc.toContinuousLinearEquiv.trans (ActualReferenceRebase.inverseCover @@ -412,6 +425,7 @@ noncomputable def toCommon (l : Label B N0) : Point ≃L[ℝ] Point := /-- To common cylinder, given by `PhysicalResidualTZ.swapCylinder.toContinuousLinearEquiv.trans ((toCommon l).prodCongr (ContinuousLinearEquiv.refl ℝ ℝ))`. -/ +@[expose] noncomputable def toCommonCylinder (l : Label B N0) : Cylinder ≃L[ℝ] Cylinder := PhysicalResidualTZ.swapCylinder.toContinuousLinearEquiv.trans ((toCommon l).prodCongr (ContinuousLinearEquiv.refl ℝ ℝ)) @@ -435,6 +449,7 @@ noncomputable def toCommonCylinder (l : Label B N0) : Cylinder ≃L[ℝ] Cylinde simp only [ContinuousLinearEquiv.symm_apply_apply] /-- Strip, constructed using `freezeStrip`. -/ +@[expose] noncomputable def strip (l : Label B N0) : StripData Cylinder := freezeStrip (ParticularWaveBounds.reindexStrip PhysicalResidualTZ.swapCylinder (HarmonicWaveInteraction.productStrip (BaseContextAssembly.nativeStrip nominal standardRegion))) @@ -442,6 +457,7 @@ noncomputable def strip (l : Label B N0) : StripData Cylinder := /-- Base, given by `freezeWave (ActualReferenceRebase.pullWave (toCommonCylinder l) (chartCoefficients l.2 l.1)) (reference l)`. -/ +@[expose] noncomputable def base (l : Label B N0) : LinearWaveBounds.WaveCoefficients Cylinder := freezeWave (ActualReferenceRebase.pullWave (toCommonCylinder l) (chartCoefficients l.2 l.1)) (reference l) @@ -452,6 +468,7 @@ noncomputable def directions (l : Label B N0) : LinearWaveBounds.GraphDirections (PrimaryResidualClass.directions (commonContext B))) (reference l) /-- Actual selected primary data. Only the dummy index is repeated. -/ +@[expose] noncomputable def primary (l : Label B N0) : PhysicalSignedWave.PrimaryData (domain l) where strip := strip l base := base l @@ -468,6 +485,7 @@ noncomputable def primary (l : Label B N0) : PhysicalSignedWave.PrimaryData (dom ((phases B N0 l.2).phase.shear l.1 ((x.1.1, x.1.2.1), nativeClock l x.1.2.2)) /-- All dummy bands describe this one native physical reference. -/ +@[expose] noncomputable def nativeViews (l : Label B N0) : (primary l).Views (reference l) := identityViews (primary l) (reference l) h (ChartScales.Q (reference l)) (ChartScales.nativeIndex h (reference l)) (ChartScales.Q_pos _) @@ -614,6 +632,7 @@ theorem primary_chart (l : Label B N0) (n : ℕ) : /-- The actual current common state supplies the torus-mean request. The primitive hypotheses concern only the real local incoming fields. -/ +@[expose] noncomputable def nativeStateData (l : Label B N0) (P : SignedStressPrimitive.Patch) (u : State Point) (H : MeanStateRegularity.PrimitiveData standardRegion P.a P.b (commonContext B) u) @@ -688,7 +707,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 +934,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 @@ -925,12 +944,14 @@ noncomputable def nativeCoefficients (l : Label B N0) /-- The scalar and the reference copy family are definable before proving their regularity. No proof or independently chosen request is stored. -/ +@[expose] noncomputable def nativeRequest (l : Label B N0) (P : SignedStressPrimitive.Patch) (u : State Point) : ℕ → Cylinder → SignedWaveUpdate.Vec2 := PhysicalSignedWave.stateRequest (primary l).strip P h (freezeContext (commonContext B) (reference l)) (freezeState u (reference l)) /-- Native copies, constructed using `ActualSignedPhysicalData.dynamicCopyData`. -/ +@[expose] noncomputable def nativeCopies (l : Label B N0) (P : SignedStressPrimitive.Patch) (u : State Point) : PeriodizedWaveBounds.CopyData Cylinder TorusInverse.Frequency := ActualSignedPhysicalData.dynamicCopyData slots outgoing.data.h_pos.le (spatialLabel l) @@ -973,12 +994,14 @@ 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 /-- Common copies as an element of `PeriodizedWaveBounds.CopyData Cylinder TorusInverse.Frequency`. -/ +@[expose] noncomputable def commonCopies : PeriodizedWaveBounds.CopyData Cylinder TorusInverse.Frequency := (ActualSignedStageControls.parameters l).copyData (BaseContextAssembly.nativeStrip nominal standardRegion) @@ -1175,6 +1198,7 @@ end LocalizedComparison /-- After particular, given by `(ActualCycleParameters.fixedParameters B N0).afterParticular x.coefficients (commonContext B) x.state`. -/ +@[expose] noncomputable def afterParticular (x : CorrectionStep.CycleState (Label B N0)) : State Point := (ActualCycleParameters.fixedParameters B N0).afterParticular x.coefficients (commonContext B) x.state diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedPhysicalCoherence.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedPhysicalCoherence.lean index 8fd0581e18..b828552ac3 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 @@ -1426,6 +1426,7 @@ end CurrentRepresentation /-- Cycle input, given by `(ActualCycleParameters.fixedParameters B N0).afterParticular x.coefficients (commonContext B) x.state`. -/ +@[expose] noncomputable def cycleInput (x : CorrectionStep.CycleState (Label B N0)) : CorrectionState.State Point := (ActualCycleParameters.fixedParameters B N0).afterParticular diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedPhysicalData.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedPhysicalData.lean index 09154f44d2..2b5b7cc294 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 @@ -160,11 +160,13 @@ variable {D h : ℝ} /-- Geometry, given by `ActualSignedGeometry.slotGeometry sys ActualSignedGeometry.vectors_det label gap`. -/ +@[expose] noncomputable def geometry (label : SlotColoring.Label) (gap : ℕ) : CommonCoverSolve.Geometry := ActualSignedGeometry.slotGeometry sys ActualSignedGeometry.vectors_det label gap /-- The carrier center is the midpoint of the physical slot, including this copy's own lattice translation. -/ +@[expose] noncomputable def center (label : SlotColoring.Label) (k : Frequency) : Plane := PartitionedCovariance.slotCenter h label + TorusAverages.latticePoint k @@ -227,6 +229,7 @@ theorem width_on_core (label : SlotColoring.Label) (gap : ℕ) (k : Frequency) ( /-- Native mask, given by `PartitionedCovariance.cutoff sys.radius z.1 * PrimaryCopyBounds.outerCutoff (z.2 / ChartScales.slotLength sys.radius h label.1)`. -/ +@[expose] noncomputable def nativeMask (label : SlotColoring.Label) (z : Plane) : ℝ := PartitionedCovariance.cutoff sys.radius z.1 * PrimaryCopyBounds.outerCutoff (z.2 / ChartScales.slotLength sys.radius h label.1) @@ -255,6 +258,7 @@ theorem nativeMask_support (label : SlotColoring.Label) : /-- The concrete compact native layout used to periodize the same signed reference. Its geometry is the existing selected slot geometry. -/ +@[expose] noncomputable def layout (hh : 0 ≤ h) (label : SlotColoring.Label) (hl : 4 ≤ label.1) (gap : ℕ) : ActualPeriodizedSignedRealization.Layout where geometry _ := geometry sys label gap @@ -269,7 +273,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 +285,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)), @@ -329,6 +334,7 @@ variable {D h : ℝ} /-- Dynamic coefficients, constructed using `ActualPeriodizedSignedRealization.coefficientsWith`. -/ +@[expose] noncomputable def dynamicCoefficients (request : ℕ → Cylinder → Vec2) (j : Fin 2) (k : Frequency) : WaveCoefficients Cylinder := ActualPeriodizedSignedRealization.coefficientsWith B (layout sys hh label hl gap) V request j @@ -337,7 +343,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,11 +431,13 @@ 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⟩) /-- Cylinder zero, given by `((PolarCharts.radius (PhysicalGraphBounds.liftXY x), (PhysicalGraphBounds.liftZT x, x.2)), 0)`. -/ +@[expose] noncomputable def cylinderZero (x : LiftPoint) : Cylinder := ((PolarCharts.radius (PhysicalGraphBounds.liftXY x), (PhysicalGraphBounds.liftZT x, x.2)), 0) @@ -595,6 +603,7 @@ variable {D h : ℝ} /-- Wave mask, given by `PartitionedCovariance.cutoff sys.radius z.1 * GaussianTailFlat.profile (z.2 / ChartScales.slotLength sys.radius h label.1)`. -/ +@[expose] noncomputable def waveMask (label : SlotColoring.Label) (z : Plane) : ℝ := PartitionedCovariance.cutoff sys.radius z.1 * GaussianTailFlat.profile (z.2 / ChartScales.slotLength sys.radius h label.1) @@ -618,6 +627,7 @@ theorem waveMask_support (label : SlotColoring.Label) : exact hz (by rw [waveMask_eq_compact, hn, zero_mul]) /-- Selected carrier, constructed using `carrier`. -/ +@[expose] noncomputable def selectedCarrier (L : NativeLabel f.active) (k : Frequency) : PhysicalWaveSum.CarrierData := carrier (h := h) L.val k @@ -628,7 +638,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 +654,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 +663,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 +671,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 +683,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 +697,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 @@ -787,6 +800,7 @@ theorem signed_raw_eq_sum (L : NativeLabel f.active) (x : Cylinder) : /-- Potential map, given by `CurlClassBounds.inverseCarrier K • ((‖N‖ ^ 2)⁻¹ • CurlClassBounds.complexCrossLinear (CurlClassBounds.complexify N))`. -/ +@[expose] noncomputable def potentialMap (K : ℝ) (N : Space) : ComplexVector →L[ℝ] ComplexVector := CurlClassBounds.inverseCarrier K • ((‖N‖ ^ 2)⁻¹ • CurlClassBounds.complexCrossLinear (CurlClassBounds.complexify N)) @@ -1044,6 +1058,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) • @@ -1313,6 +1328,7 @@ abbrev Native := CartesianCopySource.Native abbrev SourceIndex := PhysicalWaveSum.WaveIndex 1 × Frequency /-- Native cylinder, given by `((y.1, ((y.2.1.2, y.2.1.1), y.2.2)), 0)`. -/ +@[expose] noncomputable def nativeCylinder (y : Native) : Cylinder := ((y.1, ((y.2.1.2, y.2.1.1), y.2.2)), 0) @@ -1332,6 +1348,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 +1358,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) • @@ -1612,6 +1629,7 @@ theorem pressure_support (G : ReferenceGeometry sys f) (hh0 : 0 < h) (hh1 : h < /-- The actual vector-potential sum is an axis-preserving copy potential, with the same fixed outer radius used by the physical stage estimates. -/ +@[expose] noncomputable def copyPotential (G : ReferenceGeometry sys f) (hh0 : 0 < h) (hh1 : h < 1 / 2) (ha : 0 < a) (hb : 0 < b) : MixedAxisPreservation.CopyPotential h where Copy := Frequency @@ -1701,6 +1719,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) @@ -1721,12 +1740,14 @@ theorem slotSlow_eq_nativeSlow {a : ℝ} (ha : 0 < a) (c : PhysicalWaveSum.Carri rfl /-- Native past, given by `{y | 0 < y.2.1.1}`. -/ +@[expose] noncomputable def nativePast : Set Native := {y | 0 < y.2.1.1} theorem nativePast_open : IsOpen nativePast := isOpen_lt continuous_const continuous_snd.fst.fst /-- Intersecting native cells with one closed slow support retains their actual local finiteness and their disjointness. -/ +@[expose] noncomputable def restrictCells {E K : Type*} [TopologicalSpace E] (c : PeriodizedWaveBounds.Cells E K) (s : Set E) (hs : IsClosed s) : PeriodizedWaveBounds.Cells E K where @@ -1736,6 +1757,7 @@ noncomputable def restrictCells {E K : Type*} [TopologicalSpace E] unique n i j x hi hj := c.unique n i j x hi.1 hj.1 /-- Primitive core as an element of `Set LiftPoint`. -/ +@[expose] noncomputable def primitiveCore {U : PhaseJetBounds.Domain ℕ PhaseCalculus.Slow} (f : SignedFamily U) (L : PhysicalWaveSum.BandLabel) : Set LiftPoint := {x | ∃ hL : L ∈ f.active, @@ -1752,6 +1774,7 @@ variable {D h : ℝ} /-- The native cell is narrowed only by the support of the original mask and target. This avoids asking for phase estimates outside their Prepared region and does not change any coefficient. -/ +@[expose] noncomputable def localizedPotentialCells (i : Fin 3) : PhysicalCopyBounds.SupportCells (potentialFamily sys hh f i) where cells L := restrictCells ((potentialCells sys hh f i).cells L) @@ -1762,6 +1785,7 @@ noncomputable def localizedPotentialCells (i : Fin 3) : subset_closure ⟨hL, hm, ht⟩⟩ /-- Localized pressure cells, bundling `cells`, `support`, `obtain`. -/ +@[expose] noncomputable def localizedPressureCells : PhysicalCopyBounds.SupportCells (pressureFamily sys hh f) where cells L := restrictCells ((pressureCells sys hh f).cells L) @@ -1830,6 +1854,7 @@ noncomputable def pressureCarrier : /-- Lifted native past, given by `PhysicalClassBounds.cylindricalDomain (a / 4) (2 * b) ∩ PhysicalClassBounds.cylindricalMap ⁻¹' nativePast`. -/ +@[expose] noncomputable def liftedNativePast (a b : ℝ) : Set LiftPoint := PhysicalClassBounds.cylindricalDomain (a / 4) (2 * b) ∩ PhysicalClassBounds.cylindricalMap ⁻¹' nativePast @@ -1973,6 +1998,7 @@ theorem componentSourceBounds {ι X : Type} [NormedAddCommGroup X] [NormedSpace /-- An identity source chart, with its closure property derived from the actual amplitude support. No physical derivative bound is an input. -/ +@[expose] noncomputable def identitySourceChart {N : ℕ} {K I : Type} (f : PhysicalCopyBounds.CopyFamily N K) (cells : PhysicalCopyBounds.SupportCells f) {a b h r Z σ : ℝ} {gap : ℕ} (ha : 0 < a) @@ -2063,6 +2089,7 @@ variable (hp : NativeProfiles (h := h) f) (hn : NativeRegular sys hh f) /-- The physical potential estimate is constructed from the literal cut native potential, Cartesian rotation, and the actual copy geometry. -/ +@[expose] noncomputable def potentialWaveData (hs : LocalPhysicalCopyBounds.LocalSourceBounds s h α w (nativePotentialSource sys hh f)) : PhysicalStageBounds.WaveData h LiftPoint (Fin 3 × SourceIndex) Frequency (Fin 3) where @@ -2097,6 +2124,7 @@ noncomputable def potentialWaveData frequencies _ := carrier_frequencies f hP hf /-- Pressure retains its own physical factor, exactly once. -/ +@[expose] noncomputable def pressureWaveData (hs : LocalPhysicalCopyBounds.LocalSourceBounds s h α w (nativePressureSource sys hh f)) : PhysicalStageBounds.WaveData h LiftPoint SourceIndex Frequency Unit where diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedPotentialCoherence.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedPotentialCoherence.lean index bfc6860366..45f0154e6d 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) • @@ -44,12 +45,13 @@ noncomputable def potentialCoefficient (l : SignedLabel B N0) (u : CorrectionSta ((copies l u).common.amplitude n x) /-- The actual current common coefficient's curl potential. -/ +@[expose] noncomputable def potential (l : SignedLabel B N0) (u : CorrectionState.State Point) (n : ℕ) : FullPoint → ComplexVector := (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 +148,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 +316,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,17 +339,19 @@ 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) /-- A band is used only where its own current slow chart is valid. -/ -noncomputable def physicalDomain (n : ℕ) : Set ProblemStatement.SpaceTime := +@[expose] noncomputable def physicalDomain (n : ℕ) : Set ProblemStatement.SpaceTime := {z | 0 < z.2 0 ∧ (nativePoint n z).1.2.1 ∈ standardRegion.carrier} theorem physicalDomain_open (n : ℕ) : IsOpen (physicalDomain n) := by diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedReferenceGeometry.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedReferenceGeometry.lean index 7f5e24a939..621c58be45 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 @@ -247,6 +247,7 @@ variable {B N0 : ℕ} /-- Request, given by `LocalSignedRequest.fullRequest ActualPrimaryBounds.strip P (2 * ActualPrimary.h) (ActualPrimary.commonContext B) u`. -/ +@[expose] noncomputable def request (P : SignedStressPrimitive.Patch) (u : State Point) := LocalSignedRequest.fullRequest ActualPrimaryBounds.strip P (2 * ActualPrimary.h) (ActualPrimary.commonContext B) u @@ -257,10 +258,12 @@ variable (P : SignedStressPrimitive.Patch) (u : State Point) (hp : GaugeMomentBalances.MovingField ActualPrimary.standardRegion P.a P.b u.pressure) /-- States, given by `ActualSignedPhysicalBinding.nativeStateData l P u H hp`. -/ +@[expose] noncomputable def states (l : Label B N0) : (ActualSignedPhysicalBinding.nativeViews l).StateData := ActualSignedPhysicalBinding.nativeStateData l P u H hp /-- Branch, given by `(ActualSignedExterior.family (states P u H hp)).singleton L`. -/ +@[expose] noncomputable def branch (L : NativeLabel B N0) := (ActualSignedExterior.family (states P u H hp)).singleton L @@ -383,6 +386,20 @@ theorem branch_pressure_reference (L : NativeLabel B N0) (k : Copy) (x : Cylinde (ActualSignedPhysicalData.layout ActualPrimary.slots ActualPrimary.outgoing.data.h_pos.le L.val L.property 0) _ L.val.1 k x) = _ rw [layout_eq, ← ActualSignedExterior.actualLabel_reference L] + let f := ActualSignedExterior.family (B := B) (N0 := N0) + (states (B := B) (N0 := N0) P u H hp) + have hprimary : (f.singleton L).primary (f.singletonLabel L) = + ActualSignedPhysicalBinding.primary (ActualSignedExterior.actualLabel L) := by + rfl + have hcolumn : (f.singleton L).column (f.singletonLabel L) = + (ActualSignedExterior.actualLabel L).2 := by + rfl + have hlabel : (f.singletonLabel L).val.1 = + ActualSignedPhysicalBinding.reference (ActualSignedExterior.actualLabel L) := by + change L.val.1 = _ + exact (ActualSignedExterior.actualLabel_reference L).symm + unfold branch branchLabel + rw [hprimary, hcolumn, hlabel] rfl theorem branch_potential_reference (L : NativeLabel B N0) (k : Copy) (x : Cylinder) : @@ -518,7 +535,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 +798,7 @@ end end -@[expose] public section +public section noncomputable section @@ -971,6 +988,7 @@ abbrev Native := ActualSignedPhysicalData.Native abbrev Label (B N0 : ℕ) := ActualSignedPhysicalBinding.Label B N0 /-- Native cylinder map as an element of `Native →L[ℝ] PhysicalSignedWave.Cylinder`. -/ +@[expose] noncomputable def nativeCylinderMap : Native →L[ℝ] PhysicalSignedWave.Cylinder := let r := ContinuousLinearMap.fst ℝ ℝ (TorusInverse.Plane × TorusInverse.Plane) let s := ContinuousLinearMap.snd ℝ ℝ (TorusInverse.Plane × TorusInverse.Plane) @@ -984,6 +1002,7 @@ theorem nativeCylinderMap_apply (y : Native) : /-- Native to common, given by `(ActualSignedPhysicalBinding.toCommonCylinder l).toContinuousLinearMap.comp nativeCylinderMap`. -/ +@[expose] noncomputable def nativeToCommon {B N0 : ℕ} (l : Label B N0) : Native →L[ℝ] FullPoint := (ActualSignedPhysicalBinding.toCommonCylinder l).toContinuousLinearMap.comp nativeCylinderMap diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedStageControls.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedStageControls.lean index ed48461c4c..3dd50dd629 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,52 +50,53 @@ 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)) /-- Clock scale, given by `PhysicalParticularWave.clockWeight ActualPrimary.h (ChartScales.Q n) (ChartScales.Q (BaseChartJets.cellBand l.1))`. -/ +@[expose] noncomputable def clockScale (l : SignedLabel B N0) (n : ℕ) : ℝ := PhysicalParticularWave.clockWeight ActualPrimary.h (ChartScales.Q 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 +104,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 +118,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 @@ -239,6 +241,7 @@ open PhaseJetBounds PrimaryCopyBounds abbrev PulseLabel (B N0 : ℕ) := Fin 2 × ActualPrimary.Label B N0 /-- Slow jet domain, bundling `toDomain`, `growth`, `scale_le_growth`. -/ +@[expose] noncomputable def slowJetDomain (U : LocalSignedRequest.SlowRegion (2 * ActualPrimary.h)) : JetDomain (PulseLabel B N0) PhaseCalculus.Slow where toDomain := ActualPhaseDefect.reducedSlowDomain U @@ -361,6 +364,7 @@ noncomputable def nativeUnit (l : PulseLabel B N0) : PhaseCalculus.Slow × ℝ ((ActualPrimary.phases B N0 l.1).L l.2) /-- Native envelope, constructed using `PrimaryPulseBounds.referenceP`. -/ +@[expose] noncomputable def nativeEnvelope (l : PulseLabel B N0) (z : PhaseCalculus.Slow × ℝ) : ℝ := PrimaryPulseBounds.referenceP ((ActualPrimary.phases B N0 l.1).lam l.2) ((ActualPrimary.phases B N0 l.1).u l.2) ((ActualPrimary.phases B N0 l.1).L l.2) @@ -554,6 +558,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 @@ -612,14 +617,17 @@ theorem cutoff_zero_germ_outside_time (l : SignedLabel B N0) (n : ℕ) (k : Freq /-! ## Uniform transport on the actual closed control cells -/ /-- Full strip, given by `ActualPrimaryBounds.fullStrip`. -/ +@[expose] noncomputable def fullStrip : StripData FullPoint := ActualPrimaryBounds.fullStrip /-- Envelope, given by `ActualPrimaryBounds.fullEnvelope (l.2, l.1)`. -/ +@[expose] noncomputable def envelope (l : SignedLabel B N0) : ℕ → FullPoint → ℝ := ActualPrimaryBounds.fullEnvelope (l.2, l.1) /-- Phase cell, given by `{x | x ∈ ActualPrimaryBounds.controlCell n ((l.2, l.1), k) ∧ nativeTime l n k x ∈ Icc (1 / 10 : ℝ) (9 / 10)}`. -/ +@[expose] noncomputable def phaseCell (l : SignedLabel B N0) (n : ℕ) (k : Frequency) : Set FullPoint := {x | x ∈ ActualPrimaryBounds.controlCell n ((l.2, l.1), k) ∧ nativeTime l n k x ∈ Icc (1 / 10 : ℝ) (9 / 10)} @@ -724,6 +732,7 @@ theorem matrix_local_jets (r c : Fin 2) : /-- Slow linear, given by `(ContinuousLinearMap.fst ℝ PhaseCalculus.Slow ℝ).comp (ActualPrimaryBounds.slotLinear (l.2, l.1) n)`. -/ +@[expose] noncomputable def slowLinear (l : SignedLabel B N0) (n : ℕ) : FullPoint →L[ℝ] PhaseCalculus.Slow := (ContinuousLinearMap.fst ℝ PhaseCalculus.Slow ℝ).comp (ActualPrimaryBounds.slotLinear (l.2, l.1) n) @@ -916,6 +925,7 @@ noncomputable def nativeCovariance (B N0 : ℕ) : /-- Normalize native, given by `(ContinuousLinearMap.fst ℝ PhaseCalculus.Slow Plane).prod (ActualPrimaryBounds.timeProjection L)`. -/ +@[expose] noncomputable def normalizeNative (L : ActualPrimary.Label B N0) : Native →L[ℝ] (PhaseCalculus.Slow × ℝ) := (ContinuousLinearMap.fst ℝ PhaseCalculus.Slow Plane).prod @@ -940,6 +950,7 @@ theorem normalizeNative_norm (L : ActualPrimary.Label B N0) : /-- Pulse linear, given by `(normalizeNative l.1).comp ((ActualPrimaryBounds.copyLinear (l.2, l.1) n).comp ActualPrimaryBounds.nativeOfFull)`. -/ +@[expose] noncomputable def pulseLinear (l : SignedLabel B N0) (n : ℕ) : FullPoint →L[ℝ] (PhaseCalculus.Slow × ℝ) := (normalizeNative l.1).comp @@ -1143,6 +1154,7 @@ theorem native_cutoff_jets : /-- Full copy linear, given by `(ActualPrimaryBounds.copyLinear (l.2, l.1) n).comp ActualPrimaryBounds.nativeOfFull`. -/ +@[expose] noncomputable def fullCopyLinear (l : SignedLabel B N0) (n : ℕ) : FullPoint →L[ℝ] Native := (ActualPrimaryBounds.copyLinear (l.2, l.1) n).comp ActualPrimaryBounds.nativeOfFull diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedUnmaskedBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedUnmaskedBounds.lean index 55090a7711..44b5bfe229 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 @@ -276,6 +276,7 @@ theorem potential_jets {β : ℝ} {request : ℕ → Full → SignedWaveUpdate.V /-! ## Removing the cutoff preserves the literal own-band zero germs -/ /-- Reference, given by `BaseChartJets.cellBand l.1`. -/ +@[expose] noncomputable def reference (l : Label B N0) : ℕ := BaseChartJets.cellBand l.1 theorem dyadicFactor_reference (l : Label B N0) (k : Copy) (x : Full) : @@ -331,7 +332,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..63378c0a4b 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 @@ -65,18 +65,21 @@ variable (P : SignedStressPrimitive.Patch) (u : State LocalSignedRequest.Point) /-- Family, given by `ActualSignedExterior.family (fun l : Label B N0 => ActualSignedPhysicalBinding.nativeStateData l P u H hp)`. -/ +@[expose] noncomputable def family : DependentSignedPhysicalFamily.Family := ActualSignedExterior.family (fun l : Label B N0 => ActualSignedPhysicalBinding.nativeStateData l P u H hp) /-- Potential source, given by `DependentSignedPhysicalFamily.jointSource ((family (N0 := N0) P u H hp).potentialSource slots outgoing.data.h_pos.le)`. -/ +@[expose] noncomputable def potentialSource : SourceIndex → ℕ → Native → HarmonicCalculus.ComplexVector := DependentSignedPhysicalFamily.jointSource ((family (N0 := N0) P u H hp).potentialSource slots outgoing.data.h_pos.le) /-- Pressure source, given by `DependentSignedPhysicalFamily.jointSource ((family (N0 := N0) P u H hp).pressureSource slots outgoing.data.h_pos.le)`. -/ +@[expose] noncomputable def pressureSource : SourceIndex → ℕ → Native → ℂ := DependentSignedPhysicalFamily.jointSource ((family (N0 := N0) P u H hp).pressureSource slots outgoing.data.h_pos.le) @@ -125,6 +128,7 @@ theorem norm_coverPower_symm_le (d : ℕ) (y : TorusInverse.Plane) : exact (ih _).trans (norm_coverEquiv_symm_le y) /-- Native to common as an element of `Native →L[ℝ] Full`. -/ +@[expose] noncomputable def nativeToCommon (l : Label B N0) : Native →L[ℝ] Full := (ActualSignedPhysicalBinding.toCommonCylinder l).toContinuousLinearMap.comp (PhysicalResidualTZ.swapCylinder.toContinuousLinearEquiv.toContinuousLinearMap.comp @@ -810,7 +814,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 @@ -831,6 +835,7 @@ theorem liftPast_open : IsOpen liftPast := /-- The carrier and gap are unchanged. Only the amplitude is extended by zero outside positive native lift time. -/ +@[expose] noncomputable def gate {H : ℕ} {K : Type*} (f : CopyFamily H K) : CopyFamily H K := by classical exact { @@ -875,6 +880,7 @@ theorem gate_amplitude_support_subset (f : CopyFamily H K) (k : K) (I : WaveInde fun x hx => ((gate_amplitude_ne_zero_iff f k I x).mp hx).2 /-- The original closed copy cells still contain the gated amplitude. -/ +@[expose] noncomputable def gateCells {f : CopyFamily H K} (hc : SupportCells f) : SupportCells (gate f) where cells := hc.cells support I k := (gate_amplitude_support_subset f k I).trans (hc.support I k) @@ -883,6 +889,7 @@ noncomputable def gateCells {f : CopyFamily H K} (hc : SupportCells f) : Support (gateCells hc).cells = hc.cells := rfl /-- Carrier bounds refer to the same carrier and the same cells. -/ +@[expose] noncomputable def gateCarrier {f : CopyFamily H K} (hc : SupportCells f) {a b h r0 : ℝ} (hb : CarrierBounds f hc a b h r0) : CarrierBounds (gate f) (gateCells hc) a b h r0 where region := hb.region @@ -1038,7 +1045,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 +1151,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1239,22 +1246,26 @@ variable {D h : ℝ} /-- Only the positive-time representative changes; the native potential source and every carrier are the original ones. -/ +@[expose] noncomputable def potentialCopies (i : Fin 3) : PhysicalCopyBounds.CopyFamily 1 Frequency := PositiveTimeCopyFamily.gate (ActualSignedPhysicalData.potentialFamily sys hh f i) /-- Pressure copies, given by `PositiveTimeCopyFamily.gate (ActualSignedPhysicalData.pressureFamily sys hh f)`. -/ +@[expose] noncomputable def pressureCopies : PhysicalCopyBounds.CopyFamily 1 Frequency := PositiveTimeCopyFamily.gate (ActualSignedPhysicalData.pressureFamily sys hh f) /-- Potential cells, given by `PositiveTimeCopyFamily.gateCells (localizedPotentialCells sys hh f i)`. -/ +@[expose] noncomputable def potentialCells (i : Fin 3) : PhysicalCopyBounds.SupportCells (potentialCopies sys hh f i) := PositiveTimeCopyFamily.gateCells (localizedPotentialCells sys hh f i) /-- Pressure cells, given by `PositiveTimeCopyFamily.gateCells (localizedPressureCells sys hh f)`. -/ +@[expose] noncomputable def pressureCells : PhysicalCopyBounds.SupportCells (pressureCopies sys hh f) := PositiveTimeCopyFamily.gateCells (localizedPressureCells sys hh f) @@ -1742,7 +1753,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 +2041,7 @@ assembly. The source-domain statements concern the original, ungated amplitudes on positive lift time. -/ -@[expose] public section +public section noncomputable section @@ -2103,11 +2114,13 @@ variable {B N0 : ℕ} (s : ∀ l : Label B N0, (ActualSignedPhysicalBinding.nativeViews l).StateData) /-- The actual aggregate potential copies, with the sole positive-time gate. -/ +@[expose] noncomputable def potentialCopies (i : Fin 3) : CopyFamily 1 TorusInverse.Frequency := PositiveTimeCopyFamily.gate ((ActualSignedExterior.family s).potentialCopies slots outgoing.data.h_pos.le i) /-- The actual aggregate pressure copies, with the same gate. -/ +@[expose] noncomputable def pressureCopies : CopyFamily 1 TorusInverse.Frequency := PositiveTimeCopyFamily.gate ((ActualSignedExterior.family s).pressureCopies slots outgoing.data.h_pos.le) @@ -2236,7 +2249,7 @@ end end -@[expose] public section +public section noncomputable section @@ -2257,6 +2270,7 @@ abbrev SourceIndex := Σ (_ : BandLabel), ActualSignedPhysicalData.SourceIndex variable {B N0 : ℕ} /-- Native states, given by `ActualSignedPhysicalBinding.nativeStateData l P u H hp`. -/ +@[expose] noncomputable def nativeStates (P : SignedStressPrimitive.Patch) (u : State LocalSignedRequest.Point) (H : MeanStateRegularity.PrimitiveData standardRegion P.a P.b (commonContext B) u) @@ -2265,6 +2279,7 @@ noncomputable def nativeStates (P : SignedStressPrimitive.Patch) (u : State ActualSignedPhysicalBinding.nativeStateData l P u H hp /-- Family, given by `ActualSignedExterior.family (nativeStates (N0 := N0) P u H hp)`. -/ +@[expose] noncomputable def family (P : SignedStressPrimitive.Patch) (u : State LocalSignedRequest.Point) (H : MeanStateRegularity.PrimitiveData standardRegion P.a P.b (commonContext B) u) (hp : GaugeMomentBalances.MovingField standardRegion P.a P.b u.pressure) : @@ -2334,6 +2349,7 @@ section CopyFamilies variable (s : ∀ l : Label B N0, (ActualSignedPhysicalBinding.nativeViews l).StateData) /-- Original potential cells, constructed using `DependentSignedPhysicalFamily.diagonalCells`. -/ +@[expose] noncomputable def originalPotentialCells (i : Fin 3) : SupportCells ((ActualSignedExterior.family s).potentialCopies slots outgoing.data.h_pos.le i) := DependentSignedPhysicalFamily.diagonalCells _ @@ -2344,6 +2360,7 @@ noncomputable def originalPotentialCells (i : Fin 3) : ((ActualSignedExterior.family s).singleton L) i)) /-- Original pressure cells, constructed using `DependentSignedPhysicalFamily.diagonalCells`. -/ +@[expose] noncomputable def originalPressureCells : SupportCells ((ActualSignedExterior.family s).pressureCopies slots outgoing.data.h_pos.le) := DependentSignedPhysicalFamily.diagonalCells _ @@ -2434,21 +2451,25 @@ noncomputable def originalPressureCarrier : /-- The actual assembled copies, extended by zero outside positive lift time. Their fields agree with the original signed fields before t=1. -/ +@[expose] noncomputable def potentialCopies (i : Fin 3) : CopyFamily 1 TorusInverse.Frequency := PositiveTimeCopyFamily.gate ((ActualSignedExterior.family s).potentialCopies slots outgoing.data.h_pos.le i) /-- Pressure copies, given by `PositiveTimeCopyFamily.gate ((ActualSignedExterior.family s).pressureCopies slots outgoing.data.h_pos.le)`. -/ +@[expose] noncomputable def pressureCopies : CopyFamily 1 TorusInverse.Frequency := PositiveTimeCopyFamily.gate ((ActualSignedExterior.family s).pressureCopies slots outgoing.data.h_pos.le) /-- Potential cells, given by `PositiveTimeCopyFamily.gateCells (originalPotentialCells s i)`. -/ +@[expose] noncomputable def potentialCells (i : Fin 3) : SupportCells (potentialCopies s i) := PositiveTimeCopyFamily.gateCells (originalPotentialCells s i) /-- Pressure cells, given by `PositiveTimeCopyFamily.gateCells (originalPressureCells s)`. -/ +@[expose] noncomputable def pressureCells : SupportCells (pressureCopies s) := PositiveTimeCopyFamily.gateCells (originalPressureCells s) @@ -2557,6 +2578,7 @@ theorem pressure_frequencies (k : TorusInverse.Frequency) (L : BandLabel) : /-! ## The jointly indexed Cartesian sources -/ /-- Source strip, constructed using `CartesianCopySource.pullStrip`. -/ +@[expose] noncomputable def sourceStrip : WeightedClasses.StripData PhysicalGraphBounds.LiftPoint := CartesianCopySource.pullStrip ActualPrimaryBounds.strip ActualPolarCoverage.inner ActualPolarCoverage.outer ActualPolarCoverage.inner_pos @@ -2632,6 +2654,7 @@ variable (s : ∀ l : Label B N0, (ActualSignedPhysicalBinding.nativeViews l).St /-- The physical potential datum is assembled once over all source labels. The source estimate and profile constants are chosen before those labels. -/ +@[expose] noncomputable def potentialOfNative (hs : LocalPhysicalCopyBounds.LocalSourceBounds ActualPrimaryBounds.strip h α (fun (_ : SourceIndex) _ y => Real.sqrt (ActualPrimaryBounds.strip.zeta y)) @@ -2663,7 +2686,10 @@ noncomputable def potentialOfNative sourceStrip (potentialSource s) (fun k I => (i, ⟨I.1, (I, k)⟩)) (potential_amplitude_eq_source s i) (ActualSignedFamilySupport.potential_source_domain s i) - chart_maps _ _ _ := fun _ hx => hx.1 + chart_maps _ _ _ := by + intro x hx + change x ∈ sourceStrip.domain ∩ PositiveTimeCopyFamily.liftPast at hx + exact hx.1 carrier := potentialCarrier s support := ActualSignedFamilySupport.potential_support s hgeo smooth := ActualSignedFamilySupport.potential_smooth s hgeo hn @@ -2671,6 +2697,7 @@ noncomputable def potentialOfNative /-- Pressure of native, bundling `lowerRadius`, `upperRadius`, `nativeWidth`, `slowBound` and the required compatibility proofs. -/ +@[expose] noncomputable def pressureOfNative (hs : LocalPhysicalCopyBounds.LocalSourceBounds ActualPrimaryBounds.strip h α (fun (_ : SourceIndex) _ y => Real.sqrt (ActualPrimaryBounds.strip.zeta y)) @@ -2702,7 +2729,10 @@ noncomputable def pressureOfNative sourceStrip (pressureSource s) (fun k I => ⟨I.1, (I, k)⟩) (pressure_amplitude_eq_source s) (ActualSignedFamilySupport.pressure_source_domain s) - chart_maps _ _ _ := fun _ hx => hx.1 + chart_maps _ _ _ := by + intro x hx + change x ∈ sourceStrip.domain ∩ PositiveTimeCopyFamily.liftPast at hx + exact hx.1 carrier _ := pressureCarrier s support _ := ActualSignedFamilySupport.pressure_support s hgeo smooth _ := ActualSignedFamilySupport.pressure_smooth s hgeo hn @@ -2765,6 +2795,7 @@ variable (u : State LocalSignedRequest.Point) /-- Genuine primitive and measured residual data produce the entire potential record. Native regularity and native output bounds are derived. -/ +@[expose] noncomputable def potentialFromResiduals : PhysicalStageBounds.WaveData h PhysicalGraphBounds.LiftPoint (Fin 3 × SourceIndex) TorusInverse.Frequency (Fin 3) := @@ -2780,6 +2811,7 @@ noncomputable def potentialFromResiduals : exact he) /-- Pressure from residuals, constructed using `pressureOfNative`. -/ +@[expose] noncomputable def pressureFromResiduals : PhysicalStageBounds.WaveData h PhysicalGraphBounds.LiftPoint SourceIndex TorusInverse.Frequency Unit := @@ -2816,6 +2848,7 @@ variable {σ : ℝ} (x : CycleState (Label B N0)) /-- The post-particular theorem supplies every analytic hypothesis; the physical copies use its same reconstructed state and pressure primitive. -/ +@[expose] noncomputable def cyclePotentialData : PhysicalStageBounds.WaveData h PhysicalGraphBounds.LiftPoint (Fin 3 × SourceIndex) TorusInverse.Frequency (Fin 3) := @@ -2824,6 +2857,7 @@ noncomputable def cyclePotentialData : (1 + σ - ChartScales.kappa) R.reconstructed R.theta R.axial /-- Cycle pressure data, constructed using `pressureFromResiduals`. -/ +@[expose] noncomputable def cyclePressureData : PhysicalStageBounds.WaveData h PhysicalGraphBounds.LiftPoint SourceIndex TorusInverse.Frequency Unit := diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSlowAxis.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSlowAxis.lean index e46f4b2e2c..6bcd4e4eff 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 @@ -2220,6 +2220,7 @@ open SlowRecursion (AxisFunction Coefficient) /-- A conjugation-invariant open neighborhood whose real points remain in the real profile domain. It retains the entire closed physical window. -/ +@[expose] noncomputable def parameterDomain (Ω : Set ℂ) : Set ℂ := Ω ∩ (starRingEnd ℂ) ⁻¹' Ω ∩ Complex.re ⁻¹' ReferencePath.parameterInterval @@ -2416,6 +2417,7 @@ theorem element_profile_germ {T δ : ℝ} (hT : 0 < T) (hδ : 0 < δ) exact element_profile E hT hδ hδT κ hP0 S i hp.1.le hp.2 /-- Base, constructed using `SlowRecursion.makeBase`. -/ +@[expose] noncomputable def base {T δ : ℝ} (hT : 0 < T) (hδ : 0 < δ) (hδT : 2 * δ < ReferencePath.rampLimit) (κ : ℝ) (hP0 : ContDiff ℝ ∞ P0) (C : ℝ) {S : ℝ} (hS : 0 < S) : Coefficient S (parameterDomain Ω) := @@ -2478,6 +2480,7 @@ theorem base_beta_value {T δ : ℝ} (hT : 0 < T) (hδ : 0 < δ) (real_domain_mem N hX.1.le (parameterDomain_real_interval heta)) hX.1.ne')) /-- A fixed radial rectangle strictly containing the entire initial collar. -/ +@[expose] noncomputable def axisRadius (N : ReferencePath.Input) (δ : ℝ) : ℝ := Real.sqrt (N.endpoint * Real.exp δ) + 1 @@ -2494,6 +2497,7 @@ theorem collar_lt_square (N : ReferencePath.Input) (δ : ℝ) : nlinarith /-- Hierarchy used in actual slow axis. -/ +@[expose] noncomputable def hierarchy {T δ : ℝ} (hT : 0 < T) (hδ : 0 < δ) (hδT : 2 * δ < ReferencePath.rampLimit) (κ : ℝ) (hP0 : ContDiff ℝ ∞ P0) (C : ℝ) := let hc := axisRadius_pos N δ @@ -2574,6 +2578,7 @@ theorem actualPressure_smooth : ContDiff ℝ ∞ P0 := by /-- From natural, given by `hierarchy (constructedTube hp hP0 F hΛ hsmall hσ) hT hδ hδT κ (actualPressure_smooth hp hP0) C`. -/ +@[expose] noncomputable def fromNatural {T δ : ℝ} (hT : 0 < T) (hδ : 0 < δ) (hδT : 2 * δ < ReferencePath.rampLimit) (κ : ℝ) := hierarchy (constructedTube hp hP0 F hΛ hsmall hσ) hT hδ hδT κ (actualPressure_smooth hp hP0) C diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualStageEstimates.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualStageEstimates.lean index e0c7d60195..1f6b82f7df 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 @@ -35,6 +35,7 @@ open scoped ContDiff Topology BigOperators /-- Add an unused tag to native source indices. The actual copies, their carriers, and their physical fields are unchanged. -/ +@[expose] noncomputable def taggedSource {h : ℝ} {D : Type} [NormedAddCommGroup D] [NormedSpace ℝ D] {I K J T : Type*} (tag : T) (W : PhysicalStageBounds.WaveData h D I K J) : PhysicalStageBounds.WaveData h D (T × I) K J where @@ -90,7 +91,7 @@ noncomputable def taggedSource {h : ℝ} {D : Type} [NormedAddCommGroup D] [Norm /-! ## One fixed native iteration -/ /-- Step data, constructed using `CorrectionAnalyticStep.StepData`. -/ -noncomputable def StepData (B N0 j : ℕ) +@[expose] noncomputable def StepData (B N0 j : ℕ) (H : ActualCyclePreservation.Invariant (ActualIterationLedger.sigma j) (ActualCyclePreservation.state B N0 j)) : Type := CorrectionAnalyticStep.StepData ActualInitialization.geometry h (CommonWindow.index h) @@ -157,6 +158,7 @@ theorem nativePressure_eq_ledger (j : ℕ) : variable {B N0 N : ℕ} /-- Temporal input, given by `actualCycleTemporalInput M j hN (R.result j).afterSignedAxial`. -/ +@[expose] noncomputable def temporalInput (R : RunData B N0) (M : ActualMeanPhysicalData.InitialCycleInput B N0 N (fun _ => ActualCycleParameters.fixedParameters B N0)) @@ -164,6 +166,7 @@ noncomputable def temporalInput (R : RunData B N0) actualCycleTemporalInput M j hN (R.result j).afterSignedAxial /-- Rank input, given by `actualCycleRankInput M j hN (R.rank_class j)`. -/ +@[expose] noncomputable def rankInput (R : RunData B N0) (M : ActualMeanPhysicalData.InitialCycleInput B N0 N (fun _ => ActualCycleParameters.fixedParameters B N0)) @@ -172,6 +175,7 @@ noncomputable def rankInput (R : RunData B N0) /-- Angular input, given by `actualCycleAngularInput M j hN (R.result j).temporal (R.result j).rank`. -/ +@[expose] noncomputable def angularInput (R : RunData B N0) (M : ActualMeanPhysicalData.InitialCycleInput B N0 N (fun _ => ActualCycleParameters.fixedParameters B N0)) @@ -180,6 +184,7 @@ noncomputable def angularInput (R : RunData B N0) /-- Pressure input, given by `actualCyclePressureInput M j hN (R.result j).pressure /-! ## Actual wave records and their native exponents -/`. -/ +@[expose] noncomputable def pressureInput (R : RunData B N0) (M : ActualMeanPhysicalData.InitialCycleInput B N0 N (fun _ => ActualCycleParameters.fixedParameters B N0)) @@ -229,7 +234,7 @@ variable {DP DS : Type} [NormedAddCommGroup DP] [NormedSpace ℝ DP] /-- Cycle inputs, bundling `particularPotential`, `signedPotential`, `particularPressure`, `signedPressure` and the required compatibility proofs. -/ -noncomputable def cycleInputs : CycleInputs h DP (Fin 3 × IP) KP DS (Fin 3 × IS) KS where +@[expose] noncomputable def cycleInputs : CycleInputs h DP (Fin 3 × IP) KP DS (Fin 3 × IS) KS where particularPotential := W.particularPotential signedPotential := W.signedPotential particularPressure j := taggedSource (0 : Fin 3) (W.particularPressure j) @@ -291,7 +296,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..cd4768c9d0 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 @@ -46,6 +46,7 @@ variable {D I : Type} [NormedAddCommGroup D] [NormedSpace ℝ D] /-- A qualitative domain for the same operators. No quantitative bound is extended from the original strip. -/ +@[expose] noncomputable def onDomain (s : StripData D) (Ω : Set D) (hΩ : IsOpen Ω) : StripData D where domain := Ω isOpen_domain := hΩ @@ -196,6 +197,7 @@ Fréchet derivatives, transferred through an open neighborhood. -/ /-- Translation on, given by `∀ x ∈ Ω, f (x + z) = f x`. -/ +@[expose] noncomputable def TranslationOn {E : Type} (Ω : Set D) (z : D) (f : D → E) : Prop := ∀ x ∈ Ω, f (x + z) = f x @@ -396,6 +398,7 @@ abbrev Cylinder := Point × ℝ /-- Full domain, given by `HarmonicResidual.liftDomain (PhysicalMeanDomain.slowDomain U.carrier)`. -/ +@[expose] noncomputable def fullDomain {coord : ℝ} (U : LocalSignedRequest.SlowRegion coord) : Set Cylinder := HarmonicResidual.liftDomain (PhysicalMeanDomain.slowDomain U.carrier) @@ -404,6 +407,7 @@ theorem fullDomain_open {coord : ℝ} (U : LocalSignedRequest.SlowRegion coord) (PhysicalMeanDomain.slowDomain_open U.isOpen).prod isOpen_univ /-- Native domain, given by `e.symm ⁻¹' fullDomain U`. -/ +@[expose] noncomputable def nativeDomain {coord : ℝ} (e : Cylinder ≃ₗᵢ[ℝ] D) (U : LocalSignedRequest.SlowRegion coord) : Set D := e.symm ⁻¹' fullDomain U @@ -412,11 +416,13 @@ theorem nativeDomain_open {coord : ℝ} (e : Cylinder ≃ₗᵢ[ℝ] D) (fullDomain_open U).preimage e.symm.continuous /-- Deck shift, given by `((0, (0, ((k.1 : ℝ), (k.2 : ℝ)))), 0)`. -/ +@[expose] noncomputable def deckShift (k : TorusInverse.Frequency) : Cylinder := ((0, (0, ((k.1 : ℝ), (k.2 : ℝ)))), 0) /-- Mode oscillation, defined pointwise by `(vectorMode (a.background.frequency n) (a.background.phase n) ((a.commonCorrected s d).amplitude n) (e x) i).re`. -/ +@[expose] noncomputable def modeOscillation (a : CopyData D I) (s : StripData D) (d : GraphDirections D) (e : Cylinder ≃ₗᵢ[ℝ] D) : Oscillation Point := fun n x i => (vectorMode (a.background.frequency n) (a.background.phase n) @@ -552,15 +558,18 @@ open CorrectionStep ParticularWaveAssembly ParticularWaveBounds CopyAngularInvar abbrev ParticularSpace := (CycleSlow × ℝ) × TorusInverse.Plane /-- Particular chart, given by `(StateReindex.cylinder cycleAssoc).trans angleShuffle`. -/ +@[expose] noncomputable def particularChart : Cylinder ≃ₗᵢ[ℝ] ParticularSpace := (StateReindex.cylinder cycleAssoc).trans angleShuffle /-- Particular strip, given by `ParticularParameters.nativeStrip (reindexStrip cycleAssoc.symm p.strip)`. -/ +@[expose] noncomputable def particularStrip {ι : Type} (p : CycleParameters ι) : StripData ParticularSpace := ParticularParameters.nativeStrip (reindexStrip cycleAssoc.symm p.strip) /-- Particular copy data as an element of `CopyData ParticularSpace TorusInverse.Frequency`. -/ +@[expose] noncomputable def particularCopyData {ι : Type} (p : CycleParameters ι) (v : CycleCoefficients ι) (c : Context Point) (u : State Point) (l : ι) (j : ℤ) : CopyData ParticularSpace TorusInverse.Frequency := @@ -947,7 +956,7 @@ end end -@[expose] public section +public section noncomputable section @@ -968,6 +977,7 @@ variable {B N0 : ℕ} /-- Ordered, given by `CommonWindow.index ActualPrimary.h n ≤ ChartScales.nativeIndex ActualPrimary.h (BaseChartJets.cellBand l.1)`. -/ +@[expose] noncomputable def Ordered (l : Index B N0) (n : ℕ) : Prop := CommonWindow.index ActualPrimary.h n ≤ ChartScales.nativeIndex ActualPrimary.h (BaseChartJets.cellBand l.1) @@ -1435,6 +1445,7 @@ theorem target_zero_outside {p : PhaseCalculus.Slow} simp only [PrimaryTargetBounds.actualTarget, hz, smul_zero] /-- Radius, given by `x.1.1 / VariableGaugeMean.qLength (2 * ActualPrimary.h) x.1.2.1`. -/ +@[expose] noncomputable def radius (x : FullPoint) : ℝ := x.1.1 / VariableGaugeMean.qLength (2 * ActualPrimary.h) x.1.2.1 @@ -1651,6 +1662,7 @@ theorem full_regular_of_envelope_class {E : Type} [NormedAddCommGroup E] [Normed /-- Signed copies, given by `(ActualSignedStageControls.parameters l).copyData ActualPrimaryBounds.strip request`. -/ +@[expose] noncomputable def signedCopies (l : Index B N0) (request : ℕ → FullPoint → SignedWaveUpdate.Vec2) : PeriodizedWaveBounds.CopyData FullPoint Frequency := @@ -1743,6 +1755,7 @@ theorem signed_pressure_full_regular (l : Index B N0) /-- Positive domain, given by `ActualWaveRegularity.fullDomain ActualPrimary.standardRegion ∩ ActualPrimaryCoherence.positiveRadialChart`. -/ +@[expose] noncomputable def positiveDomain : Set FullPoint := ActualWaveRegularity.fullDomain ActualPrimary.standardRegion ∩ ActualPrimaryCoherence.positiveRadialChart @@ -2221,6 +2234,7 @@ theorem signed_pressure_smooth (l : Index B N0) (P : SignedStressPrimitive.Patch /-- Particular full strip, given by `ParticularWaveBounds.reindexStrip ActualWaveRegularity.particularChart.symm ActualSignedStageControls.fullStrip`. -/ +@[expose] noncomputable def particularFullStrip : StripData ActualWaveRegularity.ParticularSpace := ParticularWaveBounds.reindexStrip ActualWaveRegularity.particularChart.symm ActualSignedStageControls.fullStrip @@ -2299,6 +2313,7 @@ not a smoothness assumption on an output. -/ /-- Particular copies, given by `(ActualParticularStageControls.canonicalParameters l).copyData c u b G A j`. -/ +@[expose] noncomputable def particularCopies (l : ActualParticularStageControls.Label B N0) (c : CorrectionState.Context (CorrectionStep.CycleSlow × Plane)) (u : CorrectionState.State (CorrectionStep.CycleSlow × Plane)) @@ -2308,6 +2323,7 @@ noncomputable def particularCopies (l : ActualParticularStageControls.Label B N0 /-- Particular positive, given by `ActualWaveRegularity.particularChart.symm ⁻¹' positiveDomain`. -/ +@[expose] noncomputable def particularPositive : Set ActualWaveRegularity.ParticularSpace := ActualWaveRegularity.particularChart.symm ⁻¹' positiveDomain @@ -2414,6 +2430,7 @@ variable (l : ActualParticularStageControls.Label B N0) (G A : HarmonicResidual.BlockCoefficients (CorrectionStep.CycleSlow × Plane)) (j : ℤ) /-- Particular normal, constructed using `CurlClassBounds.coefficient`. -/ +@[expose] noncomputable def particularNormal (n : ℕ) : ActualWaveRegularity.ParticularSpace → ComplexVector := CurlClassBounds.coefficient ((particularCopies l c u b G A j).background.radius n) ((ActualParticularStageControls.canonicalParameters l).directions.radialField n) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/AlignedProfileSpectralCone.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/AlignedProfileSpectralCone.lean index edac0c3815..d18e7f824b 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 @@ -559,6 +559,7 @@ end ClosedDirection /-- Reference set, given by `PrimaryRepresentatives.referenceCompact F.data.h (NominalConeAssembly.activeLeft W) (NominalConeAssembly.activeRight W)`. -/ +@[expose] noncomputable def referenceSet {F : OutgoingProfile.Profile} (W : NominalProfile.Witness F) : Set Slow := PrimaryRepresentatives.referenceCompact F.data.h (NominalConeAssembly.activeLeft W) 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..4e2cda2080 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 := @@ -57,6 +57,7 @@ theorem radius_pos_at_terminal {x : Space} (hx : x ≠ 0) (hz : x 2 = 0) : /-- The support radius uses the same physical similarity coordinate as the wave construction, rather than a separately postulated scale. -/ +@[expose] noncomputable def outerRadius (h C : ℝ) (w : SpaceTime) : ℝ := C * Real.sqrt (PhysicalWaveSum.physicalQ h w) @@ -112,6 +113,7 @@ variable {V : Type*} [Zero V] /-- A pointwise physical support invariant. It contains no endpoint or derivative assertion. -/ +@[expose] def ShrinkingSupport (h C : ℝ) (f : SpaceTime → V) : Prop := ∀ w, w.1 < 1 → f w ≠ 0 → radius w ≤ outerRadius h C w diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/AssembledSlowBase.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/AssembledSlowBase.lean index 8680a9317c..4813653cf9 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 @@ -41,7 +41,7 @@ noncomputable def commonWindow {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) /-- Extend even, given by `ParametricRadialExtension.extension w f f.smooth (fun _ heta R => f.even heta R)`. -/ -noncomputable def extendEven {S : Set ℝ} (w : ParametricRadialExtension.ParameterWindow S) +@[expose] noncomputable def extendEven {S : Set ℝ} (w : ParametricRadialExtension.ParameterWindow S) (f : EvenProfile S) : Field := ParametricRadialExtension.extension w f f.smooth (fun _ heta R => f.even heta R) @@ -85,7 +85,7 @@ theorem extendEven_support {S : Set ℝ} (w : ParametricRadialExtension.Paramete /-- For a profile already zero on a fixed axis neighborhood, remove the unused negative-X extension without changing any physical value. -/ -noncomputable def extendCoreZero {S : Set ℝ} +@[expose] noncomputable def extendCoreZero {S : Set ℝ} (w : ParametricRadialExtension.ParameterWindow S) (r : ℝ) (f : EvenProfile S) (p : ℝ × ℝ) : ℝ := TransportPrimitive.cutoff (r / 8) (r / 4) p.1 * extendEven w f p @@ -130,6 +130,7 @@ theorem extendCoreZero_zero_parameter {S : Set ℝ} (fun _ he R => f.even he R) hp, mul_zero] /-- Each entry is an extension of the actual recursively repaired field. -/ +@[expose] noncomputable def extendedCoefficient {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) (hI : Icc (-1 : ℝ) 1 ⊆ S) (n : ℕ) (i : Fin 4) : Field := extendEven (commonWindow s hI) (component (profiles s n) i) @@ -211,6 +212,7 @@ theorem extendedCoefficient_axis_jets {S : Set ℝ} {h C rho inner : ℝ} {U : S /-- A profile smooth on a neighborhood of the nonnegative X half-plane gives a genuine globally signed-radius even field by polynomial pullback. -/ +@[expose] noncomputable def radialPullback {S : Set ℝ} {D : Set (ℝ × ℝ)} (F : Field) (hF : ContDiffOn ℝ ∞ F D) (hD : ∀ X, 0 ≤ X → ∀ eta ∈ S, (X, eta) ∈ D) : EvenProfile S := ⟨fun w => F (w.1 ^ 2 / 2, w.2), ⟨hF.comp @@ -374,6 +376,7 @@ theorem zEven_zero (Z0 : ZeroOrderSolved s inner) (n : ℕ) {R eta : ℝ} /-- Coefficients, bundling `axial`, `phi`, `pressure`, `stressTheta` and the required compatibility proofs. -/ +@[expose] noncomputable def coefficients (Z0 : ZeroOrderSolved s inner) (hI : Icc (-1 : ℝ) 1 ⊆ S) : SlowBorelBase.Coefficients where axial := fun n => extendedCoefficient s hI n 1 @@ -661,6 +664,7 @@ variable {S : Set ℝ} {h : ℝ} {D : ProfileHistories.RadialDomain} /-- The four order-zero fields are computed from one actual profile. In particular beta is reconstructed from U; it is not independent data. -/ +@[expose] noncomputable def baseFields : Coefficient S where phi := boundConstant S C * radialPullback P.f P.f_smooth hD axial := radialPullback P.U P.U_smooth hD @@ -764,6 +768,7 @@ theorem baseFields_beta_exterior {B : ℝ} (hB : 0 < B) /-- Finite exterior and pure-power facts suffice to construct the input record for the actual infinite repair recursion. -/ +@[expose] noncomputable def baseDataOfProfile {lam a b B : ℝ} (hC : C ≠ 0) (ha : 0 ≤ a) (hB : 0 < B) (hu : ∀ eta ∈ S, ∀ X, B ^ 2 / 2 ≤ X → P.U (X, eta) = 0) (hm : ∀ eta ∈ S, P.M (B ^ 2 / 2, eta) = 0) @@ -878,6 +883,7 @@ noncomputable def nominalOuterX : ℝ := (ReservedPatches.right F W.controls.radius .positive)) + 1 /-- Nominal outer radius, given by `Real.sqrt (2 * nominalOuterX W)`. -/ +@[expose] noncomputable def nominalOuterRadius : ℝ := Real.sqrt (2 * nominalOuterX W) theorem nominalOuterX_gt_radius : W.controls.radius < nominalOuterX W := by @@ -1039,6 +1045,7 @@ theorem nominal_mass_exterior : /-- A finite base input constructed from the same nominal witness, with the manuscript's reserved positive-order patch. -/ +@[expose] noncomputable def nominalBaseData : BaseData S W.axis.normalization F.data.core.lam (ReservedPatches.radialLeft F W.controls.radius .positive) @@ -1059,7 +1066,7 @@ noncomputable def nominalBaseData : exact (nominal_positive_patch W hR).2) theorem nominalBaseData_beta : (nominalBaseData W d hD).fields.beta = - betaFromU d 0 (nominalBaseData W d hD).fields.axial := rfl + betaFromU d 0 (nominalBaseData W d hD).fields.axial := by rfl end NominalBase @@ -1072,11 +1079,13 @@ theorem nominalPressure_eq : F.axisDatum = PressureDatum.pressure F.axisDatum_eq.trans (SchedulePressure.axisPressure_eq F.data) /-- Nominal tube, constructed using `ActualSlowAxis.constructedTube`. -/ +@[expose] noncomputable def nominalTube := ActualSlowAxis.constructedTube (SchedulePressure.admissible F.data) (nominalPressure_eq (F := F)) W.axis.natural.profile W.axis.scale_pos W.axis.small W.axis.preparation.sigma_pos /-- Nominal complex domain, constructed using `ActualSlowAxis.parameterDomain`. -/ +@[expose] noncomputable def nominalComplexDomain : Set ℂ := ActualSlowAxis.parameterDomain (AxisHolomorphic.parameterTube ActivationHolomorphic.parameterWindow @@ -1087,6 +1096,7 @@ theorem nominalComplexDomain_open : IsOpen (nominalComplexDomain W) := ActualSlowAxis.parameterDomain_open (nominalTube W).isOpen /-- Nominal hierarchy, constructed using `ActualSlowAxis.hierarchy`. -/ +@[expose] noncomputable def nominalHierarchy := ActualSlowAxis.hierarchy (nominalTube W) W.controls.activationTime_pos W.controls.referenceWidth_pos @@ -1094,11 +1104,13 @@ noncomputable def nominalHierarchy := /-- Nominal radius, given by `ActualSlowAxis.axisRadius W.axis.referenceInput W.controls.referenceWidth`. -/ +@[expose] noncomputable def nominalRadius : ℝ := ActualSlowAxis.axisRadius W.axis.referenceInput W.controls.referenceWidth /-- One open parameter set serves the nominal fields and every order of the same analytic local hierarchy. -/ +@[expose] noncomputable def nominalParameters : Set ℝ := {eta | (0, eta) ∈ W.domain.carrier} ∩ Complex.ofReal ⁻¹' nominalComplexDomain W @@ -1125,6 +1137,7 @@ theorem nominalDomain : Domain (nominalParameters W) F.data.h where SlowRecursion.domain_real_denominator (ActualSlowAxis.domain (nominalTube W) zero_lt_one) heta.2 /-- Nominal inner, given by `(4 / W.axis.scale) / 4`. -/ +@[expose] noncomputable def nominalInner : ℝ := (4 / W.axis.scale) / 4 /-- Nominal stop, given by `(4 / W.axis.scale) / 2`. -/ noncomputable def nominalStop : ℝ := (4 / W.axis.scale) / 2 @@ -1170,6 +1183,7 @@ theorem nominalStop_lt_patch : /-- The global recursive sequence uses the same nominal profile and the same constructed natural/ACT local hierarchy, with one common cutoff. -/ +@[expose] noncomputable def nominalScheme : Scheme (nominalParameters W) F.data.h W.axis.normalization := schemeFromHierarchy (nominalHierarchy W) (ActualSlowAxis.axisRadius_pos _ _) (nominalComplexDomain_open W) (nominalDomain W) (fun _ heta => heta.2) @@ -1192,6 +1206,7 @@ theorem nominalLocalization : Localization (nominalScheme W) (nominalHierarchy W (nominalParameters_domain W)) /-- Nominal ACT, constructed using `StressActivation.FromReference.histories`. -/ +@[expose] noncomputable def nominalACT : ProfileHistories.Profiles W.axis.referenceInput.radialDomain := StressActivation.FromReference.histories W.axis.referenceInput W.controls.activationTime_pos W.controls.referenceWidth_pos W.controls.referenceWidth_small W.controls.kappa @@ -1375,6 +1390,7 @@ theorem nominalZeroOrder : ZeroOrderSolved (nominalScheme W) (nominalInner W) := /-- The complete smooth input family is constructed from the single nominal witness; there are no freely supplied repaired coefficient fields. -/ +@[expose] noncomputable def nominalCoefficients : SlowBorelBase.Coefficients := coefficients (nominalLocalization W) (nominalBaseAgreement W) (nominalZeroOrder W) (nominalParameters_contains W) @@ -1659,6 +1675,7 @@ theorem modified_positive_patch {R eta : ℝ} (heta : eta ∈ S) exact (nominal_positive_patch W hR).2 /-- Modified base data, constructed using `baseDataOfProfile`. -/ +@[expose] noncomputable def modifiedBaseData : BaseData S W.axis.normalization F.data.core.lam (ReservedPatches.radialLeft F W.controls.radius .positive) @@ -1674,6 +1691,7 @@ noncomputable def modifiedBaseData : (fun _ he _ hR => (modified_positive_patch W Q M he hR).2) /-- Modified scheme, constructed using `schemeFromHierarchy`. -/ +@[expose] noncomputable def modifiedScheme : Scheme S F.data.h W.axis.normalization := schemeFromHierarchy (nominalHierarchy W) (ActualSlowAxis.axisRadius_pos _ _) (nominalComplexDomain_open W) (modifiedDomain W Q M) (fun _ heta => (M.subset heta).2) @@ -1756,6 +1774,7 @@ theorem modifiedZeroOrder : ZeroOrderSolved (modifiedScheme W Q M) (nominalInner /-- All positive profiles, canonical stress primitives, and global smooth extensions are rebuilt from the actual finite modified profile. -/ +@[expose] noncomputable def modifiedCoefficients : SlowBorelBase.Coefficients := coefficients (modifiedLocalization W Q M) (modifiedBaseAgreement W Q M) (modifiedZeroOrder W Q M) M.contains 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..ceb1baa8d7 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) @@ -236,17 +236,20 @@ structure Inputs (s : StripData D) (P : ℕ → D → ℝ) (κ : ℝ) radius_pos : ∀ x ∈ s.domain, 0 < c.operators.radius x /-- Corrected, given by `a.corrected (HarmonicWaveInteraction.productStrip s) (directions c) ψ`. -/ +@[expose] noncomputable def corrected (s : StripData D) (c : CorrectionState.Context D) (a : LinearWaveBounds.WaveCoefficients (D × ℝ)) (ψ : ℕ → D × ℝ → ℝ) := a.corrected (HarmonicWaveInteraction.productStrip s) (directions c) ψ /-- Primary block, given by `SignedWaveUpdate.blockOfCoefficients (corrected s c a ψ) kp`. -/ +@[expose] noncomputable def primaryBlock (s : StripData D) (c : CorrectionState.Context D) (a : LinearWaveBounds.WaveCoefficients (D × ℝ)) (ψ : ℕ → D × ℝ → ℝ) (kp : ℕ → ℤ) := SignedWaveUpdate.blockOfCoefficients (corrected s c a ψ) kp /-- Gaussian coefficients, defined pointwise by `ErrorHarmonics.conjugatePair 1 (fun x => LinearWaveBounds.excludedSlotError (directions c) ψ a.amplitude 0 n (x, 0) i)`. -/ +@[expose] noncomputable def gaussianCoefficients (c : CorrectionState.Context D) (a : LinearWaveBounds.WaveCoefficients (D × ℝ)) (ψ : ℕ → D × ℝ → ℝ) : HarmonicResidual.BlockCoefficients D := @@ -381,6 +384,7 @@ theorem linear_identity (n : ℕ) (p : D × ℝ) (hp : p.1 ∈ s.domain) : end Inputs /-- Real projection, given by `Complex.ofRealCLM.comp Complex.reCLM`. -/ +@[expose] noncomputable def realProjection : ℂ →L[ℝ] ℂ := Complex.ofRealCLM.comp Complex.reCLM @[simp] theorem realProjection_apply (z : ℂ) : realProjection z = (z.re : ℂ) := rfl @@ -804,7 +808,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 +935,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 +1113,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 +1121,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 +1275,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1288,15 +1292,17 @@ abbrev Point := PressureStream.Lift Plane abbrev Slow := PhaseCalculus.Slow /-- Common index, given by `ChartScales.nativeIndex h n`. -/ +@[expose] 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 _ _ /-- Reconstruction, bundling `exponent`, `inner`, `outer`, `inner_lt_outer` and the required compatibility proofs. -/ +@[expose] noncomputable def reconstruction (h a b : ℝ) (hab : a < b) : CorrectionState.ReconstructionData where exponent := ChartScales.radialExponent h @@ -1308,6 +1314,7 @@ noncomputable def reconstruction (h a b : ℝ) (hab : a < b) : CorrectionState.R radialDirection := TorusInverse.vector .radial /-- Operators, constructed using `CorrectionState.graphOperators`. -/ +@[expose] noncomputable def operators (h a b : ℝ) (hab : a < b) : MeanIncrementBounds.Operators Point := CorrectionState.graphOperators (reconstruction h a b hab) (ChartScales.epsilon h) (fun n => ChartScales.Tg ^ commonIndex h n * ChartScales.Q n ^ (1 + h)) @@ -1326,7 +1333,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 +1349,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) @@ -1419,6 +1427,7 @@ theorem radialCoefficient_uniform (h : ℝ) (hh : 0 ≤ h) : (le_mul_of_one_le_left (Real.rpow_nonneg (ChartScales.epsilon_pos h n).le _) hC) /-- Moving strip, constructed using `LocalSignedRequest.movingStripData`. -/ +@[expose] noncomputable def movingStrip {h : ℝ} (hh : 0 ≤ h) (U : LocalSignedRequest.SlowRegion (2 * h)) (a b cL cR : ℝ) (ha : 0 < a) (hcL : 0 < cL) (hcR : 0 < cR) : StripData Point := LocalSignedRequest.movingStripData U a b cL cR ha hcL hcR @@ -1501,6 +1510,7 @@ section NativeGeometry variable {F : OutgoingProfile.Profile} (W : NominalProfile.Witness F) /-- Native strip, constructed using `movingStrip`. -/ +@[expose] noncomputable def nativeStrip (U : LocalSignedRequest.SlowRegion (2 * F.data.h)) : StripData Point := movingStrip F.data.h_pos.le U (PrimaryTargetBounds.leftRadius W) (PrimaryTargetBounds.rightRadius @@ -1561,7 +1571,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 @@ -1571,6 +1581,7 @@ noncomputable def insertSlow : Slow →L[ℝ] Point where theorem slowCoordinates_insert (p : Slow) : slowCoordinates (insertSlow p) = p := rfl /-- Slow carrier, given by `insertSlow ⁻¹' (nativeStrip W U).domain`. -/ +@[expose] noncomputable def slowCarrier (U : LocalSignedRequest.SlowRegion (2 * F.data.h)) : Set Slow := insertSlow ⁻¹' (nativeStrip W U).domain @@ -1579,6 +1590,7 @@ theorem slowCarrier_open (U : LocalSignedRequest.SlowRegion (2 * F.data.h)) : /-- Phase domain, given by `BaseChartJets.oneDomain ι (fun _ => slowCarrier W U) (fun _ => slowCarrier_open W U)`. -/ +@[expose] noncomputable def phaseDomain (U : LocalSignedRequest.SlowRegion (2 * F.data.h)) (ι : Type*) : PhaseJetBounds.Domain ι Slow := BaseChartJets.oneDomain ι (fun _ => slowCarrier W U) (fun _ => slowCarrier_open W U) @@ -1590,6 +1602,7 @@ theorem slowCoordinates_maps (U : LocalSignedRequest.SlowRegion (2 * F.data.h)) exact (nativeStrip_mem W U x).mp hx /-- Geometry radius, given by `Real.sqrt U.qlo * PrimaryTargetBounds.leftRadius W`. -/ +@[expose] noncomputable def geometryRadius (U : LocalSignedRequest.SlowRegion (2 * F.data.h)) : ℝ := Real.sqrt U.qlo * PrimaryTargetBounds.leftRadius W @@ -1715,28 +1728,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) • @@ -1747,6 +1760,7 @@ noncomputable def rawStress (n : ℕ) (x : Point) : ℝ × ℝ := /-- The physical stress on positive radius, extended by zero to the other half-line. Its actual inner zero region makes this extension smooth. -/ +@[expose] noncomputable def virtualStress (n : ℕ) (x : Point) : ℝ × ℝ := if 0 < x.1 then rawStress H v upper B n x else 0 @@ -1759,7 +1773,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 @@ -2005,6 +2019,7 @@ theorem virtualStress_movingSupport (U : LocalSignedRequest.SlowRegion (2 * F.da intro he <;> simp only [he, Prod.fst_zero, Prod.snd_zero, ne_eq, not_true_eq_false] at hn /-- Leading virtual stress, with branches according to `0 < x.1`. -/ +@[expose] noncomputable def leadingVirtualStress (n : ℕ) (x : Point) : ℝ × ℝ := if 0 < x.1 then (ChartScales.epsilon F.data.h n * @@ -2059,18 +2074,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 +2165,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..7526bb56fe 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,20 +1367,25 @@ 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`. -/ +@[expose] noncomputable def viscosity (i : ι) : ℝ := ChartScales.epsilon h (a.band i) * (ChartScales.carrier h (a.band i) : ℝ) ^ 2 /-- B, given by `referenceScale (a.lam i) (a.viscosity i) u`. -/ +@[expose] noncomputable def B (i : ι) : ℝ := referenceScale (a.lam i) (a.viscosity i) u /-- Frequency, constructed using `PhaseEstimates.representativeFrequency`. -/ +@[expose] noncomputable def frequency (i : ι) : Plane := PhaseEstimates.representativeFrequency (a.B i) (a.sigma i) u (a.length i) (a.K i) (PhaseEstimates.shearVector (a.F0 i) (a.G0 i) (a.q0 i)) /-- Target, given by `(a.q0 i).1 * a.frequency i 0`. -/ +@[expose] noncomputable def target (i : ι) : ℝ := (a.q0 i).1 * a.frequency i 0 /-- Phase, bundling `epsilon`, `p`, `pz`, `x0` and the required compatibility proofs. -/ +@[expose] noncomputable def phase : PhaseJetBounds.PhaseFamily ι where epsilon i := ChartScales.epsilon h (a.band i) p i := PhaseEstimates.roundedFrequency (ChartScales.carrier h (a.band i)) (a.target i) @@ -1390,16 +1395,17 @@ 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 zero-floor case, which is replaced by the integer one. -/ +@[expose] noncomputable def angularMode (i : ι) : ℤ := PhaseEstimates.nonzeroRound ((ChartScales.carrier h (a.band i) : ℝ) * a.target i) @@ -1784,6 +1790,7 @@ theorem energy_bound (hh : 0 ≤ h) (hr : 0 < r0) (hM : 1 ≤ M) /-- Output bound, given by `frequencyBound M + 3 * M + M ^ 2 + 4`. -/ noncomputable def outputBound (M : ℝ) : ℝ := frequencyBound M + 3 * M + M ^ 2 + 4 /-- Output lower, given by `min (normalLower M u / 2) (1 / M)`. -/ +@[expose] noncomputable def outputLower (M u : ℝ) : ℝ := min (normalLower M u / 2) (1 / M) theorem outputBound_bounds (hM : 1 ≤ M) : @@ -1801,6 +1808,7 @@ theorem outputLower_pos (hM : 1 ≤ M) : 0 < outputLower M u := /-- The actual phase family satisfies every order-zero input of the previous primary-pulse theorem. Its normal comparison, modal errors, and damping comparison are proved here from the base and mesh data. -/ +@[expose] noncomputable def construction (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) @@ -1884,7 +1892,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..16e212f24b 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 @@ -88,6 +88,7 @@ theorem bandInput_deriv_Z (h Q : ℝ) (p : Slow) : /-- Full normalized average stream; no new coefficient sequence or cutoff schedule is chosen. -/ +@[expose] noncomputable def normalizedStream (a : ℕ → ℕ) (h : ℝ) (d : SlowBorelBase.Coefficients) (Q : ℝ) (p : Slow) : ℝ := axialFactor h p * SlowBorelBase.slowSum a h (averageSequence d) @@ -156,11 +157,13 @@ theorem normalizedStream_deriv_Z {a : ℕ → ℕ} (ha : StrictMono a) {h C Q : ring /-- Reduced radial, given by `-(p.1 / 2) * PhaseCalculus.slowZ (normalizedStream a h d Q) p`. -/ +@[expose] noncomputable def reducedRadial (a : ℕ → ℕ) (h : ℝ) (d : SlowBorelBase.Coefficients) (Q : ℝ) (p : Slow) : ℝ := -(p.1 / 2) * PhaseCalculus.slowZ (normalizedStream a h d Q) p /-- Literal normalized radial component of the constructed curl base. -/ +@[expose] noncomputable def radial (a : ℕ → ℕ) (h C : ℝ) (d : SlowBorelBase.Coefficients) (Q : ℝ) (p : Slow) : ℝ := Q ^ CoordinateAlgebra.A h * SlowBorelBase.baseVelocity a h C d (bandPoint h Q p) 0 diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/BaseRankPatch.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/BaseRankPatch.lean index 8785f0b082..6a54ec8834 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 @@ -116,23 +116,28 @@ theorem slowSum_eq_leading {V : Type} [NormedAddCommGroup V] [NormedSpace ℝ V] section RankParameters /-- The slow variables here have the physical rank convention `(T,Z)`. -/ +@[expose] noncomputable def rankScale (h : ℝ) (s : ℝ × ℝ) : ℝ := SimilarityCoordinates.coordinateQ (2 * h) s /-- Rank eta, given by `SimilarityCoordinates.coordinateEta (2 * h) s`. -/ +@[expose] noncomputable def rankEta (h : ℝ) (s : ℝ × ℝ) : ℝ := SimilarityCoordinates.coordinateEta (2 * h) s /-- Rank coefficient, given by `MeanRankUpdate.shapedAmplitude (ReservedPatches.radialAmplitude F XR 0) (rankEta F.data.h s)`. -/ +@[expose] noncomputable def rankCoefficient (F : OutgoingProfile.Profile) (XR : ℝ) (s : ℝ × ℝ) : ℝ := MeanRankUpdate.shapedAmplitude (ReservedPatches.radialAmplitude F XR 0) (rankEta F.data.h s) /-- Rank length, given by `Real.sqrt (rankScale h s)`. -/ +@[expose] noncomputable def rankLength (h : ℝ) (s : ℝ × ℝ) : ℝ := Real.sqrt (rankScale h s) /-- Rank velocity, given by `rankScale h s ^ (-CoordinateAlgebra.A h)`. -/ +@[expose] noncomputable def rankVelocity (h : ℝ) (s : ℝ × ℝ) : ℝ := rankScale h s ^ (-CoordinateAlgebra.A h) @@ -274,12 +279,14 @@ theorem normalized_mean_fields (a : ℕ → ℕ) (q : ℝ) {p : Inner} exact hzero.2.1.trans hfields.1 /-- The literal normalized angular and axial slices of the final base. -/ +@[expose] noncomputable def angularSlice (upper : ℝ) (B : ℕ) (Q : ℝ) (s : ℝ × ℝ) (R : ℝ) : ℝ := R * frequency (FinalSlowBase.scales H v upper B) F.data.h W.axis.normalization (FinalSlowBase.coefficients H v) Q (R, (s.2, s.1)) /-- Axial slice, given by `axial (FinalSlowBase.scales H v upper B) F.data.h (FinalSlowBase.coefficients H v) Q (R, (s.2, s.1))`. -/ +@[expose] noncomputable def axialSlice (upper : ℝ) (B : ℕ) (Q : ℝ) (s : ℝ × ℝ) (R : ℝ) : ℝ := axial (FinalSlowBase.scales H v upper B) F.data.h (FinalSlowBase.coefficients H v) Q (R, (s.2, s.1)) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/BaseResidual.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/BaseResidual.lean index 79c286ecb7..1ab9004a73 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 @@ -552,7 +552,7 @@ theorem baseVelocity_at_origin {a : ℕ → ℕ} (ha : StrictMono a) {h : ℝ} unfold streamFactor swirlPotential rw [AxisymmetricFields.velocity_on_axis _ _ t 0 hH hK (by simp) (by simp)] change (physicalProfile a h (-CoordinateAlgebra.A h) (bundleComponent C d 0) - (t, (0, 0))) • _ = _ + (t, (0, 0))) • ProblemStatement.coordinateVector 2 = _ unfold physicalProfile rw [physicalChart_origin hh hh1 ht, slowSum_eq_leading_of_positive_zero a h (1 - t)] @@ -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) @@ -1025,6 +1025,7 @@ section PotentialRates open ProblemStatement DiagonalResidual /-- Past, given by `Iio 1 ×ˢ univ`. -/ +@[expose] noncomputable def past : Set SpaceTime := Iio 1 ×ˢ univ /-- Profile past, given by `Iio 1 ×ˢ univ`. -/ noncomputable def profilePast : Set Chart := Iio 1 ×ˢ univ @@ -1095,30 +1096,34 @@ 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 J h C d)`. -/ +@[expose] noncomputable def prefixPotential (J : ℕ) (h C : ℝ) (d : Coefficients) : VelocityField := AxisymmetricFields.potential (prefixStream J h C d) (prefixSwirl J h C d) /-- 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) /-- Prefix velocity, given by `SpatialCurl.spatialCurl (prefixPotential J h C d)`. -/ +@[expose] noncomputable def prefixVelocity (J : ℕ) (h C : ℝ) (d : Coefficients) : VelocityField := SpatialCurl.spatialCurl (prefixPotential J h C d) /-- Prefix pressure, given by `cartesianUncutPrefix h (-2 * CoordinateAlgebra.A h) (bundleComponent C d 2) J`. -/ +@[expose] noncomputable def prefixPressure (J : ℕ) (h C : ℝ) (d : Coefficients) : PressureField := cartesianUncutPrefix h (-2 * CoordinateAlgebra.A h) (bundleComponent C d 2) J @@ -1438,6 +1443,7 @@ section AnnularFactors open ProblemStatement DiagonalResidual /-- Annular past, given by `{z | z.1 < 1 ∧ 0 < AxisymmetricFields.radialEnergy z.2}`. -/ +@[expose] noncomputable def annularPast : Set SpaceTime := {z | z.1 < 1 ∧ 0 < AxisymmetricFields.radialEnergy z.2} @@ -1526,7 +1532,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)`. -/ @@ -1683,21 +1689,25 @@ open ProblemStatement DiagonalResidual /-- Prefix stress theta, given by `physicalUncutPrefix h (-CoordinateAlgebra.A h - 1 / 2) (bundleComponent C d 3) J`. -/ +@[expose] noncomputable def prefixStressTheta (J : ℕ) (h C : ℝ) (d : Coefficients) : Chart → ℝ := physicalUncutPrefix h (-CoordinateAlgebra.A h - 1 / 2) (bundleComponent C d 3) J /-- Prefix stress axial, given by `physicalUncutPrefix h (-CoordinateAlgebra.A h - 1 / 2) (bundleComponent C d 4) J`. -/ +@[expose] noncomputable def prefixStressAxial (J : ℕ) (h C : ℝ) (d : Coefficients) : Chart → ℝ := physicalUncutPrefix h (-CoordinateAlgebra.A h - 1 / 2) (bundleComponent C d 4) J /-- Base stress force, given by `stressForce (baseStressTheta a h C d) (baseStressAxial a h C d)`. -/ +@[expose] noncomputable def baseStressForce (a : ℕ → ℕ) (h C : ℝ) (d : Coefficients) : VelocityField := stressForce (baseStressTheta a h C d) (baseStressAxial a h C d) /-- 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) @@ -1772,6 +1782,7 @@ section FiniteTailRates open ProblemStatement DiagonalResidual SlowExpansionResidual SlowResidualMatching /-- Charted domain, given by `{z | z.1 < 1 ∧ (cartesianChart h z).2 ∈ U}`. -/ +@[expose] noncomputable def chartedDomain (h : ℝ) (U : Set Inner) : Set SpaceTime := {z | z.1 < 1 ∧ (cartesianChart h z).2 ∈ U} @@ -1825,7 +1836,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 := @@ -2022,6 +2033,7 @@ open ProblemStatement DiagonalResidual ResidualStability SlowExpansionResidual /-- Base residual, given by `navierStokesResidual (baseVelocity a h C d) (basePressure a h C d) z.1 z.2 - baseStressForce a h C d z`. -/ +@[expose] noncomputable def baseResidual (a : ℕ → ℕ) (h C : ℝ) (d : Coefficients) (z : SpaceTime) : Space := navierStokesResidual (baseVelocity a h C d) (basePressure a h C d) z.1 z.2 - baseStressForce a h C d z @@ -2049,6 +2061,7 @@ theorem jetRate_neg {l : Filter SpaceTime} {q : SpaceTime → ℝ} {F : SpaceTim /-- The finite identity in this interface is the exact identity for the displayed uncut stream prefixes. It contains no asymptotic hypothesis. -/ +@[expose] def FiniteIdentities (h C : ℝ) (d : Coefficients) (f : SlowProfiles) : Prop := ∀ J : ℕ, ∀ z ∈ annularPast, navierStokesResidual (prefixVelocity J h C d) (prefixPressure J h C d) z.1 z.2 = @@ -2175,6 +2188,7 @@ variable {V : Type} [NormedAddCommGroup V] [NormedSpace ℝ V] /-- Polynomial losses in the two logarithmic edge distances are allowed. The estimate is on the full derivative tensor, including mixed derivatives. -/ +@[expose] def PolynomialEdgeJets (W : Set Inner) (zeta delta : Inner → ℝ) (f : Inner → V) : Prop := ∀ m : ℕ, ∃ C : ℝ, 0 < C ∧ ∃ N : ℕ, ∀ w ∈ W, ‖iteratedFDeriv ℝ m f w‖ ≤ C * zeta w * (delta w)⁻¹ ^ N @@ -2423,6 +2437,7 @@ end WeightedSum section WeightedTensor /-- Both independent slots of the virtual tangential tensor. -/ +@[expose] noncomputable def stressPair (d : Coefficients) (j : ℕ) (w : Inner) : Inner := (d.stressTheta j w, d.stressAxial j w) @@ -2473,6 +2488,7 @@ theorem weightedBundle_quotient_scales {a : ℕ → ℕ} {h C : ℝ} {d : Coeffi (ContinuousLinearMap.norm_snd_le _ _ _) /-- Normalized tensor, given by `slowSum a h (stressPair d)`. -/ +@[expose] noncomputable def normalizedTensor (a : ℕ → ℕ) (h : ℝ) (d : Coefficients) : Chart → Inner := slowSum a h (stressPair d) @@ -2588,19 +2604,20 @@ noncomputable def weightRightFactor {a b c : ℝ} (hab : a < b) (hc : 0 < c) (K ring /-- Swap inner, bundling `toLinearEquiv`, `norm_map`. -/ +@[expose] noncomputable def swapInner : Inner ≃ₗᵢ[ℝ] Inner where toLinearEquiv := LinearEquiv.prodComm ℝ ℝ ℝ 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 @@ -2625,8 +2642,10 @@ theorem activeZeta_edgeJets {a b c : ℝ} (hab : a < b) (hc : 0 < c) : have hX := (Real.exp_pos a).trans hw.1.1 have he : activeZeta c a b =ᶠ[𝓝 w] (radialPullback (logWeightProfile c a b) ∘ swapInner) := by filter_upwards [continuousAt_fst.eventually (Ioi_mem_nhds hX)] with y hy + have hswap : (swapInner y).2 = y.1 := by + rfl simp [activeZeta, radialWeight, hy, radialPullback, logChart, logWeightProfile, - swapInner] + hswap] rw [(SolenoidalDiagonal.iteratedFDeriv_eventuallyEq he m).self_of_nhds, swapInner.norm_iteratedFDeriv_comp_right] have hbound := hb w.2 hw.2 w.1 hw.1 @@ -2640,6 +2659,7 @@ section AxisStress open ProblemStatement DiagonalResidual /-- A common inner zero region for every actual stress coefficient. -/ +@[expose] def StressZeroCore (d : Coefficients) (r : ℝ) : Prop := ∀ j : ℕ, ∀ X ∈ Ico (0 : ℝ) r, ∀ eta ∈ Icc (-1 : ℝ) 1, d.stressTheta j (X, eta) = 0 ∧ d.stressAxial j (X, eta) = 0 @@ -3197,6 +3217,7 @@ open ActiveAnnulusWeight /-- Higher-order support is strictly interior to the active annulus. The interval and its distance from the edges may depend on the order. -/ +@[expose] def HigherInteriorSupport (d : Coefficients) (left right : ℝ) : Prop := ∀ j : ℕ, 2 ≤ j → ∃ a b : ℝ, Icc a b ⊆ Ioo (Real.exp left) (Real.exp right) ∧ SlowStressSupport.radialSupport univ a b (d.stressTheta j) ∧ @@ -3242,6 +3263,7 @@ theorem compact_weighted_jet_bound {V : Type} [NormedAddCommGroup V] [NormedSpac (mul_le_mul_of_nonneg_right (by linarith [le_max_left B 0]) (hp w hw).le) /-- Outer window, given by `Ico cut (Real.exp right) ×ˢ Icc (-1) 1`. -/ +@[expose] noncomputable def outerWindow (cut right : ℝ) : Set Inner := Ico cut (Real.exp right) ×ˢ Icc (-1) 1 diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/BaseStressClasses.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/BaseStressClasses.lean index 6895b0dae4..e55412d06f 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)) : @@ -272,6 +272,7 @@ variable {F : OutgoingProfile.Profile} {W : NominalProfile.Witness F} (v : ModulatedProfileAssembly.Witness ld) /-- The literal positive-order part of the normalized tensor. -/ +@[expose] noncomputable def correction (upper : ℝ) (B : ℕ) (y : Chart) : Inner := FinalSlowBase.normalizedStress H v upper B y - BaseResidual.stressPair (FinalSlowBase.coefficients H v) 0 y.2 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..7d7a22a178 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 @@ -46,6 +46,7 @@ theorem cylindricalMap_continuous : Continuous cylindricalMap := /-- Restriction to a padded annulus and the genuine native domain. The weight, edge distance, viscosity and slow scales are unchanged by pullback. -/ +@[expose] noncomputable def pullStrip (s : StripData Native) (a b : ℝ) (ha : 0 < a) : StripData LiftPoint where domain := cylindricalDomain a b ∩ cylindricalMap ⁻¹' s.domain @@ -134,7 +135,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 +186,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..4883446174 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 @@ -357,6 +357,7 @@ def nativeArgument (h : ℝ) (n : ℕ) : ℝ := Real.log (dyadicQ n ^ (-1 - h) / (n : ℝ) ^ 2) / Real.log coverGrowth /-- Native index, given by `⌊nativeArgument h n⌋₊`. -/ +@[expose] def nativeIndex (h : ℝ) (n : ℕ) : ℕ := ⌊nativeArgument h n⌋₊ theorem nativeArgument_expanded (h : ℝ) {n : ℕ} (hn : 1 ≤ n) : @@ -509,7 +510,7 @@ end end -@[expose] public section +public section noncomputable section @@ -521,27 +522,28 @@ 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)`. -/ +@[expose] 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 +743,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 +755,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..9a58474967 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) @@ -183,6 +183,7 @@ theorem operator_bounds {h : ℝ} (hh : 0 ≤ h) (U : LocalSignedRequest.SlowReg section Cover /-- The forward integer covering on the full free auxiliary lift. -/ +@[expose] noncomputable def coverLift (k : ℕ) : Point ≃L[ℝ] Point := (ContinuousLinearEquiv.refl ℝ ℝ).prodCongr ((ContinuousLinearEquiv.refl ℝ Plane).prodCongr (CommonCoverSolve.coverPower k)) @@ -501,7 +502,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..24bc4e73ad 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 @@ -275,6 +275,7 @@ section BandGeometry /-- The fixed native basis has columns `v_r,v_t`; only the second column is multiplied by the actual time coefficient. -/ +@[expose] noncomputable def scaledBasis (B : Plane ≃L[ℝ] Plane) (ci : ℝ) (hci : ci ≠ 0) : Plane ≃L[ℝ] Plane := (TorusAverages.transverseChart ci hci).trans B @@ -328,7 +329,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 +432,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 +443,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 +691,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 +856,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 +882,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 +946,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 +963,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 +1244,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..8629cb5335 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. -/ @@ -846,12 +846,13 @@ variable (g : Geometry) /-- Coordinate linear, given by `(g.basis.symm : Plane →L[ℝ] Plane).comp (coverPower g.gap : Plane →L[ℝ] Plane)`. -/ +@[expose] noncomputable def coordinateLinear : Plane →L[ℝ] Plane := (g.basis.symm : Plane →L[ℝ] Plane).comp (coverPower g.gap : 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`. -/ @@ -1016,6 +1017,7 @@ theorem LinearData.anchoredSolve_jets_le_polynomial /-- Negative tangent projection, given by `-(ContinuousLinearMap.id ℝ H - (innerSL ℝ n).smulRight ((⟪n, n⟫_ℝ)⁻¹ • n))`. -/ +@[expose] noncomputable def negativeTangentProjection {H : Type} [NormedAddCommGroup H] [InnerProductSpace ℝ H] (n : H) : H →L[ℝ] H := -(ContinuousLinearMap.id ℝ H - (innerSL ℝ n).smulRight ((⟪n, n⟫_ℝ)⁻¹ • n)) @@ -1049,7 +1051,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..7ab8fd140c 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 @@ -48,10 +48,12 @@ private theorem nat_le_infty (n : ℕ) : (n : WithTop ℕ∞) ≤ ∞ := section PureHeat /-- The regular Cartesian swirl coefficient of the physical heat solution. -/ +@[expose] noncomputable def heatCoefficient (C h : ℝ) : PhysicalProfile := TerminalStress.swirlCoefficient C h (fun _ => 1) /-- The pressure is the literal canonical radial integral. -/ +@[expose] noncomputable def heatPressure (C h : ℝ) : PhysicalProfile := TerminalStress.canonicalPressure (heatCoefficient C h) @@ -207,10 +209,12 @@ theorem physical_eta_mem {h : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) hh hh1 ht ⟨le_rfl, le_rfl⟩).2 /-- Exterior domain, given by `{p | p.1 < 1 ∧ R < (physicalChart h p).2.1}`. -/ +@[expose] noncomputable def exteriorDomain (h R : ℝ) : Set PhysicalPoint := {p | p.1 < 1 ∧ R < (physicalChart h p).2.1} /-- Cartesian exterior, given by `{z | z.1 < 1 ∧ R < (cartesianChart h z).2.1}`. -/ +@[expose] noncomputable def cartesianExterior (h R : ℝ) : Set SpaceTime := {z | z.1 < 1 ∧ R < (cartesianChart h z).2.1} @@ -251,12 +255,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 : ℝ} @@ -496,10 +500,12 @@ open AssembledSlowBase variable {F : OutgoingProfile.Profile} (W : NominalProfile.Witness F) /-- Nominal heat switch, given by `OutgoingDilation.switchRadius F W.controls.radius`. -/ +@[expose] noncomputable def nominalHeatSwitch : ℝ := OutgoingDilation.switchRadius F W.controls.radius /-- Nominal exterior radius, given by `max (nominalOuterX W) (max W.controls.radius (nominalHeatSwitch W * Real.exp 3))`. -/ +@[expose] noncomputable def nominalExteriorRadius : ℝ := max (nominalOuterX W) (max W.controls.radius (nominalHeatSwitch W * Real.exp 3)) @@ -700,6 +706,7 @@ section TerminalExtension /-- Closed cartesian heat domain, given by `{z | z.1 ≤ 1 ∧ 0 < AxisymmetricFields.radialEnergy z.2}`. -/ +@[expose] noncomputable def closedCartesianHeatDomain : Set SpaceTime := {z | z.1 ≤ 1 ∧ 0 < AxisymmetricFields.radialEnergy z.2} @@ -807,7 +814,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 @@ -1008,6 +1015,7 @@ theorem prefixVelocity_eq_profiles {h : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) exact hu /-- The physical similarity coordinates range inside this open half strip. -/ +@[expose] noncomputable def profileWindow : Set Inner := Ioi 0 ×ˢ Ioo (-1) 1 theorem profileWindow_open : IsOpen profileWindow := isOpen_Ioi.prod isOpen_Ioo @@ -1211,7 +1219,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1236,6 +1244,7 @@ theorem admissibleScales_mono {V : Type} [NormedAddCommGroup V] [NormedSpace ℝ blown := fun j hj m hm q hq hq1 w hw => ha.blown j hj m hm q hq hq1 w (hK hw) /-- The genuine smooth vector potential of the summed base. -/ +@[expose] noncomputable def potential (a : ℕ → ℕ) (h C : ℝ) (d : Coefficients) : ProblemStatement.VelocityField := AxisymmetricFields.potential (streamFactor a h C d) (swirlPotential a h C d) @@ -1641,6 +1650,7 @@ open BaseResidual ActiveAnnulusWeight /-- The actual two-slot, all-order weighted estimate, used only as an output of the coefficient construction and common schedule selection. -/ +@[expose] def WeightedStressBound (a : ℕ → ℕ) (h : ℝ) (d : Coefficients) (c left right : ℝ) : Prop := ∀ m : ℕ, ∃ D : ℝ, 0 < D ∧ ∃ N : ℕ, ∀ q : ℝ, 0 < q → q ≤ 1 → ∀ w ∈ activeWindow left right, @@ -1723,16 +1733,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)) @@ -2057,6 +2067,7 @@ variable {F : OutgoingProfile.Profile} {W : NominalProfile.Witness F} /-- The coefficients are rebuilt from this particular solved finite modulation, using its preserved histories and its original nominal witness. -/ +@[expose] noncomputable def coefficients : Coefficients := modifiedCoefficients W v.profiles v.finiteModification @@ -2085,12 +2096,14 @@ theorem scales_strictMono (c : ℝ) (hc : 0 < c) (upper : ℝ) (B : ℕ) : /-- Velocity, given by `baseVelocity (scales v c hc upper B) F.data.h W.axis.normalization (coefficients v)`. -/ +@[expose] noncomputable def velocity (c : ℝ) (hc : 0 < c) (upper : ℝ) (B : ℕ) : ProblemStatement.VelocityField := baseVelocity (scales v c hc upper B) F.data.h W.axis.normalization (coefficients v) /-- Pressure, given by `basePressure (scales v c hc upper B) F.data.h W.axis.normalization (coefficients v)`. -/ +@[expose] noncomputable def pressure (c : ℝ) (hc : 0 < c) (upper : ℝ) (B : ℕ) : ProblemStatement.PressureField := basePressure (scales v c hc upper B) F.data.h W.axis.normalization (coefficients v) @@ -2110,6 +2123,7 @@ noncomputable def error (c : ℝ) (hc : 0 < c) (upper : ℝ) (B : ℕ) : /-- Vector potential, given by `potential (scales v c hc upper B) F.data.h W.axis.normalization (coefficients v)`. -/ +@[expose] noncomputable def vectorPotential (c : ℝ) (hc : 0 < c) (upper : ℝ) (B : ℕ) : ProblemStatement.VelocityField := potential (scales v c hc upper B) F.data.h W.axis.normalization (coefficients v) 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..7f9ab27552 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,10 +33,11 @@ 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`. -/ +@[expose] noncomputable def AffinePhase (θ : D) (m : ℝ) (Φ : D → ℝ) : Prop := ∀ (x : D) (t : ℝ), Φ (x + t • θ) = Φ x + m * t @@ -240,6 +241,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 +256,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..c24c03cc49 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 @@ -397,6 +403,7 @@ variable {P V E : Type} [NormedAddCommGroup V] [NormedSpace ℝ V] [NormedAddCommGroup E] [NormedSpace ℝ E] /-- Time data, bundling `coefficient`, `forcingMap`, `source`. -/ +@[expose] noncomputable def timeData (d : LinearData P V E) (τ rate : ℝ) : LinearData P V E where coefficient z := rate • d.coefficient (z.1, nativeTimeMap τ rate z.2) forcingMap z := rate • d.forcingMap (z.1, nativeTimeMap τ rate z.2) @@ -523,11 +530,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..cc8950770c 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,44 +108,48 @@ 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) (p.coefficients.phase n) (p.exactCoefficients.amplitude n) x i).re`. -/ +@[expose] noncomputable def velocity (p : PrimaryPiece X) : ℕ → X → Fin 3 → ℝ := fun n x i => (vectorMode (p.coefficients.frequency n) (p.coefficients.phase n) (p.exactCoefficients.amplitude n) x i).re /-- Tangent velocity, defined pointwise by `(vectorMode (p.coefficients.frequency n) (p.coefficients.phase n) ((p.coefficients.withCutoff p.cutoff).amplitude n) x i).re`. -/ +@[expose] noncomputable def tangentVelocity (p : PrimaryPiece X) : ℕ → X → Fin 3 → ℝ := fun n x i => (vectorMode (p.coefficients.frequency n) (p.coefficients.phase n) ((p.coefficients.withCutoff p.cutoff).amplitude n) x i).re /-- 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) (p.coefficients.phase n) (p.linearGood n) x i).re`. -/ +@[expose] noncomputable def linearGoodField (p : PrimaryPiece X) : ℕ → X → Fin 3 → ℝ := fun n x i => (vectorMode (p.coefficients.frequency n) (p.coefficients.phase n) (p.linearGood n) x i).re /-- Linear residual, defined pointwise by `(p.exactCoefficients.harmonicResidual p.strip p.directions n x i).re`. -/ +@[expose] noncomputable def linearResidual (p : PrimaryPiece X) : ℕ → X → Fin 3 → ℝ := fun n x i => (p.exactCoefficients.harmonicResidual p.strip p.directions n x i).re @@ -1012,6 +1016,7 @@ variable {U : PhaseJetBounds.Domain ℕ PhaseCalculus.Slow} /-- Both physical columns are constructed from the same native primary frames used above; continuity and kinematics are proved rather than stored as fresh assumptions. -/ +@[expose] noncomputable def sourcePair (F : Fin 2 → PrimaryPulseBounds.PhaseConstruction U) (sys : SlotSystem d h vr vt) (label : UnsignedLabel) (n : ℕ) (q : PhaseCalculus.Slow) (hq : q ∈ U.carrier n) @@ -1058,6 +1063,7 @@ namespace PrimaryPiece /-- Excluded block, given by `ErrorHarmonics.gaussianBlock p.directions p.cutoff p.coefficients.amplitude 0 1 p.coefficients.frequency Φ kp`. -/ +@[expose] noncomputable def excludedBlock (p : PrimaryPiece (D × ℝ)) (Φ : ℕ → D → ℝ) (kp : ℕ → ℤ) : HarmonicBlock D := ErrorHarmonics.gaussianBlock p.directions p.cutoff p.coefficients.amplitude 0 1 @@ -1132,7 +1138,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 @@ -1164,6 +1170,7 @@ noncomputable def afterTemporal (p : ReconstructionData) (h : ℝ) /-- After rank, given by `rankStage p r axial c (afterTemporal p h axial c labels pieces baseError)`. -/ +@[expose] noncomputable def afterRank (p : ReconstructionData) (r : RankData S) (h : ℝ) (axial : S × PressureStream.Plane) (c : Context (Lift S)) (labels : Finset ι) (pieces : ι → PrimaryPiece (Lift S × ℝ)) @@ -1172,6 +1179,7 @@ noncomputable def afterRank (p : ReconstructionData) (r : RankData S) (h : ℝ) /-- The current pressure alias is retained once, after the final pressure reconstruction. Earlier obsolete pressure aliases are not accumulated. -/ +@[expose] noncomputable def retainPressureAlias (p : ReconstructionData) (c : Context (Lift S)) (u : State (Lift S)) : State (Lift S) := { u with errors := ⟨u.errors.base, u.errors.gaussian, @@ -1179,6 +1187,7 @@ noncomputable def retainPressureAlias (p : ReconstructionData) (c : Context (Lif /-- Initialized, given by `retainPressureAlias p c (afterRank p r h axial c labels pieces baseError)`. -/ +@[expose] noncomputable def initialized (p : ReconstructionData) (r : RankData S) (h : ℝ) (axial : S × PressureStream.Plane) (c : Context (Lift S)) (labels : Finset ι) (pieces : ι → PrimaryPiece (Lift S × ℝ)) @@ -1313,6 +1322,7 @@ noncomputable def afterTemporal (g : GaugeData S) (h : ℝ) (index : ℕ → ℕ /-- After rank, given by `rankStageState g r axial c (afterTemporal g h index axial c labels pieces baseError)`. -/ +@[expose] noncomputable def afterRank (g : GaugeData S) (r : RankData S) (h : ℝ) (index : ℕ → ℕ) (axial : S × PressureStream.Plane) (c : Context (PressureStream.Lift S)) (labels : Finset ι) (pieces : ι → PrimaryPiece (PressureStream.Lift S × ℝ)) @@ -1321,6 +1331,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, @@ -1328,6 +1339,7 @@ noncomputable def retainPressureAlias (g : GaugeData S) (c : Context (PressureSt /-- Initialized, given by `retainPressureAlias g c (afterRank g r h index axial c labels pieces baseError)`. -/ +@[expose] noncomputable def initialized (g : GaugeData S) (r : RankData S) (h : ℝ) (index : ℕ → ℕ) (axial : S × PressureStream.Plane) (c : Context (PressureStream.Lift S)) (labels : Finset ι) (pieces : ι → PrimaryPiece (PressureStream.Lift S × ℝ)) @@ -1386,13 +1398,14 @@ 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) /-- Temporal bands, given by `temporalStageState g h index axial c (primaryBands g c labels pieces baseError)`. -/ +@[expose] noncomputable def temporalBands (g : GaugeData S) (h : ℝ) (index : ℕ → ℕ) (axial : S × PressureStream.Plane) (c : Context (PressureStream.Lift S)) (labels : ℕ → Finset ι) (pieces : ι → PrimaryPiece (PressureStream.Lift S × ℝ)) @@ -1401,6 +1414,7 @@ noncomputable def temporalBands (g : GaugeData S) (h : ℝ) (index : ℕ → ℕ /-- Rank bands, given by `rankStageState g r axial c (temporalBands g h index axial c labels pieces baseError)`. -/ +@[expose] noncomputable def rankBands (g : GaugeData S) (r : RankData S) (h : ℝ) (index : ℕ → ℕ) (axial : S × PressureStream.Plane) (c : Context (PressureStream.Lift S)) (labels : ℕ → Finset ι) (pieces : ι → PrimaryPiece (PressureStream.Lift S × ℝ)) @@ -1409,6 +1423,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 × ℝ)) @@ -1635,6 +1650,7 @@ variable {D E : Type} [NormedAddCommGroup D] [NormedSpace ℝ D] [NormedAddCommGroup E] [NormedSpace ℝ E] /-- Insert, given by `(ContinuousLinearMap.id ℝ D).prod 0`. -/ +@[expose] noncomputable def insert : D →L[ℝ] D × ℝ := (ContinuousLinearMap.id ℝ D).prod 0 @@ -1693,7 +1709,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,16 +1801,18 @@ 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 /-- Tangent block, given by `PrimaryHarmonics.block (p.coefficients.withCutoff p.cutoff) Φ kp`. -/ +@[expose] noncomputable def tangentBlock (p : PrimaryPiece (D × ℝ)) (Φ : ℕ → D → ℝ) (kp : ℕ → ℤ) : HarmonicBlock D := PrimaryHarmonics.block (p.coefficients.withCutoff p.cutoff) Φ kp /-- Difference coefficients as an element of `WaveCoefficients (D × ℝ)`. -/ +@[expose] noncomputable def differenceCoefficients (p : PrimaryPiece (D × ℝ)) : WaveCoefficients (D × ℝ) := { p.coefficients with amplitude := fun n x => p.exactCoefficients.amplitude n x - @@ -1802,6 +1820,7 @@ noncomputable def differenceCoefficients (p : PrimaryPiece (D × ℝ)) : WaveCoe pressure := 0 } /-- Difference block, given by `PrimaryHarmonics.block p.differenceCoefficients Φ kp`. -/ +@[expose] noncomputable def differenceBlock (p : PrimaryPiece (D × ℝ)) (Φ : ℕ → D → ℝ) (kp : ℕ → ℤ) : HarmonicBlock D := PrimaryHarmonics.block p.differenceCoefficients Φ kp @@ -3931,7 +3950,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 @@ -3955,6 +3974,7 @@ theorem positive {n m : ℕ} (hn : 1 ≤ n) (hm : m ∈ levels n) : 1 ≤ m := b /-- Index, given by `((levels n).image (ChartScales.nativeIndex h)).min' ((levels_nonempty n).image _)`. -/ +@[expose] noncomputable def index (h : ℝ) (n : ℕ) : ℕ := ((levels n).image (ChartScales.nativeIndex h)).min' ((levels_nonempty n).image _) @@ -4026,6 +4046,7 @@ noncomputable def grids (D M : ℝ) (m : ℕ) : Finset SlotColoring.Grid := Fintype.piFinset (fun j => Finset.Icc (-gridRadius D M m j) (gridRadius D M m j)) /-- Labels, given by `(levels n).biUnion (fun m => (grids D M m).image (fun k => (m, k)))`. -/ +@[expose] noncomputable def labels (D M : ℝ) (n : ℕ) : Finset (ℕ × SlotColoring.Grid) := (levels n).biUnion (fun m => (grids D M m).image (fun k => (m, k))) @@ -4088,8 +4109,10 @@ abbrev certificate := profile.certificate abbrev modulation := profile.modulation /-- Radial vector, given by `TorusInverse.vector .radial`. -/ +@[expose] noncomputable def radialVector : TorusInverse.Plane := TorusInverse.vector .radial /-- Temporal vector, given by `TorusInverse.vector .temporal`. -/ +@[expose] noncomputable def temporalVector : TorusInverse.Plane := TorusInverse.vector .temporal theorem vectors_det : radialVector.1 * temporalVector.2 - radialVector.2 * temporalVector.1 ≠ 0 := @@ -4105,6 +4128,7 @@ noncomputable def slots : PartitionedCovariance.SlotSystem (CoordinateAlgebra.D radialVector temporalVector /-- Upper, given by `2 * NominalConeAssembly.activeRight nominal`. -/ +@[expose] noncomputable def upper : ℝ := 2 * NominalConeAssembly.activeRight nominal /-- These are selected outputs of the actual same-profile geometry and @@ -4145,6 +4169,7 @@ abbrev Label (B N0 : ℕ) := PrimaryGeometryAssembly.Index nominal (choice B N0) /-- Phases, given by `PrimaryGeometryAssembly.construction certificate modulation (choice B N0).prepared slots.radius_pos`. -/ +@[expose] noncomputable def phases (B N0 : ℕ) : Fin 2 → PrimaryPulseBounds.PhaseConstruction (PrimaryGeometryAssembly.domain nominal (choice B N0).prepared.N) := @@ -4158,6 +4183,7 @@ noncomputable def covariance (B N0 : ℕ) : Label B N0 → PhaseCalculus.Slow temporalVector /-- Prefactor, constructed using `PartitionedCovariance.nativePrefactor`. -/ +@[expose] noncomputable def prefactor {B N0 : ℕ} (_j : Fin 2) (L : Label B N0) : ℝ := PartitionedCovariance.nativePrefactor radialVector temporalVector slots.radius * ChartScales.timeCoefficient h (BaseChartJets.cellBand L) * @@ -4176,6 +4202,7 @@ noncomputable def nativeContext (B : ℕ) : CorrectionState.Context LocalSignedR BaseContextAssembly.nativeContext certificate modulation upper B /-- Gauge, bundling `radial`, `length`. -/ +@[expose] noncomputable def gauge : VariableGaugeMean.GaugeData TorusInverse.Plane where radial := BaseContextAssembly.reconstruction h (PrimaryTargetBounds.leftRadius nominal) (PrimaryTargetBounds.rightRadius nominal) (PrimaryTargetBounds.radii_ordered nominal) @@ -4209,6 +4236,7 @@ section NativeFields variable {B N0 : ℕ} /-- Position as an element of `SlotColoring.Position`. -/ +@[expose] noncomputable def position (L : Label B N0) (p : PhaseCalculus.Slow) : SlotColoring.Position := ![Real.sqrt (ChartScales.Q (BaseChartJets.cellBand L)) * p.1, ChartScales.Q (BaseChartJets.cellBand L) ^ (CoordinateAlgebra.D h) * p.2.1, @@ -4216,23 +4244,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,19 +4270,22 @@ 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) /-- Raw pressure, constructed using `ParticularWaveBounds.projectedPressure`. -/ +@[expose] noncomputable def rawPressure (j : Fin 2) (L : Label B N0) : PhaseCalculus.Slow × TorusInverse.Plane → ℂ := ParticularWaveBounds.projectedPressure (ChartScales.carrier h (BaseChartJets.cellBand L)) @@ -4270,7 +4302,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 @@ -4280,6 +4312,7 @@ noncomputable def geometry (j : Fin 2) (L : Label B N0) : CommonCoverSolve.Geome slots.radius • temporalVector /-- Clock window, bundling `lower`, `upper`, `padding`, `padding_pos`. -/ +@[expose] noncomputable def clockWindow (L : Label B N0) : PeriodicPhaseAssembly.ClockWindow where lower := (-slots.radius, 0) upper := (slots.radius, (phases B N0 0).L L) @@ -4287,7 +4320,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 - @@ -4327,6 +4360,7 @@ variable {B N0 : ℕ} /-- Source pair, bundling `domain`, `point`, `point_mem`, `frame` and the required compatibility proofs. -/ +@[expose] noncomputable def sourcePair (L : Label B N0) (p : PhaseCalculus.Slow) (hp : p ∈ (PrimaryGeometryAssembly.domain nominal (choice B N0).prepared.N).carrier L) : PrimaryFieldAssembly.SourcePair PhaseCalculus.Slow slots (PrimaryGeometryAssembly.label nominal @@ -4449,7 +4483,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 +4556,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) @@ -4623,6 +4658,7 @@ noncomputable def rankAmplitude : ℝ := ReservedPatches.radialAmplitude outgoing nominal.controls.radius 0 /-- Rank data, given by `RankStateBounds.normalizedData (2 * h) (CoordinateAlgebra.A h) rankAmplitude outgoing.data.core.lam rankInner rankOuter`. -/ +@[expose] noncomputable def rankData : CorrectionState.RankData TorusInverse.Plane := RankStateBounds.normalizedData (2 * h) (CoordinateAlgebra.A h) rankAmplitude outgoing.data.core.lam rankInner rankOuter @@ -4742,6 +4778,7 @@ open PhaseJetBounds PrimaryPulseBounds PrimaryCopyBounds /-- Native chart, given by `ActualSignedGeometry.preparedChart certificate modulation (choice B N0).prepared slots.radius_pos`. -/ +@[expose] noncomputable def nativeChart (B N0 : ℕ) := ActualSignedGeometry.preparedChart certificate modulation (choice B N0).prepared slots.radius_pos @@ -4754,6 +4791,7 @@ noncomputable def nativeReferenceBounds (B N0 : ℕ) := (choice B N0).covariance /-- Native base velocity, constructed using `PrimaryCopyBounds.primaryVelocity`. -/ +@[expose] noncomputable def nativeBaseVelocity (B N0 : ℕ) (j : Fin 2) : Label B N0 → ActualSignedGeometry.Native → ProblemStatement.Space := PrimaryCopyBounds.primaryVelocity (phases B N0) prefactor (nativeChart B N0).coordinate @@ -4762,6 +4800,7 @@ noncomputable def nativeBaseVelocity (B N0 : ℕ) (j : Fin 2) : /-- Native envelope, defined pointwise by `Real.sqrt ((nativeChart B N0).weight L x) * PrimaryCopyBounds.pulseEnvelope (phases B N0) (nativeChart B N0).coordinate j L x`. -/ +@[expose] noncomputable def nativeEnvelope (B N0 : ℕ) (j : Fin 2) : Label B N0 → ActualSignedGeometry.Native → ℝ := fun L x => Real.sqrt ((nativeChart B N0).weight L x) * @@ -4781,6 +4820,7 @@ theorem nativeBaseVelocity_jets (B N0 : ℕ) (j : Fin 2) : H.gap_pos H.entry_one H.lower_pos H.zero_order j /-- Native factors as an element of `Label B N0 → ActualSignedGeometry.Native → ℝ`. -/ +@[expose] noncomputable def nativeFactors (B N0 : ℕ) : Label B N0 → ActualSignedGeometry.Native → ℝ := fun _ x => SquaredPartition.dyadicProfile (SimilarityCoordinates.coordinateQ (2 * h) (x.1.2.2, x.1.2.1)) * @@ -4915,7 +4955,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 × ℝ => @@ -4965,8 +5005,8 @@ theorem tangentMode_diagonal_covariance (L : Label B N0) (p : PhaseCalculus.Slow /-- Physical tangent mode, given by `ChartScales.Q (BaseChartJets.cellBand L) ^ (-CoordinateAlgebra.A h) • tangentMode j L p Y theta`. -/ -noncomputable def physicalTangentMode (j : Fin 2) (L : Label B N0) (p : PhaseCalculus.Slow) - (Y : TorusInverse.Plane) (theta : ℝ) : Fin 3 → ℝ := +@[expose] noncomputable def physicalTangentMode (j : Fin 2) (L : Label B N0) + (p : PhaseCalculus.Slow) (Y : TorusInverse.Plane) (theta : ℝ) : Fin 3 → ℝ := ChartScales.Q (BaseChartJets.cellBand L) ^ (-CoordinateAlgebra.A h) • tangentMode j L p Y theta theorem physicalTangentMode_diagonal_covariance (L : Label B N0) (p : PhaseCalculus.Slow) @@ -5066,13 +5106,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 +5150,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 +5185,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 +5313,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) @@ -5458,6 +5500,7 @@ theorem attachedRawPressure_core (j : Fin 2) (L : Label B N0) (x : ActualSignedG simp [attachedRawPressure, WaveEdgeExtension.nativeExtension, WaveEdgeExtension.extension, hz] /-- Copy cells, constructed using `PeriodizedWaveBounds.nativeCells`. -/ +@[expose] noncomputable def copyCells (j : Fin 2) (L : Label B N0) : PeriodizedWaveBounds.Cells ActualSignedGeometry.Native TorusInverse.Frequency := PeriodizedWaveBounds.nativeCells (fun _ => geometry j L) (fun _ => (clockWindow L).core) @@ -5525,22 +5568,24 @@ 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 ^ CoordinateAlgebra.D h * x.2.1.2, ChartScales.Q n * x.2.1.1]`. -/ +@[expose] noncomputable def physicalPosition (n : ℕ) (x : LocalSignedRequest.Point) : SlotColoring.Position := ![Real.sqrt (ChartScales.Q n) * x.1, ChartScales.Q n ^ CoordinateAlgebra.D h * x.2.1.2, ChartScales.Q n * x.2.1.1] /-- Physical scale, given by `ChartScales.Q n * SimilarityCoordinates.coordinateQ (2 * h) x.2.1`. -/ +@[expose] noncomputable def physicalScale (n : ℕ) (x : LocalSignedRequest.Point) : ℝ := ChartScales.Q n * SimilarityCoordinates.coordinateQ (2 * h) x.2.1 /-- Active labels as an element of `Finset (Label B N0 × Fin 2)`. -/ -noncomputable def activeLabels (U : LocalSignedRequest.SlowRegion (2 * h)) (B N0 n : ℕ) : +@[expose] noncomputable def activeLabels (U : LocalSignedRequest.SlowRegion (2 * h)) (B N0 n : ℕ) : Finset (Label B N0 × Fin 2) := by classical exact ((CommonWindow.labels (CoordinateAlgebra.D h) (BaseContextAssembly.geometryBound nominal U) @@ -5623,7 +5668,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 +5688,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 +5708,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 +5722,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 +5799,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 +5807,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..c20b8cd3aa 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,56 +128,60 @@ 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`. -/ +@[expose] noncomputable def meanBaseError (s : State D) : MeanVector D := fun n x i => angularAverage (fun k p => s.errors.base k p i) n x /-- Equation (32) omits the fixed base-flat error from (24); it is restored here. -/ +@[expose] noncomputable def meanResidual (s : State D) (c : Context D) : MeanVector D := s.reducedMeanResidual c + s.meanBaseError /-- Mean excluded, defined pointwise by `angularAverage (fun k p => s.errors.total k p i) n x`. -/ +@[expose] noncomputable def meanExcluded (s : State D) : MeanVector D := fun n x i => angularAverage (fun k p => s.errors.total k p i) n x /-- Only the actual mean of the explicitly stored errors is removed here. -/ +@[expose] noncomputable def meanGoodResidual (s : State D) (c : Context D) : MeanVector D := s.meanResidual c - s.meanExcluded @@ -190,7 +195,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,29 +231,32 @@ 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 /-- Band limited, given by `(∀ n i, HarmonicFields.BandLimited (b.velocity n i) N) ∧ ∀ n, HarmonicFields.BandLimited (b.pressure n) N`. -/ +@[expose] def BandLimited (b : HarmonicBlock D) (N : ℕ) : Prop := (∀ n i, HarmonicFields.BandLimited (b.velocity n i) N) ∧ ∀ n, HarmonicFields.BandLimited (b.pressure n) N /-- Bounds are on stripped, grouped, nonzero harmonic coefficients. -/ +@[expose] def WaveBounds (s : StripData D) (P : ℕ → D → ℝ) (α : ℝ) (b : HarmonicBlock D) : Prop := ∀ (i : Fin 3) (j : ℤ), j ≠ 0 → WaveClass s P α (fun n x => b.velocity n i j x) /-- Pressure bounds, given by `∀ j : ℤ, j ≠ 0 → WaveClass s P α (fun n x => b.pressure n j x)`. -/ +@[expose] def PressureBounds (s : StripData D) (P : ℕ → D → ℝ) (α : ℝ) (b : HarmonicBlock D) : Prop := ∀ j : ℤ, j ≠ 0 → WaveClass s P α (fun n x => b.pressure n j x) @@ -278,37 +286,39 @@ 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) /-- Zero masses, given by `radialMoment 2 u.mean.angular = 0 ∧ radialMoment 1 u.mean.axial = 0`. -/ +@[expose] def ZeroMasses (u : State (PressureStream.Lift S)) : Prop := radialMoment 2 u.mean.angular = 0 ∧ radialMoment 1 u.mean.axial = 0 @@ -336,13 +346,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 +365,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 @@ -429,6 +439,7 @@ section Temporal variable {S : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] [FiniteDimensional ℝ S] /-- The actual temporal increment, including the compactified axial stream. -/ +@[expose] noncomputable def temporalIncrement (r : ReconstructionData) (h : ℝ) (axial : S × PressureStream.Plane) (c : Context (Lift S)) (u : State (Lift S)) : MeanIncrementBounds.Triple (Lift S) where @@ -439,7 +450,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 +458,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 @@ -495,6 +506,7 @@ variable {S : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] /-- Rank angular, given by `MeanRankUpdate.angularFamily r.lambda r.inner r.outer (r.length n) (r.velocity n) (r.coefficient n) (debt c u n)`. -/ +@[expose] noncomputable def rankAngular (r : RankData S) (c : Context (Lift S)) (u : State (Lift S)) (n : ℕ) : ℝ × S → ℝ := MeanRankUpdate.angularFamily r.lambda r.inner r.outer (r.length n) (r.velocity n) @@ -502,18 +514,21 @@ noncomputable def rankAngular (r : RankData S) (c : Context (Lift S)) /-- Rank desired axial, given by `MeanRankUpdate.desiredAxialFamily r.lambda r.inner r.outer (r.length n) (r.velocity n) (r.coefficient n) (debt c u n)`. -/ +@[expose] noncomputable def rankDesiredAxial (r : RankData S) (c : Context (Lift S)) (u : State (Lift S)) (n : ℕ) : ℝ × S → ℝ := MeanRankUpdate.desiredAxialFamily r.lambda r.inner r.outer (r.length n) (r.velocity n) (r.coefficient n) (debt c u n) /-- Rank potential, constructed using `PressureStream.streamPotential`. -/ +@[expose] noncomputable def rankPotential (p : ReconstructionData) (r : RankData S) (c : Context (Lift S)) (u : State (Lift S)) (n : ℕ) : Lift S → ℝ := PressureStream.streamPotential p.exponent p.inner p.outer (p.frequency n) ((0 : S), p.radialDirection) (MeanRankUpdate.slowLift (rankDesiredAxial r c u n)) /-- Rank increment, bundling `radial`, `angular`, `axial`. -/ +@[expose] noncomputable def rankIncrement (p : ReconstructionData) (r : RankData S) (axial : S × PressureStream.Plane) (c : Context (Lift S)) (u : State (Lift S)) : MeanIncrementBounds.Triple (Lift S) where @@ -526,7 +541,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..07b2cdc551 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 @@ -325,6 +325,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. -/ +@[expose] noncomputable def nonlinearResidual (ε : ℝ) (R : D → ℝ) (Vr Vθ Vz Vt : D → D) (B a : D → ComplexVector) (p : D → ℂ) (x : D) : ComplexVector := linearResidual ε R Vr Vθ Vz Vt B a p x + transport R Vr Vθ Vz a a x @@ -356,45 +357,54 @@ open CorrectionState HarmonicCalculus /-- Radial direction, given by `(c.operators.eR + (c.operators.radialFrequency n * c.operators.radialProfile x.1) • c.operators.vR, 0)`. -/ +@[expose] noncomputable def radialDirection (c : Context D) (n : ℕ) (x : D × ℝ) : D × ℝ := (c.operators.eR + (c.operators.radialFrequency n * c.operators.radialProfile x.1) • c.operators.vR, 0) /-- Axial direction, given by `(c.operators.epsilon n • c.operators.eZ, 0)`. -/ +@[expose] noncomputable def axialDirection (c : Context D) (n : ℕ) (_x : D × ℝ) : D × ℝ := (c.operators.epsilon n • c.operators.eZ, 0) /-- Angular direction, given by `(0, 1)`. -/ +@[expose] noncomputable def angularDirection (_x : D × ℝ) : D × ℝ := (0, 1) /-- Time direction, given by `(c.operators.fastCoefficient n • c.operators.vT - c.operators.epsilon n • c.operators.eT, 0)`. -/ +@[expose] noncomputable def timeDirection (c : Context D) (n : ℕ) (_x : D × ℝ) : D × ℝ := (c.operators.fastCoefficient n • c.operators.vT - c.operators.epsilon n • c.operators.eT, 0) /-- Complex base, given by `![(c.base.radial n x.1 : ℂ), (c.base.angular n x.1 : ℂ), (c.base.axial n x.1 : ℂ)]`. -/ +@[expose] noncomputable def complexBase (c : Context D) (n : ℕ) (x : D × ℝ) : ComplexVector := ![(c.base.radial n x.1 : ℂ), (c.base.angular n x.1 : ℂ), (c.base.axial n x.1 : ℂ)] /-- Complex perturbation as an element of `ComplexVector`. -/ +@[expose] noncomputable def complexPerturbation (u : State D) (n : ℕ) (x : D × ℝ) : ComplexVector := ![(u.mean.radial n x.1 + u.oscillation n x 0 : ℝ), (u.mean.angular n x.1 + u.oscillation n x 1 : ℝ), (u.mean.axial n x.1 + u.oscillation n x 2 : ℝ)] /-- Complex pressure, given by `(u.totalPressureIncrement n x : ℝ)`. -/ +@[expose] noncomputable def complexPressure (u : State D) (n : ℕ) (x : D × ℝ) : ℂ := (u.totalPressureIncrement n x : ℝ) /-- 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 : Context D) (n : ℕ) (x : D × ℝ) : Fin 3 → ℝ := ![0, -(c.operators.radialDiv 2 c.virtualTheta n x.1), -(c.operators.radialDiv 1 c.virtualAxial n x.1)] /-- This field uses actual Fréchet derivatives. The base flat error is restored once, alongside the negative virtual-stress divergence. -/ +@[expose] noncomputable def fullResidual (c : Context D) (u : State D) : Oscillation D := fun n x i => (nonlinearResidual (c.operators.epsilon n) (fun y : D × ℝ => c.operators.radius y.1) (radialDirection c n) angularDirection (axialDirection c n) (timeDirection c n) @@ -402,18 +412,21 @@ noncomputable def fullResidual (c : Context D) (u : State D) : Oscillation D := virtualDivergence c n x i + u.errors.base n x i /-- Full good residual, given by `fullResidual c u - u.errors.total`. -/ +@[expose] 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`. -/ +@[expose] noncomputable def angularNonconstant (f : Oscillation D) : Oscillation D := fun n x i => f n x i - angularMeanVector f n x.1 i /-- Full good wave residual, given by `angularNonconstant (fullGoodResidual c u)`. -/ +@[expose] noncomputable def fullGoodWaveResidual (c : Context D) (u : State D) : Oscillation D := angularNonconstant (fullGoodResidual c u) @@ -436,6 +449,7 @@ section ActualCovariance open CorrectionState MeasureTheory /-- Angular continuous, given by `∀ n x i, Continuous (fun θ : ℝ => u n (x, θ) i)`. -/ +@[expose] def AngularContinuous (u : Oscillation D) : Prop := ∀ n x i, Continuous (fun θ : ℝ => u n (x, θ) i) @@ -595,6 +609,7 @@ open CorrectionState variable {S : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] [FiniteDimensional ℝ S] /-- Mean bar, defined pointwise by `PressureStream.torusAverage (f n) (x.1, x.2.1)`. -/ +@[expose] noncomputable def meanBar (f : ScalarField (PressureStream.Lift S)) : ScalarField (PressureStream.Lift S) := fun n x => PressureStream.torusAverage (f n) (x.1, x.2.1) @@ -954,6 +969,7 @@ noncomputable def PhysicalFields.add (u v : PhysicalFields P) : PhysicalFields P aliasError := u.aliasError + v.aliasError /-- Mean components, given by `![m.radial n x, m.angular n x, m.axial n x]`. -/ +@[expose] noncomputable def meanComponents (m : Triple D) (n : ℕ) (x : D) : Fin 3 → ℝ := ![m.radial n x, m.angular n x, m.axial n x] @@ -1227,6 +1243,7 @@ open CorrectionState /-- The concrete normalized five-row inverse uses the physical coordinate functions of the current slow point, with no dependence on the torus slot. -/ +@[expose] noncomputable def normalizedRankData (coord A B lam a b : ℝ) : RankData PressureStream.Plane where lambda := lam @@ -1368,6 +1385,7 @@ variable {S : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] /-- Replace precisely the obsolete radial alias when the pressure has been recomputed. All other accumulated aliases remain in the error field. -/ +@[expose] noncomputable def refreshPressureAlias (p : ReconstructionData) (c : Context (PressureStream.Lift S)) (old current : State (PressureStream.Lift S)) : State (PressureStream.Lift S) := @@ -1571,17 +1589,19 @@ theorem fullResidual_reconstructed_with_mean {ι : Type*} {U : Set D} meanCoefficientValue_eq_meanResidual hrep H h hx.1 i] /-- Mean lift, defined pointwise by `meanComponents m n x.1`. -/ +@[expose] noncomputable def meanLift (m : Triple D) : Oscillation D := fun n x => meanComponents m n x.1 /-- Mean divergence, defined pointwise by `c.operators.dr m.radial n x + m.radial n x / c.operators.radius x + c.operators.dz m.axial n x`. -/ +@[expose] noncomputable def meanDivergence (c : Context D) (m : Triple D) : ScalarField D := fun n x => c.operators.dr m.radial n x + m.radial n x / c.operators.radius x + 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) @@ -1768,12 +1788,14 @@ variable {S : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] /-- Pressure reconstruction with the prescribed transported radial data for each band. This is an actual field constructor. -/ +@[expose] noncomputable def reconstructPressureFamily (r : ℕ → ReconstructionData) (c : Context (PressureStream.Lift S)) (u : State (PressureStream.Lift S)) : State (PressureStream.Lift S) := { u with pressure := fun n => (reconstructPressure (r n) c u).pressure n } /-- Common temporal error as an element of `Oscillation (PressureStream.Lift S)`. -/ +@[expose] noncomputable def commonTemporalError (r : ℕ → ReconstructionData) (h : ℝ) (index : ℕ → ℕ) (c : Context (PressureStream.Lift S)) (u : State (PressureStream.Lift S)) : Oscillation (PressureStream.Lift S) := @@ -1781,6 +1803,7 @@ noncomputable def commonTemporalError (r : ℕ → ReconstructionData) (h : ℝ) (MeanChartCompatibility.commonTemporalAlias r h index (u.axialResidual c) n) x.1] /-- Common temporal stage, constructed using `reconstructPressureFamily`. -/ +@[expose] noncomputable def commonTemporalStage (r : ℕ → ReconstructionData) (h : ℝ) (index : ℕ → ℕ) (axial : S × PressureStream.Plane) (c : Context (PressureStream.Lift S)) (u : State (PressureStream.Lift S)) : @@ -2067,6 +2090,7 @@ section HarmonicStateUpdates open CorrectionState /-- Add coefficient families on the same fixed label carrier. -/ +@[expose] noncomputable def addBlock (a b : HarmonicBlock D) : HarmonicBlock D := { a with velocity := fun n i => a.velocity n i + b.velocity n i pressure := fun n => a.pressure n + b.pressure n } @@ -2373,6 +2397,7 @@ theorem signedTensorRemainder_exact (primary old tangent curl : Oscillation D) /-- Sub block, given by `{ a with velocity := fun n i => a.velocity n i - b.velocity n i pressure := fun n => a.pressure n - b.pressure n }`. -/ +@[expose] noncomputable def subBlock (a b : HarmonicBlock D) : HarmonicBlock D := { a with velocity := fun n i => a.velocity n i - b.velocity n i pressure := fun n => a.pressure n - b.pressure n } @@ -3105,6 +3130,7 @@ open CorrectionState VariableGaugeMean variable {S : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] /-- Gauge refresh pressure alias as an element of `State (PressureStream.Lift S)`. -/ +@[expose] noncomputable def gaugeRefreshPressureAlias (g : GaugeData S) (c : Context (PressureStream.Lift S)) (old current : State (PressureStream.Lift S)) : State (PressureStream.Lift S) := @@ -3399,6 +3425,7 @@ section WaveMeanResidual open CorrectionState VariableGaugeMean /-- Zero triple, given by `⟨0, 0, 0⟩`. -/ +@[expose] noncomputable def zeroTriple : Triple D := ⟨0, 0, 0⟩ omit [NormedAddCommGroup D] [NormedSpace ℝ D] in @@ -3409,6 +3436,7 @@ variable {S : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] /-- Insert the actual oscillation and its actual excluded error, then reconstruct pressure from the resulting literal covariance. -/ +@[expose] noncomputable def gaugeWaveStage (g : GaugeData S) (c : Context (PressureStream.Lift S)) (u : State (PressureStream.Lift S)) (w : Oscillation (PressureStream.Lift S)) (q : OscillatoryScalar (PressureStream.Lift S)) (e : ExcludedErrors (PressureStream.Lift S)) : @@ -3416,6 +3444,7 @@ noncomputable def gaugeWaveStage (g : GaugeData S) (c : Context (PressureStream. reconstructState g c (u.addIncrement zeroTriple 0 w q e) /-- Gauge wave pressure change, given by `(gaugeWaveStage g c u w q e).pressure - u.pressure`. -/ +@[expose] noncomputable def gaugeWavePressureChange (g : GaugeData S) (c : Context (PressureStream.Lift S)) (u : State (PressureStream.Lift S)) (w : Oscillation (PressureStream.Lift S)) (q : OscillatoryScalar (PressureStream.Lift S)) (e : ExcludedErrors (PressureStream.Lift S)) : @@ -3584,12 +3613,13 @@ 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 /-- Exact block, constructed using `SignedWaveUpdate.blockOfCoefficients`. -/ +@[expose] noncomputable def SignedParameters.exactBlock (p : SignedParameters D) (s : StripData D) (request : ℕ → D × ℝ → SignedWaveUpdate.Vec2) : HarmonicBlock D := SignedWaveUpdate.blockOfCoefficients @@ -3826,6 +3856,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 @@ -4248,6 +4279,7 @@ theorem SignedParameters.frame_corrected (p : SignedParameters D) (s : StripData /-- Gaussian block, given by `SignedWaveUpdate.gaussianBlock (p.coefficients s request) p.directions p.cutoff p.angularFrequency`. -/ +@[expose] noncomputable def SignedParameters.gaussianBlock (p : SignedParameters D) (s : StripData D) (request : ℕ → D × ℝ → SignedWaveUpdate.Vec2) : HarmonicBlock D := SignedWaveUpdate.gaussianBlock (p.coefficients s request) p.directions p.cutoff p.angularFrequency @@ -4640,6 +4672,7 @@ open CorrectionState VariableGaugeMean variable {S : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] /-- Gauge supported, given by `∀ n, SupportedGauge a b ell U (f n)`. -/ +@[expose] def GaugeSupported (a b : ℝ) (ell : S → ℝ) (U : Set S) (f : ScalarField (PressureStream.Lift S)) : Prop := ∀ n, SupportedGauge a b ell U (f n) @@ -5035,7 +5068,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 +5083,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 +5096,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,15 +5105,18 @@ 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 /-- Curl block, given by `subBlock (p.exactBlock s request) (p.tangentBlock s request)`. -/ +@[expose] noncomputable def curlBlock (s : StripData D) (request : ℕ → D × ℝ → SignedWaveUpdate.Vec2) : HarmonicBlock D := subBlock (p.exactBlock s request) (p.tangentBlock s request) /-- Good block, constructed using `SignedWaveUpdate.coefficientBlock`. -/ +@[expose] noncomputable def goodBlock (s : StripData D) (request : ℕ → D × ℝ → SignedWaveUpdate.Vec2) : HarmonicBlock D := SignedWaveUpdate.coefficientBlock p.base.frequency (fun n x => p.base.phase n (x,0)) @@ -5088,6 +5126,7 @@ noncomputable def goodBlock (s : StripData D) (request : ℕ → D × ℝ → Si (fun _ _ => 0) /-- Gaussian block, constructed using `SignedWaveUpdate.coefficientBlock`. -/ +@[expose] noncomputable def gaussianBlock (s : StripData D) (request : ℕ → D × ℝ → SignedWaveUpdate.Vec2) : HarmonicBlock D := SignedWaveUpdate.coefficientBlock p.base.frequency (fun n x => p.base.phase n (x,0)) @@ -5151,7 +5190,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 : ℤ) : @@ -5172,12 +5211,14 @@ noncomputable def copyData (c : Context (P × TorusInverse.Plane)) (u : State (P /-- Native strip, given by `ParticularWaveBounds.reindexStrip ParticularWaveAssembly.angleShuffle.symm (HarmonicWaveInteraction.productStrip s)`. -/ +@[expose] noncomputable def nativeStrip (s : StripData (P × TorusInverse.Plane)) : StripData ((P × ℝ) × TorusInverse.Plane) := ParticularWaveBounds.reindexStrip ParticularWaveAssembly.angleShuffle.symm (HarmonicWaveInteraction.productStrip s) /-- Wave, given by `(p.copyData c u b G A j).commonCorrected (nativeStrip s) p.directions`. -/ +@[expose] noncomputable def wave (s : StripData (P × TorusInverse.Plane)) (c : Context (P × TorusInverse.Plane)) (u : State (P × TorusInverse.Plane)) (b : HarmonicBlock (P × TorusInverse.Plane)) @@ -5186,7 +5227,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 @@ -5196,6 +5237,7 @@ noncomputable def updateBlock (s : StripData (P × TorusInverse.Plane)) (fun j n x => (p.wave s c u b G A j).pressure n (ParticularWaveAssembly.angleShuffle (x,0))) /-- Good block, constructed using `ParticularWaveAssembly.assembledBlock`. -/ +@[expose] noncomputable def goodBlock (s : StripData (P × TorusInverse.Plane)) (c : Context (P × TorusInverse.Plane)) (u : State (P × TorusInverse.Plane)) (b : HarmonicBlock (P × TorusInverse.Plane)) @@ -5206,7 +5248,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 +5292,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 +5340,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 +5349,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,85 +5358,95 @@ 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 l).oscillatoryPressure n x`. -/ +@[expose] noncomputable def particularPressure : OscillatoryScalar CyclePoint := fun n x => ∑ l ∈ v.labels n, (p.particularBlock v c u l).oscillatoryPressure n x /-- Particular gaussian, given by `LabelSumBounds.fieldSum v.labels (fun l => (p.particularGaussianBlock v c u l).oscillation)`. -/ +@[expose] noncomputable def particularGaussian : Oscillation CyclePoint := LabelSumBounds.fieldSum v.labels (fun l => (p.particularGaussianBlock v c u l).oscillation) /-- After particular, given by `gaugeWaveStage p.gauge c u (p.particularVelocity v c u) (p.particularPressure v c u) ⟨0, p.particularGaussian v c u, 0⟩`. -/ +@[expose] noncomputable def afterParticular : State CyclePoint := gaugeWaveStage p.gauge c u (p.particularVelocity v c u) (p.particularPressure v c u) ⟨0, p.particularGaussian v c u, 0⟩ /-- The signed request is recomputed from the actual state after the particular solve; it is not supplied independently. -/ +@[expose] noncomputable def signedRequest : ℕ → CyclePoint × ℝ → SignedWaveUpdate.Vec2 := 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 u)`. -/ +@[expose] noncomputable def signedGaussianBlock (l : ι) : HarmonicBlock CyclePoint := (p.signed l).gaussianBlock p.strip (p.signedRequest v c u) /-- 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 v c u l).oscillation)`. -/ +@[expose] noncomputable def signedGaussian : Oscillation CyclePoint := LabelSumBounds.fieldSum v.labels (fun l => (p.signedGaussianBlock v c u l).oscillation) /-- After signed, constructed using `gaugeWaveStage`. -/ +@[expose] noncomputable def afterSigned : State CyclePoint := gaugeWaveStage p.gauge c (p.afterParticular v c u) (p.signedVelocity v c u) (p.signedPressure v c u) ⟨0, p.signedGaussian v c u, 0⟩ /-- 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)`. -/ +@[expose] noncomputable def afterRank : State CyclePoint := rankStageState p.gauge p.rank p.axial c (p.afterTemporal v c u) /-- Four literal updates followed by replacement of the obsolete radial pressure alias. The current radial alias is recorded exactly once. -/ +@[expose] noncomputable def next : State CyclePoint := gaugeRefreshPressureAlias p.gauge c u (p.afterRank v c u) /-- Final block, given by `addBlock (addBlock (v.blocks l) (p.particularBlock v c u l)) (p.signedBlock v c u l)`. -/ +@[expose] noncomputable def finalBlock (l : ι) : HarmonicBlock CyclePoint := addBlock (addBlock (v.blocks l) (p.particularBlock v c u l)) (p.signedBlock v c u l) @@ -6055,7 +6107,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 +7287,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 @@ -7271,6 +7323,7 @@ theorem particularGaussian_carrier (l : ι) : SameCarrier (v.blocks l) (p.partic /-- The new nonzero harmonic data are literal sums of the old and constructed coefficients. All new mean aliases remain in the separate field. -/ +@[expose] noncomputable def nextCoefficients : CycleCoefficients ι where labels := v.labels blocks := p.finalBlock v c u @@ -7280,6 +7333,7 @@ noncomputable def nextCoefficients : CycleCoefficients ι where residualBand := 2 * max v.residualBand 1 /-- Next axisymmetric alias as an element of `AxisymmetricAlias`. -/ +@[expose] noncomputable def nextAxisymmetricAlias (axis : AxisymmetricAlias) : AxisymmetricAlias := fun n x i => axis n x i + VariableGaugeMean.temporalAliasState p.gauge p.timeExponent p.commonIndex c (p.afterSigned v c @@ -7409,6 +7463,7 @@ namespace CycleState variable {ι : Type} /-- Step, bundling `state`, `coefficients`, `axisymmetricAlias`. -/ +@[expose] noncomputable def step (p : CycleParameters ι) (c : Context CyclePoint) (u : CycleState ι) : CycleState ι where state := p.next u.coefficients c u.state @@ -7417,7 +7472,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 @@ -8124,14 +8179,17 @@ variable {ι : Type} (p : CycleParameters ι) (v : CycleCoefficients ι) (c : Context CyclePoint) (u : State CyclePoint) /-- Before signed block, given by `addBlock (v.blocks l) (p.particularBlock v c u l)`. -/ +@[expose] noncomputable def beforeSignedBlock (l : ι) : HarmonicBlock CyclePoint := addBlock (v.blocks l) (p.particularBlock v c u l) /-- Signed tangent, given by `(p.signed l).tangentBlock p.strip (p.signedRequest v c u)`. -/ +@[expose] noncomputable def signedTangent (l : ι) : HarmonicBlock CyclePoint := (p.signed l).tangentBlock p.strip (p.signedRequest v c u) /-- Signed curl, given by `(p.signed l).curlBlock p.strip (p.signedRequest v c u)`. -/ +@[expose] noncomputable def signedCurl (l : ι) : HarmonicBlock CyclePoint := (p.signed l).curlBlock p.strip (p.signedRequest v c u) @@ -8160,6 +8218,7 @@ theorem block_band_mono {b : HarmonicBlock CyclePoint} {N M : ℕ} /-- The family in the signed covariance identity is computed from the current cycle, including its actual particular increment and signed curl. -/ +@[expose] noncomputable def signedFamily (primary : ι → HarmonicBlock CyclePoint) (P : ι → ℕ → CyclePoint → ℝ) {σ κ : ℝ} (hσ : 1 / 5 ≤ σ) (N : ℕ) @@ -8303,6 +8362,7 @@ variable {D I ι : Type} [NormedAddCommGroup D] [NormedSpace ℝ D] /-- Joint raw background, given by `LocalizedWaveBounds.WaveFamily.ofCoefficients (fun j => {(a j.1).background with amplitude := 0, pressure := 0})`. -/ +@[expose] noncomputable def jointRawBackground (a : ι → PeriodizedWaveBounds.CopyData D I) : LocalizedWaveBounds.WaveFamily D (ι × I) := LocalizedWaveBounds.WaveFamily.ofCoefficients (fun j => @@ -8310,6 +8370,7 @@ noncomputable def jointRawBackground (a : ι → PeriodizedWaveBounds.CopyData D /-- Joint raw coefficients, given by `LocalizedWaveBounds.WaveFamily.ofCoefficients (fun j => (a j.1).raw j.2)`. -/ +@[expose] noncomputable def jointRawCoefficients (a : ι → PeriodizedWaveBounds.CopyData D I) : LocalizedWaveBounds.WaveFamily D (ι × I) := LocalizedWaveBounds.WaveFamily.ofCoefficients (fun j => (a j.1).raw j.2) @@ -8464,7 +8525,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) @@ -9315,6 +9376,7 @@ open Set MeasureTheory WeightedClasses MeanIncrementBounds CorrectionState Local open scoped ContDiff BigOperators /-- Whole-fiber periodicity of the actual real oscillation. -/ +@[expose] def OscillationPeriodic (U : Set PressureStream.Plane) (w : Oscillation Point) : Prop := ∀ n R s, s ∈ U → ∀ θ, FourierAlias.TorusPeriodic (fun Y => w n ((R,(s,Y)),θ)) @@ -9569,6 +9631,7 @@ open scoped ContDiff BigOperators namespace CycleParameters /-- One geometric choice is shared by all four literal stages. -/ +@[expose] noncomputable def ofGeometry {ι : Type} (G : SignedMeanGain.Geometry) (h : ℝ) (index : ℕ → ℕ) (axial : PressureStream.Plane × PressureStream.Plane) (particular : ι → ParticularParameters CycleSlow) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/CurlClassBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/CurlClassBounds.lean index b1164d97ab..e5e9b4e44c 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) @@ -1912,6 +1915,7 @@ theorem normalCurlRemainder_class {N : ℕ → D → RealVector} {a : ℕ → D curlRemainder_class (normalCoefficient_class hN ha hb hlower hupper) hκ hr hθ hz hR hK /-- Carrier frequency, given by `Scaling.carrierFrequency (s.epsilon n)`. -/ +@[expose] noncomputable def carrierFrequency (s : StripData D) (n : ℕ) : ℝ := Scaling.carrierFrequency (s.epsilon n) @@ -2190,12 +2194,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 +2219,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..ebebe883f6 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 @@ -320,7 +320,7 @@ theorem scaledRadial_mem_annulus (n : ℕ) {w : SpaceTime} /-- The literal current common-cover evaluation point used in the physical mode estimates. -/ -noncomputable def point (a : ℝ) (i : PolarCharts.Index) (n : ℕ) (w : SpaceTime) : +@[expose] noncomputable def point (a : ℝ) (i : PolarCharts.Index) (n : ℕ) (w : SpaceTime) : PhysicalParticularWave.WaveSpace := CurrentPhysicalChartJets.chartMap a i (PhysicalWaveSum.commonLift ActualPrimary.h n (CurrentPhysicalModeGerms.commonGap n) w) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/CurrentPhysicalChartJets.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/CurrentPhysicalChartJets.lean index 15db1178bc..8be12bc64c 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 @@ -37,6 +37,7 @@ abbrev Native := PhysicalParticularWave.WaveSpace abbrev ComplexVector := HarmonicCalculus.ComplexVector /-- The actual polar lift followed by the solver's fixed coordinate order. -/ +@[expose] noncomputable def chartMap (a : ℝ) (j : PolarCharts.Index) : LiftPoint → Native := fun x => PhysicalParticularWave.waveEquiv (ActualSignedPhysicalData.cylinderAt a j x) @@ -200,6 +201,7 @@ theorem chart_smul_germ {a c : ℝ} (ha : 0 < a) (hc : 0 < c) (j : PolarCharts.I /-! ## The actual Cartesian rotation -/ /-- Rotation, given by `CartesianCopySource.rotationMap (PhysicalGraphBounds.liftXY x)`. -/ +@[expose] noncomputable def rotation (x : LiftPoint) : ComplexVector →L[ℝ] ComplexVector := CartesianCopySource.rotationMap (PhysicalGraphBounds.liftXY x) @@ -231,6 +233,7 @@ theorem rotationMap_smul {c : ℝ} (hc : 0 < c) (p : Plane) : /-- Rotate a native vector coefficient after pulling it into the actual normalized Cartesian lift. -/ +@[expose] noncomputable def rotated (a : ℝ) (j : PolarCharts.Index) (f : Native → ComplexVector) (x : LiftPoint) : ComplexVector := rotation x (f (chartMap a j x)) @@ -286,6 +289,7 @@ theorem realVector_norm_le (z : ComplexVector) : /-- The literal real-vector constructor is a fixed bounded linear map. This provides the final codomain conversion for physical vector modes. -/ +@[expose] noncomputable def realVectorCLM : ComplexVector →L[ℝ] ProblemStatement.Space := ({ toFun := PhysicalCurlCovariance.realVector map_add' := by 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..d54de4ea38 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 @@ -208,6 +208,7 @@ noncomputable def cutLog (p : ℕ → ℕ → ℝ) (j m : ℕ) : ℝ := finiteBo /-- Actual uncut jets, only on the portion `q ≤ 1` of the estimate carrier. No condition is imposed on order zero of the stage sequence. -/ +@[expose] def RawStageBounds (q : E → ℝ) (A : ℕ → E → V) (g L : ℕ → ℝ) (C p : ℕ → ℕ → ℝ) (S : Set E) : Prop := ∀ j, 1 ≤ j → ∀ m x, x ∈ S → q x ≤ 1 → @@ -536,11 +537,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. -/ @@ -690,6 +691,7 @@ theorem exists_physical_positive_sums_of_power [Finite ι] {h : ℝ} (hh : 0 < h (fun w hw => PhysicalWaveSum.physicalQ_pos hh hh1 hw) (hA i) hamono⟩ /-- The genuine open validity region for locally constructed raw stages. -/ +@[expose] noncomputable def physicalSublevel (h qbig : ℝ) : Set SpaceTime := PhysicalWaveSum.preterminal ∩ {w | PhysicalWaveSum.physicalQ h w < qbig} 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..6e318efed8 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 @@ -55,6 +55,7 @@ noncomputable def velocityMap (G : ScaledGraph) : Components →ₗ[ℝ] Velocit mul_left_comm] /-- Pressure includes the square of the same fixed velocity scale. -/ +@[expose] noncomputable def pressureMap (G : ScaledGraph) : (Cylinder → ℝ) →ₗ[ℝ] PressureField where toFun := PhysicalResidualTZ.pressureTZ G map_add' a b := by @@ -80,12 +81,14 @@ theorem incrementComponents_eq (u : State CyclePoint) (n : ℕ) : fin_cases i <;> rfl /-- Base plus the actual mean and oscillatory velocity, at one fixed band. -/ +@[expose] noncomputable def cylindricalVelocity (G : ScaledGraph) (n : ℕ) (c : Context CyclePoint) (u : State CyclePoint) : VelocityField := velocityMap G (PhysicalResidualBridge.baseComponents c n + PhysicalResidualBridge.incrementComponents u n) /-- The fixed base pressure is retained once, in addition to both state pressures. -/ +@[expose] noncomputable def cylindricalPressure (G : ScaledGraph) (n : ℕ) (p₀ : Cylinder → ℝ) (u : State CyclePoint) : PressureField := pressureMap G (p₀ + u.totalPressureIncrement n) @@ -101,7 +104,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) + @@ -132,6 +135,7 @@ noncomputable def cylindricalStepVelocity (G : ScaledGraph) (n : ℕ) : Velocity velocityMap G (stepComponents p v c u n) /-- Cylindrical step pressure, given by `pressureMap G (stepPressureComponents p v c u n)`. -/ +@[expose] noncomputable def cylindricalStepPressure (G : ScaledGraph) (n : ℕ) : PressureField := pressureMap G (stepPressureComponents p v c u n) @@ -162,7 +166,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)) @@ -175,6 +179,7 @@ noncomputable def polarVelocityMap (a : ℝ) (j : PolarCharts.Index) : r (v (PhysicalCurlCovariance.polarCoordinates a j z)) /-- Polar pressure map, bundling `toFun`, `map_add`, `map_smul`. -/ +@[expose] noncomputable def polarPressureMap (a : ℝ) (j : PolarCharts.Index) : PressureField →ₗ[ℝ] PressureField where toFun p z := p (PhysicalCurlCovariance.polarCoordinates a j z) @@ -182,11 +187,13 @@ noncomputable def polarPressureMap (a : ℝ) (j : PolarCharts.Index) : map_smul' _ _ := rfl /-- The actual state velocity in this local Cartesian chart. -/ +@[expose] noncomputable def velocity (a : ℝ) (j : PolarCharts.Index) (G : ScaledGraph) (n : ℕ) (c : Context CyclePoint) (u : State CyclePoint) : VelocityField := polarVelocityMap a j (cylindricalVelocity G n c u) /-- Pressure, given by `polarPressureMap a j (cylindricalPressure G n p₀ u)`. -/ +@[expose] noncomputable def pressure (a : ℝ) (j : PolarCharts.Index) (G : ScaledGraph) (n : ℕ) (p₀ : Cylinder → ℝ) (u : State CyclePoint) : PressureField := polarPressureMap a j (cylindricalPressure G n p₀ u) @@ -241,6 +248,7 @@ noncomputable def stepVelocity : VelocityField := polarVelocityMap a j (cylindricalStepVelocity p v c u G n) /-- Step pressure, given by `polarPressureMap a j (cylindricalStepPressure p v c u G n)`. -/ +@[expose] noncomputable def stepPressure : PressureField := polarPressureMap a j (cylindricalStepPressure p v c u G n) @@ -272,12 +280,14 @@ variable {ι : Type} (p : ℕ → CycleParameters ι) (c : Context CyclePoint) (seed : CycleState ι) (a : ℝ) (j : PolarCharts.Index) (G : ScaledGraph) (n : ℕ) /-- Velocity stages, constructed using `Nat.casesOn`. -/ +@[expose] noncomputable def velocityStages (k : ℕ) : VelocityField := Nat.casesOn k (velocity a j G n c seed.state) (fun k => stepVelocity (p k) (CycleState.iterate p c seed k).coefficients c (CycleState.iterate p c seed k).state a j G n) /-- Pressure stages, constructed using `Nat.casesOn`. -/ +@[expose] noncomputable def pressureStages (p₀ : Cylinder → ℝ) (k : ℕ) : PressureField := Nat.casesOn k (pressure a j G n p₀ seed.state) (fun k => stepPressure (p k) (CycleState.iterate p c seed k).coefficients c @@ -334,11 +344,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 : ℕ) : @@ -348,6 +358,7 @@ theorem meanComponents_split (m : Triple CyclePoint) (n : ℕ) : /-- This velocity contribution still needs a potential realization. It includes the full base, the initialized wave, and the meridional mean. -/ +@[expose] noncomputable def initialPotentialPart (a : ℝ) (j : PolarCharts.Index) (G : ScaledGraph) (n : ℕ) (c : Context CyclePoint) (u : State CyclePoint) : VelocityField := polarVelocityMap a j (velocityMap G (PhysicalResidualBridge.baseComponents c n + @@ -355,6 +366,7 @@ noncomputable def initialPotentialPart (a : ℝ) (j : PolarCharts.Index) (G : Sc /-- Initial direct part, given by `polarVelocityMap a j (velocityMap G (angularComponents u.mean n))`. -/ +@[expose] noncomputable def initialDirectPart (a : ℝ) (j : PolarCharts.Index) (G : ScaledGraph) (n : ℕ) (u : State CyclePoint) : VelocityField := polarVelocityMap a j (velocityMap G (angularComponents u.mean n)) @@ -373,12 +385,14 @@ variable {ι : Type} (p : CycleParameters ι) (v : CycleCoefficients ι) (a : ℝ) (j : PolarCharts.Index) (G : ScaledGraph) (n : ℕ) /-- The wave increments and the two meridional mean increments, literally. -/ +@[expose] noncomputable def stepPotentialPart : VelocityField := polarVelocityMap a j (velocityMap G (p.particularVelocity v c u n + p.signedVelocity v c u n + meridionalComponents (p.temporalIncrement v c u) n + meridionalComponents (p.rankIncrement v c u) n)) /-- The angular means remain direct velocities, not unspecified curls. -/ +@[expose] noncomputable def stepDirectPart : VelocityField := polarVelocityMap a j (velocityMap G (angularComponents (p.temporalIncrement v c u) n + angularComponents (p.rankIncrement v c u) n)) @@ -398,12 +412,14 @@ variable {ι : Type} (p : ℕ → CycleParameters ι) (c : Context CyclePoint) (seed : CycleState ι) (a : ℝ) (j : PolarCharts.Index) (G : ScaledGraph) (n : ℕ) /-- The exact velocity each still-to-be-constructed potential must realize. -/ +@[expose] noncomputable def potentialParts (k : ℕ) : VelocityField := Nat.casesOn k (initialPotentialPart a j G n c seed.state) (fun k => stepPotentialPart (p k) (CycleState.iterate p c seed k).coefficients c (CycleState.iterate p c seed k).state a j G n) /-- The direct angular sequence is constructed from the actual states. -/ +@[expose] noncomputable def directStages (k : ℕ) : VelocityField := Nat.casesOn k (initialDirectPart a j G n seed.state) (fun k => stepDirectPart (p k) (CycleState.iterate p c seed k).coefficients c 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..bf4fee0ae4 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 @@ -36,6 +36,7 @@ abbrev Point (P : Type) := PressureStream.Lift P abbrev ScalarField (D : Type) := MeanIncrementBounds.Field D /-- Positive domain, given by `{x | 0 < x.1}`. -/ +@[expose] noncomputable def positiveDomain : Set (Point P) := {x | 0 < x.1} omit [NormedSpace ℝ P] in @@ -225,7 +226,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 @@ -314,58 +315,65 @@ theorem barMoment_mem /-! ## Literal changes, linear rows, and explicit nonlinear remainders -/ /-- Theta leading, given by `base.axial * h.angular + base.angular * h.axial`. -/ +@[expose] noncomputable def thetaLeading (base h : Triple (Point P)) : ScalarField (Point P) := 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`. -/ +@[expose] noncomputable def thetaQuadratic (m h : Triple (Point P)) : ScalarField (Point P) := m.axial * h.angular + h.axial * m.angular + h.axial * h.angular /-- Axial quadratic, given by `(2 : ℝ) • (m.axial * h.axial) + h.axial * h.axial`. -/ +@[expose] noncomputable def axialQuadratic (m h : Triple (Point P)) : ScalarField (Point P) := (2 : ℝ) • (m.axial * h.axial) + h.axial * h.axial /-- This is the actual source difference minus the centrifugal linear row; its formula and class are proved from equation (32). -/ +@[expose] noncomputable def actualRadialError (o : Operators (Point P)) (base m h : Triple (Point P)) (W : Fin 3 → Fin 3 → ScalarField (Point P)) : ScalarField (Point P) := gr o base (updated m h) W - gr o base m W - leadingRadial o base h /-- Pressure defect, given by `barMoment 0 (gr o base m W)`. -/ +@[expose] noncomputable def pressureDefect (o : Operators (Point P)) (base m : Triple (Point P)) (W : Fin 3 → Fin 3 → ScalarField (Point P)) : ScalarField P := barMoment 0 (gr o base m W) /-- Theta defect, given by `barMoment 2 (thetaAxial base m + W 2 1)`. -/ +@[expose] noncomputable def thetaDefect (base m : Triple (Point P)) (W : Fin 3 → Fin 3 → ScalarField (Point P)) : ScalarField P := barMoment 2 (thetaAxial base m + W 2 1) /-- Axial defect, given by `barMoment 1 (axialAxial base m + W 2 2) - (1 / 2 : ℝ) • barMoment 2 (gr o base m W)`. -/ +@[expose] noncomputable def axialDefect (o : Operators (Point P)) (base m : Triple (Point P)) (W : Fin 3 → Fin 3 → ScalarField (Point P)) : ScalarField P := barMoment 1 (axialAxial base m + W 2 2) - (1 / 2 : ℝ) • barMoment 2 (gr o base m W) /-- 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,10 +611,11 @@ 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`. -/ +@[expose] noncomputable def IsSlow (f : ScalarField (Point P)) : Prop := ∀ 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..a69e6b4104 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,10 +48,11 @@ 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. -/ +@[expose] def FiniteJetRate (l : Filter D) (q : D → ℝ) (f : D → V) (M : ℕ) (r : ℝ) : Prop := ∃ C : ℝ, 0 ≤ C ∧ ∀ᶠ x in l, ∀ m ≤ M, ‖iteratedFDeriv ℝ m f x‖ ≤ C * (q x) ^ r 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..88c84aa2ee 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,22 +37,24 @@ 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`. -/ +@[expose] noncomputable def physicalDomain (U : Set Slow) : Set SpaceTime := slowPoint ⁻¹' U /-- Positive domain, given by `{p | slowOfCyl p ∈ U ∧ 0 < p.2.1}`. -/ +@[expose] noncomputable def positiveDomain (U : Set Slow) : Set CylPoint := {p | slowOfCyl p ∈ U ∧ 0 < p.2.1} @@ -80,7 +82,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 @@ -260,6 +262,7 @@ theorem divergence_cut_angular {U : Set Slow} (hU : IsOpen U) (D : AngularData U /-! ## Locally finite direct angular sums -/ /-- Angular sum, given by `SolenoidalDiagonal.potentialSum a q (fun j => angularField (b j))`. -/ +@[expose] noncomputable def angularSum (a : ℕ → ℝ) (q : SpaceTime → ℝ) (b : ℕ → Coefficient) : VelocityField := SolenoidalDiagonal.potentialSum a q (fun j => angularField (b j)) @@ -373,6 +376,7 @@ theorem angularSum_axis_zero_germ {U : Set Slow} (hU : IsOpen U) (D : ℕ → An /-- Mixed velocity, defined pointwise by `SolenoidalDiagonal.velocitySum a q A x + angularSum a q b x`. -/ +@[expose] noncomputable def mixedVelocity (a : ℕ → ℝ) (q : SpaceTime → ℝ) (A : ℕ → VelocityField) (b : ℕ → Coefficient) : VelocityField := fun x => SolenoidalDiagonal.velocitySum a q A x + angularSum a q b x @@ -413,11 +417,13 @@ theorem mixedVelocity_axis (a : ℕ → ℝ) (q : SpaceTime → ℝ) (A : ℕ /-! ## The actual similarity cutoff -/ /-- Preterminal slow, given by `{s | s.1 < 1}`. -/ +@[expose] noncomputable def preterminalSlow : Set Slow := {s | s.1 < 1} theorem preterminalSlow_open : IsOpen preterminalSlow := isOpen_lt continuous_fst continuous_const /-- Q coefficient, given by `SimilarityProfile.q h`. -/ +@[expose] noncomputable def qCoefficient (h : ℝ) : Coefficient := SimilarityProfile.q h theorem qCoefficient_physical (h : ℝ) (w : SpaceTime) : 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..5726b8603c 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 @@ -84,13 +84,16 @@ theorem stableInverse_zeroTime {a z : ℝ} (ha : 0 < a) (ha1 : a < 1) (hz : z rwa [hf] at he /-- Time axial, given by `(1 - p.1, p.2.2)`. -/ +@[expose] noncomputable def timeAxial (p : PhysicalPoint) : ℝ × ℝ := (1 - p.1, p.2.2) /-- Domain, given by `timeAxial ⁻¹' PositiveRepresentatives.stableTarget (2 * h)`. -/ +@[expose] noncomputable def domain (h : ℝ) : Set PhysicalPoint := timeAxial ⁻¹' PositiveRepresentatives.stableTarget (2 * h) /-- Q extension, given by `(PositiveRepresentatives.stableInverse (2 * h) (timeAxial p)).1`. -/ +@[expose] noncomputable def qExtension (h : ℝ) (p : PhysicalPoint) : ℝ := (PositiveRepresentatives.stableInverse (2 * h) (timeAxial p)).1 @@ -106,6 +109,7 @@ noncomputable def innerExtension (h : ℝ) (p : PhysicalPoint) : ℝ × ℝ := (XExtension h p, etaExtension h p) /-- Chart extension, given by `(qExtension h p, innerExtension h p)`. -/ +@[expose] noncomputable def chartExtension (h : ℝ) (p : PhysicalPoint) : Chart := (qExtension h p, innerExtension h p) @@ -251,10 +255,12 @@ theorem endpoint_neighborhood {h : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) /-- Cartesian domain, given by `(fun z => AxisymmetricFields.profilePoint z.1 z.2) ⁻¹' domain h`. -/ +@[expose] noncomputable def cartesianDomain (h : ℝ) : Set ProblemStatement.SpaceTime := (fun z => AxisymmetricFields.profilePoint z.1 z.2) ⁻¹' domain h /-- Cartesian extension, given by `chartExtension h (AxisymmetricFields.profilePoint z.1 z.2)`. -/ +@[expose] noncomputable def cartesianExtension (h : ℝ) (z : ProblemStatement.SpaceTime) : Chart := chartExtension h (AxisymmetricFields.profilePoint z.1 z.2) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/EntranceAlignedBase.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/EntranceAlignedBase.lean index 36a11fcd4f..b15ee53a05 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 @@ -396,6 +396,7 @@ theorem smallZeroOrder : ZeroOrderSolved (scheme W H Q M hlo) (nominalInner W) : /-- Aligned coefficients, given by `coefficients (smallLocalization W H Q M hlo) (smallBaseAgreement W H Q M hlo) (smallZeroOrder W H Q M hlo) M.contains`. -/ +@[expose] noncomputable def alignedCoefficients : SlowBorelBase.Coefficients := coefficients (smallLocalization W H Q M hlo) (smallBaseAgreement W H Q M hlo) (smallZeroOrder W H Q M hlo) M.contains @@ -868,11 +869,13 @@ 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)) /-- Modulated coefficients, given by `alignedCoefficients W H v.profiles v.finiteModification (modulation_after_entrance (d := d))`. -/ +@[expose] noncomputable def modulatedCoefficients : SlowBorelBase.Coefficients := alignedCoefficients W H v.profiles v.finiteModification (modulation_after_entrance (d := d)) @@ -1172,7 +1175,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 +1192,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 @@ -1229,6 +1232,7 @@ theorem uniform_envelope {ι E F : Type*} [NormedAddCommGroup E] [NormedSpace (mul_le_mul_of_nonneg_right (by linarith) (hw i)) /-- Sum region, given by `Ioi 0 ×ˢ (Ioi 0 ×ˢ univ)`. -/ +@[expose] noncomputable def sumRegion : Set Chart := Ioi 0 ×ˢ (Ioi 0 ×ˢ univ) theorem sumRegion_open : IsOpen sumRegion := isOpen_Ioi.prod (isOpen_Ioi.prod isOpen_univ) @@ -1277,6 +1281,7 @@ theorem scaled_jet_from_blown {f : Chart → ℝ} exact mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (norm_nonneg _) hnorm j) (norm_nonneg _) /-- Inner region, given by `Ioo qlo qhi ×ˢ (Ioo lo hi ×ˢ Ioo (-1) 1)`. -/ +@[expose] noncomputable def innerRegion (qlo qhi lo hi : ℝ) : Set Chart := Ioo qlo qhi ×ˢ (Ioo lo hi ×ˢ Ioo (-1) 1) @@ -1329,11 +1334,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 @@ -1378,6 +1385,7 @@ theorem actual_error_envelopes {ι : Type*} {a : ℕ → ℕ} {h C qlo qhi lo hi exact ⟨B, hB, fun q hq hq1 w hw => (hb q hq hq1 w hw).2⟩ /-- Physical input, given by `(1 - p.2.2, (p.1 ^ 2 / 2, p.2.1))`. -/ +@[expose] noncomputable def physicalInput (p : Slow) : Chart := (1 - p.2.2, (p.1 ^ 2 / 2, p.2.1)) theorem physicalInput_smooth : ContDiff ℝ ∞ physicalInput := @@ -1430,6 +1438,7 @@ structure GeometryBounds {ι : Type*} (D : Domain ι Slow) lo < (normalizedCoordinates h p).2.1 ∧ (normalizedCoordinates h p).2.1 < hi /-- Unit scale, given by `oneDomain ι D.carrier D.isOpen`. -/ +@[expose] noncomputable def unitScale {ι E : Type*} [NormedAddCommGroup E] (D : Domain ι E) : Domain ι E := oneDomain ι D.carrier D.isOpen @@ -1535,32 +1544,34 @@ 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)) /-- Leading frequency, given by `frequencyFactor h p * SlowBorelBase.leadingSwirl C d (normalizedCoordinates h p).2`. -/ +@[expose] noncomputable def leadingFrequency (h C : ℝ) (d : SlowBorelBase.Coefficients) (p : Slow) : ℝ := frequencyFactor h p * SlowBorelBase.leadingSwirl C d (normalizedCoordinates h p).2 /-- Leading axial, given by `axialFactor h p * d.axial 0 (normalizedCoordinates h p).2`. -/ +@[expose] noncomputable def leadingAxial (h : ℝ) (d : SlowBorelBase.Coefficients) (p : Slow) : ℝ := axialFactor h p * d.axial 0 (normalizedCoordinates h p).2 @@ -1856,7 +1867,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,15 +2033,17 @@ 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 precisely the manuscript's `S_n`; it is not a replacement coordinate. -/ +@[expose] noncomputable def positiveCellDomain (h lo hi : ℝ) (N : ℕ) : Domain (CellIndex h lo hi N) Slow where scale L := ChartScales.S (cellBand L) carrier L := PositiveRepresentatives.positiveCell L.val.val.1 L.val.val.2 @@ -2140,7 +2153,7 @@ end end -@[expose] public section +public section noncomputable section @@ -2328,7 +2341,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..78de5dc5ba 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 (σ κ : ℝ) : ℝ := @@ -296,6 +296,7 @@ theorem old_difference_bar_margin_iff (κ : ℝ) : constructor <;> intro h <;> linarith /-- Iterated accuracy parameters; this does not assert existence of the iterates. -/ +@[expose] def stageParameter (n : ℕ) : ℝ := 1 / 5 + (n : ℝ) / 10 theorem stage_parameter_zero : stageParameter 0 = 1 / 5 := by diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ExtendedHeatDebts.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ExtendedHeatDebts.lean index d9af0f554c..dc2328cdb9 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 @@ -43,7 +43,7 @@ variable {α : Type*} [MeasurableSpace α] {μ : Measure α} {J : ℕ → ℝ /-- Chain dominated, given by `∀ n L, 0 < L → ∃ b : α → ℝ, Integrable b μ ∧ ∀ᵐ t ∂μ, ∀ ν : ℝ, |ν| ≤ L → ‖J n ν t‖ ≤ b t`. -/ -noncomputable def ChainDominated (J : ℕ → ℝ → α → ℝ) (μ : Measure α) : Prop := +@[expose] noncomputable def ChainDominated (J : ℕ → ℝ → α → ℝ) (μ : Measure α) : Prop := ∀ n L, 0 < L → ∃ b : α → ℝ, Integrable b μ ∧ ∀ᵐ t ∂μ, ∀ ν : ℝ, |ν| ≤ L → ‖J n ν t‖ ≤ b t @@ -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..f5b35f6a34 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 @@ -36,6 +36,7 @@ abbrev Coeff := TerminalCompensation.Coeff /-- Parameter domain, given by `Ioo (-(3 / 2 : ℝ)) (3 / 2)`. -/ def parameterDomain : Set ℝ := Ioo (-(3 / 2 : ℝ)) (3 / 2) /-- Domain, given by `Ioi 0 ×ˢ parameterDomain`. -/ +@[expose] def domain : Set (ℝ × ℝ) := Ioi 0 ×ˢ parameterDomain theorem parameterDomain_open : IsOpen parameterDomain := isOpen_Ioo @@ -172,6 +173,7 @@ theorem parameter_correction_contDiffOn (x : ℝ) : (contDiffOn_id.prodMk contDiffOn_const) (fun _ heta => ⟨heta, mem_univ _⟩)) /-- Restriction of the constructed branch, rather than a new existential solve. -/ +@[expose] noncomputable def physical : HeatedOutgoing.CompensationWitness F XR C where radius_pos := w.radius_pos switch_large := w.switch_large @@ -205,7 +207,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 +253,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 +474,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 +493,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 @@ -719,7 +721,7 @@ theorem ScheduleBounds.physicalBand_subset {F : Profile} (b : ScheduleBounds F) /-- Amplitude bound, given by `128 * CorrectedPulseAmplitude.combinedConstant F.data.core.P F.data.core.m F.coefficientBound`. -/ -noncomputable def amplitudeBound (F : Profile) : ℝ := +@[expose] noncomputable def amplitudeBound (F : Profile) : ℝ := 128 * CorrectedPulseAmplitude.combinedConstant F.data.core.P F.data.core.m F.coefficientBound theorem ScheduleBounds.amplitudeBound_pos {F : Profile} (b : ScheduleBounds F) : diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/FinalSlowBase.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/FinalSlowBase.lean index 40002a5983..32552476aa 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 @@ -586,29 +586,33 @@ section Geometry variable {F : OutgoingProfile.Profile} (W : NominalProfile.Witness F) /-- Edge exponent, given by `W.controls.activationTime ^ 2`. -/ +@[expose] 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`. -/ +@[expose] 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)`. -/ +@[expose] noncomputable def boxRadius (upper : ℝ) : ℝ := max upper (NominalConeAssembly.activeRight W) theorem terminal_pos : 0 < NominalConeAssembly.activeRight W := @@ -667,6 +671,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 +691,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 +804,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,33 +858,37 @@ 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 W.axis.normalization (coefficients H v)`. -/ +@[expose] noncomputable def vectorPotential (upper : ℝ) (B : ℕ) : ProblemStatement.VelocityField := ConstructedSlowBase.potential (scales H v upper B) F.data.h W.axis.normalization (coefficients H v) /-- Stress force, given by `BaseResidual.baseStressForce (scales H v upper B) F.data.h W.axis.normalization (coefficients H v)`. -/ +@[expose] noncomputable def stressForce (upper : ℝ) (B : ℕ) : ProblemStatement.SpaceTime → ProblemStatement.Space := BaseResidual.baseStressForce (scales H v upper B) F.data.h W.axis.normalization (coefficients H v) /-- Error, given by `BaseResidual.baseResidual (scales H v upper B) F.data.h W.axis.normalization (coefficients H v)`. -/ +@[expose] noncomputable def error (upper : ℝ) (B : ℕ) : ProblemStatement.SpaceTime → ProblemStatement.Space := BaseResidual.baseResidual (scales H v upper B) F.data.h W.axis.normalization (coefficients H v) /-- Normalized stress, given by `BaseResidual.normalizedTensor (scales H v upper B) F.data.h (coefficients H v)`. -/ +@[expose] noncomputable def normalizedStress (upper : ℝ) (B : ℕ) : Chart → Inner := BaseResidual.normalizedTensor (scales H v upper B) F.data.h (coefficients H v) 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..3c08c7e027 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 @@ -46,6 +46,7 @@ noncomputable def axialHistory {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) (n : SlowResidualMatching.toRadius ((asSlowProfiles s).axial n) /-- The actual angular velocity coefficients in signed radius. -/ +@[expose] noncomputable def angularHistory {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) (n : ℕ) : Field := SlowResidualMatching.swirlRadius C ((asSlowProfiles s).phi n) @@ -533,7 +534,7 @@ end end -@[expose] public section +public section noncomputable section @@ -984,6 +985,7 @@ noncomputable def terminalAmplitude {F : OutgoingProfile.Profile} (W : NominalPr TerminalHistoryBridge.normalization F W.controls.radius /-- Terminal shift, given by `TerminalHistoryBridge.shift F W.controls.radius`. -/ +@[expose] noncomputable def terminalShift {F : OutgoingProfile.Profile} (W : NominalProfile.Witness F) : ℝ := TerminalHistoryBridge.shift F W.controls.radius 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..9d1b912d58 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 @@ -112,17 +112,19 @@ def angularDebt (C : ℝ) (d : Debt) : Fin 3 → ℝ := ![0, -(d 0) / (2 * C), d def axialDebt (C : ℝ) (d : Debt) : Fin 2 → ℝ := ![0, -(d 1) / C] /-- The angular increment `∆v_m`, constructed from three separated smooth bumps. -/ +@[expose] def deltaV (lam C a b : ℝ) (d : Debt) : ℝ → ℝ := LocalizedMomentRepair.repair (angularPowers lam) (cellLower a b) (cellUpper a b) (angularDebt C d) /-- The desired axial increment `γ_d`, constructed from two separated smooth bumps. -/ +@[expose] def gamma (lam C a b : ℝ) (d : Debt) : ℝ → ℝ := LocalizedMomentRepair.repair (axialPowers lam) (cellLower a b) (cellUpper a b) (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 _ _ _ _ @@ -255,7 +257,7 @@ theorem axial_row (lam C a b : ℝ) (d : Debt) (hlam : 0 < lam) (hC : C ≠ 0) field_simp /-- The five linear equations (35), retaining the general background fields. -/ -def FiveRows (V G : ℝ → ℝ) (d : Debt) (dv ga : ℝ → ℝ) : Prop := +@[expose] def FiveRows (V G : ℝ → ℝ) (d : Debt) (dv ga : ℝ → ℝ) : Prop := (∫ R, R ^ (2 : ℕ) * dv R) = 0 ∧ (∫ R, R * ga R) = 0 ∧ (∫ R, (2 * V R / R) * dv R) = -(d 0) ∧ @@ -374,10 +376,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..eaac9a0f8a 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 @@ -225,6 +225,7 @@ theorem future_square_integral_le (d : TailData) {y eta : ℝ} ring /-- The canonical pressure from the actual future of the clean outgoing field. -/ +@[expose] noncomputable def Pi (d : TailData) (y eta : ℝ) : ℝ := -(1 / 2 : ℝ) * ∫ t in Ioi y, finalAngular d (t, eta) ^ 2 diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/GaugeAliasDecay.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/GaugeAliasDecay.lean index 6326966428..55b3c38c75 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 @@ -36,7 +36,7 @@ section FiberInverse variable {S : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] [FiniteDimensional ℝ S] /-- Fiber shell, given by `{z | z.1 ∈ Icc a b ∧ z.2.1 = s}`. -/ -noncomputable def fiberShell (a b : ℝ) (s : S) : Set (Point S) := +@[expose] noncomputable def fiberShell (a b : ℝ) (s : S) : Set (Point S) := {z | z.1 ∈ Icc a b ∧ z.2.1 = s} /-- The torus inverse estimate uses only jets on the designated slow fiber. -/ 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..06c0ffe9e3 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 @@ -153,6 +153,7 @@ theorem radialMoment_zero_of_torusAverage (k : ℕ) (f : ScalarField Point) simp_rw [he, mul_zero, integral_zero] /-- The two conserved mean masses, restricted to a specified slow set. -/ +@[expose] noncomputable def ZeroMassesOn (U : Set Plane) (u : State Point) : Prop := ∀ n s, s ∈ U → CorrectionState.radialMoment 2 u.mean.angular n s = 0 ∧ CorrectionState.radialMoment 1 u.mean.axial n s = 0 diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/GaugeMomentBalances.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/GaugeMomentBalances.lean index e661959cf3..2f71f92035 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 @@ -372,15 +372,16 @@ end AuxiliaryAverage /-! ## Explicit graph operators acting on the actual torus means -/ /-- Averaged, defined pointwise by `PressureStream.torusAverage (f n)`. -/ +@[expose] 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 @@ -575,6 +576,7 @@ theorem averaged_fluxResidual {a b : ℝ} (ha : 0 < a) exact hh /-- Angular balance along as an element of `ℝ`. -/ +@[expose] noncomputable def angularBalanceAlong (ε : ℝ) (z t : S) (u R Z T : ℝ × S → ℝ) (x : ℝ × S) : ℝ := -ε * IntegratedMeanBalances.parameterPartial t u x + @@ -586,6 +588,7 @@ noncomputable def angularBalanceAlong (ε : ℝ) (z t : S) (u R Z T : ℝ × S IntegratedMeanBalances.radialDivergence 2 (fun q => T (q, x.2)) x.1 /-- Axial balance along as an element of `ℝ`. -/ +@[expose] noncomputable def axialBalanceAlong (ε : ℝ) (z t : S) (u R Z T : ℝ × S → ℝ) (x : ℝ × S) : ℝ := -ε * IntegratedMeanBalances.parameterPartial t u x + @@ -741,24 +744,28 @@ end MomentIntegration /-- Theta radial flux, given by `MeanIncrementBounds.thetaRadial c.base u.mean + u.covariance 0 1`. -/ +@[expose] noncomputable def thetaRadialFlux (c : Context (Lift S)) (u : State (Lift S)) : ScalarField (Lift S) := MeanIncrementBounds.thetaRadial c.base u.mean + u.covariance 0 1 /-- Theta axial flux, given by `MeanIncrementBounds.thetaAxial c.base u.mean + u.covariance 2 1`. -/ +@[expose] noncomputable def thetaAxialFlux (c : Context (Lift S)) (u : State (Lift S)) : ScalarField (Lift S) := MeanIncrementBounds.thetaAxial c.base u.mean + u.covariance 2 1 /-- Axial radial flux, given by `MeanIncrementBounds.axialRadial c.base u.mean + u.covariance 0 2`. -/ +@[expose] noncomputable def axialRadialFlux (c : Context (Lift S)) (u : State (Lift S)) : ScalarField (Lift S) := MeanIncrementBounds.axialRadial c.base u.mean + u.covariance 0 2 /-- Axial axial flux, given by `MeanIncrementBounds.axialAxial c.base u.mean + u.covariance 2 2`. -/ +@[expose] noncomputable def axialAxialFlux (c : Context (Lift S)) (u : State (Lift S)) : ScalarField (Lift S) := MeanIncrementBounds.axialAxial c.base u.mean + u.covariance 2 2 @@ -1097,7 +1104,7 @@ theorem slowClass_globalBandJets {ε slow : ℕ → ℝ} /-- Slow projection, given by `(ContinuousLinearMap.fst ℝ S PressureStream.Plane).comp (ContinuousLinearMap.snd ℝ ℝ (S × PressureStream.Plane))`. -/ -noncomputable def slowProjection : Lift S →L[ℝ] S := +@[expose] noncomputable def slowProjection : Lift S →L[ℝ] S := (ContinuousLinearMap.fst ℝ S PressureStream.Plane).comp (ContinuousLinearMap.snd ℝ ℝ (S × PressureStream.Plane)) @@ -1211,7 +1218,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1412,7 +1419,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 +1724,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..bf64fa6dcb 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 @@ -80,6 +80,7 @@ theorem dr (H : RadialMatch U g o) (f : Scalar) (n : ℕ) {x : Point} (hx : x.2. end RadialMatch /-- The literal radial component after removing the current pressure alias. -/ +@[expose] noncomputable def radialMinusAlias (g : VariableGaugeMean.GaugeData Plane) (c : Context Point) (u : State Point) : Scalar := fun n x => u.radialResidual c n x - VariableGaugeMean.pressureAliasState g c u n (x, 0) 0 diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/GaugeStateCoherence.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/GaugeStateCoherence.lean index c5179cfb37..639863f925 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 @@ -35,6 +35,7 @@ variable {S T : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] [NormedAddCommGroup T] [NormedSpace ℝ T] /-- The actual invertible map on the universal cover. -/ +@[expose] noncomputable def chartEquiv (l : ℝ) (hl : l ≠ 0) (P : S ≃L[ℝ] T) (k : ℕ) : PressureStream.Lift S ≃L[ℝ] PressureStream.Lift T := (PhysicalResidualNaturality.scalarEquiv ℝ l hl).prodCongr @@ -354,17 +355,18 @@ 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. -/ +@[expose] noncomputable def bandSlowEquiv (h : ℝ) (n m : ℕ) : Plane ≃L[ℝ] Plane := (PhysicalResidualNaturality.scalarEquiv ℝ (ChartScales.Q n / ChartScales.Q m) (div_pos (ChartScales.Q_pos n) (ChartScales.Q_pos m)).ne').prodCongr @@ -379,6 +381,7 @@ noncomputable def bandSlowEquiv (h : ℝ) (n m : ℕ) : Plane ≃L[ℝ] Plane := /-- Band chart equiv, given by `chartEquiv (bandScale n m) (bandScale_pos n m).ne' (bandSlowEquiv h n m) k`. -/ +@[expose] noncomputable def bandChartEquiv (h : ℝ) (n m k : ℕ) : PressureStream.Lift Plane ≃L[ℝ] PressureStream.Lift Plane := chartEquiv (bandScale n m) (bandScale_pos n m).ne' (bandSlowEquiv h n m) k 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..663280b772 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 @@ -40,6 +40,7 @@ noncomputable def profileBump : ContDiffBump (1 / 2 : ℝ) where rIn_lt_rOut := by norm_num /-- Profile, given by `profileBump`. -/ +@[expose] noncomputable def profile : ℝ → ℝ := profileBump theorem profile_contDiff : ContDiff ℝ ∞ profile := profileBump.contDiff @@ -97,7 +98,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 +398,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 +516,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 +741,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 +763,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 +970,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..2223a9d281 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 @@ -742,6 +742,7 @@ theorem future_uniqueDiff : UniqueDiffOn ℝ futureDomain := (uniqueDiffOn_Ici 0).prod uniqueDiffOn_univ /-- The physical full spacetime jet, including its one-sided value at time zero. -/ +@[expose] noncomputable def futureJet (f : VelocityField) (m : ℕ) := iteratedFDerivWithin ℝ m f futureDomain @@ -946,7 +947,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 +1101,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1113,6 +1114,7 @@ open scoped Topology ContDiff /-- A property of the actual primitive field on a local physical domain. The zero neighborhood may depend on the point and on the stage. -/ +@[expose] def AxisZeroOn (Ω : Set SpaceTime) (f : VelocityField) : Prop := ∀ w ∈ Ω, PhysicalGraphBounds.radialProjection w = 0 → f =ᶠ[𝓝 w] fun _ => 0 @@ -1141,6 +1143,7 @@ theorem angularSupport_axisZeroOn {h qbig : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) (MixedAxisPreservation.radius_zero_of_axis ha) /-- The base and finite initialization retain the same zeroth cutoff. -/ +@[expose] noncomputable def initializedSeries (base initial : VelocityField) (stages : ℕ → VelocityField) : ℕ → VelocityField | 0 => fun w => base w + initial w @@ -1194,6 +1197,7 @@ variable {F : OutgoingProfile.Profile} {W : NominalProfile.Witness F} /-- Potential stages, given by `initializedSeries (TailGaugePotential.finalPotential H v upper bandFloor) initial stages`. -/ +@[expose] noncomputable def potentialStages (upper : ℝ) (bandFloor : ℕ) (initial : VelocityField) (stages : ℕ → VelocityField) : ℕ → VelocityField := initializedSeries (TailGaugePotential.finalPotential H v upper bandFloor) initial stages diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/GlobalSlowProfiles.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/GlobalSlowProfiles.lean index cbb26b2494..2e4218b757 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 @@ -43,6 +43,7 @@ abbrev Smooth (S : Set ℝ) (f : Field) := ContDiffOn ℝ ∞ f (region S) /-- Dr, given by `ProfileHistories.radialPartial`. -/ noncomputable def dr := ProfileHistories.radialPartial /-- De, given by `ProfileHistories.parameterPartial`. -/ +@[expose] noncomputable def de := ProfileHistories.parameterPartial /-- Regular data, collecting `smooth`, `even`. -/ @@ -69,6 +70,7 @@ theorem Regular.mul {S : Set ℝ} {f g : Field} (hf : Regular S f) (hg : Regular /-- Regular algebra, bundling `carrier`, `zero_mem`, `one_mem`, `add_mem` and the required compatibility proofs. -/ +@[expose] noncomputable def regularAlgebra (S : Set ℝ) : Subalgebra ℝ Field where carrier := {f | Regular S f} zero_mem' := by exact Regular.const S 0 @@ -112,6 +114,7 @@ theorem slice_smooth {S : Set ℝ} {f : Field} (hf : Smooth S f) | @insert a s ha ih => simp only [Finset.sum_insert ha, add_apply, ih] /-- Bound constant, given by `algebraMap ℝ (EvenProfile S) c`. -/ +@[expose] noncomputable def boundConstant (S : Set ℝ) (c : ℝ) : EvenProfile S := algebraMap ℝ (EvenProfile S) c @@ -124,11 +127,13 @@ noncomputable def radiusSquared (S : Set ℝ) : EvenProfile S := fun _ _ _ => by simp only [neg_sq]⟩⟩ /-- Parameter, given by `⟨Prod.snd, ⟨contDiffOn_snd, fun _ _ _ => rfl⟩⟩`. -/ +@[expose] noncomputable def parameter (S : Set ℝ) : EvenProfile S := ⟨Prod.snd, ⟨contDiffOn_snd, fun _ _ _ => rfl⟩⟩ /-- Inverse, given by `⟨fun w => (f w)⁻¹, ⟨f.smooth.inv hf, fun _ heta R => congrArg Inv.inv (f.even heta R)⟩⟩`. -/ +@[expose] noncomputable def inverse {S : Set ℝ} (f : EvenProfile S) (hf : ∀ w ∈ region S, f w ≠ 0) : EvenProfile S := ⟨fun w => (f w)⁻¹, ⟨f.smooth.inv hf, fun _ heta R => congrArg Inv.inv (f.even heta R)⟩⟩ @@ -144,6 +149,7 @@ theorem parameter_derivative {S : Set ℝ} (hS : IsOpen S) {f : Field} (hf : Smo hf (p := (R, eta)) ⟨mem_univ _, heta⟩ /-- Eta derivative as an element of `EvenProfile S`. -/ +@[expose] noncomputable def etaDerivative {S : Set ℝ} (hS : IsOpen S) (f : EvenProfile S) : EvenProfile S := by refine ⟨de f, ⟨smooth_de hS f.smooth, ?_⟩⟩ @@ -191,6 +197,7 @@ theorem coreCutoff_zero {inner stop : ℝ} (his : inner < stop) {w : ℝ × ℝ} simp [coreCutoff, TransportPrimitive.cutoff_one his hw] /-- A normalized mass average. There is no division by the radius. -/ +@[expose] noncomputable def massAverage {S : Set ℝ} (hS : IsOpen S) (f : EvenProfile S) : EvenProfile S := by refine ⟨fun w => 2 * ∫ t in (0 : ℝ)..1, t * f (t * w.1, w.2), ⟨?_, ?_⟩⟩ @@ -236,6 +243,7 @@ structure Domain (S : Set ℝ) (h : ℝ) : Prop where /-- Inverse denominator, given by `inverse (1 - boundConstant S (2 * h) * parameter S ^ 2) (fun w hw => d.denominator w.2 hw.2)`. -/ +@[expose] noncomputable def inverseDenominator {S : Set ℝ} {h : ℝ} (d : Domain S h) : EvenProfile S := inverse (1 - boundConstant S (2 * h) * parameter S ^ 2) (fun w hw => d.denominator w.2 hw.2) @@ -244,6 +252,7 @@ noncomputable def inverseDenominator {S : Set ℝ} {h : ℝ} (d : Domain S h) : (w : ℝ × ℝ) : inverseDenominator d w = (PositiveAxisSystem.ell h w.2)⁻¹ := rfl /-- The normalized divergence reconstruction `V = X β`. -/ +@[expose] noncomputable def betaFromU {S : Set ℝ} {h : ℝ} (d : Domain S h) (lam : ℝ) (u : EvenProfile S) : EvenProfile S := (boundConstant S 2 * parameter S * u - @@ -295,6 +304,7 @@ noncomputable def axialOp2 {S : Set ℝ} {h : ℝ} (d : Domain S h) /-- Shifted axial as an element of `ℕ → EvenProfile S | 0 => 0 | k + 1 => axialOp2 d (AxisSourceRegularity.slowOrder h k - 1) (beta k)`. -/ +@[expose] noncomputable def shiftedAxial {S : Set ℝ} {h : ℝ} (d : Domain S h) (beta : ℕ → EvenProfile S) : ℕ → EvenProfile S | 0 => 0 @@ -319,6 +329,7 @@ noncomputable def previousOmegaDivX {S : Set ℝ} {h : ℝ} (d : Domain S h) | k + 1 => omegaDivX d u beta k /-- Angular field, given by `w.1 / C * phi w`. -/ +@[expose] noncomputable def angularField {S : Set ℝ} (C : ℝ) (phi : EvenProfile S) (w : ℝ × ℝ) : ℝ := w.1 / C * phi w @@ -333,6 +344,7 @@ noncomputable def pressureSource {S : Set ℝ} (C : ℝ) (phi : ℕ → EvenProf boundConstant S (1 / 2) * omega /-- Pressure from source, given by `radiusSquared S * massAverage hS source`. -/ +@[expose] noncomputable def pressureFromSource {S : Set ℝ} (hS : IsOpen S) (source : EvenProfile S) : EvenProfile S := radiusSquared S * massAverage hS source @@ -453,6 +465,7 @@ theorem patch_zero {a b : ℝ} {f : Field} (hs : PatchSupport a b f) exact hR (hs eta (subset_closure hn)) /-- Even correction as an element of `EvenProfile S`. -/ +@[expose] noncomputable def evenCorrection {S : Set ℝ} {f : Field} (hf : Smooth S f) : EvenProfile S := ⟨fun w => f w + f (-w.1, w.2), ⟨hf.add (hf.comp (contDiffOn_fst.neg.prodMk contDiffOn_snd) (fun w hw => ⟨mem_univ _, hw.2⟩)), @@ -981,10 +994,12 @@ noncomputable def recursionStep {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) : /-- A single coherent infinite sequence, constructed by well-founded recursion; all coefficient indices used in the radial source are smaller. -/ +@[expose] noncomputable def sequence {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) (n : ℕ) : Admissible s n := Nat.lt_wfRel.wf.fix (recursionStep s) n /-- Profiles, given by `(sequence s n).data`. -/ +@[expose] noncomputable def profiles {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) (n : ℕ) : Coefficient S := (sequence s n).data @@ -1180,6 +1195,7 @@ structure BaseData (S : Set ℝ) (C lam a b B : ℝ) where /-- The common cutoff is chosen strictly inside the hierarchy's proved radius; the moment patch begins beyond that cutoff. -/ +@[expose] noncomputable def schemeFromHierarchy {rho : ℝ} {U : Set ℂ} {S : Set ℝ} {h C lam inner stop a b B : ℝ} {base : Fin 5 → SimilarityProfile.InnerProfile} (A : SlowRecursion.LocalHierarchy rho U h C base) @@ -1222,6 +1238,7 @@ noncomputable def schemeFromHierarchy {rho : ℝ} {U : Set ℂ} {S : Set ℝ} /-- The actual squared-radius profile. We use ordinary derivatives only at positive X; the axis jets are the right jets of this descent. -/ +@[expose] noncomputable def xProfile {S : Set ℝ} (f : EvenProfile S) (w : ℝ × ℝ) : ℝ := f (Real.sqrt (2 * w.1), w.2) @@ -1880,7 +1897,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) @@ -1929,6 +1946,7 @@ theorem profiles_pressureCoefficient {S : Set ℝ} {h C : ℝ} (s : Scheme S h C ring /-- Component, given by `![q.phi, q.axial, q.beta, q.pressure] i`. -/ +@[expose] noncomputable def component {S : Set ℝ} (q : Coefficient S) (i : Fin 4) : EvenProfile S := ![q.phi, q.axial, q.beta, q.pressure] i diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/GluedStageEstimates.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/GluedStageEstimates.lean index b6f01b0551..abe8bc573b 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 @@ -117,6 +117,7 @@ variable {B N0 : ℕ} abbrev Label := ActualParticularStageControls.Label /-- The potential of the actual current common coefficient. -/ +@[expose] noncomputable def potential (x : CorrectionStep.CycleState (Label B N0)) (l : Label B N0) (j : ℤ) (n : ℕ) : WaveSpace → ComplexVector := (ActualReferenceRebase.actualCoefficients x l j).curlPotential @@ -125,6 +126,7 @@ noncomputable def potential (x : CorrectionStep.CycleState (Label B N0)) /-- The complete harmonic pressure, with the actual current common pressure coefficient and the same carrier. -/ +@[expose] noncomputable def pressureMode (x : CorrectionStep.CycleState (Label B N0)) (l : Label B N0) (j : ℤ) (n : ℕ) : WaveSpace → ℂ := mode ((ActualReferenceRebase.actualCoefficients x l j).frequency n) @@ -337,7 +339,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 +406,7 @@ end end -@[expose] public section +public section noncomputable section @@ -417,22 +419,26 @@ open scoped Topology ContDiff BigOperators variable {B N0 : ℕ} /-- The actual finite current-band potential, in the initializer's label order. -/ +@[expose] noncomputable def localPotential (x : CorrectionStep.CycleState (ActualInitialization.Index B N0)) (n : ℕ) : VelocityField := ActualCurrentParticularPhysical.localPotential (ActualCycleParameters.particularState x) n /-- Local pressure, given by `ActualCurrentParticularPhysical.localPressure (ActualCycleParameters.particularState x) n`. -/ +@[expose] noncomputable def localPressure (x : CorrectionStep.CycleState (ActualInitialization.Index B N0)) (n : ℕ) : PressureField := ActualCurrentParticularPhysical.localPressure (ActualCycleParameters.particularState x) n /-- One representative of the actual current-band potential formulas. -/ +@[expose] noncomputable def potential (x : CorrectionStep.CycleState (ActualInitialization.Index B N0)) (N : ℕ) : VelocityField := ValidDyadicBandCover.field h N (localPotential x) /-- Pressure, given by `ValidDyadicBandCover.field h N (localPressure x)`. -/ +@[expose] noncomputable def pressure (x : CorrectionStep.CycleState (ActualInitialization.Index B N0)) (N : ℕ) : PressureField := ValidDyadicBandCover.field h N (localPressure x) @@ -785,7 +791,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 +1221,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1271,6 +1277,7 @@ noncomputable def signedMeanPressure (j : ℕ) : PressureField := fun w => (ActualStageEstimates.pressureInput R M hN j).family.field w /-- Direct, given by `(ActualStageEstimates.angularInput R M hN j).family.angularField`. -/ +@[expose] noncomputable def direct (j : ℕ) : VelocityField := (ActualStageEstimates.angularInput R M hN j).family.angularField @@ -1422,6 +1429,7 @@ variable {B N0 N : ℕ} {D DA0 DP0 : Type} /-- The four literal contributions use the same order as the physical sequence construction. -/ +@[expose] noncomputable def potential (j : ℕ) : VelocityField := fun w => particularA j w + (W.potential j).vector w + (ActualStageEstimates.temporalInput R M hN j).family.angularField w + @@ -1429,6 +1437,7 @@ noncomputable def potential (j : ℕ) : VelocityField := fun w => /-- Pressure, defined pointwise by `particularP j w + (W.pressure j).pressure w + (ActualStageEstimates.pressureInput R M hN j).family.field w`. -/ +@[expose] noncomputable def pressure (j : ℕ) : PressureField := fun w => particularP j w + (W.pressure j).pressure w + (ActualStageEstimates.pressureInput R M hN j).family.field w @@ -1667,11 +1676,13 @@ end MixedSequence /-- Current potential, given by `ActualValidBandWaves.gluedPotential (ActualCyclePreservation.state B N0 j) N`. -/ +@[expose] noncomputable def currentPotential (B N0 N : ℕ) (j : ℕ) : VelocityField := ActualValidBandWaves.gluedPotential (ActualCyclePreservation.state B N0 j) N /-- Current pressure, given by `ActualValidBandWaves.gluedPressure (ActualCyclePreservation.state B N0 j) N`. -/ +@[expose] noncomputable def currentPressure (B N0 N : ℕ) (j : ℕ) : PressureField := ActualValidBandWaves.gluedPressure (ActualCyclePreservation.state B N0 j) N 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..d2c5e26eff 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 @@ -79,6 +79,7 @@ theorem character_continuous (j : ℤ) : Continuous (character j) := by exact ((continuous_const.mul Complex.continuous_ofReal).mul continuous_const).cexp /-- Character hom, bundling `toFun`, `map_one`, `map_mul`. -/ +@[expose] noncomputable def characterHom (φ : ℝ) : Multiplicative ℤ →* ℂ where toFun j := character (Multiplicative.toAdd j) φ map_one' := character_zero φ @@ -86,16 +87,17 @@ noncomputable def characterHom (φ : ℝ) : Multiplicative ℤ →* ℂ where /-- Evaluate hom, given by `AddMonoidAlgebra.liftNCRingHom (Pi.evalRingHom (fun _ : α => ℂ) x) (characterHom φ) (fun _ _ => Commute.all _ _)`. -/ +@[expose] noncomputable def evaluateHom {α : Type*} (x : α) (φ : ℝ) : Coefficients α →+* ℂ := AddMonoidAlgebra.liftNCRingHom (Pi.evalRingHom (fun _ : α => ℂ) x) (characterHom φ) (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 +124,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 +144,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 +222,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 : α) : @@ -270,12 +272,13 @@ theorem angularMean_product {α : Type*} (c d : Coefficients α) (k : ℝ) (Φ : simp only [zero_sub] /-- Conjugate reverse, constructed using `AddMonoidAlgebra.ofCoeff`. -/ +@[expose] noncomputable def conjugateReverse {α : Type*} (c : Coefficients α) : Coefficients α := AddMonoidAlgebra.ofCoeff <| Finsupp.equivMapDomain (Equiv.neg ℤ) (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 @@ -285,6 +288,7 @@ theorem evaluate_conjugateReverse {α : Type*} (c : Coefficients α) (x : α) ( simp only [Equiv.neg_apply, Finsupp.sum, map_sum, map_mul, character_neg] /-- Conjugate symmetric, given by `∀ j x, c (-j) x = conj (c j x)`. -/ +@[expose] def ConjugateSymmetric {α : Type*} (c : Coefficients α) : Prop := ∀ j x, c (-j) x = conj (c j x) @@ -353,7 +357,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 +386,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 +494,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 @@ -501,6 +505,7 @@ theorem derivativeCoefficient_zero (V : E → E) (k : ℝ) (Φ : E → ℝ) (j : simp [derivativeCoefficient, HarmonicCalculus.along] /-- Differentiate, constructed using `AddMonoidAlgebra.ofCoeff`. -/ +@[expose] noncomputable def differentiate (V : E → E) (k : ℝ) (Φ : E → ℝ) (c : Coefficients E) : Coefficients E := AddMonoidAlgebra.ofCoeff <| Finsupp.onFinset c.support (fun j => derivativeCoefficient V k Φ j (c @@ -513,7 +518,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 @@ -663,6 +668,7 @@ theorem character_hasDerivAt (j : ℤ) (θ : ℝ) : ring /-- Angular differentiate, constructed using `AddMonoidAlgebra.ofCoeff`. -/ +@[expose] noncomputable def angularDifferentiate {α : Type*} (kp : ℤ) (c : Coefficients α) : Coefficients α := AddMonoidAlgebra.ofCoeff <| Finsupp.onFinset c.support (fun j x => (((j * kp : ℤ) : ℂ) * @@ -676,7 +682,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..6e106b77d6 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,18 +36,20 @@ 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)`. -/ +@[expose] noncomputable def angularDirection (_p : D × ℝ) : D × ℝ := (0, 1) /-- Smoothness is required of actual coefficient functions. -/ +@[expose] def SmoothCoefficients (U : Set D) (c : Coefficients D) : Prop := ∀ j : ℤ, ContDiffOn ℝ ∞ (c j) U @@ -103,11 +105,15 @@ omit [NormedAddCommGroup D] [NormedSpace ℝ D] in omit [NormedAddCommGroup D] [NormedSpace ℝ D] in @[simp] theorem field_neg (c : Coefficients D) (k : ℝ) (Φ : D → ℝ) (kp : ℤ) (p : D × ℝ) : - field (-c) k Φ kp p = -field c k Φ kp p := (evaluateHom p.1 _).map_neg c + field (-c) k Φ kp p = -field c k Φ kp p := by + simpa only [field, evaluate_eq_hom] using + (evaluateHom p.1 (k * Φ p.1 + (kp : ℝ) * p.2)).map_neg c omit [NormedAddCommGroup D] [NormedSpace ℝ D] in @[simp] theorem field_sub (c d : Coefficients D) (k : ℝ) (Φ : D → ℝ) (kp : ℤ) (p : D × ℝ) : - field (c - d) k Φ kp p = field c k Φ kp p - field d k Φ kp p := (evaluateHom p.1 _).map_sub c d + field (c - d) k Φ kp p = field c k Φ kp p - field d k Φ kp p := by + simpa only [field, evaluate_eq_hom] using + (evaluateHom p.1 (k * Φ p.1 + (kp : ℝ) * p.2)).map_sub c d omit [NormedAddCommGroup D] [NormedSpace ℝ D] in @[simp] theorem field_constant (f : D → ℂ) (k : ℝ) (Φ : D → ℝ) (kp : ℤ) (p : D × ℝ) : @@ -188,10 +194,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 +209,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 +218,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 +227,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 +235,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 +250,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 @@ -485,6 +492,7 @@ theorem band_conjugateReverse {c : Coefficients D} {N : ℕ} (hc : BandLimited c simpa only [Int.natAbs_neg] using hc (-j) hj' /-- Canonical real projection, with exactly the conjugate negative harmonics. -/ +@[expose] noncomputable def realCoefficients (c : Coefficients D) : Coefficients D := constantCoefficient (fun _ : D => (2 : ℂ)⁻¹) * (c + conjugateReverse c) @@ -534,7 +542,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 +566,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 +733,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 +998,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 @@ -1038,18 +1046,22 @@ structure LabelData (D : Type) where aliasError : VectorCoefficients D /-- Wave, given by `vectorField d.velocity d.frequency d.phase d.angularFrequency`. -/ +@[expose] noncomputable def LabelData.wave (d : LabelData D) : D × ℝ → ComplexVector := vectorField d.velocity d.frequency d.phase d.angularFrequency /-- Pressure field, given by `field d.pressure d.frequency d.phase d.angularFrequency`. -/ +@[expose] noncomputable def LabelData.pressureField (d : LabelData D) : D × ℝ → ℂ := field d.pressure d.frequency d.phase d.angularFrequency /-- Gaussian field, given by `vectorField d.gaussian d.frequency d.phase d.angularFrequency`. -/ +@[expose] noncomputable def LabelData.gaussianField (d : LabelData D) : D × ℝ → ComplexVector := vectorField d.gaussian d.frequency d.phase d.angularFrequency /-- Alias field, given by `vectorField d.aliasError d.frequency d.phase d.angularFrequency`. -/ +@[expose] noncomputable def LabelData.aliasField (d : LabelData D) : D × ℝ → ComplexVector := vectorField d.aliasError d.frequency d.phase d.angularFrequency @@ -1066,19 +1078,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 +1277,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 +1312,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) : ℝ := @@ -1341,8 +1354,9 @@ theorem goodResidual_angularMean {ι : Type*} (labels : Finset ι) (data : ι /-- Good wave residual, given by `goodResidual labels data g B M p virtual x i - realAngularMean (fun θ => goodResidual labels data g B M p virtual (x.1, θ) i)`. -/ -noncomputable def goodWaveResidual {ι : Type*} (labels : Finset ι) (data : ι → LabelData D) - (g : Frame D) (B M : D → ComplexVector) (p : D → ℂ) (virtual : D → Fin 3 → ℝ) +@[expose] noncomputable def goodWaveResidual {ι : Type*} (labels : Finset ι) + (data : ι → LabelData D) (g : Frame D) (B M : D → ComplexVector) (p : D → ℂ) + (virtual : D → Fin 3 → ℝ) (x : D × ℝ) (i : Fin 3) : ℝ := goodResidual labels data g B M p virtual x i - realAngularMean (fun θ => goodResidual labels data g B M p virtual (x.1, θ) i) @@ -1372,7 +1386,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,15 +1397,18 @@ 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 : ℂ)] /-- State perturbation as an element of `ComplexVector`. -/ +@[expose] noncomputable def statePerturbation (s : CorrectionState.State D) (n : ℕ) (x : D × ℝ) : ComplexVector := ![(s.mean.radial n x.1 + s.oscillation n x 0 : ℝ), @@ -1399,15 +1416,18 @@ noncomputable def statePerturbation (s : CorrectionState.State D) (n : ℕ) (x : (s.mean.axial n x.1 + s.oscillation n x 2 : ℝ)] /-- State pressure, given by `(s.totalPressureIncrement n x : ℝ)`. -/ +@[expose] noncomputable def statePressure (s : CorrectionState.State D) (n : ℕ) (x : D × ℝ) : ℂ := (s.totalPressureIncrement n x : ℝ) /-- Context virtual, given by `![0, -(c.operators.radialDiv 2 c.virtualTheta n x), -(c.operators.radialDiv 1 c.virtualAxial n x)]`. -/ +@[expose] noncomputable def contextVirtual (c : CorrectionState.Context D) (n : ℕ) (x : D) : Fin 3 → ℝ := ![0, -(c.operators.radialDiv 2 c.virtualTheta n x), -(c.operators.radialDiv 1 c.virtualAxial n x)] /-- The same full normalized differential field used by the correction cycle. -/ +@[expose] noncomputable def stateFullResidual (c : CorrectionState.Context D) (s : CorrectionState.State D) (n : ℕ) (x : D × ℝ) (i : Fin 3) : ℝ := (Actual.nonlinearResidual (contextFrame c n).viscosity (fun y => (contextFrame c n).radius y.1) @@ -1417,11 +1437,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 +1455,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 +1556,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 @@ -1600,6 +1623,7 @@ theorem stateGoodWaveResidual_grouped {ι : Type*} {U : Set D} (hU : IsOpen U) h.angular_nonzero hx i /-- State mean coefficient value, constructed using `meanResidualValue`. -/ +@[expose] noncomputable def stateMeanCoefficientValue {ι : Type*} (labels : ℕ → Finset ι) (blocks : ι → CorrectionState.HarmonicBlock D) (gaussian aliasError : ι → BlockCoefficients D) (c : CorrectionState.Context D) (s : CorrectionState.State D) (n : ℕ) (x : D) (i : Fin 3) : ℝ := diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/HarmonicSourceSupport.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/HarmonicSourceSupport.lean index a4423c14f2..9de41485d7 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 @@ -31,6 +31,7 @@ variable {D : Type} [NormedAddCommGroup D] [NormedSpace ℝ D] /-- Every nonzero harmonic vanishes outside the specified spatial set. The zero coefficient is unrestricted. -/ +@[expose] def NonzeroSupported (K : Set D) (c : HarmonicFields.Coefficients D) : Prop := ∀ j : ℤ, j ≠ 0 → ∀ x : D, x ∉ K → c j x = 0 @@ -447,7 +448,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 @@ -638,6 +639,7 @@ end ColoredSlots /-- Nonzero coefficients are supported in `K` relative to `U`. Values outside `U` are not constrained. -/ +@[expose] def NonzeroSupportedOn (U K : Set D) (c : HarmonicFields.Coefficients D) : Prop := ∀ j : ℤ, j ≠ 0 → ∀ x : D, x ∈ U → x ∉ K → c j x = 0 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..562e0cd3c8 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 => @@ -183,6 +184,7 @@ theorem realCoefficients_local_congr {U : Set D} {a b : Coefficients D} simp only [HarmonicResidual.realCoefficients_apply, hab j x hx, hab (-j) x hx] /-- Triple field, given by `![(h.radial n x : ℂ), (h.angular n x : ℂ), (h.axial n x : ℂ)]`. -/ +@[expose] noncomputable def tripleField (h : MeanIncrementBounds.Triple D) (n : ℕ) (x : D) : ComplexVector := ![(h.radial n x : ℂ), (h.angular n x : ℂ), (h.axial n x : ℂ)] @@ -194,11 +196,12 @@ 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) /-- Mean cross, constructed using `crossCoefficients`. -/ +@[expose] noncomputable def meanCross (c : CorrectionState.Context D) (h : MeanIncrementBounds.Triple D) (b : CorrectionState.HarmonicBlock D) (n : ℕ) : HarmonicResidual.VectorCoefficients D := @@ -257,7 +260,7 @@ theorem residualCoefficients_mean_update (c : CorrectionState.Context D) (s₀ s /-- The slow coefficient geometry has no artificial angular coordinate. The actual separate angular carrier is accounted for explicitly below. -/ -noncomputable def slowGeometry {s : StripData D} {κ : ℝ} (c : CorrectionState.Context D) +@[expose] noncomputable def slowGeometry {s : StripData D} {κ : ℝ} (c : CorrectionState.Context D) (ho : MeanIncrementBounds.OperatorBounds s c.operators κ) (hR : ∀ x ∈ s.domain, 0 < c.operators.radius x) : Geometry s κ where radius := fun _ => c.operators.radius @@ -276,7 +279,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) := @@ -307,6 +310,7 @@ theorem blockAmplitude_class {s : StripData D} {P : ℕ → D → ℝ} {α : ℝ (hb i (-j) (neg_ne_zero.mpr hj)) /-- The separate angular phase term has the same carrier loss as the slow phase term. -/ +@[expose] noncomputable def angularCarrierTerm (c : CorrectionState.Context D) (b : CorrectionState.HarmonicBlock D) (h : MeanIncrementBounds.Triple D) (j : ℤ) (n : ℕ) (x : D) (i : Fin 3) : ℂ := @@ -489,7 +493,7 @@ theorem residualBlock_mean_update_class {s : StripData D} {κ α H : ℝ} {P : /-- Residual difference block, bundling `velocity`, `pressure`, `frequency`, `phase` and the required compatibility proofs. -/ -noncomputable def residualDifferenceBlock (c : CorrectionState.Context D) +@[expose] noncomputable def residualDifferenceBlock (c : CorrectionState.Context D) (s₀ s₁ : CorrectionState.State D) (b : CorrectionState.HarmonicBlock D) (G A₀ A₁ : HarmonicResidual.BlockCoefficients D) : CorrectionState.HarmonicBlock D where velocity := fun n i => (HarmonicResidual.residualBlock c s₁ b G A₁).velocity n i - @@ -702,7 +706,7 @@ end end -@[expose] public section +public section noncomputable section @@ -718,7 +722,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,8 +760,9 @@ 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[ℝ] ℝ)`. -/ +@[expose] noncomputable def inclusion : D →L[ℝ] D × ℝ := (ContinuousLinearMap.id ℝ D).prod (0 : D →L[ℝ] ℝ) @@ -773,6 +778,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} @@ -792,6 +798,7 @@ theorem class_slice {s : StripData D} {w : ℕ → D → ℝ} {α : ℝ} {f : /-- Lifted geometry, bundling `radius`, `radial`, `angular`, `axial` and the required compatibility proofs. -/ +@[expose] noncomputable def liftedGeometry {s : StripData D} {κ : ℝ} (G : Geometry s κ) : Geometry (productStrip s) κ where radius := fun n p => G.radius n p.1 @@ -813,11 +820,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 @@ -837,6 +844,7 @@ theorem singleMode_eq (b : CorrectionState.HarmonicBlock D) (j : ℤ) (n : ℕ) field_simp /-- The primitive divergence condition is imposed on each actual harmonic field. -/ +@[expose] def ModeSolenoidal (s : StripData D) (c : CorrectionState.Context D) (b : CorrectionState.HarmonicBlock D) : Prop := ∀ j : ℤ, j ≠ 0 → ∀ n p, p.1 ∈ s.domain → @@ -983,6 +991,7 @@ theorem orderedKernel_raw_class {s : StripData D} {κ α β : ℝ} {P : ℕ → (s.isOpen_domain.mem_nhds hx)).differentiableAt (by simp))) i).symm /-- Oscillatory input blocks have no stored velocity at harmonic zero. -/ +@[expose] def ZeroMode (b : CorrectionState.HarmonicBlock D) : Prop := ∀ n i, b.velocity n i 0 = 0 @@ -1128,7 +1137,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 +1146,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,13 +1176,14 @@ 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) (blockAmplitude a n) (blockAmplitude b n) /-- All three actual quadratic terms introduced by adding one wave block. -/ +@[expose] noncomputable def nonlinearCoefficients (c : CorrectionState.Context D) (a b : CorrectionState.HarmonicBlock D) : HarmonicResidual.BlockCoefficients D := blockTransport c a a b + blockTransport c a b a + blockTransport c a b b @@ -1410,6 +1420,7 @@ theorem nonlinear_update_with_mean {U : Set D} (hU : IsOpen U) linear_combination hn + hm /-- Linear coefficients as an element of `HarmonicResidual.BlockCoefficients D`. -/ +@[expose] noncomputable def linearCoefficients (c : CorrectionState.Context D) (carrierData b : CorrectionState.HarmonicBlock D) : HarmonicResidual.BlockCoefficients D := fun n => HarmonicResidual.linearResidual (HarmonicResidual.contextFrame c n) @@ -1513,6 +1524,7 @@ theorem residualBlock_wave_update {U : Set D} (hU : IsOpen U) /-- Interaction coefficients, given by `meanCross c u.mean (withCarrier a b) + nonlinearCoefficients c a b`. -/ +@[expose] noncomputable def interactionCoefficients (c : CorrectionState.Context D) (u : CorrectionState.State D) (a b : CorrectionState.HarmonicBlock D) : HarmonicResidual.BlockCoefficients D := @@ -1520,6 +1532,7 @@ noncomputable def interactionCoefficients (c : CorrectionState.Context D) (u : /-- Interaction block, bundling `velocity`, `pressure`, `frequency`, `phase` and the required compatibility proofs. -/ +@[expose] noncomputable def interactionBlock (c : CorrectionState.Context D) (u : CorrectionState.State D) (a b : CorrectionState.HarmonicBlock D) : CorrectionState.HarmonicBlock D where velocity := fun n i => HarmonicResidual.nonconstant @@ -1531,7 +1544,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..1b47baf24a 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 @@ -256,6 +256,7 @@ theorem matching_jets {a : ℝ} (ha : 1 < a) (n : ℕ) : /-- The globally defined extension. The original profile is used at every positive argument, and matching zeroth jets preserve it at zero as well. -/ +@[expose] noncomputable def extension (a : ℝ) : ℝ → ℝ := EndpointExtension.glue 0 (leftBranch a) (profile a) @@ -377,7 +378,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 +426,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..350873f60a 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 @@ -79,6 +79,7 @@ abbrev Control := ℝ × (Coeff × Coeff) /-- The genuine heat multiplier, smoothly continued only in the auxiliary inverse-radius variable and outside the physical parameter band. -/ +@[expose] noncomputable def freeE (F : Profile) (z : Raw) : ℝ := F.logE z.2 * (1 + OutgoingSchedule.sigma ((z.2.1 - HeatTailEdit.switchStart F.data) / (3 / 10)) * @@ -188,9 +189,11 @@ theorem freePi_contDiff (F : Profile) : ContDiff ℝ ∞ (freePi F) := by simp only [freeE_zero, sub_self, intervalIntegral.integral_zero, mul_zero, add_zero] /-- Raw point, given by `((z.1.1, z.1.2.1), z.2)`. -/ +@[expose] noncomputable def rawPoint (z : Control × Point) : Raw := ((z.1.1, z.1.2.1), z.2) /-- Value, given by `f (rawPoint z)`. -/ +@[expose] noncomputable def value (f : Raw → ℝ) (z : Control × Point) : ℝ := f (rawPoint z) /-- Radial jet, given by `fderiv ℝ f (rawPoint z) ((0, 0), (1, 0))`. -/ noncomputable def radialJet (f : Raw → ℝ) (z : Control × Point) : ℝ := @@ -281,6 +284,7 @@ theorem freeE_eq_physical (F : Profile) (XR : ℝ) (c : ℝ → Coeff) /-- Controls, given by `(1 / XR, (w.coefficients eta, derivWithin w.coefficients HeatedOutgoing.parameterDomain eta))`. -/ +@[expose] noncomputable def controls (F : Profile) {XR C : ℝ} (w : HeatedOutgoing.CompensationWitness F XR C) (eta : ℝ) : Control := (1 / XR, (w.coefficients eta, derivWithin w.coefficients HeatedOutgoing.parameterDomain eta)) @@ -321,6 +325,7 @@ noncomputable def radialNumerator (F : Profile) (z : Control × Point) : ℝ := value (freeE F) z - 2 * radialJet (freeE F) z /-- Family Q, given by `angularNumerator F z / (Real.exp (3 * z.2.1 / 2) * value (freeE F) z)`. -/ +@[expose] noncomputable def familyQ (F : Profile) (z : Control × Point) : ℝ := angularNumerator F z / (Real.exp (3 * z.2.1 / 2) * value (freeE F) z) @@ -335,6 +340,7 @@ noncomputable def familyN (F : Profile) (z : Control × Point) : ℝ := coordinateFactor z.2.2 * parameterJet (freePi F) z /-- Family A, given by `radialNumerator F z / value (freeE F) z`. -/ +@[expose] noncomputable def familyA (F : Profile) (z : Control × Point) : ℝ := radialNumerator F z / value (freeE F) z /-- Family B, given by `2 * OutgoingHistories.dY F.logU z.2 / value (freeE F) z`. -/ @@ -505,6 +511,7 @@ theorem familyGap_contDiffOn (F : Profile) : ContDiffOn ℝ ∞ (familyGap F) (r rfl /-- Evaluation at the actual compensation coefficients. -/ +@[expose] noncomputable def realize (f : Raw → ℝ) (delta : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := f ((delta, c p.2), p) @@ -525,23 +532,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 +819,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 +828,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 +839,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 +1059,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..a50ae47d4a 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 @@ -356,14 +356,17 @@ theorem canonicalKernel_eq_kernel (F : Profile) {XR : ℝ} (hXR : 0 < XR) (c : /-! ## The constants are fixed by the same compensation witness -/ /-- Angular history, given by `∫ u in Ioc 0 X, HeatedOutgoing.H F XR c (u,η)`. -/ +@[expose] noncomputable def angularHistory (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (η X : ℝ) : ℝ := ∫ u in Ioc 0 X, HeatedOutgoing.H F XR c (u,η) /-- Energy history, given by `∫ u in Ioc 0 X, HeatedOutgoing.energyDensity F XR c η u`. -/ +@[expose] noncomputable def energyHistory (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (η X : ℝ) : ℝ := ∫ u in Ioc 0 X, HeatedOutgoing.energyDensity F XR c η u /-- Power history, given by `∫ u in Ioc 0 X, OutgoingDilation.powerH F XR u`. -/ +@[expose] noncomputable def powerHistory (F : Profile) (XR X : ℝ) : ℝ := ∫ u in Ioc 0 X, OutgoingDilation.powerH F XR u diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/HeatedOutgoing.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/HeatedOutgoing.lean index 6519849a04..ba94183ce0 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,9 +748,9 @@ 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 +@[expose] def domain : Set (ℝ × ℝ) := Ioi 0 ×ˢ parameterDomain /-- Heat E, given by `OutgoingDilation.E F XR p * HeatTailEdit.multiplier F.data.h (ParametricHeatTail.diffusion p.2) (switchRadius F XR) p.1`. -/ @@ -756,43 +760,44 @@ 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) /-- J, given by `∫ u in Ioc 0 X, H F XR c (u, eta) * U F XR (u, eta)`. -/ -noncomputable def J (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (eta X : ℝ) : ℝ := +@[expose] 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 @@ -927,6 +933,7 @@ noncomputable def patchRow (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (eta : ![(A ^ 2 - B ^ 2) / X, A ^ 2 - B ^ 2, Real.sqrt (2 * X) * (A - B)] i /-- Change row as an element of `ℝ`. -/ +@[expose] noncomputable def changeRow (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (eta : ℝ) (i : Fin 3) (X : ℝ) : ℝ := ![(E F XR c (X, eta) ^ 2 - OutgoingDilation.E F XR (X, eta) ^ 2) / X, @@ -1212,8 +1219,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 +1351,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..7592553147 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 @@ -434,6 +434,7 @@ section Labels variable {B N0 : ℕ} /-- Band label, given by `⟨spatialLabel l, label_large l⟩`. -/ +@[expose] noncomputable def bandLabel (l : SignedLabel B N0) : PhysicalWaveSum.BandLabel := ⟨spatialLabel l, label_large l⟩ @@ -461,10 +462,12 @@ theorem selected_eq (l : SignedLabel B N0) (hL : bandLabel l ∈ active) : /-- Gap, given by `ChartScales.nativeIndex ActualPrimary.h L.val.1 - CommonWindow.index ActualPrimary.h L.val.1`. -/ +@[expose] noncomputable def gap (L : PhysicalWaveSum.BandLabel) : ℕ := ChartScales.nativeIndex ActualPrimary.h L.val.1 - CommonWindow.index ActualPrimary.h L.val.1 /-- Geometry, given by `ActualSignedPhysicalData.geometry ActualPrimary.slots L.val (gap L)`. -/ +@[expose] noncomputable def geometry (L : PhysicalWaveSum.BandLabel) : CommonCoverSolve.Geometry := ActualSignedPhysicalData.geometry ActualPrimary.slots L.val (gap L) @@ -472,6 +475,7 @@ theorem geometry_bandLabel (l : SignedLabel B N0) : geometry (bandLabel l) = ActualPrimary.chartGeometry (BaseChartJets.cellBand l.2) l.1 l.2 := rfl /-- Selected carrier, constructed using `ActualSignedPhysicalData.carrier`. -/ +@[expose] noncomputable def selectedCarrier (l : SignedLabel B N0) (k : Frequency) : PhysicalWaveSum.CarrierData := ActualSignedPhysicalData.carrier (h := ActualPrimary.h) (spatialLabel l) k @@ -482,6 +486,7 @@ noncomputable def selectedCarrier (l : SignedLabel B N0) (k : Frequency) : ((ActualPrimary.phases B N0 l.1).phase.G l.2) /-- Carrier, with branches according to `hL : L ∈ active (B := B) (N0 := N0)`. -/ +@[expose] noncomputable def carrier (L : PhysicalWaveSum.BandLabel) (k : Frequency) : PhysicalWaveSum.CarrierData := if hL : L ∈ active (B := B) (N0 := N0) then selectedCarrier (selected L hL) k @@ -593,6 +598,7 @@ theorem nativePressureSource_uniform : exact mul_le_of_le_one_right (Real.sqrt_nonneg _) (fullEnvelope_le_one l.1 n x) /-- Potential family, bundling `gap`, `carrier`, `amplitude`, `CartesianCopySource`. -/ +@[expose] noncomputable def potentialFamily (B N0 : ℕ) (i : Fin 3) : PhysicalCopyBounds.CopyFamily 1 Frequency where gap := gap @@ -604,6 +610,7 @@ noncomputable def potentialFamily (B N0 : ℕ) (i : Fin 3) : else 0 /-- Pressure family, bundling `gap`, `carrier`, `amplitude`, `nativePressureSource`. -/ +@[expose] noncomputable def pressureFamily (B N0 : ℕ) : PhysicalCopyBounds.CopyFamily 1 Frequency where gap := gap carrier k L := carrier (B := B) (N0 := N0) L k @@ -752,6 +759,7 @@ abbrev LiftPoint := PhysicalGraphBounds.LiftPoint /-- Slow input, given by `(ActualSignedGeometry.meanEquiv.symm (PhysicalClassBounds.cylindricalMap x)).1`. -/ +@[expose] noncomputable def slowInput (x : LiftPoint) : PhaseCalculus.Slow := (ActualSignedGeometry.meanEquiv.symm (PhysicalClassBounds.cylindricalMap x)).1 @@ -1152,17 +1160,20 @@ theorem pressure_support (B N0 : ℕ) : /-- The actual initial primary potential. The physical construction is zero on the unused future side of the preterminal domain. -/ +@[expose] noncomputable def potential (B N0 : ℕ) : ProblemStatement.VelocityField := PhysicalCopyBounds.vectorSum (potentialFamily B N0) innerRadius ActualPrimary.h ActualPrimary.slots.radius /-- Pressure, defined pointwise by `((pressureFamily B N0).sum innerRadius ActualPrimary.h ActualPrimary.slots.radius w).re`. -/ +@[expose] noncomputable def pressure (B N0 : ℕ) : ProblemStatement.PressureField := fun w => ((pressureFamily B N0).sum innerRadius ActualPrimary.h ActualPrimary.slots.radius w).re /-- Copy potential, bundling `Copy`, `harmonics`, `family`, `inner` and the required compatibility proofs. -/ +@[expose] noncomputable def copyPotential (B N0 : ℕ) : MixedAxisPreservation.CopyPotential ActualPrimary.h where Copy := Frequency @@ -1364,6 +1375,7 @@ theorem pressure_amplitude_source (B N0 : ℕ) (k : Frequency) /-- The identity chart only needs its formula on the genuine source domain. Its closure condition follows from actual amplitude support. -/ +@[expose] noncomputable def identitySourceChartOn {N : ℕ} {K I : Type} (f : PhysicalCopyBounds.CopyFamily N K) (hc : PhysicalCopyBounds.SupportCells f) {a b h r Z σ : ℝ} {gap : ℕ} (ha : 0 < a) @@ -1395,6 +1407,7 @@ noncomputable def identitySourceChartOn {N : ℕ} {K I : Type} (fun y hy => hd k J _ (PhysicalWaveSum.globalWave_ne_zero_amp hy)) /-- Potential chart, constructed using `identitySourceChartOn`. -/ +@[expose] noncomputable def potentialChart (B N0 : ℕ) (i : Fin 3) : LocalPhysicalCopyBounds.CommonChart (potentialFamily B N0 i) (potentialCells B N0 i) innerRadius outerRadius ActualPrimary.h ActualPrimary.slots.radius (-ActualPrimary.h) @@ -1403,6 +1416,7 @@ noncomputable def potentialChart (B N0 : ℕ) (i : Fin 3) : (fun k I => (i, I, k)) (potential_amplitude_source B N0 i) (potential_source_domain B N0 i) /-- Pressure chart, constructed using `identitySourceChartOn`. -/ +@[expose] noncomputable def pressureChart (B N0 : ℕ) : LocalPhysicalCopyBounds.CommonChart (pressureFamily B N0) (pressureCells B N0) innerRadius outerRadius ActualPrimary.h ActualPrimary.slots.radius @@ -1560,6 +1574,7 @@ section PhysicalData /-- Actual initial potential copies with their proved support, local regularity and uniform native jets. -/ +@[expose] noncomputable def potentialWaveData (B N0 : ℕ) : PhysicalStageBounds.WaveData ActualPrimary.h LiftPoint (Fin 3 × SourceIndex) Frequency (Fin 3) where @@ -1591,6 +1606,7 @@ noncomputable def potentialWaveData (B N0 : ℕ) : /-- The pressure has the same copied source construction and its actual physical pressure factor. -/ +@[expose] noncomputable def pressureWaveData (B N0 : ℕ) : PhysicalStageBounds.WaveData ActualPrimary.h LiftPoint SourceIndex Frequency Unit where lowerRadius := innerRadius @@ -1642,6 +1658,7 @@ section LiteralCopies variable {B N0 : ℕ} /-- Positive index, given by `ActualSignedPhysicalData.positiveIndex (bandLabel l)`. -/ +@[expose] noncomputable def positiveIndex (l : SignedLabel B N0) : PhysicalWaveSum.WaveIndex 1 := ActualSignedPhysicalData.positiveIndex (bandLabel l) @@ -2007,7 +2024,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) @@ -2614,6 +2631,7 @@ section GlobalPrimaryPressure variable {B N0 : ℕ} /-- Physical pressure coefficient, constructed using `ActualPrimary.periodicGaussian`. -/ +@[expose] noncomputable def physicalPressureCoefficient (l : SignedLabel B N0) (z : ProblemStatement.SpaceTime) : ℂ := ActualPrimary.periodicGaussian l.1 l.2 (ActualPrimaryCoherence.physicalLift z).1.2 • diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/IntegratedMeanBalances.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/IntegratedMeanBalances.lean index 2bcdd425ec..29a6936737 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 → ℝ} @@ -357,22 +357,27 @@ section Torus variable {P : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] /-- Torus inner, given by `∫ x in (0 : ℝ)..1, F (q, x)`. -/ +@[expose] noncomputable def torusInner (F : (P × ℝ) × ℝ → ℝ) (q : P × ℝ) : ℝ := ∫ x in (0 : ℝ)..1, F (q, x) /-- Torus average, given by `∫ y in (0 : ℝ)..1, torusInner F (p, y)`. -/ +@[expose] noncomputable def torusAverage (F : (P × ℝ) × ℝ → ℝ) (p : P) : ℝ := ∫ y in (0 : ℝ)..1, torusInner F (p, y) /-- Fixed partial, given by `fderiv ℝ F q v`. -/ +@[expose] noncomputable def fixedPartial (v : (P × ℝ) × ℝ) (F : (P × ℝ) × ℝ → ℝ) (q : (P × ℝ) × ℝ) : ℝ := fderiv ℝ F q v /-- Slow partial, given by `fixedPartial ((v, 0), 0) F`. -/ +@[expose] noncomputable def slowPartial (v : P) (F : (P × ℝ) × ℝ → ℝ) : (P × ℝ) × ℝ → ℝ := fixedPartial ((v, 0), 0) F /-- Torus partial, given by `fixedPartial ((0, v.2), v.1) F`. -/ +@[expose] noncomputable def torusPartial (v : ℝ × ℝ) (F : (P × ℝ) × ℝ → ℝ) : (P × ℝ) × ℝ → ℝ := fixedPartial ((0, v.2), v.1) F @@ -641,6 +646,7 @@ theorem SmoothShell.weighted_integrable {a b : ℝ} {F : MeanField} (hF : Smooth /-- The angular line of (32), after the actual torus average. Coordinates are `(R,(T,Z))`; `ε` is constant on a chart. The supplied fluxes are full averages of the pointwise products in (32), and the last radial divergence is the virtual stress. -/ +@[expose] noncomputable def angularBalance (ε : ℝ) (v radialFlux axialFlux virtualFlux : MeanField) (x : MeanPoint) : ℝ := (-ε) * parameterPartial (1, 0) v x + @@ -651,6 +657,7 @@ noncomputable def angularBalance (ε : ℝ) (v radialFlux axialFlux virtualFlux radialDivergence 2 (fun r => virtualFlux (r, x.2)) x.1 /-- The axial line of (32), with pressure retained inside the axial flux. -/ +@[expose] noncomputable def axialBalance (ε : ℝ) (γ radialFlux axialFlux pressure virtualFlux : MeanField) (x : MeanPoint) : ℝ := (-ε) * parameterPartial (1, 0) γ x + @@ -738,14 +745,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..865925625e 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 @@ -267,6 +267,7 @@ abbrev WindowPoint := ℝ × SlotColoring.Position /-- The first coordinate is the logarithmic dyadic coordinate. The window includes a two-level closed band and the actual two-mesh spatial box used by `SlotColoring`. -/ +@[expose] noncomputable def closedWindow (d : ℝ) (l : SlotColoring.Label) : Set WindowPoint := Icc ((l.1 : ℝ) - 2) ((l.1 : ℝ) + 2) ×ˢ SlotColoring.physicalBox d l @@ -515,10 +516,12 @@ 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 /-- Angular continuous, given by `∀ n x i, Continuous (fun θ : ℝ => u n (x, θ) i)`. -/ +@[expose] noncomputable def AngularContinuous (u : Oscillation D) : Prop := ∀ n x i, Continuous (fun θ : ℝ => u n (x, θ) i) @@ -530,6 +533,7 @@ theorem block_angularContinuous (a : HarmonicBlock D) : AngularContinuous a.osci /-- Actual support in a slow-label window and its padded native slot, viewed through one common auxiliary coordinate. -/ +@[expose] noncomputable def SupportedOscillations {d h : ℝ} {vr vt : TorusInverse.Plane} (sys : PartitionedCovariance.SlotSystem d h vr vt) (label : ℕ → ι → SlotColoring.Label) (χ : ℕ → D → WindowPoint) @@ -765,11 +769,11 @@ theorem signedTailLabel_admissible {N : ℕ} (hN : 1 ≤ N) : abbrev Tensor (D : Type) := Fin 3 → Fin 3 → ScalarField D /-- Symmetric covariance, given by `bilinearCovariance u v + bilinearCovariance v u`. -/ -noncomputable def symmetricCovariance (u v : Oscillation D) : Tensor D := +@[expose] 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 @@ -843,12 +847,13 @@ structure SameCarrier (a b : HarmonicBlock D) : Prop where /-- Add block, given by `{ a with velocity := fun n i => a.velocity n i + b.velocity n i pressure := fun n => a.pressure n + b.pressure n }`. -/ -noncomputable def addBlock (a b : HarmonicBlock D) : HarmonicBlock D := +@[expose] noncomputable def addBlock (a b : HarmonicBlock D) : HarmonicBlock D := { a with velocity := fun n i => a.velocity n i + b.velocity n i pressure := fun n => a.pressure n + b.pressure n } /-- Sub block, given by `{ a with velocity := fun n i => a.velocity n i - b.velocity n i pressure := fun n => a.pressure n - b.pressure n }`. -/ +@[expose] noncomputable def subBlock (a b : HarmonicBlock D) : HarmonicBlock D := { a with velocity := fun n i => a.velocity n i - b.velocity n i pressure := fun n => a.pressure n - b.pressure n } 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..c31008e30f 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,25 @@ 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`. -/ +@[expose] 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 +272,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..f194f887b6 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 @@ -486,6 +488,7 @@ variable {F : OutgoingProfile.Profile} {W : NominalProfile.Witness F} {d : ModulatedProfileAssembly.LoopData W} (v : ModulatedProfileAssembly.Witness d) /-- The actual full-annulus cone delivered by the finite modulation theorem. -/ +@[expose] noncomputable def FullTrueCone : Prop := ∀ p : Point, NominalConeAssembly.activeLeft W < p.1 → p.1 < NominalConeAssembly.activeRight W → p.2 ∈ Icc (-1 : ℝ) 1 → @@ -581,19 +584,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..9dfbaf2951 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 @@ -33,6 +33,7 @@ variable {D E : Type} [NormedAddCommGroup D] [NormedSpace ℝ D] [NormedAddCommGroup E] [NormedSpace ℝ E] /-- Cylinder, given by `U ×ˢ univ`. -/ +@[expose] noncomputable def cylinder (U : Set D) : Set (D × ℝ) := U ×ˢ univ omit [NormedSpace ℝ D] in @@ -128,6 +129,7 @@ theorem parameterIntegral_smooth [CompleteSpace E] {U : Set D} (hU : IsOpen U) contDiffOn_infty.mpr (fun m => parameterIntegral_smooth_nat hU m hf a b) /-- Period, given by `2 * Real.pi`. -/ +@[expose] noncomputable def period : ℝ := 2 * Real.pi theorem period_ne : period ≠ 0 := mul_ne_zero (by norm_num) Real.pi_ne_zero @@ -137,12 +139,14 @@ 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)`. -/ +@[expose] noncomputable def angularDirection (_p : D × ℝ) : D × ℝ := (0, 1) /-- Lift scalar, given by `f p.1`. -/ +@[expose] noncomputable def liftScalar (f : D → ℝ) (p : D × ℝ) : ℝ := f p.1 theorem liftDirection_smooth {U : Set D} {V : D → D} (hV : ContDiffOn ℝ ∞ V U) : @@ -222,6 +226,7 @@ theorem avg_along_twice {U : Set D} (hU : IsOpen U) {f : D × ℝ → ℝ} exact along_congr hU (fun y hy => (along_avg hU hf V hy).symm) hx /-- Periodic on, given by `∀ x ∈ U, ∀ θ : ℝ, f (x, θ + period) = f (x, θ)`. -/ +@[expose] def PeriodicOn (U : Set D) (f : D × ℝ → E) : Prop := ∀ x ∈ U, ∀ θ : ℝ, f (x, θ + period) = f (x, θ) @@ -297,35 +302,42 @@ 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 : ℂ), (c.base.axial n x.1 : ℂ)]`. -/ +@[expose] noncomputable def complexBase (c : CorrectionState.Context D) (n : ℕ) (x : D × ℝ) : ComplexVector := ![(c.base.radial n x.1 : ℂ), (c.base.angular n x.1 : ℂ), (c.base.axial n x.1 : ℂ)] /-- Complex perturbation as an element of `ComplexVector`. -/ +@[expose] noncomputable def complexPerturbation (u : CorrectionState.State D) (n : ℕ) (x : D × ℝ) : ComplexVector := ![(u.mean.radial n x.1 + u.oscillation n x 0 : ℝ), @@ -333,11 +345,13 @@ noncomputable def complexPerturbation (u : CorrectionState.State D) (n : ℕ) (x (u.mean.axial n x.1 + u.oscillation n x 2 : ℝ)] /-- Complex pressure, given by `(u.totalPressureIncrement n x : ℝ)`. -/ +@[expose] noncomputable def complexPressure (u : CorrectionState.State D) (n : ℕ) (x : D × ℝ) : ℂ := (u.totalPressureIncrement n x : ℝ) /-- 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 +359,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) @@ -360,18 +375,20 @@ noncomputable def fullResidual (c : CorrectionState.Context D) (u : CorrectionSt virtualDivergence c n x i + u.errors.base n x i /-- Full good residual, given by `fullResidual c u - u.errors.total`. -/ +@[expose] noncomputable def fullGoodResidual (c : CorrectionState.Context D) (u : CorrectionState.State D) : CorrectionState.Oscillation D := fullResidual c u - u.errors.total /-- Angular mean vector, defined pointwise by `CorrectionState.angularAverage (fun k p => f k p i) n x`. -/ +@[expose] noncomputable def angularMeanVector (f : CorrectionState.Oscillation D) : CorrectionState.MeanVector D := fun n x i => CorrectionState.angularAverage (fun k p => f k p i) n x /-- 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,14 +868,17 @@ 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 /-- Perturbation, given by `tripleVector u.mean n p.1 + u.oscillation n p`. -/ +@[expose] noncomputable def perturbation (u : CorrectionState.State D) (n : ℕ) (p : D × ℝ) : Fin 3 → ℝ := tripleVector u.mean n p.1 + u.oscillation n p diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/LinearWaveBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/LinearWaveBounds.lean index 293570b3a3..233ac64d5a 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,18 +123,20 @@ 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)`. -/ +@[expose] noncomputable def Dr (d : GraphDirections D) (f : ℕ → D → E) : ℕ → D → E := fun n => along (d.radialField n) (f n) @@ -147,7 +149,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 +224,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 +238,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 +246,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 +254,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 +263,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 +276,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 +301,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 +309,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 +351,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 +818,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..235477ef8c 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 @@ -32,10 +32,12 @@ open scoped Topology ContDiff BigOperators /-- The actual similarity parameter depends only on physical time and the axial coordinate, and not on radius or angle. -/ +@[expose] noncomputable def slowQ (h : ℝ) (s : DirectAngularDiagonal.Slow) : ℝ := SimilarityCoordinates.coordinateQ (2 * h) (1 - s.1, s.2) /-- Local slow domain, given by `{s | s.1 < 1 ∧ slowQ h s < qbig}`. -/ +@[expose] noncomputable def localSlowDomain (h qbig : ℝ) : Set DirectAngularDiagonal.Slow := {s | s.1 < 1 ∧ slowQ h s < qbig} @@ -69,6 +71,7 @@ theorem localSlowDomain_subset (h qbig : ℝ) : variable {h qbig : ℝ} /-- The literal uncut direct angular fields used in the diagonal. -/ +@[expose] noncomputable def rawSeries (D : ℕ → DirectAngularDiagonal.AngularData (localSlowDomain h qbig)) : ℕ → VelocityField := fun j => DirectAngularDiagonal.angularField (D j).scalar @@ -84,6 +87,7 @@ theorem rawSeries_smooth (hh : 0 < h) (hh1 : h < 1 / 2) /-- Axis preservation uses exactly the same local scalars and support, without imposing global raw smoothness. -/ +@[expose] noncomputable def angularSupport (D : ℕ → DirectAngularDiagonal.AngularData (localSlowDomain h qbig)) : ℕ → MixedAxisPreservation.AngularSupport (MixedAxisPreservation.localDomain h qbig) := 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..0bc2a0e890 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 @@ -37,6 +37,7 @@ variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] /-- Smoothness on one genuine open neighborhood. Unlike a bare `ContDiffAt ℝ ∞`, the same neighborhood works for all derivative orders. -/ +@[expose] def SmoothNear (f : E → F) (x : E) : Prop := ∃ U : Set E, IsOpen U ∧ x ∈ U ∧ ContDiffOn ℝ ∞ f U @@ -113,7 +114,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..573a947555 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 @@ -37,7 +37,7 @@ abbrev ScalarField (D : Type) := MeanIncrementBounds.Field D /-- Positive domain, given by `DefectIncrementBounds.positiveDomain ∩ PhysicalMeanDomain.slowDomain U`. -/ -noncomputable def positiveDomain (U : Set P) : Set (Point P) := +@[expose] noncomputable def positiveDomain (U : Set P) : Set (Point P) := DefectIncrementBounds.positiveDomain ∩ PhysicalMeanDomain.slowDomain U omit [NormedSpace ℝ P] in @@ -413,6 +413,7 @@ theorem remainders_mem_local (i : Fin 3) : end IntegratedBounds /-- Is slow on, given by `∀ n R p, p ∈ U → ∀ Y, f n (R, (p, Y)) = slowSlice f n p R`. -/ +@[expose] noncomputable def IsSlowOn (U : Set P) (f : ScalarField (Point P)) : Prop := ∀ n R p, p ∈ U → ∀ Y, f n (R, (p, Y)) = slowSlice f n p R diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/LocalResidualGrouping.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/LocalResidualGrouping.lean index bd11e9f519..8a825ce669 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 @@ -45,10 +45,12 @@ noncomputable def axisymmetricLift (a : MeanVector D) : Oscillation D := fun n x => a n x.1 /-- Add an independent alias without changing any velocity or pressure field. -/ +@[expose] noncomputable def addAxisymmetricAlias (s : State D) (a : MeanVector D) : State D := { s with errors := { s.errors with aliasError := s.errors.aliasError + axisymmetricLift a } } /-- Remove precisely the specified independent alias from the stored errors. -/ +@[expose] noncomputable def eraseAxisymmetricAlias (s : State D) (a : MeanVector D) : State D := { s with errors := { s.errors with aliasError := s.errors.aliasError - axisymmetricLift a } } @@ -307,7 +309,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..368baa2dc8 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 @@ -61,6 +61,7 @@ theorem slowDomain_open {U : Set S} (hU : IsOpen U) : IsOpen (slowDomain U) := hU.preimage (continuous_fst.comp continuous_snd) /-- Strip domain, given by `{p | p.1 ∈ Ioo a b ∧ p.2.1 ∈ U}`. -/ +@[expose] noncomputable def stripDomain (a b : ℝ) (U : Set S) : Set (PressureStream.Lift S) := {p | p.1 ∈ Ioo a b ∧ p.2.1 ∈ U} @@ -70,6 +71,7 @@ theorem stripDomain_open (a b : ℝ) {U : Set S} (hU : IsOpen U) : (isOpen_Ioo.preimage continuous_fst).inter (slowDomain_open hU) /-- Restriction changes only the domain, leaving all weights and band scales. -/ +@[expose] noncomputable def localStripData (a b cL cR : ℝ) (ha : 0 < a) (hcL : 0 < cL) (hcR : 0 < cR) (ε L : ℕ → ℝ) (hε : ∀ n, 0 < ε n) (hεone : ∀ n, ε n ≤ 1) (hL : ∀ n, 1 ≤ L n) @@ -93,14 +95,17 @@ theorem localStrip_majorant_eq logStrip_majorant_eq ha hcL hcR ε L hε hεone hL α C k n p hp /-- Radial support is required only at slow parameters where the source is used. -/ +@[expose] noncomputable def SupportedOn (a b : ℝ) (U : Set S) (f : PressureStream.Lift S → V) : Prop := ∀ p, p.2.1 ∈ U → f p ≠ 0 → p.1 ∈ Icc a b /-- Periodic on, given by `∀ r s, s ∈ U → FourierAlias.TorusPeriodic (fun Y => f (r, (s, Y)))`. -/ +@[expose] noncomputable def PeriodicOn (U : Set S) (f : PressureStream.Lift S → ℝ) : Prop := ∀ r s, s ∈ U → FourierAlias.TorusPeriodic (fun Y => f (r, (s, Y))) /-- The germ of a source on one entire slow fiber, including a slow neighborhood. -/ +@[expose] noncomputable def FiberGerm (s : S) (f g : PressureStream.Lift S → V) : Prop := ∀ᶠ t in 𝓝 s, ∀ r Y, f (r, (t, Y)) = g (r, (t, Y)) @@ -122,6 +127,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 +186,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)) @@ -529,6 +536,7 @@ variable {W : Type} [NormedAddCommGroup W] [NormedSpace ℝ W] /-- Fiber local, given by `∀ (f g : PressureStream.Lift S → V) (s : S), (∀ r Y, f (r, (s, Y)) = g (r, (s, Y))) → ∀ r Y, T f (r, (s, Y)) = T g (r, (s, Y))`. -/ +@[expose] noncomputable def FiberLocal (T : (PressureStream.Lift S → V) → PressureStream.Lift S → W) : Prop := ∀ (f g : PressureStream.Lift S → V) (s : S), @@ -896,6 +904,7 @@ theorem jet_zero_outside {a b : ℝ} {U : Set S} (hU : IsOpen U) (TransportPrimitive.iteratedFDeriv_supported (localize_supported hcs hs) j) hr /-- Uniform band jets on the valid slow domain, including all radial edges. -/ +@[expose] noncomputable def LocalBandJets (U : Set S) (ε L : ℕ → ℝ) (α : ℝ) (f : ℕ → PressureStream.Lift S → V) : Prop := ∀ m : ℕ, ∃ C : ℝ, 0 ≤ C ∧ ∃ k : ℕ, ∀ n p, p.2.1 ∈ U → ∀ j ≤ m, @@ -1090,7 +1099,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 @@ -1228,7 +1237,7 @@ end MomentsAndChanges /-- Normalized slow domain, given by `{s | 0 < s.1 ∧ SimilarityCoordinates.coordinateQ coord (s.1, s.2) ∈ Ioo qlo qhi}`. -/ -noncomputable def normalizedSlowDomain (coord qlo qhi : ℝ) : Set PressureStream.Plane := +@[expose] noncomputable def normalizedSlowDomain (coord qlo qhi : ℝ) : Set PressureStream.Plane := {s | 0 < s.1 ∧ SimilarityCoordinates.coordinateQ coord (s.1, s.2) ∈ Ioo qlo qhi} theorem chartQ_eq_slow (coord : ℝ) (p : MeanRankUpdate.ChartPoint) : @@ -1842,7 +1851,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1867,6 +1876,7 @@ variable {D E F : Type} [NormedAddCommGroup D] [NormedSpace ℝ D] [NormedAddCommGroup F] [NormedSpace ℝ F] /-- The exact pullback of the weights, with a local domain for the map. -/ +@[expose] noncomputable def localPullbackStrip (s : StripData D) (Φ : E → D) (U : Set E) (hU : IsOpen U) (hΦ : ContDiffOn ℝ ∞ Φ U) : StripData E where domain := U ∩ Φ ⁻¹' s.domain @@ -1957,10 +1967,12 @@ structure SlowRegion (coord : ℝ) where q_mem : ∀ s ∈ carrier, SimilarityCoordinates.coordinateQ coord s ∈ Icc qlo qhi /-- Profile map, given by `(x.1 / Real.sqrt (MeanRankUpdate.chartQ coord x), x.2)`. -/ +@[expose] noncomputable def profileMap (coord : ℝ) (x : Point) : Point := (x.1 / Real.sqrt (MeanRankUpdate.chartQ coord x), x.2) /-- Inverse profile map, given by `(Real.sqrt (MeanRankUpdate.chartQ coord x) * x.1, x.2)`. -/ +@[expose] noncomputable def inverseProfileMap (coord : ℝ) (x : Point) : Point := (Real.sqrt (MeanRankUpdate.chartQ coord x) * x.1, x.2) @@ -2019,6 +2031,7 @@ theorem SlowRegion.chartQ_pos {coord : ℝ} (U : SlowRegion coord) {x : Point} U.qlo_pos.trans_le (U.q_mem x.2.1 hx).1 /-- Moving strip data, constructed using `localPullbackStrip`. -/ +@[expose] noncomputable def movingStripData {coord : ℝ} (U : SlowRegion coord) (a b cL cR : ℝ) (ha : 0 < a) (hcL : 0 < cL) (hcR : 0 < cR) (ε L : ℕ → ℝ) (hε : ∀ n, 0 < ε n) (hεone : ∀ n, ε n ≤ 1) (hL : ∀ n, 1 ≤ L n) : @@ -2310,6 +2323,7 @@ end LocalPrimitive section PhysicalRequest /-- Support on the same moving shell used in the weight. -/ +@[expose] noncomputable def MovingSupport (a b coord : ℝ) (U : Set Plane) (f : Point → ℝ) : Prop := ∀ x, x.2.1 ∈ U → f x ≠ 0 → (profileMap coord x).1 ∈ Icc a b @@ -2433,7 +2447,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 +2457,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 +2500,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..8dd025bcdf 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,34 +526,39 @@ 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 } /-- With cutoff, given by `{ a with amplitude := fun n i x => ψ n i x • a.amplitude n i x pressure := fun n i x => (ψ n i x : ℂ) * a.pressure n i x }`. -/ +@[expose] noncomputable def withCutoff (a : WaveFamily D I) (ψ : ℕ → I → D → ℝ) : WaveFamily D I := { a with amplitude := fun n i x => ψ n i x • a.amplitude n i x @@ -561,6 +566,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 + @@ -1043,9 +1049,11 @@ variable {D I : Type} [NormedAddCommGroup D] [NormedSpace ℝ D] (a : PeriodizedWaveBounds.CopyData D I) /-- Native family, given by `WaveFamily.ofCoefficients a.localized`. -/ +@[expose] noncomputable def nativeFamily : WaveFamily D I := WaveFamily.ofCoefficients a.localized /-- Raw family, given by `WaveFamily.ofCoefficients a.raw`. -/ +@[expose] noncomputable def rawFamily : WaveFamily D I := WaveFamily.ofCoefficients a.raw theorem common_curl_germ (K : PeriodizedWaveBounds.Cells D I) @@ -1179,6 +1187,7 @@ variable {D I : Type} {L : Type*} [NormedAddCommGroup D] [NormedSpace ℝ D] (a : L → PeriodizedWaveBounds.CopyData D I) /-- Joint native family, given by `WaveFamily.ofCoefficients (fun j => (a j.1).localized j.2)`. -/ +@[expose] noncomputable def jointNativeFamily : WaveFamily D (L × I) := WaveFamily.ofCoefficients (fun j => (a j.1).localized j.2) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/MatchingDebtBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/MatchingDebtBounds.lean index 1346d10efc..6dc6be435b 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 @@ -153,6 +153,7 @@ theorem extendField_slice_eventuallyEq {scale X eta : ℝ} (hscale : 0 < scale) /-! ## The actual five-row vector and its jets -/ /-- Reset vector as an element of `Debt`. -/ +@[expose] noncomputable def resetVector (R r b : ℝ) (u f : Field) (Gi A : ℝ → ℝ) (eta : ℝ) : Debt := ![ShapeTransition.resetDebtM u Gi r b eta, @@ -275,6 +276,7 @@ noncomputable def extendedF : Field := (extendParameter c.initialShape) (extendField A.scale c.seedF)) /-- Extended debt, constructed using `resetVector`. -/ +@[expose] noncomputable def extendedDebt : ℝ → Debt := resetVector c.radius c.separation NominalProfile.matchFraction (extendedU c) (extendedF c) (extendParameter c.initialAxial) (NominalProfile.idealAmplitude F) @@ -554,6 +556,7 @@ theorem normalized_actual_debt_bound {F : OutgoingProfile.Profile} {A : NominalP /-- Small control, given by `c.reference.SmallLogControl (Icc (-1 : ℝ) 1) N eps c.activationTime c.kappa c.axialWidth c.angularWidth`. -/ +@[expose] noncomputable def SmallControl {F : OutgoingProfile.Profile} {A : NominalProfile.AxisStage F} (c : NominalProfile.Controls A) (N : ℕ) (eps : ℝ) : Prop := c.reference.SmallLogControl (Icc (-1 : ℝ) 1) N eps 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..37c2af6957 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 @@ -95,6 +95,7 @@ variable {E F : Type} [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] /-- Chart linear, given by `(l • ContinuousLinearMap.id ℝ ℝ).prodMap C`. -/ +@[expose] noncomputable def chartLinear (l : ℝ) (C : E →L[ℝ] F) : ℝ × E →L[ℝ] ℝ × F := (l • ContinuousLinearMap.id ℝ ℝ).prodMap C @@ -102,6 +103,7 @@ noncomputable def chartLinear (l : ℝ) (C : E →L[ℝ] F) : ℝ × E →L[ℝ] chartLinear l C z = (l * z.1, C z.2) := rfl /-- Pull, given by `u * f (chartLinear l C z)`. -/ +@[expose] noncomputable def pull (l : ℝ) (C : E →L[ℝ] F) (u : ℝ) (f : ℝ × F → ℝ) (z : ℝ × E) : ℝ := u * f (chartLinear l C z) @@ -320,11 +322,13 @@ variable {S T : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] [NormedAddCommGroup T] [NormedSpace ℝ T] /-- Parameter pull, given by `pull l (P.prodMap (ContinuousLinearMap.id ℝ Plane)) u f`. -/ +@[expose] noncomputable def parameterPull (l : ℝ) (P : S →L[ℝ] T) (u : ℝ) (f : PressureStream.Lift T → ℝ) : PressureStream.Lift S → ℝ := pull l (P.prodMap (ContinuousLinearMap.id ℝ Plane)) u f /-- Cover pull, given by `pull l (P.prodMap (TemporalMeanUpdate.coverMap k)) u f`. -/ +@[expose] noncomputable def coverPull (l : ℝ) (P : S →L[ℝ] T) (k : ℕ) (u : ℝ) (f : PressureStream.Lift T → ℝ) : PressureStream.Lift S → ℝ := pull l (P.prodMap (TemporalMeanUpdate.coverMap k)) u f @@ -516,7 +520,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 +668,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 +721,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 : ℝ) : @@ -747,12 +751,14 @@ theorem radialFrequency_shift (h : ℝ) (n i : ℕ) (d M : ℝ) : rw [coverMap_radial, smul_smul, radialFrequency_scale] /-- The physical slow variables are `(z,τ)` with `τ=1-t`. -/ +@[expose] noncomputable def slowToChart (h : ℝ) (n : ℕ) : Plane →L[ℝ] Plane := (ChartScales.Q n ^ (-CoordinateAlgebra.D h) • ContinuousLinearMap.fst ℝ ℝ ℝ).prod (ChartScales.Q n ^ (-1 : ℝ) • ContinuousLinearMap.snd ℝ ℝ ℝ) /-- Physical to chart, given by `chartLinear (chartScale n) ((slowToChart h n).prodMap (TemporalMeanUpdate.coverMap i))`. -/ +@[expose] noncomputable def physicalToChart (h : ℝ) (n i : ℕ) : PressureStream.Lift Plane →L[ℝ] PressureStream.Lift Plane := chartLinear (chartScale n) ((slowToChart h n).prodMap (TemporalMeanUpdate.coverMap i)) @@ -764,6 +770,7 @@ noncomputable def physicalToChart (h : ℝ) (n i : ℕ) : /-- Normalize a chart field of scaling degree `a` on the actual physical slow variables and absolute auxiliary lift. -/ +@[expose] noncomputable def fieldOnPhysical (h : ℝ) (n i : ℕ) (a : ℝ) (f : PressureStream.Lift Plane → ℝ) : PressureStream.Lift Plane → ℝ := coverPull (chartScale n) (slowToChart h n) i (ChartScales.Q n ^ (-a)) f @@ -980,14 +987,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 @@ -999,6 +1006,7 @@ noncomputable def commonTemporalFields (r : ℕ → CorrectionState.Reconstructi ((0 : S), (r n).radialDirection) (commonTemporalPotential r h index fz n) /-- Common temporal alias, constructed using `PressureStream.divideRadius`. -/ +@[expose] noncomputable def commonTemporalAlias (r : ℕ → CorrectionState.ReconstructionData) (h : ℝ) (index : ℕ → ℕ) (f : ℕ → PressureStream.Lift S → ℝ) (n : ℕ) : PressureStream.Lift S → ℝ := @@ -1008,7 +1016,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)) : @@ -1253,11 +1261,13 @@ variable {S T : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] [NormedAddCommGroup T] [NormedSpace ℝ T] /-- Source moment, given by `PressureStream.pressureMass (fun z => z.1 ^ m * f z) s`. -/ +@[expose] noncomputable def sourceMoment (m : ℕ) (f : PressureStream.Lift S → ℝ) (s : S) : ℝ := PressureStream.pressureMass (fun z => z.1 ^ m * f z) 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..f4f4396a23 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))) @@ -110,8 +110,10 @@ noncomputable def viscosity (o : Operators D) (c : ℝ) (f : Field D) : Field D end Operators /-- Smooth on, given by `∀ n, ContDiffOn ℝ ∞ (f n) U`. -/ +@[expose] def SmoothOn (U : Set D) (f : Field D) : Prop := ∀ n, ContDiffOn ℝ ∞ (f n) U /-- Agree, given by `∀ n, EqOn (f n) (g n) U`. -/ +@[expose] def Agree (U : Set D) (f g : Field D) : Prop := ∀ n, EqOn (f n) (g n) U namespace SmoothOn @@ -348,43 +350,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,10 +426,11 @@ 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`. -/ +@[expose] noncomputable def radialRemainder (o : Operators D) (b m h : Triple D) : Field D := -o.time h.radial - o.radialDiv 1 (deltaRadialRadial b m h) - o.dz (deltaAxialRadial b m h) + o.invRadius * radialAngularRemainder m h + @@ -1078,6 +1081,7 @@ theorem meanClass_meanPressure_change /-- Reconstructed pressure, defined pointwise by `PressureStream.meanPressure d a b (M n) hab (v n) (gr o base mean W n)`. -/ +@[expose] noncomputable def reconstructedPressure (d a b : ℝ) (hab : a < b) (M : ℕ → ℝ) (v : ℕ → PressureStream.Plane) (o : Operators (PressureStream.Lift P)) (base mean : Triple (PressureStream.Lift P)) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/MeanMomentBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/MeanMomentBounds.lean index 752996330f..81f73cad8f 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 @@ -35,6 +35,7 @@ variable {D E F : Type} [NormedAddCommGroup D] [NormedSpace ℝ D] /-- A global finite-prefix bound, with the discrete band and slow polynomial still visible. This is a proved consequence of the flat weighted class below. -/ +@[expose] noncomputable def GlobalBandJets (ε S : ℕ → ℝ) (α : ℝ) (f : ℕ → D → E) : Prop := ∀ m : ℕ, ∃ C : ℝ, 0 ≤ C ∧ ∃ p : ℕ, ∀ n x, ∀ j : ℕ, j ≤ m → @@ -104,7 +105,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 @@ -169,6 +170,7 @@ variable [CompleteSpace F] /-- A finite affine average; coordinate projections and torus insertion are special cases. -/ +@[expose] noncomputable def affineAverage (L : D →L[ℝ] E) (v : E) (a b : ℝ) (f : E → F) (x : D) : F := ∫ t in a..b, f (L x + t • v) @@ -294,7 +296,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 → ℝ) : @@ -362,6 +364,7 @@ section PressureMass variable {P : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] /-- Lifted pressure mass, given by `PressureStream.pressureMass f x.2.1`. -/ +@[expose] noncomputable def liftedPressureMass (f : PressureStream.Lift P → ℝ) (x : PressureStream.Lift P) : ℝ := PressureStream.pressureMass f x.2.1 @@ -403,6 +406,7 @@ theorem meanClass_pressureMass_lift hf hs hab.le /-- Insert slow, bundling `toFun`, `map_add`, `map_smul`, `cont`. -/ +@[expose] noncomputable def insertSlow : P →L[ℝ] PressureStream.Lift P where toFun p := (0, (p, (0, 0))) map_add' := by intros; ext <;> simp @@ -452,6 +456,7 @@ theorem radialCoefficient_unweighted exact ⟨C, fun j hj x hx => hb j hj x ⟨hx.1.le, hx.2.le⟩⟩ /-- Radial weighted, given by `x.1 ^ k * f x`. -/ +@[expose] noncomputable def radialWeighted (k : ℕ) (f : ℝ × P → ℝ) (x : ℝ × P) : ℝ := x.1 ^ k * f x diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/MeanRankUpdate.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/MeanRankUpdate.lean index 652802765b..5b63b1fbf1 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. -/ @@ -253,6 +253,7 @@ section Families variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] /-- Scale family, defined pointwise by `U p.2 * H (p.2, p.1 / ell p.2)`. -/ +@[expose] noncomputable def scaleFamily (ell U : E → ℝ) (H : E × ℝ → ℝ) : ℝ × E → ℝ := fun p => U p.2 * H (p.2, p.1 / ell p.2) @@ -270,6 +271,7 @@ theorem scaleFamily_contDiffOn {S : Set E} {ell U : E → ℝ} {H : E × ℝ → /-- Angular family, given by `scaleFamily ell U (fun p => FiveRowRank.deltaV lam (C p.1) a b (normalizeDebt (ell p.1) (U p.1) (d p.1)) p.2)`. -/ +@[expose] noncomputable def angularFamily (lam a b : ℝ) (ell U C : E → ℝ) (d : E → Debt) : ℝ × E → ℝ := scaleFamily ell U (fun p => FiveRowRank.deltaV lam (C p.1) a b @@ -277,6 +279,7 @@ noncomputable def angularFamily (lam a b : ℝ) (ell U C : E → ℝ) (d : E → /-- Desired axial family, given by `scaleFamily ell U (fun p => FiveRowRank.gamma lam (C p.1) a b (normalizeDebt (ell p.1) (U p.1) (d p.1)) p.2)`. -/ +@[expose] noncomputable def desiredAxialFamily (lam a b : ℝ) (ell U C : E → ℝ) (d : E → Debt) : ℝ × E → ℝ := scaleFamily ell U (fun p => FiveRowRank.gamma lam (C p.1) a b @@ -371,6 +374,7 @@ section SlowStream variable {E : Type} [NormedAddCommGroup E] [NormedSpace ℝ E] /-- The slow source is independent of both periodic phase variables. -/ +@[expose] noncomputable def slowLift (f : ℝ × E → ℝ) : PressureStream.Lift E → ℝ := fun p => f (p.1, p.2.1) @@ -563,6 +567,7 @@ section NormalizedGeometry abbrev ModelPoint := PhysicalCoordinateBounds.Point /-- The fixed shaped amplitude on the untouched patch. -/ +@[expose] noncomputable def shapedAmplitude (B η : ℝ) : ℝ := B / (1 + η ^ 2) theorem shapedAmplitude_contDiff (B : ℝ) : ContDiff ℝ ∞ (shapedAmplitude B) := @@ -572,11 +577,14 @@ theorem shapedAmplitude_ne_zero {B : ℝ} (hB : B ≠ 0) (η : ℝ) : shapedAmplitude B η ≠ 0 := div_ne_zero hB (by positivity) /-- Model length, given by `Real.sqrt y.1`. -/ +@[expose] noncomputable def modelLength (y : ModelPoint) : ℝ := Real.sqrt y.1 /-- Model velocity, given by `y.1 ^ (-A)`. -/ +@[expose] noncomputable def modelVelocity (A : ℝ) (y : ModelPoint) : ℝ := y.1 ^ (-A) /-- Model amplitude, given by `shapedAmplitude B (y.2.2 / y.1 ^ PhysicalCoordinateBounds.D coord)`. -/ +@[expose] noncomputable def modelAmplitude (coord B : ℝ) (y : ModelPoint) : ℝ := shapedAmplitude B (y.2.2 / y.1 ^ PhysicalCoordinateBounds.D coord) @@ -599,12 +607,14 @@ theorem modelAmplitude_contDiffOn (coord B : ℝ) : /-- Angular model, given by `angularFamily lam a b modelLength (modelVelocity A) (modelAmplitude coord B) (fun _ => d) (y.2.1, y)`. -/ +@[expose] noncomputable def angularModel (coord A B lam a b : ℝ) (d : Debt) (y : ModelPoint) : ℝ := angularFamily lam a b modelLength (modelVelocity A) (modelAmplitude coord B) (fun _ => d) (y.2.1, y) /-- Axial model, given by `desiredAxialFamily lam a b modelLength (modelVelocity A) (modelAmplitude coord B) (fun _ => d) (y.2.1, y)`. -/ +@[expose] noncomputable def axialModel (coord A B lam a b : ℝ) (d : Debt) (y : ModelPoint) : ℝ := desiredAxialFamily lam a b modelLength (modelVelocity A) (modelAmplitude coord B) (fun _ => d) (y.2.1, y) @@ -795,7 +805,7 @@ section ChartFields abbrev ChartPoint := PressureStream.Lift PressureStream.Plane /-- `(R,(T,Z),Y)` to the actual inverse-coordinate variables `(T,R,Z)`. -/ -noncomputable def chartInput : ChartPoint →L[ℝ] ModelPoint := +@[expose] noncomputable def chartInput : ChartPoint →L[ℝ] ModelPoint := (((ContinuousLinearMap.fst ℝ ℝ ℝ).comp ((ContinuousLinearMap.fst ℝ PressureStream.Plane PressureStream.Plane).comp (ContinuousLinearMap.snd ℝ ℝ (PressureStream.Plane × PressureStream.Plane))))).prod @@ -816,26 +826,29 @@ 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)`. -/ -noncomputable def chartEta (coord : ℝ) (p : ChartPoint) : ℝ := +@[expose] noncomputable def chartEta (coord : ℝ) (p : ChartPoint) : ℝ := PhysicalCoordinateBounds.etaCoord coord (chartInput p) /-- Chart kernel, given by `(g ∘ PhysicalCoordinateBounds.inverseCoordinates coord) ∘ chartInput`. -/ +@[expose] noncomputable def chartKernel (coord : ℝ) (g : ModelPoint → ℝ) : ChartPoint → ℝ := (g ∘ PhysicalCoordinateBounds.inverseCoordinates coord) ∘ chartInput /-- Chart angular, given by `angularIncrement lam (shapedAmplitude B (chartEta coord p)) a b (Real.sqrt (chartQ coord p)) (chartQ coord p ^ (-A)) (d p) p.1`. -/ +@[expose] noncomputable def chartAngular (coord A B lam a b : ℝ) (d : ChartPoint → Debt) (p : ChartPoint) : ℝ := angularIncrement lam (shapedAmplitude B (chartEta coord p)) a b (Real.sqrt (chartQ coord p)) (chartQ coord p ^ (-A)) (d p) p.1 /-- Chart axial, constructed using `desiredAxialIncrement`. -/ +@[expose] noncomputable def chartAxial (coord A B lam a b : ℝ) (d : ChartPoint → Debt) (p : ChartPoint) : ℝ := desiredAxialIncrement lam (shapedAmplitude B (chartEta coord p)) a b (Real.sqrt (chartQ coord p)) (chartQ coord p ^ (-A)) (d p) p.1 @@ -890,6 +903,7 @@ end ChartFields section RankClass /-- Support band, given by `Prod.fst ⁻¹' Icc (Real.sqrt qlo * a) (Real.sqrt qhi * b)`. -/ +@[expose] noncomputable def supportBand (a b qlo qhi : ℝ) : Set ChartPoint := Prod.fst ⁻¹' Icc (Real.sqrt qlo * a) (Real.sqrt qhi * b) @@ -999,7 +1013,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 +1034,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 := @@ -1893,12 +1907,14 @@ section ActualChartStream /-- Slow chart desired, defined pointwise by `chartAxial coord A B lam a b (fun z => d z.2.1) (p.1, p.2, 0)`. -/ +@[expose] noncomputable def slowChartDesired (coord A B lam a b : ℝ) (d : PressureStream.Plane → Debt) : ℝ × PressureStream.Plane → ℝ := fun p => chartAxial coord A B lam a b (fun z => d z.2.1) (p.1, p.2, 0) /-- Actual chart potential, given by `PressureStream.streamPotential power lo hi M ((0 : PressureStream.Plane), v) (slowLift (slowChartDesired coord A B lam a b d))`. -/ +@[expose] noncomputable def actualChartPotential (coord A B lam a b power lo hi M : ℝ) (v : PressureStream.Plane) (d : PressureStream.Plane → Debt) : ChartPoint → ℝ := PressureStream.streamPotential power lo hi M ((0 : PressureStream.Plane), v) @@ -1906,7 +1922,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) @@ -2024,6 +2040,7 @@ end LocalSlowStream section ActualChartIdentities /-- Actual chart axial, constructed using `PressureStream.streamGamma`. -/ +@[expose] noncomputable def actualChartAxial (coord A B lam a b power lo hi M : ℝ) (v : PressureStream.Plane) (d : PressureStream.Plane → Debt) : ChartPoint → ℝ := PressureStream.streamGamma (PressureStream.physicalSpeed power M) ((0 : PressureStream.Plane), v) 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..54186079e2 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 @@ -38,10 +38,12 @@ abbrev Scalar := MeanIncrementBounds.Field Point abbrev Tensor := Fin 3 → Fin 3 → Scalar /-- Periodicity on the entire fast torus at each allowed slow point. -/ +@[expose] noncomputable def Periodic (U : Set Plane) (f : Scalar) : Prop := ∀ n, PhysicalMeanDomain.PeriodicOn U (f n) /-- A background coefficient is only used at positive physical radii. -/ +@[expose] noncomputable def PositivePeriodic (U : Set Plane) (f : Scalar) : Prop := ∀ n R, 0 < R → ∀ s, s ∈ U → FourierAlias.TorusPeriodic (fun Y => f n (R, (s, Y))) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/MixedAxisPreservation.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/MixedAxisPreservation.lean index eb03055215..34db535ad9 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 @@ -98,6 +98,7 @@ structure CopyPotential (h : ℝ) where cells : ∀ i, PhysicalCopyBounds.SupportCells (family i) /-- Field, given by `PhysicalCopyBounds.vectorSum p.family p.inner h p.width`. -/ +@[expose] noncomputable def CopyPotential.field {h : ℝ} (p : CopyPotential.{u} h) : VelocityField := PhysicalCopyBounds.vectorSum p.family p.inner h p.width @@ -124,6 +125,7 @@ structure AngularSupport (Ω : Set SpaceTime) where scalar (DirectAngularDiagonal.cylPoint w) = 0 /-- Field, given by `DirectAngularDiagonal.angularField D.scalar`. -/ +@[expose] noncomputable def AngularSupport.field {Ω : Set SpaceTime} (D : AngularSupport Ω) : VelocityField := DirectAngularDiagonal.angularField D.scalar @@ -159,6 +161,7 @@ theorem AngularSupport.field_add {Ω : Set SpaceTime} (D E : AngularSupport Ω) /-- Existing mean-field `AngularData` restricts to the required physical domain. Its actual scalar, normalization, and graph are unchanged. -/ +@[expose] noncomputable def AngularSupport.ofAngularData {U : Set DirectAngularDiagonal.Slow} (D : DirectAngularDiagonal.AngularData U) {Ω : Set SpaceTime} (hΩ : Ω ⊆ DirectAngularDiagonal.physicalDomain U) : AngularSupport Ω where @@ -203,6 +206,7 @@ structure PotentialStage (h : ℝ) (Ω : Set SpaceTime) where /-- Field, defined pointwise by `(∑ i : Fin p.waveCount, (p.waves i).field w) + ∑ i : Fin p.streamCount, (p.streams i).field w`. -/ +@[expose] noncomputable def PotentialStage.field {h : ℝ} {Ω : Set SpaceTime} (p : PotentialStage.{u} h Ω) : VelocityField := fun w => (∑ i : Fin p.waveCount, (p.waves i).field w) + @@ -223,6 +227,7 @@ theorem PotentialStage.zero_germ {h : ℝ} {Ω : Set SpaceTime} /-- The zeroth potential is the anchored base; all positive stages are the constructed copy/mean increments. -/ +@[expose] noncomputable def potentialSeries {h : ℝ} {Ω : Set SpaceTime} (base : VelocityField) (p : ℕ → PotentialStage.{u} h Ω) : ℕ → VelocityField | 0 => base @@ -243,18 +248,21 @@ theorem potentialSeries_zero_germ {h : ℝ} {Ω : Set SpaceTime} (base : Velocit /-- Potential diagonal, given by `SolenoidalDiagonal.potentialSum scales (PhysicalWaveSum.physicalQ h) (potentialSeries base p)`. -/ +@[expose] noncomputable def potentialDiagonal {h : ℝ} {Ω : Set SpaceTime} (base : VelocityField) (p : ℕ → PotentialStage.{u} h Ω) (scales : ℕ → ℝ) : VelocityField := SolenoidalDiagonal.potentialSum scales (PhysicalWaveSum.physicalQ h) (potentialSeries base p) /-- Direct diagonal, given by `DirectAngularDiagonal.angularSum scales (PhysicalWaveSum.physicalQ h) (fun j => (D j).scalar)`. -/ +@[expose] noncomputable def directDiagonal (h : ℝ) {Ω : Set SpaceTime} (D : ℕ → AngularSupport Ω) (scales : ℕ → ℝ) : VelocityField := DirectAngularDiagonal.angularSum scales (PhysicalWaveSum.physicalQ h) (fun j => (D j).scalar) /-- Mixed diagonal, given by `DirectAngularDiagonal.mixedVelocity scales (PhysicalWaveSum.physicalQ h) (potentialSeries base p) (fun j => (D j).scalar)`. -/ +@[expose] noncomputable def mixedDiagonal {h : ℝ} {Ω : Set SpaceTime} (base : VelocityField) (p : ℕ → PotentialStage.{u} h Ω) (D : ℕ → AngularSupport Ω) (scales : ℕ → ℝ) : VelocityField := @@ -393,18 +401,21 @@ theorem origin_blowup {h : ℝ} {Ω : Set SpaceTime} /-! ## Finite initialization stays in stage zero -/ /-- Initialized base, defined pointwise by `base w + initial.field w`. -/ +@[expose] noncomputable def initializedBase {h : ℝ} {Ω : Set SpaceTime} (base : VelocityField) (initial : PotentialStage.{u} h Ω) : VelocityField := fun w => base w + initial.field w /-- This is the manuscript's stage numbering: the finite initialization and base share cutoff zero; each subsequent stage has its own cutoff. -/ +@[expose] noncomputable def initializedSeries {h : ℝ} {Ω : Set SpaceTime} (base : VelocityField) (initial : PotentialStage.{u} h Ω) (p : ℕ → PotentialStage.{u} h Ω) : ℕ → VelocityField := potentialSeries (initializedBase base initial) p /-- Initialized diagonal, given by `mixedDiagonal (initializedBase base initial) p D scales`. -/ +@[expose] noncomputable def initializedDiagonal {h : ℝ} {Ω : Set SpaceTime} (base : VelocityField) (initial : PotentialStage.{u} h Ω) (p : ℕ → PotentialStage.{u} h Ω) (D : ℕ → AngularSupport Ω) @@ -494,6 +505,7 @@ theorem initialized_origin_blowup {h : ℝ} {Ω : Set SpaceTime} /-! ## The actual small-similarity-parameter domain -/ /-- Local domain, given by `{w | w.1 < 1 ∧ PhysicalWaveSum.physicalQ h w < qbig}`. -/ +@[expose] noncomputable def localDomain (h qbig : ℝ) : Set SpaceTime := {w | w.1 < 1 ∧ PhysicalWaveSum.physicalQ h w < qbig} @@ -630,6 +642,7 @@ theorem local_initialized_final_speedUnbounded (upper : ℝ) (B : ℕ) end FinalBase /-- The exponent belongs to the already selected, constructed profile. -/ +@[expose] noncomputable def constructedExponent : ℝ := FinalSlowBase.actualProfile.outgoing.data.h theorem constructed_origin_blowup (upper : ℝ) (B : ℕ) {qbig : ℝ} (hqbig : 0 < qbig) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/MixedCandidateAssembly.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/MixedCandidateAssembly.lean index d597840b82..a05244b38d 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 @@ -131,6 +131,7 @@ noncomputable def potentialStages (upper : ℝ) (bandFloor : ℕ) {qbig : ℝ} /-- Pressure is recorded as the actual base plus its initialization change, followed by the pressure differences of full correction stages. -/ +@[expose] noncomputable def pressureStages (upper : ℝ) (bandFloor : ℕ) (initial : PressureField) (stages : ℕ → PressureField) : ℕ → PressureField := fun j w => if j = 0 then FinalSlowBase.pressure H v upper bandFloor w + initial w diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/MixedDiagonalExtensions.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/MixedDiagonalExtensions.lean index 319667e4fe..9c3f086e3d 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 @@ -107,6 +107,7 @@ theorem offplane_extension_local {h qbig : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) /-- Uniform outer support is needed only where the raw stage is used. The constant is shared by all positive stages in the central-plane theorem. -/ +@[expose] def SublevelShrinkingSupport (h C qbig : ℝ) (f : SpaceTime → V) : Prop := ∀ w, w.1 < 1 → PhysicalWaveSum.physicalQ h w < qbig → f w ≠ 0 → AnnularEndpoint.radius w ≤ AnnularEndpoint.outerRadius h C w diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/MixedDiagonalResidual.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/MixedDiagonalResidual.lean index 8d92fd06ae..fa05b12894 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 @@ -56,7 +56,7 @@ noncomputable def pressure : Component := 2 end Component /-- Component space, with branches according to `c = 2`. -/ -@[reducible] noncomputable def ComponentSpace (c : Component) : Type := +@[expose, reducible] noncomputable def ComponentSpace (c : Component) : Type := if c = 2 then ℝ else Space noncomputable instance (c : Component) : NormedAddCommGroup (ComponentSpace c) := @@ -398,7 +398,7 @@ end end -@[expose] public section +public section noncomputable section @@ -409,22 +409,26 @@ open scoped Topology ContDiff BigOperators /-- Velocity, defined pointwise by `SolenoidalDiagonal.velocitySum a q A z + SolenoidalDiagonal.potentialSum a q B z`. -/ +@[expose] def velocity (a : ℕ → ℝ) (q : SpaceTime → ℝ) (A B : ℕ → VelocityField) : VelocityField := fun z => SolenoidalDiagonal.velocitySum a q A z + SolenoidalDiagonal.potentialSum a q B z /-- Stage zero remains in every nonempty uncut prefix. -/ +@[expose] def uncutVelocity (A B : ℕ → VelocityField) (J : ℕ) : VelocityField := fun z => SpatialCurl.spatialCurl (DiagonalJetBounds.uncutPrefix A (J + 1)) z + DiagonalJetBounds.uncutPrefix B (J + 1) z /-- Pressure, given by `SolenoidalDiagonal.potentialSum a q P`. -/ +@[expose] def pressure (a : ℕ → ℝ) (q : SpaceTime → ℝ) (P : ℕ → PressureField) : PressureField := SolenoidalDiagonal.potentialSum a q P /-- Residual, defined pointwise by `navierStokesResidual (velocity a q A B) (pressure a q P) z.1 z.2`. -/ +@[expose] def residual (a : ℕ → ℝ) (q : SpaceTime → ℝ) (A B : ℕ → VelocityField) (P : ℕ → PressureField) : VelocityField := fun z => navierStokesResidual (velocity a q A B) (pressure a q P) z.1 z.2 diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/MixedPeriodicAssembly.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/MixedPeriodicAssembly.lean index af38c4dd6c..ed328ef6e6 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 @@ -37,6 +37,7 @@ open ProblemStatement Set Filter open scoped Topology ContDiff BigOperators /-- The direct field is added after taking the curl. -/ +@[expose] def velocity (A v : VelocityField) : VelocityField := fun z => SpatialCurl.spatialCurl A z + v z @@ -45,11 +46,13 @@ def cutVelocity (A v : VelocityField) : VelocityField := fun z => SpatialLocalization.cutVelocity A z + SpatialLocalization.cutPotential v z /-- Periodize the cut potential and the cut direct field separately. -/ +@[expose] def periodicVelocity (A v : VelocityField) : VelocityField := fun z => SpatialLocalization.periodicVelocity A z + PeriodicLocalization.periodize (SpatialLocalization.cutPotential v) z /-- Original residual, defined pointwise by `navierStokesResidual (velocity A v) p z.1 z.2`. -/ +@[expose] def originalResidual (A v : VelocityField) (p : PressureField) : VelocityField := fun z => navierStokesResidual (velocity A v) p z.1 z.2 diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ModulatedCone.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ModulatedCone.lean index bd14e06714..08bc5a3a9e 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) @@ -1366,6 +1367,7 @@ namespace Repaired open ProfileHistories StressActivation /-- The actual physical correction, retaining the existing axis pressure. -/ +@[expose] noncomputable def profileRepair {D : RadialDomain} (P : Profiles D) (patch : FiveProfileMoments.Patch) (A : ℝ → ℝ) (c : ℝ → ModulatedHistories.Coeff) (hA : ContDiff ℝ ∞ A) (hc : ContDiff ℝ ∞ c) : Profiles D where 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..0cd4ab5ef2 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 @@ -275,6 +275,7 @@ theorem fields_eq {p : Point} (hX : 0 ≤ p.1) (heta : p.2 ∈ d.target) : d.extended_eq _ _ hX (abs_lt.mpr heta).le⟩ /-- Profiles, constructed using `ModulatedHistories.profiles`. -/ +@[expose] noncomputable def profiles : Profiles (ModulatedHistories.stripDomain univ isOpen_univ) := ModulatedHistories.profiles univ isOpen_univ d.f d.U F.axisDatum d.f_smooth.contDiffOn d.U_smooth.contDiffOn @@ -341,6 +342,7 @@ end ParameterData /-- The first reserved five-row patch, belonging to the very same outgoing schedule and physical dilation as the nominal witness. -/ +@[expose] noncomputable def repairPatch {F : OutgoingProfile.Profile} (W : NominalProfile.Witness F) : FiveProfileMoments.Patch := ReservedPatches.momentPatch F W.controls.radius W.controls.radius_pos .modulation @@ -559,6 +561,7 @@ theorem domain_nonnegative {p : Point} (hX : 0 ≤ p.1) (heta : p.2 ∈ d.parame mem_univ _, heta⟩ /-- Output F, constructed using `AnnularAuxiliary.transplant`. -/ +@[expose] noncomputable def outputF (r : d.Realization) (N : ℕ) (c : ℝ → ModulatedHistories.Coeff) : Field := AnnularAuxiliary.transplant W.profiles.f d.parameter.f @@ -567,6 +570,7 @@ noncomputable def outputF (r : d.Realization) (N : ℕ) (ModulatedHistories.localizedF d.modulation r d.parameter.f N)) /-- Output U, constructed using `AnnularAuxiliary.transplant`. -/ +@[expose] noncomputable def outputU (r : d.Realization) (N : ℕ) (c : ℝ → ModulatedHistories.Coeff) : Field := AnnularAuxiliary.transplant W.profiles.U d.parameter.U @@ -957,6 +961,7 @@ theorem relaxedDomain_open {D : RadialDomain} (P : Profiles D) (h : ℝ) : exact ⟨hq, ⟨hq.2.2.2.1, hqpr, hqsp⟩⟩ /-- True domain, given by `{p | p ∈ relaxedDomain P h ∧ NominalConeAssembly.IsTrue P h p}`. -/ +@[expose] noncomputable def trueDomain {D : RadialDomain} (P : Profiles D) (h : ℝ) : Set Point := {p | p ∈ relaxedDomain P h ∧ NominalConeAssembly.IsTrue P h p} @@ -1142,6 +1147,7 @@ variable {F : OutgoingProfile.Profile} {W : NominalProfile.Witness F} {d : LoopData W} (v : Witness d) /-- Slow parameters, given by `d.parameters ∩ AssembledSlowBase.nominalParameters W`. -/ +@[expose] noncomputable def slowParameters (_v : Witness d) : Set ℝ := d.parameters ∩ AssembledSlowBase.nominalParameters W 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..54ea9c26db 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 @@ -126,6 +126,7 @@ section Support variable {S : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] /-- Support, given by `∀ n, SupportedGauge a b ell U (f n)`. -/ +@[expose] def Support (a b : ℝ) (ell : S → ℝ) (U : Set S) (f : ScalarField (PressureStream.Lift S)) : Prop := ∀ n, SupportedGauge a b ell U (f n) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/NativeBandExtension.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/NativeBandExtension.lean index 831d7e63a4..adff1d6e8f 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 @@ -210,6 +210,7 @@ theorem projectedPressure_contDiffAt (frequency : ℝ) end LocalAlgebra /-- Native Q, given by `SimilarityCoordinates.coordinateQ (2 * h) (x.1.2.2, x.1.2.1)`. -/ +@[expose] noncomputable def nativeQ (h : ℝ) (x : Native) : ℝ := SimilarityCoordinates.coordinateQ (2 * h) (x.1.2.2, x.1.2.1) @@ -336,6 +337,7 @@ structure ClosedMargins (vr vt : TorusInverse.Plane) where (fun k => PrimaryTargetBounds.actualTarget v p k) /-- Base velocity, constructed using `primaryVelocity`. -/ +@[expose] noncomputable def baseVelocity (hr0 : 0 < r0) (vr vt : TorusInverse.Plane) (j : Fin 2) : PrimaryGeometryAssembly.Index W a.N → Native → ProblemStatement.Space := primaryVelocity (PrimaryGeometryAssembly.construction H v a hr0) @@ -392,6 +394,7 @@ theorem bandPressure_eq_phasePressure (hr0 : 0 < r0) (vr vt : TorusInverse.Plane end Prepared /-- Radial interior, constructed using `WaveEdgeExtension.windowDomain`. -/ +@[expose] noncomputable def radialInterior {F : OutgoingProfile.Profile} (W : NominalProfile.Witness F) : Set Native := WaveEdgeExtension.windowDomain WaveEdgeExtension.nativeSlowDomain (WaveEdgeExtension.nativeRadius @@ -809,6 +812,7 @@ theorem band_pair_band_edge_jets (M : ClosedMargins H v a vr vt) /-- The full open radial domain, preserving the original native growth function exactly and adding the flat band/transverse boundary points. -/ +@[expose] noncomputable def radialDomain : JetDomain (PrimaryGeometryAssembly.Index W a.N) Native where scale := (ActualSignedGeometry.nativeDomain H v a).scale carrier := fun _ => radialInterior W @@ -882,17 +886,20 @@ variable {F : OutgoingProfile.Profile} {W : NominalProfile.Witness F} /-- Envelope, given by `pulseEnvelope (PrimaryGeometryAssembly.construction H v a hr0) (ActualSignedGeometry.pulseCoordinates H v a) j`. -/ +@[expose] noncomputable def envelope (j : Fin 2) : PrimaryGeometryAssembly.Index W a.N → Native → ℝ := pulseEnvelope (PrimaryGeometryAssembly.construction H v a hr0) (ActualSignedGeometry.pulseCoordinates H v a) j /-- Velocity weight, constructed using `Real.sqrt`. -/ +@[expose] noncomputable def velocityWeight (j : Fin 2) (L : PrimaryGeometryAssembly.Index W a.N) (x : Native) : ℝ := Real.sqrt (ChartScales.epsilon F.data.h (BaseChartJets.cellBand L)) * Real.sqrt (PrimaryTargetBounds.movingWeight W x.1) * envelope H v a hr0 j L x /-- Pressure weight, constructed using `ChartScales.epsilon`. -/ +@[expose] noncomputable def pressureWeight (j : Fin 2) (L : PrimaryGeometryAssembly.Index W a.N) (x : Native) : ℝ := ChartScales.epsilon F.data.h (BaseChartJets.cellBand L) * @@ -971,6 +978,7 @@ theorem band_pair_native_regular (M : ClosedMargins H v a vr vt) (j : Fin 2) /-- Pre outer velocity, given by `(SquaredPartition.dyadicProfile (nativeQ F.data.h x) * PartitionedCovariance.cutoff r0 x.2.1) • baseVelocity H v a hr0 vr vt j L x`. -/ +@[expose] noncomputable def preOuterVelocity (j : Fin 2) (L : PrimaryGeometryAssembly.Index W a.N) (x : Native) : ProblemStatement.Space := (SquaredPartition.dyadicProfile (nativeQ F.data.h x) * PartitionedCovariance.cutoff r0 x.2.1) • 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..695d0f5d5e 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`. -/ @@ -276,6 +276,7 @@ noncomputable def initialBand (Λ : ℝ) : Set InnerPoint := Icc (0 : ℝ) (4 / Λ) ×ˢ ReferencePath.parameterInterval /-- Initial core, given by `Ioo (0 : ℝ) (4 / Λ) ×ˢ ReferencePath.parameterInterval`. -/ +@[expose] noncomputable def initialCore (Λ : ℝ) : Set InnerPoint := Ioo (0 : ℝ) (4 / Λ) ×ˢ ReferencePath.parameterInterval diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/NaturalCore.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/NaturalCore.lean index 21df41a34e..912a642f15 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 @@ -41,10 +41,12 @@ private theorem infty_add_one_le : (∞ : WithTop ℕ∞) + 1 ≤ ∞ := by simpa only [ENat.coe_top_add_one] using (le_rfl : (∞ : WithTop ℕ∞) ≤ ∞) /-- Physical Q, given by `SimilarityCoordinates.coordinateQ (2 * h) (1 - p.1, p.2.2)`. -/ +@[expose] noncomputable def physicalQ (h : ℝ) (p : ProfilePoint) : ℝ := SimilarityCoordinates.coordinateQ (2 * h) (1 - p.1, p.2.2) /-- Physical eta, given by `SimilarityCoordinates.coordinateEta (2 * h) (1 - p.1, p.2.2)`. -/ +@[expose] noncomputable def physicalEta (h : ℝ) (p : ProfilePoint) : ℝ := SimilarityCoordinates.coordinateEta (2 * h) (1 - p.1, p.2.2) 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..2c9a0715bf 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 @@ -1544,9 +1544,9 @@ theorem original_interval_interior : /-- Complex D, given by `1 - z ^ 2`. -/ def complexD (z : ℂ) : ℂ := 1 - z ^ 2 /-- Complex L, given by `1 - 2 * (h : ℂ) * z ^ 2`. -/ -def complexL (h : ℝ) (z : ℂ) : ℂ := 1 - 2 * (h : ℂ) * z ^ 2 +@[expose] 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) @@ -1606,6 +1606,7 @@ theorem denominator_ne_zero_on_real (h j : ℝ) {σ : ℝ} (hσ : 0 < σ) (x : (sq_nonneg (NaturalAxisData.H h j x)) (sq_pos_of_pos hσ)) /-- The open region where all fixed rational expressions and pressure are analytic. -/ +@[expose] def regularSet (h j σ : ℝ) : Set ℂ := PressureDatum.strip ∩ {z | complexL h z ≠ 0} ∩ {z | denominator h j σ z ≠ 0} @@ -1670,6 +1671,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 +1919,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 +2054,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 +2080,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 +2138,7 @@ end end -@[expose] public section +public section noncomputable section @@ -2132,21 +2148,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 +2220,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 +2317,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 +2390,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 +2687,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 +2725,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..c285dce243 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 @@ -1026,7 +1026,7 @@ structure PreparedWitness (F : OutgoingProfile.Profile) (N : ℕ) (delta radiusF /-- Controls, given by `NominalProfile.Controls.ofContinuation W.axis W.continuation W.shapeTime W.shapeTime_pos`. -/ -noncomputable def PreparedWitness.controls {F : OutgoingProfile.Profile} {N : ℕ} +@[expose] noncomputable def PreparedWitness.controls {F : OutgoingProfile.Profile} {N : ℕ} {delta radiusFloor : ℝ} (W : PreparedWitness F N delta radiusFloor) : NominalProfile.Controls W.axis := NominalProfile.Controls.ofContinuation W.axis W.continuation W.shapeTime W.shapeTime_pos @@ -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 @@ -1353,6 +1353,7 @@ open NavierStokes.StressActivation namespace NavierStokes.NominalConeAssembly /-- Is true, constructed using `ActivationContinuation.IsRelaxed`. -/ +@[expose] noncomputable def IsTrue {D : RadialDomain} (P : Profiles D) (h : ℝ) (p : Point) : Prop := ActivationContinuation.IsRelaxed P h p ∧ 2 < ActivationContinuation.shearSize @@ -1379,7 +1380,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 +1665,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 _) @@ -2347,7 +2348,7 @@ variable {F : Profile} (G : CompensatedFamily F) /-- The actual heat witness and the nominal fields are constructed only after the same physical radius has met the previously fixed bound. -/ -noncomputable def assemble {D : ℝ} (hF : OutgoingProfile.Specification F D) +@[expose] noncomputable def assemble {D : ℝ} (hF : OutgoingProfile.Specification F D) (A : AxisStage F) (c : Controls A) (hr : G.radiusFloor ≤ c.radius) (hsep : c.separation ≤ Real.exp (-8)) (hs : ∀ eta ∈ HeatedOutgoing.parameterDomain, SmallDebt F c.debt eta) : NominalProfile.Witness @@ -2697,10 +2698,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..cc18e95ed3 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 @@ -101,12 +101,14 @@ theorem normalization_pos : 0 < A.normalization := A.scale_pos A.preparation.delta_pos).trans A.normalization_large) /-- Natural, given by `A.chosenNatural`. -/ +@[expose] noncomputable def natural : NaturalEntrance.EntranceProfile A.preparation.inputs A.scale A.normalization := A.chosenNatural /-- Reference input, given by `ReferencePath.Input.ofNatural A.scale_pos A.natural.profile.family`. -/ +@[expose] noncomputable def referenceInput : ReferencePath.Input := ReferencePath.Input.ofNatural A.scale_pos A.natural.profile.family @@ -116,6 +118,7 @@ theorem reference_U : A.referenceInput.U = A.natural.profile.family.U := rfl /-- Reference, given by `A.referenceInput.histories hδ hδsmall F.axisDatum F.axisDatum_contDiff`. -/ +@[expose] noncomputable def reference (δ : ℝ) (hδ : 0 < δ) (hδsmall : 2 * δ < ReferencePath.rampLimit) : ProfileHistories.Profiles A.referenceInput.radialDomain := A.referenceInput.histories hδ hδsmall F.axisDatum F.axisDatum_contDiff @@ -124,6 +127,7 @@ theorem reference_pressure0 (δ : ℝ) (hδ : 0 < δ) (hδsmall : 2 * δ < Refer (A.reference δ hδ hδsmall).pressure0 = F.axisDatum := rfl /-- The stocks used in ACT come from this exact REF profile. -/ +@[expose] noncomputable def activation (δ : ℝ) (hδ : 0 < δ) (hδsmall : 2 * δ < ReferencePath.rampLimit) : TransitionRamp.StockReference ReferencePath.parameterInterval := @@ -164,11 +168,14 @@ theorem exists_axis_stage (F : Profile) (hP : 2 ≤ F.data.core.P) {j : ℝ} /-! ## Matching geometry: the radius is derived from the same normalization -/ /-- Xi, given by `110`. -/ +@[expose] noncomputable def Xi : ℝ := 110 /-- Matching radius, given by `ShapeTransition.resetRadius Xi C F.data.core.P`. -/ +@[expose] noncomputable def matchingRadius (F : Profile) (C : ℝ) : ℝ := ShapeTransition.resetRadius Xi C F.data.core.P /-- Match fraction, given by `Real.exp (-5)`. -/ +@[expose] noncomputable def matchFraction : ℝ := Real.exp (-5) /-- Match radius, given by `matchingRadius F C * matchFraction`. -/ noncomputable def matchRadius (F : Profile) (C : ℝ) : ℝ := matchingRadius F C * matchFraction @@ -196,19 +203,20 @@ theorem eventually_matching_geometry (F : Profile) (T radiusFloor normFloor : exact ⟨hC, hn, hr, hs⟩ /-- Reset patch, bundling `left`, `right`, `left_pos`, `ordered`. -/ -noncomputable def resetPatch : FiveProfileMoments.Patch where +@[expose] noncomputable def resetPatch : FiveProfileMoments.Patch where left := Real.exp (-6) right := Real.exp (-5) left_pos := Real.exp_pos _ ordered := Real.exp_lt_exp.mpr (by norm_num) /-- Ideal amplitude, given by `F.data.core.P * OutgoingSchedule.shape eta`. -/ +@[expose] noncomputable def idealAmplitude (F : Profile) (eta : ℝ) : ℝ := F.data.core.P * OutgoingSchedule.shape 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,14 +254,16 @@ 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)`. -/ +@[expose] noncomputable def resetCoefficients (F : Profile) (debt : ℝ → Debt) (eta : ℝ) : Coeff := resetSolver.solve (normalizedDebt F debt eta) /-- Small debt, given by `‖normalizedDebt F debt eta‖ < resetSolver.radius`. -/ +@[expose] def SmallDebt (F : Profile) (debt : ℝ → Debt) (eta : ℝ) : Prop := ‖normalizedDebt F debt eta‖ < resetSolver.radius @@ -282,21 +292,23 @@ 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 (resetCoefficients F debt p.2) p.1`. -/ +@[expose] noncomputable def correctedU (F : Profile) (U : Field) (debt : ℝ → Debt) (p : Point) : ℝ := U p + idealAmplitude F p.2 * FiveProfileMoments.u resetPatch (resetCoefficients F debt p.2) p.1 /-- Corrected E, given by `E p + idealAmplitude F p.2 * FiveProfileMoments.e resetPatch (resetCoefficients F debt p.2) p.1`. -/ +@[expose] noncomputable def correctedE (F : Profile) (E : Field) (debt : ℝ → Debt) (p : Point) : ℝ := E p + idealAmplitude F p.2 * FiveProfileMoments.e resetPatch (resetCoefficients F debt p.2) p.1 @@ -358,6 +370,7 @@ theorem corrected_moments (F : Profile) (U E : Field) (debt : ℝ → Debt) (eta /-- Restored U, given by `let s := ShapeTransition.radialSwitch (XR * Real.exp (-8)) 1 p.1 (1 - s) * old p + s * idealU p.2`. -/ +@[expose] noncomputable def restoredU (XR : ℝ) (old : Field) (p : Point) : ℝ := let s := ShapeTransition.radialSwitch (XR * Real.exp (-8)) 1 p.1 (1 - s) * old p + s * idealU p.2 @@ -390,12 +403,13 @@ theorem restoredU_after {XR x : ℝ} (hXR : 0 < XR) (hx : Real.exp (-7) ≤ x) /-- Prepared E, given by `Real.sqrt (2 * (matchingRadius F C * p.1)) * ShapeTransition.shapeField Xi T li oldf (matchingRadius F C * p.1, p.2)`. -/ -noncomputable def preparedE (F : Profile) (C T : ℝ) (li : ℝ → ℝ) (oldf : Field) +@[expose] noncomputable def preparedE (F : Profile) (C T : ℝ) (li : ℝ → ℝ) (oldf : Field) (p : Point) : ℝ := Real.sqrt (2 * (matchingRadius F C * p.1)) * ShapeTransition.shapeField Xi T li oldf (matchingRadius F C * p.1, p.2) /-- Prepared U, given by `restoredU (matchingRadius F C) oldU (matchingRadius F C * p.1, p.2)`. -/ +@[expose] noncomputable def preparedU (F : Profile) (C : ℝ) (oldU : Field) (p : Point) : ℝ := restoredU (matchingRadius F C) oldU (matchingRadius F C * p.1, p.2) @@ -474,9 +488,11 @@ noncomputable def actualDebt (F : Profile) (C T : ℝ) (li : ℝ → ℝ) (oldf moments (baseU F C oldU) (baseE F C T li oldf) matchFraction eta /-- Joined U, given by `correctedU F (baseU F C oldU) (actualDebt F C T li oldf oldU)`. -/ +@[expose] noncomputable def joinedU (F : Profile) (C T : ℝ) (li : ℝ → ℝ) (oldf oldU : Field) : Field := correctedU F (baseU F C oldU) (actualDebt F C T li oldf oldU) /-- Joined E, given by `correctedE F (baseE F C T li oldf) (actualDebt F C T li oldf oldU)`. -/ +@[expose] noncomputable def joinedE (F : Profile) (C T : ℝ) (li : ℝ → ℝ) (oldf oldU : Field) : Field := correctedE F (baseE F C T li oldf) (actualDebt F C T li oldf oldU) @@ -644,21 +660,26 @@ variable {F : Profile} {A : AxisStage F} (c : Controls A) /-- Reference, given by `A.activation c.referenceWidth c.referenceWidth_pos c.referenceWidth_small`. -/ +@[expose] noncomputable def reference : TransitionRamp.StockReference ReferencePath.parameterInterval := A.activation c.referenceWidth c.referenceWidth_pos c.referenceWidth_small /-- Seed F, given by `c.reference.physicalF c.activationTime c.kappa c.axialWidth c.angularWidth`. -/ +@[expose] noncomputable def seedF : Field := c.reference.physicalF c.activationTime c.kappa c.axialWidth c.angularWidth /-- Seed U, given by `c.reference.physicalU c.activationTime c.kappa c.axialWidth`. -/ +@[expose] noncomputable def seedU : Field := c.reference.physicalU c.activationTime c.kappa c.axialWidth /-- Initial shape, given by `c.reference.endpointLog c.activationTime c.kappa c.axialWidth c.angularWidth A.normalization`. -/ +@[expose] noncomputable def initialShape : ℝ → ℝ := c.reference.endpointLog c.activationTime c.kappa c.axialWidth c.angularWidth A.normalization /-- Initial axial, given by `c.reference.endpointU c.activationTime c.kappa c.axialWidth`. -/ +@[expose] noncomputable def initialAxial : ℝ → ℝ := c.reference.endpointU c.activationTime c.kappa c.axialWidth @@ -729,21 +750,26 @@ 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`. -/ +@[expose] noncomputable def normalizedE : Field := joinedE F A.normalization c.shapeTime c.initialShape c.seedF c.seedU /-- Normalized U, given by `joinedU F A.normalization c.shapeTime c.initialShape c.seedF c.seedU`. -/ +@[expose] noncomputable def normalizedU : Field := joinedU F A.normalization c.shapeTime c.initialShape c.seedF c.seedU /-- Radius, given by `matchingRadius F A.normalization`. -/ +@[expose] noncomputable def radius (_c : Controls A) : ℝ := matchingRadius F A.normalization /-- E, given by `c.normalizedE (p.1 / c.radius, p.2)`. -/ +@[expose] noncomputable def E (p : Point) : ℝ := c.normalizedE (p.1 / c.radius, p.2) /-- U, given by `c.normalizedU (p.1 / c.radius, p.2)`. -/ +@[expose] noncomputable def U (p : Point) : ℝ := c.normalizedU (p.1 / c.radius, p.2) /-- H, given by `Real.sqrt (2 * p.1) * c.E p`. -/ noncomputable def H (p : Point) : ℝ := Real.sqrt (2 * p.1) * c.E p @@ -814,7 +840,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 @@ -886,6 +912,7 @@ theorem controls_exist {F : Profile} (A : AxisStage F) (hscale : 1 ≤ A.scale) /-! ## Regular parameter-dependent prefix integrals -/ /-- Scaled domain, bundling `carrier`, `isOpen`, `scale_mem`, `have`. -/ +@[expose] noncomputable def scaledDomain (D : ProfileHistories.RadialDomain) (R : ℝ) : ProfileHistories.RadialDomain where carrier := {p | (R * p.1, p.2) ∈ D.carrier} @@ -898,6 +925,7 @@ noncomputable def scaledDomain (D : ProfileHistories.RadialDomain) (R : ℝ) : /-- Regular density, given by `![P.U p, P.H p, P.transportDensity p, P.energyDensity p, P.f p ^ 2]`. -/ +@[expose] noncomputable def regularDensity {D : ProfileHistories.RadialDomain} (P : ProfileHistories.Profiles D) (p : Point) : Debt := ![P.U p, P.H p, P.transportDensity p, P.energyDensity p, P.f p ^ 2] @@ -943,7 +971,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 @@ -965,6 +993,7 @@ theorem restored_seed_smooth : (hs.contDiffOn.mul (idealU_smooth.comp contDiff_snd).contDiffOn) /-- Prepared domain, given by `scaledDomain A.referenceInput.radialDomain c.radius`. -/ +@[expose] noncomputable def preparedDomain : ProfileHistories.RadialDomain := scaledDomain A.referenceInput.radialDomain c.radius @@ -975,6 +1004,7 @@ theorem preparedDomain_nonnegative {p : Point} (hX : 0 ≤ p.1) /-- Prepared profiles, bundling `f`, `U`, `f_smooth`, `U_smooth` and the required compatibility proofs. -/ +@[expose] noncomputable def preparedProfiles : ProfileHistories.Profiles c.preparedDomain where f := fun p => Real.sqrt c.radius * c.shapedF (c.radius * p.1, p.2) U := preparedU F A.normalization c.seedU @@ -1412,8 +1442,10 @@ theorem outgoing_density_integrable (F : Profile) (eta r : ℝ) (i : Fin 5) : rw [div_div, mul_comm x 2] /-- Dilate field, given by `f (p.1 / R, p.2)`. -/ +@[expose] noncomputable def dilateField (R : ℝ) (f : Field) (p : Point) : ℝ := f (p.1 / R, p.2) /-- Dilation factor, given by `![R, R * Real.sqrt R, R * Real.sqrt R, R, 1]`. -/ +@[expose] noncomputable def dilationFactor (R : ℝ) : Debt := ![R, R * Real.sqrt R, R * Real.sqrt R, R, 1] theorem density_dilate (R : ℝ) (hR : 0 < R) (U E : Field) (eta : ℝ) {x : ℝ} (hx : 0 < x) @@ -1544,12 +1576,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, @@ -1561,6 +1593,7 @@ noncomputable def restoreRows (r b eta : ℝ) : Debt := ShapeTransition.restoreDebtJ c.initialAxial (idealAmplitude F) r b eta, ShapeTransition.restoreDebtS c.initialAxial r b eta, 0] /-- Manuscript debt as an element of `Debt`. -/ +@[expose] noncomputable def manuscriptDebt (eta : ℝ) : Debt := ![ShapeTransition.resetDebtM c.rawU c.initialAxial c.separation matchFraction eta, ShapeTransition.resetDebtI c.radius c.rawF (idealAmplitude F) c.separation eta, @@ -1700,6 +1733,7 @@ theorem normalizedDebt_smooth : /-- Smallness is a transparent test on the already constructed debt. Its strict sublevel set is open, so successful repair gives ordinary smoothness. -/ +@[expose] noncomputable def admissibleDomain : ProfileHistories.RadialDomain where carrier := {p | p ∈ A.referenceInput.radialDomain.carrier ∧ SmallDebt F c.debt p.2} isOpen := by @@ -1722,6 +1756,7 @@ theorem admissible_nonnegative {p : Point} (hX : 0 ≤ p.1) ⟨⟨lt_of_lt_of_le (by norm_num) (mul_nonneg A.scale_pos.le hX), hη⟩, hs⟩ /-- Profiles, bundling `f`, `U`, `f_smooth`, `U_smooth` and the required compatibility proofs. -/ +@[expose] noncomputable def profiles (hsep : c.separation ≤ Real.exp (-8)) : ProfileHistories.Profiles c.admissibleDomain where f := c.f @@ -1880,6 +1915,7 @@ end Controls /-! ## Keeping the actual continuation witness -/ /-- Of entrance, given by `⟨j, hj, prep, Λ, C, hΛ, hC, E⟩`. -/ +@[expose] noncomputable def AxisStage.ofEntrance {F : Profile} {j : ℝ} (hj : NaturalAxisData.SmallParameters F.data.h j) (prep : AxisPreparation F j) (Λ C : ℝ) (hΛ : prep.scaleBound ≤ Λ) @@ -1889,6 +1925,7 @@ noncomputable def AxisStage.ofEntrance {F : Profile} {j : ℝ} /-- Of continuation, bundling `referenceWidth`, `referenceWidth_pos`, `referenceWidth_small`, `activationTime` and the required compatibility proofs. -/ +@[expose] noncomputable def Controls.ofContinuation {F : Profile} (A : AxisStage F) {N : ℕ} {eps : ℝ} (w : ActivationContinuation.ContinuationWitness A.natural A.scale_pos A.small F.axisDatum_contDiff N eps) (T : ℝ) (hT : 0 < T) : Controls A where @@ -1935,7 +1972,7 @@ namespace Controls variable {F : Profile} {A : AxisStage F} (c : Controls A) /-- Heat join, given by `c.radius * matchFraction`. -/ -noncomputable def heatJoin : ℝ := c.radius * matchFraction +@[expose] noncomputable def heatJoin : ℝ := c.radius * matchFraction /-- Heat blend, given by `ShapeTransition.radialSwitch c.heatJoin 1 X`. -/ noncomputable def heatBlend (X : ℝ) : ℝ := ShapeTransition.radialSwitch c.heatJoin 1 X /-- Heated E, given by `c.E p + c.heatBlend p.1 * (HeatedOutgoing.E F c.radius coef p - c.E p)`. -/ @@ -2340,6 +2377,7 @@ namespace Controls variable {F : Profile} {A : AxisStage F} (c : Controls A) /-- Seed profiles, constructed using `TransitionRamp.physicalProfiles`. -/ +@[expose] noncomputable def seedProfiles : ProfileHistories.Profiles A.referenceInput.radialDomain := TransitionRamp.physicalProfiles A.natural.profile.family A.scale_pos A.small c.referenceWidth_pos c.referenceWidth_small F.axisDatum_contDiff (κ := c.kappa) @@ -2460,14 +2498,16 @@ 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`. -/ +@[expose] noncomputable def extendedPi (coef : ℝ → ExtendedHeatedOutgoing.Coeff) (p : Point) : ℝ := F.axisDatum p.2 + ProfileHistories.primitive (fun q => c.extendedf coef q ^ 2) p /-- Extended domain, bundling `carrier`, `isOpen`, `scale_mem`. -/ +@[expose] noncomputable def extendedDomain : ProfileHistories.RadialDomain where carrier := {p | p ∈ c.admissibleDomain.carrier ∧ p.2 ∈ ExtendedHeatedOutgoing.parameterDomain} isOpen := c.admissibleDomain.isOpen.inter (ExtendedHeatedOutgoing.parameterDomain_open.preimage @@ -2519,6 +2559,7 @@ theorem extendedf_smoothAt {B : ℝ} (w : ExtendedHeatedOutgoing.Witness F c.rad /-- Extended profiles, bundling `f`, `U`, `f_smooth`, `U_smooth` and the required compatibility proofs. -/ +@[expose] noncomputable def extendedProfiles {B : ℝ} (w : ExtendedHeatedOutgoing.Witness F c.radius B) (hsep : c.separation ≤ Real.exp (-8)) : ProfileHistories.Profiles c.extendedDomain where f := c.extendedf w.coefficients @@ -2660,18 +2701,23 @@ namespace Witness variable {F : Profile} (W : Witness F) /-- F, given by `W.controls.extendedf W.heat.coefficients`. -/ +@[expose] noncomputable def f : Field := W.controls.extendedf W.heat.coefficients /-- U, given by `W.controls.U`. -/ +@[expose] noncomputable def U : Field := W.controls.U /-- E, given by `W.controls.extendedE W.heat.coefficients`. -/ noncomputable def E : Field := W.controls.extendedE W.heat.coefficients /-- H, given by `Real.sqrt (2 * p.1) * W.E p`. -/ noncomputable def H (p : Point) : ℝ := Real.sqrt (2 * p.1) * W.E p /-- Pi, given by `W.controls.extendedPi W.heat.coefficients`. -/ +@[expose] noncomputable def Pi : Field := W.controls.extendedPi W.heat.coefficients /-- Domain, given by `W.controls.extendedDomain`. -/ +@[expose] noncomputable def domain : ProfileHistories.RadialDomain := W.controls.extendedDomain /-- Profiles, given by `W.controls.extendedProfiles W.heat W.separated`. -/ +@[expose] noncomputable def profiles : ProfileHistories.Profiles W.domain := W.controls.extendedProfiles W.heat W.separated 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..d63f1e9eef 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 @@ -162,11 +162,13 @@ theorem FiberAgreement.eventuallyEq {V : Type*} {U : Set Slow} (hU : IsOpen U) { /-- A primitive model retains the fast torus coordinate and the physical radial variable; only the time coordinate is replaced by `q`. -/ +@[expose] noncomputable def stableModel (coord : ℝ) (p : Lift) : Model := ((stableQ coord p.2.1, (p.1, p.2.1.2)), p.2.2) /-- Physical model, given by `((SimilarityCoordinates.coordinateQ coord p.2.1, (p.1, p.2.1.2)), p.2.2)`. -/ +@[expose] noncomputable def physicalModel (coord : ℝ) (p : Lift) : Model := ((SimilarityCoordinates.coordinateQ coord p.2.1, (p.1, p.2.1.2)), p.2.2) @@ -193,6 +195,7 @@ noncomputable def continuedSource (coord : ℝ) (F : Model → ℝ) : Lift → F ∘ stableModel coord /-- Physical source, given by `F ∘ physicalModel coord`. -/ +@[expose] noncomputable def physicalSource (coord : ℝ) (F : Model → ℝ) : Lift → ℝ := F ∘ physicalModel coord @@ -513,6 +516,7 @@ variable {P Q V E : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] /-- Reparameterize primitive ODE coefficients and forcing, while keeping the native-copy path and its entry point unchanged. -/ +@[expose] noncomputable def pullLinearData (φ : P → Q) (d : CommonCoverSolve.LinearData Q V E) : CommonCoverSolve.LinearData P V E where coefficient := fun p => d.coefficient (φ p.1, p.2) @@ -555,15 +559,18 @@ variable {V E : Type} [NormedAddCommGroup V] [NormedSpace ℝ V] [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] /-- Stable parameter, given by `(stableQ coord p.2, (p.1, p.2.2))`. -/ +@[expose] noncomputable def stableParameter (coord : ℝ) (p : ℝ × Slow) : MeanRankUpdate.ModelPoint := (stableQ coord p.2, (p.1, p.2.2)) /-- Physical parameter, given by `(SimilarityCoordinates.coordinateQ coord p.2, (p.1, p.2.2))`. -/ +@[expose] noncomputable def physicalParameter (coord : ℝ) (p : ℝ × Slow) : MeanRankUpdate.ModelPoint := (SimilarityCoordinates.coordinateQ coord p.2, (p.1, p.2.2)) /-- Continued reference solve, defined pointwise by `(pullLinearData (stableParameter coord) d).commonSolve g hab κ ((p.1, p.2.1), p.2.2)`. -/ +@[expose] noncomputable def continuedReferenceSolve (coord : ℝ) (d : CommonCoverSolve.LinearData MeanRankUpdate.ModelPoint V E) (g : CommonCoverSolve.Geometry) {a b : ℝ} (hab : a ≤ b) (κ : Slow → ℝ) : Lift → E := @@ -571,6 +578,7 @@ noncomputable def continuedReferenceSolve (coord : ℝ) /-- Physical reference solve, defined pointwise by `(pullLinearData (physicalParameter coord) d).commonSolve g hab κ ((p.1, p.2.1), p.2.2)`. -/ +@[expose] noncomputable def physicalReferenceSolve (coord : ℝ) (d : CommonCoverSolve.LinearData MeanRankUpdate.ModelPoint V E) (g : CommonCoverSolve.Geometry) {a b : ℝ} (hab : a ≤ b) (κ : Slow → ℝ) : Lift → E := @@ -681,6 +689,7 @@ variable {V E : Type} [NormedAddCommGroup V] [NormedSpace ℝ V] /-- Reference carrier model, given by `(HarmonicCalculus.mode frequency (PeriodicPhaseAssembly.phase g w.cutoff A B) (fun z => L (d.commonSolve g hst κ z)) y).re`. -/ +@[expose] noncomputable def referenceCarrierModel (d : CommonCoverSolve.LinearData MeanRankUpdate.ModelPoint V E) (g : CommonCoverSolve.Geometry) {s t : ℝ} (hst : s ≤ t) (κ : Slow → ℝ) @@ -792,7 +801,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 +809,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 +842,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 +873,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 +882,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) @@ -1037,6 +1047,7 @@ section DiagonalCutoffs variable {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] /-- Physical Q extension, given by `(EndpointCoordinates.cartesianExtension h w).1`. -/ +@[expose] noncomputable def physicalQExtension (h : ℝ) (w : SpaceTime) : ℝ := (EndpointCoordinates.cartesianExtension h w).1 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..86186f9da5 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 @@ -228,18 +228,20 @@ theorem hold_source_criterion {d : TailData} {K : ℝ} (w : ResetWitness d K) /-! ## Common actual cone coordinates and source tests -/ /-- Normal V, given by `coneA w p * (1 + (coneB w Amp p / coneA w p) ^ 2)`. -/ +@[expose] noncomputable def normalV {d : TailData} {K : ℝ} (w : ResetWitness d K) (Amp : ℝ → ℝ) (p : ℝ × ℝ) : ℝ := coneA w p * (1 + (coneB w Amp p / coneA w p) ^ 2) /-- Normal P, given by `OutgoingHistories.p1 XR w Amp p * (1 - coneB w Amp p * coneRatio w Amp p / coneA w p)`. -/ -noncomputable def normalP {d : TailData} {K : ℝ} (w : ResetWitness d K) +@[expose] noncomputable def normalP {d : TailData} {K : ℝ} (w : ResetWitness d K) (Amp : ℝ → ℝ) (XR : ℝ) (p : ℝ × ℝ) : ℝ := OutgoingHistories.p1 XR w Amp p * (1 - coneB w Amp p * coneRatio w Amp p / coneA w p) /-- Normal J, given by `OutgoingHistories.p1 XR w Amp p * (coneRatio w Amp p + coneB w Amp p / coneA w p)`. -/ +@[expose] noncomputable def normalJ {d : TailData} {K : ℝ} (w : ResetWitness d K) (Amp : ℝ → ℝ) (XR : ℝ) (p : ℝ × ℝ) : ℝ := OutgoingHistories.p1 XR w Amp p * (coneRatio w Amp p + coneB w Amp p / coneA w p) @@ -411,13 +413,15 @@ theorem relaxed_of_zero_shear {d : TailData} {K : ℝ} (w : ResetWitness d K) sub_zero, add_zero, mul_one] using hroot /-- Clean end, given by `tailStart d + 1 / 2`. -/ -noncomputable def cleanEnd (d : TailData) : ℝ := tailStart d + 1 / 2 +@[expose] noncomputable def cleanEnd (d : TailData) : ℝ := tailStart d + 1 / 2 /-- Clean window, given by `Icc left (cleanEnd d) ×ˢ Icc (-1) 1`. -/ +@[expose] noncomputable def cleanWindow (d : TailData) (left : ℝ) : Set (ℝ × ℝ) := Icc left (cleanEnd d) ×ˢ Icc (-1) 1 /-- True window, given by `Icc d.core.holdStart (cleanEnd d) ×ˢ Icc (-1) 1`. -/ +@[expose] noncomputable def trueWindow (d : TailData) : Set (ℝ × ℝ) := Icc d.core.holdStart (cleanEnd d) ×ˢ Icc (-1) 1 @@ -536,7 +540,7 @@ theorem exists_ordered_clean_cone : /-! ## The existing profile object and compact margins -/ /-- Profile clean cone, given by `CleanOutgoingCone F.reset XR left`. -/ -noncomputable def ProfileCleanCone (F : OutgoingProfile.Profile) (XR left : ℝ) : Prop := +@[expose] noncomputable def ProfileCleanCone (F : OutgoingProfile.Profile) (XR left : ℝ) : Prop := CleanOutgoingCone F.reset XR left /-- The profile wrapper retains the input profile, its reset, and its @@ -667,17 +671,20 @@ theorem clean_true_stable {d : TailData} {K : ℝ} (w : ResetWitness d K) /-! ## Margins independent of the later entrance radius -/ /-- Source C, given by `1 - coneB w Amp p * coneRatio w Amp p / coneA w p`. -/ +@[expose] noncomputable def sourceC {d : TailData} {K : ℝ} (w : ResetWitness d K) (Amp : ℝ → ℝ) (p : ℝ × ℝ) : ℝ := 1 - coneB w Amp p * coneRatio w Amp p / coneA w p /-- Source J, given by `coneRatio w Amp p + coneB w Amp p / coneA w p`. -/ +@[expose] noncomputable def sourceJ {d : TailData} {K : ℝ} (w : ResetWitness d K) (Amp : ℝ → ℝ) (p : ℝ × ℝ) : ℝ := coneRatio w Amp p + coneB w Amp p / coneA w p /-- Leading gap, given by `2 * sourceC w Amp p ^ 2 - (normalV w Amp p - 2) * sourceJ w Amp p ^ 2`. -/ +@[expose] noncomputable def leadingGap {d : TailData} {K : ℝ} (w : ResetWitness d K) (Amp : ℝ → ℝ) (p : ℝ × ℝ) : ℝ := 2 * sourceC w Amp p ^ 2 - (normalV w Amp p - 2) * sourceJ w Amp p ^ 2 diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/OutgoingEntranceCone.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/OutgoingEntranceCone.lean index b7506f933c..b18ee1c29a 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 : ℝ → ℝ} @@ -1972,23 +1973,25 @@ theorem exists_ordered_preliminary_bounds : /-- Cone A, given by `2 - 2 * (OutgoingHistories.dY (OutgoingHistories.H w) p / OutgoingHistories.H w p)`. -/ +@[expose] noncomputable def coneA {v : TailData} {K : ℝ} (w : UniformAngularReset.ResetWitness v K) (p : ℝ × ℝ) : ℝ := 2 - 2 * (OutgoingHistories.dY (OutgoingHistories.H w) p / OutgoingHistories.H w p) /-- 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) /-- Preliminary window, given by `Icc 0 v.core.holdStart ×ˢ Icc (-1) 1`. -/ +@[expose] noncomputable def preliminaryWindow (v : TailData) : Set (ℝ × ℝ) := Icc 0 v.core.holdStart ×ˢ Icc (-1) 1 diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/OutgoingHistories.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/OutgoingHistories.lean index f15050c78e..e3c324342e 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,27 +127,28 @@ 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 /-- Angular weight, given by `X p * H w p`. -/ +@[expose] noncomputable def angularWeight (w : ResetWitness d K) (p : Point) : ℝ := X p * H w p /-- Transport weight, given by `X p * (U d Amp p * H w 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 +157,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 +172,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 +326,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 +555,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 +1032,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 +1254,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 +1343,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..7c84e4f2f6 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,30 +79,32 @@ 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`. -/ +@[expose] def pressureWeight (F : Profile) (eta y : ℝ) : ℝ := F.logE (y, eta) ^ 2 /-- Log pi, given by `-(1 / 2 : ℝ) * ∫ y in Ioi p.1, F.pressureWeight p.2 y`. -/ +@[expose] 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 +180,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 +569,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 +386,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 +413,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 +511,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 +559,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 +588,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 +606,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 +631,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 +740,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 +791,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 @@ -857,6 +858,7 @@ theorem tailLag_nonneg (d : TailData) {t : ℝ} (ht : t ≤ 3) : 0 ≤ tailLag d (fun v _ => mul_nonneg (Real.exp_pos _).le (tailShapeDeriv_nonneg d v)) /-- Hold lag, given by `releaseLag d d.rampEnd * Real.exp (-(1 - d.h) * t)`. -/ +@[expose] def holdLag (d : TailData) (t : ℝ) : ℝ := releaseLag d d.rampEnd * Real.exp (-(1 - d.h) * t) @@ -1008,7 +1010,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..bab964f305 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 @@ -36,6 +36,7 @@ variable {α : Type*} [MeasurableSpace α] {μ : Measure α} {J : ℕ → ℝ → α → ℝ} /-- The domination is uniform in the parameter on each bounded interval. -/ +@[expose] def ChainDominated (J : ℕ → ℝ → α → ℝ) (μ : Measure α) : Prop := ∀ n L, 0 < L → ∃ b : α → ℝ, Integrable b μ ∧ ∀ᵐ t ∂μ, ∀ ν ∈ Icc (0 : ℝ) L, ‖J n ν t‖ ≤ b t @@ -132,7 +133,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 @@ -195,6 +196,7 @@ open HeatTailEdit /-- Heat jet bound, given by `|(Real.Gamma (1 + h))⁻¹ * RadialHeatProfile.derivativeCoeff (1 + h) n| * Real.Gamma (1 + h + (n : ℝ))`. -/ +@[expose] noncomputable def heatJetBound (h : ℝ) (n : ℕ) : ℝ := |(Real.Gamma (1 + h))⁻¹ * RadialHeatProfile.derivativeCoeff (1 + h) n| * Real.Gamma (1 + h + (n : ℝ)) @@ -508,7 +510,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 +599,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 +968,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..009ff1185e 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 @@ -1172,6 +1172,7 @@ theorem uniform_tilt_cone_margin {X : Type*} [TopologicalSpace X] linarith /-- Nominal speed, given by `a * (1 + m ^ 2)`. -/ +@[expose] def nominalSpeed (a m : ℝ) : ℝ := a * (1 + m ^ 2) /-- Seed rho, given by `correction δ (nominalSpeed a m)`. -/ def seedRho (a m δ : ℝ) : ℝ := correction δ (nominalSpeed a m) @@ -1262,7 +1263,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 +1833,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 +1850,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 +2188,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 +2255,7 @@ end end -@[expose] public section +public section noncomputable section @@ -2702,7 +2703,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 +2715,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..904b30f098 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 @@ -134,6 +134,7 @@ end ParameterWindow /-- A smooth global parameter substitution, equal to the original one on the target window. Its values remain inside the input parameter domain. -/ +@[expose] noncomputable def regularize {S : Set ℝ} (w : ParameterWindow S) (F : Plane → E) (p : Plane) : E := F (p.1, w.parameterMap p.2) @@ -150,6 +151,7 @@ theorem regularize_even {S : Set ℝ} (w : ParameterWindow S) {F : Plane → E} he _ (w.parameterMap_mem eta) r /-- Descent, given by `F (Real.sqrt (2 * p.1), p.2)`. -/ +@[expose] noncomputable def descent (F : Plane → E) (p : Plane) : E := F (Real.sqrt (2 * p.1), p.2) @@ -187,6 +189,7 @@ theorem halfPlaneLift_contDiffOn {g : Plane → E} · exact mem_univ _ /-- Half plane extension, constructed using `SpacetimeGluing.smoothExtension`. -/ +@[expose] noncomputable def halfPlaneExtension (g : Plane → E) (hg : ContDiffOn ℝ ∞ g (Ici 0 ×ˢ (univ : Set ℝ))) (p : Plane) : E := SpacetimeGluing.smoothExtension 0 (halfPlaneLift g) (halfPlaneLift_contDiffOn hg) @@ -217,7 +220,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..b1dd8ac6ff 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 @@ -504,6 +504,7 @@ end UniformModalControl /-- Reindexed base, bundling `radius`, `radialBase`, `frequencyBase`, `axialBase` and the required compatibility proofs. -/ +@[expose] noncomputable def reindexedBase {D : Type*} (base : Label → LinearWaveBounds.WaveCoefficients D) (e : ℕ → ℕ × Label) : LinearWaveBounds.WaveCoefficients D where radius n := (base (e n).2).radius (e n).1 diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ParticularWaveAssembly.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ParticularWaveAssembly.lean index 8c7e3a6178..a2dbb94270 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)) @@ -211,6 +211,7 @@ variable {P Q H : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] /-- Transport only the input data. The physical native clock and anchor are retained, and the cover is refined by a specified integer power. -/ +@[expose] noncomputable def transportTangent (t : TangentData P H) (φ : Q → P) (gap : ℕ) (amplitude : ℝ) : TangentData Q H where normal z := t.normal (φ z.1, z.2) @@ -364,6 +365,7 @@ theorem assembledBlock_mean_zero {D : Type} /-- Full mode block, given by `modeBlock j k Φ kp (fun n x => a.amplitude n (x,0)) (fun n x => a.pressure n (x,0))`. -/ +@[expose] noncomputable def fullModeBlock {D : Type} (j : ℤ) (k : ℕ → ℝ) (Φ : ℕ → D → ℝ) (kp : ℕ → ℤ) (a : LinearWaveBounds.WaveCoefficients (D × ℝ)) : HarmonicBlock D := modeBlock j k Φ kp (fun n x => a.amplitude n (x,0)) (fun n x => a.pressure n (x,0)) @@ -419,6 +421,7 @@ variable {P Q : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] [NormedAddCommGroup Q] [NormedSpace ℝ Q] /-- Transport source, defined pointwise by `amplitude • f (φ q.1, coverPower gap q.2)`. -/ +@[expose] noncomputable def transportSource (f : P × Plane → ComplexVector) (φ : Q → P) (gap : ℕ) (amplitude : ℝ) : Q × Plane → ComplexVector := fun q => amplitude • f (φ q.1, coverPower gap q.2) @@ -558,13 +561,14 @@ 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 r.length_pos.le r.cutoff /-- Reference pressure, constructed using `commonPressure`. -/ +@[expose] noncomputable def referencePressure (r : Reference P) (c : Context (P × Plane)) (u : State (P × Plane)) (b : HarmonicBlock (P × Plane)) (G A : HarmonicResidual.BlockCoefficients (P × Plane)) (j : ℤ) : P × Plane → ℂ := @@ -704,6 +708,7 @@ theorem commonPressure_invariant {θ : P} {t : TangentData P ProblemStatement.Sp (complexCopyPressure_invariant ht hs g hab k frequency) (fun r v => r • v) /-- Angle lift, defined pointwise by `f (z.1.1, z.2)`. -/ +@[expose] noncomputable def angleLift {E : Type} (f : P × Plane → E) : (P × ℝ) × Plane → E := fun z => f (z.1.1, z.2) @@ -714,6 +719,7 @@ theorem angleLift_invariant {E : Type} (f : P × Plane → E) : /-- Angle tangent, bundling `normal`, `normalDot`, `action`, `damping` and the required compatibility proofs. -/ +@[expose] noncomputable def angleTangent (t : TangentData P ProblemStatement.Space) : TangentData (P × ℝ) ProblemStatement.Space where normal := angleLift t.normal @@ -729,6 +735,7 @@ theorem angleTangent_invariant (t : TangentData P ProblemStatement.Space) : /-- An isometry retaining the physical angular coordinate, while moving it into the slow-parameter product used by the Volterra construction. -/ +@[expose] noncomputable def angleShuffle : ((P × Plane) × ℝ) ≃ₗᵢ[ℝ] ((P × ℝ) × Plane) where toFun z := ((z.1.1,z.2),z.1.2) invFun z := ((z.1.1,z.2),z.1.2) @@ -961,7 +968,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 @@ -986,6 +993,7 @@ theorem actualCarrier_affine (base : WaveCoefficients ((P × ℝ) × Plane)) ring /-- Actual copy coefficients, constructed using `complexCopyCoefficients`. -/ +@[expose] noncomputable def actualCopyCoefficients (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 : ℤ) @@ -997,6 +1005,7 @@ noncomputable def actualCopyCoefficients (r : Reference P) (charts : BandCharts (bandGeometry r charts) copy (fun _ => r.length) (fun _ => r.length_pos) /-- Actual common coefficients as an element of `WaveCoefficients ((P × ℝ) × Plane)`. -/ +@[expose] noncomputable def actualCommonCoefficients (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 : ℤ) @@ -1163,7 +1172,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)) @@ -1377,11 +1386,13 @@ variable {P : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] /-- Section strip, given by `SignedWaveUpdate.sectionStrip (reindexStrip (angleShuffle (P := P)) s)`. -/ +@[expose] noncomputable def sectionStrip (s : StripData ((P × ℝ) × Plane)) : StripData (P × Plane) := SignedWaveUpdate.sectionStrip (reindexStrip (angleShuffle (P := P)) s) /-- Native mode block, given by `fullModeBlock j b.frequency b.phase b.angularFrequency (reindexCoefficients angleShuffle a)`. -/ +@[expose] noncomputable def nativeModeBlock (j : ℤ) (b : HarmonicBlock (P × Plane)) (a : WaveCoefficients ((P × ℝ) × Plane)) : HarmonicBlock (P × Plane) := fullModeBlock j b.frequency b.phase b.angularFrequency (reindexCoefficients angleShuffle a) @@ -1457,6 +1468,7 @@ open ParticularWaveBounds CopyAngularInvariance CorrectionState variable {P : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] /-- Source family, defined pointwise by `angleLift (residualSource c u b G A j n)`. -/ +@[expose] noncomputable def sourceFamily (c : Context (P × Plane)) (u : State (P × Plane)) (b : HarmonicBlock (P × Plane)) (G A : HarmonicResidual.BlockCoefficients (P × Plane)) (j : ℤ) : ℕ → (P × ℝ) × Plane → ComplexVector := @@ -1884,23 +1896,27 @@ namespace AssemblyData variable (D : AssemblyData P) /-- Wave, constructed using `actualCorrectedCommon`. -/ +@[expose] noncomputable def wave (j : ℤ) : WaveCoefficients ((P × ℝ) × Plane) := actualCorrectedCommon D.reference D.charts D.context D.state D.carrierBlock D.gaussianInput D.aliasInput j D.background D.strip D.directions /-- Controls as an element of `Type`. -/ +@[expose] noncomputable def controls (N : ℕ) (α κ : ℝ) : Type := ∀ j ∈ modes N, LocalControl D.reference D.charts D.context D.state D.carrierBlock D.gaussianInput D.aliasInput j D.background D.copy D.strip D.directions α κ /-- Velocity, defined pointwise by `∑ j ∈ modes N, (vectorMode ((D.wave j).frequency n) ((D.wave j).phase n) ((D.wave j).amplitude n) x i).re`. -/ +@[expose] noncomputable def velocity (N : ℕ) : ℕ → (P × ℝ) × Plane → Fin 3 → ℝ := fun n x i => ∑ j ∈ modes N, (vectorMode ((D.wave j).frequency n) ((D.wave j).phase n) ((D.wave j).amplitude n) x i).re /-- Pressure, defined pointwise by `∑ j ∈ modes N, (mode ((D.wave j).frequency n) ((D.wave j).phase n) ((D.wave j).pressure n) x).re`. -/ +@[expose] noncomputable def pressure (N : ℕ) : ℕ → (P × ℝ) × Plane → ℝ := fun n x => ∑ j ∈ modes N, (mode ((D.wave j).frequency n) ((D.wave j).phase n) ((D.wave j).pressure n) x).re diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ParticularWaveBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ParticularWaveBounds.lean index 0027d6b7b1..ef8dc020e7 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) @@ -78,30 +78,31 @@ theorem reindex_kinematics {P Q : Type} (d : PrimaryODE.FrameData P) (φ : Q → h.eigenvector_deriv, h.frameK_deriv, h.frameN_deriv⟩ /-- Copy parameter, given by `(q.1, (g.coordinates k q.2).1)`. -/ +@[expose] noncomputable def copyParameter {P : Type} (g : CommonCoverSolve.Geometry) (k : Frequency) (q : P × Plane) : P × ℝ := (q.1, (g.coordinates k q.2).1) /-- Copy frame, given by `reindex d (copyParameter g k)`. -/ -noncomputable def copyFrame {P : Type} (d : PrimaryODE.FrameData (P × ℝ)) +@[expose] noncomputable def copyFrame {P : Type} (d : PrimaryODE.FrameData (P × ℝ)) (g : CommonCoverSolve.Geometry) (k : Frequency) : PrimaryODE.FrameData (P × Plane) := reindex d (copyParameter g k) /-- Copy source, given by `f (z.1.1, g.path k z.1.2 z.2)`. -/ -noncomputable def copySource {P : Type} (f : P × Plane → Space) +@[expose] noncomputable def copySource {P : Type} (f : P × Plane → Space) (g : CommonCoverSolve.Geometry) (k : Frequency) (z : (P × Plane) × ℝ) : Space := f (z.1.1, g.path k z.1.2 z.2) @[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 @@ -111,6 +112,7 @@ theorem ambient_zero {P : Type} (d : PrimaryODE.FrameData P) (z : P × ℝ) : /-! ## The native tangent data can be built directly from the frame -/ /-- Base operator, constructed using `MovingFrameODE.packCLM.comp`. -/ +@[expose] noncomputable def baseOperator (F : ℝ) (g : State) : Space →L[ℝ] Space := MovingFrameODE.packCLM.comp (((-2 * F) • PiLp.proj 2 (fun _ : Fin 3 => ℝ) 1).prod @@ -118,15 +120,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) @@ -372,6 +374,7 @@ end Bridge /-! ## Smooth primitive data discharge the continuity requirements -/ /-- Base operator family, constructed using `LinearMap.toContinuousLinearMap`. -/ +@[expose] noncomputable def baseOperatorFamily : (ℝ × State) →L[ℝ] (Space →L[ℝ] Space) := LinearMap.toContinuousLinearMap { toFun := fun z => baseOperator z.1 z.2 @@ -391,7 +394,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 +602,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1210,7 +1213,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 +1257,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 +1388,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 +1452,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) @@ -1562,6 +1566,7 @@ open PrimaryODE variable {Q : Type} [NormedAddCommGroup Q] [NormedSpace ℝ Q] /-- The explicit source projection in the two-dimensional moving frame. -/ +@[expose] noncomputable def frameForcingLinear (d : FrameData Q) (z : Q × ℝ) : PrimaryODE.Space →L[ℝ] PrimaryODE.State := LinearMap.toContinuousLinearMap { @@ -1586,7 +1591,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 +1730,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[ℝ] ℝ)‖) @@ -2189,11 +2194,12 @@ noncomputable def imagPart : ComplexVector →L[ℝ] ProblemStatement.Space := /-- Complex scale, given by `ContinuousLinearMap.pi fun i => ((ContinuousLinearMap.mul ℝ ℂ) c).comp (ContinuousLinearMap.proj i)`. -/ +@[expose] 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 +2212,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 +2231,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 +2264,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) : @@ -2433,6 +2440,7 @@ variable {P : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] /-- Zero amplitudes, given by `{ base with amplitude := fun _ _ => 0, pressure := fun _ _ => 0 }`. -/ +@[expose] noncomputable def zeroAmplitudes (base : WaveCoefficients (P × Plane)) : WaveCoefficients (P × Plane) := { base with amplitude := fun _ _ => 0, pressure := fun _ _ => 0 } @@ -3130,7 +3138,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,13 +3203,13 @@ 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) /-- Common pressure, given by `periodizedCopies g κ (fun k => complexCopyPressure t f g hab k frequency)`. -/ -noncomputable def commonPressure (t : TangentData P ProblemStatement.Space) +@[expose] noncomputable def commonPressure (t : TangentData P ProblemStatement.Space) (f : P × Plane → ComplexVector) (g : Geometry) {a b : ℝ} (hab : a ≤ b) (κ : Plane → ℝ) (frequency : ℝ) : P × Plane → ℂ := periodizedCopies g κ (fun k => complexCopyPressure t f g hab k frequency) @@ -3234,7 +3242,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 +3276,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 +3313,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 +3327,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 +3358,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..32cc01ea95 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) = @@ -241,11 +242,13 @@ theorem covered_support {f : Plane → ℝ} {S : Set Plane} (hf : support f ⊆ /-- Slot center, given by `SlotGeometry.center (Fintype.card SlotColoring.Palette) (SlotColoring.nativeGap h) (SlotColoring.color L)`. -/ +@[expose] noncomputable def slotCenter (h : ℝ) (L : SlotColoring.Label) : Plane := SlotGeometry.center (Fintype.card SlotColoring.Palette) (SlotColoring.nativeGap h) (SlotColoring.color L) /-- Slot set, given by `SlotGeometry.orientedRectangle (slotCenter h L) vr vt (2 * r)`. -/ +@[expose] noncomputable def slotSet (h r : ℝ) (vr vt : Plane) (L : SlotColoring.Label) : Set Plane := SlotGeometry.orientedRectangle (slotCenter h L) vr vt (2 * r) @@ -324,6 +327,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 +443,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 +471,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 +629,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 +637,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 +660,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 +676,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 +764,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 +773,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 +830,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 +864,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 +894,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 +959,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 +968,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 +1024,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 +1117,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..2700b902bc 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 - @@ -87,12 +87,14 @@ noncomputable def plateau : Set Plane := /-- Outer, given by `Icc (w.lower.1 - 2 * w.padding) (w.upper.1 + 2 * w.padding) ×ˢ Icc (w.lower.2 - 2 * w.padding) (w.upper.2 + 2 * w.padding)`. -/ +@[expose] noncomputable def outer : Set Plane := Icc (w.lower.1 - 2 * w.padding) (w.upper.1 + 2 * w.padding) ×ˢ Icc (w.lower.2 - 2 * w.padding) (w.upper.2 + 2 * w.padding) /-- Cutoff, given by `intervalCutoff w.lower.1 w.upper.1 w.padding z.1 * intervalCutoff w.lower.2 w.upper.2 w.padding z.2`. -/ +@[expose] noncomputable def cutoff (z : Plane) : ℝ := intervalCutoff w.lower.1 w.upper.1 w.padding z.1 * intervalCutoff w.lower.2 w.upper.2 w.padding z.2 @@ -144,6 +146,7 @@ theorem cutoff_germ_on_support {E : Type} [Zero E] {κ : Plane → E} end ClockWindow /-- The literal lattice sum of a native scalar. -/ +@[expose] noncomputable def periodizeScalar (g : Geometry) (f : Plane → ℝ) (Y : Plane) : ℝ := ∑' k : Frequency, f (g.coordinates k Y) @@ -193,6 +196,7 @@ theorem periodizeScalar_transport (g : Geometry) (f : Plane → ℝ) (d : ℕ) CopySolveCompatibility.coordinates_refine, CopySolveCompatibility.coordinates_timeGeometry] /-- The clock itself is periodicized together with its cutoff. -/ +@[expose] noncomputable def periodicClock (g : Geometry) (χ : Plane → ℝ) : Plane → ℝ := periodizeScalar g (fun z => χ z * z.2) @@ -278,6 +282,7 @@ section Phases variable {P : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] /-- Phase, given by `A z.1 - periodicClock g χ z.2 * B z.1`. -/ +@[expose] noncomputable def phase (g : Geometry) (χ : Plane → ℝ) (A B : P → ℝ) (z : P × Plane) : ℝ := A z.1 - periodicClock g χ z.2 * B z.1 @@ -331,7 +336,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 : ℝ) : @@ -431,17 +436,21 @@ end Phases abbrev Parameter := PhysicalParticularWave.Parameter /-- Slow swap, given by `(p.1, (p.2.2, p.2.1))`. -/ +@[expose] noncomputable def slowSwap (p : Parameter) : PhaseCalculus.Slow := (p.1, (p.2.2, p.2.1)) /-- Profile intercept, given by `(pz / ε) * s.2.2 + x0 * s.1`. -/ +@[expose] noncomputable def profileIntercept (ε pz x0 : ℝ) (s : Parameter) : ℝ := (pz / ε) * s.2.2 + x0 * s.1 /-- Profile rate, given by `p * F s + pz * G s`. -/ +@[expose] noncomputable def profileRate (p pz : ℝ) (F G : Parameter → ℝ) (s : Parameter) : ℝ := p * F s + pz * G s /-- Profile phase, given by `phase g χ (profileIntercept ε pz x0) (profileRate p pz F G)`. -/ +@[expose] noncomputable def profilePhase (g : Geometry) (χ : Plane → ℝ) (ε p pz x0 : ℝ) (F G : Parameter → ℝ) : Parameter × Plane → ℝ := phase g χ (profileIntercept ε pz x0) (profileRate p pz F G) 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..655fbef573 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 @@ -38,6 +38,7 @@ private theorem infty_add_one_le : (∞ : WithTop ℕ∞) + 1 ≤ ∞ := by simpa only [ENat.coe_top_add_one] using (le_rfl : (∞ : WithTop ℕ∞) ≤ ∞) /-- Slab, given by `Icc a b ×ˢ univ`. -/ +@[expose] noncomputable def slab (a b : ℝ) : Set SpaceTime := Icc a b ×ˢ univ theorem spatial_smooth {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PeriodizedWaveBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PeriodizedWaveBounds.lean index f93d9aac20..5bd90d699f 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 @@ -791,55 +792,64 @@ variable (a : CopyData D I) /-- Raw, given by `{ a.background with amplitude := fun n => a.amplitude n i pressure := fun n => a.pressure n i }`. -/ +@[expose] noncomputable def raw (i : I) : WaveCoefficients D := { a.background with amplitude := fun n => a.amplitude n i pressure := fun n => a.pressure n i } /-- Localized, given by `(a.raw i).withCutoff (fun n => a.cutoff n i)`. -/ +@[expose] noncomputable def localized (i : I) : WaveCoefficients D := (a.raw i).withCutoff (fun n => a.cutoff n i) /-- Corrected, given by `(a.raw i).corrected s d (fun n => a.cutoff n i)`. -/ +@[expose] noncomputable def corrected (s : StripData D) (d : GraphDirections D) (i : I) : WaveCoefficients D := (a.raw i).corrected s d (fun n => a.cutoff n i) /-- Local good, given by `(a.raw i).constructedGood s d (fun n => a.cutoff n i) n`. -/ +@[expose] noncomputable def localGood (s : StripData D) (d : GraphDirections D) (n : ℕ) (i : I) : 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 /-- Local gaussian, given by `excludedSlotError d (fun n => a.cutoff n i) (fun n => a.amplitude n i) a.source n`. -/ +@[expose] noncomputable def localGaussian (d : GraphDirections D) (n : ℕ) (i : I) : D → ComplexVector := 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 formula on each native copy. -/ +@[expose] noncomputable def globalGood (s : StripData D) (d : GraphDirections D) (n : ℕ) : D → ComplexVector := copySum (a.localGood s d n) /-- Cutoff sum, given by `copySum (a.cutoff n)`. -/ +@[expose] 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 +1593,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 @@ -1627,6 +1637,7 @@ theorem complexCopyData_cutoff_support (base : WaveCoefficients (P × Plane)) /-- The data-only binding to the actual fixed-reference particular solve. The source is the literal coefficient of the incoming harmonic residual; no inverse, output field, or residual witness is supplied separately. -/ +@[expose] noncomputable def particularData (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 : ℤ) 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..e42fad7d52 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,8 +867,9 @@ 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`. -/ +@[expose] noncomputable def radialSlope (n : Space) : ℝ := n 0 / normalScale n /-- Normal direction, given by `(normalScale n)⁻¹ • tail n`. -/ noncomputable def normalDirection (n : Space) : Plane := (normalScale n)⁻¹ • tail n @@ -1184,13 +1185,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 +1230,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 +1319,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 +1371,7 @@ end end -@[expose] public section +public section namespace NavierStokes.PhaseEstimates @@ -1385,6 +1387,7 @@ abbrev Slow := PhaseCalculus.Slow /-- Rounding in the punctured integer lattice. The zero floor is replaced by one; the distance to the input is still at most one. -/ +@[expose] noncomputable def nonzeroRound (x : ℝ) : ℤ := if Int.floor x = 0 then 1 else Int.floor x theorem nonzeroRound_ne_zero (x : ℝ) : nonzeroRound x ≠ 0 := by @@ -1404,6 +1407,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 +1434,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 +1476,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 +1597,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 +1714,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 +1813,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 +2037,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 +2236,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..661c1253a3 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 : @@ -641,6 +641,7 @@ theorem cartesianRadius_smooth : (PhysicalGraphBounds.sum_sq_pos hy).ne').contDiffWithinAt /-- Slow order `(T,Z)` and the actual common auxiliary coordinate. -/ +@[expose] noncomputable def slowFast : PhysicalWaveSum.LiftPoint →L[ℝ] ((ℝ × ℝ) × PhysicalGraphBounds.Plane) := (((ContinuousLinearMap.snd ℝ ℝ ℝ).comp PhysicalGraphBounds.liftZT).prod @@ -663,12 +664,12 @@ 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 + 1)`. -/ -noncomputable def cylindricalDomain (a b : ℝ) : Set PhysicalWaveSum.LiftPoint := +@[expose] noncomputable def cylindricalDomain (a b : ℝ) : Set PhysicalWaveSum.LiftPoint := (fun x => ‖PhysicalGraphBounds.liftXY x‖) ⁻¹' Ioo (a / 2) (b + 1) theorem cylindricalDomain_open (a b : ℝ) : IsOpen (cylindricalDomain a b) := diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalCoordinateBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalCoordinateBounds.lean index 8caef74e0e..08ff72d453 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) : @@ -383,12 +383,15 @@ theorem homogeneous_derivative_bound {a b : ℝ} (ha : 0 < a) (ha1 : a < 1) ring /-- Power lift, given by `y.1 ^ b`. -/ +@[expose] noncomputable def powerLift (b : ℝ) (y : Point) : ℝ := y.1 ^ b /-- Eta lift, given by `y.2.2 / y.1 ^ D a`. -/ +@[expose] noncomputable def etaLift (a : ℝ) (y : Point) : ℝ := y.2.2 / y.1 ^ D a /-- X lift, given by `y.2.1 / y.1`. -/ +@[expose] noncomputable def xLift (y : Point) : ℝ := y.2.1 / y.1 theorem powerLift_contDiffOn (b : ℝ) : ContDiffOn ℝ ∞ (powerLift b) positiveTime := by @@ -465,7 +468,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 +489,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..0f317521d2 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 @@ -516,6 +516,7 @@ section NativeCells open CommonCoverSolve /-- Native center, given by `g.center + TorusAverages.latticePoint k`. -/ +@[expose] noncomputable def nativeCenter (g : Geometry) (k : TorusInverse.Frequency) : Plane := g.center + TorusAverages.latticePoint k @@ -648,7 +649,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..4169740e54 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} @@ -330,6 +331,7 @@ end ScaledGraph /-! Coordinate reassociation and smooth cutoffs. -/ /-- Reindex vector, given by `e.symm (V (e x))`. -/ +@[expose] noncomputable def reindexVector (e : E ≃L[ℝ] F) (V : F → F) (x : E) : E := e.symm (V (e x)) @@ -413,6 +415,7 @@ namespace ScaledGraph /-- Radial curve, given by `((1, ((0, 0), (G.frequency * GraphCalculus.radialSpeed G.exponent r) • G.radialVector)), 0)`. -/ +@[expose] noncomputable def radialCurve (G : ScaledGraph) (r : ℝ) : Cylinder := ((1, ((0, 0), (G.frequency * GraphCalculus.radialSpeed G.exponent r) • G.radialVector)), 0) @@ -541,7 +544,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 +694,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))) @@ -727,6 +731,7 @@ theorem cartesianPotential_smoothAt {a : ℝ} (ha : 0 < a) (j : PolarCharts.Inde (realVector_smooth.contDiffAt.comp z (hB.comp z (polarCoordinates_smooth ha j).contDiffAt)) /-- Valid cylindrical as an element of `Set SpaceTime`. -/ +@[expose] noncomputable def validCylindrical (a : ℝ) (j : PolarCharts.Index) : Set SpaceTime := {z | 0 < z.2 0 ∧ (z.2 1 - PolarCharts.offset j) ∈ Ioo (-(Real.pi / 2)) (Real.pi / 2) ∧ @@ -850,7 +855,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, @@ -996,6 +1001,7 @@ theorem globalCartesianPotential_smoothOn {a : ℝ} (ha : 0 < a) exact contDiffAt_const.congr_of_eventuallyEq (globalCartesianPotential_zero_germ ha hzero hrad) /-- Cartesian velocity, given by `SpatialCurl.spatialCurl (globalCartesianPotential a B)`. -/ +@[expose] noncomputable def cartesianVelocity (a : ℝ) (B : SpaceTime → ComplexVector) : VelocityField := SpatialCurl.spatialCurl (globalCartesianPotential a B) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalGraphBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalGraphBounds.lean index c070c5f3dd..7690194428 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. -/ @@ -208,6 +208,7 @@ noncomputable def sector (a b : ℝ) (j : Index) : Set Plane := Metric.closedBall 0 b ∩ {p | a / 2 ≤ (rotate j p).1} /-- Chart domain, given by `{p | a / 4 < (rotate j p).1}`. -/ +@[expose] noncomputable def chartDomain (a : ℝ) (j : Index) : Set Plane := {p | a / 4 < (rotate j p).1} @@ -378,7 +379,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 +515,7 @@ end end -@[expose] public section +public section noncomputable section @@ -531,9 +532,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 @@ -563,12 +564,13 @@ theorem cover_pow_timeDirection (i : ℕ) : smul_smul, pow_succ] /-- Radial projection as an element of `SpaceTime →L[ℝ] Plane`. -/ +@[expose] noncomputable def radialProjection : SpaceTime →L[ℝ] Plane := ((AxisymmetricFields.projection 0).comp (ContinuousLinearMap.snd ℝ ℝ Space)).prod ((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 +581,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 +617,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 +632,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 +667,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 +790,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 _) ?_ @@ -901,11 +903,12 @@ abbrev LiftPoint := ChartPoint × Plane /-- Coordinate projection, given by `(AxisymmetricFields.projection j).comp (ContinuousLinearMap.snd ℝ ℝ Space)`. -/ +@[expose] 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 +925,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 +991,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 +1094,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 +1155,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 @@ -1546,6 +1554,7 @@ theorem norm_jet_linear_comp {E F G : Type*} [NormedAddCommGroup E] [NormedSpace exact L.norm_compContinuousMultilinearMap_le _ /-- Lift XY as an element of `LiftPoint →L[ℝ] Plane`. -/ +@[expose] noncomputable def liftXY : LiftPoint →L[ℝ] Plane := (((ContinuousLinearMap.fst ℝ ℝ (ℝ × ℝ)).comp (ContinuousLinearMap.snd ℝ ℝ (ℝ × (ℝ × ℝ)))).prod @@ -1555,14 +1564,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 @@ -1608,6 +1617,7 @@ noncomputable def slotConstant (ci : ℝ) (center : Plane) (r0 : ℝ) : Slot := ((0, (0, 0)), (0, (r0 - etaCoordinate center) / ci)) /-- The actual native slot coordinates, using a chosen smooth polar chart. -/ +@[expose] noncomputable def slotMap (κ : Plane → Plane) (ci : ℝ) (center : Plane) (r0 : ℝ) (y : LiftPoint) : Slot := embedPolar (κ (liftXY y)) + slotLinear ci y + slotConstant ci center r0 @@ -1698,7 +1708,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 +1882,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..a12840c9de 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 @@ -57,13 +57,14 @@ theorem normalization_pos (d : OutgoingTail.TailData) {K : ℝ} (hK : 0 < K) : /-- Edited angular, given by `q d.h p ^ (-HeatTailEdit.exponent d.h) * ParametricHeatTail.physicalEdit d K (eta d.h p) (X d.h p)`. -/ +@[expose] noncomputable def editedAngular (d : OutgoingTail.TailData) (K : ℝ) (p : PhysicalPoint) : ℝ := q d.h p ^ (-HeatTailEdit.exponent d.h) * 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 : ℝ} @@ -104,6 +105,7 @@ theorem editedAngular_div_radius (d : OutgoingTail.TailData) {K : ℝ} /-- The normalized section is used only inside the physical time domain. It supplies a direct profile-parameter comparison without `log(1-eta^2)`. Endpoint extensions of profile factors are proved separately. -/ +@[expose] noncomputable def normalizedSection (x e : ℝ) : PhysicalPoint := (e ^ 2, (x, e)) theorem q_normalizedSection {h e : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalMeanJetBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalMeanJetBounds.lean index e31cfbc306..7ef4e42967 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 @@ -329,6 +330,7 @@ structure CoherentFamily (h degree : ℝ) (N Δ : ℕ) (U : Set PhysicalGraphBou native n (VariableGaugeMean.physicalToChartTZ h n (ChartScales.nativeIndex h n - gap n) z) /-- Field, given by `D.physical ∘ physicalPoint h`. -/ +@[expose] noncomputable def CoherentFamily.field {h degree : ℝ} {N Δ : ℕ} {U : Set PhysicalGraphBounds.Plane} (D : CoherentFamily h degree N Δ U E) : SpaceTime → E := D.physical ∘ physicalPoint h @@ -353,6 +355,7 @@ theorem CoherentFamily.field_germ (D : CoherentFamily h degree N Δ U E) /-- Supported native coefficients, stated for an arbitrary normed target. For real-valued coefficients this is the actual `SupportedGauge` condition. -/ +@[expose] def NativeSupport (h a b : ℝ) (N : ℕ) (U : Set PhysicalGraphBounds.Plane) (f : ℕ → Point → E) : Prop := ∀ n ≥ N, ∀ z, z.2.1 ∈ U → f n z ≠ 0 → @@ -405,6 +408,7 @@ theorem CoherentFamily.annulus_on_tsupport (D : CoherentFamily h degree N Δ U E linarith only [haR, PolarCharts.radius_le_two_norm (PhysicalGraphBounds.scaledRadial n w)] /-- Band-independent native jets after absorbing the actual flat weight. -/ +@[expose] def NativeJets (N : ℕ) (U : Set PhysicalGraphBounds.Plane) (gain : ℝ) (f : ℕ → Point → E) : Prop := ∀ m : ℕ, ∃ A : ℝ, 0 ≤ A ∧ ∃ e : ℕ, ∀ n ≥ N, ∀ z, z.2.1 ∈ U → ∀ j ≤ m, @@ -503,6 +507,7 @@ theorem CoherentFamily.field_jet_bound_of_localBandJets (D : CoherentFamily h de /-- The open physical region on which the local native hypotheses imply smoothness, including the zero neighborhood at the spatial axis. -/ +@[expose] noncomputable def physicalDomain (h : ℝ) (N : ℕ) : Set SpaceTime := {w | w ∈ preterminal ∧ physicalQ h w < ChartScales.Q N} @@ -540,7 +545,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 +634,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 +722,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) @@ -728,8 +734,8 @@ theorem CoherentFamily.angularField_formula (D : CoherentFamily h degree N Δ U (w.2 0 / PhysicalClassBounds.cartesianRadius (PhysicalGraphBounds.radialProjection w) * D.field w) • coordinateVector 1 := by simp only [CoherentFamily.angularField, angularVector, smul_add, smul_smul] - change (D.field w * (-w.2 1 / _)) • _ + (D.field w * (w.2 0 / _)) • _ = _ - rw [mul_comm (D.field w), mul_comm (D.field w)] + simp only [PhysicalGraphBounds.radialProjection_apply] + simp only [mul_comm (D.field w)] theorem CoherentFamily.angularField_germ (D : CoherentFamily h degree N Δ U ℝ) (hU : IsOpen U) (n : ℕ) (hn : N ≤ n) {w : SpaceTime} (hw : w ∈ preterminal) @@ -914,6 +920,7 @@ noncomputable def CoherentFamily.reconstructPressure /-- Reconstruct the azimuthal stream potential from a coherent axial source. Its physical degree is exactly `A h - 1/2`. -/ +@[expose] noncomputable def CoherentFamily.reconstructStream (D : CoherentFamily h (CoordinateAlgebra.A h) N Δ U ℝ) (hh : 0 < h) (hh1 : h < 1 / 2) (ha : 0 < a) (hab : a < b) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalParticularWave.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalParticularWave.lean index de4618f332..0fc42498d4 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 @@ -35,6 +35,7 @@ variable {P : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] /-- Raw common, given by `actualCommonCoefficients D.reference D.charts D.context D.state D.carrierBlock D.gaussianInput D.aliasInput j D.background`. -/ +@[expose] noncomputable def rawCommon (D : AssemblyData P) (j : ℤ) : WaveCoefficients ((P × ℝ) × Plane) := actualCommonCoefficients D.reference D.charts D.context D.state D.carrierBlock D.gaussianInput D.aliasInput j D.background @@ -185,19 +186,20 @@ abbrev WaveSpace := (Parameter × ℝ) × Plane /-- The wave solver uses `(R,(T,Z),theta,Y)`. The physical graph theorem uses `(R,(Z,T),Y,theta)`. This is the literal isometric reordering. -/ +@[expose] noncomputable def waveEquiv : Cylinder ≃ₗᵢ[ℝ] WaveSpace := (PhysicalResidualTZ.swapCylinder.trans (StateReindex.cylinder (ParticularWaveBounds.liftAssoc Plane))).trans angleShuffle @[simp] theorem waveEquiv_apply (x : Cylinder) : - waveEquiv x = (((x.1.1, (x.1.2.1.2, x.1.2.1.1)), x.2), x.1.2.2) := rfl + waveEquiv x = (((x.1.1, (x.1.2.1.2, x.1.2.1.1)), x.2), x.1.2.2) := by 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 _) @@ -229,6 +231,7 @@ theorem ratioPower_div {Q Qr : ℝ} (hQ : 0 < Q) (hQr : 0 < Qr) (a b : ℝ) : /-- A band-to-reference change, in the `(Z,T)` order used by PCC. The slow-coordinate swap is supplied by `waveEquiv`. -/ +@[expose] noncomputable def chartChange (h Q Qr : ℝ) (gap : ℕ) : Lift →L[ℝ] Lift := MeanChartCompatibility.chartLinear (ratioPower Q Qr (1 / 2)) (((ratioPower Q Qr (CoordinateAlgebra.D h) • ContinuousLinearMap.fst ℝ ℝ ℝ).prod @@ -239,11 +242,11 @@ noncomputable def chartChange (h Q Qr : ℝ) (gap : ℕ) : Lift →L[ℝ] Lift : chartChange h Q Qr gap x = (ratioPower Q Qr (1 / 2) * x.1, ((ratioPower Q Qr (CoordinateAlgebra.D h) * x.2.1.1, - ratioPower Q Qr 1 * x.2.1.2), coverPower gap x.2.2)) := rfl + ratioPower Q Qr 1 * x.2.1.2), coverPower gap x.2.2)) := by rfl /-- 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 +273,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 @@ -507,22 +514,25 @@ theorem phaseNormal_chartChange_of_phase {Q Qr K Kr : ℝ} (hQ : 0 < Q) (hQr : 0 /-- Reference raw, given by `angleLift (referenceVelocity D.reference D.context D.state D.carrierBlock D.gaussianInput D.aliasInput j)`. -/ +@[expose] noncomputable def referenceRaw (D : AssemblyData Parameter) (j : ℤ) : WaveSpace → ComplexVector := angleLift (referenceVelocity D.reference D.context D.state D.carrierBlock D.gaussianInput D.aliasInput j) /-- Reference raw pressure, given by `angleLift (ParticularWaveAssembly.referencePressure D.reference D.context D.state D.carrierBlock D.gaussianInput D.aliasInput j)`. -/ +@[expose] noncomputable def referenceRawPressure (D : AssemblyData Parameter) (j : ℤ) : WaveSpace → ℂ := angleLift (ParticularWaveAssembly.referencePressure D.reference D.context D.state D.carrierBlock 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 D.reference.band`. -/ +@[expose] noncomputable def referencePhase (D : AssemblyData Parameter) (j : ℤ) : WaveSpace → ℝ := (actualCarrier D.background D.carrierBlock j).phase D.reference.band @@ -556,12 +566,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) @@ -663,6 +673,7 @@ structure ReferenceChart (D : AssemblyData Parameter) (h Qr : ℝ) (I : ℕ) : P I).axial /-- Reference domain, given by `waveEquiv ⁻¹' D.strip.domain`. -/ +@[expose] noncomputable def referenceDomain (D : AssemblyData Parameter) : Set Cylinder := waveEquiv ⁻¹' D.strip.domain @@ -670,10 +681,12 @@ theorem referenceDomain_open (D : AssemblyData Parameter) : IsOpen (referenceDom D.strip.isOpen_domain.preimage waveEquiv.continuous /-- Lift phase, defined pointwise by `referencePhase D j (waveEquiv x)`. -/ +@[expose] 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 +850,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)) @@ -848,16 +861,16 @@ theorem parameterChange_smooth (h Q Qr : ℝ) : ContDiff ℝ ∞ (parameterChang theorem waveEquiv_cylinderChange (h Q Qr : ℝ) (gap : ℕ) (x : Cylinder) : waveEquiv (cylinderChange h Q Qr gap x) = ((parameterChange h Q Qr (waveEquiv x).1.1, (waveEquiv x).1.2), coverPower gap (waveEquiv - x).2) := rfl + x).2) := by rfl /-- Reference source, given by `residualSource D.context D.state D.carrierBlock D.gaussianInput D.aliasInput j D.reference.band`. -/ -noncomputable def referenceSource (D : AssemblyData Parameter) (j : ℤ) : Parameter × Plane → - ComplexVector := +@[expose] noncomputable def referenceSource (D : AssemblyData Parameter) (j : ℤ) : + Parameter × Plane → ComplexVector := 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 +883,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 @@ -928,23 +941,27 @@ theorem bandPressure_eq_reference (D : AssemblyData Parameter) (h : ℝ) {Q Qr : /-- Band raw, defined pointwise by `bandAmplitude D h hQ hQr gap K j ((waveEquiv x).1.1, (waveEquiv x).2)`. -/ +@[expose] noncomputable def bandRaw (D : AssemblyData Parameter) (h : ℝ) {Q Qr : ℝ} (hQ : 0 < Q) (hQr : 0 < Qr) (gap : ℕ) (K : ℝ) (j : ℤ) : Cylinder → ComplexVector := fun x => bandAmplitude D h hQ hQr gap K j ((waveEquiv x).1.1, (waveEquiv x).2) /-- Band raw pressure, defined pointwise by `bandPressure D h hQ hQr gap K j ((waveEquiv x).1.1, (waveEquiv x).2)`. -/ +@[expose] noncomputable def bandRawPressure (D : AssemblyData Parameter) (h : ℝ) {Q Qr : ℝ} (hQ : 0 < Q) (hQr : 0 < Qr) (gap : ℕ) (K : ℝ) (j : ℤ) : Cylinder → ℂ := fun x => bandPressure D h hQ hQr gap K j ((waveEquiv x).1.1, (waveEquiv x).2) /-- 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) /-- Band velocity as an element of `Cylinder → ComplexVector`. -/ +@[expose] noncomputable def bandVelocity (D : AssemblyData Parameter) (h : ℝ) {Q Qr : ℝ} (hQ : 0 < Q) (hQr : 0 < Qr) (i gap : ℕ) (K : ℝ) (j : ℤ) : Cylinder → ComplexVector := let G := PhysicalResidualBridge.commonGraph Q h i @@ -963,6 +980,7 @@ theorem bandRaw_eq_lift (D : AssemblyData Parameter) (h : ℝ) {Q Qr : ℝ} /-- Band domain, given by `{x | 0 < x.1.1 ∧ cylinderChange h Q Qr gap x ∈ referenceDomain D ∧ parameterChange h Q Qr (waveEquiv x).1.1 ∈ U}`. -/ +@[expose] noncomputable def bandDomain (D : AssemblyData Parameter) (h Q Qr : ℝ) (gap : ℕ) (U : Set Parameter) : Set Cylinder := {x | 0 < x.1.1 ∧ cylinderChange h Q Qr gap x ∈ referenceDomain D ∧ @@ -1095,6 +1113,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 +1125,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 +1245,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 @@ -1521,13 +1540,14 @@ theorem labelVelocity_divergence (D : AssemblyData Parameter) {h Qr : ℝ} {I : /-! ## Substitution of the actual target-band residual source -/ /-- Transported residual source, constructed using `ScaledTangentTransport.transportSource`. -/ +@[expose] noncomputable def transportedResidualSource (D : AssemblyData Parameter) (h Q Qr : ℝ) (gap : ℕ) (j : ℤ) : Parameter × Plane → ComplexVector := ScaledTangentTransport.transportSource (referenceSource D j) (parameterChange h Q Qr) gap (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 +1560,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..f91b85aafd 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} @@ -329,6 +329,7 @@ theorem radial_smooth (G : ScaledGraph) {U : Set Cylinder} exact (contDiffAt_const.prodMk (contDiffAt_const.prodMk hc)).prodMk contDiffAt_const /-- Source, given by `{p | 0 < p.2 0} ∩ G.map ⁻¹' U`. -/ +@[expose] noncomputable def source (G : ScaledGraph) (U : Set Cylinder) : Set SpaceTime := {p | 0 < p.2 0} ∩ G.map ⁻¹' U @@ -361,7 +362,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 +371,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 +435,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 +676,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 +747,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..daa06bf410 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 @@ -35,7 +35,7 @@ variable {D E F : Type} [NormedAddCommGroup D] [NormedSpace ℝ D] [NormedAddCommGroup F] [NormedSpace ℝ F] /-- Scalar multiplication by a nonzero real number, with its actual inverse. -/ -noncomputable def scalarEquiv (F : Type) [NormedAddCommGroup F] [NormedSpace ℝ F] +@[expose] noncomputable def scalarEquiv (F : Type) [NormedAddCommGroup F] [NormedSpace ℝ F] (a : ℝ) (ha : a ≠ 0) : F ≃L[ℝ] F := { LinearEquiv.smulOfNeZero ℝ F a ha with continuous_toFun := continuous_const.smul continuous_id @@ -64,6 +64,7 @@ theorem along_pull (e : D ≃L[ℝ] E) (a b : ℝ) (V : D → D) (W : E → E) rw [hV, map_smul, smul_smul] /-- Equality of every coefficient on a full lifted open set, with one weight. -/ +@[expose] def CoefficientsOn (U : Set D) (e : D ≃L[ℝ] E) (a : ℝ) (c : Coefficients D) (d : Coefficients E) : Prop := ∀ j x, x ∈ U → c j x = a • d j (e x) @@ -571,7 +572,7 @@ abbrev Lift := PhysicalResidualBridge.Lift abbrev Associated := PhysicalParticularWave.Parameter × TorusInverse.Plane /-- The invertible real-lift map underlying the integer torus cover. -/ -noncomputable def chartEquiv (h : ℝ) {Q Qr : ℝ} (hQ : 0 < Q) (hQr : 0 < Qr) +@[expose] noncomputable def chartEquiv (h : ℝ) {Q Qr : ℝ} (hQ : 0 < Q) (hQr : 0 < Qr) (gap : ℕ) : Lift ≃L[ℝ] Lift := (scalarEquiv ℝ (ratioPower Q Qr (1/2)) (ratioPower_pos hQ hQr _).ne').prodCongr (((scalarEquiv ℝ (ratioPower Q Qr (CoordinateAlgebra.D h)) (ratioPower_pos hQ hQr @@ -582,7 +583,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 @@ -638,7 +639,7 @@ theorem commonFrame_chart (h : ℝ) {Q Qr : ℝ} (hQ : 0 < Q) (hQr : 0 < Qr) · exact weight_viscosity hQ hQr h /-- Association and the `(T,Z)` order used by the correction state. -/ -noncomputable def associatedToLift : Associated ≃ₗᵢ[ℝ] Lift := +@[expose] noncomputable def associatedToLift : Associated ≃ₗᵢ[ℝ] Lift := (ParticularWaveBounds.liftAssoc TorusInverse.Plane).symm.trans PhysicalResidualTZ.swapSlow @[simp] theorem associatedToLift_apply (x : Associated) : @@ -646,7 +647,7 @@ noncomputable def associatedToLift : Associated ≃ₗᵢ[ℝ] Lift := /-- Associated chart, given by `(associatedToLift.toContinuousLinearEquiv.trans (chartEquiv h hQ hQr gap)).trans associatedToLift.symm.toContinuousLinearEquiv`. -/ -noncomputable def associatedChart (h : ℝ) {Q Qr : ℝ} (hQ : 0 < Q) (hQr : 0 < Qr) +@[expose] noncomputable def associatedChart (h : ℝ) {Q Qr : ℝ} (hQ : 0 < Q) (hQr : 0 < Qr) (gap : ℕ) : Associated ≃L[ℝ] Associated := (associatedToLift.toContinuousLinearEquiv.trans (chartEquiv h hQ hQr gap)).trans associatedToLift.symm.toContinuousLinearEquiv @@ -656,7 +657,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) @@ -689,6 +690,7 @@ theorem associatedFrame_chart (h : ℝ) {Q Qr : ℝ} (hQ : 0 < Q) (hQr : 0 < Qr) · exact H.viscosity /-- The positive-radius free lift. Every auxiliary variable remains free. -/ +@[expose] def positiveLift : Set Associated := {x | 0 < x.1.1} theorem positiveLift_open : IsOpen positiveLift := isOpen_lt continuous_const continuous_fst.fst @@ -802,7 +804,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..826e9de9dc 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 @@ -34,6 +34,7 @@ abbrev Lift := PhysicalResidualBridge.Lift abbrev Cylinder := PhysicalResidualBridge.Cylinder /-- The fixed isometric involution `(R,(Z,T),Y) ↔ (R,(T,Z),Y)`. -/ +@[expose] noncomputable def swapSlow : Lift ≃ₗᵢ[ℝ] Lift where toFun x := (x.1, ((x.2.1.2, x.2.1.1), x.2.2)) invFun x := (x.1, ((x.2.1.2, x.2.1.1), x.2.2)) @@ -54,6 +55,7 @@ noncomputable def swapSlow : Lift ≃ₗᵢ[ℝ] Lift where theorem swapSlow_swapSlow (x : Lift) : swapSlow (swapSlow x) = x := rfl /-- Extension to the actual angular cylinder; the angle is not permuted. -/ +@[expose] noncomputable def swapCylinder : Cylinder ≃ₗᵢ[ℝ] Cylinder where toLinearEquiv := swapSlow.toLinearEquiv.prodCongr (LinearEquiv.refl ℝ ℝ) norm_map' x := by @@ -84,6 +86,7 @@ variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] /-- Pullback of a vector field under a fixed linear change of coordinates. -/ +@[expose] noncomputable def reindexVector (e : E ≃L[ℝ] E) (V : E → E) (x : E) : E := e.symm (V (e x)) @@ -181,10 +184,12 @@ theorem graphResidual_reindex (e : E ≃L[ℝ] E) (epsilon : ℝ) (R : E → ℝ end Calculus /-- Swap field, defined pointwise by `f n (swapSlow x)`. -/ +@[expose] noncomputable def swapField (f : MeanIncrementBounds.Field Lift) : MeanIncrementBounds.Field Lift := fun n x => f n (swapSlow x) /-- Swap triple, given by `⟨swapField m.radial, swapField m.angular, swapField m.axial⟩`. -/ +@[expose] noncomputable def swapTriple (m : MeanIncrementBounds.Triple Lift) : MeanIncrementBounds.Triple Lift := ⟨swapField m.radial, swapField m.angular, swapField m.axial⟩ @@ -205,6 +210,7 @@ noncomputable def swapOperators (o : MeanIncrementBounds.Operators Lift) : vT := swapSlow o.vT /-- Swap context, bundling `operators`, `base`, `virtualTheta`, `virtualAxial`. -/ +@[expose] noncomputable def swapContext (c : CorrectionState.Context Lift) : CorrectionState.Context Lift where operators := swapOperators c.operators @@ -213,10 +219,12 @@ noncomputable def swapContext (c : CorrectionState.Context Lift) : CorrectionSta virtualAxial := swapField c.virtualAxial /-- Swap oscillation, defined pointwise by `f n (swapCylinder x)`. -/ +@[expose] noncomputable def swapOscillation (f : CorrectionState.Oscillation Lift) : CorrectionState.Oscillation Lift := fun n x => f n (swapCylinder x) /-- Swap errors, bundling `base`, `gaussian`, `aliasError`. -/ +@[expose] noncomputable def swapErrors (e : CorrectionState.ExcludedErrors Lift) : CorrectionState.ExcludedErrors Lift where base := swapOscillation e.base @@ -225,6 +233,7 @@ noncomputable def swapErrors (e : CorrectionState.ExcludedErrors Lift) : /-- Swap state, bundling `mean`, `pressure`, `oscillation`, `oscillatoryPressure` and the required compatibility proofs. -/ +@[expose] noncomputable def swapState (s : CorrectionState.State Lift) : CorrectionState.State Lift where mean := swapTriple s.mean pressure := swapField s.pressure @@ -287,15 +296,15 @@ theorem angularDirection_swap : theorem complexBase_swap (c : CorrectionState.Context Lift) (n : ℕ) : LiftedMeanResidual.complexBase (swapContext c) n = - fun x => LiftedMeanResidual.complexBase c n (swapCylinder x) := rfl + fun x => LiftedMeanResidual.complexBase c n (swapCylinder x) := by rfl theorem complexPerturbation_swap (s : CorrectionState.State Lift) (n : ℕ) : LiftedMeanResidual.complexPerturbation (swapState s) n = - fun x => LiftedMeanResidual.complexPerturbation s n (swapCylinder x) := rfl + fun x => LiftedMeanResidual.complexPerturbation s n (swapCylinder x) := by rfl theorem complexPressure_swap (s : CorrectionState.State Lift) (n : ℕ) : LiftedMeanResidual.complexPressure (swapState s) n = - fun x => LiftedMeanResidual.complexPressure s n (swapCylinder x) := rfl + fun x => LiftedMeanResidual.complexPressure s n (swapCylinder x) := by rfl theorem virtualDivergence_swap (c : CorrectionState.Context Lift) (n : ℕ) (x : Cylinder) : LiftedMeanResidual.virtualDivergence (swapContext c) n x = @@ -407,27 +416,32 @@ 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}`. -/ +@[expose] noncomputable def graphSourceTZ (G : PhysicalResidualBridge.ScaledGraph) (U : Set Cylinder) : Set ProblemStatement.SpaceTime := {p | 0 < p.2 0 ∧ graphMapTZ G p ∈ U} /-- Graph radial TZ, given by `reindexVector swapCylinder.toContinuousLinearEquiv G.radial`. -/ +@[expose] noncomputable def graphRadialTZ (G : PhysicalResidualBridge.ScaledGraph) : Cylinder → Cylinder := reindexVector swapCylinder.toContinuousLinearEquiv G.radial /-- Graph angular TZ, given by `reindexVector swapCylinder.toContinuousLinearEquiv PhysicalResidualBridge.ScaledGraph.angular`. -/ +@[expose] noncomputable def graphAngularTZ : Cylinder → Cylinder := reindexVector swapCylinder.toContinuousLinearEquiv PhysicalResidualBridge.ScaledGraph.angular /-- Graph axial TZ, given by `reindexVector swapCylinder.toContinuousLinearEquiv G.axial`. -/ +@[expose] noncomputable def graphAxialTZ (G : PhysicalResidualBridge.ScaledGraph) : Cylinder → Cylinder := reindexVector swapCylinder.toContinuousLinearEquiv G.axial /-- Graph temporal TZ, given by `reindexVector swapCylinder.toContinuousLinearEquiv G.temporal`. -/ +@[expose] noncomputable def graphTemporalTZ (G : PhysicalResidualBridge.ScaledGraph) : Cylinder → Cylinder := reindexVector swapCylinder.toContinuousLinearEquiv G.temporal @@ -443,12 +457,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)) @@ -467,6 +481,7 @@ theorem graphResidual_swap (G : PhysicalResidualBridge.ScaledGraph) (swapCylinder x)).symm /-- The same fixed linear chart map used by the variable-gauge mean, in `(T,Z)` order. -/ +@[expose] noncomputable def physicalToChartTZ (h : ℝ) (n k : ℕ) : Lift →L[ℝ] Lift := swapSlow.toContinuousLinearEquiv.toContinuousLinearMap.comp ((MeanChartCompatibility.physicalToChart h n k).comp @@ -484,7 +499,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..9d7d8bad0f 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,12 +309,14 @@ 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 ((PhysicalParticularWave.ratioPower Q Qr (CoordinateAlgebra.D h)) • ContinuousLinearMap.id ℝ ℝ) /-- Request chart as an element of `Point ≃L[ℝ] Point`. -/ +@[expose] noncomputable def requestChart (h : ℝ) {Q Qr : ℝ} (hQ : 0 < Q) (hQr : 0 < Qr) (gap : ℕ) : Point ≃L[ℝ] Point := (PhysicalResidualTZ.swapSlow.toContinuousLinearEquiv.trans @@ -353,12 +355,14 @@ theorem slowChange_length {h Q Qr : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) /-- The strip and input coordinates are moved together. Its epsilon is definitionally the epsilon of the same full-angle wave strip. -/ +@[expose] noncomputable def stateStrip (s : StripData Cylinder) : StripData Point := SignedWaveUpdate.sectionStrip (ParticularWaveBounds.reindexStrip PhysicalResidualTZ.swapCylinder s) /-- State request, defined pointwise by `LocalSignedRequest.fullRequest (stateStrip s) P (2 * h) c u n (PhysicalResidualTZ.swapCylinder x)`. -/ +@[expose] noncomputable def stateRequest (s : StripData Cylinder) (P : SignedStressPrimitive.Patch) (h : ℝ) (c : CorrectionState.Context Point) (u : CorrectionState.State Point) : ℕ → Cylinder → Vec2 := @@ -515,19 +519,21 @@ 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`. -/ +@[expose] noncomputable def fundamental (j : Fin 2) : ℕ → Cylinder → Space := SignedWaveUpdate.phaseFundamental B.pulse B.coordinate j /-- The single Gaussian slot cutoff of this primary pulse. -/ +@[expose] 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 @@ -574,6 +580,7 @@ theorem primary_cutoff_amplitude (j : Fin 2) (n : ℕ) (x : Cylinder) : /-- The same reference carrier is pulled back before multiplication by the target band's frequency. All other background fields remain inputs. -/ +@[expose] noncomputable def viewBase (background : LinearWaveBounds.WaveCoefficients Cylinder) (frequency : ℕ → ℝ) (view : ℕ → Cylinder → Cylinder) (reference : ℕ) : LinearWaveBounds.WaveCoefficients Cylinder := @@ -584,18 +591,20 @@ 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) /-- View cutoff, defined pointwise by `B.cutoff reference (view n x)`. -/ +@[expose] noncomputable def viewCutoff (view : ℕ → Cylinder → Cylinder) (reference : ℕ) : ℕ → Cylinder → ℝ := fun n x => B.cutoff reference (view n x) /-- Each view calls the actual signed quotient constructor, with the same reference pulse and matrix. Its request may be the literal current-state request and is not replaced by an independently chosen signed wave. -/ +@[expose] noncomputable def viewCoefficients (s : StripData Cylinder) (d : LinearWaveBounds.GraphDirections Cylinder) (background : LinearWaveBounds.WaveCoefficients Cylinder) @@ -904,11 +913,13 @@ noncomputable def periodicStateAngular (C : ReferencePhase) (P : SignedStressPri reference) hm hn ha /-- Raw, given by `((B.coefficients request j).withCutoff B.cutoff).amplitude reference`. -/ +@[expose] noncomputable def raw (request : ℕ → Cylinder → Vec2) (j : Fin 2) (reference : ℕ) : Cylinder → ComplexVector := ((B.coefficients request j).withCutoff B.cutoff).amplitude reference /-- Raw pressure, given by `((B.coefficients request j).withCutoff B.cutoff).pressure reference`. -/ +@[expose] noncomputable def rawPressure (request : ℕ → Cylinder → Vec2) (j : Fin 2) (reference : ℕ) : Cylinder → ℂ := ((B.coefficients request j).withCutoff B.cutoff).pressure reference @@ -1027,37 +1038,43 @@ 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) /-- Velocity, given by `PhysicalParticularWave.velocityWeight V.exponent (V.scale n) V.referenceScale`. -/ +@[expose] noncomputable def velocity (n : ℕ) : ℝ := PhysicalParticularWave.velocityWeight V.exponent (V.scale n) V.referenceScale /-- Clock, given by `PhysicalParticularWave.clockWeight V.exponent (V.scale n) V.referenceScale`. -/ +@[expose] noncomputable def clock (n : ℕ) : ℝ := PhysicalParticularWave.clockWeight V.exponent (V.scale n) V.referenceScale /-- Normal, given by `PhysicalParticularWave.normalWeight (V.scale n) V.referenceScale (V.frequency n) (B.base.frequency reference)`. -/ +@[expose] noncomputable def normal (n : ℕ) : ℝ := PhysicalParticularWave.normalWeight (V.scale n) V.referenceScale (V.frequency n) (B.base.frequency reference) /-- Coefficients, constructed using `B.viewCoefficients`. -/ +@[expose] noncomputable def coefficients (request : ℕ → Cylinder → Vec2) (j : Fin 2) : LinearWaveBounds.WaveCoefficients Cylinder := B.viewCoefficients V.strip V.directions V.background V.frequency V.velocity V.clock V.normal (fun n => V.map n) reference request j /-- Cutoff, given by `B.viewCutoff (fun n => V.map n) reference`. -/ +@[expose] noncomputable def cutoff : ℕ → Cylinder → ℝ := B.viewCutoff (fun n => V.map n) reference /-- Exact coefficients, given by `(V.coefficients request j).corrected V.strip V.directions V.cutoff`. -/ +@[expose] noncomputable def exactCoefficients (request : ℕ → Cylinder → Vec2) (j : Fin 2) : LinearWaveBounds.WaveCoefficients Cylinder := (V.coefficients request j).corrected V.strip V.directions V.cutoff @@ -1152,11 +1169,13 @@ theorem pressure_transport (request referenceRequest : ℕ → Cylinder → Vec2 /-- Physical phase, defined pointwise by `B.base.phase reference ((PhysicalResidualBridge.commonGraph V.referenceScale V.exponent V.referenceCover).map z)`. -/ +@[expose] noncomputable def physicalPhase : SpaceTime → ℝ := fun z => B.base.phase reference ((PhysicalResidualBridge.commonGraph V.referenceScale V.exponent V.referenceCover).map z) /-- Physical raw as an element of `SpaceTime → ComplexVector`. -/ +@[expose] noncomputable def physicalRaw (referenceRequest : ℕ → Cylinder → Vec2) (j : Fin 2) : SpaceTime → ComplexVector := fun z => V.referenceScale ^ (-CoordinateAlgebra.A V.exponent) • B.raw referenceRequest j reference @@ -1164,6 +1183,7 @@ noncomputable def physicalRaw (referenceRequest : ℕ → Cylinder → Vec2) (j /-- Reference potential, given by `PhysicalCurlCovariance.referencePotential (B.base.frequency reference) V.physicalPhase (V.physicalRaw referenceRequest j)`. -/ +@[expose] noncomputable def referencePotential (referenceRequest : ℕ → Cylinder → Vec2) (j : Fin 2) : SpaceTime → ComplexVector := PhysicalCurlCovariance.referencePotential (B.base.frequency reference) V.physicalPhase @@ -1171,12 +1191,14 @@ noncomputable def referencePotential (referenceRequest : ℕ → Cylinder → Ve /-- One Cartesian potential is chosen from the reference band and cover, and each actual band wave will be identified with its curl. -/ +@[expose] noncomputable def physicalPotential (referenceRequest : ℕ → Cylinder → Vec2) (j : Fin 2) (delta : ℝ) : VelocityField := PhysicalCurlCovariance.globalCartesianPotential delta (V.referencePotential referenceRequest j) /-- Physical velocity, given by `SpatialCurl.spatialCurl (V.physicalPotential referenceRequest j delta)`. -/ +@[expose] noncomputable def physicalVelocity (referenceRequest : ℕ → Cylinder → Vec2) (j : Fin 2) (delta : ℝ) : VelocityField := SpatialCurl.spatialCurl (V.physicalPotential referenceRequest j delta) @@ -1220,6 +1242,7 @@ theorem referencePotential_periodic {referenceRequest : ℕ → Cylinder → Vec PhysicalParticularWave.angle_translate_pack] using he /-- Wave, constructed using `vectorMode`. -/ +@[expose] noncomputable def wave (request : ℕ → Cylinder → Vec2) (j : Fin 2) (n : ℕ) : Cylinder → ComplexVector := vectorMode (V.frequency n) ((V.coefficients request j).phase n) @@ -1401,7 +1424,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,12 +1432,13 @@ 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) /-- Physical pressure as an element of `PressureField`. -/ +@[expose] noncomputable def physicalPressure (referenceRequest : ℕ → Cylinder → Vec2) (j : Fin 2) (delta : ℝ) : PressureField := fun z => PhysicalCurlCovariance.globalCartesianPotential delta @@ -1422,6 +1446,7 @@ noncomputable def physicalPressure (referenceRequest : ℕ → Cylinder → Vec2 /-- Pressure mode, given by `mode (V.frequency n) ((V.coefficients request j).phase n) (((V.coefficients request j).withCutoff V.cutoff).pressure n)`. -/ +@[expose] noncomputable def pressureMode (request : ℕ → Cylinder → Vec2) (j : Fin 2) (n : ℕ) : Cylinder → ℂ := mode (V.frequency n) ((V.coefficients request j).phase n) @@ -1708,11 +1733,13 @@ namespace StateData variable {V} (D : V.StateData) /-- Request, given by `stateRequest V.strip D.patch V.exponent D.context D.current`. -/ +@[expose] noncomputable def request : ℕ → Cylinder → Vec2 := stateRequest V.strip D.patch V.exponent D.context D.current /-- Reference request, given by `stateRequest B.strip D.patch V.exponent D.referenceContext D.referenceState`. -/ +@[expose] noncomputable def referenceRequest : ℕ → Cylinder → Vec2 := stateRequest B.strip D.patch V.exponent D.referenceContext D.referenceState diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalStageBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalStageBounds.lean index 773e1d254f..12403749b8 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 @@ -110,6 +110,7 @@ structure WaveData where variable {h D I K J} /-- Scalar, given by `(W.copies i).sum W.lowerRadius h W.nativeWidth`. -/ +@[expose] noncomputable def WaveData.scalar (W : WaveData h D I K J) (i : J) : SpaceTime → ℂ := (W.copies i).sum W.lowerRadius h W.nativeWidth @@ -133,6 +134,7 @@ theorem WaveData.scalar_bound (W : WaveData h D I K J) exact ⟨C, hC, fun w hw hq => hb w hw (abs_time_le_one hh hh1 hw hq)⟩ /-- Vector, given by `PhysicalCopyBounds.vectorSum W.copies W.lowerRadius h W.nativeWidth`. -/ +@[expose] noncomputable def WaveData.vector (W : WaveData h D I K (Fin 3)) : VelocityField := PhysicalCopyBounds.vectorSum W.copies W.lowerRadius h W.nativeWidth @@ -154,6 +156,7 @@ theorem WaveData.vector_bound (W : WaveData h D I K (Fin 3)) exact ⟨C, hC, fun w hw hq => hb w hw (abs_time_le_one hh hh1 hw hq)⟩ /-- Pressure, defined pointwise by `(W.scalar () w).re`. -/ +@[expose] noncomputable def WaveData.pressure (W : WaveData h D I K Unit) : PressureField := fun w => (W.scalar () w).re @@ -327,27 +330,29 @@ 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 /-- These losses depend only on fixed physical parameters and jet order. The five offsets are fixed once for the whole stage sequence. -/ +@[expose] noncomputable def potentialLoss (h waveOffset meanOffset : ℝ) (m : ℕ) : ℝ := max (PhysicalGraphBounds.waveLoss h m + waveOffset) (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) (PhysicalMeanJetBounds.loss (2 * CoordinateAlgebra.A h) m + meanOffset)`. -/ +@[expose] noncomputable def pressureLoss (h waveOffset meanOffset : ℝ) (m : ℕ) : ℝ := max (PhysicalGraphBounds.waveLoss h m + waveOffset) (PhysicalMeanJetBounds.loss (2 * CoordinateAlgebra.A h) m + meanOffset) @@ -444,16 +449,19 @@ section Sequences variable {h qbig : ℝ} {D : Type} [NormedAddCommGroup D] [NormedSpace ℝ D] {I K : Type*} /-- Potential stages, given by `addBaseAtZero base (fun j => potentialIncrement (W j) (M j))`. -/ +@[expose] noncomputable def potentialStages (base : VelocityField) (W : ℕ → WaveData h D I K (Fin 3)) (M : ℕ → MeanData h (CoordinateAlgebra.A h - 1 / 2)) : ℕ → VelocityField := addBaseAtZero base (fun j => potentialIncrement (W j) (M j)) /-- Direct stages, defined pointwise by `(M j).family.angularField`. -/ +@[expose] noncomputable def directStages (M : ℕ → MeanData h (CoordinateAlgebra.A h)) : ℕ → VelocityField := fun j => (M j).family.angularField /-- Pressure stages, given by `addBaseAtZero base (fun j => pressureIncrement (W j) (M j))`. -/ +@[expose] noncomputable def pressureStages (base : PressureField) (W : ℕ → WaveData h D I K Unit) (M : ℕ → MeanData h (2 * CoordinateAlgebra.A h)) : ℕ → PressureField := diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalStageSupport.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalStageSupport.lean index 031fdde071..125dd67da1 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 @@ -86,6 +86,7 @@ theorem support_finset_sum {ι : Type*} {h C qbig : ℝ} {f : ι → SpaceTime end SupportAlgebra /-- This constant is shared by the entire stage sequence. -/ +@[expose] noncomputable def outerConstant (R : ℝ) : ℝ := 4 * R * Real.sqrt 2 theorem outerConstant_pos {R : ℝ} (hR : 0 < R) : 0 < outerConstant R := by @@ -389,6 +390,7 @@ end InitializedSequences section FixedPatch /-- Geometry outer constant, given by `outerConstant G.patch.b`. -/ +@[expose] noncomputable def geometryOuterConstant (G : SignedMeanGain.Geometry) : ℝ := outerConstant G.patch.b @@ -396,6 +398,7 @@ theorem geometryOuterConstant_pos (G : SignedMeanGain.Geometry) : 0 < geometryOu outerConstant_pos (G.patch.a_pos.trans G.patch.a_lt_b) /-- The concrete common constant for the manuscript's fixed actual patch. -/ +@[expose] noncomputable def actualOuterConstant : ℝ := geometryOuterConstant ActualInitialization.geometry theorem actualOuterConstant_pos : 0 < actualOuterConstant := diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalWaveSum.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalWaveSum.lean index ef9b97565b..dc96acb67a 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 @@ -43,21 +43,23 @@ private theorem nat_le_infty (k : ℕ) : (k : WithTop ℕ∞) ≤ ∞ := WithTop.coe_le_coe.mpr le_top /-- Change only the auxiliary coordinate from native to common level. -/ +@[expose] noncomputable def downLift (d : ℕ) : LiftPoint →L[ℝ] LiftPoint := (ContinuousLinearMap.id ℝ PhysicalGraphBounds.ChartPoint).prodMap ((CommonCoverSolve.coverPower d).symm : Plane →L[ℝ] Plane) /-- Up lift, given by `(ContinuousLinearMap.id ℝ PhysicalGraphBounds.ChartPoint).prodMap (CommonCoverSolve.coverPower d : Plane →L[ℝ] Plane)`. -/ +@[expose] noncomputable def upLift (d : ℕ) : LiftPoint →L[ℝ] LiftPoint := (ContinuousLinearMap.id ℝ PhysicalGraphBounds.ChartPoint).prodMap (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 +102,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 +191,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 : ℝ)) @@ -259,6 +261,7 @@ theorem common_carrier_physical_bound {h a b Z r0 P B eBase : ℝ} · exact hGb /-- Closed supports of the actual dyadic and slow masks. -/ +@[expose] noncomputable def labelRegion (D : ℝ) (L : Label) : Set (ℝ × Position) := tsupport (SquaredPartition.dyadicMask (L.1 : ℤ)) ×ˢ tsupport (SquaredPartition.physicalSlowMask D L.1 L.2.1) @@ -268,6 +271,7 @@ theorem labelRegion_closed (D : ℝ) (L : Label) : IsClosed (labelRegion D L) := /-- Physical mask, given by `SquaredPartition.dyadicMask (L.1 : ℤ) z.1 * SquaredPartition.physicalSlowMask D L.1 L.2.1 z.2`. -/ +@[expose] noncomputable def physicalMask (D : ℝ) (L : Label) (z : ℝ × Position) : ℝ := SquaredPartition.dyadicMask (L.1 : ℤ) z.1 * SquaredPartition.physicalSlowMask D L.1 L.2.1 z.2 @@ -426,12 +430,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) @@ -444,6 +448,7 @@ theorem physicalQ_smoothAt {h : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) AxisymmetricFields.contDiff_profilePoint.contDiffAt /-- The three physical variables whose rescalings enter the slow masks. -/ +@[expose] noncomputable def physicalPosition (w : SpaceTime) : Position := ![PolarCharts.radius (PhysicalGraphBounds.radialProjection w), w.2 2, 1 - w.1] @@ -456,6 +461,7 @@ theorem physicalPosition_continuous : Continuous physicalPosition := by · exact continuous_const.sub continuous_fst /-- Physical params, given by `(physicalQ h w, physicalPosition w)`. -/ +@[expose] noncomputable def physicalParams (h : ℝ) (w : SpaceTime) : ℝ × Position := (physicalQ h w, physicalPosition w) @@ -601,6 +607,7 @@ theorem jet_zero_off_tsupport {E F : Type*} [NormedAddCommGroup E] [NormedSpace exact hx ((tsupport_iteratedFDeriv_subset m) (subset_tsupport _ hn)) /-- With chart, given by `{c with chart := i}`. -/ +@[expose] noncomputable def CarrierData.withChart (c : CarrierData) (i : PolarCharts.Index) : CarrierData := {c with chart := i} @@ -626,14 +633,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 +658,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 +683,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,11 +807,12 @@ 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 /-- Sum, given by `∑ᶠ I : WaveIndex H, f.term a h r0 I w`. -/ +@[expose] noncomputable def WaveFamily.sum {H : ℕ} (f : WaveFamily H) (a h r0 : ℝ) (w : SpaceTime) : ℂ := ∑ᶠ I : WaveIndex H, f.term a h r0 I w @@ -991,7 +1000,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 +1010,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..b1096cc588 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,46 +70,49 @@ 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`. -/ +@[expose] noncomputable def angularPower (h : K) : K := -a h - 1 / 2 /-- Axial power, given by `-a h`. -/ +@[expose] noncomputable def axialPower (h : K) : K := -a h /-- Inverse square, given by `(C ^ 2)⁻¹`. -/ -noncomputable def inverseSquare (C : K) : K := (C ^ 2)⁻¹ +@[expose] noncomputable def inverseSquare (C : K) : K := (C ^ 2)⁻¹ /-- Time value, given by `(-power * j.value + dScale h * eta * j.parameter + X * j.radial) / ell h eta`. -/ -noncomputable def timeValue (h power eta X : K) (j : Jet K) : K := +@[expose] noncomputable def timeValue (h power eta X : K) (j : Jet K) : K := (-power * j.value + dScale h * eta * j.parameter + X * j.radial) / ell h eta /-- 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 +121,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 +131,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 +139,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 +157,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 +178,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 +199,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 +336,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 +373,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 +388,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 +397,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 +466,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 +516,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 +557,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 +597,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 +625,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 +640,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) @@ -698,7 +716,7 @@ theorem profileSystem_iff_positiveOrder {h C r eta : ℝ} (hr : r ≠ 0) (expanded_iff_positiveOrder h C eta (r ^ 2) hn _ _ _ _ _ _ _ _ hbeta) /-- The actual radial-average difference, with its regular value at the axis. -/ -noncomputable def averageDefect (u : InnerProfile) : InnerProfile := +@[expose] noncomputable def averageDefect (u : InnerProfile) : InnerProfile := fun w => ProfileHistories.average u w - u w theorem averageDefect_smooth (Ω : ProfileHistories.RadialDomain) {u : InnerProfile} @@ -812,24 +830,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 +1138,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 +1195,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..e941811d98 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 @@ -36,12 +36,16 @@ abbrev Slow := PhaseCalculus.Slow abbrev Label := PartitionedCovariance.UnsignedLabel /-- Positive time, given by `{p | 0 < p.2.2}`. -/ +@[expose] noncomputable def positiveTime : Set Slow := {p | 0 < p.2.2} /-- Positive part, given by `K ∩ positiveTime`. -/ +@[expose] 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`. -/ +@[expose] noncomputable def representative (K : Set Slow) (L : ActiveLabel K) : Slow := PrimaryRepresentatives.representative (positivePart K) L @@ -93,11 +97,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 := @@ -291,6 +295,7 @@ theorem referenceCompact_eq_activeReference {h a b : ℝ} (hh : 0 ≤ h) (hh1 : (activeReference_subset_lifted_image hh hh1 ha hab) /-- Stable domain, given by `{p | 0 < p.1 ∧ (p.2.2, p.2.1) ∈ stableTarget (2 * h)}`. -/ +@[expose] noncomputable def stableDomain (h : ℝ) : Set Slow := {p | 0 < p.1 ∧ (p.2.2, p.2.1) ∈ stableTarget (2 * h)} @@ -299,13 +304,16 @@ noncomputable def stableQ (h : ℝ) (p : Slow) : ℝ := (stableInverse (2 * h) (p.2.2, p.2.1)).1 /-- Stable eta, given by `p.2.1 / stableQ h p ^ CoordinateAlgebra.D h`. -/ +@[expose] noncomputable def stableEta (h : ℝ) (p : Slow) : ℝ := p.2.1 / stableQ h p ^ CoordinateAlgebra.D h /-- Stable X, given by `p.1 ^ 2 / (2 * stableQ h p)`. -/ +@[expose] noncomputable def stableX (h : ℝ) (p : Slow) : ℝ := p.1 ^ 2 / (2 * stableQ h p) /-- Stable inner, given by `(stableX h p, stableEta h p)`. -/ +@[expose] noncomputable def stableInner (h : ℝ) (p : Slow) : ℝ × ℝ := (stableX h p, stableEta h p) theorem stableDomain_open (h : ℝ) : IsOpen (stableDomain h) := @@ -441,6 +449,7 @@ theorem referenceCompact_subset_boundedDomain {h a b : ℝ} (hh : 0 ≤ h) (hh1 · exact ⟨by linarith [hb.2.1], by linarith [hb.2.2]⟩ /-- Three-mesh open box; the actual enlarged support uses two meshes. -/ +@[expose] noncomputable def openGrid (n : ℕ) (k : SlotColoring.Grid) : Set Slow := let s := SquaredPartition.nativeSpacing n Ioo (s * (k 0 : ℝ) - 3 * s) (s * (k 0 : ℝ) + 3 * s) ×ˢ @@ -448,6 +457,7 @@ noncomputable def openGrid (n : ℕ) (k : SlotColoring.Grid) : Set Slow := Ioo (s * (k 2 : ℝ) - 3 * s) (s * (k 2 : ℝ) + 3 * s)) /-- Positive cell, given by `openGrid n k ∩ positiveTime`. -/ +@[expose] noncomputable def positiveCell (n : ℕ) (k : SlotColoring.Grid) : Set Slow := openGrid n k ∩ positiveTime @@ -522,6 +532,7 @@ theorem positiveCell_eventually_subset {K U : Set Slow} (hK : IsCompact K) simpa only [dist_eq_norm] using hd'.trans (hN _ hL).le /-- Cell bound, given by `max (2 * Real.sqrt b + 1) 3`. -/ +@[expose] noncomputable def cellBound (b : ℝ) : ℝ := max (2 * Real.sqrt b + 1) 3 theorem cellBound_pos (b : ℝ) : 0 < cellBound b := @@ -618,7 +629,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 +694,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..473b1e7436 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,14 +326,15 @@ 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`. -/ +@[expose] noncomputable def graphDivergence (k : ℝ → ℝ) (v w : E) (β γ : ℝ × E → ℝ) (p : ℝ × E) : ℝ := graphDr k v β p + β p / p.1 + graphDz w γ p @@ -386,14 +387,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,12 +403,13 @@ 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) /-- Pressure alias, given by `RadialPullback.physicalAlias d a b M (0, v) (pressureSource a b hab f)`. -/ +@[expose] noncomputable def pressureAlias (d a b M : ℝ) (hab : a < b) (v : Plane) (f : Lift S → ℝ) : Lift S → ℝ := RadialPullback.physicalAlias d a b M (0, v) (pressureSource a b hab f) @@ -445,7 +447,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 +462,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 +537,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 +805,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..99647658d8 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) @@ -377,19 +377,21 @@ noncomputable def pulseMatrix (F : Fin 2 → PhaseConstruction U) /-- Pulse vector, defined pointwise by `normalizedPulse ((F j).frame i) ((F j).lam i) ((F j).u i) ((F j).L i) (χ i x)`. -/ +@[expose] noncomputable def pulseVector (F : Fin 2 → PhaseConstruction U) (χ : ι → D → PhaseCalculus.Slow × ℝ) (j : Fin 2) : ι → D → ProblemStatement.Space := fun i x => normalizedPulse ((F j).frame i) ((F j).lam i) ((F j).u i) ((F j).L i) (χ i x) /-- Pulse envelope, defined pointwise by `referenceP ((F j).lam i) ((F j).u i) ((F j).L i) ((F j).L i * (χ i x).2)`. -/ +@[expose] noncomputable def pulseEnvelope (F : Fin 2 → PhaseConstruction U) (χ : ι → D → PhaseCalculus.Slow × ℝ) (j : Fin 2) : ι → D → ℝ := fun i x => referenceP ((F j).lam i) ((F j).u i) ((F j).L i) ((F j).L i * (χ i x).2) /-- 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 +586,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) @@ -801,6 +803,7 @@ variable {X : Type} [NormedAddCommGroup X] [NormedSpace ℝ X] {Λ I : Type*} {V : JetDomain ι D} {w : ι → D → ℝ} {f : ι → D → E} /-- Affine copy, defined pointwise by `f (index l n) (L l n i x + c l n i)`. -/ +@[expose] noncomputable def affineCopy (f : ι → D → E) (index : Λ → ℕ → ι) (L : Λ → ℕ → I → X →L[ℝ] D) (c : Λ → ℕ → I → D) : Λ → ℕ → I → X → E := fun l n i x => f (index l n) (L l n i x + c l n i) @@ -1129,6 +1132,7 @@ theorem actualTarget_jets (hcone : LeadingStressWeights.FullTrueCone v₀) exact hb i p hp j hj /-- Prepared prefactor, constructed using `PartitionedCovariance.nativePrefactor`. -/ +@[expose] noncomputable def preparedPrefactor (r0 : ℝ) (vr vt : TorusInverse.Plane) {N : ℕ} (_j : Fin 2) (L : PrimaryGeometryAssembly.Index W₀ N) : ℝ := PartitionedCovariance.nativePrefactor vr vt r0 * @@ -1280,6 +1284,7 @@ end Prepared /-! ### Actual slow-mask jets and zero germs -/ /-- Position continuous linear map, constructed using `LinearMap.toContinuousLinearMap`. -/ +@[expose] noncomputable def positionCLM : PhaseCalculus.Slow →L[ℝ] SlotColoring.Position := LinearMap.toContinuousLinearMap { toFun := PrimaryRepresentatives.position @@ -1400,6 +1405,7 @@ theorem NativeJets.prepared_mask_outer_localize /-- Sign domain, bundling `carrier`, `isOpen`, `scale`, `one_le_scale` and the required compatibility proofs. -/ +@[expose] noncomputable def signDomain (V : JetDomain ι D) : JetDomain (Fin 2 × ι) D where carrier i := V.carrier i.2 isOpen i := V.isOpen i.2 diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PrimaryFieldAssembly.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PrimaryFieldAssembly.lean index 458af8b2cb..034a84b494 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,13 +123,14 @@ 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 * coveredVector P hdet j Y i : ℝ) : ℂ) /-- Slot phase, given by `(P.modes j : ℝ) * z.2 + P.phases j z.1`. -/ +@[expose] noncomputable def slotPhase {U : UnsignedLabel} (P : PairData sys U) (j : Fin 2) (z : Plane × ℝ) : ℝ := (P.modes j : ℝ) * z.2 + P.phases j z.1 @@ -533,6 +534,7 @@ namespace SourcePair variable {U : UnsignedLabel} (A : SourcePair Q sys U) /-- Pair data, bundling `pulses`, `ci`, `ci_pos`, `fits` and the required compatibility proofs. -/ +@[expose] noncomputable def pairData : PairData sys U where pulses := fun j => canonicalPrimaryPulse (A.frame j) (A.lam j) (A.rate j) (A.length_pos j) A.domain (A.coefficient_continuous j) A.point A.point_mem (A.kinematics j) @@ -550,6 +552,7 @@ noncomputable def pairData : PairData sys U where /-- The matrix is computed directly from the normalized ODE fundamentals, with the exact determinant, transverse scale, and slot-length prefactor. -/ +@[expose] noncomputable def sourceMatrix : Mat2 := primaryCovariance (fun j (_ : Unit) => nativePrefactor vr vt sys.radius * A.stretch j * A.length j) @@ -575,7 +578,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 +594,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 +602,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 +643,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 +912,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..c5004e5c7e 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 := @@ -608,6 +609,7 @@ variable {ι : Type*} {Q : Type} [NormedAddCommGroup Q] [NormedSpace ℝ Q] /-- Fundamental, given by `JointODE.reparamSolution 0 (d.coefficient 1) (fun _ => referenceP lam u L 0 • positiveSeed) (fun _ => 0)`. -/ +@[expose] noncomputable def fundamental (d : PrimaryODE.FrameData Q) (lam u L : ℝ) : Q × ℝ → State := JointODE.reparamSolution 0 (d.coefficient 1) (fun _ => referenceP lam u L 0 • positiveSeed) (fun _ => 0) @@ -733,6 +735,7 @@ variable {ι : Type*} {Q : Type} [NormedAddCommGroup Q] [NormedSpace ℝ Q] /-- Synthesis column, given by `MovingFrameODE.pack 1 ((-d.rho z) • d.frame z 0 + (if j = 0 then d.eigenvector z else -d.eigenvector z) • d.frame z 1)`. -/ +@[expose] noncomputable def synthesisColumn (d : PrimaryODE.FrameData Q) (j : Fin 2) (z : Q × ℝ) : Space := MovingFrameODE.pack 1 ((-d.rho z) • d.frame z 0 + (if j = 0 then d.eigenvector z else -d.eigenvector z) • d.frame z 1) @@ -813,6 +816,7 @@ variable {ι : Type*} {Q : Type} [NormedAddCommGroup Q] [NormedSpace ℝ Q] /-- The two actual normalized-slot integrals making up each covariance column. The prefactor includes the native Haar factor and ci times L. -/ +@[expose] noncomputable def covarianceMatrix (a b : ℝ) (pref : Fin 2 → ι → ℝ) (ψ : Fin 2 → ι → Q × ℝ → ℝ) (v : Fin 2 → ι → Q × ℝ → Space) (n : ι) (p : Q) : SmoothCovariance.Mat2 := @@ -859,7 +863,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 +980,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 +1171,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 +1224,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 +1423,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,12 +1538,13 @@ 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 /-- Primary wave, constructed using `primaryCoefficient`. -/ +@[expose] noncomputable def primaryWave (s : StripData E) (pref : Fin 2 → ℕ → ℝ) (d : Fin 2 → ℕ → PrimaryODE.FrameData Q) (lam u L : Fin 2 → ℕ → ℝ) (χ : ℕ → E → Q × ℝ) @@ -1674,7 +1679,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) : @@ -1704,6 +1709,7 @@ variable {E : Type} [NormedAddCommGroup E] [NormedSpace ℝ E] /-- Phase covariance, given by `primaryCovariance pref (fun c => (F c).frame) (fun c => (F c).lam) (fun c => (F c).u) (fun c => (F c).L)`. -/ +@[expose] noncomputable def phaseCovariance {D : Domain ℕ Slow} (F : Fin 2 → PhaseConstruction D) (pref : Fin 2 → ℕ → ℝ) : ℕ → Slow → SmoothCovariance.Mat2 := primaryCovariance pref (fun c => (F c).frame) (fun c => (F c).lam) @@ -1711,6 +1717,7 @@ noncomputable def phaseCovariance {D : Domain ℕ Slow} (F : Fin 2 → PhaseCons /-- Phase wave, given by `primaryWave s pref (fun c => (F c).frame) (fun c => (F c).lam) (fun c => (F c).u) (fun c => (F c).L) χ T mask c`. -/ +@[expose] noncomputable def phaseWave (s : StripData E) {D : Domain ℕ Slow} (F : Fin 2 → PhaseConstruction D) (pref : Fin 2 → ℕ → ℝ) (χ : ℕ → E → Slow × ℝ) (T : ℕ → E → SmoothCovariance.Vec2) @@ -1772,7 +1779,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 +1917,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 +2076,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..8b7b33e736 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 @@ -70,12 +70,13 @@ theorem norm_slow_sub_le {x y : Position} {c : ℝ} exact max_le (h 0) (max_le (h 1) (h 2)) /-- Native mask, given by `SquaredPartition.slowMask n k (position q)`. -/ +@[expose] noncomputable def nativeMask (n : ℕ) (k : Grid) (q : Slow) : ℝ := SquaredPartition.slowMask n k (position q) /-- 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 +112,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 +143,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,17 +214,18 @@ 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 /-- Lambda0, given by `Real.sqrt (-(coupling F g) * (coupling F g + ‖g‖))`. -/ +@[expose] 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 +444,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 +505,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 +591,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. -/ @@ -597,6 +600,7 @@ structure TargetCone (F : ℝ) (g T : Plane) : Prop where ratio_lt_one : targetRatio F g T < 1 /-- Slope ratio, given by `u / Real.sqrt (1 + u ^ 2)`. -/ +@[expose] noncomputable def slopeRatio (u : ℝ) : ℝ := u / Real.sqrt (1 + u ^ 2) theorem exists_slopeRatio_gt {r : ℝ} (hr : 0 ≤ r) (hr1 : r < 1) : diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PrimaryTargetBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PrimaryTargetBounds.lean index 1de9beacf8..1db9eea77f 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 @@ -49,6 +49,7 @@ abbrev Plane := MovingFrameODE.Plane /-- Two meshes leave an open neighborhood of the closed one-mesh mask support. They also give the precise `3/S³` representative distance used by the phase comparison theorem. -/ +@[expose] noncomputable def openCell (n : ℕ) (k : SlotColoring.Grid) : Set Slow := let s := SquaredPartition.nativeSpacing n (Ioo (s * (k 0 : ℝ) - 2 * s) (s * (k 0 : ℝ) + 2 * s) ×ˢ @@ -107,7 +108,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 @@ -131,6 +132,7 @@ theorem cellDomain_representative {h lo hi : ℝ} {N : ℕ} (L : BaseChartJets.C /-- Restrict labels after the constants have been chosen. The actual label and its chosen positive representative are unchanged. -/ +@[expose] noncomputable def earlierIndex {h lo hi : ℝ} {N M : ℕ} (hNM : N ≤ M) (L : BaseChartJets.CellIndex h lo hi M) : BaseChartJets.CellIndex h lo hi N := ⟨L.val, hNM.trans L.property⟩ @@ -160,6 +162,7 @@ variable {F : OutgoingProfile.Profile} (W : NominalProfile.Witness F) /-- Reference set, given by `PrimaryRepresentatives.referenceCompact F.data.h (NominalConeAssembly.activeLeft W) (NominalConeAssembly.activeRight W)`. -/ +@[expose] noncomputable def referenceSet : Set Slow := PrimaryRepresentatives.referenceCompact F.data.h (NominalConeAssembly.activeLeft W) (NominalConeAssembly.activeRight W) @@ -176,6 +179,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,14 +187,16 @@ 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`. -/ +@[expose] noncomputable def representative {N : ℕ} (L : Index W N) : Slow := PositiveRepresentatives.representative (referenceSet W) L.val /-- Base domain, given by `PositiveRepresentatives.positiveCell L.val.val.1 L.val.val.2`. -/ +@[expose] noncomputable def baseDomain {N : ℕ} (L : Index W N) : Set Slow := PositiveRepresentatives.positiveCell L.val.val.1 L.val.val.2 @@ -247,6 +253,7 @@ theorem physicalMask_has_index {N : ℕ} (L : PartitionedCovariance.UnsignedLabe /-- Mean-flow charts use `(T,Z)`, while the phase chart uses `(R,(Z,T))`. This explicit map prevents their equal product types hiding a swap. -/ +@[expose] noncomputable def fromTimeAxial (R : ℝ) (tz : ℝ × ℝ) : Slow := (R, (tz.2, tz.1)) @[simp] theorem fromTimeAxial_time (R : ℝ) (tz : ℝ × ℝ) : @@ -259,18 +266,21 @@ variable {W} (H : NominalConeAssembly.Certificate W) {ld : ModulatedProfileAssembly.LoopData W} (v : ModulatedProfileAssembly.Witness ld) /-- The chart field of the very same `FinalSlowBase` schedule. -/ +@[expose] noncomputable def frequency (upper : ℝ) (B n : ℕ) : Slow → ℝ := BaseChartJets.frequency (FinalSlowBase.scales H v upper B) F.data.h W.axis.normalization (FinalSlowBase.coefficients H v) (ChartScales.Q n) /-- Axial, given by `BaseChartJets.axial (FinalSlowBase.scales H v upper B) F.data.h (FinalSlowBase.coefficients H v) (ChartScales.Q n)`. -/ +@[expose] noncomputable def axial (upper : ℝ) (B n : ℕ) : Slow → ℝ := BaseChartJets.axial (FinalSlowBase.scales H v upper B) F.data.h (FinalSlowBase.coefficients H v) (ChartScales.Q n) /-- Leading frequency, given by `BaseChartJets.leadingFrequency F.data.h W.axis.normalization (FinalSlowBase.coefficients H v)`. -/ +@[expose] noncomputable def leadingFrequency : Slow → ℝ := BaseChartJets.leadingFrequency F.data.h W.axis.normalization (FinalSlowBase.coefficients H v) @@ -280,6 +290,7 @@ noncomputable def leadingAxial : Slow → ℝ := BaseChartJets.leadingAxial F.data.h (FinalSlowBase.coefficients H v) /-- Shear, given by `PhaseEstimates.shearVector (leadingFrequency H v) (leadingAxial H v)`. -/ +@[expose] noncomputable def shear : Slow → Plane := PhaseEstimates.shearVector (leadingFrequency H v) (leadingAxial H v) @@ -343,6 +354,7 @@ structure Prepared (upper : ℝ) (B : ℕ) (r0 : ℝ) (N0 : ℕ) where large : ∀ n, N ≤ n → BasePhaseGeometry.LargeBand F.data.h M u n /-- Phase sign, with branches according to `c = 0`. -/ +@[expose] noncomputable def phaseSign (c : Fin 2) : ℝ := if c = 0 then 1 else -1 theorem phaseSign_abs (c : Fin 2) : |phaseSign c| = 1 := by @@ -350,6 +362,7 @@ theorem phaseSign_abs (c : Fin 2) : |phaseSign c| = 1 := by /-- The actual positive representatives instantiate every entry of the phase data, including the unstable eigenpair and the nonzero rounding. -/ +@[expose] noncomputable def family {upper : ℝ} {B : ℕ} {r0 : ℝ} {N0 : ℕ} (a : Prepared H v upper B r0 N0) (c : Fin 2) : BasePhaseGeometry.FamilyData (domain W a.N) F.data.h r0 a.u a.M := by @@ -405,6 +418,7 @@ noncomputable def family {upper : ℝ} {B : ℕ} {r0 : ℝ} {N0 : ℕ} /-- Both signs have one joint domain and the same constants, which were fixed before its band threshold. All phase comparison outputs are proved by `FamilyData.construction`. -/ +@[expose] noncomputable def construction {upper : ℝ} {B : ℕ} {r0 : ℝ} {N0 : ℕ} (a : Prepared H v upper B r0 N0) (hr0 : 0 < r0) (c : Fin 2) : PrimaryPulseBounds.PhaseConstruction (domain W a.N) := @@ -592,6 +606,7 @@ theorem construction_u (c : Fin 2) (L : Index W a.N) : /-- The actual integer angular mode is retained; zero-floor rounding is not replaced by an unproved assertion that a real frequency is integral. -/ +@[expose] noncomputable def angularMode (c : Fin 2) (L : Index W a.N) : ℤ := (family H v a c).angularMode L @@ -662,6 +677,7 @@ variable {H v} reselect a target direction, parameter constant, representative, or Fourier mode. A final consumer can therefore take the maximum of its covariance cutoff and this geometry cutoff. -/ +@[expose] noncomputable def restrict {upper : ℝ} {B : ℕ} {r0 : ℝ} {N0 : ℕ} (a : Prepared H v upper B r0 N0) (N : ℕ) (hN : a.N ≤ N) : Prepared H v upper B r0 N0 where @@ -730,7 +746,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1204,6 +1220,7 @@ structure CompatiblePair (a : Fin 2 → FamilyData D h r0 u M) : Prop where sign : ∀ j i, (a j).sigma i = phaseSign j /-- The native finite covariance with the original joint label. -/ +@[expose] noncomputable def familyCovariance (vr vt : TorusInverse.Plane) (a : Fin 2 → FamilyData D h r0 u M) (i : ι) (p : Slow) : Mat2 := PrimaryPulseBounds.primaryCovariance @@ -1219,8 +1236,7 @@ theorem familyCovariance_eq_native (vr vt : TorusInverse.Plane) ((a 0).band i) p := by unfold familyCovariance nativePrimaryCovariance PrimaryPulseBounds.primaryCovariance ext r c - change _ * _ = _ * _ - simp only [FamilyData.length, hc.band] + simp only [PrimaryPulseBounds.covarianceMatrix, FamilyData.length, hc.band] /-- Uniform finite-matrix bounds follow from the actual constructed phases and their ODEs. The model point only records the common @@ -1371,6 +1387,7 @@ theorem prepared_model_mem (L : Index W a.N) {p : Slow} exact (div_le_iff₀ hmpos).mp hratio /-- Prepared covariance, given by `familyCovariance vr vt (family H v a)`. -/ +@[expose] noncomputable def preparedCovariance (vr vt : TorusInverse.Plane) : Index W a.N → Slow → Mat2 := familyCovariance vr vt (family H v a) @@ -1411,9 +1428,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)) @@ -1427,6 +1444,7 @@ theorem radii_ordered : leftRadius W < rightRadius W := /-- These are the radial-log coefficients of the very same product weight, not a replacement weight with a faster decay. -/ +@[expose] noncomputable def stripWeight (r : ℝ) : ℝ := WeightedRadialPrimitive.zeta (FinalSlowBase.edgeExponent W / 4) 1 (WeightedRadialPrimitive.logLength (leftRadius W) (rightRadius W)) @@ -1482,11 +1500,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 _ @@ -1510,6 +1528,7 @@ theorem movingWeight_eq {p : Slow} (hT : 0 < p.2.2) (hR : 0 < p.1) : /-- The mean-variable ordering `(R,((T,Z),Y))` uses exactly the same normalized point `(R,(Z,T))`. -/ +@[expose] noncomputable def meanPoint (x : LocalSignedRequest.Point) : Slow := (x.1,(x.2.1.2,x.2.1.1)) @@ -1557,7 +1576,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 @@ -1752,7 +1771,24 @@ theorem exists_actual_bounds (hcone : LeadingStressWeights.FullTrueCone v) theorem restricted_covariance (vr vt : TorusInverse.Plane) (N : ℕ) (hN : a.N ≤ N) (L : Index W N) (p : Slow) : preparedCovariance H v (a.restrict N hN) vr vt L p = - preparedCovariance H v a vr vt (earlierIndex hN L) p := rfl + preparedCovariance H v a vr vt (earlierIndex hN L) p := by + have hband (j : Fin 2) : + (family H v (a.restrict N hN) j).band L = + (family H v a j).band (earlierIndex hN L) := rfl + have hframe (j : Fin 2) : + (family H v (a.restrict N hN) j).frame L = + (family H v a j).frame (earlierIndex hN L) := rfl + have hlam (j : Fin 2) : + (family H v (a.restrict N hN) j).lam L = + (family H v a j).lam (earlierIndex hN L) := rfl + have hlength (j : Fin 2) : + (family H v (a.restrict N hN) j).length L = + (family H v a j).length (earlierIndex hN L) := by + simp only [BasePhaseGeometry.FamilyData.length, hband] + have hu : (a.restrict N hN).u = a.u := rfl + unfold preparedCovariance familyCovariance PrimaryPulseBounds.primaryCovariance + ext r c + simp only [PrimaryPulseBounds.covarianceMatrix, hband, hframe, hlam, hlength, hu] /-- A single final band threshold suffices. Restriction retains the original representative, carrier and phase on each surviving label. -/ 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..c52dc929e5 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 @@ -1086,7 +1086,7 @@ theorem pulse_coefficients_hasDerivAt (c : Parameters) {amp : ℝ → ℝ} /-- Affine profile, given by `∑ j : Fin 2, affineCoefficients c q A j * logTemplate (y - center c j)`. -/ -noncomputable def affineProfile (c : Parameters) (q A y : ℝ) : ℝ := +@[expose] noncomputable def affineProfile (c : Parameters) (q A y : ℝ) : ℝ := ∑ j : Fin 2, affineCoefficients c q A j * logTemplate (y - center c j) theorem affineProfile_contDiff (c : Parameters) (q A : ℝ) : ContDiff ℝ ∞ (affineProfile c q A) := by @@ -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)) @@ -2072,7 +2072,7 @@ def prefixAngularEnergy (c : Parameters) : ℝ := /-- Prefix energy, given by `prefixAxialEnergy c * eta ^ 2 - prefixAngularEnergy c * shape eta ^ 2`. -/ -def prefixEnergy (c : Parameters) (eta : ℝ) : ℝ := +@[expose] def prefixEnergy (c : Parameters) (eta : ℝ) : ℝ := prefixAxialEnergy c * eta ^ 2 - prefixAngularEnergy c * shape eta ^ 2 theorem prefixAngularEnergy_bound (c : Parameters) : @@ -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..222f9db552 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 @@ -2046,14 +2046,17 @@ theorem pulse_pressure_bounds (w : ResetWitness d K) {eta y : ℝ} /-! ## Actual viscous coefficients on the pulse -/ /-- Radial A, given by `2 - 2 * (dY (H w) p / H w p)`. -/ +@[expose] noncomputable def radialA (w : ResetWitness d K) (p : Point) : ℝ := 2 - 2 * (dY (H w) p / H w p) /-- Shear B, given by `2 * dY (U d amp) p / E w p`. -/ +@[expose] noncomputable def shearB (w : ResetWitness d K) (amp : ℝ → ℝ) (p : Point) : ℝ := 2 * dY (U d amp) p / E w p /-- Direction ratio, given by `Ns w amp p / (E w p * Qs w amp p)`. -/ +@[expose] noncomputable def directionRatio (w : ResetWitness d K) (amp : ℝ → ℝ) (p : Point) : ℝ := Ns w amp p / (E w p * Qs w amp p) @@ -2306,15 +2309,15 @@ theorem normalizedLag_parameter_fine_bound (c : Parameters) /-! ## The coefficient in the pulse-direction expansion -/ /-- Geometric source, given by `(1 / 2 - d.h) * eta * shapeGradient eta`. -/ -noncomputable def geometricSource (d : TailData) (eta : ℝ) : ℝ := +@[expose] noncomputable def geometricSource (d : TailData) (eta : ℝ) : ℝ := (1 / 2 - d.h) * eta * shapeGradient eta /-- Equilibrium numerator, given by `d.core.lam - d.h + geometricSource d eta`. -/ -noncomputable def equilibriumNumerator (d : TailData) (eta : ℝ) : ℝ := +@[expose] noncomputable def equilibriumNumerator (d : TailData) (eta : ℝ) : ℝ := d.core.lam - d.h + geometricSource d eta /-- Angular equilibrium, given by `equilibriumNumerator d eta / (1 - d.core.lam)`. -/ -noncomputable def angularEquilibrium (d : TailData) (eta : ℝ) : ℝ := +@[expose] noncomputable def angularEquilibrium (d : TailData) (eta : ℝ) : ℝ := equilibriumNumerator d eta / (1 - d.core.lam) /-- Derivative coefficient, given by `d.core.lam * ((1 / 2 - d.h) + geometricSource d eta) * (1 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..b0c96be736 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 @@ -343,12 +343,14 @@ def pressure (P : PressureField) : PressureField := TimeLocalization.activatedPressure (cutPressure P) /-- Periodic velocity, constructed using `TimeLocalization.activatedVelocity`. -/ +@[expose] def periodicVelocity (A B : VelocityField) : VelocityField := TimeLocalization.activatedVelocity (fun z => SpatialLocalization.periodicVelocity A z + PeriodicLocalization.periodize (cutPotential B) z) /-- Periodic pressure, given by `TimeLocalization.activatedPressure (SpatialLocalization.periodicPressure P)`. -/ +@[expose] def periodicPressure (P : PressureField) : PressureField := TimeLocalization.activatedPressure (SpatialLocalization.periodicPressure P) 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..9847ac3671 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 := @@ -666,6 +666,7 @@ theorem radial_compact_primitive_uniform variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] /-- A source slice along the actual affine shifted radial characteristic. -/ +@[expose] def radialSlice (M : ℝ) (v : E) (f : ℝ × E → V) (z : ℝ × E) (s : ℝ) : V := f (s, z.2 + (M * (s - z.1)) • v) @@ -1046,7 +1047,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 +1154,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1167,7 +1168,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 +1212,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 +1322,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 +1336,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 +1389,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 +1409,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 +1491,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 +1530,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..0efd0efa91 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 @@ -114,6 +114,7 @@ structure NormalizedParameters (coord A B : ℝ) (r : CorrectionState.RankData P /-- Normalized data, bundling `lambda`, `inner`, `outer`, `length` and the required compatibility proofs. -/ +@[expose] noncomputable def normalizedData (coord A B lam a b : ℝ) : CorrectionState.RankData Plane where lambda := lam inner := a diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/RankStateCoherence.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/RankStateCoherence.lean index 4fb11cfa30..d26e459bd4 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 @@ -258,6 +258,7 @@ theorem rankIncrementState_on (axial : S × PressureStream.Plane) (axialr : T × end ActualStep /-- The actual state before the rank step's pressure is reconstructed. -/ +@[expose] noncomputable def rankAddedState (g : VariableGaugeMean.GaugeData S) (r : CorrectionState.RankData S) (axial : S × PressureStream.Plane) (C : CorrectionState.Context (PressureStream.Lift S)) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ReferenceJetBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ReferenceJetBounds.lean index e6f93277f3..a4cd868e45 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 @@ -268,7 +268,7 @@ theorem natural_amplitude_bounds (hσ : 0 < σ) (hΛ : 0 < Λ) (hC : 0 < C) end Natural /-- Hold set, given by `Icc (0 : ℝ) 110 ×ˢ Icc (-1 : ℝ) 1`. -/ -def holdSet : Set Point := Icc (0 : ℝ) 110 ×ˢ Icc (-1 : ℝ) 1 +@[expose] def holdSet : Set Point := Icc (0 : ℝ) 110 ×ˢ Icc (-1 : ℝ) 1 theorem reference_mem (N : ReferencePath.Input) {p : Point} (hX : 0 ≤ p.1) (hη : p.2 ∈ Icc (-1 : ℝ) 1) : p ∈ N.radialDomain.carrier := by diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ReferencePath.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ReferencePath.lean index cee65967cd..86741b5724 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,13 +408,13 @@ 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) +@[expose] def logU : Field := fun p => N.U (N.fromLog p) theorem fromLog_smooth : ContDiff ℝ ∞ N.fromLog := (contDiff_const.mul contDiff_fst.exp).prodMk contDiff_snd @@ -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..3f60a877e4 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,10 +197,12 @@ 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)`. -/ +@[expose] noncomputable def Q (h τ z : ℝ) : ℝ := SimilarityCoordinates.coordinateQ (2 * h) (τ, z) /-- Eta, given by `SimilarityCoordinates.coordinateEta (2 * h) (τ, z)`. -/ +@[expose] noncomputable def eta (h τ z : ℝ) : ℝ := SimilarityCoordinates.coordinateEta (2 * h) (τ, z) /-- Reference power, given by `C * (r ^ 2 / 2) ^ (-A h)`. -/ @@ -751,7 +753,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..8c8e29e321 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 @@ -281,7 +281,7 @@ theorem radialJet_freeE_zero (F : Profile) (p : Point) : ring /-- Endpoint error, given by `c.initialAxial eta - 4 * eta`. -/ -noncomputable def endpointError {F : Profile} {A : NominalProfile.AxisStage F} +@[expose] noncomputable def endpointError {F : Profile} {A : NominalProfile.AxisStage F} (c : NominalProfile.Controls A) (eta : ℝ) : ℝ := c.initialAxial eta - 4 * eta /-- Data parameter, given by `(endpointError c eta, NominalProfile.resetCoefficients F c.debt eta)`. -/ @@ -376,6 +376,7 @@ noncomputable def logRows (F : Profile) (p : Point) : Fin 5 → ℝ := /-- Free rows, given by `![freeM F z, Real.sqrt 2 * freeI F z, Real.sqrt 2 * freeJ F z, freeS F z, freePi F z - F.axisDatum z.2.2]`. -/ +@[expose] noncomputable def freeRows (F : Profile) (z : Raw) : Fin 5 → ℝ := ![freeM F z, Real.sqrt 2 * freeI F z, Real.sqrt 2 * freeJ F z, freeS F z, freePi F z - F.axisDatum z.2.2] diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ReservedPatches.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ReservedPatches.lean index da0272ec09..17ffb41553 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,22 +66,23 @@ 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)`. -/ +@[expose] noncomputable def window (F : Profile) (XR : ℝ) (s : Slot) : Set ℝ := Ioo (left F XR s) (right F XR s) @@ -226,14 +227,17 @@ theorem inner_bounds (s : Slot) : Real.exp_lt_exp.mpr (by norm_num), Real.exp_lt_exp.mpr (by norm_num)⟩ /-- Support left, given by `left F XR s * innerLower s`. -/ +@[expose] noncomputable def supportLeft (F : Profile) (XR : ℝ) (s : Slot) : ℝ := left F XR s * innerLower s /-- Support right, given by `left F XR s * innerUpper s`. -/ +@[expose] noncomputable def supportRight (F : Profile) (XR : ℝ) (s : Slot) : ℝ := left F XR s * innerUpper s /-- Closed patch, given by `Icc (supportLeft F XR s) (supportRight F XR s)`. -/ +@[expose] noncomputable def closedPatch (F : Profile) (XR : ℝ) (s : Slot) : Set ℝ := Icc (supportLeft F XR s) (supportRight F XR s) @@ -286,6 +290,7 @@ theorem closedPatches_disjoint (F : Profile) (XR : ℝ) (hXR : 0 < XR) (closedPatch_subset F XR hXR s) (closedPatch_subset F XR hXR t) /-- Moment patch, bundling `left`, `right`, `left_pos`, `ordered`. -/ +@[expose] noncomputable def momentPatch (F : Profile) (XR : ℝ) (hXR : 0 < XR) (s : Slot) : FiveProfileMoments.Patch where left := supportLeft F XR s @@ -448,10 +453,11 @@ 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)`. -/ +@[expose] noncomputable def radialRight (F : Profile) (XR : ℝ) (s : Slot) : ℝ := Real.sqrt (2 * right F XR s) @@ -464,11 +470,12 @@ noncomputable def radialSupportRight (F : Profile) (XR : ℝ) (s : Slot) : ℝ : Real.sqrt (2 * supportRight F XR s) /-- Radial window, given by `Ioo (radialLeft F XR s) (radialRight F XR s)`. -/ +@[expose] noncomputable def radialWindow (F : Profile) (XR : ℝ) (s : Slot) : Set ℝ := Ioo (radialLeft F XR s) (radialRight F XR s) /-- Radial closed patch, given by `Icc (radialSupportLeft F XR s) (radialSupportRight F XR s)`. -/ -noncomputable def radialClosedPatch (F : Profile) (XR : ℝ) (s : Slot) : Set ℝ := +@[expose] noncomputable def radialClosedPatch (F : Profile) (XR : ℝ) (s : Slot) : Set ℝ := Icc (radialSupportLeft F XR s) (radialSupportRight F XR s) theorem radialLeft_pos (F : Profile) (XR : ℝ) (hXR : 0 < XR) (s : Slot) : @@ -552,7 +559,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..896d589141 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 @@ -154,11 +154,13 @@ variable {P : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] /-- The transverse copy coordinate is not a slow variable of the selected frame. The linear map also permits forgetting the auxiliary angle. -/ +@[expose] noncomputable def nativeFrame (d : PrimaryODE.FrameData PhaseCalculus.Slow) (χ : P →L[ℝ] PhaseCalculus.Slow) : PrimaryODE.FrameData (P × ℝ) := PrimaryCopyBridge.reindex d (fun q => χ q.1) /-- Frame argument as an element of `((P × Plane) × ℝ) →L[ℝ] (PhaseCalculus.Slow × ℝ)`. -/ +@[expose] noncomputable def frameArgument (χ : P →L[ℝ] PhaseCalculus.Slow) : ((P × Plane) × ℝ) →L[ℝ] (PhaseCalculus.Slow × ℝ) := (χ.comp ((ContinuousLinearMap.fst ℝ P Plane).comp @@ -213,6 +215,7 @@ variable {Label : Type*} {P V : Type} /-- The grouped Gaussian of this label, built from its actual copy geometry and its full padded integration rectangle. -/ +@[expose] noncomputable def groupedEnvelope (g : Label → ℕ → Geometry) (r L : Label → ℕ → ℝ) (W : Label → ℕ → ℝ → ℝ) : Label → ℕ → P × Plane → ℝ := @@ -491,11 +494,13 @@ theorem residualSource_uniform fin_cases i <;> simp [ParticularWaveAssembly.residualSource] /-- Angle strip, given by `CommonCoverClass.parameterStrip s (ContinuousLinearMap.fst ℝ P ℝ)`. -/ +@[expose] noncomputable def angleStrip (s : StripData P) : StripData (P × ℝ) := CommonCoverClass.parameterStrip s (ContinuousLinearMap.fst ℝ P ℝ) /-- Forget angle, given by `((ContinuousLinearMap.fst ℝ P ℝ).comp (ContinuousLinearMap.fst ℝ (P × ℝ) Plane)).prod (ContinuousLinearMap.snd ℝ (P × ℝ) Plane)`. -/ +@[expose] noncomputable def forgetAngle : ((P × ℝ) × Plane) →L[ℝ] (P × Plane) := ((ContinuousLinearMap.fst ℝ P ℝ).comp (ContinuousLinearMap.fst ℝ (P × ℝ) Plane)).prod (ContinuousLinearMap.snd ℝ (P × ℝ) Plane) @@ -777,6 +782,7 @@ variable {P Q : Type} /-- Transport argument, given by `(φ.comp (ContinuousLinearMap.fst ℝ Q ℝ)).prod (rate • ContinuousLinearMap.snd ℝ Q ℝ)`. -/ +@[expose] noncomputable def transportArgument [NormedAddCommGroup P] [NormedSpace ℝ P] [NormedAddCommGroup Q] [NormedSpace ℝ Q] (φ : Q →L[ℝ] P) (rate : ℝ) : (Q × ℝ) →L[ℝ] (P × ℝ) := @@ -838,6 +844,7 @@ theorem polynomial_affine_family {ι E V : Type*} /-- Transport all primitive frame fields with the same clock and normal factors as `ScaledTangentTransport.transportTangent`. -/ +@[expose] noncomputable def transportedFrame (d : PrimaryODE.FrameData P) (φ : Q → P) (shift rate normalScale : ℝ) : PrimaryODE.FrameData Q where beta z := normalScale * d.beta (φ z.1,shift+rate*z.2) @@ -1064,6 +1071,7 @@ variable {Label P : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] {D T : PhaseJetBounds.Domain (Label × ℕ) PhaseCalculus.Slow} /-- The literal selected frame after the zero-entry physical clock change. -/ +@[expose] noncomputable def scaledSelectedFrame (F : PhaseConstruction D) (φ : (Label × ℕ) → PhaseCalculus.Slow →L[ℝ] PhaseCalculus.Slow) (rate normalScale : (Label × ℕ) → ℝ) (i : Label × ℕ) : @@ -1160,7 +1168,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1180,6 +1188,7 @@ variable {Label P : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] {D : PhaseJetBounds.Domain (Label × ℕ) Slow} /-- Target domain, bundling `scale`, `carrier`, `isOpen`, `one_le_scale`. -/ +@[expose] noncomputable def targetDomain (s : StripData P) (φ : (Label × ℕ) → Slow →L[ℝ] Slow) : PhaseJetBounds.Domain (Label × ℕ) Slow where scale i := s.slow i.2 @@ -1197,6 +1206,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 @@ -1217,12 +1227,14 @@ theorem interval_contains (F : PhaseConstruction D) (clock : ActualSignedControl /-- Geometry, given by `CopySolveCompatibility.transportGeometry (reference l n) (gap l n) 0 (clock.value l n) (clock.value_pos l n).ne'`. -/ +@[expose] noncomputable def geometry (reference : Label → ℕ → Geometry) (gap : Label → ℕ → ℕ) (clock : ActualSignedControl.PositiveScale Label) (l : Label) (n : ℕ) : Geometry := CopySolveCompatibility.transportGeometry (reference l n) (gap l n) 0 (clock.value l n) (clock.value_pos l n).ne' /-- Envelope, given by `referenceP (F.lam (l,n)) (F.u (l,n)) (F.L (l,n)) (clock.value l n*v)`. -/ +@[expose] noncomputable def envelope (F : PhaseConstruction D) (clock : ActualSignedControl.PositiveScale Label) (l : Label) (n : ℕ) (v : ℝ) : ℝ := @@ -1230,6 +1242,7 @@ noncomputable def envelope (F : PhaseConstruction D) (clock : ActualSignedContro /-- Frame, given by `scaledSelectedFrame F φ (fun i => clock.value i.1 i.2) (fun i => normal.value i.1 i.2) i`. -/ +@[expose] noncomputable def frame (F : PhaseConstruction D) (φ : (Label × ℕ) → Slow →L[ℝ] Slow) (clock normal : ActualSignedControl.PositiveScale Label) (i : Label × ℕ) : @@ -1238,6 +1251,7 @@ noncomputable def frame (F : PhaseConstruction D) /-- Neighborhood, given by `{x | x.1 ∈ s.domain ∧ φ (l,n) (χ x.1) ∈ D.carrier (l,n) ∧ ((g l n).coordinates k x.2).2 ∈ Ioo 0 (length F clock l n)}`. -/ +@[expose] noncomputable def neighborhood (s : StripData P) (F : PhaseConstruction D) (χ : P →L[ℝ] Slow) (φ : (Label × ℕ) → Slow →L[ℝ] Slow) (clock : ActualSignedControl.PositiveScale Label) (g : Label → ℕ → Geometry) @@ -1247,6 +1261,7 @@ noncomputable def neighborhood (s : StripData P) (F : PhaseConstruction D) /-- Patch, given by `neighborhood s F χ φ clock g l n k ∩ {x | ((g l n).coordinates k x.2).1 ∈ Icc (-(r l n)) (r l n)}`. -/ +@[expose] noncomputable def patch (s : StripData P) (F : PhaseConstruction D) (χ : P →L[ℝ] Slow) (φ : (Label × ℕ) → Slow →L[ℝ] Slow) (clock : ActualSignedControl.PositiveScale Label) (g : Label → ℕ → Geometry) @@ -1438,6 +1453,7 @@ noncomputable def scaledControl hb l n k x hx hcell.1.2.1 hcell.2 i hi v hv⟩ /-- Overwrite only the source, exactly as `realData` and `imagData` do. -/ +@[expose] noncomputable def withSource (t : TangentData P ProblemStatement.Space) (f : P × Plane → ProblemStatement.Space) : TangentData P ProblemStatement.Space := { t with source := f } @@ -1482,6 +1498,7 @@ omit [NormedAddCommGroup P] [NormedSpace ℝ P] in withSource t (fun x => imagPart (f x)) = imagData t f := rfl /-- Transported tangent, constructed using `ParticularWaveAssembly.angleTangent`. -/ +@[expose] noncomputable def transportedTangent (F : PhaseConstruction D) (χ : P →L[ℝ] Slow) (ψ : (Label × ℕ) → P → P) (clock normal : ActualSignedControl.PositiveScale Label) @@ -1707,12 +1724,14 @@ theorem geometry_cost_constant_one (clock : ActualSignedControl.PositiveScale La /-- Physical phi, given by `ActualSignedGeometry.slowChange h (ChartScales.Q (chart i.2)) (ChartScales.Q (reference i.1 i.2))`. -/ +@[expose] noncomputable def physicalPhi (h : ℝ) (chart : ℕ → ℕ) (reference : Label → ℕ → ℕ) (i : Label × ℕ) : Slow →L[ℝ] Slow := ActualSignedGeometry.slowChange h (ChartScales.Q (chart i.2)) (ChartScales.Q (reference i.1 i.2)) /-- Physical psi, given by `PhysicalParticularWave.parameterChange h (ChartScales.Q (chart i.2)) (ChartScales.Q (reference i.1 i.2))`. -/ +@[expose] noncomputable def physicalPsi (h : ℝ) (chart : ℕ → ℕ) (reference : Label → ℕ → ℕ) (i : Label × ℕ) : Slow → Slow := PhysicalParticularWave.parameterChange h (ChartScales.Q (chart i.2)) @@ -1764,6 +1783,7 @@ variable {h dimension : ℝ} {vr vt : Plane} (slot : Label → ℕ → SlotColoring.Label) /-- Slot reference, given by `ActualSignedGeometry.slotGeometry sys hdet (slot l n) 0`. -/ +@[expose] noncomputable def slotReference (l : Label) (n : ℕ) : Geometry := ActualSignedGeometry.slotGeometry sys hdet (slot l n) 0 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..d291d0c300 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) @@ -87,6 +87,7 @@ theorem wave_power_cancellation {Q : ℝ} (hQ : 0 < Q) (h : ℝ) : rw [he, Real.rpow_zero] /-- The integer carrier frequency is the natural ceiling of `ε ^ (-1/2)`. -/ +@[expose] def carrierFrequency (ε : ℝ) : ℕ := ⌈ε ^ (-(1 / 2 : ℝ))⌉₊ theorem inverse_sqrt_power {ε : ℝ} (hε : 0 < ε) : 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..7ea8a094d4 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,17 @@ 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`. -/ +@[expose] 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 +393,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) @@ -445,6 +446,7 @@ theorem restore_error_jet_le (Gi : ℝ → ℝ) (hGi : ContDiff ℝ ∞ Gi) (z e /-- The harmless zero extension avoids evaluating the logarithmic clock at the axis. On every positive radius this is exactly the cutoff in (19). -/ +@[expose] noncomputable def radialSwitch (Xi T X : ℝ) : ℝ := if X ≤ Xi / 2 then 0 else OutgoingSchedule.sigma (Real.log (X / Xi) / T) @@ -488,7 +490,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 +641,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 +1137,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 +1179,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 +1324,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 +1390,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 +1472,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..ed43b171f1 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 @@ -129,7 +129,7 @@ theorem angularLag_abs_bound (c : Parameters) {h y η : ℝ} (hh : 0 ≤ h) linarith /-- Equilibrium, given by `(c.lam - h + D h * η * shapeGradient η) / (1 - c.lam)`. -/ -noncomputable def equilibrium (c : Parameters) (h η : ℝ) : ℝ := +@[expose] noncomputable def equilibrium (c : Parameters) (h η : ℝ) : ℝ := (c.lam - h + D h * η * shapeGradient η) / (1 - c.lam) /-- Hold coefficient, given by `L h η * averagedDrop c c.holdStart`. -/ @@ -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..e8565a9054 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)) @@ -327,6 +329,7 @@ theorem assembled_bilinear_symmetry {D h : ℝ} {vr vt : Plane} (sys : SlotSyste /-- Signed radial, given by `assembledRadialWith P hdet outer ε (fun U => increment (P U).matrix (T U) (R U)) q x`. -/ +@[expose] noncomputable def signedRadial {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 → ℝ) @@ -335,6 +338,7 @@ noncomputable def signedRadial {D h : ℝ} {vr vt : Plane} {sys : SlotSystem D h /-- Signed tangent, given by `assembledTangentWith P hdet outer ε (fun U => increment (P U).matrix (T U) (R U)) q x i`. -/ +@[expose] noncomputable def signedTangent {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 → ℝ) @@ -483,6 +487,7 @@ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] /-- A polynomial reciprocal bound, imposed only on the positive primary weight. No regularity of a quotient by the envelope is assumed. -/ +@[expose] noncomputable def InverseControl (s : StripData E) (w g : ℕ → E → ℝ) : Prop := ∃ C : ℝ, 0 ≤ C ∧ ∃ p : ℕ, ∀ n x, x ∈ s.domain → w n x / g n x ≤ C * s.growth n x ^ p @@ -549,7 +554,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..52f97d7317 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 @@ -47,6 +47,7 @@ noncomputable def axialCovarianceChange (o : Operators D) (X : Tensor D) : Scala /-- Radial covariance change, given by `-o.radialDiv 1 (X 0 0) - o.dz (X 2 0) + o.invRadius * X 1 1`. -/ +@[expose] noncomputable def radialCovarianceChange (o : Operators D) (X : Tensor D) : ScalarField D := -o.radialDiv 1 (X 0 0) - o.dz (X 2 0) + o.invRadius * X 1 1 @@ -124,6 +125,7 @@ end CovarianceChanges /-- A bound on each actual tensor entry. It is not a bound on the resulting residual and contains no update-preservation assertion. -/ +@[expose] def TensorClass (s : StripData D) (α : ℝ) (X : Tensor D) : Prop := ∀ i j, MeanClass s α (X i j) @@ -157,6 +159,7 @@ end CovarianceBounds /-! ## Literal state and covariance increments -/ /-- Zero triple, given by `⟨0, 0, 0⟩`. -/ +@[expose] noncomputable def zeroTriple : Triple D := ⟨0, 0, 0⟩ omit [NormedAddCommGroup D] [NormedSpace ℝ D] in @@ -166,7 +169,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 @@ -186,13 +189,14 @@ variable {S : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] /-- Wave stage, given by `VariableGaugeMean.reconstructState g c (u.addIncrement zeroTriple 0 w q ⟨0, gaussian, 0⟩)`. -/ -noncomputable def waveStage (g : VariableGaugeMean.GaugeData S) +@[expose] noncomputable def waveStage (g : VariableGaugeMean.GaugeData S) (c : Context (PressureStream.Lift S)) (u : State (PressureStream.Lift S)) (w : Oscillation (PressureStream.Lift S)) (q : OscillatoryScalar (PressureStream.Lift S)) (gaussian : Oscillation (PressureStream.Lift S)) : State (PressureStream.Lift S) := VariableGaugeMean.reconstructState g c (u.addIncrement zeroTriple 0 w q ⟨0, gaussian, 0⟩) /-- Pressure change, given by `(waveStage g c u w q gaussian).pressure - u.pressure`. -/ +@[expose] noncomputable def pressureChange (g : VariableGaugeMean.GaugeData S) (c : Context (PressureStream.Lift S)) (u : State (PressureStream.Lift S)) (w : Oscillation (PressureStream.Lift S)) (q : OscillatoryScalar (PressureStream.Lift S)) @@ -437,15 +441,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 +461,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,22 +628,24 @@ 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 /-- Domain, given by `PhysicalMeanDomain.slowDomain G.region.carrier`. -/ +@[expose] noncomputable def domain (G : Geometry) : Set Point := PhysicalMeanDomain.slowDomain G.region.carrier /-- Operators, given by `StateMomentBalances.nativeOperators G.gauge.radial G.epsilon G.fast G.axial G.time G.temporal`. -/ +@[expose] noncomputable def operators (G : Geometry) : Operators Point := StateMomentBalances.nativeOperators G.gauge.radial G.epsilon G.fast G.axial G.time G.temporal @@ -721,6 +733,7 @@ end Geometry /-- Regularity is imposed on actual fluxes, before any class estimate on their derivatives is derived. -/ +@[expose] def MovingField (G : Geometry) (f : ScalarField Point) : Prop := GaugeMomentBalances.MovingField G.region G.patch.a G.patch.b f @@ -757,6 +770,7 @@ end MovingField /-- Physical sigma, defined pointwise by `SignedStressPrimitive.physicalBarSigma G.patch e (SimilarityCoordinates.coordinateQ G.coord) (f n) (x.1, x.2.1)`. -/ +@[expose] noncomputable def physicalSigma (G : Geometry) (e : ℕ) (f : ScalarField Point) : ScalarField Point := fun n x => SignedStressPrimitive.physicalBarSigma G.patch e @@ -889,11 +903,13 @@ end Geometry /-- Theta remainder field, given by `thetaCovarianceChange G.operators E + G.operators.dz (S 2 1)`. -/ +@[expose] noncomputable def thetaRemainderField (G : Geometry) (S E : Tensor Point) : ScalarField Point := thetaCovarianceChange G.operators E + G.operators.dz (S 2 1) /-- Axial remainder field, given by `axialCovarianceChange G.operators E + G.operators.dz (S 2 2) + G.operators.dz p`. -/ +@[expose] noncomputable def axialRemainderField (G : Geometry) (S E : Tensor Point) (p : ScalarField Point) : ScalarField Point := axialCovarianceChange G.operators E + G.operators.dz (S 2 2) + G.operators.dz p diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/SignedStressPrimitive.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/SignedStressPrimitive.lean index 1f9c833dbb..8f3a422f92 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 @@ -122,6 +122,7 @@ theorem cutoff_deriv (P : Patch) (r : ℝ) : deriv (cutoff P) r = density P r := (cutoff_hasDerivAt P r).deriv /-- Inverse power, given by `((RadialPullback.positiveRadius (P.a / 4) r) ^ e)⁻¹`. -/ +@[expose] noncomputable def inversePower (P : Patch) (e : ℕ) (r : ℝ) : ℝ := ((RadialPullback.positiveRadius (P.a / 4) r) ^ e)⁻¹ @@ -138,6 +139,7 @@ theorem inversePower_eq (P : Patch) (e : ℕ) {r : ℝ} (hr : P.a ≤ r) : rw [RadialPullback.positiveRadius_eq_self (by linarith [P.a_pos]) (by linarith [P.a_pos])] /-- Moment density, given by `inversePower P e r * density P r`. -/ +@[expose] noncomputable def momentDensity (P : Patch) (e : ℕ) (r : ℝ) : ℝ := inversePower P e r * density P r theorem momentDensity_contDiff (P : Patch) (e : ℕ) : ContDiff ℝ ∞ (momentDensity P e) := @@ -181,8 +183,9 @@ 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`. -/ +@[expose] 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`. -/ noncomputable def bumpCorrection (P : Patch) (e : ℕ) (F : ℝ × E → ℝ) (z : ℝ × E) : ℝ := @@ -192,10 +195,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 +581,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,27 +641,31 @@ 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) /-- Radial support stated directly using the physical q, with no band index. -/ +@[expose] def PhysicalSupport (P : Patch) (q : E → ℝ) (F : ℝ × E → ℝ) : Prop := ∀ z, F z ≠ 0 → z.1 / lengthScale q z.2 ∈ Icc P.a P.b @@ -935,6 +943,7 @@ theorem physical_torusAverage_supported (P : Patch) {q : E → ℝ} exact hn (hs (z.1, (z.2, Y)) hF) /-- Physical bar sigma, given by `physicalSigma P e q (PressureStream.torusAverage F)`. -/ +@[expose] noncomputable def physicalBarSigma (P : Patch) (e : ℕ) (q : E → ℝ) (F : PressureStream.Lift E → ℝ) : ℝ × E → ℝ := physicalSigma P e q (PressureStream.torusAverage F) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/SignedWaveUpdate.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/SignedWaveUpdate.lean index a6e3a18638..4673c9237c 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 @@ -42,6 +42,7 @@ open HarmonicFields CorrectionState open scoped BigOperators ContDiff Topology ComplexConjugate /-- Conjugate pair as an element of `Coefficients D`. -/ +@[expose] noncomputable def conjugatePair {D : Type} (j : ℤ) (a : D → ℂ) : Coefficients D := by let c : Coefficients D := AddMonoidAlgebra.single j (fun x => a x / 2) exact c + conjugateReverse c @@ -99,6 +100,7 @@ theorem norm_pair_field_le {D : Type} (j : ℤ) (a : D → ℂ) (k : ℝ) (Φ : /-- Paired block, bundling `velocity`, `pressure`, `frequency`, `phase` and the required compatibility proofs. -/ +@[expose] noncomputable def pairedBlock {D : Type} (j : ℤ) (k : ℕ → ℝ) (Φ : ℕ → D → ℝ) (kp : ℕ → ℤ) (a : ℕ → D → HarmonicCalculus.ComplexVector) : HarmonicBlock D where velocity n i := conjugatePair j (fun x => a n x i) @@ -129,7 +131,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 @@ -164,6 +166,7 @@ section GaussianErrors variable {D E : Type} [NormedAddCommGroup D] [NormedSpace ℝ D] /-- Independence of the explicit angular coordinate. -/ +@[expose] def AngleIndependent (f : ℕ → D × ℝ → E) : Prop := ∀ n x θ, f n (x, θ) = f n (x, 0) @@ -203,7 +206,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) @@ -211,6 +214,7 @@ noncomputable def gaussianField (d : LinearWaveBounds.GraphDirections (D × ℝ) /-- Gaussian block, given by `pairedBlock j k Φ kp (fun n x => LinearWaveBounds.excludedSlotError d ψ a source n (x, 0))`. -/ +@[expose] noncomputable def gaussianBlock (d : LinearWaveBounds.GraphDirections (D × ℝ)) (ψ : ℕ → D × ℝ → ℝ) (a source : ℕ → D × ℝ → HarmonicCalculus.ComplexVector) (j : ℤ) (k : ℕ → ℝ) (Φ : ℕ → D → ℝ) (kp : ℕ → ℤ) : HarmonicBlock D := @@ -357,6 +361,7 @@ theorem pressureAliasRefreshBlock_band (r : ReconstructionData) end AliasErrors /-- Conjugacy is kept for both velocity and pressure coefficients. -/ +@[expose] def RealBlock {D : Type} (b : HarmonicBlock D) : Prop := (∀ n i, ConjugateSymmetric (b.velocity n i)) ∧ ∀ n, ConjugateSymmetric (b.pressure n) @@ -426,7 +431,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 +814,7 @@ end end -@[expose] public section +public section noncomputable section @@ -972,13 +977,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 +1016,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 +1027,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) : @@ -1059,6 +1064,7 @@ theorem coefficients_inputBounds /-- Equality along an actual straight fast orbit, imposed on the primitive slow data, not on the signed solve or its derivatives. -/ +@[expose] def FrozenAlong (v : D) (f : ℕ → D → E) : Prop := ∀ n x (t : ℝ), f n (x + t • v) = f n x @@ -1158,7 +1164,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 +1172,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 +1180,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) @@ -1288,6 +1294,7 @@ theorem conjugatePair_apply (a : D → ℂ) (j : ℤ) (x : D) : /-- Coefficient block, bundling `velocity`, `pressure`, `frequency`, `phase` and the required compatibility proofs. -/ +@[expose] noncomputable def coefficientBlock (frequency : ℕ → ℝ) (phase : ℕ → D → ℝ) (angularFrequency : ℕ → ℤ) (v : ℕ → D → ComplexVector) (p : ℕ → D → ℂ) : CorrectionState.HarmonicBlock D where @@ -1369,7 +1376,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)) @@ -1651,6 +1658,7 @@ theorem signedBlock_represents /-! ## Restriction of actual coefficient jets to the angular section -/ /-- Zero section, given by `(ContinuousLinearMap.id ℝ D).prod 0`. -/ +@[expose] noncomputable def zeroSection : D →L[ℝ] (D × ℝ) := (ContinuousLinearMap.id ℝ D).prod 0 theorem zeroSection_norm_le : ‖zeroSection (D := D)‖ ≤ 1 := by @@ -1660,6 +1668,7 @@ theorem zeroSection_norm_le : ‖zeroSection (D := D)‖ ≤ 1 := by /-- Section strip, bundling `domain`, `isOpen_domain`, `epsilon`, `epsilon_pos` and the required compatibility proofs. -/ +@[expose] noncomputable def sectionStrip (s : StripData (D × ℝ)) : StripData D where domain := (zeroSection (D := D)) ⁻¹' s.domain isOpen_domain := s.isOpen_domain.preimage (zeroSection (D := D)).continuous @@ -2005,7 +2014,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 +2056,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 → ℝ) @@ -2247,6 +2256,7 @@ theorem signedBlock_band /-- Gaussian block, given by `ErrorHarmonics.gaussianBlock d ψ a.amplitude 0 1 a.frequency (fun n x => a.phase n (x,0)) kp`. -/ +@[expose] noncomputable def gaussianBlock (a : LinearWaveBounds.WaveCoefficients (D × ℝ)) (d : LinearWaveBounds.GraphDirections (D × ℝ)) (ψ : ℕ → D × ℝ → ℝ) (kp : ℕ → ℤ) : CorrectionState.HarmonicBlock D := 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..18b437667f 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 @@ -100,6 +100,7 @@ theorem coordinateX_scale_h {h Q τ z s : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) coordinateX_scale (a := 2 * h) (s := s) (by linarith) (by linarith) hQ hτ /-- Physical time is `t=1-τ`; physical points have layout `(t,(s,z))`. -/ +@[expose] noncomputable def physicalScale (h Q : ℝ) (p : SimilarityProfile.PhysicalPoint) : SimilarityProfile.PhysicalPoint := (1 - Q * (1 - p.1), (Q * p.2.1, Q ^ D h * p.2.2)) @@ -157,23 +158,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 +317,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 +376,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..4b487f3d0a 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 @@ -42,6 +42,7 @@ variable {V : Type} [NormedAddCommGroup V] [NormedSpace ℝ V] /-- The same coefficient series evaluated at the actual stable coordinate extension, including the original leading power. -/ +@[expose] noncomputable def profileExtension (a : ℕ → ℕ) (h b : ℝ) (f : ℕ → Inner → V) (p : PhysicalPoint) : V := (EndpointCoordinates.chartExtension h p).1 ^ b • @@ -247,6 +248,7 @@ noncomputable def pressureNonzeroAxial {a : ℕ → ℕ} (ha : StrictMono a) {h agrees := fun _ hz => (pressureExtension_eventuallyEq a hh hh1 C d hz.2.1).self_of_nhds /-- The fixed physical radial anchor used for the exact gauge correction. -/ +@[expose] noncomputable def radialAnchor (p : PhysicalPoint) : PhysicalPoint := (p.1, (1, p.2.2)) theorem radialAnchor_smooth : ContDiff ℝ ∞ radialAnchor := @@ -254,6 +256,7 @@ theorem radialAnchor_smooth : ContDiff ℝ ∞ radialAnchor := /-- This is the literal anchored-potential formula. Equality of its curl with the original velocity is proved in the separate gauge module. -/ +@[expose] noncomputable def anchoredPotential (a : ℕ → ℕ) (h C : ℝ) (d : Coefficients) : VelocityField := AxisymmetricFields.potential (streamFactor a h C d) (fun p => swirlPotential a h C d p - swirlPotential a h C d (radialAnchor p)) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/SlowBorelBase.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/SlowBorelBase.lean index d1bc574618..3ae83960c0 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 @@ -40,10 +40,11 @@ abbrev Inner := ℝ × ℝ abbrev Chart := ℝ × Inner /-- Scale map, given by `SpatialBorelExtension.timeScale q`. -/ +@[expose] 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 +78,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 +160,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,21 +267,22 @@ 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 (positiveCoefficient h f)`. -/ +@[expose] noncomputable def positiveSum (a : ℕ → ℕ) (h : ℝ) (f : ℕ → Inner → V) : Chart → V := 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`. -/ @@ -288,6 +291,7 @@ noncomputable def cutPrefix (a : ℕ → ℕ) (h : ℝ) (f : ℕ → Inner → V f 0 y.2 + ∑ j ∈ Finset.range (J + 1), slowStage a h f j y /-- Uncut prefix, given by `f 0 y.2 + ∑ j ∈ Finset.range (J + 1), positiveCoefficient h f j y`. -/ +@[expose] noncomputable def uncutPrefix (h : ℝ) (f : ℕ → Inner → V) (J : ℕ) (y : Chart) : V := f 0 y.2 + ∑ j ∈ Finset.range (J + 1), positiveCoefficient h f j y @@ -644,13 +648,14 @@ theorem normalized_correction_bound {a : ℕ → ℕ} {h : ℝ} (hh : 0 < h) section PhysicalCoordinates /-- Inner box, given by `Icc lo hi ×ˢ Icc (-1) 1`. -/ +@[expose] noncomputable def innerBox (lo hi : ℝ) : Set Inner := Icc lo hi ×ˢ Icc (-1) 1 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 +822,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 +922,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)) @@ -1153,6 +1158,7 @@ structure SmoothCoefficients (d : Coefficients) : Prop where stressAxial : ∀ j, ContDiff ℝ ∞ (d.stressAxial j) /-- Global radial domain, bundling `carrier`, `isOpen`, `scale_mem`. -/ +@[expose] noncomputable def globalRadialDomain : ProfileHistories.RadialDomain where carrier := univ isOpen := isOpen_univ @@ -1176,6 +1182,7 @@ abbrev Bundle := Fin 7 → ℝ /-- One bundle forces one common cutoff schedule for the streams, angular data, pressure, and both stress components. -/ +@[expose] noncomputable def coefficientBundle (C : ℝ) (d : Coefficients) (j : ℕ) (w : Inner) : Bundle := ![ProfileHistories.average (d.axial j) w, -C⁻¹ * ProfileHistories.primitive (d.phi j) w, @@ -1195,6 +1202,7 @@ theorem coefficientBundle_smooth {d : Coefficients} (hd : SmoothCoefficients d) · exact hd.phi j /-- Bundle component, defined pointwise by `coefficientBundle C d j w i`. -/ +@[expose] noncomputable def bundleComponent (C : ℝ) (d : Coefficients) (i : Fin 7) : ℕ → Inner → ℝ := fun j w => coefficientBundle C d j w i @@ -1212,11 +1220,12 @@ 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) (bundleComponent C d 1)`. -/ +@[expose] noncomputable def swirlPotential (a : ℕ → ℕ) (h C : ℝ) (d : Coefficients) : Chart → ℝ := physicalProfile a h (1 / 2 - CoordinateAlgebra.A h) (bundleComponent C d 1) @@ -1226,24 +1235,27 @@ noncomputable def integratedStream (a : ℕ → ℕ) (h C : ℝ) (d : Coefficien /-- Base velocity, given by `AxisymmetricFields.velocity (streamFactor a h C d) (swirlPotential a h C d)`. -/ +@[expose] noncomputable def baseVelocity (a : ℕ → ℕ) (h C : ℝ) (d : Coefficients) : ProblemStatement.VelocityField := AxisymmetricFields.velocity (streamFactor a h C d) (swirlPotential a h C d) /-- 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) /-- Base stress theta, given by `physicalProfile a h (-CoordinateAlgebra.A h - 1 / 2) (bundleComponent C d 3)`. -/ +@[expose] noncomputable def baseStressTheta (a : ℕ → ℕ) (h C : ℝ) (d : Coefficients) : Chart → ℝ := physicalProfile a h (-CoordinateAlgebra.A h - 1 / 2) (bundleComponent C d 3) /-- Base stress axial, given by `physicalProfile a h (-CoordinateAlgebra.A h - 1 / 2) (bundleComponent C d 4)`. -/ +@[expose] noncomputable def baseStressAxial (a : ℕ → ℕ) (h C : ℝ) (d : Coefficients) : Chart → ℝ := physicalProfile a h (-CoordinateAlgebra.A h - 1 / 2) (bundleComponent C d 4) @@ -1468,18 +1480,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 +1598,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..d6ce1aa9e0 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,15 +299,15 @@ 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)`. -/ -noncomputable def pairs (N : ℕ) : Finset (ℕ × ℕ) := +@[expose] 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 @@ -559,6 +559,7 @@ theorem transport_series_identity {q X : ℝ} (hq : 0 < q) (hX : X ≠ 0) ring /-- Ordinary directional derivative on physical profile space. -/ +@[expose] def derivativeAlong (v : ProfilePoint) (f : Profile) (p : ProfilePoint) : ℝ := fderiv ℝ f p v @@ -590,7 +591,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 +654,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 +693,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 +710,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,11 +825,11 @@ 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 +@[expose] def pressureExponent (h : ℝ) : ℝ := -2 * CoordinateAlgebra.A h /-- Slow profiles data, collecting `phi`, `axial`, `flux`, `pressure`. -/ structure SlowProfiles where @@ -842,39 +843,41 @@ 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`. -/ +@[expose] 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`. -/ -def omegaCoefficient (h : ℝ) (f : SlowProfiles) (n : ℕ) : InnerProfile := +@[expose] def omegaCoefficient (h : ℝ) (f : SlowProfiles) (n : ℕ) : InnerProfile := transportCoefficient h 0 (-(1 / 2)) 0 f.flux f.axial f.flux (fun _ _ => 0) n /-- Divergence coefficient, given by `partialX (f.flux n) w + Z h (axialExponent h + slowOrder h n) (f.axial n) w`. -/ +@[expose] 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 +1032,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)) @@ -1166,6 +1169,7 @@ noncomputable def slowVelocity (N : ℕ) (h C : ℝ) (f : SlowProfiles) : (slowSwirl N h C f) (slowAxial N h f) /-- Slow pressure field, given by `AxisymmetricResidual.pressure (slowPressure N h f)`. -/ +@[expose] noncomputable def slowPressureField (N : ℕ) (h : ℝ) (f : SlowProfiles) : ProblemStatement.PressureField := AxisymmetricResidual.pressure (slowPressure N h f) @@ -1239,20 +1243,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 +1321,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..45c71d9ce2 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 : ℝ) @@ -466,6 +466,7 @@ theorem physicalChi_hasDerivAt_z (d : TailData) {p : PhysicalPoint} (ht : p.1 < ring /-- Physical taper, given by `tailShape d (Real.log (X d.h p) - y0)`. -/ +@[expose] noncomputable def physicalTaper (d : TailData) (y0 : ℝ) (p : PhysicalPoint) : ℝ := tailShape d (Real.log (X d.h p) - y0) @@ -547,10 +548,12 @@ theorem physicalHeat_eq_profileCarrier (C : ℝ) (d : TailData) (y0 : ℝ) _ = _ := by rw [← hp]; dsimp only [SimilarityProfile.inner]; ring /-- Literal physical angular velocity on the switched terminal collar. -/ +@[expose] noncomputable def physicalAngular (C : ℝ) (d : TailData) (y0 : ℝ) (p : PhysicalPoint) : ℝ := physicalHeat C (1 + d.h) p * physicalTaper d y0 p /-- Literal negative second axial derivative; no independent jet is supplied. -/ +@[expose] noncomputable def physicalSource (C : ℝ) (d : TailData) (y0 : ℝ) (p : PhysicalPoint) : ℝ := -deriv (deriv (fun z => physicalAngular C d y0 (p.1, (p.2.1, z)))) p.2.2 @@ -608,8 +611,10 @@ theorem stressX_eq_radialStress (C : ℝ) (d : TailData) (y0 : ℝ) rfl /-- Physical scale, given by `q d.h (t, (0, z))`. -/ +@[expose] noncomputable def physicalScale (d : TailData) (t z : ℝ) : ℝ := q d.h (t, (0, z)) /-- Physical eta, given by `eta d.h (t, (0, z))`. -/ +@[expose] noncomputable def physicalEta (d : TailData) (t z : ℝ) : ℝ := eta d.h (t, (0, z)) theorem physicalScale_pos (d : TailData) {t z : ℝ} (ht : t < 1) : diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/SlowRecursion.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/SlowRecursion.lean index b426ec8309..d73a128172 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 := @@ -455,6 +455,7 @@ end ExplicitInputs section SquaredRadius /-- Real parameter domain, given by `{eta | (eta : ℂ) ∈ U}`. -/ +@[expose] noncomputable def realParameterDomain (U : Set ℂ) : Set ℝ := {eta | (eta : ℂ) ∈ U} @@ -470,7 +471,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 +610,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 +741,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 +972,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 +982,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) : @@ -1039,6 +1035,7 @@ theorem partialXX_axisFactor {v : InnerProfile} {w : InnerPoint} ring /-- Z2, given by `Z h (b - D h) (Z h b v)`. -/ +@[expose] noncomputable def Z2 (h b : ℝ) (v : InnerProfile) : InnerProfile := Z h (b - D h) (Z h b v) @@ -1067,21 +1064,24 @@ 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)`. -/ +@[expose] noncomputable def shiftedAxial (h : ℝ) (V : ℕ → InnerProfile) : ℕ → InnerProfile | 0 => fun _ => 0 | k + 1 => Z2 h (slowOrder h k) (V k) /-- Shifted axial factor as an element of `ℕ → InnerProfile | 0 => fun _ => 0 | k + 1 => Z2 h (slowOrder h k - 1) (v k)`. -/ +@[expose] noncomputable def shiftedAxialFactor (h : ℝ) (v : ℕ → InnerProfile) : ℕ → InnerProfile | 0 => fun _ => 0 | k + 1 => Z2 h (slowOrder h k - 1) (v k) /-- The displayed Ω_k source before canceling its radial factor. -/ +@[expose] noncomputable def omega (h : ℝ) (U V : ℕ → InnerProfile) (k : ℕ) (w : InnerPoint) : ℝ := T h (slowOrder h k) (V k) w + (∑ ij ∈ Finset.antidiagonal k, @@ -1090,6 +1090,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 +1318,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 +1542,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 +1832,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1879,6 +1880,7 @@ theorem Regular.mul {R : ℝ} {U : Set ℂ} {F G : Raw} mul_zero, zero_mul, add_zero] /-- The class is an actual real algebra of functions. -/ +@[expose] noncomputable def regularAlgebra (R : ℝ) (U : Set ℂ) : Subalgebra ℝ Raw where carrier := {F | Regular R U F} zero_mem' := Regular.const R U 0 @@ -1909,11 +1911,12 @@ theorem AxisFunction.real {R : ℝ} {U : Set ℂ} (F : AxisFunction R U) (F (r, (eta : ℂ))).im = 0 := F.2.real r hr eta heta /-- Real constant, given by `algebraMap ℝ (AxisFunction R U) c`. -/ +@[expose] noncomputable def realConstant (R : ℝ) (U : Set ℂ) (c : ℝ) : AxisFunction R U := 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 +1961,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,11 +2118,11 @@ 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)`. -/ -noncomputable def complexProfile {R : ℝ} {U : Set ℂ} (F : AxisFunction R U) +@[expose] noncomputable def complexProfile {R : ℝ} {U : Set ℂ} (F : AxisFunction R U) (p : ℝ × ℂ) : ℂ := F (Real.sqrt p.1, p.2) theorem sqrt_mem {R X : ℝ} (hR : 0 < R) (hX : X ∈ Ico (0 : ℝ) (R ^ 2)) : @@ -2284,23 +2287,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 +2869,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) @@ -3106,7 +3109,7 @@ theorem profile_axis_jet {R : ℝ} (hR : 0 < R) {U : Set ℂ} (F : AxisFunction /-- A base made from four genuine profiles; its divergence coefficient is computed by the same canonical derivative operator used in the recursion. -/ -noncomputable def makeBase {R : ℝ} {U : Set ℂ} {h : ℝ} (c : Domain R U h) +@[expose] noncomputable def makeBase {R : ℝ} {U : Set ℂ} {h : ℝ} (c : Domain R U h) (phi u average pressure : AxisFunction R U) : Coefficient R U := ![phi, u, average - u, pressure, betaOperator c 0 u (average - u)] @@ -3142,7 +3145,7 @@ theorem sequence_mixed_pullback_holomorphic {core buffer : ℝ} {U : Set ℂ} {h (sequence c hcore hbuffer C base n i).2.even k m hr /-- The concrete finite equations of an actual sequence of profile functions. -/ -def OrderEquations {R : ℝ} {U : Set ℂ} (h C : ℝ) (A : ℕ → Coefficient R U) +@[expose] def OrderEquations {R : ℝ} {U : Set ℂ} (h C : ℝ) (A : ℕ → Coefficient R U) (n : ℕ) (w : SimilarityProfile.InnerPoint) : Prop := PositiveAxisSystem.PositiveOrderEquations h C w.2 w.1 n (fun j => PositiveAxisSystem.actualJet (profile (A j 0)) w) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/SlowResidualMatching.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/SlowResidualMatching.lean index 325b508c72..b09055220c 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,13 +39,14 @@ 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) pressure := pressure /-- The actual functions constructed by the regular-axis recursion. -/ +@[expose] noncomputable def hierarchyProfiles {R : ℝ} {U : Set ℂ} {h C : ℝ} {base : Fin 5 → InnerProfile} (A : SlowRecursion.LocalHierarchy R U h C base) : SlowProfiles := @@ -299,7 +300,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,16 +369,17 @@ 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`. -/ +@[expose] noncomputable def swirlRadius (C : ℝ) (f : InnerProfile) (w : InnerPoint) : ℝ := w.1 / C * toRadius f w @@ -433,19 +435,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 : ℝ) @@ -510,10 +513,12 @@ theorem zStress_identity {S : Set ℝ} (hS : IsOpen S) (h : ℝ) linear_combination hi /-- Physical theta stress, given by `finiteProfile N h (angularExponent h) (thetaStress h C f)`. -/ +@[expose] noncomputable def physicalThetaStress (N : ℕ) (h C : ℝ) (f : SlowProfiles) : PhysicalProfile := finiteProfile N h (angularExponent h) (thetaStress h C f) /-- Physical Z stress, given by `finiteProfile N h (angularExponent h) (zStress h f)`. -/ +@[expose] noncomputable def physicalZStress (N : ℕ) (h : ℝ) (f : SlowProfiles) : PhysicalProfile := finiteProfile N h (angularExponent h) (zStress h f) @@ -588,7 +593,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) @@ -873,6 +878,7 @@ noncomputable def transportPower (N : ℕ) (h e : ℝ) : TailIndex → ℝ /-- Transport term as an element of `TailIndex → InnerProfile | none => fun w => -Z2 h (e + slowOrder h N) (f N) w | some ij => fun w => transportKernel h e α v u f w ij.1 ij.2`. -/ +@[expose] noncomputable def transportTerm (N : ℕ) (h e α : ℝ) (v u f : ℕ → InnerProfile) : TailIndex → InnerProfile | none => fun w => -Z2 h (e + slowOrder h N) (f N) w @@ -979,7 +985,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 +995,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..9ae79aad19 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,16 +99,17 @@ 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] /-- Positive integral, given by `∫ R in Ioi (0 : ℝ), f R`. -/ +@[expose] 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 +472,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 +528,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,24 +568,26 @@ 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)`. -/ +@[expose] noncomputable def massHistory (u : JointProfile) : JointProfile := ProfileHistories.primitive (weightedAxial u) /-- Parameter mass history, given by `ProfileHistories.primitive (ProfileHistories.parameterPartial (weightedAxial u))`. -/ +@[expose] 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 @@ -700,6 +704,7 @@ theorem pressure_weighted_identity {q : JointProfile} (hq : ContDiff ℝ ∞ q) /-- Open parameter domains retain all radial histories while keeping the original parameter domain; no extension across its endpoints is needed. -/ +@[expose] noncomputable def parameterDomain (S : Set ℝ) (hS : IsOpen S) : ProfileHistories.RadialDomain where carrier := univ ×ˢ S isOpen := isOpen_univ.prod hS @@ -1024,7 +1029,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1038,15 +1043,16 @@ 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)`. -/ abbrev Smooth (S : Set ℝ) (f : Field) := ContDiffOn ℝ ∞ f (region S) /-- Exterior, given by `∀ eta ∈ S, ∀ R, B ≤ R → f (R, eta) = 0`. -/ +@[expose] noncomputable def exterior (B : ℝ) (S : Set ℝ) (f : Field) : Prop := ∀ eta ∈ S, ∀ R, B ≤ R → f (R, eta) = 0 @@ -1054,23 +1060,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 +1335,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 +1357,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 +1472,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 +1481,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 +1782,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) : @@ -1862,6 +1869,7 @@ theorem stress_slice_support (m : ℕ) {F : Field} {S : Set ℝ} {a B : ℝ} (hB exact hR (stress_exterior m hB hs hm (le_of_not_ge hh) heta) /-- Radial support, given by `∀ eta ∈ S, ∀ R, R ∉ Icc a b → f (R, eta) = 0`. -/ +@[expose] noncomputable def radialSupport (S : Set ℝ) (a b : ℝ) (f : Field) : Prop := ∀ eta ∈ S, ∀ R, R ∉ Icc a b → f (R, eta) = 0 @@ -2028,11 +2036,11 @@ theorem exterior_axialDensity {S : Set ℝ} (hS : IsOpen S) {n : ℕ} hr eta heta R hR, hz eta heta R hR, hk eta heta R hR, hprev eta heta R hR] /-- Angular stress, given by `stress 2 (angularDensity h n v u e)`. -/ -noncomputable def angularStress (h : ℝ) (n : ℕ) (v u e : History) : Field := +@[expose] noncomputable def angularStress (h : ℝ) (n : ℕ) (v u e : History) : Field := stress 2 (angularDensity h n v u e) /-- Axial stress, given by `stress 1 (axialDensity h n v u p)`. -/ -noncomputable def axialStress (h : ℝ) (n : ℕ) (v u : History) (p : Field) : Field := +@[expose] noncomputable def axialStress (h : ℝ) (n : ℕ) (v u : History) (p : Field) : Field := stress 1 (axialDensity h n v u p) /-- For n≥2 all the angular hypotheses below are supplied by ordinary @@ -2115,6 +2123,7 @@ theorem axial_stress_support {S : Set ℝ} (hS : IsOpen S) {n : ℕ} (hn : 0 < n /-- The order-one angular input is a moment of the actual axial viscosity, not a condition on the total residual. It is supplied by differentiating the restored renormalized order-zero physical angular moment. -/ +@[expose] noncomputable def LowerAngularViscosityMoment (S : Set ℝ) (B h : ℝ) (e₀ : Field) : Prop := ∀ eta ∈ S, moment B 2 (axialOp2 h (orderExponent h 0) e₀) eta = 0 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..12af16fcc9 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 @@ -447,6 +447,7 @@ theorem dyadicProfile_compactSupport : HasCompactSupport dyadicProfile := by exact isCompact_Icc /-- Integer Q, given by `(2 : ℝ) ^ (-(n : ℝ))`. -/ +@[expose] def integerQ (n : ℤ) : ℝ := (2 : ℝ) ^ (-(n : ℝ)) theorem integerQ_pos (n : ℤ) : 0 < integerQ n := Real.rpow_pos_of_pos (by norm_num) _ @@ -458,7 +459,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 +582,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 +628,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 +637,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..ea06a525d4 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) : @@ -79,15 +79,18 @@ theorem norm_iteratedFDeriv_pull (e : D ≃ₗᵢ[ℝ] E) (f : E → F) (m : ℕ e.norm_iteratedFDeriv_comp_right f x m /-- Field, defined pointwise by `f n (e x)`. -/ +@[expose] noncomputable def field (e : D ≃ₗᵢ[ℝ] E) (f : MeanIncrementBounds.Field E) : MeanIncrementBounds.Field D := fun n x => f n (e x) /-- Triple, given by `⟨field e b.radial, field e b.angular, field e b.axial⟩`. -/ +@[expose] noncomputable def triple (e : D ≃ₗᵢ[ℝ] E) (b : MeanIncrementBounds.Triple E) : MeanIncrementBounds.Triple D := ⟨field e b.radial, field e b.angular, field e b.axial⟩ /-- Operators, bundling `epsilon`, `radialFrequency`, `fastCoefficient`, `radius` and the required compatibility proofs. -/ +@[expose] noncomputable def operators (e : D ≃ₗᵢ[ℝ] E) (o : MeanIncrementBounds.Operators E) : MeanIncrementBounds.Operators D where epsilon := o.epsilon @@ -102,6 +105,7 @@ noncomputable def operators (e : D ≃ₗᵢ[ℝ] E) (o : MeanIncrementBounds.Op vT := e.symm o.vT /-- Context, bundling `operators`, `base`, `virtualTheta`, `virtualAxial`. -/ +@[expose] noncomputable def context (e : D ≃ₗᵢ[ℝ] E) (c : CorrectionState.Context E) : CorrectionState.Context D where operators := operators e c.operators @@ -110,17 +114,19 @@ 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 a.aliasError⟩`. -/ +@[expose] noncomputable def errors (e : D ≃ₗᵢ[ℝ] E) (a : CorrectionState.ExcludedErrors E) : CorrectionState.ExcludedErrors D := ⟨oscillation e a.base, oscillation e a.gaussian, oscillation e a.aliasError⟩ /-- State, bundling `mean`, `pressure`, `oscillation`, `oscillatoryPressure` and the required compatibility proofs. -/ +@[expose] noncomputable def state (e : D ≃ₗᵢ[ℝ] E) (u : CorrectionState.State E) : CorrectionState.State D where mean := triple e u.mean @@ -188,6 +194,7 @@ theorem totalPressure_pull (e : D ≃ₗᵢ[ℝ] E) (u : CorrectionState.State E /-- Coefficients, given by `AddMonoidAlgebra.ofCoeff (Finsupp.mapRange (fun f : E → ℂ => fun x => f (e x)) rfl a.coeff)`. -/ +@[expose] noncomputable def coefficients (e : D ≃ₗᵢ[ℝ] E) (a : HarmonicFields.Coefficients E) : HarmonicFields.Coefficients D := AddMonoidAlgebra.ofCoeff (Finsupp.mapRange (fun f : E → ℂ => fun x => f (e x)) rfl a.coeff) @@ -297,7 +304,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) @@ -306,6 +313,7 @@ noncomputable def block (e : D ≃ₗᵢ[ℝ] E) (b : CorrectionState.HarmonicBl angularFrequency := b.angularFrequency /-- Block coefficients, defined pointwise by `coefficients e (a n i)`. -/ +@[expose] noncomputable def blockCoefficients (e : D ≃ₗᵢ[ℝ] E) (a : HarmonicResidual.BlockCoefficients E) : HarmonicResidual.BlockCoefficients D := fun n i => coefficients e (a n i) @@ -324,6 +332,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 +656,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} @@ -783,10 +792,12 @@ variable {S : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] abbrev Associated (S : Type) := (ℝ × S) × TorusInverse.Plane /-- The actual auxiliary torus integral in the associated layout. -/ +@[expose] noncomputable def associatedTorusAverage (f : Associated S → ℝ) (p : ℝ × S) : ℝ := ∫ y in (0 : ℝ)..1, ∫ x in (0 : ℝ)..1, f (p, (x, y)) /-- The actual radial integral of that torus average. -/ +@[expose] noncomputable def associatedMass (f : Associated S → ℝ) (s : S) : ℝ := ∫ r, associatedTorusAverage f (r, s) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/StressActivation.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/StressActivation.lean index b29837fbc2..1fe2e8fe20 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,33 +1216,34 @@ 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 /-- Shear slope, given by `actualP2 T κ X0 L U p / actualP1 T κ L p`. -/ +@[expose] 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..17a7593dfd 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,11 +2251,12 @@ 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 / OutgoingHistories.E w (y, eta)`. -/ +@[expose] noncomputable def actualBs {d : TailData} {K : ℝ} (w : ResetWitness d K) (Amp : ℝ → ℝ) (y eta : ℝ) : ℝ := 2 * deriv (fun t => OutgoingHistories.U d Amp (t, eta)) y / OutgoingHistories.E w (y, eta) 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..f709a0bc70 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 @@ -33,9 +33,11 @@ open scoped Topology ContDiff abbrev Point := AxisymmetricFields.ProfilePoint /-- The radial anchor is physical and independent of the similarity scale. -/ +@[expose] noncomputable def radialAnchor (p : Point) : Point := (p.1, (1, p.2.2)) /-- Radial normalize, given by `K p - K (radialAnchor p)`. -/ +@[expose] noncomputable def radialNormalize (K : Point → ℝ) (p : Point) : ℝ := K p - K (radialAnchor p) @@ -68,6 +70,7 @@ theorem radialNormalize_anchor (K : Point → ℝ) (t z : ℝ) : radialNormalize K (t, (1, z)) = 0 := sub_self _ /-- This is the entire summed swirl potential, with all slow orders retained. -/ +@[expose] noncomputable def gaugedSwirl (a : ℕ → ℕ) (h C : ℝ) (d : SlowBorelBase.Coefficients) : Point → ℝ := radialNormalize (SlowBorelBase.swirlPotential a h C d) @@ -78,6 +81,7 @@ theorem gaugedSwirl_apply (a : ℕ → ℕ) (h C : ℝ) (d : SlowBorelBase.Coeff /-- Potential, given by `AxisymmetricFields.potential (SlowBorelBase.streamFactor a h C d) (gaugedSwirl a h C d)`. -/ +@[expose] noncomputable def potential (a : ℕ → ℕ) (h C : ℝ) (d : SlowBorelBase.Coefficients) : VelocityField := AxisymmetricFields.potential (SlowBorelBase.streamFactor a h C d) (gaugedSwirl a h C d) @@ -500,6 +504,7 @@ end FinalBase /-- A closed choice of the already constructed leading profile, repaired hierarchy, modulation, and common cutoff schedule. -/ +@[expose] noncomputable def constructedPotential (upper : ℝ) (B : ℕ) : VelocityField := finalPotential FinalSlowBase.actualProfile.certificate FinalSlowBase.actualProfile.modulation upper B 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..fff69713e7 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) @@ -435,6 +436,7 @@ variable {S : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] /-- The source in joint slow-parameter/torus coordinates, with the real source embedded isometrically in the complex Fourier construction. -/ +@[expose] noncomputable def sourceToFamily (f : PressureStream.Lift S → ℝ) (z : (ℝ × S) × Plane) : ℂ := f (z.1.1, (z.1.2, z.2)) @@ -459,7 +461,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 +566,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 @@ -639,6 +641,7 @@ section NativePullback variable {S : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] /-- Pullback cover, given by `f (z.1, (z.2.1, coverMap i z.2.2))`. -/ +@[expose] noncomputable def pullbackCover (i : ℕ) (f : PressureStream.Lift S → ℝ) (z : PressureStream.Lift S) : ℝ := f (z.1, (z.2.1, coverMap i z.2.2)) @@ -699,19 +702,20 @@ variable {S : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] [FiniteDimensiona /-- Axial potential, given by `PressureStream.streamPotential d a b M ((0 : S), v) (desiredIncrement h n f)`. -/ +@[expose] noncomputable def axialPotential (d a b M : ℝ) (v : Plane) (h : ℝ) (n : ℕ) (f : PressureStream.Lift S → ℝ) : PressureStream.Lift S → ℝ := PressureStream.streamPotential d a b M ((0 : S), v) (desiredIncrement h n f) /-- 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) @@ -725,6 +729,7 @@ theorem radialUpdate_smul_direction (d a b M : ℝ) (v : Plane) (w : S × Plane) smul_eq_mul, mul_neg] /-- The retained compactification alias, with its physical `1/r` factor. -/ +@[expose] noncomputable def axialAlias (d a b M : ℝ) (v : Plane) (h : ℝ) (n : ℕ) (f : PressureStream.Lift S → ℝ) : PressureStream.Lift S → ℝ := PressureStream.divideRadius (RadialPullback.physicalAlias d a b M ((0 : S), v) @@ -1075,8 +1080,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..ae394f0d06 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 @@ -463,6 +463,7 @@ theorem clock_band_transport (h : ℝ) (n m i ir k : ℕ) (hi : i + k = ir) : field_simp [(Real.rpow_pos_of_pos (ChartScales.Q_pos m) (1+h)).ne'] /-- Axial direction, given by `((0,1),0)`. -/ +@[expose] noncomputable def axialDirection : Plane × Plane := ((0,1),0) theorem band_axial_scalar (h : ℝ) (n m : ℕ) : 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..5ab363a1f4 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,23 +31,26 @@ 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 (OutgoingDilation.switchRadius F XR)`. -/ +@[expose] noncomputable def normalization (F : OutgoingProfile.Profile) (XR : ℝ) : ℝ := TerminalPressure.releasedNormalization F.data (OutgoingDilation.switchRadius F XR) /-- Shift, given by `Real.log (OutgoingDilation.switchRadius F XR) - 1 / 5`. -/ +@[expose] 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 +72,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..5ec57fb093 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 @@ -37,6 +37,7 @@ namespace NavierStokes.TerminalEdgeFactor abbrev EdgeParam := ℝ × ℝ /-- Time of, given by `1 - Real.exp p.1`. -/ +@[expose] noncomputable def timeOf (p : EdgeParam) : ℝ := 1 - Real.exp p.1 /-- Axis point, given by `(timeOf p, (0, p.2))`. -/ noncomputable def axisPoint (p : EdgeParam) : SimilarityProfile.PhysicalPoint := @@ -51,9 +52,11 @@ noncomputable def chartEta (d : TailData) (p : EdgeParam) : ℝ := noncomputable def outerRadius (d : TailData) (y0 : ℝ) (p : EdgeParam) : ℝ := Real.sqrt (2 * chartQ d p * Real.exp (y0 + 3)) /-- Radius, given by `outerRadius d y0 y.1 * Real.exp (-y.2 / 2)`. -/ +@[expose] noncomputable def radius (d : TailData) (y0 : ℝ) (y : EdgeParam × ℝ) : ℝ := outerRadius d y0 y.1 * Real.exp (-y.2 / 2) /-- Chart point, given by `radiusPoint (timeOf y.1) (radius d y0 y) y.1.2`. -/ +@[expose] noncomputable def chartPoint (d : TailData) (y0 : ℝ) (y : EdgeParam × ℝ) : SimilarityProfile.PhysicalPoint := radiusPoint (timeOf y.1) (radius d y0 y) y.1.2 @@ -122,6 +125,7 @@ theorem chart_logX (d : TailData) (y0 : ℝ) (y : EdgeParam × ℝ) : rw [chartX, Real.log_exp] /-- Carrier, given by `physicalHeat C (1 + d.h) (chartPoint d y0 y)`. -/ +@[expose] noncomputable def carrier (C : ℝ) (d : TailData) (y0 : ℝ) (y : EdgeParam × ℝ) : ℝ := physicalHeat C (1 + d.h) (chartPoint d y0 y) @@ -166,6 +170,7 @@ theorem carrierRadial_contDiff (C : ℝ) (d : TailData) (y0 : ℝ) : (chartPoint_contDiff d y0).contDiffAt) /-- Denominator, given by `timeDenominator d.h (timeOf p) p.2`. -/ +@[expose] noncomputable def denominator (d : TailData) (p : EdgeParam) : ℝ := timeDenominator d.h (timeOf p) p.2 @@ -178,7 +183,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 +233,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) @@ -278,6 +283,7 @@ theorem physical_heat_argument (d : TailData) (y0 : ℝ) (y : EdgeParam × ℝ) field_simp [(chartQ_pos d y.1).ne'] /-- Log taper, given by `tailShape d (y - y0)`. -/ +@[expose] noncomputable def logTaper (d : TailData) (y0 : ℝ) (y : ℝ) : ℝ := tailShape d (y - y0) /-- Radial taper, given by `radialSlice (flattening d.h (logTaper d y0)) (timeOf p) p.2`. -/ noncomputable def radialTaper (d : TailData) (y0 : ℝ) (p : EdgeParam) : ℝ → ℝ := @@ -488,6 +494,7 @@ theorem viscous_weight_integrable (C : ℝ) (d : TailData) (y0 : ℝ) (p : EdgeP /-- Angular stress, given by `terminalStress C d.h (logTaper d y0) (timeOf y.1) y.1.2 (radius d y0 y)`. -/ +@[expose] noncomputable def angularStress (C : ℝ) (d : TailData) (y0 : ℝ) (y : EdgeParam × ℝ) : ℝ := terminalStress C d.h (logTaper d y0) (timeOf y.1) y.1.2 (radius d y0 y) @@ -732,6 +739,7 @@ noncomputable def pressureGradient (C : ℝ) (d : TailData) (y0 : ℝ) (canonicalPressure (swirlCoefficient C d.h (logTaper d y0))) (chartPoint d y0 y) /-- The actual axial backward stress, written in the regular radius `s=r²/2`. -/ +@[expose] noncomputable def axialStress (C : ℝ) (d : TailData) (y0 : ℝ) (y : EdgeParam × ℝ) : ℝ := (∫ s in Ioi (radius d y0 y ^ 2 / 2), SimilarityProfile.partialZ (canonicalPressure (swirlCoefficient C d.h (logTaper d y0))) @@ -794,12 +802,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 +837,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 +875,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') @@ -915,12 +923,14 @@ theorem profileCorrectionCoefficient_contDiff (C : ℝ) (d : TailData) (y0 : ℝ ((taperSlopeFactor_contDiff d).comp contDiff_snd) /-- Profile angular factor, constructed using `profileBoundaryCoefficient`. -/ +@[expose] noncomputable def profileAngularFactor (C : ℝ) (d : TailData) (y0 : ℝ) (y : ℝ × ℝ) : ℝ := profileBoundaryCoefficient C d y0 y + (y.2 ^ 3 / profileRadius y0 y.2 ^ 2) * (ParametricFlatFactor.factor 4 3 (profileTimeCoefficient C d y0) y + ParametricFlatFactor.factor 4 3 (profileCorrectionCoefficient C d y0) y) /-- The boundary term and the two actual terminal primitives in profile coordinates. -/ +@[expose] noncomputable def profileAngularStress (C : ℝ) (d : TailData) (y0 : ℝ) (y : ℝ × ℝ) : ℝ := (FlatCutoff.edge 4 y.2 / y.2 ^ 3) * profileBoundaryCoefficient C d y0 y + (ParametricFlatFactor.primitive 4 3 (profileTimeCoefficient C d y0) y + @@ -1012,6 +1022,7 @@ noncomputable def profileAxialFactor (C : ℝ) (d : TailData) (y0 : ℝ) (y : /-- The second terminal primitive is the integral of the first one, with the exact Jacobian `s = exp(Y-δ)` of the regular radial coordinate. -/ +@[expose] noncomputable def profileAxialStress (C : ℝ) (d : TailData) (y0 : ℝ) (y : ℝ × ℝ) : ℝ := (∫ u in (0 : ℝ)..y.2, profileS y0 u * profilePressureGradient C d y0 (y.1, u)) / profileRadius y0 y.2 @@ -1157,6 +1168,7 @@ theorem axialStress_factorization (C : ℝ) (d : TailData) (y0 : ℝ) (y : EdgeP /-! ## Agreement with the physical section away from the endpoints -/ /-- Normalized param, given by `(Real.log (1 - η ^ 2), η)`. -/ +@[expose] noncomputable def normalizedParam (η : ℝ) : EdgeParam := (Real.log (1 - η ^ 2), η) theorem timeOf_normalizedParam {η : ℝ} (hη : η ^ 2 < 1) : @@ -1318,11 +1330,13 @@ theorem axialStress_normalizedParam (C : ℝ) (d : TailData) (y0 x : ℝ) /-! ## Full profile stress, all jets, and the edge direction -/ /-- Profile stress, given by `(profileAngularStress C d y0 y, profileAxialStress C d y0 y)`. -/ +@[expose] noncomputable def profileStress (C : ℝ) (d : TailData) (y0 : ℝ) (y : ℝ × ℝ) : ℝ × ℝ := (profileAngularStress C d y0 y, profileAxialStress C d y0 y) /-- Profile stress factor, given by `(profileAngularFactor C d y0 y, y.2 ^ 6 * profileAxialFactor C d y0 y)`. -/ +@[expose] noncomputable def profileStressFactor (C : ℝ) (d : TailData) (y0 : ℝ) (y : ℝ × ℝ) : ℝ × ℝ := (profileAngularFactor C d y0 y, y.2 ^ 6 * profileAxialFactor C d y0 y) @@ -1396,6 +1410,7 @@ theorem profileAxialStress_edge_jets (C : ℝ) (d : TailData) (y0 : ℝ) (n : /-- Profile tilt, given by `y.2 ^ 6 * profileAxialFactor C d y0 y / profileAngularFactor C d y0 y`. -/ +@[expose] noncomputable def profileTilt (C : ℝ) (d : TailData) (y0 : ℝ) (y : ℝ × ℝ) : ℝ := y.2 ^ 6 * profileAxialFactor C d y0 y / profileAngularFactor C d y0 y @@ -1428,7 +1443,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 +1531,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 +1588,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) @@ -1727,6 +1743,7 @@ theorem physicalStress_normalizedParam (C : ℝ) (d : TailData) (y0 x : ℝ) /-- Profile swirl coefficient, given by `profileAngularVelocity C d y0 y / profileRadius y0 y.2`. -/ +@[expose] noncomputable def profileSwirlCoefficient (C : ℝ) (d : TailData) (y0 : ℝ) (y : ℝ × ℝ) : ℝ := profileAngularVelocity C d y0 y / profileRadius y0 y.2 @@ -1738,11 +1755,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..eb8480f5eb 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 @@ -447,15 +447,17 @@ theorem transport_histories_zero_after_switch {F : Profile} {XR C : ℝ} /-- Normalization, given by `TerminalPressure.releasedNormalization F.data (OutgoingDilation.switchRadius F XR)`. -/ +@[expose] 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 (-TerminalPressure.amplitudeExponent F.data.h) (HeatedOutgoing.E F XR c)`. -/ +@[expose] noncomputable def physicalAngular (F : Profile) (XR : ℝ) (c : ℝ → Coeff) : SimilarityProfile.PhysicalProfile := SimilarityProfile.pullback F.data.h (-TerminalPressure.amplitudeExponent F.data.h) @@ -543,6 +545,7 @@ theorem physicalPressure_eq_terminal (F : Profile) {XR : ℝ} (hXR : 0 < XR) /-! ## The actual forward stress on the switched tail -/ /-- Forward theta, constructed using `HeatSwitchCone.logE`. -/ +@[expose] noncomputable def forwardTheta (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : ℝ × ℝ) : ℝ := HeatSwitchCone.logE F XR c p / Real.sqrt (2 * XR * Real.exp p.1) * @@ -551,7 +554,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)) @@ -723,6 +726,7 @@ open ProfileHistories (radialPartial parameterPartial) /-- Eta derivative, given by `derivWithin (fun η => G (p.1,η)) HeatedOutgoing.parameterDomain p.2`. -/ +@[expose] noncomputable def etaDerivative (G : (ℝ × ℝ) → ℝ) (p : ℝ × ℝ) : ℝ := derivWithin (fun η => G (p.1,η)) HeatedOutgoing.parameterDomain p.2 diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/TerminalPressure.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/TerminalPressure.lean index 04239f0233..04eb0d9452 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) @@ -94,11 +94,16 @@ theorem heatJet_bound {h ν v : ℝ} (hh : 0 < h) (hν : 0 ≤ ν) (hv : 1 ≤ v have hvp : 0 < v := zero_lt_one.trans_le hv have hj : |RadialHeatProfile.profileJet (1 + h) n (2 * ν / v)| ≤ ParametricHeatTail.heatJetBound h n := by - rw [← RadialHeatProfile.iteratedDerivWithin_profile (by linarith) n (by positivity)] - exact RadialHeatProfile.profile_derivative_bound (by linarith) n (by positivity) + have ha : 1 < 1 + h := by linarith [hh] + have hz : 0 ≤ 2 * ν / v := div_nonneg (mul_nonneg (by norm_num) hν) hvp.le + rw [← RadialHeatProfile.iteratedDerivWithin_profile ha n hz] + simpa only [ParametricHeatTail.heatJetBound] using + (RadialHeatProfile.profile_derivative_bound ha n hz) have hp : (2 / v) ^ n ≤ (2 : ℝ) ^ n := by - gcongr - exact div_le_self (by norm_num) hv + have hdiv : (2 : ℝ) / v ≤ 2 := by + apply (div_le_iff₀ hvp).2 + nlinarith [hv] + exact pow_le_pow_left₀ (div_nonneg (by norm_num) hvp.le) hdiv n rw [heatJet, abs_mul, abs_of_nonneg (pow_nonneg (by positivity) n)] exact mul_le_mul hp hj (abs_nonneg _) (by positivity) @@ -122,6 +127,7 @@ theorem heatPressureJet_hasDerivWithinAt {h ν v : ℝ} (hh : 0 < h) theorem heatPressureJet_dominated {h : ℝ} (hh : 0 < h) : ParametricHeatTail.ChainDominated (heatPressureJet h) (volume.restrict (Ioi (1 : ℝ))) := by + unfold ParametricHeatTail.ChainDominated intro n L hL let B := ParametricHeatTail.jetProduct (heatJetBound h) (heatJetBound h) n refine ⟨fun v => pressureWeight h v * B, ?_, ?_⟩ @@ -170,7 +176,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`. -/ @@ -565,6 +571,7 @@ theorem canonicalPressure_contDiffAt (C : ℝ) {h Y : ℝ} {f : ℝ → ℝ} /-- Log scale derivative, given by `CoordinateAlgebra.qAxial (SimilarityProfile.q h p) h (SimilarityProfile.eta h p) / SimilarityProfile.q h p`. -/ +@[expose] noncomputable def logScaleDerivative (h : ℝ) (p : SimilarityProfile.PhysicalPoint) : ℝ := CoordinateAlgebra.qAxial (SimilarityProfile.q h p) h (SimilarityProfile.eta h p) / SimilarityProfile.q h p @@ -864,7 +871,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 +899,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 +1110,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 +1350,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..81594e2125 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. -/ @@ -675,12 +675,13 @@ theorem forward_eq_backward_iff {R : ℝ → ℝ} {r : ℝ} (hr : 0 < r) /-- Time denominator, given by `SimilarityProfile.q h (t, (0, z)) * CoordinateAlgebra.L h (SimilarityProfile.eta h (t, (0, z)))`. -/ +@[expose] noncomputable def timeDenominator (h t z : ℝ) : ℝ := SimilarityProfile.q h (t, (0, z)) * CoordinateAlgebra.L h (SimilarityProfile.eta h (t, (0, 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 +758,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..51dee7bce6 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] @@ -2566,6 +2568,7 @@ theorem det_slotLinearMap (vr vt : Plane) : simp [slotLinearMap, LinearMap.det_toLin, Matrix.det_fin_two, mul_comm] /-- The genuine nondegenerate native chart. -/ +@[expose] noncomputable def slotChart (vr vt : Plane) (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) : Plane ≃L[ℝ] Plane := ((slotLinearMap vr vt).equivOfDetNeZero ((det_slotLinearMap vr vt).trans_ne @@ -2586,6 +2589,7 @@ theorem integral_periodize_slot {V : Type*} [NormedAddCommGroup V] [NormedSpace rw [integral_periodize_nativeField _ center hf hcf, det_slotChart] /-- Rescaling the transverse coordinate by `ci`. -/ +@[expose] noncomputable def transverseChart (ci : ℝ) (hci : ci ≠ 0) : Plane ≃L[ℝ] Plane := slotChart (1, 0) (0, ci) (by simpa using hci) @@ -2606,6 +2610,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 +2686,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..fbc2187539 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} @@ -225,6 +225,7 @@ namespace StockReference variable {J : Set ℝ} (R : StockReference J) /-- Chart, given by `(radius R.radius0 p.1, p.2)`. -/ +@[expose] noncomputable def chart (p : Point) : Point := (radius R.radius0 p.1, p.2) theorem chart_smooth : ContDiff ℝ ∞ R.chart := @@ -235,17 +236,21 @@ theorem chart_radius_pos (p : Point) : 0 < (R.chart p).1 := /-- Angular stock, defined pointwise by `ActivationStocks.profileStockOne R.profiles R.exponent (R.chart p)`. -/ +@[expose] noncomputable def angularStock : Field := fun p => ActivationStocks.profileStockOne R.profiles R.exponent (R.chart p) /-- This is `X * ns_REF`, including the radial factor in the axial ODE. -/ +@[expose] noncomputable def axialStock : Field := fun p => (R.chart p).1 * R.profiles.axialLag R.exponent (R.chart p) / NaturalAxisData.L R.exponent p.2 /-- Initial log, given by `Real.log (R.profiles.f (R.radius0, η))`. -/ +@[expose] noncomputable def initialLog (η : ℝ) : ℝ := Real.log (R.profiles.f (R.radius0, η)) /-- Initial U, given by `R.profiles.U (R.radius0, η)`. -/ +@[expose] noncomputable def initialU (η : ℝ) : ℝ := R.profiles.U (R.radius0, η) theorem angularStock_smooth (hJ : IsOpen J) : @@ -290,15 +295,17 @@ 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`. -/ +@[expose] noncomputable def logAmplitude (T κ w₁ w₂ : ℝ) : Field := logField T κ R.bigTime w₁ w₂ R.initialLog R.angularStock /-- Axial velocity, given by `axialField T κ R.bigTime w₁ R.initialU R.axialStock`. -/ +@[expose] noncomputable def axialVelocity (T κ w₁ : ℝ) : Field := axialField T κ R.bigTime w₁ R.initialU R.axialStock @@ -713,9 +720,9 @@ namespace StockReference variable {J : Set ℝ} (R : StockReference J) /-- Log time, given by `Real.log (X / R.radius0)`. -/ -noncomputable def logTime (X : ℝ) : ℝ := Real.log (X / R.radius0) +@[expose] 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 @@ -732,12 +739,12 @@ theorem chart_logTime {X η : ℝ} (hX : 0 < X) : R.chart (R.logTime X, η) = (X /-- Physical F, defined pointwise by `if p.1 ≤ R.radius0 then R.profiles.f p else Real.exp (R.logAmplitude T κ w₁ w₂ (R.logPoint p))`. -/ -noncomputable def physicalF (T κ w₁ w₂ : ℝ) : Field := fun p => +@[expose] noncomputable def physicalF (T κ w₁ w₂ : ℝ) : Field := fun p => if p.1 ≤ R.radius0 then R.profiles.f p else Real.exp (R.logAmplitude T κ w₁ w₂ (R.logPoint p)) /-- Physical U, defined pointwise by `if p.1 ≤ R.radius0 then R.profiles.U p else R.axialVelocity T κ w₁ (R.logPoint p)`. -/ -noncomputable def physicalU (T κ w₁ : ℝ) : Field := fun p => +@[expose] noncomputable def physicalU (T κ w₁ : ℝ) : Field := fun p => if p.1 ≤ R.radius0 then R.profiles.U p else R.axialVelocity T κ w₁ (R.logPoint p) theorem physicalF_before (T κ w₁ w₂ : ℝ) {p : Point} (hp : p.1 ≤ R.radius0) : @@ -747,12 +754,13 @@ theorem physicalU_before (T κ w₁ : ℝ) {p : Point} (hp : p.1 ≤ R.radius0) R.physicalU T κ w₁ p = R.profiles.U p := ite_eq_left hp /-- Endpoint U, given by `R.axialVelocity T κ w₁ (R.finalTime, η)`. -/ +@[expose] noncomputable def endpointU (T κ w₁ : ℝ) (η : ℝ) : ℝ := R.axialVelocity T κ w₁ (R.finalTime, η) /-- Endpoint log, given by `Real.log C + Real.log 220 / 2 + R.logAmplitude T κ w₁ w₂ (R.finalTime, η)`. -/ -noncomputable def endpointLog (T κ w₁ w₂ C : ℝ) (η : ℝ) : ℝ := +@[expose] noncomputable def endpointLog (T κ w₁ w₂ C : ℝ) (η : ℝ) : ℝ := Real.log C + Real.log 220 / 2 + R.logAmplitude T κ w₁ w₂ (R.finalTime, η) theorem endpointU_smooth (hJ : IsOpen J) (T κ w₁ : ℝ) : @@ -788,7 +796,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 +828,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 → @@ -1107,7 +1115,7 @@ theorem physicalF_positive (T κ w₁ w₂ : ℝ) {p : Point} /-- The pressure and all moments are recomputed from these exact physical fields. This is the object used by the later cone and matching modules. -/ -noncomputable def physicalProfiles {T κ w₁ w₂ : ℝ} (hT : 0 < T) +@[expose] noncomputable def physicalProfiles {T κ w₁ w₂ : ℝ} (hT : 0 < T) (hb : δ ≤ (ofNatural F hΛ hsmall hδ hδT hP0).bigTime) (hw₁ : 0 < w₁) (hw₂ : 0 < w₂) : Profiles (Input.ofNatural hΛ F).radialDomain where f := (ofNatural F hΛ hsmall hδ hδT hP0).physicalF T κ w₁ w₂ 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..dbdd7a0510 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 @@ -278,6 +278,7 @@ theorem nativeSlice_uniform {s : StripData ((Q × ℝ) × TorusInverse.Plane)} uniform_zeroSection (uniform_reindex (ParticularWaveAssembly.angleShuffle (P := Q)) hf) /-- The native whole-angle strip used by the literal particular solver. -/ +@[expose] noncomputable def nativeStrip (s : StripData (Q × TorusInverse.Plane)) : StripData ((Q × ℝ) × TorusInverse.Plane) := ParticularWaveBounds.reindexStrip (ParticularWaveAssembly.angleShuffle (P := Q)).symm 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..a2a58656b1 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) @@ -699,6 +699,7 @@ theorem parameterPartial_inverse (d : Direction) {f : Source P} (hf : ContDiff /-- A prefix of actual full joint Fréchet-jet bounds on a parameter set. The torus argument ranges over the whole universal cover. -/ +@[expose] def JetBound (f : Source P) (S : Set P) (n : ℕ) (C : ℝ) : Prop := ∀ j ≤ n, ∀ p ∈ S, ∀ Y, ‖iteratedFDeriv ℝ j f (p, Y)‖ ≤ C @@ -1200,7 +1201,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1307,7 +1308,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 +1484,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 +1540,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 +1576,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))`. -/ @@ -1640,6 +1641,7 @@ section RealInverse variable {P : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] /-- Parameter periodic, given by `∀ p, FourierAlias.TorusPeriodic (fun Y => f (p, Y))`. -/ +@[expose] noncomputable def ParameterPeriodic {F : Type} (f : P × Plane → F) : Prop := ∀ p, FourierAlias.TorusPeriodic (fun Y => f (p, Y)) @@ -1680,7 +1682,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`. -/ @@ -1848,6 +1850,7 @@ section TransportInverse variable {S : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] [FiniteDimensional ℝ S] /-- Family inverse, given by `fromProduct (SmoothFamilyTorusInverse.inverse d (toProduct f))`. -/ +@[expose] noncomputable def familyInverse (d : Direction) (f : ℝ × (S × Plane) → ℂ) : ℝ × (S × Plane) → ℂ := fromProduct (SmoothFamilyTorusInverse.inverse d (toProduct f)) @@ -1857,12 +1860,13 @@ theorem mean_toProduct (f : ℝ × (S × Plane) → ℂ) (p : ℝ × S) : SmoothFamilyTorusInverse.mean_eq_integral _ _ /-- Real center source, given by `fromProduct (realCentered (toProduct f))`. -/ +@[expose] noncomputable def realCenterSource (f : ℝ × (S × Plane) → ℝ) : ℝ × (S × Plane) → ℝ := fromProduct (realCentered (toProduct f)) 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) := @@ -1994,6 +1998,7 @@ theorem familyInverse_solves (d : Direction) {f : ℝ × (S × Plane) → ℂ} exact hi /-- Admissible, constructed using `ContDiff`. -/ +@[expose] noncomputable def Admissible (a b : ℝ) (f : ℝ × (S × Plane) → ℂ) : Prop := ContDiff ℝ ∞ f ∧ SmoothFamilyTorusInverse.Periodic (toProduct f) ∧ SmoothFamilyTorusInverse.ZeroMean (toProduct f) ∧ RadialAlias.RadiallySupported a b f @@ -2262,7 +2267,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 +2334,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..47cc020b50 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 @@ -34,6 +34,7 @@ variable {D : Type} {ι : Type*} [NormedAddCommGroup D] [NormedSpace ℝ D] /-- Uniform input classes for each fixed signed Fourier mode and physical component. The label and band are inside the uniform estimate. -/ +@[expose] noncomputable def UniformVelocity (s : StripData D) (P : ι → ℕ → D → ℝ) (α : ℝ) (a : ι → CorrectionState.HarmonicBlock D) : Prop := ∀ i j, j ≠ 0 → UniformWaveClass s P α (fun l n x => (a l).velocity n i j x) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/UniformPrimaryWeights.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/UniformPrimaryWeights.lean index ea8d85b554..323105301d 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 @@ -52,6 +52,7 @@ noncomputable def reindexedStrip (s : StripData D) (e : ℕ → ℕ × ι) : Str zeta_nonneg := s.zeta_nonneg /-- Pull, defined pointwise by `f (e k).2 (e k).1`. -/ +@[expose] noncomputable def pull (e : ℕ → ℕ × ι) (f : ι → ℕ → D → E) : ℕ → D → E := fun k => f (e k).2 (e k).1 @@ -242,6 +243,7 @@ theorem class_of_single {w : ℕ → D → ℝ} {f : ℕ → D → E} (hf : MemC /-- Uniform band bound, given by `∃ C : ℝ, 0 ≤ C ∧ ∃ p : ℕ, ∀ l n, ‖a l n‖ ≤ C * s.epsilon n ^ β * s.slow n ^ p`. -/ +@[expose] noncomputable def UniformBandBound (s : StripData D) (β : ℝ) (a : ι → ℕ → ℝ) : Prop := ∃ C : ℝ, 0 ≤ C ∧ ∃ p : ℕ, ∀ l n, ‖a l n‖ ≤ C * s.epsilon n ^ β * s.slow n ^ p diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ValidDyadicBandCover.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ValidDyadicBandCover.lean index 3e89529598..eedbba4552 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 @@ -50,6 +50,7 @@ variable {ι D E : Type*} def domain (U : ι → Set D) : Set D := ⋃ i, U i /-- Compatible, given by `∀ i j, EqOn (f i) (f j) (U i ∩ U j)`. -/ +@[expose] def Compatible (U : ι → Set D) (f : ι → D → E) : Prop := ∀ i j, EqOn (f i) (f j) (U i ∩ U j) @@ -214,7 +215,7 @@ end end -@[expose] public section +public section noncomputable section @@ -224,6 +225,7 @@ open Set Filter ProblemStatement PhysicalWaveSum open scoped Topology ContDiff /-- Strictly inside the band: the normalized physical scale is in `(1/2,2)`. -/ +@[expose] noncomputable def band (h : ℝ) (n : ℕ) : Set SpaceTime := {w | w ∈ preterminal ∧ ChartScales.Q n / 2 < physicalQ h w ∧ physicalQ h w < 2 * ChartScales.Q n} @@ -259,6 +261,7 @@ theorem exists_band {h : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) (N : ℕ) abbrev Index (N : ℕ) := {n : ℕ // N ≤ n} /-- Charts, given by `band h n.val`. -/ +@[expose] noncomputable def charts (h : ℝ) (N : ℕ) (n : Index N) : Set SpaceTime := band h n.val theorem sublevel_covered {h qbig : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) (N : ℕ) @@ -271,6 +274,7 @@ theorem sublevel_covered {h qbig : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) (N : ℕ) variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] /-- Compatible, given by `ValidBandGluing.Compatible (charts h N) (fun n => f n.val)`. -/ +@[expose] def Compatible (h : ℝ) (N : ℕ) (f : ℕ → SpaceTime → E) : Prop := ValidBandGluing.Compatible (charts h N) (fun n => f n.val) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/VariableGaugeMean.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/VariableGaugeMean.lean index da520f7454..8cddb72335 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,48 +66,51 @@ 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)`. -/ +@[expose] noncomputable def cutoff (d a b : ℝ) (ell : S → ℝ) (z : PressureStream.Lift S) : ℝ := 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) /-- Supported gauge, given by `∀ z, z.2.1 ∈ U → f z ≠ 0 → z.1 ∈ Icc (ell z.2.1 * a) (ell z.2.1 * b)`. -/ +@[expose] noncomputable def SupportedGauge (a b : ℝ) (ell : S → ℝ) (U : Set S) (f : PressureStream.Lift S → ℝ) : Prop := ∀ 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 /-- Mean pressure, given by `compactPrimitive d a b M ell v (pressureSource a b hab ell f)`. -/ -noncomputable def meanPressure (d a b M : ℝ) (hab : a < b) (ell : S → ℝ) +@[expose] noncomputable def meanPressure (d a b M : ℝ) (hab : a < b) (ell : S → ℝ) (v : PressureStream.Plane) (f : PressureStream.Lift S → ℝ) : PressureStream.Lift S → ℝ := compactPrimitive d a b M ell v (pressureSource a b hab ell f) /-- 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 +195,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) @@ -206,11 +209,13 @@ theorem qLength_contDiffOn {coord : ℝ} (hc : 0 < coord) (hc1 : coord < 1) : (SimilarityCoordinates.coordinateQ_spec hc hc1 hs).1.ne').contDiffWithinAt /-- Cutoff model, given by `RadialPullback.physicalCutoff d a b (y.2.1 / Real.sqrt y.1)`. -/ +@[expose] noncomputable def cutoffModel (d a b : ℝ) (y : MeanRankUpdate.ModelPoint) : ℝ := RadialPullback.physicalCutoff d a b (y.2.1 / Real.sqrt y.1) /-- Density model, given by `(Real.sqrt y.1)⁻¹ * PressureStream.rho a b hab (y.2.1 / Real.sqrt y.1)`. -/ +@[expose] noncomputable def densityModel (a b : ℝ) (hab : a < b) (y : MeanRankUpdate.ModelPoint) : ℝ := (Real.sqrt y.1)⁻¹ * PressureStream.rho a b hab (y.2.1 / Real.sqrt y.1) @@ -542,7 +547,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 +558,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 +568,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 +578,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 +586,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 @@ -594,6 +599,7 @@ noncomputable def temporalIncrementState (g : GaugeData S) (h : ℝ) (index : (temporalPotential g h index c u n) /-- Temporal axial difference, constructed using `MeanChartCompatibility.temporalAtIndex`. -/ +@[expose] noncomputable def temporalAxialDifference (g : GaugeData S) (h : ℝ) (index : ℕ → ℕ) (c : CorrectionState.Context (PressureStream.Lift S)) (u : CorrectionState.State (PressureStream.Lift S)) (n : ℕ) (z : PressureStream.Lift S) : ℝ := @@ -604,7 +610,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 +618,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 +626,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 +634,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 +648,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) := @@ -927,11 +933,13 @@ section ActualChart open TorusInverse MeanChartCompatibility /-- The same physical change, in the rank/domain order `(T,Z)`. -/ +@[expose] noncomputable def slowToChartTZ (h : ℝ) (n : ℕ) : Plane →L[ℝ] Plane := (ChartScales.Q n ^ (-1 : ℝ) • ContinuousLinearMap.fst ℝ ℝ ℝ).prod (ChartScales.Q n ^ (-CoordinateAlgebra.D h) • ContinuousLinearMap.snd ℝ ℝ ℝ) /-- Swap slow as an element of `PressureStream.Lift Plane →L[ℝ] PressureStream.Lift Plane`. -/ +@[expose] noncomputable def swapSlow : PressureStream.Lift Plane →L[ℝ] PressureStream.Lift Plane := (ContinuousLinearMap.id ℝ ℝ).prodMap ((ContinuousLinearEquiv.prodComm ℝ ℝ ℝ).toContinuousLinearMap.prodMap @@ -939,6 +947,7 @@ noncomputable def swapSlow : PressureStream.Lift Plane →L[ℝ] PressureStream. /-- Physical to chart TZ, given by `chartLinear (chartScale n) ((slowToChartTZ h n).prodMap (TemporalMeanUpdate.coverMap i))`. -/ +@[expose] noncomputable def physicalToChartTZ (h : ℝ) (n i : ℕ) : PressureStream.Lift Plane →L[ℝ] PressureStream.Lift Plane := chartLinear (chartScale n) ((slowToChartTZ h n).prodMap (TemporalMeanUpdate.coverMap i)) @@ -948,7 +957,7 @@ theorem physicalToChartTZ_swap (h : ℝ) (n i : ℕ) (z : PressureStream.Lift Pl /-- Field on physical TZ, given by `coverPull (chartScale n) (slowToChartTZ h n) i (ChartScales.Q n ^ (-a)) f`. -/ -noncomputable def fieldOnPhysicalTZ (h : ℝ) (n i : ℕ) (a : ℝ) +@[expose] noncomputable def fieldOnPhysicalTZ (h : ℝ) (n i : ℕ) (a : ℝ) (f : PressureStream.Lift Plane → ℝ) : PressureStream.Lift Plane → ℝ := coverPull (chartScale n) (slowToChartTZ h n) i (ChartScales.Q n ^ (-a)) f @@ -1317,6 +1326,7 @@ section VariableTransport variable {S : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] /-- Normalized cutoff, given by `TransportPrimitive.interiorCutoff a b (radialRatio ell z)`. -/ +@[expose] noncomputable def normalizedCutoff (a b : ℝ) (ell : S → ℝ) (z : PressureStream.Lift S) : ℝ := TransportPrimitive.interiorCutoff a b (radialRatio ell z) @@ -1609,6 +1619,7 @@ theorem qLength_reference_bounds {coord a b : ℝ} (U : SlowRegion coord) /-- Normalized cutoff model, given by `TransportPrimitive.interiorCutoff (a ^ d) (b ^ d) (y.2.1 / (Real.sqrt y.1) ^ d)`. -/ +@[expose] noncomputable def normalizedCutoffModel (d a b : ℝ) (y : MeanRankUpdate.ModelPoint) : ℝ := TransportPrimitive.interiorCutoff (a ^ d) (b ^ d) (y.2.1 / (Real.sqrt y.1) ^ d) @@ -2357,6 +2368,7 @@ variable {S : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] /-- Cutoff radial derivative, given by `(ell z.2.1)⁻¹ * deriv (physicalCutoff d a b) (radialRatio ell z)`. -/ +@[expose] noncomputable def cutoffRadialDerivative (d a b : ℝ) (ell : S → ℝ) (z : PressureStream.Lift S) : ℝ := (ell z.2.1)⁻¹ * deriv (physicalCutoff d a b) (radialRatio ell z) @@ -2737,6 +2749,7 @@ open LocalSignedRequest WeightedClasses /-- Cutoff radial derivative model, given by `(Real.sqrt y.1)⁻¹ * deriv (physicalCutoff d a b) (y.2.1 / Real.sqrt y.1)`. -/ +@[expose] noncomputable def cutoffRadialDerivativeModel (d a b : ℝ) (y : MeanRankUpdate.ModelPoint) : ℝ := (Real.sqrt y.1)⁻¹ * deriv (physicalCutoff d a b) (y.2.1 / Real.sqrt y.1) 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..0cf6dbfd0e 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 @@ -32,15 +32,17 @@ variable {D E : Type*} [NormedAddCommGroup D] [NormedSpace ℝ D] [NormedAddCommGroup E] [NormedSpace ℝ E] /-- Window, given by `{x | a < ρ x ∧ ρ x < b}`. -/ +@[expose] noncomputable def window (ρ : D → ℝ) (a b : ℝ) : Set D := {x | a < ρ x ∧ ρ x < b} /-- Window domain, given by `Ω ∩ window ρ a b`. -/ +@[expose] 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 +128,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} @@ -146,6 +148,7 @@ def BoundaryControls (Ω : Set D) (ρ : D → ℝ) (a b cL cR : ℝ) (f : D → cR (iteratedFDeriv ℝ n f) x) /-- Extended jets, defined pointwise by `extension ρ a b (iteratedFDeriv ℝ n f) x`. -/ +@[expose] noncomputable def extendedJets (ρ : D → ℝ) (a b : ℝ) (f : D → E) (x : D) : FormalMultilinearSeries ℝ D E := fun n => extension ρ a b (iteratedFDeriv ℝ n f) x @@ -293,12 +296,13 @@ theorem half_weight_right {cL cR L t : ℝ} (hcL : 0 ≤ cL) (ht : t < L) /-- Flat weight, given by `WeightedRadialPrimitive.zeta cL cR (WeightedRadialPrimitive.logLength a b) (logCoordinate ρ a x)`. -/ +@[expose] noncomputable def flatWeight (ρ : D → ℝ) (a b cL cR : ℝ) (x : D) : ℝ := WeightedRadialPrimitive.zeta cL cR (WeightedRadialPrimitive.logLength a b) (logCoordinate ρ a x) /-- 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))⁻¹ @@ -465,10 +469,11 @@ end NativeBounds abbrev NativePoint := PhaseCalculus.Slow × TorusInverse.Plane /-- Native slow domain, given by `{x | 0 < x.1.2.2}`. -/ +@[expose] 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 +494,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) @@ -888,6 +894,7 @@ theorem NativeJets.nativeExtension_jets {F : OutgoingProfile.Profile} (W : Nomin /-! ## The same extension in the mean-field variable ordering -/ /-- The actual permutation from `(R,((T,Z),Y))` to `((R,(Z,T)),Y)`. -/ +@[expose] noncomputable def meanNative : LocalSignedRequest.Point ≃ₗᵢ[ℝ] NativePoint where toLinearEquiv := { toFun := fun x => ((x.1, (x.2.1.2, x.2.1.1)), x.2.2) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/WaveEnvelopeTransport.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/WaveEnvelopeTransport.lean index b361501ff1..21d1db16a4 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 @@ -33,13 +33,16 @@ private theorem nat_le_infty (n : ℕ) : (n : WithTop ℕ∞) ≤ ∞ := ENat.natCast_le_of_coe_top_le_withTop le_rfl n /-- The full padded integration rectangle, including both time endpoints. -/ +@[expose] noncomputable def rectangle (r L : ℝ) : Set Plane := Icc (-r) r ×ˢ Icc 0 L /-- Native region, given by `(fun z => g.center + g.basis z) '' rectangle r L`. -/ +@[expose] noncomputable def nativeRegion (g : Geometry) (r L : ℝ) : Set Plane := (fun z => g.center + g.basis z) '' rectangle r L /-- A geometric injectivity condition, independent of all source fields. -/ +@[expose] noncomputable def Separated (g : Geometry) (r L : ℝ) : Prop := InjOn TorusAverages.quotientPoint (nativeRegion g r L) @@ -64,7 +67,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..278d2db1fa 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 @@ -163,11 +163,13 @@ theorem axial_vector_class (s : StripData D) (v : D) : abbrev Family (D : Type*) := ℕ → D → ComplexVector /-- Wave vector, given by `∀ i, WaveClass s P α (fun n x => a n x i)`. -/ +@[expose] def WaveVector (s : StripData D) (P : ℕ → D → ℝ) (α : ℝ) (a : Family D) : Prop := ∀ i, WaveClass s P α (fun n x => a n x i) /-- Mean vector, given by `MeanClass s (μ + 1) (fun n x => a n x 0) ∧ MeanClass s μ (fun n x => a n x 1) ∧ MeanClass s μ (fun n x => a n x 2)`. -/ +@[expose] def MeanVector (s : StripData D) (μ : ℝ) (a : Family D) : Prop := MeanClass s (μ + 1) (fun n x => a n x 0) ∧ MeanClass s μ (fun n x => a n x 1) ∧ MeanClass s μ (fun n x => a n x 2) @@ -181,11 +183,12 @@ theorem meanVector_component {s : StripData D} {μ : ℝ} {a : Family D} /-- Angular independent, given by `∀ n i x, x ∈ s.domain → along (G.angular n) (fun y => a n y i) x = 0`. -/ +@[expose] def AngularIndependent {s : StripData D} {κ : ℝ} (G : Geometry s κ) (a : Family D) : Prop := ∀ 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 +390,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 +457,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..6e64cd35ae 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 @@ -33,6 +33,7 @@ variable {D : Type} {ι : Type*} [NormedAddCommGroup D] [NormedSpace ℝ D] /-- Angular smooth, given by `∀ n i, ContDiffOn ℝ ∞ (fun p => u n p i) (HarmonicResidual.liftDomain Ω)`. -/ +@[expose] noncomputable def AngularSmooth (Ω : Set D) (u : Oscillation D) : Prop := ∀ n i, ContDiffOn ℝ ∞ (fun p => u n p i) (HarmonicResidual.liftDomain Ω) @@ -154,6 +155,7 @@ abbrev Point := GaugeDebtIncrement.Point /-- Wave support, given by `∀ n θ i, VariableGaugeMean.SupportedGauge a b (VariableGaugeMean.qLength coord) U.carrier (fun x => u n (x, θ) i)`. -/ +@[expose] noncomputable def WaveSupport {coord : ℝ} (U : LocalSignedRequest.SlowRegion coord) (a b : ℝ) (u : Oscillation Point) : Prop := ∀ n θ i, VariableGaugeMean.SupportedGauge a b (VariableGaugeMean.qLength coord) 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..18becc25a6 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 @@ -407,6 +407,7 @@ theorem norm_jet_const_mul {f : E → ℝ} {x : E} (hf : ContDiffAt ℝ ∞ f x) exact norm_smul c (iteratedFDeriv ℝ n f x) /-- The multiplier here is a fixed scalar at the point being estimated. -/ +@[expose] def normalizeAt (w : ℝ) (f : E → ℝ) : E → ℝ := fun y => w⁻¹ * f y theorem normalized_jet_bound {g : E → ℝ} {s : Set E} (hs : IsOpen s) @@ -518,6 +519,7 @@ theorem rpow_comp_jets_bound {f : E → ℝ} {s : Set E} (hs : IsOpen s) (orderBound_nonneg p n) /-- Choose sum, given by `∑ i ∈ Finset.range (n + 1), (n.choose i : ℝ)`. -/ +@[expose] def chooseSum (n : ℕ) : ℝ := ∑ i ∈ Finset.range (n + 1), (n.choose i : ℝ) theorem chooseSum_nonneg (n : ℕ) : 0 ≤ chooseSum n := by @@ -830,7 +832,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/Nikodym/Nikodym/Construction/Arith.lean b/LeanPool/Nikodym/Nikodym/Construction/Arith.lean index c6f3725522..e57eb32d84 100644 --- a/LeanPool/Nikodym/Nikodym/Construction/Arith.lean +++ b/LeanPool/Nikodym/Nikodym/Construction/Arith.lean @@ -18,7 +18,7 @@ Blueprint node M01: real-power bookkeeping used to assemble the final upper boun supply of `2m` pairwise distinct odd primes indexed as pairs `(ℓⱼ, ℓ'ⱼ)`. -/ -@[expose] public section +public section namespace Nikodym diff --git a/LeanPool/Nikodym/Nikodym/Construction/Count.lean b/LeanPool/Nikodym/Nikodym/Construction/Count.lean index cf68d5a4e8..2f65d3275f 100644 --- a/LeanPool/Nikodym/Nikodym/Construction/Count.lean +++ b/LeanPool/Nikodym/Nikodym/Construction/Count.lean @@ -32,7 +32,7 @@ digit radius is `ρ = 1 / (100 (k+1) √n)` and the trace-fiber radius is `T = `q^(k+1) - |N| ≥ E01const n k K₀ · q^((k+1) - 2⁻¹^k - 3(k+1)/n)`. -/ -@[expose] public section +public section open Finset Real diff --git a/LeanPool/Nikodym/Nikodym/Construction/Digits.lean b/LeanPool/Nikodym/Nikodym/Construction/Digits.lean index f9ef447e63..a968de6ee3 100644 --- a/LeanPool/Nikodym/Nikodym/Construction/Digits.lean +++ b/LeanPool/Nikodym/Nikodym/Construction/Digits.lean @@ -27,7 +27,7 @@ This file implements blueprint nodes D01 and D02 of Throughout, `n` denotes `Fintype.card ι`. -/ -@[expose] public section +public section namespace Nikodym @@ -94,6 +94,7 @@ section Weights /-- Blueprint D01: the mixed-radix weight `D Q i = ∏_{j < i} Q j` of the radices `Q : Fin k → ℕ`; so `D Q 0 = 1` and `D Q (i + 1) = D Q i * Q i`. -/ +@[expose] def D {k : ℕ} (Q : Fin k → ℕ) (i : Fin k) : ℕ := ∏ j ∈ Finset.univ.filter (· < i), Q j variable {k : ℕ} diff --git a/LeanPool/Nikodym/Nikodym/Construction/Fibers.lean b/LeanPool/Nikodym/Nikodym/Construction/Fibers.lean index 23949dcb09..214c934259 100644 --- a/LeanPool/Nikodym/Nikodym/Construction/Fibers.lean +++ b/LeanPool/Nikodym/Nikodym/Construction/Fibers.lean @@ -36,7 +36,7 @@ Throughout, `n` denotes `Fintype.card ι` in Layer S/D statements; in Layer C, ` integer parameters of Q01 and the number of embeddings is written `Fintype.card ι`. -/ -@[expose] public section +public section namespace Nikodym @@ -116,6 +116,7 @@ section Radix /-- Blueprint C02: the radix vector `(Q₁, …, Q_k)` of Q01, as a function on `Fin k` (here `k = h - 1`): `radix n q k i = Params.Q n q (i + 1)`. -/ +@[expose] noncomputable def radix (n q k : ℕ) : Fin k → ℕ := fun i ↦ Params.Q n q (i.val + 1) variable {n q k : ℕ} @@ -156,10 +157,12 @@ noncomputable def digitSpace (S : Scaffold b σ φ K₀ K₁) (n q k : ℕ) (ρ Fintype.piFinset fun i ↦ S.boxFinset (ρ * radix n q k i) /-- Blueprint C02: the prefix sum `yᵢ(w) = ∑_{j ≤ i} Dⱼ wⱼ`. -/ +@[expose] noncomputable def prefixSum (n q k : ℕ) (w : Fin k → R) (i : Fin k) : R := ∑ j ∈ Finset.Iic i, (D (radix n q k) j : R) * w j /-- Blueprint C02: the base point `b(w) = ∑ j, Dⱼ wⱼ`. -/ +@[expose] noncomputable def base (n q k : ℕ) (w : Fin k → R) : R := ∑ j, (D (radix n q k) j : R) * w j /-- Blueprint C02: the energy color `c(w)ᵢ = trace (yᵢ(w) ^ 2)`, landed in `ℤ` via the floor diff --git a/LeanPool/Nikodym/Nikodym/Construction/Main.lean b/LeanPool/Nikodym/Nikodym/Construction/Main.lean index fbb1002f76..2eb8d032fd 100644 --- a/LeanPool/Nikodym/Nikodym/Construction/Main.lean +++ b/LeanPool/Nikodym/Nikodym/Construction/Main.lean @@ -32,7 +32,7 @@ roots `sⱼ` in `F`; K06 gives a scaffold of rank `n` with constant `K₀`; E02 M01(c) converts the exponent. -/ -@[expose] public section +public section namespace Nikodym diff --git a/LeanPool/Nikodym/Nikodym/Construction/Parameters.lean b/LeanPool/Nikodym/Nikodym/Construction/Parameters.lean index e8ecb108f6..4a45cd3655 100644 --- a/LeanPool/Nikodym/Nikodym/Construction/Parameters.lean +++ b/LeanPool/Nikodym/Nikodym/Construction/Parameters.lean @@ -22,7 +22,7 @@ natural-number power inequalities that follow from the floor definition. Q02 rec threshold `q ≥ 2^{n 2^{h-1}}`, which forces `M, Qᵢ ≥ 2` and the matching real lower bounds. -/ -@[expose] public section +public section noncomputable section @@ -43,6 +43,7 @@ def Q (i : ℕ) : ℕ := ⌊(q : ℝ) ^ (1 / ((n : ℝ) * 2 ^ i))⌋₊ This makes `D 0 = D 1 = 1` (empty products) and `D (i + 1) = D i * Q i` whenever `1 ≤ i`, which is the recurrence `D₁ = 1`, `D_{i+1} = Dᵢ Qᵢ` of the blueprint. -/ +@[expose] def D (i : ℕ) : ℕ := ∏ j ∈ Ico 1 i, Q n q j variable {n q} diff --git a/LeanPool/Nikodym/Nikodym/Construction/ProductCriterion.lean b/LeanPool/Nikodym/Nikodym/Construction/ProductCriterion.lean index 95d85e69bd..73d5292d4f 100644 --- a/LeanPool/Nikodym/Nikodym/Construction/ProductCriterion.lean +++ b/LeanPool/Nikodym/Nikodym/Construction/ProductCriterion.lean @@ -18,7 +18,7 @@ point of `P`, then the complement `univ \ P` is a Nikodym set. The file also rec cardinality identity `|univ \ P| = q^h - |P|` in `ℕ` and in `ℝ`. -/ -@[expose] public section +public section namespace Nikodym diff --git a/LeanPool/Nikodym/Nikodym/Construction/Scaffold.lean b/LeanPool/Nikodym/Nikodym/Construction/Scaffold.lean index 07667e4676..03165233e5 100644 --- a/LeanPool/Nikodym/Nikodym/Construction/Scaffold.lean +++ b/LeanPool/Nikodym/Nikodym/Construction/Scaffold.lean @@ -32,7 +32,7 @@ This file implements blueprint nodes S01, S02 and S03 of Throughout, `n` denotes `Fintype.card ι`. -/ -@[expose] public section +public section namespace Nikodym @@ -64,10 +64,12 @@ section Box variable {R ι : Type*} [CommRing R] /-- Blueprint S01: the sup-box of radius `T`, `{x | ∀ i, |σ i x| ≤ T}`. -/ +@[expose] def box (σ : ι → R →+* ℝ) (T : ℝ) : Set R := {x | ∀ i, |σ i x| ≤ T} /-- Blueprint S01: the Euclidean embedding `x ↦ (σ i x)_i`, as an additive group homomorphism into `EuclideanSpace ℝ ι`. -/ +@[expose] def emb (σ : ι → R →+* ℝ) : R →+ EuclideanSpace ℝ ι where toFun x := WithLp.toLp 2 fun i ↦ σ i x map_zero' := by ext i; simp @@ -175,6 +177,7 @@ section Trace variable {R ι : Type*} [CommRing R] [Fintype ι] /-- Blueprint S01: the trace `∑ i, σ i x`. -/ +@[expose] def trace (σ : ι → R →+* ℝ) (x : R) : ℝ := ∑ i, σ i x variable (σ : ι → R →+* ℝ) diff --git a/LeanPool/Nikodym/Nikodym/Construction/Tangent.lean b/LeanPool/Nikodym/Nikodym/Construction/Tangent.lean index a8ccb915ec..bbccb2cea1 100644 --- a/LeanPool/Nikodym/Nikodym/Construction/Tangent.lean +++ b/LeanPool/Nikodym/Nikodym/Construction/Tangent.lean @@ -40,7 +40,7 @@ Q02 threshold `2 ^ (n 2 ^ k) ≤ q` implies `1 ≤ q`). Declarations involving ` carry a `[DecidableEq F]` assumption (consumers may use `classical`). -/ -@[expose] public section +public section namespace Nikodym diff --git a/LeanPool/Nikodym/Nikodym/Definition.lean b/LeanPool/Nikodym/Nikodym/Definition.lean index 903849613d..0d58ce110e 100644 --- a/LeanPool/Nikodym/Nikodym/Definition.lean +++ b/LeanPool/Nikodym/Nikodym/Definition.lean @@ -19,7 +19,7 @@ A finite field variant of the Nikodym problem considers subsets of `𝔽_qⁿ` s every point of `𝔽_qⁿ` there is a line meeting the complement of the set in at most that point. -/ -@[expose] public section +public section namespace Nikodym @@ -28,6 +28,7 @@ A set `S ⊆ 𝔽_qⁿ` is a Nikodym set if for every point `x ∈ 𝔽_qⁿ` th all of whose points other than `x` lie in `S`. Lines are parametrised as `x + t • v` with `v ≠ 0`, so the condition reads `x + t • v ∈ S` for all `t ≠ 0`. -/ +@[expose] def IsNikodym {F : Type*} [Field F] {n : ℕ} (S : Finset (Fin n → F)) : Prop := ∀ x, ∃ v, v ≠ 0 ∧ ∀ t : F, t ≠ 0 → x + t • v ∈ S diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/Assembly.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/Assembly.lean index 8d4fc4fb34..56c21d2273 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/Assembly.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/Assembly.lean @@ -28,7 +28,7 @@ structure `Nikodym.LowerBound.AlgebraInterface K d` for every field `K` and ever The main result is `Nikodym.LowerBound.algebraInterface K d`. -/ -@[expose] public section +public section namespace Nikodym.LowerBound diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/BaseChange.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/BaseChange.lean index e869f6f668..728df48c96 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/BaseChange.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/BaseChange.lean @@ -36,7 +36,7 @@ For a field extension `K ⊆ K'` (an arbitrary `[Algebra K K']` between fields) All statements are generic in `[Algebra K K']`; they are applied with `K' = RatFunc K` in TR7. -/ -@[expose] public section +public section namespace Nikodym.LowerBound diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/BaseChangePrime.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/BaseChangePrime.lean index 965e7c1904..3c90b494c5 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/BaseChangePrime.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/BaseChangePrime.lean @@ -39,7 +39,7 @@ The coefficient projections are shared with the Hilbert base-change proofs throu `Algebra/CoefficientProjection.lean` (TR0/TR1). -/ -@[expose] public section +public section namespace Nikodym.LowerBound diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/CoefficientProjection.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/CoefficientProjection.lean index 6fc61a6c10..5f18c59cdd 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/CoefficientProjection.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/CoefficientProjection.lean @@ -12,7 +12,7 @@ public import LeanPool.Nikodym.Nikodym.LowerBound.Algebra.Interface The common coefficient API used by both the Hilbert and Krull-dimension base-change proofs. -/ -@[expose] public section +public section namespace Nikodym.LowerBound diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/ComponentDegree.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/ComponentDegree.lean index 4b1908bcb9..339eaae7a6 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/ComponentDegree.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/ComponentDegree.lean @@ -37,7 +37,7 @@ inclusion–exclusion identity B02(i) `homHilbert_inf_add_homHilbert_sup` lives (degree `≤ n`), then `∑_{Q ∈ 𝒬} (p Q).coeff n ≤ e * (n + 1) * p₀.coeff (n + 1)`. -/ -@[expose] public section +public section namespace Nikodym.LowerBound diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/Degree.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/Degree.lean index 11fa3a29e1..f5a9677b62 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/Degree.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/Degree.lean @@ -36,7 +36,7 @@ Main declarations: `hilbert_le_degree_mul_choose_of_bounds`, and their `_of_eventually_bounds` versions. -/ -@[expose] public section +public section namespace Nikodym.LowerBound diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/Dimension.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/Dimension.lean index 093d282565..611506ec5b 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/Dimension.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/Dimension.lean @@ -42,7 +42,7 @@ arbitrary field `K`. Throughout, `A` is a domain which is a finitely generated ` `exists_minimalPrimes_le`). -/ -@[expose] public section +public section namespace Nikodym.LowerBound diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/DimensionExtra.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/DimensionExtra.lean index a2c86d4b34..e4887e03ad 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/DimensionExtra.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/DimensionExtra.lean @@ -21,7 +21,7 @@ is bounded by the dimensions of the quotients `R ⧸ p` over the primes `p ⊇ J ideal `J`. -/ -@[expose] public section +public section namespace Nikodym.LowerBound diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/FreeFiber.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/FreeFiber.lean index dfb8d60110..71cb1f8753 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/FreeFiber.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/FreeFiber.lean @@ -54,7 +54,7 @@ The fraction-field part is proved first for an arbitrary pair of domains `S → a bare `lake env lean`. -/ -@[expose] public section +public section namespace Nikodym.LowerBound diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/GradedLemmas.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/GradedLemmas.lean index 164b9330e0..3b41ffbb8c 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/GradedLemmas.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/GradedLemmas.lean @@ -35,7 +35,7 @@ the standard grading `MvPolynomial.homogeneousSubmodule σ K` (made a local inst and a homogeneous ideal containing `X i - c` (`c ≠ 0`) is the unit ideal. -/ -@[expose] public section +public section namespace Nikodym.LowerBound @@ -94,6 +94,7 @@ instance instModuleFiniteHomogeneousSubmodule [Finite σ] (t : ℕ) : /-- Blueprint A05/B01/B02: the homogeneous Hilbert function `t ↦ dim_K (P_t ⧸ J_t)`, realized as the dimension of the image of the degree-`t` forms in `P ⧸ J`. -/ +@[expose] noncomputable def homHilbert (J : Ideal (MvPolynomial σ K)) (t : ℕ) : ℕ := finrank K ((homogeneousSubmodule σ K t).map (Ideal.Quotient.mkₐ K J).toLinearMap) diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/GradedNorm.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/GradedNorm.lean index 8e792e9034..f5d4db7538 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/GradedNorm.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/GradedNorm.lean @@ -38,7 +38,7 @@ instance arguments `[Algebra (FractionRing S) (FractionRing R)]` and by `IsFractionRing.ringEquivOfRingEquiv`, and `Algebra.norm_eq_of_equiv_equiv`. -/ -@[expose] public section +public section namespace Nikodym.LowerBound @@ -73,6 +73,7 @@ section ScaleEquiv variable {K : Type*} [CommSemiring K] {σ : Type*} /-- Node A07′: the scaling automorphism `X i ↦ C u * X i` of `MvPolynomial σ K`, for a unit `u`. -/ +@[expose] noncomputable def scaleEquiv (u : Kˣ) : MvPolynomial σ K ≃ₐ[K] MvPolynomial σ K := AlgEquiv.ofAlgHom (aeval fun i ↦ C (u : K) * X i) (aeval fun i ↦ C ((u⁻¹ : Kˣ) : K) * X i) (by ext i; simp [algebraMap_eq, ← mul_assoc, ← C_mul]) @@ -197,6 +198,7 @@ variable {K : Type*} [Field K] {n s : ℕ} {J : Ideal (MvPolynomial (Fin n) K)} /-- Node A07′: the scaling automorphism `σ_u` of `R = Q ⧸ J` induced by `scaleEquiv u` on `Q`, for a homogeneous ideal `J`. -/ +@[expose] noncomputable def scaleQuotEquiv (hJh : J.IsHomogeneous (homogeneousSubmodule (Fin n) K)) (u : Kˣ) : (MvPolynomial (Fin n) K ⧸ J) ≃ₐ[K] MvPolynomial (Fin n) K ⧸ J := Ideal.quotientEquivAlg J J (scaleEquiv u) (scaleEquiv_map_eq_of_isHomogeneous u hJh).symm diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/HilbertPolynomial.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/HilbertPolynomial.lean index ee9b9e5da8..e42db9e073 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/HilbertPolynomial.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/HilbertPolynomial.lean @@ -37,7 +37,7 @@ number of standard exponents of degree at most `t`, i.e. the partial sum of the polynomial. -/ -@[expose] public section +public section namespace Nikodym.LowerBound diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/Homogenization.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/Homogenization.lean index b41adc8abc..6c530082aa 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/Homogenization.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/Homogenization.lean @@ -35,7 +35,7 @@ the index `0` is the homogenizing variable `X₀` and `Fin.succ i` is the variab quotDim I + 1` for a prime `I`. -/ -@[expose] public section +public section namespace Nikodym.LowerBound @@ -157,6 +157,7 @@ theorem homogenizeTo_monomial (t : ℕ) (α : Fin d →₀ ℕ) (c : K) : exact Finsupp.sum_single_index (map_zero _) /-- Blueprint A05: `homogenizeTo t` as a `K`-linear map. -/ +@[expose] noncomputable def homogenizeToₗ (t : ℕ) : MvPolynomial (Fin d) K →ₗ[K] MvPolynomial (Fin (d + 1)) K where toFun := homogenizeTo t @@ -200,6 +201,7 @@ theorem homogenizeTo_dehom {t : ℕ} {G : MvPolynomial (Fin (d + 1)) K} (hG : G. /-- Blueprint A05: the monomial bijection between forms of degree `t` in `d + 1` variables and polynomials of degree `≤ t` in `d` variables, as a `K`-linear isomorphism `P̂_t ≃ P_{≤t}` given by `dehom` (inverse `homogenizeTo t`). -/ +@[expose] noncomputable def dehomEquiv (t : ℕ) : homogeneousSubmodule (Fin (d + 1)) K t ≃ₗ[K] restrictTotalDegree (Fin d) K t := LinearEquiv.ofLinearMap diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/HypersurfaceDegree.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/HypersurfaceDegree.lean index 52a16cc8af..f51bb61fdb 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/HypersurfaceDegree.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/HypersurfaceDegree.lean @@ -29,7 +29,7 @@ for the factor map restricted to `V_t` then gives the identity. * `Nikodym.LowerBound.homHilbert_sup_span_singleton_add`: the identity above (blueprint B01). -/ -@[expose] public section +public section namespace Nikodym.LowerBound diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/Interface.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/Interface.lean index 5c9d9b2283..86608d0336 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/Interface.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/Interface.lean @@ -45,7 +45,7 @@ one containing a line ideal is that line ideal) is proved here unconditionally f kept only for compatibility with the blueprint node list. -/ -@[expose] public section +public section namespace Nikodym.LowerBound @@ -60,6 +60,7 @@ section QuotDim /-- Blueprint A01/C08: the Krull dimension `dim (P_d ⧸ I)` of the coordinate ring, as a natural number. The values `⊥` (zero ring) and `⊤` are sent to `0`; for a proper ideal neither occurs (`coe_quotDim`). -/ +@[expose] noncomputable def quotDim (I : Ideal (MvPolynomial (Fin d) K)) : ℕ := ((ringKrullDim (MvPolynomial (Fin d) K ⧸ I)).unbotD 0).toNat @@ -208,6 +209,7 @@ theorem evPoly_congr (h₁ h₂ : ℕ → ℕ) (e : h₁ = h₂) : evPoly h₁ = /-- Blueprint A03: the eventual polynomial of the affine Hilbert function `t ↦ hilbert I t` (junk `0` if none exists); definitionally `evPoly (hilbert I)`. -/ +@[expose] noncomputable def affineHilbertPoly (I : Ideal (MvPolynomial (Fin d) K)) : Polynomial ℚ := evPoly (hilbert I) @@ -218,6 +220,7 @@ theorem affineHilbertPoly_eq_evPoly (I : Ideal (MvPolynomial (Fin d) K)) : /-- Blueprint A03/A04: the degree `deg I = (leading coefficient of the affine Hilbert polynomial) times `(natDegree)!`, as a natural number. -/ +@[expose] noncomputable def degree (I : Ideal (MvPolynomial (Fin d) K)) : ℕ := ⌊(affineHilbertPoly I).leadingCoeff * ((affineHilbertPoly I).natDegree.factorial : ℚ)⌋₊ diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/LinearNormalization.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/LinearNormalization.lean index 48468456d9..0d530241c0 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/LinearNormalization.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/LinearNormalization.lean @@ -57,7 +57,7 @@ instance argument together with the hypothesis (`finite_of_pow_idealOfVars_le`). -/ -@[expose] public section +public section namespace Nikodym.LowerBound diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/LocalParameters.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/LocalParameters.lean index 90fd259ec2..c2390bf771 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/LocalParameters.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/LocalParameters.lean @@ -34,7 +34,7 @@ and prove theorem in `P ⧸ I` and the closed-point height formula of A01. -/ -@[expose] public section +public section namespace Nikodym.LowerBound diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/NormalizationSetting.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/NormalizationSetting.lean index 17dd20a45e..aac3628ed5 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/NormalizationSetting.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/NormalizationSetting.lean @@ -32,7 +32,7 @@ as a convention so that the files can be developed independently: This file only provides the notion of a *homogeneous element* of `R` used by A06′ and A07′. -/ -@[expose] public section +public section namespace Nikodym.LowerBound @@ -40,6 +40,7 @@ variable {K : Type*} [Field K] {n : ℕ} /-- An element of `MvPolynomial (Fin n) K ⧸ J` is *homogeneous of degree `e`* if it is the class of a form of degree `e`. -/ +@[expose] def IsHomogeneousElem (J : Ideal (MvPolynomial (Fin n) K)) (r : MvPolynomial (Fin n) K ⧸ J) (e : ℕ) : Prop := ∃ G : MvPolynomial (Fin n) K, G.IsHomogeneous e ∧ Ideal.Quotient.mk J G = r diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/PolyAsymptotics.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/PolyAsymptotics.lean index c89b7b3b75..a3d198e801 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/PolyAsymptotics.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/PolyAsymptotics.lean @@ -33,7 +33,7 @@ Main declarations (all in the `Polynomial` namespace, as named in the design doc `Polynomial.eval_comp_X_sub_C`, `Polynomial.eval_comp_X_sub_C_natCast`. -/ -@[expose] public section +public section namespace Polynomial diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/ProperCut.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/ProperCut.lean index 8d6fdb3d4f..0afd8e346f 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/ProperCut.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/ProperCut.lean @@ -48,7 +48,7 @@ over `I + (g)` the homogenization `homogenization J` is a homogeneous prime of q `∑_J deg J / n! ≤ e · (n + 1) · deg I / (n + 1)!`, i.e. `∑_J deg J ≤ e · deg I ≤ T · deg I`. -/ -@[expose] public section +public section namespace Nikodym.LowerBound diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/Transfer.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/Transfer.lean index 1107555a8e..0c4483e41d 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/Transfer.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Algebra/Transfer.lean @@ -36,7 +36,7 @@ This file implements the items **TR5** and **TR7** of the base-change node **TR* `Finset.sum_image`. -/ -@[expose] public section +public section namespace Nikodym.LowerBound diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Arithmetic/BinomialGap.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Arithmetic/BinomialGap.lean index 1b1953ff8b..9d597c1e28 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Arithmetic/BinomialGap.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Arithmetic/BinomialGap.lean @@ -21,7 +21,7 @@ Blueprint node C02: with `2 ≤ d`, `2 ≤ q` and `8 * d ^ 2 ≤ r ≤ q`, writi For `1 ≤ k ≤ d` one also has `Nat.choose (T + k) k ≤ q ^ k * Nat.choose (r + k - 1) k`. -/ -@[expose] public section +public section namespace Nikodym.LowerBound diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Arithmetic/Multiplicity.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Arithmetic/Multiplicity.lean index 26546fdc69..401e509310 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Arithmetic/Multiplicity.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Arithmetic/Multiplicity.lean @@ -19,7 +19,7 @@ and `a ≤ r`. If also `(a + 1) * M ≤ q * L`, then `r ≤ q`. In the induction, `a = 8 d ^ 2`, `C = a + 1`, and `M = Δ q ^ k`. -/ -@[expose] public section +public section namespace Nikodym.LowerBound diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Arithmetic/WeightedSelection.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Arithmetic/WeightedSelection.lean index a1c727c2b0..bb497cc6d3 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Arithmetic/WeightedSelection.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Arithmetic/WeightedSelection.lean @@ -17,7 +17,7 @@ Blueprint node C07: from `∑ L i > 0`, `Δ i > 0`, and `∑ Δ i ≤ D`, there `L i > 0` and `(∑ L) * Δ i ≤ L i * D`. -/ -@[expose] public section +public section namespace Nikodym.LowerBound diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/CarrierBound.lean b/LeanPool/Nikodym/Nikodym/LowerBound/CarrierBound.lean index 309d0992e8..b691cd6644 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/CarrierBound.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/CarrierBound.lean @@ -37,7 +37,7 @@ gives the bound after the exact integer computation of Section 5 of the blueprin All arithmetic is in `ℕ`; no real roots enter. -/ -@[expose] public section +public section namespace Nikodym.LowerBound diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Counting/Components.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Counting/Components.lean index 5fe74d2b81..8cf9159f60 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Counting/Components.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Counting/Components.lean @@ -35,7 +35,7 @@ Main declarations: the private subfamily `P.restrict s` of `#s` lines lying on `J`. -/ -@[expose] public section +public section namespace Nikodym.LowerBound diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Counting/Curves.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Counting/Curves.lean index c416fc38ab..06a83409ab 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Counting/Curves.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Counting/Curves.lean @@ -31,7 +31,7 @@ most one containing a line ideal is that line ideal), proved unconditionally in combinatorial input is the injectivity of `e ↦ P.lineIdeal e` (node F05). -/ -@[expose] public section +public section namespace Nikodym.LowerBound diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Counting/Points.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Counting/Points.lean index c9a593fc6a..d47dad154a 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Counting/Points.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Counting/Points.lean @@ -36,7 +36,7 @@ The blueprint suggests comparing leading coefficients of polynomials in `r`; we the limit `r → ∞` of `N ≤ Δ (q + (d q + k) / r) ^ k`, which is shorter in Mathlib. -/ -@[expose] public section +public section namespace Nikodym.LowerBound diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Grid/CRT.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Grid/CRT.lean index 8c8d341b33..859aede306 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Grid/CRT.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Grid/CRT.lean @@ -27,7 +27,7 @@ Nikodym exponent. version `exists_grid_jets_eq` of the interpolation statement. -/ -@[expose] public section +public section namespace Nikodym.LowerBound @@ -126,6 +126,7 @@ section LinearMap variable {ι : Type*} (I : Ideal (MvPolynomial (Fin d) K)) (x : ι → Fin d → K) (r : ℕ) /-- Blueprint G02: the `K`-linear map `P_d → ∏ i, Q_{I, x i}(r)` collecting all jets. -/ +@[expose] noncomputable def jetsLinearMap : MvPolynomial (Fin d) K →ₗ[K] ∀ i, MvPolynomial (Fin d) K ⧸ jetIdeal I (x i) r where toFun f i := Ideal.Quotient.mk (jetIdeal I (x i) r) f diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Grid/Jets.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Grid/Jets.lean index a34c66e7a0..d55851d647 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Grid/Jets.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Grid/Jets.lean @@ -39,7 +39,7 @@ The blueprint assumes `r ≥ 1`; none of the statements here needs it (for `r = zero), so the hypothesis is omitted. -/ -@[expose] public section +public section namespace Nikodym.LowerBound @@ -54,6 +54,7 @@ variable (I : Ideal (MvPolynomial (Fin d) K)) (r : ℕ) /-- Blueprint G03: the `K`-linear map `P_d ⧸ I → ∏_{x ∈ F^d} Q_{I, ι x}(r)` collecting all jets at the grid points, induced on the quotient by `I ≤ I + 𝔪_{ι x} ^ r`. -/ +@[expose] noncomputable def gridJetsLinearMap : (MvPolynomial (Fin d) K ⧸ I) →ₗ[K] ∀ x : Fin d → F, JetSpace I (liftPt x) r := LinearMap.pi fun x ↦ diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Grid/OmittedConditions.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Grid/OmittedConditions.lean index 14bfbe54d9..13913689c9 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Grid/OmittedConditions.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Grid/OmittedConditions.lean @@ -38,7 +38,7 @@ The blueprint also assumes `r ≥ 1` and `T ≤ U`; neither is needed for the st omitted. -/ -@[expose] public section +public section namespace Nikodym.LowerBound @@ -54,6 +54,7 @@ variable (I : Ideal (MvPolynomial (Fin d) K)) (r : ℕ) (B₀ : Finset (Fin d omit [Fintype F] in /-- Blueprint G04: the `K`-linear map `V_I(T) → ∏_{x ∉ B₀} Q_{I, ι x}(r)` sending the class of a polynomial of total degree at most `T` to its jets at the grid points outside `B₀`. -/ +@[expose] noncomputable def omittedJetsLinearMap : restrictionSpace I T →ₗ[K] ∀ x : {x : Fin d → F // x ∉ B₀}, JetSpace I (liftPt x.1) r := (LinearMap.pi fun x : {x : Fin d → F // x ∉ B₀} ↦ LinearMap.proj x.1) ∘ₗ diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Grid/Reduction.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Grid/Reduction.lean index f9a8f4d2bf..b12dcf1f8c 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Grid/Reduction.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Grid/Reduction.lean @@ -39,7 +39,7 @@ For the finite grid `F ⊆ K` we also define the grid polynomial the grid polynomials `Z i` lie in the point ideal of every grid point. -/ -@[expose] public section +public section namespace Nikodym.LowerBound @@ -57,6 +57,7 @@ noncomputable def Z (g : Fin d → Polynomial K) (i : Fin d) : MvPolynomial (Fin Polynomial.aeval (X i) (g i) /-- Blueprint G01: the grid ideal `J = (Z 1, …, Z d)`. -/ +@[expose] noncomputable def gridIdeal (g : Fin d → Polynomial K) : Ideal (MvPolynomial (Fin d) K) := Ideal.span (Set.range (Z g)) diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Hilbert/Defs.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Hilbert/Defs.lean index 4a588d90a9..83fcd7554a 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Hilbert/Defs.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Hilbert/Defs.lean @@ -30,7 +30,7 @@ Only the finite-dimensional image is ever given a `finrank`; the full coordinate need not be finite-dimensional. -/ -@[expose] public section +public section namespace Nikodym.LowerBound @@ -40,11 +40,13 @@ variable {K : Type*} [Field K] {d : ℕ} /-- Blueprint F02: the restriction space `V_I(t) = im (P_{d,≤t} → P_d ⧸ I)`, the image of the polynomials of total degree at most `t` in the quotient algebra `P_d ⧸ I`. -/ +@[expose] noncomputable def restrictionSpace (I : Ideal (MvPolynomial (Fin d) K)) (t : ℕ) : Submodule K (MvPolynomial (Fin d) K ⧸ I) := (restrictTotalDegree (Fin d) K t).map (Ideal.Quotient.mkₐ K I).toLinearMap /-- Blueprint F02: the affine Hilbert function `H_I(t) = dim_K V_I(t)`. -/ +@[expose] noncomputable def hilbert (I : Ideal (MvPolynomial (Fin d) K)) (t : ℕ) : ℕ := Module.finrank K (restrictionSpace I t) diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Hilbert/DegreeUpper.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Hilbert/DegreeUpper.lean index d8c815f0be..75d14b5f08 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Hilbert/DegreeUpper.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Hilbert/DegreeUpper.lean @@ -50,7 +50,7 @@ The packaged statement consumed by node A04′ is `exists_hilbert_bounds`. `∑ i, (t - e i + k).choose k`. -/ -@[expose] public section +public section namespace Nikodym.LowerBound diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Hilbert/Gap.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Hilbert/Gap.lean index c934981ac3..2debb769dc 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Hilbert/Gap.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Hilbert/Gap.lean @@ -31,7 +31,7 @@ The intermediate step `hilbert_gap_aux`, `r * H_I(U) ≤ r * H_I(T) + 4 d² * H_ every ideal `I` and needs no algebraic input. -/ -@[expose] public section +public section namespace Nikodym.LowerBound diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Hilbert/Normalized.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Hilbert/Normalized.lean index bcec0c0216..0a98c9dec4 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Hilbert/Normalized.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Hilbert/Normalized.lean @@ -36,7 +36,7 @@ The main theorem `hilbert_mul_choose_le` then follows from `hilbert_eq_sum_layer with `S = standardSet I`. -/ -@[expose] public section +public section namespace Nikodym.LowerBound diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Hilbert/Shadow.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Hilbert/Shadow.lean index f480508713..1aa05d95f6 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Hilbert/Shadow.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Hilbert/Shadow.lean @@ -18,7 +18,7 @@ Blueprint node H02: for a divisor-closed set `S` of exponent vectors in `N` vari `α ↦ α + eᵢ`. -/ -@[expose] public section +public section namespace Nikodym.LowerBound @@ -31,6 +31,7 @@ noncomputable def layer (S : Set (Fin N → ℕ)) (t : ℕ) : Finset (Fin N → classical exact (Nat.antidiagonalTuple N t).filter (· ∈ S) /-- Blueprint H02: the number of elements of `S` of total degree `t`. -/ +@[expose] noncomputable def layerCard (S : Set (Fin N → ℕ)) (t : ℕ) : ℕ := (layer S t).card /-- Blueprint H02: membership in a degree layer. -/ diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Hilbert/StandardMonomials.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Hilbert/StandardMonomials.lean index 804bee48c0..1b92babe7d 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Hilbert/StandardMonomials.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Hilbert/StandardMonomials.lean @@ -45,7 +45,7 @@ No Gröbner basis algorithm is used: leading-term cancellation against an arbitr with the same leading exponent suffices. -/ -@[expose] public section +public section namespace Nikodym.LowerBound diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/InterpolationCut.lean b/LeanPool/Nikodym/Nikodym/LowerBound/InterpolationCut.lean index 01eb8037f1..01176df158 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/InterpolationCut.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/InterpolationCut.lean @@ -36,7 +36,7 @@ The blueprint hypothesis `k ≤ d` is automatic (`quotDim_le`) and `2 ≤ q` fol `32 ≤ 8 d² ≤ r ≤ q`; neither is assumed. -/ -@[expose] public section +public section namespace Nikodym.LowerBound diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Jets/Defs.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Jets/Defs.lean index 2ca0c2b6d2..f3594e0af1 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Jets/Defs.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Jets/Defs.lean @@ -37,7 +37,7 @@ The main results are No localizations appear: everything is phrased with global quotients of `P_d`. -/ -@[expose] public section +public section namespace Nikodym.LowerBound @@ -117,6 +117,7 @@ section Translate /-- Blueprint F03: the translation automorphism `τₓ : X i ↦ X i - x i` of `P_d`. It satisfies `ev_x ∘ τₓ = ev_0` and carries `𝔪₀` onto `𝔪ₓ`. -/ +@[expose] noncomputable def translate (x : Fin d → K) : MvPolynomial (Fin d) K ≃ₐ[K] MvPolynomial (Fin d) K := AlgEquiv.ofAlgHom (aeval fun i ↦ X i - C (x i)) (aeval fun i ↦ X i + C (x i)) @@ -289,6 +290,7 @@ section Jets variable (I : Ideal (MvPolynomial (Fin d) K)) (x : Fin d → K) (r : ℕ) /-- Blueprint F03: the jet ideal `I + 𝔪ₓ ^ r` (ideal supremum). -/ +@[expose] noncomputable def jetIdeal : Ideal (MvPolynomial (Fin d) K) := I ⊔ pointIdeal x ^ r @@ -297,6 +299,7 @@ abbrev JetSpace : Type _ := MvPolynomial (Fin d) K ⧸ jetIdeal I x r /-- Blueprint F03: the jet dimension `j_{I,x}(r) = dim_K Q_{I,x}(r)`. -/ +@[expose] noncomputable def jetDim : ℕ := Module.finrank K (JetSpace I x r) diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Jets/LowerBound.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Jets/LowerBound.lean index e50c5df6cb..9856b1216d 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Jets/LowerBound.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Jets/LowerBound.lean @@ -35,7 +35,7 @@ injectivity. So the polynomials of total degree `≤ r - 1` in `s` variables emb The hypothesis `[Infinite K]` is removed by base change in the assembly (node TR). -/ -@[expose] public section +public section namespace Nikodym.LowerBound diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Lines/Basic.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Lines/Basic.lean index 116e8bdfd7..c7c9933e0f 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Lines/Basic.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Lines/Basic.lean @@ -36,7 +36,7 @@ The finite field `F` enters only through the coordinate lift `Nikodym.LowerBound `liftPt v` passes through `liftPt x`, then `x = b + a • v` for some `a : F`. -/ -@[expose] public section +public section namespace Nikodym.LowerBound @@ -104,6 +104,7 @@ end LineRes section LineIdeal /-- Blueprint F04: the line ideal `λ_{b,v} = ker (res_{b,v})`. -/ +@[expose] noncomputable def lineIdeal (b v : Fin d → K) : Ideal (MvPolynomial (Fin d) K) := RingHom.ker (lineRes b v) @@ -123,6 +124,7 @@ theorem lineIdeal_ne_top (b v : Fin d → K) : lineIdeal b v ≠ ⊤ := RingHom.ker_ne_top (lineRes b v) /-- Blueprint F04: `P_d ⧸ λ_{b,v} ≃ K[T]` for `v ≠ 0`, induced by `res_{b,v}`. -/ +@[expose] noncomputable def lineQuotEquiv (b : Fin d → K) (hv : v ≠ 0) : (MvPolynomial (Fin d) K ⧸ lineIdeal b v) ≃ₐ[K] Polynomial K := Ideal.quotientKerAlgEquivOfSurjective (lineRes_surjective b hv) @@ -360,6 +362,7 @@ section Lift variable {F : Type*} [Field F] [Algebra F K] /-- Blueprint F04: the coordinatewise lift `ι : F^d → K^d` along `algebraMap F K`. -/ +@[expose] def liftPt (x : Fin d → F) : Fin d → K := fun i ↦ algebraMap F K (x i) variable (K) diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Lines/Jets.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Lines/Jets.lean index 5d703e3dd3..3e90432270 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Lines/Jets.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Lines/Jets.lean @@ -19,7 +19,7 @@ If a line `T ↦ b + T v` lies on an ideal `I` (that is, `I ≤ λ_{b,v}`) and a restriction `res_{b,v} g`. The finite-field form substitutes the coordinate lift `liftPt`. -/ -@[expose] public section +public section namespace Nikodym.LowerBound diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Lines/Vanishing.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Lines/Vanishing.lean index ce3b78a0a9..ebbf49b13b 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Lines/Vanishing.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Lines/Vanishing.lean @@ -20,7 +20,7 @@ degree at most `r (q - 1) - 1` that satisfies the non-private jet conditions alo restricts identically to zero on that line. -/ -@[expose] public section +public section namespace Nikodym.LowerBound diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/Main.lean b/LeanPool/Nikodym/Nikodym/LowerBound/Main.lean index e6254d1106..08759e212a 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/Main.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/Main.lean @@ -31,7 +31,7 @@ The unconditional statements `Nikodym.card_compl_pow_mul_card_le` and `Nikodym.c in `Nikodym.Main` follow from these once an `AlgebraInterface F d` is constructed. -/ -@[expose] public section +public section namespace Nikodym.LowerBound diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/PolynomialSpaces.lean b/LeanPool/Nikodym/Nikodym/LowerBound/PolynomialSpaces.lean index 8facefad0f..c2eab8476e 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/PolynomialSpaces.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/PolynomialSpaces.lean @@ -33,7 +33,7 @@ Finite-dimensionality of `restrictTotalDegree (Fin d) K t` is already a Mathlib restate it as `Nikodym.LowerBound.instModuleFiniteRestrictTotalDegree` for discoverability. -/ -@[expose] public section +public section namespace Nikodym.LowerBound diff --git a/LeanPool/Nikodym/Nikodym/LowerBound/PrivateFamily.lean b/LeanPool/Nikodym/Nikodym/LowerBound/PrivateFamily.lean index ba8aebb0f9..910b518302 100644 --- a/LeanPool/Nikodym/Nikodym/LowerBound/PrivateFamily.lean +++ b/LeanPool/Nikodym/Nikodym/LowerBound/PrivateFamily.lean @@ -35,7 +35,7 @@ The main results are The number `L` of lines of the blueprint is `Fintype.card E`. -/ -@[expose] public section +public section namespace Nikodym.LowerBound @@ -78,6 +78,7 @@ variable [Algebra F K] /-- Blueprint F05: the line ideal `λ_{ι(b e), ι(v e)}` of the `e`-th line, over the extension field `K`. -/ +@[expose] noncomputable def lineIdeal (e : E) : Ideal (MvPolynomial (Fin d) K) := LowerBound.lineIdeal (liftPt (K := K) (P.b e)) (liftPt (P.v e)) @@ -131,6 +132,7 @@ section Subfamily /-- Blueprint F05: pulling back a private family along an injective map of index types gives a private family. -/ +@[expose] def comap {E' : Type*} [Fintype E'] (g : E' → E) (hg : Function.Injective g) : PrivateFamily F d E' where b := P.b ∘ g @@ -151,6 +153,7 @@ theorem comap_v {E' : Type*} [Fintype E'] (g : E' → E) (hg : Function.Injectiv rfl /-- Blueprint F05: every subfamily (indexed by a finset `s` of indices) is private. -/ +@[expose] def restrict (s : Finset E) : PrivateFamily F d s := P.comap Subtype.val Subtype.val_injective diff --git a/LeanPool/Nikodym/Nikodym/Main.lean b/LeanPool/Nikodym/Nikodym/Main.lean index 68505840fa..a3904f374e 100644 --- a/LeanPool/Nikodym/Nikodym/Main.lean +++ b/LeanPool/Nikodym/Nikodym/Main.lean @@ -34,7 +34,7 @@ Let `F` be a finite field with `q` elements, `d ≥ 2`, and `N ⊆ F^d` a Nikody `|N| ≤ q ^ d - q ^ (d - 2 ^ (1 - d) - ε)`. -/ -@[expose] public section +public section open Real diff --git a/LeanPool/Nikodym/Nikodym/MultiQuadratic/Basis.lean b/LeanPool/Nikodym/Nikodym/MultiQuadratic/Basis.lean index 2c732fccaa..efde960656 100644 --- a/LeanPool/Nikodym/Nikodym/MultiQuadratic/Basis.lean +++ b/LeanPool/Nikodym/Nikodym/MultiQuadratic/Basis.lean @@ -25,7 +25,7 @@ always passed as three separate arguments: constant coordinate, in particular an integer). -/ -@[expose] public section +public section open Finset open scoped symmDiff diff --git a/LeanPool/Nikodym/Nikodym/MultiQuadratic/Kummer.lean b/LeanPool/Nikodym/Nikodym/MultiQuadratic/Kummer.lean index 0476cdcd02..325d4b1ec9 100644 --- a/LeanPool/Nikodym/Nikodym/MultiQuadratic/Kummer.lean +++ b/LeanPool/Nikodym/Nikodym/MultiQuadratic/Kummer.lean @@ -36,7 +36,7 @@ statements `linearIndependent_sqrt_prod`, `linearIndependent_sqrt_prod_int` and * `Nikodym.MultiQuad.sum_intCast_mul_sqrt_prod_eq_zero`: the coefficient form over `ℤ`. -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Nikodym/Nikodym/MultiQuadratic/Legendre.lean b/LeanPool/Nikodym/Nikodym/MultiQuadratic/Legendre.lean index 5f187a525c..9d20f312f1 100644 --- a/LeanPool/Nikodym/Nikodym/MultiQuadratic/Legendre.lean +++ b/LeanPool/Nikodym/Nikodym/MultiQuadratic/Legendre.lean @@ -16,7 +16,7 @@ of odd prime cardinality, and a choice of square roots of the `rⱼ` induces a r `𝒪_r → F`. -/ -@[expose] public section +public section open MvPolynomial diff --git a/LeanPool/Nikodym/Nikodym/MultiQuadratic/Norm.lean b/LeanPool/Nikodym/Nikodym/MultiQuadratic/Norm.lean index 54bd64ba69..0ec6f5df63 100644 --- a/LeanPool/Nikodym/Nikodym/MultiQuadratic/Norm.lean +++ b/LeanPool/Nikodym/Nikodym/MultiQuadratic/Norm.lean @@ -23,7 +23,7 @@ As in `Nikodym.MultiQuadratic.Basis`, the K01 hypotheses `hr1`, `hsq`, `hcop` ar three separate arguments. -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Nikodym/Nikodym/MultiQuadratic/Order.lean b/LeanPool/Nikodym/Nikodym/MultiQuadratic/Order.lean index 58ee085aef..0c9b5005b2 100644 --- a/LeanPool/Nikodym/Nikodym/MultiQuadratic/Order.lean +++ b/LeanPool/Nikodym/Nikodym/MultiQuadratic/Order.lean @@ -21,7 +21,7 @@ sign embeddings `emb`, and conjugations `conj`. Linear independence of square ro used here. -/ -@[expose] public section +public section open MvPolynomial Finset open scoped symmDiff @@ -44,6 +44,7 @@ def mono (r : Fin m → ℕ) (S : Finset (Fin m)) : Order r := Ideal.Quotient.mk _ (∏ j ∈ S, X j) /-- Blueprint K02: the image of the indeterminate `Xⱼ` in `𝒪_r`. -/ +@[expose] def gen (r : Fin m → ℕ) (j : Fin m) : Order r := Ideal.Quotient.mk _ (X j) @@ -164,6 +165,7 @@ theorem mono_mul_mono (r : Fin m → ℕ) (S T : Finset (Fin m)) : section Sign /-- Blueprint K02: the sign `ε_S = ∏_{j ∈ S} εⱼ` of a subset. -/ +@[expose] def sgn (ε : Fin m → ℤˣ) (S : Finset (Fin m)) : ℤ := ∏ j ∈ S, (ε j : ℤ) diff --git a/LeanPool/Nikodym/Nikodym/MultiQuadratic/Scaffold.lean b/LeanPool/Nikodym/Nikodym/MultiQuadratic/Scaffold.lean index 567eea92f4..bb2d1131d4 100644 --- a/LeanPool/Nikodym/Nikodym/MultiQuadratic/Scaffold.lean +++ b/LeanPool/Nikodym/Nikodym/MultiQuadratic/Scaffold.lean @@ -22,7 +22,7 @@ monotone in `K₀`, so the same data is a scaffold with the larger constant `∏ `rⱼ ∣ ℓⱼ ℓ'ⱼ`. -/ -@[expose] public section +public section namespace Nikodym diff --git a/LeanPool/Nikodym/Solution.lean b/LeanPool/Nikodym/Solution.lean index 4aa8ac899e..88611dcbb7 100644 --- a/LeanPool/Nikodym/Solution.lean +++ b/LeanPool/Nikodym/Solution.lean @@ -28,7 +28,7 @@ The `example`s below are a readable local witness of the same facts: they type-c the proved theorems have the advertised types. -/ -@[expose] public section +public section namespace Nikodym 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/OneManifold.lean b/LeanPool/OneManifold.lean index 88574478ca..43ad59ccfd 100644 --- a/LeanPool/OneManifold.lean +++ b/LeanPool/OneManifold.lean @@ -46,4 +46,4 @@ Tags: topology MSC: 57N99, 54F65, 68V20 -/ -@[expose] public section +public section diff --git a/LeanPool/OneManifold/OneMfld/Charts.lean b/LeanPool/OneManifold/OneMfld/Charts.lean index 051902785e..ebb12c9ddd 100644 --- a/LeanPool/OneManifold/OneMfld/Charts.lean +++ b/LeanPool/OneManifold/OneMfld/Charts.lean @@ -18,7 +18,7 @@ An `OChart` has an open-interval target `Ioo x y` (an interior chart); an `HChar half-open target `Iio x` (a boundary chart); an `IChart` is either. -/ -@[expose] public section +public section namespace OneMfld @@ -42,14 +42,17 @@ variable [TopologicalSpace M] /-- Regard an interior chart as an interval chart. -/ +@[expose] def OChart.toIChart (a : OChart M) : IChart M := { a with is_interval := Or.inl a.target_ioo } /-- Regard a boundary chart as an interval chart. -/ +@[expose] def HChart.toIChart (a : HChart M) : IChart M := { a with is_interval := Or.inr a.target_iio } /-- Two sets meet and each has a point outside the other. -/ +@[expose] def Overlap (U : Set α) (V : Set α) : Prop := (U ∩ V).Nonempty ∧ (U \ V).Nonempty ∧ (V \ U).Nonempty diff --git a/LeanPool/OneManifold/OneMfld/CircleBlocks.lean b/LeanPool/OneManifold/OneMfld/CircleBlocks.lean index 01ce658475..8d8b253eb8 100644 --- a/LeanPool/OneManifold/OneMfld/CircleBlocks.lean +++ b/LeanPool/OneManifold/OneMfld/CircleBlocks.lean @@ -34,7 +34,7 @@ import Mathlib.Tactic.Ring -- shake: keep the circle by a closed arc and its complementary open arc. -/ -@[expose] public section +public section namespace OneMfld diff --git a/LeanPool/OneManifold/OneMfld/CircleGlue.lean b/LeanPool/OneManifold/OneMfld/CircleGlue.lean index 9e1bb8f868..92e3822f55 100644 --- a/LeanPool/OneManifold/OneMfld/CircleGlue.lean +++ b/LeanPool/OneManifold/OneMfld/CircleGlue.lean @@ -32,7 +32,7 @@ whose frontier is the two split points. The result is a chart of `M` onto the wh `AddCircle 1` with source `a.source ∪ b.source`. -/ -@[expose] public section +public section namespace OneMfld diff --git a/LeanPool/OneManifold/OneMfld/Classification.lean b/LeanPool/OneManifold/OneMfld/Classification.lean index efd775bb2a..1f3522f8d0 100644 --- a/LeanPool/OneManifold/OneMfld/Classification.lean +++ b/LeanPool/OneManifold/OneMfld/Classification.lean @@ -29,7 +29,7 @@ import Mathlib.Tactic.Tauto -- shake: keep Supporting results for the classification of compact one-dimensional manifolds. -/ -@[expose] public section +public section namespace OneMfld diff --git a/LeanPool/OneManifold/OneMfld/ClassifyInterval.lean b/LeanPool/OneManifold/OneMfld/ClassifyInterval.lean index 767eea1f1c..4651cf6da6 100644 --- a/LeanPool/OneManifold/OneMfld/ClassifyInterval.lean +++ b/LeanPool/OneManifold/OneMfld/ClassifyInterval.lean @@ -15,7 +15,7 @@ import Mathlib.Tactic.Ext -- shake: keep Classification of connected open subsets of the nonnegative real numbers. -/ -@[expose] public section +public section namespace OneMfld diff --git a/LeanPool/OneManifold/OneMfld/ClassifyOverlaps.lean b/LeanPool/OneManifold/OneMfld/ClassifyOverlaps.lean index 7301818583..89fa846421 100644 --- a/LeanPool/OneManifold/OneMfld/ClassifyOverlaps.lean +++ b/LeanPool/OneManifold/OneMfld/ClassifyOverlaps.lean @@ -32,7 +32,7 @@ import Mathlib.Tactic.Ext -- shake: keep Supporting results for the classification of compact one-dimensional manifolds. -/ -@[expose] public section +public section namespace OneMfld diff --git a/LeanPool/OneManifold/OneMfld/ClosureOverlap.lean b/LeanPool/OneManifold/OneMfld/ClosureOverlap.lean index 7d8e1bab02..e0803943c7 100644 --- a/LeanPool/OneManifold/OneMfld/ClosureOverlap.lean +++ b/LeanPool/OneManifold/OneMfld/ClosureOverlap.lean @@ -15,7 +15,7 @@ import Mathlib.Tactic.Push -- shake: keep Supporting results for the classification of compact one-dimensional manifolds. -/ -@[expose] public section +public section namespace OneMfld diff --git a/LeanPool/OneManifold/OneMfld/Compactness.lean b/LeanPool/OneManifold/OneMfld/Compactness.lean index 1a8ebeb4f1..443e0a4579 100644 --- a/LeanPool/OneManifold/OneMfld/Compactness.lean +++ b/LeanPool/OneManifold/OneMfld/Compactness.lean @@ -14,7 +14,7 @@ public import LeanPool.OneManifold.OneMfld.Noncompact Supporting results for the classification of compact one-dimensional manifolds. -/ -@[expose] public section +public section namespace OneMfld diff --git a/LeanPool/OneManifold/OneMfld/FiniteIntervalCharts.lean b/LeanPool/OneManifold/OneMfld/FiniteIntervalCharts.lean index a893dff94b..f196261687 100644 --- a/LeanPool/OneManifold/OneMfld/FiniteIntervalCharts.lean +++ b/LeanPool/OneManifold/OneMfld/FiniteIntervalCharts.lean @@ -14,7 +14,7 @@ public import LeanPool.OneManifold.OneMfld.IntervalCharts Supporting results for the classification of compact one-dimensional manifolds. -/ -@[expose] public section +public section namespace OneMfld diff --git a/LeanPool/OneManifold/OneMfld/FinitelyCharted.lean b/LeanPool/OneManifold/OneMfld/FinitelyCharted.lean index f2f10a93b4..16cdab3842 100644 --- a/LeanPool/OneManifold/OneMfld/FinitelyCharted.lean +++ b/LeanPool/OneManifold/OneMfld/FinitelyCharted.lean @@ -13,7 +13,7 @@ public import Mathlib.Geometry.Manifold.ChartedSpace Supporting results for the classification of compact one-dimensional manifolds. -/ -@[expose] public section +public section namespace OneMfld diff --git a/LeanPool/OneManifold/OneMfld/GlueBlocks.lean b/LeanPool/OneManifold/OneMfld/GlueBlocks.lean index dd71eaef8c..04a29077fd 100644 --- a/LeanPool/OneManifold/OneMfld/GlueBlocks.lean +++ b/LeanPool/OneManifold/OneMfld/GlueBlocks.lean @@ -32,7 +32,7 @@ Two overlapping boundary charts glue to a *closed* interval, so the glued chart * reflection images of end-segments in `ℝ≥0`, used to re-orient `OChart`s. -/ -@[expose] public section +public section namespace OneMfld diff --git a/LeanPool/OneManifold/OneMfld/GlueCore.lean b/LeanPool/OneManifold/OneMfld/GlueCore.lean index 99b4c6c353..3f045c8563 100644 --- a/LeanPool/OneManifold/OneMfld/GlueCore.lean +++ b/LeanPool/OneManifold/OneMfld/GlueCore.lean @@ -24,7 +24,7 @@ Two results feed the gluing construction: overlap would accumulate at two distinct points of `M` at once, contradicting `T2`. -/ -@[expose] public section +public section namespace OneMfld diff --git a/LeanPool/OneManifold/OneMfld/GlueNNReal.lean b/LeanPool/OneManifold/OneMfld/GlueNNReal.lean index d717829da2..aa71cd1c61 100644 --- a/LeanPool/OneManifold/OneMfld/GlueNNReal.lean +++ b/LeanPool/OneManifold/OneMfld/GlueNNReal.lean @@ -23,7 +23,7 @@ its target. Pick a split value `μ ∈ Ioo q 1`, let `m := b.symm μ` be the spl All the frontier conditions come from `IsImage.frontier` and `frontier_Iic`. -/ -@[expose] public section +public section namespace OneMfld diff --git a/LeanPool/OneManifold/OneMfld/GlueUI.lean b/LeanPool/OneManifold/OneMfld/GlueUI.lean index c1a10d9018..05464ffe27 100644 --- a/LeanPool/OneManifold/OneMfld/GlueUI.lean +++ b/LeanPool/OneManifold/OneMfld/GlueUI.lean @@ -28,7 +28,7 @@ point `m := b.symm μ` (that is, `k/(ρ+k) = μ/2` where `ρ := a m`). Glue with `[0, μ/2]` and `(μ/2, 1]` unite to the whole interval. -/ -@[expose] public section +public section namespace OneMfld diff --git a/LeanPool/OneManifold/OneMfld/IntervalCharts.lean b/LeanPool/OneManifold/OneMfld/IntervalCharts.lean index d1776a6f40..3c38873644 100644 --- a/LeanPool/OneManifold/OneMfld/IntervalCharts.lean +++ b/LeanPool/OneManifold/OneMfld/IntervalCharts.lean @@ -14,7 +14,7 @@ public import LeanPool.OneManifold.OneMfld.NiceCharts Supporting results for the classification of compact one-dimensional manifolds. -/ -@[expose] public section +public section namespace OneMfld diff --git a/LeanPool/OneManifold/OneMfld/LocallyConnected.lean b/LeanPool/OneManifold/OneMfld/LocallyConnected.lean index fbd3f7da1d..684fc3d67a 100644 --- a/LeanPool/OneManifold/OneMfld/LocallyConnected.lean +++ b/LeanPool/OneManifold/OneMfld/LocallyConnected.lean @@ -20,7 +20,7 @@ import Mathlib.Tactic.Ring -- shake: keep Supporting results for the classification of compact one-dimensional manifolds. -/ -@[expose] public section +public section namespace OneMfld diff --git a/LeanPool/OneManifold/OneMfld/NiceCharts.lean b/LeanPool/OneManifold/OneMfld/NiceCharts.lean index cc7cd9be06..bbda40a530 100644 --- a/LeanPool/OneManifold/OneMfld/NiceCharts.lean +++ b/LeanPool/OneManifold/OneMfld/NiceCharts.lean @@ -15,7 +15,7 @@ public import Mathlib.Geometry.Manifold.ChartedSpace Supporting results for the classification of compact one-dimensional manifolds. -/ -@[expose] public section +public section namespace OneMfld diff --git a/LeanPool/OneManifold/OneMfld/Noncompact.lean b/LeanPool/OneManifold/OneMfld/Noncompact.lean index 31c89738f3..33c4292f16 100644 --- a/LeanPool/OneManifold/OneMfld/Noncompact.lean +++ b/LeanPool/OneManifold/OneMfld/Noncompact.lean @@ -16,7 +16,7 @@ public import Mathlib.Topology.UniformSpace.Real Supporting results for the classification of compact one-dimensional manifolds. -/ -@[expose] public section +public section namespace OneMfld diff --git a/LeanPool/OneManifold/OneMfld/Normalize.lean b/LeanPool/OneManifold/OneMfld/Normalize.lean index 8914a41b22..9d0f66c5a4 100644 --- a/LeanPool/OneManifold/OneMfld/Normalize.lean +++ b/LeanPool/OneManifold/OneMfld/Normalize.lean @@ -18,7 +18,7 @@ is `Ioo 0 1`, and an `OChart` with target `Ioo 0 1` can be orientation-reversed (`x ↦ 1 - x`). H-charts cannot be flipped: the closed end at `0` is a boundary point. -/ -@[expose] public section +public section namespace OneMfld @@ -27,6 +27,7 @@ open Set noncomputable section /-- Multiplication by a positive constant, as a self-homeomorphism of `ℝ≥0`. -/ +@[expose] def NNReal.mulHomeomorph (c : NNReal) (hc : 0 < c) : NNReal ≃ₜ NNReal where toFun x := c * x invFun y := c⁻¹ * y diff --git a/LeanPool/OneManifold/OneMfld/Outer.lean b/LeanPool/OneManifold/OneMfld/Outer.lean index 975dfd8b7a..fd24615e88 100644 --- a/LeanPool/OneManifold/OneMfld/Outer.lean +++ b/LeanPool/OneManifold/OneMfld/Outer.lean @@ -29,7 +29,7 @@ argument), contradicting `nonempty_closure_inter_diff`, which forces the compone closure to escape into `V.source \ U.source`. -/ -@[expose] public section +public section namespace OneMfld diff --git a/LeanPool/OneManifold/OneMfld/PartialHomeomorphHelpers.lean b/LeanPool/OneManifold/OneMfld/PartialHomeomorphHelpers.lean index b4db4ac4b8..de1669b639 100644 --- a/LeanPool/OneManifold/OneMfld/PartialHomeomorphHelpers.lean +++ b/LeanPool/OneManifold/OneMfld/PartialHomeomorphHelpers.lean @@ -16,7 +16,7 @@ import Mathlib.Tactic.Have Supporting results for the classification of compact one-dimensional manifolds. -/ -@[expose] public section +public section namespace OneMfld diff --git a/LeanPool/OneManifold/OneMfld/RealIntervals.lean b/LeanPool/OneManifold/OneMfld/RealIntervals.lean index 15de7a5b53..ff8d2e10bd 100644 --- a/LeanPool/OneManifold/OneMfld/RealIntervals.lean +++ b/LeanPool/OneManifold/OneMfld/RealIntervals.lean @@ -24,7 +24,7 @@ import Mathlib.Tactic.Push -- shake: keep Supporting results for the classification of compact one-dimensional manifolds. -/ -@[expose] public section +public section namespace OneMfld diff --git a/LeanPool/OneManifold/OneMfld/TransitionMono.lean b/LeanPool/OneManifold/OneMfld/TransitionMono.lean index 3baa4e91b7..d8832149e8 100644 --- a/LeanPool/OneManifold/OneMfld/TransitionMono.lean +++ b/LeanPool/OneManifold/OneMfld/TransitionMono.lean @@ -19,7 +19,7 @@ monotone or strictly antitone; and a strictly monotone map of one open interval another sends ends to ends. -/ -@[expose] public section +public section namespace OneMfld diff --git a/LeanPool/OneManifold/OneMfld/TwoComponents.lean b/LeanPool/OneManifold/OneMfld/TwoComponents.lean index 75b394652a..00facbee7d 100644 --- a/LeanPool/OneManifold/OneMfld/TwoComponents.lean +++ b/LeanPool/OneManifold/OneMfld/TwoComponents.lean @@ -21,7 +21,7 @@ the full overlap to a single component `W`: the extra hypothesis is that the rel interior endpoint is not in the image of the *full* overlap. -/ -@[expose] public section +public section namespace OneMfld diff --git a/LeanPool/OneManifold/OneMfld/UnitInterval.lean b/LeanPool/OneManifold/OneMfld/UnitInterval.lean index 2f5c5e9c43..166757ead2 100644 --- a/LeanPool/OneManifold/OneMfld/UnitInterval.lean +++ b/LeanPool/OneManifold/OneMfld/UnitInterval.lean @@ -13,7 +13,7 @@ public import Mathlib.Topology.UnitInterval Supporting results for the classification of compact one-dimensional manifolds. -/ -@[expose] public section +public section namespace OneMfld diff --git a/LeanPool/OneManifold/Solution.lean b/LeanPool/OneManifold/Solution.lean index da5418177a..f7b3a401b1 100644 --- a/LeanPool/OneManifold/Solution.lean +++ b/LeanPool/OneManifold/Solution.lean @@ -19,7 +19,7 @@ Prop-level disjunction. The Challenge's `{x : ℝ // 0 ≤ x ∧ x ≤ 1}` is definitionally `↥OneMfld.UnitInterval` (and Mathlib's `↥unitInterval`). -/ -@[expose] public section +public section namespace OneMfld diff --git a/LeanPool/OperatorTheory/CrouzeixPalenciaSolution.lean b/LeanPool/OperatorTheory/CrouzeixPalenciaSolution.lean index f0f1695491..7568ba8654 100644 --- a/LeanPool/OperatorTheory/CrouzeixPalenciaSolution.lean +++ b/LeanPool/OperatorTheory/CrouzeixPalenciaSolution.lean @@ -21,7 +21,7 @@ The definitions abbreviate the proof library's public representations, and the theorems delegate to its proofs. -/ -@[expose] public section +public section open scoped InnerProductSpace Polynomial diff --git a/LeanPool/OperatorTheory/Operator/BoundaryCheck.lean b/LeanPool/OperatorTheory/Operator/BoundaryCheck.lean index a9688ac3ec..64baf8f0c9 100644 --- a/LeanPool/OperatorTheory/Operator/BoundaryCheck.lean +++ b/LeanPool/OperatorTheory/Operator/BoundaryCheck.lean @@ -15,7 +15,7 @@ declaration. A changed source signature therefore breaks elaboration, while the manifest separately audits the production declaration's axioms. -/ -@[expose] public section +public section open Complex ContinuousLinearMap Metric Polynomial Set open scoped ENNReal InnerProductSpace Interval Real diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/AdjointIntegral.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/AdjointIntegral.lean index 3553789112..d03a931a26 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/AdjointIntegral.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/AdjointIntegral.lean @@ -30,7 +30,7 @@ theorem and records the resulting contour formula. symmetrization of an operator kernel and its adjoint. -/ -@[expose] public section +public section open MeasureTheory open scoped InnerProductSpace Interval diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/AffineAuxiliary.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/AffineAuxiliary.lean index 8e9e19134d..06342d6376 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/AffineAuxiliary.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/AffineAuxiliary.lean @@ -29,7 +29,7 @@ contour is unchanged under these three simultaneous operations. scalar auxiliary identity on an arbitrary enclosing disk. -/ -@[expose] public section +public section open Complex MeasureTheory open scoped InnerProductSpace Interval Real diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/AffineCrouzeix.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/AffineCrouzeix.lean index 7852dde428..9ffe7d737e 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/AffineCrouzeix.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/AffineCrouzeix.lean @@ -21,7 +21,7 @@ an arbitrary enclosing disk by the usual affine normalization. -- the unconditional polynomial bound on an arbitrary open operator-norm disk. -/ -@[expose] public section +public section open scoped InnerProductSpace Polynomial diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/AffineDisk.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/AffineDisk.lean index 960a2df852..77b661b8e1 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/AffineDisk.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/AffineDisk.lean @@ -29,7 +29,7 @@ while the polynomial is precomposed with `z ↦ R * z + c`. package. -/ -@[expose] public section +public section open scoped InnerProductSpace Pointwise Polynomial diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/AffinePolynomial.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/AffinePolynomial.lean index c90ab472f1..d2547b0440 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/AffinePolynomial.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/AffinePolynomial.lean @@ -25,7 +25,7 @@ complex polynomial is precomposed with the affine map `z ↦ a * z + b`. * `polynomialSupNorm_affineComposition_image` — exact transport of the polynomial sup-norm. -/ -@[expose] public section +public section open scoped Polynomial diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/AffineProduct.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/AffineProduct.lean index 6440b19625..5faf18191e 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/AffineProduct.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/AffineProduct.lean @@ -26,7 +26,7 @@ its center. arbitrary-center disk estimate under strict operator-norm enclosure. -/ -@[expose] public section +public section open Complex Polynomial Set open scoped InnerProductSpace diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/AffineSpectralSet.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/AffineSpectralSet.lean index 1d04c83b3a..e3474f99a1 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/AffineSpectralSet.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/AffineSpectralSet.lean @@ -16,7 +16,7 @@ polynomial spectral-set estimate by the same affine map, without changing the spectral-set constant. -/ -@[expose] public section +public section open Set open scoped InnerProductSpace Pointwise Polynomial diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/ApproximationSupNorm.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/ApproximationSupNorm.lean index 8dd2eeb29d..d3fdfe771e 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/ApproximationSupNorm.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/ApproximationSupNorm.lean @@ -36,7 +36,7 @@ and nested, hence would have a point in their common intersection. `SmoothApprox.lean`. -/ -@[expose] public section +public section open Filter Polynomial Set diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/AuxOperator.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/AuxOperator.lean index ca1afbc2fa..0f171dfe7e 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/AuxOperator.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/AuxOperator.lean @@ -50,7 +50,7 @@ theorem from which those identities follow directly. the packaged bounded auxiliary-operator construction. -/ -@[expose] public section +public section open Complex Set spectrum open scoped InnerProductSpace Real Interval @@ -108,6 +108,7 @@ theorem crouzeixAuxiliaryIntegrand_contourIntegrable [CompleteSpace E] (A : E /-- The normalized Crouzeix--Palencia auxiliary operator associated to a scalar boundary datum `h` on a smooth Jordan domain. -/ +@[expose] noncomputable def crouzeixAuxiliaryOperator (A : E →L[ℂ] E) (Omega : SmoothJordanDomain) (h : ℂ → ℂ) : E →L[ℂ] E := (2 * (Real.pi : ℂ) * I)⁻¹ • @@ -162,6 +163,7 @@ theorem exists_bound_crouzeixPolynomialAuxiliaryIntegrand [CompleteSpace E] /-- The normalized auxiliary operator associated to the conjugate boundary values of a polynomial `p`. -/ +@[expose] noncomputable def crouzeixPolynomialAuxiliaryOperator (A : E →L[ℂ] E) (Omega : SmoothJordanDomain) (p : Polynomial ℂ) : E →L[ℂ] E := crouzeixAuxiliaryOperator A Omega (fun z => star (Polynomial.eval z p)) diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/BoundaryApproximation.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/BoundaryApproximation.lean index 37bcc91255..e5d46a5ff4 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/BoundaryApproximation.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/BoundaryApproximation.lean @@ -32,7 +32,7 @@ smooth-boundary estimate is passed through the compact exhaustion. convergence of the boundary norms to the target norm. -/ -@[expose] public section +public section open Filter Polynomial Set diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/BoundaryMaximum.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/BoundaryMaximum.lean index bf758ab2e6..5b80433b83 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/BoundaryMaximum.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/BoundaryMaximum.lean @@ -38,7 +38,7 @@ carrier as a field. identity for a bounded smooth Jordan carrier. -/ -@[expose] public section +public section open Complex Polynomial Set diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/CircleAuxiliary.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/CircleAuxiliary.lean index c07a8b51be..ac75bf11a8 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/CircleAuxiliary.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/CircleAuxiliary.lean @@ -24,7 +24,7 @@ the Crouzeix--Palencia polynomial auxiliary operator is simply auxiliary identity used by the sharp product bound. -/ -@[expose] public section +public section open Complex ComplexConjugate Polynomial Set open scoped InnerProductSpace Interval Real diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/CircleCauchy.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/CircleCauchy.lean index c2db8a9afd..7386e9a145 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/CircleCauchy.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/CircleCauchy.lean @@ -48,7 +48,7 @@ needed for the full Crouzeix--Palencia capstone. operator Cauchy formula. -/ -@[expose] public section +public section open Complex Set spectrum TopologicalSpace open scoped Real Interval diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/CircleKernel.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/CircleKernel.lean index 03e7408269..a68202dff5 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/CircleKernel.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/CircleKernel.lean @@ -35,7 +35,7 @@ side conditions consumed by the positive-kernel contractivity bound (`PositiveKe Requires `[CompleteSpace E]` (spectrum, adjoints). -/ -@[expose] public section +public section open Complex Polynomial spectrum open scoped InnerProductSpace diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/CircleProduct.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/CircleProduct.lean index ec10579479..3bed0bba78 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/CircleProduct.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/CircleProduct.lean @@ -35,7 +35,7 @@ assembly proved here. product estimate for the actual centered-disk auxiliary operator. -/ -@[expose] public section +public section open Complex Polynomial Set open scoped InnerProductSpace Pointwise diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/CircleSymmetrized.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/CircleSymmetrized.lean index d291eca90a..b0c85f78f4 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/CircleSymmetrized.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/CircleSymmetrized.lean @@ -55,7 +55,7 @@ corollary, and the representation is the polynomial double-layer identity of `‖p(A)‖ ≤ (1 + √2) * sup_{|z| ≤ R} ‖p(z)‖` (auxiliary-operator value from `CircleAuxiliary.lean`). -/ -@[expose] public section +public section open Complex Polynomial spectrum open scoped InnerProductSpace diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/ClosedBallPalencia.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/ClosedBallPalencia.lean index d953c403b2..26a4e0f392 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/ClosedBallPalencia.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/ClosedBallPalencia.lean @@ -19,7 +19,7 @@ companion is the constant `star (p(c))`, so constant polynomials give exact approximation at every stage. -/ -@[expose] public section +public section open Complex Filter MeasureTheory Metric Set open scoped InnerProductSpace Interval Real diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/CompactThickeningApprox.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/CompactThickeningApprox.lean index 6bf20c0c74..5f78386395 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/CompactThickeningApprox.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/CompactThickeningApprox.lean @@ -28,7 +28,7 @@ assembly. open-stage frontier lies in the compact control set at the same radius. -/ -@[expose] public section +public section open Metric Set @@ -44,7 +44,7 @@ private theorem smoothApproxRadius_antitone : Antitone smoothApproxRadius := by · exact_mod_cast Nat.add_le_add_right hmn 1 /-- The closed metric thickening of `K` at radius `1 / (n + 1)`. -/ -noncomputable def compactThickeningApprox (K : Set ℂ) (n : ℕ) : Set ℂ := +@[expose] noncomputable def compactThickeningApprox (K : Set ℂ) (n : ℕ) : Set ℂ := Metric.cthickening (smoothApproxRadius n) K /-- A closed thickening of a nonempty planar set at the positive approximation diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/ContourIntegral.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/ContourIntegral.lean index f60c215de0..7a4517831f 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/ContourIntegral.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/ContourIntegral.lean @@ -37,7 +37,7 @@ contours of the Crouzeix–Palencia argument — become available. for integrands with a primitive). -/ -@[expose] public section +public section open scoped Real Interval open MeasureTheory Set @@ -46,11 +46,13 @@ variable {F : Type*} [NormedAddCommGroup F] [NormedSpace ℂ F] /-- `f` is integrable along the parameterized curve `γ` over `[0, 2π]`: the integrand `t ↦ deriv γ t • f (γ t)` is interval integrable. -/ +@[expose] def ContourIntegrable (f : ℂ → F) (γ : ℝ → ℂ) : Prop := IntervalIntegrable (fun t => deriv γ t • f (γ t)) volume 0 (2 * π) /-- The contour integral `∫ t in 0..2π, γ'(t) • f (γ t)` of `f` along the parameterized curve `γ`. -/ +@[expose] noncomputable def contourIntegral (f : ℂ → F) (γ : ℝ → ℂ) : F := ∫ t in (0 : ℝ)..(2 * π), deriv γ t • f (γ t) diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/ConvexRunge.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/ConvexRunge.lean index af5cd46e02..688b647ed1 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/ConvexRunge.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/ConvexRunge.lean @@ -24,7 +24,7 @@ underlying affine separator directly for downstream polynomial-hull and functional-calculus arguments. -/ -@[expose] public section +public section open Complex Filter Metric Set open scoped Topology diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/ConvexRungeClosure.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/ConvexRungeClosure.lean index 18f855bc7a..20610449d9 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/ConvexRungeClosure.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/ConvexRungeClosure.lean @@ -20,7 +20,7 @@ Cauchy-kernel approximation, it turns uniform approximation by quadrature sums into uniform approximation by one polynomial sequence. -/ -@[expose] public section +public section open Filter Polynomial Set open scoped Topology diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/ConvexRungeFinite.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/ConvexRungeFinite.lean index 1dde7fe7a5..0d298329f2 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/ConvexRungeFinite.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/ConvexRungeFinite.lean @@ -18,7 +18,7 @@ compact-uniform limit of a single sequence of complex polynomials. This is the finite-quadrature closure step used in constructive Runge arguments. -/ -@[expose] public section +public section open Complex Filter Set open scoped Topology diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/ConvexRungeIntegral.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/ConvexRungeIntegral.lean index 5430d1b362..945e0d5730 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/ConvexRungeIntegral.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/ConvexRungeIntegral.lean @@ -25,7 +25,7 @@ gives finite sampled kernel sums, and a diagonal choice of their polynomial approximants converges uniformly to the full integral. -/ -@[expose] public section +public section open Complex Filter MeasureTheory Set open scoped Topology Interval diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/DiskMergelyan.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/DiskMergelyan.lean index b701f5c140..203977da64 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/DiskMergelyan.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/DiskMergelyan.lean @@ -18,7 +18,7 @@ obtained by radially contracting into the open disk and taking a diagonal sequence of Taylor partial sums. -/ -@[expose] public section +public section open Complex Filter Metric Set open scoped Topology diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/DoubleLayer.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/DoubleLayer.lean index cc3e4d4678..cdb6352804 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/DoubleLayer.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/DoubleLayer.lean @@ -39,7 +39,7 @@ Route: for `y = R_A(σ) x` one has `x = σ • y - A y`, hence positive-operator form. -/ -@[expose] public section +public section open Complex open scoped InnerProductSpace diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/DoubleLayerBound.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/DoubleLayerBound.lean index 59d12449d9..7950e7d716 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/DoubleLayerBound.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/DoubleLayerBound.lean @@ -29,7 +29,7 @@ identified the concrete double-layer kernel. scalar weight bounded by `M` to an operator of norm at most `2 * M`. -/ -@[expose] public section +public section open MeasureTheory open scoped InnerProductSpace Interval Real diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/DoubleLayerIntegral.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/DoubleLayerIntegral.lean index d11281737d..0a99180452 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/DoubleLayerIntegral.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/DoubleLayerIntegral.lean @@ -38,7 +38,7 @@ no such boundary-value assertion is hidden in the normalization argument. resolvent contour has Cauchy integral `2 * pi * i • 1`. -/ -@[expose] public section +public section open Complex MeasureTheory Set open scoped InnerProductSpace Interval Real diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/GeneralSymmetrized.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/GeneralSymmetrized.lean index 75c7e4cc03..3f0fffddb1 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/GeneralSymmetrized.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/GeneralSymmetrized.lean @@ -55,7 +55,7 @@ Cauchy or Plemelj theorem is hidden here. -- the corresponding accretive quadratic-form statement. -/ -@[expose] public section +public section open Complex MeasureTheory Set open scoped InnerProductSpace Interval Real diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/NormalPolynomialBound.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/NormalPolynomialBound.lean index baabe95018..ae49499683 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/NormalPolynomialBound.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/NormalPolynomialBound.lean @@ -19,7 +19,7 @@ fact as a polynomial spectral-set theorem, rewrites the norm bound directly on the numerical range, and obtains the classical identity `w(A) = ‖A‖`. -/ -@[expose] public section +public section open Complex Set open scoped InnerProductSpace Polynomial diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/NormalProduct.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/NormalProduct.lean index 8f6191afd6..c6abd06a7e 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/NormalProduct.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/NormalProduct.lean @@ -32,7 +32,7 @@ auxiliary identity. specializes the result to a star-normal operator. -/ -@[expose] public section +public section open Complex Polynomial Set open scoped InnerProductSpace diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/NormalProductSymmetrized.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/NormalProductSymmetrized.lean index 5a32650699..66a4bd4ffd 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/NormalProductSymmetrized.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/NormalProductSymmetrized.lean @@ -91,7 +91,7 @@ auxiliary product estimate. specializes the sharp estimate to a star-normal operator. -/ -@[expose] public section +public section open Complex Polynomial Set open scoped InnerProductSpace Pointwise diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/Palencia.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/Palencia.lean index 16044c4add..104f587789 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/Palencia.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/Palencia.lean @@ -59,7 +59,7 @@ formalized below; their distinct analytic hypotheses remain explicit. * `crouzeix_palencia_of_isStarNormal` -- the sharper normal-operator branch. -/ -@[expose] public section +public section open scoped InnerProductSpace diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/PalenciaApproximation.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/PalenciaApproximation.lean index 771ef5eead..a60f7894bf 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/PalenciaApproximation.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/PalenciaApproximation.lean @@ -26,7 +26,7 @@ that error after applying the algebraic Crouzeix--Palencia balance estimate. suited to a smooth exhaustion. -/ -@[expose] public section +public section open Filter open scoped InnerProductSpace diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/PalenciaExhaustion.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/PalenciaExhaustion.lean index 336646f87a..a15663ecb9 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/PalenciaExhaustion.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/PalenciaExhaustion.lean @@ -27,7 +27,7 @@ compact exhaustion of the closed numerical range. specialization to closed thickenings of the closed numerical range. -/ -@[expose] public section +public section open Filter Set open scoped InnerProductSpace diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/PalenciaSmoothApproximation.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/PalenciaSmoothApproximation.lean index 1559d2cb6b..e0758178ad 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/PalenciaSmoothApproximation.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/PalenciaSmoothApproximation.lean @@ -49,7 +49,7 @@ from the set-theoretic approximation alone. companions, uniform polynomial approximation, and calculus identification. -/ -@[expose] public section +public section open Complex Filter MeasureTheory Set open scoped InnerProductSpace Interval Real diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/PalenciaSupport.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/PalenciaSupport.lean index 138ed9a1d0..f8a934d0a0 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/PalenciaSupport.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/PalenciaSupport.lean @@ -48,7 +48,7 @@ the product estimate. from unit sup norm to every polynomial with positive sup norm. -/ -@[expose] public section +public section open Polynomial diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/PlanarDualDirection.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/PlanarDualDirection.lean index 111c809d0e..785e24affe 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/PlanarDualDirection.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/PlanarDualDirection.lean @@ -20,7 +20,7 @@ abstract separating hyperplanes be converted to the angle-indexed support halfspaces used by the smooth support-curve construction. -/ -@[expose] public section +public section open Complex @@ -40,7 +40,7 @@ theorem realContinuousLinearMap_apply_eq_re_im /-- The coefficient vector associated with a planar real continuous linear functional. -/ -noncomputable def realContinuousLinearMapCoefficient +@[expose] noncomputable def realContinuousLinearMapCoefficient (f : ℂ →L[ℝ] ℝ) : ℂ := ⟨f 1, f I⟩ diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/PolynomialBound.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/PolynomialBound.lean index 3a45d8df13..8c9f849cfa 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/PolynomialBound.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/PolynomialBound.lean @@ -20,7 +20,7 @@ file records the standard norm inequality directly on the numerical range and specializes it to powers, centered operators, and the numerical radius. -/ -@[expose] public section +public section open Complex Set open scoped InnerProductSpace Polynomial diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/PolynomialCauchyFromResolventMass.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/PolynomialCauchyFromResolventMass.lean index 611dd0f5c8..ac7b953e83 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/PolynomialCauchyFromResolventMass.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/PolynomialCauchyFromResolventMass.lean @@ -29,7 +29,7 @@ polynomial representation required by the Crouzeix--Palencia assembly. resolvent mass implies the normalized polynomial operator Cauchy formula. -/ -@[expose] public section +public section open Complex Polynomial Set open scoped InnerProductSpace Interval Real diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/PolynomialCauchyMass.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/PolynomialCauchyMass.lean index 4d5ed60be2..d3d28a5efe 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/PolynomialCauchyMass.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/PolynomialCauchyMass.lean @@ -21,7 +21,7 @@ constant polynomial `1` and clear the nonzero scalar `2πi`. derives the raw resolvent contour identity from polynomial Cauchy data. -/ -@[expose] public section +public section open Complex open scoped InnerProductSpace diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/PolynomialCompanionConvergence.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/PolynomialCompanionConvergence.lean index 8473896aba..b0e7e595e5 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/PolynomialCompanionConvergence.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/PolynomialCompanionConvergence.lean @@ -30,7 +30,7 @@ multiple of the same null sequence. -- its conjugate-polynomial specialization. -/ -@[expose] public section +public section open Complex Filter MeasureTheory Set open scoped InnerProductSpace Interval Real diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/PolynomialCompanionNormalization.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/PolynomialCompanionNormalization.lean index 7874519061..884a754062 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/PolynomialCompanionNormalization.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/PolynomialCompanionNormalization.lean @@ -37,7 +37,7 @@ polynomial on an infinite compact control set. normalization. -/ -@[expose] public section +public section open Filter diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/PolynomialSupNormZero.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/PolynomialSupNormZero.lean index f6084c5dbb..069f07f0c2 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/PolynomialSupNormZero.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/PolynomialSupNormZero.lean @@ -34,7 +34,7 @@ principal geometric specialization. nondegenerate closed disk, including the zero sup-norm case. -/ -@[expose] public section +public section open Polynomial ContinuousLinearMap diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/PolytopeSoftSupport.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/PolytopeSoftSupport.lean index 24ae73cc60..f7258395a8 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/PolytopeSoftSupport.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/PolytopeSoftSupport.lean @@ -23,23 +23,26 @@ These estimates are the quantitative input for constructing a smooth convex support curve around a polygon. -/ -@[expose] public section +public section open Complex Set open scoped ContDiff /-- The real support of `z` in the unit direction of angle `theta`. -/ +@[expose] noncomputable def polytopeDirectionalValue (z : ℂ) (theta : ℝ) : ℝ := z.re * Real.cos theta + z.im * Real.sin theta /-- The exponential partition sum used to smooth the support function of a finite point set. -/ +@[expose] noncomputable def polytopeSoftPartition (u : Finset ℂ) (delta theta : ℝ) : ℝ := ∑ z ∈ u, Real.exp (polytopeDirectionalValue z theta / delta) /-- The unnormalized log-sum-exp smoothing of the finite directional support function. -/ +@[expose] noncomputable def polytopeSoftSupport (u : Finset ℂ) (delta theta : ℝ) : ℝ := delta * Real.log (polytopeSoftPartition u delta theta) diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/PolytopeSoftSupportCurvature.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/PolytopeSoftSupportCurvature.lean index 744fa0c67b..29c53da4f3 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/PolytopeSoftSupportCurvature.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/PolytopeSoftSupportCurvature.lean @@ -20,7 +20,7 @@ inequalities: each exponent is bounded by the log partition, and weighted Cauchy--Schwarz makes the velocity variance nonnegative. -/ -@[expose] public section +public section open Complex Set open scoped ContDiff @@ -71,6 +71,7 @@ noncomputable def polytopeSoftSupportSecond /-- A strictly rounded support function, obtained by adding a positive constant to the soft support. -/ +@[expose] noncomputable def polytopeRoundedSupport (u : Finset ℂ) (delta rho theta : ℝ) : ℝ := polytopeSoftSupport u delta theta + rho diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/PositiveIntegral.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/PositiveIntegral.lean index e54b69e478..afe5f18e8d 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/PositiveIntegral.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/PositiveIntegral.lean @@ -30,7 +30,7 @@ has a positive Bochner integral. on positively oriented intervals. -/ -@[expose] public section +public section open MeasureTheory open scoped InnerProductSpace diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/PositiveKernelBound.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/PositiveKernelBound.lean index df94afb7d7..8327cfb84f 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/PositiveKernelBound.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/PositiveKernelBound.lean @@ -48,7 +48,7 @@ Requires `[CompleteSpace E]` for the square root of a positive operator and for Bochner integrals. -/ -@[expose] public section +public section open ContinuousLinearMap MeasureTheory open scoped InnerProductSpace diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/ProductBase.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/ProductBase.lean index f1d607d335..eaaedc0808 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/ProductBase.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/ProductBase.lean @@ -32,7 +32,7 @@ the polynomial sup norm on every nonempty set. -- the sharp L4.2e base case. -/ -@[expose] public section +public section open Complex Polynomial Set open scoped InnerProductSpace Interval Real diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/ProductContour.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/ProductContour.lean index 768ae6b8b9..c4a3c56f93 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/ProductContour.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/ProductContour.lean @@ -54,7 +54,7 @@ not by itself a reduction to two attainable norm estimates. -- the corresponding two-term norm reduction. -/ -@[expose] public section +public section open Complex Polynomial Set open scoped InnerProductSpace Interval Real diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/ProductNormalization.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/ProductNormalization.lean index 6abf68cf94..c738f1b751 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/ProductNormalization.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/ProductNormalization.lean @@ -22,7 +22,7 @@ Crouzeix--Palencia product estimate to polynomials of unit sup norm. polynomial. -/ -@[expose] public section +public section open scoped InnerProductSpace diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/ProductSymmetrizedAlignment.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/ProductSymmetrizedAlignment.lean index 400e63d232..1fb9460ac8 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/ProductSymmetrizedAlignment.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/ProductSymmetrizedAlignment.lean @@ -28,7 +28,7 @@ theorem gives the literal L4.2e bound for every polynomial. coupled scalar branch. -/ -@[expose] public section +public section open Complex Polynomial Set open scoped InnerProductSpace diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/ResolventCauchyKernel.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/ResolventCauchyKernel.lean index 2182a301ba..2232f25f13 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/ResolventCauchyKernel.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/ResolventCauchyKernel.lean @@ -22,7 +22,7 @@ This is the inner-contour calculation needed to identify the scalar companion functional calculus with the original conjugate-polynomial auxiliary contour. -/ -@[expose] public section +public section open Complex Set spectrum open scoped InnerProductSpace Interval Real diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/ResolventContourHomotopy.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/ResolventContourHomotopy.lean index 9fb25d4bde..b7eab3fd3e 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/ResolventContourHomotopy.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/ResolventContourHomotopy.lean @@ -21,7 +21,7 @@ resolvent-set condition. Oriented scalar winding then computes the common mass as `2 * pi * I • 1`. -/ -@[expose] public section +public section open Complex Filter MeasureTheory Metric Set spectrum open scoped InnerProductSpace Interval Pointwise Real diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCauchyKernelConstancy.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCauchyKernelConstancy.lean index 61c23c973c..830080bb4f 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCauchyKernelConstancy.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCauchyKernelConstancy.lean @@ -38,7 +38,7 @@ need only be checked at one point of each carrier. corresponding exterior winding normalization. -/ -@[expose] public section +public section open Complex Set open scoped Interval Real diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCauchyKernelWinding.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCauchyKernelWinding.lean index 72cb1e19ee..6809e2948c 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCauchyKernelWinding.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCauchyKernelWinding.lean @@ -39,7 +39,7 @@ last possibility. Thus the winding is exactly one. propagates throughout the carrier. -/ -@[expose] public section +public section open Complex Filter MeasureTheory Set open scoped Interval Real diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanion.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanion.lean index d70dcd5af9..22fb44ef29 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanion.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanion.lean @@ -47,13 +47,13 @@ Plemelj boundary-value argument. `analyticOn_crouzeixPolynomialScalarCompanion` -- their interior forms. -/ -@[expose] public section +public section open Complex Filter MeasureTheory Set spectrum open scoped Interval Real /-- The scalar Cauchy companion of `p` on a smooth Jordan domain. -/ -noncomputable def crouzeixPolynomialScalarCompanion +@[expose] noncomputable def crouzeixPolynomialScalarCompanion (Omega : SmoothJordanDomain) (p : Polynomial ℂ) (z : ℂ) : ℂ := (2 * (Real.pi : ℂ) * I)⁻¹ * contourIntegral @@ -62,6 +62,7 @@ noncomputable def crouzeixPolynomialScalarCompanion /-- The scalar integral obtained by differentiating the Cauchy companion kernel with respect to its interior argument. -/ +@[expose] noncomputable def crouzeixPolynomialScalarCompanionDeriv (Omega : SmoothJordanDomain) (p : Polynomial ℂ) (z : ℂ) : ℂ := (2 * (Real.pi : ℂ) * I)⁻¹ * diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionAssembly.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionAssembly.lean index 1d2797ddc8..0def56e359 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionAssembly.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionAssembly.lean @@ -32,7 +32,7 @@ of the original auxiliary contour. feeds those packages through the smooth-thickening fourth-power capstone. -/ -@[expose] public section +public section open Complex Filter Set open scoped InnerProductSpace Interval Real diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionBoundary.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionBoundary.lean index 10b21b399b..c69d9e8c30 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionBoundary.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionBoundary.lean @@ -40,7 +40,7 @@ closure and the frontier estimate remain explicit hypotheses. sharp reduction stated directly in terms of Plemelj boundary limits. -/ -@[expose] public section +public section open Complex Filter Set diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionBoundaryMeasure.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionBoundaryMeasure.lean index c134ce508b..91c20c9373 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionBoundaryMeasure.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionBoundaryMeasure.lean @@ -39,7 +39,7 @@ those two geometric facts rather than assuming the contraction itself. -- the sharp invariant from unit mass and oriented support alone. -/ -@[expose] public section +public section open Complex MeasureTheory Polynomial Set open scoped ComplexConjugate Interval Real @@ -47,6 +47,7 @@ open scoped ComplexConjugate Interval Real /-- The real scalar double-layer density based at `xi`. At the (measure-zero) parameter values where the boundary trace equals `xi`, Mathlib's inverse at zero makes this definition zero. -/ +@[expose] noncomputable def crouzeixBoundaryDoubleLayerDensity (Omega : SmoothJordanDomain) (xi : ℂ) (t : ℝ) : ℝ := (deriv Omega.boundaryParam t * diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionBoundaryMeasureAffine.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionBoundaryMeasureAffine.lean index 63423f3fed..a0c11cecce 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionBoundaryMeasureAffine.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionBoundaryMeasureAffine.lean @@ -38,7 +38,7 @@ domain. density. -/ -@[expose] public section +public section open Complex MeasureTheory Set open scoped Interval Real diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionBoundaryMeasureAssembly.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionBoundaryMeasureAssembly.lean index 4549da628f..441294473b 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionBoundaryMeasureAssembly.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionBoundaryMeasureAssembly.lean @@ -45,7 +45,7 @@ frontier-sup normalization. normalization, so no separate winding premise remains. -/ -@[expose] public section +public section open Complex MeasureTheory Set open scoped InnerProductSpace Interval Real diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionBoundaryMeasureCircle.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionBoundaryMeasureCircle.lean index 6664b40155..cea0a0dd3d 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionBoundaryMeasureCircle.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionBoundaryMeasureCircle.lean @@ -31,7 +31,7 @@ polynomial through the general boundary-measure theorem. sharp phase contractivity on every positive-radius disk. -/ -@[expose] public section +public section open Complex MeasureTheory Set open scoped ComplexConjugate Interval Real diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionBoundaryMeasureMass.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionBoundaryMeasureMass.lean index b553616434..3166091903 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionBoundaryMeasureMass.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionBoundaryMeasureMass.lean @@ -39,7 +39,7 @@ fundamental theorem then gives the mass identity. geometry gives sharp boundary-phase contractivity for every polynomial. -/ -@[expose] public section +public section open Complex Filter MeasureTheory Set open scoped Interval Real diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionCircle.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionCircle.lean index 34d50616e3..678ea506ab 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionCircle.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionCircle.lean @@ -41,7 +41,7 @@ for a general smooth convex boundary still require the Plemelj argument. -- the centered contraction. -/ -@[expose] public section +public section open Complex MeasureTheory Set open scoped InnerProductSpace Interval Real diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionDecay.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionDecay.lean index 28e1457d06..d72973e015 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionDecay.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionDecay.lean @@ -37,7 +37,7 @@ assert boundary continuity or the sharp companion contraction. companion tends to zero at infinity. -/ -@[expose] public section +public section open Complex Filter Set open scoped Interval Real diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionPhaseInduction.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionPhaseInduction.lean index 64b8e42610..76fdb9cd37 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionPhaseInduction.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionPhaseInduction.lean @@ -36,7 +36,7 @@ phase step as its phase hypothesis. -- the L4.2 assembly from the remaining positive-degree phase step. -/ -@[expose] public section +public section open Complex Filter Set open scoped InnerProductSpace Interval Real @@ -46,6 +46,7 @@ universe u /-- The sharp boundary invariant for the scalar Crouzeix companion: at every frontier point, the conjugate point value plus the lower-degree phase contour is bounded by the polynomial frontier sup norm. -/ +@[expose] def CrouzeixBoundaryPhaseContractive (Omega : SmoothJordanDomain) (p : Polynomial ℂ) : Prop := ∀ xi ∈ frontier Omega.carrier, diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionPlemelj.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionPlemelj.lean index ddf8c2ba93..65498317d6 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionPlemelj.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionPlemelj.lean @@ -47,7 +47,7 @@ asserted here; those are the remaining analytic inputs. sharp interior reduction in terms of the explicit regularized values. -/ -@[expose] public section +public section open Complex Filter MeasureTheory Set open scoped Interval Real @@ -55,6 +55,7 @@ open scoped Interval Real /-- The normalized scalar Cauchy kernel of the parametrized frontier. For a positively oriented Jordan curve it is `1` in the carrier and `0` outside the closed domain. -/ +@[expose] noncomputable def crouzeixScalarCauchyKernel (Omega : SmoothJordanDomain) (z : ℂ) : ℂ := (2 * (Real.pi : ℂ) * I)⁻¹ * @@ -62,6 +63,7 @@ noncomputable def crouzeixScalarCauchyKernel /-- The scalar companion regularized at `xi` by subtracting the boundary datum at `xi` from its numerator. -/ +@[expose] noncomputable def crouzeixPolynomialScalarCompanionRegularized (Omega : SmoothJordanDomain) (p : Polynomial ℂ) (xi z : ℂ) : ℂ := (2 * (Real.pi : ℂ) * I)⁻¹ * @@ -73,6 +75,7 @@ noncomputable def crouzeixPolynomialScalarCompanionRegularized /-- The explicit prospective interior boundary value: the original datum at `xi` plus the regularized transform evaluated at `xi`. -/ +@[expose] noncomputable def crouzeixPolynomialScalarCompanionBoundaryValue (Omega : SmoothJordanDomain) (p : Polynomial ℂ) (xi : ℂ) : ℂ := star (Polynomial.eval xi p) + diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionPlemeljBound.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionPlemeljBound.lean index 2dc709e650..c7623c8199 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionPlemeljBound.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionPlemeljBound.lean @@ -40,7 +40,7 @@ divided-difference term that a sharp boundary argument must control. quantitative bound for the explicit Plemelj boundary value. -/ -@[expose] public section +public section open Complex Set open scoped Interval Real diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionPlemeljCircle.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionPlemeljCircle.lean index 5545436f9e..581c23f595 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionPlemeljCircle.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionPlemeljCircle.lean @@ -47,7 +47,7 @@ companion exactly. constant polynomial sequence converging to the auxiliary operator. -/ -@[expose] public section +public section open Complex ComplexConjugate Filter Polynomial Set open scoped Interval Real diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionRadial.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionRadial.lean index d102582a0a..68d7252d23 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionRadial.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionRadial.lean @@ -74,7 +74,7 @@ value. -- the sharp phase inequality controls that extension on the closure. -/ -@[expose] public section +public section open Complex Filter MeasureTheory Set open scoped Interval Real diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionRadialAssembly.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionRadialAssembly.lean index d65690bb6e..0ad041bd0c 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionRadialAssembly.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/ScalarCompanionRadialAssembly.lean @@ -23,7 +23,7 @@ The remaining inputs are the genuinely sharp phase contraction, polynomial approximation, and reproduction of the polynomial auxiliary contour. -/ -@[expose] public section +public section open Complex Filter Set open scoped InnerProductSpace Interval Real diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothApprox.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothApprox.lean index 77f9716ce2..80223ee536 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothApprox.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothApprox.lean @@ -31,7 +31,7 @@ convex sets, `Ball.Pointwise` identifies closures of metric thickenings, supplies the smooth regular circle parametrization API. -/ -@[expose] public section +public section open Complex Metric Set open scoped ContDiff @@ -54,6 +54,7 @@ structure SmoothJordanDomain where boundaryParam_regular : ∀ t, deriv boundaryParam t ≠ 0 /-- A positive-radius open disk, with `circleMap` as its smooth Jordan boundary. -/ +@[expose] noncomputable def SmoothJordanDomain.ball (c : ℂ) (R : ℝ) (hR : 0 < R) : SmoothJordanDomain where carrier := Metric.ball c R @@ -82,9 +83,11 @@ theorem exists_smoothJordanDomain_superset_of_isCompact (K : Set ℂ) (hK : IsCo /-- The positive radii `1, 1/2, 1/3, ...` used for the explicit thickening approximation. -/ +@[expose] noncomputable def smoothApproxRadius (n : ℕ) : ℝ := 1 / (n + 1 : ℝ) /-- The `n`th open metric thickening of `K`, at radius `1 / (n + 1)`. -/ +@[expose] noncomputable def convexThickeningApprox (K : Set ℂ) (n : ℕ) : Set ℂ := Metric.thickening (smoothApproxRadius n) K @@ -165,6 +168,7 @@ structure SmoothConvexApproximation (K : Set ℂ) where /-- Closed disks admit a complete smooth convex approximation: enlarge the radius by `1 / (n + 1)` and use the standard circle parametrization at every stage. This is the fully verified model case for the general L4.2b package. -/ +@[expose] noncomputable def smoothClosedBallApproximation (c : ℂ) (R : ℝ) (hR : 0 ≤ R) : SmoothConvexApproximation (Metric.closedBall c R) where domain n := SmoothJordanDomain.ball c (smoothApproxRadius n + R) diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanAffine.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanAffine.lean index d130d1d21a..b188d81b17 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanAffine.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanAffine.lean @@ -23,7 +23,7 @@ Its role is the reusable affine geometry needed by such approximation arguments. -/ -@[expose] public section +public section open Complex Metric Set open scoped ContDiff @@ -41,6 +41,7 @@ theorem deriv_continuousLinearEquiv_comp (Omega : SmoothJordanDomain) t hdiff.hasDerivAt).deriv /-- Transport a smooth Jordan domain by an invertible real-linear map. -/ +@[expose] noncomputable def linearImage (Omega : SmoothJordanDomain) (e : ℂ ≃L[ℝ] ℂ) : SmoothJordanDomain where carrier := e '' Omega.carrier @@ -89,6 +90,7 @@ theorem deriv_const_add_boundaryParam (Omega : SmoothJordanDomain) exact (hdiff.hasDerivAt.const_add c).deriv /-- Translate a smooth Jordan domain by a complex vector. -/ +@[expose] noncomputable def translate (Omega : SmoothJordanDomain) (c : ℂ) : SmoothJordanDomain where carrier := (fun z => c + z) '' Omega.carrier @@ -128,6 +130,7 @@ theorem translate_boundaryParam_deriv (Omega : SmoothJordanDomain) /-- An affine image of a positive-radius disk. In the real plane this is an ellipse, represented with its exact smooth regular boundary parametrization. -/ +@[expose] noncomputable def ellipse (c : ℂ) (e : ℂ ≃L[ℝ] ℂ) (R : ℝ) (hR : 0 < R) : SmoothJordanDomain := ((SmoothJordanDomain.ball 0 R hR).linearImage e).translate c diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanCauchy.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanCauchy.lean index f044f5808c..23b0910b63 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanCauchy.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanCauchy.lean @@ -24,7 +24,7 @@ strict inward homothetic copies of the boundary. Compact-uniform convergence of their integrands then transports the zero value to the original contour. -/ -@[expose] public section +public section open Complex Filter MeasureTheory Set open scoped Interval Topology diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanCauchyFormula.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanCauchyFormula.lean index b2c5cee3c5..c28bfdd0ba 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanCauchyFormula.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanCauchyFormula.lean @@ -20,7 +20,7 @@ one. Oriented and canonical-orientation corollaries expose the forms needed by polynomial approximation on smooth convex domains. -/ -@[expose] public section +public section open Complex Filter MeasureTheory Set open scoped Interval Topology diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanCompact.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanCompact.lean index 9c639cbe0d..f29c2913d9 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanCompact.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanCompact.lean @@ -19,7 +19,7 @@ the scalar Cauchy transform then tends to zero at infinity, ruling out an unbounded carrier. -/ -@[expose] public section +public section open Complex Metric Set diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanExhaustion.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanExhaustion.lean index 9e53d2978d..0db419c877 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanExhaustion.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanExhaustion.lean @@ -23,7 +23,7 @@ derives contour mass and winding from oriented numerical-range support, and packages scalar-companion approximation into the sharp exhaustion limit. -/ -@[expose] public section +public section open Complex Filter MeasureTheory Set open scoped InnerProductSpace Interval Real @@ -231,7 +231,7 @@ theorem StrictNestedSmoothJordanExhaustion.diffContOnCl_canonicalScalarCompanion stage: every function continuous on the closure and complex differentiable in the carrier is a compact-uniform limit of complex polynomials. This is the Mergelyan conclusion specialized to the represented domain. -/ -def SmoothJordanDomain.HasMergelyanPolynomialApproximation +@[expose] def SmoothJordanDomain.HasMergelyanPolynomialApproximation (Omega : SmoothJordanDomain) : Prop := ∀ f : ℂ → ℂ, DiffContOnCl ℂ f Omega.carrier → ∃ q : ℕ → Polynomial ℂ, diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanInflation.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanInflation.lean index 2e8b15ad6c..a193ab9f57 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanInflation.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanInflation.lean @@ -20,7 +20,7 @@ Hausdorff displacement. Thus closed smooth Jordan carriers themselves have the local outer-approximation property used by the terminal exhaustion. -/ -@[expose] public section +public section open Complex Metric Set diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanMergelyan.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanMergelyan.lean index c95303afca..e2957b6fde 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanMergelyan.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanMergelyan.lean @@ -22,7 +22,7 @@ closed carrier. `ConvexRungeIntegral` approximates each radialized function, and a diagonal selection removes the radial contraction. -/ -@[expose] public section +public section open Complex Filter Metric Set open scoped Interval Real Topology diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanMergelyanAssembly.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanMergelyanAssembly.lean index 2e6cee56eb..f212e24d74 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanMergelyanAssembly.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanMergelyanAssembly.lean @@ -18,7 +18,7 @@ smooth Jordan exhaustion, or realize the explicit convex thickenings by such domains. -/ -@[expose] public section +public section open Complex Set open scoped InnerProductSpace diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanOuterApproximation.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanOuterApproximation.lean index fbdf91ea5e..81294b197c 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanOuterApproximation.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanOuterApproximation.lean @@ -24,14 +24,14 @@ bounded by `1/(n+1)`. The first bound gives strict nesting; the second makes the intersection exactly `K`. -/ -@[expose] public section +public section open Complex Metric Set open scoped InnerProductSpace /-- A planar set admits smooth Jordan outer approximations at every positive metric scale. -/ -def HasSmoothJordanOuterApproximation (K : Set ℂ) : Prop := +@[expose] def HasSmoothJordanOuterApproximation (K : Set ℂ) : Prop := ∀ ε : ℝ, 0 < ε → ∃ Omega : SmoothJordanDomain, K ⊆ Omega.carrier ∧ closure Omega.carrier ⊆ Metric.thickening ε K diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanOuterApproximationReduction.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanOuterApproximationReduction.lean index 87fce30643..fdb5628bf7 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanOuterApproximationReduction.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanOuterApproximationReduction.lean @@ -18,7 +18,7 @@ This thickening is still compact and convex, has nonempty interior, and a second half-scale thickening fits inside the requested original scale. -/ -@[expose] public section +public section open Complex Metric Set open scoped InnerProductSpace diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanPolytopeReduction.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanPolytopeReduction.lean index 281ec67e73..5b35bd756d 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanPolytopeReduction.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanPolytopeReduction.lean @@ -23,7 +23,7 @@ requested scale. Consequently the same finite-convex-hull hypothesis reaches the exact Crouzeix--Palencia operator bound. -/ -@[expose] public section +public section open Complex Metric Set open scoped InnerProductSpace @@ -31,7 +31,7 @@ open scoped InnerProductSpace /-- Smooth Jordan outer approximation holds for every full-dimensional convex polytope in the complex plane, where a polytope is presented as the convex hull of a finite set of points. -/ -def HasSmoothJordanOuterApproximationForPolytopes : Prop := +@[expose] def HasSmoothJordanOuterApproximationForPolytopes : Prop := ∀ u : Finset ℂ, (interior (convexHull ℝ (u : Set ℂ))).Nonempty → HasSmoothJordanOuterApproximation (convexHull ℝ (u : Set ℂ)) diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanSimilarity.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanSimilarity.lean index 1c371ad0af..1656fc2984 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanSimilarity.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanSimilarity.lean @@ -23,14 +23,14 @@ disk. An interior point supplies a small disk, and a homothety expands it to unit radius. -/ -@[expose] public section +public section open Complex Metric Set open scoped InnerProductSpace /-- Multiplication by a nonzero complex number, regarded as an invertible real-linear map of the complex plane. -/ -noncomputable def complexMulRealEquiv (a : ℂ) (ha : a ≠ 0) : +@[expose] noncomputable def complexMulRealEquiv (a : ℂ) (ha : a ≠ 0) : ℂ ≃L[ℝ] ℂ := ContinuousLinearEquiv.smulLeft (R₁ := ℝ) (M₁ := ℂ) (Units.mk0 a ha) diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanSupport.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanSupport.lean index aa02464a20..bedacc7fa8 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanSupport.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothJordanSupport.lean @@ -46,7 +46,7 @@ therefore fixes the normal sign on the full frontier. trace and its reversal that has the supporting-normal sign. -/ -@[expose] public section +public section open Complex Set open scoped Real @@ -269,6 +269,7 @@ theorem SmoothJordanDomain.frontier_support_of_support_at_mem_carrier /-- Reverse the orientation of a smooth Jordan boundary by the affine reparametrization `t ↦ 2π - t`. The carrier and all of its geometric properties are unchanged. -/ +@[expose] noncomputable def SmoothJordanDomain.reverseOrientation (Omega : SmoothJordanDomain) : SmoothJordanDomain where carrier := Omega.carrier diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothSupportCurve.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothSupportCurve.lean index d186244552..fffdae7bff 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothSupportCurve.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothSupportCurve.lean @@ -24,26 +24,30 @@ the later global argument identifying the curve with the frontier of its support envelope. -/ -@[expose] public section +public section open Complex Set open scoped ContDiff /-- Unit outward normal at angle `theta`. -/ +@[expose] noncomputable def smoothSupportUnitNormal (theta : ℝ) : ℂ := circleMap 0 1 theta /-- Positively oriented unit tangent at angle `theta`. -/ +@[expose] noncomputable def smoothSupportUnitTangent (theta : ℝ) : ℂ := smoothSupportUnitNormal theta * I /-- The planar curve represented by a differentiable support function. -/ +@[expose] noncomputable def smoothSupportCurve (h : ℝ → ℝ) (theta : ℝ) : ℂ := h theta • smoothSupportUnitNormal theta + deriv h theta • smoothSupportUnitTangent theta /-- The radius of curvature associated with a twice differentiable support function. -/ +@[expose] noncomputable def smoothSupportCurvatureRadius (h : ℝ → ℝ) (theta : ℝ) : ℝ := h theta + deriv (deriv h) theta @@ -209,6 +213,7 @@ theorem polytopeDirectionalValue_smoothSupportCurve_self /-- The support curve associated with the strictly rounded log-sum-exp support of a finite polytope. -/ +@[expose] noncomputable def polytopeRoundedSupportCurve (u : Finset ℂ) (delta rho : ℝ) : ℝ → ℂ := smoothSupportCurve (polytopeRoundedSupport u delta rho) diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothSupportCurveGlobal.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothSupportCurveGlobal.lean index 4237b5e93d..5842f315cd 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothSupportCurveGlobal.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothSupportCurveGlobal.lean @@ -20,7 +20,7 @@ uniqueness of the supporting contact, and injectivity on every fundamental period. -/ -@[expose] public section +public section open Complex Metric Set open scoped ContDiff diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothSupportCurveRange.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothSupportCurveRange.lean index 0ff718d9bb..044d2e1da2 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothSupportCurveRange.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothSupportCurveRange.lean @@ -17,7 +17,7 @@ the support curve. The key local fact is that an active support inequality recovers both normal and tangent coordinates of the contact point. -/ -@[expose] public section +public section open Complex Metric Set open scoped ContDiff diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothSupportDomain.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothSupportDomain.lean index 09ef40b230..719993ed06 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothSupportDomain.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothSupportDomain.lean @@ -19,14 +19,14 @@ approximation problem, culminating in the exact polynomial Crouzeix--Palencia theorem. -/ -@[expose] public section +public section open Complex Metric Set open scoped ContDiff InnerProductSpace /-- Package a rounded support envelope as a smooth Jordan domain once its support curve has been identified with the envelope frontier. -/ -noncomputable def polytopeRoundedSupportDomainOfRange +@[expose] noncomputable def polytopeRoundedSupportDomainOfRange {u : Finset ℂ} (hu : u.Nonempty) {delta rho : ℝ} (hdelta : 0 < delta) (hrho : 0 < rho) (hrange : Set.range (polytopeRoundedSupportCurve u delta rho) = @@ -105,7 +105,7 @@ theorem hasSmoothJordanOuterApproximationForPolytopes_of_supportCurve_range /-- The smooth Jordan domain canonically associated with a nonempty rounded finite support function. -/ -noncomputable def polytopeRoundedSupportDomain +@[expose] noncomputable def polytopeRoundedSupportDomain {u : Finset ℂ} (hu : u.Nonempty) {delta rho : ℝ} (hdelta : 0 < delta) (hrho : 0 < rho) : SmoothJordanDomain := diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothSupportEnvelope.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothSupportEnvelope.lean index b3e21aece0..57f9c953ed 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothSupportEnvelope.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothSupportEnvelope.lean @@ -19,7 +19,7 @@ the original convex hull lies in that interior with the explicit rounding margin. -/ -@[expose] public section +public section open Complex Metric Set open scoped ComplexConjugate @@ -41,10 +41,11 @@ noncomputable def smoothSupportDirectionalLinearMap (theta : ℝ) : ring /-- Closed convex envelope cut out by all directional support halfspaces. -/ -def smoothSupportClosedEnvelope (h : ℝ → ℝ) : Set ℂ := +@[expose] def smoothSupportClosedEnvelope (h : ℝ → ℝ) : Set ℂ := {z | ∀ theta, polytopeDirectionalValue z theta ≤ h theta} /-- Open carrier associated with a support function. -/ +@[expose] def smoothSupportOpenEnvelope (h : ℝ → ℝ) : Set ℂ := interior (smoothSupportClosedEnvelope h) diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothSupportEnvelopeApproximation.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothSupportEnvelopeApproximation.lean index 9478994c91..f487deca38 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothSupportEnvelopeApproximation.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothSupportEnvelopeApproximation.lean @@ -20,7 +20,7 @@ proof uses the nearest-point characterization for closed convex sets and the direction of the displacement from a nearest point. -/ -@[expose] public section +public section open Complex Metric Set open scoped InnerProductSpace diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothSupportEnvelopeTight.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothSupportEnvelopeTight.lean index 80497675da..c3665f5f1e 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothSupportEnvelopeTight.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothSupportEnvelopeTight.lean @@ -18,7 +18,7 @@ record an explicit choice that remains valid even for one-point finite sets, where the logarithmic cardinality term vanishes. -/ -@[expose] public section +public section open Complex Metric Set open scoped ContDiff diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothSupportExhaustion.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothSupportExhaustion.lean index 933b9f07b6..1ecab74f92 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothSupportExhaustion.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/SmoothSupportExhaustion.lean @@ -19,7 +19,7 @@ resulting strict nested exhaustion, including the canonical specialization to the closed numerical range of an operator. -/ -@[expose] public section +public section open Complex Metric Set open scoped InnerProductSpace diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/SpectralAuxiliary.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/SpectralAuxiliary.lean index eb00544526..3e7eb01d26 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/SpectralAuxiliary.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/SpectralAuxiliary.lean @@ -29,7 +29,7 @@ boundary transform rather than a disk von Neumann inequality. scalar form of the symmetrized estimate when the circle encloses the numerical range. -/ -@[expose] public section +public section open Complex ComplexConjugate Polynomial Set spectrum open scoped InnerProductSpace Interval Real diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/SpectralAuxiliaryCenter.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/SpectralAuxiliaryCenter.lean index 31ebd3dc42..b5761ed2f4 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/SpectralAuxiliaryCenter.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/SpectralAuxiliaryCenter.lean @@ -36,7 +36,7 @@ of the numerical range lies in the open disk `ball c r`. through the open disks `ball c (r + 1/(n+1))` (`ApproximationSupNorm.lean`). -/ -@[expose] public section +public section open Complex Polynomial spectrum Filter Topology open scoped InnerProductSpace Pointwise diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/SpectralCauchy.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/SpectralCauchy.lean index f2dc4f4b9e..314d917bef 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/SpectralCauchy.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/SpectralCauchy.lean @@ -53,7 +53,7 @@ The product side of the Crouzeix–Palencia argument is *not* upgraded here: the of `CircleProduct.lean` uses von Neumann's inequality, which needs `‖A‖ ≤ r`. -/ -@[expose] public section +public section open Complex Polynomial spectrum open scoped InnerProductSpace diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/SpectralSetMonotone.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/SpectralSetMonotone.lean index c0a7d2244d..513d186a27 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/SpectralSetMonotone.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/SpectralSetMonotone.lean @@ -16,7 +16,7 @@ Polynomial spectral-set estimates persist when the constant is increased or when a compact control set is enlarged. -/ -@[expose] public section +public section open Set open scoped InnerProductSpace Polynomial diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/SpectralSetSuperset.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/SpectralSetSuperset.lean index 017ce89d1e..95c56ea356 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/SpectralSetSuperset.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/SpectralSetSuperset.lean @@ -18,7 +18,7 @@ improvement, persist on every compact set containing the closed numerical range. -/ -@[expose] public section +public section open Set open scoped InnerProductSpace diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/SymmetrizedAuxiliary.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/SymmetrizedAuxiliary.lean index 97f4641563..ba80e3dcab 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/SymmetrizedAuxiliary.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/SymmetrizedAuxiliary.lean @@ -25,7 +25,7 @@ supply it without changing the algebraic interface. integral of the resolvent double-layer kernel. -/ -@[expose] public section +public section open Complex MeasureTheory Set open scoped InnerProductSpace Interval Real diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/SymmetrizedBound.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/SymmetrizedBound.lean index b5d895aa85..ebe9c28022 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/SymmetrizedBound.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/SymmetrizedBound.lean @@ -30,7 +30,7 @@ itself. representation. -/ -@[expose] public section +public section open MeasureTheory open scoped InnerProductSpace Interval Real diff --git a/LeanPool/OperatorTheory/Operator/Crouzeix/VonNeumann.lean b/LeanPool/OperatorTheory/Operator/Crouzeix/VonNeumann.lean index 602f14fb48..32fda0bfb4 100644 --- a/LeanPool/OperatorTheory/Operator/Crouzeix/VonNeumann.lean +++ b/LeanPool/OperatorTheory/Operator/Crouzeix/VonNeumann.lean @@ -45,7 +45,7 @@ an inner-product-preserving `V : E →L[ℂ] H` and a unitary `U` on `H` with Requires `[CompleteSpace E]` (adjoints, the C*-algebra structure on `E →L[ℂ] E`). -/ -@[expose] public section +public section open Polynomial ContinuousLinearMap open scoped InnerProductSpace diff --git a/LeanPool/OperatorTheory/Operator/Dilation/Halmos.lean b/LeanPool/OperatorTheory/Operator/Dilation/Halmos.lean index 95eb34ef33..0026a1392f 100644 --- a/LeanPool/OperatorTheory/Operator/Dilation/Halmos.lean +++ b/LeanPool/OperatorTheory/Operator/Dilation/Halmos.lean @@ -19,7 +19,7 @@ two-by-two argument through continuous functional calculus: the off-diagonal sel contraction `(x, y) ↦ (T y, T† x)` gives a unitary after adjoining its defect square root. -/ -@[expose] public section +public section open ContinuousLinearMap open scoped InnerProductSpace diff --git a/LeanPool/OperatorTheory/Operator/Dilation/Schaeffer.lean b/LeanPool/OperatorTheory/Operator/Dilation/Schaeffer.lean index babf440184..d30ec54321 100644 --- a/LeanPool/OperatorTheory/Operator/Dilation/Schaeffer.lean +++ b/LeanPool/OperatorTheory/Operator/Dilation/Schaeffer.lean @@ -23,7 +23,7 @@ The negative sites stay zero, so the system component at site zero evolves as the resulting power-compression identity. -/ -@[expose] public section +public section open scoped ENNReal InnerProductSpace @@ -39,6 +39,7 @@ abbrev SchaefferSpace (E : Type u) [NormedAddCommGroup E] := lp (fun _ : ℤ => E) 2 /-- Embed `E` isometrically as coordinate zero of its bilateral Hilbert sum. -/ +@[expose] noncomputable def schaefferEmbedding : E →L[ℂ] SchaefferSpace E := lp.singleContinuousLinearMap ℂ (fun _ : ℤ => E) 2 0 @@ -61,6 +62,7 @@ theorem adjoint_schaefferEmbedding_apply (f : SchaefferSpace E) : simp only [schaefferEmbedding_apply, lp.inner_single_right] /-- Reindex a square-summable family along an equivalence. -/ +@[expose] noncomputable def lpReindexForward {ι ι' : Type*} (e : ι ≃ ι') (f : lp (fun _ : ι => E) 2) : lp (fun _ : ι' => E) 2 := ⟨fun j => f (e.symm j), by @@ -93,6 +95,7 @@ private theorem norm_lpReindexForward {ι ι' : Type*} (e : ι ≃ ι') (by norm_num : 0 < (2 : ℝ≥0∞).toReal) f /-- Reindexing a square-summable family along an equivalence is a linear isometry equivalence. -/ +@[expose] noncomputable def lpReindex {ι ι' : Type*} (e : ι ≃ ι') : lp (fun _ : ι => E) 2 ≃ₗᵢ[ℂ] lp (fun _ : ι' => E) 2 where toFun := lpReindexForward e @@ -114,6 +117,7 @@ noncomputable def lpReindex {ι ι' : Type*} (e : ι ≃ ι') : norm_map' := by exact norm_lpReindexForward e /-- The right bilateral shift, as a linear isometry equivalence of the dilation space. -/ +@[expose] noncomputable def schaefferBilateralShiftEquiv : SchaefferSpace E ≃ₗᵢ[ℂ] SchaefferSpace E := lpReindex (Equiv.addRight (1 : ℤ)) @@ -153,6 +157,7 @@ abbrev SchaefferNetworkSpace (E : Type u) [NormedAddCommGroup E] := lp (fun _ : ℤ => SchaefferNetworkFiber E) 2 /-- Insert the system space into the system component of one network site. -/ +@[expose] noncomputable def schaefferFiberEmbedding : E →L[ℂ] SchaefferNetworkFiber E := (WithLp.prodContinuousLinearEquiv 2 ℂ E E).symm.toContinuousLinearMap.comp @@ -164,6 +169,7 @@ private theorem schaefferFiberEmbedding_apply (x : E) : schaefferFiberEmbedding x = WithLp.toLp 2 (x, 0) := rfl /-- Embed the original space at the system component of site zero. -/ +@[expose] noncomputable def schaefferNetworkEmbedding : E →L[ℂ] SchaefferNetworkSpace E := (lp.singleContinuousLinearMap ℂ (fun _ : ℤ => SchaefferNetworkFiber E) 2 0).comp diff --git a/LeanPool/OperatorTheory/Operator/NumericalRange/Adjoint.lean b/LeanPool/OperatorTheory/Operator/NumericalRange/Adjoint.lean index 8273940c92..24c540cb61 100644 --- a/LeanPool/OperatorTheory/Operator/NumericalRange/Adjoint.lean +++ b/LeanPool/OperatorTheory/Operator/NumericalRange/Adjoint.lean @@ -21,7 +21,7 @@ range. * `numericalRange_adjoint` — `W(A†) = conj '' W(A)`. -/ -@[expose] public section +public section open scoped InnerProductSpace open ContinuousLinearMap diff --git a/LeanPool/OperatorTheory/Operator/NumericalRange/Affine.lean b/LeanPool/OperatorTheory/Operator/NumericalRange/Affine.lean index 0b9aff781b..d4543497a9 100644 --- a/LeanPool/OperatorTheory/Operator/NumericalRange/Affine.lean +++ b/LeanPool/OperatorTheory/Operator/NumericalRange/Affine.lean @@ -18,7 +18,7 @@ multiplication, translation by a scalar operator, and the centered-rescaled operators used in disk normalization arguments. -/ -@[expose] public section +public section open Set open scoped InnerProductSpace diff --git a/LeanPool/OperatorTheory/Operator/NumericalRange/AffineClosure.lean b/LeanPool/OperatorTheory/Operator/NumericalRange/AffineClosure.lean index 8b321c2b96..859cc8c539 100644 --- a/LeanPool/OperatorTheory/Operator/NumericalRange/AffineClosure.lean +++ b/LeanPool/OperatorTheory/Operator/NumericalRange/AffineClosure.lean @@ -18,7 +18,7 @@ The raw numerical-range covariance extends to the standard affine form also commutes exactly with closure. -/ -@[expose] public section +public section open Set open scoped InnerProductSpace diff --git a/LeanPool/OperatorTheory/Operator/NumericalRange/Basic.lean b/LeanPool/OperatorTheory/Operator/NumericalRange/Basic.lean index 4467b9de50..ee3fbcdf78 100644 --- a/LeanPool/OperatorTheory/Operator/NumericalRange/Basic.lean +++ b/LeanPool/OperatorTheory/Operator/NumericalRange/Basic.lean @@ -28,7 +28,7 @@ while `σ(A) = {i}`, breaking the spectrum inclusion that later layers need. No completeness assumption on `E` is needed. -/ -@[expose] public section +public section open scoped InnerProductSpace @@ -36,6 +36,7 @@ variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] /-- The numerical range of a continuous linear operator `A` on a complex inner product space: the set of `⟪x, A x⟫_ℂ` as `x` ranges over the unit sphere. -/ +@[expose] noncomputable def numericalRange (A : E →L[ℂ] E) : Set ℂ := { z | ∃ x : E, ‖x‖ = 1 ∧ ⟪x, A x⟫_ℂ = z } diff --git a/LeanPool/OperatorTheory/Operator/NumericalRange/Bounded.lean b/LeanPool/OperatorTheory/Operator/NumericalRange/Bounded.lean index af525dc488..1a8ed02cd4 100644 --- a/LeanPool/OperatorTheory/Operator/NumericalRange/Bounded.lean +++ b/LeanPool/OperatorTheory/Operator/NumericalRange/Bounded.lean @@ -28,7 +28,7 @@ No completeness assumption on `E` is needed. (Recreated in run-003; the original recovered after the accidental deletion.) -/ -@[expose] public section +public section open scoped InnerProductSpace @@ -59,6 +59,7 @@ theorem isBounded_numericalRange (A : E →L[ℂ] E) : /-- The numerical radius is the supremum of the moduli of points in the numerical range. This definition also gives zero on an empty numerical range, as happens on a subsingleton space. -/ +@[expose] noncomputable def numericalRadius (A : E →L[ℂ] E) : ℝ := ⨆ z ∈ numericalRange A, ‖z‖ diff --git a/LeanPool/OperatorTheory/Operator/NumericalRange/Compact.lean b/LeanPool/OperatorTheory/Operator/NumericalRange/Compact.lean index 60c0c85cbd..d00fd9cd54 100644 --- a/LeanPool/OperatorTheory/Operator/NumericalRange/Compact.lean +++ b/LeanPool/OperatorTheory/Operator/NumericalRange/Compact.lean @@ -26,7 +26,7 @@ disk), which is why `spectrum_subset_closure_numericalRange` carries a closure; `spectrum_subset_numericalRange` for the finite-dimensional statement without it. -/ -@[expose] public section +public section open scoped InnerProductSpace diff --git a/LeanPool/OperatorTheory/Operator/NumericalRange/Compression.lean b/LeanPool/OperatorTheory/Operator/NumericalRange/Compression.lean index bf01ffcf3b..92e28757a4 100644 --- a/LeanPool/OperatorTheory/Operator/NumericalRange/Compression.lean +++ b/LeanPool/OperatorTheory/Operator/NumericalRange/Compression.lean @@ -18,7 +18,7 @@ contained in that of `A`. Numerical radius is therefore monotone under isometric compression. -/ -@[expose] public section +public section open ContinuousLinearMap open scoped InnerProductSpace InnerProduct diff --git a/LeanPool/OperatorTheory/Operator/NumericalRange/Convex.lean b/LeanPool/OperatorTheory/Operator/NumericalRange/Convex.lean index 98504b1120..3a05171e5c 100644 --- a/LeanPool/OperatorTheory/Operator/NumericalRange/Convex.lean +++ b/LeanPool/OperatorTheory/Operator/NumericalRange/Convex.lean @@ -18,7 +18,7 @@ This file proves the Toeplitz--Hausdorff theorem: the numerical range of a bounded linear operator on a complex inner product space is convex over `ℝ`. -/ -@[expose] public section +public section open scoped InnerProductSpace diff --git a/LeanPool/OperatorTheory/Operator/NumericalRange/Helpers.lean b/LeanPool/OperatorTheory/Operator/NumericalRange/Helpers.lean index ee960320a5..45399c4d31 100644 --- a/LeanPool/OperatorTheory/Operator/NumericalRange/Helpers.lean +++ b/LeanPool/OperatorTheory/Operator/NumericalRange/Helpers.lean @@ -15,7 +15,7 @@ These lemmas reconstruct identities lost during the accidental deletion. They support the recovered convexity and spectrum-inclusion proofs. -/ -@[expose] public section +public section open scoped InnerProductSpace diff --git a/LeanPool/OperatorTheory/Operator/NumericalRange/Nonempty.lean b/LeanPool/OperatorTheory/Operator/NumericalRange/Nonempty.lean index af4cb2318d..6090a452ce 100644 --- a/LeanPool/OperatorTheory/Operator/NumericalRange/Nonempty.lean +++ b/LeanPool/OperatorTheory/Operator/NumericalRange/Nonempty.lean @@ -17,7 +17,7 @@ space is nontrivial. Thus the only empty numerical ranges are those on a subsingleton space. -/ -@[expose] public section +public section open scoped InnerProductSpace diff --git a/LeanPool/OperatorTheory/Operator/NumericalRange/Radius.lean b/LeanPool/OperatorTheory/Operator/NumericalRange/Radius.lean index 513ac23c7a..964f20a014 100644 --- a/LeanPool/OperatorTheory/Operator/NumericalRange/Radius.lean +++ b/LeanPool/OperatorTheory/Operator/NumericalRange/Radius.lean @@ -29,7 +29,7 @@ the complex polarization identity to the quadratic form `x ↦ ⟪x, A x⟫_ℂ`. -/ -@[expose] public section +public section open Complex open scoped InnerProductSpace @@ -281,6 +281,7 @@ theorem numericalRadius_sub_le (A B : E →L[ℂ] E) : /-- The numerical radius bundled as a complex seminorm on bounded operators. Definiteness is supplied separately by `numericalRadius_eq_zero_iff`. -/ +@[expose] noncomputable def numericalRadiusSeminorm : Seminorm ℂ (E →L[ℂ] E) := Seminorm.of numericalRadius numericalRadius_add_le numericalRadius_smul diff --git a/LeanPool/OperatorTheory/Operator/NumericalRange/RadiusAdjoint.lean b/LeanPool/OperatorTheory/Operator/NumericalRange/RadiusAdjoint.lean index 99edff1bea..989b8643be 100644 --- a/LeanPool/OperatorTheory/Operator/NumericalRange/RadiusAdjoint.lean +++ b/LeanPool/OperatorTheory/Operator/NumericalRange/RadiusAdjoint.lean @@ -17,7 +17,7 @@ radius is unchanged. Likewise, unitary changes of orthonormal coordinates preserve the entire numerical range and hence the numerical radius. -/ -@[expose] public section +public section open Complex open ContinuousLinearMap diff --git a/LeanPool/OperatorTheory/Operator/NumericalRange/RadiusAffine.lean b/LeanPool/OperatorTheory/Operator/NumericalRange/RadiusAffine.lean index 3f890697da..bff1b6a884 100644 --- a/LeanPool/OperatorTheory/Operator/NumericalRange/RadiusAffine.lean +++ b/LeanPool/OperatorTheory/Operator/NumericalRange/RadiusAffine.lean @@ -22,7 +22,7 @@ by at most the modulus of the scalar, and centered numerical radii are Lipschitz in the center. -/ -@[expose] public section +public section open Filter open ContinuousLinearMap diff --git a/LeanPool/OperatorTheory/Operator/NumericalRange/RadiusAlgebra.lean b/LeanPool/OperatorTheory/Operator/NumericalRange/RadiusAlgebra.lean index dc53ead712..671d274e99 100644 --- a/LeanPool/OperatorTheory/Operator/NumericalRange/RadiusAlgebra.lean +++ b/LeanPool/OperatorTheory/Operator/NumericalRange/RadiusAlgebra.lean @@ -18,7 +18,7 @@ those estimates and their immediate commutator and anticommutator consequences. -/ -@[expose] public section +public section open scoped InnerProductSpace diff --git a/LeanPool/OperatorTheory/Operator/NumericalRange/RadiusCartesian.lean b/LeanPool/OperatorTheory/Operator/NumericalRange/RadiusCartesian.lean index fd8cb62e05..b220150295 100644 --- a/LeanPool/OperatorTheory/Operator/NumericalRange/RadiusCartesian.lean +++ b/LeanPool/OperatorTheory/Operator/NumericalRange/RadiusCartesian.lean @@ -16,7 +16,7 @@ The selfadjoint and skew-adjoint numerators of an operator are each bounded in norm by twice its numerical radius. -/ -@[expose] public section +public section open Complex ContinuousLinearMap open scoped InnerProductSpace InnerProduct diff --git a/LeanPool/OperatorTheory/Operator/NumericalRange/RadiusCharacterization.lean b/LeanPool/OperatorTheory/Operator/NumericalRange/RadiusCharacterization.lean index a7b577fe5e..a70743ed0e 100644 --- a/LeanPool/OperatorTheory/Operator/NumericalRange/RadiusCharacterization.lean +++ b/LeanPool/OperatorTheory/Operator/NumericalRange/RadiusCharacterization.lean @@ -15,7 +15,7 @@ The inequality `w(A) ≤ r` is equivalent to containment of the numerical range, or its closure, in the closed disk of radius `r` about zero. -/ -@[expose] public section +public section open Set open scoped InnerProductSpace diff --git a/LeanPool/OperatorTheory/Operator/NumericalRange/RadiusFiniteDimensional.lean b/LeanPool/OperatorTheory/Operator/NumericalRange/RadiusFiniteDimensional.lean index 850470eb60..5a525c758a 100644 --- a/LeanPool/OperatorTheory/Operator/NumericalRange/RadiusFiniteDimensional.lean +++ b/LeanPool/OperatorTheory/Operator/NumericalRange/RadiusFiniteDimensional.lean @@ -16,7 +16,7 @@ In a nontrivial finite-dimensional Hilbert space the numerical range is a nonempty compact set, so its norm achieves the numerical radius. -/ -@[expose] public section +public section open scoped InnerProductSpace diff --git a/LeanPool/OperatorTheory/Operator/NumericalRange/RadiusNormal.lean b/LeanPool/OperatorTheory/Operator/NumericalRange/RadiusNormal.lean index c9052436b9..c6ae31b7b0 100644 --- a/LeanPool/OperatorTheory/Operator/NumericalRange/RadiusNormal.lean +++ b/LeanPool/OperatorTheory/Operator/NumericalRange/RadiusNormal.lean @@ -18,7 +18,7 @@ Since the spectrum lies in the closed numerical-range disk, the numerical radius therefore equals the operator norm. -/ -@[expose] public section +public section open scoped InnerProductSpace diff --git a/LeanPool/OperatorTheory/Operator/NumericalRange/RadiusSpectrum.lean b/LeanPool/OperatorTheory/Operator/NumericalRange/RadiusSpectrum.lean index 1ef1ad626b..582d74b6a4 100644 --- a/LeanPool/OperatorTheory/Operator/NumericalRange/RadiusSpectrum.lean +++ b/LeanPool/OperatorTheory/Operator/NumericalRange/RadiusSpectrum.lean @@ -19,7 +19,7 @@ Equivalently, every spectral value has modulus at most the numerical radius, and the spectral radius is bounded by the numerical radius. -/ -@[expose] public section +public section open Set open scoped ENNReal InnerProductSpace NNReal diff --git a/LeanPool/OperatorTheory/Operator/NumericalRange/Stability.lean b/LeanPool/OperatorTheory/Operator/NumericalRange/Stability.lean index 0f4d302506..fa9727652c 100644 --- a/LeanPool/OperatorTheory/Operator/NumericalRange/Stability.lean +++ b/LeanPool/OperatorTheory/Operator/NumericalRange/Stability.lean @@ -16,7 +16,7 @@ numerical ranges mutually approximate one another to within the operator-norm distance. -/ -@[expose] public section +public section open scoped InnerProductSpace diff --git a/LeanPool/OperatorTheory/Operator/SpectralSet/Basic.lean b/LeanPool/OperatorTheory/Operator/SpectralSet/Basic.lean index 877da19870..f4553e6962 100644 --- a/LeanPool/OperatorTheory/Operator/SpectralSet/Basic.lean +++ b/LeanPool/OperatorTheory/Operator/SpectralSet/Basic.lean @@ -17,22 +17,25 @@ Defines `polynomialSupNorm`, `IsKPolynomialSpectralSet`, and `IsPolynomialSpectr These are *polynomial* spectral sets (norm bound on `Polynomial.aeval`). -/ -@[expose] public section +public section open scoped Polynomial variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] /-- The supremum of the norm of a polynomial over a complex set. -/ +@[expose] noncomputable def polynomialSupNorm (p : Polynomial ℂ) (X : Set ℂ) : ℝ := ⨆ z ∈ X, ‖Polynomial.eval z p‖ /-- Spectrum containment and a polynomial-calculus bound with constant `K`. -/ +@[expose] def IsKPolynomialSpectralSet (A : E →L[ℂ] E) (K : ℝ) (X : Set ℂ) : Prop := spectrum ℂ (A : E →L[ℂ] E) ⊆ X ∧ ∀ p : Polynomial ℂ, ‖Polynomial.aeval A p‖ ≤ K * polynomialSupNorm p X /-- A polynomial spectral set with multiplicative constant one. -/ +@[expose] def IsPolynomialSpectralSet (A : E →L[ℂ] E) (X : Set ℂ) : Prop := IsKPolynomialSpectralSet A 1 X diff --git a/LeanPool/OperatorTheory/Operator/SpectralSet/Normal.lean b/LeanPool/OperatorTheory/Operator/SpectralSet/Normal.lean index 46f8ae796f..02fa1208d6 100644 --- a/LeanPool/OperatorTheory/Operator/SpectralSet/Normal.lean +++ b/LeanPool/OperatorTheory/Operator/SpectralSet/Normal.lean @@ -26,7 +26,7 @@ Consumers: unitaries with `K` the closed unit disk (`Crouzeix/VonNeumann.lean`), operators on a Hilbert space with `K = closure W(A)` (`Crouzeix/Palencia.lean`). -/ -@[expose] public section +public section open Polynomial diff --git a/LeanPool/OperatorTheory/Operator/SpectralSet/SpectrumInNR.lean b/LeanPool/OperatorTheory/Operator/SpectralSet/SpectrumInNR.lean index 5ebea92a62..5648695bc1 100644 --- a/LeanPool/OperatorTheory/Operator/SpectralSet/SpectrumInNR.lean +++ b/LeanPool/OperatorTheory/Operator/SpectralSet/SpectrumInNR.lean @@ -37,7 +37,7 @@ production, with one rewrite direction fixed, by agent-alpha-2. Requires `[CompleteSpace E]` (adjoints and the spectrum of `E →L[ℂ] E`). -/ -@[expose] public section +public section open scoped InnerProductSpace open ContinuousLinearMap diff --git a/LeanPool/OrderClosures/BanLat/Basic.lean b/LeanPool/OrderClosures/BanLat/Basic.lean index e82304c235..611842fc5c 100644 --- a/LeanPool/OrderClosures/BanLat/Basic.lean +++ b/LeanPool/OrderClosures/BanLat/Basic.lean @@ -31,7 +31,7 @@ real scalar multiplication (`VectorLattice`) and proves that positive scalars di `⊔` and `⊓`, culminating in `abs_smul'`. The Archimedean case is treated at the end. -/ -@[expose] public section +public section /-- A real vector lattice is a real module whose scalar multiplication is monotone for non-negative scalars and is compatible with the lattice-ordered additive structure. -/ diff --git a/LeanPool/OrderClosures/BanLat/Convergences/Order.lean b/LeanPool/OrderClosures/BanLat/Convergences/Order.lean index 517ec59474..b92bb86711 100644 --- a/LeanPool/OrderClosures/BanLat/Convergences/Order.lean +++ b/LeanPool/OrderClosures/BanLat/Convergences/Order.lean @@ -17,7 +17,7 @@ separate directed regulator net decreasing to zero, so the regulator need not ha index set as the net being controlled. -/ -@[expose] public section +public section universe u v @@ -25,6 +25,7 @@ variable {X : Type u} [AddCommGroup X] [Lattice X] [IsOrderedAddMonoid X] /-- A net `u` **order converges** to `x` if its tails are eventually controlled by a separate decreasing regulator net with greatest lower bound zero. -/ +@[expose] def OrderConvergesTo {ι : Type v} [Preorder ι] (u : ι → X) (x : X) : Prop := ∃ (κ : Type u) (_ : Preorder κ) (_ : IsDirected κ (· ≤ ·)) (_ : Nonempty κ), ∃ r : κ → X, diff --git a/LeanPool/OrderClosures/BanLat/Disjoint.lean b/LeanPool/OrderClosures/BanLat/Disjoint.lean index c5cdfb715e..ca860e9aac 100644 --- a/LeanPool/OrderClosures/BanLat/Disjoint.lean +++ b/LeanPool/OrderClosures/BanLat/Disjoint.lean @@ -24,7 +24,7 @@ independent over `ℝ`. Finally, in a normed vector lattice, a limit of a pairwise-disjoint sequence is forced to be zero. -/ -@[expose] public section +public section open scoped Topology open Filter Finset @@ -37,6 +37,7 @@ variable {X : Type*} [AddCommGroup X] [Lattice X] [IsOrderedAddMonoid X] /-- Two elements of a lattice-ordered group are **disjoint** when `|x| ⊓ |y| = 0`. -/ +@[expose] def IsVLDisjoint (x y : X) : Prop := |x| ⊓ |y| = 0 omit [IsOrderedAddMonoid X] in diff --git a/LeanPool/OrderClosures/BanLat/Examples/CofK/Basic.lean b/LeanPool/OrderClosures/BanLat/Examples/CofK/Basic.lean index 60a9aea2eb..236eb23e66 100644 --- a/LeanPool/OrderClosures/BanLat/Examples/CofK/Basic.lean +++ b/LeanPool/OrderClosures/BanLat/Examples/CofK/Basic.lean @@ -19,7 +19,7 @@ real-valued functions equipped with the supremum norm and the pointwise order is a Banach lattice. -/ -@[expose] public section +public section variable {K : Type*} [TopologicalSpace K] [CompactSpace K] diff --git a/LeanPool/OrderClosures/BanLat/LLexpr.lean b/LeanPool/OrderClosures/BanLat/LLexpr.lean index 4a15c556ab..6a02cac118 100644 --- a/LeanPool/OrderClosures/BanLat/LLexpr.lean +++ b/LeanPool/OrderClosures/BanLat/LLexpr.lean @@ -25,7 +25,7 @@ The main application is the Yudin theorem: a lattice-linear identity between formal expressions holds in every vector lattice as soon as it holds on `ℝ`. -/ -@[expose] public section +public section /-- A formal lattice-linear expression in `n` variables, built from the variables by addition, real scalar multiplication, and the binary lattice @@ -46,6 +46,7 @@ variable {n : ℕ} /-- Evaluation of a formal lattice-linear expression at an `n`-tuple of vectors in a vector lattice. -/ +@[expose] def eval {X : Type*} [AddCommGroup X] [Lattice X] [IsOrderedAddMonoid X] [VectorLattice X] (x : Fin n → X) : LLexpr n → X | .zero => 0 @@ -126,6 +127,7 @@ variable {X : Type*} [AddCommGroup X] [Lattice X] [IsOrderedAddMonoid X] /-- The set of lattice-linear combinations of a tuple `x : Fin n → X`, i.e. the image of `LLexpr n` under evaluation at `x`. -/ +@[expose] def combinations (x : Fin n → X) : Set X := Set.range (eval x) @@ -135,6 +137,7 @@ end Combinations /-- A formal lattice-linear expression *vanishes* on a vector lattice `X` if its evaluation is zero for every substitution by vectors of `X`. -/ +@[expose] def Vanishes (X : Type*) [AddCommGroup X] [Lattice X] [IsOrderedAddMonoid X] [VectorLattice X] (e : LLexpr n) : Prop := ∀ x : Fin n → X, eval x e = 0 diff --git a/LeanPool/OrderClosures/BanLat/LatticeSeminorm.lean b/LeanPool/OrderClosures/BanLat/LatticeSeminorm.lean index 23e90ba9d1..96f5b0c62a 100644 --- a/LeanPool/OrderClosures/BanLat/LatticeSeminorm.lean +++ b/LeanPool/OrderClosures/BanLat/LatticeSeminorm.lean @@ -18,7 +18,7 @@ Extracted from BanLat `LocallySolid/WithSeminorms.lean` at `b00e59836016aa1099b8011add6b07385e66428e`. -/ -@[expose] public section +public section open scoped Topology Pointwise diff --git a/LeanPool/OrderClosures/BanLat/Normed.lean b/LeanPool/OrderClosures/BanLat/Normed.lean index 5a843b1bb5..90ac734c3a 100644 --- a/LeanPool/OrderClosures/BanLat/Normed.lean +++ b/LeanPool/OrderClosures/BanLat/Normed.lean @@ -23,7 +23,7 @@ vector lattices, including continuity of lattice operations, closedness of the positive cone, boundedness of order intervals, and monotone convergence facts. -/ -@[expose] public section +public section /-- A normed vector lattice is a real vector lattice equipped with a lattice norm: a norm satisfying `|x| ≤ |y| → ‖x‖ ≤ ‖y‖`. -/ diff --git a/LeanPool/OrderClosures/BanLat/Operators/Hom.lean b/LeanPool/OrderClosures/BanLat/Operators/Hom.lean index a0d2c3c20b..0475f036cb 100644 --- a/LeanPool/OrderClosures/BanLat/Operators/Hom.lean +++ b/LeanPool/OrderClosures/BanLat/Operators/Hom.lean @@ -29,7 +29,7 @@ The final section introduces `BanachLatEquiv`, the type of Banach lattice isomet real linear isometric equivalences that also preserve `⊔` and `⊓`. -/ -@[expose] public section +public section /-! ## Vector lattice homomorphisms -/ @@ -71,6 +71,7 @@ theorem isVecLatHom (f : VecLatHom X Y) : IsVecLatHom f where map_inf' := f.toLatticeHom.map_inf' /-- Construct a `VecLatHom` from a proof that a function satisfies `IsVecLatHom`. -/ +@[expose] def ofIsVecLatHom (f : X → Y) (h : IsVecLatHom f) : VecLatHom X Y where toFun := f map_add' := h.map_add @@ -251,6 +252,7 @@ end LLexpr namespace IsVecLatHom /-- Bundle an `IsVecLatHom` proof into a `VecLatHom`. -/ +@[expose] def mk' (f : X → Y) (vlh : IsVecLatHom f) : VecLatHom X Y := VecLatHom.ofIsVecLatHom f vlh @@ -522,6 +524,7 @@ variable {X : Type*} [NormedAddCommGroup X] [Lattice X] [IsOrderedAddMonoid X] /-- The canonical inclusion of a normed vector lattice into its completion, as a vector lattice homomorphism. -/ +@[expose] noncomputable def toCompletionVecLatHom : VecLatHom X (Completion X) where toFun := ((↑) : X → Completion X) map_add' := Completion.coe_add diff --git a/LeanPool/OrderClosures/BanLat/Operators/Positive.lean b/LeanPool/OrderClosures/BanLat/Operators/Positive.lean index 026e8e0856..adfc6365af 100644 --- a/LeanPool/OrderClosures/BanLat/Operators/Positive.lean +++ b/LeanPool/OrderClosures/BanLat/Operators/Positive.lean @@ -25,7 +25,7 @@ to a positive linear operator when the codomain is Archimedean. Finally, every p operator from a Banach lattice to a normed vector lattice is automatically continuous. -/ -@[expose] public section +public section /-! ## Definition and basic properties -/ @@ -265,6 +265,7 @@ variable /-- **Extension Lemma**: an additive map on the positive cone of a vector lattice extends to a unique positive linear operator when the codomain is Archimedean. The extension satisfies `T x = τ x⁺ − τ x⁻`. -/ +@[expose] noncomputable def extension : X →ₗ[ℝ] Y := { toFun := fun x => τ x⁺ - τ x⁻ map_add' := extFun_add hτ_add diff --git a/LeanPool/OrderClosures/BanLat/OrderComplete.lean b/LeanPool/OrderClosures/BanLat/OrderComplete.lean index 1ebab4b84d..7a6a72ffae 100644 --- a/LeanPool/OrderClosures/BanLat/OrderComplete.lean +++ b/LeanPool/OrderClosures/BanLat/OrderComplete.lean @@ -22,7 +22,7 @@ completeness, introduces the sequential analogue the Archimedean property. -/ -@[expose] public section +public section open Set @@ -70,7 +70,7 @@ lemma exists_isLUB_of_pos_of_shift /-- Build a `ConditionallyCompleteLattice` structure from a blanket hypothesis that every non-empty bounded above set has a least upper bound. -/ -@[reducible] +@[expose, reducible] noncomputable def conditionallyCompleteLatticeOfHasLUB {X : Type*} [AddCommGroup X] [Lattice X] [IsOrderedAddMonoid X] (hLUB : ∀ {S : Set X}, S.Nonempty → BddAbove S → ∃ x, IsLUB S x) : @@ -187,7 +187,7 @@ noncomputable def conditionallyCompleteLatticeOfPosNet /-- On a lattice-ordered additive commutative group, a `ConditionallyCompleteLattice` structure exists provided every non-empty bounded above set of positive elements has a least upper bound. -/ -@[reducible] +@[expose, reducible] noncomputable def conditionallyCompleteLatticeOfPosSet (X : Type*) [AddCommGroup X] [Lattice X] [IsOrderedAddMonoid X] (H : ∀ {S : Set X}, S ⊆ {x | 0 ≤ x} → S.Nonempty → BddAbove S → @@ -225,7 +225,7 @@ instance (priority := 100) ConditionallyCompleteLattice.toSigmaConditionallyComp /-- Build a `SigmaConditionallyCompleteLattice` structure from a hypothesis that every countable non-empty bounded above set has a least upper bound. -/ -@[reducible] +@[expose, reducible] noncomputable def sigmaConditionallyCompleteLatticeOfHasCountableLUB {X : Type*} [AddCommGroup X] [Lattice X] [IsOrderedAddMonoid X] (hLUB : ∀ {S : Set X}, S.Countable → S.Nonempty → BddAbove S → @@ -324,7 +324,7 @@ lemma exists_isLUB_pos_countable_set_of_pos_seq /-- On a lattice-ordered additive commutative group, a `SigmaConditionallyCompleteLattice` structure exists provided every increasing bounded above sequence of positive elements has a least upper bound. -/ -@[reducible] +@[expose, reducible] noncomputable def sigmaConditionallyCompleteLatticeOfPosSeq (X : Type*) [AddCommGroup X] [Lattice X] [IsOrderedAddMonoid X] (H : ∀ {u : ℕ → X}, Monotone u → (∀ n, 0 ≤ u n) → diff --git a/LeanPool/OrderClosures/BanLat/OrderContinuous/Basic.lean b/LeanPool/OrderClosures/BanLat/OrderContinuous/Basic.lean index 43c31f5760..0d7ebed29c 100644 --- a/LeanPool/OrderClosures/BanLat/OrderContinuous/Basic.lean +++ b/LeanPool/OrderClosures/BanLat/OrderContinuous/Basic.lean @@ -25,7 +25,7 @@ equivalent sequential characterisations of σ-order continuity, and shows that an order continuous Banach lattice is order complete. -/ -@[expose] public section +public section universe u @@ -225,7 +225,7 @@ lemma le_zero_of_lb_upperBounds_sub [IsVLArchimedean X] (fun n => key n w₀ hw₀ a₀ ha₀) /-- An order continuous Banach lattice is order complete. -/ -@[reducible] +@[expose, reducible] noncomputable def conditionallyCompleteLatticeOfIsOrderContinuousNorm [IsOrderContinuousNorm X] : ConditionallyCompleteLattice X := by diff --git a/LeanPool/OrderClosures/BanLat/OrderContinuous/MeyerNieberg.lean b/LeanPool/OrderClosures/BanLat/OrderContinuous/MeyerNieberg.lean index 91082ddad0..c6ca29b0ac 100644 --- a/LeanPool/OrderClosures/BanLat/OrderContinuous/MeyerNieberg.lean +++ b/LeanPool/OrderClosures/BanLat/OrderContinuous/MeyerNieberg.lean @@ -19,7 +19,7 @@ an order continuous Banach lattice every order-bounded set of pairwise disjoint non-zero elements is at most countable. -/ -@[expose] public section +public section variable {X : Type*} [NormedAddCommGroup X] [Lattice X] [IsOrderedAddMonoid X] diff --git a/LeanPool/OrderClosures/BanLat/OrderContinuous/Nakano.lean b/LeanPool/OrderClosures/BanLat/OrderContinuous/Nakano.lean index 040079d29d..8b75836aa2 100644 --- a/LeanPool/OrderClosures/BanLat/OrderContinuous/Nakano.lean +++ b/LeanPool/OrderClosures/BanLat/OrderContinuous/Nakano.lean @@ -23,7 +23,7 @@ order continuity, σ-conditional completeness, σ-order continuity, and monotone norm convergence of bounded sequences. -/ -@[expose] public section +public section namespace BanachLattice @@ -52,7 +52,7 @@ variable {X : Type*} [NormedAddCommGroup X] [Lattice X] [IsOrderedAddMonoid X] /-- A lattice-ordered additive commutative group in which every increasing order-bounded sequence converges in norm to a least upper bound is σ-conditionally complete. -/ -@[reducible] +@[expose, reducible] noncomputable def sigmaConditionallyCompleteLatticeOfMonoBddAboveTendsto (h : ∀ {u : ℕ → X}, Monotone u → BddAbove (Set.range u) → ∃ x, IsLUB (Set.range u) x ∧ Filter.Tendsto u Filter.atTop (nhds x)) : diff --git a/LeanPool/OrderClosures/BanLat/OrderUnit.lean b/LeanPool/OrderClosures/BanLat/OrderUnit.lean index 5372d34923..cdd486c831 100644 --- a/LeanPool/OrderClosures/BanLat/OrderUnit.lean +++ b/LeanPool/OrderClosures/BanLat/OrderUnit.lean @@ -19,7 +19,7 @@ every other element up to a positive scalar multiple. Every strong order unit is a weak order unit. -/ -@[expose] public section +public section variable {X : Type*} [AddCommGroup X] [Lattice X] [IsOrderedAddMonoid X] [VectorLattice X] @@ -32,6 +32,7 @@ def WeakOrderUnit (e : X) : Prop := /-- An element `e` of a vector lattice is a **strong order unit** if it is non-negative and every element of `X` is dominated, in absolute value, by some non-negative real multiple of `e`. -/ +@[expose] def StrongOrderUnit (e : X) : Prop := 0 ≤ e ∧ ∀ x : X, ∃ c : ℝ, 0 ≤ c ∧ |x| ≤ c • e diff --git a/LeanPool/OrderClosures/BanLat/Pi.lean b/LeanPool/OrderClosures/BanLat/Pi.lean index b9500a1025..3abfaf6926 100644 --- a/LeanPool/OrderClosures/BanLat/Pi.lean +++ b/LeanPool/OrderClosures/BanLat/Pi.lean @@ -16,7 +16,7 @@ instance from BanLat `Pi.lean`; the separate finite-dimensional normed products are outside the dependency closure of the order-adherence constructions. -/ -@[expose] public section +public section /-! ### Pointwise product -/ diff --git a/LeanPool/OrderClosures/BanLat/Substructures/Band/Basic.lean b/LeanPool/OrderClosures/BanLat/Substructures/Band/Basic.lean index 2ef3afb498..53b0b652e2 100644 --- a/LeanPool/OrderClosures/BanLat/Substructures/Band/Basic.lean +++ b/LeanPool/OrderClosures/BanLat/Substructures/Band/Basic.lean @@ -22,7 +22,7 @@ and vector sublattices, proves the basic closure properties, and records that order completeness passes from the ambient vector lattice to a band. -/ -@[expose] public section +public section section MainVariables variable {X : Type*} [AddCommGroup X] [Lattice X] [IsOrderedAddMonoid X] @@ -97,6 +97,7 @@ automatically a band. -/ /-- An order ideal is a band as soon as every directed subset of positive elements with supremum in `X` has its supremum in the ideal. -/ +@[expose] def ofPosDirectedSSupMem (J : OrderIdeal X) (h : ∀ S, S ⊆ (J : Set X) → (∀ x ∈ S, 0 ≤ x) → DirectedOn (· ≤ ·) S → S.Nonempty → ∀ x, IsLUB S x → x ∈ J) : Band X where diff --git a/LeanPool/OrderClosures/BanLat/Substructures/Band/DisjointComplement.lean b/LeanPool/OrderClosures/BanLat/Substructures/Band/DisjointComplement.lean index da401cc205..d610298300 100644 --- a/LeanPool/OrderClosures/BanLat/Substructures/Band/DisjointComplement.lean +++ b/LeanPool/OrderClosures/BanLat/Substructures/Band/DisjointComplement.lean @@ -21,7 +21,7 @@ In a normed vector lattice, every disjoint complement is norm closed: it is an intersection of zero-sets of the continuous maps `x ↦ |x| ⊓ |a|`. -/ -@[expose] public section +public section variable {X : Type*} [AddCommGroup X] [Lattice X] [IsOrderedAddMonoid X] [VectorLattice X] @@ -30,6 +30,7 @@ variable {X : Type*} [AddCommGroup X] [Lattice X] [IsOrderedAddMonoid X] /-- The **disjoint complement** of a set `A ⊆ X` is the set of all elements disjoint from every member of `A`. -/ +@[expose] def disjointComplement (A : Set X) : Set X := {x : X | ∀ a ∈ A, IsVLDisjoint x a} @@ -100,6 +101,7 @@ namespace Band /-! ### The disjoint complement is a band -/ /-- The disjoint complement of any set is a band. -/ +@[expose] def disjointComplement (A : Set X) : Band X := Band.ofPosDirectedSSupMem (.ofSolid diff --git a/LeanPool/OrderClosures/BanLat/Substructures/Ideal.lean b/LeanPool/OrderClosures/BanLat/Substructures/Ideal.lean index 967b026cc1..a933ab6c75 100644 --- a/LeanPool/OrderClosures/BanLat/Substructures/Ideal.lean +++ b/LeanPool/OrderClosures/BanLat/Substructures/Ideal.lean @@ -21,7 +21,7 @@ subspace. This file defines the bundled `OrderIdeal` structure extending `VectorSublattice` and establishes the basic characterisations and properties. -/ -@[expose] public section +public section variable {X : Type*} [AddCommGroup X] [Lattice X] [IsOrderedAddMonoid X] [VectorLattice X] @@ -83,6 +83,7 @@ theorem mem_of_abs_le_abs {x y : X} (hx : x ∈ J) /-- Build an `OrderIdeal` from a submodule that is solid in the absolute-value sense: `x ∈ M` and `|y| ≤ |x|` imply `y ∈ M`. Every solid subspace is automatically a sublattice and an ideal. -/ +@[expose] def ofSolid (M : Submodule ℝ X) (h : ∀ x y : X, x ∈ M → |y| ≤ |x| → y ∈ M) : OrderIdeal X where @@ -138,6 +139,7 @@ theorem toSubmodule_injective : /-! ### Ideal generated by a set -/ /-- The intersection of two order ideals is an order ideal. -/ +@[expose] protected def inf (J₁ J₂ : OrderIdeal X) : OrderIdeal X where toSubmodule := J₁.toSubmodule ⊓ J₂.toSubmodule sup_mem' := fun hx hy => @@ -548,7 +550,7 @@ instance instIsOrderedAddMonoidPrincipal (a : X) : /-- In an Archimedean vector lattice, the principal ideal `I_a` with the gauge norm is a normed additive commutative group. -/ -@[reducible] +@[expose, reducible] noncomputable def principalNormedAddCommGroup [IsVLArchimedean X] (a : X) : NormedAddCommGroup ↥(principalSubmodule a) := @@ -627,6 +629,7 @@ private theorem sum_pos_mem (J₁ J₂ : OrderIdeal X) {v u₁ u₂ : X} abel /-- The sum of two order ideals (as submodules) is again an order ideal. -/ +@[expose] def sum (J₁ J₂ : OrderIdeal X) : OrderIdeal X := ofSolid (J₁.toSubmodule + J₂.toSubmodule) <| by intro x y hx hyx @@ -936,6 +939,7 @@ theorem topologicalClosure_solid (J : OrderIdeal X) : /-- The **norm closure** of an order ideal `J` in a normed vector lattice is again an order ideal, whose underlying submodule is the topological closure of `J.toSubmodule`. -/ +@[expose] def topologicalClosure (J : OrderIdeal X) : OrderIdeal X := ofSolid J.toSubmodule.topologicalClosure (topologicalClosure_solid J) @@ -974,6 +978,7 @@ instance : PartialOrder (ClosedOrderIdeal X) := .ofSetLike (ClosedOrderIdeal X) /-- The intersection of two closed order ideals is a closed order ideal. -/ +@[expose] def inf (J₁ J₂ : ClosedOrderIdeal X) : ClosedOrderIdeal X where toOrderIdeal := J₁.toOrderIdeal ⊓ J₂.toOrderIdeal isClosed' := J₁.isClosed.inter J₂.isClosed @@ -1058,6 +1063,7 @@ theorem isClosed_sum {J₁ J₂ : OrderIdeal X} /-- The sum of two closed order ideals of a Banach lattice is again a closed order ideal. -/ +@[expose] def sup (J₁ J₂ : ClosedOrderIdeal X) : ClosedOrderIdeal X where toOrderIdeal := OrderIdeal.sum J₁.toOrderIdeal J₂.toOrderIdeal isClosed' := isClosed_sum J₁.isClosed J₂.isClosed diff --git a/LeanPool/OrderClosures/BanLat/Substructures/Sublattice.lean b/LeanPool/OrderClosures/BanLat/Substructures/Sublattice.lean index 9393bef753..8008b147fb 100644 --- a/LeanPool/OrderClosures/BanLat/Substructures/Sublattice.lean +++ b/LeanPool/OrderClosures/BanLat/Substructures/Sublattice.lean @@ -27,7 +27,7 @@ them in terms of sup- and inf-closures, and records the induced normed vector lattice structure on closed sublattices. -/ -@[expose] public section +public section variable {X : Type*} [AddCommGroup X] [Lattice X] [IsOrderedAddMonoid X] [VectorLattice X] @@ -106,6 +106,7 @@ theorem smul_mem_infClosure_of_smulClosed {s : Set X} exact infClosure_min hsub h_ic hx /-- The sup-closure of a pointed cone is a pointed cone. -/ +@[expose] def supClosure (C : PointedCone ℝ X) : PointedCone ℝ X where carrier := _root_.supClosure (C : Set X) zero_mem' := subset_supClosure C.zero_mem @@ -118,6 +119,7 @@ theorem coe_supClosure (C : PointedCone ℝ X) : (supClosure C : Set X) = _root_.supClosure (C : Set X) := rfl /-- The inf-closure of a pointed cone is a pointed cone. -/ +@[expose] def infClosure (C : PointedCone ℝ X) : PointedCone ℝ X where carrier := _root_.infClosure (C : Set X) zero_mem' := subset_infClosure C.zero_mem @@ -187,6 +189,7 @@ private theorem posPart_mem_of_absClosed (M : Submodule ℝ X) exact M.smul_mem _ (M.add_mem hx (h x hx)) /-- Build a `VectorSublattice` from a submodule closed under `|·|`. -/ +@[expose] def ofAbsClosed (M : Submodule ℝ X) (h : ∀ x : X, x ∈ M → |x| ∈ M) : VectorSublattice X where toSubmodule := M @@ -729,6 +732,7 @@ instance instNormedVectorLatticeSubtype : /-- The closure of a vector sublattice in a normed vector lattice is again a vector sublattice. -/ +@[expose] noncomputable def topologicalClosure (Y : VectorSublattice X) : VectorSublattice X where toSubmodule := Y.toSubmodule.topologicalClosure sup_mem' := fun {x y} hx hy => by diff --git a/LeanPool/OrderClosures/GaoLeungCharacterization.lean b/LeanPool/OrderClosures/GaoLeungCharacterization.lean index 55b8012539..bbccbb1603 100644 --- a/LeanPool/OrderClosures/GaoLeungCharacterization.lean +++ b/LeanPool/OrderClosures/GaoLeungCharacterization.lean @@ -21,7 +21,7 @@ ambient Banach lattice. The row-limit sublattice then separates uo-adherence from order adherence. -/ -@[expose] public section +public section namespace OrderClosures diff --git a/LeanPool/OrderClosures/GaoLeungProblem.lean b/LeanPool/OrderClosures/GaoLeungProblem.lean index 8b782e2ec6..a17e7550f9 100644 --- a/LeanPool/OrderClosures/GaoLeungProblem.lean +++ b/LeanPool/OrderClosures/GaoLeungProblem.lean @@ -19,4 +19,4 @@ public import LeanPool.OrderClosures.GaoLeungProblem.Iterations Compatibility umbrella for the paper-ordered Gao--Leung formalization. -/ -@[expose] public section +public section diff --git a/LeanPool/OrderClosures/GaoLeungProblem/CNFOrder.lean b/LeanPool/OrderClosures/GaoLeungProblem/CNFOrder.lean index 8bcd24789a..a88cbe8bf7 100644 --- a/LeanPool/OrderClosures/GaoLeungProblem/CNFOrder.lean +++ b/LeanPool/OrderClosures/GaoLeungProblem/CNFOrder.lean @@ -14,7 +14,7 @@ public import Mathlib.SetTheory.Ordinal.Principal # The Cantor-normal-form extension order -/ -@[expose] public section +public section namespace OrderClosures @@ -26,6 +26,7 @@ section OrdinalConstruction /-- The relation `≺` from the proof of Theorem `thm:solid-iterations`, expressed directly using Mathlib's Cantor normal form at base `ω`. -/ +@[expose] def cnfExtensionLT (ζ ζ' : Ordinal.{u}) : Prop := ∃ (pre tail : List (Ordinal.{u} × Ordinal.{u})) (β c γ d : Ordinal.{u}), Ordinal.CNF Ordinal.omega0 ζ = pre ++ (β, c) :: tail ∧ @@ -35,6 +36,7 @@ def cnfExtensionLT (ζ ζ' : Ordinal.{u}) : Prop := (pre = [] ∨ ∃ δ e, pre.getLast? = some (δ, e) ∧ γ < δ))) /-- Reflexive closure of the paper's relation `≺`. -/ +@[expose] def cnfExtensionLE (ζ ζ' : Ordinal.{u}) : Prop := ζ = ζ' ∨ cnfExtensionLT ζ ζ' /-- One strict extension after a fixed CNF prefix; introduced separately so @@ -47,6 +49,7 @@ def CNFStep (pre : List (Ordinal.{u} × Ordinal.{u})) /-- The transitive closure of one-step CNF extensions; used as a tractable list model of `cnfExtensionLT`. -/ +@[expose] def CNFListLT (l l' : List (Ordinal.{u} × Ordinal.{u})) : Prop := ∃ (pre tail : List (Ordinal.{u} × Ordinal.{u})) (x y : Ordinal.{u} × Ordinal.{u}), @@ -54,6 +57,7 @@ def CNFListLT (l l' : List (Ordinal.{u} × Ordinal.{u})) : Prop := /-- Evaluates a list of exponent-coefficient pairs as an ordinal CNF sum; used to compare list extensions with ordinal inequalities. -/ +@[expose] noncomputable def cnfValue (l : List (Ordinal.{u} × Ordinal.{u})) : Ordinal.{u} := l.foldr (fun p r ↦ Ordinal.omega0 ^ p.1 * p.2 + r) 0 diff --git a/LeanPool/OrderClosures/GaoLeungProblem/Counterexample.lean b/LeanPool/OrderClosures/GaoLeungProblem/Counterexample.lean index c445e26190..7ec3317cd9 100644 --- a/LeanPool/OrderClosures/GaoLeungProblem/Counterexample.lean +++ b/LeanPool/OrderClosures/GaoLeungProblem/Counterexample.lean @@ -20,7 +20,7 @@ Formalization of the paper's counterexamples concerning order and unbounded-orde adherences of sublattices and solid sets. -/ -@[expose] public section +public section namespace OrderClosures diff --git a/LeanPool/OrderClosures/GaoLeungProblem/Iterations.lean b/LeanPool/OrderClosures/GaoLeungProblem/Iterations.lean index 2f04e53981..21884a621d 100644 --- a/LeanPool/OrderClosures/GaoLeungProblem/Iterations.lean +++ b/LeanPool/OrderClosures/GaoLeungProblem/Iterations.lean @@ -14,7 +14,7 @@ public import Mathlib.SetTheory.Cardinal.Ordinal # Arbitrarily long order-adherence iterations -/ -@[expose] public section +public section namespace OrderClosures diff --git a/LeanPool/OrderClosures/GaoLeungProblem/OrdinalSpace.lean b/LeanPool/OrderClosures/GaoLeungProblem/OrdinalSpace.lean index c6e4714eab..639c9ab316 100644 --- a/LeanPool/OrderClosures/GaoLeungProblem/OrdinalSpace.lean +++ b/LeanPool/OrderClosures/GaoLeungProblem/OrdinalSpace.lean @@ -13,7 +13,7 @@ public import LeanPool.OrderClosures.GaoLeungProblem.CNFOrder # The compact ordinal space and coordinate projections -/ -@[expose] public section +public section namespace OrderClosures @@ -33,6 +33,7 @@ def GaoCompactSpace (ξ : Ordinal.{u}) := ∀ a b : GaoIndex ξ, cnfExtensionLT a.1 b.1 → x a ≤ x b} /-- Coordinate projection `π_ζ` on the Gao compact space. -/ +@[expose] noncomputable def ordinalProjection (ξ : Ordinal.{u}) (ζ : GaoIndex ξ) : C(GaoCompactSpace ξ, ℝ) where toFun := fun x ↦ if x.1 ζ then 1 else 0 @@ -66,14 +67,17 @@ theorem continuousMap_exists_finite_coordinates /-- The least exponent in the Cantor normal form of an ordinal (zero at the empty normal form). -/ +@[expose] noncomputable def leastCNFExponent (ζ : Ordinal.{u}) : Ordinal.{u} := ((Ordinal.CNF Ordinal.omega0 ζ).getLast?.map Prod.fst).getD 0 /-- The index set `Z_β` from Claim 3. -/ +@[expose] def GaoStageIndices (ξ β : Ordinal.{u}) : Set (GaoIndex ξ) := {ζ | ζ.1 ≤ Ordinal.omega0 ^ ξ ∧ leastCNFExponent ζ.1 < β} /-- The solid set `S_β` from Claim 3. -/ +@[expose] def GaoStageSet (ξ β : Ordinal.{u}) : Set C(GaoCompactSpace ξ, ℝ) := {f | ∃ ζ ∈ GaoStageIndices ξ β, |f| ≤ ordinalProjection ξ ζ} diff --git a/LeanPool/OrderClosures/GaoLeungProblem/StageFormula.lean b/LeanPool/OrderClosures/GaoLeungProblem/StageFormula.lean index a848f28fe2..66e4dababe 100644 --- a/LeanPool/OrderClosures/GaoLeungProblem/StageFormula.lean +++ b/LeanPool/OrderClosures/GaoLeungProblem/StageFormula.lean @@ -13,7 +13,7 @@ public import LeanPool.OrderClosures.GaoLeungProblem.OrdinalSpace # Adherence formulas for Gao stages -/ -@[expose] public section +public section namespace OrderClosures diff --git a/LeanPool/OrderClosures/OrderAdherence.lean b/LeanPool/OrderClosures/OrderAdherence.lean index 290b02f40b..7a76acec53 100644 --- a/LeanPool/OrderClosures/OrderAdherence.lean +++ b/LeanPool/OrderClosures/OrderAdherence.lean @@ -25,7 +25,7 @@ Shared definitions and results about order convergence, unbounded-order converge solid hulls, and iterated order adherence used throughout the formalization. -/ -@[expose] public section +public section open Set @@ -39,20 +39,24 @@ variable {X : Type u} [AddCommGroup X] [Lattice X] [IsOrderedAddMonoid X] [VectorLattice X] /-- Unbounded-order convergence, defined using BanLat's `OrderConvergesTo`. -/ +@[expose] def UOConvergesTo {ι : Type v} [Preorder ι] (f : ι → X) (x : X) : Prop := ∀ a : X, 0 ≤ a → OrderConvergesTo (fun i ↦ |f i - x| ⊓ a) 0 /-- The order adherence of a set: limits of order-convergent nets in the set. -/ +@[expose] def orderAdherence (A : Set X) : Set X := {x | ∃ (ι : Type u) (_ : Preorder ι) (_ : IsDirected ι (· ≤ ·)) (_ : Nonempty ι), ∃ f : ι → X, (∀ i, f i ∈ A) ∧ OrderConvergesTo f x} /-- The unbounded-order adherence of a set. -/ +@[expose] def uoAdherence (A : Set X) : Set X := {x | ∃ (ι : Type u) (_ : Preorder ι) (_ : IsDirected ι (· ≤ ·)) (_ : Nonempty ι), ∃ f : ι → X, (∀ i, f i ∈ A) ∧ UOConvergesTo f x} /-- A set is order closed when it contains the order limits of all its nets. -/ +@[expose] def IsOrderClosed (A : Set X) : Prop := orderAdherence A ⊆ A /-- A set is unbounded-order closed when it contains the uo-limits of all its nets. -/ @@ -63,15 +67,18 @@ def orderClosure (A : Set X) : Set X := ⋂₀ {B : Set X | A ⊆ B ∧ IsOrderClosed B} /-- The paper's directed-supremum description of the positive part of order adherence. -/ +@[expose] def directedPositiveAdherence (A : Set X) : Set X := {x | 0 ≤ x ∧ ∃ B : Set X, B ⊆ A ∩ {y | 0 ≤ y} ∧ B.Nonempty ∧ DirectedOn (· ≤ ·) B ∧ IsLUB B x} /-- For a solid set, order adherence is the solid hull of its directed positive suprema. -/ +@[expose] def solidOrderAdherence (A : Set X) : Set X := LatticeOrderedAddCommGroup.solidClosure (directedPositiveAdherence A) /-- Finite iteration of order adherence. -/ +@[expose] def iteratedOrderAdherence (A : Set X) : ℕ → Set X | 0 => A | n + 1 => orderAdherence (iteratedOrderAdherence A n) @@ -86,6 +93,7 @@ structure OrderAdherenceTower (A : Set X) where stage ξ = ⋃ η : Set.Iio ξ, stage η.1 /-- At least `ξ` stages are needed when every earlier adherence step is proper. -/ +@[expose] def NeedsOrderAdherenceIterations (A : Set X) (ξ : Ordinal.{u}) : Prop := ∃ T : OrderAdherenceTower A, ∀ η < ξ, T.stage η ⊂ T.stage (Order.succ η) @@ -368,14 +376,17 @@ theorem solidHull_eq_iUnion_Icc (A : Set X) : simpa using neg_le_neg hlow /-- The least cardinality of a set whose solid hull is `S`. -/ +@[expose] noncomputable def solidGeneratorNumber (S : Set X) : Cardinal := sInf {κ : Cardinal | ∃ A : Set X, Cardinal.mk A = κ ∧ solidHull A = S} /-- Scalar dilation of a set. -/ +@[expose] def scaleSet (a : ℝ) (A : Set X) [SMul ℝ X] : Set X := (fun x ↦ a • x) '' A /-- A set-theoretic unit ball for a specified real-valued norm. -/ +@[expose] def unitBallFor (p : X → ℝ) : Set X := {x | p x ≤ 1} end Solidity @@ -383,6 +394,7 @@ end Solidity section CompletenessAndNorms /-- Order completeness, stated without installing a second lattice instance. -/ +@[expose] def IsOrderComplete (X : Type u) [Preorder X] : Prop := ∀ A : Set X, A.Nonempty → BddAbove A → ∃ x, IsLUB A x @@ -395,6 +407,7 @@ noncomputable def conditionallyCompleteLatticeOfIsOrderComplete conditionallyCompleteLatticeOfPosSet X fun _ hne hbdd => hX _ hne hbdd /-- Density character: the least cardinality of a dense subset. -/ +@[expose] noncomputable def densityCharacter (X : Type u) [TopologicalSpace X] : Cardinal := sInf {κ : Cardinal | ∃ D : Set X, Dense D ∧ Cardinal.mk D = κ} @@ -417,28 +430,33 @@ all subsequent Fatou and norm-comparison statements. -/ instance : CoeFun (PaperLatticeNorm X) (fun _ ↦ X → ℝ) := ⟨PaperLatticeNorm.toFun⟩ /-- Sequential completeness for the metric induced by `p`. -/ +@[expose] def IsCompleteFor (p : X → ℝ) : Prop := ∀ f : ℕ → X, (∀ ε > 0, ∃ N, ∀ m ≥ N, ∀ n ≥ N, p (f m - f n) < ε) → ∃ x, ∀ ε > 0, ∃ N, ∀ n ≥ N, p (f n - x) < ε /-- Fatou's property for a specified lattice norm. -/ +@[expose] def HasFatouProperty (p : X → ℝ) : Prop := ∀ {ι : Type u} [Preorder ι] [IsDirected ι (· ≤ ·)] [Nonempty ι] (f : ι → X) (x : X), Monotone f → (∀ i, 0 ≤ f i) → IsLUB (Set.range f) x → IsLUB (p '' Set.range f) (p x) /-- Weak Fatou property with constant `K` for a specified lattice norm. -/ +@[expose] def HasWeakFatouProperty (p : X → ℝ) (K : ℝ) : Prop := 1 ≤ K ∧ ∀ {ι : Type u} [Preorder ι] [IsDirected ι (· ≤ ·)] [Nonempty ι] (f : ι → X) (x : X), Monotone f → (∀ i, 0 ≤ f i) → IsLUB (Set.range f) x → ∀ c, (∀ i, p (f i) ≤ c) → p x ≤ K * c /-- Equivalence of two norms through two positive comparison constants. -/ +@[expose] def EquivalentNorms (p q : X → ℝ) : Prop := ∃ c C : ℝ, 0 < c ∧ 0 < C ∧ ∀ x, c * p x ≤ q x ∧ q x ≤ C * p x /-- The ambient norm as a paper lattice norm. -/ +@[expose] noncomputable def ambientLatticeNorm {Y : Type u} [NormedAddCommGroup Y] [Lattice Y] [IsOrderedAddMonoid Y] [NormedVectorLattice Y] : PaperLatticeNorm Y where diff --git a/LeanPool/OrderClosures/Solovay.lean b/LeanPool/OrderClosures/Solovay.lean index e91c78018b..55a3afa6b5 100644 --- a/LeanPool/OrderClosures/Solovay.lean +++ b/LeanPool/OrderClosures/Solovay.lean @@ -24,7 +24,7 @@ algebra as the clopen algebra of its Stone space and develops the analytic facts needed for the Gao--Leung counterexample. -/ -@[expose] public section +public section open Set @@ -55,6 +55,7 @@ noncomputable instance regularOpenCompleteBooleanAlgebra /-- Regards a clopen set as a regular open element; used to turn finite cylinders into Boolean-algebra generators. -/ +@[expose] def regularOpenOfClopen {X : Type u} [TopologicalSpace X] (s : Set X) (hs : IsClopen s) : RegularOpen X := by let U : TopologicalSpace.Opens X := ⟨s, hs.2⟩ diff --git a/LeanPool/OrderClosures/WeaklyFatou.lean b/LeanPool/OrderClosures/WeaklyFatou.lean index 3972cd726b..36688ea336 100644 --- a/LeanPool/OrderClosures/WeaklyFatou.lean +++ b/LeanPool/OrderClosures/WeaklyFatou.lean @@ -20,4 +20,4 @@ public import LeanPool.OrderClosures.WeaklyFatou.FinalSpace Compatibility umbrella for the paper-ordered weakly Fatou construction. -/ -@[expose] public section +public section diff --git a/LeanPool/OrderClosures/WeaklyFatou/Bands.lean b/LeanPool/OrderClosures/WeaklyFatou/Bands.lean index 4bc1da2d86..ef82213edc 100644 --- a/LeanPool/OrderClosures/WeaklyFatou/Bands.lean +++ b/LeanPool/OrderClosures/WeaklyFatou/Bands.lean @@ -13,7 +13,7 @@ public import LeanPool.OrderClosures.WeaklyFatou.TreeNorm # Bands, upshift, trimming, and the weak Fatou estimate -/ -@[expose] public section +public section namespace OrderClosures @@ -48,6 +48,7 @@ noncomputable def finiteBandProjection (n : ℕ) (Λ : Finset (TreeBandIndex n)) /-- Assigns a node to the root band or the sibling band indexed by its parent; used to define the finite band partition pointwise. -/ +@[expose] noncomputable def treeBandOfNode (n : ℕ) (t : TreeNode n) : TreeBandIndex n := by classical @@ -225,6 +226,7 @@ theorem parent_eq_treeBandParent (n : ℕ) (t : TreeNode n) : · simp [treeBandOfNode, treeBandParent, ht] /-- The upshift `S_n`, merging coefficients at their parents. -/ +@[expose] noncomputable def treeUpshift (n : ℕ) (w : TreeCoefficients n) : TreeCoefficients n := w.mapDomain TreeNode.parent @@ -424,6 +426,7 @@ theorem tree_sharp_subsequence simpa [y, Function.comp_def] using tendsto_subtype_rng.mp hcoord /-- The bands occurring in infinitely many supports of a sequence. -/ +@[expose] def recurrentBands (n : ℕ) (w : ℕ → TreeCoefficients n) : Set (TreeBandIndex n) := {B | Set.Infinite {m | (treeBandProjection n B (w m)).support.Nonempty}} diff --git a/LeanPool/OrderClosures/WeaklyFatou/FinalSpace.lean b/LeanPool/OrderClosures/WeaklyFatou/FinalSpace.lean index 7c84bf61da..3e273957bd 100644 --- a/LeanPool/OrderClosures/WeaklyFatou/FinalSpace.lean +++ b/LeanPool/OrderClosures/WeaklyFatou/FinalSpace.lean @@ -13,7 +13,7 @@ public import LeanPool.OrderClosures.WeaklyFatou.Moderated # Component adherence and the final `c₀`-sum -/ -@[expose] public section +public section namespace OrderClosures diff --git a/LeanPool/OrderClosures/WeaklyFatou/FiniteTree.lean b/LeanPool/OrderClosures/WeaklyFatou/FiniteTree.lean index 81bdf534ce..90c763a1bc 100644 --- a/LeanPool/OrderClosures/WeaklyFatou/FiniteTree.lean +++ b/LeanPool/OrderClosures/WeaklyFatou/FiniteTree.lean @@ -15,7 +15,7 @@ public import LeanPool.OrderClosures.WeaklyFatou.Reductions The finite-height tree, its cylinder sets, and the parent-disjointness lemma. -/ -@[expose] public section +public section namespace OrderClosures @@ -33,20 +33,24 @@ namespace TreeNode abbrev level {n : ℕ} (t : TreeNode n) : ℕ := t.1.length /-- The root `∅`. -/ +@[expose] def root (n : ℕ) : TreeNode n := ⟨[], by simp⟩ /-- The child `t⌢m`. -/ +@[expose] def child {n : ℕ} (t : TreeNode n) (h : level t < n) (m : ℕ) : TreeNode n := ⟨t.1 ++ [m], by simpa [level] using h⟩ /-- The parent map, fixing the root. -/ +@[expose] def parent {n : ℕ} (t : TreeNode n) : TreeNode n := ⟨t.1.dropLast, by rw [List.length_dropLast] exact (Nat.sub_le _ _).trans t.2⟩ /-- Restriction `t|j`. -/ +@[expose] def restrict {n : ℕ} (t : TreeNode n) (j : ℕ) : TreeNode n := ⟨t.1.take j, by rw [List.length_take] @@ -61,6 +65,7 @@ abbrev TreeNonterminal (n : ℕ) := {t : TreeNode n // TreeNode.level t < n} abbrev TreeProduct (n : ℕ) := TreeNonterminal n → ℕ /-- The strict prefix `t|j`, regarded as a non-terminal node. -/ +@[expose] def strictPrefix {n : ℕ} (t : TreeNode n) (j : Fin (TreeNode.level t)) : TreeNonterminal n := ⟨TreeNode.restrict t j, by @@ -70,6 +75,7 @@ def strictPrefix {n : ℕ} (t : TreeNode n) (j : Fin (TreeNode.level t)) : _ ≤ n := t.2⟩ /-- The cylinder `E_t`. -/ +@[expose] def treeCylinder (n : ℕ) (t : TreeNode n) : Set (TreeProduct n) := {α | ∀ j : Fin (TreeNode.level t), α (strictPrefix t j) ≤ t.1.get j} @@ -152,6 +158,7 @@ theorem treeCylinder_isClopen (n : ℕ) (t : TreeNode n) : (continuous_apply (strictPrefix t j)) /-- The characteristic function `s_t = χ_{E_t}`. -/ +@[expose] noncomputable def treeFunction (n : ℕ) (t : TreeNode n) : BoundedContinuousFunction (TreeProduct n) ℝ := BoundedContinuousFunction.indicator (treeCylinder n t) (treeCylinder_isClopen n t) @@ -264,10 +271,12 @@ theorem treeCylinder_finite_cover exact (not_lt_of_ge (hαu j)) (hj.trans_le hle) /-- Parent-disjointness (`π`-disjointness in the source). -/ +@[expose] def ParentDisjoint {n : ℕ} (A B : Set (TreeNode n)) : Prop := TreeNode.parent '' A ∩ TreeNode.parent '' B = ∅ /-- The finite union of the cylinders indexed by `F`. -/ +@[expose] def finiteCylinderUnion (n : ℕ) (F : Finset (TreeNode n)) : Set (TreeProduct n) := ⋃ t : F, treeCylinder n t.1 diff --git a/LeanPool/OrderClosures/WeaklyFatou/Moderated.lean b/LeanPool/OrderClosures/WeaklyFatou/Moderated.lean index 6dcbc028bc..0c745fd237 100644 --- a/LeanPool/OrderClosures/WeaklyFatou/Moderated.lean +++ b/LeanPool/OrderClosures/WeaklyFatou/Moderated.lean @@ -13,7 +13,7 @@ public import LeanPool.OrderClosures.WeaklyFatou.Bands # Thinning, transient bands, and component moderatedness -/ -@[expose] public section +public section namespace OrderClosures diff --git a/LeanPool/OrderClosures/WeaklyFatou/Reductions.lean b/LeanPool/OrderClosures/WeaklyFatou/Reductions.lean index a70b95375c..b0d84d69b8 100644 --- a/LeanPool/OrderClosures/WeaklyFatou/Reductions.lean +++ b/LeanPool/OrderClosures/WeaklyFatou/Reductions.lean @@ -16,7 +16,7 @@ Formalization of the paper's construction of a weakly Fatou Banach lattice norm not equivalent to any lattice norm with the Fatou property. -/ -@[expose] public section +public section namespace OrderClosures @@ -176,6 +176,7 @@ theorem fatou_iterated_unitBall exact fun m _ ↦ hall m /-- Weak sequential Nakano constant, Definition 3(a) in the paper. -/ +@[expose] def IsWeakSequentialNakanoConstant (p : X → ℝ) (K : ℝ) : Prop := 1 ≤ K ∧ ∀ (x : ℕ → X), Monotone x → (∀ m, 0 ≤ x m) → BddAbove (Set.range x) → (∀ m, p (x m) ≤ 1) → diff --git a/LeanPool/OrderClosures/WeaklyFatou/TreeNorm.lean b/LeanPool/OrderClosures/WeaklyFatou/TreeNorm.lean index ea6f1909f9..e3b746a071 100644 --- a/LeanPool/OrderClosures/WeaklyFatou/TreeNorm.lean +++ b/LeanPool/OrderClosures/WeaklyFatou/TreeNorm.lean @@ -13,7 +13,7 @@ public import LeanPool.OrderClosures.WeaklyFatou.FiniteTree # The induced tree seminorm and component lattice -/ -@[expose] public section +public section namespace OrderClosures @@ -28,14 +28,17 @@ universe u abbrev TreeCoefficients (n : ℕ) := TreeNode n →₀ ℝ /-- The basis vector `e_t`. -/ +@[expose] noncomputable def treeBasis {n : ℕ} (t : TreeNode n) : TreeCoefficients n := Finsupp.single t 1 /-- The weighted `ℓ¹` functional `ρ_n`. -/ +@[expose] noncomputable def treeRho (n : ℕ) (w : TreeCoefficients n) : ℝ := w.sum fun t a ↦ (2 : ℝ) ^ (-(TreeNode.level t : ℤ)) * |a| /-- The positive operator `T_n`. -/ +@[expose] noncomputable def treeOperator (n : ℕ) (w : TreeCoefficients n) : BoundedContinuousFunction (TreeProduct n) ℝ := w.sum fun t a ↦ a • treeFunction n t @@ -536,6 +539,7 @@ theorem treeSeminorm_exact_basis (n : ℕ) (t : TreeNode n) : simpa [abs_of_nonneg (treeFunction_nonneg n t)] using hmajor /-- The closed vector sublattice generated by the tree functions. -/ +@[expose] noncomputable def treeSublattice (n : ℕ) : VectorSublattice (BoundedContinuousFunction (TreeProduct n) ℝ) := (VectorSublattice.generated (Set.range (treeFunction n))).topologicalClosure @@ -587,6 +591,7 @@ noncomputable instance treeComponentVectorLattice (n : ℕ) : exact smul_le_smul_of_nonneg_left hxy ha /-- The norm `p_n` restricted to `X_n`. -/ +@[expose] noncomputable def componentLatticeNorm (n : ℕ) : PaperLatticeNorm (TreeComponent n) where toFun := fun x ↦ treeSeminorm n x.1 nonneg := by @@ -615,6 +620,7 @@ noncomputable def componentLatticeNorm (n : ℕ) : PaperLatticeNorm (TreeCompone exact (treeLatticeSeminorm n).monotone_abs' hxy /-- The constant function `1`, as an element of `X_n`. -/ +@[expose] noncomputable def componentRoot (n : ℕ) : TreeComponent n := ⟨treeFunction n (TreeNode.root n), by change treeFunction n (TreeNode.root n) ∈ @@ -624,6 +630,7 @@ noncomputable def componentRoot (n : ℕ) : TreeComponent n := exact VectorSublattice.subset_generated _ ⟨TreeNode.root n, rfl⟩⟩ /-- Any tree function, viewed in the generated component. -/ +@[expose] noncomputable def componentTreeFunction (n : ℕ) (t : TreeNode n) : TreeComponent n := ⟨treeFunction n t, by change treeFunction n t ∈ 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 7c14843351..a3921df006 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..2432608a87 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] @@ -86,7 +85,8 @@ lemma PreState.getLast_mem {H X} {bt : BuildTree H X} (π : PreState bt) : List.getLast_mem _ /-- A pre-state "has" an `AnyNegFormula` if one of its sequents contains it. -/ -def PreState.hasAnf {H X} {bt : BuildTree H X} (π : PreState bt) (anf : AnyNegFormula) : Prop := +@[expose] def PreState.hasAnf {H X} {bt : BuildTree H X} (π : PreState bt) + (anf : AnyNegFormula) : Prop := ∃ Z ∈ π.val, AnyNegFormula.memSequent Z anf /-- If a pre-state has `~''ξ` then the *unloaded* formula `~ξ.unload` is among its formulas. -/ diff --git a/LeanPool/PDL/Completeness/Modelgraphs.lean b/LeanPool/PDL/Completeness/Modelgraphs.lean index 2728eb0d92..89e50676d1 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 @@ -28,7 +28,7 @@ namespace Modelgraphs /-- Definition 6.3: Given relations for all atomic programs over model graph states (i.e. sets of formulas), define relations for all PDL programs inductively as usual, but using membership to interpret the test operator. -/ -def Q {W : Finset (Finset Formula)} (R : Nat → W → W → Prop) +@[expose] def Q {W : Finset (Finset Formula)} (R : Nat → W → W → Prop) : Program → W → W → Prop | ·c => R c | ?'τ => fun v w => v = w ∧ τ ∈ v.1 @@ -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 @@ -443,10 +443,12 @@ theorem truthLemma {Worlds} (MG : ModelGraph Worlds) : /-! ## Additional Q relations for the completeness proof -/ /-- Q_F - for a list `F` of tests (instead of a set in the notes). -/ +@[expose] def Qtests {W : Finset (Finset Formula)} (R : Nat → W → W → Prop) (F : List Formula) : W → W → Prop | 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 +469,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..17ab110acc 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 @@ -21,7 +21,7 @@ open vDash HasSat /-- An interpolant θ for φ and ψ only uses the vocabulary in both, is implied by φ and implies ψ. -/ -def Interpolant (φ : Formula) (ψ : Formula) (θ : Formula) := +@[expose] def Interpolant (φ : Formula) (ψ : Formula) (θ : Formula) := θ.voc ⊆ φ.voc ∩ ψ.voc ∧ tautology (φ ↣ θ) ∧ tautology (θ ↣ ψ) theorem interpolation {φ ψ : Formula} : diff --git a/LeanPool/PDL/Interpolation/Uniformity.lean b/LeanPool/PDL/Interpolation/Uniformity.lean index efdb7fdf6b..b7b272eb89 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 @@ -136,7 +136,7 @@ thing. Asking for both here only spares us the purely technical work of transpor and U2 along `Tableau.flip`, which would need a `flip` operation on `FinePathIn`. What it buys us is `Tableau.isUniform.flip` below, which is needed because the interpolation proof flips the tableau when the loaded formula is on the left. -/ -def Tableau.isUniform {H : History} {X : Sequent} (tab : Tableau H X) : Prop := +@[expose] def Tableau.isUniform {H : History} {X : Sequent} (tab : Tableau H X) : Prop := tab.UniCore ∧ tab.flip.UniCore /-- Transporting `Tableau.UniCore` along an equality of tableaux. -/ @@ -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 1ea12b0138..a13647e678 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/Endgame.lean b/LeanPool/PFR/Endgame.lean index d1e2c7e121..f6197ba0cf 100644 --- a/LeanPool/PFR/Endgame.lean +++ b/LeanPool/PFR/Endgame.lean @@ -422,7 +422,7 @@ lemma construct_good : have v2 := construct_good_prelim p X₁ X₂ h_min (by rw [← hT]; abel) hT₁ hT₃ hT₂ have v3 := construct_good_prelim p X₁ X₂ h_min (by rw [← hT]; abel) hT₂ hT₁ hT₃ have v6 := construct_good_prelim p X₁ X₂ h_min (by rw [← hT]; abel) hT₃ hT₂ hT₁ - simp only [mutualInfo, entropy_comm hT₂ hT₁, entropy_comm hT₃ hT₁, entropy_comm hT₃ hT₂] + simp only [mutualInfo_def, entropy_comm hT₂ hT₁, entropy_comm hT₃ hT₁, entropy_comm hT₃ hT₂] at * linarith diff --git a/LeanPool/PFR/FirstEstimate.lean b/LeanPool/PFR/FirstEstimate.lean index c413fdbb29..0d2b55908b 100644 --- a/LeanPool/PFR/FirstEstimate.lean +++ b/LeanPool/PFR/FirstEstimate.lean @@ -208,7 +208,8 @@ lemma ent_ofsum_le linarith have rw₂ : H[X₁ + X₂'] = k + H[X₁]/2 + H[X₂]/2 := by have HX₂_eq : H[X₂] = H[X₂'] := - congr_arg (fun (μ : Measure G) ↦ measureEntropy (μ := μ)) h₂.map_eq + by simpa only [entropy_def] using + congr_arg (fun (μ : Measure G) ↦ measureEntropy (μ := μ)) h₂.map_eq have k_eq : k = H[X₁ - X₂'] - H[X₁] / 2 - H[X₂'] / 2 := by have k_eq_aux : k = d[X₁ # X₂'] := h₂.rdist_congr_right hX₁.aemeasurable rw [k_eq_aux] @@ -217,7 +218,8 @@ lemma ent_ofsum_le ring have rw₃ : H[X₂ + X₁'] = k + H[X₁]/2 + H[X₂]/2 := by have HX₁_eq : H[X₁] = H[X₁'] := - congr_arg (fun (μ : Measure G) ↦ measureEntropy (μ := μ)) h₁.map_eq + by simpa only [entropy_def] using + congr_arg (fun (μ : Measure G) ↦ measureEntropy (μ := μ)) h₁.map_eq have k_eq' : k = H[X₁' - X₂] - H[X₁'] / 2 - H[X₂] / 2 := by have k_eq_aux : k = d[X₁' # X₂] := h₁.rdist_congr_left hX₂.aemeasurable rw [k_eq_aux] 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/PFR/MoreRuzsaDist.lean b/LeanPool/PFR/MoreRuzsaDist.lean index 3e88397bf5..a476dc5dc6 100644 --- a/LeanPool/PFR/MoreRuzsaDist.lean +++ b/LeanPool/PFR/MoreRuzsaDist.lean @@ -877,7 +877,7 @@ public lemma multiDist_indep {m : ℕ} {Ω : Type*} (hΩ : MeasureSpace Ω) [IsProbabilityMeasure hΩ.volume] {X : Fin m → Ω → G} (hX : ∀ i, Measurable (X i)) (h_indep : iIndepFun X) : D[X; fun _ ↦ hΩ] = H[∑ i, X i] - (∑ i, H[X i]) / m := by - simp only [multiDist, entropy, inv_mul_eq_div, sub_left_inj] + simp only [multiDist, entropy_def, inv_mul_eq_div, sub_left_inj] congr rw [iIndepFun_iff_map_fun_eq_pi_map (by fun_prop)] at h_indep rw [← h_indep, Measure.map_map] <;> try fun_prop @@ -2103,7 +2103,7 @@ theorem multiDist_of_hom' {G G' : Type*} [MeasurableSpace G] [MeasurableSingleto (a : Fin m → G') : D[fun i ω ↦ ι (X i ω) + a i; hΩ] = D[X; hΩ] := by unfold multiDist congr 1 - · unfold entropy + · simp only [entropy_def] set sum_G : (Fin m → G) → G := fun x ↦ ∑ i, x i set sum_G' : (Fin m → G') → G' := fun x ↦ ∑ i, x i let ι' : G → G' := fun x ↦ ι x + ∑ i, a i diff --git a/LeanPool/PFR/MultiTauFunctional.lean b/LeanPool/PFR/MultiTauFunctional.lean index 547d1285ed..5af5acd705 100644 --- a/LeanPool/PFR/MultiTauFunctional.lean +++ b/LeanPool/PFR/MultiTauFunctional.lean @@ -117,6 +117,7 @@ lemma multiTau_continuous {G Ω₀ : Type u} [MeasurableFinGroup G] [Topological apply Continuous.add (Continuous.sub ?_ ?_) ?_ · let f : (Fin p.m → G) → G := fun x ↦ ∑ i, x i have fcont : Continuous f := by fun_prop + simp only [entropy_def] change Continuous fun (x : Fin p.m → ProbabilityMeasure G) ↦ Hm[(ProbabilityMeasure.map (ProbabilityMeasure.pi x) f : Measure G)] apply continuous_measureEntropy_probabilityMeasure.comp diff --git a/LeanPool/PFR/WeakPFR.lean b/LeanPool/PFR/WeakPFR.lean index 1bd87b6d39..e993a590e9 100644 --- a/LeanPool/PFR/WeakPFR.lean +++ b/LeanPool/PFR/WeakPFR.lean @@ -545,15 +545,16 @@ lemma single_fibres {G H Ω Ω' : Type*} rintro h ⟨a, ha, rfl⟩ exact h (h_BY ⟨a, ha⟩) unfold M - unfold entropy + simp only [entropy_def] have : IsProbabilityMeasure (.map (φ ∘ UA) ℙ) := inferInstance have : IsProbabilityMeasure (.map (φ ∘ UB) ℙ) := inferInstance rewrite [← Finset.sum_product', ← tsum_eq_sum (L := SummationFilter.unconditional _) fun _ ↦ h_compl, ← measureEntropy_prod] + rw [measureEntropy_of_isProbabilityMeasure] apply tsum_congr; intro; congr - rewrite [← Set.singleton_prod_singleton, measureReal_ennreal_smul_apply, measureReal_def, + rewrite [← Set.singleton_prod_singleton, measureReal_def, Measure.prod_prod, Measure.map_apply (.comp .of_discrete hUA') (MeasurableSet.singleton _), Measure.map_apply (.comp .of_discrete hUB') (MeasurableSet.singleton _), 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/PaperIVCliqueTree/Basic.lean b/LeanPool/PaperIVCliqueTree/Basic.lean index 1218c78d6a..44b3d820ca 100644 --- a/LeanPool/PaperIVCliqueTree/Basic.lean +++ b/LeanPool/PaperIVCliqueTree/Basic.lean @@ -48,7 +48,7 @@ and with maximal-clique bags). partitioned by their assigned bags. -/ -@[expose] public section +public section namespace SimpleGraph @@ -91,6 +91,7 @@ theorem exists_mem_bag (v : V) : ∃ i, v ∈ T.bag i := ⟨T.top v, T.mem_bag_t /-- `T.IsAncestor i j` means that `j` occurs on the chain of parents starting at `i` (inclusively). -/ +@[expose] def IsAncestor (i j : ι) : Prop := Relation.ReflTransGen (fun a b => T.parent a = some b) i j variable {T} @@ -177,6 +178,7 @@ theorem exists_isLeaf [Finite ι] [Nonempty ι] (T : CliqueTree G ι) : ∃ i, T variable (T) /-- The vertices occurring in exactly one bag, namely in the bag of `i`. -/ +@[expose] def privateVerts (i : ι) : Set V := {v | v ∈ T.bag i ∧ ∀ k, v ∈ T.bag k → k = i} variable {T} @@ -218,6 +220,7 @@ theorem exists_bag_ne_of_isLeaf {i : ι} (hleaf : T.IsLeaf i) {x y : V} (hadj : variable (T) /-- The set of vertices covered by the subtree hanging below `i`. -/ +@[expose] def branch (i : ι) : Set V := {v | ∃ j, T.IsAncestor j i ∧ v ∈ T.bag j} variable {T} @@ -259,6 +262,7 @@ theorem not_adj_of_branch_separator [DecidableEq V] {i j : ι} (hp : T.parent i /-! ### Unique edge assignment and accounting -/ /-- The canonical bag of an edge: the deeper of the two top bags of its endpoints. -/ +@[expose] noncomputable def edgeBag (T : CliqueTree G ι) (e : Sym2 V) : ι := Sym2.lift ⟨fun x y => if T.rank (T.top x) ≤ T.rank (T.top y) then T.top y else T.top x, by diff --git a/LeanPool/PaperIVCliqueTree/Characterization.lean b/LeanPool/PaperIVCliqueTree/Characterization.lean index 4c1d6e3041..2b0d8fce1e 100644 --- a/LeanPool/PaperIVCliqueTree/Characterization.lean +++ b/LeanPool/PaperIVCliqueTree/Characterization.lean @@ -31,7 +31,7 @@ distance two along a cycle of length at least `4` their edge is not an edge of t * `SimpleGraph.isChordal_iff_exists_isPEO` -/ -@[expose] public section +public section namespace SimpleGraph diff --git a/LeanPool/PaperIVCliqueTree/Connector.lean b/LeanPool/PaperIVCliqueTree/Connector.lean index 0dac29b700..15808fa163 100644 --- a/LeanPool/PaperIVCliqueTree/Connector.lean +++ b/LeanPool/PaperIVCliqueTree/Connector.lean @@ -17,7 +17,7 @@ Strict rank descent proves connectivity; a maximal-rank vertex on a putative cycle would have two different lower neighbours, contradicting unique parenthood. -/ -@[expose] public section +public section namespace SimpleGraph.CliqueTree diff --git a/LeanPool/PaperIVCliqueTree/Counting.lean b/LeanPool/PaperIVCliqueTree/Counting.lean index 8371506390..cb9b847aaa 100644 --- a/LeanPool/PaperIVCliqueTree/Counting.lean +++ b/LeanPool/PaperIVCliqueTree/Counting.lean @@ -30,7 +30,7 @@ of which — the node `top v` — does not pass `v` on to its parent. * `SimpleGraph.CliqueTree.card_eq_sum_card_bag_sub_sum_card_inter` -/ -@[expose] public section +public section namespace SimpleGraph diff --git a/LeanPool/PaperIVCliqueTree/Gavril.lean b/LeanPool/PaperIVCliqueTree/Gavril.lean index 6cd9163946..9d078272d3 100644 --- a/LeanPool/PaperIVCliqueTree/Gavril.lean +++ b/LeanPool/PaperIVCliqueTree/Gavril.lean @@ -20,7 +20,7 @@ in trees are exactly the chordal graphs", JCT B 16 (1974), 47–56, doi:10.1016/0095-8956(74)90094-X. No recognition algorithm or runtime bound is claimed. -/ -@[expose] public section +public section namespace SimpleGraph diff --git a/LeanPool/PaperIVCliqueTree/Gluing.lean b/LeanPool/PaperIVCliqueTree/Gluing.lean index 4724a5a811..8b61fb3c9e 100644 --- a/LeanPool/PaperIVCliqueTree/Gluing.lean +++ b/LeanPool/PaperIVCliqueTree/Gluing.lean @@ -17,7 +17,7 @@ retained. This is not the convention of clique sums allowing separator-edge deletion. Edge accounting does not imply additivity of packing optima. -/ -@[expose] public section +public section namespace SimpleGraph diff --git a/LeanPool/PaperIVCliqueTree/GluingChordal.lean b/LeanPool/PaperIVCliqueTree/GluingChordal.lean index 817a7e001a..b33f24338c 100644 --- a/LeanPool/PaperIVCliqueTree/GluingChordal.lean +++ b/LeanPool/PaperIVCliqueTree/GluingChordal.lean @@ -16,7 +16,7 @@ condition ensures that left-exclusive vertices acquire no extra neighbours. The existing simplicial-elimination ranking then yields a PEO and chordality. -/ -@[expose] public section +public section namespace SimpleGraph diff --git a/LeanPool/PaperIVCliqueTree/GluingCounting.lean b/LeanPool/PaperIVCliqueTree/GluingCounting.lean index 2a4c7136f8..677712dc51 100644 --- a/LeanPool/PaperIVCliqueTree/GluingCounting.lean +++ b/LeanPool/PaperIVCliqueTree/GluingCounting.lean @@ -14,7 +14,7 @@ All counts use Mathlib's induced graphs and literal edge finsets. The edges in the overlap are counted twice by the pieces and once by the whole graph. -/ -@[expose] public section +public section namespace SimpleGraph.CliqueGluing diff --git a/LeanPool/PaperIVCliqueTree/GluingSimplicial.lean b/LeanPool/PaperIVCliqueTree/GluingSimplicial.lean index 7b399d2e24..8a773f9ebe 100644 --- a/LeanPool/PaperIVCliqueTree/GluingSimplicial.lean +++ b/LeanPool/PaperIVCliqueTree/GluingSimplicial.lean @@ -15,7 +15,7 @@ outside it is eliminated. The proof works in the connected component of an outside vertex and uses the existing one- and two-vertex Dirac interfaces. -/ -@[expose] public section +public section namespace SimpleGraph diff --git a/LeanPool/PaperIVCliqueTree/Helly.lean b/LeanPool/PaperIVCliqueTree/Helly.lean index c67794dfe7..c8bce52ab4 100644 --- a/LeanPool/PaperIVCliqueTree/Helly.lean +++ b/LeanPool/PaperIVCliqueTree/Helly.lean @@ -26,7 +26,7 @@ graph with the size of the largest bag, and shows that some bag is a maximum cli elimination order -/ -@[expose] public section +public section namespace SimpleGraph diff --git a/LeanPool/PaperIVCliqueTree/Maximal.lean b/LeanPool/PaperIVCliqueTree/Maximal.lean index 70a230b141..0536e94e5d 100644 --- a/LeanPool/PaperIVCliqueTree/Maximal.lean +++ b/LeanPool/PaperIVCliqueTree/Maximal.lean @@ -37,13 +37,14 @@ that every maximal clique occurs as a bag. PEO bags, namely the bag of its earliest vertex (so removing redundant bags loses nothing) -/ -@[expose] public section +public section namespace SimpleGraph variable {V : Type*} {G : SimpleGraph V} /-- `K` is a maximal clique of the subgraph of `G` induced on `S`. -/ +@[expose] def IsMaximalCliqueOn (G : SimpleGraph V) (S K : Finset V) : Prop := K ⊆ S ∧ G.IsClique (K : Set V) ∧ ∀ K', K' ⊆ S → G.IsClique (K' : Set V) → K ⊆ K' → K' = K diff --git a/LeanPool/PaperIVCliqueTree/MaximalBridge.lean b/LeanPool/PaperIVCliqueTree/MaximalBridge.lean index 2d5706662d..6b673458ec 100644 --- a/LeanPool/PaperIVCliqueTree/MaximalBridge.lean +++ b/LeanPool/PaperIVCliqueTree/MaximalBridge.lean @@ -29,7 +29,7 @@ Two complements to `CliqueTree/Maximal.lean`. * `SimpleGraph.IsChordal.card_maximalCliques_le` -/ -@[expose] public section +public section namespace SimpleGraph diff --git a/LeanPool/PaperIVCliqueTree/PEO.lean b/LeanPool/PaperIVCliqueTree/PEO.lean index b811a99bb9..b9dbec5128 100644 --- a/LeanPool/PaperIVCliqueTree/PEO.lean +++ b/LeanPool/PaperIVCliqueTree/PEO.lean @@ -34,7 +34,7 @@ in the sense of `SimpleGraph.CliqueTree`, with parent of `v` the earliest later exactly once, to its earlier endpoint -/ -@[expose] public section +public section namespace SimpleGraph @@ -265,6 +265,7 @@ theorem mem_peoBag_peoParent {v w : V} (hw : w ∈ peoBag G ord v) (hne : w ≠ /-- **The clique-bag decomposition of a perfect elimination order is a clique tree.** No maximality of the bags is required. -/ +@[expose] noncomputable def cliqueTree : CliqueTree G V where bag := peoBag G ord parent := peoParent G ord diff --git a/LeanPool/PaperIVCliqueTree/Separator.lean b/LeanPool/PaperIVCliqueTree/Separator.lean index 8209a0d1a5..0c3887a34c 100644 --- a/LeanPool/PaperIVCliqueTree/Separator.lean +++ b/LeanPool/PaperIVCliqueTree/Separator.lean @@ -31,7 +31,7 @@ a clique tree with repeated maximal bags, and graph. -/ -@[expose] public section +public section namespace SimpleGraph diff --git a/LeanPool/PaperIVCliqueTree/SubtreeHelly.lean b/LeanPool/PaperIVCliqueTree/SubtreeHelly.lean index bd2848f98a..462d2604a9 100644 --- a/LeanPool/PaperIVCliqueTree/SubtreeHelly.lean +++ b/LeanPool/PaperIVCliqueTree/SubtreeHelly.lean @@ -15,7 +15,7 @@ The proof removes a leaf. Unless one member is that singleton, every member survives removal; two members meeting only at the leaf also contain its neighbour. -/ -@[expose] public section +public section namespace SimpleGraph diff --git a/LeanPool/PaperIVCliqueTree/SubtreeRepresentation.lean b/LeanPool/PaperIVCliqueTree/SubtreeRepresentation.lean index a00d58eb0e..34a16f3ab6 100644 --- a/LeanPool/PaperIVCliqueTree/SubtreeRepresentation.lean +++ b/LeanPool/PaperIVCliqueTree/SubtreeRepresentation.lean @@ -18,7 +18,7 @@ This constructor uses one extra host node; it does not claim a minimal or maximal-clique-indexed host tree. -/ -@[expose] public section +public section namespace SimpleGraph diff --git a/LeanPool/PaperIVCliqueTree/TreeDecomposition.lean b/LeanPool/PaperIVCliqueTree/TreeDecomposition.lean index a96538128d..7467af4503 100644 --- a/LeanPool/PaperIVCliqueTree/TreeDecomposition.lean +++ b/LeanPool/PaperIVCliqueTree/TreeDecomposition.lean @@ -20,18 +20,20 @@ The target interface fixes its node universe to `Type`, so the adapter uses finite node types in that universe. Graph vertices may live in any universe. -/ -@[expose] public section +public section namespace SimpleGraph.CliqueTree variable {V : Type*} {ι : Type} {G : SimpleGraph V} (T : G.CliqueTree ι) /-- Extend the original bags by an empty bag at the connector. -/ +@[expose] def connectorBag : Option ι → Finset V | none => ∅ | some i => T.bag i /-- The subtree induced by bags containing a fixed vertex. -/ +@[expose] def vertexBagGraph (v : V) : SimpleGraph {x : Option ι // v ∈ T.connectorBag x} := T.connectorGraph.induce {x | v ∈ T.connectorBag x} @@ -63,6 +65,7 @@ theorem vertexBagGraph_connected (v : V) : (T.vertexBagGraph v).Connected := by /-- Convert a finite rooted clique forest into the existing tree-decomposition interface, preserving original bags and adding only an empty connector bag. -/ +@[expose] noncomputable def toTreeDecomposition [Fintype ι] : Utilities.Treewidth.TreeDecomposition G := by classical diff --git a/LeanPool/PaperIVCliqueTree/TreewidthExact.lean b/LeanPool/PaperIVCliqueTree/TreewidthExact.lean index 7c231bb899..3ef72c4bef 100644 --- a/LeanPool/PaperIVCliqueTree/TreewidthExact.lean +++ b/LeanPool/PaperIVCliqueTree/TreewidthExact.lean @@ -18,7 +18,7 @@ gives the universal clique lower bound; the clique-forest adapter attains it for finite chordal graphs. The successor form excludes the empty vertex type. -/ -@[expose] public section +public section namespace Utilities.Treewidth diff --git a/LeanPool/ParameterFreeGradient/O3/AboveTwo.lean b/LeanPool/ParameterFreeGradient/O3/AboveTwo.lean index 9f24c1c21a..012135149b 100644 --- a/LeanPool/ParameterFreeGradient/O3/AboveTwo.lean +++ b/LeanPool/ParameterFreeGradient/O3/AboveTwo.lean @@ -24,14 +24,14 @@ derive both the estimate-sequence ledger and the restart gap/distance implication. This module does not replace it with a target-shaped assumption. -/ -@[expose] public section +public section open scoped BigOperators namespace O3 /-- The genuine-real regime from TeX Section 3. -/ -def AboveTwoRegime (p : ℝ) : Prop := 2 < p +@[expose] def AboveTwoRegime (p : ℝ) : Prop := 2 < p /-- The exact trial exponent `2(p-1)/(p+2)`. -/ noncomputable def aboveAlpha (p : ℝ) : ℝ := 2 * (p - 1) / (p + 2) diff --git a/LeanPool/ParameterFreeGradient/O3/Anchor.lean b/LeanPool/ParameterFreeGradient/O3/Anchor.lean index c86fe23ddb..1d3e1c6f71 100644 --- a/LeanPool/ParameterFreeGradient/O3/Anchor.lean +++ b/LeanPool/ParameterFreeGradient/O3/Anchor.lean @@ -16,16 +16,16 @@ finite-dimensional `ell_p/ell_q` Hölder geometry. It deliberately does not postulate termination or an accepted trace as data. -/ -@[expose] public section +public section namespace O3 /-- The exact `ell_p → ell_q` Lipschitz-gradient hypothesis. -/ -def LipschitzGradient {d : ℕ} (p q L : ℝ) (grad : Point d → Point d) : Prop := +@[expose] def LipschitzGradient {d : ℕ} (p q L : ℝ) (grad : Point d → Point d) : Prop := ∀ x y, lpNorm q (grad x - grad y) ≤ L * lpNorm p (x - y) /-- The supplied nondegenerate secant scale. -/ -noncomputable def secantScale {d : ℕ} (p q : ℝ) (grad : Point d → Point d) +@[expose] noncomputable def secantScale {d : ℕ} (p q : ℝ) (grad : Point d → Point d) (x₀ z₀ : Point d) : ℝ := lpNorm q (grad z₀ - grad x₀) / lpNorm p (z₀ - x₀) @@ -49,11 +49,11 @@ theorem secantScale_le {d : ℕ} {p q L : ℝ} /-- A first-order convexity inequality, kept explicit so that no ambient Euclidean norm silently replaces the frozen `ell_p` geometry. -/ -def FirstOrderConvex {d : ℕ} (f : Point d → ℝ) (grad : Point d → Point d) : Prop := +@[expose] def FirstOrderConvex {d : ℕ} (f : Point d → ℝ) (grad : Point d → Point d) : Prop := ∀ x y, f x + pairing (grad x) (y - x) ≤ f y /-- The observable anchor test at distance `D`. -/ -def AnchorTest {d : ℕ} (f : Point d → ℝ) (x₀ : Point d) (G D : ℝ) +@[expose] def AnchorTest {d : ℕ} (f : Point d → ℝ) (x₀ : Point d) (G D : ℝ) (y : Point d) : Prop := f y ≤ f x₀ - G * D / 2 @@ -89,21 +89,21 @@ theorem anchorAccepted_radius {d : ℕ} {p : ℝ} (hp : 1 < p) nlinarith /-- The explicit coordinate norming direction used by the frozen anchor. -/ -noncomputable def anchorNormingVector {d : ℕ} (q : ℝ) (g : Vec d) : Vec d := +@[expose] noncomputable def anchorNormingVector {d : ℕ} (q : ℝ) (g : Vec d) : Vec d := fun i => ((SignType.sign (g i) : ℝ) * |g i| ^ (q - 1)) / (lpNorm q g) ^ (q - 1) /-- Dyadic curvature scale `2^epoch M₀`. -/ -noncomputable def anchorScale (M₀ : ℝ) (epoch : ℕ) : ℝ := +@[expose] noncomputable def anchorScale (M₀ : ℝ) (epoch : ℕ) : ℝ := (2 : ℝ) ^ epoch * M₀ /-- Exact radius tested at one dyadic scale. -/ -noncomputable def anchorRadius (G M₀ : ℝ) (epoch : ℕ) : ℝ := +@[expose] noncomputable def anchorRadius (G M₀ : ℝ) (epoch : ℕ) : ℝ := G / anchorScale M₀ epoch /-- Exact gradient-ray point queried at one dyadic scale. -/ -noncomputable def anchorProbePoint {d : ℕ} (q : ℝ) (x₀ g₀ : Vec d) +@[expose] noncomputable def anchorProbePoint {d : ℕ} (q : ℝ) (x₀ g₀ : Vec d) (G M₀ : ℝ) (epoch : ℕ) : Vec d := x₀ - anchorRadius G M₀ epoch • anchorNormingVector q g₀ @@ -140,7 +140,7 @@ The actual fuel-bounded dyadic anchor loop. Every iteration makes exactly one pair-oracle query, tests its returned value, and either stops or doubles the scale by incrementing `epoch`. -/ -noncomputable def runAnchor {d : ℕ} (oracle : PairOracle d) (cfg : AnchorConfig d) : +@[expose] noncomputable def runAnchor {d : ℕ} (oracle : PairOracle d) (cfg : AnchorConfig d) : ℕ → ℕ → OracleTrace d → Option (AnchorResult d) | 0, _, _ => none | fuel + 1, epoch, history => @@ -176,7 +176,7 @@ theorem exists_anchor_scale_ge {M₀ L : ℝ} (hM₀ : 0 < M₀) : exact hepoch.le /-- First dyadic scale which dominates `L`; this is proof-side, not method input. -/ -noncomputable def anchorScaleCap (M₀ L : ℝ) (hM₀ : 0 < M₀) : ℕ := +@[expose] noncomputable def anchorScaleCap (M₀ L : ℝ) (hM₀ : 0 < M₀) : ℕ := Nat.find (exists_anchor_scale_ge (L := L) hM₀) theorem anchorScaleCap_dominates {M₀ L : ℝ} (hM₀ : 0 < M₀) : diff --git a/LeanPool/ParameterFreeGradient/O3/BelowTwo.lean b/LeanPool/ParameterFreeGradient/O3/BelowTwo.lean index f894dc34b3..60ceeef735 100644 --- a/LeanPool/ParameterFreeGradient/O3/BelowTwo.lean +++ b/LeanPool/ParameterFreeGradient/O3/BelowTwo.lean @@ -23,7 +23,7 @@ result load-bearingly. No conditional replacement taking the desired strong-convexity conclusion as an extra hypothesis is introduced. -/ -@[expose] public section +public section namespace O3 @@ -134,7 +134,7 @@ The accepted estimate-sequence weight `A_N`. This recursive definition is exactly `A_0 = 0`, `A_1 = 1/M`, and `A_(k+1) = A_k/(1-tau)` for `k >= 1`. -/ -noncomputable def belowWeight (M tau : ℝ) : ℕ → ℝ +@[expose] noncomputable def belowWeight (M tau : ℝ) : ℕ → ℝ | 0 => 0 | n + 1 => if n = 0 then 1 / M else belowWeight M tau n / (1 - tau) diff --git a/LeanPool/ParameterFreeGradient/O3/Controller.lean b/LeanPool/ParameterFreeGradient/O3/Controller.lean index 4201c17be3..9e9ebbfa1f 100644 --- a/LeanPool/ParameterFreeGradient/O3/Controller.lean +++ b/LeanPool/ParameterFreeGradient/O3/Controller.lean @@ -19,7 +19,7 @@ from the local-trial obligations and finite numerical search caps; it is not a field of the controller state or of a certificate. -/ -@[expose] public section +public section namespace O3 @@ -35,10 +35,12 @@ structure ControllerConfig where prefixCalls : ℕ /-- The scale estimate after the specified number of dyadic doublings. -/ +@[expose] def ControllerConfig.scaleAt (cfg : ControllerConfig) (s : ℕ) : ℝ := (2 : ℝ) ^ s * cfg.initialScale /-- The radius at a given scale epoch and radius-doubling level. -/ +@[expose] noncomputable def ControllerConfig.radiusAt (cfg : ControllerConfig) (s j : ℕ) : ℝ := (2 : ℝ) ^ j * cfg.gradientSizeAtStart / cfg.scaleAt s diff --git a/LeanPool/ParameterFreeGradient/O3/Euclidean.lean b/LeanPool/ParameterFreeGradient/O3/Euclidean.lean index cff03e4f60..19c72d24e9 100644 --- a/LeanPool/ParameterFreeGradient/O3/Euclidean.lean +++ b/LeanPool/ParameterFreeGradient/O3/Euclidean.lean @@ -17,12 +17,12 @@ identities. It deliberately does not turn either load-bearing identity into a certificate field. -/ -@[expose] public section +public section namespace O3 /-- The positive quadratic root used to update the Euclidean acceleration weight. -/ -noncomputable def euclideanWeight (A : ℝ) : ℝ := +@[expose] noncomputable def euclideanWeight (A : ℝ) : ℝ := (1 + Real.sqrt (1 + 4 * A)) / 2 theorem euclideanWeight_pos {A : ℝ} (hA : 0 ≤ A) : 0 < euclideanWeight A := by @@ -37,11 +37,11 @@ theorem euclideanWeight_equation {A : ℝ} (hA : 0 ≤ A) : nlinarith /-- The standard accelerated theta update with discriminant `1 + 4 t²`. -/ -noncomputable def thetaStep (t : ℝ) : ℝ := +@[expose] noncomputable def thetaStep (t : ℝ) : ℝ := (1 + Real.sqrt (1 + 4 * t ^ 2)) / 2 /-- The modified terminal theta update with discriminant `1 + 8 t²`. -/ -noncomputable def thetaZeroStep (t : ℝ) : ℝ := +@[expose] noncomputable def thetaZeroStep (t : ℝ) : ℝ := (1 + Real.sqrt (1 + 8 * t ^ 2)) / 2 theorem thetaStep_pos (t : ℝ) : 0 < thetaStep t := by @@ -79,7 +79,7 @@ noncomputable def ogmgTheta (n : ℕ) : Fin (n + 1) → ℝ := fun i => else Nat.rec (motive := fun _ => ℝ) 1 (fun _ t => thetaStep t) (n - i.val) /-- The ordinary backward tail `theta_n=1`, iterated away from the endpoint. -/ -noncomputable def ogmgThetaTail : ℕ → ℝ +@[expose] noncomputable def ogmgThetaTail : ℕ → ℝ | 0 => 1 | k + 1 => thetaStep (ogmgThetaTail k) @@ -100,7 +100,7 @@ theorem ogmgThetaTail_ge (k : ℕ) : linarith /-- The special doubled first coefficient of the OGM-G certificate. -/ -noncomputable def ogmgThetaZero (n : ℕ) : ℝ := +@[expose] noncomputable def ogmgThetaZero (n : ℕ) : ℝ := thetaZeroStep (ogmgThetaTail (n - 1)) theorem thetaZeroStep_ge_sqrtTwo_mul {t : ℝ} (_ht : 0 ≤ t) : @@ -140,6 +140,7 @@ theorem ogmgThetaZero_ge {n : ℕ} (hn : 1 ≤ n) : /-- Exact number of pair calls in the source's Euclidean trial: Phase A makes at most two calls per iteration, Phase B reuses `U`, makes `n` further iterate queries, and makes one terminal descent query. -/ +@[expose] def euclideanTrialCallBudget (m n : ℕ) : ℕ := 2 * m + n + 1 theorem euclideanTrialCallBudget_diagonal (n : ℕ) : @@ -148,7 +149,7 @@ theorem euclideanTrialCallBudget_diagonal (n : ℕ) : omega /-- The source horizon `ceil (2 sqrt (M D / eps))`. -/ -noncomputable def euclideanHorizon (kappa : ℝ) : ℕ := +@[expose] noncomputable def euclideanHorizon (kappa : ℝ) : ℕ := Nat.ceil (2 * Real.sqrt kappa) theorem euclideanHorizon_real_le {kappa : ℝ} : @@ -192,7 +193,7 @@ theorem euclideanPhaseTrace_exact {d m : ℕ} (oracle : PairOracle d) Phase B reuses `U`; this trace therefore contains only the `n` newly queried iterates `u_1,...,u_n` and the additional terminal query at `v_n`. -/ -def finiteDataOGMGTrace {d n : ℕ} (oracle : PairOracle d) +@[expose] def finiteDataOGMGTrace {d n : ℕ} (oracle : PairOracle d) (newIterates : Fin n → Vec d) (terminalDescent : Vec d) : OracleTrace d := (List.finRange n).map (fun i => oracle.observe (newIterates i)) ++ [oracle.observe terminalDescent] @@ -251,6 +252,7 @@ theorem finiteDataOGMGTrace_final_iterate_queried {d n : ℕ} exact ⟨last, List.mem_finRange last, rfl⟩ /-- Scalar denominator step used at the end of the guarded Euclidean-gap proof. -/ +@[expose] noncomputable def EuclideanGapScalarStatement : Prop := ∀ (M D fGap A : ℝ) (m : ℕ), 0 < M → 0 ≤ D → 1 ≤ m → diff --git a/LeanPool/ParameterFreeGradient/O3/Foundation.lean b/LeanPool/ParameterFreeGradient/O3/Foundation.lean index ae5b9cbf86..e5d6662529 100644 --- a/LeanPool/ParameterFreeGradient/O3/Foundation.lean +++ b/LeanPool/ParameterFreeGradient/O3/Foundation.lean @@ -19,7 +19,7 @@ machine. In particular, a method can obtain objective information only by a and an optimizer are not fields of `MethodInput`. -/ -@[expose] public section +public section namespace O3 @@ -43,7 +43,7 @@ structure Observation (d : ℕ) where gradient : Vec d /-- Package a query point with its exact objective value and gradient. -/ -def PairOracle.observe {d : ℕ} (oracle : PairOracle d) (x : Vec d) : Observation d := +@[expose] def PairOracle.observe {d : ℕ} (oracle : PairOracle d) (x : Vec d) : Observation d := ⟨x, oracle.value x, oracle.gradient x⟩ /-- The only numerical/problem data supplied to the O3 state machine. -/ @@ -85,7 +85,7 @@ structure RunResult (d : ℕ) where queries : List (Observation d) /-- Execute at most the given number of machine steps while accumulating query responses. -/ -def FirstOrderMethod.runFuel {d : ℕ} (method : FirstOrderMethod d) +@[expose] def FirstOrderMethod.runFuel {d : ℕ} (method : FirstOrderMethod d) (oracle : PairOracle d) : ℕ → method.State → List (Observation d) → Option (RunResult d) | 0, _, _ => none | fuel + 1, state, history => @@ -96,43 +96,43 @@ def FirstOrderMethod.runFuel {d : ℕ} (method : FirstOrderMethod d) method.runFuel oracle fuel (next obs) (history ++ [obs]) /-- Run a first-order method from its initial state with an empty query history. -/ -def FirstOrderMethod.run {d : ℕ} (method : FirstOrderMethod d) +@[expose] def FirstOrderMethod.run {d : ℕ} (method : FirstOrderMethod d) (oracle : PairOracle d) (input : MethodInput d) (fuel : ℕ) : Option (RunResult d) := method.runFuel oracle fuel (method.initial input) [] /-- The number of oracle responses in a completed run. -/ -def RunResult.callCount {d : ℕ} (result : RunResult d) : ℕ := result.queries.length +@[expose] def RunResult.callCount {d : ℕ} (result : RunResult d) : ℕ := result.queries.length /-- The returned point really was queried; a bare unobserved terminal point is not enough for the frozen theorem. -/ -def RunResult.returnedWasQueried {d : ℕ} (result : RunResult d) : Prop := +@[expose] def RunResult.returnedWasQueried {d : ℕ} (result : RunResult d) : Prop := result.returned ∈ result.queries.map Observation.point /-- The coordinate gradient represents the Frechet derivative. The ambient norm used by Mathlib for differentiability is immaterial in finite dimension. -/ -def IsCoordinateGradient {d : ℕ} (f : Vec d → ℝ) (grad : Vec d → Vec d) : Prop := +@[expose] def IsCoordinateGradient {d : ℕ} (f : Vec d → ℝ) (grad : Vec d → Vec d) : Prop := ∀ x, DifferentiableAt ℝ f x ∧ ∀ h, fderiv ℝ f x h = pairing (grad x) h /-- The set of global minimizers of the objective function. -/ -def MinimizerSet {d : ℕ} (f : Vec d → ℝ) : Set (Vec d) := +@[expose] def MinimizerSet {d : ℕ} (f : Vec d → ℝ) : Set (Vec d) := {x | ∀ y, f x ≤ f y} /-- The exact source-level `ℓ_p` distance to the nonempty minimizer set. -/ -noncomputable def minimizerDistance {d : ℕ} (p : ℝ) (f : Vec d → ℝ) (x0 : Vec d) : ℝ := +@[expose] noncomputable def minimizerDistance {d : ℕ} (p : ℝ) (f : Vec d → ℝ) (x0 : Vec d) : ℝ := sInf ((fun x => lpNorm p (x - x0)) '' MinimizerSet f) /-- The gradient is Lipschitz from the primal `ℓ_p` norm to the specified dual norm. -/ -def IsLpSmooth {d : ℕ} (p q L : ℝ) (grad : Vec d → Vec d) : Prop := +@[expose] def IsLpSmooth {d : ℕ} (p q L : ℝ) (grad : Vec d → Vec d) : Prop := ∀ x y, lpNorm q (grad x - grad y) ≤ L * lpNorm p (x - y) /-- Exact nondegenerate secant initialization and its observable scale. -/ -def SecantWitness {d : ℕ} (p q M0 : ℝ) (grad : Vec d → Vec d) +@[expose] def SecantWitness {d : ℕ} (p q M0 : ℝ) (grad : Vec d → Vec d) (x0 z0 : Vec d) : Prop := z0 ≠ x0 ∧ grad z0 ≠ grad x0 ∧ M0 = lpNorm q (grad z0 - grad x0) / lpNorm p (z0 - x0) ∧ 0 < M0 /-- Exact convexity hypothesis from the frozen source. -/ -def IsConvexObjective {d : ℕ} (f : Vec d → ℝ) : Prop := ConvexOn ℝ Set.univ f +@[expose] def IsConvexObjective {d : ℕ} (f : Vec d → ℝ) : Prop := ConvexOn ℝ Set.univ f /-- One complete admissible instance. The algorithm never receives this structure; it is used only by the correctness theorem. -/ @@ -161,23 +161,26 @@ structure AdmissibleInstance (d : ℕ) (p : ℝ) where secant : SecantWitness p (conjugateExponent p) M0 grad x0 z0 /-- The exact value-gradient oracle associated with an admissible instance. -/ +@[expose] def AdmissibleInstance.oracle {d : ℕ} {p : ℝ} (P : AdmissibleInstance d p) : PairOracle d := ⟨P.f, P.grad⟩ /-- Extract the observable numerical inputs supplied to the method. -/ +@[expose] def AdmissibleInstance.methodInput {d : ℕ} {p : ℝ} (P : AdmissibleInstance d p) : MethodInput d := ⟨p, P.eps, P.x0, P.z0, P.M0⟩ /-- The primal-norm distance from the initial point to the minimizer set. -/ +@[expose] noncomputable def AdmissibleInstance.radius {d : ℕ} {p : ℝ} (P : AdmissibleInstance d p) : ℝ := minimizerDistance p P.f P.x0 /-- The dimensionless quantity `L R / ε` governing the complexity bounds. -/ -noncomputable def AdmissibleInstance.condition {d : ℕ} {p : ℝ} +@[expose] noncomputable def AdmissibleInstance.condition {d : ℕ} {p : ℝ} (P : AdmissibleInstance d p) : ℝ := P.L * P.radius / P.eps /-- The condition quantity truncated below at one. -/ -noncomputable def AdmissibleInstance.conditionBar {d : ℕ} {p : ℝ} +@[expose] noncomputable def AdmissibleInstance.conditionBar {d : ℕ} {p : ℝ} (P : AdmissibleInstance d p) : ℝ := max 1 P.condition /-- The returned point's gradient satisfies the prescribed dual-norm tolerance. -/ diff --git a/LeanPool/ParameterFreeGradient/O3/Geometry.lean b/LeanPool/ParameterFreeGradient/O3/Geometry.lean index 852e3f6c61..cd6c4c1d6b 100644 --- a/LeanPool/ParameterFreeGradient/O3/Geometry.lean +++ b/LeanPool/ParameterFreeGradient/O3/Geometry.lean @@ -16,7 +16,7 @@ number. We use the literal finite-sum formula from the TeX source rather than the ambient Euclidean norm on `Fin d → ℝ`. -/ -@[expose] public section +public section open scoped BigOperators @@ -26,10 +26,10 @@ namespace O3 abbrev Point (d : ℕ) := Fin d → ℝ /-- The coordinate pairing used between `ell_p` and `ell_q`. -/ -def pairing {d : ℕ} (x y : Point d) : ℝ := ∑ i, x i * y i +@[expose] def pairing {d : ℕ} (x y : Point d) : ℝ := ∑ i, x i * y i /-- The real conjugate exponent `q = p / (p - 1)`. -/ -noncomputable def conjugateExponent (p : ℝ) : ℝ := Real.conjExponent p +@[expose] noncomputable def conjugateExponent (p : ℝ) : ℝ := Real.conjExponent p theorem conjugateExponent_eq (p : ℝ) : conjugateExponent p = p / (p - 1) := rfl @@ -42,10 +42,10 @@ theorem one_lt_conjugateExponent {p : ℝ} (hp : 1 < p) : exact (holderConjugate_conjugateExponent hp).symm.lt /-- The `p`-th power sum underlying the finite-dimensional `ell_p` norm. -/ -noncomputable def lpPower (p : ℝ) {d : ℕ} (x : Point d) : ℝ := ∑ i, |x i| ^ p +@[expose] noncomputable def lpPower (p : ℝ) {d : ℕ} (x : Point d) : ℝ := ∑ i, |x i| ^ p /-- The literal finite-dimensional `ell_p` norm for a real exponent. -/ -noncomputable def lpNorm (p : ℝ) {d : ℕ} (x : Point d) : ℝ := (lpPower p x) ^ (1 / p) +@[expose] noncomputable def lpNorm (p : ℝ) {d : ℕ} (x : Point d) : ℝ := (lpPower p x) ^ (1 / p) theorem lpPower_nonneg (p : ℝ) {d : ℕ} (x : Point d) : 0 ≤ lpPower p x := by exact Finset.sum_nonneg fun i _ ↦ Real.rpow_nonneg (abs_nonneg (x i)) p @@ -129,26 +129,26 @@ theorem abs_pairing_le_lpNorm_mul {p q : ℝ} (hpq : p.HolderConjugate q) · exact pairing_le_lpNorm_mul hpq x y /-- The power-duality map `J_p(u)_i = |u_i|^(p-2) u_i` from the TeX source. -/ -noncomputable def powerDualityMap (p : ℝ) {d : ℕ} (u : Point d) : Point d := +@[expose] noncomputable def powerDualityMap (p : ℝ) {d : ℕ} (u : Point d) : Point d := fun i ↦ |u i| ^ (p - 2) * u i /-- `h_c(x) = (1/p) ||x-c||_p^p`, written using its literal power sum. -/ -noncomputable def uniformRegularizer (p : ℝ) {d : ℕ} (c x : Point d) : ℝ := +@[expose] noncomputable def uniformRegularizer (p : ℝ) {d : ℕ} (c x : Point d) : ℝ := (1 / p) * lpPower p (x - c) /-- The normalized `ell_p` duality map used in the `1 < p ≤ 2` chain. -/ -noncomputable def dualityMap (p : ℝ) {d : ℕ} (u : Point d) : Point d := +@[expose] noncomputable def dualityMap (p : ℝ) {d : ℕ} (u : Point d) : Point d := if lpNorm p u = 0 then 0 else fun i ↦ (lpNorm p u) ^ (2 - p) * (|u i| ^ (p - 2) * u i) /-- `ψ_c(x) = (1/2) ||x-c||_p^2`. -/ -noncomputable def quadraticRegularizer (p : ℝ) {d : ℕ} (c x : Point d) : ℝ := +@[expose] noncomputable def quadraticRegularizer (p : ℝ) {d : ℕ} (c x : Point d) : ℝ := (1 / 2 : ℝ) * (lpNorm p (x - c)) ^ (2 : ℕ) /-- Exact unproved target of TeX Lemma `lem:puniform`. Keeping this as a transparent proposition records the residual obligation without presenting it as a proved theorem. -/ -noncomputable def PUniformConvexityStatement : Prop := +@[expose] noncomputable def PUniformConvexityStatement : Prop := ∀ (p : ℝ), 2 < p → ∀ (d : ℕ) (x y c : Point d), uniformRegularizer p c y ≥ uniformRegularizer p c x + pairing (powerDualityMap p (x - c)) (y - x) + @@ -156,7 +156,7 @@ noncomputable def PUniformConvexityStatement : Prop := /-- Exact unproved target of TeX Lemma `lem:belowgeometry`. This proposition preserves real `p` and arbitrary `d`; it is not a theorem or certificate. -/ -noncomputable def BelowGeometryStatement : Prop := +@[expose] noncomputable def BelowGeometryStatement : Prop := ∀ (p : ℝ), 1 < p → p ≤ 2 → ∀ (d : ℕ) (x y : Point d), quadraticRegularizer p 0 y ≥ quadraticRegularizer p 0 x + pairing (dualityMap p x) (y - x) + diff --git a/LeanPool/ParameterFreeGradient/O3/GeometryExperimental.lean b/LeanPool/ParameterFreeGradient/O3/GeometryExperimental.lean index 7000ab5e07..1cd903d992 100644 --- a/LeanPool/ParameterFreeGradient/O3/GeometryExperimental.lean +++ b/LeanPool/ParameterFreeGradient/O3/GeometryExperimental.lean @@ -15,12 +15,12 @@ public import LeanPool.ParameterFreeGradient.O3.Geometry Scalar and vector uniform convexity for the power mirror geometry. -/ -@[expose] public section +public section namespace O3.Experimental /-- The scalar power-duality map `u ↦ |u|^(p - 2) u`. -/ -noncomputable def scalarJ (p u : ℝ) : ℝ := |u| ^ (p - 2) * u +@[expose] noncomputable def scalarJ (p u : ℝ) : ℝ := |u| ^ (p - 2) * u lemma scalarJ_nonneg {p u : ℝ} (hp : 2 < p) (hu : 0 ≤ u) : scalarJ p u = u ^ (p - 1) := by diff --git a/LeanPool/ParameterFreeGradient/O3/Oracle.lean b/LeanPool/ParameterFreeGradient/O3/Oracle.lean index fe63d42882..0936d1d124 100644 --- a/LeanPool/ParameterFreeGradient/O3/Oracle.lean +++ b/LeanPool/ParameterFreeGradient/O3/Oracle.lean @@ -19,7 +19,7 @@ Those properties live in the separate proposition `TrialValid` and must be proved by the regime-specific trial modules. -/ -@[expose] public section +public section namespace O3 @@ -30,11 +30,11 @@ abbrev OracleTrace (d : ℕ) := List (Observation d) def oracleCallCount (trace : OracleTrace d) : ℕ := trace.length /-- Every recorded observation is the exact answer returned at its point. -/ -def TraceExact (oracle : PairOracle d) (trace : OracleTrace d) : Prop := +@[expose] def TraceExact (oracle : PairOracle d) (trace : OracleTrace d) : Prop := ∀ o ∈ trace, o = oracle.observe o.point /-- A point was actually queried in the given trace. -/ -def WasQueried (trace : OracleTrace d) (x : Vec d) : Prop := +@[expose] def WasQueried (trace : OracleTrace d) (x : Vec d) : Prop := ∃ o ∈ trace, o.point = x theorem traceExact_nil (oracle : PairOracle d) : @@ -71,9 +71,10 @@ structure GuardCheck where margin : ℝ /-- The guard's inequality holds exactly when its signed margin is nonnegative. -/ -def GuardCheck.Holds (check : GuardCheck) : Prop := 0 ≤ check.margin +@[expose] def GuardCheck.Holds (check : GuardCheck) : Prop := 0 ≤ check.margin /-- Margin for `f(y) ≤ f(x) + linear + (M/2) * stepSq`. -/ +@[expose] noncomputable def upperModelGuard (fx fy linear stepSq M : ℝ) : GuardCheck := { kind := .upperModel margin := fx + linear + (M / 2) * stepSq - fy } @@ -87,7 +88,7 @@ def gradientGuard (gradDiff stepNorm M : ℝ) : GuardCheck := Margin for the ordered Euclidean finite-data interpolation guard `f_i-f_j-pairing-(2M)^{-1} gradDiffSq ≥ 0`. -/ -noncomputable def interpolationGuard +@[expose] noncomputable def interpolationGuard (fi fj pairing gradDiffSq M : ℝ) : GuardCheck := { kind := .interpolation margin := fi - fj - pairing - gradDiffSq / (2 * M) } @@ -108,7 +109,7 @@ theorem interpolationGuard_holds_iff (fi fj pairing gradDiffSq M : ℝ) : rfl /-- Every guard recorded in the list has a nonnegative margin. -/ -def allGuardsPass (guards : List GuardCheck) : Prop := +@[expose] def allGuardsPass (guards : List GuardCheck) : Prop := ∀ check ∈ guards, check.Holds /-- The list contains a failed guard of the specified kind. -/ @@ -138,7 +139,7 @@ def TrialReport.calls (report : TrialReport d) : ℕ := oracleCallCount report.observations /-- Purely data-level consistency of the recorded outcome. -/ -def TrialReport.OutcomeRecorded (report : TrialReport d) : Prop := +@[expose] def TrialReport.OutcomeRecorded (report : TrialReport d) : Prop := match report.outcome with | .success x => WasQueried report.observations x | .scale kind => HasFailedGuard report.guards kind @@ -150,7 +151,7 @@ proposition, not a certificate field. The scale and radius conclusions are exactly the directional implications used by the frozen outer-controller lemma. -/ -def TrialValid +@[expose] def TrialValid (oracle : PairOracle d) (gradientSize : Vec d → ℝ) (eps L R M D : ℝ) (report : TrialReport d) : Prop := TraceExact oracle report.observations ∧ diff --git a/LeanPool/ParameterFreeGradient/O3/Stage10EuclideanGuards.lean b/LeanPool/ParameterFreeGradient/O3/Stage10EuclideanGuards.lean index a8e3550b87..0d4a9a3f54 100644 --- a/LeanPool/ParameterFreeGradient/O3/Stage10EuclideanGuards.lean +++ b/LeanPool/ParameterFreeGradient/O3/Stage10EuclideanGuards.lean @@ -18,7 +18,7 @@ inequality is derived from convexity and the exact `L/2` descent lemma; it is not assumed as a certificate. -/ -@[expose] public section +public section namespace O3 diff --git a/LeanPool/ParameterFreeGradient/O3/Stage11Amortization.lean b/LeanPool/ParameterFreeGradient/O3/Stage11Amortization.lean index aa7e0dbf3d..f8beb545de 100644 --- a/LeanPool/ParameterFreeGradient/O3/Stage11Amortization.lean +++ b/LeanPool/ParameterFreeGradient/O3/Stage11Amortization.lean @@ -18,7 +18,7 @@ scale. In particular no estimate of the form "number of trials times the last trial" occurs. -/ -@[expose] public section +public section namespace O3 @@ -90,11 +90,11 @@ theorem scale_geometric_sum_le_endpoint {a k0 : ℝ} radius_geometric_sum_le_endpoint ha hk0 S /-- The square-root cost weight used in the Euclidean controller analysis. -/ -noncomputable def euclideanWrapperWeight (x : ℝ) : ℝ := Real.sqrt x +@[expose] noncomputable def euclideanWrapperWeight (x : ℝ) : ℝ := Real.sqrt x /-- The power-law cost weight used for exponents above two. -/ -noncomputable def aboveWrapperWeight (a x : ℝ) : ℝ := x ^ a +@[expose] noncomputable def aboveWrapperWeight (a x : ℝ) : ℝ := x ^ a /-- The square-root logarithmic cost weight used for exponents below two. -/ -noncomputable def belowWrapperWeight (x : ℝ) : ℝ := +@[expose] noncomputable def belowWrapperWeight (x : ℝ) : ℝ := Real.sqrt x * Real.log (Real.exp 1 + x) end O3 diff --git a/LeanPool/ParameterFreeGradient/O3/Stage11RConditionBar.lean b/LeanPool/ParameterFreeGradient/O3/Stage11RConditionBar.lean index 24d86862b1..d88e86dc9c 100644 --- a/LeanPool/ParameterFreeGradient/O3/Stage11RConditionBar.lean +++ b/LeanPool/ParameterFreeGradient/O3/Stage11RConditionBar.lean @@ -18,7 +18,7 @@ the executable controller amortization to `conditionBar = max 1 condition`. The constants are explicit and independent of the problem instance. -/ -@[expose] public section +public section namespace O3 diff --git a/LeanPool/ParameterFreeGradient/O3/Stage12AAnchorMachine.lean b/LeanPool/ParameterFreeGradient/O3/Stage12AAnchorMachine.lean index c86fe79a45..648da7c539 100644 --- a/LeanPool/ParameterFreeGradient/O3/Stage12AAnchorMachine.lean +++ b/LeanPool/ParameterFreeGradient/O3/Stage12AAnchorMachine.lean @@ -17,12 +17,13 @@ transition function contains no oracle or admissible instance; objective data enters only through the continuation of `Action.query`. -/ -@[expose] public section +public section namespace O3 /-- Runtime-only anchor configuration reconstructed after the counted query at `x0`. This definition has no proof-side problem parameters. -/ +@[expose] noncomputable def anchorPrefixConfig (input : MethodInput d) (f0 : ℝ) (g0 : Vec d) (G : ℝ) : AnchorConfig d := { q := conjugateExponent input.p @@ -71,7 +72,7 @@ noncomputable def anchorPrefixAction : AnchorPrefixState d → /-- The one dimension-indexed concrete first-order method for the causal prefix. The real exponent is read only from runtime input. -/ -noncomputable def anchorPrefixMethod (d : ℕ) : FirstOrderMethod d where +@[expose] noncomputable def anchorPrefixMethod (d : ℕ) : FirstOrderMethod d where State := AnchorPrefixState d initial := AnchorPrefixState.needX0 action := anchorPrefixAction diff --git a/LeanPool/ParameterFreeGradient/O3/Stage2BelowGeometry.lean b/LeanPool/ParameterFreeGradient/O3/Stage2BelowGeometry.lean index 8b56afdf0b..0d2c9b6051 100644 --- a/LeanPool/ParameterFreeGradient/O3/Stage2BelowGeometry.lean +++ b/LeanPool/ParameterFreeGradient/O3/Stage2BelowGeometry.lean @@ -18,7 +18,7 @@ explicit duality/Fenchel reduction. The exported theorem is the frozen `O3.BelowGeometryStatement` without additional hypotheses. -/ -@[expose] public section +public section namespace O3 namespace Stage2Closure diff --git a/LeanPool/ParameterFreeGradient/O3/Stage2RouteA.lean b/LeanPool/ParameterFreeGradient/O3/Stage2RouteA.lean index 239bf53847..95b16c3998 100644 --- a/LeanPool/ParameterFreeGradient/O3/Stage2RouteA.lean +++ b/LeanPool/ParameterFreeGradient/O3/Stage2RouteA.lean @@ -18,18 +18,18 @@ It deliberately does not export the frozen theorem until the singular-line integration argument is complete. -/ -@[expose] public section +public section open scoped BigOperators namespace O3.Stage2RouteA /-- The power sum along an affine line. -/ -noncomputable def linePower (p : ℝ) {d : ℕ} (x h : Point d) (t : ℝ) : ℝ := +@[expose] noncomputable def linePower (p : ℝ) {d : ℕ} (x h : Point d) (t : ℝ) : ℝ := lpPower p (x + t • h) /-- The directional pairing with the unnormalised power-duality map. -/ -noncomputable def linePowerDerivative (p : ℝ) {d : ℕ} +@[expose] noncomputable def linePowerDerivative (p : ℝ) {d : ℕ} (x h : Point d) (t : ℝ) : ℝ := p * pairing (powerDualityMap p (x + t • h)) h @@ -66,7 +66,7 @@ lemma lpNorm_sq_eq_lpPower_rpow {p : ℝ} (hp : p ≠ 0) {d : ℕ} (z : Point d) field_simp /-- The one-variable restriction of `x ↦ (1/2)‖x‖_p²`. -/ -noncomputable def lineEnergy (p : ℝ) {d : ℕ} (x h : Point d) (t : ℝ) : ℝ := +@[expose] noncomputable def lineEnergy (p : ℝ) {d : ℕ} (x h : Point d) (t : ℝ) : ℝ := (1 / 2 : ℝ) * (linePower p x h t) ^ (2 / p) lemma lineEnergy_eq_quadraticRegularizer {p : ℝ} (hp : p ≠ 0) {d : ℕ} @@ -199,12 +199,12 @@ lemma hasDerivAt_scalarJ_above_two {q u : ℝ} (hq : 2 < q) : · exact hasDerivAt_scalarJ_of_ne_zero hu /-- The weighted quadratic form that appears in the Hessian. -/ -noncomputable def weightedSquareSum (p : ℝ) {d : ℕ} +@[expose] noncomputable def weightedSquareSum (p : ℝ) {d : ℕ} (x h : Point d) (t : ℝ) : ℝ := ∑ i : Fin d, |(x + t • h) i| ^ (p - 2) * (h i) ^ (2 : ℕ) /-- The unnormalised duality pairing along a line. -/ -noncomputable def linePowerPair (p : ℝ) {d : ℕ} +@[expose] noncomputable def linePowerPair (p : ℝ) {d : ℕ} (x h : Point d) (t : ℝ) : ℝ := pairing (powerDualityMap p (x + t • h)) h diff --git a/LeanPool/ParameterFreeGradient/O3/Stage2RouteB.lean b/LeanPool/ParameterFreeGradient/O3/Stage2RouteB.lean index b09ad5732b..992e69152b 100644 --- a/LeanPool/ParameterFreeGradient/O3/Stage2RouteB.lean +++ b/LeanPool/ParameterFreeGradient/O3/Stage2RouteB.lean @@ -19,7 +19,7 @@ explicit finite-dimensional definitions. In particular, it does not assume strong convexity or the frozen target. -/ -@[expose] public section +public section open scoped BigOperators @@ -84,7 +84,7 @@ lemma dualityMap_zero {p : ℝ} (hp : 0 < p) {d : ℕ} : dualityMap p (0 : Point simp [dualityMap, lpNorm_zero hp] /-- The scalar energy written directly in terms of the finite power sum. -/ -noncomputable def squaredLpEnergy (p : ℝ) {d : ℕ} (x : Point d) : ℝ := +@[expose] noncomputable def squaredLpEnergy (p : ℝ) {d : ℕ} (x : Point d) : ℝ := (1 / 2 : ℝ) * (lpPower p x) ^ (2 / p) lemma squaredLpEnergy_eq_quadraticRegularizer {p : ℝ} (_hp : 0 < p) @@ -461,7 +461,7 @@ lemma fenchelYoung_lower {p : ℝ} (hp : 1 < p) {d : ℕ} (w y : Point d) : /-- Exact dual-exponent smoothness interface. This is a reduction interface, not an assumed theorem in the target chain. -/ -noncomputable def ConjugateSmoothnessStatement : Prop := +@[expose] noncomputable def ConjugateSmoothnessStatement : Prop := ∀ (p : ℝ), 1 < p → p ≤ 2 → ∀ (d : ℕ) (u v : Point d), squaredLpEnergy (conjugateExponent p) v ≤ squaredLpEnergy (conjugateExponent p) u + diff --git a/LeanPool/ParameterFreeGradient/O3/Stage2RouteC.lean b/LeanPool/ParameterFreeGradient/O3/Stage2RouteC.lean index 928373dcc6..836e2acdc9 100644 --- a/LeanPool/ParameterFreeGradient/O3/Stage2RouteC.lean +++ b/LeanPool/ParameterFreeGradient/O3/Stage2RouteC.lean @@ -21,7 +21,7 @@ exact quantitative input needed here is therefore recorded explicitly below, but only as a proposition carrier, never as an assumption or an axiom. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ParameterFreeGradient/O3/Stage2RouteD.lean b/LeanPool/ParameterFreeGradient/O3/Stage2RouteD.lean index abd7a2dc1a..c6fc75e1e4 100644 --- a/LeanPool/ParameterFreeGradient/O3/Stage2RouteD.lean +++ b/LeanPool/ParameterFreeGradient/O3/Stage2RouteD.lean @@ -15,7 +15,7 @@ This probe-local module develops native identities needed by a direct Bregman proof. It contains no target-shaped hypothesis. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ParameterFreeGradient/O3/Stage3Anchor.lean b/LeanPool/ParameterFreeGradient/O3/Stage3Anchor.lean index 969a1ba850..ded667d8b0 100644 --- a/LeanPool/ParameterFreeGradient/O3/Stage3Anchor.lean +++ b/LeanPool/ParameterFreeGradient/O3/Stage3Anchor.lean @@ -17,7 +17,7 @@ acceptance at the first dyadic scale dominating `L`, the actual infimum distance to the minimizer set, and the displayed base-two ceiling count. -/ -@[expose] public section +public section namespace O3 @@ -25,7 +25,7 @@ open Stage3Anchor /-- The anchor loop configuration contains only data already observed at `x₀`; neither `L` nor a minimizer nor the solution radius is an input. -/ -noncomputable def AdmissibleInstance.anchorConfig {d : ℕ} {p : ℝ} +@[expose] noncomputable def AdmissibleInstance.anchorConfig {d : ℕ} {p : ℝ} (P : AdmissibleInstance d p) : AnchorConfig d := { q := conjugateExponent p x₀ := P.x0 @@ -155,7 +155,7 @@ theorem runAnchor_some_add_fuel {d : ℕ} (oracle : PairOracle d) /-- Transparent source-level carrier for the frozen gradient-ray anchor. The only quantified algorithmic object is the admissible instance; `L`, the minimizer set, and its distance are used only in the correctness conclusion. -/ -def AnchorStatement : Prop := +@[expose] def AnchorStatement : Prop := ∀ (p : ℝ) (d : ℕ) (P : AdmissibleInstance d p), let cfg := P.anchorConfig let N := Nat.ceil (Real.logb 2 (P.L / P.M0)) diff --git a/LeanPool/ParameterFreeGradient/O3/Stage3AnchorNorming.lean b/LeanPool/ParameterFreeGradient/O3/Stage3AnchorNorming.lean index e92cdeaadd..8dfe2b8c8d 100644 --- a/LeanPool/ParameterFreeGradient/O3/Stage3AnchorNorming.lean +++ b/LeanPool/ParameterFreeGradient/O3/Stage3AnchorNorming.lean @@ -18,7 +18,7 @@ The source coordinate formula is identified with the normalized duality map, then its two norming identities are derived without adding them as hypotheses. -/ -@[expose] public section +public section namespace O3 namespace Stage3Anchor diff --git a/LeanPool/ParameterFreeGradient/O3/Stage3Descent.lean b/LeanPool/ParameterFreeGradient/O3/Stage3Descent.lean index 6797bf3849..44d41b191b 100644 --- a/LeanPool/ParameterFreeGradient/O3/Stage3Descent.lean +++ b/LeanPool/ParameterFreeGradient/O3/Stage3Descent.lean @@ -19,13 +19,13 @@ model, its derivative is nonpositive on `[0,1]`; this yields the coefficient inequalities alone. -/ -@[expose] public section +public section namespace O3 namespace Stage3Anchor /-- The objective restricted to the affine line from `x` to `y`. -/ -noncomputable def objectiveLine {d : ℕ} (f : Vec d → ℝ) +@[expose] noncomputable def objectiveLine {d : ℕ} (f : Vec d → ℝ) (x y : Vec d) (t : ℝ) : ℝ := f (AffineMap.lineMap x y t) diff --git a/LeanPool/ParameterFreeGradient/O3/Stage4AlgebraRadius.lean b/LeanPool/ParameterFreeGradient/O3/Stage4AlgebraRadius.lean index 4d57973c17..fab4aefa58 100644 --- a/LeanPool/ParameterFreeGradient/O3/Stage4AlgebraRadius.lean +++ b/LeanPool/ParameterFreeGradient/O3/Stage4AlgebraRadius.lean @@ -19,7 +19,7 @@ regularized minimizer from its minimizing property and the actual `sInf` definition of the distance to the minimizer set. -/ -@[expose] public section +public section namespace O3 diff --git a/LeanPool/ParameterFreeGradient/O3/Stage8EuclideanGap.lean b/LeanPool/ParameterFreeGradient/O3/Stage8EuclideanGap.lean index dbe01afb40..e487f89275 100644 --- a/LeanPool/ParameterFreeGradient/O3/Stage8EuclideanGap.lean +++ b/LeanPool/ParameterFreeGradient/O3/Stage8EuclideanGap.lean @@ -17,7 +17,7 @@ recursive Phase-A execution and evaluates it at the internally constructed closest optimizer. -/ -@[expose] public section +public section namespace O3 @@ -185,6 +185,7 @@ theorem euclideanEstimate_potential {d : ℕ} /-- Exact frozen carrier for TeX Lemma `lem:euclideangap`. The optimizer is proof-side and universally quantified in the conclusion; it is not supplied to the algorithm or used by its recursion. -/ +@[expose] def EuclideanGapStatement : Prop := ∀ (d : ℕ) (P : AdmissibleInstance d 2) (M D : ℝ) (m : ℕ), 0 < M → 1 ≤ m → EuclideanEstimateAccepted P M m → P.radius ≤ D → diff --git a/LeanPool/ParameterFreeGradient/O3/Stage8EuclideanMinimizer.lean b/LeanPool/ParameterFreeGradient/O3/Stage8EuclideanMinimizer.lean index 432de0e53b..5ea62787a4 100644 --- a/LeanPool/ParameterFreeGradient/O3/Stage8EuclideanMinimizer.lean +++ b/LeanPool/ParameterFreeGradient/O3/Stage8EuclideanMinimizer.lean @@ -19,7 +19,7 @@ are derived from the project's explicit `lpNorm 2`; no ambient-norm shortcut or minimizer certificate is used. -/ -@[expose] public section +public section namespace O3 namespace Stage8EuclideanMinimizer @@ -27,12 +27,12 @@ namespace Stage8EuclideanMinimizer /-- The canonical representation of the recursive Euclidean estimate potential. The vector `s` is the accumulated weighted gradient and `c` contains the accumulated affine offsets. -/ -noncomputable def euclideanPsi (M : ℝ) {d : ℕ} +@[expose] noncomputable def euclideanPsi (M : ℝ) {d : ℕ} (x₀ s : Point d) (c : ℝ) (x : Point d) : ℝ := M / 2 * (lpNorm 2 (x - x₀)) ^ (2 : ℕ) + c + pairing s (x - x₀) /-- The explicit minimizer `x₀ - M⁻¹ s` of the canonical potential. -/ -noncomputable def euclideanPsiMinimizer (M : ℝ) {d : ℕ} +@[expose] noncomputable def euclideanPsiMinimizer (M : ℝ) {d : ℕ} (x₀ s : Point d) : Point d := x₀ - M⁻¹ • s diff --git a/LeanPool/ParameterFreeGradient/O3/Stage8EuclideanPhase.lean b/LeanPool/ParameterFreeGradient/O3/Stage8EuclideanPhase.lean index bb9cdcf341..b5b730f76c 100644 --- a/LeanPool/ParameterFreeGradient/O3/Stage8EuclideanPhase.lean +++ b/LeanPool/ParameterFreeGradient/O3/Stage8EuclideanPhase.lean @@ -20,12 +20,12 @@ minimizer, query, two oracle observations, literal potential, and guard are deterministic definitions, while their correctness properties are theorems. -/ -@[expose] public section +public section namespace O3 /-- The normalized weighted average of an accelerated point and an estimate minimizer. -/ -noncomputable def euclideanBarycenter {d : ℕ} (A a : ℝ) +@[expose] noncomputable def euclideanBarycenter {d : ℕ} (A a : ℝ) (x z : Vec d) : Vec d := (A + a)⁻¹ • (A • x + a • z) @@ -37,7 +37,7 @@ structure EuclideanEstimateState (d : ℕ) where cumulativeGradient : Vec d /-- The recursively updated Euclidean accelerated iterate and accumulated gradient. -/ -noncomputable def euclideanEstimateState {d : ℕ} +@[expose] noncomputable def euclideanEstimateState {d : ℕ} (P : AdmissibleInstance d 2) (M : ℝ) : ℕ → EuclideanEstimateState d | 0 => ⟨P.x0, 0⟩ | k + 1 => @@ -53,20 +53,20 @@ noncomputable def euclideanEstimateState {d : ℕ} ⟨euclideanBarycenter A a state.accelerated zNext, sNext⟩ /-- The minimizer of the quadratic estimate potential at iteration `k`. -/ -noncomputable def euclideanEstimateMinimizer {d : ℕ} +@[expose] noncomputable def euclideanEstimateMinimizer {d : ℕ} (P : AdmissibleInstance d 2) (M : ℝ) (k : ℕ) : Vec d := Stage8EuclideanMinimizer.euclideanPsiMinimizer M P.x0 (euclideanEstimateState P M k).cumulativeGradient /-- The Euclidean oracle query obtained by averaging the iterate and estimate minimizer. -/ -noncomputable def euclideanEstimateQuery {d : ℕ} +@[expose] noncomputable def euclideanEstimateQuery {d : ℕ} (P : AdmissibleInstance d 2) (M : ℝ) (k : ℕ) : Vec d := euclideanBarycenter (euclideanA k) (euclideanWeight (euclideanA k)) (euclideanEstimateState P M k).accelerated (euclideanEstimateMinimizer P M k) /-- The value-gradient observation at the Euclidean estimate query. -/ -noncomputable def euclideanEstimateObservation {d : ℕ} +@[expose] noncomputable def euclideanEstimateObservation {d : ℕ} (P : AdmissibleInstance d 2) (M : ℝ) (k : ℕ) : Observation d := P.oracle.observe (euclideanEstimateQuery P M k) @@ -82,7 +82,7 @@ noncomputable def euclideanEstimateConstant {d : ℕ} pairing observation.gradient (P.x0 - observation.point)) /-- The literal recursively accumulated source potential. -/ -noncomputable def euclideanEstimateFunction {d : ℕ} +@[expose] noncomputable def euclideanEstimateFunction {d : ℕ} (P : AdmissibleInstance d 2) (M : ℝ) : ℕ → Vec d → ℝ | 0 => fun x => M / 2 * (lpNorm 2 (x - P.x0)) ^ (2 : ℕ) | k + 1 => fun x => @@ -93,11 +93,12 @@ noncomputable def euclideanEstimateFunction {d : ℕ} pairing observation.gradient (x - observation.point)) /-- The Euclidean estimate potential evaluated at its minimizer. -/ -noncomputable def euclideanEstimateMinimum {d : ℕ} +@[expose] noncomputable def euclideanEstimateMinimum {d : ℕ} (P : AdmissibleInstance d 2) (M : ℝ) (k : ℕ) : ℝ := euclideanEstimateFunction P M k (euclideanEstimateMinimizer P M k) /-- The upper-model guard between the estimate query and the next accelerated iterate. -/ +@[expose] noncomputable def euclideanEstimateGuard {d : ℕ} (P : AdmissibleInstance d 2) (M : ℝ) (k : ℕ) : GuardCheck := let atY := euclideanEstimateObservation P M k @@ -108,6 +109,7 @@ noncomputable def euclideanEstimateGuard {d : ℕ} ((lpNorm 2 (xNext - atY.point)) ^ (2 : ℕ)) M /-- Every Euclidean upper-model guard before the given horizon is accepted. -/ +@[expose] def EuclideanEstimateAccepted {d : ℕ} (P : AdmissibleInstance d 2) (M : ℝ) (m : ℕ) : Prop := ∀ k, k < m → (euclideanEstimateGuard P M k).Holds diff --git a/LeanPool/ParameterFreeGradient/O3/Stage8EuclideanRadius.lean b/LeanPool/ParameterFreeGradient/O3/Stage8EuclideanRadius.lean index c633f37614..b159bd5e6f 100644 --- a/LeanPool/ParameterFreeGradient/O3/Stage8EuclideanRadius.lean +++ b/LeanPool/ParameterFreeGradient/O3/Stage8EuclideanRadius.lean @@ -21,7 +21,7 @@ to the finite-dimensional `PiLp 2` space. A closest point in that proper space therefore gives an actual optimizer at the exact frozen radius. -/ -@[expose] public section +public section namespace O3.Stage8EuclideanRadius diff --git a/LeanPool/ParameterFreeGradient/O3/Stage8EuclideanWeights.lean b/LeanPool/ParameterFreeGradient/O3/Stage8EuclideanWeights.lean index 5ce4102e8b..4ef6447324 100644 --- a/LeanPool/ParameterFreeGradient/O3/Stage8EuclideanWeights.lean +++ b/LeanPool/ParameterFreeGradient/O3/Stage8EuclideanWeights.lean @@ -17,12 +17,12 @@ This module records the source recurrence weight gives the exact alternative form `Aₖ₊₁ = aₖ₊₁²`. -/ -@[expose] public section +public section namespace O3 /-- The cumulative weights in the Euclidean estimate sequence. -/ -noncomputable def euclideanA : ℕ → ℝ +@[expose] noncomputable def euclideanA : ℕ → ℝ | 0 => 0 | k + 1 => euclideanA k + euclideanWeight (euclideanA k) diff --git a/LeanPool/ParameterFreeGradient/O3/Stage9Certificate.lean b/LeanPool/ParameterFreeGradient/O3/Stage9Certificate.lean index 2b4dec94d3..8118f41257 100644 --- a/LeanPool/ParameterFreeGradient/O3/Stage9Certificate.lean +++ b/LeanPool/ParameterFreeGradient/O3/Stage9Certificate.lean @@ -24,7 +24,7 @@ special equation `theta_0^2-theta_0=2 theta_1^2` is used exactly. The actual vector recurrence supplies the pairing-balance premise in `Stage9Pairing`. -/ -@[expose] public section +public section namespace O3 namespace Stage9Certificate @@ -33,27 +33,27 @@ namespace Stage9Certificate `psi_i = f_i - f^* - ||g_i||^2/(2M)`. The squared gradient is an explicit scalar input so that the coefficient algebra is independent of a particular vector representation. -/ -noncomputable def ogmgPsi (M fstar : ℝ) (fval gradSq : ℕ → ℝ) (i : ℕ) : ℝ := +@[expose] noncomputable def ogmgPsi (M fstar : ℝ) (fval gradSq : ℕ → ℝ) (i : ℕ) : ℝ := fval i - fstar - gradSq i / (2 * M) /-- The source interpolation remainder `I_ij = psi_i - psi_j - `. -/ -def ogmgI (psi : ℕ → ℝ) (pairTerm : ℕ → ℕ → ℝ) (i j : ℕ) : ℝ := +@[expose] def ogmgI (psi : ℕ → ℝ) (pairTerm : ℕ → ℕ → ℝ) (i j : ℕ) : ℝ := psi i - psi j - pairTerm i j /-- `delta_i = kappa_(i+1) - kappa_i`. -/ -def ogmgDelta (kappa : ℕ → ℝ) (i : ℕ) : ℝ := +@[expose] def ogmgDelta (kappa : ℕ → ℝ) (i : ℕ) : ℝ := kappa (i + 1) - kappa i /-- The literal right side of the frozen OGM-G certificate. -/ -def ogmgCertificateRhs (n : ℕ) (kappa psi : ℕ → ℝ) +@[expose] def ogmgCertificateRhs (n : ℕ) (kappa psi : ℕ → ℝ) (pairTerm : ℕ → ℕ → ℝ) : ℝ := (∑ i ∈ Finset.range n, kappa (i + 1) * ogmgI psi pairTerm i (i + 1)) + (∑ i ∈ Finset.range n, ogmgDelta kappa i * ogmgI psi pairTerm n i) + psi n /-- The unsigned collection of pairing terms subtracted by the certificate. -/ -def ogmgPairingAggregate (n : ℕ) (kappa : ℕ → ℝ) +@[expose] def ogmgPairingAggregate (n : ℕ) (kappa : ℕ → ℝ) (pairTerm : ℕ → ℕ → ℝ) : ℝ := (∑ i ∈ Finset.range n, kappa (i + 1) * pairTerm i (i + 1)) + ∑ i ∈ Finset.range n, ogmgDelta kappa i * pairTerm n i diff --git a/LeanPool/ParameterFreeGradient/O3/Stage9Execution.lean b/LeanPool/ParameterFreeGradient/O3/Stage9Execution.lean index 7d1e4d6c90..39c26a9198 100644 --- a/LeanPool/ParameterFreeGradient/O3/Stage9Execution.lean +++ b/LeanPool/ParameterFreeGradient/O3/Stage9Execution.lean @@ -23,7 +23,7 @@ The phase-B trace deliberately omits `u₀ = U`, which is reused from Phase A, and contains exactly the newly queried points `u₁, …, uₙ, vₙ`. -/ -@[expose] public section +public section open scoped BigOperators @@ -47,7 +47,7 @@ structure OGMGExecutionConfig (d : ℕ) where /-- The source-exact configuration: no theta sequence is supplied by the caller; it is the frozen special-zero/backward-tail sequence for horizon `n`. -/ -noncomputable def stage9ExecutionConfig {d : ℕ} (n : ℕ) +@[expose] noncomputable def stage9ExecutionConfig {d : ℕ} (n : ℕ) (oracle : PairOracle d) (M : ℝ) (U : Vec d) : OGMGExecutionConfig d := { horizon := n oracle := oracle @@ -72,6 +72,7 @@ structure OGMGExecutionState (d : ℕ) where previousV : Vec d /-- One literal source step. -/ +@[expose] noncomputable def ogmgExecutionStep (cfg : OGMGExecutionConfig d) (i : ℕ) (state : OGMGExecutionState d) : OGMGExecutionState d := let v := state.current - cfg.M⁻¹ • (cfg.oracle.observe state.current).gradient @@ -85,20 +86,24 @@ noncomputable def ogmgExecutionStep (cfg : OGMGExecutionConfig d) (i : ℕ) /-- Primitive-recursive actual execution, beginning from `u_0=U, v_(-1)=U`. -/ -noncomputable def ogmgState (cfg : OGMGExecutionConfig d) : ℕ → OGMGExecutionState d +@[expose] noncomputable def ogmgState + (cfg : OGMGExecutionConfig d) : ℕ → OGMGExecutionState d | 0 => ⟨cfg.U, cfg.U⟩ | i + 1 => ogmgExecutionStep cfg i (ogmgState cfg i) /-- The actual observation at `u_i`. -/ -noncomputable def ogmgObservation (cfg : OGMGExecutionConfig d) (i : ℕ) : Observation d := +@[expose] noncomputable def ogmgObservation + (cfg : OGMGExecutionConfig d) (i : ℕ) : Observation d := cfg.oracle.observe (ogmgState cfg i).current /-- The actual queried gradient `g_i`. -/ -noncomputable def ogmgGradient (cfg : OGMGExecutionConfig d) (i : ℕ) : Vec d := +@[expose] noncomputable def ogmgGradient + (cfg : OGMGExecutionConfig d) (i : ℕ) : Vec d := (ogmgObservation cfg i).gradient /-- The literal gradient point `v_i=u_i-g_i/M`. -/ -noncomputable def ogmgV (cfg : OGMGExecutionConfig d) (i : ℕ) : Vec d := +@[expose] noncomputable def ogmgV + (cfg : OGMGExecutionConfig d) (i : ℕ) : Vec d := (ogmgState cfg i).current - cfg.M⁻¹ • ogmgGradient cfg i @[simp] theorem ogmgState_zero_current (cfg : OGMGExecutionConfig d) : @@ -252,6 +257,7 @@ noncomputable def ogmgNewIterates (cfg : OGMGExecutionConfig d) : Fin cfg.horizo fun i => (ogmgState cfg (i.val + 1)).current /-- The final extra query is at exactly `v_n`. -/ +@[expose] noncomputable def ogmgTerminalObservation (cfg : OGMGExecutionConfig d) : Observation d := cfg.oracle.observe (ogmgV cfg cfg.horizon) @@ -291,21 +297,21 @@ theorem ogmgExecutionTrace_final_iterate_queried (cfg : OGMGExecutionConfig d) /-- The reused point `u₀=U` and every subsequently queried `u_i`, including `u_n`, as an actual oracle observation. -/ -noncomputable def ogmgDataObservation (cfg : OGMGExecutionConfig d) +@[expose] noncomputable def ogmgDataObservation (cfg : OGMGExecutionConfig d) (i : Fin (cfg.horizon + 1)) : Observation d := ogmgObservation cfg i.val /-- Scalar/vector projections of the actual finite data, ready for the algebraic certificate. These are definitions, not freely supplied arrays. -/ -noncomputable def ogmgFunctionValue (cfg : OGMGExecutionConfig d) (i : ℕ) : ℝ := +@[expose] noncomputable def ogmgFunctionValue (cfg : OGMGExecutionConfig d) (i : ℕ) : ℝ := (ogmgObservation cfg i).value /-- The squared Euclidean norm of the gradient at an execution query. -/ -noncomputable def ogmgGradientSq (cfg : OGMGExecutionConfig d) (i : ℕ) : ℝ := +@[expose] noncomputable def ogmgGradientSq (cfg : OGMGExecutionConfig d) (i : ℕ) : ℝ := (lpNorm 2 (ogmgGradient cfg i)) ^ (2 : ℕ) /-- The gradient at query `j` paired with the difference of gradient-step points `i` and `j`. -/ -noncomputable def ogmgPairTerm (cfg : OGMGExecutionConfig d) +@[expose] noncomputable def ogmgPairTerm (cfg : OGMGExecutionConfig d) (i j : ℕ) : ℝ := pairing (ogmgGradient cfg j) (ogmgV cfg i - ogmgV cfg j) @@ -317,7 +323,7 @@ noncomputable def ogmgPairTerm (cfg : OGMGExecutionConfig d) simp [ogmgPairTerm, pairing] /-- The observable ordered interpolation check for `(i,j)`. -/ -noncomputable def ogmgInterpolationCheck (cfg : OGMGExecutionConfig d) +@[expose] noncomputable def ogmgInterpolationCheck (cfg : OGMGExecutionConfig d) (i j : Fin (cfg.horizon + 1)) : GuardCheck := let oi := ogmgDataObservation cfg i let oj := ogmgDataObservation cfg j @@ -343,7 +349,7 @@ noncomputable def ogmgAllInterpolationChecks (ogmgInterpolationCheck cfg i j).kind = .interpolation := rfl /-- All ordered-pair finite-data interpolation guards pass. -/ -def OGMGAllInterpolationGuardsHold (cfg : OGMGExecutionConfig d) : Prop := +@[expose] def OGMGAllInterpolationGuardsHold (cfg : OGMGExecutionConfig d) : Prop := allGuardsPass (ogmgAllInterpolationChecks cfg) theorem ogmgAllInterpolationGuardsHold_iff diff --git a/LeanPool/ParameterFreeGradient/O3/Stage9FiniteDataOGMG.lean b/LeanPool/ParameterFreeGradient/O3/Stage9FiniteDataOGMG.lean index e38bff6be6..e1535ed9a1 100644 --- a/LeanPool/ParameterFreeGradient/O3/Stage9FiniteDataOGMG.lean +++ b/LeanPool/ParameterFreeGradient/O3/Stage9FiniteDataOGMG.lean @@ -18,20 +18,20 @@ the native finite algebraic certificate. In particular, the certificate is proved from the actual recursion; it is not an input field or hypothesis. -/ -@[expose] public section +public section open scoped BigOperators namespace O3 /-- The scalar OGM-G potential instantiated with an actual oracle execution. -/ -noncomputable def stage9ActualPsi (cfg : OGMGExecutionConfig d) +@[expose] noncomputable def stage9ActualPsi (cfg : OGMGExecutionConfig d) (fstar : ℝ) (i : ℕ) : ℝ := Stage9Certificate.ogmgPsi cfg.M fstar (ogmgFunctionValue cfg) (ogmgGradientSq cfg) i /-- The two-point interpolation certificate instantiated with an actual oracle execution. -/ -noncomputable def stage9ActualI (cfg : OGMGExecutionConfig d) +@[expose] noncomputable def stage9ActualI (cfg : OGMGExecutionConfig d) (fstar : ℝ) (i j : ℕ) : ℝ := Stage9Certificate.ogmgI (stage9ActualPsi cfg fstar) (ogmgPairTerm cfg) i j @@ -192,6 +192,7 @@ theorem stage9Actual_certificate_audit_n3 /-- Exact source-level proposition carrier. The oracle and all method data precede the proof-only lower bound; no certificate is supplied by the caller. -/ +@[expose] def FiniteDataOGMGStatement : Prop := ∀ (d : ℕ) (oracle : PairOracle d) (U : Vec d) (M fstar : ℝ) (n : ℕ), 0 < M → 1 ≤ n → diff --git a/LeanPool/ParameterFreeGradient/O3/Stage9Pairing.lean b/LeanPool/ParameterFreeGradient/O3/Stage9Pairing.lean index 1bc537b57e..e428f8202a 100644 --- a/LeanPool/ParameterFreeGradient/O3/Stage9Pairing.lean +++ b/LeanPool/ParameterFreeGradient/O3/Stage9Pairing.lean @@ -18,14 +18,14 @@ certificate from the actual auxiliary recurrence. The balance is a theorem, not a field of the final statement. -/ -@[expose] public section +public section open scoped BigOperators namespace O3 /-- The gradient at index `j` paired with the difference of the two indexed points. -/ -noncomputable def stage9PairTerm {d : ℕ} (g v : ℕ → Vec d) +@[expose] noncomputable def stage9PairTerm {d : ℕ} (g v : ℕ → Vec d) (i j : ℕ) : ℝ := pairing (g j) (v i - v j) /-- The two pairing sums combine into one edge sum after discrete summation diff --git a/LeanPool/ParameterFreeGradient/O3/Stage9Telescoping.lean b/LeanPool/ParameterFreeGradient/O3/Stage9Telescoping.lean index 3e4e06ab33..e641b3fe85 100644 --- a/LeanPool/ParameterFreeGradient/O3/Stage9Telescoping.lean +++ b/LeanPool/ParameterFreeGradient/O3/Stage9Telescoping.lean @@ -18,14 +18,14 @@ recursively generated auxiliary `p` sequence and the exact polarization used by the finite-data identity. -/ -@[expose] public section +public section open scoped BigOperators namespace O3 /-- The sum of gradients before index `k`, weighted by the certificate increments. -/ -noncomputable def stage9WeightedGradient {d : ℕ} +@[expose] noncomputable def stage9WeightedGradient {d : ℕ} (delta : ℕ → ℝ) (g : ℕ → Vec d) (k : ℕ) : Vec d := ∑ j ∈ Finset.range k, delta j • g j @@ -109,7 +109,7 @@ theorem stage9_pairing_summation_by_parts {d : ℕ} ring /-- The auxiliary sequence from the frozen OGM-G certificate. -/ -noncomputable def stage9P {d : ℕ} (theta : ℕ → ℝ) +@[expose] noncomputable def stage9P {d : ℕ} (theta : ℕ → ℝ) (g : ℕ → Vec d) : ℕ → Vec d | 0 => 0 | k + 1 => (1 - 1 / theta k) • stage9P theta g k + diff --git a/LeanPool/ParameterFreeGradient/O3/Stage9Theta.lean b/LeanPool/ParameterFreeGradient/O3/Stage9Theta.lean index 82fbb8526b..ee48dff511 100644 --- a/LeanPool/ParameterFreeGradient/O3/Stage9Theta.lean +++ b/LeanPool/ParameterFreeGradient/O3/Stage9Theta.lean @@ -17,7 +17,7 @@ The representation is Nat-indexed because the certificate sums over boundary hypothesis explicitly. -/ -@[expose] public section +public section namespace O3 @@ -194,7 +194,7 @@ theorem stage9Kappa_mono {n i j : ℕ} (hij : i ≤ j) (hjn : j ≤ n) : exact (ih (by omega)).trans (stage9Kappa_mono_succ (by omega)) /-- The source increment `delta_i = kappa_(i+1) - kappa_i`. -/ -noncomputable def stage9Delta (n i : ℕ) : ℝ := +@[expose] noncomputable def stage9Delta (n i : ℕ) : ℝ := stage9Kappa n (i + 1) - stage9Kappa n i theorem stage9Delta_nonneg {n i : ℕ} (hin : i < n) : diff --git a/LeanPool/ParameterFreeGradient/V7/AboveTwoStatements.lean b/LeanPool/ParameterFreeGradient/V7/AboveTwoStatements.lean index 2abc6320a6..612c88224c 100644 --- a/LeanPool/ParameterFreeGradient/V7/AboveTwoStatements.lean +++ b/LeanPool/ParameterFreeGradient/V7/AboveTwoStatements.lean @@ -13,25 +13,25 @@ The geometry, residual identities, phase bounds, and operational contracts for e two. -/ -@[expose] public section +public section namespace V7 /-- The power mirror potential `‖x‖ₚ^p / p` used for exponents above two. -/ -noncomputable def aboveH (p : ℝ) (x : Point d) : ℝ := +@[expose] noncomputable def aboveH (p : ℝ) (x : Point d) : ℝ := (1 / p) * (lpNorm p x) ^ p /-- The conjugate power potential with the Hölder-conjugate exponent. -/ -noncomputable def aboveHstar (p : ℝ) (s : Point d) : ℝ := +@[expose] noncomputable def aboveHstar (p : ℝ) (s : Point d) : ℝ := (1 / conjugateExponent p) * (lpNorm (conjugateExponent p) s) ^ (conjugateExponent p) /-- The power duality map at the Hölder-conjugate exponent. -/ -noncomputable def aboveMirrorMap (p : ℝ) (s : Point d) : Point d := +@[expose] noncomputable def aboveMirrorMap (p : ℝ) (s : Point d) : Point d := O3.powerDualityMap (conjugateExponent p) s /-- The conjugacy, gradient, uniform convexity, and Bregman identities for the above-two geometry. -/ -noncomputable def AboveGeometryStatement : Prop := +@[expose] noncomputable def AboveGeometryStatement : Prop := ∀ (p : ℝ), 2 < p → ∀ (d : ℕ), (∀ s : Point d, FenchelConjugate (aboveH p) s = aboveHstar p s) ∧ O3.IsCoordinateGradient @@ -47,39 +47,39 @@ noncomputable def AboveGeometryStatement : Prop := (aboveMirrorMap p t) (aboveMirrorMap p s) /-- The uniform convexity constant of the power mirror potential. -/ -noncomputable def aboveUniformConstant (p : ℝ) : ℝ := 2 ^ (2 - p) / p +@[expose] noncomputable def aboveUniformConstant (p : ℝ) : ℝ := 2 ^ (2 - p) / p /-- The exponent in the accumulated above-two residual error. -/ -noncomputable def aboveErrorPower (p : ℝ) : ℝ := p / (p - 2) +@[expose] noncomputable def aboveErrorPower (p : ℝ) : ℝ := p / (p - 2) /-- The coefficient of the error bound obtained from the above-two mixed residual. -/ -noncomputable def aboveErrorConstant (p : ℝ) : ℝ := +@[expose] noncomputable def aboveErrorConstant (p : ℝ) : ℝ := (p - 2) / (2 * p) * (p * aboveUniformConstant p) ^ (-2 / (p - 2)) /-- The error constant after bounding the squared weight increments by their growth rate. -/ -noncomputable def aboveBudgetConstant (p : ℝ) : ℝ := +@[expose] noncomputable def aboveBudgetConstant (p : ℝ) : ℝ := 4 ^ (aboveErrorPower p) * aboveErrorConstant p /-- The exponent relating an above-two error budget to the coefficient scale. -/ -noncomputable def aboveBudgetExponent (p : ℝ) : ℝ := (p - 2) / p +@[expose] noncomputable def aboveBudgetExponent (p : ℝ) : ℝ := (p - 2) / p /-- The coefficient of the terminal weight in terms of the error budget and horizon. -/ -noncomputable def aboveGrowthConstant (p : ℝ) : ℝ := +@[expose] noncomputable def aboveGrowthConstant (p : ℝ) : ℝ := (2 * aboveBudgetConstant p) ^ (-aboveBudgetExponent p) /-- The exponent-dependent constant used to choose the primal trial horizon. -/ -noncomputable def aboveHp (p : ℝ) : ℝ := +@[expose] noncomputable def aboveHp (p : ℝ) : ℝ := 3 * p ^ (aboveBudgetExponent p) / (2 * p * aboveGrowthConstant p) /-- The exponent-dependent constant used to choose the dual trial horizon. -/ -noncomputable def aboveJp (p : ℝ) : ℝ := +@[expose] noncomputable def aboveJp (p : ℝ) : ℝ := 2 * (conjugateExponent p) ^ (1 + aboveBudgetExponent p) / aboveGrowthConstant p /-- The weight scale chosen from the error budget and iteration horizon. -/ -noncomputable def aboveGamma (p eta : ℝ) (n : ℕ) : ℝ := +@[expose] noncomputable def aboveGamma (p eta : ℝ) (n : ℕ) : ℝ := (eta / (2 * aboveBudgetConstant p * n)) ^ (aboveBudgetExponent p) /-- The accumulated above-two residual error for a weight sequence and its increments. -/ -noncomputable def aboveErrorSum (p : ℝ) (n : ℕ) +@[expose] noncomputable def aboveErrorSum (p : ℝ) (n : ℕ) (u dw : ScalarSeq) : ℝ := aboveErrorConstant p * ∑ k ∈ Finset.range n, ((dw k) ^ (2 : ℕ) / u k) ^ (aboveErrorPower p) /-- Quadratic trial weights meet the error budget and have the stated terminal growth. -/ -noncomputable def AboveWeightErrorBalanceStatement : Prop := +@[expose] noncomputable def AboveWeightErrorBalanceStatement : Prop := ∀ (p : ℝ), 2 < p → ∀ (n : ℕ), 1 ≤ n → ∀ (eta : ℝ), 0 < eta → let gamma := aboveGamma p eta n let u : ScalarSeq := fun k => @@ -91,20 +91,20 @@ noncomputable def AboveWeightErrorBalanceStatement : Prop := (n : ℝ) ^ ((p + 2) / p) /-- The primal residual for above-two geometry, expressed through the common residual formula. -/ -noncomputable def AbovePrimalResidual (p : ℝ) (n : ℕ) +@[expose] noncomputable def AbovePrimalResidual (p : ℝ) (n : ℕ) (u : ScalarSeq) (alpha : ScalarMatrix) (A B X : VectorSeq d) (Omega : Point d → ℝ) : ℝ := BelowPrimalResidual p n u (fun _ => 0) alpha A B X Omega /-- The dual residual for above-two geometry, expressed through the common residual formula. -/ -noncomputable def AboveDualResidual (p : ℝ) (n : ℕ) +@[expose] noncomputable def AboveDualResidual (p : ℝ) (n : ℕ) (u : ScalarSeq) (alpha b : ScalarMatrix) (C D : VectorSeq d) (Omega : Point d → ℝ) : ℝ := BelowDualResidual p n u alpha b C D Omega /-- The weight, increment, matrix recurrence, row-sum, and support conditions for an above-two phase. -/ -def AboveCoefficientAssumptions (n : ℕ) (u dw : ScalarSeq) +@[expose] def AboveCoefficientAssumptions (n : ℕ) (u dw : ScalarSeq) (alpha c b : ScalarMatrix) : Prop := 0 < u 0 ∧ u n = u (n - 1) ∧ dw n = 0 ∧ c 0 0 = 1 ∧ b 0 0 = -1 ∧ (∀ k < n, 0 < u k ∧ u k ≤ u (k + 1) ∧ @@ -121,7 +121,7 @@ def AboveCoefficientAssumptions (n : ℕ) (u dw : ScalarSeq) ∀ k < n, (∑ i ∈ Finset.range (k + 2), b (k + 1) i) = 0 /-- Source carrier for `lem:above-pointwise` (A05). -/ -noncomputable def AbovePointwiseResidualIdentityStatement : Prop := +@[expose] noncomputable def AbovePointwiseResidualIdentityStatement : Prop := ∀ (p : ℝ), 2 < p → ∀ (d n : ℕ), 1 ≤ n → ∀ (u dw : ScalarSeq) (alpha c b : ScalarMatrix) (Omega : Point d → ℝ), AboveCoefficientAssumptions n u dw alpha c b → EvenIncrement Omega → @@ -164,6 +164,7 @@ structure AbovePrimalPhaseData (p : ℝ) (d n : ℕ) where trace : List (Observation d) /-- The above-two primal coefficient conditions, initial state, and step recurrences. -/ +@[expose] def AbovePrimalPhaseDynamics (data : AbovePrimalPhaseData p d n) : Prop := 1 ≤ n ∧ AboveCoefficientAssumptions n data.u data.dw data.alpha data.c data.b ∧ data.s 0 = 0 ∧ data.v 0 = 0 ∧ data.x 0 = 0 ∧ @@ -176,7 +177,7 @@ def AbovePrimalPhaseDynamics (data : AbovePrimalPhaseData p d n) : Prop := (data.dw k / data.u (k + 1)) • (data.v (k + 1) - data.v k) /-- The primal dynamics, convex gradient oracle, attained minimum, guards, and exact query trace. -/ -def AbovePrimalPhaseAssumptions (data : AbovePrimalPhaseData p d n) : Prop := +@[expose] def AbovePrimalPhaseAssumptions (data : AbovePrimalPhaseData p d n) : Prop := AbovePrimalPhaseDynamics data ∧ O3.IsConvexObjective data.oracle.value ∧ O3.IsCoordinateGradient data.oracle.value data.oracle.gradient ∧ data.fstar = sInf (Set.range data.oracle.value) ∧ @@ -224,6 +225,7 @@ structure AboveDualPhaseData (p : ℝ) (d n : ℕ) where trace : List (Observation d) /-- The above-two coefficient conditions and reversed dual query and gradient recurrences. -/ +@[expose] def AboveDualPhaseDynamics (data : AboveDualPhaseData p d n) : Prop := 1 ≤ n ∧ AboveCoefficientAssumptions n data.u data.dw data.alpha data.c data.b ∧ data.r 0 = -(data.b n n) • data.G 0 ∧ @@ -235,6 +237,7 @@ def AboveDualPhaseDynamics (data : AboveDualPhaseData p d n) : Prop := weightedSum (k + 2) (fun i => data.b (n - i) (n - 1 - k)) data.G /-- The dual dynamics, convex gradient oracle, lower bound, accepted guards, and exact trace. -/ +@[expose] def AboveDualPhaseAssumptions (data : AboveDualPhaseData p d n) : Prop := AboveDualPhaseDynamics data ∧ O3.IsConvexObjective data.oracle.value ∧ O3.IsCoordinateGradient data.oracle.value data.oracle.gradient ∧ @@ -281,7 +284,7 @@ structure AboveTrialWitness (p : ℝ) (d : ℕ) where phaseTwoCenter : Point d /-- The horizon, normalization, phase execution, and report requirements of an above-two trial. -/ -def AboveTrialOperationalContract (p eps M D : ℝ) (x0 : Point d) +@[expose] def AboveTrialOperationalContract (p eps M D : ℝ) (x0 : Point d) (cached : CachedPair d) (oracle : PairOracle d) (report : TrialReport d) (w : AboveTrialWitness p d) : Prop := let delta := eps / (M * D) @@ -327,6 +330,7 @@ def AboveTrialOperationalContract (p eps M D : ℝ) (x0 : Point d) /-- Source carrier for `prop:abovetrial` (A01--A12), with the current `p/(p+2)` exponent and endpoint reuse. -/ +@[expose] noncomputable def AboveTrialStatement : Prop := ∀ (p : ℝ), 2 < p → ∃ Cp : ℝ, 0 < Cp ∧ ∀ (d : ℕ) diff --git a/LeanPool/ParameterFreeGradient/V7/BelowTwoStatements.lean b/LeanPool/ParameterFreeGradient/V7/BelowTwoStatements.lean index 0ad652e178..2e741b764a 100644 --- a/LeanPool/ParameterFreeGradient/V7/BelowTwoStatements.lean +++ b/LeanPool/ParameterFreeGradient/V7/BelowTwoStatements.lean @@ -13,35 +13,35 @@ The squared-norm geometry, residual identities, and two-phase trial contracts fo below two. -/ -@[expose] public section +public section open scoped BigOperators namespace V7 /-- The scaled squared norm mirror potential for exponents between one and two. -/ -noncomputable def belowH (p : ℝ) (x : Point d) : ℝ := +@[expose] noncomputable def belowH (p : ℝ) (x : Point d) : ℝ := (1 / (2 * (p - 1))) * (lpNorm p x) ^ (2 : ℕ) /-- The conjugate scaled squared norm potential for the below-two geometry. -/ -noncomputable def belowHstar (p : ℝ) (s : Point d) : ℝ := +@[expose] noncomputable def belowHstar (p : ℝ) (s : Point d) : ℝ := ((p - 1) / 2) * (lpNorm (conjugateExponent p) s) ^ (2 : ℕ) /-- The scaled duality map giving the gradient of the below-two conjugate potential. -/ -noncomputable def belowMirrorMap (p : ℝ) (s : Point d) : Point d := +@[expose] noncomputable def belowMirrorMap (p : ℝ) (s : Point d) : Point d := (p - 1) • O3.dualityMap (conjugateExponent p) s /-- The Bregman difference of a function and its specified gradient, based at `y`. -/ -noncomputable def FunctionBregman (F : Point d → ℝ) (grad : Point d → Point d) +@[expose] noncomputable def FunctionBregman (F : Point d → ℝ) (grad : Point d → Point d) (x y : Point d) : ℝ := F x - F y - pairing (grad y) (x - y) /-- The real supremum of the affine dual pairings minus the objective. -/ -noncomputable def FenchelConjugate (F : Point d → ℝ) (s : Point d) : ℝ := +@[expose] noncomputable def FenchelConjugate (F : Point d → ℝ) (s : Point d) : ℝ := sSup {r : ℝ | ∃ x : Point d, r = pairing s x - F x} /-- Source carrier for `lem:belowgeometry` (B02). -/ -noncomputable def BelowGeometryStatement : Prop := +@[expose] noncomputable def BelowGeometryStatement : Prop := ∀ (p : ℝ), 1 < p → p < 2 → ∀ (d : ℕ), (∀ x y : Point d, belowH p y ≥ belowH p x + @@ -85,7 +85,7 @@ structure BelowPrimalData (p : ℝ) (d n : ℕ) where trace : List (Observation d) /-- The prescribed below-two weights, initial state, and primal update recurrences. -/ -def BelowPrimalDynamics (data : BelowPrimalData p d n) : Prop := +@[expose] def BelowPrimalDynamics (data : BelowPrimalData p d n) : Prop := 1 ≤ n ∧ data.u 0 = 1 / 4 ∧ data.u n = data.u (n - 1) ∧ data.dw n = 0 ∧ (∀ k < n, data.u k = (((k : ℝ) + 1) ^ (2 : ℕ)) / 4 ∧ @@ -102,7 +102,7 @@ def BelowPrimalDynamics (data : BelowPrimalData p d n) : Prop := (data.dw k / data.u (k + 1)) • (data.v (k + 1) - data.v k) /-- The below-two primal dynamics, convex gradient oracle, minimizer, guards, and exact trace. -/ -def BelowPrimalAssumptions (data : BelowPrimalData p d n) : Prop := +@[expose] def BelowPrimalAssumptions (data : BelowPrimalData p d n) : Prop := BelowPrimalDynamics data ∧ O3.IsConvexObjective data.oracle.value ∧ O3.IsCoordinateGradient data.oracle.value data.oracle.gradient ∧ @@ -130,7 +130,7 @@ def BelowPrimalAssumptions (data : BelowPrimalData p d n) : Prop := ∀ k ≤ n, QueriedAt data.trace k (data.x k) /-- Source carrier for `lem:below-primal` (B04--B05). -/ -noncomputable def BelowPrimalStatement : Prop := +@[expose] noncomputable def BelowPrimalStatement : Prop := ∀ (p : ℝ), 1 < p → p < 2 → ∀ (d n : ℕ) (data : BelowPrimalData p d n), BelowPrimalAssumptions data → data.oracle.value (data.x n) - data.fstar ≤ belowH p data.z / data.u n @@ -143,12 +143,12 @@ abbrev ScalarSeq := ℕ → ℝ abbrev ScalarMatrix := ℕ → ℕ → ℝ /-- The coordinatewise weighted sum of the first `n` vectors. -/ -noncomputable def weightedSum (n : ℕ) (a : ScalarSeq) (X : VectorSeq d) : Point d := +@[expose] noncomputable def weightedSum (n : ℕ) (a : ScalarSeq) (X : VectorSeq d) : Point d := fun j => ∑ i ∈ Finset.range n, a i * X i j /-- The primal energy residual combining gradient differences, mirror increments, and mixed pairings. -/ -noncomputable def BelowPrimalResidual (p : ℝ) (n : ℕ) +@[expose] noncomputable def BelowPrimalResidual (p : ℝ) (n : ℕ) (u _dw : ScalarSeq) (alpha : ScalarMatrix) (A B X : VectorSeq d) (Omega : Point d → ℝ) : ℝ := (∑ k ∈ Finset.range n, @@ -160,7 +160,7 @@ noncomputable def BelowPrimalResidual (p : ℝ) (n : ℕ) u k * pairing (A k - A (k + 1)) (X k)) /-- The reversed dual energy residual with reciprocal weights and mixed pairings. -/ -noncomputable def BelowDualResidual (p : ℝ) (n : ℕ) +@[expose] noncomputable def BelowDualResidual (p : ℝ) (n : ℕ) (u : ScalarSeq) (alpha b : ScalarMatrix) (C D : VectorSeq d) (Omega : Point d → ℝ) : ℝ := let w : ScalarSeq := fun i => 1 / u (n - i) @@ -177,23 +177,24 @@ noncomputable def BelowDualResidual (p : ℝ) (n : ℕ) (weightedSum (k + 1) (fun i => alpha (n - i) (n - 1 - k)) D)) /-- The increment potential is unchanged when its argument is negated. -/ -def EvenIncrement (Omega : Point d → ℝ) : Prop := ∀ x, Omega (-x) = Omega x +@[expose] def EvenIncrement (Omega : Point d → ℝ) : Prop := + ∀ x, Omega (-x) = Omega x /-- The reverse-indexed gradient and mirror correspondence used in the residual identity. -/ -def BelowResidualMap (n : ℕ) (u : ScalarSeq) (A B C D : VectorSeq d) : Prop := +@[expose] def BelowResidualMap (n : ℕ) (u : ScalarSeq) (A B C D : VectorSeq d) : Prop := C 0 = u n • A n ∧ (∀ i < n, C (n - i) - C (n - i - 1) = u i • (A i - A (i + 1))) ∧ ∀ i ≤ n, D i = B (n - i) /-- The primal iterate recurrence driven by coefficient-row differences. -/ -def BelowXRecurrence (n : ℕ) (b : ScalarMatrix) +@[expose] def BelowXRecurrence (n : ℕ) (b : ScalarMatrix) (B X : VectorSeq d) : Prop := X 0 = B 0 ∧ ∀ k < n, X (k + 1) = X k - weightedSum (k + 2) (b (k + 1)) B /-- The explicit quadratic weights and coefficient recurrences for the below-two residual identity. -/ -def BelowCoefficientAssumptions (n : ℕ) (u dw : ScalarSeq) +@[expose] def BelowCoefficientAssumptions (n : ℕ) (u dw : ScalarSeq) (alpha c b : ScalarMatrix) : Prop := u 0 = 1 / 4 ∧ u n = u (n - 1) ∧ dw n = 0 ∧ c 0 0 = 1 ∧ b 0 0 = -1 ∧ (∀ k < n, u k = (((k : ℝ) + 1) ^ (2 : ℕ)) / 4 ∧ @@ -210,10 +211,11 @@ def BelowCoefficientAssumptions (n : ℕ) (u dw : ScalarSeq) ∀ k < n, (∑ i ∈ Finset.range (k + 2), b (k + 1) i) = 0 /-- Two vector sequences agree through the inclusive horizon `n`. -/ -def SameOnHorizon (n : ℕ) (A B : VectorSeq d) : Prop := +@[expose] def SameOnHorizon (n : ℕ) (A B : VectorSeq d) : Prop := ∀ k ≤ n, A k = B k /-- Source carrier for `lem:below-identity` (B06--B07). -/ +@[expose] noncomputable def BelowPointwiseResidualIdentityStatement : Prop := ∀ (p : ℝ), 1 < p → p < 2 → ∀ (d n : ℕ), 1 ≤ n → ∀ (u dw : ScalarSeq) (alpha c b : ScalarMatrix) @@ -256,6 +258,7 @@ structure BelowDualData (p : ℝ) (d n : ℕ) where trace : List (Observation d) /-- The below-two coefficient conditions and reversed dual query and gradient recurrences. -/ +@[expose] def BelowDualDynamics (data : BelowDualData p d n) : Prop := 1 ≤ n ∧ BelowCoefficientAssumptions n data.u data.dw data.alpha data.c data.b ∧ @@ -268,6 +271,7 @@ def BelowDualDynamics (data : BelowDualData p d n) : Prop := weightedSum (k + 2) (fun i => data.b (n - i) (n - 1 - k)) data.G /-- The below-two dual dynamics, convex gradient oracle, lower bound, guards, and exact trace. -/ +@[expose] def BelowDualAssumptions (data : BelowDualData p d n) : Prop := BelowDualDynamics data ∧ O3.IsConvexObjective data.oracle.value ∧ O3.IsCoordinateGradient data.oracle.value data.oracle.gradient ∧ @@ -291,6 +295,7 @@ def BelowDualAssumptions (data : BelowDualData p d n) : Prop := (data.oracle.gradient (data.q k) - data.oracle.gradient (data.q (k + 1)))) ^ (2 : ℕ) /-- Source carrier for `lem:below-dual` (B07--B08). -/ +@[expose] noncomputable def BelowTerminalGradientStatement : Prop := ∀ (p : ℝ), 1 < p → p < 2 → ∀ (d n : ℕ) (data : BelowDualData p d n), BelowDualAssumptions data → @@ -301,6 +306,7 @@ noncomputable def BelowTerminalGradientStatement : Prop := /-- Source carrier for `lem:below-guard-scaling` (B12), including the exact argument orientation in both normalized and physical Bregman remainders. -/ +@[expose] noncomputable def BelowGuardScalingStatement : Prop := ∀ (p M D : ℝ), 1 < p → 0 < M → 0 < D → ∀ (d : ℕ) (oracle : PairOracle d) (c x y : Point d), @@ -318,7 +324,7 @@ noncomputable def BelowGuardScalingStatement : Prop := CocoercivityGuard p M oracle X Y) /-- The oracle translated by `c` and rescaled by the distance and smoothness estimates. -/ -noncomputable def normalizedPairOracle (c : Point d) (M D : ℝ) +@[expose] noncomputable def normalizedPairOracle (c : Point d) (M D : ℝ) (oracle : PairOracle d) : PairOracle d := { value := fun y => (oracle.value (c + D • y) - oracle.value c) / (M * D ^ (2 : ℕ)) @@ -341,6 +347,7 @@ structure BelowTrialWitness (p : ℝ) (d : ℕ) where phaseTwoCenter : Point d /-- The horizon, normalization, phase execution, and report requirements of a below-two trial. -/ +@[expose] def BelowTrialOperationalContract (p eps M D : ℝ) (x0 : Point d) (cached : CachedPair d) (oracle : PairOracle d) (report : TrialReport d) (w : BelowTrialWitness p d) : Prop := @@ -375,6 +382,7 @@ def BelowTrialOperationalContract (p eps M D : ℝ) (x0 : Point d) /-- Source carrier for `prop:belowtrial` (B01--B13), with the current no-log local count. -/ +@[expose] noncomputable def BelowTrialStatement : Prop := ∀ (p : ℝ), 1 < p → p < 2 → ∀ (d : ℕ) (eps M D : ℝ), 0 < eps → 0 < M → 0 < D → ∀ (x0 : Point d) diff --git a/LeanPool/ParameterFreeGradient/V7/ControllerStatements.lean b/LeanPool/ParameterFreeGradient/V7/ControllerStatements.lean index 4fcb78b44f..e2f8c73563 100644 --- a/LeanPool/ParameterFreeGradient/V7/ControllerStatements.lean +++ b/LeanPool/ParameterFreeGradient/V7/ControllerStatements.lean @@ -13,7 +13,7 @@ public import LeanPool.ParameterFreeGradient.V7.AboveTwoStatements Observable trial certification and amortized query bounds along the realized controller path. -/ -@[expose] public section +public section namespace V7 @@ -31,12 +31,12 @@ structure AnchorRunData (d : ℕ) where trace : List (Observation d) /-- The normalized signed power vector that attains the dual norm pairing. -/ -noncomputable def normingDirection (q : ℝ) (g : Point d) : Point d := +@[expose] noncomputable def normingDirection (q : ℝ) (g : Point d) : Point d := fun i => ((SignType.sign (g i) : ℝ) * |g i| ^ (q - 1)) / (lpNorm q g) ^ (q - 1) /-- The norming direction has unit primal norm and attains the gradient's dual norm. -/ -noncomputable def NormingDirectionStatement : Prop := +@[expose] noncomputable def NormingDirectionStatement : Prop := ∀ (p : ℝ), 1 < p → ∀ (d : ℕ) (g : Point d), 0 < lpNorm (conjugateExponent p) g → lpNorm p (normingDirection (conjugateExponent p) g) = 1 ∧ @@ -44,6 +44,7 @@ noncomputable def NormingDirectionStatement : Prop := lpNorm (conjugateExponent p) g /-- The candidate anchor achieves the required decrease from the initial point. -/ +@[expose] def AnchorTest (oracle : PairOracle d) (x0 : Point d) (G D : ℝ) (y : Point d) : Prop := oracle.value y ≤ oracle.value x0 - G * D / 2 @@ -51,7 +52,7 @@ def AnchorTest (oracle : PairOracle d) (x0 : Point d) (G D : ℝ) /-- The explicit dyadic ray search, including every rejected test and the first accepted test. These are algorithm-definition assumptions, not the named carrier's mathematical conclusions. -/ -def AnchorExecution (p : ℝ) (input : MethodInput d) (oracle : PairOracle d) +@[expose] def AnchorExecution (p : ℝ) (input : MethodInput d) (oracle : PairOracle d) (cached : CachedPair d) (run : AnchorRunData d) : Prop := let G := lpNorm (conjugateExponent p) cached.observation.gradient (∀ k, run.M k = (2 : ℝ) ^ k * input.M0) ∧ @@ -69,7 +70,7 @@ def AnchorExecution (p : ℝ) (input : MethodInput d) (oracle : PairOracle d) /-- U03/U13/U14/U19: source carrier for `lem:anchor`, keeping raw `M0`, accepted `Ma`, and `Da` distinct. -/ -noncomputable def AnchorStatement : Prop := +@[expose] noncomputable def AnchorStatement : Prop := ∀ (p : ℝ), 1 < p → ∀ (d : ℕ) (input : MethodInput d) (inst : PositiveInstance p d input.x0), input.p = p → 0 < input.eps → SecantInitialization input inst.oracle → @@ -95,16 +96,17 @@ structure ControllerVisit where D : ℝ /-- The specified visit occupies index `i` in the chronological controller path. -/ -def VisitAt (visits : List ControllerVisit) (i : ℕ) +@[expose] def VisitAt (visits : List ControllerVisit) (i : ℕ) (visit : ControllerVisit) : Prop := (visits.drop i).head? = some visit /-- The specified trial report occupies index `i` in the report list. -/ -def ReportAt (reports : List (TrialReport d)) (i : ℕ) +@[expose] def ReportAt (reports : List (TrialReport d)) (i : ℕ) (report : TrialReport d) : Prop := (reports.drop i).head? = some report /-- The initial visit and successive controller transitions agree with their trial reports. -/ +@[expose] def ControllerPath (G Ma Da : ℝ) (visits : List ControllerVisit) (reports : List (TrialReport d)) : Prop := visits.length = reports.length ∧ @@ -118,6 +120,7 @@ def ControllerPath (G Ma Da : ℝ) (visits : List ControllerVisit) | .scale _ => next.M = 2 * current.M ∧ next.D = G / next.M /-- The realized visits form the permitted geometric sequence of scales and radii. -/ +@[expose] def RealizedPathGeometricallyDominated (eps G Ma R : ℝ) (visits : List ControllerVisit) : Prop := ∃ (S : ℕ) (lastRadius : ℕ → ℕ), @@ -135,7 +138,7 @@ def RealizedPathGeometricallyDominated (eps G Ma R : ℝ) (Ms S * R / eps) ^ a / (1 - (2 : ℝ) ^ (-a))) /-- The observable guard kind is available in the selected exponent regime. -/ -def GuardAllowedInRegime (p : ℝ) (kind : ObservableGuardKind) : Prop := +@[expose] def GuardAllowedInRegime (p : ℝ) (kind : ObservableGuardKind) : Prop := if p = 2 then kind = .upperModel ∨ kind = .interpolation ∨ kind = .terminalDescent else @@ -144,6 +147,7 @@ def GuardAllowedInRegime (p : ℝ) (kind : ObservableGuardKind) : Prop := /-- The complete schedule belongs to the specified local routine. An early success or first failure consumes a prefix; Radius is legal only after the entire regime-appropriate schedule has been checked. -/ +@[expose] def GuardLedgerComplete (p : ℝ) (report : TrialReport d) (schedule : List (ObservableGuardCheck d)) : Prop := report.checkedGuards <+: schedule ∧ @@ -154,6 +158,7 @@ def GuardLedgerComplete (p : ℝ) (report : TrialReport d) /-- U15--U22: source carrier for `prop:certification`. Correctness, visited bounds, reset behavior, and realized-path accounting are distinct conjuncts. -/ +@[expose] noncomputable def TrialOutcomeCertificationStatement : Prop := ∀ (p : ℝ), 1 < p → ∀ (d : ℕ) (eps G Ma Da L R : ℝ), 0 < eps → 0 < G → 0 < Ma → 0 < Da → @@ -175,11 +180,12 @@ noncomputable def TrialOutcomeCertificationStatement : Prop := RealizedPathGeometricallyDominated eps G Ma R visits /-- The trial complexity exponent: one half below two, and `p / (p + 2)` above two. -/ -noncomputable def localCostExponent (p : ℝ) : ℝ := +@[expose] noncomputable def localCostExponent (p : ℝ) : ℝ := if p ≤ 2 then 1 / 2 else p / (p + 2) /-- G01--G02: source carrier for `lem:amortization`. Both geometric sums range over the realized path, never a rectangular product grid. -/ +@[expose] noncomputable def GeometricTrialAmortizationStatement : Prop := ∃ C : ℝ, 0 < C ∧ ∀ (p : ℝ), 1 < p → ∃ Cp : ℝ, 0 < Cp ∧ ∀ (eps G L R Ma Da : ℝ), diff --git a/LeanPool/ParameterFreeGradient/V7/EuclideanStatements.lean b/LeanPool/ParameterFreeGradient/V7/EuclideanStatements.lean index 284fba1833..4b883b641b 100644 --- a/LeanPool/ParameterFreeGradient/V7/EuclideanStatements.lean +++ b/LeanPool/ParameterFreeGradient/V7/EuclideanStatements.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.TrialInterfaces Finite Euclidean phase data, guard schedules, and the two-phase local trial contract. -/ -@[expose] public section +public section open scoped BigOperators @@ -42,6 +42,7 @@ structure EuclideanGapData (d m : ℕ) where trace : List (Observation d) /-- The initial state, coefficient equations, and accelerated Euclidean update recurrences. -/ +@[expose] def EuclideanGapDynamics (data : EuclideanGapData d m) : Prop := 0 < data.M ∧ data.A 0 = 0 ∧ data.x 0 = data.x0 ∧ data.w 0 = data.x0 ∧ ∀ k < m, @@ -59,6 +60,7 @@ def EuclideanGapDynamics (data : EuclideanGapData d m) : Prop := (data.a (k + 1) / data.A (k + 1)) • data.w (k + 1) /-- The Euclidean dynamics, radius bound, accepted models, and exact observation trace. -/ +@[expose] def EuclideanGapAssumptions (data : EuclideanGapData d m) : Prop := EuclideanGapDynamics data ∧ data.inst.R ≤ data.D ∧ data.x 0 = data.x0 ∧ data.w 0 = data.x0 ∧ @@ -84,6 +86,7 @@ def EuclideanGapAssumptions (data : EuclideanGapData d m) : Prop := 0 < data.A m /-- Source carrier for `lem:euclideangap` (E01). -/ +@[expose] noncomputable def EuclideanGapStatement : Prop := ∀ (d m : ℕ) (data : EuclideanGapData d m), EuclideanGapAssumptions data → @@ -114,6 +117,7 @@ structure OGMGData (d n : ℕ) where trace : List (Observation d) /-- The backward coefficient equations, initial state, and literal OGM-G update recurrences. -/ +@[expose] def OGMGDynamics (data : OGMGData d n) : Prop := 1 ≤ n ∧ 0 < data.M ∧ data.theta n = 1 ∧ data.u 0 = data.U ∧ data.vMinusOne = data.U ∧ @@ -133,6 +137,7 @@ def OGMGDynamics (data : OGMGData d n) : Prop := data.v n = data.u n - (1 / data.M) • data.oracle.gradient (data.u n) /-- The OGM-G dynamics, convex gradient oracle, attained minimum, guards, and exact trace. -/ +@[expose] def OGMGAssumptions (data : OGMGData d n) : Prop := OGMGDynamics data ∧ O3.IsConvexObjective data.oracle.value ∧ O3.IsCoordinateGradient data.oracle.value data.oracle.gradient ∧ @@ -163,6 +168,7 @@ def OGMGAssumptions (data : OGMGData d n) : Prop := TerminalDescentGuard data.M data.oracle (data.u n) (data.v n) /-- Source carrier for `lem:ogmg` (E02). -/ +@[expose] noncomputable def FiniteDataOGMGStatement : Prop := ∀ (d n : ℕ) (data : OGMGData d n), OGMGAssumptions data → (lpNorm 2 (data.oracle.gradient (data.u n))) ^ (2 : ℕ) ≤ @@ -171,7 +177,7 @@ noncomputable def FiniteDataOGMGStatement : Prop := data.theta 0 ≥ ((n : ℝ) + 1) / Real.sqrt 2 /-- The prescribed observation list for the Euclidean gap and OGM-G phases. -/ -def euclideanPlannedTrace (inst : PositiveInstance 2 d x0) +@[expose] def euclideanPlannedTrace (inst : PositiveInstance 2 d x0) (phaseA : EuclideanGapData d m) (phaseB : OGMGData d n) : List (Observation d) := ((List.range m).flatMap (fun k => @@ -182,12 +188,13 @@ def euclideanPlannedTrace (inst : PositiveInstance 2 d x0) [inst.oracle.observe (phaseB.v n)] /-- A guard check formed from the exact oracle observations at its two points. -/ +@[expose] def exactGuardCheck (kind : ObservableGuardKind) (oracle : PairOracle d) (x y : Point d) : ObservableGuardCheck d := ⟨kind, oracle.observe x, oracle.observe y⟩ /-- The upper-model, interpolation, and terminal-descent checks of a Euclidean trial. -/ -def euclideanGuardSchedule (inst : PositiveInstance 2 d x0) +@[expose] def euclideanGuardSchedule (inst : PositiveInstance 2 d x0) (phaseA : EuclideanGapData d m) (phaseB : OGMGData d n) : List (ObservableGuardCheck d) := ((List.range m).map (fun k => @@ -201,6 +208,7 @@ def euclideanGuardSchedule (inst : PositiveInstance 2 d x0) checkable. Phase-A upper-model checks are made after each two-query step; the ordered interpolation ledger is checked after `u_n` and before the separate terminal-descent query at `v_n`. -/ +@[expose] def EuclideanScaleTraceStopsAtFailure (inst : PositiveInstance 2 d x0) (report : TrialReport d) (phaseA : EuclideanGapData d m) (phaseB : OGMGData d n) : Prop := @@ -218,6 +226,7 @@ def EuclideanScaleTraceStopsAtFailure (inst : PositiveInstance 2 d x0) report.trace = euclideanPlannedTrace inst phaseA phaseB) /-- The linked Euclidean phases, guard schedule, and chronological trial report contract. -/ +@[expose] def EuclideanTrialOperationalContract (x0 : Point d) (M D : ℝ) (inst : PositiveInstance 2 d x0) (report : TrialReport d) (phaseA : EuclideanGapData d m) (phaseB : OGMGData d n) : Prop := @@ -250,6 +259,7 @@ def EuclideanTrialOperationalContract (x0 : Point d) (M D : ℝ) /-- Source carrier for `prop:euclideantrial` (E03), retaining the exact `2m+n+1` accounting and the distinct terminal descent query. -/ +@[expose] noncomputable def EuclideanTrialStatement : Prop := ∃ C : ℝ, 0 < C ∧ ∀ (d : ℕ) (eps M D : ℝ), 0 < eps → 0 < M → 0 < D → ∀ (x0 : Point d) diff --git a/LeanPool/ParameterFreeGradient/V7/FiniteProgram.lean b/LeanPool/ParameterFreeGradient/V7/FiniteProgram.lean index 30e876a29f..ae0be2ae56 100644 --- a/LeanPool/ParameterFreeGradient/V7/FiniteProgram.lean +++ b/LeanPool/ParameterFreeGradient/V7/FiniteProgram.lean @@ -10,7 +10,7 @@ public import LeanPool.ParameterFreeGradient.V7.TrialInterfaces /-! # Finite query programs shared by the geometry-specific trial machines -/ -@[expose] public section +public section namespace V7.CausalProgram @@ -31,7 +31,7 @@ noncomputable def Program.action : PackedProgram d → | ⟨fuel + 1, .query point next⟩ => .query point fun obs => ⟨fuel, next obs⟩ /-- The report obtained by evaluating the finite program against an oracle. -/ -noncomputable def Program.eval (oracle : PairOracle d) : +@[expose] noncomputable def Program.eval (oracle : PairOracle d) : (fuel : ℕ) → Program d fuel → List (Observation d) → TrialReport d | _, .finish guards outcome, history => ⟨history, guards, outcome⟩ | fuel + 1, .query point next, history => @@ -39,7 +39,7 @@ noncomputable def Program.eval (oracle : PairOracle d) : Program.eval oracle fuel (next obs) (history ++ [obs]) /-- The local trial induced by a family of initial finite query programs. -/ -noncomputable def programTrial +@[expose] noncomputable def programTrial (initial : ℝ → ℝ → CachedPair d → PackedProgram d) : LocalTrial d where State := PackedProgram d initial := initial diff --git a/LeanPool/ParameterFreeGradient/V7/Foundation.lean b/LeanPool/ParameterFreeGradient/V7/Foundation.lean index d3d20000f3..758d8c40af 100644 --- a/LeanPool/ParameterFreeGradient/V7/Foundation.lean +++ b/LeanPool/ParameterFreeGradient/V7/Foundation.lean @@ -15,7 +15,7 @@ This module contains transparent data carriers only. It deliberately does not import any historical O3 result or concrete O3 dispatcher. -/ -@[expose] public section +public section namespace V7 @@ -53,27 +53,29 @@ structure PairRunResult (d : ℕ) where trace : List (Observation d) /-- The number of oracle calls recorded after initialization. -/ -def PairRunResult.postInitializationCallCount (run : PairRunResult d) : ℕ := +@[expose] def PairRunResult.postInitializationCallCount (run : PairRunResult d) : ℕ := run.trace.length /-- Every trace entry equals the exact oracle observation at its recorded point. -/ -def TraceExact (oracle : PairOracle d) (trace : List (Observation d)) : Prop := +@[expose] def TraceExact (oracle : PairOracle d) (trace : List (Observation d)) : Prop := ∀ obs ∈ trace, obs = oracle.observe obs.point /-- The point occurs among the recorded oracle queries. -/ +@[expose] def WasQueried (trace : List (Observation d)) (x : Point d) : Prop := ∃ obs ∈ trace, obs.point = x /-- The point was queried at the specified chronological trace index. -/ +@[expose] def QueriedAt (trace : List (Observation d)) (k : ℕ) (x : Point d) : Prop := ∃ obs, (trace.drop k).head? = some obs ∧ obs.point = x /-- The returned point occurs in the run's query trace. -/ -def PairRunResult.returnedWasQueried (run : PairRunResult d) : Prop := +@[expose] def PairRunResult.returnedWasQueried (run : PairRunResult d) : Prop := WasQueried run.trace run.returned /-- The numerical input viewed in the underlying causal machine interface. -/ -def MethodInput.toO3 (input : MethodInput d) : O3.MethodInput d := +@[expose] def MethodInput.toO3 (input : MethodInput d) : O3.MethodInput d := ⟨input.p, input.eps, input.x0, input.z0, input.M0⟩ /-- A single causal machine family selected before `p`, dimension, or @@ -81,6 +83,7 @@ instance data. Objective information reaches it only through `query`. -/ abbrev RuntimeMethodFamily := (d : ℕ) → O3.FirstOrderMethod d /-- A finite-fuel execution of the underlying method produces the specified result and trace. -/ +@[expose] def Executes (method : O3.FirstOrderMethod d) (input : MethodInput d) (oracle : PairOracle d) (run : PairRunResult d) : Prop := ∃ (fuel : ℕ) (oldRun : O3.RunResult d), @@ -88,7 +91,7 @@ def Executes (method : O3.FirstOrderMethod d) (input : MethodInput d) run.returned = oldRun.returned ∧ run.trace = oldRun.queries /-- A supplied nondegenerate secant relation; discovery is outside the count. -/ -def SecantInitialization (input : MethodInput d) (oracle : PairOracle d) : Prop := +@[expose] def SecantInitialization (input : MethodInput d) (oracle : PairOracle d) : Prop := input.z0 ≠ input.x0 ∧ oracle.gradient input.z0 ≠ oracle.gradient input.x0 ∧ input.M0 = diff --git a/LeanPool/ParameterFreeGradient/V7/Guards.lean b/LeanPool/ParameterFreeGradient/V7/Guards.lean index bea8bc42c6..6e545026bf 100644 --- a/LeanPool/ParameterFreeGradient/V7/Guards.lean +++ b/LeanPool/ParameterFreeGradient/V7/Guards.lean @@ -12,41 +12,42 @@ public import LeanPool.ParameterFreeGradient.V7.PositiveModel Observable upper-model, gradient, cocoercivity, interpolation, and descent inequalities. -/ -@[expose] public section +public section namespace V7 /-- The objective's linearization error at `x`, based at `y`. -/ -noncomputable def BregmanRemainder (oracle : PairOracle d) +@[expose] noncomputable def BregmanRemainder (oracle : PairOracle d) (x y : Point d) : ℝ := oracle.value x - oracle.value y - pairing (oracle.gradient y) (x - y) /-- The quadratic upper model with estimate `M` bounds the objective at `y`. -/ -noncomputable def UpperModelGuard (p M : ℝ) (oracle : PairOracle d) +@[expose] noncomputable def UpperModelGuard (p M : ℝ) (oracle : PairOracle d) (x y : Point d) : Prop := oracle.value y ≤ oracle.value x + pairing (oracle.gradient x) (y - x) + (M / 2) * (lpNorm p (y - x)) ^ (2 : ℕ) /-- The two observed gradients satisfy the proposed Lipschitz bound in the dual norm. -/ -noncomputable def GradientGuard (p M : ℝ) (oracle : PairOracle d) +@[expose] noncomputable def GradientGuard (p M : ℝ) (oracle : PairOracle d) (x y : Point d) : Prop := lpNorm (conjugateExponent p) (oracle.gradient y - oracle.gradient x) ≤ M * lpNorm p (y - x) /-- Exact current orientation: `D_f(x,y)` uses the gradient at `y`. -/ -noncomputable def CocoercivityGuard (p M : ℝ) (oracle : PairOracle d) +@[expose] noncomputable def CocoercivityGuard (p M : ℝ) (oracle : PairOracle d) (x y : Point d) : Prop := BregmanRemainder oracle x y ≥ (lpNorm (conjugateExponent p) (oracle.gradient x - oracle.gradient y)) ^ (2 : ℕ) / (2 * M) /-- The observed Euclidean Bregman gap dominates the squared gradient difference. -/ -noncomputable def EuclideanInterpolationGuard (M : ℝ) (oracle : PairOracle d) +@[expose] noncomputable def EuclideanInterpolationGuard (M : ℝ) (oracle : PairOracle d) (xi xj : Point d) : Prop := oracle.value xi - oracle.value xj - pairing (oracle.gradient xj) (xi - xj) - (lpNorm 2 (oracle.gradient xi - oracle.gradient xj)) ^ (2 : ℕ) / (2 * M) ≥ 0 /-- The terminal gradient step achieves the decrease predicted by the smoothness estimate. -/ +@[expose] noncomputable def TerminalDescentGuard (M : ℝ) (oracle : PairOracle d) (u v : Point d) : Prop := oracle.value v ≤ oracle.value u - @@ -67,7 +68,7 @@ structure ObservableGuardFailure (d : ℕ) where y : Point d /-- The selected observable inequality fails for the supplied oracle and estimates. -/ -noncomputable def GuardFails (p M : ℝ) (oracle : PairOracle d) +@[expose] noncomputable def GuardFails (p M : ℝ) (oracle : PairOracle d) (w : ObservableGuardFailure d) : Prop := match w.kind with | .upperModel => ¬ UpperModelGuard p M oracle w.x w.y diff --git a/LeanPool/ParameterFreeGradient/V7/LowerBoundStatements.lean b/LeanPool/ParameterFreeGradient/V7/LowerBoundStatements.lean index 9e73c0477a..9ab0371ca9 100644 --- a/LeanPool/ParameterFreeGradient/V7/LowerBoundStatements.lean +++ b/LeanPool/ParameterFreeGradient/V7/LowerBoundStatements.lean @@ -14,7 +14,7 @@ public import LeanPool.ParameterFreeGradient.V7.StrictModel Smoothing kernels, resisting oracle completions, and known-parameter lower-bound statements. -/ -@[expose] public section +public section open scoped BigOperators @@ -29,6 +29,7 @@ structure DeterministicExactPairAlgorithm (d : ℕ) where output : Point d → List (Observation d) → Point d /-- Each trace point is the deterministic algorithm's query for the preceding history. -/ +@[expose] def GeneratedBy (algorithm : DeterministicExactPairAlgorithm d) (x0 : Point d) (trace : List (Observation d)) : Prop := ∀ (t : ℕ) (ht : t < trace.length), @@ -49,16 +50,18 @@ structure SmoothingKernelData (p : ℝ) (d : ℕ) where smooth : ℝ → (Point d → ℝ) → PairOracle d /-- The infimal convolution of the objective with the rescaled smoothing potential. -/ -noncomputable def localSmoothingValue (kernel : SmoothingKernelData p d) +@[expose] noncomputable def localSmoothingValue (kernel : SmoothingKernelData p d) (chi : ℝ) (ell : Point d → ℝ) (x : Point d) : ℝ := sInf {r : ℝ | ∃ v : Point d, r = ell (x + v) + chi * kernel.phi ((1 / chi) • v)} /-- The objective is one-Lipschitz with respect to the `ℓp` norm. -/ +@[expose] def IsOneLipschitz (p : ℝ) (f : Point d → ℝ) : Prop := ∀ x y, |f x - f y| ≤ lpNorm p (x - y) /-- The primal and dual transformations preserve their norms and mutual pairing. -/ +@[expose] def SignedLpSymmetry (p : ℝ) (Q Qdual : Point d → Point d) : Prop := (∀ x, lpNorm p (Q x) = lpNorm p x) ∧ (∀ s, lpNorm (conjugateExponent p) (Qdual s) = @@ -66,6 +69,7 @@ def SignedLpSymmetry (p : ℝ) (Q Qdual : Point d → Point d) : Prop := (∀ s x, pairing (Qdual s) (Q x) = pairing s x) /-- The regularity, curvature, normalization, and smoothing properties required of a kernel. -/ +@[expose] def SmoothingKernelAssumptions (kernel : SmoothingKernelData p d) : Prop := 0 < kernel.Mpd ∧ O3.IsConvexObjective kernel.phi ∧ @@ -106,10 +110,11 @@ def SmoothingKernelAssumptions (kernel : SmoothingKernelData p d) : Prop := (kernel.smooth chi ell).value (Q x) /-- The signed-coordinate-invariant power kernel used in the lower-bound construction. -/ -noncomputable def lowerKernelPhi (r0 theta : ℝ) (x : Point d) : ℝ := +@[expose] noncomputable def lowerKernelPhi (r0 theta : ℝ) (x : Point d) : ℝ := 2 * (∑ j, |x j| ^ r0) ^ (2 * theta / r0) /-- A smoothing kernel exists with the prescribed power formula and dimension-dependent bounds. -/ +@[expose] noncomputable def SmoothingKernelConstructionStatement : Prop := ∃ C : ℝ, 0 < C ∧ ∀ (p : ℝ), 2 < p → ∀ (d : ℕ), 2 ≤ d → ∃ (r0 theta : ℝ) (kernel : SmoothingKernelData p d), @@ -156,6 +161,7 @@ structure LowerCompletionData (p : ℝ) (d T : ℕ) where xi : ℕ → ℝ /-- The partial objective is exactly the maximum of the affine pieces selected through `t`. -/ +@[expose] def ResistingMaximumAt (data : LowerCompletionData p d T) (t : ℕ) : Prop := ∀ x, (∀ i ≤ t, @@ -167,6 +173,7 @@ def ResistingMaximumAt (data : LowerCompletionData p d T) (t : ℕ) : Prop := /-- The scales, fresh coordinates, oracle consistency, and adaptive queries of the resisting construction. -/ +@[expose] def LowerCompletionAssumptions (data : LowerCompletionData p d T) : Prop := 2 < p ∧ 2 ≤ d ∧ 1 ≤ T ∧ T ≤ d ∧ data.x0 = 0 ∧ @@ -200,6 +207,7 @@ def LowerCompletionAssumptions (data : LowerCompletionData p d T) : Prop := /-- Source carrier for `lem:above-lower-completion` (L01--L04): both value and gradient agree at every chronological query. -/ +@[expose] def AboveLowerExactPairCompletionStatement : Prop := ∀ (p : ℝ), 2 < p → ∀ (d T : ℕ) (data : LowerCompletionData p d T), LowerCompletionAssumptions data → @@ -212,17 +220,20 @@ structure LowerObjectiveData (p : ℝ) (d T : ℕ) extends LowerCompletionData p d T /-- The objective eventually exceeds every real bound outside a sufficiently large `ℓp` ball. -/ +@[expose] def IsCoerciveLp (p : ℝ) (f : Point d → ℝ) : Prop := ∀ B : ℝ, ∃ radius : ℝ, 0 ≤ radius ∧ ∀ x, radius ≤ lpNorm p x → B ≤ f x /-- The completion conditions together with convexity and the exact coordinate gradient. -/ +@[expose] def LowerObjectiveAssumptions (data : LowerObjectiveData p d T) : Prop := LowerCompletionAssumptions data.toLowerCompletionData ∧ O3.IsConvexObjective data.completedOracle.value ∧ O3.IsCoordinateGradient data.completedOracle.value data.completedOracle.gradient /-- Source carrier for `lem:above-lower-gap` (L05). -/ +@[expose] noncomputable def AboveLowerQueryGapStatement : Prop := ∀ (p : ℝ), 2 < p → ∀ (d T : ℕ) (data : LowerObjectiveData p d T), LowerObjectiveAssumptions data → @@ -235,6 +246,7 @@ noncomputable def AboveLowerQueryGapStatement : Prop := 1 / (16 * data.kernel.Mpd * (T : ℝ) ^ (1 + 2 / p)) /-- Source carrier for `lem:above-lower-outside` (L06). -/ +@[expose] noncomputable def AboveLowerOutsideGradientStatement : Prop := ∀ (p : ℝ), 2 < p → ∀ (d T : ℕ) (data : LowerObjectiveData p d T), LowerObjectiveAssumptions data → @@ -247,6 +259,7 @@ noncomputable def AboveLowerOutsideGradientStatement : Prop := lpNorm p x < 4 /-- Source carrier for `prop:above-lower-base-gradient` (L07). -/ +@[expose] noncomputable def AboveLowerBaseGradientStatement : Prop := ∀ (p : ℝ), 2 < p → ∀ (d T : ℕ) (data : LowerObjectiveData p d T), LowerObjectiveAssumptions data → @@ -256,6 +269,7 @@ noncomputable def AboveLowerBaseGradientStatement : Prop := 1 / (128 * data.kernel.Mpd * (T : ℝ) ^ (1 + 2 / p)) /-- Source carrier for `lem:above-lower-radius` (L08). -/ +@[expose] noncomputable def AboveLowerOptimizerRadiusStatement : Prop := ∀ (p : ℝ), 2 < p → ∀ (d T : ℕ), 2 ≤ d → 1 ≤ T → T ≤ d → ∀ kernel : SmoothingKernelData p d, SmoothingKernelAssumptions kernel → @@ -265,6 +279,7 @@ noncomputable def AboveLowerOptimizerRadiusStatement : Prop := rT = minimizerDistance p data.completedOracle data.x0 /-- An exact deterministic run with a nonempty trace charging its initial query. -/ +@[expose] def ChargedKnownParameterRun (algorithm : DeterministicExactPairAlgorithm d) (x0 : Point d) (oracle : PairOracle d) (trace : List (Observation d)) : Prop := GeneratedBy algorithm x0 trace ∧ TraceExact oracle trace ∧ @@ -272,6 +287,7 @@ def ChargedKnownParameterRun (algorithm : DeterministicExactPairAlgorithm d) /-- Upper half of the current known-parameter proposition. `Cp` occurs after `p` and before dimension and instance data. -/ +@[expose] noncomputable def KnownParameterAboveTwoUpperStatement : Prop := ∀ (p : ℝ), 2 < p → ∃ Cp : ℝ, 0 < Cp ∧ ∀ (d : ℕ) (eps L R : ℝ), 0 < eps → 0 < L → 0 < R → @@ -289,6 +305,7 @@ noncomputable def KnownParameterAboveTwoUpperStatement : Prop := /-- Lower half of the current proposition: deterministic, exact-pair, every first-`T` query, `T ≤ d`, and explicit `Mpd`. -/ +@[expose] noncomputable def KnownParameterAboveTwoLowerStatement : Prop := ∃ C : ℝ, 0 < C ∧ ∀ (p : ℝ), 2 < p → ∀ (d T : ℕ), 2 ≤ d → 1 ≤ T → T ≤ d → ∀ (L R : ℝ), 0 < L → 0 < R → @@ -324,6 +341,7 @@ noncomputable def KnownParameterAboveTwoLowerStatement : Prop := /-- Source carrier for `prop:pgtwo-optimality` (U11--U12, A01--A13, L01--L09). The upper and lower halves remain separately inspectable. -/ +@[expose] noncomputable def KnownParameterAboveTwoOptimalityStatement : Prop := KnownParameterAboveTwoUpperStatement ∧ KnownParameterAboveTwoLowerStatement diff --git a/LeanPool/ParameterFreeGradient/V7/MainStatement.lean b/LeanPool/ParameterFreeGradient/V7/MainStatement.lean index 3d7a470320..60e4e582d6 100644 --- a/LeanPool/ParameterFreeGradient/V7/MainStatement.lean +++ b/LeanPool/ParameterFreeGradient/V7/MainStatement.lean @@ -14,11 +14,12 @@ public import LeanPool.ParameterFreeGradient.V7.ControllerStatements The regime-dependent query rate and the main parameter-free convergence statement. -/ -@[expose] public section +public section namespace V7 /-- The regime-dependent main complexity rate, including the logarithmic smoothness-search cost. -/ +@[expose] noncomputable def CurrentMainRate (p Cp C Kbar L M0 : ℝ) : ℝ := if p < 2 then Cp * Kbar ^ (1 / 2 : ℝ) + Cp * Real.log (Real.exp 1 + L / M0) @@ -30,6 +31,7 @@ noncomputable def CurrentMainRate (p Cp C Kbar L M0 : ℝ) : ℝ := /-- G03 and `thm:main`: one runtime-`p` method family is selected first; the universal Euclidean constant precedes `p`, while `Cp` is selected after `p` and before dimension or instance data. -/ +@[expose] noncomputable def MainStatement : Prop := ∃ family : RuntimeMethodFamily, ∃ C : ℝ, 0 < C ∧ diff --git a/LeanPool/ParameterFreeGradient/V7/PositiveModel.lean b/LeanPool/ParameterFreeGradient/V7/PositiveModel.lean index c02427f1e8..929ac48c7c 100644 --- a/LeanPool/ParameterFreeGradient/V7/PositiveModel.lean +++ b/LeanPool/ParameterFreeGradient/V7/PositiveModel.lean @@ -19,25 +19,26 @@ starts after initialization. The strict-local and known-parameter lower bounds u the separate method models in `StrictModel` and `LowerBoundStatements`. -/ -@[expose] public section +public section namespace V7 /-- The oracle's gradient is the coordinate gradient of its value function. -/ -def IsCoordinateGradient (oracle : PairOracle d) : Prop := +@[expose] def IsCoordinateGradient (oracle : PairOracle d) : Prop := O3.IsCoordinateGradient oracle.value oracle.gradient /-- The set of global minimizers of the oracle's value function. -/ -def MinimizerSet (oracle : PairOracle d) : Set (Point d) := +@[expose] def MinimizerSet (oracle : PairOracle d) : Set (Point d) := O3.MinimizerSet oracle.value /-- The `ℓp` distance from the initial point to the objective's minimizer set. -/ +@[expose] noncomputable def minimizerDistance (p : ℝ) (oracle : PairOracle d) (x0 : Point d) : ℝ := O3.minimizerDistance p oracle.value x0 /-- The oracle gradient is `L`-Lipschitz from the primal norm to its dual norm. -/ -def IsLpSmooth (p L : ℝ) (oracle : PairOracle d) : Prop := +@[expose] def IsLpSmooth (p L : ℝ) (oracle : PairOracle d) : Prop := O3.IsLpSmooth p (conjugateExponent p) L oracle.gradient /-- Proof-side objective certificate. It is never an algorithm input. -/ @@ -53,18 +54,21 @@ structure PositiveInstance (p : ℝ) (d : ℕ) (x0 : Point d) where smooth : IsLpSmooth p L oracle /-- The initial distance to the minimizer set. -/ -noncomputable def PositiveInstance.R (inst : PositiveInstance p d x0) : ℝ := +@[expose] noncomputable def PositiveInstance.R (inst : PositiveInstance p d x0) : ℝ := minimizerDistance p inst.oracle x0 /-- The common minimum value, expressed as an infimum over minimizers. -/ +@[expose] noncomputable def PositiveInstance.fstar (inst : PositiveInstance p d x0) : ℝ := sInf (inst.oracle.value '' MinimizerSet inst.oracle) /-- The gradient-accuracy condition number `L * R / eps`. -/ +@[expose] noncomputable def conditionNumber (inst : PositiveInstance p d x0) (eps : ℝ) : ℝ := inst.L * inst.R / eps /-- The condition number truncated below at one. -/ +@[expose] noncomputable def conditionBar (inst : PositiveInstance p d x0) (eps : ℝ) : ℝ := max 1 (conditionNumber inst eps) diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Anchor.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Anchor.lean index 36e1e58abb..7e793d23ba 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Anchor.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Anchor.lean @@ -13,7 +13,7 @@ public import LeanPool.ParameterFreeGradient.O3.Stage3Anchor The anchor-search theorem transported to the current positive secant interface. -/ -@[expose] public section +public section namespace V7 diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Euclidean.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Euclidean.lean index f4b6b1f362..5735fca38b 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Euclidean.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Euclidean.lean @@ -14,7 +14,7 @@ public import LeanPool.ParameterFreeGradient.O3.Stage9FiniteDataOGMG Euclidean gap reduction and finite OGM-G guarantees in the current interface. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/GuardAdapters.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/GuardAdapters.lean index df41c42a9f..a813e803c6 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/GuardAdapters.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/GuardAdapters.lean @@ -14,7 +14,7 @@ Compatibility and soundness of the current observable guards and the original an inequalities. -/ -@[expose] public section +public section namespace V7 diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/ResidualAlgebra.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/ResidualAlgebra.lean index de0302ce24..3d249c7367 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/ResidualAlgebra.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/ResidualAlgebra.lean @@ -16,7 +16,7 @@ The weighted reversal, pairing and triangular-sum identities depend on the resid map and recurrence, independently of the coefficient regime. -/ -@[expose] public section +public section open scoped BigOperators @@ -200,7 +200,7 @@ lemma triangle_sum {E : Type*} [AddCommMonoid E] ac_rfl /-- Dual sequence expressed by the weighted summation-by-parts formula. -/ -noncomputable def dualP (n : ℕ) (u : ScalarSeq) +@[expose] noncomputable def dualP (n : ℕ) (u : ScalarSeq) (C : VectorSeq d) (k : ℕ) : Point d := (1 / u (n - (k + 1))) • C (k + 1) - weightedSum (k + 1) diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Shared.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Shared.lean index b838ae421b..5c622b653f 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Shared.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Shared.lean @@ -13,7 +13,7 @@ public import LeanPool.ParameterFreeGradient.O3.Stage3AnchorNorming The normalized dual direction used by the anchor search and its norm-attaining pairing. -/ -@[expose] public section +public section namespace V7 diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/AnalyticBridge.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/AnalyticBridge.lean index 9f4f4ea1f4..a01b5a7717 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/AnalyticBridge.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/AnalyticBridge.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage1E03.Semantics The Euclidean source execution connected to the analytic gap and terminal-gradient estimates. -/ -@[expose] public section +public section namespace V7 namespace Stage1E03 diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/Certificate.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/Certificate.lean index e8aa265ae4..1a23b5e8b1 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/Certificate.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/Certificate.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage1E03.AnalyticBridge Correctness certificates for all possible reports of the Euclidean local trial. -/ -@[expose] public section +public section namespace V7 namespace Stage1E03 diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/Correctness.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/Correctness.lean index cc7f3a23c8..341ec83df6 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/Correctness.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/Correctness.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage1E03.Shapes The source Euclidean guard schedule and its operational report contract. -/ -@[expose] public section +public section namespace V7 namespace Stage1E03 @@ -22,12 +22,12 @@ noncomputable local instance correctnessPropDecidable (q : Prop) : Decidable q : Classical.propDecidable q /-- The accelerated endpoint passed from the estimate phase to OGM-G. -/ -noncomputable def sourceU (inst : PositiveInstance 2 d x0) (M : ℝ) +@[expose] noncomputable def sourceU (inst : PositiveInstance 2 d x0) (M : ℝ) (n : ℕ) : Point d := (sourceEstimateState inst.oracle M x0 n).accelerated /-- The new OGM-G observations after its reused initial query. -/ -noncomputable def sourceNewTrace (inst : PositiveInstance 2 d x0) +@[expose] noncomputable def sourceNewTrace (inst : PositiveInstance 2 d x0) (M : ℝ) (n : ℕ) : List (Observation d) := let cfg := O3.stage9ExecutionConfig n inst.oracle M (sourceU inst M n) (List.range n).map fun j => @@ -42,13 +42,14 @@ noncomputable def sourceInterpolationSchedule inst.oracle.observe (O3.ogmgState cfg i).current /-- The oracle observation at the terminal OGM-G gradient-step point. -/ +@[expose] noncomputable def sourceTerminalObservation (inst : PositiveInstance 2 d x0) (M : ℝ) (n : ℕ) : Observation d := let cfg := O3.stage9ExecutionConfig n inst.oracle M (sourceU inst M n) inst.oracle.observe (O3.ogmgV cfg n) /-- The descent check between the final OGM-G query and its gradient step. -/ -noncomputable def sourceTerminalGuard +@[expose] noncomputable def sourceTerminalGuard (inst : PositiveInstance 2 d x0) (M : ℝ) (n : ℕ) : ObservableGuardCheck d := let cfg := O3.stage9ExecutionConfig n inst.oracle M (sourceU inst M n) @@ -56,13 +57,13 @@ noncomputable def sourceTerminalGuard (inst.oracle.observe (O3.ogmgV cfg n)) /-- The complete planned trace of both Euclidean phases and the terminal query. -/ -noncomputable def sourcePlannedTrace (inst : PositiveInstance 2 d x0) +@[expose] noncomputable def sourcePlannedTrace (inst : PositiveInstance 2 d x0) (M : ℝ) (n : ℕ) : List (Observation d) := phaseATraceFrom inst M 0 n ++ sourceNewTrace inst M n ++ [sourceTerminalObservation inst M n] /-- The complete planned guard schedule of the Euclidean trial. -/ -noncomputable def sourceGuardSchedule (inst : PositiveInstance 2 d x0) +@[expose] noncomputable def sourceGuardSchedule (inst : PositiveInstance 2 d x0) (M : ℝ) (n : ℕ) : List (ObservableGuardCheck d) := phaseAGuardsFrom inst M 0 n ++ sourceInterpolationSchedule inst M n ++ [sourceTerminalGuard inst M n] @@ -137,6 +138,7 @@ theorem source_schedule_pairs (inst : PositiveInstance 2 d x0) sourcePlannedTrace, terminalCheck] /-- The possible early-failure and completed-report shapes of the Euclidean trial. -/ +@[expose] def FullReportShape (inst : PositiveInstance 2 d x0) (eps M : ℝ) (n : ℕ) (report : TrialReport d) : Prop := (∃ r < n, ∃ failed, diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/Ledger.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/Ledger.lean index 889ccede91..f40263b45e 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/Ledger.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/Ledger.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage1E03.Machine The ordered guard evaluator records exactly the accepted prefix and first failure. -/ -@[expose] public section +public section namespace V7 namespace Stage1E03 diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/Machine.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/Machine.lean index 90b4eb84bd..d88b89b2b1 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/Machine.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/Machine.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.O3.Stage10EuclideanGuards /-! Dependency-pure causal machine for the frozen V7 Euclidean trial. -/ -@[expose] public section +public section namespace V7 namespace Stage1E03 @@ -22,6 +22,7 @@ noncomputable local instance e03PropDecidable (q : Prop) : Decidable q := Classical.propDecidable q /-- The selected observable inequality evaluated solely from its recorded observations. -/ +@[expose] noncomputable def CheckHolds (p M : ℝ) (check : ObservableGuardCheck d) : Prop := match check.kind with | .upperModel => @@ -46,28 +47,28 @@ noncomputable def CheckHolds (p M : ℝ) (check : ObservableGuardCheck d) : Prop (lpNorm 2 check.xPair.gradient) ^ (2 : ℕ) / (2 * M) /-- An upper-model guard formed from the query and proposed next-point observations. -/ -noncomputable def upperCheck (oy ox : Observation d) : ObservableGuardCheck d := +@[expose] noncomputable def upperCheck (oy ox : Observation d) : ObservableGuardCheck d := ⟨.upperModel, oy, ox⟩ /-- A Euclidean interpolation guard formed from two observations. -/ -noncomputable def interpolationCheck (oi oj : Observation d) : +@[expose] noncomputable def interpolationCheck (oi oj : Observation d) : ObservableGuardCheck d := ⟨.interpolation, oi, oj⟩ /-- A terminal-descent guard formed from the final query and gradient-step observations. -/ -noncomputable def terminalCheck (on ov : Observation d) : +@[expose] noncomputable def terminalCheck (on ov : Observation d) : ObservableGuardCheck d := ⟨.terminalDescent, on, ov⟩ /-- The ordered list of interpolation checks for every pair through horizon `n`. -/ -noncomputable def allInterpolationChecks (n : ℕ) +@[expose] noncomputable def allInterpolationChecks (n : ℕ) (obsAt : ℕ → Observation d) : List (ObservableGuardCheck d) := (List.range (n + 1)).flatMap fun i => (List.range (n + 1)).map fun j => interpolationCheck (obsAt i) (obsAt j) /-- Pure inspection: the error branch is exactly the prefix through the first failed current-V7 point-carrying guard. -/ -noncomputable def evaluateChecks (p M : ℝ) : +@[expose] noncomputable def evaluateChecks (p M : ℝ) : List (ObservableGuardCheck d) → Except (List (ObservableGuardCheck d) × ObservableGuardCheck d) (List (ObservableGuardCheck d)) @@ -86,6 +87,7 @@ export V7.CausalProgram.Program (query finish action eval runFuel_eq_eval) end Program /-- The ceiling of the Euclidean trial's accuracy-dependent iteration horizon. -/ +@[expose] noncomputable def horizon (eps M D : ℝ) : ℕ := Nat.ceil (2 * Real.sqrt (M * D / eps)) @@ -136,7 +138,7 @@ theorem horizon_gradient_budget {eps M D : ℝ} simpa only [kappa, n, s] using hnum) /-- The next accelerated estimate state after receiving a query observation. -/ -noncomputable def nextEstimateState (M : ℝ) (x0 : Point d) (k : ℕ) +@[expose] noncomputable def nextEstimateState (M : ℝ) (x0 : Point d) (k : ℕ) (state : O3.EuclideanEstimateState d) (oy : Observation d) : O3.EuclideanEstimateState d := let A := O3.euclideanA k @@ -147,7 +149,7 @@ noncomputable def nextEstimateState (M : ℝ) (x0 : Point d) (k : ℕ) /-- The estimate-sequence query formed from the current accelerated point and quadratic minimizer. -/ -noncomputable def estimateQuery (M : ℝ) (x0 : Point d) (k : ℕ) +@[expose] noncomputable def estimateQuery (M : ℝ) (x0 : Point d) (k : ℕ) (state : O3.EuclideanEstimateState d) : Point d := O3.euclideanBarycenter (O3.euclideanA k) (O3.euclideanWeight (O3.euclideanA k)) state.accelerated @@ -155,6 +157,7 @@ noncomputable def estimateQuery (M : ℝ) (x0 : Point d) (k : ℕ) state.cumulativeGradient) /-- One OGM-G state update using the observed gradient and prescribed momentum coefficients. -/ +@[expose] noncomputable def ogmgStep (n : ℕ) (M : ℝ) (i : ℕ) (state : O3.OGMGExecutionState d) (oi : Observation d) : O3.OGMGExecutionState d := @@ -168,7 +171,7 @@ noncomputable def ogmgStep (n : ℕ) (M : ℝ) (i : ℕ) ⟨v + momentum • (v - state.previousV) + correction • (v - state.current), v⟩ /-- The final one-query program checking descent and selecting the terminal outcome. -/ -noncomputable def terminalProgram (eps M : ℝ) (n : ℕ) +@[expose] noncomputable def terminalProgram (eps M : ℝ) (n : ℕ) (obsAt : ℕ → Observation d) (exec : O3.OGMGExecutionState d) (guards : List (ObservableGuardCheck d)) : Program d 1 := let on := obsAt n @@ -183,7 +186,7 @@ noncomputable def terminalProgram (eps M : ℝ) (n : ℕ) else .finish allGuards (.scale terminal) /-- The finite OGM-G query program followed by interpolation and terminal-descent checks. -/ -noncomputable def phaseBProgram (eps M : ℝ) (n i : ℕ) +@[expose] noncomputable def phaseBProgram (eps M : ℝ) (n i : ℕ) (exec : O3.OGMGExecutionState d) (obsAt : ℕ → Observation d) (guards : List (ObservableGuardCheck d)) : (fuel : ℕ) → Program d (fuel + 1) @@ -199,12 +202,12 @@ noncomputable def phaseBProgram (eps M : ℝ) (n i : ℕ) (fun j => if j = i + 1 then oi else obsAt j) guards fuel /-- The query bound for the remaining estimate phase and the following OGM-G phase. -/ -def phaseABudget (n : ℕ) : ℕ → ℕ +@[expose] def phaseABudget (n : ℕ) : ℕ → ℕ | 0 => n + 1 | fuel + 1 => phaseABudget n fuel + 2 /-- The estimate-phase query program, which checks each upper model before continuing. -/ -noncomputable def phaseAProgram (eps M : ℝ) (x0 : Point d) (n k : ℕ) +@[expose] noncomputable def phaseAProgram (eps M : ℝ) (x0 : Point d) (n k : ℕ) (estimate : O3.EuclideanEstimateState d) (last : Option (Observation d)) (guards : List (ObservableGuardCheck d)) : @@ -228,6 +231,7 @@ noncomputable def phaseAProgram (eps M : ℝ) (x0 : Point d) (n k : ℕ) else .finish (guards ++ [check]) (.scale check) /-- The Euclidean local trial with a fixed planned horizon. -/ +@[expose] noncomputable def euclideanLocalTrial (eps : ℝ) (x0 : Point d) (n : ℕ) : LocalTrial d := programTrial fun M _D _cached => diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/Proof.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/Proof.lean index 212aa2820f..3fc6b3ddb0 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/Proof.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/Proof.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage1E03.Certificate Existence of a certified Euclidean two-phase local trial with its query bound. -/ -@[expose] public section +public section namespace V7 diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/Refinement.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/Refinement.lean index 31c1a9b288..e7328c83b3 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/Refinement.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/Refinement.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage1E03.SourceData The finite Euclidean query programs evaluate to the literal source reports. -/ -@[expose] public section +public section namespace V7 namespace Stage1E03 @@ -22,13 +22,13 @@ noncomputable local instance refinementPropDecidable (q : Prop) : Decidable q := Classical.propDecidable q /-- A report with earlier observations and checked guards prepended. -/ -def prependReport (history : List (Observation d)) +@[expose] def prependReport (history : List (Observation d)) (guards : List (ObservableGuardCheck d)) (tail : TrialReport d) : TrialReport d := ⟨history ++ tail.trace, guards ++ tail.checkedGuards, tail.outcome⟩ /-- The source terminal-query report, determined by the descent guard and gradient accuracy. -/ -noncomputable def sourceTerminalReport (inst : PositiveInstance 2 d x0) +@[expose] noncomputable def sourceTerminalReport (inst : PositiveInstance 2 d x0) (eps M : ℝ) (n : ℕ) (U : Point d) : TrialReport d := let cfg := O3.stage9ExecutionConfig n inst.oracle M U let on := inst.oracle.observe (O3.ogmgState cfg n).current @@ -41,7 +41,7 @@ noncomputable def sourceTerminalReport (inst : PositiveInstance 2 d x0) else ⟨[ov], [terminal], .scale terminal⟩ /-- The source phase-B suffix that checks interpolation before terminal descent. -/ -noncomputable def sourcePhaseBSuffix (inst : PositiveInstance 2 d x0) +@[expose] noncomputable def sourcePhaseBSuffix (inst : PositiveInstance 2 d x0) (eps M : ℝ) (n : ℕ) (U : Point d) : TrialReport d := let cfg := O3.stage9ExecutionConfig n inst.oracle M U let checks := allInterpolationChecks n fun i => @@ -51,7 +51,7 @@ noncomputable def sourcePhaseBSuffix (inst : PositiveInstance 2 d x0) | .ok passed => prependReport [] passed (sourceTerminalReport inst eps M n U) /-- The source OGM-G report with its new observations and concluding checks. -/ -noncomputable def sourcePhaseBReport (inst : PositiveInstance 2 d x0) +@[expose] noncomputable def sourcePhaseBReport (inst : PositiveInstance 2 d x0) (eps M : ℝ) (n : ℕ) (U : Point d) : TrialReport d := let cfg := O3.stage9ExecutionConfig n inst.oracle M U let newTrace := (List.range n).map fun j => @@ -59,7 +59,7 @@ noncomputable def sourcePhaseBReport (inst : PositiveInstance 2 d x0) prependReport newTrace [] (sourcePhaseBSuffix inst eps M n U) /-- The recursively assembled source report for the remaining estimate phase and OGM-G. -/ -noncomputable def sourcePhaseAReport (inst : PositiveInstance 2 d x0) +@[expose] noncomputable def sourcePhaseAReport (inst : PositiveInstance 2 d x0) (eps M : ℝ) (n : ℕ) : ℕ → ℕ → TrialReport d | _, 0 => sourcePhaseBReport inst eps M n (sourceEstimateState inst.oracle M x0 n).accelerated diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/Semantics.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/Semantics.lean index 00fab376ea..506b9c34da 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/Semantics.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/Semantics.lean @@ -13,7 +13,7 @@ Compatibility of source Euclidean states and recorded checks with the original a execution. -/ -@[expose] public section +public section namespace V7 namespace Stage1E03 @@ -41,6 +41,7 @@ theorem minimizer_gradient_zero (inst : PositiveInstance 2 d x0) exact (O3.lpNorm_eq_zero_iff (by norm_num)).mp hnorm /-- The current positive instance expressed in the original admissible-instance interface. -/ +@[expose] noncomputable def legacyInstance (inst : PositiveInstance 2 d x0) (eps : ℝ) (heps : 0 < eps) (hG : eps < lpNorm 2 (inst.oracle.gradient x0)) : diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/Shapes.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/Shapes.lean index db359eab04..8b8cd7612b 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/Shapes.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/Shapes.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage1E03.Refinement The early-failure and complete shapes of source Euclidean reports. -/ -@[expose] public section +public section namespace V7 namespace Stage1E03 @@ -22,7 +22,7 @@ noncomputable local instance shapesPropDecidable (q : Prop) : Decidable q := Classical.propDecidable q /-- The alternating query and accelerated-point observations of an estimate-phase segment. -/ -noncomputable def phaseATraceFrom (inst : PositiveInstance 2 d x0) +@[expose] noncomputable def phaseATraceFrom (inst : PositiveInstance 2 d x0) (M : ℝ) (k fuel : ℕ) : List (Observation d) := (List.range fuel).flatMap fun j => [inst.oracle.observe (estimateQuery M x0 (k + j) @@ -31,7 +31,7 @@ noncomputable def phaseATraceFrom (inst : PositiveInstance 2 d x0) (sourceEstimateState inst.oracle M x0 (k + j + 1)).accelerated] /-- The upper-model guards corresponding to an estimate-phase segment. -/ -noncomputable def phaseAGuardsFrom (inst : PositiveInstance 2 d x0) +@[expose] noncomputable def phaseAGuardsFrom (inst : PositiveInstance 2 d x0) (M : ℝ) (k fuel : ℕ) : List (ObservableGuardCheck d) := (List.range fuel).map fun j => upperCheck @@ -98,6 +98,7 @@ theorem phaseAGuardsFrom_succ (inst : PositiveInstance 2 d x0) simp [phaseAGuardsFrom] /-- The report records precisely the first failed guard after a prefix of accepted guards. -/ +@[expose] def FailureLedger (p M : ℝ) (report : TrialReport d) (failed : ObservableGuardCheck d) : Prop := report.outcome = .scale failed ∧ @@ -106,6 +107,7 @@ def FailureLedger (p M : ℝ) (report : TrialReport d) ¬ CheckHolds p M failed /-- Every observation used in a checked guard occurs in the report's trace. -/ +@[expose] def GuardPairsInTrace (report : TrialReport d) : Prop := ∀ check ∈ report.checkedGuards, check.xPair ∈ report.trace ∧ check.yPair ∈ report.trace diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/SourceData.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/SourceData.lean index 382a5c8ed5..6477f68d74 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/SourceData.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage1E03/SourceData.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage1E03.Ledger The literal Euclidean trajectories packaged with their dynamics and exact traces. -/ -@[expose] public section +public section open scoped BigOperators @@ -20,6 +20,7 @@ namespace V7 namespace Stage1E03 /-- The literal recursive estimate state driven by an arbitrary value-gradient oracle. -/ +@[expose] noncomputable def sourceEstimateState (oracle : PairOracle d) (M : ℝ) (x0 : Point d) : ℕ → O3.EuclideanEstimateState d | 0 => ⟨x0, 0⟩ @@ -28,6 +29,7 @@ noncomputable def sourceEstimateState (oracle : PairOracle d) (M : ℝ) (oracle.observe (estimateQuery M x0 k (sourceEstimateState oracle M x0 k))) /-- The quadratic potential minimizer associated with the source estimate state. -/ +@[expose] noncomputable def sourceEstimateMinimizer (oracle : PairOracle d) (M : ℝ) (x0 : Point d) (k : ℕ) : Point d := O3.Stage8EuclideanMinimizer.euclideanPsiMinimizer M x0 @@ -39,7 +41,7 @@ noncomputable def sourcePhaseAWeight : ℕ → ℝ | k + 1 => O3.euclideanWeight (O3.euclideanA k) /-- The literal source estimate execution packaged as Euclidean gap-phase data. -/ -noncomputable def sourcePhaseAData (inst : PositiveInstance 2 d x0) +@[expose] noncomputable def sourcePhaseAData (inst : PositiveInstance 2 d x0) (M D : ℝ) (m : ℕ) : EuclideanGapData d m where x0 := x0 inst := inst @@ -56,7 +58,7 @@ noncomputable def sourcePhaseAData (inst : PositiveInstance 2 d x0) inst.oracle.observe (sourceEstimateState inst.oracle M x0 (k + 1)).accelerated] /-- The literal source OGM-G execution packaged as finite phase data. -/ -noncomputable def sourcePhaseBData (inst : PositiveInstance 2 d x0) +@[expose] noncomputable def sourcePhaseBData (inst : PositiveInstance 2 d x0) (M : ℝ) (n : ℕ) (U : Point d) : OGMGData d n := let cfg := O3.stage9ExecutionConfig n inst.oracle M U { oracle := inst.oracle diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage2/Controller.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage2/Controller.lean index 90409ecce5..5f2f7f2f75 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage2/Controller.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage2/Controller.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage2.PathShape Observable trial outcomes certify success or an insufficient scale or radius estimate. -/ -@[expose] public section +public section namespace V7 namespace Stage2 diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage2/Geometric.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage2/Geometric.lean index fdcdbfc36c..12a614a527 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage2/Geometric.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage2/Geometric.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage2.GuardSoundness Positivity and geometric-sum estimates for the local complexity exponent. -/ -@[expose] public section +public section namespace V7 namespace Stage2 diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage2/GuardSoundness.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage2/GuardSoundness.lean index d843fc1b3c..bdc340f115 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage2/GuardSoundness.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage2/GuardSoundness.lean @@ -13,7 +13,7 @@ Cocoercivity guards hold above the true smoothness scale, so failure certifies a estimate. -/ -@[expose] public section +public section namespace V7 namespace Stage2 diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage2/PathShape.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage2/PathShape.lean index c4464b1c34..1ab3d1a39a 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage2/PathShape.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage2/PathShape.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage2.Geometric The realized controller path has the prescribed geometric sequence of scales and radii. -/ -@[expose] public section +public section namespace V7 namespace Stage2 @@ -24,18 +24,18 @@ private theorem controllerVisit_ext {v w : ControllerVisit} simp_all /-- The dyadic smoothness estimate at scale index `s`. -/ -def pathScale (Ma : ℝ) (s : ℕ) : ℝ := (2 : ℝ) ^ s * Ma +@[expose] def pathScale (Ma : ℝ) (s : ℕ) : ℝ := (2 : ℝ) ^ s * Ma /-- The dyadic radius at scale index `s` and radius index `j`. -/ -noncomputable def pathRadius (G Ma : ℝ) (s j : ℕ) : ℝ := +@[expose] noncomputable def pathRadius (G Ma : ℝ) (s j : ℕ) : ℝ := (2 : ℝ) ^ j * G / pathScale Ma s /-- The controller visit associated with the two geometric indices. -/ -noncomputable def pathVisit (G Ma : ℝ) (s j : ℕ) : ControllerVisit := +@[expose] noncomputable def pathVisit (G Ma : ℝ) (s j : ℕ) : ControllerVisit := ⟨pathScale Ma s, pathRadius G Ma s j⟩ /-- The chronological path through each scale's realized initial segment of radii. -/ -noncomputable def pathGrid (G Ma : ℝ) (S : ℕ) (lastRadius : ℕ → ℕ) : +@[expose] noncomputable def pathGrid (G Ma : ℝ) (S : ℕ) (lastRadius : ℕ → ℕ) : List ControllerVisit := (List.range (S + 1)).flatMap fun s => (List.range (lastRadius s + 1)).map fun j => pathVisit G Ma s j diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage2Resume/Amortization.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage2Resume/Amortization.lean index ca8e17ea6e..032c89b8f1 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage2Resume/Amortization.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage2Resume/Amortization.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage2Resume.Transport The total local trial cost is bounded by the endpoint costs of the realized controller path. -/ -@[expose] public section +public section namespace V7 namespace Stage2Resume diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage2Resume/Positivity.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage2Resume/Positivity.lean index 13251c292e..70f02a980b 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage2Resume/Positivity.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage2Resume/Positivity.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage2.Controller Positive constants and endpoint estimates for geometric trial amortization. -/ -@[expose] public section +public section namespace V7 namespace Stage2Resume diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage2Resume/Transport.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage2Resume/Transport.lean index 18f6e5f40d..2a3a184499 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage2Resume/Transport.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage2Resume/Transport.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage2Resume.Positivity Transport of sums over the realized geometric visits into chronological report-call bounds. -/ -@[expose] public section +public section namespace V7 namespace Stage2Resume diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwo/Dual.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwo/Dual.lean index e42ae1235f..eda0d1d6ae 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwo/Dual.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwo/Dual.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage3BelowTwo.Identity The below-two dual phase terminal gradient bound from the residual identity. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwo/Geometry.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwo/Geometry.lean index 40bc8253e6..af7758ed7a 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwo/Geometry.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwo/Geometry.lean @@ -18,7 +18,7 @@ public import Mathlib.Analysis.Normed.Operator.Asymptotics Conjugacy, gradients, and Bregman geometry of the scaled squared norms below exponent two. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwo/Identity.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwo/Identity.lean index e04347a09f..b3f4a932fa 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwo/Identity.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwo/Identity.lean @@ -13,7 +13,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage3BelowTwo.Primal The pointwise primal-dual residual identity for the below-two coefficient recurrences. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwo/Primal.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwo/Primal.lean index dd8e9d25a8..03e1d3027f 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwo/Primal.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwo/Primal.lean @@ -14,7 +14,7 @@ public import LeanPool.ParameterFreeGradient.O3.Stage3Descent The below-two primal potential identity and terminal objective-gap bound. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoResumeS3E/GuardScaling.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoResumeS3E/GuardScaling.lean index f9c595b363..c5ba68868a 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoResumeS3E/GuardScaling.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoResumeS3E/GuardScaling.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage3BelowTwo.Dual Observable below-two guards transported through the trial's affine normalization. -/ -@[expose] public section +public section namespace V7 diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/AnalyticBridge.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/AnalyticBridge.lean index f74929e65c..cc447c48be 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/AnalyticBridge.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/AnalyticBridge.lean @@ -13,7 +13,7 @@ public import Mathlib.Topology.MetricSpace.HausdorffDistance The completed below-two phases imply the requested physical terminal-gradient bound. -/ -@[expose] public section +public section namespace V7.Stage3BelowTwoS3F diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Bounds.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Bounds.lean index 2a322d3ffa..697d44a12e 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Bounds.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Bounds.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage3BelowTwoS3F.Contrac The below-two trial's query count is bounded by its accuracy-dependent horizon. -/ -@[expose] public section +public section namespace V7.Stage3BelowTwoS3F diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Certificate.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Certificate.lean index 22cd051b14..1b24879860 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Certificate.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Certificate.lean @@ -13,7 +13,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage2.GuardSoundness Every below-two report shape supplies the required correctness and guard certificates. -/ -@[expose] public section +public section namespace V7.Stage3BelowTwoS3F diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Coefficients.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Coefficients.lean index de93a3fef6..e01c6d3335 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Coefficients.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Coefficients.lean @@ -13,7 +13,7 @@ The explicit below-two coefficient matrices satisfy recurrence, support, and row conditions. -/ -@[expose] public section +public section open scoped BigOperators @@ -30,6 +30,7 @@ noncomputable def increment (n k : ℕ) : ℝ := if k < n then weight n k - (if k = 0 then 0 else weight n (k - 1)) else 0 /-- The subdiagonal coefficient matrix selecting each weighted gradient increment. -/ +@[expose] noncomputable def alpha (n : ℕ) : ScalarMatrix := fun row i => if 0 < row ∧ row ≤ n then if i = row - 1 then increment n (row - 1) else 0 diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Contract.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Contract.lean index eb52fa4397..9dd6832cbf 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Contract.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Contract.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage3BelowTwoS3F.Certifi The below-two report shape yields its guard ledger, call accounting, and operational contract. -/ -@[expose] public section +public section namespace V7.Stage3BelowTwoS3F diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/DualRecursion.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/DualRecursion.lean index 41b03c82d3..267fb71391 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/DualRecursion.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/DualRecursion.lean @@ -13,12 +13,13 @@ The mutually recursive normalized query and gradient-accumulator trajectories of dual phase. -/ -@[expose] public section +public section namespace V7.Stage3BelowTwoS3F mutual /-- The recursively generated normalized query points of the below-two dual phase. -/ + @[expose] noncomputable def dualQ (p : ℝ) (n : ℕ) (oracle : PairOracle d) : ℕ → Point d | 0 => 0 @@ -28,6 +29,7 @@ mutual termination_by k => k /-- The recursively accumulated dual vectors in the below-two dual phase. -/ + @[expose] noncomputable def dualR (p : ℝ) (n : ℕ) (oracle : PairOracle d) : ℕ → Point d | 0 => -(coeffB n n n) • oracle.gradient 0 diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/DualTrajectory.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/DualTrajectory.lean index a64ff66e39..d792d926b8 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/DualTrajectory.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/DualTrajectory.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage3BelowTwoS3F.DualRec The below-two dual trajectory has the required dynamics and exact chronological observations. -/ -@[expose] public section +public section namespace V7.Stage3BelowTwoS3F @@ -70,6 +70,7 @@ noncomputable def dualTrace (p : ℝ) (n : ℕ) (oracle : PairOracle d) : (List.range (n + 1)).map fun k => oracle.observe (dualQ p n oracle k) /-- The concrete dual trajectories and coefficients packaged as below-two phase data. -/ +@[expose] noncomputable def dualData (p : ℝ) (n : ℕ) (oracle : PairOracle d) : BelowDualData p d n where oracle := oracle diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Ledger.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Ledger.lean index 2a8fefa3ca..c2cd81014b 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Ledger.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Ledger.lean @@ -12,12 +12,12 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage3BelowTwoS3F.Semanti Consecutive below-two guard checks match the cached observation and the two phase traces. -/ -@[expose] public section +public section namespace V7.Stage3BelowTwoS3F /-- The cocoercivity checks between consecutive observations, starting from a cached observation. -/ -noncomputable def chainChecks (first : Observation d) : List (Observation d) → +@[expose] noncomputable def chainChecks (first : Observation d) : List (Observation d) → List (ObservableGuardCheck d) | [] => [] | obs :: rest => cocoCheck first obs :: chainChecks obs rest diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Machine.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Machine.lean index c93e8e1044..d9c9f124a3 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Machine.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Machine.lean @@ -13,7 +13,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage3BelowTwoS3F.DualTra Finite causal query programs implementing the below-two primal and dual phases. -/ -@[expose] public section +public section namespace V7.Stage3BelowTwoS3F @@ -22,11 +22,12 @@ noncomputable local instance machinePropDecidable (q : Prop) : Decidable q := Classical.propDecidable q /-- The observed physical gradient rescaled into normalized trial coordinates. -/ +@[expose] noncomputable def normalizedGradient (M D : ℝ) (obs : Observation d) : Point d := (1 / (M * D)) • obs.gradient /-- The cocoercivity guard formed from consecutive observations. -/ -noncomputable def cocoCheck (before after : Observation d) : +@[expose] noncomputable def cocoCheck (before after : Observation d) : ObservableGuardCheck d := ⟨.cocoercivity, before, after⟩ /-- The cocoercivity inequality reconstructed from a guard's two recorded observations. -/ @@ -42,6 +43,7 @@ noncomputable def checkHolds (p M : ℝ) (check : ObservableGuardCheck d) : Prop /-- The form actually evaluated by the machine, written directly from the two returned exact pairs. -/ +@[expose] noncomputable def cocoPairHolds (p M : ℝ) (before after : Observation d) : Prop := before.value - after.value - pairing after.gradient (before.point - after.point) ≥ @@ -55,6 +57,7 @@ export V7.CausalProgram.Program (query finish action eval runFuel_eq_eval) end Program /-- The below-two dual query program with early accuracy or guard-failure termination. -/ +@[expose] noncomputable def dualProgram (p eps M D : ℝ) (n k : ℕ) (center : Point d) (q r : Point d) (G : VectorSeq d) (previous : Observation d) (guards : List (ObservableGuardCheck d)) : @@ -78,11 +81,13 @@ noncomputable def dualProgram (p eps M D : ℝ) (n k : ℕ) else .finish guardsNext (.scale check) /-- The remaining primal query budget plus the complete dual query budget. -/ +@[expose] def phaseOneBudget (n : ℕ) : ℕ → ℕ | 0 => n | fuel + 1 => phaseOneBudget n fuel + 1 /-- The below-two primal query program that passes its endpoint to the dual phase. -/ +@[expose] noncomputable def phaseOneProgram (p eps M D : ℝ) (x0 : Point d) (n k : ℕ) (state : PrimalState d) (previous : Observation d) (guards : List (ObservableGuardCheck d)) : @@ -112,6 +117,7 @@ noncomputable def phaseOneProgram (p eps M D : ℝ) (x0 : Point d) (n k : ℕ) else .finish guardsNext (.scale check) /-- The complete below-two local trial initialized with the cached starting observation. -/ +@[expose] noncomputable def belowLocalTrial (p eps : ℝ) (x0 : Point d) (n : ℕ) : LocalTrial d := programTrial fun M D cached => diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Normalization.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Normalization.lean index d34f49e68e..df6b6905b3 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Normalization.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Normalization.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage3BelowTwoS3F.Ledger Convexity, coordinate gradients, and lower bounds survive affine oracle normalization. -/ -@[expose] public section +public section namespace V7.Stage3BelowTwoS3F diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/PrimalTrajectory.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/PrimalTrajectory.lean index 462530a2e0..41485a3759 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/PrimalTrajectory.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/PrimalTrajectory.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage3BelowTwoS3F.Coeffic The literal below-two primal trajectory has the required dynamics and exact observations. -/ -@[expose] public section +public section namespace V7.Stage3BelowTwoS3F @@ -26,6 +26,7 @@ structure PrimalState (d : ℕ) where x : Point d /-- The literal below-two primal trajectory starting at the zero normalized state. -/ +@[expose] noncomputable def primalState (p : ℝ) (n : ℕ) (oracle : PairOracle d) : ℕ → PrimalState d | 0 => ⟨0, 0, 0⟩ @@ -59,6 +60,7 @@ noncomputable def primalTrace (p : ℝ) (n : ℕ) (oracle : PairOracle d) : (List.range (n + 1)).map fun k => oracle.observe (primalState p n oracle k).x /-- The concrete primal trajectory packaged with a comparison minimizer and minimum value. -/ +@[expose] noncomputable def primalData (p : ℝ) (n : ℕ) (oracle : PairOracle d) (z : Point d) (fstar : ℝ) : BelowPrimalData p d n where oracle := oracle diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Proof.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Proof.lean index 51f31da079..3d4f31d085 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Proof.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Proof.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage3BelowTwoS3F.Bounds Existence of the certified below-two local trial with its complete operational contract. -/ -@[expose] public section +public section namespace V7 diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Semantics.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Semantics.lean index 913e7ab50a..3b0bc22130 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Semantics.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Semantics.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage3BelowTwoS3F.Shapes The below-two query programs produce exactly the permitted report shapes. -/ -@[expose] public section +public section namespace V7.Stage3BelowTwoS3F diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Shapes.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Shapes.lean index f51664e044..3d3cfb7f1f 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Shapes.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage3BelowTwoS3F/Shapes.lean @@ -12,55 +12,65 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage3BelowTwoS3F.Machine Physical observations, guard schedules, and possible outcomes of the below-two trial. -/ -@[expose] public section +public section namespace V7.Stage3BelowTwoS3F /-- The ceiling of the below-two iteration horizon determined by accuracy and trial estimates. -/ +@[expose] noncomputable def horizon (p eps M D : ℝ) : ℕ := Nat.ceil (2 * Real.sqrt (M * D / ((p - 1) * eps))) /-- The phase-one oracle normalized around the initial point. -/ +@[expose] noncomputable def phaseOneOracle (x0 : Point d) (M D : ℝ) (oracle : PairOracle d) : PairOracle d := normalizedPairOracle x0 M D oracle /-- The normalized phase-one state at its prescribed accuracy-dependent horizon. -/ +@[expose] noncomputable def phaseOneState (p eps M D : ℝ) (x0 : Point d) (oracle : PairOracle d) (k : ℕ) : PrimalState d := primalState p (horizon p eps M D) (phaseOneOracle x0 M D oracle) k /-- The physical oracle observation corresponding to a normalized primal iterate. -/ +@[expose] noncomputable def phaseOneObs (p eps M D : ℝ) (x0 : Point d) (oracle : PairOracle d) (k : ℕ) : Observation d := oracle.observe (x0 + D • (phaseOneState p eps M D x0 oracle k).x) /-- The physical endpoint of phase one used as the center of phase two. -/ +@[expose] noncomputable def phaseTwoCenter (p eps M D : ℝ) (x0 : Point d) (oracle : PairOracle d) : Point d := (phaseOneObs p eps M D x0 oracle (horizon p eps M D)).point /-- The phase-two oracle normalized around the completed primal endpoint. -/ +@[expose] noncomputable def phaseTwoOracle (p eps M D : ℝ) (x0 : Point d) (oracle : PairOracle d) : PairOracle d := normalizedPairOracle (phaseTwoCenter p eps M D x0 oracle) M D oracle /-- The physical oracle observation corresponding to a normalized dual query. -/ +@[expose] noncomputable def phaseTwoObs (p eps M D : ℝ) (x0 : Point d) (oracle : PairOracle d) (k : ℕ) : Observation d := oracle.observe (phaseTwoCenter p eps M D x0 oracle + D • dualQ p (horizon p eps M D) (phaseTwoOracle p eps M D x0 oracle) k) /-- The new primal observations after the reused initial query. -/ +@[expose] noncomputable def phaseOneNewTrace (p eps M D : ℝ) (x0 : Point d) (oracle : PairOracle d) (m : ℕ) : List (Observation d) := (List.range m).map fun k => phaseOneObs p eps M D x0 oracle (k + 1) /-- The new dual observations after the reused phase-one endpoint. -/ +@[expose] noncomputable def phaseTwoNewTrace (p eps M D : ℝ) (x0 : Point d) (oracle : PairOracle d) (m : ℕ) : List (Observation d) := (List.range m).map fun k => phaseTwoObs p eps M D x0 oracle (k + 1) /-- The consecutive cocoercivity checks in the completed primal prefix. -/ +@[expose] noncomputable def phaseOneChecks (p eps M D : ℝ) (x0 : Point d) (oracle : PairOracle d) (m : ℕ) : List (ObservableGuardCheck d) := (List.range m).map fun k => cocoCheck @@ -68,6 +78,7 @@ noncomputable def phaseOneChecks (p eps M D : ℝ) (x0 : Point d) (phaseOneObs p eps M D x0 oracle (k + 1)) /-- The consecutive cocoercivity checks in the completed dual prefix. -/ +@[expose] noncomputable def phaseTwoChecks (p eps M D : ℝ) (x0 : Point d) (oracle : PairOracle d) (m : ℕ) : List (ObservableGuardCheck d) := (List.range m).map fun k => cocoCheck @@ -75,6 +86,7 @@ noncomputable def phaseTwoChecks (p eps M D : ℝ) (x0 : Point d) (phaseTwoObs p eps M D x0 oracle (k + 1)) /-- The ordered guard checks from the completed prefixes of both phases. -/ +@[expose] noncomputable def allChecks (p eps M D : ℝ) (x0 : Point d) (oracle : PairOracle d) (m₁ m₂ : ℕ) : List (ObservableGuardCheck d) := phaseOneChecks p eps M D x0 oracle m₁ ++ diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwo/Constants.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwo/Constants.lean index bb9b6f50bd..eee10324ff 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwo/Constants.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwo/Constants.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage4AboveTwo.Geometry Positivity of the constants and scales used by the above-two phases. -/ -@[expose] public section +public section namespace V7.Stage4AboveTwo diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwo/Geometry.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwo/Geometry.lean index d5423975ad..dcf1894c38 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwo/Geometry.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwo/Geometry.lean @@ -14,7 +14,7 @@ public import LeanPool.ParameterFreeGradient.O3.Stage2RouteB Conjugacy, gradients, and uniform convexity of the above-two power mirror geometry. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwo/Identity.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwo/Identity.lean index 1d7a47a4c8..9f21835d8a 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwo/Identity.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwo/Identity.lean @@ -15,7 +15,7 @@ public import LeanPool.ParameterFreeGradient.O3.Stage2RouteD The pointwise primal-dual residual identity for the above-two coefficient recurrences. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwo/PrimalResidual.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwo/PrimalResidual.lean index fc57ae4666..9dc68ced56 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwo/PrimalResidual.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwo/PrimalResidual.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage4AboveTwo.Identity Lower bounds for the mixed gradient and mirror residual in above-two geometry. -/ -@[expose] public section +public section namespace V7.Stage4AboveTwo @@ -195,7 +195,7 @@ theorem mixedVectorResidual_lower {p u d : ℝ} (hp : 2 < p) linarith /-- The sum of quadratic gradient, power mirror, and mixed-pairing residual terms. -/ -noncomputable def aboveMixedResidual (p : ℝ) (n : ℕ) +@[expose] noncomputable def aboveMixedResidual (p : ℝ) (n : ℕ) (u dw : ScalarSeq) (A B : VectorSeq d) : ℝ := ∑ k ∈ Finset.range n, ((u k / 2) * (lpNorm (conjugateExponent p) (A k - A (k + 1))) ^ (2 : ℕ) + diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwo/WeightBalance.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwo/WeightBalance.lean index 56c0783eb2..c932c80094 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwo/WeightBalance.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwo/WeightBalance.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage4AboveTwo.Constants The above-two weight scale balances accumulated residual error against terminal weight growth. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoDualPhase/DualEnergy.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoDualPhase/DualEnergy.lean index a4bba8ef98..e1a8d605d8 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoDualPhase/DualEnergy.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoDualPhase/DualEnergy.lean @@ -13,7 +13,7 @@ public import LeanPool.ParameterFreeGradient.O3.Stage3Descent The above-two dual trajectory satisfies the terminal row, query, and energy identities. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoDualPhase/PhaseBounds.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoDualPhase/PhaseBounds.lean index e31e756b39..c7cc67e674 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoDualPhase/PhaseBounds.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoDualPhase/PhaseBounds.lean @@ -12,18 +12,18 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage4AboveTwoDualPhase.D The prescribed primal and dual horizons imply objective-gap and terminal-gradient bounds. -/ -@[expose] public section +public section namespace V7.Stage4AboveTwoDualPhase /-- The scaled quadratic weight sequence held constant from the terminal index onward. -/ -noncomputable def plateauU (p eta : ℝ) (n : ℕ) : ScalarSeq := +@[expose] noncomputable def plateauU (p eta : ℝ) (n : ℕ) : ScalarSeq := fun k ↦ if k < n then aboveGamma p eta n * ((k : ℝ) + 1) ^ (2 : ℕ) else aboveGamma p eta n * (n : ℝ) ^ (2 : ℕ) /-- The increments of the scaled quadratic weight sequence with terminal plateau. -/ -noncomputable def plateauDw (p eta : ℝ) (n : ℕ) : ScalarSeq := +@[expose] noncomputable def plateauDw (p eta : ℝ) (n : ℕ) : ScalarSeq := fun k ↦ plateauU p eta n k - (if k = 0 then 0 else plateauU p eta n (k - 1)) diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/AnalyticBridge.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/AnalyticBridge.lean index 5a80a49a25..817f8aa68c 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/AnalyticBridge.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/AnalyticBridge.lean @@ -13,7 +13,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage3BelowTwoS3F.Analyti The completed above-two phases imply the requested physical terminal-gradient accuracy. -/ -@[expose] public section +public section namespace V7.Stage4AboveTwoFinalTrial diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Bounds.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Bounds.lean index 088817d20a..6461c35489 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Bounds.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Bounds.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage4AboveTwoFinalTrial. The above-two trial's total query count obeys its regime-dependent rate. -/ -@[expose] public section +public section namespace V7.Stage4AboveTwoFinalTrial diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Certificate.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Certificate.lean index 5af42c6721..2186827132 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Certificate.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Certificate.lean @@ -13,7 +13,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage2.GuardSoundness Every above-two report shape supplies correctness and exact guard certificates. -/ -@[expose] public section +public section namespace V7.Stage4AboveTwoFinalTrial diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Coefficients.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Coefficients.lean index dfaf395498..7d3427cb6a 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Coefficients.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Coefficients.lean @@ -13,21 +13,24 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage3BelowTwoS3F.Machine The above-two trial coefficients satisfy recurrence, support, and row-sum assumptions. -/ -@[expose] public section +public section open scoped BigOperators namespace V7.Stage4AboveTwoFinalTrial /-- The terminal-plateau weight sequence used by the above-two trial. -/ +@[expose] noncomputable def weight (p eta : ℝ) (n : ℕ) : ScalarSeq := Stage4AboveTwoDualPhase.plateauU p eta n /-- The increments of the above-two trial's weight sequence. -/ +@[expose] noncomputable def increment (p eta : ℝ) (n : ℕ) : ScalarSeq := Stage4AboveTwoDualPhase.plateauDw p eta n /-- The subdiagonal matrix selecting weighted gradient increments in an above-two phase. -/ +@[expose] noncomputable def alpha (p eta : ℝ) (n : ℕ) : ScalarMatrix := fun row i => if 0 < row ∧ row ≤ n then if i = row - 1 then increment p eta n (row - 1) else 0 diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Contract.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Contract.lean index bc8ca383ed..eed81ba9e4 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Contract.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Contract.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage4AboveTwoFinalTrial. The concrete above-two phase trajectories satisfy the operational trial contract. -/ -@[expose] public section +public section namespace V7.Stage4AboveTwoFinalTrial diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Ledger.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Ledger.lean index cc457f3567..6ed599db1e 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Ledger.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Ledger.lean @@ -13,7 +13,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage3BelowTwoS3F.Ledger Above-two reports have complete consecutive guard ledgers and bounded call counts. -/ -@[expose] public section +public section namespace V7.Stage4AboveTwoFinalTrial diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Machine.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Machine.lean index 7b86b10a43..0bc1cee9f5 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Machine.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Machine.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage4AboveTwoFinalTrial. Finite causal query programs implementing the above-two primal and dual phases. -/ -@[expose] public section +public section namespace V7.Stage4AboveTwoFinalTrial @@ -23,6 +23,7 @@ noncomputable local instance machinePropDecidable (q : Prop) : Decidable q := Classical.propDecidable q /-- The above-two dual query program with early accuracy or guard-failure termination. -/ +@[expose] noncomputable def dualProgram (p eps M D eta : ℝ) (n k : ℕ) (center : Point d) (q r : Point d) (G : VectorSeq d) (previous : Observation d) (guards : List (ObservableGuardCheck d)) : @@ -46,11 +47,13 @@ noncomputable def dualProgram (p eps M D eta : ℝ) (n k : ℕ) else .finish guardsNext (.scale check) /-- The remaining primal query budget plus the prescribed dual horizon. -/ +@[expose] def phaseOneBudget (nD : ℕ) : ℕ → ℕ | 0 => nD | fuel + 1 => phaseOneBudget nD fuel + 1 /-- The above-two primal query program that initializes the dual phase at its endpoint. -/ +@[expose] noncomputable def phaseOneProgram (p eps M D eta₁ eta₂ : ℝ) (x0 : Point d) (n₁ n₂ k : ℕ) (state : PrimalState d) (previous : Observation d) (guards : List (ObservableGuardCheck d)) : @@ -81,6 +84,7 @@ noncomputable def phaseOneProgram (p eps M D eta₁ eta₂ : ℝ) else .finish guardsNext (.scale check) /-- The complete above-two local trial with its primal and dual horizons. -/ +@[expose] noncomputable def aboveLocalTrial (p eps : ℝ) (x0 : Point d) (nf nd : ℕ) : LocalTrial d := programTrial fun M D cached => diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Proof.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Proof.lean index 42935faa68..db4541c9bf 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Proof.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Proof.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage4AboveTwoFinalTrial. Existence of the certified above-two two-phase trial and its query complexity bound. -/ -@[expose] public section +public section namespace V7 diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Semantics.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Semantics.lean index c73e27ce58..90d4d18e75 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Semantics.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Semantics.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage4AboveTwoFinalTrial. The above-two query programs produce exactly the permitted report shapes. -/ -@[expose] public section +public section namespace V7.Stage4AboveTwoFinalTrial diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Shapes.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Shapes.lean index f5f4fadfe5..4cd33d3e7f 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Shapes.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Shapes.lean @@ -12,37 +12,43 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage4AboveTwoFinalTrial. The physical above-two phase observations, guard schedules, and terminal outcome shapes. -/ -@[expose] public section +public section namespace V7.Stage4AboveTwoFinalTrial open V7.Stage3BelowTwoS3F /-- The above-two primal oracle normalized around the initial point. -/ +@[expose] noncomputable def phaseOneOracle (x0 : Point d) (M D : ℝ) (oracle : PairOracle d) : PairOracle d := normalizedPairOracle x0 M D oracle /-- The normalized primal state at the prescribed primal budget and horizon. -/ +@[expose] noncomputable def phaseOneState (p eps M D : ℝ) (x0 : Point d) (oracle : PairOracle d) (k : ℕ) : PrimalState d := primalState p (etaF p) (nF p eps M D) (phaseOneOracle x0 M D oracle) k /-- The physical oracle observation at a normalized above-two primal iterate. -/ +@[expose] noncomputable def phaseOneObs (p eps M D : ℝ) (x0 : Point d) (oracle : PairOracle d) (k : ℕ) : Observation d := oracle.observe (x0 + D • (phaseOneState p eps M D x0 oracle k).x) /-- The completed primal endpoint used as the physical center of the dual phase. -/ +@[expose] noncomputable def phaseTwoCenter (p eps M D : ℝ) (x0 : Point d) (oracle : PairOracle d) : Point d := (phaseOneObs p eps M D x0 oracle (nF p eps M D)).point /-- The above-two dual oracle normalized around the primal endpoint. -/ +@[expose] noncomputable def phaseTwoOracle (p eps M D : ℝ) (x0 : Point d) (oracle : PairOracle d) : PairOracle d := normalizedPairOracle (phaseTwoCenter p eps M D x0 oracle) M D oracle /-- The physical oracle observation at a normalized above-two dual query. -/ +@[expose] noncomputable def phaseTwoObs (p eps M D : ℝ) (x0 : Point d) (oracle : PairOracle d) (k : ℕ) : Observation d := oracle.observe (phaseTwoCenter p eps M D x0 oracle + @@ -50,16 +56,19 @@ noncomputable def phaseTwoObs (p eps M D : ℝ) (x0 : Point d) (phaseTwoOracle p eps M D x0 oracle) k) /-- The new primal observations after the reused initial query. -/ +@[expose] noncomputable def phaseOneNewTrace (p eps M D : ℝ) (x0 : Point d) (oracle : PairOracle d) (m : ℕ) : List (Observation d) := (List.range m).map fun k => phaseOneObs p eps M D x0 oracle (k + 1) /-- The new dual observations after the reused primal endpoint. -/ +@[expose] noncomputable def phaseTwoNewTrace (p eps M D : ℝ) (x0 : Point d) (oracle : PairOracle d) (m : ℕ) : List (Observation d) := (List.range m).map fun k => phaseTwoObs p eps M D x0 oracle (k + 1) /-- The consecutive cocoercivity checks in the completed above-two primal prefix. -/ +@[expose] noncomputable def phaseOneChecks (p eps M D : ℝ) (x0 : Point d) (oracle : PairOracle d) (m : ℕ) : List (ObservableGuardCheck d) := (List.range m).map fun k => cocoCheck @@ -67,6 +76,7 @@ noncomputable def phaseOneChecks (p eps M D : ℝ) (x0 : Point d) (phaseOneObs p eps M D x0 oracle (k + 1)) /-- The consecutive cocoercivity checks in the completed above-two dual prefix. -/ +@[expose] noncomputable def phaseTwoChecks (p eps M D : ℝ) (x0 : Point d) (oracle : PairOracle d) (m : ℕ) : List (ObservableGuardCheck d) := (List.range m).map fun k => cocoCheck @@ -74,6 +84,7 @@ noncomputable def phaseTwoChecks (p eps M D : ℝ) (x0 : Point d) (phaseTwoObs p eps M D x0 oracle (k + 1)) /-- The ordered guard checks from the completed prefixes of both above-two phases. -/ +@[expose] noncomputable def allChecks (p eps M D : ℝ) (x0 : Point d) (oracle : PairOracle d) (m₁ m₂ : ℕ) : List (ObservableGuardCheck d) := phaseOneChecks p eps M D x0 oracle m₁ ++ phaseTwoChecks p eps M D x0 oracle m₂ diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Trajectory.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Trajectory.lean index 82bac2316e..d75efb730a 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Trajectory.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/Trajectory.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage4AboveTwoFinalTrial. The above-two dual trajectory satisfies its dynamics and exact observation requirements. -/ -@[expose] public section +public section namespace V7.Stage4AboveTwoFinalTrial @@ -69,6 +69,7 @@ noncomputable def dualTrace (p eta : ℝ) (n : ℕ) (oracle : PairOracle d) : (List.range (n + 1)).map fun k => oracle.observe (dualQ p eta n oracle k) /-- The concrete dual trajectories and coefficients packaged as above-two phase data. -/ +@[expose] noncomputable def dualData (p eta : ℝ) (n : ℕ) (oracle : PairOracle d) : AboveDualPhaseData p d n where oracle := oracle diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/TrajectoryDefinitions.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/TrajectoryDefinitions.lean index 58f677f7fc..1c51e143ae 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/TrajectoryDefinitions.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoFinalTrial/TrajectoryDefinitions.lean @@ -13,21 +13,25 @@ The above-two trial parameters, explicit primal trajectory, and mutually recursi trajectory. -/ -@[expose] public section +public section namespace V7.Stage4AboveTwoFinalTrial /-- The accuracy normalized by the trial's smoothness and distance estimates. -/ -noncomputable def delta (eps M D : ℝ) : ℝ := eps / (M * D) +@[expose] noncomputable def delta (eps M D : ℝ) : ℝ := eps / (M * D) /-- The primal phase error budget `1 / p`. -/ +@[expose] noncomputable def etaF (p : ℝ) : ℝ := 1 / p /-- The dual phase error budget determined by the normalized accuracy. -/ +@[expose] noncomputable def etaD (p eps M D : ℝ) : ℝ := delta eps M D ^ conjugateExponent p / conjugateExponent p /-- The ceiling of the primal horizon required by the above-two gap bound. -/ +@[expose] noncomputable def nF (p eps M D : ℝ) : ℕ := Nat.ceil ((aboveHp p / delta eps M D) ^ (p / (p + 2))) /-- The ceiling of the dual horizon required by the above-two gradient bound. -/ +@[expose] noncomputable def nD (p eps M D : ℝ) : ℕ := Nat.ceil ((aboveJp p / delta eps M D) ^ (p / (p + 2))) @@ -65,6 +69,7 @@ structure PrimalState (d : ℕ) where x : Point d /-- The literal above-two primal trajectory starting at the zero normalized state. -/ +@[expose] noncomputable def primalState (p eta : ℝ) (n : ℕ) (oracle : PairOracle d) : ℕ → PrimalState d | 0 => ⟨0, 0, 0⟩ @@ -98,6 +103,7 @@ noncomputable def primalTrace (p eta : ℝ) (n : ℕ) (oracle : PairOracle d) : (List.range (n + 1)).map fun k => oracle.observe (primalState p eta n oracle k).x /-- The concrete above-two primal trajectory packaged with its minimum objective value. -/ +@[expose] noncomputable def primalData (p eta : ℝ) (n : ℕ) (oracle : PairOracle d) (fstar : ℝ) : AbovePrimalPhaseData p d n where oracle := oracle @@ -152,6 +158,7 @@ theorem primal_queried_at (p eta : ℝ) (n : ℕ) (oracle : PairOracle d) mutual /-- The recursively generated normalized query points of the above-two dual phase. -/ + @[expose] noncomputable def dualQ (p eta : ℝ) (n : ℕ) (oracle : PairOracle d) : ℕ → Point d | 0 => 0 @@ -160,6 +167,7 @@ mutual termination_by k => k /-- The recursively accumulated vectors of the above-two dual phase. -/ + @[expose] noncomputable def dualR (p eta : ℝ) (n : ℕ) (oracle : PairOracle d) : ℕ → Point d | 0 => -(coeffB p eta n n n) • oracle.gradient 0 diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoPrimalRepair/PrimalEnergy.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoPrimalRepair/PrimalEnergy.lean index 4d2705e710..24b2205a1d 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoPrimalRepair/PrimalEnergy.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage4AboveTwoPrimalRepair/PrimalEnergy.lean @@ -14,7 +14,7 @@ public import LeanPool.ParameterFreeGradient.O3.Stage3Descent The above-two primal potential identity and terminal objective-gap estimate. -/ -@[expose] public section +public section namespace V7.Stage4AboveTwoPrimalRepair diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLower/KernelElementary.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLower/KernelElementary.lean index d7d08039a9..396e8010b5 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLower/KernelElementary.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLower/KernelElementary.lean @@ -13,7 +13,7 @@ public import LeanPool.ParameterFreeGradient.O3.GeometryExperimental Elementary positivity, normalization, and norm-power identities for the smoothing kernel. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLower diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLower/LocalityBridge.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLower/LocalityBridge.lean index 60845e2cd0..d3ef7f42a5 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLower/LocalityBridge.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLower/LocalityBridge.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.LowerBoundStatements Neighborhood equality of smooth objective values determines the complete exact oracle pair. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLower @@ -44,6 +44,7 @@ convolution: equality of the original objectives on the closed smoothing ball must make the two smoothed value functions equal on a neighbourhood of the centre. The strict boundary inequality of the kernel is what supplies the required interior slack. -/ +@[expose] def LocalSmoothingNeighborhoodStability (kernel : SmoothingKernelData p d) : Prop := ∀ (chi : ℝ), 0 < chi → ∀ ell₁ ell₂ : Point d → ℝ, O3.IsConvexObjective ell₁ → IsOneLipschitz p ell₁ → @@ -54,6 +55,7 @@ def LocalSmoothingNeighborhoodStability (kernel : SmoothingKernelData p d) : Pro /-- Smoothing a convex one-Lipschitz objective produces an oracle with the exact coordinate gradient. -/ +@[expose] def SmoothingCoordinateGradientCore (kernel : SmoothingKernelData p d) : Prop := ∀ (chi : ℝ), 0 < chi → ∀ ell : Point d → ℝ, O3.IsConvexObjective ell → IsOneLipschitz p ell → diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLower/Parameters.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLower/Parameters.lean index 61d050d1e2..ff1e0c7ae6 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLower/Parameters.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLower/Parameters.lean @@ -13,12 +13,12 @@ public import Mathlib.Analysis.Complex.ExponentialBounds Explicit exponents and dimension-dependent Hessian constants for the smoothing kernel. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLower /-- The kernel coordinate exponent, capped by three times the logarithm of the dimension. -/ -noncomputable def kernelR0 (p : ℝ) (d : ℕ) : ℝ := +@[expose] noncomputable def kernelR0 (p : ℝ) (d : ℕ) : ℝ := min p (3 * Real.log d) /-- The kernel power parameter chosen strictly between one and half the coordinate exponent. -/ diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerResume/InfimalAttainment.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerResume/InfimalAttainment.lean index dc9b33baf5..392320e9e1 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerResume/InfimalAttainment.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerResume/InfimalAttainment.lean @@ -14,7 +14,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage5AboveTwoLowerS5AGlo Attainment and interior-radius bounds for the kernel's infimal-convolution minimizers. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerResume/InfimalLocalityClosure.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerResume/InfimalLocalityClosure.lean index 78f3bc33c3..edbe4fcc5c 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerResume/InfimalLocalityClosure.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerResume/InfimalLocalityClosure.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage5AboveTwoLowerResume Locality of the infimal smoothing value and its exact value-gradient observations. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLowerResume diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/BaseGradient.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/BaseGradient.lean index adafbe14b8..cbe5195c38 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/BaseGradient.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/BaseGradient.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage5AboveTwoLowerS5A2En A lower bound for the completed hard objective's gradient at the initial point. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLowerS5A2Envelope diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/Closure.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/Closure.lean index 519c41de80..1c47adc817 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/Closure.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/Closure.lean @@ -14,7 +14,7 @@ The selected envelope gradient closes the smoothing kernel's derivative, smoothn locality properties. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLowerS5A2Envelope diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/ConditionalSmoothness.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/ConditionalSmoothness.lean index c1a11c0e65..b9fa31da03 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/ConditionalSmoothness.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/ConditionalSmoothness.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage5AboveTwoLowerS5A2En Conditional Lipschitz and uniqueness bounds for gradients at infimal-convolution minimizers. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLowerS5A2Envelope @@ -22,6 +22,7 @@ open Stage5AboveTwoLower.S5ARepair /-- The exact local kernel inequality needed by the primal envelope route. It is stated only on the unit `ell_p` ball, matching the frozen Hessian control and the already proved strict interiority of all minimizers. -/ +@[expose] def KernelCocoerciveOnUnit (p M : ℝ) (gradPhi : Point d → Point d) : Prop := ∀ u w : Point d, lpNorm p u ≤ 1 → lpNorm p w ≤ 1 → (lpNorm (conjugateExponent p) (gradPhi u - gradPhi w)) ^ (2 : ℕ) ≤ diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/Construction.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/Construction.lean index 7d1c1f1a83..a43a1a74d3 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/Construction.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/Construction.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage5AboveTwoLowerS5A2En Construction of the smoothing kernel with its explicit regularity and curvature guarantees. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLowerS5A2Envelope diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/DimensionControl.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/DimensionControl.lean index 284c79d61b..93431a21d5 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/DimensionControl.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/DimensionControl.lean @@ -13,7 +13,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage5AboveTwoLowerS5AGlo Dimension-dependent norm comparisons yield the kernel Hessian and cocoercivity bounds. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLowerS5A2Envelope diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/EnvelopeDerivative.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/EnvelopeDerivative.lean index 4c48127512..1d3d87e054 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/EnvelopeDerivative.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/EnvelopeDerivative.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage5AboveTwoLowerS5A2En Selection of minimizing displacements and differentiation of the resulting envelope. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLowerS5A2Envelope @@ -44,7 +44,7 @@ lemma selectedDisplacement_spec (kernel : SmoothingKernelData p d) exact Classical.choose_spec hex /-- The envelope gradient obtained from a selected minimizing displacement. -/ -noncomputable def selectedEnvelopeGradient +@[expose] noncomputable def selectedEnvelopeGradient (kernel : SmoothingKernelData p d) (chi : ℝ) (ell : Point d → ℝ) (x : Point d) : Point d := -kernel.gradPhi ((1 / chi) • selectedDisplacement kernel chi ell x) diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/EnvelopeSupport.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/EnvelopeSupport.lean index e41e7733c7..6e2896516c 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/EnvelopeSupport.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/EnvelopeSupport.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage5AboveTwoLowerS5A2En Minimizing displacements give global supporting inequalities for the smoothing envelope. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLowerS5A2Envelope diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/ExactPairCompletion.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/ExactPairCompletion.lean index 5430fa5ddf..2d2aae662c 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/ExactPairCompletion.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/ExactPairCompletion.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage5AboveTwoLowerS5A2En The completed resisting oracle preserves all earlier exact value-gradient observations. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLowerS5A2Envelope diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/KernelAssembly.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/KernelAssembly.lean index b10a0908e9..000d72456b 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/KernelAssembly.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/KernelAssembly.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage5AboveTwoLowerS5A2En Assembly of the selected envelope oracle and its coordinate-gradient and smoothness proofs. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLowerS5A2Envelope @@ -23,7 +23,7 @@ open Stage5AboveTwoLower.S5AGlobalC2 open Stage5AboveTwoLowerResume /-- The explicit curvature bound for the constructed smoothing kernel. -/ -noncomputable def repairMpd (p : ℝ) (d : ℕ) : ℝ := +@[expose] noncomputable def repairMpd (p : ℝ) (d : ℕ) : ℝ := if p ≤ 3 * Real.log d then 5 * p else 15 * Real.exp (2 / 3) * Real.log d @@ -33,6 +33,7 @@ noncomputable def dormantOracle (d : ℕ) : PairOracle d := /-- Nonrecursive concrete kernel data used to formulate and select minimizers. Its dormant `smooth` field is never used in the infimal cost. -/ +@[expose] noncomputable def repairKernelBase (p : ℝ) (d : ℕ) : SmoothingKernelData p d := { phi := lowerKernelPhi (kernelR0 p d) (repairTheta p d) @@ -42,14 +43,14 @@ noncomputable def repairKernelBase (p : ℝ) (d : ℕ) : smooth := fun _ _ ↦ dormantOracle d } /-- The infimal smoothing value paired with the selected envelope gradient. -/ -noncomputable def repairSelectedOracle (p : ℝ) (d : ℕ) +@[expose] noncomputable def repairSelectedOracle (p : ℝ) (d : ℕ) (chi : ℝ) (ell : Point d → ℝ) : PairOracle d := { value := localSmoothingValue (repairKernelBase p d) chi ell gradient := selectedEnvelopeGradient (repairKernelBase p d) chi ell } /-- Final kernel data: its smooth oracle is the literal infimal value paired with the selected primal-envelope gradient. -/ -noncomputable def repairKernel (p : ℝ) (d : ℕ) : +@[expose] noncomputable def repairKernel (p : ℝ) (d : ℕ) : SmoothingKernelData p d := { phi := lowerKernelPhi (kernelR0 p d) (repairTheta p d) gradPhi := kernelGradientVector (kernelR0 p d) (repairTheta p d) diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/KernelCocoercivity.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/KernelCocoercivity.lean index c68b84c189..eb85c2042a 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/KernelCocoercivity.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/KernelCocoercivity.lean @@ -14,7 +14,7 @@ public import Mathlib.MeasureTheory.Integral.IntervalIntegral.FundThmCalculus A positive semidefinite Hessian bound yields cocoercivity of the kernel gradient. -/ -@[expose] public section +public section open scoped Interval diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/KernelConvexity.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/KernelConvexity.lean index 9f919f0236..476a85ddbc 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/KernelConvexity.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/KernelConvexity.lean @@ -13,7 +13,7 @@ public import Mathlib.Analysis.Convex.SpecificFunctions.Basic Convexity of the finite-dimensional norm and the power smoothing kernel. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLowerS5A2Envelope diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/KernelHessianStructure.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/KernelHessianStructure.lean index feeb232d44..4d3d892995 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/KernelHessianStructure.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/KernelHessianStructure.lean @@ -13,7 +13,7 @@ public import Mathlib.Analysis.Calculus.FDeriv.Symmetric Symmetry, positivity, and Cauchy-Schwarz estimates for the kernel Hessian. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLowerS5A2Envelope diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/OptimizerRadius.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/OptimizerRadius.lean index 007bed4b48..fa03ef7aad 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/OptimizerRadius.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/OptimizerRadius.lean @@ -13,7 +13,7 @@ The completed resisting objective has a controlled, symmetry-invariant distance minimizers. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLowerS5A2Envelope diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/OutsideGradient.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/OutsideGradient.lean index 3ec15a4694..bb47a3a5be 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/OutsideGradient.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/OutsideGradient.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage5AboveTwoLowerS5A2En The completed resisting objective's gradient remains large outside the central region. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLowerS5A2Envelope diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/PhysicalLower.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/PhysicalLower.lean index 265199f52a..c877bace5d 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/PhysicalLower.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/PhysicalLower.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage5AboveTwoLowerS5A2En Fresh maximizing coordinates and signs for the finite resisting construction. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLowerS5A2Envelope diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/PrimalOptimality.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/PrimalOptimality.lean index dbd31efc08..a7ba43601b 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/PrimalOptimality.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/PrimalOptimality.lean @@ -13,7 +13,7 @@ public import LeanPool.ParameterFreeGradient.O3.Stage3Descent First-order optimality of an infimal-convolution minimizer gives a supporting inequality. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/QueryGap.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/QueryGap.lean index fe668b5a00..3191a2e520 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/QueryGap.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/QueryGap.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage5AboveTwoLowerS5A2En A persistent query gap and existence of a global minimizer for the completed hard objective. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLowerS5A2Envelope diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/SymmetryClassification.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/SymmetryClassification.lean index 38e5825000..976afe4e60 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/SymmetryClassification.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/SymmetryClassification.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage5AboveTwoLowerS5A2En Pairing-preserving `ℓp` symmetries preserve every coordinate-power norm. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLowerS5A2Envelope @@ -200,6 +200,7 @@ lemma signedLpSymmetry_column_abs_at_index {p : ℝ} (hp : 2 < p) (by linarith : p ≠ 0)).mp (by simpa [honepow] using hsingle) /-- The primal symmetry bundled as a real linear map. -/ +@[expose] def signedLpLinearMap {p : ℝ} (Q Qdual : Point d → Point d) (hsym : SignedLpSymmetry p Q Qdual) : Point d →ₗ[ℝ] Point d where diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/SymmetryEquivariance.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/SymmetryEquivariance.lean index c99403fdea..85707b62c6 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/SymmetryEquivariance.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/SymmetryEquivariance.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage5AboveTwoLowerS5A2En Signed coordinate transformations preserve the kernel and commute with infimal smoothing. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLowerS5A2Envelope diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/SymmetryLinearization.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/SymmetryLinearization.lean index 92fb0745b5..ca63363b60 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/SymmetryLinearization.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5A2Envelope/SymmetryLinearization.lean @@ -14,7 +14,7 @@ public import Mathlib.LinearAlgebra.Basis.Basic Norm- and pairing-preserving transformations are linear, using the dual image basis. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLowerS5A2Envelope @@ -22,7 +22,7 @@ open scoped BigOperators open Stage5AboveTwoLower.S5ARepair /-- The vector equal to one at coordinate `i` and zero elsewhere. -/ -def coordinateUnit (i : Fin d) : Point d := fun j ↦ if j = i then 1 else 0 +@[expose] def coordinateUnit (i : Fin d) : Point d := fun j ↦ if j = i then 1 else 0 lemma pairing_coordinateUnit (x : Point d) (i : Fin d) : O3.pairing (coordinateUnit i) x = x i := by diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5AFinalRepair/OriginFrechet.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5AFinalRepair/OriginFrechet.lean index d2b7071cb6..dbebf94a0d 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5AFinalRepair/OriginFrechet.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5AFinalRepair/OriginFrechet.lean @@ -15,7 +15,7 @@ public import Mathlib.Analysis.InnerProductSpace.NormPow The kernel gradient is Fréchet differentiable at the origin with zero derivative. -/ -@[expose] public section +public section open scoped BigOperators open Asymptotics @@ -71,6 +71,7 @@ lemma norm_le_lpNorm {s : ℝ} (hs : 1 ≤ s) {d : ℕ} (x : Point d) : /-- Explicit finite-dimensional comparison constant between the ambient product norm and the literal `ell_s` norm. -/ +@[expose] noncomputable def lpAmbientConstant (s : ℝ) (d : ℕ) : ℝ := ↑(NNReal.rpow (d : NNReal) (1 / ENNReal.ofReal s).toReal) diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5AGlobalC2/Calculus.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5AGlobalC2/Calculus.lean index 1ec8426dd6..099d20fc9d 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5AGlobalC2/Calculus.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5AGlobalC2/Calculus.lean @@ -12,13 +12,14 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage5AboveTwoLowerS5AGlo The power smoothing kernel is twice continuously Fréchet differentiable globally. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLower.S5AGlobalC2 open S5ARepair /-- The derivative of the kernel's Fréchet derivative, obtained from its Hessian. -/ +@[expose] noncomputable def kernelFDerivDerivative (r theta : ℝ) (x : Point d) : Point d →L[ℝ] (Point d →L[ℝ] ℝ) := (ContinuousLinearMap.compL ℝ (Point d) (Point d) (Point d →L[ℝ] ℝ)) diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5AGlobalC2/Continuity.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5AGlobalC2/Continuity.lean index cc40c65d98..3f92313a54 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5AGlobalC2/Continuity.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5AGlobalC2/Continuity.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage5AboveTwoLowerS5AGlo Continuity of the assembled kernel Hessian at all points. -/ -@[expose] public section +public section open scoped BigOperators @@ -21,6 +21,7 @@ namespace V7.Stage5AboveTwoLower.S5AGlobalC2 open S5ARepair S5AFinalRepair S5AHessianContinuity /-- The linear map sending a vector to its continuous pairing functional. -/ +@[expose] noncomputable def pairingCLMLinear {d : ℕ} : Point d →ₗ[ℝ] (Point d →L[ℝ] ℝ) where toFun := pairingCLM @@ -41,7 +42,7 @@ noncomputable def pairingCLMLinear {d : ℕ} : ring /-- The continuous linear map sending a vector to its pairing functional. -/ -noncomputable def pairingCLMCLM {d : ℕ} : +@[expose] noncomputable def pairingCLMCLM {d : ℕ} : Point d →L[ℝ] (Point d →L[ℝ] ℝ) := LinearMap.toContinuousLinearMap (pairingCLMLinear (d := d)) @@ -112,6 +113,7 @@ lemma continuousAt_kernelHessianCoord_of_ne_zero {r theta : ℝ} exact hfirst.add hsecond /-- The linear assembly of coordinate functionals into a vector-valued continuous linear map. -/ +@[expose] noncomputable def assemblePiLinear {d : ℕ} : ((i : Fin d) → Point d →L[ℝ] ℝ) →ₗ[ℝ] (Point d →L[ℝ] Point d) where toFun := ContinuousLinearMap.pi @@ -123,7 +125,7 @@ noncomputable def assemblePiLinear {d : ℕ} : simp /-- The continuous linear assembly of coordinate functionals into a vector-valued derivative. -/ -noncomputable def assemblePiCLM {d : ℕ} : +@[expose] noncomputable def assemblePiCLM {d : ℕ} : ((i : Fin d) → Point d →L[ℝ] ℝ) →L[ℝ] (Point d →L[ℝ] Point d) := LinearMap.toContinuousLinearMap (assemblePiLinear (d := d)) diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5AGlobalC2/Core.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5AGlobalC2/Core.lean index b3f72aedb7..7ad7cc1261 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5AGlobalC2/Core.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5AGlobalC2/Core.lean @@ -13,7 +13,7 @@ public import LeanPool.ParameterFreeGradient.O3.Stage2RouteD The global coordinate-gradient and Hessian formulas for the power smoothing kernel. -/ -@[expose] public section +public section open scoped BigOperators open Asymptotics diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5AGlobalC2/QuadraticBound.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5AGlobalC2/QuadraticBound.lean index 35f6dd9c49..d117466e27 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5AGlobalC2/QuadraticBound.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5AGlobalC2/QuadraticBound.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage5AboveTwoLowerS5AGlo The kernel Hessian satisfies the explicit quadratic-form upper bound. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5AHessianContinuity/HessianContinuity.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5AHessianContinuity/HessianContinuity.lean index 978d0ad4f7..675010040d 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5AHessianContinuity/HessianContinuity.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5AHessianContinuity/HessianContinuity.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage5AboveTwoLowerS5AFin Ambient norm estimates imply continuity of the kernel Hessian at the origin. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5ARepair/InfimalLocality.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5ARepair/InfimalLocality.lean index 93abfdc10d..bad32daa57 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5ARepair/InfimalLocality.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5ARepair/InfimalLocality.lean @@ -13,7 +13,7 @@ public import LeanPool.ParameterFreeGradient.O3.Stage2RouteC Stable interior minimizing displacements imply locality of the infimal-convolution value. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLower.S5ARepair @@ -57,11 +57,12 @@ lemma eventually_lpNorm_sub_lt {p eta : ℝ} (hp : 1 ≤ p) exact hc hmem /-- The objective value plus the rescaled kernel penalty at a displacement. -/ -noncomputable def smoothingCost (kernel : SmoothingKernelData p d) +@[expose] noncomputable def smoothingCost (kernel : SmoothingKernelData p d) (chi : ℝ) (ell : Point d → ℝ) (x v : Point d) : ℝ := ell (x + v) + chi * kernel.phi ((1 / chi) • v) /-- The displacement globally minimizes the infimal-convolution cost. -/ +@[expose] def IsInfimalMinimizer (kernel : SmoothingKernelData p d) (chi : ℝ) (ell : Point d → ℝ) (x v : Point d) : Prop := ∀ w, smoothingCost kernel chi ell x v ≤ smoothingCost kernel chi ell x w diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5ARepair/KernelAmbientHessian.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5ARepair/KernelAmbientHessian.lean index 5b4fda4d77..8753147b1d 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5ARepair/KernelAmbientHessian.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5ARepair/KernelAmbientHessian.lean @@ -12,12 +12,12 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage5AboveTwoLowerS5ARep The explicit ambient Hessian of the power kernel away from the origin. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLower.S5ARepair /-- One coordinate of the explicit kernel Hessian as a continuous linear functional. -/ -noncomputable def kernelHessianCoord (r theta : ℝ) (x : Point d) (i : Fin d) : +@[expose] noncomputable def kernelHessianCoord (r theta : ℝ) (x : Point d) (i : Fin d) : Point d →L[ℝ] ℝ := (4 * theta * O3.Experimental.scalarJ r (x i)) • ((2 * theta / r - 1) * @@ -27,7 +27,7 @@ noncomputable def kernelHessianCoord (r theta : ℝ) (x : Point d) (i : Fin d) : (ContinuousLinearMap.proj i : Point d →L[ℝ] ℝ) /-- The explicit kernel Hessian assembled from its coordinate functionals. -/ -noncomputable def kernelHessian (r theta : ℝ) (x : Point d) : +@[expose] noncomputable def kernelHessian (r theta : ℝ) (x : Point d) : Point d →L[ℝ] Point d := ContinuousLinearMap.pi (fun i ↦ kernelHessianCoord r theta x i) diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5ARepair/KernelAmbientNonzero.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5ARepair/KernelAmbientNonzero.lean index 0861a62342..9676c45339 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5ARepair/KernelAmbientNonzero.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5ARepair/KernelAmbientNonzero.lean @@ -12,14 +12,14 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage5AboveTwoLowerS5ARep The ambient Fréchet derivative and coordinate gradient of the power kernel away from zero. -/ -@[expose] public section +public section open scoped BigOperators namespace V7.Stage5AboveTwoLower.S5ARepair /-- The continuous linear functional given by pairing with a fixed vector. -/ -noncomputable def pairingCLM (g : Point d) : Point d →L[ℝ] ℝ := +@[expose] noncomputable def pairingCLM (g : Point d) : Point d →L[ℝ] ℝ := ∑ i : Fin d, (g i) • ContinuousLinearMap.proj i @[simp] lemma pairingCLM_apply (g h : Point d) : @@ -27,7 +27,7 @@ noncomputable def pairingCLM (g : Point d) : Point d →L[ℝ] ℝ := simp [pairingCLM, O3.pairing] /-- The Fréchet derivative formula for the sum of coordinate absolute powers. -/ -noncomputable def lpPowerFDeriv (r : ℝ) (x : Point d) : Point d →L[ℝ] ℝ := +@[expose] noncomputable def lpPowerFDeriv (r : ℝ) (x : Point d) : Point d →L[ℝ] ℝ := r • pairingCLM (O3.powerDualityMap r x) lemma hasFDerivAt_lpPower {r : ℝ} (hr : 1 < r) (x : Point d) : @@ -61,12 +61,12 @@ lemma hasFDerivAt_lpPower {r : ℝ} (hr : 1 < r) (x : Point d) : ring /-- The explicit coordinate gradient of the power smoothing kernel. -/ -noncomputable def kernelGradientVector (r theta : ℝ) (x : Point d) : Point d := +@[expose] noncomputable def kernelGradientVector (r theta : ℝ) (x : Point d) : Point d := (4 * theta * (O3.lpPower r x) ^ (2 * theta / r - 1)) • O3.powerDualityMap r x /-- The kernel gradient represented as a continuous linear functional. -/ -noncomputable def kernelFDeriv (r theta : ℝ) (x : Point d) : +@[expose] noncomputable def kernelFDeriv (r theta : ℝ) (x : Point d) : Point d →L[ℝ] ℝ := pairingCLM (kernelGradientVector r theta x) lemma hasFDerivAt_lowerKernelPhi_of_ne_zero {r theta : ℝ} diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5ARepair/KernelLineCalculus.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5ARepair/KernelLineCalculus.lean index 5d0ba57c90..dee0169ccd 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5ARepair/KernelLineCalculus.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5ARepair/KernelLineCalculus.lean @@ -14,7 +14,7 @@ public import LeanPool.ParameterFreeGradient.O3.Stage2RouteA First and second derivatives of the power kernel restricted to affine lines. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5ARepair/Parameters.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5ARepair/Parameters.lean index ce913d1b65..267943d385 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5ARepair/Parameters.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5ARepair/Parameters.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage5AboveTwoLower.Param Refined kernel parameters satisfying the required exponent and Hessian bounds. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLower.S5ARepair diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/CompletedTrace.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/CompletedTrace.lean index 3da477aeda..bb59d33dde 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/CompletedTrace.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/CompletedTrace.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage5AboveTwoLowerS5F.Ob The completed normalized resisting trace is exact, causal, and charges its initial query. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLowerS5F @@ -20,7 +20,7 @@ open Stage5AboveTwoLower open Stage5AboveTwoLowerS5A2Envelope /-- The finite exact trace of the normalized completed resisting oracle. -/ -noncomputable def unitTrace (p : ℝ) (d T : ℕ) +@[expose] noncomputable def unitTrace (p : ℝ) (d T : ℕ) (algorithm : DeterministicExactPairAlgorithm d) (hT : 1 ≤ T) (hTd : T ≤ d) : List (Observation d) := let data := unitCompletionData p d T algorithm hT hTd diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/CompletionData.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/CompletionData.lean index 37ea7539fd..e5a3a03a1e 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/CompletionData.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/CompletionData.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage5AboveTwoLowerS5F.Pr The recursive resisting prefixes assemble into valid completed lower-bound data. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLowerS5F @@ -99,6 +99,7 @@ lemma xi_step_spec (P : PrefixParameters p d T) (t : ℕ) : resistingSign_spec (query P t (sigma P t)) /-- The final scaled smooth oracle obtained from the last partial resisting objective. -/ +@[expose] noncomputable def completedOracle (P : PrefixParameters p d T) : PairOracle d := { value := fun x => P.beta * (P.kernel.smooth P.chi (partialH P (T - 1))).value x @@ -106,7 +107,7 @@ noncomputable def completedOracle (P : PrefixParameters p d T) : PairOracle d := (P.kernel.smooth P.chi (partialH P (T - 1))).gradient x } /-- The recursively constructed prefixes packaged as completed lower-bound data. -/ -noncomputable def completionData (P : PrefixParameters p d T) (Delta : ℝ) : +@[expose] noncomputable def completionData (P : PrefixParameters p d T) (Delta : ℝ) : LowerCompletionData p d T := { algorithm := P.algorithm x0 := 0 diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/LocalTrialAdapter.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/LocalTrialAdapter.lean index 6664b94a43..acfcf73c85 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/LocalTrialAdapter.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/LocalTrialAdapter.lean @@ -13,7 +13,7 @@ A causal local trial induces a deterministic exact-pair algorithm with its cache charged. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLowerS5F diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/LowerTheorem.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/LowerTheorem.lean index d28569deca..d398bdc4dd 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/LowerTheorem.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/LowerTheorem.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage5AboveTwoLowerS5F.Ra The normalized resisting construction yields the physical known-parameter query lower bound. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLowerS5F diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/ObjectiveData.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/ObjectiveData.lean index 1dab819085..29989bd693 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/ObjectiveData.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/ObjectiveData.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage5AboveTwoLowerS5F.Co The normalized completion is a convex objective with the stated coordinate gradient. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLowerS5F @@ -28,7 +28,7 @@ noncomputable def unitDeltaStep (p : ℝ) (T : ℕ) : ℝ := unitDelta p T / (2 noncomputable def unitChi (p : ℝ) (T : ℕ) : ℝ := unitDeltaStep p T / 2 /-- The explicit kernel and scales initializing the normalized resisting construction. -/ -noncomputable def unitParameters (p : ℝ) (d T : ℕ) +@[expose] noncomputable def unitParameters (p : ℝ) (d T : ℕ) (algorithm : DeterministicExactPairAlgorithm d) (hT : 1 ≤ T) (hTd : T ≤ d) : PrefixParameters p d T := { algorithm := algorithm @@ -58,7 +58,7 @@ lemma unitBeta_pos {p : ℝ} {d T : ℕ} (hp : 2 < p) (hd : 2 ≤ d) (hT : 1 ≤ div_pos (unitChi_pos hT) (repairMpd_pos hp hd) /-- The complete normalized resisting data for a deterministic algorithm. -/ -noncomputable def unitCompletionData (p : ℝ) (d T : ℕ) +@[expose] noncomputable def unitCompletionData (p : ℝ) (d T : ℕ) (algorithm : DeterministicExactPairAlgorithm d) (hT : 1 ≤ T) (hTd : T ≤ d) : LowerCompletionData p d T := completionData (unitParameters p d T algorithm hT hTd) (unitDelta p T) @@ -127,6 +127,7 @@ lemma coordinateGradient_const_mul (f : Point d → ℝ) (g : Point d → Point exact (O3.Stage2RouteD.pairing_smul_left c (g x) h).symm /-- The normalized completed resisting data viewed as objective data. -/ +@[expose] noncomputable def unitObjectiveData (p : ℝ) (d T : ℕ) (algorithm : DeterministicExactPairAlgorithm d) (hT : 1 ≤ T) (hTd : T ≤ d) : LowerObjectiveData p d T := diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/Optimality.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/Optimality.lean index e976290cf4..840050fbb6 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/Optimality.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/Optimality.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage5AboveTwoLowerS5F.Up The matching known-parameter upper and lower bounds establish above-two optimality. -/ -@[expose] public section +public section namespace V7 diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/PhysicalAnalytic.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/PhysicalAnalytic.lean index 235e151a6e..e3e761f4c3 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/PhysicalAnalytic.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/PhysicalAnalytic.lean @@ -14,7 +14,7 @@ Physical rescaling preserves convexity, gradients, smoothness, and the prescribe distance. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLowerS5F diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/PhysicalScaling.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/PhysicalScaling.lean index 75450eb113..8490f98a73 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/PhysicalScaling.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/PhysicalScaling.lean @@ -12,16 +12,16 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage5AboveTwoLowerS5F.Co Affine transport of algorithms, oracle observations, and exact chronological traces. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLowerS5F /-- The affine map from normalized coordinates to the requested physical radius and center. -/ -noncomputable def physicalForward (x0 : Point d) (R rT : ℝ) (z : Point d) : Point d := +@[expose] noncomputable def physicalForward (x0 : Point d) (R rT : ℝ) (z : Point d) : Point d := x0 + (R / rT) • z /-- The affine map from physical coordinates back to the normalized construction. -/ -noncomputable def physicalBackward (x0 : Point d) (R rT : ℝ) (x : Point d) : Point d := +@[expose] noncomputable def physicalBackward (x0 : Point d) (R rT : ℝ) (x : Point d) : Point d := (rT / R) • (x - x0) lemma physicalForward_backward (x0 : Point d) {R rT : ℝ} @@ -41,7 +41,7 @@ lemma physicalBackward_forward (x0 : Point d) {R rT : ℝ} smul_smul, hscale, one_smul] /-- The normalized oracle rescaled to the prescribed physical smoothness and radius. -/ -noncomputable def physicalOracle (x0 : Point d) (L R rT : ℝ) +@[expose] noncomputable def physicalOracle (x0 : Point d) (L R rT : ℝ) (bar : PairOracle d) : PairOracle d := { value := fun x => (L * R ^ (2 : ℕ) / rT ^ (2 : ℕ)) * bar.value (physicalBackward x0 R rT x) @@ -49,6 +49,7 @@ noncomputable def physicalOracle (x0 : Point d) (L R rT : ℝ) bar.gradient (physicalBackward x0 R rT x) } /-- An observation transported to physical coordinates with rescaled value and gradient. -/ +@[expose] noncomputable def physicalObservation (x0 : Point d) (L R rT : ℝ) (obs : Observation d) : Observation d := { point := physicalForward x0 R rT obs.point @@ -75,7 +76,7 @@ noncomputable def normalizedAdversaryAlgorithm (x0 : Point d) (L R rT : ℝ) (algorithm.output x0 (trace.map (physicalObservation x0 L R rT))) } /-- The normalized observation trace transported to physical coordinates. -/ -noncomputable def physicalTrace (x0 : Point d) (L R rT : ℝ) +@[expose] noncomputable def physicalTrace (x0 : Point d) (L R rT : ℝ) (trace : List (Observation d)) : List (Observation d) := trace.map (physicalObservation x0 L R rT) diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/PrefixState.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/PrefixState.lean index ee02f51581..14873ced21 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/PrefixState.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/PrefixState.lean @@ -14,7 +14,7 @@ The recursive state construction of the resisting coordinates, signs, and partia oracles. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLowerS5F @@ -50,20 +50,23 @@ structure ResistingPrefixState (d : ℕ) where obsPrefix : List (Observation d) /-- The empty state before any resisting coordinate or observation is chosen. -/ +@[expose] def initialState (d : ℕ) : ResistingPrefixState d := ⟨[], [], []⟩ /-- A previously selected coordinate, with zero as the out-of-range default. -/ +@[expose] def priorSigma (P : PrefixParameters p d T) (state : ResistingPrefixState d) (s : ℕ) : Fin d := state.sigmaPrefix.getD s (firstCoordinate P) /-- The next algorithm query, with the first query fixed at the origin. -/ +@[expose] noncomputable def stepQuery (P : PrefixParameters p d T) (t : ℕ) (state : ResistingPrefixState d) : Point d := if t = 0 then 0 else P.algorithm.nextQuery 0 state.obsPrefix /-- An unused coordinate maximizing the current query magnitude, chosen before the horizon. -/ -noncomputable def stepSigma (P : PrefixParameters p d T) (t : ℕ) +@[expose] noncomputable def stepSigma (P : PrefixParameters p d T) (t : ℕ) (state : ResistingPrefixState d) : Fin d := if ht : t < T then Classical.choose @@ -72,11 +75,12 @@ noncomputable def stepSigma (P : PrefixParameters p d T) (t : ℕ) else firstCoordinate P /-- The sign aligned with the current query at the newly selected coordinate. -/ -noncomputable def stepXi (P : PrefixParameters p d T) (t : ℕ) +@[expose] noncomputable def stepXi (P : PrefixParameters p d T) (t : ℕ) (state : ResistingPrefixState d) : ℝ := resistingSign ((stepQuery P t state) (stepSigma P t state)) /-- An indexed signed-coordinate affine piece after appending the current resisting choice. -/ +@[expose] noncomputable def piece (P : PrefixParameters p d T) (state : ResistingPrefixState d) (t i : ℕ) (x : Point d) : ℝ := let sigmas := state.sigmaPrefix ++ [stepSigma P t state] @@ -84,6 +88,7 @@ noncomputable def piece (P : PrefixParameters p d T) (state : ResistingPrefixSta xis.getD i 0 * x (sigmas.getD i (firstCoordinate P)) - (i : ℝ) * P.delta /-- The maximum of the affine pieces selected through the current step. -/ +@[expose] noncomputable def stepG (P : PrefixParameters p d T) (t : ℕ) (state : ResistingPrefixState d) (x : Point d) : ℝ := let values := (Finset.range (t + 1)).image (fun i => piece P state t i x) @@ -92,17 +97,20 @@ noncomputable def stepG (P : PrefixParameters p d T) (t : ℕ) exact ⟨0, Finset.mem_range.mpr (Nat.zero_lt_succ t), rfl⟩) /-- The resisting maximum combined with a radial term to ensure coercivity. -/ +@[expose] noncomputable def stepH (P : PrefixParameters p d T) (t : ℕ) (state : ResistingPrefixState d) (x : Point d) : ℝ := max (stepG P t state x / 2) (lpNorm p x - 3 / 2) /-- The scaled smooth oracle associated with the current regularized resisting objective. -/ +@[expose] noncomputable def stepOracle (P : PrefixParameters p d T) (t : ℕ) (state : ResistingPrefixState d) : PairOracle d := { value := fun x => P.beta * (P.kernel.smooth P.chi (stepH P t state)).value x gradient := fun x => P.beta • (P.kernel.smooth P.chi (stepH P t state)).gradient x } /-- The prefix state after appending the selected coordinate, sign, and oracle observation. -/ +@[expose] noncomputable def advance (P : PrefixParameters p d T) (t : ℕ) (state : ResistingPrefixState d) : ResistingPrefixState d := { sigmaPrefix := state.sigmaPrefix ++ [stepSigma P t state] @@ -111,32 +119,36 @@ noncomputable def advance (P : PrefixParameters p d T) (t : ℕ) [(stepOracle P t state).observe (stepQuery P t state)] } /-- The recursively generated resisting prefix state. -/ +@[expose] noncomputable def prefixState (P : PrefixParameters p d T) : ℕ → ResistingPrefixState d | 0 => initialState d | t + 1 => advance P t (prefixState P t) /-- The query made at step `t` of the recursively generated resisting construction. -/ -noncomputable def query (P : PrefixParameters p d T) (t : ℕ) : Point d := +@[expose] noncomputable def query (P : PrefixParameters p d T) (t : ℕ) : Point d := stepQuery P t (prefixState P t) /-- The coordinate selected at step `t` of the resisting construction. -/ -noncomputable def sigma (P : PrefixParameters p d T) (t : ℕ) : Fin d := +@[expose] noncomputable def sigma (P : PrefixParameters p d T) (t : ℕ) : Fin d := stepSigma P t (prefixState P t) /-- The sign selected at step `t` of the resisting construction. -/ -noncomputable def xi (P : PrefixParameters p d T) (t : ℕ) : ℝ := +@[expose] noncomputable def xi (P : PrefixParameters p d T) (t : ℕ) : ℝ := stepXi P t (prefixState P t) /-- The resisting affine maximum at prefix length `t + 1`. -/ +@[expose] noncomputable def partialG (P : PrefixParameters p d T) (t : ℕ) : Point d → ℝ := stepG P t (prefixState P t) /-- The regularized nonsmooth objective at prefix length `t + 1`. -/ +@[expose] noncomputable def partialH (P : PrefixParameters p d T) (t : ℕ) : Point d → ℝ := stepH P t (prefixState P t) /-- The scaled smoothed oracle at prefix length `t + 1`. -/ +@[expose] noncomputable def partialOracle (P : PrefixParameters p d T) (t : ℕ) : PairOracle d := stepOracle P t (prefixState P t) diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/PrefixSync.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/PrefixSync.lean index 0d09cc7135..c2aa042a3a 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/PrefixSync.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/PrefixSync.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage5AboveTwoLowerS5F.Pr The resisting prefix states synchronize their stored coordinates, signs, and observations. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLowerS5F diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/RateAlgebra.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/RateAlgebra.lean index ceae8b7db5..dbef97900f 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/RateAlgebra.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/RateAlgebra.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage5AboveTwoLowerS5F.Un The algebraic conversion from the hard-instance query gap to the lower-bound complexity rate. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLowerS5F diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/UnitInstance.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/UnitInstance.lean index dd3285c3b8..0443d69e88 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/UnitInstance.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/UnitInstance.lean @@ -13,7 +13,7 @@ The normalized completed resisting oracle is a certified positive smooth optimiz instance. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLowerS5F @@ -73,6 +73,7 @@ theorem unitCompleted_smooth {p : ℝ} {d T : ℕ} field_simp [ne_of_gt (unitChi_pos hT), ne_of_gt (repairMpd_pos hp hd)] /-- The normalized completed resisting oracle certified as a positive optimization instance. -/ +@[expose] noncomputable def unitPositiveInstance {p : ℝ} {d T : ℕ} (algorithm : DeterministicExactPairAlgorithm d) (hp : 2 < p) (hd : 2 ≤ d) (hT : 1 ≤ T) (hTd : T ≤ d) : diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/UpperAnalytic.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/UpperAnalytic.lean index 372536f5d5..eef97db613 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/UpperAnalytic.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/UpperAnalytic.lean @@ -14,7 +14,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage1E03.Semantics The initial gradient is bounded by smoothness times the distance to the minimizer set. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLowerS5F diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/UpperTheorem.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/UpperTheorem.lean index 098e363a93..9060f841ac 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/UpperTheorem.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/UpperTheorem.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage5AboveTwoLowerS5F.Up A certified above-two local trial yields the known-parameter upper query bound. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLowerS5F diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/UpperTrial.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/UpperTrial.lean index b0532914e4..c39d61cc19 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/UpperTrial.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage5AboveTwoLowerS5F/UpperTrial.lean @@ -13,7 +13,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage4AboveTwoFinalTrial. The explicit above-two trial supplied to the known-parameter upper-bound argument. -/ -@[expose] public section +public section namespace V7.Stage5AboveTwoLowerS5F diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage6StrictDeterministic/AffineTrace.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage6StrictDeterministic/AffineTrace.lean index 339aa86994..e7026140e7 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage6StrictDeterministic/AffineTrace.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage6StrictDeterministic/AffineTrace.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.StrictStatements The deterministic strict method's exact transcript against the affine oracle. -/ -@[expose] public section +public section namespace V7.Stage6StrictDeterministic @@ -23,7 +23,7 @@ def causalQuery (method : StrictLocalMethod) (t : ℕ) if t = 0 then method.x0 else method.nextQuery trace /-- Chronological exact transcript generated against the affine oracle. -/ -noncomputable def affineTrace (method : StrictLocalMethod) (eps : ℝ) : +@[expose] noncomputable def affineTrace (method : StrictLocalMethod) (eps : ℝ) : ℕ → StrictTranscript | 0 => [] | n + 1 => diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage6StrictDeterministic/Closure.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage6StrictDeterministic/Closure.lean index ee07360c4f..2cdb91350a 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage6StrictDeterministic/Closure.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage6StrictDeterministic/Closure.lean @@ -13,7 +13,7 @@ No strict deterministic method has a uniform finite query horizon on the normali family. -/ -@[expose] public section +public section namespace V7 diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage6StrictDeterministic/HSelection.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage6StrictDeterministic/HSelection.lean index ade159385f..5845acaed3 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage6StrictDeterministic/HSelection.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage6StrictDeterministic/HSelection.lean @@ -12,12 +12,12 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage6StrictDeterministic Selection of a hard-family scale beyond every query and output in a finite transcript. -/ -@[expose] public section +public section namespace V7.Stage6StrictDeterministic /-- Oriented finite displacement maximum, with zero included explicitly. -/ -def traceDisplacementBound (x0 : StrictPoint) : StrictTranscript → ℝ +@[expose] def traceDisplacementBound (x0 : StrictPoint) : StrictTranscript → ℝ | [] => 0 | obs :: trace => max (obs.point 0 - x0 0) (traceDisplacementBound x0 trace) diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage6StrictDeterministic/HardInstance.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage6StrictDeterministic/HardInstance.lean index 4fbf0c9fd8..e36475215e 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage6StrictDeterministic/HardInstance.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage6StrictDeterministic/HardInstance.lean @@ -13,17 +13,17 @@ The one-dimensional hard family has a unique minimizer and exact smoothness and constants. -/ -@[expose] public section +public section namespace V7.Stage6StrictDeterministic /-- The one-dimensional hard objective paired with its exact derivative oracle. -/ -noncomputable def hardOracle (eps : ℝ) (x0 : StrictPoint) (H : ℝ) : PairOracle 1 := +@[expose] noncomputable def hardOracle (eps : ℝ) (x0 : StrictPoint) (H : ℝ) : PairOracle 1 := { value := strictHardFamily eps x0 H gradient := strictHardDerivative eps x0 H } /-- The minimizer located a distance `2 * H` to the right of the initial point. -/ -def hardMinimizer (x0 : StrictPoint) (H : ℝ) : StrictPoint := +@[expose] def hardMinimizer (x0 : StrictPoint) (H : ℝ) : StrictPoint := fun _ ↦ x0 0 + 2 * H theorem strictPoint_ext {x y : StrictPoint} (h : x 0 = y 0) : x = y := by diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage6StrictDeterministic/Indistinguishability.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage6StrictDeterministic/Indistinguishability.lean index 3ef968c8f6..a50459c3ef 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage6StrictDeterministic/Indistinguishability.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage6StrictDeterministic/Indistinguishability.lean @@ -13,7 +13,7 @@ Finite affine transcripts are indistinguishable from a sufficiently distant hard instance. -/ -@[expose] public section +public section namespace V7.Stage6StrictDeterministic diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage6StrictDeterministic/ScalarHard.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage6StrictDeterministic/ScalarHard.lean index cc2ff2e515..54ffbf24b9 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage6StrictDeterministic/ScalarHard.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage6StrictDeterministic/ScalarHard.lean @@ -15,19 +15,19 @@ Calculus, convexity, minimizers, and growth of the scalar affine-quadratic-affin objective. -/ -@[expose] public section +public section namespace V7.Stage6StrictDeterministic /-- The piecewise linear-quadratic hard objective in displacement coordinates. -/ -noncomputable def hardValue (eps H z : ℝ) : ℝ := +@[expose] noncomputable def hardValue (eps H z : ℝ) : ℝ := let g := 2 * eps if z ≤ H then -g * z else if z ≤ 3 * H then -g * z + (g / (2 * H)) * (z - H) ^ 2 else g * z - 4 * g * H /-- The continuous piecewise affine slope of the hard objective. -/ -noncomputable def hardSlope (eps H z : ℝ) : ℝ := +@[expose] noncomputable def hardSlope (eps H z : ℝ) : ℝ := let g := 2 * eps if z ≤ H then -g else if z ≤ 3 * H then g * (z / H - 2) else g diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage7StrictRandomizedExpected/Closure.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage7StrictRandomizedExpected/Closure.lean index e3b6df59c5..cdf0dd0ba4 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage7StrictRandomizedExpected/Closure.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage7StrictRandomizedExpected/Closure.lean @@ -13,7 +13,7 @@ The strict-oracle scale-identification impossibility theorem and its determinist randomized forms. -/ -@[expose] public section +public section namespace V7 diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage7StrictRandomizedExpected/Displacement.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage7StrictRandomizedExpected/Displacement.lean index a5b05468ed..a1f938808b 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage7StrictRandomizedExpected/Displacement.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage7StrictRandomizedExpected/Displacement.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage7StrictRandomizedExp Measurable finite displacement bounds admit a deterministic threshold with high probability. -/ -@[expose] public section +public section open MeasureTheory Filter diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage7StrictRandomizedExpected/Expected.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage7StrictRandomizedExpected/Expected.lean index 740aebe8d5..3b17e79d1f 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage7StrictRandomizedExpected/Expected.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage7StrictRandomizedExpected/Expected.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage7StrictRandomizedExp Finite-horizon failure probabilities force an unbounded worst-case expected hitting time. -/ -@[expose] public section +public section open MeasureTheory diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage7StrictRandomizedExpected/MeasurableTrace.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage7StrictRandomizedExpected/MeasurableTrace.lean index 2360840499..20be448aa9 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage7StrictRandomizedExpected/MeasurableTrace.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage7StrictRandomizedExpected/MeasurableTrace.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage6StrictDeterministic Joint measurability and exactness of randomized causal queries, transcripts, and outputs. -/ -@[expose] public section +public section open MeasureTheory @@ -63,7 +63,7 @@ def causalQuery {Ω : Type*} [MeasurableSpace Ω] /-- Exact chronological transcript against one fixed oracle, simultaneously defined for every seed and every finite horizon. -/ -noncomputable def causalTrace {Ω : Type*} [MeasurableSpace Ω] +@[expose] noncomputable def causalTrace {Ω : Type*} [MeasurableSpace Ω] (method : RandomizedStrictLocalMethod Ω) (x0 : StrictPoint) (oracle : PairOracle 1) : ℕ → Ω → StrictTranscript | 0 => fun _ => [] diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage7StrictRandomizedExpected/Randomized.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage7StrictRandomizedExpected/Randomized.lean index 79a376abdf..a2d9b8a635 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage7StrictRandomizedExpected/Randomized.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage7StrictRandomizedExpected/Randomized.lean @@ -14,7 +14,7 @@ A single normalized hard instance makes finite-horizon randomized success arbitr unlikely. -/ -@[expose] public section +public section open MeasureTheory diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage7StrictRandomizedExpected/Transfer.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage7StrictRandomizedExpected/Transfer.lean index c9c66e2ae7..4c093c7f84 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage7StrictRandomizedExpected/Transfer.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage7StrictRandomizedExpected/Transfer.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage7StrictRandomizedExp The one-dimensional strict-oracle lower bounds transfer to every interior `ℓp` exponent. -/ -@[expose] public section +public section namespace V7.Stage7StrictRandomizedExpected diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/Accounting.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/Accounting.lean index b53384eac3..7824e5d688 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/Accounting.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/Accounting.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage8Main.History Regime-specific local trial costs combine with geometric path amortization. -/ -@[expose] public section +public section namespace V7.Stage8Main @@ -33,7 +33,7 @@ theorem amortFor_pos (p : ℝ) (hp : 1 < p) : 0 < amortFor p hp := ((Classical.choose_spec V7.geometricTrialAmortization).2 p hp)).1 /-- The universal amortization constant at exponent two and the regime constant otherwise. -/ -noncomputable def selectedAmort (p : ℝ) (hp : 1 < p) : ℝ := +@[expose] noncomputable def selectedAmort (p : ℝ) (hp : 1 < p) : ℝ := if p = 2 then amortUniversal else amortFor p hp theorem selectedAmort_pos (p : ℝ) (hp : 1 < p) : diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/AnchorSplice.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/AnchorSplice.lean index e3491c677a..c293cb877b 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/AnchorSplice.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/AnchorSplice.lean @@ -13,12 +13,12 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Anchor Initialization and anchor search splice into the causal controller execution. -/ -@[expose] public section +public section namespace V7.Stage8Main /-- The runtime data assembled from valid primitive inputs and an accepted anchor search. -/ -def runtimeDataFromAnchor (input : MethodInput d) (hp : 1 < input.p) +@[expose] def runtimeDataFromAnchor (input : MethodInput d) (hp : 1 < input.p) (heps : 0 < input.eps) (hM0 : 0 < input.M0) (cached : CachedPair d) (G : ℝ) (hGdef : G = lpNorm (conjugateExponent input.p) cached.observation.gradient) (hG : 0 < G) diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/Controller.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/Controller.lean index 08ecf6fba7..7d1e2316ca 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/Controller.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/Controller.lean @@ -14,7 +14,7 @@ public import LeanPool.ParameterFreeGradient.O3.Stage4AlgebraRadius Finite scale and radius caps give a decreasing rank and controller termination. -/ -@[expose] public section +public section namespace V7.Stage8Main @@ -28,6 +28,7 @@ noncomputable def controllerLocalSpec (data : RuntimeData d) Classical.choice (runtimeTrial_spec data state inst hcached hlarge) /-- The report of the selected certified local trial execution. -/ +@[expose] noncomputable def controllerReport (data : RuntimeData d) (inst : PositiveInstance data.input.p d data.input.x0) (hcached : data.cached.observation = inst.oracle.observe data.input.x0) @@ -51,6 +52,7 @@ inductive RuntimeControllerRunResult (d : ℕ) where | success (finish : RuntimeFinish d) /-- The controller transition determined by a local trial's success, radius, or scale outcome. -/ +@[expose] noncomputable def controllerStep (data : RuntimeData d) (state : RuntimeControllerState d) (report : TrialReport d) : RuntimeControllerRunResult d := @@ -63,6 +65,7 @@ noncomputable def controllerStep (data : RuntimeData d) | .radius _ => .exhausted (nextRadius data state report) /-- The finite-fuel controller execution driven by certified local trial reports. -/ +@[expose] noncomputable def runController (data : RuntimeData d) (inst : PositiveInstance data.input.p d data.input.x0) (hcached : data.cached.observation = inst.oracle.observe data.input.x0) @@ -77,6 +80,7 @@ noncomputable def runController (data : RuntimeData d) | .exhausted state' => runController data inst hcached hlarge fuel state' /-- The underlying controller configuration, including the initialization and anchor call count. -/ +@[expose] noncomputable def controllerConfig (data : RuntimeData d) : O3.ControllerConfig := { initialScale := data.Ma gradientSizeAtStart := data.G diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/History.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/History.lean index 82b8ebbfdb..416e609bd6 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/History.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/History.lean @@ -14,7 +14,7 @@ The controller preserves valid reports, chronological paths, and terminal correc certificates. -/ -@[expose] public section +public section namespace V7.Stage8Main @@ -89,6 +89,7 @@ theorem controllerPath_append (G Ma Da : ℝ) exact hlast current report hcOld hrOld /-- A report has complete guards, valid trial certificates, and the required local cost bound. -/ +@[expose] def ValidReport (data : RuntimeData d) (inst : PositiveInstance data.input.p d data.input.x0) (visit : ControllerVisit) (report : TrialReport d) : Prop := diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/LocalDispatch.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/LocalDispatch.lean index 6704065c30..d73ae8de9a 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/LocalDispatch.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/LocalDispatch.lean @@ -18,7 +18,7 @@ The selectors in this file are made before a positive instance is supplied. They depend only on public runtime data and the cached exact observation. -/ -@[expose] public section +public section namespace V7.Stage8Main diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/LocalSpec.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/LocalSpec.lean index be0c8d2b7d..f95791d19f 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/LocalSpec.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/LocalSpec.lean @@ -12,12 +12,12 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage8Main.RuntimeMachine Selection and certification of the local trial for each runtime exponent regime. -/ -@[expose] public section +public section namespace V7.Stage8Main /-- The local query-cost coefficient for the runtime's exponent regime. -/ -noncomputable def runtimeCoefficient (data : RuntimeData d) : ℝ := +@[expose] noncomputable def runtimeCoefficient (data : RuntimeData d) : ℝ := if hp2 : data.input.p < 2 then 4 / Real.sqrt (data.input.p - 1) + 2 else if hpEq : data.input.p = 2 then diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/Main.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/Main.lean index 080b85ef0f..f2f4e8c60a 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/Main.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/Main.lean @@ -13,7 +13,7 @@ public import LeanPool.ParameterFreeGradient.V7.MainStatement The completed runtime satisfies the parameter-free main rate in all exponent regimes. -/ -@[expose] public section +public section namespace V7.Stage8Main diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/MainExecution.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/MainExecution.lean index 51c1e00723..67fcf8f458 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/MainExecution.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/MainExecution.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage8Main.Accounting The successful runtime produces a causal exact query trace and valid output. -/ -@[expose] public section +public section namespace V7.Stage8Main diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/Refinement.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/Refinement.lean index 60e2034b80..74353c0e93 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/Refinement.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/Refinement.lean @@ -12,12 +12,12 @@ public import LeanPool.ParameterFreeGradient.V7.Proofs.Stage8Main.Controller The explicit causal state machine refines the certified finite controller execution. -/ -@[expose] public section +public section namespace V7.Stage8Main /-- The chronological observation list obtained by concatenating the trial reports. -/ -def reportsTrace (reports : List (TrialReport d)) : List (Observation d) := +@[expose] def reportsTrace (reports : List (TrialReport d)) : List (Observation d) := reports.flatMap TrialReport.trace @[simp] theorem reportsTrace_append_singleton diff --git a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/RuntimeMachine.lean b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/RuntimeMachine.lean index 1a88c2dba6..8b65aa24b9 100644 --- a/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/RuntimeMachine.lean +++ b/LeanPool/ParameterFreeGradient/V7/Proofs/Stage8Main/RuntimeMachine.lean @@ -18,7 +18,7 @@ the primitive `O3.FirstOrderMethod` execution interface from the historical namespace. -/ -@[expose] public section +public section namespace V7.Stage8Main @@ -45,6 +45,7 @@ structure RuntimeData (d : ℕ) where anchorTrace : List (Observation d) /-- The accepted anchor smoothness estimate. -/ +@[expose] noncomputable def RuntimeData.Ma (data : RuntimeData d) : ℝ := (2 : ℝ) ^ data.anchorEpoch * data.input.M0 @@ -63,16 +64,17 @@ structure RuntimeControllerState (d : ℕ) where reports : List (TrialReport d) /-- The controller state before its first local trial. -/ -def initialRuntimeControllerState : RuntimeControllerState d := +@[expose] def initialRuntimeControllerState : RuntimeControllerState d := ⟨0, 0, [], []⟩ /-- The current dyadic smoothness estimate. -/ +@[expose] noncomputable def RuntimeControllerState.M (data : RuntimeData d) (state : RuntimeControllerState d) : ℝ := (2 : ℝ) ^ state.scaleEpoch * data.Ma /-- The current dyadic radius estimate normalized by the initial gradient size. -/ -noncomputable def RuntimeControllerState.D (data : RuntimeData d) +@[expose] noncomputable def RuntimeControllerState.D (data : RuntimeData d) (state : RuntimeControllerState d) : ℝ := (2 : ℝ) ^ state.radiusLevel * data.G / state.M data @@ -85,7 +87,7 @@ theorem RuntimeControllerState.D_pos (data : RuntimeData d) exact div_pos (mul_pos (pow_pos (by norm_num) _) data.hG) (state.M_pos data) /-- The certified local trial selected for the current exponent regime and controller estimates. -/ -noncomputable def runtimeTrial (data : RuntimeData d) +@[expose] noncomputable def runtimeTrial (data : RuntimeData d) (state : RuntimeControllerState d) : LocalTrial d := if hp2 : data.input.p < 2 then belowTrialFor data.input.p data.hp hp2 data.input.eps @@ -101,7 +103,7 @@ noncomputable def runtimeTrial (data : RuntimeData d) (state.M_pos data) (state.D_pos data) data.input.x0 data.cached /-- The next controller state after a scale failure, resetting the radius level. -/ -noncomputable def nextScale (data : RuntimeData d) (state : RuntimeControllerState d) +@[expose] noncomputable def nextScale (data : RuntimeData d) (state : RuntimeControllerState d) (report : TrialReport d) : RuntimeControllerState d := { scaleEpoch := state.scaleEpoch + 1 radiusLevel := 0 @@ -109,7 +111,7 @@ noncomputable def nextScale (data : RuntimeData d) (state : RuntimeControllerSta reports := state.reports ++ [report] } /-- The next controller state after a radius failure, retaining the current smoothness scale. -/ -noncomputable def nextRadius (data : RuntimeData d) (state : RuntimeControllerState d) +@[expose] noncomputable def nextRadius (data : RuntimeData d) (state : RuntimeControllerState d) (report : TrialReport d) : RuntimeControllerState d := { scaleEpoch := state.scaleEpoch radiusLevel := state.radiusLevel + 1 @@ -132,6 +134,7 @@ inductive CurrentMethodState (d : ℕ) where (observations : List (Observation d)) /-- The first action of the current local trial, embedded in the global method state. -/ +@[expose] noncomputable def startLocalAction (data : RuntimeData d) (state : RuntimeControllerState d) : O3.Action d (CurrentMethodState d) := let trial := runtimeTrial data state @@ -141,7 +144,7 @@ noncomputable def startLocalAction (data : RuntimeData d) | .finish _ _ => .done data.input.x0 /-- The next local query or controller transition after a local trial observation. -/ -noncomputable def continueLocalAction (data : RuntimeData d) +@[expose] noncomputable def continueLocalAction (data : RuntimeData d) (state : RuntimeControllerState d) (machineState : (runtimeTrial data state).State) (observations : List (Observation d)) : O3.Action d (CurrentMethodState d) := @@ -158,7 +161,7 @@ noncomputable def continueLocalAction (data : RuntimeData d) | .radius _ => startLocalAction data (nextRadius data state report) /-- The observable state transition of the complete parameter-free method. -/ -noncomputable def currentMethodAction : +@[expose] noncomputable def currentMethodAction : CurrentMethodState d → O3.Action d (CurrentMethodState d) | .needX0 input => .query input.x0 fun observation => @@ -198,7 +201,7 @@ noncomputable def currentMethodAction : /-- The first-order method implementing initialization, anchor search, and the geometric controller. -/ -noncomputable def currentMethod (d : ℕ) : O3.FirstOrderMethod d where +@[expose] noncomputable def currentMethod (d : ℕ) : O3.FirstOrderMethod d where State := CurrentMethodState d initial := fun input => CurrentMethodState.needX0 { p := input.p, eps := input.eps, x0 := input.x0, @@ -206,6 +209,7 @@ noncomputable def currentMethod (d : ℕ) : O3.FirstOrderMethod d where action := currentMethodAction /-- One family is fixed before runtime `p`, dimension-specific input, or oracle. -/ +@[expose] noncomputable def currentMethodFamily : RuntimeMethodFamily := fun d => currentMethod d end V7.Stage8Main diff --git a/LeanPool/ParameterFreeGradient/V7/StrictModel.lean b/LeanPool/ParameterFreeGradient/V7/StrictModel.lean index 9bd11511b6..a68959346f 100644 --- a/LeanPool/ParameterFreeGradient/V7/StrictModel.lean +++ b/LeanPool/ParameterFreeGradient/V7/StrictModel.lean @@ -14,7 +14,7 @@ Strict deterministic and randomized oracle models, exact transcripts, and normal instances. -/ -@[expose] public section +public section open MeasureTheory @@ -34,7 +34,7 @@ instance : MeasurableSpace StrictObservation := /-- Cylinder sigma algebra on finite exact-pair transcripts, generated by length events and Borel events at each finite coordinate. -/ -@[instance_reducible] def strictTranscriptMeasurableSpace : +@[expose, instance_reducible] def strictTranscriptMeasurableSpace : MeasurableSpace StrictTranscript := MeasurableSpace.generateFrom {s : Set StrictTranscript | (∃ n : ℕ, s = {trace | trace.length = n}) ∨ @@ -72,43 +72,43 @@ instance [MeasurableSpace Ω] : CoeFun (RandomizedStrictLocalMethod Ω) (fun _ => Ω → StrictLocalMethod) := ⟨RandomizedStrictLocalMethod.run⟩ /-- Every transcript entry is the exact observation of the one-dimensional oracle. -/ -def StrictTranscriptExact (oracle : PairOracle 1) (trace : StrictTranscript) : Prop := +@[expose] def StrictTranscriptExact (oracle : PairOracle 1) (trace : StrictTranscript) : Prop := TraceExact oracle trace /-- The transcript contains `N` queries, all with gradient magnitude above the target accuracy. -/ -def StrictAllFirstNQueriesFail (eps : ℝ) (oracle : PairOracle 1) +@[expose] def StrictAllFirstNQueriesFail (eps : ℝ) (oracle : PairOracle 1) (trace : StrictTranscript) (N : ℕ) : Prop := trace.length = N ∧ ∀ obs ∈ trace, eps < |oracle.gradient obs.point 0| /-- The method's finite-budget output has gradient magnitude above its target accuracy. -/ -def StrictFiniteOutputFails (method : StrictLocalMethod) (oracle : PairOracle 1) +@[expose] def StrictFiniteOutputFails (method : StrictLocalMethod) (oracle : PairOracle 1) (trace : StrictTranscript) (N : ℕ) : Prop := method.eps < |oracle.gradient (method.output N trace) 0| /-- Some query before budget `N`, or the corresponding output, meets the gradient accuracy. -/ -def StrictSuccessThrough (method : StrictLocalMethod) (oracle : PairOracle 1) +@[expose] def StrictSuccessThrough (method : StrictLocalMethod) (oracle : PairOracle 1) (trace : StrictTranscript) (N : ℕ) : Prop := (∃ obs ∈ trace.take N, |oracle.gradient obs.point 0| ≤ method.eps) ∨ |oracle.gradient (method.output N trace) 0| ≤ method.eps /-- The constant bounds every gradient difference and is the least such bound. -/ -def ExactGradientLipschitzConstant (oracle : PairOracle 1) (L : ℝ) : Prop := +@[expose] def ExactGradientLipschitzConstant (oracle : PairOracle 1) (L : ℝ) : Prop := (∀ x y, |oracle.gradient x 0 - oracle.gradient y 0| ≤ L * |x 0 - y 0|) ∧ ∀ L' : ℝ, (∀ x y, |oracle.gradient x 0 - oracle.gradient y 0| ≤ L' * |x 0 - y 0|) → L ≤ L' /-- The one-dimensional objective tends above every bound outside a sufficiently large interval. -/ -def IsCoerciveReal (f : StrictPoint → ℝ) : Prop := +@[expose] def IsCoerciveReal (f : StrictPoint → ℝ) : Prop := ∀ B : ℝ, ∃ R : ℝ, 0 ≤ R ∧ ∀ x, R ≤ |x 0| → B ≤ f x /-- The specified point is a global minimizer and is the only point attaining its value. -/ -def UniqueMinimizer (f : StrictPoint → ℝ) (xstar : StrictPoint) : Prop := +@[expose] def UniqueMinimizer (f : StrictPoint → ℝ) (xstar : StrictPoint) : Prop := (∀ x, f xstar ≤ f x) ∧ ∀ x, f x = f xstar → x = xstar /-- The affine--quadratic--affine family from `thm:impossibility`. -/ -noncomputable def strictHardFamily (eps : ℝ) (x0 : StrictPoint) (H : ℝ) +@[expose] noncomputable def strictHardFamily (eps : ℝ) (x0 : StrictPoint) (H : ℝ) (x : StrictPoint) : ℝ := let g := 2 * eps let z := x 0 - x0 0 @@ -117,7 +117,7 @@ noncomputable def strictHardFamily (eps : ℝ) (x0 : StrictPoint) (H : ℝ) else g * z - 4 * g * H /-- The exact piecewise derivative of the affine-quadratic-affine hard family. -/ -noncomputable def strictHardDerivative (eps : ℝ) (x0 : StrictPoint) (H : ℝ) +@[expose] noncomputable def strictHardDerivative (eps : ℝ) (x0 : StrictPoint) (H : ℝ) (x : StrictPoint) : StrictPoint := fun _ => let g := 2 * eps @@ -126,7 +126,7 @@ noncomputable def strictHardDerivative (eps : ℝ) (x0 : StrictPoint) (H : ℝ) /-- The hard-family oracle has the required convexity, minimizer, and exact normalization properties. -/ -def StrictHardInstance (eps : ℝ) (x0 : StrictPoint) (H L R : ℝ) +@[expose] def StrictHardInstance (eps : ℝ) (x0 : StrictPoint) (H L R : ℝ) (oracle : PairOracle 1) (xstar : StrictPoint) : Prop := 0 < H ∧ oracle.value = strictHardFamily eps x0 H ∧ @@ -139,11 +139,12 @@ def StrictHardInstance (eps : ℝ) (x0 : StrictPoint) (H L R : ℝ) 0 < L ∧ R = |xstar 0 - x0 0| ∧ L * R / eps = 4 /-- The affine oracle matching the left tail of every hard-family instance. -/ -noncomputable def strictAffineOracle (eps : ℝ) (x0 : StrictPoint) : PairOracle 1 := +@[expose] noncomputable def strictAffineOracle (eps : ℝ) (x0 : StrictPoint) : PairOracle 1 := { value := fun x => -(2 * eps) * (x 0 - x0 0) gradient := fun _ _ => -(2 * eps) } /-- A convex coercive exact-gradient instance with unique minimizer and condition number four. -/ +@[expose] def StrictNormalizedInstance (eps : ℝ) (x0 : StrictPoint) (L R : ℝ) (oracle : PairOracle 1) (xstar : StrictPoint) : Prop := O3.IsConvexObjective oracle.value ∧ IsCoerciveReal oracle.value ∧ @@ -154,13 +155,13 @@ def StrictNormalizedInstance (eps : ℝ) (x0 : StrictPoint) (L R : ℝ) /-- A source-level hitting-time carrier. `top` means no queried or returned small-gradient point is reached. -/ -noncomputable def strictHittingTime (method : StrictLocalMethod) +@[expose] noncomputable def strictHittingTime (method : StrictLocalMethod) (oracle : PairOracle 1) (traces : ℕ → StrictTranscript) : ENNReal := sInf {t : ENNReal | ∃ N : ℕ, t = (N : ENNReal) ∧ StrictSuccessThrough method oracle (traces N) N} /-- The exact transcript follows the strict method's causal query rule. -/ -def StrictRunConsistent (method : StrictLocalMethod) (oracle : PairOracle 1) +@[expose] def StrictRunConsistent (method : StrictLocalMethod) (oracle : PairOracle 1) (trace : StrictTranscript) : Prop := StrictTranscriptExact oracle trace ∧ ∀ (t : ℕ) (ht : t < trace.length), diff --git a/LeanPool/ParameterFreeGradient/V7/StrictStatements.lean b/LeanPool/ParameterFreeGradient/V7/StrictStatements.lean index 76ed6fc438..ea082b9c19 100644 --- a/LeanPool/ParameterFreeGradient/V7/StrictStatements.lean +++ b/LeanPool/ParameterFreeGradient/V7/StrictStatements.lean @@ -14,7 +14,7 @@ Finite-horizon, expected-time, and scale-identification impossibility statements methods. -/ -@[expose] public section +public section open MeasureTheory @@ -22,7 +22,7 @@ namespace V7 /-- U04--U07: `eps` is fixed before the method; the hard transition length and objective are existential only after the finite transcript/output map. -/ -noncomputable def DeterministicFiniteHorizonImpossibilityStatement : Prop := +@[expose] noncomputable def DeterministicFiniteHorizonImpossibilityStatement : Prop := ∀ (p eps : ℝ), 1 < p → 0 < eps → ∀ (method : StrictLocalMethod), method.eps = eps → ∀ (N : ℕ), 0 < N → @@ -39,6 +39,7 @@ noncomputable def DeterministicFiniteHorizonImpossibilityStatement : Prop := /-- U08: a single deterministic `H` and hard instance is chosen after the whole seed-indexed method, never separately for each seed. -/ +@[expose] noncomputable def RandomizedFiniteHorizonImpossibilityStatement : Prop := ∀ (p eps : ℝ), 1 < p → 0 < eps → ∀ (Ω : Type) [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] @@ -70,6 +71,7 @@ noncomputable def RandomizedFiniteHorizonImpossibilityStatement : Prop := /-- U09: the supremum of the actual expected queried-or-returned hitting time over normalized strict instances is infinite. -/ +@[expose] noncomputable def InfiniteWorstCaseExpectedHittingTimeStatement : Prop := ∀ (p eps : ℝ), 1 < p → 0 < eps → ∀ (Ω : Type) [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] @@ -87,6 +89,7 @@ noncomputable def InfiniteWorstCaseExpectedHittingTimeStatement : Prop := /-- U10: the real-line obstruction applies for every fixed interior exponent because the one-dimensional `ell_p` and `ell_q` norms are absolute value. -/ +@[expose] noncomputable def OneDimensionalInteriorLpTransferStatement : Prop := ∀ (p : ℝ), 1 < p → (∀ x : StrictPoint, lpNorm p x = |x 0|) ∧ @@ -94,6 +97,7 @@ noncomputable def OneDimensionalInteriorLpTransferStatement : Prop := /-- Source carrier for `thm:impossibility`; its deterministic, randomized, expectation, and all-`p` clauses remain separate conjuncts. -/ +@[expose] noncomputable def ScaleIdentificationImpossibilityStatement : Prop := DeterministicFiniteHorizonImpossibilityStatement ∧ RandomizedFiniteHorizonImpossibilityStatement ∧ diff --git a/LeanPool/ParameterFreeGradient/V7/TrialInterfaces.lean b/LeanPool/ParameterFreeGradient/V7/TrialInterfaces.lean index 39f150ec9f..0a065ac9a7 100644 --- a/LeanPool/ParameterFreeGradient/V7/TrialInterfaces.lean +++ b/LeanPool/ParameterFreeGradient/V7/TrialInterfaces.lean @@ -12,7 +12,7 @@ public import LeanPool.ParameterFreeGradient.V7.Guards Causal local trial actions, observable reports, guard ledgers, and correctness certificates. -/ -@[expose] public section +public section namespace V7 @@ -26,6 +26,7 @@ structure ObservableGuardCheck (d : ℕ) where yPair : Observation d /-- The point-based failure witness associated with an observation-based guard check. -/ +@[expose] def ObservableGuardCheck.failure (check : ObservableGuardCheck d) : ObservableGuardFailure d := ⟨check.kind, check.xPair.point, check.yPair.point⟩ @@ -45,6 +46,7 @@ structure TrialReport (d : ℕ) where outcome : TrialOutcome d /-- The number of new oracle observations recorded by the trial. -/ +@[expose] def TrialReport.calls (report : TrialReport d) : ℕ := report.trace.length /-- An observation retained for reuse without another oracle call. -/ @@ -68,7 +70,7 @@ structure LocalTrial (d : ℕ) where action : State → LocalTrialAction d State /-- The finite-fuel local execution, returning no report if its action budget is exhausted. -/ -def LocalTrial.runFuel (trial : LocalTrial d) (oracle : PairOracle d) : +@[expose] def LocalTrial.runFuel (trial : LocalTrial d) (oracle : PairOracle d) : ℕ → trial.State → List (Observation d) → Option (TrialReport d) | 0, _, _ => none | fuel + 1, state, history => @@ -79,12 +81,13 @@ def LocalTrial.runFuel (trial : LocalTrial d) (oracle : PairOracle d) : trial.runFuel oracle fuel (next obs) (history ++ [obs]) /-- Some finite-fuel execution from the prescribed initial state returns this report. -/ -def LocalTrial.Executes (trial : LocalTrial d) (M D : ℝ) (cached : CachedPair d) +@[expose] def LocalTrial.Executes (trial : LocalTrial d) (M D : ℝ) (cached : CachedPair d) (oracle : PairOracle d) (report : TrialReport d) : Prop := ∃ fuel, trial.runFuel oracle fuel (trial.initial M D cached) [] = some report /-- A success report returns an exact queried point meeting the gradient target after accepted guards. -/ +@[expose] def SuccessCorrect (eps p M : ℝ) (oracle : PairOracle d) (report : TrialReport d) : Prop := ∀ obs, report.outcome = .success obs → @@ -95,6 +98,7 @@ def SuccessCorrect (eps p M : ℝ) (oracle : PairOracle d) /-- A scale report identifies the first failed guard and certifies that the smoothness estimate is too small. -/ +@[expose] def ScaleCorrect (p M L : ℝ) (oracle : PairOracle d) (report : TrialReport d) : Prop := ∀ failed, report.outcome = .scale failed → @@ -105,6 +109,7 @@ def ScaleCorrect (p M L : ℝ) (oracle : PairOracle d) GuardFails p M oracle failed.failure ∧ M < L /-- A radius report has accepted guards and certifies that its radius estimate is too small. -/ +@[expose] def RadiusCorrect (eps p M D R : ℝ) (oracle : PairOracle d) (report : TrialReport d) : Prop := ∀ terminal, report.outcome = .radius terminal → @@ -114,12 +119,14 @@ def RadiusCorrect (eps p M D R : ℝ) (oracle : PairOracle d) eps < lpNorm (conjugateExponent p) terminal.gradient ∧ D < R /-- The report belongs to one of the three possible terminal outcome cases. -/ +@[expose] def TrialOutcomeExhaustive (report : TrialReport d) : Prop := (∃ x, report.outcome = .success x) ∨ (∃ g, report.outcome = .scale g) ∨ ∃ x, report.outcome = .radius x /-- The numbers of consecutive guard checks and calls agree with the terminal outcome. -/ +@[expose] def TrialReport.consecutiveGuardAccounting (report : TrialReport d) : Prop := match report.outcome with | .success _ => report.checkedGuards.length + 1 = report.calls @@ -127,7 +134,7 @@ def TrialReport.consecutiveGuardAccounting (report : TrialReport d) : Prop := | .radius _ => report.checkedGuards.length = report.calls /-- The observation is either cached or present in the trial's new query trace. -/ -def ObservationAvailable (cached : CachedPair d) (report : TrialReport d) +@[expose] def ObservationAvailable (cached : CachedPair d) (report : TrialReport d) (obs : Observation d) : Prop := obs = cached.observation ∨ obs ∈ report.trace @@ -140,18 +147,20 @@ def ConsecutiveAvailable (cached : CachedPair d) (report : TrialReport d) before ++ [check.xPair, check.yPair] ++ after /-- Every recorded guard has a kind in the allowed list. -/ +@[expose] def CheckedGuardsHaveKinds (report : TrialReport d) (allowed : List ObservableGuardKind) : Prop := ∀ check ∈ report.checkedGuards, check.kind ∈ allowed /-- A guard of the specified kind and ordered pair of points occurs in the checked list. -/ +@[expose] def GuardRecorded (report : TrialReport d) (kind : ObservableGuardKind) (x y : Point d) : Prop := ∃ check ∈ report.checkedGuards, check.kind = kind ∧ check.xPair.point = x ∧ check.yPair.point = y /-- Each guard uses the corresponding consecutive pair in the cached observation and query trace. -/ -def ConsecutiveGuardLedger (cached : CachedPair d) +@[expose] def ConsecutiveGuardLedger (cached : CachedPair d) (report : TrialReport d) : Prop := ∀ i < report.checkedGuards.length, ∃ check, (report.checkedGuards.drop i).head? = some check ∧ @@ -160,7 +169,7 @@ def ConsecutiveGuardLedger (cached : CachedPair d) /-- Every predicate reported by the routine is evaluated on exact pairs that the routine actually possesses: the cached pair or a chronological query. -/ -def GuardDataExact (cached : CachedPair d) (oracle : PairOracle d) +@[expose] def GuardDataExact (cached : CachedPair d) (oracle : PairOracle d) (report : TrialReport d) : Prop := cached.observation = oracle.observe cached.observation.point ∧ ∀ check ∈ report.checkedGuards, @@ -170,6 +179,7 @@ def GuardDataExact (cached : CachedPair d) (oracle : PairOracle d) check.yPair = oracle.observe check.yPair.point /-- Correctness proposition kept separate from observable trial data. -/ +@[expose] def TrialCertificate (eps p M D L R : ℝ) (cached : CachedPair d) (oracle : PairOracle d) (report : TrialReport d) : Prop := 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 908ed73af8..42a2600884 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 5f06c33574..eecd3df2b2 100644 --- a/LeanPool/PolyaEnumerationTheorem.lean +++ b/LeanPool/PolyaEnumerationTheorem.lean @@ -22,7 +22,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 9dee65cb18..fbaf01905f 100644 --- a/LeanPool/PolyaEnumerationTheorem/Basic.lean +++ b/LeanPool/PolyaEnumerationTheorem/Basic.lean @@ -39,7 +39,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 15c12c7fca..c089a0f940 100644 --- a/LeanPool/PolyaEnumerationTheorem/Concrete.lean +++ b/LeanPool/PolyaEnumerationTheorem/Concrete.lean @@ -12,7 +12,7 @@ public import LeanPool.PolyaEnumerationTheorem.Basic # 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 fa00afff3a..cc02b7096b 100644 --- a/LeanPool/PolyaEnumerationTheorem/PermutationAuxiliary.lean +++ b/LeanPool/PolyaEnumerationTheorem/PermutationAuxiliary.lean @@ -10,7 +10,7 @@ public import Mathlib.GroupTheory.Perm.Cycle.Basic # Auxiliary results on permutations -/ -@[expose] public section +public section universe u diff --git a/LeanPool/PolyaEnumerationTheorem/ReductionToFin.lean b/LeanPool/PolyaEnumerationTheorem/ReductionToFin.lean index cbfdf971c5..e6f743cc46 100644 --- a/LeanPool/PolyaEnumerationTheorem/ReductionToFin.lean +++ b/LeanPool/PolyaEnumerationTheorem/ReductionToFin.lean @@ -17,7 +17,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 c6b28a32ea..631dc251b2 100644 --- a/LeanPool/PolyaEnumerationTheorem/StirlingFirstKindSum.lean +++ b/LeanPool/PolyaEnumerationTheorem/StirlingFirstKindSum.lean @@ -17,7 +17,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..ac5f7ec540 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 @@ -78,7 +78,7 @@ variable {X_A X_B : Type _} variable [FAb_A : AddFreeGroup A X_A] [FAb_B : AddFreeGroup B X_B] /-- The inclusion map from the direct sum of the bases of two free groups into their product. -/ -def ι : (X_A ⊕ X_B) → A × B +@[expose] def ι : (X_A ⊕ X_B) → A × B | Sum.inl x_a => (FAb_A.ι x_a, 0) | Sum.inr x_b => (0, FAb_B.ι x_b) 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..c8bb97d32c 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 @@ -123,7 +123,7 @@ instance {α β : Type _} [dfa : DecideForall α] [dfb : DecideForall β] : DecideForall (α × β) := ⟨by apply decideProd⟩ -@[reducible, instance] +@[reducible, instance, expose] def decideUnit (p : Unit → Prop) [DecidablePred p] : Decidable (∀ x : Unit, p x) := if c : p () then .isTrue (fun x => by cases x; exact c) @@ -133,7 +133,7 @@ def decideUnit (p : Unit → Prop) [DecidablePred p] : Decidable (∀ x : Unit, instance : DecideForall Unit := ⟨by apply decideUnit⟩ -@[reducible, instance] +@[reducible, instance, expose] def decideSum {α β : Type _} [dfa : DecideForall α] [dfb : DecideForall β] (p : α ⊕ β → Prop) [DecidablePred p] : Decidable (∀ x : α ⊕ β, p x) := if c: ∀x: α, p (Sum.inl x) then diff --git a/LeanPool/Polylean/UnitConjecture/FreeModule.lean b/LeanPool/Polylean/UnitConjecture/FreeModule.lean index ef1f37e0c3..cbc0e7d04d 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₀ @@ -208,7 +208,7 @@ theorem eq_mem_of_equalOnList (l : List X) (f g : X → R) (x : X) (mhyp : x ∈ namespace FormalSum /-- Add a monomial, combining its coefficient with the first matching basis term. -/ -def addMonomial (term : R × X) : FormalSum R X → FormalSum R X +@[expose] def addMonomial (term : R × X) : FormalSum R X → FormalSum R X | [] => if term.1 = 0 then [] else [term] | head :: tail => if head.2 = term.2 then @@ -240,7 +240,7 @@ theorem coords_addMonomial (term : R × X) (sum : FormalSum R X) (x : X) : · simp [addMonomial, hsame, coords, ih, add_left_comm] /-- Combine repeated basis terms and discard terms whose coefficients cancel. -/ -def combineCoefficients : FormalSum R X → FormalSum R X +@[expose] def combineCoefficients : FormalSum R X → FormalSum R X | [] => [] | term :: tail => addMonomial term (combineCoefficients tail) @@ -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 @@ -477,7 +478,7 @@ namespace FormalSum -/ /-- Scalar multiplication on formal sums. -/ -def scmul : R → FormalSum R X → FormalSum R X +@[expose] def scmul : R → FormalSum R X → FormalSum R X | _, [] => [] | r, (h :: t) => let (a₀, x₀) := h @@ -494,7 +495,7 @@ theorem scmul_coords (r : R) (s : FormalSum R X) (x₀ : X) : simp only [coords, left_distrib, ih, scmul, monom_coords_mul] /-- Scalar multiplication on the Free Module. -/ -def _root_.LeanPool.Polylean.FreeModule.scmul : R → R[X] → R[X] := by +@[expose] def _root_.LeanPool.Polylean.FreeModule.scmul : R → R[X] → R[X] := by intro r let f : FormalSum R X → R[X] := fun s => ⟦s.scmul r⟧ apply Quotient.lift f @@ -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..46c28a0dff 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 @@ -36,13 +36,13 @@ variable {G : Type} [Group G] [DecidableEq G] ## Multiplication on formal sums -/ /-- multiplication by a monomial -/ -def _root_.LeanPool.Polylean.FormalSum.mulMonom +@[expose] def _root_.LeanPool.Polylean.FormalSum.mulMonom (b : R) (h : G) : FormalSum R G → FormalSum R G | [] => [] | (a, g) :: tail => (a * b, g * h) :: (mulMonom b h tail) /-- multiplication for formal sums -/ -def _root_.LeanPool.Polylean.FormalSum.mul +@[expose] def _root_.LeanPool.Polylean.FormalSum.mul (fst : FormalSum R G) : FormalSum R G → FormalSum R G | [] => [] | (b, h) :: ys => @@ -139,7 +139,7 @@ theorem mul_zero_cons (s t : FormalSum R G) : mul s ((0, h) :: t) ≈ mul s t := /-- Quotient in second argument for group ring multiplication -/ -def mulAux : FormalSum R G → R[G] → R[G] := by +@[expose] def mulAux : FormalSum R G → R[G] → R[G] := by intro s apply Quotient.lift (⟦FormalSum.mul s ·⟧) apply func_eql_of_move_equiv @@ -241,7 +241,7 @@ theorem first_arg_invariant_nil (s₁ s₂ : FormalSum R G) first_arg_invariant s₁ s₂ [] rel /-- multiplication for free modules -/ -def mul : R[G] → R[G] → R[G] := by +@[expose] def mul : R[G] → R[G] → R[G] := by let f := fun (s : FormalSum R G) => fun (t : R[G]) => mulAux s t apply Quotient.lift f @@ -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..fc430e12d2 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 @@ -76,7 +76,7 @@ instance {A B : Type _} [AddGroup A] [AddGroup B] [AddTorsionFree A] /-! ### **Step 1:** Defining the square of an element of `P`. -/ /-- The function taking an element of `P` to its square, which lies in the kernel `K`. -/ -@[aesop norm unfold (rule_sets := [P]), reducible] +@[expose, aesop norm unfold (rule_sets := [P]), reducible] def _root_.LeanPool.Polylean.P.sq : P → K | ((p, q, r), .e) => (p + p, q + q, r + r) | ((_, q, _), .b) => (0, q + q + 1, 0) 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 8e0c54f8dd..97872266c7 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 @@ -405,6 +405,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 @@ -673,7 +674,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 7f6f258f50..d07efa17a7 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 d0a701e23e..55c3589963 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 0e88591aa3..8ba39161e7 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 bf4a2892fb..fff83002d8 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..3d0fde19d3 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 @@ -444,7 +444,7 @@ variable [Fintype X] [Fintype Y] [Fintype A] [Fintype B] variable {G : Game X Y A B} /-- The measurement effect for winning. -/ -def winningEffect (S : Strategy G) (x : X) (y : Y) : +@[expose] def winningEffect (S : Strategy G) (x : X) (y : Y) : Matrix (S.Alice × S.Bob) (S.Alice × S.Bob) ℂ := ∑ a : A, ∑ b : B, if G.predicate x y a b = true then S.jointEffect x y a b else 0 @@ -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..17c5951f1d 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,20 +3772,20 @@ 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 : ℝ)) /-- The distribution floor residual construction used in the quantum parallel-repetition argument. -/ -def distributionFloorResidual (denominator : ℕ) (p : ι → ℝ) : ℕ := +@[expose] def distributionFloorResidual (denominator : ℕ) (p : ι → ℝ) : ℕ := denominator - ∑ i, distributionFloorNumerator denominator p i /-- The distribution rounded numerator construction used in the quantum parallel-repetition argument. -/ -def distributionRoundedNumerator +@[expose] def distributionRoundedNumerator (base : ι) (denominator : ℕ) (p : ι → ℝ) : ι → ℕ := fun i => distributionFloorNumerator denominator p i + if i = base then distributionFloorResidual denominator p else 0 @@ -3794,7 +3795,7 @@ private def distributionFloorProbability fun i => (distributionFloorNumerator denominator p i : ℝ) / denominator /-- The probability of distribution rounded. -/ -def distributionRoundedProbability +@[expose] def distributionRoundedProbability (base : ι) (denominator : ℕ) (p : ι → ℝ) : ι → ℝ := fun i => (distributionRoundedNumerator base denominator 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 @@ -5201,7 +5202,7 @@ def finiteTensorLocalUnitary exact finiteTensorLocalUnitaryMatrix_gram U /-- The unitary operator implementing controlled finite tensor local. -/ -def controlledFiniteTensorLocalUnitary +@[expose] def controlledFiniteTensorLocalUnitary {Ω ι β : Type*} [Fintype Ω] [DecidableEq Ω] [Fintype ι] [DecidableEq ι] @@ -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..7c944024d2 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) := @@ -851,7 +851,7 @@ theorem dSVDensityRationalCanonicalAcceptedTarget_ne_zero nlinarith /-- Normalize the canonical accepted target vector. -/ -def dSVDensityRationalCanonicalNormalizedTarget +@[expose] def dSVDensityRationalCanonicalNormalizedTarget {d : ℕ} (w : ℝ) (N : ℕ) (ξ : BipartiteUnitVector d) : EuclideanSpace ℂ (Fin d × Fin d) := @@ -904,7 +904,7 @@ private theorem dSVDensityRationalCanonicalNormalizedTarget_distance_le width grid ξ /-- The target object for DSV density rational canonical accepted unit. -/ -def dSVDensityRationalCanonicalAcceptedUnitTarget +@[expose] def dSVDensityRationalCanonicalAcceptedUnitTarget {d N : ℕ} {w : ℝ} (width : 0 < w) (grid : 0 < N) (fine : (d : ℝ) / (N : ℝ) < 1 / (w + 1)) (ξ : BipartiteUnitVector 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, @@ -1833,7 +1833,7 @@ open scoped BigOperators Kronecker ComplexOrder MatrixOrder attribute [local instance] Classical.propDecidable /-- The rank map for DSV density rational physical mixed accepted intersection. -/ -def dSVDensityRationalPhysicalMixedAcceptedIntersectionRank +@[expose] def dSVDensityRationalPhysicalMixedAcceptedIntersectionRank {d : ℕ} (w : ℝ) (N : ℕ) (ξ ζ : BipartiteUnitVector d) (i j : Fin d) : Fin (N + 1) := @@ -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 : ℕ) @@ -2311,7 +2313,7 @@ attribute [local instance] Classical.propDecidable The DSV density rational first accept actual tensor basis construction used in the quantum parallel-repetition argument. -/ -def dSVDensityRationalFirstAcceptActualTensorBasis +@[expose] def dSVDensityRationalFirstAcceptActualTensorBasis {β : Type*} [Fintype β] [DecidableEq β] {L : ℕ} (U : Matrix.unitaryGroup β ℂ) : Matrix.unitaryGroup (Σ _ : Fin (L + 1), Fin (L + 1) → β) ℂ := @@ -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 → @@ -2792,7 +2794,7 @@ def dSVDensityRationalPublicBucketCoherentPhaseSigmaState (fun a b => work a.1 a.2 b.2) /-- The unitary operator implementing DSV density rational public bucket coherent phase local. -/ -def dSVDensityRationalPublicBucketCoherentPhaseLocalUnitary +@[expose] def dSVDensityRationalPublicBucketCoherentPhaseLocalUnitary {H I : Type*} [Fintype H] [DecidableEq H] {B D m : ℕ} (rank : H → Fin D) @@ -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 @@ -3263,7 +3265,7 @@ theorem dSVDensityRationalPrefixHarmonicSpectralOverlap_nonneg spectralAtomOverlap_nonneg _ _ _ _ i j /-- The overlap quantity for DSV density rational local spectral pair basis. -/ -def dSVDensityRationalLocalSpectralPairBasisOverlap +@[expose] def dSVDensityRationalLocalSpectralPairBasisOverlap {d : ℕ} (ξ ζ : BipartiteUnitVector d) (i j : Fin d) : ℂ := unitaryBasisOverlap @@ -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 β ℂ) : @@ -4428,7 +4430,7 @@ def dSVDensityRationalHeterogeneousActualPhysicalLocalUnitary (L := L) U /-- The unitary operator implementing DSV density rational heterogeneous actual alice. -/ -def dSVDensityRationalHeterogeneousActualAliceUnitary +@[expose] def dSVDensityRationalHeterogeneousActualAliceUnitary (N : ℕ) {S d L : ℕ} (width : Fin S → ℝ) (schedule : Fin L → Fin S) (ξ : BipartiteUnitVector d) : @@ -4441,7 +4443,7 @@ def dSVDensityRationalHeterogeneousActualAliceUnitary (dSVUniformDensityAliceHistorySpectralCopy (N := N) ξ) /-- The unitary operator implementing DSV density rational heterogeneous actual bob. -/ -def dSVDensityRationalHeterogeneousActualBobUnitary +@[expose] def dSVDensityRationalHeterogeneousActualBobUnitary (N : ℕ) {S d L : ℕ} (width : Fin S → ℝ) (schedule : Fin L → Fin S) (ζ : BipartiteUnitVector d) : @@ -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..15f3b34b5f 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 : ℝ)) * @@ -1139,7 +1139,7 @@ abbrev ExactRevealHistoryTuple j ∈ exactRightPrefix seed} → X) /-- The finite equivalence encoding exact reveal history. -/ -def exactRevealHistoryEquiv +@[expose] def exactRevealHistoryEquiv {n : ℕ} (D : Finset (Fin n)) (seed : ExactRemainingSeed D) : ExactRevealHistory X Y D seed ≃ @@ -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) @@ -1753,7 +1755,7 @@ abbrev ExactHistoryFlagTuple ({j : Fin n // j ∈ D} → B) /-- The finite equivalence encoding exact history flag. -/ -def exactHistoryFlagEquiv +@[expose] def exactHistoryFlagEquiv {n : ℕ} (D : Finset (Fin n)) : ExactHistoryFlag X Y A B D ≃ ExactHistoryFlagTuple X Y A B D where @@ -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) @@ -2618,7 +2626,7 @@ variable {X Y A B : Type*} variable [Fintype X] [Fintype Y] [Fintype A] [Fintype B] /-- The standard exponential-decay statement for quantum parallel repetition. -/ -def StandardQuantumParallelRepetition (G : Game X Y A B) : Prop := +@[expose] def StandardQuantumParallelRepetition (G : Game X Y A B) : Prop := entangledValue G < 1 → HasExponentialBound (repeatedEntangledValue G) @@ -2726,7 +2734,7 @@ variable [Fintype dA] [Fintype dB] [DecidableEq dA] [DecidableEq dB] variable [Fintype J] [DecidableEq J] /-- The measurement effect for pure verifier. -/ -def pureVerifierEffect +@[expose] def pureVerifierEffect (G : Game X Y A B) (z : EuclideanSpace ℂ (dA × dB)) (hz : ‖z‖ = 1) (PA : X → POVM A dA) (PB : Y → POVM B dB) @@ -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 + @@ -4739,7 +4747,7 @@ variable {R : Type*} [Fintype R] variable {ι : R → Type*} [∀ r, Fintype (ι r)] /-- The state vector representing tagged tensor. -/ -def taggedTensorVector +@[expose] def taggedTensorVector (r : R) (z : EuclideanSpace ℂ (ι r × ι r)) : EuclideanSpace ℂ ((PUnit.{1} ⊕ (Σ r : R, ι r)) × @@ -4861,7 +4869,7 @@ theorem finiteTotalVariation_triangle (∑ i, |q i - r i|) / 2 := by ring /-- The weighted conditional joint construction used in the quantum parallel-repetition argument. -/ -def weightedConditionalJoint +@[expose] def weightedConditionalJoint {κ ι : Type*} (weight : κ → ℝ) (conditional : κ → ι → ℝ) : κ × ι → ℝ := @@ -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 @@ -5171,7 +5179,7 @@ theorem finiteRelativeEntropy_uniform_le_log_card ring /-- The uniform flag reference construction used in the quantum parallel-repetition argument. -/ -def uniformFlagReference +@[expose] def uniformFlagReference {Ω Z : Type*} [Fintype Z] (prior : Ω → ℝ) : Ω × Z → ℝ := fun t => prior t.1 * finiteUniformWeight Z @@ -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)) : ℝ := @@ -5574,7 +5582,7 @@ abbrev ConditionedAnswerFlag The repeated conditioned answer flag construction used in the quantum parallel-repetition argument. -/ -def repeatedConditionedAnswerFlag +@[expose] def repeatedConditionedAnswerFlag (G : Game X Y A B) (n : ℕ) (_S : Strategy (G.repeat n)) (D : Finset (Fin n)) (ω : StrategyOutcome @@ -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 → ℝ := @@ -5850,7 +5858,7 @@ theorem exactLocallySampleableLaw_eq_zero_of_question_zero zero_div, ite_self, mul_zero] /-- The total probability mass of exact alice local. -/ -def exactAliceLocalMass +@[expose] def exactAliceLocalMass {n : ℕ} (D : Finset (Fin n)) (Q : ExactLocallySampleableTuple X Y A B D → ℝ) (i : SourceRemainingCoordinate D) (x : X) : ℝ := @@ -5858,7 +5866,7 @@ def exactAliceLocalMass ∑ y : Y, Q (i, x, y, r) /-- The total probability mass of exact bob local. -/ -def exactBobLocalMass +@[expose] def exactBobLocalMass {n : ℕ} (D : Finset (Fin n)) (Q : ExactLocallySampleableTuple X Y A B D → ℝ) (i : SourceRemainingCoordinate D) (y : Y) : ℝ := @@ -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 → ℝ) @@ -6056,7 +6064,7 @@ theorem exactBobLocalConditional_sum /-- The exact locally sampleable ja construction used in the quantum parallel-repetition argument. -/ -def exactLocallySampleableJA +@[expose] def exactLocallySampleableJA (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (base : ExactHistoryFlag X Y A B D) @@ -6070,7 +6078,7 @@ def exactLocallySampleableJA /-- The exact locally sampleable jb construction used in the quantum parallel-repetition argument. -/ -def exactLocallySampleableJB +@[expose] def exactLocallySampleableJB (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (base : ExactHistoryFlag X Y A B D) @@ -6322,7 +6330,7 @@ abbrev ExactLocalSamplerIndex The exact local conditional family construction used in the quantum parallel-repetition argument. -/ -def exactLocalConditionalFamily +@[expose] def exactLocalConditionalFamily {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..1d3c39f718 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 := @@ -542,7 +542,7 @@ abbrev ExactGlobalHistoryLocalIndex ExactPaddedLocalIndex G n S D r) /-- The state vector representing exact global history. -/ -def exactGlobalHistoryVector +@[expose] def exactGlobalHistoryVector (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (r : ExactHistoryFlag X Y A B D) @@ -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) @@ -697,7 +698,7 @@ abbrev ExactSourceGlobalState Fin (Fintype.card (ExactGlobalHistoryLocalIndex G n S D))) /-- The exact source tuple psi construction used in the quantum parallel-repetition argument. -/ -def exactSourceTuplePsi +@[expose] def exactSourceTuplePsi (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (t : ExactLocallySampleableTuple 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) : @@ -740,7 +741,7 @@ theorem exactSourceTupleGamma_norm G n S D t.2.2.2 t.2.1).property /-- The numerical bound for exact source state distance. -/ -def ExactSourceStateDistanceBound +@[expose] def ExactSourceStateDistanceBound (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (η : ℝ) : Prop := (∑ 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 + @@ -1118,7 +1119,7 @@ def exactSourceClassicalInformationRate ((Finset.univ \ D).card : ℝ) /-- The numerical bound for exact source classical information. -/ -def ExactSourceClassicalInformationBound +@[expose] def ExactSourceClassicalInformationBound (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (base : ExactHistoryFlag X Y A B D) : Prop := @@ -1143,7 +1144,7 @@ theorem exactFiniteRelativeEntropy_equiv (fun i => q i * InformationTheory.klFun (p i / q i)) /-- The finite equivalence encoding exact alice information. -/ -def exactAliceInformationEquiv +@[expose] def exactAliceInformationEquiv {n : ℕ} (D : Finset (Fin n)) : ExactLocallySampleableTuple X Y A B D ≃ (SourceRemainingCoordinate D × X) × @@ -1158,7 +1159,7 @@ def exactAliceInformationEquiv rfl /-- The finite equivalence encoding exact bob information. -/ -def exactBobInformationEquiv +@[expose] def exactBobInformationEquiv {n : ℕ} (D : Finset (Fin n)) : ExactLocallySampleableTuple X Y A B D ≃ (SourceRemainingCoordinate D × Y) × @@ -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) @@ -1531,7 +1532,7 @@ variable {X Y A B : Type*} variable [Fintype X] [Fintype Y] [Fintype A] [Fintype B] /-- The finite equivalence encoding exact source prefix flag. -/ -def exactSourcePrefixFlagEquiv +@[expose] def exactSourcePrefixFlagEquiv {Ω V Z : Type*} {h : ℕ} : ((Ω × (Fin h → V)) × Z) ≃ ((Ω × Z) × (Fin h → V)) where @@ -1560,12 +1561,12 @@ variable {X Y A B : Type*} variable [Fintype X] [Fintype Y] [Fintype A] [Fintype B] /-- The marginal distribution of exact alice question prior. -/ -def exactAliceQuestionPriorMarginal +@[expose] def exactAliceQuestionPriorMarginal (G : Game X Y A B) (x : X) : ℝ := ∑ y : Y, G.questionWeight x y /-- The marginal distribution of exact bob question prior. -/ -def exactBobQuestionPriorMarginal +@[expose] def exactBobQuestionPriorMarginal (G : Game X Y A B) (y : Y) : ℝ := ∑ x : X, G.questionWeight x y @@ -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) @@ -2422,7 +2423,7 @@ open QuantumParallelRepetition.ClassicalInformation attribute [local instance] Classical.propDecidable /-- The finite encoding of exact prefix next. -/ -def exactPrefixNextCode +@[expose] def exactPrefixNextCode {Ω V : Type*} {h : ℕ} (default : V) (k : Fin h) : (Ω × (Fin h → V)) → ((Ω × (Fin h → V)) × V) := @@ -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 @@ -3216,7 +3217,7 @@ def exactForwardSeedLaw weight_sum := exactSeedWeight_sum nonempty /-- The finite probability law for exact reverse alice conditional seed. -/ -def exactReverseAliceConditionalSeedLaw +@[expose] def exactReverseAliceConditionalSeedLaw {M : Type*} [Fintype M] [DecidableEq M] (nonempty : 0 < Fintype.card M) (side : Finset M) : @@ -3230,7 +3231,7 @@ def exactReverseAliceConditionalSeedLaw else exactForwardSeedLaw nonempty /-- The finite probability law for exact reverse bob conditional seed. -/ -def exactReverseBobConditionalSeedLaw +@[expose] def exactReverseBobConditionalSeedLaw {M : Type*} [Fintype M] [DecidableEq M] (nonempty : 0 < Fintype.card M) (side : Finset M) : @@ -3279,7 +3280,7 @@ variable {X Y A B : Type*} variable [Fintype X] [Fintype Y] [Fintype A] [Fintype B] /-- The finite probability law for reweighted seed prior event. -/ -def reweightedSeedPriorEventLaw +@[expose] def reweightedSeedPriorEventLaw {K : Type*} [Fintype K] (seedLaw : FiniteEventLaw K) (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) : @@ -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)) @@ -3599,7 +3600,7 @@ def reweightedSeedPrefixJoint /-- The reweighted seed prefix prior construction used in the quantum parallel-repetition argument. -/ -def reweightedSeedPrefixPrior +@[expose] def reweightedSeedPrefixPrior {K Ω V : Type*} [Fintype K] {h : ℕ} (seedLaw : FiniteEventLaw K) (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) @@ -4097,7 +4098,7 @@ open QuantumParallelRepetition.ClassicalInformation attribute [local instance] Classical.propDecidable /-- The finite encoding of exact reverse alice marker. -/ -def exactReverseAliceMarkerCode +@[expose] def exactReverseAliceMarkerCode {M : Type*} [Fintype M] [DecidableEq M] (seed : ExactForwardSeed M) : Σ side : Finset M, @@ -4109,7 +4110,7 @@ def exactReverseAliceMarkerCode exactReverseLeftSide_coordinate_mem seed⟩⟩ /-- The finite encoding of exact reverse bob marker. -/ -def exactReverseBobMarkerCode +@[expose] def exactReverseBobMarkerCode {M : Type*} [Fintype M] [DecidableEq M] (seed : ExactForwardSeed M) : Σ side : Finset M, @@ -5534,7 +5535,7 @@ open QuantumParallelRepetition.ClassicalInformation attribute [local instance] Classical.propDecidable /-- The finite equivalence encoding exact reverse alice weighted marker. -/ -def exactReverseAliceWeightedMarkerEquiv +@[expose] def exactReverseAliceWeightedMarkerEquiv {M : Type*} [Fintype M] [DecidableEq M] : ExactForwardSeed M ≃ (Σ side : Finset M, @@ -5555,7 +5556,7 @@ def exactReverseAliceWeightedMarkerEquiv side context position /-- The finite equivalence encoding exact reverse bob weighted marker. -/ -def exactReverseBobWeightedMarkerEquiv +@[expose] def exactReverseBobWeightedMarkerEquiv {M : Type*} [Fintype M] [DecidableEq M] : ExactForwardSeed M ≃ (Σ side : Finset M, @@ -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, @@ -7438,7 +7439,7 @@ private theorem exactFairGammaPsiDistance_mul_postselection_le · simp only [accepted, ↓reduceIte, sum_const_zero, mul_zero] /-- The numerical bound for exact fair operator entropy. -/ -def ExactFairOperatorEntropyBound +@[expose] def ExactFairOperatorEntropyBound (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (η : ℝ) : Prop := exactFairAcceptedAliceEntropy G n S D ≤ diff --git a/LeanPool/QuantumParallelRepetition/Part06.lean b/LeanPool/QuantumParallelRepetition/Part06.lean index 4d14f94cc5..a71808ad62 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) @@ -6214,7 +6214,7 @@ def dSVDensityRationalHeterogeneousActualPhysicalFlagMass (⟨flagAlice, alice⟩, ⟨flagBob, bob⟩)‖ ^ 2 /-- The total probability mass of DSV density rational heterogeneous actual asynchronous flag. -/ -def dSVDensityRationalHeterogeneousActualAsynchronousFlagMass +@[expose] def dSVDensityRationalHeterogeneousActualAsynchronousFlagMass (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 @@ -6807,7 +6807,7 @@ theorem dSVDensityRationalPublicLogPhasePhysicalAlignedLocalAction_apply The DSV density rational heterogeneous target first spectral alice construction used in the quantum parallel-repetition argument. -/ -def dSVDensityRationalHeterogeneousTargetFirstSpectralAlice +@[expose] def dSVDensityRationalHeterogeneousTargetFirstSpectralAlice (S B N d L m : ℕ) (width : Fin S → ℝ) (schedule : Fin L → Fin S) (ξ : BipartiteUnitVector d) : @@ -6827,7 +6827,7 @@ def dSVDensityRationalHeterogeneousTargetFirstSpectralAlice The DSV density rational heterogeneous target first spectral bob construction used in the quantum parallel-repetition argument. -/ -def dSVDensityRationalHeterogeneousTargetFirstSpectralBob +@[expose] def dSVDensityRationalHeterogeneousTargetFirstSpectralBob (S B N d L m : ℕ) (width : Fin S → ℝ) (schedule : Fin L → Fin S) (ζ : BipartiteUnitVector d) : @@ -6844,7 +6844,7 @@ def dSVDensityRationalHeterogeneousTargetFirstSpectralBob N width schedule ζ)) /-- The source object for DSV density rational heterogeneous target first spectral physical. -/ -def dSVDensityRationalHeterogeneousTargetFirstSpectralPhysicalSource +@[expose] def dSVDensityRationalHeterogeneousTargetFirstSpectralPhysicalSource (S B N d L m : ℕ) (width : Fin S → ℝ) (schedule : Fin L → Fin S) (ξ ζ : BipartiteUnitVector d) : @@ -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..71d1eafafc 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 ℂ @@ -921,7 +921,7 @@ def dSVDensityRationalPublicBucketPhysicalCoherentMixedState w N ξ ζ i j)) /-- The quantum state representing DSV density rational public bucket physical coherent target. -/ -def dSVDensityRationalPublicBucketPhysicalCoherentTargetState +@[expose] def dSVDensityRationalPublicBucketPhysicalCoherentTargetState {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 → @@ -2887,7 +2887,7 @@ def exactLocallySampleableJARounded The exact locally sampleable jb rounded construction used in the quantum parallel-repetition argument. -/ -def exactLocallySampleableJBRounded +@[expose] def exactLocallySampleableJBRounded (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 → ℕ) @@ -3341,7 +3341,7 @@ def exactSourceBobPermutationHistory The exact source permutation matched construction used in the quantum parallel-repetition argument. -/ -def exactSourcePermutationMatched +@[expose] def exactSourcePermutationMatched {n : ℕ} (D : Finset (Fin n)) (denominator : ℕ) (numerator : ExactLocalSamplerIndex X Y D → ExactHistoryFlag X Y A B D → ℕ) @@ -4937,7 +4937,7 @@ variable {X Y A B : Type*} variable [Fintype X] [Fintype Y] [Fintype A] [Fintype B] /-- The information increment contributed by exact conditioned reverse alice prefix entropy. -/ -def exactConditionedReverseAlicePrefixEntropyIncrement +@[expose] def exactConditionedReverseAlicePrefixEntropyIncrement (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (remaining : 0 < (Finset.univ \ D).card) @@ -4952,7 +4952,7 @@ def exactConditionedReverseAlicePrefixEntropyIncrement default k /-- The information increment contributed by exact conditioned reverse bob prefix entropy. -/ -def exactConditionedReverseBobPrefixEntropyIncrement +@[expose] def exactConditionedReverseBobPrefixEntropyIncrement (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (remaining : 0 < (Finset.univ \ D).card) @@ -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) @@ -5680,7 +5680,7 @@ abbrev ExactReverseBobNextContext The exact conditioned reverse alice next joint construction used in the quantum parallel- repetition argument. -/ -def exactConditionedReverseAliceNextJoint +@[expose] def exactConditionedReverseAliceNextJoint (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) @@ -5714,7 +5714,7 @@ def exactConditionedReverseAliceNextPrior The exact conditioned reverse bob next joint construction used in the quantum parallel- repetition argument. -/ -def exactConditionedReverseBobNextJoint +@[expose] def exactConditionedReverseBobNextJoint (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (remaining : 0 < (Finset.univ \ D).card) @@ -5731,7 +5731,7 @@ def exactConditionedReverseBobNextJoint The exact conditioned reverse bob next prior construction used in the quantum parallel- repetition argument. -/ -def exactConditionedReverseBobNextPrior +@[expose] def exactConditionedReverseBobNextPrior (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..9f43c3013e 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 @@ -2284,7 +2284,7 @@ def exactSourceGlobalBobPOVM actual /-- The positive operator-valued measurement implementing exact source global catalyst alice. -/ -def exactSourceGlobalCatalystAlicePOVM +@[expose] def exactSourceGlobalCatalystAlicePOVM [DecidableEq A] (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (e : ℕ) (a₀ : A) (x : X) : @@ -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) : @@ -6826,7 +6826,7 @@ variable [Fintype X] [Fintype Y] [Fintype A] [Fintype B] The exact source support preserving classical sampler construction used in the quantum parallel- repetition argument. -/ -def ExactSourceSupportPreservingClassicalSampler +@[expose] def ExactSourceSupportPreservingClassicalSampler (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (base : ExactHistoryFlag X Y A B D) diff --git a/LeanPool/QuantumParallelRepetition/Part09.lean b/LeanPool/QuantumParallelRepetition/Part09.lean index db15a7af95..7cbea09bbe 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 @@ -93,7 +93,7 @@ variable {X Y A B : Type*} variable [Fintype X] [Fintype Y] [Fintype A] [Fintype B] /-- The one-coordinate strategy and error data extracted from an exact source. -/ -def ExactSourceOneGameRounding +@[expose] def ExactSourceOneGameRounding (G : Game X Y A B) : Prop := ∃ K₀ : ℝ, 0 ≤ K₀ ∧ ∀ (n : ℕ) (S : Strategy (G.repeat n)) @@ -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 @@ -885,7 +886,7 @@ abbrev UnconditionalSelectedCopyLocalIndex Σ _ : Fin B × Fin d, Fin (N * m) /-- The selected mixed stage after applying its coherent local bucket resets. -/ -def unconditionalSelectedCopyCleanedStage +@[expose] def unconditionalSelectedCopyCleanedStage {d N B m : ℕ} (Q : ℕ) (w : ℝ) (ξ ζ : BipartiteUnitVector d) @@ -2012,7 +2013,7 @@ open WithLp open scoped BigOperators Kronecker ComplexOrder MatrixOrder /-- The unitary operator implementing unconditional mixed conjugate selected branch. -/ -def unconditionalMixedConjugateSelectedBranchUnitary +@[expose] def unconditionalMixedConjugateSelectedBranchUnitary {ι τ : Type*} [Fintype ι] [DecidableEq ι] [Fintype τ] [DecidableEq τ] (U V : Matrix.unitaryGroup ι ℂ) : @@ -2027,7 +2028,7 @@ def unconditionalMixedConjugateSelectedBranchUnitary (Matrix.unitaryGroup τ ℂ).one_mem /-- The operator action for unconditional mixed conjugate selected branch local. -/ -def unconditionalMixedConjugateSelectedBranchLocalAction +@[expose] def unconditionalMixedConjugateSelectedBranchLocalAction {ι τ : Type*} [Fintype ι] [DecidableEq ι] [Fintype τ] [DecidableEq τ] (U V : Matrix.unitaryGroup ι ℂ) @@ -2168,7 +2169,7 @@ def actualStoppingBranchVector toLp 2 fun q => z (⟨r, q.1⟩, ⟨s, q.2⟩) /-- The measurement effect for actual stopping branch winning. -/ -def actualStoppingBranchWinningEffect +@[expose] def actualStoppingBranchWinningEffect (G : Game X Y A B) (PA : (r : R) → X → POVM A (ι r)) (PB : (s : R) → Y → POVM B (κ s)) @@ -3664,7 +3665,7 @@ private theorem unconditionalSourcePhysicalCleanedSelectedHistoryEquiv_hit rfl /-- Group the selected pair together and retain the bilateral prefix and tail indices. -/ -def unconditionalSourcePhysicalCleanedFullBilateralRegroup +@[expose] def unconditionalSourcePhysicalCleanedFullBilateralRegroup {R : Type*} {B N d L m : ℕ} (j : Fin L) : ((UnconditionalSelectedCopyLocalIndex B d N m × ((Fin j.val → DSVUniformDensityThresholdLocalIndex N d) × @@ -3706,7 +3707,7 @@ def unconditionalSourcePhysicalCleanedFullBilateralRegroup simp only [Prod.mk.eta] /-- The linear isometry implementing unconditional source physical cleaned full bilateral state. -/ -def unconditionalSourcePhysicalCleanedFullBilateralStateIsometry +@[expose] def unconditionalSourcePhysicalCleanedFullBilateralStateIsometry {P R : Type*} [Fintype P] [Fintype R] {B N d L m : ℕ} (phaseSplit : P ≃ Fin B × R) (j : Fin L) : @@ -4445,7 +4446,7 @@ def directDSVActualReindexedRetainedPOVM simp only [kroneckerMap_apply, Matrix.one_apply, mul_ite, mul_one, mul_zero] /-- The finite equivalence encoding direct DSV actual bilateral retained index. -/ -def directDSVActualBilateralRetainedIndexEquiv +@[expose] def directDSVActualBilateralRetainedIndexEquiv {s t u v ι κ : Type*} (eA : ι ≃ s × t) (eB : κ ≃ u × v) : (ι × κ) ≃ ((s × u) × (t × v)) := @@ -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] @@ -4707,7 +4708,7 @@ open scoped BigOperators Kronecker ComplexOrder MatrixOrder attribute [local instance] Classical.propDecidable /-- The finite equivalence encoding unconditional actual fixed source retained history pair. -/ -def unconditionalActualFixedSourceRetainedHistoryPairEquiv +@[expose] def unconditionalActualFixedSourceRetainedHistoryPairEquiv {N d L : ℕ} {R : Type} (j : Fin L) : (UnconditionalActualCleanedSelectedRetainedIndex (N := N) (d := d) j R × @@ -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 ≃ @@ -4998,7 +5000,7 @@ def physical8OneScaleActualGlobalFiberEquiv (N := N) (d := d) j R))) /-- The positive operator-valued measurement implementing physical 8 one scale original flag. -/ -def physical8OneScaleOriginalFlagPOVM +@[expose] def physical8OneScaleOriginalFlagPOVM {C Z : Type*} [Fintype C] [DecidableEq C] {P N d L m : ℕ} {R : Type} [Fintype R] @@ -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) @@ -6500,7 +6502,7 @@ def integratorActualC485SourceBobPOVM (exactSourceGlobalCatalystBobPOVM G n S D 1 b₀ y)) /-- The positive operator-valued measurement implementing integrator actual c 485 selected alice. -/ -def integratorActualC485SelectedAlicePOVM +@[expose] def integratorActualC485SelectedAlicePOVM {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)) @@ -6518,7 +6520,7 @@ def integratorActualC485SelectedAlicePOVM (integratorActualC485SourceAlicePOVM G n S D a₀ x) /-- The positive operator-valued measurement implementing integrator actual c 485 selected bob. -/ -def integratorActualC485SelectedBobPOVM +@[expose] def integratorActualC485SelectedBobPOVM {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)) @@ -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] @@ -6803,13 +6806,16 @@ private theorem unconditionalActualFairSourceBaseSupportedBorn (exactGlobalHistoryFinPsi G n S D h.2.2.2 h.2.1 h.2.2.1))) := by exact unconditionalActualFairSourceEOneReindexedGlobalWinningBorn + (d := Fintype.card (ExactGlobalHistoryLocalIndex G n S D)) (unconditionalConjugateSourceGlobalCatalystWinningEffect G n S D 1 a₀ b₀ h.2.1 h.2.2.1) (exactGlobalHistoryFinPsi G n S D h.2.2.2 h.2.1 h.2.2.1) - _ = _ := - unconditionalConjugateSourceGlobalCatalystWinningEffect_law_supported - G n S D positive 1 (by norm_num) a₀ b₀ h supported + _ = _ := by + have hSupported := + unconditionalConjugateSourceGlobalCatalystWinningEffect_law_supported + G n S D positive 1 (by decide) a₀ b₀ h supported + exact hSupported private def unconditionalActualFairSourcePhaseHarmonicWork (P k : ℕ) : diff --git a/LeanPool/QuantumParallelRepetition/Part10.lean b/LeanPool/QuantumParallelRepetition/Part10.lean index 9843fd4a18..3876fc4b36 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 @@ -356,7 +356,7 @@ theorem unconditionalActualC485RetainedPureWorkReindexBorn whole (winning ⊗ₖ (1 : Matrix v v ℂ)) z /-- The finite equivalence encoding unconditional actual c 485 retained history pair. -/ -def unconditionalActualC485RetainedHistoryPairEquiv +@[expose] def unconditionalActualC485RetainedHistoryPairEquiv {P N d L : ℕ} (j : Fin L) : (UnconditionalSourceFlagControlledRetainedIndex (N := N) (d := d) j @@ -1257,7 +1257,7 @@ theorem unconditionalActualFairSourceVerifier_historyBorn_bounded The unconditional actual c 485 fair source diagonal work construction used in the quantum parallel-repetition argument. -/ -def unconditionalActualC485FairSourceDiagonalWork +@[expose] def unconditionalActualC485FairSourceDiagonalWork {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)) @@ -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..fa8ea243e6 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 κ] @@ -889,7 +889,7 @@ private theorem unconditionalActualC485CompleteDecodedScalarBorn x y z source cleaned source_eq decoded /-- The Born-rule weight for unconditional actual fair source history stop. -/ -def unconditionalActualFairSourceHistoryStopBorn +@[expose] def unconditionalActualFairSourceHistoryStopBorn {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)) @@ -914,7 +914,7 @@ def unconditionalActualFairSourceHistoryStopBorn UA UB j) /-- The Born-rule weight for unconditional actual fair source physical stop. -/ -def unconditionalActualFairSourcePhysicalStopBorn +@[expose] def unconditionalActualFairSourcePhysicalStopBorn {X Y A B : Type} [Fintype X] [Fintype Y] [Fintype A] [Fintype B] [DecidableEq A] [DecidableEq B] 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/QuantumQuery/Adversary.lean b/LeanPool/QuantumQuery/Adversary.lean index 5a3cf489d2..ade90060b6 100644 --- a/LeanPool/QuantumQuery/Adversary.lean +++ b/LeanPool/QuantumQuery/Adversary.lean @@ -16,7 +16,7 @@ Ported from the corresponding upstream modules listed by the source sections bel References beginning with `Source` name these retained sections. -/ -@[expose] public section +public section section SourceDefs @@ -58,6 +58,7 @@ variable {O : Type*} /-- The difference matrix `D_i` (HLŠ §2, BL Definition 6): `(advD i) x y = 1` if `x i ≠ y i` and `0` otherwise. -/ +@[expose] def advD (i : ι) : Matrix (ι → σ) (ι → σ) ℝ := Matrix.of fun x y => if x i = y i then 0 else 1 @@ -81,6 +82,7 @@ lemma hadamard_advD_apply (Γ : Matrix (ι → σ) (ι → σ) ℝ) (i : ι) /-- An adversary matrix for `f` (HLŠ §2): a real symmetric matrix supported on pairs of inputs with different `f`-values. Taking `x = y` shows the diagonal vanishes. -/ +@[expose] def IsAdvMatrix (f : (ι → σ) → O) (Γ : Matrix (ι → σ) (ι → σ) ℝ) : Prop := Γ.IsHermitian ∧ ∀ x y, f x = f y → Γ x y = 0 @@ -113,6 +115,7 @@ lemma isAdvMatrix_zero (f : (ι → σ) → O) : IsAdvMatrix f 0 := /-- The negative-weight adversary bound `ADV±(f)` (HLŠ Definition 2, in the division-free form of BL Definition 6). -/ +@[expose] noncomputable def advPM (f : (ι → σ) → O) : ℝ := sSup {r : ℝ | ∃ Γ, IsAdvMatrix f Γ ∧ (∀ i, ‖Γ ⊙ advD i‖ ≤ 1) ∧ r = ‖Γ‖} @@ -892,6 +895,7 @@ open Matrix variable {U : Type*} [Fintype U] /-- Restriction of a vector to a color class of the coloring `χ`. -/ +@[expose] def brestrict (χ : U → Bool) (b : Bool) (w : U → ℝ) : U → ℝ := fun u => if χ u = b then w u else 0 @@ -1198,9 +1202,11 @@ variable {α Y Z : Type*} [Fintype α] [DecidableEq α] variable [Fintype Y] [DecidableEq Y] [Fintype Z] [DecidableEq Z] /-- The `i`-th block of a composed input. -/ +@[expose] def sliceE (e : Z ≃ (α → Y)) (z : Z) (i : α) : Y := e z i /-- The vector of inner-function values of a composed input. -/ +@[expose] def tildeE (e : Z ≃ (α → Y)) (g : α → Y → Bool) (z : Z) : α → Bool := fun i => g i (sliceE e z i) @@ -1213,6 +1219,7 @@ omit [DecidableEq Y] [DecidableEq Z] [DecidableEq α] [Fintype Y] [Fintype Z] [F (i : α) : tildeE e g z i = g i (sliceE e z i) := rfl /-- BL Definition 19 over an abstract block decomposition. -/ +@[expose] noncomputable def composeE (e : Z ≃ (α → Y)) (g : α → Y → Bool) (Γf : Matrix (α → Bool) (α → Bool) ℝ) (M : α → Matrix Y Y ℝ) : Matrix Z Z ℝ := @@ -1249,13 +1256,16 @@ currying equivalence. -/ variable {α β : Type*} [Fintype α] [DecidableEq α] [Fintype β] [DecidableEq β] /-- The block decomposition of a Boolean cube into `α` blocks of shape `β`. -/ +@[expose] def cubeBlocks (α β : Type*) : ((α × β) → Bool) ≃ (α → (β → Bool)) := Equiv.curry α β Bool /-- The `i`-th block of a composed input. -/ +@[expose] def slice (x : (α × β) → Bool) (i : α) : β → Bool := sliceE (cubeBlocks α β) x i /-- The vector of inner-function values of a composed input. -/ +@[expose] def tilde (g : α → (β → Bool) → Bool) (x : (α × β) → Bool) : α → Bool := tildeE (cubeBlocks α β) g x @@ -1271,6 +1281,7 @@ omit [DecidableEq α] [DecidableEq β] [Fintype α] [Fintype β] in (i : α) : tilde g x i = g i (slice x i) := rfl /-- BL Definition 19, uniform-alphabet form: the composed matrix. -/ +@[expose] noncomputable def compose (g : α → (β → Bool) → Bool) (Γf : Matrix (α → Bool) (α → Bool) ℝ) (M : α → Matrix (β → Bool) (β → Bool) ℝ) : @@ -1866,6 +1877,7 @@ lemma posSemidef_prod_eval {F : α → Matrix Bool Bool ℝ} /-- The outer auxiliary matrix of HLŠ Lemma 16 (denoted `A_c` there, with `lamv i` the eigenvalue selected in slot `i`). -/ +@[expose] noncomputable def Emat (R lamv : α → ℝ) : Matrix (α → Bool) (α → Bool) ℝ := Matrix.of fun a b => ∏ i, if a i = b i then R i else lamv i @@ -2002,6 +2014,7 @@ variable {O : Type*} /-- The difference matrix of a promise domain: `1` exactly when a query at `i` distinguishes the two promise inputs. -/ +@[expose] def advDOn (read : X → ι → σ) (i : ι) : Matrix X X ℝ := Matrix.of fun x y => if read x i = read y i then 0 else 1 @@ -2025,6 +2038,7 @@ lemma hadamard_advDOn_apply (read : X → ι → σ) (Γ : Matrix X X ℝ) (i : by_cases h : read x i = read y i <;> simp [h] /-- An adversary matrix on a promise domain. -/ +@[expose] def IsAdvMatrixOn (f : X → O) (Γ : Matrix X X ℝ) : Prop := Γ.IsHermitian ∧ ∀ x y, f x = f y → Γ x y = 0 @@ -2033,6 +2047,7 @@ lemma isAdvMatrixOn_zero (f : X → O) : IsAdvMatrixOn f (0 : Matrix X X ℝ) := ⟨Matrix.isHermitian_zero, fun _ _ _ => rfl⟩ /-- **The adversary bound of a function on a promise domain.** -/ +@[expose] noncomputable def advPMOn (read : X → ι → σ) (f : X → O) : ℝ := sSup {r : ℝ | ∃ Γ, IsAdvMatrixOn f Γ ∧ (∀ i, ‖Γ ⊙ advDOn read i‖ ≤ 1) ∧ r = ‖Γ‖} @@ -2076,6 +2091,7 @@ namespace DualPairOn variable {K : Type*} [Fintype K] {read : X → ι → σ} {f : X → O} /-- The cost of a dual solution on a promise domain. -/ +@[expose] def IsCostLe (P : DualPairOn read K f) (c : ℝ) : Prop := (∀ x, ∑ i, ∑ k, P.u x i k * P.u x i k ≤ c) ∧ (∀ x, ∑ i, ∑ k, P.v x i k * P.v x i k ≤ c) @@ -2205,6 +2221,7 @@ abbrev GramIdxOn (X ι : Type*) : Type _ := X × ι × Bool /-- The right-hand side of the dual feasibility constraint on the promise domain: `1` on pairs with distinct values, `0` otherwise. -/ +@[expose] def dualTargetOn (f : X → O) : Matrix X X ℝ := Matrix.of fun x y => if f x = f y then 0 else 1 @@ -2219,6 +2236,7 @@ lemma dualTargetOn_comm (f : X → O) (x y : X) : /-- The left-hand side of the dual feasibility constraint, as a function of the Gram matrix, with the mask read through `read`. -/ +@[expose] def gramROn (read : X → ι → σ) (G : Matrix (GramIdxOn X ι) (GramIdxOn X ι) ℝ) : Matrix X X ℝ := Matrix.of fun x y => @@ -2413,6 +2431,7 @@ abbrev GramIdx (ι σ : Type*) : Type _ := GramIdxOn (ι → σ) ι /-- The right-hand side of the dual feasibility constraint: `dualTarget g x y = 1` if `g x ≠ g y` and `0` otherwise. -/ +@[expose] def dualTarget (g : (ι → σ) → O) : Matrix (ι → σ) (ι → σ) ℝ := dualTargetOn g omit [DecidableEq ι] [DecidableEq σ] [Fintype ι] [Fintype σ] in @@ -2425,6 +2444,7 @@ lemma dualTarget_comm (g : (ι → σ) → O) (x y : ι → σ) : /-- The left-hand side of the dual feasibility constraint, as a function of the Gram matrix. -/ +@[expose] def gramR (G : Matrix (GramIdx ι σ) (GramIdx ι σ) ℝ) : Matrix (ι → σ) (ι → σ) ℝ := gramROn id G @@ -2436,6 +2456,7 @@ omit [DecidableEq ι] [Fintype σ] in /-- The dual objective, as a function of the Gram matrix: `gramCost G false x` is `∑ i, ‖u x i‖²` and `gramCost G true x` is `∑ i, ‖v x i‖²`. -/ +@[expose] def gramCost (G : Matrix (GramIdx ι σ) (GramIdx ι σ) ℝ) (b : Bool) (x : ι → σ) : ℝ := gramCostOn G b x @@ -2501,6 +2522,7 @@ variable {K : Type*} [Fintype K] {g : (ι → σ) → O} /-- The two vector families of a dual solution, packed into a single matrix whose rows are indexed by `GramIdx ι σ`. -/ +@[expose] def dualVec (P : DualPair K g) : Matrix (GramIdx ι σ) K ℝ := Matrix.of fun z k => if z.2.2 then P.v z.1 z.2.1 k else P.u z.1 z.2.1 k @@ -2606,6 +2628,7 @@ variable {σ : Type*} [DecidableEq σ] variable {O : Type*} [DecidableEq O] /-- Restricting a function to a block of coordinates. -/ +@[expose] def pullbackFun (e : κ → ι) (f : (κ → σ) → O) : (ι → σ) → O := fun x => f fun j => x (e j) @@ -2819,6 +2842,7 @@ end DualPair variable {σ' : Type*} [DecidableEq σ'] /-- Recoding the input alphabet along a map `m`. -/ +@[expose] def alphaFun (m : σ → σ') (f : (ι → σ') → O) : (ι → σ) → O := fun x => f fun i => m (x i) @@ -3085,6 +3109,7 @@ lemma sum_prod_sliceE (F : α → (Y) → ℝ) : (fun y => ∏ i, F i (sliceE e y i)) (fun p => ∏ i, F i (p i)) fun y => rfl /-- The tensor eigenvector of the composed matrix. -/ +@[expose] noncomputable def tensorVecE (g : α → (Y) → Bool) (v : α → (Y) → ℝ) (w : (α → Bool) → ℝ) : (Z) → ℝ := @@ -3218,6 +3243,7 @@ lemma sum_prod_slice (F : α → (β → Bool) → ℝ) : sum_prod_sliceE (cubeBlocks α β) F /-- The tensor eigenvector of the composed matrix. -/ +@[expose] noncomputable def tensorVec (g : α → (β → Bool) → Bool) (v : α → (β → Bool) → ℝ) (w : (α → Bool) → ℝ) : ((α × β) → Bool) → ℝ := @@ -3353,6 +3379,7 @@ each constraint, and an input with a side tag for each cost variable. -/ abbrev DualOmegaOn (X : Type*) : Type _ := (X × X) ⊕ (X × Bool) /-- The affine data of the promise dual program, read off a Gram matrix. -/ +@[expose] def gramLOn (read : X → ι → σ) (G : Matrix (GramIdxOn X ι) (GramIdxOn X ι) ℝ) : DualOmegaOn X → ℝ := Sum.elim (fun q => gramROn read G q.1 q.2) (fun q => gramCostOn G q.2 q.1) @@ -3368,6 +3395,7 @@ omit [DecidableEq X] [DecidableEq ι] [Fintype X] [Fintype σ] in gramLOn read G (Sum.inr (x, b)) = gramCostOn G b x := rfl /-- `gramLOn` as a linear map. -/ +@[expose] def gramLOnₗ (read : X → ι → σ) : Matrix (GramIdxOn X ι) (GramIdxOn X ι) ℝ →ₗ[ℝ] (DualOmegaOn X → ℝ) where toFun := gramLOn read @@ -3615,6 +3643,7 @@ variable. -/ abbrev DualOmega (ι σ : Type*) : Type _ := DualOmegaOn (ι → σ) /-- The affine data of the dual program, read off a Gram matrix. -/ +@[expose] def gramL (G : Matrix (GramIdx ι σ) (GramIdx ι σ) ℝ) : DualOmega ι σ → ℝ := gramLOn id G omit [DecidableEq ι] [Fintype σ] in @@ -3626,6 +3655,7 @@ omit [DecidableEq ι] [Fintype σ] in (x : ι → σ) (b : Bool) : gramL G (Sum.inr (x, b)) = gramCost G b x := rfl /-- `gramL` as a linear map. -/ +@[expose] def gramLₗ : Matrix (GramIdx ι σ) (GramIdx ι σ) ℝ →ₗ[ℝ] (DualOmega ι σ → ℝ) := gramLOnₗ id omit [DecidableEq ι] [Fintype σ] in @@ -5610,6 +5640,7 @@ theorem advPM_mul_le_advPM_composeFun (f : (α → Bool) → Bool) /-! ## The iterated corollary -/ /-- Index types for iterated composition: `α`, `α × α`, `α × (α × α)`, … -/ +@[expose] def iterIdx (α : Type*) : ℕ → Type _ | 0 => α | d + 1 => α × iterIdx α d @@ -5629,6 +5660,7 @@ instance iterIdx.decEq (α : Type*) [DecidableEq α] : inferInstanceAs (DecidableEq (α × iterIdx α d)) /-- Iterated composition `f^{∘(d+1)}`. -/ +@[expose] def iterFun (f : (α → Bool) → Bool) : (d : ℕ) → ((iterIdx α d → Bool) → Bool) | 0 => f | d + 1 => composeFun f (iterFun f d) @@ -6309,6 +6341,7 @@ theorem advDual_not (f : (ι → Bool) → Bool) : simpa using h /-- Negating every input bit. -/ +@[expose] def flipAll : (ι → Bool) ≃ (ι → Bool) where toFun x := fun i => !(x i) invFun x := fun i => !(x i) @@ -7050,9 +7083,11 @@ variable {ι : Type*} [Fintype ι] [DecidableEq ι] /-! ## The `n`-bit OR function -/ /-- The all-zero input. -/ +@[expose] def zeroVec : ι → Bool := fun _ => false /-- The input with a single `true` in position `i`. -/ +@[expose] def unitVec (i : ι) : ι → Bool := fun j => decide (j = i) /-- The `n`-bit OR function. -/ @@ -7916,6 +7951,7 @@ variable {K K' : Type*} [Fintype K] [Fintype K'] variable {h : (P → V) → O} {g : P → (ι → σ) → V} /-- **Shared-input dual composition.** -/ +@[expose] noncomputable def composeShared (Q : DualPair K h) (R : ∀ p, DualPair K' (g p)) : DualPair (P × K × K') (sharedFun h g) where u x i := fun c => Q.u (fun p => g p x) c.1 c.2.1 * (R c.1).u x i c.2.2 @@ -9703,6 +9739,7 @@ variable {O : Type} [DecidableEq O] /-! ## The two predicates -/ /-- `f` has a feasible dual solution of cost at most `c`. -/ +@[expose] def HasDual {ι : Type} [Fintype ι] {σ : Type} [DecidableEq σ] {O : Type} [DecidableEq O] (f : (ι → σ) → O) (c : ℝ) : Prop := ∃ (K : Type) (_ : Fintype K) (P : DualPair K f), P.IsCostLe c @@ -10291,6 +10328,7 @@ variable {K : Type} [Fintype K] {read : X → ι → σ} {f : X → O} {f' : X /-- **Output recoding.** A dual solution for `f` is a dual solution for any `f'` with the same kernel on the promise — same vectors, same cost. -/ +@[expose] def ofKer (P : DualPairOn read K f) (h : ∀ x y, f x = f y ↔ f' x = f' y) : DualPairOn read K f' where u := P.u @@ -10343,6 +10381,7 @@ end DualPairOn /-- `f` has a feasible dual solution of cost at most `c` on the promise domain `read`. -/ +@[expose] def HasDualOn {ι : Type} [Fintype ι] {σ : Type} [DecidableEq σ] {X : Type} [Fintype X] {O : Type} [DecidableEq O] (read : X → ι → σ) (f : X → O) (c : ℝ) : Prop := diff --git a/LeanPool/QuantumQuery/Algorithms.lean b/LeanPool/QuantumQuery/Algorithms.lean index 4d29abff6e..777987c44a 100644 --- a/LeanPool/QuantumQuery/Algorithms.lean +++ b/LeanPool/QuantumQuery/Algorithms.lean @@ -15,7 +15,7 @@ Ported from the corresponding upstream modules listed by the source sections bel References beginning with `Source` name these retained sections. -/ -@[expose] public section +public section section SourceQuantumFiniteHilbert @@ -73,18 +73,21 @@ variable {H : Type*} [Fintype H] [DecidableEq H] /-- The Hermitian inner product on `H → ℂ`, conjugate-linear in the **first** argument (the physicists' convention, and Mathlib's). -/ +@[expose] def qInner (ψ φ : H → ℂ) : ℂ := star ψ ⬝ᵥ φ omit [DecidableEq H] in lemma qInner_def (ψ φ : H → ℂ) : qInner ψ φ = ∑ h, star (ψ h) * φ h := rfl /-- The squared norm of a state, as a real number. -/ +@[expose] def qNormSq (ψ : H → ℂ) : ℝ := ∑ h, Complex.normSq (ψ h) omit [DecidableEq H] in lemma qNormSq_def (ψ : H → ℂ) : qNormSq ψ = ∑ h, Complex.normSq (ψ h) := rfl /-- A (pure) quantum state: a unit vector. -/ +@[expose] def IsQState (ψ : H → ℂ) : Prop := qNormSq ψ = 1 omit [DecidableEq H] in @@ -361,9 +364,11 @@ lemma qPerm_mul_self_of_involutive {e : Equiv.Perm H} (he : Function.Involutive /-! ## Projectors and reflections -/ /-- An orthogonal projector. -/ +@[expose] def IsQProjector (P : Matrix H H ℂ) : Prop := Pᴴ = P ∧ P * P = P /-- The reflection about the range of a projector, `2P - 1`. -/ +@[expose] def qRefl (P : Matrix H H ℂ) : Matrix H H ℂ := (2 : ℂ) • P - 1 lemma qRefl_conjTranspose {P : Matrix H H ℂ} (hP : IsQProjector P) : @@ -540,6 +545,7 @@ variable {O : Type} [Fintype O] [DecidableEq O] /-! ## The exponential-moment tail -/ /-- The number of coordinates at which the record `y` differs from `b`. -/ +@[expose] def wrongCount {k : ℕ} (y b : Fin k → O) : ℕ := (Finset.univ.filter (fun j => y j ≠ b j)).card @@ -833,10 +839,12 @@ variable {H : Type*} [Fintype H] [DecidableEq H] variable {O : Type*} [DecidableEq O] /-- The unnormalized part of `ψ` that announces the outcome `o`. -/ +@[expose] def qRestrict (p : H → O) (o : O) (ψ : H → ℂ) : H → ℂ := fun h => if p h = o then ψ h else 0 /-- **The probability that measuring `ψ` announces the outcome `o`.** -/ +@[expose] def qProb (p : H → O) (ψ : H → ℂ) (o : O) : ℝ := ∑ h, if p h = o then Complex.normSq (ψ h) else 0 @@ -1089,6 +1097,7 @@ variable {ι σ W : Type*} [Fintype ι] [DecidableEq ι] [Fintype σ] [Decidable [Fintype W] [DecidableEq W] /-- The oracle's action on the computational basis. -/ +@[expose] def oracleMap (a : ι → σ) : QBasis ι σ W → QBasis ι σ W | (none, t, w) => (none, t, w) | (some i, t, w) => (some i, Equiv.swap none (some (a i)) t, w) @@ -1138,6 +1147,7 @@ lemma oracleMap_involutive (a : ι → σ) : · simp /-- The oracle as a permutation of the basis. -/ +@[expose] def oraclePerm (a : ι → σ) : Equiv.Perm (QBasis ι σ W) := Function.Involutive.toPerm _ (oracleMap_involutive a) @@ -1150,6 +1160,7 @@ lemma oraclePerm_involutive (a : ι → σ) : Function.Involutive (oraclePerm (W := W) a) := oracleMap_involutive a /-- **The oracle unitary.** -/ +@[expose] def oracleMat (a : ι → σ) : Matrix (QBasis ι σ W) (QBasis ι σ W) ℂ := qPerm (oraclePerm a) @@ -1267,6 +1278,7 @@ structure QAlg (ι σ O W : Type) [Fintype ι] [DecidableEq ι] [Fintype σ] namespace QAlg /-- **The state of `A` on input `a` after `t` queries.** -/ +@[expose] def state (A : QAlg ι σ O W) (a : ι → σ) : ℕ → (QBasis ι σ W → ℂ) | 0 => A.step 0 *ᵥ A.init | t + 1 => A.step (t + 1) *ᵥ (oracleMat a *ᵥ A.state a t) @@ -1290,6 +1302,7 @@ theorem state_isQState (A : QAlg ι σ O W) (a : ι → σ) (t : ℕ) : variable [DecidableEq O] /-- The probability that `A`, run for `t` queries on input `a`, announces `o`. -/ +@[expose] def prob (A : QAlg ι σ O W) (a : ι → σ) (t : ℕ) (o : O) : ℝ := qProb A.readout (A.state a t) o @@ -1309,6 +1322,7 @@ variable [DecidableEq O] /-- **`A` computes `f` on the promise `read` with error at most `ε` in `q` queries.** -/ +@[expose] def ComputesWithErrorOn (A : QAlg ι σ O W) (q : ℕ) (read : X → ι → σ) (f : X → O) (ε : ℝ) : Prop := ∀ x : X, 1 - ε ≤ A.prob (read x) q (f x) @@ -1414,6 +1428,7 @@ lemma matrix_ext_of_mulVec_qBasis {H : Type} [Fintype H] [DecidableEq H] simpa [Matrix.mulVec, dotProduct, qBasis_apply, Finset.sum_ite_eq'] using hpq /-- The extended basis, split as (rest, extra register). -/ +@[expose] def regEquiv : QBasis ι σ (V × W) ≃ QBasis ι σ W × V where toFun p := ((p.1, p.2.1, p.2.2.2), p.2.2.1) invFun x := (x.1.1, x.1.2.1, (x.2, x.1.2.2)) @@ -1485,6 +1500,7 @@ lemma liftReg_mem_unitaryGroup {U : Matrix (QBasis ι σ W) (QBasis ι σ W) ℂ /-- **The encoded subspace**: `ψ`, placed in the sector where the extra register holds `v`. -/ +@[expose] def embedReg (v : V) (ψ : QBasis ι σ W → ℂ) : QBasis ι σ (V × W) → ℂ := fun p => if p.2.2.1 = v then ψ (p.1, p.2.1, p.2.2.2) else 0 @@ -1794,11 +1810,13 @@ variable {X : Type} [Fintype X] /-- The set of query counts at which `f` is computable with error `≤ ε`. The workspace is existentially quantified here — this is the one place where that costs anything, and it keeps `QAlg` free of a bundled type field. -/ +@[expose] def QueryCounts (read : X → ι → σ) (f : X → O) (ε : ℝ) : Set ℕ := {q | ∃ (W : Type) (_ : Fintype W) (_ : DecidableEq W) (A : QAlg ι σ O W), ComputesWithErrorOn A q read f ε} /-- **Bounded-error quantum query complexity on a promise.** -/ +@[expose] noncomputable def qQueryOn (read : X → ι → σ) (f : X → O) (ε : ℝ) : ℕ := sInf (QueryCounts read f ε) @@ -2004,6 +2022,7 @@ variable (Q : Matrix (QBasis ι σ W) (QBasis ι σ W) ℂ) /-- The operator implemented by the first `t` queries of `R`, with the opaque oracle matrix `Q` in place of the transposition oracle. -/ +@[expose] def runWith (R : QRoutine ι σ W) : ℕ → Matrix (QBasis ι σ W) (QBasis ι σ W) ℂ | 0 => R.step 0 | t + 1 => R.step (t + 1) * (Q * R.runWith t) @@ -2032,6 +2051,7 @@ lemma runWith_congr {R S : QRoutine ι σ W} {t : ℕ} end GeneralOracle /-- The operator implemented by the first `t` queries of `R`. -/ +@[expose] def runUpto (R : QRoutine ι σ W) (a : ι → σ) : ℕ → Matrix (QBasis ι σ W) (QBasis ι σ W) ℂ := R.runWith (oracleMat a) @@ -2043,6 +2063,7 @@ def runUpto (R : QRoutine ι σ W) (a : ι → σ) : R.runUpto a (t + 1) = R.step (t + 1) * (oracleMat a * R.runUpto a t) := rfl /-- **The operator implemented by `R`**, using exactly `R.len` queries. -/ +@[expose] def run (R : QRoutine ι σ W) (a : ι → σ) : Matrix (QBasis ι σ W) (QBasis ι σ W) ℂ := R.runUpto a R.len @@ -2062,6 +2083,7 @@ lemma runUpto_congr {R S : QRoutine ι σ W} (a : ι → σ) {t : ℕ} /-- Turn a routine into an algorithm by supplying an initial state and a readout. -/ +@[expose] def toAlg (R : QRoutine ι σ W) (init : QBasis ι σ W → ℂ) (hinit : IsQState init) (readout : QBasis ι σ W → O) : QAlg ι σ O W where init := init @@ -2091,6 +2113,7 @@ lemma toAlg_state_len (R : QRoutine ι σ W) (init : QBasis ι σ W → ℂ) /-- **Sequencing**: run `R`, then `S`. The two boundary unitaries are merged, so the query count is exactly `R.len + S.len`. -/ +@[expose] def comp (R S : QRoutine ι σ W) : QRoutine ι σ W where len := R.len + S.len step := fun t => @@ -2211,6 +2234,7 @@ identity. Padding by *one* is a different matter — it needs somewhere to park the query index so that the extra query idles — and lives in `SourceQuantumControl`. -/ /-- Append two queries that cancel. -/ +@[expose] def padTwo (R : QRoutine ι σ W) : QRoutine ι σ W where len := R.len + 2 step := fun t => if t ≤ R.len then R.step t else 1 @@ -2322,6 +2346,7 @@ theorem exists_inv (R : QRoutine ι σ W) : /-! ## Zero-query constructors, and an explicit inverse -/ /-- A zero-query routine: just a unitary. -/ +@[expose] def ofUnitary (U : Matrix (QBasis ι σ W) (QBasis ι σ W) ℂ) (hU : U ∈ Matrix.unitaryGroup (QBasis ι σ W) ℂ) : QRoutine ι σ W where len := 0 @@ -2341,6 +2366,7 @@ lemma ofUnitary_runWith (Q : Matrix (QBasis ι σ W) (QBasis ι σ W) ℂ) (ofUnitary U hU).runWith Q 0 = U := rfl /-- The zero-query identity routine. -/ +@[expose] def identity : QRoutine ι σ W := ofUnitary 1 one_mem_qUnitary @[simp] lemma identity_len : (identity : QRoutine ι σ W).len = 0 := rfl @@ -2349,6 +2375,7 @@ def identity : QRoutine ι σ W := ofUnitary 1 one_mem_qUnitary (identity : QRoutine ι σ W).run a = 1 := rfl /-- **The one-query routine**: a single bare oracle call. -/ +@[expose] def query : QRoutine ι σ W where len := 1 step := fun _ => 1 @@ -2504,6 +2531,7 @@ instance instCtrlWorkFintype {ι W : Type} [Fintype ι] [Fintype W] : /-- Swap the query-index register with the parking slot, unless the control bit says otherwise. -/ +@[expose] def parkMap : QBasis ι σ (CtrlWork ι W) → QBasis ι σ (CtrlWork ι W) | (k, t, (true, s, w)) => (k, t, (true, s, w)) | (k, t, (false, s, w)) => (s, t, (false, k, w)) @@ -2546,6 +2574,7 @@ lemma parkMat_mulVec_apply (ψ : QBasis ι σ (CtrlWork ι W) → ℂ) /-- **The controlled query**: park, query, unpark. Note the single `oracleMat` factor — this costs exactly one physical query. -/ +@[expose] def ctrlQuery (a : ι → σ) : Matrix (QBasis ι σ (CtrlWork ι W)) (QBasis ι σ (CtrlWork ι W)) ℂ := parkMat * (oracleMat a * parkMat) @@ -2556,6 +2585,7 @@ lemma ctrlQuery_mem_unitaryGroup (a : ι → σ) : (mul_mem (oracleMat_mem_unitaryGroup a) parkMat_mem_unitaryGroup) /-- The basis action of the controlled query. -/ +@[expose] def ctrlMap (a : ι → σ) : QBasis ι σ (CtrlWork ι W) → QBasis ι σ (CtrlWork ι W) := fun p => parkMap (oracleMap a (parkMap p)) @@ -2657,6 +2687,7 @@ theorem ctrlQuery_mulVec_of_parked (a : ι → σ) /-! ## Idling and padding by one -/ /-- The controlled query as a **one-query routine**. -/ +@[expose] def ctrlQueryRoutine : QRoutine ι σ (CtrlWork ι W) where len := 1 step := fun _ => parkMat @@ -2669,6 +2700,7 @@ lemma ctrlQueryRoutine_run (a : ι → σ) : (ctrlQueryRoutine (ι := ι) (σ := σ) (W := W)).run a = ctrlQuery a := rfl /-- **Padding by one query.** -/ +@[expose] def padOne (R : QRoutine ι σ (CtrlWork ι W)) : QRoutine ι σ (CtrlWork ι W) := R.comp ctrlQueryRoutine @@ -2699,6 +2731,7 @@ it. -/ /-- The blank-slot embedding: `ψ` in the sector with control bit `b` and an empty parking slot. -/ +@[expose] def embedCtrl (b : Bool) (ψ : QBasis ι σ W → ℂ) : QBasis ι σ (CtrlWork ι W) → ℂ := embedReg b (embedReg none ψ) @@ -2876,6 +2909,7 @@ variable {β γ δ : Type} [Fintype β] [DecidableEq β] [Fintype γ] [Decidable [Fintype δ] [DecidableEq δ] /-- `M ⊗ 1`, read through the factorizing equivalence `e`. -/ +@[expose] def kronLift (e : β ≃ γ × δ) (M : Matrix γ γ ℂ) : Matrix β β ℂ := (Matrix.kroneckerMap (· * ·) M (1 : Matrix δ δ ℂ)).submatrix e e @@ -2910,6 +2944,7 @@ lemma kronLift_mem_unitaryGroup (e : β ≃ γ × δ) {M : Matrix γ γ ℂ} /-- A state of split form: `φ` on the system factor, `ξ` on the environment. -/ +@[expose] def splitVec (e : β ≃ γ × δ) (φ : γ → ℂ) (ξ : δ → ℂ) : β → ℂ := fun b => φ (e b).1 * ξ (e b).2 @@ -2991,6 +3026,7 @@ lemma oracleMat_mulVec_splitVec {e : QBasis ι σ W' ≃ QBasis ι σ W × D} oracleMat_mulVec_apply] /-- A routine's steps, lifted along `e`. -/ +@[expose] def QRoutine.kronLift (e : QBasis ι σ W' ≃ QBasis ι σ W × D) (R : QRoutine ι σ W) : QRoutine ι σ W' where len := R.len @@ -3066,6 +3102,7 @@ lemma qProb_comp_ge {H O O' : Type} [Fintype H] /-- **Relabelling the readout**: same initial state, same steps, composed output map. -/ +@[expose] def QAlg.postcomp {O O' W : Type} [Fintype W] [DecidableEq W] (A : QAlg ι σ O W) (g : O → O') : QAlg ι σ O' W := { A with readout := fun p => g (A.readout p) } @@ -3184,6 +3221,7 @@ section IdxSwap variable {W : Type} [Fintype W] [DecidableEq W] /-- Transpose two values of the query-index register. -/ +@[expose] def idxSwapMap (u v : Option ι) : QBasis ι σ W → QBasis ι σ W := fun p => (Equiv.swap u v p.1, p.2) @@ -3194,6 +3232,7 @@ lemma idxSwapMap_involutive (u v : Option ι) : simp [idxSwapMap] /-- The index-register transposition, as a permutation of the basis. -/ +@[expose] def idxSwapPerm (u v : Option ι) : Equiv.Perm (QBasis ι σ W) := Function.Involutive.toPerm _ (idxSwapMap_involutive u v) @@ -3207,6 +3246,7 @@ end IdxSwap abbrev QRec (ι σ : Type) : Type := ι → Option σ /-- Swap the answer register with the workspace slot `j`. -/ +@[expose] def slotSwapMap (j : ι) : QBasis ι σ (QRec ι σ) → QBasis ι σ (QRec ι σ) := fun p => (p.1, p.2.2 j, Function.update p.2.2 j p.2.1) @@ -3218,6 +3258,7 @@ lemma slotSwapMap_involutive (j : ι) : /-- The slot swap at an *optional* index: at `none` there is nothing to store, so the algorithm idles. This is what lets one formula describe every step. -/ +@[expose] def slotSwapPerm : Option ι → Equiv.Perm (QBasis ι σ (QRec ι σ)) | none => 1 | some j => Function.Involutive.toPerm _ (slotSwapMap_involutive j) @@ -3268,6 +3309,7 @@ lemma equivFin_of_idxAt {t : ℕ} {j : ι} (h : idxAt ι t = some j) : /-! ## The record -/ /-- The workspace after `t` queries: the answers at the first `t` indices. -/ +@[expose] noncomputable def recAt (a : ι → σ) (t : ℕ) : QRec ι σ := fun i => if (Fintype.equivFin ι i : ℕ) < t then some (a i) else none @@ -3317,6 +3359,7 @@ lemma recAt_self_eq_none (a : ι → σ) {t : ℕ} {j : ι} /-- **The algorithm that reads every coordinate**, announcing `dec` of the completed record. -/ +@[expose] noncomputable def readAllAlg (dec : QRec ι σ → O) : QAlg ι σ O (QRec ι σ) where init := qBasis (none, none, fun _ => none) init_isQState := isQState_qBasis _ @@ -3483,12 +3526,14 @@ variable {σ : Type} [Fintype σ] [DecidableEq σ] /-- The left vector of the factorization: `1` on the constant coordinate and `1` at its own letter. -/ +@[expose] def uniformLeft (a : σ) : Option σ → ℝ | none => 1 | some x => if x = a then 1 else 0 /-- The right vector: `1` on the constant coordinate and `−1` at its own letter. -/ +@[expose] def uniformRight (b : σ) : Option σ → ℝ | none => 1 | some x => if x = b then -1 else 0 @@ -3624,6 +3669,7 @@ lemma normSq_hadS : Complex.normSq hadS = 2⁻¹ := by Real.mul_self_sqrt (by norm_num : (0 : ℝ) ≤ 2)] /-- The Hadamard gate on one qubit: `(1/√2)·(−1)^{b·b'}`. -/ +@[expose] noncomputable def hadMat : Matrix Bool Bool ℂ := Matrix.of fun b b' => if b && b' then -hadS else hadS @@ -3719,6 +3765,7 @@ lemma isQState_hadInit {u : QBasis ι σ W → ℂ} (hu : IsQState u) : /-- **The Hadamard test of `R` on `u`**: controlled-`R` between two Hadamards on a control qubit, measuring the control. Announces `true` on control `0`. Costs exactly `R.len` queries. -/ +@[expose] noncomputable def hadTest (R : QRoutine ι σ W) (u : QBasis ι σ W → ℂ) (hu : IsQState u) : QAlg ι σ Bool (CtrlWork ι W) := (R.control.comp (QRoutine.ofUnitary ctrlHad ctrlHad_mem_unitaryGroup)).toAlg @@ -4168,6 +4215,7 @@ section Realizes variable {X : Type} [Fintype X] {O O' : Type} [DecidableEq O] [DecidableEq O'] /-- Some algorithm has outcome distribution `P` after `q` queries. -/ +@[expose] def Realizes (read : X → ι → σ) (q : ℕ) (P : X → O → ℝ) : Prop := ∃ (W : Type) (_ : Fintype W) (_ : DecidableEq W) (A : QAlg ι σ O W), ∀ x o, A.prob (read x) q o = P x o @@ -4330,6 +4378,7 @@ open Matrix /-- XOR the `some`-part of `s` into the `some`-part of `t`; blank on either side leaves `t` alone. -/ +@[expose] def optXor : Option Bool → Option Bool → Option Bool | some b, some c => some (xor b c) | t, _ => t @@ -4351,6 +4400,7 @@ lemma optXor_optXor (t s : Option Bool) : optXor (optXor t s) s = t := by variable {ι W : Type} [Fintype ι] [DecidableEq ι] [Fintype W] [DecidableEq W] /-- The XOR oracle's action on the computational basis. -/ +@[expose] def xorOracleMap (a : ι → Bool) : QBasis ι Bool W → QBasis ι Bool W | (none, t, w) => (none, t, w) | (some i, t, w) => (some i, optXor t (some (a i)), w) @@ -4379,6 +4429,7 @@ lemma xorOracleMap_involutive (a : ι → Bool) : · simp [optXor_optXor] /-- The XOR oracle as a permutation of the basis. -/ +@[expose] def xorOraclePerm (a : ι → Bool) : Equiv.Perm (QBasis ι Bool W) := Function.Involutive.toPerm _ (xorOracleMap_involutive a) @@ -4416,6 +4467,7 @@ variable {O : Type} [DecidableEq O] variable {X : Type} [Fintype X] /-- **The state of `A` on input `a` after `t` XOR queries.** -/ +@[expose] def xorState (A : QAlg ι Bool O W) (a : ι → Bool) : ℕ → (QBasis ι Bool W → ℂ) | 0 => A.step 0 *ᵥ A.init @@ -4457,6 +4509,7 @@ lemma xorState_eq_runWith (A : QAlg ι Bool O W) (n : ℕ) (a : ι → Bool) /-- `A` computes `f` on the promise `read` with error at most `ε` in `q` **XOR queries**. -/ +@[expose] def XorComputesWithErrorOn (A : QAlg ι Bool O W) (q : ℕ) (read : X → ι → Bool) (f : X → O) (ε : ℝ) : Prop := ∀ x : X, 1 - ε ≤ qProb A.readout (xorState A (read x) q) (f x) @@ -4843,6 +4896,7 @@ variable {ι W : Type} [Fintype ι] [DecidableEq ι] [Fintype W] [DecidableEq W] namespace QRoutine /-- The operator implemented by `R` against the XOR oracle. -/ +@[expose] def xorRun (R : QRoutine ι Bool W) (a : ι → Bool) : Matrix (QBasis ι Bool W) (QBasis ι Bool W) ℂ := R.runWith (xorOracleMat a) R.len @@ -4863,6 +4917,7 @@ All on `QBasis ι Bool (Option Bool × W)`: index, answer, ancilla, workspace. -/ /-- Swap the answer register with the ancilla. -/ +@[expose] def swapAncMap : QBasis ι Bool (Option Bool × W) → QBasis ι Bool (Option Bool × W) | (idx, t, (v, w)) => (idx, v, (t, w)) @@ -4878,6 +4933,7 @@ lemma swapAncMap_involutive : rfl /-- XOR the answer register's value into the ancilla. -/ +@[expose] def xorIntoMap : QBasis ι Bool (Option Bool × W) → QBasis ι Bool (Option Bool × W) | (idx, s, (t, w)) => (idx, s, (optXor t s, w)) @@ -4895,6 +4951,7 @@ lemma xorIntoMap_involutive : /-- On an active index with answer `some v`: swap `⊥ ↔ some v` in the ancilla. Controlled on the index being active, so the idle sector is exactly fixed. -/ +@[expose] def ctrlSwapMap : QBasis ι Bool (Option Bool × W) → QBasis ι Bool (Option Bool × W) | (some i, some v, (t, w)) => (some i, some v, (Equiv.swap none (some v) t, w)) | p => p @@ -4974,6 +5031,7 @@ lemma ctrlSwapMat_mulVec_apply (ψ : QBasis ι Bool (Option Bool × W) → ℂ) /-! ## The two gadgets -/ /-- **Transposition simulates XOR**: two physical queries. -/ +@[expose] def xorGadget : QRoutine ι Bool (Option Bool × W) where len := 2 step := fun t => if t = 1 then xorIntoMat else swapAncMat @@ -4986,6 +5044,7 @@ def xorGadget : QRoutine ι Bool (Option Bool × W) where @[simp] lemma xorGadget_len : (xorGadget (ι := ι) (W := W)).len = 2 := rfl /-- **XOR simulates transposition**: two physical queries. -/ +@[expose] def transGadget : QRoutine ι Bool (Option Bool × W) where len := 2 step := fun t => if t = 1 then ctrlSwapMat else swapAncMat diff --git a/LeanPool/QuantumQuery/Polynomial.lean b/LeanPool/QuantumQuery/Polynomial.lean index e47ed907d9..45205b6029 100644 --- a/LeanPool/QuantumQuery/Polynomial.lean +++ b/LeanPool/QuantumQuery/Polynomial.lean @@ -15,7 +15,7 @@ Ported from the corresponding upstream modules listed by the source sections bel References beginning with `Source` name these retained sections. -/ -@[expose] public section +public section section SourcePolynomialBoolean @@ -44,6 +44,7 @@ open MvPolynomial /-! ## Bits and evaluation -/ /-- The real value of a Boolean: `1` for `true`, `0` for `false`. -/ +@[expose] def bit (b : Bool) : ℝ := if b then 1 else 0 @[simp] lemma bit_true : bit true = 1 := rfl @@ -151,6 +152,7 @@ namespace AmpPoly variable (P : AmpPoly ι) /-- The complex value at a Boolean point. -/ +@[expose] noncomputable def evalC (P : AmpPoly ι) (a : ι → Bool) : ℂ := ⟨evalBool P.re a, evalBool P.im a⟩ diff --git a/LeanPool/QuantumQuery/QueryBounds.lean b/LeanPool/QuantumQuery/QueryBounds.lean index 41face22ec..609dc31579 100644 --- a/LeanPool/QuantumQuery/QueryBounds.lean +++ b/LeanPool/QuantumQuery/QueryBounds.lean @@ -14,7 +14,7 @@ Ported from the corresponding upstream modules listed by the source sections bel References beginning with `Source` name these retained sections. -/ -@[expose] public section +public section section SourceQuantumLowerBoundBridge @@ -311,6 +311,7 @@ lemma gramForm_sub_eq_mask {Γ M : Matrix X X ℝ} {p : X → X → Prop} [Decid /-! ## Sector decomposition by the query-index register -/ /-- The query-index register, used as a readout map. -/ +@[expose] def idxOf : QBasis ι σ W → Option ι := fun p => p.1 omit [DecidableEq W] [DecidableEq ι] [DecidableEq σ] [Fintype W] [Fintype ι] [Fintype σ] in @@ -378,6 +379,7 @@ lemma oracleMat_mulVec_qRestrict_some {a b : ι → σ} {i : ι} (hab : a i = b /-! ## The progress measure -/ /-- The weighted family `x ↦ δ x • ψ x`. -/ +@[expose] noncomputable def qScale (δ : X → ℝ) (ψ : X → (H → ℂ)) : X → (H → ℂ) := fun x => (δ x : ℂ) • ψ x @@ -457,6 +459,7 @@ variable (read : X → ι → σ) (Γ : Matrix X X ℝ) (δ : X → ℝ) (ψ : X → (QBasis ι σ W → ℂ)) /-- The weighted family restricted to the sector `o`. -/ +@[expose] noncomputable def sectFam (o : Option ι) (δ : X → ℝ) (ψ : X → (QBasis ι σ W → ℂ)) : X → (QBasis ι σ W → ℂ) := fun x => (δ x : ℂ) • qRestrict idxOf o (ψ x) diff --git a/LeanPool/QuantumQuery/StateConversion.lean b/LeanPool/QuantumQuery/StateConversion.lean index 2235e96f5d..b9e57f2346 100644 --- a/LeanPool/QuantumQuery/StateConversion.lean +++ b/LeanPool/QuantumQuery/StateConversion.lean @@ -16,7 +16,7 @@ Ported from the corresponding upstream modules listed by the source sections bel References beginning with `Source` name these retained sections. -/ -@[expose] public section +public section section SourceQuantumChordGap @@ -1091,6 +1091,7 @@ variable {ι σ V W : Type} [Fintype ι] [DecidableEq ι] [Fintype σ] [Decidabl namespace QRoutine /-- **Lift a routine along a workspace extension.** -/ +@[expose] def liftReg (V : Type) [Fintype V] [DecidableEq V] (R : QRoutine ι σ W) : QRoutine ι σ (V × W) where len := R.len @@ -2237,6 +2238,7 @@ open Matrix variable {X O : Type} [Fintype X] [DecidableEq O] {f : X → O} /-- The attained output of `x`, as an element of the finite workspace. -/ +@[expose] def rangeElem (f : X → O) (x : X) : ↥(Set.range f) := ⟨f x, ⟨x, rfl⟩⟩ omit [DecidableEq O] [Fintype X] in @@ -2326,11 +2328,13 @@ readout measures — one coherent conversion, never one detector per output. -/ /-- The common initial vector: the constant coordinate alone. -/ +@[expose] def commonVec {R : Type} : Option R → ℝ | none => 1 | some _ => 0 /-- The output-labelled vector: the coordinate of one attained output. -/ +@[expose] def outVec {R : Type} [DecidableEq R] (r : R) : Option R → ℝ | none => 0 | some s => if s = r then 1 else 0 @@ -2832,6 +2836,7 @@ abbrev UQBasis (R ι σ K : Type) : Type := QBasis ι σ (UWork R ι K) /-- The realization: place an abstract vector in the query basis, extending by zero off the embedded coordinates. -/ +@[expose] def uRealize (ψ : UBasis R ι σ K → ℂ) : UQBasis R ι σ K → ℂ := fun q => match q with | (none, none, Sum.inl s) => ψ (Sum.inl s) @@ -3759,6 +3764,7 @@ points. Proving the inner product and the norm once, for this shape, is what keeps the rest of the file free of basis manipulation. -/ /-- A state of the construction's shape. -/ +@[expose] def scState (α : ℂ) (A : ι → σ → K → ℂ) : QBasis ι σ (Option K) → ℂ | (none, none, none) => α | (some i, some s, some k) => A i s k @@ -4131,6 +4137,7 @@ variable {ι σ X O K : Type} [Fintype ι] [DecidableEq ι] [Fintype σ] /-- **Rescaling a dual pair**: `u ↦ αu`, `v ↦ α⁻¹v`. Feasibility is scale-invariant, and the two sides' masses trade against each other — the balancing device of the algorithm extraction. -/ +@[expose] noncomputable def scale (P : DualPairOn read K f) {α : ℝ} (hα : α ≠ 0) : DualPairOn read K f where u x i k := α * P.u x i k @@ -4247,6 +4254,7 @@ theorem qNormSq_posWitness_le [Nonempty σ] {cu : ℝ} (P : DualPairOn read K f) /-- **The detector for output `o`**: the uniform-clock phase detector of the reflection product built from the witness construction's generators and the span of the positive witnesses of `f⁻¹(o)`. Cost: `4(T−1)` queries. -/ +@[expose] noncomputable def scDetector (P : DualPairOn read K f) (o : O) (T : ℕ) : QRoutine ι σ (ClockWork ι T (Option K)) := clockPhaseRefl (inputReflProduct scGen (scKer read f P o) @@ -4528,6 +4536,7 @@ variable {ι σ K X O : Type} [Fintype ι] [DecidableEq ι] [Fintype σ] /-- **The uniform detector**: the clocked phase reflection of the reflection product `R_P·R_L`, for the physical generators and the global projector `uniformL P α`. -/ +@[expose] noncomputable def uniformDetector (P : DualPairOn read K f) (α : ℝ) (T : ℕ) : QRoutine ι σ (ClockWork ι T (UWork ↥(Set.range f) ι K)) := clockPhaseRefl (inputReflProduct @@ -5073,12 +5082,14 @@ variable {ι σ K X O : Type} [Fintype ι] [DecidableEq ι] [Fintype σ] /-- **The uniform extraction constant** — one fixed absolute constant, never a free variable. -/ +@[expose] def uniformExtractionConstant : ℝ := 8192 /-! ## The readout -/ /-- The label of one workspace coordinate: the output held in the target register, or the junk label `o₀` anywhere else. -/ +@[expose] def uniformLabel (f : X → O) (o₀ : O) : UWork ↥(Set.range f) ι K → O | Sum.inl (some r) => (r : O) 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..4d9d759f1a 100644 --- a/LeanPool/RearrangementNumber/NonMRR/Bounding.lean +++ b/LeanPool/RearrangementNumber/NonMRR/Bounding.lean @@ -22,24 +22,24 @@ 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 namespace NonMRR /-- Eventual domination of natural-valued sequences. -/ -def EventuallyLE (f g : ℕ → ℕ) : Prop := ∀ᶠ n in atTop, f n ≤ g n +@[expose] def EventuallyLE (f g : ℕ → ℕ) : Prop := ∀ᶠ n in atTop, f n ≤ g n /-- The strict comparison holding at arbitrarily large coordinates. -/ -def FrequentlyLT (f g : ℕ → ℕ) : Prop := ∃ᶠ n in atTop, f n < g n +@[expose] def FrequentlyLT (f g : ℕ → ℕ) : Prop := ∃ᶠ n in atTop, f n < g n theorem frequentlyLT_iff_not_eventuallyLE (f g : ℕ → ℕ) : FrequentlyLT f g ↔ ¬ EventuallyLE g f := by simp only [FrequentlyLT, EventuallyLE, Filter.Frequently, not_lt] /-- The usual relation whose norm is the bounding number. -/ -def boundingRelation : Relation where +@[expose] def boundingRelation : Relation where Challenge := ℕ → ℕ Response := ℕ → ℕ relates := FrequentlyLT @@ -48,7 +48,7 @@ def boundingRelation : Relation where exact Nat.lt_succ_self _)⟩ /-- The least cardinality of an eventually unbounded family. -/ -noncomputable def boundingNumber : Cardinal := boundingRelation.norm +@[expose] noncomputable def boundingNumber : Cardinal := boundingRelation.norm theorem dominating_boundingRelation_iff (s : Set (ℕ → ℕ)) : boundingRelation.Dominating s ↔ ¬ ∃ f, ∀ g ∈ s, EventuallyLE g f := by diff --git a/LeanPool/RearrangementNumber/NonMRR/Catalogue.lean b/LeanPool/RearrangementNumber/NonMRR/Catalogue.lean index 6b6af3e501..645d380520 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 @@ -31,6 +31,7 @@ noncomputable section namespace NonMRR /-- The denominators of the prescribed prefix tolerances. -/ +@[expose] def blockDenominator (n : ℕ) : ℕ := 2 ^ (n + 1) theorem blockDenominator_pos (n : ℕ) : 0 < blockDenominator n := by @@ -41,6 +42,7 @@ theorem blockDenominator_pos (n : ℕ) : 0 < blockDenominator n := by def blockTolerance (n : ℕ) : ℝ := 1 / (blockDenominator n : ℝ) /-- The number of exceptional choices allowed at each stage. -/ +@[expose] def blockCapacity (n : ℕ) : ℕ := 8 * blockDenominator n ^ 4 theorem blockCapacity_pos (n : ℕ) : 0 < blockCapacity n := by 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..13c5883d11 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 @@ -27,11 +27,12 @@ namespace NonMRR /-- A family meeting each prescribed function infinitely often along each infinite set of coordinates. -/ -def StronglyCoincident (F : Set (ℕ → ℕ)) : Prop := +@[expose] def StronglyCoincident (F : Set (ℕ → ℕ)) : Prop := ∀ W : Set ℕ, W.Infinite → ∀ c : ℕ → ℕ, ∃ f ∈ F, ∃ᶠ n in atTop, n ∈ W ∧ f n = c n /-- A family of increasing sequences with gaps escaping each bound. -/ +@[expose] def GapUnbounded (B : Set (ℕ → ℕ)) : Prop := (∀ t ∈ B, StrictMono t) ∧ ∀ g : ℕ → ℕ, ∃ t ∈ B, ∃ᶠ k in atTop, g (t k) < t (k + 1) 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..0d87342f48 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 @@ -30,6 +30,7 @@ namespace NonMRR /-- The rearrangement relation on conditionally convergent real series. The rearrangement theorem supplies a response to every challenge. -/ +@[expose] def rearrangementRelation : Relation where Challenge := ConditionalSeries Response := Equiv.Perm ℕ 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..dbd1712999 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 @@ -42,7 +42,7 @@ theorem permutationControl_separates (π : Equiv.Perm ℕ) {n x y : ℕ} omega /-- Insert enough space after each point to pass the next cutoff. -/ -def spacedSequence (g : ℕ → ℕ) : ℕ → ℕ +@[expose] def spacedSequence (g : ℕ → ℕ) : ℕ → ℕ | 0 => 0 | n + 1 => max (spacedSequence g n + 1) (g (spacedSequence g n)) diff --git a/LeanPool/RearrangementNumber/NonMRR/Relations.lean b/LeanPool/RearrangementNumber/NonMRR/Relations.lean index 06e6a742e6..d1033bdedf 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,11 +41,11 @@ 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. -/ -noncomputable def norm (A : Relation.{u}) : Cardinal.{u} := +@[expose] noncomputable def norm (A : Relation.{u}) : Cardinal.{u} := sInf {κ | ∃ s : Set A.Response, A.Dominating s ∧ #s = κ} theorem dominating_univ (A : Relation.{u}) : A.Dominating univ := by @@ -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..3399094742 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 @@ -31,7 +31,7 @@ def selectedBlock (u : ℕ → ℕ → ℕ → ℝ) (e g : ℕ → ℕ) (n i : if e n < g n then u n (e n) i else 0 /-- Values with a large prefix in the natural or the permuted order. -/ -noncomputable def badValues (u : ℕ → ℕ → ℕ → ℝ) (g : ℕ → ℕ) +@[expose] noncomputable def badValues (u : ℕ → ℕ → ℕ → ℝ) (g : ℕ → ℕ) (π : Equiv.Perm ℕ) (b : ℕ → ℝ) (n : ℕ) : Finset ℕ := by classical exact (range (g n)).filter (fun k ↦ diff --git a/LeanPool/RearrangementNumber/NonMRR/Series.lean b/LeanPool/RearrangementNumber/NonMRR/Series.lean index 7cf68853f2..bffb4a4504 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,14 +48,15 @@ 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. -/ +@[expose] noncomputable def rr : Cardinal := sInf {κ | ∃ s : Set (Equiv.Perm ℕ), IsRearranging s ∧ #s = κ} diff --git a/LeanPool/RearrangementNumber/NonMRR/SlalomBound.lean b/LeanPool/RearrangementNumber/NonMRR/SlalomBound.lean index 567f725e73..4350654102 100644 --- a/LeanPool/RearrangementNumber/NonMRR/SlalomBound.lean +++ b/LeanPool/RearrangementNumber/NonMRR/SlalomBound.lean @@ -21,13 +21,14 @@ 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 namespace NonMRR /-- The norm of the specific bounded-slalom relation used in the construction. -/ +@[expose] noncomputable def blockSlalomNumber : Cardinal := (slalomRelation blockCapacity blockCapacity_pos).norm diff --git a/LeanPool/RearrangementNumber/NonMRR/Slaloms.lean b/LeanPool/RearrangementNumber/NonMRR/Slaloms.lean index f48b9bfe1f..a1ed79306e 100644 --- a/LeanPool/RearrangementNumber/NonMRR/Slaloms.lean +++ b/LeanPool/RearrangementNumber/NonMRR/Slaloms.lean @@ -21,17 +21,17 @@ 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 namespace NonMRR /-- A slalom with the pointwise width bound `r`. -/ -def Slalom (r : ℕ → ℕ) := {φ : ℕ → Finset ℕ // ∀ n, (φ n).card ≤ r n} +@[expose] def Slalom (r : ℕ → ℕ) := {φ : ℕ → Finset ℕ // ∀ n, (φ n).card ≤ r n} /-- The slalom relation: the response catches the challenge infinitely often. -/ -def slalomRelation (r : ℕ → ℕ) (hr : ∀ n, 0 < r n) : Relation where +@[expose] def slalomRelation (r : ℕ → ℕ) (hr : ∀ n, 0 < r n) : Relation where Challenge := ℕ → ℕ Response := Slalom r relates e φ := ∃ᶠ n in atTop, e n ∈ φ.val n 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/RegtsSevenster/RS/Assembly/BlueprintDeligne.lean b/LeanPool/RegtsSevenster/RS/Assembly/BlueprintDeligne.lean index 6a489719da..95aace3948 100644 --- a/LeanPool/RegtsSevenster/RS/Assembly/BlueprintDeligne.lean +++ b/LeanPool/RegtsSevenster/RS/Assembly/BlueprintDeligne.lean @@ -18,7 +18,7 @@ depend on nothing beyond `propext`, `Classical.choice` and `Quot.sound` is checked rather than asserted. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Assembly/BlueprintFactorial.lean b/LeanPool/RegtsSevenster/RS/Assembly/BlueprintFactorial.lean index bbc354dd46..e4c0afa7bb 100644 --- a/LeanPool/RegtsSevenster/RS/Assembly/BlueprintFactorial.lean +++ b/LeanPool/RegtsSevenster/RS/Assembly/BlueprintFactorial.lean @@ -29,7 +29,7 @@ trace-zeta mechanisms. Schur theory used by Deligne and by the colour bounds is audited separately. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Assembly/BlueprintStatement.lean b/LeanPool/RegtsSevenster/RS/Assembly/BlueprintStatement.lean index 5b11467768..f745a08310 100644 --- a/LeanPool/RegtsSevenster/RS/Assembly/BlueprintStatement.lean +++ b/LeanPool/RegtsSevenster/RS/Assembly/BlueprintStatement.lean @@ -44,7 +44,7 @@ trusts. `RS/DimensionDefinitions.lean` adds the growth, minimum and prescribed-dimension surface and imports only that main surface. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/RegtsSevenster/RS/Classical/Algebra/FactorialTrace.lean b/LeanPool/RegtsSevenster/RS/Classical/Algebra/FactorialTrace.lean index daafb8a102..12b0af980d 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Algebra/FactorialTrace.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Algebra/FactorialTrace.lean @@ -25,7 +25,7 @@ and strand instances are supplied in `Novel/Envelope/FactorialTrace` and `Novel/Envelope/BlockFactorialTrace`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Algebra/TraceCriterion.lean b/LeanPool/RegtsSevenster/RS/Classical/Algebra/TraceCriterion.lean index 7e6e6445aa..8f2ab19022 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Algebra/TraceCriterion.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Algebra/TraceCriterion.lean @@ -20,7 +20,7 @@ forcing `j = 0`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/CatTheory/Growth.lean b/LeanPool/RegtsSevenster/RS/Classical/CatTheory/Growth.lean index d69972d693..17191bfef7 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/CatTheory/Growth.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/CatTheory/Growth.lean @@ -24,7 +24,7 @@ hypothesis in; the endomorphism dimension is the measure the envelope's rank bound supplies directly. -/ -@[expose] public section +public section namespace RS @@ -36,6 +36,7 @@ variable (A : Type u) /-- Every object has moderate tensor-power growth, measured by endomorphism dimensions. -/ +@[expose] def ModerateEndGrowth [Category.{v} A] [MonoidalCategory A] [Preadditive A] [Linear ℂ A] : Prop := ∀ Y : A, ∃ C c : ℕ, ∀ N : ℕ, diff --git a/LeanPool/RegtsSevenster/RS/Classical/CatTheory/Intertwine.lean b/LeanPool/RegtsSevenster/RS/Classical/CatTheory/Intertwine.lean index 2c499c5c4f..351383f38a 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/CatTheory/Intertwine.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/CatTheory/Intertwine.lean @@ -15,7 +15,7 @@ An intertwining relation is preserved by addition and scalar multiplication in a linear category. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/CatTheory/KaroubiLinear.lean b/LeanPool/RegtsSevenster/RS/Classical/CatTheory/KaroubiLinear.lean index b50595b3c8..fdfe14a7b9 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/CatTheory/KaroubiLinear.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/CatTheory/KaroubiLinear.lean @@ -15,13 +15,14 @@ The underlying-morphism map transports the linear structure of the base category to its Karoubi completion. -/ -@[expose] public section +public section namespace RS open CategoryTheory CategoryTheory.Idempotents /-- The underlying-morphism map is additive. -/ +@[expose] def karoubiHomAddHom {C : Type*} [Category C] [Preadditive C] (P Q : Karoubi C) : (P ⟶ Q) →+ (P.X ⟶ Q.X) where toFun g := g.f @@ -55,6 +56,7 @@ noncomputable instance karoubiLinear {C : Type*} [Category C] rw [Linear.comp_smul] /-- The underlying-morphism map is complex linear. -/ +@[expose] noncomputable def karoubiHomLinearMap {C : Type*} [Category C] [Preadditive C] [Linear ℂ C] (P Q : Karoubi C) : (P ⟶ Q) →ₗ[ℂ] (P.X ⟶ Q.X) where diff --git a/LeanPool/RegtsSevenster/RS/Classical/CatTheory/KaroubiTrace.lean b/LeanPool/RegtsSevenster/RS/Classical/CatTheory/KaroubiTrace.lean index 491190d52f..76be965852 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/CatTheory/KaroubiTrace.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/CatTheory/KaroubiTrace.lean @@ -19,7 +19,7 @@ nondegenerate trace that kills nilpotents proves semisimplicity of every corner endomorphism algebra. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/CatTheory/Length.lean b/LeanPool/RegtsSevenster/RS/Classical/CatTheory/Length.lean index abdf787f6e..ee0caecbe4 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/CatTheory/Length.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/CatTheory/Length.lean @@ -25,7 +25,7 @@ at most `0`, simple objects have length at most `1`, and the bound is subadditive over binary biproducts. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/CatTheory/LengthBound.lean b/LeanPool/RegtsSevenster/RS/Classical/CatTheory/LengthBound.lean index a0f9077ac4..ba760e322b 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/CatTheory/LengthBound.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/CatTheory/LengthBound.lean @@ -23,7 +23,7 @@ in `End Y`, hence a linearly independent family, so that two halves. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/CatTheory/LinearCategory.lean b/LeanPool/RegtsSevenster/RS/Classical/CatTheory/LinearCategory.lean index c346bef0aa..9a1bf2f8e0 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/CatTheory/LinearCategory.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/CatTheory/LinearCategory.lean @@ -18,7 +18,7 @@ scalar endomorphisms of the tensor unit (`HasScalarUnit`), is defined in `RS/Definitions.lean`. -/ -@[expose] public section +public section namespace RS @@ -29,11 +29,13 @@ universe v u variable (A : Type u) /-- Every Hom-space is finite dimensional over ℂ. -/ +@[expose] def HasFinDimHom [Category.{v} A] [Preadditive A] [Linear ℂ A] : Prop := ∀ X Y : A, FiniteDimensional ℂ (X ⟶ Y) /-- Every object is a finite biproduct of simple objects. -/ +@[expose] def IsSemisimple [Category.{v} A] [Preadditive A] [HasFiniteBiproducts A] : Prop := ∀ X : A, ∃ (n : ℕ) (S : Fin n → A), diff --git a/LeanPool/RegtsSevenster/RS/Classical/CatTheory/PartialTrace.lean b/LeanPool/RegtsSevenster/RS/Classical/CatTheory/PartialTrace.lean index fd2c0b52dc..710906f961 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/CatTheory/PartialTrace.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/CatTheory/PartialTrace.lean @@ -23,7 +23,7 @@ trace. Those are what the cycle-trace factorisation of a permutation action needs. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/CatTheory/TensorPow.lean b/LeanPool/RegtsSevenster/RS/Classical/CatTheory/TensorPow.lean index 25ddd38095..44cbbc2667 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/CatTheory/TensorPow.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/CatTheory/TensorPow.lean @@ -19,7 +19,7 @@ satisfies, and the implication from it to Deligne's subquotient form. -/ -@[expose] public section +public section namespace RS @@ -44,6 +44,7 @@ retract of a finite biproduct of tensor powers of `X` alone. This is how the envelope generates, and it is stronger than Deligne's hypothesis in two ways at once — a retract rather than a subquotient, and no duals among the powers. -/ +@[expose] def RetractGeneratedBy [Category.{v} A] [MonoidalCategory A] [Preadditive A] [HasFiniteBiproducts A] (X : A) : Prop := diff --git a/LeanPool/RegtsSevenster/RS/Classical/CatTheory/Trace.lean b/LeanPool/RegtsSevenster/RS/Classical/CatTheory/Trace.lean index 00c6572703..eecaeddc04 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/CatTheory/Trace.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/CatTheory/Trace.lean @@ -21,7 +21,7 @@ dimension; the trace is additive and ℂ-homogeneous; it is cyclic; and it is multiplicative over the tensor product. -/ -@[expose] public section +public section namespace RS @@ -34,7 +34,7 @@ variable {C : Type u} /-- The categorical trace of an endomorphism: coevaluate, act, cross the strand over the right dual, and evaluate. -/ -def catTrace [Category.{v} C] [MonoidalCategory C] [SymmetricCategory C] +@[expose] def catTrace [Category.{v} C] [MonoidalCategory C] [SymmetricCategory C] [RigidCategory C] {X : C} (f : X ⟶ X) : End (𝟙_ C) := η_ X Xᘁ ≫ f ▷ Xᘁ ≫ (β_ X Xᘁ).hom ≫ ε_ X Xᘁ @@ -104,7 +104,7 @@ theorem catTrace_eq_loop rw [braiding_naturality_left_assoc] /-- The trace computed against a chosen exact pairing. -/ -def pairTrace [Category.{v} C] [MonoidalCategory C] [SymmetricCategory C] +@[expose] def pairTrace [Category.{v} C] [MonoidalCategory C] [SymmetricCategory C] {X D : C} (p : ExactPairing X D) (f : X ⟶ X) : End (𝟙_ C) := letI := p @@ -381,6 +381,7 @@ theorem catDim_unit [Category.{v} C] [MonoidalCategory C] [SymmetricCategory C] monoidal /-- **The trace as a ℂ-linear map** into the scalar monoid. -/ +@[expose] def catTraceLin [Category.{v} C] [MonoidalCategory C] [SymmetricCategory C] [Preadditive C] [Linear ℂ C] [MonoidalPreadditive C] [MonoidalLinear ℂ C] [RigidCategory C] diff --git a/LeanPool/RegtsSevenster/RS/Classical/CatTheory/UnitEnd.lean b/LeanPool/RegtsSevenster/RS/Classical/CatTheory/UnitEnd.lean index 3d7af0c0ce..3187be5855 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/CatTheory/UnitEnd.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/CatTheory/UnitEnd.lean @@ -19,7 +19,7 @@ endomorphism of the unit either as a right whiskering or as a left whiskering, and whiskerings on opposite sides commute. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/CatTheory/WhiskerAdditive.lean b/LeanPool/RegtsSevenster/RS/Classical/CatTheory/WhiskerAdditive.lean index 814cc1706a..158192be6e 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/CatTheory/WhiskerAdditive.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/CatTheory/WhiskerAdditive.lean @@ -27,7 +27,7 @@ instance for `tensorLeft`, so the distributors are built here directly. -/ -@[expose] public section +public section namespace RS @@ -82,7 +82,7 @@ section Distributors /-- **Tensoring on the left distributes over a binary biproduct.** -/ -noncomputable def tensorBiprodIso +@[expose] noncomputable def tensorBiprodIso [Category.{v} C] [MonoidalCategory C] [Preadditive C] [MonoidalPreadditive C] [Limits.HasBinaryBiproducts C] (B X Y : C) : @@ -99,7 +99,7 @@ noncomputable def tensorBiprodIso /-- **Tensoring on the right distributes over a binary biproduct.** -/ -noncomputable def biprodTensorIso +@[expose] noncomputable def biprodTensorIso [Category.{v} C] [MonoidalCategory C] [Preadditive C] [MonoidalPreadditive C] [Limits.HasBinaryBiproducts C] (X Y B : C) : diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/AltPow.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/AltPow.lean index 5cec8142f8..e7fe0a95a4 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/AltPow.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/AltPow.lean @@ -34,7 +34,7 @@ module's scope, exactly as its symmetric counterpart lives in `PowAct.lean` rather than in `SymAlg.lean`. -/ -@[expose] public section +public section namespace RS @@ -56,6 +56,7 @@ section Antisymmetriser /-- **The antisymmetriser** `(1/n!) • ∑ σ, sign σ • σ` of the symmetric-group algebra. -/ +@[expose] noncomputable def antisymmetriser (n : ℕ) : SymGroupAlgebra n := ((n.factorial : ℂ))⁻¹ • ∑ σ : Equiv.Perm (Fin n), @@ -134,6 +135,7 @@ end Antisymmetriser section AltPow /-- The antisymmetriser acting on the module power. -/ +@[expose] noncomputable def altPowIdem [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] (A : D) [MonObj A] (X : D) [ModObj A X] [Preadditive D] [HasFiniteBiproducts D] @@ -159,6 +161,7 @@ the module power, with section `altPowσ`; this presentation is chosen because consumers build morphisms out of the alternating power by descent along `altPowπ` and morphisms into it through the section. -/ +@[expose] noncomputable def altPow [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] (A : D) [MonObj A] (X : D) [ModObj A X] [Preadditive D] [HasFiniteBiproducts D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/AltPowAct.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/AltPowAct.lean index c80aff19eb..176ae0d634 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/AltPowAct.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/AltPowAct.lean @@ -31,7 +31,7 @@ every positive alternating power a module. * `altPowMod`: the bundled module. -/ -@[expose] public section +public section namespace RS @@ -161,6 +161,7 @@ noncomputable def altPowModObj mul_smul := altPowAct_mul A X n /-- The alternating power of a module, bundled as a module. -/ +@[expose] noncomputable def altPowMod [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] (A : D) [MonObj A] (X : D) [ModObj A X] [Preadditive D] [HasFiniteBiproducts D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeAdjoint.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeAdjoint.lean index 3545261194..2cc4f518e0 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeAdjoint.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeAdjoint.lean @@ -19,7 +19,7 @@ the base morphism. This is the working form for the adjointness of the split idempotents. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeBiprod.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeBiprod.lean index 993624d297..65d926e94c 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeBiprod.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeBiprod.lean @@ -18,7 +18,7 @@ projects componentwise; the inverse injects componentwise; both are linear over the new base, and they are mutually inverse. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeCoherence.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeCoherence.lean index 22cb374851..1af9266433 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeCoherence.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeCoherence.lean @@ -17,7 +17,7 @@ collapse: contracting the regular factor before or after the base change gives the same map. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeDatum.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeDatum.lean index ea5e4cfea0..7eaf98c6a8 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeDatum.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeDatum.lean @@ -19,7 +19,7 @@ composites defining the base-changed pairing and copairing are linear too. -/ -@[expose] public section +public section namespace RS @@ -126,6 +126,7 @@ theorem baseChangeCopair_linear exact Category.assoc _ _ _ /-- **The base change of a duality datum.** -/ +@[expose] noncomputable def baseChangeDatum [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] @@ -145,6 +146,7 @@ section Unit /-- **The unit of the base-change structure**: the base change of the regular module is the regular module over the new base. -/ +@[expose] noncomputable def baseChangeUnitIso [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeFree.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeFree.lean index aa70d63a91..cb999c326f 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeFree.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeFree.lean @@ -22,7 +22,7 @@ the free module on an object to the free module over the new base: A V) ≅ freeMod B V` in the category of `B`-modules. -/ -@[expose] public section +public section namespace RS @@ -130,6 +130,7 @@ lemma modTensorπ_baseChangeFreeHom modTensorπ_desc A (restrictRegular φ) (freeMod A V) _ _ /-- The inverse comparison map: insert the unit of `A`. -/ +@[expose] noncomputable def baseChangeFreeInv [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] (A : D) [MonObj A] (B : D) [MonObj B] (φ : A ⟶ B) @@ -337,6 +338,7 @@ lemma freeAct_baseChangeFreeInv /-- **Base change of a free module**: the base change along `φ` of the free `A`-module on `V` is the free `B`-module on `V`, as an isomorphism of `B`-modules. -/ +@[expose] noncomputable def baseChangeFreeIso [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] (A : D) [MonObj A] (B : D) [MonObj B] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeLinear.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeLinear.lean index b5b8926d22..4e8a04e74c 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeLinear.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeLinear.lean @@ -18,7 +18,7 @@ intertwines the descended actions, and the two linearity laws follow by chaining the factors. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeMonoidal.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeMonoidal.lean index 614698d446..abf3031e83 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeMonoidal.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeMonoidal.lean @@ -20,7 +20,7 @@ This file bundles the structure map as an isomorphism of modules over the new base and proves it natural in both slots. -/ -@[expose] public section +public section namespace RS @@ -33,6 +33,7 @@ variable {D : Type u} /-- **The structure map of base change, as an isomorphism of modules over the new base.** -/ +@[expose] noncomputable def projFormulaMod [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeTensor.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeTensor.lean index 6fdd78b4f2..0cb45684c5 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeTensor.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeTensor.lean @@ -20,7 +20,7 @@ relative tensor this yields the projection formula: base change commutes with the tensor product of modules. -/ -@[expose] public section +public section namespace RS @@ -32,6 +32,7 @@ universe v u variable {D : Type u} /-- Scalar restriction of a module along the base morphism. -/ +@[expose] noncomputable def restrictMod [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] (B : D) [MonObj B] (φ : A ⟶ B) [IsMonHom φ] (P : Mod D B) : @@ -57,6 +58,7 @@ lemma actRight_restrictMod the carrier of the unrestricted module. All statements of this development use this spelling, so that goals remain type-correct at the instances transparency level. -/ +@[expose] noncomputable def restrictπ [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] (A : D) [MonObj A] (B : D) [MonObj B] (φ : A ⟶ B) @@ -82,6 +84,7 @@ theorem restrictπ_cond /-- The cover of the collapse: act the middle base into the module and project. -/ +@[expose] noncomputable def collapseCover [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] (A : D) [MonObj A] (B : D) [MonObj B] (φ : A ⟶ B) @@ -347,6 +350,7 @@ theorem whiskerLeft_unitSlot_baseChangeAct /-- The projection of the new-base tensor, retyped at the induced-module carrier. -/ +@[expose] noncomputable def bcπ [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] @@ -586,6 +590,7 @@ theorem collapseHom_collapseInv (whiskerLeft_unitSlot_baseChangeAct A B φ N)) _ /-- **The change-of-rings collapse**, packaged. -/ +@[expose] noncomputable def collapseIso [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] @@ -664,6 +669,7 @@ theorem restrictMod_baseChange_eq /-- **The projection formula**: the relative tensor over the new base of two base changes is the base change of the relative tensor. -/ +@[expose] noncomputable def projFormula [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] @@ -683,6 +689,7 @@ section Datum /-- **The base change of the pairing**: collapse, apply the pairing under the base, and collapse the regular module. -/ +@[expose] noncomputable def baseChangePair [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] @@ -698,6 +705,7 @@ noncomputable def baseChangePair (modTensorUnitRight A (restrictRegular φ)).hom /-- **The base change of the copairing.** -/ +@[expose] noncomputable def baseChangeCopair [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeTransport.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeTransport.lean index 5261657092..7a9e75d8ec 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeTransport.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeTransport.lean @@ -21,7 +21,7 @@ insertion and contraction, conjugated by the structure map, so their composite is the image of an identity. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeZigzag.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeZigzag.lean index 89e223a222..a2be9f377b 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeZigzag.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/BaseChangeZigzag.lean @@ -15,7 +15,7 @@ The statement that base change preserves the zigzag laws, named so that the dévissage steps can refer to it directly. -/ -@[expose] public section +public section namespace RS @@ -28,6 +28,7 @@ variable {D : Type u} /-- **Base change preserves the zigzag laws**: the statement of record for the dévissage steps. -/ +@[expose] def BaseChangeZigzagStatement [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/BigTensor.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/BigTensor.lean index afb1fde45f..2717f3996d 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/BigTensor.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/BigTensor.lean @@ -26,7 +26,7 @@ transition maps of a `Finset ι`-shaped diagram, and the big tensor product is its colimit. -/ -@[expose] public section +public section namespace RS @@ -47,7 +47,7 @@ variable {D : Type u} /-- The tensor product of the factors `B i` over a list of indices, folded to the right with the unit object as seed. -/ -def listTensor [Category.{v} D] [MonoidalCategory D] +@[expose] def listTensor [Category.{v} D] [MonoidalCategory D] (B : ι → D) : List ι → D | [] => 𝟙_ D | i :: l => B i ⊗ listTensor B l @@ -63,7 +63,7 @@ section LinearOrder /-- The tensor product of the factors `B i` over a finite set of indices, in the slot order given by the linear order on `ι`. -/ -def finTensor [Category.{v} D] [MonoidalCategory D] [LinearOrder ι] +@[expose] def finTensor [Category.{v} D] [MonoidalCategory D] [LinearOrder ι] (B : ι → D) (s : Finset ι) : D := listTensor B (s.sort (· ≤ ·)) @@ -173,6 +173,7 @@ Convention: all stated morphisms have `listTensor`-form endpoints; the tensor-shaped intermediate objects appear only between explicit `eqToHom` guards, so that every composition in the subsequent lemmas is well typed on the nose. -/ +@[expose] def inclFilter [Category.{v} D] [MonoidalCategory D] (B : ι → D) [∀ i, MonObj (B i)] (p : ι → Bool) : @@ -454,7 +455,7 @@ example : IsFiltered (Finset ι) := inferInstance /-- The `Finset ι`-shaped diagram of finite sub-tensor-products, with the unit insertions as transition maps. -/ -@[simps] +@[expose, simps] def finTensorDiagram [Category.{v} D] [MonoidalCategory D] [LinearOrder ι] (B : ι → D) [∀ i, MonObj (B i)] : Finset ι ⥤ D where @@ -466,6 +467,7 @@ def finTensorDiagram /-- The tensor product of the whole family `B`, as the filtered colimit of its finite sub-tensor-products. -/ +@[expose] noncomputable def bigTensor [Category.{v} D] [MonoidalCategory D] [LinearOrder ι] (B : ι → D) [∀ i, MonObj (B i)] [HasColimitsOfShape (Finset ι) D] : @@ -473,6 +475,7 @@ noncomputable def bigTensor /-- The stage inclusion of a finite sub-tensor-product into the big tensor product. -/ +@[expose] noncomputable def bigTensorStage [Category.{v} D] [MonoidalCategory D] [LinearOrder ι] (B : ι → D) [∀ i, MonObj (B i)] [HasColimitsOfShape (Finset ι) D] @@ -559,7 +562,7 @@ lemma finTensorIncl_empty [Category.{v} D] [MonoidalCategory D] [LinearOrder ι] /-- The merge map of two finite stages: include both into the union stage and multiply there. -/ -def finTensorMul [Category.{v} D] [MonoidalCategory D] [LinearOrder ι] +@[expose] def finTensorMul [Category.{v} D] [MonoidalCategory D] [LinearOrder ι] [BraidedCategory D] (B : ι → D) [∀ i, MonObj (B i)] (s t : Finset ι) : finTensor B s ⊗ finTensor B t ⟶ finTensor B (s ∪ t) := diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/BigTensorUnit.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/BigTensorUnit.lean index 21ca80ca04..8532091347 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/BigTensorUnit.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/BigTensorUnit.lean @@ -20,7 +20,7 @@ ambient category can be tested against the filtered colimit one stage at a time. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/BiprodPow.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/BiprodPow.lean index 21a5a75a71..d212de0561 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/BiprodPow.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/BiprodPow.lean @@ -36,7 +36,7 @@ power of a rigid object, so the word-indexed power here is called `wordPow` instead. -/ -@[expose] public section +public section namespace RS @@ -50,6 +50,7 @@ variable {A : Type u} /-- **The word power**: tensor an `X` for each `true` letter of `w` and a `Y` for each `false` one, by the recursion of `tensorPow`. -/ +@[expose] def wordPow [Category.{v} A] [MonoidalCategory A] (X Y : A) : (n : ℕ) → (Fin n → Bool) → A | 0, _ => 𝟙_ A @@ -297,6 +298,7 @@ end Biprod /-! ## Counting letters and the sorted words -/ /-- The number of `true` letters of a word. -/ +@[expose] def popCount {n : ℕ} (w : Fin n → Bool) : ℕ := (Finset.univ.filter fun i => w i = true).card @@ -330,6 +332,7 @@ below the tail — to the top of the `X` block when its letter is `true`, and kept in place when it is `false` — and the rest is sorted recursively. This is the `ofSplit` decomposition the tensor-power action recurses on. -/ +@[expose] noncomputable def sortPerm : {n : ℕ} → (Fin n → Bool) → Equiv.Perm (Fin n) | 0, _ => 1 @@ -353,6 +356,7 @@ theorem sortPerm_succ {n : ℕ} (w : Fin (n + 1) → Bool) : /-- **The sorted word**: `true` on the first block of `p` slots and `false` on the last `q`. -/ +@[expose] def standardWord (p q : ℕ) : Fin (p + q) → Bool := fun i => decide ((i : ℕ) < p) @@ -410,6 +414,7 @@ theorem wordPow_standard_succ [Category.{v} A] [MonoidalCategory A] with all `X`s below all `Y`s, the word power reassociates to `X ^ ⊗ p ⊗ Y ^ ⊗ q`. Built by the recursion of the word, so that consumers can compose with it stage by stage. -/ +@[expose] noncomputable def standardMixedIso [Category.{v} A] [MonoidalCategory A] (X Y : A) (p : ℕ) : (q : ℕ) → (wordPow X Y (p + q) (standardWord p q) ≅ diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/BiprodTransfer.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/BiprodTransfer.lean index b41f9827f4..8bf9eba3d4 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/BiprodTransfer.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/BiprodTransfer.lean @@ -24,7 +24,7 @@ not, since a nonzero multiplicity pushes a bounding-box cell into `μ'` or `ν'` (Deligne 1.10). -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/BlockUnits.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/BlockUnits.lean index f3558f5f6d..7402e69193 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/BlockUnits.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/BlockUnits.lean @@ -29,7 +29,7 @@ rank-one projections attached to a basis of the carrier (`basisProj`) pull back to the required family of units. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/BraidCoherence.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/BraidCoherence.lean index 3d2fb59c4b..1302ccd1f4 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/BraidCoherence.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/BraidCoherence.lean @@ -21,7 +21,7 @@ adjacent pair of crossings `β_ Q R ≫ β_ R Q` cancels by the symmetry axiom, and the residual pure-associator words close by coherence. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainAlgebra.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainAlgebra.lean index c97cc38830..79eb82de6d 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainAlgebra.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainAlgebra.lean @@ -30,7 +30,7 @@ the second slot. All colimit-level laws are cast-free because the stage inclusions absorb the index transports. -/ -@[expose] public section +public section namespace RS @@ -45,6 +45,7 @@ universe v u variable {E : Type u} /-- Transport of a chain object along an equality of indices. -/ +@[expose] def chainCast [Category.{v} E] (B : ℕ → E) {a b : ℕ} (h : a = b) : B a ⟶ B b := eqToHom (congrArg B h) @@ -65,18 +66,21 @@ theorem chainCast_trans [Category.{v} E] (B : ℕ → E) /-- The chain diagram over the `v`-small copy of `ℕ`, the shape at which the receiving category is assumed to have colimits. -/ +@[expose] noncomputable def chainDiagram [Category.{v} E] (B : ℕ → E) (δ : ∀ n, B n ⟶ B (n + 1)) : SmallNat.{v} ⥤ E := smallNatEquiv.inverse ⋙ chainFunctor B δ /-- The colimit object of the chain. -/ +@[expose] noncomputable def chainColimit [Category.{v} E] (B : ℕ → E) (δ : ∀ n, B n ⟶ B (n + 1)) [HasColimitsOfShape SmallNat.{v} E] : E := colimit (chainDiagram B δ) /-- The stage inclusion into the chain colimit. -/ +@[expose] noncomputable def chainColimitι [Category.{v} E] (B : ℕ → E) (δ : ∀ n, B n ⟶ B (n + 1)) [HasColimitsOfShape SmallNat.{v} E] @@ -532,6 +536,7 @@ inclusions. -/ /-- The colimit unit: the bottom-stage unit followed by the stage inclusion. -/ +@[expose] noncomputable def chainColimitUnit [Category.{v} E] (B : ℕ → E) (δ : ∀ n, B n ⟶ B (n + 1)) [HasColimitsOfShape SmallNat.{v} E] [MonoidalCategory E] @@ -663,7 +668,7 @@ theorem chainColimit_mul_assoc /-- **The chain colimit as a monoid object**: the unit is the included bottom-stage unit and the multiplication is assembled from the stagewise multiplications. -/ -@[reducible] +@[expose, reducible] noncomputable def chainColimitMonObj [Category.{v} E] (B : ℕ → E) (δ : ∀ n, B n ⟶ B (n + 1)) [HasColimitsOfShape SmallNat.{v} E] [MonoidalCategory E] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainB.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainB.lean index bb40feada6..6230aa311c 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainB.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainB.lean @@ -19,7 +19,7 @@ insertion is inserting after multiplying. These are the compatibility squares consumed by the colimit algebra. -/ -@[expose] public section +public section namespace RS @@ -248,6 +248,7 @@ section Colimit /-- **The algebra of the splitting chain**: the colimit of the symmetric stages along the seed transitions. -/ +@[expose] noncomputable def chainB [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] @@ -318,6 +319,7 @@ theorem chainB_isCommMonObj /-- **The unit of the splitting-chain algebra**: the seed at the bottom stage. -/ +@[expose] noncomputable def chainBUnit [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainBGr.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainBGr.lean index 3afe689d64..a16de10834 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainBGr.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainBGr.lean @@ -18,7 +18,7 @@ the `M`-arity and negative degrees the `M'`-arity. The balanced degree is the algebra of the splitting chain, carrying the unit. -/ -@[expose] public section +public section namespace RS @@ -32,6 +32,7 @@ variable {D : Type u} /-- **The graded component at an integer degree**: the line through `((−a)⁺, a⁺)` — nonnegative degrees raise the `M`-arity, negative degrees the `M'`-arity. -/ +@[expose] noncomputable def chainBGrComponent [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] @@ -59,6 +60,7 @@ noncomputable def chainBGrComponentZeroIso /-- The iterated line shift: raising both offsets `n` times is the identity on the colimit. -/ +@[expose] noncomputable def chainBdegShiftIso [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] @@ -154,6 +156,7 @@ noncomputable def chainBGrι /-- **The unit of the graded splitting algebra**: the unit of the balanced algebra, in degree zero. -/ +@[expose] noncomputable def chainBGrUnit [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] @@ -1562,7 +1565,7 @@ theorem chainBGrMul_unit /-- **The graded splitting algebra is a monoid object**: the degree-zero unit and the graded multiplication satisfy the monoid laws. -/ -@[reducible] +@[expose, reducible] noncomputable def chainBGrMonObj [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainBGraded.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainBGraded.lean index 21a15a6729..5304761705 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainBGraded.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainBGraded.lean @@ -21,7 +21,7 @@ algebra. The balanced line recovers the degree-zero algebra carrier. -/ -@[expose] public section +public section namespace RS @@ -35,6 +35,7 @@ variable {D : Type u} /-- **The shifted graded component**: the colimit of the two-index stages along the line through the starting bidegree, climbing both arities by the seed transition. -/ +@[expose] noncomputable def chainBdeg [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] @@ -49,6 +50,7 @@ noncomputable def chainBdeg (fun k => chainDelta2 A M M' d (p₀ + k) (q₀ + k)) /-- The stage insertion of a shifted graded component. -/ +@[expose] noncomputable def chainBdegι [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] @@ -101,6 +103,7 @@ theorem chainCast_line /-- **The stagewise multiplication of two lines**: the two-index stage multiplication, transported onto the sum line. -/ +@[expose] noncomputable def chainBdegMulStage [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] @@ -188,6 +191,7 @@ theorem chainBdegMulStage_delta_left section ZeroLine /-- The stage identification of the balanced line. -/ +@[expose] noncomputable def chainBdegZeroStageIso [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] @@ -235,6 +239,7 @@ private theorem chainBdegZeroStage_compatibility /-- **The balanced line is the degree-zero algebra carrier**: the zero-offset line's colimit is the splitting-chain algebra. -/ +@[expose] noncomputable def chainBdegZeroIso [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] @@ -256,6 +261,7 @@ end ZeroLine /-- The stages of the raised line are the shifted stages of the line. -/ +@[expose] noncomputable def chainBdegSuccStageIso [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] @@ -296,6 +302,7 @@ private theorem chainBdegSuccStage_compatibility /-- **The raised line is the line**: shifting both offsets by one is passing to the tail of the chain, which has the same colimit. -/ +@[expose] noncomputable def chainBdegSuccIso [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] @@ -349,6 +356,7 @@ noncomputable def chainBdegMul (chainBdegMulStage_delta_right A M M' d p₀ q₀ r₀ s₀) /-- Transport of a graded component along offset equalities. -/ +@[expose] noncomputable def chainBdegCast [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainBGradedLaws.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainBGradedLaws.lean index cc2e8d31ce..4680e7b79c 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainBGradedLaws.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainBGradedLaws.lean @@ -20,7 +20,7 @@ Each law descends from the corresponding two-index stage law of chain colimits, mirroring the homogeneous laws of `ChainAlgebra`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainBInd.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainBInd.lean index e73ce37b8c..21fee31757 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainBInd.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainBInd.lean @@ -57,7 +57,7 @@ therefore carried as a hypothesis, as in `RS.Classical.Deligne.SuperRealize`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainBNonzero.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainBNonzero.lean index 6119ae2c18..85c103faab 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainBNonzero.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainBNonzero.lean @@ -18,7 +18,7 @@ unit stage, and the power zigzag induction keeps every stage alive. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainBofA.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainBofA.lean index ed37d8a536..ebf3c6dbce 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainBofA.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainBofA.lean @@ -20,7 +20,7 @@ reduces along the colimit defining equations to the bilinearity of the stage multiplication over the base. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainBridge.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainBridge.lean index 2cfda7788d..9d77e2989c 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainBridge.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainBridge.lean @@ -22,7 +22,7 @@ wiring that connects the copairing powers of the duality datum to the stage units that the colimit detection speaks about. -/ -@[expose] public section +public section namespace RS @@ -107,6 +107,7 @@ end SlotComm /-- **The stage projection**: a power stage maps to the matching splitting-chain stage by swapping the pair into copairing order and projecting both slots onto the symmetric powers. -/ +@[expose] noncomputable def projStage [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainDelta.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainDelta.lean index 81dd9831fe..aa45e6f83d 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainDelta.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainDelta.lean @@ -18,7 +18,7 @@ transition. The stage units ride along the transitions by construction; their nonvanishing is the pairing side's business. -/ -@[expose] public section +public section namespace RS @@ -110,6 +110,7 @@ theorem actLeft_symPowOne_inv /-- A module maps into the singleton stage of its symmetric-power tower. -/ +@[expose] noncomputable def toSymPowModZero [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] @@ -122,6 +123,7 @@ noncomputable def toSymPowModZero /-- **The seed of the splitting chain**: the copairing lands in the bottom stage. -/ +@[expose] noncomputable def chainSeed [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] @@ -134,6 +136,7 @@ noncomputable def chainSeed modTensorMap A (toSymPowModZero A M') (toSymPowModZero A M) /-- **The chain transition**: multiplication by the seed. -/ +@[expose] noncomputable def chainDelta [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] @@ -148,6 +151,7 @@ noncomputable def chainDelta chainMul A M M' k 0 /-- The stage units of the splitting chain. -/ +@[expose] noncomputable def chainUnitStage [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainIns/Base.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainIns/Base.lean index 4e087d2366..4440f03e77 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainIns/Base.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainIns/Base.lean @@ -34,7 +34,7 @@ the subject of [FirstSlot.lean](FirstSlot.lean) and symmetric multiplication, up to the arity transport. -/ -@[expose] public section +public section namespace RS @@ -51,6 +51,7 @@ section SymIns /-- **Left insertion into a symmetric power**: the module enters through the singleton power and multiplies. -/ +@[expose] noncomputable def symInsL [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainIns/FirstSlot.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainIns/FirstSlot.lean index ee5675ff20..f7d413f05a 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainIns/FirstSlot.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainIns/FirstSlot.lean @@ -23,7 +23,7 @@ transition. raising the merged arities by one on each side. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainIns/SecondSlot.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainIns/SecondSlot.lean index b1babd22d5..f021d0b574 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainIns/SecondSlot.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainIns/SecondSlot.lean @@ -23,7 +23,7 @@ proofs need are established first. raising the merged arities by one on each side. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainMul.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainMul.lean index b69d62c0c0..64b7cc9262 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainMul.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainMul.lean @@ -17,7 +17,7 @@ bundles; through the interchange, the tensor product of two chain stages multiplies into the chain stage of summed arity. -/ -@[expose] public section +public section namespace RS @@ -115,6 +115,7 @@ theorem symMulDesc_act /-- The descended symmetric multiplication as a map of modules. -/ +@[expose] noncomputable def symMulMod [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] @@ -128,6 +129,7 @@ noncomputable def symMulMod /-- One stage of the splitting chain: the module tensor product of matching symmetric powers of the dual pair. -/ +@[expose] noncomputable def chainStage [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] @@ -139,6 +141,7 @@ noncomputable def chainStage /-- **The chain multiplication**: two stages interchange and multiply into the stage of summed arity. -/ +@[expose] noncomputable def chainMul [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainMulHet.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainMulHet.lean index accd4c9351..ec0e4a42d1 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainMulHet.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainMulHet.lean @@ -23,7 +23,7 @@ isomorphisms. The defining equation on a pair of stages is cast-free because the stage inclusions absorb the index transports. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainMulLaws.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainMulLaws.lean index aa31746055..58ffff5e51 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainMulLaws.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainMulLaws.lean @@ -20,7 +20,7 @@ interchange `tensorμ`. Transports of chain stages along equalities of arities are packaged as `chainStageCast`. -/ -@[expose] public section +public section namespace RS @@ -36,6 +36,7 @@ variable {D : Type u} section StageCast /-- Transport of a chain stage along an equality of arities. -/ +@[expose] noncomputable def chainStageCast [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainNonzero.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainNonzero.lean index 52e64feb25..d1e052ce9b 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainNonzero.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainNonzero.lean @@ -22,7 +22,7 @@ powers (1.15.1), and the `δ` of a duality vanishes only on the zero module. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainShift.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainShift.lean index 81cd96f41f..14511c1d3a 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainShift.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainShift.lean @@ -22,7 +22,7 @@ family of legs absorbed by the transitions descends to the chain colimit, with the stage computation exposed as a simp lemma. -/ -@[expose] public section +public section namespace RS @@ -140,6 +140,7 @@ theorem ι_chainColimitUntail /-- Dropping the bottom stage of a chain does not change the colimit. -/ +@[expose] noncomputable def chainColimitTailIso [Category.{v} E] (B : ℕ → E) (δ : ∀ n, B n ⟶ B (n + 1)) [HasColimitsOfShape SmallNat.{v} E] : diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainStage2.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainStage2.lean index 9027b8238f..3531c396fa 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainStage2.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainStage2.lean @@ -20,7 +20,7 @@ seed transitions all restate the balanced machinery at two free indices; the substrate for the graded splitting algebra. -/ -@[expose] public section +public section namespace RS @@ -36,6 +36,7 @@ variable {D : Type u} /-- A two-index stage of the splitting chain: the module tensor product of independently sized symmetric powers of the dual pair. -/ +@[expose] noncomputable def chainStage2 [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] @@ -61,6 +62,7 @@ theorem chainStage2_diag section Stage2Cast /-- Transport of a two-index stage along equalities of arities. -/ +@[expose] noncomputable def chainStage2Cast [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] @@ -129,6 +131,7 @@ end Stage2Cast /-- **The two-index chain multiplication**: two stages interchange and multiply into the stage of the slotwise summed arities. -/ +@[expose] noncomputable def chainMul2 [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] @@ -1023,6 +1026,7 @@ section Chain2Delta /-- **The two-index chain transition**: multiplication by the seed, which raises both arities by one. -/ +@[expose] noncomputable def chainDelta2 [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainUnit.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainUnit.lean index 2e3716fc96..04cc4ae1d3 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainUnit.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ChainUnit.lean @@ -22,7 +22,7 @@ indexed by a universe-lifted copy of `ℕ`, the shape at which the ind-category is known to have filtered colimits. -/ -@[expose] public section +public section namespace RS @@ -34,6 +34,7 @@ universe v abbrev SmallNat : Type v := ULiftHom.{v} (ULift.{v} ℕ) /-- The equivalence between `ℕ` and its `v`-small copy. -/ +@[expose] noncomputable def smallNatEquiv : ℕ ≌ SmallNat.{v} := ULiftHomULiftCategory.equiv ℕ @@ -54,6 +55,7 @@ theorem unit_chainMap [SmallCategory C] [MonoidalCategory C] rw [chainMap_succ_of_le B δ hmn, ← Category.assoc, ih, hu] /-- The chain functor over the `v`-small copy of `ℕ`. -/ +@[expose] noncomputable def chainFunctorSmall [SmallCategory C] (B : ℕ → Ind C) (δ : ∀ n, B n ⟶ B (n + 1)) : SmallNat.{v} ⥤ Ind C := diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/CharSplit.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/CharSplit.lean index c7d419693d..d7b8411621 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/CharSplit.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/CharSplit.lean @@ -22,7 +22,7 @@ specialisation at a pointwise product of scalar sequences over pairs of shapes. -/ -@[expose] public section +public section namespace RS @@ -35,6 +35,7 @@ universe u /-- The completed cycle product of a prospective power-sum sequence: the product of `t` over the cycle type, completed by `t 1` over the fixed points. -/ +@[expose] noncomputable def cycleFun {n : ℕ} (t : ℕ → ℂ) (π : Equiv.Perm (Fin n)) : ℂ := (π.cycleType.map t).prod * (t 1) ^ (n - π.cycleType.sum) @@ -280,6 +281,7 @@ pullback representations, a nonnegative integer. -/ /-- The Kronecker multiplicity of three shapes of one size: the normalized triple class pairing of their recast Jacobi–Trudi characters. -/ +@[expose] noncomputable def kronMult {n : ℕ} (lam μ ν : Shape n) : ℂ := ((n.factorial : ℂ))⁻¹ * ∑ π : Equiv.Perm (Fin n), jtChar lam.val (permCast lam.prop.symm π) * diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/CommonAlgebra.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/CommonAlgebra.lean index 391ef0b476..76ea5260e3 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/CommonAlgebra.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/CommonAlgebra.lean @@ -21,7 +21,7 @@ The index type is put in bijection with a well-ordered one so that the slot order required by the tensor product is available. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/CoprodPreserve.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/CoprodPreserve.lean index a8ef0c8c86..3d17c668ad 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/CoprodPreserve.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/CoprodPreserve.lean @@ -21,7 +21,7 @@ ind-category, which is exact and preserves filtered colimits, and must be seen to preserve the coend presentations of §3. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/CountableDescent.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/CountableDescent.lean index b743f80ddb..da66c30ca9 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/CountableDescent.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/CountableDescent.lean @@ -60,7 +60,7 @@ diagram is dominated by a single stage, whence `RS.exists_factor_of_mix_hom_colimit`. -/ -@[expose] public section +public section namespace RS @@ -124,6 +124,7 @@ noncomputable abbrev presDiagram [SmallCategory C] /-- The structural map of a stage of the chosen presentation into the ind-object it presents. -/ +@[expose] noncomputable def presStage [SmallCategory C] (A : Ind C) (i : A.presentation.I) : indOf.obj (A.presentation.F.obj i) ⟶ A := @@ -254,6 +255,7 @@ theorem stageMul_spec presStage_naturality, mulStageMap_spec] /-- The stages of the generated tower. -/ +@[expose] noncomputable def towerIdx [SmallCategory C] [MonoidalCategory C] (A : Ind C) [MonObj A] (i₀ : A.presentation.I) : ℕ → A.presentation.I @@ -261,7 +263,7 @@ noncomputable def towerIdx | n + 1 => nextStage A (towerIdx A i₀ n) /-- The rungs of the generated tower, as objects of `C`. -/ -@[reducible] noncomputable def towerObj +@[expose, reducible] noncomputable def towerObj [SmallCategory C] [MonoidalCategory C] (A : Ind C) [MonObj A] (i₀ : A.presentation.I) (n : ℕ) : C := @@ -510,6 +512,7 @@ section ImageTower variable {C : Type v} /-- The rungs of the image tower. -/ +@[expose] noncomputable def imageRung [SmallCategory C] [MonoidalCategory C] [Abelian C] (A : Ind C) [MonObj A] (i₀ : A.presentation.I) @@ -525,6 +528,7 @@ noncomputable def imageRungStep stageImageMap A (stageStep A (towerIdx A i₀ n)) /-- The image tower as a diagram of ind-objects. -/ +@[expose] noncomputable def imageSeq [SmallCategory C] [MonoidalCategory C] [Abelian C] (A : Ind C) [MonObj A] (i₀ : A.presentation.I) : ℕ ⥤ Ind C := @@ -532,6 +536,7 @@ noncomputable def imageSeq /-- **The subalgebra generated by a stage, realised inside the algebra**: the colimit of the tower of images. -/ +@[expose] noncomputable def imageSubalgebra [SmallCategory C] [MonoidalCategory C] [Abelian C] (A : Ind C) [MonObj A] (i₀ : A.presentation.I) : Ind C := @@ -561,6 +566,7 @@ noncomputable def imageSubalgebraHom (Cocone.mk A (imageNatTrans A i₀))) /-- The rungs of the image tower map into it. -/ +@[expose] noncomputable def imageRungι [SmallCategory C] [MonoidalCategory C] [Abelian C] (A : Ind C) [MonObj A] (i₀ : A.presentation.I) @@ -645,6 +651,7 @@ variable {C : Type v} variable (C) in /-- **Embedded images**: the image in the ind-completion of a map out of an embedded object is again embedded. -/ +@[expose] def IndImageEmbedded [SmallCategory C] [Abelian C] : Prop := ∀ (Y : C) (Z : Ind C) (f : indOf.obj Y ⟶ Z), ∃ W : C, Nonempty (Limits.image f ≅ indOf.obj W) diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/CountableDescentClose.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/CountableDescentClose.lean index 2db6d4e8e8..fad33cc9ca 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/CountableDescentClose.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/CountableDescentClose.lean @@ -61,7 +61,7 @@ hypothesis discharged from finite length by `RS.indImageEmbedded_of_lengthLE`. -/ -@[expose] public section +public section namespace RS @@ -79,6 +79,7 @@ variable {C : Type v} /-- **Compactness of an ind-object**, phrased as in `RS.Classical.Deligne.IndCompact`: a morphism from the object into a filtered colimit factors through a stage of the diagram. -/ +@[expose] def IndCompactObj [SmallCategory C] (Y : Ind C) : Prop := ∀ {I : Type v} [SmallCategory I] [IsFiltered I] (D : I ⥤ Ind C) @@ -119,7 +120,7 @@ variable {C : Type v} /-- The cocone of the chosen presentation of an ind-object, with the ind-object itself as its point. -/ -@[simps! pt] +@[expose, simps! pt] noncomputable def presCocone [SmallCategory C] (A : Ind C) : Cocone (presDiagram A) := Cocone.mk A diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/CountableNullstellensatz.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/CountableNullstellensatz.lean index 53219babf0..174a97b458 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/CountableNullstellensatz.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/CountableNullstellensatz.lean @@ -34,7 +34,7 @@ The finite-type predecessor is `RS.exists_algHom_complex` in Zariski's lemma instead of the dimension count. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/CoverFactor.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/CoverFactor.lean index 3cbb25d010..53fe989e7a 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/CoverFactor.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/CoverFactor.lean @@ -19,7 +19,7 @@ permutation action through the identification to the committed plain equivariance. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/CycleSplit.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/CycleSplit.lean index b379ad961b..b93161ccac 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/CycleSplit.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/CycleSplit.lean @@ -26,7 +26,7 @@ expansion of a product of binomials, with subsets of the orbit set enumerating exactly the invariant subsets of the carrier. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/DayCalculus.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/DayCalculus.lean index 3249bd905a..a91731369e 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/DayCalculus.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/DayCalculus.lean @@ -33,7 +33,7 @@ the former preserves colimits pointwise because tensoring in `Type v` does, and the latter is a left adjoint. -/ -@[expose] public section +public section namespace RS @@ -49,12 +49,13 @@ variable {D : Type v} /-- Evaluation at `d` of the underlying functor, as a `Type`-valued functor on `D ⊛⥤ Type v`. Every corepresentability statement in this file corepresents a functor of this shape. -/ -def dayEvaluation [SmallCategory D] [MonoidalCategory D] +@[expose] def dayEvaluation [SmallCategory D] [MonoidalCategory D] (d : D) : (D ⊛⥤ Type v) ⥤ Type v := (equiv D (Type v)).functor ⋙ (evaluation D (Type v)).obj d /-- The corepresentable Day functor at `c` corepresents evaluation at `c`: the Yoneda lemma, read through the `DayFunctor` synonym. -/ +@[expose] def coyonedaDayCorepresentableBy [SmallCategory D] [MonoidalCategory D] (c : D) : (dayEvaluation c).CorepresentableBy @@ -79,6 +80,7 @@ external product of the two corepresentables, which is definitionally the corepresentable of the product category at `(a, b)`, so the Yoneda lemma evaluates. This is the co-Yoneda computation for Day convolution. -/ +@[expose] def dayCoyonedaCorepresentableBy [SmallCategory D] [MonoidalCategory D] (a b : D) : (dayEvaluation (a ⊗ b)).CorepresentableBy @@ -112,6 +114,7 @@ def dayCoyonedaCorepresentableBy [SmallCategory D] [MonoidalCategory D] /-- Day convolution of corepresentables: the Day tensor of the corepresentable functors at `a` and `b` is the corepresentable functor at `a ⊗ b`. -/ +@[expose] def dayCoyonedaIso [SmallCategory D] [MonoidalCategory D] (a b : D) : DayFunctor.mk (coyoneda.obj (Opposite.op a)) ⊗ @@ -124,6 +127,7 @@ def dayCoyonedaIso [SmallCategory D] [MonoidalCategory D] determined by an element of `F.functor.obj (𝟙_ D)`, via the universal property of the unit as a left Kan extension along `fromPUnit (𝟙_ D)`. -/ +@[expose] def dayUnitCorepresentableBy [SmallCategory D] [MonoidalCategory D] : (dayEvaluation (𝟙_ D)).CorepresentableBy (𝟙_ (D ⊛⥤ Type v)) where homEquiv {F} := @@ -142,6 +146,7 @@ def dayUnitCorepresentableBy [SmallCategory D] [MonoidalCategory D] : variable (D) in /-- The Day unit is the corepresentable functor at the monoidal unit of `D`. -/ +@[expose] def dayUnitIso [SmallCategory D] [MonoidalCategory D] : 𝟙_ (MonoidalCategory.DayFunctor D (Type v)) ≅ DayFunctor.mk (coyoneda.obj (Opposite.op (𝟙_ D))) := @@ -210,7 +215,7 @@ instance externalRightFunctor_preservesColimits [SmallCategory D] /-- The Day tensor, on underlying functors, is the left Kan extension of the external product along `tensor D`. -/ -@[simps] +@[expose, simps] def tensorObjLanIso [SmallCategory D] [MonoidalCategory D] (F G : D ⊛⥤ Type v) : (F ⊗ G).functor ≅ (tensor D).lan.obj (F.functor ⊠ G.functor) where diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/DayType.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/DayType.lean index 06c4a8ddd7..6c10dda800 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/DayType.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/DayType.lean @@ -36,7 +36,7 @@ The Mathlib imports above are deliberate exceptions to the reachable from it. -/ -@[expose] public section +public section namespace RS @@ -254,6 +254,7 @@ section Braided /-- The braiding on `C ⊛⥤ V`, inherited from the Day-convolution braiding of the underlying functors. -/ +@[expose] def dayFunctorBraiding [Category.{v₁} C] {V : Type u₂} [Category.{v₂} V] [MonoidalCategory C] [MonoidalCategory V] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/DeligneAssembly.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/DeligneAssembly.lean index ec08a8d1ec..d006437545 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/DeligneAssembly.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/DeligneAssembly.lean @@ -72,7 +72,7 @@ and `RS.evenEmbedLinear_scalarUnit` reads that off for the even embedding. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/DescentClose.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/DescentClose.lean index 8dac817357..154a039308 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/DescentClose.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/DescentClose.lean @@ -17,7 +17,7 @@ Over a zigzag datum the sandwich retract exists, so vanishing of a relative tensor power descends to the module itself. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/DevissageBound.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/DevissageBound.lean index 359792b310..a3eecaf291 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/DevissageBound.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/DevissageBound.lean @@ -22,7 +22,7 @@ the mixed sum forces the diagram to contain the cell recording the two counts. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/DoubledAbelian.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/DoubledAbelian.lean index 592b7c5ede..b7fcf70775 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/DoubledAbelian.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/DoubledAbelian.lean @@ -27,7 +27,7 @@ isomorphism, so both components of the comparison upstairs are isomorphisms, and `Doubled.isIso_of_components` concludes. -/ -@[expose] public section +public section namespace RS @@ -44,6 +44,7 @@ section Components variable {A : Type u} /-- The even-component functor `X ↦ X.even`. -/ +@[expose] def evenFunctor [Category.{v} A] : Doubled A ⥤ A where obj X := X.even map f := evenHom f @@ -51,6 +52,7 @@ def evenFunctor [Category.{v} A] : Doubled A ⥤ A where map_comp _ _ := rfl /-- The odd-component functor `X ↦ X.odd`. -/ +@[expose] def oddFunctor [Category.{v} A] : Doubled A ⥤ A where obj X := X.odd map f := oddHom f diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/DoubledGrowth.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/DoubledGrowth.lean index 5cd991d170..4075ea372e 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/DoubledGrowth.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/DoubledGrowth.lean @@ -47,7 +47,7 @@ in the doubling: the presentations produced here use mixed powers with no dual factors at all. -/ -@[expose] public section +public section namespace RS @@ -336,6 +336,7 @@ variable {A : Type u} /-- The diagonal embedding `M ↦ (M, M)`: the ambient object placed in both degrees at once. -/ +@[expose] def dbl [Category.{v} A] : A ⥤ Doubled A where obj M := ⟨M, M⟩ map f := homMk f f diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/DoubledLine.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/DoubledLine.lean index a47682b8f3..1ad7446f9f 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/DoubledLine.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/DoubledLine.lean @@ -19,7 +19,7 @@ general case of 2.11, where the category itself need not contain such an object. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/DoubledScalar.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/DoubledScalar.lean index 8836d8b918..37875b16b6 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/DoubledScalar.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/DoubledScalar.lean @@ -17,7 +17,7 @@ object in odd degree, so its endomorphisms are those of the unit downstairs: the scalar-unit hypothesis passes to the doubling. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/DoubledSmall.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/DoubledSmall.lean index eaea727fbd..e162cdb4b0 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/DoubledSmall.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/DoubledSmall.lean @@ -15,7 +15,7 @@ The doubling of a category is its product with itself: an object is a pair and a morphism is a pair. Essential smallness follows. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/DoubledSplit.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/DoubledSplit.lean index 2432e73812..27b0421752 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/DoubledSplit.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/DoubledSplit.lean @@ -20,7 +20,7 @@ simple algebra that splits the doubling is available, together with the complex point of its Γ-algebra. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/Doubling.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/Doubling.lean index f4d928aebc..3e64901d36 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/Doubling.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/Doubling.lean @@ -34,7 +34,7 @@ componentwise matrix checks against the distributor calculus set up in the `Distributors` section. -/ -@[expose] public section +public section namespace RS @@ -75,12 +75,12 @@ instance instCategory [Category.{v} A] : Category (Doubled A) where comp f g := ⟨f.even ≫ g.even, f.odd ≫ g.odd⟩ /-- The even component of a morphism of super-objects. -/ -def evenHom [Category.{v} A] +@[expose] def evenHom [Category.{v} A] {X Y : Doubled A} (f : X ⟶ Y) : X.even ⟶ Y.even := Hom.even f /-- The odd component of a morphism of super-objects. -/ -def oddHom [Category.{v} A] +@[expose] def oddHom [Category.{v} A] {X Y : Doubled A} (f : X ⟶ Y) : X.odd ⟶ Y.odd := Hom.odd f @@ -95,7 +95,7 @@ theorem hom_ext [Category.{v} A] /-- A morphism of super-objects from a pair of component morphisms. -/ -def homMk [Category.{v} A] +@[expose] def homMk [Category.{v} A] {X Y : Doubled A} (fe : X.even ⟶ Y.even) (fo : X.odd ⟶ Y.odd) : X ⟶ Y := ⟨fe, fo⟩ @@ -136,7 +136,7 @@ theorem oddHom_comp [Category.{v} A] /-- An isomorphism of super-objects from a pair of component isomorphisms. -/ -@[simps] +@[expose, simps] def isoMk [Category.{v} A] {X Y : Doubled A} (e : X.even ≅ Y.even) (o : X.odd ≅ Y.odd) : X ≅ Y where @@ -537,6 +537,7 @@ theorem tensorObj_odd [Category.{v} A] [MonoidalCategory A] [Preadditive A] rfl /-- The graded tensor product of morphisms, blockwise. -/ +@[expose] def tensorHom [Category.{v} A] [MonoidalCategory A] [Preadditive A] [HasBinaryBiproducts A] {X₁ Y₁ X₂ Y₂ : Doubled A} (f : X₁ ⟶ Y₁) @@ -546,6 +547,7 @@ def tensorHom [Category.{v} A] [MonoidalCategory A] [Preadditive A] (biprod.map (evenHom f ⊗ₘ oddHom g) (oddHom f ⊗ₘ evenHom g)) /-- Left whiskering of super-objects, blockwise. -/ +@[expose] def whiskerLeft [Category.{v} A] [MonoidalCategory A] [Preadditive A] [HasBinaryBiproducts A] (X : Doubled A) {Y₁ Y₂ : Doubled A} (g : Y₁ ⟶ Y₂) : @@ -555,6 +557,7 @@ def whiskerLeft [Category.{v} A] [MonoidalCategory A] [Preadditive A] (biprod.map (X.even ◁ oddHom g) (X.odd ◁ evenHom g)) /-- Right whiskering of super-objects, blockwise. -/ +@[expose] def whiskerRight [Category.{v} A] [MonoidalCategory A] [Preadditive A] [HasBinaryBiproducts A] {X₁ X₂ : Doubled A} (f : X₁ ⟶ X₂) (Y : Doubled A) : @@ -566,6 +569,7 @@ def whiskerRight [Category.{v} A] [MonoidalCategory A] [Preadditive A] /-- The even component of the associator: each of the four parity blocks re-associates through `A`'s associator and is routed to the matching block of the right-nested product. -/ +@[expose] def assocEven [Category.{v} A] [MonoidalCategory A] [Preadditive A] [MonoidalPreadditive A] [HasBinaryBiproducts A] (X Y Z : Doubled A) : @@ -698,6 +702,7 @@ theorem isZero_tensorZero [Category.{v} A] [MonoidalCategory A] [Preadditive A] /-- Collapse of a unit block against a zero block, in the shape of the left unitor components. -/ +@[expose] def leftUnitorComp [Category.{v} A] [MonoidalCategory A] [Preadditive A] [MonoidalPreadditive A] [HasBinaryBiproducts A] [HasZeroObject A] (M M' : A) : @@ -712,6 +717,7 @@ def leftUnitorComp [Category.{v} A] [MonoidalCategory A] [Preadditive A] /-- Collapse of a unit block against a zero block, in the shape of the even right unitor component. -/ +@[expose] def rightUnitorComp [Category.{v} A] [MonoidalCategory A] [Preadditive A] [MonoidalPreadditive A] [HasBinaryBiproducts A] [HasZeroObject A] (M M' : A) : @@ -1335,6 +1341,7 @@ instance [Category.{v} A] [Preadditive A] [HasZeroObject A] /-- The even embedding is monoidal up to isomorphism: the graded tensor of two even objects collapses to the even tensor. -/ +@[expose] def evenEmbedTensorIso [Category.{v} A] [MonoidalCategory A] [Preadditive A] [MonoidalPreadditive A] [HasBinaryBiproducts A] [HasZeroObject A] (X Y : A) : @@ -1358,6 +1365,7 @@ theorem evenEmbedTensorIso_braided simp /-- The unit comparison of the even embedding: definitional. -/ +@[expose] def evenEmbedUnitIso [Category.{v} A] [MonoidalCategory A] [Preadditive A] [MonoidalPreadditive A] [HasBinaryBiproducts A] [HasZeroObject A] : 𝟙_ (Doubled A) ≅ evenEmbed.obj (𝟙_ A) := @@ -1423,6 +1431,7 @@ end OddUnit section Biproducts /-- The componentwise binary bicone on a pair of super-objects. -/ +@[expose] def binaryBicone [Category.{v} A] [Preadditive A] [HasBinaryBiproducts A] (X Y : Doubled A) : BinaryBicone X Y where pt := ⟨X.even ⊞ Y.even, X.odd ⊞ Y.odd⟩ @@ -1519,6 +1528,7 @@ section Kernels /-- The componentwise kernel fork of a morphism of super-objects. -/ +@[expose] def kernelFork [Category.{v} A] [Preadditive A] [HasKernels A] {X Y : Doubled A} (f : X ⟶ Y) : KernelFork f := KernelFork.ofι @@ -1557,6 +1567,7 @@ section Cokernels /-- The componentwise cokernel cofork of a morphism of super-objects. -/ +@[expose] def cokernelCofork [Category.{v} A] [Preadditive A] [HasCokernels A] {X Y : Doubled A} (f : X ⟶ Y) : CokernelCofork f := diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/DualityMate.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/DualityMate.lean index 31c4bd18b9..6dc16d8de3 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/DualityMate.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/DualityMate.lean @@ -17,7 +17,7 @@ mate of its partner. A monoidal natural transformation between fibre functors supplies exactly this data at every object. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/EvenEmbedMonoidal.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/EvenEmbedMonoidal.lean index 6943a539bf..66744b5d8f 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/EvenEmbedMonoidal.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/EvenEmbedMonoidal.lean @@ -34,7 +34,7 @@ or out of the zero object is unique; so it preserves all limits and all colimits, in particular the finite ones. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ExactFromShort.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ExactFromShort.lean index 08092e703e..764f2efb0b 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ExactFromShort.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ExactFromShort.lean @@ -22,7 +22,7 @@ homology. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FactorialBeats.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FactorialBeats.lean index 261a6bc554..274939f330 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FactorialBeats.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FactorialBeats.lean @@ -26,7 +26,7 @@ least `1`, and it then suffices to pick `m` beyond both `3 * b ^ 2` exceeding the constant (so the spare factor `2 ^ m` swallows it). -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreAdditive.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreAdditive.lean index 150b191bbc..3cf4162636 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreAdditive.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreAdditive.lean @@ -23,7 +23,7 @@ the module objects, because the category of module objects carries no additive structure in this development. -/ -@[expose] public section +public section namespace RS @@ -37,6 +37,7 @@ variable {D : Type u} /-- **The fibre functor over an algebra**: base change, then realize. -/ +@[expose] noncomputable def fibreFun [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [Linear ℂ D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreBridge.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreBridge.lean index 0229ad1110..5d03891e72 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreBridge.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreBridge.lean @@ -18,7 +18,7 @@ the module objects, and once as a composite, so that the monoidal comparison could be read off. The two are the same functor. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreEps.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreEps.lean index d7832caf04..c9995add41 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreEps.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreEps.lean @@ -20,7 +20,7 @@ components it is composition with the inverse right unitor of the algebra. -/ -@[expose] public section +public section namespace RS @@ -35,6 +35,7 @@ variable {D : Type u} open SuperCommAlgebra.Mod /-- **The unit comparison of the fibre functor.** -/ +@[expose] noncomputable def fibreEpsIso [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [Linear ℂ D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreExact.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreExact.lean index b2eca1c734..93f2c86329 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreExact.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreExact.lean @@ -47,7 +47,7 @@ the ambient category; for `Ind C` it is supplied by counterpart. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreFaithful.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreFaithful.lean index 2947314e5c..dcf12627d1 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreFaithful.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreFaithful.lean @@ -19,7 +19,7 @@ after base change; and if the unit of the algebra is a monomorphism that is enough to kill the morphism itself. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreFunctor.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreFunctor.lean index bfa1f89f39..7862cd1c73 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreFunctor.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreFunctor.lean @@ -18,7 +18,7 @@ so `ω` is a functor from the category to the super modules over the Γ-algebra of the base. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreLinear.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreLinear.lean index ac979be316..8a21e9303b 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreLinear.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreLinear.lean @@ -17,7 +17,7 @@ is. This is the last field of `RS.DeligneFibreFunctor` that the fibre construction does not supply on its own. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreMix.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreMix.lean index 2c8acac52c..207e303b33 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreMix.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreMix.lean @@ -19,7 +19,7 @@ contributes the algebra and the line contributes its parity shift, and the fibre functor is additive. -/ -@[expose] public section +public section namespace RS @@ -34,6 +34,7 @@ variable {D : Type u} attribute [local instance] CategoryTheory.ModObj.regular /-- **The free super module of rank `(p | q)`.** -/ +@[expose] noncomputable def superFree [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [Linear ℂ D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreMonoidal.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreMonoidal.lean index db86d2e8c4..866e5ccf51 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreMonoidal.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreMonoidal.lean @@ -51,7 +51,7 @@ a separate matter and is not assumed here, so the strong notions `Functor.Monoidal` and `Functor.Braided` are not instantiated. -/ -@[expose] public section +public section namespace RS @@ -415,6 +415,7 @@ open SuperCommAlgebra.Mod /-- **The fibre functor over an algebra**: base change to the algebra followed by realization. -/ +@[expose] noncomputable def fibreOver [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [Linear ℂ D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreMu.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreMu.lean index 551627b498..1707ea8d71 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreMu.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreMu.lean @@ -23,7 +23,7 @@ formula, which is what makes the coherence of `ω` a computation in the ambient category alone. -/ -@[expose] public section +public section namespace RS @@ -38,6 +38,7 @@ variable {D : Type u} open SuperCommAlgebra.Mod /-- **The monoidal comparison of the fibre functor.** -/ +@[expose] noncomputable def fibreMu [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [Linear ℂ D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreMuNat.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreMuNat.lean index 4f1241f079..c2e240f03c 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreMuNat.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreMuNat.lean @@ -16,7 +16,7 @@ monoidal comparison of the fibre functor inherits that naturality directly on the generators of the tensor product of super modules. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreOverComplex.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreOverComplex.lean index 6fc1dcfdec..2eeb1f11b9 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreOverComplex.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreOverComplex.lean @@ -69,7 +69,7 @@ of a mixed object as a free super module. steps 1 to 5. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreOverSplitting.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreOverSplitting.lean index 5dd5e1b432..bf71ea1624 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreOverSplitting.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreOverSplitting.lean @@ -33,7 +33,7 @@ consume. The variable block therefore names the symmetry of `Ind C` only, matching `RS.Classical.Deligne.UniversalAlgebra`. -/ -@[expose] public section +public section namespace RS @@ -46,7 +46,7 @@ variable {C : Type v} /-- **The restricted fibre functor is strong monoidal** over an algebra that splits the embedded objects. -/ -@[implicit_reducible] +@[expose, implicit_reducible] noncomputable def indFibreMonoidal [SmallCategory C] [MonoidalCategory C] [Abelian C] [CategoryTheory.Linear ℂ (Ind C)] [MonoidalPreadditive (Ind C)] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreRestrict.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreRestrict.lean index 3f6e3ab74c..d6949f0802 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreRestrict.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreRestrict.lean @@ -19,7 +19,7 @@ functor; the composite of that functor with the fibre functor is then strong monoidal. -/ -@[expose] public section +public section namespace RS @@ -34,6 +34,7 @@ variable {D : Type u} /-- **The algebra splits the image of a functor**: every object in the image becomes a mixed sum of copies of the unit and of the odd line after base change. -/ +@[expose] def SplitsOn [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [HasFiniteBiproducts D] (L : OddLine D) (R : D) [MonObj R] {C : Type u₂} [Category.{v₂} C] (F : C ⥤ D) : Prop := @@ -41,7 +42,7 @@ def SplitsOn [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] Nonempty (freeMod R (F.obj X) ≅ freeMod R (L.mix p q)) /-- **The restricted fibre functor is strong monoidal.** -/ -@[implicit_reducible] +@[expose, implicit_reducible] noncomputable def fibreRestrictMonoidal [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [Linear ℂ D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreStrong.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreStrong.lean index a38dfe6f5f..e8b20670d8 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreStrong.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FibreStrong.lean @@ -19,7 +19,7 @@ unit comparison is invertible outright. The lax symmetric monoidal structure of the fibre functor is therefore strong. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FiltNil.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FiltNil.lean index c795dc2b82..4cfc8fd18a 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FiltNil.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FiltNil.lean @@ -38,7 +38,7 @@ The shift hypothesis is phrased with `End.asHom f`, so consumers supply factorisations of the morphism `(F k).arrow ≫ End.asHom f`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FlatLimit.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FlatLimit.lean index 6d51d204d3..6326720cfd 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FlatLimit.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FlatLimit.lean @@ -57,7 +57,7 @@ matrix — in particular the base change `Rⱼ ⊗_{R_{i₀}} M_{i₀}` — is projective, hence flat. -/ -@[expose] public section +public section namespace RS namespace FlatLimit diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeCollapseAlg.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeCollapseAlg.lean index df3588ddc6..156271697e 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeCollapseAlg.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeCollapseAlg.lean @@ -17,7 +17,7 @@ letters becomes, after collapsing the heads, the action on the ambient word under the head. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeMixRetract.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeMixRetract.lean index e9f161d5dc..31a6be8375 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeMixRetract.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeMixRetract.lean @@ -19,7 +19,7 @@ additivity argument without ever forming a biproduct in the category of module objects. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeModAdjoint.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeModAdjoint.lean index bc817e9e73..752100d228 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeModAdjoint.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeModAdjoint.lean @@ -36,7 +36,7 @@ language of `A ⊗ X` and a bare action morphism, and are transported into the category of module objects by definitional unfolding. -/ -@[expose] public section +public section namespace RS @@ -112,6 +112,7 @@ theorem freeModHom_lin [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] /-- **The free–forgetful adjunction bijection for module objects**: module maps out of the free module on `X` are maps out of `X`, by restriction along the unit. -/ +@[expose] noncomputable def freeModHomEquiv [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] (X : D) (M : Mod D A) : diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeModBiprod.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeModBiprod.lean index 852193f9a0..37bc620faf 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeModBiprod.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeModBiprod.lean @@ -27,7 +27,7 @@ The vanishing of the free module on a zero object completes the bookkeeping of the empty mixed sum. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeModFunctor.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeModFunctor.lean index a8c3410b3f..e54eb93f92 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeModFunctor.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeModFunctor.lean @@ -20,7 +20,7 @@ comparison of the ambient category, and realization carries the comparison of (2.11.1). -/ -@[expose] public section +public section namespace RS @@ -47,6 +47,7 @@ theorem freeModMap_comp [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] exact MonoidalCategory.whiskerLeft_comp A f g /-- **Base change to an algebra, as a functor.** -/ +@[expose] noncomputable def freeModFunctor [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] : D ⥤ Mod D A where obj V := freeMod A V diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeModShuffle.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeModShuffle.lean index d90b2a74e2..a516fcf978 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeModShuffle.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeModShuffle.lean @@ -19,7 +19,7 @@ modules: the bookkeeping of the mixed free part of the dévissage decomposition. -/ -@[expose] public section +public section namespace RS @@ -43,6 +43,7 @@ theorem freeModUnit_linear B ◁ (ρ_ B).hom from by monoidal] /-- **The free module on the unit is the regular module.** -/ +@[expose] noncomputable def freeModUnitIso [Category.{v} D] [MonoidalCategory D] (B : D) [MonObj B] : freeMod B (𝟙_ D) ≅ regularMod B where @@ -171,6 +172,7 @@ noncomputable def freeModBiprodIso end Biprod /-- The free module on an isomorphism. -/ +@[expose] noncomputable def freeModMapIso [Category.{v} D] [MonoidalCategory D] (B : D) [MonObj B] {V W : D} (e : V ≅ W) : diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeModShuffleCoh.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeModShuffleCoh.lean index 95dc392ae5..91b4439b9e 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeModShuffleCoh.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeModShuffleCoh.lean @@ -37,7 +37,7 @@ generator, and that double twist is not the identity. Accordingly is the interchange identity `RS.tensorμ_braiding` behind it. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeModTensor.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeModTensor.lean index cf7338a3ce..776375544a 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeModTensor.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeModTensor.lean @@ -27,7 +27,7 @@ first generator past the second algebra factor. `RS.gpair`, as the shuffle. -/ -@[expose] public section +public section namespace RS @@ -44,6 +44,7 @@ variable {D : Type u} /-- The braided coherence morphism carrying a generator past a scalar: `(R ⊗ V) ⊗ R ⟶ (R ⊗ R) ⊗ V`. -/ +@[expose] def freeModSlide [Category.{v} D] [MonoidalCategory D] [BraidedCategory D] (R : D) (V : D) : (R ⊗ V) ⊗ R ⟶ (R ⊗ R) ⊗ V := diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeNormalise.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeNormalise.lean index bc74b574e5..97f9eeb137 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeNormalise.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeNormalise.lean @@ -24,7 +24,7 @@ and under it the descended group-algebra action becomes the ambient action under the head. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeNormaliseBase.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeNormaliseBase.lean index 81e3f49827..6364e5d772 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeNormaliseBase.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeNormaliseBase.lean @@ -16,7 +16,7 @@ the single head is already at the front, and re-inserting it puts it back where it was. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeNormaliseStep.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeNormaliseStep.lean index 29c4c59917..61baed29d0 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeNormaliseStep.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeNormaliseStep.lean @@ -31,7 +31,7 @@ products are formed in the same order on both sides, so no commutativity is needed for the step. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreePow.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreePow.lean index cc432a746a..d3c6c30081 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreePow.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreePow.lean @@ -26,7 +26,7 @@ for the whole file; the statements of record are spelt at the carrier `A ⊗ V` with that instance. -/ -@[expose] public section +public section namespace RS @@ -44,6 +44,7 @@ section Fold /-- **The multiplication fold**: the left-to-right product `tensorPow D A n ⟶ A`, one factor at a time; the empty product is the unit. -/ +@[expose] noncomputable def muFold [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] : (n : ℕ) → tensorPow D A n ⟶ A @@ -157,6 +158,7 @@ section Collect /-- **The free collapse**: multiply all the heads of a power of free letters to the front of the word. -/ +@[expose] noncomputable def freeCollapse [Category.{v} D] [MonoidalCategory D] [BraidedCategory D] (A : D) [MonObj A] (V : D) : (n : ℕ) → diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreePowDesc.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreePowDesc.lean index 888370971f..a112674518 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreePowDesc.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreePowDesc.lean @@ -40,7 +40,7 @@ carrier is spelt `(freeMod A V).X` so that instance synthesis finds it. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreePowInsert.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreePowInsert.lean index 5951abd797..d39b435854 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreePowInsert.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreePowInsert.lean @@ -29,7 +29,7 @@ interchange, and the folded unit word contributes only a left unitor. -/ -@[expose] public section +public section namespace RS @@ -44,6 +44,7 @@ variable {D : Type u} /-- The unit word: the empty product of units in an ambient power. -/ +@[expose] noncomputable def unitWord [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] : (n : ℕ) → (𝟙_ D ⟶ tensorPow D A n) @@ -56,6 +57,7 @@ noncomputable def unitWord [Category.{v} D] [MonoidalCategory D] /-- Insert the monoid unit into every letter of an ambient power. -/ +@[expose] noncomputable def freeUnitPow [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] (V : D) : (n : ℕ) → (tensorPow D V n ⟶ tensorPow D (A ⊗ V) n) @@ -174,6 +176,7 @@ private theorem unitTensorμ /-- **The free insertion**: carry the head into the top letter of the word and fill every other letter with the unit. -/ +@[expose] noncomputable def freeInsert [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] (A : D) [MonObj A] (V : D) (n : ℕ) : diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeSlide.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeSlide.lean index 89ad9c9923..7f91766387 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeSlide.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeSlide.lean @@ -18,7 +18,7 @@ power says exactly that the slide is invisible after the projection. -/ -@[expose] public section +public section namespace RS @@ -31,6 +31,7 @@ variable {D : Type u} /-- **Splitting the head off a free letter**: the head becomes a trailing scalar and the letter keeps the unit. -/ +@[expose] noncomputable def freeSplit [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] (A : D) [MonObj A] (V : D) : (A ⊗ V) ⟶ (A ⊗ V) ⊗ A := @@ -57,6 +58,7 @@ theorem freeSplit_actRight /-- **The slide window**: split the head off the first letter and act with it on the second. -/ +@[expose] noncomputable def freeSlideWin [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] (A : D) [MonObj A] (V : D) : @@ -113,6 +115,7 @@ theorem freeSlideWin_modPowπ /-- **The top slide**: slide the head of the penultimate letter into the last one. -/ +@[expose] noncomputable def freeSlideTop [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] (A : D) [MonObj A] (V : D) diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeSummand.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeSummand.lean index 5e7eef08e7..07cf4b41c0 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeSummand.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeSummand.lean @@ -19,7 +19,7 @@ split off further mixed sums, and consequently a direct summand of a free mixed module is again a free mixed module. -/ -@[expose] public section +public section namespace RS @@ -153,6 +153,7 @@ section Line variable {D : Type u} /-- Whiskering an object twice by the line returns the object. -/ +@[expose] noncomputable def OddLine.rot [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] (L : OddLine D) diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeTwistPi.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeTwistPi.lean index 4195f4a8ab..4fc7315919 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeTwistPi.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/FreeTwistPi.lean @@ -23,7 +23,7 @@ carries the algebra past the generator, reassociates, and acts. consumes. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaAlgebra.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaAlgebra.lean index 0b9996b12a..4fed1dd16d 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaAlgebra.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaAlgebra.lean @@ -37,7 +37,7 @@ coherence alone: it is the first triangle identity of the self-duality of the odd line, `RS.OddLine.evaluation_coevaluation`. -/ -@[expose] public section +public section namespace RS @@ -55,6 +55,7 @@ variable {D : Type u} /-- The *convolution product* of two morphisms into a monoid object, taken at arbitrary sources: tensor the two morphisms and multiply. -/ +@[expose] noncomputable def gmul [Category.{v} D] [MonoidalCategory D] {R : D} [MonObj R] {X Y : D} (a : X ⟶ R) (b : Y ⟶ R) : X ⊗ Y ⟶ R := @@ -181,6 +182,7 @@ transported along a chosen morphism `s` from the intended source into the tensor product of the two given sources. The four graded multiplication blocks of `RS.gammaAlgebra` are the four instances of this construction. -/ +@[expose] noncomputable def gmulLin [Category.{v} D] [MonoidalCategory D] {R : D} [MonObj R] [Preadditive D] [MonoidalPreadditive D] [Linear ℂ D] [MonoidalLinear ℂ D] @@ -231,6 +233,7 @@ product of the two sources involved: the left unitor for even-even and even-odd, the right unitor for odd-even, and the square trivialisation `L.sq` of the odd line for odd-odd. The Koszul sign of `comm_oo` is exactly `RS.OddLine.braid_neg`. -/ +@[expose] noncomputable def gammaAlgebra (D : Type u) [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [Linear ℂ D] [MonoidalLinear ℂ D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaBiprod.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaBiprod.lean index 7337ddb72a..f573c63e0b 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaBiprod.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaBiprod.lean @@ -18,7 +18,7 @@ morphisms, and the action on a biproduct is componentwise, so the realization of a biproduct is the biproduct of the realizations. -/ -@[expose] public section +public section namespace RS @@ -30,6 +30,7 @@ variable {D : Type u} /-- The comparison of the realization of a biproduct with the biproduct of the realizations. -/ +@[expose] noncomputable def gammaBiprodMap [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [CategoryTheory.Linear ℂ D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaComplex.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaComplex.lean index 0041dc6e34..71c763bd15 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaComplex.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaComplex.lean @@ -24,7 +24,7 @@ the free-module functor is then full and faithful on the mixed objects, and idempotents split with free image. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaCountable.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaCountable.lean index 58ea776dcc..7f52f96f05 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaCountable.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaCountable.lean @@ -63,7 +63,7 @@ the countable Nullstellensatz, as a ℂ-point of the Γ-algebra (`RS.nonempty_superPoint_gammaAlgebra`). -/ -@[expose] public section +public section namespace RS @@ -243,6 +243,7 @@ variable {C : Type v} variable (C) in /-- ℂ-linearity of the embedding `C ⥤ Ind C`, as a hypothesis on the ambient linear structure of the ind-completion. -/ +@[expose] def IndOfLinear [SmallCategory C] [Abelian C] [CategoryTheory.Linear ℂ C] [CategoryTheory.Linear ℂ (Ind C)] : Prop := ∀ (X Y : C) (c : ℂ) (f : X ⟶ Y), @@ -312,6 +313,7 @@ variable {C : Type v} is the colimit of a countable filtered diagram of embedded objects. This is the shape in which "built from countably much data" enters the dimension count of the Γ-algebra. -/ +@[expose] def CountablyPresented [SmallCategory C] (Z : Ind C) : Prop := ∃ (I : Type v) (_ : SmallCategory I) (_ : IsFiltered I) diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaModule.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaModule.lean index 2c1b2b74ab..ff062e23fc 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaModule.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaModule.lean @@ -37,7 +37,7 @@ first triangle identity of the self-duality of the odd line, `RS.OddLine.evaluation_coevaluation`. -/ -@[expose] public section +public section namespace RS @@ -113,6 +113,7 @@ variable {D : Type u} /-- The *convolution action* of a morphism into a monoid object on a morphism into a module object, taken at arbitrary sources: tensor the two morphisms and act. -/ +@[expose] noncomputable def gact [Category.{v} D] [MonoidalCategory D] {R : D} [MonObj R] {M : D} [ModObj R M] @@ -238,6 +239,7 @@ transported along a chosen morphism `s` from the intended source into the tensor product of the two given sources. The four graded action blocks of `RS.gammaModule` are the four instances of this construction. -/ +@[expose] noncomputable def gactLin [Category.{v} D] [MonoidalCategory D] {R : D} [MonObj R] {M : D} [ModObj R M] [Preadditive D] [MonoidalPreadditive D] [Linear ℂ D] @@ -292,6 +294,7 @@ coherence isomorphisms that identify the sources in `RS.gammaAlgebra`: the left unitor for even-even and even-odd, the right unitor for odd-even, and the square trivialisation `L.sq` of the odd line for odd-odd. -/ +@[expose] noncomputable def gammaModule (D : Type u) [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [Linear ℂ D] [MonoidalLinear ℂ D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaModuleFunctor.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaModuleFunctor.lean index b68a40553c..11f5cb403f 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaModuleFunctor.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaModuleFunctor.lean @@ -16,7 +16,7 @@ module objects over a fixed commutative monoid object: the realization of a module map is postcomposition. -/ -@[expose] public section +public section namespace RS @@ -27,6 +27,7 @@ universe v u variable {D : Type u} /-- **Realization, as a functor on module objects.** -/ +@[expose] noncomputable def gammaModuleFunctor [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [CategoryTheory.Linear ℂ D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaPair.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaPair.lean index 27f0b1ac74..d01cffcb54 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaPair.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaPair.lean @@ -57,7 +57,7 @@ self-duality of the odd line, `RS.OddLine.evaluation_coevaluation`. -/ -@[expose] public section +public section namespace RS @@ -75,6 +75,7 @@ variable {D : Type u} /-- The *pairing* of a morphism into one module object with a morphism into another, taken at arbitrary sources: tensor the two morphisms and project to the relative tensor product. -/ +@[expose] noncomputable def gpair [Category.{v} D] [MonoidalCategory D] [BraidedCategory D] [HasCoequalizers D] {R : D} [MonObj R] {M : Mod D R} {N : Mod D R} @@ -167,6 +168,7 @@ along a chosen morphism `s` from the intended source into the tensor product of the two given sources. The four graded blocks of the comparison map of `RS.gammaPairComparison` are the four instances of this construction. -/ +@[expose] noncomputable def gpairLin [Category.{v} D] [MonoidalCategory D] [BraidedCategory D] [HasCoequalizers D] {R : D} [MonObj R] [Preadditive D] @@ -1028,6 +1030,7 @@ source identifications, and they descend by the universal property of `RS.SuperCommAlgebra.Mod.tensor` because the eight balancing laws hold; that they are morphisms of super modules is the eight action laws. -/ +@[expose] noncomputable def gammaPairComparison [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [Linear ℂ D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaPairAdd.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaPairAdd.lean index f3fa3d2592..ac1a3cb816 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaPairAdd.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaPairAdd.lean @@ -21,7 +21,7 @@ identity. These are what let a decomposition of a module object into a finite family of retracts be pushed through the comparison. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaPairFreeFree.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaPairFreeFree.lean index cc44bda574..4b59813044 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaPairFreeFree.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaPairFreeFree.lean @@ -19,7 +19,7 @@ any pair of free modules whose objects become mixed sums after base change. Every case but the odd line against itself is a unitor. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaPairFreeMix.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaPairFreeMix.lean index 18c94ddd98..d82a619aed 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaPairFreeMix.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaPairFreeMix.lean @@ -21,7 +21,7 @@ is the left unitor of `RS.gammaPairComparison_unitLeft`; the odd line is passed in as a hypothesis and discharged separately. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaPairNat.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaPairNat.lean index a8db21ecb5..ee87b38a9c 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaPairNat.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaPairNat.lean @@ -50,7 +50,7 @@ reduces the naturality square to exactly those four instances. the two module objects. -/ -@[expose] public section +public section namespace RS @@ -164,6 +164,7 @@ theorem SuperCommAlgebra.Mod.comp_oddMap_apply (a : P ⟶ Q) (a ≫ b).oddMap t = b.oddMap (a.oddMap t) := rfl /-- The tensor product of two isomorphisms of super modules. -/ +@[expose] noncomputable def SuperCommAlgebra.Mod.tensorIso (a : P ≅ P') (b : Q ≅ Q') : P.tensor Q ≅ P'.tensor Q' where hom := SuperCommAlgebra.Mod.tensorHom a.hom b.hom diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaPairRetract.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaPairRetract.lean index 07a7a281c0..52246d58c4 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaPairRetract.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaPairRetract.lean @@ -21,7 +21,7 @@ cases; it needs no biproducts in the category of module objects, only the retraction identities and the totality of the projectors. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaPairRetractRight.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaPairRetractRight.lean index ba59c72f8c..ee13a5a0fb 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaPairRetractRight.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaPairRetractRight.lean @@ -18,7 +18,7 @@ sense, transports invertibility of the comparison map of Deligne's (2.11.1) in exactly the same way. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaPairUnit.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaPairUnit.lean index bd6dd347b6..a3c675ca73 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaPairUnit.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaPairUnit.lean @@ -28,7 +28,7 @@ module element on the odd-odd block braids `L` past `L`, which is `−1`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaShift.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaShift.lean index c91b33af16..0f1f68e509 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaShift.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaShift.lean @@ -33,7 +33,7 @@ compatibilities is that lemma conjugated by the very coherence isomorphisms that identify the sources in `RS.gammaAlgebra`. -/ -@[expose] public section +public section namespace RS @@ -53,6 +53,7 @@ variable {D : Type u} /-- **The odd cap**: contract the two twisting legs of a doubly twisted object against the square trivialisation of the odd line. -/ +@[expose] def OddLine.cap [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] (L : OddLine D) (Z : D) : @@ -194,6 +195,7 @@ variable {D : Type u} parity swaps of `RS.RhoTwist` intertwine the four action blocks of the Γ-module of the free module on the odd line with the four relabelled blocks of the parity shift of the Γ-module of `R`. -/ +@[expose] noncomputable def gammaShiftHom [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [CategoryTheory.Linear ℂ D] @@ -241,6 +243,7 @@ noncomputable def gammaShiftHom /-- **The realization of an odd twist is the parity shift of the realization**: the Γ-module of the free `R`-module on the odd line is the parity shift of the Γ-module of `R`. -/ +@[expose] noncomputable def gammaShiftIso [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [CategoryTheory.Linear ℂ D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaTwistLeft.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaTwistLeft.lean index bad948b79c..5bb684c3d4 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaTwistLeft.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/GammaTwistLeft.lean @@ -36,7 +36,7 @@ line, which is `−1`. The sign is absorbed once and for all into the odd component `RS.gammaTwistLeftOdd`. -/ -@[expose] public section +public section namespace RS @@ -83,6 +83,7 @@ variable {D : Type u} /-- **The left odd cap**: contract the two leading legs of a doubly twisted object against the square trivialisation of the odd line. -/ +@[expose] def OddLine.capL [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] (L : OddLine D) (Z : D) : diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/GeneratorAlgebra.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/GeneratorAlgebra.lean index c5aeed5449..892e4f0744 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/GeneratorAlgebra.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/GeneratorAlgebra.lean @@ -32,7 +32,7 @@ its scalars a field of countable dimension over the complex numbers, hence the complex numbers themselves. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/GrowthDichotomy.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/GrowthDichotomy.lean index 6f5ce7c223..4e60872d0c 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/GrowthDichotomy.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/GrowthDichotomy.lean @@ -31,7 +31,7 @@ the central idempotents at each size — are named `Prop`s here and discharged for the tree's package where the block theory lives. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/HomFinite.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/HomFinite.lean index e5d9aed22a..1271604732 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/HomFinite.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/HomFinite.lean @@ -34,7 +34,7 @@ to the unit, and is the line `End (𝟙_ A) = ℂ` when it is — the scalar-unit hypothesis read as a ℂ-linear equivalence. -/ -@[expose] public section +public section namespace RS @@ -55,6 +55,7 @@ section ScalarEnd variable {A : Type u} /-- Scaling the identity of the tensor unit, as a ℂ-linear map. -/ +@[expose] def unitScalarMap [Category.{v} A] [Preadditive A] [Linear ℂ A] [MonoidalCategory A] : ℂ →ₗ[ℂ] (𝟙_ A ⟶ 𝟙_ A) where @@ -65,6 +66,7 @@ def unitScalarMap /-- **The scalars exhaust the unit endomorphisms**, as a ℂ-linear equivalence `ℂ ≃ₗ End (𝟙_ A)`: this is exactly the content of `HasScalarUnit`, packaged linearly. -/ +@[expose] noncomputable def unitEndEquiv [Category.{v} A] [Preadditive A] [Linear ℂ A] [MonoidalCategory A] (hu : HasScalarUnit A) : diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/HookMult.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/HookMult.lean index 6cfe2ef27f..114601c9c8 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/HookMult.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/HookMult.lean @@ -22,7 +22,7 @@ number, so every term vanishes; hook positivity makes the two specialisation factors nonzero, killing the multiplicity. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/HookZero.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/HookZero.lean index 388787ac5b..79b1335f62 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/HookZero.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/HookZero.lean @@ -25,7 +25,7 @@ those rows live in a `p`-dimensional coordinate subspace, are linearly dependent, and the determinant is zero. -/ -@[expose] public section +public section namespace RS @@ -66,6 +66,7 @@ theorem det_hookColOp (p ℓ : ℕ) : (hookColOp p ℓ).det = 1 := by · omega /-- The Jacobi–Trudi matrix of a row-length list. -/ +@[expose] noncomputable def jtMatrix (t : ℕ → ℂ) (rows : List ℕ) : Matrix (Fin rows.length) (Fin rows.length) ℂ := Matrix.of fun i j : Fin rows.length => diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IdemCut.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IdemCut.lean index a9cec51a0f..a7c9638e8e 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IdemCut.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IdemCut.lean @@ -38,7 +38,7 @@ interface are plugged in elsewhere. the alternating power, definitionally. -/ -@[expose] public section +public section namespace RS @@ -54,6 +54,7 @@ variable {D : Type u} section IdemCut /-- A group-algebra element acting on the module power. -/ +@[expose] noncomputable def modPowCutIdem [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] (A : D) [MonObj A] (X : D) [ModObj A X] [Preadditive D] [HasFiniteBiproducts D] @@ -81,6 +82,7 @@ idempotency splits it off as a direct summand of the module power, with section `modPowCutσ`; this presentation is chosen because consumers build morphisms out of the cut by descent along `modPowCutπ` and morphisms into it through the section. -/ +@[expose] noncomputable def modPowCut [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] (A : D) [MonObj A] (X : D) [ModObj A X] [Preadditive D] [HasFiniteBiproducts D] @@ -343,6 +345,7 @@ noncomputable def modPowCutModObj mul_smul := modPowCutAct_mul A X n e he /-- The cut of a module, bundled as a module. -/ +@[expose] noncomputable def modPowCutMod [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] (A : D) [MonObj A] (X : D) [ModObj A X] [Preadditive D] [HasFiniteBiproducts D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IdempotentLength.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IdempotentLength.lean index 001187f9ca..d8e8dffa54 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IdempotentLength.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IdempotentLength.lean @@ -26,7 +26,7 @@ increasing: a collapse of consecutive kernels would factor orthogonality, contradicting `f (n + 1) ≠ 0`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ImageSubalgebra.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ImageSubalgebra.lean index 6814003aa1..473e7db503 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ImageSubalgebra.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ImageSubalgebra.lean @@ -49,7 +49,7 @@ cancels, so each reduces to the corresponding law in `A`. This is and, over a symmetric `C`, `IsCommMonObj` of the same. -/ -@[expose] public section +public section namespace RS @@ -129,7 +129,7 @@ theorem mul_comm_of_mono IsCommMonObj.mul_comm] /-- **A subobject closed under the operations is an algebra.** -/ -@[reducible] def monObjOfMono +@[expose, reducible] def monObjOfMono [Category.{w} D] [MonoidalCategory D] {S : D} {A : D} [MonObj A] (k : S ⟶ A) [Mono k] (m : S ⊗ S ⟶ S) (e : 𝟙_ D ⟶ S) (hm : m ≫ k = (k ⊗ₘ k) ≫ μ[A]) @@ -233,7 +233,7 @@ variable {C : Type v} /-- The image tower, read as a diagram over the ambient-universe copy of the natural numbers. -/ -@[reducible] noncomputable def imageDiagram +@[expose, reducible] noncomputable def imageDiagram [SmallCategory C] [MonoidalCategory C] [Abelian C] (A : Ind C) [MonObj A] (i₀ : A.presentation.I) : Tower.{v} ⥤ Ind C := AsSmall.down ⋙ imageSeq A i₀ diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndAllColim.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndAllColim.lean index b0111ffa91..45038b86c1 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndAllColim.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndAllColim.lean @@ -20,7 +20,7 @@ which the coend presentations of §3 pass through the tensor product. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndBigTensorUnit.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndBigTensorUnit.lean index 721f8de236..1d8354d097 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndBigTensorUnit.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndBigTensorUnit.lean @@ -21,7 +21,7 @@ algebras with nonvanishing units again has a nonvanishing unit — the step Deligne asserts without proof in 2.11. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndCoeq.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndCoeq.lean index b869dbae1a..5bf8239699 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndCoeq.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndCoeq.lean @@ -71,7 +71,7 @@ The acceptance tests confirm that the cokernel and kernel comparison isomorphisms of both tensoring functors synthesize. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndCompact.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndCompact.lean index 3fe5f68179..8c07184579 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndCompact.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndCompact.lean @@ -38,7 +38,7 @@ of a filtered colimit of types (`Types.jointly_surjective'`, `Types.FilteredColimit.colimit_eq_iff`). -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndDayClosure.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndDayClosure.lean index 894cc4a8c5..7e5f281847 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndDayClosure.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndDayClosure.lean @@ -36,7 +36,7 @@ two colimit steps are the same manoeuvre, factored out as `RS.isIndObject_obj_of_preservesColimits`. -/ -@[expose] public section +public section namespace RS @@ -51,6 +51,7 @@ variable {C : Type v} /-- Transport an isomorphism of plain presheaves to the Day synonym category. -/ +@[expose] def dayMkIso [SmallCategory C] [MonoidalCategory C] {A B : Cᵒᵖ ⥤ Type v} (e : A ≅ B) : (DayFunctor.mk A : Cᵒᵖ ⊛⥤ Type v) ≅ DayFunctor.mk B := @@ -68,6 +69,7 @@ presheaves at `x` and `y` is the yoneda presheaf at `x ⊗ y`. This is `RS.dayCoyonedaIso` at the base `Cᵒᵖ`, transported along `Coyoneda.objOpOp`, using that `op x ⊗ op y = op (x ⊗ y)` holds definitionally in `Cᵒᵖ`. -/ +@[expose] def dayYonedaIso [SmallCategory C] [MonoidalCategory C] (x y : C) : (DayFunctor.mk (yoneda.obj x) : Cᵒᵖ ⊛⥤ Type v) ⊗ diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndImage.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndImage.lean index 226ccb5b8e..edce4fc204 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndImage.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndImage.lean @@ -40,7 +40,7 @@ epi–mono factorisation through `indOf.obj (image g₀)`; uniqueness of such factorisations identifies the image of `f` with it. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndKill.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndKill.lean index e7d0c0ef34..c1bed64d04 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndKill.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndKill.lean @@ -23,7 +23,7 @@ character combinatorics to the categorical direct-sum transfer of Schur vanishing. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndLocallyMixed.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndLocallyMixed.lean index ba81c0a65e..1583a5b63b 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndLocallyMixed.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndLocallyMixed.lean @@ -19,7 +19,7 @@ makes it a mixed sum of the unit and the odd line after base change to some nonzero commutative algebra. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndMonoidal.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndMonoidal.lean index f50cabb833..10439156e4 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndMonoidal.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndMonoidal.lean @@ -23,7 +23,7 @@ inherits the structure through `Ind.equivalence` and the full monoidal subcategory of the ind-property. -/ -@[expose] public section +public section namespace RS @@ -35,6 +35,7 @@ variable (C : Type v) /-- The ind-property, read on the Day synonym of the presheaf category. -/ +@[expose] def IsIndDay [SmallCategory C] [MonoidalCategory C] (F : MonoidalCategory.DayFunctor Cᵒᵖ (Type v)) : Prop := IsIndObject F.functor @@ -62,6 +63,7 @@ instance isIndDay_closedUnderIso [SmallCategory C] [MonoidalCategory C] : /-- The wrapper equivalence between the ind-subcategory of the presheaf category and the ind-subcategory of its Day synonym. -/ +@[expose] noncomputable def indDayCongr [SmallCategory C] [MonoidalCategory C] : ObjectProperty.FullSubcategory (IsIndObject (C := C)) ≌ @@ -88,6 +90,7 @@ noncomputable def indDayCongr [SmallCategory C] [MonoidalCategory C] : /-- `Ind C` is equivalent to the monoidal full subcategory of ind-objects of the Day presheaf category. -/ +@[expose] noncomputable def indDayEquivalence [SmallCategory C] [MonoidalCategory C] : Ind C ≌ ObjectProperty.FullSubcategory (C := MonoidalCategory.DayFunctor Cᵒᵖ (Type v)) diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndOfLinear.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndOfLinear.lean index 53a695d122..c03a6e8674 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndOfLinear.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndOfLinear.lean @@ -50,7 +50,7 @@ both actions are defined from the same `ψ`, and the proof uses only the unitality of the strong monoidal structure of the embedding. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndOfMonoidal.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndOfMonoidal.lean index eada19ccb4..ef0ff58eb8 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndOfMonoidal.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndOfMonoidal.lean @@ -48,7 +48,7 @@ and `rightUnitor_hom_unit_app` fields of Mathlib's `CategoryTheory.MonoidalCategory.LawfulDayConvolutionMonoidalCategoryStruct`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndPointTensor.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndPointTensor.lean index decfe886cc..7c98d98d97 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndPointTensor.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndPointTensor.lean @@ -51,7 +51,7 @@ the colimit of `X.presentation.F ⋙ Ind.yoneda` over the filtered index category `X.presentation.I`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndSchur.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndSchur.lean index f24af7f151..69bf54fed4 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndSchur.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndSchur.lean @@ -57,7 +57,7 @@ Yoneda lemma, by one element — its value on the canonical element comparisons are decided by evaluating both sides there. -/ -@[expose] public section +public section namespace RS @@ -77,7 +77,7 @@ variable {D : Type v} /-- The Day-convolution structure of a plain presheaf pair, read through the synonym: makes the `DayConvolution` API available on underlying functors of the Day category. -/ -@[reducible] def dayConvPlain [SmallCategory D] [MonoidalCategory D] +@[expose, reducible] def dayConvPlain [SmallCategory D] [MonoidalCategory D] (F G : D ⥤ Type v) : DayConvolution F G := dayConv (DayFunctor.mk F) (DayFunctor.mk G) @@ -86,6 +86,7 @@ attribute [local instance] dayConvPlain /-- The canonical element of the Day tensor of two corepresentables: the Kan-extension unit evaluated on the pair of identities. -/ +@[expose] def dayCoyonedaUnitElt [SmallCategory D] [MonoidalCategory D] (a b : D) : ((DayFunctor.mk (coyoneda.obj (op a)) ⊗ @@ -97,6 +98,7 @@ def dayCoyonedaUnitElt [SmallCategory D] [MonoidalCategory D] /-- The canonical element of a left-nested triple Day tensor of corepresentables. -/ +@[expose] def dayCoyonedaUnitElt₂ [SmallCategory D] [MonoidalCategory D] (a b c : D) : (((DayFunctor.mk (coyoneda.obj (op a)) ⊗ @@ -110,6 +112,7 @@ def dayCoyonedaUnitElt₂ [SmallCategory D] [MonoidalCategory D] /-- The canonical element of a right-nested triple Day tensor of corepresentables. -/ +@[expose] def dayCoyonedaUnitElt₂' [SmallCategory D] [MonoidalCategory D] (a b c : D) : ((DayFunctor.mk (coyoneda.obj (op a)) ⊗ @@ -127,6 +130,7 @@ corepresents evaluation at `(a ⊗ b) ⊗ c`: iterate the Kan-extension universal property twice and read off the Yoneda lemma on the external product of three corepresentables, which is definitionally the corepresentable of the triple product category. -/ +@[expose] def dayCoyonedaCorepresentableBy₂ [SmallCategory D] [MonoidalCategory D] (a b c : D) : (dayEvaluation ((a ⊗ b) ⊗ c)).CorepresentableBy @@ -739,6 +743,7 @@ section Powers tensor powers**: `n = 0` is `RS.indOfUnitIso`, and each successor stage tensors the previous one with `indOf.obj X` and applies the embedding-tensor comparison. -/ +@[expose] def indOfPowIso [SmallCategory C] [MonoidalCategory C] (X : C) : (n : ℕ) → (tensorPow (Ind C) (indOf.obj X) n ≅ indOf.obj (tensorPow C X n)) diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndSchurKilled.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndSchurKilled.lean index bb432a9a76..b0861568f5 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndSchurKilled.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndSchurKilled.lean @@ -47,7 +47,7 @@ as in the acceptance section of `RS.Classical.Deligne.ScalarLinear`: between `ψ` and an ambient linear structure is needed. -/ -@[expose] public section +public section namespace RS @@ -89,7 +89,7 @@ tensorator followed by the image of the evaluation and the counit comparison. Both triangle identities descend from the corresponding identities downstairs, whose image is expanded by the oplax coherences of `CategoryTheory.Functor.Monoidal`. -/ -@[implicit_reducible] +@[expose, implicit_reducible] def exactPairingMap [Category.{v} A] [MonoidalCategory A] {B : Type u'} [Category.{v'} B] [MonoidalCategory B] (F : A ⥤ B) [F.Monoidal] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndSimple.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndSimple.lean index 23c2168afa..15ab406174 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndSimple.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndSimple.lean @@ -45,7 +45,7 @@ epimorphism in an abelian category is an isomorphism. monomorphism. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndSplit.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndSplit.lean index 93cc677f9e..4c7f2fd90a 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndSplit.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndSplit.lean @@ -28,7 +28,7 @@ the binomial count, and the character expansion of each block factor. -/ -@[expose] public section +public section namespace RS @@ -104,6 +104,7 @@ private theorem blockEmbed_injective {a b : ℕ} the joint size: the normalized pairing, over the block product `S_a × S_b`, of the recast Jacobi–Trudi character of the joint shape with the recast characters of the two shapes. -/ +@[expose] noncomputable def indMult {a b : ℕ} (lam : Shape (a + b)) (μ : Shape a) (ν : Shape b) : ℂ := ((a.factorial : ℂ) * (b.factorial : ℂ))⁻¹ * diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndSplitSection.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndSplitSection.lean index 0569dc48ea..b2672e4d46 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndSplitSection.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndSplitSection.lean @@ -45,7 +45,7 @@ rigid, so the pullback taken in `C` has a right dual there, and comparison isomorphism. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndTensorExact.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndTensorExact.lean index 6ced52053a..75f3a8c867 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndTensorExact.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndTensorExact.lean @@ -61,7 +61,7 @@ object fields must reduce at instance transparency for the `show`-retyped colimit proofs below to be stateable. -/ -@[expose] public section +public section namespace RS @@ -79,6 +79,7 @@ section Embedding /-- The embedding of `Ind C` into the Day presheaf category: the indization equivalence onto the full monoidal subcategory of ind-objects, followed by the subcategory inclusion. -/ +@[expose] def indToDay [SmallCategory C] [MonoidalCategory C] : Ind C ⥤ (Cᵒᵖ ⊛⥤ Type v) := (indDayEquivalence C).functor ⋙ ObjectProperty.ι _ @@ -196,6 +197,7 @@ under `indToDay`, the tensor `indOf.obj x ⊗ indOf.obj y` is the Day tensor of the representables at `x` and `y`, which is the representable at `x ⊗ y` — that is, the image of `indOf.obj (x ⊗ y)`. -/ +@[expose] def indToDayTensorIso [SmallCategory C] [MonoidalCategory C] (x y : C) : (indToDay (C := C)).obj (indOf.obj x ⊗ indOf.obj y) ≅ @@ -212,6 +214,7 @@ def indToDayFullyFaithful [SmallCategory C] [MonoidalCategory C] : /-- The tensor of two embedded objects of `Ind C` is the embedding of the tensor: `indOf` is monoidal up to isomorphism. -/ +@[expose] def indOfTensorIso [SmallCategory C] [MonoidalCategory C] (x y : C) : indOf.obj x ⊗ indOf.obj y ≅ indOf.obj (x ⊗ y) := @@ -251,6 +254,7 @@ open scoped CategoryTheory.Prod /-- The universal transformation classified by the Day tensor of two corepresentables: on a pair of morphisms it takes the tensor, `(f, g) ↦ f ⊗ₘ g`. -/ +@[expose] def coyonedaTensorHom {D : Type v} [SmallCategory D] [MonoidalCategory D] (a b : D) : coyoneda.obj (op ((a, b) : D × D)) ⟶ @@ -570,6 +574,7 @@ lemma indOfTensorIso_hom_natural_left [SmallCategory C] [MonoidalCategory C] Day unit, identified through `RS.dayUnitIso` with the representable at `𝟙_ C` and pulled back through the fully faithful monoidal embedding `RS.indToDay`. -/ +@[expose] def indOfUnitIso [SmallCategory C] [MonoidalCategory C] : (𝟙_ (Ind C)) ≅ indOf.obj (𝟙_ C) := indToDayFullyFaithful.preimageIso @@ -596,7 +601,7 @@ lemma coconeLeg_w /-- The pointwise binary coproduct of two diagrams of the same shape. -/ -@[reducible, simps] +@[expose, reducible, simps] def coprodDiagram {J : Type v₁} [Category.{v₁} J] {ℬ : Type u₃} [Category.{v₃} ℬ] [HasBinaryCoproducts ℬ] @@ -623,7 +628,7 @@ lemma coprodLeg_w /-- The coproduct of two cocones: a cocone over the pointwise coproduct diagram, with the coproduct of the two points as its point. -/ -@[reducible, simps] +@[expose, reducible, simps] def coprodCocone {J : Type v₁} [Category.{v₁} J] {ℬ : Type u₃} [Category.{v₃} ℬ] [HasBinaryCoproducts ℬ] {D₁ D₂ : J ⥤ ℬ} (c₁ : Cocone D₁) (c₂ : Cocone D₂) : @@ -640,7 +645,7 @@ def coprodCocone {J : Type v₁} [Category.{v₁} J] {ℬ : Type u₃} [Category /-- A cocone over the pointwise coproduct, restricted along the first inclusion to a cocone over the first diagram. -/ -@[reducible, simps] +@[expose, reducible, simps] def coprodCoconeFst {J : Type v₁} [Category.{v₁} J] {ℬ : Type u₃} [Category.{v₃} ℬ] [HasBinaryCoproducts ℬ] @@ -656,7 +661,7 @@ def coprodCoconeFst /-- A cocone over the pointwise coproduct, restricted along the second inclusion to a cocone over the second diagram. -/ -@[reducible, simps] +@[expose, reducible, simps] def coprodCoconeSnd {J : Type v₁} [Category.{v₁} J] {ℬ : Type u₃} [Category.{v₃} ℬ] [HasBinaryCoproducts ℬ] @@ -716,7 +721,7 @@ def isColimitCoprodCocone rw [hf, ← hm' j, coprod.inr_map_assoc] /-- The pointwise binary coproduct of two functors. -/ -@[reducible, simps] +@[expose, reducible, simps] def coprodPairFunctor {𝒜 : Type u₂} [Category.{v₂} 𝒜] {ℬ : Type u₃} [Category.{v₃} ℬ] [HasBinaryCoproducts ℬ] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndUnitNonzero.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndUnitNonzero.lean index ccb6800373..65e43b986e 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndUnitNonzero.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/IndUnitNonzero.lean @@ -18,7 +18,7 @@ Ind-completion is not a zero object. This is the side condition of both Proposition 2.9 and Rappel 2.10 over the Ind-completion. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/InitDatum.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/InitDatum.lean index a3ab0f9628..927e563e29 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/InitDatum.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/InitDatum.lean @@ -18,7 +18,7 @@ relative tensor collapses to the plain tensor, and the pairing and copairing pass through the collapse. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/InitState.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/InitState.lean index 55ffa6f88d..19e52d7eb0 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/InitState.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/InitState.lean @@ -17,7 +17,7 @@ is the tensor unit, no factors are split off, and the remainder is the object itself with its ambient duality. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/InterchangeAct.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/InterchangeAct.lean index ed2d1b9f2a..f6c9b7229b 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/InterchangeAct.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/InterchangeAct.lean @@ -21,7 +21,7 @@ structure morphism of the splitting-chain algebra multiplies through. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/KernelPow.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/KernelPow.lean index 0cfeea2c23..f8eac96b04 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/KernelPow.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/KernelPow.lean @@ -50,7 +50,7 @@ Three layers: joins but no indexed supremum. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/KeyLemma.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/KeyLemma.lean index 9517bc5762..23a4eab96c 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/KeyLemma.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/KeyLemma.lean @@ -43,7 +43,7 @@ constructible morphism connects them. The degree-zero object `modTensor A M' M ⊗ B` is where the splitting genuinely lives. -/ -@[expose] public section +public section namespace RS @@ -91,6 +91,7 @@ section Bundles /-- The pairing of a duality datum, as a module map into the regular module. -/ +@[expose] noncomputable def ModDualityDatum.pairMod [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Limits.HasCoequalizers D] @@ -103,6 +104,7 @@ noncomputable def ModDualityDatum.pairMod /-- The copairing of a duality datum, as a module map from the regular module. -/ +@[expose] noncomputable def ModDualityDatum.copairMod [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Limits.HasCoequalizers D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/KeyLemmaClose.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/KeyLemmaClose.lean index 1513a90d66..a61dc7a369 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/KeyLemmaClose.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/KeyLemmaClose.lean @@ -24,7 +24,7 @@ the seed. Nonvanishing is the stage-detection argument of the balanced line. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/KeyLemmaData.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/KeyLemmaData.lean index fdba36126e..0c8967a130 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/KeyLemmaData.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/KeyLemmaData.lean @@ -28,7 +28,7 @@ nonvanishing argument is unaffected; the insertions live in degrees `±1`. -/ -@[expose] public section +public section namespace RS @@ -103,6 +103,7 @@ section Statement consumed direction): a duality datum with the zigzag laws, over a nonzero base whose symmetric powers of the module never vanish, admits splitting data. -/ +@[expose] def KeyLemmaDataStatement [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/KillerNonempty.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/KillerNonempty.lean index d8261defb8..08fd1f50d6 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/KillerNonempty.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/KillerNonempty.lean @@ -17,7 +17,7 @@ every diagram, so a killed object is killed at some diagram with at least one cell. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/KronKill.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/KronKill.lean index 5d69585d31..e488df5ec3 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/KronKill.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/KronKill.lean @@ -22,7 +22,7 @@ the multiplicity is. This mirrors the induction kill of by the two external embeddings and the diagonal. -/ -@[expose] public section +public section namespace RS @@ -37,6 +37,7 @@ private theorem ma_smul_apply {G : Type*} (r : ℂ) universe u /-- The first-factor embedding of `S_n` into `S_n × S_n`. -/ +@[expose] noncomputable def extFstHom (n : ℕ) : Equiv.Perm (Fin n) →* Equiv.Perm (Fin n) × Equiv.Perm (Fin n) where @@ -45,6 +46,7 @@ noncomputable def extFstHom (n : ℕ) : map_mul' σ σ' := by rw [Prod.mk_mul_mk, one_mul] /-- The second-factor embedding of `S_n` into `S_n × S_n`. -/ +@[expose] noncomputable def extSndHom (n : ℕ) : Equiv.Perm (Fin n) →* Equiv.Perm (Fin n) × Equiv.Perm (Fin n) where @@ -53,6 +55,7 @@ noncomputable def extSndHom (n : ℕ) : map_mul' τ τ' := by rw [Prod.mk_mul_mk, one_mul] /-- The diagonal embedding of `S_n` into `S_n × S_n`. -/ +@[expose] noncomputable def diagHom (n : ℕ) : Equiv.Perm (Fin n) →* Equiv.Perm (Fin n) × Equiv.Perm (Fin n) where @@ -63,6 +66,7 @@ noncomputable def diagHom (n : ℕ) : /-- **The external product**: the product of the two one-sided images of a pair of group-algebra elements in the group algebra of `S_n × S_n`. -/ +@[expose] noncomputable def extProd {n : ℕ} (x y : SymGroupAlgebra n) : MonoidAlgebra ℂ (Equiv.Perm (Fin n) × Equiv.Perm (Fin n)) := MonoidAlgebra.mapDomainAlgHom ℂ ℂ (extFstHom n) x * @@ -70,6 +74,7 @@ noncomputable def extProd {n : ℕ} (x y : SymGroupAlgebra n) : /-- **The diagonal embedding of group algebras**: extension of the diagonal along `mapDomain`, an algebra homomorphism. -/ +@[expose] noncomputable def diagEmbed {n : ℕ} : SymGroupAlgebra n →ₐ[ℂ] MonoidAlgebra ℂ (Equiv.Perm (Fin n) × Equiv.Perm (Fin n)) := diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/LambdaCoend.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/LambdaCoend.lean index eb90bb4ee4..9a2040b08e 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/LambdaCoend.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/LambdaCoend.lean @@ -20,7 +20,7 @@ stage maps and dinaturality, the mapping property, and functoriality in both arguments. -/ -@[expose] public section +public section namespace RS @@ -32,7 +32,7 @@ variable {A : Type u} /-- The Λ diagram of a pair of functors: `(X, Y) ↦ α(Xᘁ) ⊗ β(Y)`, contravariant in `X` through the adjoint mate. -/ -@[simps!] +@[expose, simps!] def lambdaDiagram [Category.{v} A] [MonoidalCategory A] [RightRigidCategory A] {D : Type u'} [Category.{v'} D] [MonoidalCategory D] (α β : A ⥤ D) : Aᵒᵖ ⥤ A ⥤ D where @@ -132,7 +132,7 @@ section /-- Natural transformations in both arguments induce a map of Λ diagrams. -/ -@[simps] +@[expose, simps] def lambdaDiagramMap [Category.{v} A] [MonoidalCategory A] [RightRigidCategory A] {D : Type u'} [Category.{v'} D] [MonoidalCategory D] {α : A ⥤ D} @@ -214,7 +214,7 @@ open Functor.LaxMonoidal /-- The right dual of the monoidal unit supplied by the rigid structure — the instance the Λ stages use, which need not be the unit-specific instance. -/ -noncomputable def unitRigidDual +@[expose] noncomputable def unitRigidDual [Category.{v} A] [MonoidalCategory A] [RightRigidCategory A] : A := @HasRightDual.rightDual A _ _ (𝟙_ A) (RightRigidCategory.rightDual (𝟙_ A)) @@ -352,7 +352,7 @@ section /-- The cocone under the whiskered multispan carried by a dinatural family. -/ -@[simps] +@[expose, simps] def tensorLeftCoendCocone {D : Type u'} [Category.{v'} D] [MonoidalCategory D] {J : Type u} [Category.{v} J] (F : Jᵒᵖ ⥤ J ⥤ D) (W : D) {Z : D} @@ -425,7 +425,7 @@ section /-- The cocone under the right-whiskered multispan carried by a dinatural family. -/ -@[simps] +@[expose, simps] def tensorRightCoendCocone {D : Type u'} [Category.{v'} D] [MonoidalCategory D] {J : Type u} [Category.{v} J] (F : Jᵒᵖ ⥤ J ⥤ D) (W : D) {Z : D} diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/MixDegenerate.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/MixDegenerate.lean index d922d853f6..f9d7db6e52 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/MixDegenerate.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/MixDegenerate.lean @@ -30,7 +30,7 @@ arbitrary dimensions. The two sides are joined exactly as before, giving the nonvanishing statement for all counts `r s : ℕ`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/MixShuffle.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/MixShuffle.lean index 039512a326..16c4ceb57f 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/MixShuffle.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/MixShuffle.lean @@ -18,7 +18,7 @@ isomorphism is pure index bookkeeping: the first unit index is peeled off and the remaining indices are shifted down by one. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/MixShuffleLine.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/MixShuffleLine.lean index 862ecca175..86a8f23738 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/MixShuffleLine.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/MixShuffleLine.lean @@ -18,7 +18,7 @@ isomorphism is pure index bookkeeping: the first line index is peeled off and the remaining indices are shifted down by one. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/MixSumPow.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/MixSumPow.lean index 394db277a1..6e1c1715ec 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/MixSumPow.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/MixSumPow.lean @@ -21,7 +21,7 @@ nonvanishing of the mixed sum at every diagram avoiding the cell `(p + 1, q + 1)` then transports across the isomorphism. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/MixWhisker.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/MixWhisker.lean index 55d075933d..b9399f537b 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/MixWhisker.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/MixWhisker.lean @@ -31,7 +31,7 @@ odd line is killed by `W ⊗ −`; for `W` a monoid object with nonzero unit this is automatic, since the odd line is invertible. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/MixWhiskerAll.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/MixWhiskerAll.lean index aaa8a0335d..b5367642b5 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/MixWhiskerAll.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/MixWhiskerAll.lean @@ -21,7 +21,7 @@ every pair of counts and every diagram avoiding the corresponding cell. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/MixedConc.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/MixedConc.lean index 97decef8ff..3ab517cae6 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/MixedConc.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/MixedConc.lean @@ -32,7 +32,7 @@ the insertion lemma. The `ℂ`-bilinear extension to the group algebras then holds on basis permutations and extends linearly. -/ -@[expose] public section +public section namespace RS @@ -51,6 +51,7 @@ variable {a b : ℕ} convention is that of `finSumFinEquiv`, which carries the `Fin a` summand onto `{0, …, a − 1}` by `Fin.castAdd` and the `Fin b` summand onto `{a, …, a + b − 1}` by `Fin.natAdd`. -/ +@[expose] noncomputable def blockEmbed (σ : Equiv.Perm (Fin a)) (τ : Equiv.Perm (Fin b)) : Equiv.Perm (Fin (a + b)) := finSumFinEquiv.permCongr (σ.sumCongr τ) @@ -209,6 +210,7 @@ variable {A : Type u} `tensorPow` itself: the empty second power is absorbed by the right unitor, and one further factor reassociates off the second power and whiskers the previous stage. -/ +@[expose] noncomputable def tensorPowConcat [Category.{v} A] [MonoidalCategory A] (X : A) (a : ℕ) : (b : ℕ) → (tensorPow A X a ⊗ tensorPow A X b ≅ tensorPow A X (a + b)) @@ -473,6 +475,7 @@ end Symmetric section Linear /-- The first-block embedding as a monoid homomorphism. -/ +@[expose] noncomputable def blockEmbedFstHom (a b : ℕ) : Equiv.Perm (Fin a) →* Equiv.Perm (Fin (a + b)) where toFun σ := blockEmbed σ 1 @@ -480,6 +483,7 @@ noncomputable def blockEmbedFstHom (a b : ℕ) : map_mul' σ σ' := by rw [← blockEmbed_mul, one_mul] /-- The second-block embedding as a monoid homomorphism. -/ +@[expose] noncomputable def blockEmbedSndHom (a b : ℕ) : Equiv.Perm (Fin b) →* Equiv.Perm (Fin (a + b)) where toFun τ := blockEmbed 1 τ @@ -489,6 +493,7 @@ noncomputable def blockEmbedSndHom (a b : ℕ) : /-- **The block embedding of group algebras**: the `ℂ`-bilinear extension of `blockEmbed`, carrying a pair of group-algebra elements to the product of their one-sided embeddings. -/ +@[expose] noncomputable def blockAlgEmbed {a b : ℕ} (x : SymGroupAlgebra a) (y : SymGroupAlgebra b) : SymGroupAlgebra (a + b) := MonoidAlgebra.mapDomainAlgHom ℂ ℂ (blockEmbedFstHom a b) x * diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/MixedDiag.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/MixedDiag.lean index 753e809460..439e4f20a6 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/MixedDiag.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/MixedDiag.lean @@ -28,7 +28,7 @@ lemmas of `Deligne/PermNat.lean` do, and linearises to the group algebra, whose diagonal double action is packaged as `diagAlg`. -/ -@[expose] public section +public section namespace RS @@ -42,6 +42,7 @@ variable {A : Type u} /-- **The middle-four interchange as an isomorphism**: `tensorμ` and `tensorδ` are mutually inverse. -/ +@[expose] noncomputable def tensorμIso [Category.{v} A] [MonoidalCategory A] [SymmetricCategory A] (P Q X Y : A) : @@ -55,6 +56,7 @@ noncomputable def tensorμIso `(X ⊗ Y) ^ ⊗ n ≅ X ^ ⊗ n ⊗ Y ^ ⊗ n`: at each stage the previous stage sorts all but the newest pair of factors, and the middle-four interchange routes that pair to its two destinations. -/ +@[expose] noncomputable def tensorPowDistrib [Category.{v} A] [MonoidalCategory A] [SymmetricCategory A] (X Y : A) : (n : ℕ) → @@ -330,7 +332,7 @@ theorem tensorPowDistrib_permMor /-- **The diagonal double action of a permutation** on `X ^ ⊗ n ⊗ Y ^ ⊗ n`, as a monoid homomorphism: `σ` acts by its two actions tensored together. -/ -@[simps] +@[expose, simps] noncomputable def diagPermHom [Category.{v} A] [MonoidalCategory A] [SymmetricCategory A] (X Y : A) (n : ℕ) : diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/MixedTransport.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/MixedTransport.lean index 7085456de7..c0395f8809 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/MixedTransport.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/MixedTransport.lean @@ -17,7 +17,7 @@ module on the same object, so a decomposition over one algebra becomes a decomposition over any algebra under it. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModAbelian.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModAbelian.lean index e23841ea63..5b20c56102 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModAbelian.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModAbelian.lean @@ -57,7 +57,7 @@ companion) and to a sum of copies of two simple objects (`RS.exists_mixSum_iso_of_mono` and its companion) follow. -/ -@[expose] public section +public section namespace RS @@ -100,18 +100,21 @@ theorem neg_lin [Category.{v} D] [MonoidalCategory D] [Preadditive D] whiskerLeft_neg, Preadditive.neg_comp] /-- The sum of two module maps. -/ +@[expose] def homAdd [Category.{v} D] [MonoidalCategory D] [Preadditive D] [MonoidalPreadditive D] {A : D} [MonObj A] {M : Mod D A} {N : Mod D A} (f g : M ⟶ N) : M ⟶ N := Mod.Hom.mk' (f.hom + g.hom) (by exact add_lin f g) /-- The zero module map. -/ +@[expose] def homZero [Category.{v} D] [MonoidalCategory D] [Preadditive D] [MonoidalPreadditive D] {A : D} [MonObj A] {M : Mod D A} {N : Mod D A} : M ⟶ N := Mod.Hom.mk' 0 (by exact zero_lin) /-- The negative of a module map. -/ +@[expose] def homNeg [Category.{v} D] [MonoidalCategory D] [Preadditive D] [MonoidalPreadditive D] {A : D} [MonObj A] {M : Mod D A} {N : Mod D A} (f : M ⟶ N) : M ⟶ N := @@ -248,6 +251,7 @@ section Biprod variable {D : Type u} /-- The binary bicone carried by the biproduct of two modules. -/ +@[expose] noncomputable def modBinaryBicone [Category.{v} D] [MonoidalCategory D] [Preadditive D] [MonoidalPreadditive D] [HasBinaryBiproducts D] (A : D) [MonObj A] @@ -538,7 +542,7 @@ theorem kerAct_mul [Category.{v} D] [MonoidalCategory D] [Preadditive D] /-- The module structure on the kernel of the underlying morphism. -/ -@[implicit_reducible] +@[expose, implicit_reducible] noncomputable def kerModObj [Category.{v} D] [MonoidalCategory D] [Preadditive D] [MonoidalPreadditive D] [HasKernels D] (A : D) [MonObj A] {M : Mod D A} @@ -548,6 +552,7 @@ noncomputable def kerModObj mul_smul := kerAct_mul A f /-- **The kernel of a module map**, bundled. -/ +@[expose] noncomputable def kerMod [Category.{v} D] [MonoidalCategory D] [Preadditive D] [MonoidalPreadditive D] [HasKernels D] (A : D) [MonObj A] {M : Mod D A} {N : Mod D A} (f : M ⟶ N) : Mod D A := @@ -555,6 +560,7 @@ noncomputable def kerMod [Category.{v} D] [MonoidalCategory D] [Preadditive D] ⟨kernel f.hom⟩ /-- The inclusion of the kernel of a module map. -/ +@[expose] noncomputable def kerIncl [Category.{v} D] [MonoidalCategory D] [Preadditive D] [MonoidalPreadditive D] [HasKernels D] (A : D) [MonObj A] {M : Mod D A} {N : Mod D A} (f : M ⟶ N) : kerMod A f ⟶ M := @@ -732,7 +738,7 @@ theorem cokerAct_mul [Category.{v} D] [MonoidalCategory D] [Preadditive D] /-- The module structure on the cokernel of the underlying morphism. -/ -@[implicit_reducible] +@[expose, implicit_reducible] noncomputable def cokerModObj [Category.{v} D] [MonoidalCategory D] [Preadditive D] [MonoidalPreadditive D] [HasCokernels D] @@ -744,6 +750,7 @@ noncomputable def cokerModObj mul_smul := cokerAct_mul A f /-- **The cokernel of a module map**, bundled. -/ +@[expose] noncomputable def cokerMod [Category.{v} D] [MonoidalCategory D] [Preadditive D] [MonoidalPreadditive D] [HasCokernels D] [∀ Z : D, PreservesColimitsOfShape WalkingParallelPair (tensorLeft Z)] @@ -752,6 +759,7 @@ noncomputable def cokerMod [Category.{v} D] [MonoidalCategory D] [Preadditive D] ⟨cokernel f.hom⟩ /-- The projection onto the cokernel of a module map. -/ +@[expose] noncomputable def cokerProj [Category.{v} D] [MonoidalCategory D] [Preadditive D] [MonoidalPreadditive D] [HasCokernels D] @@ -1418,6 +1426,7 @@ theorem exists_quotient_of_epi_biprod [Category.{v} E] [Abelian E] /-- **The direct sum of a list of indices**, formed by iterated binary biproducts from a family of objects. -/ +@[expose] noncomputable def idxSum [Category.{v} E] [Abelian E] {J : Type w} (S : J → E) : List J → E | [] => 0 @@ -1502,6 +1511,7 @@ theorem exists_sublist_iso_of_epi [Category.{v} E] [Abelian E] /-! ## Sums of copies of two simple objects -/ /-- The direct sum of `p` copies of `X` and `q` copies of `Y`. -/ +@[expose] noncomputable def mixSum [Category.{v} E] [Abelian E] (X Y : E) (p q : ℕ) : E := idxSum (id : E → E) (List.replicate p X ++ List.replicate q Y) diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModAssoc.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModAssoc.lean index 7dcfeb0497..4eccaae1d5 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModAssoc.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModAssoc.lean @@ -31,7 +31,7 @@ target. forward map. -/ -@[expose] public section +public section namespace RS @@ -118,6 +118,7 @@ theorem modTensor_condition_left /-- The cover of the associator: reassociate and project through both tensor products of the right-nested side. -/ +@[expose] noncomputable def modTensorAssocCover [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] @@ -250,6 +251,7 @@ theorem modTensorπ_assocHom /-- The cover of the inverse associator: reassociate backwards and project through both tensor products of the left-nested side. -/ +@[expose] noncomputable def modTensorAssocInvCover [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] @@ -433,6 +435,7 @@ theorem modTensorAssocInv_assocHom /-- **The associator isomorphism of the tensor product of modules** (Deligne 2002, §2.3): the relative tensor is associative up to the descended ambient associator. -/ +@[expose] noncomputable def modTensorAssocIso [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] @@ -532,6 +535,7 @@ theorem modTensorAssocInv_act Category.id_comp] /-- The associator as a morphism of bundled modules. -/ +@[expose] noncomputable def modTensorAssocModHom [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] @@ -545,6 +549,7 @@ noncomputable def modTensorAssocModHom (modTensorAssocHom_act A M N P) /-- The inverse associator as a morphism of bundled modules. -/ +@[expose] noncomputable def modTensorAssocModInv [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] @@ -559,6 +564,7 @@ noncomputable def modTensorAssocModInv /-- **The associator of the tensor product of modules, as an isomorphism of bundled modules.** -/ +@[expose] noncomputable def modTensorAssocModIso [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModBiprod.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModBiprod.lean index 557047508d..ef90561e56 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModBiprod.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModBiprod.lean @@ -19,7 +19,7 @@ and morphisms out of the biproduct module are determined by the two components. -/ -@[expose] public section +public section namespace RS @@ -31,6 +31,7 @@ universe v u variable {D : Type u} /-- The componentwise action on the biproduct of the carriers. -/ +@[expose] noncomputable def modBiprodAct [Category.{v} D] [MonoidalCategory D] [Preadditive D] [HasBinaryBiproducts D] (A : D) [MonObj A] (M : Mod D A) (N : Mod D A) : @@ -76,7 +77,7 @@ theorem modBiprodAct_mul [Category.{v} D] [MonoidalCategory D] [Preadditive D] associator_naturality_right_assoc] /-- The module structure on the biproduct of the carriers. -/ -@[implicit_reducible] +@[expose, implicit_reducible] noncomputable def modBiprodModObj [Category.{v} D] [MonoidalCategory D] [Preadditive D] [HasBinaryBiproducts D] (A : D) [MonObj A] (M : Mod D A) (N : Mod D A) : @@ -86,6 +87,7 @@ noncomputable def modBiprodModObj mul_smul := modBiprodAct_mul A M N /-- **The biproduct of modules**, bundled. -/ +@[expose] noncomputable def modBiprod [Category.{v} D] [MonoidalCategory D] [Preadditive D] [HasBinaryBiproducts D] (A : D) [MonObj A] (M : Mod D A) (N : Mod D A) : @@ -152,6 +154,7 @@ theorem modBiprodAct_snd [Category.{v} D] [MonoidalCategory D] [Preadditive D] rw [modBiprodAct, biprod.lift_snd] /-- The first injection is a module map. -/ +@[expose] noncomputable def modBiprodInl [Category.{v} D] [MonoidalCategory D] [Preadditive D] [MonoidalPreadditive D] [HasBinaryBiproducts D] (A : D) [MonObj A] @@ -160,6 +163,7 @@ noncomputable def modBiprodInl (by exact actLeft_modBiprodInl A M N) /-- The second injection is a module map. -/ +@[expose] noncomputable def modBiprodInr [Category.{v} D] [MonoidalCategory D] [Preadditive D] [MonoidalPreadditive D] [HasBinaryBiproducts D] (A : D) [MonObj A] @@ -168,6 +172,7 @@ noncomputable def modBiprodInr (by exact actLeft_modBiprodInr A M N) /-- The first projection is a module map. -/ +@[expose] noncomputable def modBiprodFst [Category.{v} D] [MonoidalCategory D] [Preadditive D] [HasBinaryBiproducts D] (A : D) [MonObj A] (M : Mod D A) (N : Mod D A) : @@ -176,6 +181,7 @@ noncomputable def modBiprodFst (by exact modBiprodAct_fst A M N) /-- The second projection is a module map. -/ +@[expose] noncomputable def modBiprodSnd [Category.{v} D] [MonoidalCategory D] [Preadditive D] [HasBinaryBiproducts D] (A : D) [MonObj A] (M : Mod D A) (N : Mod D A) : @@ -220,6 +226,7 @@ theorem modBiprodAct_map [Category.{v} D] [MonoidalCategory D] [Preadditive D] biprod.map_snd] /-- **Functoriality of the module biproduct.** -/ +@[expose] noncomputable def modBiprodMap [Category.{v} D] [MonoidalCategory D] [Preadditive D] [HasBinaryBiproducts D] (A : D) [MonObj A] (M : Mod D A) (N : Mod D A) diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModContractL.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModContractL.lean index 2c59d03aa8..fa23ec3b81 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModContractL.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModContractL.lean @@ -18,7 +18,7 @@ braid is needed at the fold level. The zag composite inserts a copairing's image on the right and contracts the leading pair. -/ -@[expose] public section +public section namespace RS @@ -54,6 +54,7 @@ section Contract3L /-- The fold-level three-window contraction of a leading pair: pair off the leading window, act on the head of the remainder with the resulting scalar from the left. -/ +@[expose] noncomputable def contract3LFold [Category.{v} D] [MonoidalCategory D] [BraidedCategory D] [Preadditive D] [HasFiniteBiproducts D] [HasCoequalizers D] (A : D) @@ -266,6 +267,7 @@ section ZagCore insert the copairing on the right, concatenate, and contract the leading pair. The zagzig law of a duality datum states that this composite is the identity. -/ +@[expose] noncomputable def zagComposite [Category.{v} D] [MonoidalCategory D] [BraidedCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModCross.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModCross.lean index 2223745665..5960d3bc0c 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModCross.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModCross.lean @@ -38,7 +38,7 @@ two-element multi-tensor. relation, with its defining equation `modMultiπ_swapPair`. -/ -@[expose] public section +public section namespace RS @@ -60,6 +60,7 @@ section CrossDefs /-- The boundary-insertion object: the monoid between the folds of two blocks, whiskered under a prefix. -/ +@[expose] def modCrossMid [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] (Xs Ys : List (Mod D A)) : List (Mod D A) → D @@ -81,6 +82,7 @@ def modCrossMid [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] rfl /-- Assemble a boundary window into a prefix-whiskered leg. -/ +@[expose] def modCrossLegOf [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] (Xs Ys : List (Mod D A)) (w : (modList A Xs ⊗ A) ⊗ modList A Ys ⟶ modList A (Xs ++ Ys)) : @@ -113,6 +115,7 @@ section CrossWindows /-- The crossing window: the monoid braids over the whole first block and acts on its head. -/ +@[expose] def modCrossHeadWin [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] [BraidedCategory D] (X : Mod D A) (l Ys : List (Mod D A)) : @@ -124,6 +127,7 @@ def modCrossHeadWin [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] /-- The stationary window: the monoid acts on the head of the second block. -/ +@[expose] def modCrossYWin [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] (Xs : List (Mod D A)) (Y : Mod D A) (m : List (Mod D A)) : @@ -146,6 +150,7 @@ section CrossBase /-- The base bridge: absorb the unit seed of a singleton first block and reassociate onto the relation window of the head slot. -/ +@[expose] def modCrossBridge [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] (X Y : Mod D A) (m : List (Mod D A)) : (pre : List (Mod D A)) → @@ -260,6 +265,7 @@ tail block under a prefix extended by the head. -/ section CrossStep /-- Peel the head of the first block into the prefix. -/ +@[expose] def modCrossPeel [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] (X : Mod D A) (Xs' Ys : List (Mod D A)) : (pre : List (Mod D A)) → @@ -321,6 +327,7 @@ lemma modCrossPeel_yWin [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] /-- The step bridge: braid the monoid over the tail of the first block and retype at the relation window of the head slot. -/ +@[expose] def modCrossStepBridge [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] [BraidedCategory D] (X P : Mod D A) (l' Ys : List (Mod D A)) : diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModDual.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModDual.lean index 665a6c2c65..17375d7c9a 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModDual.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModDual.lean @@ -45,7 +45,7 @@ copairing, need the multi-tensor coherence layer and are outside this module's scope. -/ -@[expose] public section +public section namespace RS @@ -60,6 +60,7 @@ section ActCoev /-- The coevaluation twisted by the action: informally `a ↦ (a • xᵢ) ⊗ yᵢ` in dual-basis notation. -/ +@[expose] def actCoev [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] (X : D) (Y : D) [ExactPairing X Y] [ModObj A X] : A ⟶ X ⊗ Y := @@ -108,6 +109,7 @@ lemma mul_actCoev /-- The contragredient right action on the dual: informally `f ⊗ a ↦ f (a • ·)`, that is, `f ⊗ a ↦ f (a • xᵢ) yᵢ` in dual-basis notation. -/ +@[expose] def dualActRight [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] (X : D) (Y : D) [ExactPairing X Y] [ModObj A X] : Y ⊗ A ⟶ Y := @@ -209,6 +211,7 @@ back along the inverse braiding. The inverse braiding (rather than the braiding `β_ A Y`) is chosen so that the braided right action `actRight` derived from it is exactly `dualActRight`; see `actRight_dualMod`. -/ +@[expose] def dualActLeft [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] [BraidedCategory D] (X : D) (Y : D) [ExactPairing X Y] [ModObj A X] : A ⊗ Y ⟶ Y := @@ -259,7 +262,7 @@ lemma mul_dualActLeft [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] IsCommMonObj.mul_comm' A] /-- The dual module structure on `Y`, for a commutative monoid. -/ -@[implicit_reducible] +@[expose, implicit_reducible] def dualModObj [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] [BraidedCategory D] (X : D) (Y : D) [ExactPairing X Y] [ModObj A X] [IsCommMonObj A] : ModObj A Y where @@ -269,7 +272,7 @@ def dualModObj [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] /-- The dual of a module, bundled: `Y` with the transported action. -/ -@[reducible] +@[expose, reducible] def dualMod [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] [BraidedCategory D] (X : D) (Y : D) [ExactPairing X Y] [ModObj A X] [IsCommMonObj A] : Mod D A := @@ -298,7 +301,7 @@ end DualModule section AsMod /-- A module object, bundled as a module. -/ -@[reducible] +@[expose, reducible] def asMod [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] (X : D) [ModObj A X] : Mod D A := ⟨X⟩ diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModIns.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModIns.lean index a05dcb7fe2..3aeb6f7722 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModIns.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModIns.lean @@ -19,7 +19,7 @@ contraction descends through the coequalizer using the pairing's linearity. -/ -@[expose] public section +public section namespace RS @@ -87,6 +87,7 @@ section Contract3 /-- The fold-level three-window contraction: pair off the trailing window, act on the head with the resulting scalar. -/ +@[expose] noncomputable def contract3Fold [Category.{v} D] [MonoidalCategory D] [BraidedCategory D] [Preadditive D] [HasFiniteBiproducts D] [HasCoequalizers D] (A : D) @@ -290,6 +291,7 @@ end Contract3 section ZigCore /-- The image of a copairing at the two-element multi-tensor. -/ +@[expose] noncomputable def copairImage [Category.{v} D] [MonoidalCategory D] [BraidedCategory D] [Preadditive D] [HasFiniteBiproducts D] [HasCoequalizers D] (A : D) @@ -302,6 +304,7 @@ noncomputable def copairImage insert the copairing on the left, concatenate, and contract the trailing pair. The zigzag law of a duality datum states that this composite is the identity. -/ +@[expose] noncomputable def zigComposite [Category.{v} D] [MonoidalCategory D] [BraidedCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModMulti.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModMulti.lean index 9e64f0d90b..ee211714d1 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModMulti.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModMulti.lean @@ -62,7 +62,7 @@ is outside this module's scope; its substrate (the head modules, the concatenation map, and the slot relations) is complete. -/ -@[expose] public section +public section namespace RS @@ -79,6 +79,7 @@ section ModList /-- The tensor fold of the underlying objects of a list of modules, folded to the right with the monoidal unit as seed. -/ +@[expose] def modList [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] : List (Mod D A) → D | [] => 𝟙_ D @@ -97,6 +98,7 @@ def modList [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] : /-- Transport of the tensor fold along an equality of lists. It is an `eqToHom`, so it composes and cancels by `eqToHom` simp lemmas. -/ +@[expose] def modListCast [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] {l₁ l₂ : List (Mod D A)} (h : l₁ = l₂) : modList A l₁ ⟶ modList A l₂ := @@ -139,6 +141,7 @@ section Slots /-- The relation object of a slot: the ambient fold with the monoid inserted between the two factors of the slot. -/ +@[expose] def modMultiMid [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] : List (Mod D A) → Mod D A → Mod D A → List (Mod D A) → D @@ -162,6 +165,7 @@ def modMultiMid [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] : /-- Assemble a window morphism on `(M.X ⊗ A) ⊗ N.X` into a relation leg over a prefix: resolve the window, reassociate the second factor onto the suffix, and whisker through the prefix. -/ +@[expose] def modMultiLegOf [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] (M N : Mod D A) (post : List (Mod D A)) (w : (M.X ⊗ A) ⊗ N.X ⟶ M.X ⊗ N.X) : @@ -189,6 +193,7 @@ def modMultiLegOf [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] /-- The first relation leg at a slot: act on the left factor of the window through the braided right action. -/ +@[expose] def modMultiLegM [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] [BraidedCategory D] (pre : List (Mod D A)) (M N : Mod D A) @@ -198,6 +203,7 @@ def modMultiLegM [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] /-- The second relation leg at a slot: associate and act on the right factor of the window. -/ +@[expose] def modMultiLegN [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] (pre : List (Mod D A)) (M N : Mod D A) (post : List (Mod D A)) : @@ -234,6 +240,7 @@ def ModSlot.consSlot [Category.{v} D] [MonoidalCategory D] {A : D} [MonObj A] ⟨P :: s.pre, s.fst, s.snd, s.post, congrArg (List.cons P) s.eq⟩ /-- The list of all adjacent slots of a list of modules. -/ +@[expose] def modSlots [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] : (Xs : List (Mod D A)) → List (ModSlot Xs) | [] => [] @@ -339,6 +346,7 @@ section ModMulti coequalizer of the wide relation pair, identifying `(x·c) ⊗ y ~ x ⊗ (c·y)` in every adjacent slot simultaneously. No binary module tensor product and no associativity enter. -/ +@[expose] noncomputable def modMulti [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] [BraidedCategory D] [Preadditive D] [HasFiniteBiproducts D] @@ -347,6 +355,7 @@ noncomputable def modMulti coequalizer (modMultiLegFst A Xs) (modMultiLegSnd A Xs) /-- The projection of the ambient fold onto the multi-tensor. -/ +@[expose] noncomputable def modMultiπ [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] [BraidedCategory D] [Preadditive D] [HasFiniteBiproducts D] @@ -455,6 +464,7 @@ is the empty biproduct, the legs agree, and the projection is an isomorphism. -/ /-- On a slot-free list the projection is an isomorphism. -/ +@[expose] noncomputable def modMultiTriv [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] [BraidedCategory D] [Preadditive D] [HasFiniteBiproducts D] @@ -480,6 +490,7 @@ noncomputable def modMultiNil modMultiTriv A (modSlots_nil A) /-- **The singleton multi-tensor is the module.** -/ +@[expose] noncomputable def modMultiSingle [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] [BraidedCategory D] [Preadditive D] [HasFiniteBiproducts D] @@ -520,6 +531,7 @@ def pairResolve X.X ◁ (ρ_ Y.X).hom /-- The inverse resolution: reinstate the unit seed. -/ +@[expose] def pairResolveInv [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] (X : Mod D A) (Y : Mod D A) : X.X ⊗ Y.X ⟶ modList A [X, Y] := @@ -547,12 +559,14 @@ lemma pairResolveInv_resolve /-- The window seed of the pair: the right unitor of the single relation object, retyped at `modMultiMid`. -/ +@[expose] def pairSeed [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] (X : Mod D A) (Y : Mod D A) : modMultiMid A [] X Y [] ⟶ (X.X ⊗ A) ⊗ Y.X := (ρ_ ((X.X ⊗ A) ⊗ Y.X)).hom /-- The inverse window seed of the pair. -/ +@[expose] def pairSeedInv [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] (X : Mod D A) (Y : Mod D A) : (X.X ⊗ A) ⊗ Y.X ⟶ modMultiMid A [] X Y [] := @@ -657,6 +671,7 @@ lemma modTensorπ_pairInv /-- **The two-element multi-tensor is the binary module tensor product**: the one-slot wide presentation and the parallel-pair presentation coequalize the same relations. -/ +@[expose] noncomputable def modMultiPair [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] [BraidedCategory D] [Preadditive D] [HasFiniteBiproducts D] @@ -687,6 +702,7 @@ section Concat /-- Concatenation of tensor folds: the two-block fold reassociates onto the fold of the concatenated list. -/ +@[expose] def modListConcat [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] : (Xs Ys : List (Mod D A)) → (modList A Xs ⊗ modList A Ys ≅ modList A (Xs ++ Ys)) @@ -1213,6 +1229,7 @@ section HeadAction /-- The head action on the fold of a non-empty list: act on the head factor. -/ +@[expose] def modListHeadAct [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] (X : Mod D A) (l : List (Mod D A)) : A ⊗ modList A (X :: l) ⟶ modList A (X :: l) := @@ -1386,6 +1403,7 @@ lemma modListHeadAct_slotwise h4).trans (Category.assoc _ _ _).symm) /-- **The head action on the multi-tensor**, by descent. -/ +@[expose] noncomputable def modMultiHeadAct [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] [BraidedCategory D] [IsCommMonObj A] [Preadditive D] @@ -1450,7 +1468,7 @@ lemma modMultiHeadAct_mul rw [reassoc_of% (modListHeadAct_mul A X l)] /-- The multi-tensor of a non-empty list is a module over `A`. -/ -@[implicit_reducible] +@[expose, implicit_reducible] noncomputable def modMultiModObj [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] [BraidedCategory D] [IsCommMonObj A] [Preadditive D] @@ -1464,6 +1482,7 @@ noncomputable def modMultiModObj mul_smul := modMultiHeadAct_mul A X l /-- The multi-tensor of a non-empty list, bundled as a module. -/ +@[expose] noncomputable def modMultiMod [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] [BraidedCategory D] [IsCommMonObj A] [Preadditive D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModMultiTriple.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModMultiTriple.lean index e4c03a2e1c..55b344f0f0 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModMultiTriple.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModMultiTriple.lean @@ -37,7 +37,7 @@ product of `ModTensor.lean`. directions. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModPowCast.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModPowCast.lean index 1d2888aaf0..42f8cb8e00 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModPowCast.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModPowCast.lean @@ -33,7 +33,7 @@ that die after the projection keep dying `modPowAlg_compat` follows. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModPowDescent.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModPowDescent.lean index c0a2599d8c..d466489152 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModPowDescent.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModPowDescent.lean @@ -18,7 +18,7 @@ tower. Together with the merge isomorphisms this descends the vanishing of a relative power to the module itself. -/ -@[expose] public section +public section namespace RS @@ -31,6 +31,7 @@ variable {D : Type u} /-- **The sandwich tower**: iterate tensoring with the pair `M ⊗ M'` on the left. -/ +@[expose] noncomputable def sandwichTower [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModPowDescentClose.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModPowDescentClose.lean index badaf0aa1a..56e26df202 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModPowDescentClose.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModPowDescentClose.lean @@ -17,7 +17,7 @@ iterates up the tower, and the tower reassembles into a power pair whose first factor is the vanishing power. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModPowStage.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModPowStage.lean index 0896c2b3df..f18c24b814 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModPowStage.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModPowStage.lean @@ -29,7 +29,7 @@ further letter. projection at one arity is invisible at the next. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModSchur.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModSchur.lean index 32897dd622..7d7f30f055 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModSchur.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModSchur.lean @@ -20,7 +20,7 @@ every block of one size acts as zero, the completeness of the blocks collapses the whole power. -/ -@[expose] public section +public section namespace RS @@ -32,6 +32,7 @@ variable {D : Type u} /-- **Module-level Schur vanishing**: the block of the shape acts as zero on the relative tensor power of the module. -/ +@[expose] def ModSchurKilled [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [HasFiniteBiproducts D] [HasCoequalizers D] [Linear ℂ D] (A : D) [MonObj A] (X : D) [ModObj A X] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModSchurSummand.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModSchurSummand.lean index c21775421e..d566bbd3f1 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModSchurSummand.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModSchurSummand.lean @@ -17,7 +17,7 @@ on the relative tensor powers: the module-power map of the section is a split monomorphism and intertwines the two actions. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModTensor.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModTensor.lean index ce6d5be2a0..7de7abb804 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModTensor.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModTensor.lean @@ -47,7 +47,7 @@ The development is scoped to the structures above; associativity of `modTensor` is outside this module's scope. -/ -@[expose] public section +public section namespace RS @@ -62,6 +62,7 @@ section ActLeft /-- The action morphism of a module object, typed at the tensor product. -/ +@[expose] def actLeft [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] (X : D) [ModObj A X] : A ⊗ X ⟶ X := γ[A, X] @@ -99,7 +100,7 @@ lemma actLeft_natural [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] /-- The regular module, with underlying object reducibly `A`; it is definitionally Mathlib's `Mod.regular A`. -/ -@[reducible] +@[expose, reducible] def regularMod [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] : Mod D A := letI := ModObj.regular A @@ -138,7 +139,7 @@ lemma mul_act_tensorRight /-- A left module tensored with an object on the right: the action of `A` on `X ⊗ V` through the left factor. -/ -@[implicit_reducible] +@[expose, implicit_reducible] def tensorRightModObj [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] (X : D) [ModObj A X] (V : D) : ModObj A (X ⊗ V) where @@ -157,7 +158,7 @@ def tensorRightModObj [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] /-- The free module on an object: `A ⊗ V` with the action given by multiplication on the left factor. -/ -@[implicit_reducible] +@[expose, implicit_reducible] def freeModObj [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] (V : D) : ModObj A (A ⊗ V) := letI := ModObj.regular A @@ -176,7 +177,7 @@ theorem whiskerLeft_one_mul monoidal /-- The free module on an object, bundled. -/ -def freeMod [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] +@[expose] def freeMod [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] (V : D) : Mod D A := letI := freeModObj A V ⟨A ⊗ V⟩ @@ -194,6 +195,7 @@ section RightAction /-- The right action of `A` on a left module, induced by the braiding. -/ +@[expose] def actRight [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] [BraidedCategory D] (X : D) [ModObj A X] : X ⊗ A ⟶ X := @@ -230,6 +232,7 @@ lemma actRight_natural_mod factors, having carried the first generator past the second algebra factor. This is at once the head absorption that folds an incoming free letter into an accumulated head. -/ +@[expose] def freeModShuffle [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] [BraidedCategory D] (V W : D) : (A ⊗ V) ⊗ (A ⊗ W) ⟶ A ⊗ (V ⊗ W) := @@ -268,6 +271,7 @@ section ModTensor /-- First leg of the module-tensor parallel pair on `(M.X ⊗ A) ⊗ N.X`: act on `M` through the braided right action. -/ +@[expose] def modTensorLegM [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] [BraidedCategory D] (M : Mod D A) (N : Mod D A) : (M.X ⊗ A) ⊗ N.X ⟶ M.X ⊗ N.X := @@ -275,6 +279,7 @@ def modTensorLegM [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] /-- Second leg of the module-tensor parallel pair on `(M.X ⊗ A) ⊗ N.X`: associate and act on `N`. -/ +@[expose] def modTensorLegN [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] (M : Mod D A) (N : Mod D A) : (M.X ⊗ A) ⊗ N.X ⟶ M.X ⊗ N.X := @@ -327,12 +332,14 @@ section /-- The tensor product of two modules over `A`: the coequalizer of `modTensorLegM` and `modTensorLegN`. -/ +@[expose] noncomputable def modTensor [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] [BraidedCategory D] (M : Mod D A) (N : Mod D A) [HasCoequalizers D] : D := coequalizer (modTensorLegM A M N) (modTensorLegN A M N) /-- The projection onto the tensor product of modules. -/ +@[expose] noncomputable def modTensorπ [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] [BraidedCategory D] (M : Mod D A) (N : Mod D A) [HasCoequalizers D] : @@ -614,7 +621,7 @@ lemma modTensorDescAct_desc /-- Descend a compatible monoid action on `M.X` to a module structure on the tensor product. -/ -@[implicit_reducible] +@[expose, implicit_reducible] noncomputable def modTensorDescModObj [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] [BraidedCategory D] (M : Mod D A) (N : Mod D A) [HasCoequalizers D] @@ -637,7 +644,7 @@ section TensorModule /-- The `A`-module structure on the tensor product of modules over a commutative monoid: the action on the `M`-factor descends. -/ -@[implicit_reducible] +@[expose, implicit_reducible] noncomputable def modTensorModObj [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] [BraidedCategory D] [IsCommMonObj A] (M : Mod D A) (N : Mod D A) @@ -648,6 +655,7 @@ noncomputable def modTensorModObj (actLeft_actRight A M.X) (one_actLeft A M.X) (mul_actLeft A M.X) /-- The action of `A` on the tensor product of modules. -/ +@[expose] noncomputable def modTensorAct [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] [BraidedCategory D] [IsCommMonObj A] (M : Mod D A) (N : Mod D A) @@ -692,7 +700,7 @@ lemma modTensorAct_mul [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] (actLeft_actRight A M.X) (mul_actLeft A M.X) /-- The tensor product of modules, bundled as a module. -/ -noncomputable def modTensorMod +@[expose] noncomputable def modTensorMod [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] [BraidedCategory D] [IsCommMonObj A] (M : Mod D A) (N : Mod D A) [HasCoequalizers D] @@ -764,7 +772,7 @@ lemma modTensorLegM_regular_actRight /-- The regular module is a left unit for the module tensor product. -/ -@[simps] +@[expose, simps] noncomputable def modTensorUnitLeft [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] [BraidedCategory D] [IsCommMonObj A] (N : Mod D A) [HasCoequalizers D] : @@ -797,7 +805,7 @@ noncomputable def modTensorUnitLeft /-- The regular module is a right unit for the module tensor product of a commutative monoid. -/ -@[simps] +@[expose, simps] noncomputable def modTensorUnitRight [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] [BraidedCategory D] [IsCommMonObj A] (M : Mod D A) [HasCoequalizers D] : @@ -962,6 +970,7 @@ lemma modTensorAct_map [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] rw [reassoc_of% hpre] /-- Functoriality, as a morphism of bundled modules. -/ +@[expose] noncomputable def modTensorMapMod [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] [BraidedCategory D] {M : Mod D A} {M' : Mod D A} {N : Mod D A} @@ -972,6 +981,7 @@ noncomputable def modTensorMapMod Mod.Hom.mk' (modTensorMap A f g) (modTensorAct_map A f g) /-- The relative tensor product of two module isomorphisms. -/ +@[expose] noncomputable def modTensorMapIso [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] [BraidedCategory D] {M : Mod D A} {M' : Mod D A} {N : Mod D A} @@ -998,7 +1008,7 @@ section BaseChange /-- `B` as an `A`-module by restriction along `φ`, with underlying object reducibly `B`. -/ -@[reducible] +@[expose, reducible] def restrictRegular [Category.{v} D] [MonoidalCategory D] {A : D} {B : D} [MonObj A] [MonObj B] (φ : A ⟶ B) [IsMonHom φ] : Mod D A := @@ -1036,6 +1046,7 @@ lemma mul_actRight_restrictRegular /-- Base change along `φ`: the extension `B ⊗[A] M` of an `A`-module `M`. -/ +@[expose] noncomputable def baseChange [Category.{v} D] [MonoidalCategory D] {A : D} {B : D} [MonObj A] [MonObj B] (φ : A ⟶ B) [IsMonHom φ] [BraidedCategory D] @@ -1045,7 +1056,7 @@ noncomputable def baseChange /-- The `B`-module structure on the base change: multiplication on the left factor descends. -/ -@[implicit_reducible] +@[expose, implicit_reducible] noncomputable def baseChangeModObj [Category.{v} D] [MonoidalCategory D] {A : D} {B : D} [MonObj A] [MonObj B] (φ : A ⟶ B) [IsMonHom φ] [BraidedCategory D] @@ -1058,6 +1069,7 @@ noncomputable def baseChangeModObj (MonObj.mul_assoc B) /-- The action of `B` on the base change. -/ +@[expose] noncomputable def baseChangeAct [Category.{v} D] [MonoidalCategory D] {A : D} {B : D} [MonObj A] [MonObj B] (φ : A ⟶ B) [IsMonHom φ] [BraidedCategory D] @@ -1083,7 +1095,7 @@ lemma whiskerLeft_modTensorπ_baseChangeAct (mul_actRight_restrictRegular φ) /-- Base change, bundled as a `B`-module. -/ -noncomputable def baseChangeMod +@[expose] noncomputable def baseChangeMod [Category.{v} D] [MonoidalCategory D] {A : D} {B : D} [MonObj A] [MonObj B] (φ : A ⟶ B) [IsMonHom φ] [BraidedCategory D] [HasCoequalizers D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModZero.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModZero.lean index bfce9d89d7..f6a5ef050f 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModZero.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ModZero.lean @@ -18,7 +18,7 @@ epic, and the ordinary tensor product with a zero object is zero. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/MuInterchange.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/MuInterchange.lean index 760549cc98..6c1d5cfa23 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/MuInterchange.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/MuInterchange.lean @@ -18,7 +18,7 @@ twice. This is the symmetric-category companion of Mathlib's adjacent symmetry cancellation dissolves the doubled crossing. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/MulBy.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/MulBy.lean index 61f7bc9395..b1775884d1 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/MulBy.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/MulBy.lean @@ -23,7 +23,7 @@ its kernel and an ideal for its image, so simplicity makes it invertible, and the preimage of the unit is then an inverse for `g`. -/ -@[expose] public section +public section namespace RS @@ -37,6 +37,7 @@ section Basic variable {D : Type u} /-- **Multiplication by an even scalar.** -/ +@[expose] noncomputable def mulBy [Category.{v} D] [MonoidalCategory D] (R : D) [MonObj R] (g : 𝟙_ D ⟶ R) : R ⟶ R := (λ_ R).inv ≫ gmul g (𝟙 R) diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/NatChain.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/NatChain.lean index cd90a024cb..dd289b990d 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/NatChain.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/NatChain.lean @@ -18,7 +18,7 @@ defined by recursion on its length, with the composition law proved once and the one-step computation exposed as a simp lemma. -/ -@[expose] public section +public section namespace RS @@ -71,7 +71,7 @@ theorem chainMap_trans [Category.{v} D] /-- The functor out of `ℕ` assembled from objects and one-step transitions. -/ -noncomputable def chainFunctor [Category.{v} D] +@[expose] noncomputable def chainFunctor [Category.{v} D] (B : ℕ → D) (δ : ∀ n, B n ⟶ B (n + 1)) : ℕ ⥤ D where obj := B diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/NewtonConv.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/NewtonConv.lean index 4369d96cd6..09ae6f63d6 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/NewtonConv.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/NewtonConv.lean @@ -28,7 +28,7 @@ Coefficient extraction yields the consumer-facing convolution formula for Jacobi–Trudi consumers. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/NullPoint.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/NullPoint.lean index 0dfd8d8c33..8763c10f3c 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/NullPoint.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/NullPoint.lean @@ -17,7 +17,7 @@ the Jacobson ring ℂ, and lift to the algebraically closed base. This is the Nullstellensatz input of the descent's final step. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/OddLineMap.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/OddLineMap.lean index 69e1a32bb0..e05c5b58ae 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/OddLineMap.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/OddLineMap.lean @@ -17,7 +17,7 @@ the self-braiding of the image is the image of the self-braiding, which is minus an identity. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/OddLinePairing.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/OddLinePairing.lean index 01d4e0faa8..3f15c9da8b 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/OddLinePairing.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/OddLinePairing.lean @@ -19,7 +19,7 @@ the hexagon turns that cyclic rearrangement into a braiding past the trivialisation, which the unit coherences absorb. -/ -@[expose] public section +public section namespace RS @@ -149,7 +149,7 @@ theorem OddLine.coevaluation_evaluation /-- **The odd line is self-dual**: the square trivialisation is an exact pairing of the line with itself. -/ -@[implicit_reducible] +@[expose, implicit_reducible] noncomputable def OddLine.exactPairing [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] (L : OddLine D) : diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/OddParity.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/OddParity.lean index 7a3c91472b..3de51c0f30 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/OddParity.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/OddParity.lean @@ -23,7 +23,7 @@ The mirror form, with the twist on the left, is obtained from this one by transporting along the braiding. -/ -@[expose] public section +public section namespace RS @@ -57,6 +57,7 @@ theorem OddLine.coevaluation_whiskerRight /-- **Tensoring by the odd line swaps parity**: points of a twisted object are odd elements of the object. -/ +@[expose] noncomputable def oddParitySwap [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [CategoryTheory.Linear ℂ D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/OddPermSign.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/OddPermSign.lean index 26e9937344..fc8db36fd6 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/OddPermSign.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/OddPermSign.lean @@ -21,7 +21,7 @@ sign. The linear extension evaluates the group algebra's action on a single group element accordingly. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/OddSquare.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/OddSquare.lean index 825f2bb649..635def4304 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/OddSquare.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/OddSquare.lean @@ -24,7 +24,7 @@ of parities — are the content of this file. Two of them carry a sign, and the sign is the self-braiding of the odd line. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/OddSquareIso.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/OddSquareIso.lean index 1893a0854b..eb9e3da63f 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/OddSquareIso.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/OddSquareIso.lean @@ -23,7 +23,7 @@ is an isomorphism. The sign is the self-braiding of the line and is the same on all four blocks. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PairCarrier.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PairCarrier.lean index 0be5dd03be..4a1750b4b9 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PairCarrier.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PairCarrier.lean @@ -18,7 +18,7 @@ and the copair element multiplies to the unit of the carrier — the section identity of the splitting data of the Key Lemma. -/ -@[expose] public section +public section namespace RS @@ -32,6 +32,7 @@ variable {D : Type u} /-- **The pair product on the carrier**: the descended pair product of the entries, entering the degree-zero component two stages up. -/ +@[expose] noncomputable def splitPairMul [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PairMul.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PairMul.lean index 4b5fa3a52a..5c68ffea8f 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PairMul.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PairMul.lean @@ -18,7 +18,7 @@ crossed pairs. The chain transitions and the stage products of the splitting algebra factor through it. -/ -@[expose] public section +public section namespace RS @@ -30,6 +30,7 @@ universe v u variable {D : Type u} /-- The raw interchange: cross the middle factors. -/ +@[expose] def rawInterchange [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] (A : D) [MonObj A] (N₁ : Mod D A) (N₂ : Mod D A) (P₁ : Mod D A) (P₂ : Mod D A) : @@ -38,6 +39,7 @@ def rawInterchange tensorμ N₁.X N₂.X P₁.X P₂.X /-- The raw interchange followed by the projections. -/ +@[expose] noncomputable def rawInterchangeπ [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PairPerm.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PairPerm.lean index a10002d4ef..ceaca3d1a6 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PairPerm.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PairPerm.lean @@ -39,7 +39,7 @@ into the *order-reversing adjoint* permutation of the `M'`-slots. symmetric powers. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PermNat.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PermNat.lean index bd5fcc7db6..b659a68660 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PermNat.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PermNat.lean @@ -29,7 +29,7 @@ intertwines the two actions, so if the block idempotent kills `X ^ ⊗ n` it kills `Y ^ ⊗ n` as well. -/ -@[expose] public section +public section namespace RS @@ -43,6 +43,7 @@ variable {A : Type u} /-- **The tensor power of a morphism**: `f ^ ⊗ n` acts as `f` on every factor, by the same recursion that defines `tensorPow`. -/ +@[expose] noncomputable def tensorPowMap [Category.{v} A] [MonoidalCategory A] {X Y : A} (f : X ⟶ Y) : (n : ℕ) → (tensorPow A X n ⟶ tensorPow A Y n) diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PermRepChar.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PermRepChar.lean index ef1f6b42d4..46c98f9032 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PermRepChar.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PermRepChar.lean @@ -28,7 +28,7 @@ Schur specialisation as the dimension of an equivariant Hom space. -/ -@[expose] public section +public section namespace RS @@ -40,6 +40,7 @@ open Finset Equiv MonoidAlgebra /-- The colour space: all colourings of `n` sites in `p` colours, the basis of the `n`-th tensor power of `ℂ^p`. -/ +@[expose] def colourSpace (n p : ℕ) : Type := Fin n → Fin p /-- The colour space is finite. -/ diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PieriPos.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PieriPos.lean index 0f2664d27f..2364a4e8fc 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PieriPos.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PieriPos.lean @@ -37,7 +37,7 @@ specialisations. the nonvanishing direction of Deligne 1.9 on the character side. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PlainShuffle.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PlainShuffle.lean index b17977798f..d29aea1ca5 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PlainShuffle.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PlainShuffle.lean @@ -30,7 +30,7 @@ equivariance statements in the form the plain tensor-power calculus consumes. -/ -@[expose] public section +public section namespace RS @@ -46,6 +46,7 @@ unitor, and each further step of the recursion is the middle-four interchange `tensorμ`, inverted by `tensorδ`. It is the distribution isomorphism `tensorPowDistrib`, under the shuffle's own name. -/ +@[expose] noncomputable def plainShuffle [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] (X Y : D) (n : ℕ) : diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PointBaseChange.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PointBaseChange.lean index 6cbf359d53..453dabc716 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PointBaseChange.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PointBaseChange.lean @@ -61,7 +61,7 @@ finite-dimensional spaces is finite-dimensional. `RS.freeEvenEquivFin`, `freeOddEquivFin`. -/ -@[expose] public section +public section namespace RS @@ -76,6 +76,7 @@ variable {S : SuperCommAlgebra.{u, u}} /-! ## The two component functors -/ /-- **The even component as a functor** to complex vector spaces. -/ +@[expose] noncomputable def evenModFunctor (S : SuperCommAlgebra.{u, u}) : S.Mod.{u, u, u, u} ⥤ ModuleCat.{u} ℂ where obj M := ModuleCat.of ℂ M.even @@ -103,6 +104,7 @@ instance oddModFunctor_additive (S : SuperCommAlgebra.{u, u}) : /-- An isomorphism of super modules is a linear equivalence on even components. -/ +@[expose] noncomputable def evenEquiv {M N : S.Mod.{u, u, u, u}} (e : M ≅ N) : M.even ≃ₗ[ℂ] N.even := ((evenModFunctor S).mapIso e).toLinearEquiv @@ -134,6 +136,7 @@ noncomputable def oddBiproductEquiv {J : Type} [Fintype J] /-! ## Tensoring on the right -/ /-- **Tensoring on the right by a fixed module**, as a functor. -/ +@[expose] noncomputable def tensorRightFunctor (N : S.Mod.{u, u, u, u}) : S.Mod.{u, u, u, u} ⥤ S.Mod.{u, u, u, u} where obj M := M.tensor N @@ -162,6 +165,7 @@ variable {S : SuperCommAlgebra.{u, u}} /-- **Base change of the unit module**: tensoring the unit with the residue module of a point returns the residue module. This is the left unitor. -/ +@[expose] noncomputable def unitTensorPoint (P : SuperPoint S) : (S.unitMod.tensor (pointMod P) : S.Mod.{u, u, u, u}) ≅ pointMod P := @@ -364,6 +368,7 @@ the space of coordinate vectors of its dimension. The two equivalences `RS.toSuperVectEvenEquiv` and `RS.toSuperVectOddEquiv` identify the components of the base change with the components of this super vector space. -/ +@[expose] noncomputable def toSuperVect (P : SuperPoint S) (M : S.Mod.{u, u, u, u}) : diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PointFibre.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PointFibre.lean index a9de931945..457cad1260 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PointFibre.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PointFibre.lean @@ -80,7 +80,7 @@ algebra being a monomorphism — vanishes itself. * `RS.exists_deligneFibre_of_point`: the four properties packaged. -/ -@[expose] public section +public section namespace RS open CategoryTheory Limits @@ -216,6 +216,7 @@ variable {M N Q : S.Mod.{u, u, u, u}} The morphism is tensored with the residue module and the result is read in the coordinates that `RS.toSuperVect` installs on the two components. -/ +@[expose] noncomputable def superVectHom [FiniteDimensional ℂ (M.tensor (pointMod P)).even] [FiniteDimensional ℂ (M.tensor (pointMod P)).odd] @@ -342,6 +343,7 @@ variable {S : SuperCommAlgebra.{u, u}} (P : SuperPoint S) {E : Type u₂} tensored with the residue module of the point and packaged as a super vector space; each morphism is conjugated through the coordinate equivalences. -/ +@[expose] noncomputable def superVectFunctor [Category.{v₂} E] (G : E ⥤ S.Mod.{u, u, u, u}) (hE : ∀ X, FiniteDimensional ℂ ((G.obj X).tensor (pointMod P)).even) @@ -584,6 +586,7 @@ theorem finiteDimensional_indFibre_odd /-- **The fibre functor into super vector spaces**: embed, take the fibre over the splitting algebra, and base change to the ℂ-point. -/ +@[expose] noncomputable def deligneFibre [SmallCategory C] [MonoidalCategory C] [SymmetricCategory C] [Abelian C] [MonoidalPreadditive C] [CategoryTheory.Linear ℂ (Ind C)] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PointMonoidal/Calculus.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PointMonoidal/Calculus.lean index 932b5ce501..8220f6a5d2 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PointMonoidal/Calculus.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PointMonoidal/Calculus.lean @@ -43,7 +43,7 @@ proved in [Coherence.lean](Coherence.lean). threefold graded tensor product. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PointMonoidal/Coherence.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PointMonoidal/Coherence.lean index 3409581715..dbbedeb379 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PointMonoidal/Coherence.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PointMonoidal/Coherence.lean @@ -41,7 +41,7 @@ strength of base change along an algebra map, in super form. are invertible. -/ -@[expose] public section +public section namespace RS @@ -920,6 +920,7 @@ variable {S : SuperCommAlgebra.{u, u}} (P : SuperPoint S) /-- **The unit comparison of the fibre functor**, before the coordinates are installed: a complex number is scaled into the algebra and pushed into the base change. -/ +@[expose] noncomputable def superVectEpsRaw : ℂ →ₗ[ℂ] ((S.unitMod : S.Mod.{u, u, u, u}).tensor (pointMod P)).even := @@ -928,6 +929,7 @@ noncomputable def superVectEpsRaw : /-- **The unit comparison of the fibre functor**: the unit super vector space maps to the base change of the unit module. -/ +@[expose] noncomputable def superVectEps [FiniteDimensional ℂ ((S.unitMod : S.Mod.{u, u, u, u}).tensor (pointMod P)).even] : diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PointMonoidal/Comparison.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PointMonoidal/Comparison.lean index d26fd1fe52..2bdefdff3f 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PointMonoidal/Comparison.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PointMonoidal/Comparison.lean @@ -46,7 +46,7 @@ hypothesis is needed. tensor product of super vector spaces. -/ -@[expose] public section +public section namespace RS @@ -72,6 +72,7 @@ open scoped TensorProduct variable {S : SuperCommAlgebra.{u, u}} (P : SuperPoint S) /-- The unit of the residue module. -/ +@[expose] noncomputable def pointOne : (pointMod P : S.Mod.{u, u, u, u}).even := ULift.up 1 @@ -79,6 +80,7 @@ noncomputable def pointOne : (pointMod P : S.Mod.{u, u, u, u}).even := complex vector space by its underlying complex number. The residue module being one dimensional in even degree, this describes every linear map out of it. -/ +@[expose] noncomputable def pointScale (X : Type u) [AddCommGroup X] [Module ℂ X] : X →ₗ[ℂ] ((pointMod P : S.Mod.{u, u, u, u}).even →ₗ[ℂ] X) where @@ -152,6 +154,7 @@ open scoped TensorProduct /-- **The graded comparison in even degree**: the quotient map onto the even part of the tensor product. -/ +@[expose] noncomputable def gradedTensorEven : (A.even ⊗[ℂ] B.even) × (A.odd ⊗[ℂ] B.odd) →ₗ[ℂ] (A.tensor B : S.Mod.{u, u, u, u}).even := @@ -159,6 +162,7 @@ noncomputable def gradedTensorEven : /-- **The graded comparison in odd degree**: the quotient map onto the odd part of the tensor product. -/ +@[expose] noncomputable def gradedTensorOdd : (A.even ⊗[ℂ] B.odd) × (A.odd ⊗[ℂ] B.even) →ₗ[ℂ] (A.tensor B : S.Mod.{u, u, u, u}).odd := @@ -255,6 +259,7 @@ abbrev basePairOdd : Type u := (N.tensor (pointMod P)).even) /-- The even-even block of the inverse comparison. -/ +@[expose] noncomputable def baseNuFee : M.even →ₗ[ℂ] N.even →ₗ[ℂ] ((pointMod P : S.Mod.{u, u, u, u}).even →ₗ[ℂ] @@ -269,6 +274,7 @@ noncomputable def baseNuFee : (pointScale P (basePairEven P M N)) /-- The odd-odd block of the inverse comparison. -/ +@[expose] noncomputable def baseNuFoo : M.odd →ₗ[ℂ] N.odd →ₗ[ℂ] ((pointMod P : S.Mod.{u, u, u, u}).even →ₗ[ℂ] @@ -283,6 +289,7 @@ noncomputable def baseNuFoo : (pointScale P (basePairEven P M N)) /-- The even-odd block of the inverse comparison. -/ +@[expose] noncomputable def baseNuFeo : M.even →ₗ[ℂ] N.odd →ₗ[ℂ] ((pointMod P : S.Mod.{u, u, u, u}).even →ₗ[ℂ] @@ -297,6 +304,7 @@ noncomputable def baseNuFeo : (pointScale P (basePairOdd P M N)) /-- The odd-even block of the inverse comparison. -/ +@[expose] noncomputable def baseNuFoe : M.odd →ₗ[ℂ] N.even →ₗ[ℂ] ((pointMod P : S.Mod.{u, u, u, u}).even →ₗ[ℂ] @@ -426,6 +434,7 @@ variable (M N) /-- **The inner lift of the inverse comparison**, in even degree: the two even blocks descend to the tensor product of the two modules. -/ +@[expose] noncomputable def baseNuInnerEven : (M.tensor N : S.Mod.{u, u, u, u}).even →ₗ[ℂ] ((pointMod P : S.Mod.{u, u, u, u}).even →ₗ[ℂ] @@ -435,6 +444,7 @@ noncomputable def baseNuInnerEven : (baseNuFoo_balanced_oeo P) (baseNuFee_balanced_ooe P) /-- **The inner lift of the inverse comparison**, in odd degree. -/ +@[expose] noncomputable def baseNuInnerOdd : (M.tensor N : S.Mod.{u, u, u, u}).odd →ₗ[ℂ] ((pointMod P : S.Mod.{u, u, u, u}).even →ₗ[ℂ] @@ -615,6 +625,7 @@ variable (M N : S.Mod.{u, u, u, u}) /-- **The comparison morphism in super vector spaces**, in even degree, before the coordinates are installed. -/ +@[expose] noncomputable def superVectMuEvenRaw : ((M.tensor (pointMod P)).even ⊗[ℂ] (N.tensor (pointMod P)).even) × @@ -626,6 +637,7 @@ noncomputable def superVectMuEvenRaw : /-- **The comparison morphism in super vector spaces**, in odd degree, before the coordinates are installed. -/ +@[expose] noncomputable def superVectMuOddRaw : ((M.tensor (pointMod P)).even ⊗[ℂ] (N.tensor (pointMod P)).odd) × @@ -637,6 +649,7 @@ noncomputable def superVectMuOddRaw : /-- The coordinates on the even part of the tensor product of the two base changes. -/ +@[expose] noncomputable def superVectPairEvenEquiv [FiniteDimensional ℂ (M.tensor (pointMod P)).even] [FiniteDimensional ℂ (M.tensor (pointMod P)).odd] @@ -652,6 +665,7 @@ noncomputable def superVectPairEvenEquiv /-- The coordinates on the odd part of the tensor product of the two base changes. -/ +@[expose] noncomputable def superVectPairOddEquiv [FiniteDimensional ℂ (M.tensor (pointMod P)).even] [FiniteDimensional ℂ (M.tensor (pointMod P)).odd] @@ -669,6 +683,7 @@ noncomputable def superVectPairOddEquiv product of the base changes maps to the base change of the tensor product. It is the raw comparison, read in the coordinates that `RS.toSuperVect` installs. -/ +@[expose] noncomputable def superVectMu [FiniteDimensional ℂ (M.tensor (pointMod P)).even] [FiniteDimensional ℂ (M.tensor (pointMod P)).odd] [FiniteDimensional ℂ (N.tensor (pointMod P)).even] @@ -699,18 +714,22 @@ section Summands open scoped TensorProduct /-- The even-even block of the even part. -/ +@[expose] def svEvenInl {V W : SuperVect} (t : V.even ⊗[ℂ] W.even) : (V ⊗ W).even := (t, 0) /-- The odd-odd block of the even part. -/ +@[expose] def svEvenInr {V W : SuperVect} (t : V.odd ⊗[ℂ] W.odd) : (V ⊗ W).even := (0, t) /-- The even-odd block of the odd part. -/ +@[expose] def svOddInl {V W : SuperVect} (t : V.even ⊗[ℂ] W.odd) : (V ⊗ W).odd := (t, 0) /-- The odd-even block of the odd part. -/ +@[expose] def svOddInr {V W : SuperVect} (t : V.odd ⊗[ℂ] W.even) : (V ⊗ W).odd := (0, t) diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PointMonoidal/Functor.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PointMonoidal/Functor.lean index 7fd7b38b5a..8fd79be362 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PointMonoidal/Functor.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PointMonoidal/Functor.lean @@ -32,7 +32,7 @@ gives a braided fibre functor out of the ambient category. splitting algebra at a complex point is braided. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PointMonoidal/Residue.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PointMonoidal/Residue.lean index 089f6753f2..159a507ffd 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PointMonoidal/Residue.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PointMonoidal/Residue.lean @@ -46,7 +46,7 @@ The comparison is carried down to super vector spaces in generator computations consume. -/ -@[expose] public section +public section namespace RS @@ -93,6 +93,7 @@ theorem pointMod_actOO (u : S.odd) /-- **The multiplication of the residue module**, on even parts: the residue module is a copy of ℂ in even degree, and this is the multiplication of ℂ. -/ +@[expose] noncomputable def pointMulLin : (pointMod P : S.Mod.{u, u, u, u}).even →ₗ[ℂ] (pointMod P : S.Mod.{u, u, u, u}).even →ₗ[ℂ] @@ -177,6 +178,7 @@ noncomputable def pointMulHom : /-- **The unit of the residue module**: the point itself, read as a morphism from the algebra. -/ +@[expose] noncomputable def pointUnitHom : (S.unitMod : S.Mod.{u, u, u, u}) ⟶ pointMod P where evenMap := (ULift.moduleEquiv (R := ℂ) (M := ℂ)).symm.toLinearMap ∘ₗ @@ -236,6 +238,7 @@ noncomputable def pointBaseMu (M N : S.Mod.{u, u, u, u}) : /-- **The unit of base change**, over the algebra: the point read as a morphism from the unit, followed by the inverse left unitor. -/ +@[expose] noncomputable def pointBaseEps : (S.unitMod : S.Mod.{u, u, u, u}) ⟶ (S.unitMod : S.Mod.{u, u, u, u}).tensor (pointMod P) := diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PointTensor.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PointTensor.lean index bdc679ce53..9a8952a6bd 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PointTensor.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PointTensor.lean @@ -18,7 +18,7 @@ monomorphism, and in particular nonzero. This is the input that makes a tensor product of nonzero algebras nonzero. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowAct.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowAct.lean index e3f8780b29..a0e7b3ce91 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowAct.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowAct.lean @@ -35,7 +35,7 @@ symmetric power a module again. * `modPowMod`/`symPowMod`: the bundled modules. -/ -@[expose] public section +public section namespace RS @@ -52,6 +52,7 @@ section BraidPast /-- Carry an object across a context: the isomorphism `A ⊗ (V ⊗ T) ≅ V ⊗ (A ⊗ T)` braiding `A` past `V`. -/ +@[expose] def braidPast [Category.{v} D] [MonoidalCategory D] [BraidedCategory D] (A V T : D) : A ⊗ (V ⊗ T) ≅ V ⊗ (A ⊗ T) := (α_ A V T).symm ≪≫ whiskerRightIso (β_ A V) T ≪≫ α_ V A T @@ -126,6 +127,7 @@ section ActAcross /-- The action of a monoid on `V ⊗ X` through the right factor: braid `A` past `V`, then act on `X`. -/ +@[expose] def actAcross [Category.{v} D] [MonoidalCategory D] [BraidedCategory D] (A : D) [MonObj A] (V X : D) [ModObj A X] : A ⊗ (V ⊗ X) ⟶ V ⊗ X := @@ -199,7 +201,7 @@ theorem mul_actAcross /-- A left module tensored with an object on the left: the action of `A` on `V ⊗ X` through the right factor. -/ -@[implicit_reducible] +@[expose, implicit_reducible] def tensorLeftModObj [Category.{v} D] [MonoidalCategory D] [BraidedCategory D] (A : D) [MonObj A] @@ -297,6 +299,7 @@ section PowTail /-- The raw tail action on a positive tensor power: the monoid acts on the last factor, braided past the lower power. -/ +@[expose] def powTailAct [Category.{v} D] [MonoidalCategory D] [BraidedCategory D] (A : D) [MonObj A] (X : D) [ModObj A X] (n : ℕ) : @@ -721,7 +724,7 @@ theorem modPowAct_mul /-- **The module power of a module is a module**, in every positive arity. -/ -@[implicit_reducible] +@[expose, implicit_reducible] noncomputable def modPowModObj [Category.{v} D] [MonoidalCategory D] [BraidedCategory D] (A : D) [MonObj A] (X : D) [ModObj A X] [Preadditive D] [HasFiniteBiproducts D] @@ -734,6 +737,7 @@ noncomputable def modPowModObj mul_smul := modPowAct_mul A X n /-- The module power of a module, bundled as a module. -/ +@[expose] noncomputable def modPowMod [Category.{v} D] [MonoidalCategory D] [BraidedCategory D] (A : D) [MonObj A] (X : D) [ModObj A X] [Preadditive D] [HasFiniteBiproducts D] @@ -1038,6 +1042,7 @@ section SymAct /-- **The monoid action on the symmetric power**, through the section and the descended action. -/ +@[expose] noncomputable def symPowAct [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] (A : D) [MonObj A] (X : D) [ModObj A X] [Preadditive D] [HasFiniteBiproducts D] @@ -1101,7 +1106,7 @@ theorem symPowAct_mul /-- **The symmetric power of a module is a module**, in every positive arity. -/ -@[implicit_reducible] +@[expose, implicit_reducible] noncomputable def symPowModObj [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] (A : D) [MonObj A] (X : D) [ModObj A X] [Preadditive D] [HasFiniteBiproducts D] @@ -1135,6 +1140,7 @@ theorem symPowσ_modPowAct rw [symPowπ_symPowσ, h', ← whiskerLeft_comp_assoc, hσI] /-- The symmetric power of a module, bundled as a module. -/ +@[expose] noncomputable def symPowMod [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] (A : D) [MonObj A] (X : D) [ModObj A X] [Preadditive D] [HasFiniteBiproducts D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowActMul.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowActMul.lean index bf17393643..ac5891292d 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowActMul.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowActMul.lean @@ -36,7 +36,7 @@ into `A`-module algebras. equivariance of the descended action. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowChain.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowChain.lean index c5a4d00d8e..19f1599e73 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowChain.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowChain.lean @@ -18,7 +18,7 @@ multiply; the copairing seeds the bottom stage, and the iterated seed multiplication is the copairing power of the duality datum. -/ -@[expose] public section +public section namespace RS @@ -117,6 +117,7 @@ theorem powMulDesc_act simpa only [Category.assoc] using h /-- The descended power multiplication as a map of modules. -/ +@[expose] noncomputable def powMulMod [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] @@ -150,6 +151,7 @@ theorem actLeft_modPowOne_inv simp only [Iso.hom_inv_id, Category.comp_id] /-- A module maps into the singleton stage of its power tower. -/ +@[expose] noncomputable def toModPowModZero [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] @@ -162,6 +164,7 @@ noncomputable def toModPowModZero /-- One stage of the power chain: the module tensor product of matching module powers of the dual pair, in copairing order. -/ +@[expose] noncomputable def powStage [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] @@ -189,6 +192,7 @@ noncomputable def powChainMul /-- **The seed of the power chain**: the copairing lands in the bottom stage. -/ +@[expose] noncomputable def powSeed [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] @@ -201,6 +205,7 @@ noncomputable def powSeed modTensorMap A (toModPowModZero A M) (toModPowModZero A M') /-- An arity transport of module powers, as a map of modules. -/ +@[expose] noncomputable def modPowCastMod [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] @@ -213,6 +218,7 @@ noncomputable def modPowCastMod /-- The braiding of the module tensor product, as a map of modules. -/ +@[expose] noncomputable def modTensorSwapMod [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] @@ -226,6 +232,7 @@ noncomputable def modTensorSwapMod position of the nested pairing — the new factor joins the `M`-power at the front and the `M'`-power at the back, so the peel of the nested pairing removes exactly the inserted pair. -/ +@[expose] noncomputable def powDelta [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] @@ -248,6 +255,7 @@ noncomputable def powDelta /-- **The copairing powers**: the iterated seed multiplication along the power chain. -/ +@[expose] noncomputable def powUnitStage [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowCopairing.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowCopairing.lean index fcab6e8832..b777619521 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowCopairing.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowCopairing.lean @@ -25,7 +25,7 @@ nonvanishing engine of the Key Lemma's chain: a vanishing chain unit forces the unit of the base to vanish. -/ -@[expose] public section +public section namespace RS @@ -43,6 +43,7 @@ section Braided /-- **The copairing unit**: the copairing of the datum evaluated at the unit of the base. The seed of the chain units of the Key Lemma. -/ +@[expose] noncomputable def copairUnit [Category.{v} D] [MonoidalCategory D] [BraidedCategory D] [HasCoequalizers D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowDatum.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowDatum.lean index 4ab271e557..3285d01a1b 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowDatum.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowDatum.lean @@ -26,7 +26,7 @@ power datum detects the nonvanishing of the copairing powers from the nonvanishing of the power modules. -/ -@[expose] public section +public section namespace RS @@ -120,6 +120,7 @@ theorem powCopairA_linear /-- **The power duality datum**: the tensor powers of a dual pair form a dual pair, with the power pairing and the copairing power. -/ +@[expose] noncomputable def powDualityDatum [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowInduct.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowInduct.lean index 9cb07acc75..ec3de93a7c 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowInduct.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowInduct.lean @@ -21,7 +21,7 @@ transfer and the step is the tensor inheritance transferred along the merge. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowMerge.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowMerge.lean index 21752d8dc3..8fbc41bf5c 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowMerge.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowMerge.lean @@ -35,7 +35,7 @@ concatenation of ambient tensor powers. forward direction and `powSplit` as the inverse. -/ -@[expose] public section +public section namespace RS @@ -887,6 +887,7 @@ projection. section Interior /-- The bridge of `midConcatFst`, as an isomorphism. -/ +@[expose] noncomputable def midConcatFstIso [Category.{v} D] [MonoidalCategory D] (A : D) (X : D) (s t n : ℕ) : @@ -898,6 +899,7 @@ noncomputable def midConcatFstIso (tensorPowConcat X t n) /-- The bridge of `midConcatSnd`, as an isomorphism. -/ +@[expose] noncomputable def midConcatSndIso [Category.{v} D] [MonoidalCategory D] (A : D) (X : D) (m s t : ℕ) : diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowPairSucc.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowPairSucc.lean index bb1818197e..69fc5cbb2d 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowPairSucc.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowPairSucc.lean @@ -21,7 +21,7 @@ rearrangement itself is the retraction `tensorMu_braid_retract`, a pure braid coherence. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowPairing.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowPairing.lean index fc194eb3bc..72efcbd6ed 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowPairing.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowPairing.lean @@ -23,7 +23,7 @@ coequalizers reduce, by the same recursion, to the datum's linearity and the commutativity of the monoid. -/ -@[expose] public section +public section namespace RS @@ -41,6 +41,7 @@ section Braided section PairRaw /-- The datum's pairing evaluated on the raw tensor product. -/ +@[expose] noncomputable def pairRaw [Category.{v} D] [MonoidalCategory D] [BraidedCategory D] [HasCoequalizers D] @@ -127,6 +128,7 @@ recursion on the arity: at `n + 1`, peel the first factor of the `M`-power, pair it with the exposed last factor of the `M'`-power, braid the resulting scalar past the remaining `M`-power, and multiply it onto the pairing of the remaining powers. -/ +@[expose] noncomputable def rawPair [Category.{v} D] [MonoidalCategory D] [BraidedCategory D] [HasCoequalizers D] @@ -191,6 +193,7 @@ the step. section PairStep /-- The generic recursion step of the power pairing. -/ +@[expose] noncomputable def pairStep [Category.{v} D] [MonoidalCategory D] [BraidedCategory D] [HasCoequalizers D] @@ -1877,6 +1880,7 @@ section SymDescent /-- The section of the symmetric power, as a morphism of modules. -/ +@[expose] noncomputable def symPowσMod [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowPoint.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowPoint.lean index 6b1f790c75..2597868c56 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowPoint.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowPoint.lean @@ -21,7 +21,7 @@ monomorphism are monomorphisms. The substrate of the nonvanishing of the local splitting algebra. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowSucc.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowSucc.lean index aa64928ea8..299f1cc49a 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowSucc.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowSucc.lean @@ -19,7 +19,7 @@ extension principle reduces the comparison to the unit elements, where the chain recursion is definitional. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowSuccMod.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowSuccMod.lean index 9e9b705859..2522c01ab1 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowSuccMod.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowSuccMod.lean @@ -28,7 +28,7 @@ back — become isomorphisms of modules. inverse, with roundtrips. -/ -@[expose] public section +public section namespace RS @@ -64,6 +64,7 @@ theorem powSplit_act [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] /-- **The module-level inverse of the merge**: the split bundled as a map of modules. -/ +@[expose] noncomputable def powMulModInv [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] @@ -147,6 +148,7 @@ theorem modTensorSwapMod_modTensorSwapMod /-- **The front insertion**: merge a fresh factor onto the front of a module power, through the braiding. This is the `M`-side leg of the chain transition `powDelta`. -/ +@[expose] noncomputable def powFrontMod [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] @@ -220,6 +222,7 @@ theorem powFrontModInv_powFrontMod /-- **The back insertion**: merge a fresh factor onto the back of a module power — the bundled merge with a singleton right block. -/ +@[expose] noncomputable def powBackMod [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowTriangle.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowTriangle.lean index 3e878a61a7..c6dcc82860 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowTriangle.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowTriangle.lean @@ -18,7 +18,7 @@ evaluates every chain unit to the unit of the base. This is the nonvanishing engine of the Key Lemma's chain. -/ -@[expose] public section +public section namespace RS @@ -810,6 +810,7 @@ theorem powDelta_pairing modPowPairing A M M' d (n + 1)) := by rw [powDelta] repeat' erw [Category.assoc] + rfl refine hflat.trans ?_ refine ((congrArg (fun t => (ρ_ (powStage A M M' n)).inv ≫ diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowZig.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowZig.lean index 04f0aa8924..18ce570cd9 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowZig.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowZig.lean @@ -18,7 +18,7 @@ copairing (`RS.zigCarrier`), with their naturality in the module and their evaluation on scalars. -/ -@[expose] public section +public section namespace RS @@ -31,6 +31,7 @@ variable {D : Type u} /-- **The scalar-based copairing power**: the base acts on the chain unit. -/ +@[expose] noncomputable def powCopairA [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] @@ -140,6 +141,7 @@ noncomputable def zigCarrier (β_ (modTensor A M' M) M.X).hom ≫ carrierContract A p /-- The singleton stage maps back onto the module. -/ +@[expose] noncomputable def fromModPowModZero [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowZigzag.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowZigzag.lean index 32d63316ac..9dd9bf22ce 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowZigzag.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PowZigzag.lean @@ -19,7 +19,7 @@ step peels one inserted couple off the onion-aligned copairing power against the outermost ring of the nested pairing. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PresentedQuotient.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PresentedQuotient.lean index 4ae9e389b6..0f14443709 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/PresentedQuotient.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/PresentedQuotient.lean @@ -50,7 +50,7 @@ of a countably presented ind-object is of at most countable dimension any of its quotients (`RS.rank_hom_unit_le_aleph0_of_epi`). -/ -@[expose] public section +public section namespace RS @@ -117,6 +117,7 @@ variable {C : Type v} /-- A compatible family of maps into a fixed object, read as a diagram in the arrow category. -/ +@[expose] noncomputable def arrowDiagram [SmallCategory C] {I : Type v} [SmallCategory I] {D : I ⥤ Ind C} {Q : Ind C} @@ -137,6 +138,7 @@ noncomputable def arrowDiagram /-- **The diagram of images** of a compatible family of maps into a fixed object. -/ +@[expose] noncomputable def imageDiag [SmallCategory C] [Abelian C] {I : Type v} [SmallCategory I] {D : I ⥤ Ind C} {Q : Ind C} diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/Prop21.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/Prop21.lean index c92a5c9c84..b8f7f85a13 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/Prop21.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/Prop21.lean @@ -20,7 +20,7 @@ there is a nonzero commutative algebra in the Ind-completion whose fibre functor is strong monoidal, exact and faithful. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/Prop21Core.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/Prop21Core.lean index 32d8fe62c5..9d53677f21 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/Prop21Core.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/Prop21Core.lean @@ -22,7 +22,7 @@ algebra of `RS.exists_splitting_algebra` splits every embedded object and every embedded short exact sequence at once. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/Prop21General.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/Prop21General.lean index f08455785b..3574468fca 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/Prop21General.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/Prop21General.lean @@ -37,7 +37,7 @@ functor — is supplied by the growth dichotomy `RS.forall_exists_schurKilled`, applied to the doubling. -/ -@[expose] public section +public section namespace RS @@ -53,6 +53,7 @@ variable {A : Type v} /-- **The scalar unit of the doubling**, as the ring isomorphism that Proposition 2.1 consumes: the unit of the doubling is the unit of `A` in even degree, so its endomorphisms are the scalars. -/ +@[expose] def doubledScalarUnit [SmallCategory A] [MonoidalCategory A] [Abelian A] [MonoidalPreadditive A] [CategoryTheory.Linear ℂ A] (hu : HasScalarUnit A) : diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/Prop29.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/Prop29.lean index f0f4340237..85df1fe376 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/Prop29.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/Prop29.lean @@ -20,7 +20,7 @@ unit with braiding `−1`; local means after base change to some nonzero commutative algebra. -/ -@[expose] public section +public section namespace RS @@ -48,6 +48,7 @@ variable {D} /-- The mixed sum of `p` copies of the unit and `q` copies of the line. -/ +@[expose] noncomputable def OddLine.mix [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [HasFiniteBiproducts D] @@ -68,6 +69,7 @@ theorem OddLine.isZero_mix_zero /-- **Locally mixed**: after base change to some nonzero commutative algebra, the object becomes a sum of copies of the unit and the line. -/ +@[expose] def OddLine.LocallyMixed [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [HasFiniteBiproducts D] @@ -96,6 +98,7 @@ theorem OddLine.isZero_tensor_iff /-- **The trichotomy statement of record** (Deligne 2.9, the consumed direction): an object killed by some Schur functor is locally a mixed sum of the unit and the odd line. -/ +@[expose] def Prop29Statement [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [HasFiniteBiproducts D] [CategoryTheory.Linear ℂ D] (P : SchurPackage.{v}) (L : OddLine D) diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/Prop29Close.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/Prop29Close.lean index 7c188cfe36..5718b3ab6d 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/Prop29Close.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/Prop29Close.lean @@ -22,7 +22,7 @@ killed by some Schur functor is locally a mixed sum of the unit and the odd line. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/Prop29State.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/Prop29State.lean index 24e699c35e..a837793928 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/Prop29State.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/Prop29State.lean @@ -23,7 +23,7 @@ Lemma), splits a line factor (through the sign-twisted mirror), or exits with the remainder already zero. -/ -@[expose] public section +public section namespace RS @@ -80,6 +80,7 @@ section Steps /-- **Case (a) of the dévissage**: when every symmetric power of the remainder survives, a further unit factor splits off. -/ +@[expose] def DevissageStepA [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] [HasCoequalizers D] @@ -95,6 +96,7 @@ def DevissageStepA [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] /-- **Case (b)**: when every alternating power of the remainder survives, a further line factor splits off. -/ +@[expose] def DevissageStepB [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] [HasCoequalizers D] @@ -154,6 +156,7 @@ theorem devissageExit /-- **The trichotomy**: over any state, either every symmetric power of the remainder survives, or every alternating power survives, or the remainder has died. -/ +@[expose] def DevissageTrichotomy [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/Rappel210.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/Rappel210.lean index 6c10caabf0..832f2c0f79 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/Rappel210.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/Rappel210.lean @@ -18,7 +18,7 @@ splitting is a section of the base-changed epimorphism as module maps over the algebra. -/ -@[expose] public section +public section namespace RS @@ -38,6 +38,7 @@ theorem freeModMap_lin [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] ← associator_inv_naturality_right_assoc] /-- The free module on a morphism. -/ +@[expose] noncomputable def freeModMap [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] {V W : D} (f : V ⟶ W) : @@ -53,6 +54,7 @@ section Statement the consumed direction): a short exact sequence acquires a module-level section of its epimorphism after base change to some nonzero commutative algebra. -/ +@[expose] def Rappel210Statement [Category.{v} D] [MonoidalCategory D] [BraidedCategory D] [Abelian D] (S : ShortComplex D) (_ : S.ShortExact) : diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/Rappel210Bridge.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/Rappel210Bridge.lean index a8ab7a6e3b..30d71a1b0c 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/Rappel210Bridge.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/Rappel210Bridge.lean @@ -20,7 +20,7 @@ nonzero unit no stage unit vanishes. The class of the object in the splitting algebra restricts on the point to the unit. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/Rappel210Chain.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/Rappel210Chain.lean index 52cd7ebdfa..86333ce98c 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/Rappel210Chain.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/Rappel210Chain.lean @@ -21,7 +21,7 @@ laws assemble the colimit into a commutative algebra through the generic chain kit. -/ -@[expose] public section +public section namespace RS @@ -34,6 +34,7 @@ variable {D : Type u} /-- The stages of the local splitting chain: the plain symmetric powers, one letter up. -/ +@[expose] noncomputable def splitStage [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [HasFiniteBiproducts D] [HasCoequalizers D] [Linear ℂ D] @@ -43,6 +44,7 @@ noncomputable def splitStage /-- The seed of the local splitting chain: the point, in the singleton power. -/ +@[expose] noncomputable def splitSeed [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [HasFiniteBiproducts D] [HasCoequalizers D] [Linear ℂ D] @@ -51,6 +53,7 @@ noncomputable def splitSeed /-- The transition of the local splitting chain: multiplication by the seed. -/ +@[expose] noncomputable def splitDelta [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] @@ -64,6 +67,7 @@ noncomputable def splitDelta symMul (𝟙_ D) Y (n + 1) 1 /-- The stage multiplication of the local splitting chain. -/ +@[expose] noncomputable def splitMu [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] @@ -78,6 +82,7 @@ noncomputable def splitMu /-- The stage units of the local splitting chain: the powers of the point. -/ +@[expose] noncomputable def splitUnitStage [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] @@ -384,6 +389,7 @@ section Colimit /-- **The local splitting algebra**: the colimit of the chain of symmetric powers along multiplication by the point. -/ +@[expose] noncomputable def splitAlgebra [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] @@ -393,6 +399,7 @@ noncomputable def splitAlgebra chainColimit (splitStage Y) (splitDelta Y pt) /-- The unit of the local splitting algebra: the included seed. -/ +@[expose] noncomputable def splitAlgebraUnit [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] @@ -406,7 +413,7 @@ noncomputable def splitAlgebraUnit /-- **The local splitting algebra as a monoid object**: the unit is the included seed and the multiplication is assembled from the stage multiplications through the chain kit. -/ -@[reducible] +@[expose, reducible] noncomputable def splitAlgebraMonObj [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/Rappel210Close.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/Rappel210Close.lean index d3680f57d1..d8619db963 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/Rappel210Close.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/Rappel210Close.lean @@ -20,7 +20,7 @@ ind-category follows from the stage units through the filtered criterion. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/Rappel210Ind.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/Rappel210Ind.lean index 1baf9e65e3..575c8b6713 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/Rappel210Ind.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/Rappel210Ind.lean @@ -20,7 +20,7 @@ vanishes. The local splitting statement therefore holds for every short exact sequence whose relevant objects carry duals. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/Rappel210Reduce.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/Rappel210Reduce.lean index 0f1c97ae2c..64b62a80ea 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/Rappel210Reduce.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/Rappel210Reduce.lean @@ -20,7 +20,7 @@ tensoring, which produces the internal-hom extension that the pullback stage consumes. -/ -@[expose] public section +public section namespace RS @@ -71,6 +71,7 @@ section Reduction /-- The name of the identity: the coevaluation, braided into the evaluation source. -/ +@[expose] noncomputable def unitName [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] (X : D) [HasRightDual X] : @@ -79,12 +80,14 @@ noncomputable def unitName /-- The middle object of the unit-form extension: the pullback of the internal-hom epimorphism along the name of the identity. -/ +@[expose] noncomputable def unitFormMid [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Abelian D] (S : ShortComplex D) [HasRightDual S.X₃] : D := pullback (((S.X₃)ᘁ) ◁ S.g) (unitName S.X₃) /-- The inclusion of the unit-form extension. -/ +@[expose] noncomputable def unitFormIn [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Abelian D] [MonoidalPreadditive D] (S : ShortComplex D) [HasRightDual S.X₃] : @@ -96,6 +99,7 @@ noncomputable def unitFormIn /-- **The unit-form extension**: the given sequence, internally hommed and pulled back along the name of the identity, now with unit quotient. -/ +@[expose] noncomputable def unitForm [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Abelian D] [MonoidalPreadditive D] (S : ShortComplex D) [HasRightDual S.X₃] : diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/RegularSum.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/RegularSum.lean index 401d2a1aea..6313881221 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/RegularSum.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/RegularSum.lean @@ -35,7 +35,7 @@ a dimension count in the centre of the group algebra against the class sums, which are no more numerous than the shapes. -/ -@[expose] public section +public section namespace RS @@ -326,6 +326,7 @@ sizes; on coefficients this is relabelling of permutations along section Transport /-- Relabelling of permutations along an equality of sizes. -/ +@[expose] def permCast {m n : ℕ} (h : m = n) : Equiv.Perm (Fin m) ≃ Equiv.Perm (Fin n) := Equiv.permCongr (finCongr h) @@ -701,6 +702,7 @@ specialisations, hence the shapes — by the separation theorem. -/ section Orthogonality /-- Relabelling as a homomorphism of permutation groups. -/ +@[expose] def permCastHom {m n : ℕ} (h : m = n) : Equiv.Perm (Fin m) →* Equiv.Perm (Fin n) where toFun := permCast h diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/RhoBiprod.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/RhoBiprod.lean index dc32863e56..b8185ee32f 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/RhoBiprod.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/RhoBiprod.lean @@ -16,7 +16,7 @@ the summands, ℂ-linearly. With the distribution of a tensor over a biproduct this computes `ρ` on a mixed sum. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/RhoTwist.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/RhoTwist.lean index 4a837129fa..380309a741 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/RhoTwist.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/RhoTwist.lean @@ -18,7 +18,7 @@ components. These four identifications are the base cases of the computation of `ρ` on the free modules of 2.11. -/ -@[expose] public section +public section namespace RS @@ -46,6 +46,7 @@ noncomputable def rhoOddUnit /-- **The even part of a twist by the odd line** is the odd part of the object. -/ +@[expose] noncomputable def rhoEvenOdd [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [CategoryTheory.Linear ℂ D] @@ -56,6 +57,7 @@ noncomputable def rhoEvenOdd /-- **The odd part of a twist by the odd line** is the even part of the object. -/ +@[expose] noncomputable def rhoOddOdd [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [CategoryTheory.Linear ℂ D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/RowColIdem.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/RowColIdem.lean index 9d9decc102..586cef3634 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/RowColIdem.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/RowColIdem.lean @@ -32,7 +32,7 @@ forces dimension one, and the idempotents coincide with the symmetriser and antisymmetriser on the nose. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SandwichMerge.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SandwichMerge.lean index afe3a5263c..4e084ed882 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SandwichMerge.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SandwichMerge.lean @@ -31,7 +31,7 @@ letters `M'`). descends to every tower stage. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SandwichRetract.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SandwichRetract.lean index 3c0b274051..4607a79767 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SandwichRetract.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SandwichRetract.lean @@ -18,7 +18,7 @@ collapses of the relative tensor as module isomorphisms, the bundled copairing and pairing, and the associator. -/ -@[expose] public section +public section namespace RS @@ -65,6 +65,7 @@ theorem modTensorUnitLeft_act simp only [Category.assoc] /-- **The left unit collapse, as a module isomorphism.** -/ +@[expose] noncomputable def modTensorUnitLeftMod [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] @@ -122,6 +123,7 @@ theorem modTensorUnitRight_act simp only [Category.assoc] /-- **The right unit collapse, as a module isomorphism.** -/ +@[expose] noncomputable def modTensorUnitRightMod [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] @@ -145,6 +147,7 @@ section Legs /-- **The sandwich insertion**: expand the unit and insert the copairing on the left. -/ +@[expose] noncomputable def sandwichIns [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] @@ -157,6 +160,7 @@ noncomputable def sandwichIns /-- **The sandwich contraction**: reassociate, contract the trailing pair, and collapse the unit. -/ +@[expose] noncomputable def sandwichCon [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] @@ -171,6 +175,7 @@ noncomputable def sandwichCon /-- **The dual sandwich insertion**: expand the unit and insert the copairing on the right. -/ +@[expose] noncomputable def sandwichInsR [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] @@ -183,6 +188,7 @@ noncomputable def sandwichInsR /-- **The dual sandwich contraction**: reassociate backwards, contract the leading pair, and collapse the unit. -/ +@[expose] noncomputable def sandwichConR [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SandwichZig.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SandwichZig.lean index 5f8b41a69d..91a5b1a8db 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SandwichZig.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SandwichZig.lean @@ -20,7 +20,7 @@ supplies those two readings, `RS.sandwichIns_hom` and `RS.modTensorπ_sandwichCon`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ScalarBraiding.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ScalarBraiding.lean index ea75ec2ead..4cc6999101 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ScalarBraiding.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ScalarBraiding.lean @@ -26,7 +26,7 @@ give the vanishing half of Deligne 1.9 for `𝟙^p ⊕ 1-bar^q` inside any ambient category — the engine of the trichotomy 2.9. -/ -@[expose] public section +public section namespace RS @@ -322,6 +322,7 @@ theorem schurKilled_odd_row section Sums /-- `p + 1` biproduct copies of an object. -/ +@[expose] noncomputable def sumPow [Category.{v} A] [Preadditive A] [HasBinaryBiproducts A] (X : A) : ℕ → A diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ScalarLinear.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ScalarLinear.lean index 1e23076620..23a5b4b35a 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ScalarLinear.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ScalarLinear.lean @@ -44,7 +44,7 @@ with existing linear structures (and with itself, for two different `φ`), so callers install the structure with `letI` at use sites. -/ -@[expose] public section +public section namespace RS @@ -63,6 +63,7 @@ variable {D : Type u} /-- The unit endomorphism `φ c`, typed as a morphism rather than as an element of the endomorphism ring, so that sums and composites of these values elaborate at the hom-set instances. -/ +@[expose] def scalarHom [Category.{v} D] [MonoidalCategory D] [Preadditive D] (φ : ℂ ≃+* End (𝟙_ D)) (c : ℂ) : 𝟙_ D ⟶ 𝟙_ D := φ c @@ -80,6 +81,7 @@ theorem scalarUnit_map_mul [Category.{v} D] [MonoidalCategory D] [Preadditive D] /-- **The scalar `c` as an endomorphism of `X`**: whisker the unit endomorphism `φ c` onto `X` and cancel the unit through the left unitor. -/ +@[expose] def scalarEnd [Category.{v} D] [MonoidalCategory D] [Preadditive D] (φ : ℂ ≃+* End (𝟙_ D)) (c : ℂ) (X : D) : X ⟶ X := (λ_ X).inv ≫ (scalarHom φ c ▷ X) ≫ (λ_ X).hom @@ -205,6 +207,7 @@ theorem scalarEnd_zero [Category.{v} D] [MonoidalCategory D] [Preadditive D] /-- **The scalar action on a hom-set**: whisker the unit endomorphism through the left unitor of the source and compose. -/ +@[expose] def scalarSmul [Category.{v} D] [MonoidalCategory D] [Preadditive D] (φ : ℂ ≃+* End (𝟙_ D)) {X Y : D} (c : ℂ) (f : X ⟶ Y) : X ⟶ Y := @@ -219,7 +222,7 @@ theorem scalarSmul_eq [Category.{v} D] [MonoidalCategory D] [Preadditive D] /-- The ℂ-module structure on a hom-set induced by the scalar unit. -/ -@[reducible] def scalarModule +@[expose, reducible] def scalarModule [Category.{v} D] [MonoidalCategory D] [Preadditive D] [MonoidalPreadditive D] (φ : ℂ ≃+* End (𝟙_ D)) (X Y : D) : @@ -251,7 +254,7 @@ unit. -/ `ℂ ≃+* End (𝟙_ D)` makes a preadditive monoidal category ℂ-linear. A `def`, not an instance: an unconditional instance would clash with every existing linear structure, so callers install it by `letI`. -/ -@[reducible] def linearOfScalarUnit +@[expose, reducible] def linearOfScalarUnit [Category.{v} D] [MonoidalCategory D] [Preadditive D] [MonoidalPreadditive D] (φ : ℂ ≃+* End (𝟙_ D)) : @@ -307,6 +310,7 @@ variable {E : Type u'} /-- Conjugation by an isomorphism as a ring equivalence of endomorphism rings; conjugation preserves the reversed products because the connecting isomorphisms cancel in the middle. -/ +@[expose] def endCongrRingEquiv [Category.{v'} E] [Preadditive E] {X Y : E} (α : X ≅ Y) : End X ≃+* End Y := { α.conj with @@ -345,6 +349,7 @@ theorem indOf_additive [SmallCategory C] [Preadditive C] [HasFiniteColimits C] : /-- Full faithfulness of the embedding on endomorphisms, as a ring equivalence; `End`-multiplication is reversed composition on both sides, so functoriality preserves it verbatim. -/ +@[expose] def indOfEndRingEquiv [SmallCategory C] [Preadditive C] [HasFiniteColimits C] (x : C) : End x ≃+* End (indOf.obj x) where toFun f := indOf.map f @@ -360,6 +365,7 @@ def indOfEndRingEquiv [SmallCategory C] [Preadditive C] [HasFiniteColimits C] /-- **The scalar unit of `Ind C`**: a ring isomorphism `ℂ ≃+* End (𝟙_ C)` transports along the embedding and the unit identification to one for `Ind C`. -/ +@[expose] def indScalarUnit [SmallCategory C] [MonoidalCategory C] [Preadditive C] [HasFiniteColimits C] (ψ : ℂ ≃+* End (𝟙_ C)) : diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ScalarUnitEquiv.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ScalarUnitEquiv.lean index a332a792bd..ac501d670d 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ScalarUnitEquiv.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ScalarUnitEquiv.lean @@ -17,7 +17,7 @@ ring homomorphism, so it is a ring isomorphism, which is the form in which the ℂ-linear structure of the Ind-completion consumes it. -/ -@[expose] public section +public section namespace RS @@ -29,6 +29,7 @@ variable (A : Type u) /-- Scaling the identity of the tensor unit, as a ring homomorphism. -/ +@[expose] def scalarUnitRingHom [Category.{v} A] [Preadditive A] [CategoryTheory.Linear ℂ A] [MonoidalCategory A] : ℂ →+* End (𝟙_ A) where @@ -44,6 +45,7 @@ def scalarUnitRingHom variable {A} /-- **The scalar unit as a ring isomorphism.** -/ +@[expose] noncomputable def scalarUnitEquiv [Category.{v} A] [Preadditive A] [CategoryTheory.Linear ℂ A] [MonoidalCategory A] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ScalarUnitInd.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ScalarUnitInd.lean index e0a1e49755..294e0b60e1 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ScalarUnitInd.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ScalarUnitInd.lean @@ -18,7 +18,7 @@ ind-completion this supplies the hypothesis upstairs from the one downstairs. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SchurTransport.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SchurTransport.lean index 9c4fc428c0..bece92619a 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SchurTransport.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SchurTransport.lean @@ -40,7 +40,7 @@ embedded object is Schur vanishing downstairs. instantiation `RS.schurKilled_indOf_iff_of_hasScalarUnit`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SchurVanishing.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SchurVanishing.lean index 63271c0aca..0d4340e4ab 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SchurVanishing.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SchurVanishing.lean @@ -25,7 +25,7 @@ block, and `permAlg_compat` carries the vanishing of `e λ`'s action up the standard embedding. -/ -@[expose] public section +public section namespace RS @@ -39,6 +39,7 @@ variable {A : Type u} idempotent of its block acts as zero on the `μ.card`-th tensor power of `X`. This is the vanishing of the `μ`-isotypic summand of `X ^ ⊗ μ.card`, i.e. of Deligne's Schur functor `S_μ(X)`. -/ +@[expose] def SchurKilled [Category.{v} A] [MonoidalCategory A] [SymmetricCategory A] [Preadditive A] [Linear ℂ A] (P : SchurPackage.{v}) (X : A) (μ : YoungDiagram) : diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SeedIns.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SeedIns.lean index 6eb518497c..01eedd8d21 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SeedIns.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SeedIns.lean @@ -19,7 +19,7 @@ of the `ofBase`, `ins` and `ins'` fields of the splitting data of the Key Lemma. -/ -@[expose] public section +public section namespace RS @@ -32,6 +32,7 @@ variable {D : Type u} /-- **The base entry**: the base algebra acts on the seed element in the bottom stage. -/ +@[expose] noncomputable def chainBaseStage [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] @@ -838,6 +839,7 @@ private theorem tensor_whiskerL [Category.{v} D] [MonoidalCategory D] /-- **The raw pair product**: both entries enter and multiply into the diagonal stage two levels up. -/ +@[expose] noncomputable def chainPairRaw [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ShapeAlgebra.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ShapeAlgebra.lean index dbdd7dbb3d..0310206592 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ShapeAlgebra.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ShapeAlgebra.lean @@ -21,7 +21,7 @@ algebra map, so idempotence and products transport; an injective one, so nonvanishing transports too. -/ -@[expose] public section +public section namespace RS @@ -35,6 +35,7 @@ theorem symCast_injective {m n : ℕ} (h : m ≤ n) : /-- The central idempotent of a shape of size `n`, recast into the group algebra of `S_n`. -/ +@[expose] noncomputable def Shape.e (P : SchurPackage.{u}) {n : ℕ} (μ : Shape n) : SymGroupAlgebra n := symCast (le_of_eq μ.prop) (P.e μ.val) diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ShapeFintype.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ShapeFintype.lean index 1b7c556558..95a42bd203 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ShapeFintype.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ShapeFintype.lean @@ -17,7 +17,7 @@ correspondence with `Nat.Partition n` that reads off the row lengths. This is the tree's standard idiom for "sum over the partitions of `n`". -/ -@[expose] public section +public section namespace RS @@ -30,7 +30,7 @@ theorem rowLens_injective : Function.Injective YoungDiagram.rowLens := /-! ### Shapes -/ /-- The Young diagrams with `n` cells. -/ -def Shape (n : ℕ) : Type := {μ : YoungDiagram // μ.card = n} +@[expose] def Shape (n : ℕ) : Type := {μ : YoungDiagram // μ.card = n} namespace Shape @@ -54,6 +54,7 @@ instance (n : ℕ) : DecidableEq (Shape n) := fun μ ν => /-- Young diagrams of size `n` correspond to partitions of `n`, by reading off the row lengths. -/ +@[expose] noncomputable def shapeEquivPartition (n : ℕ) : Shape n ≃ Nat.Partition n where toFun μ := diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SignConj.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SignConj.lean index 092cf113f5..bc989d5e49 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SignConj.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SignConj.lean @@ -21,7 +21,7 @@ simultaneous action: the plain action on the twisting powers alongside the descended action on the module powers. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SimpleGenerator.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SimpleGenerator.lean index 5294a8e42c..9665780429 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SimpleGenerator.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SimpleGenerator.lean @@ -24,7 +24,7 @@ carry the splitting from the tensor generator to every subquotient, and with it to the whole category. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SimplePoint.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SimplePoint.lean index 517c495e87..68525961b4 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SimplePoint.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SimplePoint.lean @@ -21,7 +21,7 @@ the base change of `RS/Classical/Deligne/PointFibre.lean` lands in finite-dimensional super vector spaces. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SimpleQuotient.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SimpleQuotient.lean index a5b072d8ec..c9ca9729a9 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SimpleQuotient.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SimpleQuotient.lean @@ -17,7 +17,7 @@ algebra which is simple as an algebra: its only ideals are `⊥` and `⊤`. -/ -@[expose] public section +public section namespace RS @@ -89,6 +89,7 @@ theorem factors_of_isColimit [SmallCategory C] [Abelian C] /-- **An ideal of an algebra object**: a subobject that absorbs multiplication by the algebra. -/ +@[expose] def IsIdeal [SmallCategory C] [MonoidalCategory C] (𝔸 : Ind C) [MonObj 𝔸] (I : Subobject 𝔸) : Prop := I.Factors ((𝔸 ◁ I.arrow) ≫ μ[𝔸]) @@ -179,6 +180,7 @@ instance small_subobject_subset [SmallCategory C] [Abelian C] /-- A `v`-small copy of a family of subobjects of an ind-object, serving as the index of the diagram of its members. -/ +@[expose] def SubIndex [SmallCategory C] [Abelian C] {A : Ind C} (s : Set (Subobject A)) : Type v := Shrink.{v} ↥s @@ -235,6 +237,7 @@ theorem isFiltered_subIndex [SmallCategory C] [Abelian C] exact isFiltered_of_directed_le_nonempty _ /-- The diagram of the members of a family of subobjects. -/ +@[expose] noncomputable def subDiagram [SmallCategory C] [Abelian C] {A : Ind C} (s : Set (Subobject A)) : SubIndex s ⥤ Ind C where diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SimpleScalars.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SimpleScalars.lean index 0833213cd5..fae2188eff 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SimpleScalars.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SimpleScalars.lean @@ -32,7 +32,7 @@ under either alternative of simplicity the action vanishes (`RS.hom_oddLine_eq_zero_of_simple`). -/ -@[expose] public section +public section namespace RS @@ -305,7 +305,7 @@ theorem isField_gammaEven /-- The even part of the Γ-algebra of a simple algebra, as a field. -/ -@[reducible] noncomputable def gammaEvenField +@[expose, reducible] noncomputable def gammaEvenField [SmallCategory C] [MonoidalCategory C] [SymmetricCategory C] [Abelian C] [RigidCategory C] [MonoidalPreadditive C] (R : Ind C) [MonObj R] [IsCommMonObj R] [CategoryTheory.Linear ℂ (Ind C)] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SimpleSplit.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SimpleSplit.lean index e541c7e8bd..ff248ce48a 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SimpleSplit.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SimpleSplit.lean @@ -68,7 +68,7 @@ epimorphism out of a free mixed module splits of the local splitting statement without constructing it by hand. -/ -@[expose] public section +public section namespace RS @@ -339,6 +339,7 @@ end Rotation section OddLineFree /-- A module twisted on the right by the odd line. -/ +@[expose] noncomputable def modLine [SmallCategory C] [MonoidalCategory C] [SymmetricCategory C] [Abelian C] (𝔹 : Ind C) [MonObj 𝔹] (L : OddLine (Ind C)) diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SmallReduction.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SmallReduction.lean index 3598b10e8b..b628e16cc5 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SmallReduction.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SmallReduction.lean @@ -37,7 +37,7 @@ monoidal structure transported along `CategoryTheory.equivSmallModel` `RS.DeligneFibreFunctor.precompose`. -/ -@[expose] public section +public section namespace RS @@ -302,13 +302,13 @@ variable (A : Type u) /-- The small model of an essentially small monoidal category, carrying the monoidal structure transported along `CategoryTheory.equivSmallModel`. -/ -@[reducible] noncomputable def SmallDeligne +@[expose, reducible] noncomputable def SmallDeligne [Category.{v} A] [EssentiallySmall.{v} A] : Type v := Monoidal.Transported (equivSmallModel.{v} A) /-- The transporting equivalence onto the small model, monoidal by construction. -/ -@[reducible] noncomputable def smallDeligneEquiv +@[expose, reducible] noncomputable def smallDeligneEquiv [Category.{v} A] [EssentiallySmall.{v} A] : A ≌ SmallDeligne A := Monoidal.equivalenceTransported (equivSmallModel.{v} A) diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitAdjoint.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitAdjoint.lean index 41d34b40a2..9466f1627c 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitAdjoint.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitAdjoint.lean @@ -21,7 +21,7 @@ Passing to the complementary idempotents gives the adjointness in the form the dévissage step consumes. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitAssemble.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitAssemble.lean index 9e8016ed47..b1aed6c79b 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitAssemble.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitAssemble.lean @@ -22,7 +22,7 @@ the base entry, in the exact shape of the splitting data of the Key Lemma. -/ -@[expose] public section +public section namespace RS @@ -35,6 +35,7 @@ variable {D : Type u} /-- **The base entry on the carrier**: the base algebra enters the degree-zero component at the bottom stage. -/ +@[expose] noncomputable def splitOfBase [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] @@ -50,6 +51,7 @@ noncomputable def splitOfBase /-- **The module entry on the carrier**: the module enters the degree `+1` component at the bottom stage. -/ +@[expose] noncomputable def splitIns [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] @@ -66,6 +68,7 @@ noncomputable def splitIns /-- **The dual entry on the carrier**: the dual module enters the degree `−1` component at the bottom stage, through the arity transport identifying the bottom stage of the `−1` line. -/ +@[expose] noncomputable def splitIns' [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitClosure.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitClosure.lean index 7247f69b6e..17e7560ef5 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitClosure.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitClosure.lean @@ -32,7 +32,7 @@ tensor generator and its dual splits every embedded object, once subquotients of split objects are known to be split. -/ -@[expose] public section +public section namespace RS @@ -250,6 +250,7 @@ attribute [local instance] hasBinaryBiproducts_of_finite_biproducts /-- An object is *split* by `R` when its free module is a mixed sum: a sum of copies of the unit and of the odd line. -/ +@[expose] def IsSplit [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [HasFiniteBiproducts D] (L : OddLine D) (R : D) [MonObj R] (Y : D) : Prop := diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitComplement.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitComplement.lean index 1300f087ce..a82738f8ea 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitComplement.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitComplement.lean @@ -18,7 +18,7 @@ complement of the split unit factor, and carries the descended action. -/ -@[expose] public section +public section namespace RS @@ -31,6 +31,7 @@ variable {D : Type u} /-- **The split idempotent** on the base change: evaluate, then coevaluate. -/ +@[expose] noncomputable def splitIdem [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] (A : D) [MonObj A] [IsCommMonObj A] {M : Mod D A} @@ -93,6 +94,7 @@ section Complement /-- **The complement carrier**: the kernel of the split idempotent. -/ +@[expose] noncomputable def splitCompl [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [HasCoequalizers D] (A : D) [MonObj A] [IsCommMonObj A] @@ -107,6 +109,7 @@ noncomputable def splitCompl kernel (splitIdem A B φ v w d hv hw) /-- The action of the algebra descends to the complement. -/ +@[expose] noncomputable def splitComplAct [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasCoequalizers D] (A : D) @@ -248,7 +251,7 @@ theorem splitComplAct_mul (kernel.ι (splitIdem A B φ v w d hv hw))).mp hι /-- The complement, as a module over the algebra. -/ -@[implicit_reducible] +@[expose, implicit_reducible] noncomputable def splitComplModObj [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasCoequalizers D] (A : D) @@ -266,6 +269,7 @@ noncomputable def splitComplModObj mul_smul := splitComplAct_mul A B φ v w d hv hw /-- The complement, bundled. -/ +@[expose] noncomputable def splitComplMod [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasCoequalizers D] (A : D) @@ -282,6 +286,7 @@ noncomputable def splitComplMod /-- The projection onto the complement: the complementary idempotent, corestricted to the kernel. -/ +@[expose] noncomputable def splitComplProj [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [HasCoequalizers D] (A : D) [MonObj A] [IsCommMonObj A] @@ -649,6 +654,7 @@ end Complement section Retract /-- The kernel inclusion of the complement, as a module map. -/ +@[expose] noncomputable def splitComplIncl [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasCoequalizers D] (A : D) @@ -665,6 +671,7 @@ noncomputable def splitComplIncl exact splitComplAct_ι A B φ v w d hv hw) /-- The projection onto the complement, as a module map. -/ +@[expose] noncomputable def splitComplProjMod [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasCoequalizers D] (A : D) diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitEverything.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitEverything.lean index e05abe6d4e..6cc6af7c1f 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitEverything.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitEverything.lean @@ -27,7 +27,7 @@ algebra are the complex numbers, so its Γ-algebra has a complex point. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitExact.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitExact.lean index 40977f4a13..933eead1ec 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitExact.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitExact.lean @@ -30,7 +30,7 @@ naming the general statements at the shape in which they are consumed. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitExtract.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitExtract.lean index 5272f570d7..bbc739ac7b 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitExtract.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitExtract.lean @@ -19,7 +19,7 @@ against the dual insertion supplies a coevaluation; the section identity of the data makes the pair a retract. -/ -@[expose] public section +public section namespace RS @@ -94,6 +94,7 @@ section Coeval /-- A base-linear insertion, bundled as a module morphism into the restricted regular module. -/ +@[expose] noncomputable def insHom [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] {M' : Mod D A} (B : D) [MonObj B] (φ : A ⟶ B) [IsMonHom φ] (w : M'.X ⟶ B) @@ -223,6 +224,7 @@ theorem baseChangeAct_splitEval /-- **The coevaluation**: the copair element with its dual factor pushed into the algebra, multiplied against the algebra. -/ +@[expose] noncomputable def splitCoeval [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] (A : D) [MonObj A] [IsCommMonObj A] {M : Mod D A} diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitExtractDual.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitExtractDual.lean index 042a33a3c5..4ea852fe30 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitExtractDual.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitExtractDual.lean @@ -22,7 +22,7 @@ idempotent is the complement. No braiding is needed anywhere: the copairing already presents the primal factor on the left. -/ -@[expose] public section +public section namespace RS @@ -92,6 +92,7 @@ theorem splitCoevalCoreDual_splitEval /-- **The dual coevaluation**: the copair element with its primal factor pushed into the algebra, multiplied against the algebra. -/ +@[expose] noncomputable def splitCoevalDual [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] (A : D) [MonObj A] [IsCommMonObj A] {M : Mod D A} @@ -199,6 +200,7 @@ noncomputable def splitCoevalDualMod /-- **The dual split idempotent** on the base change of the dual module: evaluate, then coevaluate. -/ +@[expose] noncomputable def splitIdemDual [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] (A : D) [MonObj A] [IsCommMonObj A] {M : Mod D A} @@ -261,6 +263,7 @@ section Complement /-- **The dual complement carrier**: the kernel of the dual split idempotent. -/ +@[expose] noncomputable def splitComplDual [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [HasCoequalizers D] (A : D) [MonObj A] [IsCommMonObj A] @@ -276,6 +279,7 @@ noncomputable def splitComplDual /-- The action of the algebra descends to the dual complement. -/ +@[expose] noncomputable def splitComplActDual [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasCoequalizers D] (A : D) @@ -417,7 +421,7 @@ theorem splitComplActDual_mul (kernel.ι (splitIdemDual A B φ v w d hv hw))).mp hι /-- The dual complement, as a module over the algebra. -/ -@[implicit_reducible] +@[expose, implicit_reducible] noncomputable def splitComplModObjDual [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasCoequalizers D] (A : D) @@ -435,6 +439,7 @@ noncomputable def splitComplModObjDual mul_smul := splitComplActDual_mul A B φ v w d hv hw /-- The dual complement, bundled. -/ +@[expose] noncomputable def splitComplModDual [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasCoequalizers D] (A : D) @@ -451,6 +456,7 @@ noncomputable def splitComplModDual /-- The projection onto the dual complement: the complementary idempotent, corestricted to the kernel. -/ +@[expose] noncomputable def splitComplProjDual [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [HasCoequalizers D] (A : D) [MonObj A] [IsCommMonObj A] @@ -785,6 +791,7 @@ section RetractDual /-- The kernel inclusion of the dual complement, as a module map. -/ +@[expose] noncomputable def splitComplInclDual [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasCoequalizers D] (A : D) @@ -802,6 +809,7 @@ noncomputable def splitComplInclDual (by exact splitComplActDual_ι A B φ v w d hv hw) /-- The projection onto the dual complement, as a module map. -/ +@[expose] noncomputable def splitComplProjModDual [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasCoequalizers D] (A : D) diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitMonHom.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitMonHom.lean index ee58b86e35..14e2c99588 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitMonHom.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitMonHom.lean @@ -19,7 +19,7 @@ monoid-morphism property of the base entry of the splitting data. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitPairDef.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitPairDef.lean index c62f9ce320..59cf4ca210 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitPairDef.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitPairDef.lean @@ -21,7 +21,7 @@ equation of the pair product field of the splitting data of the Key Lemma. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitReduce.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitReduce.lean index 2197d3c4f2..9be845b08b 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitReduce.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitReduce.lean @@ -19,7 +19,7 @@ the splitting-algebra argument then only ever meets maps out of the unit. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitTransport.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitTransport.lean index 6e6da91654..3c251acd2c 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitTransport.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplitTransport.lean @@ -17,7 +17,7 @@ object, so a section of a free morphism over one algebra base-changes to a section over any algebra under it. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplittingAlgebra.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplittingAlgebra.lean index d1206d6476..34a5d36558 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplittingAlgebra.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SplittingAlgebra.lean @@ -20,7 +20,7 @@ hypotheses under which the fibre functor over that algebra is strong monoidal and exact. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/StateTransport.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/StateTransport.lean index d7678c1aaa..97005f4b2a 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/StateTransport.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/StateTransport.lean @@ -17,7 +17,7 @@ generates, so an isomorphism of objects carries a state to a state without disturbing any of the counts. -/ -@[expose] public section +public section namespace RS @@ -33,6 +33,7 @@ attribute [local instance] /-- **Transport of a dévissage state along an isomorphism** of the object being decomposed. -/ +@[expose] noncomputable def DevissageState.transportObj [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/StepA.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/StepA.lean index d4902f3a35..dba3570792 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/StepA.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/StepA.lean @@ -19,7 +19,7 @@ the new base, the complement becomes the new remainder, and the mixed free part gains one unit summand. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/StepATransport.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/StepATransport.lean index 93f7e20071..04e6d061d9 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/StepATransport.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/StepATransport.lean @@ -18,7 +18,7 @@ recombined with the splitting of the remainder: one further unit summand joins the mixed free part. -/ -@[expose] public section +public section namespace RS @@ -33,6 +33,7 @@ attribute [local instance] hasBinaryBiproducts_of_finite_biproducts /-- **Base change on morphisms of modules.** -/ +@[expose] noncomputable def baseChangeMapMod [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] @@ -56,6 +57,7 @@ noncomputable def baseChangeMapMod modTensorMap A (𝟙 (restrictRegular φ)) g := rfl /-- **Base change is functorial on isomorphisms.** -/ +@[expose] noncomputable def baseChangeMapIso [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/StepB.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/StepB.lean index b950b1fb03..8029c98524 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/StepB.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/StepB.lean @@ -20,7 +20,7 @@ factor off it. Twisting back turns that unit factor into a line factor of the original state. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperEmbed/Letters.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperEmbed/Letters.lean index f3d8f4c31a..7ebbb23d15 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperEmbed/Letters.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperEmbed/Letters.lean @@ -33,7 +33,7 @@ that transports; the two systems it is applied to are built in tensor power exactly when its colour sums vanish. -/ -@[expose] public section +public section namespace RS @@ -79,6 +79,7 @@ namespace MixedLetters /-- **The inclusion of a colouring**: the fold of the letterwise inclusions into the tensor power, in slot order. -/ +@[expose] noncomputable def colourInto [Category.{v} A] [MonoidalCategory A] [Preadditive A] {K : Type} [Fintype K] {par : K → Bool} {U : A} {M : A} @@ -296,6 +297,7 @@ variable {A : Type u} /-- Absorbing one letter into a power of `U`: a `U`-letter extends the power, a unit letter is stripped by the right unitor. -/ +@[expose] noncomputable def tailIso [Category.{v} A] [MonoidalCategory A] (U : A) (k : ℕ) : (b : Bool) → (tensorPow A U k ⊗ (bif b then U else 𝟙_ A) ≅ diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperEmbed/Signs.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperEmbed/Signs.lean index 7e2d27fb56..2d64a4021a 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperEmbed/Signs.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperEmbed/Signs.lean @@ -28,7 +28,7 @@ categorical side consumes it in [Letters.lean](Letters.lean). `parSign_swap` on an adjacent transposition. -/ -@[expose] public section +public section namespace RS @@ -43,6 +43,7 @@ A permutation routes the factor in slot `i` to slot `σ i` /-- Reindexing a slot labelling along a permutation: the label of slot `i` moves to slot `σ i`. -/ +@[expose] def permIndex {K : Type*} {n : ℕ} (σ : Equiv.Perm (Fin n)) (c : Fin n → K) : Fin n → K := c ∘ ⇑σ⁻¹ @@ -73,6 +74,7 @@ enumerations gives a permutation of `Fin (popCount w)` whose sign is the Koszul sign of the shuffle. -/ /-- The set of `true` slots of a word. -/ +@[expose] def trueSet {n : ℕ} (w : Fin n → Bool) : Finset (Fin n) := Finset.univ.filter fun i => w i = true @@ -112,6 +114,7 @@ noncomputable def trueEnum {n : ℕ} (w : Fin n → Bool) : /-- A permutation carries the `true` slots of a word bijectively onto the `true` slots of the shuffled word. -/ +@[expose] def trueShift {n : ℕ} (σ : Equiv.Perm (Fin n)) (w : Fin n → Bool) : {i // i ∈ trueSet w} ≃ {i // i ∈ trueSet (permIndex σ w)} := (σ : Fin n ≃ Fin n).subtypeEquiv fun i => by @@ -126,6 +129,7 @@ theorem trueShift_apply {n : ℕ} (σ : Equiv.Perm (Fin n)) /-- **The induced permutation on the odd slots**: conjugate the shift by the monotone enumerations. -/ +@[expose] noncomputable def oddPerm {n : ℕ} (σ : Equiv.Perm (Fin n)) (w : Fin n → Bool) : Equiv.Perm (Fin (popCount w)) := (trueEnum w).toEquiv.trans ((trueShift σ w).trans diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperEmbed/Standard.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperEmbed/Standard.lean index eae6730e54..732e4011b0 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperEmbed/Standard.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperEmbed/Standard.lean @@ -34,7 +34,7 @@ as well — contradicting `not_schurKilled_stdSuper`. of `schurKilled_unit_odd`. -/ -@[expose] public section +public section namespace RS @@ -59,6 +59,7 @@ section BiprodLetters variable {A : Type u} /-- The inclusion of one copy into an iterated biproduct sum. -/ +@[expose] noncomputable def sumPowIns [Category.{v} A] [Preadditive A] [HasBinaryBiproducts A] (X : A) : (k : ℕ) → Fin (k + 1) → @@ -69,6 +70,7 @@ noncomputable def sumPowIns (fun j => sumPowIns X k j ≫ biprod.inl) i /-- The projection onto one copy of an iterated biproduct sum. -/ +@[expose] noncomputable def sumPowPrj [Category.{v} A] [Preadditive A] [HasBinaryBiproducts A] (X : A) : (k : ℕ) → Fin (k + 1) → diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperEvenRing.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperEvenRing.lean index bef8e02a47..9ab40f2fe3 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperEvenRing.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperEvenRing.lean @@ -39,7 +39,7 @@ top of them. [NullPoint.lean](NullPoint.lean). -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperGamma.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperGamma.lean index aa757731d0..3447f9c784 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperGamma.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperGamma.lean @@ -53,7 +53,7 @@ an `RS.SuperCommAlgebra`, feeding the odd-nil quotient theory of `RS.SuperRealize`. -/ -@[expose] public section +public section namespace RS @@ -226,6 +226,7 @@ theorem convAlong_smul_right /-- Prefixed convolution packaged as a ℂ-bilinear map on hom ℂ-modules. -/ +@[expose] def convAlongHom [Category.{u'} D] [MonoidalCategory D] [Preadditive D] [MonoidalPreadditive D] (R : D) [MonObj R] [CategoryTheory.Linear ℂ D] [MonoidalLinear ℂ D] @@ -292,6 +293,7 @@ The hypothesis `hα` is not a formal consequence of `(ho, hβ)`: it pins down the compatibility of the chosen trivialization with the associator, and holds for the standard odd line of super vector spaces (hence in `Ind SmallSuperVect`). -/ +@[expose] def superGammaAlgebra [Category.{u'} D] [MonoidalCategory D] [BraidedCategory D] [Preadditive D] [MonoidalPreadditive D] [CategoryTheory.Linear ℂ D] [MonoidalLinear ℂ D] (R : D) [MonObj R] [IsCommMonObj R] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperGammaInst.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperGammaInst.lean index 439797480c..82dba56931 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperGammaInst.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperGammaInst.lean @@ -48,7 +48,7 @@ generator `indOf.obj sOdd`, and the three hypotheses are proved. the scalar unit as in `RS.ScalarLinear`. -/ -@[expose] public section +public section namespace RS @@ -433,6 +433,7 @@ def lineTensorEquiv : /-- **The trivialization of the odd square in `SuperVect`**: the even component pairs the two odd lines through `lineTensorEquiv`, and the odd component is trivial. -/ +@[expose] def superOddSquare : stdSuper 0 1 ⊗ stdSuper 0 1 ≅ 𝟙_ SuperVect := let : Subsingleton ((stdSuper 0 1).even ⊗[ℂ] (stdSuper 0 1).even) := by infer_instance @@ -715,6 +716,7 @@ section IndAssembly /-- **The odd line of the instantiated ambient**: the embedded odd generator of the small model. -/ +@[expose] def indOddLine : Ind SmallSuperVect := indOf.obj sOdd /-- **The trivialized odd square of the ambient**: the transported @@ -747,6 +749,7 @@ form a super-commutative ℂ-algebra under prefixed convolution — `RS.superGammaAlgebra` at the odd line `indOddLine`, with the ℂ-linear structure installed from the scalar unit of the small model as in `RS.ScalarLinear`. -/ +@[expose] def superGammaAlgebraInd (R : Ind SmallSuperVect) [MonObj R] [IsCommMonObj R] : SuperCommAlgebra := letI := linearOfScalarUnit (indScalarUnit smallScalarUnit) diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperModAbelian.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperModAbelian.lean index 0566579112..7b466ec6fc 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperModAbelian.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperModAbelian.lean @@ -44,7 +44,7 @@ identities, so each survives verbatim in a submodule and in a quotient. -/ -@[expose] public section +public section namespace RS @@ -64,6 +64,7 @@ variable {A E F : Type*} /-- **The restriction of an action block** to a pair of submodules carried into one another by it. -/ +@[expose] def actRestrict [AddCommGroup A] [Module ℂ A] [AddCommGroup E] [Module ℂ E] [AddCommGroup F] [Module ℂ F] (φ : A →ₗ[ℂ] E →ₗ[ℂ] F) {p : Submodule ℂ E} @@ -92,6 +93,7 @@ theorem actRestrict_coe /-- **The descent of an action block** to a pair of quotients, the first by a submodule carried by the block into the second. -/ +@[expose] def actQuot [AddCommGroup A] [Module ℂ A] [AddCommGroup E] [Module ℂ E] [AddCommGroup F] [Module ℂ F] (φ : A →ₗ[ℂ] E →ₗ[ℂ] F) {p : Submodule ℂ E} diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperModBiprod.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperModBiprod.lean index 8b2f4fd4ad..9d3e82beed 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperModBiprod.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperModBiprod.lean @@ -31,7 +31,7 @@ biproducts then follow formally from the zero object and the binary ones. -/ -@[expose] public section +public section namespace RS @@ -53,6 +53,7 @@ variable {A E₁ E₂ F₁ F₂ : Type*} blocks acting on the two factors of a product separately. The four action blocks of a biproduct of super modules are the four instances of this construction. -/ +@[expose] def prodAct [AddCommGroup A] [Module ℂ A] [AddCommGroup E₁] [Module ℂ E₁] [AddCommGroup E₂] [Module ℂ E₂] [AddCommGroup F₁] [Module ℂ F₁] [AddCommGroup F₂] [Module ℂ F₂] @@ -120,6 +121,7 @@ instance hasZeroObject : /-- **The biproduct of two super modules**: the product of the even components, the product of the odd components, and the four action blocks taken componentwise. -/ +@[expose] def biprod (M N : Mod.{u, u', w, w'} S) : Mod.{u, u', w, w'} S where even := M.even × N.even diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperModBiprodMap.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperModBiprodMap.lean index 9d1e745af2..e76e171c8e 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperModBiprodMap.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperModBiprodMap.lean @@ -17,7 +17,7 @@ biproducts, componentwise; a pair of isomorphisms induces an isomorphism. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperModHom.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperModHom.lean index 717ec73aea..6f8a9f30be 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperModHom.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperModHom.lean @@ -17,7 +17,7 @@ four action blocks. Postcomposition with a morphism of module objects realizes one. -/ -@[expose] public section +public section namespace RS @@ -48,6 +48,7 @@ namespace SuperCommAlgebra.Mod variable {S : SuperCommAlgebra} /-- The identity morphism of super modules. -/ +@[expose] def Hom.id (M : S.Mod) : Hom M M where evenMap := LinearMap.id oddMap := LinearMap.id @@ -57,6 +58,7 @@ def Hom.id (M : S.Mod) : Hom M M where map_actOO _ _ := rfl /-- Composition of morphisms of super modules. -/ +@[expose] def Hom.comp {M N P : S.Mod} (f : Hom M N) (g : Hom N P) : Hom M P where evenMap := g.evenMap.comp f.evenMap @@ -217,6 +219,7 @@ theorem gact_naturality [Category.{v} D] [MonoidalCategory D] (R : D) [MonObj R] MonoidalCategory.tensorHom_comp_tensorHom, Category.comp_id] /-- **Postcomposition realizes a morphism of super modules.** -/ +@[expose] noncomputable def gammaModuleMap [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [CategoryTheory.Linear ℂ D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperModIso.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperModIso.lean index 7f588f1fac..0af8b82728 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperModIso.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperModIso.lean @@ -17,7 +17,7 @@ again commute with the four actions, because the actions on the source are determined by those on the target. -/ -@[expose] public section +public section namespace RS @@ -31,6 +31,7 @@ variable {S : SuperCommAlgebra.{u, u'}} /-- **A degreewise bijective morphism of super modules is an isomorphism.** -/ +@[expose] noncomputable def isoOfComponents {M N : S.Mod} (f : M ⟶ N) (he : Function.Bijective f.evenMap) (ho : Function.Bijective f.oddMap) : M ≅ N where diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperModMonoidal.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperModMonoidal.lean index d25c238ecd..af984b6161 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperModMonoidal.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperModMonoidal.lean @@ -43,7 +43,7 @@ morphisms out of a two-, three- and four-fold tensor product. `MonoidalCategory` and `SymmetricCategory` instances. -/ -@[expose] public section +public section namespace RS @@ -61,6 +61,7 @@ variable {A A' B C D : Type*} again bilinear. This is the shape in which a lift out of a tensor product is fed into a second lift: the value of the outer lift is itself a linear map. -/ +@[expose] noncomputable def bicomp [AddCommGroup A] [Module ℂ A] [AddCommGroup A'] [Module ℂ A'] [AddCommGroup B] [Module ℂ B] [AddCommGroup C] [Module ℂ C] @@ -82,6 +83,7 @@ theorem bicomp_apply argument is the one held back: `(a', d) ↦ (a ↦ f (g a a') d)`. This is the shape needed when the inner lift is taken in the second factor of a tensor product. -/ +@[expose] noncomputable def bicompFlip [AddCommGroup A] [Module ℂ A] [AddCommGroup A'] [Module ℂ A'] [AddCommGroup B] [Module ℂ B] [AddCommGroup C] [Module ℂ C] @@ -537,6 +539,7 @@ variable {M N Q : S.Mod.{u, u, u, u}} (d : TensorData M N Q) /-- **A morphism out of a tensor product**: the two lifts of the four blocks of a `TensorData`, assembled into a morphism of super modules out of `M ⊗ N`. -/ +@[expose] noncomputable def mkHom : M.tensor N ⟶ Q where evenMap := liftEven M N d.fee d.foo d.hee d.hoo d.hoeo d.hooe oddMap := liftOdd M N d.feo d.foe d.heeo d.heoe d.hoee d.hooo @@ -622,6 +625,7 @@ section TensorHom variable {M M' M'' N N' N'' : S.Mod.{u, u, u, u}} /-- The data of the tensor product of two morphisms. -/ +@[expose] noncomputable def tensorHomData (f : M ⟶ M') (g : N ⟶ N') : TensorData M N (M'.tensor N') where fee := (tmulEE M' N').compl₁₂ f.evenMap g.evenMap @@ -695,6 +699,7 @@ noncomputable def tensorHomData (f : M ⟶ M') (g : N ⟶ N') : /-- **The tensor product of two morphisms**: apply each morphism in its own factor, degreewise. -/ +@[expose] noncomputable def tensorHom (f : M ⟶ M') (g : N ⟶ N') : M.tensor N ⟶ M'.tensor N' := mkHom (tensorHomData f g) @@ -760,7 +765,7 @@ associativity laws. It is `reducible` so that the identification of its components with those of `S` is transparent to unification and to `rw`. -/ -@[reducible] +@[expose, reducible] def _root_.RS.SuperCommAlgebra.unitMod (S : SuperCommAlgebra.{u, u}) : S.Mod.{u, u, u, u} where even := S.even @@ -879,6 +884,7 @@ theorem leftUnitorHom_oddMap_tmulOE (u : S.odd) (m : M.even) : /-- The inverse of the left unitor: tensor with the algebra unit. -/ +@[expose] noncomputable def leftUnitorInv : M ⟶ S.unitMod.tensor M where evenMap := tmulEE S.unitMod M S.one oddMap := tmulEO S.unitMod M S.one @@ -905,6 +911,7 @@ theorem leftUnitorInv_oddMap (m : M.odd) : /-- **The left unitor**: tensoring with the unit on the left changes nothing. -/ +@[expose] noncomputable def leftUnitor : S.unitMod.tensor M ≅ M where hom := leftUnitorHom M inv := leftUnitorInv M @@ -1022,6 +1029,7 @@ theorem rightUnitorHom_oddMap_tmulOE (m : M.odd) (x : S.even) : /-- The inverse of the right unitor: tensor with the algebra unit on the right. -/ +@[expose] noncomputable def rightUnitorInv : M ⟶ M.tensor S.unitMod where evenMap := (tmulEE M S.unitMod).flip S.one oddMap := (tmulOE M S.unitMod).flip S.one @@ -1040,6 +1048,7 @@ theorem rightUnitorInv_oddMap (m : M.odd) : /-- **The right unitor**: tensoring with the unit on the right changes nothing. -/ +@[expose] noncomputable def rightUnitor : M.tensor S.unitMod ≅ M where hom := rightUnitorHom M inv := rightUnitorInv M @@ -1228,6 +1237,7 @@ theorem braidingHom_braidingHom : id_oddMap, LinearMap.id_coe, id_eq] /-- **The braiding**: the Koszul swap of the two factors. -/ +@[expose] noncomputable def braiding : M.tensor N ≅ N.tensor M where hom := braidingHom M N inv := braidingHom N M @@ -2172,6 +2182,7 @@ theorem assocInv_assocHom : /-- **The associator**: reassociation of a threefold tensor product, with no sign. -/ +@[expose] noncomputable def associator : (M.tensor N).tensor P ≅ M.tensor (N.tensor P) where hom := assocHom M N P diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperModShift.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperModShift.lean index dd9ca07acb..867eaca9a7 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperModShift.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperModShift.lean @@ -18,7 +18,7 @@ permute among themselves and no sign appears. This is the module underlying a twist by the odd line. -/ -@[expose] public section +public section namespace RS @@ -31,6 +31,7 @@ namespace SuperCommAlgebra.Mod variable {S : SuperCommAlgebra.{u, u'}} /-- **The parity shift** of a super module. -/ +@[expose] def shift (M : S.Mod) : S.Mod where even := M.odd odd := M.even diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperModShiftUnit.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperModShiftUnit.lean index 9184e5ed15..a9d8a0fa99 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperModShiftUnit.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperModShiftUnit.lean @@ -46,7 +46,7 @@ degree and `+1` in odd degree. * `RS.SuperCommAlgebra.Mod.shiftUnitTensor`: the isomorphism. -/ -@[expose] public section +public section namespace RS @@ -165,6 +165,7 @@ noncomputable def shiftUnitHom : /-- The inverse of the shift-unit isomorphism: tensor with the algebra unit, which is odd in the shifted unit module. The even component carries a sign, forced by the odd-odd Koszul relator. -/ +@[expose] noncomputable def shiftUnitInv : shift M ⟶ (shift S.unitMod).tensor M where evenMap := -tmulOO (shift S.unitMod) M S.one @@ -208,6 +209,7 @@ noncomputable def shiftUnitInv : /-- **The parity shift of the unit is invertible**: tensoring with the shifted unit module shifts the parity. -/ +@[expose] noncomputable def shiftUnitTensor : (shift S.unitMod).tensor M ≅ shift M where hom := shiftUnitHom M diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperModTensor.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperModTensor.lean index 7f5f72687d..55219d1ad2 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperModTensor.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperModTensor.lean @@ -70,7 +70,7 @@ the construction needs a *commutative* base. packaged as `exists_unique_liftEven` and `exists_unique_liftOdd`. -/ -@[expose] public section +public section namespace RS @@ -87,6 +87,7 @@ variable (P Q : Type*) /-- A pair of parity blocks acting on the *left* factor of a two-summand graded tensor product, in the degree-preserving pattern: each summand stays where it is. -/ +@[expose] noncomputable def tensorLeftDiag [AddCommGroup P] [Module ℂ P] [AddCommGroup Q] [Module ℂ Q] {A : Type*} {X₁ : Type*} {X₂ : Type*} {Y₁ : Type*} {Y₂ : Type*} [AddCommGroup A] @@ -122,6 +123,7 @@ theorem tensorLeftDiag_apply /-- A pair of parity blocks acting on the *left* factor of a two-summand graded tensor product, in the degree-reversing pattern: the two summands are interchanged. -/ +@[expose] noncomputable def tensorLeftSwap [AddCommGroup P] [Module ℂ P] [AddCommGroup Q] [Module ℂ Q] {A : Type*} {X₁ : Type*} {X₂ : Type*} {Y₁ : Type*} {Y₂ : Type*} [AddCommGroup A] @@ -164,6 +166,7 @@ variable {A T T' : Type*} bilinear action of `A` carrying a submodule `R` of its source into a submodule `R'` of its target induces an action on the quotients. -/ +@[expose] noncomputable def descendAct [AddCommGroup A] [Module ℂ A] [AddCommGroup T] [Module ℂ T] [AddCommGroup T'] [Module ℂ T'] @@ -387,21 +390,25 @@ theorem relOddOOO_neg_mem (c : S.odd) (m : M.odd) (n : N.odd) : /-! ### The four action blocks before quotienting -/ /-- An even scalar acting on the left factor of the even part. -/ +@[expose] noncomputable def preActEE : S.even →ₗ[ℂ] tenEven M N →ₗ[ℂ] tenEven M N := tensorLeftDiag N.even N.odd M.actEE M.actEO /-- An even scalar acting on the left factor of the odd part. -/ +@[expose] noncomputable def preActEO : S.even →ₗ[ℂ] tenOdd M N →ₗ[ℂ] tenOdd M N := tensorLeftDiag N.odd N.even M.actEE M.actEO /-- An odd scalar acting on the left factor of the even part. -/ +@[expose] noncomputable def preActOE : S.odd →ₗ[ℂ] tenEven M N →ₗ[ℂ] tenOdd M N := tensorLeftSwap N.even N.odd M.actOE M.actOO /-- An odd scalar acting on the left factor of the odd part. -/ +@[expose] noncomputable def preActOO : S.odd →ₗ[ℂ] tenOdd M N →ₗ[ℂ] tenEven M N := tensorLeftSwap N.odd N.even M.actOE M.actOO @@ -673,6 +680,7 @@ super-commutative ℂ-algebra: the graded ℂ-tensor product of the underlying super spaces, quotiented in each degree by the balancing relators, with the `S`-action induced from the action on the left factor. -/ +@[expose] noncomputable def tensor : S.Mod where even := tenEven M N ⧸ balEven M N odd := tenOdd M N ⧸ balOdd M N @@ -722,24 +730,28 @@ noncomputable def tensor : S.Mod where /-! ### The canonical balanced map -/ /-- The canonical map, even times even. -/ +@[expose] noncomputable def tmulEE : M.even →ₗ[ℂ] N.even →ₗ[ℂ] (tensor M N).even := LinearMap.compr₂ (TensorProduct.mk ℂ M.even N.even) ((balEven M N).mkQ ∘ₗ LinearMap.inl ℂ _ _) /-- The canonical map, odd times odd. -/ +@[expose] noncomputable def tmulOO : M.odd →ₗ[ℂ] N.odd →ₗ[ℂ] (tensor M N).even := LinearMap.compr₂ (TensorProduct.mk ℂ M.odd N.odd) ((balEven M N).mkQ ∘ₗ LinearMap.inr ℂ _ _) /-- The canonical map, even times odd. -/ +@[expose] noncomputable def tmulEO : M.even →ₗ[ℂ] N.odd →ₗ[ℂ] (tensor M N).odd := LinearMap.compr₂ (TensorProduct.mk ℂ M.even N.odd) ((balOdd M N).mkQ ∘ₗ LinearMap.inl ℂ _ _) /-- The canonical map, odd times even. -/ +@[expose] noncomputable def tmulOE : M.odd →ₗ[ℂ] N.even →ₗ[ℂ] (tensor M N).odd := LinearMap.compr₂ (TensorProduct.mk ℂ M.odd N.even) @@ -916,6 +928,7 @@ variable {P : Type v} even-even and odd-odd blocks, balanced against the four even-degree relator families, factors through the even part of the tensor product. -/ +@[expose] noncomputable def liftEven [AddCommGroup P] [Module ℂ P] (fee : M.even →ₗ[ℂ] N.even →ₗ[ℂ] P) (foo : M.odd →ₗ[ℂ] N.odd →ₗ[ℂ] P) @@ -952,6 +965,7 @@ noncomputable def liftEven [AddCommGroup P] [Module ℂ P] even-odd and odd-even blocks, balanced against the four odd-degree relator families, factors through the odd part of the tensor product. -/ +@[expose] noncomputable def liftOdd [AddCommGroup P] [Module ℂ P] (feo : M.even →ₗ[ℂ] N.odd →ₗ[ℂ] P) (foe : M.odd →ₗ[ℂ] N.even →ₗ[ℂ] P) diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperPointMod.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperPointMod.lean index e52ca41728..6b9e052750 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperPointMod.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperPointMod.lean @@ -19,7 +19,7 @@ which is consistent exactly because a point kills the products of two odd elements. -/ -@[expose] public section +public section namespace RS @@ -34,6 +34,7 @@ variable {S : SuperCommAlgebra.{u, u'}} /-- **The residue module of a complex point**: the complex numbers in even degree and zero in odd degree, with the even part of the algebra acting through the point. -/ +@[expose] noncomputable def pointMod (P : SuperPoint S) : S.Mod.{u, u', w, w} where even := ULift.{w} ℂ diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperRealize.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperRealize.lean index 2a1a71ffb4..5d52c392a6 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperRealize.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperRealize.lean @@ -49,7 +49,7 @@ layers. values on `C`. -/ -@[expose] public section +public section namespace RS @@ -194,6 +194,7 @@ instance instAlgebraEven : Algebra ℂ S.even := /-- The even part of the ideal generated by the odd component: the ideal of the even ring spanned by the products of two odd elements. -/ +@[expose] def oddIdeal : Ideal S.even := Ideal.span (Set.range fun p : S.odd × S.odd => S.mulOO p.1 p.2) @@ -360,6 +361,7 @@ instance {V W : SuperMod.{u}} : SMul ℤ (V ⟶ W) := /-- The components of a morphism determine it; the additive and module structures are pulled back componentwise. -/ +@[expose] def homComponents {V W : SuperMod.{u}} (f : V ⟶ W) : (V.even →ₗ[ℂ] W.even) × (V.odd →ₗ[ℂ] W.odd) := (f.evenMap, f.oddMap) @@ -524,6 +526,7 @@ instance superRealize_linear object is isomorphic to a finite biproduct of members of the family. For the small model of `SuperVect` the two-member family of the unit and the odd line generates in this sense. -/ +@[expose] def BiproductGenerates [SmallCategory C] [Preadditive C] [HasFiniteColimits C] {ι : Type*} (g : ι → C) : Prop := ∀ X : C, ∃ (n : ℕ) (w : Fin n → ι), Nonempty (X ≅ ⨁ (g ∘ w)) @@ -625,6 +628,7 @@ theorem isZero_of_generator_hom_eq_zero /-- The generator pair of the realization functor as a `Bool`-indexed family: `false` is the even generator, `true` the odd one. -/ +@[expose] def generatorPair (g₀ g₁ : C) : Bool → C := fun b => bif b then g₁ else g₀ diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperSeries.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperSeries.lean index 0d3f8d4c28..f62e6a8b90 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperSeries.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperSeries.lean @@ -27,7 +27,7 @@ the pure cases and, for `n > q`, a linear recurrence of order `p` — the input for hook-vanishing arguments. -/ -@[expose] public section +public section namespace RS @@ -38,6 +38,7 @@ open Finset PowerSeries /-- The power sums of the super vector space `ℂ^{p|q}`: `p` copies of `+1` and `q` copies of `−1` with the super sign, so `superPS p q 1 = p + q`, `superPS p q 2 = p − q`, and so on. -/ +@[expose] noncomputable def superPS (p q : ℕ) : ℕ → ℂ := fun c => (p : ℂ) + (-1) ^ (c + 1) * (q : ℂ) diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperSmall.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperSmall.lean index 6cc81848a1..66805a1019 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperSmall.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperSmall.lean @@ -60,7 +60,7 @@ all reachable through the funnel; `isBilimitOfTotal` lives in the root `CategoryTheory.Limits` namespace, not on `Bicone`. -/ -@[expose] public section +public section namespace RS @@ -76,6 +76,7 @@ namespace SuperVect `Fin p → ℂ` in even degree and `Fin q → ℂ` in odd degree. Every super vector space is isomorphic to exactly one standard object, which is the entire content of the small model below. -/ +@[expose] def stdObj (pq : ℕ × ℕ) : SuperVect where even := Fin pq.1 → ℂ odd := Fin pq.2 → ℂ @@ -92,6 +93,7 @@ theorem stdObj_odd (pq : ℕ × ℕ) : /-- Componentwise linear equivalences assemble to an isomorphism of super vector spaces. -/ +@[expose] def isoOfEquivs {V W : SuperVect} (e : V.even ≃ₗ[ℂ] W.even) (o : V.odd ≃ₗ[ℂ] W.odd) : V ≅ W where hom := ⟨e.toLinearMap, o.toLinearMap⟩ @@ -479,6 +481,7 @@ instance : smallSuperInclusion.IsEquivalence := {} /-- **The small-model equivalence**: the small model is equivalent to `SuperVect`. -/ +@[expose] def smallSuperEquiv : SmallSuperVect ≌ SuperVect := smallSuperInclusion.asEquivalence @@ -503,6 +506,7 @@ def sEven : SmallSuperVect := (1, 0) /-- The odd generator of the small model: the odd line `(0, 1)`. -/ +@[expose] def sOdd : SmallSuperVect := (0, 1) /-- Any two subsingleton ℂ-modules are linearly equivalent by the diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperValues.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperValues.lean index 04aea6f87d..928256eba4 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperValues.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperValues.lean @@ -20,7 +20,7 @@ number — the full nonnegativity input for the hook arguments of Deligne 1.10/1.12. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperVectSchur.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperVectSchur.lean index 03600d4c6a..e458ee8127 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperVectSchur.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SuperVectSchur.lean @@ -29,7 +29,7 @@ Frobenius formula then yields `dim λ · s_λ(superPS p q)`, positive by hook positivity — so the idempotent's action cannot vanish. -/ -@[expose] public section +public section namespace RS @@ -42,6 +42,7 @@ noncomputable section /-- **The standard super vector space of dimension `(p, q)`**: `ℂ^p` in even degree and `ℂ^q` in odd degree. -/ +@[expose] def stdSuper (p q : ℕ) : SuperVect where even := Fin p → ℂ odd := Fin q → ℂ @@ -65,11 +66,13 @@ braiding enter through the action itself.) -/ /-- The trace of an endomorphism in `SuperVect`: the sum of the traces of its even and odd components. -/ +@[expose] def sTr {V : SuperVect} (f : V ⟶ V) : ℂ := LinearMap.trace ℂ V.even (SuperVect.Hom.evenMap f) + LinearMap.trace ℂ V.odd (SuperVect.Hom.oddMap f) /-- The super trace as a linear functional on endomorphisms. -/ +@[expose] def sTrL (V : SuperVect) : (V ⟶ V) →ₗ[ℂ] ℂ where toFun := sTr map_add' f g := by @@ -139,6 +142,7 @@ theorem sTr_tensorHom {V W : SuperVect} (f : V ⟶ V) (g : W ⟶ W) : /-- The parity involution of a super vector space: the identity on the even component and minus the identity on the odd component. -/ +@[expose] def parHom (V : SuperVect) : V ⟶ V where evenMap := LinearMap.id oddMap := -LinearMap.id @@ -211,6 +215,7 @@ theorem sTr_eq_trace_tot {V : SuperVect} (f : V ⟶ V) : /-- The middle shuffle of four product components: `((A × B) × (C × D)) ≃ₗ ((A × D) × (B × C))`. -/ +@[expose] def prodShuffle (A B C D : Type*) [AddCommGroup A] [Module ℂ A] [AddCommGroup B] [Module ℂ B] [AddCommGroup C] [Module ℂ C] [AddCommGroup D] [Module ℂ D] : @@ -233,6 +238,7 @@ theorem prodShuffle_apply (A B C D : Type*) /-- **The total tensor identification**: the total space of a graded tensor product is the tensor product of the total spaces, by the four-block shuffle. -/ +@[expose] def totTensor (V W : SuperVect) : (Tot V ⊗[ℂ] Tot W) ≃ₗ[ℂ] Tot (SuperVect.tensorObj V W) := (TensorProduct.prodLeft ℂ ℂ V.even V.odd (Tot W)).trans @@ -1229,6 +1235,7 @@ presentation. -/ /-- **The graded signed permutation representation**: the symmetric group acting on the total space of the tensor power of the standard super object, by the categorical action with its Koszul signs. -/ +@[expose] def gradedSignRep (p q n : ℕ) : Representation ℂ (Equiv.Perm (Fin n)) (Tot (tensorPow SuperVect (stdSuper p q) n)) where diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SymAlg.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SymAlg.lean index 2a3872b25e..5796da7bbe 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SymAlg.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SymAlg.lean @@ -53,7 +53,7 @@ frame machinery below are the concatenation substrate they will consume. -/ -@[expose] public section +public section namespace RS @@ -70,6 +70,7 @@ section PowCast /-- Transport of a tensor power along an equality of arities. It is an `eqToHom`, so it composes and cancels by `eqToHom` simp lemmas. -/ +@[expose] def powCast [Category.{v} D] [MonoidalCategory D] (X : D) {m n : ℕ} (h : m = n) : tensorPow D X m ⟶ tensorPow D X n := @@ -112,6 +113,7 @@ module factor be compared in a common frame. section Peel /-- Peel the first factor off a non-empty tensor power. -/ +@[expose] noncomputable def powPeel [Category.{v} D] [MonoidalCategory D] (X : D) : (q : ℕ) → (tensorPow D X (q + 1) ≅ X ⊗ tensorPow D X q) @@ -125,6 +127,7 @@ theorem powPeel_zero [Category.{v} D] [MonoidalCategory D] (X : D) : /-- Attach a peeled factor to the power below it. The associator, retyped so that its target is stated through the tensor power — this keeps every statement about it type-correct at low transparency. -/ +@[expose] noncomputable def powAttach [Category.{v} D] [MonoidalCategory D] (X : D) (p q : ℕ) : tensorPow D X p ⊗ (X ⊗ tensorPow D X q) ⟶ @@ -134,6 +137,7 @@ noncomputable def powAttach [Category.{v} D] [MonoidalCategory D] (X : D) /-- Expose the top factor of the second block of a pair of powers. The associator, retyped so that its source is stated through the tensor power. -/ +@[expose] noncomputable def powExpose [Category.{v} D] [MonoidalCategory D] (X : D) (p q : ℕ) : tensorPow D X p ⊗ tensorPow D X (q + 1) ⟶ @@ -237,12 +241,14 @@ section WinLeg /-- The slot leg acting on the left factor, through the braided right action. -/ +@[expose] noncomputable def winLegM [Category.{v} D] [MonoidalCategory D] [BraidedCategory D] (A : D) [MonObj A] (X : D) [ModObj A X] : (X ⊗ A) ⊗ X ⟶ X ⊗ X := actRight A X ▷ X /-- The slot leg acting on the right factor: associate, then act. -/ +@[expose] noncomputable def winLegN [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] (X : D) [ModObj A X] : (X ⊗ A) ⊗ X ⟶ X ⊗ X := @@ -264,6 +270,7 @@ abbrev modPowMid [Category.{v} D] [MonoidalCategory D] (A : D) (X : D) /-- Glue a resolved slot back into the ambient power: reassociate the two exposed factors onto the lower power and concatenate. -/ +@[expose] noncomputable def modPowGlue [Category.{v} D] [MonoidalCategory D] (X : D) (a b : ℕ) : (tensorPow D X a ⊗ (X ⊗ X)) ⊗ tensorPow D X b ⟶ @@ -273,6 +280,7 @@ noncomputable def modPowGlue [Category.{v} D] [MonoidalCategory D] (X : D) /-- The first relation leg at slot `(a, b)`: act on the left module factor through the braided right action, then glue. -/ +@[expose] noncomputable def modPowLegM [Category.{v} D] [MonoidalCategory D] [BraidedCategory D] (A : D) [MonObj A] (X : D) [ModObj A X] @@ -283,6 +291,7 @@ noncomputable def modPowLegM /-- The second relation leg at slot `(a, b)`: associate and act on the right module factor, then glue. -/ +@[expose] noncomputable def modPowLegN [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] (X : D) [ModObj A X] @@ -307,6 +316,7 @@ noncomputable abbrev modPowSrc ⨁ fun i : Fin (n - 1) => modPowMid A X i.val (n - 2 - i.val) /-- The first leg of the relation pair, assembled over all slots. -/ +@[expose] noncomputable def modPowLegFst [Category.{v} D] [MonoidalCategory D] [BraidedCategory D] (A : D) [MonObj A] (X : D) [ModObj A X] [Preadditive D] [HasFiniteBiproducts D] @@ -316,6 +326,7 @@ noncomputable def modPowLegFst modPowLegM A X i.val (n - 2 - i.val) ≫ powCast X (slot_decomp i) /-- The second leg of the relation pair, assembled over all slots. -/ +@[expose] noncomputable def modPowLegSnd [Category.{v} D] [MonoidalCategory D] (A : D) [MonObj A] (X : D) [ModObj A X] [Preadditive D] [HasFiniteBiproducts D] @@ -334,6 +345,7 @@ section ModPow the wide relation pair, identifying `(x·c) ⊗ y ~ x ⊗ (c·y)` in every adjacent slot simultaneously. No binary module tensor product and no associativity enter. -/ +@[expose] noncomputable def modPow [Category.{v} D] [MonoidalCategory D] [BraidedCategory D] (A : D) [MonObj A] (X : D) [ModObj A X] [Preadditive D] [HasFiniteBiproducts D] @@ -342,6 +354,7 @@ noncomputable def modPow coequalizer (modPowLegFst A X n) (modPowLegSnd A X n) /-- The projection of the ambient power onto the module power. -/ +@[expose] noncomputable def modPowπ [Category.{v} D] [MonoidalCategory D] [BraidedCategory D] (A : D) [MonObj A] (X : D) [ModObj A X] [Preadditive D] [HasFiniteBiproducts D] @@ -442,6 +455,7 @@ isomorphism. -/ /-- Below two factors the projection is an isomorphism. -/ +@[expose] noncomputable def modPowTriv [Category.{v} D] [MonoidalCategory D] [BraidedCategory D] (A : D) [MonObj A] (X : D) [ModObj A X] [Preadditive D] [HasFiniteBiproducts D] @@ -455,6 +469,7 @@ noncomputable def modPowTriv inv_hom_id := modPowπ_desc A X _ _ /-- **The empty module power is the unit.** -/ +@[expose] noncomputable def modPowZero [Category.{v} D] [MonoidalCategory D] [BraidedCategory D] (A : D) [MonObj A] (X : D) [ModObj A X] [Preadditive D] [HasFiniteBiproducts D] @@ -462,6 +477,7 @@ noncomputable def modPowZero modPowTriv A X (by omega) /-- **The singleton module power is the module.** -/ +@[expose] noncomputable def modPowOne [Category.{v} D] [MonoidalCategory D] [BraidedCategory D] (A : D) [MonObj A] (X : D) [ModObj A X] [Preadditive D] [HasFiniteBiproducts D] @@ -1763,7 +1779,7 @@ theorem modPowPerm_mul /-- **The symmetric group acting on the module power**, as a monoid homomorphism. -/ -@[simps] +@[expose, simps] noncomputable def modPowPermHom [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] (A : D) [MonObj A] (X : D) [ModObj A X] [Preadditive D] [HasFiniteBiproducts D] @@ -1787,6 +1803,7 @@ section Symmetriser /-- **The symmetriser** `(1/n!) • ∑ σ, σ` of the symmetric-group algebra. -/ +@[expose] noncomputable def symmetriser (n : ℕ) : SymGroupAlgebra n := ((n.factorial : ℂ))⁻¹ • ∑ σ : Equiv.Perm (Fin n), MonoidAlgebra.single σ 1 @@ -1831,6 +1848,7 @@ section SymPow /-- **The symmetric-group algebra acting on the module power**, the `ℂ`-linear extension of the descended action. -/ +@[expose] noncomputable def modPowAlg [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] (A : D) [MonObj A] (X : D) [ModObj A X] [Preadditive D] [HasFiniteBiproducts D] @@ -1853,6 +1871,7 @@ theorem modPowAlg_single rfl /-- The symmetriser acting on the module power. -/ +@[expose] noncomputable def symPowIdem [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] (A : D) [MonObj A] (X : D) [ModObj A X] [Preadditive D] [HasFiniteBiproducts D] @@ -1878,6 +1897,7 @@ with section `symPowσ`; this presentation is chosen because the consumers of the Key Lemma build morphisms out of the symmetric power by descent along `symPowπ` and morphisms into it through the section. -/ +@[expose] noncomputable def symPow [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] (A : D) [MonObj A] (X : D) [ModObj A X] [Preadditive D] [HasFiniteBiproducts D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SymDatum.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SymDatum.lean index 9eb4daaa14..e1d4db29ea 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SymDatum.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SymDatum.lean @@ -20,7 +20,7 @@ transferred datum are where retraction and self-adjointness enter, and they live with the pairing calculus. -/ -@[expose] public section +public section namespace RS @@ -38,6 +38,7 @@ modules induces one on any pair connected to it by module maps — the pairing pulls back along maps into the pair, the copairing pushes forward along maps out of it. Linearity is inherited compositionally. -/ +@[expose] noncomputable def ModDualityDatum.transfer [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] @@ -74,6 +75,7 @@ section SymBundles /-- The symmetriser projection, as a morphism of bundled modules; the mirror of `symPowσMod`. -/ +@[expose] noncomputable def symPowπMod [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] @@ -96,6 +98,7 @@ section SymDatum /-- **The symmetric power duality datum**: the symmetric powers of a dual pair form a dual pair, by transferring the power datum along the symmetriser section and projection. -/ +@[expose] noncomputable def symDualityDatum [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SymMul.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SymMul.lean index 52aa83fd4f..892856a98f 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/SymMul.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/SymMul.lean @@ -43,7 +43,7 @@ braided category the `tensorRight` mirror follows — together with intended consumers. -/ -@[expose] public section +public section namespace RS @@ -194,6 +194,7 @@ end CastTransport section ModCast /-- Transport of a module power along an equality of arities. -/ +@[expose] noncomputable def modPowCast [Category.{v} D] [MonoidalCategory D] [BraidedCategory D] (A : D) [MonObj A] (X : D) [ModObj A X] [Preadditive D] [HasFiniteBiproducts D] @@ -247,6 +248,7 @@ section SlotEmbed /-- The bridge carrying a left-block slot into the concatenated power: reassociate the right block onto the slot context and concatenate the contexts. -/ +@[expose] noncomputable def midConcatFst [Category.{v} D] [MonoidalCategory D] (A : D) (X : D) (a b n : ℕ) : @@ -259,6 +261,7 @@ noncomputable def midConcatFst /-- The bridge carrying a right-block slot into the concatenated power: reassociate the left block onto the slot's lower context and concatenate. -/ +@[expose] noncomputable def midConcatSnd [Category.{v} D] [MonoidalCategory D] (A : D) (X : D) (m a b : ℕ) : @@ -953,6 +956,7 @@ section SymMulDef /-- **The multiplication on symmetric powers**, through the sections and the raw multiplication. -/ +@[expose] noncomputable def symMul [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] (A : D) [MonObj A] (X : D) [ModObj A X] [Preadditive D] [HasFiniteBiproducts D] @@ -1066,6 +1070,7 @@ theorem symPowIdem_one rfl /-- **The singleton symmetric power is the module.** -/ +@[expose] noncomputable def symPowOne [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] (A : D) [MonObj A] (X : D) [ModObj A X] [Preadditive D] [HasFiniteBiproducts D] @@ -1079,6 +1084,7 @@ noncomputable def symPowOne Category.id_comp, Iso.inv_hom_id] /-- Transport of a symmetric power along an equality of arities. -/ +@[expose] noncomputable def symPowCast [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] (A : D) [MonObj A] (X : D) [ModObj A X] [Preadditive D] [HasFiniteBiproducts D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/TensorDatum.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/TensorDatum.lean index b5f8ab3373..500ade35f8 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/TensorDatum.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/TensorDatum.lean @@ -19,7 +19,7 @@ descended interchange exists because the interchange is linear in both factors. -/ -@[expose] public section +public section namespace RS @@ -107,6 +107,7 @@ end InterchangeDesc section Datum /-- The fold of the doubled regular module onto the base. -/ +@[expose] noncomputable def regPairFold [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] (A : D) [MonObj A] [IsCommMonObj A] : @@ -115,6 +116,7 @@ noncomputable def regPairFold /-- **The tensor pairing**: cross through the descended interchange, pair coordinatewise, and fold. -/ +@[expose] noncomputable def tensorPair [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] @@ -130,6 +132,7 @@ noncomputable def tensorPair modTensorMap A d₁.pairMod d₂.pairMod ≫ regPairFold A /-- The unfolding of the base into the doubled regular module. -/ +@[expose] noncomputable def regPairUnfold [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] (A : D) [MonObj A] [IsCommMonObj A] : @@ -138,6 +141,7 @@ noncomputable def regPairUnfold /-- **The tensor copairing**: unfold the unit, insert both copairings, and regroup through the descended interchange. -/ +@[expose] noncomputable def tensorCopair [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] @@ -216,6 +220,7 @@ theorem tensorCopair_linear /-- **The tensor product of duality data** (Deligne 1.15, tensor part): dual pairs tensor, with the crossed coordinatewise pairing and copairing. -/ +@[expose] noncomputable def tensorDatum [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/TensorExact.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/TensorExact.lean index 614297cdd6..86a7495917 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/TensorExact.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/TensorExact.lean @@ -20,7 +20,7 @@ zero objects, and a tensor power of a nonzero object detects nothing (`X ^ ⊗ n = 0` forces `X = 0`, Deligne 1.17). -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/TensorMuBraid.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/TensorMuBraid.lean index 05bd298092..7a0e5e3c77 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/TensorMuBraid.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/TensorMuBraid.lean @@ -27,7 +27,7 @@ exchange of the disjoint crossings `β_ a c` and `β_ b d` produces the right-hand side. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/TensorPowZero.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/TensorPowZero.lean index 8466aa4e70..edea57ceef 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/TensorPowZero.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/TensorPowZero.lean @@ -28,7 +28,7 @@ objects over a preadditive monoidal structure. Downward induction and the left unitor then give the theorem. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/TensorTransfer.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/TensorTransfer.lean index c8e1b22ec1..ef4ea11e3e 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/TensorTransfer.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/TensorTransfer.lean @@ -26,7 +26,7 @@ multiplicity pushes a bounding-box cell into `μ'` or `ν'` (Deligne 1.12). -/ -@[expose] public section +public section namespace RS @@ -58,7 +58,7 @@ noncomputable def whiskerLeftAlg /-- **The double action of a pair of permutations** on `X ^ ⊗ n ⊗ Y ^ ⊗ n`, as a monoid homomorphism on the product group: `(σ, τ)` acts by the two actions tensored together. -/ -@[simps] +@[expose, simps] noncomputable def pairPermHom [Category.{v} A] [MonoidalCategory A] [SymmetricCategory A] [Preadditive A] @@ -122,7 +122,7 @@ theorem pairAlg_diagEmbed ((σ, σ) : Equiv.Perm (Fin n) × Equiv.Perm (Fin n)) (1 : ℂ) := by change MonoidAlgebra.mapDomain _ (MonoidAlgebra.single σ 1) = _ - exact MonoidAlgebra.mapDomain_single + exact MonoidAlgebra.mapDomain_single (R := ℂ) rw [hd, pairAlg_single, diagAlg_single] exact DFunLike.congr_fun hext x @@ -152,7 +152,7 @@ theorem pairAlg_extFst ((σ, 1) : Equiv.Perm (Fin n) × Equiv.Perm (Fin n)) (1 : ℂ) := by change MonoidAlgebra.mapDomain _ (MonoidAlgebra.single σ 1) = _ - exact MonoidAlgebra.mapDomain_single + exact MonoidAlgebra.mapDomain_single (R := ℂ) rw [hf, pairAlg_single, permAlg_single, permMor_one, MonoidalCategory.tensorHom_id] rfl @@ -184,7 +184,7 @@ theorem pairAlg_extSnd ((1, τ) : Equiv.Perm (Fin n) × Equiv.Perm (Fin n)) (1 : ℂ) := by change MonoidAlgebra.mapDomain _ (MonoidAlgebra.single τ 1) = _ - exact MonoidAlgebra.mapDomain_single + exact MonoidAlgebra.mapDomain_single (R := ℂ) rw [hs, pairAlg_single, permAlg_single, permMor_one, MonoidalCategory.id_tensorHom] rfl diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/TensorZigzag.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/TensorZigzag.lean index ae97116ff9..7eed15f141 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/TensorZigzag.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/TensorZigzag.lean @@ -21,7 +21,7 @@ of carriers is the tensor of the component contractions; nesting the two component triangles closes the tensor triangle. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/TrichotomyClose.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/TrichotomyClose.lean index e9be1a0420..bc5b8feab2 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/TrichotomyClose.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/TrichotomyClose.lean @@ -20,7 +20,7 @@ remainder. The descent is a parameter, discharged by the sandwich retract. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistBiprod.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistBiprod.lean index 6690168bfc..731a06edc8 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistBiprod.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistBiprod.lean @@ -24,7 +24,7 @@ projection is a module map and the twist of a module map is again a module map. -/ -@[expose] public section +public section namespace RS @@ -242,6 +242,7 @@ theorem twistBiprodActR_inv MonoidalCategory.whiskerLeft_id, Category.id_comp] /-- The distributivity map, as a module map. -/ +@[expose] noncomputable def tensorLeftBiprodModHom [Category.{v} D] [MonoidalCategory D] [Preadditive D] [HasBinaryBiproducts D] [SymmetricCategory D] (A : D) [MonObj A] (V : D) @@ -253,6 +254,7 @@ noncomputable def tensorLeftBiprodModHom (by exact twistBiprodActL_hom A V P Q) /-- The inverse distributivity map, as a module map. -/ +@[expose] noncomputable def tensorLeftBiprodModInv [Category.{v} D] [MonoidalCategory D] [Preadditive D] [MonoidalPreadditive D] [HasBinaryBiproducts D] [SymmetricCategory D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistCoherence.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistCoherence.lean index 53e1f7629f..2b45bd616c 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistCoherence.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistCoherence.lean @@ -17,7 +17,7 @@ back into the middle equals associating it into the second factor and interchanging. Two crossings cancel by symmetry. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistDatum.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistDatum.lean index 63987dedaf..1f01d150ca 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistDatum.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistDatum.lean @@ -28,7 +28,7 @@ along the twist shuffle gives the odd twist of a duality datum, zigzag laws included. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistFreeTensor.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistFreeTensor.lean index 154cc47eef..e4d780754b 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistFreeTensor.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistFreeTensor.lean @@ -23,7 +23,7 @@ braiding. a module is the twist of that module by the generating object. -/ -@[expose] public section +public section namespace RS @@ -58,6 +58,7 @@ theorem freeRegTwist_act /-- **The free module is a twisted regular module**: the free module on `V` is the twist by `V` of the regular module, through the braiding carrying the algebra past the generator. -/ +@[expose] noncomputable def freeRegTwistIso [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] (A : D) [MonObj A] @@ -87,6 +88,7 @@ module on `V` with a module `M` is the twist of `M` by `V`. The free module is the twisted regular module, the twist shuffle collects both twists in front, and the regular module is the unit of the relative tensor. -/ +@[expose] noncomputable def freeTensorTwistIso [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistMixLine.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistMixLine.lean index 656f36942a..b8bf007113 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistMixLine.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistMixLine.lean @@ -20,7 +20,7 @@ sum `L.mix q p` of `q` copies of the unit and `p` copies of the line. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistPow.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistPow.lean index 6529996197..756e5d8d51 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistPow.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistPow.lean @@ -18,7 +18,7 @@ isomorphisms: the two transport devices consumed by the k-fold twisted power identification. -/ -@[expose] public section +public section namespace RS @@ -31,6 +31,7 @@ variable {D : Type u} /-- The double twist transport: object and module isomorphisms together. -/ +@[expose] noncomputable def tensorLeftModMapIso [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] (A : D) [MonObj A] @@ -43,6 +44,7 @@ noncomputable def tensorLeftModMapIso section Powers /-- The bottom power module is the module. -/ +@[expose] noncomputable def modPowModZeroIso [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] @@ -58,6 +60,7 @@ noncomputable def modPowModZeroIso /-- The merge of adjacent power modules, as a module isomorphism. -/ +@[expose] noncomputable def powMergeModIso [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] @@ -75,6 +78,7 @@ noncomputable def powMergeModIso /-- **The twisted power identification**: the relative powers of a twisted module are the twist of the powers by the tensor powers of the twisting object. -/ +@[expose] noncomputable def twistPowModIso [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistShuffle.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistShuffle.lean index 270878a8ef..ad838a5a1e 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistShuffle.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistShuffle.lean @@ -21,7 +21,7 @@ general, and the sign phenomena of the odd line enter only at the symmetriser conjugation downstream. -/ -@[expose] public section +public section namespace RS @@ -33,6 +33,7 @@ universe v u variable {D : Type u} /-- The twist of a module by an object on the left, bundled. -/ +@[expose] noncomputable def tensorLeftMod [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] (A : D) [MonObj A] @@ -50,6 +51,7 @@ noncomputable def tensorLeftMod /-- The cover map of the twist shuffle: the middle-four interchange followed by the projection under the twists. -/ +@[expose] noncomputable def twistShuffleCover [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] (A : D) [MonObj A] (V : D) (W : D) (R : Mod D A) @@ -448,6 +450,7 @@ theorem twistShuffleHom_act /-- **The twist shuffle as a module map**: the shuffled pair maps to the twist of the relative tensor. -/ +@[expose] noncomputable def twistShuffleModHom [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] @@ -486,6 +489,7 @@ theorem twistShuffleInv_act MonoidalCategory.whiskerLeft_id, Category.id_comp] /-- The inverse twist shuffle as a module map. -/ +@[expose] noncomputable def twistShuffleModInv [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] @@ -498,6 +502,7 @@ noncomputable def twistShuffleModInv (twistShuffleInv_act A V W R S) /-- The module-level twist shuffle is an isomorphism. -/ +@[expose] noncomputable def twistShuffleModIso [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [HasCoequalizers D] @@ -515,6 +520,7 @@ noncomputable def twistShuffleModIso /-- An object map in the twist slot, as a module map: the twist action carries past the context naturally. -/ +@[expose] noncomputable def tensorLeftModContextHom [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] (A : D) [MonObj A] @@ -528,6 +534,7 @@ noncomputable def tensorLeftModContextHom exact (actAcross_natural A f M.X).symm) /-- A module map under the twist, as a module map. -/ +@[expose] noncomputable def tensorLeftModWhiskerHom [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] (A : D) [MonObj A] @@ -546,6 +553,7 @@ noncomputable def tensorLeftModWhiskerHom ← braidPast_natural_tail, Category.assoc]) /-- The twist-slot transport of an object isomorphism. -/ +@[expose] noncomputable def tensorLeftModContextIso [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] (A : D) [MonObj A] @@ -564,6 +572,7 @@ noncomputable def tensorLeftModContextIso MonoidalCategory.id_whiskerRight]) /-- The twist of a module isomorphism. -/ +@[expose] noncomputable def tensorLeftModWhiskerIso [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] (A : D) [MonObj A] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistState.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistState.lean index 3a22268981..9ee21d87b7 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistState.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistState.lean @@ -21,7 +21,7 @@ into a line and each line summand into a unit, so the two counts change places. Twisting twice returns to the original object. -/ -@[expose] public section +public section namespace RS @@ -49,6 +49,7 @@ noncomputable def freeMixTwistIso /-- **The odd twist of a dévissage state**: the counts change places and the remainder gains a line factor. -/ +@[expose] noncomputable def twistState [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] [Preadditive D] [MonoidalPreadditive D] [HasFiniteBiproducts D] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistSymPow.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistSymPow.lean index 2769a4a9a6..b68297c2d4 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistSymPow.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistSymPow.lean @@ -19,7 +19,7 @@ zero both are the tensor unit, so the exchange holds there too. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistUnitor.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistUnitor.lean index 846e9b5730..7278a9dff7 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistUnitor.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/TwistUnitor.lean @@ -30,7 +30,7 @@ actions. twist of the free module, through the carrying isomorphism. -/ -@[expose] public section +public section namespace RS @@ -62,6 +62,7 @@ theorem actAcross_unit /-- **The unit twist collapses**: twisting a module by the tensor unit is the left unitor, as a module isomorphism. -/ +@[expose] noncomputable def tensorLeftUnitMod [Category.{v} D] [MonoidalCategory D] [SymmetricCategory D] (A : D) [MonObj A] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/UnitBase.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/UnitBase.lean index 7cf4ca5c76..ef06bb0472 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/UnitBase.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/UnitBase.lean @@ -26,7 +26,7 @@ collapses to the ambient category. whose carrier is zero collapses to the other summand. -/ -@[expose] public section +public section namespace RS @@ -41,6 +41,7 @@ section UnitModule /-- Any object, as a module over the tensor unit through the trivial action. -/ +@[expose] def unitMod [Category.{v} D] [MonoidalCategory D] (X : D) : Mod D (𝟙_ D) := ⟨X⟩ @@ -93,7 +94,7 @@ lemma modTensorLegM_unitBase_eq /-- **Over the trivial base the module tensor product is the plain tensor product**: the coequalizer of a pair of equal legs is the target itself. -/ -@[simps] +@[expose, simps] noncomputable def modTensorUnitBase [Category.{v} D] [MonoidalCategory D] [BraidedCategory D] (M : Mod D (𝟙_ D)) (N : Mod D (𝟙_ D)) [HasCoequalizers D] : @@ -130,6 +131,7 @@ theorem freeModUnitBase_linear_inv /-- **The free module over the trivial base is its generator**, via the left unitor. -/ +@[expose] noncomputable def freeModUnitBase [Category.{v} D] [MonoidalCategory D] (V : D) : freeMod (𝟙_ D) V ≅ unitMod V where diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/UnitFreeMod.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/UnitFreeMod.lean index eacf4ea32c..3b72f370b7 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/UnitFreeMod.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/UnitFreeMod.lean @@ -24,7 +24,7 @@ leg is the coherence identity in the monoidal unit recorded by `freeModUnitBase_linear` and `freeModUnitBase_linear_inv`. -/ -@[expose] public section +public section namespace RS @@ -38,6 +38,7 @@ section UnitFree /-- **The trivial module on `V` is the free module on `V` over the tensor unit**, through the inverse left unitor. -/ +@[expose] noncomputable def unitFreeIso [Category.{v} D] [MonoidalCategory D] (V : D) : unitMod V ≅ freeMod (𝟙_ D) V := (freeModUnitBase V).symm diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/UnitMod.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/UnitMod.lean index 176f3d0f8b..fe063a76f8 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/UnitMod.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/UnitMod.lean @@ -20,7 +20,7 @@ multiplication law inherited — the substrate of the local splitting algebra. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/UnitSimple.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/UnitSimple.lean index 01b860a35c..f099eaa157 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/UnitSimple.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/UnitSimple.lean @@ -28,7 +28,7 @@ idempotents besides `0` and `1`: the value `1` would force `i = 0`, so the idempotent vanishes, `V = 0`, and `i` is an isomorphism. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/UnitStage.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/UnitStage.lean index 201b5433ec..c1c28645f8 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/UnitStage.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/UnitStage.lean @@ -16,7 +16,7 @@ maps out of it into filtered colimits factor through stages — the form in which the Key Lemma's colimit algebra is probed. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/UniversalAlgebra.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/UniversalAlgebra.lean index c93f98d3c6..13eb4feafe 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/UniversalAlgebra.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/UniversalAlgebra.lean @@ -19,7 +19,7 @@ gives a single nonzero algebra over which every object is a mixed sum and every short exact sequence splits. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/WhiskerFaithful.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/WhiskerFaithful.lean index 9ceab00fa8..fb3d1d282f 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/WhiskerFaithful.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/WhiskerFaithful.lean @@ -23,7 +23,7 @@ Simplicity of the unit is carried as a hypothesis and discharged where `End 𝟙 = ℂ` is available. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/WordMap.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/WordMap.lean index 43f85d9a4a..99dbe2af99 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/WordMap.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/WordMap.lean @@ -36,7 +36,7 @@ reused from `BiprodPow` unchanged: they depend only on the two source objects, never on the letter maps. -/ -@[expose] public section +public section namespace RS @@ -50,6 +50,7 @@ variable {A : Type u} /-- The morphism selected by one letter: `f` on a `true` letter and `g` on a `false` one. -/ +@[expose] def letterMap [Category.{v} A] {U : A} {V : A} {Z : A} (f : U ⟶ Z) (g : V ⟶ Z) : (b : Bool) → ((bif b then U else V) ⟶ Z) @@ -58,6 +59,7 @@ def letterMap [Category.{v} A] {U : A} {V : A} {Z : A} /-- **The word map**: the fold of the letter maps of `f` and `g` over a word, by the recursion of `wordPow`. -/ +@[expose] noncomputable def wordMap [Category.{v} A] [MonoidalCategory A] {U : A} {V : A} {Z : A} (f : U ⟶ Z) (g : V ⟶ Z) : diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ZagAction.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ZagAction.lean index 7c74003e3b..85c0855a60 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ZagAction.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ZagAction.lean @@ -17,7 +17,7 @@ both carriers on the left and projecting is multiplying the scalars and acting on the projected pair. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ZigzagCarrier.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ZigzagCarrier.lean index d814019e7f..8da51444b2 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ZigzagCarrier.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ZigzagCarrier.lean @@ -36,7 +36,7 @@ conversely. the multi-level laws from the carrier-level identities. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ZigzagNonzero.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ZigzagNonzero.lean index 313148923a..66425cae3a 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ZigzagNonzero.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ZigzagNonzero.lean @@ -26,7 +26,7 @@ nonvanishing exactly from the nonvanishing of the corresponding power objects. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ZigzagSandwich.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ZigzagSandwich.lean index 3ee322a6bb..00e4f059fe 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ZigzagSandwich.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ZigzagSandwich.lean @@ -24,7 +24,7 @@ That form is what a strong monoidal functor transports, so it is the shape in which base change consumes the zigzag laws. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ZigzagTransfer.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ZigzagTransfer.lean index 28bee4fbda..7e39848f86 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ZigzagTransfer.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ZigzagTransfer.lean @@ -23,7 +23,7 @@ projection, this gives the zigzag laws of the symmetric-power datum from those of the power datum — Deligne's 1.15.1. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ZigzagTransferIso.lean b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ZigzagTransferIso.lean index c7da3c653d..3aea172dae 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Deligne/ZigzagTransferIso.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Deligne/ZigzagTransferIso.lean @@ -17,7 +17,7 @@ transfer is vacuous and the zigzag laws pass across without any further hypothesis. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Interfaces/DeligneBridge.lean b/LeanPool/RegtsSevenster/RS/Classical/Interfaces/DeligneBridge.lean index 0362e3b3d0..bd2130f521 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Interfaces/DeligneBridge.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Interfaces/DeligneBridge.lean @@ -21,7 +21,7 @@ supersymmetry by the braided-functor axiom, and `exists_std_model` produces the coordinates. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/RegtsSevenster/RS/Classical/Interfaces/DelignePackage.lean b/LeanPool/RegtsSevenster/RS/Classical/Interfaces/DelignePackage.lean index 07a925c74b..7f276a8272 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Interfaces/DelignePackage.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Interfaces/DelignePackage.lean @@ -27,7 +27,7 @@ cited theorem are discharged for that envelope in `RS/Novel/Envelope/EnvDelignePackage.lean`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Interfaces/DelignePackageRestrict.lean b/LeanPool/RegtsSevenster/RS/Classical/Interfaces/DelignePackageRestrict.lean index 8dc691b7ea..b95fbe3460 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Interfaces/DelignePackageRestrict.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Interfaces/DelignePackageRestrict.lean @@ -16,7 +16,7 @@ monoidal, additive, ℂ-linear functor: compose the fibre functor with the embedding. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Interfaces/DeligneTheorem.lean b/LeanPool/RegtsSevenster/RS/Classical/Interfaces/DeligneTheorem.lean index f838277915..530e5391e2 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Interfaces/DeligneTheorem.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Interfaces/DeligneTheorem.lean @@ -29,7 +29,7 @@ representations of a supergroup, which yields the functor by composing with the forgetful functor. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Interfaces/EulerianIndependence.lean b/LeanPool/RegtsSevenster/RS/Classical/Interfaces/EulerianIndependence.lean index f60be41f7b..234a821900 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Interfaces/EulerianIndependence.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Interfaces/EulerianIndependence.lean @@ -20,7 +20,7 @@ eliminates the choice in `EdgeSubset.mixedValue` against any concrete transition data. -/ -@[expose] public section +public section namespace RS @@ -29,6 +29,7 @@ arXiv:1807.04494, Proposition 3): the mixed summand is independent of the transition system and orientation. Proved as `RS.eulerianIndependence` in `RS/Novel/Skein/AllInternalAgreement.lean`. -/ +@[expose] def EulerianIndependence : Prop := ∀ {α : Type} {W : Fragment α} (F : EdgeSubset W) {k ℓ : ℕ} (h : MixedFunctional k ℓ) diff --git a/LeanPool/RegtsSevenster/RS/Classical/Interfaces/FibreTransport.lean b/LeanPool/RegtsSevenster/RS/Classical/Interfaces/FibreTransport.lean index 45c97d80f3..f75efdf2e5 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Interfaces/FibreTransport.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Interfaces/FibreTransport.lean @@ -24,7 +24,7 @@ monoidal functor) is Mathlib's `ExactPairing.ofFaithful`. -/ -@[expose] public section +public section namespace RS @@ -40,7 +40,7 @@ an `ExactPairing X Y` in `C` yields an with evaluation and coevaluation conjugated through the tensorator and unit isomorphisms of `F`. -/ -@[instance_reducible] +@[expose, instance_reducible] def ExactPairing.map [Category C] [Category D] [MonoidalCategory C] [MonoidalCategory D] (F : C ⥤ D) [F.Monoidal] diff --git a/LeanPool/RegtsSevenster/RS/Classical/Interfaces/KoszulAction.lean b/LeanPool/RegtsSevenster/RS/Classical/Interfaces/KoszulAction.lean index 67db1071e2..f2f15e9582 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Interfaces/KoszulAction.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Interfaces/KoszulAction.lean @@ -22,7 +22,7 @@ representation kills too. That containment is what the sector trace needs. -/ -@[expose] public section +public section noncomputable section @@ -38,11 +38,13 @@ variable {R : ℕ} (f : EdgeRankParameter R) /-- The even component of a SuperVect endomorphism, viewed as a module endomorphism. -/ +@[expose] def evenComponent (W : SuperVect) (g : End W) : Module.End ℂ W.even := (g : SuperVect.Hom W W).evenMap /-- The odd component of a SuperVect endomorphism. -/ +@[expose] def oddComponent (W : SuperVect) (g : End W) : Module.End ℂ W.odd := (g : SuperVect.Hom W W).oddMap diff --git a/LeanPool/RegtsSevenster/RS/Classical/Interfaces/OmegaPerm.lean b/LeanPool/RegtsSevenster/RS/Classical/Interfaces/OmegaPerm.lean index 72263580ae..dda33f9300 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Interfaces/OmegaPerm.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Interfaces/OmegaPerm.lean @@ -47,7 +47,7 @@ the symmetric-group algebra to `End (ω.obj (SkeinObj.mk n))`, and agreeing on the generators `σ` makes it that composite. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/RegtsSevenster/RS/Classical/Interfaces/OmegaTensorPower.lean b/LeanPool/RegtsSevenster/RS/Classical/Interfaces/OmegaTensorPower.lean index 23f8bf0516..24d0b2de9a 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Interfaces/OmegaTensorPower.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Interfaces/OmegaTensorPower.lean @@ -38,7 +38,7 @@ This file builds the chain: by `omegaPow`. -/ -@[expose] public section +public section noncomputable section @@ -143,6 +143,7 @@ theorem omegaPow_hom_inv : /-- **The iterated tensorator**: the `n`-th monoidal power of the strand image is isomorphic to `ω.obj (SkeinObj.mk n)`, built by iterating the tensorator `μ`/`δ`. -/ +@[expose] noncomputable def omegaPow (n : ℕ) : superPow (strandImage f P) n ≅ P.ω.obj (SkeinObj.mk n) where hom := omegaPowHom f P n @@ -155,6 +156,7 @@ noncomputable def omegaPow (n : ℕ) : /-- Conjugation of an endomorphism by an isomorphism: `e.hom ≫ f ≫ e.inv`, transporting `f : End Y` to `End X` via `e : X ≅ Y`. -/ +@[expose] def isoConj {C : Type*} [Category C] {X Y : C} (e : X ≅ Y) (f : End Y) : End X := e.hom ≫ f ≫ e.inv diff --git a/LeanPool/RegtsSevenster/RS/Classical/Interfaces/SchurPackage.lean b/LeanPool/RegtsSevenster/RS/Classical/Interfaces/SchurPackage.lean index a4e843f1fe..1043d70ce1 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Interfaces/SchurPackage.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Interfaces/SchurPackage.lean @@ -34,7 +34,7 @@ constructed from mathlib's linear algebra as `RS.schurPackage` in `RS/Classical/SchurTheory/Package.lean`. -/ -@[expose] public section +public section namespace RS @@ -49,6 +49,7 @@ abbrev SymGroupAlgebra (n : ℕ) : Type := /-- Extension of scalars of the group algebra along the standard embedding `S_m ↪ S_n` (permutations extended by the identity), for `m ≤ n`. -/ +@[expose] noncomputable def symCast {m n : ℕ} (h : m ≤ n) : SymGroupAlgebra m →ₐ[ℂ] SymGroupAlgebra n := MonoidAlgebra.mapDomainAlgHom ℂ ℂ @@ -56,6 +57,7 @@ noncomputable def symCast {m n : ℕ} (h : m ≤ n) : /-- The group-algebra element `(d / n!) • ∑ π, χ π • π` attached to a prospective dimension `d` and character `χ`. -/ +@[expose] noncomputable def charIdempotent {n : ℕ} (d : ℕ) (χ : Perm (Fin n) → ℂ) : SymGroupAlgebra n := ((d : ℂ) / (n.factorial : ℂ)) • @@ -120,7 +122,7 @@ structure SchurPackage where namespace SchurPackage /-- The central idempotent of shape `μ`. -/ -noncomputable def e (P : SchurPackage) (μ : YoungDiagram) : +@[expose] noncomputable def e (P : SchurPackage) (μ : YoungDiagram) : SymGroupAlgebra μ.card := charIdempotent (P.dim μ) (P.char μ) diff --git a/LeanPool/RegtsSevenster/RS/Classical/Interfaces/SectorDischarge.lean b/LeanPool/RegtsSevenster/RS/Classical/Interfaces/SectorDischarge.lean index ad7794212e..7c40f1578b 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Interfaces/SectorDischarge.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Interfaces/SectorDischarge.lean @@ -32,7 +32,7 @@ standard-model extraction `(e, e')`, then feeds the sector traces * `squareSectorBound_of_detPos` — the last gap of the quantitative theorem. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/RegtsSevenster/RS/Classical/Interfaces/SectorIntertwine.lean b/LeanPool/RegtsSevenster/RS/Classical/Interfaces/SectorIntertwine.lean index 98b6f8b798..d7e25b9030 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Interfaces/SectorIntertwine.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Interfaces/SectorIntertwine.lean @@ -51,7 +51,7 @@ follows from `superPermAction_zero_imp_evenPermRep_zero` in `KoszulAction.lean`. -/ -@[expose] public section +public section noncomputable section @@ -64,6 +64,7 @@ open Finset MonoidAlgebra /-! ## All-even colourings -/ /-- The all-even colouring: every position gets an even colour. -/ +@[expose] def allEvenEmb (k ℓ n : ℕ) (f : Fin n → Fin k) : MixedColouring k ℓ n := fun i => Sum.inl (f i) @@ -261,6 +262,7 @@ theorem evenSectorTr_perm (k ℓ n : ℕ) (σ : Equiv.Perm (Fin n)) : /-! ## All-odd colourings (even-n case) -/ /-- The all-odd colouring: every position gets an odd colour. -/ +@[expose] def allOddEmb (k ℓ n : ℕ) (g : Fin n → Fin (2 * ℓ)) : MixedColouring k ℓ n := fun i => Sum.inr (g i) diff --git a/LeanPool/RegtsSevenster/RS/Classical/Interfaces/TotalDimension.lean b/LeanPool/RegtsSevenster/RS/Classical/Interfaces/TotalDimension.lean index cd2023f3bf..dad5b74b00 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Interfaces/TotalDimension.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Interfaces/TotalDimension.lean @@ -23,7 +23,7 @@ block faithfulness therefore bounds `(k + 2 * ℓ) ^ n` by `R ^ n` times a fixed polynomial, forcing `k + 2 * ℓ ≤ R`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/BlockKill.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/BlockKill.lean index 1ec785c12e..733bce1404 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/BlockKill.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/BlockKill.lean @@ -16,7 +16,7 @@ intertwiners commute with the whole algebra action, so annihilation transports along equivalences of representations. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/BranchTrace.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/BranchTrace.lean index e02fff86aa..db02e4c5c2 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/BranchTrace.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/BranchTrace.lean @@ -18,7 +18,7 @@ identity, and compute the trace of the cast idempotent as the pairing. -/ -@[expose] public section +public section namespace RS @@ -26,6 +26,7 @@ open Finset open scoped Classical in /-- The mixed restriction pairing. -/ +@[expose] noncomputable def restrPairing (lam mu : YoungDiagram) (h : lam.card ≤ mu.card) : ℂ := ∑ σ : Equiv.Perm (Fin lam.card), diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/CentralElem.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/CentralElem.lean index bbe2e40884..61af2d2650 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/CentralElem.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/CentralElem.lean @@ -16,7 +16,7 @@ coefficient function is central — pure coefficient algebra, no representation theory. -/ -@[expose] public section +public section namespace RS @@ -26,6 +26,7 @@ variable {G : Type*} /-- The group-algebra element attached to a coefficient function. -/ +@[expose] noncomputable def classElem [Group G] [Fintype G] (c : G → ℂ) : MonoidAlgebra ℂ G := ∑ g : G, c g • MonoidAlgebra.single g 1 diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/CharClass.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/CharClass.lean index 0f0c3dd752..164daf9720 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/CharClass.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/CharClass.lean @@ -17,7 +17,7 @@ under inversion (a permutation is conjugate to its inverse, having the same cycle type). -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/CharDecomp.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/CharDecomp.lean index 44f2d8618d..d6c3630d81 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/CharDecomp.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/CharDecomp.lean @@ -17,7 +17,7 @@ decomposes as a sum of native characters `nChar S g` for simple submodules `S` of the regular module. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/CharEquiv.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/CharEquiv.lean index 0ddba300d7..609cb01034 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/CharEquiv.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/CharEquiv.lean @@ -17,7 +17,7 @@ group element. The corollary specialises this to the native submodule representations `rhoS`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/ColourCycleSum.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/ColourCycleSum.lean index 9fd5a5c03c..1bd4d1065e 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/ColourCycleSum.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/ColourCycleSum.lean @@ -19,7 +19,7 @@ and the Frobenius formula for the Jacobi–Trudi character hold unconditionally. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/ColourWeight.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/ColourWeight.lean index dcd061ee0f..74e15ae7b6 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/ColourWeight.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/ColourWeight.lean @@ -20,7 +20,7 @@ weighted permutation sum as a sum of stabilizer weights over the class. -/ -@[expose] public section +public section namespace RS @@ -103,6 +103,7 @@ theorem card_colourClass (α : Fin N → ℕ) open scoped Classical in /-- The permutation character of the colour class `α`: the number of colourings with fibre sizes `α` fixed by `π`. -/ +@[expose] noncomputable def colourChar (α : Fin N → ℕ) (π : Equiv.Perm (Fin n)) : ℕ := (Finset.univ.filter diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/CommutantBound.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/CommutantBound.lean index 4fc5c32d8a..bd4f4fab15 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/CommutantBound.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/CommutantBound.lean @@ -19,7 +19,7 @@ faithfulness, and the commutant dimension bounds the number of simple summands, counted with multiplicity. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/ContentCount.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/ContentCount.lean index 6d10ba8996..7c8b41cc9d 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/ContentCount.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/ContentCount.lean @@ -18,7 +18,7 @@ and uses an orbit-stabilizer argument. The stabiliser count enters as a hypothesis, discharged as `card_fixing_perms` in `StabCount.lean`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/CycleFactor.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/CycleFactor.lean index 9373d9a82b..537e187e35 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/CycleFactor.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/CycleFactor.lean @@ -17,7 +17,7 @@ each orbit is coloured uniformly, contributing a power sum in its size. -/ -@[expose] public section +public section namespace RS @@ -26,6 +26,7 @@ open Finset Equiv Equiv.Perm /-- The completed cycle-type product of a prospective power-sum sequence: the product over the full cycle type, fixed points included. -/ +@[expose] noncomputable def cycleProd (t : ℕ → ℂ) {n : ℕ} (π : Equiv.Perm (Fin n)) : ℂ := (π.cycleType.map t).prod * t 1 ^ (n - π.cycleType.sum) diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/CycleSum.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/CycleSum.lean index 6a240419ab..ce954dc27e 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/CycleSum.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/CycleSum.lean @@ -19,7 +19,7 @@ cycle-type product in the power sums of the colours; summed over the symmetric group this yields `n! · h_n`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/CycleSumPrep.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/CycleSumPrep.lean index 18683ffb95..4f8010e8e2 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/CycleSumPrep.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/CycleSumPrep.lean @@ -17,7 +17,7 @@ cycle-sum identity from realized power sums to arbitrary prospective ones. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/EndSum.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/EndSum.lean index 320684ff40..69c539a14d 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/EndSum.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/EndSum.lean @@ -17,7 +17,7 @@ generates the full endomorphism algebra in the sense that it can be `U i`, `W i` such that `∑ i, U i * A * W i = 1`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/FibreCard.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/FibreCard.lean index 1e37699367..d2f4c42c0b 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/FibreCard.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/FibreCard.lean @@ -15,7 +15,7 @@ Shared definitions for the cycle sums: the fibre counts of a function `Fin n → Fin N` and its content multiset. -/ -@[expose] public section +public section namespace RS @@ -24,11 +24,13 @@ open Finset variable {n N : ℕ} /-- The size of the fibre of a colouring over a colour. -/ +@[expose] noncomputable def fibreCard (f : Fin n → Fin N) (j : Fin N) : ℕ := by classical exact (Finset.univ.filter (fun i => f i = j)).card /-- The content of a colouring: the multiset of its values. -/ +@[expose] def content (f : Fin n → Fin N) : Sym (Fin N) n := ⟨Finset.univ.val.map f, by rw [Multiset.card_map] diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/FixWeight.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/FixWeight.lean index 01552e6181..01368fa59d 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/FixWeight.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/FixWeight.lean @@ -21,7 +21,7 @@ additivity over `sigmaCongrRight`) enter as explicit hypotheses, discharged in `ColourCycleSum.lean`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/HVal.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/HVal.lean index 1df76e74e7..60e6c2336c 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/HVal.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/HVal.lean @@ -25,7 +25,7 @@ unit of multiplicity. Consequently `hVal x` satisfies the defining recursion of `newtonH (pVal x)`. -/ -@[expose] public section +public section namespace RS @@ -34,11 +34,13 @@ open Finset variable {N : ℕ} /-- The power sum of exponent `c` of a finite family. -/ +@[expose] noncomputable def pVal (x : Fin N → ℂ) (c : ℕ) : ℂ := ∑ j : Fin N, x j ^ c /-- The complete homogeneous value of degree `k` of a finite family: the sum of the products of all size-`k` multisets. -/ +@[expose] noncomputable def hVal (x : Fin N → ℂ) (k : ℕ) : ℂ := ∑ s : Sym (Fin N) k, (s.1.map x).prod diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/IdempotentBridge.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/IdempotentBridge.lean index 962f609d8a..67383edaa3 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/IdempotentBridge.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/IdempotentBridge.lean @@ -18,7 +18,7 @@ normalizations agree, identifying `charIdempotent (nDim S) (nChar S)` with `nProjector S` over the symmetric group. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/JTChar.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/JTChar.lean index 40fdf19a90..7b244ae0a8 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/JTChar.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/JTChar.lean @@ -22,7 +22,7 @@ cycle sum. The two cycle-type transport facts enter as explicit hypotheses, discharged in `ColourCycleSum.lean`. -/ -@[expose] public section +public section namespace RS @@ -35,6 +35,7 @@ private theorem list_sum_eq_fin_sum (l : List ℕ) : rw [List.sum_ofFn] /-- The signed Jacobi–Trudi degree of row `i` under `σ`. -/ +@[expose] def jtSigned (μ : YoungDiagram) (σ : Equiv.Perm (Fin μ.rowLens.length)) (i : Fin μ.rowLens.length) : ℤ := @@ -56,6 +57,7 @@ theorem sum_jtSigned (μ : YoungDiagram) /-- The shifted composition attached to a Leibniz term, when nonnegative. -/ +@[expose] def jtComp (μ : YoungDiagram) (σ : Equiv.Perm (Fin μ.rowLens.length)) (i : Fin μ.rowLens.length) : ℕ := @@ -77,6 +79,7 @@ theorem sum_jtComp (μ : YoungDiagram) open scoped Classical in /-- **The Jacobi–Trudi virtual character** of shape `μ`. -/ +@[expose] noncomputable def jtChar (μ : YoungDiagram) (π : Equiv.Perm (Fin μ.card)) : ℂ := ∑ σ : Equiv.Perm (Fin μ.rowLens.length), diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/JTIntChar.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/JTIntChar.lean index a1174cc767..a5d0739a24 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/JTIntChar.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/JTIntChar.lean @@ -19,7 +19,7 @@ sum yields `jtChar μ` as a signed combination of native characters with signs in `{±1}`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/JTIrreducible.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/JTIrreducible.lean index adde1ee38a..b405b0afd4 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/JTIrreducible.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/JTIrreducible.lean @@ -20,7 +20,7 @@ squares over the classes, and conclude a unique class with coefficient `±1`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/JTOrtho.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/JTOrtho.lean index eff762f6c1..937a80cc77 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/JTOrtho.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/JTOrtho.lean @@ -19,7 +19,7 @@ product of the symmetric group, which is what makes them the irreducible characters. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/JTPad.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/JTPad.lean index 1a29de4385..c425e742b5 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/JTPad.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/JTPad.lean @@ -17,7 +17,7 @@ extra permutation index beyond the diagram's row count contributes zero weight, because the guard forces it to be fixed. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/JTSimple.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/JTSimple.lean index b3ebda5bac..76c42768a2 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/JTSimple.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/JTSimple.lean @@ -13,7 +13,7 @@ public import LeanPool.RegtsSevenster.RS.Classical.SchurTheory.JTIrreducible # The Jacobi–Trudi character is plus-or-minus a native character -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/KillSimples.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/KillSimples.lean index a1017d9912..d1d7a2d8d8 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/KillSimples.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/KillSimples.lean @@ -18,7 +18,7 @@ of elements of simples, and left multiplication kills each summand. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/MixedCount.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/MixedCount.lean index dcb2b31251..c0e15b4373 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/MixedCount.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/MixedCount.lean @@ -16,7 +16,7 @@ Expresses the colour character of a lifted permutation as a convolution over tail-content vectors. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/MixedFixed.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/MixedFixed.lean index f7a627eaa3..bb3bb1fbcd 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/MixedFixed.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/MixedFixed.lean @@ -16,7 +16,7 @@ Decomposes the subtype of colourings fixed by a lifted permutation on the first `m` coordinates and free colourings on the tail. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/NativeAction.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/NativeAction.lean index cb11fa6f3f..e61d4760b3 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/NativeAction.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/NativeAction.lean @@ -19,7 +19,7 @@ definitionally scalar multiplication, so no transparency options and no equivalence transport are needed. -/ -@[expose] public section +public section namespace RS @@ -52,6 +52,7 @@ instance [Group G] (S : Submodule (MonoidAlgebra ℂ G) (MonoidAlgebra ℂ G)) : /-- The native representation of a submodule of the regular module. -/ +@[expose] noncomputable def rhoS [Group G] (S : Submodule (MonoidAlgebra ℂ G) (MonoidAlgebra ℂ G)) : Representation ℂ G (subCarrier S) := diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/NativeFaithful.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/NativeFaithful.lean index 557d93ba90..1013eb39f0 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/NativeFaithful.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/NativeFaithful.lean @@ -20,7 +20,7 @@ generates, so an algebra map vanishing on a block element but not on the projector is impossible. -/ -@[expose] public section +public section namespace RS @@ -138,12 +138,14 @@ noncomputable abbrev natBlock [Group G] [Fintype G] LinearMap.range (mulLeft ℂ (nProjector S)) /-- The standard-coordinates equivalence of the carrier. -/ +@[expose] noncomputable def stdEquiv [Group G] [Fintype G] (S : Submodule (MonoidAlgebra ℂ G) (MonoidAlgebra ℂ G)) : subCarrier S ≃ₗ[ℂ] (Fin (nDim S) → ℂ) := (Module.finBasis ℂ (subCarrier S)).equivFun /-- The block map in standard coordinates. -/ +@[expose] noncomputable def mPsi [Group G] [Fintype G] (S : Submodule (MonoidAlgebra ℂ G) (MonoidAlgebra ℂ G)) (y : MonoidAlgebra ℂ G) : @@ -211,6 +213,7 @@ theorem mPsi_projector_eq_one [Group G] [Fintype G] rfl /-- The standard-coordinates block map on the block. -/ +@[expose] noncomputable def mPsiLin [Group G] [Fintype G] (S : Submodule (MonoidAlgebra ℂ G) (MonoidAlgebra ℂ G)) : natBlock S →ₗ[ℂ] diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/NativeTable.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/NativeTable.lean index 09d503ab55..e8a0345c8e 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/NativeTable.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/NativeTable.lean @@ -17,7 +17,7 @@ orthogonality-evaluated action table, idempotency, centrality, and the block rank. -/ -@[expose] public section +public section namespace RS @@ -26,22 +26,26 @@ open Finset LinearMap variable {G : Type*} /-- The character of a submodule of the regular module. -/ +@[expose] noncomputable def nChar [Group G] (S : Submodule (MonoidAlgebra ℂ G) (MonoidAlgebra ℂ G)) (g : G) : ℂ := (rhoS S).character g /-- The dimension of a submodule of the regular module. -/ +@[expose] noncomputable def nDim [Group G] (S : Submodule (MonoidAlgebra ℂ G) (MonoidAlgebra ℂ G)) : ℕ := Module.finrank ℂ (subCarrier S) /-- The normalized projector coefficient. -/ +@[expose] noncomputable def nCoeff [Group G] [Fintype G] (S : Submodule (MonoidAlgebra ℂ G) (MonoidAlgebra ℂ G)) : G → ℂ := fun g => ((nDim S : ℂ) / (Fintype.card G : ℂ)) * nChar S g⁻¹ /-- The normalized projector. -/ +@[expose] noncomputable def nProjector [Group G] [Fintype G] (S : Submodule (MonoidAlgebra ℂ G) (MonoidAlgebra ℂ G)) : MonoidAlgebra ℂ G := diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/OrbitBridge.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/OrbitBridge.lean index 14e92e7658..f997528eac 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/OrbitBridge.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/OrbitBridge.lean @@ -15,7 +15,7 @@ The multiset of orbit sizes of a permutation `π : Equiv.Perm (Fin n)` equals its cycle type plus singleton fixed-point orbits. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/Package.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/Package.lean index 80180e7a13..da66dc72e8 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/Package.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/Package.lean @@ -18,12 +18,13 @@ symmetric-group representation theory consumed by the development is a theorem of this tree. -/ -@[expose] public section +public section namespace RS open scoped Classical in /-- **The Schur package.** -/ +@[expose] noncomputable def schurPackage : SchurPackage.{u} := schurPackageOf three_pow_mul_factorial_ge (fun lam mu hle h => diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/PackageAssembly.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/PackageAssembly.lean index f41505f83b..8f6f8259c9 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/PackageAssembly.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/PackageAssembly.lean @@ -19,7 +19,7 @@ The branching field and the factorial bound enter as parameters, discharged in `PairingPos.lean` and `Common/FactorialBound.lean`. -/ -@[expose] public section +public section namespace RS @@ -54,6 +54,7 @@ theorem charIdempotent_jtSimple (μ : YoungDiagram) : /-- **The Schur package**, given the branching fact and the factorial bound. -/ +@[expose] noncomputable def schurPackageOf (H3 : ∀ n : ℕ, n ^ n ≤ 3 ^ n * n.factorial) (Hbranch : ∀ (lam mu : YoungDiagram), lam ≤ mu → diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/PairChar.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/PairChar.lean index e82ca23c7b..1dc460b457 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/PairChar.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/PairChar.lean @@ -16,7 +16,7 @@ character of a pair of colourings is the product of the two characters at the same permutation. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/PairInner.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/PairInner.lean index b31385ba9e..1c7dfdea38 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/PairInner.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/PairInner.lean @@ -17,7 +17,7 @@ pair contents with those margins: Fubini, the pair stabilizer count, content grouping, and orbit–stabilizer. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/PairOrbit.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/PairOrbit.lean index 0240cafc15..bf158bc1ca 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/PairOrbit.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/PairOrbit.lean @@ -16,7 +16,7 @@ classes (transported along `finProdFinEquiv`), and the fibre-margin partition. -/ -@[expose] public section +public section namespace RS @@ -25,6 +25,7 @@ open Finset Equiv variable {n k : ℕ} /-- The content multiset of a pair colouring. -/ +@[expose] def pairContent (p : Fin n → Fin k × Fin k) : Multiset (Fin k × Fin k) := Finset.univ.val.map p diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/PairStab.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/PairStab.lean index 4baac7d506..2b3682900b 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/PairStab.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/PairStab.lean @@ -15,7 +15,7 @@ The stabilizer count for colourings by pairs, transported along `finProdFinEquiv` from the `Fin`-codomain machinery. -/ -@[expose] public section +public section namespace RS @@ -25,6 +25,7 @@ variable {n k : ℕ} open scoped Classical in /-- The fibre size of a pair colouring over a pair colour. -/ +@[expose] noncomputable def pairFibre (p : Fin n → Fin k × Fin k) (c : Fin k × Fin k) : ℕ := (Finset.univ.filter (fun i => p i = c)).card diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/PairTuple.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/PairTuple.lean index 684fa5f80b..82d236f610 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/PairTuple.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/PairTuple.lean @@ -15,7 +15,7 @@ The set of pair-contents with prescribed row and column margins bijects with the set of row-wise multisets with matching column margins. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/PairingPos.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/PairingPos.lean index 3340546546..8c67f82f4c 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/PairingPos.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/PairingPos.lean @@ -19,7 +19,7 @@ bridging the combinatorial Pieri chain to the representation-theoretic branching sandwich. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/PermModule.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/PermModule.lean index 0e58eb929f..fb3e0db7f6 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/PermModule.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/PermModule.lean @@ -17,7 +17,7 @@ with the inverse. The resulting `ofMulAction` representation has character equal to `colourChar α`. -/ -@[expose] public section +public section namespace RS @@ -26,6 +26,7 @@ open Finset Equiv MonoidAlgebra /-- The colour class: colourings with prescribed fibre sizes. -/ +@[expose] def colourClass (n : ℕ) {N : ℕ} (α : Fin N → ℕ) : Type := {g : Fin n → Fin N // ∀ j, fibreCard g j = α j} diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/PowerSurj.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/PowerSurj.lean index a4c93b4183..c50d91a2b4 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/PowerSurj.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/PowerSurj.lean @@ -24,7 +24,7 @@ identities are proved for genuine variable families and transferred to arbitrary prospective power sums. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/RegularTrace.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/RegularTrace.lean index b013633d69..2bde8dc27c 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/RegularTrace.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/RegularTrace.lean @@ -17,7 +17,7 @@ idempotents this computes block dimensions without any decomposition theory. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/SameCycleQuot.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/SameCycleQuot.lean index 1dc621f30e..6f6ecb27fe 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/SameCycleQuot.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/SameCycleQuot.lean @@ -19,7 +19,7 @@ cycle-sum identity: a permutation's completed cycle-type product expands as a sum over colourings of its orbits. -/ -@[expose] public section +public section namespace RS @@ -34,10 +34,12 @@ def sameCycleSetoid : Setoid (Fin n) where Equiv.Perm.SameCycle.symm, Equiv.Perm.SameCycle.trans⟩ /-- The orbit space of a permutation. -/ +@[expose] def OrbitSpace : Type := Quotient (sameCycleSetoid π) /-- The class of a point. -/ +@[expose] def orbitOf (i : Fin n) : OrbitSpace π := Quotient.mk (sameCycleSetoid π) i @@ -58,11 +60,13 @@ noncomputable instance : Fintype (OrbitSpace π) := by (Classical.decRel _) /-- The fibre of an orbit: the points lying in it. -/ +@[expose] noncomputable def orbFibre (O : OrbitSpace π) : Finset (Fin n) := by classical exact Finset.univ.filter (fun i => orbitOf π i = O) /-- The size of an orbit. -/ +@[expose] noncomputable def orbCard (O : OrbitSpace π) : ℕ := (orbFibre π O).card @@ -123,6 +127,7 @@ theorem fixed_comp_zpow {C : Type*} {f : Fin n → C} /-- Functions fixed by the permutation are exactly the functions on the orbit space. -/ +@[expose] noncomputable def fixedFunEquiv (C : Type*) : {f : Fin n → C // f ∘ π = f} ≃ (OrbitSpace π → C) where toFun f := Quotient.lift f.1 (by diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/ScalarTrace.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/ScalarTrace.lean index 2d1c69202d..c4c149646c 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/ScalarTrace.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/ScalarTrace.lean @@ -16,7 +16,7 @@ irreducible representation is determined by the character pairing: `z · dim V = ∑ g, c g · χ_ρ(g)`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/SchurAction.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/SchurAction.lean index 159e2c1ff6..900eafbe5b 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/SchurAction.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/SchurAction.lean @@ -18,7 +18,7 @@ image of a class-function element under a representation commutes with the action, so it acts as a scalar on every irreducible. -/ -@[expose] public section +public section namespace RS @@ -27,6 +27,7 @@ open Finset LinearMap variable {G V : Type*} /-- Irreducibility, spelled invariant-submodule-theoretically. -/ +@[expose] def IsIrredRep [Group G] [AddCommGroup V] [Module ℂ V] (ρ : Representation ℂ G V) : Prop := Nontrivial V ∧ diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/SigmaCycleType.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/SigmaCycleType.lean index 4a15243a4d..ee1655d435 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/SigmaCycleType.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/SigmaCycleType.lean @@ -16,7 +16,7 @@ fibres' cycle types: a fibrewise permutation moves each fibre inside itself, so its orbits are the fibres' orbits. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/SignResolve.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/SignResolve.lean index a0664de6e5..932c317f6d 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/SignResolve.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/SignResolve.lean @@ -17,7 +17,7 @@ so in the `±`-dichotomy of `jtChar_pm_simple` only the positive sign survives: the Jacobi–Trudi character IS a native character. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/SignedTensor.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/SignedTensor.lean index b6d39c604c..1b186390e1 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/SignedTensor.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/SignedTensor.lean @@ -18,7 +18,7 @@ signed Frobenius sum expressing the twisted trace in terms of Schur values at the negated sequence. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/SimpleEmbed.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/SimpleEmbed.lean index 6b60d0ac41..d1f32fb8eb 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/SimpleEmbed.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/SimpleEmbed.lean @@ -15,7 +15,7 @@ Every simple `ℂ[G]`-module is isomorphic (as a module) to a simple submodule of the regular module `MonoidAlgebra ℂ G`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/SquareGrowth.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/SquareGrowth.lean index caaf180561..9c565d7b3d 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/SquareGrowth.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/SquareGrowth.lean @@ -19,7 +19,7 @@ most `(2s)^(s²)` times it, so the dimension dominates the hypothesis `H3`, discharged in `FactorialBound.lean`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/SquareGrowthSharp.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/SquareGrowthSharp.lean index 8fe22a6ae5..790f6994f0 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/SquareGrowthSharp.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/SquareGrowthSharp.lean @@ -18,7 +18,7 @@ analytic `n ^ n ≤ e ^ n · n !` (one term of the Taylor series of displayed `2e` of the paper. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/SquareStair.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/SquareStair.lean index 7411eb4be1..160dd6725d 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/SquareStair.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/SquareStair.lean @@ -17,7 +17,7 @@ diagrams, and the elementary factorial bounds feeding the square growth estimate. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/StabCount.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/StabCount.lean index 5ee8ab95a6..21d8518132 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/StabCount.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/StabCount.lean @@ -15,7 +15,7 @@ For `f : Fin n → Fin N`, the number of permutations `π` with `f ∘ π = f` equals `∏ j, (fibreCard f j)!`. -/ -@[expose] public section +public section namespace RS @@ -39,6 +39,7 @@ def toFibrePerms (f : Fin n → Fin N) (π : Perm (Fin n)) exact ⟨fun h => key.symm.trans h, fun h => key.trans h⟩ /-- Backward: fibre permutations assemble into a global fixing permutation. -/ +@[expose] def ofFibrePerms (f : Fin n → Fin N) (σ : ∀ j : Fin N, Perm {i : Fin n // f i = j}) : Perm (Fin n) := (sigmaFiberEquiv f).permCongr (Perm.sigmaCongrRight σ) @@ -56,6 +57,7 @@ theorem ofFibrePerms_fixes (f : Fin n → Fin N) /-- The bijection between fixing permutations and families of fibre permutations. -/ +@[expose] def fixingEquiv (f : Fin n → Fin N) : {π : Perm (Fin n) // f ∘ π = f} ≃ (∀ j : Fin N, Perm {i : Fin n // f i = j}) where diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/TensorNonvanishing.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/TensorNonvanishing.lean index aed38a4f8a..8b68ea8532 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/TensorNonvanishing.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/TensorNonvanishing.lean @@ -21,7 +21,7 @@ nonzero — the even and odd sectors of the dimension-bound dichotomy. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/TensorTrace.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/TensorTrace.lean index a9e78cd99e..122ed8626c 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/TensorTrace.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/TensorTrace.lean @@ -18,7 +18,7 @@ character of the induced representation equals the completed cycle-type product at the constant sequence `fun _ => (m : ℂ)`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/WordCommutant.lean b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/WordCommutant.lean index e9b2b3cbeb..09aa1c4ed4 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/WordCommutant.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SchurTheory/WordCommutant.lean @@ -18,7 +18,7 @@ lies between zero and the word length, giving the polynomial bound `(n + 1) ^ (Fintype.card α ^ 2)`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Super/ColourAction.lean b/LeanPool/RegtsSevenster/RS/Classical/Super/ColourAction.lean index c132c9f12f..96c856c83e 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Super/ColourAction.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Super/ColourAction.lean @@ -17,7 +17,7 @@ braiding acts on the colouring model as the Koszul-signed adjacent swap, positionwise and wordwise. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Super/ColourConj.lean b/LeanPool/RegtsSevenster/RS/Classical/Super/ColourConj.lean index debd26e91f..60dbbbb749 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Super/ColourConj.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Super/ColourConj.lean @@ -18,7 +18,7 @@ step is conjugation of the whisker through `colourPowerStep`. These are the carriers of the braiding-coordinate computation. -/ -@[expose] public section +public section namespace RS @@ -27,6 +27,7 @@ open CategoryTheory MonoidalCategory variable {k ℓ : ℕ} /-- Conjugating a power endomorphism into the colouring model. -/ +@[expose] noncomputable def toColour (n : ℕ) (g : superPow (stdSuperPair k ℓ) n ⟶ superPow (stdSuperPair k ℓ) n) : colourPower k ℓ n ⟶ colourPower k ℓ n where @@ -39,6 +40,7 @@ noncomputable def toColour (n : ℕ) /-- Extending a colour-model endomorphism by one position: conjugation of the whisker through the step equivalence. -/ +@[expose] noncomputable def colourExtend (n : ℕ) (T : colourPower k ℓ n ⟶ colourPower k ℓ n) : colourPower k ℓ (n + 1) ⟶ colourPower k ℓ (n + 1) where diff --git a/LeanPool/RegtsSevenster/RS/Classical/Super/ColourConjStep.lean b/LeanPool/RegtsSevenster/RS/Classical/Super/ColourConjStep.lean index d614b0d4e1..3f573033f2 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Super/ColourConjStep.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Super/ColourConjStep.lean @@ -18,7 +18,7 @@ observing that the `tensorCongr`-conjugation of a whisker is `tensorHom` of the inner conjugation. -/ -@[expose] public section +public section open scoped TensorProduct diff --git a/LeanPool/RegtsSevenster/RS/Classical/Super/ColourConjTop.lean b/LeanPool/RegtsSevenster/RS/Classical/Super/ColourConjTop.lean index 58d0ff43c4..0f9a92f668 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Super/ColourConjTop.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Super/ColourConjTop.lean @@ -17,7 +17,7 @@ Koszul-signed adjacent swap: coordinate evaluation of the braid on the block structure, one encoding context throughout. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Super/ColourEval.lean b/LeanPool/RegtsSevenster/RS/Classical/Super/ColourEval.lean index d5c1ee1074..c8bb2ab8c6 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Super/ColourEval.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Super/ColourEval.lean @@ -16,7 +16,7 @@ the colouring of a product index splits into its two factors — the computation rules the standard super model's coordinates use. -/ -@[expose] public section +public section open scoped TensorProduct diff --git a/LeanPool/RegtsSevenster/RS/Classical/Super/ColourExtendSwap.lean b/LeanPool/RegtsSevenster/RS/Classical/Super/ColourExtendSwap.lean index f4c5f8be75..644a450a40 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Super/ColourExtendSwap.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Super/ColourExtendSwap.lean @@ -20,7 +20,7 @@ The proof is the corresponding statement for the adjacency sign (`adjSign_eq_tail`) carried through the word and its permutation. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Super/ColourFormMatch.lean b/LeanPool/RegtsSevenster/RS/Classical/Super/ColourFormMatch.lean index fb56550da6..ee2d132c05 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Super/ColourFormMatch.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Super/ColourFormMatch.lean @@ -18,7 +18,7 @@ corresponding basis vectors — the orthonormal pairing on even colours, the symplectic pairing on odd colours. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Super/ColourMerge.lean b/LeanPool/RegtsSevenster/RS/Classical/Super/ColourMerge.lean index b9e25b5d0b..2411812fa4 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Super/ColourMerge.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Super/ColourMerge.lean @@ -16,7 +16,7 @@ Coordinates of a merged even pair multiply over the halves, vanishing when the halves have odd parity. -/ -@[expose] public section +public section open scoped TensorProduct @@ -27,11 +27,13 @@ open CategoryTheory MonoidalCategory /-! ### First and second halves of a colouring -/ /-- The first half of a colouring of a sum. -/ +@[expose] def MixedColouring.firstHalf {k ℓ a b : ℕ} (c : MixedColouring k ℓ (a + b)) : MixedColouring k ℓ a := fun i => c (Fin.castAdd b i) /-- The second half of a colouring of a sum. -/ +@[expose] def MixedColouring.secondHalf {k ℓ a b : ℕ} (c : MixedColouring k ℓ (a + b)) : MixedColouring k ℓ b := fun j => c (Fin.natAdd a j) diff --git a/LeanPool/RegtsSevenster/RS/Classical/Super/ColourMergeOdd.lean b/LeanPool/RegtsSevenster/RS/Classical/Super/ColourMergeOdd.lean index adf3c6aa33..50be0c69b7 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Super/ColourMergeOdd.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Super/ColourMergeOdd.lean @@ -21,7 +21,7 @@ pure tensor, and the two parts of `colourMerge_pair_odd` are proved by one mutual induction on the second arity. -/ -@[expose] public section +public section open scoped TensorProduct diff --git a/LeanPool/RegtsSevenster/RS/Classical/Super/ColourPairing.lean b/LeanPool/RegtsSevenster/RS/Classical/Super/ColourPairing.lean index d4b5fb1af5..fea046366f 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Super/ColourPairing.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Super/ColourPairing.lean @@ -21,12 +21,13 @@ single-position form entries: `1` on matching even colours, the symplectic entry on odd colours, `0` on mixed positions. -/ -@[expose] public section +public section namespace RS /-- The single-position form entry: Kronecker on even colours, the symplectic matrix on odd colours, zero on mixed. -/ +@[expose] def colourFormEntry (k ℓ : ℕ) : (Fin k ⊕ Fin (2 * ℓ)) → (Fin k ⊕ Fin (2 * ℓ)) → ℂ | Sum.inl i, Sum.inl j => if i = j then 1 else 0 @@ -39,6 +40,7 @@ def colourFormEntry (k ℓ : ℕ) : /-- The Koszul crossing count of a colouring pair: pairs of positions `i < j` with the second argument odd at `i` and the first odd at `j`. -/ +@[expose] def koszulCrossings {k ℓ d : ℕ} (c c' : MixedColouring k ℓ d) : ℕ := (Finset.univ.filter (fun p : Fin d × Fin d => @@ -46,6 +48,7 @@ def koszulCrossings {k ℓ d : ℕ} /-- **The pinned tensor-power pairing** on colouring basis vectors. -/ +@[expose] noncomputable def betaColour {k ℓ d : ℕ} (c c' : MixedColouring k ℓ d) : ℂ := (-1 : ℂ) ^ koszulCrossings c c' * diff --git a/LeanPool/RegtsSevenster/RS/Classical/Super/ColourPairingSymm.lean b/LeanPool/RegtsSevenster/RS/Classical/Super/ColourPairingSymm.lean index a7d345f23a..d690b5043b 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Super/ColourPairingSymm.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Super/ColourPairingSymm.lean @@ -29,13 +29,14 @@ the fibre functor is applied. The lemma is kept because it is a numbered lemma of the paper. -/ -@[expose] public section +public section namespace RS namespace MixedColouring /-- Permuting a colouring by a permutation of positions. -/ +@[expose] def perm {k ℓ d : ℕ} (c : MixedColouring k ℓ d) (π : Equiv.Perm (Fin d)) : MixedColouring k ℓ d := fun i => c (π i) diff --git a/LeanPool/RegtsSevenster/RS/Classical/Super/ColourPower.lean b/LeanPool/RegtsSevenster/RS/Classical/Super/ColourPower.lean index 54b2aef2ce..8911c37586 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Super/ColourPower.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Super/ColourPower.lean @@ -23,7 +23,7 @@ meshing directly with the mixed partition function's Definition-5 sum. -/ -@[expose] public section +public section open scoped TensorProduct @@ -46,11 +46,13 @@ instance (k ℓ d : ℕ) : DecidableEq (MixedColouring k ℓ d) := inferInstanceAs (DecidableEq (Fin d → Fin k ⊕ Fin (2 * ℓ))) /-- The odd positions of a colouring. -/ +@[expose] def oddSet {k ℓ d : ℕ} (c : MixedColouring k ℓ d) : Finset (Fin d) := Finset.univ.filter (fun i => (c i).isRight) /-- A colouring is even when its odd support has even size. -/ +@[expose] def IsEven {k ℓ d : ℕ} (c : MixedColouring k ℓ d) : Prop := Even c.oddSet.card @@ -64,6 +66,7 @@ end MixedColouring /-- **The colouring model** of the `d`-th tensor power of the standard super space: functions on mixed colourings, graded by the parity of the odd support. -/ +@[expose] noncomputable def colourPower (k ℓ d : ℕ) : SuperVect where even := {c : MixedColouring k ℓ d // c.IsEven} → ℂ odd := {c : MixedColouring k ℓ d // ¬ c.IsEven} → ℂ @@ -78,6 +81,7 @@ structure SuperLinearEquiv (V W : SuperVect) where /-- The tensor product of function spaces on finite types is the function space on the product. -/ +@[expose] noncomputable def funTensorFun (ι κ : Type) [Fintype ι] [Fintype κ] : ((ι → ℂ) ⊗[ℂ] (κ → ℂ)) ≃ₗ[ℂ] (ι × κ → ℂ) := @@ -89,6 +93,7 @@ noncomputable def funTensorFun (ι κ : Type) [Fintype ι] /-- The iterated monoidal power of a super vector space, new factors on the right. -/ +@[expose] noncomputable def superPow (V : SuperVect) : ℕ → SuperVect | 0 => SuperVect.tensorUnit | d + 1 => SuperVect.tensorObj (superPow V d) V @@ -98,6 +103,7 @@ noncomputable def superPow (V : SuperVect) : ℕ → SuperVect namespace MixedColouring /-- The tail of a colouring: the first `d` positions. -/ +@[expose] def tail {k ℓ d : ℕ} (c : MixedColouring k ℓ (d + 1)) : MixedColouring k ℓ d := fun i => c i.castSucc @@ -132,6 +138,7 @@ theorem isEven_succ_right {k ℓ d : ℕ} end MixedColouring /-- Splitting a colouring at its last position. -/ +@[expose] noncomputable def colouringSplit (k ℓ d : ℕ) : MixedColouring k ℓ (d + 1) ≃ MixedColouring k ℓ d × (Fin k ⊕ Fin (2 * ℓ)) where @@ -160,6 +167,7 @@ theorem MixedColouring.isEven_split {k ℓ d : ℕ} exact c.isEven_succ_right b h /-- A subtype of a product by a condition on the first factor. -/ +@[expose] def subtypeProdFst {A X : Type} (Q : A → Prop) : {p : A × X // Q p.1} ≃ {a : A // Q a} × X where toFun p := (⟨p.val.1, p.prop⟩, p.val.2) @@ -170,6 +178,7 @@ def subtypeProdFst {A X : Type} (Q : A → Prop) : /-- The even colourings of `d + 1` positions split by the last colour: an even colour on an even tail, or an odd colour on an odd tail. -/ +@[expose] noncomputable def evenSplitEquiv (k ℓ d : ℕ) : {c : MixedColouring k ℓ (d + 1) // c.IsEven} ≃ ({c : MixedColouring k ℓ d // c.IsEven} × Fin k) ⊕ @@ -200,6 +209,7 @@ noncomputable def evenSplitEquiv (k ℓ d : ℕ) : /-- The odd colourings of `d + 1` positions split by the last colour: an even colour on an odd tail, or an odd colour on an even tail. -/ +@[expose] noncomputable def oddSplitEquiv (k ℓ d : ℕ) : {c : MixedColouring k ℓ (d + 1) // ¬ c.IsEven} ≃ ({c : MixedColouring k ℓ d // ¬ c.IsEven} × Fin k) ⊕ @@ -238,16 +248,19 @@ noncomputable def oddSplitEquiv (k ℓ d : ℕ) : namespace SuperLinearEquiv /-- The identity super linear equivalence. -/ +@[expose] noncomputable def refl (V : SuperVect) : SuperLinearEquiv V V := ⟨LinearEquiv.refl ℂ _, LinearEquiv.refl ℂ _⟩ /-- Composition of super linear equivalences. -/ +@[expose] noncomputable def trans {U V W : SuperVect} (e : SuperLinearEquiv U V) (e' : SuperLinearEquiv V W) : SuperLinearEquiv U W := ⟨e.evenEquiv.trans e'.evenEquiv, e.oddEquiv.trans e'.oddEquiv⟩ /-- The tensor of super linear equivalences. -/ +@[expose] noncomputable def tensorCongr {V V' W W' : SuperVect} (e : SuperLinearEquiv V V') (e' : SuperLinearEquiv W W') : SuperLinearEquiv (SuperVect.tensorObj V W) @@ -280,6 +293,7 @@ instance colourZeroOddEmpty (k ℓ : ℕ) : /-- The base of the recursion: the zeroth power is the colouring model of zero positions. -/ +@[expose] noncomputable def colourPowerZero (k ℓ : ℕ) : SuperLinearEquiv SuperVect.tensorUnit (colourPower k ℓ 0) := ⟨(LinearEquiv.funUnique @@ -290,6 +304,7 @@ noncomputable def colourPowerZero (k ℓ : ℕ) : /-- The step of the recursion: tensoring the colouring model with the standard space extends the colourings by one position. -/ +@[expose] noncomputable def colourPowerStep (k ℓ d : ℕ) : SuperLinearEquiv (SuperVect.tensorObj (colourPower k ℓ d) (stdSuperPair k ℓ)) @@ -316,6 +331,7 @@ noncomputable def colourPowerStep (k ℓ d : ℕ) : /-- **The colouring model of the iterated power**: the `d`-th monoidal power of the standard super space is the colouring model. -/ +@[expose] noncomputable def colourPowerEquiv (k ℓ : ℕ) : (d : ℕ) → SuperLinearEquiv (superPow (stdSuperPair k ℓ) d) (colourPower k ℓ d) diff --git a/LeanPool/RegtsSevenster/RS/Classical/Super/ColourTotal.lean b/LeanPool/RegtsSevenster/RS/Classical/Super/ColourTotal.lean index 0a899c2dc2..026c6e2396 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Super/ColourTotal.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Super/ColourTotal.lean @@ -17,7 +17,7 @@ tensor space with all functions on colour words. The model permutation acts there by reindexing and its odd-inversion sign. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/Super/ColourWord.lean b/LeanPool/RegtsSevenster/RS/Classical/Super/ColourWord.lean index 9af087fa60..1777814b8c 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Super/ColourWord.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Super/ColourWord.lean @@ -19,7 +19,7 @@ word's Koszul sign, computed stepwise along the colouring's own trajectory. -/ -@[expose] public section +public section namespace RS @@ -28,6 +28,7 @@ open CategoryTheory variable {k ℓ : ℕ} /-- The colour-side braiding word. -/ +@[expose] noncomputable def colourSwapWord (k ℓ : ℕ) {n : ℕ} : List (Fin n) → (colourPower k ℓ (n + 1) ⟶ colourPower k ℓ (n + 1)) @@ -38,6 +39,7 @@ noncomputable def colourSwapWord (k ℓ : ℕ) {n : ℕ} : /-- The Koszul sign of a word along a colouring's trajectory: each step contributes the adjacent sign at the colouring reached so far. -/ +@[expose] def wordSign {n : ℕ} : List (Fin n) → MixedColouring k ℓ (n + 1) → ℂ | [], _ => 1 @@ -48,6 +50,7 @@ def wordSign {n : ℕ} : ⟨i.val + 1, by omega⟩) /-- The permutation of a word of adjacent swaps. -/ +@[expose] def wordPerm {n : ℕ} : List (Fin n) → _root_.Equiv.Perm (Fin (n + 1)) | [] => 1 diff --git a/LeanPool/RegtsSevenster/RS/Classical/Super/OrthonormalBasis.lean b/LeanPool/RegtsSevenster/RS/Classical/Super/OrthonormalBasis.lean index 4197d8845a..a7f432e678 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Super/OrthonormalBasis.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Super/OrthonormalBasis.lean @@ -30,7 +30,7 @@ The proof proceeds by: diagonal entries to `1`. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/RegtsSevenster/RS/Classical/Super/PowBraid.lean b/LeanPool/RegtsSevenster/RS/Classical/Super/PowBraid.lean index 581b5206c9..f9c75db00a 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Super/PowBraid.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Super/PowBraid.lean @@ -19,7 +19,7 @@ defined here; the identification is the coordinate workhorse of the extraction. -/ -@[expose] public section +public section namespace RS @@ -27,6 +27,7 @@ open CategoryTheory MonoidalCategory /-- The top adjacent braiding on a monoidal power: braid the last two factors through the associator. -/ +@[expose] noncomputable def topBraid (V : SuperVect) (m : ℕ) : superPow V (m + 2) ⟶ superPow V (m + 2) := (α_ (superPow V m) V V).hom ≫ @@ -35,6 +36,7 @@ noncomputable def topBraid (V : SuperVect) (m : ℕ) : /-- The adjacent braiding at position `i`: swap the factors at zero-based positions `i` and `i + 1`. -/ +@[expose] noncomputable def powBraid (V : SuperVect) : (n : ℕ) → (i : ℕ) → i + 2 ≤ n → (superPow V n ⟶ superPow V n) @@ -86,12 +88,14 @@ theorem MixedColouring.not_isEven_comp {k ℓ d : ℕ} /-- The Koszul sign of swapping two positions of a colouring: `−1` when both are odd. -/ +@[expose] def adjSign {k ℓ d : ℕ} (c : MixedColouring k ℓ d) (a b : Fin d) : ℂ := if (c a).isRight ∧ (c b).isRight then -1 else 1 /-- The Koszul-signed adjacent position swap on the colouring model. -/ +@[expose] noncomputable def colourSwap (k ℓ : ℕ) : (n : ℕ) → (i : ℕ) → i + 2 ≤ n → (colourPower k ℓ n ⟶ colourPower k ℓ n) := diff --git a/LeanPool/RegtsSevenster/RS/Classical/Super/SuperVect.lean b/LeanPool/RegtsSevenster/RS/Classical/Super/SuperVect.lean index 596d746dbf..104abbc7cd 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Super/SuperVect.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Super/SuperVect.lean @@ -21,7 +21,7 @@ blocks, and the braiding on the four generator shapes, including the Koszul sign on odd⊗odd. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/RegtsSevenster/RS/Classical/Super/SymplecticBasis.lean b/LeanPool/RegtsSevenster/RS/Classical/Super/SymplecticBasis.lean index f8266e3dee..3294b91de0 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Super/SymplecticBasis.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Super/SymplecticBasis.lean @@ -31,7 +31,7 @@ through `Basis.prod`, `Submodule.prodEquivOfIsCompl` and the reindexing `symplecticReindexEquiv` on `Fin (2 * ℓ)`. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/RegtsSevenster/RS/Classical/Super/TotalSpace.lean b/LeanPool/RegtsSevenster/RS/Classical/Super/TotalSpace.lean index e706254a53..62c0c88d11 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Super/TotalSpace.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Super/TotalSpace.lean @@ -16,7 +16,7 @@ components. Morphisms act componentwise, giving an algebra map on endomorphisms. -/ -@[expose] public section +public section namespace RS @@ -28,6 +28,7 @@ noncomputable section abbrev Tot (V : SuperVect) : Type := V.even × V.odd /-- The total linear map of a morphism of super vector spaces. -/ +@[expose] def tot {V W : SuperVect} (f : V ⟶ W) : Tot V →ₗ[ℂ] Tot W := LinearMap.prodMap (SuperVect.Hom.evenMap f) (SuperVect.Hom.oddMap f) @@ -63,6 +64,7 @@ theorem tot_zero (V W : SuperVect) : tot (0 : V ⟶ W) = 0 := by ext v <;> rfl /-- Forgetting the grading preserves the endomorphism algebra. -/ +@[expose] def totAlgHom (V : SuperVect) : End V →ₐ[ℂ] Module.End ℂ (Tot V) where toFun := tot map_one' := tot_id V @@ -74,6 +76,7 @@ def totAlgHom (V : SuperVect) : End V →ₐ[ℂ] Module.End ℂ (Tot V) where rw [tot_smul, tot_id] /-- A super isomorphism induces a linear equivalence of total spaces. -/ +@[expose] def totIso {V W : SuperVect} (e : V ≅ W) : Tot V ≃ₗ[ℂ] Tot W where __ := tot e.hom invFun := tot e.inv diff --git a/LeanPool/RegtsSevenster/RS/Classical/Super/WordSignPerm.lean b/LeanPool/RegtsSevenster/RS/Classical/Super/WordSignPerm.lean index f01784ab35..82cc9075c0 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/Super/WordSignPerm.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/Super/WordSignPerm.lean @@ -16,7 +16,7 @@ by identifying it as `(-1) ^ oddInversions (wordPerm w) c`, where `oddInversions σ c` counts inversions of `σ` at odd-coloured positions. -/ -@[expose] public section +public section namespace RS @@ -27,6 +27,7 @@ variable {k ℓ : ℕ} /-- Count of inversions of `σ` restricted to odd-coloured positions: pairs `(a, b)` with `a < b`, `σ a > σ b`, and both `c (σ a)` and `c (σ b)` odd-coloured. -/ +@[expose] def oddInversions {k ℓ n : ℕ} (σ : _root_.Equiv.Perm (Fin n)) (c : MixedColouring k ℓ n) : ℕ := (univ.filter (fun p : Fin n × Fin n => diff --git a/LeanPool/RegtsSevenster/RS/Classical/SymFun/AlternantExpand.lean b/LeanPool/RegtsSevenster/RS/Classical/SymFun/AlternantExpand.lean index 56a16026ba..e7a36c8f7d 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SymFun/AlternantExpand.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SymFun/AlternantExpand.lean @@ -17,7 +17,7 @@ coefficient of `w₀` in `P · a_δ` is the signed sum over permutations of the guarded shifted coefficients of `P`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SymFun/AlternantPieri.lean b/LeanPool/RegtsSevenster/RS/Classical/SymFun/AlternantPieri.lean index f192b6ec44..e53bdbea52 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SymFun/AlternantPieri.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SymFun/AlternantPieri.lean @@ -22,7 +22,7 @@ via `det_apply'`, use the per-term product identity for match termwise. -/ -@[expose] public section +public section namespace RS @@ -31,6 +31,7 @@ open Finset MvPolynomial Equiv variable {k : ℕ} /-- The plain power alternant of an exponent vector. -/ +@[expose] noncomputable def altDet {k : ℕ} (e : Fin k → ℕ) : MvPolynomial (Fin k) ℂ := (Matrix.of fun i j : Fin k => diff --git a/LeanPool/RegtsSevenster/RS/Classical/SymFun/AlternantStrict.lean b/LeanPool/RegtsSevenster/RS/Classical/SymFun/AlternantStrict.lean index 3e5f5bd735..9eddd960ca 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SymFun/AlternantStrict.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SymFun/AlternantStrict.lean @@ -17,7 +17,7 @@ is the equality indicator — the two facts driving nonnegativity in the Pieri chain. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SymFun/Bialternant.lean b/LeanPool/RegtsSevenster/RS/Classical/SymFun/Bialternant.lean index c8461c3a22..9c0eba5180 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SymFun/Bialternant.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SymFun/Bialternant.lean @@ -22,7 +22,7 @@ determinants and anchoring at `v = 0` gives the bialternant form: the polynomial Jacobi–Trudi identity `a_{v+δ} = s_v · a_δ`. -/ -@[expose] public section +public section namespace RS @@ -31,6 +31,7 @@ open Finset MvPolynomial Equiv variable {k : ℕ} /-- The alternant matrix of variable powers. -/ +@[expose] noncomputable def powMat (v : Fin k → ℕ) : Matrix (Fin k) (Fin k) (MvPolynomial (Fin k) ℂ) := Matrix.of fun i j => X j ^ (v i + ((k - 1) - (i : ℕ))) @@ -43,6 +44,7 @@ noncomputable def hMat (v : Fin k → ℕ) : /-- The Jacobi–Trudi matrix of complete homogeneous polynomials. -/ +@[expose] noncomputable def jtMat (v : Fin k → ℕ) : Matrix (Fin k) (Fin k) (MvPolynomial (Fin k) ℂ) := Matrix.of fun i j => hSubZ Finset.univ diff --git a/LeanPool/RegtsSevenster/RS/Classical/SymFun/BinomialDet.lean b/LeanPool/RegtsSevenster/RS/Classical/SymFun/BinomialDet.lean index af4248bf92..c341516d35 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SymFun/BinomialDet.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SymFun/BinomialDet.lean @@ -19,7 +19,7 @@ case is stated as `SquareBinomialDetPos` and proved by the Lindström–Gessel–Viennot argument of `LGVStrict.lean`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SymFun/BinomialH.lean b/LeanPool/RegtsSevenster/RS/Classical/SymFun/BinomialH.lean index 610d90bf38..f78509cba8 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SymFun/BinomialH.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SymFun/BinomialH.lean @@ -18,7 +18,7 @@ function `(1−z)^{−m}`); at `−m` they are the signed binomials the tensor-space traces of the dimension-bound argument. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SymFun/CoeffExtract.lean b/LeanPool/RegtsSevenster/RS/Classical/SymFun/CoeffExtract.lean index 2cf40467e2..3636313a38 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SymFun/CoeffExtract.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SymFun/CoeffExtract.lean @@ -16,7 +16,7 @@ injective exponents is `1`: distinct permutations contribute distinct monomials, and only the identity hits the diagonal. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SymFun/CoeffSplit.lean b/LeanPool/RegtsSevenster/RS/Classical/SymFun/CoeffSplit.lean index 69f8007d1d..de295866be 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SymFun/CoeffSplit.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SymFun/CoeffSplit.lean @@ -16,7 +16,7 @@ antidiagonal to guarded pointwise splits over a bounded pi-set — the shape produced by the colour-character convolution. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SymFun/DeltaSeq.lean b/LeanPool/RegtsSevenster/RS/Classical/SymFun/DeltaSeq.lean index 64b736694d..7d2a6bcd38 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SymFun/DeltaSeq.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SymFun/DeltaSeq.lean @@ -18,7 +18,7 @@ Jacobi–Trudi character degree as `n!` times the Jacobi–Trudi determinant at `t₀`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SymFun/DescVandermonde.lean b/LeanPool/RegtsSevenster/RS/Classical/SymFun/DescVandermonde.lean index 741add5359..689bb47fb4 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SymFun/DescVandermonde.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SymFun/DescVandermonde.lean @@ -21,7 +21,7 @@ the descending Pochhammer polynomials (which are monic of the correct degree) combined with `det_vandermonde`. -/ -@[expose] public section +public section open Polynomial Matrix Finset diff --git a/LeanPool/RegtsSevenster/RS/Classical/SymFun/DimFormula.lean b/LeanPool/RegtsSevenster/RS/Classical/SymFun/DimFormula.lean index 60bb291e62..ee3c65f815 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SymFun/DimFormula.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SymFun/DimFormula.lean @@ -19,13 +19,14 @@ and evaluates the determinant as a manifestly positive Vandermonde product of staircase differences. -/ -@[expose] public section +public section namespace RS open Finset /-- The staircase exponents of a diagram over its own row count. -/ +@[expose] noncomputable def eStair (μ : YoungDiagram) (i : Fin μ.rowLens.length) : ℕ := μ.rowLens.get i + ((μ.rowLens.length - 1) - (i : ℕ)) diff --git a/LeanPool/RegtsSevenster/RS/Classical/SymFun/EHConv.lean b/LeanPool/RegtsSevenster/RS/Classical/SymFun/EHConv.lean index 94808dac2f..46c206b338 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SymFun/EHConv.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SymFun/EHConv.lean @@ -19,7 +19,7 @@ add-one-variable recurrence enters as the hypothesis `HSubRec`, discharged in `HInsert.lean`. -/ -@[expose] public section +public section namespace RS @@ -44,6 +44,7 @@ theorem hSub_empty (m : ℕ) : exact absurd (hall i hi) (Finset.notMem_empty i) /-- The mixed e–h convolution with one extra variable. -/ +@[expose] noncomputable def fmix (A : Finset (Fin k)) (j : Fin k) (M : ℕ) : MvPolynomial (Fin k) ℂ := ∑ r ∈ Finset.range (M + 1), diff --git a/LeanPool/RegtsSevenster/RS/Classical/SymFun/EHDischarge.lean b/LeanPool/RegtsSevenster/RS/Classical/SymFun/EHDischarge.lean index c8cd8e51ed..3b6225b02a 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SymFun/EHDischarge.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SymFun/EHDischarge.lean @@ -18,7 +18,7 @@ so the resolvent identity and the shifted forms hold unconditionally. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SymFun/HInsert.lean b/LeanPool/RegtsSevenster/RS/Classical/SymFun/HInsert.lean index 6be2c3e6d9..c33049aeee 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SymFun/HInsert.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SymFun/HInsert.lean @@ -14,7 +14,7 @@ public import LeanPool.RegtsSevenster.RS.Classical.SymFun.SubsetEH `hSub (insert j A) (m+1) = hSub A (m+1) + X j * hSub (insert j A) m` -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SymFun/HProdCoeff.lean b/LeanPool/RegtsSevenster/RS/Classical/SymFun/HProdCoeff.lean index 0c7180702b..b76f879f69 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SymFun/HProdCoeff.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SymFun/HProdCoeff.lean @@ -16,7 +16,7 @@ The coefficient of a monomial `w` in the product symmetric-function indices whose combined weight equals `w`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SymFun/HSubZ.lean b/LeanPool/RegtsSevenster/RS/Classical/SymFun/HSubZ.lean index eefb707bd0..ce52d622c7 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SymFun/HSubZ.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SymFun/HSubZ.lean @@ -16,7 +16,7 @@ degrees, and the guarded range-`k` form of the resolvent — the entry form of the bialternant matrices. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SymFun/HookVanishing.lean b/LeanPool/RegtsSevenster/RS/Classical/SymFun/HookVanishing.lean index 705610613b..79fe3bc128 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SymFun/HookVanishing.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SymFun/HookVanishing.lean @@ -25,7 +25,7 @@ This is the composition of `exists_recurrence_of_schurDet_vanishing` of `Common/YoungDiagrams.lean`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SymFun/JTDetExpand.lean b/LeanPool/RegtsSevenster/RS/Classical/SymFun/JTDetExpand.lean index 337995f633..1f8dca2b0d 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SymFun/JTDetExpand.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SymFun/JTDetExpand.lean @@ -16,7 +16,7 @@ permutations of complete homogeneous products, with terms containing a negative degree vanishing. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SymFun/JTGuard.lean b/LeanPool/RegtsSevenster/RS/Classical/SymFun/JTGuard.lean index 6fc748222b..17e850c416 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SymFun/JTGuard.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SymFun/JTGuard.lean @@ -17,7 +17,7 @@ margins match the shifted compositions, and sorted shapes have injective staircase exponents. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SymFun/LGVStrict.lean b/LeanPool/RegtsSevenster/RS/Classical/SymFun/LGVStrict.lean index 67ea8d8371..ef07ecc9e6 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SymFun/LGVStrict.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SymFun/LGVStrict.lean @@ -24,7 +24,7 @@ noncrossing tuples all have `σ = 1` and count with sign `+1`, and at least one exists. -/ -@[expose] public section +public section diff --git a/LeanPool/RegtsSevenster/RS/Classical/SymFun/PieriChain.lean b/LeanPool/RegtsSevenster/RS/Classical/SymFun/PieriChain.lean index 14be82d871..d060fbc189 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SymFun/PieriChain.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SymFun/PieriChain.lean @@ -17,13 +17,14 @@ coefficient of the target monomial in `p₁ʳ · a_{eVec λ}` when `μ` extends `λ` by `r` cells. -/ -@[expose] public section +public section namespace RS open Finset MvPolynomial Equiv /-- The staircase exponent vector of a diagram in `k` variables. -/ +@[expose] noncomputable def eVec (nu : YoungDiagram) (k : ℕ) : Fin k → ℕ := fun i => nu.rowLen i + ((k - 1) - (i : ℕ)) diff --git a/LeanPool/RegtsSevenster/RS/Classical/SymFun/PowCount.lean b/LeanPool/RegtsSevenster/RS/Classical/SymFun/PowCount.lean index fdd04e2abb..8aea594b9a 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SymFun/PowCount.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SymFun/PowCount.lean @@ -15,7 +15,7 @@ The coefficient of a monomial `w` in `(∑ l, X l) ^ |T|` counts the number of functions `T → Fin k` whose fibre sizes match `w`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SymFun/PowerSums.lean b/LeanPool/RegtsSevenster/RS/Classical/SymFun/PowerSums.lean index c1eb4ea523..3ad6b05c0e 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SymFun/PowerSums.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SymFun/PowerSums.lean @@ -25,14 +25,14 @@ symmetric-group characters is the `frobenius` field of `SchurPackage` in `Interfaces/SchurPackage.lean`. -/ -@[expose] public section +public section namespace RS /-- The complete homogeneous sequence attached to a sequence of power sums, via the Newton recursion `(n+1) · h (n+1) = ∑_{i ≤ n} t (i+1) · h (n−i)`; `h 0 = 1`. -/ -noncomputable def newtonH (t : ℕ → ℂ) : ℕ → ℂ +@[expose] noncomputable def newtonH (t : ℕ → ℂ) : ℕ → ℂ | 0 => 1 | n + 1 => ((n : ℂ) + 1)⁻¹ * @@ -41,17 +41,19 @@ noncomputable def newtonH (t : ℕ → ℂ) : ℕ → ℂ /-- Integer-indexed extension of `newtonH`, vanishing in negative degrees — the form entering the Jacobi–Trudi determinant. -/ +@[expose] noncomputable def newtonHZ (t : ℕ → ℂ) (n : ℤ) : ℂ := if 0 ≤ n then newtonH t n.toNat else 0 /-- The Schur specialization of a row-length list `rows`, defined as the Jacobi–Trudi determinant `det (h_{rows i − i + j})_{i,j}`. -/ -noncomputable def schurDet (t : ℕ → ℂ) (rows : List ℕ) : ℂ := +@[expose] noncomputable def schurDet (t : ℕ → ℂ) (rows : List ℕ) : ℂ := Matrix.det <| Matrix.of fun i j : Fin rows.length => newtonHZ t ((rows.get i : ℤ) + (j : ℤ) - (i : ℤ)) /-- The Schur specialization of a Young diagram: `schurDet` on its row-length list. -/ +@[expose] noncomputable def diagramSchur (μ : YoungDiagram) (t : ℕ → ℂ) : ℂ := schurDet t μ.rowLens diff --git a/LeanPool/RegtsSevenster/RS/Classical/SymFun/RationalityFromRecurrence.lean b/LeanPool/RegtsSevenster/RS/Classical/SymFun/RationalityFromRecurrence.lean index d63a326ea6..85c8868365 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SymFun/RationalityFromRecurrence.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SymFun/RationalityFromRecurrence.lean @@ -23,7 +23,7 @@ pair, factors both over ℂ, and reads off the power-sum identity from the logarithmic derivative of `H = P₀/Q₀`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SymFun/RecurrenceFromVanishing.lean b/LeanPool/RegtsSevenster/RS/Classical/SymFun/RecurrenceFromVanishing.lean index 00d02a9294..bc0e87ecbd 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SymFun/RecurrenceFromVanishing.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SymFun/RecurrenceFromVanishing.lean @@ -34,7 +34,7 @@ The proof proceeds in three stages: recurrence. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SymFun/SubsetEH.lean b/LeanPool/RegtsSevenster/RS/Classical/SymFun/SubsetEH.lean index 8ec075ad4c..190f55ca6c 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SymFun/SubsetEH.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SymFun/SubsetEH.lean @@ -19,7 +19,7 @@ of the e–h convolution and the bialternant Jacobi–Trudi identity. The `hSub` recurrence is proven in `HInsert.lean`. -/ -@[expose] public section +public section namespace RS @@ -36,7 +36,7 @@ noncomputable def eSub (A : Finset (Fin k)) (r : ℕ) : open scoped Classical in /-- The complete homogeneous polynomial supported in a subset of the variables. -/ -noncomputable def hSub (A : Finset (Fin k)) (m : ℕ) : +@[expose] noncomputable def hSub (A : Finset (Fin k)) (m : ℕ) : MvPolynomial (Fin k) ℂ := ∑ w ∈ Finset.univ.filter (fun w : Sym (Fin k) m => ∀ i ∈ w.1, i ∈ A), diff --git a/LeanPool/RegtsSevenster/RS/Classical/SymFun/SuperPowerSums.lean b/LeanPool/RegtsSevenster/RS/Classical/SymFun/SuperPowerSums.lean index abf7b546c7..770ffd24b8 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SymFun/SuperPowerSums.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SymFun/SuperPowerSums.lean @@ -24,7 +24,7 @@ the shifted power-sum series; this is immediate from the Newton recursion that defines `newtonH`. -/ -@[expose] public section +public section namespace RS @@ -34,10 +34,12 @@ open Finset PowerSeries /-- The generating power series of the complete homogeneous sequence: `H = PowerSeries.mk (newtonH t)`. -/ +@[expose] noncomputable def newtonHSeries (t : ℕ → ℂ) : ℂ⟦X⟧ := PowerSeries.mk (newtonH t) /-- The shifted power-sum series: coefficient `n` is `t (n + 1)`. -/ +@[expose] noncomputable def powerSumSeries (t : ℕ → ℂ) : ℂ⟦X⟧ := PowerSeries.mk (fun n => t (n + 1)) diff --git a/LeanPool/RegtsSevenster/RS/Classical/SymFun/TCount.lean b/LeanPool/RegtsSevenster/RS/Classical/SymFun/TCount.lean index 241b0a0bba..80cbe1b223 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SymFun/TCount.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SymFun/TCount.lean @@ -17,7 +17,7 @@ bridges into the signed double-sum identity: the signed count of margin-constrained Sym-tuples over shifted compositions is `1`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SymFun/TIdentity.lean b/LeanPool/RegtsSevenster/RS/Classical/SymFun/TIdentity.lean index d1f385db88..c82b8b5245 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SymFun/TIdentity.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SymFun/TIdentity.lean @@ -18,7 +18,7 @@ products equals `1`. This is the polynomial form of the orthonormality `⟨χ_μ, χ_μ⟩ = 1`. -/ -@[expose] public section +public section namespace RS @@ -27,6 +27,7 @@ open Finset MvPolynomial Equiv variable {k : ℕ} /-- The diagonal staircase exponent of a shape. -/ +@[expose] noncomputable def diagExp (v : Fin k → ℕ) : Fin k →₀ ℕ := ∑ i, Finsupp.single i (v i + ((k - 1) - (i : ℕ))) diff --git a/LeanPool/RegtsSevenster/RS/Classical/SymFun/ZetaExp.lean b/LeanPool/RegtsSevenster/RS/Classical/SymFun/ZetaExp.lean index e3ad408657..880e4c81d6 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SymFun/ZetaExp.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SymFun/ZetaExp.lean @@ -17,7 +17,7 @@ via the differential characterization — the displayed form of the trace zeta function. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SymFun/ZetaRational.lean b/LeanPool/RegtsSevenster/RS/Classical/SymFun/ZetaRational.lean index fd34605a23..9a3d2a5fea 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SymFun/ZetaRational.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SymFun/ZetaRational.lean @@ -19,7 +19,7 @@ which is the form the trace zeta function is read in, and the recurrence itself is supplied by hook vanishing. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Classical/SymFun/ZetaSeries.lean b/LeanPool/RegtsSevenster/RS/Classical/SymFun/ZetaSeries.lean index 3445495454..b29a1d6967 100644 --- a/LeanPool/RegtsSevenster/RS/Classical/SymFun/ZetaSeries.lean +++ b/LeanPool/RegtsSevenster/RS/Classical/SymFun/ZetaSeries.lean @@ -19,7 +19,7 @@ for formal power series over ℂ and applies it to characterize the Newton series. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Common/DiagramChain.lean b/LeanPool/RegtsSevenster/RS/Common/DiagramChain.lean index 09b61ef8c9..aa86a39b3a 100644 --- a/LeanPool/RegtsSevenster/RS/Common/DiagramChain.lean +++ b/LeanPool/RegtsSevenster/RS/Common/DiagramChain.lean @@ -17,7 +17,7 @@ cell in `mu.cells \ lam.cells` that is minimal for the sum of coordinates, then insert it into `lam`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Common/ExponentialGrowth.lean b/LeanPool/RegtsSevenster/RS/Common/ExponentialGrowth.lean index c555274d77..8fc934f9fe 100644 --- a/LeanPool/RegtsSevenster/RS/Common/ExponentialGrowth.lean +++ b/LeanPool/RegtsSevenster/RS/Common/ExponentialGrowth.lean @@ -15,7 +15,7 @@ A fixed polynomial factor cannot compensate for a larger exponential base. This form applies directly to tensor-dimension estimates. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Common/FactorialBound.lean b/LeanPool/RegtsSevenster/RS/Common/FactorialBound.lean index aa37707669..9c28a695b5 100644 --- a/LeanPool/RegtsSevenster/RS/Common/FactorialBound.lean +++ b/LeanPool/RegtsSevenster/RS/Common/FactorialBound.lean @@ -29,7 +29,7 @@ which the `⌊2eR⌋` threshold does need, is `RS/Classical/SchurTheory/SquareGrowthSharp.lean`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Common/FinSlots.lean b/LeanPool/RegtsSevenster/RS/Common/FinSlots.lean index d748e16820..97a2e18a1d 100644 --- a/LeanPool/RegtsSevenster/RS/Common/FinSlots.lean +++ b/LeanPool/RegtsSevenster/RS/Common/FinSlots.lean @@ -15,7 +15,7 @@ The two inclusions of an index into the doubled finite set have distinct values. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Common/ListAttach.lean b/LeanPool/RegtsSevenster/RS/Common/ListAttach.lean index 52af24efd8..f5bbb367e6 100644 --- a/LeanPool/RegtsSevenster/RS/Common/ListAttach.lean +++ b/LeanPool/RegtsSevenster/RS/Common/ListAttach.lean @@ -18,7 +18,7 @@ list product is the finset product of the finset the list enumerates. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Common/ListPairs.lean b/LeanPool/RegtsSevenster/RS/Common/ListPairs.lean index b7f8091d6c..1c36426018 100644 --- a/LeanPool/RegtsSevenster/RS/Common/ListPairs.lean +++ b/LeanPool/RegtsSevenster/RS/Common/ListPairs.lean @@ -15,7 +15,7 @@ Flattening a list of two-element blocks doubles its length and places the two components at the even and odd positions. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Common/ListSign.lean b/LeanPool/RegtsSevenster/RS/Common/ListSign.lean index 8e8877aa13..cdf13f9237 100644 --- a/LeanPool/RegtsSevenster/RS/Common/ListSign.lean +++ b/LeanPool/RegtsSevenster/RS/Common/ListSign.lean @@ -18,7 +18,7 @@ combinatorial engine of the alternating evaluation of mixed vertex functionals. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Common/NilpotentMap.lean b/LeanPool/RegtsSevenster/RS/Common/NilpotentMap.lean index 8c4bee16ef..6015a49c8d 100644 --- a/LeanPool/RegtsSevenster/RS/Common/NilpotentMap.lean +++ b/LeanPool/RegtsSevenster/RS/Common/NilpotentMap.lean @@ -15,7 +15,7 @@ A positive vanishing exponent transports through a multiplicative map even when that map does not preserve the identity. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Common/NilpotentPowerTrace.lean b/LeanPool/RegtsSevenster/RS/Common/NilpotentPowerTrace.lean index 3e11ae9976..7812e61e29 100644 --- a/LeanPool/RegtsSevenster/RS/Common/NilpotentPowerTrace.lean +++ b/LeanPool/RegtsSevenster/RS/Common/NilpotentPowerTrace.lean @@ -18,7 +18,7 @@ factorial-rank proof of nilpotent-trace vanishing (arXiv:1211.3561, Proposition 4). -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Common/PairDisjoint.lean b/LeanPool/RegtsSevenster/RS/Common/PairDisjoint.lean index e9163df9c7..f4bc68f403 100644 --- a/LeanPool/RegtsSevenster/RS/Common/PairDisjoint.lean +++ b/LeanPool/RegtsSevenster/RS/Common/PairDisjoint.lean @@ -20,7 +20,7 @@ fields, so that the four inequalities are never read off a nested conjunction by position. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Common/PermCongr.lean b/LeanPool/RegtsSevenster/RS/Common/PermCongr.lean index 13db12575c..88c4a2a5cb 100644 --- a/LeanPool/RegtsSevenster/RS/Common/PermCongr.lean +++ b/LeanPool/RegtsSevenster/RS/Common/PermCongr.lean @@ -22,7 +22,7 @@ the sum of the two cycle types and the sum of the two fixed-point counts. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Common/PermTopSplit.lean b/LeanPool/RegtsSevenster/RS/Common/PermTopSplit.lean index 774339a822..05c2a7c060 100644 --- a/LeanPool/RegtsSevenster/RS/Common/PermTopSplit.lean +++ b/LeanPool/RegtsSevenster/RS/Common/PermTopSplit.lean @@ -23,7 +23,7 @@ induced permutation is not the one a tensor power's factors see. The compression here is `finSuccAboveEquiv`. -/ -@[expose] public section +public section namespace RS @@ -32,6 +32,7 @@ open Equiv variable {n : ℕ} /-- Where a permutation sends the top slot. -/ +@[expose] def topImage (σ : Perm (Fin (n + 1))) : Fin (n + 1) := σ (Fin.last n) /-- The identity leaves the top slot alone. -/ @@ -330,6 +331,7 @@ targets they consume. Everything below them is untouched. -/ /-- The transposition of the top two slots. -/ +@[expose] noncomputable def topSwap : Perm (Fin (n + 2)) := Equiv.swap (Fin.castSucc (Fin.last n)) (Fin.last (n + 1)) diff --git a/LeanPool/RegtsSevenster/RS/Common/ProdSum.lean b/LeanPool/RegtsSevenster/RS/Common/ProdSum.lean index eb390a586a..70fc127436 100644 --- a/LeanPool/RegtsSevenster/RS/Common/ProdSum.lean +++ b/LeanPool/RegtsSevenster/RS/Common/ProdSum.lean @@ -22,7 +22,7 @@ live here rather than beside their first user because two files need them. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Common/RowLenChain.lean b/LeanPool/RegtsSevenster/RS/Common/RowLenChain.lean index 73d2864ed0..b894cb1555 100644 --- a/LeanPool/RegtsSevenster/RS/Common/RowLenChain.lean +++ b/LeanPool/RegtsSevenster/RS/Common/RowLenChain.lean @@ -15,7 +15,7 @@ A diagram extending another by a single cell bumps exactly one row length by one; row lengths are monotone in diagram containment. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Common/RowSpanRank.lean b/LeanPool/RegtsSevenster/RS/Common/RowSpanRank.lean index 7c3b23693d..b2af31707d 100644 --- a/LeanPool/RegtsSevenster/RS/Common/RowSpanRank.lean +++ b/LeanPool/RegtsSevenster/RS/Common/RowSpanRank.lean @@ -29,7 +29,7 @@ on `κ` is separated by finitely many coordinates infinite matrix visible on a single finite submatrix. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Common/TraceSeparation.lean b/LeanPool/RegtsSevenster/RS/Common/TraceSeparation.lean index adc7d3ce79..3171e0de73 100644 --- a/LeanPool/RegtsSevenster/RS/Common/TraceSeparation.lean +++ b/LeanPool/RegtsSevenster/RS/Common/TraceSeparation.lean @@ -17,7 +17,7 @@ separates the represented elements. Its translates give dual functionals, so the group elements are linearly independent. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Common/YoungDiagrams.lean b/LeanPool/RegtsSevenster/RS/Common/YoungDiagrams.lean index 0203c16dab..01e052e8fa 100644 --- a/LeanPool/RegtsSevenster/RS/Common/YoungDiagrams.lean +++ b/LeanPool/RegtsSevenster/RS/Common/YoungDiagrams.lean @@ -18,7 +18,7 @@ square diagram is the shape whose dimension growth drives that confinement. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Definitions.lean b/LeanPool/RegtsSevenster/RS/Definitions.lean index ff00577d58..625c20cf3e 100644 --- a/LeanPool/RegtsSevenster/RS/Definitions.lean +++ b/LeanPool/RegtsSevenster/RS/Definitions.lean @@ -38,7 +38,7 @@ pairings and the edge-rank hypothesis; Eulerian edge subsets; the mixed partition function; the named statements; super vector spaces; the vocabulary of Deligne's hypotheses; and Deligne's theorem. -/ -@[expose] public section +public section namespace RS @@ -49,12 +49,14 @@ Definition 5: reordering the odd colours multiplies the vertex value by the sign of the permutation, realized as `(−1)` to the inversion count. -/ /-- The number of inversions of a list over a linear order. -/ +@[expose] def inversions {α : Type} [LinearOrder α] : List α → ℕ | [] => 0 | a :: l => (l.filter (fun b => b < a)).length + inversions l /-- The sorting sign of a list: `(−1)` to the number of inversions. -/ +@[expose] def sortSign {α : Type} [LinearOrder α] (l : List α) : ℤ := (-1) ^ inversions l @@ -125,6 +127,7 @@ theorem pairing_boundaryFlag_comm (W : Fragment α) {i j : α} /-- The closed fragment with no flags, no vertices, and a given number of free circles. -/ +@[expose] def circlesOnly (c : ℕ) : Fragment Empty where Flag := Empty Vertex := Empty @@ -138,6 +141,7 @@ def circlesOnly (c : ℕ) : Fragment Empty where circles := c /-- Transport a fragment along an equivalence of label types. -/ +@[expose] def relabel (W : Fragment α) (e : α ≃ β) : Fragment β where Flag := W.Flag Vertex := W.Vertex @@ -158,6 +162,7 @@ def relabel (W : Fragment α) (e : α ≃ β) : Fragment β where circles := W.circles /-- Disjoint union of fragments, over the sum of the label types. -/ +@[expose] def disjUnion (W₁ : Fragment α) (W₂ : Fragment β) : Fragment (α ⊕ β) where Flag := W₁.Flag ⊕ W₂.Flag @@ -223,6 +228,7 @@ theorem survivingFlag_attach_ne {W : Fragment α} {i j : α} which is supplied together with the equation identifying it. Taking the value as a parameter is what lets every proof below reason by cases on it, so `glueAttach` itself is never unfolded. -/ +@[expose] def glueAttachOn (W : Fragment α) (i j : α) (f : SurvivingFlag W i j) : ∀ s : W.Vertex ⊕ α, W.attach f.val = s → W.Vertex ⊕ SurvivingLabel α i j @@ -233,6 +239,7 @@ def glueAttachOn (W : Fragment α) (i j : α) (f : SurvivingFlag W i j) : /-- The attachment map after gluing at `{i, j}`: unchanged, with the label type restricted to the surviving labels. -/ +@[expose] def glueAttach (W : Fragment α) (i j : α) (f : SurvivingFlag W i j) : W.Vertex ⊕ SurvivingLabel α i j := glueAttachOn W i j f (W.attach f.val) rfl @@ -259,6 +266,7 @@ variable {W : Fragment α} {i j : α} /-- The rewired pairing for an *open* glue (the two glued flags do not bound a common edge): the far ends of the two glued edges become partners; all other flags keep their partners. -/ +@[expose] def rewire (hopen : W.pairing (W.boundaryFlag i) ≠ W.boundaryFlag j) (f : SurvivingFlag W i j) : SurvivingFlag W i j := if hfi : W.pairing f.val = W.boundaryFlag i then @@ -337,6 +345,7 @@ section Glue variable (W : Fragment α) (i j : α) /-- The boundary flag of a surviving label survives the glue. -/ +@[expose] def glueBoundaryFlag (ℓ : SurvivingLabel α i j) : SurvivingFlag W i j := ⟨W.boundaryFlag ℓ.val, fun h => ℓ.prop.1 (W.boundaryFlag_injective h), @@ -424,6 +433,7 @@ are determined by `W` alone; only the pairing and the circle count tell the closed and open glues apart. Naming that common part gives the two glues a single shape, so any fact about a glue that does not mention its pairing is proved once. -/ +@[expose] def glueWith (p : SurvivingFlag W i j → SurvivingFlag W i j) (hinvol : ∀ f, p (p f) = f) (hne : ∀ f, p f ≠ f) (c : ℕ) : Fragment (SurvivingLabel α i j) where @@ -440,6 +450,7 @@ def glueWith (p : SurvivingFlag W i j → SurvivingFlag W i j) /-- Gluing the boundary labels `i ≠ j` when their flags bound a common edge: the edge closes into a free circle. -/ +@[expose] def gluePairClosed (hclosed : W.pairing (W.boundaryFlag i) = W.boundaryFlag j) : Fragment (SurvivingLabel α i j) := glueWith W i j @@ -455,6 +466,7 @@ def gluePairClosed (hclosed : W.pairing (W.boundaryFlag i) = W.boundaryFlag j) : /-- Gluing the boundary labels `i ≠ j` when their flags bound distinct edges: the two edges are unified by rewiring. -/ +@[expose] def gluePairOpen (hij : i ≠ j) (hopen : W.pairing (W.boundaryFlag i) ≠ W.boundaryFlag j) : Fragment (SurvivingLabel α i j) := @@ -464,6 +476,7 @@ def gluePairOpen (hij : i ≠ j) /-- Gluing a pair of distinct boundary labels: the two half-edges at `i` and `j` are joined. If they bound a common edge it closes into a free circle; otherwise their edges are unified end to end. -/ +@[expose] def gluePair (hij : i ≠ j) : Fragment (SurvivingLabel α i j) := if hclosed : W.pairing (W.boundaryFlag i) = W.boundaryFlag j then gluePairClosed W i j hclosed @@ -508,6 +521,7 @@ of `Fin` indices. Composition is what the connection pairing evaluates. -/ /-! ### Removing a point -/ /-- Removing one point from `Fin (n + 1)` leaves `Fin n`. -/ +@[expose] noncomputable def finRemoveEquiv {n : ℕ} (a : Fin (n + 1)) : {x : Fin (n + 1) // x ≠ a} ≃ Fin n where toFun x := ((finSuccEquiv' a) x.val).get (by @@ -525,6 +539,7 @@ noncomputable def finRemoveEquiv {n : ℕ} (a : Fin (n + 1)) : /-- Removing `inl a` and `inr b` from a sum splits into the two one-point removals. -/ +@[expose] def sumRemoveSplitEquiv {A B : Type} (a : A) (b : B) : {x : A ⊕ B // x ≠ Sum.inl a ∧ x ≠ Sum.inr b} ≃ {x : A // x ≠ a} ⊕ {y : B // y ≠ b} where @@ -544,6 +559,7 @@ def sumRemoveSplitEquiv {A B : Type} (a : A) (b : B) : | Sum.inr _ => rfl /-- Removing label `t` from `Fin (t + 1 + u)` leaves `Fin (t + u)`. -/ +@[expose] noncomputable def rightRemoveEquiv (t u : ℕ) : {x : Fin (t + 1 + u) // x ≠ ⟨t, by omega⟩} ≃ Fin (t + u) := Equiv.trans @@ -553,6 +569,7 @@ noncomputable def rightRemoveEquiv (t u : ℕ) : /-- The label re-indexing after gluing the top interface pair: removing the last label on the left and label `t` on the right. -/ +@[expose] noncomputable def interfaceStepEquiv (s t u : ℕ) : {x : Fin (s + t + 1) ⊕ Fin (t + 1 + u) // x ≠ Sum.inl ⟨s + t, Nat.lt_succ_self _⟩ ∧ @@ -565,6 +582,7 @@ noncomputable def interfaceStepEquiv (s t u : ℕ) : /-- Glue the `t` interface labels of a fragment over `Fin (s + t) ⊕ Fin (t + u)`: the pairs `(inl (s + k), inr k)` for `k < t`, glued top pair first. -/ +@[expose] noncomputable def glueInterface (s : ℕ) : (t : ℕ) → (u : ℕ) → Fragment (Fin (s + t) ⊕ Fin (t + u)) → Fragment (Fin s ⊕ Fin u) @@ -577,6 +595,7 @@ noncomputable def glueInterface (s : ℕ) : /-- Composition of fragments: glue the last `t` labels of `F` to the first `t` labels of `G`, in order. -/ +@[expose] noncomputable def Fragment.compose {s t u : ℕ} (F : Fragment (Fin (s + t))) (G : Fragment (Fin (t + u))) : Fragment (Fin (s + u)) := @@ -598,29 +617,34 @@ abbrev ClosedFragment : Type 1 := Fragment (Fin 0) /-- The full closure of two `t`-fragments: compose them as a `(0 + t)`- and a `(t + 0)`-fragment. -/ +@[expose] noncomputable def pairClose {t : ℕ} (F G : Fragment (Fin t)) : ClosedFragment := (F.relabel (finCongr (by omega : t = 0 + t))).compose (G.relabel (finCongr (by omega : t = t + 0))) /-- The connection pairing of a parameter at arity `t`. -/ +@[expose] noncomputable def connectionPairing (f : ClosedFragment → ℂ) (t : ℕ) (F G : Fragment (Fin t)) : ℂ := f (pairClose F G) /-- The curried connection pairing as a linear map from the free module on `t`-fragments to the function space. -/ +@[expose] noncomputable def connectionMap (f : ClosedFragment → ℂ) (t : ℕ) : (Fragment (Fin t) →₀ ℂ) →ₗ[ℂ] (Fragment (Fin t) → ℂ) := Finsupp.lift _ ℂ _ (fun F G => connectionPairing f t F G) /-- The edge-rank hypothesis `H2`: the connection pairing at every arity has rank at most `R ^ t`. -/ +@[expose] def EdgeRankBounded (f : ClosedFragment → ℂ) (R : ℕ) : Prop := ∀ t : ℕ, Module.rank ℂ (LinearMap.range (connectionMap f t)) ≤ (R : Cardinal) ^ t /-- The empty closed fragment. -/ +@[expose] noncomputable def emptyClosedFragment : ClosedFragment := (Fragment.circlesOnly 0).relabel (Equiv.equivOfIsEmpty Empty (Fin 0)) @@ -663,12 +687,14 @@ variable {W : Fragment α} /-- The degree of a vertex within an edge subset: the number of participating flags attached to it. -/ +@[expose] noncomputable def deg (F : EdgeSubset W) (v : W.Vertex) : ℕ := letI := Classical.decEq (W.Vertex ⊕ α) (F.flags.filter (fun f => W.attach f = Sum.inl v)).card /-- An edge subset is Eulerian when every vertex has even degree within it. -/ +@[expose] def Eulerian (F : EdgeSubset W) : Prop := ∀ v : W.Vertex, Even (F.deg v) @@ -693,6 +719,7 @@ structure TransitionSystem (F : EdgeSubset W) where /-- The walk map of a transition system: follow the edge to the partner flag, then the matching at its vertex. -/ +@[expose] def TransitionSystem.walk {F : EdgeSubset W} (κ : TransitionSystem F) (f : W.Flag) : W.Flag := κ.match_ (W.pairing f) @@ -722,6 +749,7 @@ theorem TransitionSystem.walk_injOn {F : EdgeSubset W} /-- The walk permutation of a transition system: the walk map as a permutation of the participating flags. -/ +@[expose] noncomputable def TransitionSystem.walkPerm {F : EdgeSubset W} (κ : TransitionSystem F) : Equiv.Perm {f : W.Flag // f ∈ F.flags} := Equiv.ofBijective @@ -734,6 +762,7 @@ noncomputable def TransitionSystem.walkPerm {F : EdgeSubset W} of `n` edges carries two walk-cycles of length `n` when `n ≥ 2` and two walk fixed points when `n = 1`, so the count is half the total number of orbits. -/ +@[expose] noncomputable def TransitionSystem.circuitCount {F : EdgeSubset W} (κ : TransitionSystem F) : ℕ := (κ.walkPerm.cycleType.card + @@ -755,12 +784,14 @@ free-circle factor `(k − 2ℓ)^circles` times the sum over Eulerian subsets. - /-- The data of a `(k, 2ℓ)` mixed vertex functional: a value for each multiset of even colours and set of odd colours. -/ +@[expose] def MixedFunctional (k ℓ : ℕ) : Type := Multiset (Fin k) → Finset (Fin (2 * ℓ)) → ℂ /-- The alternating evaluation of a mixed functional on an ordered list of odd colours: zero on repetitions, otherwise the sorting sign times the value on the underlying set. -/ +@[expose] def MixedFunctional.evalOdd {k ℓ : ℕ} (h : MixedFunctional k ℓ) (μ : Multiset (Fin k)) (w : List (Fin (2 * ℓ))) : ℂ := if w.Nodup then (sortSign w : ℂ) * h μ w.toFinset else 0 @@ -768,12 +799,14 @@ def MixedFunctional.evalOdd {k ℓ : ℕ} (h : MixedFunctional k ℓ) /-- The odd-colour index pairing of the standard symplectic basis: the partner of colour `c` is `c + ℓ` when `c < ℓ` and `c − ℓ` otherwise. -/ +@[expose] def oddPartner (ℓ : ℕ) (c : Fin (2 * ℓ)) : Fin (2 * ℓ) := if h : c.val < ℓ then ⟨c.val + ℓ, by omega⟩ else ⟨c.val - ℓ, by omega⟩ /-- The sign of the odd-colour pairing: `g_c = −f_{c+ℓ}` for `c < ℓ` and `g_c = f_{c−ℓ}` otherwise. -/ +@[expose] def oddPartnerSign (ℓ : ℕ) (c : Fin (2 * ℓ)) : ℤ := if c.val < ℓ then -1 else 1 @@ -796,7 +829,7 @@ structure EdgeSubset.TransitionSystem.Orientation {α : Type} transported from an enumeration. Used only to enumerate vertex pairings; the evaluated summands are independent of the choice because pair blocks move by even permutations. -/ -@[instance_reducible] +@[expose, instance_reducible] noncomputable def Fragment.flagOrder {α : Type} (W : Fragment α) : LinearOrder W.Flag := LinearOrder.lift' (Fintype.equivFin W.Flag) @@ -804,6 +837,7 @@ noncomputable def Fragment.flagOrder {α : Type} (W : Fragment α) : /-- The incoming participating flags at a vertex, in the fixed flag order. -/ +@[expose] noncomputable def EdgeSubset.inFlagsAt {α : Type} {W : Fragment α} (F : EdgeSubset W) {κ : F.TransitionSystem} (o : κ.Orientation) (v : W.Vertex) : List W.Flag := @@ -825,6 +859,7 @@ theorem EdgeSubset.pairing_not_mem (F : EdgeSubset W) {f : W.Flag} /-- Even colourings of the non-participating edges: pairing-constant colours on the flags outside the subset. -/ +@[expose] def EdgeSubset.EvenColouring (F : EdgeSubset W) (k : ℕ) : Type := {ψ : {f : W.Flag // f ∉ F.flags} → Fin k // ∀ f : {f : W.Flag // f ∉ F.flags}, @@ -832,6 +867,7 @@ def EdgeSubset.EvenColouring (F : EdgeSubset W) (k : ℕ) : Type := /-- Odd colourings of the participating edges: pairing-constant colours on the flags of the subset. -/ +@[expose] def EdgeSubset.OddColouring (F : EdgeSubset W) (ℓ : ℕ) : Type := {φ : {f : W.Flag // f ∈ F.flags} → Fin (2 * ℓ) // ∀ f : {f : W.Flag // f ∈ F.flags}, @@ -854,6 +890,7 @@ noncomputable instance EdgeSubset.OddColouring.instFintype open Classical in /-- The even-colour multiset at a vertex: the colours of the non-participating flags attached to it. -/ +@[expose] noncomputable def EdgeSubset.evenColoursAt (F : EdgeSubset W) {k : ℕ} (ψ : F.EvenColouring k) (v : W.Vertex) : Multiset (Fin k) := ((Finset.univ.filter @@ -873,6 +910,7 @@ open Classical in /-- The odd pair contributed by an incoming participating flag: its edge colour followed by the partner index of its matched outgoing flag's edge colour. -/ +@[expose] noncomputable def EdgeSubset.oddPairFn (F : EdgeSubset W) {ℓ : ℕ} (κ : F.TransitionSystem) (φ : F.OddColouring ℓ) (f : {f : W.Flag // f ∈ F.flags}) : List (Fin (2 * ℓ)) := @@ -881,6 +919,7 @@ noncomputable def EdgeSubset.oddPairFn (F : EdgeSubset W) {ℓ : ℕ} open Classical in /-- The odd-pairing sign contributed by an incoming participating flag: the partner sign of its matched outgoing flag's colour. -/ +@[expose] noncomputable def EdgeSubset.oddSignFn (F : EdgeSubset W) {ℓ : ℕ} (κ : F.TransitionSystem) (φ : F.OddColouring ℓ) (f : {f : W.Flag // f ∈ F.flags}) : ℤ := @@ -889,6 +928,7 @@ noncomputable def EdgeSubset.oddSignFn (F : EdgeSubset W) {ℓ : ℕ} open Classical in /-- The odd-colour list at a vertex: the odd pairs of the incoming flags in the fixed order. -/ +@[expose] noncomputable def EdgeSubset.oddListAt (F : EdgeSubset W) {ℓ : ℕ} {κ : F.TransitionSystem} (o : κ.Orientation) (φ : F.OddColouring ℓ) (v : W.Vertex) : List (Fin (2 * ℓ)) := @@ -898,6 +938,7 @@ noncomputable def EdgeSubset.oddListAt (F : EdgeSubset W) {ℓ : ℕ} open Classical in /-- The odd-pairing sign at a vertex: the product of the partner signs of the outgoing colours. -/ +@[expose] noncomputable def EdgeSubset.oddSignAt (F : EdgeSubset W) {ℓ : ℕ} {κ : F.TransitionSystem} (o : κ.Orientation) (φ : F.OddColouring ℓ) (v : W.Vertex) : ℤ := @@ -908,6 +949,7 @@ open Classical in /-- The Definition 5 summand of an Eulerian edge subset with chosen transition system and orientation: the circuit sign times the colouring sum of the vertex values. -/ +@[expose] noncomputable def EdgeSubset.mixedSummand (F : EdgeSubset W) {k ℓ : ℕ} (h : MixedFunctional k ℓ) {κ : F.TransitionSystem} (o : κ.Orientation) : ℂ := @@ -922,6 +964,7 @@ open Classical in choice of transition system and orientation, zero when none exists. (Every Eulerian subset admits one; the value is independent of the choice by the Eulerian-independence input.) -/ +@[expose] noncomputable def EdgeSubset.mixedValue (F : EdgeSubset W) {k ℓ : ℕ} (h : MixedFunctional k ℓ) : ℂ := if hne : Nonempty ((κ : F.TransitionSystem) × κ.Orientation) then @@ -934,6 +977,7 @@ open Classical in /-- **The mixed partition function** (Regts–Sevenster Definition 5) of a fragment: the free-circle factor times the sum over Eulerian edge subsets of their circuit-signed colouring sums. -/ +@[expose] noncomputable def mixedPartition {α : Type} {k ℓ : ℕ} (h : MixedFunctional k ℓ) (W : Fragment α) : ℂ := ((k : ℂ) - 2 * ℓ) ^ W.circles * @@ -1009,6 +1053,7 @@ def RegtsSevensterStatementTotal : Prop := /-- **THE CONVERSE STATEMENT**: every mixed partition function is an edge-rank-bounded parameter with base `max 1 (k + 2ℓ)` (Regts–Sevenster, arXiv:1807.04494, Theorem 6). -/ +@[expose] def RegtsSevensterConverseStatement : Prop := ∀ (k ℓ : ℕ) (h : MixedFunctional k ℓ), ∃ g : EdgeRankParameter (max 1 (k + 2 * ℓ)), @@ -1063,13 +1108,13 @@ structure Hom (V W : SuperVect) where oddMap : V.odd →ₗ[ℂ] W.odd /-- The identity morphism on a super vector space. -/ -@[simp] +@[simp, expose] def Hom.id (V : SuperVect) : Hom V V where evenMap := LinearMap.id oddMap := LinearMap.id /-- Composition of super-vector-space morphisms. -/ -@[simp] +@[simp, expose] def Hom.comp {V W X : SuperVect} (g : Hom W X) (f : Hom V W) : Hom V X where evenMap := g.evenMap.comp f.evenMap oddMap := g.oddMap.comp f.oddMap @@ -1099,12 +1144,14 @@ instance instCategory : Category SuperVect where /-- The graded tensor product of two super vector spaces. The even component is `(V.even ⊗ W.even) × (V.odd ⊗ W.odd)` and the odd component is `(V.even ⊗ W.odd) × (V.odd ⊗ W.even)`. -/ +@[expose] def tensorObj (V W : SuperVect) : SuperVect where even := (V.even ⊗[ℂ] W.even) × (V.odd ⊗[ℂ] W.odd) odd := (V.even ⊗[ℂ] W.odd) × (V.odd ⊗[ℂ] W.even) /-- The tensor product of two grading-preserving maps acts component-wise on each tensor block. -/ +@[expose] def tensorHom {V₁ V₂ W₁ W₂ : SuperVect} (f : Hom V₁ V₂) (g : Hom W₁ W₂) : Hom (tensorObj V₁ W₁) (tensorObj V₂ W₂) := by @@ -1123,7 +1170,7 @@ def tensorHom {V₁ V₂ W₁ W₂ : SuperVect} /-- The monoidal unit: ℂ in even degree, the zero module in odd degree. Marked reducible so that `tensorUnit.odd` reduces to `PUnit` during type-class synthesis. -/ -@[reducible] +@[expose, reducible] def tensorUnit : SuperVect where even := ℂ odd := PUnit @@ -1134,6 +1181,7 @@ def tensorUnit : SuperVect where first factor and *minus* `TensorProduct.comm` on the second. Stated over bare modules so that instances of it at compound objects have syntactically reduced types. -/ +@[expose] def koszulEvenAux (A B C D : Type*) [AddCommGroup A] [Module ℂ A] [AddCommGroup B] [Module ℂ B] [AddCommGroup C] [Module ℂ C] [AddCommGroup D] [Module ℂ D] : @@ -1144,6 +1192,7 @@ def koszulEvenAux (A B C D : Type*) /-- Module-level odd Koszul block: swaps the two summands and applies `TensorProduct.comm` on each (no sign). -/ +@[expose] def koszulOddAux (A B C D : Type*) [AddCommGroup A] [Module ℂ A] [AddCommGroup B] [Module ℂ B] [AddCommGroup C] [Module ℂ C] [AddCommGroup D] [Module ℂ D] : @@ -1155,6 +1204,7 @@ def koszulOddAux (A B C D : Type*) /-- The even component of the Koszul braiding: applies `TensorProduct.comm` on the even⊗even block and *minus* `TensorProduct.comm` on the odd⊗odd block. -/ +@[expose] def koszulBraidingEven (V W : SuperVect) : (V.even ⊗[ℂ] W.even) × (V.odd ⊗[ℂ] W.odd) →ₗ[ℂ] (W.even ⊗[ℂ] V.even) × (W.odd ⊗[ℂ] V.odd) := @@ -1163,6 +1213,7 @@ def koszulBraidingEven (V W : SuperVect) : /-- The odd component of the Koszul braiding: swaps the two blocks and applies `TensorProduct.comm` on each (no sign, since even⊗odd and odd⊗even contribute (−1)^(0·1) = 1). -/ +@[expose] def koszulBraidingOdd (V W : SuperVect) : (V.even ⊗[ℂ] W.odd) × (V.odd ⊗[ℂ] W.even) →ₗ[ℂ] (W.even ⊗[ℂ] V.odd) × (W.odd ⊗[ℂ] V.even) := @@ -1171,6 +1222,7 @@ def koszulBraidingOdd (V W : SuperVect) : /-- The Koszul braiding morphism `V ⊗ W → W ⊗ V` in SuperVect, carrying the sign (−1)^(p·q) on the swap of homogeneous elements of parity p and q. -/ +@[expose] def koszulBraiding (V W : SuperVect) : Hom (tensorObj V W) (tensorObj W V) := by refine ⟨?_, ?_⟩ @@ -1215,6 +1267,7 @@ theorem koszulBraidingOdd_pair (V W : SuperVect) /-! ### Koszul braiding as a categorical isomorphism -/ /-- The Koszul braiding as an isomorphism in SuperVect. -/ +@[expose] def koszulBraidingIso (V W : SuperVect) : tensorObj V W ≅ tensorObj W V where hom := koszulBraiding V W @@ -1225,6 +1278,7 @@ def koszulBraidingIso (V W : SuperVect) : /-! ### Left and right unitors -/ /-- The left unitor isomorphism `𝟙_ ⊗ V ≅ V`. -/ +@[expose] def leftUnitor (V : SuperVect) : tensorObj tensorUnit V ≅ V where hom := by @@ -1267,6 +1321,7 @@ def leftUnitor (V : SuperVect) : apply LinearMap.ext; intro x; simp /-- The right unitor isomorphism `V ⊗ 𝟙_ ≅ V`. -/ +@[expose] def rightUnitor (V : SuperVect) : tensorObj V tensorUnit ≅ V where hom := by @@ -1315,6 +1370,7 @@ def rightUnitor (V : SuperVect) : `(a, b, c, d) ↦ (a, c, d, b)`. All field proofs hold by `rfl` because the permutation is a definitional reshuffling of product components. -/ +@[expose] def prod4Perm (A B C D : Type*) [AddCommGroup A] [Module ℂ A] [AddCommGroup B] [Module ℂ B] [AddCommGroup C] [Module ℂ C] [AddCommGroup D] [Module ℂ D] : @@ -1334,6 +1390,7 @@ modules so that instances of it at compound objects have syntactically reduced types; the even and odd components of the SuperVect associator are its instantiations with the two `C`-slots in the two orders. -/ +@[expose] def assocAux (A₁ A₂ B₁ B₂ C₁ C₂ : Type*) [AddCommGroup A₁] [Module ℂ A₁] [AddCommGroup A₂] [Module ℂ A₂] [AddCommGroup B₁] [Module ℂ B₁] [AddCommGroup B₂] [Module ℂ B₂] @@ -1361,6 +1418,7 @@ def assocAux (A₁ A₂ B₁ B₂ C₁ C₂ : Type*) s1 ≪≫ₗ s2 ≪≫ₗ s3 ≪≫ₗ s4 /-- The even component of the associator equivalence. -/ +@[expose] def assocEvenEquiv (V W X : SuperVect) : ((((V.even ⊗[ℂ] W.even) × (V.odd ⊗[ℂ] W.odd)) ⊗[ℂ] X.even) × (((V.even ⊗[ℂ] W.odd) × (V.odd ⊗[ℂ] W.even)) ⊗[ℂ] X.odd)) ≃ₗ[ℂ] @@ -1370,6 +1428,7 @@ def assocEvenEquiv (V W X : SuperVect) : /-- The odd component of the associator equivalence: `assocAux` with the roles of the two `X`-slots swapped. -/ +@[expose] def assocOddEquiv (V W X : SuperVect) : ((((V.even ⊗[ℂ] W.even) × (V.odd ⊗[ℂ] W.odd)) ⊗[ℂ] X.odd) × (((V.even ⊗[ℂ] W.odd) × (V.odd ⊗[ℂ] W.even)) ⊗[ℂ] X.even)) ≃ₗ[ℂ] @@ -1380,6 +1439,7 @@ def assocOddEquiv (V W X : SuperVect) : /-- The associator isomorphism `(V ⊗ W) ⊗ X ≅ V ⊗ (W ⊗ X)` in SuperVect. Distributes tensor over products, reassociates each block, and permutes the summands back into the canonical grading order. -/ +@[expose] def associator (V W X : SuperVect) : tensorObj (tensorObj V W) X ≅ tensorObj V (tensorObj W X) where hom := by @@ -2253,6 +2313,7 @@ instance {V W : SuperVect} : SMul ℤ (V ⟶ W) := /-- The components of a morphism determine it; the additive and module structures are pulled back componentwise. -/ +@[expose] def homComponents {V W : SuperVect} (f : V ⟶ W) : (V.even →ₗ[ℂ] W.even) × (V.odd →ₗ[ℂ] W.odd) := (f.evenMap, f.oddMap) @@ -2364,6 +2425,7 @@ variable {C : Type u} /-- **`Y` is a subquotient of `Z`**: a quotient of a subobject of `Z`. This is the relation Deligne's tensor-generation hypothesis is stated with. -/ +@[expose] def IsSubquotientOf [Category.{v} C] (Y Z : C) : Prop := ∃ (S : C) (i : S ⟶ Z) (p : S ⟶ Y), Mono i ∧ Epi p @@ -2380,6 +2442,7 @@ theorem isSubquotientOf_of_retract [Category.{v} C] no strictly increasing chain of `k + 2` subobjects; equivalently, every chain `0 = Y₀ < ⋯ < Y_ℓ = Y` has `ℓ ≤ k`, so the composition length of `Y` is at most `k`. -/ +@[expose] def LengthLE [Category.{v} C] (Y : C) (k : ℕ) : Prop := ∀ f : Fin (k + 2) → Subobject Y, ¬ StrictMono f @@ -2391,6 +2454,7 @@ section variable (A : Type u) /-- The unit's endomorphisms are the scalars. -/ +@[expose] def HasScalarUnit [Category.{v} A] [Preadditive A] [Linear ℂ A] [MonoidalCategory A] : Prop := Function.Bijective @@ -2403,12 +2467,14 @@ section variable (A : Type u) /-- Iterated tensor power of an object. -/ +@[expose] def tensorPow [Category.{v} A] [MonoidalCategory A] (X : A) : ℕ → A | 0 => 𝟙_ A | n + 1 => tensorObj (tensorPow X n) X /-- A mixed tensor power of `X`: `X ^ ⊗ a ⊗ (Xᘁ) ^ ⊗ b`. -/ +@[expose] def mixedPow [Category.{v} A] [MonoidalCategory A] [RigidCategory A] (X : A) (a b : ℕ) : A := tensorPow A X a ⊗ tensorPow A (Xᘁ) b @@ -2417,6 +2483,7 @@ def mixedPow [Category.{v} A] [MonoidalCategory A] hypothesis: every object is a subquotient of a finite biproduct of mixed tensor powers of `X` — a quotient of a subobject of such a biproduct. -/ +@[expose] def TensorGeneratedBy [Category.{v} A] [MonoidalCategory A] [Preadditive A] [HasFiniteBiproducts A] [RigidCategory A] (X : A) : Prop := ∀ Y : A, ∃ (k : ℕ) (ab : Fin k → ℕ × ℕ), @@ -2424,6 +2491,7 @@ def TensorGeneratedBy [Category.{v} A] [MonoidalCategory A] /-- Every object has moderate tensor-power growth, measured by composition length. -/ +@[expose] def ModerateLengthGrowth [Category.{v} A] [MonoidalCategory A] : Prop := ∀ Y : A, ∃ C c : ℕ, ∀ N : ℕ, LengthLE (tensorPow A Y N) (C * c ^ N) @@ -2490,6 +2558,7 @@ category with ℂ-bilinear tensor product, scalar unit endomorphisms, a finite tensor generator and moderate growth of the lengths of its tensor powers admits an exact faithful ℂ-linear symmetric monoidal fibre functor to finite-dimensional super vector spaces. -/ +@[expose] def DeligneTheoremStatement : Prop := ∀ (A : Type u) [Category.{v} A] [Abelian A] [Linear ℂ A] [MonoidalCategory A] [SymmetricCategory A] diff --git a/LeanPool/RegtsSevenster/RS/DimensionDefinitions.lean b/LeanPool/RegtsSevenster/RS/DimensionDefinitions.lean index fcf08ced8f..530bb53041 100644 --- a/LeanPool/RegtsSevenster/RS/DimensionDefinitions.lean +++ b/LeanPool/RegtsSevenster/RS/DimensionDefinitions.lean @@ -18,22 +18,25 @@ colour dimension is the least total colour bound of a representing mixed model; it is zero when no representing model exists. -/ -@[expose] public section +public section namespace RS /-- The closed fragment of `c` free circles. -/ +@[expose] noncomputable def circlesClosed (c : ℕ) : ClosedFragment := (Fragment.circlesOnly c).relabel (_root_.Equiv.equivOfIsEmpty Empty (Fin 0)) /-- The natural dimension of the connection-map range. It agrees with connection rank whenever the range is finite-dimensional. -/ +@[expose] noncomputable def connectionRank (f : ClosedFragment → ℂ) (t : ℕ) : ℕ := Module.finrank ℂ (LinearMap.range (connectionMap f t)) /-- A mixed functional represents the parameter on every closed fragment, including those with free circles. -/ +@[expose] def MixedFunctional.Represents {k ℓ : ℕ} (h : MixedFunctional k ℓ) (f : ClosedFragment → ℂ) : Prop := ∀ W, f W = mixedPartition h W diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/AdjSwapBmc.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/AdjSwapBmc.lean index 9b2b8d7f35..07e9c46d56 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/AdjSwapBmc.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/AdjSwapBmc.lean @@ -19,13 +19,14 @@ transpose, so the whole recursion lives in the bundle-map calculus. -/ -@[expose] public section +public section namespace RS open CategoryTheory MonoidalCategory /-- The adjacent swap as a label equivalence. -/ +@[expose] def adjSwapEquiv (n i : ℕ) (h : i + 2 ≤ n) : Fin n ≃ Fin n := _root_.Equiv.swap ⟨i, by omega⟩ ⟨i + 1, by omega⟩ diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/AdjacentWord.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/AdjacentWord.lean index 9d4d47ee9f..e3d98b5826 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/AdjacentWord.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/AdjacentWord.lean @@ -28,13 +28,14 @@ conjugation identity and lift the recursive word for `σ'` by mapping positions through `Fin.succ`. -/ -@[expose] public section +public section namespace RS open Equiv /-- The adjacent transposition at position `i`: swaps `i` and `i + 1`. -/ +@[expose] def adjTrans {n : ℕ} (i : Fin n) : Equiv.Perm (Fin (n + 1)) := Equiv.swap i.castSucc i.succ diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BasisCoord.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BasisCoord.lean index 7b48d9f2c0..35bd72f44b 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BasisCoord.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BasisCoord.lean @@ -16,7 +16,7 @@ The coordinate of a colour basis vector is the equality indicator: the coordinate calculus closes on basis input. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BasisSplit.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BasisSplit.lean index 4daa5052a6..afaa1df8d1 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BasisSplit.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BasisSplit.lean @@ -18,7 +18,7 @@ both parities identify the coordinates; injectivity does the rest. -/ -@[expose] public section +public section namespace RS @@ -27,6 +27,7 @@ open scoped TensorProduct variable {k ℓ : ℕ} /-- The even coordinate basis vector at a colouring. -/ +@[expose] noncomputable def evenBasisVec {n : ℕ} (c : {c : MixedColouring k ℓ n // c.IsEven}) : (superPow (stdSuperPair k ℓ) n).even := @@ -38,6 +39,14 @@ noncomputable def oddBasisVec {n : ℕ} (superPow (stdSuperPair k ℓ) n).odd := (colourPowerEquiv k ℓ n).oddEquiv.symm (Pi.single c 1) +/-- The odd colouring coordinates of an odd coordinate basis vector. -/ +theorem colourPowerEquiv_oddBasisVec {n : ℕ} + (c : {c : MixedColouring k ℓ n // ¬ c.IsEven}) : + (colourPowerEquiv k ℓ n).oddEquiv (oddBasisVec c) = + Pi.single c 1 := by + unfold oddBasisVec + exact (colourPowerEquiv k ℓ n).oddEquiv.apply_symm_apply _ + /-- Colourings are determined by their halves. -/ theorem MixedColouring.ext_halves {a b : ℕ} {c₁ c₂ : MixedColouring k ℓ (a + b)} diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BetaData.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BetaData.lean index ed7ffab7ac..f4a2334668 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BetaData.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BetaData.lean @@ -15,7 +15,7 @@ The colour-form entries at a partner slot, the colouring of a sum index on either side, and the `β`-diagonal these produce. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BetaDiag.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BetaDiag.lean index d5050916d4..6a2eedba4c 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BetaDiag.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BetaDiag.lean @@ -18,7 +18,7 @@ the peeled colouring times the split factor — the smaller diagonal against the two-position form entry, vanishing on odd halves. -/ -@[expose] public section +public section namespace RS @@ -110,6 +110,7 @@ theorem peelColour_pairSnd (m : ℕ) omega /-- **The diagonal cap pairing**: the colour-side cap value. -/ +@[expose] noncomputable def betaDiag : (m : ℕ) → MixedColouring k ℓ (m + m) → ℂ | 0, _ => 1 diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BetaDiagForm.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BetaDiagForm.lean index 6952ac857e..9a38ff664f 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BetaDiagForm.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BetaDiagForm.lean @@ -17,7 +17,7 @@ The diagonal cap pairing `betaDiag m c` on a colouring pairing `betaColour` applied to the two halves of `c`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BetaFlip.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BetaFlip.lean index 29b7ec69f4..81d5639e0c 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BetaFlip.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BetaFlip.lean @@ -21,7 +21,7 @@ pairing at the flipped data colouring is the crossing and representative parities times the Definition 5 odd signs. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BlockAlign.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BlockAlign.lean index 77a27e87bc..a11e8430da 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BlockAlign.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BlockAlign.lean @@ -19,7 +19,7 @@ Definition 5 per-flag values: outgoing flags carry the partner of their colour, incoming flags the colour itself. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BlockCanon.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BlockCanon.lean index 125c000b88..b70a50e2cc 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BlockCanon.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BlockCanon.lean @@ -19,7 +19,7 @@ multiset at the block's vertex, and the odd list carries the Definition 5 odd values. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BlockData.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BlockData.lean index 79066f2afc..578c47074c 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BlockData.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BlockData.lean @@ -17,7 +17,7 @@ colouring data at those flags: participating flags carry the odd colour (or its partner on partner slots), the rest the even colour. -/ -@[expose] public section +public section namespace RS @@ -26,6 +26,7 @@ open Finset variable {k ℓ : ℕ} /-- The flag of the j-th slot in the v-th block. -/ +@[expose] noncomputable def blockFlag (W : ClosedFragment) (v : Fin (ds W).length) (j : Fin ((ds W).get v)) : W.Flag := (starFlagEnum W).symm (slotEmbed W v j) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BlockOddList.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BlockOddList.lean index 76fd80ce62..2c17b1c8ba 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BlockOddList.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BlockOddList.lean @@ -17,7 +17,7 @@ Definition 5 value map over the block-slot flag enumeration, entry by entry. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BlockParity.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BlockParity.lean index 25074d9f20..307ed18d7d 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BlockParity.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BlockParity.lean @@ -18,7 +18,7 @@ corresponding vertex have even count. Corollary: the master summand vanishes whenever any block is odd-parity. -/ -@[expose] public section +public section namespace RS @@ -28,6 +28,7 @@ variable {k ℓ : ℕ} /-- The vertex corresponding to the v-th block of the sorted colouring: applying the vertex enumeration to the block index. -/ +@[expose] noncomputable def blockVertex (W : ClosedFragment) (v : Fin (degList (starAssignEnum W)).length) : W.Vertex := (Fintype.equivFin W.Vertex).symm diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BlockRestrict.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BlockRestrict.lean index 54bf6cf4d2..35aa903411 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BlockRestrict.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BlockRestrict.lean @@ -18,7 +18,7 @@ at a cons: the vocabulary in which the assembled star vector's coordinates factor over the vertices. -/ -@[expose] public section +public section namespace RS @@ -37,6 +37,7 @@ theorem blockSigmaEquiv_cons_succ_val (d : ℕ) (ds : List ℕ) variable {k ℓ : ℕ} /-- The block restriction of a colouring. -/ +@[expose] noncomputable def blockRestrict (ds : List ℕ) (c : MixedColouring k ℓ ds.sum) (v : Fin ds.length) : MixedColouring k ℓ (ds.get v) := fun j => diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BlockSigma.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BlockSigma.lean index ca03f955a2..baefd5e0fd 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BlockSigma.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BlockSigma.lean @@ -15,11 +15,12 @@ The block enumeration pairs a block index with an offset within the block to enumerate the concatenated total. -/ -@[expose] public section +public section namespace RS /-- Split the sigma over a cons list into head + tail. -/ +@[expose] def blockSigmaSplitFun (d : ℕ) (ds : List ℕ) : (Σ v : Fin (ds.length + 1), Fin ((d :: ds).get v)) → Fin d ⊕ (Σ w : Fin ds.length, Fin (ds.get w)) @@ -34,6 +35,7 @@ def blockSigmaSplitInv (d : ℕ) (ds : List ℕ) : | Sum.inr ⟨w, j⟩ => ⟨w.succ, j⟩ /-- The sigma over a cons list splits as head + tail. -/ +@[expose] def blockSigmaSplit (d : ℕ) (ds : List ℕ) : (Σ v : Fin (ds.length + 1), Fin ((d :: ds).get v)) ≃ Fin d ⊕ (Σ w : Fin ds.length, Fin (ds.get w)) where @@ -51,6 +53,7 @@ def blockSigmaSplit (d : ℕ) (ds : List ℕ) : /-- The block enumeration: a block index and an offset within the block enumerate the concatenated total. -/ +@[expose] noncomputable def blockSigmaEquiv : (ds : List ℕ) → (Σ v : Fin ds.length, Fin (ds.get v)) ≃ Fin ds.sum | [] => diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BlockSort.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BlockSort.lean index 22c6dd8074..a6276e0e48 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BlockSort.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BlockSort.lean @@ -18,7 +18,7 @@ fibre. Relabelling along the sort turns the multi-star into the block-assigned form, ready for the block factorization. -/ -@[expose] public section +public section namespace RS @@ -75,6 +75,7 @@ theorem degList_card_sigma : /-- The sort map: a slot goes to its vertex block at its enumerated offset within the fibre. -/ +@[expose] noncomputable def sortFun (i : Fin n) : Σ w : Fin (degList assign).length, Fin ((degList assign).get w) := @@ -112,6 +113,7 @@ theorem sortFun_bijective : Function.Bijective (sortFun assign) := by exact ⟨hinj, by rw [Fintype.card_fin, degList_card_sigma]⟩ /-- **The sort equivalence** onto the block index space. -/ +@[expose] noncomputable def sortSigma : Fin n ≃ Σ w : Fin (degList assign).length, Fin ((degList assign).get w) := diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BraidWord.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BraidWord.lean index 77a847a90f..725bfc6729 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BraidWord.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/BraidWord.lean @@ -17,7 +17,7 @@ any permutation bundle map conjugates through `stdToOmega` into the corresponding word of model braidings. -/ -@[expose] public section +public section namespace RS @@ -35,6 +35,7 @@ theorem adjTrans_eq_adjSwap {n : ℕ} (i : Fin n) : from Fin.ext rfl] /-- The model-side braiding word. -/ +@[expose] noncomputable def powBraidWord (V : SuperVect) {n : ℕ} : List (Fin n) → (superPow V (n + 1) ⟶ superPow V (n + 1)) | [] => 𝟙 _ diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CanonColour.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CanonColour.lean index 61b11bfbb1..2c39ed5e40 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CanonColour.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CanonColour.lean @@ -18,7 +18,7 @@ vertex functional of Definition 5 evaluates the symmetric star coordinates. -/ -@[expose] public section +public section namespace RS @@ -26,6 +26,7 @@ variable {k ℓ : ℕ} /-- The canonical colouring: sorted even colours, then sorted odd colours. -/ +@[expose] noncomputable def canonColouring (μm : Multiset (Fin k)) (F : Finset (Fin (2 * ℓ))) : MixedColouring k ℓ (μm.card + F.card) := fun i => diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CanonPerm.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CanonPerm.lean index b516ac4be9..a71097364e 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CanonPerm.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CanonPerm.lean @@ -25,7 +25,7 @@ functional sees only the multiset and the set, and the sign the reindexing costs is exactly the one the list carries. -/ -@[expose] public section +public section namespace RS @@ -37,18 +37,21 @@ variable {k ℓ : ℕ} /-- The even colours of a mixed colouring, as a multiset: even colours may repeat. -/ +@[expose] noncomputable def evenMultisetOf {d : ℕ} (c : MixedColouring k ℓ d) : Multiset (Fin k) := ↑((List.ofFn c).filterMap Sum.getLeft?) /-- The odd colours, in slot order: the list whose sorting sign the summand carries. -/ +@[expose] noncomputable def oddListOf {d : ℕ} (c : MixedColouring k ℓ d) : List (Fin (2 * ℓ)) := (List.ofFn c).filterMap Sum.getRight? /-- The odd colours as a set — the index the functional is evaluated at. -/ +@[expose] noncomputable def oddFinsetOf {d : ℕ} (c : MixedColouring k ℓ d) : Finset (Fin (2 * ℓ)) := (oddListOf c).toFinset diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CapClosed.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CapClosed.lean index 0d392c2f68..cbb153f90c 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CapClosed.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CapClosed.lean @@ -16,7 +16,7 @@ The peel induction: the cap value on colour basis vectors is the diagonal cap pairing. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CapExpansion.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CapExpansion.lean index 8d43d44322..c7260322e6 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CapExpansion.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CapExpansion.lean @@ -16,7 +16,7 @@ the cap values of the colour basis vectors: linearity through the coordinate expansion. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CapFun.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CapFun.lean index 9c0ce3babe..49d0a0b6da 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CapFun.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CapFun.lean @@ -18,7 +18,7 @@ successor cap evaluates through the peel rotation and the tensor split. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CapMatch.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CapMatch.lean index 9935925fc5..a583425064 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CapMatch.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CapMatch.lean @@ -18,7 +18,7 @@ into the strand-bundle cap yields the cap of the permuted matching. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CapPeel.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CapPeel.lean index 5572ba887c..fc41a6b77c 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CapPeel.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CapPeel.lean @@ -18,23 +18,26 @@ boundary word. This is the recursion that computes the cap functional in coordinates. -/ -@[expose] public section +public section namespace RS /-- The peel rotation, on values. -/ +@[expose] def capPeelFun (m j : ℕ) : ℕ := if j < m then j else if j = m then m + m else if j ≤ m + m then j - 1 else j /-- The inverse peel rotation, on values. -/ +@[expose] def capPeelInv (m j : ℕ) : ℕ := if j < m then j else if j = m + m then m else if j < m + m then j + 1 else j /-- The peel rotation: move the last strand's ends to the end. -/ +@[expose] def capPeelRotation (m : ℕ) : Fin ((m + 1) + (m + 1)) ≃ Fin ((m + m) + 2) where toFun i := ⟨capPeelFun m i.val, by diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CapPeelSplit.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CapPeelSplit.lean index a631143d2a..57e7d0817f 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CapPeelSplit.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CapPeelSplit.lean @@ -18,7 +18,7 @@ value of the permuted-and-cast vector. The colour action of the permutation is the only remaining ingredient of the closed form. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CapPerm.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CapPerm.lean index 13b08a0ebf..2bb3fde72f 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CapPerm.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CapPerm.lean @@ -16,7 +16,7 @@ an arity cast; the permutation feeds the braiding-word transport and the cast transports as an equality of powers. -/ -@[expose] public section +public section namespace RS @@ -24,6 +24,7 @@ open CategoryTheory MonoidalCategory open Functor.LaxMonoidal Functor.OplaxMonoidal /-- The peel rotation as a permutation of the source arity. -/ +@[expose] def capPeelPerm (m : ℕ) : _root_.Equiv.Perm (Fin ((m + 1) + (m + 1))) := (capPeelRotation m).trans (finCongr diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CapSplit.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CapSplit.lean index f2a5756417..41a7dcdeb4 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CapSplit.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CapSplit.lean @@ -17,7 +17,7 @@ transported merge of model vectors is the product of the smaller cap value and the strand evaluation. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CapVal.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CapVal.lean index 66022f9ea1..8d5c463628 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CapVal.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CapVal.lean @@ -16,7 +16,7 @@ final computation evaluates. Its base case: the zero cap reads off the scalar itself. -/ -@[expose] public section +public section namespace RS @@ -30,6 +30,7 @@ variable (e : stdSuperPair k ℓ ⟶ P.ω.obj (SkeinObj.mk 1)) /-- The cap value: the cap functional on the transported model vector. -/ +@[expose] noncomputable def capVal (m : ℕ) (v : (superPow (stdSuperPair k ℓ) (m + m)).even) : ℂ := omegaFun f P (bundleCapClass f m) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ChainLists.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ChainLists.lean index a46c461a2f..e3d0c7ba11 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ChainLists.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ChainLists.lean @@ -16,7 +16,7 @@ edge-interleaved list, the oriented list, the matched list, and the global pair concatenation. -/ -@[expose] public section +public section namespace RS @@ -26,6 +26,7 @@ variable {k ℓ : ℕ} open Classical in /-- The participating edges in edge order. -/ +@[expose] noncomputable def partEdges (W : ClosedFragment) (F : EdgeSubset W) : List (Fin (edgeCount W)) := (edgeIndexSet W F).sort (· ≤ ·) @@ -53,6 +54,7 @@ theorem partnerMem_of_partEdge {W : ClosedFragment} open Classical in /-- **The edge-interleaved enumeration**: each participating edge contributes its representative then its partner. -/ +@[expose] noncomputable def edgePairList (W : ClosedFragment) (F : EdgeSubset W) : List {f : W.Flag // f ∈ F.flags} := ((partEdges W F).attachWith (· ∈ edgeIndexSet W F) @@ -67,6 +69,7 @@ noncomputable def edgePairList (W : ClosedFragment) open Classical in /-- **The oriented enumeration**: each participating edge contributes its incoming then its outgoing flag. -/ +@[expose] noncomputable def orientedPairList (W : ClosedFragment) (F : EdgeSubset W) {κ : F.TransitionSystem} (o : κ.Orientation) : List {f : W.Flag // f ∈ F.flags} := @@ -92,6 +95,7 @@ noncomputable def orientedPairList (W : ClosedFragment) open Classical in /-- **The matched enumeration**: each participating edge contributes its incoming flag then that flag's match. -/ +@[expose] noncomputable def matchedPairList (W : ClosedFragment) (F : EdgeSubset W) {κ : F.TransitionSystem} (o : κ.Orientation) : List {f : W.Flag // f ∈ F.flags} := @@ -117,6 +121,7 @@ noncomputable def matchedPairList (W : ClosedFragment) open Classical in /-- **The global pair enumeration**: the vertex pair enumerations in block order. -/ +@[expose] noncomputable def globalPairList (W : ClosedFragment) (F : EdgeSubset W) {κ : F.TransitionSystem} (o : κ.Orientation) : List {f : W.Flag // f ∈ F.flags} := diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CircleModel.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CircleModel.lean index 9494dd8b2e..b0434b4e45 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CircleModel.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CircleModel.lean @@ -20,7 +20,7 @@ and the standard model identifies it with the superdimension `k − 2ℓ`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CircleScalar.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CircleScalar.lean index b0db9df29b..c52f89216b 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CircleScalar.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CircleScalar.lean @@ -19,15 +19,17 @@ off as the power of the circle value. This is the accompanying paper's class level. -/ -@[expose] public section +public section namespace RS /-- The circle value of a parameter. -/ +@[expose] noncomputable def circleVal {R : ℕ} (f : EdgeRankParameter R) : ℂ := f.val (circlesClosed 1) /-- Adding free circles to a fragment. -/ +@[expose] def addCircles {α : Type} (X : Fragment α) (c : ℕ) : Fragment α := { X with circles := X.circles + c } diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CircuitCount.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CircuitCount.lean index 49be34aef9..2e7bd7bc2f 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CircuitCount.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CircuitCount.lean @@ -19,7 +19,7 @@ restrictions have the same orbit count, whence the circuit count out-restriction. -/ -@[expose] public section +public section namespace RS @@ -33,6 +33,7 @@ variable {β : Type} /-- The orbit count of a permutation: number of non-trivial cycles plus number of fixed points. -/ +@[expose] noncomputable def orbitCount [Fintype β] [DecidableEq β] (π : Perm β) : ℕ := π.cycleType.card + Fintype.card (Function.fixedPoints π) @@ -177,6 +178,7 @@ theorem walkPerm_isOut_iff (κ : F.TransitionSystem) (o : κ.Orientation) rw [κ.walkPerm_val, κ.walk_isOut o x.val x.prop] /-- The out-flag restriction of the walk permutation. -/ +@[expose] noncomputable def outPerm (κ : F.TransitionSystem) (o : κ.Orientation) : Perm {f : {g : W.Flag // g ∈ F.flags} // o.isOut f.val = true} := κ.walkPerm.subtypePerm (fun x => κ.walkPerm_isOut_iff o x) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ClosedTransition.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ClosedTransition.lean index 3a3e7b51a7..b118febfb8 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ClosedTransition.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ClosedTransition.lean @@ -18,7 +18,7 @@ transition system: the choice in the Definition 5 value is always inhabited. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ConcatSign.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ConcatSign.lean index c1770355cc..2614e9acf6 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ConcatSign.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ConcatSign.lean @@ -16,7 +16,7 @@ the product of the per-block key-sortSigns: key ranges of distinct blocks are disjoint and ordered, so concatenation adds no inversions. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CoordInterface.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CoordInterface.lean index 716f0f862f..11247851cd 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CoordInterface.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CoordInterface.lean @@ -20,7 +20,7 @@ the parameter value as a pairing in the fibre, ready for the standard-model coordinates. -/ -@[expose] public section +public section namespace RS @@ -30,6 +30,7 @@ variable {R : ℕ} (f : EdgeRankParameter R) variable (P : DelignePackage (SkeinObj f)) /-- The image vector of a `⟨0⟩ ⟶ ⟨d⟩` morphism. -/ +@[expose] noncomputable def omegaVec {d : ℕ} (p : (SkeinObj.mk 0 : SkeinObj f) ⟶ SkeinObj.mk d) : (P.ω.obj (SkeinObj.mk d)).even := @@ -39,6 +40,7 @@ noncomputable def omegaVec {d : ℕ} SuperVect.Hom _ _).evenMap 1 /-- The image functional of a `⟨d⟩ ⟶ ⟨0⟩` morphism. -/ +@[expose] noncomputable def omegaFun {d : ℕ} (q : (SkeinObj.mk d : SkeinObj f) ⟶ SkeinObj.mk 0) : (P.ω.obj (SkeinObj.mk d)).even →ₗ[ℂ] ℂ := @@ -67,6 +69,7 @@ theorem star_pairing (W : ClosedFragment) : /-- The single-vertex star with `d` legs: one internal vertex, `d` pendant edges. -/ +@[expose] def vertexStar (d : ℕ) : Fragment (Fin d) where Flag := Fin d ⊕ Fin d Vertex := Unit @@ -88,6 +91,7 @@ def vertexStar (d : ℕ) : Fragment (Fin d) where /-- The degree-`d` vertex functional data: the image vector of the vertex star read as a `(0, d)`-morphism. -/ +@[expose] noncomputable def starVec (d : ℕ) : (P.ω.obj (SkeinObj.mk d)).even := omegaVec f P (HomSpace.ofFragment f.val diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CoordOf.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CoordOf.lean index 218fe59947..32b10742d6 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CoordOf.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CoordOf.lean @@ -18,13 +18,14 @@ basis expansion: the vocabulary in which the final computation evaluates. -/ -@[expose] public section +public section namespace RS variable {k ℓ : ℕ} /-- The coordinate of a model vector at a colouring. -/ +@[expose] noncomputable def coordOf {n : ℕ} (v : (superPow (stdSuperPair k ℓ) n).even) (c : MixedColouring k ℓ n) : ℂ := diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CoreParity.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CoreParity.lean index 0d06043924..a9e1312ed7 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CoreParity.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/CoreParity.lean @@ -22,7 +22,7 @@ the parity of the core slots' pairing and the parity of the whole slot list. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/EdgeSign.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/EdgeSign.lean index 784e86885f..bb671e5e4e 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/EdgeSign.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/EdgeSign.lean @@ -17,7 +17,7 @@ per-edge signs into the Definition 5 orientation signs, up to the count of edges whose representative is incoming. -/ -@[expose] public section +public section namespace RS @@ -28,6 +28,7 @@ variable {k ℓ : ℕ} open Classical in /-- The participating edges whose representative flag is incoming. -/ +@[expose] noncomputable def inRepCount (W : ClosedFragment) (F : EdgeSubset W) {κ : F.TransitionSystem} (o : κ.Orientation) : ℕ := diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/EvForm.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/EvForm.lean index 8a85966728..4ec26ab60e 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/EvForm.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/EvForm.lean @@ -16,7 +16,7 @@ functional composed with the structure map is the standard form: the pointwise consequence of the model transport equation. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/EvFormOdd.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/EvFormOdd.lean index 0c1474257d..ef7a3c80a9 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/EvFormOdd.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/EvFormOdd.lean @@ -18,7 +18,7 @@ structure map is the standard form's odd block — the symplectic entries. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/EvLeaf.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/EvLeaf.lean index a10eff0ce8..831e8e87eb 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/EvLeaf.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/EvLeaf.lean @@ -18,7 +18,7 @@ evenness; the pure branches route through the one-position basis presentations and the standard-form identification. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/FibreParam.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/FibreParam.lean index 8727159ec3..de88fd604b 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/FibreParam.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/FibreParam.lean @@ -16,7 +16,7 @@ flags carry the odd edge colour on the representative slot and its partner on the partner slot; the rest carry the even colour. -/ -@[expose] public section +public section namespace RS @@ -26,6 +26,7 @@ open CategoryTheory Finset variable {k ℓ : ℕ} /-- The colouring of an edge subset with colouring data. -/ +@[expose] noncomputable def colouringOf (W : ClosedFragment) (F : EdgeSubset W) (ψ : F.EvenColouring k) (φ : F.OddColouring ℓ) : @@ -123,6 +124,7 @@ theorem colouringOf_isEven (W : ClosedFragment) /-- The diagonal partner of a colour: even colours repeat, odd colours pair symplectically. -/ +@[expose] def diagPartner (x : Fin k ⊕ Fin (2 * ℓ)) : Fin k ⊕ Fin (2 * ℓ) := match x with @@ -131,6 +133,7 @@ def diagPartner (x : Fin k ⊕ Fin (2 * ℓ)) : /-- Diagonal colourings: the partner slot carries the diagonal partner of the representative slot. -/ +@[expose] def Diagonal (W : ClosedFragment) (c : MixedColouring k ℓ (edgeCount W + edgeCount W)) : Prop := diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/FlagEnum.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/FlagEnum.lean index ec3bb04182..c029af92cd 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/FlagEnum.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/FlagEnum.lean @@ -17,7 +17,7 @@ are duplicate-free lists of the participating flags at a vertex: the raw material for the canonical index permutation between them. -/ -@[expose] public section +public section namespace RS @@ -175,6 +175,7 @@ variable {k ℓ : ℕ} open Classical in /-- The block-slot enumeration: the participating slots of a block in slot order, as flags. -/ +@[expose] noncomputable def blockOddFlagList (W : ClosedFragment) (F : EdgeSubset W) (v : Fin (ds W).length) : List {f : W.Flag // f ∈ F.flags} := diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/GlobalSlotList.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/GlobalSlotList.lean index 728ba5f981..653e946bd8 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/GlobalSlotList.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/GlobalSlotList.lean @@ -16,7 +16,7 @@ The participating flags of an edge subset, enumerated in slot order, and the link between the pattern inversion count and list inversions. -/ -@[expose] public section +public section namespace RS @@ -37,6 +37,7 @@ theorem mem_partSlots {W : ClosedFragment} {F : EdgeSubset W} exact ⟨fun h => h.2, fun h => ⟨Finset.mem_univ _, h⟩⟩ /-- The global slot list: participating flags in slot order. -/ +@[expose] noncomputable def globalSlotList (W : ClosedFragment) (F : EdgeSubset W) : List {f : W.Flag // f ∈ F.flags} := ((partSlots W F).sort (· ≤ ·)).pmap diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/HRS.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/HRS.lean index e3d2dcd83c..cec7b25590 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/HRS.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/HRS.lean @@ -21,7 +21,7 @@ Lemma 5.7 proves the change of basis and the invariance of the partition function under the isometry `Ψ`. -/ -@[expose] public section +public section namespace RS @@ -33,6 +33,7 @@ variable (e' : P.ω.obj (SkeinObj.mk 1) ⟶ stdSuperPair k ℓ) /-- The star coordinate: the vertex star vector transported to the colouring model, read at a colouring; zero on odd-parity colourings. -/ +@[expose] noncomputable def starCoord (d : ℕ) (c : MixedColouring k ℓ d) : ℂ := if hc : c.IsEven then diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/IndexPerm.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/IndexPerm.lean index 59c7efd20c..d1ffe1835e 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/IndexPerm.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/IndexPerm.lean @@ -19,7 +19,7 @@ any injective relabelling differ by exactly it, and the sign is multiplicative along a chain of reorderings. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ListSignPerm.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ListSignPerm.lean index 08d10330a8..705a89d701 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ListSignPerm.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ListSignPerm.lean @@ -18,7 +18,7 @@ adjacent transpositions, where the two lists differ by one swap and the sorting signs by one factor of `−1`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/MasterSum.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/MasterSum.lean index a80c8f9f7d..d3f8d1e35c 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/MasterSum.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/MasterSum.lean @@ -16,7 +16,7 @@ expansion through the closed form, the permutation and cast transports, and the star-vector coordinates. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ModelCoord.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ModelCoord.lean index 0d677239fd..5f8cf3293f 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ModelCoord.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ModelCoord.lean @@ -18,7 +18,7 @@ coordinates over the degree blocks: the merge coordinate product rule threaded through the sum casts and the block enumeration. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ModelPermCoord.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ModelPermCoord.lean index 31c050c53f..7a47e3d57e 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ModelPermCoord.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ModelPermCoord.lean @@ -16,7 +16,7 @@ The model permutation map acts on coordinates by the adjacent-word sign and the permutation reindex. -/ -@[expose] public section +public section open CategoryTheory diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ModelStarVec.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ModelStarVec.lean index c1fe0287ed..90f7779004 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ModelStarVec.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ModelStarVec.lean @@ -18,7 +18,7 @@ fibre-side assembled vector. This is the form on which the colouring coordinates evaluate. -/ -@[expose] public section +public section namespace RS @@ -32,6 +32,7 @@ variable (e : stdSuperPair k ℓ ⟶ P.ω.obj (SkeinObj.mk 1)) variable (e' : P.ω.obj (SkeinObj.mk 1) ⟶ stdSuperPair k ℓ) /-- The assembled star vector, in the model. -/ +@[expose] noncomputable def modelStarVec : (ds : List ℕ) → (superPow (stdSuperPair k ℓ) ds.sum).even | [] => (1 : ℂ) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/MultiStar.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/MultiStar.lean index 1780f695c2..c5dfae92f1 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/MultiStar.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/MultiStar.lean @@ -17,12 +17,13 @@ by an assignment map. This is the bridge between the explosion machinery and the vertex-star factorization. -/ -@[expose] public section +public section namespace RS /-- A multi-star: `n` pendant edges with a vertex assignment and a free-circle count. -/ +@[expose] def multiStar {V : Type} [Fintype V] {n : ℕ} (assign : Fin n → V) (c : ℕ) : Fragment (Fin n) where Flag := Fin n ⊕ Fin n @@ -45,6 +46,7 @@ def multiStar {V : Type} [Fintype V] {n : ℕ} /-- The inner-flag enumeration of the star union: original flags through the star enumeration. -/ +@[expose] noncomputable def starFlagEnum (W : ClosedFragment) : W.Flag ≃ Fin (edgeCount W + edgeCount W) := (_root_.Equiv.subtypeUnivEquiv @@ -52,6 +54,7 @@ noncomputable def starFlagEnum (W : ClosedFragment) : /-- The vertex assignment of the star union: each slot's original flag sits at its vertex. -/ +@[expose] noncomputable def starAssign (W : ClosedFragment) : Fin (edgeCount W + edgeCount W) → W.Vertex := fun i => ClosedFragment.vertexOf W ((starFlagEnum W).symm i) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/NFDef.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/NFDef.lean index 385e2b8bfa..c77aacbded 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/NFDef.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/NFDef.lean @@ -20,7 +20,7 @@ interface: the normal form is manifestly independent of the transition system and orientation. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/NFValue.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/NFValue.lean index 0d4503546d..de7bd55f64 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/NFValue.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/NFValue.lean @@ -17,7 +17,7 @@ summand equals the (κ, o)-free normal form — the engine of Eulerian independence. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OddFlip.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OddFlip.lean index 9e4d137516..482bb2efeb 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OddFlip.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OddFlip.lean @@ -16,7 +16,7 @@ colourings, so summing a value over the colourings is invariant under it — the reindexing the circuit-sign computation uses. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OddListMultiset.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OddListMultiset.lean index c0373f6ba9..555f6cbc72 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OddListMultiset.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OddListMultiset.lean @@ -18,7 +18,7 @@ order forgotten — the form in which two orientations' lists can be compared, since only the order distinguishes them. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OddPair.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OddPair.lean index 8bd94a7b28..0ba6c18c57 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OddPair.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OddPair.lean @@ -17,7 +17,7 @@ odd parts (the unit has no odd part). This disposes of the cross-split odd basis terms in the cap recursion. -/ -@[expose] public section +public section namespace RS @@ -26,6 +26,7 @@ open MonoidalCategory open scoped TensorProduct /-- The even element carried by a pair of odd vectors. -/ +@[expose] def oddPair {V W : SuperVect} (v : V.odd) (w : W.odd) : (SuperVect.tensorObj V W).even := (0, v ⊗ₜ[ℂ] w) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OddSignProd.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OddSignProd.lean index 8a435f0d4c..dd7148be53 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OddSignProd.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OddSignProd.lean @@ -12,7 +12,7 @@ public import LeanPool.RegtsSevenster.RS.Novel.Skein.TransitionExists # Product of odd signs over vertices equals product over outgoing flags -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OmegaCotensor.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OmegaCotensor.lean index cc3a55a9a5..d373243574 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OmegaCotensor.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OmegaCotensor.lean @@ -18,7 +18,7 @@ first — every rewrite fires over generic instances — then the strict skein unit and the concrete SuperVect unitor. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OmegaStarVec.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OmegaStarVec.lean index e46c350ef1..ec3700216c 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OmegaStarVec.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OmegaStarVec.lean @@ -19,7 +19,7 @@ times the cap functional evaluated on the sorted assembled vector — arc (b) of the extraction, complete. -/ -@[expose] public section +public section namespace RS @@ -30,6 +30,7 @@ variable {R : ℕ} (f : EdgeRankParameter R) variable (P : DelignePackage (SkeinObj f)) /-- The assembled star vector of a degree list. -/ +@[expose] noncomputable def omegaStarVec : (ds : List ℕ) → (P.ω.obj (SkeinObj.mk ds.sum)).even | [] => omegaVec f P (𝟙 (SkeinObj.mk 0)) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OmegaTensor.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OmegaTensor.lean index cd5bc75279..9d9e562286 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OmegaTensor.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OmegaTensor.lean @@ -18,7 +18,7 @@ where every rewrite fires — and the strictness of the skein unit is exploited only in two small concrete bridging steps. -/ -@[expose] public section +public section namespace RS @@ -26,6 +26,7 @@ open CategoryTheory Functor.LaxMonoidal Functor.OplaxMonoidal open MonoidalCategory /-- The even component of a tensor of even vectors. -/ +@[expose] def evenPair {V W : SuperVect} (v : V.even) (w : W.even) : (SuperVect.tensorObj V W).even := (v ⊗ₜ[ℂ] w, 0) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OmegaTransport.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OmegaTransport.lean index d3e1401de5..9cb60e4fcb 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OmegaTransport.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OmegaTransport.lean @@ -20,7 +20,7 @@ compose to the parameter value times the identity of the image of the unit object. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OneBasis.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OneBasis.lean index 786237cc8a..f918f83d6b 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OneBasis.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OneBasis.lean @@ -16,7 +16,7 @@ unit-padded standard basis vectors: the single-layer computation of `colourPowerEquiv 1` on padded pure tensors. -/ -@[expose] public section +public section namespace RS @@ -25,10 +25,12 @@ open scoped TensorProduct variable {k ℓ : ℕ} /-- The one-position even colouring. -/ +@[expose] def oneColourE (k ℓ : ℕ) (i : Fin k) : MixedColouring k ℓ 1 := fun _ => Sum.inl i /-- The one-position odd colouring. -/ +@[expose] def oneColourO (k ℓ : ℕ) (a : Fin (2 * ℓ)) : MixedColouring k ℓ 1 := fun _ => Sum.inr a @@ -189,12 +191,7 @@ theorem oddBasisVec_one (a : Fin (2 * ℓ)) : {c : MixedColouring k ℓ 1 // ¬ c.IsEven}) = oddUnitPad (stdF ℓ a) := by apply (colourPowerEquiv k ℓ 1).oddEquiv.injective - rw [show (colourPowerEquiv k ℓ 1).oddEquiv - (oddBasisVec (⟨oneColourO k ℓ a, - oneColourO_not_isEven a⟩ : - {c : MixedColouring k ℓ 1 // ¬ c.IsEven})) = - Pi.single ⟨oneColourO k ℓ a, oneColourO_not_isEven a⟩ 1 from - (colourPowerEquiv k ℓ 1).oddEquiv.apply_symm_apply _] + rw [colourPowerEquiv_oddBasisVec] funext ⟨c', hc'⟩ change _ = ((colourPowerEquiv k ℓ 1).oddEquiv (oddUnitPad (stdF ℓ a)) ⟨c', hc'⟩) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OrbitCard.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OrbitCard.lean index 58bf861f66..60ce283b56 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OrbitCard.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OrbitCard.lean @@ -25,7 +25,7 @@ rotation on labels, say — since a bijection of quotients is then enough. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OutSignEdges.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OutSignEdges.lean index bdfb3db833..19c76bff20 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OutSignEdges.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/OutSignEdges.lean @@ -17,7 +17,7 @@ contributes the sign of its (pairing-constant) colour exactly once, and non-participating edges contribute 1 on both sides. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/PairEnum.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/PairEnum.lean index ce0eeb0df9..a289f6c558 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/PairEnum.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/PairEnum.lean @@ -16,7 +16,7 @@ per-flag value map over an explicit flag list: the incoming flags in the fixed order, each followed by its match. -/ -@[expose] public section +public section namespace RS @@ -66,6 +66,7 @@ private theorem flatMap_congr' {γ δ : Type*} (l : List γ) open Classical in /-- The flag list underlying the odd list at a vertex: the incoming flags in the fixed order, each followed by its match. -/ +@[expose] noncomputable def pairFlagList (o : κ.Orientation) (v : W.Vertex) : List {f : W.Flag // f ∈ F.flags} := ((F.inFlagsAt o v).attachWith (· ∈ F.flags) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/PairList.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/PairList.lean index 1762f1b0db..2ac7eccb3c 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/PairList.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/PairList.lean @@ -16,7 +16,7 @@ The edge and oriented pair lists enumerate each participating flag exactly once. The slot helpers identify the two ends of each edge. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ParameterModel.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ParameterModel.lean index 207ec42a5d..964a5d33f8 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ParameterModel.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ParameterModel.lean @@ -17,7 +17,7 @@ assembled star vector acted on by the sort's model permutation word and the degree-sum cast — pushed forward once. -/ -@[expose] public section +public section namespace RS @@ -32,6 +32,7 @@ variable (e' : P.ω.obj (SkeinObj.mk 1) ⟶ stdSuperPair k ℓ) /-- The model action of a permutation: trivial at arity zero, the braiding word of the adjacent-transposition word above. -/ +@[expose] noncomputable def modelPermMap : {n : ℕ} → (σ : _root_.Equiv.Perm (Fin n)) → (superPow (stdSuperPair k ℓ) n ⟶ superPow (stdSuperPair k ℓ) n) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/PatternInv.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/PatternInv.lean index ee79342fa2..3fb089f5d5 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/PatternInv.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/PatternInv.lean @@ -16,7 +16,7 @@ the pattern: the sort-permutation's odd inversions count pairs of participating slots, a pure `(W, F)` quantity. -/ -@[expose] public section +public section namespace RS @@ -27,6 +27,7 @@ variable {k ℓ : ℕ} open Classical in /-- The pattern inversion count of an edge subset: inverted sort pairs of participating slots. -/ +@[expose] noncomputable def patternOddInv (W : ClosedFragment) (F : EdgeSubset W) : ℕ := (Finset.univ.filter diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/PowMerge.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/PowMerge.lean index eea1fe66d5..172e66261c 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/PowMerge.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/PowMerge.lean @@ -17,7 +17,7 @@ compatibility with the model transport: transporting blockwise and merging through the structure map agrees with merging first. -/ -@[expose] public section +public section namespace RS @@ -25,6 +25,7 @@ open CategoryTheory MonoidalCategory open Functor.LaxMonoidal Functor.OplaxMonoidal /-- The block merge of monoidal powers. -/ +@[expose] noncomputable def powMerge (V : SuperVect) : (a b : ℕ) → (superPow V a ⊗ superPow V b ⟶ superPow V (a + b)) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/RegroupSign.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/RegroupSign.lean index 2311f12080..f05067f68f 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/RegroupSign.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/RegroupSign.lean @@ -34,7 +34,7 @@ Both run on the flat-map presentations of the three lists and on the index arithmetic of a list of pairs. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/Reindex.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/Reindex.lean index 7f3a09d8ac..93a5b9ecca 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/Reindex.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/Reindex.lean @@ -17,7 +17,7 @@ The master summand, the flag pattern of a colouring, and the fibrewise partition of the master colour sum over flag patterns. -/ -@[expose] public section +public section namespace RS @@ -31,6 +31,7 @@ variable (e : stdSuperPair k ℓ ⟶ P.ω.obj (SkeinObj.mk 1)) variable (e' : P.ω.obj (SkeinObj.mk 1) ⟶ stdSuperPair k ℓ) /-- The master summand of a colouring. -/ +@[expose] noncomputable def masterSummand (W : ClosedFragment) (c : MixedColouring k ℓ (edgeCount W + edgeCount W)) : ℂ := @@ -63,6 +64,7 @@ theorem parameter_masterSummand (W : ClosedFragment) open Classical in /-- The flag pattern of a colouring: the flags at odd slots. -/ +@[expose] noncomputable def colourFlags (W : ClosedFragment) (c : MixedColouring k ℓ (edgeCount W + edgeCount W)) : Finset W.Flag := @@ -84,6 +86,7 @@ theorem masterSum_partition (W : ClosedFragment) : (Finset.sum_fiberwise _ _ _).symm /-- Parity purity: cap-paired slots share parity. -/ +@[expose] def PairPure {m : ℕ} (c : MixedColouring k ℓ (m + m)) : Prop := ∀ i : Fin m, diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ReindexBij.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ReindexBij.lean index 53f125efe3..20c6a01150 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ReindexBij.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ReindexBij.lean @@ -15,7 +15,7 @@ Closed-pattern fibres are pure; their sums reindex over the colouring data through the diagonal parametrization. -/ -@[expose] public section +public section namespace RS @@ -175,6 +175,7 @@ theorem fibreSum_eq_dataSum (W : ClosedFragment) open Classical in /-- The edge set of an edge subset: representative slots whose flags participate. -/ +@[expose] noncomputable def edgeIndexSet (W : ClosedFragment) (F : EdgeSubset W) : Finset (Fin (edgeCount W)) := Finset.univ.filter (fun i => diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ReindexHeart.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ReindexHeart.lean index 5640c3190b..7c60df4791 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ReindexHeart.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ReindexHeart.lean @@ -17,7 +17,7 @@ and the identification of the parameter with Definition 5's mixed partition function. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ReindexVanish.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ReindexVanish.lean index 9111d0dc50..1472ec7d3f 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ReindexVanish.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/ReindexVanish.lean @@ -17,7 +17,7 @@ Non-Eulerian patterns kill every master summand in their fibre: the odd-degree vertex is a block of odd parity. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/RepFlag.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/RepFlag.lean index 8ed4ef545e..f1d0e2aa99 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/RepFlag.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/RepFlag.lean @@ -18,7 +18,7 @@ the pairing — it is the flip set aligning the data colouring with the Definition 5 odd lists. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/RiffleSign.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/RiffleSign.lean index 0e38cad185..00340137e4 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/RiffleSign.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/RiffleSign.lean @@ -18,7 +18,7 @@ from edge-interleaved to oriented order has sign `(−1)^s` where `s` is the number of edges whose representative flag is outgoing. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/SignPair.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/SignPair.lean index a969ff94ff..2fa379d74f 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/SignPair.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/SignPair.lean @@ -17,7 +17,7 @@ their mapped sorting signs is the reindexing permutation's sign: the transport plus a square. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/SkeinPowBraid.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/SkeinPowBraid.lean index 5ec2ac8e76..84fac98c21 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/SkeinPowBraid.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/SkeinPowBraid.lean @@ -21,7 +21,7 @@ strictness of the skein associator enters only through a small concrete collapse. -/ -@[expose] public section +public section namespace RS @@ -74,6 +74,7 @@ theorem braid_top_intertwine {C D : Type*} [Category C] variable {R : ℕ} (f : EdgeRankParameter R) /-- The skein-side adjacent braiding at position `i`. -/ +@[expose] noncomputable def skeinPowBraid : (n : ℕ) → (i : ℕ) → i + 2 ≤ n → ((SkeinObj.mk n : SkeinObj f) ⟶ SkeinObj.mk n) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/SlotPairing.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/SlotPairing.lean index 6379f9742d..2d6f07e851 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/SlotPairing.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/SlotPairing.lean @@ -17,7 +17,7 @@ slots `i` and `edgeCount + i`. The general-flag glue for the Eulerian reindex. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/SortFactor.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/SortFactor.lean index 1705530cb8..e015c9b633 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/SortFactor.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/SortFactor.lean @@ -19,7 +19,7 @@ with the free circles split off. Specialised to the star union this is the fragment-level star factorization. -/ -@[expose] public section +public section namespace RS @@ -28,6 +28,7 @@ section SortEquiv variable {n m : ℕ} (assign : Fin n → Fin m) /-- The full sort: slots to the block-concatenated enumeration. -/ +@[expose] noncomputable def sortEquiv : Fin n ≃ Fin (degList assign).sum := (sortSigma assign).trans (blockSigmaEquiv (degList assign)) @@ -80,6 +81,7 @@ noncomputable def multiStarVertexMap {V V' : Type} circles_eq := rfl /-- The star union's assignment, with vertices enumerated. -/ +@[expose] noncomputable def starAssignEnum (W : ClosedFragment) : Fin (edgeCount W + edgeCount W) → Fin (Fintype.card W.Vertex) := diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/SortPerm.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/SortPerm.lean index 8092039536..d7d982b415 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/SortPerm.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/SortPerm.lean @@ -16,7 +16,7 @@ permutation followed by the degree-sum cast, feeding the braiding-word transport and the cast transport respectively. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/StarClassFactor.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/StarClassFactor.lean index a126cc89d0..b6afe7e614 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/StarClassFactor.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/StarClassFactor.lean @@ -17,7 +17,7 @@ power times the iterated vertex-star tensor class composed with the bundle map of the sort. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/StarPeel.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/StarPeel.lean index b33886ef14..960e83677a 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/StarPeel.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/StarPeel.lean @@ -17,11 +17,12 @@ block, `starTensor` is the iterated tensor, and the peel induction identifies them. -/ -@[expose] public section +public section namespace RS /-- The block of a slot in a degree list. -/ +@[expose] def blockAssign : (ds : List ℕ) → Fin ds.sum → Fin ds.length | [], i => i.elim0 | d :: ds, i => @@ -32,6 +33,7 @@ def blockAssign : (ds : List ℕ) → Fin ds.sum → Fin ds.length omega⟩).succ /-- The iterated tensor of vertex stars over a degree list. -/ +@[expose] noncomputable def starTensor : (ds : List ℕ) → Fragment (Fin ds.sum) | [] => emptyClosedFragment diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/StarPerm.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/StarPerm.lean index 0e45e3e0ac..ad2061fb03 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/StarPerm.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/StarPerm.lean @@ -16,7 +16,7 @@ intertwines permutations, and hence the star coordinate at a permuted colouring is the odd-inversion sign times the original. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/StarRepeat.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/StarRepeat.lean index df0384aea1..3ebdb6ac59 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/StarRepeat.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/StarRepeat.lean @@ -16,7 +16,7 @@ inversion count is the both-odd indicator, so a colouring fixed by an adjacent swap of equal odd colours equals its own negation. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/StarSymm.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/StarSymm.lean index 27134de5cb..b972a9856d 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/StarSymm.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/StarSymm.lean @@ -17,7 +17,7 @@ the S_d-invariance that makes the vertex coordinates well defined on multiset data. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/StarTensorClass.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/StarTensorClass.lean index 27ce6170ad..6ea44c54e1 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/StarTensorClass.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/StarTensorClass.lean @@ -17,13 +17,14 @@ tensor of the vertex-star class with the tail, composed with the sum cast. -/ -@[expose] public section +public section namespace RS variable {R : ℕ} (f : EdgeRankParameter R) /-- The vertex-star class: a `(0, d)`-morphism. -/ +@[expose] noncomputable def vertexStarClass (d : ℕ) : HomSpace f.val (0 + d) := HomSpace.ofFragment f.val diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/StdTransport.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/StdTransport.lean index ad2ebda2ef..b4171a1ed9 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/StdTransport.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/StdTransport.lean @@ -19,7 +19,7 @@ structure maps of the fibre functor, `stdFromOmega` disassembles, and the two are mutually inverse whenever the strand maps are. -/ -@[expose] public section +public section namespace RS @@ -37,6 +37,7 @@ variable (e' : P.ω.obj (SkeinObj.mk 1) ⟶ stdSuperPair k ℓ) /-- The model transport: iterated strand identifications assembled left-nested through the structure maps. -/ +@[expose] noncomputable def stdToOmega : (m : ℕ) → (superPow (stdSuperPair k ℓ) m ⟶ P.ω.obj (SkeinObj.mk m)) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/StrandTransport.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/StrandTransport.lean index b3a3f9d247..84f521b861 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/StrandTransport.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/StrandTransport.lean @@ -17,7 +17,7 @@ strict skein unitor eliminated. Its even and odd evaluations on unit-padded vectors are the strand identification itself. -/ -@[expose] public section +public section namespace RS @@ -84,6 +84,7 @@ theorem stdToOmega_one_even (x : (stdSuperPair k ℓ).even) : exact (TensorProduct.lid_tmul _ _).trans (one_smul _ _) /-- The unit-padded odd element. -/ +@[expose] def oddUnitPad {V : SuperVect} (y : V.odd) : (SuperVect.tensorObj SuperVect.tensorUnit V).odd := ((1 : ℂ) ⊗ₜ[ℂ] y, 0) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/TauCount.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/TauCount.lean index df5b6599df..073b0eeddc 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/TauCount.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/TauCount.lean @@ -16,7 +16,7 @@ Combinatorial lemmas connecting the tau-sign product over vertices to the number of outgoing flags, via the incoming/outgoing partition. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/TauKey.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/TauKey.lean index 33b17757c1..faf6256fc4 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/TauKey.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/TauKey.lean @@ -18,7 +18,7 @@ the canonical index permutation's sign is the key-sortSign of the pair enumeration alone. -/ -@[expose] public section +public section namespace RS @@ -27,6 +27,7 @@ open Finset variable {k ℓ : ℕ} /-- The sorted-position key of a flag. -/ +@[expose] noncomputable def sortKey (W : ClosedFragment) (f : W.Flag) : Fin (ds W).sum := sortEquiv (starAssignEnum W) (starFlagEnum W f) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/TopBraidMerge.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/TopBraidMerge.lean index 1ca99a9c74..f2312c8149 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/TopBraidMerge.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/TopBraidMerge.lean @@ -17,7 +17,7 @@ merging equals merging and braiding on top. Abstract braided coherence first, instantiated to the powers. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/TwoBasis.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/TwoBasis.lean index b6dd3104a3..690354a376 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/TwoBasis.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/TwoBasis.lean @@ -16,7 +16,7 @@ structure `(superPow V 1) ⊗ V`: nested unit-padded standard basis vectors, one lemma per parity pattern. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/VertexSign.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/VertexSign.lean index f18d1c09c0..2218087bb3 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/VertexSign.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/VertexSign.lean @@ -18,7 +18,7 @@ of the two flag enumerations, so the reindexing sign transports between them, and the block enumeration is key-sorted. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/VertexValue.lean b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/VertexValue.lean index 14d91ed49f..d45d658731 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Coordinates/VertexValue.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Coordinates/VertexValue.lean @@ -18,7 +18,7 @@ the canonical colouring, whose star coordinate the functional `hRS` evaluates. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/AtomDichotomy.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/AtomDichotomy.lean index b392cbc417..bfd6506d06 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/AtomDichotomy.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/AtomDichotomy.lean @@ -20,7 +20,7 @@ isomorphism. This is the engine turning the atomic idempotent decomposition into a semisimple-category structure. -/ -@[expose] public section +public section namespace RS @@ -115,7 +115,7 @@ theorem atom_iso_of_ne_zero {S T : Karoubi (SkeinObj f)} /-- The Karoubi object cut out of `X` by an idempotent of its endomorphism algebra. -/ -@[reducible] noncomputable def cutBy (X : Karoubi (SkeinObj f)) +@[expose, reducible] noncomputable def cutBy (X : Karoubi (SkeinObj f)) {eK : End X} (he : IsIdempotentElem eK) : Karoubi (SkeinObj f) where X := X.X diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/AtomicIdempotents.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/AtomicIdempotents.lean index 9478a6aa0e..6cca45f7f0 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/AtomicIdempotents.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/AtomicIdempotents.lean @@ -18,7 +18,7 @@ Wedderburn–Artin. These are the atoms along which Karoubi objects split into simples. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/BlockAssembly.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/BlockAssembly.lean index 977a5677bd..8474e7981f 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/BlockAssembly.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/BlockAssembly.lean @@ -21,7 +21,7 @@ proof at every strand arity. The mainline semisimplicity proof uses the factorial argument in `BlockFactorialTrace`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/BlockBounds.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/BlockBounds.lean index 004efff5dc..4cc5c528fa 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/BlockBounds.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/BlockBounds.lean @@ -20,7 +20,7 @@ containment. Both are stated against an arbitrary target algebra; the skein endomorphism algebras are substituted downstream. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/BlockCycle.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/BlockCycle.lean index c57f4db3e8..c67eb86cda 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/BlockCycle.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/BlockCycle.lean @@ -25,7 +25,7 @@ into the tuple's cyclic composite, which for a constant tuple is a power. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/BlockFactor.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/BlockFactor.lean index 8959e23d4d..07ad9a340c 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/BlockFactor.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/BlockFactor.lean @@ -21,7 +21,7 @@ slices carry `finCongr` casts because `n·(a+b) = n·a + n·b` is propositional, managed by the arity-cast transport `endCast`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/BlockFactorialTrace.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/BlockFactorialTrace.lean index c54edde0ac..f252697691 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/BlockFactorialTrace.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/BlockFactorialTrace.lean @@ -20,7 +20,7 @@ connection pairing supplies semisimplicity by the trace criterion. The Schur and trace-zeta proof remains in `BlockAssembly`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/BlockSplice.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/BlockSplice.lean index 11dc97aa49..2d8d282f7c 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/BlockSplice.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/BlockSplice.lean @@ -26,7 +26,7 @@ rotation as through-strands tensored with `K` cups, and the same after the outer relabel is collapsed. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/BlockTower.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/BlockTower.lean index 7560c42480..ba634f3171 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/BlockTower.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/BlockTower.lean @@ -22,7 +22,7 @@ so the recursive block constructions live at the same indices as the tensor structure. -/ -@[expose] public section +public section namespace RS @@ -52,6 +52,7 @@ theorem blockPerm_mul (n : ℕ) {k : ℕ} simp [blockPerm] /-- The block-permutation monoid homomorphism. -/ +@[expose] noncomputable def blockPermHom (n k : ℕ) : Equiv.Perm (Fin k) →* Equiv.Perm (Fin (n * k)) where toFun := blockPerm n @@ -112,6 +113,7 @@ theorem blockRep_of (n k : ℕ) (σ : Equiv.Perm (Fin k)) : /-! ### The block-diagonal power -/ /-- The End-typed tensor at block arities. -/ +@[expose] noncomputable def blockTensorEnd {a b : ℕ} (u : skeinEnd f a) (v : skeinEnd f b) : skeinEnd f (a + b) := @@ -123,6 +125,7 @@ noncomputable def blockTensorEnd {a b : ℕ} /-- The block-diagonal tensor power: `k` copies of an `n`-strand endomorphism. The index arithmetic is definitional: `n * (k + 1) ≡ n * k + n`. -/ +@[expose] noncomputable def blockPow (n : ℕ) (g : skeinEnd f n) : (k : ℕ) → skeinEnd f (n * k) | 0 => 1 @@ -304,6 +307,7 @@ theorem blockRep_compat (n : ℕ) {j k : ℕ} (h : j ≤ k) /-- **The block permutation tower**: `S_k` acting by block permutations on the `n·k`-strand endomorphism algebras, of growth `(R ^ n) ^ 2`. -/ +@[expose] noncomputable def blockPermTower (n : ℕ) : PermTower (fun k => skeinEnd f (n * k)) (((R : ℝ) ^ n) ^ 2) where rep k := blockRep f n k diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/CycleNormal.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/CycleNormal.lean index 8d5a261506..252199ed2d 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/CycleNormal.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/CycleNormal.lean @@ -17,7 +17,7 @@ the normal form against which the skein trace of a permutation factors into cycle loops. -/ -@[expose] public section +public section namespace RS @@ -25,6 +25,7 @@ open Equiv Equiv.Perm /-- The block sum of rotations prescribed by a list of block lengths. -/ +@[expose] noncomputable def blockCycles : (l : List ℕ) → Perm (Fin l.sum) | [] => 1 | c :: rest => @@ -34,6 +35,7 @@ noncomputable def blockCycles : (l : List ℕ) → Perm (Fin l.sum) /-- The full cycle type: the cycle type completed by the fixed points as one-cycles. -/ +@[expose] noncomputable def fullCycleType {n : ℕ} (π : Perm (Fin n)) : Multiset ℕ := π.cycleType + Multiset.replicate (n - π.cycleType.sum) 1 diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/CycleTrace.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/CycleTrace.lean index 70b9128377..9541fdfb20 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/CycleTrace.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/CycleTrace.lean @@ -26,7 +26,7 @@ arbitrary endomorphism on the top factor through the induction is what makes the accumulated copies of `g` bookkeepable. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/EnvAbelian.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/EnvAbelian.lean index 8377d566ab..308df90ee1 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/EnvAbelian.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/EnvAbelian.lean @@ -21,7 +21,7 @@ endomorphism algebra, and kernels are the splittings of the regular idempotents. -/ -@[expose] public section +public section namespace RS @@ -72,7 +72,7 @@ decomposition of each matrix entry `NilpotentMatTrace.lean`). The outer Karoubi is still needed: the additive envelope of an idempotent-complete category need not be idempotent-complete. -/ -@[reducible] def Env := Karoubi (Mat_ (Karoubi (SkeinObj f))) +@[expose, reducible] def Env := Karoubi (Mat_ (Karoubi (SkeinObj f))) /-! ### Semisimplicity of envelope endomorphism algebras -/ @@ -304,7 +304,7 @@ noncomputable def envNormalEpi {M N : Env f} (e : M ⟶ N) [Epi e] : /-- **The envelope is abelian**, from the factorial trace obstruction and the connection pairing. -/ -@[reducible] +@[expose, reducible] noncomputable def envAbelian : Abelian (Env f) := by haveI : HasFiniteBiproducts (Env f) := inferInstance diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/EnvDeligne.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/EnvDeligne.lean index 3e53b315c9..20c3d5f10c 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/EnvDeligne.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/EnvDeligne.lean @@ -25,7 +25,7 @@ and moderate growth in `EnvGrowth.lean`; `EnvDelignePackage.lean` feeds all five to the cited statement. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/EnvDelignePackage.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/EnvDelignePackage.lean index 1c8b4368a6..d59c78af8a 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/EnvDelignePackage.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/EnvDelignePackage.lean @@ -28,7 +28,7 @@ only transcendental input, applied to the concretely constructed envelope. -/ -@[expose] public section +public section namespace RS @@ -38,6 +38,7 @@ variable {R : ℕ} (f : EdgeRankParameter R) /-- The braided linear embedding of the skein category into its envelope. -/ +@[expose] noncomputable def skeinToEnv : SkeinObj f ⥤ Env f := toKaroubi (SkeinObj f) ⋙ Mat_.embedding (Karoubi (SkeinObj f)) ⋙ diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/EnvGenerator.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/EnvGenerator.lean index 64616a8561..9df4f11c77 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/EnvGenerator.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/EnvGenerator.lean @@ -18,7 +18,7 @@ power of the single strand, up to canonical isomorphism. This is the spine of the Deligne generator and moderate-growth fields. -/ -@[expose] public section +public section namespace RS @@ -40,10 +40,12 @@ theorem karoubi_obj_ext {D : Type u} [Category.{v} D] {X : D} /-! ### The embedded strands -/ /-- The embedded `n`-strand object of the corner category. -/ +@[expose] noncomputable def strandK (n : ℕ) : Karoubi (SkeinObj f) := (toKaroubi (SkeinObj f)).obj (SkeinObj.mk n) /-- The embedded `n`-strand object of the envelope. -/ +@[expose] noncomputable def envStrand (n : ℕ) : Env f := (toKaroubi (Mat_ (Karoubi (SkeinObj f)))).obj ((Mat_.embedding (Karoubi (SkeinObj f))).obj (strandK f n)) @@ -61,6 +63,7 @@ variable {D : Type u} /-- The diagonal comparison from the tensor of embeddings to the embedding of the tensor. -/ +@[expose] noncomputable def matEmbTensorHom [Category.{v} D] [Preadditive D] [MonoidalCategory D] (x y : D) : @@ -79,6 +82,7 @@ noncomputable def matEmbTensorInv /-- The diagonal isomorphism between the tensor of embeddings and the embedding of the tensor. -/ +@[expose] noncomputable def matEmbTensorIso [Category.{v} D] [Preadditive D] [MonoidalCategory D] (x y : D) : diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/EnvGrowth.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/EnvGrowth.lean index 0798074370..b1d410ca57 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/EnvGrowth.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/EnvGrowth.lean @@ -20,7 +20,7 @@ most `(R+1)^(2m)`; tensor powers multiply index cardinalities and add arities, so the total bound is exponential in the power. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/EnvInstances.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/EnvInstances.lean index 1099db8d2b..a8e929a048 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/EnvInstances.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/EnvInstances.lean @@ -19,7 +19,7 @@ through the Karoubi and matrix layers entrywise, giving the full instance chain for the envelope. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/EnvSemisimple.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/EnvSemisimple.lean index 256bb4af29..dc1d1e7420 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/EnvSemisimple.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/EnvSemisimple.lean @@ -20,7 +20,7 @@ scalar endomorphisms, which is simple because monomorphisms split in the envelope, and the object is the biproduct of its corners. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/FactorialTrace.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/FactorialTrace.lean index 12e18c63b2..58130fb8f1 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/FactorialTrace.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/FactorialTrace.lean @@ -19,7 +19,7 @@ less than `n!`, and hence from exponential endomorphism growth. The Frobenius and trace-zeta route is retained in `ObjectTower`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/Frobenius.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/Frobenius.lean index f45b1d33ee..a5ead54792 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/Frobenius.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/Frobenius.lean @@ -26,7 +26,7 @@ factorization these feed is `BlockFactor.lean`, and the Frobenius identity itself `BlockAssembly.lean`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/HookConfinement.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/HookConfinement.lean index 369668d3e0..a6bff4e52e 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/HookConfinement.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/HookConfinement.lean @@ -28,7 +28,7 @@ propagation no shape containing the square is alive; and a shape outside the hook contains the square. -/ -@[expose] public section +public section namespace RS @@ -53,6 +53,7 @@ namespace PermTower variable {E : ℕ → Type u} /-- A shape is alive in a tower when its idempotent is not killed. -/ +@[expose] def Alive [∀ n, Ring (E n)] [∀ n, Algebra ℂ (E n)] {A : ℝ} (T : PermTower E A) (P : SchurPackage.{u}) (μ : YoungDiagram) : Prop := diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/HookConfinementSharp.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/HookConfinementSharp.lean index e68b59518a..a0678d7f8c 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/HookConfinementSharp.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/HookConfinementSharp.lean @@ -23,7 +23,7 @@ package. The constant here comes from the block dimensions of the assembled package, through `square_growth_sharp`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/KaroubiEmbBraided.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/KaroubiEmbBraided.lean index 8cc029613e..57a5d23c55 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/KaroubiEmbBraided.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/KaroubiEmbBraided.lean @@ -16,7 +16,7 @@ The canonical functor `toKaroubi C` is a braided monoidal functor the Karoubi envelope) and is ℂ-linear. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/KaroubiMonoidal.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/KaroubiMonoidal.lean index 687ee1ee68..384d86894c 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/KaroubiMonoidal.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/KaroubiMonoidal.lean @@ -27,7 +27,7 @@ The canonical functor `toKaroubi C : C ⥤ Karoubi C` is strong monoidal. When `C` is braided (respectively symmetric), so is `Karoubi C`. -/ -@[expose] public section +public section namespace RS @@ -601,6 +601,7 @@ private theorem braid_inv_nat /-- The braiding isomorphism on Karoubi objects, defined prior to the instance so that simp lemmas for the `.f` projection are available inside the axiom proofs. -/ +@[expose] noncomputable def karoubiBraidingIso [Category.{v} C] [MonoidalCategory C] [BraidedCategory C] (X Y : Karoubi C) : diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/KaroubiRigid.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/KaroubiRigid.lean index 8eec1c8969..0137740eeb 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/KaroubiRigid.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/KaroubiRigid.lean @@ -23,7 +23,7 @@ adjoint mate, the second onto the base snake identity. When `C` is moreover braided, `Karoubi C` is rigid. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/KaroubiSemisimple.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/KaroubiSemisimple.lean index 36118054de..43b8560b39 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/KaroubiSemisimple.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/KaroubiSemisimple.lean @@ -20,7 +20,7 @@ cyclicity moves the idempotent across products, so ambient nondegeneracy restricts to the corner. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/MatBraided.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/MatBraided.lean index c1556099dd..2148927410 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/MatBraided.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/MatBraided.lean @@ -16,7 +16,7 @@ When `C` is a braided (resp. symmetric) monoidal preadditive category, so is componentwise braidings of `C`, reindexed by the swap `M.ι × N.ι ↔ N.ι × M.ι`. -/ -@[expose] public section +public section noncomputable section @@ -82,6 +82,7 @@ section Braided open scoped Classical in /-- The matrix morphism that swaps tensor factors using the component braidings. -/ +@[expose] def matBraidHom [Category.{v} C] [Preadditive C] [MonoidalCategory C] [BraidedCategory C] (M N : Mat_ C) : (M ⊗ N : Mat_ C) ⟶ (N ⊗ M : Mat_ C) := @@ -176,6 +177,7 @@ private theorem matBraid_inv_hom · intro b _ hb; simp [show ¬(j₂ = b) from Ne.symm hb] /-- The braiding isomorphism on matrix objects induced by the component braidings. -/ +@[expose] def matBraidIso [Category.{v} C] [Preadditive C] [MonoidalCategory C] [BraidedCategory C] (M N : Mat_ C) : (M ⊗ N : Mat_ C) ≅ (N ⊗ M : Mat_ C) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/MatEmbMonoidal.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/MatEmbMonoidal.lean index 0a3ba43525..d30d752b90 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/MatEmbMonoidal.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/MatEmbMonoidal.lean @@ -28,7 +28,7 @@ automatically derives the full `Functor.Monoidal` structure including the `OplaxMonoidal` fields. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/MatMonoidal.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/MatMonoidal.lean index c9ff460ed6..a4e6feda6d 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/MatMonoidal.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/MatMonoidal.lean @@ -29,7 +29,7 @@ multiplication turns into iterated sums that factor via `tensor_sum` and identities reduce componentwise to the corresponding identities in `C`. -/ -@[expose] public section +public section noncomputable section @@ -48,18 +48,19 @@ variable {C : Type u} /-- Tensor product of objects in `Mat_ C`: index by the product, with componentwise tensor in `C`. -/ -@[reducible] def matTensorObj [Category.{v} C] [MonoidalCategory C] +@[expose, reducible] def matTensorObj [Category.{v} C] [MonoidalCategory C] (M N : Mat_ C) : Mat_ C := ⟨M.ι × N.ι, fun p => M.X p.1 ⊗ N.X p.2⟩ /-- Tensor product of morphisms in `Mat_ C`: the Kronecker product. -/ +@[expose] def matTensorHom [Category.{v} C] [Preadditive C] [MonoidalCategory C] {M₁ N₁ M₂ N₂ : Mat_ C} (f : M₁ ⟶ N₁) (g : M₂ ⟶ N₂) : matTensorObj M₁ M₂ ⟶ matTensorObj N₁ N₂ := fun (i₁, i₂) (j₁, j₂) => f i₁ j₁ ⊗ₘ g i₂ j₂ /-- The tensor unit in `Mat_ C`. -/ -@[reducible] def matTensorUnit +@[expose, reducible] def matTensorUnit [Category.{v} C] [MonoidalCategory C] : Mat_ C := ⟨PUnit, fun _ => 𝟙_ C⟩ /-! ### Structural isomorphisms @@ -70,6 +71,7 @@ of `C`, and all other entries are zero. -/ open scoped Classical in /-- The associator hom in `Mat_ C`. -/ +@[expose] def matAssocHom [Category.{v} C] [Preadditive C] [MonoidalCategory C] (M N K : Mat_ C) : matTensorObj (matTensorObj M N) K ⟶ matTensorObj M (matTensorObj N K) := @@ -85,6 +87,7 @@ def matAssocHom [Category.{v} C] [Preadditive C] [MonoidalCategory C] open scoped Classical in /-- The associator inv in `Mat_ C`. -/ +@[expose] def matAssocInv [Category.{v} C] [Preadditive C] [MonoidalCategory C] (M N K : Mat_ C) : matTensorObj M (matTensorObj N K) ⟶ matTensorObj (matTensorObj M N) K := @@ -100,6 +103,7 @@ def matAssocInv [Category.{v} C] [Preadditive C] [MonoidalCategory C] open scoped Classical in /-- The left unitor hom in `Mat_ C`. -/ +@[expose] def matLeftUnitorHom [Category.{v} C] [Preadditive C] [MonoidalCategory C] (M : Mat_ C) : @@ -111,6 +115,7 @@ def matLeftUnitorHom open scoped Classical in /-- The left unitor inv in `Mat_ C`. -/ +@[expose] def matLeftUnitorInv [Category.{v} C] [Preadditive C] [MonoidalCategory C] (M : Mat_ C) : @@ -122,6 +127,7 @@ def matLeftUnitorInv open scoped Classical in /-- The right unitor hom in `Mat_ C`. -/ +@[expose] def matRightUnitorHom [Category.{v} C] [Preadditive C] [MonoidalCategory C] (M : Mat_ C) : @@ -133,6 +139,7 @@ def matRightUnitorHom open scoped Classical in /-- The right unitor inv in `Mat_ C`. -/ +@[expose] def matRightUnitorInv [Category.{v} C] [Preadditive C] [MonoidalCategory C] (M : Mat_ C) : @@ -267,6 +274,7 @@ private theorem matRightUnitor_inv_hom simp [this, zero_comp] /-- The associator isomorphism in `Mat_ C`. -/ +@[expose] def matAssociator [Category.{v} C] [Preadditive C] [MonoidalCategory C] (M N K : Mat_ C) : matTensorObj (matTensorObj M N) K ≅ matTensorObj M (matTensorObj N K) where @@ -276,6 +284,7 @@ def matAssociator [Category.{v} C] [Preadditive C] [MonoidalCategory C] inv_hom_id := by exact matAssoc_inv_hom M N K /-- The left unitor isomorphism in `Mat_ C`. -/ +@[expose] def matLeftUnitor [Category.{v} C] [Preadditive C] [MonoidalCategory C] (M : Mat_ C) : matTensorObj matTensorUnit M ≅ M where @@ -285,6 +294,7 @@ def matLeftUnitor [Category.{v} C] [Preadditive C] [MonoidalCategory C] inv_hom_id := by exact matLeftUnitor_inv_hom M /-- The right unitor isomorphism in `Mat_ C`. -/ +@[expose] def matRightUnitor [Category.{v} C] [Preadditive C] [MonoidalCategory C] (M : Mat_ C) : matTensorObj M matTensorUnit ≅ M where diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/MatRigid.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/MatRigid.lean index 1eb73a590a..60923c1169 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/MatRigid.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/MatRigid.lean @@ -22,7 +22,7 @@ identity at each index. When `C` is moreover braided, `Mat_ C` is rigid. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/MatSemisimple.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/MatSemisimple.lean index fd4d556aa7..867306a03e 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/MatSemisimple.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/MatSemisimple.lean @@ -18,7 +18,7 @@ trace criterion once nilpotents are known to have vanishing trace, which the atom decomposition supplies. -/ -@[expose] public section +public section namespace RS @@ -68,6 +68,7 @@ noncomputable instance matLinear : /-! ### The diagonal trace -/ /-- The diagonal trace on matrix-envelope endomorphisms. -/ +@[expose] noncomputable def matTrace (M : Mat_ (Karoubi (SkeinObj f))) : End M →ₗ[ℂ] ℂ where toFun φ := ∑ i : M.ι, diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/NilpotentMatTrace.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/NilpotentMatTrace.lean index 2512c6d9e4..a1b78820f8 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/NilpotentMatTrace.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/NilpotentMatTrace.lean @@ -22,7 +22,7 @@ inherits nilpotency — so each class block has vanishing complex trace, and the diagonal trace is the class-weighted sum of those. -/ -@[expose] public section +public section namespace RS @@ -116,11 +116,11 @@ theorem matTrace_resolution variable {f} {M : Mat_ (Karoubi (SkeinObj f))} /-- The total atom index. -/ -@[reducible] def AtomResolution.κ (A : AtomResolution f M) := +@[expose, reducible] def AtomResolution.κ (A : AtomResolution f M) := Σ i : M.ι, A.idx i /-- The atom at a total index. -/ -@[reducible] noncomputable def AtomResolution.S +@[expose, reducible] noncomputable def AtomResolution.S (A : AtomResolution f M) (p : A.κ) : Karoubi (SkeinObj f) := cutBy (f := f) (M.X p.1) (A.atomic p.1 p.2).idem @@ -259,6 +259,7 @@ noncomputable def AtomResolution.w (A : AtomResolution f M) /-! ### The matrix elements -/ /-- The matrix element of an endomorphism at a pair of atoms. -/ +@[expose] noncomputable def AtomResolution.t (A : AtomResolution f M) (φ : End M) (p q : A.κ) : A.S p ⟶ A.S q := ⟨(A.e p.1 p.2).f ≫ (φ p.1 q.1).f ≫ (A.e q.1 q.2).f, by diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/NilpotentTrace.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/NilpotentTrace.lean index 21cfaaca25..250251f8ed 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/NilpotentTrace.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/NilpotentTrace.lean @@ -31,7 +31,7 @@ permutation action on strand bundles, `pow` the tensor power of an endomorphism, and `frobenius` the categorical Frobenius formula. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/ObjectTower.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/ObjectTower.lean index fd77ea01db..7c0235f48a 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/ObjectTower.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/ObjectTower.lean @@ -24,7 +24,7 @@ identity comes from the cycle-type formula for the trace of a permutation against a tensor power. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/PermTrace.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/PermTrace.lean index c6e3d39357..fa16efe906 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/PermTrace.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/PermTrace.lean @@ -23,7 +23,7 @@ lengths are its full cycle type (`exists_conj_blockCycles`), so the three combine to give the general formula. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/RankDimension.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/RankDimension.lean index 70a4c66a84..550d8293fa 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/RankDimension.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/RankDimension.lean @@ -17,7 +17,7 @@ with the skein Hom space. At even arity this is the endomorphism algebra used by the commutant estimate. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/ScalarPermTrace.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/ScalarPermTrace.lean index f3f9a7ad82..a3cb0d16f8 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/ScalarPermTrace.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/ScalarPermTrace.lean @@ -18,7 +18,7 @@ the Frobenius formula. Fixed points can be recorded separately from the nontrivial cycles. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/ScalarTrace.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/ScalarTrace.lean index d28788d647..f4fc060a2d 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/ScalarTrace.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/ScalarTrace.lean @@ -21,7 +21,7 @@ trace fields ask for. Cyclicity carries across the identification unchanged. -/ -@[expose] public section +public section namespace RS @@ -34,6 +34,7 @@ variable {C : Type u} /-- **The unit's endomorphisms are the scalars**, as an algebra isomorphism. This is `HasScalarUnit` read as bijectivity of the structure map. -/ +@[expose] noncomputable def unitScalarEquiv [Category.{v} C] [Preadditive C] [Linear ℂ C] [MonoidalCategory C] (h : HasScalarUnit C) : @@ -41,6 +42,7 @@ noncomputable def unitScalarEquiv AlgEquiv.ofBijective (Algebra.ofId ℂ (End (𝟙_ C))) h /-- **The scalar named by an endomorphism of the unit.** -/ +@[expose] noncomputable def unitScalar [Category.{v} C] [Preadditive C] [Linear ℂ C] [MonoidalCategory C] (h : HasScalarUnit C) : @@ -50,6 +52,7 @@ noncomputable def unitScalar /-! ## The complex-valued trace -/ /-- **The complex-valued categorical trace.** -/ +@[expose] noncomputable def scalarTrace [Category.{v} C] [Preadditive C] [Linear ℂ C] [MonoidalCategory C] [SymmetricCategory C] [MonoidalPreadditive C] [MonoidalLinear ℂ C] diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/SemisimpleAll.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/SemisimpleAll.lean index 1342bc852d..e26c2fa809 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/SemisimpleAll.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/SemisimpleAll.lean @@ -23,7 +23,7 @@ what `isSemisimpleRing_of_trace` consumes to make every skein endomorphism algebra semisimple. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/SkeinDimBound.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/SkeinDimBound.lean index d779db60e0..de3a8b82bd 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/SkeinDimBound.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/SkeinDimBound.lean @@ -27,7 +27,7 @@ the sector traces of `SectorIntertwine.lean` and the binomial determinant of `SymFun/LGVStrict.lean`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/SkeinTower.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/SkeinTower.lean index 6bb118f8fc..4335839e27 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/SkeinTower.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/SkeinTower.lean @@ -40,7 +40,7 @@ map `σ ↦ [permFragment σ]` is a genuine `MonoidHom` from `Perm (Fin n)` to `End (SkeinObj.mk n)` by `permFragmentCompose`. -/ -@[expose] public section +public section namespace RS @@ -52,6 +52,7 @@ variable {R : ℕ} (f : EdgeRankParameter R) /-- The endomorphism ℂ-algebra of the `n`-strand object of the skein category. Definitionally `HomSpace f.val (n + n)`. -/ +@[expose] noncomputable def skeinEnd (n : ℕ) : Type 1 := End (SkeinObj.mk (f := f) n) @@ -75,6 +76,7 @@ noncomputable instance skeinEndModule (n : ℕ) : Module ℂ (skeinEnd f n) := /-! ### The permutation representation -/ /-- The class of a permutation fragment in the endomorphism algebra. -/ +@[expose] noncomputable def permClass (n : ℕ) (σ : Equiv.Perm (Fin n)) : skeinEnd f n := HomSpace.ofFragment f.val (permFragment σ) @@ -85,6 +87,7 @@ identity. Multiplication: `End.mul_def` reverses composition order, and `permFragmentCompose τ σ` gives `(permFragment τ).compose (permFragment σ) ≃ permFragment (σ * τ)`, so `[P_σ] * [P_τ] = [P_τ] ≫ [P_σ] = [compose P_τ P_σ] = [P_{σ*τ}]`. -/ +@[expose] noncomputable def permToEnd (n : ℕ) : Equiv.Perm (Fin n) →* skeinEnd f n where toFun σ := permClass f n σ @@ -281,6 +284,7 @@ the tensor extension, and the dimension bound from the Hom-space rank bound. The growth constant is `R ^ 2` because the tower's bound is `A ^ n` while the Hom-space bound is `R ^ (2n)`; its square root, which is what the threshold `2e√A` reads, is `R`. -/ +@[expose] noncomputable def skeinPermTower : PermTower (skeinEnd f) ((R : ℝ) ^ 2) where rep := skeinRep f diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/SkeinTrace.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/SkeinTrace.lean index dfd41ef624..03076b7cda 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/SkeinTrace.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/SkeinTrace.lean @@ -20,7 +20,7 @@ it: closing a tensor product multiplies the two closures, proved by bilinear induction down to single fragments. -/ -@[expose] public section +public section namespace RS @@ -30,6 +30,7 @@ variable {R : ℕ} (f : EdgeRankParameter R) /-- The trace of an `n`-strand endomorphism: the closure against the strand bundle. -/ +@[expose] noncomputable def skeinTrace (n : ℕ) (g : skeinEnd f n) : ℂ := HomSpace.traceMap f.val n g diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/SuperKill.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/SuperKill.lean index b3f603e520..b3e619aaf9 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/SuperKill.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/SuperKill.lean @@ -19,7 +19,7 @@ at any side `s > 2eR` dies at the super level — the unconditional half of the sector dichotomy. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/SymPerm.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/SymPerm.lean index d1da7d18cc..15c7d265c6 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/SymPerm.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/SymPerm.lean @@ -29,7 +29,7 @@ structure then turns the action into the algebra map `permAlg` that a tower's representation field asks for. -/ -@[expose] public section +public section namespace RS @@ -44,6 +44,7 @@ variable {A : Type u} /-- **The top transposition**: braid the last two factors of `X ^ ⊗ (n + 2)`. Reassociating exposes the last two tensorands, the braiding exchanges them, and the associator is undone. -/ +@[expose] noncomputable def swapTop [Category.{v} A] [MonoidalCategory A] [SymmetricCategory A] (X : A) (n : ℕ) : @@ -76,6 +77,7 @@ one. It is defined by bubbling one slot at a time, so no word is chosen: `insertTop X n n` is the identity, and each further step composes one more top transposition, whiskered by the factors above it. The recursion is on the gap `n - p`. -/ +@[expose] noncomputable def insertTop [Category.{v} A] [MonoidalCategory A] [SymmetricCategory A] (X : A) : (n : ℕ) → (k : ℕ) → @@ -350,6 +352,7 @@ generation. /-- **The permutation action on a tensor power**: `permMor X σ` routes the factor in slot `i` to slot `σ i`. -/ +@[expose] noncomputable def permMor [Category.{v} A] [MonoidalCategory A] [SymmetricCategory A] (X : A) : @@ -643,7 +646,7 @@ asks for. Only this last step needs the linear structure. -/ /-- **The action as a monoid homomorphism.** -/ -@[simps] +@[expose, simps] noncomputable def permHom [Category.{v} A] [MonoidalCategory A] [SymmetricCategory A] (X : A) (n : ℕ) : @@ -655,6 +658,7 @@ noncomputable def permHom section Linear /-- **The symmetric-group algebra acting on a tensor power.** -/ +@[expose] noncomputable def permAlg [Category.{v} A] [MonoidalCategory A] [SymmetricCategory A] [Preadditive A] [Linear ℂ A] diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/SymPermCast.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/SymPermCast.lean index 758839de82..b3d4bdde45 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/SymPermCast.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/SymPermCast.lean @@ -26,7 +26,7 @@ category is used: additivity of `▷` is `MonoidalPreadditive` and its ℂ-homogeneity is `MonoidalLinear`. -/ -@[expose] public section +public section namespace RS @@ -42,6 +42,7 @@ variable {A : Type u} endomorphisms. Multiplicativity is functoriality of `▷` — note that `End` multiplies in the order opposite to composition, which is why no reversal appears. -/ +@[expose] noncomputable def whiskerAlg [Category.{v} A] [MonoidalCategory A] [Preadditive A] [Linear ℂ A] [MonoidalPreadditive A] [MonoidalLinear ℂ A] @@ -59,6 +60,7 @@ noncomputable def whiskerAlg /-- **Repeated whiskering**: the algebra map carrying an endomorphism of `X ^ ⊗ m` to the endomorphism of `X ^ ⊗ (m + k)` that acts on the first `m` factors and fixes the last `k`. -/ +@[expose] noncomputable def whiskerPowAlg [Category.{v} A] [MonoidalCategory A] [Preadditive A] [Linear ℂ A] [MonoidalPreadditive A] [MonoidalLinear ℂ A] diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/TensorPowHom.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/TensorPowHom.lean index 8e457362ac..cf2770c1e3 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/TensorPowHom.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/TensorPowHom.lean @@ -19,7 +19,7 @@ and applying `g` to each may be done in either order (`permMor_comp_powHom`). -/ -@[expose] public section +public section namespace RS @@ -33,6 +33,7 @@ variable {A : Type u} /-- **The tensor power of an endomorphism**: `powHom X g n` acts by `g` on each of the `n` factors of `X ^ ⊗ n`. -/ +@[expose] noncomputable def powHom [Category.{v} A] [MonoidalCategory A] (X : A) (g : End X) : (n : ℕ) → End (tensorPow A X n) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/TensorPowSplit.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/TensorPowSplit.lean index d6ecef2c02..48f78520ff 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/TensorPowSplit.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/TensorPowSplit.lean @@ -22,7 +22,7 @@ that let the trace of a permutation-and-endomorphism word be computed block by block. -/ -@[expose] public section +public section namespace RS @@ -39,6 +39,7 @@ by recursion on the upper block. At `q = 0` it is the right unitor's inverse; each further factor is carried across by the associator, so the isomorphism is built from unitors and associators alone. -/ +@[expose] noncomputable def splitPow [Category.{v} A] [MonoidalCategory A] (X : A) : (p q : ℕ) → (tensorPow A X (p + q) ≅ tensorPow A X p ⊗ tensorPow A X q) @@ -66,6 +67,7 @@ theorem splitPow_succ [Category.{v} A] [MonoidalCategory A] /-- The block sum of two permutations: `σ` acts on the lower `p` slots and `τ` on the upper `q`, with no interaction between the blocks. -/ +@[expose] def blockSum {p q : ℕ} (σ : Equiv.Perm (Fin p)) (τ : Equiv.Perm (Fin q)) : Equiv.Perm (Fin (p + q)) := finSumFinEquiv.permCongr (Equiv.sumCongr σ τ) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/TraceZeta.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/TraceZeta.lean index 2ad08e8c6c..c93267609f 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/TraceZeta.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/TraceZeta.lean @@ -30,7 +30,7 @@ hook-vanishing half of the proof uses only the Frobenius identity and hook confinement, both of which hold for every element. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Envelope/TraceZetaSharp.lean b/LeanPool/RegtsSevenster/RS/Novel/Envelope/TraceZetaSharp.lean index 8bef49510d..5ebedaec9a 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Envelope/TraceZetaSharp.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Envelope/TraceZetaSharp.lean @@ -39,7 +39,7 @@ degree bound, and the threshold is stated in the growth constant itself. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Extraction/CircleValue.lean b/LeanPool/RegtsSevenster/RS/Novel/Extraction/CircleValue.lean index d6dc605c35..1408616464 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Extraction/CircleValue.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Extraction/CircleValue.lean @@ -16,7 +16,7 @@ the superdimension `k − 2ℓ`, which is the value Definition 5 gives a free circle. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/RegtsSevenster/RS/Novel/Extraction/CoordIso.lean b/LeanPool/RegtsSevenster/RS/Novel/Extraction/CoordIso.lean index 2eb3017285..e9f598ade2 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Extraction/CoordIso.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Extraction/CoordIso.lean @@ -20,7 +20,7 @@ coordinate conventions: every self-dual object of SuperVect *is* a standard orthosymplectic space, form and all. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/RegtsSevenster/RS/Novel/Extraction/Coordinates.lean b/LeanPool/RegtsSevenster/RS/Novel/Extraction/Coordinates.lean index e5d87b04a9..9844cad77f 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Extraction/Coordinates.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Extraction/Coordinates.lean @@ -34,7 +34,7 @@ The route: * `exists_coordinates` assembles the graded statement. -/ -@[expose] public section +public section noncomputable section @@ -48,6 +48,7 @@ open Module /-- The even component of a form morphism `V ⊗ V ⟶ 𝟙`, with its domain and codomain presented in reduced form. -/ +@[expose] def formEvenMap {V : SuperVect} (b : SuperVect.Hom (SuperVect.tensorObj V V) SuperVect.tensorUnit) : ((V.even ⊗[ℂ] V.even) × (V.odd ⊗[ℂ] V.odd)) →ₗ[ℂ] ℂ := @@ -55,6 +56,7 @@ def formEvenMap {V : SuperVect} /-- The even block of a form morphism, as a bilinear form on `V.even`. -/ +@[expose] def formEvenBlock {V : SuperVect} (b : SuperVect.Hom (SuperVect.tensorObj V V) SuperVect.tensorUnit) : BilinForm ℂ V.even := @@ -62,6 +64,7 @@ def formEvenBlock {V : SuperVect} /-- The odd block of a form morphism, as a bilinear form on `V.odd`. -/ +@[expose] def formOddBlock {V : SuperVect} (b : SuperVect.Hom (SuperVect.tensorObj V V) SuperVect.tensorUnit) : BilinForm ℂ V.odd := diff --git a/LeanPool/RegtsSevenster/RS/Novel/Extraction/CopairUnique.lean b/LeanPool/RegtsSevenster/RS/Novel/Extraction/CopairUnique.lean index 98a0b77733..6f2f5e2710 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Extraction/CopairUnique.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Extraction/CopairUnique.lean @@ -26,7 +26,7 @@ with its dual), so the blocks are pinned to the standard copairing elements, which satisfy the same identities. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/RegtsSevenster/RS/Novel/Extraction/Nondegenerate.lean b/LeanPool/RegtsSevenster/RS/Novel/Extraction/Nondegenerate.lean index fec8fc42f9..396be02fb6 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Extraction/Nondegenerate.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Extraction/Nondegenerate.lean @@ -32,7 +32,7 @@ coordinate identification follows unconditionally (`exists_coordinates_of_snake`). -/ -@[expose] public section +public section noncomputable section @@ -53,6 +53,7 @@ def formOddMap {V : SuperVect} /-- The even component of a copairing morphism `𝟙 ⟶ V ⊗ V`, with its domain and codomain presented in reduced form. -/ +@[expose] def formCoevMap {V : SuperVect} (C : SuperVect.Hom SuperVect.tensorUnit (SuperVect.tensorObj V V)) : ℂ →ₗ[ℂ] ((V.even ⊗[ℂ] V.even) × (V.odd ⊗[ℂ] V.odd)) := diff --git a/LeanPool/RegtsSevenster/RS/Novel/Extraction/SnakeTransport.lean b/LeanPool/RegtsSevenster/RS/Novel/Extraction/SnakeTransport.lean index 1f0b18eb3e..65fe076090 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Extraction/SnakeTransport.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Extraction/SnakeTransport.lean @@ -26,7 +26,7 @@ via `tensorHom_def'`, and the transported copairing is then pinned by `stdCopair_unique`. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/RegtsSevenster/RS/Novel/Extraction/StdDuality.lean b/LeanPool/RegtsSevenster/RS/Novel/Extraction/StdDuality.lean index b0ecf3a02a..ca13b97078 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Extraction/StdDuality.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Extraction/StdDuality.lean @@ -20,13 +20,14 @@ block is symmetric; the odd block is antisymmetric, and the Koszul sign of the braiding on the odd⊗odd summand exactly compensates. -/ -@[expose] public section +public section namespace RS open scoped TensorProduct /-- The even form as a bilinear map. -/ +@[expose] noncomputable def stdFormEvenBilin (k : ℕ) : (Fin k → ℂ) →ₗ[ℂ] (Fin k → ℂ) →ₗ[ℂ] ℂ := LinearMap.mk₂ ℂ (stdFormEven k) @@ -56,6 +57,7 @@ noncomputable def stdFormEvenBilin (k : ℕ) : ring)) /-- The odd form as a bilinear map. -/ +@[expose] noncomputable def stdFormOddBilin (ℓ : ℕ) : (Fin (2 * ℓ) → ℂ) →ₗ[ℂ] (Fin (2 * ℓ) → ℂ) →ₗ[ℂ] ℂ := LinearMap.mk₂ ℂ (stdFormOdd ℓ) @@ -88,6 +90,7 @@ noncomputable def stdFormOddBilin (ℓ : ℕ) : /-- The standard form as an even morphism `stdSuperPair ⊗ stdSuperPair ⟶ 𝟙` of super vector spaces. -/ +@[expose] noncomputable def stdForm (k ℓ : ℕ) : SuperVect.Hom (SuperVect.tensorObj (stdSuperPair k ℓ) (stdSuperPair k ℓ)) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Extraction/StdRigid.lean b/LeanPool/RegtsSevenster/RS/Novel/Extraction/StdRigid.lean index 723669ec5c..744184029c 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Extraction/StdRigid.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Extraction/StdRigid.lean @@ -19,7 +19,7 @@ the contraction identities `L_C = id` distributed over the graded blocks. -/ -@[expose] public section +public section namespace RS @@ -27,11 +27,13 @@ open CategoryTheory open scoped TensorProduct /-- The even copairing element `Σ e_i ⊗ e_i`. -/ +@[expose] noncomputable def stdCopairEvenElem (k : ℕ) : (Fin k → ℂ) ⊗[ℂ] (Fin k → ℂ) := ∑ i, stdE k i ⊗ₜ[ℂ] stdE k i /-- The odd copairing element `Σ f_i ⊗ g_i`. -/ +@[expose] noncomputable def stdCopairOddElem (ℓ : ℕ) : (Fin (2 * ℓ) → ℂ) ⊗[ℂ] (Fin (2 * ℓ) → ℂ) := ∑ i, stdF ℓ i ⊗ₜ[ℂ] stdG ℓ i @@ -53,6 +55,7 @@ private lemma equiv_zero {M N : Type*} [AddCommMonoid M] [Module ℂ M] /-- The standard copairing as an even morphism `𝟙 ⟶ stdSuperPair ⊗ stdSuperPair`. -/ +@[expose] noncomputable def stdCopair (k ℓ : ℕ) : SuperVect.Hom SuperVect.tensorUnit (SuperVect.tensorObj (stdSuperPair k ℓ) (stdSuperPair k ℓ)) := by diff --git a/LeanPool/RegtsSevenster/RS/Novel/Extraction/StdSuper.lean b/LeanPool/RegtsSevenster/RS/Novel/Extraction/StdSuper.lean index a8fc4890d7..ce682ff59c 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Extraction/StdSuper.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Extraction/StdSuper.lean @@ -26,7 +26,7 @@ the accompanying paper writes `ξ i` and `η i` for the same vectors, `f` being reserved there for the graph parameter. -/ -@[expose] public section +public section namespace RS @@ -34,30 +34,36 @@ open scoped BigOperators /-- The standard super vector space with even dimension `k` and odd dimension `2ℓ`. -/ +@[expose] noncomputable def stdSuperPair (k ℓ : ℕ) : SuperVect where even := Fin k → ℂ odd := Fin (2 * ℓ) → ℂ /-- The standard even basis vectors `e i`. -/ +@[expose] noncomputable def stdE (k : ℕ) (i : Fin k) : Fin k → ℂ := Pi.single i 1 /-- The standard odd basis vectors `f i`. -/ +@[expose] noncomputable def stdF (ℓ : ℕ) (i : Fin (2 * ℓ)) : Fin (2 * ℓ) → ℂ := Pi.single i 1 /-- The even part of the standard form: the orthonormal pairing. -/ +@[expose] noncomputable def stdFormEven (k : ℕ) (x y : Fin k → ℂ) : ℂ := ∑ i, x i * y i /-- The odd part of the standard form: the antisymmetric pairing with `b (f m) (f (m + ℓ)) = 1` for `m ≤ ℓ` and all other basis values forced by antisymmetry. -/ +@[expose] noncomputable def stdFormOdd (ℓ : ℕ) (x y : Fin (2 * ℓ) → ℂ) : ℂ := ∑ i, -(oddPartnerSign ℓ i : ℂ) * x i * y (oddPartner ℓ i) /-- The Regts–Sevenster dual odd vectors: `g i = −f (i + ℓ)` for `i < ℓ` and `g i = f (i − ℓ)` otherwise. -/ +@[expose] noncomputable def stdG (ℓ : ℕ) (i : Fin (2 * ℓ)) : Fin (2 * ℓ) → ℂ := (oddPartnerSign ℓ i : ℂ) • stdF ℓ (oddPartner ℓ i) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/AllInternalAgreement.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/AllInternalAgreement.lean index 3ed227140d..fb24d8ffdd 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/AllInternalAgreement.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/AllInternalAgreement.lean @@ -36,7 +36,7 @@ state is ever chosen — every state used is manufactured from an existing even colouring — so no `(k, ℓ) = (0, 0)` edge case arises. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/AllInternalIndependence.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/AllInternalIndependence.lean index 438c4cfec1..1c1d6240b1 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/AllInternalIndependence.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/AllInternalIndependence.lean @@ -18,7 +18,7 @@ summand at the open circuit count is independent of all choices — Proposition 3 for the boundary-free sector, as a theorem. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/BraidedInstance.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/BraidedInstance.lean index b9760cfc86..3cf66c3e7a 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/BraidedInstance.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/BraidedInstance.lean @@ -16,7 +16,7 @@ label identities, and the `BraidedCategory`/`SymmetricCategory` instances on `SkeinObj f`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/BraidedNat.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/BraidedNat.lean index 9164f8bf78..e180c12ce4 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/BraidedNat.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/BraidedNat.lean @@ -15,7 +15,7 @@ Value lemmas for the tensor swap, the braiding-naturality label meets, and the fragment-level naturality squares. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/BundleClose.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/BundleClose.lean index e33a2855af..f73e574d33 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/BundleClose.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/BundleClose.lean @@ -24,7 +24,7 @@ collapses to the fragment; and the lifted low-block pairs are then exactly the straight matching. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/BundleMapClasses.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/BundleMapClasses.lean index b0ce5edf6c..e8060d2356 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/BundleMapClasses.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/BundleMapClasses.lean @@ -27,12 +27,13 @@ collapses through this law into an equality of label equivalences. -/ -@[expose] public section +public section namespace RS /-- The outgoing label map of a bundle: fix the inputs, apply `e` to the outputs. -/ +@[expose] def outMapEquiv {n m : ℕ} (e : Fin n ≃ Fin m) : Fin (n + n) ≃ Fin (n + m) := finSumFinEquiv.symm.trans @@ -41,6 +42,7 @@ def outMapEquiv {n m : ℕ} (e : Fin n ≃ Fin m) : /-- The bundle map of a label equivalence: strand `k` joins input `k` to output `e k`. -/ +@[expose] noncomputable def bundleMap {n m : ℕ} (e : Fin n ≃ Fin m) : Fragment (Fin (n + m)) := (strandBundle n).relabel (outMapEquiv e) @@ -133,6 +135,7 @@ theorem outMapEquiv_natAdd {n m : ℕ} (e : Fin n ≃ Fin m) exact finSumFinEquiv_apply_right (e k) /-- The sum of two label equivalences, on concatenated blocks. -/ +@[expose] def tensorMapEquiv {n₁ m₁ n₂ m₂ : ℕ} (e₁ : Fin n₁ ≃ Fin m₁) (e₂ : Fin n₂ ≃ Fin m₂) : Fin (n₁ + n₂) ≃ Fin (m₁ + m₂) := @@ -313,6 +316,7 @@ theorem inTransport_finCongr {n m u : ℕ} (h : n = m) : variable {R : ℕ} (f : EdgeRankParameter R) /-- The bundle-map class. -/ +@[expose] noncomputable def bundleMapClass {n m : ℕ} (e : Fin n ≃ Fin m) : HomSpace f.val (n + m) := HomSpace.ofFragment f.val (bundleMap e) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/BundleTensor.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/BundleTensor.lean index 32927df09a..e58deb668a 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/BundleTensor.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/BundleTensor.lean @@ -18,7 +18,7 @@ with the monoidal product, the entry point for the trace multiplicativity (Lemma 3.5(b)). -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/CanonExistence.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/CanonExistence.lean index 566abb3116..f614ce1e20 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/CanonExistence.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/CanonExistence.lean @@ -42,7 +42,7 @@ flags lying on non-canonically oriented boundary-to-boundary chains. chain's canonicality status (`pathCanonical_canonOrientation`). -/ -@[expose] public section +public section namespace RS @@ -253,6 +253,7 @@ theorem canonIsOut_of_not_bad /-- **The flipped orientation**: negate the given orientation on the flip set. The closure lemmas make the flip commute with both orientation axioms. -/ +@[expose] noncomputable def canonOrientation [LinearOrder α] {W : Fragment α} {F : EdgeSubset W} (κ : F.RelTransitionSystem) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/CanonTransport.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/CanonTransport.lean index 2ea7e87015..7717f7e968 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/CanonTransport.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/CanonTransport.lean @@ -16,7 +16,7 @@ orientation — transport along a relabel, down across either branch of a single-pair glue, and back up from a closed lift. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/CanonicalFrame.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/CanonicalFrame.lean index c5a4549377..61caf9c555 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/CanonicalFrame.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/CanonicalFrame.lean @@ -28,7 +28,7 @@ over the anti-canonical chains re-canonicalizes any orientation (`exists_recanonicalize`). -/ -@[expose] public section +public section namespace RS @@ -44,6 +44,7 @@ variable {α : Type} the orientation value at the flag's entry edge (the internal partner of the boundary flag). `false` means the entry edge is incoming — the chain leaves this end. -/ +@[expose] def chainDir {W : Fragment α} {F : EdgeSubset W} {κ : F.RelTransitionSystem} (o : κ.Orientation) (β : W.Flag) : Bool := o.isOut (W.pairing β) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/ChainAgreement.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/ChainAgreement.lean index 34ef5d6690..0d633f30de 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/ChainAgreement.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/ChainAgreement.lean @@ -47,7 +47,7 @@ whole chain's values are determined by the pinned seed. chain. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/ChordCount.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/ChordCount.lean index fdf6046ac4..8a46a2bb72 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/ChordCount.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/ChordCount.lean @@ -21,7 +21,7 @@ This is what makes "the number of chords" a single notion: it is the diagram, and they agree. -/ -@[expose] public section +public section namespace RS @@ -62,6 +62,7 @@ theorem boundaryLabel_boundaryFlag {W : Fragment α} /-- The label a subset's chain carries a used label to; the identity on unused ones. -/ +@[expose] noncomputable def chordInv {W : Fragment α} (F : EdgeSubset W) (κ : F.RelTransitionSystem) (i : α) : α := diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/ChordLabels.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/ChordLabels.lean index c68b4a5055..3ff88d1b60 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/ChordLabels.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/ChordLabels.lean @@ -18,7 +18,7 @@ concrete bridge from `chordCrossingCount` to the abstract chord parity layer. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/ChordParity.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/ChordParity.lean index 5f62d431c5..720a17d005 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/ChordParity.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/ChordParity.lean @@ -19,7 +19,7 @@ cut — a nested chord contributes both ends, a crossing chord exactly one. -/ -@[expose] public section +public section namespace RS @@ -29,6 +29,7 @@ variable {α : Type} /-- A chord crosses the cut when exactly one endpoint lies between the cut labels. -/ +@[expose] def CrossesCut [LinearOrder α] (i j : α) (p : α × α) : Prop := Xor (i < p.1 ∧ p.1 < j) (i < p.2 ∧ p.2 < j) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/ChordSwapParity.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/ChordSwapParity.lean index 2f368b52ce..27a9081a3d 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/ChordSwapParity.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/ChordSwapParity.lean @@ -27,7 +27,7 @@ coexisting crossing predicates: the total crossing parity (`third_chord_reparity` per element). -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/CloseRotate.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/CloseRotate.lean index 1457a7978c..8a037acb21 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/CloseRotate.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/CloseRotate.lean @@ -27,12 +27,13 @@ the ideal lemma and the trace calculus (accompanying paper, Lemma 3.3(a) and Lemma 3.5(a)). -/ -@[expose] public section +public section namespace RS /-- The boundary transpose: exchange the two sides of an `(n,p)`-boundary. -/ +@[expose] noncomputable def transposeEquiv (n p : ℕ) : Fin (n + p) ≃ Fin (p + n) := (finSumFinEquiv.symm.trans @@ -82,6 +83,7 @@ theorem transposeEquiv_symm_high (n p : ℕ) (j : ℕ) (hj : j < n) /-- The `m`-block: the low labels of `F` against the low labels of `K`, top pair first. -/ +@[expose] def mBlock (m n p : ℕ) : List (((Fin (m + n) ⊕ Fin (n + p)) ⊕ Fin (m + p)) × ((Fin (m + n) ⊕ Fin (n + p)) ⊕ Fin (m + p))) := @@ -91,6 +93,7 @@ def mBlock (m n p : ℕ) : /-- The `p`-block: the high labels of `H` against the high labels of `K`, top pair first. -/ +@[expose] def pBlock (m n p : ℕ) : List (((Fin (m + n) ⊕ Fin (n + p)) ⊕ Fin (m + p)) × ((Fin (m + n) ⊕ Fin (n + p)) ⊕ Fin (m + p))) := @@ -100,6 +103,7 @@ def pBlock (m n p : ℕ) : /-- The `n`-block: the high labels of `F` against the low labels of `H`, top pair first — the embedded composition interface. -/ +@[expose] def nBlock (m n p : ℕ) : List (((Fin (m + n) ⊕ Fin (n + p)) ⊕ Fin (m + p)) × ((Fin (m + n) ⊕ Fin (n + p)) ⊕ Fin (m + p))) := @@ -296,6 +300,7 @@ theorem liftPairs_append {α : Type} (ps : List (α × α)) : (liftPairs_append ps qs₁ qs₂ _) /-- The high half of a full-closure interface list. -/ +@[expose] def ipHigh (m p : ℕ) : List ((Fin (0 + (m + p)) ⊕ Fin (m + p + 0)) × (Fin (0 + (m + p)) ⊕ Fin (m + p + 0))) := @@ -304,6 +309,7 @@ def ipHigh (m p : ℕ) : Sum.inr ⟨m + ℓ.val, by have := ℓ.isLt; omega⟩)) /-- The low half of a full-closure interface list. -/ +@[expose] def ipLow (m p : ℕ) : List ((Fin (0 + (m + p)) ⊕ Fin (m + p + 0)) × (Fin (0 + (m + p)) ⊕ Fin (m + p + 0))) := @@ -678,6 +684,7 @@ noncomputable def rotMR (m n p : ℕ) : List.Perm.refl _)).symm) /-- The transported boundary equivalence of the right side. -/ +@[expose] noncomputable def rotSigma (m n p : ℕ) : (Fin (m + n) ⊕ Fragment.FoldSurviving (Fin (m + p) ⊕ Fin (p + n)) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/CloseRotateLeft.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/CloseRotateLeft.lean index 29fc408ed7..857c4dee31 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/CloseRotateLeft.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/CloseRotateLeft.lean @@ -20,7 +20,7 @@ where `Wᵀ` transposes the boundary of `W`. This is the left-mirror variant of `pairCloseComposeRotate`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/CloseUnion.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/CloseUnion.lean index 5ee3b48983..894accb1af 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/CloseUnion.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/CloseUnion.lean @@ -24,7 +24,7 @@ the multiplicativity of the parameter (Lemma 3.2), this yields the trace multiplicativity (Lemma 3.5(b)). -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/ClosedAgreement.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/ClosedAgreement.lean index 0fd5872013..43ffa2ca74 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/ClosedAgreement.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/ClosedAgreement.lean @@ -24,7 +24,7 @@ Definition 5 value. This is the base case of the converse's factorization induction. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/ClosedCutDispatch.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/ClosedCutDispatch.lean index 3139663d54..d2728cb73b 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/ClosedCutDispatch.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/ClosedCutDispatch.lean @@ -21,7 +21,7 @@ which flags are boundary after the glue, that the walk agrees step for step, and that the path matching is carried across unchanged. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/ClosedIdentify.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/ClosedIdentify.lean index 5d878aea03..11c372e43b 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/ClosedIdentify.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/ClosedIdentify.lean @@ -25,7 +25,7 @@ identify the relabelled fragment's Definition 5 value with the constrained value downstairs, with no independence input. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/ClosedTopSum.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/ClosedTopSum.lean index 9da31b3f55..dc16fa7690 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/ClosedTopSum.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/ClosedTopSum.lean @@ -19,7 +19,7 @@ constrained partition value as the weighted sum the iteration carries. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/ColourEmbedding.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/ColourEmbedding.lean index 85f3611391..9459d93f98 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/ColourEmbedding.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/ColourEmbedding.lean @@ -18,7 +18,7 @@ such an embedding preserves its alternating evaluations on the embedded colours and annihilates inputs using any other colour. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/ColourGlue.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/ColourGlue.lean index c09f6e899c..91c9299d59 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/ColourGlue.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/ColourGlue.lean @@ -26,7 +26,7 @@ when it carries an odd one; the sum over the state's colour at the cut runs over the corresponding block. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/ColourPadding.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/ColourPadding.lean index 102cc2706c..b6ffe6d140 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/ColourPadding.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/ColourPadding.lean @@ -18,7 +18,7 @@ zero vertex factor. Equality of superdimensions then preserves the free-circle factor as well. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/ColourRecursion.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/ColourRecursion.lean index 18e1dac499..4c3939e205 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/ColourRecursion.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/ColourRecursion.lean @@ -21,7 +21,7 @@ stage and at the base, and the dispatch on whether the stage's cut closes. -/ -@[expose] public section +public section namespace RS @@ -109,6 +109,7 @@ variable (n : ℕ) (V : Fragment (Fin (0 + (n + 1)) ⊕ Fin ((n + 1) + 0))) /-- The stage's family, pulled back along the relabel. -/ +@[expose] noncomputable def stepDataGlued (𝒟 : DataFamily (stepFragment n V)) : DataFamily (V.gluePair (cutL n) (cutR n) (cutL_ne_cutR n)) := relabelDataDown (stepIso n) 𝒟 @@ -132,6 +133,7 @@ theorem gluePair_eq_open (hop : V.pairing (V.boundaryFlag (cutL n)) /-- **One stage of the composition, on the data.** The family is chosen at the composition and pushed back: along the relabel, then across the glue. -/ +@[expose] noncomputable def stepDataDown (𝒟 : DataFamily (stepFragment n V)) : DataFamily V := if hcl : V.pairing (V.boundaryFlag (cutL n)) @@ -329,6 +331,7 @@ section Iterate /-- **The family, pushed back to the base.** A choice at the composition determines one at every stage, by ungluing. -/ +@[expose] noncomputable def pushData : (n : ℕ) → (V : Fragment (Fin (0 + n) ⊕ Fin (n + 0))) → DataFamily (glueInterface 0 n 0 V) → DataFamily V @@ -340,6 +343,7 @@ open Classical in /-- **The closing cuts a subset carries.** This is the ledger's `glueCount`, read on the colouring side: the count the base's summand is taken at rises by one at each of them. -/ +@[expose] noncomputable def carried : (n : ℕ) → (V : Fragment (Fin (0 + n) ⊕ Fin (n + 0))) → Finset V.Flag → ℕ diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/ComposeAssoc.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/ComposeAssoc.lean index 1cdd865faf..d922c7dd6f 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/ComposeAssoc.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/ComposeAssoc.lean @@ -23,7 +23,7 @@ association, and the final meet in the middle via two-stage folding and reordering. -/ -@[expose] public section +public section namespace RS @@ -470,6 +470,7 @@ noncomputable def glueListPullRelabelTrans {α β γ : Type} (W : Fragment α) (Fragment.Equiv.relabelTrans _ _ _)) /-- Transport the two closure casts across a normalized right-hand fragment. -/ +@[expose] noncomputable def pairCloseAmbientEquiv {n : ℕ} (F G : Fragment (Fin n)) {α : Type} {N : Fragment α} {e : α ≃ Fin n} (E : G.Equiv (N.relabel e)) := (Fragment.relabelDisjUnionLeft F @@ -495,6 +496,7 @@ noncomputable def pairCloseAmbientEquiv {n : ℕ} (F G : Fragment (Fin n)) flatten the two-stage survivors, pass through the embedded and relabelled fold equivalences, and read off the outer boundary identification. -/ +@[expose] noncomputable def lhsLabelEquiv (s t u v : ℕ) : Fragment.FoldSurviving ((Fin (s + t) ⊕ Fin (t + u)) ⊕ Fin (u + v)) @@ -604,6 +606,7 @@ theorem rhs_ground_eq (s t u v : ℕ) : /-- The associativity bridge: survivors of the ambient `u`-interface pairs are survivors of the right-embedded pairs in the right-associated ambient. -/ +@[expose] noncomputable def rhsBridgeEquiv (s t u v : ℕ) : Fragment.FoldSurviving ((Fin (s + t) ⊕ Fin (t + u)) ⊕ Fin (u + v)) @@ -828,6 +831,7 @@ noncomputable def assocNormalLeft {s t u v : ℕ} /-- The outer interface pairs of the right association, pulled back to the boundary of the inner composition. -/ +@[expose] noncomputable def rhsQs1 (s t u v : ℕ) : List ((Fin (s + t) ⊕ Fragment.FoldSurviving (Fin (t + u) ⊕ Fin (u + v)) @@ -846,6 +850,7 @@ private theorem rhsQs1_wf (s t u v : ℕ) : /-- The outer interface pairs, pulled into the right-embedded fold survivors. -/ +@[expose] noncomputable def rhsQs2 (s t u v : ℕ) := Fragment.mapPairs (Fragment.inrFoldEquiv (α := Fin (s + t)) @@ -854,12 +859,14 @@ noncomputable def rhsQs2 (s t u v : ℕ) := /-- The outer interface pairs, pulled across the associativity bridge. -/ +@[expose] noncomputable def rhsQs3 (s t u v : ℕ) := Fragment.mapPairs (rhsBridgeEquiv s t u v).symm (rhsQs2 s t u v) /-- The composed label identification of the right association. -/ +@[expose] noncomputable def rhsLabelEquiv (s t u v : ℕ) : Fragment.FoldSurviving ((Fin (s + t) ⊕ Fin (t + u)) ⊕ Fin (u + v)) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/ComposeNormal.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/ComposeNormal.lean index 5b91123351..1f110950d2 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/ComposeNormal.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/ComposeNormal.lean @@ -18,11 +18,12 @@ surviving labels with `Fin s ⊕ Fin u`. The normalization of `glueInterface` as a `glueList` builds on these. -/ -@[expose] public section +public section namespace RS /-- The interface pairs glued by `glueInterface`, top pair first. -/ +@[expose] def interfacePairs (s t u : ℕ) : List ((Fin (s + t) ⊕ Fin (t + u)) × (Fin (s + t) ⊕ Fin (t + u))) := (List.finRange t).reverse.map (fun k => @@ -69,6 +70,7 @@ theorem interfacePairs_wf (s t u : ℕ) : exact hkm (Fin.ext (by omega)).symm /-- Left labels below the interface. -/ +@[expose] def finLtEquiv (s t : ℕ) : {a : Fin (s + t) // a.val < s} ≃ Fin s where toFun a := ⟨a.val.val, a.prop⟩ invFun a := ⟨⟨a.val, by have := a.isLt; omega⟩, by @@ -78,6 +80,7 @@ def finLtEquiv (s t : ℕ) : {a : Fin (s + t) // a.val < s} ≃ Fin s where right_inv a := Fin.ext rfl /-- Right labels beyond the interface. -/ +@[expose] def finGeEquiv (t u : ℕ) : {b : Fin (t + u) // ¬ b.val < t} ≃ Fin u where toFun b := ⟨b.val.val - t, by have h1 := b.val.isLt @@ -95,6 +98,7 @@ def finGeEquiv (t u : ℕ) : {b : Fin (t + u) // ¬ b.val < t} ≃ Fin u where omega) /-- The survival predicate of the interface gluing. -/ +@[expose] def interfaceSurvPred (s t u : ℕ) : Fin (s + t) ⊕ Fin (t + u) → Prop := Sum.elim (fun a => a.val < s) (fun b => ¬ b.val < t) @@ -148,6 +152,7 @@ theorem interfaceSurv_iff (s t u : ℕ) (x : Fin (s + t) ⊕ Fin (t + u)) : /-- The labels surviving the interface gluing: left labels below `s` and right labels beyond `t`. -/ +@[expose] noncomputable def interfaceSurvEquiv (s t u : ℕ) : Fragment.FoldSurviving (Fin (s + t) ⊕ Fin (t + u)) (interfacePairs s t u) ≃ Fin s ⊕ Fin u := @@ -564,12 +569,14 @@ noncomputable def composeNormal {s t u : ℕ} /-! ### Boundary permutations across an interface -/ /-- Permuting the last `t` labels of `Fin (s + t)`. -/ +@[expose] def outPermEquiv (s : ℕ) {t : ℕ} (σ : Equiv.Perm (Fin t)) : Fin (s + t) ≃ Fin (s + t) := finSumFinEquiv.symm.trans ((Equiv.sumCongr (Equiv.refl (Fin s)) σ).trans finSumFinEquiv) /-- Permuting the first `t` labels of `Fin (t + u)`. -/ +@[expose] def inPermEquiv {t : ℕ} (σ : Equiv.Perm (Fin t)) (u : ℕ) : Fin (t + u) ≃ Fin (t + u) := finSumFinEquiv.symm.trans diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/ComposeRelabel.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/ComposeRelabel.lean index c9f904bc89..0389b6f076 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/ComposeRelabel.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/ComposeRelabel.lean @@ -26,7 +26,7 @@ its two halves `outPermEquiv_symm_low` and absorption run in either direction. -/ -@[expose] public section +public section namespace RS @@ -93,6 +93,7 @@ theorem out_ground (s t u : ℕ) (σ : Equiv.Perm (Fin u)) : /-! ### The outgoing relabel -/ /-- The peeled pairs of the outgoing relabel. -/ +@[expose] noncomputable def outQs (s t u : ℕ) (σ : Equiv.Perm (Fin u)) := Fragment.mapPairs (_root_.Equiv.sumCongr (_root_.Equiv.refl (Fin (s + t))) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/Composition.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/Composition.lean index ca667920a5..626fd556be 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/Composition.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/Composition.lean @@ -23,7 +23,7 @@ it needs each surviving label's new index as an explicit natural number. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/CompositionEquiv.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/CompositionEquiv.lean index 049abf15ea..faeb0dbad1 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/CompositionEquiv.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/CompositionEquiv.lean @@ -17,7 +17,7 @@ equivalent outputs. These are the transport lemmas through which every up-to-isomorphism identity about composition is proved. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/ConnectionRank.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/ConnectionRank.lean index 662fa636b0..03e297ca79 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/ConnectionRank.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/ConnectionRank.lean @@ -26,7 +26,7 @@ literature's supremum over finite submatrices (`edgeRankBounded_iff_submatrixRank`). -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/ConverseAssembly.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/ConverseAssembly.lean index 8121187d53..ebdd2e0714 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/ConverseAssembly.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/ConverseAssembly.lean @@ -21,7 +21,7 @@ as the base's summands, summed over its subsets and over the interface colours. -/ -@[expose] public section +public section namespace RS @@ -83,6 +83,7 @@ four sums puts the pairing in that form. open Classical in /-- A fragment tensor's term at one subset. -/ +@[expose] noncomputable def tensorTermAt {α : Type} [LinearOrder α] [Fintype α] (V : Fragment α) {k ℓ : ℕ} (h : MixedFunctional k ℓ) (s : Finset V.Flag) (x : GenBoundaryState k ℓ α) : ℂ := @@ -1501,6 +1502,7 @@ glue applies; elsewhere the value is junk the identity never reads. open Classical in /-- **The upward glue of a data family, at an open cut.** -/ +@[expose] noncomputable def glueDataOpen {α : Type} [LinearOrder α] {V : Fragment α} {i j : α} (hij : i ≠ j) (hopen : V.pairing (V.boundaryFlag i) ≠ V.boundaryFlag j) @@ -1527,6 +1529,7 @@ open Classical in closing cut rewires no directions, so no compatibility is needed; what it does need is the lift's bit, since a glued subset has two lifts and they are different subsets of the base. -/ +@[expose] noncomputable def glueDataClosed {α : Type} [LinearOrder α] {V : Fragment α} {i j : α} (hclosed : V.pairing (V.boundaryFlag i) = V.boundaryFlag j) @@ -1546,6 +1549,7 @@ noncomputable def glueDataClosed {α : Type} [LinearOrder α] open Classical in /-- **A data family under a relabel, upward.** The counterpart of `relabelDataDown`. -/ +@[expose] noncomputable def relabelDataUp {α' β' : Type} [LinearOrder α'] [LinearOrder β'] (e : α' ≃o β') {W' : Fragment α'} (𝒟 : DataFamily W') : DataFamily (W'.relabel e.toEquiv) := @@ -1567,6 +1571,7 @@ open Classical in /-- **One stage of the upward lift.** The mirror of `stepDataDown`: dispatch on whether the stage's cut closes, glue the family across it, and relabel up. -/ +@[expose] noncomputable def stepDataUp (n : ℕ) (V : Fragment (Fin (0 + (n + 1)) ⊕ Fin ((n + 1) + 0))) (b : Bool) (𝒟 : DataFamily V) : @@ -1584,6 +1589,7 @@ open Classical in /-- **The upward lift over the whole interface.** The mirror of `pushData`, carrying one bit for each stage — the lift the closing cuts leave undetermined. -/ +@[expose] noncomputable def liftData : (n : ℕ) → (V : Fragment (Fin (0 + n) ⊕ Fin (n + 0))) → (Fin n → Bool) → DataFamily V → diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/ConverseDischarge.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/ConverseDischarge.lean index 789ebbf214..ca1c139de6 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/ConverseDischarge.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/ConverseDischarge.lean @@ -16,7 +16,7 @@ the choice-free value lemma and equivalence invariance of the mixed partition value hold unconditionally. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/ConverseFamily.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/ConverseFamily.lean index 8e157ca851..c40b773cd2 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/ConverseFamily.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/ConverseFamily.lean @@ -20,7 +20,7 @@ the super form pairing of the two fragments' tensors — the tensor side of the Gram identity. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/ConverseGram.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/ConverseGram.lean index be859368ef..8c61bbefc8 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/ConverseGram.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/ConverseGram.lean @@ -23,7 +23,7 @@ the converse it gives is `regts_sevenster_converse` in `RS/TheoremConverse.lean`. -/ -@[expose] public section +public section namespace RS @@ -60,6 +60,7 @@ the fragment's own free circles riding along. The flag model carries vertex-free loops the graph model has no room for, and the partition function weights each by `k - 2ℓ`; the circles the closure creates come out of the contraction instead. -/ +@[expose] noncomputable def fragmentTensor {k ℓ : ℕ} (h : MixedFunctional k ℓ) (t : ℕ) (F : Fragment (Fin t)) (x : GenBoundaryState k ℓ (Fin t)) : ℂ := diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/ConverseIdentity.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/ConverseIdentity.lean index 184ec55bdb..603f340c71 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/ConverseIdentity.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/ConverseIdentity.lean @@ -21,7 +21,7 @@ the bits each subset itself determines, and the tensor side of that sum is `EdgeSubset.base_sum_eq_superForm_pairing_bitsOf`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/ConverseLift.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/ConverseLift.lean index 8caa2f7959..0b5cbd8e11 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/ConverseLift.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/ConverseLift.lean @@ -18,7 +18,7 @@ iterate over the interface, and the identity when the interface is empty. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/ConversePair.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/ConversePair.lean index 60b244e400..fc8e769742 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/ConversePair.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/ConversePair.lean @@ -21,7 +21,7 @@ composition's base and sums the results; `ConverseTrip.lean` carries the choice up and down the interface. -/ -@[expose] public section +public section namespace RS @@ -1018,6 +1018,7 @@ theorem cutBalanced_stepData_closed (n : ℕ) open Classical in /-- **The summand a single datum computes.** The total form of the colouring sum: zero where the subset does not carry the state. -/ +@[expose] noncomputable def edgeTermOf {α : Type} {V : Fragment α} {k ℓ : ℕ} (h : MixedFunctional k ℓ) {s : Finset V.Flag} {hc : ∀ f ∈ s, V.pairing f ∈ s} diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/ConverseTrip.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/ConverseTrip.lean index d34df9d51d..8f90869207 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/ConverseTrip.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/ConverseTrip.lean @@ -16,7 +16,7 @@ pushed back down is the family itself. Iterating over the interface gives the composition's sum in terms of the base's own subsets. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/CrossingDelta.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/CrossingDelta.lean index 449f6b686e..16efad4624 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/CrossingDelta.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/CrossingDelta.lean @@ -21,7 +21,7 @@ mixed block (per-third-chord parity transfer, `third_chord_reparity`) and the four-end block (evaluated to the mutual-crossing indicator). -/ -@[expose] public section +public section namespace RS @@ -32,6 +32,7 @@ variable {α : Type} /-- Symmetrized crossing of two chords given by (unordered) label pairs: each chord is normalized low-to-high and the two normalized chords interleave, in either order. -/ +@[expose] def chordPairCrossSym [LinearOrder α] (p q : α × α) : Prop := ChordPairCross (min p.1 p.2) (max p.1 p.2) (min q.1 q.2) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/CutMatching.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/CutMatching.lean index 24a89ad8d1..2c01f524db 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/CutMatching.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/CutMatching.lean @@ -31,7 +31,7 @@ order. That is the same orientation the mixed partition function's own through-edge product uses. -/ -@[expose] public section +public section namespace RS @@ -41,6 +41,7 @@ variable {α : Type} /-- A used label whose trail is a single edge: its entry edge is another used label's flag. -/ +@[expose] def IsThroughLabel {W : Fragment α} (F : EdgeSubset W) (i : α) : Prop := W.pairing (W.boundaryFlag i) ∈ F.boundaryFlags @@ -83,6 +84,7 @@ labels** — RS21's `M(ω,κ)`. Partners are the two ends of a trail; the direction is the trail's own, read from the orientation where the trail has an internal step and from the label order where it is a single edge. -/ +@[expose] noncomputable def cutMatching [LinearOrder α] {W : Fragment α} (F : EdgeSubset W) (κ : F.RelTransitionSystem) (o : κ.Orientation) : @@ -169,6 +171,7 @@ theorem chordInv_relabelUp [LinearOrder α] {W : Fragment α} exact (e.apply_symm_apply b).symm /-- **The used labels shift through the relabel.** -/ +@[expose] noncomputable def usedLabRelabelEquiv [LinearOrder α] {W : Fragment α} {β : Type} [LinearOrder β] (e : α ≃o β) (F : EdgeSubset W) : @@ -226,6 +229,7 @@ abbrev UsedLab {W : Fragment α} open Classical in /-- Undo the dual basis against a given set of arc directions. -/ +@[expose] noncomputable def untwistD {W : Fragment α} {k ℓ : ℕ} (F : EdgeSubset W) (tl : UsedLab F → Bool) (x : GenBoundaryState k ℓ α) : @@ -242,6 +246,7 @@ noncomputable def untwistD {W : Fragment α} open Classical in /-- The dual basis's weight against a given set of arc directions. -/ +@[expose] noncomputable def dualWeightD {W : Fragment α} [Fintype α] {k ℓ : ℕ} (F : EdgeSubset W) (tl : UsedLab F → Bool) @@ -258,6 +263,7 @@ noncomputable def dualWeightD {W : Fragment α} open Classical in /-- Undo the dual basis: partner the colour at each leg the trail leaves. -/ +@[expose] noncomputable def untwist [LinearOrder α] {W : Fragment α} {k ℓ : ℕ} (F : EdgeSubset W) (κ : F.RelTransitionSystem) (o : κ.Orientation) @@ -274,6 +280,7 @@ noncomputable def untwist [LinearOrder α] {W : Fragment α} open Classical in /-- **The dual basis's weight**: the partner signs at the legs the trail leaves. -/ +@[expose] noncomputable def dualWeight [LinearOrder α] {W : Fragment α} [Fintype α] {k ℓ : ℕ} (F : EdgeSubset W) (κ : F.RelTransitionSystem) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/CutSubsetSum.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/CutSubsetSum.lean index 60b7c18f40..6ca899598e 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/CutSubsetSum.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/CutSubsetSum.lean @@ -25,7 +25,7 @@ trips of `GlueSubsetBij`: `dropSubset` recovers the glued subset, pairing-closed subset is always a lift. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/DirMatching.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/DirMatching.lean index 52ae6e7982..8d8584483b 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/DirMatching.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/DirMatching.lean @@ -29,7 +29,7 @@ functions runs on: the product of two matchings' signs is `(-1)` to the number of components of their union. -/ -@[expose] public section +public section namespace RS @@ -55,14 +55,17 @@ variable {α : Type} /-- **The union is Eulerian**: at every point exactly one of the two matchings' arcs leaves it. -/ +@[expose] def Alternating (M N : DirMatching α) : Prop := ∀ a, N.tail a = !M.tail a /-- The rotation of an Eulerian union: follow the arc that leaves. -/ +@[expose] def rot (M N : DirMatching α) (a : α) : α := if M.tail a then M.edge a else N.edge a /-- The step backwards: follow the arc that enters. -/ +@[expose] def rotInv (M N : DirMatching α) (a : α) : α := if M.tail a then N.edge a else M.edge a @@ -105,6 +108,7 @@ theorem rot_rotInv (h : Alternating M N) (a : α) : M.edge_invol] /-- **The rotation of an Eulerian union**, as a permutation. -/ +@[expose] def rotPerm (M N : DirMatching α) (h : Alternating M N) : Equiv.Perm α where toFun := M.rot N @@ -506,6 +510,7 @@ gluing closes. /-- **The interface matching**: each label of one side paired with the same label of the other. -/ +@[expose] def interfaceMatching (γ : Type) : DirMatching (γ ⊕ γ) where edge := Sum.swap edge_invol x := by rcases x with a | a <;> rfl @@ -531,6 +536,7 @@ even size it is that one transported along the order isomorphism. -/ /-- Transport a directed matching along an equivalence. -/ +@[expose] def map {β : Type} (e : α ≃ β) (M : DirMatching α) : DirMatching β where edge b := e (M.edge (e.symm b)) edge_invol b := by simp [M.edge_invol] @@ -680,6 +686,7 @@ composes any carrier with the transposition of that arc's two ends. /-- **Reverse the direction of one arc**, leaving the pairing alone. -/ +@[expose] def reverseArc [DecidableEq α] (M : DirMatching α) (a : α) : DirMatching α where edge := M.edge @@ -871,6 +878,7 @@ fixed-point-freeness of both pairings. -/ /-- The pairing of a matching, as a permutation. -/ +@[expose] def edgePerm (M : DirMatching α) : Equiv.Perm α where toFun := M.edge invFun := M.edge @@ -1133,6 +1141,7 @@ theorem rot_rot_of_interface (h : Alternating M N) {i j : α} /-- The contracted partner map: the partners of the two identified points are matched to one another. -/ +@[expose] def contractEdge [DecidableEq α] (M : DirMatching α) (i j : α) (x : α) : α := if M.edge x = i then M.edge j @@ -1203,6 +1212,7 @@ two identified points must carry opposite directions, which is what makes the contracted directions consistent — RS21's requirement that the two Eulerian orientations induce an Eulerian orientation of the glued subset. -/ +@[expose] def contract [DecidableEq α] (M : DirMatching α) {i j : α} (hij : i ≠ j) (hopen : M.edge i ≠ j) (hdir : M.tail j = !M.tail i) : DirMatching (Surviving i j) where @@ -1239,6 +1249,7 @@ iterated. /-- The interface matching restricted to the labels surviving the identification of one of its own arcs. -/ +@[expose] def restrict (N : DirMatching α) {i j : α} (hN : N.edge i = j) : DirMatching (Surviving i j) where edge x := ⟨N.edge x.val, by @@ -1974,6 +1985,7 @@ common component. -/ /-- **Two matchings, side by side.** -/ +@[expose] def sumMatching {γ δ : Type} (M : DirMatching γ) (N : DirMatching δ) : DirMatching (γ ⊕ δ) where edge := Sum.map M.edge N.edge @@ -1993,6 +2005,7 @@ def sumMatching {γ δ : Type} (M : DirMatching γ) (N : DirMatching δ) : /-- **The interface matching across an identification** of the two sides' labels. -/ +@[expose] def interfaceEquivMatching {γ δ : Type} (e : γ ≃ δ) : DirMatching (γ ⊕ δ) where edge := Sum.elim (fun a => Sum.inr (e a)) (fun b => Sum.inl (e.symm b)) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/DisjSubsetSplit.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/DisjSubsetSplit.lean index f8d6c3873a..a55d491227 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/DisjSubsetSplit.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/DisjSubsetSplit.lean @@ -18,7 +18,7 @@ the first layer of the multiplicativity of the corrected constrained value over `disjUnion`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/DisjUnionFactor/A.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/DisjUnionFactor/A.lean index 5a5a966662..1f165bfca5 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/DisjUnionFactor/A.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/DisjUnionFactor/A.lean @@ -29,7 +29,7 @@ edge-pairing reversal is a fixed-point-free involution on walk orbits), and splits the through product and the colouring sums. -/ -@[expose] public section +public section namespace RS @@ -566,6 +566,7 @@ noncomputable def rightRel (κ : F.RelTransitionSystem) : /-- The product of two componentwise transition systems: a system on the union, inverse to the two restrictions. -/ +@[expose] noncomputable def prodRel (κ₁ : (leftSub F).RelTransitionSystem) (κ₂ : (rightSub F).RelTransitionSystem) : F.RelTransitionSystem where @@ -608,6 +609,7 @@ noncomputable def prodRel (κ₁ : (leftSub F).RelTransitionSystem) (inr_mem_internal.mp hf) w (attach_inr_eq_inr.mp hv)) /-- The product of two componentwise orientations. -/ +@[expose] noncomputable def prodOrient {κ₁ : (leftSub F).RelTransitionSystem} {κ₂ : (rightSub F).RelTransitionSystem} (o₁ : κ₁.Orientation) (o₂ : κ₂.Orientation) : diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/DisjUnionFactor/B.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/DisjUnionFactor/B.lean index fbd33aa534..f544ce5e98 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/DisjUnionFactor/B.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/DisjUnionFactor/B.lean @@ -15,7 +15,7 @@ The colouring sum and the through-summand of a union split into the two components. -/ -@[expose] public section +public section namespace RS @@ -60,6 +60,7 @@ theorem notmem_right' {g : W₂.Flag} /-- The underlying map of the join of two even colourings: each non-participating flag takes its own component's colour. -/ +@[expose] noncomputable def joinEvenVal {k : ℕ} (ψ₁ : (leftSub F).EvenColouring k) (ψ₂ : (rightSub F).EvenColouring k) : @@ -109,6 +110,7 @@ noncomputable def joinEven {k : ℕ} /-- Even colourings of a union subset are pairs of even colourings of the two restrictions. -/ +@[expose] noncomputable def joinEvenEquiv (F : EdgeSubset (W₁.disjUnion W₂)) (k : ℕ) : ((leftSub F).EvenColouring k × (rightSub F).EvenColouring k) ≃ @@ -134,6 +136,7 @@ noncomputable def joinEvenEquiv /-- The underlying map of the join of two core odd colourings: each core flag takes its own component's colour. -/ +@[expose] noncomputable def joinCoreVal {ℓ : ℕ} (φ₁ : (leftSub F).CoreOddColouring ℓ) (φ₂ : (rightSub F).CoreOddColouring ℓ) : @@ -160,6 +163,7 @@ theorem joinCoreVal_inr {ℓ : ℕ} /-- The join of two component core odd colourings as a core odd colouring of the union subset. -/ +@[expose] noncomputable def joinCore {ℓ : ℕ} (φ₁ : (leftSub F).CoreOddColouring ℓ) (φ₂ : (rightSub F).CoreOddColouring ℓ) : @@ -184,6 +188,7 @@ noncomputable def joinCore {ℓ : ℕ} /-- Core odd colourings of a union subset are pairs of core odd colourings of the two restrictions. -/ +@[expose] noncomputable def joinCoreEquiv (F : EdgeSubset (W₁.disjUnion W₂)) (ℓ : ℕ) : ((leftSub F).CoreOddColouring ℓ × diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/DisjUnionFactor/C.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/DisjUnionFactor/C.lean index 9d228d19fc..eceefb6915 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/DisjUnionFactor/C.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/DisjUnionFactor/C.lean @@ -14,7 +14,7 @@ public import LeanPool.RegtsSevenster.RS.Novel.Skein.DisjUnionFactor.B Migrating canonical data between a union and its components. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/DisjUnionProduct.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/DisjUnionProduct.lean index 74e72784aa..aedd8f80c2 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/DisjUnionProduct.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/DisjUnionProduct.lean @@ -26,7 +26,7 @@ value (`EdgeSubset.throughValueC_eq_mixedValue`). Independence across boundary pairings is not needed, there being no boundary. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/EdgeColouring.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/EdgeColouring.lean index 7db8d349dc..cf6bee7606 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/EdgeColouring.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/EdgeColouring.lean @@ -25,7 +25,7 @@ theorem about `EdgeOddColouring` rather than a definition in its own right. -/ -@[expose] public section +public section namespace RS @@ -37,6 +37,7 @@ variable {α : Type} /-- **RS21's odd colouring**: a colour on every edge of the subset, constant on the two flags of an edge. -/ +@[expose] def EdgeOddColouring {W : Fragment α} (F : EdgeSubset W) (ℓ : ℕ) : Type := {φ : {f : W.Flag // f ∈ F.flags} → Fin (2 * ℓ) // @@ -52,6 +53,7 @@ noncomputable instance EdgeOddColouring.instFintype {W : Fragment α} /-- The colouring restricted to the edges with an end at a vertex — the ones the vertex product reads. -/ +@[expose] noncomputable def EdgeOddColouring.core {W : Fragment α} {F : EdgeSubset W} {ℓ : ℕ} (φ : F.EdgeOddColouring ℓ) : F.CoreOddColouring ℓ := @@ -68,6 +70,7 @@ theorem EdgeOddColouring.pairing {W : Fragment α} /-- **The boundary constraint** `φ ∼ χ₁`: at a used label the colouring agrees with the state. -/ +@[expose] def edgeOddBoundaryMatch {W : Fragment α} {k ℓ : ℕ} (F : EdgeSubset W) (st : GenBoundaryState k ℓ α) (φ : F.EdgeOddColouring ℓ) : @@ -198,6 +201,7 @@ theorem not_coreFlags_pairing {W : Fragment α} /-- **The agreement condition**: at a through-edge the state's two legs carry one colour. -/ +@[expose] def ThroughAgree {W : Fragment α} {k ℓ : ℕ} (F : EdgeSubset W) (χ : GenBoundaryState k ℓ α) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/EdgeSum.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/EdgeSum.lean index 460a2ddfde..ffbe3b51b2 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/EdgeSum.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/EdgeSum.lean @@ -28,7 +28,7 @@ RS21's sum is the flag model's, cut down to the agreeing states — which is what the pairing of two tensors computes. -/ -@[expose] public section +public section namespace RS @@ -41,6 +41,7 @@ variable {α : Type} open scoped Classical in /-- **RS21's colouring sum** over the colourings of the whole subset. -/ +@[expose] noncomputable def edgeSum {W : Fragment α} (F : EdgeSubset W) {k ℓ : ℕ} (h : MixedFunctional k ℓ) (st : GenBoundaryState k ℓ α) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/EdgeTerm.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/EdgeTerm.lean index dd8e7c9620..7a892d0608 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/EdgeTerm.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/EdgeTerm.lean @@ -20,7 +20,7 @@ the summand is named here with the count as a parameter, extended by zero off the good subsets, exactly as `termAt` is. -/ -@[expose] public section +public section namespace RS @@ -1249,6 +1249,7 @@ theorem relabel_edgeSum {α : Type} {β : Type} {W : Fragment α} (ee : α ≃ relabel_evenColoursAt ee F ψ v, core_relabel_eq ee F φ] /-- **The data family pulled back along a relabel.** -/ +@[expose] noncomputable def relabelDataDown {α' β' : Type} [LinearOrder α'] [LinearOrder β'] (e : α' ≃o β') {W' : Fragment α'} (𝒟 : DataFamily (W'.relabel e.toEquiv)) : DataFamily W' := diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/Eulerian.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/Eulerian.lean index e618d7f6e5..d686dcad72 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/Eulerian.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/Eulerian.lean @@ -20,7 +20,7 @@ edge subsets, the Eulerian condition, transition systems and the circuit count all transport along fragment equivalences. -/ -@[expose] public section +public section namespace RS @@ -37,6 +37,7 @@ theorem ext {F₁ F₂ : EdgeSubset W} (h : F₁.flags = F₂.flags) : cases F₁; cases F₂; simpa using h /-- Transport of edge subsets along a fragment equivalence. -/ +@[expose] noncomputable def transport {W₁ W₂ : Fragment α} (e : W₁.Equiv W₂) : EdgeSubset W₁ ≃ EdgeSubset W₂ where toFun F := @@ -113,6 +114,7 @@ theorem transport_symm_transport {W₁ W₂ : Fragment α} /-- Transport of a transition system along a fragment equivalence: the conjugated matching. -/ +@[expose] noncomputable def TransitionSystem.transport {W₁ W₂ : Fragment α} (e : W₁.Equiv W₂) {F : EdgeSubset W₁} (κ : F.TransitionSystem) : (EdgeSubset.transport e F).TransitionSystem where @@ -152,6 +154,7 @@ noncomputable def TransitionSystem.transport {W₁ W₂ : Fragment α} /-- The flag equivalence restricted to a transported edge subset. -/ +@[expose] noncomputable def transportFlagsEquiv {W₁ W₂ : Fragment α} (e : W₁.Equiv W₂) (F : EdgeSubset W₁) : {f : W₁.Flag // f ∈ F.flags} ≃ diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/ExactPairingInstance.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/ExactPairingInstance.lean index 8502843370..5ceb0db5f7 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/ExactPairingInstance.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/ExactPairingInstance.lean @@ -19,7 +19,7 @@ formulation lives at equal numeral arities and collapses to the identity class. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/FibreValue.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/FibreValue.lean index 4a942e4330..f8e94c66dd 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/FibreValue.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/FibreValue.lean @@ -23,7 +23,7 @@ diagrams: `not_throughIndependenceC` exhibits two path-canonical data with different boundary pairings whose signed values differ. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/FlagGraph.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/FlagGraph.lean index 745096bce2..dde797f5a9 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/FlagGraph.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/FlagGraph.lean @@ -19,7 +19,7 @@ checks that closing the strand onto itself yields one free circle and no flags. -/ -@[expose] public section +public section namespace RS @@ -31,6 +31,7 @@ variable {α β : Type} /-- The strand: a single edge with two boundary flags and no internal vertices. The identity 2-fragment. -/ +@[expose] def strand : Fragment (Fin 2) where Flag := Fin 2 Vertex := Empty diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/FlipSignForm.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/FlipSignForm.lean index 63cbb7da7d..8e3e63bbf5 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/FlipSignForm.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/FlipSignForm.lean @@ -18,7 +18,7 @@ occurs evenly contributes exactly `(−1)^length`. That is the sign bookkeeping the paired step of Proposition 3 runs on. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/FlipSignProduct.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/FlipSignProduct.lean index 053b8859e0..b0d9c5e101 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/FlipSignProduct.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/FlipSignProduct.lean @@ -18,7 +18,7 @@ sequence in which every label occurs evenly contributes exactly `(−1)^length`. -/ -@[expose] public section +public section namespace RS @@ -28,12 +28,14 @@ variable {α : Type} {ℓ : ℕ} open scoped Classical in /-- The colour relabel of one flip. -/ +@[expose] noncomputable def flipColours (f : α → Fin (2 * ℓ)) (p : α × α) : α → Fin (2 * ℓ) := fun a => if a = p.1 ∨ a = p.2 then oddPartner ℓ (f a) else f a /-- The accumulated port-sign product of a flip sequence, at the evolving colours. -/ +@[expose] noncomputable def flipSignProd (f : α → Fin (2 * ℓ)) : List (α × α) → ℤ | [] => 1 @@ -42,6 +44,7 @@ noncomputable def flipSignProd (f : α → Fin (2 * ℓ)) : flipSignProd (flipColours f p) L /-- The label instances of a flip sequence. -/ +@[expose] def flipLabels (L : List (α × α)) : List α := L.flatMap (fun p => [p.1, p.2]) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/FourLabelParity.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/FourLabelParity.lean index b18504ee93..9be75892a1 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/FourLabelParity.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/FourLabelParity.lean @@ -29,7 +29,7 @@ four vertices is transitive iff it has no directed triangle), and a uniform decision of all indicators from the six resolved comparisons. -/ -@[expose] public section +public section /- the closing `simp` argument list is shared by all 64 order branches, and each branch uses a different subset of it -/ diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/FragmentEquiv.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/FragmentEquiv.lean index 7d44341cac..a6ada4c407 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/FragmentEquiv.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/FragmentEquiv.lean @@ -20,7 +20,7 @@ congruences for the fragment operations: relabelling, disjoint union, and single-pair gluing. -/ -@[expose] public section +public section namespace RS @@ -50,6 +50,7 @@ def refl (W : Fragment α) : Equiv W W where circles_eq := rfl /-- The inverse equivalence. -/ +@[expose] def symm (e : Equiv W₁ W₂) : Equiv W₂ W₁ where flagEquiv := e.flagEquiv.symm vertexEquiv := e.vertexEquiv.symm diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/GenBoundaryStates.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/GenBoundaryStates.lean index e274920e5c..c35157a9d7 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/GenBoundaryStates.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/GenBoundaryStates.lean @@ -19,13 +19,14 @@ states are indexed by the surviving labels of a `gluePair` rather than by an initial segment of ℕ. -/ -@[expose] public section +public section namespace RS /-- A boundary state over an arbitrary label type: one colour per label, even (`Sum.inl`) when the boundary edge is outside the Eulerian subset and odd (`Sum.inr`) when it participates. -/ +@[expose] def GenBoundaryState (k ℓ : ℕ) (α : Type) : Type := α → (Fin k ⊕ Fin (2 * ℓ)) @@ -51,6 +52,7 @@ theorem card_genBoundaryState (k ℓ : ℕ) (α : Type) [Fintype α] Fintype.card_fin] /-- The boundary-membership constraint over a general label type. -/ +@[expose] def genBoundarySubsetMatches {k ℓ : ℕ} {α : Type} (W : Fragment α) (s : Finset W.Flag) (st : GenBoundaryState k ℓ α) : Prop := @@ -75,6 +77,7 @@ end GenHelpers /-- The even-colouring boundary constraint over a general label type. -/ +@[expose] def genEvenBoundaryMatch {k ℓ : ℕ} {α : Type} {W : Fragment α} (F : EdgeSubset W) (st : GenBoundaryState k ℓ α) (hbnd : genBoundarySubsetMatches W F.flags st) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueAmbient.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueAmbient.lean index 1ca20ab559..3c26b422fe 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueAmbient.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueAmbient.lean @@ -18,7 +18,7 @@ equivalence (with the label re-bracketing), and a single-pair glue commutes with extending the ambient fragment by a disjoint union. -/ -@[expose] public section +public section namespace RS @@ -33,6 +33,7 @@ variable {α β : Type} /-- The label equivalence for gluing inside an ambient union: surviving labels of the sum at an inl-pair decompose as the surviving labels of the left factor plus the right labels. -/ +@[expose] def ambientLabelEquiv (i j : α) : SurvivingLabel (α ⊕ β) (Sum.inl i) (Sum.inl j) ≃ (SurvivingLabel α i j ⊕ β) where @@ -453,6 +454,7 @@ noncomputable def gluePairRelabel (W : Fragment α) (e : α ≃ β) /-! ### Component swap of a single glue -/ /-- Swapping the two removed labels. -/ +@[expose] def survLabelSwapEquiv (α : Type) (i j : α) : SurvivingLabel α j i ≃ SurvivingLabel α i j where toFun x := ⟨x.val, x.prop.2, x.prop.1⟩ diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueChord.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueChord.lean index 9ac01786b7..470f2af125 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueChord.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueChord.lean @@ -24,7 +24,7 @@ with the two glued labels removed, and the glued chord matching is the contraction of the lifted one at those two labels. -/ -@[expose] public section +public section namespace RS @@ -86,6 +86,7 @@ local notation "Fl" => /-- **The glued subset's used labels** are the lifted subset's, less the two glued ones. -/ +@[expose] noncomputable def usedLabelGlueEquiv (hbi : W.boundaryFlag i ∈ (Fl).boundaryFlags) (hbj : W.boundaryFlag j ∈ (Fl).boundaryFlags) : @@ -429,6 +430,7 @@ subfamily of the base's, not to all of them. /-- **The base's subsets the glue reaches**: pairing-closed, and using the two glued boundary flags together. -/ +@[expose] def AgreeingSubset (i j : α) (s : Finset W.Flag) : Prop := (∀ f ∈ s, W.pairing f ∈ s) ∧ (W.boundaryFlag i ∈ s ↔ W.boundaryFlag j ∈ s) @@ -559,6 +561,7 @@ theorem chordInv_closed_pair /-- **The glued subset's used labels** across a closed glue whose edge lies in the subset: the lifted ones, less the two glued. -/ +@[expose] noncomputable def usedLabelGlueClosedEquiv (hbi : W.boundaryFlag i ∈ (FlT).boundaryFlags) (hbj : W.boundaryFlag j ∈ (FlT).boundaryFlags) : diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueChords.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueChords.lean index 86ce084177..386a7f684f 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueChords.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueChords.lean @@ -19,7 +19,7 @@ composition over which the pairing-resolved gluing decomposition lives. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueCircuitDelta.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueCircuitDelta.lean index 90afe4df56..606ecdd14d 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueCircuitDelta.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueCircuitDelta.lean @@ -34,7 +34,7 @@ rewire. linked and none otherwise. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueComm.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueComm.lean index b2e6fbeeb2..180a2ca874 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueComm.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueComm.lean @@ -23,7 +23,7 @@ and `{k, l}` are edges determines the open/closed status of each glue and thus the circle count and rewiring behaviour. -/ -@[expose] public section +public section namespace RS @@ -36,6 +36,7 @@ variable {α : Type} /-- The swap equivalence between nested surviving-label subtypes: removing `{i, j}` then `{k, l}` is the same as removing `{k, l}` then `{i, j}`. -/ +@[expose] def swapLabelEquiv {i j k l : α} (hik : i ≠ k) (hil : i ≠ l) (hjk : j ≠ k) (hjl : j ≠ l) : SurvivingLabel (SurvivingLabel α i j) ⟨k, hik.symm, hjk.symm⟩ ⟨l, hil.symm, diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueCrossDelta.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueCrossDelta.lean index 54e147e8f3..b441a29cb1 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueCrossDelta.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueCrossDelta.lean @@ -26,7 +26,7 @@ the converse's per-cut splitting carries. cut chords. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueFold.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueFold.lean index 29445b503e..09b5e8c7b1 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueFold.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueFold.lean @@ -19,7 +19,7 @@ pair list, up to fragment equivalence composed with the canonical relabelling. -/ -@[expose] public section +public section namespace RS @@ -30,6 +30,7 @@ variable {α : Type} /-! ### Well-formedness of pair lists -/ /-- All 2n components of a list of pairs are pairwise distinct. -/ +@[expose] def PairsWF (ps : List (α × α)) : Prop := (ps.flatMap (fun p => [p.1, p.2])).Nodup @@ -83,10 +84,12 @@ theorem PairsWF.perm {ps qs : List (α × α)} (h : PairsWF ps) /-- The labels surviving all glues in a pair list: those not appearing as any component of any pair. -/ +@[expose] def FoldSurviving (α : Type) (ps : List (α × α)) : Type := {x : α // ∀ p ∈ ps, x ≠ p.1 ∧ x ≠ p.2} /-- The vacuous surviving equivalence for the empty list. -/ +@[expose] def foldSurvivingNilEquiv : FoldSurviving α [] ≃ α where toFun x := x.val invFun x := ⟨x, fun _ h => absurd h List.not_mem_nil⟩ @@ -96,6 +99,7 @@ def foldSurvivingNilEquiv : FoldSurviving α [] ≃ α where /-- The surviving-set equivalence induced by a permutation of pairs: the membership condition is ∀-quantified over ∈, so a permutation preserving membership gives an equivalence. -/ +@[expose] def foldSurvivingPermEquiv {ps qs : List (α × α)} (hperm : ps.Perm qs) : FoldSurviving α ps ≃ FoldSurviving α qs where @@ -116,6 +120,7 @@ theorem PairsWF.sep {i j : α} {ps : List (α × α)} h.head_disjoint_of /-- Coerce a well-formed tail into pairs of surviving labels. -/ +@[expose] def coercePairsList (i j : α) : (ps : List (α × α)) → PairsSep i j ps → @@ -187,6 +192,7 @@ theorem coercePairsList_mem (i j : α) : (first remove i, j from α to get SurvivingLabel; then remove the coerced tail pairs) and the flat surviving type (remove (i, j) :: ps at once). -/ +@[expose] def foldFlatten (i j : α) (ps : List (α × α)) (h : PairsSep i j ps) : FoldSurviving (SurvivingLabel α i j) (coercePairsList i j ps h) ≃ @@ -214,6 +220,7 @@ def foldFlatten (i j : α) (ps : List (α × α)) /-! ### The fold: iterated single-pair gluing -/ /-- Fold a well-formed pair list using a bound on its length as structural fuel. -/ +@[expose] noncomputable def glueListAux : (n : ℕ) → {α : Type} → (W : Fragment α) → (ps : List (α × α)) → PairsWF ps → @@ -233,6 +240,7 @@ noncomputable def glueListAux : /-- Iterated single-pair gluing along a list of distinct pairs. Glues each pair in order; the result is labelled by the elements of α not appearing in any pair. -/ +@[expose] noncomputable def glueList {α : Type} (W : Fragment α) (ps : List (α × α)) (h : PairsWF ps) : Fragment (FoldSurviving α ps) := @@ -310,6 +318,7 @@ noncomputable def glueListCongr {α : Type} /-! ### Relabelling commutes with the fold -/ /-- Map a pair list through an equivalence. -/ +@[expose] def mapPairs (e : α ≃ β) (ps : List (α × α)) : List (β × β) := ps.map (Prod.map e e) @@ -332,6 +341,7 @@ theorem mapPairs_wf (e : α ≃ β) (ps : List (α × α)) /-- The canonical equivalence on FoldSurviving induced by a label equivalence. -/ +@[expose] def foldSurvivingMapEquiv (e : α ≃ β) (ps : List (α × α)) : FoldSurviving α ps ≃ FoldSurviving β (mapPairs e ps) where toFun x := ⟨e x.val, fun p hp => by @@ -787,6 +797,7 @@ abbrev PairsSepAll (ps qs : List (α × α)) : Prop := /-- Pairs avoiding an earlier pair list lift into its surviving labels. -/ +@[expose] def liftPairs (ps : List (α × α)) : (qs : List (α × α)) → PairsSepAll ps qs → List (FoldSurviving α ps × FoldSurviving α ps) @@ -882,6 +893,7 @@ theorem liftPairs_mem (ps : List (α × α)) : /-- The two-stage surviving labels flatten to the concatenation's surviving labels. -/ +@[expose] def appendFlatten (ps qs : List (α × α)) (h : PairsSepAll ps qs) : FoldSurviving (FoldSurviving α ps) (liftPairs ps qs h) ≃ FoldSurviving α (ps ++ qs) where @@ -1140,6 +1152,7 @@ noncomputable def glueListAppend (W : Fragment α) /-- Embed a pair list into the left summand of a disjoint union. -/ +@[expose] def inlPairs (ps : List (α × α)) : List ((α ⊕ β) × (α ⊕ β)) := ps.map (Prod.map Sum.inl Sum.inl) @@ -1166,6 +1179,7 @@ theorem inlPairs_wf (ps : List (α × α)) /-- The surviving-label equivalence for left-embedded pairs: inl-labels survive iff they survive the original list; all inr-labels survive. -/ +@[expose] def inlFoldEquiv (ps : List (α × α)) : FoldSurviving (α ⊕ β) (inlPairs (β := β) ps) ≃ @@ -1216,6 +1230,7 @@ def inlFoldEquiv (ps : List (α × α)) : /-- Embed a pair list into the right summand of a disjoint union. -/ +@[expose] def inrPairs (qs : List (β × β)) : List ((α ⊕ β) × (α ⊕ β)) := qs.map (Prod.map Sum.inr Sum.inr) @@ -1242,6 +1257,7 @@ theorem inrPairs_wf (qs : List (β × β)) /-- The surviving-label equivalence for right-embedded pairs: inr-labels survive iff they survive the original list; all inl-labels survive. -/ +@[expose] def inrFoldEquiv (qs : List (β × β)) : FoldSurviving (α ⊕ β) (inrPairs (α := α) qs) ≃ @@ -1783,6 +1799,7 @@ theorem swapPairs_wf (ps : List (α × α)) /-- Surviving labels are invariant under swapping pair components: `x ≠ p.1 ∧ x ≠ p.2` iff `x ≠ p.2 ∧ x ≠ p.1`. -/ +@[expose] def swapFoldEquiv (ps : List (α × α)) : FoldSurviving α (ps.map Prod.swap) ≃ FoldSurviving α ps where diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueLedger.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueLedger.lean index ceb1ab78e8..ced439ed18 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueLedger.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueLedger.lean @@ -26,7 +26,7 @@ the same on both sides, the chord matching is unchanged, and so is the circuit count. -/ -@[expose] public section +public section namespace RS @@ -164,6 +164,7 @@ theorem chordInv_glueOpen_miss include hc' hc hni in /-- **The used labels are the same** across a glue whose edge the subset misses. -/ +@[expose] noncomputable def usedLabelGlueMissEquiv : {l : SurvivingLabel α i j // (W.gluePairOpen i j hij hopen).boundaryFlag l ∈ @@ -331,6 +332,7 @@ theorem boundaryFlagJ_not_mem_of_closed_miss : include hij hc' hcF in /-- **The used labels are the same** across a closed glue whose edge the subset leaves out. -/ +@[expose] noncomputable def usedLabelGlueClosedMissEquiv : {l : SurvivingLabel α i j // (W.gluePairClosed i j hclosed).boundaryFlag l ∈ diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/GluePathMatch.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/GluePathMatch.lean index af0184e575..89537eda01 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/GluePathMatch.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/GluePathMatch.lean @@ -32,7 +32,7 @@ terms of the `pathMatch` of `κ`: lifted one. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueRelTransport.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueRelTransport.lean index ea017646df..74b191b75a 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueRelTransport.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueRelTransport.lean @@ -30,7 +30,7 @@ of `GlueCircuitDelta.lean` reads), and prove that edge's flags do not participate. -/ -@[expose] public section +public section namespace RS @@ -119,6 +119,7 @@ theorem internal_surviving (i j : α) {F : EdgeSubset W} /-- Extend a surviving-flag self-map to all of `W.Flag`: apply it through the subtype on surviving flags, identity elsewhere. -/ +@[expose] noncomputable def unglueMatch (m : SurvivingFlag W i j → SurvivingFlag W i j) (f : W.Flag) : W.Flag := @@ -168,6 +169,7 @@ theorem glueMatch_val_of_mem (m : W.Flag → W.Flag) /-- Extend a surviving-flag orientation to all of `W.Flag`: through the subtype on surviving flags, `false` elsewhere. -/ +@[expose] noncomputable def unglueIsOut (b : SurvivingFlag W i j → Bool) (f : W.Flag) : Bool := if h : f ≠ W.boundaryFlag i ∧ f ≠ W.boundaryFlag j then @@ -392,6 +394,7 @@ theorem unglueOpen_glueOpen_match surviving flags, `false` junk at the two glued boundary flags (which are never internal, so the structure fields do not constrain them). -/ +@[expose] noncomputable def unglueOrientationOpen (κ' : (Fg).RelTransitionSystem) (o' : κ'.Orientation) : (RelTransitionSystem.unglueOpen hij hopen s' hc' hc @@ -1006,6 +1009,7 @@ theorem unglueClosed_glueClosed_match /-- **Unglue an orientation (closed case)**: through the subtype, `false` junk at the two glued boundary flags. -/ +@[expose] noncomputable def unglueOrientationClosed (κ' : (Fg).RelTransitionSystem) (o' : κ'.Orientation) : (RelTransitionSystem.unglueClosed hclosed b s' hc' hc @@ -1041,6 +1045,7 @@ noncomputable def unglueOrientationClosed /-- **Glue an orientation (closed case)**: through `Subtype.val`. Unconditional: the closed glued pairing agrees with the `W`-pairing on surviving flags. -/ +@[expose] noncomputable def glueOrientationClosed (κ : (Fl).RelTransitionSystem) (o : κ.Orientation) : (RelTransitionSystem.glueClosed hclosed b s' hc' hc diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueSplit.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueSplit.lean index 07baaa0c84..1e0733d23e 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueSplit.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueSplit.lean @@ -22,12 +22,13 @@ the signed path-canonical value of `PathCanon.lean`, whose within-pairing independence is `PropThreeOpen.lean`. -/ -@[expose] public section +public section namespace RS /-- Extension of a boundary state on the surviving labels to the full label type, prescribing the two glued ends. -/ +@[expose] noncomputable def GenBoundaryState.extendPair {k ℓ : ℕ} {α : Type} (i j : α) (st : GenBoundaryState k ℓ (Fragment.SurvivingLabel α i j)) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueSplitProof/A.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueSplitProof/A.lean index 55e0fd3c88..3c66babe38 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueSplitProof/A.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueSplitProof/A.lean @@ -28,7 +28,7 @@ two ends with `i = 1, j = 0` gives `k + 2ℓ` instead of `k − 2ℓ`. All cuts in the development are therefore ordered. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueSplitProof/C.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueSplitProof/C.lean index 5a16946af8..3ec789ab78 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueSplitProof/C.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueSplitProof/C.lean @@ -15,7 +15,7 @@ The per-subset ledgers and the open-cut engine, assembled into the master splitting identities. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueSubsetBij.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueSubsetBij.lean index 8af489c533..223419a39b 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueSubsetBij.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/GlueSubsetBij.lean @@ -20,7 +20,7 @@ unified by rewiring) and the closed case (they bound a common edge, which closes into a free circle parameterized by a Bool). -/ -@[expose] public section +public section namespace RS @@ -55,6 +55,7 @@ variable {W : Fragment α} {i j : α} /-- In the open case, the W-partner of boundary flag `i` is a surviving flag (it is neither `boundaryFlag i` nor `boundaryFlag j`). -/ +@[expose] def partnerSurvI (hopen : W.pairing (W.boundaryFlag i) ≠ W.boundaryFlag j) : SurvivingFlag W i j := @@ -64,6 +65,7 @@ def partnerSurvI /-- In the open case, the W-partner of boundary flag `j` is a surviving flag. -/ +@[expose] def partnerSurvJ (hopen : W.pairing (W.boundaryFlag i) ≠ W.boundaryFlag j) : SurvivingFlag W i j := @@ -298,6 +300,7 @@ variable {W : Fragment α} {i j : α} image under `Subtype.val`, together with both boundary flags `i` and `j` iff the Bool `b` is true (the closed-off circle-edge participates). -/ +@[expose] noncomputable def liftSubsetClosed (s' : Finset (SurvivingFlag W i j)) (b : Bool) : Finset W.Flag := diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/GramRank.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/GramRank.lean index 9cbc4f6256..7782163c5a 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/GramRank.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/GramRank.lean @@ -22,7 +22,7 @@ Gram matrix: a Gram factorization exhibits each row as a combination of the columns indexed by the ambient space's coordinates. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/HomCompose.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/HomCompose.lean index 23c7ea90b0..b3bfc5c400 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/HomCompose.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/HomCompose.lean @@ -17,13 +17,14 @@ bilinear composition of Hom spaces — the composition of the skein category. On fragment classes it is composition of fragments. -/ -@[expose] public section +public section namespace RS variable {R : ℕ} (f : EdgeRankParameter R) /-- The composition into the quotient, for a fixed left factor. -/ +@[expose] noncomputable def homComposeAux (s t u : ℕ) (x : Fragment (Fin (s + t)) →₀ ℂ) : HomSpace f.val (t + u) →ₗ[ℂ] HomSpace f.val (s + u) := @@ -48,6 +49,7 @@ theorem homComposeAux_mk (s t u : ℕ) /-- **The descended composition** of the skein category: the bilinear composition of Hom spaces. -/ +@[expose] noncomputable def HomSpace.comp (s t u : ℕ) : HomSpace f.val (s + t) →ₗ[ℂ] HomSpace f.val (t + u) →ₗ[ℂ] HomSpace f.val (s + u) := diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/HomSpaces.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/HomSpaces.lean index 9c71b745bb..6ed86d9efe 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/HomSpaces.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/HomSpaces.lean @@ -18,13 +18,14 @@ rank through the first isomorphism theorem: the quotient by the kernel is equivalent to the range of the pairing map. -/ -@[expose] public section +public section namespace RS /-- The Hom space of the skein category at arity `t`: the free module on `t`-fragments modulo the kernel of the connection pairing. -/ +@[expose] noncomputable def HomSpace (f : ClosedFragment → ℂ) (t : ℕ) : Type 1 := (Fragment (Fin t) →₀ ℂ) ⧸ LinearMap.ker (connectionMap f t) @@ -40,6 +41,7 @@ noncomputable instance (f : ClosedFragment → ℂ) (t : ℕ) : Submodule.Quotient.module _ /-- The class of a single fragment in the Hom space. -/ +@[expose] noncomputable def HomSpace.ofFragment (f : ClosedFragment → ℂ) {t : ℕ} (F : Fragment (Fin t)) : HomSpace f t := Submodule.Quotient.mk (Finsupp.single F 1) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/HomTensor.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/HomTensor.lean index 8a0dd047e8..89ae89a0d4 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/HomTensor.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/HomTensor.lean @@ -17,13 +17,14 @@ Hom spaces — the monoidal product of the skein category. On fragment classes it is the tensor of fragments. -/ -@[expose] public section +public section namespace RS variable {R : ℕ} (f : EdgeRankParameter R) /-- The tensor into the quotient, for a fixed left factor. -/ +@[expose] noncomputable def homTensorAux (s t u v : ℕ) (x : Fragment (Fin (s + t)) →₀ ℂ) : HomSpace f.val (u + v) →ₗ[ℂ] @@ -51,6 +52,7 @@ theorem homTensorAux_mk (s t u v : ℕ) (tensorFinsupp s t u v x y) := rfl /-- **The descended monoidal product** of the skein category. -/ +@[expose] noncomputable def HomSpace.tensor (s t u v : ℕ) : HomSpace f.val (s + t) →ₗ[ℂ] HomSpace f.val (u + v) →ₗ[ℂ] diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/HomTraceCyclic.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/HomTraceCyclic.lean index db399aeaf8..0a49d34031 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/HomTraceCyclic.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/HomTraceCyclic.lean @@ -17,7 +17,7 @@ order. Bilinear induction with `fragTrace_comm` at the singles. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/HomTraceNondegenerate.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/HomTraceNondegenerate.lean index 4e01a22e02..473f5aa2af 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/HomTraceNondegenerate.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/HomTraceNondegenerate.lean @@ -18,7 +18,7 @@ the input to the semisimplicity of the End algebras (Theorem 4.4) and the atom dichotomy (Lemma 4.5). -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/IdentityLaw.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/IdentityLaw.lean index 7d91b02691..8c6915d0af 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/IdentityLaw.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/IdentityLaw.lean @@ -26,7 +26,7 @@ interface labels `C`, and the outer labels `D`; the shuffle constructor permutation with definitional inverses. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/IdentityLawRight.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/IdentityLawRight.lean index d3b1b1bfcc..7159e6f882 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/IdentityLawRight.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/IdentityLawRight.lean @@ -37,7 +37,7 @@ The stage equivalence maps `Fin (s + u) ⊕ Fin (t' + t')` to The shuffle: `((D ⊕ C) ⊕ B) ⊕ (A ⊕ A') ≃ (D ⊕ C) ⊕ ((A ⊕ A') ⊕ B)`. -/ -@[expose] public section +public section namespace RS @@ -45,6 +45,7 @@ namespace RS output, F's outer labels and the not-yet-glued interface labels; on the right output, the strand-bundle labels followed by F's already-glued trailing labels. -/ +@[expose] def stageEquivR (s t' u : ℕ) (ht : t' ≤ u) : Fin (s + u) ⊕ Fin (t' + t') ≃ Fin (s + t') ⊕ Fin (t' + u) where toFun x := match x with diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/InterfaceAlternate.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/InterfaceAlternate.lean index 17b01a8240..b85894b682 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/InterfaceAlternate.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/InterfaceAlternate.lean @@ -24,7 +24,7 @@ sides — the unglued orientation's chain directions at the two glued labels are opposite. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/InterfaceContract.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/InterfaceContract.lean index 3fb7a3d154..fc8d211ce7 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/InterfaceContract.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/InterfaceContract.lean @@ -26,7 +26,7 @@ at a closed cut, and at an open one the configuration's own kernel, which is the same form read in the basis the tensor twists into. -/ -@[expose] public section +public section namespace RS @@ -47,6 +47,7 @@ open Fragment Equiv /-- The fragment one stage down: glue the top interface pair, then relabel. -/ +@[expose] noncomputable def stepFragment (n : ℕ) (V : Fragment (Fin (0 + (n + 1)) ⊕ Fin ((n + 1) + 0))) : Fragment (Fin (0 + n) ⊕ Fin (n + 0)) := @@ -93,6 +94,7 @@ open Classical in whose drop is closed under the rewire the base's data are the unglue of the glued fragment's; elsewhere any choice serves, the summand vanishing there. -/ +@[expose] noncomputable def unglueDataOpen [LinearOrder L] {V : Fragment L} {i : L} {j : L} (hij : i ≠ j) (hopen : V.pairing (V.boundaryFlag i) ≠ V.boundaryFlag j) @@ -197,6 +199,7 @@ open Classical in /-- **The glued fragment's data at a closed cut, read on the base.** Here no agreement is needed: a closed subset's drop is always closed under the glued pairing, the two cut flags being partners. -/ +@[expose] noncomputable def unglueDataClosed [LinearOrder L] {V : Fragment L} {i : L} {j : L} (hij : i ≠ j) (hclosed : V.pairing (V.boundaryFlag i) = V.boundaryFlag j) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/InterfaceCut.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/InterfaceCut.lean index 1d840f1eb6..81b801501d 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/InterfaceCut.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/InterfaceCut.lean @@ -29,7 +29,7 @@ condition under which a glued edge is in the Eulerian subset or out of it, and it is what the boundary state pins. -/ -@[expose] public section +public section namespace RS @@ -42,6 +42,7 @@ variable {γ δ : Type} /-- **The subset uses the two halves of every interface pair together.** -/ +@[expose] def InterfacePaired {V : Fragment (γ ⊕ δ)} (F : EdgeSubset V) (e : γ ≃ δ) : Prop := ∀ a : γ, V.boundaryFlag (Sum.inl a) ∈ F.boundaryFlags @@ -65,6 +66,7 @@ def usedSideEquiv {V : Fragment (γ ⊕ δ)} (F : EdgeSubset V) : right_inv := fun x => by cases x <;> rfl /-- The identification of the two sides' used labels. -/ +@[expose] def interfaceSideEquiv {V : Fragment (γ ⊕ δ)} (F : EdgeSubset V) (e : γ ≃ δ) (hp : InterfacePaired F e) : {a : γ // V.boundaryFlag (Sum.inl a) ∈ F.boundaryFlags} @@ -284,6 +286,7 @@ is the identity on indices. section InterfaceStep /-- The identification of the two halves at interface size `n`. -/ +@[expose] def stepIdent (n : ℕ) : Fin (0 + n) ≃ Fin (n + 0) := finCongr (by omega) @@ -494,6 +497,7 @@ section DisjUnionCut variable {α β : Type} /-- The used labels of the left half. -/ +@[expose] def usedLeftEquiv {W₁ : Fragment α} {W₂ : Fragment β} (F : EdgeSubset (W₁.disjUnion W₂)) : {a : α // @@ -502,6 +506,7 @@ def usedLeftEquiv Equiv.subtypeEquivRight (fun _ => inl_mem_boundary) /-- The used labels of the right half. -/ +@[expose] def usedRightEquiv {W₁ : Fragment α} {W₂ : Fragment β} (F : EdgeSubset (W₁.disjUnion W₂)) : {b : β // @@ -600,6 +605,7 @@ theorem cutMatching_disjUnion_edge /-- The interface identification, read on the two sides' own used labels. -/ +@[expose] def interfaceSideDisjEquiv {W₁ : Fragment α} {W₂ : Fragment β} (F : EdgeSubset (W₁.disjUnion W₂)) (e : α ≃ β) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/InterfaceOrderIso.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/InterfaceOrderIso.lean index 81d0075e30..88b9a8be7e 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/InterfaceOrderIso.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/InterfaceOrderIso.lean @@ -35,7 +35,7 @@ sum orders explicitly through the reducible aliases which are definitionally the projections of `sumLexLinearOrder`. -/ -@[expose] public section +public section namespace RS @@ -103,6 +103,7 @@ theorem strictMono_equiv_symm [LinearOrder α] [LinearOrder β] /-- A strictly monotone equivalence between linear orders, as an order isomorphism (keeping the underlying equivalence on the nose). -/ +@[expose] def orderIsoOfStrictMonoEquiv [LinearOrder α] [LinearOrder β] (e : α ≃ β) (h : StrictMono e) : α ≃o β := @@ -154,6 +155,7 @@ theorem finSumFinEquiv_strictMono (m n : ℕ) : /-- `finSumFinEquiv` as an order isomorphism for the lexicographic order on `Fin m ⊕ Fin n`. -/ +@[expose] def finSumFinOrderIso (m n : ℕ) : @OrderIso (Fin m ⊕ Fin n) (Fin (m + n)) (sumLexLE (Fin m) (Fin n)) _ := @@ -248,6 +250,7 @@ theorem interfaceStepEquiv_strictMono (s t u : ℕ) : /-- The interface-step re-indexing (`interfaceStepEquiv`) as an order isomorphism for the lexicographic orders. -/ +@[expose] noncomputable def interfaceStepOrderIso (s t u : ℕ) : @OrderIso {x : Fin (s + t + 1) ⊕ Fin (t + 1 + u) // diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/InterfaceShift.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/InterfaceShift.lean index a074bbe504..b3c7e31a02 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/InterfaceShift.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/InterfaceShift.lean @@ -20,7 +20,7 @@ engine of the permutation calculus of §3.1: strand fragments compose by composing their permutations. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/InvolutionCard.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/InvolutionCard.lean index f4b75b2a2a..841545ed07 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/InvolutionCard.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/InvolutionCard.lean @@ -19,7 +19,7 @@ edges match flags in pairs, chords match labels in pairs, and a directed matching matches its points in pairs. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/LabelChords.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/LabelChords.lean index 58badba453..48e9f7e9d7 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/LabelChords.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/LabelChords.lean @@ -18,7 +18,7 @@ index over which the pairing-resolved open-sector values live. `SamePairing` is exactly equality of chord diagrams. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/LedgerCast.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/LedgerCast.lean index 907feea55e..02b2cfaba6 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/LedgerCast.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/LedgerCast.lean @@ -22,7 +22,7 @@ Nothing here is more than `subst`: the transports exist so the recursion can name them rather than unfold them. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/LedgerRecursion.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/LedgerRecursion.lean index e9fda7b0c0..7408e66950 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/LedgerRecursion.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/LedgerRecursion.lean @@ -23,7 +23,7 @@ matching exist and that a glue preserves. This file names that data and the step that advances it. -/ -@[expose] public section +public section namespace RS @@ -128,6 +128,7 @@ noncomputable def stepFlags : V.dropSubset (cutL n) (cutR n) D.sub.flags /-- Whether the subset carries the closed cut's own edge. -/ +@[expose] noncomputable def stepBit : Bool := decide (V.boundaryFlag (cutL n) ∈ D.sub.flags) @@ -331,6 +332,7 @@ noncomputable def glueData : (n : ℕ) → open Classical in /-- **The cuts at which a component disappears**: the closed ones whose edge the subset carries. -/ +@[expose] noncomputable def glueCount : (n : ℕ) → (V : Fragment (Fin (0 + n) ⊕ Fin (n + 0))) → StageData n V → ℕ | 0, _, _ => 0 @@ -657,6 +659,7 @@ theorem stageLedger_disjUnion (n : ℕ) /-- The interface identification at size `n`, as an order isomorphism. -/ +@[expose] def stepIdentOrderIso (n : ℕ) : Fin (0 + n) ≃o Fin (n + 0) := Fin.castOrderIso (by omega) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/LedgerSets.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/LedgerSets.lean index eb321acb50..9e9344971d 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/LedgerSets.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/LedgerSets.lean @@ -27,7 +27,7 @@ and vanishes on a pairing-preserving one (`statusDiff_of_samePairing`). -/ -@[expose] public section +public section namespace RS @@ -95,6 +95,7 @@ theorem symmU_assoc (E₁ E₂ E₃ : Finset α) : open scoped Classical in /-- The two-element label set of a label pair. -/ +@[expose] noncomputable def pairSet (p : α × α) : Finset α := {p.1, p.2} /-- Membership in a pair's label set. -/ @@ -105,6 +106,7 @@ theorem mem_pairSet {p : α × α} {i : α} : rw [Finset.mem_insert, Finset.mem_singleton] /-- The symmetric-difference fold of a list of label pairs. -/ +@[expose] noncomputable def pairFold (L : List (α × α)) : Finset α := L.foldr (fun p E => symmU (pairSet p) E) ∅ @@ -185,6 +187,7 @@ variable {α : Type} /-- A chord pair whose low end is anti-canonical for `o`: the label pair of a chain flipped by the recanonicalization of `o`. -/ +@[expose] def AntiLowPair [LinearOrder α] {W : Fragment α} {F : EdgeSubset W} {κ : F.RelTransitionSystem} (o : κ.Orientation) (p : α × α) : Prop := @@ -258,6 +261,7 @@ variable {W : Fragment α} {F : EdgeSubset W} /-- The status difference of two systems: the labels whose high-status differs — the potential of the canonical route's accumulated relabel. -/ +@[expose] noncomputable def statusDiff [LinearOrder α] (κ κ' : F.RelTransitionSystem) : Finset α := symmU (highSet κ) (highSet κ') diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/LedgerStage.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/LedgerStage.lean index f8f1983cf5..23baed65f8 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/LedgerStage.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/LedgerStage.lean @@ -20,7 +20,7 @@ given that way, so that a stage consumes only the involution and the one equation saying the glued labels are partners. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/LedgerValue.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/LedgerValue.lean index f383ee4605..c5e44c37e7 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/LedgerValue.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/LedgerValue.lean @@ -21,7 +21,7 @@ existence. The single-step disjunct is a theorem the paired step in value form. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/LoopExample.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/LoopExample.lean index 569eded70b..cedd21fd29 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/LoopExample.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/LoopExample.lean @@ -29,7 +29,7 @@ odd colourings contribute through a common basis vector. A sign error in any one of them changes the answer. -/ -@[expose] public section +public section namespace RS @@ -38,6 +38,7 @@ namespace RS /-- **The loop graph** `L`: one vertex, one edge, both of whose flags are attached to that vertex. No boundary labels, and no free circles — the loop is an edge, not a circle. -/ +@[expose] def loopGraph : ClosedFragment where Flag := Bool Vertex := Unit diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/LoopVerify.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/LoopVerify.lean index 4559e23649..fedfd3aeb8 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/LoopVerify.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/LoopVerify.lean @@ -32,7 +32,7 @@ summands are `−1` and `0`, so the canonical value depends on the boundary pairing and independence can only be asserted within one. -/ -@[expose] public section +public section namespace RS @@ -44,6 +44,7 @@ open EdgeSubset /-- `cKappa` repaired along `cSquare` (`0 1 2 3`): the matching `0 ↔ 2`, `1 ↔ 3`, with chords `(4,7)` and `(5,6)`. -/ +@[expose] def lvKappa₂R : cSubset.RelTransitionSystem := cKappa.repair 0 1 2 3 cV cSquare @@ -51,6 +52,7 @@ def lvKappa₂R : cSubset.RelTransitionSystem := /-- `cO` with the boundary chain `5–1–3–6` (flags `1, 3`) reversed — the chain carrying the colour `3`. -/ +@[expose] def lvO₂flip : lvKappa₂R.Orientation where isOut := ![false, false, true, true, false, false, false, false] match_flip := fun f hf => by diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/MixedPartition.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/MixedPartition.lean index ef7c9ee9ce..5bb7110ef8 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/MixedPartition.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/MixedPartition.lean @@ -20,7 +20,7 @@ repeated colours evaluate to zero — and the transport of the Definition 5 summand along fragment equivalences. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/MonoidalInstance.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/MonoidalInstance.lean index 3396549842..e89e0741f8 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/MonoidalInstance.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/MonoidalInstance.lean @@ -18,7 +18,7 @@ and the coherence diagrams, all collapsing through the bundle-map calculus. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/MonoidalNat.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/MonoidalNat.lean index f70dcfeda8..19e182d4a1 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/MonoidalNat.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/MonoidalNat.lean @@ -21,7 +21,7 @@ associativity and unit laws are relabellings by casts, and all casts collapse through the transport lemmas. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/MonoidalStruct.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/MonoidalStruct.lean index da12455d59..a34bec292d 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/MonoidalStruct.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/MonoidalStruct.lean @@ -20,7 +20,7 @@ the coherence lemmas provable without the interchange law bundle-map calculus. -/ -@[expose] public section +public section namespace RS @@ -29,6 +29,7 @@ open CategoryTheory variable {R : ℕ} (f : EdgeRankParameter R) /-- The cast isomorphism between equal-arity objects. -/ +@[expose] noncomputable def castIso {n m : ℕ} (h : n = m) : (SkeinObj.mk n : SkeinObj f) ≅ SkeinObj.mk m where hom := bundleMapClass f (finCongr h) @@ -152,6 +153,7 @@ theorem transposeEquiv_trans_self (a b : ℕ) : /-- **The braiding isomorphism** of the skein category: the block-transpose bundle map. -/ +@[expose] noncomputable def skeinBraiding (X Y : SkeinObj f) : MonoidalCategoryStruct.tensorObj X Y ≅ MonoidalCategoryStruct.tensorObj Y X where diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/Multiplicativity.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/Multiplicativity.lean index 77c0934d8e..29aec06dd0 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/Multiplicativity.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/Multiplicativity.lean @@ -18,11 +18,12 @@ normalized there), so every row is a scalar multiple of it, and evaluating at the empty graph identifies the scalar. -/ -@[expose] public section +public section namespace RS /-- Disjoint union of closed fragments. -/ +@[expose] noncomputable def ClosedFragment.union (W₁ W₂ : ClosedFragment) : ClosedFragment := (W₁.disjUnion W₂).relabel (Equiv.equivOfIsEmpty _ _) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/NonSeparatedStep.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/NonSeparatedStep.lean index e7ba9c6515..9fd1bbf3c6 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/NonSeparatedStep.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/NonSeparatedStep.lean @@ -57,7 +57,7 @@ the parity files: merges the circuit into `a`'s component, Δ = −1). -/ -@[expose] public section +public section namespace RS @@ -211,6 +211,7 @@ variable {F : EdgeSubset W} {κ : F.RelTransitionSystem} {a b c d : W.Flag} {S : Finset W.Flag} /-- The `∂`-flip of a core odd colouring on the segment edges. -/ +@[expose] noncomputable def segFlipColouring (hSpair : ∀ f ∈ S, W.pairing f ∈ S) {ℓ : ℕ} (φ : F.CoreOddColouring ℓ) : F.CoreOddColouring ℓ := ⟨fun g => if g.val ∈ S then oddPartner ℓ (φ.val g) else φ.val g, @@ -1581,6 +1582,7 @@ variable {F : EdgeSubset W} /-- The walk from `c` reaches `a` with internal pairings: the same-component configuration of the non-separated move (both the same-circuit and the same-chain reversal sub-cases). -/ +@[expose] def WalkReach (κ : F.RelTransitionSystem) (c a : W.Flag) : Prop := ∃ m : ℕ, 1 ≤ m ∧ (∀ j, j < m → @@ -1919,6 +1921,7 @@ square preserves the circuit-count parity — the segment reversal maps the two traversal orbits of the affected component onto two orbits of the same sizes (Δ = 0 on circuits; chains carry no periodic flags). Proved in `OrbitParities.lean`. -/ +@[expose] def NonSeparatedSegmentParity : Prop := ∀ {α : Type} {W : Fragment α} {F : EdgeSubset W} {κ : F.RelTransitionSystem} {a b c d : W.Flag} {v : W.Vertex} @@ -1931,6 +1934,7 @@ def NonSeparatedSegmentParity : Prop := `c`-edge lies on a circuit not carrying `a` flips the count parity — the splice merges the circuit into `a`'s component (Δ = −1). Proved in `OrbitParities.lean`. -/ +@[expose] def NonSeparatedMergeParity : Prop := ∀ {α : Type} {W : Fragment α} {F : EdgeSubset W} {κ : F.RelTransitionSystem} {a b c d : W.Flag} {v : W.Vertex} diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/OpenCircuits.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/OpenCircuits.lean index cf1d7faab8..c4d3b63d62 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/OpenCircuits.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/OpenCircuits.lean @@ -37,7 +37,7 @@ whose forward walk eventually returns to them. not periodic. -/ -@[expose] public section +public section namespace RS @@ -53,6 +53,7 @@ variable {F : EdgeSubset W} /-- A flag on a closed circuit: it is internal, every intermediate pairing stays internal, and the walk returns to it. -/ +@[expose] def RelTransitionSystem.PeriodicFlag (κ : F.RelTransitionSystem) (f : W.Flag) : Prop := f ∈ F.internalFlags ∧ @@ -136,6 +137,7 @@ theorem RelTransitionSystem.periodicFlag_step open scoped Classical in /-- The finset of periodic flags. -/ +@[expose] noncomputable def RelTransitionSystem.periodicFlags (κ : F.RelTransitionSystem) : Finset W.Flag := F.internalFlags.filter (fun f => @@ -185,6 +187,7 @@ theorem RelTransitionSystem.internalWalk_injOn_periodic /-! ### 3. walkPermPeriodic -/ /-- The walk permutation restricted to periodic flags. -/ +@[expose] noncomputable def RelTransitionSystem.walkPermPeriodic (κ : F.RelTransitionSystem) : Equiv.Perm {f : W.Flag // f ∈ κ.periodicFlags} := @@ -200,6 +203,7 @@ noncomputable def RelTransitionSystem.walkPermPeriodic /-- The open circuit count: half the orbit count of the walk on periodic flags. -/ +@[expose] noncomputable def RelTransitionSystem.openCircuitCount (κ : F.RelTransitionSystem) : ℕ := (κ.walkPermPeriodic.cycleType.card + @@ -473,6 +477,7 @@ theorem pairing_mem_periodicFlags (κ : F.RelTransitionSystem) · rw [hrev n le_rfl, Nat.sub_self, iterWalk_zero] /-- The edge-pairing reversal on periodic flags. -/ +@[expose] noncomputable def revPerm (κ : F.RelTransitionSystem) : Equiv.Perm {f : W.Flag // f ∈ κ.periodicFlags} := Function.Involutive.toPerm diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/OrbitParities.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/OrbitParities.lean index 3958600b20..0241bd1452 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/OrbitParities.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/OrbitParities.lean @@ -50,7 +50,7 @@ The localization needed for `fullPerm_repair` comes from assumption is discharged by well-ordering the label type. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/OrientExistence.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/OrientExistence.lean index 2c94eb05dc..a8cd0becde 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/OrientExistence.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/OrientExistence.lean @@ -17,7 +17,7 @@ orbits by the orbit representative gives the directions. Canonical data therefore exist exactly when a transition system does. -/ -@[expose] public section +public section namespace RS @@ -144,6 +144,7 @@ theorem relComplete_ne (κ : F.RelTransitionSystem) /-- The completed matching as a permutation of the participating flags. -/ +@[expose] noncomputable def relMatchPerm (κ : F.RelTransitionSystem) : Equiv.Perm {f : W.Flag // f ∈ F.flags} where toFun x := ⟨relComplete κ x.val, relComplete_mem κ x.prop⟩ diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/OrientationFlip.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/OrientationFlip.lean index 330d4a94e6..9a68366763 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/OrientationFlip.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/OrientationFlip.lean @@ -54,7 +54,7 @@ circuit-supported differences (or fix path orientations by convention). -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/PairCloseComm.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/PairCloseComm.lean index b90d5b5104..b78d191794 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/PairCloseComm.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/PairCloseComm.lean @@ -16,7 +16,7 @@ an `(0+t)`- with a `(t+0)`-fragment, is invariant (up to `Fragment.Equiv`) under swapping `F` and `G`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/PairedAssembly.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/PairedAssembly.lean index d70e100164..55e0cba37f 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/PairedAssembly.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/PairedAssembly.lean @@ -41,7 +41,7 @@ Main results: `chainStatusLedger` (the enriched chain induction), `pairedLedgerUnsigned`, and `pairedLedger`. -/ -@[expose] public section +public section namespace RS @@ -76,6 +76,7 @@ theorem flipSignProd_mul_self (f : α → Fin (2 * ℓ)) _ = 1 := by rw [h1, h2, h3, one_mul, one_mul] /-- The accumulated colour relabel of a flip sequence. -/ +@[expose] noncomputable def flipColoursFold (f : α → Fin (2 * ℓ)) (L : List (α × α)) : α → Fin (2 * ℓ) := L.foldl flipColours f diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/PairingConnectivity.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/PairingConnectivity.lean index b8b0180970..85b822bb49 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/PairingConnectivity.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/PairingConnectivity.lean @@ -19,7 +19,7 @@ localized repairs qualify, and derives the same-pairing invariance of the signed summand from connectivity and the per-step ledger. -/ -@[expose] public section +public section namespace RS @@ -30,6 +30,7 @@ variable {α : Type} namespace EdgeSubset /-- Two systems induce the same boundary pairing. -/ +@[expose] def SamePairing {W : Fragment α} {F : EdgeSubset W} (κ κ' : F.RelTransitionSystem) : Prop := ∀ (δ : W.Flag) (hδ : δ ∈ F.boundaryFlags), @@ -54,6 +55,7 @@ theorem SamePairing.trans {W : Fragment α} {F : EdgeSubset W} fun δ hδ => (h δ hδ).trans (h' δ hδ) /-- A repair step that preserves the boundary pairing. -/ +@[expose] def MatchPreservingStep {W : Fragment α} {F : EdgeSubset W} (κ₁ κ₂ : F.RelTransitionSystem) : Prop := ∃ (a b c d : W.Flag) (v : W.Vertex) @@ -77,6 +79,7 @@ the boundary pairing (individual repairs may cross two chains and change it; the double-crossing example shows single-step connectivity fails, and non-adjacent restorations force general blocks rather than pairs). -/ +@[expose] def PairedStep {W : Fragment α} {F : EdgeSubset W} (κ₁ κ₂ : F.RelTransitionSystem) : Prop := (∃ (n : ℕ) (chain : Fin (n + 1) → F.RelTransitionSystem), @@ -86,6 +89,7 @@ def PairedStep {W : Fragment α} {F : EdgeSubset W} /-- A pairing-preserving move: a single preserved step or a π-restoring pair. -/ +@[expose] def MatchPreservingMove {W : Fragment α} {F : EdgeSubset W} (κ₁ κ₂ : F.RelTransitionSystem) : Prop := MatchPreservingStep κ₁ κ₂ ∨ PairedStep κ₁ κ₂ @@ -95,6 +99,7 @@ systems with the same boundary pairing are connected by pairing-preserving moves, up to match-equality at the endpoints. (Single steps do not suffice: the double-crossing configuration disconnects the fibre.) -/ +@[expose] def PairingConnectivity : Prop := ∀ {α : Type} [LinearOrder α] {W : Fragment α} {F : EdgeSubset W} (κ κ' : F.RelTransitionSystem), @@ -124,6 +129,7 @@ step preserves the signed canonical summand (dischargeable from the localized/non-separated ledgers plus the orbit parities; two-path moves change the pairing and are excluded by the step relation). -/ +@[expose] def MatchPreservingLedger : Prop := ∀ {α : Type} [LinearOrder α] {W : Fragment α} {F : EdgeSubset W} {k ℓ : ℕ} (hM : MixedFunctional k ℓ) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/PairingSignature.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/PairingSignature.lean index 2e373685c3..7feaa73258 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/PairingSignature.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/PairingSignature.lean @@ -18,7 +18,7 @@ repairs the crossing count returns — the parity backbone of the holonomy bookkeeping. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/PairingSwap.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/PairingSwap.lean index fd0e6d354a..52f939d739 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/PairingSwap.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/PairingSwap.lean @@ -21,7 +21,7 @@ holonomy programme — repair words act on boundary pairings through transposition conjugations. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/PairingValue.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/PairingValue.lean index 4ba4ef0376..6b519e1c10 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/PairingValue.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/PairingValue.lean @@ -19,7 +19,7 @@ pairing-preserving ledger — the well-definedness of the value as a function of the pairing, riding on the proved block connectivity. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/PartialClose.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/PartialClose.lean index ba1f2a2c12..e493090410 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/PartialClose.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/PartialClose.lean @@ -23,13 +23,14 @@ file provides the construction: the gluing pair list, its well-formedness, the survivor identification, and congruence. -/ -@[expose] public section +public section namespace RS /-- The `z`-gluing pairs: `z`'s high block against the last block of `G`, then `z`'s low block against the second block of `G` (top pair first within each block). -/ +@[expose] noncomputable def zClosePairs (s t u v : ℕ) : List ((Fin (u + v) ⊕ Fin ((s + u) + (t + v))) × (Fin (u + v) ⊕ Fin ((s + u) + (t + v)))) := @@ -128,6 +129,7 @@ theorem zClosePairs_wf (s t u v : ℕ) : /-- The survivor predicate of the `z`-gluing: no `z`-label survives, and a `G`-label survives iff it lies in one of the two `x`-blocks. -/ +@[expose] def pcSurvPred (s t u v : ℕ) : Fin (u + v) ⊕ Fin ((s + u) + (t + v)) → Prop := Sum.elim (fun _ => False) @@ -149,6 +151,7 @@ theorem pcSurv_iff (s t u v : ℕ) /-- The surviving `G`-labels of the `z`-gluing, identified with the `(s + t)`-boundary: first `x`-block by value, second by offset. -/ +@[expose] def pcSurvValEquiv (s t u v : ℕ) : {x : Fin (u + v) ⊕ Fin ((s + u) + (t + v)) // pcSurvPred s t u v x} ≃ Fin (s + t) where @@ -194,6 +197,7 @@ def pcSurvValEquiv (s t u v : ℕ) : omega) /-- The survivor identification of the `z`-gluing. -/ +@[expose] noncomputable def pcSurvEquiv (s t u v : ℕ) : Fragment.FoldSurviving (Fin (u + v) ⊕ Fin ((s + u) + (t + v))) (zClosePairs s t u v) ≃ Fin (s + t) := @@ -205,6 +209,7 @@ noncomputable def pcSurvEquiv (s t u v : ℕ) : /-- **Partial closure**: glue every open end of `z` into the matching `z`-block end of the test fragment `G`; the surviving `x`-block ends form the `(s + t)`-boundary. -/ +@[expose] noncomputable def partialClose {s t u v : ℕ} (z : Fragment (Fin (u + v))) (G : Fragment (Fin ((s + u) + (t + v)))) : diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/PartialCloseCompose.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/PartialCloseCompose.lean index 8f779fb6a8..39d8f086f3 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/PartialCloseCompose.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/PartialCloseCompose.lean @@ -20,7 +20,7 @@ the entire compose-calculus (identity laws, free-side relabels, permutation absorption) act on partial closures. -/ -@[expose] public section +public section namespace RS @@ -191,6 +191,7 @@ theorem pc_compose_ground (s t u v : ℕ) : /-! ### The label meet -/ /-- The peeled composition pairs. -/ +@[expose] noncomputable def pcComposeQs (s t u v : ℕ) := Fragment.mapPairs (_root_.Equiv.sumCongr diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/PartialCloseTensor.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/PartialCloseTensor.lean index f5ace40ef5..798e3c9260 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/PartialCloseTensor.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/PartialCloseTensor.lean @@ -27,7 +27,7 @@ This file: the three-summand shuffle, the ground computation inner-pair identification. -/ -@[expose] public section +public section namespace RS @@ -87,6 +87,7 @@ noncomputable def disjUnionShuffle {α β γ : Type} /-- The closure pairs of `z` against `z'`, over the pair of `(u + v)`-boundaries: high block, then low block. -/ +@[expose] def innerClosePairs (u v : ℕ) : List ((Fin (u + v) ⊕ Fin (u + v)) × (Fin (u + v) ⊕ Fin (u + v))) := @@ -302,6 +303,7 @@ noncomputable def innerNormal {u v : ℕ} /-! ### The main chain -/ /-- The clean label of the partial closure of a tensor. -/ +@[expose] noncomputable def pcTensorClose (s t : ℕ) : (Fin (s + t) ⊕ Fin (0 + 0)) ≃ Fin (s + t) := (_root_.Equiv.sumCongr (_root_.Equiv.refl (Fin (s + t))) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/PathCanon.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/PathCanon.lean index d397454244..3097a810ad 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/PathCanon.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/PathCanon.lean @@ -23,7 +23,7 @@ summand well-defined; the corrected value chooses among canonical data, and the corrected independence interface quantifies over it. -/ -@[expose] public section +public section namespace RS @@ -37,6 +37,7 @@ namespace EdgeSubset boundary-to-boundary chain is directed from its lower-labelled end to its higher-labelled one — the entry edge at the lower end is incoming. -/ +@[expose] def PathCanonical [LinearOrder α] {W : Fragment α} {F : EdgeSubset W} {κ : F.RelTransitionSystem} (o : κ.Orientation) : Prop := @@ -60,6 +61,7 @@ theorem pathCanonical_of_allInternal [LinearOrder α] {W : Fragment α} /-- The chord-interleaving condition between two boundary chains: both chords are recorded at their lower-labelled ends and interleave. -/ +@[expose] def ChordCross [LinearOrder α] {W : Fragment α} {F : EdgeSubset W} (κ : F.RelTransitionSystem) (b b' : {x : W.Flag // x ∈ F.boundaryFlags}) : Prop := @@ -73,6 +75,7 @@ def ChordCross [LinearOrder α] {W : Fragment α} open Classical in /-- The number of interleaving chain-chord pairs of a transition system. -/ +@[expose] noncomputable def chordCrossingCount [LinearOrder α] {W : Fragment α} {F : EdgeSubset W} (κ : F.RelTransitionSystem) : ℕ := @@ -82,6 +85,7 @@ noncomputable def chordCrossingCount [LinearOrder α] {W : Fragment α} /-- **The path-sector sign**: the crossing sign of the boundary chain pairing — the Pfaffian chord-diagram sign forced by the two-path repair obstruction. -/ +@[expose] noncomputable def pathSign [LinearOrder α] {W : Fragment α} {F : EdgeSubset W} (κ : F.RelTransitionSystem) : ℂ := @@ -104,6 +108,7 @@ theorem pathSign_of_allInternal [LinearOrder α] {W : Fragment α} /-- Canonical transition data: a relative system with a path-canonical orientation. -/ +@[expose] def CanonData [LinearOrder α] {W : Fragment α} (F : EdgeSubset W) : Type := (κ : F.RelTransitionSystem) × {o : κ.Orientation // PathCanonical o} @@ -111,6 +116,7 @@ def CanonData [LinearOrder α] {W : Fragment α} open Classical in /-- **The canonical constrained value**: the through summand at the open circuit count, chosen among path-canonical data. -/ +@[expose] noncomputable def throughValueC [LinearOrder α] {W : Fragment α} (F : EdgeSubset W) {k ℓ : ℕ} (h : MixedFunctional k ℓ) (st : GenBoundaryState k ℓ α) @@ -126,6 +132,7 @@ end EdgeSubset open Classical in /-- **The canonical state-constrained partition value** of an open fragment. -/ +@[expose] noncomputable def throughMixedPartitionC [LinearOrder α] {k ℓ : ℕ} (h : MixedFunctional k ℓ) (W : Fragment α) @@ -165,6 +172,7 @@ end EdgeSubset /-- **The corrected independence interface**: the constrained summand at the open circuit count is independent of the choice of relative transition system and *path-canonical* orientation. -/ +@[expose] def ThroughIndependenceC : Prop := ∀ {α : Type} [LinearOrder α] {W : Fragment α} (F : EdgeSubset W) {k ℓ : ℕ} (h : MixedFunctional k ℓ) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/PathLedger.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/PathLedger.lean index 635419181f..1421a29400 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/PathLedger.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/PathLedger.lean @@ -52,7 +52,7 @@ factor and the case analysis that controls it. `SeparatedParity.lean` and `NonSeparatedStep.lean` respectively. -/ -@[expose] public section +public section namespace RS @@ -66,11 +66,13 @@ variable {γ : Type*} /-- Two chords of a linear order, each recorded low-to-high, interleave (in either relative position). -/ +@[expose] def ChordPairCross [LinearOrder γ] (x y u w : γ) : Prop := (x < u ∧ u < y ∧ y < w) ∨ (u < x ∧ x < w ∧ w < y) /-- A point lies strictly inside a chord. -/ +@[expose] def InsideChord [LinearOrder γ] (x y p : γ) : Prop := x < p ∧ p < y @@ -440,6 +442,7 @@ variable {F : EdgeSubset W} /-- Membership on the boundary chain of `β`: the flag appears on the walk from `β` (on either side of an edge) before the chain exits. -/ +@[expose] def OnBoundaryChain (κ : F.RelTransitionSystem) (β f : W.Flag) : Prop := ∃ k t : ℕ, t ≤ k ∧ @@ -617,6 +620,7 @@ variable {F : EdgeSubset W} two re-paired edges lie on periodic components, or each of the four flags is periodic or on the chain of a single boundary flag. The complement is the genuine two-path case (case 4). -/ +@[expose] def SquareLocalized (κ : F.RelTransitionSystem) (a b c d : W.Flag) : Prop := (κ.PeriodicFlag a ∧ κ.PeriodicFlag c) ∨ @@ -882,6 +886,7 @@ variable {F : EdgeSubset W} {κ : F.RelTransitionSystem} /-- The flags of the walk orbit through `g`, on both sides of each visited edge. -/ +@[expose] def OrbitFlag (κ : F.RelTransitionSystem) (g f : W.Flag) : Prop := ∃ m, f = iterWalk κ g m ∨ f = W.pairing (iterWalk κ g m) @@ -1021,6 +1026,7 @@ end EdgeSubset square on a localized configuration flips the circuit-count parity (the splice merges two circuits, Δ = −1, or splits one component, Δ = +1). Discharged in `SeparatedParity.lean`. -/ +@[expose] def SeparatedCountParity : Prop := ∀ {α : Type} {W : Fragment α} {F : EdgeSubset W} {κ : F.RelTransitionSystem} {a b c d : W.Flag} {v : W.Vertex} diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/PathMatch.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/PathMatch.lean index 3b598a2ad2..70ea11262a 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/PathMatch.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/PathMatch.lean @@ -33,7 +33,7 @@ chain result and `σ` is the edge pairing), established by induction on `j` using `match_invol`. -/ -@[expose] public section +public section namespace RS @@ -120,6 +120,7 @@ theorem traceChain_result_boundary (κ : F.RelTransitionSystem) /-- The fuel-free chain step iterated: cross the edge, then match. This is `traceChain`'s recursion without the termination test, so the two can be compared step by step. -/ +@[expose] noncomputable def iterWalk (κ : F.RelTransitionSystem) (f : W.Flag) : ℕ → W.Flag | 0 => f diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/PermCompose.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/PermCompose.lean index bde4c847f9..95e45220e5 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/PermCompose.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/PermCompose.lean @@ -25,7 +25,7 @@ permutation is traded for a strand re-indexing of the bundle equivalence. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/PermFragment.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/PermFragment.lean index 6f07e7ffe9..908f92f337 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/PermFragment.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/PermFragment.lean @@ -18,12 +18,13 @@ of `t` disjoint strands, strand `k` joining incoming boundary label gives the strand bundle. -/ -@[expose] public section +public section namespace RS /-- The permutation fragment of `σ`: strand `k` joins incoming label `k` to outgoing label `t + σ k`. -/ +@[expose] def permFragment {t : ℕ} (σ : Equiv.Perm (Fin t)) : Fragment (Fin (t + t)) where Flag := Fin t × Bool @@ -77,6 +78,7 @@ theorem permFragment_one (t : ℕ) : /-- The label re-indexing that fixes incoming labels and permutes outgoing labels by `σ`. -/ +@[expose] def permHighEquiv {t : ℕ} (σ : Equiv.Perm (Fin t)) : Fin (t + t) ≃ Fin (t + t) where toFun ℓ := diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/PropThreeOpen.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/PropThreeOpen.lean index d92b864f51..017b77193f 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/PropThreeOpen.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/PropThreeOpen.lean @@ -22,7 +22,7 @@ constrained value is a function of the boundary pairing, and of nothing else. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/RSTensor.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/RSTensor.lean index 0984eecf07..6863332993 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/RSTensor.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/RSTensor.lean @@ -34,7 +34,7 @@ The tensor is zero at a coordinate whose parity pattern is not the subset's, which is the condition that `χ` be consistent with `S`. -/ -@[expose] public section +public section namespace RS @@ -46,6 +46,7 @@ variable {α : Type} open scoped Classical in /-- **RS21's tensor `t′_h`, in coordinates.** -/ +@[expose] noncomputable def tPrime [LinearOrder α] [Fintype α] {W : Fragment α} (F : EdgeSubset W) {k ℓ : ℕ} (h : MixedFunctional k ℓ) (κ : F.RelTransitionSystem) @@ -68,6 +69,7 @@ open scoped Classical in /-- **RS21's tensor at given arc directions.** The chain orientation fixes the vertex signs; the arc directions fix which legs carry `f` and which carry `g`. -/ +@[expose] noncomputable def tPrimeD [Fintype α] {W : Fragment α} (F : EdgeSubset W) {k ℓ : ℕ} (h : MixedFunctional k ℓ) (κ : F.RelTransitionSystem) @@ -167,6 +169,7 @@ theorem card_usedLabel_eq [LinearOrder α] [Fintype α] {W : Fragment α} omega /-- **RS21's normalised tensor `t_h`, in coordinates.** -/ +@[expose] noncomputable def tFull [LinearOrder α] [Fintype α] {W : Fragment α} (F : EdgeSubset W) {k ℓ : ℕ} (h : MixedFunctional k ℓ) (κ : F.RelTransitionSystem) @@ -190,6 +193,7 @@ theorem card_usedLab_eq [Fintype α] {W : Fragment α} /-- **RS21's normalised tensor at given arc directions.** The directions enter twice: through the matching's sign and through the dual basis. -/ +@[expose] noncomputable def tFullD [LinearOrder α] [Fintype α] {W : Fragment α} (F : EdgeSubset W) {k ℓ : ℕ} (h : MixedFunctional k ℓ) (κ : F.RelTransitionSystem) @@ -528,6 +532,7 @@ RS21 colours a through-edge once, so a state whose two legs there disagree carries no colouring at all and both tensors vanish at it. The pairing therefore sees only the agreeing states, and it is this value, not the bare product of vertex sums, that it computes. -/ +@[expose] noncomputable def pairAgreeValue {t : ℕ} {W₁ W₂ : Fragment (Fin t)} (F₁ : EdgeSubset W₁) (F₂ : EdgeSubset W₂) {k ℓ : ℕ} (h : MixedFunctional k ℓ) {κ₁ : F₁.RelTransitionSystem} @@ -1827,6 +1832,7 @@ invariance under reversing a trail. open Classical in /-- **The fragment's tensor**: `Σ_H t_h(F,H,ω_H,κ_H)`. -/ +@[expose] noncomputable def _root_.RS.tensorSum [LinearOrder α] [Fintype α] (V : Fragment α) {k ℓ : ℕ} (h : MixedFunctional k ℓ) (x : GenBoundaryState k ℓ α) : ℂ := diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/RelTransition.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/RelTransition.lean index e5e9c784b5..f9cdadc622 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/RelTransition.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/RelTransition.lean @@ -49,7 +49,7 @@ degenerates to `TransitionSystem` and `internalCircuitCount` equals `circuitCount`. -/ -@[expose] public section +public section namespace RS @@ -66,6 +66,7 @@ variable {W : Fragment α} open scoped Classical in /-- The internal flags of an edge subset: participating flags attached to a vertex. -/ +@[expose] noncomputable def internalFlags (F : EdgeSubset W) : Finset W.Flag := F.flags.filter (fun f => ∃ v : W.Vertex, W.attach f = Sum.inl v) @@ -80,6 +81,7 @@ theorem mem_internalFlags_iff {f : W.Flag} {F : EdgeSubset W} : open scoped Classical in /-- The boundary flags of an edge subset: participating flags attached to a boundary label. -/ +@[expose] noncomputable def boundaryFlags (F : EdgeSubset W) : Finset W.Flag := F.flags.filter (fun f => ∃ i : α, W.attach f = Sum.inr i) @@ -137,6 +139,7 @@ theorem boundaryFlag_mem_boundaryFlags {F : EdgeSubset W} {a : α} · exact hbd /-- All participating flags are internal (no boundary flags). -/ +@[expose] def allInternal (F : EdgeSubset W) : Prop := F.boundaryFlags = ∅ /-- When all flags are internal, a participating flag is internal. -/ @@ -180,6 +183,7 @@ theorem mem_internalFlags_of {F : EdgeSubset W} {f : W.Flag} open scoped Classical in /-- Every `TransitionSystem` is a `RelTransitionSystem`. -/ +@[expose] def TransitionSystem.toRelTransitionSystem {F : EdgeSubset W} (κ : F.TransitionSystem) : F.RelTransitionSystem where match_ := κ.match_ @@ -196,6 +200,7 @@ def TransitionSystem.toRelTransitionSystem {F : EdgeSubset W} /-- The walk map on flags via a relative transition: follow pairing then matching. -/ +@[expose] noncomputable def RelTransitionSystem.internalWalk {F : EdgeSubset W} (κ : F.RelTransitionSystem) (f : W.Flag) : W.Flag := κ.match_ (W.pairing f) @@ -252,6 +257,7 @@ theorem RelTransitionSystem.internalWalk_injOn_of_allInternal /-- The walk permutation on internal flags, when all flags are internal. -/ +@[expose] noncomputable def RelTransitionSystem.walkPermInternal {F : EdgeSubset W} (κ : F.RelTransitionSystem) (hall : F.allInternal) : @@ -265,6 +271,7 @@ noncomputable def RelTransitionSystem.walkPermInternal (congrArg Subtype.val h)))) /-- The internal circuit count when all flags are internal. -/ +@[expose] noncomputable def RelTransitionSystem.internalCircuitCount {F : EdgeSubset W} (κ : F.RelTransitionSystem) (hall : F.allInternal) : ℕ := @@ -350,6 +357,7 @@ structure RelTransitionSystem.Orientation {F : EdgeSubset W} /-- Follow the chain from a flag: apply pairing, check if boundary; if internal, apply matching and recurse. Returns `none` if the fuel runs out. -/ +@[expose] noncomputable def traceChain {F : EdgeSubset W} (κ : F.RelTransitionSystem) : ℕ → W.Flag → Option W.Flag | 0, _ => none diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/RelValue.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/RelValue.lean index 2f476073a7..44bc453367 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/RelValue.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/RelValue.lean @@ -21,7 +21,7 @@ that lands. For subsets arising from a standard transition system, the relative data agrees with the original. -/ -@[expose] public section +public section namespace RS @@ -32,6 +32,7 @@ variable {α : Type} {W : Fragment α} /-- In-flags at a vertex for a boundary-relative orientation: the participating flags attached to the vertex and marked incoming, in the fixed enumeration order. -/ +@[expose] noncomputable def EdgeSubset.relInFlagsAt (F : EdgeSubset W) {κ : F.RelTransitionSystem} (o : κ.Orientation) (v : W.Vertex) : List W.Flag := @@ -56,6 +57,7 @@ theorem EdgeSubset.mem_internal_of_mem_relInFlagsAt /-! ## Agreement with the standard data -/ /-- Transport of an orientation to the relative system. -/ +@[expose] def EdgeSubset.TransitionSystem.Orientation.toRel {F : EdgeSubset W} {κ : F.TransitionSystem} (o : κ.Orientation) : κ.toRelTransitionSystem.Orientation where diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/RelabelChords.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/RelabelChords.lean index ca49089180..8b6450d901 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/RelabelChords.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/RelabelChords.lean @@ -18,7 +18,7 @@ and the path matching are untouched, the labels shift through `e`, and `e` preserves the sorting. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/RelabelInvariance.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/RelabelInvariance.lean index e663f0de75..9b3f671b92 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/RelabelInvariance.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/RelabelInvariance.lean @@ -27,7 +27,7 @@ already pinned to a choice: the relabel carries one side's data to the other's, and the conversions are identity-shaped. -/ -@[expose] public section +public section namespace RS @@ -90,6 +90,7 @@ theorem relabel_boundaryFlag_apply (a : α) : /-- Transport of an edge subset along a relabel: the flags and the pairing are untouched. -/ +@[expose] def EdgeSubset.relabelUp (F : EdgeSubset W) : EdgeSubset (W.relabel ee) where flags := F.flags pairing_mem := fun f hf => F.pairing_mem f hf @@ -154,6 +155,7 @@ theorem relabel_genBoundarySubsetMatches_iff {k ℓ : ℕ} /-! ## Relative transition systems under a relabel -/ /-- Transport of a relative transition system along a relabel. -/ +@[expose] def relabelTransUp (F : EdgeSubset W) (κ : F.RelTransitionSystem) : (F.relabelUp ee).RelTransitionSystem where match_ := κ.match_ @@ -171,6 +173,7 @@ def relabelTransUp (F : EdgeSubset W) (κ : F.RelTransitionSystem) : /-- Transport of a relative transition system back along a relabel. -/ +@[expose] def relabelTransDown (F : EdgeSubset W) (κ : (F.relabelUp ee).RelTransitionSystem) : F.RelTransitionSystem where match_ := κ.match_ @@ -187,6 +190,7 @@ def relabelTransDown (F : EdgeSubset W) ((relabel_attach_inl_iff ee f v).mpr hv)) /-- Transport of an orientation along a relabel. -/ +@[expose] def relabelOrientUp (F : EdgeSubset W) {κ : F.RelTransitionSystem} (o : κ.Orientation) : (relabelTransUp ee F κ).Orientation where isOut := o.isOut @@ -197,6 +201,7 @@ def relabelOrientUp (F : EdgeSubset W) {κ : F.RelTransitionSystem} (by rwa [relabelUp_internalFlags ee F] at hp) /-- Transport of an orientation back along a relabel. -/ +@[expose] def relabelOrientDown (F : EdgeSubset W) {κ : (F.relabelUp ee).RelTransitionSystem} (o : κ.Orientation) : (relabelTransDown ee F κ).Orientation where diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/RepairInvariance.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/RepairInvariance.lean index 9bd14e447e..615aa52199 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/RepairInvariance.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/RepairInvariance.lean @@ -51,7 +51,7 @@ ledger of `PathLedger.lean`, whose statements weigh the summand by the boundary pairing's chord sign. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/RigidInstance.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/RigidInstance.lean index 6d65a2b156..0d8afe3e1b 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/RigidInstance.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/RigidInstance.lean @@ -19,7 +19,7 @@ definitional, and the flip `1 + n = n + 1` is transported along `eqToIso`). -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/RigidityClasses.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/RigidityClasses.lean index 7c6e055be7..8f290e263c 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/RigidityClasses.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/RigidityClasses.lean @@ -21,7 +21,7 @@ under any boundary relabelling. These are the data that the Deligne fibre functor sends to the standard form and copairing. -/ -@[expose] public section +public section namespace RS @@ -55,24 +55,29 @@ noncomputable def strandRelabelEquiv (e : Fin 2 ≃ Fin 2) : circles_eq := rfl /-- The evaluation fragment: the strand as a `(2,0)`-morphism. -/ +@[expose] noncomputable def evFrag : Fragment (Fin (2 + 0)) := Fragment.strand.relabel (finCongr (by omega : 2 = 2 + 0)) /-- The coevaluation fragment: the strand as a `(0,2)`-morphism. -/ +@[expose] noncomputable def coevFrag : Fragment (Fin (0 + 2)) := Fragment.strand.relabel (finCongr (by omega : 2 = 0 + 2)) variable {R : ℕ} (f : EdgeRankParameter R) /-- The evaluation class. -/ +@[expose] noncomputable def evClass : HomSpace f.val (2 + 0) := HomSpace.ofFragment f.val evFrag /-- The coevaluation class. -/ +@[expose] noncomputable def coevClass : HomSpace f.val (0 + 2) := HomSpace.ofFragment f.val coevFrag /-- The braiding class on two strands. -/ +@[expose] noncomputable def braidClass : HomSpace f.val (2 + 2) := HomSpace.ofFragment f.val (permFragment (_root_.Equiv.swap (0 : Fin 2) 1)) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/ScalarClass.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/ScalarClass.lean index d250d5e068..595b196eaa 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/ScalarClass.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/ScalarClass.lean @@ -20,7 +20,7 @@ both rows of the arity-zero pairing are multiples of the empty row, with ratio `f(W)`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/ScalarFunctional.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/ScalarFunctional.lean index f8abb2e2c8..462aa20426 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/ScalarFunctional.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/ScalarFunctional.lean @@ -19,7 +19,7 @@ every identity of Hom-classes at arity zero becomes an identity of parameter values through this functional. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/SeparatedParity.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/SeparatedParity.lean index 591c153214..1d0c624065 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/SeparatedParity.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/SeparatedParity.lean @@ -50,7 +50,7 @@ moves by exactly `±2`, i.e. the circuit count by `±1`. * `separatedCountParity` — the discharged `SeparatedCountParity`. -/ -@[expose] public section +public section namespace RS @@ -66,6 +66,7 @@ variable {Y : Type} /-- The total orbit count of a permutation: nontrivial cycles plus fixed points. -/ +@[expose] noncomputable def permOrbitCount [Fintype Y] [DecidableEq Y] (g : Perm Y) : ℕ := g.cycleType.card + Fintype.card (Function.fixedPoints g) @@ -751,6 +752,7 @@ namespace EdgeSubset variable {α : Type} {W : Fragment α} {F : EdgeSubset W} /-- The edge pairing as a permutation of the participating flags. -/ +@[expose] noncomputable def pairingPermSP (F : EdgeSubset W) : Equiv.Perm {f : W.Flag // f ∈ F.flags} where toFun x := ⟨W.pairing x.val, F.pairing_mem x.val x.prop⟩ @@ -836,6 +838,7 @@ theorem fullMatchFun_invol (κ : F.RelTransitionSystem) exact κ.pathMatch_invol hb /-- The extended matching as an (involutive) permutation. -/ +@[expose] noncomputable def fullMatchPerm (κ : F.RelTransitionSystem) : Equiv.Perm {f : W.Flag // f ∈ F.flags} where toFun := fullMatchFun κ @@ -857,6 +860,7 @@ theorem fullMatchPerm_mul_self (κ : F.RelTransitionSystem) : /-- **The full walk permutation**: pairing followed by extended matching, a permutation of all participating flags. -/ +@[expose] noncomputable def fullPerm (κ : F.RelTransitionSystem) : Equiv.Perm {f : W.Flag // f ∈ F.flags} := fullMatchPerm κ * pairingPermSP F diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/SimpleUnit.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/SimpleUnit.lean index 6ca7e19109..26b6a8fc49 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/SimpleUnit.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/SimpleUnit.lean @@ -20,7 +20,7 @@ nonzero because its closure row at the empty fragment is `f(∅) = 1`. -/ -@[expose] public section +public section noncomputable section @@ -28,6 +28,7 @@ namespace RS /-- The class of the empty fragment in the arity-zero Hom space. -/ +@[expose] noncomputable def emptyClass (f : ClosedFragment → ℂ) : HomSpace f 0 := HomSpace.ofFragment f emptyClosedFragment diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/SkeinCatInstance.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/SkeinCatInstance.lean index a8c745cce9..0b66a2d55e 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/SkeinCatInstance.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/SkeinCatInstance.lean @@ -18,7 +18,7 @@ composition is the descended bilinear composition. All axioms were proven in `SkeinCategory.lean`; this file only packages them. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/SkeinCategory.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/SkeinCategory.lean index 475f864c8a..29e582ca9a 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/SkeinCategory.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/SkeinCategory.lean @@ -22,7 +22,7 @@ with the per-single case supplied by a fragment equivalence (identity laws, associativity) through isomorphism invariance. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/SkeinIdeal.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/SkeinIdeal.lean index 417e0d5b05..71fa109f32 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/SkeinIdeal.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/SkeinIdeal.lean @@ -21,7 +21,7 @@ row of the original — the rotation of closures moves the composed factor into the test fragment. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/SkeinIdealLeft.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/SkeinIdealLeft.lean index 86312c4a17..48b24ed53a 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/SkeinIdealLeft.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/SkeinIdealLeft.lean @@ -21,7 +21,7 @@ two-sided ideal (accompanying paper, Lemma 3.3(a)), so composition descends to the Hom spaces. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/SkeinLinear.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/SkeinLinear.lean index cb991823e9..dc3c88308f 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/SkeinLinear.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/SkeinLinear.lean @@ -16,7 +16,7 @@ bilinear, so the skein category is preadditive and ℂ-linear — two of the instance hypotheses of the Deligne package carrier. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/SnakeClasses.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/SnakeClasses.lean index 0776811395..b59a3937a4 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/SnakeClasses.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/SnakeClasses.lean @@ -20,16 +20,18 @@ established by `decide` over the two surviving flags, with the inverse flag map given canonically by the boundary-flag function. -/ -@[expose] public section +public section namespace RS /-- The left snake fragment `(coev ⊗ id) ∘ (id ⊗ ev)`. -/ +@[expose] noncomputable def snakeFragL : Fragment (Fin (1 + 1)) := (tensorFragment coevFrag (strandBundle 1)).compose (tensorFragment (strandBundle 1) evFrag) /-- The right snake fragment `(id ⊗ coev) ∘ (ev ⊗ id)`. -/ +@[expose] noncomputable def snakeFragR : Fragment (Fin (1 + 1)) := (tensorFragment (strandBundle 1) coevFrag).compose (tensorFragment evFrag (strandBundle 1)) @@ -156,6 +158,7 @@ noncomputable def snakeFragREquiv : variable {R : ℕ} (f : EdgeRankParameter R) /-- The identity class on one strand. -/ +@[expose] noncomputable def idClass : HomSpace f.val (1 + 1) := HomSpace.ofFragment f.val (strandBundle 1) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/StarCompClass.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/StarCompClass.lean index e6d9448007..773fc6a032 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/StarCompClass.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/StarCompClass.lean @@ -20,13 +20,14 @@ the parameter value times the empty class — the identity that the fibre functor transports into the standard model. -/ -@[expose] public section +public section namespace RS variable {R : ℕ} (f : EdgeRankParameter R) /-- The star-union class as a `(0, 2m)`-morphism. -/ +@[expose] noncomputable def starClass (W : ClosedFragment) : HomSpace f.val (0 + (edgeCount W + edgeCount W)) := HomSpace.ofFragment f.val @@ -35,6 +36,7 @@ noncomputable def starClass (W : ClosedFragment) : 0 + (edgeCount W + edgeCount W)))) /-- The strand-bundle class as a `(2m, 0)`-morphism. -/ +@[expose] noncomputable def bundleCapClass (m : ℕ) : HomSpace f.val ((m + m) + 0) := HomSpace.ofFragment f.val diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/StarDecomposition.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/StarDecomposition.lean index 275f2f5c9a..039bd3bddb 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/StarDecomposition.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/StarDecomposition.lean @@ -21,7 +21,7 @@ canonical ones gives `starDecomposition`, the accompanying paper's union glued along the edge matching. -/ -@[expose] public section +public section namespace RS @@ -31,6 +31,7 @@ variable (W : ClosedFragment) /-- The matching pairs of a representative list, as labels of the explosion at `C`. -/ +@[expose] def repPairs (C : Finset W.Flag) (hC : CutClosed W C) : (l : List W.Flag) → (∀ x ∈ l, x ∈ C) → List ({f : W.Flag // f ∈ C} × {f : W.Flag // f ∈ C}) @@ -369,6 +370,7 @@ theorem repPairs_wf_of (C : Finset W.Flag) (hC : CutClosed W C) : /-- The canonical orbit representatives: flags enumerated below their partners. -/ +@[expose] noncomputable def canonicalReps : List W.Flag := (Finset.univ.filter (fun f => (Fintype.equivFin W.Flag f : ℕ) < diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/StarEnum.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/StarEnum.lean index 0af322fabd..33b1c57626 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/StarEnum.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/StarEnum.lean @@ -20,7 +20,7 @@ the straight matching in the star union restores the fragment — the shape the trace calculus closes against the strand bundle. -/ -@[expose] public section +public section namespace RS @@ -113,11 +113,13 @@ noncomputable def starEnum : /-- **The star union**: the explosion at the full cut with the representatives-first boundary enumeration. -/ +@[expose] noncomputable def starUnion : Fragment (Fin (edgeCount W + edgeCount W)) := (explodeAt W Finset.univ (fullCut_closed W)).relabel (starEnum W) /-- The straight matching pairs `i ↔ m + i`. -/ +@[expose] def matchPairs (m : ℕ) : List (Fin (m + m) × Fin (m + m)) := (List.finRange m).map (fun j => (Fin.castAdd m j, Fin.natAdd m j)) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/StarExplode.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/StarExplode.lean index c3b48fb662..d5f2132c59 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/StarExplode.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/StarExplode.lean @@ -24,7 +24,7 @@ edge at a time (`explodeAtGluePair`, next file), giving the star decomposition by induction. -/ -@[expose] public section +public section namespace RS @@ -43,6 +43,7 @@ theorem ClosedFragment.attach_eq_vertexOf (W : ClosedFragment) · exact Fin.elim0 ℓ /-- A pairing-closed cut set: with each flag, its partner. -/ +@[expose] def CutClosed (W : ClosedFragment) (C : Finset W.Flag) : Prop := ∀ f ∈ C, W.pairing f ∈ C @@ -55,6 +56,7 @@ theorem CutClosed.pairing_mem {W : ClosedFragment} /-- **The explosion at a cut set**: sever each cut flag's edge, the freed half-edge becoming a pendant boundary edge labelled by the cut flag itself. -/ +@[expose] def explodeAt (W : ClosedFragment) (C : Finset W.Flag) (hC : CutClosed W C) : Fragment {f : W.Flag // f ∈ C} where Flag := W.Flag ⊕ {f : W.Flag // f ∈ C} @@ -129,9 +131,11 @@ theorem cutErase_closed : CutClosed W (cutErase W C f₀) := by exact hg.2.1 (by rw [← W.pairing_invol g, h, W.pairing_invol]) /-- The glued labels of the step, as labels of the explosion. -/ +@[expose] def stepLabelI : {f : W.Flag // f ∈ C} := ⟨f₀, h₀⟩ /-- The partner label of the step. -/ +@[expose] def stepLabelJ : {f : W.Flag // f ∈ C} := ⟨W.pairing f₀, hC f₀ h₀⟩ @@ -141,6 +145,7 @@ theorem stepLabel_ne : stepLabelI W C f₀ h₀ ≠ W.pairing_ne f₀ (congrArg Subtype.val h).symm /-- The surviving labels of the step are the shrunken cut set. -/ +@[expose] def stepLabelEquiv : {f : W.Flag // f ∈ cutErase W C f₀} ≃ Fragment.SurvivingLabel {f : W.Flag // f ∈ C} diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/StarPrep.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/StarPrep.lean index 7a158c7c8a..6afdd338bf 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/StarPrep.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/StarPrep.lean @@ -20,7 +20,7 @@ blocks; and the interface pairs of a full closure split into the high-block pairs followed by the low-block pairs. -/ -@[expose] public section +public section namespace RS @@ -139,6 +139,7 @@ noncomputable def strandBundleTranspose (m : ℕ) : /-! ### The interface split of a full closure -/ /-- The high-block interface pairs of a full `(m + m)`-closure. -/ +@[expose] def highCross (m : ℕ) : List ((Fin (0 + (m + m)) ⊕ Fin ((m + m) + 0)) × (Fin (0 + (m + m)) ⊕ Fin ((m + m) + 0))) := @@ -147,6 +148,7 @@ def highCross (m : ℕ) : Sum.inr ⟨m + k.val, by have := k.isLt; omega⟩)) /-- The low-block interface pairs of a full `(m + m)`-closure. -/ +@[expose] def lowCross (m : ℕ) : List ((Fin (0 + (m + m)) ⊕ Fin ((m + m) + 0)) × (Fin (0 + (m + m)) ⊕ Fin ((m + m) + 0))) := diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/StarTrace.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/StarTrace.lean index 3d1c2168c9..e61150466a 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/StarTrace.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/StarTrace.lean @@ -19,7 +19,7 @@ the star union restores the fragment (`starUnion_reglue`). On Hom classes: the descended trace of the star-union class is the value. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/StateFlipSet.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/StateFlipSet.lean index 9e2b8eec47..759f32e090 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/StateFlipSet.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/StateFlipSet.lean @@ -17,7 +17,7 @@ Composition is symmetric difference, so pairing-returning accumulations cancel by parity. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/StatusSet.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/StatusSet.lean index 92edcea977..492dd74b8b 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/StatusSet.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/StatusSet.lean @@ -20,7 +20,7 @@ high-status difference of the endpoint pairings — empty exactly when the pairing returns. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/StepFrame.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/StepFrame.lean index 26edb452ba..927032bfe7 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/StepFrame.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/StepFrame.lean @@ -21,7 +21,7 @@ directions, a constraint on the old frame derived from the new system. -/ -@[expose] public section +public section namespace RS @@ -525,6 +525,7 @@ end EdgeSubset /-- The paired step without the chord signs: within a block the pairing returns, so the two path signs agree and cancel. -/ +@[expose] def PairedLedgerUnsigned : Prop := ∀ {α : Type} [LinearOrder α] {W : Fragment α} {F : EdgeSubset W} {k ℓ : ℕ} (hM : MixedFunctional k ℓ) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/StepLedger.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/StepLedger.lean index a3b99afbca..edc1268794 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/StepLedger.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/StepLedger.lean @@ -65,7 +65,7 @@ repair does not carry the ledger on its own, which is why a pair is treated as one composite move. -/ -@[expose] public section +public section namespace RS @@ -702,6 +702,7 @@ repair undoes the re-routing of the first, the composite walk change is supported on the two crossing squares, and the two vertex negations cancel against the net chord-parity change. Proved in `PairedAssembly.lean`. -/ +@[expose] def PairedLedger : Prop := ∀ {α : Type} [LinearOrder α] {W : Fragment α} {F : EdgeSubset W} {k ℓ : ℕ} (hM : MixedFunctional k ℓ) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/StepStatus.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/StepStatus.lean index 0001193be0..1ef39b39a8 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/StepStatus.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/StepStatus.lean @@ -27,7 +27,7 @@ low-in-old (the re-paired ends carry opposite old statuses, on a re-paired end (`mem_highSet_repair_untouched`). -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/StepStatusNonsep.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/StepStatusNonsep.lean index 64f5b28b06..946a640c28 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/StepStatusNonsep.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/StepStatusNonsep.lean @@ -39,7 +39,7 @@ No swap-end data is consumed: the identity holds for the anchored transported frame of *any* repair from a canonical source. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/StrandBundle.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/StrandBundle.lean index 52e07ddbb0..699dcab943 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/StrandBundle.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/StrandBundle.lean @@ -18,12 +18,13 @@ boundary label `k` to boundary label `t + k`. Flags are pairs `b = true` at the outgoing end (label `t + k`). -/ -@[expose] public section +public section namespace RS /-- The bundle of `t` parallel strands: strand `k` joins label `k` to label `t + k`. -/ +@[expose] def strandBundle (t : ℕ) : Fragment (Fin (t + t)) where Flag := Fin t × Bool Vertex := Empty diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/SumLexOrder.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/SumLexOrder.lean index 5650bbb06e..10be4f624d 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/SumLexOrder.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/SumLexOrder.lean @@ -20,7 +20,7 @@ multiplicativity of the corrected value, first target of the factorization chain. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/SuperGram.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/SuperGram.lean index 7dfd4496ff..9879cbbbfa 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/SuperGram.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/SuperGram.lean @@ -25,7 +25,7 @@ attached to the two fragments bounds the edge-rank by `(k + 2ℓ)^t`, because that is how many boundary states there are. -/ -@[expose] public section +public section namespace RS @@ -67,12 +67,14 @@ factor depends on the boundary state alone. -/ /-- The number of legs a boundary state colours oddly. -/ +@[expose] noncomputable def oddCount {k ℓ t : ℕ} (x : GenBoundaryState k ℓ (Fin t)) : ℕ := (Finset.univ.filter (fun i => ∃ c, x i = Sum.inr c)).card /-- **The fragment tensor's normalising root**: a fourth root of unity, one quarter turn for every two odd legs. -/ +@[expose] noncomputable def stateTwist {k ℓ t : ℕ} (x : GenBoundaryState k ℓ (Fin t)) : ℂ := Complex.I ^ (oddCount x / 2) @@ -153,12 +155,14 @@ collapses to a single one. /-- **The dual of one leg's colour**: itself on an even colour, the partner on an odd one. -/ +@[expose] noncomputable def dualLeg {k ℓ : ℕ} : (Fin k ⊕ Fin (2 * ℓ)) → (Fin k ⊕ Fin (2 * ℓ)) | Sum.inl a => Sum.inl a | Sum.inr c => Sum.inr (oddPartner ℓ c) /-- **The dual state**: the dual colour at every leg. -/ +@[expose] noncomputable def dualState {k ℓ : ℕ} {α : Type} (x : GenBoundaryState k ℓ α) : GenBoundaryState k ℓ α := fun i => dualLeg (x i) @@ -200,6 +204,7 @@ theorem superForm_eq_zero_of_ne_dualState {k ℓ t : ℕ} /-- **One leg's form against its own dual**: `1` on an even colour, and on an odd one the negated dual sign — RS21's `⟨f_c, g_c⟩`. -/ +@[expose] noncomputable def legSelf {k ℓ : ℕ} : (Fin k ⊕ Fin (2 * ℓ)) → ℂ | Sum.inl _ => 1 @@ -292,6 +297,7 @@ count. -/ /-- One leg's dual-basis weight, as it occurs in `dualWeight`. -/ +@[expose] noncomputable def legWeight {k ℓ : ℕ} (b : Bool) (v : Fin k ⊕ Fin (2 * ℓ)) : ℂ := match v with @@ -354,6 +360,7 @@ theorem dualLeg_involutive {k ℓ : ℕ} : rw [oddPartner_invol] /-- **Undoing the dual basis at the legs whose arc leaves.** -/ +@[expose] noncomputable def untwistState {k ℓ t : ℕ} (b : Fin t → Bool) (x : GenBoundaryState k ℓ (Fin t)) : GenBoundaryState k ℓ (Fin t) := diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/SuperSpace.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/SuperSpace.lean index 1cae1c03b8..f4924dad01 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/SuperSpace.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/SuperSpace.lean @@ -29,7 +29,7 @@ the tower's colour kernel, which pairs the odd colours through `-oddThroughFactor`. -/ -@[expose] public section +public section namespace RS @@ -38,6 +38,7 @@ namespace RS /-- **The symplectic matrix** `J = [[0, I], [-I, 0]]` in coordinates: `J c d` is `1` when `d = c + ℓ`, `-1` when `c = d + ℓ`, and `0` otherwise. -/ +@[expose] noncomputable def symplecticJ (ℓ : ℕ) (c d : Fin (2 * ℓ)) : ℂ := if d.val = c.val + ℓ then 1 else if c.val = d.val + ℓ then -1 @@ -45,6 +46,7 @@ noncomputable def symplecticJ (ℓ : ℕ) (c d : Fin (2 * ℓ)) : ℂ := /-- **The super form on one leg**: the identity on the even colours, `J` on the odd ones, zero across. -/ +@[expose] noncomputable def superLeg {k ℓ : ℕ} : (Fin k ⊕ Fin (2 * ℓ)) → (Fin k ⊕ Fin (2 * ℓ)) → ℂ | Sum.inl a, Sum.inl b => if a = b then 1 else 0 @@ -80,6 +82,7 @@ fixes the convention. /-- The symplectic dual of a colour: the partner colour with the partner sign. This is RS21's `g_c` written in the basis of the `f`'s. -/ +@[expose] noncomputable def dualSign (ℓ : ℕ) (c : Fin (2 * ℓ)) : ℂ := ((oddPartnerSign ℓ c : ℤ) : ℂ) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/TensorAssoc.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/TensorAssoc.lean index cb7e04e0cd..ad78b88989 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/TensorAssoc.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/TensorAssoc.lean @@ -20,13 +20,14 @@ interleave value lemmas; the associator equivalence follows by pure relabel algebra. -/ -@[expose] public section +public section namespace RS variable (s₁ t₁ s₂ t₂ s₃ t₃ : ℕ) /-- The associativity cast of interleaved boundaries. -/ +@[expose] noncomputable def tensorAssocCast : Fin ((s₁ + (s₂ + s₃)) + (t₁ + (t₂ + t₃))) ≃ Fin (((s₁ + s₂) + s₃) + ((t₁ + t₂) + t₃)) := diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/TensorComm.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/TensorComm.lean index 652ee66ff1..ac211dcfb3 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/TensorComm.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/TensorComm.lean @@ -18,11 +18,12 @@ right-slot half of the monoidal ideal follows from the left-slot machinery through the swap. -/ -@[expose] public section +public section namespace RS /-- The block swap of interleaved boundaries. -/ +@[expose] noncomputable def tensorSwapEquiv (s t u v : ℕ) : Fin ((u + s) + (v + t)) ≃ Fin ((s + u) + (t + v)) := (interleaveEquiv u v s t).symm.trans diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/TensorCompClass.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/TensorCompClass.lean index 98e8c4ca7e..d06ea9e248 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/TensorCompClass.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/TensorCompClass.lean @@ -18,7 +18,7 @@ to the Hom spaces: the fragment-level interchange at the singles, extended by the four-fold bilinear induction. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/TensorFragment.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/TensorFragment.lean index 2c4203eb16..8635d2474b 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/TensorFragment.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/TensorFragment.lean @@ -20,13 +20,14 @@ the interleaving, and `tensorFragmentCongr` shows the tensor respects fragment equivalence in both slots. -/ -@[expose] public section +public section namespace RS /-- The interleaving of two `(low, high)` boundaries: low block of the first, low block of the second, high block of the first, high block of the second. -/ +@[expose] def interleaveEquiv (s t u v : ℕ) : (Fin (s + t) ⊕ Fin (u + v)) ≃ Fin ((s + u) + (t + v)) := ((_root_.Equiv.sumCongr finSumFinEquiv.symm @@ -103,6 +104,7 @@ theorem interleaveEquiv_symm_high_right (s t u v : ℕ) (l : Fin v) : /-- The tensor product of fragments: disjoint union with interleaved boundary. -/ +@[expose] noncomputable def tensorFragment {s t u v : ℕ} (x : Fragment (Fin (s + t))) (z : Fragment (Fin (u + v))) : Fragment (Fin ((s + u) + (t + v))) := diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/TensorIdeal.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/TensorIdeal.lean index 4552cc5142..50cd9d374c 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/TensorIdeal.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/TensorIdeal.lean @@ -25,7 +25,7 @@ remains is the closure of `x` against the survivors — the defining gluing of `partialClose`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/TensorInterchange.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/TensorInterchange.lean index 1f854699ee..bc03dc8910 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/TensorInterchange.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/TensorInterchange.lean @@ -22,7 +22,7 @@ by normalizing both sides to iterated gluing over the common ambient `(F₁ ⊔ G₁) ⊔ (F₂ ⊔ G₂)` and meeting the label chains. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/TensorUnit.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/TensorUnit.lean index b902192e47..9a6adfdafd 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/TensorUnit.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/TensorUnit.lean @@ -16,7 +16,7 @@ arithmetic cast, on either side. These power the unitors of the monoidal skein category. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/ThroughEdgeCut.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/ThroughEdgeCut.lean index 4dbcbed87c..bf2e727f13 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/ThroughEdgeCut.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/ThroughEdgeCut.lean @@ -21,7 +21,7 @@ transports here are what the colouring recursion needs at such a cut. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/ThroughIndCFalse.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/ThroughIndCFalse.lean index c9ca98a077..375aa69eb3 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/ThroughIndCFalse.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/ThroughIndCFalse.lean @@ -24,7 +24,7 @@ interfaces consuming `ThroughIndependenceC` must be re-based on the pairing-resolved value. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/ThroughValue.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/ThroughValue.lean index ab8f9cecfe..2f11784c57 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/ThroughValue.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/ThroughValue.lean @@ -27,7 +27,7 @@ Even colourings stay fully pairing-constant: the even gluing weight is diagonal, which pairing-constancy implements already. -/ -@[expose] public section +public section namespace RS @@ -40,12 +40,14 @@ namespace EdgeSubset open scoped Classical in /-- The through-flags: participating flags on boundary–boundary edges. -/ +@[expose] noncomputable def throughFlags (F : EdgeSubset W) : Finset W.Flag := F.flags.filter (fun f => (∃ i : α, W.attach f = Sum.inr i) ∧ (∃ j : α, W.attach (W.pairing f) = Sum.inr j)) /-- The core flags: participating flags on edges with at least one internal end. -/ +@[expose] noncomputable def coreFlags (F : EdgeSubset W) : Finset W.Flag := F.flags \ F.throughFlags @@ -105,6 +107,7 @@ theorem internalFlags_subset_coreFlags (F : EdgeSubset W) : /-- Odd colourings of the core: pairing-constant colours on the participating flags of edges with an internal end. -/ +@[expose] def CoreOddColouring (F : EdgeSubset W) (ℓ : ℕ) : Type := {φ : {f : W.Flag // f ∈ F.coreFlags} → Fin (2 * ℓ) // ∀ f : {f : W.Flag // f ∈ F.coreFlags}, @@ -123,6 +126,7 @@ noncomputable instance CoreOddColouring.instFintype open Classical in /-- The odd pair contributed by an incoming internal flag, from the core colouring. -/ +@[expose] noncomputable def coreOddPairFn (F : EdgeSubset W) {ℓ : ℕ} (κ : F.RelTransitionSystem) (φ : F.CoreOddColouring ℓ) (f : {f : W.Flag // f ∈ F.internalFlags}) : @@ -134,6 +138,7 @@ noncomputable def coreOddPairFn (F : EdgeSubset W) {ℓ : ℕ} open Classical in /-- The odd-pairing sign contributed by an incoming internal flag, from the core colouring. -/ +@[expose] noncomputable def coreOddSignFn (F : EdgeSubset W) {ℓ : ℕ} (κ : F.RelTransitionSystem) (φ : F.CoreOddColouring ℓ) (f : {f : W.Flag // f ∈ F.internalFlags}) : ℤ := @@ -142,6 +147,7 @@ noncomputable def coreOddSignFn (F : EdgeSubset W) {ℓ : ℕ} open Classical in /-- The odd-colour list at a vertex, from the core colouring. -/ +@[expose] noncomputable def coreOddListAt (F : EdgeSubset W) {ℓ : ℕ} {κ : F.RelTransitionSystem} (o : κ.Orientation) (φ : F.CoreOddColouring ℓ) (v : W.Vertex) : @@ -152,6 +158,7 @@ noncomputable def coreOddListAt (F : EdgeSubset W) {ℓ : ℕ} open Classical in /-- The odd-pairing sign at a vertex, from the core colouring. -/ +@[expose] noncomputable def coreOddSignAt (F : EdgeSubset W) {ℓ : ℕ} {κ : F.RelTransitionSystem} (o : κ.Orientation) (φ : F.CoreOddColouring ℓ) (v : W.Vertex) : ℤ := @@ -187,6 +194,7 @@ open scoped Classical in /-- The through-edge state weight of an edge subset: each through-edge contributes its state factor exactly once, from its lower-label flag. -/ +@[expose] noncomputable def throughProduct [LinearOrder α] {k ℓ : ℕ} (F : EdgeSubset W) (st : GenBoundaryState k ℓ α) : ℂ := ∏ f ∈ F.throughFlags.attach, @@ -198,6 +206,7 @@ noncomputable def throughProduct [LinearOrder α] {k ℓ : ℕ} /-- The core odd boundary constraint: the state's odd colours are imposed on the core boundary flags (through-edges are constrained by the through factor instead). -/ +@[expose] def coreOddBoundaryMatch {k ℓ : ℕ} (F : EdgeSubset W) (st : GenBoundaryState k ℓ α) (φ : F.CoreOddColouring ℓ) : Prop := @@ -208,6 +217,7 @@ def coreOddBoundaryMatch {k ℓ : ℕ} (F : EdgeSubset W) open Classical in /-- **The corrected constrained summand**: circuit sign, through factor, and the core colouring sum. -/ +@[expose] noncomputable def throughSummand [LinearOrder α] (F : EdgeSubset W) {k ℓ : ℕ} (h : MixedFunctional k ℓ) (st : GenBoundaryState k ℓ α) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/Trace.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/Trace.lean index 891afb26d8..e863d02254 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/Trace.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/Trace.lean @@ -20,12 +20,13 @@ the pairing kernel by construction and so descends to the Hom spaces of the skein category. -/ -@[expose] public section +public section namespace RS /-- The trace of a `(t + t)`-fragment under a parameter: the value of its strand closure. -/ +@[expose] noncomputable def fragTrace (f : ClosedFragment → ℂ) {t : ℕ} (F : Fragment (Fin (t + t))) : ℂ := f (pairClose F (strandBundle t)) @@ -51,6 +52,7 @@ theorem ker_le_ker_traceFunctional (f : ClosedFragment → ℂ) (t : ℕ) : rfl /-- The trace descends to the Hom space. -/ +@[expose] noncomputable def HomSpace.traceMap (f : ClosedFragment → ℂ) (t : ℕ) : HomSpace f (t + t) →ₗ[ℂ] ℂ := Submodule.liftQ _ (traceFunctional f t) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/TraceCyclic.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/TraceCyclic.lean index 76350122af..281c3a25b2 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/TraceCyclic.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/TraceCyclic.lean @@ -27,7 +27,7 @@ commutativity of the closure and the closure-relabel exchange `s = 0`, where the outgoing block is the entire boundary. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/TraceNondegenerate.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/TraceNondegenerate.lean index 76ba8f7d3d..add18cf9ee 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/TraceNondegenerate.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/TraceNondegenerate.lean @@ -20,7 +20,7 @@ so the two test families coincide, and an element all of whose traces vanish lies in the pairing kernel. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/TransitionExists.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/TransitionExists.lean index 7bbdb36264..c9ad8661d7 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/TransitionExists.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/TransitionExists.lean @@ -28,7 +28,7 @@ orientation. The construction proceeds in two parts: orbit representatives under the flag order. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/TransitionMove.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/TransitionMove.lean index de7263ac94..3746a2230e 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/TransitionMove.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/TransitionMove.lean @@ -62,7 +62,7 @@ needs the orbit machinery; that construction is segment. -/ -@[expose] public section +public section namespace RS @@ -78,6 +78,7 @@ variable {W : Fragment α} {F : EdgeSubset W} /-- Re-pair a matching function at four flags: `a ↦ c`, `c ↦ a`, `b ↦ d`, `d ↦ b`, leaving every other flag to `m`. -/ +@[expose] def repairFun (m : W.Flag → W.Flag) (a b c d : W.Flag) : W.Flag → W.Flag := fun f => if f = a then c else if f = c then a else @@ -217,6 +218,7 @@ square (`a ↔ b`, `c ↔ d` matched, all four distinct, all at vertex `v`), the transition system matching `a ↔ c` and `b ↔ d` instead, keeping every other matched pair. The result is a system over the *same* edge subset `F`. -/ +@[expose] def repair (κ : F.RelTransitionSystem) (a b c d : W.Flag) (v : W.Vertex) (h : RepairSquare κ a b c d v) : F.RelTransitionSystem where @@ -328,6 +330,7 @@ on the internal flags. All fields of `RelTransitionSystem` constrain only internal flags, so `MatchEq`-related systems are interchangeable; the matching's values off `F.internalFlags` are junk. -/ +@[expose] def MatchEq (κ₁ κ₂ : F.RelTransitionSystem) : Prop := ∀ f ∈ F.internalFlags, κ₁.match_ f = κ₂.match_ f @@ -412,6 +415,7 @@ theorem RepairSquare.symm {κ : F.RelTransitionSystem} /-- One elementary move joins `κ₁` to `κ₂`: some admissible square of `κ₁` repairs it to a system matching-equal to `κ₂`. -/ +@[expose] def IsRepairStep (κ₁ κ₂ : F.RelTransitionSystem) : Prop := ∃ (a b c d : W.Flag) (v : W.Vertex) (h : RepairSquare κ₁ a b c d v), @@ -596,6 +600,7 @@ namespace RelTransitionSystem /-- Orientations transport across matching equality: an orientation constrains `isOut` only through the matching's values on internal flags. -/ +@[expose] def Orientation.ofMatchEq {κ κ' : F.RelTransitionSystem} (heq : κ.MatchEq κ') (o : κ.Orientation) : κ'.Orientation where isOut := o.isOut @@ -608,6 +613,7 @@ orientation already separates `a` and `c` (`isOut c = !isOut a`), it transports *unchanged* along the repair. When instead `isOut c = isOut a` the transported orientation must flip `isOut` along a walk segment; that is `Orientation.segFlip`. -/ +@[expose] def Orientation.transportRepair {κ : F.RelTransitionSystem} {a b c d : W.Flag} {v : W.Vertex} (h : RepairSquare κ a b c d v) (o : κ.Orientation) (hflip : o.isOut c = !o.isOut a) : diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/TransposeLedger.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/TransposeLedger.lean index d25f12e973..a68f59195f 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/TransposeLedger.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/TransposeLedger.lean @@ -55,7 +55,7 @@ separated configuration. The decomposition behind the constant: `ThroughIndCFalse.lean` compares against. -/ -@[expose] public section +public section namespace RS @@ -68,6 +68,7 @@ square's vertex; the `oddPartnerSign` commutation and the colour re-routing contribute `+1` each, so `T` is constant — independent of the boundary state, the `∂`-data at the four re-paired ends, and the transition system. -/ +@[expose] noncomputable def twoPathTransformFactor : ℂ := -1 /-- The factor unfolded. -/ @@ -160,7 +161,7 @@ open EdgeSubset /-- One vertex, four pendant edges: flags `0–3` at the vertex, flags `4–7` at boundary labels `0–3`; edges `{0,4}`, `{1,5}`, `{3,6}`, `{2,7}`. -/ -@[reducible] def cFragment : Fragment (Fin 4) where +@[expose, reducible] def cFragment : Fragment (Fin 4) where Flag := Fin 8 Vertex := Unit attach := ![Sum.inl (), Sum.inl (), Sum.inl (), Sum.inl (), @@ -257,6 +258,7 @@ theorem cSquare : RepairSquare cKappa 0 1 2 3 cV := /-- The separated, path-canonical orientation: both chains enter the vertex through their low-label ends. -/ +@[expose] def cO : cKappa.Orientation where isOut := ![false, true, true, false, false, false, false, false] match_flip := fun f hf => by @@ -288,6 +290,7 @@ theorem cBnd : /-- The functional supported on the colour set `{0, 5, 2, 7}` (the odd-list set of the original summand). -/ +@[expose] noncomputable def cFunctional : MixedFunctional 0 4 := fun _ s => if s = ({0, 5, 2, 7} : Finset (Fin (2 * 4))) then 1 else 0 @@ -340,6 +343,7 @@ theorem cThroughProduct : /-- The edge colours: edge `{0,4}` gets `0`, `{1,5}` gets `1`, `{3,6}` gets `2`, `{2,7}` gets `3`. -/ +@[expose] def cColour : Fin 8 → Fin (2 * 4) := ![0, 1, 3, 2, 0, 1, 2, 3] /-- The pinned core odd colouring. -/ diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/TwoPathNonSep.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/TwoPathNonSep.lean index ce91f9e34a..f1746cc16c 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/TwoPathNonSep.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/TwoPathNonSep.lean @@ -28,7 +28,7 @@ factor is minus the product of the two end colours' odd-partner signs. -/ -@[expose] public section +public section namespace RS @@ -39,6 +39,7 @@ namespace RS open scoped Classical in /-- Apply the odd-partner involution to the (odd) state entries at two labels, leaving all other labels untouched. -/ +@[expose] noncomputable def stateOddFlip {k ℓ : ℕ} {α : Type} (st : GenBoundaryState k ℓ α) (i₁ i₂ : α) : GenBoundaryState k ℓ α := @@ -1501,6 +1502,7 @@ original state. Unlike the separated factor `−1`, it depends on the boundary state (only through those two signs), and the transform additionally `∂`-relabels the state at the two chain-end labels. -/ +@[expose] noncomputable def twoPathNonSepFactor (ℓ : ℕ) (c₁ c₂ : Fin (2 * ℓ)) : ℂ := -(((oddPartnerSign ℓ c₁ * oddPartnerSign ℓ c₂ : ℤ) : ℂ)) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/TwoPathStep.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/TwoPathStep.lean index ad83405a36..153d203e1c 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/TwoPathStep.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/TwoPathStep.lean @@ -32,7 +32,7 @@ The transform factor the move contributes to the summand is pinned in `TransposeLedger.lean`, on top of this count invariance. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/VertexOddSign.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/VertexOddSign.lean index 134f83d09f..e99d1ee675 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/VertexOddSign.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/VertexOddSign.lean @@ -23,7 +23,7 @@ Flipping the colours on a set `S` negates the sign at the flags of analysis a product of independent local factors. -/ -@[expose] public section +public section namespace RS @@ -73,11 +73,13 @@ theorem relInFlagsAt_coe {κ₀ : F.RelTransitionSystem} /-! ## The odd-colour pair at an internal flag -/ /-- The flag's own odd colour. -/ +@[expose] noncomputable def pairA (φ : F.CoreOddColouring ℓ) (f : {f : W.Flag // f ∈ F.internalFlags}) : Fin (2 * ℓ) := φ.val ⟨f.val, F.internalFlags_subset_coreFlags f.prop⟩ /-- The odd colour opposite the flag's transition partner. -/ +@[expose] noncomputable def pairB {κ₀ : F.RelTransitionSystem} (φ : F.CoreOddColouring ℓ) (f : {f : W.Flag // f ∈ F.internalFlags}) : Fin (2 * ℓ) := @@ -126,6 +128,7 @@ theorem evalOdd_flatMap_rev (hM : MixedFunctional k ℓ) /-- The odd-pairing sign an incoming flag carries, extended by one off the core. -/ +@[expose] noncomputable def inSign (φ : F.CoreOddColouring ℓ) (g : W.Flag) : ℤ := if hg : g ∈ F.coreFlags then oddPartnerSign ℓ (φ.val ⟨g, hg⟩) diff --git a/LeanPool/RegtsSevenster/RS/Novel/Skein/VertexSum.lean b/LeanPool/RegtsSevenster/RS/Novel/Skein/VertexSum.lean index 591cbea980..711360b8a4 100644 --- a/LeanPool/RegtsSevenster/RS/Novel/Skein/VertexSum.lean +++ b/LeanPool/RegtsSevenster/RS/Novel/Skein/VertexSum.lean @@ -24,7 +24,7 @@ product, which the graph model instead carries inside the boundary vectors. -/ -@[expose] public section +public section namespace RS @@ -37,6 +37,7 @@ variable {α : Type} open scoped Classical in /-- **The vertex sum**: over colourings extending the boundary state, the product of the functional's vertex values. -/ +@[expose] noncomputable def vertexSum {W : Fragment α} (F : EdgeSubset W) {k ℓ : ℕ} (h : MixedFunctional k ℓ) (st : GenBoundaryState k ℓ α) diff --git a/LeanPool/RegtsSevenster/RS/QuantSector.lean b/LeanPool/RegtsSevenster/RS/QuantSector.lean index 542f9a515d..e4c7f0bc1f 100644 --- a/LeanPool/RegtsSevenster/RS/QuantSector.lean +++ b/LeanPool/RegtsSevenster/RS/QuantSector.lean @@ -23,7 +23,7 @@ together with the square Schur nonvanishing); this file holds the tower half of the dichotomy and the assembly. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/StatementConverse.lean b/LeanPool/RegtsSevenster/RS/StatementConverse.lean index 531c781bf4..2f0269379d 100644 --- a/LeanPool/RegtsSevenster/RS/StatementConverse.lean +++ b/LeanPool/RegtsSevenster/RS/StatementConverse.lean @@ -22,7 +22,7 @@ proved here: the Definition 5 value of any flagless fragment is `(k − 2ℓ) ^ circles`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/Summit.lean b/LeanPool/RegtsSevenster/RS/Summit.lean index 35830802bd..e735e4a5da 100644 --- a/LeanPool/RegtsSevenster/RS/Summit.lean +++ b/LeanPool/RegtsSevenster/RS/Summit.lean @@ -34,7 +34,7 @@ The axiom checks are pinned in `RS/Assembly/BlueprintDeligne.lean`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/TheoremConverse.lean b/LeanPool/RegtsSevenster/RS/TheoremConverse.lean index 53ac460cdc..9d18dc7b56 100644 --- a/LeanPool/RegtsSevenster/RS/TheoremConverse.lean +++ b/LeanPool/RegtsSevenster/RS/TheoremConverse.lean @@ -18,7 +18,7 @@ edge-rank-bounded parameter. With it the characterization and the quantitative round trip rest on Deligne alone. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/TheoremDimension.lean b/LeanPool/RegtsSevenster/RS/TheoremDimension.lean index d9d8cae134..16f07796d4 100644 --- a/LeanPool/RegtsSevenster/RS/TheoremDimension.lean +++ b/LeanPool/RegtsSevenster/RS/TheoremDimension.lean @@ -18,7 +18,7 @@ the even roots of the actual connection ranks. The assembly is conditional on Deligne's theorem, discharged in `RS/Summit.lean`. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/TheoremForward.lean b/LeanPool/RegtsSevenster/RS/TheoremForward.lean index e3e496f8ef..531fe14d52 100644 --- a/LeanPool/RegtsSevenster/RS/TheoremForward.lean +++ b/LeanPool/RegtsSevenster/RS/TheoremForward.lean @@ -18,7 +18,7 @@ of the envelope from the connection-rank bound, without a Schur package. The resulting fibre functor provides the mixed model. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/TheoremPadding.lean b/LeanPool/RegtsSevenster/RS/TheoremPadding.lean index f27dc4f0ef..7d6cd255d1 100644 --- a/LeanPool/RegtsSevenster/RS/TheoremPadding.lean +++ b/LeanPool/RegtsSevenster/RS/TheoremPadding.lean @@ -18,7 +18,7 @@ prescribed compatible pair. Extension by zero then gives a model on exactly that pair of colour spaces. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/TheoremQuant.lean b/LeanPool/RegtsSevenster/RS/TheoremQuant.lean index 5ce8aa6978..59e8b7ff69 100644 --- a/LeanPool/RegtsSevenster/RS/TheoremQuant.lean +++ b/LeanPool/RegtsSevenster/RS/TheoremQuant.lean @@ -17,7 +17,7 @@ nonvanishing, so the quantitative Regts–Sevenster statement rests on Deligne's theorem and one binomial determinant. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/RS/TheoremTotal.lean b/LeanPool/RegtsSevenster/RS/TheoremTotal.lean index 9b13510601..6df5994649 100644 --- a/LeanPool/RegtsSevenster/RS/TheoremTotal.lean +++ b/LeanPool/RegtsSevenster/RS/TheoremTotal.lean @@ -18,7 +18,7 @@ theorem; the dimension bound comes from the polynomial commutant estimate for the full signed colour action. -/ -@[expose] public section +public section namespace RS diff --git a/LeanPool/RegtsSevenster/Solution.lean b/LeanPool/RegtsSevenster/Solution.lean index e0352aa0c4..97e0484d5a 100644 --- a/LeanPool/RegtsSevenster/Solution.lean +++ b/LeanPool/RegtsSevenster/Solution.lean @@ -19,7 +19,7 @@ that the kernel accepts them; see `comparator-config.json` and the CI workflow. -/ -@[expose] public section +public section namespace Certified 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..cfcaa620b1 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 @@ -58,7 +58,7 @@ private lemma changeMeasureFun_coe {c : ℝ≥0∞} (hc : c ≠ ∞) (hν : ν (MeasureTheory.MemLp.coeFn_toLp (memLp_changeMeasure (μ := μ) (ν := ν) (p := p) hc hν f)) /-- The identity map as a linear map `Lp E p μ →ₗ[ℝ] Lp E p ν` under a measure bound `ν ≤ c • μ`. -/ -noncomputable def changeMeasureₗ {c : ℝ≥0∞} (hc : c ≠ ∞) (hν : ν ≤ c • μ) : +@[expose] noncomputable def changeMeasureₗ {c : ℝ≥0∞} (hc : c ≠ ∞) (hν : ν ≤ c • μ) : Lp E p μ →ₗ[ℝ] Lp E p ν where toFun := changeMeasureFun (μ := μ) (ν := ν) (p := p) hc hν map_add' f g := by @@ -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 59764612c8..ebc0c39044 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 135f71ebae..a9df17f676 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 (OrderMonoidWithZeroHomClass.toOrderMonoidWithZeroHom v.normalization) @@ -299,7 +300,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 @@ -451,7 +452,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 @@ -509,6 +510,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 c40f2ec47a..85a0e7e49c 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/RungeKuttaOrderConditions/Imports.lean b/LeanPool/RungeKuttaOrderConditions/Imports.lean index 45350bbdfa..d029882b32 100644 --- a/LeanPool/RungeKuttaOrderConditions/Imports.lean +++ b/LeanPool/RungeKuttaOrderConditions/Imports.lean @@ -8,3 +8,4 @@ module -- shake: keep-all --deprecated_module: ignore -- Generated project imports; run `lake exe mk_all`. public import LeanPool.RungeKuttaOrderConditions public import LeanPool.RungeKuttaOrderConditions.ButcherOrder +public import LeanPool.RungeKuttaOrderConditions.CheckerExamples 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/SNumbers/AddOns/Approximable.lean b/LeanPool/SNumbers/AddOns/Approximable.lean index 47caf3c3eb..c258ae9354 100644 --- a/LeanPool/SNumbers/AddOns/Approximable.lean +++ b/LeanPool/SNumbers/AddOns/Approximable.lean @@ -39,7 +39,7 @@ treated in `AddOns.Compact` via the singular value decomposition. finite rank. -/ -@[expose] public section +public section universe u @@ -57,6 +57,7 @@ variable [NormedAddCommGroup Z] [NormedSpace 𝕜 Z] /-- An operator `S : X →L[𝕜] Y` is **approximable** if its approximation numbers tend to zero. -/ +@[expose] def IsApproximable (S : X →L[𝕜] Y) : Prop := Tendsto (SNumbers.approximationNumber S) atTop (𝓝 0) diff --git a/LeanPool/SNumbers/AddOns/Compact.lean b/LeanPool/SNumbers/AddOns/Compact.lean index e4b61de691..b577f45dfd 100644 --- a/LeanPool/SNumbers/AddOns/Compact.lean +++ b/LeanPool/SNumbers/AddOns/Compact.lean @@ -79,7 +79,7 @@ operators. On Hilbert spaces the Schmidt representation repairs this, and then 12.3. -/ -@[expose] public section +public section universe u diff --git a/LeanPool/SNumbers/BasicResults/Auerbach.lean b/LeanPool/SNumbers/BasicResults/Auerbach.lean index 15f354d8ed..22ae51f320 100644 --- a/LeanPool/SNumbers/BasicResults/Auerbach.lean +++ b/LeanPool/SNumbers/BasicResults/Auerbach.lean @@ -20,7 +20,7 @@ The proof maximizes `|det|` on the product of unit balls, then reads off the bas and dual functionals from the maximizer. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/SNumbers/BasicResults/Determinant.lean b/LeanPool/SNumbers/BasicResults/Determinant.lean index f43b2f48ce..84822e6479 100644 --- a/LeanPool/SNumbers/BasicResults/Determinant.lean +++ b/LeanPool/SNumbers/BasicResults/Determinant.lean @@ -25,7 +25,7 @@ public import Mathlib.LinearAlgebra.Determinant commutative ring and with no invertibility hypothesis. -/ -@[expose] public section +public section open LinearMap open scoped ComplexConjugate diff --git a/LeanPool/SNumbers/BasicResults/GarlingGordon.lean b/LeanPool/SNumbers/BasicResults/GarlingGordon.lean index 4f82c13c1f..9253483795 100644 --- a/LeanPool/SNumbers/BasicResults/GarlingGordon.lean +++ b/LeanPool/SNumbers/BasicResults/GarlingGordon.lean @@ -28,7 +28,7 @@ is intrinsic to the general Banach setting `SNumbers.Inequalities` recover the sharp constant by letting `ε → 0`. -/ -@[expose] public section +public section universe u diff --git a/LeanPool/SNumbers/BasicResults/John.lean b/LeanPool/SNumbers/BasicResults/John.lean index 75dffa4136..066cbd15ae 100644 --- a/LeanPool/SNumbers/BasicResults/John.lean +++ b/LeanPool/SNumbers/BasicResults/John.lean @@ -68,7 +68,7 @@ norm (`c‖x‖ ≤ p x ≤ C‖x‖`, `c > 0`). The ellipsoid `T (B₂)` lies i topological double dual). -/ -@[expose] public section +public section universe u @@ -268,6 +268,7 @@ lemma isCompact_contact (q : Seminorm 𝕜 (EuclideanSpace 𝕜 (Fin k))) : /-- The self-adjoint **rank-one operator** `u ⊗ u : x ↦ ⟪u, x⟫ • u`. The John decomposition of identity expresses `id` as a positive combination of these over contact points. -/ +@[expose] noncomputable def rankOneSA (u : EuclideanSpace 𝕜 (Fin k)) : EuclideanSpace 𝕜 (Fin k) →L[𝕜] EuclideanSpace 𝕜 (Fin k) := (innerSL 𝕜 u).smulRight u diff --git a/LeanPool/SNumbers/BasicResults/JohnAux.lean b/LeanPool/SNumbers/BasicResults/JohnAux.lean index 624538fbfa..39158bcd57 100644 --- a/LeanPool/SNumbers/BasicResults/JohnAux.lean +++ b/LeanPool/SNumbers/BasicResults/JohnAux.lean @@ -49,7 +49,7 @@ candidate for upstreaming to Mathlib: for some endomorphism `G`. -/ -@[expose] public section +public section open scoped InnerProductSpace ComplexConjugate diff --git a/LeanPool/SNumbers/BasicResults/KadetsSnobar.lean b/LeanPool/SNumbers/BasicResults/KadetsSnobar.lean index c210e3cf6a..5b27d84e5b 100644 --- a/LeanPool/SNumbers/BasicResults/KadetsSnobar.lean +++ b/LeanPool/SNumbers/BasicResults/KadetsSnobar.lean @@ -24,7 +24,7 @@ weaken `dim V` to `n`; the underlying input is `John.john_decomposition`, the John decomposition of identity. -/ -@[expose] public section +public section universe u diff --git a/LeanPool/SNumbers/BasicResults/LittleGrothendieck.lean b/LeanPool/SNumbers/BasicResults/LittleGrothendieck.lean index ee663662ee..df53cbd8b4 100644 --- a/LeanPool/SNumbers/BasicResults/LittleGrothendieck.lean +++ b/LeanPool/SNumbers/BasicResults/LittleGrothendieck.lean @@ -51,7 +51,7 @@ makes `∑_j ‖w_j‖²` summable (`summable_norm_sq_row`), recorded at the end together with the `ℓ₂`-norm identity `norm_sq_eq_tsum_norm_sq`. -/ -@[expose] public section +public section open scoped ENNReal diff --git a/LeanPool/SNumbers/BasicResults/SVD.lean b/LeanPool/SNumbers/BasicResults/SVD.lean index 182acf76a1..3f9b1c8cf6 100644 --- a/LeanPool/SNumbers/BasicResults/SVD.lean +++ b/LeanPool/SNumbers/BasicResults/SVD.lean @@ -49,7 +49,7 @@ operators. operator (Bessel plus a row bound). -/ -@[expose] public section +public section universe u @@ -75,6 +75,7 @@ special case with no zeros. -/ /-- `OrthonormalOrZero 𝕜 u`: each `u i` is a unit vector or zero, and distinct vectors are orthogonal. -/ +@[expose] def OrthonormalOrZero (𝕜 : Type*) [RCLike 𝕜] {H : Type*} [NormedAddCommGroup H] [InnerProductSpace 𝕜 H] {ι : Type*} (u : ι → H) : Prop := (∀ i, ‖u i‖ = 1 ∨ u i = 0) ∧ Pairwise (fun i j => (inner 𝕜 (u i) (u j) : 𝕜) = 0) diff --git a/LeanPool/SNumbers/BasicResults/Spectral/Complexification.lean b/LeanPool/SNumbers/BasicResults/Spectral/Complexification.lean index e61b4070c0..ae5d24b1c8 100644 --- a/LeanPool/SNumbers/BasicResults/Spectral/Complexification.lean +++ b/LeanPool/SNumbers/BasicResults/Spectral/Complexification.lean @@ -40,7 +40,7 @@ of a real *inner product space* with its complex inner product. This file constructs it, kept deliberately elementary and self-contained. -/ -@[expose] public section +public section noncomputable section @@ -50,6 +50,7 @@ variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℝ H] /-- The **complexification** of a real inner product space `H`, modelled as the pair type `H × H`; the pair `(x, y)` represents the formal sum `x + i·y`. -/ +@[expose] def Complexification (H : Type*) : Type _ := H × H @@ -65,6 +66,7 @@ type `Complexification H` is only type-correct after unfolding `Complexification which `simp` and `rw` refuse to do; going through `mk` together with the projection lemmas `mk_fst`/`mk_snd` below keeps every goal in this file stated in terms the simp set can act on. -/ +@[expose] def mk (x y : H) : Complexification H := (x, y) omit [NormedAddCommGroup H] [InnerProductSpace ℝ H] in @@ -177,6 +179,7 @@ instance [Nontrivial H] : Nontrivial (Complexification H) := rw [RCLike.real_smul_eq_coe_smul (K := ℂ), smul_snd]; simp /-- The canonical embedding `x ↦ x + i·0` of `H` into its complexification. -/ +@[expose] def ofReal (x : H) : Complexification H := mk x 0 omit [InnerProductSpace ℝ H] in @@ -200,6 +203,7 @@ omit [InnerProductSpace ℝ H] in exact Real.sqrt_sq (norm_nonneg x) /-- The embedding `ofReal` as a real-linear isometry `H →ₗᵢ[ℝ] Complexification H`. -/ +@[expose] def ofRealLi : H →ₗᵢ[ℝ] Complexification H where toFun := ofReal map_add' x y := by apply Prod.ext <;> simp @@ -234,12 +238,14 @@ lemma norm_le_add (u : Complexification H) : ‖u‖ ≤ ‖u.1‖ + ‖u.2‖ : mul_nonneg (norm_nonneg u.1) (norm_nonneg u.2)] /-- The real-part projection `(x, y) ↦ x` as an `ℝ`-linear map. -/ +@[expose] def fstₗ : Complexification H →ₗ[ℝ] H where toFun u := u.1 map_add' := add_fst map_smul' r u := rsmul_fst r u /-- The real-part projection `(x, y) ↦ x` as a continuous `ℝ`-linear map. -/ +@[expose] def fstL : Complexification H →L[ℝ] H := fstₗ.mkContinuous 1 fun u => by rw [one_mul]; exact norm_fst_le u @@ -270,6 +276,7 @@ involution of the complexification. Its set of fixed points is exactly the image object descends to the real space. -/ /-- Complex conjugation on the complexification: `(x, y) ↦ (x, -y)`. -/ +@[expose] def conj (u : Complexification H) : Complexification H := mk u.1 (-u.2) omit [InnerProductSpace ℝ H] in @@ -303,6 +310,7 @@ lemma conj_smul (c : ℂ) (u : Complexification H) : exact (sq_eq_sq₀ (norm_nonneg _) (norm_nonneg _)).mp hsq /-- Conjugation as a real-linear isometry. -/ +@[expose] def conjLi : Complexification H →ₗᵢ[ℝ] Complexification H where toFun := conj map_add' := conj_add @@ -310,6 +318,7 @@ def conjLi : Complexification H →ₗᵢ[ℝ] Complexification H where norm_map' := norm_conj /-- Conjugation as a continuous `ℝ`-linear map. -/ +@[expose] def conjL : Complexification H →L[ℝ] Complexification H := conjLi.toContinuousLinearMap @[simp] lemma conjL_apply (u : Complexification H) : conjL u = conj u := rfl @@ -339,6 +348,7 @@ variable {H₁ H₂ : Type*} [NormedAddCommGroup H₂] [InnerProductSpace ℝ H₂] /-- The complexification of `S` as a `ℂ`-linear map, `(x, y) ↦ (S x, S y)`. -/ +@[expose] def complexifyₗ (S : H₁ →L[ℝ] H₂) : Complexification H₁ →ₗ[ℂ] Complexification H₂ where toFun u := mk (S u.1) (S u.2) map_add' u v := by apply Prod.ext <;> simp @@ -358,6 +368,7 @@ lemma norm_complexifyₗ_le (S : H₁ →L[ℝ] H₂) (u : Complexification H₁ /-- The complexification of a real bounded operator `S`, as a `ℂ`-linear bounded operator `(x, y) ↦ (S x, S y)`. -/ +@[expose] def complexify (S : H₁ →L[ℝ] H₂) : Complexification H₁ →L[ℂ] Complexification H₂ := (complexifyₗ S).mkContinuous ‖S‖ (norm_complexifyₗ_le S) diff --git a/LeanPool/SNumbers/BasicResults/Spectral/MonotoneConvergence.lean b/LeanPool/SNumbers/BasicResults/Spectral/MonotoneConvergence.lean index 96a4740265..ab73cb62b5 100644 --- a/LeanPool/SNumbers/BasicResults/Spectral/MonotoneConvergence.lean +++ b/LeanPool/SNumbers/BasicResults/Spectral/MonotoneConvergence.lean @@ -21,7 +21,7 @@ The key inequality is, for a positive operator `A` on a complex Hilbert space, with `‖A x‖² = re⟪A² x, x⟫`. -/ -@[expose] public section +public section open ContinuousLinearMap RCLike open scoped InnerProductSpace diff --git a/LeanPool/SNumbers/BasicResults/Spectral/MultiplicationOperator.lean b/LeanPool/SNumbers/BasicResults/Spectral/MultiplicationOperator.lean index a5fa1a3872..e692cface3 100644 --- a/LeanPool/SNumbers/BasicResults/Spectral/MultiplicationOperator.lean +++ b/LeanPool/SNumbers/BasicResults/Spectral/MultiplicationOperator.lean @@ -46,7 +46,7 @@ Mathlib reuse: Hölder's inequality for `L^∞ · L²` `MemLp.coeFn_toLp` interface to `Lp`, and `LinearMap.mkContinuous`. -/ -@[expose] public section +public section open scoped ENNReal NNReal open MeasureTheory diff --git a/LeanPool/SNumbers/BasicResults/Spectral/Projection.lean b/LeanPool/SNumbers/BasicResults/Spectral/Projection.lean index bfe2436a35..3587b15b9f 100644 --- a/LeanPool/SNumbers/BasicResults/Spectral/Projection.lean +++ b/LeanPool/SNumbers/BasicResults/Spectral/Projection.lean @@ -32,7 +32,7 @@ elementary properties (continuity, `0 ≤ · ≤ 1`, antitone in `n`, value `1` above the threshold). -/ -@[expose] public section +public section open ContinuousLinearMap diff --git a/LeanPool/SNumbers/BasicResults/Spectral/RealProjection.lean b/LeanPool/SNumbers/BasicResults/Spectral/RealProjection.lean index f67b00c17c..ae75eb1f74 100644 --- a/LeanPool/SNumbers/BasicResults/Spectral/RealProjection.lean +++ b/LeanPool/SNumbers/BasicResults/Spectral/RealProjection.lean @@ -27,7 +27,7 @@ complexification). Hence `Eℂ` maps the real subspace `range ofReal` into itsel a real operator `E` inheriting the two operator-norm bounds. -/ -@[expose] public section +public section open Complexification ContinuousLinearMap diff --git a/LeanPool/SNumbers/BasicResults/Spectral/Representation.lean b/LeanPool/SNumbers/BasicResults/Spectral/Representation.lean index 98ee44d2a2..e433bab608 100644 --- a/LeanPool/SNumbers/BasicResults/Spectral/Representation.lean +++ b/LeanPool/SNumbers/BasicResults/Spectral/Representation.lean @@ -36,7 +36,7 @@ derives the geometric fact the factorisation needs. bounded below by `c` there. This is the geometric heart of `SVD.exists_scalar_factorisation`. -/ -@[expose] public section +public section open ContinuousLinearMap Complexification RCLike diff --git a/LeanPool/SNumbers/SNumbers/Approximation.lean b/LeanPool/SNumbers/SNumbers/Approximation.lean index f505b19ec2..150f749c24 100644 --- a/LeanPool/SNumbers/SNumbers/Approximation.lean +++ b/LeanPool/SNumbers/SNumbers/Approximation.lean @@ -52,7 +52,7 @@ s-number sequence `s`). sequence `s` — the approximation numbers are the largest. -/ -@[expose] public section +public section universe u @@ -70,11 +70,13 @@ variable [NormedAddCommGroup Z] [NormedSpace 𝕜 Z] /-- The set of approximation residuals `‖S - L‖` over operators `L` of rank at most `n`. -/ +@[expose] def approximationSet (S : X →L[𝕜] Y) (n : ℕ) : Set ℝ := {r | ∃ L : X →L[𝕜] Y, L.rank ≤ (n : Cardinal) ∧ r = ‖S - L‖} /-- The `n`-th **approximation number** of a continuous linear map: the infimum of `‖S - L‖` over operators `L` of rank at most `n`. -/ +@[expose] noncomputable def approximationNumber (S : X →L[𝕜] Y) (n : ℕ) : ℝ := sInf (approximationSet S n) @@ -357,6 +359,7 @@ lemma approximationNumber_id_euclidean (n : ℕ) : /-! ### Summary: approximation numbers form a strict s-number sequence -/ /-- The approximation-numbers family. -/ +@[expose] noncomputable def approximationFamily : Family 𝕜 := fun {_X _Y} _ _ _ _ S n => approximationNumber S n diff --git a/LeanPool/SNumbers/SNumbers/Basic.lean b/LeanPool/SNumbers/SNumbers/Basic.lean index afa40d97b1..152dabb666 100644 --- a/LeanPool/SNumbers/SNumbers/Basic.lean +++ b/LeanPool/SNumbers/SNumbers/Basic.lean @@ -58,7 +58,7 @@ required at the level of axioms; downstream constructions add `[CompleteSpace X]` where needed. -/ -@[expose] public section +public section universe u @@ -90,30 +90,35 @@ abbrev Family (𝕜 : Type u) [NontriviallyNormedField 𝕜] := variable {𝕜 : Type u} [NontriviallyNormedField 𝕜] /-- (S1) `s` takes non-negative values. -/ +@[expose] def Nonneg (s : Family 𝕜) : Prop := ∀ {X Y : Type u} [NormedAddCommGroup X] [NormedSpace 𝕜 X] [NormedAddCommGroup Y] [NormedSpace 𝕜 Y] (S : X →L[𝕜] Y) (n : ℕ), 0 ≤ s S n /-- (S1) The first value equals the operator norm: `s 0 S = ‖S‖`. -/ +@[expose] def NormAtZero (s : Family 𝕜) : Prop := ∀ {X Y : Type u} [NormedAddCommGroup X] [NormedSpace 𝕜 X] [NormedAddCommGroup Y] [NormedSpace 𝕜 Y] (S : X →L[𝕜] Y), s S 0 = ‖S‖ /-- (S1) The sequence is non-increasing in `n`. -/ +@[expose] def Antitone (s : Family 𝕜) : Prop := ∀ {X Y : Type u} [NormedAddCommGroup X] [NormedSpace 𝕜 X] [NormedAddCommGroup Y] [NormedSpace 𝕜 Y] (S : X →L[𝕜] Y) (n : ℕ), s S (n + 1) ≤ s S n /-- (S2) Subadditivity: `s n (S + T) ≤ s n S + ‖T‖`. -/ +@[expose] def Subadditive (s : Family 𝕜) : Prop := ∀ {X Y : Type u} [NormedAddCommGroup X] [NormedSpace 𝕜 X] [NormedAddCommGroup Y] [NormedSpace 𝕜 Y] (S T : X →L[𝕜] Y) (n : ℕ), s (S + T) n ≤ s S n + ‖T‖ /-- (S3) Ideal property: `s n (B ∘ S ∘ A) ≤ ‖B‖ * s n S * ‖A‖`. -/ +@[expose] def IdealLike (s : Family 𝕜) : Prop := ∀ {W X Y Z : Type u} [NormedAddCommGroup W] [NormedSpace 𝕜 W] [NormedAddCommGroup X] [NormedSpace 𝕜 X] @@ -123,12 +128,14 @@ def IdealLike (s : Family 𝕜) : Prop := s (B.comp (S.comp A)) n ≤ ‖B‖ * s S n * ‖A‖ /-- (S4) Vanishing on operators of rank at most `n`. -/ +@[expose] def VanishesOnLowRank (s : Family 𝕜) : Prop := ∀ {X Y : Type u} [NormedAddCommGroup X] [NormedSpace 𝕜 X] [NormedAddCommGroup Y] [NormedSpace 𝕜 Y] (S : X →L[𝕜] Y) (n : ℕ), S.rank ≤ (n : Cardinal) → s S n = 0 /-- (S5) Normalisation: `s n (id_{ℓ₂^{n+1}}) = 1`. -/ +@[expose] def NormalisedAtId (s : Family 𝕜) : Prop := ∀ (n : ℕ), s (ContinuousLinearMap.id 𝕜 (EuclideanSpace 𝕜 (Fin (n + 1)))) n = 1 @@ -138,6 +145,7 @@ A strengthening of (S5), which only fixes the value on the specific Hilbert space `ℓ₂^{n+1}`. Sequences satisfying (S5') have `s n (id_X) = 1` on *every* `X` with finite dimension strictly above `n`; specialising to `X = ℓ₂^{n+1}` (where `dim = n + 1 > n`) recovers (S5). -/ +@[expose] def StrictlyNormalisedAtId (s : Family 𝕜) : Prop := ∀ {X : Type u} [NormedAddCommGroup X] [NormedSpace 𝕜 X] (n : ℕ), n < Module.finrank 𝕜 X → s (ContinuousLinearMap.id 𝕜 X) n = 1 diff --git a/LeanPool/SNumbers/SNumbers/Bernstein.lean b/LeanPool/SNumbers/SNumbers/Bernstein.lean index 5a0728d029..7cfb6992ba 100644 --- a/LeanPool/SNumbers/SNumbers/Bernstein.lean +++ b/LeanPool/SNumbers/SNumbers/Bernstein.lean @@ -28,7 +28,7 @@ The Bernstein numbers are the *smallest injective strict s-number sequence* The development needs only `[NontriviallyNormedField 𝕜]`. -/ -@[expose] public section +public section universe u @@ -55,6 +55,7 @@ noncomputable def gainOnSubspace (S : X →L[𝕜] Y) (M : Submodule 𝕜 X) : /-- The set of admissible gains at stage `n`: the numbers `gainOnSubspace S M` for subspaces `M ⊆ X` of dimension exactly `n + 1`. The `n`-th Bernstein number is its supremum. -/ +@[expose] def bernsteinSet (S : X →L[𝕜] Y) (n : ℕ) : Set ℝ := {r | ∃ M : Submodule 𝕜 X, Module.rank 𝕜 M = (n + 1 : ℕ) ∧ r = gainOnSubspace S M} @@ -62,6 +63,7 @@ def bernsteinSet (S : X →L[𝕜] Y) (n : ℕ) : Set ℝ := /-- The `n`-th **Bernstein number** of a continuous linear map. `b_n S = sup_{M ⊆ X, dim M = n + 1} gainOnSubspace S M`. -/ +@[expose] noncomputable def bernsteinNumber (S : X →L[𝕜] Y) (n : ℕ) : ℝ := sSup (bernsteinSet S n) diff --git a/LeanPool/SNumbers/SNumbers/Entropy.lean b/LeanPool/SNumbers/SNumbers/Entropy.lean index 1cff93103c..7332ef1517 100644 --- a/LeanPool/SNumbers/SNumbers/Entropy.lean +++ b/LeanPool/SNumbers/SNumbers/Entropy.lean @@ -106,7 +106,7 @@ where one is needed; the topological work is done by `Metric.totallyBounded_iff`. -/ -@[expose] public section +public section universe u @@ -125,6 +125,7 @@ variable [NormedAddCommGroup Z] [NormedSpace 𝕜 Z] /-- The set of admissible radii at stage `n`: those `ε > 0` for which the image of the closed unit ball of `X` under `S` can be covered by at most `2 ^ n` closed balls of radius `ε`, with arbitrary centres in `Y`. -/ +@[expose] def entropySet (S : X →L[𝕜] Y) (n : ℕ) : Set ℝ := {ε | 0 < ε ∧ ∃ N : Finset Y, N.card ≤ 2 ^ n ∧ ⇑S '' Metric.closedBall 0 1 ⊆ ⋃ y ∈ (N : Set Y), Metric.closedBall y ε} @@ -132,6 +133,7 @@ def entropySet (S : X →L[𝕜] Y) (n : ℕ) : Set ℝ := /-- The `n`-th **entropy number** of a continuous linear map: the infimum of the radii `ε > 0` for which `S(B_X)` is covered by at most `2 ^ n` closed `ε`-balls. -/ +@[expose] noncomputable def entropyNumber (S : X →L[𝕜] Y) (n : ℕ) : ℝ := sInf (entropySet S n) diff --git a/LeanPool/SNumbers/SNumbers/EntropyBounds.lean b/LeanPool/SNumbers/SNumbers/EntropyBounds.lean index 6e8b750698..7f7101c79e 100644 --- a/LeanPool/SNumbers/SNumbers/EntropyBounds.lean +++ b/LeanPool/SNumbers/SNumbers/EntropyBounds.lean @@ -83,7 +83,7 @@ Nets are passed as functions `Fin k → Y` rather than as the `Finset` of [link](https://zbmath.org/3996455), 2.4 ([Pie87]). -/ -@[expose] public section +public section universe u diff --git a/LeanPool/SNumbers/SNumbers/Examples/DiagonalMatrices.lean b/LeanPool/SNumbers/SNumbers/Examples/DiagonalMatrices.lean index 805a6797ef..a06019ab64 100644 --- a/LeanPool/SNumbers/SNumbers/Examples/DiagonalMatrices.lean +++ b/LeanPool/SNumbers/SNumbers/Examples/DiagonalMatrices.lean @@ -73,7 +73,7 @@ maps `projFin` / `padFin` in `SNumbers.PiLpCoordinates`. [link](https://zbmath.org/3996455). -/ -@[expose] public section +public section universe u @@ -89,6 +89,7 @@ variable {𝕜 : Type u} [RCLike 𝕜] {m : ℕ} {p : ℝ≥0∞} [Fact (1 ≤ p /-- The **diagonal operator** `D_σ : ℓ^p_m → ℓ^p_m`, `x ↦ (σ_i · x_i)`, as a continuous linear map. The domain is finite-dimensional, so continuity is automatic (`LinearMap.toContinuousLinearMap`). -/ +@[expose] noncomputable def DiagCLM (p : ℝ≥0∞) [Fact (1 ≤ p)] (σ : Fin m → 𝕜) : PiLp p (fun _ : Fin m => 𝕜) →L[𝕜] PiLp p (fun _ : Fin m => 𝕜) := LinearMap.toContinuousLinearMap @@ -347,6 +348,7 @@ variable {q : ℝ≥0∞} [Fact (1 ≤ q)] so continuity is automatic. Specialises to `DiagCLM p σ` when `q = p` (`DiagCLMpq_self`) and to the identity embedding `idEmbed p q` when `σ ≡ 1` (`DiagCLMpq_one`). -/ +@[expose] noncomputable def DiagCLMpq (p q : ℝ≥0∞) [Fact (1 ≤ p)] [Fact (1 ≤ q)] (σ : Fin m → 𝕜) : PiLp q (fun _ : Fin m => 𝕜) →L[𝕜] PiLp p (fun _ : Fin m => 𝕜) := LinearMap.toContinuousLinearMap diff --git a/LeanPool/SNumbers/SNumbers/Examples/ExHelpers.lean b/LeanPool/SNumbers/SNumbers/Examples/ExHelpers.lean index 1bdb876e86..49c76cdadd 100644 --- a/LeanPool/SNumbers/SNumbers/Examples/ExHelpers.lean +++ b/LeanPool/SNumbers/SNumbers/Examples/ExHelpers.lean @@ -35,7 +35,7 @@ saturating a prescribed coordinate bound on many coordinates. The proof is an extreme-point argument (Krein–Milman) combined with the pigeonhole lemma. -/ -@[expose] public section +public section universe u diff --git a/LeanPool/SNumbers/SNumbers/Examples/Identity.lean b/LeanPool/SNumbers/SNumbers/Examples/Identity.lean index 9d034d5a95..97d539b67f 100644 --- a/LeanPool/SNumbers/SNumbers/Examples/Identity.lean +++ b/LeanPool/SNumbers/SNumbers/Examples/Identity.lean @@ -41,7 +41,7 @@ This file develops the case `1 ≤ p ≤ q < ∞`: `SNumbers.Examples.ExHelpers`. -/ -@[expose] public section +public section universe u @@ -123,6 +123,7 @@ lemma piLp_norm_const_one {p : ℝ≥0∞} [Fact (1 ≤ p)] (hp : p ≠ ∞) : /-- The **identity embedding** `id : ℓ^q_m → ℓ^p_m`: the same underlying vector, re-measured in the `p`-norm. -/ +@[expose] noncomputable def idEmbed (p q : ℝ≥0∞) [Fact (1 ≤ p)] [Fact (1 ≤ q)] : PiLp q (fun _ : Fin m => 𝕜) →L[𝕜] PiLp p (fun _ : Fin m => 𝕜) := LinearMap.toContinuousLinearMap diff --git a/LeanPool/SNumbers/SNumbers/Examples/IdentityL1Linfty.lean b/LeanPool/SNumbers/SNumbers/Examples/IdentityL1Linfty.lean index 1011c904d7..531416b6f4 100644 --- a/LeanPool/SNumbers/SNumbers/Examples/IdentityL1Linfty.lean +++ b/LeanPool/SNumbers/SNumbers/Examples/IdentityL1Linfty.lean @@ -47,7 +47,7 @@ the approximation numbers. Here `ℓ₁ = lp (fun _ : ℕ => 𝕜) 1` and `ℓ_∞ = lp (fun _ : ℕ => 𝕜) ∞`, and `𝕜` is `RCLike`. -/ -@[expose] public section +public section open scoped ENNReal @@ -74,6 +74,7 @@ lemma norm_coe_linf_le_norm {p : ℝ≥0∞} [Fact (1 ≤ p)] (hp : p ≠ 0) exact lp.norm_apply_le_norm hp f i /-- The natural inclusion `I : ℓ₁ → ℓ_∞`, a contraction. -/ +@[expose] noncomputable def incl : L1 𝕜 →L[𝕜] Linf 𝕜 := LinearMap.mkContinuous (lp.linearMapOfLE 𝕜 (fun _ : ℕ => 𝕜) le_top) 1 (fun f => by rw [one_mul]; exact norm_coe_linf_le_norm (by norm_num) f) @@ -386,6 +387,7 @@ lemma norm_coe_l2_le_norm_l1 (f : L1 𝕜) : nlinarith [norm_nonneg g, norm_nonneg f, hsq, hle] /-- The norm-one inclusion `J₁ : ℓ₁ → ℓ₂`. -/ +@[expose] noncomputable def inclL1L2 : L1 𝕜 →L[𝕜] L2 𝕜 := LinearMap.mkContinuous (lp.linearMapOfLE 𝕜 (fun _ : ℕ => 𝕜) (by norm_num : (1 : ℝ≥0∞) ≤ 2)) 1 (fun f => by @@ -398,6 +400,7 @@ lemma norm_inclL1L2_le : ‖(inclL1L2 : L1 𝕜 →L[𝕜] L2 𝕜)‖ ≤ 1 := LinearMap.mkContinuous_norm_le _ zero_le_one _ /-- The norm-one inclusion `J₂ : ℓ₂ → ℓ_∞`. -/ +@[expose] noncomputable def inclL2Linf : L2 𝕜 →L[𝕜] Linf 𝕜 := LinearMap.mkContinuous (lp.linearMapOfLE 𝕜 (fun _ : ℕ => 𝕜) le_top) 1 (fun f => by rw [one_mul]; exact norm_coe_linf_le_norm (by norm_num) f) diff --git a/LeanPool/SNumbers/SNumbers/Gelfand.lean b/LeanPool/SNumbers/SNumbers/Gelfand.lean index 26b4b1407a..e9730774af 100644 --- a/LeanPool/SNumbers/SNumbers/Gelfand.lean +++ b/LeanPool/SNumbers/SNumbers/Gelfand.lean @@ -36,7 +36,7 @@ particular, the strict-normalisation proof needs no `[CompleteSpace 𝕜]` hypothesis. -/ -@[expose] public section +public section universe u @@ -55,12 +55,14 @@ variable [NormedAddCommGroup Z] [NormedSpace 𝕜 Z] /-! ### Definitions -/ /-- The norm of `S` restricted to a (closed) subspace `M` of `X`. -/ +@[expose] noncomputable def deviationFromRestriction (S : X →L[𝕜] Y) (M : Submodule 𝕜 X) : ℝ := ‖S.comp M.subtypeL‖ /-- The set of admissible deviations at stage `n`: the numbers `‖S|_M‖` for closed subspaces `M ⊆ X` of codimension at most `n`. The `n`-th Gelfand number is its infimum. -/ +@[expose] def gelfandSet (S : X →L[𝕜] Y) (n : ℕ) : Set ℝ := {r | ∃ M : Submodule 𝕜 X, IsClosed (M : Set X) ∧ @@ -70,6 +72,7 @@ def gelfandSet (S : X →L[𝕜] Y) (n : ℕ) : Set ℝ := /-- The `n`-th **Gelfand number** of a continuous linear map. `c_n S = inf_{M ⊆ X closed, codim M ≤ n} ‖S|_M‖`. -/ +@[expose] noncomputable def gelfandNumber (S : X →L[𝕜] Y) (n : ℕ) : ℝ := sInf (gelfandSet S n) diff --git a/LeanPool/SNumbers/SNumbers/Helpers.lean b/LeanPool/SNumbers/SNumbers/Helpers.lean index 7eba5c3cb6..cbdd14be46 100644 --- a/LeanPool/SNumbers/SNumbers/Helpers.lean +++ b/LeanPool/SNumbers/SNumbers/Helpers.lean @@ -37,7 +37,7 @@ topological modules but without operator-norm information; the lemmas here add the missing norm bounds in the normed setting. -/ -@[expose] public section +public section universe u diff --git a/LeanPool/SNumbers/SNumbers/Hilbert.lean b/LeanPool/SNumbers/SNumbers/Hilbert.lean index e178b2b100..596788473a 100644 --- a/LeanPool/SNumbers/SNumbers/Hilbert.lean +++ b/LeanPool/SNumbers/SNumbers/Hilbert.lean @@ -43,7 +43,7 @@ The two non-trivial halves are: (`approximationNumber_id_euclidean`) via the (S3) ideal property. -/ -@[expose] public section +public section universe u @@ -68,6 +68,7 @@ abbrev L2 (𝕜 : Type*) [RCLike 𝕜] : Type _ := lp (fun _ : ℕ => 𝕜) 2 /-- The set of ratios `a_n (B ∘ S ∘ A) / (‖B‖ ‖A‖)` over nonzero `A : ℓ₂ → X`, `B : Y → ℓ₂`, whose supremum is the Hilbert number. -/ +@[expose] def hilbertSet (S : X →L[𝕜] Y) (n : ℕ) : Set ℝ := {r | ∃ (A : L2 𝕜 →L[𝕜] X) (B : Y →L[𝕜] L2 𝕜), A ≠ 0 ∧ B ≠ 0 ∧ @@ -78,6 +79,7 @@ def hilbertSet (S : X →L[𝕜] Y) (n : ℕ) : Set ℝ := `h_n S = sup { a_n (B ∘ S ∘ A) / (‖B‖ * ‖A‖) : A : ℓ₂ →L X, B : Y →L ℓ₂, A ≠ 0, B ≠ 0 }`. -/ +@[expose] noncomputable def hilbertNumber (S : X →L[𝕜] Y) (n : ℕ) : ℝ := sSup (hilbertSet S n) diff --git a/LeanPool/SNumbers/SNumbers/Inequalities.lean b/LeanPool/SNumbers/SNumbers/Inequalities.lean index 705473d411..1f3173d348 100644 --- a/LeanPool/SNumbers/SNumbers/Inequalities.lean +++ b/LeanPool/SNumbers/SNumbers/Inequalities.lean @@ -110,7 +110,7 @@ admissible `(A, B)` yields `hₙ(S) ≤ sₙ(S)`. `aₙ ≤ (1+√n)·cₙ` estimate from [Pie87, 2.10.2]. -/ -@[expose] public section +public section universe u diff --git a/LeanPool/SNumbers/SNumbers/Injectivity.lean b/LeanPool/SNumbers/SNumbers/Injectivity.lean index 9c868ae87b..c2d1e8c26a 100644 --- a/LeanPool/SNumbers/SNumbers/Injectivity.lean +++ b/LeanPool/SNumbers/SNumbers/Injectivity.lean @@ -60,7 +60,7 @@ an isometry / a metric surjection (`‖J ∘ T‖ = ‖T‖`, `‖T ∘ Q‖ = the infimum sets coincide. -/ -@[expose] public section +public section universe u @@ -80,6 +80,7 @@ variable [NormedAddCommGroup Z] [NormedSpace 𝕜 Z] /-- A **metric injection** is a norm-preserving (isometric) continuous linear map: `‖J y‖ = ‖y‖` for all `y`. -/ +@[expose] def IsMetricInjection (J : Y →L[𝕜] Z) : Prop := ∀ y, ‖J y‖ = ‖y‖ @@ -144,6 +145,7 @@ lemma IsMetricSurjection.norm_comp {Q : W →L[𝕜] X} (hQ : IsMetricSurjection /-- An `s`-number sequence is **injective** if post-composition with any metric injection leaves it unchanged: `sₙ(J ∘ S) = sₙ(S)`. -/ +@[expose] def Injective (s : Family 𝕜) : Prop := ∀ {X Y Z : Type u} [NormedAddCommGroup X] [NormedSpace 𝕜 X] [NormedAddCommGroup Y] [NormedSpace 𝕜 Y] diff --git a/LeanPool/SNumbers/SNumbers/Kolmogorov.lean b/LeanPool/SNumbers/SNumbers/Kolmogorov.lean index 3f1e70e4a1..0f28ac8a74 100644 --- a/LeanPool/SNumbers/SNumbers/Kolmogorov.lean +++ b/LeanPool/SNumbers/SNumbers/Kolmogorov.lean @@ -48,7 +48,7 @@ agree on Banach spaces. -/ -@[expose] public section +public section universe u @@ -68,17 +68,20 @@ variable [NormedAddCommGroup Z] [NormedSpace 𝕜 Z] /-- Quotient form of the deviation: `‖π_V ∘ S‖`, where `π_V` is the quotient projection `Y →L[𝕜] Y ⧸ V`. -/ +@[expose] noncomputable def deviationFromSubspace (S : X →L[𝕜] Y) (V : Submodule 𝕜 Y) : ℝ := ‖V.mkQL.comp S‖ /-- The set of admissible deviations at stage `n`: the numbers `‖π_V ∘ S‖` for subspaces `V ⊆ Y` of dimension at most `n`. The `n`-th Kolmogorov number is its infimum. -/ +@[expose] def kolmogorovSet (S : X →L[𝕜] Y) (n : ℕ) : Set ℝ := {r | ∃ V : Submodule 𝕜 Y, Module.rank 𝕜 V ≤ (n : Cardinal) ∧ r = deviationFromSubspace S V} /-- Quotient form of the `n`-th Kolmogorov number. -/ +@[expose] noncomputable def kolmogorovNumber (S : X →L[𝕜] Y) (n : ℕ) : ℝ := sInf (kolmogorovSet S n) diff --git a/LeanPool/SNumbers/SNumbers/KolmogorovLifting.lean b/LeanPool/SNumbers/SNumbers/KolmogorovLifting.lean index d6e312fa89..243d749021 100644 --- a/LeanPool/SNumbers/SNumbers/KolmogorovLifting.lean +++ b/LeanPool/SNumbers/SNumbers/KolmogorovLifting.lean @@ -92,7 +92,7 @@ with `section` blocks switching to stronger hypotheses when needed: `[DenselyNormedField 𝕜] + [CompleteSpace 𝕜]`). -/ -@[expose] public section +public section universe u @@ -140,6 +140,7 @@ private lemma summable_smul_val [CompleteSpace X] (α : BallLp 𝕜 X) : (summable_norm_smul_val α).of_norm /-- The summation surjection `Q : ℓ¹(B_X) →L[𝕜] X`. Operator norm `≤ 1`. -/ +@[expose] noncomputable def Q [CompleteSpace X] : BallLp 𝕜 X →L[𝕜] X := LinearMap.mkContinuous { toFun := fun α => ∑' x : Ball X, α x • (x : X) @@ -361,6 +362,7 @@ private lemma summable_smul_liftBasis {A : W →L[𝕜] X} {c : 𝕜} exact mul_le_mul_of_nonneg_left (norm_liftBasis hc hc_ne w).le (norm_nonneg _)) /-- The lift `T_{A,c} : ℓ¹(B_W) →L[𝕜] ℓ¹(B_X)`. -/ +@[expose] noncomputable def liftA (A : W →L[𝕜] X) {c : 𝕜} (hc : ‖A‖ ≤ ‖c‖) (hc_ne : c ≠ 0) : BallLp 𝕜 W →L[𝕜] BallLp 𝕜 X := LinearMap.mkContinuous diff --git a/LeanPool/SNumbers/SNumbers/MaxDifference.lean b/LeanPool/SNumbers/SNumbers/MaxDifference.lean index ace7b10fc8..ee72765f1a 100644 --- a/LeanPool/SNumbers/SNumbers/MaxDifference.lean +++ b/LeanPool/SNumbers/SNumbers/MaxDifference.lean @@ -119,7 +119,7 @@ Hilbert space is **not** formalised here. (general case). -/ -@[expose] public section +public section universe u diff --git a/LeanPool/SNumbers/SNumbers/PiLpCoordinates.lean b/LeanPool/SNumbers/SNumbers/PiLpCoordinates.lean index 941cc8eb14..177b10447f 100644 --- a/LeanPool/SNumbers/SNumbers/PiLpCoordinates.lean +++ b/LeanPool/SNumbers/SNumbers/PiLpCoordinates.lean @@ -31,7 +31,7 @@ This is generic `PiLp` material (no s-number content); it is a candidate for upstreaming to `Mathlib.Analysis.Normed.Lp.PiLp`. -/ -@[expose] public section +public section universe u @@ -70,6 +70,7 @@ lemma finrank_piLp (k : ℕ) : /-- The **coordinate projection** `ℓ^p_m → ℓ^p_n` keeping the first `n` coordinates (along `Fin.castLE h`). -/ +@[expose] noncomputable def projFin (h : n ≤ m) : PiLp p (fun _ : Fin m => 𝕜) →L[𝕜] PiLp p (fun _ : Fin n => 𝕜) := LinearMap.toContinuousLinearMap @@ -82,6 +83,7 @@ noncomputable def projFin (h : n ≤ m) : /-- The **coordinate embedding** `ℓ^p_n → ℓ^p_m` extending by zeros past the first `n` coordinates. -/ +@[expose] noncomputable def padFin : PiLp p (fun _ : Fin n => 𝕜) →L[𝕜] PiLp p (fun _ : Fin m => 𝕜) := LinearMap.toContinuousLinearMap diff --git a/LeanPool/SNumbers/SNumbers/SingularValuesFinDim.lean b/LeanPool/SNumbers/SNumbers/SingularValuesFinDim.lean index e3edecea6a..ecf59ced96 100644 --- a/LeanPool/SNumbers/SNumbers/SingularValuesFinDim.lean +++ b/LeanPool/SNumbers/SNumbers/SingularValuesFinDim.lean @@ -47,7 +47,7 @@ s S n = aₙ(S) (Pietsch uniqueness on Hilbert spaces) gives `aₙ = σₙ`, so no separate statement is needed. -/ -@[expose] public section +public section universe u diff --git a/LeanPool/SNumbers/SNumbers/Uniqueness.lean b/LeanPool/SNumbers/SNumbers/Uniqueness.lean index 9033ee2f41..9167659e8e 100644 --- a/LeanPool/SNumbers/SNumbers/Uniqueness.lean +++ b/LeanPool/SNumbers/SNumbers/Uniqueness.lean @@ -60,7 +60,7 @@ input is `SpectralRepresentation.exists_spectral_projection`. `sₙ(S) = aₙ(S)`. -/ -@[expose] public section +public section universe u 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..48aadec8b1 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 @@ -102,7 +102,7 @@ variable {Ω C D S : Set Plane} {a b z : Plane} point of `Ω`, and has all of its points except `a` inside `Ω`. Stated for a chain rather than for a simple arc; see the module docstring. -/ -def PolyAccessible (Ω : Set Plane) (a : Plane) : Prop := +@[expose] def PolyAccessible (Ω : Set Plane) (a : Plane) : Prop := ∃ (vs : List Plane) (h : vs ≠ []), vs.head h = a ∧ vs.getLast h ∈ Ω ∧ poly vs \ {a} ⊆ Ω /-- A point of `Ω` is accessible from it, by the constant chain. -/ 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..71c98618e7 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 @@ -154,10 +154,10 @@ noncomputable def off : Plane := A.vertex i + t • A.tang i + s • perp (A.tan noncomputable def pt : Plane := A.off i c 0 /-- Edge `i` of the arc. -/ -def edge : Set Plane := segment ℝ (A.vertex i) (A.vertex (i + 1)) +@[expose] 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 @@ -1716,7 +1716,7 @@ end PolyArc /-- **`P` is a simple polygonal arc from `a` to `b`, presented by a vertex list.** This is the arc analogue of what `Schoenflies.exists_closedPolygon` proves for a Jordan curve, and it is the one thing this module does not prove; see the note at the end of the file. -/ -def IsPolyArcCarrier (P : Set Plane) (a b : Plane) : Prop := +@[expose] def IsPolyArcCarrier (P : Set Plane) (a b : Plane) : Prop := ∃ (n : ℕ) (A : PolyArc n), A.carrier = P ∧ A.vertex 0 = a ∧ A.vertex (n + 1) = b /-- **`HasArcCollars` for a set presented as the carrier of a `PolyArc`.** The conclusion is @@ -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..22743c93ab 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 @@ -102,7 +102,7 @@ This exists so that a *part* of one overlay can be spoken about as a graph in it while remaining a subgraph of the whole overlay (`segGraph_mono`). Building the part as an overlay of its own source segments would not do: the total overlay cuts those segments at more points, so a sub-overlay is not a subgraph of it. -/ -def segGraph (S : Set Piece) : Graph Plane Piece where +@[expose] def segGraph (S : Set Piece) : Graph Plane Piece where vertexSet := {v | ∃ P ∈ S, v = P.1 ∨ v = P.2} IsLink P x y := P ∈ S ∧ ((x = P.1 ∧ y = P.2) ∨ (x = P.2 ∧ y = P.1)) edgeSet := S @@ -200,12 +200,14 @@ variable {pieces : List Piece} {points : List Plane} {c c₁ c₂ : Plane} {r : /-- The edges of an overlay whose segment lies on the boundary of the square of `ℓ^∞`-radius `r` about `c`. -/ +@[expose] def squareEdges (pieces : List Piece) (points : List Plane) (c : Plane) (r : ℝ) : Set Piece := {Q | Q ∈ overlayPieces pieces points ∧ Q.seg ⊆ frontier (Plane.closedSquare c r)} /-- **The part of one overlay lying on one square boundary.** A subgraph of that overlay by construction (`squareGraph_le`), which is the single-ambient-graph obligation of `Graph.IsPlaneChain` discharged at the bottom of the tower. -/ +@[expose] def squareGraph (pieces : List Piece) (points : List Plane) (c : Plane) (r : ℝ) : Graph Plane Piece := segGraph (squareEdges pieces points c r) @@ -370,6 +372,7 @@ points, each cut point a vertex — so it is a cycle, and `Graph.IsLongCycle.isT finishes. What a discharging module must build is the cyclic order of the cut points along the four sides; `Schoenflies/SegmentOrder.lean` is the tool. Nothing about the arc, the chain or the outer face enters the statement. -/ +@[expose] def SquaresTwoConnected : Prop := ∀ (pieces : List Piece) (points : List Plane), (∀ P ∈ pieces, P.Nondeg) → EndsAreCut pieces points → MeetsAreCut pieces points → diff --git a/LeanPool/Schoenflies/ArcComplementPrep.lean b/LeanPool/Schoenflies/ArcComplementPrep.lean index 44dcf4454e..bcffd6f428 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) : @@ -1004,7 +1004,7 @@ theorem exists_mesh {α : ℝ → Plane} (hα : ContinuousOn α I) {ε : ℝ} (h /-! ## Part 4: nonadjacent subarcs are at positive distance -/ /-- The `i`-th subarc of the even partition of an arc into `n` pieces. -/ -def subarcCell (α : ℝ → Plane) (n i : ℕ) : Set Plane := +@[expose] def subarcCell (α : ℝ → Plane) (n i : ℕ) : Set Plane := α '' Icc (sample n i) (sample n (i + 1)) theorem isCompact_subarcCell {α : ℝ → Plane} (hα : ContinuousOn α I) {n i : ℕ} 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..edccd30242 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 @@ -69,7 +69,7 @@ namespace Graph variable {β : Type*} {G : Graph Plane β} {drawing : β → ℝ → Plane} {C D : Set Plane} /-- An edge is **nonboundary** when its arc is not contained in the outer boundary. -/ -def Nonboundary (drawing : β → ℝ → Plane) (C : Set Plane) (e : β) : Prop := +@[expose] def Nonboundary (drawing : β → ℝ → Plane) (C : Set Plane) (e : β) : Prop := ¬ edgeArc drawing e ⊆ C /-- **One finite stage of the skeleton**, as `lem:skeleton-crosscuts` uses it. @@ -260,6 +260,7 @@ so `interiorPart` is that set rather than a `Graph`. -/ /-- The point set of the blueprint's interior subgraph `Λ`: the vertices lying in the region, together with the edges that run entirely inside it. -/ +@[expose] def interiorPart (G : Graph Plane β) (drawing : β → ℝ → Plane) (D : Set Plane) : Set Plane := (V(G) ∩ D) ∪ ⋃ e ∈ {e | e ∈ E(G) ∧ edgeArc drawing e ⊆ D}, edgeArc drawing e diff --git a/LeanPool/Schoenflies/BoundaryContinuity2.lean b/LeanPool/Schoenflies/BoundaryContinuity2.lean index e294d63707..63958a56c7 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 @@ -283,7 +283,7 @@ crosscut `P` of `C`, whose image under the limit map is a crosscut `P'` of the o The agreement clause is stated on `P ∖ {a, b}`, which by `IsCrosscut.inter_eq` is exactly `P ∩ Int(C)` — the part of the crosscut on which `F` is defined at all. -/ -def HasAnchorCrosscuts (C 𝒜 : Set Plane) (u F : Plane → Plane) : Prop := +@[expose] def HasAnchorCrosscuts (C 𝒜 : Set Plane) (u F : Plane → Plane) : Prop := ∀ ⦃a b : Plane⦄, a ∈ 𝒜 → b ∈ 𝒜 → a ≠ b → ∃ P P' : Set Plane, IsCrosscut C P a b ∧ IsCrosscut modelCurve P' (u a) (u b) ∧ F '' (P \ {a, b}) = P' \ {u a, u b} @@ -295,7 +295,7 @@ This is the germ of the nonboundary edge that `lem:anchor-density` attaches to ` initial subarc of that edge with the endpoint `c` removed, and `F '' J` is the corresponding initial subarc of the target edge, which ends at `u c` because the finite skeleton homeomorphism sends `c` to `u c`. Nothing else about the spokes is used anywhere. -/ -def HasSpokes (C 𝒜 : Set Plane) (u F : Plane → Plane) : Prop := +@[expose] def HasSpokes (C 𝒜 : Set Plane) (u F : Plane → Plane) : Prop := ∀ c ∈ 𝒜, ∀ ε > 0, ∃ J : Set Plane, J ⊆ inside C ∧ IsPreconnected J ∧ J ⊆ ball c ε ∧ c ∈ closure J ∧ u c ∈ closure (F '' J) @@ -690,7 +690,7 @@ interiors (`prop:interior-homeomorphism`), the anchor crosscuts with their targe `Schoenflies.squareExtension_of_hasLimitHomeomorphism` turns this into `Schoenflies.SquareExtension`, which is the input required by the final reduction. -/ -def HasLimitHomeomorphism : Prop := +@[expose] def HasLimitHomeomorphism : Prop := ∀ (C : Set Plane) (u v : Plane → Plane), IsJordanCurve C → IsHomeoOn u v C modelCurve → ∃ (𝒜 : Set Plane) (F F' : Plane → Plane), 𝒜 ⊆ C ∧ C ⊆ closure 𝒜 ∧ IsHomeoOn F F' (inside C) (Plane.openSquare 0 1) ∧ 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..044c44880a 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 @@ -107,6 +107,7 @@ namespace CellStructure variable {γ : Type*} {S : CellStructure γ} /-- The subcells of a cell: the index set of its closed cell in assertion (i). -/ +@[expose] def subcells (S : CellStructure γ) (τ : γ) : Set γ := {σ | σ ∈ S.cells ∧ S.sub σ τ} theorem mem_subcells_iff {σ τ : γ} : σ ∈ S.subcells τ ↔ σ ∈ S.cells ∧ S.sub σ τ := Iff.rfl @@ -163,7 +164,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 @@ -417,7 +419,7 @@ variable {d : S.SplitData} {R : S.Realization} {R' : (S.splitFace d).Realization /-- The cells the ear **creates**: its interior vertices and its edges. The two ends of the ear are old vertices, and the blueprint is explicit that the split does not create them. -/ -def earNewCells (d : S.SplitData) : Set γ := (V(d.ear) \ {d.source, d.target}) ∪ E(d.ear) +@[expose] def earNewCells (d : S.SplitData) : Set γ := (V(d.ear) \ {d.source, d.target}) ∪ E(d.ear) theorem newCells_eq (d : S.SplitData) : d.newCells = d.earNewCells ∪ {d.face₁, d.face₂} := rfl diff --git a/LeanPool/Schoenflies/CombinatorialInvariance.lean b/LeanPool/Schoenflies/CombinatorialInvariance.lean index c2794fe16c..f938d27c00 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) +@[expose] 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 +@[expose] 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..d2bb49aab4 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 @@ -127,13 +127,13 @@ theorem connected_of_isPreconnected_pointSet [G.Finite] exact Set.disjoint_left.1 hAB hxA (hsub (Or.inl hx)) /-- The part of a drawn graph supported on a prescribed set. -/ -def traceGraph (G : Graph Plane β) (drawing : β → ℝ → Plane) (A : Set Plane) : +@[expose] def traceGraph (G : Graph Plane β) (drawing : β → ℝ → Plane) (A : Set Plane) : Graph Plane β := (G.restrict {e | edgeArc drawing e ⊆ A}).induce (V(G) ∩ A) /-- The vertices retained by a trace graph. -/ @[simp] theorem traceGraph_vertexSet (A : Set Plane) : - V(traceGraph G drawing A) = V(G) ∩ A := rfl + V(traceGraph G drawing A) = V(G) ∩ A := by exact rfl /-- A trace edge is exactly an ambient edge whose full arc and endpoints lie in the support. -/ @[simp] theorem traceGraph_isLink (A : Set Plane) : @@ -1206,6 +1206,7 @@ variable {γ : Type*} {S₀ : CellStructure γ} {srcOuter srcDom tgtOuter tgtDom : Set Plane} /-- Subdivide a generated matched pair at corresponding source and target parameters. -/ +@[expose] noncomputable def subdivide (P : GeneratedPair S₀ srcOuter srcDom tgtOuter tgtDom) (d : P.str.SubdivData) {t : ℝ} (ht : t ∈ Set.Ioo (0 : ℝ) 1) : 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..097dbcd7ac 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 @@ -146,7 +146,7 @@ variable {f g : Plane → Plane} {S T : Set Plane} /-- A restricted homeomorphism of the whole plane onto the whole plane *is* a homeomorphism. This is the last step of `thm:main`. -/ -noncomputable def homeomorphOfUniv (h : IsHomeoOn f g univ univ) : Plane ≃ₜ Plane where +@[expose] noncomputable def homeomorphOfUniv (h : IsHomeoOn f g univ univ) : Plane ≃ₜ Plane where toFun := f invFun := g left_inv z := h.invOn.1 (mem_univ z) @@ -247,7 +247,7 @@ and every homeomorphism `u : C → S` there is a homeomorphism `C ∪ Int(C) → Written in the unbundled `Schoenflies.IsHomeoOn` style: `u` comes with its inverse `v`, and the conclusion produces the extension `F` together with its inverse `G`. `S` is `Schoenflies.modelCurve` and `Q` is `Schoenflies.Plane.closedSquare 0 1`. -/ -def SquareExtension : Prop := +@[expose] def SquareExtension : Prop := ∀ (C : Set Plane) (u v : Plane → Plane), IsJordanCurve C → IsHomeoOn u v C modelCurve → ∃ F G : Plane → Plane, IsHomeoOn F G (C ∪ inside C) (Plane.closedSquare 0 1) ∧ EqOn F u C 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..09d7405341 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 @@ -685,7 +685,7 @@ end IsFaceCycle /-- **`lem:face-cycles`, as a property of a plane graph**: every face has a cycle as its boundary and is one of the two complementary regions of that cycle. -/ -def HasFaceCycles (G : Graph Plane β) (drawing : β → ℝ → Plane) : Prop := +@[expose] def HasFaceCycles (G : Graph Plane β) (drawing : β → ℝ → Plane) : Prop := ∀ z ∈ exterior G drawing, ∃ (e : β) (u v : Plane) (D : List β), IsFaceCycle G drawing z e u v D /-! ## The base case: the faces of a single cycle @@ -790,7 +790,7 @@ blueprint's "Theorem 2.8 replaces `F` by exactly two regions, both bounded by cy This is **assumed**, not proved; see the section docstring for why `main`'s Theorem 2.8 does not apply. -/ -def CrosscutSplitsRegion : Prop := +@[expose] def CrosscutSplitsRegion : Prop := ∀ (J A₁ A₂ P Ω : Set Plane) (p q : Plane), IsSeparating J → IsPolygonal J → IsPolygonal P → IsArcBetween A₁ p q → IsArcBetween A₂ p q → A₁ ∪ A₂ = J → A₁ ∩ A₂ = {p, q} → diff --git a/LeanPool/Schoenflies/FiniteTransfer.lean b/LeanPool/Schoenflies/FiniteTransfer.lean index 9d17f877f4..8939375569 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 @@ -599,6 +599,7 @@ drawings by `EarCrosscut.isWeaklyAdmissible_realize`. -/ /-- Build the next generated pair from matching geometric realizations of one abstract face split. -/ +@[expose] noncomputable def split (P : GeneratedPair S₀ srcOuter srcDom tgtOuter tgtDom) (hS : P.str.CombInvariants) (d : P.str.SplitData) (srcPos : γ → Plane) (srcDraw : γ → ℝ → Plane) @@ -657,7 +658,7 @@ noncomputable def split (P : GeneratedPair S₀ srcOuter srcDom tgtOuter tgtDom) (htgtEdgePoly : ∀ ⦃e⦄, e ∈ E(d.ear) → IsPolygonal (edgeArc tgtDraw e)) : (P.split hS d srcPos srcDraw tgtPos tgtDraw hsrc htgt m hsrcEdgePoly htgtEdgePoly).str = - P.str.splitFace d := rfl + P.str.splitFace d := by exact rfl end GeneratedPair @@ -892,16 +893,17 @@ variable {T : GeneratedPair S₀ srcOuter srcDom tgtOuter tgtDom} {B H : Graph Plane γ} {Hdraw : γ → ℝ → Plane} {a : Plane} {D : List γ} /-- The generated pair assembled from the data of one realized ear. -/ +@[expose] noncomputable def pair (w : EarStepData T B H Hdraw a D) : GeneratedPair S₀ srcOuter srcDom tgtOuter tgtDom := T.split T.str_combInvariants w.splitData w.srcPos w.srcDraw w.tgtPos w.tgtDraw w.srcCrosscut w.tgtCrosscut w.earHomeo w.srcEdgePolygonal w.tgtEdgePolygonal @[simp] theorem pair_src (w : EarStepData T B H Hdraw a D) : - w.pair.src = w.splitData.realize T.src w.srcPos w.srcDraw w.srcCrosscut := rfl + w.pair.src = w.splitData.realize T.src w.srcPos w.srcDraw w.srcCrosscut := by exact rfl @[simp] theorem pair_tgt (w : EarStepData T B H Hdraw a D) : - w.pair.tgt = w.splitData.realize T.tgt w.tgtPos w.tgtDraw w.tgtCrosscut := rfl + w.pair.tgt = w.splitData.realize T.tgt w.tgtPos w.tgtDraw w.tgtCrosscut := by exact rfl /-- The exposed constructor data really performs one `EarStep`: the pair it builds refines the original pair along the composite parent map, occupies the enlarged source graph, and contains @@ -1063,6 +1065,7 @@ existence theorems, rather than as an unused parameter of the predicates, makes explicit. -/ /-- **Step 1, the common subdivision**, as an interface. -/ +@[expose] def CommonSubdivision (P : GeneratedPair S₀ srcOuter srcDom tgtOuter tgtDom) (H : Graph Plane γ) (Hdraw : γ → ℝ → Plane) : Prop := ∃ (K : Graph Plane γ) (T₀ : GeneratedPair S₀ srcOuter srcDom tgtOuter tgtDom) (par₀ : γ → γ), diff --git a/LeanPool/Schoenflies/FiniteTransferTarget.lean b/LeanPool/Schoenflies/FiniteTransferTarget.lean index 3a34f9df34..5d879242ed 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 @@ -188,6 +188,7 @@ variable {T : GeneratedPair S₀ srcOuter srcDom tgtOuter tgtDom} {B H : Graph Plane γ} {Hdraw : γ → ℝ → Plane} {a : Plane} {D : List γ} /-- Assemble the generated pair exposed by one reverse-ear construction. -/ +@[expose] noncomputable def pair (w : TargetEarStepData T B H Hdraw a D) : GeneratedPair S₀ srcOuter srcDom tgtOuter tgtDom := T.split T.str_combInvariants w.splitData w.srcPos w.srcDraw w.tgtPos w.tgtDraw @@ -195,11 +196,11 @@ noncomputable def pair (w : TargetEarStepData T B H Hdraw a D) : @[simp] theorem pair_src (w : TargetEarStepData T B H Hdraw a D) : w.pair.src = - w.splitData.realize T.src w.srcPos w.srcDraw w.srcCrosscut := rfl + w.splitData.realize T.src w.srcPos w.srcDraw w.srcCrosscut := by exact rfl @[simp] theorem pair_tgt (w : TargetEarStepData T B H Hdraw a D) : w.pair.tgt = - w.splitData.realize T.tgt w.tgtPos w.tgtDraw w.tgtCrosscut := rfl + w.splitData.realize T.tgt w.tgtPos w.tgtDraw w.tgtCrosscut := by exact rfl /-- The assembled pair realizes the enlarged target subgraph and refines the original pair. -/ theorem isTargetPartialTransferOf_pair @@ -368,7 +369,7 @@ theorem target_ear_edge_polygonal /-- Every boundary endpoint of a nonouter ambient target edge comes from a strongly accessible source anchor. The stage construction will discharge this from the fresh-point list of its anchored square mesh. -/ -def TargetBoundaryAnchored {β : Type*} +@[expose] def TargetBoundaryAnchored {β : Type*} (P : GeneratedPair S₀ srcOuter srcDom tgtOuter tgtDom) (H : Graph Plane β) (Hdraw : β → ℝ → Plane) : Prop := ∀ {f : β} {y : Plane}, f ∈ E(H) → H.Inc f y → y ∈ tgtOuter → @@ -378,7 +379,7 @@ def TargetBoundaryAnchored {β : Type*} /-- The relative anchoring condition used by reverse ear insertion. Only genuinely new ambient edges need to end at prescribed strongly accessible anchors; edges already covering the original target skeleton are irrelevant to the next ear. -/ -def NewTargetBoundaryAnchored {β : Type*} +@[expose] def NewTargetBoundaryAnchored {β : Type*} (P : GeneratedPair S₀ srcOuter srcDom tgtOuter tgtDom) (base : Set Plane) (H : Graph Plane β) (Hdraw : β → ℝ → Plane) : Prop := ∀ {B : Graph Plane β}, B ≤ H → base ⊆ pointSet B Hdraw → @@ -398,7 +399,7 @@ theorem TargetBoundaryAnchored.new /-- At a point of the distinguished boundary, there is at most one incident ambient edge not contained in that boundary. The ambient edge-name type is deliberately independent of the cell-name type. -/ -def NonouterIncidenceUniqueAtBoundary {β : Type*} +@[expose] def NonouterIncidenceUniqueAtBoundary {β : Type*} (H : Graph Plane β) (Hdraw : β → ℝ → Plane) (outer : Set Plane) : Prop := ∀ {z : Plane} {e f : β}, z ∈ outer → e ∈ E(H) → f ∈ E(H) → H.Inc e z → H.Inc f z → @@ -408,7 +409,7 @@ def NonouterIncidenceUniqueAtBoundary {β : Type*} nonouter ambient edge cannot meet, at the distinguished boundary, a nonouter edge already in the current trace. Unlike `NonouterIncidenceUniqueAtBoundary`, this permits several old nonouter edges at an old boundary vertex, which is essential for target-mesh overlays. -/ -def NoNewNonouterIncidenceAtBoundary {β : Type*} +@[expose] def NoNewNonouterIncidenceAtBoundary {β : Type*} (base : Set Plane) (H : Graph Plane β) (Hdraw : β → ℝ → Plane) (outer : Set Plane) : Prop := ∀ {B : Graph Plane β}, B ≤ H → base ⊆ pointSet B Hdraw → @@ -813,12 +814,12 @@ def CellStructure.OuterIncidenceAtMostTwo (S : CellStructure γ) (v : γ) : Prop S.outerGraph.Inc g v → e = f ∨ e = g ∨ f = g /-- The distinguished outer graph is locally at most two-branched at every vertex. -/ -def CellStructure.OuterIncidenceAtMostTwoEverywhere (S : CellStructure γ) : Prop := +@[expose] def CellStructure.OuterIncidenceAtMostTwoEverywhere (S : CellStructure γ) : Prop := ∀ v, S.OuterIncidenceAtMostTwo v /-- The edge set of the distinguished outer graph is exactly one simple cycle. Isolated vertices are intentionally irrelevant: reverse transfer only reads edge incidence. -/ -def CellStructure.OuterEdgesFormCycle (S : CellStructure γ) : Prop := +@[expose] def CellStructure.OuterEdgesFormCycle (S : CellStructure γ) : Prop := ∃ e u v D, S.outerGraph.IsCycleThrough e u v D ∧ E(S.outerGraph) = {f | f ∈ e :: D} @@ -1213,13 +1214,13 @@ theorem GeneratedPair.unique_source_face_of_outerOnly /-- Source vertices incident with a nonboundary edge. Outer-only vertices are deliberately excluded: a fresh anchor must not enter the compact set merely because it is already a vertex of the outer cycle. -/ -def GeneratedPair.sourceNonboundaryVertices +@[expose] def GeneratedPair.sourceNonboundaryVertices (T : GeneratedPair S₀ srcOuter srcDom tgtOuter tgtDom) : Set Plane := {x | ∃ e, e ∈ E(T.src.graph) ∧ e ∉ E(T.str.outerGraph) ∧ T.src.graph.Inc e x} /-- The current source graph with outer edges and outer-only vertices removed. Its point set is the compact union of the closed nonboundary edges used in the fresh-anchor argument. -/ -def GeneratedPair.sourceNonboundaryGraph +@[expose] def GeneratedPair.sourceNonboundaryGraph (T : GeneratedPair S₀ srcOuter srcDom tgtOuter tgtDom) : Graph Plane γ := (T.src.graph.deleteEdges E(T.str.outerGraph)).induce T.sourceNonboundaryVertices @@ -1433,7 +1434,7 @@ def GeneratedPair.SourceEndpointReady /-- The two genuinely evolving obligations at a wild-boundary endpoint: no nonboundary edge has reached it yet, and the next ear's face is its unique incident current source face. -/ -def GeneratedPair.SourceEndpointFreshCombinatorics +@[expose] def GeneratedPair.SourceEndpointFreshCombinatorics (T : GeneratedPair S₀ srcOuter srcDom tgtOuter tgtDom) (F : γ) (x : Plane) : Prop := x ∈ srcOuter → x ∉ pointSet T.sourceNonboundaryGraph T.src.drawing ∧ @@ -1442,7 +1443,7 @@ def GeneratedPair.SourceEndpointFreshCombinatorics /-- The remaining prescribed-ear combinatorics after boundary anchoring has supplied strong accessibility: both outer endpoints are fresh and incident with the selected face alone. -/ -def TargetEarFreshCombinatorics +@[expose] def TargetEarFreshCombinatorics (P : GeneratedPair S₀ srcOuter srcDom tgtOuter tgtDom) (H : Graph Plane γ) (Hdraw : γ → ℝ → Plane) : Prop := ∀ (B : Graph Plane γ) (a b : Plane) (D : List γ), B.IsTwoConnected → B ≤ H → 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..3d6e227d06 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 @@ -194,7 +194,7 @@ theorem exists_accessCone_disjoint (h : StronglyAccessible D a) (hK : IsCompact /-- Absorption by cells for connected sets already known to lie in an ambient domain. This is the precise form needed for a tangent cone inside a Jordan domain when `K` contains only the closed nonboundary edges and not the wild boundary itself. -/ -def CellsAbsorbIn (D K : Set Plane) (cells : Set (Set Plane)) : Prop := +@[expose] def CellsAbsorbIn (D K : Set Plane) (cells : Set (Set Plane)) : Prop := ∀ N : Set Plane, N ⊆ D → IsPreconnected N → Disjoint N K → ∀ R ∈ cells, (N ∩ R).Nonempty → N ⊆ R diff --git a/LeanPool/Schoenflies/FreshDenseSelection.lean b/LeanPool/Schoenflies/FreshDenseSelection.lean index ab14d884cd..cdbdf9bb08 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 @@ -183,7 +183,7 @@ theorem exists_finite_freshDense_of_dense {eligible : Set Plane} /-- A finite boundary list is a metric net at scale `delta`. This explicit consequence is retained for the boundary-continuity construction; `FreshDense` itself is the order-free connected-component estimate needed by the target mesh. -/ -def FreshNet (fresh : List Plane) (delta : ℝ) : Prop := +@[expose] def FreshNet (fresh : List Plane) (delta : ℝ) : Prop := ∀ x ∈ modelCurve, ∃ z ∈ fresh, dist x z < delta theorem FreshDense.mono {fresh fresh' : List Plane} {delta : ℝ} 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..68a23078cf 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} @@ -331,7 +331,7 @@ abbrev SubstWalk : γ → List γ → List γ → Prop := CellStructure.SubstWalk S d.edge d.left d.right d.newEdge₁ d.newEdge₂ /-- The three cells the subdivision creates. -/ -def newCells : Set γ := {d.newVertex, d.newEdge₁, d.newEdge₂} +@[expose] def newCells : Set γ := {d.newVertex, d.newEdge₁, d.newEdge₂} variable {d} @@ -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 @@ -418,6 +418,7 @@ update list, in order: the old pairs that involve neither `e` nor a new cell; th pairs of the new cells (see the fidelity note in the module docstring); `v ≼ e₁, e₂`; each old endpoint below its adjacent new edge; and the new cells below exactly the old *strict* supercells of `e`. -/ +@[expose] def subRel : γ → γ → Prop := fun σ τ => (σ ∉ d.newCells ∧ τ ∉ d.newCells ∧ σ ≠ d.edge ∧ τ ≠ d.edge ∧ S.sub σ τ) ∨ (σ = τ ∧ σ ∈ d.newCells) ∨ @@ -435,6 +436,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,18 +621,19 @@ 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 explicit that they are their own parents. -/ +@[expose] 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 +685,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 @@ -703,6 +706,7 @@ list, in order: the old pairs involving neither `R` nor a new cell; the reflexiv new cells (see the fidelity note in the module docstring); the incidences along the ear; and the cells of `P` and of `Bᵢ`, together with `Rᵢ` itself, below `Rᵢ`. No 2-cell is below another. -/ +@[expose] def subRel : γ → γ → Prop := fun σ τ => (σ ∉ d.newCells ∧ τ ∉ d.newCells ∧ σ ≠ d.face ∧ τ ≠ d.face ∧ S.sub σ τ) ∨ (σ = τ ∧ σ ∈ d.newCells) ∨ @@ -719,6 +723,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..4eb385aaa9 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 @@ -97,7 +97,7 @@ which is why every closure property below is one line of the reachability API. No `v ∈ V(G)` clause: `Graph.Reaches` already carries it, since the empty walk demands a vertex of the graph. For `u ∉ V(G)` the component is empty. -/ -def component (G : Graph α β) (u : α) : Set α := {v | G.Reaches u v} +@[expose] def component (G : Graph α β) (u : α) : Set α := {v | G.Reaches u v} theorem mem_component_iff : v ∈ G.component u ↔ G.Reaches u v := Iff.rfl 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..d343bd5b64 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 @@ -88,7 +88,7 @@ namespace ClosedPolygon variable {m : ℕ} /-- **The same closed polygon, traversed the other way.** -/ -def reverse (P : ClosedPolygon m) : ClosedPolygon m where +@[expose] def reverse (P : ClosedPolygon m) : ClosedPolygon m where vertex j := P.vertex (-j) vertex_inj _ _ h := neg_injective (P.vertex_inj h) edges_meet i j hij := by diff --git a/LeanPool/Schoenflies/Graph/K33Land.lean b/LeanPool/Schoenflies/Graph/K33Land.lean index f5a3ce7f80..330aee2bd7 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 @@ -306,7 +306,7 @@ Needed only to pin the *direction* in which a realization traverses a prescribed same construction with the `corner` field dropped. -/ /-- **The same closed polygon, traversed the other way.** -/ -def reverse {m : ℕ} (P : PrePolygon m) : PrePolygon m where +@[expose] def reverse {m : ℕ} (P : PrePolygon m) : PrePolygon m where vertex j := P.vertex (-j) vertex_inj _ _ h := neg_injective (P.vertex_inj h) edges_meet i j hij := by diff --git a/LeanPool/Schoenflies/Graph/K33Planar.lean b/LeanPool/Schoenflies/Graph/K33Planar.lean index 04bff6feee..d24e7ec106 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 @@ -235,7 +235,8 @@ those segments. This is the one thing this module assumes and does not prove. See "The gap" in the module docstring. -/ -def IsHexRealization (drawing : β → ℝ → Plane) (e : Fin 3 → Fin 3 → β) (s : Fin 3) : Prop := +@[expose] def IsHexRealization (drawing : β → ℝ → Plane) (e : Fin 3 → Fin 3 → β) + (s : Fin 3) : Prop := ∃ (m m₁ m₂ : ℕ) (C : ClosedPolygon m) (J₁ : ClosedPolygon m₁) (J₂ : ClosedPolygon m₂) (K : List Piece) (a : ZMod (m + 3)) (k : ℕ), k ≤ m + 3 ∧ @@ -364,7 +365,7 @@ structure IsArcK33 (x y : Fin 3 → Plane) (P : Fin 3 → Fin 3 → Set Plane) : /-- **The abstract `K(3,3)` on six named points of the plane.** Its edges are index pairs, and `(i, j)` links `x i` to `y j`. The edge set is all of `Fin 3 × Fin 3`, so no membership side condition ever has to be discharged. -/ -def k33Graph (x y : Fin 3 → Plane) : Graph Plane (Fin 3 × Fin 3) where +@[expose] def k33Graph (x y : Fin 3 → Plane) : Graph Plane (Fin 3 × Fin 3) where vertexSet := Set.range x ∪ Set.range y edgeSet := Set.univ IsLink p u v := (u = x p.1 ∧ v = y p.2) ∨ (u = y p.2 ∧ v = x p.1) 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..6f54c89600 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 @@ -422,7 +422,7 @@ graph is a `def` and every clause is a theorem about it. -/ become vertices whatever else happens. Enlarging the list produced by `exists_cut_points` is harmless (`EndsAreCut.mono`, `MeetsAreCut.mono`) and is what makes the two common vertices of `lem:union-two-connected` available. -/ -noncomputable def attachPoints (pieces : List Piece) (extra : List Plane) : List Plane := +@[expose] noncomputable def attachPoints (pieces : List Piece) (extra : List Plane) : List Plane := extra ++ (exists_cut_points pieces).choose theorem mem_attachPoints_of_mem {pieces : List Piece} {extra : List Plane} {x : Plane} @@ -439,6 +439,7 @@ theorem attachPoints_meetsAreCut (pieces : List Piece) (extra : List Plane) : /-- **The overlay of `lem:polygonal-overlay`, with the convention of `rem:polygonal-overlay-convention`**: every intersection of the listed segments is a vertex, and so is every prescribed extra point. -/ +@[expose] noncomputable def attachGraph (pieces : List Piece) (extra : List Plane) : Graph Plane Piece := overlayGraph pieces (attachPoints pieces extra) diff --git a/LeanPool/Schoenflies/InitialGenerated.lean b/LeanPool/Schoenflies/InitialGenerated.lean index d6f6746bb4..c3bafbdf56 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 @@ -419,14 +419,14 @@ theorem biUnion_faceCells (H : HexData) (k : Bool) : refine H.biUnion_of_three_edges _ (i := 1) (j := 2) (l := 3) (by decide) (by decide) (fun c hc => ?_) ?_ ?_ ?_ ?_ ?_ ?_ ?_ ?_ ?_ ?_ · simp only [faceCells, Set.mem_insert_iff, Set.mem_singleton_iff] at hc - rcases hc with rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl <;> decide - all_goals (simp only [faceCells, Set.mem_insert_iff, Set.mem_singleton_iff]; decide) + rcases hc with rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl <;> simp + all_goals (simp only [faceCells, Set.mem_insert_iff, Set.mem_singleton_iff]; simp) · rw [HexData.arcOf_true] refine H.biUnion_of_three_edges _ (i := 4) (j := 5) (l := 0) (by decide) (by decide) (fun c hc => ?_) ?_ ?_ ?_ ?_ ?_ ?_ ?_ ?_ ?_ ?_ · simp only [faceCells, Set.mem_insert_iff, Set.mem_singleton_iff] at hc - rcases hc with rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl <;> decide - all_goals (simp only [faceCells, Set.mem_insert_iff, Set.mem_singleton_iff]; decide) + rcases hc with rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl <;> simp + all_goals (simp only [faceCells, Set.mem_insert_iff, Set.mem_singleton_iff]; simp) /-! ### Assertion (i) and `def:admissible-graph`, for either realization @@ -786,6 +786,7 @@ realizations of `prop:initial-pair`, and the two cell decompositions are This is the base case of the whole construction: `thm:finite-transfer` consumes a `GeneratedPair` and produces one, and this is the first. -/ +@[expose] noncomputable def generatedPair : GeneratedPair initialStructure C (C ∪ inside C) modelCurve (Plane.closedSquare 0 1) where str := initialStructure @@ -848,7 +849,7 @@ end InitialData crosscut into `a` or `b` (`AnchoredInitialData.stronglyAccessible_a`). So the pair is built from the underlying `InitialData`, and this is the specialisation for a consumer holding the anchored form. -/ -noncomputable def AnchoredInitialData.generatedPair {C : Set Plane} {A : AnchorSet C} +@[expose] noncomputable def AnchoredInitialData.generatedPair {C : Set Plane} {A : AnchorSet C} (D : AnchoredInitialData C A) : GeneratedPair initialStructure C (C ∪ inside C) modelCurve (Plane.closedSquare 0 1) := D.toInitialData.generatedPair 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..6aca93179c 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,22 +229,22 @@ 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) /-- The six 0-cells. -/ -def vertices : Set InitialCell := Set.range InitialCell.vert +@[expose] 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 +@[expose] def faces : Set InitialCell := Set.range InitialCell.face theorem outerEdges_subset_edges : outerEdges ⊆ edges := Set.subset_union_left @@ -283,7 +283,7 @@ theorem disjoint_faces_edges : Disjoint faces edges := by end InitialCell /-- The abstract 1-skeleton of the initial structure: a hexagon with one long chord. -/ -def initSkel : Graph InitialCell InitialCell where +@[expose] def initSkel : Graph InitialCell InitialCell where vertexSet := InitialCell.vertices edgeSet := InitialCell.edges IsLink e x y := e ∈ InitialCell.edges ∧ @@ -297,7 +297,7 @@ def initSkel : Graph InitialCell InitialCell where hxy.1 ▸ (InitialCell.ends_mem_vertices he).2] /-- The distinguished outer cycle: the same hexagon without the chord. -/ -def initOuter : Graph InitialCell InitialCell where +@[expose] def initOuter : Graph InitialCell InitialCell where vertexSet := InitialCell.vertices edgeSet := InitialCell.outerEdges IsLink e x y := e ∈ InitialCell.outerEdges ∧ @@ -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] | _ => [] @@ -344,7 +344,7 @@ def initBoundary : InitialCell → List InitialCell /-- The names that `initialStructure` declares to be cells: the six 0-cells, the seven 1-cells and the two 2-cells. This is `initialStructure.cells` unfolded, written out here because `initSub` is a field of `initialStructure` and cannot refer to it. -/ -def cellNames : Set InitialCell := +@[expose] def cellNames : Set InitialCell := InitialCell.vertices ∪ InitialCell.edges ∪ InitialCell.faces theorem aux_notMem_cellNames (n : ℕ) : InitialCell.aux n ∉ cellNames := by @@ -362,7 +362,7 @@ The reflexive clause is restricted to `cellNames`. `≼_abs` must relate cells t `CellStructure.CombInvariants.sub_mem_left` and `.sub_mem_right` say so — and `InitialCell` carries a spare supply of names beyond the fifteen cells, so unrestricted reflexivity would relate a spare name to itself and make both false. -/ -def initSub (c d : InitialCell) : Prop := +@[expose] def initSub (c d : InitialCell) : Prop := (c = d ∧ d ∈ cellNames) ∨ (d ∈ InitialCell.edges ∧ (c = d.ends.1 ∨ c = d.ends.2)) ∨ (∃ k, d = .face k ∧ c ∈ faceCells k) @@ -376,7 +376,7 @@ theorem initSub_face {k : Bool} {c : InitialCell} (h : c ∈ faceCells k) : initSub c (.face k) := Or.inr (Or.inr ⟨k, rfl, h⟩) /-- **The abstract record of the initial matched cellulation.** -/ -def initialStructure : CellStructure InitialCell where +@[expose] def initialStructure : CellStructure InitialCell where skel := initSkel faces := InitialCell.faces outerGraph := initOuter @@ -474,27 +474,27 @@ namespace HexData variable (H : HexData) /-- Where each 0-cell sits. Junk on the other cells, which `Realization` never reads. -/ -def point : InitialCell → Plane +@[expose] def point : InitialCell → Plane | .vert i => H.pos i | _ => 0 /-- How each 1-cell is drawn. Junk on the other cells. -/ -def draw : InitialCell → ℝ → Plane +@[expose] def draw : InitialCell → ℝ → Plane | .edge i => H.outer i | .chord => H.chordParam | _ => fun _ => 0 /-- The crosscut, as a set. -/ -def chordSet : Set Plane := H.chordParam '' I +@[expose] def chordSet : Set Plane := H.chordParam '' I /-- The two boundary edge-paths from `pos 1` to `pos 4`, as sets: `arcOf false` is `A₁`, the union of the outer edges `1, 2, 3`, and `arcOf true` is `A₂`, the union of `4, 5, 0`. -/ -def arcOf : Bool → Set Plane +@[expose] def arcOf : Bool → Set Plane | false => H.outer 1 '' I ∪ (H.outer 2 '' I ∪ H.outer 3 '' I) | true => H.outer 4 '' I ∪ (H.outer 5 '' I ∪ H.outer 0 '' I) /-- The realized outer cycle, as the union of the six outer edges. -/ -def outerArcs : Set Plane := ⋃ i : Fin 6, H.outer i '' I +@[expose] def outerArcs : Set Plane := ⋃ i : Fin 6, H.outer i '' I /-- The point set of each open cell. @@ -503,7 +503,7 @@ blueprint prescribes (tex 1590–1602): "the 2-cell `Rᵢ` is realized in the so side whose closure meets `C` in `Aᵢ`". By `thm:general-crosscut` that side is `Int(Aᵢ ∪ P)` = `inside (arcOf k ∪ chordSet)`, and taking this as the *definition* makes the crosscut theorem apply to it with nothing to transport. -/ -def cellSet : InitialCell → Set Plane +@[expose] def cellSet : InitialCell → Set Plane | .vert i => {H.pos i} | .edge i => H.outer i '' I \ {H.pos i, H.pos (i + 1)} | .chord => H.chordParam '' I \ {H.pos 1, H.pos 4} @@ -618,7 +618,7 @@ theorem isDrawing : Graph.IsDrawing (initSkel.map H.point) H.draw where key _ (j + 1) (InitialCell.edge_mem_edges j) (Or.inr rfl)] /-- **The realization of `initialStructure` determined by a `HexData`.** -/ -def realization : initialStructure.Realization where +@[expose] def realization : initialStructure.Realization where pos := H.point drawing := H.draw injOn_pos := H.injOn_point @@ -971,16 +971,16 @@ variable {α β : ℝ} /-- The six marked points of `S`, in cyclic order: the corner `(1,1)`, `u(a) = (α,1)`, the corners `(-1,1)` and `(-1,-1)`, `u(b) = (β,-1)`, and the corner `(1,-1)`. -/ -def tgtPos (α β : ℝ) : Fin 6 → Plane := +@[expose] def tgtPos (α β : ℝ) : Fin 6 → Plane := ![Plane.mk 1 1, Plane.mk α 1, Plane.mk (-1) 1, Plane.mk (-1) (-1), Plane.mk β (-1), Plane.mk 1 (-1)] /-- The six outer edges of the target, straight. -/ -noncomputable def tgtOuter (α β : ℝ) (i : Fin 6) : ℝ → Plane := +@[expose] noncomputable def tgtOuter (α β : ℝ) (i : Fin 6) : ℝ → Plane := AffineMap.lineMap (tgtPos α β i) (tgtPos α β (i + 1)) /-- The straight chord `[u(a), u(b)]`. -/ -noncomputable def tgtChord (α β : ℝ) : ℝ → Plane := +@[expose] noncomputable def tgtChord (α β : ℝ) : ℝ → Plane := AffineMap.lineMap (tgtPos α β 1) (tgtPos α β 4) theorem tgtOuter_image (α β : ℝ) (i : Fin 6) : @@ -1141,7 +1141,7 @@ theorem tgtPos_succ_ne (hα : |α| < 1) (hβ : |β| < 1) (i : Fin 6) : /-- **The target realization of `prop:initial-pair`**: the square `S`, subdivided at its four corners and at `u(a) = (α,1)`, `u(b) = (β,-1)`, together with the straight chord between the last two. -/ -noncomputable def targetHex (hα : |α| < 1) (hβ : |β| < 1) : HexData where +@[expose] noncomputable def targetHex (hα : |α| < 1) (hβ : |β| < 1) : HexData where pos := tgtPos α β outer := tgtOuter α β chordParam := tgtChord α β @@ -1189,7 +1189,7 @@ variable {C : Set Plane} /-- **The source realization of `prop:initial-pair`**: `C`, subdivided at the `u`-preimages of the four corners and of `u(a), u(b)`, together with the polygonal crosscut `P` from `a` to `b`. -/ -noncomputable def sourceHex {u w : Plane → Plane} {sp : ℝ → Plane} +@[expose] noncomputable def sourceHex {u w : Plane → Plane} {sp : ℝ → Plane} (hw : IsSetHomeoOn u w C modelCurve) (hα : |α| < 1) (hβ : |β| < 1) (hspc : ContinuousOn sp I) (hspi : InjOn sp I) (hsp0 : sp 0 = w (tgtPos α β 1)) (hsp1 : sp 1 = w (tgtPos α β 4)) @@ -1330,27 +1330,27 @@ namespace InitialData variable {C : Set Plane} (d : InitialData C) /-- The first chosen boundary point, `a = u⁻¹(xa, 1)`. -/ -def a : Plane := d.w (tgtPos d.xa d.xb 1) +@[expose] def a : Plane := d.w (tgtPos d.xa d.xb 1) /-- The second chosen boundary point, `b = u⁻¹(xb, -1)`. -/ -def b : Plane := d.w (tgtPos d.xa d.xb 4) +@[expose] def b : Plane := d.w (tgtPos d.xa d.xb 4) /-- The polygonal crosscut `P`, as a set. -/ -def crossSet : Set Plane := d.cross '' I +@[expose] def crossSet : Set Plane := d.cross '' I /-- **The source realization data.** -/ -noncomputable def src : HexData := +@[expose] noncomputable def src : HexData := sourceHex d.homeo d.abs_xa d.abs_xb d.continuousOn_cross d.injOn_cross d.cross_zero d.cross_one d.cross_inside /-- **The target realization data.** -/ -noncomputable def tgt : HexData := targetHex d.abs_xa d.abs_xb +@[expose] noncomputable def tgt : HexData := targetHex d.abs_xa d.abs_xb /-- **The source realization of `initialStructure`** — `Γ` of `prop:initial-pair`. -/ -noncomputable def sourceRealization : initialStructure.Realization := d.src.realization +@[expose] noncomputable def sourceRealization : initialStructure.Realization := d.src.realization /-- **The target realization of `initialStructure`** — `Γ'` of `prop:initial-pair`. -/ -noncomputable def targetRealization : initialStructure.Realization := d.tgt.realization +@[expose] noncomputable def targetRealization : initialStructure.Realization := d.tgt.realization @[simp] theorem src_pos_one : d.src.pos 1 = d.a := rfl @@ -1544,7 +1544,7 @@ theorem rightInvOn_skel : (clause 2), and on the crosscut it is the chosen homeomorphism `P → [u(a), u(b)]` matching endpoints (clause 3); clause 1 is definitional here, both realizations being realizations of the one `initialStructure`. -/ -noncomputable def skeletonHomeo : +@[expose] noncomputable def skeletonHomeo : CellStructure.SkeletonHomeo d.sourceRealization d.targetRealization where toFun := d.skelMap invFun := d.skelInv @@ -1743,10 +1743,10 @@ nonempty, so the countable dense set of strongly accessible points of then supply the polygonal crosscut. -/ /-- The relative interior of the top side of the square. -/ -def openTop : Set Plane := {p : Plane | |p 0| < 1 ∧ 0 < p 1} ∩ modelCurve +@[expose] def openTop : Set Plane := {p : Plane | |p 0| < 1 ∧ 0 < p 1} ∩ modelCurve /-- The relative interior of the bottom side — the side *opposite* the top one. -/ -def openBottom : Set Plane := {p : Plane | |p 0| < 1 ∧ p 1 < 0} ∩ modelCurve +@[expose] def openBottom : Set Plane := {p : Plane | |p 0| < 1 ∧ p 1 < 0} ∩ modelCurve theorem isOpen_topBand : IsOpen {p : Plane | |p 0| < 1 ∧ 0 < p 1} := by have h1 : IsOpen {p : Plane | |p 0| < 1} := 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..05aac74cef 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 @@ -50,7 +50,7 @@ theorem prescribedAnchoredInitialData_u (hC : IsJordanCurve C) hu.toIsSetHomeoOn).choose_spec.1 /-- The quantitative sequence starting with a prescribed boundary homeomorphism. -/ -noncomputable def prescribedJordanStageSequence (hC : IsJordanCurve C) +@[expose] noncomputable def prescribedJordanStageSequence (hC : IsJordanCurve C) (u v : Plane → Plane) (hu : IsHomeoOn u v C modelCurve) : StageSequence InitialCell initialStructure C := denseQuantitativeStageSequence diff --git a/LeanPool/Schoenflies/Inversion.lean b/LeanPool/Schoenflies/Inversion.lean index 476a5ec9e0..b3b53786ff 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 @@ -168,14 +168,14 @@ theorem isOpen_invert_image {S : Set Plane} (hS : IsOpen S) (ha : a ∉ S) : exact ha (by simpa using hz) /-- "`I_a` is an involutive homeomorphism of `ℝ² ∖ {a}`", bundled. Its inverse is itself. -/ -@[simps! -isSimp apply] +@[expose, simps! -isSimp apply] noncomputable def invertHomeo (a : Plane) : ({a}ᶜ : Set Plane) ≃ₜ ({a}ᶜ : Set Plane) where toFun z := ⟨invert a z, fun h => z.2 (mem_singleton_iff.2 (invert_eq_center_iff.1 (mem_singleton_iff.1 h)))⟩ invFun z := ⟨invert a z, fun h => z.2 (mem_singleton_iff.2 (invert_eq_center_iff.1 (mem_singleton_iff.1 h)))⟩ - left_inv z := Subtype.ext (invert_invert a z) - right_inv z := Subtype.ext (invert_invert a z) + left_inv z := by exact Subtype.ext (invert_invert a z) + right_inv z := by exact Subtype.ext (invert_invert a z) continuous_toFun := ((continuousOn_invert a).domRestrict).subtype_mk _ continuous_invFun := ((continuousOn_invert a).domRestrict).subtype_mk _ @@ -558,7 +558,7 @@ point to another. This is *not* a restatement of `prop:exterior-extension`: it is about the two **interiors**, which is the bounded theorem, and it is what the blueprint proves from `thm:closed-interior-extension` and `lem:square-point-mover`. -/ -def PointedInteriorExtension : Prop := +@[expose] def PointedInteriorExtension : Prop := ∀ (C C' : Set Plane) (f g : Plane → Plane) (a b : Plane), IsJordanCurve C → IsJordanCurve C' → IsHomeoOn f g C C' → a ∈ inside C → b ∈ inside C' → ∃ F G : Plane → Plane, 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..fbfb5d9a01 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 @@ -380,17 +380,17 @@ namespace LimitTower variable [Nonempty γ] (L : LimitTower γ) {x y z : Plane} {m n : ℕ} {σ : γ} /-- The open source region `D = Int(C)`. -/ -def region : Set Plane := L.dom \ L.bdry +@[expose] def region : Set Plane := L.dom \ L.bdry /-- The open target region `Q°`. -/ -def region' : Set Plane := L.dom' \ L.bdry' +@[expose] def region' : Set Plane := L.dom' \ L.bdry' /-- `St_{Γ'_n}(σ'_n(x))`, written `T_n(x)` in the blueprint: the closed target star of the cell corresponding to the source carrier of `x`. -/ -def tgtStar (n : ℕ) (x : Plane) : Set Plane := (L.tgt n).star ((L.src n).carrier x) +@[expose] def tgtStar (n : ℕ) (x : Plane) : Set Plane := (L.tgt n).star ((L.src n).carrier x) /-- `St_{Γ_n}(x)`, the closed source star of the source carrier of `x`. -/ -def srcStar (n : ℕ) (x : Plane) : Set Plane := (L.src n).star ((L.src n).carrier x) +@[expose] def srcStar (n : ℕ) (x : Plane) : Set Plane := (L.src n).star ((L.src n).carrier x) variable {L} 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..2629d7d630 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 @@ -415,12 +415,12 @@ noncomputable def localGridY (p : Plane) (s : ℝ) (k : ℕ) : ℕ → ℝ := uniformCoord (p 1 - s) (2 * s / k) /-- The edges of the local grid, as a list of segments. -/ -noncomputable def localGridEdges (p : Plane) (s : ℝ) (k : ℕ) : List Piece := +@[expose] noncomputable def localGridEdges (p : Plane) (s : ℝ) (k : ℕ) : List Piece := gridEdges (localGridX p s k) (localGridY p s k) k k /-- **The local grid** of `prop:local-grid-attachment`: the uniform `k × k` rectangular grid on the closed square `W` of centre `p` and radius `s`. -/ -noncomputable def localGrid (p : Plane) (s : ℝ) (k : ℕ) : Graph Plane Piece := +@[expose] noncomputable def localGrid (p : Plane) (s : ℝ) (k : ℕ) : Graph Plane Piece := gridGraph (localGridX p s k) (localGridY p s k) k k theorem localGrid_eq (p : Plane) (s : ℝ) (k : ℕ) : 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..77de136b20 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 @@ -248,7 +248,7 @@ theorem mapsTo_invFun : /-- Reverse a chosen matching of two realized ears. Direction (b) of finite transfer first constructs the ear on the target side, so it naturally obtains the matching in the opposite direction from the one consumed by `GeneratedPair.split`. -/ -def symm : d.EarHomeo earPos₂ earDraw₂ earPos₁ earDraw₁ where +@[expose] def symm : d.EarHomeo earPos₂ earDraw₂ earPos₁ earDraw₁ where toFun := m.invFun invFun := m.toFun continuousOn_toFun := m.continuousOn_invFun @@ -416,7 +416,7 @@ realizations — `def:matched-pair` clause 3 for the structure `S.splitFace d`. It is an *extension* of `g`, not a new map: `splitHomeo_eqOn` says it agrees with `g` on the whole old realized skeleton, which is precisely the field `StageSequence.skelHomeo_succ`. -/ -noncomputable def splitHomeo (g : SkeletonHomeo R₁ R₂) +@[expose] noncomputable def splitHomeo (g : SkeletonHomeo R₁ R₂) (hE₁ : d.EarCrosscut R₁ earPos₁ earDraw₁) (hE₂ : d.EarCrosscut R₂ earPos₂ earDraw₂) (m : d.EarHomeo earPos₁ earDraw₁ earPos₂ earDraw₂) : SkeletonHomeo (d.realize R₁ earPos₁ earDraw₁ hE₁) (d.realize R₂ earPos₂ earDraw₂ hE₂) where 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..0398fea6ca 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 @@ -119,7 +119,7 @@ variable {α β : Type*} {Γ : ℕ → Graph α β} {G K : Graph α β} {i m p : Indexed by the **length** `m` of the block rather than by its right endpoint: the blueprint minimises `j - i`, and with this indexing that is a strong induction on the second argument with no subtraction anywhere. -/ -def chainUnion (Γ : ℕ → Graph α β) (i : ℕ) : ℕ → Graph α β +@[expose] def chainUnion (Γ : ℕ → Graph α β) (i : ℕ) : ℕ → Graph α β | 0 => Γ i | m + 1 => (chainUnion Γ i m).union (Γ (i + m + 1)) @@ -594,6 +594,7 @@ It is a statement about a single descent step, not about outer faces, and it doe `n` except to keep the block inside the chain. A discharging module has `Graph.IsCycleThrough.split_at`, `Graph.exists_spliced_cycle`, `Graph.IsDrawing.arcs_of_split` and `Schoenflies.crosscutSplitsRegion` available. -/ +@[expose] def Descent (Γ : ℕ → Graph Plane β) (drawing : β → ℝ → Plane) (n : ℕ) (x : Plane) : Prop := ∀ (i m : ℕ), i + (m + 2) ≤ n → ∀ (e : β) (u v : Plane) (D : List β), @@ -624,7 +625,7 @@ member and an edge of the earlier chain outside `Γ (j-1)`, build a crosscut of The hypothesis that `x` is enclosed is carried along because it costs nothing and a discharger may want it; the construction in the blueprint does not use it. -/ -def CrosscutExists (Γ : ℕ → Graph Plane β) (drawing : β → ℝ → Plane) (n : ℕ) (x : Plane) : +@[expose] def CrosscutExists (Γ : ℕ → Graph Plane β) (drawing : β → ℝ → Plane) (n : ℕ) (x : Plane) : Prop := ∀ (i m : ℕ), i + (m + 2) ≤ n → ∀ (e : β) (u v : Plane) (D : List β), @@ -656,6 +657,7 @@ counterexample, instead of as a `sorry` nobody revisited. -/ `Γ p ∪ Γ (p+1)` — off its drawing, with an unbounded face through it. A consumer proves the second clause with `Graph.beyondSquare_subset_face`, and `Graph.unbounded_face_unique` is what makes "an unbounded face" *the* outer face. -/ +@[expose] def OuterOnPairs (Γ : ℕ → Graph Plane β) (drawing : β → ℝ → Plane) (n : ℕ) (x : Plane) : Prop := ∀ p, p + 1 ≤ n → x ∈ exterior (chainUnion Γ p 1) drawing ∧ ¬ Bornology.IsBounded (face (chainUnion Γ p 1) drawing x) 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..ef098acc26 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 @@ -60,6 +60,7 @@ theorem trans (hGH : IsPlaneSubdivisionExtension G Gdraw H Hdraw) end IsPlaneSubdivisionExtension /-- The already-subdivided edges of a finite straight overlay, listed as pieces. -/ +@[expose] noncomputable def currentOverlayPieces (pieces : List Piece) (extra : List Plane) : List Piece := (attachGraph pieces extra).edgeFinset.toList @@ -68,13 +69,13 @@ noncomputable def currentOverlayPieces (pieces : List Piece) (extra : List Plane rw [currentOverlayPieces, Finset.mem_toList, Graph.mem_edgeFinset] /-- Append further straight pieces to the current overlay edge list. -/ -noncomputable def extendedOverlayPieces +@[expose] noncomputable def extendedOverlayPieces (pieces : List Piece) (extra : List Plane) (joins : List Piece) : List Piece := currentOverlayPieces pieces extra ++ joins /-- Re-overlay the current straight graph together with the joining pieces, retaining every old vertex as a cut point. -/ -noncomputable def extendOverlay +@[expose] noncomputable def extendOverlay (pieces : List Piece) (extra : List Plane) (joins : List Piece) : Graph Plane Piece := attachGraph (extendedOverlayPieces pieces extra joins) (attachGraph pieces extra).vertexFinset.toList diff --git a/LeanPool/Schoenflies/OverlayGraph.lean b/LeanPool/Schoenflies/OverlayGraph.lean index 4eb43f7816..b627e1424e 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 @@ -171,6 +171,7 @@ theorem cover_map_orientPiece (l : List Piece) : cover (l.map orientPiece) = cov open scoped Classical in /-- The edges of the overlay: the pieces of the subdivision, oriented and then deduplicated. Orienting is what makes the deduplication a plain list operation. -/ +@[expose] noncomputable def overlayPieces (pieces : List Piece) (points : List Plane) : List Piece := ((subdivide pieces points).map orientPiece).dedup @@ -233,13 +234,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 +287,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..d6b8ca73ed 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 _ @@ -260,7 +261,7 @@ the two definitions compose with nothing but `List.sum_append`. -/ /-- `L` is a **chain from `p` to `q`**: its mod-`2` boundary is `p` together with `q`. Stated by duality, exactly as `Schoenflies.IsClosedChain` is. -/ -def IsChainFrom (L : List Piece) (p q : Plane) : Prop := +@[expose] def IsChainFrom (L : List Piece) (p q : Plane) : Prop := ∀ f : Plane → ZMod 2, (L.map fun P => f P.1 + f P.2).sum = f p + f q /-- A chain whose two ends coincide is a closed chain, and conversely. -/ @@ -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..694cf0c9fe 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 @@ -302,7 +302,7 @@ theorem skip_edges_meet (A : PreArc (n + 1)) (hi : i < n + 1) (fun he => hjk (skipIdx_injective i he)) ⟨hzj, hzk⟩ /-- **The vertex list with a redundant vertex deleted.** -/ -def deleteVertex (A : PreArc (n + 1)) (hi : i < n + 1) +@[expose] def deleteVertex (A : PreArc (n + 1)) (hi : i < n + 1) (hdet : det (A.vertex i - A.vertex (i + 1)) (A.vertex (i + 1 + 1) - A.vertex (i + 1)) = 0) : PreArc n where vertex k := A.vertex (skipIdx i k) 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..08b0d2f625 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 @@ -97,6 +97,7 @@ functions of the data. -/ /-- The region of `ℝ² ∖ C` that does **not** contain `y`: everything off `C` except the component of `y`. For a separating curve this really is the other region (`IsSeparating.isRegionPair_farRegion`); no hypothesis is needed to define it. -/ +@[expose] def farRegion (C : Set Plane) (y : Plane) : Set Plane := Cᶜ \ connectedComponentIn Cᶜ y theorem mem_farRegion_iff : x ∈ farRegion C y ↔ x ∉ C ∧ x ∉ connectedComponentIn Cᶜ y := Iff.rfl @@ -214,6 +215,7 @@ variable {m : ℕ} {C : ClosedPolygon m} {a : ZMod (m + 3)} {k : ℕ} /-- The arc of `C` that leaves vertex `a` and runs forward through `k` edges, as a set: the blueprint's `A₁` for `k` edges and `A₂` for the remaining `m + 3 - k`. -/ +@[expose] def arc (C : ClosedPolygon m) (a : ZMod (m + 3)) (k : ℕ) : Set Plane := cover (C.arcPieces a k) theorem arc_subset_carrier (C : ClosedPolygon m) (a : ZMod (m + 3)) (k : ℕ) : 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..7e0258f357 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 @@ -177,7 +177,7 @@ theorem isArcBetween_chain (P : PrePolygon m) : `vertex_inj` and `edges_meet`, so it is the old proof verbatim. -/ /-- The edge list of the arc of `P` that leaves vertex `a` and runs forward through `k` edges. -/ -def arcPieces (P : PrePolygon m) (a : ZMod (m + 3)) (k : ℕ) : List Piece := +@[expose] def arcPieces (P : PrePolygon m) (a : ZMod (m + 3)) (k : ℕ) : List Piece := (List.range k).map fun t : ℕ => (P.vertex (a + t), P.vertex (a + t + 1)) /-- Forgetting the `corner` field does not change the edge list of an arc. -/ @@ -301,6 +301,7 @@ theorem parity_splitting (P : PrePolygon m) (u : Plane) (a : ZMod (m + 3)) (hk : /-! ## The arcs as sets -/ /-- The arc of `P` that leaves vertex `a` and runs forward through `k` edges, as a set. -/ +@[expose] def arc (P : PrePolygon m) (a : ZMod (m + 3)) (k : ℕ) : Set Plane := cover (P.arcPieces a k) @[simp] theorem arc_toPre (C : ClosedPolygon m) (a : ZMod (m + 3)) (k : ℕ) : @@ -679,7 +680,7 @@ theorem insEdge_last_subset : segment ℝ z (P.vertex 0) ⊆ P.edge (-1) := by /-- **The polygon with one extra vertex, interior to its last edge** — equivalently, with the last edge split in two at a prescribed interior point. -/ -def insertLast (P : PrePolygon m) (hz : z ∈ openSegment ℝ (P.vertex (-1)) (P.vertex 0)) : +@[expose] def insertLast (P : PrePolygon m) (hz : z ∈ openSegment ℝ (P.vertex (-1)) (P.vertex 0)) : PrePolygon (m + 1) where vertex := insVertex P z vertex_inj := by diff --git a/LeanPool/Schoenflies/PrePolygonSep.lean b/LeanPool/Schoenflies/PrePolygonSep.lean index 8da7248b61..10b3fac7e6 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 @@ -236,7 +236,7 @@ that the two are the same list. -/ /-- 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 : PrePolygon m) : List Piece := +@[expose] def pieces (P : PrePolygon 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/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..83df97f79e 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 @@ -91,13 +91,13 @@ noncomputable def scheduledQuantitativeSuccessor (dyadicTargetBound_pos n)) /-- The recursively chosen generated pairs. -/ -noncomputable def quantitativeStage : ℕ → +@[expose] noncomputable def quantitativeStage : ℕ → GeneratedPair S₀ C (C ∪ inside C) modelCurve (Plane.closedSquare 0 1) := fun n => Nat.rec P₀ (fun k P => (scheduledQuantitativeSuccessor hC hcycle q k P).pair) n @[simp] theorem quantitativeStage_zero : - quantitativeStage P₀ hC hcycle q 0 = P₀ := rfl + quantitativeStage P₀ hC hcycle q 0 = P₀ := by exact rfl @[simp] theorem quantitativeStage_succ (n : ℕ) : quantitativeStage P₀ hC hcycle q (n + 1) = @@ -247,7 +247,7 @@ theorem tendsto_quantitativeStage_diam_sourceStar /-- The complete quantitative recursion, in the exact interface consumed by the limit-map construction. -/ -noncomputable def quantitativeStageSequence +@[expose] noncomputable def quantitativeStageSequence (hbase : S₀.CombInvariants) (hdense : q.CentresDense) : StageSequence γ S₀ C where stage := quantitativeStage P₀ hC hcycle q @@ -264,7 +264,7 @@ noncomputable def quantitativeStageSequence /-- The recursion with its canonical dense schedule. No convergence hypothesis remains in this interface. -/ -noncomputable def denseQuantitativeStageSequence (hbase : S₀.CombInvariants) : +@[expose] noncomputable def denseQuantitativeStageSequence (hbase : S₀.CombInvariants) : StageSequence γ S₀ C := quantitativeStageSequence P₀ hC hcycle (denseQuantitativeSchedule hC) hbase (denseQuantitativeSchedule_centresDense hC) 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..4ba7f80503 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 @@ -112,10 +112,10 @@ namespace PrePolygon variable {m : ℕ} (P : PrePolygon m) /-- The edge leaving vertex `i`. -/ -def edge (i : ZMod (m + 3)) : Set Plane := segment ℝ (P.vertex i) (P.vertex (i + 1)) +@[expose] def edge (i : ZMod (m + 3)) : Set Plane := segment ℝ (P.vertex i) (P.vertex (i + 1)) /-- The carrier: the union of the edges. -/ -def carrier : Set Plane := ⋃ i, P.edge i +@[expose] def carrier : Set Plane := ⋃ i, P.edge i variable {P} @@ -130,7 +130,7 @@ theorem vertex_ne_succ (i : ZMod (m + 3)) : P.vertex i ≠ P.vertex (i + 1) := f end PrePolygon /-- A `ClosedPolygon` read as a `PrePolygon`: forget the `corner` field. -/ -def ClosedPolygon.toPre {m : ℕ} (P : ClosedPolygon m) : PrePolygon m := +@[expose] def ClosedPolygon.toPre {m : ℕ} (P : ClosedPolygon m) : PrePolygon m := ⟨P.vertex, P.vertex_inj, P.edges_meet⟩ @[simp] theorem ClosedPolygon.carrier_toPre {m : ℕ} (P : ClosedPolygon m) : @@ -173,7 +173,7 @@ Reading the same cyclic list from a different starting vertex. It is used once, vertex that is about to be deleted to the end of the list. -/ /-- The same closed polygon, read from vertex `a` onwards. -/ -def rotate (P : PrePolygon m) (a : ZMod (m + 3)) : PrePolygon m where +@[expose] def rotate (P : PrePolygon m) (a : ZMod (m + 3)) : PrePolygon m where vertex j := P.vertex (a + j) vertex_inj i j h := add_left_cancel (P.vertex_inj h) edges_meet i j hij := by @@ -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 _ @@ -732,11 +733,11 @@ section Gaps variable {n : ℕ} {T : Finset ℝ} (hcard : T.card = n) /-- The `i`-th parameter, in increasing order. -/ -noncomputable def par (T : Finset ℝ) (hcard : T.card = n) (i : Fin n) : ℝ := +@[expose] 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 @@ -1362,7 +1363,7 @@ namespace ClosedPolygon variable {m : ℕ} /-- The same closed polygon, read from vertex `a` onwards. -/ -def rotate (P : ClosedPolygon m) (a : ZMod (m + 3)) : ClosedPolygon m where +@[expose] def rotate (P : ClosedPolygon m) (a : ZMod (m + 3)) : ClosedPolygon m where vertex j := P.vertex (a + j) vertex_inj i j h := add_left_cancel (P.vertex_inj h) edges_meet i j hij := by diff --git a/LeanPool/Schoenflies/RealizeSplit.lean b/LeanPool/Schoenflies/RealizeSplit.lean index 8e0ad6f3ba..1688164888 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 @@ -372,6 +372,7 @@ theorem subcells_face_diff : S.subcells d.face \ {d.face} = d.cells₁ ∪ d.cel exacts [d.cells₁_ne_face h, d.cells₂_ne_face h] /-- The drawn ear: the abstract ear pushed into the plane along the chosen positions. -/ +@[expose] def earGraph (d : S.SplitData) (earPos : γ → Plane) : Graph Plane γ := d.ear.map earPos @[simp] theorem vertexSet_earGraph (earPos : γ → Plane) : @@ -381,7 +382,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 @@ -843,7 +844,7 @@ and assertion (i) at the old stage produce a realization of `S.splitFace d`: This is the object the whole split step of `lem:cellulation-invariants` was missing: `SplitData.isCrosscutSplit_realize` puts it in the relation `IsCrosscutSplit` to `R`, and `IsCrosscutSplit.isCellDecomposition_and_isFaceJordan` then propagates both invariants. -/ -noncomputable def realize (R : S.Realization) (d : S.SplitData) (earPos : γ → Plane) +@[expose] noncomputable def realize (R : S.Realization) (d : S.SplitData) (earPos : γ → Plane) (earDraw : γ → ℝ → Plane) (hE : d.EarCrosscut R earPos earDraw) : (S.splitFace d).Realization where pos := d.splitPos R earPos diff --git a/LeanPool/Schoenflies/RealizeSubdiv.lean b/LeanPool/Schoenflies/RealizeSubdiv.lean index b1a86cd7fb..5420e47b43 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 @@ -447,7 +447,8 @@ noncomputable def realizeCell (d : S.SubdivData) (R : S.Realization) (t : ℝ) : else R.cell c /-- The drawn skeleton after the subdivision. -/ -noncomputable def realizeGraph (d : S.SubdivData) (R : S.Realization) (t : ℝ) : Graph Plane γ := +@[expose] noncomputable def realizeGraph (d : S.SubdivData) (R : S.Realization) + (t : ℝ) : Graph Plane γ := d.skeleton.map (d.realizePos R t) variable {d R} @@ -896,7 +897,7 @@ and every surviving cell is exactly where it was. There is no geometric side condition: everything the construction needs is already carried by `R`, and is extracted by the lemmas above rather than assumed. -/ -noncomputable def realize (d : S.SubdivData) (R : S.Realization) (t : ℝ) +@[expose] noncomputable def realize (d : S.SubdivData) (R : S.Realization) (t : ℝ) (ht : t ∈ Ioo (0 : ℝ) 1) : (S.subdivideEdge d).Realization where pos := d.realizePos R t drawing := d.realizeDrawing R t diff --git a/LeanPool/Schoenflies/RealizeSubdivHomeo.lean b/LeanPool/Schoenflies/RealizeSubdivHomeo.lean index 7ba2bb98f9..40429dff80 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 @@ -167,6 +167,7 @@ The point map is untouched: a subdivision does not move the realized 1-skeleton (`skeletonSet_realize`), so six of the eight fields are the old ones read through that equality. The two that are not — `pos_apply` at the new 0-cell and `edgeArc_image` at the two new 1-cells — are `drawing_targetParam` and `image_edge_uIcc`. -/ +@[expose] noncomputable def realizeHomeo (d : S.SubdivData) (g : SkeletonHomeo R₁ R₂) {t : ℝ} (ht : t ∈ Ioo (0 : ℝ) 1) : SkeletonHomeo (d.realize R₁ t ht) @@ -211,10 +212,10 @@ noncomputable def realizeHomeo (d : S.SubdivData) (g : SkeletonHomeo R₁ R₂) exact g.edgeArc_image heS @[simp] theorem realizeHomeo_toFun (ht : t ∈ Ioo (0 : ℝ) 1) : - (d.realizeHomeo g ht).toFun = g.toFun := rfl + (d.realizeHomeo g ht).toFun = g.toFun := by exact rfl @[simp] theorem realizeHomeo_invFun (ht : t ∈ Ioo (0 : ℝ) 1) : - (d.realizeHomeo g ht).invFun = g.invFun := rfl + (d.realizeHomeo g ht).invFun = g.invFun := by exact rfl /-- **The transported map is the old one as a point map** — the form `CellStructure.LimitTower.skelHomeo_succ` consumes. -/ 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..8ad717ac46 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 @@ -215,7 +215,7 @@ noncomputable def crosscutPieces (J : Piece) (p : Plane) (s epsilon : ℝ) : Lis /-- The finite straight-line overlay of the old compact source core, an auxiliary crosscut, and the local grid. Old nonboundary vertices and prescribed points are retained. -/ -noncomputable def crosscutOverlay (J : Piece) (p : Plane) (s epsilon : ℝ) +@[expose] noncomputable def crosscutOverlay (J : Piece) (p : Plane) (s epsilon : ℝ) (extra : List Plane) : Graph Plane Piece := attachGraph (Q.crosscutPieces J p s epsilon) (extra ++ P.sourceNonboundaryGraph.vertexFinset.toList) @@ -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..2f808dcd16 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 @@ -260,12 +260,12 @@ namespace SourceNonboundarySegmentCover variable (Q : SourceNonboundarySegmentCover P) /-- The two finite segment families in the source local-grid overlay. -/ -noncomputable def localPieces (p : Plane) (s epsilon : ℝ) : List Piece := +@[expose] noncomputable def localPieces (p : Plane) (s epsilon : ℝ) : List Piece := Q.pieces ++ localGridEdges p s (localGridCount s epsilon) /-- The compact old source core overlaid with a fine local grid. Old nonboundary vertices and any prescribed attachment points are retained as overlay vertices. -/ -noncomputable def localOverlay (p : Plane) (s epsilon : ℝ) +@[expose] noncomputable def localOverlay (p : Plane) (s epsilon : ℝ) (extra : List Plane) : Graph Plane Piece := attachGraph (Q.localPieces p s epsilon) (extra ++ P.sourceNonboundaryGraph.vertexFinset.toList) @@ -645,7 +645,7 @@ noncomputable abbrev innerGraph : Graph Plane γ := (Q.localOverlay p s epsilon extra).relabelEdges w.name w.name_inj /-- The mixed source extension graph. -/ -noncomputable def graph : Graph Plane γ := w.outerGraph.union w.innerGraph +@[expose] noncomputable def graph : Graph Plane γ := w.outerGraph.union w.innerGraph /-- The mixed drawing uses the original parametrizations on the wild outer edges and straight segments on every freshly named inner edge. -/ 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..e3f111d72a 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 @@ -817,7 +817,7 @@ theorem missing from `main` — "the subdivision of a segment at a finite point that blocks `prop:anchored-square-mesh` from being carried over to `Schoenflies.squareMesh`. -/ /-- The edges of an overlay lying inside one of its source segments. -/ -def insideEdges (pieces : List Piece) (points : List Plane) (P₀ : Piece) : Set Piece := +@[expose] def insideEdges (pieces : List Piece) (points : List Plane) (P₀ : Piece) : Set Piece := {Q | Q ∈ overlayPieces pieces points ∧ Q.seg ⊆ P₀.seg} /-- **The edges inside one source segment tile it.** Every clause is a property of the diff --git a/LeanPool/Schoenflies/SquareMesh.lean b/LeanPool/Schoenflies/SquareMesh.lean index fec825c113..9a4872fd36 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)), @@ -201,7 +201,7 @@ theorem smul_segment_eq_image {a b : ℝ} (hab : a ≤ b) (z : Plane) : /-! ### Spokes -/ /-- The radial spoke at a boundary point `z`, running from `z` inwards to `N⁻¹ • z`. -/ -noncomputable def spokePiece (N : ℕ) (z : Plane) : Piece := (z, ((N : ℝ)⁻¹) • z) +@[expose] noncomputable def spokePiece (N : ℕ) (z : Plane) : Piece := (z, ((N : ℝ)⁻¹) • z) /-- A spoke is the set of multiples `t • z` with `N⁻¹ ≤ t ≤ 1`. -/ theorem spokePiece_seg {N : ℕ} (hN : 2 ≤ N) (z : Plane) : @@ -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) : @@ -549,7 +549,7 @@ is the point-set half: the edges whose arcs lie on `S` occupy exactly `S`. See t docstring. -/ /-- The edges of the mesh that lie on the model curve. -/ -def outerEdges (N : ℕ) (fresh anchors : List Plane) : Set Piece := +@[expose] def outerEdges (N : ℕ) (fresh anchors : List Plane) : Set Piece := {P | P ∈ E(meshGraph N fresh anchors) ∧ P.seg ⊆ modelCurve} /-- **The outer edges occupy exactly the model curve.** -/ @@ -762,7 +762,7 @@ This is the hypothesis the blueprint discharges by "parametrize `S` by a circle, continuity to cut it into arcs of diameter `< δ/8`, and pick one fresh point in the relative interior of each". Stated as a property of a *set* rather than of a cyclic order, it needs no ordering of the fresh points along `S` — which is what makes the whole mesh order-free. -/ -def FreshDense (fresh : List Plane) (δ : ℝ) : Prop := +@[expose] def FreshDense (fresh : List Plane) (δ : ℝ) : Prop := ∀ A : Set Plane, A ⊆ modelCurve \ {x | x ∈ fresh} → IsPreconnected A → ∀ x ∈ A, ∀ y ∈ A, dist x y ≤ δ / 2 @@ -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..2cc58cdbec 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 @@ -262,16 +262,16 @@ runs on. Every inner ring needs the same facts, so they are restated here with t parameter; `rsideT 1 = sideT` and so on, definitionally. -/ /-- The top side of the ring of radius `r`, from the north-east corner to the north-west one. -/ -def rsideT (r : ℝ) : Piece := (Plane.mk r r, Plane.mk (-r) r) +@[expose] def rsideT (r : ℝ) : Piece := (Plane.mk r r, Plane.mk (-r) r) /-- The left side of the ring of radius `r`, from north-west to south-west. -/ -def rsideL (r : ℝ) : Piece := (Plane.mk (-r) r, Plane.mk (-r) (-r)) +@[expose] def rsideL (r : ℝ) : Piece := (Plane.mk (-r) r, Plane.mk (-r) (-r)) /-- The bottom side of the ring of radius `r`, from south-west to south-east. -/ -def rsideB (r : ℝ) : Piece := (Plane.mk (-r) (-r), Plane.mk r (-r)) +@[expose] def rsideB (r : ℝ) : Piece := (Plane.mk (-r) (-r), Plane.mk r (-r)) /-- The right side of the ring of radius `r`, from south-east back to north-east. -/ -def rsideR (r : ℝ) : Piece := (Plane.mk r (-r), Plane.mk r r) +@[expose] def rsideR (r : ℝ) : Piece := (Plane.mk r (-r), Plane.mk r r) theorem rsideT_one : rsideT 1 = sideT := rfl theorem rsideL_one : rsideL 1 = sideL := rfl diff --git a/LeanPool/Schoenflies/SquareMeshConnected.lean b/LeanPool/Schoenflies/SquareMeshConnected.lean index 46412fe5a8..ee2a654e26 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,15 @@ 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)`. -/ +@[expose] 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 +462,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..1b68303cf5 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 @@ -740,6 +740,7 @@ chain running from `P.1` to `P.2`. Nothing about the mesh appears in it. -/ /-- **The overlay subdivides each source segment into a path.** For each nondegenerate source segment `P` there is an ordering `W` of *exactly* the overlay edges lying inside `P` which is a path of the overlay from `P.1` to `P.2`. -/ +@[expose] def SubdividesToPath (pieces : List Piece) (points : List Plane) : Prop := ∀ P ∈ pieces, P.Nondeg → ∃ W : List Piece, (overlayGraph pieces points).IsPath P.1 W P.2 ∧ @@ -779,16 +780,16 @@ 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)) +@[expose] 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) +@[expose] def sideR : Piece := (Plane.mk 1 (-1), Plane.mk 1 1) theorem sideT_mem_ringPieces : sideT ∈ ringPieces 1 := by simp [ringPieces, sideT] theorem sideL_mem_ringPieces : sideL ∈ ringPieces 1 := by simp [ringPieces, sideL] 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..be67d33d22 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 @@ -153,7 +153,7 @@ theorem skelHomeo_succ (n : ℕ) : /-- **The tower the limit section consumes.** Every field is read off the stages or is one of the four facts about the two concrete domains; there is no mathematics here beyond the two recorded above. -/ -def limitTower : CellStructure.LimitTower γ where +@[expose] def limitTower : CellStructure.LimitTower γ where str n := (T.stage n).str src n := (T.stage n).src tgt n := (T.stage n).tgt 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..b58a8b5e56 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 @@ -153,7 +153,7 @@ noncomputable def meshPieces (Q : TargetSegmentCover P) (delta : ℝ) /-- The target skeleton overlaid with the anchored square mesh. Old vertices and prescribed mesh anchors are explicitly included in the cut list. -/ -noncomputable def meshOverlay (Q : TargetSegmentCover P) (delta : ℝ) +@[expose] noncomputable def meshOverlay (Q : TargetSegmentCover P) (delta : ℝ) (fresh anchors : List Plane) : Graph Plane Piece := attachGraph (Q.meshPieces delta fresh anchors) (anchors ++ P.tgt.graph.vertexFinset.toList) 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..8d2660e70a 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 @@ -200,11 +200,11 @@ noncomputable def windowRadius (C : Set Plane) (ε : ℝ) (p : Plane) : ℝ := supRadius C p - min (supRadius C p / 2) ε /-- **`W_n(p)`**, the closed window. -/ -noncomputable def window (C : Set Plane) (ε : ℝ) (p : Plane) : Set Plane := +@[expose] noncomputable def window (C : Set Plane) (ε : ℝ) (p : Plane) : Set Plane := Plane.closedSquare p (windowRadius C ε p) /-- The interior of the window, which is where `lem:grid-star-estimate` places its point. -/ -noncomputable def openWindow (C : Set Plane) (ε : ℝ) (p : Plane) : Set Plane := +@[expose] noncomputable def openWindow (C : Set Plane) (ε : ℝ) (p : Plane) : Set Plane := Plane.openSquare p (windowRadius C ε p) /-- **`0 < s_n(p)`.** -/ @@ -271,7 +271,7 @@ value of the enumeration recurs at arbitrarily large indices, and the mesh seque /-- **An enumeration in which every value of `f` occurs infinitely often.** Cantor pairing, read off the first component: the value `f k` reappears at `Nat.pair k m` for every `m`. -/ -def recur {α : Type*} (f : ℕ → α) (n : ℕ) : α := f (Nat.unpair n).1 +@[expose] def recur {α : Type*} (f : ℕ → α) (n : ℕ) : α := f (Nat.unpair n).1 /-- **"The point `b` occurs at arbitrarily large indices."** This is the step of `prop:shrinking-stars` that lets the mesh parameter be taken as small as the point requires: the diff --git a/LeanPool/ScottishBook155/AdjunctionFormula.lean b/LeanPool/ScottishBook155/AdjunctionFormula.lean index 346a88631e..7082c18705 100644 --- a/LeanPool/ScottishBook155/AdjunctionFormula.lean +++ b/LeanPool/ScottishBook155/AdjunctionFormula.lean @@ -19,7 +19,7 @@ short-scale property: an excursion through the old target cannot shorten a source pair of distance at most `r`. -/ -@[expose] public section +public section namespace ScottishBook155 @@ -35,6 +35,7 @@ theorem oneSum_dist_eq /-- Length of the cheapest source--target--source excursion in the proposed metric adjunction. -/ +@[expose] noncomputable def attachmentExcursionCost {M : Type u} [NormedAddCommGroup M] {N : Type v} [PseudoMetricSpace N] (V : M → N) (a : M) (y : N) (H : ℝ) (x₀ x₁ : OneSum M) : ℝ := @@ -45,12 +46,14 @@ noncomputable def attachmentExcursionCost /-- The manuscript's source--source adjunction distance formula, before the ambient quotient space is constructed. -/ +@[expose] noncomputable def sourceAdjunctionDist {M : Type u} [NormedAddCommGroup M] {N : Type v} [PseudoMetricSpace N] (V : M → N) (a : M) (y : N) (H : ℝ) (x₀ x₁ : OneSum M) : ℝ := min (dist x₀ x₁) (attachmentExcursionCost V a y H x₀ x₁) /-- Distance candidate from a source point to an old-target point. -/ +@[expose] noncomputable def attachmentTargetCost {M : Type u} [NormedAddCommGroup M] {N : Type v} [PseudoMetricSpace N] (V : M → N) (a : M) (y : N) (H : ℝ) (x : OneSum M) (n : N) : ℝ := @@ -60,6 +63,7 @@ noncomputable def attachmentTargetCost /-- The two-layer adjunction predistance on the disjoint union of the source and old target. The remaining construction step is to prove its triangle inequality and take its metric separation quotient. -/ +@[expose] noncomputable def adjunctionPreDist {M : Type u} [NormedAddCommGroup M] {N : Type v} [PseudoMetricSpace N] (V : M → N) (a : M) (y : N) (H : ℝ) : @@ -658,7 +662,7 @@ theorem adjunctionPreDist_triangle /-- The gluing pseudometric on the disjoint union of the one-sum source and target, under the attachment distance bound. -/ -@[implicit_reducible] +@[implicit_reducible, expose] noncomputable def adjunctionPseudoMetricSpace {M : Type u} [NormedAddCommGroup M] {N : Type v} [PseudoMetricSpace N] @@ -813,6 +817,7 @@ theorem adjunctionPreDist_source_eq_of_short /-- The metric separation quotient realizing the asymmetric metric adjunction. -/ +@[expose] noncomputable def AdjunctionSpace {M : Type u} [NormedAddCommGroup M] {N : Type v} [PseudoMetricSpace N] (V : M → N) (a : M) (y : N) (H : ℝ) @@ -832,6 +837,7 @@ noncomputable instance (adjunctionPseudoMetricSpace V a y H hattach).toUniformSpace.toTopologicalSpace /-- The canonical map from the one-sum source into the metric adjunction space. -/ +@[expose] noncomputable def adjunctionSourceMk {M : Type u} [NormedAddCommGroup M] {N : Type v} [PseudoMetricSpace N] (V : M → N) (a : M) (y : N) (H : ℝ) @@ -849,6 +855,7 @@ noncomputable instance adjunctionSpaceNonempty ⟨adjunctionSourceMk V a y H hattach 0⟩ /-- The canonical map from the target into the metric adjunction space. -/ +@[expose] noncomputable def adjunctionTargetMk {M : Type u} [NormedAddCommGroup M] {N : Type v} [PseudoMetricSpace N] (V : M → N) (a : M) (y : N) (H : ℝ) diff --git a/LeanPool/ScottishBook155/AdjunctionRetraction.lean b/LeanPool/ScottishBook155/AdjunctionRetraction.lean index 83e532ca37..643ab170ec 100644 --- a/LeanPool/ScottishBook155/AdjunctionRetraction.lean +++ b/LeanPool/ScottishBook155/AdjunctionRetraction.lean @@ -17,7 +17,7 @@ identity on the old target it is nonexpansive for the adjunction predistance, so it descends through metric separation. -/ -@[expose] public section +public section namespace ScottishBook155 @@ -27,6 +27,7 @@ universe u v /-- The source retraction expressed on the one-sum model of the source and its added real coordinate. -/ +@[expose] noncomputable def sourceRetractionOne {M : Type u} {N : Type v} [NormedAddCommGroup N] [NormedSpace ℝ N] (V : M → N) (a : M) (y : N) (L H : ℝ) (x : OneSum M) : N := @@ -34,6 +35,7 @@ noncomputable def sourceRetractionOne /-- The map on the disjoint union that retracts the source component and fixes the target component. -/ +@[expose] noncomputable def adjunctionRetractionPre {M : Type u} {N : Type v} [NormedAddCommGroup N] [NormedSpace ℝ N] (V : M → N) (a : M) (y : N) (L H : ℝ) : OneSum M ⊕ N → N @@ -149,6 +151,7 @@ theorem adjunctionRetractionPre_dist_le /-- The pointed nonexpansive retraction from the metric adjunction to the old target. -/ +@[expose] noncomputable def adjunctionRetraction {M : Type u} {N : Type v} [NormedAddCommGroup M] [NormedAddCommGroup N] [NormedSpace ℝ N] (V : M → N) (a : M) (y : N) (L H : ℝ) diff --git a/LeanPool/ScottishBook155/AdjunctionRetractiveEnvelope.lean b/LeanPool/ScottishBook155/AdjunctionRetractiveEnvelope.lean index c650e7a1da..af950f8eac 100644 --- a/LeanPool/ScottishBook155/AdjunctionRetractiveEnvelope.lean +++ b/LeanPool/ScottishBook155/AdjunctionRetractiveEnvelope.lean @@ -19,7 +19,7 @@ target, and recovers the nonlinear adjunction retraction by a contractive linear projection. -/ -@[expose] public section +public section namespace ScottishBook155 @@ -29,6 +29,7 @@ universe u v /-- The retractive-envelope embedding of the adjunction space, using its canonical target inclusion and retraction. -/ +@[expose] noncomputable def adjunctionEnvelopeEmbedding {M : Type u} {N : Type v} [NormedAddCommGroup M] [NormedAddCommGroup N] [NormedSpace ℝ N] (V : M → N) (a : M) (y : N) (L H : ℝ) diff --git a/LeanPool/ScottishBook155/AttachmentMap.lean b/LeanPool/ScottishBook155/AttachmentMap.lean index 29be88ed52..3b08b3e979 100644 --- a/LeanPool/ScottishBook155/AttachmentMap.lean +++ b/LeanPool/ScottishBook155/AttachmentMap.lean @@ -17,7 +17,7 @@ attachment set in `M ⊕₁ ℝ` is parametrized by `M ⊕ Unit`: the left summa the base hyperplane and the right summand is the single elevated point. -/ -@[expose] public section +public section namespace ScottishBook155 @@ -29,18 +29,21 @@ universe u v abbrev OneSum (M : Type u) := WithLp 1 (M × ℝ) /-- Parametrization of the base hyperplane together with one elevated point. -/ +@[expose] noncomputable def attachmentPoint {M : Type u} (a : M) (H : ℝ) : M ⊕ Unit → OneSum M | Sum.inl m => toLp 1 (m, 0) | Sum.inr _ => toLp 1 (a, H) /-- The attachment subset of the sum-norm product. -/ +@[expose] noncomputable def attachmentSet {M : Type u} (a : M) (H : ℝ) : Set (OneSum M) := Set.range (attachmentPoint a H) /-- The map prescribed on the attachment set before taking the metric adjunction. -/ +@[expose] def attachmentMap {M : Type u} {N : Type v} (V : M → N) (y : N) : M ⊕ Unit → N | Sum.inl m => V m diff --git a/LeanPool/ScottishBook155/BentSeedStage.lean b/LeanPool/ScottishBook155/BentSeedStage.lean index ae4e71099a..84dfd61587 100644 --- a/LeanPool/ScottishBook155/BentSeedStage.lean +++ b/LeanPool/ScottishBook155/BentSeedStage.lean @@ -16,13 +16,14 @@ between real Banach spaces carrying the invariant used by the transfinite construction. -/ -@[expose] public section +public section namespace ScottishBook155 open WithLp /-- The bent seed as a map into the genuine l-one Banach sum. -/ +@[expose] noncomputable def bentMapL1 (t : ℝ) : OneSum ℝ := toLp 1 (bentMap t) @@ -49,6 +50,7 @@ theorem bentMapL1_contraction : simpa using bentMap_contraction /-- Stage zero of the claim-14 recursion. -/ +@[expose] noncomputable def bentSeedStage : ProtectedStage ((1 : ℝ) / 2) where source := RealBanachSpace.ofType ℝ target := RealBanachSpace.ofType (OneSum ℝ) diff --git a/LeanPool/ScottishBook155/BookkeepingSchedule.lean b/LeanPool/ScottishBook155/BookkeepingSchedule.lean index 2dcc97bffd..f1ad2b6824 100644 --- a/LeanPool/ScottishBook155/BookkeepingSchedule.lean +++ b/LeanPool/ScottishBook155/BookkeepingSchedule.lean @@ -17,7 +17,7 @@ order type and recursively choose a fresh point in the full-size tail above `α`. -/ -@[expose] public section +public section namespace ScottishBook155 @@ -114,6 +114,7 @@ theorem bookkeepingSchedule_gt (p : RI × RI) : /-- The stage which receives the point named by a bookkeeping requirement. The schedule names the transition; the point is present at its successor. -/ +@[expose] noncomputable def bookkeepingReceivingStage (p : RI × RI) : RI := Order.succ (bookkeepingSchedule p) diff --git a/LeanPool/ScottishBook155/CardinalControl.lean b/LeanPool/ScottishBook155/CardinalControl.lean index 7c3673f676..cdd0fd3085 100644 --- a/LeanPool/ScottishBook155/CardinalControl.lean +++ b/LeanPool/ScottishBook155/CardinalControl.lean @@ -17,7 +17,7 @@ successor target is controlled by its explicit dense set of finite linear combinations, followed by the generic sequence encoding of metric closure. -/ -@[expose] public section +public section namespace ScottishBook155 diff --git a/LeanPool/ScottishBook155/Claim14.lean b/LeanPool/ScottishBook155/Claim14.lean index 5dbe6cf14b..f471e9ab7c 100644 --- a/LeanPool/ScottishBook155/Claim14.lean +++ b/LeanPool/ScottishBook155/Claim14.lean @@ -17,7 +17,7 @@ bijection satisfying the paper's closed-ball conclusion while failing to be a global isometry. -/ -@[expose] public section +public section namespace ScottishBook155 @@ -39,6 +39,7 @@ instance : CoeSort (RealBanachSpace.{u}) (Type u) := ⟨RealBanachSpace.carrier⟩ /-- Bundle an already-instanced real Banach space. -/ +@[expose] def RealBanachSpace.ofType (X : Type u) [NormedAddCommGroup X] [NormedSpace ℝ X] [CompleteSpace X] : RealBanachSpace.{u} where carrier := X @@ -55,6 +56,7 @@ structure Claim14Witness where isCounterexample : IsCounterexampleAt ((1 : ℝ) / 4) map /-- The exact formal proposition corresponding to canonical claim 14. -/ +@[expose] def Claim14 : Prop := Nonempty (Claim14Witness.{u}) /-- The stronger construction invariant used in the paper is sufficient for diff --git a/LeanPool/ScottishBook155/CoherentBiSystem.lean b/LeanPool/ScottishBook155/CoherentBiSystem.lean index 5cc81f04a4..4a009cdb10 100644 --- a/LeanPool/ScottishBook155/CoherentBiSystem.lean +++ b/LeanPool/ScottishBook155/CoherentBiSystem.lean @@ -16,7 +16,7 @@ retractions supplies both a directed system and the projection system used at completed limit stages. -/ -@[expose] public section +public section namespace ScottishBook155 @@ -67,6 +67,7 @@ noncomputable instance directedSystem (B : CoherentBiSystem G) : /-- Projection from any component to component `a`: embed forward below `a`, and retract backward above `a`. -/ +@[expose] noncomputable def totalProject (B : CoherentBiSystem G) (a i : ι) : G i →L[ℝ] G a := by by_cases hia : i ≤ a @@ -96,6 +97,7 @@ theorem totalProject_of_ge (B : CoherentBiSystem G) /-- The total projections form the projection system required at a completed direct limit. -/ +@[expose] noncomputable def projectionSystem (B : CoherentBiSystem G) : CoherentRetractionLimit.ProjectionSystem G B.embed where project := totalProject G B diff --git a/LeanPool/ScottishBook155/CoherentRetractionLimit.lean b/LeanPool/ScottishBook155/CoherentRetractionLimit.lean index 18f4ee20c4..7c84dad528 100644 --- a/LeanPool/ScottishBook155/CoherentRetractionLimit.lean +++ b/LeanPool/ScottishBook155/CoherentRetractionLimit.lean @@ -16,7 +16,7 @@ stage. A coherent family of contractive projections to an earlier component extends to a contractive linear map from the completed direct limit. -/ -@[expose] public section +public section namespace ScottishBook155 @@ -100,6 +100,7 @@ structure ProjectionSystem where project a i x = e i a hia x /-- The projection system restricted to one fixed component. -/ +@[expose] noncomputable def ProjectionSystem.family (P : ProjectionSystem N e) (a : ι) : ProjectionFamily N e a where project := P.project a @@ -111,6 +112,7 @@ noncomputable def ProjectionSystem.family (P : ProjectionSystem N e) (a : ι) : /-- Project a completed-limit vector to component `a` and include it back into the completed limit. -/ +@[expose] noncomputable def ProjectionSystem.approx (P : ProjectionSystem N e) (a : ι) (z : NormedDirectLimit.CompletedCarrier N e) : NormedDirectLimit.CompletedCarrier N e := diff --git a/LeanPool/ScottishBook155/CollapsedQuotient.lean b/LeanPool/ScottishBook155/CollapsedQuotient.lean index e648f51b09..8f6293434c 100644 --- a/LeanPool/ScottishBook155/CollapsedQuotient.lean +++ b/LeanPool/ScottishBook155/CollapsedQuotient.lean @@ -15,7 +15,7 @@ This module constructs the pseudometric on the original space whose metric separation quotient is the quotient used for the injectivity coordinate. -/ -@[expose] public section +public section namespace ScottishBook155 @@ -24,6 +24,7 @@ open ENNReal lp Metric universe u /-- The distance obtained by allowing a path to jump for free inside `S`. -/ +@[expose] noncomputable def collapsedDist {P : Type u} [MetricSpace P] (S : Set P) (x y : P) : ℝ := min (dist x y) (infDist x S + infDist y S) @@ -60,7 +61,7 @@ theorem collapsedDist_triangle {P : Type u} [MetricSpace P] (S : Set P) (x y z : linarith /-- The pseudometric whose separation quotient collapses `S`. -/ -@[implicit_reducible] +@[implicit_reducible, expose] noncomputable def collapsedPseudoMetricSpace {P : Type u} [MetricSpace P] (S : Set P) : PseudoMetricSpace P where dist := collapsedDist S @@ -69,6 +70,7 @@ noncomputable def collapsedPseudoMetricSpace {P : Type u} [MetricSpace P] (S : S dist_triangle := collapsedDist_triangle S /-- The metric separation quotient of the collapsed pseudometric. -/ +@[expose] noncomputable def CollapsedQuotient (P : Type u) [MetricSpace P] (S : Set P) : Type u := letI := collapsedPseudoMetricSpace S SeparationQuotient P @@ -80,6 +82,7 @@ noncomputable instance {P : Type u} [MetricSpace P] (S : Set P) : infer_instance /-- The canonical map to the collapsed quotient. -/ +@[expose] noncomputable def collapseMk {P : Type u} [MetricSpace P] (S : Set P) (x : P) : CollapsedQuotient P S := by unfold CollapsedQuotient diff --git a/LeanPool/ScottishBook155/CombinedEmbedding.lean b/LeanPool/ScottishBook155/CombinedEmbedding.lean index 5dbfa420ca..165c0896db 100644 --- a/LeanPool/ScottishBook155/CombinedEmbedding.lean +++ b/LeanPool/ScottishBook155/CombinedEmbedding.lean @@ -18,7 +18,7 @@ in the max product preserves its metric estimates and supplies global injectivity once the first coordinate separates the collapsed subset. -/ -@[expose] public section +public section namespace ScottishBook155 @@ -28,6 +28,7 @@ universe u v /-- Pair an arbitrary relative coordinate with the quotient Kuratowski coordinate used to recover injectivity. -/ +@[expose] noncomputable def combinedEmbedding {P : Type u} [MetricSpace P] {E : Type v} (relative : P → E) (S : Set P) (base : P) (x : P) : E × lp (fun _ : CollapsedQuotient P S ↦ ℝ) ∞ := diff --git a/LeanPool/ScottishBook155/CompletedLimitMap.lean b/LeanPool/ScottishBook155/CompletedLimitMap.lean index 2df85a7ba8..bf15f21404 100644 --- a/LeanPool/ScottishBook155/CompletedLimitMap.lean +++ b/LeanPool/ScottishBook155/CompletedLimitMap.lean @@ -16,7 +16,7 @@ systems induces a nonexpansive map between their completed normed direct limits. Linearity of the stage maps is neither assumed nor used. -/ -@[expose] public section +public section namespace ScottishBook155 @@ -150,6 +150,7 @@ theorem algebraicMap_lipschitz /-- The coherent nonexpansive map extended to the completed normed direct limits. -/ +@[expose] noncomputable def completedMap : CompletedSource M eM → CompletedTarget N eN := UniformSpace.Completion.extension diff --git a/LeanPool/ScottishBook155/DenseSequenceCardinal.lean b/LeanPool/ScottishBook155/DenseSequenceCardinal.lean index 171b4c8860..02392c9438 100644 --- a/LeanPool/ScottishBook155/DenseSequenceCardinal.lean +++ b/LeanPool/ScottishBook155/DenseSequenceCardinal.lean @@ -20,7 +20,7 @@ keeps the completion estimates independent of the internal representation of Mathlib's completion. -/ -@[expose] public section +public section namespace ScottishBook155 diff --git a/LeanPool/ScottishBook155/DirectedLimitStage.lean b/LeanPool/ScottishBook155/DirectedLimitStage.lean index 9fc0b0190d..26eec2c899 100644 --- a/LeanPool/ScottishBook155/DirectedLimitStage.lean +++ b/LeanPool/ScottishBook155/DirectedLimitStage.lean @@ -20,7 +20,7 @@ preservation; eventual target recovery and injectivity of the earlier stages prove injectivity of the completed map. -/ -@[expose] public section +public section namespace ScottishBook155 @@ -66,6 +66,7 @@ abbrev Target := NormedDirectLimit.CompletedCarrier N eN /-- The continuous extension to completed limits of the compatible nonexpansive stage maps. -/ +@[expose] noncomputable def limitMap : Source M eM → Target N eN := CompletedLimitMap.completedMap M N eM eN V @@ -198,6 +199,7 @@ theorem eventualRecovery_of_bounded_lt exact boundedRecovery a x ha /-- The completed directed limit is another protected stage. -/ +@[expose] noncomputable def toProtectedStage {r : ℝ} (stageInjective : ∀ i, Function.Injective (V i)) (stagePreserves : ∀ i, PreservesUpTo r (V i)) @@ -238,6 +240,7 @@ noncomputable def toProtectedStageOfBounded {r L : ℝ} (hL : 0 < L) hL boundedRecovery) /-- Version of `toProtectedStage` for an open uniform recovery band. -/ +@[expose] noncomputable def toProtectedStageOfBoundedLt {r L : ℝ} (hL : 0 < L) (stageInjective : ∀ i, Function.Injective (V i)) (stagePreserves : ∀ i, PreservesUpTo r (V i)) diff --git a/LeanPool/ScottishBook155/FinalAssembly.lean b/LeanPool/ScottishBook155/FinalAssembly.lean index 579f75774b..5f45ecac68 100644 --- a/LeanPool/ScottishBook155/FinalAssembly.lean +++ b/LeanPool/ScottishBook155/FinalAssembly.lean @@ -17,7 +17,7 @@ provide; the theorem proves that those data yield the canonical claim-14 witness. -/ -@[expose] public section +public section namespace ScottishBook155 diff --git a/LeanPool/ScottishBook155/FinalChainAssembly.lean b/LeanPool/ScottishBook155/FinalChainAssembly.lean index 0817f41aae..b02dc6a073 100644 --- a/LeanPool/ScottishBook155/FinalChainAssembly.lean +++ b/LeanPool/ScottishBook155/FinalChainAssembly.lean @@ -19,7 +19,7 @@ that the completed direct limits contain no points beyond the stage union, and the schedule gives surjectivity of the final map. -/ -@[expose] public section +public section namespace ScottishBook155 diff --git a/LeanPool/ScottishBook155/InitialSegmentOrder.lean b/LeanPool/ScottishBook155/InitialSegmentOrder.lean index 9a6a835df1..43f351df9c 100644 --- a/LeanPool/ScottishBook155/InitialSegmentOrder.lean +++ b/LeanPool/ScottishBook155/InitialSegmentOrder.lean @@ -12,7 +12,7 @@ public import LeanPool.ScottishBook155.RecursionCardinal # Closed initial segments as an open segment with a new top -/ -@[expose] public section +public section namespace ScottishBook155 diff --git a/LeanPool/ScottishBook155/KuratowskiCoordinate.lean b/LeanPool/ScottishBook155/KuratowskiCoordinate.lean index c0bca89995..f6b82ab927 100644 --- a/LeanPool/ScottishBook155/KuratowskiCoordinate.lean +++ b/LeanPool/ScottishBook155/KuratowskiCoordinate.lean @@ -18,7 +18,7 @@ of `P`. Unlike Mathlib's countable Kuratowski embedding, this construction does not require separability. -/ -@[expose] public section +public section namespace ScottishBook155 @@ -27,6 +27,7 @@ open ENNReal lp universe u /-- The distance-difference Kuratowski coordinate based at `base`. -/ +@[expose] noncomputable def fullKuratowski {P : Type u} [MetricSpace P] (base z : P) : ℓ^∞(P, ℝ) := ⟨fun u => dist z u - dist base u, by diff --git a/LeanPool/ScottishBook155/LimitCardinal.lean b/LeanPool/ScottishBook155/LimitCardinal.lean index 80022b4aa7..a71e85714e 100644 --- a/LeanPool/ScottishBook155/LimitCardinal.lean +++ b/LeanPool/ScottishBook155/LimitCardinal.lean @@ -13,7 +13,7 @@ public import LeanPool.ScottishBook155.RecursionCardinal # Cardinal bounds at protected limit stages -/ -@[expose] public section +public section namespace ScottishBook155 diff --git a/LeanPool/ScottishBook155/LimitStageCore.lean b/LeanPool/ScottishBook155/LimitStageCore.lean index 35a2b1c621..8fd4c62f29 100644 --- a/LeanPool/ScottishBook155/LimitStageCore.lean +++ b/LeanPool/ScottishBook155/LimitStageCore.lean @@ -19,7 +19,7 @@ short-distance preservation passes to the completion, and a jointly separating family of recovered coordinates forces injectivity. -/ -@[expose] public section +public section namespace ScottishBook155 diff --git a/LeanPool/ScottishBook155/LpTruncation.lean b/LeanPool/ScottishBook155/LpTruncation.lean index 27b7125a92..39ef3e4543 100644 --- a/LeanPool/ScottishBook155/LpTruncation.lean +++ b/LeanPool/ScottishBook155/LpTruncation.lean @@ -18,7 +18,7 @@ argument. They converge to the original vector and never increase pairwise distance. -/ -@[expose] public section +public section namespace ScottishBook155 @@ -28,6 +28,7 @@ universe u /-- Keep exactly the coordinates in a finite set. -/ +@[expose] noncomputable def lpTruncation {ι : Type u} (s : Finset ι) (f : ℓ^1(ι, ℝ)) : ℓ^1(ι, ℝ) := by classical @@ -97,6 +98,7 @@ theorem lpTruncation_tendsto {ι : Type u} (f : ℓ^1(ι, ℝ)) : (lp.hasSum_single (E := fun _ : ι => ℝ) (p := (1 : ℝ≥0∞)) (by simp) f) /-- Restrict an l-one vector to an arbitrary set of coordinates. -/ +@[expose] noncomputable def lpSetTruncation {ι : Type u} (A : Set ι) (f : ℓ^1(ι, ℝ)) : ℓ^1(ι, ℝ) := ⟨A.indicator f, f.2.mono' fun i => by @@ -115,12 +117,14 @@ variable {M : Type*} abbrev L1ExtensionSpace (M : Type*) (ι : Type u) := WithLp 1 (M × ℓ^1(ι, ℝ)) /-- Leave the first summand fixed and truncate the l-one coordinates. -/ +@[expose] noncomputable def l1ExtensionTruncation {ι : Type u} (s : Finset ι) (x : L1ExtensionSpace M ι) : L1ExtensionSpace M ι := WithLp.toLp 1 (x.fst, lpTruncation s x.snd) /-- Leave the first summand fixed and restrict the l-one tail to an arbitrary set of coordinates. -/ +@[expose] noncomputable def l1ExtensionSetTruncation {ι : Type u} (A : Set ι) (x : L1ExtensionSpace M ι) : L1ExtensionSpace M ι := WithLp.toLp 1 (x.fst, lpSetTruncation A x.snd) diff --git a/LeanPool/ScottishBook155/NormedDirectLimit.lean b/LeanPool/ScottishBook155/NormedDirectLimit.lean index 88bfd66588..8e41e9c966 100644 --- a/LeanPool/ScottishBook155/NormedDirectLimit.lean +++ b/LeanPool/ScottishBook155/NormedDirectLimit.lean @@ -21,7 +21,7 @@ whose transition maps are linear isometries, this file equips that algebraic direct limit with the unique norm making every canonical map isometric. -/ -@[expose] public section +public section namespace ScottishBook155 @@ -85,6 +85,7 @@ theorem repr_spec (z : Carrier G f) : Classical.choose_spec (Classical.choose_spec (Module.DirectLimit.exists_of z)) /-- The norm of a direct-limit element, computed from any representative. -/ +@[expose] noncomputable def limitNorm (z : Carrier G f) : ℝ := ‖reprValue G f z‖ @@ -94,6 +95,7 @@ theorem limitNorm_of (i : ι) (x : G i) : exact norm_eq_of_of_eq G f (repr_spec G f _) /-- The additive norm induced on the algebraic direct limit. -/ +@[expose] noncomputable def addGroupNorm : AddGroupNorm (Carrier G f) where toFun := limitNorm G f map_zero' := by @@ -128,6 +130,7 @@ noncomputable instance normedSpace : NormedSpace ℝ (Carrier G f) where rw [limitNorm_of, limitNorm_of, norm_smul] /-- Every canonical component map is a linear isometry. -/ +@[expose] noncomputable def of (i : ι) : G i →ₗᵢ[ℝ] Carrier G f where toLinearMap := Module.DirectLimit.of ℝ ι G (linearMap G f) i norm_map' := limitNorm_of G f i @@ -143,6 +146,7 @@ abbrev CompletedCarrier := UniformSpace.Completion (Carrier G f) /-- The canonical isometric embedding of a component into the completed direct limit. -/ +@[expose] noncomputable def completedOf (i : ι) : G i →ₗᵢ[ℝ] CompletedCarrier G f := UniformSpace.Completion.toComplₗᵢ.comp (of G f i) diff --git a/LeanPool/ScottishBook155/Paper1.lean b/LeanPool/ScottishBook155/Paper1.lean index 0137a760c0..8210c5593b 100644 --- a/LeanPool/ScottishBook155/Paper1.lean +++ b/LeanPool/ScottishBook155/Paper1.lean @@ -19,11 +19,12 @@ theorem. The protected one-point extension and the transfinite construction are not asserted here. -/ -@[expose] public section +public section namespace ScottishBook155 /-- The `ℓ₁` distance on the real plane. -/ +@[expose] def l1Dist (x y : ℝ × ℝ) : ℝ := |x.1 - y.1| + |x.2 - y.2| /-- The bent line used as the seed of the construction in `paper1`. -/ @@ -33,6 +34,7 @@ noncomputable def bentMap (t : ℝ) : ℝ × ℝ := else (1 - t, 1) /-- Preservation of all distances up to a fixed scale. -/ +@[expose] def PreservesUpTo {X Y : Type*} [PseudoMetricSpace X] [PseudoMetricSpace Y] (r : ℝ) (f : X → Y) : Prop := ∀ ⦃x y : X⦄, dist x y ≤ r → dist (f x) (f y) = dist x y diff --git a/LeanPool/ScottishBook155/PrefixGlue.lean b/LeanPool/ScottishBook155/PrefixGlue.lean index fb8720c4c1..5d79bdf87f 100644 --- a/LeanPool/ScottishBook155/PrefixGlue.lean +++ b/LeanPool/ScottishBook155/PrefixGlue.lean @@ -14,7 +14,7 @@ public import LeanPool.ScottishBook155.ProtectedChainTransport # Gluing compatible closed prefixes below a limit -/ -@[expose] public section +public section namespace ScottishBook155 @@ -30,6 +30,7 @@ structure CompatiblePrefixFamily (j : RI) where namespace ProtectedPrefix /-- The top-to-top link supplied by a restriction equality. -/ +@[expose] noncomputable def linkOfRestriction {i k : RI} (Pi : ProtectedPrefix i) (Pk : ProtectedPrefix k) (hik : i ≤ k) (hchain : (Pk.restriction hik).chain = Pi.chain) : @@ -54,6 +55,7 @@ abbrev stage (i : Set.Iio j) : ProtectedStage.{0} ((1 : ℝ) / 2) := /-- The canonical protected link between two members of a compatible prefix family. -/ +@[expose] noncomputable def link (i k : Set.Iio j) (hik : i ≤ k) : ProtectedLink (F.stage i) (F.stage k) 1 := (F.item i).linkOfRestriction (F.item k) hik (F.coherent i k hik) @@ -212,6 +214,7 @@ theorem target_cast_project_eq_later (a i k : Set.Iio j) /-- Glue a compatible family of closed prefixes into one protected chain on the open initial segment. -/ +@[expose] noncomputable def openChain : ProtectedChain (ι := Set.Iio j) ((1 : ℝ) / 2) 1 where stage := F.stage diff --git a/LeanPool/ScottishBook155/Preliminaries.lean b/LeanPool/ScottishBook155/Preliminaries.lean index 3a728a4793..519512c624 100644 --- a/LeanPool/ScottishBook155/Preliminaries.lean +++ b/LeanPool/ScottishBook155/Preliminaries.lean @@ -16,7 +16,7 @@ This module formalizes the line-segment subdivision argument from the preliminaries of `paper1`. -/ -@[expose] public section +public section namespace ScottishBook155 diff --git a/LeanPool/ScottishBook155/ProtectedChain.lean b/LeanPool/ScottishBook155/ProtectedChain.lean index 6b5d6438fa..f4c9a7c1ec 100644 --- a/LeanPool/ScottishBook155/ProtectedChain.lean +++ b/LeanPool/ScottishBook155/ProtectedChain.lean @@ -18,7 +18,7 @@ coherent forward embeddings and backward projections, and the fixed-band recovery identity between every two stages. -/ -@[expose] public section +public section namespace ScottishBook155 diff --git a/LeanPool/ScottishBook155/ProtectedChainCore.lean b/LeanPool/ScottishBook155/ProtectedChainCore.lean index 795e39ba33..6cada51050 100644 --- a/LeanPool/ScottishBook155/ProtectedChainCore.lean +++ b/LeanPool/ScottishBook155/ProtectedChainCore.lean @@ -15,7 +15,7 @@ The uniform recovery law is stable when one more active or idle successor is attached. This is the successor induction step used by the transfinite chain. -/ -@[expose] public section +public section namespace ScottishBook155 @@ -42,6 +42,7 @@ structure ProtectedLink {r : ℝ} targetProjection (S.map z) = A.map (sourceProjection z) /-- The identity link. -/ +@[expose] noncomputable def ProtectedLink.refl {r L : ℝ} (S : ProtectedStage.{u} r) : ProtectedLink S S L where sourceEmbedding := LinearIsometry.id @@ -71,6 +72,7 @@ noncomputable def ProtectedTransition.toLink recovers := fun z hz => T.recovers z hz.le /-- Append one successor transition to an existing coherent link. -/ +@[expose] noncomputable def ProtectedLink.extend {r L : ℝ} {A S : ProtectedStage.{u} r} (P : ProtectedLink A S L) (T : ProtectedTransition S L) : diff --git a/LeanPool/ScottishBook155/ProtectedChainLimit.lean b/LeanPool/ScottishBook155/ProtectedChainLimit.lean index 71198000ff..4b2b802543 100644 --- a/LeanPool/ScottishBook155/ProtectedChainLimit.lean +++ b/LeanPool/ScottishBook155/ProtectedChainLimit.lean @@ -16,7 +16,7 @@ completed direct limit. Together with `DirectedLimitStage`, this constructs a new protected stage at every nonempty limit segment. -/ -@[expose] public section +public section namespace ScottishBook155 @@ -48,14 +48,17 @@ abbrev LimitTarget := NormedDirectLimit.CompletedCarrier (fun i => (C.stage i).target) C.targetSystem.embed /-- The compatible source projections, packaged for extension to the completed limit. -/ +@[expose] noncomputable def sourceProjectionSystem := CoherentBiSystem.projectionSystem _ C.sourceSystem /-- The compatible target projections, packaged for extension to the completed limit. -/ +@[expose] noncomputable def targetProjectionSystem := CoherentBiSystem.projectionSystem _ C.targetSystem /-- The map between completed limits induced by the uniformly nonexpansive stage maps. -/ +@[expose] noncomputable def completedMap : C.LimitSource → C.LimitTarget := DirectedLimitStage.limitMap _ _ C.sourceSystem.embed C.targetSystem.embed (fun i => (C.stage i).map) @@ -240,6 +243,7 @@ theorem completed_recovery_of_dist_lt (hr : 0 < r) (a : ι) /-- The completed direct limit of a protected chain is again a protected stage. This is the limit clause used by the transfinite recursion. -/ +@[expose] noncomputable def limitStage (hr : 0 < r) (hL : 0 < L) : ProtectedStage.{u} r := DirectedLimitStage.toProtectedStageOfBoundedLt _ _ @@ -251,6 +255,7 @@ noncomputable def limitStage (hr : 0 < r) (hL : 0 < L) : (C.completed_recovery_of_dist_lt hr) /-- Every component is coherently linked to the completed limit stage. -/ +@[expose] noncomputable def toLimitLink (hr : 0 < r) (hL : 0 < L) (a : ι) : ProtectedLink (C.stage a) (C.limitStage hr hL) L where sourceEmbedding := NormedDirectLimit.completedOf _ C.sourceSystem.embed a diff --git a/LeanPool/ScottishBook155/ProtectedChainLimitAppend.lean b/LeanPool/ScottishBook155/ProtectedChainLimitAppend.lean index 0779e7db81..d31a8ea652 100644 --- a/LeanPool/ScottishBook155/ProtectedChainLimitAppend.lean +++ b/LeanPool/ScottishBook155/ProtectedChainLimitAppend.lean @@ -13,7 +13,7 @@ public import LeanPool.ScottishBook155.ProtectedChainSuccessor # Appending a completed limit stage to a coherent chain -/ -@[expose] public section +public section namespace ScottishBook155 @@ -35,12 +35,14 @@ noncomputable local instance appendLimitTargetDirectedSystem : CoherentBiSystem.directedSystem _ C.targetSystem /-- The family obtained by placing the completed limit stage at a new top. -/ +@[expose] noncomputable def appendLimitStage (hr : 0 < r) (hL : 0 < L) : WithTop ι → ProtectedStage.{u} r | ⊤ => C.limitStage hr hL | (i : ι) => C.stage i /-- The old links and the canonical links into the completed limit. -/ +@[expose] noncomputable def appendLimitLink (hr : 0 < r) (hL : 0 < L) (i j : WithTop ι) (hij : i ≤ j) : ProtectedLink (C.appendLimitStage hr hL i) @@ -56,6 +58,7 @@ noncomputable def appendLimitLink (hr : 0 < r) (hL : 0 < L) | coe i => exact C.link i j (by simpa using hij) /-- Adjoin the completed direct limit as one new top stage. -/ +@[expose] noncomputable def appendLimit (hr : 0 < r) (hL : 0 < L) : ProtectedChain (ι := WithTop ι) r L where stage := C.appendLimitStage hr hL diff --git a/LeanPool/ScottishBook155/ProtectedChainReindex.lean b/LeanPool/ScottishBook155/ProtectedChainReindex.lean index f338aae2b3..aaa780285a 100644 --- a/LeanPool/ScottishBook155/ProtectedChainReindex.lean +++ b/LeanPool/ScottishBook155/ProtectedChainReindex.lean @@ -12,7 +12,7 @@ public import LeanPool.ScottishBook155.ProtectedChain # Reindexing coherent protected chains -/ -@[expose] public section +public section namespace ScottishBook155 @@ -25,6 +25,7 @@ variable {r L : ℝ} /-- The canonical inclusion of an ordered type into the same type with a new top element. -/ +@[expose] noncomputable def withTopCoeOrderEmbedding {ι : Type u} [LinearOrder ι] : ι ↪o WithTop ι where toFun := fun i => i @@ -32,6 +33,7 @@ noncomputable def withTopCoeOrderEmbedding {ι : Type u} [LinearOrder ι] : map_rel_iff' := by intro i j; simp /-- Pull a protected chain back along an order embedding. -/ +@[expose] noncomputable def reindex (C : ProtectedChain (ι := ι) r L) (e : κ ↪o ι) : ProtectedChain (ι := κ) r L where stage k := C.stage (e k) diff --git a/LeanPool/ScottishBook155/ProtectedChainSingleton.lean b/LeanPool/ScottishBook155/ProtectedChainSingleton.lean index c736e4ea70..9f66b00a36 100644 --- a/LeanPool/ScottishBook155/ProtectedChainSingleton.lean +++ b/LeanPool/ScottishBook155/ProtectedChainSingleton.lean @@ -12,13 +12,14 @@ public import LeanPool.ScottishBook155.ProtectedChain # Constant coherent protected chains -/ -@[expose] public section +public section namespace ScottishBook155 universe u /-- A constant family of one protected stage is a coherent chain. -/ +@[expose] noncomputable def constantProtectedChain {ι : Type u} [LinearOrder ι] {r L : ℝ} (S : ProtectedStage.{u} r) : ProtectedChain (ι := ι) r L where diff --git a/LeanPool/ScottishBook155/ProtectedChainSuccessor.lean b/LeanPool/ScottishBook155/ProtectedChainSuccessor.lean index c6cfcd71b5..bc023f4fca 100644 --- a/LeanPool/ScottishBook155/ProtectedChainSuccessor.lean +++ b/LeanPool/ScottishBook155/ProtectedChainSuccessor.lean @@ -16,7 +16,7 @@ This file packages the successor clause independently of the transfinite recursion. The new index is the top point of `WithTop ι`. -/ -@[expose] public section +public section namespace ScottishBook155 @@ -29,6 +29,7 @@ variable {r L : ℝ} (C : ProtectedChain (ι := ι) r L) /-- The coherent systems of a chain give a protected link between any two comparable stages. -/ +@[expose] noncomputable def link (i j : ι) (hij : i ≤ j) : ProtectedLink (C.stage i) (C.stage j) L where sourceEmbedding := C.sourceSystem.embed i j hij @@ -45,6 +46,7 @@ noncomputable def link (i j : ι) (hij : i ≤ j) : variable {C} /-- The stage family obtained by adjoining a new top stage. -/ +@[expose] noncomputable def appendStage (T : ProtectedTransition (C.stage ⊤) L) : WithTop ι → ProtectedStage.{u} r @@ -52,6 +54,7 @@ noncomputable def appendStage | (i : ι) => C.stage i /-- Links in the chain with one new top stage. -/ +@[expose] noncomputable def appendLink (T : ProtectedTransition (C.stage ⊤) L) (i j : WithTop ι) (hij : i ≤ j) : @@ -83,6 +86,7 @@ theorem appendLink_top_top appendLink T ⊤ ⊤ le_rfl = ProtectedLink.refl T.next := rfl /-- The coherent protected chain after one successor transition. -/ +@[expose] noncomputable def append (T : ProtectedTransition (C.stage ⊤) L) : ProtectedChain (ι := WithTop ι) r L where diff --git a/LeanPool/ScottishBook155/ProtectedChainTransport.lean b/LeanPool/ScottishBook155/ProtectedChainTransport.lean index 7f532d4fb7..d8f8530733 100644 --- a/LeanPool/ScottishBook155/ProtectedChainTransport.lean +++ b/LeanPool/ScottishBook155/ProtectedChainTransport.lean @@ -17,19 +17,21 @@ propositionally equal. These pointwise transport operations keep all large dependent elimination out of the coherence proofs. -/ -@[expose] public section +public section namespace ScottishBook155 namespace ProtectedStage /-- Transport a source point along equality of protected stages. -/ +@[expose] noncomputable def castSourcePoint {r : ℝ} {A B : ProtectedStage.{0} r} (h : A = B) : A.source → B.source := by subst B exact id /-- Transport a target point along equality of protected stages. -/ +@[expose] noncomputable def castTargetPoint {r : ℝ} {A B : ProtectedStage.{0} r} (h : A = B) : A.target → B.target := by subst B @@ -94,6 +96,7 @@ end ProtectedStage namespace ProtectedLink /-- Change the source stage of a protected link along an equality. -/ +@[expose] noncomputable def castSource {r L : ℝ} {A A' B : ProtectedStage.{0} r} (h : A = A') (P : ProtectedLink A B L) : ProtectedLink A' B L := by diff --git a/LeanPool/ScottishBook155/ProtectedEnvelope.lean b/LeanPool/ScottishBook155/ProtectedEnvelope.lean index 5c6948c94a..4a8583135b 100644 --- a/LeanPool/ScottishBook155/ProtectedEnvelope.lean +++ b/LeanPool/ScottishBook155/ProtectedEnvelope.lean @@ -18,7 +18,7 @@ all selected exact distances. The collapsed-quotient Kuratowski coordinate separates the remaining pairs without changing those metric estimates. -/ -@[expose] public section +public section namespace ScottishBook155 @@ -37,6 +37,7 @@ abbrev ProtectedEnvelopeAmbient (P : Type u) (N : Type v) [MetricSpace P] /-- A generating point with an arbitrary old-target coordinate. Allowing the first coordinate to vary independently ensures that every retractive metric embedding lands in the same closed linear span. -/ +@[expose] noncomputable def protectedEnvelopeGenerator {P : Type u} {N : Type v} [MetricSpace P] [NormedAddCommGroup N] [NormedSpace ℝ N] (j : N → P) (z : N × P) : ProtectedEnvelopeAmbient P N j := @@ -92,12 +93,14 @@ noncomputable def protectedEnvelopeSequenceEmbedding {P : Type u} {N : Type v} (protectedEnvelopeDenseMap_denseRange j) /-- The raw metric coordinate in the ambient product. -/ +@[expose] noncomputable def protectedEnvelopeEmbeddingAmbient {P : Type u} {N : Type v} [MetricSpace P] [NormedAddCommGroup N] [NormedSpace ℝ N] (j : N → P) (R : P → N) (p : P) : ProtectedEnvelopeAmbient P N j := combinedEmbedding (retractiveEmbedding j R) (Set.range j) (j 0) p /-- The final metric embedding, based at the zero point of the old target. -/ +@[expose] noncomputable def protectedEnvelopeEmbedding {P : Type u} {N : Type v} [MetricSpace P] [NormedAddCommGroup N] [NormedSpace ℝ N] (j : N → P) (R : P → N) (p : P) : ProtectedEnvelope P N j := @@ -107,6 +110,7 @@ noncomputable def protectedEnvelopeEmbedding {P : Type u} {N : Type v} exact Submodule.subset_span ⟨(R p, p), rfl⟩⟩ /-- The raw old-target embedding in the ambient product. -/ +@[expose] noncomputable def protectedTargetLinearAmbient {P : Type u} {N : Type v} [MetricSpace P] [NormedAddCommGroup N] [NormedSpace ℝ N] (j : N → P) : N →ₗ[ℝ] ProtectedEnvelopeAmbient P N j where @@ -128,6 +132,7 @@ theorem protectedEnvelopeGenerator_target {P : Type u} {N : Type v} · rfl /-- The old target embeds linearly into the density-controlled envelope. -/ +@[expose] noncomputable def protectedTargetLinear {P : Type u} {N : Type v} [MetricSpace P] [NormedAddCommGroup N] [NormedSpace ℝ N] (j : N → P) : N →ₗ[ℝ] ProtectedEnvelope P N j where @@ -160,6 +165,7 @@ noncomputable def protectedTargetLinearIsometry {P : Type u} {N : Type v} norm_map' := norm_protectedTargetLinear_eq j /-- Projection through the first two product coordinates. -/ +@[expose] noncomputable def protectedEnvelopeProjection {P : Type u} {N : Type v} [MetricSpace P] [NormedAddCommGroup N] [NormedSpace ℝ N] (j : N → P) : ProtectedEnvelope P N j →L[ℝ] N := diff --git a/LeanPool/ScottishBook155/ProtectedExtension.lean b/LeanPool/ScottishBook155/ProtectedExtension.lean index e0f49e7ace..ed10fa9acb 100644 --- a/LeanPool/ScottishBook155/ProtectedExtension.lean +++ b/LeanPool/ScottishBook155/ProtectedExtension.lean @@ -16,7 +16,7 @@ This module formalizes the scalar cutoff from the last part of Lipschitz-free-space construction. -/ -@[expose] public section +public section namespace ScottishBook155 diff --git a/LeanPool/ScottishBook155/ProtectedExtensionAssembly.lean b/LeanPool/ScottishBook155/ProtectedExtensionAssembly.lean index 94a0a99b51..be27dc01b0 100644 --- a/LeanPool/ScottishBook155/ProtectedExtensionAssembly.lean +++ b/LeanPool/ScottishBook155/ProtectedExtensionAssembly.lean @@ -18,7 +18,7 @@ target embeddings and the linear recovery map together with the properties used by the successor construction. -/ -@[expose] public section +public section namespace ScottishBook155 @@ -29,6 +29,7 @@ noncomputable section universe u v /-- The canonical copy of the old source as the zero-height hyperplane. -/ +@[expose] noncomputable def protectedSourceBaseLinearIsometry {M : Type u} [NormedAddCommGroup M] [NormedSpace ℝ M] : M →ₗᵢ[ℝ] OneSum M where @@ -49,6 +50,7 @@ abbrev ProtectedExtensionSpace (adjunctionTargetMk V a y H hattach) /-- The map from the extended source into the protected envelope of the adjunction. -/ +@[expose] noncomputable def protectedExtensionSourceEmbedding {M : Type u} {N : Type v} [NormedAddCommGroup M] [NormedAddCommGroup N] [NormedSpace ℝ N] (V : M → N) (a : M) (y : N) (L H : ℝ) @@ -63,6 +65,7 @@ noncomputable def protectedExtensionSourceEmbedding (adjunctionSourceMk V a y H hattach x) /-- The linear embedding of the original target into the protected extension space. -/ +@[expose] noncomputable def protectedExtensionTargetLinear {M : Type u} {N : Type v} [NormedAddCommGroup M] [NormedAddCommGroup N] [NormedSpace ℝ N] (V : M → N) (a : M) (y : N) (H : ℝ) @@ -73,6 +76,7 @@ noncomputable def protectedExtensionTargetLinear /-- The continuous linear projection from the protected extension back to the original target. -/ +@[expose] noncomputable def protectedExtensionProjection {M : Type u} {N : Type v} [NormedAddCommGroup M] [NormedAddCommGroup N] [NormedSpace ℝ N] (V : M → N) (a : M) (y : N) (H : ℝ) @@ -90,6 +94,7 @@ theorem protectedExtensionTargetLinear_norm exact norm_protectedTargetLinear_eq _ n /-- The assembled old-target map is a linear isometric embedding. -/ +@[expose] noncomputable def protectedExtensionTargetLinearIsometry {M : Type u} {N : Type v} [NormedAddCommGroup M] [NormedAddCommGroup N] [NormedSpace ℝ N] (V : M → N) (a : M) (y : N) (H : ℝ) diff --git a/LeanPool/ScottishBook155/ProtectedExtensionTheorem.lean b/LeanPool/ScottishBook155/ProtectedExtensionTheorem.lean index 2fb44a145f..5067a23f68 100644 --- a/LeanPool/ScottishBook155/ProtectedExtensionTheorem.lean +++ b/LeanPool/ScottishBook155/ProtectedExtensionTheorem.lean @@ -16,7 +16,7 @@ inequalities. Here the height is chosen and the resulting properties are packaged in the hypothesis form of the manuscript's protected-extension lemma. -/ -@[expose] public section +public section namespace ScottishBook155 diff --git a/LeanPool/ScottishBook155/RecursionCardinal.lean b/LeanPool/ScottishBook155/RecursionCardinal.lean index 75ac59854e..45373d4b89 100644 --- a/LeanPool/ScottishBook155/RecursionCardinal.lean +++ b/LeanPool/ScottishBook155/RecursionCardinal.lean @@ -17,7 +17,7 @@ for the recursion. The identities below are precisely the cardinal arithmetic used in the manuscript. -/ -@[expose] public section +public section namespace ScottishBook155 @@ -26,6 +26,7 @@ open scoped Cardinal universe u /-- Uniform cardinal bound for every Banach stage. -/ +@[expose] def stageCardinal : Cardinal := 2 ^ Cardinal.continuum /-- Regular successor cardinal indexing the final recursion. -/ diff --git a/LeanPool/ScottishBook155/RegularDirectLimit.lean b/LeanPool/ScottishBook155/RegularDirectLimit.lean index b0a1b7a4f9..8c80defcdb 100644 --- a/LeanPool/ScottishBook155/RegularDirectLimit.lean +++ b/LeanPool/ScottishBook155/RegularDirectLimit.lean @@ -17,7 +17,7 @@ the manuscript's assertion that a countable Cauchy sequence is contained in one earlier stage. -/ -@[expose] public section +public section namespace ScottishBook155 diff --git a/LeanPool/ScottishBook155/RelativeEnvelope.lean b/LeanPool/ScottishBook155/RelativeEnvelope.lean index f839aa2181..4ce52628ca 100644 --- a/LeanPool/ScottishBook155/RelativeEnvelope.lean +++ b/LeanPool/ScottishBook155/RelativeEnvelope.lean @@ -26,7 +26,7 @@ admissible functionals to prove that the induced linear copy of the old space is isometric. -/ -@[expose] public section +public section namespace ScottishBook155 @@ -47,6 +47,7 @@ structure RelativeFunctional (P : Type u) (N : Type v) [MetricSpace P] agree : ∀ n, value (j n) = linear n /-- Evaluation on all admissible relative functionals, normalized at `j 0`. -/ +@[expose] noncomputable def relativeEvaluation {P : Type u} {N : Type v} [MetricSpace P] [NormedAddCommGroup N] [NormedSpace ℝ N] (j : N → P) (p : P) : ℓ^∞(RelativeFunctional P N j, ℝ) := @@ -92,6 +93,7 @@ theorem relativeEvaluation_target_apply {P : Type u} {N : Type v} [MetricSpace P simp [relativeEvaluation_apply, φ.agree] /-- The distinguished old space maps linearly into the relative coordinate. -/ +@[expose] noncomputable def relativeTargetLinear {P : Type u} {N : Type v} [MetricSpace P] [NormedAddCommGroup N] [NormedSpace ℝ N] (j : N → P) : N →ₗ[ℝ] ℓ^∞(RelativeFunctional P N j, ℝ) where diff --git a/LeanPool/ScottishBook155/RetractiveEnvelope.lean b/LeanPool/ScottishBook155/RetractiveEnvelope.lean index aef36a93eb..d517882d28 100644 --- a/LeanPool/ScottishBook155/RetractiveEnvelope.lean +++ b/LeanPool/ScottishBook155/RetractiveEnvelope.lean @@ -16,7 +16,7 @@ envelope. Adjoining the old target as a max-product coordinate makes the retraction linear and explicit: it is first-coordinate projection. -/ -@[expose] public section +public section namespace ScottishBook155 @@ -31,12 +31,14 @@ abbrev RetractiveEnvelope (P : Type u) (N : Type v) [MetricSpace P] /-- Embed the attached metric space using a chosen metric retraction and the relative evaluation coordinate. -/ +@[expose] noncomputable def retractiveEmbedding {P : Type u} {N : Type v} [MetricSpace P] [NormedAddCommGroup N] [NormedSpace ℝ N] (j : N → P) (R : P → N) (p : P) : RetractiveEnvelope P N j := (R p, relativeEvaluation j p) /-- The old target embeds linearly in both coordinates. -/ +@[expose] noncomputable def retractiveTargetLinear {P : Type u} {N : Type v} [MetricSpace P] [NormedAddCommGroup N] [NormedSpace ℝ N] (j : N → P) : N →ₗ[ℝ] RetractiveEnvelope P N j where @@ -51,6 +53,7 @@ theorem norm_retractiveTargetLinear_eq {P : Type u} {N : Type v} [MetricSpace P] exact max_eq_left (norm_relativeTargetLinear_le j n) /-- The old target is a linear isometric subspace of the retractive envelope. -/ +@[expose] noncomputable def retractiveTargetLinearIsometry {P : Type u} {N : Type v} [MetricSpace P] [NormedAddCommGroup N] [NormedSpace ℝ N] (j : N → P) : N →ₗᵢ[ℝ] RetractiveEnvelope P N j where @@ -58,6 +61,7 @@ noncomputable def retractiveTargetLinearIsometry {P : Type u} {N : Type v} norm_map' := norm_retractiveTargetLinear_eq j /-- First-coordinate projection is the contractive linear retraction. -/ +@[expose] noncomputable def retractiveProjection {P : Type u} {N : Type v} [MetricSpace P] [NormedAddCommGroup N] [NormedSpace ℝ N] (j : N → P) : RetractiveEnvelope P N j →L[ℝ] N := diff --git a/LeanPool/ScottishBook155/ScheduledSuccessor.lean b/LeanPool/ScottishBook155/ScheduledSuccessor.lean index f5ccc270c3..5b405f9059 100644 --- a/LeanPool/ScottishBook155/ScheduledSuccessor.lean +++ b/LeanPool/ScottishBook155/ScheduledSuccessor.lean @@ -17,7 +17,7 @@ which case the transition is idle, or it is added by the protected one-point extension. -/ -@[expose] public section +public section namespace ScottishBook155 diff --git a/LeanPool/ScottishBook155/StageSystem.lean b/LeanPool/ScottishBook155/StageSystem.lean index a163e7b7e5..a007d07a16 100644 --- a/LeanPool/ScottishBook155/StageSystem.lean +++ b/LeanPool/ScottishBook155/StageSystem.lean @@ -16,7 +16,7 @@ This file packages exactly the data exported by the protected one-point extension in the form needed by the transfinite construction. -/ -@[expose] public section +public section namespace ScottishBook155 @@ -60,11 +60,13 @@ structure ProtectedSuccessor {r : ℝ} (S : ProtectedStage.{u} r) targetRetraction (next.map (sourceEquiv (toLp 1 (m, s)))) = S.map m /-- The canonical old-source embedding into an l-one successor source. -/ +@[expose] noncomputable def oneSumSourceEmbedding (M : RealBanachSpace.{u}) : M →ₗᵢ[ℝ] OneSum M := protectedSourceBaseLinearIsometry /-- The source embedding associated to a protected successor. -/ +@[expose] noncomputable def ProtectedSuccessor.sourceEmbedding {r L : ℝ} {S : ProtectedStage.{u} r} {y : S.target} (P : ProtectedSuccessor S L y) : S.source →ₗᵢ[ℝ] P.next.source := @@ -147,6 +149,7 @@ structure ProtectedTransition {r : ℝ} (S : ProtectedStage.{u} r) (L : ℝ) whe targetProjection (next.map z) = S.map (sourceProjection z) /-- An active protected successor as a uniform transition. -/ +@[expose] noncomputable def ProtectedSuccessor.toTransition {r L : ℝ} {S : ProtectedStage.{u} r} {y : S.target} (P : ProtectedSuccessor S L y) : ProtectedTransition S L where @@ -182,6 +185,7 @@ noncomputable def ProtectedSuccessor.toTransition recovers := P.recovers_of_dist_le /-- The idle successor transition. -/ +@[expose] noncomputable def idleTransition {r L : ℝ} (S : ProtectedStage.{u} r) : ProtectedTransition S L where next := S @@ -199,6 +203,7 @@ noncomputable def idleTransition {r L : ℝ} (S : ProtectedStage.{u} r) : /-- Claim 13 supplies every active successor transition required by the claim-14 recursion. -/ +@[expose] noncomputable def protectedSuccessor {r L : ℝ} (hr : 0 < r) (hL : 0 < L) (S : ProtectedStage.{u} r) (y : S.target) (hy : y ∉ Set.range S.map) : diff --git a/LeanPool/ScottishBook155/SuccessorCardinal.lean b/LeanPool/ScottishBook155/SuccessorCardinal.lean index fbb0a7ed3b..68464f9561 100644 --- a/LeanPool/ScottishBook155/SuccessorCardinal.lean +++ b/LeanPool/ScottishBook155/SuccessorCardinal.lean @@ -13,7 +13,7 @@ public import LeanPool.ScottishBook155.StageSystem # Cardinal bounds for protected successors -/ -@[expose] public section +public section namespace ScottishBook155 diff --git a/LeanPool/ScottishBook155/TransfiniteConstruction.lean b/LeanPool/ScottishBook155/TransfiniteConstruction.lean index 453fb8ee62..8145b3bd25 100644 --- a/LeanPool/ScottishBook155/TransfiniteConstruction.lean +++ b/LeanPool/ScottishBook155/TransfiniteConstruction.lean @@ -20,7 +20,7 @@ schedule, limit stages glue and complete the earlier prefixes, and the resulting scheduled chain supplies the unconditional witness for `Claim14`. -/ -@[expose] public section +public section namespace ScottishBook155 @@ -270,6 +270,7 @@ end ProtectedPrefix open CategoryTheory Opposite /-- The inverse system of protected prefixes under restriction. -/ +@[expose] noncomputable def protectedPrefixFunctor : RIᵒᵖ ⥤ Type 1 where obj j := ProtectedPrefix j.unop map {X Y} f := ↾(fun P : ProtectedPrefix X.unop => @@ -345,6 +346,7 @@ noncomputable def protectedPrefixSection : protectedPrefixFunctor.sections := protectedPrefixInductionData.sectionsMk seedPrefix /-- The canonical bounded prefix ending at `j`. -/ +@[expose] noncomputable def canonicalPrefix (j : RI) : ProtectedPrefix j := protectedPrefixSection.val (op j) @@ -387,7 +389,7 @@ structure CompatiblePrefixSequence where ((item _j).restriction hij).chain = (item _i).chain /-- The canonical transfinite section as a coherent prefix sequence. -/ -noncomputable def canonicalPrefixSequence : CompatiblePrefixSequence where +@[expose] noncomputable def canonicalPrefixSequence : CompatiblePrefixSequence where item := canonicalPrefix coherent _ _ hij := congrArg ProtectedPrefix.chain (canonicalPrefix_restriction hij) @@ -397,6 +399,7 @@ namespace CompatiblePrefixSequence variable (G : CompatiblePrefixSequence) /-- Restrict a global prefix sequence to indices below `j`. -/ +@[expose] noncomputable def below (j : RI) : CompatiblePrefixFamily j where item i := G.item i.1 coherent i k hik := G.coherent i.1 k.1 hik @@ -407,6 +410,7 @@ abbrev stage (i : RI) : ProtectedStage.{0} ((1 : ℝ) / 2) := /-- The protected link between two stages, obtained from coherence of their closed prefixes. -/ +@[expose] noncomputable def link (i j : RI) (hij : i ≤ j) : ProtectedLink (G.stage i) (G.stage j) 1 := (G.item i).linkOfRestriction (G.item j) hij (G.coherent i j hij) @@ -521,6 +525,7 @@ theorem targetProjection_embed (a i j : RI) (hai : a ≤ i) (hij : i ≤ j) /-- Glue a coherent sequence of closed prefixes into one protected chain on the whole recursion order. -/ +@[expose] noncomputable def toProtectedChain : ProtectedChain (ι := RI) ((1 : ℝ) / 2) 1 where stage := G.stage @@ -546,6 +551,7 @@ noncomputable def toProtectedChain : end CompatiblePrefixSequence /-- The global coherent protected chain produced by the transfinite section. -/ +@[expose] noncomputable def canonicalProtectedChain : ProtectedChain (ι := RI) ((1 : ℝ) / 2) 1 := canonicalPrefixSequence.toProtectedChain diff --git a/LeanPool/ScottishBook155/TransfinitePrefix.lean b/LeanPool/ScottishBook155/TransfinitePrefix.lean index 05a5e685c6..e160b9b23f 100644 --- a/LeanPool/ScottishBook155/TransfinitePrefix.lean +++ b/LeanPool/ScottishBook155/TransfinitePrefix.lean @@ -18,7 +18,7 @@ public import LeanPool.ScottishBook155.LimitCardinal # Cardinal-controlled protected prefixes -/ -@[expose] public section +public section namespace ScottishBook155 @@ -49,6 +49,7 @@ abbrev topStage : ProtectedStage.{0} ((1 : ℝ) / 2) := P.chain.stage ⟨j, show j ≤ j from le_rfl⟩ /-- The canonical recursion-indexed enumeration at a stage of a prefix. -/ +@[expose] noncomputable def enumerate (i : Set.Iic j) : RI → (P.chain.stage i).target := stageEnumeration (P.target_mk_le i) @@ -57,12 +58,14 @@ theorem enumerate_surjective (i : Set.Iic j) : stageEnumeration_surjective (P.target_mk_le i) /-- The bent seed as the bounded prefix at the minimum recursion index. -/ +@[expose] noncomputable def ofMin (j : RI) (_hj : IsMin j) : ProtectedPrefix j where chain := constantProtectedChain bentSeedStage source_mk_le := fun _ ↦ bentSeedStage_source_mk_le target_mk_le := fun _ ↦ bentSeedStage_target_mk_le /-- Append one scheduled successor to a bounded prefix. -/ +@[expose] noncomputable def successor (P : ProtectedPrefix j) (y : P.topStage.target) : ProtectedPrefix (Order.succ j) := by let T := scheduledSuccessor P.topStage y @@ -92,6 +95,7 @@ noncomputable def successor (P : ProtectedPrefix j) (y : P.topStage.target) : target_mk_le := fun i ↦ hTarget (e i) } /-- Append the completed direct limit at a nonzero limit index. -/ +@[expose] noncomputable def ofLimit (j : RI) (hj : Order.IsSuccLimit j) (C : ProtectedChain (ι := Set.Iio j) ((1 : ℝ) / 2) 1) (hSource : ∀ i, Cardinal.mk (C.stage i).source ≤ stageCardinal) @@ -127,6 +131,7 @@ noncomputable def ofLimit (j : RI) (hj : Order.IsSuccLimit j) target_mk_le := fun i ↦ hTargetPlus (e i) } /-- Restrict a bounded prefix to an earlier closed initial segment. -/ +@[expose] noncomputable def restriction {i : RI} (hij : i ≤ j) : ProtectedPrefix i where chain := P.chain.reindex ⟨⟨fun k ↦ (⟨k.1, k.2.trans hij⟩ : Set.Iic j), 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/Sendov/Analytic/Defect.lean b/LeanPool/Sendov/Analytic/Defect.lean index 000f23fb2d..8620fc73f9 100644 --- a/LeanPool/Sendov/Analytic/Defect.lean +++ b/LeanPool/Sendov/Analytic/Defect.lean @@ -42,7 +42,7 @@ is therefore avoided. * `Sendov.defect`: the lemma. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/Analytic/Jsum.lean b/LeanPool/Sendov/Analytic/Jsum.lean index 991df0c734..6d3143191b 100644 --- a/LeanPool/Sendov/Analytic/Jsum.lean +++ b/LeanPool/Sendov/Analytic/Jsum.lean @@ -35,7 +35,7 @@ since the `qⱼ` are reciprocals and never vanish. * `Sendov.prod_mul_sum_inv`: `(∏ s) ∑ⱼ 1/sⱼ = sumEraseProd s` when no `sⱼ` vanishes. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/Analytic/LowDegree.lean b/LeanPool/Sendov/Analytic/LowDegree.lean index 5e94a9da3a..a24ca3e639 100644 --- a/LeanPool/Sendov/Analytic/LowDegree.lean +++ b/LeanPool/Sendov/Analytic/LowDegree.lean @@ -37,7 +37,7 @@ equality examples. * `Sendov.lowJ_lt_one`: `J_m(a) < 1` for `0 < a < 1` and `1 ≤ m ≤ 4`. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/Analytic/Maclaurin.lean b/LeanPool/Sendov/Analytic/Maclaurin.lean index 8b62f7ac01..0d5d213f48 100644 --- a/LeanPool/Sendov/Analytic/Maclaurin.lean +++ b/LeanPool/Sendov/Analytic/Maclaurin.lean @@ -45,7 +45,7 @@ Neither statement mentions anything Sendov-specific; both are candidates for ups * `Sendov.Multiset.esymm_card_pred_le`: `e_{N-1}(s) ≤ N (mean s)^{N-1}`. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/Analytic/Origin.lean b/LeanPool/Sendov/Analytic/Origin.lean index c0850f6264..c18ff3c5d3 100644 --- a/LeanPool/Sendov/Analytic/Origin.lean +++ b/LeanPool/Sendov/Analytic/Origin.lean @@ -53,7 +53,7 @@ splits that into the main term `(∑ⱼ qⱼ) F(t)` plus `a t` times the case `g the residual actually being estimated. -/ -@[expose] public section +public section namespace Sendov @@ -277,6 +277,7 @@ lemma norm_sumEraseProdC_le (g f : ℂ → ℂ) : ∀ (s : Multiset ℂ), (∀ v nlinarith [ih ht, norm_nonneg (f v), norm_nonneg (sumEraseProdC t g f), h2, hv] /-- `F(t) = ∏ⱼ (1 - a t qⱼ)`. -/ +@[expose] noncomputable def Fprod (a : ℝ) (q : Multiset ℂ) (t : ℝ) : ℂ := (q.map (fun v => 1 - (a : ℂ) * (t : ℂ) * v)).prod diff --git a/LeanPool/Sendov/Analytic/OriginExact.lean b/LeanPool/Sendov/Analytic/OriginExact.lean index ad07bcba6a..bc7d5f6488 100644 --- a/LeanPool/Sendov/Analytic/OriginExact.lean +++ b/LeanPool/Sendov/Analytic/OriginExact.lean @@ -36,7 +36,7 @@ The chain is: * `Sendov.grow`: the lower bound `‖W‖ ≥ 2an/(n-1)`. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/Analytic/Polar.lean b/LeanPool/Sendov/Analytic/Polar.lean index d7c0db8d44..58eafbf73d 100644 --- a/LeanPool/Sendov/Analytic/Polar.lean +++ b/LeanPool/Sendov/Analytic/Polar.lean @@ -40,7 +40,7 @@ and `p'(a) ≠ 0` is never needed. * `Sendov.one_le_integral_prod_norm`: the branch point `(⋆)`. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/Boundary.lean b/LeanPool/Sendov/Boundary.lean index 2b5f22f5b2..91be9258d6 100644 --- a/LeanPool/Sendov/Boundary.lean +++ b/LeanPool/Sendov/Boundary.lean @@ -46,7 +46,7 @@ interior argument. * `Sendov.boundary_reciprocal`: `(BR)`, in division-free form. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/Common/Basic.lean b/LeanPool/Sendov/Common/Basic.lean index 3d07064288..e6defba7de 100644 --- a/LeanPool/Sendov/Common/Basic.lean +++ b/LeanPool/Sendov/Common/Basic.lean @@ -22,7 +22,7 @@ degree-specific argument. The two facts that matter are: `A - 2 * c = B - 1 < 0`, which is what gives `Sendov.Q_le_one`. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/Common/Chord.lean b/LeanPool/Sendov/Common/Chord.lean index a6397954f2..bc3f5e4e13 100644 --- a/LeanPool/Sendov/Common/Chord.lean +++ b/LeanPool/Sendov/Common/Chord.lean @@ -34,7 +34,7 @@ downstream of the Gamma bound stays valid. * `Sendov.integral_le_tail_lin`, `Sendov.integral_le_tail_cube`: the two instances used. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/Common/Quadratic.lean b/LeanPool/Sendov/Common/Quadratic.lean index a65a38cefc..d54b18a9b4 100644 --- a/LeanPool/Sendov/Common/Quadratic.lean +++ b/LeanPool/Sendov/Common/Quadratic.lean @@ -36,11 +36,12 @@ matters, because `A` is genuinely negative in parts of the range. * `Sendov.QQ_le_at_one`: `QQ t ≤ QQ 1` above it. -/ -@[expose] public section +public section namespace Sendov /-- The quadratic `1 - 2ct + At²`. -/ +@[expose] noncomputable def QQ (c A t : ℝ) : ℝ := 1 - 2 * c * t + A * t ^ 2 /-- `Sendov.Q` is an instance of `Sendov.QQ`. Stated before the section variables below, diff --git a/LeanPool/Sendov/Common/Rpow.lean b/LeanPool/Sendov/Common/Rpow.lean index 0a0d33b753..28a95fb87d 100644 --- a/LeanPool/Sendov/Common/Rpow.lean +++ b/LeanPool/Sendov/Common/Rpow.lean @@ -26,7 +26,7 @@ In particular: the large-degree reduction. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/Common/Sinh.lean b/LeanPool/Sendov/Common/Sinh.lean index 9d79cdc418..a4e6d4ef8d 100644 --- a/LeanPool/Sendov/Common/Sinh.lean +++ b/LeanPool/Sendov/Common/Sinh.lean @@ -60,7 +60,7 @@ identity and eight applications of "vanishes at `0` and has nonnegative derivati * `Sendov.sinh_le_mul_exp`: the form actually used, `sinh h ≤ h exp (√(h²+9) - 3)`. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/Conjecture.lean b/LeanPool/Sendov/Conjecture.lean index 14ec8509a6..e17158e759 100644 --- a/LeanPool/Sendov/Conjecture.lean +++ b/LeanPool/Sendov/Conjecture.lean @@ -35,7 +35,7 @@ Three cases, by the position of `a`: * `Sendov.sendov`: Sendov's conjecture. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/Counterexample/Factor.lean b/LeanPool/Sendov/Counterexample/Factor.lean index c87406a381..39d752481b 100644 --- a/LeanPool/Sendov/Counterexample/Factor.lean +++ b/LeanPool/Sendov/Counterexample/Factor.lean @@ -40,7 +40,7 @@ rewriting unfolds again. An opaque local is what is wanted. * `Sendov.exists_crit_multiset`: the factorization of `p'` over the reciprocal coordinates `q`. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/Counterexample/Identities.lean b/LeanPool/Sendov/Counterexample/Identities.lean index a3ce553ddb..090cc8b627 100644 --- a/LeanPool/Sendov/Counterexample/Identities.lean +++ b/LeanPool/Sendov/Counterexample/Identities.lean @@ -35,7 +35,7 @@ formalized: no junk value of `0⁻¹` is ever evaluated. * `Sendov.second_origin_identity`. -/ -@[expose] public section +public section namespace Sendov @@ -44,6 +44,7 @@ open Polynomial Multiset open scoped Classical in /-- `∑ⱼ ∏_{k≠j} sₖ`. This is `(∏ s) · (∑ⱼ 1/sⱼ)` with the denominators cleared, and unlike that expression it is well defined when some `sⱼ` vanishes. -/ +@[expose] noncomputable def sumEraseProd (s : Multiset ℂ) : ℂ := (s.map (fun j => (s.erase j).prod)).sum diff --git a/LeanPool/Sendov/Defs.lean b/LeanPool/Sendov/Defs.lean index 1b9f1b53ae..70b2f4421f 100644 --- a/LeanPool/Sendov/Defs.lean +++ b/LeanPool/Sendov/Defs.lean @@ -86,28 +86,33 @@ and `R 97 17 ≈ 0.2921`. The feasibility constraint is binding at low degree: * T. Tao, *A digestion of the proof of Sendov's conjecture*, blog post, 2026. -/ -@[expose] public section +public section namespace Sendov /-- `M n = n - 1`. All of the quantities below are naturally expressed in terms of it. -/ +@[expose] noncomputable def M (n : ℕ) : ℝ := (n : ℝ) - 1 /-- `A n α = a ^ 2 = 1 - 2α/(n-1)`, from the definition `α = (n-1)(1-a²)/2` of `α`. The blog post's `a ^ 4` is therefore `A n α ^ 2`. -/ +@[expose] noncomputable def A (n : ℕ) (α : ℝ) : ℝ := 1 - 2 * α / M n /-- `c n α = 1 - α/(n-1) - α/(2(3+α))`: the value taken by `a * x` after the substitution of `α/(3+α)` for `β(1)`. This is `c(α)` in the blog post. -/ +@[expose] noncomputable def c (n : ℕ) (α : ℝ) : ℝ := 1 - α / M n - α / (2 * (3 + α)) /-- `Q n α t = 1 - 2 c t + A t ^ 2`: the quadratic replacing `β(t) = 1 - 2 a x t + a² t²` after the substitution of `α/(3+α)` for `β(1)`. Note `Q n α 1 = α/(3+α)`. -/ +@[expose] noncomputable def Q (n : ℕ) (α : ℝ) (t : ℝ) : ℝ := 1 - 2 * c n α * t + A n α * t ^ 2 /-- `R n α` is the right-hand side of equation `stat` of the blog post: `1/6 + 1/(4(3+α)) + 1/(2(n-1)) + 1/(4(n-1)(3+α)) + a⁴ n (n-1) (n-2)/(4(3+α)) * ∫ t in 0..1, t³ (1 - 2c(α)t + a²t²) ^ ((n-4)/2)`. -/ +@[expose] noncomputable def R (n : ℕ) (α : ℝ) : ℝ := 1 / 6 + 1 / (4 * (3 + α)) + 1 / (2 * M n) + 1 / (4 * M n * (3 + α)) + A n α ^ 2 * n * M n * ((n : ℝ) - 2) / (4 * (3 + α)) * diff --git a/LeanPool/Sendov/FiniteRange/Batch.lean b/LeanPool/Sendov/FiniteRange/Batch.lean index 395ea374a7..1d8e47a39b 100644 --- a/LeanPool/Sendov/FiniteRange/Batch.lean +++ b/LeanPool/Sendov/FiniteRange/Batch.lean @@ -38,7 +38,7 @@ member, so a batch is cheaper than any single degree it covers except the first. * `Sendov.A_mono`: `A` increases with `n`. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/FiniteRange/Certificate.lean b/LeanPool/Sendov/FiniteRange/Certificate.lean index 0864c5fd4f..1cc0cc1512 100644 --- a/LeanPool/Sendov/FiniteRange/Certificate.lean +++ b/LeanPool/Sendov/FiniteRange/Certificate.lean @@ -29,23 +29,26 @@ Numerals beyond 90 digits cannot sit on one line; `Sendov.big` assembles them fr chunks. -/ -@[expose] public section +public section namespace Sendov /-- A large natural number assembled from little-endian chunks of at most 90 decimal digits, as an integer. -/ +@[expose] def big (chunks : List ℕ) : ℤ := (npev chunks (10 ^ 90) : ℤ) /-! ### Polynomial arithmetic on coefficient lists -/ /-- Scalar multiple of a dense integer polynomial. -/ +@[expose] def pscale (c : ℤ) (p : List ℤ) : List ℤ := p.map (fun a => c * a) lemma pev_pscale (c : ℤ) (p : List ℤ) (x : ℝ) : pev (pscale c p) x = (c : ℝ) * pev p x := pev_map_mul c p x /-- Difference of dense integer polynomials. -/ +@[expose] def psub (p q : List ℤ) : List ℤ := padd p (pscale (-1) q) lemma pev_psub (p q : List ℤ) (x : ℝ) : pev (psub p q) x = pev p x - pev q x := by @@ -54,6 +57,7 @@ lemma pev_psub (p q : List ℤ) (x : ℝ) : pev (psub p q) x = pev p x - pev q x ring /-- Power of a dense integer polynomial. -/ +@[expose] def ppow (p : List ℤ) : ℕ → List ℤ | 0 => [1] | k + 1 => pmul p (ppow p k) @@ -75,6 +79,7 @@ lemma pev_X (x : ℝ) : pev [0, 1] x = x := by simp [pev] /-- `bern p q d b` is `∑ⱼ bⱼ Xʲ (p - q X)^(d-j)` as a coefficient list, the entries of `b` being listed from `j = 0`. -/ +@[expose] def bern (p q : ℤ) : ℕ → List ℤ → List ℤ | _, [] => [] | d, a :: rest => padd (pscale a (ppow [p, -q] d)) (0 :: bern p q (d - 1) rest) @@ -153,11 +158,13 @@ theorem pev_pos_of_bern (P B : List ℤ) (p q : ℤ) (d : ℕ) (hp : 0 < p) (_hq /-- The denominator of the batch bound of `Sendov.R_le_batch`, after the moment substitution, as a polynomial in `α`: with `m₀ = n₀ - 1` and `m₁ = n₁ - 1`, `12 m₀ m₁² L (2m₀)^k (3+α)^(k+1)`. -/ +@[expose] def batchD (n₀ n₁ k : ℕ) (L : ℤ) : List ℤ := pscale (12 * ((n₀ : ℤ) - 1) * ((n₁ : ℤ) - 1) ^ 2 * L * (2 * ((n₀ : ℤ) - 1)) ^ k) (ppow [3, 1] (k + 1)) /-- The numerator of the batch bound over the denominator `Sendov.batchD`. -/ +@[expose] def batchN (n₀ n₁ k : ℕ) (L : ℤ) (Nmom : List ℤ) : List ℤ := padd (pscale (2 * ((n₀ : ℤ) - 1) * ((n₁ : ℤ) - 1) ^ 2 * (L * (2 * ((n₀ : ℤ) - 1)) ^ k)) (ppow [3, 1] (k + 1))) @@ -171,6 +178,7 @@ def batchN (n₀ n₁ k : ℕ) (L : ℤ) (Nmom : List ℤ) : List ℤ := (pmul (ppow [((n₁ : ℤ) - 1), -2] 2) Nmom))))) /-- The numerator of `1 - bound`: the polynomial that each batch certifies positive. -/ +@[expose] def batchP (n₀ n₁ k : ℕ) (L : ℤ) (Nmom : List ℤ) : List ℤ := psub (batchD n₀ n₁ k L) (batchN n₀ n₁ k L Nmom) diff --git a/LeanPool/Sendov/FiniteRange/Cover.lean b/LeanPool/Sendov/FiniteRange/Cover.lean index 41e303bf67..14991e3679 100644 --- a/LeanPool/Sendov/FiniteRange/Cover.lean +++ b/LeanPool/Sendov/FiniteRange/Cover.lean @@ -52,7 +52,7 @@ Degrees `5` and `7` are handled one at a time (`Sendov.finite_range_five`, is a single Bernstein certificate valid simultaneously for all `n₀ ≤ n ≤ n₁`. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/FiniteRange/Degree10To11.lean b/LeanPool/Sendov/FiniteRange/Degree10To11.lean index 384096e731..f6e1567bba 100644 --- a/LeanPool/Sendov/FiniteRange/Degree10To11.lean +++ b/LeanPool/Sendov/FiniteRange/Degree10To11.lean @@ -25,7 +25,7 @@ The moment numerator `Nmomc` is checked against the packed recurrence (`Sendov.pev_pos_of_bern`). Every closed computation is evaluated by the kernel. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/FiniteRange/Degree12To13.lean b/LeanPool/Sendov/FiniteRange/Degree12To13.lean index 91df0c964a..a49030c62a 100644 --- a/LeanPool/Sendov/FiniteRange/Degree12To13.lean +++ b/LeanPool/Sendov/FiniteRange/Degree12To13.lean @@ -25,7 +25,7 @@ The moment numerator `Nmomc` is checked against the packed recurrence (`Sendov.pev_pos_of_bern`). Every closed computation is evaluated by the kernel. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/FiniteRange/Degree14To15.lean b/LeanPool/Sendov/FiniteRange/Degree14To15.lean index 87826680f2..b613fd08a5 100644 --- a/LeanPool/Sendov/FiniteRange/Degree14To15.lean +++ b/LeanPool/Sendov/FiniteRange/Degree14To15.lean @@ -25,7 +25,7 @@ The moment numerator `Nmomc` is checked against the packed recurrence (`Sendov.pev_pos_of_bern`). Every closed computation is evaluated by the kernel. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/FiniteRange/Degree16To18.lean b/LeanPool/Sendov/FiniteRange/Degree16To18.lean index 00fa7ccd2f..2b1d6dc1bc 100644 --- a/LeanPool/Sendov/FiniteRange/Degree16To18.lean +++ b/LeanPool/Sendov/FiniteRange/Degree16To18.lean @@ -25,7 +25,7 @@ The moment numerator `Nmomc` is checked against the packed recurrence (`Sendov.pev_pos_of_bern`). Every closed computation is evaluated by the kernel. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/FiniteRange/Degree18To20.lean b/LeanPool/Sendov/FiniteRange/Degree18To20.lean index aad36844ea..3e3480620e 100644 --- a/LeanPool/Sendov/FiniteRange/Degree18To20.lean +++ b/LeanPool/Sendov/FiniteRange/Degree18To20.lean @@ -25,7 +25,7 @@ The moment numerator `Nmomc` is checked against the packed recurrence (`Sendov.pev_pos_of_bern`). Every closed computation is evaluated by the kernel. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/FiniteRange/Degree20To22.lean b/LeanPool/Sendov/FiniteRange/Degree20To22.lean index 11050eb4c9..5418d8caeb 100644 --- a/LeanPool/Sendov/FiniteRange/Degree20To22.lean +++ b/LeanPool/Sendov/FiniteRange/Degree20To22.lean @@ -25,7 +25,7 @@ The moment numerator `Nmomc` is checked against the packed recurrence (`Sendov.pev_pos_of_bern`). Every closed computation is evaluated by the kernel. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/FiniteRange/Degree22To24.lean b/LeanPool/Sendov/FiniteRange/Degree22To24.lean index bff1ec10b9..bcb8fa9f62 100644 --- a/LeanPool/Sendov/FiniteRange/Degree22To24.lean +++ b/LeanPool/Sendov/FiniteRange/Degree22To24.lean @@ -25,7 +25,7 @@ The moment numerator `Nmomc` is checked against the packed recurrence (`Sendov.pev_pos_of_bern`). Every closed computation is evaluated by the kernel. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/FiniteRange/Degree24To26.lean b/LeanPool/Sendov/FiniteRange/Degree24To26.lean index 6c7998a8cc..af34d925f9 100644 --- a/LeanPool/Sendov/FiniteRange/Degree24To26.lean +++ b/LeanPool/Sendov/FiniteRange/Degree24To26.lean @@ -25,7 +25,7 @@ The moment numerator `Nmomc` is checked against the packed recurrence (`Sendov.pev_pos_of_bern`). Every closed computation is evaluated by the kernel. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/FiniteRange/Degree26To27.lean b/LeanPool/Sendov/FiniteRange/Degree26To27.lean index 2cc7239c22..de2461cba2 100644 --- a/LeanPool/Sendov/FiniteRange/Degree26To27.lean +++ b/LeanPool/Sendov/FiniteRange/Degree26To27.lean @@ -25,7 +25,7 @@ The moment numerator `Nmomc` is checked against the packed recurrence (`Sendov.pev_pos_of_bern`). Every closed computation is evaluated by the kernel. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/FiniteRange/Degree28To29.lean b/LeanPool/Sendov/FiniteRange/Degree28To29.lean index 174c9a983c..11b6fb39a7 100644 --- a/LeanPool/Sendov/FiniteRange/Degree28To29.lean +++ b/LeanPool/Sendov/FiniteRange/Degree28To29.lean @@ -25,7 +25,7 @@ The moment numerator `Nmomc` is checked against the packed recurrence (`Sendov.pev_pos_of_bern`). Every closed computation is evaluated by the kernel. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/FiniteRange/Degree30To31.lean b/LeanPool/Sendov/FiniteRange/Degree30To31.lean index 960fadced3..1005111167 100644 --- a/LeanPool/Sendov/FiniteRange/Degree30To31.lean +++ b/LeanPool/Sendov/FiniteRange/Degree30To31.lean @@ -25,7 +25,7 @@ The moment numerator `Nmomc` is checked against the packed recurrence (`Sendov.pev_pos_of_bern`). Every closed computation is evaluated by the kernel. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/FiniteRange/Degree32To33.lean b/LeanPool/Sendov/FiniteRange/Degree32To33.lean index 471f3b1c45..443d176287 100644 --- a/LeanPool/Sendov/FiniteRange/Degree32To33.lean +++ b/LeanPool/Sendov/FiniteRange/Degree32To33.lean @@ -25,7 +25,7 @@ The moment numerator `Nmomc` is checked against the packed recurrence (`Sendov.pev_pos_of_bern`). Every closed computation is evaluated by the kernel. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/FiniteRange/Degree34To35.lean b/LeanPool/Sendov/FiniteRange/Degree34To35.lean index 3d8e51154f..c5957f7025 100644 --- a/LeanPool/Sendov/FiniteRange/Degree34To35.lean +++ b/LeanPool/Sendov/FiniteRange/Degree34To35.lean @@ -25,7 +25,7 @@ The moment numerator `Nmomc` is checked against the packed recurrence (`Sendov.pev_pos_of_bern`). Every closed computation is evaluated by the kernel. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/FiniteRange/Degree36To37.lean b/LeanPool/Sendov/FiniteRange/Degree36To37.lean index b01084ff7b..3b360892eb 100644 --- a/LeanPool/Sendov/FiniteRange/Degree36To37.lean +++ b/LeanPool/Sendov/FiniteRange/Degree36To37.lean @@ -25,7 +25,7 @@ The moment numerator `Nmomc` is checked against the packed recurrence (`Sendov.pev_pos_of_bern`). Every closed computation is evaluated by the kernel. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/FiniteRange/Degree38To39.lean b/LeanPool/Sendov/FiniteRange/Degree38To39.lean index a65a66fca1..ddc61fa6fc 100644 --- a/LeanPool/Sendov/FiniteRange/Degree38To39.lean +++ b/LeanPool/Sendov/FiniteRange/Degree38To39.lean @@ -25,7 +25,7 @@ The moment numerator `Nmomc` is checked against the packed recurrence (`Sendov.pev_pos_of_bern`). Every closed computation is evaluated by the kernel. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/FiniteRange/Degree40To41.lean b/LeanPool/Sendov/FiniteRange/Degree40To41.lean index 34f5945b51..66d801b3bb 100644 --- a/LeanPool/Sendov/FiniteRange/Degree40To41.lean +++ b/LeanPool/Sendov/FiniteRange/Degree40To41.lean @@ -25,7 +25,7 @@ The moment numerator `Nmomc` is checked against the packed recurrence (`Sendov.pev_pos_of_bern`). Every closed computation is evaluated by the kernel. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/FiniteRange/Degree42To43.lean b/LeanPool/Sendov/FiniteRange/Degree42To43.lean index 855c3f870d..342523de75 100644 --- a/LeanPool/Sendov/FiniteRange/Degree42To43.lean +++ b/LeanPool/Sendov/FiniteRange/Degree42To43.lean @@ -25,7 +25,7 @@ The moment numerator `Nmomc` is checked against the packed recurrence (`Sendov.pev_pos_of_bern`). Every closed computation is evaluated by the kernel. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/FiniteRange/Degree44To45.lean b/LeanPool/Sendov/FiniteRange/Degree44To45.lean index cac1d1f3c1..2023490c38 100644 --- a/LeanPool/Sendov/FiniteRange/Degree44To45.lean +++ b/LeanPool/Sendov/FiniteRange/Degree44To45.lean @@ -25,7 +25,7 @@ The moment numerator `Nmomc` is checked against the packed recurrence (`Sendov.pev_pos_of_bern`). Every closed computation is evaluated by the kernel. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/FiniteRange/Degree46To47.lean b/LeanPool/Sendov/FiniteRange/Degree46To47.lean index d9900f4333..f842ea6053 100644 --- a/LeanPool/Sendov/FiniteRange/Degree46To47.lean +++ b/LeanPool/Sendov/FiniteRange/Degree46To47.lean @@ -25,7 +25,7 @@ The moment numerator `Nmomc` is checked against the packed recurrence (`Sendov.pev_pos_of_bern`). Every closed computation is evaluated by the kernel. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/FiniteRange/Degree48To49.lean b/LeanPool/Sendov/FiniteRange/Degree48To49.lean index ce1c75f4cc..05ddba225c 100644 --- a/LeanPool/Sendov/FiniteRange/Degree48To49.lean +++ b/LeanPool/Sendov/FiniteRange/Degree48To49.lean @@ -25,7 +25,7 @@ The moment numerator `Nmomc` is checked against the packed recurrence (`Sendov.pev_pos_of_bern`). Every closed computation is evaluated by the kernel. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/FiniteRange/Degree5.lean b/LeanPool/Sendov/FiniteRange/Degree5.lean index c86212c21c..8bf4d7be36 100644 --- a/LeanPool/Sendov/FiniteRange/Degree5.lean +++ b/LeanPool/Sendov/FiniteRange/Degree5.lean @@ -41,7 +41,7 @@ orientation: over the feasible range `α ≤ 1.678` the exact maximum of `R 5 α `1`, and would prove nothing. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/FiniteRange/Degree50To51.lean b/LeanPool/Sendov/FiniteRange/Degree50To51.lean index 3909d84b43..df821ab391 100644 --- a/LeanPool/Sendov/FiniteRange/Degree50To51.lean +++ b/LeanPool/Sendov/FiniteRange/Degree50To51.lean @@ -25,7 +25,7 @@ The moment numerator `Nmomc` is checked against the packed recurrence (`Sendov.pev_pos_of_bern`). Every closed computation is evaluated by the kernel. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/FiniteRange/Degree52To53.lean b/LeanPool/Sendov/FiniteRange/Degree52To53.lean index 264321f2a8..31f8fad46a 100644 --- a/LeanPool/Sendov/FiniteRange/Degree52To53.lean +++ b/LeanPool/Sendov/FiniteRange/Degree52To53.lean @@ -25,7 +25,7 @@ The moment numerator `Nmomc` is checked against the packed recurrence (`Sendov.pev_pos_of_bern`). Every closed computation is evaluated by the kernel. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/FiniteRange/Degree54To55.lean b/LeanPool/Sendov/FiniteRange/Degree54To55.lean index 421f163c02..a11adf460c 100644 --- a/LeanPool/Sendov/FiniteRange/Degree54To55.lean +++ b/LeanPool/Sendov/FiniteRange/Degree54To55.lean @@ -25,7 +25,7 @@ The moment numerator `Nmomc` is checked against the packed recurrence (`Sendov.pev_pos_of_bern`). Every closed computation is evaluated by the kernel. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/FiniteRange/Degree56To58.lean b/LeanPool/Sendov/FiniteRange/Degree56To58.lean index 17000e29ee..b4505d3360 100644 --- a/LeanPool/Sendov/FiniteRange/Degree56To58.lean +++ b/LeanPool/Sendov/FiniteRange/Degree56To58.lean @@ -25,7 +25,7 @@ The moment numerator `Nmomc` is checked against the packed recurrence (`Sendov.pev_pos_of_bern`). Every closed computation is evaluated by the kernel. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/FiniteRange/Degree58To60.lean b/LeanPool/Sendov/FiniteRange/Degree58To60.lean index 6b3d0c4e3d..137b9c49f0 100644 --- a/LeanPool/Sendov/FiniteRange/Degree58To60.lean +++ b/LeanPool/Sendov/FiniteRange/Degree58To60.lean @@ -25,7 +25,7 @@ The moment numerator `Nmomc` is checked against the packed recurrence (`Sendov.pev_pos_of_bern`). Every closed computation is evaluated by the kernel. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/FiniteRange/Degree60To63.lean b/LeanPool/Sendov/FiniteRange/Degree60To63.lean index c2c26975a4..bc1d0ffc13 100644 --- a/LeanPool/Sendov/FiniteRange/Degree60To63.lean +++ b/LeanPool/Sendov/FiniteRange/Degree60To63.lean @@ -25,7 +25,7 @@ The moment numerator `Nmomc` is checked against the packed recurrence (`Sendov.pev_pos_of_bern`). Every closed computation is evaluated by the kernel. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/FiniteRange/Degree64To69.lean b/LeanPool/Sendov/FiniteRange/Degree64To69.lean index fdd3aceeea..96f3ddf139 100644 --- a/LeanPool/Sendov/FiniteRange/Degree64To69.lean +++ b/LeanPool/Sendov/FiniteRange/Degree64To69.lean @@ -25,7 +25,7 @@ The moment numerator `Nmomc` is checked against the packed recurrence (`Sendov.pev_pos_of_bern`). Every closed computation is evaluated by the kernel. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/FiniteRange/Degree6To6.lean b/LeanPool/Sendov/FiniteRange/Degree6To6.lean index a7bf71c330..e015110bad 100644 --- a/LeanPool/Sendov/FiniteRange/Degree6To6.lean +++ b/LeanPool/Sendov/FiniteRange/Degree6To6.lean @@ -25,7 +25,7 @@ The moment numerator `Nmomc` is checked against the packed recurrence (`Sendov.pev_pos_of_bern`). Every closed computation is evaluated by the kernel. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/FiniteRange/Degree7.lean b/LeanPool/Sendov/FiniteRange/Degree7.lean index c7dcd75e42..4a6da6f284 100644 --- a/LeanPool/Sendov/FiniteRange/Degree7.lean +++ b/LeanPool/Sendov/FiniteRange/Degree7.lean @@ -30,7 +30,7 @@ but small: the exact maximum of `R 7 α` over the feasible range is about `0.598 `0.664` for this upper bound. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/FiniteRange/Degree70To79.lean b/LeanPool/Sendov/FiniteRange/Degree70To79.lean index 6e838a2b45..b4e87d90f7 100644 --- a/LeanPool/Sendov/FiniteRange/Degree70To79.lean +++ b/LeanPool/Sendov/FiniteRange/Degree70To79.lean @@ -25,7 +25,7 @@ The moment numerator `Nmomc` is checked against the packed recurrence (`Sendov.pev_pos_of_bern`). Every closed computation is evaluated by the kernel. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/FiniteRange/Degree80To100.lean b/LeanPool/Sendov/FiniteRange/Degree80To100.lean index 6336394139..26bb313e5e 100644 --- a/LeanPool/Sendov/FiniteRange/Degree80To100.lean +++ b/LeanPool/Sendov/FiniteRange/Degree80To100.lean @@ -25,7 +25,7 @@ The moment numerator `Nmomc` is checked against the packed recurrence (`Sendov.pev_pos_of_bern`). Every closed computation is evaluated by the kernel. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/FiniteRange/Degree8To9.lean b/LeanPool/Sendov/FiniteRange/Degree8To9.lean index cb1a61b236..5942c347a6 100644 --- a/LeanPool/Sendov/FiniteRange/Degree8To9.lean +++ b/LeanPool/Sendov/FiniteRange/Degree8To9.lean @@ -25,7 +25,7 @@ The moment numerator `Nmomc` is checked against the packed recurrence (`Sendov.pev_pos_of_bern`). Every closed computation is evaluated by the kernel. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/FiniteRange/Moments.lean b/LeanPool/Sendov/FiniteRange/Moments.lean index cef21a1e19..62363c6747 100644 --- a/LeanPool/Sendov/FiniteRange/Moments.lean +++ b/LeanPool/Sendov/FiniteRange/Moments.lean @@ -32,7 +32,7 @@ Note that no hypothesis on `c`, `A` or `α` is needed here — the identity is a one. Feasibility is required only for the odd-degree reduction, never for the moments. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/FiniteRange/OddBound.lean b/LeanPool/Sendov/FiniteRange/OddBound.lean index 3672bb3122..f362b99af4 100644 --- a/LeanPool/Sendov/FiniteRange/OddBound.lean +++ b/LeanPool/Sendov/FiniteRange/OddBound.lean @@ -31,7 +31,7 @@ Note that only `0 ≤ Q` is needed, never `Q ≤ 1`: the tangent-line inequality `(√q - w)² ≥ 0`. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/FiniteRange/Pack.lean b/LeanPool/Sendov/FiniteRange/Pack.lean index 10eeeb15dc..86bff5497a 100644 --- a/LeanPool/Sendov/FiniteRange/Pack.lean +++ b/LeanPool/Sendov/FiniteRange/Pack.lean @@ -38,12 +38,13 @@ Everything here is about `ℕ`; signed coefficients are handled downstream by sp * `Sendov.unpackN_npev`: `unpackN b p.length (npev p b) = p` for coefficients below `b`. -/ -@[expose] public section +public section namespace Sendov /-- Evaluate a dense `ℕ`-polynomial (lowest degree first) at `b`, by Horner's rule. This is the packing map: `npev p b` is the single natural number representing `p`. -/ +@[expose] def npev : List ℕ → ℕ → ℕ | [], _ => 0 | a :: p, b => a + b * npev p b @@ -54,6 +55,7 @@ def npev : List ℕ → ℕ → ℕ npev (a :: p) b = a + b * npev p b := rfl /-- Recover the first `m` coefficients of a packed polynomial. -/ +@[expose] def unpackN (b : ℕ) : ℕ → ℕ → List ℕ | 0, _ => [] | m + 1, x => (x % b) :: unpackN b m (x / b) @@ -182,6 +184,7 @@ of `x % b` taken in `(-b/2, b/2)` rather than `[0, b)`. The overflow condition `2 * |c| < b`. -/ /-- Evaluate a dense `ℤ`-polynomial at an integer. This is the signed packing map. -/ +@[expose] def pevZ : List ℤ → ℤ → ℤ | [], _ => 0 | a :: p, b => a + b * pevZ p b @@ -193,9 +196,11 @@ def pevZ : List ℤ → ℤ → ℤ /-- The balanced representative of `x` modulo `b`, lying in `(-b/2, b/2)` when `b` is positive and `x` is a balanced digit. -/ +@[expose] def bdig (b x : ℤ) : ℤ := if 2 * (x % b) < b then x % b else x % b - b /-- Recover the first `m` balanced digits of a packed `ℤ`-polynomial. -/ +@[expose] def unpackZ (b : ℤ) : ℕ → ℤ → List ℤ | 0, _ => [] | m + 1, x => bdig b x :: unpackZ b m ((x - bdig b x) / b) diff --git a/LeanPool/Sendov/FiniteRange/PackBridge.lean b/LeanPool/Sendov/FiniteRange/PackBridge.lean index 444624d347..52da13876e 100644 --- a/LeanPool/Sendov/FiniteRange/PackBridge.lean +++ b/LeanPool/Sendov/FiniteRange/PackBridge.lean @@ -34,11 +34,12 @@ the numerical parameters `β` and `τ` have to be chosen, one per degree. * `Sendov.pevZ_rowZ_qrow`: the recurrence as one integer exponentiation. -/ -@[expose] public section +public section namespace Sendov /-- The row with each coefficient polynomial packed at the base `β`. -/ +@[expose] def rowZ (r : List (List ℤ)) (β : ℤ) : List ℤ := r.map (fun p => pevZ p β) @[simp] lemma rowZ_nil (β : ℤ) : rowZ [] β = [] := rfl @@ -95,6 +96,7 @@ theorem rowZ_qrow_eq (g₀ g₁ g₂ : List ℤ) (k : ℕ) (β τ : ℤ) (hτ : denominators clears them, turning the moment into one `ℤ`-polynomial in `α`. -/ /-- `∑ⱼ (L/(i+j+4)) • rⱼ`: the moment numerator, scaled by `L` to clear denominators. -/ +@[expose] def wsum (L : ℤ) : ℕ → List (List ℤ) → List ℤ | _, [] => [] | i, p :: r => padd (p.map (fun c => (L / ((i : ℤ) + 4)) * c)) (wsum L (i + 1) r) @@ -143,6 +145,7 @@ proved rather than checked. The `L¹` norm does it: it is submultiplicative, so of the `k`-th power is at most `(l1 g₀ + l1 g₁ + l1 g₂) ^ k`. -/ /-- Sum of absolute values of the coefficients. -/ +@[expose] def l1 : List ℤ → ℤ | [] => 0 | a :: p => |a| + l1 p @@ -199,6 +202,7 @@ lemma l1_pmul (p q : List ℤ) : l1 (pmul p q) ≤ l1 p * l1 q := by nlinarith [ih, hq, hstep] /-- The `L¹` norm of a row: the total of its coefficients' absolute values. -/ +@[expose] def l1row : List (List ℤ) → ℤ | [] => 0 | p :: r => l1 p + l1row r @@ -362,6 +366,7 @@ theorem unpackZ_pevZ_le (β : ℤ) (hβ : 0 < β) : simp /-- The weighted sum computed directly on the α-packed row. -/ +@[expose] def wsumZ (L : ℤ) : ℕ → List ℤ → ℤ | _, [] => 0 | i, a :: s => (L / ((i : ℤ) + 4)) * a + wsumZ L (i + 1) s diff --git a/LeanPool/Sendov/FiniteRange/Recurrence.lean b/LeanPool/Sendov/FiniteRange/Recurrence.lean index 3043e6b31d..e22b1be9f9 100644 --- a/LeanPool/Sendov/FiniteRange/Recurrence.lean +++ b/LeanPool/Sendov/FiniteRange/Recurrence.lean @@ -45,7 +45,7 @@ kernel computation on integer data. * `Sendov.integral_moment_rec`: the moment, via the recurrence. -/ -@[expose] public section +public section namespace Sendov @@ -54,17 +54,20 @@ open MeasureTheory /-! ### Integer polynomials in `α`, densely represented, lowest degree first -/ /-- Evaluation of a dense integer polynomial at a real point, by Horner's rule. -/ +@[expose] def pev : List ℤ → ℝ → ℝ | [], _ => 0 | a :: p, x => (a : ℝ) + x * pev p x /-- Addition of dense integer polynomials. -/ +@[expose] def padd : List ℤ → List ℤ → List ℤ | [], q => q | a :: p, [] => a :: p | a :: p, b :: q => (a + b) :: padd p q /-- Multiplication of dense integer polynomials. -/ +@[expose] def pmul : List ℤ → List ℤ → List ℤ | [], _ => [] | a :: p, q => padd (q.map (fun b => a * b)) (0 :: pmul p q) @@ -105,17 +108,20 @@ lemma pev_pmul (p q : List ℤ) (x : ℝ) : pev (pmul p q) x = pev p x * pev q x /-! ### Rows: polynomials in `t` whose coefficients are polynomials in `α` -/ /-- Evaluation of a row at `α` (coefficientwise) and `t` (by Horner's rule). -/ +@[expose] def rev : List (List ℤ) → ℝ → ℝ → ℝ | [], _, _ => 0 | p :: r, α, t => pev p α + t * rev r α t /-- Addition of rows. -/ +@[expose] def radd : List (List ℤ) → List (List ℤ) → List (List ℤ) | [], s => s | p :: r, [] => p :: r | p :: r, q :: s => padd p q :: radd r s /-- Multiply every coefficient of a row by a fixed polynomial in `α`. -/ +@[expose] def rscale (g : List ℤ) (r : List (List ℤ)) : List (List ℤ) := r.map (pmul g) @[simp] lemma rev_nil (α t : ℝ) : rev [] α t = 0 := rfl @@ -150,11 +156,13 @@ lemma rev_shift (r : List (List ℤ)) (α t : ℝ) : /-! ### The recurrence -/ /-- One step of the recurrence: multiply a row by `g₀ + g₁ t + g₂ t²`. -/ +@[expose] def qstep (g₀ g₁ g₂ : List ℤ) (r : List (List ℤ)) : List (List ℤ) := radd (rscale g₀ r) (radd ([] :: rscale g₁ r) ([] :: [] :: rscale g₂ r)) /-- The coefficients of `(g₀ + g₁ t + g₂ t²) ^ k`, as a polynomial in `t` whose coefficients are integer polynomials in `α`. -/ +@[expose] def qrow (g₀ g₁ g₂ : List ℤ) : ℕ → List (List ℤ) | 0 => [[1]] | k + 1 => qstep g₀ g₁ g₂ (qrow g₀ g₁ g₂ k) @@ -171,6 +179,7 @@ lemma rev_qrow (g₀ g₁ g₂ : List ℤ) (k : ℕ) (α t : ℝ) : /-- `irow r i α = ∑ⱼ (coefficient j of r, at α) / (i + j + 4)`, the value of `∫ t in 0..1, t ^ (i+3) * rev r α t`. -/ +@[expose] noncomputable def irow : List (List ℤ) → ℕ → ℝ → ℝ | [], _, _ => 0 | p :: r, i, α => pev p α / (i + 4) + irow r (i + 1) α @@ -227,12 +236,15 @@ with integer coefficients, `g₂ = 6(n-1) + (2(n-1) - 12) α - 4 α²`. -/ /-- `D` itself, as an integer polynomial in `α`. -/ +@[expose] def gg0 (n : ℕ) : List ℤ := [6 * ((n : ℤ) - 1), 2 * ((n : ℤ) - 1)] /-- `-2 D c`, as an integer polynomial in `α`. -/ +@[expose] def gg1 (n : ℕ) : List ℤ := [-12 * ((n : ℤ) - 1), 12 - 2 * ((n : ℤ) - 1), 4] /-- `D A`, as an integer polynomial in `α`. -/ +@[expose] def gg2 (n : ℕ) : List ℤ := [6 * ((n : ℤ) - 1), 2 * ((n : ℤ) - 1) - 12, -4] @[simp] lemma gg0_length (n : ℕ) : (gg0 n).length = 2 := rfl diff --git a/LeanPool/Sendov/Interior.lean b/LeanPool/Sendov/Interior.lean index 2acbe9bd9f..1552d92e06 100644 --- a/LeanPool/Sendov/Interior.lean +++ b/LeanPool/Sendov/Interior.lean @@ -44,7 +44,7 @@ have norm at most one. * `Sendov.sendov_interior_real`: the two combined, `0 ≤ a < 1`. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/LargeDegree/Endgame.lean b/LeanPool/Sendov/LargeDegree/Endgame.lean index f9ad96e435..6fb177542d 100644 --- a/LeanPool/Sendov/LargeDegree/Endgame.lean +++ b/LeanPool/Sendov/LargeDegree/Endgame.lean @@ -47,7 +47,7 @@ and the certificate were closed by `ring` under a twentyfold heartbeat budget. * `Sendov.large_degree`: `R n α < 1` for `n ≥ 101`. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/LargeDegree/Monotone.lean b/LeanPool/Sendov/LargeDegree/Monotone.lean index a45cc409a4..ddbc9fbe52 100644 --- a/LeanPool/Sendov/LargeDegree/Monotone.lean +++ b/LeanPool/Sendov/LargeDegree/Monotone.lean @@ -51,13 +51,14 @@ having negative discriminant. * `Sendov.U_le_Ut`: `U n α ≤ Ut α` for `n ≥ 101`, where `Ut` involves no `n` and no `rpow`. -/ -@[expose] public section +public section namespace Sendov variable {n : ℕ} {α : ℝ} /-- The first tail term of `Sendov.U`, in closed form. -/ +@[expose] noncomputable def T1 (n : ℕ) (α : ℝ) : ℝ := 24 * ((n : ℝ) - 1 - 2 * α) ^ 2 / ((3 + α) * c n α ^ 4 * ((n : ℝ) - 1) * ((n : ℝ) + 2) * ((n : ℝ) + 4)) @@ -312,6 +313,7 @@ lemma T2_le (hn : 101 ≤ n) (hα : 0 ≤ α) (hα' : α ≤ 17) : T2 n α ≤ T /-! ### The bound with no degree left in it -/ /-- The elementary bound at `n = 101`, with `√B` removed and `α` the only variable. -/ +@[expose] noncomputable def Ut (α : ℝ) : ℝ := 1 / 6 + 1 / (4 * (3 + α)) + 1 / 200 + 1 / (400 * (3 + α)) + 101 / 100 * T1 101 α + (100 - 2 * α) ^ 2 / 100 * 101 * 99 / (16 * (3 + α)) * (α / (3 + α)) ^ 48 diff --git a/LeanPool/Sendov/LargeDegree/Tail.lean b/LeanPool/Sendov/LargeDegree/Tail.lean index 2f21c4feff..79e976a586 100644 --- a/LeanPool/Sendov/LargeDegree/Tail.lean +++ b/LeanPool/Sendov/LargeDegree/Tail.lean @@ -28,7 +28,7 @@ through `Q n α t = QQ (c n α) (A n α) t` and `Q n α 1 = α/(3+α)`. * `Sendov.integral_le_tail`: the bound above. -/ -@[expose] public section +public section namespace Sendov @@ -62,6 +62,7 @@ alone; no integral survives. -/ /-- The elementary bound replacing `Sendov.R`: `(11)` of the informal write-up, but with the sharper Beta constant `6/((r+1)(r+2)(r+3)(r+4))` in place of `6/r⁴`. -/ +@[expose] noncomputable def U (n : ℕ) (α : ℝ) : ℝ := 1 / 6 + 1 / (4 * (3 + α)) + 1 / (2 * M n) + 1 / (4 * M n * (3 + α)) + A n α ^ 2 * n * M n * ((n : ℝ) - 2) / (4 * (3 + α)) diff --git a/LeanPool/Sendov/Main.lean b/LeanPool/Sendov/Main.lean index 0c4c85b180..770ed53f9c 100644 --- a/LeanPool/Sendov/Main.lean +++ b/LeanPool/Sendov/Main.lean @@ -32,7 +32,7 @@ analytic side would start with margin `0.122` instead of `0.048`. * `Sendov.stat_contradiction`: equation `stat` of the blog post is therefore unsatisfiable. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/Reduction/Alpha17.lean b/LeanPool/Sendov/Reduction/Alpha17.lean index c8c11d80c4..1f344fb577 100644 --- a/LeanPool/Sendov/Reduction/Alpha17.lean +++ b/LeanPool/Sendov/Reduction/Alpha17.lean @@ -39,7 +39,7 @@ reaches `1.817`, and the extra room is what pays for the crude constants below. * `Sendov.alpha_le_seventeen`: `(beta-bound) + (origin-exact) ⟹ α ≤ 17`. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/Reduction/BetaBound.lean b/LeanPool/Sendov/Reduction/BetaBound.lean index b09f0d003e..ddd47b55d0 100644 --- a/LeanPool/Sendov/Reduction/BetaBound.lean +++ b/LeanPool/Sendov/Reduction/BetaBound.lean @@ -34,7 +34,7 @@ integrand is at most `e^{-α} < 1` throughout, so the integral is below `1`. He * `Sendov.beta_le`: `(lt) ⟹ B ≤ α/(3+α)`. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/Reduction/Main.lean b/LeanPool/Sendov/Reduction/Main.lean index dec21f2326..172ffc735e 100644 --- a/LeanPool/Sendov/Reduction/Main.lean +++ b/LeanPool/Sendov/Reduction/Main.lean @@ -52,7 +52,7 @@ logarithmic half by `Sendov.alpha_le_seventeen`, to bound `1/x²`. * `Sendov.polar_origin_incompatible`: the two raw inequalities have no common solution. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/Reduction/Polar.lean b/LeanPool/Sendov/Reduction/Polar.lean index 5ad30055f0..7c388c9ef0 100644 --- a/LeanPool/Sendov/Reduction/Polar.lean +++ b/LeanPool/Sendov/Reduction/Polar.lean @@ -37,7 +37,7 @@ having to argue that the integrand is strictly smaller on a set of positive meas * `Sendov.polar_exp`: `(1Q) ⟹ (lt)`. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/Reduction/Setup.lean b/LeanPool/Sendov/Reduction/Setup.lean index cd5b3ee4b0..af631ba4a2 100644 --- a/LeanPool/Sendov/Reduction/Setup.lean +++ b/LeanPool/Sendov/Reduction/Setup.lean @@ -35,11 +35,12 @@ each other: with `α = (n-1)(1-a²)/2` one has `A n α = a²` *exactly*, so the * `Sendov.alpha_pos`, `Sendov.alpha_le_half`: the range of `α`. -/ -@[expose] public section +public section namespace Sendov /-- The integrand of the raw polar inequality `(1Q)`. -/ +@[expose] noncomputable def Ppolar (a x t : ℝ) : ℝ := a ^ 2 + 2 * a * t * x * (1 - a ^ 2) + t ^ 2 * (1 - a ^ 2) ^ 2 diff --git a/LeanPool/Sendov/Reduction/Simplified.lean b/LeanPool/Sendov/Reduction/Simplified.lean index 4c4e43c231..34d1ce940d 100644 --- a/LeanPool/Sendov/Reduction/Simplified.lean +++ b/LeanPool/Sendov/Reduction/Simplified.lean @@ -38,7 +38,7 @@ finite and `1/(ax) ≥ 1`. * `Sendov.one_le_of_origin`: `(origin-exact) + (beta-bound) ⟹ (1le)`. -/ -@[expose] public section +public section namespace Sendov diff --git a/LeanPool/Sendov/Reduction/Stat.lean b/LeanPool/Sendov/Reduction/Stat.lean index c0bc569f4d..b01a47c4b6 100644 --- a/LeanPool/Sendov/Reduction/Stat.lean +++ b/LeanPool/Sendov/Reduction/Stat.lean @@ -32,7 +32,7 @@ pointwise comparison, the same way `Sendov.integral_anti` gets it in the batchin * `Sendov.stat_of_one_le`: `(1le) + (beta-bound) ⟹ 1 ≤ R n α`. -/ -@[expose] public section +public section namespace Sendov 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 583c484c05..a84e8a920e 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/SeveralComplexVariables/Solution.lean b/LeanPool/SeveralComplexVariables/Solution.lean index 4a2c1095fa..8203411c31 100644 --- a/LeanPool/SeveralComplexVariables/Solution.lean +++ b/LeanPool/SeveralComplexVariables/Solution.lean @@ -60,7 +60,7 @@ additional results supply the project's broader scope. The local analytic Nullst [scvBibliography]: https://github.com/bjbraams/lean-scv/blob/caef1ae776ff79933718312357980d46628d3702/formalization.yaml -/ -@[expose] public section +public section open Complex Filter Function MeasureTheory Metric Set 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/Stafford38/AlgebraicAnalysis/Commutator.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Commutator.lean index 5a7d92100c..03817c9d2b 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Commutator.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Commutator.lean @@ -22,7 +22,7 @@ symplectic layer and the differential-Ore escape layer. The convention is specific structure is assumed. -/ -@[expose] public section +public section namespace AlgebraicAnalysis @@ -31,6 +31,7 @@ section variable {A : Type*} [Ring A] /-- The ring commutator, with the written multiplication order retained. -/ +@[expose] def ringCommutator (u v : A) : A := u * v - v * u @[simp] diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/CommutatorRiccati.lean b/LeanPool/Stafford38/AlgebraicAnalysis/CommutatorRiccati.lean index 174f969180..b7f82d05bb 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/CommutatorRiccati.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/CommutatorRiccati.lean @@ -18,13 +18,14 @@ inverse-Euler calculation. No Weyl presentation, filtration, module, or application-specific hypothesis is assumed. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.InverseEulerRiccati variable {A : Type*} [Ring A] /-- Historical local name for the shared ring commutator. -/ +@[expose] def commutator (a b : A) : A := AlgebraicAnalysis.ringCommutator a b @[simp] diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Derivation/Central.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Derivation/Central.lean index 37d6f36c4a..cc074b7bfa 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Derivation/Central.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Derivation/Central.lean @@ -23,7 +23,7 @@ visible. It does not assert that a particular localization has those properties. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.NoncommutativeDerivation diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Derivation/Escape.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Derivation/Escape.lean index db403efd6a..ff5879fece 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Derivation/Escape.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Derivation/Escape.lean @@ -31,7 +31,7 @@ No module-span, simplicity, denominator, or geometric statement is included: those are separate packet obligations. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.Escape @@ -47,6 +47,7 @@ variable {E S : Type*} [DivisionRing E] [Ring S] The orientation is the one used in the escape argument: `adₓ(w) = w x - x w`. -/ +@[expose] def commutator (x : S) : S →+ S where toFun w := w * x - x * w map_zero' := by simp diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/DifferentialOperators/Basic.lean b/LeanPool/Stafford38/AlgebraicAnalysis/DifferentialOperators/Basic.lean index fb682c60b5..d8aba95df7 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/DifferentialOperators/Basic.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/DifferentialOperators/Basic.lean @@ -18,7 +18,7 @@ from Stafford38 commit `1585e4c7`, originally application-specific hypothesis is used. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.DifferentialOperators @@ -28,6 +28,7 @@ variable {k R : Type*} [CommRing k] [CommRing R] [Algebra k R] abbrev End := Module.End k R /-- Multiplication by an element of `R`, as a `k`-linear endomorphism. -/ +@[expose] def multiplication (a : R) : End (k := k) (R := R) := LinearMap.mulLeft k a @@ -36,6 +37,7 @@ theorem multiplication_apply (a x : R) : multiplication (k := k) a x = a * x := rfl /-- The commutator of an endomorphism with multiplication by `a`. -/ +@[expose] def commutator (P : End (k := k) (R := R)) (a : R) : End (k := k) (R := R) := P * multiplication (k := k) a - multiplication (k := k) a * P @@ -44,6 +46,7 @@ theorem commutator_apply (P : End (k := k) (R := R)) (a x : R) : commutator P a x = P (a * x) - a * P x := rfl /-- Differential operators of order at most `n`. -/ +@[expose] def order : ℕ → Submodule k (End (k := k) (R := R)) | 0 => { carrier := {P | ∀ a, commutator P a = 0} @@ -175,6 +178,7 @@ theorem mul_mem_order {P Q : End (k := k) (R := R)} {m n : ℕ} (by simpa only [Nat.succ_add, Nat.add_succ] using ihm (hP a) hQ') /-- The algebra of all finite-order `k`-linear differential operators on `R`. -/ +@[expose] def algebra : Subalgebra k (End (k := k) (R := R)) where carrier := {P | ∃ n, P ∈ order n} zero_mem' := ⟨0, (order 0).zero_mem⟩ diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/DifferentialOperators/CoordinateGeneration.lean b/LeanPool/Stafford38/AlgebraicAnalysis/DifferentialOperators/CoordinateGeneration.lean index bb2d5cc1a9..c4a244e181 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/DifferentialOperators/CoordinateGeneration.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/DifferentialOperators/CoordinateGeneration.lean @@ -20,7 +20,7 @@ differential operator, provided that commuting with all the coordinates already characterizes multiplication operators. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.DifferentialOperators.CoordinateGeneration diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/DifferentialOperators/FormallyEtaleDerivations.lean b/LeanPool/Stafford38/AlgebraicAnalysis/DifferentialOperators/FormallyEtaleDerivations.lean index 321c1c3d45..cfa1e9a2cd 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/DifferentialOperators/FormallyEtaleDerivations.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/DifferentialOperators/FormallyEtaleDerivations.lean @@ -15,7 +15,7 @@ The base-change equivalence for Kähler differentials extends derivations unique Localizations and separable field extensions use this common construction. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.DifferentialOperators.FormallyEtaleDerivations diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/DifferentialOperators/LocalizedPolynomialCommutant.lean b/LeanPool/Stafford38/AlgebraicAnalysis/DifferentialOperators/LocalizedPolynomialCommutant.lean index 203af292ea..d37467ba1b 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/DifferentialOperators/LocalizedPolynomialCommutant.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/DifferentialOperators/LocalizedPolynomialCommutant.lean @@ -19,7 +19,7 @@ uses the localization presentation; it does not use a finite-order hypothesis. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.DifferentialOperators.LocalizedPolynomialCommutant diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/DifferentialOperators/LocalizedPolynomialDerivations.lean b/LeanPool/Stafford38/AlgebraicAnalysis/DifferentialOperators/LocalizedPolynomialDerivations.lean index 6a6d78d9b8..19cc74b2fa 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/DifferentialOperators/LocalizedPolynomialDerivations.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/DifferentialOperators/LocalizedPolynomialDerivations.lean @@ -19,7 +19,7 @@ change. This file records the resulting extension operation and its specialization to the partial derivations of a polynomial ring. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.DifferentialOperators.LocalizedPolynomialDerivations diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/FieldTheory/FunctionField.lean b/LeanPool/Stafford38/AlgebraicAnalysis/FieldTheory/FunctionField.lean index c5a10dcdfc..29f288a7ec 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/FieldTheory/FunctionField.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/FieldTheory/FunctionField.lean @@ -20,7 +20,7 @@ finite type as an algebra: a transcendental fraction field is generally not finitely generated as an algebra over its ground field. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.FunctionField diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/LinearAlgebra/FiniteTaylorReconstruction.lean b/LeanPool/Stafford38/AlgebraicAnalysis/LinearAlgebra/FiniteTaylorReconstruction.lean index 57c42f2571..96d7d7de10 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/LinearAlgebra/FiniteTaylorReconstruction.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/LinearAlgebra/FiniteTaylorReconstruction.lean @@ -19,7 +19,7 @@ Application-independent finite Taylor reconstruction for a nilpotent endomorphism. Extracted from Stafford38 commit c8a513d553b24c7c08da82f496c44dbbaeb1f2fc. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.FiniteTaylorReconstruction @@ -29,6 +29,7 @@ variable {𝕜 : Type*} [Field 𝕜] [CharZero 𝕜] variable {V : Type*} [AddCommGroup V] [Module 𝕜 V] /-- The finite alternating Taylor projector associated with two endomorphisms. -/ +@[expose] def projectorMapG (K : ℕ) (S D : V →ₗ[𝕜] V) : V →ₗ[𝕜] V := ∑ r ∈ Finset.range (K + 1), ((-1 : 𝕜) ^ r / (r.factorial : 𝕜)) • (S ^ r * D ^ r) diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/BaseLocalizationModuleComparison.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/BaseLocalizationModuleComparison.lean index 66012f9f73..b0fcff0a93 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/BaseLocalizationModuleComparison.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/BaseLocalizationModuleComparison.lean @@ -17,7 +17,7 @@ For an `R`-algebra `C`, localizing a `C`-module at the image of a submonoid `S ≤ R` agrees with localizing it as an `R`-module at `S`. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.BaseLocalizationModuleComparison diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/BaseLocalizedKoszulPositivity.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/BaseLocalizedKoszulPositivity.lean index 4b0a76c3c6..69413099b3 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/BaseLocalizedKoszulPositivity.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/BaseLocalizedKoszulPositivity.lean @@ -17,7 +17,7 @@ public import LeanPool.Stafford38.AlgebraicAnalysis.Module.PrincipalKoszulMinima Strict positivity of the localized principal Koszul Euler characteristic over the base ring. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.BaseLocalizedKoszulPositivity diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/CommutingPolynomialAction.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/CommutingPolynomialAction.lean index 3a852a61eb..b2dcac6898 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/CommutingPolynomialAction.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/CommutingPolynomialAction.lean @@ -17,7 +17,7 @@ pairwise commuting endomorphisms therefore gives an evaluation map by first landing in the commutative subalgebra which it generates. -/ -@[expose] public section +public section open scoped IsMulCommutative diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/DenominatorTorsion.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/DenominatorTorsion.lean index 2c3b829236..1ee3b588d5 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/DenominatorTorsion.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/DenominatorTorsion.lean @@ -23,7 +23,7 @@ the principal right-ideal case is proved directly from the opposite Ore condition. No stage freeness or noncommutative flatness is postulated. -/ -@[expose] public section +public section namespace AlgebraicAnalysis namespace DenominatorTorsion diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/EndomorphismKernelSupport.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/EndomorphismKernelSupport.lean index acee9a8ae7..eaeb3501a8 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/EndomorphismKernelSupport.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/EndomorphismKernelSupport.lean @@ -18,7 +18,7 @@ Noetherian ring. The proof is deliberately made at a prime, using the actual `LocalizedModule` support definition. -/ -@[expose] public section +public section namespace AlgebraicAnalysis diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/EndomorphismKernelSupportOverBase.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/EndomorphismKernelSupportOverBase.lean index a8d3ac9863..90f68fd421 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/EndomorphismKernelSupportOverBase.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/EndomorphismKernelSupportOverBase.lean @@ -18,7 +18,7 @@ over that algebra. This gives the kernel--cokernel support inclusion after restriction of scalars, without assuming finite generation over the base. -/ -@[expose] public section +public section namespace AlgebraicAnalysis diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/EscapeAssembly.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/EscapeAssembly.lean index 75b15dd544..53f05a8218 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/EscapeAssembly.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/EscapeAssembly.lean @@ -24,7 +24,7 @@ The theorem deliberately stops at this local span result. It does not claim that a global Stafford correction family supplies the hypotheses. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.EscapeAssembly diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/EscapeSpan.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/EscapeSpan.lean index 0fd467c094..30fc37e365 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/EscapeSpan.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/EscapeSpan.lean @@ -21,7 +21,7 @@ No claim is made here that a particular escape family produces the pure coordinate vectors. That is the remaining Stafford correction construction. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.EscapeSpan @@ -32,6 +32,7 @@ noncomputable section variable {S : Type*} [Ring S] {n : ℕ} /-- Coordinatewise right multiplication in the free right `S`-module. -/ +@[expose] def rightMulVector (v : Fin n → S) (a : S) : Fin n → S := fun i => v i * a @@ -45,6 +46,7 @@ theorem op_smul_vector (v : Fin n → S) (a : S) : rfl /-- Coordinatewise commutator with the distinguished escape coordinate. -/ +@[expose] def commutatorVector (x : S) (v : Fin n → S) : Fin n → S := fun i => commutator x (v i) diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredSchreyer.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredSchreyer.lean index 090a6ddb0d..16be36e1da 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredSchreyer.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredSchreyer.lean @@ -23,7 +23,7 @@ additive subgroup. No Ore, Weyl, or characteristic-variety structure is needed. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.FilteredSchreyer diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredStrictness.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredStrictness.lean index de31680f89..c8e4a1966d 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredStrictness.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredStrictness.lean @@ -17,7 +17,7 @@ subquotient of the filtration. The formulation here uses only submodules and their quotients; it does not introduce a separate associated-graded framework. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.FilteredStrictness diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredTwoTermBoundaryExhaustion.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredTwoTermBoundaryExhaustion.lean index ab4d599364..0bfbdb83ad 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredTwoTermBoundaryExhaustion.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredTwoTermBoundaryExhaustion.lean @@ -19,7 +19,7 @@ filtration imply pointwise eventual vanishing; finite support then gives the same statement on the external direct sum. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.FilteredTwoTermPages diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredTwoTermBoundaryNaturality.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredTwoTermBoundaryNaturality.lean index 3fd6643e6a..720e16fe5c 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredTwoTermBoundaryNaturality.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredTwoTermBoundaryNaturality.lean @@ -17,7 +17,7 @@ The quotient maps from page one to later target pages commute with every filtered operator. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.FilteredTwoTermPages diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredTwoTermPageActions.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredTwoTermPageActions.lean index 9f679332bf..00594e85b7 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredTwoTermPageActions.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredTwoTermPageActions.lean @@ -20,7 +20,7 @@ operator is unchanged on pages after adding one that shifts an additional filtration level. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.FilteredTwoTermPages @@ -90,6 +90,7 @@ theorem commute_apply (x : M) : K.f (P.g x) = P.g (K.f x) := by exact LinearMap.congr_fun P.commute x /-- The restriction of the operator to a source-page cycle numerator. -/ +@[expose] def sourceRestricted (r : ℕ) (p : ℤ) : K.cycles r p →ₗ[k] K.cycles r (p - d) := (P.g.comp (K.cycles r p).subtype).codRestrict (K.cycles r (p - d)) (by @@ -138,6 +139,7 @@ theorem sourcePageCast_mk (r : ℕ) {p q : ℤ} (h : p = q) rfl /-- The restriction of the operator to a target-page filtration piece. -/ +@[expose] def targetRestricted (p : ℤ) : K.G p →ₗ[k] K.G (p - d) := (P.g.comp (K.G p).subtype).codRestrict (K.G (p - d)) (fun x => P.shift p (x : M) x.property) @@ -169,6 +171,7 @@ private theorem targetRestricted_denominator (r : ℕ) (p : ℤ) : exact P.maps_boundaries r p hx /-- The operator induced on a target page. -/ +@[expose] def targetMap (r : ℕ) (p : ℤ) : K.TargetPage r p →ₗ[k] K.TargetPage r (p - d) := Submodule.mapQ _ _ (P.targetRestricted p) diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredTwoTermPageEquivalences.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredTwoTermPageEquivalences.lean index 26f2f4a37e..5002b5e0ba 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredTwoTermPageEquivalences.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredTwoTermPageEquivalences.lean @@ -18,7 +18,7 @@ This file proves, from the concrete representative definitions in differential and that the next target page is its cokernel. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.FilteredTwoTermPages @@ -40,6 +40,7 @@ private abbrev targetDenominator (r : ℕ) (p : ℤ) : (K.boundaries r p).comap (K.G p).subtype /-- Include cycles surviving the next page into the current cycle numerator. -/ +@[expose] def sourceSuccInclusion (r : ℕ) (p : ℤ) : K.cycles (r + 1) p →ₗ[k] K.cycles r p := Submodule.inclusion (K.cycles_succ_le r p) @@ -51,6 +52,7 @@ private theorem sourceSuccInclusion_denominator (r : ℕ) (p : ℤ) : exact hx /-- The map from the next source page to the current source page. -/ +@[expose] def sourceSuccMap (r : ℕ) (p : ℤ) : K.SourcePage (r + 1) p →ₗ[k] K.SourcePage r p := Submodule.mapQ _ _ (K.sourceSuccInclusion r p) @@ -73,6 +75,7 @@ private theorem drop_sourceSuccMap_eq_zero (r : ℕ) (p : ℤ) (K.sourceSuccInclusion r p z) z.property /-- The canonical map from the next source page into the kernel of `d_r`. -/ +@[expose] def sourceSuccKernelMap (r : ℕ) (p : ℤ) : K.SourcePage (r + 1) p →ₗ[k] LinearMap.ker (K.drop r p) := (K.sourceSuccMap r p).codRestrict (LinearMap.ker (K.drop r p)) @@ -112,6 +115,7 @@ private theorem sourceSuccKernelMap_surjective (r : ℕ) (p : ℤ) : /-- On the source, the next page is the kernel of the current page differential. -/ +@[expose] noncomputable def sourceSuccEquivKerDrop (r : ℕ) (p : ℤ) : K.SourcePage (r + 1) p ≃ₗ[k] LinearMap.ker (K.drop r p) := LinearEquiv.ofBijective (K.sourceSuccKernelMap r p) @@ -120,6 +124,7 @@ noncomputable def sourceSuccEquivKerDrop (r : ℕ) (p : ℤ) : K.sourceSuccKernelMap_surjective r p⟩) /-- The quotient map from a target page to its successor page. -/ +@[expose] def targetSuccMap (r : ℕ) (p : ℤ) : K.TargetPage r p →ₗ[k] K.TargetPage (r + 1) p := Submodule.mapQ _ _ LinearMap.id (by diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredTwoTermPages.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredTwoTermPages.lean index 527682dd31..2f3044b6d1 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredTwoTermPages.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredTwoTermPages.lean @@ -21,7 +21,7 @@ We use a decreasing, integer-indexed filtration `G`, as obtained from an increasing filtration `F` by `G p = F (-p)`. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.FilteredTwoTermPages @@ -45,10 +45,12 @@ namespace FilteredTwoTerm variable (K : FilteredTwoTerm k M) /-- The numerator of `Z_r` in the source. -/ +@[expose] def cycles (r : ℕ) (p : ℤ) : Submodule k M := K.G p ⊓ (K.G (p + r)).comap K.f /-- The numerator of `B_r` in the target. -/ +@[expose] def boundaries (r : ℕ) (p : ℤ) : Submodule k M := (K.G p ⊓ (K.G (p - r + 1)).map K.f) ⊔ K.G (p + 1) @@ -81,6 +83,7 @@ instance targetPageAddCommGroup (r : ℕ) (p : ℤ) : AddCommGroup (K.TargetPage (K.G p ⧸ (K.boundaries r p).comap (K.G p).subtype)) /-- Apply the filtered differential to a cycle representative. -/ +@[expose] def restrictedDrop (r : ℕ) (p : ℤ) : K.cycles r p →ₗ[k] K.G (p + r) := (K.f.comp (K.cycles r p).subtype).codRestrict (K.G (p + r)) @@ -99,6 +102,7 @@ private theorem drop_denominator (r : ℕ) (p : ℤ) : rfl /-- The page differential, formed by applying `f` to a representative. -/ +@[expose] def drop (r : ℕ) (p : ℤ) : K.SourcePage r p →ₗ[k] K.TargetPage r (p + r) := Submodule.mapQ _ _ (K.restrictedDrop r p) (by exact K.drop_denominator r p) diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredTwoTermSuccessorNaturality.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredTwoTermSuccessorNaturality.lean index ba3cc8cc60..21087b8853 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredTwoTermSuccessorNaturality.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredTwoTermSuccessorNaturality.lean @@ -17,7 +17,7 @@ page action. The proof is by direct-sum induction and quotient representatives; no abstract successor-page interface is used. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.FilteredTwoTermPages diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredTwoTermTotalActions.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredTwoTermTotalActions.lean index eaa6ea6be7..dd0860738f 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredTwoTermTotalActions.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredTwoTermTotalActions.lean @@ -17,7 +17,7 @@ into maps on the total direct sums. The index shift is part of the map: an operator of degree `d` sends the summand at `p` to the summand at `p - d`. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.FilteredTwoTermPages diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredTwoTermTotalPages.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredTwoTermTotalPages.lean index 4d109130c7..3b313704af 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredTwoTermTotalPages.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/FilteredTwoTermTotalPages.lean @@ -19,7 +19,7 @@ packages the component maps into one direct-sum map; no successor-page interface is assumed here. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.FilteredTwoTermPages @@ -93,6 +93,7 @@ private theorem totalDrop_apply_component (r : ℕ) (p : ℤ) /-- The componentwise successor map on the total source page. -/ +@[expose] noncomputable def sourceTotalSuccMap (r : ℕ) : K.SourceTotal (r + 1) →ₗ[k] K.SourceTotal r := DirectSum.lmap (fun p => @@ -151,6 +152,7 @@ private theorem targetReindex_totalDrop (r : ℕ) (x : K.SourceTotal r) : exact K.totalDrop_apply_component r p x /-- The componentwise quotient map on the total target page. -/ +@[expose] def targetTotalSuccMap (r : ℕ) : K.TargetTotal r →ₗ[k] K.TargetTotal (r + 1) := DirectSum.lmap (K.targetSuccMap r) diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/FreeSummandInduction.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/FreeSummandInduction.lean index 2cfe98acac..1afd102ea6 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/FreeSummandInduction.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/FreeSummandInduction.lean @@ -17,13 +17,14 @@ functionals. It does not assert that such a sequence can be constructed from rank or torsion hypotheses. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.FreeSummandInduction variable {R : Type*} [Ring R] /-- The harmless zero-factor equivalence used at the start of an iteration. -/ +@[expose] def emptyFactorEquiv (M : Type*) [AddCommGroup M] [Module R M] : M ≃ₗ[R] M × (Fin 0 → R) := { toFun := fun m ↦ (m, fun i ↦ Fin.elim0 i) diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/HyperplaneRestriction.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/HyperplaneRestriction.lean index 6828916e59..cdb32495c5 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/HyperplaneRestriction.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/HyperplaneRestriction.lean @@ -19,7 +19,7 @@ hypersurface. The proof is the determinant trick and is independent of any filtered or differential-operator application. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.HyperplaneRestriction diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/LocalizedKernelCokernelEquivalences.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/LocalizedKernelCokernelEquivalences.lean index 6b106ac19b..887fd1f8cc 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/LocalizedKernelCokernelEquivalences.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/LocalizedKernelCokernelEquivalences.lean @@ -17,7 +17,7 @@ needed by the successor pages. The equivalences below are obtained from the canonical submodule and quotient localization equivalences in Mathlib. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.LocalizedKernelCokernelEquivalences @@ -34,6 +34,7 @@ variable (S : Submonoid R) (f : U →ₗ[R] V) /-- The localization of an `R`-linear map, regarded as a map over the localized ring. -/ +@[expose] noncomputable def localizedMap : LocalizedModule S U →ₗ[Localization S] LocalizedModule S V := (LocalizedModule.map S f).extendScalarsOfIsLocalization S (Localization S) diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/LocalizedMinimalSupportAvoidance.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/LocalizedMinimalSupportAvoidance.lean index 01266261af..352f0f9124 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/LocalizedMinimalSupportAvoidance.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/LocalizedMinimalSupportAvoidance.lean @@ -20,7 +20,7 @@ Minimal-prime avoidance then follows from the ordinary minimal-prime correspondence for a localization. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.LocalizedMinimalSupportAvoidance diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/MinimalPrimeFiniteLengthLocalization.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/MinimalPrimeFiniteLengthLocalization.lean index 21e278d364..ba406ac979 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/MinimalPrimeFiniteLengthLocalization.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/MinimalPrimeFiniteLengthLocalization.lean @@ -23,7 +23,7 @@ if `P` is minimal over the annihilator of a finite module, then localization at `P` is nonzero and has finite length. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.MinimalPrimeFiniteLengthLocalization diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/MinimalSupportExistence.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/MinimalSupportExistence.lean index 453ef1bd74..4b5cc17b86 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/MinimalSupportExistence.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/MinimalSupportExistence.lean @@ -17,7 +17,7 @@ A nontrivial finite module over a commutative Noetherian ring has a prime in its support which is minimal among the support primes. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.MinimalSupportExistence diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/MinimalSupportKernelCokernelLengths.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/MinimalSupportKernelCokernelLengths.lean index ce10f19037..03d70d535c 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/MinimalSupportKernelCokernelLengths.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/MinimalSupportKernelCokernelLengths.lean @@ -20,7 +20,7 @@ explicitly; no restriction-of-scalars finiteness of the ambient module is used. -/ -@[expose] public section +public section namespace AlgebraicAnalysis diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/MonicAnnihilatorFinite.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/MonicAnnihilatorFinite.lean index fe697fef1e..f6066fc9b3 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/MonicAnnihilatorFinite.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/MonicAnnihilatorFinite.lean @@ -20,7 +20,7 @@ over the coefficient ring. This is the algebraic finiteness step for the normal covariable; no characteristic-support assertion is assumed. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.MonicAnnihilatorFinite diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/PrincipalKoszulFiniteTorsion.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/PrincipalKoszulFiniteTorsion.lean index db5be09c48..39611e17ad 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/PrincipalKoszulFiniteTorsion.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/PrincipalKoszulFiniteTorsion.lean @@ -22,7 +22,7 @@ nonzero. It proves only the strict length inequality and makes no noncharacteristic-support or geometric nonvanishing claim. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.PrincipalKoszulFiniteTorsion diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/PrincipalKoszulMinimalSupportPositivity.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/PrincipalKoszulMinimalSupportPositivity.lean index ed6b0a5271..606c0ebf6a 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/PrincipalKoszulMinimalSupportPositivity.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/PrincipalKoszulMinimalSupportPositivity.lean @@ -18,7 +18,7 @@ finite `C`-module itself. In particular, no finiteness of `E` over the base ring `R` is needed. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.PrincipalKoszulMinimalSupportPositivity diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/PrincipalKoszulPositivity.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/PrincipalKoszulPositivity.lean index 753739b18f..3ca7c48e87 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/PrincipalKoszulPositivity.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/PrincipalKoszulPositivity.lean @@ -20,7 +20,7 @@ a support prime avoids the scalar. The proof retains embedded torsion; it does not infer injectivity from minimal-prime avoidance. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.PrincipalKoszulPositivity diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/PrincipalKoszulSupportOverBase.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/PrincipalKoszulSupportOverBase.lean index 58a8893f22..bf370a6a6a 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/PrincipalKoszulSupportOverBase.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/PrincipalKoszulSupportOverBase.lean @@ -19,7 +19,7 @@ generation of `E` over `R` is needed: only the first `R`-kernel has finite length. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.PrincipalKoszulSupportOverBase diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/RankExact.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/RankExact.lean index 1807b83e89..d368944af1 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/RankExact.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/RankExact.lean @@ -21,7 +21,7 @@ known to split, its localized middle term is equivalent to a product and the rank is additive. No flatness or exactness interface is postulated here. -/ -@[expose] public section +public section namespace AlgebraicAnalysis namespace RankExact diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/RankTorsion.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/RankTorsion.lean index a744150ba8..19b9a61522 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/RankTorsion.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/RankTorsion.lean @@ -35,7 +35,7 @@ Mathlib remains available, but is deliberately not reused as a theorem about noncommutative `R`. -/ -@[expose] public section +public section namespace AlgebraicAnalysis namespace RankTorsion @@ -118,6 +118,7 @@ abbrev LocalizedRightModule (R : Type u) (M : Type v) M[(Rᵐᵒᵖ)⁰⁻¹] /-- The rank of a right module after passage to the full fraction ring. -/ +@[expose] noncomputable def oreRank (M : Type v) [AddCommGroup M] [Module Rᵐᵒᵖ M] : Cardinal := Module.rank (FractionRingOp R) (LocalizedRightModule R M) omit [Nontrivial R] [NoZeroDivisors R] in diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/RightCoordinates.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/RightCoordinates.lean index 6e78d975b8..5d185545c7 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/RightCoordinates.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/RightCoordinates.lean @@ -25,7 +25,7 @@ single-coordinate decomposition. No freeness of an Ore localization is assumed or encoded by an equivalent hypothesis here. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.RightCoordinates @@ -34,6 +34,7 @@ noncomputable section variable {S ι α : Type*} [Ring S] /-- The coordinatewise right action on finitely supported `S`-coordinates. -/ +@[expose] def rightCoordinateAction (v : ι →₀ S) (a : S) : ι →₀ S := (MulOpposite.op a : Sᵐᵒᵖ) • v diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/Splice.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/Splice.lean index ba88379460..7fc5277caa 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/Splice.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/Splice.lean @@ -19,7 +19,7 @@ assumption. The hypotheses that construct the relevant submodules remain with the application. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.Splice diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/SplitLatticePresentation.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/SplitLatticePresentation.lean index 2b8928fa1d..6a567c5425 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/SplitLatticePresentation.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/SplitLatticePresentation.lean @@ -20,7 +20,7 @@ basis only inside the proof produces a column matrix and a retraction matrix. The matrices split, and their columns span exactly the original submodule. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.SplitLatticePresentation diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/StableTorsionResidualSupport.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/StableTorsionResidualSupport.lean index 102674e255..c5438545dd 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/StableTorsionResidualSupport.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/StableTorsionResidualSupport.lean @@ -18,7 +18,7 @@ sequence for the power kernel splits support into torsion and residual parts, and `support_quotSMulTop` then applies at the larger prime. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.StableTorsionResidualSupport diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/StablyFree.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/StablyFree.lean index 9529f54660..adc1d02b12 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/StablyFree.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/StablyFree.lean @@ -17,7 +17,7 @@ stable freeness used in filtered-ring arguments. It is a definition, not a claim that any particular ring has the property. -/ -@[expose] public section +public section namespace AlgebraicAnalysis namespace StablyFree diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/TorsionProjectiveImage.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/TorsionProjectiveImage.lean index dbd57b8aee..472232e226 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/TorsionProjectiveImage.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/TorsionProjectiveImage.lean @@ -18,7 +18,7 @@ through the first factor. It does not assert that a torsion module admits such a presentation. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.TorsionProjectiveImage diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/TriangularDenominator.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/TriangularDenominator.lean index 2cb9bf4258..5820e5d3ef 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/TriangularDenominator.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/TriangularDenominator.lean @@ -24,7 +24,7 @@ The hypotheses describing the filtration are data, rather than an assertion that an arbitrary Ore extension is free or flat. -/ -@[expose] public section +public section namespace AlgebraicAnalysis namespace TriangularDenominator diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/TwoSimplicity.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/TwoSimplicity.lean index 88fa8ed39e..f772db1fd6 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/TwoSimplicity.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/TwoSimplicity.lean @@ -20,7 +20,7 @@ torsion statement to two-simplicity. It does not assert the localization or rank theorem needed to produce that torsion statement. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.TwoSimplicity diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/TwoTermPageLength.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/TwoTermPageLength.lean index f4d80dcb3d..26e4a53990 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/TwoTermPageLength.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/TwoTermPageLength.lean @@ -15,7 +15,7 @@ public import Mathlib.Tactic Length comparison for stabilized two-term pages with exhaustive target boundaries. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.TwoTermPageLength diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/UniformBoundaryVanishing.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/UniformBoundaryVanishing.lean index 6dfcc7dfd8..517159553e 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/UniformBoundaryVanishing.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/UniformBoundaryVanishing.lean @@ -19,7 +19,7 @@ localized statement deliberately assumes Noetherianity only after localization. -/ -@[expose] public section +public section open IsNoetherian diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Module/Unimodular.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Module/Unimodular.lean index 063f40db26..f26161f1e3 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Module/Unimodular.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Module/Unimodular.lean @@ -18,7 +18,7 @@ to a unimodular element. It uses no rank, Ore, simplicity, or finiteness hypothesis. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.Unimodular diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Ore/ActiveCoordinate.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Ore/ActiveCoordinate.lean index f625ae61f4..94bec914b4 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Ore/ActiveCoordinate.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Ore/ActiveCoordinate.lean @@ -21,7 +21,7 @@ The results use only the checked normal-form construction. They do not postulate a PBW basis, a presented Weyl algebra, or an operator realization. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.OreActiveCoordinate diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Ore/Associativity.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Ore/Associativity.lean index 10d276dcf0..8a2508402f 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Ore/Associativity.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Ore/Associativity.lean @@ -16,7 +16,7 @@ This removes the commutativity assumption from the faithful-operator proof of associativity for `Stafford.OreDivision.rightMul`. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.OreAssociativity @@ -110,6 +110,7 @@ def leftOreShift (D : OreDivisionDerivation B) : abel /-- The faithful left-regular representation of the one-variable Ore model. -/ +@[expose] def faithfulAmbient (D : OreDivisionDerivation B) : OreAmbient B (AddMonoid.End (Polynomial B)) D where embed := coefficientLeft @@ -210,6 +211,7 @@ theorem rightMul_assoc_of_ring /-! ## The concrete associative Ore ring -/ /-- The image of the faithful normal-form representation. -/ +@[expose] def faithfulRange (D : OreDivisionDerivation B) : Subring (AddMonoid.End (Polynomial B)) where carrier := Set.range (OreAmbient.eval D (faithfulAmbient D)) @@ -230,6 +232,7 @@ left-regular action on normal polynomials. -/ abbrev NormalOre (D : OreDivisionDerivation B) := faithfulRange D /-- A coefficient-left polynomial regarded as an element of the Ore ring. -/ +@[expose] def normalForm (D : OreDivisionDerivation B) (p : Polynomial B) : NormalOre D := ⟨OreAmbient.eval D (faithfulAmbient D) p, ⟨p, rfl⟩⟩ @@ -278,6 +281,7 @@ theorem normalForm_mul (D : OreDivisionDerivation B) exact OreAmbient.eval_rightMul D (faithfulAmbient D) p q /-- The normal-form map as an additive homomorphism. -/ +@[expose] def normalFormAddHom (D : OreDivisionDerivation B) : Polynomial B →+ NormalOre D where toFun := normalForm D @@ -286,12 +290,14 @@ def normalFormAddHom (D : OreDivisionDerivation B) : /-- Normal forms are additively equivalent to ordinary coefficient-left polynomials. -/ +@[expose] def normalFormAddEquiv (D : OreDivisionDerivation B) : Polynomial B ≃+ NormalOre D := AddEquiv.ofBijective (normalFormAddHom D) ⟨normalForm_injective D, normalForm_surjective D⟩ /-- The canonical coefficient embedding. -/ +@[expose] def normalCoefficient (D : OreDivisionDerivation B) : B →+* NormalOre D := coefficientLeft.codRestrict (faithfulRange D) fun b => by exact ⟨C b, faithful_eval_C D b⟩ @@ -303,6 +309,7 @@ theorem normalForm_C (D : OreDivisionDerivation B) (b : B) : exact faithful_eval_C D b /-- The canonical Ore variable. -/ +@[expose] def normalVariable (D : OreDivisionDerivation B) : NormalOre D := normalForm D X diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Ore/IteratedPBW.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Ore/IteratedPBW.lean index 0f18ee06e3..3e31f08085 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Ore/IteratedPBW.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Ore/IteratedPBW.lean @@ -19,7 +19,7 @@ coefficient embedding at every stage; no centrality of the coefficient field inside the Ore ring is used. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.OreIteratedPBW diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Ore/IteratedTower.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Ore/IteratedTower.lean index 4845fa2f02..3d6a994156 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Ore/IteratedTower.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Ore/IteratedTower.lean @@ -23,7 +23,7 @@ faithfulness and freeness over a rational Weyl subring are deliberately not asserted here. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.OreIteratedTower @@ -44,16 +44,19 @@ variable {B : Type u} [Ring B] abbrev Derivation (B : Type u) [Ring B] := OreDivisionDerivation B /-- Commutation of two coefficient derivations. -/ +@[expose] def Commutes (D E : Derivation B) : Prop := ∀ b : B, D (E b) = E (D b) /-- Pairwise commutation for a finite ordered family. -/ +@[expose] def PairwiseCommutes : List (Derivation B) → Prop | [] => True | D :: Ds => (∀ E ∈ Ds, Commutes D E) ∧ PairwiseCommutes Ds /-- Commutation of one derivation with every member of a list. -/ +@[expose] def CommutesWith (D : Derivation B) : List (Derivation B) → Prop | Es => ∀ E ∈ Es, Commutes D E @@ -99,6 +102,7 @@ structure TowerBuild (Ds : List (Derivation B)) Commutes (B := carrier) (extend D hD) (extend E hE) /-- Recursively construct the finite commuting derivation-Ore tower. -/ +@[expose] def build : (Ds : List (Derivation B)) → (hDs : PairwiseCommutes Ds) → TowerBuild Ds hDs | [], _ => diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Ore/LeftPBW.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Ore/LeftPBW.lean index 5148ee454e..faf3acfebf 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Ore/LeftPBW.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Ore/LeftPBW.lean @@ -24,7 +24,7 @@ The iterated tower still needs the commuting derivations to be extended over earlier stages. Nothing in this file postulates such extensions. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.OreLeftPBW @@ -62,6 +62,7 @@ theorem normalForm_smul_left (D : OreDivisionDerivation K) /-- Coefficient-left Ore normal form as a linear equivalence over the coefficient field. -/ +@[expose] def leftNormalFormLinearEquiv (D : OreDivisionDerivation K) : Polynomial K ≃ₗ[K] NormalOre D := { normalFormAddEquiv D with diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Ore/Localization.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Ore/Localization.lean index 909fb918d4..cfc7129d71 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Ore/Localization.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Ore/Localization.lean @@ -18,7 +18,7 @@ Ore condition. No flatness, Noetherianity, or freeness of a localized ring over a stage ring is assumed. -/ -@[expose] public section +public section namespace AlgebraicAnalysis namespace OreStageLocalization diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Ore/LocalizationExtension.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Ore/LocalizationExtension.lean index 38f2aa35b7..dcb8e45963 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Ore/LocalizationExtension.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Ore/LocalizationExtension.lean @@ -19,7 +19,7 @@ extension of the localized coefficient ring. It packages data and its compatibility law; it does not assert that the data exist. -/ -@[expose] public section +public section namespace AlgebraicAnalysis namespace OreLocalizationExtension diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Ore/PrincipalRightIdeal.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Ore/PrincipalRightIdeal.lean index d4dc394991..69e8f5270f 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Ore/PrincipalRightIdeal.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Ore/PrincipalRightIdeal.lean @@ -20,7 +20,7 @@ explicit: division has the divisor on the left and the quotient on the right. No simplicity, localization, or left-PID statement is asserted here. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.OrePrincipalRightIdeal diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Ore/RightDivision.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Ore/RightDivision.lean index 58d34865eb..6c3bf8d77f 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Ore/RightDivision.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Ore/RightDivision.lean @@ -26,7 +26,7 @@ The coefficient ring is allowed to be noncommutative. No commutative polynomial division theorem is used. -/ -@[expose] public section +public section namespace AlgebraicAnalysis @@ -122,12 +122,14 @@ The definition is coefficientwise and finite. It is deliberately not the ordinary multiplication of `Polynomial B`: the inner `push` expansion is the derivation correction for moving `b` through powers of `x`. -/ +@[expose] def rightTerm (i : ℕ) (a b : B) (j : ℕ) : Polynomial B := ∑ k ∈ Finset.range (i + 1), Polynomial.monomial (i - k + j) (a * (Nat.choose i k • (D^[k]) b)) /-- Right multiplication by one coefficient-monomial. -/ +@[expose] def rightMulMonomial (p : Polynomial B) (b : B) (j : ℕ) : Polynomial B := p.sum (fun i a => rightTerm D i a b j) @@ -211,6 +213,7 @@ lemma rightMulMonomial_zero_right (p : Polynomial B) (j : ℕ) : simp [iterate_zero] /-- The product `d*q` of a normal polynomial by a normal right quotient. -/ +@[expose] def rightMul (d q : Polynomial B) : Polynomial B := q.sum (fun j c => rightMulMonomial D d c j) @@ -645,14 +648,17 @@ theorem pow_mul (b : B) (n : ℕ) : rw [hsecond] /-- A single coefficient moved through a power of the Ore variable. -/ +@[expose] def reverseTerm (b : B) (i j : ℕ) : A := O.x ^ j * O.embed ((D^[i]) b) /-- A signed term for the reverse normal-order expansion. -/ +@[expose] def reverseSignedTerm (b : B) (i j : ℕ) : A := (-1 : A) ^ i * reverseTerm D O b i j /-- The reverse normal-order expansion of `x^n * embed b`. -/ +@[expose] def reverseExpansion (b : B) (n : ℕ) : A := ∑ ij ∈ Finset.HasAntidiagonal.antidiagonal n, n.choose ij.1 • reverseSignedTerm D O b ij.1 ij.2 @@ -1014,6 +1020,7 @@ theorem commutator_iterate_eval_monomial by_cases hjn : j ≤ n <;> simp [hjn] /-- Evaluation of a normal polynomial in an ambient Ore ring. -/ +@[expose] def eval (p : Polynomial B) : A := p.sum (fun i b => O.embed b * O.x ^ i) @@ -1040,6 +1047,7 @@ lemma eval_add (p q : Polynomial B) : rw [map_add, add_mul] /-- The additive evaluation homomorphism. -/ +@[expose] def evalAddHom : Polynomial B →+ A where toFun := eval D O map_zero' := eval_zero D O diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Ore/RightHilbertBasis.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Ore/RightHilbertBasis.lean index 277202ce05..89d3a2699f 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Ore/RightHilbertBasis.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Ore/RightHilbertBasis.lean @@ -19,7 +19,7 @@ right ideals of the coefficient ring are represented as submodules for the opposite scalar ring. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.OreDerivationRightHilbertBasis diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Ore/RightIntersection.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Ore/RightIntersection.lean index 6d954abbad..9b2254b0cc 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Ore/RightIntersection.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Ore/RightIntersection.lean @@ -20,7 +20,7 @@ right Ore condition is kept as an explicit common-right-multiple hypothesis; this module does not depend on a particular localization construction. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.OreRightIntersection diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Ore/RightLocalization.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Ore/RightLocalization.lean index afdfab67c3..fcc5f4340f 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Ore/RightLocalization.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Ore/RightLocalization.lean @@ -19,7 +19,7 @@ right-denominator clearing API. Extracted from Stafford38 commit c8a513d553b24c7c08da82f496c44dbbaeb1f2fc. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.OreRightLocalization diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Ore/RightPBW.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Ore/RightPBW.lean index 300e81f507..8553ebd03d 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Ore/RightPBW.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Ore/RightPBW.lean @@ -20,7 +20,7 @@ monomials form a genuine right basis; the proof uses finite-support maximal degree induction, so no freeness or flatness assumption is introduced. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.OreRightPBW @@ -39,6 +39,7 @@ universe u variable {B : Type u} [Ring B] /-- The candidate right-coefficient PBW monomial of order `n`. -/ +@[expose] def rightPBWMonomial (D : OreDivisionDerivation B) (n : ℕ) : NormalOre D := normalForm D (Polynomial.X ^ n) diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Ore/RightQuotient.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Ore/RightQuotient.lean index 922eb88689..54d4a3b004 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Ore/RightQuotient.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Ore/RightQuotient.lean @@ -21,7 +21,7 @@ The final section instantiates the construction on the outer momentum layer of the iterated Weyl tower and uses the literal generators `d` and `x^N d`. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.OreRightQuotient @@ -143,6 +143,7 @@ theorem normalForm_monomial_reverse (D : OreDivisionDerivation B) rw [normalForm_X_pow_coe] /-- The finite right-coefficient window of order less than `n`. -/ +@[expose] def rightCoefficientWindow (D : OreDivisionDerivation B) (n : ℕ) : Submodule Bᵐᵒᵖ (NormalOre D) := Submodule.span Bᵐᵒᵖ @@ -189,6 +190,7 @@ theorem normalForm_mem_rightCoefficientWindow_of_degree_lt exact lt_of_le_of_lt (Polynomial.le_natDegree_of_mem_supp j hj) hp /-- A right ideal viewed as a coefficient-opposite submodule. -/ +@[expose] def rightIdealAsCoeffSubmodule (D : OreDivisionDerivation B) (I : Submodule (NormalOre D)ᵐᵒᵖ (NormalOre D)) : Submodule Bᵐᵒᵖ (NormalOre D) where @@ -202,6 +204,7 @@ def rightIdealAsCoeffSubmodule (D : OreDivisionDerivation B) exact I.smul_mem (MulOpposite.op (normalCoefficient D b.unop)) ha /-- The right ideal generated by two normal forms. -/ +@[expose] def twoGeneratorRightIdeal (D : OreDivisionDerivation B) (H J : Polynomial B) : Submodule (NormalOre D)ᵐᵒᵖ (NormalOre D) := @@ -209,6 +212,7 @@ def twoGeneratorRightIdeal (D : OreDivisionDerivation B) ({normalForm D H, normalForm D J} : Set (NormalOre D)) /-- The coefficient-opposite submodule underlying a two-generator ideal. -/ +@[expose] def twoGeneratorCoeffSubmodule (D : OreDivisionDerivation B) (H J : Polynomial B) : Submodule Bᵐᵒᵖ (NormalOre D) := rightIdealAsCoeffSubmodule D (twoGeneratorRightIdeal D H J) diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Ore/Tower.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Ore/Tower.lean index fa54b966fc..622cca7449 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Ore/Tower.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Ore/Tower.lean @@ -19,7 +19,7 @@ normal form. The formulas at the coefficient embedding and at the Ore variable are part of the interface used by later tower stages. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.OreTower diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/Polynomial/DistinguishedVariable.lean b/LeanPool/Stafford38/AlgebraicAnalysis/Polynomial/DistinguishedVariable.lean index 70d7b340e8..877a37c599 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/Polynomial/DistinguishedVariable.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/Polynomial/DistinguishedVariable.lean @@ -22,7 +22,7 @@ prime containing the polynomial and every auxiliary variable also contains the distinguished variable, provided the pure coefficient is a unit. -/ -@[expose] public section +public section namespace AlgebraicAnalysis.MvPolynomial diff --git a/LeanPool/Stafford38/AlgebraicAnalysis/RingTheory/TwoGeneratorIdentity.lean b/LeanPool/Stafford38/AlgebraicAnalysis/RingTheory/TwoGeneratorIdentity.lean index c1002a87ec..7296b86af4 100644 --- a/LeanPool/Stafford38/AlgebraicAnalysis/RingTheory/TwoGeneratorIdentity.lean +++ b/LeanPool/Stafford38/AlgebraicAnalysis/RingTheory/TwoGeneratorIdentity.lean @@ -26,7 +26,7 @@ names and imports are intentionally absent. The written multiplication order is preserved. -/ -@[expose] public section +public section namespace AlgebraicAnalysis diff --git a/LeanPool/Stafford38/FixedSourceSolution.lean b/LeanPool/Stafford38/FixedSourceSolution.lean index 1d896ffdc7..421c8087aa 100644 --- a/LeanPool/Stafford38/FixedSourceSolution.lean +++ b/LeanPool/Stafford38/FixedSourceSolution.lean @@ -23,7 +23,7 @@ file only combines those facts; it adds no hypothesis and supplies no degree or normal-form datum. -/ -@[expose] public section +public section namespace Stafford38FixedSourceChallenge diff --git a/LeanPool/Stafford38/Proofs/Stafford38Reduction.lean b/LeanPool/Stafford38/Proofs/Stafford38Reduction.lean index 9f193c185a..4c82b66112 100644 --- a/LeanPool/Stafford38/Proofs/Stafford38Reduction.lean +++ b/LeanPool/Stafford38/Proofs/Stafford38Reduction.lean @@ -20,7 +20,7 @@ and nonzero scalars. These conditional interfaces are retained for current imports; the unconditional theorem is proved in `Stafford38.FoundationClosure`. -/ -@[expose] public section +public section namespace Stafford namespace Reduction diff --git a/LeanPool/Stafford38/Proofs/WeylPurePower.lean b/LeanPool/Stafford38/Proofs/WeylPurePower.lean index 0d887b12e5..bab52673ff 100644 --- a/LeanPool/Stafford38/Proofs/WeylPurePower.lean +++ b/LeanPool/Stafford38/Proofs/WeylPurePower.lean @@ -28,7 +28,7 @@ The remaining universal monic problem is not hidden here: it is the passage from a pure power to a general monic polynomial. -/ -@[expose] public section +public section namespace Stafford diff --git a/LeanPool/Stafford38/Proofs/WeylSymplectic.lean b/LeanPool/Stafford38/Proofs/WeylSymplectic.lean index 2785a0085b..38fb4696dc 100644 --- a/LeanPool/Stafford38/Proofs/WeylSymplectic.lean +++ b/LeanPool/Stafford38/Proofs/WeylSymplectic.lean @@ -36,7 +36,7 @@ linear-algebra scope. Reusable commutator identities are imported from AlgebraicAnalysis. -/ -@[expose] public section +public section namespace Stafford @@ -44,6 +44,7 @@ variable {k A ι : Type*} [Field k] [Ring A] [Algebra k A] [Fintype ι] [DecidableEq ι] /-- Historical namespace for the shared ring commutator. -/ +@[expose] def commutator (u v : A) : A := AlgebraicAnalysis.ringCommutator u v @[simp] @@ -51,6 +52,7 @@ theorem commutator_eq_shared (u v : A) : commutator u v = AlgebraicAnalysis.ringCommutator u v := rfl /-- The linear combination of a family of generators specified by a matrix. -/ +@[expose] def linearCombination (M : Matrix ι ι k) (z : ι → A) (i : ι) : A := ∑ j, algebraMap k A (M i j) * z j @@ -196,6 +198,7 @@ argument below proves the form-preserving A₂ map is an automorphism. -/ /-- The generating relation equating each generator commutator with the corresponding scalar form entry. -/ +@[expose] def freeWeylRelation (omega : Matrix ι ι k) (a b : FreeAlgebra k ι) : Prop := ∃ i j, @@ -208,6 +211,7 @@ abbrev FreeWeyl (k : Type*) [Field k] (ι : Type*) (omega : Matrix ι ι k) := RingQuot (freeWeylRelation omega) /-- The image of a free generator in the Weyl quotient. -/ +@[expose] def freeWeylGenerator (omega : Matrix ι ι k) (i : ι) : FreeWeyl k ι omega := RingQuot.mkAlgHom k (freeWeylRelation omega) (FreeAlgebra.ι k i) @@ -247,6 +251,7 @@ theorem freeWeylGenerator_commutator rfl /-- The linear combination of Weyl elements specified by a row of a matrix. -/ +@[expose] def freeWeylLinearCombination {omega : Matrix ι ι k} (M : Matrix ι ι k) (z : ι → FreeWeyl k ι omega) (i : ι) : FreeWeyl k ι omega := diff --git a/LeanPool/Stafford38/Solution.lean b/LeanPool/Stafford38/Solution.lean index 7b0c269931..6f6d4eaa08 100644 --- a/LeanPool/Stafford38/Solution.lean +++ b/LeanPool/Stafford38/Solution.lean @@ -13,7 +13,7 @@ public import LeanPool.Stafford38.Stafford38.FoundationClosure The presented Weyl algebra and the two-generator identity proved by Stafford’s theorem. -/ -@[expose] public section +public section namespace Stafford38Challenge diff --git a/LeanPool/Stafford38/Stafford38/CanonicalSupportVanishingReduction.lean b/LeanPool/Stafford38/Stafford38/CanonicalSupportVanishingReduction.lean index daf3b08f76..b9f00a1611 100644 --- a/LeanPool/Stafford38/Stafford38/CanonicalSupportVanishingReduction.lean +++ b/LeanPool/Stafford38/Stafford38/CanonicalSupportVanishingReduction.lean @@ -30,7 +30,7 @@ No finite phase-space limit is asserted: the Laurent base coordinates may have poles, and only the fibre residue is specialized. -/ -@[expose] public section +public section namespace Stafford38.CanonicalSupportVanishingReduction diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/ArtinianAdaptedBasisExistence.lean b/LeanPool/Stafford38/Stafford38/Characteristic/ArtinianAdaptedBasisExistence.lean index dec19aa2be..57c5a7a9ae 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/ArtinianAdaptedBasisExistence.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/ArtinianAdaptedBasisExistence.lean @@ -22,7 +22,7 @@ sorting by decreasing labels gives the ordered `Fin` basis used by the Artinian trace argument. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.ArtinianAdaptedBasisExistence diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/ArtinianAdaptedBasisTraceAdapter.lean b/LeanPool/Stafford38/Stafford38/Characteristic/ArtinianAdaptedBasisTraceAdapter.lean index f050dcb2ca..147fdfd820 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/ArtinianAdaptedBasisTraceAdapter.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/ArtinianAdaptedBasisTraceAdapter.lean @@ -33,7 +33,7 @@ hypothesis already implies trace zero. It is not a formalization of equation adapter is proved here. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.ArtinianAdaptedBasisTraceAdapter @@ -56,6 +56,7 @@ local notation "𝔪" => IsLocalRing.maximalIdeal R /-- Left multiplication on the special-fibre module, viewed as a `K`-linear endomorphism. -/ +@[expose] def leftMultiplicationEnd (r : R) : Module.End K V where toFun v := r • v map_add' := smul_add r diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/ArtinianCoefficientField.lean b/LeanPool/Stafford38/Stafford38/Characteristic/ArtinianCoefficientField.lean index d90c896795..7cafd10104 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/ArtinianCoefficientField.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/ArtinianCoefficientField.lean @@ -31,7 +31,7 @@ smoothness of the residue field therefore lifts its identity map through the residue quotient, producing the coefficient-field section. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/ArtinianEquation33TraceProducer.lean b/LeanPool/Stafford38/Stafford38/Characteristic/ArtinianEquation33TraceProducer.lean index d9ac5167a8..15e510a064 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/ArtinianEquation33TraceProducer.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/ArtinianEquation33TraceProducer.lean @@ -29,7 +29,7 @@ instantiate the localized right-Rees ring, identify the reduced matrix with the induced `z`-action, or prove the high-power Artinian reduction. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.ArtinianEquation33TraceProducer diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/ArtinianTriangularTrace.lean b/LeanPool/Stafford38/Stafford38/Characteristic/ArtinianTriangularTrace.lean index 801a00bcf7..d375d9de0d 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/ArtinianTriangularTrace.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/ArtinianTriangularTrace.lean @@ -37,7 +37,7 @@ the trace-zero operator from a square-zero module, or connect it to the localized right Rees module. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.ArtinianTriangularTrace @@ -52,6 +52,7 @@ variable {n : ℕ} /-- A square matrix is strictly upper triangular when every entry on or below the diagonal is zero. -/ +@[expose] def IsStrictUpperTriangular (M : Matrix (Fin (n + 1)) (Fin (n + 1)) K) : Prop := ∀ i j, j ≤ i → M i j = 0 diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/AssociatedGradedFinite.lean b/LeanPool/Stafford38/Stafford38/Characteristic/AssociatedGradedFinite.lean index 26a3936c09..688c3c7638 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/AssociatedGradedFinite.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/AssociatedGradedFinite.lean @@ -19,7 +19,7 @@ to the already checked minimal-prime localization theorem. No Noetherian, trace, or involutivity conclusion is hidden in the construction. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.AssociatedGradedFinite diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/AssociatedGradedModule.lean b/LeanPool/Stafford38/Stafford38/Characteristic/AssociatedGradedModule.lean index 59c8f03a90..12c8eff3a5 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/AssociatedGradedModule.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/AssociatedGradedModule.lean @@ -25,7 +25,7 @@ its annihilator is proved equal (not merely comparable) to that ideal. No Rees algebra, radical involutivity, or Gabber theorem is asserted here. -/ -@[expose] public section +public section namespace Stafford38.CharacteristicAssociatedGradedModule diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/BGab001CoefficientFieldTrace.lean b/LeanPool/Stafford38/Stafford38/Characteristic/BGab001CoefficientFieldTrace.lean index 772a272406..050624f81b 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/BGab001CoefficientFieldTrace.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/BGab001CoefficientFieldTrace.lean @@ -21,7 +21,7 @@ but sends each basis vector to a strictly deeper maximal-ideal layer. This is sufficient to kill its diagonal without replacing coefficients by residues. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.BGab001CoefficientFieldTrace diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/BaseLocalizationModuleComparison.lean b/LeanPool/Stafford38/Stafford38/Characteristic/BaseLocalizationModuleComparison.lean index b766abe77e..ed4c154539 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/BaseLocalizationModuleComparison.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/BaseLocalizationModuleComparison.lean @@ -14,7 +14,7 @@ Compatibility exports for comparison of base and coefficient localizations from the shared algebraic-analysis library. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.BaseLocalizationModuleComparison diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/BaseLocalizedKoszulPositivity.lean b/LeanPool/Stafford38/Stafford38/Characteristic/BaseLocalizedKoszulPositivity.lean index fea986fd1c..6a97871366 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/BaseLocalizedKoszulPositivity.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/BaseLocalizedKoszulPositivity.lean @@ -19,7 +19,7 @@ Compatibility exports for Koszul positivity after base localization from the shared algebraic-analysis library. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.BaseLocalizedKoszulPositivity diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/BaseRelativePoisson.lean b/LeanPool/Stafford38/Stafford38/Characteristic/BaseRelativePoisson.lean index 55e7c8d3a9..9bcce445a0 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/BaseRelativePoisson.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/BaseRelativePoisson.lean @@ -21,7 +21,7 @@ characteristic ideal of a Weyl module, satisfies this condition. Supplying that fact is the remaining Gabber input. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.BaseRelativePoisson diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/BaseZeroSection.lean b/LeanPool/Stafford38/Stafford38/Characteristic/BaseZeroSection.lean index 679472f076..dd2076f271 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/BaseZeroSection.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/BaseZeroSection.lean @@ -20,7 +20,7 @@ already determines a zero-section point of the full reduced support; no chosen point in the original support fibre is needed. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.BaseZeroSection diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalAxisAvoidanceConsumer.lean b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalAxisAvoidanceConsumer.lean index 7c22ce2e9a..e0b9c3371d 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalAxisAvoidanceConsumer.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalAxisAvoidanceConsumer.lean @@ -21,7 +21,7 @@ coordinate and derives strict filtered surjectivity and its associated-graded form. -/ -@[expose] public section +public section namespace Stafford38.CanonicalAxisAvoidanceConsumer diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalAxisMonicInitialTop.lean b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalAxisMonicInitialTop.lean index 0bf07e9f1b..009ec9fba5 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalAxisMonicInitialTop.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalAxisMonicInitialTop.lean @@ -31,7 +31,7 @@ No D-module theorem, noncharacteristic pullback theorem, or project axiom is used here. -/ -@[expose] public section +public section namespace Stafford38.CanonicalAxisMonicInitialTop diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalBaseVariety.lean b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalBaseVariety.lean index b9e70d297b..e05e6a59e4 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalBaseVariety.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalBaseVariety.lean @@ -22,7 +22,7 @@ has nonzero distinguished coordinate. These are exactly the affine premises of the remaining projective-boundary theorem. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.CanonicalBaseVariety diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalCertificate.lean b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalCertificate.lean index 51bb9651cc..28052ab4bf 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalCertificate.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalCertificate.lean @@ -20,7 +20,7 @@ ideal yields the exact fixed-source Stafford certificate. No theorem proving that the support is empty is assumed or supplied here. -/ -@[expose] public section +public section namespace Stafford38.CharacteristicCanonicalCertificate diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalFilteredGradedBridge.lean b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalFilteredGradedBridge.lean index 4fdfa43f00..45ffe2af91 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalFilteredGradedBridge.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalFilteredGradedBridge.lean @@ -17,7 +17,7 @@ This file records the first genuine page-level bridge: at `p = -m`, the zero-page source and target are the actual order-`m` quotient graded piece. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.CanonicalFilteredGradedBridge diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalFilteredTwoTerm.lean b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalFilteredTwoTerm.lean index b699abe0c6..5d3cbfdca4 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalFilteredTwoTerm.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalFilteredTwoTerm.lean @@ -19,7 +19,7 @@ The filtration is the actual order filtration on the quotient, extended by zero in negative order. No associated-graded identification is assumed here. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.CanonicalFilteredTwoTerm diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalGabberInvolutivityInterface.lean b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalGabberInvolutivityInterface.lean index daf7d4d43e..76e5226a37 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalGabberInvolutivityInterface.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalGabberInvolutivityInterface.lean @@ -59,7 +59,7 @@ every step trust-zero. No Gabber-type statement is proved here; the first proposition is a theorem-shaped interface a caller must still supply. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.CanonicalGabberInvolutivityInterface diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalGradedTangentialEquivalences.lean b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalGradedTangentialEquivalences.lean index 06db7c4a4e..58ae17a144 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalGradedTangentialEquivalences.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalGradedTangentialEquivalences.lean @@ -15,7 +15,7 @@ public import LeanPool.Stafford38.Stafford38.Characteristic.CanonicalTangentialS Tangentially linear equivalences between canonical total pages and graded modules. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.CanonicalGradedTangentialEquivalences diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalKoszulContradiction.lean b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalKoszulContradiction.lean index a3396c2769..c293247f2b 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalKoszulContradiction.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalKoszulContradiction.lean @@ -18,7 +18,7 @@ public import LeanPool.Stafford38.Stafford38.Characteristic.MinimalSupportExiste The contradiction between the canonical page length inequality and Koszul positivity. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.CanonicalKoszulContradiction diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalLaurentSymbolControl.lean b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalLaurentSymbolControl.lean index 4429a75ba1..ae49c962ad 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalLaurentSymbolControl.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalLaurentSymbolControl.lean @@ -22,7 +22,7 @@ proves directly that conormals generated by the scalar extension of the the post-extension base contraction is needed. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.CanonicalLaurentSymbolControl diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalMonicSaturation.lean b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalMonicSaturation.lean index 20795a0739..a2f623c944 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalMonicSaturation.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalMonicSaturation.lean @@ -34,7 +34,7 @@ preimages, but do not provide the strict differential-order estimate isolated below. -/ -@[expose] public section +public section namespace Stafford38.CanonicalMonicSaturation diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalNoncharacteristicCancellation.lean b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalNoncharacteristicCancellation.lean index 85753ec0b1..ac2437313b 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalNoncharacteristicCancellation.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalNoncharacteristicCancellation.lean @@ -26,7 +26,7 @@ coordinate). Monicity and unrestricted surjectivity alone do not prove that strictness statement; no such implication is assumed here. -/ -@[expose] public section +public section namespace Stafford38.CanonicalNoncharacteristicCancellation diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalNormalAxisSupport.lean b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalNormalAxisSupport.lean index eea65a3cff..75216206f2 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalNormalAxisSupport.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalNormalAxisSupport.lean @@ -21,7 +21,7 @@ This is the exact prime-ideal form of normal-axis exclusion. It proves no filtered strictness or noncharacteristic inverse-image theorem. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.CanonicalNormalAxisSupport diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalNormalSymbolFiniteness.lean b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalNormalSymbolFiniteness.lean index 0ff782148b..cf03c3564a 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalNormalSymbolFiniteness.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalNormalSymbolFiniteness.lean @@ -15,7 +15,7 @@ public import LeanPool.Stafford38.Stafford38.Characteristic.MonicAnnihilatorFini Finiteness of the canonical graded quotient from a monic normal-symbol annihilator. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.CanonicalNormalSymbolFiniteness diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalOldTangentialFiniteness.lean b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalOldTangentialFiniteness.lean index ce79c7d0be..3107afe6b5 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalOldTangentialFiniteness.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalOldTangentialFiniteness.lean @@ -13,7 +13,7 @@ public import LeanPool.Stafford38.Stafford38.Characteristic.CanonicalTangentialR Finiteness over the original tangential polynomial ring after changing phase variables. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.CanonicalOldTangentialFiniteness diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalPageEulerInequality.lean b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalPageEulerInequality.lean index e0ed570296..cf0212ea1f 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalPageEulerInequality.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalPageEulerInequality.lean @@ -17,7 +17,7 @@ public import LeanPool.Stafford38.Stafford38.Characteristic.TwoTermPageLength The localized Euler length inequality for canonical two-term pages. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.CanonicalPageEulerInequality open Stafford38.Characteristic diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalResidueExtensionSymbolControlAdapter.lean b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalResidueExtensionSymbolControlAdapter.lean index 7e5c1b094d..0b8f062705 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalResidueExtensionSymbolControlAdapter.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalResidueExtensionSymbolControlAdapter.lean @@ -55,7 +55,7 @@ Nothing here proves any Gabber-type statement; the new predicates are theorem-shaped interfaces that a caller must still prove. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.CanonicalResidueExtensionSymbolControlAdapter diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalSupportAvoidanceFromCokernel.lean b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalSupportAvoidanceFromCokernel.lean index 36dcd0aa90..f684530fd7 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalSupportAvoidanceFromCokernel.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalSupportAvoidanceFromCokernel.lean @@ -15,7 +15,7 @@ public import LeanPool.Stafford38.Stafford38.PaperInputs coordinate variable, so the same empty-support statement excludes the coordinate zero locus from the transposed support. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.CanonicalSupportAvoidanceFromCokernel diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalTangentialBoundaryMaps.lean b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalTangentialBoundaryMaps.lean index 87ebb879b8..972764306d 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalTangentialBoundaryMaps.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalTangentialBoundaryMaps.lean @@ -17,7 +17,7 @@ These are the actual quotient maps of the filtered complex, with their linearity over the tangential polynomial ring proved from the Weyl action. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.CanonicalTangentialTotalAction diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalTangentialPageOperators.lean b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalTangentialPageOperators.lean index e8fcb8f714..dfcdab4d76 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalTangentialPageOperators.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalTangentialPageOperators.lean @@ -19,7 +19,7 @@ filtered operator on the canonical quotient. The distinguished coordinate commutes with these operators, so they induce operators on every page. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.CanonicalTangentialPageOperators diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalTangentialRingEquivalence.lean b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalTangentialRingEquivalence.lean index fd2637ba42..ac66381083 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalTangentialRingEquivalence.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalTangentialRingEquivalence.lean @@ -13,7 +13,7 @@ public import LeanPool.Stafford38.Stafford38.Characteristic.CanonicalTangentialS The polynomial-ring equivalence identifying old and retained tangential variables. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.CanonicalTangentialRingEquivalence diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalTangentialSuccessors.lean b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalTangentialSuccessors.lean index b43b62e453..a00bb9a73d 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalTangentialSuccessors.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalTangentialSuccessors.lean @@ -18,7 +18,7 @@ injectivity, surjectivity and exactness therefore give kernel and cokernel equivalences over that ring, not just over the ground field. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.CanonicalTangentialTotalAction diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalTangentialSymbolFiniteness.lean b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalTangentialSymbolFiniteness.lean index 4bd207cfa5..0caeb3b2ee 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalTangentialSymbolFiniteness.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalTangentialSymbolFiniteness.lean @@ -13,7 +13,7 @@ public import LeanPool.Stafford38.Stafford38.Characteristic.CanonicalNormalSymbo Finiteness of canonical graded modules over the tangential symbol ring. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.CanonicalTangentialSymbolFiniteness diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalTangentialTotalAction.lean b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalTangentialTotalAction.lean index 3af1979f97..6005602c8c 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalTangentialTotalAction.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalTangentialTotalAction.lean @@ -17,7 +17,7 @@ The commuting polynomial action is constructed from the actual right Weyl generators. Their commutators have lower order and hence vanish on the pages. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.CanonicalTangentialTotalAction diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalTotalGradedActionCompatibility.lean b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalTotalGradedActionCompatibility.lean index 1b67f41633..0f3b4e9894 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalTotalGradedActionCompatibility.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalTotalGradedActionCompatibility.lean @@ -15,7 +15,7 @@ public import LeanPool.Stafford38.Stafford38.Characteristic.CanonicalTangentialR Compatibility of tangential polynomial actions with the total-to-graded equivalences. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.CanonicalTotalGradedActionCompatibility diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalTotalGradedBridge.lean b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalTotalGradedBridge.lean index 0d4250d309..31e890853b 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalTotalGradedBridge.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalTotalGradedBridge.lean @@ -15,7 +15,7 @@ public import LeanPool.Stafford38.Stafford38.Characteristic.FilteredTwoTermTotal Equivalences between total two-term pages and the canonical associated graded modules. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.CanonicalTotalGradedBridge diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalUnitCoordinatePreimage.lean b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalUnitCoordinatePreimage.lean index 447c46813e..4e84dc1f07 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalUnitCoordinatePreimage.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalUnitCoordinatePreimage.lean @@ -25,7 +25,7 @@ previous all-degree cancellation and strict-lower-preimage hypotheses imply the unit-only condition. No converse is asserted. -/ -@[expose] public section +public section namespace Stafford38.CanonicalUnitCoordinatePreimage diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalUnitPreimageFromInitialTop.lean b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalUnitPreimageFromInitialTop.lean index 063ff4626d..41ae7da0fb 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalUnitPreimageFromInitialTop.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/CanonicalUnitPreimageFromInitialTop.lean @@ -22,7 +22,7 @@ predecessor required by `StrictUnitCoordinatePreimage`. No noncharacteristic or characteristic-variety theorem is used here. -/ -@[expose] public section +public section namespace Stafford38.CanonicalUnitPreimageFromInitialTop diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/CommutingPolynomialAction.lean b/LeanPool/Stafford38/Stafford38/Characteristic/CommutingPolynomialAction.lean index 7773545ce4..74bc42bcda 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/CommutingPolynomialAction.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/CommutingPolynomialAction.lean @@ -14,7 +14,7 @@ Compatibility exports for polynomial actions from commuting endomorphisms from the shared algebraic-analysis library. -/ -@[expose] public section +public section namespace Stafford38.Characteristic diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/ConcreteEquation33SourceMatrices.lean b/LeanPool/Stafford38/Stafford38/Characteristic/ConcreteEquation33SourceMatrices.lean index df1e7a53b3..ff628716bd 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/ConcreteEquation33SourceMatrices.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/ConcreteEquation33SourceMatrices.lean @@ -36,7 +36,7 @@ remaining source-specific action identity; its exact signature is recorded at the end, without claiming the final operator trace. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.ConcreteEquation33SourceMatrices diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/ConcreteInducedZAction.lean b/LeanPool/Stafford38/Stafford38/Characteristic/ConcreteInducedZAction.lean index 0e83dee351..482944ffe5 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/ConcreteInducedZAction.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/ConcreteInducedZAction.lean @@ -31,7 +31,7 @@ requires expanding the commutator of the two constructed action equations and descending the resulting parameter-multiple equality through exactness. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.ConcreteInducedZAction diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/ConcreteLocalizedTwoBlockSpecialFibre.lean b/LeanPool/Stafford38/Stafford38/Characteristic/ConcreteLocalizedTwoBlockSpecialFibre.lean index 3d715f30e4..60aa32c56b 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/ConcreteLocalizedTwoBlockSpecialFibre.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/ConcreteLocalizedTwoBlockSpecialFibre.lean @@ -22,7 +22,7 @@ with the commutative doubled-power quotient. No Artinianness, module action, adapted basis, or equation-(3.3) input is used. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.ConcreteLocalizedTwoBlockSpecialFibre diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/ConcreteSquareZeroTraceData.lean b/LeanPool/Stafford38/Stafford38/Characteristic/ConcreteSquareZeroTraceData.lean index 4b0d650b23..f82ccf93f2 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/ConcreteSquareZeroTraceData.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/ConcreteSquareZeroTraceData.lean @@ -23,7 +23,7 @@ No localization, finite-length trace theorem, or radical involutivity theorem is asserted here. -/ -@[expose] public section +public section namespace Stafford38.CharacteristicConcreteSquareZeroTraceData diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/EmptySupportVanishing.lean b/LeanPool/Stafford38/Stafford38/Characteristic/EmptySupportVanishing.lean index 0fb4dc0ea5..2e14b9f1b8 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/EmptySupportVanishing.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/EmptySupportVanishing.lean @@ -19,7 +19,7 @@ vanishing. No action of the symbol ring on that direct sum is transported or used here. -/ -@[expose] public section +public section namespace Stafford38.CharacteristicEmptySupportVanishing diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/EndomorphismKernelSupport.lean b/LeanPool/Stafford38/Stafford38/Characteristic/EndomorphismKernelSupport.lean index 5cef946db0..ca4cf9e87d 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/EndomorphismKernelSupport.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/EndomorphismKernelSupport.lean @@ -14,7 +14,7 @@ Compatibility exports for support comparison for an endomorphism kernel and coke from the shared algebraic-analysis library. -/ -@[expose] public section +public section namespace Stafford38.Characteristic diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/EndomorphismKernelSupportOverBase.lean b/LeanPool/Stafford38/Stafford38/Characteristic/EndomorphismKernelSupportOverBase.lean index 031bda2baf..c3ddec2ea2 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/EndomorphismKernelSupportOverBase.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/EndomorphismKernelSupportOverBase.lean @@ -15,7 +15,7 @@ Compatibility exports for kernel and cokernel support over the base ring from the shared algebraic-analysis library. -/ -@[expose] public section +public section namespace Stafford38.Characteristic diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/FilteredQuotient.lean b/LeanPool/Stafford38/Stafford38/Characteristic/FilteredQuotient.lean index a5360019ec..e4ed69e6a6 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/FilteredQuotient.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/FilteredQuotient.lean @@ -24,7 +24,7 @@ graded `SymbolRing`-module equivalence and identify its annihilator/support with `orderInitialIdeal`. -/ -@[expose] public section +public section namespace Stafford38.CharacteristicFilteredQuotient diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/FilteredQuotientGraded.lean b/LeanPool/Stafford38/Stafford38/Characteristic/FilteredQuotientGraded.lean index 60a794ecf4..ee4c562238 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/FilteredQuotientGraded.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/FilteredQuotientGraded.lean @@ -24,7 +24,7 @@ that the degree-`N` part of the ideal generated by all initial symbols is exactly `orderSymbolRelation k I N`. -/ -@[expose] public section +public section namespace Stafford38.CharacteristicFilteredQuotientGraded diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/FilteredQuotientRees.lean b/LeanPool/Stafford38/Stafford38/Characteristic/FilteredQuotientRees.lean index cacf9104b0..cd851b0fb7 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/FilteredQuotientRees.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/FilteredQuotientRees.lean @@ -22,7 +22,7 @@ the required right action of the order-Rees ring. Kernel equality and that action are deliberately left as subsequent theorems. -/ -@[expose] public section +public section namespace Stafford38.CharacteristicFilteredQuotientRees diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/FilteredQuotientReesAction.lean b/LeanPool/Stafford38/Stafford38/Characteristic/FilteredQuotientReesAction.lean index 25c4bdd50d..7a414a632f 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/FilteredQuotientReesAction.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/FilteredQuotientReesAction.lean @@ -20,7 +20,7 @@ opposite of the order-Rees ring, so homogeneous scalar action is written right Weyl multiplication and raises filtration degree additively. -/ -@[expose] public section +public section namespace Stafford38.CharacteristicFilteredQuotientReesAction diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/FilteredQuotientReesExact.lean b/LeanPool/Stafford38/Stafford38/Characteristic/FilteredQuotientReesExact.lean index c07e45254c..cb363f7da5 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/FilteredQuotientReesExact.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/FilteredQuotientReesExact.lean @@ -21,7 +21,7 @@ Only `k`-linear maps are used here. In particular, this file introduces no Rees-ring action and asserts no special-fibre ring or module equivalence. -/ -@[expose] public section +public section namespace Stafford38.CharacteristicFilteredQuotientReesExact diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/FilteredQuotientSpecialFibre.lean b/LeanPool/Stafford38/Stafford38/Characteristic/FilteredQuotientSpecialFibre.lean index 00a93feb74..7e6f1eedf6 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/FilteredQuotientSpecialFibre.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/FilteredQuotientSpecialFibre.lean @@ -17,7 +17,7 @@ with the actual associated graded module. This is a `k`-linear equivalence only. The right order-Rees action and its parameter compatibility are separate. -/ -@[expose] public section +public section namespace Stafford38.CharacteristicFilteredQuotientSpecialFibre diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/FilteredQuotientSupport.lean b/LeanPool/Stafford38/Stafford38/Characteristic/FilteredQuotientSupport.lean index 34539df61a..c9f280a4fb 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/FilteredQuotientSupport.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/FilteredQuotientSupport.lean @@ -22,7 +22,7 @@ support equality, is not proved in this file. No conclusion about vanishing of the ungraded Weyl quotient is made here. -/ -@[expose] public section +public section namespace Stafford38.CharacteristicFilteredQuotientSupport diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/FilteredQuotientTwoJet.lean b/LeanPool/Stafford38/Stafford38/Characteristic/FilteredQuotientTwoJet.lean index 9ca93a4c2c..3b3565a01d 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/FilteredQuotientTwoJet.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/FilteredQuotientTwoJet.lean @@ -23,7 +23,7 @@ its action retains written right Weyl multiplication. No trace theorem, minimal-prime statement, or Gabber theorem is asserted. -/ -@[expose] public section +public section namespace Stafford38.CharacteristicFilteredQuotientTwoJet diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/FilteredTwoTermBoundaryExhaustion.lean b/LeanPool/Stafford38/Stafford38/Characteristic/FilteredTwoTermBoundaryExhaustion.lean index 640dbca3e4..fda3f93fb0 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/FilteredTwoTermBoundaryExhaustion.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/FilteredTwoTermBoundaryExhaustion.lean @@ -15,7 +15,7 @@ Compatibility exports for exhaustion of filtered two-term boundaries from the shared algebraic-analysis library. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.FilteredTwoTermPages diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/FilteredTwoTermBoundaryNaturality.lean b/LeanPool/Stafford38/Stafford38/Characteristic/FilteredTwoTermBoundaryNaturality.lean index da3333b1f1..be9c8978e8 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/FilteredTwoTermBoundaryNaturality.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/FilteredTwoTermBoundaryNaturality.lean @@ -16,7 +16,7 @@ Compatibility exports for naturality of filtered boundary maps from the shared algebraic-analysis library. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.FilteredTwoTermPages diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/FilteredTwoTermPageActions.lean b/LeanPool/Stafford38/Stafford38/Characteristic/FilteredTwoTermPageActions.lean index e3eee2e59d..de2eb7ae32 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/FilteredTwoTermPageActions.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/FilteredTwoTermPageActions.lean @@ -15,7 +15,7 @@ Compatibility exports for operator actions on filtered two-term pages from the shared algebraic-analysis library. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.FilteredTwoTermPages diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/FilteredTwoTermPageEquivalences.lean b/LeanPool/Stafford38/Stafford38/Characteristic/FilteredTwoTermPageEquivalences.lean index 64a9d55c74..787d8808f8 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/FilteredTwoTermPageEquivalences.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/FilteredTwoTermPageEquivalences.lean @@ -15,7 +15,7 @@ Compatibility exports for successor-page kernel and cokernel equivalences from the shared algebraic-analysis library. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.FilteredTwoTermPages diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/FilteredTwoTermPages.lean b/LeanPool/Stafford38/Stafford38/Characteristic/FilteredTwoTermPages.lean index e3f2bdb7af..8ce03ca952 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/FilteredTwoTermPages.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/FilteredTwoTermPages.lean @@ -14,7 +14,7 @@ Compatibility exports for filtered two-term cycles, boundaries, and pages from the shared algebraic-analysis library. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.FilteredTwoTermPages diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/FilteredTwoTermSuccessorNaturality.lean b/LeanPool/Stafford38/Stafford38/Characteristic/FilteredTwoTermSuccessorNaturality.lean index 4a9007a6d1..bed947c3c4 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/FilteredTwoTermSuccessorNaturality.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/FilteredTwoTermSuccessorNaturality.lean @@ -15,7 +15,7 @@ Compatibility exports for naturality of successor-page operators from the shared algebraic-analysis library. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.FilteredTwoTermPages diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/FilteredTwoTermTotalActions.lean b/LeanPool/Stafford38/Stafford38/Characteristic/FilteredTwoTermTotalActions.lean index b6698c084c..e8af171ecf 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/FilteredTwoTermTotalActions.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/FilteredTwoTermTotalActions.lean @@ -15,7 +15,7 @@ Compatibility exports for operator actions on total filtered two-term pages from the shared algebraic-analysis library. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.FilteredTwoTermPages diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/FilteredTwoTermTotalPages.lean b/LeanPool/Stafford38/Stafford38/Characteristic/FilteredTwoTermTotalPages.lean index ea92846917..7ef2a0ae04 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/FilteredTwoTermTotalPages.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/FilteredTwoTermTotalPages.lean @@ -16,7 +16,7 @@ Compatibility exports for total filtered two-term pages from the shared algebraic-analysis library. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.FilteredTwoTermPages diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/FilteredVanishing.lean b/LeanPool/Stafford38/Stafford38/Characteristic/FilteredVanishing.lean index e628a563fb..1316c20ba4 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/FilteredVanishing.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/FilteredVanishing.lean @@ -20,7 +20,7 @@ by one. Exhaustivity of the PBW order filtration then reaches every quotient class. -/ -@[expose] public section +public section namespace Stafford38.CharacteristicFilteredVanishing diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/GabberGlobalAssembly.lean b/LeanPool/Stafford38/Stafford38/Characteristic/GabberGlobalAssembly.lean index dabe8f171b..0cd0787ff8 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/GabberGlobalAssembly.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/GabberGlobalAssembly.lean @@ -30,7 +30,7 @@ This is the classical theorem implemented for cyclic Weyl quotients. Its exact radical-involutivity interface is proved here; see docs/literature.md and docs/proof-guide.md. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.GabberGlobalAssembly diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/GeometricSupportDescent.lean b/LeanPool/Stafford38/Stafford38/Characteristic/GeometricSupportDescent.lean index 017933c75a..d3256637ba 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/GeometricSupportDescent.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/GeometricSupportDescent.lean @@ -24,7 +24,7 @@ residue field into the algebraic closure. It does not use characteristic varieties, Gabber's theorem, or asymptotic geometry. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.GeometricSupportDescent diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/GeometricSupportScalarExtension.lean b/LeanPool/Stafford38/Stafford38/Characteristic/GeometricSupportScalarExtension.lean index 2045932d91..7e1a7612c7 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/GeometricSupportScalarExtension.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/GeometricSupportScalarExtension.lean @@ -20,7 +20,7 @@ universal Gabber theorem can be run directly over the extension field; no unrecorded transport of Poisson closure is needed. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.GeometricSupportScalarExtension diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/HomogeneousChart.lean b/LeanPool/Stafford38/Stafford38/Characteristic/HomogeneousChart.lean index d5b51bdf03..062bf62d59 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/HomogeneousChart.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/HomogeneousChart.lean @@ -22,7 +22,7 @@ pure-power coefficient. The remaining chart-existence obligation is to place the chosen nonzero vector into a prescribed column of a symplectic matrix. -/ -@[expose] public section +public section namespace Stafford38.CharacteristicHomogeneousChart diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/InitialIdeal.lean b/LeanPool/Stafford38/Stafford38/Characteristic/InitialIdeal.lean index 9bb431ba76..70fb57eb1d 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/InitialIdeal.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/InitialIdeal.lean @@ -20,7 +20,7 @@ construction is concrete: no abstract D-module or characteristic-variety interface is assumed. -/ -@[expose] public section +public section namespace Stafford38.CharacteristicInitialIdeal diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/InitialIdealHomogeneous.lean b/LeanPool/Stafford38/Stafford38/Characteristic/InitialIdealHomogeneous.lean index 22ee87aed4..8bbf6c17aa 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/InitialIdealHomogeneous.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/InitialIdealHomogeneous.lean @@ -20,7 +20,7 @@ polynomial multiplier and the homogeneous relation closure proved in `FilteredQuotientGraded`. -/ -@[expose] public section +public section namespace Stafford38.CharacteristicInitialIdealHomogeneous diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/LinearAction.lean b/LeanPool/Stafford38/Stafford38/Characteristic/LinearAction.lean index f19e1abaff..4fd4977e9f 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/LinearAction.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/LinearAction.lean @@ -18,7 +18,7 @@ matrix order, matching the Weyl-generator substitution convention. Explicit mutual inverse certificates produce an algebra equivalence. -/ -@[expose] public section +public section namespace Stafford38.CharacteristicLinearAction @@ -31,12 +31,14 @@ universe u variable (k : Type u) [Field k] /-- The linear symbol polynomial determined by a row of the change-of-variables matrix. -/ +@[expose] def symbolLinearCombination {n : ℕ} (M : Matrix (PhaseVar n) (PhaseVar n) k) (i : PhaseVar n) : SymbolRing k n := ∑ j, MvPolynomial.C (M i j) * MvPolynomial.X j /-- The symbol-algebra map induced by a matrix of linear substitutions. -/ +@[expose] def symbolLinearAlgHom {n : ℕ} (M : Matrix (PhaseVar n) (PhaseVar n) k) : SymbolRing k n →ₐ[k] SymbolRing k n := diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/LocalizedHighPowerTwoBlockVanishing.lean b/LeanPool/Stafford38/Stafford38/Characteristic/LocalizedHighPowerTwoBlockVanishing.lean index 176d149234..554aaca92e 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/LocalizedHighPowerTwoBlockVanishing.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/LocalizedHighPowerTwoBlockVanishing.lean @@ -25,7 +25,7 @@ displayed product order. No residue-field action is placed on the deformation module. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.LocalizedHighPowerTwoBlockVanishing diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/LocalizedKernelCokernelEquivalences.lean b/LeanPool/Stafford38/Stafford38/Characteristic/LocalizedKernelCokernelEquivalences.lean index 239f5f1cfa..a229efc634 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/LocalizedKernelCokernelEquivalences.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/LocalizedKernelCokernelEquivalences.lean @@ -14,7 +14,7 @@ Compatibility exports for localization of kernels and cokernels from the shared algebraic-analysis library. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.LocalizedKernelCokernelEquivalences diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/LocalizedMinimalSupportAvoidance.lean b/LeanPool/Stafford38/Stafford38/Characteristic/LocalizedMinimalSupportAvoidance.lean index 6a40b6a9d0..4246ece609 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/LocalizedMinimalSupportAvoidance.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/LocalizedMinimalSupportAvoidance.lean @@ -14,7 +14,7 @@ Compatibility exports for minimal support avoidance after localization from the shared algebraic-analysis library. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.LocalizedMinimalSupportAvoidance diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/LocalizedOrderReesTwoJetSpecializationKernel.lean b/LeanPool/Stafford38/Stafford38/Characteristic/LocalizedOrderReesTwoJetSpecializationKernel.lean index 95480862cd..318316a8e5 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/LocalizedOrderReesTwoJetSpecializationKernel.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/LocalizedOrderReesTwoJetSpecializationKernel.lean @@ -25,7 +25,7 @@ particular, the localized parameter is written on the left; centrality is used explicitly before applying the unlocalized factorization. -/ -@[expose] public section +public section namespace Stafford38.CharacteristicLocalizedOrderReesTwoJetSpecializationKernel diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/LocalizedSpecializationActionCompatibility.lean b/LeanPool/Stafford38/Stafford38/Characteristic/LocalizedSpecializationActionCompatibility.lean index 8dacb44463..9f4c783712 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/LocalizedSpecializationActionCompatibility.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/LocalizedSpecializationActionCompatibility.lean @@ -24,7 +24,7 @@ No Artinian descent, characteristic-variety, or involutivity statement is made here. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.LocalizedSpecializationActionCompatibility diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/LocalizedTwoBlockModuleExactness.lean b/LeanPool/Stafford38/Stafford38/Characteristic/LocalizedTwoBlockModuleExactness.lean index ceefea6b10..d3c4caaa5c 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/LocalizedTwoBlockModuleExactness.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/LocalizedTwoBlockModuleExactness.lean @@ -22,7 +22,7 @@ No identification of the quotient ring modulo its parameter with the commutative doubled-power quotient is asserted. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.LocalizedTwoBlockModuleExactness diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/LocalizedTwoBlockPrincipalKernelDescent.lean b/LeanPool/Stafford38/Stafford38/Characteristic/LocalizedTwoBlockPrincipalKernelDescent.lean index 48e279bc97..dd974817e4 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/LocalizedTwoBlockPrincipalKernelDescent.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/LocalizedTwoBlockPrincipalKernelDescent.lean @@ -26,7 +26,7 @@ No Artinianness, module-action statement, adapted basis, or matrix identity is used here. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.LocalizedTwoBlockPrincipalKernelDescent diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/LocalizedTwoBlockQuotient.lean b/LeanPool/Stafford38/Stafford38/Characteristic/LocalizedTwoBlockQuotient.lean index 648190f7ca..7a22c07719 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/LocalizedTwoBlockQuotient.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/LocalizedTwoBlockQuotient.lean @@ -27,7 +27,7 @@ congruence quotient by `J`. No source matrices, adapted basis, or trace identity is assumed here. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.LocalizedTwoBlockQuotient diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/MinimalPrimeFiniteLengthLocalization.lean b/LeanPool/Stafford38/Stafford38/Characteristic/MinimalPrimeFiniteLengthLocalization.lean index 2125f219ae..dcd576cfd7 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/MinimalPrimeFiniteLengthLocalization.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/MinimalPrimeFiniteLengthLocalization.lean @@ -14,7 +14,7 @@ Compatibility exports for finite length after localization at a minimal support from the shared algebraic-analysis library. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.MinimalPrimeFiniteLengthLocalization diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/MinimalPrimePoisson.lean b/LeanPool/Stafford38/Stafford38/Characteristic/MinimalPrimePoisson.lean index 0f46eb8830..17b3bdabf8 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/MinimalPrimePoisson.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/MinimalPrimePoisson.lean @@ -20,7 +20,7 @@ required bracket membership in every minimal prime over the original ideal. No integrability statement for those minimal primes is asserted here. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.MinimalPrimePoisson diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/MinimalSupportExistence.lean b/LeanPool/Stafford38/Stafford38/Characteristic/MinimalSupportExistence.lean index 248cbb5424..87765f37dc 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/MinimalSupportExistence.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/MinimalSupportExistence.lean @@ -14,7 +14,7 @@ Compatibility exports for existence of a minimal support prime from the shared algebraic-analysis library. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.MinimalSupportExistence diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/MinimalSupportKernelCokernelLengths.lean b/LeanPool/Stafford38/Stafford38/Characteristic/MinimalSupportKernelCokernelLengths.lean index e3f9a7e905..2f845d9181 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/MinimalSupportKernelCokernelLengths.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/MinimalSupportKernelCokernelLengths.lean @@ -16,7 +16,7 @@ Compatibility exports for localized kernel and cokernel lengths from the shared algebraic-analysis library. -/ -@[expose] public section +public section namespace Stafford38.Characteristic diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/MonicAnnihilatorFinite.lean b/LeanPool/Stafford38/Stafford38/Characteristic/MonicAnnihilatorFinite.lean index 5cdd27cc3f..87bd1eac4d 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/MonicAnnihilatorFinite.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/MonicAnnihilatorFinite.lean @@ -14,7 +14,7 @@ Compatibility exports for finite modules from monic annihilators from the shared algebraic-analysis library. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.MonicAnnihilatorFinite diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/NoncharacteristicMinimalPrime.lean b/LeanPool/Stafford38/Stafford38/Characteristic/NoncharacteristicMinimalPrime.lean index 79d455ec1e..bdee725abf 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/NoncharacteristicMinimalPrime.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/NoncharacteristicMinimalPrime.lean @@ -15,7 +15,7 @@ public import LeanPool.Stafford38.Stafford38.Characteristic.CanonicalNormalAxisS Avoidance of the normal coordinate by minimal primes of the characteristic support. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.NoncharacteristicMinimalPrime diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/NormalSymbolPolynomial.lean b/LeanPool/Stafford38/Stafford38/Characteristic/NormalSymbolPolynomial.lean index e1a980ddaf..40abce7da0 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/NormalSymbolPolynomial.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/NormalSymbolPolynomial.lean @@ -15,7 +15,7 @@ public import Mathlib.RingTheory.MvPolynomial.Homogeneous Normal-symbol polynomials obtained from the canonical filtered quotient. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.NormalSymbolPolynomial diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/OrderReesTwoJet.lean b/LeanPool/Stafford38/Stafford38/Characteristic/OrderReesTwoJet.lean index 37feb2bc36..01fb93e5f1 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/OrderReesTwoJet.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/OrderReesTwoJet.lean @@ -24,7 +24,7 @@ No Rees-module action, quotient module, trace package, or Gabber theorem is constructed here. -/ -@[expose] public section +public section namespace Stafford38.CharacteristicOrderReesTwoJet diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/OrderReesTwoJetBracket.lean b/LeanPool/Stafford38/Stafford38/Characteristic/OrderReesTwoJetBracket.lean index f34020c5b6..bceeef0485 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/OrderReesTwoJetBracket.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/OrderReesTwoJetBracket.lean @@ -24,7 +24,7 @@ asserts existence for arbitrary two-jet classes while retaining the explicit source-level witness used to prove it. -/ -@[expose] public section +public section namespace Stafford38.CharacteristicOrderReesTwoJetBracket diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/OrderReesTwoJetSpecializationKernel.lean b/LeanPool/Stafford38/Stafford38/Characteristic/OrderReesTwoJetSpecializationKernel.lean index 435abff690..fa59b59dd0 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/OrderReesTwoJetSpecializationKernel.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/OrderReesTwoJetSpecializationKernel.lean @@ -24,7 +24,7 @@ The factor is always written on the left. Centrality of `T` is not used to reverse any noncommutative product. -/ -@[expose] public section +public section namespace Stafford38.CharacteristicOrderReesTwoJetSpecializationKernel diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/Polynomial.lean b/LeanPool/Stafford38/Stafford38/Characteristic/Polynomial.lean index d13590e1e7..afbf784196 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/Polynomial.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/Polynomial.lean @@ -20,7 +20,7 @@ that ring and its canonical polynomial Poisson bracket without assuming any characteristic-variety theorem. -/ -@[expose] public section +public section namespace Stafford38.Characteristic @@ -37,6 +37,7 @@ def fibreWeight {n : ℕ} : PhaseVar n → ℕ | Sum.inr _ => 1 /-- The standard Poisson bracket on affine cotangent space. -/ +@[expose] noncomputable def poissonBracket {k : Type*} [CommRing k] {n : ℕ} (f g : SymbolRing k n) : SymbolRing k n := @@ -47,6 +48,7 @@ noncomputable def poissonBracket MvPolynomial.pderiv (Sum.inl i : PhaseVar n) g) /-- An ideal is Poisson when it is stable under bracketing with every symbol. -/ +@[expose] def IsPoisson {k : Type*} [CommRing k] {n : ℕ} (J : Ideal (SymbolRing k n)) : Prop := diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/PostScalarExtensionPoisson.lean b/LeanPool/Stafford38/Stafford38/Characteristic/PostScalarExtensionPoisson.lean index 72794537a9..c653ebbd11 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/PostScalarExtensionPoisson.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/PostScalarExtensionPoisson.lean @@ -20,7 +20,7 @@ coordinate derivation. No claim is made that taking a radical after base change preserves bracket closure. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.PostScalarExtensionPoisson diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/PrincipalKoszulFiniteTorsion.lean b/LeanPool/Stafford38/Stafford38/Characteristic/PrincipalKoszulFiniteTorsion.lean index b51ae74053..75a3b38691 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/PrincipalKoszulFiniteTorsion.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/PrincipalKoszulFiniteTorsion.lean @@ -15,7 +15,7 @@ Compatibility exports for finite torsion in principal Koszul complexes from the shared algebraic-analysis library. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.PrincipalKoszulFiniteTorsion diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/PrincipalKoszulMinimalSupportPositivity.lean b/LeanPool/Stafford38/Stafford38/Characteristic/PrincipalKoszulMinimalSupportPositivity.lean index f485feb5fd..b0e6da8649 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/PrincipalKoszulMinimalSupportPositivity.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/PrincipalKoszulMinimalSupportPositivity.lean @@ -15,7 +15,7 @@ Compatibility exports for principal Koszul positivity at minimal support from the shared algebraic-analysis library. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.PrincipalKoszulMinimalSupportPositivity diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/PrincipalKoszulPositivity.lean b/LeanPool/Stafford38/Stafford38/Characteristic/PrincipalKoszulPositivity.lean index 3a9c98ee7d..44d2a7fc92 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/PrincipalKoszulPositivity.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/PrincipalKoszulPositivity.lean @@ -15,7 +15,7 @@ Compatibility exports for positivity of the principal Koszul Euler characteristi from the shared algebraic-analysis library. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.PrincipalKoszulPositivity diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/PrincipalKoszulSupportOverBase.lean b/LeanPool/Stafford38/Stafford38/Characteristic/PrincipalKoszulSupportOverBase.lean index f516f9c0e6..3e07b996c1 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/PrincipalKoszulSupportOverBase.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/PrincipalKoszulSupportOverBase.lean @@ -16,7 +16,7 @@ Compatibility exports for principal Koszul support over the base ring from the shared algebraic-analysis library. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.PrincipalKoszulSupportOverBase diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/RadicalMinimalPrimeInvolutivity.lean b/LeanPool/Stafford38/Stafford38/Characteristic/RadicalMinimalPrimeInvolutivity.lean index 6cbf51fe8b..523b3aee53 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/RadicalMinimalPrimeInvolutivity.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/RadicalMinimalPrimeInvolutivity.lean @@ -45,7 +45,7 @@ Nothing here proves involutivity of any concrete radical; this is the descent step only. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.RadicalMinimalPrimeInvolutivity diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/ReducedSupportIdeal.lean b/LeanPool/Stafford38/Stafford38/Characteristic/ReducedSupportIdeal.lean index e8417a8102..5f959883fc 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/ReducedSupportIdeal.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/ReducedSupportIdeal.lean @@ -19,7 +19,7 @@ polynomial ring. These definitions make the remaining base-relative Gabber statement concrete; no Poisson-closure theorem is asserted here. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.ReducedSupportIdeal diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/RightReesArtinianAdapter.lean b/LeanPool/Stafford38/Stafford38/Characteristic/RightReesArtinianAdapter.lean index 7358739eb2..e8d3fb287e 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/RightReesArtinianAdapter.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/RightReesArtinianAdapter.lean @@ -37,7 +37,7 @@ quotient descent and survival of parameter exactness are then separate. No Artinian quotient action is asserted below. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.RightReesArtinianAdapter diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/SourceActionCommutatorExpansion.lean b/LeanPool/Stafford38/Stafford38/Characteristic/SourceActionCommutatorExpansion.lean index a2ee02ba60..da5c12db74 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/SourceActionCommutatorExpansion.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/SourceActionCommutatorExpansion.lean @@ -27,7 +27,7 @@ isolates the remaining trace-comparison obligation. It does not assert an equality with a residue-mapped coefficient matrix. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.SourceActionCommutatorExpansion diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/SpecializedNoncharacteristicEquality.lean b/LeanPool/Stafford38/Stafford38/Characteristic/SpecializedNoncharacteristicEquality.lean index d2e2c5665d..866e6b39f9 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/SpecializedNoncharacteristicEquality.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/SpecializedNoncharacteristicEquality.lean @@ -27,7 +27,7 @@ specialized strict noncharacteristic inverse-image theorem. No substitute for that theorem is assumed here. -/ -@[expose] public section +public section namespace Stafford38.SpecializedNoncharacteristicEquality diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/SquareZeroAnnihilatorBracket.lean b/LeanPool/Stafford38/Stafford38/Characteristic/SquareZeroAnnihilatorBracket.lean index a8c10e9d4d..21b5982f5a 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/SquareZeroAnnihilatorBracket.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/SquareZeroAnnihilatorBracket.lean @@ -23,7 +23,7 @@ itself. It does not prove bracket closure of its radical or of any prime ideal for inputs that merely lie in that larger ideal. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.SquareZeroAnnihilatorBracket diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/SquareZeroArtinianTruncation.lean b/LeanPool/Stafford38/Stafford38/Characteristic/SquareZeroArtinianTruncation.lean index e4de0d6a37..54f07135bc 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/SquareZeroArtinianTruncation.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/SquareZeroArtinianTruncation.lean @@ -23,7 +23,7 @@ deformation ring. Membership is tested after specialization in the commutative fibre, which is exactly the datum available in the Rees two-jet. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.SquareZeroArtinianTruncation diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/SquareZeroHighPowerReduction.lean b/LeanPool/Stafford38/Stafford38/Characteristic/SquareZeroHighPowerReduction.lean index 170f8aab4b..713cea49da 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/SquareZeroHighPowerReduction.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/SquareZeroHighPowerReduction.lean @@ -27,7 +27,7 @@ an artificial multiplication API for two-sided ideals: membership in the relevant product is recorded by an explicit finite sum of products. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.SquareZeroHighPowerReduction diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/SquareZeroLinearTrace.lean b/LeanPool/Stafford38/Stafford38/Characteristic/SquareZeroLinearTrace.lean index dae59ac488..6220de5cf5 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/SquareZeroLinearTrace.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/SquareZeroLinearTrace.lean @@ -25,7 +25,7 @@ block decomposition. The off-diagonal block of the displayed commutator is a sum of two rectangular commutators, so its trace is zero. -/ -@[expose] public section +public section noncomputable section @@ -43,6 +43,7 @@ lemma mapsTo_range_of_comp_comm (C F : V →ₗ[k] V) exact LinearMap.congr_fun hF.symm v /-- The endomorphism induced by `F` on `V / range C`. -/ +@[expose] def quotientEnd (C F : V →ₗ[k] V) (hF : F.comp C = C.comp F) : (V ⧸ LinearMap.range C) →ₗ[k] (V ⧸ LinearMap.range C) := (LinearMap.range C).mapQ (LinearMap.range C) F @@ -54,6 +55,7 @@ def rangeEnd (C F : V →ₗ[k] V) (hF : F.comp C = C.comp F) : F.restrict (mapsTo_range_of_comp_comm C F hF) /-- Exactness makes the map induced by `C` from the quotient to its range an equivalence. -/ +@[expose] def quotientToRangeEquiv (C : V →ₗ[k] V) (hExact : LinearMap.ker C = LinearMap.range C) : (V ⧸ LinearMap.range C) ≃ₗ[k] LinearMap.range C := by let cbar : (V ⧸ LinearMap.range C) →ₗ[k] LinearMap.range C := diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/SquareZeroLocalizedExactness.lean b/LeanPool/Stafford38/Stafford38/Characteristic/SquareZeroLocalizedExactness.lean index 6e7bc135d0..ad8a2610b9 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/SquareZeroLocalizedExactness.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/SquareZeroLocalizedExactness.lean @@ -30,7 +30,7 @@ The only typeclass parameter is Mathlib's `OreSet`; its existence for the pulled-back denominators is proved in `SquareZeroOreLocalization`. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.SquareZeroLocalizedExactness diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/SquareZeroLocalizedRing.lean b/LeanPool/Stafford38/Stafford38/Characteristic/SquareZeroLocalizedRing.lean index 999471ec56..6186c27b16 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/SquareZeroLocalizedRing.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/SquareZeroLocalizedRing.lean @@ -23,7 +23,7 @@ parameter, that the target is an Artinian quotient, or that a coefficient field exists. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.SquareZeroLocalizedRing diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/SquareZeroOreLocalization.lean b/LeanPool/Stafford38/Stafford38/Characteristic/SquareZeroOreLocalization.lean index ff97e6d49b..df7fb8c19e 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/SquareZeroOreLocalization.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/SquareZeroOreLocalization.lean @@ -22,7 +22,7 @@ This is the localization input needed by the minimal-prime trace argument. No trace, finite-length, or prime-ideal conclusion is asserted here. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.SquareZeroOreLocalization diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/SquareZeroTraceData.lean b/LeanPool/Stafford38/Stafford38/Characteristic/SquareZeroTraceData.lean index aeae1b7eec..60ac0137b7 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/SquareZeroTraceData.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/SquareZeroTraceData.lean @@ -21,7 +21,7 @@ No localization, trace theorem, minimal-prime statement, Gabber theorem, or concrete Weyl instance is asserted here. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.SquareZeroTraceData @@ -38,6 +38,7 @@ variable [SMulCommClass k Bᵐᵒᵖ N] The scalar action is by `Bᵐᵒᵖ`; thus `rightActionEnd k B N b` sends `m` to `m b` in ordinary right-module notation. -/ +@[expose] def rightActionEnd (b : B) : Module.End k N where toFun m := MulOpposite.op b • m map_add' _ _ := smul_add _ _ _ diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/StableTorsionResidualSupport.lean b/LeanPool/Stafford38/Stafford38/Characteristic/StableTorsionResidualSupport.lean index b103399fb0..c41c8a81bf 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/StableTorsionResidualSupport.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/StableTorsionResidualSupport.lean @@ -15,7 +15,7 @@ Compatibility exports for residual support after removing stable torsion from the shared algebraic-analysis library. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.StableTorsionResidualSupport diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/SymplecticCompletion.lean b/LeanPool/Stafford38/Stafford38/Characteristic/SymplecticCompletion.lean index c5229be462..2bf6ed0fe4 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/SymplecticCompletion.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/SymplecticCompletion.lean @@ -21,7 +21,7 @@ Combined with homogeneous nonvanishing, this makes the transformed pure-power coefficient nonzero over the original characteristic-zero field. -/ -@[expose] public section +public section namespace Stafford38.CharacteristicSymplecticCompletion diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/TransposedFilteredModuleSupport.lean b/LeanPool/Stafford38/Stafford38/Characteristic/TransposedFilteredModuleSupport.lean index cd67fcdec7..45dee8effe 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/TransposedFilteredModuleSupport.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/TransposedFilteredModuleSupport.lean @@ -23,7 +23,7 @@ No noncharacteristic restriction theorem or D-module comparison theorem is used here. -/ -@[expose] public section +public section namespace Stafford38.CharacteristicTransposedFilteredModuleSupport diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/TwoTermPageLength.lean b/LeanPool/Stafford38/Stafford38/Characteristic/TwoTermPageLength.lean index 23fd1351e2..93173b9aed 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/TwoTermPageLength.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/TwoTermPageLength.lean @@ -14,7 +14,7 @@ Compatibility exports for length comparison for filtered two-term pages from the shared algebraic-analysis library. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.TwoTermPageLength diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/UniformBoundaryVanishing.lean b/LeanPool/Stafford38/Stafford38/Characteristic/UniformBoundaryVanishing.lean index d8a0b9063b..8883958612 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/UniformBoundaryVanishing.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/UniformBoundaryVanishing.lean @@ -14,7 +14,7 @@ Compatibility exports for uniform vanishing of Noetherian boundaries from the shared algebraic-analysis library. -/ -@[expose] public section +public section export AlgebraicAnalysis (exists_uniform_zero_of_noetherian exists_uniform_subsingleton_of_noetherian exists_uniform_zero_localized diff --git a/LeanPool/Stafford38/Stafford38/Characteristic/ZeroSectionContainment.lean b/LeanPool/Stafford38/Stafford38/Characteristic/ZeroSectionContainment.lean index cf2201f50c..fd1a4d3203 100644 --- a/LeanPool/Stafford38/Stafford38/Characteristic/ZeroSectionContainment.lean +++ b/LeanPool/Stafford38/Stafford38/Characteristic/ZeroSectionContainment.lean @@ -23,7 +23,7 @@ radical, it takes a power in the order initial ideal, extracts its fibre-degree zero component there, and then uses reducedness of the ground field. -/ -@[expose] public section +public section namespace Stafford38.Characteristic.ZeroSectionContainment diff --git a/LeanPool/Stafford38/Stafford38/CoordinateDifferentialGeneration.lean b/LeanPool/Stafford38/Stafford38/CoordinateDifferentialGeneration.lean index ec20a305e3..98f72a4c0d 100644 --- a/LeanPool/Stafford38/Stafford38/CoordinateDifferentialGeneration.lean +++ b/LeanPool/Stafford38/Stafford38/CoordinateDifferentialGeneration.lean @@ -11,7 +11,7 @@ public import LeanPool.Stafford38.AlgebraicAnalysis.DifferentialOperators.Coordi /-! Compatibility exports for the reusable coordinate-generation argument. -/ -@[expose] public section +public section namespace Stafford38.CoordinateDifferentialGeneration export AlgebraicAnalysis.DifferentialOperators.CoordinateGeneration diff --git a/LeanPool/Stafford38/Stafford38/DifferentialOperators.lean b/LeanPool/Stafford38/Stafford38/DifferentialOperators.lean index 3726309f35..c3fb20cb79 100644 --- a/LeanPool/Stafford38/Stafford38/DifferentialOperators.lean +++ b/LeanPool/Stafford38/Stafford38/DifferentialOperators.lean @@ -12,7 +12,7 @@ public import LeanPool.Stafford38.AlgebraicAnalysis.DifferentialOperators.Basic /-! Compatibility aliases for the neutral AlgebraicAnalysis differential operator API. -/ -@[expose] public section +public section namespace Stafford38.DifferentialOperators diff --git a/LeanPool/Stafford38/Stafford38/EulerRootSeparation.lean b/LeanPool/Stafford38/Stafford38/EulerRootSeparation.lean index d13bda287a..412710d7a3 100644 --- a/LeanPool/Stafford38/Stafford38/EulerRootSeparation.lean +++ b/LeanPool/Stafford38/Stafford38/EulerRootSeparation.lean @@ -43,7 +43,7 @@ Everything is proved over `ℂ`, descended to `ℚ` by `Polynomial.isCoprime_map and transported to an arbitrary characteristic-zero field by `IsCoprime.map`. -/ -@[expose] public section +public section namespace Stafford38.Evolution diff --git a/LeanPool/Stafford38/Stafford38/EvolutionaryCertificate.lean b/LeanPool/Stafford38/Stafford38/EvolutionaryCertificate.lean index 94dcc24ac1..2341d84d54 100644 --- a/LeanPool/Stafford38/Stafford38/EvolutionaryCertificate.lean +++ b/LeanPool/Stafford38/Stafford38/EvolutionaryCertificate.lean @@ -41,7 +41,7 @@ Convention: all ideals here are **right** ideals, matching the repository convention. Statements are written as `d * R + x ^ r * d * S = 1`. -/ -@[expose] public section +public section namespace Stafford38.Evolution @@ -82,11 +82,13 @@ variable {D : Type*} [Ring D] {x p : D} def euler (x p : D) : D := x * p /-- `(E + 1)(E + 2) ⋯ (E + n)`. -/ +@[expose] def rising (E : D) : ℕ → D | 0 => 1 | (n + 1) => rising E n * (E + ((n : D) + 1)) /-- `E (E - 1) ⋯ (E - (n-1))`. -/ +@[expose] def falling (E : D) : ℕ → D | 0 => 1 | (n + 1) => falling E n * (E - (n : D)) @@ -204,17 +206,20 @@ lemma commute_aeval_euler {a E : D} (h : a * E = E * a) (f : k[X]) : exact (c1.mul_right (hc.pow_right m)).eq /-- The rising factorial as a polynomial. -/ +@[expose] noncomputable def risingPoly (k : Type*) [CommRing k] : ℕ → k[X] | 0 => 1 | (n + 1) => risingPoly k n * (X + Polynomial.C ((n : k) + 1)) /-- The falling factorial as a polynomial. -/ +@[expose] noncomputable def fallingPoly (k : Type*) [CommRing k] : ℕ → k[X] | 0 => 1 | (n + 1) => fallingPoly k n * (X - Polynomial.C (n : k)) /-- The Euler corner polynomial `C_r = R₊ - R₋`; its evaluation at `E` is the commutator `p ^ r x ^ r - x ^ r p ^ r`. -/ +@[expose] noncomputable def cornerPoly (k : Type*) [CommRing k] (r : ℕ) : k[X] := risingPoly k r - fallingPoly k r @@ -254,6 +259,7 @@ def potentialSum (x : D) : List (D × ℕ) → D | (t :: ts) => t.1 * x ^ t.2 + potentialSum x ts /-- `∏ⱼ C(X + nⱼ)`, one shift of the corner polynomial per potential term. -/ +@[expose] noncomputable def shiftedProd (C : k[X]) : List (D × ℕ) → k[X] | [] => 1 | (t :: ts) => C.comp (X + Polynomial.C ((t.2 : ℕ) : k)) * shiftedProd C ts @@ -310,6 +316,7 @@ theorem potential_elimination (hw : p * x = x * p + 1) (C : k[X]) /-! ### The main theorem -/ /-- Shifting every exponent of the potential support by `r`. -/ +@[expose] def shiftSupport (terms : List (D × ℕ)) (r : ℕ) : List (D × ℕ) := terms.map fun t => (t.1, t.2 + r) diff --git a/LeanPool/Stafford38/Stafford38/EvolutionaryCorollary.lean b/LeanPool/Stafford38/Stafford38/EvolutionaryCorollary.lean index ed875d2225..e8ddff5cae 100644 --- a/LeanPool/Stafford38/Stafford38/EvolutionaryCorollary.lean +++ b/LeanPool/Stafford38/Stafford38/EvolutionaryCorollary.lean @@ -18,7 +18,7 @@ This file combines the algebraic certificate with Euler-root separation. It contains only the unconditional ring-theoretic corollary needed by the paper. -/ -@[expose] public section +public section namespace Stafford38.Evolution diff --git a/LeanPool/Stafford38/Stafford38/FixedSourceAssembly.lean b/LeanPool/Stafford38/Stafford38/FixedSourceAssembly.lean index 1bf8cda8f9..f62856a70c 100644 --- a/LeanPool/Stafford38/Stafford38/FixedSourceAssembly.lean +++ b/LeanPool/Stafford38/Stafford38/FixedSourceAssembly.lean @@ -13,7 +13,7 @@ public import LeanPool.Stafford38.Stafford38.FixedSourceStatement Assembly of the fixed-source reduction from canonical characteristic and Weyl data. -/ -@[expose] public section +public section namespace Stafford38.FixedSource diff --git a/LeanPool/Stafford38/Stafford38/FixedSourceChallengeTransport.lean b/LeanPool/Stafford38/Stafford38/FixedSourceChallengeTransport.lean index 278127e64f..18585d2e04 100644 --- a/LeanPool/Stafford38/Stafford38/FixedSourceChallengeTransport.lean +++ b/LeanPool/Stafford38/Stafford38/FixedSourceChallengeTransport.lean @@ -38,7 +38,7 @@ theorem `Stafford38.universalFixedSourceStatement`. No degree and no normal-form datum is supplied as a hypothesis anywhere. -/ -@[expose] public section +public section namespace Stafford38FixedSourceChallenge diff --git a/LeanPool/Stafford38/Stafford38/FixedSourceStatement.lean b/LeanPool/Stafford38/Stafford38/FixedSourceStatement.lean index db2f965000..e9028e6fe9 100644 --- a/LeanPool/Stafford38/Stafford38/FixedSourceStatement.lean +++ b/LeanPool/Stafford38/Stafford38/FixedSourceStatement.lean @@ -11,7 +11,7 @@ public import LeanPool.Stafford38.Stafford38.UniversalAssembly /-! The (actual) Bernstein degree, read directly from checked PBW normal form. -/ -@[expose] public section +public section namespace Stafford38.FixedSource diff --git a/LeanPool/Stafford38/Stafford38/FoundationClosure.lean b/LeanPool/Stafford38/Stafford38/FoundationClosure.lean index 75fc1e1b34..9f2ea5f966 100644 --- a/LeanPool/Stafford38/Stafford38/FoundationClosure.lean +++ b/LeanPool/Stafford38/Stafford38/FoundationClosure.lean @@ -28,7 +28,7 @@ Conjecture 3.8, p. 438, is the source problem. This project proves the general c visible-frame route. -/ -@[expose] public section +public section namespace Stafford38.FoundationClosure diff --git a/LeanPool/Stafford38/Stafford38/Geometry/AffineComponentCoordinateSplit.lean b/LeanPool/Stafford38/Stafford38/Geometry/AffineComponentCoordinateSplit.lean index f2755f7cb8..557f98a89f 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/AffineComponentCoordinateSplit.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/AffineComponentCoordinateSplit.lean @@ -23,7 +23,7 @@ this gives the component split used before the divisorial-boundary construction. -/ -@[expose] public section +public section namespace Stafford38.Geometry.AffineComponentCoordinateSplit diff --git a/LeanPool/Stafford38/Stafford38/Geometry/AffineConormalClosure.lean b/LeanPool/Stafford38/Stafford38/Geometry/AffineConormalClosure.lean index 892b5734b9..3e144e87e0 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/AffineConormalClosure.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/AffineConormalClosure.lean @@ -23,7 +23,7 @@ It does not identify a smooth scheme-theoretic conormal bundle or prove the asymptotic conormal theorem at infinity. -/ -@[expose] public section +public section namespace Stafford38.Geometry.AffineConormalClosure diff --git a/LeanPool/Stafford38/Stafford38/Geometry/AffineConormalSpan.lean b/LeanPool/Stafford38/Stafford38/Geometry/AffineConormalSpan.lean index bf4139e3ec..69a9fb08db 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/AffineConormalSpan.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/AffineConormalSpan.lean @@ -30,7 +30,7 @@ of a smooth locus, or the passage from pointwise fibres to the closure of the smooth conormal bundle. -/ -@[expose] public section +public section namespace Stafford38.Geometry.AffineConormalSpan diff --git a/LeanPool/Stafford38/Stafford38/Geometry/ArcFrameConormal.lean b/LeanPool/Stafford38/Stafford38/Geometry/ArcFrameConormal.lean index f0c03df912..8ada6e961e 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/ArcFrameConormal.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/ArcFrameConormal.lean @@ -25,7 +25,7 @@ divisorial chart, identify an arc with a projective component, or descend a `CanonicalAsymptoticLaurentProducer`. -/ -@[expose] public section +public section namespace Stafford38.Geometry.ArcFrameConormal diff --git a/LeanPool/Stafford38/Stafford38/Geometry/AsymptoticChartArcAdapter.lean b/LeanPool/Stafford38/Stafford38/Geometry/AsymptoticChartArcAdapter.lean index 0af184f410..90846570df 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/AsymptoticChartArcAdapter.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/AsymptoticChartArcAdapter.lean @@ -32,7 +32,7 @@ criterion concerns the closed point directly; no generic-rank specialization is used. -/ -@[expose] public section +public section namespace Stafford38.Geometry.AsymptoticChartArcAdapter diff --git a/LeanPool/Stafford38/Stafford38/Geometry/AsymptoticDivisorExistence.lean b/LeanPool/Stafford38/Stafford38/Geometry/AsymptoticDivisorExistence.lean index f3651637af..e69294c741 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/AsymptoticDivisorExistence.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/AsymptoticDivisorExistence.lean @@ -36,7 +36,7 @@ under the extension (nor the equivalent normalization/height-one-prime construction). -/ -@[expose] public section +public section namespace Stafford38.Geometry.AsymptoticDivisorExistence @@ -69,6 +69,7 @@ theorem transcendental_of_not_mem_range_algebraMap exact IntermediateField.subset_adjoin k {x} (Set.mem_singleton x) /-- The prime ideal `(X)` in the one-variable polynomial ring. -/ +@[expose] def coordinateZeroPrime : Ideal (Polynomial k) := Ideal.span {Polynomial.X} instance coordinateZeroPrime_isPrime : (coordinateZeroPrime k).IsPrime := by diff --git a/LeanPool/Stafford38/Stafford38/Geometry/CanonicalAsymptoticLaurentProducer.lean b/LeanPool/Stafford38/Stafford38/Geometry/CanonicalAsymptoticLaurentProducer.lean index ecc4e62a34..04886b092a 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/CanonicalAsymptoticLaurentProducer.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/CanonicalAsymptoticLaurentProducer.lean @@ -42,7 +42,7 @@ proving the tangent-span inclusion are separate geometric obligations. `CanonicalBoundaryChartProduction` records exactly that remaining obligation. -/ -@[expose] public section +public section namespace Stafford38.Geometry.CanonicalAsymptoticLaurentProducer diff --git a/LeanPool/Stafford38/Stafford38/Geometry/CanonicalConstantCoordinateBranch.lean b/LeanPool/Stafford38/Stafford38/Geometry/CanonicalConstantCoordinateBranch.lean index 773f179ec1..7aabe55b5f 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/CanonicalConstantCoordinateBranch.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/CanonicalConstantCoordinateBranch.lean @@ -23,7 +23,7 @@ This gives the exact residue-extension endpoint used by the canonical assembly, with residue extension equal to the ground field. -/ -@[expose] public section +public section namespace Stafford38.Geometry.CanonicalConstantCoordinateBranch diff --git a/LeanPool/Stafford38/Stafford38/Geometry/CanonicalFiniteGradientProjectiveCoordinates.lean b/LeanPool/Stafford38/Stafford38/Geometry/CanonicalFiniteGradientProjectiveCoordinates.lean index fd11b47f5b..3d4290c241 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/CanonicalFiniteGradientProjectiveCoordinates.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/CanonicalFiniteGradientProjectiveCoordinates.lean @@ -22,7 +22,7 @@ coordinate ratio, and the two zero-residue facts needed by downstream certificates. -/ -@[expose] public section +public section namespace Stafford38.Geometry.CanonicalFiniteGradientProjectiveCoordinates diff --git a/LeanPool/Stafford38/Stafford38/Geometry/CanonicalNonconstantFiniteGradientProduction.lean b/LeanPool/Stafford38/Stafford38/Geometry/CanonicalNonconstantFiniteGradientProduction.lean index 4987fba9e5..0f5d57ee32 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/CanonicalNonconstantFiniteGradientProduction.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/CanonicalNonconstantFiniteGradientProduction.lean @@ -22,7 +22,7 @@ The actual construction of the finite-gradient certificate remains a separate geometric problem. -/ -@[expose] public section +public section namespace Stafford38.Geometry.CanonicalNonconstantFiniteGradientProduction diff --git a/LeanPool/Stafford38/Stafford38/Geometry/CanonicalNonconstantFiniteGradientProductionProof.lean b/LeanPool/Stafford38/Stafford38/Geometry/CanonicalNonconstantFiniteGradientProductionProof.lean index 21ccbf6f73..5fecc99b86 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/CanonicalNonconstantFiniteGradientProductionProof.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/CanonicalNonconstantFiniteGradientProductionProof.lean @@ -27,7 +27,7 @@ boundary construction. The theorem below is the trust-zero adapter from that bridge to the finite equation/gradient certificate. -/ -@[expose] public section +public section namespace Stafford38.Geometry.CanonicalNonconstantFiniteGradientProductionProof diff --git a/LeanPool/Stafford38/Stafford38/Geometry/CanonicalResidueExtensionAssembly.lean b/LeanPool/Stafford38/Stafford38/Geometry/CanonicalResidueExtensionAssembly.lean index 0ad61a6b4a..2294b7e486 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/CanonicalResidueExtensionAssembly.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/CanonicalResidueExtensionAssembly.lean @@ -34,7 +34,7 @@ integrability, prove noncharacteristic restriction, or prove the canonical coordinate-preimage hypothesis. -/ -@[expose] public section +public section namespace Stafford38.Geometry.CanonicalResidueExtensionAssembly diff --git a/LeanPool/Stafford38/Stafford38/Geometry/CanonicalVisibleDivisorFrameProduction.lean b/LeanPool/Stafford38/Stafford38/Geometry/CanonicalVisibleDivisorFrameProduction.lean index 99e280248c..364f5d07e5 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/CanonicalVisibleDivisorFrameProduction.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/CanonicalVisibleDivisorFrameProduction.lean @@ -36,7 +36,7 @@ Nothing here constructs the place or the frame. The producer statement remaining geometric input of lane C. -/ -@[expose] public section +public section namespace Stafford38.Geometry.CanonicalVisibleDivisorFrameProduction diff --git a/LeanPool/Stafford38/Stafford38/Geometry/ChartArcAnnihilation.lean b/LeanPool/Stafford38/Stafford38/Geometry/ChartArcAnnihilation.lean index 3fe5c6c1a6..12d91022f9 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/ChartArcAnnihilation.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/ChartArcAnnihilation.lean @@ -24,7 +24,7 @@ its actual normalized chart, with precisely the coordinate ordering used by annihilation; annihilation itself is not a field of the certificate. -/ -@[expose] public section +public section namespace Stafford38.Geometry.ChartArcAnnihilation diff --git a/LeanPool/Stafford38/Stafford38/Geometry/CoisotropicTranslation.lean b/LeanPool/Stafford38/Stafford38/Geometry/CoisotropicTranslation.lean index 8d97ec9e2e..81095da6c4 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/CoisotropicTranslation.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/CoisotropicTranslation.lean @@ -23,7 +23,7 @@ here. In particular, no variety, characteristic support, conormal bundle, or geometric integration theorem is represented by these declarations. -/ -@[expose] public section +public section namespace Stafford38.Geometry.CoisotropicTranslation @@ -47,6 +47,7 @@ def zeroSectionPoint (y : Fin n → k) : PhaseVar n → k | Sum.inr _ => 0 /-- The point obtained from `(y, 0)` by translating the fibre by `t df_y`. -/ +@[expose] def differentialTranslatePoint (y : Fin n → k) (f : MvPolynomial (Fin n) k) (t : k) : PhaseVar n → k | Sum.inl i => y i @@ -232,6 +233,7 @@ theorem fibreLinePolynomial_poissonBracket_baseLift /-! ## Iterated Hamiltonian differentiation -/ /-- Iteration of bracketing on the left by one base equation. -/ +@[expose] def hamiltonIter (f : MvPolynomial (Fin n) k) : ℕ → SymbolRing k n → SymbolRing k n | 0, g => g | m + 1, g => poissonBracket (baseLift f) (hamiltonIter f m g) diff --git a/LeanPool/Stafford38/Stafford38/Geometry/CompletedDVRCoefficientSection.lean b/LeanPool/Stafford38/Stafford38/Geometry/CompletedDVRCoefficientSection.lean index f31e5ca911..c3412563ab 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/CompletedDVRCoefficientSection.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/CompletedDVRCoefficientSection.lean @@ -27,7 +27,7 @@ separability hypothesis in characteristic zero, so the construction applies to it directly. No equivalence with a power-series ring is asserted. -/ -@[expose] public section +public section namespace Stafford38.Geometry.CompletedDVRCoefficientSection @@ -57,6 +57,7 @@ abbrev maximalIdealModel : Ideal V := maximalIdeal V abbrev AdicJet (n : ℕ) := V ⧸ ((maximalIdealModel V) ^ (n + 1)) /-- Reduction of a positive adic jet to the residue field. -/ +@[expose] def adicJetResidue (n : ℕ) : AdicJet V n →ₐ[E] ResidueFieldModel V := Ideal.Quotient.liftₐ ((maximalIdealModel V) ^ (n + 1)) (IsScalarTower.toAlgHom E V (ResidueFieldModel V)) (by @@ -139,6 +140,7 @@ theorem adicJetCoefficientSection_compatible /-- Convert the usual quotient by `maximalIdealModel^n` to the coordinate quotient used in the definition of `AdicCompletion`. -/ +@[expose] def exactQuotientToCompletionCoordinate (n : ℕ) : (V ⧸ ((maximalIdealModel V) ^ n)) ≃ₐ[E] V ⧸ ((maximalIdealModel V) ^ n • ⊤ : Ideal V) := by @@ -166,6 +168,7 @@ def zeroCompletionCoordinateSection : /-- The coefficient section in every coordinate of Mathlib's adic inverse limit. Coordinate zero is trivial; coordinate `n+1` is the formally etale section in `V / maximalIdealModel^(n+1)`. -/ +@[expose] def completionCoordinateSection (hsep : Algebra.IsSeparable E (ResidueFieldModel V)) : ∀ n : ℕ, ResidueFieldModel V →ₐ[E] V ⧸ ((maximalIdealModel V) ^ n • ⊤ : Ideal V) @@ -223,6 +226,7 @@ theorem completionCoordinateSection_compatible /-- The compatible finite-level sections assemble to an actual `E`-algebra coefficient section in the adic completion. -/ +@[expose] def completedCoefficientSection (hsep : Algebra.IsSeparable E (ResidueFieldModel V)) : ResidueFieldModel V →ₐ[E] AdicCompletion (maximalIdealModel V) V where diff --git a/LeanPool/Stafford38/Stafford38/Geometry/CompletedDVRPowerSeriesEquiv.lean b/LeanPool/Stafford38/Stafford38/Geometry/CompletedDVRPowerSeriesEquiv.lean index e0ffa46a8c..d70f1d4c80 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/CompletedDVRPowerSeriesEquiv.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/CompletedDVRPowerSeriesEquiv.lean @@ -28,7 +28,7 @@ No Cohen structure theorem is invoked. In particular, an equivalence is constructed only from a separately proved surjectivity statement. -/ -@[expose] public section +public section namespace Stafford38.Geometry.CompletedDVRPowerSeries @@ -221,6 +221,7 @@ theorem powerSeriesCoordinateMap_compatible /-- The actual chosen-coordinate power-series map to the maximal-ideal adic completion. -/ +@[expose] def completedDVRPowerSeriesMap (hsep : Algebra.IsSeparable E (ResidueFieldModel V)) : PowerSeries (ResidueFieldModel V) →+* AdicCompletion (maximalIdealModel V) V where diff --git a/LeanPool/Stafford38/Stafford38/Geometry/ComponentFunctionFieldBoundary.lean b/LeanPool/Stafford38/Stafford38/Geometry/ComponentFunctionFieldBoundary.lean index 36ab729091..1eeb0146bd 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/ComponentFunctionFieldBoundary.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/ComponentFunctionFieldBoundary.lean @@ -21,7 +21,7 @@ field. Therefore every transcendental component coordinate admits the discrete boundary refinement constructed by the relative divisorial tower. -/ -@[expose] public section +public section namespace Stafford38.Geometry.ComponentFunctionFieldBoundary diff --git a/LeanPool/Stafford38/Stafford38/Geometry/ComponentProjectiveClosure.lean b/LeanPool/Stafford38/Stafford38/Geometry/ComponentProjectiveClosure.lean index a79831cf33..9f2a774bfc 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/ComponentProjectiveClosure.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/ComponentProjectiveClosure.lean @@ -23,7 +23,7 @@ coordinate. Zeroth-chart dehomogenization recovers the affine component ideal exactly. -/ -@[expose] public section +public section namespace Stafford38.Geometry.ComponentProjectiveClosure diff --git a/LeanPool/Stafford38/Stafford38/Geometry/ComponentProjectiveClosureNormalization.lean b/LeanPool/Stafford38/Stafford38/Geometry/ComponentProjectiveClosureNormalization.lean index 5889a77b59..c1135727bb 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/ComponentProjectiveClosureNormalization.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/ComponentProjectiveClosureNormalization.lean @@ -26,7 +26,7 @@ This is only a homogeneous projective statement. It does not assert that an arbitrary affine chart point satisfies the original affine component ideal. -/ -@[expose] public section +public section namespace Stafford38.Geometry.ComponentProjectiveClosureNormalization diff --git a/LeanPool/Stafford38/Stafford38/Geometry/ComponentProjectiveOrder.lean b/LeanPool/Stafford38/Stafford38/Geometry/ComponentProjectiveOrder.lean index 9fe9d13d7b..aee2bcf2e6 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/ComponentProjectiveOrder.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/ComponentProjectiveOrder.lean @@ -21,7 +21,7 @@ coordinate is a nonunit. Consequently, a common projective normalization of all affine coordinates cannot have unit homogeneous denominator. -/ -@[expose] public section +public section namespace Stafford38.Geometry.ComponentProjectiveOrder diff --git a/LeanPool/Stafford38/Stafford38/Geometry/ConormalAxisContradiction.lean b/LeanPool/Stafford38/Stafford38/Geometry/ConormalAxisContradiction.lean index 3e19231389..ed633bcd37 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/ConormalAxisContradiction.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/ConormalAxisContradiction.lean @@ -24,7 +24,7 @@ equation-conormal-closure containment gives the corresponding contradiction. This file proves no conormal-axis producer and no Gabber theorem. -/ -@[expose] public section +public section namespace Stafford38.Geometry.ConormalAxisContradiction diff --git a/LeanPool/Stafford38/Stafford38/Geometry/ConormalPrincipalOpenDensity.lean b/LeanPool/Stafford38/Stafford38/Geometry/ConormalPrincipalOpenDensity.lean index 2ceb435de6..2abf29c1c3 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/ConormalPrincipalOpenDensity.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/ConormalPrincipalOpenDensity.lean @@ -19,7 +19,7 @@ kept as a separate theorem below, so its hypotheses and its use of the equation-defined conormal are visible at the call site. -/ -@[expose] public section +public section namespace Stafford38.Geometry.ConormalPrincipalOpenDensity diff --git a/LeanPool/Stafford38/Stafford38/Geometry/ConormalScalarExtensionVanishing.lean b/LeanPool/Stafford38/Stafford38/Geometry/ConormalScalarExtensionVanishing.lean index 210c9f354e..f666f8da5d 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/ConormalScalarExtensionVanishing.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/ConormalScalarExtensionVanishing.lean @@ -14,7 +14,7 @@ public import LeanPool.Stafford38.Stafford38.Geometry.ScalarExtensionPoints # Scalar extension of equation-conormal vanishing -/ -@[expose] public section +public section namespace Stafford38.Geometry.ConormalScalarExtensionVanishing diff --git a/LeanPool/Stafford38/Stafford38/Geometry/ConstantCoordinateConormal.lean b/LeanPool/Stafford38/Stafford38/Geometry/ConstantCoordinateConormal.lean index 8bfaa53dcd..2f703263f3 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/ConstantCoordinateConormal.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/ConstantCoordinateConormal.lean @@ -22,7 +22,7 @@ axis is then present at a constant point, with no projective boundary or completion. -/ -@[expose] public section +public section namespace Stafford38.Geometry.ConstantCoordinateConormal diff --git a/LeanPool/Stafford38/Stafford38/Geometry/ContinuousPowerSeriesTangentFrame.lean b/LeanPool/Stafford38/Stafford38/Geometry/ContinuousPowerSeriesTangentFrame.lean index c64108462a..a79d8fb1f0 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/ContinuousPowerSeriesTangentFrame.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/ContinuousPowerSeriesTangentFrame.lean @@ -37,7 +37,7 @@ of the residue vectors and the tangent-dimension bound. This file does not construct the residue-field section or the `K[[t]]` chart. -/ -@[expose] public section +public section namespace Stafford38.Geometry.ContinuousPowerSeriesTangentFrame diff --git a/LeanPool/Stafford38/Stafford38/Geometry/DivisorTangentLattice.lean b/LeanPool/Stafford38/Stafford38/Geometry/DivisorTangentLattice.lean index 773621f94c..c5e197a4d1 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/DivisorTangentLattice.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/DivisorTangentLattice.lean @@ -49,7 +49,7 @@ about the derivation restricted to `V`, and producing a place that satisfies it is the remaining geometric input of lane C. -/ -@[expose] public section +public section namespace Stafford38.Geometry.DivisorTangentLattice diff --git a/LeanPool/Stafford38/Stafford38/Geometry/DivisorialBoundaryExtension.lean b/LeanPool/Stafford38/Stafford38/Geometry/DivisorialBoundaryExtension.lean index 6de8eb7648..6fe916f8d2 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/DivisorialBoundaryExtension.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/DivisorialBoundaryExtension.lean @@ -35,7 +35,7 @@ characteristic zero this is the usual finite transcendence-basis step; no such presentation is assumed or named in the theorem proved here. -/ -@[expose] public section +public section namespace Stafford38.Geometry.DivisorialBoundaryExtension diff --git a/LeanPool/Stafford38/Stafford38/Geometry/DivisorialVisibleFrameCore.lean b/LeanPool/Stafford38/Stafford38/Geometry/DivisorialVisibleFrameCore.lean index 370b54826c..582e259d3b 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/DivisorialVisibleFrameCore.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/DivisorialVisibleFrameCore.lean @@ -20,7 +20,7 @@ transcendence stages and states the assembly interface used by the dedicated normalization, residue-algebraicity, and coefficient-field modules. -/ -@[expose] public section +public section open IsLocalRing Polynomial open Stafford38.Geometry.NormalizationHeightOne @@ -34,17 +34,20 @@ namespace Stafford38.Geometry.LaneC variable {k K : Type u} [Field k] [Field K] [Algebra k K] /-- The coefficient-field inclusion with codomain restricted to the valuation ring. -/ +@[expose] def coeffHom (E : IntermediateField k K) (V : ValuationSubring K) (hEV : ∀ z : E, (z : K) ∈ V.toSubring) : E →+* V.toSubring := RingHom.codRestrict (IntermediateField.val E).toRingHom V.toSubring hEV /-- The ground-field map into the valuation ring through the coefficient field. -/ +@[expose] def groundHom (E : IntermediateField k K) (V : ValuationSubring K) (hEV : ∀ z : E, (z : K) ∈ V.toSubring) : k →+* V.toSubring := (coeffHom E V hEV).comp (algebraMap k E) /-- Existence of a discrete boundary place with finite residue and differential data and algebraic coordinate residues. -/ +@[expose] def DivisorialVisibleFrameExistence : Prop := ∀ (k K : Type u) [Field k] [CharZero k] [Field K] [Algebra k K] (r : ℕ) (y : Fin r → K) (i : Fin r), @@ -73,12 +76,14 @@ def DivisorialVisibleFrameExistence : Prop := /-! The concrete localization model used by the place stage. -/ /-- The localization of an affine subalgebra at a prime, realized inside its fraction field. -/ +@[expose] def placeSubalgebra (A : Subalgebra k K) [IsFractionRing A K] (p : Ideal A) [p.IsPrime] : Subalgebra A K := Localization.subalgebra.ofField K p.primeCompl p.primeCompl_le_nonZeroDivisors /-- The valuation subring obtained when the local affine place contains each element or its inverse. -/ +@[expose] def placeValuationSubring (A : Subalgebra k K) [IsFractionRing A K] (p : Ideal A) [p.IsPrime] (h : ∀ z : K, z ∈ (placeSubalgebra A p).toSubring ∨ @@ -377,6 +382,7 @@ The four other stage fields are already available as the theorems above. -/ /-- Existence of a normalized finite-type affine chart that contains the selected coordinate but excludes its inverse. -/ +@[expose] def Stage2Obligation : Prop := ∀ {k K : Type u} [Field k] [CharZero k] [Field K] [Algebra k K] {r : ℕ} (y : Fin r → K) (i : Fin r) @@ -392,6 +398,7 @@ def Stage2Obligation : Prop := /-- Algebraicity of the valuation residue field over the field generated by residues of integral generators. -/ +@[expose] def Stage4Obligation : Prop := ∀ {k K : Type u} [Field k] [Field K] [Algebra k K] (A : Subalgebra k K) (p : Ideal A) [p.IsPrime] @@ -411,6 +418,7 @@ def Stage4Obligation : Prop := /-- Existence of a coefficient subfield contained in the valuation ring over which the residue field is finite. -/ +@[expose] def Stage5Obligation : Prop := ∀ {k K : Type u} [Field k] [Field K] [Algebra k K] (A : Subalgebra k K) [Algebra.FiniteType k A] (p : Ideal A) [p.IsPrime] diff --git a/LeanPool/Stafford38/Stafford38/Geometry/DivisorialVisibleFrameStage2.lean b/LeanPool/Stafford38/Stafford38/Geometry/DivisorialVisibleFrameStage2.lean index db8af951f5..6d5d536a9e 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/DivisorialVisibleFrameStage2.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/DivisorialVisibleFrameStage2.lean @@ -19,7 +19,7 @@ public import LeanPool.Stafford38.Stafford38.Geometry.NormalizationHeightOne Normalized affine charts and integral models for a selected divisorial boundary coordinate. -/ -@[expose] public section +public section open IsLocalRing open scoped nonZeroDivisors diff --git a/LeanPool/Stafford38/Stafford38/Geometry/DivisorialVisibleFrameStage4.lean b/LeanPool/Stafford38/Stafford38/Geometry/DivisorialVisibleFrameStage4.lean index 033fb20f87..ee5e858927 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/DivisorialVisibleFrameStage4.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/DivisorialVisibleFrameStage4.lean @@ -18,7 +18,7 @@ public import Mathlib.FieldTheory.IntermediateField.Adjoin.Defs Algebraicity of the divisorial residue field from integral affine models. -/ -@[expose] public section +public section open IsLocalRing noncomputable section diff --git a/LeanPool/Stafford38/Stafford38/Geometry/DivisorialVisibleFrameStage5.lean b/LeanPool/Stafford38/Stafford38/Geometry/DivisorialVisibleFrameStage5.lean index 12fca21585..786267a48d 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/DivisorialVisibleFrameStage5.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/DivisorialVisibleFrameStage5.lean @@ -13,7 +13,7 @@ public import LeanPool.Stafford38.Stafford38.Geometry.DivisorialVisibleFrameCore Coefficient-field maps and residue-field compatibility for a divisorial valuation ring. -/ -@[expose] public section +public section open IsLocalRing @@ -24,6 +24,7 @@ universe u namespace Stafford38.Geometry.DivisorialVisibleFrameStage5 /-- The coefficient-field inclusion restricted to the chosen valuation ring. -/ +@[expose] def coeffHom {k K : Type u} [Field k] [Field K] [Algebra k K] (E : IntermediateField k K) (V : ValuationSubring K) (hEV : ∀ z : E, (z : K) ∈ V.toSubring) : E →+* V.toSubring := diff --git a/LeanPool/Stafford38/Stafford38/Geometry/DivisorialVisibleFrameStageAssembly.lean b/LeanPool/Stafford38/Stafford38/Geometry/DivisorialVisibleFrameStageAssembly.lean index c95d7d2242..261f64cded 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/DivisorialVisibleFrameStageAssembly.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/DivisorialVisibleFrameStageAssembly.lean @@ -16,7 +16,7 @@ public import LeanPool.Stafford38.Stafford38.Geometry.DivisorialVisibleFrameStag Assembly of the verified affine, residue-field, and valuation stages of a visible frame. -/ -@[expose] public section +public section open IsLocalRing Polynomial open Stafford38.Geometry.NormalizationHeightOne diff --git a/LeanPool/Stafford38/Stafford38/Geometry/ExactDivisorialVisibleFrameExistence.lean b/LeanPool/Stafford38/Stafford38/Geometry/ExactDivisorialVisibleFrameExistence.lean index 0910de87a3..d820e96cfb 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/ExactDivisorialVisibleFrameExistence.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/ExactDivisorialVisibleFrameExistence.lean @@ -17,7 +17,7 @@ public import LeanPool.Stafford38.Stafford38.Geometry.RelativeRetainedBoundaryPl Existence of a divisorial frame satisfying the exact visibility interface. -/ -@[expose] public section +public section namespace Stafford38.Geometry.ExactDivisorialVisibleFrameExistence diff --git a/LeanPool/Stafford38/Stafford38/Geometry/ExactVisibleDivisorFrameInterface.lean b/LeanPool/Stafford38/Stafford38/Geometry/ExactVisibleDivisorFrameInterface.lean index 7c59c53f0f..970c3ac94a 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/ExactVisibleDivisorFrameInterface.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/ExactVisibleDivisorFrameInterface.lean @@ -28,7 +28,7 @@ The exact producer is supplied separately by `ExactDivisorialVisibleFrameExistence`. -/ -@[expose] public section +public section namespace Stafford38.Geometry.ExactVisibleDivisorFrameInterface diff --git a/LeanPool/Stafford38/Stafford38/Geometry/FibreConicalVanishingIdeal.lean b/LeanPool/Stafford38/Stafford38/Geometry/FibreConicalVanishingIdeal.lean index b81c4f5eaf..abc9ced494 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/FibreConicalVanishingIdeal.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/FibreConicalVanishingIdeal.lean @@ -13,7 +13,7 @@ public import LeanPool.Stafford38.Stafford38.Geometry.GeneralConormalContainment # Fibre-conical zero sets have homogeneous vanishing ideals -/ -@[expose] public section +public section namespace Stafford38.Geometry.FibreConicalVanishingIdeal diff --git a/LeanPool/Stafford38/Stafford38/Geometry/FiniteGradientBoundaryProducer.lean b/LeanPool/Stafford38/Stafford38/Geometry/FiniteGradientBoundaryProducer.lean index f43082b47a..073ddbe84a 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/FiniteGradientBoundaryProducer.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/FiniteGradientBoundaryProducer.lean @@ -25,7 +25,7 @@ No normalization, projective closure, boundary divisor, or existence of such a certificate is asserted here. -/ -@[expose] public section +public section namespace Stafford38.Geometry.FiniteGradientBoundaryProducer diff --git a/LeanPool/Stafford38/Stafford38/Geometry/FiniteGradientFromTangentInclusion.lean b/LeanPool/Stafford38/Stafford38/Geometry/FiniteGradientFromTangentInclusion.lean index eff9156869..33acfef524 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/FiniteGradientFromTangentInclusion.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/FiniteGradientFromTangentInclusion.lean @@ -29,7 +29,7 @@ inclusion for the completed boundary chart (and separately handle any residue-field transport). -/ -@[expose] public section +public section namespace Stafford38.Geometry.FiniteGradientFromTangentInclusion diff --git a/LeanPool/Stafford38/Stafford38/Geometry/FiniteGradientResidueExtension.lean b/LeanPool/Stafford38/Stafford38/Geometry/FiniteGradientResidueExtension.lean index 4da93a44ba..15289d4d1d 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/FiniteGradientResidueExtension.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/FiniteGradientResidueExtension.lean @@ -24,7 +24,7 @@ map `K → k`, algebraic-closedness of `K`, normalization, boundary divisor, or global certificate construction is assumed. -/ -@[expose] public section +public section namespace Stafford38.Geometry.FiniteGradientResidueExtension diff --git a/LeanPool/Stafford38/Stafford38/Geometry/FiniteSeparableDVRChartFoundation.lean b/LeanPool/Stafford38/Stafford38/Geometry/FiniteSeparableDVRChartFoundation.lean index 3a167c35ef..1969aa87a9 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/FiniteSeparableDVRChartFoundation.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/FiniteSeparableDVRChartFoundation.lean @@ -26,7 +26,7 @@ to the inverse limit is outside this module's finite-level scope; the completion comparison is supplied by the downstream completed-DVR chart. -/ -@[expose] public section +public section namespace Stafford38.Geometry.FiniteSeparableDVRChartFoundation diff --git a/LeanPool/Stafford38/Stafford38/Geometry/FixedWitnessTangentSqueeze.lean b/LeanPool/Stafford38/Stafford38/Geometry/FixedWitnessTangentSqueeze.lean index 552035adbc..b91144c6af 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/FixedWitnessTangentSqueeze.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/FixedWitnessTangentSqueeze.lean @@ -19,7 +19,7 @@ linear-algebra consumer; it does not construct tangent vectors or establish a smoothness or dimension bound. -/ -@[expose] public section +public section namespace Stafford38.Geometry.FixedWitnessTangentSqueeze diff --git a/LeanPool/Stafford38/Stafford38/Geometry/FormalDivisorAxisLift.lean b/LeanPool/Stafford38/Stafford38/Geometry/FormalDivisorAxisLift.lean index 0200a27879..09e6587271 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/FormalDivisorAxisLift.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/FormalDivisorAxisLift.lean @@ -26,7 +26,7 @@ residue is the pure axis covector. No normalization, projective divisor, formal-chart construction, or global conormal-closure statement is made here. -/ -@[expose] public section +public section namespace Stafford38.GeometryFormalDivisorAxisLift diff --git a/LeanPool/Stafford38/Stafford38/Geometry/FormalDivisorLaurentConormal.lean b/LeanPool/Stafford38/Stafford38/Geometry/FormalDivisorLaurentConormal.lean index 97a6d7e6e9..6a42ad8a5b 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/FormalDivisorLaurentConormal.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/FormalDivisorLaurentConormal.lean @@ -27,7 +27,7 @@ No normalization or divisor chart is constructed here. In particular this file makes no global closure, coisotropy, or Gabber claim. -/ -@[expose] public section +public section namespace Stafford38.Geometry.FormalDivisorLaurentConormal diff --git a/LeanPool/Stafford38/Stafford38/Geometry/FormalDivisorTangent.lean b/LeanPool/Stafford38/Stafford38/Geometry/FormalDivisorTangent.lean index dedc35a41b..ccb17af7e0 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/FormalDivisorTangent.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/FormalDivisorTangent.lean @@ -27,7 +27,7 @@ Every output is constructed from the displayed equations. No residue-rank, saturation, splitting, or left-inverse hypothesis is assumed. -/ -@[expose] public section +public section namespace Stafford38.GeometryFormalDivisorTangent @@ -173,6 +173,7 @@ abbrev FormalTangentColumn (κ : Type*) := Unit ⊕ (κ ⊕ Unit) /-- Assemble the position, divisor-tangent, and normalized transverse columns without making any rank assertion. -/ +@[expose] def formalTangentMatrix {ι : Type v} {κ : Type w} (q : ι → PowerSeries k) (Z : Matrix ι κ (PowerSeries k)) diff --git a/LeanPool/Stafford38/Stafford38/Geometry/GeneralAsymptoticConormal.lean b/LeanPool/Stafford38/Stafford38/Geometry/GeneralAsymptoticConormal.lean index 93f0949cc2..6265b1a9ad 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/GeneralAsymptoticConormal.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/GeneralAsymptoticConormal.lean @@ -19,7 +19,7 @@ coordinates may have poles. Smooth-locus density and scalar-extension vanishing relate that witness to the ground-field projective direction set. -/ -@[expose] public section +public section namespace Stafford38.Geometry.GeneralAsymptoticConormal diff --git a/LeanPool/Stafford38/Stafford38/Geometry/GeneralAsymptoticLaurentAxis.lean b/LeanPool/Stafford38/Stafford38/Geometry/GeneralAsymptoticLaurentAxis.lean index 7065ab462b..dc0592cca9 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/GeneralAsymptoticLaurentAxis.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/GeneralAsymptoticLaurentAxis.lean @@ -20,7 +20,7 @@ prime affine ideal. The conclusion is a residue-extension Laurent witness; its comparison with ground-field projective directions is separate. -/ -@[expose] public section +public section namespace Stafford38.Geometry.GeneralAsymptoticLaurentAxis diff --git a/LeanPool/Stafford38/Stafford38/Geometry/GeneralCoisotropicCanonicalAdapter.lean b/LeanPool/Stafford38/Stafford38/Geometry/GeneralCoisotropicCanonicalAdapter.lean index 912f5981cc..188d1a0162 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/GeneralCoisotropicCanonicalAdapter.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/GeneralCoisotropicCanonicalAdapter.lean @@ -33,7 +33,7 @@ This adapter is deliberately separate from the canonical support assembly, so the general theorem can be integrated there without an import cycle. -/ -@[expose] public section +public section namespace Stafford38.Geometry.GeneralCoisotropicCanonicalAdapter diff --git a/LeanPool/Stafford38/Stafford38/Geometry/GeneralCoisotropicExclusion.lean b/LeanPool/Stafford38/Stafford38/Geometry/GeneralCoisotropicExclusion.lean index 84da99bdf5..3173f10342 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/GeneralCoisotropicExclusion.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/GeneralCoisotropicExclusion.lean @@ -18,7 +18,7 @@ symbol hypersurface transverse to the distinguished axis must meet the coordinate hyperplane. -/ -@[expose] public section +public section namespace Stafford38.Geometry.GeneralCoisotropicExclusion diff --git a/LeanPool/Stafford38/Stafford38/Geometry/GeneralCoisotropicSets.lean b/LeanPool/Stafford38/Stafford38/Geometry/GeneralCoisotropicSets.lean index edce2aa132..6c1ee3a9db 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/GeneralCoisotropicSets.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/GeneralCoisotropicSets.lean @@ -18,7 +18,7 @@ The vanishing ideal is radical, and its base contraction describes the base projection of a closed fibre-conical set. -/ -@[expose] public section +public section namespace Stafford38.Geometry.GeneralCoisotropicSets diff --git a/LeanPool/Stafford38/Stafford38/Geometry/GeneralCoisotropicSetsTest.lean b/LeanPool/Stafford38/Stafford38/Geometry/GeneralCoisotropicSetsTest.lean index dc288d04d4..81d5f9c6d5 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/GeneralCoisotropicSetsTest.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/GeneralCoisotropicSetsTest.lean @@ -21,7 +21,7 @@ rather than by an explicit homogeneous-ideal hypothesis. The additional Poisson import supplies product rules for the independent negative control. -/ -@[expose] public section +public section namespace Stafford38.Geometry.GeneralCoisotropicSetsTest diff --git a/LeanPool/Stafford38/Stafford38/Geometry/GeneralComponentConormalContainment.lean b/LeanPool/Stafford38/Stafford38/Geometry/GeneralComponentConormalContainment.lean index 4e9fe4c504..6db392bf9b 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/GeneralComponentConormalContainment.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/GeneralComponentConormalContainment.lean @@ -17,7 +17,7 @@ public import Mathlib.RingTheory.Ideal.MinimalPrime.Localization Containment of a component’s conormal closure in the ambient characteristic variety. -/ -@[expose] public section +public section namespace Stafford38.Geometry.GeneralComponentConormalContainment diff --git a/LeanPool/Stafford38/Stafford38/Geometry/GeneralConormalAxis.lean b/LeanPool/Stafford38/Stafford38/Geometry/GeneralConormalAxis.lean index 89705e1f99..a2e38234e7 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/GeneralConormalAxis.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/GeneralConormalAxis.lean @@ -29,7 +29,7 @@ Chapters 1–2 supply characteristic-variety context. The visible-frame and fini construction is project mathematics, not a cited theorem from this book. See docs/literature.md. -/ -@[expose] public section +public section namespace Stafford38.Geometry.GeneralConormalAxis diff --git a/LeanPool/Stafford38/Stafford38/Geometry/GeneralConormalContainment.lean b/LeanPool/Stafford38/Stafford38/Geometry/GeneralConormalContainment.lean index 137362bd78..5524320ea2 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/GeneralConormalContainment.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/GeneralConormalContainment.lean @@ -17,7 +17,7 @@ Fibre-degree homogeneity supplies its zero-section input through the actual Mathlib graded-ideal API. -/ -@[expose] public section +public section namespace Stafford38.Geometry.GeneralConormalContainment diff --git a/LeanPool/Stafford38/Stafford38/Geometry/GeneralConstantCoordinateAxis.lean b/LeanPool/Stafford38/Stafford38/Geometry/GeneralConstantCoordinateAxis.lean index 4fceebe8d9..261fcb5967 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/GeneralConstantCoordinateAxis.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/GeneralConstantCoordinateAxis.lean @@ -15,7 +15,7 @@ public import Mathlib.RingTheory.Nullstellensatz A constant coordinate equation and its pure conormal axis on an affine component. -/ -@[expose] public section +public section namespace Stafford38.Geometry.GeneralConstantCoordinateAxis diff --git a/LeanPool/Stafford38/Stafford38/Geometry/GeneralCoordinateAvoidance.lean b/LeanPool/Stafford38/Stafford38/Geometry/GeneralCoordinateAvoidance.lean index 2b9d9d94c6..c6a1e95a31 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/GeneralCoordinateAvoidance.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/GeneralCoordinateAvoidance.lean @@ -16,7 +16,7 @@ A coordinate that never vanishes on an affine zero locus is invertible modulo its defining ideal. The ideal need not be prime or radical. -/ -@[expose] public section +public section namespace Stafford38.Geometry.GeneralCoordinateAvoidance diff --git a/LeanPool/Stafford38/Stafford38/Geometry/GeneralDivisorialVisibleFrame.lean b/LeanPool/Stafford38/Stafford38/Geometry/GeneralDivisorialVisibleFrame.lean index 4ce247b83c..9907799c20 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/GeneralDivisorialVisibleFrame.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/GeneralDivisorialVisibleFrame.lean @@ -19,7 +19,7 @@ direction with the smooth projective conormal closure is performed downstream in the general asymptotic-conormal construction. -/ -@[expose] public section +public section namespace Stafford38.Geometry.GeneralDivisorialVisibleFrame diff --git a/LeanPool/Stafford38/Stafford38/Geometry/GeneralTangentLatticePresentation.lean b/LeanPool/Stafford38/Stafford38/Geometry/GeneralTangentLatticePresentation.lean index b5850ed206..7a17d72c07 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/GeneralTangentLatticePresentation.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/GeneralTangentLatticePresentation.lean @@ -11,7 +11,7 @@ public import LeanPool.Stafford38.AlgebraicAnalysis.Module.SplitLatticePresentat /-! Compatibility exports for the neutral split-lattice presentation. -/ -@[expose] public section +public section namespace Stafford38.Geometry.GeneralTangentLatticePresentation diff --git a/LeanPool/Stafford38/Stafford38/Geometry/GeneralTangentLimitCriterion.lean b/LeanPool/Stafford38/Stafford38/Geometry/GeneralTangentLimitCriterion.lean index 509cef0fa3..0f225d1f4c 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/GeneralTangentLimitCriterion.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/GeneralTangentLimitCriterion.lean @@ -37,7 +37,7 @@ matrix presentation and proves the projective-closure and tangent-chart dictionaries before applying that kernel. -/ -@[expose] public section +public section namespace Stafford38.Geometry.GeneralTangentLimitCriterion diff --git a/LeanPool/Stafford38/Stafford38/Geometry/GeneralTangentLimitCriterionTest.lean b/LeanPool/Stafford38/Stafford38/Geometry/GeneralTangentLimitCriterionTest.lean index 3fa22d5320..5f347c3e5f 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/GeneralTangentLimitCriterionTest.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/GeneralTangentLimitCriterionTest.lean @@ -19,7 +19,7 @@ lattice. No matrix basis, retraction, annihilator, position coefficients, or separate tangent-chart equality is supplied. -/ -@[expose] public section +public section namespace Stafford38.Geometry.GeneralTangentLimitCriterionTest diff --git a/LeanPool/Stafford38/Stafford38/Geometry/GenericPointKaehlerConormal.lean b/LeanPool/Stafford38/Stafford38/Geometry/GenericPointKaehlerConormal.lean index d3c3fa54ec..73baef89ce 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/GenericPointKaehlerConormal.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/GenericPointKaehlerConormal.lean @@ -33,7 +33,7 @@ smoothness, or geometric conormal bundles. Only linear algebra of Kähler differentials and derivations over the fraction field of a quotient ring. -/ -@[expose] public section +public section namespace Stafford38.Geometry.GenericPointKaehlerConormal diff --git a/LeanPool/Stafford38/Stafford38/Geometry/GenericSmoothOpen.lean b/LeanPool/Stafford38/Stafford38/Geometry/GenericSmoothOpen.lean index b7b7662189..b88c50325d 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/GenericSmoothOpen.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/GenericSmoothOpen.lean @@ -21,7 +21,7 @@ is smooth. This file deliberately makes no Jacobian or conormal identification. -/ -@[expose] public section +public section namespace Stafford38.Geometry diff --git a/LeanPool/Stafford38/Stafford38/Geometry/JacobianConormalComparison.lean b/LeanPool/Stafford38/Stafford38/Geometry/JacobianConormalComparison.lean index fe6c13271c..a8f23d5621 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/JacobianConormalComparison.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/JacobianConormalComparison.lean @@ -29,7 +29,7 @@ comparison, algebraic closedness, or base change is asserted here. Those are inputs to the comparison theorem, not consequences of it. -/ -@[expose] public section +public section namespace Stafford38.Geometry.JacobianConormalComparison diff --git a/LeanPool/Stafford38/Stafford38/Geometry/KaehlerDVRVisibility.lean b/LeanPool/Stafford38/Stafford38/Geometry/KaehlerDVRVisibility.lean index 721c66bc3f..37a32c471a 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/KaehlerDVRVisibility.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/KaehlerDVRVisibility.lean @@ -24,7 +24,7 @@ remaining residue cotangent space. Mapping this statement to the fraction field gives the visibility condition used by `VisibleDivisorFrame`. -/ -@[expose] public section +public section namespace Stafford38.Geometry.KaehlerDVRVisibility diff --git a/LeanPool/Stafford38/Stafford38/Geometry/KaehlerSpanSeparableAdjoin.lean b/LeanPool/Stafford38/Stafford38/Geometry/KaehlerSpanSeparableAdjoin.lean index cc50c73e54..7fea0959ae 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/KaehlerSpanSeparableAdjoin.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/KaehlerSpanSeparableAdjoin.lean @@ -27,7 +27,7 @@ residue coordinates at a chosen divisor generate an intermediate field, or produce any completed boundary chart. Those are separate geometric inputs. -/ -@[expose] public section +public section namespace Stafford38.Geometry.KaehlerSpanSeparableAdjoin diff --git a/LeanPool/Stafford38/Stafford38/Geometry/KaehlerVisibleDerivationFrame.lean b/LeanPool/Stafford38/Stafford38/Geometry/KaehlerVisibleDerivationFrame.lean index 0cc64bc0b9..5592c57399 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/KaehlerVisibleDerivationFrame.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/KaehlerVisibleDerivationFrame.lean @@ -28,7 +28,7 @@ This file assumes the spanning hypothesis. In particular, it does not claim that an arbitrary retained DVR or boundary place supplies it. -/ -@[expose] public section +public section namespace Stafford38.Geometry.KaehlerVisibleDerivationFrame diff --git a/LeanPool/Stafford38/Stafford38/Geometry/LaurentConormalDirection.lean b/LeanPool/Stafford38/Stafford38/Geometry/LaurentConormalDirection.lean index d5401c6304..559b81107c 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/LaurentConormalDirection.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/LaurentConormalDirection.lean @@ -29,7 +29,7 @@ normalization chart, asymptotic-conormal producer, or Gabber theorem is proved here. -/ -@[expose] public section +public section namespace Stafford38.Geometry.LaurentConormalDirection diff --git a/LeanPool/Stafford38/Stafford38/Geometry/LaurentConormalResidueExtension.lean b/LeanPool/Stafford38/Stafford38/Geometry/LaurentConormalResidueExtension.lean index 10d544d9a3..368270cb41 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/LaurentConormalResidueExtension.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/LaurentConormalResidueExtension.lean @@ -34,7 +34,7 @@ completed-boundary local interface. They construct no projective chart, normalization, divisor, or tangent comparison. -/ -@[expose] public section +public section namespace Stafford38.Geometry.LaurentConormalResidueExtension diff --git a/LeanPool/Stafford38/Stafford38/Geometry/LocalizedProjectiveChartTransition.lean b/LeanPool/Stafford38/Stafford38/Geometry/LocalizedProjectiveChartTransition.lean index 3464ec4f04..f2b974c754 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/LocalizedProjectiveChartTransition.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/LocalizedProjectiveChartTransition.lean @@ -18,7 +18,7 @@ chosen chart is obtained by inverting the chosen-chart coordinate representing `X₀ / X_chart`. This file constructs the resulting transition homomorphism. -/ -@[expose] public section +public section namespace Stafford38.Geometry.LocalizedProjectiveChartTransition diff --git a/LeanPool/Stafford38/Stafford38/Geometry/NormalizationHeightOne.lean b/LeanPool/Stafford38/Stafford38/Geometry/NormalizationHeightOne.lean index 18578d5ff6..1b0cdc8b47 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/NormalizationHeightOne.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/NormalizationHeightOne.lean @@ -49,7 +49,7 @@ the `haveI` style option, so that the checked artefact is not perturbed for cosmetics. -/ -@[expose] public section +public section namespace Stafford38.Geometry.NormalizationHeightOne diff --git a/LeanPool/Stafford38/Stafford38/Geometry/OneVariableAmbientConormal.lean b/LeanPool/Stafford38/Stafford38/Geometry/OneVariableAmbientConormal.lean index 661c72a5b8..6beb0a8aab 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/OneVariableAmbientConormal.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/OneVariableAmbientConormal.lean @@ -26,7 +26,7 @@ nonzero, so the ambient equation itself spans the unique cotangent direction. This produces the Laurent conormal axis for the ambient ideal directly. -/ -@[expose] public section +public section namespace Stafford38.Geometry.OneVariableAmbientConormal diff --git a/LeanPool/Stafford38/Stafford38/Geometry/OneVariablePrimeConormal.lean b/LeanPool/Stafford38/Stafford38/Geometry/OneVariablePrimeConormal.lean index 7130ae8784..f4cd019dfc 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/OneVariablePrimeConormal.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/OneVariablePrimeConormal.lean @@ -26,7 +26,7 @@ No projective chart, completion, Gabber input, or filtered cancellation is used here. -/ -@[expose] public section +public section namespace Stafford38.Geometry.OneVariablePrimeConormal diff --git a/LeanPool/Stafford38/Stafford38/Geometry/PointwiseConormalContainment.lean b/LeanPool/Stafford38/Stafford38/Geometry/PointwiseConormalContainment.lean index 098c01d3fe..dedfa1a322 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/PointwiseConormalContainment.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/PointwiseConormalContainment.lean @@ -24,7 +24,7 @@ vanishing at the chosen point; it does not prove that hypothesis or any homogeneity statement. -/ -@[expose] public section +public section namespace Stafford38.Geometry.PointwiseConormalContainment diff --git a/LeanPool/Stafford38/Stafford38/Geometry/PowerSeriesArcTangency.lean b/LeanPool/Stafford38/Stafford38/Geometry/PowerSeriesArcTangency.lean index 8adae4e59b..b4f174ca2a 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/PowerSeriesArcTangency.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/PowerSeriesArcTangency.lean @@ -25,7 +25,7 @@ projective component. Those chart, normalization, frame-independence, and dimension arguments remain separate geometric obligations. -/ -@[expose] public section +public section namespace Stafford38.Geometry.PowerSeriesArcTangency diff --git a/LeanPool/Stafford38/Stafford38/Geometry/PowerSeriesTangentLimit.lean b/LeanPool/Stafford38/Stafford38/Geometry/PowerSeriesTangentLimit.lean index d23a6e25e5..fc19b6fe83 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/PowerSeriesTangentLimit.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/PowerSeriesTangentLimit.lean @@ -27,7 +27,7 @@ does not construct the split lattice from `T`, nor does it construct an arc, a normalization, a divisor at infinity, or a projective closure. -/ -@[expose] public section +public section namespace Stafford38.GeometryPowerSeriesTangentLimit @@ -40,6 +40,7 @@ universe u v variable {k : Type u} [Field k] /-- The coordinate row selecting `axis`. -/ +@[expose] def axisRow {ι : Type*} [DecidableEq ι] (axis : ι) : ι → k := fun i => if i = axis then 1 else 0 diff --git a/LeanPool/Stafford38/Stafford38/Geometry/ProjectiveBoundaryFrameRank.lean b/LeanPool/Stafford38/Stafford38/Geometry/ProjectiveBoundaryFrameRank.lean index d158ca7d85..6dfc99bc2f 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/ProjectiveBoundaryFrameRank.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/ProjectiveBoundaryFrameRank.lean @@ -27,7 +27,7 @@ and no closed-boundary tangent bound is asserted; either conclusion needs an additional geometric comparison. -/ -@[expose] public section +public section namespace Stafford38.Geometry.ProjectiveBoundaryFrameRank diff --git a/LeanPool/Stafford38/Stafford38/Geometry/ProjectiveConormalDehomogenization.lean b/LeanPool/Stafford38/Stafford38/Geometry/ProjectiveConormalDehomogenization.lean index a661a53798..5d16f73e27 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/ProjectiveConormalDehomogenization.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/ProjectiveConormalDehomogenization.lean @@ -22,7 +22,7 @@ Laurent specialization, closure theorem, or coisotropy statement is constructed here. The tangent-space equality and the base equations are explicit inputs. -/ -@[expose] public section +public section namespace Stafford38.Geometry.ProjectiveConormalDehomogenization diff --git a/LeanPool/Stafford38/Stafford38/Geometry/ProjectiveConormalDirections.lean b/LeanPool/Stafford38/Stafford38/Geometry/ProjectiveConormalDirections.lean index 193b42686e..c1f6c5b982 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/ProjectiveConormalDirections.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/ProjectiveConormalDirections.lean @@ -18,7 +18,7 @@ Only the polynomial criterion is recorded here. This file does not identify an asymptotic conormal variety with a projective closure. -/ -@[expose] public section +public section namespace Stafford38.Geometry.ProjectiveConormalDirections diff --git a/LeanPool/Stafford38/Stafford38/Geometry/ProjectiveDivisorOrderGap.lean b/LeanPool/Stafford38/Stafford38/Geometry/ProjectiveDivisorOrderGap.lean index 893142ebe7..297db0a754 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/ProjectiveDivisorOrderGap.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/ProjectiveDivisorOrderGap.lean @@ -30,7 +30,7 @@ prime divisor. Those global existence statements are not presently available in Mathlib's algebraic-geometry library. -/ -@[expose] public section +public section namespace Stafford38.Geometry.ProjectiveDivisorOrderGap diff --git a/LeanPool/Stafford38/Stafford38/Geometry/ProjectiveEquationFormalChart.lean b/LeanPool/Stafford38/Stafford38/Geometry/ProjectiveEquationFormalChart.lean index 7d448df062..f7244c27fb 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/ProjectiveEquationFormalChart.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/ProjectiveEquationFormalChart.lean @@ -25,7 +25,7 @@ or tangent-space equality is constructed here. Those geometric existence statements remain outside this algebraic chart calculation. -/ -@[expose] public section +public section namespace Stafford38.Geometry.ProjectiveEquationFormalChart diff --git a/LeanPool/Stafford38/Stafford38/Geometry/ProjectiveTangentInclusion.lean b/LeanPool/Stafford38/Stafford38/Geometry/ProjectiveTangentInclusion.lean index d63380606a..c228620c6c 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/ProjectiveTangentInclusion.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/ProjectiveTangentInclusion.lean @@ -22,7 +22,7 @@ divisor and Laurent-direction consumers. It constructs no projective chart, normalization, tangent comparison, or conormal-closure theorem. -/ -@[expose] public section +public section namespace Stafford38.Geometry.ProjectiveTangentInclusion diff --git a/LeanPool/Stafford38/Stafford38/Geometry/ProjectiveValuationNormalization.lean b/LeanPool/Stafford38/Stafford38/Geometry/ProjectiveValuationNormalization.lean index dccc84916c..2f36ecb4be 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/ProjectiveValuationNormalization.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/ProjectiveValuationNormalization.lean @@ -21,7 +21,7 @@ same scalar is used in every coordinate, so all projective ratios and homogeneous equations are preserved. -/ -@[expose] public section +public section namespace Stafford38.Geometry.ProjectiveValuationNormalization diff --git a/LeanPool/Stafford38/Stafford38/Geometry/RelativeCoefficientDVRPlace.lean b/LeanPool/Stafford38/Stafford38/Geometry/RelativeCoefficientDVRPlace.lean index ffcf8f6187..b8b5d745b4 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/RelativeCoefficientDVRPlace.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/RelativeCoefficientDVRPlace.lean @@ -21,7 +21,7 @@ residue extension is finite and separable in characteristic zero. No inverse limit, completion, or power-series chart is constructed here. -/ -@[expose] public section +public section namespace Stafford38.Geometry.RelativeCoefficientDVR diff --git a/LeanPool/Stafford38/Stafford38/Geometry/RelativeDivisorialTower.lean b/LeanPool/Stafford38/Stafford38/Geometry/RelativeDivisorialTower.lean index 88b5c7a53b..8f9a1bcc03 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/RelativeDivisorialTower.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/RelativeDivisorialTower.lean @@ -30,7 +30,7 @@ comparison, together with transport of the finite-dimensional instance, is the next formal interface needed by the existing divisorial-extension theorem. -/ -@[expose] public section +public section namespace Stafford38.Geometry.RelativeDivisorialTower diff --git a/LeanPool/Stafford38/Stafford38/Geometry/RelativeFractionFieldTransport.lean b/LeanPool/Stafford38/Stafford38/Geometry/RelativeFractionFieldTransport.lean index 367d46f299..d84f75e430 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/RelativeFractionFieldTransport.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/RelativeFractionFieldTransport.lean @@ -22,7 +22,7 @@ finite separable tower constructed in `RelativeDivisorialTower` to the exact input expected by `DivisorialBoundaryExtension`. -/ -@[expose] public section +public section namespace Stafford38.Geometry.RelativeFractionFieldTransport diff --git a/LeanPool/Stafford38/Stafford38/Geometry/RelativeRetainedBoundaryPlace.lean b/LeanPool/Stafford38/Stafford38/Geometry/RelativeRetainedBoundaryPlace.lean index e65d1057e4..182903ce84 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/RelativeRetainedBoundaryPlace.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/RelativeRetainedBoundaryPlace.lean @@ -22,7 +22,7 @@ No projective normalization, completed projective coordinates, or tangent frame is constructed here. -/ -@[expose] public section +public section namespace Stafford38.Geometry.RelativeRetainedBoundaryPlace diff --git a/LeanPool/Stafford38/Stafford38/Geometry/ResidueMinorSelection.lean b/LeanPool/Stafford38/Stafford38/Geometry/ResidueMinorSelection.lean index e86b17668f..6cddbf60c6 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/ResidueMinorSelection.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/ResidueMinorSelection.lean @@ -20,7 +20,7 @@ the column index type into the row index type, matching the input expected by `GeometrySplitTangentMatrix`. -/ -@[expose] public section +public section namespace Stafford38.GeometryResidueMinorSelection @@ -96,6 +96,7 @@ theorem exists_selectedMinor_det_ne_zero_of_mulVec_injective /-! ## Power-series residue matrices -/ /-- Entrywise constant coefficient of a power-series matrix. -/ +@[expose] def residueMatrix {ι : Type v} {κ : Type w} (B : Matrix ι κ (PowerSeries k)) : Matrix ι κ k := fun i j => PowerSeries.constantCoeff (B i j) diff --git a/LeanPool/Stafford38/Stafford38/Geometry/RetainedComponentEquationPackage.lean b/LeanPool/Stafford38/Stafford38/Geometry/RetainedComponentEquationPackage.lean index 87b2a4199b..af708f312b 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/RetainedComponentEquationPackage.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/RetainedComponentEquationPackage.lean @@ -22,7 +22,7 @@ No ambient algebra structure on the residue field is used, and no tangent data are constructed here. -/ -@[expose] public section +public section namespace Stafford38.Geometry.RetainedComponentEquationPackage diff --git a/LeanPool/Stafford38/Stafford38/Geometry/RetainedDVRCore.lean b/LeanPool/Stafford38/Stafford38/Geometry/RetainedDVRCore.lean index c456f744b8..ef61e592af 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/RetainedDVRCore.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/RetainedDVRCore.lean @@ -26,7 +26,7 @@ not construct a relative coefficient-field map, residue separability, an inverse limit, or a power-series chart. -/ -@[expose] public section +public section namespace Stafford38.Geometry.RetainedDVR @@ -39,6 +39,7 @@ noncomputable section universe u v w /-- Finiteness of the residue-field extension induced by a local ring homomorphism. -/ +@[expose] def ResidueExtensionFinite {A V : Type*} [CommRing A] [IsLocalRing A] [CommRing V] [IsLocalRing V] (factor : A →+* V) diff --git a/LeanPool/Stafford38/Stafford38/Geometry/RetainedGroundMapIdentification.lean b/LeanPool/Stafford38/Stafford38/Geometry/RetainedGroundMapIdentification.lean index 70d73dd1ca..102b52e643 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/RetainedGroundMapIdentification.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/RetainedGroundMapIdentification.lean @@ -24,7 +24,7 @@ The choice of `Algebra` structure is part of the statement. No equality with an unrelated ground-field embedding of the residue field is asserted. -/ -@[expose] public section +public section namespace Stafford38.Geometry.RetainedGroundMapIdentification diff --git a/LeanPool/Stafford38/Stafford38/Geometry/RetainedPlaceConormalTransport.lean b/LeanPool/Stafford38/Stafford38/Geometry/RetainedPlaceConormalTransport.lean index eba1e993eb..042d3bac5c 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/RetainedPlaceConormalTransport.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/RetainedPlaceConormalTransport.lean @@ -56,7 +56,7 @@ What is not proved here: the existence of a visible divisor frame `D`, and the bridge `hbridge`; both are explicit hypotheses. -/ -@[expose] public section +public section namespace Stafford38.Geometry.RetainedPlaceConormalTransport diff --git a/LeanPool/Stafford38/Stafford38/Geometry/RetainedProjectiveCompletion.lean b/LeanPool/Stafford38/Stafford38/Geometry/RetainedProjectiveCompletion.lean index 2eef62d703..0c6b2ed31f 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/RetainedProjectiveCompletion.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/RetainedProjectiveCompletion.lean @@ -19,7 +19,7 @@ power series over the actual residue field. Krull intersection makes this coordinate map injective, so projective nonvanishing is preserved. -/ -@[expose] public section +public section namespace Stafford38.Geometry.RetainedProjectiveCompletion diff --git a/LeanPool/Stafford38/Stafford38/Geometry/RetractionSpecialization.lean b/LeanPool/Stafford38/Stafford38/Geometry/RetractionSpecialization.lean index 91e1a0a13c..aef7fadfa3 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/RetractionSpecialization.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/RetractionSpecialization.lean @@ -27,7 +27,7 @@ contradiction for an arbitrary variable type and arbitrary specialization vector. -/ -@[expose] public section +public section namespace Stafford38.GeometryRetractionSpecialization @@ -40,6 +40,7 @@ universe u v w variable {R : Type u} [CommRing R] /-- A row vector multiplied by a matrix on the right. -/ +@[expose] def rowMul {ι κ : Type*} [Fintype ι] (a : ι → R) (B : Matrix ι κ R) : κ → R := fun j => ∑ i, a i * B i j diff --git a/LeanPool/Stafford38/Stafford38/Geometry/ScalarExtensionPoints.lean b/LeanPool/Stafford38/Stafford38/Geometry/ScalarExtensionPoints.lean index b5c57b0e62..581e03cab5 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/ScalarExtensionPoints.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/ScalarExtensionPoints.lean @@ -24,7 +24,7 @@ zero loci agree over every extension field. No assertion that radicals, closures, or ideal contractions commute with base change is made here. -/ -@[expose] public section +public section namespace Stafford38.Geometry.ScalarExtensionPoints diff --git a/LeanPool/Stafford38/Stafford38/Geometry/SeparableResidueDerivationExtension.lean b/LeanPool/Stafford38/Stafford38/Geometry/SeparableResidueDerivationExtension.lean index 9a87cf9a25..3d9f818884 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/SeparableResidueDerivationExtension.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/SeparableResidueDerivationExtension.lean @@ -30,7 +30,7 @@ identify a completion with `K[[t]]`, or extend these derivations continuously to power series. Those remain separate inputs to the completed-chart step. -/ -@[expose] public section +public section namespace Stafford38.Geometry.SeparableResidueDerivationExtension @@ -89,6 +89,7 @@ theorem existsUnique_derivation_extension rw [hD', extendDerivation_compAlgebraMap] /-- Restriction of derivations along `E -> K`, as a `K`-linear map. -/ +@[expose] def restrictDerivation : Derivation k K K →ₗ[K] Derivation k E K where toFun D := D.compAlgebraMap E @@ -98,6 +99,7 @@ def restrictDerivation : /-- Restriction is a linear equivalence for a separable field extension. In particular, finite derivation frames can be transported without losing linear relations. -/ +@[expose] noncomputable def derivationRestrictionEquiv : Derivation k K K ≃ₗ[K] Derivation k E K := LinearEquiv.ofBijective (restrictDerivation k E K) ⟨ diff --git a/LeanPool/Stafford38/Stafford38/Geometry/SmoothAffineConormal.lean b/LeanPool/Stafford38/Stafford38/Geometry/SmoothAffineConormal.lean index 0d1717c341..73d55abdc9 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/SmoothAffineConormal.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/SmoothAffineConormal.lean @@ -19,7 +19,7 @@ equation conormal over those smooth points has the same algebraic closure as the full equation conormal. -/ -@[expose] public section +public section namespace Stafford38.Geometry.SmoothAffineConormal diff --git a/LeanPool/Stafford38/Stafford38/Geometry/SmoothConormalFibreVanishing.lean b/LeanPool/Stafford38/Stafford38/Geometry/SmoothConormalFibreVanishing.lean index f9cb6fd186..f025ccdcdc 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/SmoothConormalFibreVanishing.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/SmoothConormalFibreVanishing.lean @@ -17,7 +17,7 @@ For a prime affine ideal, a fibre polynomial vanishing on all smooth conormal fibres also vanishes on the entire equation-conormal locus. -/ -@[expose] public section +public section namespace Stafford38.Geometry.SmoothConormalFibreVanishing diff --git a/LeanPool/Stafford38/Stafford38/Geometry/SplitTangentMatrix.lean b/LeanPool/Stafford38/Stafford38/Geometry/SplitTangentMatrix.lean index 810049b393..cc5f107feb 100644 --- a/LeanPool/Stafford38/Stafford38/Geometry/SplitTangentMatrix.lean +++ b/LeanPool/Stafford38/Stafford38/Geometry/SplitTangentMatrix.lean @@ -23,7 +23,7 @@ selected minor has nonzero constant coefficient. This file does not assert that a suitable minor exists for a geometric tangent family. -/ -@[expose] public section +public section namespace Stafford38.GeometrySplitTangentMatrix @@ -34,6 +34,7 @@ universe u v variable {R : Type u} [CommRing R] /-- The square submatrix obtained by retaining the explicitly selected rows. -/ +@[expose] def selectedMinor {ι κ : Type*} (B : Matrix ι κ R) (rows : κ ↪ ι) : Matrix κ κ R := fun a b => B (rows a) b diff --git a/LeanPool/Stafford38/Stafford38/LeftDenominatorTransport.lean b/LeanPool/Stafford38/Stafford38/LeftDenominatorTransport.lean index 9cb3b488ee..4e6ed0eb9a 100644 --- a/LeanPool/Stafford38/Stafford38/LeftDenominatorTransport.lean +++ b/LeanPool/Stafford38/Stafford38/LeftDenominatorTransport.lean @@ -13,7 +13,7 @@ public import LeanPool.Stafford38.Stafford38.LocalizationCorollaries Transport of the two-generator identity through left unit denominator clearing. -/ -@[expose] public section +public section namespace Stafford38.LocalizationCorollaries diff --git a/LeanPool/Stafford38/Stafford38/LeftHandedCorollary.lean b/LeanPool/Stafford38/Stafford38/LeftHandedCorollary.lean index 26bab2157e..ed8478fabc 100644 --- a/LeanPool/Stafford38/Stafford38/LeftHandedCorollary.lean +++ b/LeanPool/Stafford38/Stafford38/LeftHandedCorollary.lean @@ -13,7 +13,7 @@ public import LeanPool.Stafford38.Stafford38.Weyl.TranspositionFiltration /-! The left-handed form is the formal-adjoint/opposite-ring image of the written-order Stafford identity. -/ -@[expose] public section +public section namespace Stafford38.LeftHandedCorollary diff --git a/LeanPool/Stafford38/Stafford38/LocalizationCorollaries.lean b/LeanPool/Stafford38/Stafford38/LocalizationCorollaries.lean index bd0e6a6354..a3f26bad9b 100644 --- a/LeanPool/Stafford38/Stafford38/LocalizationCorollaries.lean +++ b/LeanPool/Stafford38/Stafford38/LocalizationCorollaries.lean @@ -14,7 +14,7 @@ public import LeanPool.Stafford38.AlgebraicAnalysis.Ore.RightLocalization /-! Right Ore localization corollaries for the Stafford 3.8 identity. The generic unit-denominator transport proof lives in AlgebraicAnalysis. -/ -@[expose] public section +public section namespace Stafford38.LocalizationCorollaries diff --git a/LeanPool/Stafford38/Stafford38/LocalizedDifferentialClearing.lean b/LeanPool/Stafford38/Stafford38/LocalizedDifferentialClearing.lean index c65c722ba6..1d07425f0c 100644 --- a/LeanPool/Stafford38/Stafford38/LocalizedDifferentialClearing.lean +++ b/LeanPool/Stafford38/Stafford38/LocalizedDifferentialClearing.lean @@ -15,7 +15,7 @@ public import LeanPool.Stafford38.Stafford38.LocalizedPolynomialCommutant Clearing coefficient denominators in localized polynomial differential operators. -/ -@[expose] public section +public section namespace Stafford38.LocalizedDifferentialClearing diff --git a/LeanPool/Stafford38/Stafford38/LocalizedDifferentialCorollaries.lean b/LeanPool/Stafford38/Stafford38/LocalizedDifferentialCorollaries.lean index 12cef0e88e..133087b001 100644 --- a/LeanPool/Stafford38/Stafford38/LocalizedDifferentialCorollaries.lean +++ b/LeanPool/Stafford38/Stafford38/LocalizedDifferentialCorollaries.lean @@ -15,7 +15,7 @@ public import LeanPool.Stafford38.Stafford38.FoundationClosure Two-generator corollaries for localized polynomial differential-operator rings. -/ -@[expose] public section +public section namespace Stafford38.LocalizedDifferentialCorollaries diff --git a/LeanPool/Stafford38/Stafford38/LocalizedPolynomialCommutant.lean b/LeanPool/Stafford38/Stafford38/LocalizedPolynomialCommutant.lean index 1b89d245d9..ed4a618a68 100644 --- a/LeanPool/Stafford38/Stafford38/LocalizedPolynomialCommutant.lean +++ b/LeanPool/Stafford38/Stafford38/LocalizedPolynomialCommutant.lean @@ -11,7 +11,7 @@ public import LeanPool.Stafford38.AlgebraicAnalysis.DifferentialOperators.Locali /-! Compatibility export for the reusable localized polynomial commutant. -/ -@[expose] public section +public section namespace Stafford38.LocalizedPolynomialCommutant export AlgebraicAnalysis.DifferentialOperators.LocalizedPolynomialCommutant diff --git a/LeanPool/Stafford38/Stafford38/LocalizedPolynomialDerivations.lean b/LeanPool/Stafford38/Stafford38/LocalizedPolynomialDerivations.lean index 06c66ad2e0..1fd7f40c09 100644 --- a/LeanPool/Stafford38/Stafford38/LocalizedPolynomialDerivations.lean +++ b/LeanPool/Stafford38/Stafford38/LocalizedPolynomialDerivations.lean @@ -11,7 +11,7 @@ public import LeanPool.Stafford38.AlgebraicAnalysis.DifferentialOperators.Locali /-! Compatibility exports for reusable localized polynomial derivations. -/ -@[expose] public section +public section namespace Stafford38.LocalizedPolynomialDerivations export AlgebraicAnalysis.DifferentialOperators.LocalizedPolynomialDerivations diff --git a/LeanPool/Stafford38/Stafford38/LocalizedWeylAction.lean b/LeanPool/Stafford38/Stafford38/LocalizedWeylAction.lean index 6a1c94efe5..f9350f800d 100644 --- a/LeanPool/Stafford38/Stafford38/LocalizedWeylAction.lean +++ b/LeanPool/Stafford38/Stafford38/LocalizedWeylAction.lean @@ -20,7 +20,7 @@ operators of a localization of a polynomial ring. No identification of the resulting differential-operator algebra with another presentation is used. -/ -@[expose] public section +public section namespace Stafford38.LocalizedWeylAction @@ -48,10 +48,12 @@ abbrev D (B : Type u) [CommRing B] [Algebra k B] := algebra (k := k) (R := B) /-- The endomorphism given by multiplication by a localized coordinate. -/ +@[expose] def coordinateEnd (i : Fin n) : End (k := k) (R := B) := multiplication (algebraMap (A (k := k) (n := n)) B (MvPolynomial.X i)) /-- The localized partial derivative, regarded as a linear endomorphism. -/ +@[expose] def momentumEnd (i : Fin n) : End (k := k) (R := B) := (localizedPderiv S B i).toLinearMap @@ -75,6 +77,7 @@ theorem momentumEnd_mem_order_one (i : Fin n) : momentumEnd, mul_comm] /-- The coordinate multiplication and differentiation operators forming the Weyl generators. -/ +@[expose] def differentialGenerator : (Fin n ⊕ Fin n) → D (k := k) B | .inl i => ⟨coordinateEnd (B := B) i, 0, coordinateEnd_mem_order_zero (B := B) i⟩ diff --git a/LeanPool/Stafford38/Stafford38/Ore/CoordinateStage.lean b/LeanPool/Stafford38/Stafford38/Ore/CoordinateStage.lean index 895e1d546b..76189d73b7 100644 --- a/LeanPool/Stafford38/Stafford38/Ore/CoordinateStage.lean +++ b/LeanPool/Stafford38/Stafford38/Ore/CoordinateStage.lean @@ -17,7 +17,7 @@ identifies the first stage in the recursive Weyl construction with a central polynomial extension and transports ordinary differentiation to it. -/ -@[expose] public section +public section namespace Stafford38.OreCoordinateStage @@ -31,6 +31,7 @@ noncomputable section variable {B : Type*} [Ring B] /-- The zero derivation on a ring. -/ +@[expose] def zeroDerivation : OreDivisionDerivation B where toFun := 0 map_zero' := rfl diff --git a/LeanPool/Stafford38/Stafford38/Ore/IteratedPairStage.lean b/LeanPool/Stafford38/Stafford38/Ore/IteratedPairStage.lean index 58f03647f0..75a39baf02 100644 --- a/LeanPool/Stafford38/Stafford38/Ore/IteratedPairStage.lean +++ b/LeanPool/Stafford38/Stafford38/Ore/IteratedPairStage.lean @@ -18,7 +18,7 @@ canonical data introduced at each successor; it does not identify the tower with a presented Weyl algebra. -/ -@[expose] public section +public section namespace Stafford38.OreIteratedPairStage @@ -38,6 +38,7 @@ structure RingStage where variable (B : Type u) [Ring B] /-- The recursively constructed ring data after adjoining `n` Weyl pairs. -/ +@[expose] def iteratedPairData : Nat → RingStage | 0 => ⟨B, inferInstance⟩ | n + 1 => @@ -47,6 +48,7 @@ def iteratedPairData : Nat → RingStage /-- The ring obtained from `B` after recursively adjoining `n` checked coordinate-momentum pairs. -/ +@[expose] def IteratedPairStage (n : Nat) : Type u := (iteratedPairData B n).carrier @@ -63,15 +65,18 @@ theorem iteratedPairStage_succ (n : Nat) : PairStage (B := IteratedPairStage B n) := rfl /-- The canonical embedding from stage `n` into stage `n + 1`. -/ +@[expose] def stageEmbedding (n : Nat) : IteratedPairStage B n →+* IteratedPairStage B (n + 1) := pairCoefficient (B := IteratedPairStage B n) /-- The coordinate introduced at the successor of stage `n`. -/ +@[expose] def stageCoordinate (n : Nat) : IteratedPairStage B (n + 1) := pairCoordinate (B := IteratedPairStage B n) /-- The momentum introduced at the successor of stage `n`. -/ +@[expose] def stageMomentum (n : Nat) : IteratedPairStage B (n + 1) := pairMomentum (B := IteratedPairStage B n) diff --git a/LeanPool/Stafford38/Stafford38/Ore/LinearNormalForm.lean b/LeanPool/Stafford38/Stafford38/Ore/LinearNormalForm.lean index bb990b8a6a..2298617290 100644 --- a/LeanPool/Stafford38/Stafford38/Ore/LinearNormalForm.lean +++ b/LeanPool/Stafford38/Stafford38/Ore/LinearNormalForm.lean @@ -21,7 +21,7 @@ killed by the coefficient derivation. This is the scalar interface needed to turn the iterated Ore normal form into a PBW basis. -/ -@[expose] public section +public section namespace Stafford38.OreLinearNormalForm @@ -230,6 +230,7 @@ theorem normalForm_smul (c : k) (p : Polynomial B) : /-- Ore normal forms are linearly equivalent to ordinary coefficient-left polynomials. -/ +@[expose] def normalFormLinearEquiv : Polynomial B ≃ₗ[k] NormalOre D := { normalFormAddEquiv D with map_smul' := normalForm_smul D hAlg } diff --git a/LeanPool/Stafford38/Stafford38/Ore/PairStage.lean b/LeanPool/Stafford38/Stafford38/Ore/PairStage.lean index 2890374540..6b6a831508 100644 --- a/LeanPool/Stafford38/Stafford38/Ore/PairStage.lean +++ b/LeanPool/Stafford38/Stafford38/Ore/PairStage.lean @@ -20,7 +20,7 @@ derivation momentum. This file packages the resulting three canonical generator families and proves their exact relations. -/ -@[expose] public section +public section namespace Stafford38.OrePairStage @@ -46,14 +46,17 @@ abbrev outerDerivation : OreDivisionDerivation (CoordinateStage (B := B)) := coordinateDerivation /-- Embed the old coefficient ring through both Ore stages. -/ +@[expose] def pairCoefficient : B →+* PairStage (B := B) := (normalCoefficient outerDerivation).comp (normalCoefficient innerDerivation) /-- The newly adjoined coordinate. -/ +@[expose] def pairCoordinate : PairStage (B := B) := normalCoefficient outerDerivation (normalVariable innerDerivation) /-- The newly adjoined momentum. -/ +@[expose] def pairMomentum : PairStage (B := B) := normalVariable outerDerivation @@ -115,7 +118,7 @@ section Scalars variable {k : Type*} [CommRing k] [Algebra k B] /-- The scalar algebra structure on the central-coordinate stage. -/ -@[instance_reducible] +@[expose, instance_reducible] def coordinateStageAlgebra : Algebra k (CoordinateStage (B := B)) := Stafford38.OreScalarAlgebra.normalOreAlgebra innerDerivation fun c => by exact zeroDerivation_apply (algebraMap k B c) @@ -128,7 +131,7 @@ theorem coordinateDerivation_algebraMap (c : k) : exact coordinateDerivation_coefficient (algebraMap k B c) /-- The scalar algebra structure on the full coordinate-momentum pair. -/ -@[instance_reducible] +@[expose, instance_reducible] def pairStageAlgebra : Algebra k (PairStage (B := B)) := by letI : Algebra k (CoordinateStage (B := B)) := coordinateStageAlgebra exact Stafford38.OreScalarAlgebra.normalOreAlgebra outerDerivation diff --git a/LeanPool/Stafford38/Stafford38/Ore/PairUniversal.lean b/LeanPool/Stafford38/Stafford38/Ore/PairUniversal.lean index b067d47056..5de339dc20 100644 --- a/LeanPool/Stafford38/Stafford38/Ore/PairUniversal.lean +++ b/LeanPool/Stafford38/Stafford38/Ore/PairUniversal.lean @@ -19,7 +19,7 @@ central-coordinate stage. A momentum satisfying the derivation relation against that map then defines a map from `PairStage`. -/ -@[expose] public section +public section namespace Stafford38.OrePairUniversal diff --git a/LeanPool/Stafford38/Stafford38/Ore/ScalarAlgebra.lean b/LeanPool/Stafford38/Stafford38/Ore/ScalarAlgebra.lean index 253425ad31..11cf4a5e0f 100644 --- a/LeanPool/Stafford38/Stafford38/Ore/ScalarAlgebra.lean +++ b/LeanPool/Stafford38/Stafford38/Ore/ScalarAlgebra.lean @@ -17,7 +17,7 @@ If the coefficient ring is a `k`-algebra and the derivation kills `k`, then the canonical image of `k` is central in the normal-form Ore ring. -/ -@[expose] public section +public section namespace Stafford38.OreScalarAlgebra @@ -59,7 +59,7 @@ theorem normalScalar_commutes (D : OreDivisionDerivation B) exact (hsa.mul_right (hsx.pow_right n)).eq /-- The scalar algebra structure induced by the canonical coefficient map. -/ -@[instance_reducible] +@[expose, instance_reducible] def normalOreAlgebra (D : OreDivisionDerivation B) (hD : ∀ c : k, D (algebraMap k B c) = 0) : Algebra k (NormalOre D) := RingHom.toAlgebra' diff --git a/LeanPool/Stafford38/Stafford38/PaperInputs.lean b/LeanPool/Stafford38/Stafford38/PaperInputs.lean index e1e37e7e04..7e32ef3be2 100644 --- a/LeanPool/Stafford38/Stafford38/PaperInputs.lean +++ b/LeanPool/Stafford38/Stafford38/PaperInputs.lean @@ -27,7 +27,7 @@ typeclass. The assembly theorems here remain conditional when considered in isolation; their hypotheses are discharged by the unconditional development. -/ -@[expose] public section +public section namespace Stafford38.PaperInputs diff --git a/LeanPool/Stafford38/Stafford38/PolynomialDifferentialOperators.lean b/LeanPool/Stafford38/Stafford38/PolynomialDifferentialOperators.lean index c8659db05b..90c5a8694b 100644 --- a/LeanPool/Stafford38/Stafford38/PolynomialDifferentialOperators.lean +++ b/LeanPool/Stafford38/Stafford38/PolynomialDifferentialOperators.lean @@ -21,7 +21,7 @@ finite-order differential operators, so this construction does not assume an identification of that algebra with the Weyl algebra. -/ -@[expose] public section +public section namespace Stafford38.PolynomialDifferentialOperators diff --git a/LeanPool/Stafford38/Stafford38/PolynomialOperatorCommutators.lean b/LeanPool/Stafford38/Stafford38/PolynomialOperatorCommutators.lean index ed2bf84217..23b2c8c00f 100644 --- a/LeanPool/Stafford38/Stafford38/PolynomialOperatorCommutators.lean +++ b/LeanPool/Stafford38/Stafford38/PolynomialOperatorCommutators.lean @@ -11,7 +11,7 @@ public import LeanPool.Stafford38.Stafford38.PolynomialDifferentialOperators /-! Coordinate commutators on the intrinsic polynomial endomorphism ring. -/ -@[expose] public section +public section namespace Stafford38.PolynomialOperatorCommutators @@ -29,6 +29,7 @@ abbrev Operator := Module.End k (PolynomialRing k n) abbrev OperatorEnd := Module.End k (Operator k n) /-- The linear map sending an operator to its commutator with a coordinate multiplication. -/ +@[expose] def coordinateCommutator (i : Fin n) : OperatorEnd k n where toFun P := commutator P (MvPolynomial.X i) map_add' P Q := by @@ -57,6 +58,7 @@ theorem coordinateCommutator_comm (i j : Fin n) : abel /-- The composition of coordinate-commutator maps in the order specified by a list. -/ +@[expose] def iteratedCoordinateCommutator (l : List (Fin n)) : OperatorEnd k n := l.foldr (fun i T => coordinateCommutator k n i * T) 1 diff --git a/LeanPool/Stafford38/Stafford38/PolynomialOperatorTaylorProjection.lean b/LeanPool/Stafford38/Stafford38/PolynomialOperatorTaylorProjection.lean index e21f728617..36e2890efc 100644 --- a/LeanPool/Stafford38/Stafford38/PolynomialOperatorTaylorProjection.lean +++ b/LeanPool/Stafford38/Stafford38/PolynomialOperatorTaylorProjection.lean @@ -18,7 +18,7 @@ operator representation. Products are compositions and the powers of the partial derivative stay on the right. -/ -@[expose] public section +public section namespace Stafford38.PolynomialOperatorTaylorProjection diff --git a/LeanPool/Stafford38/Stafford38/Quotient/EulerSurjectivity.lean b/LeanPool/Stafford38/Stafford38/Quotient/EulerSurjectivity.lean index e226ebb201..2e73c9f03c 100644 --- a/LeanPool/Stafford38/Stafford38/Quotient/EulerSurjectivity.lean +++ b/LeanPool/Stafford38/Stafford38/Quotient/EulerSurjectivity.lean @@ -21,7 +21,7 @@ ideal is a submodule of the regular right module, encoded as an `Aᵐᵒᵖ`-submodule of `A`. -/ -@[expose] public section +public section namespace Stafford38.EulerSurjectivity diff --git a/LeanPool/Stafford38/Stafford38/Statement.lean b/LeanPool/Stafford38/Stafford38/Statement.lean index 04ecf495fd..3ed9489b66 100644 --- a/LeanPool/Stafford38/Stafford38/Statement.lean +++ b/LeanPool/Stafford38/Stafford38/Statement.lean @@ -18,7 +18,7 @@ must eventually prove. It intentionally declares no theorem with an unproved hypothesis and introduces no project axiom. -/ -@[expose] public section +public section namespace Stafford38 diff --git a/LeanPool/Stafford38/Stafford38/UniversalAssembly.lean b/LeanPool/Stafford38/Stafford38/UniversalAssembly.lean index b503d636bd..1e45a5c7f3 100644 --- a/LeanPool/Stafford38/Stafford38/UniversalAssembly.lean +++ b/LeanPool/Stafford38/Stafford38/UniversalAssembly.lean @@ -21,7 +21,7 @@ single remaining hypothesis is the concrete support-vanishing theorem for the literal canonical right ideal attached to a normalized PBW-monic operator. -/ -@[expose] public section +public section namespace Stafford38.UniversalAssembly diff --git a/LeanPool/Stafford38/Stafford38/Weyl/AssociatedGraded.lean b/LeanPool/Stafford38/Stafford38/Weyl/AssociatedGraded.lean index 5b396981e3..50d3e631f6 100644 --- a/LeanPool/Stafford38/Stafford38/Weyl/AssociatedGraded.lean +++ b/LeanPool/Stafford38/Stafford38/Weyl/AssociatedGraded.lean @@ -20,7 +20,7 @@ quotient is canonically linearly equivalent to its symbol component. The external graded multiplication is a downstream construction. -/ -@[expose] public section +public section namespace Stafford38.WeylAssociatedGraded diff --git a/LeanPool/Stafford38/Stafford38/Weyl/CommutatorSymbol.lean b/LeanPool/Stafford38/Stafford38/Weyl/CommutatorSymbol.lean index a099d9698b..f815c65bb8 100644 --- a/LeanPool/Stafford38/Stafford38/Weyl/CommutatorSymbol.lean +++ b/LeanPool/Stafford38/Stafford38/Weyl/CommutatorSymbol.lean @@ -18,7 +18,7 @@ commutator--Poisson correspondence. It uses the exact PBW block normal form; no characteristic-ideal, radical, or Gabber statement is assumed. -/ -@[expose] public section +public section namespace Stafford38.WeylCommutatorSymbol diff --git a/LeanPool/Stafford38/Stafford38/Weyl/CoordinateCommutatorSymbol.lean b/LeanPool/Stafford38/Stafford38/Weyl/CoordinateCommutatorSymbol.lean index 07d411f9d2..d7ae65b91f 100644 --- a/LeanPool/Stafford38/Stafford38/Weyl/CoordinateCommutatorSymbol.lean +++ b/LeanPool/Stafford38/Stafford38/Weyl/CoordinateCommutatorSymbol.lean @@ -17,7 +17,7 @@ presented Weyl elements. The proof packages both sides as linear maps and checks equality on the full PBW basis. -/ -@[expose] public section +public section namespace Stafford38.WeylCoordinateCommutatorSymbol diff --git a/LeanPool/Stafford38/Stafford38/Weyl/EulerRemainder.lean b/LeanPool/Stafford38/Stafford38/Weyl/EulerRemainder.lean index fae38b61f9..7340fd4656 100644 --- a/LeanPool/Stafford38/Stafford38/Weyl/EulerRemainder.lean +++ b/LeanPool/Stafford38/Stafford38/Weyl/EulerRemainder.lean @@ -20,7 +20,7 @@ right coordinate factor after multiplication by `x^N` on either side. The cofactors remain in the concrete Euler subring. -/ -@[expose] public section +public section namespace Stafford38.WeylEulerRemainder diff --git a/LeanPool/Stafford38/Stafford38/Weyl/EulerResidue.lean b/LeanPool/Stafford38/Stafford38/Weyl/EulerResidue.lean index a9c6417c25..03df052813 100644 --- a/LeanPool/Stafford38/Stafford38/Weyl/EulerResidue.lean +++ b/LeanPool/Stafford38/Stafford38/Weyl/EulerResidue.lean @@ -18,7 +18,7 @@ The remaining step for quotient surjectivity is to prove that the displayed error term has a right factor `x` lying in the Euler-nonnegative subring. -/ -@[expose] public section +public section namespace Stafford38.WeylEulerResidue diff --git a/LeanPool/Stafford38/Stafford38/Weyl/EulerSubring.lean b/LeanPool/Stafford38/Stafford38/Weyl/EulerSubring.lean index 04bee06bf8..5001aefb4a 100644 --- a/LeanPool/Stafford38/Stafford38/Weyl/EulerSubring.lean +++ b/LeanPool/Stafford38/Stafford38/Weyl/EulerSubring.lean @@ -19,7 +19,7 @@ commuting with a Weyl coordinate `x`, the subring generated by the coefficients, `x`, and `E = x*p` satisfies `x*R ⊆ R*x`. -/ -@[expose] public section +public section namespace Stafford38.WeylEulerSubring diff --git a/LeanPool/Stafford38/Stafford38/Weyl/FilteredCommutator.lean b/LeanPool/Stafford38/Stafford38/Weyl/FilteredCommutator.lean index 4aaf5cb903..99d16da48d 100644 --- a/LeanPool/Stafford38/Stafford38/Weyl/FilteredCommutator.lean +++ b/LeanPool/Stafford38/Stafford38/Weyl/FilteredCommutator.lean @@ -18,7 +18,7 @@ filtered elements; it includes the degree-zero case rather than hiding natural- number truncation behind a positivity hypothesis. -/ -@[expose] public section +public section namespace Stafford38.WeylFilteredCommutator diff --git a/LeanPool/Stafford38/Stafford38/Weyl/FilteredScalarLifting.lean b/LeanPool/Stafford38/Stafford38/Weyl/FilteredScalarLifting.lean index f130fe14d4..ed172e4b33 100644 --- a/LeanPool/Stafford38/Stafford38/Weyl/FilteredScalarLifting.lean +++ b/LeanPool/Stafford38/Stafford38/Weyl/FilteredScalarLifting.lean @@ -27,7 +27,7 @@ falsifier: an arbitrary high-degree representation need not be termwise bounded, even though a bounded representation exists. -/ -@[expose] public section +public section namespace Stafford38.Weyl.FilteredScalarLifting diff --git a/LeanPool/Stafford38/Stafford38/Weyl/Filtration.lean b/LeanPool/Stafford38/Stafford38/Weyl/Filtration.lean index 4b579a6ffb..5de205501a 100644 --- a/LeanPool/Stafford38/Stafford38/Weyl/Filtration.lean +++ b/LeanPool/Stafford38/Stafford38/Weyl/Filtration.lean @@ -20,7 +20,7 @@ Bernstein and order weights. Exact normal ordering then proves multiplicative closure. Leading symbols and the associated graded algebra remain downstream. -/ -@[expose] public section +public section namespace Stafford38.WeylFiltration diff --git a/LeanPool/Stafford38/Stafford38/Weyl/GradedAlgebra.lean b/LeanPool/Stafford38/Stafford38/Weyl/GradedAlgebra.lean index bae374cc5f..453ddc26e5 100644 --- a/LeanPool/Stafford38/Stafford38/Weyl/GradedAlgebra.lean +++ b/LeanPool/Stafford38/Stafford38/Weyl/GradedAlgebra.lean @@ -22,7 +22,7 @@ transported multiplication is proved to be the multiplication induced by Weyl products of filtered representatives. -/ -@[expose] public section +public section namespace Stafford38.WeylAssociatedGraded diff --git a/LeanPool/Stafford38/Stafford38/Weyl/IteratedEquivalence.lean b/LeanPool/Stafford38/Stafford38/Weyl/IteratedEquivalence.lean index a84ea99bd7..3c46bcb9e1 100644 --- a/LeanPool/Stafford38/Stafford38/Weyl/IteratedEquivalence.lean +++ b/LeanPool/Stafford38/Stafford38/Weyl/IteratedEquivalence.lean @@ -21,7 +21,7 @@ the two checked universal properties; it does not assume a PBW theorem for the quotient presentation. -/ -@[expose] public section +public section namespace Stafford38.WeylIteratedEquivalence @@ -40,7 +40,7 @@ variable (k : Type u) [Field k] /-- The scalar algebra structure inherited recursively by the iterated Ore tower. -/ -@[instance_reducible] +@[expose, instance_reducible] def iteratedPairStageAlgebra : (n : Nat) → Algebra k (IteratedPairStage k n) | 0 => by @@ -56,6 +56,7 @@ instance (n : Nat) : Algebra k (IteratedPairStage k n) := iteratedPairStageAlgebra k n /-- The canonical successor embedding as a scalar-preserving algebra map. -/ +@[expose] def stageAlgHom (n : Nat) : IteratedPairStage k n →ₐ[k] IteratedPairStage k (n + 1) where toRingHom := stageEmbedding k n @@ -68,6 +69,7 @@ def stageAlgHom (n : Nat) : rfl /-- Coordinates in the final stage, ordered from newest to oldest. -/ +@[expose] def iteratedCoordinate : (n : Nat) → Fin n → IteratedPairStage k n | 0, i => Fin.elim0 i @@ -76,6 +78,7 @@ def iteratedCoordinate : (fun j => stageAlgHom k n (iteratedCoordinate n j)) i /-- Momenta in the final stage, ordered from newest to oldest. -/ +@[expose] def iteratedMomentum : (n : Nat) → Fin n → IteratedPairStage k n | 0, i => Fin.elim0 i @@ -84,6 +87,7 @@ def iteratedMomentum : (fun j => stageAlgHom k n (iteratedMomentum n j)) i /-- The combined coordinate-momentum generator family. -/ +@[expose] def iteratedGenerator (n : Nat) : (Fin n ⊕ Fin n) → IteratedPairStage k n := Sum.elim (iteratedCoordinate k n) (iteratedMomentum k n) @@ -303,6 +307,7 @@ abbrev PresentedWeyl (n : Nat) := FreeWeyl k (Fin n ⊕ Fin n) (Matrix.J (Fin n) k) /-- Insert an old index after the newly adjoined coordinate or momentum. -/ +@[expose] def oldIndex {n : Nat} : (Fin n ⊕ Fin n) → (Fin (n + 1) ⊕ Fin (n + 1)) | .inl i => .inl i.succ @@ -643,6 +648,7 @@ theorem iteratedToPresented_comp_presentedToIterated (n : Nat) : /-- The quotient presentation is canonically equivalent to the recursive Ore construction, without using PBW independence for the quotient. -/ +@[expose] def presentedIteratedEquiv (n : Nat) : PresentedWeyl k n ≃ₐ[k] IteratedPairStage k n := AlgEquiv.ofAlgHom (presentedToIterated k n) (iteratedToPresented k n) diff --git a/LeanPool/Stafford38/Stafford38/Weyl/LeadingSymbol.lean b/LeanPool/Stafford38/Stafford38/Weyl/LeadingSymbol.lean index a4605863a7..2ab9488145 100644 --- a/LeanPool/Stafford38/Stafford38/Weyl/LeadingSymbol.lean +++ b/LeanPool/Stafford38/Stafford38/Weyl/LeadingSymbol.lean @@ -20,7 +20,7 @@ filtrations, the principal component of a product is the product of the principal components. No associated graded identification is assumed here. -/ -@[expose] public section +public section namespace Stafford38.WeylLeadingSymbol diff --git a/LeanPool/Stafford38/Stafford38/Weyl/MonicNormalization.lean b/LeanPool/Stafford38/Stafford38/Weyl/MonicNormalization.lean index d7a882d403..8b6aa7a50f 100644 --- a/LeanPool/Stafford38/Stafford38/Weyl/MonicNormalization.lean +++ b/LeanPool/Stafford38/Stafford38/Weyl/MonicNormalization.lean @@ -23,7 +23,7 @@ This file stops at the commutative-symbol monicity interface. Identifying it with a monic Ore polynomial in the selected momentum is the next dependency. -/ -@[expose] public section +public section namespace Stafford38.WeylMonicNormalization diff --git a/LeanPool/Stafford38/Stafford38/Weyl/OrderRees.lean b/LeanPool/Stafford38/Stafford38/Weyl/OrderRees.lean index 59f40eeada..4816bf9f96 100644 --- a/LeanPool/Stafford38/Stafford38/Weyl/OrderRees.lean +++ b/LeanPool/Stafford38/Stafford38/Weyl/OrderRees.lean @@ -19,7 +19,7 @@ degree-`N` coefficient lies in `F_N A`. No commutativity of `A`, Rees specialization, or Gabber theorem is assumed. -/ -@[expose] public section +public section namespace Stafford38.WeylOrderRees diff --git a/LeanPool/Stafford38/Stafford38/Weyl/OuterOreMonic.lean b/LeanPool/Stafford38/Stafford38/Weyl/OuterOreMonic.lean index 2a96237982..115db77510 100644 --- a/LeanPool/Stafford38/Stafford38/Weyl/OuterOreMonic.lean +++ b/LeanPool/Stafford38/Stafford38/Weyl/OuterOreMonic.lean @@ -20,7 +20,7 @@ polynomial, and turns the checked PBW coefficient-one bound into `Polynomial.Monic`. -/ -@[expose] public section +public section namespace Stafford38.WeylOuterOreMonic diff --git a/LeanPool/Stafford38/Stafford38/Weyl/PBW.lean b/LeanPool/Stafford38/Stafford38/Weyl/PBW.lean index 9dac8ca8df..07a46265e7 100644 --- a/LeanPool/Stafford38/Stafford38/Weyl/PBW.lean +++ b/LeanPool/Stafford38/Stafford38/Weyl/PBW.lean @@ -24,7 +24,7 @@ quotient presentation. Recursive all-degree formulas identify those basis vectors with ordered products of the named Weyl generators. -/ -@[expose] public section +public section namespace Stafford38.WeylPBW @@ -161,6 +161,7 @@ theorem flattenPairSymbols_monomial (n a p : ℕ) (r : SymbolRing k n) : /-- The finite exponent vector with coordinate exponents `a` and momentum exponents `p`. -/ +@[expose] def phaseExponent {n : ℕ} (a p : Fin n → ℕ) : PhaseVar n →₀ ℕ := Finsupp.equivFunOnFinite.symm (Sum.elim a p) diff --git a/LeanPool/Stafford38/Stafford38/Weyl/PBWFirstContraction.lean b/LeanPool/Stafford38/Stafford38/Weyl/PBWFirstContraction.lean index bd5482ded0..abc8237230 100644 --- a/LeanPool/Stafford38/Stafford38/Weyl/PBWFirstContraction.lean +++ b/LeanPool/Stafford38/Stafford38/Weyl/PBWFirstContraction.lean @@ -18,7 +18,7 @@ commutator argument so that the one-sided normal-ordering calculation is an independent input. -/ -@[expose] public section +public section namespace Stafford38.WeylPBWFirstContraction diff --git a/LeanPool/Stafford38/Stafford38/Weyl/PBWMonicBridge.lean b/LeanPool/Stafford38/Stafford38/Weyl/PBWMonicBridge.lean index ce17c9507d..b7ef1a7d1f 100644 --- a/LeanPool/Stafford38/Stafford38/Weyl/PBWMonicBridge.lean +++ b/LeanPool/Stafford38/Stafford38/Weyl/PBWMonicBridge.lean @@ -23,7 +23,7 @@ and exact normalized image. Converting this PBW statement to `Polynomial.Monic` for the outer Ore layer remains separate. -/ -@[expose] public section +public section namespace Stafford38.WeylPBWMonicBridge diff --git a/LeanPool/Stafford38/Stafford38/Weyl/PresentedScalarExtension.lean b/LeanPool/Stafford38/Stafford38/Weyl/PresentedScalarExtension.lean index a84bd3696d..40e4dc14fe 100644 --- a/LeanPool/Stafford38/Stafford38/Weyl/PresentedScalarExtension.lean +++ b/LeanPool/Stafford38/Stafford38/Weyl/PresentedScalarExtension.lean @@ -37,7 +37,7 @@ comparison is recorded as an explicit contract below and proved in definitional. -/ -@[expose] public section +public section namespace Stafford38.Weyl.PresentedScalarExtension diff --git a/LeanPool/Stafford38/Stafford38/Weyl/QuotientTransport.lean b/LeanPool/Stafford38/Stafford38/Weyl/QuotientTransport.lean index b69166495e..23097c6537 100644 --- a/LeanPool/Stafford38/Stafford38/Weyl/QuotientTransport.lean +++ b/LeanPool/Stafford38/Stafford38/Weyl/QuotientTransport.lean @@ -20,7 +20,7 @@ ideal and its right quotient across that equivalence. The final theorem is the presented-Weyl form of the already proved `PairStage` surjectivity. -/ -@[expose] public section +public section namespace Stafford38.WeylQuotientTransport diff --git a/LeanPool/Stafford38/Stafford38/Weyl/SymbolCompatibility.lean b/LeanPool/Stafford38/Stafford38/Weyl/SymbolCompatibility.lean index 5257341ad8..7547c19e7f 100644 --- a/LeanPool/Stafford38/Stafford38/Weyl/SymbolCompatibility.lean +++ b/LeanPool/Stafford38/Stafford38/Weyl/SymbolCompatibility.lean @@ -22,7 +22,7 @@ For a symplectic linear Weyl map, this induced substitution is exactly the phase-space linear action defined in `Characteristic.LinearAction`. -/ -@[expose] public section +public section namespace Stafford38.WeylSymbolCompatibility diff --git a/LeanPool/Stafford38/Stafford38/Weyl/Symplectic.lean b/LeanPool/Stafford38/Stafford38/Weyl/Symplectic.lean index e351fd06a8..b60ddcf735 100644 --- a/LeanPool/Stafford38/Stafford38/Weyl/Symplectic.lean +++ b/LeanPool/Stafford38/Stafford38/Weyl/Symplectic.lean @@ -20,7 +20,7 @@ of the input, which keeps this theorem independent of matrix inversion APIs and makes the exact direction of generator substitution explicit. -/ -@[expose] public section +public section namespace Stafford38.WeylSymplectic @@ -54,6 +54,7 @@ theorem standardSymplecticHpres {n : ℕ} (fun i j => freeWeylGenerator_commutator (standardForm k n) i j) hM /-- The presented Weyl algebra endomorphism induced by a standard symplectic matrix. -/ +@[expose] def standardSymplecticAlgHom {n : ℕ} (M : Matrix (Fin n ⊕ Fin n) (Fin n ⊕ Fin n) k) (hM : M * standardForm k n * Matrix.transpose M = standardForm k n) : diff --git a/LeanPool/Stafford38/Stafford38/Weyl/Transposition.lean b/LeanPool/Stafford38/Stafford38/Weyl/Transposition.lean index 4b1c16ca34..a36850d62c 100644 --- a/LeanPool/Stafford38/Stafford38/Weyl/Transposition.lean +++ b/LeanPool/Stafford38/Stafford38/Weyl/Transposition.lean @@ -20,7 +20,7 @@ change sign. The construction uses only the checked universal property of the quotient presentation. -/ -@[expose] public section +public section namespace Stafford38.WeylTransposition @@ -171,6 +171,7 @@ theorem transpositionHom_comp_opComm_transpositionHom (n : Nat) : /-- Transposition is a scalar-preserving equivalence with the opposite Weyl algebra. -/ +@[expose] def transpositionEquiv (n : Nat) : PresentedWeyl k n ≃ₐ[k] (PresentedWeyl k n)ᵐᵒᵖ := AlgEquiv.ofAlgHom (transpositionHom k n) (AlgHom.opComm (transpositionHom k n)) @@ -234,7 +235,7 @@ theorem transpose_injective (n : Nat) : Function.Injective (transpose k n) := by /-- A right `PresentedWeyl`-module becomes a left module by restriction of scalars along transposition. -/ -@[instance_reducible] +@[expose, instance_reducible] def transposedLeftModule (n : Nat) (M : Type v) [AddCommMonoid M] [Module (PresentedWeyl k n)ᵐᵒᵖ M] : Module (PresentedWeyl k n) M := Module.compHom M (transpositionEquiv k n).toRingEquiv.toRingHom diff --git a/LeanPool/Stafford38/Stafford38/Weyl/TranspositionFiltration.lean b/LeanPool/Stafford38/Stafford38/Weyl/TranspositionFiltration.lean index 843d65001e..f89119c613 100644 --- a/LeanPool/Stafford38/Stafford38/Weyl/TranspositionFiltration.lean +++ b/LeanPool/Stafford38/Stafford38/Weyl/TranspositionFiltration.lean @@ -20,7 +20,7 @@ preserves both differential order and Bernstein degree. No filtered `D`-module or characteristic-variety theorem is used here. -/ -@[expose] public section +public section namespace Stafford38.WeylTranspositionFiltration diff --git a/LeanPool/Stafford38/Stafford38/Weyl/Universal.lean b/LeanPool/Stafford38/Stafford38/Weyl/Universal.lean index 8886c25897..4d4aa54cb3 100644 --- a/LeanPool/Stafford38/Stafford38/Weyl/Universal.lean +++ b/LeanPool/Stafford38/Stafford38/Weyl/Universal.lean @@ -18,7 +18,7 @@ This factors the quotient lift used by the existing symplectic maps: any family satisfying the prescribed commutators induces a unique algebra map. -/ -@[expose] public section +public section namespace Stafford38.WeylUniversal 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 31eadf9364..75ace18d62 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 79d7e3cd9d..436cd01ede 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 @@ -132,10 +132,10 @@ theorem rowLabel_sum_lt_base _ < rowBase l := Nat.lt_succ_self _ /-- 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 757c5dd7d5..ff4c985717 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/TuttePath/Chain.lean b/LeanPool/TuttePath/Chain.lean index 3c4b82424e..7b078e074f 100644 --- a/LeanPool/TuttePath/Chain.lean +++ b/LeanPool/TuttePath/Chain.lean @@ -11,7 +11,7 @@ public import LeanPool.TuttePath.IndecomposableStep /-! The rank-selection consequence of `cor:indecomposable-chain`, obtained by literally repeating the downward step. This is the chain interface needed below. -/ -@[expose] public section +public section namespace TutteFormalization variable {α : Type*} {M : Matroid α} [M.Finite] {S T : Set α} diff --git a/LeanPool/TuttePath/ConnectedPartitions.lean b/LeanPool/TuttePath/ConnectedPartitions.lean index 12311e3274..500ddd64bc 100644 --- a/LeanPool/TuttePath/ConnectedPartitions.lean +++ b/LeanPool/TuttePath/ConnectedPartitions.lean @@ -12,7 +12,7 @@ public import LeanPool.TuttePath.ContractionFlats /-! Connectivity background in additive-partition form. This verifies the needed conclusions without claiming to audit the source's cocircuit proof. -/ -@[expose] public section +public section namespace TutteFormalization open scoped Matroid diff --git a/LeanPool/TuttePath/ContractionFlats.lean b/LeanPool/TuttePath/ContractionFlats.lean index 817857b7a1..f4109f7c6f 100644 --- a/LeanPool/TuttePath/ContractionFlats.lean +++ b/LeanPool/TuttePath/ContractionFlats.lean @@ -14,7 +14,7 @@ BG-01 interval transport of flats and hyperplanes across contraction by a flat. These statements implement the background correspondence used in lem:separation. -/ -@[expose] public section +public section namespace TutteFormalization diff --git a/LeanPool/TuttePath/ContractionRank.lean b/LeanPool/TuttePath/ContractionRank.lean index 338a1e30f0..3252135c67 100644 --- a/LeanPool/TuttePath/ContractionRank.lean +++ b/LeanPool/TuttePath/ContractionRank.lean @@ -15,7 +15,7 @@ dual deletion; its dual and restriction rank formulas therefore suffice to derive the paper's contraction rank formula without adding an assumption. -/ -@[expose] public section +public section namespace TutteFormalization diff --git a/LeanPool/TuttePath/Definitions.lean b/LeanPool/TuttePath/Definitions.lean index 4b45b5be53..924e8412c7 100644 --- a/LeanPool/TuttePath/Definitions.lean +++ b/LeanPool/TuttePath/Definitions.lean @@ -17,7 +17,7 @@ setting all ranks here are finite, so their equations are natural-rank equations The pinned matroid API has no connectedness, hyperplane or modular-cut predicate. -/ -@[expose] public section +public section namespace TutteFormalization @@ -25,22 +25,22 @@ variable {α : Type*} /-- `def:matroid-operations`: no partition into two nonempty additive-rank parts. In particular, no nonemptiness of the ground set is required. -/ -def Connected (M : Matroid α) : Prop := +@[expose] def Connected (M : Matroid α) : Prop := ¬ ∃ A B : Set α, A.Nonempty ∧ B.Nonempty ∧ Disjoint A B ∧ A ∪ B = M.E ∧ M.eRk A + M.eRk B = M.eRk M.E /-- `def:matroid`: a maximal proper flat. Ground containment follows from `IsFlat`. -/ -def IsHyperplane (M : Matroid α) (H : Set α) : Prop := +@[expose] def IsHyperplane (M : Matroid α) (H : Set α) : Prop := M.IsFlat H ∧ H ≠ M.E ∧ ∀ G : Set α, M.IsFlat G → H ⊆ G → G = H ∨ G = M.E /-- `def:indecomposable`: flatness and source connectedness of the contraction. -/ -def Indecomposable (M : Matroid α) (F : Set α) : Prop := +@[expose] def Indecomposable (M : Matroid α) (F : Set α) : Prop := M.IsFlat F ∧ Connected (M.contract F) /-- `def:modular-cut`: a pair of flats satisfying the modular rank equality. Their join is the Mathlib closure of their union. -/ -def ModularPair (M : Matroid α) (F G : Set α) : Prop := +@[expose] def ModularPair (M : Matroid α) (F G : Set α) : Prop := M.IsFlat F ∧ M.IsFlat G ∧ M.eRk F + M.eRk G = M.eRk (F ∩ G) + M.eRk (M.closure (F ∪ G)) @@ -53,12 +53,12 @@ structure ModularCut (M : Matroid α) (Γ : Set (Set α)) : Prop where /-- A corank-two flat: for finite ground set, this rank equation says `rk(M.E) - rk(F) = 2`, without truncated subtraction or conversion from `ℕ∞`. -/ -def CorankTwo (M : Matroid α) (F : Set α) : Prop := +@[expose] def CorankTwo (M : Matroid α) (F : Set α) : Prop := M.IsFlat F ∧ M.eRk F + 2 = M.eRk M.E /-- `def:tutte-path`: the condition on two consecutive vertices. Hyperplane conditions are imposed on every vertex by `TuttePath`. -/ -def TutteAdjacent (M : Matroid α) (H K : Set α) : Prop := +@[expose] def TutteAdjacent (M : Matroid α) (H K : Set α) : Prop := H ≠ K ∧ Indecomposable M (H ∩ K) ∧ CorankTwo M (H ∩ K) /-- `def:tutte-path`: `length` counts edges, and there are `length + 1` vertices. @@ -77,16 +77,16 @@ namespace TuttePath variable {M : Matroid α} /-- The first vertex. -/ -def origin (p : TuttePath M) : Set α := p.vertex 0 +@[expose] def origin (p : TuttePath M) : Set α := p.vertex 0 /-- The last vertex. -/ -def terminus (p : TuttePath M) : Set α := p.vertex (Fin.last p.length) +@[expose] def terminus (p : TuttePath M) : Set α := p.vertex (Fin.last p.length) /-- Every vertex contains `F`; this does not assert that `F` is the carrier. -/ -def On (p : TuttePath M) (F : Set α) : Prop := ∀ i, F ⊆ p.vertex i +@[expose] def On (p : TuttePath M) (F : Set α) : Prop := ∀ i, F ⊆ p.vertex i /-- Every vertex lies outside the cut. -/ -def Off (p : TuttePath M) (Γ : Set (Set α)) : Prop := ∀ i, p.vertex i ∉ Γ +@[expose] def Off (p : TuttePath M) (Γ : Set (Set α)) : Prop := ∀ i, p.vertex i ∉ Γ /-- The carrier from `def:tutte-path`. The index type is always nonempty. -/ def carrier (p : TuttePath M) : Set α := ⋂ i, p.vertex i diff --git a/LeanPool/TuttePath/Diamond.lean b/LeanPool/TuttePath/Diamond.lean index c9707f3318..57e5a35e6a 100644 --- a/LeanPool/TuttePath/Diamond.lean +++ b/LeanPool/TuttePath/Diamond.lean @@ -10,7 +10,7 @@ public import LeanPool.TuttePath.DiamondRanks -- Modified for Lean Pool: module integration, public visibility, and import paths. /-! The source `prop:indecomposable-diamond` construction. -/ -@[expose] public section +public section namespace TutteFormalization variable {α : Type*} {M : Matroid α} [M.Finite] {S T : Set α} diff --git a/LeanPool/TuttePath/DiamondRanks.lean b/LeanPool/TuttePath/DiamondRanks.lean index b6321a7cb0..b5a8dc2d7c 100644 --- a/LeanPool/TuttePath/DiamondRanks.lean +++ b/LeanPool/TuttePath/DiamondRanks.lean @@ -11,7 +11,7 @@ public import LeanPool.TuttePath.PathRanks -- Modified for Lean Pool: module integration, public visibility, and import paths. /-! Explicit rank calculations used in the source Diamond construction. -/ -@[expose] public section +public section namespace TutteFormalization open scoped Matroid diff --git a/LeanPool/TuttePath/FlatRank.lean b/LeanPool/TuttePath/FlatRank.lean index da4483ebc7..e0f99a173d 100644 --- a/LeanPool/TuttePath/FlatRank.lean +++ b/LeanPool/TuttePath/FlatRank.lean @@ -17,7 +17,7 @@ Natural ranks are an internal arithmetic interface to finite `eRk`. The structural lemmas do not depend on the path theorem. -/ -@[expose] public section +public section namespace TutteFormalization @@ -28,7 +28,7 @@ theorem contraction_finite (M : Matroid α) [M.Finite] (F : Set α) : (M.contract F).Finite := inferInstance /-- Engineering interface; only used with a finite-ground-set matroid below. -/ -noncomputable def natRank (M : Matroid α) (F : Set α) : ℕ := (M.eRk F).toNat +@[expose] noncomputable def natRank (M : Matroid α) (F : Set α) : ℕ := (M.eRk F).toNat theorem cast_natRank (M : Matroid α) [M.Finite] (F : Set α) : (natRank M F : ℕ∞) = M.eRk F := diff --git a/LeanPool/TuttePath/HyperplaneTools.lean b/LeanPool/TuttePath/HyperplaneTools.lean index b7fcfd4e0d..24d08646b2 100644 --- a/LeanPool/TuttePath/HyperplaneTools.lean +++ b/LeanPool/TuttePath/HyperplaneTools.lean @@ -14,7 +14,7 @@ BG-01 hyperplane separation follows the source's basis construction. ST-02's modular-cut rule is then proved using the exact rank equality. -/ -@[expose] public section +public section namespace TutteFormalization diff --git a/LeanPool/TuttePath/IndecomposableComplement.lean b/LeanPool/TuttePath/IndecomposableComplement.lean index 9199bf5fb0..996f16c7b8 100644 --- a/LeanPool/TuttePath/IndecomposableComplement.lean +++ b/LeanPool/TuttePath/IndecomposableComplement.lean @@ -10,7 +10,7 @@ public import LeanPool.TuttePath.Diamond -- Modified for Lean Pool: module integration, public visibility, and import paths. /-! `prop:indecomposable-complement`: minimal-rank crossing cover and corank induction. -/ -@[expose] public section +public section namespace TutteFormalization variable {α : Type*} {M : Matroid α} [M.Finite] {S T U : Set α} diff --git a/LeanPool/TuttePath/IndecomposableStep.lean b/LeanPool/TuttePath/IndecomposableStep.lean index 54d8d6e435..b744dd84b0 100644 --- a/LeanPool/TuttePath/IndecomposableStep.lean +++ b/LeanPool/TuttePath/IndecomposableStep.lean @@ -12,7 +12,7 @@ public import Mathlib.Data.Set.Finite.Lemmas -- Modified for Lean Pool: module integration, public visibility, and import paths. /-! `prop:indecomposable-step`: the source maximal-intersection construction. -/ -@[expose] public section +public section namespace TutteFormalization variable {α : Type*} {M : Matroid α} [M.Finite] {S T : Set α} diff --git a/LeanPool/TuttePath/PathInduction.lean b/LeanPool/TuttePath/PathInduction.lean index 9b2077ac7e..dce993ae50 100644 --- a/LeanPool/TuttePath/PathInduction.lean +++ b/LeanPool/TuttePath/PathInduction.lean @@ -12,7 +12,7 @@ public import LeanPool.TuttePath.PathOperations /-! The corank induction of `thm:path-theorem`. This file does not import the public target, so none of its dependencies can rely on that target. -/ -@[expose] public section +public section namespace TutteFormalization diff --git a/LeanPool/TuttePath/PathOperations.lean b/LeanPool/TuttePath/PathOperations.lean index 1f4d602695..ce97d6f40d 100644 --- a/LeanPool/TuttePath/PathOperations.lean +++ b/LeanPool/TuttePath/PathOperations.lean @@ -16,7 +16,7 @@ The protected finite-sequence representation is unchanged. Appending one vertex is enough for the source proof; no injectivity of the sequence is imposed. -/ -@[expose] public section +public section namespace TutteFormalization @@ -25,7 +25,7 @@ variable {α : Type*} {M : Matroid α} namespace TuttePath /-- PT-01: a one-vertex path has no edge conditions. -/ -def singleton (H : Set α) (hH : IsHyperplane M H) : TuttePath M where +@[expose] def singleton (H : Set α) (hH : IsHyperplane M H) : TuttePath M where length := 0 vertex := fun _ => H isHyperplane := fun _ => hH diff --git a/LeanPool/TuttePath/PathRanks.lean b/LeanPool/TuttePath/PathRanks.lean index 73a2bebf31..9869acc90a 100644 --- a/LeanPool/TuttePath/PathRanks.lean +++ b/LeanPool/TuttePath/PathRanks.lean @@ -15,7 +15,7 @@ All contextual hypotheses are explicit. No structural existence theorem is assumed globally, and none of these results depends on the path theorem. -/ -@[expose] public section +public section namespace TutteFormalization diff --git a/LeanPool/TuttePath/PathTheorem.lean b/LeanPool/TuttePath/PathTheorem.lean index 61410e2adc..c48ae348ef 100644 --- a/LeanPool/TuttePath/PathTheorem.lean +++ b/LeanPool/TuttePath/PathTheorem.lean @@ -18,7 +18,7 @@ Definitions appear in `LeanPool.TuttePath.Definitions`. Structural dependencies are proved in the imported project modules. -/ -@[expose] public section +public section namespace TutteFormalization diff --git a/LeanPool/TuttePath/RelativeComplement.lean b/LeanPool/TuttePath/RelativeComplement.lean index 04f67044a2..1abc9d93a0 100644 --- a/LeanPool/TuttePath/RelativeComplement.lean +++ b/LeanPool/TuttePath/RelativeComplement.lean @@ -15,7 +15,7 @@ The recursion is the paper's simultaneous adjoining of an element to S and T; it terminates because the corank of S decreases strictly at each step. -/ -@[expose] public section +public section namespace TutteFormalization diff --git a/LeanPool/TuttePath/Separation.lean b/LeanPool/TuttePath/Separation.lean index 1ab5571c8b..d8473c6d4d 100644 --- a/LeanPool/TuttePath/Separation.lean +++ b/LeanPool/TuttePath/Separation.lean @@ -11,7 +11,7 @@ public import LeanPool.TuttePath.ConnectedPartitions /-! `lem:separation` in its literal set-theoretic form. Direct-sum background is expanded using rank partitions; the source cocircuit criterion is not audited. -/ -@[expose] public section +public section namespace TutteFormalization open scoped Matroid diff --git a/LeanPool/TuttePath/SeparationRank.lean b/LeanPool/TuttePath/SeparationRank.lean index 0a1c0ec4a1..aa2b092ec0 100644 --- a/LeanPool/TuttePath/SeparationRank.lean +++ b/LeanPool/TuttePath/SeparationRank.lean @@ -15,7 +15,7 @@ background used in `lem:separation`. These lemmas use the actual partition and rank equations rather than assuming a decomposition theorem. -/ -@[expose] public section +public section namespace TutteFormalization 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 78d560db4a..6423e1d81d 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..fcaee70e8d 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 @@ -121,26 +121,26 @@ instance : Module 𝕜 (ModuleOfModuleAlgebra 𝕜 A V) := moduleScalarOfModule 𝕜 A V /-- The map from `V` to its type synonym `ModuleOfModuleAlgebra 𝕜 A V`. -/ -def _root_.ModuleOfModuleAlgebra.mk (v : V) : +@[expose] def _root_.ModuleOfModuleAlgebra.mk (v : V) : ModuleOfModuleAlgebra 𝕜 A V := v /-- The map from `V` to its type synonym `ModuleOfModuleAlgebra 𝕜 A V` as a homomorphism of additive groups. -/ -def _root_.ModuleOfModuleAlgebra.mkAddHom : +@[expose] def _root_.ModuleOfModuleAlgebra.mkAddHom : V →+ ModuleOfModuleAlgebra 𝕜 A V where toFun := ModuleOfModuleAlgebra.mk 𝕜 A V map_zero' := rfl map_add' _ _ := rfl /-- The map from the type synonym `ModuleOfModuleAlgebra 𝕜 A V` back to `V`. -/ -def _root_.ModuleOfModuleAlgebra.unMk (v : ModuleOfModuleAlgebra 𝕜 A V) : +@[expose] def _root_.ModuleOfModuleAlgebra.unMk (v : ModuleOfModuleAlgebra 𝕜 A V) : V := v /-- The map from the type synonym `ModuleOfModuleAlgebra 𝕜 A V` back to `V` as a homomorphism of additive groups. -/ -def _root_.ModuleOfModuleAlgebra.unMkAddHom (𝕜 A V : Type*) [CommRing 𝕜] +@[expose] def _root_.ModuleOfModuleAlgebra.unMkAddHom (𝕜 A V : Type*) [CommRing 𝕜] [Semiring A] [Algebra 𝕜 A] [AddCommGroup V] [Module A V] : ModuleOfModuleAlgebra 𝕜 A V →+ V where toFun := ModuleOfModuleAlgebra.unMk 𝕜 A V @@ -159,7 +159,7 @@ variable (V : Type*) [AddCommGroup V] [Module A V] /-- An element `a ∈ A` of a `𝕜`-algebra `A` defines a `𝕜`-linear map `V → V` by left multiplication. -/ -def ModuleOfModuleAlgebra.lsmul (a : A) : +@[expose] def ModuleOfModuleAlgebra.lsmul (a : A) : ModuleOfModuleAlgebra 𝕜 A V →ₗ[𝕜] ModuleOfModuleAlgebra 𝕜 A V where toFun v := ModuleOfModuleAlgebra.mkAddHom 𝕜 A V (a • ModuleOfModuleAlgebra.unMkAddHom 𝕜 A V v) @@ -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] @@ -359,7 +359,7 @@ variable (ρ : LieAlgebra.Representation 𝕜 𝕂 𝓰 V) /-- A representation of a `𝕜`-Lie algebra `𝓰` on a vector space `V` defines a `𝓤 𝕜 𝓰`-module structure on `V`. -/ -@[reducible] noncomputable def LieAlgebra.Representation.moduleUniversalEnvelopingAlgebra : +@[expose, reducible] noncomputable def LieAlgebra.Representation.moduleUniversalEnvelopingAlgebra : Module (𝓤 𝕜 𝓰) V where smul a v := UniversalEnvelopingAlgebra.lift 𝕜 ρ a v one_smul v := by @@ -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..b5bb67d008 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) @@ -747,7 +747,7 @@ variable {heiOper} in On a vector space with a representation of the Heisenberg algebra that acts locally truncatedly, we get a representation of the Virasoro algebra with central charge 1 by the Sugawara construction. -/ -noncomputable def _root_.VirasoroProject.sugawaraRepresentation [CharZero 𝕜] : +@[expose] noncomputable def _root_.VirasoroProject.sugawaraRepresentation [CharZero 𝕜] : VirasoroAlgebra 𝕜 →ₗ⁅𝕜⁆ (V →ₗ[𝕜] V) := by apply VirasoroAlgebra.representationOfCentralChargeOfL 1 (lOper := sugawaraGen heiTrunc) intro n 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..902fff0619 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 @@ -51,6 +51,7 @@ variable (𝕜 : Type*) [Field 𝕜] /-- A bilinear map version of the Virasoro cocycle. (Defining formula: `γ (lgen n) (lgen m) = (n^3 - n) / 12 * δ[n+m,0]`.) -/ +@[expose] noncomputable def virasoroCocycleBilin : (WittAlgebra 𝕜) →ₗ[𝕜] (WittAlgebra 𝕜) →ₗ[𝕜] 𝕜 := (lgen 𝕜).constr 𝕜 <| fun n ↦ (lgen 𝕜).constr 𝕜 <| fun m ↦ if n + m = 0 then (n^3 - n) / 12 else 0 @@ -99,7 +100,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/Vizing/Basic.lean b/LeanPool/Vizing/Basic.lean index 51e6c5a72f..f5d6f83c6c 100644 --- a/LeanPool/Vizing/Basic.lean +++ b/LeanPool/Vizing/Basic.lean @@ -16,7 +16,7 @@ public import Mathlib.Tactic.Tauto Basic definitions and extension operations for the fan-and-Kempe proof of Vizing's theorem. -/ -@[expose] public section +public section section /-! @@ -46,9 +46,11 @@ namespace PEC variable {G : SimpleGraph V} /-- A colour is free at a vertex if no edge at that vertex carries it. -/ +@[expose] def IsFree (c : PEC G C) (v : V) (γ : C) : Prop := ∀ u, c.col v u ≠ some γ /-- `c'` colours at least the edges that `c` colours. -/ +@[expose] def Extends (c c' : PEC G C) : Prop := ∀ u v, c.col u v ≠ none → c'.col u v ≠ none omit [DecidableEq V] in @@ -101,6 +103,7 @@ lemma updFun_of_ne {f : V → V → Option C} {x y u v : V} (o : Option C) updFun f x y o y x = o := ite_eq_left (Or.inr ⟨rfl, rfl⟩) /-- Colour the (possibly already coloured) edge `x y` with a colour free at both endpoints. -/ +@[expose] def setEdge (c : PEC G C) {x y : V} (γ : C) (hadj : G.Adj x y) (hx : c.IsFree x γ) (hy : c.IsFree y γ) : PEC G C where col := updFun c.col x y (some γ) diff --git a/LeanPool/Vizing/ColourClasses.lean b/LeanPool/Vizing/ColourClasses.lean index 13d11e9575..d96805078f 100644 --- a/LeanPool/Vizing/ColourClasses.lean +++ b/LeanPool/Vizing/ColourClasses.lean @@ -15,13 +15,14 @@ Colour classes partition a finite set. For graph edges, properness means that two distinct edges of the same colour have disjoint endpoints. -/ -@[expose] public section +public section namespace LeanPool.Vizing.ColourClasses variable {α β : Type*} [DecidableEq β] /-- The elements of `S` assigned the literal colour `b`. -/ +@[expose] def colourClass (S : Finset α) (colour : α → β) (b : β) : Finset α := S.filter fun a => colour a = b @@ -67,6 +68,7 @@ theorem card_eq_sum_card_colourClass (S : Finset α) (colour : α → β) : variable {V : Type*} [DecidableEq V] /-- Two distinct edges assigned the same colour have no common endpoint. -/ +@[expose] def ProperOn (E : Finset (Sym2 V)) (colour : Sym2 V → β) : Prop := ∀ e ∈ E, ∀ f ∈ E, e ≠ f → colour e = colour f → Disjoint e.toFinset f.toFinset diff --git a/LeanPool/Vizing/Corollaries.lean b/LeanPool/Vizing/Corollaries.lean index 8c80208e5c..7f07a332d0 100644 --- a/LeanPool/Vizing/Corollaries.lean +++ b/LeanPool/Vizing/Corollaries.lean @@ -15,7 +15,7 @@ of at least `maxDegree + 1` colours. Unused colours are included in the balancing, and every class has at most the ceiling of the average size. -/ -@[expose] public section +public section namespace LeanPool.Vizing diff --git a/LeanPool/Vizing/Endpoints.lean b/LeanPool/Vizing/Endpoints.lean index d806dfbd60..957efc634b 100644 --- a/LeanPool/Vizing/Endpoints.lean +++ b/LeanPool/Vizing/Endpoints.lean @@ -16,7 +16,7 @@ at most two vertices of degree at most `1`. This is the combinatorial input to step of Vizing's theorem. -/ -@[expose] public section +public section open SimpleGraph Finset diff --git a/LeanPool/Vizing/Equitable.lean b/LeanPool/Vizing/Equitable.lean index 3fedd070cf..b2d5e9869a 100644 --- a/LeanPool/Vizing/Equitable.lean +++ b/LeanPool/Vizing/Equitable.lean @@ -18,7 +18,7 @@ preserves properness and decreases the square-energy. Finite descent therefore produces an equitable colouring on the original palette. -/ -@[expose] public section +public section namespace LeanPool.Vizing.Equitable diff --git a/LeanPool/Vizing/EquitableDefinitions.lean b/LeanPool/Vizing/EquitableDefinitions.lean index be2a534e4c..ee2d6d4d9b 100644 --- a/LeanPool/Vizing/EquitableDefinitions.lean +++ b/LeanPool/Vizing/EquitableDefinitions.lean @@ -19,7 +19,7 @@ the termination argument for Kempe recolouring. An equitable colouring also has every class bounded by the ceiling of the average size. -/ -@[expose] public section +public section namespace LeanPool.Vizing.EquitableDefinitions @@ -29,11 +29,13 @@ variable {V Color : Type*} [DecidableEq V] [Fintype Color] [DecidableEq Color] /-- All literal colour classes differ in cardinality by at most one. -/ +@[expose] def IsEquitable (E : Finset (Sym2 V)) (colour : Sym2 V → Color) : Prop := ∀ a b : Color, (colourClass E colour a).card ≤ (colourClass E colour b).card + 1 /-- The square-energy used by alternating-component descent. -/ +@[expose] def energy (E : Finset (Sym2 V)) (colour : Sym2 V → Color) : ℕ := ∑ a : Color, (colourClass E colour a).card ^ 2 diff --git a/LeanPool/Vizing/Fan.lean b/LeanPool/Vizing/Fan.lean index 9bfa0d3d8f..5bf7e5acfc 100644 --- a/LeanPool/Vizing/Fan.lean +++ b/LeanPool/Vizing/Fan.lean @@ -16,7 +16,7 @@ neighbours `f 0 = y, f 1, …, f n` of `x` such that the colour of `x (f (i+1))` the edge `x y`. -/ -@[expose] public section +public section open SimpleGraph Finset diff --git a/LeanPool/Vizing/Kempe.lean b/LeanPool/Vizing/Kempe.lean index 78ea3c62f3..844cbd8679 100644 --- a/LeanPool/Vizing/Kempe.lean +++ b/LeanPool/Vizing/Kempe.lean @@ -15,7 +15,7 @@ the edges coloured `a` or `b`. Swapping the two colours on the connected compon `x` produces another partial proper edge colouring, colouring exactly the same edges. -/ -@[expose] public section +public section open SimpleGraph Finset @@ -96,6 +96,7 @@ lemma kempeSwapFun_isSome (c : PEC G C) (a b : C) (x u v : V) : · rw [kempeSwapFun_of_not_reachable c a b hu v] /-- Swapping the colours `a` and `b` on the Kempe component of `x`. -/ +@[expose] noncomputable def kempeSwap (c : PEC G C) (a b : C) (x : V) : PEC G C where col := c.kempeSwapFun a b x col_symm := by diff --git a/LeanPool/Vizing/LineGraphColouring.lean b/LeanPool/Vizing/LineGraphColouring.lean index d789f77aa5..7df514e971 100644 --- a/LeanPool/Vizing/LineGraphColouring.lean +++ b/LeanPool/Vizing/LineGraphColouring.lean @@ -16,7 +16,7 @@ Any colouring of the line graph induces a proper colour assignment on equitable recolouring on a fixed finite palette. -/ -@[expose] public section +public section namespace LeanPool.Vizing.LineGraphColouring diff --git a/LeanPool/Vizing/Main.lean b/LeanPool/Vizing/Main.lean index cac092c880..36ba580ad0 100644 --- a/LeanPool/Vizing/Main.lean +++ b/LeanPool/Vizing/Main.lean @@ -16,7 +16,7 @@ Iterating the extension step colours all edges, giving a proper edge colouring w `Δ + 1` colours; equivalently, the line graph is `(Δ + 1)`-colourable. -/ -@[expose] public section +public section open SimpleGraph Finset @@ -86,6 +86,7 @@ theorem exists_total [DecidableRel G.Adj] (hcard : G.maxDegree < Fintype.card C) /-! ### From total colourings to colourings of the line graph -/ /-- The optional colour on an unordered pair. -/ +@[expose] def edgeOption (c : PEC G C) (e : Sym2 V) : Option C := Sym2.lift ⟨c.col, c.col_symm⟩ e diff --git a/LeanPool/Vizing/Step.lean b/LeanPool/Vizing/Step.lean index 6923eac5e7..ab14ff7611 100644 --- a/LeanPool/Vizing/Step.lean +++ b/LeanPool/Vizing/Step.lean @@ -15,7 +15,7 @@ recolour so that `x y` becomes coloured and no edge loses its colour. This is t Vizing's theorem: a maximal fan at `x` is rotated, after a Kempe chain interchange if needed. -/ -@[expose] public section +public section open SimpleGraph Finset 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..107c9eeb50 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,13 +63,13 @@ 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) /-- `skZeroIsoSkOne` -/ -noncomputable def skZeroIsoSkOne : CWComplex.IProd.sk X 0 ≅ CWComplex.IProd.sk X 1 := +@[expose] noncomputable def skZeroIsoSkOne : CWComplex.IProd.sk X 0 ≅ CWComplex.IProd.sk X 1 := have : IsIso <| ofHom <| zeroOneIncl.prodMap <| ContinuousMap.id <| X.sk 0 := by have := X.isEmpty_sk_zero infer_instance -- TopCat.isIso_of_isEmpty @@ -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 @@ -373,17 +377,21 @@ lemma w' : xskl X n ≫ l' X n Z = xskr X n ≫ r' X n Z := by (cubeBoundary.botTopSidesCover_closed n)) xt_cube rw [ContinuousMap.liftCoverClosed_coe' _ _ _ _ _ xt_cube this] change _ = (cubeAttSides X α) ⟨_, _⟩ - simp only [↓cubeSplitAtLast_inv_down_eq, Homeomorph.apply_symm_apply] + simp only [] change _ = (Limits.pushout.inr (l X n) (r X n)) _ congr 2 - simp only [cubeAtt, TopCat.hom_comp] - change (X.attachCells n).attachMaps α x = - (X.attachCells n).attachMaps α - (((diskPair.homeoCubePairULift n).hom.left ≫ - (diskPair.homeoCubePairULift n).inv.left) x) - congr 1 - rw [Arrow.hom_inv_id_left] - rfl + · change t = (Cube.splitAtLast (Cube.splitAtLast.symm (t, _))).1 + simp only [Homeomorph.apply_symm_apply] + · change (X.attachCells n).attachMaps α x = + (X.cubeAtt α) ⟨⟨(Cube.splitAtLast (Cube.splitAtLast.symm (t, _))).2, _⟩⟩ + simp only [Homeomorph.apply_symm_apply] + change (X.attachCells n).attachMaps α x = + (X.attachCells n).attachMaps α + (((diskPair.homeoCubePairULift n).hom.left ≫ + (diskPair.homeoCubePairULift n).inv.left) x) + congr 1 + rw [Arrow.hom_inv_id_left] + rfl change (Hom.hom Z.inl) ((Hom.hom (Limits.pushout.inr (l X n) (r X n))) (t, (Hom.hom ((X.attachCells n).attachMaps α)) x)) = _ @@ -607,7 +615,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)) := @@ -948,7 +956,7 @@ end IProd /-- `IProd` -/ -noncomputable def IProd : RelCWComplex where +@[expose] noncomputable def IProd : RelCWComplex where sk := IProd.sk X attachCells n := match n with diff --git a/LeanPool/WhiteheadTheorem/CWComplex/IProd/Iso.lean b/LeanPool/WhiteheadTheorem/CWComplex/IProd/Iso.lean index e460257047..1f242bfc53 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 @@ -36,8 +36,11 @@ lemma inl_l_r_eq_relCWComplex_skInclSucc_zero : (Limits.Sigma.desc fun a ↦ isEmptyElim a) (Limits.Sigma.map fun _ ↦ diskBoundaryIncl 0) ).inv simp only [Nat.reduceAdd, Iso.trans_inv, Iso.symm_inv] - change _ = _ ≫ _ ≫ _ - exact (Iso.hom_inv_id_assoc _ _).symm + let i : IProd.sk X 0 ≅ _ := asIso <| Limits.pushout.inl + (Limits.Sigma.desc fun a : (X.IProd.attachCells 0).cells ↦ isEmptyElim a) + (Limits.Sigma.map fun _ ↦ diskBoundaryIncl 0) + change (skZeroIsoSkOne X).hom = i.hom ≫ i.inv ≫ (skZeroIsoSkOne X).hom + exact (Iso.hom_inv_id_assoc i (skZeroIsoSkOne X).hom).symm lemma skInclSucc_eq_relCWComplex_skInclSucc (n : ℕ) : IProd.skInclSucc X n = RelCWComplex.skInclSucc X.IProd (n + 1) := by @@ -123,7 +126,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..eaa6f9e5a9 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 @@ -332,7 +332,7 @@ theorem homotopicWith_const_isMapOfPairs_of_unique_pi apply this } /-- `stretchToWall` -/ -noncomputable def _root_.TopCat.Cyl.stretchToWall : +@[expose] noncomputable def _root_.TopCat.Cyl.stretchToWall : C(I × (disk.{u} (n + 1)), I × (disk.{u} (n + 1))) := by refine { toFun := fun ⟨t, ⟨x, hx⟩⟩ ↦ 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..b6b0d635d2 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 @@ -24,7 +24,7 @@ open scoped ContinuousMap universe u /-- `IsWeakHomotopyEquiv` -/ -def IsWeakHomotopyEquiv {X Y : Type u} [TopologicalSpace X] [TopologicalSpace Y] +@[expose] def IsWeakHomotopyEquiv {X Y : Type u} [TopologicalSpace X] [TopologicalSpace Y] (f : C(X, Y)) : Prop := Nonempty X ∧ ∀ n x, Function.Bijective (HomotopyGroup.inducedMap n x f) @@ -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..3eb2ad3ba0 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 _ @@ -442,7 +443,7 @@ lemma cubeInclToBotOrTop_mem_botOrTop /-- Given a point on the boundary of the `n`-dimensional cube, cast it as a point on the boundary of the `(n + 1)`-dimensional cube by specifying the height `t : I`. -/ -def castSucc {n : ℕ} (t : I) (y : ∂𝕀 n) : ∂𝕀 (n + 1) := +@[expose] def castSucc {n : ℕ} (t : I) (y : ∂𝕀 n) : ∂𝕀 (n + 1) := ⟨cubeSplitAtLast.inv ⟨t, cubeBoundaryIncl n y⟩ |>.down, cubeSplitAtLast_inv_mem_boundary_of_mem_boundary t y⟩ 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 ccd0d116c3..a241accf10 100644 --- a/LeanPool/WhiteheadTheorem/Shapes/Disk.lean +++ b/LeanPool/WhiteheadTheorem/Shapes/Disk.lean @@ -13,13 +13,13 @@ public import Mathlib.Topology.Category.TopCat.Sphere Imported Lean Pool material for `LeanPool.WhiteheadTheorem.Shapes.Disk`. -/ -@[expose] public section +public section namespace TopCat /-- 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..a5485ee0ce 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`. -/ @@ -76,7 +76,7 @@ lemma eq_zero_iff (x : pDisk.{u} n p) : x = 0 ↔ x.down.val = 0 := /-- Map `x` to `(‖x‖_p / ‖x‖_q) • x`. Note that division by zero evaluates to zero (see `toQDisk_zero`). -/ -noncomputable def toQDisk : pDisk.{u} n p → pDisk.{u} n q +@[expose] noncomputable def toQDisk : pDisk.{u} n p → pDisk.{u} n q | ⟨x, hx⟩ => ⟨ (‖x‖ * ‖WithLp.toLp q (WithLp.ofLp x)‖⁻¹) • WithLp.toLp q (WithLp.ofLp x), by simp only [Metric.mem_closedBall, dist_zero_right] at * simp only [norm_smul, norm_mul, Real.norm_eq_abs, abs_norm, norm_inv] @@ -159,7 +159,7 @@ lemma continuous_toQDisk : Continuous (toQDisk.{u} n p q) := /-- `pDisk n p` (the unit disk in `ℝⁿ` based on the `Lᵖ` norm) is homeomorphic to `pDisk n q` (the unit disk in `ℝⁿ` based on the `L^q` norm). -/ -noncomputable def homeoQDisk : pDisk.{u} n p ≃ₜ pDisk.{u} n q where +@[expose] noncomputable def homeoQDisk : pDisk.{u} n p ≃ₜ pDisk.{u} n q where toFun := toQDisk n p q invFun := toQDisk n q p left_inv := toPDisk_comp_toQDisk n p q @@ -188,7 +188,7 @@ lemma neq_zero (x : pDiskBoundary.{u} n p) : x.down.val ≠ 0 := fun xz ↦ by exact (by norm_num : (0 : ℝ) ≠ 1) (x0.symm.trans x1) /-- `toQDiskBoundary` -/ -noncomputable def toQDiskBoundary : pDiskBoundary.{u} n p → pDiskBoundary.{u} n q +@[expose] noncomputable def toQDiskBoundary : pDiskBoundary.{u} n p → pDiskBoundary.{u} n q | ⟨x, hx⟩ => ⟨ (‖x‖ * ‖WithLp.toLp q (WithLp.ofLp x)‖⁻¹) • WithLp.toLp q (WithLp.ofLp x), by have xnz := neq_zero.{u} n p ⟨x, hx⟩ simp only [mem_sphere_iff_norm, sub_zero] at hx ⊢ @@ -225,7 +225,7 @@ lemma continuous_toQDiskBoundary : Continuous (toQDiskBoundary.{u} n p q) := by fun_prop (disch := exact denominator_ne_zero _) /-- `pDiskBounday n p` is homeomorphic to `pDiskBoundary n q`. -/ -noncomputable def homeoQDiskBoundary : +@[expose] noncomputable def homeoQDiskBoundary : pDiskBoundary.{u} n p ≃ₜ pDiskBoundary.{u} n q where toFun := toQDiskBoundary n p q invFun := toQDiskBoundary n q p @@ -260,7 +260,7 @@ namespace TopCat /-- The large cube $[-1, 1]^n$ is homeomorphic to `pDisk n ∞` (the disk in `ℝⁿ` according to the `L∞` norm). -/ -def largeCubeHomeoPDisk (n : ℕ) : (Fin n → Set.Icc (-1 : ℝ) (1 : ℝ)) ≃ₜ pDisk n ∞ where +@[expose] def largeCubeHomeoPDisk (n : ℕ) : (Fin n → Set.Icc (-1 : ℝ) (1 : ℝ)) ≃ₜ pDisk n ∞ where toFun := fun x ↦ ⟨⟨WithLp.toLp ∞ (fun i ↦ (x i : ℝ)), by simp only [Metric.mem_closedBall, PiLp.dist_eq_iSup] refine Real.iSup_le ?_ (by norm_num) @@ -282,17 +282,17 @@ def largeCubeHomeoPDisk (n : ℕ) : (Fin n → Set.Icc (-1 : ℝ) (1 : ℝ)) ≃ continuous_uliftDown.subtype_val).subtype_mk _ /-- The large cube $[-1, 1]^n$ is homeomorphic to the cube $[0, 1]^n$. -/ -noncomputable def largeCubeHomeoCube (n : ℕ) : +@[expose] noncomputable def largeCubeHomeoCube (n : ℕ) : (Fin n → Set.Icc (-1 : ℝ) (1 : ℝ)) ≃ₜ I^ Fin n := Homeomorph.piCongrRight fun _ ↦ iccHomeoI _ _ (by norm_num) /-- The n-disk `𝔻 n` is homeomorphic to the cube $[0, 1]^n$. -/ -noncomputable def diskHomeoCube (n : ℕ) : TopCat.disk.{u} n ≃ₜ (I^ Fin n) := +@[expose] noncomputable def diskHomeoCube (n : ℕ) : TopCat.disk.{u} n ≃ₜ (I^ Fin n) := (pDisk.homeoQDisk.{u} n 2 ∞).trans <| (largeCubeHomeoPDisk n).symm.trans (largeCubeHomeoCube n) /-- `largeCubeBoundaryHomeoPDiskBoundary` -/ -noncomputable def largeCubeBoundaryHomeoPDiskBoundary (n : ℕ) : +@[expose] noncomputable def largeCubeBoundaryHomeoPDiskBoundary (n : ℕ) : { x : Fin n → Set.Icc (-1 : ℝ) (1 : ℝ) | ∃ i, x i = (-1 : ℝ) ∨ x i = (1 : ℝ) } ≃ₜ pDiskBoundary n ∞ where toFun := fun ⟨x, hx⟩ ↦ ⟨⟨WithLp.toLp ∞ (fun i ↦ (x i : ℝ)), by @@ -338,7 +338,7 @@ noncomputable def largeCubeBoundaryHomeoPDiskBoundary (n : ℕ) : continuous_uliftDown.subtype_val /-- `largeCubeBoundaryHomeoCubeBoundary` -/ -noncomputable def largeCubeBoundaryHomeoCubeBoundary (n : ℕ) : +@[expose] noncomputable def largeCubeBoundaryHomeoCubeBoundary (n : ℕ) : { x : Fin n → Set.Icc (-1 : ℝ) (1 : ℝ) | ∃ i, x i = (-1 : ℝ) ∨ x i = (1 : ℝ) } ≃ₜ Cube.boundary (Fin n) where toFun := fun ⟨x, hx⟩ ↦ ⟨fun i ↦ iccHomeoI (-1 : ℝ) (1 : ℝ) (by norm_num) (x i), by @@ -363,7 +363,7 @@ noncomputable def largeCubeBoundaryHomeoCubeBoundary (n : ℕ) : exact (continuous_apply i).comp continuous_subtype_val /-- `diskBoundaryHomeoCubeBoundary` -/ -noncomputable def diskBoundaryHomeoCubeBoundary (n : ℕ) : +@[expose] noncomputable def diskBoundaryHomeoCubeBoundary (n : ℕ) : TopCat.diskBoundary.{u} n ≃ₜ Cube.boundary (Fin n) := (pDiskBoundary.homeoQDiskBoundary.{u} n 2 ∞).trans <| (largeCubeBoundaryHomeoPDiskBoundary n).symm.trans (largeCubeBoundaryHomeoCubeBoundary n) @@ -400,21 +400,21 @@ end diskPair -------------------------------------------------------------------------------------- /-- `diskHomeoCubeULift` -/ -noncomputable def diskHomeoCubeULift (n : ℕ) : +@[expose] noncomputable def diskHomeoCubeULift (n : ℕ) : disk.{u} n ≃ₜ cube.{u} n := (diskHomeoCube n).trans Homeomorph.ulift.symm /-- `diskIsoCubeULift` -/ -noncomputable def diskIsoCubeULift (n : ℕ) : disk.{u} n ≅ cube.{u} n := +@[expose] noncomputable def diskIsoCubeULift (n : ℕ) : disk.{u} n ≅ cube.{u} n := isoOfHomeo (diskHomeoCubeULift n) /-- `diskBoundaryHomeoCubeBoundaryULift` -/ -noncomputable def diskBoundaryHomeoCubeBoundaryULift (n : ℕ) : +@[expose] noncomputable def diskBoundaryHomeoCubeBoundaryULift (n : ℕ) : diskBoundary.{u} n ≃ₜ cubeBoundary.{u} n := (TopCat.diskBoundaryHomeoCubeBoundary n).trans Homeomorph.ulift.symm /-- `diskBoundaryIsoCubeBoundaryULift` -/ -noncomputable def diskBoundaryIsoCubeBoundaryULift (n : ℕ) : +@[expose] noncomputable def diskBoundaryIsoCubeBoundaryULift (n : ℕ) : diskBoundary.{u} n ≅ cubeBoundary.{u} n := isoOfHomeo (diskBoundaryHomeoCubeBoundaryULift n) @@ -422,7 +422,7 @@ namespace diskPair /-- Homeomorphism from the pair (TopCat.disk.{u} n, TopCat.diskBoundary.{u} n) to the pair (TopCat.cube.{u} n, TopCat.cubeBoundary.{u} n) -/ -noncomputable def homeoCubePairULift (n : ℕ) : +@[expose] noncomputable def homeoCubePairULift (n : ℕ) : CategoryTheory.Arrow.mk (diskBoundaryIncl n) ≅ CategoryTheory.Arrow.mk (cubeBoundaryIncl n) := CategoryTheory.Arrow.isoMk' _ _ 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..71c48be12f 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) : @@ -193,7 +193,7 @@ lemma curriedDeformRetrEvalAt_eq_deformRetrEvalAt (t : I) : congr /-- The mapping cylinder of `f : X ⟶ Y` is homotopy equivalent to its base `Y`. -/ -noncomputable def homotopyEquivBase : MapCyl f ≃ₕ Y where +@[expose] noncomputable def homotopyEquivBase : MapCyl f ≃ₕ Y where toFun := (retr f).hom invFun := (inl f).hom left_inv := Nonempty.intro 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 596e645dcf..42f8e57ba3 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/Zeta32/Analytic/Contour/Kernel.lean b/LeanPool/Zeta32/Analytic/Contour/Kernel.lean index b02674452a..b879c4653e 100644 --- a/LeanPool/Zeta32/Analytic/Contour/Kernel.lean +++ b/LeanPool/Zeta32/Analytic/Contour/Kernel.lean @@ -19,7 +19,7 @@ public import Mathlib.Tactic.Ring derivative, the kernel `w = 2rρ + iρ'` of `Interfaces.lean`, and integrability of polynomially bounded functions against them (the proof notes, 5.1). -/ -@[expose] public section +public section open MeasureTheory Set Filter Topology @@ -28,9 +28,11 @@ namespace Zeta32.Analytic.Contour noncomputable section /-- The contour point `t = 1/2 + i y`, written exactly as in `heineIntegrand`. -/ +@[expose] def tpt (y : ℝ) : ℂ := (1/2 : ℂ) + Complex.I * (y : ℂ) /-- The logistic density `ρ(y) = (π/2) sech²(πy)`. -/ +@[expose] def rho (y : ℝ) : ℝ := Real.pi / 2 / Real.cosh (Real.pi * y) ^ 2 /-- `ρ'(y) = -π² sinh(πy) / cosh³(πy)`. -/ diff --git a/LeanPool/Zeta32/Analytic/Contour/Moments.lean b/LeanPool/Zeta32/Analytic/Contour/Moments.lean index dd5e61abe0..469995980b 100644 --- a/LeanPool/Zeta32/Analytic/Contour/Moments.lean +++ b/LeanPool/Zeta32/Analytic/Contour/Moments.lean @@ -12,7 +12,7 @@ public import Mathlib.Analysis.PSeries `E[(t+j)^{-(p+1)}] = (p+1) (ζ(p+2) − H_j^{(p+2)})`. Both follow from the shift rule `E[F(t+1)] − E[F(t)] = F'(1)` alone. -/ -@[expose] public section +public section open MeasureTheory Set Filter Topology Finset @@ -21,6 +21,7 @@ namespace Zeta32.Analytic.Contour noncomputable section /-- The logistic functional. -/ +@[expose] def Erho (φ : ℂ → ℂ) : ℂ := ∫ y : ℝ, φ (tpt y) * (rho y : ℂ) lemma norm_tpt_le (y : ℝ) : ‖tpt y‖ ≤ 1 + |y| := by @@ -95,6 +96,7 @@ theorem Erho_pow (m : ℕ) : Erho (fun t => t ^ m) = (bernoulli' m : ℂ) := by /-! ### Poles -/ /-- `(t + j)^{-(p+1)}`. -/ +@[expose] def invPow (j p : ℕ) (t : ℂ) : ℂ := ((t + j) ^ (p + 1))⁻¹ lemma add_nat_re (t : ℂ) (j : ℕ) : (t + j).re = t.re + j := by simp diff --git a/LeanPool/Zeta32/Analytic/Contour/PartialFractions.lean b/LeanPool/Zeta32/Analytic/Contour/PartialFractions.lean index 3a9c1c3bea..a3d5024d6a 100644 --- a/LeanPool/Zeta32/Analytic/Contour/PartialFractions.lean +++ b/LeanPool/Zeta32/Analytic/Contour/PartialFractions.lean @@ -17,7 +17,7 @@ The generic part (`piPl`, `polyPart`, `resP`, `partial_fractionsP`) is (itself extracted from Apery/Arith/PoleFun.lean in mo271/Zeta5 by Moritz Firsching, Apache-2.0); the specialization to `D (5*n)` follows Li2 `OriginalPartialFractions.lean`. -/ -@[expose] public section +public section open Finset Polynomial open scoped BigOperators diff --git a/LeanPool/Zeta32/Analytic/Contour/Rectangle.lean b/LeanPool/Zeta32/Analytic/Contour/Rectangle.lean index 25536a7398..452f3a71c6 100644 --- a/LeanPool/Zeta32/Analytic/Contour/Rectangle.lean +++ b/LeanPool/Zeta32/Analytic/Contour/Rectangle.lean @@ -15,7 +15,7 @@ Proof: `π²/sin²(πt) = -(π cot πt)'`, so by the fundamental theorem of calc four edges the boundary integral equals that of `F'(t) π cot(πt)`, which has the single simple pole `t = 1` in the rectangle with residue `F'(1)`. -/ -@[expose] public section +public section open MeasureTheory Set Filter Topology open scoped Interval @@ -25,6 +25,7 @@ namespace Zeta32.Analytic.Contour noncomputable section /-- `K(t) = π²/sin²(πt)`. -/ +@[expose] def Kc (t : ℂ) : ℂ := (Real.pi : ℂ) ^ 2 / Complex.sin ((Real.pi : ℂ) * t) ^ 2 /-- `π cot(πt)`. -/ @@ -32,6 +33,7 @@ def cotK (t : ℂ) : ℂ := (Real.pi : ℂ) * Complex.cos ((Real.pi : ℂ) * t) / Complex.sin ((Real.pi : ℂ) * t) /-- The open strip `0 < Re t < 2`. -/ +@[expose] def strip : Set ℂ := {t | 0 < t.re ∧ t.re < 2} lemma isOpen_strip : IsOpen strip := @@ -214,8 +216,10 @@ end Edges /-! ### The rectangle `[1/2, 3/2] × [-T, T]` -/ /-- Lower-left corner. -/ +@[expose] def zT (T : ℝ) : ℂ := ⟨1/2, -T⟩ /-- Upper-right corner. -/ +@[expose] def wT (T : ℝ) : ℂ := ⟨3/2, T⟩ lemma one_re_mem (T : ℝ) : (1 : ℂ).re ∈ Ioo (zT T).re (wT T).re := by diff --git a/LeanPool/Zeta32/Analytic/Contour/RectangleResidue.lean b/LeanPool/Zeta32/Analytic/Contour/RectangleResidue.lean index 24ae89a294..1721be3ce7 100644 --- a/LeanPool/Zeta32/Analytic/Contour/RectangleResidue.lean +++ b/LeanPool/Zeta32/Analytic/Contour/RectangleResidue.lean @@ -65,7 +65,7 @@ complex analysis, residue theorem, contour integral, Cauchy formula, rectangular -/ -@[expose] public section +public section open Filter Topology MeasureTheory intervalIntegral Real open scoped Topology Interval @@ -79,6 +79,7 @@ variable {z w ρ : ℂ} /-- The oriented boundary integral of `f` over the rectangle `[z, w]`, in the sign convention of `Complex.integral_boundary_rect_eq_zero_of_differentiable_on_off_countable`. -/ +@[expose] noncomputable def boundaryIntegral (f : ℂ → ℂ) (z w : ℂ) : ℂ := (∫ x : ℝ in z.re..w.re, f (x + z.im * I)) - (∫ x : ℝ in z.re..w.re, f (x + w.im * I)) + diff --git a/LeanPool/Zeta32/Analytic/Contour/Shift.lean b/LeanPool/Zeta32/Analytic/Contour/Shift.lean index 13d9692804..7c772f2e4b 100644 --- a/LeanPool/Zeta32/Analytic/Contour/Shift.lean +++ b/LeanPool/Zeta32/Analytic/Contour/Shift.lean @@ -13,7 +13,7 @@ for `F` holomorphic on `0 < Re t < 2` with polynomial growth on `1/2 ≤ Re t Obtained from `boundaryIntegral_mul_Kc` by letting the height `T → ∞`: on both vertical edges `π²/sin²(πt) = 2πρ(y)`, and on the horizontal edges `|π²/sin²(πt)| ≤ 16π² e^{-2πT}`. -/ -@[expose] public section +public section open MeasureTheory Set Filter Topology open scoped Interval @@ -119,6 +119,7 @@ lemma right_pt (y : ℝ) : (((3/2 : ℝ)) : ℂ) + (y : ℂ) * Complex.I = tpt y unfold tpt; push_cast; ring /-- The growth hypothesis on the closed strip `1/2 ≤ Re t ≤ 3/2`. -/ +@[expose] def PolyGrowth (F : ℂ → ℂ) (C : ℝ) (N : ℕ) : Prop := ∀ t : ℂ, 1/2 ≤ t.re → t.re ≤ 3/2 → ‖F t‖ ≤ C * (1 + |t.im|) ^ N diff --git a/LeanPool/Zeta32/Analytic/Energy.lean b/LeanPool/Zeta32/Analytic/Energy.lean index fa1369bffa..7a1b452acc 100644 --- a/LeanPool/Zeta32/Analytic/Energy.lean +++ b/LeanPool/Zeta32/Analytic/Energy.lean @@ -21,7 +21,7 @@ Poisson, CIntegrals, Regularity, Potential — (8′), (11′), (15′) and the `massA` of FstarDefs; ZeroMass, CircleTools, Discrete — (12), (13′); Assembly — (14′) and the constant. -/ -@[expose] public section +public section open Filter Polynomial diff --git a/LeanPool/Zeta32/Analytic/Energy/Assembly.lean b/LeanPool/Zeta32/Analytic/Energy/Assembly.lean index 65d341881e..9f613e03e5 100644 --- a/LeanPool/Zeta32/Analytic/Energy/Assembly.lean +++ b/LeanPool/Zeta32/Analytic/Energy/Assembly.lean @@ -12,7 +12,7 @@ public import Mathlib.Analysis.Real.Pi.Bounds /-! the proof notes (11′), (14′), (15′): tail margin, integration of the configuration bound, and the constant `F* = 9(3/2 − log 3) + (9/2)(ℓ − W) ≤ −6`. -/ -@[expose] public section +public section open Real MeasureTheory Polynomial Filter Topology diff --git a/LeanPool/Zeta32/Analytic/Energy/CIntegrals.lean b/LeanPool/Zeta32/Analytic/Energy/CIntegrals.lean index a347370643..a0cfbfc7d6 100644 --- a/LeanPool/Zeta32/Analytic/Energy/CIntegrals.lean +++ b/LeanPool/Zeta32/Analytic/Energy/CIntegrals.lean @@ -18,7 +18,7 @@ Each by one generic statement (`integral_gtil`): `g = 1/3 + (4/3)1_{c≥1} − ( x²/c²) + |x| atan(c/|x|)` and `−J` (FstarDefs). -/ -@[expose] public section +public section open Real MeasureTheory Set Filter Topology diff --git a/LeanPool/Zeta32/Analytic/Energy/CircleTools.lean b/LeanPool/Zeta32/Analytic/Energy/CircleTools.lean index 1b7fd010a5..aa48ea125c 100644 --- a/LeanPool/Zeta32/Analytic/Energy/CircleTools.lean +++ b/LeanPool/Zeta32/Analytic/Energy/CircleTools.lean @@ -23,7 +23,7 @@ namespace changed: -- Base/FiniteSignedEnergyBound.lean, -- Positive/Packed/P197.lean (complex_signed_energy_log_bound). -/ -@[expose] public section +public section open MeasureTheory Set Real intervalIntegral open scoped BigOperators diff --git a/LeanPool/Zeta32/Analytic/Energy/Component.lean b/LeanPool/Zeta32/Analytic/Energy/Component.lean index 42000647a2..bde6945363 100644 --- a/LeanPool/Zeta32/Analytic/Energy/Component.lean +++ b/LeanPool/Zeta32/Analytic/Energy/Component.lean @@ -15,7 +15,7 @@ unit disc: the balayage of `δ_{±ic}` onto `[-a, a]` minus a multiple of the arcsine measure (GLOBAL-INTEGRAL-v1 §5). -/ -@[expose] public section +public section open Real MeasureTheory Set @@ -24,6 +24,7 @@ noncomputable section /-- `β = a/(u_c + c)`: `±iβ` are the preimages of `±ic` inside the unit disc under `w ↦ (a/2)(w + 1/w)`. -/ +@[expose] def betaC (a c : ℝ) : ℝ := a / (uC a c + c) /-- Angular density of `ρ_c`. -/ diff --git a/LeanPool/Zeta32/Analytic/Energy/Defs.lean b/LeanPool/Zeta32/Analytic/Energy/Defs.lean index 9abf8244da..7bfa4ba3a8 100644 --- a/LeanPool/Zeta32/Analytic/Energy/Defs.lean +++ b/LeanPool/Zeta32/Analytic/Energy/Defs.lean @@ -17,7 +17,7 @@ potential and energy of a `gtil = (1/3, 5/3, 4/3)` on `(0,1), [1,5), [5,∞)`, and the constants `kC a c`, `wC c x` with `2 L_c = kC + wC` on the support. -/ -@[expose] public section +public section open Real MeasureTheory @@ -25,33 +25,43 @@ namespace Zeta32.Analytic.EnergyI noncomputable section /-- Logarithmic potential of a density `ρ` supported on `[-a, a]`. -/ +@[expose] def potD (ρ : ℝ → ℝ) (a x : ℝ) : ℝ := ∫ t in (-a)..a, Real.log |x - t| * ρ t /-- Logarithmic energy of a density `ρ` supported on `[-a, a]`. -/ +@[expose] def ID (ρ : ℝ → ℝ) (a : ℝ) : ℝ := ∫ x in (-a)..a, potD ρ a x * ρ x /-- Potential of the comparison density `rhoA a`. -/ +@[expose] def potA (a x : ℝ) : ℝ := potD (rhoA a) a x /-- Energy of the comparison density `rhoA a`. -/ +@[expose] def IA (a : ℝ) : ℝ := ID (rhoA a) a /-- The weight `g` of the proof notes (8′) for layout (4,5,3). -/ +@[expose] def gtil (c : ℝ) : ℝ := if c < 1 then 1/3 else if c < 5 then 5/3 else 4/3 /-- `u_c = √(c² + a²)`. -/ +@[expose] def uC (a c : ℝ) : ℝ := √(c^2 + a^2) /-- The component density `ρ_c` of GLOBAL-INTEGRAL-v1 (9). -/ +@[expose] def rhoC (a c t : ℝ) : ℝ := c * √(a^2 - t^2) / (2 * π * uC a c * (t^2 + c^2)) /-- Potential of the component `ρ_c`. -/ +@[expose] def potC (a c x : ℝ) : ℝ := ∫ t in (-a)..a, Real.log |x - t| * rhoC a c t /-- Value of `2 L_c − wC c` on the support. -/ +@[expose] def kC (a c : ℝ) : ℝ := Real.log (a * c / (uC a c + c)) - c / uC a c * Real.log (a / 2) /-- `w_c(x) = ½ log(1 + x²/c²)`, so that `W = ∫ g w_c dc`. -/ +@[expose] def wC (c x : ℝ) : ℝ := Real.log (1 + x^2 / c^2) / 2 end diff --git a/LeanPool/Zeta32/Analytic/Energy/Discrete.lean b/LeanPool/Zeta32/Analytic/Energy/Discrete.lean index 596b2f3b35..5741486e90 100644 --- a/LeanPool/Zeta32/Analytic/Energy/Discrete.lean +++ b/LeanPool/Zeta32/Analytic/Energy/Discrete.lean @@ -20,7 +20,7 @@ with the truncation error `K ≥ 0`, `K = 0` for `|x_i − t| ≥ ε`, and `∫ ρK ≤ √ε(N²/2 + 2)` by AM–GM and `∫ K² ≤ 4ε` (this replaces the rearrangement step of the proof notes (13′); only `ρ ∈ L²` is used). -/ -@[expose] public section +public section open Real MeasureTheory Set Filter open scoped Interval diff --git a/LeanPool/Zeta32/Analytic/Energy/LogNorm.lean b/LeanPool/Zeta32/Analytic/Energy/LogNorm.lean index 814aef5c5e..7308dbda29 100644 --- a/LeanPool/Zeta32/Analytic/Energy/LogNorm.lean +++ b/LeanPool/Zeta32/Analytic/Energy/LogNorm.lean @@ -18,7 +18,7 @@ public import Mathlib.Tactic.Ring -- LogNormScaling.lean, -- LogNormSumComparison.lean, LogNormSumError.lean (namespace changed only). -/ -@[expose] public section +public section open MeasureTheory Set open scoped BigOperators diff --git a/LeanPool/Zeta32/Analytic/Energy/Pointwise.lean b/LeanPool/Zeta32/Analytic/Energy/Pointwise.lean index 698bdf4420..1130105c90 100644 --- a/LeanPool/Zeta32/Analytic/Energy/Pointwise.lean +++ b/LeanPool/Zeta32/Analytic/Energy/Pointwise.lean @@ -22,7 +22,7 @@ Stirling bound for `S_n`, `|w(y)| ≤ 4π(|r|+π) e^{−2π|y|}`, and the identi The wfun bound follows Zeta32/Analytic/Contour/Kernel.lean and the structure follows Li2Unified/Modular/Base/OriginalProductLog.lean, OriginalScaledProductLog.lean. -/ -@[expose] public section +public section open Real MeasureTheory Set open scoped BigOperators @@ -133,6 +133,7 @@ theorem external_field_eq (x : ℝ) : /-! ### The pointwise bound -/ /-- The single-variable Heine factor `|t R_n(t) w(y)|`, `t = 1/2 + iy`. -/ +@[expose] def psiH (r : ℚ) (n : ℕ) (y : ℝ) : ℝ := ‖((1/2 : ℂ) + Complex.I * (y : ℂ)) * Rfun n ((1/2 : ℂ) + Complex.I * (y : ℂ)) * wfun r y‖ diff --git a/LeanPool/Zeta32/Analytic/Energy/Poisson.lean b/LeanPool/Zeta32/Analytic/Energy/Poisson.lean index a14df8c63c..0203d450ab 100644 --- a/LeanPool/Zeta32/Analytic/Energy/Poisson.lean +++ b/LeanPool/Zeta32/Analytic/Energy/Poisson.lean @@ -16,7 +16,7 @@ formula the arcsine part. Outside `[-a, a]` the inequality reduces to `ψ(q) ≥ 0` for `q ≥ 1`, proved by `ψ′ ≥ 0`. -/ -@[expose] public section +public section open Real MeasureTheory Set Filter open scoped Interval diff --git a/LeanPool/Zeta32/Analytic/Energy/PoissonKernel.lean b/LeanPool/Zeta32/Analytic/Energy/PoissonKernel.lean index 4798684493..61cbefd03c 100644 --- a/LeanPool/Zeta32/Analytic/Energy/PoissonKernel.lean +++ b/LeanPool/Zeta32/Analytic/Energy/PoissonKernel.lean @@ -13,7 +13,7 @@ The three facts: `∫₀^{2π} PK w = 2π`, `∫₀^{2π} PK w · log|e^{iθ} ≥ 1`, and `∫₀^{2π} log|e^{iθ} − q| = 2π log⁺|q|`; all from Mathlib's Poisson/Jensen formulas. -/ -@[expose] public section +public section open Real MeasureTheory Metric InnerProductSpace diff --git a/LeanPool/Zeta32/Analytic/Energy/Potential.lean b/LeanPool/Zeta32/Analytic/Energy/Potential.lean index e62c2c40b3..e43a914187 100644 --- a/LeanPool/Zeta32/Analytic/Energy/Potential.lean +++ b/LeanPool/Zeta32/Analytic/Energy/Potential.lean @@ -16,7 +16,7 @@ With the per-component potentials (Poisson) and the `g`-integrals of `kC`, `wC` `2L − W = ℓ` on `[-a, a]`, `2L − W ≤ ℓ` everywhere, and `2I − W = ℓ`, `ℓ = ellA a`, when `massA a = 1`. -/ -@[expose] public section +public section open Real MeasureTheory Set Filter open scoped Interval diff --git a/LeanPool/Zeta32/Analytic/Energy/Regularity.lean b/LeanPool/Zeta32/Analytic/Energy/Regularity.lean index 205b22cda6..1775264d6c 100644 --- a/LeanPool/Zeta32/Analytic/Energy/Regularity.lean +++ b/LeanPool/Zeta32/Analytic/Energy/Regularity.lean @@ -11,7 +11,7 @@ public import LeanPool.Zeta32.Fstar.Rho "density near 0"): `rhoA a t = fc a |t| − log|t|/(6π)` with `fc` continuous (Fstar/Rho.lean), hence `rhoA`, `rhoA²` and `log|x − ·| · rhoA` are integrable (via `log²` integrable, AM–GM). -/ -@[expose] public section +public section open Real MeasureTheory Set Filter open scoped Interval diff --git a/LeanPool/Zeta32/Analytic/Energy/Scaling.lean b/LeanPool/Zeta32/Analytic/Energy/Scaling.lean index aea216b216..4b27f57185 100644 --- a/LeanPool/Zeta32/Analytic/Energy/Scaling.lean +++ b/LeanPool/Zeta32/Analytic/Energy/Scaling.lean @@ -15,7 +15,7 @@ coordinate; with `|Q_n(C_r)| ≤ exp(9(3/2 − log 3)n² + C n log(n+1)) ∫ D` for every integrable `D` dominating `∏_l (1+|x_l|)^7 e^{−3n W(x_l)} · Δ(x)²`. -/ -@[expose] public section +public section open Real MeasureTheory Polynomial open scoped BigOperators @@ -24,6 +24,7 @@ namespace Zeta32.Analytic.EnergyI noncomputable section /-- The squared Vandermonde product in the form of `heineIntegrand`. -/ +@[expose] def vdm {m : ℕ} (x : Fin m → ℝ) : ℝ := ∏ l, ∏ l' ∈ Finset.univ.filter (fun l' => l < l'), (x l - x l') ^ 2 diff --git a/LeanPool/Zeta32/Analytic/Energy/Stirling.lean b/LeanPool/Zeta32/Analytic/Energy/Stirling.lean index e4c7968dcc..cf76715128 100644 --- a/LeanPool/Zeta32/Analytic/Energy/Stirling.lean +++ b/LeanPool/Zeta32/Analytic/Energy/Stirling.lean @@ -21,7 +21,7 @@ public import Mathlib.Analysis.Complex.ExponentialBounds -- Base/OriginalFnLogBounds.lean (factorial_log_sum_bounds), Base/OriginalSnLogBounds.lean -- (pattern). -/ -@[expose] public section +public section open MeasureTheory Set open scoped BigOperators diff --git a/LeanPool/Zeta32/Analytic/Energy/ZeroMass.lean b/LeanPool/Zeta32/Analytic/Energy/ZeroMass.lean index 5f94d51f44..67cd6eac56 100644 --- a/LeanPool/Zeta32/Analytic/Energy/ZeroMass.lean +++ b/LeanPool/Zeta32/Analytic/Energy/ZeroMass.lean @@ -24,7 +24,7 @@ Gaussian positivity is new here (the Li₂ version needs bounded continuous curve densities; our comparison density is unbounded). -/ -@[expose] public section +public section open MeasureTheory Set Real intervalIntegral Filter Topology diff --git a/LeanPool/Zeta32/Analytic/Heine.lean b/LeanPool/Zeta32/Analytic/Heine.lean index ba7bfc96e3..521bf01693 100644 --- a/LeanPool/Zeta32/Analytic/Heine.lean +++ b/LeanPool/Zeta32/Analytic/Heine.lean @@ -16,7 +16,7 @@ determinants in `t_j = 1/2 + i y_j`, and `|t_j − t_l| = |y_j − y_l|`, which The statement `HeineBound` of `Interfaces.lean` is proved literally, for every `r` and `n` (including `n = 0`). -/ -@[expose] public section +public section open MeasureTheory Finset Polynomial Matrix diff --git a/LeanPool/Zeta32/Analytic/Logistic.lean b/LeanPool/Zeta32/Analytic/Logistic.lean index b50199866e..48a19a17f0 100644 --- a/LeanPool/Zeta32/Analytic/Logistic.lean +++ b/LeanPool/Zeta32/Analytic/Logistic.lean @@ -16,7 +16,7 @@ for `G = t f`. Together with the moments of `Contour/Moments.lean` this identifi ∫ (t · t^e R_n)(1/2 + iy) w(y) dy = C_r · slope n e + intercept r n e. -/ -@[expose] public section +public section open MeasureTheory Set Filter Topology Finset Polynomial diff --git a/LeanPool/Zeta32/Arith/Greedy.lean b/LeanPool/Zeta32/Arith/Greedy.lean index 7a63028a03..d5d780ec4d 100644 --- a/LeanPool/Zeta32/Arith/Greedy.lean +++ b/LeanPool/Zeta32/Arith/Greedy.lean @@ -26,7 +26,7 @@ class-wise partial fractions: `Zeta32.Arith.Local.VG_polynomialMoment` (Local/Bi the polynomial part of `U_r`), `Zeta32.Arith.Local.VG_res`, `VG_polyPart_eval` (Local/PoleFun.lean) and `Zeta32.Arith.Local.Lfun_GV` (Local/Entry.lean). -/ -@[expose] public section +public section open Filter Polynomial Finset diff --git a/LeanPool/Zeta32/Arith/LargePrimes.lean b/LeanPool/Zeta32/Arith/LargePrimes.lean index 6f2c33ab32..61a7886354 100644 --- a/LeanPool/Zeta32/Arith/LargePrimes.lean +++ b/LeanPool/Zeta32/Arith/LargePrimes.lean @@ -14,7 +14,7 @@ have degree normalizer `S_n^{3n}/F_n` is a `p`-adic unit. -/ -@[expose] public section +public section open Zeta32.Arith.Local namespace Zeta32.Outer diff --git a/LeanPool/Zeta32/Arith/Local/Alloc.lean b/LeanPool/Zeta32/Arith/Local/Alloc.lean index 8284c1ba60..8bd7cbe90c 100644 --- a/LeanPool/Zeta32/Arith/Local/Alloc.lean +++ b/LeanPool/Zeta32/Arith/Local/Alloc.lean @@ -21,7 +21,7 @@ number of entries taken from column `b` before step `i`. class of `-b` (`Adm_gbasis`). -/ -@[expose] public section +public section open Finset Polynomial @@ -40,11 +40,13 @@ noncomputable def gchoice (κ : ℕ → ℕ) : ℕ := if h : 0 < p then (exists_greedy_choice n p h κ).choose else 0 /-- The allocation before step `i`. -/ +@[expose] noncomputable def galloc : ℕ → ℕ → ℕ | 0 => fun _ => 0 | i + 1 => fun b => galloc i b + if b = gchoice n p (galloc i) then 1 else 0 /-- The column chosen at step `i`. -/ +@[expose] noncomputable def gpick (i : ℕ) : ℕ := gchoice n p (galloc n p i) /-- The entry taken at step `i`. -/ diff --git a/LeanPool/Zeta32/Arith/Local/Binom.lean b/LeanPool/Zeta32/Arith/Local/Binom.lean index 7a4e88f081..1baf87c9a2 100644 --- a/LeanPool/Zeta32/Arith/Local/Binom.lean +++ b/LeanPool/Zeta32/Arith/Local/Binom.lean @@ -20,7 +20,7 @@ public import Mathlib.RingTheory.Polynomial.Pochhammer and `r` is `p`-integral, then `v_p(polynomialMoment r q) ≥ β - 2`. -/ -@[expose] public section +public section -- adapted from mo271/Zeta5@f19a196:Apery/Arith/BinomBasis.lean -- and .../Apery/Arith/TauBound.lean (mo271/Zeta5 by Moritz Firsching, Apache-2.0). @@ -35,6 +35,7 @@ export Zeta5Irrational (poly_eq_of_nat Lb Lb_add Lb_smul Lb_C_mul Lb_monomial Lb Lb_sum Lb_shift) /-- `Lbp Q = ∑_n Q_n B'_n` (the convention `B'₁ = +1/2` of `Zeta32.moment`). -/ +@[expose] noncomputable def Lbp (Q : ℚ[X]) : ℚ := Q.sum fun n a => a * bernoulli' n lemma Lbp_add (P Q : ℚ[X]) : Lbp (P + Q) = Lbp P + Lbp Q := by diff --git a/LeanPool/Zeta32/Arith/Local/Entry.lean b/LeanPool/Zeta32/Arith/Local/Entry.lean index fd517273e2..55664c58c9 100644 --- a/LeanPool/Zeta32/Arith/Local/Entry.lean +++ b/LeanPool/Zeta32/Arith/Local/Entry.lean @@ -26,7 +26,7 @@ For a numerator `A`, `Lfun r n A = U_r(A / D_{5n})` (the proof notes, §0): `v_p ≥ min_c (e_c + [c = 0] - ℓ_c) - 2`. -/ -@[expose] public section +public section open Finset Polynomial @@ -35,6 +35,7 @@ namespace Zeta32.Arith.Local /-! ### The poles -/ /-- The pole set `{-1, …, -5n}`. -/ +@[expose] def Pl5 (n : ℕ) : Finset ℤ := (Finset.Icc 1 (5 * n)).image fun j : ℕ => -(j : ℤ) lemma neg_natCast_injective : Function.Injective fun j : ℕ => -(j : ℤ) := by @@ -68,6 +69,7 @@ lemma resP_Pl5 (A : ℚ[X]) (n j : ℕ) : /-! ### The entry functional -/ /-- `U_r(A / D_{5n})`, as a polynomial in `X`. -/ +@[expose] noncomputable def Lfun (r : ℚ) (n : ℕ) (A : ℚ[X]) : ℚ[X] := C (∑ j ∈ Finset.Icc 1 (5 * n), resP A (Pl5 n) (-(j : ℤ)) * (2 * (j : ℚ))) * X + C (polynomialMoment r (A /ₘ Zeta32.D (5 * n)) + diff --git a/LeanPool/Zeta32/Arith/Local/PoleFun.lean b/LeanPool/Zeta32/Arith/Local/PoleFun.lean index 51723acfeb..7ad3a1d4c4 100644 --- a/LeanPool/Zeta32/Arith/Local/PoleFun.lean +++ b/LeanPool/Zeta32/Arith/Local/PoleFun.lean @@ -19,7 +19,7 @@ For a numerator `A ∈ ℚ[x]` and a finite set `Pl ⊆ ℤ` of simple poles: * `VG_polyPart_eval` : a class-wise lower bound for the values of the polynomial part at integers. -/ -@[expose] public section +public section -- adapted from mo271/Zeta5@f19a196:Apery/Arith/PoleFun.lean, -- .../Apery/Arith/DirectBound.lean and .../Apery/Arith/DirectPoly.lean @@ -140,9 +140,11 @@ end Adm /-! ### Residues -/ /-- Poles in the class `c`. -/ +@[expose] def plc (p : ℕ) (Pl : Finset ℤ) (c : ZMod p) : Finset ℤ := Pl.filter fun r : ℤ => (r : ZMod p) = c /-- Poles in the same class differ by exactly one power of `p`. -/ +@[expose] def Sep (p : ℕ) (Pl : Finset ℤ) : Prop := ∀ r ∈ Pl, ∀ s ∈ Pl, r ≠ s → (r : ZMod p) = s → ¬ (p : ℤ) ^ 2 ∣ r - s diff --git a/LeanPool/Zeta32/Arith/Local/Val.lean b/LeanPool/Zeta32/Arith/Local/Val.lean index 3a0aeef8a3..6d88eb42f7 100644 --- a/LeanPool/Zeta32/Arith/Local/Val.lean +++ b/LeanPool/Zeta32/Arith/Local/Val.lean @@ -13,7 +13,7 @@ The local API reuses the existing `Zeta5Irrational` valuation and integral-polyn Only the product identity and the inverse bound without a nonzero premise are specific here. -/ -@[expose] public section +public section open Finset Polynomial diff --git a/LeanPool/Zeta32/Arith/Local/ValExtra.lean b/LeanPool/Zeta32/Arith/Local/ValExtra.lean index 781df61ee1..9376afe6d1 100644 --- a/LeanPool/Zeta32/Arith/Local/ValExtra.lean +++ b/LeanPool/Zeta32/Arith/Local/ValExtra.lean @@ -9,7 +9,7 @@ public import LeanPool.Zeta32.Arith.Local.Val /-! `VG.ratDen`, formerly only in the duplicate `Arith/Small/Val.lean` (adapted from dtq1997/li2-half-irrationality@d5d8206:Li2Unified/Modular/Base/Valuation.lean). -/ -@[expose] public section +public section open Finset Polynomial diff --git a/LeanPool/Zeta32/Arith/Node.lean b/LeanPool/Zeta32/Arith/Node.lean index 623655d783..52b0920e5d 100644 --- a/LeanPool/Zeta32/Arith/Node.lean +++ b/LeanPool/Zeta32/Arith/Node.lean @@ -21,7 +21,7 @@ is applied to `costQ`, which equals `cost` when `Q r n ≠ 0` and is below every hypothesis bound when `Q r n = 0`. -/ -@[expose] public section +public section open Polynomial Filter Topology open scoped BigOperators diff --git a/LeanPool/Zeta32/Arith/Outer.lean b/LeanPool/Zeta32/Arith/Outer.lean index b25f3260e6..9088645a22 100644 --- a/LeanPool/Zeta32/Arith/Outer.lean +++ b/LeanPool/Zeta32/Arith/Outer.lean @@ -16,7 +16,7 @@ force `n ≥ 1`, `p ≥ 3`, `p > 2n`, `p² > 5n`); `outer_per_prime_bound` is the eventual form used by `Arith.arith_of_parts`. -/ -@[expose] public section +public section open Zeta32.Arith.Local namespace Zeta32.Outer diff --git a/LeanPool/Zeta32/Arith/Outer/Classes.lean b/LeanPool/Zeta32/Arith/Outer/Classes.lean index 10ee662fd9..93780b1d6b 100644 --- a/LeanPool/Zeta32/Arith/Outer/Classes.lean +++ b/LeanPool/Zeta32/Arith/Outer/Classes.lean @@ -22,7 +22,7 @@ The regrouping (`Ccl`, `jn`, `regroup`) is adapted from dtq1997/li2-half-irrationality@d5d8206:Li2Unified/Modular/Base/DecayMediumAssembly.lean and the finite indicator sums from .../Base/MediumClassCounts.lean. -/ -@[expose] public section +public section open Polynomial open scoped BigOperators @@ -37,6 +37,7 @@ variable (p K : ℕ) def Ccl (c : ℕ) : ℕ := if c + 1 ≤ K then (K - (c+1))/p + 1 else 0 /-- Descending enumeration of the residue class represented by `c + 1`. -/ +@[expose] def jn (c t : ℕ) : ℕ := c + 1 + p * (Ccl p K c - 1 - t) lemma Ccl_pos {c : ℕ} {t : ℕ} (ht : t < Ccl p K c) : c + 1 ≤ K := by @@ -218,6 +219,7 @@ lemma wv_cancelled {n p j : ℕ} (hj : j ≤ n) : wv n p j = 15 * (n:ℚ) + 1 := /-! ## Class costs -/ /-- The Newton-form class cost of `rank_one_GV`. -/ +@[expose] def Scl (n p c : ℕ) : ℚ := ∑ k ∈ Finset.range (Ccl p (5*n) c), min (wv n p (jn p (5*n) c k) + 2 * k) 0 diff --git a/LeanPool/Zeta32/Arith/Outer/Entries.lean b/LeanPool/Zeta32/Arith/Outer/Entries.lean index bc86e79809..4f6e1ef0b5 100644 --- a/LeanPool/Zeta32/Arith/Outer/Entries.lean +++ b/LeanPool/Zeta32/Arith/Outer/Entries.lean @@ -23,7 +23,7 @@ DecayMediumNodes: `D_eval_neg_of_lt`, `padicValRat_factorial_small`, `rscale_val IntegerFamily: the integer quotient), with the layout `(s, K) = (3, 4)` there replaced by `(4, 5)` here. -/ -@[expose] public section +public section open Zeta32.Arith.Local @@ -231,6 +231,7 @@ theorem entry_eq (r : ℚ) (n : ℕ) (a b : Fin (3 * n)) : /-- Node weight of the proof notes, Lemma 5: `w_j = v_p(ρ_j) + betaWt`, and a large dummy value for the cancelled nodes `j ≤ n` (where `ρ_j = 0`). -/ +@[expose] def wv (n p j : ℕ) : ℚ := if j ≤ n then 15 * (n:ℚ) + 1 else (3 * ((j-1)/p : ℕ) - 4 * ((j-1-n)/p : ℕ) - ((5 * n-j)/p : ℕ) : ℚ) + betaWt p j diff --git a/LeanPool/Zeta32/Arith/Outer/Moments.lean b/LeanPool/Zeta32/Arith/Outer/Moments.lean index 2c8a147b61..f3e970b6ee 100644 --- a/LeanPool/Zeta32/Arith/Outer/Moments.lean +++ b/LeanPool/Zeta32/Arith/Outer/Moments.lean @@ -13,7 +13,7 @@ public import LeanPool.Zeta32.Arith.Local.Val `H_j^{(e)}` and `β_j` (`v_p(β_j) ≥ 0` for `j < p`, `≥ -2` for `p ∣ j`, `≥ -3` otherwise, `j < p²`). -/ -@[expose] public section +public section open Zeta32.Arith.Local @@ -150,6 +150,7 @@ lemma H_VG_small {e j : ℕ} (hj : j < p) : VG p (H e j) 0 := by exact inv_pow_VG_small ha1 (by omega) /-- The weight of the constant `min(v_p(2j), v_p(β_j))` in the proof notes, Lemma 5. -/ +@[expose] def betaWt (p j : ℕ) : ℚ := if j < p then 0 else if p ∣ j then -2 else -3 lemma nat_VG_dvd (j : ℕ) (hj : 0 < j) : VG p (j:ℚ) (if p ∣ j then 1 else 0) := by diff --git a/LeanPool/Zeta32/Arith/Outer/Norm.lean b/LeanPool/Zeta32/Arith/Outer/Norm.lean index 8fc842dcd3..fcec3d76c6 100644 --- a/LeanPool/Zeta32/Arith/Outer/Norm.lean +++ b/LeanPool/Zeta32/Arith/Outer/Norm.lean @@ -14,7 +14,7 @@ bounds over all classes. `normScale_val` and the floor sums are adapted from dtq1997/li2-half-irrationality@d5d8206:Li2Unified/Modular/Base/ DecayMediumClosed.lean and MediumFloorSum.lean (layout `2n, 4n, 3` there, `3n, 5n, 4` here). -/ -@[expose] public section +public section open Zeta32.Arith.Local @@ -35,6 +35,7 @@ lemma padicValRat_prod_range (p : ℕ) [Fact p.Prime] (f : ℕ → ℚ) (hf : padicValRat.mul (Finset.prod_ne_zero_iff.mpr fun i _ => hf i) (hf N), ih] /-- Prime-valuation normalization term for the scaled determinant. -/ +@[expose] def normVal (p n : ℕ) : ℚ := 3 * (n:ℚ) * (((5*n)/p : ℕ) - 4 * ((n/p : ℕ) : ℚ)) - 2 * ∑ i ∈ Finset.range (3*n), ((i/p : ℕ) : ℚ) diff --git a/LeanPool/Zeta32/Arith/Outer/RankOne.lean b/LeanPool/Zeta32/Arith/Outer/RankOne.lean index 455f489f13..b04562d8fe 100644 --- a/LeanPool/Zeta32/Arith/Outer/RankOne.lean +++ b/LeanPool/Zeta32/Arith/Outer/RankOne.lean @@ -12,7 +12,7 @@ all nodes p-integral, nodes in one class pairwise congruent mod p, v_p(gamma_{c, and w_c nondecreasing in t: v_p(det H) >= sum_c sum_{k p` are multiplied by `p` (`rowScale`); then the poly The rank-one part follows the Li₂ proof `parameter_raw_Q_GV` (dtq1997/li2-half-irrationality@d5d8206:Li2Unified/Modular/Positive/Packed/P045.lean). -/ -@[expose] public section +public section open Zeta32.Arith.Local @@ -25,6 +25,7 @@ namespace Zeta32.Outer noncomputable section /-- Row scaling: `p` on the last `r_p` rows. -/ +@[expose] def rowScale (n p : ℕ) (a : ℕ) : ℚ := if a + 2*n + 2 ≤ p then 1 else p section Val diff --git a/LeanPool/Zeta32/Arith/Profiles.lean b/LeanPool/Zeta32/Arith/Profiles.lean index b9551ad0bb..1ece182af6 100644 --- a/LeanPool/Zeta32/Arith/Profiles.lean +++ b/LeanPool/Zeta32/Arith/Profiles.lean @@ -10,14 +10,16 @@ public import Mathlib.Analysis.SpecialFunctions.Pow.Real /-! Zeta32 — Arith — Profiles. -/ -@[expose] public section +public section namespace Zeta32.ArithSum /-- The fractional-part profile controlling the arithmetic valuation bound. -/ +@[expose] noncomputable def psiL (x : ℝ) : ℝ := let a := Int.fract (1/x); let b := Int.fract (5/x); let g := Int.fract (3/x) 6 + x*g*(1-g) - 3*(4*a-b) + x/4*(16*a + b - 8*min a b - (4*a-b)^2) /-- The piecewise affine profile controlling the outer-prime contribution. -/ +@[expose] noncomputable def phiL (x : ℝ) : ℝ := if x ≤ 5/2 then 6 - x else if x ≤ 3 then 24 - 7*x else if x ≤ 4 then 18 - 5*x else 2 - x diff --git a/LeanPool/Zeta32/Arith/Relaxed.lean b/LeanPool/Zeta32/Arith/Relaxed.lean index bc565adcc1..890eeb1465 100644 --- a/LeanPool/Zeta32/Arith/Relaxed.lean +++ b/LeanPool/Zeta32/Arith/Relaxed.lean @@ -15,7 +15,7 @@ Steps: (i) `Relaxed.Basic.allocation_relaxation`; (ii) `Relaxed.Columns.sum_colV `Relaxed.Basic.padicValRat_scale_one_level`; (iii)–(iv) the identity (8.1)+(8.2) in the combined form `−norm_p − relax = n ψ(x) + E_p`, `E_p = (p − 12n − 8r₀ + 2s₀ − 1)/(4p)`; (v) `E_p < 3/4`. -/ -@[expose] public section +public section namespace Zeta32.Arith.Relaxed open Zeta32 diff --git a/LeanPool/Zeta32/Arith/Relaxed/Basic.lean b/LeanPool/Zeta32/Arith/Relaxed/Basic.lean index efbf2277ba..75924e24af 100644 --- a/LeanPool/Zeta32/Arith/Relaxed/Basic.lean +++ b/LeanPool/Zeta32/Arith/Relaxed/Basic.lean @@ -11,7 +11,7 @@ public import LeanPool.Zeta32.Arith.Local.Val the reduction `cost ≤ -(v_p(scale) + allocCost)`, and the real relaxation of the allocation cost (completed square + Cauchy–Schwarz). -/ -@[expose] public section +public section namespace Zeta32.Arith.Relaxed open Zeta32 diff --git a/LeanPool/Zeta32/Arith/Relaxed/Columns.lean b/LeanPool/Zeta32/Arith/Relaxed/Columns.lean index e06450d186..d876534c46 100644 --- a/LeanPool/Zeta32/Arith/Relaxed/Columns.lean +++ b/LeanPool/Zeta32/Arith/Relaxed/Columns.lean @@ -11,7 +11,7 @@ public import LeanPool.Zeta32.Interfaces (the column multiset `β+1` once, `β+3` μ times, `β−1` (s₀−μ) times, `β+4` (r₀−μ) times, `β` otherwise). -/ -@[expose] public section +public section namespace Zeta32.Arith.Relaxed open Zeta32 diff --git a/LeanPool/Zeta32/Arith/Small/Bern.lean b/LeanPool/Zeta32/Arith/Small/Bern.lean index 28e88c0be0..4c03ba9135 100644 --- a/LeanPool/Zeta32/Arith/Small/Bern.lean +++ b/LeanPool/Zeta32/Arith/Small/Bern.lean @@ -17,7 +17,7 @@ on polynomials. * if `deg g ≤ d` and `v_p(g(z)) ≥ β` for all `z ∈ ℤ`, then `v_p(polynomialMoment r g) ≥ β - 2⌊log_p(d+2)⌋ - v_p(den r)`. -/ -@[expose] public section +public section open Zeta32.Arith.Local diff --git a/LeanPool/Zeta32/Arith/Small/Binom.lean b/LeanPool/Zeta32/Arith/Small/Binom.lean index e080e9d43e..de41a60915 100644 --- a/LeanPool/Zeta32/Arith/Small/Binom.lean +++ b/LeanPool/Zeta32/Arith/Small/Binom.lean @@ -15,7 +15,7 @@ public import Mathlib.RingTheory.Polynomial.Pochhammer arbitrary centre, derivatives at integers (`v_p ≥ β - ⌊log_p e⌋`), `D_m = m!·binom(t+m,m)`, and the residue scale `K!/∏_{l≠j}(l-j) ∈ ℤ`. -/ -@[expose] public section +public section open Zeta32.Arith.Local @@ -290,6 +290,7 @@ lemma inv_choose_VG (p : ℕ) [hp : Fact p.Prime] {k K N : ℕ} (hk : K ≤ k) ( /-! ### Residue denominators -/ /-- Product of the differences from `j` to all other indices in `1`, …, `K`. -/ +@[expose] def eraseProd (K j : ℕ) : ℚ := ∏ l ∈ (Finset.Icc 1 K).erase j, ((l:ℚ) - (j:ℚ)) lemma D_eval_eq_prod (m : ℕ) (x : ℚ) : (D m).eval x = ∏ l ∈ Finset.Icc 1 m, (x + l) := by diff --git a/LeanPool/Zeta32/Arith/Small/Entry.lean b/LeanPool/Zeta32/Arith/Small/Entry.lean index d3fbfe1a37..040f6cfc05 100644 --- a/LeanPool/Zeta32/Arith/Small/Entry.lean +++ b/LeanPool/Zeta32/Arith/Small/Entry.lean @@ -13,7 +13,7 @@ public import LeanPool.Zeta32.Arith.Small.Gram `v_p(β_j) ≥ -3⌊log_p j⌋ - v_p(den r)`; (c) `polynomialMoment_VG`. Every entry of `binomGram r n` has Gauss valuation `≥ -3⌊log_p(10n+2)⌋ - v_p(den r)`. -/ -@[expose] public section +public section open Zeta32.Arith.Local diff --git a/LeanPool/Zeta32/Arith/Small/Gram.lean b/LeanPool/Zeta32/Arith/Small/Gram.lean index cd4637c0b8..30095de0bc 100644 --- a/LeanPool/Zeta32/Arith/Small/Gram.lean +++ b/LeanPool/Zeta32/Arith/Small/Gram.lean @@ -11,7 +11,7 @@ public import LeanPool.Zeta32.Arith.Small.Bern `Q_n/F_n = det[U_r(binom(t,a) binom(t,b) R_n)]`, and with one factor `S_n` per row, `Qtilde r n = det[U_r(S_n D_n^4 binom(t,a) binom(t,b) / D_{5n})]`. -/ -@[expose] public section +public section -- adapted from -- dtq1997/li2-half-irrationality@d5d8206:Li2Unified/Modular/Base/NumeratorFunctional.lean @@ -29,6 +29,7 @@ noncomputable section /-- The functional `U_r` on `F / D_{5n}`: polynomial part plus simple poles `U_r(1/(t+j)) = 2jX + β_j`. -/ +@[expose] def Ufun (r : ℚ) (n : ℕ) (F : ℚ[X]) : ℚ[X] := C (polynomialMoment r (F /ₘ D (5*n))) + ∑ j ∈ Finset.Icc 1 (5*n), @@ -173,6 +174,7 @@ lemma coeffMat_binom_det_sq (n : ℕ) : exact Finset.prod_congr rfl fun i _ => by rw [inv_pow] /-- The binomial Gram matrix with the scalar `S_n` inside every entry. -/ +@[expose] def binomGram (r : ℚ) (n : ℕ) : Matrix (Fin (3*n)) (Fin (3*n)) ℚ[X] := Matrix.of fun a b => Ufun r n (C (Sn n) * (D n)^4 * binomPoly a * binomPoly b) diff --git a/LeanPool/Zeta32/Arith/SmallPrimes.lean b/LeanPool/Zeta32/Arith/SmallPrimes.lean index fbf4603b9e..042ad6b13f 100644 --- a/LeanPool/Zeta32/Arith/SmallPrimes.lean +++ b/LeanPool/Zeta32/Arith/SmallPrimes.lean @@ -13,7 +13,7 @@ public import LeanPool.Zeta32.Arith.Small.Entry at most `3n` times the entry bound (`det_GV`). Here `D = 2h + sn + 2 = 10n + 2`. -/ -@[expose] public section +public section open Zeta32.Arith.Local namespace Zeta32.Arith diff --git a/LeanPool/Zeta32/Arith/Sum/Main.lean b/LeanPool/Zeta32/Arith/Sum/Main.lean index f4f0bddcec..b52628e860 100644 --- a/LeanPool/Zeta32/Arith/Sum/Main.lean +++ b/LeanPool/Zeta32/Arith/Sum/Main.lean @@ -19,7 +19,7 @@ The primes `p ≤ 5n` are split as * the additive constants `3/4` and `5` cost at most `(13/2) θ(5n) = O(n)`. The normalised main part tends to `tailConst/20 + midRat + 35/36 − (25/4) log(140/3) < 283/50`. -/ -@[expose] public section +public section open Finset Filter Topology diff --git a/LeanPool/Zeta32/Arith/Sum/Numerics.lean b/LeanPool/Zeta32/Arith/Sum/Numerics.lean index 8370eedb39..966e9a41ac 100644 --- a/LeanPool/Zeta32/Arith/Sum/Numerics.lean +++ b/LeanPool/Zeta32/Arith/Sum/Numerics.lean @@ -21,12 +21,13 @@ results/lean-route-A.out; here the tail constant is `33/5 + 121/2000` (slightly `33/5 + 28/500`, see `psiL_le_tail`). -/ -@[expose] public section +public section namespace Zeta32.ArithSum noncomputable section /-- Exact integral of `pa i + pb i · x` over piece `i` in `x` (from `1/ub (i+1)` to `1/ub i`). -/ +@[expose] def pieceRat (i : ℕ) : ℚ := pa i * (1 / ub i - 1 / ub (i + 1)) + pb i * ((1 / ub i ^ 2 - 1 / ub (i + 1) ^ 2) / 2) @@ -130,6 +131,7 @@ theorem log_140_div_3_gt : (3842 / 1000 : ℝ) < Real.log (140 / 3) := by linarith /-- Tail constant: `psiL x ≤ tailConst` for `0 < x ≤ 1/20`. -/ +@[expose] def tailConst : ℚ := 33 / 5 + 121 / 2000 theorem constant_lt : diff --git a/LeanPool/Zeta32/Arith/Sum/PNT/DecayPNTInterface.lean b/LeanPool/Zeta32/Arith/Sum/PNT/DecayPNTInterface.lean index a997a0bd0c..53e1cd7785 100644 --- a/LeanPool/Zeta32/Arith/Sum/PNT/DecayPNTInterface.lean +++ b/LeanPool/Zeta32/Arith/Sum/PNT/DecayPNTInterface.lean @@ -15,7 +15,7 @@ development preserved in LeanPool.MooreBound instead of duplicating its analytic -- dtq1997/li2-half-irrationality@d5d8206:Li2Unified/Modular/Base/DecayPNTInterface.lean -- The copied PNT closure is replaced by the pooled MooreBound proof. -@[expose] public section +public section theorem Zeta32.ArithSum.PNT.theta_isEquivalent_id : Asymptotics.IsEquivalent Filter.atTop Chebyshev.theta id := diff --git a/LeanPool/Zeta32/Arith/Sum/PNT/PrimeThetaInterval.lean b/LeanPool/Zeta32/Arith/Sum/PNT/PrimeThetaInterval.lean index 064134e09f..04f72f936d 100644 --- a/LeanPool/Zeta32/Arith/Sum/PNT/PrimeThetaInterval.lean +++ b/LeanPool/Zeta32/Arith/Sum/PNT/PrimeThetaInterval.lean @@ -13,7 +13,7 @@ public import LeanPool.Zeta5Irrational.PrimeSum -- dtq1997/li2-half-irrationality@d5d8206:Li2Unified/Modular/Base/PrimeThetaInterval.lean -- (namespace Li2 -> Zeta32.ArithSum, imports renamed; proof and style updated for Lean Pool) -@[expose] public section +public section open Finset Filter Topology Asymptotics namespace Zeta32.ArithSum.PrimeSums @@ -22,6 +22,7 @@ noncomputable section export Zeta5Irrational (cPrime) /-- Sum of prime logarithms over the integer indices in the interval `(a, b]`. -/ +@[expose] def logSum (a b : ℝ) : ℝ := ∑ k ∈ Finset.Ioc ⌊a⌋₊ ⌊b⌋₊, cPrime k lemma theta_eq_sum_cPrime (t : ℝ) : diff --git a/LeanPool/Zeta32/Arith/Sum/PNT/PrimeWeightedAbel.lean b/LeanPool/Zeta32/Arith/Sum/PNT/PrimeWeightedAbel.lean index 739ee768cb..3947a8ce79 100644 --- a/LeanPool/Zeta32/Arith/Sum/PNT/PrimeWeightedAbel.lean +++ b/LeanPool/Zeta32/Arith/Sum/PNT/PrimeWeightedAbel.lean @@ -13,7 +13,7 @@ public import Mathlib.Analysis.SpecialFunctions.Integrals.Basic -- dtq1997/li2-half-irrationality@d5d8206:Li2Unified/Modular/Base/PrimeWeightedAbel.lean -- (namespace Li2 -> Zeta32.ArithSum, imports renamed; proof and style updated for Lean Pool) -@[expose] public section +public section open Finset Filter Topology MeasureTheory Set Real Asymptotics namespace Zeta32.ArithSum.PrimeSums diff --git a/LeanPool/Zeta32/Arith/Sum/Pieces.lean b/LeanPool/Zeta32/Arith/Sum/Pieces.lean index 19872f91e6..74b19e2d3d 100644 --- a/LeanPool/Zeta32/Arith/Sum/Pieces.lean +++ b/LeanPool/Zeta32/Arith/Sum/Pieces.lean @@ -19,7 +19,7 @@ into 196 half-open pieces `[ub i, ub (i+1))`. On the piece with `⌊u⌋ = m` an The outer range `(7/3, 5]` of `x` is `[1/5, 3/7)` in `u`, four pieces on which `phiL` is linear. The tail `x ≤ 1/20` is handled by the global bound `psiL x ≤ 33/5 + (121/100) x`. -/ -@[expose] public section +public section namespace Zeta32.ArithSum noncomputable section @@ -27,17 +27,20 @@ noncomputable section /-! ### The cells of `[0,1]` and the ten formulas -/ /-- Breakpoints of the cells of `[0, 1]` (partition by `j/3, j/4, j/5`). -/ +@[expose] def alphaQ : ℕ → ℚ | 0 => 0 | 1 => 1/5 | 2 => 1/4 | 3 => 1/3 | 4 => 2/5 | 5 => 1/2 | 6 => 3/5 | 7 => 2/3 | 8 => 3/4 | 9 => 4/5 | _ => 1 /-- Constant coefficient on cell `k` (with `m = ⌊1/x⌋`). -/ +@[expose] def cellA : ℕ → ℚ → ℚ | 0, m => (62*m+49)/4 | 1, m => (62*m+7)/4 | 2, m => (62*m+39)/4 | 3, m => (62*m+63)/4 | 4, m => (62*m+21)/4 | 5, m => (62*m+53)/4 | 6, m => (62*m+11)/4 | 7, m => (62*m+35)/4 | 8, m => (62*m+67)/4 | _, m => (62*m+25)/4 /-- Coefficient of `x` on cell `k`. -/ +@[expose] def cellB : ℕ → ℚ → ℚ | 0, m => -(m*(37*m+25))/4 | 1, m => -(37*m^2-5*m-6)/4 | 2, m => -(37*m^2+27*m+2)/4 | 3, m => -(37*m^2+51*m+10)/4 | 4, m => -(37*m^2+21*m-2)/4 | 5, m => -(37*m^2+53*m+14)/4 @@ -218,14 +221,19 @@ theorem psiL_cell (k : ℕ) (hk : k < 10) (m : ℕ) {x : ℝ} (hx : 0 < x) /-! ### The 196 pieces of the relaxed range, indexed flatly -/ /-- Integer part `m` of piece `i` (pieces `0..5` have `m = 0`, cells `4..9`). -/ +@[expose] def pm (i : ℕ) : ℕ := if i < 6 then 0 else (i - 6) / 10 + 1 /-- Cell `k` of piece `i`. -/ +@[expose] def pk (i : ℕ) : ℕ := if i < 6 then i + 4 else (i - 6) % 10 /-- Left endpoint (in `u = 1/x`) of piece `i`; piece `0` starts at `3/7` inside cell `4`. -/ +@[expose] def ub (i : ℕ) : ℚ := if i = 0 then 3/7 else (pm i : ℚ) + alphaQ (pk i) /-- Coefficients of piece `i`: `psiL x = pa i + pb i · x − 25/(4x)`. -/ +@[expose] def pa (i : ℕ) : ℚ := cellA (pk i) (pm i) /-- Constant term of the affine arithmetic-profile cell selected by `i`. -/ +@[expose] def pb (i : ℕ) : ℚ := cellB (pk i) (pm i) lemma pk_lt (i : ℕ) : pk i < 10 := by @@ -289,12 +297,15 @@ theorem psiL_piece (i : ℕ) {x : ℝ} (hx : 0 < x) (h1 : (ub i : ℝ) ≤ 1 / x /-! ### The four pieces of the outer range (`7/3 < x ≤ 5`, i.e. `1/5 ≤ u < 3/7`) -/ /-- Rational breakpoints for the reciprocal outer-prime profile. -/ +@[expose] def vb : ℕ → ℚ | 0 => 1/5 | 1 => 1/4 | 2 => 1/3 | 3 => 2/5 | _ => 3/7 /-- Constant terms of the affine pieces of the reciprocal outer-prime profile. -/ +@[expose] def vc : ℕ → ℚ | 0 => 2 | 1 => 18 | 2 => 24 | _ => 6 /-- Slopes of the affine pieces of the reciprocal outer-prime profile. -/ +@[expose] def vd : ℕ → ℚ | 0 => -1 | 1 => -5 | 2 => -7 | _ => -1 diff --git a/LeanPool/Zeta32/Arith/Sum/Windows.lean b/LeanPool/Zeta32/Arith/Sum/Windows.lean index fbbdda7bb3..b61a1718f8 100644 --- a/LeanPool/Zeta32/Arith/Sum/Windows.lean +++ b/LeanPool/Zeta32/Arith/Sum/Windows.lean @@ -17,7 +17,7 @@ and the resulting limit of one "piece" `∑ (A n + B p + C n²/p) log p`, plus t window into consecutive pieces. -/ -@[expose] public section +public section open Finset Filter Topology MeasureTheory Set Real Asymptotics @@ -171,6 +171,7 @@ def pieceSum (A B C u₁ u₂ : ℝ) (n : ℕ) : ℝ := (A * n + B * k + C * (n : ℝ) ^ 2 / k) * cPrime k /-- The normalised limit of one piece. -/ +@[expose] def pieceLim (A B C u₁ u₂ : ℝ) : ℝ := A * (1 / u₁ - 1 / u₂) + B * ((1 / u₁ ^ 2 - 1 / u₂ ^ 2) / 2) + C * Real.log (u₂ / u₁) diff --git a/LeanPool/Zeta32/Assembly.lean b/LeanPool/Zeta32/Assembly.lean index 8dea6d43bb..218fcdf40b 100644 --- a/LeanPool/Zeta32/Assembly.lean +++ b/LeanPool/Zeta32/Assembly.lean @@ -9,7 +9,7 @@ public import Mathlib.Analysis.PSeries /-! Zeta32 — Assembly. -/ -@[expose] public section +public section open Polynomial Filter Topology namespace Zeta32 @@ -30,14 +30,17 @@ theorem P_eq_zero_of_Q_eq_zero (r : ℚ) (n : ℕ) (hQ : Q r n = 0) : P r n = 0 /-- The two growth nodes of the proof notes, §9, as hypotheses: arithmetic (`A = 283/50`, only needed when `Q r n ≠ 0`) and analytic (`F = −6`). -/ +@[expose] def ArithNode (r : ℚ) : Prop := ∀ ε > 0, ∀ᶠ n : ℕ in atTop, Q r n ≠ 0 → Real.log (dtilde r n) ≤ (283/50 + ε) * (n:ℝ)^2 /-- Eventual exponential bound for the scaled polynomial evaluated at the target zeta value. -/ +@[expose] def AnalyticNode (r : ℚ) : Prop := ∀ ε > 0, ∀ᶠ n : ℕ in atTop, |Polynomial.aeval (Cr r) (Qtilde r n)| ≤ Real.exp ((-6 + ε) * (n:ℝ)^2) /-- Nonzero constant reduction of the primitive polynomial at admissible prime edges. -/ +@[expose] def PrimeEdgeNode (r : ℚ) : Prop := ∀ (p : ℕ) [Fact p.Prime], 7 ≤ p → p ∉ PrimeEdge.exceptional → ¬ p ∣ r.den → ∃ c : ZMod p, c ≠ 0 ∧ (P r (p-1)).map (Int.castRingHom (ZMod p)) = Polynomial.C c diff --git a/LeanPool/Zeta32/Criterion.lean b/LeanPool/Zeta32/Criterion.lean index ea5cb6a373..c2f22e8517 100644 --- a/LeanPool/Zeta32/Criterion.lean +++ b/LeanPool/Zeta32/Criterion.lean @@ -12,7 +12,7 @@ import LeanPool.Zeta5Irrational.Criterion /-! Generic criterion adapted from the Li₂ light-certificate project and the Apéry criterion in mo271/Zeta5 (Apache-2.0), with attribution retained. -/ -@[expose] public section +public section open Polynomial Filter Topology namespace Zeta32 diff --git a/LeanPool/Zeta32/Family.lean b/LeanPool/Zeta32/Family.lean index 10d4a77fc6..ff4a3b4d7d 100644 --- a/LeanPool/Zeta32/Family.lean +++ b/LeanPool/Zeta32/Family.lean @@ -9,7 +9,7 @@ public import Mathlib.NumberTheory.Bernoulli /-! Zeta32 — Family. -/ -@[expose] public section +public section open Polynomial open scoped BigOperators @@ -18,37 +18,50 @@ namespace Zeta32 noncomputable section /-- The rational polynomial with roots `-1`, …, `-m`. -/ +@[expose] def D (m : ℕ) : ℚ[X] := ∏ j ∈ Finset.Icc 1 m, (X + C (j : ℚ)) /-- Numerator of the rational function used to construct the polynomial family. -/ +@[expose] def numerator (n k : ℕ) : ℚ[X] := X^k * (D n)^4 /-- Polynomial quotient of the numerator by the denominator polynomial. -/ +@[expose] def polynomialPart (n k : ℕ) : ℚ[X] := numerator n k /ₘ D (5*n) /-- Residue coefficient at the simple pole indexed by `j`. -/ +@[expose] def residue (n k j : ℕ) : ℚ := (numerator n k).eval (-(j : ℚ)) / ∏ l ∈ (Finset.Icc 1 (5*n)).erase j, ((l : ℚ)-(j : ℚ)) /-- Bernoulli moment of the polynomial functional at rational parameter `r`. -/ +@[expose] def moment (r : ℚ) (e : ℕ) : ℚ := ((e+1 : ℕ) : ℚ) * bernoulli' e + 2*r*bernoulli' (e+1) /-- Finite generalized harmonic sum of order `e` through index `j`. -/ +@[expose] def H (e j : ℕ) : ℚ := ∑ a ∈ Finset.Icc 1 j, 1 / (a : ℚ)^e /-- Constant contribution of the pole indexed by `j` to the moment functional. -/ +@[expose] def beta (r : ℚ) (j : ℕ) : ℚ := 2*r - 2*j*H 3 j + 2*r*j*H 2 j /-- Linear extension of the Bernoulli moments to a polynomial. -/ +@[expose] def polynomialMoment (r : ℚ) (p : ℚ[X]) : ℚ := p.sum fun e a => a * moment r e /-- Coefficient of the target zeta value in the rational-function moment. -/ +@[expose] def slope (n k : ℕ) : ℚ := ∑ j ∈ Finset.Icc 1 (5*n), residue n k j * (2*j) /-- Constant coefficient in the rational-function moment. -/ +@[expose] def intercept (r : ℚ) (n k : ℕ) : ℚ := polynomialMoment r (polynomialPart n k) + ∑ j ∈ Finset.Icc 1 (5*n), residue n k j * beta r j /-- Hankel matrix of the constant moment coefficients. -/ +@[expose] def A (r : ℚ) (n : ℕ) : Matrix (Fin (3*n)) (Fin (3*n)) ℚ := fun i k => intercept r n (i.val+k.val) /-- Hankel matrix of the target-value moment coefficients. -/ +@[expose] def B (n : ℕ) : Matrix (Fin (3*n)) (Fin (3*n)) ℚ := fun i k => slope n (i.val+k.val) /-- Determinant polynomial of the moment pencil `X • B + A`. -/ +@[expose] def Q (r : ℚ) (n : ℕ) : ℚ[X] := Matrix.det ((X : ℚ[X]) • (B n).map C + (A r n).map C) @@ -56,6 +69,7 @@ theorem Q_natDegree_le (r : ℚ) (n : ℕ) : (Q r n).natDegree ≤ 3*n := by simpa [Q] using Polynomial.natDegree_det_X_add_C_le (B n) (A r n) /-- Primitive integral normalization of the determinant polynomial, with zero preserved. -/ +@[expose] def primitiveQ (r : ℚ) (n : ℕ) : ℤ[X] := if Q r n = 0 then 0 else (IsLocalization.integerNormalization (nonZeroDivisors ℤ) (Q r n)).primPart @@ -104,12 +118,16 @@ theorem primitiveQ_proportional (r : ℚ) (n : ℕ) : nlinarith [hco] /-- Factorial quotient used to normalize the rational-function determinant. -/ +@[expose] def Sn (n : ℕ) : ℚ := ((5*n).factorial : ℚ) / ((n.factorial : ℚ)^4) /-- Product of squared factorials used to normalize the Hankel determinant. -/ +@[expose] def Fn (n : ℕ) : ℚ := ∏ i ∈ Finset.range (3*n), ((i.factorial : ℚ))^2 /-- Positive scalar converting the determinant to its arithmetic normalization. -/ +@[expose] def scale (n : ℕ) : ℚ := Sn n ^ (3*n) / Fn n /-- The determinant polynomial after multiplication by the arithmetic normalization. -/ +@[expose] def Qtilde (r : ℚ) (n : ℕ) : ℚ[X] := C (scale n) * Q r n theorem Sn_pos (n : ℕ) : 0 < Sn n := by @@ -125,6 +143,7 @@ theorem scale_pos (n : ℕ) : 0 < scale n := by exact div_pos (pow_pos (Sn_pos n) _) (Fn_pos n) /-- Negative minimum valuation among the nonzero coefficients of the normalized polynomial. -/ +@[expose] def cost (r : ℚ) (n p : ℕ) : ℝ := -sInf {v : ℝ | ∃ k, (Qtilde r n).coeff k ≠ 0 ∧ v = (padicValRat p ((Qtilde r n).coeff k) : ℝ)} @@ -137,6 +156,7 @@ theorem primitiveScale_spec (r : ℚ) (n : ℕ) : (primitiveQ r n).map (algebraMap ℤ ℚ) = C (primitiveScale r n) * Q r n := (primitiveQ_proportional r n).choose_spec.2 /-- Primitive integral determinant polynomial with a positive proportionality factor. -/ +@[expose] def P (r : ℚ) (n : ℕ) : ℤ[X] := if 0 < primitiveScale r n then primitiveQ r n else -primitiveQ r n @@ -177,10 +197,13 @@ theorem P_eq_dtilde_Qtilde (r : ℚ) (n : ℕ) : field_simp [scale_pos n |>.ne'] /-- Real zeta value at three, expressed as a convergent series. -/ +@[expose] def zeta3val : ℝ := ∑' k : ℕ, 1 / ((k : ℝ) + 1)^3 /-- Real zeta value at two, expressed as a convergent series. -/ +@[expose] def zeta2val : ℝ := ∑' k : ℕ, 1 / ((k : ℝ) + 1)^2 /-- The real target value `ζ(3) - r * ζ(2)`. -/ +@[expose] def Cr (r : ℚ) : ℝ := zeta3val - (r : ℝ) * zeta2val end diff --git a/LeanPool/Zeta32/Final.lean b/LeanPool/Zeta32/Final.lean index e2f4a263b4..27fd7eb117 100644 --- a/LeanPool/Zeta32/Final.lean +++ b/LeanPool/Zeta32/Final.lean @@ -25,7 +25,7 @@ at `ζ(3) − r ζ(2)` (`analytic_node`), and the nonvanishing modulo primes (`p independence then follows from the irrationality of `ζ(3) − r ζ(2)` for every rational `r` and of `ζ(2)`. -/ -@[expose] public section +public section open Filter Polynomial diff --git a/LeanPool/Zeta32/Fstar.lean b/LeanPool/Zeta32/Fstar.lean index fa92842bfe..5b40b1c913 100644 --- a/LeanPool/Zeta32/Fstar.lean +++ b/LeanPool/Zeta32/Fstar.lean @@ -19,7 +19,7 @@ a]` dropped (≥ 0): 4. `ellA a ≤ −159/100`, `log 3 > 549/500`; the final rational inequality by `linarith` (`F ≤ −6.2474 < −6`). No code copied from other repositories. -/ -@[expose] public section +public section open Real MeasureTheory namespace Zeta32.Fstar diff --git a/LeanPool/Zeta32/Fstar/Rho.lean b/LeanPool/Zeta32/Fstar/Rho.lean index 8752efdda0..95c6ce2388 100644 --- a/LeanPool/Zeta32/Fstar/Rho.lean +++ b/LeanPool/Zeta32/Fstar/Rho.lean @@ -16,7 +16,7 @@ Monotonicity in `x` uses the log form with `U_c = √(c²+a²)` fixed and the id `(U₁+s)(U₂+t)(U₁−t)(U₂−s) − (U₁+t)(U₂+s)(U₁−s)(U₂−t) = 2(s−t)(U₂−U₁)(U₁U₂+st)`. Integrability: `ρ_a = fc − log x/(6π)` on `(0, a]` with `fc` continuous. Written from scratch. -/ -@[expose] public section +public section open Real MeasureTheory namespace Zeta32.Fstar diff --git a/LeanPool/Zeta32/Fstar/Wt.lean b/LeanPool/Zeta32/Fstar/Wt.lean index 84f8cdeac7..8a0c094579 100644 --- a/LeanPool/Zeta32/Fstar/Wt.lean +++ b/LeanPool/Zeta32/Fstar/Wt.lean @@ -14,7 +14,7 @@ public import Mathlib.Analysis.SpecialFunctions.Log.Deriv `W′ = (2/3)(π − 2 atan(1/x) + atan(5/x)/2)` after `atan(1/x) = π/2 − atan x`. Written from scratch. -/ -@[expose] public section +public section open Real namespace Zeta32.Fstar diff --git a/LeanPool/Zeta32/FstarDefs.lean b/LeanPool/Zeta32/FstarDefs.lean index 2d87bb1c51..ae222e6a48 100644 --- a/LeanPool/Zeta32/FstarDefs.lean +++ b/LeanPool/Zeta32/FstarDefs.lean @@ -12,62 +12,75 @@ public import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic the proof notes, 5.4). Mathlib only. `FstarPoints` implies `FstarInput`, which the energy bound uses. -/ -@[expose] public section +public section namespace Zeta32 noncomputable section /-- `W(x) = (2/3)(πx − 2(x·atan(1/x) + log(1+x²)/2) + (x·atan(5/x) + 5·log(1+x²/25)/2)/2)`. -/ +@[expose] def Wt (x : ℝ) : ℝ := (2/3) * (Real.pi * x - 2 * (x * Real.arctan (1/x) + Real.log (1 + x^2) / 2) + (x * Real.arctan (5/x) + 5 * Real.log (1 + x^2/25) / 2) / 2) /-- `G(c,x) = log((√(c²+a²) + √(a²−x²)) / (√(c²+a²) − √(a²−x²)))`. -/ +@[expose] def Gfun (a c x : ℝ) : ℝ := Real.log ((Real.sqrt (c^2 + a^2) + Real.sqrt (a^2 - x^2)) / (Real.sqrt (c^2 + a^2) - Real.sqrt (a^2 - x^2))) /-- `ρ_a(x)`, g = (1/3, 5/3, 4/3) on (0,1), [1,5), [5,∞). -/ +@[expose] def rhoA (a x : ℝ) : ℝ := ((1/3) * (Gfun a 0 x - Gfun a 1 x) + (5/3) * (Gfun a 1 x - Gfun a 5 x) + (4/3) * Gfun a 5 x) / (4 * Real.pi) /-- Total mass of `ρ_a`. -/ +@[expose] def massA (a : ℝ) : ℝ := ((1/3) * (1 - (Real.sqrt (1 + a^2) - a)) + (5/3) * (4 - (Real.sqrt (25 + a^2) - Real.sqrt (1 + a^2))) + (4/3) * (Real.sqrt (25 + a^2) - 5)) / 2 /-- `J(c) = −c·log(2c/(c+√(c²+a²))) − (√(c²+a²) − c)`; `J(0) = −a` for `a > 0`. -/ +@[expose] def Jfun (a c : ℝ) : ℝ := -c * Real.log (2*c / (c + Real.sqrt (c^2 + a^2))) - (Real.sqrt (c^2 + a^2) - c) /-- `ℓ(a)`, the closed form (16) of GLOBAL-INTEGRAL-v1 for this layout. -/ +@[expose] def ellA (a : ℝ) : ℝ := 2 * Real.log (a/2) + (1/3) * (Jfun a 0 - Jfun a 1) + (5/3) * (Jfun a 1 - Jfun a 5) + (4/3) * Jfun a 5 /-- The analytic constant is at most −6 at the root of the mass equation. -/ +@[expose] def FstarInput : Prop := ∀ a : ℝ, 0 < a → massA a = 1 → 9 * (3/2 - Real.log 3) + (9/2) * (ellA a - 2 * ∫ x in (0:ℝ)..a, Wt x * rhoA a x) ≤ -6 /-- Rational lower endpoint for the equilibrium-support parameter. -/ +@[expose] def aMinus : ℝ := 93331/50000 /-- Rational upper endpoint for the equilibrium-support parameter. -/ +@[expose] def aPlus : ℝ := 186663/100000 /-- `x_k = a₋·k/16`. -/ +@[expose] def xk (k : ℕ) : ℝ := aMinus * k / 16 /-- Certified rational lower bounds for the potential weight at the fifteen test points. -/ +@[expose] def Wlow : Fin 15 → ℚ := ![(17/250 : ℚ), (153/1000 : ℚ), (127/500 : ℚ), (369/1000 : ℚ), (499/1000 : ℚ), (641/1000 : ℚ), (397/500 : ℚ), (239/250 : ℚ), (141/125 : ℚ), (1307/1000 : ℚ), (1493/1000 : ℚ), (421/250 : ℚ), (1881/1000 : ℚ), (2083/1000 : ℚ), (286/125 : ℚ)] /-- Certified rational lower bounds for the auxiliary ratio at the fifteen test points. -/ +@[expose] def Rlow : Fin 15 → ℚ := ![(223/500 : ℚ), (203/500 : ℚ), (377/1000 : ℚ), (44/125 : ℚ), (329/1000 : ℚ), (153/500 : ℚ), (283/1000 : ℚ), (13/50 : ℚ), (119/500 : ℚ), (43/200 : ℚ), (191/1000 : ℚ), (167/1000 : ℚ), (71/500 : ℚ), (113/1000 : ℚ), (39/500 : ℚ)] /-- Finitely many rational checks. Index `k : Fin 15` stands for the point `x_(k+1)`. -/ +@[expose] def FstarPoints : Prop := massA aMinus < 1 ∧ 1 < massA aPlus ∧ (∀ a ∈ Set.Icc aMinus aPlus, ellA a ≤ -159/100) ∧ diff --git a/LeanPool/Zeta32/FstarPointsRho.lean b/LeanPool/Zeta32/FstarPointsRho.lean index 1c5c0a1103..e4bd54f42a 100644 --- a/LeanPool/Zeta32/FstarPointsRho.lean +++ b/LeanPool/Zeta32/FstarPointsRho.lean @@ -12,7 +12,7 @@ public import LeanPool.Zeta32.FstarPointsRho.Ell (`FstarPointsRho/Points.lean`, one declaration per point). Generic lemmas: `FstarPointsRho/Basic.lean`. -/ -@[expose] public section +public section namespace Zeta32.Fstar diff --git a/LeanPool/Zeta32/FstarPointsRho/Basic.lean b/LeanPool/Zeta32/FstarPointsRho/Basic.lean index 45333a2426..43fae8a001 100644 --- a/LeanPool/Zeta32/FstarPointsRho/Basic.lean +++ b/LeanPool/Zeta32/FstarPointsRho/Basic.lean @@ -21,13 +21,14 @@ sum of the lower bound. Written from scratch. -/ -@[expose] public section +public section open Real namespace Zeta32.Fstar.B2 noncomputable section /-- Partial sum `2(t + t³/3 + t⁵/5 + t⁷/7)` of `log((1+t)/(1−t))`. -/ +@[expose] def lser (t : ℝ) : ℝ := 2 * (t + t ^ 3 / 3 + t ^ 5 / 5 + t ^ 7 / 7) theorem lser_le_log {z : ℝ} (hz : 1 ≤ z) : lser ((z - 1) / (z + 1)) ≤ log z := by diff --git a/LeanPool/Zeta32/FstarPointsRho/Ell.lean b/LeanPool/Zeta32/FstarPointsRho/Ell.lean index faa69501ca..413183c069 100644 --- a/LeanPool/Zeta32/FstarPointsRho/Ell.lean +++ b/LeanPool/Zeta32/FstarPointsRho/Ell.lean @@ -14,7 +14,7 @@ monotonicity in `a` `log_le`/`log_ge'`. Upper bound obtained: `−1.60135`. Data: `tools/b2_numerics.py`. -/ -@[expose] public section +public section open Real namespace Zeta32.Fstar.B2 diff --git a/LeanPool/Zeta32/FstarPointsRho/Points.lean b/LeanPool/Zeta32/FstarPointsRho/Points.lean index 5a8a417223..46ad479605 100644 --- a/LeanPool/Zeta32/FstarPointsRho/Points.lean +++ b/LeanPool/Zeta32/FstarPointsRho/Points.lean @@ -12,7 +12,7 @@ The upstream comments attribute the data (`sl ≤ s ≤ sh`, `P`, `m`) to rational reproduction procedure are documented in `CertificateReproduction.lean`. Each side goal is a small `norm_num` on rationals. `U₁ ≤ 211761/100000`, `U₅ ≥ 266853/50000`. -/ -@[expose] public section +public section open Real namespace Zeta32.Fstar.B2 diff --git a/LeanPool/Zeta32/FstarPointsW.lean b/LeanPool/Zeta32/FstarPointsW.lean index c8cf08dc91..b495a0705b 100644 --- a/LeanPool/Zeta32/FstarPointsW.lean +++ b/LeanPool/Zeta32/FstarPointsW.lean @@ -11,7 +11,7 @@ public import LeanPool.Zeta32.FstarPointsW.MassLog `log 3` lower bound and the 15 lower bounds for `Wt` at `x_k = aMinus·k/16` (index `k : Fin 15` stands for `x_(k+1)`). No `sorry`, no new axioms, no `native_decide`. -/ -@[expose] public section +public section namespace Zeta32.Fstar diff --git a/LeanPool/Zeta32/FstarPointsW/Bounds.lean b/LeanPool/Zeta32/FstarPointsW/Bounds.lean index d7ff9e12ac..2a4f983bb6 100644 --- a/LeanPool/Zeta32/FstarPointsW/Bounds.lean +++ b/LeanPool/Zeta32/FstarPointsW/Bounds.lean @@ -13,7 +13,7 @@ odd Taylor polynomials bracket `arctan` on `[0, ∞)` (monotonicity of the remai `arctan x = π/4 + arctan ((x-1)/(x+1))`, and the Mathlib Taylor remainder bound for `log (1 - u)`. `Wt_ge` turns four atom bounds into a lower bound for `Wt x`. Written from scratch. -/ -@[expose] public section +public section open Real diff --git a/LeanPool/Zeta32/FstarPointsW/MassLog.lean b/LeanPool/Zeta32/FstarPointsW/MassLog.lean index cef8a35c2a..65fa867fe2 100644 --- a/LeanPool/Zeta32/FstarPointsW/MassLog.lean +++ b/LeanPool/Zeta32/FstarPointsW/MassLog.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta32.FstarPointsW.Bounds through rational squares; `massA a = (1 + a + 4√(1+a²) - √(25+a²))/6`, margins ≈ 1.2e-6 and 5.7e-6), and `549/500 < log 3` from `2 log 3 = 3 log 2 + log (1 + 1/8)`. Written from scratch. -/ -@[expose] public section +public section open Real diff --git a/LeanPool/Zeta32/FstarPointsW/Points.lean b/LeanPool/Zeta32/FstarPointsW/Points.lean index 948b8c5f22..1536c05a3d 100644 --- a/LeanPool/Zeta32/FstarPointsW/Points.lean +++ b/LeanPool/Zeta32/FstarPointsW/Points.lean @@ -13,7 +13,7 @@ were attributed upstream to `tools/choose_params.py` and `tools/gen_points.py`. Those scripts are not distributed upstream; see `CertificateReproduction.lean` for the exact inputs and a self-contained rational reproduction procedure. -/ -@[expose] public section +public section open Real diff --git a/LeanPool/Zeta32/Interfaces.lean b/LeanPool/Zeta32/Interfaces.lean index e454f2f37e..328a103b17 100644 --- a/LeanPool/Zeta32/Interfaces.lean +++ b/LeanPool/Zeta32/Interfaces.lean @@ -12,7 +12,7 @@ public import Mathlib.MeasureTheory.Measure.Lebesgue.Basic Arithmetic: `colVal`, `allocCost`, `GreedyBound` (the proof notes, Lemma 4 in allocation form). Analytic: `Rfun`, `wfun`, `heineIntegrand`, `HeineBound` (the proof notes, 5.2 in bound form). -/ -@[expose] public section +public section open Polynomial open scoped BigOperators @@ -22,36 +22,43 @@ noncomputable section /-- Column value `c_b = 4 N_b − C_b + [b = 0] − 2` of the proof notes, §3, with `N_b = #{1 ≤ i ≤ n : i ≡ b}` and `C_b = #{1 ≤ j ≤ 5n : j ≡ b}` modulo `p`. -/ +@[expose] def colVal (n p b : ℕ) : ℤ := 4 * (((Finset.Icc 1 n).filter (fun i => i % p = b)).card : ℤ) - (((Finset.Icc 1 (5*n)).filter (fun j => j % p = b)).card : ℤ) + (if b = 0 then 1 else 0) - 2 /-- Cost of taking the first `k b` entries `c_b, c_b + 2, …` of every column `b < p`. -/ +@[expose] def allocCost (n p : ℕ) (k : ℕ → ℕ) : ℤ := ∑ b ∈ Finset.range p, ((k b : ℤ) * colVal n p b + (k b : ℤ) * ((k b : ℤ) - 1)) /-- the proof notes, Lemma 4 in allocation form: some allocation of the `h = 3n` picks bounds every nonzero coefficient of `Q r n` from below `p`-adically (the greedy allocation does). -/ +@[expose] def GreedyBound (r : ℚ) (n p : ℕ) : Prop := ∃ k : ℕ → ℕ, (∑ b ∈ Finset.range p, k b) = 3*n ∧ ∀ i, (Q r n).coeff i ≠ 0 → ((allocCost n p k : ℤ) : ℚ) ≤ (padicValRat p ((Q r n).coeff i) : ℚ) /-- `R_n(t) = D_n(t)^4 / D_{5n}(t)` as a complex function. -/ +@[expose] def Rfun (n : ℕ) (t : ℂ) : ℂ := (∏ j ∈ Finset.Icc 1 n, (t + j))^4 / ∏ j ∈ Finset.Icc 1 (5*n), (t + j) /-- The kernel `w(y) = (π/2) sech²(πy) (2r − 2πi tanh πy)` of the proof notes, 5.1. -/ +@[expose] def wfun (r : ℚ) (y : ℝ) : ℂ := ((Real.pi / 2 / Real.cosh (Real.pi * y) ^ 2 : ℝ) : ℂ) * (2 * (r : ℂ) - 2 * Real.pi * Complex.I * (Real.tanh (Real.pi * y) : ℂ)) /-- `∏_l |(t R_n)(t_l) w(y_l)| · Δ(y)²` with `t_l = 1/2 + i y_l`, `h = 3n`. -/ +@[expose] def heineIntegrand (r : ℚ) (n : ℕ) (y : Fin (3 * n) → ℝ) : ℝ := (∏ l, ‖((1/2 : ℂ) + Complex.I * (y l)) * Rfun n ((1/2 : ℂ) + Complex.I * (y l)) * wfun r (y l)‖) * ∏ l, ∏ l' ∈ Finset.univ.filter (fun l' => l < l'), (y l - y l') ^ 2 /-- the proof notes, 5.2 (Heine), in the bound form used by 5.3. -/ +@[expose] def HeineBound (r : ℚ) (n : ℕ) : Prop := |Polynomial.aeval (Cr r) (Q r n)| ≤ (1 / ((3*n).factorial : ℝ)) * ∫ y, heineIntegrand r n y diff --git a/LeanPool/Zeta32/PrimeEdge/Auxiliary/ClassBasis.lean b/LeanPool/Zeta32/PrimeEdge/Auxiliary/ClassBasis.lean index bdaf7f0468..ab84f2ab2c 100644 --- a/LeanPool/Zeta32/PrimeEdge/Auxiliary/ClassBasis.lean +++ b/LeanPool/Zeta32/PrimeEdge/Auxiliary/ClassBasis.lean @@ -14,7 +14,7 @@ Apery/Arith/Unimodular.lean in mo271/Zeta5 by Moritz Firsching (https://github.c commit f19a1960609f7d38e7b63fd2acb05e6f60a7b741), Apache-2.0), restated for `Zeta32.Arith.Local.coeffMat`. -/ -@[expose] public section +public section open Finset Polynomial diff --git a/LeanPool/Zeta32/PrimeEdge/Basis.lean b/LeanPool/Zeta32/PrimeEdge/Basis.lean index 5fa03ef208..fa5ec56e31 100644 --- a/LeanPool/Zeta32/PrimeEdge/Basis.lean +++ b/LeanPool/Zeta32/PrimeEdge/Basis.lean @@ -12,7 +12,7 @@ public import LeanPool.Zeta32.PrimeEdge.Auxiliary.ClassBasis each of degree `< h`. On the disc `t = -b + p u` it is `(p u)^i · (p-unit)`, and on every other disc `b'` it carries the factor `(t + b')^{m_{b'}}`. -/ -@[expose] public section +public section open Polynomial open scoped BigOperators @@ -23,11 +23,13 @@ open Zeta32.Arith.Local variable {p : ℕ} /-- The CRT product basis vector `φ_a`. -/ +@[expose] noncomputable def crtBasis (p : ℕ) (a : Idx p) : ℚ[X] := (X + C (a.1.val : ℚ)) ^ a.2.val * ∏ b ∈ (Finset.range p).erase a.1.val, (X + C (b : ℚ)) ^ mult p b /-- The entry numerator `φ_a φ_c D_n^4`, `n = p - 1`. -/ +@[expose] noncomputable def Aent (p : ℕ) (a c : Idx p) : ℚ[X] := crtBasis p a * crtBasis p c * Zeta32.D (p - 1) ^ 4 @@ -36,6 +38,7 @@ noncomputable def idxEquiv (hp : 5 ≤ p) : Fin (3 * (p - 1)) ≃ Idx p := (Fintype.equivFinOfCardEq (card_Idx hp)).symm /-- Determinant of the change of basis from monomials to the CRT basis. -/ +@[expose] noncomputable def basisDet (p : ℕ) (hp : 5 ≤ p) : ℚ := (coeffMat fun i => crtBasis p (idxEquiv hp i)).det diff --git a/LeanPool/Zeta32/PrimeEdge/Blocks.lean b/LeanPool/Zeta32/PrimeEdge/Blocks.lean index 5730b7556e..7d08a2bc36 100644 --- a/LeanPool/Zeta32/PrimeEdge/Blocks.lean +++ b/LeanPool/Zeta32/PrimeEdge/Blocks.lean @@ -14,22 +14,28 @@ r_0)]` with (exact rationals of code/local_blocks_453.py and the FIX table of code/prime_edge_crt453.py). The Hankel entries depend only on `i+k`; the moment sequences are recorded separately. -/ -@[expose] public section +public section namespace Zeta32.PrimeEdge /-- `V⁰(u^e r_L)`, `e = 0, …, 4`. -/ +@[expose] def lowMoment : Fin 5 → ℚ := ![1565/648, -15575/648, 101261/648, -545255/648, 2649929/648] /-- `V⁰(u^e r_H)`, `e = 0, …, 2`. -/ +@[expose] def highMoment : Fin 3 → ℚ := ![-115/8, 481/8, -1731/8] /-- `V⁰(u^e r_0)`, `e = 0, …, 6`. -/ +@[expose] def zeroMoment : Fin 7 → ℚ := ![1/1296, 7/648, 1565/648, -15575/648, 101261/648, -545255/648, 2649929/648] /-- The three-by-three Hankel block formed from the low moments. -/ +@[expose] def lowBlockMatrix : Matrix (Fin 3) (Fin 3) ℚ := fun i k => lowMoment ⟨i.val + k.val, by omega⟩ /-- The two-by-two Hankel block formed from the high moments. -/ +@[expose] def highBlockMatrix : Matrix (Fin 2) (Fin 2) ℚ := fun i k => highMoment ⟨i.val + k.val, by omega⟩ /-- The four-by-four Hankel block formed from the zero moments. -/ +@[expose] def M₀ : Matrix (Fin 4) (Fin 4) ℚ := fun i k => zeroMoment ⟨i.val + k.val, by omega⟩ theorem M_L_eq : lowBlockMatrix = !![1565/648, -15575/648, 101261/648; diff --git a/LeanPool/Zeta32/PrimeEdge/Congruence.lean b/LeanPool/Zeta32/PrimeEdge/Congruence.lean index ad8e8a7e9e..8f76db1b65 100644 --- a/LeanPool/Zeta32/PrimeEdge/Congruence.lean +++ b/LeanPool/Zeta32/PrimeEdge/Congruence.lean @@ -13,7 +13,7 @@ public import LeanPool.Zeta32.PrimeEdge.Valuation congruence `det G ≡ det Ref (mod p^{Σπ+1})`, and the scaled congruence `p^{-Σπ} det(T)^2 · Q_{p-1} ≡ (unit) (mod p)`. No `sorry` in this file. -/ -@[expose] public section +public section open Polynomial open scoped BigOperators diff --git a/LeanPool/Zeta32/PrimeEdge/Disc/Bernoulli.lean b/LeanPool/Zeta32/PrimeEdge/Disc/Bernoulli.lean index 666b4c6d80..ed7b386cd7 100644 --- a/LeanPool/Zeta32/PrimeEdge/Disc/Bernoulli.lean +++ b/LeanPool/Zeta32/PrimeEdge/Disc/Bernoulli.lean @@ -11,7 +11,7 @@ public import LeanPool.Zeta32.Arith.Local.Val `v_p(B'_k) ≥ -1` always, `v_p(B'_k) ≥ 0` unless `k > 0` and `(p - 1) ∣ k`, and the resulting bounds on the local moments `locMoment s e = e B'_{e-1} + 2 s B'_e` for `v_p(s) ≥ 1`. -/ -@[expose] public section +public section open Polynomial open scoped BigOperators diff --git a/LeanPool/Zeta32/PrimeEdge/Disc/Core.lean b/LeanPool/Zeta32/PrimeEdge/Disc/Core.lean index d349333da1..149c0420c5 100644 --- a/LeanPool/Zeta32/PrimeEdge/Disc/Core.lean +++ b/LeanPool/Zeta32/PrimeEdge/Disc/Core.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta32.PrimeEdge.Disc.Factor of `seriesPart` when `dissectNum = p^E u^E R`: the coefficient of `u^e` vanishes for `e < E` and has valuation `≥ e`. -/ -@[expose] public section +public section open Polynomial open scoped BigOperators diff --git a/LeanPool/Zeta32/PrimeEdge/Disc/Factor.lean b/LeanPool/Zeta32/PrimeEdge/Disc/Factor.lean index b77b788a01..69f3f5b7b1 100644 --- a/LeanPool/Zeta32/PrimeEdge/Disc/Factor.lean +++ b/LeanPool/Zeta32/PrimeEdge/Disc/Factor.lean @@ -14,7 +14,7 @@ public import LeanPool.Zeta32.PrimeEdge.Basis depending only on `b`. Also: `farProd` is scaled with unit constant term, and the near sets for `n = p - 1`. -/ -@[expose] public section +public section open Polynomial open scoped BigOperators @@ -25,6 +25,7 @@ open Zeta32.Arith.Local variable {p : ℕ} /-- The CRT basis vector without its own-class factor. -/ +@[expose] noncomputable def crt0 (p b : ℕ) : ℚ[X] := ∏ b' ∈ (Finset.range p).erase b, (X + C (b' : ℚ)) ^ mult p b' @@ -35,6 +36,7 @@ lemma crtBasis_eq (a : Idx p) : noncomputable def B0 (p b : ℕ) : ℚ[X] := crt0 p b * crt0 p b * Zeta32.D (p - 1) ^ 4 /-- Exponent of the own disc. -/ +@[expose] def ownExp (b : ℕ) : ℕ := if b = 0 then 1 else 4 lemma good_crt0 [Fact p.Prime] {d : ℕ} (hd : d < p) (b : ℕ) : diff --git a/LeanPool/Zeta32/PrimeEdge/Disc/LocValue.lean b/LeanPool/Zeta32/PrimeEdge/Disc/LocValue.lean index f97c793ad5..df6ffd031a 100644 --- a/LeanPool/Zeta32/PrimeEdge/Disc/LocValue.lean +++ b/LeanPool/Zeta32/PrimeEdge/Disc/LocValue.lean @@ -12,7 +12,7 @@ public import LeanPool.Zeta32.Arith.Local.PoleFun `M ⊆ {0,…,4}` (`≥ -1` always, `≥ 0` if `e ≤ |M| + 2p - 2`), the `s`-dependence (`≥ 1` if `e ≤ |M| + p - 2`), and removal of a near pole at `0` against a factor `u`. -/ -@[expose] public section +public section open Polynomial open scoped BigOperators diff --git a/LeanPool/Zeta32/PrimeEdge/Disc/Scaled.lean b/LeanPool/Zeta32/PrimeEdge/Disc/Scaled.lean index 07a3fc66f0..a1fea1ca42 100644 --- a/LeanPool/Zeta32/PrimeEdge/Disc/Scaled.lean +++ b/LeanPool/Zeta32/PrimeEdge/Disc/Scaled.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta32.PrimeEdge.Disc.LocValue valuation `≥ e`, i.e. `G(p u)` with `G` integral) and the disc factorization predicate `Good`: `F(p u - d) = p^E u^E R(u)` with `R` scaled and `R(0)` a `p`-adic unit. -/ -@[expose] public section +public section open Polynomial open scoped BigOperators @@ -24,9 +24,11 @@ variable {p : ℕ} def Scaled (p : ℕ) (f : ℚ[X]) : Prop := ∀ e, VG p (f.coeff e) e /-- Coefficientwise valuation lower bound for a power series scaled by its degree. -/ +@[expose] def ScaledPS (p : ℕ) (f : PowerSeries ℚ) : Prop := ∀ e, VG p (PowerSeries.coeff e f) e /-- A nonzero rational of valuation `0`. -/ +@[expose] def IsUnitV (p : ℕ) (q : ℚ) : Prop := q ≠ 0 ∧ padicValRat p q = 0 lemma IsUnitV.mul [Fact p.Prime] {q q' : ℚ} (h : IsUnitV p q) (h' : IsUnitV p q') : @@ -149,6 +151,7 @@ end ScaledPS /-! ### The disc factorization predicate -/ /-- `F(p u - d) = p^E u^E R(u)`, `R` scaled with unit constant term. -/ +@[expose] def Good (p d : ℕ) (F : ℚ[X]) (E : ℕ) : Prop := ∃ R : ℚ[X], F.comp (C (p : ℚ) * X - C (d : ℚ)) = C ((p : ℚ) ^ E) * X ^ E * R ∧ Scaled p R ∧ IsUnitV p (R.coeff 0) diff --git a/LeanPool/Zeta32/PrimeEdge/Dist/Basic.lean b/LeanPool/Zeta32/PrimeEdge/Dist/Basic.lean index abfb647c18..8a4f299c66 100644 --- a/LeanPool/Zeta32/PrimeEdge/Dist/Basic.lean +++ b/LeanPool/Zeta32/PrimeEdge/Dist/Basic.lean @@ -14,7 +14,7 @@ public import LeanPool.Zeta32.Arith.Local.Entry * `pf_nat` : partial fractions over the nodes `-m`, `m ∈ M`; * `locValue_pf` : value of `locValue` on a partial-fraction form. -/ -@[expose] public section +public section open Polynomial open scoped BigOperators @@ -25,6 +25,7 @@ open Zeta32.Arith.Local noncomputable section /-- `∏_{m ∈ M} (X + m)`. -/ +@[expose] def mprod (M : Finset ℕ) : ℚ[X] := ∏ m ∈ M, (X + C (m : ℚ)) lemma mprod_monic (M : Finset ℕ) : (mprod M).Monic := @@ -72,6 +73,7 @@ lemma dist_locValue_sum {ι : Type*} (s : ℚ) (t : Finset ι) (S : ι → ℚ[X exact locValue_sum_linear s t S M /-- Residue of `S / mprod M` at `-m`. -/ +@[expose] def resN (S : ℚ[X]) (M : Finset ℕ) (m : ℕ) : ℚ := S.eval (-(m : ℚ)) / ∏ m' ∈ M.erase m, ((m' : ℚ) - m) diff --git a/LeanPool/Zeta32/PrimeEdge/Dist/Far.lean b/LeanPool/Zeta32/PrimeEdge/Dist/Far.lean index e3f9d0c8ed..c8952c1d5b 100644 --- a/LeanPool/Zeta32/PrimeEdge/Dist/Far.lean +++ b/LeanPool/Zeta32/PrimeEdge/Dist/Far.lean @@ -13,7 +13,7 @@ public import LeanPool.Zeta32.PrimeEdge.Dist.Val * `dl_far` : on the other discs it is far: `dl = V^loc(trunc (near(u) / ((j - b) + p u)))`; * `VG_far` : the far value is `p`-integral (Tate coefficients `v ≥ e`, von Staudt). -/ -@[expose] public section +public section open Polynomial open scoped BigOperators @@ -24,6 +24,7 @@ open Zeta32.Arith.Local noncomputable section /-- `D_S / (t + j)`. -/ +@[expose] def Ej (M : Finset ℕ) (j : ℕ) : ℚ[X] := ∏ m' ∈ M.erase j, (X + C (m' : ℚ)) lemma Ej_mul {M : Finset ℕ} {j : ℕ} (hj : j ∈ M) : Ej M j * (X + C (j : ℚ)) = mprod M := by diff --git a/LeanPool/Zeta32/PrimeEdge/Dist/Global.lean b/LeanPool/Zeta32/PrimeEdge/Dist/Global.lean index 465b96f1ad..0b0b2833ad 100644 --- a/LeanPool/Zeta32/PrimeEdge/Dist/Global.lean +++ b/LeanPool/Zeta32/PrimeEdge/Dist/Global.lean @@ -9,7 +9,7 @@ public import LeanPool.Zeta32.PrimeEdge.Dist.Basic /-! The global side of S2b-1: the `X`-free part of `U_r(A / D_{5n})` is the functional `locValue r` (same formulas, global constants) on `t A / D_{5n}`. -/ -@[expose] public section +public section open Polynomial open scoped BigOperators diff --git a/LeanPool/Zeta32/PrimeEdge/Dist/Mult.lean b/LeanPool/Zeta32/PrimeEdge/Dist/Mult.lean index 5fcea948f2..23e3820aa5 100644 --- a/LeanPool/Zeta32/PrimeEdge/Dist/Mult.lean +++ b/LeanPool/Zeta32/PrimeEdge/Dist/Mult.lean @@ -11,7 +11,7 @@ public import LeanPool.Zeta32.PrimeEdge.Dist.Basic (a shift-invariant linear functional on `ℚ[X]` vanishes). Consequence for `locPoly`: `∑_{b j % p = b)).image (fun j => (j - b) / p) /-- Far factors of `S` on the disc `b`. -/ +@[expose] def farS (p b : ℕ) (S : Finset ℕ) : ℚ[X] := ∏ j ∈ S.filter (fun j => j % p ≠ b), (C ((j : ℚ) - b) + C (p : ℚ) * X) @@ -95,6 +97,7 @@ lemma ps_mul_inv {F : ℚ[X]} (h : F.coeff 0 ≠ 0) : (F : PowerSeries ℚ) * (F PowerSeries.mul_inv_cancel _ (by rwa [Polynomial.constantCoeff_coe]) /-- The truncated local functional on a general numerator `F`. -/ +@[expose] def dl (r : ℚ) (n p b : ℕ) (F : ℚ[X]) : ℚ := (p : ℚ) ^ (-((nearSet n p b).card : ℤ)) * locValue (r * p) (PowerSeries.trunc (truncOrder n) @@ -114,6 +117,7 @@ lemma dl_C_mul (r : ℚ) (n p b : ℕ) (c : ℚ) (F : ℚ[X]) : ring /-- The error of the truncated distribution formula on a numerator `F`. -/ +@[expose] def Err (r : ℚ) (n p : ℕ) (F : ℚ[X]) : ℚ := locValue r F (Finset.Icc 1 (5 * n)) - (p : ℚ) ^ (-2 : ℤ) * ∑ b ∈ Finset.range p, dl r n p b F diff --git a/LeanPool/Zeta32/PrimeEdge/Dist/Val.lean b/LeanPool/Zeta32/PrimeEdge/Dist/Val.lean index 0a15a7eb9d..97f0853c90 100644 --- a/LeanPool/Zeta32/PrimeEdge/Dist/Val.lean +++ b/LeanPool/Zeta32/PrimeEdge/Dist/Val.lean @@ -15,7 +15,7 @@ public import LeanPool.Zeta32.PrimeEdge.Dist.Basic * `VG_locPoly_tate` : `v_p(locPoly s F) ≥ 0` if `v_p(F_e) ≥ e` and `v_p(s) ≥ 1`; * `H_split` : `H_e(j) = p^{-e} H_e(⌊j/p⌋) + ∑_{a ≤ j, p ∤ a} a^{-e}`. -/ -@[expose] public section +public section open Polynomial open scoped BigOperators diff --git a/LeanPool/Zeta32/PrimeEdge/Distribution.lean b/LeanPool/Zeta32/PrimeEdge/Distribution.lean index 6ece1f6208..9e6bb47e28 100644 --- a/LeanPool/Zeta32/PrimeEdge/Distribution.lean +++ b/LeanPool/Zeta32/PrimeEdge/Distribution.lean @@ -30,7 +30,7 @@ proof (files `Dist/*`). No `ℚ_p` constants are needed. Write `p`-integral value (`VG_far`). So the error on one pole has valuation `≥ -2` (`VG_Err_Ej`). * `v_p(c_j) ≥ β + 1` (`VG_res`, and `p ∣ j` when `j` is in the class `0`). -/ -@[expose] public section +public section open Polynomial open scoped BigOperators diff --git a/LeanPool/Zeta32/PrimeEdge/EntryBounds.lean b/LeanPool/Zeta32/PrimeEdge/EntryBounds.lean index a8c0b434d9..c793dc850e 100644 --- a/LeanPool/Zeta32/PrimeEdge/EntryBounds.lean +++ b/LeanPool/Zeta32/PrimeEdge/EntryBounds.lean @@ -15,7 +15,7 @@ mod p)`; the poles of `Lfun` are `-j`, `j ∈ [1, 5n]`, and the class `γ : ZMod p` of the pole `-j` corresponds to the disc `d = (-γ).val = j mod p`. -/ -@[expose] public section +public section open Polynomial open scoped BigOperators diff --git a/LeanPool/Zeta32/PrimeEdge/Gram.lean b/LeanPool/Zeta32/PrimeEdge/Gram.lean index ad55f0ef9c..71abcc7804 100644 --- a/LeanPool/Zeta32/PrimeEdge/Gram.lean +++ b/LeanPool/Zeta32/PrimeEdge/Gram.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta32.PrimeEdge.Basis `det[U_r(φ_a φ_c R_n)] = det(T)^2 · Q_n` for any family of degree `< h` (adapted from `det_basis_change` in Arith/Local/Entry.lean and Li₂ Base/Gram.lean). -/ -@[expose] public section +public section open Polynomial open scoped BigOperators @@ -63,6 +63,7 @@ theorem gram_basis_change (r : ℚ) (n : ℕ) (E : Fin (3 * n) → ℚ[X]) ring /-- The entry matrix `G_{ac} = U_r(φ_a φ_c R_n)` in the CRT basis, `n = p - 1`. -/ +@[expose] noncomputable def G (r : ℚ) (p : ℕ) : Matrix (Idx p) (Idx p) ℚ[X] := Matrix.of fun a c => Lfun r (p - 1) (Aent p a c) diff --git a/LeanPool/Zeta32/PrimeEdge/Index.lean b/LeanPool/Zeta32/PrimeEdge/Index.lean index 3db90285c6..47322257b3 100644 --- a/LeanPool/Zeta32/PrimeEdge/Index.lean +++ b/LeanPool/Zeta32/PrimeEdge/Index.lean @@ -22,30 +22,36 @@ A basis vector is `a = ⟨b, i⟩ : Idx p` with `i < mult p b`; its greedy level `discExp a c d = c_d + kmul a d + kmul c d` is the Lemma 4 exponent of the entry `(a, c)` on disc `d`. -/ -@[expose] public section +public section open scoped BigOperators namespace Zeta32.PrimeEdge /-- Multiplicity `m_b` of the class `b` in the CRT basis. -/ +@[expose] def mult (p b : ℕ) : ℕ := if b = 0 then 4 else if b + 5 ≤ p then 3 else 2 /-- Greedy column base `c_b = s N_b - C_b + [b = 0] - 2` for `n = p - 1`. -/ +@[expose] def colBase (p b : ℕ) : ℤ := if b = 0 then -5 else if b + 5 ≤ p then -3 else -2 /-- Basis index: a class `b` and an order `i < m_b`. -/ abbrev Idx (p : ℕ) := (b : Fin p) × Fin (mult p b.val) /-- Greedy level `π_a = c_b + 2 i`. -/ +@[expose] def level (p : ℕ) (a : Idx p) : ℤ := colBase p a.1.val + 2 * (a.2.val : ℤ) /-- Row/column weight `ρ_a = π_a / 2`. -/ +@[expose] def rho (p : ℕ) (a : Idx p) : ℚ := (level p a : ℚ) / 2 /-- Multiplicity of `(t + d)` in the basis vector `a`. -/ +@[expose] def kmul (p : ℕ) (a : Idx p) (d : ℕ) : ℕ := if a.1.val = d then a.2.val else mult p d /-- Lemma 4 exponent of the entry `(a, c)` on the disc `d`. -/ +@[expose] def discExp (p : ℕ) (a c : Idx p) (d : ℕ) : ℤ := colBase p d + (kmul p a d : ℤ) + (kmul p c d : ℤ) diff --git a/LeanPool/Zeta32/PrimeEdge/Local.lean b/LeanPool/Zeta32/PrimeEdge/Local.lean index af8ac27bed..4eb460bb79 100644 --- a/LeanPool/Zeta32/PrimeEdge/Local.lean +++ b/LeanPool/Zeta32/PrimeEdge/Local.lean @@ -23,7 +23,7 @@ The local functional (the `X`-free part of `V_Y`, Corollary 2) on `S / ∏_{m `V((u+m)^{-1}) = 2 H_m^{(3)} - 2 s H_m^{(2)}` (the `-2Y` part is dropped; `Y ∈ p³ ℤ_p[X]`). `s = r p` gives `V_Y` without `Y`; `s = 0` gives `V⁰`. -/ -@[expose] public section +public section open Polynomial open scoped BigOperators @@ -32,6 +32,7 @@ namespace Zeta32.PrimeEdge noncomputable section /-- Near poles on the disc `b`. -/ +@[expose] def nearSet (n p b : ℕ) : Finset ℕ := ((Finset.Icc 1 (5 * n)).filter (fun j => j % p = b)).image (fun j => (j - b) / p) @@ -39,30 +40,38 @@ def nearSet (n p b : ℕ) : Finset ℕ := def nearProd (n p b : ℕ) : ℚ[X] := ∏ m ∈ nearSet n p b, (X + C (m : ℚ)) /-- Transformed denominator factors outside the residue class selected by `b`. -/ +@[expose] def farProd (n p b : ℕ) : ℚ[X] := ∏ j ∈ (Finset.Icc 1 (5 * n)).filter (fun j => j % p ≠ b), (C ((j : ℚ) - b) + C (p : ℚ) * X) /-- `(t · A)(p u - b)` as a polynomial in `u`. -/ +@[expose] def dissectNum (p b : ℕ) (A : ℚ[X]) : ℚ[X] := (X * A).comp (C (p : ℚ) * X - C (b : ℚ)) /-- Truncation order of the far-pole expansions. -/ +@[expose] def truncOrder (n : ℕ) : ℕ := 10 * n + 2 /-- `dissectNum / farProd`, expanded in `ℚ[[u]]` and truncated to degree `< truncOrder n`. -/ +@[expose] def seriesPart (n p b : ℕ) (A : ℚ[X]) : ℚ[X] := PowerSeries.trunc (truncOrder n) ((dissectNum p b A : PowerSeries ℚ) * (farProd n p b : PowerSeries ℚ)⁻¹) /-- `V(u^e) = e B_{e-1} + 2 s B_e`. -/ +@[expose] def locMoment (s : ℚ) (e : ℕ) : ℚ := (e : ℚ) * bernoulli' (e - 1) + 2 * s * bernoulli' e /-- Linear extension of the local moments to a polynomial. -/ +@[expose] def locPoly (s : ℚ) (P : ℚ[X]) : ℚ := P.sum fun e a => a * locMoment s e /-- `V((u+m)^{-1})` without the `-2Y` part. -/ +@[expose] def locPole (s : ℚ) (m : ℕ) : ℚ := 2 * Zeta32.H 3 m - 2 * s * Zeta32.H 2 m /-- The local functional on `S / ∏_{m ∈ M} (u + m)` (polynomial part plus Lagrange residues). -/ +@[expose] def locValue (s : ℚ) (S : ℚ[X]) (M : Finset ℕ) : ℚ := locPoly s (S /ₘ ∏ m ∈ M, (X + C (m : ℚ))) + ∑ m ∈ M, S.eval (-(m : ℚ)) / (∏ m' ∈ M.erase m, ((m' : ℚ) - m)) * locPole s m @@ -109,12 +118,14 @@ lemma locValue_sum_linear {ι : Type*} (s : ℚ) (t : Finset ι) (S : ι → ℚ /-- `V_Y(g_b)` without the `Y` part, with far poles truncated: `p^{-|near|} V(seriesPart / nearProd)`. -/ +@[expose] def discLocal (r : ℚ) (n p b : ℕ) (A : ℚ[X]) : ℚ := (p : ℚ) ^ (-((nearSet n p b).card : ℤ)) * locValue (r * p) (seriesPart n p b A) (nearSet n p b) /-- `V⁰(u^e r_type)` for the three class types of §6: zero `r_0 = u/((u+1)…(u+4))`, low `r_L = u³/((u+1)…(u+4))`, high `r_H = u³/((u+1)(u+2)(u+3))`. -/ +@[expose] def blockMoment (p b e : ℕ) : ℚ := if b = 0 then locValue 0 (X ^ (e + 1)) {1, 2, 3, 4} else if b + 5 ≤ p then locValue 0 (X ^ (e + 3)) {1, 2, 3, 4} diff --git a/LeanPool/Zeta32/PrimeEdge/LocalShape.lean b/LeanPool/Zeta32/PrimeEdge/LocalShape.lean index d645c63e08..9510526ce2 100644 --- a/LeanPool/Zeta32/PrimeEdge/LocalShape.lean +++ b/LeanPool/Zeta32/PrimeEdge/LocalShape.lean @@ -28,7 +28,7 @@ Lemma 3 for such numerators (`LocValue`, `Bernoulli`: von Staudt). Other disc: ` Own disc: `w_b = K(0)` for `K = R_b / farProd`; subtracting `p^E K(0) u^E` leaves a numerator vanishing to order `E + 1`, and `V_{rp}(u^E) ≡ V⁰(u^E) mod p` (degree `E ≤ |near| + p - 2`). -/ -@[expose] public section +public section open Polynomial open scoped BigOperators diff --git a/LeanPool/Zeta32/PrimeEdge/Reduction.lean b/LeanPool/Zeta32/PrimeEdge/Reduction.lean index 1c286ba35b..244b5e4953 100644 --- a/LeanPool/Zeta32/PrimeEdge/Reduction.lean +++ b/LeanPool/Zeta32/PrimeEdge/Reduction.lean @@ -9,7 +9,7 @@ public import LeanPool.Zeta32.PrimeEdge.Congruence /-! the proof notes, §6 Proposition 6. `exceptional` is defined in `Zeta32.PrimeEdge.Reference` (same name, same value). the proof is the S5 assembly (primitive reduction). -/ -@[expose] public section +public section namespace Zeta32.PrimeEdge open Polynomial Zeta32.Arith.Local diff --git a/LeanPool/Zeta32/PrimeEdge/Reference.lean b/LeanPool/Zeta32/PrimeEdge/Reference.lean index 93f8f8547e..cfbe5daaa7 100644 --- a/LeanPool/Zeta32/PrimeEdge/Reference.lean +++ b/LeanPool/Zeta32/PrimeEdge/Reference.lean @@ -12,7 +12,7 @@ public import Mathlib.Tactic.NormNum.Prime its determinant `p^{Σπ} · (unit)`. Blocks: `Ref_{⟨b,i⟩,⟨b,k⟩} = p^{c_b+i+k} w_b V⁰(u^{i+k} r_type)`. -/ -@[expose] public section +public section open Polynomial open scoped BigOperators @@ -26,6 +26,7 @@ variable {p : ℕ} def exceptional : Finset ℕ := {11, 67, 193, 283, 367, 110731} /-- The reference matrix for unit weights `w`. -/ +@[expose] noncomputable def Ref (p : ℕ) (w : ℕ → ℚ) : Matrix (Idx p) (Idx p) ℚ[X] := Matrix.of fun a c => if a.1 = c.1 then C ((p : ℚ) ^ (colBase p a.1.val + a.2.val + c.2.val) * w a.1.val * @@ -40,6 +41,7 @@ noncomputable def refUnit (p : ℕ) (w : ℕ → ℚ) : ℚ := ∏ b : Fin p, (w b.val ^ mult p b.val * hankelDet p b) /-- `Σ π` as an integer. -/ +@[expose] def levelSum (p : ℕ) : ℤ := ∑ a : Idx p, level p a /-- **S3a (block diagonal determinant).** Scaling rows by `p^{c_b+i}` and columns by `p^k` diff --git a/LeanPool/Zeta32/PrimeEdge/V0Table.lean b/LeanPool/Zeta32/PrimeEdge/V0Table.lean index 08441ccc73..1b99b947a3 100644 --- a/LeanPool/Zeta32/PrimeEdge/V0Table.lean +++ b/LeanPool/Zeta32/PrimeEdge/V0Table.lean @@ -14,7 +14,7 @@ polynomial division by `(u+1)…(u+4)` resp. `(u+1)(u+2)(u+3)`, Lagrange residue B_{e-1}` and `V⁰((u+m)^{-1}) = 2 H_m^{(3)}`. -/ -@[expose] public section +public section open Polynomial open scoped BigOperators diff --git a/LeanPool/Zeta32/PrimeEdge/Valuation.lean b/LeanPool/Zeta32/PrimeEdge/Valuation.lean index 38cd2941fe..123292b0fa 100644 --- a/LeanPool/Zeta32/PrimeEdge/Valuation.lean +++ b/LeanPool/Zeta32/PrimeEdge/Valuation.lean @@ -11,7 +11,7 @@ public import Mathlib.RingTheory.Polynomial.Content Adapted from Li2Unified/Modular/Base/DetCongruence.lean and PrimitiveReduction.lean (li2-light-certs-2026-09-29/repo-simplify), restated for `Zeta32.Arith.Local.VG/GV`. -/ -@[expose] public section +public section open Polynomial open scoped BigOperators diff --git a/LeanPool/Zeta32/PrimeObstruction.lean b/LeanPool/Zeta32/PrimeObstruction.lean index 5522695585..546b15702b 100644 --- a/LeanPool/Zeta32/PrimeObstruction.lean +++ b/LeanPool/Zeta32/PrimeObstruction.lean @@ -9,7 +9,7 @@ public import LeanPool.Zeta32.Criterion /-! Adapted from the Li₂ light-certificate project and mo271/Zeta5; see NOTICE. -/ -@[expose] public section +public section open Polynomial namespace Zeta32 diff --git a/LeanPool/Zeta32/Results.lean b/LeanPool/Zeta32/Results.lean index 37649da981..5764670a8a 100644 --- a/LeanPool/Zeta32/Results.lean +++ b/LeanPool/Zeta32/Results.lean @@ -8,7 +8,7 @@ public import LeanPool.Zeta32.Final /-! Zeta32 — Results. -/ -@[expose] public section +public section namespace Zeta32Acceptance 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 83c335462b..72ff3e633d 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 b211c23722..8cd7ee470a 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 8c76800076..bcef08f819 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 c93a2ae379..3851759b32 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 1ec94ab292..d00f47962c 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 44f6cdfe3a..c7601bdbca 100644 --- a/LeanPool/Zeta5Irrational/Andreief.lean +++ b/LeanPool/Zeta5Irrational/Andreief.lean @@ -18,7 +18,7 @@ The real proof is from mo271/Zeta5 by Moritz Firsching; the scalar generalizatio is from Qian Tang's Zeta32 development, with its full attribution in `LeanPool/Zeta32.lean`. -/ -@[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 84505c12dc..73dcac7459 100644 --- a/LeanPool/Zeta5Irrational/Arith/BasisChange.lean +++ b/LeanPool/Zeta5Irrational/Arith/BasisChange.lean @@ -20,7 +20,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 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/CoefficientMatrix.lean b/LeanPool/Zeta5Irrational/Arith/CoefficientMatrix.lean index 6b7ddcc2a4..a6758444ad 100644 --- a/LeanPool/Zeta5Irrational/Arith/CoefficientMatrix.lean +++ b/LeanPool/Zeta5Irrational/Arith/CoefficientMatrix.lean @@ -13,14 +13,14 @@ public import Mathlib.Data.Matrix.Basic The coefficient matrix and its expansion are shared by the Zeta5 and Zeta32 changes of polynomial basis. -/ -@[expose] public section +public section open Finset Polynomial namespace Zeta5Irrational /-- 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/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 4bfb2d215a..6110c5b932 100644 --- a/LeanPool/Zeta5Irrational/Arith/PoleFun.lean +++ b/LeanPool/Zeta5Irrational/Arith/PoleFun.lean @@ -24,18 +24,18 @@ 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 /-- 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) 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 9ae7ed9736..2e81555ccc 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 8fd6678b10..1d2bd649bd 100644 --- a/LeanPool/Zeta5Irrational/Criterion.lean +++ b/LeanPool/Zeta5Irrational/Criterion.lean @@ -31,7 +31,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..2c90180876 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), @@ -70,7 +70,7 @@ def aInL : List ℚ := (891 / 40), (931 / 40), (401 / 20), (189 / 10)] /-- Rational intercepts of the 125 inner-range linear pieces. -/ -def bInL : List ℚ := +@[expose] def bInL : List ℚ := [(-6), (-5 / 2), (-35 / 2), (-17), (-13), (-33 / 2), (-9 / 2), (-23 / 2), (-7), (-11), (-31), (-26), (-61 / 2), (-31 / 2), (-10), (-19), (-24), (-18), (-43), (-97 / 2), (-61 / 2), (-24), (-35), (-41), (-34), (-64), (-141 / 2), (-99 / 2), (-42), (-50), (-42), (-49), (-62), @@ -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..366e8f6879 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,25 +885,25 @@ 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)] /-- Rational intercepts of the 13 outer-range linear pieces. -/ -def bOutL : List ℚ := +@[expose] 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/SimplePoles.lean b/LeanPool/Zeta5Irrational/SimplePoles.lean index 22a5bb340e..e50d53aef4 100644 --- a/LeanPool/Zeta5Irrational/SimplePoles.lean +++ b/LeanPool/Zeta5Irrational/SimplePoles.lean @@ -11,14 +11,14 @@ public import Mathlib.LinearAlgebra.Lagrange This generic API is shared by the Zeta5 and Zeta32 arithmetic and contour proofs. -/ -@[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 := @@ -31,11 +31,11 @@ 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) lemma lagrange_basis_eq (Pl : Finset ℤ) (r : ℤ) : 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