diff --git a/frontiers/cap_first_exit_lean_20261002/ALIGNMENT.md b/frontiers/cap_first_exit_lean_20261002/ALIGNMENT.md index 394f4bf91..a190fdd82 100644 --- a/frontiers/cap_first_exit_lean_20261002/ALIGNMENT.md +++ b/frontiers/cap_first_exit_lean_20261002/ALIGNMENT.md @@ -4,7 +4,7 @@ | Source | Path | Role | |---|---|---| -| SP | `reviews/d1_cap_elder_partner_second_pass_claude_20260930/REVIEW.md` | the line-numbered reconstruction of CAP §§2–5. L13, L16, L17 and L19–L22 are proved here. L7, L11, L12 and L18 enter `ridge_capHyp` as hypotheses. | +| SP | `reviews/d1_cap_elder_partner_second_pass_claude_20260930/REVIEW.md` | the line-numbered reconstruction of CAP §§2–5. L13, L16, L17 and L19–L22 are proved here. Since v1.5, L1, L2, L5, L7 (maximum and uniqueness), L8, L11's chain rule and L18 are also proved, from SP's normalization and L4's output (`ridge_capHyp_normalized`, `ridge_capHyp_sp`, `ridge_capHyp_of_slices`). Inputs that remain: L3–L4's derivation of `δ`, L7's existence and regularity of `h`, and L12. | | CAP | `imports/lifetime_parent_20260925/MARKED_CYLINDER_CAP_PROOF.md` | the deterministic theorem that SP reconstructs | The source setting (SP §2) is as follows: @@ -51,6 +51,20 @@ The source setting (SP §2) is as follows: | `ridge_profile` | on `D = [-2r, 2r]`: `g' = F`, `F(-r/2) = F(r/2) = 0`, `ConvexOn D (F - (x + r/2)(x - r/2)/8)` ⇒ `g ≤ g(-r/2)` on `[-2r, r/2]`; `g(r/2) ≤ g` on `[-r/2, 2r]`; `g(-2r) ≤ g(-r/2) - 9r³/32`; `g(r/2) + 9r³/32 ≤ g(2r)` | SP L13 (sign pattern), L16 (ceiling along the ridge), L17 (both exact integrals `9r³/32`), L20 (ridge minimum) | SP states L12 as `F'' − 1/4 > 0`; Lean takes the weaker convexity of `F − q`. L17's integrals come from comparing `g` with `Q = x³/24 − r²x/32`, `Q' = q`. | | `ridge_capHyp` | `CapHyp f C M z b s`, with `C = Icc (-2r) (r/2) ×ˢ closedBall 0 (2r)`, `M = (-r/2, h(-r/2))`, `z = (2r, h(2r))`, `b = g(-r/2)`, `s = g(r/2)` | SP L16, L17, L19, L20 | Hypotheses, all local as in SP: `hT` = L7's `f(x, y) ≤ g(x)` on `C`; `hg` = L11 on `[-2r, 2r]`; `hh` = continuity of `h` on `[-r/2, 2r]`; `hFa`, `hFc` = critical pins; `hconv` = L12 on `[-2r, 2r]`; `hside` = L18 (non-strict suffices); `hM` (`h(a) = 0` in SP); `hgap` (SP: `r³/6 < 9r³/32`). The ridge path does not need to stay in `C`. | | `ridge_saddle_strict` | under `hTs` (the unique transverse maximizer, L7) and a strict `hside`, every frontier point other than `S = (r/2, h(r/2))` has `f < s` | SP L19, "only `S` attains it" | The left face is strict through `hgap`; the right face is strict through uniqueness. | +| `strongConcave_le_of_hasFDerivAt` | `StrongConcaveOn K δ φ`, `p ∈ K`, `HasFDerivAt φ L p`, `y ∈ K` ⇒ `φ y ≤ φ p + L (y - p) - δ/2 ‖y - p‖²` | SP L7 ("strong concavity about the maximizer"), L8, L18 | The engine of the slice rows. `p` need not be interior: only the segment from `p` to `y` is used. Mathlib's `StrongConcaveOn K δ` is uniform concavity with modulus `δ/2 · r²`. In an inner product space it is equivalent to the concavity of `φ + δ/2 ‖·‖²` (Mathlib's `strongConcaveOn_iff_convex`), i.e. SP's `D_y² f ≤ -δ I`. | +| `slice_le` | `L = 0`: `φ y ≤ φ p - δ/2 ‖y - p‖²` | SP L7 (unique transverse maximizer), L16 (`f(x, y) ≤ g(x)`), L19 (`f(c, y) ≤ s - (δ/2)‖y‖²`) | With `δ > 0`, equality only at `y = p`. | +| `slice_ridge_bound` | `0, p ∈ K`, `p` critical, `w` = derivative at `0` ⇒ `δ ‖p‖ ≤ ‖w‖` | SP L8 (`‖h‖ ≤ ‖w‖/δ`) | Two applications of the engine replace SP's strong-monotonicity step. Needs no sign of `δ`. | +| `slice_curved` | on `sphere 0 R`: `φ y < s`, given `p ∈ B̄(0, R)` critical, `‖w‖ ≤ ω ≤ Rδ`, `φ p ≤ b` and `2δ(b - s) < (Rδ - ω)²` | SP L18 (`R = 2r`) | SP: `f ≤ g(x) - (δ/2)‖y - h‖²`, `‖y - h‖ ≥ 2r - ‖h‖`, `‖h‖ ≤ ‖w‖/δ`. Since `(δ/2)(2r - ω/δ)² = (2rδ - ω)²/(2δ)`, the stated condition is exactly SP's comparison, written without division. | +| `slice_hasFDerivAt`, `ridge_hasDerivAt` | the slice's derivative is `D ∘ inr`; if `D ∘ inr = 0` at `(x, h x)` and `h` has derivative `h'`, then `g = f(·, h ·)` has derivative `D (1, 0)` | SP L11 (`F := g' = f_x(x, h(x))`; "the `∇_y f · h'` term vanishes on the ridge") | `D (1, 0)` is `f_x` at `(x, h x)`. | +| `ridge_inputs_of_joint` | joint derivatives `D x` along the ridge, `HasDerivAt h (h' x) x` and `D x ∘ inr = 0` on `[-2r, 2r]` ⇒ `hh`, `hg` with `F x = D x (1, 0)`, and the slice critical points `hcrit` on `[-2r, r/2]` | SP L7 (the ridge equation `∇_y f(x, h(x)) = 0`, `h ∈ C³`), L11 | Differentiability of `h` is L7's implicit-function output. Only first derivatives are used. | +| `ridge_capHyp_of_slices` | the conclusions of `ridge_capHyp` and `ridge_saddle_strict`, with `hT`, `hTs`, `hside` and `hM` replaced by: `hconc` (each slice `δ`-strongly concave on `B̄(0, 2r)` for `x ∈ [-2r, r/2]`, `δ > 0`), `hball` and `hcrit` (`h x ∈ B̄(0, 2r)` is a critical point of its slice), `hw` and `hω` (the slice derivative `w x` at `0` has `‖w x‖ ≤ ω`), `hωr` (`ω ≤ 2rδ`) and `hcurv` (`2δ(b - s) < (2rδ - ω)²`) | SP L4 (`hconc`), L5 (`hω`), L7, L8, L16, L18, L19 | SP takes strong concavity for `x ∈ [-2r, 2r]`; Lean needs it only on the cap's `x`-range. `w x` is a continuous linear functional; with `E` Euclidean, its operator norm is SP's `‖∇_y f(x, 0)‖`. | +| `convexOn_add_node`, `two_node_bound` | `u + (m/2)t²` convex and `u − (m/2)t²` concave on `D`, `u(a) = u(c) = 0` with `a < c` in `D` ⇒ `|u x| ≤ (m/2)|(x − a)(x − c)|` for every `x ∈ D` | SP L5 (two-node interpolation remainder, "valid outside the pin interval too") | The convexity pair is the weak form of `|u''| ≤ m`. Proved by comparing `±u + (m/2)(t − a)(t − c)` with the `convex_zeros_*` lemmas, with no mean-value point `ξ`. | +| `slice_gradient_bound` | for `w : ℝ → E →L[ℝ] ℝ` vanishing at `a < c`, with the convexity pair for each `t ↦ w t v` at modulus `m‖v‖`: `‖w x‖ ≤ (m/2)|(x − a)(x − c)|` on `D` | SP L5 (`‖w(x)‖ ≤ (m/2)|x² − r²/4|`, with `‖w''‖ ≤ m`) | SP takes `e = w(x)/‖w(x)‖`; Lean bounds every `w x v` and uses `opNorm_le_bound`. With `E` Euclidean this is the same norm. | +| `ridge_capHyp_sp` | the conclusions of `ridge_capHyp_of_slices` under `m ≥ 2`, `δ > rm(8m − 5)`, `hconc`, `hball`, `hcrit`, `h(∓r/2) = 0`, `hw`, the convexity pair for `w` on `[−2r, r/2]`, `hh`, `hg`, `hFa`, `hFc`, `hconv` and `b − s ≤ r³/6` | SP §2 normalization (`b − s = r³/6`), L2, L4, L5, L7, L8, L11, L12, L16–L20 | `w(∓r/2) = 0` follows from `h(∓r/2) = 0` and uniqueness of the derivative. `‖w‖ ≤ 2mr²` follows from `slice_gradient_bound`, since `|x² − r²/4| ≤ 4r²` on the cap; `hωr` and `hcurv` then follow from `sp_curved_side_constants`. | +| `hermite_gap_le` | `g' = G` on `[a, c]`, `G(a) = G(c) = 0`, the convexity pair for `G` at modulus `m` ⇒ `g(a) − g(c) ≤ m(c − a)³/12` | SP L1 (`g_0(c) − g_0(a) = −(1/2)∫ φ g_0'''`, `∫ φ = r³/6`) | No integral: `two_node_bound` gives `G ≥ −(m/2)(t − a)(c − t)`, so `g + (m/2)Φ` with `Φ' = (t − a)(c − t)` is monotone, and `Φ(c) = (c − a)³/6`. The pair is the weak form of `|g_0'''| ≤ m`. | +| `hermite_m_ge_two` | on `[−r/2, r/2]`, `g(−r/2) − g(r/2) = r³/6` ⇒ `2 ≤ m` | SP L2 (`m ≥ 2`) | SP's `φ`-weighted average of `f_xxx` is exactly 2, so `m ≥ 2`. Lean proves this inequality, not the average identity, and does not need L2's second statement (a point with `f_xxx = 2`). | +| `ridge_capHyp_normalized` | the conclusions of `ridge_capHyp_sp`, with `hm` replaced by: `g_0 = f(·, 0)` has derivative `G0` on `[−r/2, r/2]`, `G0(∓r/2) = 0`, the convexity pair for `G0` at modulus `m`, and the gap exactly `r³/6` | SP §2 normalization, L1, L2, then as `ridge_capHyp_sp` | `G0(∓r/2) = 0` are the critical pins along `y = 0`. `h(∓r/2) = 0` identifies `b − s` with `g_0(−r/2) − g_0(r/2)`. | +| `sp_curved_side_constants` | `r > 0`, `m ≥ 2`, `δ > r m (8m - 5)`, `0 ≤ ω ≤ 2 m r²` ⇒ `ω ≤ 2rδ` and `2δ · r³/6 < (2rδ - ω)²` | SP L2 (`m ≥ 2`), L4 (`δ > rmk`, `k = 8m - 5`), L5 (`‖w‖ ≤ (15/8) m r² < 2 m r²`), L18 (`4400r³/121 > r³/6`) | So SP's own constants meet `hωr` and `hcurv` at SP's gap `b - s = r³/6`. | | `CapHyp.congr` | from `g = f` on `closure C` and along one ridge `γ₀`, `CapHyp g C M z b s` | the audit's exterior-invariance corollary (Math-#193 deliverable 2) | `closure C ⊇ C ∪ frontier C`. In SP, `C` is closed. | ## 3. Non-vacuity and necessity, proved in Lean @@ -78,6 +92,10 @@ Each necessity theorem is one conjunction, so it certifies its own premises, not `ridgeToy_capHyp` and `ridgeToy_saddle_strict` instantiate `ridge_capHyp` and `ridge_saddle_strict` at SP's normalization, with `r = 1`, `E = ℝ`, `f(x, y) = x³/3 − x/4 − y²`, `h = 0` and `F = x² − 1/4`. The gap there is exactly `r³/6`, so all ridge hypotheses are jointly satisfiable. +`ridgeToy_joint` and `ridgeToy_slices` run the same toy through the slice route (v1.5). The joint derivative along `y = 0` is `D x = (x² − 1/4) · dx`, its transverse part vanishes, and each slice `y ↦ x³/3 − x/4 − y²` is `2`-strongly concave. With `w = 0`, `ω = 0` and `δ = 2`, the curvature condition reads `2/3 < 16`. Every input of `ridge_inputs_of_joint` and `ridge_capHyp_of_slices` is therefore jointly satisfiable, and the two theorems re-derive (C1)–(C3) and (C2⁺). + +The ridge toy has `δ = 2`, below SP's `δ > rm(8m − 5) = 22`. So `spToyF (x, y) = x³/3 − x/4 − 12y²` is added: there `m = 2` (`f_xxx = 2`), `δ = 24`, `w = 0` and the gap is exactly `r³/6`. `spToy_capHyp` shows that every hypothesis of `ridge_capHyp_sp` holds there, so SP's normalized hypotheses are jointly satisfiable. `spToy_normalized` does the same for `ridge_capHyp_normalized`, with `G0 = x² − 1/4`, `|G0''| = 2 = m` and gap exactly `1/6`. + The toy lives on `ℝ`, which is not compact. So the older-peak theorems (`older_peak`, `elder_death_level_peak`) have no concrete instance exhibited in Lean. Their extra hypotheses (compact, locally connected, continuous `f`) hold on the torus. @@ -91,7 +109,7 @@ illustrates the hypotheses; it is not a model of the planar cap. |---|---|---|---| | I1 | Coordinates: SP's cap is `[-2r, r/2] × B̄(0, 2r)` in a frame `φ` of the periodic lift, and SP's "boundary" is the topological frontier. The transport to the torus (`CapHyp.toTorus`) and the face list (`frontier_cylinder`) are proved; the transport needs no embedding radius | SP §2 | Only the identification of SP's objects with these Lean objects remains. | | I2 | Persistence bookkeeping: in H0 superlevel persistence with distinct critical values, the class born at a local maximum `M` dies at the largest level at which its component contains a strictly higher local maximum (the elder rule) | SP L22, P §8 | This is the definition of the elder pairing. On a compact, locally connected space, Lean proves that this level is `s` (`elder_death_level_peak`). Only the identification of the persistence module's pairing with that definition is informal. | -| I3 | The multi-variable analytic steps L1–L12 and L18, which supply `hT`, `hTs`, `hg`, `hFa`, `hFc`, `hconv`, `hside` and `hgap` of `ridge_capHyp` from `G_r` | SP L1–L12, L18; CAP §§2–5 | Hermite identity, increments, strong concavity, implicit function theorem, ridge identity, `F''` bound and curved-side estimate, with exact constants checked by SP's script, not in Lean. L13, L16, L17, L19 and L20 are proved in Lean from these outputs. | +| I3 | The analytic steps that produce the inputs of `ridge_capHyp_normalized` from `G_r`: L3–L4 (increments, and the transverse Hessian bound giving `δ > rmk` in `hconc`); `m` as a bound on the third derivatives, which gives the convexity pairs for `G0 = ∂_x f(·, 0)` (L1's input `|g_0'''| ≤ m`) and for `w` (L5's input `‖w''‖ ≤ m`); the critical pins `G0(∓r/2) = 0` and `h(∓r/2) = 0`; L6 (the `w'` bound); L7's existence of the transverse maximizer `h(x)` in the ball and the implicit-function regularity of `h`; and L9–L12 (`‖h'‖` and the `F''` bound giving `hconv`) | SP L3, L4, L6, L7, L9–L12; CAP §§2–5 | These are checked with exact constants by SP's script, not in Lean. Since v1.5, Lean proves L1, L2, L5, L7's maximum and uniqueness, L8, L11's chain rule and L18 from those outputs, and checks SP's constants in the curvature step. L13, L16, L17, L19 and L20 were already proved in v1.4. | | I4 | Theorem A, measurability, `Q^W(G_r^c) ≤ C r³` | P §§7–8, C1, G1 | probability | ## 5. Review contract @@ -106,5 +124,7 @@ names: For each row of §§1–2, the record gives ALIGNED, MISALIGNED (with the corrected statement), or NOT ASSESSED. For each row of §4, it says whether the interface is stated correctly. -A changed Lean source, toolchain or pin makes an earlier review stale. A same-provider read, including any Claude +A changed Lean source, toolchain or pin makes an earlier review stale. + +v1.5 is additive: it inserts the sections `Slice` and the slice-route toy, and updates the file's header comment. The 53 v1.4 declarations and their statements are unchanged, as the diff against v1.4 shows. The v1.4 alignment review ([5396110365](https://github.com/d6g8k5htny-coder/Math-/pull/246#pullrequestreview-5396110365), `ALIGNED_SCOPED`) therefore still covers the v1.4 rows once a reviewer confirms by diff that they are unchanged. A delta review assesses the new rows: the fourteen slice rows of §2, the v1.5 toy paragraphs of §3 and the revised I3. A same-provider read, including any Claude read, gives zero independence credit. A build or merge is not an alignment review. diff --git a/frontiers/cap_first_exit_lean_20261002/CapFirstExit.lean b/frontiers/cap_first_exit_lean_20261002/CapFirstExit.lean index a5dd14bae..9d3453191 100644 --- a/frontiers/cap_first_exit_lean_20261002/CapFirstExit.lean +++ b/frontiers/cap_first_exit_lean_20261002/CapFirstExit.lean @@ -16,9 +16,11 @@ is one instance. Only the older-peak theorems add compactness, local connectedness and continuity of `f`, all of which hold on the torus. - What this file does NOT formalize: the multi-variable analytic steps L1–L12 and L18 (they enter - `ridge_capHyp` as hypotheses; L13, L16, L17, L19 and L20 are proved from them); the - identification of the H0 persistence pairing with the elder rule (L22, P §8); the + What this file does NOT formalize: the analytic steps L3, L4 and L6, the existence and + implicit-function regularity of the transverse maximizer `h`, and L9–L12 (they enter + `ridge_capHyp_normalized`, `ridge_capHyp_of_slices` and `ridge_inputs_of_joint` as hypotheses; + L1, L2, L5, L7's maximum and uniqueness, L8, L11's chain rule, L13 and L16–L20 are proved from + them); the identification of the H0 persistence pairing with the elder rule (L22, P §8); the unstable-branch analysis (L23); and every probabilistic statement. -/ import Mathlib @@ -669,6 +671,416 @@ theorem ridge_saddle_strict {f : ℝ × E → ℝ} {h : ℝ → E} {F : ℝ → end Ridge +/-! ### The transverse slices (L7, L8, L11, L18) + +`ridge_capHyp` takes the transverse maximum (`hT`), its uniqueness (`hTs`), the curved side +(`hside`) and the ridge equation `g' = F` as inputs. SP derives them deterministically from L4 +(each slice `y ↦ f (x, y)` is `δ`-strongly concave on `B̄(0, 2r)`), L5 (the transverse derivative +`w x` at `y = 0` has norm at most `ω`) and the ridge equation `∂_y f (x, h x) = 0`. This section +proves those derivations. -/ + +section Slice + +open Filter Topology + +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + +/-- **Strong concavity about a point with a derivative (the engine of L7, L8, L18).** If `φ` is +`δ`-strongly concave on `K`, `p ∈ K`, and `φ` has derivative `L` at `p`, then +`φ y ≤ φ p + L (y - p) - (δ/2)‖y - p‖²` for every `y ∈ K`. `p` need not be interior: only the +segment from `p` to `y`, which lies in `K`, is used. -/ +theorem strongConcave_le_of_hasFDerivAt {K : Set E} {φ : E → ℝ} {δ : ℝ} {p : E} + {L : E →L[ℝ] ℝ} (hφ : StrongConcaveOn K δ φ) (hp : p ∈ K) (hd : HasFDerivAt φ L p) {y : E} + (hy : y ∈ K) : φ y ≤ φ p + L (y - p) - δ / 2 * ‖y - p‖ ^ 2 := by + set v := y - p with hv + have h1 : HasDerivAt (fun t : ℝ => p + t • v) v 0 := by + simpa using ((hasDerivAt_id (0 : ℝ)).smul_const v).const_add p + have h2 : HasFDerivAt φ L (p + (0 : ℝ) • v) := by simpa using hd + have hline : HasDerivAt (fun t : ℝ => φ (p + t • v)) (L v) 0 := h2.comp_hasDerivAt (0 : ℝ) h1 + have hslope := hline.tendsto_slope_zero_right + have hbound : ∀ᶠ t in 𝓝[>] (0 : ℝ), + φ y - φ p + (1 - t) * (δ / 2 * ‖v‖ ^ 2) ≤ + t⁻¹ • (φ (p + (0 + t) • v) - φ (p + (0 : ℝ) • v)) := by + have hlt : ∀ᶠ t in 𝓝[>] (0 : ℝ), t < 1 := + nhdsWithin_le_nhds (Iio_mem_nhds one_pos) + filter_upwards [self_mem_nhdsWithin, hlt] with t (ht0 : 0 < t) ht1 + have key := hφ.2 hp hy (by linarith : (0 : ℝ) ≤ 1 - t) ht0.le (by ring : 1 - t + t = 1) + have hpt : (1 - t) • p + t • y = p + t • v := by + simp only [hv, smul_sub, sub_smul, one_smul]; abel + have hnorm : ‖p - y‖ = ‖v‖ := by rw [hv, norm_sub_rev] + rw [hpt, hnorm, smul_eq_mul, smul_eq_mul] at key + simp only [zero_smul, add_zero, zero_add, smul_eq_mul] + rw [le_inv_mul_iff₀ ht0] + nlinarith [key] + have hlim : Tendsto (fun t : ℝ => φ y - φ p + (1 - t) * (δ / 2 * ‖v‖ ^ 2)) (𝓝[>] 0) + (𝓝 (φ y - φ p + (1 - 0) * (δ / 2 * ‖v‖ ^ 2))) := + ((continuous_const.add ((continuous_const.sub continuous_id).mul continuous_const)).tendsto + 0).mono_left nhdsWithin_le_nhds + have := le_of_tendsto_of_tendsto hlim hslope hbound + simp only [sub_zero, one_mul] at this + linarith + +/-- **L7 (the transverse maximum).** At a critical point `p` of a `δ`-strongly concave slice, +`φ y ≤ φ p - (δ/2)‖y - p‖²` on `K`. With `δ > 0` the maximizer is unique. -/ +theorem slice_le {K : Set E} {φ : E → ℝ} {δ : ℝ} {p : E} + (hφ : StrongConcaveOn K δ φ) (hp : p ∈ K) (hd : HasFDerivAt φ (0 : E →L[ℝ] ℝ) p) + {y : E} (hy : y ∈ K) : φ y ≤ φ p - δ / 2 * ‖y - p‖ ^ 2 := by + simpa using strongConcave_le_of_hasFDerivAt hφ hp hd hy + +/-- **L8 (the ridge bound).** If `0, p ∈ K`, `p` is critical and `w` is the derivative at `0`, +then `δ ‖p‖ ≤ ‖w‖`, i.e. `‖h(x)‖ ≤ ‖w(x)‖/δ`. -/ +theorem slice_ridge_bound {K : Set E} {φ : E → ℝ} {δ : ℝ} {p : E} {w : E →L[ℝ] ℝ} + (hφ : StrongConcaveOn K δ φ) (h0 : (0 : E) ∈ K) (hp : p ∈ K) + (hd : HasFDerivAt φ (0 : E →L[ℝ] ℝ) p) (hw : HasFDerivAt φ w 0) : δ * ‖p‖ ≤ ‖w‖ := by + have h1 := slice_le hφ hp hd h0 + have h2 := strongConcave_le_of_hasFDerivAt hφ h0 hw hp + simp only [zero_sub, norm_neg, sub_zero] at h1 h2 + have h3 : w p ≤ ‖w‖ * ‖p‖ := + (le_abs_self _).trans (by simpa [Real.norm_eq_abs] using w.le_opNorm p) + have h4 : δ * ‖p‖ * ‖p‖ ≤ ‖w‖ * ‖p‖ := by nlinarith + rcases (norm_nonneg p).eq_or_lt with h | h + · rw [← h, mul_zero]; exact norm_nonneg w + · exact le_of_mul_le_mul_right h4 h + +/-- **L18 (the curved side).** On the sphere of radius `R`, the slice is strictly below `s` +once `φ p ≤ b`, `‖w‖ ≤ ω ≤ Rδ` and `2δ(b - s) < (Rδ - ω)²`. -/ +theorem slice_curved {φ : E → ℝ} {δ ω R b s : ℝ} {p : E} {w : E →L[ℝ] ℝ} + (hφ : StrongConcaveOn (Metric.closedBall (0 : E) R) δ φ) (hδ : 0 < δ) + (hp : p ∈ Metric.closedBall (0 : E) R) (hd : HasFDerivAt φ (0 : E →L[ℝ] ℝ) p) + (hw : HasFDerivAt φ w 0) (hω : ‖w‖ ≤ ω) (hωR : ω ≤ R * δ) (hb : φ p ≤ b) + (hcurv : 2 * δ * (b - s) < (R * δ - ω) ^ 2) {y : E} (hy : y ∈ Metric.sphere (0 : E) R) : + φ y < s := by + have hyn : ‖y‖ = R := mem_sphere_zero_iff_norm.mp hy + have hR : 0 ≤ R := hyn ▸ norm_nonneg y + have h0 : (0 : E) ∈ Metric.closedBall (0 : E) R := Metric.mem_closedBall_self hR + have hL8 := slice_ridge_bound hφ h0 hp hd hw + have hL7 := slice_le hφ hp hd (Metric.sphere_subset_closedBall hy) + have htri : R - ‖p‖ ≤ ‖y - p‖ := by have := norm_sub_norm_le y p; linarith + have hρ : R * δ - ω ≤ δ * ‖y - p‖ := by nlinarith + have hsq : (R * δ - ω) ^ 2 ≤ (δ * ‖y - p‖) ^ 2 := pow_le_pow_left₀ (by linarith) hρ 2 + have h5 : δ * (2 * (b - s)) < δ * (δ * ‖y - p‖ ^ 2) := by nlinarith + have h6 : 2 * (b - s) < δ * ‖y - p‖ ^ 2 := lt_of_mul_lt_mul_left h5 hδ.le + linarith + +/-- The derivative of a slice `y ↦ f (x, y)` is the joint derivative restricted to the +transverse directions. -/ +theorem slice_hasFDerivAt {f : ℝ × E → ℝ} {x : ℝ} {y : E} {D : ℝ × E →L[ℝ] ℝ} + (hf : HasFDerivAt f D (x, y)) : + HasFDerivAt (fun y' => f (x, y')) (D.comp (ContinuousLinearMap.inr ℝ ℝ E)) y := + hf.comp y (hasFDerivAt_prodMk_right x y) + +/-- **L11 (the ridge function's derivative).** If `f` has joint derivative `D` at `(x, h x)`, +`h` has derivative `h'` at `x`, and the transverse part of `D` vanishes (the ridge equation +`∂_y f = 0`), then `g = f (·, h ·)` has derivative `F x = D (1, 0) = ∂_x f (x, h x)`: the +`∂_y f · h'` term drops out. -/ +theorem ridge_hasDerivAt {f : ℝ × E → ℝ} {h : ℝ → E} {x : ℝ} {D : ℝ × E →L[ℝ] ℝ} {h' : E} + (hf : HasFDerivAt f D (x, h x)) (hh : HasDerivAt h h' x) + (hy : D.comp (ContinuousLinearMap.inr ℝ ℝ E) = 0) : + HasDerivAt (fun t => f (t, h t)) (D (1, 0)) x := by + have hp : HasDerivAt (fun t => (t, h t)) ((1 : ℝ), h') x := (hasDerivAt_id x).prodMk hh + have hc := hf.comp_hasDerivAt x hp + have h0 : D (0, h') = 0 := by + simpa using congrArg (fun L : E →L[ℝ] ℝ => L h') hy + have hD : D (1, h') = D (1, 0) := by + calc D (1, h') = D ((1, 0) + (0, h')) := by simp + _ = D (1, 0) + D (0, h') := map_add _ _ _ + _ = D (1, 0) := by rw [h0, add_zero] + rw [← hD] + exact hc + +/-- **(C1)–(C3) and (C2⁺) from the slices.** `ridge_capHyp` and `ridge_saddle_strict` with +`hT`, `hTs`, `hside` and `hM` derived (L7, L8, L18) from L4 (`hconc`), the critical points +`h x ∈ B̄(0, 2r)` (`hball`, `hcrit`; L7's existence part), L5 (`hw`, `hω`) and the curvature +condition `2δ(b - s) < (2rδ - ω)²`, which SP's constants satisfy (`sp_curved_side_constants`). -/ +theorem ridge_capHyp_of_slices {f : ℝ × E → ℝ} {h : ℝ → E} {F : ℝ → ℝ} {w : ℝ → E →L[ℝ] ℝ} + {r δ ω : ℝ} (hr : 0 < r) (hδ : 0 < δ) + (hh : ContinuousOn h (Icc (-r / 2) (2 * r))) + (hg : ∀ x ∈ Icc (-2 * r) (2 * r), HasDerivAt (fun x => f (x, h x)) (F x) x) + (hFa : F (-r / 2) = 0) (hFc : F (r / 2) = 0) + (hconv : ConvexOn ℝ (Icc (-2 * r) (2 * r)) (fun x => F x - (x + r / 2) * (x - r / 2) / 8)) + (hconc : ∀ x ∈ Icc (-2 * r) (r / 2), + StrongConcaveOn (Metric.closedBall (0 : E) (2 * r)) δ (fun y => f (x, y))) + (hball : ∀ x ∈ Icc (-2 * r) (r / 2), h x ∈ Metric.closedBall (0 : E) (2 * r)) + (hcrit : ∀ x ∈ Icc (-2 * r) (r / 2), + HasFDerivAt (fun y => f (x, y)) (0 : E →L[ℝ] ℝ) (h x)) + (hw : ∀ x ∈ Icc (-2 * r) (r / 2), HasFDerivAt (fun y => f (x, y)) (w x) (0 : E)) + (hω : ∀ x ∈ Icc (-2 * r) (r / 2), ‖w x‖ ≤ ω) (hωr : ω ≤ 2 * r * δ) + (hcurv : 2 * δ * (f (-r / 2, h (-r / 2)) - f (r / 2, h (r / 2))) < (2 * r * δ - ω) ^ 2) + (hgap : f (-r / 2, h (-r / 2)) - f (r / 2, h (r / 2)) < 9 * r ^ 3 / 32) : + CapHyp f (Icc (-2 * r) (r / 2) ×ˢ Metric.closedBall (0 : E) (2 * r)) (-r / 2, h (-r / 2)) + (2 * r, h (2 * r)) (f (-r / 2, h (-r / 2))) (f (r / 2, h (r / 2))) ∧ + ∀ x ∈ frontier (Icc (-2 * r) (r / 2) ×ˢ Metric.closedBall (0 : E) (2 * r)), + x ≠ (r / 2, h (r / 2)) → f x < f (r / 2, h (r / 2)) := by + obtain ⟨hceil, -, -, -⟩ := ridge_profile hr hg hFa hFc hconv + have hT : ∀ p ∈ Icc (-2 * r) (r / 2) ×ˢ Metric.closedBall (0 : E) (2 * r), + f p ≤ f (p.1, h p.1) := by + rintro ⟨x, y⟩ ⟨hx, hy⟩ + have h1 := slice_le (hconc x hx) (hball x hx) (hcrit x hx) hy + have h2 : 0 ≤ δ / 2 * ‖y - h x‖ ^ 2 := by positivity + simp only at h1 ⊢ + linarith + have hTs : ∀ p ∈ Icc (-2 * r) (r / 2) ×ˢ Metric.closedBall (0 : E) (2 * r), p.2 ≠ h p.1 → + f p < f (p.1, h p.1) := by + rintro ⟨x, y⟩ ⟨hx, hy⟩ hne + have h1 := slice_le (hconc x hx) (hball x hx) (hcrit x hx) hy + have h2 : 0 < ‖y - h x‖ := norm_pos_iff.mpr (sub_ne_zero.mpr hne) + have h3 : 0 < δ / 2 * ‖y - h x‖ ^ 2 := mul_pos (by linarith) (pow_pos h2 2) + simp only at h1 ⊢ + linarith + have hside : ∀ p ∈ Icc (-2 * r) (r / 2) ×ˢ Metric.sphere (0 : E) (2 * r), + f p < f (r / 2, h (r / 2)) := by + rintro ⟨x, y⟩ ⟨hx, hy⟩ + exact slice_curved (hconc x hx) hδ (hball x hx) (hcrit x hx) (hw x hx) (hω x hx) hωr + (hceil x hx) hcurv hy + have hM : ‖h (-r / 2)‖ ≤ 2 * r := by + simpa using hball (-r / 2) ⟨by linarith, by linarith⟩ + exact ⟨ridge_capHyp hr hh hg hFa hFc hconv hT (fun p hp => (hside p hp).le) hM hgap, + ridge_saddle_strict hr hg hFa hFc hconv hT hTs hside hgap⟩ + +/-- **The joint form (L7, L11).** From a joint derivative `D x` of `f` along the ridge, a +differentiable `h` and the ridge equation `(D x) ∘ inr = 0`, the inputs `hh`, `hg` (with +`F x = D x (1, 0)`) and `hcrit` of `ridge_capHyp_of_slices` follow. -/ +theorem ridge_inputs_of_joint {f : ℝ × E → ℝ} {h h' : ℝ → E} {D : ℝ → ℝ × E →L[ℝ] ℝ} {r : ℝ} + (hr : 0 < r) (hD : ∀ x ∈ Icc (-2 * r) (2 * r), HasFDerivAt f (D x) (x, h x)) + (hh' : ∀ x ∈ Icc (-2 * r) (2 * r), HasDerivAt h (h' x) x) + (hridge : ∀ x ∈ Icc (-2 * r) (2 * r), (D x).comp (ContinuousLinearMap.inr ℝ ℝ E) = 0) : + ContinuousOn h (Icc (-r / 2) (2 * r)) ∧ + (∀ x ∈ Icc (-2 * r) (2 * r), HasDerivAt (fun x => f (x, h x)) (D x (1, 0)) x) ∧ + ∀ x ∈ Icc (-2 * r) (r / 2), HasFDerivAt (fun y => f (x, y)) (0 : E →L[ℝ] ℝ) (h x) := by + refine ⟨fun x hx => ?_, fun x hx => ridge_hasDerivAt (hD x hx) (hh' x hx) (hridge x hx), + fun x hx => ?_⟩ + · exact (hh' x ⟨by linarith [hx.1], hx.2⟩).continuousAt.continuousWithinAt + · have hx' : x ∈ Icc (-2 * r) (2 * r) := ⟨hx.1, by linarith [hx.2]⟩ + simpa [hridge x hx'] using slice_hasFDerivAt (hD x hx') + +/-- **SP's constants satisfy the curvature condition (L4, L5, L18).** With `m ≥ 2`, +`δ > r m (8m - 5)` (L4, `k = 8m - 5`), `0 ≤ ω ≤ 2 m r²` (L5) and SP's gap `b - s = r³/6`: +`ω ≤ 2rδ` and `2δ · r³/6 < (2rδ - ω)²`. -/ +theorem sp_curved_side_constants {r m δ ω : ℝ} (hr : 0 < r) (hm : 2 ≤ m) + (hδ : r * m * (8 * m - 5) < δ) (hω0 : 0 ≤ ω) (hω : ω ≤ 2 * m * r ^ 2) : + ω ≤ 2 * r * δ ∧ 2 * δ * (r ^ 3 / 6) < (2 * r * δ - ω) ^ 2 := by + have hk : 11 ≤ 8 * m - 5 := by linarith + have hrm : 0 < r * m := by positivity + have h11 : 11 * (r * m) < δ := by nlinarith + have h22 : 22 * r < δ := by nlinarith + have hωδ : 11 * ω < 2 * r * δ := by nlinarith + have hpos : 20 * r * δ < 11 * (2 * r * δ - ω) := by nlinarith + refine ⟨by linarith, ?_⟩ + have hsq : (20 * r * δ) ^ 2 < (11 * (2 * r * δ - ω)) ^ 2 := + pow_lt_pow_left₀ hpos (by have hδ0 : 0 < δ := by linarith + positivity) two_ne_zero + nlinarith [hsq] + +/-- Adding the affine function `(m/2)((t - a)(t - c) - t²)` preserves convexity. -/ +theorem convexOn_add_node {u : ℝ → ℝ} {D : Set ℝ} {a c m : ℝ} + (hcv : ConvexOn ℝ D (fun t => u t + m / 2 * t ^ 2)) : + ConvexOn ℝ D (fun t => u t + m / 2 * ((t - a) * (t - c))) := by + refine ⟨hcv.1, fun x hx y hy p q hp hq hpq => ?_⟩ + have h := hcv.2 hx hy hp hq hpq + simp only [smul_eq_mul] at h ⊢ + have key : (u (p * x + q * y) + m / 2 * ((p * x + q * y - a) * (p * x + q * y - c))) - + (p * (u x + m / 2 * ((x - a) * (x - c))) + q * (u y + m / 2 * ((y - a) * (y - c)))) = + (u (p * x + q * y) + m / 2 * (p * x + q * y) ^ 2) - + (p * (u x + m / 2 * x ^ 2) + q * (u y + m / 2 * y ^ 2)) := by + have hq' : q = 1 - p := by linarith + subst hq' + ring + linarith + +/-- **L5 (two-node interpolation), scalar form.** If `u + (m/2) t²` is convex and `u - (m/2) t²` is +concave on `D` (the weak form of `|u''| ≤ m`) and `u` vanishes at `a < c` in `D`, then +`|u x| ≤ (m/2) |(x - a)(x - c)|` for every `x ∈ D`, inside or outside `[a, c]`. -/ +theorem two_node_bound {u : ℝ → ℝ} {D : Set ℝ} {a c m : ℝ} + (hcv : ConvexOn ℝ D (fun t => u t + m / 2 * t ^ 2)) + (hcc : ConcaveOn ℝ D (fun t => u t - m / 2 * t ^ 2)) + (haD : a ∈ D) (hcD : c ∈ D) (hac : a < c) (ha : u a = 0) (hc : u c = 0) {x : ℝ} + (hx : x ∈ D) : |u x| ≤ m / 2 * |(x - a) * (x - c)| := by + have hψ := convexOn_add_node (a := a) (c := c) hcv + have hcv' : ConvexOn ℝ D (fun t => -u t + m / 2 * t ^ 2) := + hcc.neg.congr fun t _ => by simp only [Pi.neg_apply]; ring + have hχ := convexOn_add_node (a := a) (c := c) hcv' + have hψa : u a + m / 2 * ((a - a) * (a - c)) = 0 := by rw [ha]; ring + have hψc : u c + m / 2 * ((c - a) * (c - c)) = 0 := by rw [hc]; ring + have hχa : -u a + m / 2 * ((a - a) * (a - c)) = 0 := by rw [ha]; ring + have hχc : -u c + m / 2 * ((c - a) * (c - c)) = 0 := by rw [hc]; ring + rcases le_or_gt x a with hxa | hxa + · have h1 := convex_zeros_left hψ hcD hac hψa hψc hx hxa + have h2 := convex_zeros_left hχ hcD hac hχa hχc hx hxa + have hP : 0 ≤ (x - a) * (x - c) := mul_nonneg_of_nonpos_of_nonpos (by linarith) (by linarith) + rw [abs_of_nonneg hP, abs_le] + constructor <;> linarith + rcases le_or_gt c x with hcx | hcx + · have h1 := convex_zeros_right hψ haD hac hψa hψc hx hcx + have h2 := convex_zeros_right hχ haD hac hχa hχc hx hcx + have hP : 0 ≤ (x - a) * (x - c) := mul_nonneg (by linarith) (by linarith) + rw [abs_of_nonneg hP, abs_le] + constructor <;> linarith + · have h1 := convex_zeros_between hψ haD hcD hac.le hψa hψc ⟨hxa.le, hcx.le⟩ + have h2 := convex_zeros_between hχ haD hcD hac.le hχa hχc ⟨hxa.le, hcx.le⟩ + have hP : (x - a) * (x - c) ≤ 0 := mul_nonpos_of_nonneg_of_nonpos (by linarith) (by linarith) + rw [abs_of_nonpos hP, abs_le] + constructor <;> linarith + +/-- **L5 (the transverse gradient at `y = 0`).** If the slice derivatives `w t` at `y = 0` vanish at +the pins `a < c` and, for every direction `v`, `t ↦ w t v` has second derivative bounded by +`m ‖v‖` in the weak form below, then `‖w x‖ ≤ (m/2) |(x - a)(x - c)|` on `D`. -/ +theorem slice_gradient_bound {w : ℝ → E →L[ℝ] ℝ} {D : Set ℝ} {a c m : ℝ} (hm : 0 ≤ m) + (hcv : ∀ v : E, ConvexOn ℝ D (fun t => w t v + m * ‖v‖ / 2 * t ^ 2)) + (hcc : ∀ v : E, ConcaveOn ℝ D (fun t => w t v - m * ‖v‖ / 2 * t ^ 2)) + (haD : a ∈ D) (hcD : c ∈ D) (hac : a < c) (ha : w a = 0) (hc : w c = 0) {x : ℝ} + (hx : x ∈ D) : ‖w x‖ ≤ m / 2 * |(x - a) * (x - c)| := by + refine ContinuousLinearMap.opNorm_le_bound _ (by positivity) fun v => ?_ + have h := two_node_bound (u := fun t => w t v) (m := m * ‖v‖) (hcv v) (hcc v) haD hcD hac + (by simp [ha]) (by simp [hc]) hx + rw [Real.norm_eq_abs] + calc |w x v| ≤ m * ‖v‖ / 2 * |(x - a) * (x - c)| := h + _ = m / 2 * |(x - a) * (x - c)| * ‖v‖ := by ring + +/-- **The cap from SP's normalized hypotheses (L2, L4, L5, L7, L11, L12).** With `m ≥ 2` (L2), +slices `δ`-strongly concave for some `δ > r m (8m - 5)` (L4), slice derivatives at `y = 0` with +second `x`-derivative bounded by `m` in the weak form (L5), critical points `h x` with +`h(∓r/2) = 0` (L7) and the gap `b - s ≤ r³/6`, the conclusions of `ridge_capHyp_of_slices` hold. +`hω`, `hωr` and `hcurv` are derived: `‖w‖ ≤ 2 m r²` (`slice_gradient_bound`) and +`sp_curved_side_constants`. -/ +theorem ridge_capHyp_sp {f : ℝ × E → ℝ} {h : ℝ → E} {F : ℝ → ℝ} {w : ℝ → E →L[ℝ] ℝ} + {r m δ : ℝ} (hr : 0 < r) (hm : 2 ≤ m) (hδ : r * m * (8 * m - 5) < δ) + (hh : ContinuousOn h (Icc (-r / 2) (2 * r))) + (hg : ∀ x ∈ Icc (-2 * r) (2 * r), HasDerivAt (fun x => f (x, h x)) (F x) x) + (hFa : F (-r / 2) = 0) (hFc : F (r / 2) = 0) + (hconv : ConvexOn ℝ (Icc (-2 * r) (2 * r)) (fun x => F x - (x + r / 2) * (x - r / 2) / 8)) + (hconc : ∀ x ∈ Icc (-2 * r) (r / 2), + StrongConcaveOn (Metric.closedBall (0 : E) (2 * r)) δ (fun y => f (x, y))) + (hball : ∀ x ∈ Icc (-2 * r) (r / 2), h x ∈ Metric.closedBall (0 : E) (2 * r)) + (hcrit : ∀ x ∈ Icc (-2 * r) (r / 2), + HasFDerivAt (fun y => f (x, y)) (0 : E →L[ℝ] ℝ) (h x)) + (hha : h (-r / 2) = 0) (hhc : h (r / 2) = 0) + (hw : ∀ x ∈ Icc (-2 * r) (r / 2), HasFDerivAt (fun y => f (x, y)) (w x) (0 : E)) + (hwcv : ∀ v : E, ConvexOn ℝ (Icc (-2 * r) (r / 2)) (fun t => w t v + m * ‖v‖ / 2 * t ^ 2)) + (hwcc : ∀ v : E, ConcaveOn ℝ (Icc (-2 * r) (r / 2)) (fun t => w t v - m * ‖v‖ / 2 * t ^ 2)) + (hgap : f (-r / 2, h (-r / 2)) - f (r / 2, h (r / 2)) ≤ r ^ 3 / 6) : + CapHyp f (Icc (-2 * r) (r / 2) ×ˢ Metric.closedBall (0 : E) (2 * r)) (-r / 2, h (-r / 2)) + (2 * r, h (2 * r)) (f (-r / 2, h (-r / 2))) (f (r / 2, h (r / 2))) ∧ + ∀ x ∈ frontier (Icc (-2 * r) (r / 2) ×ˢ Metric.closedBall (0 : E) (2 * r)), + x ≠ (r / 2, h (r / 2)) → f x < f (r / 2, h (r / 2)) := by + have hm0 : 0 ≤ m := by linarith + have hδ0 : 0 < δ := by + have : 0 < r * m * (8 * m - 5) := by + have : 0 < 8 * m - 5 := by linarith + positivity + linarith + have ha : -r / 2 ∈ Icc (-2 * r) (r / 2) := ⟨by linarith, by linarith⟩ + have hc : r / 2 ∈ Icc (-2 * r) (r / 2) := ⟨by linarith, le_rfl⟩ + have hwa : w (-r / 2) = 0 := (hw _ ha).unique (by simpa [hha] using hcrit _ ha) + have hwc : w (r / 2) = 0 := (hw _ hc).unique (by simpa [hhc] using hcrit _ hc) + have hω : ∀ x ∈ Icc (-2 * r) (r / 2), ‖w x‖ ≤ 2 * m * r ^ 2 := by + intro x hx + have h1 := slice_gradient_bound hm0 hwcv hwcc ha hc (by linarith) hwa hwc hx + have h2 : |(x - -r / 2) * (x - r / 2)| ≤ 4 * r ^ 2 := by + rw [abs_le] + constructor <;> nlinarith [hx.1, hx.2] + calc ‖w x‖ ≤ m / 2 * |(x - -r / 2) * (x - r / 2)| := h1 + _ ≤ m / 2 * (4 * r ^ 2) := by gcongr + _ = 2 * m * r ^ 2 := by ring + obtain ⟨hωr, hcurv⟩ := sp_curved_side_constants hr hm hδ (by positivity) le_rfl + refine ridge_capHyp_of_slices hr hδ0 hh hg hFa hFc hconv hconc hball hcrit hw hω hωr ?_ ?_ + · calc 2 * δ * (f (-r / 2, h (-r / 2)) - f (r / 2, h (r / 2))) ≤ 2 * δ * (r ^ 3 / 6) := by + gcongr + _ < _ := hcurv + · have : r ^ 3 / 6 < 9 * r ^ 3 / 32 := by + have : 0 < r ^ 3 := by positivity + linarith + linarith + +/-- **L1 (the Hermite identity, as a bound).** If `g' = G` on `[a, c]`, `G` vanishes at both ends +(the pins are critical) and `|G''| ≤ m` in the weak form, then `g(a) - g(c) ≤ m (c - a)³/12`. +SP's identity `g(c) - g(a) = -(1/2)∫ φ g'''` with `∫ φ = (c - a)³/6` gives the same bound; here it +comes from `two_node_bound` and monotonicity of `g + (m/2)Φ`, `Φ' = (t - a)(c - t)`. -/ +theorem hermite_gap_le {g G : ℝ → ℝ} {a c m : ℝ} (hac : a < c) + (hg : ∀ x ∈ Icc a c, HasDerivAt g (G x) x) + (hcv : ConvexOn ℝ (Icc a c) (fun t => G t + m / 2 * t ^ 2)) + (hcc : ConcaveOn ℝ (Icc a c) (fun t => G t - m / 2 * t ^ 2)) + (hGa : G a = 0) (hGc : G c = 0) : + g a - g c ≤ m * (c - a) ^ 3 / 12 := by + have hpoly : ∀ x, HasDerivAt (fun t => (c - a) * (t - a) ^ 2 / 2 - (t - a) ^ 3 / 3) + ((x - a) * (c - x)) x := by + intro x + have h1 : HasDerivAt (fun t => t - a) 1 x := (hasDerivAt_id x).sub_const a + have h2 := ((h1.pow 2).const_mul (c - a)).div_const 2 + have h3 := (h1.pow 3).div_const 3 + convert h2.sub h3 using 1 + push_cast + ring + set k : ℝ → ℝ := fun t => g t + m / 2 * ((c - a) * (t - a) ^ 2 / 2 - (t - a) ^ 3 / 3) + with hk + have hkd : ∀ x ∈ Icc a c, HasDerivAt k (G x + m / 2 * ((x - a) * (c - x))) x := + fun x hx => (hg x hx).add ((hpoly x).const_mul (m / 2)) + have hmono : MonotoneOn k (Icc a c) := by + refine monotoneOn_of_hasDerivWithinAt_nonneg (convex_Icc a c) + (fun x hx => (hkd x hx).continuousAt.continuousWithinAt) + (fun x hx => (hkd x (interior_subset hx)).hasDerivWithinAt) (fun x hx => ?_) + have hx := interior_subset hx + have hb := two_node_bound hcv hcc (left_mem_Icc.mpr hac.le) (right_mem_Icc.mpr hac.le) hac + hGa hGc hx + have hP : (x - a) * (x - c) ≤ 0 := + mul_nonpos_of_nonneg_of_nonpos (by linarith [hx.1]) (by linarith [hx.2]) + rw [abs_of_nonpos hP] at hb + have := (abs_le.mp hb).1 + nlinarith + have hkac := hmono (left_mem_Icc.mpr hac.le) (right_mem_Icc.mpr hac.le) hac.le + simp only [hk] at hkac + have e0 : m / 2 * ((c - a) * (a - a) ^ 2 / 2 - (a - a) ^ 3 / 3) = 0 := by ring + have e1 : m / 2 * ((c - a) * (c - a) ^ 2 / 2 - (c - a) ^ 3 / 3) = m * (c - a) ^ 3 / 12 := by + ring + linarith + +/-- **L2 (`m ≥ 2`).** Under SP's normalization `g(-r/2) - g(r/2) = r³/6` on the pin interval, the +weak bound `|g'''| ≤ m` forces `m ≥ 2`. -/ +theorem hermite_m_ge_two {g G : ℝ → ℝ} {r m : ℝ} (hr : 0 < r) + (hg : ∀ x ∈ Icc (-r / 2) (r / 2), HasDerivAt g (G x) x) + (hcv : ConvexOn ℝ (Icc (-r / 2) (r / 2)) (fun t => G t + m / 2 * t ^ 2)) + (hcc : ConcaveOn ℝ (Icc (-r / 2) (r / 2)) (fun t => G t - m / 2 * t ^ 2)) + (hGa : G (-r / 2) = 0) (hGc : G (r / 2) = 0) (hgap : g (-r / 2) - g (r / 2) = r ^ 3 / 6) : + 2 ≤ m := by + have h := hermite_gap_le (by linarith) hg hcv hcc hGa hGc + have hcr : r / 2 - -r / 2 = r := by ring + rw [hgap, hcr] at h + have hr3 : 0 < r ^ 3 := by positivity + nlinarith + +/-- **The cap from SP's normalization (L1, L2 and the rest of `ridge_capHyp_sp`).** As +`ridge_capHyp_sp`, with `m ≥ 2` derived instead of assumed: `g0 = f(·, 0)` has derivative `G0` +vanishing at the pins with `|G0''| ≤ m` (weak form), and the gap is exactly `r³/6`. -/ +theorem ridge_capHyp_normalized {f : ℝ × E → ℝ} {h : ℝ → E} {F G0 : ℝ → ℝ} + {w : ℝ → E →L[ℝ] ℝ} {r m δ : ℝ} (hr : 0 < r) + (hg0 : ∀ x ∈ Icc (-r / 2) (r / 2), HasDerivAt (fun x => f (x, 0)) (G0 x) x) + (hG0cv : ConvexOn ℝ (Icc (-r / 2) (r / 2)) (fun t => G0 t + m / 2 * t ^ 2)) + (hG0cc : ConcaveOn ℝ (Icc (-r / 2) (r / 2)) (fun t => G0 t - m / 2 * t ^ 2)) + (hG0a : G0 (-r / 2) = 0) (hG0c : G0 (r / 2) = 0) + (hδ : r * m * (8 * m - 5) < δ) + (hh : ContinuousOn h (Icc (-r / 2) (2 * r))) + (hg : ∀ x ∈ Icc (-2 * r) (2 * r), HasDerivAt (fun x => f (x, h x)) (F x) x) + (hFa : F (-r / 2) = 0) (hFc : F (r / 2) = 0) + (hconv : ConvexOn ℝ (Icc (-2 * r) (2 * r)) (fun x => F x - (x + r / 2) * (x - r / 2) / 8)) + (hconc : ∀ x ∈ Icc (-2 * r) (r / 2), + StrongConcaveOn (Metric.closedBall (0 : E) (2 * r)) δ (fun y => f (x, y))) + (hball : ∀ x ∈ Icc (-2 * r) (r / 2), h x ∈ Metric.closedBall (0 : E) (2 * r)) + (hcrit : ∀ x ∈ Icc (-2 * r) (r / 2), + HasFDerivAt (fun y => f (x, y)) (0 : E →L[ℝ] ℝ) (h x)) + (hha : h (-r / 2) = 0) (hhc : h (r / 2) = 0) + (hw : ∀ x ∈ Icc (-2 * r) (r / 2), HasFDerivAt (fun y => f (x, y)) (w x) (0 : E)) + (hwcv : ∀ v : E, ConvexOn ℝ (Icc (-2 * r) (r / 2)) (fun t => w t v + m * ‖v‖ / 2 * t ^ 2)) + (hwcc : ∀ v : E, ConcaveOn ℝ (Icc (-2 * r) (r / 2)) (fun t => w t v - m * ‖v‖ / 2 * t ^ 2)) + (hnorm : f (-r / 2, h (-r / 2)) - f (r / 2, h (r / 2)) = r ^ 3 / 6) : + CapHyp f (Icc (-2 * r) (r / 2) ×ˢ Metric.closedBall (0 : E) (2 * r)) (-r / 2, h (-r / 2)) + (2 * r, h (2 * r)) (f (-r / 2, h (-r / 2))) (f (r / 2, h (r / 2))) ∧ + ∀ x ∈ frontier (Icc (-2 * r) (r / 2) ×ˢ Metric.closedBall (0 : E) (2 * r)), + x ≠ (r / 2, h (r / 2)) → f x < f (r / 2, h (r / 2)) := by + have hm : 2 ≤ m := hermite_m_ge_two hr hg0 hG0cv hG0cc hG0a hG0c (by simpa [hha, hhc] using hnorm) + exact ridge_capHyp_sp hr hm hδ hh hg hFa hFc hconv hconc hball hcrit hha hhc hw hwcv hwcc + hnorm.le + +end Slice + /-! ### A concrete instance and the necessity of each hypothesis On `ℝ`, `toyF x = max (-|x|) (x - 2)` has a local maximum `M = 0` at height `b = 0`, a @@ -877,4 +1289,203 @@ theorem ridgeToy_saddle_strict : · simp only [ridgeToyF] norm_num +/-! ### The ridge toy through the slice route -/ + +/-- The ridge toy's joint derivative along the ridge `y = 0` is `D x = (x² - 1/4) · dx`. Its +transverse part vanishes (the ridge equation), and `D x (1, 0) = x² - 1/4 = F x`. -/ +theorem ridgeToy_joint (x : ℝ) : + HasFDerivAt ridgeToyF ((x ^ 2 - 1 / 4) • ContinuousLinearMap.fst ℝ ℝ ℝ) (x, 0) ∧ + ((x ^ 2 - 1 / 4) • ContinuousLinearMap.fst ℝ ℝ ℝ).comp (ContinuousLinearMap.inr ℝ ℝ ℝ) = + 0 ∧ + ((x ^ 2 - 1 / 4) • ContinuousLinearMap.fst ℝ ℝ ℝ) (1, 0) = x ^ 2 - 1 / 4 := by + refine ⟨?_, by ext; simp, by simp⟩ + have hu : HasDerivAt (fun t : ℝ => t ^ 3 / 3 - t / 4) (x ^ 2 - 1 / 4) x := by + have h1 := ((hasDerivAt_pow 3 x).div_const 3).sub ((hasDerivAt_id x).div_const 4) + convert h1 using 1 + · funext t; simp + · push_cast; ring + have hv : HasDerivAt (fun t : ℝ => t ^ 2) 0 (0 : ℝ) := by + simpa using hasDerivAt_pow 2 (0 : ℝ) + have h1 := hu.comp_hasFDerivAt ((x, (0 : ℝ)) : ℝ × ℝ) (hasFDerivAt_fst (𝕜 := ℝ)) + have h2 := hv.comp_hasFDerivAt ((x, (0 : ℝ)) : ℝ × ℝ) (hasFDerivAt_snd (𝕜 := ℝ)) + convert h1.sub h2 using 1 + · funext p; simp [ridgeToyF] + · simp + +/-- **The slice route is jointly satisfiable.** The ridge toy (`r = 1`, `h = 0`) meets every +input of `ridge_inputs_of_joint` and `ridge_capHyp_of_slices`, with `δ = 2` (each slice is +`-y²` plus a constant), `w = 0`, `ω = 0`, and the curvature condition +`2δ(b - s) = 2/3 < 16 = (2rδ - ω)²`. The combined theorems re-derive (C1)–(C3) and (C2⁺). -/ +theorem ridgeToy_slices : + CapHyp ridgeToyF (Icc (-2 * 1) (1 / 2) ×ˢ Metric.closedBall (0 : ℝ) (2 * 1)) (-1 / 2, 0) + (2 * 1, 0) (ridgeToyF (-1 / 2, 0)) (ridgeToyF (1 / 2, 0)) ∧ + ∀ x ∈ frontier (Icc (-2 * 1) (1 / 2) ×ˢ Metric.closedBall (0 : ℝ) (2 * 1)), + x ≠ (1 / 2, 0) → ridgeToyF x < ridgeToyF (1 / 2, 0) := by + obtain ⟨hh, hg, hcrit⟩ := ridge_inputs_of_joint (E := ℝ) (f := ridgeToyF) + (h := fun _ => (0 : ℝ)) (h' := fun _ => (0 : ℝ)) + (D := fun x => (x ^ 2 - 1 / 4) • ContinuousLinearMap.fst ℝ ℝ ℝ) (r := 1) one_pos + (fun x _ => (ridgeToy_joint x).1) (fun x _ => hasDerivAt_const x (0 : ℝ)) + (fun x _ => (ridgeToy_joint x).2.1) + refine ridge_capHyp_of_slices (E := ℝ) (f := ridgeToyF) (h := fun _ => (0 : ℝ)) + (w := fun _ => 0) (r := 1) (δ := 2) (ω := 0) one_pos two_pos hh hg ?_ ?_ ?_ ?_ ?_ + hcrit (fun x hx => hcrit x hx) ?_ ?_ ?_ ?_ + · simp only [(ridgeToy_joint _).2.2] + norm_num + · simp only [(ridgeToy_joint _).2.2] + norm_num + · have hc : ConvexOn ℝ univ (fun x : ℝ => (7 / 8 : ℝ) • x ^ 2 + (-7 / 32 : ℝ)) := + ((even_two.convexOn_pow).smul (by norm_num)).add (convexOn_const _ convex_univ) + refine (hc.subset (subset_univ _) (convex_Icc _ _)).congr ?_ + intro x _ + simp only [(ridgeToy_joint _).2.2, smul_eq_mul] + ring + · intro x _ + rw [strongConcaveOn_iff_convex] + refine (concaveOn_const (x ^ 3 / 3 - x / 4) (convex_closedBall (0 : ℝ) (2 * 1))).congr ?_ + intro y _ + simp only [ridgeToyF, Real.norm_eq_abs, sq_abs] + ring + · intro x _ + simp + · intro x _ + simp + · norm_num + · simp only [ridgeToyF] + norm_num + · simp only [ridgeToyF] + norm_num + + +/-- A field that meets SP's normalized hypotheses: `f (x, y) = x³/3 - x/4 - 12 y²`, so `m = 2` +(`f_xxx = 2`), `δ = 24 > r m (8m - 5) = 22` at `r = 1`, and gap exactly `r³/6`. -/ +noncomputable def spToyF (p : ℝ × ℝ) : ℝ := p.1 ^ 3 / 3 - p.1 / 4 - 12 * p.2 ^ 2 + +/-- **`ridge_capHyp_sp` is not vacuous.** `spToyF` meets every hypothesis, with `h = 0`, `w = 0`, +`F = x² - 1/4`, `m = 2` and `δ = 24`. -/ +theorem spToy_capHyp : + CapHyp spToyF (Icc (-2 * 1) (1 / 2) ×ˢ Metric.closedBall (0 : ℝ) (2 * 1)) (-1 / 2, 0) + (2 * 1, 0) (spToyF (-1 / 2, 0)) (spToyF (1 / 2, 0)) ∧ + ∀ x ∈ frontier (Icc (-2 * 1) (1 / 2) ×ˢ Metric.closedBall (0 : ℝ) (2 * 1)), + x ≠ (1 / 2, 0) → spToyF x < spToyF (1 / 2, 0) := by + have hslice : ∀ x : ℝ, HasFDerivAt (fun y : ℝ => spToyF (x, y)) (0 : ℝ →L[ℝ] ℝ) 0 := by + intro x + rw [hasFDerivAt_iff_hasDerivAt] + have h1 := ((hasDerivAt_pow 2 (0 : ℝ)).const_mul 12).const_sub (x ^ 3 / 3 - x / 4) + convert h1 using 1 + · funext y + simp only [spToyF] + · simp + refine ridge_capHyp_sp (E := ℝ) (f := spToyF) (h := fun _ => (0 : ℝ)) + (F := fun x => x ^ 2 - 1 / 4) (w := fun _ => 0) (r := 1) (m := 2) (δ := 24) one_pos le_rfl + (by norm_num) continuousOn_const ?_ ?_ ?_ ?_ ?_ ?_ (fun x _ => hslice x) rfl rfl + (fun x _ => hslice x) ?_ ?_ ?_ + · intro x _ + have h1 := ((hasDerivAt_pow 3 x).div_const 3).sub ((hasDerivAt_id x).div_const 4) + convert h1 using 1 + · funext y + simp only [spToyF, id, Pi.sub_apply] + ring + · push_cast + ring + · norm_num + · norm_num + · have hc : ConvexOn ℝ univ (fun x : ℝ => (7 / 8 : ℝ) • x ^ 2 + (-7 / 32 : ℝ)) := + ((even_two.convexOn_pow).smul (by norm_num)).add (convexOn_const _ convex_univ) + refine (hc.subset (subset_univ _) (convex_Icc _ _)).congr ?_ + intro x _ + simp only [smul_eq_mul] + ring + · intro x _ + rw [strongConcaveOn_iff_convex] + refine (concaveOn_const (x ^ 3 / 3 - x / 4) (convex_closedBall (0 : ℝ) (2 * 1))).congr ?_ + intro y _ + simp only [spToyF, Real.norm_eq_abs, sq_abs] + ring + · intro x _ + simp + · intro v + have hc : ConvexOn ℝ univ (fun t : ℝ => ‖v‖ • t ^ 2) := + (even_two.convexOn_pow).smul (norm_nonneg v) + refine (hc.subset (subset_univ _) (convex_Icc _ _)).congr ?_ + intro t _ + simp only [smul_eq_mul, zero_apply] + ring + · intro v + have hc : ConcaveOn ℝ univ (fun t : ℝ => -(‖v‖ • t ^ 2)) := + ((even_two.convexOn_pow).smul (norm_nonneg v)).neg + refine (hc.subset (subset_univ _) (convex_Icc _ _)).congr ?_ + intro t _ + simp only [smul_eq_mul, zero_apply] + ring + · simp only [spToyF] + norm_num + + +/-- **`ridge_capHyp_normalized` is not vacuous.** `spToyF` meets every hypothesis, with +`G0 = x² - 1/4` (so `|G0''| = 2 = m`) and gap exactly `1/6`. -/ +theorem spToy_normalized : + CapHyp spToyF (Icc (-2 * 1) (1 / 2) ×ˢ Metric.closedBall (0 : ℝ) (2 * 1)) (-1 / 2, 0) + (2 * 1, 0) (spToyF (-1 / 2, 0)) (spToyF (1 / 2, 0)) ∧ + ∀ x ∈ frontier (Icc (-2 * 1) (1 / 2) ×ˢ Metric.closedBall (0 : ℝ) (2 * 1)), + x ≠ (1 / 2, 0) → spToyF x < spToyF (1 / 2, 0) := by + have hslice : ∀ x : ℝ, HasFDerivAt (fun y : ℝ => spToyF (x, y)) (0 : ℝ →L[ℝ] ℝ) 0 := by + intro x + rw [hasFDerivAt_iff_hasDerivAt] + have h1 := ((hasDerivAt_pow 2 (0 : ℝ)).const_mul 12).const_sub (x ^ 3 / 3 - x / 4) + convert h1 using 1 + · funext y + simp only [spToyF] + · simp + have hgx : ∀ x : ℝ, HasDerivAt (fun x => spToyF (x, 0)) (x ^ 2 - 1 / 4) x := by + intro x + have h1 := ((hasDerivAt_pow 3 x).div_const 3).sub ((hasDerivAt_id x).div_const 4) + convert h1 using 1 + · funext y + simp only [spToyF, id, Pi.sub_apply] + ring + · push_cast + ring + have hq : ConvexOn ℝ univ (fun x : ℝ => (7 / 8 : ℝ) • x ^ 2 + (-7 / 32 : ℝ)) := + ((even_two.convexOn_pow).smul (by norm_num)).add (convexOn_const _ convex_univ) + refine ridge_capHyp_normalized (E := ℝ) (f := spToyF) (h := fun _ => (0 : ℝ)) + (F := fun x => x ^ 2 - 1 / 4) (G0 := fun x => x ^ 2 - 1 / 4) (w := fun _ => 0) (r := 1) + (m := 2) (δ := 24) one_pos (fun x _ => hgx x) ?_ ?_ (by norm_num) (by norm_num) + (by norm_num) continuousOn_const (fun x _ => hgx x) (by norm_num) (by norm_num) ?_ ?_ + (fun x _ => by simp) (fun x _ => hslice x) rfl rfl (fun x _ => hslice x) ?_ ?_ ?_ + · have hc : ConvexOn ℝ univ (fun x : ℝ => (2 : ℝ) • x ^ 2 + (-1 / 4 : ℝ)) := + ((even_two.convexOn_pow).smul (by norm_num)).add (convexOn_const _ convex_univ) + refine (hc.subset (subset_univ _) (convex_Icc _ _)).congr ?_ + intro x _ + simp only [smul_eq_mul] + ring + · refine (concaveOn_const (-1 / 4 : ℝ) (convex_Icc _ _)).congr ?_ + intro x _ + ring + · refine (hq.subset (subset_univ _) (convex_Icc _ _)).congr ?_ + intro x _ + simp only [smul_eq_mul] + ring + · intro x _ + rw [strongConcaveOn_iff_convex] + refine (concaveOn_const (x ^ 3 / 3 - x / 4) (convex_closedBall (0 : ℝ) (2 * 1))).congr ?_ + intro y _ + simp only [spToyF, Real.norm_eq_abs, sq_abs] + ring + · intro v + have hc : ConvexOn ℝ univ (fun t : ℝ => ‖v‖ • t ^ 2) := + (even_two.convexOn_pow).smul (norm_nonneg v) + refine (hc.subset (subset_univ _) (convex_Icc _ _)).congr ?_ + intro t _ + simp only [smul_eq_mul, zero_apply] + ring + · intro v + have hc : ConcaveOn ℝ univ (fun t : ℝ => -(‖v‖ • t ^ 2)) := + ((even_two.convexOn_pow).smul (norm_nonneg v)).neg + refine (hc.subset (subset_univ _) (convex_Icc _ _)).congr ?_ + intro t _ + simp only [smul_eq_mul, zero_apply] + ring + · simp only [spToyF] + norm_num + end CapFirstExit diff --git a/frontiers/cap_first_exit_lean_20261002/MANIFEST.json b/frontiers/cap_first_exit_lean_20261002/MANIFEST.json index f978bfee1..9d3557406 100644 --- a/frontiers/cap_first_exit_lean_20261002/MANIFEST.json +++ b/frontiers/cap_first_exit_lean_20261002/MANIFEST.json @@ -70,6 +70,22 @@ "CapFirstExit.ridge_profile", "CapFirstExit.ridge_capHyp", "CapFirstExit.ridge_saddle_strict", + "CapFirstExit.strongConcave_le_of_hasFDerivAt", + "CapFirstExit.slice_le", + "CapFirstExit.slice_ridge_bound", + "CapFirstExit.slice_curved", + "CapFirstExit.slice_hasFDerivAt", + "CapFirstExit.ridge_hasDerivAt", + "CapFirstExit.ridge_capHyp_of_slices", + "CapFirstExit.ridge_inputs_of_joint", + "CapFirstExit.sp_curved_side_constants", + "CapFirstExit.convexOn_add_node", + "CapFirstExit.two_node_bound", + "CapFirstExit.slice_gradient_bound", + "CapFirstExit.ridge_capHyp_sp", + "CapFirstExit.hermite_gap_le", + "CapFirstExit.hermite_m_ge_two", + "CapFirstExit.ridge_capHyp_normalized", "CapFirstExit.toyF", "CapFirstExit.toyRidge", "CapFirstExit.toy_ridge_ge", @@ -85,7 +101,12 @@ "CapFirstExit.toy_needs_C3", "CapFirstExit.ridgeToyF", "CapFirstExit.ridgeToy_capHyp", - "CapFirstExit.ridgeToy_saddle_strict" + "CapFirstExit.ridgeToy_saddle_strict", + "CapFirstExit.ridgeToy_joint", + "CapFirstExit.ridgeToy_slices", + "CapFirstExit.spToyF", + "CapFirstExit.spToy_capHyp", + "CapFirstExit.spToy_normalized" ], "expected_axioms": { "CapFirstExit.path_meets_frontier": [ @@ -273,6 +294,86 @@ "Quot.sound", "propext" ], + "CapFirstExit.strongConcave_le_of_hasFDerivAt": [ + "Classical.choice", + "Quot.sound", + "propext" + ], + "CapFirstExit.slice_le": [ + "Classical.choice", + "Quot.sound", + "propext" + ], + "CapFirstExit.slice_ridge_bound": [ + "Classical.choice", + "Quot.sound", + "propext" + ], + "CapFirstExit.slice_curved": [ + "Classical.choice", + "Quot.sound", + "propext" + ], + "CapFirstExit.slice_hasFDerivAt": [ + "Classical.choice", + "Quot.sound", + "propext" + ], + "CapFirstExit.ridge_hasDerivAt": [ + "Classical.choice", + "Quot.sound", + "propext" + ], + "CapFirstExit.ridge_capHyp_of_slices": [ + "Classical.choice", + "Quot.sound", + "propext" + ], + "CapFirstExit.ridge_inputs_of_joint": [ + "Classical.choice", + "Quot.sound", + "propext" + ], + "CapFirstExit.sp_curved_side_constants": [ + "Classical.choice", + "Quot.sound", + "propext" + ], + "CapFirstExit.convexOn_add_node": [ + "Classical.choice", + "Quot.sound", + "propext" + ], + "CapFirstExit.two_node_bound": [ + "Classical.choice", + "Quot.sound", + "propext" + ], + "CapFirstExit.slice_gradient_bound": [ + "Classical.choice", + "Quot.sound", + "propext" + ], + "CapFirstExit.ridge_capHyp_sp": [ + "Classical.choice", + "Quot.sound", + "propext" + ], + "CapFirstExit.hermite_gap_le": [ + "Classical.choice", + "Quot.sound", + "propext" + ], + "CapFirstExit.hermite_m_ge_two": [ + "Classical.choice", + "Quot.sound", + "propext" + ], + "CapFirstExit.ridge_capHyp_normalized": [ + "Classical.choice", + "Quot.sound", + "propext" + ], "CapFirstExit.toyF": [ "Classical.choice", "Quot.sound", @@ -352,6 +453,31 @@ "Classical.choice", "Quot.sound", "propext" + ], + "CapFirstExit.ridgeToy_joint": [ + "Classical.choice", + "Quot.sound", + "propext" + ], + "CapFirstExit.ridgeToy_slices": [ + "Classical.choice", + "Quot.sound", + "propext" + ], + "CapFirstExit.spToyF": [ + "Classical.choice", + "Quot.sound", + "propext" + ], + "CapFirstExit.spToy_capHyp": [ + "Classical.choice", + "Quot.sound", + "propext" + ], + "CapFirstExit.spToy_normalized": [ + "Classical.choice", + "Quot.sound", + "propext" ] }, "files": [ @@ -362,18 +488,18 @@ }, { "path": "ALIGNMENT.md", - "bytes": 11887, - "sha256": "c55a89e0c5134f78d0051bda0f221a0f50f2802a72def8b2d37dc41d362821a8" + "bytes": 19924, + "sha256": "57b992a292ba73f841ad41d9051fa29bba6238a3aad567193249443e18fded58" }, { "path": "CapFirstExit.lean", - "bytes": 42711, - "sha256": "2fe8943b74c6aa66a46b7b1db6fe5332f82dff2ee01ff27731188404ddad4ebd" + "bytes": 77018, + "sha256": "4b84c4e1b06ade5d1581b47a24e8905a5c1715773de5e73f539fdb98c07a1fad" }, { "path": "README.md", - "bytes": 9402, - "sha256": "5256f80e0e500f61098bac8cdd9e0a349573bf212ca5bcbf41af6566bf10c7f7" + "bytes": 12711, + "sha256": "a6d235c69b8d7d5d129214043acbd1450f5231bffea27dd15762e9011613c260" }, { "path": "gate.py", @@ -398,7 +524,7 @@ { "path": "test_gate.py", "bytes": 6274, - "sha256": "f7df7152065d3fb69aed839138575b0cca3f821d958f5849f617e69e390bc6b3" + "sha256": "7fe701b2fb9b790d089a107064140d140fedaec93936c08851475c02895528eb" } ] } diff --git a/frontiers/cap_first_exit_lean_20261002/README.md b/frontiers/cap_first_exit_lean_20261002/README.md index 204cdc148..080aa8ac7 100644 --- a/frontiers/cap_first_exit_lean_20261002/README.md +++ b/frontiers/cap_first_exit_lean_20261002/README.md @@ -19,11 +19,20 @@ That implication has two parts: - (C3) a path from `M` to an older point `z`, `f(z) > b`, along which `f ≥ s`. - **Topological part (L21–L22).** From (C1)–(C3), deduce `M`'s global maximin level and its superlevel death level. -This packet kernel-checks two things: +This packet kernel-checks three things: - the whole topological part; -- the one-variable and assembly steps of the analytic part (L13, L16, L17, L19, L20, in `ridge_capHyp`). +- the one-variable and assembly steps of the analytic part (L13, L16, L17, L19, L20, in `ridge_capHyp`); +- since v1.5, L1–L2 and the slice steps: + - L1–L2, the Hermite bound `g(a) − g(c) ≤ m(c − a)³/12`, which under the normalization `b − s = r³/6` forces `m ≥ 2`; + - L5, the transverse-gradient bound, from the third-derivative bound `m`; + - L7, the transverse maximum and its uniqueness; + - L8, the ridge bound; + - L11's chain rule; + - L18, the curved side. -The multi-variable estimates L1–L12 and L18 remain hypotheses. + These are derived from L4's output, the strong concavity of each transverse slice. `ridge_capHyp_sp` takes SP's hypotheses with `m ≥ 2` assumed. `ridge_capHyp_normalized` derives `m ≥ 2` from SP's normalization (gap exactly `r³/6`, pins critical, third derivatives bounded by `m`). + +The estimates L3, L4 and L6, L7's existence and regularity of `h`, and L9–L12 remain hypotheses. In the topological theorems, `X` is any topological space, and nothing is assumed about `f` outside `C` except along the single ridge path. @@ -50,6 +59,18 @@ single ridge path. | `frontier_cylinder`, `isCompact_cylinder` | `frontier ([a, c] × B̄(0, R)) = {a, c} × B̄(0, R) ∪ [a, c] × S(0, R)`: exactly the end faces and curved side estimated in L17–L19; the cylinder is compact | | `ridge_profile` | L13, L16, L17 and L20 in one variable. Assume, on `[−2r, 2r]`, that `g' = F`, `F(∓r/2) = 0` and `F − (x + r/2)(x − r/2)/8` is convex. Then `g ≤ g(−r/2)` on `[−2r, r/2]` and `g ≥ g(r/2)` on `[−r/2, 2r]`. Also `g(−2r) ≤ g(−r/2) − 9r³/32` and `g(2r) ≥ g(r/2) + 9r³/32`: the exact face integrals | | `ridge_capHyp`, `ridge_saddle_strict` | (C1)–(C3), and (C2⁺), on the cylinder `[−2r, r/2] × B̄(0, 2r)`, derived from the multi-variable outputs, each assumed only where SP supplies it: L7 (transverse maximum, unique for (C2⁺)), L11 (`g' = F` on `[−2r, 2r]`), L12 (`F'' ≥ 1/4` as convexity on `[−2r, 2r]`), L18 (curved side), and the gap `b − s < 9r³/32` | +| `strongConcave_le_of_hasFDerivAt`, `slice_le` | the engine: a `δ`-strongly concave `φ` with derivative `L` at `p ∈ K` satisfies `φ y ≤ φ p + L(y − p) − (δ/2)‖y − p‖²` on `K`. At a critical point this is L7, `f(x, y) ≤ g(x) − (δ/2)‖y − h(x)‖²` | +| `slice_ridge_bound` | L8: `δ‖h(x)‖ ≤ ‖w(x)‖`, where `w(x)` is the slice derivative at `y = 0` | +| `slice_curved` | L18: on `‖y‖ = R` the slice is `< s` once `‖w‖ ≤ ω ≤ Rδ`, `g(x) ≤ b` and `2δ(b − s) < (Rδ − ω)²` | +| `slice_hasFDerivAt`, `ridge_hasDerivAt`, `ridge_inputs_of_joint` | L11: with the ridge equation `∂_y f = 0` along `y = h(x)`, `g' = ∂_x f(x, h(x))`. Joint derivatives and a differentiable `h` supply `hh`, `hg` and the slice critical points | +| `ridge_capHyp_of_slices` | (C1)–(C3) and (C2⁺) on the cylinder, with the transverse hypotheses of `ridge_capHyp` replaced by L4 (`hconc`), the critical points `h(x) ∈ B̄(0, 2r)`, L5 (`‖w‖ ≤ ω`) and `2δ(b − s) < (2rδ − ω)²` | +| `convexOn_add_node`, `two_node_bound`, `slice_gradient_bound` | L5: if `u` vanishes at `a < c` and `|u''| ≤ m` (weak form), then `|u(x)| ≤ (m/2)|(x − a)(x − c)|`, inside and outside `[a, c]`. For the slice derivatives `w(x)` at `y = 0`, this gives `‖w(x)‖ ≤ (m/2)|x² − r²/4| ≤ 2mr²` on the cap | +| `ridge_capHyp_sp` | the cap from SP's normalized hypotheses: `m ≥ 2` (L2), `δ > rm(8m − 5)` with `hconc` (L4), the weak third-derivative bound on `w` (L5), critical points with `h(∓r/2) = 0` (L7), L11, L12 and gap `≤ r³/6`. `ω`, `hωr` and `hcurv` are derived | +| `spToyF`, `spToy_capHyp` | `x³/3 − x/4 − 12y²` (`m = 2`, `δ = 24 > 22`, gap `r³/6`) meets every hypothesis of `ridge_capHyp_sp` | +| `hermite_gap_le`, `hermite_m_ge_two` | L1–L2: if `g' = G` vanishes at `a < c` and `|G''| ≤ m` (weak form), then `g(a) − g(c) ≤ m(c − a)³/12`. At the gap `r³/6` on `[−r/2, r/2]`, this forces `m ≥ 2` | +| `ridge_capHyp_normalized`, `spToy_normalized` | the cap with `m ≥ 2` derived from the normalization (L1–L2) instead of assumed; `spToyF` meets every hypothesis | +| `sp_curved_side_constants` | SP's constants (`m ≥ 2`, `δ > rm(8m − 5)`, `ω ≤ 2mr²`, gap `r³/6`) satisfy `ω ≤ 2rδ` and the curvature condition | +| `ridgeToy_joint`, `ridgeToy_slices` | the ridge toy (`δ = 2`, `ω = 0`) meets every input of the slice route, which re-derives (C1)–(C3) and (C2⁺) | | `ridgeToy_capHyp`, `ridgeToy_saddle_strict` | SP's normalization at `r = 1` (`f = x³/3 − x/4 − y²`, gap exactly `r³/6`) satisfies every ridge hypothesis, so they are jointly satisfiable | | `toy_capHyp`, `toy_death_level` | a concrete instance on `ℝ`, showing the hypotheses are satisfiable and the theorems are not vacuous | | `toy_needs_C1`, `toy_needs_C2`, `toy_needs_C3` | proved counterexamples: for each of (C1), (C2), (C3), Lean proves that the other two hold, that this one fails, and that the maximin conclusion fails | @@ -70,9 +91,10 @@ that step. This packet does not formalize: -- the multi-variable analytic steps L1–L12 and L18: the Hermite identity, increments, strong concavity and the - transverse maximizer, the implicit function theorem, the ridge identity, the `F''` bound, and the curved side. These - enter `ridge_capHyp` as hypotheses, and L13, L16, L17, L19 and L20 are proved from them; +- the analytic steps L3, L4 and L6 (the increments, the transverse Hessian bound that produces `δ`, and the `w'` + bound), the existence and implicit-function regularity of the transverse maximizer `h`, and L9–L12 (the `‖h'‖` and + `F''` bounds). These enter `ridge_capHyp_normalized`, `ridge_capHyp_of_slices` and `ridge_inputs_of_joint` as + hypotheses. L1, L2, L5, L7's maximum and uniqueness, L8, L11's chain rule, L13 and L16–L20 are proved from them; - the match between the source's coordinates and the Lean objects: that SP's cap is `[-2r, r/2] × B̄(0, 2r)` in a frame `φ` and that SP analyses the periodic lift. The transport to the torus and the face list are themselves proved (`CapHyp.toTorus`, `frontier_cylinder`); @@ -111,7 +133,7 @@ The source gate checks: bound); - rebuilds the package fresh; - replays the module with `leanchecker`; -- prints the axioms of all 52 declarations, requiring exactly the manifest's report: each uses only `propext`, +- prints the axioms of all 74 declarations, requiring exactly the manifest's report: each uses only `propext`, `Classical.choice`, `Quot.sound`; - runs three negative controls (an injected `sorry`, a custom axiom, and `native_decide`). The audit must reject each. diff --git a/frontiers/cap_first_exit_lean_20261002/test_gate.py b/frontiers/cap_first_exit_lean_20261002/test_gate.py index 61ca37bc1..f8e6a79ff 100644 --- a/frontiers/cap_first_exit_lean_20261002/test_gate.py +++ b/frontiers/cap_first_exit_lean_20261002/test_gate.py @@ -16,7 +16,7 @@ class SourceGate(unittest.TestCase): def test_tree_passes(self): m = gate.source_check() - self.assertEqual(len(m["targets"]), 53) + self.assertEqual(len(m["targets"]), 74) self.assertEqual(m['scientific_effect'], 'NONE') def copy(self):