diff --git a/proof/docs/BG_CEILING_SUBACTION_20260902.md b/proof/docs/BG_CEILING_SUBACTION_20260902.md new file mode 100644 index 00000000..ba7c4053 --- /dev/null +++ b/proof/docs/BG_CEILING_SUBACTION_20260902.md @@ -0,0 +1,68 @@ +# BG classical ceiling: an explicit additive SUBACTION closes the core (2026-09-02) + +**Status: MAJOR reduction, empirically decisive, NOT yet kernel-proven. `conjecture1_proved = False`.** + +## The reformulation (why this is different from the failed cap) + +The branch ceiling `∀ b, bell b ≤ 0` telescopes per-vertex: +`bell b = Σ_{v∈b} e_v`, `e_v = log(1 + S_v/d_v) − F*`, `S_v = Σ_{child c} bY(c)`, `d_v = deg(v)`, +`F* = log(621/64)/11`. (Equivalently: ceiling ⟺ geomean of the cavity fields +`h_v = d_v/(d_v+S_v) ∈ (0,1]` is `≥ W^(1/11)`, `W=64/621`.) + +An **additive subaction** is a function `ρ` on vertex-states with `ρ ≥ 0` and, for every vertex, +``` + (SUB) e_v + ρ(v) ≤ Σ_{child c} ρ(c). +``` +Summing over `b` telescopes to `bell b ≤ −ρ(root) ≤ 0` — the ceiling. This is the ergodic- +optimization / Aubry–Mather "calibrated subaction" (a coboundary correction of the potential). + +**Why additive beats the multiplicative cap `Bcap`.** The refuted `Le1Step` was multiplicative +(`W·a^11·∏ψ ≤ ψ`): a product of slightly-loose factors overshoots — that is exactly why it was +FALSE (`proof/docs/BG_LE1STEP_REFUTED_20260902.md`). `(SUB)` is a *sum* of local terms; slight +looseness stays bounded and telescopes. The subaction cannot hit that failure mode. + +## The explicit witness (verified) + +The maximizer is a **period-2 parity oscillation onto a single finite 3-state tie** (the 5-arm +cherry-spider, n=11), NOT aperiodic — so a **finite-partition, piecewise-affine subaction exists** +(Bousch). The high-degree tail is trivially slack (more children ⇒ more RHS credit). An +**affine-per-degree** `ρ(d,μ) = a_d + b_d·μ` suffices on the compact core: + +| d | ρ(d,μ) | notes | +|---|--------|-------| +| 1 (leaf) | `F*` | exact tie anchor | +| 2 | `≈ −0.0609 + 0.2057·μ`, through `(μ=1/3, 2F*−log(3/2))` | cherry = tie anchor | +| 3 | `≈ −0.0116 + 0.0578·μ` | free (slack) | +| ≥4 | `0` | incl. the hub `(d=6, μ=3/23)` ⇒ ρ=0 | + +**Only 3 constraints are tight (active), and they are exactly the tie's 3 states**: +`ρ(leaf)=F*`; cherry `e_cherry+ρ(2,1/3)=ρ(leaf)` ⇒ `ρ(2,1/3)=2F*−log(3/2)`; hub +`e_hub+0=5·ρ(2,1/3)` ⇒ `ρ(2,1/3)=(log(23/18)−F*)/5`. Consistency of the two is the exact +`27·23 = 621` identity (`(3/2)^5·(23/18)=621/64`, `11F*=log(621/64)`). Everything else is slack ⇒ +the non-tie coefficients are FREE and can be taken with rational slack. + +## Verification (decisive, empirical) + +- **All 376,464 branches n≤16**: worst `(SUB)` margin `−4e-6` (float noise at the pinned leaf). +- **Continuous interior grid** (parents deg 2–6, children deg 1–10, incl. tail): worst `+1e-6` (at + the cherry — the equality), tail (child deg≥7) worst `+0.022`. The gap is concave in the child- + message sum ⇒ **box corners give the worst case** (this is the parallel session's ① endpoint lever). + +## What this reduces the ceiling to (the remaining proof) + +1. **Lean additive bridge** `ceiling_of_subaction : (ρ≥0 ∧ ∀v (SUB)) → ∀b bell b≤0` — the additive + analog of the proven `BGSCLGStepBridge.ceiling_of_gstep`; provable sorry-free now. +2. **Finitely many per-cell inequalities** on the compact core (deg ≤ 6), each an affine-in-μ box + check (① endpoints) + a `log(1+S/d)` enclosure (turan/jensen rational bounds); slack everywhere + except the tie. +3. **A high-degree tail lemma** (deg ≥ 7: `Σ_c ρ(c) − ρ(v) − e_v ≥ 0` with large slack). +4. **The tie identity** `27·23 = 621` handled exactly (composes with `TightCapEnclosure`/`acl_d6`). + +## Honest scope + +This is an explicit, verified WITNESS + a clean reduction — not a kernel proof. The subaction values +at the tie are irreducibly transcendental (`F*`, `log(3/2)`); the proof is enclosure-conditional. No +`sorry` has been discharged yet. Dispelled en route: aperiodicity (maximizer is period-2/finite) and a +hard countable tail (slack). `conjecture1_proved = False` until the full chain lake-builds. + +Repro: `/tmp/boxlp.py` (solve), `/tmp/verify2.py` (376k-tree + interior-grid validation). diff --git a/proof/docs/BG_CEILING_SUBACTION_HANDOFF.md b/proof/docs/BG_CEILING_SUBACTION_HANDOFF.md new file mode 100644 index 00000000..89b53b91 --- /dev/null +++ b/proof/docs/BG_CEILING_SUBACTION_HANDOFF.md @@ -0,0 +1,108 @@ +# BG classical ceiling via additive SUBACTION — consolidated handoff (2026-09-03) + +**Status: reduction chain kernel-complete; `IsSubaction ρwit` per-cell family in progress. +`conjecture1_proved = False`.** Branch `bg/scl-on-main` (GitHub `DrMurphyIsIn/Arda`). + +## 1. The result and the reduction chain (all kernel-green, axiom-clean `[propext, Classical.choice, Quot.sound]`) + +Goal: the BG classical branch ceiling `∀ b, bell b ≤ 0` (equivalently `Gf b := exp(11·bell b) ≤ 1`, +`Gf b = btotal(b)^11·(64/621)^|b|`), `bell b = log(btotal b) − |b|·F*`, `F* = log(621/64)/11`. + +The ceiling telescopes per-vertex: `bell b = Σ_v e_v`, `e_v = log(1 + S_v/d_v) − F*`, `S_v = Σ_{child c} bY c`, +`d_v = deg v = bcc v + 1`. An **additive subaction** `ρ : Branch → ℝ` with `ρ ≥ 0` and the per-vertex +inequality `(SUB) e_v + ρ(v) ≤ Σ_c ρ(c)` telescopes to `bell b ≤ −ρ(root) ≤ 0`. + +| theorem (`R3Cert.BGSCL`, file) | statement | +|---|---| +| `ceiling_of_subaction` (BGSCLSubaction) | `(∀b 0≤ρ b) → IsSubaction ρ → ∀b bell b ≤ 0` | +| `ρwit_nonneg` (BGSCLSubaction) | `∀b, 0 ≤ ρwit b` (nonneg leg DISCHARGED) | +| `ceiling_of_witness` (BGSCLSubaction) | `IsSubaction ρwit → ∀b bell b ≤ 0` | + +So the **entire ceiling now rests on the single obligation `IsSubaction ρwit`.** + +Why additive, not the earlier cap: the multiplicative capped-product step `Le1Step` is **FALSE** +(`proof/docs/BG_LE1STEP_REFUTED_20260902.md`, exact counterexample 3 children at message 13/42 → 1.006 > 1). +A *sum* of slightly-loose local terms telescopes; a *product* overshoots. The subaction cannot hit that. + +## 2. The witness `ρwit` (validated, `R3Cert/BGSCLSubaction.lean`) + +``` +ρwit(leaf) = F* +ρwit(deg 2,μ) = 2F* − log(3/2) + (1/4)(μ − 1/3) -- μ = bY = 1/3 at the cherry (tie anchor) +ρwit(deg 3,μ) = μ/32 +ρwit(deg 4,μ) = μ/384 +ρwit(deg ≥5) = 0 +``` +Keyed by `bcc b` (degree − 1) and `bY b`. Only `F*` and `log(3/2)` are transcendental (deg 1,2); +deg 3,4 rational-linear; deg ≥5 vanishes (because `e_tail = log(1+1/d) − F* > 0` ONLY for `d = 2,3,4`). +**Validated exhaustively** (all 376k branches n≤16 + high-degree parents to deg-140 + spider family + +120k mixed high-degree trees), margin 0, tight only at the `27·23 = 621` tie. NB: the earlier +`ρwit(deg≥4)=0` witness FAILED the high-degree-parent tail — this corrected witness is the valid one. + +## 3. `IsSubaction ρwit` cell map — what's proven, what remains + +`IsSubaction ρwit := ∀ cs, (log(1 + (cs.map bY).sum/((cs.length)+1)) − F*) + ρwit(node cs) ≤ (cs.map ρwit).sum`. +Finite per-node family: node degree `d = |cs|+1`. + +| node deg | children | cell | status | +|---|---|---|---| +| 1 | — | `subaction_nil` | ✅ | +| 2 | leaf (cherry) | `subaction_cherry` (exact tie leg) | ✅ | +| 2 | deg-2 | `subaction_deg2_deg2child` (tangent@½ + secant + `log54_sub_fstar_le'`) | ✅ | +| 2 | deg≥3 (all) | `subaction_deg2_highchild` (uses `log79_add_fstar`, TIGHT route) | ✅ | +| 3 | leaf,leaf | `subaction_broom_d3` (fixed-point) | ✅ | +| 3 | deg≥3, deg≥3 | `subaction_deg3_highchildren` (DECOUPLE, `BGSCLSubactionDeg3.lean`) | ✅ | +| 3 | {leaf,deg-2}×{leaf,deg-2,deg≥3} | see §5 | ⏳ | +| 4 | multi-child | same assembly, d=4 reference | ⏳ | +| ≥5 | (ρ=0 tail) | multi-child decouple (leaf children give `S` up to `d−1`, covered by `Σρ = |leaves|·F*`) | ⏳ | +| tie | `27·23` | exact identity | ⏳ | + +**Node degrees 1 and 2 COMPLETE; the single-child spine complete; first two multi-child (broom + first +decouple) done.** + +## 4. The round-trip protocol (PROVEN end-to-end) + +1. **BG side** specifies a cell: node degree `d`, child-degree profile, message intervals, tangent reference `s0`. +2. **Telperion side** (`emit_log_combination`) generates the enclosure atom, verifies green against `R3Cert.BGSCLInduction`, delivers on a branch. +3. **BG side** merges + assembles (`log_tangent` decouple + node-ρ bound + per-child ρ-lower-bound lemma + equal-distribution `linarith`) into the cell, verifies green + axiom-clean, merges to `bg/scl-on-main`. + +Three enclosure regimes, all built + dogfooded: **monotone** (`≤0`, tie identity), **tangent** (degree-1 +`log x≤x−1`, any-sign q), **tight** (degree-3 exp via `Real.exp_bound'` — needed when the fold `X` is near +`e^q`, or `X>1`). Decouple = `RecursionClosureEmitter` shape; `log_tangent` is in the repo. + +**KEY assembly trick:** choose `s0` so the tangent slope `1/(d+s0)` MATCHES `ρwit`'s slope on the heavy child +degree → the per-child bound becomes **message-independent** (collapses to one scalar log-combination atom). + +## 5. Next cell specs (ready to generate) + +**`subaction_deg3_deg2children` — deg-3 hub, two deg-2 children** (exercises TIGHT route inside the decouple): +- Profile `bcc c₁ = bcc c₂ = 1`, `bY cᵢ ∈ [1/3, 1/2]` (`bY_ge_third_of_bcc1` + `bY_le_inv_deg`). +- Reference **`s0 = 1`** (slope-matching: `1/(3+1) = 1/4 = ρwit(deg-2)` slope ⇒ per-child bound bY-independent). + `log_tangent (d:=3)(s:=S)(s0:=1)`: `log(1+S/3) ≤ log(4/3) + (S−1)/4`. +- Node-ρ bound `ρwit(node) = (1/32)/(3+S) ≤ 3/352` (`S ≥ 2/3`). +- **Enclosure atom (TIGHT route needed):** `2·log(3/2) + log(4/3) − 5·F* ≤ 79/1056`. + Fold `Y = (3/2)²²·(4/3)¹¹·(64/621)⁵ ≈ 2.06 > 1`, so `log x ≤ x−1` is loose (`x−1 ≈ 1.06 > 0.823` needed); + degree-3 exp route closes it (`Y ≤ 1+q+q²/2+q³/6 ≤ exp q`, `q = 79/96`). +- Per-child bound (deg-2, bY-independent): `2F*−log(3/2)+1/24 ≥ C'/2`, `C' = log(4/3)−F*+3/352` — reduces to the atom. Margin **+0.0091**. + +**Remaining d=3 profiles:** `leaf+deg≥3` and `leaf+deg-2` close via `LHS ≤ F* ≤ RHS` (leaf's `ρ=F*` dominates; +monotone enclosure); `deg-2+deg≥3` = one deg-2 (tight atom) + one deg≥3 (§3 per-child bound). +**d=4:** same assembly, reference `s0 = 3·(child max message)` per profile. +**Tail (deg ≥5):** `ρwit(node)=0`, so `e_node ≤ Σρ(c)`; NOT a uniform `≤0` collapse (leaf children give +`S` up to `d−1`) — needs the same decouple, `Σρ ≥ |leaf children|·F*` covering `e_node`. + +## 6. Files + +- `R3Cert/BGSCLInduction.lean` — Branch model, `bell`, `bY`, `bell_node`, `log_tangent`, `bY_node`, `scl_of_child_step` (shared, on `main`). +- `R3Cert/BGSCLSubaction.lean` — `IsSubaction`, `ceiling_of_subaction`, `ρwit`, `ρwit_nonneg`, `ceiling_of_witness`, all §3 cells + helpers (`bY_le_one`, `bY_le_inv_deg`, `bY_ge_third_of_bcc1`, `cherry_anchor_nonneg`, `log54_sub_fstar_le'`, `log53_enc`, …). +- `R3Cert/BGSCLSubactionEnc.lean` — `log79_add_fstar` (Telperion tight-route enclosure). +- `R3Cert/BGSCLSubactionDeg3.lean` — `subaction_deg3_highchildren` + `log119_sub_fstar` + `rhowit_ge_perchild`. +- Telperion `emit_log_combination` (routes monotone/tangent/tight) — the enclosure generator. + +## 7. Honest scope + +Kernel-complete: the reduction `ceiling ⟸ IsSubaction ρwit`, the witness + its nonnegativity, and the +single-child + first multi-child cells. Open: the rest of the `IsSubaction ρwit` per-cell family (d=3 mid +profiles, d=4, the deg≥5 tail) and the `27·23` tie identity. The round-trip is proven, the tools built, the +pattern pinned — the remainder is finite, patterned generation, not new mathematics. `conjecture1_proved = False` +until the whole family lands and the chain builds sorry-free. Do NOT claim the ceiling closed before then. diff --git a/proof/docs/BG_LE1STEP_REFUTED_20260902.md b/proof/docs/BG_LE1STEP_REFUTED_20260902.md new file mode 100644 index 00000000..257316b5 --- /dev/null +++ b/proof/docs/BG_LE1STEP_REFUTED_20260902.md @@ -0,0 +1,64 @@ +# The CappedJoint `≤1` step (Le1Step) is FALSE — refutation (2026-09-02) + +**Status: DECISIVE NEGATIVE. `conjecture1_proved = False`.** + +## What was claimed + +The BG classical branch ceiling `∀ b, bell b ≤ 0` (equivalently `Gf b := exp(11·bell b) ≤ 1`, +`Gf b = btotal(b)^11·(64/621)^|b|`) was reduced, via the sorry-free kernel bridge +`R3Cert.BGSCLGStepBridge.ceiling_of_glemma_le1`, to two per-hub message inequalities on the +CappedJoint cap `Bcap(μ) = min(masterUb μ, glemmaUb μ, 1)` (`W = 64/621`): +- `GlemmaStep` — PROVEN in ℚ as `CappedJointClosure.gstep_le_one_achievable` (all arities); +- `Le1Step` : `W · a^11 · ∏_c Bcap(μ_c) ≤ 1`, `a = 1 + (Σ μ_c)/(j+1)`, over achievable child + messages `μ_c ∈ (0,1/2] ∪ {1}`. + +`glemmaUb_le_masterUb` (`μ ≤ 1/2`) shows `masterUb` is subsumed, so the whole ceiling rests on `Le1Step`. +This is exactly the CappedJoint candidate's `≤1` / `phi_le_one` step (the "1" leg of `Bcap`). + +## The refutation (exact rational counterexample) + +`Le1Step` is **FALSE**. Take a hub whose `j = 3` children each have message `μ_c = 13/42 ≈ 0.30952`: + + Bcap(13/42) = 0.994091… (the glemma cap binds; < 1, a genuine capped factor) + a = 1 + (3·13/42)/4 = 69/56 + W · a^11 · Bcap(13/42)^3 = 1.006094… > 1 (exact Fraction, verified) + +and it grows to `1.147` at `j=4`, `1.249` at `j=5`. The config is **reachable**: `μ = 13/42` +means `d_c + S_c = 42/13`, i.e. a degree-3 child with two deep grandchildren (message sum `3/13`). +So `Le1Step` fails on a real branch — it is not merely unproven, it is false. + +## Root cause + +`Bcap` is **too loose in the mid-message band `μ ∈ (0.30, 0.45)`**. A real branch with `bY = 0.31` +has actual `Gf ≈ 0.20`, but `Bcap(0.31) = 0.994` (a ~5× over-estimate), so the capped product +`∏ Bcap` overshoots. The induction `Gf b ≤ Bcap(bY b)` uses `Gf(c) ≤ Bcap(μ_c)`, discarding the +true tightness; the multiplicative step then exceeds 1. + +## Consequences + +1. The bridge `ceiling ⟸ GlemmaStep ∧ Le1Step` is a **valid** reduction but to a **false** + hypothesis, so it cannot close the ceiling. +2. The **CappedJoint candidate is refuted**: its `≤1` (`phi_le_one`) step is false, not just + "empirically verified but unproven." The `n ≤ 15` census missed it because for actual small + trees the child `Gf` and message are linked (tight); the abstract `Bcap`-cap step is not. +3. The ceiling `∀b bell b ≤ 0` is still **TRUE** (376k-branch numeric check). Closing it needs a + cap `ψ` **tighter than `Bcap`** in the mid-band — the true per-message envelope + `env(μ) = sup{Gf(b) : bY(b)=μ}` (which DOES satisfy the step, with large margin, e.g. the + `13/42` family closes at `0.0004 ≤ 1` under a tight `ψ`). Finding an explicit, *provable* such + `ψ` is the M_d frontier — the genuine open crux. + +## Reproduce + + python3 -c " + from fractions import Fraction as Fr + W=Fr(64,621) + def mU(m): return W*(Fr(3)/(2+m))**11 + def gU(m): return W*W*(Fr(5,3))**11/((1+m/3)**11) + def B(m): return min(mU(m),gU(m),Fr(1)) + mu=Fr(13,42) + for j in (3,4,5): + S=j*mu; a=1+S/(j+1); v=W*a**11*B(mu)**j + print(j, float(v), v>1)" + +Kernel artifacts: `R3Cert.BGSCLGStepBridge` (`Le1Step`, `ceiling_of_glemma_le1`, `Gf_node`, +`glemmaUb_le_masterUb`) on branch `bg/scl-on-main`. diff --git a/proof/docs/BG_SUBACTION_CONSOLIDATED_HANDOFF.md b/proof/docs/BG_SUBACTION_CONSOLIDATED_HANDOFF.md new file mode 100644 index 00000000..fe631937 --- /dev/null +++ b/proof/docs/BG_SUBACTION_CONSOLIDATED_HANDOFF.md @@ -0,0 +1,195 @@ +# BG additive-SUBACTION ceiling — consolidated handoff (2026-09-04) + +**STATUS: CLOSED (2026-09-04). The classical-branch ceiling `∀ b, bell b ≤ 0` is now fully proven, +kernel-verified, and axiom-clean `[propext, Classical.choice, Quot.sound]`.** `IsSubaction ρwit` is assembled +end-to-end (`isSubaction_ρwit`) and the capstone `bg_ceiling : ∀ b, bell b ≤ 0 := ceiling_of_witness +isSubaction_ρwit` is guarded by `AxiomGuard.lean` (51 theorems). The formerly-remaining patterned/mechanical +assembly is DONE: the 35 deg-4 node cells (`R3Cert/BGSCLSubactionD4Cells.lean`, wiring the `d4_*` atoms), the 7 +tail stragglers `subaction_tail_d{5,7,8,9,62,63,64}` + the gap-free `tail_wrapper` +(`R3Cert/BGSCLSubactionTailWrap.lean`, incl. the tight upper anchor `cherry_anchor_le_tight ≤ 133/17061`), and the +permutation bridge `subaction_perm` + top-level degree dispatch `subaction_deg4`/`subaction_deg4_canon` +(`R3Cert/BGSCLSubactionDispatch.lean`). `lake build R3Cert` green (8867 jobs); CI `proof-lean` + `proof-comparator` +(independent judge) both green on `bg/scl-on-main` (PR #210). Delivered via a 3-worktree parallel agent team + an +adversarial verification pass. + +**SCOPE (honest — do NOT overstate): this closes ONE branch — the classical-branch ceiling line `bell b ≤ 0`, +consumed as the `hceil` hypothesis of the SCL/G-step bridge. It is NOT conjecture1.** conjecture1 +(`R47TopCapstone.conjecture1_of_layers`, the Laplacian-permanent-ratio maximizer) still reduces to the two open +layers Hnorm/Hdom and is not yet wired to this branch. **`conjecture1_proved = False` (unchanged).** The history +below is retained for provenance. + +--- + +## 0. Original reduction status (retained for provenance) + +The ceiling reduced to the single obligation `IsSubaction ρwit`; the deg-1/2/3 cell families were COMPLETE, +the full d=4 atom table proven, all three deg≥5 uniform tail families + the 27·23 tie proven, all three +reduce-to-uniform MESSAGE halves (deg-2/3/4) proven, the counts→single-degree EXCHANGE DISSOLVED (the +tangent-decouple, §3.3), the decouple backbone `tail_decouple` KERNEL LEAN, and the mixed-config tail +CLOSED for `d=6` (tie), `d∈[10,61]` (deg-4 regime), and `d≥65` (the INFINITE deg-5 tail) — all for ARBITRARY +children. The finite/patterned remainder (7 straggler tail degrees, the tail wrapper, the d=4 cell wiring, the +top-level dispatch) has since been completed as recorded in the status block above. + +Branch `bg/scl-on-main` (GitHub `DrMurphyIsIn/Arda`). Everything below is `no sorry`, kernel-verified, axiom-clean +`[propext, Classical.choice, Quot.sound]` (CI-enforced by `AxiomGuard.lean`, **40 guarded theorems**), full +`lake build` green (BG-subaction build re-verified 2026-09-04: 8659 jobs, 9 modules, no sorry, AxiomGuard clean). +Supersedes the running notes in `BG_CEILING_SUBACTION_HANDOFF.md`, `BG_SUBACTION_TELPERION_NEXTCELLS.md`, +`BG_SUBACTION_D4_TAIL_TIE_SPEC.md` (kept for detail/derivations). + +--- + +## 1. The reduction (kernel-green) + +The classical branch ceiling `∀ b, bell b ≤ 0` (`bell b = log(btotal b) − |b|·F*`, `F* = log(621/64)/11`). +The earlier multiplicative capped-product step `Le1Step` is **FALSE** (`BG_LE1STEP_REFUTED_20260902.md`, exact +counterexample). The live line is the **additive subaction**: a `ρ ≥ 0` with the per-vertex inequality +`(SUB) e_v + ρ(v) ≤ Σ_child ρ(c)` telescopes to `bell b ≤ −ρ(root) ≤ 0`. + +| theorem (`R3Cert.BGSCL`) | statement | +|---|---| +| `ceiling_of_subaction` | `(∀b, 0≤ρ b) → IsSubaction ρ → ∀b, bell b ≤ 0` | +| `ρwit_nonneg` | `∀b, 0 ≤ ρwit b` (nonnegativity leg — DISCHARGED) | +| `ceiling_of_witness` | `IsSubaction ρwit → ∀b, bell b ≤ 0` | + +The witness `ρwit` (keyed by degree `bcc+1` and message `bY`), validated exhaustively (376k branches n≤16 + +high-degree parents to deg-140 + spider + 120k mixed), margin 0 tight only at the 621 tie: +``` +ρwit(leaf) = F*; ρwit(deg-2,μ) = 2F*−log(3/2)+(μ−1/3)/4; ρwit(deg-3,μ) = μ/32; ρwit(deg-4,μ) = μ/384; ρwit(deg≥5) = 0 +``` +So the **entire ceiling rests on `IsSubaction ρwit`** — a finite per-node cell family (`∀ cs, e_node + ρwit(node cs) +≤ Σ ρwit(c)`, node degree `d = |cs|+1`). + +## 2. `IsSubaction ρwit` — what is proven + +### Node degree 1, 2 — COMPLETE +`subaction_nil` (deg-1), `subaction_cherry` (deg-2/leaf), `subaction_deg2_deg2child`, `subaction_deg2_highchild` +(deg≥3 child, subsumes deg≥5), `subaction_deg2_deg5child`. + +### Node degree 3 — COMPLETE (all six child profiles) +`subaction_broom_d3` (leaf,leaf), `subaction_deg3_highchildren` (deg≥3,deg≥3), `subaction_deg3_deg2children` +(deg-2,deg-2), `subaction_deg3_leaf_deg2` (leaf,deg-2), `subaction_deg3_leaf_high` (leaf,deg≥3), and the redesigned +two-slope **`subaction_deg3_deg2_high`** (deg-2,deg≥3). Cell (D) was the crux: the deg-2 slope 1/4 vs deg≥3 per-child +slope 3/11 can't both be slope-matched by a single tangent; dissolved by **bounding the high child's message ≤1/3, +DROPPING its (nonneg) ρwit, and slope-matching only the deg-2 child** — a recipe that also unblocks d=4 mixed profiles. +Enclosure atoms in `BGSCLSubactionEnc2.lean` (deg3_deg2children_enc, log32_sub2fstar, log139_sub2fstar) + +`log2_sub3fstar` (cell D). + +### Node degree 4 — the full 35-atom table proven; cells are mechanical +All **35 d=4 child-profile enclosure atoms** are proven in `BGSCLSubactionD4.lean` via one reusable lemma +`tangent_atom` (the tangent-route enclosure generator, written with `zpow` so a single lemma covers every +`log(3/2)`-fold sign, incl. the 15 negative-`kL` (2,*) profiles). Each profile closes with a single `log_tangent` at +its binding corner (verified: no two-slope wall at d=4, since each binding corner puts all children at a common +message). The 35 `subaction_*` cells themselves (wiring each atom + tangent + `linarith` over the message box) are the +one mechanical remaining d=4 task — the atoms and the recipe are done. NB: the pre-existing `subaction_cell_broom_d4` / +`subaction_cell_d4_d3` use a SUPERSEDED witness (ρ3), not `ρwit`. + +### Node degree ≥5 (the tail) — all three uniform families + the tie proven +`ρwit(node)=0`, so `(SUB)` is `log(1+S/d) − F* ≤ Σ ρwit(c)` (`S=Σ bY(c)`, `d−1` children). The naive +"`Σρ ≥ |leaves|·F*`" design is WRONG (fails at 4 deg-3 children, no leaves, e_node>0). The worst profile per d is +uniform-type. Proven families (`BGSCLSubactionTail.lean`): +- `tail_all_deg4` (∀d≥1): `log((5d−1)/(4d)) − F* ≤ (d−1)/1536` — the flattest (min slack +0.0057 @ d=18). +- `tail_all_deg3` (∀d≥1): `log((4d−1)/(3d)) − F* ≤ (d−1)/96`. +- `tail_all_deg2` (∀d≥5, ℕ, the **TIE family**, exact equality at d=6): `log((4d−1)/(3d)) ≤ (2d−1)F* − (d−1)log(3/2)`. + Not closable by one concavity bound over ℝ (tight@d6) → ℕ-dispatch: d=5 (fold), d=6 (`tie_identity_d6`), d≥7 + (`tail_all_deg2_large`, concavity + a quadratic with negative discriminant, using `henc_deg2_qp7`/`henc_deg2_q7`). +- The 27·23 tie: `tie_identity_d6` (`(23/18)·(3/2)⁵ = 621/64`) + `subaction_tail_tie_d6` (deg-6, five cherry children, + exact equality). + +**Mixed-config tail cells (arbitrary children) — CLOSED for d=6, d∈[10,61], d≥65** (`BGSCLSubactionTailDecouple.lean`): +`tail_decouple` (backbone) + `subaction_tail_d6` + `subaction_tail_deg4` + `subaction_tail_deg5`, with per-child +mins `phi_lb_d6`/`phi_lb_deg4`/`phi_lb_general` and the tight anchor `cherry_anchor_ge_tight`. See §3.3(iii). + +## 3. Remaining pieces (updated 2026-09-03 by review-owner) + +The tail families cover uniform-degree configs. To cover ARBITRARY child multisets, the reduce-to-uniform argument. +Its structure is fully characterized; the message halves are now ALL proven: + +1. **Within a degree, only count + message-sum matter** — `ρwit` is affine in the message, so the message + *distribution* within a degree is irrelevant. (Established.) +2. **Message → worst endpoint** — the per-degree SUB-slack. **DONE for all three** (`BGSCLSubactionExch.lean`): + `tail_deg2_sum` (deg-2, slope-monotone), `tail_deg3_sum` (`log(1+S/d)−F* ≤ S/32`, ∀d≥5, `0≤S≤(d−1)/3`), + `tail_deg4_sum` (`log(1+S/d)−F* ≤ S/384`, ∀d≥5, `0≤S≤(d−1)/4`). So the message half of reduce-to-uniform is CLOSED + for every degree. +3. **Counts → single-degree exchange** — **DISSOLVED (2026-09-03, numerically verified; Lean pending).** NOT + discrete convexity. The **TANGENT-decouple** does it (subadditivity was too lossy — §5 — but the tangent at a + chosen `S0` is tight): from `log_tangent`, for ANY `S0`, + `G(config) := Σρwit(cᵢ) − (log(1+S/d)−F*) ≥ const(S0) + Σᵢ φ_{S0}(cᵢ) ≥ const(S0) + (d−1)·min_c φ_{S0}(c) =: B(S0)`, + where `φ_{S0}(c) = ρwit(c) − bY(c)/(d+S0)` and `const(S0) = F* − log(1+S0/d) + S0/(d+S0)`. `min_c φ_{S0}` is a + FINITE per-degree-class check (each `ρwit(c) − σ·bY(c)` is affine in the message ⇒ min at an endpoint; deg≥5 + contributes `−σ/5` at deg-5, bY=1/5). Choosing `S0 ∈ {(d−1)/3, (d−1)/4, (d−1)/5}` gives `B(S0) ≥ 0` for every + `d≥5` (verified d=5..1000; tight `B=0` at the d=6 tie via `S0=(d−1)/3`), and at the self-consistent `S0` the + algebra collapses `B` EXACTLY to the proven uniform-family bound (`tail_all_deg2`/`tail_all_deg4`) or the easy + `F* − log((6d−1)/(5d)) ≥ 0` (deg-5 regime). **400k random mixed configs: worst G = +0.025, no violations.** + Lean recipe: (i) per-child min lemma `∀ c, φ_{S0}(c) ≥ m_d` (per-degree-class, like the existing per-child + bounds); (ii) the `log_tangent` decouple + list-lift for `Σφ`; (iii) a 3-way `d`-split picking `S0`, each branch + closing via the matching `tail_all_*` family. Reduces the "nub" to patterned mechanical work. + **DONE (ii): the decouple backbone is KERNEL LEAN** (`BGSCLSubactionTailDecouple.lean`, AxiomGuard-guarded): + `sum_rhowit_ge` (list-lift), `ρwit_node_high` (`ρwit(node)=0` for deg≥5), and `tail_decouple` — which reduces + ANY tail cell to hypotheses `hpc` (the per-child bound (i)) + `hB` (`B(S0)≥0`). + **DONE (iii, three of the d-split branches — the mixed-config tail CLOSED for arbitrary children):** + - `subaction_tail_d6` (`|cs|=5`, the **tie**): `S0=(d−1)/3`, `phi_lb_d6`, `hB` via `tie_identity_d6`. + - `subaction_tail_deg4` (`d∈[10,61]`, **52 values**): `S0=(d−1)/4`, `phi_lb_deg4` (σ∈[5/384,4/49], deg-3 σ<>1/32 + split), `hB=tail_all_deg4` (B-terms collapse to `|cs|/1536`, arg `(5d−1)/(4d)`). Its d=10 boundary needs the + TIGHT anchor `cherry_anchor_ge_tight : 3/400 ≤ 2F*−log(3/2)`, proved via `2F*−log(3/2)=(1/11)log(529/486)` + (`529/486=(621/64)²(2/3)¹¹`, the 27·23 structure) + a degree-3 `Real.exp_bound` (`exp(33/400)≤529/486`). + - `subaction_tail_deg5` (`d≥65`, the **INFINITE** tail): `S0=|cs|/5`, `phi_lb_general` (any σ∈(0,5/384]), + `hB = F*−log((6d−1)/(5d)) ≥ 0` (from `(6/5)¹¹≤621/64`; B-terms cancel via `field_simp;ring`). + **Remaining tail (7 straggler degrees + wrapper):** `d∈{5,7,8,9}` (cherry regime, `S0=(d−1)/3`, + `m=2F*−log(3/2)−σ/3`, `hB=tail_all_deg2`; the d=9 boundary needs a tight UPPER anchor `≤~0.00779`, the mirror of + `cherry_anchor_ge_tight`) + `d∈{62,63,64}` (boundary, `S0=(d−1)/4`, `m=−σ/5` via `phi_lb_general` since σ≤5/384 + there, custom B). Then a `rcases`-on-`cs.length` wrapper unifying {d=6, cherry, deg-4, deg-5} into + `∀ cs, 4 ≤ cs.length → (tail SUB)`. +4. **Branch-level list lift** — expressing `Σρ`/`ΣbY` over arbitrary child lists (mechanical list induction). OPEN. +5. **d=4 cell wiring** — the 35 `d4_*` enclosure atoms + `tangent_atom` recipe are done; the 35 node-level + `subaction_deg4_*` cells (wire atom + `log_tangent` + `linarith` over the message box, per the d=3 templates in + `BGSCLSubactionDeg3Mid.lean`) are unwritten. MECHANICAL. Completes node degree 4. + +**Recommended next steps (in order of tractability):** (a) the 7 tail stragglers — the cherry range `d∈[5,9]` +(reuses the `subaction_tail_d6` pattern; needs one tight UPPER anchor atom, the mirror of `cherry_anchor_ge_tight`) ++ the 3 boundary values `d∈{62,63,64}` (reuse `phi_lb_general`, custom B); (b) the `rcases`-on-length tail wrapper +→ `∀ cs, 4 ≤ cs.length → (tail SUB)`; (c) the d=4 cell wiring (35 `subaction_deg4_*`, mechanical, completes node +deg 4); (d) the top-level `IsSubaction` degree-dispatch assembling everything. **All are patterned/mechanical — +with the counts exchange dissolved and the two tail extremes closed, no open MATHEMATICS remains, only Lean +assembly + a handful of tight boundary enclosures.** (Verify each green vs the kernel; `conjecture1_proved` stays +False until the whole `IsSubaction ρwit` builds sorry-free.) + +## 4. Tools & techniques (reusable) + +- **`tangent_atom (A kL kF B)`** (`BGSCLSubactionD4.lean`) — one-line tangent-route enclosures; `zpow` handles any + `log(3/2)`-fold sign; `hfold` is a `norm_num` fact (works even for ~120-digit folds, ~5s). +- **tight_hi route** — for folds `X>1`, `Q>0` (where tangent's `X−1≤11B` fails and the old `tight` route needs `Q<0`): + `Real.log_le_iff_le_exp` + a degree-`n` Taylor LOWER bound on `exp Q` (`Real.exp_bound`), auto-`n`. Used by + `log2_sub3fstar` (n=5), `tail_all_deg3`'s atom (n=5), `henc_deg2_q7` (n=4). Telperion shipped this as an emitter + route (`telperion/log-combination-tight-hi`), incl. a 5th route `tangent_multi` for the negative-`kL` (2,*) atoms. +- **cell-(D) drop-the-high-child recipe** — dissolves two-slope obstructions (deg-3 mixed, d=4 mixed). +- **tail family recipe** — `log((·d−1)/(·d)) = log(·) + log(1−1/(·d)) ≤ log(·) − 1/(·d)` (concavity) + a tight_hi atom + + a negative-discriminant quadratic `nlinarith [sq_nonneg (·)]`. +- **message-monotonicity** (`tail_deg2_sum`) — `g(S)=log(1+S/d)−S/4` monotone via `log((d+S)/(d+S0)) ≤ (S−S0)/(d+S0)`. + +## 5. Footguns (this line) + +- **NO-GO for the counts exchange (checked 2026-09-03): log-subadditivity is too lossy.** The tempting shortcut + `log(1+S/d) ≤ Σ log(1+bY(cᵢ)/d)` decouples the children (then each child's `δ = log(1+bY/d) − ρwit` is independent, + so the worst config is trivially uniform-at-argmax). But the subadditive bound loses too much: at d=18, all deg-4, + it gives `Σρ`-requirement `≈ 0.0279` where the EXACT `tail_all_deg4` needs `≤ 0.0111` (slack +0.006) — i.e. it fails + by 2.5×. So the counts exchange MUST use the exact coupled `log(1+S/d)`; the per-child/independence route is a dead + end. This is why (3) is genuinely discrete-convexity, not a per-child bound. +- `(4/3)^11 ≈ 23.7` (not ~4.4): `log(4/3) − F*` folds to `X≈2.44 > 1` ⇒ **tight_hi, not tangent**. Sanity-check fold + magnitudes before choosing a route. +- `field_simp` sometimes fully closes an identity ⇒ a trailing `ring` errors "no goals" (case-dependent; e.g. `hfact` + needs bare `field_simp`, but `hid` needs `field_simp; ring`). +- List-length casts: `↑(0+1+1+1+1+1)` needs `Nat.reduceAdd` in the simp set to fold to 5. +- ℕ-degree dispatch: after `subst h` the goal carries `↑5` — `push_cast` BEFORE `rw [show (4*(5:ℝ)−1)/… = …]`. +- `positivity` won't use hypotheses for `set`-opaque terms — discharge `0 ≤ S0` / `0 < 1+S0/d` explicitly + (`div_nonneg`, `div_pos`). +- `Real.log_zpow` + `positivity` handle signed folds uniformly; `norm_num` evaluates zpow of concrete rationals. + +## 6. Honest scope + +Proven: the reduction, the witness + nonnegativity, deg-1/2/3 cells complete, the full d=4 atom table, all three +uniform tail families, the tie, all three reduce-to-uniform message halves, the counts-exchange DISSOLUTION, the +kernel-Lean `tail_decouple` backbone, and the mixed-config tail CLOSED for `d=6`, `d∈[10,61]`, `d≥65` (arbitrary +children). Open: 7 tail straggler degrees (`d∈{5,7,8,9}` + `d∈{62,63,64}`, each a `tail_decouple` instantiation +needing its boundary enclosure), the tail wrapper, the 35 d=4 cell wirings, and the top-level `IsSubaction` +degree-dispatch. No open MATHEMATICS — but the ceiling is NOT closed. Do NOT claim it closed until `IsSubaction ρwit` +builds sorry-free end-to-end. This ceiling line is distinct from the finite-n tree→hub Hnorm/Hdom work. diff --git a/proof/docs/BG_SUBACTION_D4_TAIL_TIE_SPEC.md b/proof/docs/BG_SUBACTION_D4_TAIL_TIE_SPEC.md new file mode 100644 index 00000000..5df83db7 --- /dev/null +++ b/proof/docs/BG_SUBACTION_D4_TAIL_TIE_SPEC.md @@ -0,0 +1,151 @@ +# BG additive-SUBACTION: d=4 profiles, the deg≥5 tail, and the 27·23 tie — spec (2026-09-03) + +Continues `BG_SUBACTION_TELPERION_NEXTCELLS.md` after the **degree-3 family completed** (commit `378186e`, +`R3Cert/BGSCLSubactionDeg3Mid.lean`). Covers the three remaining pieces of `IsSubaction ρwit`: +**(A) d=4 mixed profiles**, **(B) the deg≥5 tail**, **(C) the 27·23 tie identity**. All numerics verified against +`F* = log(621/64)/11`, `ρwit(leaf)=F*, ρwit(2,μ)=2F*−log(3/2)+(μ−1/3)/4, ρwit(3,μ)=μ/32, ρwit(4,μ)=μ/384, ρwit(≥5)=0`. +`conjecture1_proved = False`. + +> **Stale-table correction.** The existing `subaction_cell_broom_d4` / `subaction_cell_d4_d3` / +> `log54_sub_fstar_le` / `ρ3` in `BGSCLSubaction.lean` were built for a **superseded** witness +> (`ρ3(μ)=(μ−1/5)/8`, `ρ(broom)=0`) that FAILS the high-degree tail (see the NOTE at `BGSCLSubaction.lean:159`). +> They are true isolated inequalities but are **NOT cells of `ρwit`**. The d=4 family below is for the corrected +> `ρwit` (deg-4 node ρ = `bY/384`) and is genuinely open. + +--- + +## Part A — d=4 mixed profiles: PATTERNED, ready to emit (all TANGENT route) + +A d=4 hub has 3 children; `ρwit(node) = bY(node)/384`, `bY(node) = 1/(4+S)`, `S = Σ bY(child_i)`. +All **35 profiles** (multisets of child degrees from {leaf, 2, 3, 4, ≥5}) are TRUE, and — unlike cell (D) — +**each closes with a single `log_tangent` at its binding corner** (no two-slope wall, because every d=4 profile's +binding corner puts all children at a common message, so one tangent point is exact there and slack ≥0 at the +other corners; verified over all 8 corners × all 35 profiles). + +### Recipe (per profile, mirror the deg-3 cells) +For a profile with children of types `t1,t2,t3`: +1. Bound each child message to its range: leaf `=1`; deg-2 `∈[1/3,1/2]`; deg-3 `∈[0,1/3]`; deg-4 `∈[0,1/4]`; deg≥5 `∈[0,1/5]`. +2. `log_tangent (d:=4) (s:=S) (s0:=S_bind)` where `S_bind` = the binding-corner message sum (table below), giving + `log(1+S/4) ≤ log((4+S_bind)/4) + (S−S_bind)/(4+S_bind)`. +3. Node-ρ: `ρwit(node) ≤ 1/(384·(4+S_min))` (`S_min` = children at min message). +4. Per-child ρ: deg-2 EQUALITY `2F*−log(3/2)+(μ−1/3)/4`; deg-3 `=μ/32`; deg-4 `=μ/384`; deg≥5 drop (`≥0`); leaf `=F*`. +5. The **atom** (single-log enclosure, table below). Then `linarith [message bounds]` — the post-tangent goal is + **linear** in the messages, so `linarith` closes it over the whole box (no per-corner case split needed). + +### The 35 atoms (all verified; route = tangent unless noted). Format `log(A) + kL·log(3/2) − kF·F* ≤ bound`: + +| profile | atom | +|---|---| +| (leaf,leaf,leaf) | `log(7/4) − 4F* ≤ −1/2688` | +| (2,leaf,leaf) | `log(19/12) − log(3/2) − 5F* ≤ −1/2432` | +| (2,2,leaf) | `log(17/12) − 2log(3/2) − 6F* ≤ −1/2176` | +| (2,2,2) | `log(5/4) − 3log(3/2) − 7F* ≤ −1/1920` | +| (2,2,3) | `log(5/4) − 2log(3/2) − 5F* ≤ 53/5376` | +| (2,2,4) | `log(59/48) − 2log(3/2) − 5F* ≤ 1/10752` | +| (2,2,5) | `log(73/60) − 2log(3/2) − 5F* ≤ −1/1792` | +| (2,3,leaf) | `log(17/12) − log(3/2) − 4F* ≤ 61/6144` | +| (2,3,3) | `log(5/4) − log(3/2) − 3F* ≤ 101/4992` | +| (2,3,4) | `log(59/48) − log(3/2) − 3F* ≤ 209/19968` | +| (2,3,5) | `log(73/60) − log(3/2) − 3F* ≤ 49/4992` | +| (2,4,leaf) | `log(67/48) − log(3/2) − 4F* ≤ 1/6144` | +| (2,4,4) | `log(29/24) − log(3/2) − 3F* ≤ 7/9984` | +| (2,4,5) | `log(287/240) − log(3/2) − 3F* ≤ 1/19968` | +| (2,5,leaf) | `log(83/60) − log(3/2) − 4F* ≤ −1/2048` | +| (2,5,5) | `log(71/60) − log(3/2) − 3F* ≤ −1/1664` | +| (3,leaf,leaf) | `log(19/12) − 3F* ≤ 23/2304` | +| (3,3,leaf) | `log(17/12) − 2F* ≤ 13/640` | +| (3,3,3) | `log(5/4) − F* ≤ 47/1536` | +| (3,3,4) | `log(59/48) − F* ≤ 1/48` | +| (3,3,5) | `log(73/60) − F* ≤ 31/1536` | +| (3,4,leaf) | `log(67/48) − 2F* ≤ 27/2560` | +| (3,4,4) | `log(29/24) − F* ≤ 17/1536` | +| (3,4,5) | `log(287/240) − F* ≤ 1/96` | +| (3,5,leaf) | `log(83/60) − 2F* ≤ 19/1920` | +| (3,5,5) | `log(71/60) − F* ≤ 5/512` | +| (4,leaf,leaf) | `log(25/16) − 3F* ≤ 1/4608` | +| (4,4,leaf) | `log(11/8) − 2F* ≤ 1/1280` | +| (4,4,4) | `log(19/16) − F* ≤ 1/768` | +| (4,4,5) | `log(47/40) − F* ≤ 1/1536` | +| (4,5,leaf) | `log(109/80) − 2F* ≤ 1/7680` | +| (4,5,5) | `log(93/80) − F* ≤ 0` (MONOTONE — bound is exactly 0) | +| (5,leaf,leaf) | `log(31/20) − 3F* ≤ −1/2304` | +| (5,5,leaf) | `log(27/20) − 2F* ≤ −1/1920` | +| (5,5,5) | `log(23/20) − F* ≤ −1/1536` | + +Every atom's fold `X = A^11 · (3/2)^(11·kL) · (621/64)^(−kF)` satisfies `X−1 ≤ 11·bound` ⇒ **tangent route** +(`Real.log_le_sub_one_of_pos`), the cheapest — `norm_num` discharges the rational `X−1 ≤ 11·bound`. The one exception +`(4,5,5)` has bound 0 ⇒ **monotone**. **None need tight_hi** (unlike deg-3's `deg3_deg2children_enc` / cell-(D)'s +`log2_sub3fstar`). Hand this table to Telperion as 35 `emit_log_combination` calls; auto-route will pick tangent/monotone. + +--- + +## Part B — the deg≥5 tail: THE ONE GENUINELY-OPEN PIECE (needs a uniform-in-d lemma) + +A deg-`d` hub (`d≥5`) has `k=d−1` children and `ρwit(node)=0`, so `(SUB)` is +`log(1+S/d) − F* ≤ Σ_i ρwit(child_i)`, `S = Σ bY(child_i)`. + +### The naive "Σρ ≥ |leaf children|·F*" design is WRONG +It fails whenever there are no leaves: e.g. **four deg-3 children** (d=5, all `bY=1/3`) has `e_node = log(19/15)−F* ≈ ++0.030 > 0` but `|leaves|·F* = 0`. The message-carried ρ of the non-leaf children is **essential** and cannot be +dropped (drop-the-child, the cell-(D) escape, does NOT apply here — the deg-3 children push `S` up *and* their ρ is +needed). This is why the tail is not a uniform `≤0` collapse and not a deg-3/d=4-style patterned emit. + +### Empirical map (exhaustive over compositions, d=5..14; uniform-type sampled to d=199) +- The **worst profile at each d is uniform-type**: all-deg-2 for `d ≤ 9`, all-deg-4 for `d ≥ 10`. +- Per-type minimum margin over d: **all-deg-2 → 0 (at d=6, the tie)**; all-deg-3 → +0.0119 (d=5); **all-deg-4 → +0.0057 + (d=18)**; all-deg-5 → +0.025 (d→large). Margins are tiny but strictly positive except the d=6 tie. +- A single `log_tangent` at the binding S closes each *individual* d — but the crude `log(1+x)≤x` bound (s0=0) does + **not** close until `d ≈ 62` (deg-4 children have `ρ/bY = 1/384`, so per-child `bY/d ≤ ρ` needs `d ≥ 384`; only + log-concavity saves it below that). So "finite cells up to D0 + crude tail" is impractical (`D0 ≈ 62`). + +### Recommended proof design (the actionable path) +Two obligations: + +1. **Reduce-to-uniform** (`tail_worst_is_uniform`): for fixed d, the SUB-slack `Σρ_i − (log(1+S/d)−F*)` is minimised + at a uniform-type profile (all children the same degree, at the binding message). Exchange/convexity argument: + each child's `(bY_i/(d+s0)) − ρ(child_i)` contribution is convex, so an extremal profile is uniform. Discharges the + combinatorial explosion (arbitrary d−1-child mixes) down to 4 one-parameter families. + +2. **Three per-type d-families** (the real content — each a `d`-indexed enclosure, tie/min at the noted d): + - `tail_all_deg2`: `log((4d−1)/(3d)) ≤ (2d−1)·F* − (d−1)·log(3/2)` (`bY=1/3`, `S=(d−1)/3`; **equality at d=6**). + - `tail_all_deg3`: `log((4d−1)/(3d)) − F* ≤ (d−1)/96` (`bY=1/3`; min slack +0.0119 at d=5). + - `tail_all_deg4`: `log((5d−1)/(4d)) − F* ≤ (d−1)/1536` (`bY=1/4`, `S=(d−1)/4`; **crux, min +0.0057 at d=18**). + - (all-deg-5 / leaves: `e_node < 0` or ρ dominates — a crude `log(1+x)≤x` closes them; no family needed.) + + Each family has slack that is **convex in d with a single interior minimum** (d=6 / d=5 / d=18). Prove by: verify the + finite window around the minimum (a handful of explicit d), then a monotone tail `d ≥ D_t` via `log(1+x) ≤ x − + x²/2 + x³/3` (`x∈[0,1]`) — the degree-3 log upper bound keeps enough concavity that `Σρ` (linear in d) dominates + for large d. The **all-deg-4 family is the crux**: min margin +0.0057 at d=18, tie-adjacent, and `ρ=bY/384` is the + flattest — this is where a naive bound dies and the cubic-log correction is required. + +**Status: this is the remaining research.** It is NOT a Telperion emit (no finite atom list); it is a BG-side +uniform induction/monotonicity proof. The empirics (worst=uniform, exact d=6 tie, convex-in-d slack) de-risk it, but +the `tail_all_deg4` d-family + the reduce-to-uniform exchange lemma are genuinely new proof obligations. + +--- + +## Part C — the 27·23 = 621 tie identity + +The witness is calibrated so `(SUB)` holds with **exact equality** (margin 0) at the tie configurations — these are +where `621 = 27·23` appears and the ceiling is sharp. Two exact-equality cells (verified margin `0` to machine ε): + +1. **`subaction_cherry`** (already proven) — d=2 hub, one leaf child. `bY(node)=1/3`, `ρwit(node)=2F*−log(3/2)`, and + `(log(3/2)−F*) + (2F*−log(3/2)) = F* = ρwit(leaf)`. The **degree-2 face** of the tie (`F* ≤ F*`). +2. **`subaction_tail_tie_d6`** (open) — d=6 hub, five deg-2 children each at `bY=1/3`. `S=5/3`, + `e_node = log((4·6−1)/(3·6))−F* = log(23/18)−F*`, `Σρ = 5·(2F*−log(3/2))`, and + `log(23/18) − F* = 5·(2F*−log(3/2))` **exactly** ⟺ `log(23/18) + 5·log(3/2) = 11·F* = log(621/64)` + ⟺ `(23/18)·(3/2)^5 = 621/64` ⟺ `23·243 / (18·32) = 621/64` ⟺ `5589/576 = 621/64` ✓ (both `= 9.703125`). + This is the `27·23` identity in the tail: `23·3^5 = 23·243 = 5589` and `621·9 = 5589`, i.e. `621 = 27·23` with the + `3^5/18 = 27/... ` bookkeeping. It is an **exact `norm_num` identity once F* is unfolded** (`11·F* = log(621/64)`, + `log((23/18)·(3/2)^5) = log(621/64)`), NOT an enclosure — the cleanest cell in the family. + +The tie also lives at the boundary of the deg-2 tail family (`tail_all_deg2` above is tight exactly at d=6), so proving +`tail_all_deg2` subsumes `subaction_tail_tie_d6`. + +--- + +## Handoff summary +- **d=4 (Part A):** ready now — 35 tangent/monotone atoms tabulated; emit + assemble exactly like the deg-3 leaf cells. +- **tie (Part C):** ready now — `subaction_tail_tie_d6` is an exact `norm_num` log-identity (`(23/18)(3/2)^5=621/64`). +- **deg≥5 tail (Part B):** the one open research piece — reduce-to-uniform + three per-type d-families (deg-4 the crux); + a BG-side uniform induction, not a Telperion emit. diff --git a/proof/docs/BG_SUBACTION_TELPERION_NEXTCELLS.md b/proof/docs/BG_SUBACTION_TELPERION_NEXTCELLS.md new file mode 100644 index 00000000..1f2f4a58 --- /dev/null +++ b/proof/docs/BG_SUBACTION_TELPERION_NEXTCELLS.md @@ -0,0 +1,128 @@ +# Telperion handoff — enclosure atoms for the next `IsSubaction ρwit` cells (2026-09-03) + +**For the parallel Telperion session.** Branch `bg/scl-on-main` (GitHub `DrMurphyIsIn/Arda`). +Companion to `BG_CEILING_SUBACTION_HANDOFF.md`. `conjecture1_proved = False`. + +## 0. What Telperion produces + +The BG ceiling now rests on the single obligation `IsSubaction ρwit`, discharged cell-by-cell over a +finite per-node family. Each cell's proof (BG side) does: `log_tangent` decouple → node-ρ bound → +per-child ρ lower bounds → `linarith`. The **one analytic input Telperion supplies per cell is a scalar +enclosure atom** — a message-independent inequality of the form + +``` +Σ_i a_i · Real.log (r_i) − k · FSTAR ≤ B (a_i, k, B, r_i all rational) +``` + +emitted by `emit_log_combination`. Multiply by 11 (`11·FSTAR = log(621/64)`) to get the **fold** +`X = ∏_i r_i^(11 a_i) · (64/621)^k`, and the atom is exactly `log X ≤ 11·B`, i.e. `X ≤ exp(11·B)`. +Route by where `X` sits: + +- **monotone** — `log x ≤ x − 1` at `X ≤ 1` with `11B = 0` (strictly requires `q = 0`). Cheapest. +- **tangent** — degree-1 `log x ≤ x − 1` folded through FSTAR, gated by `X − 1 ≤ 11B` (`11B = N·q`), any-sign `q`. +- **tight** (Q<0) — degree-3 exp Taylor (`Real.exp_bound'`, `n = 3`) for the **added-FSTAR** blocker shape + (`log(7/9) + F* ≤ …`), where `11B < 0`. Shows `X · exp(−11B) ≤ 1`. HARD-REQUIRES `11B < 0`. +- **tight_hi** (Q>0) — degree-`n` exp **lower** bound for `11B > 0` with fold `X > 1`. Discharges `log X ≤ 11B` + via `Real.log_le_iff_le_exp` + `Real.exp_bound` (`exp(11B) ≥ Sₙ − Eₙ`) then rational `X ≤ Sₙ − Eₙ`; + auto-picks the smallest `n ≤ 8` that closes. This route DID NOT EXIST when the spec was first written — it was + added by the Telperion session for atom (A) (branch `telperion/log-combination-tight-hi`). + +Established examples in-repo (match this naming + shape): `log119_sub_fstar` (tangent), +`log79_add_fstar` (tight, `q = 11/24`), `log74_le_4fstar`, `log54_sub_fstar_le'`, `log53_enc`, `d2_deg5_enc`. + +> **Route-label correction (2026-09-03, post-delivery).** The route tags in §2 below were WRONG in the first +> draft and are corrected here: (A) is **tight_hi** (not the existing tight route — that requires `Q<0`, atom A +> has `Q=+79/96`); (B) and (C) are **tangent** (not monotone — monotone strictly needs `q=0`, and the +> `X−1 ≤ N·q` gate quoted for them is the *tangent* gate). Atom A also folds cleanly `2·log(3/2)+log(4/3)=log 3` +> (fold `X = 3^11/(621/64)^5 ≈ 2.06`). All three were emitter-generated and delivered on +> `bg/scl-deg3-leaf-cells` (`R3Cert/BGSCLSubactionEnc2.lean`), axiom-clean. + +## 1. State reconciliation (the §3/§5 cell table in the main handoff is slightly stale) + +Already **landed** on `bg/scl-on-main` (verified present + axiom-clean via `AxiomGuard.lean`, commit `80e51d1`): + +| node deg | children | cell theorem | +|---|---|---| +| 1 | — | `subaction_nil` | +| 2 | leaf | `subaction_cherry` | +| 2 | deg-2 | `subaction_deg2_deg2child` | +| 2 | deg≥3 | `subaction_deg2_highchild` | +| 2 | deg≥5 | `subaction_deg2_deg5child` | +| 3 | leaf,leaf | `subaction_broom_d3` | +| 3 | deg≥3,deg≥3 | `subaction_deg3_highchildren` | +| 4 | leaf,leaf,leaf | `subaction_cell_broom_d4` | +| 4 | deg-3 profile | `subaction_cell_d4_d3` | + +So deg-1, deg-2 (all child types), and part of deg-3/deg-4 are done. Remaining below. + +## 2. READY TO EMIT — three atoms, exact, verified numerically + +These three cells close with a single tangent + independent per-child bounds; Telperion can generate the +atoms immediately. Constants verified against `F* = log(621/64)/11 ≈ 0.2065862`. + +### (A) `subaction_deg3_deg2children` — deg-3 hub, two deg-2 children [route: TIGHT_HI] +- BG assembly: `s0 = 1` (slope `1/(3+1) = 1/4` = ρwit(deg-2) slope ⇒ per-child bound message-independent); + `log_tangent (d:=3)(s:=S)(s0:=1)`: `log(1+S/3) ≤ log(4/3) + (S−1)/4`. Node-ρ `ρwit(node)=1/(32(3+S)) ≤ 3/352` (`S ≥ 2/3`). +- **Atom:** `2·Real.log (3/2) + Real.log (4/3) − 5·FSTAR ≤ 79/1056` (LHS folds to `log 3 − 5·FSTAR`). +- Fold `Y = 3^11/(621/64)^5 = (3/2)^22·(4/3)^11·(64/621)^5 ≈ 2.0596 > 1`; `11B = 79/96 ≈ 0.8229 > 0`. This needs the + **tight_hi route** (Q>0, X>1) — the existing tight route requires `Q<0` and does NOT apply, and `x−1 ≈ 1.06 > 0.82` + kills the tangent gate. `Real.exp_bound` degree-`n` lower bound, auto-picks `n = 4` (slack ≈ 0.17), `exp(79/96) ≈ 2.277 ≥ Y`. +- Delivered as `deg3_deg2children_enc` (multi-term ⇒ `_enc` suffix), cell margin **+0.00913**. + +### (B) `subaction_deg3_leaf_deg2` — deg-3 hub, one leaf + one deg-2 child [route: TANGENT] +- The leaf's `ρwit = F*` alone dominates the RHS (`F* ≤ ρwit(leaf)+ρwit(deg-2)`), so the cell reduces to + `e_node + ρwit(node) ≤ F*` in the single variable `S = 1 + bY(deg-2) ∈ [4/3, 3/2]`. The LHS is increasing in `S` + (derivative `1/(3+S) − 1/(32(3+S)²) > 0`), so evaluate at the endpoint `S = 3/2`. +- **Atom:** `Real.log (3/2) − 2·FSTAR ≤ −1/144`. +- Fold `X = (3/2)^11·(64/621)^2 ≈ 0.9188`; `11B = −11/144 ≈ −0.0764 < 0`; `X−1 ≈ −0.0812 ≤ 11B` → **tangent** OK + (NOT monotone — monotone requires `11B = 0`; this passes the `X−1 ≤ 11B` tangent gate). +- Delivered as `log32_sub2fstar`, cell margin **+0.00076** (tight but valid). + +### (C) `subaction_deg3_leaf_high` — deg-3 hub, one leaf + one deg≥3 child [route: TANGENT] +- Same "leaf ρ = F* dominates" reduction; `S = 1 + bY(deg≥3) ∈ [1, 4/3]`, endpoint `S = 4/3`. +- **Atom:** `Real.log (13/9) − 2·FSTAR ≤ −3/416`. +- Fold `X = (13/9)^11·(64/621)^2 ≈ 0.6069`; `11B = −33/416 ≈ −0.0793 < 0`; `X−1 ≈ −0.393 ≤ 11B` → **tangent**, huge slack. +- Delivered as `log139_sub2fstar`, cell margin **+0.038** (comfortable). + +## 3. CELL (D) — SOLVED (redesign landed); (E)/(F) still need BG-side design + +### (D) `subaction_deg3_deg2_high` — deg-3 hub, one deg-2 + one deg≥3 child [RESOLVED 2026-09-03] +The two-slope obstruction (deg-2 ρwit slope `1/4` vs deg≥3 per-child slope `3/11`; a single tangent can't +match both, overshoots ≈ **+0.0043** at the `(bY_d2,bY_h)=(1/3,0)` corner via the loose `rhowit_ge_perchild` +line) is **dissolved WITHOUT a two-slope decouple**. Key move: the high child's message is small (`bY_h ≤ 1/3`), +so bound it into a constant, **DROP its (nonnegative) `ρwit` entirely** (no per-child line ⇒ no slope to match), +and reduce to a single-variable inequality in the deg-2 child's message. Tangent at `s0 = 1` (slope-match the +deg-2 child), node-ρ `≤ 3/320`, and ONE new atom closes it. Proven + axiom-clean in +`R3Cert/BGSCLSubactionDeg3Mid.lean` (`subaction_deg3_deg2_high`), worst corner `(1/3,1/3)`, atom margin `+0.0006`. +- **New atom (delivered here, `log2_sub3fstar`) — route TIGHT_HI:** `Real.log (4/3) + Real.log (3/2) − 3·FSTAR ≤ 71/960`. + Fold `X = (4/3)¹¹·(3/2)¹¹·(621/64)⁻³ = 536870912/239483061 ≈ 2.2418 > 1`, `Q = 781/960 > 0`. **Needs degree-5 + Taylor** (n=4 lower bound `≈ 2.2114 < X`; n=5 gives `exp Q ≥ 61122928451812033/27179089920000000 ≥ X`) — a data + point that the tight_hi auto-`n` search must go past n=4. Dogfood note for the emitter: confirm it escalates n. + +### (E) Remaining d=4 mixed profiles [the (D) trick unblocks the two-slope cases] +`subaction_cell_broom_d4` (all-leaf) and `subaction_cell_d4_d3` (deg-3 children) are done. The mixed profiles +(leaf/deg-2/deg≥3 combinations across the 3 children) follow the same assembly with reference +`s0 = 3·(child max message)` per profile. Any profile mixing a deg-2 and a deg≥3 child previously hit the (D) +two-slope obstruction — **now dissolved by the same (D) recipe**: bound each deg≥3 child's message `≤ 1/3`, +drop its `ρwit ≥ 0`, and slope-match only the deg-2 child(ren). Each profile still needs its own scalar atom +(different constant/fold), but the *shape* is settled — no research left, just per-profile atom emits. Recommend +BG enumerate the d=4 profiles and hand Telperion the atom list; each is monotone/tangent or tight_hi by fold. + +### (F) deg≥5 tail +`ρwit(node) = 0` for deg ≥ 5, so `(SUB)` is `e_node ≤ Σ_c ρwit(c)`. This is **not** a uniform `≤ 0` collapse: +leaf children push `S` up to `d − 1`, so `e_node = log(1 + S/d) − F*` can be positive and must be covered by +`Σ ρwit ≥ (#leaf children)·F*`. Needs the decouple with the bound `Σ_c ρwit(c) ≥ |leaf children|·F*`; the +residual atom is a family in `d` (parametric), not a single scalar — BG to state the parametric form first. + +## 4. Verification protocol (per atom) + +1. Telperion emits the atom lemma into `R3Cert/BGSCLSubactionEnc.lean` (or a new `…Enc*.lean`), route as + specified, `import Mathlib` + `import R3Cert.BGSCLInduction`, namespace `R3Cert.BGSCL`. +2. `lake build R3Cert.BGSCLSubactionEnc` green; no bare `sorry`/`admit` (write "no \`sorry\`" in prose to + avoid the CI grep-scan false positive). +3. Deliver on the branch; BG side merges + writes the cell theorem consuming it, then adds the cell theorem to + `AxiomGuard.lean` (`#print axioms R3Cert.BGSCL.subaction_…`) so CI keeps the axiom-clean claim enforced. +4. Confirm `lake env lean AxiomGuard.lean` reports `[propext, Classical.choice, Quot.sound]` (no `sorryAx`). + +Local build works: `PATH=$HOME/.elan/bin; cd proof/formalization; lake exe cache get; lake build …` +(toolchain v4.32.0; the `R3Cert.+` glob self-builds every module). diff --git a/proof/docs/probes/bg_tail_counts_exchange_dissolution.py b/proof/docs/probes/bg_tail_counts_exchange_dissolution.py new file mode 100644 index 00000000..9bb12303 --- /dev/null +++ b/proof/docs/probes/bg_tail_counts_exchange_dissolution.py @@ -0,0 +1,25 @@ +# Repro: the tail counts->single-degree EXCHANGE is DISSOLVED by the tangent-decouple. +# G(config) >= const(S0) + (d-1)*min_c phi_{S0}(c) =: B(S0); some S0 in {(d-1)/3,(d-1)/4,(d-1)/5} gives B>=0 +# for all d>=5 (tight=0 at the d=6 tie). 400k random mixed configs: worst G > 0. (2026-09-03) +import math, random +random.seed(2) +F=math.log(621/64)/11; LOG32=math.log(3/2) +def rho(deg,y): + if deg==1: return F + if deg==2: return 2*F-LOG32+(y-1/3)/4 + if deg==3: return y/32 + if deg==4: return y/384 + return 0.0 +def rng(deg): return [1.0] if deg==1 else [1/(2*deg-1),1/deg] +def minphi(sigma): + return min(rho(deg,y)-sigma*y for deg in list(range(1,80))+[150,400] for y in rng(deg)) +def B(d,S0): + sigma=1/(d+S0); return F-math.log(1+S0/d)+S0/(d+S0)+(d-1)*minphi(sigma) +assert all(max(B(d,(d-1)/3),B(d,(d-1)/4),B(d,(d-1)/5))>=-1e-9 for d in range(5,2000)), "B>=0 fails" +worst=min( + sum(rho(dg,y) for dg,y in kids)-(math.log(1+sum(y for _,y in kids)/d)-F) + for _ in range(400000) + for d in [random.randint(5,160)] + for kids in [[(dg,1.0 if dg==1 else random.uniform(*rng(dg))) for dg in (random.choice([1,2,3,4,5,6,8,12]) for _ in range(d-1))]] +) +print(f"B(S0)>=0 for all d in [5,2000): OK; worst G over 400k mixed configs = {worst:+.6f} (>=0 => dissolved)") diff --git a/proof/formalization/AxiomGuard.lean b/proof/formalization/AxiomGuard.lean index 2bcfbe86..293be5ba 100644 --- a/proof/formalization/AxiomGuard.lean +++ b/proof/formalization/AxiomGuard.lean @@ -20,11 +20,108 @@ the two open layers Hnorm/Hdom); guarding it guards its entire dependency cone. * R3Cert.phi_le_one — the Φ ≤ 1 analytic crux. * R3Cert.CappedJointConfig.gstep_le_one_achievable — the g-step / master ineq crux. + + Additive SUBACTION ceiling (2026-09-03, branch bg/scl-on-main) — the current live + line for the classical branch ceiling `∀ b, bell b ≤ 0`, after the multiplicative + capped-product step `Le1Step` was REFUTED (BG_LE1STEP_REFUTED_20260902.md). The + ceiling reduces to the single obligation `IsSubaction ρwit`; guarding the reduction + chain + each discharged per-cell family member keeps the "kernel-green, axiom-clean" + claim machine-enforced as the family grows. + * R3Cert.BGSCL.ceiling_of_subaction — the additive bridge (ρ≥0 ∧ IsSubaction ρ → ceiling). + * R3Cert.BGSCL.ρwit_nonneg — the witness nonnegativity leg (discharged). + * R3Cert.BGSCL.ceiling_of_witness — ceiling ⟸ IsSubaction ρwit (the single obligation). + * R3Cert.BGSCL.subaction_* — the discharged cells of the IsSubaction ρwit family. -/ import R3Cert.R47TopCapstone import R3Cert.PotentialFinal import R3Cert.CappedJointClosure +import R3Cert.BGSCLSubaction +import R3Cert.BGSCLSubactionDeg3 +import R3Cert.BGSCLSubactionDeg3Mid +import R3Cert.BGSCLSubactionD4 +import R3Cert.BGSCLSubactionTail +import R3Cert.BGSCLSubactionTailDecouple +import R3Cert.BGSCLSubactionD4Cells +import R3Cert.BGSCLSubactionTailWrap +import R3Cert.BGSCLSubactionDispatch #print axioms R3Cert.Step3.conjecture1_of_layers #print axioms R3Cert.phi_le_one #print axioms R3Cert.CappedJointConfig.gstep_le_one_achievable + +-- Additive SUBACTION reduction chain (the ceiling now rests on `IsSubaction ρwit`). +#print axioms R3Cert.BGSCL.ceiling_of_subaction +#print axioms R3Cert.BGSCL.ρwit_nonneg +#print axioms R3Cert.BGSCL.ceiling_of_witness + +-- Tail (deg≥5) DECOUPLE backbone: reduces a mixed-degree tail cell to per-child bound + B(S0)≥0 +-- (the counts-exchange dissolution; no discrete convexity). +#print axioms R3Cert.BGSCL.sum_rhowit_ge +#print axioms R3Cert.BGSCL.ρwit_node_high +#print axioms R3Cert.BGSCL.tail_decouple +-- First CLOSED mixed-config tail cell: the d=6 tie (arbitrary children), via tail_decouple. +#print axioms R3Cert.BGSCL.phi_lb_d6 +#print axioms R3Cert.BGSCL.subaction_tail_d6 +-- The INFINITE tail closed: deg-5 regime, ALL nodes of degree >= 65, arbitrary children. +#print axioms R3Cert.BGSCL.cherry_anchor_ge +#print axioms R3Cert.BGSCL.phi_lb_general +#print axioms R3Cert.BGSCL.subaction_tail_deg5 +-- The deg-4 range regime d in [10,61]: tight anchor + per-child min + tail_all_deg4. +#print axioms R3Cert.BGSCL.cherry_anchor_ge_tight +#print axioms R3Cert.BGSCL.phi_lb_deg4 +#print axioms R3Cert.BGSCL.subaction_tail_deg4 + +-- Discharged cells of the `IsSubaction ρwit` per-node family. +#print axioms R3Cert.BGSCL.subaction_nil +#print axioms R3Cert.BGSCL.subaction_cherry +#print axioms R3Cert.BGSCL.subaction_deg2_deg2child +#print axioms R3Cert.BGSCL.subaction_deg2_highchild +#print axioms R3Cert.BGSCL.subaction_broom_d3 +#print axioms R3Cert.BGSCL.subaction_deg3_highchildren + +-- Degree-3 hub family completed (2026-09-03): the two-deg-2, leaf/deg-2, leaf/deg≥3 profiles, +-- and the redesigned two-slope (deg-2/deg≥3) cell + its new tight_hi atom `log2_sub3fstar`. +#print axioms R3Cert.BGSCL.subaction_deg3_deg2children +#print axioms R3Cert.BGSCL.subaction_deg3_leaf_deg2 +#print axioms R3Cert.BGSCL.subaction_deg3_leaf_high +#print axioms R3Cert.BGSCL.log2_sub3fstar + +-- Degree-4 enclosure atoms (2026-09-03): the tangent-route generator + representatives spanning the +-- structural cases (log(3/2)-fold present/absent, bound sign). All 35 `d4_*` go through `tangent_atom`. +#print axioms R3Cert.BGSCL.tangent_atom +#print axioms R3Cert.BGSCL.d4_222 +#print axioms R3Cert.BGSCL.d4_333 +#print axioms R3Cert.BGSCL.d4_455 + +-- The deg≥5 tail crux family + the 27·23 = 621 tie identity (2026-09-03). +#print axioms R3Cert.BGSCL.tail_all_deg4 +#print axioms R3Cert.BGSCL.tail_all_deg3 +#print axioms R3Cert.BGSCL.tail_all_deg2 +#print axioms R3Cert.BGSCL.tail_deg2_sum +#print axioms R3Cert.BGSCL.henc_deg2_qp7 +#print axioms R3Cert.BGSCL.henc_deg2_q7 +#print axioms R3Cert.BGSCL.tie_identity_d6 +#print axioms R3Cert.BGSCL.subaction_tail_tie_d6 +#print axioms R3Cert.BGSCL.subaction_deg3_deg2_high + +-- =========================================================================================== +-- CEILING CLOSED (2026-09-04): `IsSubaction ρwit` fully assembled ⇒ `bell b ≤ 0` for all b. +-- Degree-4 node cells (all 35, wiring the `d4_*` atoms), the 7 tail stragglers + gap-free +-- `tail_wrapper`, the permutation-invariance bridge, the top-level degree dispatch, and the +-- `bg_ceiling` capstone. These make the classical-branch ceiling machine-checked & axiom-clean. +-- =========================================================================================== +-- Permutation invariance of the SUB predicate (canonicalizes ordered cells to arbitrary orders). +#print axioms R3Cert.BGSCL.subaction_perm +-- Tail stragglers + the unified gap-free tail wrapper (∀ cs, 4 ≤ cs.length → SUB cs). +#print axioms R3Cert.BGSCL.cherry_anchor_le_tight +#print axioms R3Cert.BGSCL.subaction_tail_d9 +#print axioms R3Cert.BGSCL.tail_wrapper +-- Degree-4 node cells: representatives across the class spectrum + the canonicalizing dispatchers. +#print axioms R3Cert.BGSCL.subaction_deg4_LLL +#print axioms R3Cert.BGSCL.subaction_deg4_HHH +#print axioms R3Cert.BGSCL.subaction_deg4_L2H +#print axioms R3Cert.BGSCL.subaction_deg4_canon +#print axioms R3Cert.BGSCL.subaction_deg4 +-- The single obligation and the capstone: the ceiling now holds unconditionally. +#print axioms R3Cert.BGSCL.isSubaction_ρwit +#print axioms R3Cert.BGSCL.bg_ceiling diff --git a/proof/formalization/R3Cert/BGSCLCeil.lean b/proof/formalization/R3Cert/BGSCLCeil.lean new file mode 100644 index 00000000..153429d3 --- /dev/null +++ b/proof/formalization/R3Cert/BGSCLCeil.lean @@ -0,0 +1,312 @@ +/- + The per-hub branch-ceiling step `CeilStep` (BGSCLHub), degree ≤ 6. + + For a hub of root-degree `d ≤ 6`, the concave-log tangent at the EXACT all-cherry slope `μ* = 3/(4d-1)` (which + lies in the invariant price interval `I` for `d ≤ 6`) makes the child `S`-terms cancel exactly against the child + SCL bound, giving `bell (node cs) ≤ A_d := (d-1)(log(3/2) − 2F*) + log((4d-1)/(3d)) − F*`. `A_d ≤ 0` is a clean + rational log inequality — strict for `d ≤ 5`, and EXACTLY `0` at `d = 6` (the arithmetic tie + `(3/2)^5·(23/18) = 621/64`, i.e. the `n = 11` degree-6 near-broom). This closes the ceiling step for `d ≤ 6`. + (The `d ≥ 7` tail is the reachable-`y` envelope, gated in Telperion by `HighDegreeTailCertificate`.) + + conjecture1_proved = False. +-/ +import Mathlib +import R3Cert.BGSCLInduction +import R3Cert.BGSCLStep +import R3Cert.BGSCLHub + +namespace R3Cert +namespace BGSCL + +/-- All-cherry ceiling, d=2: `A_2 = log(3/2) + log(7/6) − 3F* ≤ 0`. -/ +theorem acl_d2 : Real.log (3/2) + Real.log (7/6) - 3*FSTAR ≤ 0 := by + have hF : FSTAR = Real.log (621/64)/11 := rfl + rw [hF] + have hcomb : (11:ℝ)*(Real.log (3/2) + Real.log (7/6) - 3*(Real.log (621/64)/11)) + = Real.log ((3/2)^11 * (7/6)^11 * (64/621)^3) := by + rw [Real.log_mul (by positivity) (by positivity), Real.log_mul (by positivity) (by positivity), + Real.log_pow, Real.log_pow, Real.log_pow, + show (64:ℝ)/621 = (621/64)⁻¹ by norm_num, Real.log_inv] + ring + have hX : Real.log ((3/2)^11 * (7/6)^11 * (64/621)^3) ≤ 0 := + Real.log_nonpos (by positivity) (by norm_num) + nlinarith [hcomb, hX] + +/-- All-cherry ceiling, d=3: `A_3 = 2 log(3/2) + log(11/9) − 5F* ≤ 0`. -/ +theorem acl_d3 : 2*Real.log (3/2) + Real.log (11/9) - 5*FSTAR ≤ 0 := by + have hF : FSTAR = Real.log (621/64)/11 := rfl + rw [hF] + have hcomb : (11:ℝ)*(2*Real.log (3/2) + Real.log (11/9) - 5*(Real.log (621/64)/11)) + = Real.log ((3/2)^22 * (11/9)^11 * (64/621)^5) := by + rw [Real.log_mul (by positivity) (by positivity), Real.log_mul (by positivity) (by positivity), + Real.log_pow, Real.log_pow, Real.log_pow, + show (64:ℝ)/621 = (621/64)⁻¹ by norm_num, Real.log_inv] + ring + have hX : Real.log ((3/2)^22 * (11/9)^11 * (64/621)^5) ≤ 0 := + Real.log_nonpos (by positivity) (by norm_num) + nlinarith [hcomb, hX] + +/-- All-cherry ceiling, d=4: `A_4 = 3 log(3/2) + log(5/4) − 7F* ≤ 0`. -/ +theorem acl_d4 : 3*Real.log (3/2) + Real.log (5/4) - 7*FSTAR ≤ 0 := by + have hF : FSTAR = Real.log (621/64)/11 := rfl + rw [hF] + have hcomb : (11:ℝ)*(3*Real.log (3/2) + Real.log (5/4) - 7*(Real.log (621/64)/11)) + = Real.log ((3/2)^33 * (5/4)^11 * (64/621)^7) := by + rw [Real.log_mul (by positivity) (by positivity), Real.log_mul (by positivity) (by positivity), + Real.log_pow, Real.log_pow, Real.log_pow, + show (64:ℝ)/621 = (621/64)⁻¹ by norm_num, Real.log_inv] + ring + have hX : Real.log ((3/2)^33 * (5/4)^11 * (64/621)^7) ≤ 0 := + Real.log_nonpos (by positivity) (by norm_num) + nlinarith [hcomb, hX] + +/-- All-cherry ceiling, d=5: `A_5 = 4 log(3/2) + log(19/15) − 9F* ≤ 0`. -/ +theorem acl_d5 : 4*Real.log (3/2) + Real.log (19/15) - 9*FSTAR ≤ 0 := by + have hF : FSTAR = Real.log (621/64)/11 := rfl + rw [hF] + have hcomb : (11:ℝ)*(4*Real.log (3/2) + Real.log (19/15) - 9*(Real.log (621/64)/11)) + = Real.log ((3/2)^44 * (19/15)^11 * (64/621)^9) := by + rw [Real.log_mul (by positivity) (by positivity), Real.log_mul (by positivity) (by positivity), + Real.log_pow, Real.log_pow, Real.log_pow, + show (64:ℝ)/621 = (621/64)⁻¹ by norm_num, Real.log_inv] + ring + have hX : Real.log ((3/2)^44 * (19/15)^11 * (64/621)^9) ≤ 0 := + Real.log_nonpos (by positivity) (by norm_num) + nlinarith [hcomb, hX] + +/-- All-cherry ceiling, d=6: `A_6 = 5 log(3/2) + log(23/18) − 11F* ≤ 0` — EXACTLY `0` (the tie + `(3/2)^5·(23/18) = 621/64`). -/ +theorem acl_d6 : 5*Real.log (3/2) + Real.log (23/18) - 11*FSTAR ≤ 0 := by + have hF : FSTAR = Real.log (621/64)/11 := rfl + rw [hF] + have hcomb : (11:ℝ)*(5*Real.log (3/2) + Real.log (23/18) - 11*(Real.log (621/64)/11)) + = Real.log ((3/2)^55 * (23/18)^11 * (64/621)^11) := by + rw [Real.log_mul (by positivity) (by positivity), Real.log_mul (by positivity) (by positivity), + Real.log_pow, Real.log_pow, Real.log_pow, + show (64:ℝ)/621 = (621/64)⁻¹ by norm_num, Real.log_inv] + ring + have hX : Real.log ((3/2)^55 * (23/18)^11 * (64/621)^11) ≤ 0 := + Real.log_nonpos (by positivity) (by norm_num) + nlinarith [hcomb, hX] + +/-- `bell cherry ≤ 0` (`log(3/2) − 2F* ≤ 0`). -/ +theorem bell_cherry_nonpos : bell cherry ≤ 0 := by + rw [bell_cherry] + have hF : FSTAR = Real.log (621/64)/11 := rfl + rw [hF] + have hcomb : (11:ℝ)*(Real.log (3/2) - 2*(Real.log (621/64)/11)) + = Real.log ((3/2)^11 * (64/621)^2) := by + rw [Real.log_mul (by positivity) (by positivity), Real.log_pow, Real.log_pow, + show (64:ℝ)/621 = (621/64)⁻¹ by norm_num, Real.log_inv] + ring + have hX : Real.log ((3/2)^11 * (64/621)^2) ≤ 0 := Real.log_nonpos (by positivity) (by norm_num) + nlinarith [hcomb, hX] + +/-- **Ceiling step, d=2** (`cs.length = 1`). Leaf child ⟹ hub `= cherry` (`bell cherry ≤ 0`); non-leaf ⟹ + the all-cherry decouple at `μ* = 3/7` gives `bell (node cs) ≤ A_2 = log(3/2) + log(7/6) − 3F* ≤ 0`. -/ +theorem ceil_hub_d2 {cs : List Branch} (hlen : cs.length = 1) + (hchild : ∀ c ∈ cs, PSCLne c) : bell (Branch.node cs) ≤ 0 := by + obtain ⟨c, rfl⟩ : ∃ c, cs = [c] := by + cases cs with + | nil => simp at hlen + | cons c t => cases t with + | nil => exact ⟨c, rfl⟩ + | cons _ _ => simp at hlen + have hc1 : PSCLne c := hchild c (List.mem_cons.mpr (Or.inl rfl)) + by_cases hc : c = Branch.node [] + · subst hc + show bell (Branch.node [Branch.node []]) ≤ 0 + have hch : Branch.node [Branch.node []] = cherry := rfl + rw [hch]; exact bell_cherry_nonpos + · set S := (([c] : List Branch).map bY).sum with hSdef + have hSnn : 0 ≤ S := by + rw [hSdef]; apply List.sum_nonneg; intro x hx; rw [List.mem_map] at hx + obtain ⟨z, _, rfl⟩ := hx; exact bY_nonneg z + have hlenR : (([c] : List Branch).length : ℝ) = 1 := by norm_num + have hchild2 : ∀ x ∈ ([c] : List Branch), bV (3/7) x ≤ bV (3/7) cherry := by + intro x hx; rw [List.mem_singleton] at hx; subst hx + exact hc1 hc (3/7) (by constructor <;> norm_num) + have hsum : (([c] : List Branch).map bell).sum + ≤ (([c] : List Branch).length : ℝ) * bV (3/7) cherry - (3/7) * (([c] : List Branch).map bY).sum := + child_bell_sum_le (3/7) [c] hchild2 + rw [hlenR, ← hSdef] at hsum + have htan := bell_node_tangent [c] (s0 := 1/3) (by norm_num) + rw [hlenR, ← hSdef] at htan + have hlogeq : Real.log (1 + 1/3/((1:ℝ)+1)) = Real.log (7/6) := by norm_num + have hden : ((1:ℝ)+1)+1/3 = 7/3 := by norm_num + rw [hlogeq, hden] at htan + have hRHS : bell (Branch.node [c]) + ≤ (1 * bV (3/7) cherry - (3/7) * S) + (Real.log (7/6) + (S - 1/3)/(7/3) - FSTAR) := by + linarith [htan, hsum] + have hbridge : (1 * bV (3/7) cherry - (3/7) * S) + (Real.log (7/6) + (S - 1/3)/(7/3) - FSTAR) + = Real.log (3/2) + Real.log (7/6) - 3*FSTAR := by + rw [bV, bell_cherry, bY_cherry]; ring + linarith [hRHS, hbridge, acl_d2] + +/-- **Ceiling step, d=3** (`cs.length = 2`). `μ* = 3/11 ∈ I`, `s0 = 2/3` ⟹ `bell (node cs) ≤ A_3 ≤ 0`. -/ +theorem ceil_hub_d3 {cs : List Branch} (hlen : cs.length = 2) + (hchild : ∀ c ∈ cs, PSCLne c) : bell (Branch.node cs) ≤ 0 := by + set S := (cs.map bY).sum with hSdef + have hSnn : 0 ≤ S := by + rw [hSdef]; apply List.sum_nonneg; intro x hx; rw [List.mem_map] at hx + obtain ⟨z, _, rfl⟩ := hx; exact bY_nonneg z + have hlenR : (cs.length : ℝ) = 2 := by exact_mod_cast hlen + have hchild2 : ∀ c ∈ cs, bV (3/11) c ≤ bV (3/11) cherry := by + intro c hc + by_cases hleaf : c = Branch.node [] + · subst hleaf; exact leaf_le_cherry (by norm_num) + · exact hchild c hc hleaf (3/11) (by constructor <;> norm_num) + have hsum : (cs.map bell).sum ≤ (cs.length : ℝ) * bV (3/11) cherry - (3/11) * (cs.map bY).sum := + child_bell_sum_le (3/11) cs hchild2 + rw [hlenR, ← hSdef] at hsum + have htan := bell_node_tangent cs (s0 := 2/3) (by norm_num) + rw [hlenR, ← hSdef] at htan + have hlogeq : Real.log (1 + 2/3/((2:ℝ)+1)) = Real.log (11/9) := by norm_num + have hden : ((2:ℝ)+1)+2/3 = 11/3 := by norm_num + rw [hlogeq, hden] at htan + have hRHS : bell (Branch.node cs) + ≤ (2 * bV (3/11) cherry - (3/11) * S) + (Real.log (11/9) + (S - 2/3)/(11/3) - FSTAR) := by + linarith [htan, hsum] + have hbridge : (2 * bV (3/11) cherry - (3/11) * S) + (Real.log (11/9) + (S - 2/3)/(11/3) - FSTAR) + = 2*Real.log (3/2) + Real.log (11/9) - 5*FSTAR := by + rw [bV, bell_cherry, bY_cherry]; ring + linarith [hRHS, hbridge, acl_d3] + +/-- **Ceiling step, d=4** (`cs.length = 3`). `μ* = 1/5 ∈ I`, `s0 = 1` ⟹ `bell (node cs) ≤ A_4 ≤ 0`. -/ +theorem ceil_hub_d4 {cs : List Branch} (hlen : cs.length = 3) + (hchild : ∀ c ∈ cs, PSCLne c) : bell (Branch.node cs) ≤ 0 := by + set S := (cs.map bY).sum with hSdef + have hSnn : 0 ≤ S := by + rw [hSdef]; apply List.sum_nonneg; intro x hx; rw [List.mem_map] at hx + obtain ⟨z, _, rfl⟩ := hx; exact bY_nonneg z + have hlenR : (cs.length : ℝ) = 3 := by exact_mod_cast hlen + have hchild2 : ∀ c ∈ cs, bV (1/5) c ≤ bV (1/5) cherry := by + intro c hc + by_cases hleaf : c = Branch.node [] + · subst hleaf; exact leaf_le_cherry (by norm_num) + · exact hchild c hc hleaf (1/5) (by constructor <;> norm_num) + have hsum : (cs.map bell).sum ≤ (cs.length : ℝ) * bV (1/5) cherry - (1/5) * (cs.map bY).sum := + child_bell_sum_le (1/5) cs hchild2 + rw [hlenR, ← hSdef] at hsum + have htan := bell_node_tangent cs (s0 := 1) (by norm_num) + rw [hlenR, ← hSdef] at htan + have hlogeq : Real.log (1 + 1/((3:ℝ)+1)) = Real.log (5/4) := by norm_num + have hden : ((3:ℝ)+1)+1 = 5 := by norm_num + rw [hlogeq, hden] at htan + have hRHS : bell (Branch.node cs) + ≤ (3 * bV (1/5) cherry - (1/5) * S) + (Real.log (5/4) + (S - 1)/5 - FSTAR) := by + linarith [htan, hsum] + have hbridge : (3 * bV (1/5) cherry - (1/5) * S) + (Real.log (5/4) + (S - 1)/5 - FSTAR) + = 3*Real.log (3/2) + Real.log (5/4) - 7*FSTAR := by + rw [bV, bell_cherry, bY_cherry]; ring + linarith [hRHS, hbridge, acl_d4] + +/-- **Ceiling step, d=5** (`cs.length = 4`). `μ* = 3/19 ∈ I`, `s0 = 4/3` ⟹ `bell (node cs) ≤ A_5 ≤ 0`. -/ +theorem ceil_hub_d5 {cs : List Branch} (hlen : cs.length = 4) + (hchild : ∀ c ∈ cs, PSCLne c) : bell (Branch.node cs) ≤ 0 := by + set S := (cs.map bY).sum with hSdef + have hSnn : 0 ≤ S := by + rw [hSdef]; apply List.sum_nonneg; intro x hx; rw [List.mem_map] at hx + obtain ⟨z, _, rfl⟩ := hx; exact bY_nonneg z + have hlenR : (cs.length : ℝ) = 4 := by exact_mod_cast hlen + have hchild2 : ∀ c ∈ cs, bV (3/19) c ≤ bV (3/19) cherry := by + intro c hc + by_cases hleaf : c = Branch.node [] + · subst hleaf; exact leaf_le_cherry (by norm_num) + · exact hchild c hc hleaf (3/19) (by constructor <;> norm_num) + have hsum : (cs.map bell).sum ≤ (cs.length : ℝ) * bV (3/19) cherry - (3/19) * (cs.map bY).sum := + child_bell_sum_le (3/19) cs hchild2 + rw [hlenR, ← hSdef] at hsum + have htan := bell_node_tangent cs (s0 := 4/3) (by norm_num) + rw [hlenR, ← hSdef] at htan + have hlogeq : Real.log (1 + 4/3/((4:ℝ)+1)) = Real.log (19/15) := by norm_num + have hden : ((4:ℝ)+1)+4/3 = 19/3 := by norm_num + rw [hlogeq, hden] at htan + have hRHS : bell (Branch.node cs) + ≤ (4 * bV (3/19) cherry - (3/19) * S) + (Real.log (19/15) + (S - 4/3)/(19/3) - FSTAR) := by + linarith [htan, hsum] + have hbridge : (4 * bV (3/19) cherry - (3/19) * S) + (Real.log (19/15) + (S - 4/3)/(19/3) - FSTAR) + = 4*Real.log (3/2) + Real.log (19/15) - 9*FSTAR := by + rw [bV, bell_cherry, bY_cherry]; ring + linarith [hRHS, hbridge, acl_d5] + +/-- **Ceiling step, d=6** (`cs.length = 5`). `μ* = 3/23 ∈ I`, `s0 = 5/3` ⟹ `bell (node cs) ≤ A_6 = 0` + (the exact `n=11` degree-6 tie). -/ +theorem ceil_hub_d6 {cs : List Branch} (hlen : cs.length = 5) + (hchild : ∀ c ∈ cs, PSCLne c) : bell (Branch.node cs) ≤ 0 := by + set S := (cs.map bY).sum with hSdef + have hSnn : 0 ≤ S := by + rw [hSdef]; apply List.sum_nonneg; intro x hx; rw [List.mem_map] at hx + obtain ⟨z, _, rfl⟩ := hx; exact bY_nonneg z + have hlenR : (cs.length : ℝ) = 5 := by exact_mod_cast hlen + have hchild2 : ∀ c ∈ cs, bV (3/23) c ≤ bV (3/23) cherry := by + intro c hc + by_cases hleaf : c = Branch.node [] + · subst hleaf; exact leaf_le_cherry (by norm_num) + · exact hchild c hc hleaf (3/23) (by constructor <;> norm_num) + have hsum : (cs.map bell).sum ≤ (cs.length : ℝ) * bV (3/23) cherry - (3/23) * (cs.map bY).sum := + child_bell_sum_le (3/23) cs hchild2 + rw [hlenR, ← hSdef] at hsum + have htan := bell_node_tangent cs (s0 := 5/3) (by norm_num) + rw [hlenR, ← hSdef] at htan + have hlogeq : Real.log (1 + 5/3/((5:ℝ)+1)) = Real.log (23/18) := by norm_num + have hden : ((5:ℝ)+1)+5/3 = 23/3 := by norm_num + rw [hlogeq, hden] at htan + have hRHS : bell (Branch.node cs) + ≤ (5 * bV (3/23) cherry - (3/23) * S) + (Real.log (23/18) + (S - 5/3)/(23/3) - FSTAR) := by + linarith [htan, hsum] + have hbridge : (5 * bV (3/23) cherry - (3/23) * S) + (Real.log (23/18) + (S - 5/3)/(23/3) - FSTAR) + = 5*Real.log (3/2) + Real.log (23/18) - 11*FSTAR := by + rw [bV, bell_cherry, bY_cherry]; ring + linarith [hRHS, hbridge, acl_d6] + +/-- `0 ≤ F*` (`621/64 ≥ 1`). -/ +theorem fstar_nonneg : (0:ℝ) ≤ FSTAR := by + rw [FSTAR]; exact div_nonneg (Real.log_nonneg (by norm_num)) (by norm_num) + +/-- **The d≥7 hub-ceiling residual.** For a hub of root-degree `d ≥ 7`, `bell (node cs) ≤ 0` given the child + ceilings AND child SCL. This is the ONLY residual of the whole branch-ceiling + SCL after the `d ≤ 6` + ceilings are proven (numeric margin `+0.0015`, worst at the all-cherry hub). It is the high-degree tail of + the `M_d` frontier: the all-cherry price `μ* = 3/(4d-1)` falls BELOW the invariant interval `I` for `d ≥ 7`, + so the `d ≤ 6` all-cherry decouple does not apply, and the SCL-on-`I` bound alone overshoots by `~0.004` + (the min-`y` regime needs the reachable-`y` structure). Gated in Telperion (`HighDegreeTailCertificate` + + the near-broom certificates). `conjecture1_proved = False`. -/ +def CeilStepHi : Prop := + ∀ cs : List Branch, 6 ≤ cs.length → + (∀ c ∈ cs, bell c ≤ 0) → (∀ c ∈ cs, PSCLne c) → bell (Branch.node cs) ≤ 0 + +/-- **The full per-hub ceiling step, from the d≥7 residual.** `d ≤ 6` is PROVEN (the all-cherry decouple, + including the exact `d = 6` arithmetic tie `acl_d6`); `d ≥ 7` is `CeilStepHi`. Note the `d ≤ 6` ceilings + need only the child SCL (not the child ceilings) — the child ceilings are consumed only by the tail. -/ +theorem ceilStep_of_hi (hhi : CeilStepHi) : CeilStep := by + intro cs hcc hcs + rcases cs with _ | ⟨a, t⟩ + · rw [bell_leaf]; linarith [fstar_nonneg] + · have h1 : 1 ≤ (a :: t).length := by simp + rcases Nat.lt_or_ge (a :: t).length 6 with hlo | hge + · rcases (by omega : (a :: t).length = 1 ∨ (a :: t).length = 2 ∨ (a :: t).length = 3 + ∨ (a :: t).length = 4 ∨ (a :: t).length = 5) with h | h | h | h | h + · exact ceil_hub_d2 h hcs + · exact ceil_hub_d3 h hcs + · exact ceil_hub_d4 h hcs + · exact ceil_hub_d5 h hcs + · exact ceil_hub_d6 h hcs + · exact hhi (a :: t) hge hcc hcs + +/-- **Joint ceiling + SCL for every branch, from the d≥7 residual.** The `d ≤ 6` ceiling — including the tight + `n = 11` degree-6 arithmetic tie — is now PROVEN in Lean; the ENTIRE branch ceiling `∀ b, bell b ≤ 0` and the + leaf-excluding SCL `∀ b, PSCLne b` reduce to the single high-degree-tail residual `CeilStepHi` (margin + `+0.0015`). `conjecture1_proved = False`. -/ +theorem ceil_and_scl_of_ceilStepHi (hhi : CeilStepHi) : ∀ b, bell b ≤ 0 ∧ PSCLne b := + ceil_and_scl_of_ceilStep (ceilStep_of_hi hhi) + +/-- The branch ceiling `∀ b, bell b ≤ 0` from the d≥7 residual. -/ +theorem bell_ceiling_of_ceilStepHi (hhi : CeilStepHi) : ∀ b, bell b ≤ 0 := + fun b => (ceil_and_scl_of_ceilStepHi hhi b).1 + +/-- The SCL `∀ b, PSCLne b` from the d≥7 residual. -/ +theorem scl_of_ceilStepHi (hhi : CeilStepHi) : ∀ b, PSCLne b := + fun b => (ceil_and_scl_of_ceilStepHi hhi b).2 + +end BGSCL +end R3Cert diff --git a/proof/formalization/R3Cert/BGSCLCeilHi.lean b/proof/formalization/R3Cert/BGSCLCeilHi.lean new file mode 100644 index 00000000..dd56275b --- /dev/null +++ b/proof/formalization/R3Cert/BGSCLCeilHi.lean @@ -0,0 +1,138 @@ +/- + Per-child-degree BUDGET lemmas toward the d≥7 hub-ceiling residual `CeilStepHi` (BGSCLCeil). + + The natural attack on `CeilStepHi` (`bell(node cs) ≤ 0` for a hub of degree `d ≥ 7`) is the all-cherry + concave-log tangent at slope `μ* = 3/(4d-1)`, using the SHARP per-degree ceiling `bell(c) ≤ cbound(deg c)` + (`= A_k` for `3 ≤ k ≤ 6`, `= log(3/2) − 2F*` for `k = 2` [the cherry, NOT `A_2`], `= −F*` for a leaf, `= 0` + for `k ≥ 7`) with `deg-2` children handled by SCL extend-below-`I` (their `y ≥ 1/3`). This closes EXACTLY for + `7 ≤ d ≤ 15`; for `d ≥ 16` the price `μ*` drops below the crossover and the incompatible (bell-max, y-max) of + low-degree children breaks the per-child inequality — the genuine `TieSlack` regime (matching the BG ledger's + step 2a, `k ≥ 16`), which needs a separate slack argument. So these lemmas are NECESSARY infrastructure but + do NOT on their own discharge `CeilStepHi`; the `d ≥ 16` tail remains open. + + The `key_dk` lemmas (`7·A_k + 1/k ≤ F*`, the `d = 7` per-child budget; `d ≥ 7` follows by `A_k ≤ 0` + monotonicity) reduce (11×-clear) to `log(W_k) ≤ −11/k`, discharged by bounding `exp(11/k) ≤ r_k` (small + integer, via `(exp(11/k))^k = (exp 1)^11 < 2.7182818286^11 ≤ r_k^k`) then `W_k · r_k ≤ 1` (`norm_num`, no + large powers). `k = 5, 6` instead use `A_k ≤ 0` + `1/k ≤ F*` (avoids the huge `norm_num`). + conjecture1_proved = False. +-/ +import Mathlib +import R3Cert.BGSCLInduction +import R3Cert.BGSCLStep +import R3Cert.BGSCLHub +import R3Cert.BGSCLCeil + +namespace R3Cert +namespace BGSCL + +/-- Per-child budget, k=2: `7·A_2 + 1/2 ≤ F*`, `A_2 = log(3/2) + log(7/6) − 3F*`. -/ +theorem key_d2 : 7*(Real.log (3/2) + Real.log (7/6) - 3*FSTAR) + 1/2 ≤ FSTAR := by + have e1 : (Real.exp (11/2))^2 = Real.exp 11 := by rw [← Real.exp_nat_mul]; congr 1; norm_num + have e2 : (Real.exp 1)^11 = Real.exp 11 := by rw [← Real.exp_nat_mul]; congr 1; norm_num + have hb : (Real.exp 1)^11 ≤ (2.7182818286:ℝ)^11 := + pow_le_pow_left₀ (Real.exp_nonneg 1) (le_of_lt Real.exp_one_lt_d9) 11 + have hexp : Real.exp (11/2) ≤ (300:ℝ) := by + have hpk : (Real.exp (11/2))^2 ≤ (300:ℝ)^2 := by + rw [e1, ← e2]; have : (2.7182818286:ℝ)^11 ≤ (300:ℝ)^2 := by norm_num + linarith + exact le_of_pow_le_pow_left₀ (by norm_num) (by norm_num) hpk + have hWK : (0:ℝ) < (3/2:ℝ)^77*(7/6)^77*(64/621)^22 := by positivity + have h1 : ((3/2:ℝ)^77*(7/6)^77*(64/621)^22) * Real.exp (11/2) ≤ 1 := by + have hm := mul_le_mul_of_nonneg_left hexp (le_of_lt hWK) + have hWr : ((3/2:ℝ)^77*(7/6)^77*(64/621)^22) * (300:ℝ) ≤ 1 := by norm_num + linarith + have hlogW : Real.log ((3/2:ℝ)^77*(7/6)^77*(64/621)^22) ≤ -(11/2) := by + have h3 : Real.log (((3/2:ℝ)^77*(7/6)^77*(64/621)^22) * Real.exp (11/2)) ≤ 0 := by + rw [Real.log_le_iff_le_exp (by positivity), Real.exp_zero]; exact h1 + rw [Real.log_mul (ne_of_gt hWK) (ne_of_gt (Real.exp_pos _)), Real.log_exp] at h3; linarith + have hF : FSTAR = Real.log (621/64)/11 := rfl + have hcomb : (11:ℝ)*(7*(Real.log (3/2) + Real.log (7/6) - 3*FSTAR) + 1/2 - FSTAR) + = Real.log ((3/2:ℝ)^77*(7/6)^77*(64/621)^22) + 11/2 := by + rw [hF, Real.log_mul (by positivity) (by positivity), Real.log_mul (by positivity) (by positivity), + Real.log_pow, Real.log_pow, Real.log_pow, show (64:ℝ)/621=(621/64)⁻¹ by norm_num, Real.log_inv] + ring + linarith [hcomb, hlogW] + +/-- Per-child budget, k=3: `7·A_3 + 1/3 ≤ F*`, `A_3 = 2 log(3/2) + log(11/9) − 5F*`. -/ +theorem key_d3 : 7*(2*Real.log (3/2) + Real.log (11/9) - 5*FSTAR) + 1/3 ≤ FSTAR := by + have e1 : (Real.exp (11/3))^3 = Real.exp 11 := by rw [← Real.exp_nat_mul]; congr 1; norm_num + have e2 : (Real.exp 1)^11 = Real.exp 11 := by rw [← Real.exp_nat_mul]; congr 1; norm_num + have hb : (Real.exp 1)^11 ≤ (2.7182818286:ℝ)^11 := + pow_le_pow_left₀ (Real.exp_nonneg 1) (le_of_lt Real.exp_one_lt_d9) 11 + have hexp : Real.exp (11/3) ≤ (45:ℝ) := by + have hpk : (Real.exp (11/3))^3 ≤ (45:ℝ)^3 := by + rw [e1, ← e2]; have : (2.7182818286:ℝ)^11 ≤ (45:ℝ)^3 := by norm_num + linarith + exact le_of_pow_le_pow_left₀ (by norm_num) (by norm_num) hpk + have hWK : (0:ℝ) < (3/2:ℝ)^154*(11/9)^77*(64/621)^36 := by positivity + have h1 : ((3/2:ℝ)^154*(11/9)^77*(64/621)^36) * Real.exp (11/3) ≤ 1 := by + have hm := mul_le_mul_of_nonneg_left hexp (le_of_lt hWK) + have hWr : ((3/2:ℝ)^154*(11/9)^77*(64/621)^36) * (45:ℝ) ≤ 1 := by norm_num + linarith + have hlogW : Real.log ((3/2:ℝ)^154*(11/9)^77*(64/621)^36) ≤ -(11/3) := by + have h3 : Real.log (((3/2:ℝ)^154*(11/9)^77*(64/621)^36) * Real.exp (11/3)) ≤ 0 := by + rw [Real.log_le_iff_le_exp (by positivity), Real.exp_zero]; exact h1 + rw [Real.log_mul (ne_of_gt hWK) (ne_of_gt (Real.exp_pos _)), Real.log_exp] at h3; linarith + have hF : FSTAR = Real.log (621/64)/11 := rfl + have hcomb : (11:ℝ)*(7*(2*Real.log (3/2) + Real.log (11/9) - 5*FSTAR) + 1/3 - FSTAR) + = Real.log ((3/2:ℝ)^154*(11/9)^77*(64/621)^36) + 11/3 := by + rw [hF, Real.log_mul (by positivity) (by positivity), Real.log_mul (by positivity) (by positivity), + Real.log_pow, Real.log_pow, Real.log_pow, show (64:ℝ)/621=(621/64)⁻¹ by norm_num, Real.log_inv] + ring + linarith [hcomb, hlogW] + +/-- Per-child budget, k=4 (binding): `7·A_4 + 1/4 ≤ F*`, `A_4 = 3 log(3/2) + log(5/4) − 7F*`. -/ +theorem key_d4 : 7*(3*Real.log (3/2) + Real.log (5/4) - 7*FSTAR) + 1/4 ≤ FSTAR := by + have e1 : (Real.exp (11/4))^4 = Real.exp 11 := by rw [← Real.exp_nat_mul]; congr 1; norm_num + have e2 : (Real.exp 1)^11 = Real.exp 11 := by rw [← Real.exp_nat_mul]; congr 1; norm_num + have hb : (Real.exp 1)^11 ≤ (2.7182818286:ℝ)^11 := + pow_le_pow_left₀ (Real.exp_nonneg 1) (le_of_lt Real.exp_one_lt_d9) 11 + have hexp : Real.exp (11/4) ≤ (16:ℝ) := by + have hpk : (Real.exp (11/4))^4 ≤ (16:ℝ)^4 := by + rw [e1, ← e2]; have : (2.7182818286:ℝ)^11 ≤ (16:ℝ)^4 := by norm_num + linarith + exact le_of_pow_le_pow_left₀ (by norm_num) (by norm_num) hpk + have hWK : (0:ℝ) < (3/2:ℝ)^231*(5/4)^77*(64/621)^50 := by positivity + have h1 : ((3/2:ℝ)^231*(5/4)^77*(64/621)^50) * Real.exp (11/4) ≤ 1 := by + have hm := mul_le_mul_of_nonneg_left hexp (le_of_lt hWK) + have hWr : ((3/2:ℝ)^231*(5/4)^77*(64/621)^50) * (16:ℝ) ≤ 1 := by norm_num + linarith + have hlogW : Real.log ((3/2:ℝ)^231*(5/4)^77*(64/621)^50) ≤ -(11/4) := by + have h3 : Real.log (((3/2:ℝ)^231*(5/4)^77*(64/621)^50) * Real.exp (11/4)) ≤ 0 := by + rw [Real.log_le_iff_le_exp (by positivity), Real.exp_zero]; exact h1 + rw [Real.log_mul (ne_of_gt hWK) (ne_of_gt (Real.exp_pos _)), Real.log_exp] at h3; linarith + have hF : FSTAR = Real.log (621/64)/11 := rfl + have hcomb : (11:ℝ)*(7*(3*Real.log (3/2) + Real.log (5/4) - 7*FSTAR) + 1/4 - FSTAR) + = Real.log ((3/2:ℝ)^231*(5/4)^77*(64/621)^50) + 11/4 := by + rw [hF, Real.log_mul (by positivity) (by positivity), Real.log_mul (by positivity) (by positivity), + Real.log_pow, Real.log_pow, Real.log_pow, show (64:ℝ)/621=(621/64)⁻¹ by norm_num, Real.log_inv] + ring + linarith [hcomb, hlogW] + +/-- `1/5 ≤ F*` (`11/5 ≤ log(621/64)`, via `exp(11/5) ≤ 9.5 ≤ 621/64`). -/ +theorem recip5_le_fstar : (1:ℝ)/5 ≤ FSTAR := by + have e1 : (Real.exp (11/5))^5 = Real.exp 11 := by rw [← Real.exp_nat_mul]; congr 1; norm_num + have e2 : (Real.exp 1)^11 = Real.exp 11 := by rw [← Real.exp_nat_mul]; congr 1; norm_num + have hb : (Real.exp 1)^11 ≤ (2.7182818286:ℝ)^11 := + pow_le_pow_left₀ (Real.exp_nonneg 1) (le_of_lt Real.exp_one_lt_d9) 11 + have hexp : Real.exp (11/5) ≤ (9.5:ℝ) := by + have hpk : (Real.exp (11/5))^5 ≤ (9.5:ℝ)^5 := by + rw [e1, ← e2]; have : (2.7182818286:ℝ)^11 ≤ (9.5:ℝ)^5 := by norm_num + linarith + exact le_of_pow_le_pow_left₀ (by norm_num) (by norm_num) hpk + have hlog : (11:ℝ)/5 ≤ Real.log (621/64) := by + rw [Real.le_log_iff_exp_le (by norm_num)]; exact le_trans hexp (by norm_num) + rw [FSTAR]; linarith + +/-- Per-child budget, k=5: `7·A_5 + 1/5 ≤ F*` — since `A_5 ≤ 0` (`acl_d5`) and `1/5 ≤ F*`. -/ +theorem key_d5 : 7*(4*Real.log (3/2) + Real.log (19/15) - 9*FSTAR) + 1/5 ≤ FSTAR := by + have hA5 : 4*Real.log (3/2) + Real.log (19/15) - 9*FSTAR ≤ 0 := acl_d5 + linarith [hA5, recip5_le_fstar] + +/-- Per-child budget, k=6: `7·A_6 + 1/6 ≤ F*` — since `A_6 ≤ 0` (`acl_d6`) and `1/6 ≤ 1/5 ≤ F*`. -/ +theorem key_d6 : 7*(5*Real.log (3/2) + Real.log (23/18) - 11*FSTAR) + 1/6 ≤ FSTAR := by + have hA6 : 5*Real.log (3/2) + Real.log (23/18) - 11*FSTAR ≤ 0 := acl_d6 + linarith [hA6, recip5_le_fstar] + +end BGSCL +end R3Cert diff --git a/proof/formalization/R3Cert/BGSCLDecouple.lean b/proof/formalization/R3Cert/BGSCLDecouple.lean new file mode 100644 index 00000000..c00fdfd5 --- /dev/null +++ b/proof/formalization/R3Cert/BGSCLDecouple.lean @@ -0,0 +1,178 @@ +/- + SCL per-hub decouple residual — the `nlinarith` core of `FlowedHubStep` (the d≤6 tangent decouple). + This discharges the Telperion `PerHubDecoupleResidualCertificate` in Lean. The d=2 residual `R(S) ≤ 0` + is PROVEN here (no `sorry`, axiom-clean); d=3..6 follow by the SAME template (`log((4d-1)/(3d))` combined via + `×11` into `log(rational)`, bounded by a clean `exp` power, then `μ/(d+S)` cleared and `nlinarith` on the + upward parabola in `S`). Verified against the Telperion cert (20 endpoint atoms, margin ≥ +0.007). + conjecture1_proved = False. +-/ +import Mathlib +import R3Cert.BGSCLInduction +import R3Cert.BGSCLStep + +namespace R3Cert +namespace BGSCL + +/-- The keystone log bound for the d=2 decouple: `g := log(7/6) − F* ≤ −1/22`. Via `11·g = + log((7/6)^11 · 64/621)` and the clean half-integer bound `exp(1/2) = √(exp 1) < 1.6489`. -/ +theorem log76_gap : Real.log (7/6) - FSTAR ≤ -(1/22) := by + have hF : FSTAR = Real.log (621 / 64) / 11 := rfl + rw [hF] + have hcomb : (11:ℝ) * (Real.log (7/6) - Real.log (621/64)/11) + = Real.log ((7/6)^11 * (64/621)) := by + rw [Real.log_mul (by positivity) (by norm_num), Real.log_pow, + show (64:ℝ)/621 = (621/64)⁻¹ by norm_num, Real.log_inv]; ring + have hval : Real.log ((7/6)^11 * (64/621)) ≤ -(1/2) := by + rw [Real.log_le_iff_le_exp (by positivity), Real.exp_neg] + have hehalf : Real.exp (1/2) * Real.exp (1/2) = Real.exp 1 := by rw [← Real.exp_add]; norm_num + have h1 : Real.exp 1 < 2.7182818286 := Real.exp_one_lt_d9 + have hexp12 : Real.exp (1/2) < 1.6489 := by nlinarith [hehalf, h1, Real.exp_pos (1/2 : ℝ)] + have hpos : (0:ℝ) < Real.exp (1/2) := Real.exp_pos _ + have hinvcancel : (Real.exp (1/2))⁻¹ * Real.exp (1/2) = 1 := inv_mul_cancel₀ (ne_of_gt hpos) + have hinvpos : (0:ℝ) < (Real.exp (1/2))⁻¹ := inv_pos.mpr hpos + nlinarith [hexp12, hpos, hinvcancel, hinvpos] + nlinarith [hcomb, hval] + +/-- d=2 decouple residual `R(S) ≤ 0` on `S ∈ [0, 1/2]`, `μ ∈ I`. `μ'' = muPP 2 μ = 3(7−3μ)/49`; + `R(S) = μ''/3 − μ/3 − 1/7 + log(7/6) − F* + 9μS/49 + μ/(2+S)`. The log part `≤ −1/22` (`log76_gap`); + the rational part `≤ 1/22` after clearing `(2+S) > 0` (upward parabola, margin `+0.0002`). -/ +theorem decouple_d2 (μ S : ℝ) (hμ : inI μ) (hS0 : 0 ≤ S) (hSmax : S ≤ 1/2) : + (muPP 2 μ)/3 - μ/3 - 1/7 + Real.log (7/6) - FSTAR + 9*μ*S/49 + μ/(2+S) ≤ 0 := by + obtain ⟨hμlo, hμhi⟩ := hμ + have hmuPP : muPP 2 μ = 3*(7 - 3*μ)/49 := by rw [muPP]; norm_num + have hg := log76_gap + have h2S : (0:ℝ) < 2 + S := by linarith + have hμpos : 0 ≤ μ := by linarith + rw [hmuPP, div_eq_mul_inv μ (2+S)] + have hinv : (2+S)⁻¹ * (2+S) = 1 := inv_mul_cancel₀ (ne_of_gt h2S) + have hinvpos : 0 < (2+S)⁻¹ := inv_pos.mpr h2S + nlinarith [hg, hμlo, hμhi, hS0, hSmax, h2S, hinv, hinvpos, mul_nonneg hμpos (le_of_lt hinvpos), + mul_nonneg hμpos hS0, mul_nonneg (mul_nonneg hμpos hS0) (le_of_lt hinvpos), + mul_nonneg (mul_nonneg hμpos (le_of_lt hinvpos)) hS0] + +/-- d=3 log gap: `log(3/2) + log(11/9) - 3 F* ≤ 0` (the combined `log(X_3)` with `X_3 = (3/2)^11·(11/9)^11·(64/621)^3 < 1`). -/ +theorem log_gap_d3 : Real.log (3/2) + Real.log (11/9) - 3*FSTAR ≤ 0 := by + have hF : FSTAR = Real.log (621/64)/11 := rfl + rw [hF] + have hcomb : (11:ℝ)*(Real.log (3/2) + Real.log (11/9) - 3*(Real.log (621/64)/11)) + = Real.log ((3/2)^11 * (11/9)^11 * (64/621)^3) := by + rw [Real.log_mul (by positivity) (by positivity), Real.log_mul (by positivity) (by positivity), + Real.log_pow, Real.log_pow, Real.log_pow, + show (64:ℝ)/621 = (621/64)⁻¹ by norm_num, Real.log_inv] + ring + have hX : Real.log ((3/2)^11 * (11/9)^11 * (64/621)^3) ≤ 0 := + Real.log_nonpos (by positivity) (by norm_num) + nlinarith [hcomb, hX] + +/-- d=3 decouple residual `R(S) ≤ 0` on `S ∈ [0,2]`, `μ ∈ I`. `μ'' = muPP 3 μ = 3(11−3μ)/121`. -/ +theorem decouple_d3 (μ S : ℝ) (hμ : inI μ) (hS0 : 0 ≤ S) (hSmax : S ≤ 2) : + 2*(muPP 3 μ)/3 - μ/3 + 9*μ*S/121 - 2/11 + (Real.log (3/2) + Real.log (11/9) - 3*FSTAR) + μ/(3+S) ≤ 0 := by + obtain ⟨hμlo, hμhi⟩ := hμ + have hmuPP : muPP 3 μ = 3*(11 - 3*μ)/121 := by rw [muPP]; norm_num + have hg := log_gap_d3 + have h3S : (0:ℝ) < 3 + S := by linarith + have hμpos : 0 ≤ μ := by linarith + rw [hmuPP, div_eq_mul_inv μ (3+S)] + have hinv : (3+S)⁻¹ * (3+S) = 1 := inv_mul_cancel₀ (ne_of_gt h3S) + have hinvpos : 0 < (3+S)⁻¹ := inv_pos.mpr h3S + nlinarith [hg, hμlo, hμhi, hS0, hSmax, h3S, hinv, hinvpos, mul_nonneg hμpos (le_of_lt hinvpos), + mul_nonneg hμpos hS0, mul_nonneg (mul_nonneg hμpos hS0) (le_of_lt hinvpos), + mul_nonneg (mul_nonneg hμpos (le_of_lt hinvpos)) hS0] + +/-- d=4 log gap: `2·log(3/2) + log(5/4) - 5 F* ≤ 1334065663/1159983480832`. -/ +theorem log_gap_d4 : 2*Real.log (3/2) + Real.log (5/4) - 5*FSTAR ≤ 1334065663/1159983480832 := by + have hF : FSTAR = Real.log (621/64)/11 := rfl + rw [hF] + have hcomb : (11:ℝ)*(2*Real.log (3/2) + Real.log (5/4) - 5*(Real.log (621/64)/11)) + = Real.log ((3/2)^22 * (5/4)^11 * (64/621)^5) := by + rw [Real.log_mul (by positivity) (by positivity), Real.log_mul (by positivity) (by positivity), + Real.log_pow, Real.log_pow, Real.log_pow, + show (64:ℝ)/621 = (621/64)⁻¹ by norm_num, Real.log_inv] + ring + have hX : Real.log ((3/2)^22 * (5/4)^11 * (64/621)^5) + ≤ (3/2)^22 * (5/4)^11 * (64/621)^5 - 1 := + Real.log_le_sub_one_of_pos (by positivity) + have hXval : (3/2)^22 * (5/4)^11 * (64/621)^5 - 1 = 1334065663/105453043712 := by norm_num + nlinarith [hcomb, hX, hXval] + +/-- d=4 decouple residual `R(S) ≤ 0` on `S ∈ [0,3]`, `μ ∈ I`. `μ'' = muPP 4 μ = 3(15−3μ)/225`. -/ +theorem decouple_d4 (μ S : ℝ) (hμ : inI μ) (hS0 : 0 ≤ S) (hSmax : S ≤ 3) : + (1*(muPP 4 μ)/1) - μ/3 + 1*μ*S/16 - (1/4) + (2*Real.log (3/2) + Real.log (5/4) - 5*FSTAR) + μ/(4+S) ≤ 0 := by + obtain ⟨hμlo, hμhi⟩ := hμ + have hmuPP : muPP 4 μ = 3*(15 - 3*μ)/225 := by rw [muPP]; norm_num + have hg := log_gap_d4 + have hdS : (0:ℝ) < 4 + S := by linarith + have hμpos : 0 ≤ μ := by linarith + rw [hmuPP, div_eq_mul_inv μ (4+S)] + have hinv : (4+S)⁻¹ * (4+S) = 1 := inv_mul_cancel₀ (ne_of_gt hdS) + have hinvpos : 0 < (4+S)⁻¹ := inv_pos.mpr hdS + nlinarith [hg, hμlo, hμhi, hS0, hSmax, hdS, hinv, hinvpos, mul_nonneg hμpos (le_of_lt hinvpos), + mul_nonneg hμpos hS0, mul_nonneg (mul_nonneg hμpos hS0) (le_of_lt hinvpos), + mul_nonneg (mul_nonneg hμpos (le_of_lt hinvpos)) hS0] + + +/-- d=5 log gap: `3·log(3/2) + log(19/15) - 7 F* ≤ 12677795138367509/1828763667822265625`. -/ +theorem log_gap_d5 : 3*Real.log (3/2) + Real.log (19/15) - 7*FSTAR ≤ 12677795138367509/1828763667822265625 := by + have hF : FSTAR = Real.log (621/64)/11 := rfl + rw [hF] + have hcomb : (11:ℝ)*(3*Real.log (3/2) + Real.log (19/15) - 7*(Real.log (621/64)/11)) + = Real.log ((3/2)^33 * (19/15)^11 * (64/621)^7) := by + rw [Real.log_mul (by positivity) (by positivity), Real.log_mul (by positivity) (by positivity), + Real.log_pow, Real.log_pow, Real.log_pow, + show (64:ℝ)/621 = (621/64)⁻¹ by norm_num, Real.log_inv] + ring + have hX : Real.log ((3/2)^33 * (19/15)^11 * (64/621)^7) + ≤ (3/2)^33 * (19/15)^11 * (64/621)^7 - 1 := + Real.log_le_sub_one_of_pos (by positivity) + have hXval : (3/2)^33 * (19/15)^11 * (64/621)^7 - 1 = 12677795138367509/166251242529296875 := by norm_num + nlinarith [hcomb, hX, hXval] + +/-- d=5 decouple residual `R(S) ≤ 0` on `S ∈ [0,4]`, `μ ∈ I`. `μ'' = muPP 5 μ = 3(19−3μ)/361`. -/ +theorem decouple_d5 (μ S : ℝ) (hμ : inI μ) (hS0 : 0 ≤ S) (hSmax : S ≤ 4) : + (4*(muPP 5 μ)/3) - μ/3 + 9*μ*S/361 - (4/19) + (3*Real.log (3/2) + Real.log (19/15) - 7*FSTAR) + μ/(5+S) ≤ 0 := by + obtain ⟨hμlo, hμhi⟩ := hμ + have hmuPP : muPP 5 μ = 3*(19 - 3*μ)/361 := by rw [muPP]; norm_num + have hg := log_gap_d5 + have hdS : (0:ℝ) < 5 + S := by linarith + have hμpos : 0 ≤ μ := by linarith + rw [hmuPP, div_eq_mul_inv μ (5+S)] + have hinv : (5+S)⁻¹ * (5+S) = 1 := inv_mul_cancel₀ (ne_of_gt hdS) + have hinvpos : 0 < (5+S)⁻¹ := inv_pos.mpr hdS + nlinarith [hg, hμlo, hμhi, hS0, hSmax, hdS, hinv, hinvpos, mul_nonneg hμpos (le_of_lt hinvpos), + mul_nonneg hμpos hS0, mul_nonneg (mul_nonneg hμpos hS0) (le_of_lt hinvpos), + mul_nonneg (mul_nonneg hμpos (le_of_lt hinvpos)) hS0] + + +/-- d=6 log gap: `4·log(3/2) + log(23/18) - 9 F* ≤ 43/5346`. -/ +theorem log_gap_d6 : 4*Real.log (3/2) + Real.log (23/18) - 9*FSTAR ≤ 43/5346 := by + have hF : FSTAR = Real.log (621/64)/11 := rfl + rw [hF] + have hcomb : (11:ℝ)*(4*Real.log (3/2) + Real.log (23/18) - 9*(Real.log (621/64)/11)) + = Real.log ((3/2)^44 * (23/18)^11 * (64/621)^9) := by + rw [Real.log_mul (by positivity) (by positivity), Real.log_mul (by positivity) (by positivity), + Real.log_pow, Real.log_pow, Real.log_pow, + show (64:ℝ)/621 = (621/64)⁻¹ by norm_num, Real.log_inv] + ring + have hX : Real.log ((3/2)^44 * (23/18)^11 * (64/621)^9) + ≤ (3/2)^44 * (23/18)^11 * (64/621)^9 - 1 := + Real.log_le_sub_one_of_pos (by positivity) + have hXval : (3/2)^44 * (23/18)^11 * (64/621)^9 - 1 = 43/486 := by norm_num + nlinarith [hcomb, hX, hXval] + +/-- d=6 decouple residual `R(S) ≤ 0` on `S ∈ [0,5]`, `μ ∈ I`. `μ'' = muPP 6 μ = 3(23−3μ)/529`. -/ +theorem decouple_d6 (μ S : ℝ) (hμ : inI μ) (hS0 : 0 ≤ S) (hSmax : S ≤ 5) : + (5*(muPP 6 μ)/3) - μ/3 + 9*μ*S/529 - (5/23) + (4*Real.log (3/2) + Real.log (23/18) - 9*FSTAR) + μ/(6+S) ≤ 0 := by + obtain ⟨hμlo, hμhi⟩ := hμ + have hmuPP : muPP 6 μ = 3*(23 - 3*μ)/529 := by rw [muPP]; norm_num + have hg := log_gap_d6 + have hdS : (0:ℝ) < 6 + S := by linarith + have hμpos : 0 ≤ μ := by linarith + rw [hmuPP, div_eq_mul_inv μ (6+S)] + have hinv : (6+S)⁻¹ * (6+S) = 1 := inv_mul_cancel₀ (ne_of_gt hdS) + have hinvpos : 0 < (6+S)⁻¹ := inv_pos.mpr hdS + nlinarith [hg, hμlo, hμhi, hS0, hSmax, hdS, hinv, hinvpos, mul_nonneg hμpos (le_of_lt hinvpos), + mul_nonneg hμpos hS0, mul_nonneg (mul_nonneg hμpos hS0) (le_of_lt hinvpos), + mul_nonneg (mul_nonneg hμpos (le_of_lt hinvpos)) hS0] + +end BGSCL +end R3Cert diff --git a/proof/formalization/R3Cert/BGSCLGStepBridge.lean b/proof/formalization/R3Cert/BGSCLGStepBridge.lean new file mode 100644 index 00000000..df0c0cf2 --- /dev/null +++ b/proof/formalization/R3Cert/BGSCLGStepBridge.lean @@ -0,0 +1,233 @@ +/- + The g-step ↔ classical-Branch-model BRIDGE (2026-09-02). + + This is the recursion-assembly `(ii)` that no file on `main` had: it connects the CappedJoint g-step machinery + to the concrete branch ceiling `bell b ≤ 0`. The exp-cleared ceiling quantity is `Gf b := exp(11·bell b)` + (`= btotal(b)^11 · (64/621)^|b|`), so `Gf b ≤ 1 ⟺ bell b ≤ 0`. It obeys the cavity recursion in product form + (`Gf_node`), and the message `μ = bY(c)` is the cavity field. The capped joint invariant is `Gf b ≤ capB(bY b)` + with `capB = min(master_ub, glemma_ub, 1)`. + + `ceiling_of_gstep` reduces the WHOLE classical branch ceiling `∀ b, bell b ≤ 0` — for every rooted branch, all + degrees — to the SINGLE per-hub message inequality `GStep` (`W·a^11·∏capB ≤ capB(μ_hub)`), via well-founded + recursion + the achievability of `bY` (`bY_leaf = 1`, `bY_nonleaf ≤ 1/2`). `GStep` is the honest remaining + obligation (the CappedJoint `STEP≤1`, tight only at the `d=6` tie); it is stated as an explicit hypothesis, NOT + proven here. `conjecture1_proved = False`. +-/ +import Mathlib +import R3Cert.BGSCLInduction +import R3Cert.BGSCLStep +import R3Cert.BGSCLHub + +namespace R3Cert +namespace BGSCL + +open Real + +/-- The exp-cleared ceiling quantity `Gf b = exp(11·bell b) = btotal(b)^11·(64/621)^|b|`. + `Gf b ≤ 1 ⟺ bell b ≤ 0`. -/ +noncomputable def Gf (b : Branch) : ℝ := Real.exp (11 * bell b) + +theorem Gf_pos (b : Branch) : 0 < Gf b := Real.exp_pos _ + +/-- `bell b ≤ 0` from `Gf b ≤ 1`. -/ +theorem bell_nonpos_of_Gf {b : Branch} (h : Gf b ≤ 1) : bell b ≤ 0 := by + unfold Gf at h + have := Real.exp_le_one_iff.mp h + linarith + +/-- The master-side per-message cap `master_ub(μ) = (64/621)(3/(2+μ))^11`. -/ +noncomputable def masterUb (μ : ℝ) : ℝ := (64/621) * (3/(2+μ))^11 +/-- The g-lemma-side per-message cap `glemma_ub(μ) = (64/621)²(5/3)^11/(1+μ/3)^11`. -/ +noncomputable def glemmaUb (μ : ℝ) : ℝ := (64/621)^2 * (5/3)^11 / (1+μ/3)^11 +/-- The capped child bound `Bcap(μ) = min(master_ub, glemma_ub, 1)`. -/ +noncomputable def capB (μ : ℝ) : ℝ := min (masterUb μ) (min (glemmaUb μ) 1) + +theorem capB_le_one (μ : ℝ) : capB μ ≤ 1 := le_trans (min_le_right _ _) (min_le_right _ _) + +/-- `capB(1) = 64/621` (the leaf/arm value: `master_ub(1) = 64/621` is the binding min). -/ +theorem capB_one : capB (1:ℝ) = 64/621 := by + have h1 : glemmaUb 1 ≤ (1:ℝ) := by unfold glemmaUb; norm_num + have h2 : masterUb (1:ℝ) ≤ glemmaUb 1 := by unfold masterUb glemmaUb; norm_num + have h3 : masterUb (1:ℝ) = 64/621 := by unfold masterUb; norm_num + unfold capB + rw [min_eq_left h1, min_eq_left h2, h3] + +/-- **PIECE 1 (master ⟸ glemma).** On the hub range `μ ≤ 1/2`, the glemma cap is BELOW the master cap: + `glemmaUb(μ) ≤ masterUb(μ)`. Hence the master component of the per-hub step is a `le_trans` off the + (proven) glemma component — no separate master proof is needed. (`(3+μ)/(2+μ) ≥ 7/5 ⟺ μ ≤ 1/2`, and + `(64/621)·(5/3)^11 ≤ (7/5)^11`, i.e. the integer `64·25^11 ≤ 621·21^11`.) -/ +theorem glemmaUb_le_masterUb {μ : ℝ} (hμ0 : 0 ≤ μ) (hμ : μ ≤ 1/2) : glemmaUb μ ≤ masterUb μ := by + have h2 : (0:ℝ) < 2 + μ := by linarith + unfold glemmaUb masterUb + rw [div_le_iff₀ (by positivity)] + have hcombine : (3/(2+μ))^11 * (1+μ/3)^11 = ((3+μ)/(2+μ))^11 := by + rw [← mul_pow]; congr 1; field_simp + have hr : (7/5:ℝ) ≤ (3+μ)/(2+μ) := by rw [le_div_iff₀ h2]; linarith + have hpow : (7/5:ℝ)^11 ≤ ((3+μ)/(2+μ))^11 := pow_le_pow_left₀ (by norm_num) hr 11 + have hcert : (64/621:ℝ)^2 * (5/3)^11 ≤ (64/621) * (7/5)^11 := by norm_num + have hmul := mul_le_mul_of_nonneg_left hpow (by norm_num : (0:ℝ) ≤ 64/621) + calc (64/621:ℝ)^2 * (5/3)^11 + ≤ (64/621) * ((3+μ)/(2+μ))^11 := by linarith [hcert, hmul] + _ = (64/621) * (3/(2+μ))^11 * (1+μ/3)^11 := by rw [mul_assoc, hcombine] + +/-- exp of a scaled branch-`bell` sum is the product of `Gf`s. -/ +theorem exp_eleven_sum (cs : List Branch) : + Real.exp (11 * (cs.map bell).sum) = (cs.map Gf).prod := by + induction cs with + | nil => simp [Gf] + | cons a t ih => + simp only [List.map_cons, List.sum_cons, List.prod_cons] + rw [mul_add, Real.exp_add, ih] + rfl + +/-- **The `Gf` cavity recursion (product form).** `Gf(node cs) = (64/621)·(1 + S/d)^11·∏ Gf(c)`, + `S = Σ bY(c)`, `d = |cs|+1`. (Exp of `bell_node`.) -/ +theorem Gf_node (cs : List Branch) : + Gf (Branch.node cs) + = (64/621) * (1 + (cs.map bY).sum / ((cs.length:ℝ)+1))^11 * (cs.map Gf).prod := by + have hd : (0:ℝ) < (cs.length:ℝ)+1 := by positivity + have hSnn : (0:ℝ) ≤ (cs.map bY).sum := by + apply List.sum_nonneg; intro x hx; rw [List.mem_map] at hx + obtain ⟨c, _, rfl⟩ := hx; exact bY_nonneg c + have hpos : (0:ℝ) < 1 + (cs.map bY).sum / ((cs.length:ℝ)+1) := by + have : (0:ℝ) ≤ (cs.map bY).sum / ((cs.length:ℝ)+1) := div_nonneg hSnn (le_of_lt hd) + linarith + have hlog : Real.exp (11 * Real.log (1 + (cs.map bY).sum / ((cs.length:ℝ)+1))) + = (1 + (cs.map bY).sum / ((cs.length:ℝ)+1))^11 := by + rw [show (11:ℝ) * Real.log (1 + (cs.map bY).sum / ((cs.length:ℝ)+1)) + = Real.log ((1 + (cs.map bY).sum / ((cs.length:ℝ)+1))^11) from by + rw [Real.log_pow]; push_cast; ring] + exact Real.exp_log (by positivity) + have hFneg : Real.exp (-(11 * FSTAR)) = 64/621 := by + rw [show -(11 * FSTAR) = -Real.log (621/64) from by rw [FSTAR]; ring, Real.exp_neg, + Real.exp_log (by norm_num)] + norm_num + have heq : 11 * bell (Branch.node cs) + = 11 * (cs.map bell).sum + + 11 * Real.log (1 + (cs.map bY).sum / ((cs.length:ℝ)+1)) + (-(11 * FSTAR)) := by + rw [bell_node]; ring + rw [show Gf (Branch.node cs) = Real.exp (11 * bell (Branch.node cs)) from rfl, + heq, Real.exp_add, Real.exp_add, exp_eleven_sum, hlog, hFneg] + ring + +/-- Achievability of a cavity message: `0 < μ` and (`μ ≤ 1/2` or `μ = 1`). -/ +def Achiev (μ : ℝ) : Prop := 0 < μ ∧ (μ ≤ 1/2 ∨ μ = 1) + +theorem bY_pos (b : Branch) : 0 < bY b := by + cases b with + | node cs => + rw [bY_node] + have hSnn : (0:ℝ) ≤ (cs.map bY).sum := by + apply List.sum_nonneg; intro x hx; rw [List.mem_map] at hx + obtain ⟨c, _, rfl⟩ := hx; exact bY_nonneg c + positivity + +/-- `bY(b)` is achievable: leaf ⟹ `= 1`, non-leaf ⟹ `≤ 1/2`. -/ +theorem bY_achievable (b : Branch) : Achiev (bY b) := by + refine ⟨bY_pos b, ?_⟩ + cases b with + | node cs => + cases cs with + | nil => right; exact bY_leaf + | cons a rest => left; exact bY_nonleaf_le_half a rest + +/-- **The per-hub message step (`STEP≤1` in capped form).** For a non-empty hub whose children's messages are + achievable, the boosted product of child caps is `≤` the hub's cap. This is the CappedJoint g-step obligation + (`W·a^11·∏Bcap ≤ Bcap(μ_hub)`); tight only at the `d=6` all-cherry tie. The single remaining analytic input. -/ +def GStep : Prop := + ∀ cs : List Branch, cs ≠ [] → (∀ c ∈ cs, Achiev (bY c)) → + (64/621 : ℝ) * (1 + (cs.map bY).sum / ((cs.length:ℝ)+1))^11 + * (cs.map (fun c => capB (bY c))).prod + ≤ capB (bY (Branch.node cs)) + +/-- `∏ Gf(c) ≤ ∏ capB(bY c)` from the per-child bound. -/ +theorem list_prod_mono (cs : List Branch) (h : ∀ c ∈ cs, Gf c ≤ capB (bY c)) : + (cs.map Gf).prod ≤ (cs.map (fun c => capB (bY c))).prod := by + induction cs with + | nil => simp + | cons a t ih => + simp only [List.map_cons, List.prod_cons] + have ha : Gf a ≤ capB (bY a) := h a (List.mem_cons.mpr (Or.inl rfl)) + have iht : (t.map Gf).prod ≤ (t.map (fun c => capB (bY c))).prod := + ih (fun c hc => h c (List.mem_cons.mpr (Or.inr hc))) + have hGt : (0:ℝ) ≤ (t.map Gf).prod := by + apply List.prod_nonneg; intro x hx; rw [List.mem_map] at hx + obtain ⟨c, _, rfl⟩ := hx; exact le_of_lt (Gf_pos c) + have hca : (0:ℝ) ≤ capB (bY a) := le_trans (le_of_lt (Gf_pos a)) ha + calc Gf a * (t.map Gf).prod + ≤ capB (bY a) * (t.map Gf).prod := mul_le_mul_of_nonneg_right ha hGt + _ ≤ capB (bY a) * (t.map (fun c => capB (bY c))).prod := mul_le_mul_of_nonneg_left iht hca + +/-- **THE BRIDGE.** The whole classical branch ceiling `∀ b, bell b ≤ 0` — every rooted branch, all degrees — + reduces to the single per-hub message inequality `GStep`. Proof: the capped joint invariant `Gf b ≤ capB(bY b)` + holds for every branch by well-founded recursion on `|b|` (leaf: `Gf(node []) = 64/621 = capB 1`; hub: the + child IH + `Gf_node` product recursion + `list_prod_mono` + `GStep` with the achievable child messages), and + `capB ≤ 1` gives `Gf b ≤ 1`, i.e. `bell b ≤ 0`. `GStep` is the sole hypothesis — the honest remaining + obligation. `conjecture1_proved = False`. -/ +theorem ceiling_of_gstep (hstep : GStep) : ∀ b, bell b ≤ 0 := by + have hinv : ∀ b, Gf b ≤ capB (bY b) := by + refine scl_of_child_step bsize bchildren (fun b => Gf b ≤ capB (bY b)) bchildren_bsize_lt + (fun a hIH => ?_) + cases a with + | node cs => + have hchild : ∀ c ∈ cs, Gf c ≤ capB (bY c) := + fun c hc => hIH c (by simpa only [bchildren] using hc) + rw [Gf_node] + by_cases hcs : cs = [] + · subst hcs + simp only [List.map_nil, List.sum_nil, List.prod_nil, List.length_nil, Nat.cast_zero] + rw [bY_leaf, capB_one]; norm_num + · have hprod : (cs.map Gf).prod ≤ (cs.map (fun c => capB (bY c))).prod := + list_prod_mono cs hchild + have hboost : (0:ℝ) ≤ (64/621 : ℝ) * (1 + (cs.map bY).sum / ((cs.length:ℝ)+1))^11 := by + have hSnn : (0:ℝ) ≤ (cs.map bY).sum := by + apply List.sum_nonneg; intro x hx; rw [List.mem_map] at hx + obtain ⟨c, _, rfl⟩ := hx; exact bY_nonneg c + positivity + calc (64/621 : ℝ) * (1 + (cs.map bY).sum / ((cs.length:ℝ)+1))^11 * (cs.map Gf).prod + ≤ (64/621 : ℝ) * (1 + (cs.map bY).sum / ((cs.length:ℝ)+1))^11 + * (cs.map (fun c => capB (bY c))).prod := + mul_le_mul_of_nonneg_left hprod hboost + _ ≤ capB (bY (Branch.node cs)) := + hstep cs hcs (fun c _ => bY_achievable c) + exact fun b => bell_nonpos_of_Gf (le_trans (hinv b) (capB_le_one _)) + +/-- The glemma-component per-hub step (`W·a^11·prodBcap ≤ glemmaUb(μ_hub)`) — the CappedJoint + `gstep_le_one_achievable` (PROVEN in ℚ; all arities), transported to the classical `bY`/`Gf` setting. -/ +def GlemmaStep : Prop := + ∀ cs : List Branch, cs ≠ [] → (∀ c ∈ cs, Achiev (bY c)) → + (64/621 : ℝ) * (1 + (cs.map bY).sum / ((cs.length:ℝ)+1))^11 + * (cs.map (fun c => capB (bY c))).prod + ≤ glemmaUb (bY (Branch.node cs)) + +/-- **PIECE 2 (the `≤1` step)** — `W·a^11·prodBcap ≤ 1`. The SOLE genuinely-open obligation: it is TIGHT + exactly at the `d=6` all-cherry tie (the `27·23 = 621` identity, `acl_d6`), strictly slack elsewhere, and is + NOT implied by `GlemmaStep` when the hub message `< 0.306` (there both caps exceed 1). For hub message + `≥ 0.306` it DOES follow from `GlemmaStep` (`glemmaUb ≤ 1`); the residual is the small-message / large-hub + tie region — the `M_d` frontier. -/ +def Le1Step : Prop := + ∀ cs : List Branch, cs ≠ [] → (∀ c ∈ cs, Achiev (bY c)) → + (64/621 : ℝ) * (1 + (cs.map bY).sum / ((cs.length:ℝ)+1))^11 + * (cs.map (fun c => capB (bY c))).prod + ≤ 1 + +/-- **The sharpened per-hub step**: `GStep` follows from `GlemmaStep ∧ Le1Step` — the master cap is derived from + glemma via `glemmaUb_le_masterUb` (piece 1). So the whole thing rests on glemma (proven) + the `≤1` step. -/ +theorem gstep_of_glemma_le1 (hg : GlemmaStep) (h1 : Le1Step) : GStep := by + intro cs hcs hach + have hμle : bY (Branch.node cs) ≤ 1/2 := by + cases cs with + | nil => exact absurd rfl hcs + | cons a rest => exact bY_nonleaf_le_half a rest + have hgl := hg cs hcs hach + exact le_min (le_trans hgl (glemmaUb_le_masterUb (bY_nonneg _) hμle)) + (le_min hgl (h1 cs hcs hach)) + +/-- **The sharpened bridge.** The entire classical branch ceiling `∀ b, bell b ≤ 0` reduces to `GlemmaStep` + (proven in ℚ as `gstep_le_one_achievable`) together with `Le1Step` (piece 2, the tie-tight residual). + Master is subsumed. `conjecture1_proved = False`. -/ +theorem ceiling_of_glemma_le1 (hg : GlemmaStep) (h1 : Le1Step) : ∀ b, bell b ≤ 0 := + ceiling_of_gstep (gstep_of_glemma_le1 hg h1) + +end BGSCL +end R3Cert diff --git a/proof/formalization/R3Cert/BGSCLHub.lean b/proof/formalization/R3Cert/BGSCLHub.lean new file mode 100644 index 00000000..ed56dce3 --- /dev/null +++ b/proof/formalization/R3Cert/BGSCLHub.lean @@ -0,0 +1,448 @@ +/- + SCL FlowedHubStep assembly — the list machinery + tangent connection tying the per-degree decouple + residuals (`BGSCLDecouple`) to the actual hub `node cs`. + `child_bell_sum_le`: from the per-child SCL at a price `ν`, the sum bound `Σ bell(c) ≤ |cs|·bV_ν(cherry) − ν·S`. + This feeds `bell_node_tangent` + `bY_node` + `decouple_d` to give `bV μ (node cs) ≤ bV μ cherry` for d≤6. + (d≥7 needs the branch ceiling `bell (node cs) ≤ 0`, a separate result not yet in the SCL Lean.) + conjecture1_proved = False. +-/ +import Mathlib +import R3Cert.BGSCLInduction +import R3Cert.BGSCLStep +import R3Cert.BGSCLDecouple +import R3Cert.BGSCLFlowed + +namespace R3Cert +namespace BGSCL + +/-- **The child-sum bound.** If every child `c ∈ cs` satisfies the SCL at price `ν` + (`bV ν c ≤ bV ν cherry`), then `Σ_c bell(c) ≤ |cs|·bV_ν(cherry) − ν·Σ_c bY(c)`. (Since + `bell c = bV ν c − ν·bY c ≤ bV ν cherry − ν·bY c`, summed.) This is the list-machinery half of the + per-hub decouple: it converts the per-child hypotheses into the single scalar `Σ bell` bound the + tangent needs. -/ +theorem child_bell_sum_le (ν : ℝ) (cs : List Branch) (h : ∀ c ∈ cs, bV ν c ≤ bV ν cherry) : + (cs.map bell).sum ≤ (cs.length : ℝ) * bV ν cherry - ν * (cs.map bY).sum := by + induction cs with + | nil => simp + | cons a t ih => + have ha : bell a + ν * bY a ≤ bell cherry + ν * bY cherry := by + have h1 : bV ν a = bell a + ν * bY a := rfl + have h2 : bV ν cherry = bell cherry + ν * bY cherry := rfl + have := h a (List.mem_cons.mpr (Or.inl rfl)); rw [h1, h2] at this; exact this + have iht : (t.map bell).sum ≤ (t.length : ℝ) * bV ν cherry - ν * (t.map bY).sum := + ih (fun c hc => h c (List.mem_cons.mpr (Or.inr hc))) + have hVc : bV ν cherry = bell cherry + ν * bY cherry := rfl + simp only [List.map_cons, List.sum_cons, List.length_cons, Nat.cast_add, Nat.cast_one] + rw [hVc] at iht ⊢ + nlinarith [ha, iht] + +/-- `bY b ≤ 1` for every branch (`h ≤ 1`, `bcc ≥ 0`). -/ +theorem bY_le_one (b : Branch) : bY b ≤ 1 := by + cases b with + | node cs => + rw [bY_node] + have hS : 0 ≤ (cs.map bY).sum := by + apply List.sum_nonneg; intro x hx; rw [List.mem_map] at hx + obtain ⟨c, _, rfl⟩ := hx; exact bY_nonneg c + have hlen : (0:ℝ) ≤ (cs.length:ℝ) := Nat.cast_nonneg _ + rw [div_le_one (by linarith)]; linarith + +/-- A non-leaf branch `node (a :: rest)` has `bY ≤ 1/2` (denominator `≥ 2`). -/ +theorem bY_nonleaf_le_half (a : Branch) (rest : List Branch) : + bY (Branch.node (a :: rest)) ≤ 1/2 := by + rw [bY_node] + have hS : 0 ≤ ((a :: rest).map bY).sum := by + apply List.sum_nonneg; intro x hx; rw [List.mem_map] at hx + obtain ⟨c, _, rfl⟩ := hx; exact bY_nonneg c + have h1 : (1:ℝ) ≤ ((a :: rest).length : ℝ) := by + have : (0:ℝ) ≤ (rest.length : ℝ) := Nat.cast_nonneg _ + rw [List.length_cons]; push_cast; linarith + rw [div_le_iff₀ (by linarith)] + linarith + +/-- **Uniform child SCL at the flowed price** (`d ∈ {3..6}`): every child satisfies `bV_{μ''} c ≤ bV_{μ''} cherry` + — leaf children via `leaf_le_cherry` (`μ'' ≤ 3/11`), non-leaf via `PSCLne` at `μ'' ∈ I`. -/ +theorem child_scl_muPP {d : ℝ} (hd3 : 3 ≤ d) (hd6 : d ≤ 6) {μ : ℝ} (hμ : inI μ) + {cs : List Branch} (hchild : ∀ c ∈ cs, PSCLne c) : + ∀ c ∈ cs, bV (muPP d μ) c ≤ bV (muPP d μ) cherry := by + intro c hc + have hμ0 : (0:ℝ) ≤ μ := le_trans (by norm_num) hμ.1 + by_cases hleaf : c = Branch.node [] + · subst hleaf + exact leaf_le_cherry (muPP_le_three_eleven hd3 hμ0) + · exact hchild c hc hleaf (muPP d μ) (muPP_mem_I (by linarith) hd6 hμ) + +/-- `Σ_c bY(c) ≤ |cs|` (each `bY ≤ 1`). -/ +theorem sum_bY_le_length (cs : List Branch) : (cs.map bY).sum ≤ (cs.length : ℝ) := by + induction cs with + | nil => simp + | cons a t ih => + simp only [List.map_cons, List.sum_cons, List.length_cons, Nat.cast_add, Nat.cast_one] + have := bY_le_one a + linarith [ih] + +/-- **Hub connection, d=3** (`cs.length = 2`). -/ +theorem hub_le_d3 {mu : ℝ} (hmu : inI mu) {cs : List Branch} (hlen : cs.length = 2) + (hchild : ∀ c ∈ cs, PSCLne c) : + bV mu (Branch.node cs) ≤ bV mu cherry := by + set S := (cs.map bY).sum with hSdef + have hSnn : 0 ≤ S := by + rw [hSdef]; apply List.sum_nonneg; intro x hx; rw [List.mem_map] at hx + obtain ⟨c, _, rfl⟩ := hx; exact bY_nonneg c + have hlenR : (cs.length : ℝ) = 2 := by exact_mod_cast hlen + have hSle : S ≤ 2 := by + have := sum_bY_le_length cs; rw [hlenR] at this; rw [hSdef]; exact this + have hmpp : muPP 3 mu = (33 - 9*mu)/121 := by rw [muPP]; ring + have hchild2 := child_scl_muPP (d:=3) (by norm_num) (by norm_num) hmu hchild + have hsum : (cs.map bell).sum ≤ (cs.length : ℝ) * bV (muPP 3 mu) cherry - muPP 3 mu * (cs.map bY).sum := + child_bell_sum_le (muPP 3 mu) cs hchild2 + rw [hlenR, ← hSdef] at hsum + have htan := bell_node_tangent cs (s0 := 2/3) (by norm_num) + rw [hlenR, ← hSdef] at htan + have hlogeq : Real.log (1 + 2/3/((2:ℝ)+1)) = Real.log (11/9) := by norm_num + have hden : ((2:ℝ)+1)+2/3 = 11/3 := by norm_num + rw [hlogeq, hden] at htan + have hbY : bY (Branch.node cs) = 1 / (3 + S) := by + have hden' : ((cs.length : ℝ) + 1) + (cs.map bY).sum = 3 + S := by rw [hlenR, ← hSdef]; ring + rw [bY_node, hden'] + have hdec := decouple_d3 mu S hmu hSnn hSle + have hVpp : bV (muPP 3 mu) cherry = Real.log (3/2) - 2*FSTAR + muPP 3 mu * (1/3) := by + rw [bV, bell_cherry, bY_cherry] + have hVc : bV mu cherry = Real.log (3/2) - 2*FSTAR + mu * (1/3) := by + rw [bV, bell_cherry, bY_cherry] + -- the RHS bound on bV mu (node cs) + have hbV : bV mu (Branch.node cs) = bell (Branch.node cs) + mu * (1/(3+S)) := by rw [bV, hbY] + have hRHS : bV mu (Branch.node cs) + ≤ (2 * bV (muPP 3 mu) cherry - muPP 3 mu * S + + (Real.log (11/9) + (S - 2/3)/(11/3) - FSTAR)) + mu * (1/(3+S)) := by + rw [hbV]; linarith [htan, hsum] + -- the algebraic identity: RHS - bV mu cherry = decouple_d3 LHS (μ'' expanded, μ/(3+S) shared atom) + have hbridge : (2 * bV (muPP 3 mu) cherry - muPP 3 mu * S + + (Real.log (11/9) + (S - 2/3)/(11/3) - FSTAR)) + mu * (1/(3+S)) - bV mu cherry + = (2*(muPP 3 mu)/3 - mu/3 + 9*mu*S/121 - 2/11 + + (Real.log (3/2) + Real.log (11/9) - 3*FSTAR) + mu/(3+S)) := by + rw [hVpp, hVc, hmpp]; ring + linarith [hRHS, hbridge, hdec] + +/-- **Hub connection, d=4** (`cs.length = 3`). -/ +theorem hub_le_d4 {mu : ℝ} (hmu : inI mu) {cs : List Branch} (hlen : cs.length = 3) + (hchild : ∀ c ∈ cs, PSCLne c) : + bV mu (Branch.node cs) ≤ bV mu cherry := by + set S := (cs.map bY).sum with hSdef + have hSnn : 0 ≤ S := by + rw [hSdef]; apply List.sum_nonneg; intro x hx; rw [List.mem_map] at hx + obtain ⟨c, _, rfl⟩ := hx; exact bY_nonneg c + have hlenR : (cs.length : ℝ) = 3 := by exact_mod_cast hlen + have hSle : S ≤ 3 := by + have := sum_bY_le_length cs; rw [hlenR] at this; rw [hSdef]; exact this + have hmpp : muPP 4 mu = 3*(15 - 3*mu)/225 := by rw [muPP]; norm_num + have hchild2 := child_scl_muPP (d:=4) (by norm_num) (by norm_num) hmu hchild + have hsum : (cs.map bell).sum ≤ (cs.length : ℝ) * bV (muPP 4 mu) cherry - muPP 4 mu * (cs.map bY).sum := + child_bell_sum_le (muPP 4 mu) cs hchild2 + rw [hlenR, ← hSdef] at hsum + have htan := bell_node_tangent cs (s0 := 1) (by norm_num) + rw [hlenR, ← hSdef] at htan + have hlogeq : Real.log (1 + 1/((3:ℝ)+1)) = Real.log (5/4) := by norm_num + have hden : ((3:ℝ)+1)+1 = 5 := by norm_num + rw [hlogeq, hden] at htan + have hbY : bY (Branch.node cs) = 1 / (4 + S) := by + have hden' : ((cs.length : ℝ) + 1) + (cs.map bY).sum = 4 + S := by rw [hlenR, ← hSdef]; ring + rw [bY_node, hden'] + -- d=4's pre-existing decouple lemma uses a non-uniform normalization; prove the UNIFORM + -- residual (matching the clean tangent) inline via the same log gap. + have hdS : (0:ℝ) < 4 + S := by linarith + have hμpos : (0:ℝ) ≤ mu := le_trans (by norm_num) hmu.1 + have hdec : (muPP 4 mu) - mu/3 + 9*mu*S/225 - (3/15) + + (2*Real.log (3/2) + Real.log (5/4) - 5*FSTAR) + mu/(4+S) ≤ 0 := by + obtain ⟨hμlo, hμhi⟩ := hmu + have hg := log_gap_d4 + rw [hmpp, div_eq_mul_inv mu (4+S)] + have hinv : (4+S)⁻¹ * (4+S) = 1 := inv_mul_cancel₀ (ne_of_gt hdS) + have hinvpos : 0 < (4+S)⁻¹ := inv_pos.mpr hdS + nlinarith [hg, hμlo, hμhi, hSnn, hSle, hdS, hinv, hinvpos, mul_nonneg hμpos (le_of_lt hinvpos), + mul_nonneg hμpos hSnn, mul_nonneg (mul_nonneg hμpos hSnn) (le_of_lt hinvpos), + mul_nonneg (mul_nonneg hμpos (le_of_lt hinvpos)) hSnn] + have hVpp : bV (muPP 4 mu) cherry = Real.log (3/2) - 2*FSTAR + muPP 4 mu * (1/3) := by + rw [bV, bell_cherry, bY_cherry] + have hVc : bV mu cherry = Real.log (3/2) - 2*FSTAR + mu * (1/3) := by + rw [bV, bell_cherry, bY_cherry] + have hbV : bV mu (Branch.node cs) = bell (Branch.node cs) + mu * (1/(4+S)) := by rw [bV, hbY] + have hRHS : bV mu (Branch.node cs) + ≤ ((3:ℝ) * bV (muPP 4 mu) cherry - muPP 4 mu * S + + (Real.log (5/4) + (S - 1)/5 - FSTAR)) + mu * (1/(4+S)) := by + rw [hbV]; linarith [htan, hsum] + have hbridge : ((3:ℝ) * bV (muPP 4 mu) cherry - muPP 4 mu * S + + (Real.log (5/4) + (S - 1)/5 - FSTAR)) + mu * (1/(4+S)) - bV mu cherry + = ((muPP 4 mu) - mu/3 + 9*mu*S/225 - (3/15) + + (2*Real.log (3/2) + Real.log (5/4) - 5*FSTAR) + mu/(4+S)) := by + rw [hVpp, hVc, hmpp]; ring + linarith [hRHS, hbridge, hdec] + +/-- **Hub connection, d=5** (`cs.length = 4`). -/ +theorem hub_le_d5 {mu : ℝ} (hmu : inI mu) {cs : List Branch} (hlen : cs.length = 4) + (hchild : ∀ c ∈ cs, PSCLne c) : + bV mu (Branch.node cs) ≤ bV mu cherry := by + set S := (cs.map bY).sum with hSdef + have hSnn : 0 ≤ S := by + rw [hSdef]; apply List.sum_nonneg; intro x hx; rw [List.mem_map] at hx + obtain ⟨c, _, rfl⟩ := hx; exact bY_nonneg c + have hlenR : (cs.length : ℝ) = 4 := by exact_mod_cast hlen + have hSle : S ≤ 4 := by + have := sum_bY_le_length cs; rw [hlenR] at this; rw [hSdef]; exact this + have hmpp : muPP 5 mu = 3*(19 - 3*mu)/361 := by rw [muPP]; norm_num + have hchild2 := child_scl_muPP (d:=5) (by norm_num) (by norm_num) hmu hchild + have hsum : (cs.map bell).sum ≤ (cs.length : ℝ) * bV (muPP 5 mu) cherry - muPP 5 mu * (cs.map bY).sum := + child_bell_sum_le (muPP 5 mu) cs hchild2 + rw [hlenR, ← hSdef] at hsum + have htan := bell_node_tangent cs (s0 := 4/3) (by norm_num) + rw [hlenR, ← hSdef] at htan + have hlogeq : Real.log (1 + 4/3/((4:ℝ)+1)) = Real.log (19/15) := by norm_num + have hden : ((4:ℝ)+1)+4/3 = 19/3 := by norm_num + rw [hlogeq, hden] at htan + have hbY : bY (Branch.node cs) = 1 / (5 + S) := by + have hden' : ((cs.length : ℝ) + 1) + (cs.map bY).sum = 5 + S := by rw [hlenR, ← hSdef]; ring + rw [bY_node, hden'] + have hdec := decouple_d5 mu S hmu hSnn hSle + have hVpp : bV (muPP 5 mu) cherry = Real.log (3/2) - 2*FSTAR + muPP 5 mu * (1/3) := by + rw [bV, bell_cherry, bY_cherry] + have hVc : bV mu cherry = Real.log (3/2) - 2*FSTAR + mu * (1/3) := by + rw [bV, bell_cherry, bY_cherry] + have hbV : bV mu (Branch.node cs) = bell (Branch.node cs) + mu * (1/(5+S)) := by rw [bV, hbY] + have hRHS : bV mu (Branch.node cs) + ≤ ((4:ℝ) * bV (muPP 5 mu) cherry - muPP 5 mu * S + + (Real.log (19/15) + (S - 4/3)/(19/3) - FSTAR)) + mu * (1/(5+S)) := by + rw [hbV]; linarith [htan, hsum] + have hbridge : ((4:ℝ) * bV (muPP 5 mu) cherry - muPP 5 mu * S + + (Real.log (19/15) + (S - 4/3)/(19/3) - FSTAR)) + mu * (1/(5+S)) - bV mu cherry + = ((4*(muPP 5 mu)/3) - mu/3 + 9*mu*S/361 - (4/19) + + (3*Real.log (3/2) + Real.log (19/15) - 7*FSTAR) + mu/(5+S)) := by + rw [hVpp, hVc, hmpp]; ring + linarith [hRHS, hbridge, hdec] + +/-- **Hub connection, d=6** (`cs.length = 5`). -/ +theorem hub_le_d6 {mu : ℝ} (hmu : inI mu) {cs : List Branch} (hlen : cs.length = 5) + (hchild : ∀ c ∈ cs, PSCLne c) : + bV mu (Branch.node cs) ≤ bV mu cherry := by + set S := (cs.map bY).sum with hSdef + have hSnn : 0 ≤ S := by + rw [hSdef]; apply List.sum_nonneg; intro x hx; rw [List.mem_map] at hx + obtain ⟨c, _, rfl⟩ := hx; exact bY_nonneg c + have hlenR : (cs.length : ℝ) = 5 := by exact_mod_cast hlen + have hSle : S ≤ 5 := by + have := sum_bY_le_length cs; rw [hlenR] at this; rw [hSdef]; exact this + have hmpp : muPP 6 mu = 3*(23 - 3*mu)/529 := by rw [muPP]; norm_num + have hchild2 := child_scl_muPP (d:=6) (by norm_num) (by norm_num) hmu hchild + have hsum : (cs.map bell).sum ≤ (cs.length : ℝ) * bV (muPP 6 mu) cherry - muPP 6 mu * (cs.map bY).sum := + child_bell_sum_le (muPP 6 mu) cs hchild2 + rw [hlenR, ← hSdef] at hsum + have htan := bell_node_tangent cs (s0 := 5/3) (by norm_num) + rw [hlenR, ← hSdef] at htan + have hlogeq : Real.log (1 + 5/3/((5:ℝ)+1)) = Real.log (23/18) := by norm_num + have hden : ((5:ℝ)+1)+5/3 = 23/3 := by norm_num + rw [hlogeq, hden] at htan + have hbY : bY (Branch.node cs) = 1 / (6 + S) := by + have hden' : ((cs.length : ℝ) + 1) + (cs.map bY).sum = 6 + S := by rw [hlenR, ← hSdef]; ring + rw [bY_node, hden'] + have hdec := decouple_d6 mu S hmu hSnn hSle + have hVpp : bV (muPP 6 mu) cherry = Real.log (3/2) - 2*FSTAR + muPP 6 mu * (1/3) := by + rw [bV, bell_cherry, bY_cherry] + have hVc : bV mu cherry = Real.log (3/2) - 2*FSTAR + mu * (1/3) := by + rw [bV, bell_cherry, bY_cherry] + have hbV : bV mu (Branch.node cs) = bell (Branch.node cs) + mu * (1/(6+S)) := by rw [bV, hbY] + have hRHS : bV mu (Branch.node cs) + ≤ ((5:ℝ) * bV (muPP 6 mu) cherry - muPP 6 mu * S + + (Real.log (23/18) + (S - 5/3)/(23/3) - FSTAR)) + mu * (1/(6+S)) := by + rw [hbV]; linarith [htan, hsum] + have hbridge : ((5:ℝ) * bV (muPP 6 mu) cherry - muPP 6 mu * S + + (Real.log (23/18) + (S - 5/3)/(23/3) - FSTAR)) + mu * (1/(6+S)) - bV mu cherry + = ((5*(muPP 6 mu)/3) - mu/3 + 9*mu*S/529 - (5/23) + + (4*Real.log (3/2) + Real.log (23/18) - 9*FSTAR) + mu/(6+S)) := by + rw [hVpp, hVc, hmpp]; ring + linarith [hRHS, hbridge, hdec] + +/-- **Hub connection, d=2** (`cs.length = 1`, single child). Special: a LEAF child makes the hub + `node [node []] = cherry` exactly (trivial equality); a NON-leaf child has `bY ≤ 1/2` (`S ≤ 1/2`), + so `decouple_d2` applies with the child IH at `μ'' = muPP 2 μ ∈ I`. -/ +theorem hub_le_d2 {mu : ℝ} (hmu : inI mu) {cs : List Branch} (hlen : cs.length = 1) + (hchild : ∀ c ∈ cs, PSCLne c) : + bV mu (Branch.node cs) ≤ bV mu cherry := by + obtain ⟨c, rfl⟩ : ∃ c, cs = [c] := by + cases cs with + | nil => simp at hlen + | cons c t => cases t with + | nil => exact ⟨c, rfl⟩ + | cons _ _ => simp at hlen + have hc1 : PSCLne c := hchild c (List.mem_cons.mpr (Or.inl rfl)) + by_cases hc : c = Branch.node [] + · subst hc; exact le_of_eq rfl + · set S := (([c] : List Branch).map bY).sum with hSdef + have hSnn : 0 ≤ S := by + rw [hSdef]; apply List.sum_nonneg; intro x hx; rw [List.mem_map] at hx + obtain ⟨z, _, rfl⟩ := hx; exact bY_nonneg z + have hScc : S = bY c := by rw [hSdef]; simp + have hSle : S ≤ 1/2 := by + rw [hScc] + cases c with + | node cs' => cases cs' with + | nil => exact absurd rfl hc + | cons a rest => exact bY_nonleaf_le_half a rest + have hlenR : (([c] : List Branch).length : ℝ) = 1 := by norm_num + have hmpp : muPP 2 mu = 3*(7 - 3*mu)/49 := by rw [muPP]; norm_num + have hchild2 : ∀ x ∈ ([c] : List Branch), bV (muPP 2 mu) x ≤ bV (muPP 2 mu) cherry := by + intro x hx + rw [List.mem_singleton] at hx; subst hx + exact hc1 hc (muPP 2 mu) (muPP_mem_I (by norm_num) (by norm_num) hmu) + have hsum : (([c] : List Branch).map bell).sum + ≤ (([c] : List Branch).length : ℝ) * bV (muPP 2 mu) cherry - muPP 2 mu * (([c] : List Branch).map bY).sum := + child_bell_sum_le (muPP 2 mu) [c] hchild2 + rw [hlenR, ← hSdef] at hsum + have htan := bell_node_tangent [c] (s0 := 1/3) (by norm_num) + rw [hlenR, ← hSdef] at htan + have hlogeq : Real.log (1 + 1/3/((1:ℝ)+1)) = Real.log (7/6) := by norm_num + have hden : ((1:ℝ)+1)+1/3 = 7/3 := by norm_num + rw [hlogeq, hden] at htan + have hbY : bY (Branch.node [c]) = 1 / (2 + S) := by + have hden' : (([c] : List Branch).length : ℝ) + 1 + (([c] : List Branch).map bY).sum = 2 + S := by + rw [hlenR, ← hSdef]; ring + rw [bY_node, hden'] + have hdec := decouple_d2 mu S hmu hSnn hSle + have hVpp : bV (muPP 2 mu) cherry = Real.log (3/2) - 2*FSTAR + muPP 2 mu * (1/3) := by + rw [bV, bell_cherry, bY_cherry] + have hVc : bV mu cherry = Real.log (3/2) - 2*FSTAR + mu * (1/3) := by + rw [bV, bell_cherry, bY_cherry] + have hbV : bV mu (Branch.node [c]) = bell (Branch.node [c]) + mu * (1/(2+S)) := by rw [bV, hbY] + have hRHS : bV mu (Branch.node [c]) + ≤ ((1:ℝ) * bV (muPP 2 mu) cherry - muPP 2 mu * S + + (Real.log (7/6) + (S - 1/3)/(7/3) - FSTAR)) + mu * (1/(2+S)) := by + rw [hbV]; linarith [htan, hsum] + have hbridge : ((1:ℝ) * bV (muPP 2 mu) cherry - muPP 2 mu * S + + (Real.log (7/6) + (S - 1/3)/(7/3) - FSTAR)) + mu * (1/(2+S)) - bV mu cherry + = ((muPP 2 mu)/3 - mu/3 - 1/7 + Real.log (7/6) - FSTAR + 9*mu*S/49 + mu/(2+S)) := by + rw [hVpp, hVc, hmpp]; ring + linarith [hRHS, hbridge, hdec] + +/-- **The cherry ceiling gap** `log(3/2) − 2 F* ≥ −1/50`. (True value `≈ −0.00768`; margin `+0.012`.) + `two_le_log_gap` is too loose here (`≥ −0.0248`), so combine `11·(log(3/2) − 2F*) = log(354294/385641)` + and lower-bound via `log x ≥ 1 − 1/x` (`Real.log_le_sub_one_of_pos` on the inverse). -/ +theorem cherry_ceiling_gap : (-1/50 : ℝ) ≤ Real.log (3/2) - 2*FSTAR := by + have hF : FSTAR = Real.log (621/64)/11 := rfl + rw [hF] + have hcomb : (11:ℝ)*(Real.log (3/2) - 2*(Real.log (621/64)/11)) + = Real.log ((3/2)^11 * (64/621)^2) := by + rw [Real.log_mul (by positivity) (by positivity), Real.log_pow, Real.log_pow, + show (64:ℝ)/621 = (621/64)⁻¹ by norm_num, Real.log_inv] + ring + have hXval : ((3/2:ℝ))^11 * (64/621)^2 = 354294/385641 := by norm_num + have hXpos : (0:ℝ) < ((3/2:ℝ))^11 * (64/621)^2 := by positivity + have hle := Real.log_le_sub_one_of_pos (inv_pos.mpr hXpos) + rw [Real.log_inv] at hle + rw [hXval] at hcomb hle + have hinvval : ((354294:ℝ)/385641)⁻¹ = 385641/354294 := by norm_num + rw [hinvval] at hle + linarith [hcomb, hle] + +/-- **Hub connection, d≥7 ceiling** (`cs.length ≥ 6`). For a high-degree hub the tangent decouple is loose; + instead `bV μ (node cs) = bell(node cs) + μ·bY ≤ 0 + μ/7 ≤ bV μ cherry`, using the branch ceiling + `bell (node cs) ≤ 0` (hypothesis; the separate not-yet-formalized result) and `bY ≤ 1/7`. The cherry + lower bound `μ/7 ≤ bV μ cherry` follows from `cherry_ceiling_gap` + `μ ≥ 456/3703` (`4μ/21 ≥ 1/50`). -/ +theorem hub_le_highdeg {mu : ℝ} (hmu : inI mu) {cs : List Branch} (hd7 : 6 ≤ cs.length) + (hceil : bell (Branch.node cs) ≤ 0) : + bV mu (Branch.node cs) ≤ bV mu cherry := by + have hμpos : (0:ℝ) ≤ mu := le_trans (by norm_num) hmu.1 + obtain ⟨hμlo, hμhi⟩ := hmu + set S := (cs.map bY).sum with hSdef + have hSnn : 0 ≤ S := by + rw [hSdef]; apply List.sum_nonneg; intro x hx; rw [List.mem_map] at hx + obtain ⟨z, _, rfl⟩ := hx; exact bY_nonneg z + have hlenR : (6:ℝ) ≤ (cs.length : ℝ) := by exact_mod_cast hd7 + have hden : (7:ℝ) ≤ ((cs.length : ℝ) + 1) + S := by linarith + have hbY : bY (Branch.node cs) = 1 / (((cs.length : ℝ) + 1) + S) := by rw [bY_node, ← hSdef] + have hbYle : bY (Branch.node cs) ≤ 1/7 := by + rw [hbY]; exact one_div_le_one_div_of_le (by norm_num) (by linarith) + have hbVnode : bV mu (Branch.node cs) ≤ mu * (1/7) := by + have hb : bV mu (Branch.node cs) = bell (Branch.node cs) + mu * bY (Branch.node cs) := rfl + rw [hb]; nlinarith [hceil, mul_le_mul_of_nonneg_left hbYle hμpos] + have hVc : bV mu cherry = Real.log (3/2) - 2*FSTAR + mu * (1/3) := by + rw [bV, bell_cherry, bY_cherry] + have h4μ : mu * (1/7) ≤ bV mu cherry := by + rw [hVc]; nlinarith [cherry_ceiling_gap, hμlo] + linarith [hbVnode, h4μ] + +/-- **The flowed per-hub step, from the branch ceiling.** Case split on `cs.length`: `{1..5}` route through + `hub_le_d2..d6` (tangent decouple), `≥6` through `hub_le_highdeg` (needs `bell (node cs) ≤ 0`). Reduces + `FlowedHubStep` — and hence the SCL for every non-leaf branch — to the single global obligation + `∀ b, bell b ≤ 0` (the branch ceiling). `conjecture1_proved = False`. -/ +theorem flowed_hub_step_of_ceiling (hceil : ∀ b, bell b ≤ 0) : FlowedHubStep := by + intro cs hcs hchild mu hmu + have hlen1 : 1 ≤ cs.length := by + rcases cs with _ | ⟨a, t⟩ + · exact absurd rfl hcs + · simp + rcases Nat.lt_or_ge cs.length 6 with hlo | hhi + · rcases (by omega : cs.length = 1 ∨ cs.length = 2 ∨ cs.length = 3 ∨ cs.length = 4 ∨ cs.length = 5) + with h | h | h | h | h + · exact hub_le_d2 hmu h hchild + · exact hub_le_d3 hmu h hchild + · exact hub_le_d4 hmu h hchild + · exact hub_le_d5 hmu h hchild + · exact hub_le_d6 hmu h hchild + · exact hub_le_highdeg hmu hhi (hceil (Branch.node cs)) + +/-- **The SCL for every non-leaf branch, from the branch ceiling.** Chains `flowed_hub_step_of_ceiling` + into `scl_of_flowed_step`. This is the full reduction of the leaf-excluding single-child lemma to the + single global obligation `∀ b, bell b ≤ 0`. `conjecture1_proved = False`. -/ +theorem scl_of_ceiling (hceil : ∀ b, bell b ≤ 0) : ∀ b, PSCLne b := + scl_of_flowed_step (flowed_hub_step_of_ceiling hceil) + +/-- **The per-hub ceiling step** — the SINGLE remaining obligation. A hub `node cs` whose children each + satisfy BOTH the branch ceiling `bell c ≤ 0` AND the leaf-excluding SCL `PSCLne c` has `bell (node cs) ≤ 0`. + This is exactly step `1b` / `2b-lo` of the BG upper-bound ledger (the `M_d` frontier: `ell(hub) ≤ ell(B(k)) ≤ 0`), + whose arithmetic is GATED in Telperion (`MdStepCertificate`, `NearBroomUnimodalityCertificate`, + `HighDegreeTailCertificate`, `BroomOptimumCertificate` — all `.check()` pass). Its shape — child ceilings + + child SCL ⟹ hub ceiling — is precisely what those certificates consume. `conjecture1_proved = False`. -/ +def CeilStep : Prop := + ∀ cs : List Branch, (∀ c ∈ cs, bell c ≤ 0) → (∀ c ∈ cs, PSCLne c) → bell (Branch.node cs) ≤ 0 + +/-- **The joint ceiling+SCL induction.** ONE well-founded strong induction on `|b|` proves BOTH the branch + ceiling `bell b ≤ 0` AND the leaf-excluding SCL `PSCLne b` for every branch, reduced to the single per-hub + ceiling step `CeilStep`. At a hub `node cs`: the child IH supplies BOTH properties on the (smaller) children; + `CeilStep` gives the hub ceiling `bell (node cs) ≤ 0`; then the SCL follows — `hub_le_d2..d6` (tangent + decouple, using child SCL) for degree `≤ 6`, and `hub_le_highdeg` (using the just-proved hub ceiling) for + degree `≥ 7`. This ELIMINATES the free-floating `∀ b, bell b ≤ 0` hypothesis of `scl_of_ceiling`: the SCL's + d≥7 leg now draws the ceiling from the JOINT induction hypothesis, so the sole residual is `CeilStep` itself + — the `M_d` frontier, matching the BG ledger's single open piece exactly. `conjecture1_proved = False`. -/ +theorem ceil_and_scl_of_ceilStep (hceil : CeilStep) : ∀ b, bell b ≤ 0 ∧ PSCLne b := by + refine scl_of_child_step bsize bchildren (fun b => bell b ≤ 0 ∧ PSCLne b) bchildren_bsize_lt + (fun a hIH => ?_) + cases a with + | node cs => + have hcc : ∀ c ∈ cs, bell c ≤ 0 := fun c hc => (hIH c (by simpa only [bchildren] using hc)).1 + have hcs : ∀ c ∈ cs, PSCLne c := fun c hc => (hIH c (by simpa only [bchildren] using hc)).2 + have hb : bell (Branch.node cs) ≤ 0 := hceil cs hcc hcs + refine ⟨hb, ?_⟩ + intro hne μ hμ + have hne' : cs ≠ [] := fun h => hne (by rw [h]) + have hlen1 : 1 ≤ cs.length := by + rcases cs with _ | ⟨a, t⟩ + · exact absurd rfl hne' + · simp + rcases Nat.lt_or_ge cs.length 6 with hlo | hhi + · rcases (by omega : cs.length = 1 ∨ cs.length = 2 ∨ cs.length = 3 ∨ cs.length = 4 ∨ cs.length = 5) + with h | h | h | h | h + · exact hub_le_d2 hμ h hcs + · exact hub_le_d3 hμ h hcs + · exact hub_le_d4 hμ h hcs + · exact hub_le_d5 hμ h hcs + · exact hub_le_d6 hμ h hcs + · exact hub_le_highdeg hμ hhi hb + +/-- The branch ceiling `∀ b, bell b ≤ 0` from the per-hub ceiling step. -/ +theorem bell_ceiling_of_ceilStep (hceil : CeilStep) : ∀ b, bell b ≤ 0 := + fun b => (ceil_and_scl_of_ceilStep hceil b).1 + +/-- The SCL `∀ b, PSCLne b` from the per-hub ceiling step (no free-floating ceiling hypothesis). -/ +theorem scl_of_ceilStep (hceil : CeilStep) : ∀ b, PSCLne b := + fun b => (ceil_and_scl_of_ceilStep hceil b).2 + +end BGSCL +end R3Cert diff --git a/proof/formalization/R3Cert/BGSCLSubaction.lean b/proof/formalization/R3Cert/BGSCLSubaction.lean new file mode 100644 index 00000000..1fc18663 --- /dev/null +++ b/proof/formalization/R3Cert/BGSCLSubaction.lean @@ -0,0 +1,477 @@ +/- + The additive SUBACTION bridge + first compact-core cell (2026-09-02). + + Companion to `BGSCLGStepBridge`. It replaces the (REFUTED) multiplicative capped-product step by the + ADDITIVE ergodic-optimization SUBACTION. Since `bell b = Σ_v e_v` telescopes (`bell_node`), a subaction + `ρ ≥ 0` satisfying the per-vertex inequality `e_v + ρ(v) ≤ Σ_{child c} ρ(c)` gives, by strong induction, + `bell b ≤ −ρ(root) ≤ 0` — the branch ceiling. Being a SUM (not a product), it structurally CANNOT incur the + multiplicative overshoot that makes the capped-product step `Le1Step` FALSE + (see `proof/docs/BG_LE1STEP_REFUTED_20260902.md`, `proof/docs/BG_CEILING_SUBACTION_20260902.md`). + + * `ceiling_of_subaction` — the bridge, sorry-free: `(ρ≥0 ∧ IsSubaction ρ) → ∀ b, bell b ≤ 0`. + * `subaction_cell_broom_d4` — the FIRST compact-core cell of the empirically-verified affine-per-degree + witness (`ρ(leaf)=F*`, `ρ(deg≥4)=0`) against the kernel: the degree-4 all-leaf (broom) corner, whose + `(SUB)` content is `log(7/4) ≤ 4·F*`, discharged by log-monotonicity + `norm_num` on the rational + `(7/4)^11 ≤ (621/64)^4`. This is the message-endpoint corner (all children at the maximal message `y=1`). + + This is a WITNESS + a reduction, NOT a closed ceiling: the full per-cell certificate family over the + compact deg-≤6 core (each an affine-in-μ endpoint check + a `log(1+S/d)` enclosure) and the high-degree tail + lemma remain to be discharged. No `sorry` here. `conjecture1_proved = False`. +-/ +import Mathlib +import R3Cert.BGSCLInduction +import R3Cert.BGSCLSubactionEnc + +namespace R3Cert +namespace BGSCL + +open Real + +/-- **The additive subaction inequality (SUB).** A function `ρ : Branch → ℝ` is a *subaction* when, at every + hub `node cs`, the local excess `e = log(1 + (Σ_c y_c)/d) − F*` (`d = |cs|+1`, `y_c = bY c`) plus the hub's + own `ρ` is dominated by the children's `ρ`-sum. For `cs = []` this specializes to `−F* + ρ(leaf) ≤ 0`, + i.e. `ρ(leaf) ≤ F*`. The `log(...) − FSTAR` term is exactly `bell_node`'s local excess, so summing `(SUB)` + over a branch telescopes to `bell b ≤ −ρ(root)`. -/ +def IsSubaction (ρ : Branch → ℝ) : Prop := + ∀ cs : List Branch, + (Real.log (1 + (cs.map bY).sum / ((cs.length : ℝ) + 1)) - FSTAR) + ρ (Branch.node cs) + ≤ (cs.map ρ).sum + +/-- **The additive SUBACTION bridge.** If `ρ ≥ 0` is a subaction, the whole branch ceiling `∀ b, bell b ≤ 0` + holds. Additive analog of `ceiling_of_gstep`: the per-vertex inequality is a SUM, so `Σ_v e_v = bell b` + telescopes against `−ρ(root) ≤ 0` with no multiplicative overshoot. Proof: `scl_of_child_step` strong + induction with the invariant `bell b + ρ b ≤ 0`; the hub step is exactly `(SUB)` plus the child IH sum. -/ +theorem ceiling_of_subaction (ρ : Branch → ℝ) + (hSUB : IsSubaction ρ) (hρ : ∀ b, 0 ≤ ρ b) : + ∀ b, bell b ≤ 0 := by + -- `Σ_c (bell c + ρ c) = Σ_c bell c + Σ_c ρ c` + have hsplit : ∀ l : List Branch, + (l.map (fun c => bell c + ρ c)).sum = (l.map bell).sum + (l.map ρ).sum := by + intro l; induction l with + | nil => simp + | cons a t ih => simp only [List.map_cons, List.sum_cons, ih]; ring + -- strengthened invariant `bell b + ρ b ≤ 0` + have key : ∀ b, bell b + ρ b ≤ 0 := by + refine scl_of_child_step bsize bchildren (fun b => bell b + ρ b ≤ 0) bchildren_bsize_lt ?_ + intro a hIH + cases a with + | node cs => + have hsum : (cs.map (fun c => bell c + ρ c)).sum ≤ 0 := by + refine list_sum_nonpos ?_ + intro x hx; rw [List.mem_map] at hx; obtain ⟨c, hc, rfl⟩ := hx + exact hIH c (by simpa [bchildren] using hc) + rw [hsplit] at hsum + have hsub := hSUB cs + rw [bell_node] + linarith + intro b + have h1 := key b + have h2 := hρ b + linarith + +/-! ### First compact-core cell of the verified witness against the kernel. -/ + +/-- `bY(leaf) = 1` for the leaf `node []` (the maximal message). -/ +theorem bY_leaf : bY (Branch.node []) = 1 := by + simp [bY, bh, bcc, cav, cavAgg] + +/-- The 3-leaf child list of the degree-4 broom vertex has message-sum `3` and length `3` — grounding the + cell's `(SUB)` numerics (`log(1 + 3/4) = log(7/4)`, RHS `= 3·F*`). -/ +theorem broom_d4_children_eval : + (([Branch.node [], Branch.node [], Branch.node []] : List Branch).map bY).sum = 3 + ∧ ([Branch.node [], Branch.node [], Branch.node []] : List Branch).length = 3 := by + refine ⟨?_, ?_⟩ + · simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, bY_leaf]; norm_num + · simp + +/-- `log(7/4) ≤ 4·F*` — the analytic content of the degree-4 broom cell, via log-monotonicity reduced to the + rational `(7/4)^11 ≤ (621/64)^4` (`norm_num`). `F* = log(621/64)/11`. -/ +theorem log74_le_4fstar : Real.log (7/4 : ℝ) ≤ 4 * FSTAR := by + rw [FSTAR] + have key : 11 * Real.log (7/4 : ℝ) ≤ 4 * Real.log (621/64 : ℝ) := by + have e1 : Real.log ((7/4 : ℝ) ^ (11 : ℕ)) = 11 * Real.log (7/4 : ℝ) := by + rw [Real.log_pow]; norm_num + have e2 : Real.log ((621/64 : ℝ) ^ (4 : ℕ)) = 4 * Real.log (621/64 : ℝ) := by + rw [Real.log_pow]; norm_num + have hle : Real.log ((7/4 : ℝ) ^ (11 : ℕ)) ≤ Real.log ((621/64 : ℝ) ^ (4 : ℕ)) := + Real.log_le_log (by positivity) (by norm_num) + rw [e1, e2] at hle; exact hle + linarith + +/-- **POC — the first compact-core cell of the witness against the kernel.** The subaction inequality `(SUB)` + at the degree-4 broom vertex (children = three leaves, all at the maximal message `y=1`), with the verified + affine-per-degree witness `ρ(broom)=0`, `ρ(leaf)=F*`: `(log(1 + 3/4) − F*) + 0 ≤ 3·F*`. This is the + all-children-maximal endpoint corner; the `log` is discharged exactly by `log74_le_4fstar`. Kernel-checked, + no `sorry`. -/ +theorem subaction_cell_broom_d4 : + (Real.log (1 + 3 / ((3 : ℝ) + 1)) - FSTAR) + (0 : ℝ) ≤ 3 * FSTAR := by + have h74 : (1 + 3 / ((3 : ℝ) + 1)) = 7 / 4 := by norm_num + rw [h74] + have := log74_le_4fstar + linarith + +/-! ### The first TIGHT compact-core cell (deg-4 hub, deg-3 children) — tangent-endpoint + log-enclosure. -/ + +/-- The (rational, tie-free) degree-3 line of the verified witness, `ρ₃(μ) = (1/8)(μ − 1/5)`. With + `ρ(leaf)=F*`, `ρ(2,μ)=2F*−log(3/2)+(1/4)(μ−1/3)`, `ρ(3,·)=ρ₃`, `ρ(deg≥4)=0`, the subaction holds globally + (checked on all branches `n≤14`); `ρ₃` is the piece the deg-4 tight cell exercises. -/ +noncomputable def ρ3 (μ : ℝ) : ℝ := (1 / 8) * (μ - 1 / 5) + +/-- **Log-enclosure** `log(5/4) − F* ≤ 1/20`, via `log x ≤ x − 1` at `x = (5/4)^11·(64/621) ≈ 1.20` + (so `log x ≤ x−1 ≈ 0.20 ≤ 11/20`, all rational after clearing the `11·F* = log(621/64)`). This is the + analytic content the deg-4/deg-3 tight cell rests on (kin to the parallel session's + `TranscendentalEnclosureEmitter`). -/ +theorem log54_sub_fstar_le : Real.log (5 / 4 : ℝ) - FSTAR ≤ 1 / 20 := by + rw [FSTAR] + have hpos : (0 : ℝ) < (5 / 4 : ℝ) ^ (11 : ℕ) * (64 / 621) := by positivity + have hr := Real.log_le_sub_one_of_pos hpos + have hsplit : Real.log ((5 / 4 : ℝ) ^ (11 : ℕ) * (64 / 621)) + = 11 * Real.log (5 / 4) - Real.log (621 / 64) := by + rw [Real.log_mul (by positivity) (by norm_num), Real.log_pow, + show (64 / 621 : ℝ) = (621 / 64)⁻¹ by norm_num, Real.log_inv] + push_cast; ring + rw [hsplit] at hr + have hnum : (5 / 4 : ℝ) ^ (11 : ℕ) * (64 / 621) - 1 ≤ 11 / 20 := by norm_num + linarith + +/-- **POC — the first TIGHT compact-core cell (degree-4 hub with three degree-3 children).** The subaction + inequality `(SUB)` at a degree-4 vertex (`ρ = 0`) whose three children are degree-3 with messages + `y_i ∈ [1/5, 1/3]` (`ρ(3,·) = ρ₃`): `(log(1 + (Σy)/4) − F*) + 0 ≤ Σ ρ₃(y_i)`. This is the binding cell + class (margin ≈ 0.033), far tighter than the broom corner. The proof is the two tools the whole + certificate family needs: the CONCAVE-LOG TANGENT at the aggregate endpoint `S = 1` (`log_tangent`, which + collapses the 3-variable child-message box to the message endpoint — the analytic form of ①'s + affine-endpoint / the `CurvatureBoundaryEmitter`), plus the LOG-ENCLOSURE `log(5/4) − F* ≤ 1/20`. + Kernel-checked, no `sorry`. -/ +theorem subaction_cell_d4_d3 (y1 y2 y3 : ℝ) + (h1 : 1 / 5 ≤ y1) (h1' : y1 ≤ 1 / 3) (h2 : 1 / 5 ≤ y2) (h2' : y2 ≤ 1 / 3) + (h3 : 1 / 5 ≤ y3) (h3' : y3 ≤ 1 / 3) : + (Real.log (1 + (y1 + y2 + y3) / 4) - FSTAR) + 0 ≤ ρ3 y1 + ρ3 y2 + ρ3 y3 := by + have hS0 : (0 : ℝ) ≤ y1 + y2 + y3 := by linarith + have hS1 : y1 + y2 + y3 ≤ 1 := by linarith + -- tangent of the concave `log(1 + S/4)` at the aggregate endpoint S = 1 + have htan := log_tangent (d := (4 : ℝ)) (s := y1 + y2 + y3) (s0 := (1 : ℝ)) + (by norm_num) hS0 (by norm_num) + rw [show (1 : ℝ) + 1 / 4 = 5 / 4 by norm_num, show (4 : ℝ) + 1 = 5 by norm_num] at htan + have henc := log54_sub_fstar_le + simp only [ρ3] + linarith + +/-! ### The validated explicit witness `ρwit`, and the single conditional theorem. + + NOTE: the exploratory `ρ3(μ)=(1/8)(μ−1/5)` above was found (2026-09-03) to belong to a witness that + FAILS the high-degree-parent tail (a deg-D hub with deg-4 children at message → 1/4 has `e_node>0`, + `RHS=0`); `subaction_cell_broom_d4`/`subaction_cell_d4_d3`/`log54_sub_fstar_le`/`log74_le_4fstar` remain + TRUE isolated inequalities (and the log-enclosure tools), but are not cells of a globally-valid witness. + The corrected, thoroughly-validated witness (enumerated n≤15 + tail to deg-140 + spider family + 120k + mixed high-degree trees, margin 0 tight only at the `27·23` tie, `ρ≥0`) is `ρwit` below — clean rationals + except the two tie anchors `F*`, `log(3/2)`; `e_tail = log(1+1/d)−F* > 0` only for `d=2,3,4`, so `ρ` + vanishes for `d≥5`. -/ + +/-- Every message is `≤ 1` (`bY(node cs) = 1/((|cs|+1)+Σ bY) ≤ 1`). -/ +theorem bY_le_one (b : Branch) : bY b ≤ 1 := by + cases b with + | node cs => + rw [bY_node] + have hSnn : (0:ℝ) ≤ (cs.map bY).sum := + List.sum_nonneg (fun x hx => by + rw [List.mem_map] at hx; obtain ⟨c, _, rfl⟩ := hx; exact bY_nonneg c) + have hcl : (0:ℝ) ≤ (cs.length : ℝ) := Nat.cast_nonneg _ + have hpos : (0:ℝ) < ((cs.length : ℝ) + 1) + (cs.map bY).sum := by linarith + rw [div_le_one hpos] + linarith + +/-- A degree-2 branch (`node [c]`) has message `≥ 1/3` (since the single child's message is `≤ 1`). -/ +theorem bY_deg2_ge_third (c : Branch) : (1:ℝ)/3 ≤ bY (Branch.node [c]) := by + rw [bY_node] + have hc := bY_le_one c + have h0 := bY_nonneg c + simp only [List.length_cons, List.length_nil, List.map_cons, List.map_nil, List.sum_cons, + List.sum_nil, Nat.cast_one, add_zero, zero_add] + apply one_div_le_one_div_of_le (by linarith) + linarith + +/-- `0 ≤ F*`. -/ +theorem fstar_nonneg : 0 ≤ FSTAR := + by rw [FSTAR]; exact div_nonneg (Real.log_nonneg (by norm_num)) (by norm_num) + +/-- The cherry/tie anchor is nonnegative: `2F* − log(3/2) ≥ 0` (via `(621/64)² ≥ (3/2)¹¹`, F*-folded). -/ +theorem cherry_anchor_nonneg : 0 ≤ 2 * FSTAR - Real.log (3/2 : ℝ) := by + rw [FSTAR] + have h : 11 * Real.log (3/2 : ℝ) ≤ 2 * Real.log (621/64 : ℝ) := by + have e1 : Real.log ((3/2 : ℝ) ^ (11:ℕ)) = 11 * Real.log (3/2) := by rw [Real.log_pow]; norm_num + have e2 : Real.log ((621/64 : ℝ) ^ (2:ℕ)) = 2 * Real.log (621/64) := by rw [Real.log_pow]; norm_num + have hle : Real.log ((3/2 : ℝ) ^ (11:ℕ)) ≤ Real.log ((621/64 : ℝ) ^ (2:ℕ)) := + Real.log_le_log (by positivity) (by norm_num) + rw [e1, e2] at hle; exact hle + linarith + +/-- **The validated explicit witness** `ρwit : Branch → ℝ`, keyed by degree `= bcc + 1` and message `bY`: + `ρ(leaf)=F*`, `ρ(2,μ)=2F*−log(3/2)+(1/4)(μ−1/3)`, `ρ(3,μ)=μ/32`, `ρ(4,μ)=μ/384`, `ρ(deg≥5)=0`. -/ +noncomputable def ρwit (b : Branch) : ℝ := + match bcc b with + | 0 => FSTAR + | 1 => (2 * FSTAR - Real.log (3/2)) + (1/4) * (bY b - 1/3) + | 2 => (1/32) * bY b + | 3 => (1/384) * bY b + | _ => 0 + +/-- `ρwit ≥ 0` everywhere (the nonnegativity the bridge requires). -/ +theorem ρwit_nonneg (b : Branch) : 0 ≤ ρwit b := by + cases b with + | node cs => + rcases cs with _ | ⟨c, _ | ⟨c2, _ | ⟨c3, _ | ⟨c4, t⟩⟩⟩⟩ + · simp only [ρwit, bcc, List.length_nil]; exact fstar_nonneg + · simp only [ρwit, bcc, List.length_cons, List.length_nil] + have hb3 := bY_deg2_ge_third c + have hch := cherry_anchor_nonneg + nlinarith [hb3, hch] + · simp only [ρwit, bcc, List.length_cons, List.length_nil] + exact mul_nonneg (by norm_num) (bY_nonneg _) + · simp only [ρwit, bcc, List.length_cons, List.length_nil] + exact mul_nonneg (by norm_num) (bY_nonneg _) + · simp [ρwit, bcc, List.length_cons] + +/-- **The ceiling, reduced to a single explicit hypothesis.** If the validated rational witness `ρwit` + satisfies the per-vertex subaction inequality (`IsSubaction ρwit` — the finite per-cell family over the + compact deg-≤4 core plus the `deg≥5 ⇒ ρ=0` tail), then the whole branch ceiling `∀ b, bell b ≤ 0` holds. + The nonnegativity leg is discharged (`ρwit_nonneg`); `IsSubaction ρwit` is the one remaining obligation, + now against a concrete, thoroughly-validated witness. `conjecture1_proved = False`. -/ +theorem ceiling_of_witness (hSUB : IsSubaction ρwit) : ∀ b, bell b ≤ 0 := + ceiling_of_subaction ρwit hSUB ρwit_nonneg + +/-! ### First cells of `IsSubaction ρwit` (the remaining obligation). + + `IsSubaction ρwit` is `∀ cs, e_node + ρwit(node cs) ≤ Σ_c ρwit(c)`; discharging it is a finite per-node + family: node degree `d = |cs|+1 ∈ {1,2,3,4}` (each with arbitrary child-degree mixes) plus the + `d ≥ 5 ⇒ ρwit(node)=0` tail cells, every cell a tangent-endpoint reduction + an F*-folded log-enclosure + (`curvature_boundary` + `log_combination`). These two anchor cells are the base and the tie leg. -/ + +/-- `ρwit(leaf) = F*`. -/ +theorem ρwit_leaf : ρwit (Branch.node []) = FSTAR := by simp [ρwit, bcc] + +/-- **Cell: the leaf node** (`cs = []`, degree 1). `(log 1 − F*) + F* = 0 ≤ 0` — the trivial base. -/ +theorem subaction_nil : + (Real.log (1 + (([] : List Branch).map bY).sum / (((([] : List Branch)).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node []) ≤ (([] : List Branch).map ρwit).sum := by + simp only [List.map_nil, List.sum_nil, List.length_nil, Nat.cast_zero, zero_add, zero_div, + add_zero, Real.log_one, ρwit_leaf] + linarith + +/-- **Cell: the cherry** (`cs = [leaf]`, degree 2 with one leaf child). Here `bY(leaf)=1`, `bY(node)=1/3`, + so `ρwit(node)=2F*−log(3/2)` and the inequality is `(log(3/2)−F*)+(2F*−log(3/2)) ≤ F*`, i.e. `F* ≤ F*` + — the EXACT tie leg (equality), the `27·23` identity's degree-2 face. -/ +theorem subaction_cherry : + (Real.log (1 + (([Branch.node []]).map bY).sum + / ((([Branch.node []] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [Branch.node []]) ≤ (([Branch.node []]).map ρwit).sum := by + have hbYnode : bY (Branch.node [Branch.node []]) = 1/3 := by + rw [bY_node]; simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, + List.length_cons, List.length_nil, bY_leaf, Nat.cast_one, add_zero, zero_add] + norm_num + have hrnode : ρwit (Branch.node [Branch.node []]) = 2 * FSTAR - Real.log (3/2) := by + rw [ρwit]; simp only [bcc, List.length_cons, List.length_nil, hbYnode]; ring + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil, bY_leaf, ρwit_leaf, hrnode, add_zero, Nat.cast_one, zero_add] + rw [show (1:ℝ) + 1 / (1 + 1) = 3/2 by norm_num] + linarith + +/-- Message bound by degree: `bY b ≤ 1/(bcc b + 1) = 1/deg`. -/ +theorem bY_le_inv_deg (b : Branch) : bY b ≤ 1 / ((bcc b : ℝ) + 1) := by + cases b with + | node cs => + rw [bY_node] + simp only [bcc] + have hSnn : (0:ℝ) ≤ (cs.map bY).sum := List.sum_nonneg (fun x hx => by + rw [List.mem_map] at hx; obtain ⟨c, _, rfl⟩ := hx; exact bY_nonneg c) + have hd : (0:ℝ) < (cs.length : ℝ) + 1 := by positivity + exact one_div_le_one_div_of_le hd (by linarith) + +/-- Log-enclosure for the deg-2 node with a deg≥5 child: `log(11/15) + F* + 1/24 ≤ 0` + (via `log x ≤ x−1` at `x = (11/15)¹¹·(621/64) ≈ 0.32`, F*-folded). -/ +theorem d2_deg5_enc : Real.log (11/15 : ℝ) + FSTAR + 1/24 ≤ 0 := by + rw [FSTAR] + have hr := Real.log_le_sub_one_of_pos + (show (0:ℝ) < (11/15 : ℝ) ^ (11:ℕ) * (621/64) by positivity) + have hsplit : Real.log ((11/15 : ℝ) ^ (11:ℕ) * (621/64)) + = 11 * Real.log (11/15) + Real.log (621/64) := by + rw [Real.log_mul (by positivity) (by norm_num), Real.log_pow]; push_cast; ring + rw [hsplit] at hr + have hnum : (11/15 : ℝ) ^ (11:ℕ) * (621/64) - 1 ≤ -11/24 := by norm_num + linarith + +/-- **Cell: degree-2 node with any deg≥5 child.** Here the child's `ρwit = 0` and its message `≤ 1/5`, so + the local excess is already `< 0`: `(log(1+bY c/2) − F*) + ρwit(node) ≤ log(11/10) − F* + [2F*−log(3/2)+1/24] + = log(11/15) + F* + 1/24 ≤ 0`. Covers infinitely many child degrees uniformly. -/ +theorem subaction_deg2_deg5child (c : Branch) (hc : 4 ≤ bcc c) : + (Real.log (1 + (([c]).map bY).sum / ((([c] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c]) ≤ (([c]).map ρwit).sum := by + have hy0 := bY_nonneg c + have hy5 : bY c ≤ 1/5 := by + have h1 := bY_le_inv_deg c + have hcast : (4:ℝ) ≤ (bcc c : ℝ) := by exact_mod_cast hc + have h2 : (1:ℝ) / ((bcc c : ℝ) + 1) ≤ 1/5 := one_div_le_one_div_of_le (by norm_num) (by linarith) + linarith + have hrc : ρwit c = 0 := by + rw [ρwit] + rcases hbc : bcc c with _ | _ | _ | _ | n + · exact absurd hbc (by omega) + · exact absurd hbc (by omega) + · exact absurd hbc (by omega) + · exact absurd hbc (by omega) + · rfl + have hrnode : ρwit (Branch.node [c]) ≤ 2 * FSTAR - Real.log (3/2) + 1/24 := by + have hbn : bY (Branch.node [c]) ≤ 1/2 := by + have h := bY_le_inv_deg (Branch.node [c]) + simp only [bcc, List.length_cons, List.length_nil] at h + norm_num at h ⊢; linarith + rw [ρwit]; simp only [bcc, List.length_cons, List.length_nil] + linarith + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil, hrc, add_zero, zero_add, Nat.cast_one] + have hlog : Real.log (1 + bY c / (1 + 1)) ≤ Real.log (11/10) := by + apply Real.log_le_log (by positivity) + have : bY c / (1 + 1) ≤ 1/10 := by linarith + linarith + have hld : Real.log (11/10 : ℝ) - Real.log (3/2) = Real.log (11/15) := by + rw [← Real.log_div (by norm_num) (by norm_num)]; norm_num + have henc := d2_deg5_enc + linarith [hlog, hrnode, henc, hld] + +/-- Tighter enclosure `log(5/4) − F* ≤ 1/55` (via `log x ≤ x−1` at `x=(5/4)¹¹·(64/621) ≈ 1.1998`, + so `x−1 ≈ 0.1998 ≤ 11/55`, F*-folded). -/ +theorem log54_sub_fstar_le' : Real.log (5/4 : ℝ) - FSTAR ≤ 1/55 := by + rw [FSTAR] + have hr := Real.log_le_sub_one_of_pos + (show (0:ℝ) < (5/4 : ℝ) ^ (11:ℕ) * (64/621) by positivity) + have hsplit : Real.log ((5/4 : ℝ) ^ (11:ℕ) * (64/621)) + = 11 * Real.log (5/4) - Real.log (621/64) := by + rw [Real.log_mul (by positivity) (by norm_num), Real.log_pow, + show (64/621 : ℝ) = (621/64)⁻¹ by norm_num, Real.log_inv] + push_cast; ring + rw [hsplit] at hr + have hnum : (5/4 : ℝ) ^ (11:ℕ) * (64/621) - 1 ≤ 11/55 := by norm_num + linarith + +/-- A degree-2 branch (`bcc = 1`) has message `≥ 1/3`. -/ +theorem bY_ge_third_of_bcc1 (c : Branch) (hc : bcc c = 1) : (1:ℝ)/3 ≤ bY c := by + cases c with + | node cs => + simp only [bcc] at hc + rcases cs with _ | ⟨c', _ | ⟨c2, t⟩⟩ + · simp at hc + · exact bY_deg2_ge_third c' + · simp only [List.length_cons, List.length_nil] at hc; omega + +/-- **Cell: degree-2 node with a deg-2 child** (`bcc c = 1`, `bY c ∈ [1/3,1/2]`). The delicate mid case: + after cancelling the shared `2F*−log(3/2)−(1/4)(1/3)`, reduces to + `log(1+y/2) − F* + (1/4)/(2+y) ≤ (1/4)y`, closed by the concave-log tangent at `y=1/2`, the convex + secant bound `1/(2+y) ≤ 3/7 − (6/35)(y−1/3)`, and the tight enclosure `log(5/4)−F* ≤ 1/55`. -/ +theorem subaction_deg2_deg2child (c : Branch) (hc : bcc c = 1) : + (Real.log (1 + (([c]).map bY).sum / ((([c] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c]) ≤ (([c]).map ρwit).sum := by + have hy0 := bY_nonneg c + have hy_lo : (1:ℝ)/3 ≤ bY c := bY_ge_third_of_bcc1 c hc + have hy_hi : bY c ≤ 1/2 := by + have h := bY_le_inv_deg c; rw [hc] at h; norm_num at h; linarith + have hden : (0:ℝ) < 2 + bY c := by linarith + have hrc : ρwit c = 2 * FSTAR - Real.log (3/2) + (1/4) * (bY c - 1/3) := by + simp only [ρwit, hc] + have hbYn : bY (Branch.node [c]) = 1 / (2 + bY c) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + Nat.cast_one, add_zero, zero_add] + norm_num + have hrn : ρwit (Branch.node [c]) + = 2 * FSTAR - Real.log (3/2) + (1/4) * (1 / (2 + bY c) - 1/3) := by + rw [ρwit]; simp only [bcc, List.length_cons, List.length_nil]; rw [hbYn] + have htan : Real.log (1 + bY c / (1 + 1)) ≤ Real.log (5/4) + (2/5) * (bY c - 1/2) := by + have h := log_tangent (d := (2:ℝ)) (s := bY c) (s0 := (1:ℝ)/2) + (by norm_num) (by linarith) (by norm_num) + rw [show (1:ℝ) + (1/2)/2 = 5/4 by norm_num, show (2:ℝ) + 1/2 = 5/2 by norm_num] at h + rw [show (1:ℝ) + bY c / (1 + 1) = 1 + bY c / 2 by norm_num] + calc Real.log (1 + bY c / 2) ≤ Real.log (5/4) + (bY c - 1/2) / (5/2) := h + _ = Real.log (5/4) + (2/5) * (bY c - 1/2) := by ring + have hsec : 1 / (2 + bY c) ≤ 3/7 - (6/35) * (bY c - 1/3) := by + rw [div_le_iff₀ hden] + nlinarith [mul_nonneg (show (0:ℝ) ≤ bY c - 1/3 by linarith) + (show (0:ℝ) ≤ 1/2 - bY c by linarith)] + have henc := log54_sub_fstar_le' + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil, hrc, hrn, add_zero] + linarith [htan, hsec, henc, hy_lo, hy_hi] + +/-- **Cell: degree-2 node with ANY deg≥3 child** — closes the whole degree-2 node. For any child with + `bcc c ≥ 2` (degree ≥ 3), the message `≤ 1/3`, so `log(1+bY c/2) ≤ log(7/6)` and + `ρwit(node) ≤ 2F*−log(3/2)+1/24`, giving LHS `≤ log(7/6)−F*+[2F*−log(3/2)+1/24] = log(7/9)+F*+1/24 ≤ 0` + (the tight-route enclosure `log79_add_fstar`, Telperion `emit_log_combination route='tight'`), which is + `≤ 0 ≤ ρwit c`. Subsumes `subaction_deg2_deg5child` and handles the deg-3/deg-4 children the degree-1 + tangent could not. -/ +theorem subaction_deg2_highchild (c : Branch) (hc : 2 ≤ bcc c) : + (Real.log (1 + (([c]).map bY).sum / ((([c] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c]) ≤ (([c]).map ρwit).sum := by + have hy0 := bY_nonneg c + have hy3 : bY c ≤ 1/3 := by + have h1 := bY_le_inv_deg c + have hcast : (2:ℝ) ≤ (bcc c : ℝ) := by exact_mod_cast hc + have h2 : (1:ℝ) / ((bcc c : ℝ) + 1) ≤ 1/3 := one_div_le_one_div_of_le (by norm_num) (by linarith) + linarith + have hrnode : ρwit (Branch.node [c]) ≤ 2 * FSTAR - Real.log (3/2) + 1/24 := by + have hbn : bY (Branch.node [c]) ≤ 1/2 := by + have h := bY_le_inv_deg (Branch.node [c]) + simp only [bcc, List.length_cons, List.length_nil] at h + norm_num at h ⊢; linarith + rw [ρwit]; simp only [bcc, List.length_cons, List.length_nil] + linarith + have hrc_nn : 0 ≤ ρwit c := ρwit_nonneg c + have henc : Real.log (7/9 : ℝ) + FSTAR + 1/24 ≤ 0 := by have h := log79_add_fstar; linarith + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil, add_zero, zero_add, Nat.cast_one] + have hlog : Real.log (1 + bY c / (1 + 1)) ≤ Real.log (7/6) := by + apply Real.log_le_log (by positivity) + have : bY c / (1 + 1) ≤ 1/6 := by linarith + linarith + have hld : Real.log (7/6 : ℝ) - Real.log (3/2) = Real.log (7/9) := by + rw [← Real.log_div (by norm_num) (by norm_num)]; norm_num + linarith [hlog, hrnode, hrc_nn, hld, henc] + +/-! ### First MULTI-child cell (node degree 3): the two-leaf broom. -/ + +/-- Log-enclosure for the degree-3 broom: `log(5/3) + 1/160 ≤ 3F*` (monotone/tangent route, comfortable + margin: fold `(5/3)¹¹·(64/621)³ ≈ 0.555`, `x−1 ≈ −0.445 ≤ −11/160`). -/ +theorem log53_enc : Real.log (5/3 : ℝ) + 1/160 ≤ 3 * FSTAR := by + rw [FSTAR] + have hr := Real.log_le_sub_one_of_pos + (show (0:ℝ) < (5/3 : ℝ) ^ (11:ℕ) * (64/621 : ℝ) ^ (3:ℕ) by positivity) + have hsplit : Real.log ((5/3 : ℝ) ^ (11:ℕ) * (64/621 : ℝ) ^ (3:ℕ)) + = 11 * Real.log (5/3) - 3 * Real.log (621/64) := by + rw [Real.log_mul (by positivity) (by positivity), Real.log_pow, Real.log_pow, + show (64/621 : ℝ) = (621/64)⁻¹ by norm_num, Real.log_inv] + push_cast; ring + rw [hsplit] at hr + have hnum : (5/3 : ℝ) ^ (11:ℕ) * (64/621 : ℝ) ^ (3:ℕ) - 1 ≤ -11/160 := by norm_num + linarith + +/-- **Cell: the degree-3 broom** (`cs = [leaf, leaf]`). Both children are leaves (`bY=1`, `ρwit=F*`), the + node has `bY=1/5`, `ρwit(node)=1/160`; the inequality is `(log(5/3)−F*)+1/160 ≤ 2F*`, a fixed-point + 2-child enclosure (no decouple — messages are pinned). Pins the two-child list mechanics. -/ +theorem subaction_broom_d3 : + (Real.log (1 + (([Branch.node [], Branch.node []]).map bY).sum + / ((([Branch.node [], Branch.node []] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [Branch.node [], Branch.node []]) + ≤ (([Branch.node [], Branch.node []]).map ρwit).sum := by + have hbY : bY (Branch.node [Branch.node [], Branch.node []]) = 1/5 := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil, bY_leaf] + norm_num + have hrnode : ρwit (Branch.node [Branch.node [], Branch.node []]) = 1/160 := by + rw [ρwit]; simp only [bcc, List.length_cons, List.length_nil, hbY]; norm_num + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil, bY_leaf, ρwit_leaf, hrnode] + rw [show ((0 + 1 + 1 : ℕ) : ℝ) = 2 by norm_num, + show (1:ℝ) + (1 + (1 + 0)) / (2 + 1) = 5/3 by norm_num] + have := log53_enc + linarith + +end BGSCL +end R3Cert diff --git a/proof/formalization/R3Cert/BGSCLSubactionD4.lean b/proof/formalization/R3Cert/BGSCLSubactionD4.lean new file mode 100644 index 00000000..3fa9322e --- /dev/null +++ b/proof/formalization/R3Cert/BGSCLSubactionD4.lean @@ -0,0 +1,114 @@ +/- + The degree-4 hub `IsSubaction ρwit` enclosure atoms (2026-09-03). + + A degree-4 hub has 3 children; `ρwit(node) = bY(node)/384`. Every one of the 35 child-degree profiles + (multisets from {leaf, 2, 3, 4, ≥5}) closes with a SINGLE `log_tangent` at its binding corner, reducing to a + single-log enclosure `log A + kL·log(3/2) − kF·F* ≤ B` — ALL on the **tangent route** (`log x ≤ x−1`), the + cheapest. See `proof/docs/BG_SUBACTION_D4_TAIL_TIE_SPEC.md` for the derivation and the recipe. + + This file DOGFOODS the whole 35-atom table against the kernel via one reusable lemma `tangent_atom` + (the tangent-route enclosure generator, `zpow` so one lemma covers every `log(3/2)`-fold sign), then 35 + one-line applications. Names `d4_` with `L` = leaf. Kernel-checked, no `sorry`. + `conjecture1_proved = False`. +-/ +import Mathlib +import R3Cert.BGSCLInduction + +namespace R3Cert +namespace BGSCL + +open Real + +/-- **The tangent-route enclosure generator.** For any `A > 0` and integer fold exponents `kL, kF`, if the + folded rational `X = A¹¹·(3/2)^(11kL)·(621/64)^(−kF)` satisfies `X − 1 ≤ 11·B` (a `norm_num` fact), then + `log A + kL·log(3/2) − kF·F* ≤ B`. This is the `emit_log_combination` tangent route, dogfooded once; + every d=4 atom below is a one-line application. -/ +theorem tangent_atom (A : ℝ) (kL kF : ℤ) (B : ℝ) (hA : 0 < A) + (hfold : A ^ (11:ℤ) * (3/2 : ℝ) ^ (11 * kL) * (621/64 : ℝ) ^ (-kF) - 1 ≤ 11 * B) : + Real.log A + (kL : ℝ) * Real.log (3/2) - (kF : ℝ) * FSTAR ≤ B := by + rw [FSTAR] + have hpos : (0:ℝ) < A ^ (11:ℤ) * (3/2 : ℝ) ^ (11 * kL) * (621/64 : ℝ) ^ (-kF) := by positivity + have hr := Real.log_le_sub_one_of_pos hpos + have hsplit : Real.log (A ^ (11:ℤ) * (3/2 : ℝ) ^ (11 * kL) * (621/64 : ℝ) ^ (-kF)) + = 11 * Real.log A + (11 * (kL:ℝ)) * Real.log (3/2) - (kF:ℝ) * Real.log (621/64) := by + rw [Real.log_mul (by positivity) (by positivity), Real.log_mul (by positivity) (by positivity), + Real.log_zpow, Real.log_zpow, Real.log_zpow] + push_cast; ring + rw [hsplit] at hr + linarith + +/-! ### The 35 degree-4 enclosure atoms (all tangent route). -/ + +theorem d4_LLL : Real.log (7/4 : ℝ) + (0 : ℤ) * Real.log (3/2) - (4 : ℤ) * FSTAR ≤ (-1/2688 : ℝ) := + tangent_atom (7/4 : ℝ) (0) (4) (-1/2688 : ℝ) (by norm_num) (by norm_num) +theorem d4_2LL : Real.log (19/12 : ℝ) + (-1 : ℤ) * Real.log (3/2) - (5 : ℤ) * FSTAR ≤ (-1/2432 : ℝ) := + tangent_atom (19/12 : ℝ) (-1) (5) (-1/2432 : ℝ) (by norm_num) (by norm_num) +theorem d4_22L : Real.log (17/12 : ℝ) + (-2 : ℤ) * Real.log (3/2) - (6 : ℤ) * FSTAR ≤ (-1/2176 : ℝ) := + tangent_atom (17/12 : ℝ) (-2) (6) (-1/2176 : ℝ) (by norm_num) (by norm_num) +theorem d4_222 : Real.log (5/4 : ℝ) + (-3 : ℤ) * Real.log (3/2) - (7 : ℤ) * FSTAR ≤ (-1/1920 : ℝ) := + tangent_atom (5/4 : ℝ) (-3) (7) (-1/1920 : ℝ) (by norm_num) (by norm_num) +theorem d4_223 : Real.log (5/4 : ℝ) + (-2 : ℤ) * Real.log (3/2) - (5 : ℤ) * FSTAR ≤ (53/5376 : ℝ) := + tangent_atom (5/4 : ℝ) (-2) (5) (53/5376 : ℝ) (by norm_num) (by norm_num) +theorem d4_224 : Real.log (59/48 : ℝ) + (-2 : ℤ) * Real.log (3/2) - (5 : ℤ) * FSTAR ≤ (1/10752 : ℝ) := + tangent_atom (59/48 : ℝ) (-2) (5) (1/10752 : ℝ) (by norm_num) (by norm_num) +theorem d4_225 : Real.log (73/60 : ℝ) + (-2 : ℤ) * Real.log (3/2) - (5 : ℤ) * FSTAR ≤ (-1/1792 : ℝ) := + tangent_atom (73/60 : ℝ) (-2) (5) (-1/1792 : ℝ) (by norm_num) (by norm_num) +theorem d4_23L : Real.log (17/12 : ℝ) + (-1 : ℤ) * Real.log (3/2) - (4 : ℤ) * FSTAR ≤ (61/6144 : ℝ) := + tangent_atom (17/12 : ℝ) (-1) (4) (61/6144 : ℝ) (by norm_num) (by norm_num) +theorem d4_233 : Real.log (5/4 : ℝ) + (-1 : ℤ) * Real.log (3/2) - (3 : ℤ) * FSTAR ≤ (101/4992 : ℝ) := + tangent_atom (5/4 : ℝ) (-1) (3) (101/4992 : ℝ) (by norm_num) (by norm_num) +theorem d4_234 : Real.log (59/48 : ℝ) + (-1 : ℤ) * Real.log (3/2) - (3 : ℤ) * FSTAR ≤ (209/19968 : ℝ) := + tangent_atom (59/48 : ℝ) (-1) (3) (209/19968 : ℝ) (by norm_num) (by norm_num) +theorem d4_235 : Real.log (73/60 : ℝ) + (-1 : ℤ) * Real.log (3/2) - (3 : ℤ) * FSTAR ≤ (49/4992 : ℝ) := + tangent_atom (73/60 : ℝ) (-1) (3) (49/4992 : ℝ) (by norm_num) (by norm_num) +theorem d4_24L : Real.log (67/48 : ℝ) + (-1 : ℤ) * Real.log (3/2) - (4 : ℤ) * FSTAR ≤ (1/6144 : ℝ) := + tangent_atom (67/48 : ℝ) (-1) (4) (1/6144 : ℝ) (by norm_num) (by norm_num) +theorem d4_244 : Real.log (29/24 : ℝ) + (-1 : ℤ) * Real.log (3/2) - (3 : ℤ) * FSTAR ≤ (7/9984 : ℝ) := + tangent_atom (29/24 : ℝ) (-1) (3) (7/9984 : ℝ) (by norm_num) (by norm_num) +theorem d4_245 : Real.log (287/240 : ℝ) + (-1 : ℤ) * Real.log (3/2) - (3 : ℤ) * FSTAR ≤ (1/19968 : ℝ) := + tangent_atom (287/240 : ℝ) (-1) (3) (1/19968 : ℝ) (by norm_num) (by norm_num) +theorem d4_25L : Real.log (83/60 : ℝ) + (-1 : ℤ) * Real.log (3/2) - (4 : ℤ) * FSTAR ≤ (-1/2048 : ℝ) := + tangent_atom (83/60 : ℝ) (-1) (4) (-1/2048 : ℝ) (by norm_num) (by norm_num) +theorem d4_255 : Real.log (71/60 : ℝ) + (-1 : ℤ) * Real.log (3/2) - (3 : ℤ) * FSTAR ≤ (-1/1664 : ℝ) := + tangent_atom (71/60 : ℝ) (-1) (3) (-1/1664 : ℝ) (by norm_num) (by norm_num) +theorem d4_3LL : Real.log (19/12 : ℝ) + (0 : ℤ) * Real.log (3/2) - (3 : ℤ) * FSTAR ≤ (23/2304 : ℝ) := + tangent_atom (19/12 : ℝ) (0) (3) (23/2304 : ℝ) (by norm_num) (by norm_num) +theorem d4_33L : Real.log (17/12 : ℝ) + (0 : ℤ) * Real.log (3/2) - (2 : ℤ) * FSTAR ≤ (13/640 : ℝ) := + tangent_atom (17/12 : ℝ) (0) (2) (13/640 : ℝ) (by norm_num) (by norm_num) +theorem d4_333 : Real.log (5/4 : ℝ) + (0 : ℤ) * Real.log (3/2) - (1 : ℤ) * FSTAR ≤ (47/1536 : ℝ) := + tangent_atom (5/4 : ℝ) (0) (1) (47/1536 : ℝ) (by norm_num) (by norm_num) +theorem d4_334 : Real.log (59/48 : ℝ) + (0 : ℤ) * Real.log (3/2) - (1 : ℤ) * FSTAR ≤ (1/48 : ℝ) := + tangent_atom (59/48 : ℝ) (0) (1) (1/48 : ℝ) (by norm_num) (by norm_num) +theorem d4_335 : Real.log (73/60 : ℝ) + (0 : ℤ) * Real.log (3/2) - (1 : ℤ) * FSTAR ≤ (31/1536 : ℝ) := + tangent_atom (73/60 : ℝ) (0) (1) (31/1536 : ℝ) (by norm_num) (by norm_num) +theorem d4_34L : Real.log (67/48 : ℝ) + (0 : ℤ) * Real.log (3/2) - (2 : ℤ) * FSTAR ≤ (27/2560 : ℝ) := + tangent_atom (67/48 : ℝ) (0) (2) (27/2560 : ℝ) (by norm_num) (by norm_num) +theorem d4_344 : Real.log (29/24 : ℝ) + (0 : ℤ) * Real.log (3/2) - (1 : ℤ) * FSTAR ≤ (17/1536 : ℝ) := + tangent_atom (29/24 : ℝ) (0) (1) (17/1536 : ℝ) (by norm_num) (by norm_num) +theorem d4_345 : Real.log (287/240 : ℝ) + (0 : ℤ) * Real.log (3/2) - (1 : ℤ) * FSTAR ≤ (1/96 : ℝ) := + tangent_atom (287/240 : ℝ) (0) (1) (1/96 : ℝ) (by norm_num) (by norm_num) +theorem d4_35L : Real.log (83/60 : ℝ) + (0 : ℤ) * Real.log (3/2) - (2 : ℤ) * FSTAR ≤ (19/1920 : ℝ) := + tangent_atom (83/60 : ℝ) (0) (2) (19/1920 : ℝ) (by norm_num) (by norm_num) +theorem d4_355 : Real.log (71/60 : ℝ) + (0 : ℤ) * Real.log (3/2) - (1 : ℤ) * FSTAR ≤ (5/512 : ℝ) := + tangent_atom (71/60 : ℝ) (0) (1) (5/512 : ℝ) (by norm_num) (by norm_num) +theorem d4_4LL : Real.log (25/16 : ℝ) + (0 : ℤ) * Real.log (3/2) - (3 : ℤ) * FSTAR ≤ (1/4608 : ℝ) := + tangent_atom (25/16 : ℝ) (0) (3) (1/4608 : ℝ) (by norm_num) (by norm_num) +theorem d4_44L : Real.log (11/8 : ℝ) + (0 : ℤ) * Real.log (3/2) - (2 : ℤ) * FSTAR ≤ (1/1280 : ℝ) := + tangent_atom (11/8 : ℝ) (0) (2) (1/1280 : ℝ) (by norm_num) (by norm_num) +theorem d4_444 : Real.log (19/16 : ℝ) + (0 : ℤ) * Real.log (3/2) - (1 : ℤ) * FSTAR ≤ (1/768 : ℝ) := + tangent_atom (19/16 : ℝ) (0) (1) (1/768 : ℝ) (by norm_num) (by norm_num) +theorem d4_445 : Real.log (47/40 : ℝ) + (0 : ℤ) * Real.log (3/2) - (1 : ℤ) * FSTAR ≤ (1/1536 : ℝ) := + tangent_atom (47/40 : ℝ) (0) (1) (1/1536 : ℝ) (by norm_num) (by norm_num) +theorem d4_45L : Real.log (109/80 : ℝ) + (0 : ℤ) * Real.log (3/2) - (2 : ℤ) * FSTAR ≤ (1/7680 : ℝ) := + tangent_atom (109/80 : ℝ) (0) (2) (1/7680 : ℝ) (by norm_num) (by norm_num) +theorem d4_455 : Real.log (93/80 : ℝ) + (0 : ℤ) * Real.log (3/2) - (1 : ℤ) * FSTAR ≤ (0 : ℝ) := + tangent_atom (93/80 : ℝ) (0) (1) (0 : ℝ) (by norm_num) (by norm_num) +theorem d4_5LL : Real.log (31/20 : ℝ) + (0 : ℤ) * Real.log (3/2) - (3 : ℤ) * FSTAR ≤ (-1/2304 : ℝ) := + tangent_atom (31/20 : ℝ) (0) (3) (-1/2304 : ℝ) (by norm_num) (by norm_num) +theorem d4_55L : Real.log (27/20 : ℝ) + (0 : ℤ) * Real.log (3/2) - (2 : ℤ) * FSTAR ≤ (-1/1920 : ℝ) := + tangent_atom (27/20 : ℝ) (0) (2) (-1/1920 : ℝ) (by norm_num) (by norm_num) +theorem d4_555 : Real.log (23/20 : ℝ) + (0 : ℤ) * Real.log (3/2) - (1 : ℤ) * FSTAR ≤ (-1/1536 : ℝ) := + tangent_atom (23/20 : ℝ) (0) (1) (-1/1536 : ℝ) (by norm_num) (by norm_num) + +end BGSCL +end R3Cert diff --git a/proof/formalization/R3Cert/BGSCLSubactionD4Cells.lean b/proof/formalization/R3Cert/BGSCLSubactionD4Cells.lean new file mode 100644 index 00000000..fff7183c --- /dev/null +++ b/proof/formalization/R3Cert/BGSCLSubactionD4Cells.lean @@ -0,0 +1,2212 @@ +/- + The 35 degree-4 hub `IsSubaction ρwit` node cells (2026-09-03). + + A degree-4 hub has 3 children; `ρwit(node) = bY(node)/384 = 1/(384·(4+S))`, `S = Σ bY(childᵢ)`. Every one + of the 35 child-degree profiles (multisets from {leaf, 2, 3, 4, ≥5}) closes with a SINGLE `log_tangent` at + its binding corner (no two-slope "drop-the-high-child" needed at d=4, unlike deg-3 cell (D)), reducing to + the single-log enclosure ATOM `d4_*` already proven in `BGSCLSubactionD4.lean`. This file is the mechanical + "wiring": per-child message bound + node-ρ bound + tangent + atom + `linarith`, mirroring the degree-3 cells + in `BGSCLSubactionDeg3Mid.lean`. The `log(3/2)` and `F*` opaque terms cancel exactly between each atom's + `(kL, kF)` folds and the per-child `ρwit` sum, so `linarith` closes each cell over the whole message box. + + Naming: `subaction_deg4_`, `X ≤ Y ≤ Z` the child classes in ascending bcc order + (L = leaf/bcc0, 2 = bcc1, 3 = bcc2, 4 = bcc3, H = deg≥5/bcc≥4). The atom `d4_*` for the same multiset uses + the D4.lean convention (digits ascending, leaf last). Kernel-checked, no `sorry`. `conjecture1_proved = False`. +-/ +import Mathlib +import R3Cert.BGSCLInduction +import R3Cert.BGSCLSubaction +import R3Cert.BGSCLSubactionD4 + +namespace R3Cert +namespace BGSCL + +open Real + +/-- Cell `LLL` (uses `d4_LLL`). -/ +theorem subaction_deg4_LLL (c1 c2 c3 : Branch) + (h1 : bcc c1 = 0) (h2 : bcc c2 = 0) (h3 : bcc c3 = 0) : + (Real.log (1 + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2, c3]) ≤ (([c1, c2, c3]).map ρwit).sum := by + have hy1_0 := bY_nonneg c1 + have hy2_0 := bY_nonneg c2 + have hy3_0 := bY_nonneg c3 + have hy1e : bY c1 = 1 := by + have hc1 : c1 = Branch.node [] := by + cases c1 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h1; omega + rw [hc1, bY_leaf] + have hy2e : bY c2 = 1 := by + have hc2 : c2 = Branch.node [] := by + cases c2 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h2; omega + rw [hc2, bY_leaf] + have hy3e : bY c3 = 1 := by + have hc3 : c3 = Branch.node [] := by + cases c3 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h3; omega + rw [hc3, bY_leaf] + set S := bY c1 + bY c2 + bY c3 with hS + have hS0 : (0:ℝ) ≤ S := by rw [hS]; linarith + have hSmin : (3:ℝ) ≤ S := by rw [hS]; linarith + have hden : (0:ℝ) < 4 + S := by linarith + have htan := log_tangent (d := (4:ℝ)) (s := S) (s0 := (3:ℝ)) (by norm_num) hS0 (by norm_num) + rw [show (1:ℝ) + (3:ℝ)/4 = (7/4:ℝ) by norm_num, show (4:ℝ) + (3:ℝ) = (7:ℝ) by norm_num] at htan + have hbYnode : bY (Branch.node [c1, c2, c3]) = 1 / (4 + S) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hbcc_node : bcc (Branch.node [c1, c2, c3]) = 3 := by simp [bcc] + have hrnode : ρwit (Branch.node [c1, c2, c3]) = (1/384) * (1 / (4 + S)) := by + rw [ρwit, hbcc_node, hbYnode]; norm_num + have hrnode_le : ρwit (Branch.node [c1, c2, c3]) ≤ (1/2688:ℝ) := by + rw [hrnode] + have hinv : 1 / (4 + S) ≤ (1/7:ℝ) := by + have h := one_div_le_one_div_of_le (show (0:ℝ) < (7:ℝ) by norm_num) + (show (7:ℝ) ≤ 4 + S by linarith) + rwa [show (1:ℝ)/(7:ℝ) = (1/7:ℝ) by norm_num] at h + have hinv_nn : (0:ℝ) ≤ 1 / (4 + S) := by positivity + nlinarith [hinv, hinv_nn] + have henc := d4_LLL + have hrc1 : ρwit c1 = FSTAR := by + have hcr1 : c1 = Branch.node [] := by + cases c1 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h1; omega + rw [hcr1, ρwit_leaf] + have hrc2 : ρwit c2 = FSTAR := by + have hcr2 : c2 = Branch.node [] := by + cases c2 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h2; omega + rw [hcr2, ρwit_leaf] + have hrc3 : ρwit c3 = FSTAR := by + have hcr3 : c3 = Branch.node [] := by + cases c3 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h3; omega + rw [hcr3, ρwit_leaf] + have hlogarg : (1:ℝ) + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1) = 1 + S / 4 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hrhs : (([c1, c2, c3]).map ρwit).sum = ρwit c1 + ρwit c2 + ρwit c3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, add_zero] + ring + rw [hlogarg, hrhs, hrc1, hrc2, hrc3] + linarith [htan, hrnode_le, henc, hy1e, hy2e, hy3e, hS] + +/-- Cell `LL2` (uses `d4_2LL`). -/ +theorem subaction_deg4_LL2 (c1 c2 c3 : Branch) + (h1 : bcc c1 = 0) (h2 : bcc c2 = 0) (h3 : bcc c3 = 1) : + (Real.log (1 + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2, c3]) ≤ (([c1, c2, c3]).map ρwit).sum := by + have hy1_0 := bY_nonneg c1 + have hy2_0 := bY_nonneg c2 + have hy3_0 := bY_nonneg c3 + have hy1e : bY c1 = 1 := by + have hc1 : c1 = Branch.node [] := by + cases c1 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h1; omega + rw [hc1, bY_leaf] + have hy2e : bY c2 = 1 := by + have hc2 : c2 = Branch.node [] := by + cases c2 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h2; omega + rw [hc2, bY_leaf] + have hy3_lo : (1:ℝ)/3 ≤ bY c3 := bY_ge_third_of_bcc1 c3 h3 + have hy3_hi : bY c3 ≤ 1/2 := by + have h := bY_le_inv_deg c3; rw [h3] at h; norm_num at h; linarith + set S := bY c1 + bY c2 + bY c3 with hS + have hS0 : (0:ℝ) ≤ S := by rw [hS]; linarith + have hSmin : (7/3:ℝ) ≤ S := by rw [hS]; linarith + have hden : (0:ℝ) < 4 + S := by linarith + have htan := log_tangent (d := (4:ℝ)) (s := S) (s0 := (7/3:ℝ)) (by norm_num) hS0 (by norm_num) + rw [show (1:ℝ) + (7/3:ℝ)/4 = (19/12:ℝ) by norm_num, show (4:ℝ) + (7/3:ℝ) = (19/3:ℝ) by norm_num] at htan + have hbYnode : bY (Branch.node [c1, c2, c3]) = 1 / (4 + S) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hbcc_node : bcc (Branch.node [c1, c2, c3]) = 3 := by simp [bcc] + have hrnode : ρwit (Branch.node [c1, c2, c3]) = (1/384) * (1 / (4 + S)) := by + rw [ρwit, hbcc_node, hbYnode]; norm_num + have hrnode_le : ρwit (Branch.node [c1, c2, c3]) ≤ (1/2432:ℝ) := by + rw [hrnode] + have hinv : 1 / (4 + S) ≤ (3/19:ℝ) := by + have h := one_div_le_one_div_of_le (show (0:ℝ) < (19/3:ℝ) by norm_num) + (show (19/3:ℝ) ≤ 4 + S by linarith) + rwa [show (1:ℝ)/(19/3:ℝ) = (3/19:ℝ) by norm_num] at h + have hinv_nn : (0:ℝ) ≤ 1 / (4 + S) := by positivity + nlinarith [hinv, hinv_nn] + -- correctly-signed atom (kL=+1); the `d4_2LL` in D4.lean has kL=-1 (loose, wrong sign to combine) + have henc : Real.log (19/12:ℝ) + (1 : ℤ) * Real.log (3/2) - (5 : ℤ) * FSTAR ≤ (-1/2432:ℝ) := + tangent_atom (19/12:ℝ) (1) (5) (-1/2432:ℝ) (by norm_num) (by norm_num) + have hrc1 : ρwit c1 = FSTAR := by + have hcr1 : c1 = Branch.node [] := by + cases c1 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h1; omega + rw [hcr1, ρwit_leaf] + have hrc2 : ρwit c2 = FSTAR := by + have hcr2 : c2 = Branch.node [] := by + cases c2 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h2; omega + rw [hcr2, ρwit_leaf] + have hrc3 : ρwit c3 = 2 * FSTAR - Real.log (3/2) + (1/4) * (bY c3 - 1/3) := by + simp only [ρwit, h3] + have hlogarg : (1:ℝ) + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1) = 1 + S / 4 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hrhs : (([c1, c2, c3]).map ρwit).sum = ρwit c1 + ρwit c2 + ρwit c3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, add_zero] + ring + rw [hlogarg, hrhs, hrc1, hrc2, hrc3] + linarith [htan, hrnode_le, henc, hy1e, hy2e, hS] + +/-- Cell `LL3` (uses `d4_3LL`). -/ +theorem subaction_deg4_LL3 (c1 c2 c3 : Branch) + (h1 : bcc c1 = 0) (h2 : bcc c2 = 0) (h3 : bcc c3 = 2) : + (Real.log (1 + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2, c3]) ≤ (([c1, c2, c3]).map ρwit).sum := by + have hy1_0 := bY_nonneg c1 + have hy2_0 := bY_nonneg c2 + have hy3_0 := bY_nonneg c3 + have hy1e : bY c1 = 1 := by + have hc1 : c1 = Branch.node [] := by + cases c1 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h1; omega + rw [hc1, bY_leaf] + have hy2e : bY c2 = 1 := by + have hc2 : c2 = Branch.node [] := by + cases c2 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h2; omega + rw [hc2, bY_leaf] + have hy3_hi : bY c3 ≤ (1/3:ℝ) := by + have h := bY_le_inv_deg c3; rw [h3] at h; norm_num at h; linarith + set S := bY c1 + bY c2 + bY c3 with hS + have hS0 : (0:ℝ) ≤ S := by rw [hS]; linarith + have hSmin : (2:ℝ) ≤ S := by rw [hS]; linarith + have hden : (0:ℝ) < 4 + S := by linarith + have htan := log_tangent (d := (4:ℝ)) (s := S) (s0 := (7/3:ℝ)) (by norm_num) hS0 (by norm_num) + rw [show (1:ℝ) + (7/3:ℝ)/4 = (19/12:ℝ) by norm_num, show (4:ℝ) + (7/3:ℝ) = (19/3:ℝ) by norm_num] at htan + have hbYnode : bY (Branch.node [c1, c2, c3]) = 1 / (4 + S) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hbcc_node : bcc (Branch.node [c1, c2, c3]) = 3 := by simp [bcc] + have hrnode : ρwit (Branch.node [c1, c2, c3]) = (1/384) * (1 / (4 + S)) := by + rw [ρwit, hbcc_node, hbYnode]; norm_num + have hrnode_le : ρwit (Branch.node [c1, c2, c3]) ≤ (1/2304:ℝ) := by + rw [hrnode] + have hinv : 1 / (4 + S) ≤ (1/6:ℝ) := by + have h := one_div_le_one_div_of_le (show (0:ℝ) < (6:ℝ) by norm_num) + (show (6:ℝ) ≤ 4 + S by linarith) + rwa [show (1:ℝ)/(6:ℝ) = (1/6:ℝ) by norm_num] at h + have hinv_nn : (0:ℝ) ≤ 1 / (4 + S) := by positivity + nlinarith [hinv, hinv_nn] + have henc := d4_3LL + have hrc1 : ρwit c1 = FSTAR := by + have hcr1 : c1 = Branch.node [] := by + cases c1 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h1; omega + rw [hcr1, ρwit_leaf] + have hrc2 : ρwit c2 = FSTAR := by + have hcr2 : c2 = Branch.node [] := by + cases c2 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h2; omega + rw [hcr2, ρwit_leaf] + have hrc3 : ρwit c3 = (1/32) * bY c3 := by simp only [ρwit, h3] + have hlogarg : (1:ℝ) + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1) = 1 + S / 4 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hrhs : (([c1, c2, c3]).map ρwit).sum = ρwit c1 + ρwit c2 + ρwit c3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, add_zero] + ring + rw [hlogarg, hrhs, hrc1, hrc2, hrc3] + linarith [htan, hrnode_le, henc, hy1e, hy2e, hS] + +/-- Cell `LL4` (uses `d4_4LL`). -/ +theorem subaction_deg4_LL4 (c1 c2 c3 : Branch) + (h1 : bcc c1 = 0) (h2 : bcc c2 = 0) (h3 : bcc c3 = 3) : + (Real.log (1 + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2, c3]) ≤ (([c1, c2, c3]).map ρwit).sum := by + have hy1_0 := bY_nonneg c1 + have hy2_0 := bY_nonneg c2 + have hy3_0 := bY_nonneg c3 + have hy1e : bY c1 = 1 := by + have hc1 : c1 = Branch.node [] := by + cases c1 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h1; omega + rw [hc1, bY_leaf] + have hy2e : bY c2 = 1 := by + have hc2 : c2 = Branch.node [] := by + cases c2 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h2; omega + rw [hc2, bY_leaf] + have hy3_hi : bY c3 ≤ (1/4:ℝ) := by + have h := bY_le_inv_deg c3; rw [h3] at h; norm_num at h; linarith + set S := bY c1 + bY c2 + bY c3 with hS + have hS0 : (0:ℝ) ≤ S := by rw [hS]; linarith + have hSmin : (2:ℝ) ≤ S := by rw [hS]; linarith + have hden : (0:ℝ) < 4 + S := by linarith + have htan := log_tangent (d := (4:ℝ)) (s := S) (s0 := (9/4:ℝ)) (by norm_num) hS0 (by norm_num) + rw [show (1:ℝ) + (9/4:ℝ)/4 = (25/16:ℝ) by norm_num, show (4:ℝ) + (9/4:ℝ) = (25/4:ℝ) by norm_num] at htan + have hbYnode : bY (Branch.node [c1, c2, c3]) = 1 / (4 + S) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hbcc_node : bcc (Branch.node [c1, c2, c3]) = 3 := by simp [bcc] + have hrnode : ρwit (Branch.node [c1, c2, c3]) = (1/384) * (1 / (4 + S)) := by + rw [ρwit, hbcc_node, hbYnode]; norm_num + have hrnode_le : ρwit (Branch.node [c1, c2, c3]) ≤ (1/2304:ℝ) := by + rw [hrnode] + have hinv : 1 / (4 + S) ≤ (1/6:ℝ) := by + have h := one_div_le_one_div_of_le (show (0:ℝ) < (6:ℝ) by norm_num) + (show (6:ℝ) ≤ 4 + S by linarith) + rwa [show (1:ℝ)/(6:ℝ) = (1/6:ℝ) by norm_num] at h + have hinv_nn : (0:ℝ) ≤ 1 / (4 + S) := by positivity + nlinarith [hinv, hinv_nn] + have henc := d4_4LL + have hrc1 : ρwit c1 = FSTAR := by + have hcr1 : c1 = Branch.node [] := by + cases c1 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h1; omega + rw [hcr1, ρwit_leaf] + have hrc2 : ρwit c2 = FSTAR := by + have hcr2 : c2 = Branch.node [] := by + cases c2 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h2; omega + rw [hcr2, ρwit_leaf] + have hrc3 : ρwit c3 = (1/384) * bY c3 := by simp only [ρwit, h3] + have hlogarg : (1:ℝ) + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1) = 1 + S / 4 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hrhs : (([c1, c2, c3]).map ρwit).sum = ρwit c1 + ρwit c2 + ρwit c3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, add_zero] + ring + rw [hlogarg, hrhs, hrc1, hrc2, hrc3] + linarith [htan, hrnode_le, henc, hy1e, hy2e, hS] + +/-- Cell `LLH` (uses `d4_5LL`). -/ +theorem subaction_deg4_LLH (c1 c2 c3 : Branch) + (h1 : bcc c1 = 0) (h2 : bcc c2 = 0) (h3 : 4 ≤ bcc c3) : + (Real.log (1 + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2, c3]) ≤ (([c1, c2, c3]).map ρwit).sum := by + have hy1_0 := bY_nonneg c1 + have hy2_0 := bY_nonneg c2 + have hy3_0 := bY_nonneg c3 + have hy1e : bY c1 = 1 := by + have hc1 : c1 = Branch.node [] := by + cases c1 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h1; omega + rw [hc1, bY_leaf] + have hy2e : bY c2 = 1 := by + have hc2 : c2 = Branch.node [] := by + cases c2 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h2; omega + rw [hc2, bY_leaf] + have hy3_hi : bY c3 ≤ (1/5:ℝ) := by + have hbi := bY_le_inv_deg c3 + have hcast : (4:ℝ) ≤ (bcc c3 : ℝ) := by exact_mod_cast h3 + have hb2 : (1:ℝ) / ((bcc c3 : ℝ) + 1) ≤ 1/5 := one_div_le_one_div_of_le (by norm_num) (by linarith) + linarith + set S := bY c1 + bY c2 + bY c3 with hS + have hS0 : (0:ℝ) ≤ S := by rw [hS]; linarith + have hSmin : (2:ℝ) ≤ S := by rw [hS]; linarith + have hden : (0:ℝ) < 4 + S := by linarith + have htan := log_tangent (d := (4:ℝ)) (s := S) (s0 := (11/5:ℝ)) (by norm_num) hS0 (by norm_num) + rw [show (1:ℝ) + (11/5:ℝ)/4 = (31/20:ℝ) by norm_num, show (4:ℝ) + (11/5:ℝ) = (31/5:ℝ) by norm_num] at htan + have hbYnode : bY (Branch.node [c1, c2, c3]) = 1 / (4 + S) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hbcc_node : bcc (Branch.node [c1, c2, c3]) = 3 := by simp [bcc] + have hrnode : ρwit (Branch.node [c1, c2, c3]) = (1/384) * (1 / (4 + S)) := by + rw [ρwit, hbcc_node, hbYnode]; norm_num + have hrnode_le : ρwit (Branch.node [c1, c2, c3]) ≤ (1/2304:ℝ) := by + rw [hrnode] + have hinv : 1 / (4 + S) ≤ (1/6:ℝ) := by + have h := one_div_le_one_div_of_le (show (0:ℝ) < (6:ℝ) by norm_num) + (show (6:ℝ) ≤ 4 + S by linarith) + rwa [show (1:ℝ)/(6:ℝ) = (1/6:ℝ) by norm_num] at h + have hinv_nn : (0:ℝ) ≤ 1 / (4 + S) := by positivity + nlinarith [hinv, hinv_nn] + have henc := d4_5LL + have hrc1 : ρwit c1 = FSTAR := by + have hcr1 : c1 = Branch.node [] := by + cases c1 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h1; omega + rw [hcr1, ρwit_leaf] + have hrc2 : ρwit c2 = FSTAR := by + have hcr2 : c2 = Branch.node [] := by + cases c2 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h2; omega + rw [hcr2, ρwit_leaf] + have hrc3_nn : 0 ≤ ρwit c3 := ρwit_nonneg c3 + have hlogarg : (1:ℝ) + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1) = 1 + S / 4 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hrhs : (([c1, c2, c3]).map ρwit).sum = ρwit c1 + ρwit c2 + ρwit c3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, add_zero] + ring + rw [hlogarg, hrhs, hrc1, hrc2] + linarith [htan, hrnode_le, henc, hy1e, hy2e, hrc3_nn, hy3_hi, hS] + +/-- Cell `L22` (uses `d4_22L`). -/ +theorem subaction_deg4_L22 (c1 c2 c3 : Branch) + (h1 : bcc c1 = 0) (h2 : bcc c2 = 1) (h3 : bcc c3 = 1) : + (Real.log (1 + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2, c3]) ≤ (([c1, c2, c3]).map ρwit).sum := by + have hy1_0 := bY_nonneg c1 + have hy2_0 := bY_nonneg c2 + have hy3_0 := bY_nonneg c3 + have hy1e : bY c1 = 1 := by + have hc1 : c1 = Branch.node [] := by + cases c1 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h1; omega + rw [hc1, bY_leaf] + have hy2_lo : (1:ℝ)/3 ≤ bY c2 := bY_ge_third_of_bcc1 c2 h2 + have hy2_hi : bY c2 ≤ 1/2 := by + have h := bY_le_inv_deg c2; rw [h2] at h; norm_num at h; linarith + have hy3_lo : (1:ℝ)/3 ≤ bY c3 := bY_ge_third_of_bcc1 c3 h3 + have hy3_hi : bY c3 ≤ 1/2 := by + have h := bY_le_inv_deg c3; rw [h3] at h; norm_num at h; linarith + set S := bY c1 + bY c2 + bY c3 with hS + have hS0 : (0:ℝ) ≤ S := by rw [hS]; linarith + have hSmin : (5/3:ℝ) ≤ S := by rw [hS]; linarith + have hden : (0:ℝ) < 4 + S := by linarith + have htan := log_tangent (d := (4:ℝ)) (s := S) (s0 := (5/3:ℝ)) (by norm_num) hS0 (by norm_num) + rw [show (1:ℝ) + (5/3:ℝ)/4 = (17/12:ℝ) by norm_num, show (4:ℝ) + (5/3:ℝ) = (17/3:ℝ) by norm_num] at htan + have hbYnode : bY (Branch.node [c1, c2, c3]) = 1 / (4 + S) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hbcc_node : bcc (Branch.node [c1, c2, c3]) = 3 := by simp [bcc] + have hrnode : ρwit (Branch.node [c1, c2, c3]) = (1/384) * (1 / (4 + S)) := by + rw [ρwit, hbcc_node, hbYnode]; norm_num + have hrnode_le : ρwit (Branch.node [c1, c2, c3]) ≤ (1/2176:ℝ) := by + rw [hrnode] + have hinv : 1 / (4 + S) ≤ (3/17:ℝ) := by + have h := one_div_le_one_div_of_le (show (0:ℝ) < (17/3:ℝ) by norm_num) + (show (17/3:ℝ) ≤ 4 + S by linarith) + rwa [show (1:ℝ)/(17/3:ℝ) = (3/17:ℝ) by norm_num] at h + have hinv_nn : (0:ℝ) ≤ 1 / (4 + S) := by positivity + nlinarith [hinv, hinv_nn] + -- correctly-signed atom (kL=+2); the `d4_22L` in D4.lean has kL=-2 (loose, wrong sign to combine) + have henc : Real.log (17/12:ℝ) + (2 : ℤ) * Real.log (3/2) - (6 : ℤ) * FSTAR ≤ (-1/2176:ℝ) := + tangent_atom (17/12:ℝ) (2) (6) (-1/2176:ℝ) (by norm_num) (by norm_num) + have hrc1 : ρwit c1 = FSTAR := by + have hcr1 : c1 = Branch.node [] := by + cases c1 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h1; omega + rw [hcr1, ρwit_leaf] + have hrc2 : ρwit c2 = 2 * FSTAR - Real.log (3/2) + (1/4) * (bY c2 - 1/3) := by + simp only [ρwit, h2] + have hrc3 : ρwit c3 = 2 * FSTAR - Real.log (3/2) + (1/4) * (bY c3 - 1/3) := by + simp only [ρwit, h3] + have hlogarg : (1:ℝ) + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1) = 1 + S / 4 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hrhs : (([c1, c2, c3]).map ρwit).sum = ρwit c1 + ρwit c2 + ρwit c3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, add_zero] + ring + rw [hlogarg, hrhs, hrc1, hrc2, hrc3] + linarith [htan, hrnode_le, henc, hy1e, hS] + +/-- Cell `L23` (uses `d4_23L`). -/ +theorem subaction_deg4_L23 (c1 c2 c3 : Branch) + (h1 : bcc c1 = 0) (h2 : bcc c2 = 1) (h3 : bcc c3 = 2) : + (Real.log (1 + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2, c3]) ≤ (([c1, c2, c3]).map ρwit).sum := by + have hy1_0 := bY_nonneg c1 + have hy2_0 := bY_nonneg c2 + have hy3_0 := bY_nonneg c3 + have hy1e : bY c1 = 1 := by + have hc1 : c1 = Branch.node [] := by + cases c1 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h1; omega + rw [hc1, bY_leaf] + have hy2_lo : (1:ℝ)/3 ≤ bY c2 := bY_ge_third_of_bcc1 c2 h2 + have hy2_hi : bY c2 ≤ 1/2 := by + have h := bY_le_inv_deg c2; rw [h2] at h; norm_num at h; linarith + have hy3_hi : bY c3 ≤ (1/3:ℝ) := by + have h := bY_le_inv_deg c3; rw [h3] at h; norm_num at h; linarith + set S := bY c1 + bY c2 + bY c3 with hS + have hS0 : (0:ℝ) ≤ S := by rw [hS]; linarith + have hSmin : (4/3:ℝ) ≤ S := by rw [hS]; linarith + have hden : (0:ℝ) < 4 + S := by linarith + have htan := log_tangent (d := (4:ℝ)) (s := S) (s0 := (5/3:ℝ)) (by norm_num) hS0 (by norm_num) + rw [show (1:ℝ) + (5/3:ℝ)/4 = (17/12:ℝ) by norm_num, show (4:ℝ) + (5/3:ℝ) = (17/3:ℝ) by norm_num] at htan + have hbYnode : bY (Branch.node [c1, c2, c3]) = 1 / (4 + S) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hbcc_node : bcc (Branch.node [c1, c2, c3]) = 3 := by simp [bcc] + have hrnode : ρwit (Branch.node [c1, c2, c3]) = (1/384) * (1 / (4 + S)) := by + rw [ρwit, hbcc_node, hbYnode]; norm_num + have hrnode_le : ρwit (Branch.node [c1, c2, c3]) ≤ (1/2048:ℝ) := by + rw [hrnode] + have hinv : 1 / (4 + S) ≤ (3/16:ℝ) := by + have h := one_div_le_one_div_of_le (show (0:ℝ) < (16/3:ℝ) by norm_num) + (show (16/3:ℝ) ≤ 4 + S by linarith) + rwa [show (1:ℝ)/(16/3:ℝ) = (3/16:ℝ) by norm_num] at h + have hinv_nn : (0:ℝ) ≤ 1 / (4 + S) := by positivity + nlinarith [hinv, hinv_nn] + -- correctly-signed atom (kL=+1); the `d4_23L` in D4.lean has kL=-1 (loose, wrong sign to combine) + have henc : Real.log (17/12:ℝ) + (1 : ℤ) * Real.log (3/2) - (4 : ℤ) * FSTAR ≤ (61/6144:ℝ) := + tangent_atom (17/12:ℝ) (1) (4) (61/6144:ℝ) (by norm_num) (by norm_num) + have hrc1 : ρwit c1 = FSTAR := by + have hcr1 : c1 = Branch.node [] := by + cases c1 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h1; omega + rw [hcr1, ρwit_leaf] + have hrc2 : ρwit c2 = 2 * FSTAR - Real.log (3/2) + (1/4) * (bY c2 - 1/3) := by + simp only [ρwit, h2] + have hrc3 : ρwit c3 = (1/32) * bY c3 := by simp only [ρwit, h3] + have hlogarg : (1:ℝ) + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1) = 1 + S / 4 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hrhs : (([c1, c2, c3]).map ρwit).sum = ρwit c1 + ρwit c2 + ρwit c3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, add_zero] + ring + rw [hlogarg, hrhs, hrc1, hrc2, hrc3] + linarith [htan, hrnode_le, henc, hy1e, hS] + +/-- Cell `L24` (uses `d4_24L`). -/ +theorem subaction_deg4_L24 (c1 c2 c3 : Branch) + (h1 : bcc c1 = 0) (h2 : bcc c2 = 1) (h3 : bcc c3 = 3) : + (Real.log (1 + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2, c3]) ≤ (([c1, c2, c3]).map ρwit).sum := by + have hy1_0 := bY_nonneg c1 + have hy2_0 := bY_nonneg c2 + have hy3_0 := bY_nonneg c3 + have hy1e : bY c1 = 1 := by + have hc1 : c1 = Branch.node [] := by + cases c1 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h1; omega + rw [hc1, bY_leaf] + have hy2_lo : (1:ℝ)/3 ≤ bY c2 := bY_ge_third_of_bcc1 c2 h2 + have hy2_hi : bY c2 ≤ 1/2 := by + have h := bY_le_inv_deg c2; rw [h2] at h; norm_num at h; linarith + have hy3_hi : bY c3 ≤ (1/4:ℝ) := by + have h := bY_le_inv_deg c3; rw [h3] at h; norm_num at h; linarith + set S := bY c1 + bY c2 + bY c3 with hS + have hS0 : (0:ℝ) ≤ S := by rw [hS]; linarith + have hSmin : (4/3:ℝ) ≤ S := by rw [hS]; linarith + have hden : (0:ℝ) < 4 + S := by linarith + have htan := log_tangent (d := (4:ℝ)) (s := S) (s0 := (19/12:ℝ)) (by norm_num) hS0 (by norm_num) + rw [show (1:ℝ) + (19/12:ℝ)/4 = (67/48:ℝ) by norm_num, show (4:ℝ) + (19/12:ℝ) = (67/12:ℝ) by norm_num] at htan + have hbYnode : bY (Branch.node [c1, c2, c3]) = 1 / (4 + S) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hbcc_node : bcc (Branch.node [c1, c2, c3]) = 3 := by simp [bcc] + have hrnode : ρwit (Branch.node [c1, c2, c3]) = (1/384) * (1 / (4 + S)) := by + rw [ρwit, hbcc_node, hbYnode]; norm_num + have hrnode_le : ρwit (Branch.node [c1, c2, c3]) ≤ (1/2048:ℝ) := by + rw [hrnode] + have hinv : 1 / (4 + S) ≤ (3/16:ℝ) := by + have h := one_div_le_one_div_of_le (show (0:ℝ) < (16/3:ℝ) by norm_num) + (show (16/3:ℝ) ≤ 4 + S by linarith) + rwa [show (1:ℝ)/(16/3:ℝ) = (3/16:ℝ) by norm_num] at h + have hinv_nn : (0:ℝ) ≤ 1 / (4 + S) := by positivity + nlinarith [hinv, hinv_nn] + -- correctly-signed atom (kL=+1); the `d4_24L` in D4.lean has kL=-1 (loose, wrong sign to combine) + have henc : Real.log (67/48:ℝ) + (1 : ℤ) * Real.log (3/2) - (4 : ℤ) * FSTAR ≤ (1/6144:ℝ) := + tangent_atom (67/48:ℝ) (1) (4) (1/6144:ℝ) (by norm_num) (by norm_num) + have hrc1 : ρwit c1 = FSTAR := by + have hcr1 : c1 = Branch.node [] := by + cases c1 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h1; omega + rw [hcr1, ρwit_leaf] + have hrc2 : ρwit c2 = 2 * FSTAR - Real.log (3/2) + (1/4) * (bY c2 - 1/3) := by + simp only [ρwit, h2] + have hrc3 : ρwit c3 = (1/384) * bY c3 := by simp only [ρwit, h3] + have hlogarg : (1:ℝ) + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1) = 1 + S / 4 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hrhs : (([c1, c2, c3]).map ρwit).sum = ρwit c1 + ρwit c2 + ρwit c3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, add_zero] + ring + rw [hlogarg, hrhs, hrc1, hrc2, hrc3] + linarith [htan, hrnode_le, henc, hy1e, hS] + +/-- Cell `L2H` (uses `d4_25L`). -/ +theorem subaction_deg4_L2H (c1 c2 c3 : Branch) + (h1 : bcc c1 = 0) (h2 : bcc c2 = 1) (h3 : 4 ≤ bcc c3) : + (Real.log (1 + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2, c3]) ≤ (([c1, c2, c3]).map ρwit).sum := by + have hy1_0 := bY_nonneg c1 + have hy2_0 := bY_nonneg c2 + have hy3_0 := bY_nonneg c3 + have hy1e : bY c1 = 1 := by + have hc1 : c1 = Branch.node [] := by + cases c1 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h1; omega + rw [hc1, bY_leaf] + have hy2_lo : (1:ℝ)/3 ≤ bY c2 := bY_ge_third_of_bcc1 c2 h2 + have hy2_hi : bY c2 ≤ 1/2 := by + have h := bY_le_inv_deg c2; rw [h2] at h; norm_num at h; linarith + have hy3_hi : bY c3 ≤ (1/5:ℝ) := by + have hbi := bY_le_inv_deg c3 + have hcast : (4:ℝ) ≤ (bcc c3 : ℝ) := by exact_mod_cast h3 + have hb2 : (1:ℝ) / ((bcc c3 : ℝ) + 1) ≤ 1/5 := one_div_le_one_div_of_le (by norm_num) (by linarith) + linarith + set S := bY c1 + bY c2 + bY c3 with hS + have hS0 : (0:ℝ) ≤ S := by rw [hS]; linarith + have hSmin : (4/3:ℝ) ≤ S := by rw [hS]; linarith + have hden : (0:ℝ) < 4 + S := by linarith + have htan := log_tangent (d := (4:ℝ)) (s := S) (s0 := (23/15:ℝ)) (by norm_num) hS0 (by norm_num) + rw [show (1:ℝ) + (23/15:ℝ)/4 = (83/60:ℝ) by norm_num, show (4:ℝ) + (23/15:ℝ) = (83/15:ℝ) by norm_num] at htan + have hbYnode : bY (Branch.node [c1, c2, c3]) = 1 / (4 + S) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hbcc_node : bcc (Branch.node [c1, c2, c3]) = 3 := by simp [bcc] + have hrnode : ρwit (Branch.node [c1, c2, c3]) = (1/384) * (1 / (4 + S)) := by + rw [ρwit, hbcc_node, hbYnode]; norm_num + have hrnode_le : ρwit (Branch.node [c1, c2, c3]) ≤ (1/2048:ℝ) := by + rw [hrnode] + have hinv : 1 / (4 + S) ≤ (3/16:ℝ) := by + have h := one_div_le_one_div_of_le (show (0:ℝ) < (16/3:ℝ) by norm_num) + (show (16/3:ℝ) ≤ 4 + S by linarith) + rwa [show (1:ℝ)/(16/3:ℝ) = (3/16:ℝ) by norm_num] at h + have hinv_nn : (0:ℝ) ≤ 1 / (4 + S) := by positivity + nlinarith [hinv, hinv_nn] + -- correctly-signed atom (kL=+1); the `d4_25L` in D4.lean has kL=-1 (loose, wrong sign to combine) + have henc : Real.log (83/60:ℝ) + (1 : ℤ) * Real.log (3/2) - (4 : ℤ) * FSTAR ≤ (-1/2048:ℝ) := + tangent_atom (83/60:ℝ) (1) (4) (-1/2048:ℝ) (by norm_num) (by norm_num) + have hrc1 : ρwit c1 = FSTAR := by + have hcr1 : c1 = Branch.node [] := by + cases c1 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h1; omega + rw [hcr1, ρwit_leaf] + have hrc2 : ρwit c2 = 2 * FSTAR - Real.log (3/2) + (1/4) * (bY c2 - 1/3) := by + simp only [ρwit, h2] + have hrc3_nn : 0 ≤ ρwit c3 := ρwit_nonneg c3 + have hlogarg : (1:ℝ) + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1) = 1 + S / 4 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hrhs : (([c1, c2, c3]).map ρwit).sum = ρwit c1 + ρwit c2 + ρwit c3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, add_zero] + ring + rw [hlogarg, hrhs, hrc1, hrc2] + linarith [htan, hrnode_le, henc, hy1e, hrc3_nn, hy3_hi, hS] + +/-- Cell `L33` (uses `d4_33L`). -/ +theorem subaction_deg4_L33 (c1 c2 c3 : Branch) + (h1 : bcc c1 = 0) (h2 : bcc c2 = 2) (h3 : bcc c3 = 2) : + (Real.log (1 + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2, c3]) ≤ (([c1, c2, c3]).map ρwit).sum := by + have hy1_0 := bY_nonneg c1 + have hy2_0 := bY_nonneg c2 + have hy3_0 := bY_nonneg c3 + have hy1e : bY c1 = 1 := by + have hc1 : c1 = Branch.node [] := by + cases c1 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h1; omega + rw [hc1, bY_leaf] + have hy2_hi : bY c2 ≤ (1/3:ℝ) := by + have h := bY_le_inv_deg c2; rw [h2] at h; norm_num at h; linarith + have hy3_hi : bY c3 ≤ (1/3:ℝ) := by + have h := bY_le_inv_deg c3; rw [h3] at h; norm_num at h; linarith + set S := bY c1 + bY c2 + bY c3 with hS + have hS0 : (0:ℝ) ≤ S := by rw [hS]; linarith + have hSmin : (1:ℝ) ≤ S := by rw [hS]; linarith + have hden : (0:ℝ) < 4 + S := by linarith + have htan := log_tangent (d := (4:ℝ)) (s := S) (s0 := (5/3:ℝ)) (by norm_num) hS0 (by norm_num) + rw [show (1:ℝ) + (5/3:ℝ)/4 = (17/12:ℝ) by norm_num, show (4:ℝ) + (5/3:ℝ) = (17/3:ℝ) by norm_num] at htan + have hbYnode : bY (Branch.node [c1, c2, c3]) = 1 / (4 + S) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hbcc_node : bcc (Branch.node [c1, c2, c3]) = 3 := by simp [bcc] + have hrnode : ρwit (Branch.node [c1, c2, c3]) = (1/384) * (1 / (4 + S)) := by + rw [ρwit, hbcc_node, hbYnode]; norm_num + have hrnode_le : ρwit (Branch.node [c1, c2, c3]) ≤ (1/1920:ℝ) := by + rw [hrnode] + have hinv : 1 / (4 + S) ≤ (1/5:ℝ) := by + have h := one_div_le_one_div_of_le (show (0:ℝ) < (5:ℝ) by norm_num) + (show (5:ℝ) ≤ 4 + S by linarith) + rwa [show (1:ℝ)/(5:ℝ) = (1/5:ℝ) by norm_num] at h + have hinv_nn : (0:ℝ) ≤ 1 / (4 + S) := by positivity + nlinarith [hinv, hinv_nn] + have henc := d4_33L + have hrc1 : ρwit c1 = FSTAR := by + have hcr1 : c1 = Branch.node [] := by + cases c1 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h1; omega + rw [hcr1, ρwit_leaf] + have hrc2 : ρwit c2 = (1/32) * bY c2 := by simp only [ρwit, h2] + have hrc3 : ρwit c3 = (1/32) * bY c3 := by simp only [ρwit, h3] + have hlogarg : (1:ℝ) + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1) = 1 + S / 4 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hrhs : (([c1, c2, c3]).map ρwit).sum = ρwit c1 + ρwit c2 + ρwit c3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, add_zero] + ring + rw [hlogarg, hrhs, hrc1, hrc2, hrc3] + linarith [htan, hrnode_le, henc, hy1e, hS] + +/-- Cell `L34` (uses `d4_34L`). -/ +theorem subaction_deg4_L34 (c1 c2 c3 : Branch) + (h1 : bcc c1 = 0) (h2 : bcc c2 = 2) (h3 : bcc c3 = 3) : + (Real.log (1 + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2, c3]) ≤ (([c1, c2, c3]).map ρwit).sum := by + have hy1_0 := bY_nonneg c1 + have hy2_0 := bY_nonneg c2 + have hy3_0 := bY_nonneg c3 + have hy1e : bY c1 = 1 := by + have hc1 : c1 = Branch.node [] := by + cases c1 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h1; omega + rw [hc1, bY_leaf] + have hy2_hi : bY c2 ≤ (1/3:ℝ) := by + have h := bY_le_inv_deg c2; rw [h2] at h; norm_num at h; linarith + have hy3_hi : bY c3 ≤ (1/4:ℝ) := by + have h := bY_le_inv_deg c3; rw [h3] at h; norm_num at h; linarith + set S := bY c1 + bY c2 + bY c3 with hS + have hS0 : (0:ℝ) ≤ S := by rw [hS]; linarith + have hSmin : (1:ℝ) ≤ S := by rw [hS]; linarith + have hden : (0:ℝ) < 4 + S := by linarith + have htan := log_tangent (d := (4:ℝ)) (s := S) (s0 := (19/12:ℝ)) (by norm_num) hS0 (by norm_num) + rw [show (1:ℝ) + (19/12:ℝ)/4 = (67/48:ℝ) by norm_num, show (4:ℝ) + (19/12:ℝ) = (67/12:ℝ) by norm_num] at htan + have hbYnode : bY (Branch.node [c1, c2, c3]) = 1 / (4 + S) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hbcc_node : bcc (Branch.node [c1, c2, c3]) = 3 := by simp [bcc] + have hrnode : ρwit (Branch.node [c1, c2, c3]) = (1/384) * (1 / (4 + S)) := by + rw [ρwit, hbcc_node, hbYnode]; norm_num + have hrnode_le : ρwit (Branch.node [c1, c2, c3]) ≤ (1/1920:ℝ) := by + rw [hrnode] + have hinv : 1 / (4 + S) ≤ (1/5:ℝ) := by + have h := one_div_le_one_div_of_le (show (0:ℝ) < (5:ℝ) by norm_num) + (show (5:ℝ) ≤ 4 + S by linarith) + rwa [show (1:ℝ)/(5:ℝ) = (1/5:ℝ) by norm_num] at h + have hinv_nn : (0:ℝ) ≤ 1 / (4 + S) := by positivity + nlinarith [hinv, hinv_nn] + have henc := d4_34L + have hrc1 : ρwit c1 = FSTAR := by + have hcr1 : c1 = Branch.node [] := by + cases c1 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h1; omega + rw [hcr1, ρwit_leaf] + have hrc2 : ρwit c2 = (1/32) * bY c2 := by simp only [ρwit, h2] + have hrc3 : ρwit c3 = (1/384) * bY c3 := by simp only [ρwit, h3] + have hlogarg : (1:ℝ) + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1) = 1 + S / 4 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hrhs : (([c1, c2, c3]).map ρwit).sum = ρwit c1 + ρwit c2 + ρwit c3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, add_zero] + ring + rw [hlogarg, hrhs, hrc1, hrc2, hrc3] + linarith [htan, hrnode_le, henc, hy1e, hS] + +/-- Cell `L3H` (uses `d4_35L`). -/ +theorem subaction_deg4_L3H (c1 c2 c3 : Branch) + (h1 : bcc c1 = 0) (h2 : bcc c2 = 2) (h3 : 4 ≤ bcc c3) : + (Real.log (1 + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2, c3]) ≤ (([c1, c2, c3]).map ρwit).sum := by + have hy1_0 := bY_nonneg c1 + have hy2_0 := bY_nonneg c2 + have hy3_0 := bY_nonneg c3 + have hy1e : bY c1 = 1 := by + have hc1 : c1 = Branch.node [] := by + cases c1 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h1; omega + rw [hc1, bY_leaf] + have hy2_hi : bY c2 ≤ (1/3:ℝ) := by + have h := bY_le_inv_deg c2; rw [h2] at h; norm_num at h; linarith + have hy3_hi : bY c3 ≤ (1/5:ℝ) := by + have hbi := bY_le_inv_deg c3 + have hcast : (4:ℝ) ≤ (bcc c3 : ℝ) := by exact_mod_cast h3 + have hb2 : (1:ℝ) / ((bcc c3 : ℝ) + 1) ≤ 1/5 := one_div_le_one_div_of_le (by norm_num) (by linarith) + linarith + set S := bY c1 + bY c2 + bY c3 with hS + have hS0 : (0:ℝ) ≤ S := by rw [hS]; linarith + have hSmin : (1:ℝ) ≤ S := by rw [hS]; linarith + have hden : (0:ℝ) < 4 + S := by linarith + have htan := log_tangent (d := (4:ℝ)) (s := S) (s0 := (23/15:ℝ)) (by norm_num) hS0 (by norm_num) + rw [show (1:ℝ) + (23/15:ℝ)/4 = (83/60:ℝ) by norm_num, show (4:ℝ) + (23/15:ℝ) = (83/15:ℝ) by norm_num] at htan + have hbYnode : bY (Branch.node [c1, c2, c3]) = 1 / (4 + S) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hbcc_node : bcc (Branch.node [c1, c2, c3]) = 3 := by simp [bcc] + have hrnode : ρwit (Branch.node [c1, c2, c3]) = (1/384) * (1 / (4 + S)) := by + rw [ρwit, hbcc_node, hbYnode]; norm_num + have hrnode_le : ρwit (Branch.node [c1, c2, c3]) ≤ (1/1920:ℝ) := by + rw [hrnode] + have hinv : 1 / (4 + S) ≤ (1/5:ℝ) := by + have h := one_div_le_one_div_of_le (show (0:ℝ) < (5:ℝ) by norm_num) + (show (5:ℝ) ≤ 4 + S by linarith) + rwa [show (1:ℝ)/(5:ℝ) = (1/5:ℝ) by norm_num] at h + have hinv_nn : (0:ℝ) ≤ 1 / (4 + S) := by positivity + nlinarith [hinv, hinv_nn] + have henc := d4_35L + have hrc1 : ρwit c1 = FSTAR := by + have hcr1 : c1 = Branch.node [] := by + cases c1 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h1; omega + rw [hcr1, ρwit_leaf] + have hrc2 : ρwit c2 = (1/32) * bY c2 := by simp only [ρwit, h2] + have hrc3_nn : 0 ≤ ρwit c3 := ρwit_nonneg c3 + have hlogarg : (1:ℝ) + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1) = 1 + S / 4 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hrhs : (([c1, c2, c3]).map ρwit).sum = ρwit c1 + ρwit c2 + ρwit c3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, add_zero] + ring + rw [hlogarg, hrhs, hrc1, hrc2] + linarith [htan, hrnode_le, henc, hy1e, hrc3_nn, hy3_hi, hS] + +/-- Cell `L44` (uses `d4_44L`). -/ +theorem subaction_deg4_L44 (c1 c2 c3 : Branch) + (h1 : bcc c1 = 0) (h2 : bcc c2 = 3) (h3 : bcc c3 = 3) : + (Real.log (1 + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2, c3]) ≤ (([c1, c2, c3]).map ρwit).sum := by + have hy1_0 := bY_nonneg c1 + have hy2_0 := bY_nonneg c2 + have hy3_0 := bY_nonneg c3 + have hy1e : bY c1 = 1 := by + have hc1 : c1 = Branch.node [] := by + cases c1 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h1; omega + rw [hc1, bY_leaf] + have hy2_hi : bY c2 ≤ (1/4:ℝ) := by + have h := bY_le_inv_deg c2; rw [h2] at h; norm_num at h; linarith + have hy3_hi : bY c3 ≤ (1/4:ℝ) := by + have h := bY_le_inv_deg c3; rw [h3] at h; norm_num at h; linarith + set S := bY c1 + bY c2 + bY c3 with hS + have hS0 : (0:ℝ) ≤ S := by rw [hS]; linarith + have hSmin : (1:ℝ) ≤ S := by rw [hS]; linarith + have hden : (0:ℝ) < 4 + S := by linarith + have htan := log_tangent (d := (4:ℝ)) (s := S) (s0 := (3/2:ℝ)) (by norm_num) hS0 (by norm_num) + rw [show (1:ℝ) + (3/2:ℝ)/4 = (11/8:ℝ) by norm_num, show (4:ℝ) + (3/2:ℝ) = (11/2:ℝ) by norm_num] at htan + have hbYnode : bY (Branch.node [c1, c2, c3]) = 1 / (4 + S) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hbcc_node : bcc (Branch.node [c1, c2, c3]) = 3 := by simp [bcc] + have hrnode : ρwit (Branch.node [c1, c2, c3]) = (1/384) * (1 / (4 + S)) := by + rw [ρwit, hbcc_node, hbYnode]; norm_num + have hrnode_le : ρwit (Branch.node [c1, c2, c3]) ≤ (1/1920:ℝ) := by + rw [hrnode] + have hinv : 1 / (4 + S) ≤ (1/5:ℝ) := by + have h := one_div_le_one_div_of_le (show (0:ℝ) < (5:ℝ) by norm_num) + (show (5:ℝ) ≤ 4 + S by linarith) + rwa [show (1:ℝ)/(5:ℝ) = (1/5:ℝ) by norm_num] at h + have hinv_nn : (0:ℝ) ≤ 1 / (4 + S) := by positivity + nlinarith [hinv, hinv_nn] + have henc := d4_44L + have hrc1 : ρwit c1 = FSTAR := by + have hcr1 : c1 = Branch.node [] := by + cases c1 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h1; omega + rw [hcr1, ρwit_leaf] + have hrc2 : ρwit c2 = (1/384) * bY c2 := by simp only [ρwit, h2] + have hrc3 : ρwit c3 = (1/384) * bY c3 := by simp only [ρwit, h3] + have hlogarg : (1:ℝ) + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1) = 1 + S / 4 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hrhs : (([c1, c2, c3]).map ρwit).sum = ρwit c1 + ρwit c2 + ρwit c3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, add_zero] + ring + rw [hlogarg, hrhs, hrc1, hrc2, hrc3] + linarith [htan, hrnode_le, henc, hy1e, hS] + +/-- Cell `L4H` (uses `d4_45L`). -/ +theorem subaction_deg4_L4H (c1 c2 c3 : Branch) + (h1 : bcc c1 = 0) (h2 : bcc c2 = 3) (h3 : 4 ≤ bcc c3) : + (Real.log (1 + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2, c3]) ≤ (([c1, c2, c3]).map ρwit).sum := by + have hy1_0 := bY_nonneg c1 + have hy2_0 := bY_nonneg c2 + have hy3_0 := bY_nonneg c3 + have hy1e : bY c1 = 1 := by + have hc1 : c1 = Branch.node [] := by + cases c1 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h1; omega + rw [hc1, bY_leaf] + have hy2_hi : bY c2 ≤ (1/4:ℝ) := by + have h := bY_le_inv_deg c2; rw [h2] at h; norm_num at h; linarith + have hy3_hi : bY c3 ≤ (1/5:ℝ) := by + have hbi := bY_le_inv_deg c3 + have hcast : (4:ℝ) ≤ (bcc c3 : ℝ) := by exact_mod_cast h3 + have hb2 : (1:ℝ) / ((bcc c3 : ℝ) + 1) ≤ 1/5 := one_div_le_one_div_of_le (by norm_num) (by linarith) + linarith + set S := bY c1 + bY c2 + bY c3 with hS + have hS0 : (0:ℝ) ≤ S := by rw [hS]; linarith + have hSmin : (1:ℝ) ≤ S := by rw [hS]; linarith + have hden : (0:ℝ) < 4 + S := by linarith + have htan := log_tangent (d := (4:ℝ)) (s := S) (s0 := (29/20:ℝ)) (by norm_num) hS0 (by norm_num) + rw [show (1:ℝ) + (29/20:ℝ)/4 = (109/80:ℝ) by norm_num, show (4:ℝ) + (29/20:ℝ) = (109/20:ℝ) by norm_num] at htan + have hbYnode : bY (Branch.node [c1, c2, c3]) = 1 / (4 + S) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hbcc_node : bcc (Branch.node [c1, c2, c3]) = 3 := by simp [bcc] + have hrnode : ρwit (Branch.node [c1, c2, c3]) = (1/384) * (1 / (4 + S)) := by + rw [ρwit, hbcc_node, hbYnode]; norm_num + have hrnode_le : ρwit (Branch.node [c1, c2, c3]) ≤ (1/1920:ℝ) := by + rw [hrnode] + have hinv : 1 / (4 + S) ≤ (1/5:ℝ) := by + have h := one_div_le_one_div_of_le (show (0:ℝ) < (5:ℝ) by norm_num) + (show (5:ℝ) ≤ 4 + S by linarith) + rwa [show (1:ℝ)/(5:ℝ) = (1/5:ℝ) by norm_num] at h + have hinv_nn : (0:ℝ) ≤ 1 / (4 + S) := by positivity + nlinarith [hinv, hinv_nn] + have henc := d4_45L + have hrc1 : ρwit c1 = FSTAR := by + have hcr1 : c1 = Branch.node [] := by + cases c1 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h1; omega + rw [hcr1, ρwit_leaf] + have hrc2 : ρwit c2 = (1/384) * bY c2 := by simp only [ρwit, h2] + have hrc3_nn : 0 ≤ ρwit c3 := ρwit_nonneg c3 + have hlogarg : (1:ℝ) + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1) = 1 + S / 4 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hrhs : (([c1, c2, c3]).map ρwit).sum = ρwit c1 + ρwit c2 + ρwit c3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, add_zero] + ring + rw [hlogarg, hrhs, hrc1, hrc2] + linarith [htan, hrnode_le, henc, hy1e, hrc3_nn, hy3_hi, hS] + +/-- Cell `LHH` (uses `d4_55L`). -/ +theorem subaction_deg4_LHH (c1 c2 c3 : Branch) + (h1 : bcc c1 = 0) (h2 : 4 ≤ bcc c2) (h3 : 4 ≤ bcc c3) : + (Real.log (1 + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2, c3]) ≤ (([c1, c2, c3]).map ρwit).sum := by + have hy1_0 := bY_nonneg c1 + have hy2_0 := bY_nonneg c2 + have hy3_0 := bY_nonneg c3 + have hy1e : bY c1 = 1 := by + have hc1 : c1 = Branch.node [] := by + cases c1 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h1; omega + rw [hc1, bY_leaf] + have hy2_hi : bY c2 ≤ (1/5:ℝ) := by + have hbi := bY_le_inv_deg c2 + have hcast : (4:ℝ) ≤ (bcc c2 : ℝ) := by exact_mod_cast h2 + have hb2 : (1:ℝ) / ((bcc c2 : ℝ) + 1) ≤ 1/5 := one_div_le_one_div_of_le (by norm_num) (by linarith) + linarith + have hy3_hi : bY c3 ≤ (1/5:ℝ) := by + have hbi := bY_le_inv_deg c3 + have hcast : (4:ℝ) ≤ (bcc c3 : ℝ) := by exact_mod_cast h3 + have hb2 : (1:ℝ) / ((bcc c3 : ℝ) + 1) ≤ 1/5 := one_div_le_one_div_of_le (by norm_num) (by linarith) + linarith + set S := bY c1 + bY c2 + bY c3 with hS + have hS0 : (0:ℝ) ≤ S := by rw [hS]; linarith + have hSmin : (1:ℝ) ≤ S := by rw [hS]; linarith + have hden : (0:ℝ) < 4 + S := by linarith + have htan := log_tangent (d := (4:ℝ)) (s := S) (s0 := (7/5:ℝ)) (by norm_num) hS0 (by norm_num) + rw [show (1:ℝ) + (7/5:ℝ)/4 = (27/20:ℝ) by norm_num, show (4:ℝ) + (7/5:ℝ) = (27/5:ℝ) by norm_num] at htan + have hbYnode : bY (Branch.node [c1, c2, c3]) = 1 / (4 + S) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hbcc_node : bcc (Branch.node [c1, c2, c3]) = 3 := by simp [bcc] + have hrnode : ρwit (Branch.node [c1, c2, c3]) = (1/384) * (1 / (4 + S)) := by + rw [ρwit, hbcc_node, hbYnode]; norm_num + have hrnode_le : ρwit (Branch.node [c1, c2, c3]) ≤ (1/1920:ℝ) := by + rw [hrnode] + have hinv : 1 / (4 + S) ≤ (1/5:ℝ) := by + have h := one_div_le_one_div_of_le (show (0:ℝ) < (5:ℝ) by norm_num) + (show (5:ℝ) ≤ 4 + S by linarith) + rwa [show (1:ℝ)/(5:ℝ) = (1/5:ℝ) by norm_num] at h + have hinv_nn : (0:ℝ) ≤ 1 / (4 + S) := by positivity + nlinarith [hinv, hinv_nn] + have henc := d4_55L + have hrc1 : ρwit c1 = FSTAR := by + have hcr1 : c1 = Branch.node [] := by + cases c1 with + | node cs => cases cs with + | nil => rfl + | cons a t => simp only [bcc, List.length_cons] at h1; omega + rw [hcr1, ρwit_leaf] + have hrc2_nn : 0 ≤ ρwit c2 := ρwit_nonneg c2 + have hrc3_nn : 0 ≤ ρwit c3 := ρwit_nonneg c3 + have hlogarg : (1:ℝ) + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1) = 1 + S / 4 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hrhs : (([c1, c2, c3]).map ρwit).sum = ρwit c1 + ρwit c2 + ρwit c3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, add_zero] + ring + rw [hlogarg, hrhs, hrc1] + linarith [htan, hrnode_le, henc, hy1e, hrc2_nn, hy2_hi, hrc3_nn, hy3_hi, hS] + +/-- Cell `222` (uses `d4_222`). -/ +theorem subaction_deg4_222 (c1 c2 c3 : Branch) + (h1 : bcc c1 = 1) (h2 : bcc c2 = 1) (h3 : bcc c3 = 1) : + (Real.log (1 + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2, c3]) ≤ (([c1, c2, c3]).map ρwit).sum := by + have hy1_0 := bY_nonneg c1 + have hy2_0 := bY_nonneg c2 + have hy3_0 := bY_nonneg c3 + have hy1_lo : (1:ℝ)/3 ≤ bY c1 := bY_ge_third_of_bcc1 c1 h1 + have hy1_hi : bY c1 ≤ 1/2 := by + have h := bY_le_inv_deg c1; rw [h1] at h; norm_num at h; linarith + have hy2_lo : (1:ℝ)/3 ≤ bY c2 := bY_ge_third_of_bcc1 c2 h2 + have hy2_hi : bY c2 ≤ 1/2 := by + have h := bY_le_inv_deg c2; rw [h2] at h; norm_num at h; linarith + have hy3_lo : (1:ℝ)/3 ≤ bY c3 := bY_ge_third_of_bcc1 c3 h3 + have hy3_hi : bY c3 ≤ 1/2 := by + have h := bY_le_inv_deg c3; rw [h3] at h; norm_num at h; linarith + set S := bY c1 + bY c2 + bY c3 with hS + have hS0 : (0:ℝ) ≤ S := by rw [hS]; linarith + have hSmin : (1:ℝ) ≤ S := by rw [hS]; linarith + have hden : (0:ℝ) < 4 + S := by linarith + have htan := log_tangent (d := (4:ℝ)) (s := S) (s0 := (1:ℝ)) (by norm_num) hS0 (by norm_num) + rw [show (1:ℝ) + (1:ℝ)/4 = (5/4:ℝ) by norm_num, show (4:ℝ) + (1:ℝ) = (5:ℝ) by norm_num] at htan + have hbYnode : bY (Branch.node [c1, c2, c3]) = 1 / (4 + S) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hbcc_node : bcc (Branch.node [c1, c2, c3]) = 3 := by simp [bcc] + have hrnode : ρwit (Branch.node [c1, c2, c3]) = (1/384) * (1 / (4 + S)) := by + rw [ρwit, hbcc_node, hbYnode]; norm_num + have hrnode_le : ρwit (Branch.node [c1, c2, c3]) ≤ (1/1920:ℝ) := by + rw [hrnode] + have hinv : 1 / (4 + S) ≤ (1/5:ℝ) := by + have h := one_div_le_one_div_of_le (show (0:ℝ) < (5:ℝ) by norm_num) + (show (5:ℝ) ≤ 4 + S by linarith) + rwa [show (1:ℝ)/(5:ℝ) = (1/5:ℝ) by norm_num] at h + have hinv_nn : (0:ℝ) ≤ 1 / (4 + S) := by positivity + nlinarith [hinv, hinv_nn] + -- correctly-signed atom (kL=+3); the `d4_222` in D4.lean has kL=-3 (loose, wrong sign to combine) + have henc : Real.log (5/4:ℝ) + (3 : ℤ) * Real.log (3/2) - (7 : ℤ) * FSTAR ≤ (-1/1920:ℝ) := + tangent_atom (5/4:ℝ) (3) (7) (-1/1920:ℝ) (by norm_num) (by norm_num) + have hrc1 : ρwit c1 = 2 * FSTAR - Real.log (3/2) + (1/4) * (bY c1 - 1/3) := by + simp only [ρwit, h1] + have hrc2 : ρwit c2 = 2 * FSTAR - Real.log (3/2) + (1/4) * (bY c2 - 1/3) := by + simp only [ρwit, h2] + have hrc3 : ρwit c3 = 2 * FSTAR - Real.log (3/2) + (1/4) * (bY c3 - 1/3) := by + simp only [ρwit, h3] + have hlogarg : (1:ℝ) + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1) = 1 + S / 4 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hrhs : (([c1, c2, c3]).map ρwit).sum = ρwit c1 + ρwit c2 + ρwit c3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, add_zero] + ring + rw [hlogarg, hrhs, hrc1, hrc2, hrc3] + linarith [htan, hrnode_le, henc, hS] + +/-- Cell `223` (uses `d4_223`). -/ +theorem subaction_deg4_223 (c1 c2 c3 : Branch) + (h1 : bcc c1 = 1) (h2 : bcc c2 = 1) (h3 : bcc c3 = 2) : + (Real.log (1 + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2, c3]) ≤ (([c1, c2, c3]).map ρwit).sum := by + have hy1_0 := bY_nonneg c1 + have hy2_0 := bY_nonneg c2 + have hy3_0 := bY_nonneg c3 + have hy1_lo : (1:ℝ)/3 ≤ bY c1 := bY_ge_third_of_bcc1 c1 h1 + have hy1_hi : bY c1 ≤ 1/2 := by + have h := bY_le_inv_deg c1; rw [h1] at h; norm_num at h; linarith + have hy2_lo : (1:ℝ)/3 ≤ bY c2 := bY_ge_third_of_bcc1 c2 h2 + have hy2_hi : bY c2 ≤ 1/2 := by + have h := bY_le_inv_deg c2; rw [h2] at h; norm_num at h; linarith + have hy3_hi : bY c3 ≤ (1/3:ℝ) := by + have h := bY_le_inv_deg c3; rw [h3] at h; norm_num at h; linarith + set S := bY c1 + bY c2 + bY c3 with hS + have hS0 : (0:ℝ) ≤ S := by rw [hS]; linarith + have hSmin : (2/3:ℝ) ≤ S := by rw [hS]; linarith + have hden : (0:ℝ) < 4 + S := by linarith + have htan := log_tangent (d := (4:ℝ)) (s := S) (s0 := (1:ℝ)) (by norm_num) hS0 (by norm_num) + rw [show (1:ℝ) + (1:ℝ)/4 = (5/4:ℝ) by norm_num, show (4:ℝ) + (1:ℝ) = (5:ℝ) by norm_num] at htan + have hbYnode : bY (Branch.node [c1, c2, c3]) = 1 / (4 + S) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hbcc_node : bcc (Branch.node [c1, c2, c3]) = 3 := by simp [bcc] + have hrnode : ρwit (Branch.node [c1, c2, c3]) = (1/384) * (1 / (4 + S)) := by + rw [ρwit, hbcc_node, hbYnode]; norm_num + have hrnode_le : ρwit (Branch.node [c1, c2, c3]) ≤ (1/1792:ℝ) := by + rw [hrnode] + have hinv : 1 / (4 + S) ≤ (3/14:ℝ) := by + have h := one_div_le_one_div_of_le (show (0:ℝ) < (14/3:ℝ) by norm_num) + (show (14/3:ℝ) ≤ 4 + S by linarith) + rwa [show (1:ℝ)/(14/3:ℝ) = (3/14:ℝ) by norm_num] at h + have hinv_nn : (0:ℝ) ≤ 1 / (4 + S) := by positivity + nlinarith [hinv, hinv_nn] + -- correctly-signed atom (kL=+2); the `d4_223` in D4.lean has kL=-2 (loose, wrong sign to combine) + have henc : Real.log (5/4:ℝ) + (2 : ℤ) * Real.log (3/2) - (5 : ℤ) * FSTAR ≤ (53/5376:ℝ) := + tangent_atom (5/4:ℝ) (2) (5) (53/5376:ℝ) (by norm_num) (by norm_num) + have hrc1 : ρwit c1 = 2 * FSTAR - Real.log (3/2) + (1/4) * (bY c1 - 1/3) := by + simp only [ρwit, h1] + have hrc2 : ρwit c2 = 2 * FSTAR - Real.log (3/2) + (1/4) * (bY c2 - 1/3) := by + simp only [ρwit, h2] + have hrc3 : ρwit c3 = (1/32) * bY c3 := by simp only [ρwit, h3] + have hlogarg : (1:ℝ) + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1) = 1 + S / 4 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hrhs : (([c1, c2, c3]).map ρwit).sum = ρwit c1 + ρwit c2 + ρwit c3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, add_zero] + ring + rw [hlogarg, hrhs, hrc1, hrc2, hrc3] + linarith [htan, hrnode_le, henc, hS] + +/-- Cell `224` (uses `d4_224`). -/ +theorem subaction_deg4_224 (c1 c2 c3 : Branch) + (h1 : bcc c1 = 1) (h2 : bcc c2 = 1) (h3 : bcc c3 = 3) : + (Real.log (1 + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2, c3]) ≤ (([c1, c2, c3]).map ρwit).sum := by + have hy1_0 := bY_nonneg c1 + have hy2_0 := bY_nonneg c2 + have hy3_0 := bY_nonneg c3 + have hy1_lo : (1:ℝ)/3 ≤ bY c1 := bY_ge_third_of_bcc1 c1 h1 + have hy1_hi : bY c1 ≤ 1/2 := by + have h := bY_le_inv_deg c1; rw [h1] at h; norm_num at h; linarith + have hy2_lo : (1:ℝ)/3 ≤ bY c2 := bY_ge_third_of_bcc1 c2 h2 + have hy2_hi : bY c2 ≤ 1/2 := by + have h := bY_le_inv_deg c2; rw [h2] at h; norm_num at h; linarith + have hy3_hi : bY c3 ≤ (1/4:ℝ) := by + have h := bY_le_inv_deg c3; rw [h3] at h; norm_num at h; linarith + set S := bY c1 + bY c2 + bY c3 with hS + have hS0 : (0:ℝ) ≤ S := by rw [hS]; linarith + have hSmin : (2/3:ℝ) ≤ S := by rw [hS]; linarith + have hden : (0:ℝ) < 4 + S := by linarith + have htan := log_tangent (d := (4:ℝ)) (s := S) (s0 := (11/12:ℝ)) (by norm_num) hS0 (by norm_num) + rw [show (1:ℝ) + (11/12:ℝ)/4 = (59/48:ℝ) by norm_num, show (4:ℝ) + (11/12:ℝ) = (59/12:ℝ) by norm_num] at htan + have hbYnode : bY (Branch.node [c1, c2, c3]) = 1 / (4 + S) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hbcc_node : bcc (Branch.node [c1, c2, c3]) = 3 := by simp [bcc] + have hrnode : ρwit (Branch.node [c1, c2, c3]) = (1/384) * (1 / (4 + S)) := by + rw [ρwit, hbcc_node, hbYnode]; norm_num + have hrnode_le : ρwit (Branch.node [c1, c2, c3]) ≤ (1/1792:ℝ) := by + rw [hrnode] + have hinv : 1 / (4 + S) ≤ (3/14:ℝ) := by + have h := one_div_le_one_div_of_le (show (0:ℝ) < (14/3:ℝ) by norm_num) + (show (14/3:ℝ) ≤ 4 + S by linarith) + rwa [show (1:ℝ)/(14/3:ℝ) = (3/14:ℝ) by norm_num] at h + have hinv_nn : (0:ℝ) ≤ 1 / (4 + S) := by positivity + nlinarith [hinv, hinv_nn] + -- correctly-signed atom (kL=+2); the `d4_224` in D4.lean has kL=-2 (loose, wrong sign to combine) + have henc : Real.log (59/48:ℝ) + (2 : ℤ) * Real.log (3/2) - (5 : ℤ) * FSTAR ≤ (1/10752:ℝ) := + tangent_atom (59/48:ℝ) (2) (5) (1/10752:ℝ) (by norm_num) (by norm_num) + have hrc1 : ρwit c1 = 2 * FSTAR - Real.log (3/2) + (1/4) * (bY c1 - 1/3) := by + simp only [ρwit, h1] + have hrc2 : ρwit c2 = 2 * FSTAR - Real.log (3/2) + (1/4) * (bY c2 - 1/3) := by + simp only [ρwit, h2] + have hrc3 : ρwit c3 = (1/384) * bY c3 := by simp only [ρwit, h3] + have hlogarg : (1:ℝ) + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1) = 1 + S / 4 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hrhs : (([c1, c2, c3]).map ρwit).sum = ρwit c1 + ρwit c2 + ρwit c3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, add_zero] + ring + rw [hlogarg, hrhs, hrc1, hrc2, hrc3] + linarith [htan, hrnode_le, henc, hS] + +/-- Cell `22H` (uses `d4_225`). -/ +theorem subaction_deg4_22H (c1 c2 c3 : Branch) + (h1 : bcc c1 = 1) (h2 : bcc c2 = 1) (h3 : 4 ≤ bcc c3) : + (Real.log (1 + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2, c3]) ≤ (([c1, c2, c3]).map ρwit).sum := by + have hy1_0 := bY_nonneg c1 + have hy2_0 := bY_nonneg c2 + have hy3_0 := bY_nonneg c3 + have hy1_lo : (1:ℝ)/3 ≤ bY c1 := bY_ge_third_of_bcc1 c1 h1 + have hy1_hi : bY c1 ≤ 1/2 := by + have h := bY_le_inv_deg c1; rw [h1] at h; norm_num at h; linarith + have hy2_lo : (1:ℝ)/3 ≤ bY c2 := bY_ge_third_of_bcc1 c2 h2 + have hy2_hi : bY c2 ≤ 1/2 := by + have h := bY_le_inv_deg c2; rw [h2] at h; norm_num at h; linarith + have hy3_hi : bY c3 ≤ (1/5:ℝ) := by + have hbi := bY_le_inv_deg c3 + have hcast : (4:ℝ) ≤ (bcc c3 : ℝ) := by exact_mod_cast h3 + have hb2 : (1:ℝ) / ((bcc c3 : ℝ) + 1) ≤ 1/5 := one_div_le_one_div_of_le (by norm_num) (by linarith) + linarith + set S := bY c1 + bY c2 + bY c3 with hS + have hS0 : (0:ℝ) ≤ S := by rw [hS]; linarith + have hSmin : (2/3:ℝ) ≤ S := by rw [hS]; linarith + have hden : (0:ℝ) < 4 + S := by linarith + have htan := log_tangent (d := (4:ℝ)) (s := S) (s0 := (13/15:ℝ)) (by norm_num) hS0 (by norm_num) + rw [show (1:ℝ) + (13/15:ℝ)/4 = (73/60:ℝ) by norm_num, show (4:ℝ) + (13/15:ℝ) = (73/15:ℝ) by norm_num] at htan + have hbYnode : bY (Branch.node [c1, c2, c3]) = 1 / (4 + S) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hbcc_node : bcc (Branch.node [c1, c2, c3]) = 3 := by simp [bcc] + have hrnode : ρwit (Branch.node [c1, c2, c3]) = (1/384) * (1 / (4 + S)) := by + rw [ρwit, hbcc_node, hbYnode]; norm_num + have hrnode_le : ρwit (Branch.node [c1, c2, c3]) ≤ (1/1792:ℝ) := by + rw [hrnode] + have hinv : 1 / (4 + S) ≤ (3/14:ℝ) := by + have h := one_div_le_one_div_of_le (show (0:ℝ) < (14/3:ℝ) by norm_num) + (show (14/3:ℝ) ≤ 4 + S by linarith) + rwa [show (1:ℝ)/(14/3:ℝ) = (3/14:ℝ) by norm_num] at h + have hinv_nn : (0:ℝ) ≤ 1 / (4 + S) := by positivity + nlinarith [hinv, hinv_nn] + -- correctly-signed atom (kL=+2); the `d4_225` in D4.lean has kL=-2 (loose, wrong sign to combine) + have henc : Real.log (73/60:ℝ) + (2 : ℤ) * Real.log (3/2) - (5 : ℤ) * FSTAR ≤ (-1/1792:ℝ) := + tangent_atom (73/60:ℝ) (2) (5) (-1/1792:ℝ) (by norm_num) (by norm_num) + have hrc1 : ρwit c1 = 2 * FSTAR - Real.log (3/2) + (1/4) * (bY c1 - 1/3) := by + simp only [ρwit, h1] + have hrc2 : ρwit c2 = 2 * FSTAR - Real.log (3/2) + (1/4) * (bY c2 - 1/3) := by + simp only [ρwit, h2] + have hrc3_nn : 0 ≤ ρwit c3 := ρwit_nonneg c3 + have hlogarg : (1:ℝ) + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1) = 1 + S / 4 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hrhs : (([c1, c2, c3]).map ρwit).sum = ρwit c1 + ρwit c2 + ρwit c3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, add_zero] + ring + rw [hlogarg, hrhs, hrc1, hrc2] + linarith [htan, hrnode_le, henc, hrc3_nn, hy3_hi, hS] + +/-- Cell `233` (uses `d4_233`). -/ +theorem subaction_deg4_233 (c1 c2 c3 : Branch) + (h1 : bcc c1 = 1) (h2 : bcc c2 = 2) (h3 : bcc c3 = 2) : + (Real.log (1 + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2, c3]) ≤ (([c1, c2, c3]).map ρwit).sum := by + have hy1_0 := bY_nonneg c1 + have hy2_0 := bY_nonneg c2 + have hy3_0 := bY_nonneg c3 + have hy1_lo : (1:ℝ)/3 ≤ bY c1 := bY_ge_third_of_bcc1 c1 h1 + have hy1_hi : bY c1 ≤ 1/2 := by + have h := bY_le_inv_deg c1; rw [h1] at h; norm_num at h; linarith + have hy2_hi : bY c2 ≤ (1/3:ℝ) := by + have h := bY_le_inv_deg c2; rw [h2] at h; norm_num at h; linarith + have hy3_hi : bY c3 ≤ (1/3:ℝ) := by + have h := bY_le_inv_deg c3; rw [h3] at h; norm_num at h; linarith + set S := bY c1 + bY c2 + bY c3 with hS + have hS0 : (0:ℝ) ≤ S := by rw [hS]; linarith + have hSmin : (1/3:ℝ) ≤ S := by rw [hS]; linarith + have hden : (0:ℝ) < 4 + S := by linarith + have htan := log_tangent (d := (4:ℝ)) (s := S) (s0 := (1:ℝ)) (by norm_num) hS0 (by norm_num) + rw [show (1:ℝ) + (1:ℝ)/4 = (5/4:ℝ) by norm_num, show (4:ℝ) + (1:ℝ) = (5:ℝ) by norm_num] at htan + have hbYnode : bY (Branch.node [c1, c2, c3]) = 1 / (4 + S) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hbcc_node : bcc (Branch.node [c1, c2, c3]) = 3 := by simp [bcc] + have hrnode : ρwit (Branch.node [c1, c2, c3]) = (1/384) * (1 / (4 + S)) := by + rw [ρwit, hbcc_node, hbYnode]; norm_num + have hrnode_le : ρwit (Branch.node [c1, c2, c3]) ≤ (1/1664:ℝ) := by + rw [hrnode] + have hinv : 1 / (4 + S) ≤ (3/13:ℝ) := by + have h := one_div_le_one_div_of_le (show (0:ℝ) < (13/3:ℝ) by norm_num) + (show (13/3:ℝ) ≤ 4 + S by linarith) + rwa [show (1:ℝ)/(13/3:ℝ) = (3/13:ℝ) by norm_num] at h + have hinv_nn : (0:ℝ) ≤ 1 / (4 + S) := by positivity + nlinarith [hinv, hinv_nn] + -- correctly-signed atom (kL=+1); the `d4_233` in D4.lean has kL=-1 (loose, wrong sign to combine) + have henc : Real.log (5/4:ℝ) + (1 : ℤ) * Real.log (3/2) - (3 : ℤ) * FSTAR ≤ (101/4992:ℝ) := + tangent_atom (5/4:ℝ) (1) (3) (101/4992:ℝ) (by norm_num) (by norm_num) + have hrc1 : ρwit c1 = 2 * FSTAR - Real.log (3/2) + (1/4) * (bY c1 - 1/3) := by + simp only [ρwit, h1] + have hrc2 : ρwit c2 = (1/32) * bY c2 := by simp only [ρwit, h2] + have hrc3 : ρwit c3 = (1/32) * bY c3 := by simp only [ρwit, h3] + have hlogarg : (1:ℝ) + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1) = 1 + S / 4 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hrhs : (([c1, c2, c3]).map ρwit).sum = ρwit c1 + ρwit c2 + ρwit c3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, add_zero] + ring + rw [hlogarg, hrhs, hrc1, hrc2, hrc3] + linarith [htan, hrnode_le, henc, hS] + +/-- Cell `234` (uses `d4_234`). -/ +theorem subaction_deg4_234 (c1 c2 c3 : Branch) + (h1 : bcc c1 = 1) (h2 : bcc c2 = 2) (h3 : bcc c3 = 3) : + (Real.log (1 + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2, c3]) ≤ (([c1, c2, c3]).map ρwit).sum := by + have hy1_0 := bY_nonneg c1 + have hy2_0 := bY_nonneg c2 + have hy3_0 := bY_nonneg c3 + have hy1_lo : (1:ℝ)/3 ≤ bY c1 := bY_ge_third_of_bcc1 c1 h1 + have hy1_hi : bY c1 ≤ 1/2 := by + have h := bY_le_inv_deg c1; rw [h1] at h; norm_num at h; linarith + have hy2_hi : bY c2 ≤ (1/3:ℝ) := by + have h := bY_le_inv_deg c2; rw [h2] at h; norm_num at h; linarith + have hy3_hi : bY c3 ≤ (1/4:ℝ) := by + have h := bY_le_inv_deg c3; rw [h3] at h; norm_num at h; linarith + set S := bY c1 + bY c2 + bY c3 with hS + have hS0 : (0:ℝ) ≤ S := by rw [hS]; linarith + have hSmin : (1/3:ℝ) ≤ S := by rw [hS]; linarith + have hden : (0:ℝ) < 4 + S := by linarith + have htan := log_tangent (d := (4:ℝ)) (s := S) (s0 := (11/12:ℝ)) (by norm_num) hS0 (by norm_num) + rw [show (1:ℝ) + (11/12:ℝ)/4 = (59/48:ℝ) by norm_num, show (4:ℝ) + (11/12:ℝ) = (59/12:ℝ) by norm_num] at htan + have hbYnode : bY (Branch.node [c1, c2, c3]) = 1 / (4 + S) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hbcc_node : bcc (Branch.node [c1, c2, c3]) = 3 := by simp [bcc] + have hrnode : ρwit (Branch.node [c1, c2, c3]) = (1/384) * (1 / (4 + S)) := by + rw [ρwit, hbcc_node, hbYnode]; norm_num + have hrnode_le : ρwit (Branch.node [c1, c2, c3]) ≤ (1/1664:ℝ) := by + rw [hrnode] + have hinv : 1 / (4 + S) ≤ (3/13:ℝ) := by + have h := one_div_le_one_div_of_le (show (0:ℝ) < (13/3:ℝ) by norm_num) + (show (13/3:ℝ) ≤ 4 + S by linarith) + rwa [show (1:ℝ)/(13/3:ℝ) = (3/13:ℝ) by norm_num] at h + have hinv_nn : (0:ℝ) ≤ 1 / (4 + S) := by positivity + nlinarith [hinv, hinv_nn] + -- correctly-signed atom (kL=+1); the `d4_234` in D4.lean has kL=-1 (loose, wrong sign to combine) + have henc : Real.log (59/48:ℝ) + (1 : ℤ) * Real.log (3/2) - (3 : ℤ) * FSTAR ≤ (209/19968:ℝ) := + tangent_atom (59/48:ℝ) (1) (3) (209/19968:ℝ) (by norm_num) (by norm_num) + have hrc1 : ρwit c1 = 2 * FSTAR - Real.log (3/2) + (1/4) * (bY c1 - 1/3) := by + simp only [ρwit, h1] + have hrc2 : ρwit c2 = (1/32) * bY c2 := by simp only [ρwit, h2] + have hrc3 : ρwit c3 = (1/384) * bY c3 := by simp only [ρwit, h3] + have hlogarg : (1:ℝ) + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1) = 1 + S / 4 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hrhs : (([c1, c2, c3]).map ρwit).sum = ρwit c1 + ρwit c2 + ρwit c3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, add_zero] + ring + rw [hlogarg, hrhs, hrc1, hrc2, hrc3] + linarith [htan, hrnode_le, henc, hS] + +/-- Cell `23H` (uses `d4_235`). -/ +theorem subaction_deg4_23H (c1 c2 c3 : Branch) + (h1 : bcc c1 = 1) (h2 : bcc c2 = 2) (h3 : 4 ≤ bcc c3) : + (Real.log (1 + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2, c3]) ≤ (([c1, c2, c3]).map ρwit).sum := by + have hy1_0 := bY_nonneg c1 + have hy2_0 := bY_nonneg c2 + have hy3_0 := bY_nonneg c3 + have hy1_lo : (1:ℝ)/3 ≤ bY c1 := bY_ge_third_of_bcc1 c1 h1 + have hy1_hi : bY c1 ≤ 1/2 := by + have h := bY_le_inv_deg c1; rw [h1] at h; norm_num at h; linarith + have hy2_hi : bY c2 ≤ (1/3:ℝ) := by + have h := bY_le_inv_deg c2; rw [h2] at h; norm_num at h; linarith + have hy3_hi : bY c3 ≤ (1/5:ℝ) := by + have hbi := bY_le_inv_deg c3 + have hcast : (4:ℝ) ≤ (bcc c3 : ℝ) := by exact_mod_cast h3 + have hb2 : (1:ℝ) / ((bcc c3 : ℝ) + 1) ≤ 1/5 := one_div_le_one_div_of_le (by norm_num) (by linarith) + linarith + set S := bY c1 + bY c2 + bY c3 with hS + have hS0 : (0:ℝ) ≤ S := by rw [hS]; linarith + have hSmin : (1/3:ℝ) ≤ S := by rw [hS]; linarith + have hden : (0:ℝ) < 4 + S := by linarith + have htan := log_tangent (d := (4:ℝ)) (s := S) (s0 := (13/15:ℝ)) (by norm_num) hS0 (by norm_num) + rw [show (1:ℝ) + (13/15:ℝ)/4 = (73/60:ℝ) by norm_num, show (4:ℝ) + (13/15:ℝ) = (73/15:ℝ) by norm_num] at htan + have hbYnode : bY (Branch.node [c1, c2, c3]) = 1 / (4 + S) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hbcc_node : bcc (Branch.node [c1, c2, c3]) = 3 := by simp [bcc] + have hrnode : ρwit (Branch.node [c1, c2, c3]) = (1/384) * (1 / (4 + S)) := by + rw [ρwit, hbcc_node, hbYnode]; norm_num + have hrnode_le : ρwit (Branch.node [c1, c2, c3]) ≤ (1/1664:ℝ) := by + rw [hrnode] + have hinv : 1 / (4 + S) ≤ (3/13:ℝ) := by + have h := one_div_le_one_div_of_le (show (0:ℝ) < (13/3:ℝ) by norm_num) + (show (13/3:ℝ) ≤ 4 + S by linarith) + rwa [show (1:ℝ)/(13/3:ℝ) = (3/13:ℝ) by norm_num] at h + have hinv_nn : (0:ℝ) ≤ 1 / (4 + S) := by positivity + nlinarith [hinv, hinv_nn] + -- correctly-signed atom (kL=+1); the `d4_235` in D4.lean has kL=-1 (loose, wrong sign to combine) + have henc : Real.log (73/60:ℝ) + (1 : ℤ) * Real.log (3/2) - (3 : ℤ) * FSTAR ≤ (49/4992:ℝ) := + tangent_atom (73/60:ℝ) (1) (3) (49/4992:ℝ) (by norm_num) (by norm_num) + have hrc1 : ρwit c1 = 2 * FSTAR - Real.log (3/2) + (1/4) * (bY c1 - 1/3) := by + simp only [ρwit, h1] + have hrc2 : ρwit c2 = (1/32) * bY c2 := by simp only [ρwit, h2] + have hrc3_nn : 0 ≤ ρwit c3 := ρwit_nonneg c3 + have hlogarg : (1:ℝ) + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1) = 1 + S / 4 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hrhs : (([c1, c2, c3]).map ρwit).sum = ρwit c1 + ρwit c2 + ρwit c3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, add_zero] + ring + rw [hlogarg, hrhs, hrc1, hrc2] + linarith [htan, hrnode_le, henc, hrc3_nn, hy3_hi, hS] + +/-- Cell `244` (uses `d4_244`). -/ +theorem subaction_deg4_244 (c1 c2 c3 : Branch) + (h1 : bcc c1 = 1) (h2 : bcc c2 = 3) (h3 : bcc c3 = 3) : + (Real.log (1 + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2, c3]) ≤ (([c1, c2, c3]).map ρwit).sum := by + have hy1_0 := bY_nonneg c1 + have hy2_0 := bY_nonneg c2 + have hy3_0 := bY_nonneg c3 + have hy1_lo : (1:ℝ)/3 ≤ bY c1 := bY_ge_third_of_bcc1 c1 h1 + have hy1_hi : bY c1 ≤ 1/2 := by + have h := bY_le_inv_deg c1; rw [h1] at h; norm_num at h; linarith + have hy2_hi : bY c2 ≤ (1/4:ℝ) := by + have h := bY_le_inv_deg c2; rw [h2] at h; norm_num at h; linarith + have hy3_hi : bY c3 ≤ (1/4:ℝ) := by + have h := bY_le_inv_deg c3; rw [h3] at h; norm_num at h; linarith + set S := bY c1 + bY c2 + bY c3 with hS + have hS0 : (0:ℝ) ≤ S := by rw [hS]; linarith + have hSmin : (1/3:ℝ) ≤ S := by rw [hS]; linarith + have hden : (0:ℝ) < 4 + S := by linarith + have htan := log_tangent (d := (4:ℝ)) (s := S) (s0 := (5/6:ℝ)) (by norm_num) hS0 (by norm_num) + rw [show (1:ℝ) + (5/6:ℝ)/4 = (29/24:ℝ) by norm_num, show (4:ℝ) + (5/6:ℝ) = (29/6:ℝ) by norm_num] at htan + have hbYnode : bY (Branch.node [c1, c2, c3]) = 1 / (4 + S) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hbcc_node : bcc (Branch.node [c1, c2, c3]) = 3 := by simp [bcc] + have hrnode : ρwit (Branch.node [c1, c2, c3]) = (1/384) * (1 / (4 + S)) := by + rw [ρwit, hbcc_node, hbYnode]; norm_num + have hrnode_le : ρwit (Branch.node [c1, c2, c3]) ≤ (1/1664:ℝ) := by + rw [hrnode] + have hinv : 1 / (4 + S) ≤ (3/13:ℝ) := by + have h := one_div_le_one_div_of_le (show (0:ℝ) < (13/3:ℝ) by norm_num) + (show (13/3:ℝ) ≤ 4 + S by linarith) + rwa [show (1:ℝ)/(13/3:ℝ) = (3/13:ℝ) by norm_num] at h + have hinv_nn : (0:ℝ) ≤ 1 / (4 + S) := by positivity + nlinarith [hinv, hinv_nn] + -- correctly-signed atom (kL=+1); the `d4_244` in D4.lean has kL=-1 (loose, wrong sign to combine) + have henc : Real.log (29/24:ℝ) + (1 : ℤ) * Real.log (3/2) - (3 : ℤ) * FSTAR ≤ (7/9984:ℝ) := + tangent_atom (29/24:ℝ) (1) (3) (7/9984:ℝ) (by norm_num) (by norm_num) + have hrc1 : ρwit c1 = 2 * FSTAR - Real.log (3/2) + (1/4) * (bY c1 - 1/3) := by + simp only [ρwit, h1] + have hrc2 : ρwit c2 = (1/384) * bY c2 := by simp only [ρwit, h2] + have hrc3 : ρwit c3 = (1/384) * bY c3 := by simp only [ρwit, h3] + have hlogarg : (1:ℝ) + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1) = 1 + S / 4 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hrhs : (([c1, c2, c3]).map ρwit).sum = ρwit c1 + ρwit c2 + ρwit c3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, add_zero] + ring + rw [hlogarg, hrhs, hrc1, hrc2, hrc3] + linarith [htan, hrnode_le, henc, hS] + +/-- Cell `24H` (uses `d4_245`). -/ +theorem subaction_deg4_24H (c1 c2 c3 : Branch) + (h1 : bcc c1 = 1) (h2 : bcc c2 = 3) (h3 : 4 ≤ bcc c3) : + (Real.log (1 + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2, c3]) ≤ (([c1, c2, c3]).map ρwit).sum := by + have hy1_0 := bY_nonneg c1 + have hy2_0 := bY_nonneg c2 + have hy3_0 := bY_nonneg c3 + have hy1_lo : (1:ℝ)/3 ≤ bY c1 := bY_ge_third_of_bcc1 c1 h1 + have hy1_hi : bY c1 ≤ 1/2 := by + have h := bY_le_inv_deg c1; rw [h1] at h; norm_num at h; linarith + have hy2_hi : bY c2 ≤ (1/4:ℝ) := by + have h := bY_le_inv_deg c2; rw [h2] at h; norm_num at h; linarith + have hy3_hi : bY c3 ≤ (1/5:ℝ) := by + have hbi := bY_le_inv_deg c3 + have hcast : (4:ℝ) ≤ (bcc c3 : ℝ) := by exact_mod_cast h3 + have hb2 : (1:ℝ) / ((bcc c3 : ℝ) + 1) ≤ 1/5 := one_div_le_one_div_of_le (by norm_num) (by linarith) + linarith + set S := bY c1 + bY c2 + bY c3 with hS + have hS0 : (0:ℝ) ≤ S := by rw [hS]; linarith + have hSmin : (1/3:ℝ) ≤ S := by rw [hS]; linarith + have hden : (0:ℝ) < 4 + S := by linarith + have htan := log_tangent (d := (4:ℝ)) (s := S) (s0 := (47/60:ℝ)) (by norm_num) hS0 (by norm_num) + rw [show (1:ℝ) + (47/60:ℝ)/4 = (287/240:ℝ) by norm_num, show (4:ℝ) + (47/60:ℝ) = (287/60:ℝ) by norm_num] at htan + have hbYnode : bY (Branch.node [c1, c2, c3]) = 1 / (4 + S) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hbcc_node : bcc (Branch.node [c1, c2, c3]) = 3 := by simp [bcc] + have hrnode : ρwit (Branch.node [c1, c2, c3]) = (1/384) * (1 / (4 + S)) := by + rw [ρwit, hbcc_node, hbYnode]; norm_num + have hrnode_le : ρwit (Branch.node [c1, c2, c3]) ≤ (1/1664:ℝ) := by + rw [hrnode] + have hinv : 1 / (4 + S) ≤ (3/13:ℝ) := by + have h := one_div_le_one_div_of_le (show (0:ℝ) < (13/3:ℝ) by norm_num) + (show (13/3:ℝ) ≤ 4 + S by linarith) + rwa [show (1:ℝ)/(13/3:ℝ) = (3/13:ℝ) by norm_num] at h + have hinv_nn : (0:ℝ) ≤ 1 / (4 + S) := by positivity + nlinarith [hinv, hinv_nn] + -- correctly-signed atom (kL=+1); the `d4_245` in D4.lean has kL=-1 (loose, wrong sign to combine) + have henc : Real.log (287/240:ℝ) + (1 : ℤ) * Real.log (3/2) - (3 : ℤ) * FSTAR ≤ (1/19968:ℝ) := + tangent_atom (287/240:ℝ) (1) (3) (1/19968:ℝ) (by norm_num) (by norm_num) + have hrc1 : ρwit c1 = 2 * FSTAR - Real.log (3/2) + (1/4) * (bY c1 - 1/3) := by + simp only [ρwit, h1] + have hrc2 : ρwit c2 = (1/384) * bY c2 := by simp only [ρwit, h2] + have hrc3_nn : 0 ≤ ρwit c3 := ρwit_nonneg c3 + have hlogarg : (1:ℝ) + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1) = 1 + S / 4 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hrhs : (([c1, c2, c3]).map ρwit).sum = ρwit c1 + ρwit c2 + ρwit c3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, add_zero] + ring + rw [hlogarg, hrhs, hrc1, hrc2] + linarith [htan, hrnode_le, henc, hrc3_nn, hy3_hi, hS] + +/-- Cell `2HH` (uses `d4_255`). -/ +theorem subaction_deg4_2HH (c1 c2 c3 : Branch) + (h1 : bcc c1 = 1) (h2 : 4 ≤ bcc c2) (h3 : 4 ≤ bcc c3) : + (Real.log (1 + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2, c3]) ≤ (([c1, c2, c3]).map ρwit).sum := by + have hy1_0 := bY_nonneg c1 + have hy2_0 := bY_nonneg c2 + have hy3_0 := bY_nonneg c3 + have hy1_lo : (1:ℝ)/3 ≤ bY c1 := bY_ge_third_of_bcc1 c1 h1 + have hy1_hi : bY c1 ≤ 1/2 := by + have h := bY_le_inv_deg c1; rw [h1] at h; norm_num at h; linarith + have hy2_hi : bY c2 ≤ (1/5:ℝ) := by + have hbi := bY_le_inv_deg c2 + have hcast : (4:ℝ) ≤ (bcc c2 : ℝ) := by exact_mod_cast h2 + have hb2 : (1:ℝ) / ((bcc c2 : ℝ) + 1) ≤ 1/5 := one_div_le_one_div_of_le (by norm_num) (by linarith) + linarith + have hy3_hi : bY c3 ≤ (1/5:ℝ) := by + have hbi := bY_le_inv_deg c3 + have hcast : (4:ℝ) ≤ (bcc c3 : ℝ) := by exact_mod_cast h3 + have hb2 : (1:ℝ) / ((bcc c3 : ℝ) + 1) ≤ 1/5 := one_div_le_one_div_of_le (by norm_num) (by linarith) + linarith + set S := bY c1 + bY c2 + bY c3 with hS + have hS0 : (0:ℝ) ≤ S := by rw [hS]; linarith + have hSmin : (1/3:ℝ) ≤ S := by rw [hS]; linarith + have hden : (0:ℝ) < 4 + S := by linarith + have htan := log_tangent (d := (4:ℝ)) (s := S) (s0 := (11/15:ℝ)) (by norm_num) hS0 (by norm_num) + rw [show (1:ℝ) + (11/15:ℝ)/4 = (71/60:ℝ) by norm_num, show (4:ℝ) + (11/15:ℝ) = (71/15:ℝ) by norm_num] at htan + have hbYnode : bY (Branch.node [c1, c2, c3]) = 1 / (4 + S) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hbcc_node : bcc (Branch.node [c1, c2, c3]) = 3 := by simp [bcc] + have hrnode : ρwit (Branch.node [c1, c2, c3]) = (1/384) * (1 / (4 + S)) := by + rw [ρwit, hbcc_node, hbYnode]; norm_num + have hrnode_le : ρwit (Branch.node [c1, c2, c3]) ≤ (1/1664:ℝ) := by + rw [hrnode] + have hinv : 1 / (4 + S) ≤ (3/13:ℝ) := by + have h := one_div_le_one_div_of_le (show (0:ℝ) < (13/3:ℝ) by norm_num) + (show (13/3:ℝ) ≤ 4 + S by linarith) + rwa [show (1:ℝ)/(13/3:ℝ) = (3/13:ℝ) by norm_num] at h + have hinv_nn : (0:ℝ) ≤ 1 / (4 + S) := by positivity + nlinarith [hinv, hinv_nn] + -- correctly-signed atom (kL=+1); the `d4_255` in D4.lean has kL=-1 (loose, wrong sign to combine) + have henc : Real.log (71/60:ℝ) + (1 : ℤ) * Real.log (3/2) - (3 : ℤ) * FSTAR ≤ (-1/1664:ℝ) := + tangent_atom (71/60:ℝ) (1) (3) (-1/1664:ℝ) (by norm_num) (by norm_num) + have hrc1 : ρwit c1 = 2 * FSTAR - Real.log (3/2) + (1/4) * (bY c1 - 1/3) := by + simp only [ρwit, h1] + have hrc2_nn : 0 ≤ ρwit c2 := ρwit_nonneg c2 + have hrc3_nn : 0 ≤ ρwit c3 := ρwit_nonneg c3 + have hlogarg : (1:ℝ) + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1) = 1 + S / 4 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hrhs : (([c1, c2, c3]).map ρwit).sum = ρwit c1 + ρwit c2 + ρwit c3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, add_zero] + ring + rw [hlogarg, hrhs, hrc1] + linarith [htan, hrnode_le, henc, hrc2_nn, hy2_hi, hrc3_nn, hy3_hi, hS] + +/-- Cell `333` (uses `d4_333`). -/ +theorem subaction_deg4_333 (c1 c2 c3 : Branch) + (h1 : bcc c1 = 2) (h2 : bcc c2 = 2) (h3 : bcc c3 = 2) : + (Real.log (1 + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2, c3]) ≤ (([c1, c2, c3]).map ρwit).sum := by + have hy1_0 := bY_nonneg c1 + have hy2_0 := bY_nonneg c2 + have hy3_0 := bY_nonneg c3 + have hy1_hi : bY c1 ≤ (1/3:ℝ) := by + have h := bY_le_inv_deg c1; rw [h1] at h; norm_num at h; linarith + have hy2_hi : bY c2 ≤ (1/3:ℝ) := by + have h := bY_le_inv_deg c2; rw [h2] at h; norm_num at h; linarith + have hy3_hi : bY c3 ≤ (1/3:ℝ) := by + have h := bY_le_inv_deg c3; rw [h3] at h; norm_num at h; linarith + set S := bY c1 + bY c2 + bY c3 with hS + have hS0 : (0:ℝ) ≤ S := by rw [hS]; linarith + have hSmin : (0:ℝ) ≤ S := by rw [hS]; linarith + have hden : (0:ℝ) < 4 + S := by linarith + have htan := log_tangent (d := (4:ℝ)) (s := S) (s0 := (1:ℝ)) (by norm_num) hS0 (by norm_num) + rw [show (1:ℝ) + (1:ℝ)/4 = (5/4:ℝ) by norm_num, show (4:ℝ) + (1:ℝ) = (5:ℝ) by norm_num] at htan + have hbYnode : bY (Branch.node [c1, c2, c3]) = 1 / (4 + S) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hbcc_node : bcc (Branch.node [c1, c2, c3]) = 3 := by simp [bcc] + have hrnode : ρwit (Branch.node [c1, c2, c3]) = (1/384) * (1 / (4 + S)) := by + rw [ρwit, hbcc_node, hbYnode]; norm_num + have hrnode_le : ρwit (Branch.node [c1, c2, c3]) ≤ (1/1536:ℝ) := by + rw [hrnode] + have hinv : 1 / (4 + S) ≤ (1/4:ℝ) := by + have h := one_div_le_one_div_of_le (show (0:ℝ) < (4:ℝ) by norm_num) + (show (4:ℝ) ≤ 4 + S by linarith) + rwa [show (1:ℝ)/(4:ℝ) = (1/4:ℝ) by norm_num] at h + have hinv_nn : (0:ℝ) ≤ 1 / (4 + S) := by positivity + nlinarith [hinv, hinv_nn] + have henc := d4_333 + have hrc1 : ρwit c1 = (1/32) * bY c1 := by simp only [ρwit, h1] + have hrc2 : ρwit c2 = (1/32) * bY c2 := by simp only [ρwit, h2] + have hrc3 : ρwit c3 = (1/32) * bY c3 := by simp only [ρwit, h3] + have hlogarg : (1:ℝ) + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1) = 1 + S / 4 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hrhs : (([c1, c2, c3]).map ρwit).sum = ρwit c1 + ρwit c2 + ρwit c3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, add_zero] + ring + rw [hlogarg, hrhs, hrc1, hrc2, hrc3] + linarith [htan, hrnode_le, henc, hS] + +/-- Cell `334` (uses `d4_334`). -/ +theorem subaction_deg4_334 (c1 c2 c3 : Branch) + (h1 : bcc c1 = 2) (h2 : bcc c2 = 2) (h3 : bcc c3 = 3) : + (Real.log (1 + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2, c3]) ≤ (([c1, c2, c3]).map ρwit).sum := by + have hy1_0 := bY_nonneg c1 + have hy2_0 := bY_nonneg c2 + have hy3_0 := bY_nonneg c3 + have hy1_hi : bY c1 ≤ (1/3:ℝ) := by + have h := bY_le_inv_deg c1; rw [h1] at h; norm_num at h; linarith + have hy2_hi : bY c2 ≤ (1/3:ℝ) := by + have h := bY_le_inv_deg c2; rw [h2] at h; norm_num at h; linarith + have hy3_hi : bY c3 ≤ (1/4:ℝ) := by + have h := bY_le_inv_deg c3; rw [h3] at h; norm_num at h; linarith + set S := bY c1 + bY c2 + bY c3 with hS + have hS0 : (0:ℝ) ≤ S := by rw [hS]; linarith + have hSmin : (0:ℝ) ≤ S := by rw [hS]; linarith + have hden : (0:ℝ) < 4 + S := by linarith + have htan := log_tangent (d := (4:ℝ)) (s := S) (s0 := (11/12:ℝ)) (by norm_num) hS0 (by norm_num) + rw [show (1:ℝ) + (11/12:ℝ)/4 = (59/48:ℝ) by norm_num, show (4:ℝ) + (11/12:ℝ) = (59/12:ℝ) by norm_num] at htan + have hbYnode : bY (Branch.node [c1, c2, c3]) = 1 / (4 + S) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hbcc_node : bcc (Branch.node [c1, c2, c3]) = 3 := by simp [bcc] + have hrnode : ρwit (Branch.node [c1, c2, c3]) = (1/384) * (1 / (4 + S)) := by + rw [ρwit, hbcc_node, hbYnode]; norm_num + have hrnode_le : ρwit (Branch.node [c1, c2, c3]) ≤ (1/1536:ℝ) := by + rw [hrnode] + have hinv : 1 / (4 + S) ≤ (1/4:ℝ) := by + have h := one_div_le_one_div_of_le (show (0:ℝ) < (4:ℝ) by norm_num) + (show (4:ℝ) ≤ 4 + S by linarith) + rwa [show (1:ℝ)/(4:ℝ) = (1/4:ℝ) by norm_num] at h + have hinv_nn : (0:ℝ) ≤ 1 / (4 + S) := by positivity + nlinarith [hinv, hinv_nn] + have henc := d4_334 + have hrc1 : ρwit c1 = (1/32) * bY c1 := by simp only [ρwit, h1] + have hrc2 : ρwit c2 = (1/32) * bY c2 := by simp only [ρwit, h2] + have hrc3 : ρwit c3 = (1/384) * bY c3 := by simp only [ρwit, h3] + have hlogarg : (1:ℝ) + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1) = 1 + S / 4 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hrhs : (([c1, c2, c3]).map ρwit).sum = ρwit c1 + ρwit c2 + ρwit c3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, add_zero] + ring + rw [hlogarg, hrhs, hrc1, hrc2, hrc3] + linarith [htan, hrnode_le, henc, hS] + +/-- Cell `33H` (uses `d4_335`). -/ +theorem subaction_deg4_33H (c1 c2 c3 : Branch) + (h1 : bcc c1 = 2) (h2 : bcc c2 = 2) (h3 : 4 ≤ bcc c3) : + (Real.log (1 + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2, c3]) ≤ (([c1, c2, c3]).map ρwit).sum := by + have hy1_0 := bY_nonneg c1 + have hy2_0 := bY_nonneg c2 + have hy3_0 := bY_nonneg c3 + have hy1_hi : bY c1 ≤ (1/3:ℝ) := by + have h := bY_le_inv_deg c1; rw [h1] at h; norm_num at h; linarith + have hy2_hi : bY c2 ≤ (1/3:ℝ) := by + have h := bY_le_inv_deg c2; rw [h2] at h; norm_num at h; linarith + have hy3_hi : bY c3 ≤ (1/5:ℝ) := by + have hbi := bY_le_inv_deg c3 + have hcast : (4:ℝ) ≤ (bcc c3 : ℝ) := by exact_mod_cast h3 + have hb2 : (1:ℝ) / ((bcc c3 : ℝ) + 1) ≤ 1/5 := one_div_le_one_div_of_le (by norm_num) (by linarith) + linarith + set S := bY c1 + bY c2 + bY c3 with hS + have hS0 : (0:ℝ) ≤ S := by rw [hS]; linarith + have hSmin : (0:ℝ) ≤ S := by rw [hS]; linarith + have hden : (0:ℝ) < 4 + S := by linarith + have htan := log_tangent (d := (4:ℝ)) (s := S) (s0 := (13/15:ℝ)) (by norm_num) hS0 (by norm_num) + rw [show (1:ℝ) + (13/15:ℝ)/4 = (73/60:ℝ) by norm_num, show (4:ℝ) + (13/15:ℝ) = (73/15:ℝ) by norm_num] at htan + have hbYnode : bY (Branch.node [c1, c2, c3]) = 1 / (4 + S) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hbcc_node : bcc (Branch.node [c1, c2, c3]) = 3 := by simp [bcc] + have hrnode : ρwit (Branch.node [c1, c2, c3]) = (1/384) * (1 / (4 + S)) := by + rw [ρwit, hbcc_node, hbYnode]; norm_num + have hrnode_le : ρwit (Branch.node [c1, c2, c3]) ≤ (1/1536:ℝ) := by + rw [hrnode] + have hinv : 1 / (4 + S) ≤ (1/4:ℝ) := by + have h := one_div_le_one_div_of_le (show (0:ℝ) < (4:ℝ) by norm_num) + (show (4:ℝ) ≤ 4 + S by linarith) + rwa [show (1:ℝ)/(4:ℝ) = (1/4:ℝ) by norm_num] at h + have hinv_nn : (0:ℝ) ≤ 1 / (4 + S) := by positivity + nlinarith [hinv, hinv_nn] + have henc := d4_335 + have hrc1 : ρwit c1 = (1/32) * bY c1 := by simp only [ρwit, h1] + have hrc2 : ρwit c2 = (1/32) * bY c2 := by simp only [ρwit, h2] + have hrc3_nn : 0 ≤ ρwit c3 := ρwit_nonneg c3 + have hlogarg : (1:ℝ) + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1) = 1 + S / 4 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hrhs : (([c1, c2, c3]).map ρwit).sum = ρwit c1 + ρwit c2 + ρwit c3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, add_zero] + ring + rw [hlogarg, hrhs, hrc1, hrc2] + linarith [htan, hrnode_le, henc, hrc3_nn, hy3_hi, hS] + +/-- Cell `344` (uses `d4_344`). -/ +theorem subaction_deg4_344 (c1 c2 c3 : Branch) + (h1 : bcc c1 = 2) (h2 : bcc c2 = 3) (h3 : bcc c3 = 3) : + (Real.log (1 + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2, c3]) ≤ (([c1, c2, c3]).map ρwit).sum := by + have hy1_0 := bY_nonneg c1 + have hy2_0 := bY_nonneg c2 + have hy3_0 := bY_nonneg c3 + have hy1_hi : bY c1 ≤ (1/3:ℝ) := by + have h := bY_le_inv_deg c1; rw [h1] at h; norm_num at h; linarith + have hy2_hi : bY c2 ≤ (1/4:ℝ) := by + have h := bY_le_inv_deg c2; rw [h2] at h; norm_num at h; linarith + have hy3_hi : bY c3 ≤ (1/4:ℝ) := by + have h := bY_le_inv_deg c3; rw [h3] at h; norm_num at h; linarith + set S := bY c1 + bY c2 + bY c3 with hS + have hS0 : (0:ℝ) ≤ S := by rw [hS]; linarith + have hSmin : (0:ℝ) ≤ S := by rw [hS]; linarith + have hden : (0:ℝ) < 4 + S := by linarith + have htan := log_tangent (d := (4:ℝ)) (s := S) (s0 := (5/6:ℝ)) (by norm_num) hS0 (by norm_num) + rw [show (1:ℝ) + (5/6:ℝ)/4 = (29/24:ℝ) by norm_num, show (4:ℝ) + (5/6:ℝ) = (29/6:ℝ) by norm_num] at htan + have hbYnode : bY (Branch.node [c1, c2, c3]) = 1 / (4 + S) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hbcc_node : bcc (Branch.node [c1, c2, c3]) = 3 := by simp [bcc] + have hrnode : ρwit (Branch.node [c1, c2, c3]) = (1/384) * (1 / (4 + S)) := by + rw [ρwit, hbcc_node, hbYnode]; norm_num + have hrnode_le : ρwit (Branch.node [c1, c2, c3]) ≤ (1/1536:ℝ) := by + rw [hrnode] + have hinv : 1 / (4 + S) ≤ (1/4:ℝ) := by + have h := one_div_le_one_div_of_le (show (0:ℝ) < (4:ℝ) by norm_num) + (show (4:ℝ) ≤ 4 + S by linarith) + rwa [show (1:ℝ)/(4:ℝ) = (1/4:ℝ) by norm_num] at h + have hinv_nn : (0:ℝ) ≤ 1 / (4 + S) := by positivity + nlinarith [hinv, hinv_nn] + have henc := d4_344 + have hrc1 : ρwit c1 = (1/32) * bY c1 := by simp only [ρwit, h1] + have hrc2 : ρwit c2 = (1/384) * bY c2 := by simp only [ρwit, h2] + have hrc3 : ρwit c3 = (1/384) * bY c3 := by simp only [ρwit, h3] + have hlogarg : (1:ℝ) + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1) = 1 + S / 4 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hrhs : (([c1, c2, c3]).map ρwit).sum = ρwit c1 + ρwit c2 + ρwit c3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, add_zero] + ring + rw [hlogarg, hrhs, hrc1, hrc2, hrc3] + linarith [htan, hrnode_le, henc, hS] + +/-- Cell `34H` (uses `d4_345`). -/ +theorem subaction_deg4_34H (c1 c2 c3 : Branch) + (h1 : bcc c1 = 2) (h2 : bcc c2 = 3) (h3 : 4 ≤ bcc c3) : + (Real.log (1 + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2, c3]) ≤ (([c1, c2, c3]).map ρwit).sum := by + have hy1_0 := bY_nonneg c1 + have hy2_0 := bY_nonneg c2 + have hy3_0 := bY_nonneg c3 + have hy1_hi : bY c1 ≤ (1/3:ℝ) := by + have h := bY_le_inv_deg c1; rw [h1] at h; norm_num at h; linarith + have hy2_hi : bY c2 ≤ (1/4:ℝ) := by + have h := bY_le_inv_deg c2; rw [h2] at h; norm_num at h; linarith + have hy3_hi : bY c3 ≤ (1/5:ℝ) := by + have hbi := bY_le_inv_deg c3 + have hcast : (4:ℝ) ≤ (bcc c3 : ℝ) := by exact_mod_cast h3 + have hb2 : (1:ℝ) / ((bcc c3 : ℝ) + 1) ≤ 1/5 := one_div_le_one_div_of_le (by norm_num) (by linarith) + linarith + set S := bY c1 + bY c2 + bY c3 with hS + have hS0 : (0:ℝ) ≤ S := by rw [hS]; linarith + have hSmin : (0:ℝ) ≤ S := by rw [hS]; linarith + have hden : (0:ℝ) < 4 + S := by linarith + have htan := log_tangent (d := (4:ℝ)) (s := S) (s0 := (47/60:ℝ)) (by norm_num) hS0 (by norm_num) + rw [show (1:ℝ) + (47/60:ℝ)/4 = (287/240:ℝ) by norm_num, show (4:ℝ) + (47/60:ℝ) = (287/60:ℝ) by norm_num] at htan + have hbYnode : bY (Branch.node [c1, c2, c3]) = 1 / (4 + S) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hbcc_node : bcc (Branch.node [c1, c2, c3]) = 3 := by simp [bcc] + have hrnode : ρwit (Branch.node [c1, c2, c3]) = (1/384) * (1 / (4 + S)) := by + rw [ρwit, hbcc_node, hbYnode]; norm_num + have hrnode_le : ρwit (Branch.node [c1, c2, c3]) ≤ (1/1536:ℝ) := by + rw [hrnode] + have hinv : 1 / (4 + S) ≤ (1/4:ℝ) := by + have h := one_div_le_one_div_of_le (show (0:ℝ) < (4:ℝ) by norm_num) + (show (4:ℝ) ≤ 4 + S by linarith) + rwa [show (1:ℝ)/(4:ℝ) = (1/4:ℝ) by norm_num] at h + have hinv_nn : (0:ℝ) ≤ 1 / (4 + S) := by positivity + nlinarith [hinv, hinv_nn] + have henc := d4_345 + have hrc1 : ρwit c1 = (1/32) * bY c1 := by simp only [ρwit, h1] + have hrc2 : ρwit c2 = (1/384) * bY c2 := by simp only [ρwit, h2] + have hrc3_nn : 0 ≤ ρwit c3 := ρwit_nonneg c3 + have hlogarg : (1:ℝ) + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1) = 1 + S / 4 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hrhs : (([c1, c2, c3]).map ρwit).sum = ρwit c1 + ρwit c2 + ρwit c3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, add_zero] + ring + rw [hlogarg, hrhs, hrc1, hrc2] + linarith [htan, hrnode_le, henc, hrc3_nn, hy3_hi, hS] + +/-- Cell `3HH` (uses `d4_355`). -/ +theorem subaction_deg4_3HH (c1 c2 c3 : Branch) + (h1 : bcc c1 = 2) (h2 : 4 ≤ bcc c2) (h3 : 4 ≤ bcc c3) : + (Real.log (1 + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2, c3]) ≤ (([c1, c2, c3]).map ρwit).sum := by + have hy1_0 := bY_nonneg c1 + have hy2_0 := bY_nonneg c2 + have hy3_0 := bY_nonneg c3 + have hy1_hi : bY c1 ≤ (1/3:ℝ) := by + have h := bY_le_inv_deg c1; rw [h1] at h; norm_num at h; linarith + have hy2_hi : bY c2 ≤ (1/5:ℝ) := by + have hbi := bY_le_inv_deg c2 + have hcast : (4:ℝ) ≤ (bcc c2 : ℝ) := by exact_mod_cast h2 + have hb2 : (1:ℝ) / ((bcc c2 : ℝ) + 1) ≤ 1/5 := one_div_le_one_div_of_le (by norm_num) (by linarith) + linarith + have hy3_hi : bY c3 ≤ (1/5:ℝ) := by + have hbi := bY_le_inv_deg c3 + have hcast : (4:ℝ) ≤ (bcc c3 : ℝ) := by exact_mod_cast h3 + have hb2 : (1:ℝ) / ((bcc c3 : ℝ) + 1) ≤ 1/5 := one_div_le_one_div_of_le (by norm_num) (by linarith) + linarith + set S := bY c1 + bY c2 + bY c3 with hS + have hS0 : (0:ℝ) ≤ S := by rw [hS]; linarith + have hSmin : (0:ℝ) ≤ S := by rw [hS]; linarith + have hden : (0:ℝ) < 4 + S := by linarith + have htan := log_tangent (d := (4:ℝ)) (s := S) (s0 := (11/15:ℝ)) (by norm_num) hS0 (by norm_num) + rw [show (1:ℝ) + (11/15:ℝ)/4 = (71/60:ℝ) by norm_num, show (4:ℝ) + (11/15:ℝ) = (71/15:ℝ) by norm_num] at htan + have hbYnode : bY (Branch.node [c1, c2, c3]) = 1 / (4 + S) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hbcc_node : bcc (Branch.node [c1, c2, c3]) = 3 := by simp [bcc] + have hrnode : ρwit (Branch.node [c1, c2, c3]) = (1/384) * (1 / (4 + S)) := by + rw [ρwit, hbcc_node, hbYnode]; norm_num + have hrnode_le : ρwit (Branch.node [c1, c2, c3]) ≤ (1/1536:ℝ) := by + rw [hrnode] + have hinv : 1 / (4 + S) ≤ (1/4:ℝ) := by + have h := one_div_le_one_div_of_le (show (0:ℝ) < (4:ℝ) by norm_num) + (show (4:ℝ) ≤ 4 + S by linarith) + rwa [show (1:ℝ)/(4:ℝ) = (1/4:ℝ) by norm_num] at h + have hinv_nn : (0:ℝ) ≤ 1 / (4 + S) := by positivity + nlinarith [hinv, hinv_nn] + have henc := d4_355 + have hrc1 : ρwit c1 = (1/32) * bY c1 := by simp only [ρwit, h1] + have hrc2_nn : 0 ≤ ρwit c2 := ρwit_nonneg c2 + have hrc3_nn : 0 ≤ ρwit c3 := ρwit_nonneg c3 + have hlogarg : (1:ℝ) + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1) = 1 + S / 4 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hrhs : (([c1, c2, c3]).map ρwit).sum = ρwit c1 + ρwit c2 + ρwit c3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, add_zero] + ring + rw [hlogarg, hrhs, hrc1] + linarith [htan, hrnode_le, henc, hrc2_nn, hy2_hi, hrc3_nn, hy3_hi, hS] + +/-- Cell `444` (uses `d4_444`). -/ +theorem subaction_deg4_444 (c1 c2 c3 : Branch) + (h1 : bcc c1 = 3) (h2 : bcc c2 = 3) (h3 : bcc c3 = 3) : + (Real.log (1 + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2, c3]) ≤ (([c1, c2, c3]).map ρwit).sum := by + have hy1_0 := bY_nonneg c1 + have hy2_0 := bY_nonneg c2 + have hy3_0 := bY_nonneg c3 + have hy1_hi : bY c1 ≤ (1/4:ℝ) := by + have h := bY_le_inv_deg c1; rw [h1] at h; norm_num at h; linarith + have hy2_hi : bY c2 ≤ (1/4:ℝ) := by + have h := bY_le_inv_deg c2; rw [h2] at h; norm_num at h; linarith + have hy3_hi : bY c3 ≤ (1/4:ℝ) := by + have h := bY_le_inv_deg c3; rw [h3] at h; norm_num at h; linarith + set S := bY c1 + bY c2 + bY c3 with hS + have hS0 : (0:ℝ) ≤ S := by rw [hS]; linarith + have hSmin : (0:ℝ) ≤ S := by rw [hS]; linarith + have hden : (0:ℝ) < 4 + S := by linarith + have htan := log_tangent (d := (4:ℝ)) (s := S) (s0 := (3/4:ℝ)) (by norm_num) hS0 (by norm_num) + rw [show (1:ℝ) + (3/4:ℝ)/4 = (19/16:ℝ) by norm_num, show (4:ℝ) + (3/4:ℝ) = (19/4:ℝ) by norm_num] at htan + have hbYnode : bY (Branch.node [c1, c2, c3]) = 1 / (4 + S) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hbcc_node : bcc (Branch.node [c1, c2, c3]) = 3 := by simp [bcc] + have hrnode : ρwit (Branch.node [c1, c2, c3]) = (1/384) * (1 / (4 + S)) := by + rw [ρwit, hbcc_node, hbYnode]; norm_num + have hrnode_le : ρwit (Branch.node [c1, c2, c3]) ≤ (1/1536:ℝ) := by + rw [hrnode] + have hinv : 1 / (4 + S) ≤ (1/4:ℝ) := by + have h := one_div_le_one_div_of_le (show (0:ℝ) < (4:ℝ) by norm_num) + (show (4:ℝ) ≤ 4 + S by linarith) + rwa [show (1:ℝ)/(4:ℝ) = (1/4:ℝ) by norm_num] at h + have hinv_nn : (0:ℝ) ≤ 1 / (4 + S) := by positivity + nlinarith [hinv, hinv_nn] + have henc := d4_444 + have hrc1 : ρwit c1 = (1/384) * bY c1 := by simp only [ρwit, h1] + have hrc2 : ρwit c2 = (1/384) * bY c2 := by simp only [ρwit, h2] + have hrc3 : ρwit c3 = (1/384) * bY c3 := by simp only [ρwit, h3] + have hlogarg : (1:ℝ) + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1) = 1 + S / 4 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hrhs : (([c1, c2, c3]).map ρwit).sum = ρwit c1 + ρwit c2 + ρwit c3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, add_zero] + ring + rw [hlogarg, hrhs, hrc1, hrc2, hrc3] + linarith [htan, hrnode_le, henc, hS] + +/-- Cell `44H` (uses `d4_445`). -/ +theorem subaction_deg4_44H (c1 c2 c3 : Branch) + (h1 : bcc c1 = 3) (h2 : bcc c2 = 3) (h3 : 4 ≤ bcc c3) : + (Real.log (1 + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2, c3]) ≤ (([c1, c2, c3]).map ρwit).sum := by + have hy1_0 := bY_nonneg c1 + have hy2_0 := bY_nonneg c2 + have hy3_0 := bY_nonneg c3 + have hy1_hi : bY c1 ≤ (1/4:ℝ) := by + have h := bY_le_inv_deg c1; rw [h1] at h; norm_num at h; linarith + have hy2_hi : bY c2 ≤ (1/4:ℝ) := by + have h := bY_le_inv_deg c2; rw [h2] at h; norm_num at h; linarith + have hy3_hi : bY c3 ≤ (1/5:ℝ) := by + have hbi := bY_le_inv_deg c3 + have hcast : (4:ℝ) ≤ (bcc c3 : ℝ) := by exact_mod_cast h3 + have hb2 : (1:ℝ) / ((bcc c3 : ℝ) + 1) ≤ 1/5 := one_div_le_one_div_of_le (by norm_num) (by linarith) + linarith + set S := bY c1 + bY c2 + bY c3 with hS + have hS0 : (0:ℝ) ≤ S := by rw [hS]; linarith + have hSmin : (0:ℝ) ≤ S := by rw [hS]; linarith + have hden : (0:ℝ) < 4 + S := by linarith + have htan := log_tangent (d := (4:ℝ)) (s := S) (s0 := (7/10:ℝ)) (by norm_num) hS0 (by norm_num) + rw [show (1:ℝ) + (7/10:ℝ)/4 = (47/40:ℝ) by norm_num, show (4:ℝ) + (7/10:ℝ) = (47/10:ℝ) by norm_num] at htan + have hbYnode : bY (Branch.node [c1, c2, c3]) = 1 / (4 + S) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hbcc_node : bcc (Branch.node [c1, c2, c3]) = 3 := by simp [bcc] + have hrnode : ρwit (Branch.node [c1, c2, c3]) = (1/384) * (1 / (4 + S)) := by + rw [ρwit, hbcc_node, hbYnode]; norm_num + have hrnode_le : ρwit (Branch.node [c1, c2, c3]) ≤ (1/1536:ℝ) := by + rw [hrnode] + have hinv : 1 / (4 + S) ≤ (1/4:ℝ) := by + have h := one_div_le_one_div_of_le (show (0:ℝ) < (4:ℝ) by norm_num) + (show (4:ℝ) ≤ 4 + S by linarith) + rwa [show (1:ℝ)/(4:ℝ) = (1/4:ℝ) by norm_num] at h + have hinv_nn : (0:ℝ) ≤ 1 / (4 + S) := by positivity + nlinarith [hinv, hinv_nn] + have henc := d4_445 + have hrc1 : ρwit c1 = (1/384) * bY c1 := by simp only [ρwit, h1] + have hrc2 : ρwit c2 = (1/384) * bY c2 := by simp only [ρwit, h2] + have hrc3_nn : 0 ≤ ρwit c3 := ρwit_nonneg c3 + have hlogarg : (1:ℝ) + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1) = 1 + S / 4 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hrhs : (([c1, c2, c3]).map ρwit).sum = ρwit c1 + ρwit c2 + ρwit c3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, add_zero] + ring + rw [hlogarg, hrhs, hrc1, hrc2] + linarith [htan, hrnode_le, henc, hrc3_nn, hy3_hi, hS] + +/-- Cell `4HH` (uses `d4_455`). -/ +theorem subaction_deg4_4HH (c1 c2 c3 : Branch) + (h1 : bcc c1 = 3) (h2 : 4 ≤ bcc c2) (h3 : 4 ≤ bcc c3) : + (Real.log (1 + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2, c3]) ≤ (([c1, c2, c3]).map ρwit).sum := by + have hy1_0 := bY_nonneg c1 + have hy2_0 := bY_nonneg c2 + have hy3_0 := bY_nonneg c3 + have hy1_hi : bY c1 ≤ (1/4:ℝ) := by + have h := bY_le_inv_deg c1; rw [h1] at h; norm_num at h; linarith + have hy2_hi : bY c2 ≤ (1/5:ℝ) := by + have hbi := bY_le_inv_deg c2 + have hcast : (4:ℝ) ≤ (bcc c2 : ℝ) := by exact_mod_cast h2 + have hb2 : (1:ℝ) / ((bcc c2 : ℝ) + 1) ≤ 1/5 := one_div_le_one_div_of_le (by norm_num) (by linarith) + linarith + have hy3_hi : bY c3 ≤ (1/5:ℝ) := by + have hbi := bY_le_inv_deg c3 + have hcast : (4:ℝ) ≤ (bcc c3 : ℝ) := by exact_mod_cast h3 + have hb2 : (1:ℝ) / ((bcc c3 : ℝ) + 1) ≤ 1/5 := one_div_le_one_div_of_le (by norm_num) (by linarith) + linarith + set S := bY c1 + bY c2 + bY c3 with hS + have hS0 : (0:ℝ) ≤ S := by rw [hS]; linarith + have hSmin : (0:ℝ) ≤ S := by rw [hS]; linarith + have hden : (0:ℝ) < 4 + S := by linarith + have htan := log_tangent (d := (4:ℝ)) (s := S) (s0 := (13/20:ℝ)) (by norm_num) hS0 (by norm_num) + rw [show (1:ℝ) + (13/20:ℝ)/4 = (93/80:ℝ) by norm_num, show (4:ℝ) + (13/20:ℝ) = (93/20:ℝ) by norm_num] at htan + have hbYnode : bY (Branch.node [c1, c2, c3]) = 1 / (4 + S) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hbcc_node : bcc (Branch.node [c1, c2, c3]) = 3 := by simp [bcc] + have hrnode : ρwit (Branch.node [c1, c2, c3]) = (1/384) * (1 / (4 + S)) := by + rw [ρwit, hbcc_node, hbYnode]; norm_num + have hrnode_le : ρwit (Branch.node [c1, c2, c3]) ≤ (1/1536:ℝ) := by + rw [hrnode] + have hinv : 1 / (4 + S) ≤ (1/4:ℝ) := by + have h := one_div_le_one_div_of_le (show (0:ℝ) < (4:ℝ) by norm_num) + (show (4:ℝ) ≤ 4 + S by linarith) + rwa [show (1:ℝ)/(4:ℝ) = (1/4:ℝ) by norm_num] at h + have hinv_nn : (0:ℝ) ≤ 1 / (4 + S) := by positivity + nlinarith [hinv, hinv_nn] + have henc := d4_455 + have hrc1 : ρwit c1 = (1/384) * bY c1 := by simp only [ρwit, h1] + have hrc2_nn : 0 ≤ ρwit c2 := ρwit_nonneg c2 + have hrc3_nn : 0 ≤ ρwit c3 := ρwit_nonneg c3 + have hlogarg : (1:ℝ) + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1) = 1 + S / 4 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hrhs : (([c1, c2, c3]).map ρwit).sum = ρwit c1 + ρwit c2 + ρwit c3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, add_zero] + ring + rw [hlogarg, hrhs, hrc1] + linarith [htan, hrnode_le, henc, hrc2_nn, hy2_hi, hrc3_nn, hy3_hi, hS] + +/-- Cell `HHH` (uses `d4_555`). -/ +theorem subaction_deg4_HHH (c1 c2 c3 : Branch) + (h1 : 4 ≤ bcc c1) (h2 : 4 ≤ bcc c2) (h3 : 4 ≤ bcc c3) : + (Real.log (1 + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2, c3]) ≤ (([c1, c2, c3]).map ρwit).sum := by + have hy1_0 := bY_nonneg c1 + have hy2_0 := bY_nonneg c2 + have hy3_0 := bY_nonneg c3 + have hy1_hi : bY c1 ≤ (1/5:ℝ) := by + have hbi := bY_le_inv_deg c1 + have hcast : (4:ℝ) ≤ (bcc c1 : ℝ) := by exact_mod_cast h1 + have hb2 : (1:ℝ) / ((bcc c1 : ℝ) + 1) ≤ 1/5 := one_div_le_one_div_of_le (by norm_num) (by linarith) + linarith + have hy2_hi : bY c2 ≤ (1/5:ℝ) := by + have hbi := bY_le_inv_deg c2 + have hcast : (4:ℝ) ≤ (bcc c2 : ℝ) := by exact_mod_cast h2 + have hb2 : (1:ℝ) / ((bcc c2 : ℝ) + 1) ≤ 1/5 := one_div_le_one_div_of_le (by norm_num) (by linarith) + linarith + have hy3_hi : bY c3 ≤ (1/5:ℝ) := by + have hbi := bY_le_inv_deg c3 + have hcast : (4:ℝ) ≤ (bcc c3 : ℝ) := by exact_mod_cast h3 + have hb2 : (1:ℝ) / ((bcc c3 : ℝ) + 1) ≤ 1/5 := one_div_le_one_div_of_le (by norm_num) (by linarith) + linarith + set S := bY c1 + bY c2 + bY c3 with hS + have hS0 : (0:ℝ) ≤ S := by rw [hS]; linarith + have hSmin : (0:ℝ) ≤ S := by rw [hS]; linarith + have hden : (0:ℝ) < 4 + S := by linarith + have htan := log_tangent (d := (4:ℝ)) (s := S) (s0 := (3/5:ℝ)) (by norm_num) hS0 (by norm_num) + rw [show (1:ℝ) + (3/5:ℝ)/4 = (23/20:ℝ) by norm_num, show (4:ℝ) + (3/5:ℝ) = (23/5:ℝ) by norm_num] at htan + have hbYnode : bY (Branch.node [c1, c2, c3]) = 1 / (4 + S) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hbcc_node : bcc (Branch.node [c1, c2, c3]) = 3 := by simp [bcc] + have hrnode : ρwit (Branch.node [c1, c2, c3]) = (1/384) * (1 / (4 + S)) := by + rw [ρwit, hbcc_node, hbYnode]; norm_num + have hrnode_le : ρwit (Branch.node [c1, c2, c3]) ≤ (1/1536:ℝ) := by + rw [hrnode] + have hinv : 1 / (4 + S) ≤ (1/4:ℝ) := by + have h := one_div_le_one_div_of_le (show (0:ℝ) < (4:ℝ) by norm_num) + (show (4:ℝ) ≤ 4 + S by linarith) + rwa [show (1:ℝ)/(4:ℝ) = (1/4:ℝ) by norm_num] at h + have hinv_nn : (0:ℝ) ≤ 1 / (4 + S) := by positivity + nlinarith [hinv, hinv_nn] + have henc := d4_555 + have hrc1_nn : 0 ≤ ρwit c1 := ρwit_nonneg c1 + have hrc2_nn : 0 ≤ ρwit c2 := ρwit_nonneg c2 + have hrc3_nn : 0 ≤ ρwit c3 := ρwit_nonneg c3 + have hlogarg : (1:ℝ) + (([c1, c2, c3]).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1) = 1 + S / 4 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring + have hrhs : (([c1, c2, c3]).map ρwit).sum = ρwit c1 + ρwit c2 + ρwit c3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, add_zero] + ring + rw [hlogarg, hrhs] + linarith [htan, hrnode_le, henc, hrc1_nn, hy1_hi, hrc2_nn, hy2_hi, hrc3_nn, hy3_hi, hS] +end BGSCL +end R3Cert diff --git a/proof/formalization/R3Cert/BGSCLSubactionDeg3.lean b/proof/formalization/R3Cert/BGSCLSubactionDeg3.lean new file mode 100644 index 00000000..1db460e1 --- /dev/null +++ b/proof/formalization/R3Cert/BGSCLSubactionDeg3.lean @@ -0,0 +1,150 @@ +/- + The first genuine MULTI-CHILD SUBACTION cell with high-degree children (2026-09-03). + + Companion to `BGSCLSubaction`. It discharges the first degree-3 SUBACTION cell whose BOTH children carry a + free (non-pinned) message: a degree-3 hub (`node [c1, c2]`) whose two children are each degree ≥ 3 + (`bcc cᵢ ≥ 2`, so `bY cᵢ ∈ [0, 1/3]`). Unlike the broom (`subaction_broom_d3`, both children leaves, messages + pinned to 1) this cell requires the concave-log DECOUPLE across a free two-variable message box, collapsed to + the aggregate endpoint `S = bY c1 + bY c2 = 2/3` by `log_tangent`, plus a per-child ρ-lower-bound that turns + the linearized slope term `(3/11)(S − 2/3)` into `Σ_c ρwit c`. + + * `log119_sub_fstar` — the enclosure atom `log(11/9) − F* ≤ −1/200` (Telperion-generated). + * `rhowit_ge_perchild` — per-child ρ lower bound: `(3/11)(bY c − 1/3) + 13/4800 ≤ ρwit c` for `bcc c ≥ 2`. + * `subaction_deg3_highchildren` — the cell: `(log(1 + S/3) − F*) + ρwit(node [c1,c2]) ≤ Σ ρwit cᵢ`. + + Kernel-checked, no `sorry`. `conjecture1_proved = False`. +-/ +import Mathlib +import R3Cert.BGSCLInduction +import R3Cert.BGSCLSubaction + +namespace R3Cert +namespace BGSCL + +open Real + +/-- **The enclosure atom** `log(11/9) − F* ≤ −1/200`, via `log x ≤ x − 1` at + `x = (11/9)¹¹·(64/621) ≈ 0.945`, F*-folded (Telperion-generated). -/ +theorem log119_sub_fstar : Real.log (11/9 : ℝ) - (FSTAR : ℝ) ≤ (-1/200 : ℝ) := by + rw [FSTAR] + have hpos : (0 : ℝ) < (11/9 : ℝ) ^ (11 : ℕ) * (64/621) := by positivity + have hr := Real.log_le_sub_one_of_pos hpos + have hsplit : Real.log ((11/9 : ℝ) ^ (11 : ℕ) * (64/621)) + = 11 * Real.log (11/9 : ℝ) - Real.log (621/64 : ℝ) := by + rw [Real.log_mul (by positivity) (by norm_num), Real.log_pow, + show (64/621 : ℝ) = (621/64 : ℝ)⁻¹ by norm_num, Real.log_inv] + push_cast; ring + rw [hsplit] at hr + have hnum : (11/9 : ℝ) ^ (11 : ℕ) * (64/621) - 1 ≤ -11/200 := by norm_num + linarith + +/-- **Per-child ρ-lower-bound.** For any child `c` of degree ≥ 3 (`bcc c ≥ 2`, so `bY c ≤ 1/3`), the witness + `ρwit c` dominates the affine slope line `(3/11)(bY c − 1/3) + 13/4800`. This is what turns the decoupled + slope term into `Σ_c ρwit c` in the cell. Case split on degree 3 / 4 / ≥5: + * deg-3 (`ρwit = bY/32`): worst at `bY = 1/3`, margin `+0.0077`. + * deg-4 (`ρwit = bY/384 ≥ 0`): RHS `< 0` since `bY ≤ 1/4`. + * deg≥5 (`ρwit = 0`): RHS `< 0` since `bY ≤ 1/5`. -/ +theorem rhowit_ge_perchild (c : Branch) (hc : 2 ≤ bcc c) : + (3/11) * (bY c - 1/3) + 13/4800 ≤ ρwit c := by + have hy := bY_le_inv_deg c + have hy0 := bY_nonneg c + rcases (show bcc c = 2 ∨ bcc c = 3 ∨ 4 ≤ bcc c by omega) with h | h | h + · -- deg-3: ρwit = (1/32) * bY c, bY c ≤ 1/3 + have hyle : bY c ≤ 1/3 := by rw [h] at hy; norm_num at hy; linarith + simp only [ρwit, h] + linarith + · -- deg-4: ρwit = (1/384) * bY c ≥ 0, RHS < 0 (bY c ≤ 1/4) + have hyle : bY c ≤ 1/4 := by rw [h] at hy; norm_num at hy; linarith + simp only [ρwit, h] + nlinarith [hy0] + · -- deg≥5: ρwit = 0, RHS < 0 (bY c ≤ 1/5) + have hyle : bY c ≤ 1/5 := by + have hcast : (4:ℝ) ≤ (bcc c : ℝ) := by exact_mod_cast h + have h2 : (1:ℝ) / ((bcc c : ℝ) + 1) ≤ 1/5 := + one_div_le_one_div_of_le (by norm_num) (by linarith) + linarith + have hrc : ρwit c = 0 := by + rw [ρwit] + rcases hbc : bcc c with _ | _ | _ | _ | n + · exact absurd hbc (by omega) + · exact absurd hbc (by omega) + · exact absurd hbc (by omega) + · exact absurd hbc (by omega) + · rfl + rw [hrc]; linarith + +/-- **The first genuine multi-child high-degree SUBACTION cell** (degree-3 hub, two degree-≥3 children). The + subaction inequality `(SUB)` at a degree-3 vertex (`node [c1, c2]`, `ρwit(node) = bY(node)/32`) whose two + children each carry a free message `bY cᵢ ∈ [0, 1/3]`: `(log(1 + S/3) − F*) + ρwit(node) ≤ ρwit c1 + ρwit c2`, + `S = bY c1 + bY c2`. Discharged by: (1) the concave-log DECOUPLE (`log_tangent`) collapsing the free + two-variable message box to the aggregate endpoint `S = 2/3`, giving the slope line `log(11/9) + (3/11)(S−2/3)`; + (2) the node-ρ bound `ρwit(node) = 1/(32(3+S)) ≤ 1/96`; (3) the enclosure `log(11/9) − F* ≤ −1/200`; + (4) the two per-child ρ-lower-bounds `rhowit_ge_perchild`. Tightest margin `+0.0077` at the all-deg-3 + corner `bY = 1/3`. Kernel-checked, no `sorry`. -/ +theorem subaction_deg3_highchildren (c1 c2 : Branch) (h1 : 2 ≤ bcc c1) (h2 : 2 ≤ bcc c2) : + (Real.log (1 + (([c1, c2]).map bY).sum + / ((([c1, c2] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2]) ≤ (([c1, c2]).map ρwit).sum := by + -- child message bounds + have hy1_0 := bY_nonneg c1 + have hy2_0 := bY_nonneg c2 + have hy1 : bY c1 ≤ 1/3 := by + have hy := bY_le_inv_deg c1 + have hcast : (2:ℝ) ≤ (bcc c1 : ℝ) := by exact_mod_cast h1 + have hle : (1:ℝ) / ((bcc c1 : ℝ) + 1) ≤ 1/3 := one_div_le_one_div_of_le (by norm_num) (by linarith) + linarith + have hy2 : bY c2 ≤ 1/3 := by + have hy := bY_le_inv_deg c2 + have hcast : (2:ℝ) ≤ (bcc c2 : ℝ) := by exact_mod_cast h2 + have hle : (1:ℝ) / ((bcc c2 : ℝ) + 1) ≤ 1/3 := one_div_le_one_div_of_le (by norm_num) (by linarith) + linarith + set S := bY c1 + bY c2 with hS + have hS0 : (0:ℝ) ≤ S := by rw [hS]; linarith + have hSle : S ≤ 2/3 := by rw [hS]; linarith + have hden : (0:ℝ) < 3 + S := by linarith + -- (1) decouple: log(1 + S/3) ≤ log(11/9) + (S − 2/3)/(11/3) = log(11/9) + (3/11)(S − 2/3) + have htan := log_tangent (d := (3:ℝ)) (s := S) (s0 := (2:ℝ)/3) + (by norm_num) hS0 (by norm_num) + rw [show (1:ℝ) + (2/3)/3 = 11/9 by norm_num, show (3:ℝ) + 2/3 = 11/3 by norm_num] at htan + -- (2) node-ρ bound: ρwit(node [c1,c2]) = (1/32) * bY(node) = 1/(32(3+S)) ≤ 1/96 + have hbYnode : bY (Branch.node [c1, c2]) = 1 / (3 + S) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring_nf + have hbcc_node : bcc (Branch.node [c1, c2]) = 2 := by simp [bcc] + have hrnode : ρwit (Branch.node [c1, c2]) = (1/32) * (1 / (3 + S)) := by + rw [ρwit, hbcc_node, hbYnode] + norm_num + have hrnode_le : ρwit (Branch.node [c1, c2]) ≤ 1/96 := by + rw [hrnode] + have hinv : 1 / (3 + S) ≤ 1 / 3 := one_div_le_one_div_of_le (by norm_num) (by linarith) + have hinv_nn : (0:ℝ) ≤ 1 / (3 + S) := by positivity + nlinarith [hinv, hinv_nn] + -- (3) enclosure + have henc := log119_sub_fstar + -- (4) per-child lower bounds + have hpc1 := rhowit_ge_perchild c1 h1 + have hpc2 := rhowit_ge_perchild c2 h2 + -- assemble: simplify the goal's log-arg and RHS + have hlogarg : (1:ℝ) + (([c1, c2]).map bY).sum + / ((([c1, c2] : List Branch).length : ℝ) + 1) = 1 + S / 3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; norm_num + have hrhs : (([c1, c2]).map ρwit).sum = ρwit c1 + ρwit c2 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, add_zero] + rw [hlogarg, hrhs] + -- htan : log(1 + S/3) ≤ log(11/9) + (S − 2/3)/(11/3) + -- Combine: LHS ≤ [log(11/9) − F* + (3/11)(S−2/3)] + 1/96 + -- ≤ [−1/200 + (3/11)(S−2/3)] + 1/96 + -- = (3/11)((bY c1 − 1/3) + (bY c2 − 1/3)) + (1/96 − 1/200) + -- with 1/96 − 1/200 = 13/2400 = 2·(13/4800), split equally between the two per-child bounds. + have hslope : (S - 2/3)/(11/3) = (3/11) * (bY c1 - 1/3) + (3/11) * (bY c2 - 1/3) := by + rw [hS]; ring + linarith [htan, hrnode_le, henc, hpc1, hpc2, hslope] + +end BGSCL +end R3Cert + +-- #print axioms R3Cert.BGSCL.subaction_deg3_highchildren diff --git a/proof/formalization/R3Cert/BGSCLSubactionDeg3Mid.lean b/proof/formalization/R3Cert/BGSCLSubactionDeg3Mid.lean new file mode 100644 index 00000000..f537ee1b --- /dev/null +++ b/proof/formalization/R3Cert/BGSCLSubactionDeg3Mid.lean @@ -0,0 +1,271 @@ +/- + The remaining degree-3 `IsSubaction ρwit` cells (2026-09-03). + + Completes the degree-3 hub family started in `BGSCLSubactionDeg3.lean` + (`subaction_deg3_highchildren`) and `BGSCLSubaction.lean` (`subaction_broom_d3`). + A degree-3 hub has two children; the profiles by child degree are: + + (leaf,leaf) -> subaction_broom_d3 [BGSCLSubaction] + (deg>=3,deg>=3) -> subaction_deg3_highchildren [BGSCLSubactionDeg3] + (deg-2,deg-2) -> subaction_deg3_deg2children [HERE] + (leaf,deg-2) -> subaction_deg3_leaf_deg2 [HERE] + (leaf,deg>=3) -> subaction_deg3_leaf_high [HERE] + (deg-2,deg>=3) -> subaction_deg3_deg2_high [HERE] (redesigned, see below) + + The three leaf/deg-2/deg-2 cells consume the Telperion atoms `deg3_deg2children_enc` + (tight_hi), `log32_sub2fstar`, `log139_sub2fstar` (tangent) from `BGSCLSubactionEnc2`. + + CELL (D) REDESIGN. The (deg-2, deg>=3) profile has a genuine two-slope obstruction: + a single `log_tangent` cannot slope-match BOTH the deg-2 child's `ρwit` slope (1/4) + and the deg>=3 child's per-child lower-bound slope (3/11); matching one overshoots the + other (fails by ~0.0043 at the (bY_d2, bY_h) = (1/3, 0) corner). The fix here dissolves + it WITHOUT the two-slope decouple: since the high child's message is small (`bY_h <= 1/3`), + bound it into a constant, drop its (nonneg) `ρwit`, and reduce to a single-variable + inequality in the deg-2 child's message closed by the ONE new tight_hi atom + `log2_sub3fstar : log(4/3) + log(3/2) - 3F* <= 71/960`. + + Kernel-checked, no `sorry`. `conjecture1_proved = False`. +-/ +import Mathlib +import R3Cert.BGSCLInduction +import R3Cert.BGSCLSubaction +import R3Cert.BGSCLSubactionEnc2 + +namespace R3Cert +namespace BGSCL + +open Real + +/-! ### Cell: degree-3 hub, two degree-2 children (`bcc cᵢ = 1`, `bY cᵢ ∈ [1/3,1/2]`). + + Decouple at `s0 = 1` (slope `1/(3+1) = 1/4` = ρwit(deg-2) slope ⇒ the per-child terms are + message-independent), node-ρ `≤ 3/352`, enclosure `deg3_deg2children_enc`. Margin `+0.0091`. -/ +theorem subaction_deg3_deg2children (c1 c2 : Branch) (h1 : bcc c1 = 1) (h2 : bcc c2 = 1) : + (Real.log (1 + (([c1, c2]).map bY).sum + / ((([c1, c2] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2]) ≤ (([c1, c2]).map ρwit).sum := by + have hy1_0 := bY_nonneg c1 + have hy2_0 := bY_nonneg c2 + have hy1_lo : (1:ℝ)/3 ≤ bY c1 := bY_ge_third_of_bcc1 c1 h1 + have hy2_lo : (1:ℝ)/3 ≤ bY c2 := bY_ge_third_of_bcc1 c2 h2 + have hy1_hi : bY c1 ≤ 1/2 := by + have h := bY_le_inv_deg c1; rw [h1] at h; norm_num at h; linarith + have hy2_hi : bY c2 ≤ 1/2 := by + have h := bY_le_inv_deg c2; rw [h2] at h; norm_num at h; linarith + set S := bY c1 + bY c2 with hS + have hS0 : (0:ℝ) ≤ S := by rw [hS]; linarith + have hS_lo : (2:ℝ)/3 ≤ S := by rw [hS]; linarith + have hden : (0:ℝ) < 3 + S := by linarith + have htan := log_tangent (d := (3:ℝ)) (s := S) (s0 := (1:ℝ)) (by norm_num) hS0 (by norm_num) + rw [show (1:ℝ) + 1/3 = 4/3 by norm_num, show (3:ℝ) + 1 = 4 by norm_num] at htan + have hbYnode : bY (Branch.node [c1, c2]) = 1 / (3 + S) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring_nf + have hbcc_node : bcc (Branch.node [c1, c2]) = 2 := by simp [bcc] + have hrnode : ρwit (Branch.node [c1, c2]) = (1/32) * (1 / (3 + S)) := by + rw [ρwit, hbcc_node, hbYnode]; norm_num + have hrnode_le : ρwit (Branch.node [c1, c2]) ≤ 3/352 := by + rw [hrnode] + have hinv : 1 / (3 + S) ≤ 3/11 := by + have h := one_div_le_one_div_of_le (show (0:ℝ) < 11/3 by norm_num) + (show (11:ℝ)/3 ≤ 3 + S by linarith) + rwa [show (1:ℝ)/(11/3) = 3/11 by norm_num] at h + have hinv_nn : (0:ℝ) ≤ 1 / (3 + S) := by positivity + nlinarith [hinv, hinv_nn] + have henc := deg3_deg2children_enc + have hrc1 : ρwit c1 = 2 * FSTAR - Real.log (3/2) + (1/4) * (bY c1 - 1/3) := by + simp only [ρwit, h1] + have hrc2 : ρwit c2 = 2 * FSTAR - Real.log (3/2) + (1/4) * (bY c2 - 1/3) := by + simp only [ρwit, h2] + have hlogarg : (1:ℝ) + (([c1, c2]).map bY).sum + / ((([c1, c2] : List Branch).length : ℝ) + 1) = 1 + S / 3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; norm_num + have hrhs : (([c1, c2]).map ρwit).sum = ρwit c1 + ρwit c2 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, add_zero] + rw [hlogarg, hrhs, hrc1, hrc2] + linarith [htan, hrnode_le, henc, hS] + +/-! ### Cell: degree-3 hub, one leaf + one degree-2 child (`bcc c = 1`). + + The leaf's `ρwit = F*` dominates the RHS; reduce to `e_node + ρwit(node) ≤ F*` in the single + variable `bY c ∈ [1/3,1/2]` (`S = 1 + bY c`). Tangent at the endpoint `s0 = 3/2`, node-ρ folded + into a quadratic (`div_le_iff₀` + `nlinarith`), enclosure `log32_sub2fstar`. Margin `+0.0008`. -/ +theorem subaction_deg3_leaf_deg2 (c : Branch) (hc : bcc c = 1) : + (Real.log (1 + (([Branch.node [], c]).map bY).sum + / ((([Branch.node [], c] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [Branch.node [], c]) ≤ (([Branch.node [], c]).map ρwit).sum := by + have hy0 := bY_nonneg c + have hy_lo : (1:ℝ)/3 ≤ bY c := bY_ge_third_of_bcc1 c hc + have hy_hi : bY c ≤ 1/2 := by + have h := bY_le_inv_deg c; rw [hc] at h; norm_num at h; linarith + have hden : (0:ℝ) < 4 + bY c := by linarith + have htan : Real.log (1 + (1 + bY c)/3) ≤ Real.log (3/2) + (2/9) * (bY c - 1/2) := by + have h := log_tangent (d := (3:ℝ)) (s := 1 + bY c) (s0 := (3:ℝ)/2) + (by norm_num) (by linarith) (by norm_num) + rw [show (1:ℝ) + (3/2)/3 = 3/2 by norm_num, show (3:ℝ) + 3/2 = 9/2 by norm_num] at h + calc Real.log (1 + (1 + bY c)/3) + ≤ Real.log (3/2) + ((1 + bY c) - 3/2)/(9/2) := h + _ = Real.log (3/2) + (2/9) * (bY c - 1/2) := by ring + have hquad : (1/32 : ℝ) * (1 / (4 + bY c)) ≤ 1/144 - (2/9) * (bY c - 1/2) := by + rw [show (1/32 : ℝ) * (1 / (4 + bY c)) = (1/32)/(4 + bY c) by ring, div_le_iff₀ hden] + nlinarith [mul_nonneg (show (0:ℝ) ≤ 1/2 - bY c by linarith) + (show (0:ℝ) ≤ bY c - 1/3 by linarith), hy_hi, hy_lo] + have henc := log32_sub2fstar + have hrc_nn : 0 ≤ ρwit c := ρwit_nonneg c + have hbYnode : bY (Branch.node [Branch.node [], c]) = 1 / (4 + bY c) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil, bY_leaf] + push_cast; ring + have hbcc_node : bcc (Branch.node [Branch.node [], c]) = 2 := by simp [bcc] + have hrnode : ρwit (Branch.node [Branch.node [], c]) = (1/32) * (1 / (4 + bY c)) := by + rw [ρwit, hbcc_node, hbYnode]; norm_num + have hlogarg : (1:ℝ) + (([Branch.node [], c]).map bY).sum + / ((([Branch.node [], c] : List Branch).length : ℝ) + 1) = 1 + (1 + bY c)/3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil, bY_leaf] + norm_num + have hrhs : (([Branch.node [], c]).map ρwit).sum = FSTAR + ρwit c := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, ρwit_leaf, add_zero] + rw [hlogarg, hrhs, hrnode] + linarith [htan, henc, hquad, hrc_nn] + +/-! ### Cell: degree-3 hub, one leaf + one degree-≥3 child (`bcc c ≥ 2`, `bY c ∈ [0,1/3]`). + + Same "leaf `ρwit = F*` dominates" reduction; endpoint tangent at `s0 = 4/3`, node-ρ folded into a + quadratic, enclosure `log139_sub2fstar`. Margin `+0.038`. -/ +theorem subaction_deg3_leaf_high (c : Branch) (hc : 2 ≤ bcc c) : + (Real.log (1 + (([Branch.node [], c]).map bY).sum + / ((([Branch.node [], c] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [Branch.node [], c]) ≤ (([Branch.node [], c]).map ρwit).sum := by + have hy0 := bY_nonneg c + have hy3 : bY c ≤ 1/3 := by + have h1 := bY_le_inv_deg c + have hcast : (2:ℝ) ≤ (bcc c : ℝ) := by exact_mod_cast hc + have h2 : (1:ℝ) / ((bcc c : ℝ) + 1) ≤ 1/3 := one_div_le_one_div_of_le (by norm_num) (by linarith) + linarith + have hden : (0:ℝ) < 4 + bY c := by linarith + have htan : Real.log (1 + (1 + bY c)/3) ≤ Real.log (13/9) + (3/13) * (bY c - 1/3) := by + have h := log_tangent (d := (3:ℝ)) (s := 1 + bY c) (s0 := (4:ℝ)/3) + (by norm_num) (by linarith) (by norm_num) + rw [show (1:ℝ) + (4/3)/3 = 13/9 by norm_num, show (3:ℝ) + 4/3 = 13/3 by norm_num] at h + calc Real.log (1 + (1 + bY c)/3) + ≤ Real.log (13/9) + ((1 + bY c) - 4/3)/(13/3) := h + _ = Real.log (13/9) + (3/13) * (bY c - 1/3) := by ring + have hquad : (1/32 : ℝ) * (1 / (4 + bY c)) ≤ 3/416 - (3/13) * (bY c - 1/3) := by + rw [show (1/32 : ℝ) * (1 / (4 + bY c)) = (1/32)/(4 + bY c) by ring, div_le_iff₀ hden] + nlinarith [mul_nonneg (show (0:ℝ) ≤ 1/3 - bY c by linarith) hy0, hy3, hy0] + have henc := log139_sub2fstar + have hrc_nn : 0 ≤ ρwit c := ρwit_nonneg c + have hbYnode : bY (Branch.node [Branch.node [], c]) = 1 / (4 + bY c) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil, bY_leaf] + push_cast; ring + have hbcc_node : bcc (Branch.node [Branch.node [], c]) = 2 := by simp [bcc] + have hrnode : ρwit (Branch.node [Branch.node [], c]) = (1/32) * (1 / (4 + bY c)) := by + rw [ρwit, hbcc_node, hbYnode]; norm_num + have hlogarg : (1:ℝ) + (([Branch.node [], c]).map bY).sum + / ((([Branch.node [], c] : List Branch).length : ℝ) + 1) = 1 + (1 + bY c)/3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil, bY_leaf] + norm_num + have hrhs : (([Branch.node [], c]).map ρwit).sum = FSTAR + ρwit c := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, ρwit_leaf, add_zero] + rw [hlogarg, hrhs, hrnode] + linarith [htan, henc, hquad, hrc_nn] + +/-! ### Cell (D) atom: `log(4/3) + log(3/2) - 3F* ≤ 71/960` (tight_hi route, dogfooded). + + Fold `X = (4/3)¹¹·(3/2)¹¹·(621/64)⁻³ = 2⁻¹¹-free = 536870912/239483061 ≈ 2.2418 > 1`, `Q = 781/960 > 0`. + The existing `tight` route needs `Q<0`; the degree-1 tangent needs `X−1 ≤ Q` (fails, `1.24 > 0.81`). + tight_hi: `log X ≤ Q ⟺ X ≤ exp Q`, with a **degree-5** Taylor lower bound on `exp Q` (`Real.exp_bound`, + n=4 is too weak here since `X` sits closer to `exp Q`): `exp Q ≥ 61122928451812033/27179089920000000 ≥ X`. -/ +theorem log2_sub3fstar : + Real.log (4/3 : ℝ) + Real.log (3/2 : ℝ) - (3 * FSTAR : ℝ) ≤ (71/960 : ℝ) := by + rw [FSTAR] + have hXpos : (0 : ℝ) < (4/3 : ℝ) ^ (11 : ℕ) * (3/2 : ℝ) ^ (11 : ℕ) * (((621/64 : ℝ) ^ (3 : ℕ))⁻¹) := by + positivity + have hsplit : Real.log ((4/3 : ℝ) ^ (11 : ℕ) * (3/2 : ℝ) ^ (11 : ℕ) * (((621/64 : ℝ) ^ (3 : ℕ))⁻¹)) + = 11 * Real.log (4/3 : ℝ) + 11 * Real.log (3/2 : ℝ) - 3 * Real.log (621/64 : ℝ) := by + rw [Real.log_mul (by positivity) (by positivity), + Real.log_mul (by positivity) (by positivity), + Real.log_inv, Real.log_pow, Real.log_pow, Real.log_pow] + push_cast; ring + have hx : |(781/960 : ℝ)| ≤ 1 := by rw [abs_of_nonneg (by norm_num)]; norm_num + have hb := Real.exp_bound hx (n := 5) (by norm_num) + have hexpge : (61122928451812033/27179089920000000 : ℝ) ≤ Real.exp (781/960 : ℝ) := by + have hlo := (abs_le.mp hb).1 + norm_num [Finset.sum_range_succ, Nat.factorial, abs_of_nonneg] at hlo + linarith + have hXexp : (4/3 : ℝ) ^ (11 : ℕ) * (3/2 : ℝ) ^ (11 : ℕ) * (((621/64 : ℝ) ^ (3 : ℕ))⁻¹) + ≤ Real.exp (781/960 : ℝ) := by + have hXle : (4/3 : ℝ) ^ (11 : ℕ) * (3/2 : ℝ) ^ (11 : ℕ) * (((621/64 : ℝ) ^ (3 : ℕ))⁻¹) + ≤ (61122928451812033/27179089920000000 : ℝ) := by norm_num + linarith + have hlogX : Real.log ((4/3 : ℝ) ^ (11 : ℕ) * (3/2 : ℝ) ^ (11 : ℕ) * (((621/64 : ℝ) ^ (3 : ℕ))⁻¹)) + ≤ (781/960 : ℝ) := by + rw [Real.log_le_iff_le_exp hXpos]; exact hXexp + rw [hsplit] at hlogX + linarith + +/-! ### Cell (D): degree-3 hub, one degree-2 + one degree-≥3 child (the redesigned two-slope cell). + + `c1` deg-2 (`bcc c1 = 1`), `c2` deg-≥3 (`bcc c2 ≥ 2`, `bY c2 ≤ 1/3`). NO two-slope decouple: bound + `bY c2 ≤ 1/3` into a constant, DROP `ρwit c2 ≥ 0`, tangent at `s0 = 1` (slope-match the deg-2 child), + node-ρ `≤ 3/320`, and the single atom `log2_sub3fstar`. Worst corner `(bY_d2,bY_h)=(1/3,1/3)`, + atom margin `+0.0006`. -/ +theorem subaction_deg3_deg2_high (c1 c2 : Branch) (h1 : bcc c1 = 1) (h2 : 2 ≤ bcc c2) : + (Real.log (1 + (([c1, c2]).map bY).sum + / ((([c1, c2] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2]) ≤ (([c1, c2]).map ρwit).sum := by + have hy1_0 := bY_nonneg c1 + have hy2_0 := bY_nonneg c2 + have hy1_lo : (1:ℝ)/3 ≤ bY c1 := bY_ge_third_of_bcc1 c1 h1 + have hy2_hi : bY c2 ≤ 1/3 := by + have h1' := bY_le_inv_deg c2 + have hcast : (2:ℝ) ≤ (bcc c2 : ℝ) := by exact_mod_cast h2 + have h3 : (1:ℝ) / ((bcc c2 : ℝ) + 1) ≤ 1/3 := one_div_le_one_div_of_le (by norm_num) (by linarith) + linarith + set S := bY c1 + bY c2 with hS + have hS0 : (0:ℝ) ≤ S := by rw [hS]; linarith + have hS_lo : (1:ℝ)/3 ≤ S := by rw [hS]; linarith + have hden : (0:ℝ) < 3 + S := by linarith + have htan := log_tangent (d := (3:ℝ)) (s := S) (s0 := (1:ℝ)) (by norm_num) hS0 (by norm_num) + rw [show (1:ℝ) + 1/3 = 4/3 by norm_num, show (3:ℝ) + 1 = 4 by norm_num] at htan + have hbYnode : bY (Branch.node [c1, c2]) = 1 / (3 + S) := by + rw [bY_node] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; ring_nf + have hbcc_node : bcc (Branch.node [c1, c2]) = 2 := by simp [bcc] + have hrnode : ρwit (Branch.node [c1, c2]) = (1/32) * (1 / (3 + S)) := by + rw [ρwit, hbcc_node, hbYnode]; norm_num + have hrnode_le : ρwit (Branch.node [c1, c2]) ≤ 3/320 := by + rw [hrnode] + have hinv : 1 / (3 + S) ≤ 3/10 := by + have h := one_div_le_one_div_of_le (show (0:ℝ) < 10/3 by norm_num) + (show (10:ℝ)/3 ≤ 3 + S by linarith) + rwa [show (1:ℝ)/(10/3) = 3/10 by norm_num] at h + have hinv_nn : (0:ℝ) ≤ 1 / (3 + S) := by positivity + nlinarith [hinv, hinv_nn] + have henc := log2_sub3fstar + have hrc1 : ρwit c1 = 2 * FSTAR - Real.log (3/2) + (1/4) * (bY c1 - 1/3) := by + simp only [ρwit, h1] + have hrc2_nn : 0 ≤ ρwit c2 := ρwit_nonneg c2 + have hlogarg : (1:ℝ) + (([c1, c2]).map bY).sum + / ((([c1, c2] : List Branch).length : ℝ) + 1) = 1 + S / 3 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil] + rw [hS]; norm_num + have hrhs : (([c1, c2]).map ρwit).sum = ρwit c1 + ρwit c2 := by + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, add_zero] + rw [hlogarg, hrhs, hrc1] + linarith [htan, hrnode_le, henc, hrc2_nn, hy2_hi, hS] + +end BGSCL +end R3Cert diff --git a/proof/formalization/R3Cert/BGSCLSubactionDispatch.lean b/proof/formalization/R3Cert/BGSCLSubactionDispatch.lean new file mode 100644 index 00000000..a93589c1 --- /dev/null +++ b/proof/formalization/R3Cert/BGSCLSubactionDispatch.lean @@ -0,0 +1,283 @@ +/- + Top-level dispatch for `IsSubaction ρwit`, and the branch-ceiling capstone (2026-09-04). + + Assembles the per-degree SUBACTION cells (`BGSCLSubaction`, `BGSCLSubactionDeg3`, + `BGSCLSubactionDeg3Mid`, `BGSCLSubactionD4Cells`, `BGSCLSubactionTailWrap`) into the single + obligation `IsSubaction ρwit` that `ceiling_of_witness` needs. The dispatcher `rcases` the + child list `cs` by length (node degree `= |cs| + 1`) and, within each length, by the children's + `bcc` classes, applying the matching cell. Child order is canonicalized by `subaction_perm` + (permutation invariance of the (SUB) predicate): the 9 ordered degree-3 pairs reduce to the 6 + canonical `subaction_deg3_*` cells, and an arbitrary degree-4 triple is sorted by `bcc` and + routed to the 35 canonical `subaction_deg4_*` cells; the tail (degree ≥ 5) goes to `tail_wrapper`. + + CANONICALIZATION CONVENTION: + child classes by `bcc`: L = 0, deg-2 = 1, deg-3 = 2, deg-4 = 3, H = (4 ≤ bcc); + canonical child order = non-decreasing `bcc`. + + `isSubaction_ρwit` and the capstone `bg_ceiling : ∀ b, bell b ≤ 0` are fully proven, no `sorry`. + `conjecture1_proved = False`. +-/ +import Mathlib +import R3Cert.BGSCLInduction +import R3Cert.BGSCLSubaction +import R3Cert.BGSCLSubactionDeg3 +import R3Cert.BGSCLSubactionDeg3Mid +import R3Cert.BGSCLSubactionD4Cells +import R3Cert.BGSCLSubactionTailWrap + +namespace R3Cert +namespace BGSCL + +open Real + +/-! ### Permutation invariance of the (SUB) predicate. -/ + +/-- `ρwit` reads only through `bcc (node cs) = |cs|` and `bY (node cs)` (which, by `bY_node`, + depends only on `|cs|` and `(cs.map bY).sum`); hence it is invariant under permuting the + children. A `List.Perm` fixes both `|cs|` and `(cs.map bY).sum`, so `ρwit` agrees. -/ +theorem ρwit_node_perm {cs cs' : List Branch} (h : cs.Perm cs') : + ρwit (Branch.node cs) = ρwit (Branch.node cs') := by + have hlen : cs.length = cs'.length := h.length_eq + have hbY : (cs.map bY).sum = (cs'.map bY).sum := (h.map bY).sum_eq + have hbYnode : bY (Branch.node cs) = bY (Branch.node cs') := by + rw [bY_node, bY_node, hlen, hbY] + rw [ρwit, ρwit] + simp only [bcc, hlen, hbYnode] + +/-- **Permutation invariance of (SUB).** The subaction inequality at a hub `node cs` transports + across any permutation of the children: the log-term (through `(cs.map bY).sum` and `|cs|`), the + node `ρwit` (`ρwit_node_perm`), and the RHS `(cs.map ρwit).sum` are each Perm-invariant. -/ +theorem subaction_perm {cs cs' : List Branch} (h : cs.Perm cs') + (hsub : (Real.log (1 + (cs'.map bY).sum / ((cs'.length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node cs') ≤ (cs'.map ρwit).sum) : + (Real.log (1 + (cs.map bY).sum / ((cs.length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node cs) ≤ (cs.map ρwit).sum := by + have hlen : cs.length = cs'.length := h.length_eq + have hbY : (cs.map bY).sum = (cs'.map bY).sum := (h.map bY).sum_eq + have hrho : (cs.map ρwit).sum = (cs'.map ρwit).sum := (h.map ρwit).sum_eq + have hnode : ρwit (Branch.node cs) = ρwit (Branch.node cs') := ρwit_node_perm h + rw [hbY, hlen, hnode, hrho] + exact hsub + +/-! ### Class helpers. -/ + +/-- A child with `bcc = 0` is the leaf `node []`. -/ +theorem eq_leaf_of_bcc_zero {c : Branch} (hc : bcc c = 0) : c = Branch.node [] := by + cases c with + | node cs => + simp only [bcc, List.length_eq_zero_iff] at hc + rw [hc] + +/-! ### Degree-1 arm (`cs = []`). -/ + +/-- Degree-1 dispatch: the leaf node. -/ +theorem subaction_deg1 : + (Real.log (1 + (([] : List Branch).map bY).sum / ((([] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node []) ≤ (([] : List Branch).map ρwit).sum := + subaction_nil + +/-! ### Degree-2 arm (`cs = [c]`). -/ + +/-- Degree-2 dispatch: one child, cased by `bcc c` — leaf ⇒ `subaction_cherry`, + deg-2 ⇒ `subaction_deg2_deg2child`, deg-≥3 ⇒ `subaction_deg2_highchild`. -/ +theorem subaction_deg2 (c : Branch) : + (Real.log (1 + (([c] : List Branch).map bY).sum / ((([c] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c]) ≤ (([c] : List Branch).map ρwit).sum := by + rcases (show bcc c = 0 ∨ bcc c = 1 ∨ 2 ≤ bcc c by omega) with h | h | h + · -- leaf child + rw [eq_leaf_of_bcc_zero h] + exact subaction_cherry + · exact subaction_deg2_deg2child c h + · exact subaction_deg2_highchild c h + +/-! ### Degree-3 arm (`cs = [c1, c2]`). + + Canonicalize the ordered pair `(bcc c1, bcc c2)` over the classes {L = 0, deg-2 = 1, H = ≥2} + to non-decreasing order via `subaction_perm (List.Perm.swap ..)`, reducing the 9 ordered + profiles to the 6 canonical cells: + LL → subaction_broom_d3, LD2 → subaction_deg3_leaf_deg2, + LH → subaction_deg3_leaf_high, D2D2→ subaction_deg3_deg2children, + D2H → subaction_deg3_deg2_high, HH → subaction_deg3_highchildren. -/ + +/-- The canonical (non-decreasing) degree-3 cell for classes `(k1, k2)` with `k1 ≤ k2` classwise. + Handles the 6 canonical orderings; callers use `subaction_perm` to canonicalize. -/ +theorem subaction_deg3_canon (c1 c2 : Branch) + (hle : bcc c1 = 0 ∧ bcc c2 = 0 + ∨ bcc c1 = 0 ∧ bcc c2 = 1 + ∨ bcc c1 = 0 ∧ 2 ≤ bcc c2 + ∨ bcc c1 = 1 ∧ bcc c2 = 1 + ∨ bcc c1 = 1 ∧ 2 ≤ bcc c2 + ∨ 2 ≤ bcc c1 ∧ 2 ≤ bcc c2) : + (Real.log (1 + (([c1, c2] : List Branch).map bY).sum + / ((([c1, c2] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2]) ≤ (([c1, c2] : List Branch).map ρwit).sum := by + rcases hle with ⟨k1, k2⟩ | ⟨k1, k2⟩ | ⟨k1, k2⟩ | ⟨k1, k2⟩ | ⟨k1, k2⟩ | ⟨k1, k2⟩ + · -- (L, L) + rw [eq_leaf_of_bcc_zero k1, eq_leaf_of_bcc_zero k2] + exact subaction_broom_d3 + · -- (L, deg-2) + rw [eq_leaf_of_bcc_zero k1] + exact subaction_deg3_leaf_deg2 c2 k2 + · -- (L, high) + rw [eq_leaf_of_bcc_zero k1] + exact subaction_deg3_leaf_high c2 k2 + · -- (deg-2, deg-2) + exact subaction_deg3_deg2children c1 c2 k1 k2 + · -- (deg-2, high) + exact subaction_deg3_deg2_high c1 c2 k1 k2 + · -- (high, high) + exact subaction_deg3_highchildren c1 c2 k1 k2 + +/-- Degree-3 dispatch: two children, canonicalized to non-decreasing `bcc` via `subaction_perm`. -/ +theorem subaction_deg3 (c1 c2 : Branch) : + (Real.log (1 + (([c1, c2] : List Branch).map bY).sum + / ((([c1, c2] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2]) ≤ (([c1, c2] : List Branch).map ρwit).sum := by + -- classify each child + rcases (show bcc c1 = 0 ∨ bcc c1 = 1 ∨ 2 ≤ bcc c1 by omega) with h1 | h1 | h1 <;> + rcases (show bcc c2 = 0 ∨ bcc c2 = 1 ∨ 2 ≤ bcc c2 by omega) with h2 | h2 | h2 + -- canonical (already non-decreasing) cases: apply directly + · exact subaction_deg3_canon c1 c2 (Or.inl ⟨h1, h2⟩) + · exact subaction_deg3_canon c1 c2 (Or.inr (Or.inl ⟨h1, h2⟩)) + · exact subaction_deg3_canon c1 c2 (Or.inr (Or.inr (Or.inl ⟨h1, h2⟩))) + -- (deg-2, L) → swap to (L, deg-2) + · exact subaction_perm (List.Perm.swap c2 c1 []) (subaction_deg3_canon c2 c1 (Or.inr (Or.inl ⟨h2, h1⟩))) + · exact subaction_deg3_canon c1 c2 (Or.inr (Or.inr (Or.inr (Or.inl ⟨h1, h2⟩)))) + · exact subaction_deg3_canon c1 c2 (Or.inr (Or.inr (Or.inr (Or.inr (Or.inl ⟨h1, h2⟩))))) + -- (high, L) → swap to (L, high) + · exact subaction_perm (List.Perm.swap c2 c1 []) (subaction_deg3_canon c2 c1 (Or.inr (Or.inr (Or.inl ⟨h2, h1⟩)))) + -- (high, deg-2) → swap to (deg-2, high) + · exact subaction_perm (List.Perm.swap c2 c1 []) (subaction_deg3_canon c2 c1 (Or.inr (Or.inr (Or.inr (Or.inr (Or.inl ⟨h2, h1⟩)))))) + -- (high, high) + · exact subaction_deg3_canon c1 c2 (Or.inr (Or.inr (Or.inr (Or.inr (Or.inr ⟨h1, h2⟩))))) + +/-! ### Degree-4 arm (`cs = [c1, c2, c3]`). + + Same sort-then-classify factoring as degree 3, one dimension up. `subaction_deg4_canon` + handles a triple already in non-decreasing `bcc` order (`bcc x ≤ bcc y ≤ bcc z`), routing + the 35 reachable class-triples to the `subaction_deg4_XYZ` cells (the 90 non-monotone + class-triples are unreachable given the two `≤` hypotheses — `omega` closes them). + `subaction_deg4` sorts an arbitrary triple by `bcc` via three `le_total` splits and transports + the canonical proof back with `subaction_perm`. Class codes: 0→L, 1→2, 2→3, 3→4, ≥4→H. -/ + +/-- The canonical (non-decreasing `bcc`) degree-4 cell. Given `bcc x ≤ bcc y ≤ bcc z`, classify each + of `bcc x, bcc y, bcc z` into {0,1,2,3,≥4} and apply the matching `subaction_deg4_XYZ` cell; the + two ≤ hypotheses render the 90 non-monotone class-triples unreachable (`omega`). -/ +theorem subaction_deg4_canon (x y z : Branch) + (hxy : bcc x ≤ bcc y) (hyz : bcc y ≤ bcc z) : + (Real.log (1 + (([x, y, z] : List Branch).map bY).sum + / ((([x, y, z] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [x, y, z]) ≤ (([x, y, z] : List Branch).map ρwit).sum := by + rcases (show bcc x = 0 ∨ bcc x = 1 ∨ bcc x = 2 ∨ bcc x = 3 ∨ 4 ≤ bcc x by omega) with + hx | hx | hx | hx | hx <;> + rcases (show bcc y = 0 ∨ bcc y = 1 ∨ bcc y = 2 ∨ bcc y = 3 ∨ 4 ≤ bcc y by omega) with + hy | hy | hy | hy | hy <;> + rcases (show bcc z = 0 ∨ bcc z = 1 ∨ bcc z = 2 ∨ bcc z = 3 ∨ 4 ≤ bcc z by omega) with + hz | hz | hz | hz | hz <;> + first + | exact subaction_deg4_LLL x y z hx hy hz + | exact subaction_deg4_LL2 x y z hx hy hz + | exact subaction_deg4_LL3 x y z hx hy hz + | exact subaction_deg4_LL4 x y z hx hy hz + | exact subaction_deg4_LLH x y z hx hy hz + | exact subaction_deg4_L22 x y z hx hy hz + | exact subaction_deg4_L23 x y z hx hy hz + | exact subaction_deg4_L24 x y z hx hy hz + | exact subaction_deg4_L2H x y z hx hy hz + | exact subaction_deg4_L33 x y z hx hy hz + | exact subaction_deg4_L34 x y z hx hy hz + | exact subaction_deg4_L3H x y z hx hy hz + | exact subaction_deg4_L44 x y z hx hy hz + | exact subaction_deg4_L4H x y z hx hy hz + | exact subaction_deg4_LHH x y z hx hy hz + | exact subaction_deg4_222 x y z hx hy hz + | exact subaction_deg4_223 x y z hx hy hz + | exact subaction_deg4_224 x y z hx hy hz + | exact subaction_deg4_22H x y z hx hy hz + | exact subaction_deg4_233 x y z hx hy hz + | exact subaction_deg4_234 x y z hx hy hz + | exact subaction_deg4_23H x y z hx hy hz + | exact subaction_deg4_244 x y z hx hy hz + | exact subaction_deg4_24H x y z hx hy hz + | exact subaction_deg4_2HH x y z hx hy hz + | exact subaction_deg4_333 x y z hx hy hz + | exact subaction_deg4_334 x y z hx hy hz + | exact subaction_deg4_33H x y z hx hy hz + | exact subaction_deg4_344 x y z hx hy hz + | exact subaction_deg4_34H x y z hx hy hz + | exact subaction_deg4_3HH x y z hx hy hz + | exact subaction_deg4_444 x y z hx hy hz + | exact subaction_deg4_44H x y z hx hy hz + | exact subaction_deg4_4HH x y z hx hy hz + | exact subaction_deg4_HHH x y z hx hy hz + | omega + +/-- Degree-4 dispatch: sort the three children into non-decreasing `bcc` order `[x,y,z]` via three + `le_total` splits, and transport `subaction_deg4_canon` back to the input order `[c1,c2,c3]` with + `subaction_perm`. -/ +theorem subaction_deg4 (c1 c2 c3 : Branch) : + (Real.log (1 + (([c1, c2, c3] : List Branch).map bY).sum + / ((([c1, c2, c3] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [c1, c2, c3]) ≤ (([c1, c2, c3] : List Branch).map ρwit).sum := by + -- perms of [c1,c2,c3] to each sorted order + have p_123 : ([c1, c2, c3] : List Branch).Perm [c1, c2, c3] := List.Perm.refl _ + have p_132 : ([c1, c2, c3] : List Branch).Perm [c1, c3, c2] := + (List.Perm.swap c3 c2 []).cons c1 + have p_213 : ([c1, c2, c3] : List Branch).Perm [c2, c1, c3] := + List.Perm.swap c2 c1 [c3] + have p_231 : ([c1, c2, c3] : List Branch).Perm [c2, c3, c1] := + (List.Perm.swap c2 c1 [c3]).trans ((List.Perm.swap c3 c1 []).cons c2) + have p_312 : ([c1, c2, c3] : List Branch).Perm [c3, c1, c2] := + ((List.Perm.swap c3 c2 []).cons c1).trans (List.Perm.swap c3 c1 [c2]) + have p_321 : ([c1, c2, c3] : List Branch).Perm [c3, c2, c1] := + (List.Perm.swap c2 c1 [c3]).trans + ((List.Perm.swap c3 c1 []).cons c2 |>.trans (List.Perm.swap c3 c2 [c1])) + rcases le_total (bcc c1) (bcc c2) with h12 | h12 <;> + rcases le_total (bcc c2) (bcc c3) with h23 | h23 <;> + rcases le_total (bcc c1) (bcc c3) with h13 | h13 + · -- a≤b≤c + exact subaction_perm p_123 (subaction_deg4_canon c1 c2 c3 h12 h23) + · -- a≤b, b≤c, c≤a ⟹ all equal + exact subaction_perm p_123 (subaction_deg4_canon c1 c2 c3 h12 h23) + · -- a≤c≤b + exact subaction_perm p_132 (subaction_deg4_canon c1 c3 c2 h13 h23) + · -- c≤a≤b + exact subaction_perm p_312 (subaction_deg4_canon c3 c1 c2 h13 h12) + · -- b≤a≤c + exact subaction_perm p_213 (subaction_deg4_canon c2 c1 c3 h12 h13) + · -- b≤c≤a + exact subaction_perm p_231 (subaction_deg4_canon c2 c3 c1 h23 h13) + · -- c≤b≤a (all equal here) + exact subaction_perm p_321 (subaction_deg4_canon c3 c2 c1 h23 h12) + · -- c≤b≤a + exact subaction_perm p_321 (subaction_deg4_canon c3 c2 c1 h23 h12) + +/-! ### Top-level dispatch. -/ + +/-- **`IsSubaction ρwit`** — the single remaining obligation of `ceiling_of_witness`, assembled by + dispatching on child-list length (node degree) and, within each degree, on the children's + `bcc` classes. Degrees 1/2/3/4 are discharged by the per-degree sort-then-classify dispatchers + over the cell family; the tail (degree ≥ 5) by `tail_wrapper`. No `sorry`. -/ +theorem isSubaction_ρwit : IsSubaction ρwit := by + intro cs + rcases cs with _ | ⟨c1, _ | ⟨c2, _ | ⟨c3, _ | ⟨c4, rest⟩⟩⟩⟩ + · -- degree 1: cs = [] + exact subaction_deg1 + · -- degree 2: cs = [c1] + exact subaction_deg2 c1 + · -- degree 3: cs = [c1, c2] + exact subaction_deg3 c1 c2 + · -- degree 4: cs = [c1, c2, c3] + exact subaction_deg4 c1 c2 c3 + · -- degree ≥ 5: cs = c1 :: c2 :: c3 :: c4 :: rest (tail) + exact tail_wrapper _ (by simp only [List.length_cons]; omega) + +/-! ### Capstone. -/ + +/-- **The branch ceiling.** Feeding the fully-assembled `IsSubaction ρwit` into `ceiling_of_witness` + (whose nonnegativity leg `ρwit_nonneg` is already discharged) yields `∀ b, bell b ≤ 0` — the + additive-subaction branch ceiling, unconditional in Lean. `conjecture1_proved = False`. -/ +theorem bg_ceiling : ∀ b, bell b ≤ 0 := ceiling_of_witness isSubaction_ρwit + +end BGSCL +end R3Cert diff --git a/proof/formalization/R3Cert/BGSCLSubactionEnc.lean b/proof/formalization/R3Cert/BGSCLSubactionEnc.lean new file mode 100644 index 00000000..e08cb51e --- /dev/null +++ b/proof/formalization/R3Cert/BGSCLSubactionEnc.lean @@ -0,0 +1,51 @@ +/- + Tight-route log-enclosure for the degree-2 node / degree-3 child SUBACTION cell (2026-09-03). + + The analytic core the deg-3-child cell needs, where log x <= x-1 is TOO LOOSE + (fold X=(7/9)^11*(621/64) ~ 0.611, need log X <= -11/24 ~ -0.458, but x-1 ~ -0.389). + Telperion emit_log_combination route='tight': log X <= Q via X <= exp Q + degree-3 + Taylor exp upper (Real.exp_bound'). Kernel-checked against R3Cert.BGSCLInduction. + conjecture1_proved = False. +-/ +import Mathlib +import R3Cert.BGSCLInduction + +namespace R3Cert +namespace BGSCL + +open Real + +theorem log79_add_fstar : Real.log (7/9 : ℝ) - (-1 * FSTAR : ℝ) ≤ (-1/24 : ℝ) := by + rw [FSTAR] + have hXpos : (0 : ℝ) < (7/9 : ℝ) ^ (11 : ℕ) * ((621/64 : ℝ) ^ (1 : ℕ)) := by positivity + have hsplit : Real.log ((7/9 : ℝ) ^ (11 : ℕ) * ((621/64 : ℝ) ^ (1 : ℕ))) + = 11 * Real.log (7/9 : ℝ) + 1 * Real.log (621/64 : ℝ) := by + rw [Real.log_mul (by positivity) (by positivity), Real.log_pow, + Real.log_pow] + push_cast; ring + have hexp := Real.exp_bound' (x := (11/24 : ℝ)) (by norm_num) (by norm_num) + (n := 3) (by norm_num) + have hU : (∑ m ∈ Finset.range 3, (11/24 : ℝ) ^ m / m.factorial) + + (11/24 : ℝ) ^ 3 * (3 + 1) / ((3 : ℕ).factorial * 3) ≤ (98585/62208 : ℝ) := by + norm_num [Finset.sum_range_succ, Nat.factorial] + have hexpU : Real.exp (11/24 : ℝ) ≤ (98585/62208 : ℝ) := le_trans hexp hU + have hexppos : (0 : ℝ) < Real.exp (11/24 : ℝ) := Real.exp_pos _ + have hprod : (7/9 : ℝ) ^ (11 : ℕ) * ((621/64 : ℝ) ^ (1 : ℕ)) * Real.exp (11/24 : ℝ) ≤ 1 := by + have hmono : (7/9 : ℝ) ^ (11 : ℕ) * ((621/64 : ℝ) ^ (1 : ℕ)) * Real.exp (11/24 : ℝ) + ≤ (7/9 : ℝ) ^ (11 : ℕ) * ((621/64 : ℝ) ^ (1 : ℕ)) * (98585/62208 : ℝ) := + mul_le_mul_of_nonneg_left hexpU (le_of_lt hXpos) + have hXU : (7/9 : ℝ) ^ (11 : ℕ) * ((621/64 : ℝ) ^ (1 : ℕ)) * (98585/62208 : ℝ) ≤ 1 := by norm_num + linarith + have hXle : (7/9 : ℝ) ^ (11 : ℕ) * ((621/64 : ℝ) ^ (1 : ℕ)) ≤ Real.exp (-(11/24) : ℝ) := by + rw [Real.exp_neg, ← one_div] + rw [le_div_iff₀ hexppos] + linarith [hprod] + have hlogle : Real.log ((7/9 : ℝ) ^ (11 : ℕ) * ((621/64 : ℝ) ^ (1 : ℕ))) ≤ (-11/24 : ℝ) := by + rw [Real.log_le_iff_le_exp hXpos] + have hEq : (-(11/24) : ℝ) = (-11/24 : ℝ) := by norm_num + rw [hEq] at hXle; exact hXle + rw [hsplit] at hlogle + linarith + +end BGSCL +end R3Cert diff --git a/proof/formalization/R3Cert/BGSCLSubactionEnc2.lean b/proof/formalization/R3Cert/BGSCLSubactionEnc2.lean new file mode 100644 index 00000000..aa13dbab --- /dev/null +++ b/proof/formalization/R3Cert/BGSCLSubactionEnc2.lean @@ -0,0 +1,79 @@ +/- + Enclosure atoms for the next `IsSubaction ρwit` cells (2026-09-03): degree-3 hub + profiles with a leaf/deg-2 child. Generated by Telperion `emit_log_combination` + (routes: tangent, tight_hi). Companion to `BGSCLSubactionEnc.lean`. Each atom is a + message-independent scalar log-combination folded to a single `log X` and discharged; + kernel-checked against `R3Cert.BGSCLInduction`. No `sorry`. `conjecture1_proved = False`. +-/ +import Mathlib +import R3Cert.BGSCLInduction + +namespace R3Cert +namespace BGSCL + +open Real + +-- ===== F*-folding, TIGHT-HI route (Q=79/96>0, fold X>1): 2 * Real.log (3/2 : ℝ) + Real.log (4/3 : ℝ) − 5·FSTAR ≤ 79/1056 (FSTAR = log(621/64)/11) ===== +-- Fold X = ∏ rᵢ^(cᵢ·11) · (621/64)^(-5) = 1073741824/521343783 (≈ 2.0596) > 1; goal ⟺ log X ≤ Q = 79/96. +-- Degree-1 tangent is TOO LOOSE (X−1 > Q) and the `tight` route needs Q<0; +-- TIGHT-HI: log X ≤ Q ⟺ X ≤ exp Q (Real.log_le_iff_le_exp), and a degree-4 +-- Taylor LOWER bound on exp Q (Real.exp_bound) gives exp Q ≥ 18186940987/8153726976 ≥ X. +theorem deg3_deg2children_enc : 2 * Real.log (3/2 : ℝ) + Real.log (4/3 : ℝ) - (5 * FSTAR : ℝ) ≤ (79/1056 : ℝ) := by + rw [FSTAR] + have hXpos : (0 : ℝ) < (3/2 : ℝ) ^ (22 : ℕ) * (4/3 : ℝ) ^ (11 : ℕ) * (((621/64 : ℝ) ^ (5 : ℕ))⁻¹) := by positivity + have hsplit : Real.log ((3/2 : ℝ) ^ (22 : ℕ) * (4/3 : ℝ) ^ (11 : ℕ) * (((621/64 : ℝ) ^ (5 : ℕ))⁻¹)) + = 22 * Real.log (3/2 : ℝ) + 11 * Real.log (4/3 : ℝ) - 5 * Real.log (621/64 : ℝ) := by + rw [Real.log_mul (by positivity) (by positivity), + Real.log_mul (by positivity) (by positivity), + Real.log_inv, Real.log_pow, Real.log_pow, Real.log_pow] + push_cast; ring + have hx : |(79/96 : ℝ)| ≤ 1 := by rw [abs_of_nonneg (by norm_num)]; norm_num + have hb := Real.exp_bound hx (n := 4) (by norm_num) + have hexpge : (18186940987/8153726976 : ℝ) ≤ Real.exp (79/96 : ℝ) := by + have hlo := (abs_le.mp hb).1 + norm_num [Finset.sum_range_succ, Nat.factorial, abs_of_nonneg] at hlo + linarith + have hXexp : (3/2 : ℝ) ^ (22 : ℕ) * (4/3 : ℝ) ^ (11 : ℕ) * (((621/64 : ℝ) ^ (5 : ℕ))⁻¹) ≤ Real.exp (79/96 : ℝ) := by + have hXle : (3/2 : ℝ) ^ (22 : ℕ) * (4/3 : ℝ) ^ (11 : ℕ) * (((621/64 : ℝ) ^ (5 : ℕ))⁻¹) ≤ (18186940987/8153726976 : ℝ) := by norm_num + linarith + have hlogX : Real.log ((3/2 : ℝ) ^ (22 : ℕ) * (4/3 : ℝ) ^ (11 : ℕ) * (((621/64 : ℝ) ^ (5 : ℕ))⁻¹)) ≤ (79/96 : ℝ) := by + rw [Real.log_le_iff_le_exp hXpos]; exact hXexp + rw [hsplit] at hlogX + linarith + +-- ===== F*-folding, TANGENT route (general k=2): 1·log(3/2) − 2·FSTAR ≤ -1/144 (FSTAR = log(621/64)/11) ===== +-- Fold: 11·(1·log 3/2 − 2·FSTAR) = log((3/2)^11·((621/64)^2)⁻¹) +-- ≤ (3/2)^11·((621/64)^2)⁻¹ − 1 (Real.log_le_sub_one_of_pos); the fold − 1 +-- ≤ -11/144 is a rational norm_num fact. TIGHT AT THE TIE (no F* lower bound). +theorem log32_sub2fstar : Real.log (3/2 : ℝ) - (2 * FSTAR : ℝ) ≤ (-1/144 : ℝ) := by + rw [FSTAR] + have hpos : (0 : ℝ) < (3/2 : ℝ) ^ (11 : ℕ) * (((621/64 : ℝ) ^ (2 : ℕ))⁻¹) := by positivity + have hr := Real.log_le_sub_one_of_pos hpos + have hsplit : Real.log ((3/2 : ℝ) ^ (11 : ℕ) * (((621/64 : ℝ) ^ (2 : ℕ))⁻¹)) + = 11 * Real.log (3/2 : ℝ) - 2 * Real.log (621/64 : ℝ) := by + rw [Real.log_mul (by positivity) (by positivity), Real.log_pow, + Real.log_inv, Real.log_pow] + push_cast; ring + rw [hsplit] at hr + have hnum : (3/2 : ℝ) ^ (11 : ℕ) * (((621/64 : ℝ) ^ (2 : ℕ))⁻¹) - 1 ≤ -11/144 := by norm_num + linarith + +-- ===== F*-folding, TANGENT route (general k=2): 1·log(13/9) − 2·FSTAR ≤ -3/416 (FSTAR = log(621/64)/11) ===== +-- Fold: 11·(1·log 13/9 − 2·FSTAR) = log((13/9)^11·((621/64)^2)⁻¹) +-- ≤ (13/9)^11·((621/64)^2)⁻¹ − 1 (Real.log_le_sub_one_of_pos); the fold − 1 +-- ≤ -33/416 is a rational norm_num fact. TIGHT AT THE TIE (no F* lower bound). +theorem log139_sub2fstar : Real.log (13/9 : ℝ) - (2 * FSTAR : ℝ) ≤ (-3/416 : ℝ) := by + rw [FSTAR] + have hpos : (0 : ℝ) < (13/9 : ℝ) ^ (11 : ℕ) * (((621/64 : ℝ) ^ (2 : ℕ))⁻¹) := by positivity + have hr := Real.log_le_sub_one_of_pos hpos + have hsplit : Real.log ((13/9 : ℝ) ^ (11 : ℕ) * (((621/64 : ℝ) ^ (2 : ℕ))⁻¹)) + = 11 * Real.log (13/9 : ℝ) - 2 * Real.log (621/64 : ℝ) := by + rw [Real.log_mul (by positivity) (by positivity), Real.log_pow, + Real.log_inv, Real.log_pow] + push_cast; ring + rw [hsplit] at hr + have hnum : (13/9 : ℝ) ^ (11 : ℕ) * (((621/64 : ℝ) ^ (2 : ℕ))⁻¹) - 1 ≤ -33/416 := by norm_num + linarith + +end BGSCL +end R3Cert diff --git a/proof/formalization/R3Cert/BGSCLSubactionTail.lean b/proof/formalization/R3Cert/BGSCLSubactionTail.lean new file mode 100644 index 00000000..14309266 --- /dev/null +++ b/proof/formalization/R3Cert/BGSCLSubactionTail.lean @@ -0,0 +1,309 @@ +/- + The deg≥5 tail crux family + the 27·23 tie identity (2026-09-03). + + Two pieces of `IsSubaction ρwit` beyond the degree-3/4 core: + + * `tail_all_deg4` — the CRUX of the deg≥5 tail. For a degree-`d` hub (`d ≥ 1`) whose children are all + degree-4 at the maximal message `1/4` (`S = (d−1)/4`, `ρwit(node)=0`), the local excess obeys + `log((5d−1)/(4d)) − F* ≤ (d−1)/1536`. This is the flattest per-type tail family (`ρ = bY/384`), min + slack `+0.0057` at `d=18`. Proof: `log((5d−1)/(4d)) = log(5/4) + log(1 − 1/(5d)) ≤ log(5/4) − 1/(5d)` + (concavity, `Real.log_le_sub_one_of_pos`), then the atom `log(5/4) − F* ≤ 1/55` reduces it to a rational + quadratic in `d` with NEGATIVE discriminant (`55d² − 1591d + 16896 > 0`, via `sq_nonneg (110d − 1591)`). + + * `subaction_tail_tie_d6` — the 27·23 = 621 tie. A degree-6 hub with five cherry children (each deg-2 at + `bY = 1/3`, `ρwit = 2F*−log(3/2)`; `ρwit(node)=0`) meets `(SUB)` with EXACT equality, because + `(23/18)·(3/2)⁵ = 621/64`, i.e. `log(23/18) + 5·log(3/2) = 11·F* = log(621/64)`. + + Kernel-checked, no `sorry`. `conjecture1_proved = False`. +-/ +import Mathlib +import R3Cert.BGSCLInduction +import R3Cert.BGSCLSubaction + +namespace R3Cert +namespace BGSCL + +open Real + +/-! ### The deg≥5 tail crux: the all-degree-4 `d`-family. -/ + +/-- **`tail_all_deg4`.** For every real `d ≥ 1`, `log((5d−1)/(4d)) − F* ≤ (d−1)/1536`. This is the binding + per-type family of the deg≥5 tail (all children degree-4 at message `1/4`); the slack is convex in `d` + with a single interior minimum `+0.0057` at `d = 18`. -/ +theorem tail_all_deg4 (d : ℝ) (hd : 1 ≤ d) : + Real.log ((5 * d - 1) / (4 * d)) - FSTAR ≤ (d - 1) / 1536 := by + have hd0 : (0 : ℝ) < d := by linarith + have h5d : (0 : ℝ) < 5 * d := by linarith + -- factor: (5d−1)/(4d) = (5/4)·(1 − 1/(5d)) + have hfact : (5 * d - 1) / (4 * d) = (5 / 4) * (1 - 1 / (5 * d)) := by + field_simp + have harg_pos : (0 : ℝ) < 1 - 1 / (5 * d) := by + have : 1 / (5 * d) < 1 := by rw [div_lt_one h5d]; linarith + linarith + have hsplit : Real.log ((5 * d - 1) / (4 * d)) = Real.log (5 / 4) + Real.log (1 - 1 / (5 * d)) := by + rw [hfact, Real.log_mul (by norm_num) (ne_of_gt harg_pos)] + -- concavity: log(1 − 1/(5d)) ≤ −1/(5d) + have hlog1 : Real.log (1 - 1 / (5 * d)) ≤ -(1 / (5 * d)) := by + have h := Real.log_le_sub_one_of_pos harg_pos + linarith + -- the atom log(5/4) − F* ≤ 1/55 + have henc : Real.log (5 / 4) - FSTAR ≤ 1 / 55 := log54_sub_fstar_le' + -- rational quadratic: 1/55 − 1/(5d) ≤ (d−1)/1536 (discriminant of 55d²−1591d+16896 is < 0) + have hquad : (1 : ℝ) / 55 - 1 / (5 * d) ≤ (d - 1) / 1536 := by + rw [← sub_nonneg] + have hden : (0 : ℝ) < 422400 * d := by positivity + have hnum : (0 : ℝ) ≤ 275 * d ^ 2 - 7955 * d + 84480 := by + nlinarith [sq_nonneg (110 * d - 1591)] + have hid : (d - 1) / 1536 - (1 / 55 - 1 / (5 * d)) + = (275 * d ^ 2 - 7955 * d + 84480) / (422400 * d) := by + field_simp; ring + rw [hid]; exact div_nonneg hnum (le_of_lt hden) + linarith [hsplit, hlog1, henc, hquad] + +/-- **`tail_all_deg3`.** For every real `d ≥ 1`, `log((4d−1)/(3d)) − F* ≤ (d−1)/96`. The all-degree-3 tail + family (children at message `1/3`, `S = (d−1)/3`; `ρwit = bY/32`), min slack `+0.0119` at `d = 5`. Same + concavity + quadratic recipe as `tail_all_deg4`, with the atom `log(4/3) − F* ≤ 1/12` and the quadratic + `d² − 9d + 24 > 0` (discriminant `−15`). -/ +theorem tail_all_deg3 (d : ℝ) (hd : 1 ≤ d) : + Real.log ((4 * d - 1) / (3 * d)) - FSTAR ≤ (d - 1) / 96 := by + have hd0 : (0 : ℝ) < d := by linarith + have h3d : (0 : ℝ) < 3 * d := by linarith + have hfact : (4 * d - 1) / (3 * d) = (4 / 3) * (1 - 1 / (4 * d)) := by + field_simp + have harg_pos : (0 : ℝ) < 1 - 1 / (4 * d) := by + have : 1 / (4 * d) < 1 := by rw [div_lt_one (by linarith)]; linarith + linarith + have hsplit : Real.log ((4 * d - 1) / (3 * d)) = Real.log (4 / 3) + Real.log (1 - 1 / (4 * d)) := by + rw [hfact, Real.log_mul (by norm_num) (ne_of_gt harg_pos)] + have hlog1 : Real.log (1 - 1 / (4 * d)) ≤ -(1 / (4 * d)) := by + have h := Real.log_le_sub_one_of_pos harg_pos + linarith + -- atom log(4/3) − F* ≤ 1/12 (TIGHT_HI route: fold X = (4/3)¹¹·(64/621) ≈ 2.44 > 1, Q = 11/12 > 0; + -- degree-5 Taylor lower bound gives exp(11/12) ≥ 20637533/8294400 ≥ X) + have henc : Real.log (4 / 3) - FSTAR ≤ 1 / 12 := by + rw [FSTAR] + have hXpos : (0 : ℝ) < (4 / 3 : ℝ) ^ (11 : ℕ) * (((621 / 64 : ℝ) ^ (1 : ℕ))⁻¹) := by positivity + have hs : Real.log ((4 / 3 : ℝ) ^ (11 : ℕ) * (((621 / 64 : ℝ) ^ (1 : ℕ))⁻¹)) + = 11 * Real.log (4 / 3) - Real.log (621 / 64) := by + rw [Real.log_mul (by positivity) (by positivity), Real.log_inv, Real.log_pow, Real.log_pow] + push_cast; ring + have hx : |(11 / 12 : ℝ)| ≤ 1 := by rw [abs_of_nonneg (by norm_num)]; norm_num + have hb := Real.exp_bound hx (n := 5) (by norm_num) + have hexpge : (20637533 / 8294400 : ℝ) ≤ Real.exp (11 / 12 : ℝ) := by + have hlo := (abs_le.mp hb).1 + norm_num [Finset.sum_range_succ, Nat.factorial, abs_of_nonneg] at hlo + linarith + have hXexp : (4 / 3 : ℝ) ^ (11 : ℕ) * (((621 / 64 : ℝ) ^ (1 : ℕ))⁻¹) ≤ Real.exp (11 / 12 : ℝ) := by + have hXle : (4 / 3 : ℝ) ^ (11 : ℕ) * (((621 / 64 : ℝ) ^ (1 : ℕ))⁻¹) ≤ (20637533 / 8294400 : ℝ) := by + norm_num + linarith + have hlogX : Real.log ((4 / 3 : ℝ) ^ (11 : ℕ) * (((621 / 64 : ℝ) ^ (1 : ℕ))⁻¹)) ≤ (11 / 12 : ℝ) := by + rw [Real.log_le_iff_le_exp hXpos]; exact hXexp + rw [hs] at hlogX + linarith + -- 1/12 − 1/(4d) ≤ (d−1)/96 ⟺ d² − 9d + 24 ≥ 0 (discriminant < 0) + have hquad : (1 : ℝ) / 12 - 1 / (4 * d) ≤ (d - 1) / 96 := by + rw [← sub_nonneg] + have hden : (0 : ℝ) < 96 * d := by positivity + have hnum : (0 : ℝ) ≤ d ^ 2 - 9 * d + 24 := by nlinarith [sq_nonneg (2 * d - 9)] + have hid : (d - 1) / 96 - (1 / 12 - 1 / (4 * d)) = (d ^ 2 - 9 * d + 24) / (96 * d) := by + field_simp; ring + rw [hid]; exact div_nonneg hnum (le_of_lt hden) + linarith [hsplit, hlog1, henc, hquad] + +/-! ### The 27·23 = 621 tie identity (deg-6 hub, five cherry children). -/ + +/-- The exact tie identity `log(23/18) + 5·log(3/2) = 11·F*`, i.e. `(23/18)·(3/2)⁵ = 621/64`. -/ +theorem tie_identity_d6 : Real.log (23 / 18) + 5 * Real.log (3 / 2) = 11 * FSTAR := by + rw [FSTAR] + have h : Real.log (23 / 18) + 5 * Real.log (3 / 2) = Real.log (621 / 64) := by + rw [show (621 / 64 : ℝ) = (23 / 18) * (3 / 2) ^ (5 : ℕ) by norm_num, + Real.log_mul (by norm_num) (by positivity), Real.log_pow] + push_cast; ring + rw [h]; ring + +/-- **`subaction_tail_tie_d6`** — the 27·23 tie cell. A degree-6 hub whose five children are all the cherry + `node [leaf]` (deg-2, `bY = 1/3`, `ρwit = 2F*−log(3/2)`); the hub has `ρwit = 0` (deg ≥ 5). `(SUB)` holds + with EXACT equality: `log(23/18) − F* = 5·(2F*−log(3/2))`, the `621 = 27·23` face in the tail. -/ +theorem subaction_tail_tie_d6 : + (Real.log (1 + (([Branch.node [Branch.node []], Branch.node [Branch.node []], + Branch.node [Branch.node []], Branch.node [Branch.node []], + Branch.node [Branch.node []]]).map bY).sum + / ((([Branch.node [Branch.node []], Branch.node [Branch.node []], + Branch.node [Branch.node []], Branch.node [Branch.node []], + Branch.node [Branch.node []]] : List Branch).length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node [Branch.node [Branch.node []], Branch.node [Branch.node []], + Branch.node [Branch.node []], Branch.node [Branch.node []], Branch.node [Branch.node []]]) + ≤ (([Branch.node [Branch.node []], Branch.node [Branch.node []], + Branch.node [Branch.node []], Branch.node [Branch.node []], + Branch.node [Branch.node []]]).map ρwit).sum := by + -- cherry message and ρ (as in subaction_cherry) + have hbYc : bY (Branch.node [Branch.node []]) = 1 / 3 := by + rw [bY_node]; simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, + List.length_cons, List.length_nil, bY_leaf, Nat.cast_one, add_zero, zero_add] + norm_num + have hrc : ρwit (Branch.node [Branch.node []]) = 2 * FSTAR - Real.log (3 / 2) := by + rw [ρwit]; simp only [bcc, List.length_cons, List.length_nil, hbYc]; ring + -- node has bcc = 5 ⇒ ρwit = 0 + have hrnode : ρwit (Branch.node [Branch.node [Branch.node []], Branch.node [Branch.node []], + Branch.node [Branch.node []], Branch.node [Branch.node []], Branch.node [Branch.node []]]) = 0 := by + rw [ρwit]; simp only [bcc, List.length_cons, List.length_nil] + simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, List.length_cons, + List.length_nil, hbYc, hrc, hrnode, add_zero, Nat.reduceAdd, Nat.cast_ofNat] + rw [show (1 : ℝ) + (1 / 3 + (1 / 3 + (1 / 3 + (1 / 3 + 1 / 3)))) / ((5 : ℝ) + 1) = 23 / 18 by norm_num] + have hid := tie_identity_d6 + linarith + +/-! ### The all-degree-2 tail family (the TIE family — tight at d=6, so the hardest of the three). + + `tail_all_deg2 (d ≥ 5) : log((4d−1)/(3d)) ≤ (2d−1)F* − (d−1)log(3/2)` (all-deg-2 hub, children at `bY=1/3`, + `ρwit = 2F*−log(3/2)`). Equality at d=6 (the `27·23` tie), so it is NOT closable by a single concavity bound + over ℝ; dispatch on the natural degree: d=5 (fold), d=6 (exact via `tie_identity_d6`), d≥7 (concavity + the + quadratic `q(x) = 4a·x² − 4(a+p)·x + 1 ≥ 0`, `a = 2F*−log(3/2)`, `p = log(4/3)−F*`, whose real roots are both + `< 7`; via `q(x) = 4a(x−7)² + 4(13a−p)(x−7) + (1−28(p−6a))` with the two enclosures below). -/ + +/-- Enclosure `13a − p ≥ 0` (`a = 2F*−log(3/2)`, `p = log(4/3)−F*`), i.e. `0 ≤ 27F* − 13log(3/2) − log(4/3)`; + the `q'(7) ≥ 0` leg. Direct `X ≥ 1` fold `(621/64)²⁷ ≥ (3/2)¹⁴³·(4/3)¹¹`. -/ +theorem henc_deg2_qp7 : (0 : ℝ) ≤ 27 * FSTAR - 13 * Real.log (3 / 2) - Real.log (4 / 3) := by + have hX : (1 : ℝ) ≤ (621 / 64 : ℝ) ^ (27 : ℕ) / ((3 / 2 : ℝ) ^ (143 : ℕ) * (4 / 3 : ℝ) ^ (11 : ℕ)) := by + rw [le_div_iff₀ (by positivity)]; norm_num + have hlogX := Real.log_nonneg hX + rw [Real.log_div (by positivity) (by positivity), Real.log_mul (by positivity) (by positivity), + Real.log_pow, Real.log_pow, Real.log_pow] at hlogX + rw [FSTAR]; push_cast at hlogX ⊢; linarith + +/-- Enclosure `p − 6a ≤ 1/28`, i.e. `log(4/3) + 6log(3/2) − 13F* ≤ 1/28`; the `q(7) ≥ 0` leg. TIGHT_HI: + fold `Y = (4/3)¹¹·(3/2)⁶⁶·(64/621)¹³ ≈ 1.467 > 1`, `Q = 11/28`; degree-4 Taylor gives + `exp(11/28) ≥ 29088281/19668992 ≥ Y`. -/ +theorem henc_deg2_q7 : Real.log (4 / 3) + 6 * Real.log (3 / 2) - 13 * FSTAR ≤ 1 / 28 := by + rw [FSTAR] + have hXpos : (0 : ℝ) < (4 / 3 : ℝ) ^ (11 : ℕ) * (3 / 2 : ℝ) ^ (66 : ℕ) * (((621 / 64 : ℝ) ^ (13 : ℕ))⁻¹) := by + positivity + have hs : Real.log ((4 / 3 : ℝ) ^ (11 : ℕ) * (3 / 2 : ℝ) ^ (66 : ℕ) * (((621 / 64 : ℝ) ^ (13 : ℕ))⁻¹)) + = 11 * Real.log (4 / 3) + 66 * Real.log (3 / 2) - 13 * Real.log (621 / 64) := by + rw [Real.log_mul (by positivity) (by positivity), Real.log_mul (by positivity) (by positivity), + Real.log_inv, Real.log_pow, Real.log_pow, Real.log_pow] + push_cast; ring + have hx : |(11 / 28 : ℝ)| ≤ 1 := by rw [abs_of_nonneg (by norm_num)]; norm_num + have hb := Real.exp_bound hx (n := 4) (by norm_num) + have hexpge : (29088281 / 19668992 : ℝ) ≤ Real.exp (11 / 28 : ℝ) := by + have hlo := (abs_le.mp hb).1 + norm_num [Finset.sum_range_succ, Nat.factorial, abs_of_nonneg] at hlo + linarith + have hXexp : (4 / 3 : ℝ) ^ (11 : ℕ) * (3 / 2 : ℝ) ^ (66 : ℕ) * (((621 / 64 : ℝ) ^ (13 : ℕ))⁻¹) + ≤ Real.exp (11 / 28 : ℝ) := by + have hXle : (4 / 3 : ℝ) ^ (11 : ℕ) * (3 / 2 : ℝ) ^ (66 : ℕ) * (((621 / 64 : ℝ) ^ (13 : ℕ))⁻¹) + ≤ (29088281 / 19668992 : ℝ) := by norm_num + linarith + have hlogX : Real.log ((4 / 3 : ℝ) ^ (11 : ℕ) * (3 / 2 : ℝ) ^ (66 : ℕ) * (((621 / 64 : ℝ) ^ (13 : ℕ))⁻¹)) + ≤ (11 / 28 : ℝ) := by + rw [Real.log_le_iff_le_exp hXpos]; exact hXexp + rw [hs] at hlogX + linarith + +/-- The all-deg-2 tail family for real `x ≥ 7` (concavity + the quadratic `q(x) ≥ 0`). -/ +theorem tail_all_deg2_large (x : ℝ) (hx : 7 ≤ x) : + Real.log ((4 * x - 1) / (3 * x)) ≤ (2 * x - 1) * FSTAR - (x - 1) * Real.log (3 / 2) := by + have hx0 : (0 : ℝ) < x := by linarith + have hfact : (4 * x - 1) / (3 * x) = (4 / 3) * (1 - 1 / (4 * x)) := by field_simp + have harg : (0 : ℝ) < 1 - 1 / (4 * x) := by + have : 1 / (4 * x) < 1 := by rw [div_lt_one (by linarith)]; linarith + linarith + have hsplit : Real.log ((4 * x - 1) / (3 * x)) = Real.log (4 / 3) + Real.log (1 - 1 / (4 * x)) := by + rw [hfact, Real.log_mul (by norm_num) (ne_of_gt harg)] + have hlog1 : Real.log (1 - 1 / (4 * x)) ≤ -(1 / (4 * x)) := by + have := Real.log_le_sub_one_of_pos harg; linarith + have ha : (0 : ℝ) ≤ 2 * FSTAR - Real.log (3 / 2) := cherry_anchor_nonneg + have hqp7 := henc_deg2_qp7 + have hq7 := henc_deg2_q7 + -- log(4/3) − 1/(4x) ≤ (2x−1)F* − (x−1)log(3/2) ⟺ q(x) ≥ 0 + have hq : Real.log (4 / 3) - 1 / (4 * x) ≤ (2 * x - 1) * FSTAR - (x - 1) * Real.log (3 / 2) := by + rw [← sub_nonneg] + have h4x : (0 : ℝ) < 4 * x := by linarith + have hpoly : (2 * x - 1) * FSTAR - (x - 1) * Real.log (3 / 2) - (Real.log (4 / 3) - 1 / (4 * x)) + = (4 * (2 * FSTAR - Real.log (3 / 2)) * x ^ 2 + - 4 * ((2 * FSTAR - Real.log (3 / 2)) + (Real.log (4 / 3) - FSTAR)) * x + 1) / (4 * x) := by + field_simp; ring + rw [hpoly] + apply div_nonneg _ (le_of_lt h4x) + nlinarith [mul_nonneg ha (sq_nonneg (x - 7)), + mul_nonneg hqp7 (show (0 : ℝ) ≤ x - 7 by linarith), hq7, ha, hx] + linarith [hsplit, hlog1, hq] + +/-- d=5 leg of the all-deg-2 family: `log(19/15) ≤ 9F* − 4log(3/2)` (fold `X < 1`). -/ +theorem tail_deg2_d5 : Real.log (19 / 15) ≤ 9 * FSTAR - 4 * Real.log (3 / 2) := by + rw [FSTAR] + have hpos : (0 : ℝ) < (19 / 15 : ℝ) ^ (11 : ℕ) * (3 / 2 : ℝ) ^ (44 : ℕ) * (((621 / 64 : ℝ) ^ (9 : ℕ))⁻¹) := by + positivity + have hr := Real.log_le_sub_one_of_pos hpos + have hs : Real.log ((19 / 15 : ℝ) ^ (11 : ℕ) * (3 / 2 : ℝ) ^ (44 : ℕ) * (((621 / 64 : ℝ) ^ (9 : ℕ))⁻¹)) + = 11 * Real.log (19 / 15) + 44 * Real.log (3 / 2) - 9 * Real.log (621 / 64) := by + rw [Real.log_mul (by positivity) (by positivity), Real.log_mul (by positivity) (by positivity), + Real.log_inv, Real.log_pow, Real.log_pow, Real.log_pow] + push_cast; ring + rw [hs] at hr + have hnum : (19 / 15 : ℝ) ^ (11 : ℕ) * (3 / 2 : ℝ) ^ (44 : ℕ) * (((621 / 64 : ℝ) ^ (9 : ℕ))⁻¹) - 1 ≤ 0 := by + norm_num + linarith + +/-- **`tail_all_deg2`** — the all-deg-2 tail family for every natural degree `d ≥ 5`. Dispatches d=5 (fold), + d=6 (the exact 27·23 tie via `tie_identity_d6`), d≥7 (`tail_all_deg2_large`). -/ +theorem tail_all_deg2 (d : ℕ) (hd : 5 ≤ d) : + Real.log ((4 * (d : ℝ) - 1) / (3 * d)) ≤ (2 * d - 1) * FSTAR - (d - 1) * Real.log (3 / 2) := by + rcases (show d = 5 ∨ d = 6 ∨ 7 ≤ d by omega) with h | h | h + · subst h + have h5 := tail_deg2_d5 + push_cast + rw [show (4 * (5 : ℝ) - 1) / (3 * 5) = 19 / 15 by norm_num] + linarith + · subst h + have hid := tie_identity_d6 + push_cast + rw [show (4 * (6 : ℝ) - 1) / (3 * 6) = 23 / 18 by norm_num] + linarith + · have hx : (7 : ℝ) ≤ (d : ℝ) := by exact_mod_cast h + exact tail_all_deg2_large (d : ℝ) hx + +/-! ### Reduce-to-uniform: the message half for the deg-2 (tie) family. + + A deg-`d` hub whose `d−1` children are ALL degree-2, with arbitrary messages `yᵢ ∈ [1/3,1/2]` summing to `S`, + satisfies `(SUB)`. Because `ρwit(deg-2,·)` is AFFINE in the message, `Σ ρwit` depends only on the count and the + message-sum `S`; and because the deg-2 `ρ`-slope `1/4` dominates `1/(d+S)` for every `d ≥ 5`, the SUB-slack is + MONOTONE in `S` over the whole range (no interior extremum), so the worst case is `S = (d−1)/3` (all `yᵢ = 1/3`, + the tie), reducing to `tail_all_deg2`. This is the message half of reduce-to-uniform for the binding family; + the counts→single-degree exchange (across degrees) and the deg-3/deg-4 message halves (whose slack is only + CONCAVE, with a `d`-dependent worst endpoint) remain. -/ +theorem tail_deg2_sum (d : ℕ) (hd : 5 ≤ d) (S : ℝ) + (hSlo : ((d : ℝ) - 1) / 3 ≤ S) (hShi : S ≤ ((d : ℝ) - 1) / 2) : + Real.log (1 + S / (d : ℝ)) - FSTAR + ≤ ((d : ℝ) - 1) * (2 * FSTAR - Real.log (3 / 2)) + (S - ((d : ℝ) - 1) / 3) / 4 := by + have hdR : (5 : ℝ) ≤ (d : ℝ) := by exact_mod_cast hd + have hd0 : (0 : ℝ) < (d : ℝ) := by linarith + set S0 := ((d : ℝ) - 1) / 3 with hS0def + have hS0nn : (0 : ℝ) ≤ S0 := by rw [hS0def]; apply div_nonneg (by linarith) (by norm_num) + have hSS0 : (0 : ℝ) ≤ S - S0 := by linarith + have hposS : (0 : ℝ) < 1 + S / (d : ℝ) := by + have : (0 : ℝ) ≤ S := by linarith + positivity + have hpos0 : (0 : ℝ) < 1 + S0 / (d : ℝ) := by + have := div_nonneg hS0nn (le_of_lt hd0); linarith + -- (1) g-monotonicity: log(1+S/d) − S/4 ≤ log(1+S0/d) − S0/4 + have hmono : Real.log (1 + S / (d : ℝ)) - S / 4 ≤ Real.log (1 + S0 / (d : ℝ)) - S0 / 4 := by + have hratio : (1 + S / (d : ℝ)) / (1 + S0 / (d : ℝ)) - 1 = (S - S0) / ((d : ℝ) + S0) := by + field_simp; ring + have hlogr : Real.log ((1 + S / (d : ℝ)) / (1 + S0 / (d : ℝ))) ≤ (S - S0) / ((d : ℝ) + S0) := by + rw [← hratio]; exact Real.log_le_sub_one_of_pos (div_pos hposS hpos0) + rw [Real.log_div (ne_of_gt hposS) (ne_of_gt hpos0)] at hlogr + have hslope : (S - S0) / ((d : ℝ) + S0) ≤ (S - S0) / 4 := + div_le_div_of_nonneg_left hSS0 (by norm_num) (by linarith) + linarith + -- (2) at S0 the log argument is (4d−1)/(3d) + have hS0val : (1 : ℝ) + S0 / (d : ℝ) = (4 * (d : ℝ) - 1) / (3 * (d : ℝ)) := by + rw [hS0def]; field_simp; ring + rw [hS0val] at hmono + -- (3) reduce to the uniform (tie) family + have htail := tail_all_deg2 d hd + linarith [hmono, htail] + +end BGSCL +end R3Cert diff --git a/proof/formalization/R3Cert/BGSCLSubactionTailDecouple.lean b/proof/formalization/R3Cert/BGSCLSubactionTailDecouple.lean new file mode 100644 index 00000000..ef0fafb0 --- /dev/null +++ b/proof/formalization/R3Cert/BGSCLSubactionTailDecouple.lean @@ -0,0 +1,376 @@ +/- + The tail (deg≥5) DECOUPLE reduction (2026-09-03). + + Reusable backbone for the mixed-degree tail cells of `IsSubaction ρwit`, per the counts-exchange + dissolution (`proof/docs/BG_SUBACTION_CONSOLIDATED_HANDOFF.md` §3.3): for a node of degree + `d = |cs|+1 ≥ 5` (so `ρwit(node cs) = 0`), the subaction inequality + `(log(1 + S/d) − F*) + 0 ≤ Σ_c ρwit(c)` (`S = Σ bY(c)`) + follows, via the concave-log tangent at ANY reference `S0`, from + (i) a per-child lower bound `ρwit(c) ≥ m + bY(c)/(d+S0)` for all children, and + (ii) `B(S0) := (d−1)·m + [F* − log(1+S0/d) + S0/(d+S0)] ≥ 0`. + No discrete convexity: the tangent decouples the coupled `log`, and `Σ` lifts the per-child bound. + Kernel-checked vs `R3Cert.BGSCLInduction`/`BGSCLSubaction`. No `sorry`. `conjecture1_proved = False`. +-/ +import Mathlib +import R3Cert.BGSCLInduction +import R3Cert.BGSCLSubaction +import R3Cert.BGSCLSubactionTail + +namespace R3Cert +namespace BGSCL + +open Real + +/-- **List-lift.** A per-child affine lower bound `m + σ·bY c ≤ ρwit c` sums to + `(|cs|)·m + σ·(Σ bY) ≤ Σ ρwit`. -/ +theorem sum_rhowit_ge (σ m : ℝ) : ∀ (cs : List Branch), + (∀ c ∈ cs, m + σ * bY c ≤ ρwit c) → + (cs.length : ℝ) * m + σ * (cs.map bY).sum ≤ (cs.map ρwit).sum + | [], _ => by simp + | a :: t, h => by + have ha : m + σ * bY a ≤ ρwit a := h a (by simp) + have ht := sum_rhowit_ge σ m t (fun c hc => h c (by simp [hc])) + simp only [List.length_cons, List.map_cons, List.sum_cons, Nat.cast_add, Nat.cast_one] + calc ((t.length : ℝ) + 1) * m + σ * (bY a + (t.map bY).sum) + = (m + σ * bY a) + ((t.length : ℝ) * m + σ * (t.map bY).sum) := by ring + _ ≤ ρwit a + (t.map ρwit).sum := add_le_add ha ht + +/-- `ρwit(node cs) = 0` when the degree is ≥ 5 (`|cs| ≥ 4`). -/ +theorem ρwit_node_high {cs : List Branch} (hlen : 4 ≤ cs.length) : + ρwit (Branch.node cs) = 0 := by + rw [ρwit] + simp only [bcc] + rcases hcl : cs.length with _ | _ | _ | _ | n + · omega + · omega + · omega + · omega + · rfl + +/-- **The tail DECOUPLE reduction.** For a node of degree `d = |cs|+1 ≥ 5` (`ρwit(node cs)=0`), the + subaction inequality reduces — via the concave-log tangent at any reference `S0 ≥ 0` — to a per-child + lower bound (`hpc`) plus `B(S0) ≥ 0` (`hB`). This is the mixed-degree tail closer; instantiate with the + per-degree-class min `m` and the `S0 ∈ {(d−1)/3, (d−1)/4, (d−1)/5}` d-split. -/ +theorem tail_decouple (cs : List Branch) (S0 m : ℝ) + (hlen : 4 ≤ cs.length) (hS0 : 0 ≤ S0) + (hpc : ∀ c ∈ cs, m + (1 / (((cs.length : ℝ) + 1) + S0)) * bY c ≤ ρwit c) + (hB : 0 ≤ (cs.length : ℝ) * m + + (FSTAR - Real.log (1 + S0 / ((cs.length : ℝ) + 1)) + + S0 / (((cs.length : ℝ) + 1) + S0))) : + (Real.log (1 + (cs.map bY).sum / ((cs.length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node cs) ≤ (cs.map ρwit).sum := by + have hd_pos : (0 : ℝ) < (cs.length : ℝ) + 1 := by positivity + have hdS0 : (0 : ℝ) < ((cs.length : ℝ) + 1) + S0 := by positivity + have hS_nn : (0 : ℝ) ≤ (cs.map bY).sum := + List.sum_nonneg (fun x hx => by + rw [List.mem_map] at hx; obtain ⟨c, _, rfl⟩ := hx; exact bY_nonneg c) + have htan := log_tangent (d := (cs.length : ℝ) + 1) (s := (cs.map bY).sum) (s0 := S0) + hd_pos hS_nn hS0 + have hsum := sum_rhowit_ge (1 / (((cs.length : ℝ) + 1) + S0)) m cs hpc + have hsp : ((cs.map bY).sum - S0) / (((cs.length : ℝ) + 1) + S0) + = (1 / (((cs.length : ℝ) + 1) + S0)) * (cs.map bY).sum + - S0 / (((cs.length : ℝ) + 1) + S0) := by + field_simp + rw [ρwit_node_high hlen] + linarith [htan, hsum, hB, hsp] + +/-! ### Instantiation: the d=6 (tie) tail cell — arbitrary children, via `tail_decouple`. -/ + +/-- Enclosure `2F* − log(3/2) ≤ 1/96` (via `log x ≤ x−1` at `x=(621/64)²·(2/3)¹¹ ≈ 1.088`). -/ +theorem cherry_anchor_le : 2 * FSTAR - Real.log (3/2) ≤ 1/96 := by + rw [FSTAR] + have hr := Real.log_le_sub_one_of_pos + (show (0:ℝ) < (621/64 : ℝ) ^ (2:ℕ) * (2/3 : ℝ) ^ (11:ℕ) by positivity) + have hsplit : Real.log ((621/64 : ℝ) ^ (2:ℕ) * (2/3 : ℝ) ^ (11:ℕ)) + = 2 * Real.log (621/64) - 11 * Real.log (3/2) := by + rw [Real.log_mul (by positivity) (by positivity), Real.log_pow, Real.log_pow, + show (2/3 : ℝ) = (3/2)⁻¹ by norm_num, Real.log_inv] + push_cast; ring + rw [hsplit] at hr + have hnum : (621/64 : ℝ) ^ (2:ℕ) * (2/3 : ℝ) ^ (11:ℕ) - 1 ≤ 11/96 := by norm_num + linarith + +/-- Enclosure `2/23 ≤ log(3/2) − F*` (via `exp(22/23) ≤ exp 1 < 2.7182818286 ≤ (3/2)¹¹·(64/621)`). -/ +theorem log32_sub_fstar_ge : (2:ℝ)/23 ≤ Real.log (3/2) - FSTAR := by + rw [FSTAR] + have hY : (0:ℝ) < (3/2 : ℝ) ^ (11:ℕ) * (64/621) := by positivity + have hlog : Real.log ((3/2 : ℝ) ^ (11:ℕ) * (64/621)) + = 11 * Real.log (3/2) - Real.log (621/64) := by + rw [Real.log_mul (by positivity) (by norm_num), Real.log_pow, + show (64/621 : ℝ) = (621/64)⁻¹ by norm_num, Real.log_inv] + push_cast; ring + have hge : (22:ℝ)/23 ≤ Real.log ((3/2 : ℝ) ^ (11:ℕ) * (64/621)) := by + rw [Real.le_log_iff_exp_le hY] + calc Real.exp (22/23) ≤ Real.exp 1 := Real.exp_le_exp.mpr (by norm_num) + _ ≤ 2.7182818286 := le_of_lt Real.exp_one_lt_d9 + _ ≤ (3/2 : ℝ) ^ (11:ℕ) * (64/621) := by norm_num + rw [hlog] at hge; linarith + +/-- **Per-child bound at `σ = 3/23`** (the d=6 reference). `m + (3/23)·bY c ≤ ρwit c` for every branch, + `m = 2F* − log(3/2) − 1/23`, by a per-degree-class check (leaf via `log32_sub_fstar_ge`; deg 3/4/≥5 via + `cherry_anchor_le`; deg-2 via `bY ≥ 1/3`). -/ +theorem phi_lb_d6 (c : Branch) : + (2 * FSTAR - Real.log (3/2) - 1/23) + (3/23) * bY c ≤ ρwit c := by + have hy0 := bY_nonneg c + have hyd := bY_le_inv_deg c + have hE3 := cherry_anchor_le + have hEl := log32_sub_fstar_ge + rcases hbc : bcc c with _ | _ | _ | _ | n + · have hby1 : bY c = 1 := by + cases c with + | node cs => simp only [bcc] at hbc; rw [List.length_eq_zero_iff.mp hbc] at *; exact bY_leaf + have hrc : ρwit c = FSTAR := by + cases c with + | node cs => simp only [bcc] at hbc; rw [List.length_eq_zero_iff.mp hbc] at *; exact ρwit_leaf + rw [hby1, hrc]; linarith + · have hby3 : (1:ℝ)/3 ≤ bY c := bY_ge_third_of_bcc1 c hbc + have hrc : ρwit c = 2 * FSTAR - Real.log (3/2) + (1/4) * (bY c - 1/3) := by + simp only [ρwit, hbc] + rw [hrc]; linarith + · have hby : bY c ≤ 1/3 := by rw [hbc] at hyd; norm_num at hyd; linarith + have hrc : ρwit c = (1/32) * bY c := by simp only [ρwit, hbc] + rw [hrc] + nlinarith [hE3, mul_nonneg (show (0:ℝ) ≤ 1/3 - bY c by linarith) + (show (0:ℝ) ≤ 73/736 by norm_num)] + · have hby : bY c ≤ 1/4 := by rw [hbc] at hyd; norm_num at hyd; linarith + have hrc : ρwit c = (1/384) * bY c := by simp only [ρwit, hbc] + rw [hrc]; nlinarith [hE3, hby, hy0] + · have hn : (0:ℝ) ≤ (n : ℝ) := Nat.cast_nonneg n + have hby : bY c ≤ 1/5 := by + rw [hbc] at hyd + have hd5 : (5:ℝ) ≤ ((n + 4 : ℕ) : ℝ) + 1 := by push_cast; linarith + have hle : (1:ℝ) / (((n + 4 : ℕ) : ℝ) + 1) ≤ 1/5 := + one_div_le_one_div_of_le (by norm_num) hd5 + linarith + have hrc : ρwit c = 0 := by + cases c with + | node cs => simp only [bcc] at hbc; exact ρwit_node_high (by omega) + rw [hrc]; nlinarith [hE3, hby, hy0] + +/-- **The degree-6 (tie) tail cell.** `IsSubaction ρwit` at any node of degree 6 (`|cs| = 5`, arbitrary + children): via `tail_decouple` with `S0 = 5/3` (all-cherry reference), the per-child bound `phi_lb_d6`, and + `B = 0` — the EXACT `27·23` identity (`tie_identity_d6`). Closes the tie for ALL mixed child configs. -/ +theorem subaction_tail_d6 (cs : List Branch) (hlen : cs.length = 5) : + (Real.log (1 + (cs.map bY).sum / ((cs.length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node cs) ≤ (cs.map ρwit).sum := by + have h4 : 4 ≤ cs.length := by omega + refine tail_decouple cs (5/3) (2 * FSTAR - Real.log (3/2) - 1/23) h4 (by norm_num) ?_ ?_ + · intro c _ + have hσ : (1 : ℝ) / (((cs.length : ℝ) + 1) + 5/3) = 3/23 := by rw [hlen]; norm_num + rw [hσ]; exact phi_lb_d6 c + · rw [hlen]; push_cast + rw [show (1 : ℝ) + 5/3 / (5 + 1) = 23/18 by norm_num, + show (5:ℝ)/3 / ((5 + 1) + 5/3) = 5/23 by norm_num] + linarith [tie_identity_d6] + +/-! ### The large-d (deg-5-min) regime: reusable per-child min over a σ-range. -/ + +/-- Anchor lower bound `1/500 ≤ 2F* − log(3/2)` (via `1 − 1/X ≤ log X` at `X=(621/64)²·(2/3)¹¹ ≈ 1.088`). -/ +theorem cherry_anchor_ge : (1:ℝ)/500 ≤ 2 * FSTAR - Real.log (3/2) := by + rw [FSTAR] + set X : ℝ := (621/64:ℝ)^(2:ℕ) * (2/3:ℝ)^(11:ℕ) with hXdef + have hXpos : (0:ℝ) < X := by rw [hXdef]; positivity + have hli := Real.log_le_sub_one_of_pos (show (0:ℝ) < X⁻¹ by positivity) + rw [Real.log_inv] at hli + have hX489 : (500:ℝ)/489 ≤ X := by rw [hXdef]; norm_num + have hinv : X⁻¹ ≤ 489/500 := by + have hnn : (0:ℝ) ≤ X⁻¹ := le_of_lt (inv_pos.mpr hXpos) + have hc : X * X⁻¹ = 1 := mul_inv_cancel₀ (ne_of_gt hXpos) + nlinarith [hc, mul_nonneg hnn (show (0:ℝ) ≤ X - 500/489 by linarith)] + have hsplit : Real.log X = 2 * Real.log (621/64) - 11 * Real.log (3/2) := by + rw [hXdef, Real.log_mul (by positivity) (by positivity), Real.log_pow, Real.log_pow, + show (2/3:ℝ) = (3/2)⁻¹ by norm_num, Real.log_inv] + push_cast; ring + rw [hsplit] at hli + linarith + +/-- **Per-child min for the deg-5-min regime.** For any `σ ∈ (0, 5/384]`, `(−σ/5) + σ·bY c ≤ ρwit c` for every + branch (`m = −σ/5`), by the per-degree-class check (leaf/deg-2 via `fstar_ge_7_100`/`cherry_anchor_ge`; + deg-3 `σ<1/32`; deg-4 `σ≤5/384`; deg≥5 `bY≤1/5`). -/ +theorem phi_lb_general (σ : ℝ) (hσ0 : 0 < σ) (hσhi : σ ≤ 5/384) (c : Branch) : + (-σ/5) + σ * bY c ≤ ρwit c := by + have hy0 := bY_nonneg c + have hyd := bY_le_inv_deg c + have hanchor := cherry_anchor_ge + have hfst : (7:ℝ)/100 ≤ FSTAR := by + rw [FSTAR] + have h := Real.log_le_sub_one_of_pos (show (0:ℝ) < (64/621:ℝ) by norm_num) + rw [show (64/621:ℝ) = (621/64)⁻¹ by norm_num, Real.log_inv] at h + rw [show ((621/64:ℝ)⁻¹) = 64/621 by norm_num] at h + linarith + rcases hbc : bcc c with _ | _ | _ | _ | n + · have hby1 : bY c = 1 := by + cases c with + | node cs => simp only [bcc] at hbc; rw [List.length_eq_zero_iff.mp hbc] at *; exact bY_leaf + have hrc : ρwit c = FSTAR := by + cases c with + | node cs => simp only [bcc] at hbc; rw [List.length_eq_zero_iff.mp hbc] at *; exact ρwit_leaf + rw [hby1, hrc]; linarith + · have hby3 := bY_ge_third_of_bcc1 c hbc + have hrc : ρwit c = 2 * FSTAR - Real.log (3/2) + (1/4) * (bY c - 1/3) := by simp only [ρwit, hbc] + rw [hrc] + nlinarith [hanchor, hσhi, mul_nonneg (show (0:ℝ) ≤ bY c - 1/3 by linarith) + (show (0:ℝ) ≤ 1/4 - σ by linarith)] + · have hby : bY c ≤ 1/3 := by rw [hbc] at hyd; norm_num at hyd; linarith + have hrc : ρwit c = (1/32) * bY c := by simp only [ρwit, hbc] + rw [hrc] + nlinarith [hσ0, mul_nonneg hy0 (show (0:ℝ) ≤ 1/32 - σ by linarith)] + · have hby : bY c ≤ 1/4 := by rw [hbc] at hyd; norm_num at hyd; linarith + have hrc : ρwit c = (1/384) * bY c := by simp only [ρwit, hbc] + rw [hrc] + nlinarith [hσ0, mul_nonneg (show (0:ℝ) ≤ 1/4 - bY c by linarith) + (show (0:ℝ) ≤ 5/384 - σ by linarith)] + · have hn : (0:ℝ) ≤ (n : ℝ) := Nat.cast_nonneg n + have hby : bY c ≤ 1/5 := by + rw [hbc] at hyd + have hd5 : (5:ℝ) ≤ ((n + 4 : ℕ) : ℝ) + 1 := by push_cast; linarith + have hle : (1:ℝ) / (((n + 4 : ℕ) : ℝ) + 1) ≤ 1/5 := + one_div_le_one_div_of_le (by norm_num) hd5 + linarith + have hrc : ρwit c = 0 := by + cases c with + | node cs => simp only [bcc] at hbc; exact ρwit_node_high (by omega) + rw [hrc]; nlinarith [hσ0, hby] + +/-- Tight anchor bound `3/400 ≤ 2F* − log(3/2)` (needed at the deg-4 regime's d=10 boundary). Uses the exact + `2F*−log(3/2) = (1/11)·log(529/486)` (`529/486 = (621/64)²·(2/3)¹¹`, the `27·23` structure) + a degree-3 + Taylor bound `exp(33/400) ≤ 529/486`. -/ +theorem cherry_anchor_ge_tight : (3:ℝ)/400 ≤ 2 * FSTAR - Real.log (3/2) := by + have hkey : (2:ℝ) * FSTAR - Real.log (3/2) = (1/11) * Real.log (529/486) := by + rw [FSTAR, show (529/486:ℝ) = (621/64)^(2:ℕ) * (2/3)^(11:ℕ) by norm_num, + Real.log_mul (by positivity) (by positivity), Real.log_pow, Real.log_pow, + show (2/3:ℝ) = (3/2)⁻¹ by norm_num, Real.log_inv] + push_cast; ring + rw [hkey] + have hlog : (33:ℝ)/400 ≤ Real.log (529/486) := by + rw [Real.le_log_iff_exp_le (by norm_num)] + have hb := Real.exp_bound (x := (33/400 : ℝ)) (by norm_num) (n := 3) (by norm_num) + have hb2 := (abs_le.mp hb).2 + have hs : ∑ i ∈ Finset.range 3, (33/400:ℝ)^i / (i.factorial:ℝ) = 1 + 33/400 + (33/400)^2/2 := by + simp [Finset.sum_range_succ, Nat.factorial] + rw [hs] at hb2 + have herr : |(33/400:ℝ)|^3 * ((3+1)/((Nat.factorial 3:ℝ)*3)) ≤ 529/486 - (1 + 33/400 + (33/400)^2/2) := by + norm_num [Nat.factorial] + linarith [hb2, herr] + linarith [hlog] + +/-- **The large-`d` (deg-5) tail regime, `∀ d ≥ 65`.** `IsSubaction ρwit` at any node of degree + `d = |cs|+1 ≥ 65` with arbitrary children — via `tail_decouple` at the all-deg-5 reference + `S0 = |cs|/5`, the per-child min `phi_lb_general`, and `B = F* − log((6d−1)/(5d)) ≥ 0` (`log(6/5) ≤ F*` + since `(6/5)¹¹ ≤ 621/64`). Closes the entire infinite tail. -/ +theorem subaction_tail_deg5 (cs : List Branch) (hlen : 64 ≤ cs.length) : + (Real.log (1 + (cs.map bY).sum / ((cs.length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node cs) ≤ (cs.map ρwit).sum := by + have h4 : 4 ≤ cs.length := by omega + have hL : (64:ℝ) ≤ (cs.length : ℝ) := by exact_mod_cast hlen + have hDpos : (0:ℝ) < ((cs.length : ℝ) + 1) + (cs.length : ℝ) / 5 := by positivity + set σ : ℝ := 1 / (((cs.length : ℝ) + 1) + (cs.length : ℝ) / 5) with hσdef + have hσ0 : 0 < σ := by rw [hσdef]; positivity + have hσle : σ ≤ 5/384 := by + rw [hσdef, div_le_iff₀ hDpos]; nlinarith [hL] + refine tail_decouple cs ((cs.length : ℝ) / 5) (-σ/5) h4 (by positivity) ?_ ?_ + · intro c _ + rw [show (1 : ℝ) / (((cs.length : ℝ) + 1) + (cs.length : ℝ) / 5) = σ from hσdef.symm] + exact phi_lb_general σ hσ0 hσle c + · have hcancel : (cs.length : ℝ) * (-σ/5) + + (cs.length : ℝ) / 5 / (((cs.length : ℝ) + 1) + (cs.length : ℝ) / 5) = 0 := by + rw [hσdef]; field_simp; ring + have harg : (1 : ℝ) + (cs.length : ℝ) / 5 / ((cs.length : ℝ) + 1) + = (6 * (cs.length : ℝ) + 5) / (5 * ((cs.length : ℝ) + 1)) := by + field_simp; ring + have hlogle : Real.log (1 + (cs.length : ℝ) / 5 / ((cs.length : ℝ) + 1)) ≤ FSTAR := by + rw [harg] + have hb65 : (6 * (cs.length : ℝ) + 5) / (5 * ((cs.length : ℝ) + 1)) ≤ 6/5 := by + rw [div_le_iff₀ (by positivity)]; nlinarith [hL] + have hmono : Real.log ((6 * (cs.length : ℝ) + 5) / (5 * ((cs.length : ℝ) + 1))) + ≤ Real.log (6/5) := Real.log_le_log (by positivity) hb65 + have hlog65 : Real.log (6/5 : ℝ) ≤ FSTAR := by + rw [FSTAR] + have e : Real.log ((6/5 : ℝ) ^ (11:ℕ)) = 11 * Real.log (6/5) := by rw [Real.log_pow]; norm_num + have hle : Real.log ((6/5 : ℝ) ^ (11:ℕ)) ≤ Real.log (621/64) := + Real.log_le_log (by positivity) (by norm_num) + rw [e] at hle; linarith + linarith + linarith [hcancel, hlogle] + +/-- **Per-child min for the deg-4-min regime.** For `σ ∈ [5/384, 4/49]`, `(1/1536 − σ/4) + σ·bY c ≤ ρwit c` + for every branch (`m = 1/1536 − σ/4`, the deg-4 corner), per-degree-class (deg-2 via the TIGHT + `cherry_anchor_ge_tight`; deg-3 by a σ<1/32 vs σ>1/32 split; deg-4 tight; deg≥5 `σ≥5/384`). -/ +theorem phi_lb_deg4 (σ : ℝ) (hσlo : 5/384 ≤ σ) (hσhi : σ ≤ 4/49) (c : Branch) : + (1/1536 - σ/4) + σ * bY c ≤ ρwit c := by + have hy0 := bY_nonneg c + have hyd := bY_le_inv_deg c + have hanch := cherry_anchor_ge_tight + have hfst : (7:ℝ)/100 ≤ FSTAR := by + rw [FSTAR] + have h := Real.log_le_sub_one_of_pos (show (0:ℝ) < (64/621:ℝ) by norm_num) + rw [show (64/621:ℝ) = (621/64)⁻¹ by norm_num, Real.log_inv, + show ((621/64:ℝ)⁻¹) = 64/621 by norm_num] at h + linarith + rcases hbc : bcc c with _ | _ | _ | _ | n + · have hby1 : bY c = 1 := by + cases c with + | node cs => simp only [bcc] at hbc; rw [List.length_eq_zero_iff.mp hbc] at *; exact bY_leaf + have hrc : ρwit c = FSTAR := by + cases c with + | node cs => simp only [bcc] at hbc; rw [List.length_eq_zero_iff.mp hbc] at *; exact ρwit_leaf + rw [hby1, hrc]; nlinarith [hfst, hσhi] + · have hby3 := bY_ge_third_of_bcc1 c hbc + have hrc : ρwit c = 2 * FSTAR - Real.log (3/2) + (1/4) * (bY c - 1/3) := by simp only [ρwit, hbc] + rw [hrc] + nlinarith [hanch, hσhi, mul_nonneg (show (0:ℝ) ≤ bY c - 1/3 by linarith) + (show (0:ℝ) ≤ 1/4 - σ by linarith)] + · have hby : bY c ≤ 1/3 := by rw [hbc] at hyd; norm_num at hyd; linarith + have hrc : ρwit c = (1/32) * bY c := by simp only [ρwit, hbc] + rw [hrc] + by_cases hs : σ ≤ 1/32 + · nlinarith [hσlo, mul_nonneg hy0 (show (0:ℝ) ≤ 1/32 - σ by linarith)] + · push_neg at hs + nlinarith [hσhi, mul_nonneg (show (0:ℝ) ≤ 1/3 - bY c by linarith) + (show (0:ℝ) ≤ σ - 1/32 by linarith)] + · have hby : bY c ≤ 1/4 := by rw [hbc] at hyd; norm_num at hyd; linarith + have hrc : ρwit c = (1/384) * bY c := by simp only [ρwit, hbc] + rw [hrc] + nlinarith [mul_nonneg (show (0:ℝ) ≤ 1/4 - bY c by linarith) + (show (0:ℝ) ≤ σ - 1/384 by linarith)] + · have hn : (0:ℝ) ≤ (n : ℝ) := Nat.cast_nonneg n + have hby : bY c ≤ 1/5 := by + rw [hbc] at hyd + have hd5 : (5:ℝ) ≤ ((n + 4 : ℕ) : ℝ) + 1 := by push_cast; linarith + have hle : (1:ℝ) / (((n + 4 : ℕ) : ℝ) + 1) ≤ 1/5 := + one_div_le_one_div_of_le (by norm_num) hd5 + linarith + have hrc : ρwit c = 0 := by + cases c with + | node cs => simp only [bcc] at hbc; exact ρwit_node_high (by omega) + rw [hrc]; nlinarith [hy0, hby, hσlo] + +/-- **The deg-4 tail regime, `d ∈ [10,61]`** (`|cs| ∈ [9,60]`). `IsSubaction ρwit` at any such node with + arbitrary children — via `tail_decouple` at `S0 = |cs|/4`, per-child `phi_lb_deg4`, and `hB = tail_all_deg4` + (the two B-terms collapse to `|cs|/1536`, `log(1+S0/d) = log((5d−1)/(4d))`). -/ +theorem subaction_tail_deg4 (cs : List Branch) (h1 : 9 ≤ cs.length) (h2 : cs.length ≤ 60) : + (Real.log (1 + (cs.map bY).sum / ((cs.length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node cs) ≤ (cs.map ρwit).sum := by + have h4 : 4 ≤ cs.length := by omega + have hL9 : (9:ℝ) ≤ (cs.length : ℝ) := by exact_mod_cast h1 + have hL60 : (cs.length : ℝ) ≤ 60 := by exact_mod_cast h2 + have hDpos : (0:ℝ) < ((cs.length : ℝ) + 1) + (cs.length : ℝ) / 4 := by positivity + set σ : ℝ := 1 / (((cs.length : ℝ) + 1) + (cs.length : ℝ) / 4) with hσdef + have hσlo : 5/384 ≤ σ := by rw [hσdef, le_div_iff₀ hDpos]; nlinarith [hL60] + have hσhi : σ ≤ 4/49 := by rw [hσdef, div_le_iff₀ hDpos]; nlinarith [hL9] + refine tail_decouple cs ((cs.length : ℝ) / 4) (1/1536 - σ/4) h4 (by positivity) ?_ ?_ + · intro c _ + rw [show (1 : ℝ) / (((cs.length : ℝ) + 1) + (cs.length : ℝ) / 4) = σ from hσdef.symm] + exact phi_lb_deg4 σ hσlo hσhi c + · have htad := tail_all_deg4 ((cs.length : ℝ) + 1) (by linarith) + have hcancel : (cs.length : ℝ) * (1/1536 - σ/4) + + (cs.length : ℝ) / 4 / (((cs.length : ℝ) + 1) + (cs.length : ℝ) / 4) = (cs.length : ℝ) / 1536 := by + rw [hσdef]; field_simp; ring + have harg : (1 : ℝ) + (cs.length : ℝ) / 4 / ((cs.length : ℝ) + 1) + = (5 * ((cs.length : ℝ) + 1) - 1) / (4 * ((cs.length : ℝ) + 1)) := by + field_simp; ring + rw [harg] + linarith [htad, hcancel] + +end BGSCL +end R3Cert diff --git a/proof/formalization/R3Cert/BGSCLSubactionTailWrap.lean b/proof/formalization/R3Cert/BGSCLSubactionTailWrap.lean new file mode 100644 index 00000000..5e36f8f9 --- /dev/null +++ b/proof/formalization/R3Cert/BGSCLSubactionTailWrap.lean @@ -0,0 +1,432 @@ +/- + The tail (deg≥5) STRAGGLER cells + the unified `tail_wrapper` (2026-09-04). + + The `tail_decouple` backbone (`R3Cert.BGSCLSubactionTailDecouple`) already closes the two uniform-reference + regimes of `IsSubaction ρwit` for a tail hub (`d = |cs|+1 ≥ 5`, `ρwit(node cs) = 0`): + * `subaction_tail_deg4` — `|cs| ∈ [9,60]` (deg-4 reference `S0 = |cs|/4`), and + * `subaction_tail_deg5` — `|cs| ≥ 64` (deg-5 reference `S0 = |cs|/5`), + plus the tie cell `subaction_tail_d6` — `|cs| = 5` (all-cherry reference `S0 = 5/3`). + + This file discharges the SEVEN remaining "straggler" degrees and assembles the full-tail closer: + + * CHERRY cells `|cs| ∈ {4,6,7,8}` (degrees `d ∈ {5,7,8,9}`): `tail_decouple` at the all-cherry reference + `S0 = |cs|/3` (`σ = 3/(4d−1)`), per-child min `phi_lb_cherry`, and the B-obligation + `log((4d−1)/(3d)) ≤ (2d−1)F* − (d−1)log(3/2)` = `tail_all_deg2` at the concrete `d` (the `(d−1)/(4d−1)` + terms cancel exactly; `m = a − σ/3`, `a = 2F* − log(3/2)`). + + * BOUNDARY cells `|cs| ∈ {61,62,63}` (degrees `d ∈ {62,63,64}`): the transition zone where neither + `|cs|/4` nor `|cs|/5` is slack enough. Handled by pinning the reference so `σ = 5/384` exactly + (`S0 = 384/5 − d`), per-child min `phi_lb_deg4` (which is TIGHT at `σ = 5/384`, `m = −1/384`), and a + crude `log x ≤ x−1` B-obligation: the log argument collapses to `384/(5d)` and `(384/(5d))¹¹·64/621` + is ≤ `1 + 11·extra` with ample slack. + + * `cherry_anchor_le_tight` — the tight UPPER cherry anchor `2F* − log(3/2) ≤ 133/17061` (the mirror of + `cherry_anchor_ge_tight`; needed nowhere below in the end, since the cherry B-terms cancel exactly, but + delivered as the requested tight upper bound via the exact `(1/11)·log(529/486)` identity). + + Finally `tail_wrapper` dispatches `interval_cases`/`omega` over `|cs|` on the gap-free partition + `{4} ∪ {5} ∪ {6,7,8} ∪ [9,60] ∪ {61,62,63} ∪ [64,∞)`, closing `IsSubaction ρwit` for EVERY tail hub. + + Kernel-checked vs `R3Cert.BGSCLSubactionTailDecouple`/`BGSCLSubactionTail`/`BGSCLSubaction`. No `sorry`. + `conjecture1_proved = False`. +-/ +import Mathlib +import R3Cert.BGSCLInduction +import R3Cert.BGSCLSubaction +import R3Cert.BGSCLSubactionTail +import R3Cert.BGSCLSubactionTailDecouple + +namespace R3Cert +namespace BGSCL + +open Real + +/-! ### The tight UPPER cherry anchor (mirror of `cherry_anchor_ge_tight`). -/ + +/-- **Tight upper cherry anchor** `2F* − log(3/2) ≤ 133/17061`. Mirror of `cherry_anchor_ge_tight`: uses the + exact `2F* − log(3/2) = (1/11)·log(529/486)` (`529/486 = (621/64)²·(2/3)¹¹`) and bounds `log(529/486)` + ABOVE via `529/486 ≤ exp(11·C)` (`Real.log_le_iff_le_exp` + `Real.exp_bound`, a degree-3 Taylor LOWER + bound on `exp`). `133/17061 = 11·(133/17061)/11 ≈ 0.007795`, a clean rational `≥ 2F* − log(3/2) ≈ 0.007707`. -/ +theorem cherry_anchor_le_tight : 2 * FSTAR - Real.log (3/2) ≤ 133/17061 := by + have hkey : (2:ℝ) * FSTAR - Real.log (3/2) = (1/11) * Real.log (529/486) := by + rw [FSTAR, show (529/486:ℝ) = (621/64)^(2:ℕ) * (2/3)^(11:ℕ) by norm_num, + Real.log_mul (by positivity) (by positivity), Real.log_pow, Real.log_pow, + show (2/3:ℝ) = (3/2)⁻¹ by norm_num, Real.log_inv] + push_cast; ring + rw [hkey] + -- 11·(133/17061) = 1463/17061 = 133/1551. Show log(529/486) ≤ 133/1551. + have hlog : Real.log (529/486) ≤ (133:ℝ)/1551 := by + rw [Real.log_le_iff_le_exp (by norm_num)] + have hb := Real.exp_bound (x := (133/1551 : ℝ)) (by norm_num) (n := 3) (by norm_num) + have hb1 := (abs_le.mp hb).1 + have hs : ∑ i ∈ Finset.range 3, (133/1551:ℝ)^i / (i.factorial:ℝ) + = 1 + 133/1551 + (133/1551)^2/2 := by + simp [Finset.sum_range_succ, Nat.factorial] + rw [hs] at hb1 + -- exp(133/1551) ≥ (1 + 133/1551 + (133/1551)²/2) − err ≥ 529/486 + have herr : |(133/1551:ℝ)|^3 * ((3+1)/((Nat.factorial 3:ℝ)*3)) + ≤ (1 + 133/1551 + (133/1551)^2/2) - 529/486 := by + norm_num [Nat.factorial] + linarith [hb1, herr] + linarith [hlog] + +/-! ### The cherry (all-deg-2 reference) per-child min, parameterized by degree. -/ + +/-- **Per-child min for the cherry (all-deg-2) reference.** For any `σ ∈ (0, 3/23]` and `m = a − σ/3` + (`a = 2F* − log(3/2)`), `m + σ·bY c ≤ ρwit c` for every branch. Valid for `σ ∈ [1/11, 3/23]`, the range + covering the four cherry straggler degrees (`σ ∈ {1/8,1/10,1/11}`). The cherry-corner `m = a − σ/3` is + tight at the deg-2 child (`bY = 1/3`); the other child types are dominated using the TIGHT upper anchor + `cherry_anchor_le_tight` (`a ≤ 133/17061`): deg-4 (`a ≤ 1/1536 + σ/12`, the binding constraint that forces + `σ ≥ 1/11`), deg-3 (`3a ≤ σ`), deg-≥5 (`a ≤ (2/15)σ`); leaf via the anchor `1/6 ≤ log(3/2) − F*` + (so `(2/3)σ ≤ (2/3)(3/19) = 2/19 ≤ 1/6`). -/ +theorem phi_lb_cherry (σ : ℝ) (hσlo : 1/11 ≤ σ) (hσhi : σ ≤ 3/19) (c : Branch) : + (2 * FSTAR - Real.log (3/2) - σ/3) + σ * bY c ≤ ρwit c := by + have hσ0 : (0:ℝ) < σ := by linarith + have hy0 := bY_nonneg c + have hyd := bY_le_inv_deg c + have hAub := cherry_anchor_le_tight -- 2F* − log(3/2) ≤ 133/17061 (a ≤ ~0.007796) + -- lower anchor `1/9 ≤ log(3/2) − F*` (needed for σ up to 3/19 in the leaf case, since (2/3)(3/19)=2/19≤1/9): + -- 11·(log(3/2) − F*) = log((3/2)¹¹·64/621) and (3/2)¹¹·64/621 ≈ 8.914 ≥ exp(11/9) ≈ 3.395. + have hEl : (1:ℝ)/9 ≤ Real.log (3/2) - FSTAR := by + rw [FSTAR] + have hY : (0:ℝ) < (3/2 : ℝ) ^ (11:ℕ) * (64/621) := by positivity + have hlog : Real.log ((3/2 : ℝ) ^ (11:ℕ) * (64/621)) + = 11 * Real.log (3/2) - Real.log (621/64) := by + rw [Real.log_mul (by positivity) (by norm_num), Real.log_pow, + show (64/621 : ℝ) = (621/64)⁻¹ by norm_num, Real.log_inv] + push_cast; ring + have hge : (11:ℝ)/9 ≤ Real.log ((3/2 : ℝ) ^ (11:ℕ) * (64/621)) := by + rw [Real.le_log_iff_exp_le hY] + -- exp(11/9) = exp(1)·exp(2/9) ≤ 2.7182818286 · (deg-4 Taylor ub) ≤ 4 ≤ (3/2)¹¹·64/621. + have he29 : Real.exp (2/9 : ℝ) ≤ (1 + 2/9 + (2/9)^2/2 + (2/9)^3/6) + (2/9:ℝ)^4 * ((4+1)/((Nat.factorial 4:ℝ)*4)) := by + have hb := Real.exp_bound (x := (2/9 : ℝ)) (by rw [abs_of_nonneg] <;> norm_num) (n := 4) (by norm_num) + have hhi := (abs_le.mp hb).2 + have hs : ∑ i ∈ Finset.range 4, (2/9:ℝ)^i / (i.factorial:ℝ) + = 1 + 2/9 + (2/9)^2/2 + (2/9)^3/6 := by simp [Finset.sum_range_succ, Nat.factorial] + have habs : |(2/9:ℝ)| = 2/9 := by rw [abs_of_nonneg]; norm_num + rw [hs, habs] at hhi; linarith + have hsplit : Real.exp (11/9 : ℝ) = Real.exp 1 * Real.exp (2/9 : ℝ) := by + rw [← Real.exp_add]; norm_num + calc Real.exp (11/9 : ℝ) = Real.exp 1 * Real.exp (2/9 : ℝ) := hsplit + _ ≤ 2.7182818286 * ((1 + 2/9 + (2/9)^2/2 + (2/9)^3/6) + (2/9:ℝ)^4 * ((4+1)/((Nat.factorial 4:ℝ)*4))) := by + apply mul_le_mul (le_of_lt Real.exp_one_lt_d9) he29 (le_of_lt (Real.exp_pos _)) (by norm_num) + _ ≤ 4 := by norm_num [Nat.factorial] + _ ≤ (3/2 : ℝ) ^ (11:ℕ) * (64/621) := by norm_num + rw [hlog] at hge; linarith + rcases hbc : bcc c with _ | _ | _ | _ | n + · -- leaf: bY = 1, ρwit = F*. + have hby1 : bY c = 1 := by + cases c with + | node cs => simp only [bcc] at hbc; rw [List.length_eq_zero_iff.mp hbc] at *; exact bY_leaf + have hrc : ρwit c = FSTAR := by + cases c with + | node cs => simp only [bcc] at hbc; rw [List.length_eq_zero_iff.mp hbc] at *; exact ρwit_leaf + rw [hby1, hrc] + -- goal ⟺ F* − log(3/2) + (2/3)σ ≤ 0; from hEl (1/6 ≤ log(3/2)−F*) and σ ≤ 3/19 ⇒ (2/3)σ ≤ 2/19 ≤ 1/6. + nlinarith [hEl, hσhi] + · have hby3 : (1:ℝ)/3 ≤ bY c := bY_ge_third_of_bcc1 c hbc + have hrc : ρwit c = 2 * FSTAR - Real.log (3/2) + (1/4) * (bY c - 1/3) := by + simp only [ρwit, hbc] + rw [hrc] + -- goal ⟺ (σ − 1/4)(bY − 1/3) ≤ 0 (deg-2 corner, tight at bY = 1/3). + nlinarith [hσhi, mul_nonneg (show (0:ℝ) ≤ bY c - 1/3 by linarith) + (show (0:ℝ) ≤ 1/4 - σ by linarith)] + · have hby : bY c ≤ 1/3 := by rw [hbc] at hyd; norm_num at hyd; linarith + have hrc : ρwit c = (1/32) * bY c := by simp only [ρwit, hbc] + rw [hrc] + -- (a − σ/3) + σ·bY ≤ bY/32 ⟺ a − σ/3 + bY(σ − 1/32) ≤ 0. σ ≥ 1/11 > 1/32; worst bY = 0: a ≤ σ/3. + -- 3a ≤ 3·(133/17061) ≈ 0.0234 ≤ 1/11 ≤ σ. + nlinarith [hAub, hσlo, hby, hy0, + mul_nonneg hy0 (show (0:ℝ) ≤ σ - 1/32 by linarith)] + · have hby : bY c ≤ 1/4 := by rw [hbc] at hyd; norm_num at hyd; linarith + have hrc : ρwit c = (1/384) * bY c := by simp only [ρwit, hbc] + rw [hrc] + -- (a − σ/3) + σ·bY ≤ bY/384 ⟺ a − σ/3 + bY(σ − 1/384) ≤ 0. worst bY = 1/4: a ≤ 1/1536 + σ/12. + -- a ≤ 133/17061 ≤ 1/1536 + (1/11)/12 ≤ 1/1536 + σ/12. This is the constraint forcing σ ≥ 1/11. + nlinarith [hAub, hσlo, hby, hy0, + mul_nonneg (show (0:ℝ) ≤ 1/4 - bY c by linarith) (show (0:ℝ) ≤ σ - 1/384 by linarith)] + · have hn : (0:ℝ) ≤ (n : ℝ) := Nat.cast_nonneg n + have hby : bY c ≤ 1/5 := by + rw [hbc] at hyd + have hd5 : (5:ℝ) ≤ ((n + 4 : ℕ) : ℝ) + 1 := by push_cast; linarith + have hle : (1:ℝ) / (((n + 4 : ℕ) : ℝ) + 1) ≤ 1/5 := + one_div_le_one_div_of_le (by norm_num) hd5 + linarith + have hrc : ρwit c = 0 := by + cases c with + | node cs => simp only [bcc] at hbc; exact ρwit_node_high (by omega) + rw [hrc] + -- (a − σ/3) + σ·bY ≤ 0. worst bY = 1/5: a ≤ (2/15)σ. a ≤ 133/17061 ≤ (2/15)(1/11). + nlinarith [hAub, hσlo, hby, hy0, mul_nonneg (show (0:ℝ) ≤ σ by linarith) + (show (0:ℝ) ≤ 1/5 - bY c by linarith)] + +/-! ### The four CHERRY straggler cells `d ∈ {5,7,8,9}` (`|cs| ∈ {4,6,7,8}`). + + Each is a `tail_decouple` instantiation with the cherry-corner per-child min `phi_lb_cherry` (`m = a − σ/3`, + `a = 2F* − log(3/2)`). The reference `S0` (hence `σ = 1/(d+S0)`) is chosen in the per-degree feasibility + window `[deg-4 floor, B ceiling]`: the deg-4 CHILD needs `σ ≥ 12(a − 1/1536) ≈ 0.085` (so `σ ≥ 1/11`), while + the B-obligation needs `σ` not too large. + * `d = 5` (`S0 = 4/3`, `σ = 3/19`) and `d = 7` (`S0 = 2`, `σ = 1/9`): the all-cherry reference `S0 = (d−1)/3`, + so B collapses EXACTLY to `tail_all_deg2` at the concrete `d` (the `(d−1)/(4d−1)` terms cancel). + * `d = 8` (`S0 = 2`, `σ = 1/10`) and `d = 9` (`S0 = 2`, `σ = 1/11`): shifted references (the cherry `σ` would + undershoot the deg-4 floor), so B is `log(arg) ≤ F* + rational`, discharged by the exact 11-fold + `11·(log(arg) − F*) = log(arg¹¹·(3/2)^{11(d−1)}·(64/621)^{2d−1})` and a Taylor exp LOWER bound + (`Real.log_le_iff_le_exp` + `Real.exp_bound`): `arg ≤ exp(rational)`. -/ + +/-- **CHERRY cell `d = 5`** (`|cs| = 4`). `S0 = 4/3`, `σ = 3/19`, B = `tail_all_deg2 5`. -/ +theorem subaction_tail_d5 (cs : List Branch) (hlen : cs.length = 4) : + (Real.log (1 + (cs.map bY).sum / ((cs.length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node cs) ≤ (cs.map ρwit).sum := by + have h4 : 4 ≤ cs.length := by omega + refine tail_decouple cs (4/3) (2 * FSTAR - Real.log (3/2) - (3/19)/3) h4 (by norm_num) ?_ ?_ + · intro c _ + have hσ : (1 : ℝ) / (((cs.length : ℝ) + 1) + 4/3) = 3/19 := by rw [hlen]; norm_num + rw [hσ]; exact phi_lb_cherry (3/19) (by norm_num) (by norm_num) c + · rw [hlen]; push_cast + rw [show (1 : ℝ) + 4/3 / (4 + 1) = 19/15 by norm_num, + show (4:ℝ)/3 / ((4 + 1) + 4/3) = 4/19 by norm_num] + have h := tail_all_deg2 5 (by norm_num) + push_cast at h + rw [show (4 * (5:ℝ) - 1) / (3 * 5) = 19/15 by norm_num] at h + linarith + +/-- **CHERRY cell `d = 7`** (`|cs| = 6`). `S0 = 2`, `σ = 3/27 = 1/9`, B = `tail_all_deg2 7`. -/ +theorem subaction_tail_d7 (cs : List Branch) (hlen : cs.length = 6) : + (Real.log (1 + (cs.map bY).sum / ((cs.length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node cs) ≤ (cs.map ρwit).sum := by + have h4 : 4 ≤ cs.length := by omega + refine tail_decouple cs 2 (2 * FSTAR - Real.log (3/2) - (1/9)/3) h4 (by norm_num) ?_ ?_ + · intro c _ + have hσ : (1 : ℝ) / (((cs.length : ℝ) + 1) + 2) = 1/9 := by rw [hlen]; norm_num + rw [hσ]; exact phi_lb_cherry (1/9) (by norm_num) (by norm_num) c + · rw [hlen]; push_cast + rw [show (1 : ℝ) + 2 / (6 + 1) = 9/7 by norm_num, + show (2:ℝ) / ((6 + 1) + 2) = 2/9 by norm_num] + have h := tail_all_deg2 7 (by norm_num) + push_cast at h + rw [show (4 * (7:ℝ) - 1) / (3 * 7) = 9/7 by norm_num] at h + linarith + +/-- The d=8 B-fold: `log(5/4) ≤ (15·F* − 7·log(3/2)) − 1/30`, i.e. `arg = 5/4` meets the shifted reference. + Exact 11-fold `11·log(5/4) − 15·log(621/64) + 77·log(3/2) = log(val)`, `val = (5/4)¹¹·(3/2)⁷⁷·(64/621)¹⁵ ≈ 0.663`; + since `−11/30 < 0`, `log(val) ≤ −11/30 ⟺ val ≤ exp(−11/30) = 1/exp(11/30)`, reduced to `val ≤ 1/tub` where + `tub ≥ exp(11/30)` is a degree-3 Taylor UPPER bound on `exp` (`Real.exp_bound`). -/ +theorem henc_cherry_d8 : Real.log (5/4) ≤ (15 * FSTAR - 7 * Real.log (3/2)) - 1/30 := by + set val : ℝ := (5/4:ℝ)^(11:ℕ) * (3/2:ℝ)^(77:ℕ) * ((621/64:ℝ)^(15:ℕ))⁻¹ with hvaldef + have hvalpos : (0:ℝ) < val := by rw [hvaldef]; positivity + have hlog : Real.log val = 11 * Real.log (5/4) + 77 * Real.log (3/2) - 15 * Real.log (621/64) := by + rw [hvaldef, Real.log_mul (by positivity) (by positivity), + Real.log_mul (by positivity) (by positivity), + Real.log_inv, Real.log_pow, Real.log_pow, Real.log_pow] + push_cast; ring + -- exp(11/30) ≤ 1 + 11/30 + (11/30)²/2 + err (degree-3 Taylor UPPER bound); call the RHS `tub`. + have hb := Real.exp_bound (x := (11/30 : ℝ)) (by norm_num) (n := 3) (by norm_num) + have hhi := (abs_le.mp hb).2 + have hs : ∑ i ∈ Finset.range 3, (11/30:ℝ)^i / (i.factorial:ℝ) = 1 + 11/30 + (11/30)^2/2 := by + simp [Finset.sum_range_succ, Nat.factorial] + rw [hs] at hhi + have hexpub : Real.exp (11/30) ≤ (2140657 : ℝ)/1458000 := by + have herr : (1 + 11/30 + (11/30)^2/2) + |(11/30:ℝ)|^3 * ((3+1)/((Nat.factorial 3:ℝ)*3)) + ≤ (2140657 : ℝ)/1458000 := by norm_num [Nat.factorial] + linarith [hhi, herr] + have hexppos : (0:ℝ) < Real.exp (11/30) := Real.exp_pos _ + -- val ≤ exp(−11/30) = 1/exp(11/30); since exp(11/30) ≤ tub and val·tub ≤ 1. + have hvalle : val ≤ Real.exp (-(11/30)) := by + rw [Real.exp_neg] + rw [le_inv_comm₀ hvalpos hexppos] + calc Real.exp (11/30) ≤ (2140657:ℝ)/1458000 := hexpub + _ ≤ val⁻¹ := by rw [hvaldef, le_inv_comm₀ (by norm_num) (by positivity)]; norm_num + have hfinal : Real.log val ≤ -(11/30) := by + rw [Real.log_le_iff_le_exp hvalpos]; exact hvalle + rw [hlog] at hfinal + simp only [FSTAR] + linarith + +/-- **CHERRY cell `d = 8`** (`|cs| = 7`). Shifted reference `S0 = 2` (`σ = 1/10`); B via `henc_cherry_d8`. -/ +theorem subaction_tail_d8 (cs : List Branch) (hlen : cs.length = 7) : + (Real.log (1 + (cs.map bY).sum / ((cs.length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node cs) ≤ (cs.map ρwit).sum := by + have h4 : 4 ≤ cs.length := by omega + refine tail_decouple cs 2 (2 * FSTAR - Real.log (3/2) - (1/10)/3) h4 (by norm_num) ?_ ?_ + · intro c _ + have hσ : (1 : ℝ) / (((cs.length : ℝ) + 1) + 2) = 1/10 := by rw [hlen]; norm_num + rw [hσ]; exact phi_lb_cherry (1/10) (by norm_num) (by norm_num) c + · rw [hlen]; push_cast + rw [show (1 : ℝ) + 2 / (7 + 1) = 5/4 by norm_num, + show (2:ℝ) / ((7 + 1) + 2) = 1/5 by norm_num] + -- B: 0 ≤ 7·(a − 1/30) + F* − log(5/4) + 1/5, a = 2F* − log(3/2). + -- ⟺ log(5/4) ≤ 7·(2F* − log(3/2)) + F* − 7/30 + 1/5 = 15F* − 7log(3/2) − 1/30. + have h := henc_cherry_d8 + linarith + +/-- The d=9 B-fold: `log(11/9) ≤ (17·F* − 8·log(3/2)) − 2/33`. Exact 11-fold + `11·log(11/9) − 17·log(621/64) + 88·log(3/2) = log(val)`, `val = (11/9)¹¹·(3/2)⁸⁸·(64/621)¹⁷ ≈ 0.476`; + `log(val) ≤ −2/3 ⟺ val ≤ exp(−2/3) = 1/exp(2/3)`, reduced to `val ≤ 1/2` (`exp(2/3) ≤ 2`, a degree-4 + Taylor UPPER bound). -/ +theorem henc_cherry_d9 : Real.log (11/9) ≤ (17 * FSTAR - 8 * Real.log (3/2)) - 2/33 := by + set val : ℝ := (11/9:ℝ)^(11:ℕ) * (3/2:ℝ)^(88:ℕ) * ((621/64:ℝ)^(17:ℕ))⁻¹ with hvaldef + have hvalpos : (0:ℝ) < val := by rw [hvaldef]; positivity + have hlog : Real.log val = 11 * Real.log (11/9) + 88 * Real.log (3/2) - 17 * Real.log (621/64) := by + rw [hvaldef, Real.log_mul (by positivity) (by positivity), + Real.log_mul (by positivity) (by positivity), + Real.log_inv, Real.log_pow, Real.log_pow, Real.log_pow] + push_cast; ring + -- exp(2/3) ≤ 2 (degree-4 Taylor UPPER bound) + have hb := Real.exp_bound (x := (2/3 : ℝ)) (by norm_num) (n := 4) (by norm_num) + have hhi := (abs_le.mp hb).2 + have hs : ∑ i ∈ Finset.range 4, (2/3:ℝ)^i / (i.factorial:ℝ) + = 1 + 2/3 + (2/3)^2/2 + (2/3)^3/6 := by + simp [Finset.sum_range_succ, Nat.factorial] + rw [hs] at hhi + have hexpub : Real.exp (2/3) ≤ (2:ℝ) := by + have herr : (1 + 2/3 + (2/3)^2/2 + (2/3)^3/6) + |(2/3:ℝ)|^4 * ((4+1)/((Nat.factorial 4:ℝ)*4)) + ≤ (2:ℝ) := by norm_num [Nat.factorial] + linarith [hhi, herr] + have hexppos : (0:ℝ) < Real.exp (2/3) := Real.exp_pos _ + have hvalle : val ≤ Real.exp (-(2/3)) := by + rw [Real.exp_neg, le_inv_comm₀ hvalpos hexppos] + calc Real.exp (2/3) ≤ (2:ℝ) := hexpub + _ ≤ val⁻¹ := by rw [hvaldef, le_inv_comm₀ (by norm_num) (by positivity)]; norm_num + have hfinal : Real.log val ≤ -(2/3) := by + rw [Real.log_le_iff_le_exp hvalpos]; exact hvalle + rw [hlog] at hfinal + simp only [FSTAR] + linarith + +/-- **CHERRY cell `d = 9`** (`|cs| = 8`). Shifted reference `S0 = 2` (`σ = 1/11`); B via `henc_cherry_d9`. -/ +theorem subaction_tail_d9 (cs : List Branch) (hlen : cs.length = 8) : + (Real.log (1 + (cs.map bY).sum / ((cs.length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node cs) ≤ (cs.map ρwit).sum := by + have h4 : 4 ≤ cs.length := by omega + refine tail_decouple cs 2 (2 * FSTAR - Real.log (3/2) - (1/11)/3) h4 (by norm_num) ?_ ?_ + · intro c _ + have hσ : (1 : ℝ) / (((cs.length : ℝ) + 1) + 2) = 1/11 := by rw [hlen]; norm_num + rw [hσ]; exact phi_lb_cherry (1/11) (by norm_num) (by norm_num) c + · rw [hlen]; push_cast + rw [show (1 : ℝ) + 2 / (8 + 1) = 11/9 by norm_num, + show (2:ℝ) / ((8 + 1) + 2) = 2/11 by norm_num] + -- B ⟺ log(11/9) ≤ 8·(2F* − log(3/2)) + F* − 8/33 + 2/11 = 17F* − 8log(3/2) − 2/33. + have h := henc_cherry_d9 + linarith + + +/-! ### The three BOUNDARY straggler cells `d ∈ {62,63,64}` (`|cs| ∈ {61,62,63}`). + + The transition zone. Pin the reference so `σ = 5/384` exactly (`S0 = 384/5 − d`, `d = |cs|+1`): then the + deg-4 per-child min `phi_lb_deg4` applies at its tight lower corner (`m = 1/1536 − (5/384)/4 = −1/384`), and + the log argument at the reference collapses to `384/(5d)` (since `(|cs|+1) + S0 = 384/5`). The B-obligation + `log(384/(5d)) ≤ F* + extra` is discharged by the exact fold `11·(log(384/(5d)) − F*) = log((384/(5d))¹¹·64/621)` + and the crude `log x ≤ x − 1` (the fold value is ≤ `1 + 11·extra` with wide slack). -/ + +/-- Shared boundary closer: for a tail hub with `|cs| = L`, reference `S0 = 384/5 − (L+1)` (so `σ = 5/384`), + given `S0 ≥ 0` and the B-obligation as a raw numeric inequality. -/ +private theorem tail_boundary_cell (cs : List Branch) (L : ℕ) (hLge : 4 ≤ L) (hlen : cs.length = L) + (hS0 : (0:ℝ) ≤ 384/5 - ((L:ℝ) + 1)) + (hB : (0:ℝ) ≤ (L:ℝ) * (-1/384) + + (FSTAR - Real.log (1 + (384/5 - ((L:ℝ)+1)) / ((L:ℝ) + 1)) + + (384/5 - ((L:ℝ)+1)) / (((L:ℝ) + 1) + (384/5 - ((L:ℝ)+1))))) : + (Real.log (1 + (cs.map bY).sum / ((cs.length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node cs) ≤ (cs.map ρwit).sum := by + have h4 : 4 ≤ cs.length := by omega + subst hlen + refine tail_decouple cs (384/5 - ((cs.length:ℝ)+1)) (-1/384) h4 hS0 ?_ hB + · intro c _ + have hσ : (1 : ℝ) / (((cs.length : ℝ) + 1) + (384/5 - ((cs.length:ℝ)+1))) = 5/384 := by + have : ((cs.length : ℝ) + 1) + (384/5 - ((cs.length:ℝ)+1)) = 384/5 := by ring + rw [this]; norm_num + rw [hσ] + have := phi_lb_deg4 (5/384) (by norm_num) (by norm_num) c + -- phi_lb_deg4 gives (1/1536 − (5/384)/4) + (5/384)·bY ≤ ρwit; 1/1536 − 5/1536 = −1/384 + have heq : (1/1536 - (5/384)/4 : ℝ) = -1/384 := by norm_num + rw [heq] at this + exact this + +/-- Discharge the boundary B-obligation for a concrete `|cs| = L` via the exact fold and `log x ≤ x − 1`. + `arg = 1 + S0/(L+1) = 384/(5(L+1))`; `11·(log arg − F*) = log(arg¹¹·64/621)`; the fold value is + `≤ 1 + 11·extra`, so `log(fold) ≤ 11·extra` and `B ≥ 0`. -/ +private theorem tail_boundary_B (L : ℕ) (hL : 61 ≤ L) (hL2 : L ≤ 63) : + (0:ℝ) ≤ (L:ℝ) * (-1/384) + + (FSTAR - Real.log (1 + (384/5 - ((L:ℝ)+1)) / ((L:ℝ) + 1)) + + (384/5 - ((L:ℝ)+1)) / (((L:ℝ) + 1) + (384/5 - ((L:ℝ)+1)))) := by + -- (L+1)+S0 = 384/5, so the last term is S0/(384/5) = 5·S0/384; and arg = (384/5)/(L+1). + have hden : ((L:ℝ) + 1) + (384/5 - ((L:ℝ)+1)) = 384/5 := by ring + have hLpos : (0:ℝ) < (L:ℝ) + 1 := by positivity + have harg : (1:ℝ) + (384/5 - ((L:ℝ)+1)) / ((L:ℝ) + 1) = (384/5) / ((L:ℝ) + 1) := by + rw [eq_div_iff (ne_of_gt hLpos), add_mul, div_mul_cancel₀ _ (ne_of_gt hLpos), one_mul]; ring + rw [hden, harg] + -- Let A = (384/5)/(L+1). Bound log A ≤ F* + [ (5·S0/384) − L/384 ] =: F* + extra. + -- Exact: 11·(log A − F*) = log(A¹¹ · 64/621) ≤ A¹¹·64/621 − 1. Suffices A¹¹·64/621 − 1 ≤ 11·extra. + have hApos : (0:ℝ) < (384/5) / ((L:ℝ) + 1) := by positivity + -- 11·log A − log(621/64) = log(A¹¹ · 64/621) + have hlog11 : (11:ℝ) * Real.log ((384/5) / ((L:ℝ) + 1)) - Real.log (621/64) + = Real.log (((384/5) / ((L:ℝ) + 1))^(11:ℕ) * (64/621)) := by + rw [Real.log_mul (by positivity) (by norm_num), Real.log_pow, + show (64/621:ℝ) = (621/64)⁻¹ by norm_num, Real.log_inv] + push_cast; ring + have hfold := Real.log_le_sub_one_of_pos + (show (0:ℝ) < ((384/5) / ((L:ℝ) + 1))^(11:ℕ) * (64/621) by positivity) + rw [← hlog11] at hfold + -- Now bound the fold value − 1 by 11·extra, and F* = log(621/64)/11. + interval_cases L + · -- L = 61 + have hv : (((384/5:ℝ) / ((61:ℝ) + 1))^(11:ℕ) * (64/621)) - 1 ≤ 11 * ((5 * (384/5 - 62) / 384) - 61/384) := by + norm_num + simp only [FSTAR] + push_cast at hfold ⊢ + nlinarith [hfold, hv] + · -- L = 62 + have hv : (((384/5:ℝ) / ((62:ℝ) + 1))^(11:ℕ) * (64/621)) - 1 ≤ 11 * ((5 * (384/5 - 63) / 384) - 62/384) := by + norm_num + simp only [FSTAR] + push_cast at hfold ⊢ + nlinarith [hfold, hv] + · -- L = 63 + have hv : (((384/5:ℝ) / ((63:ℝ) + 1))^(11:ℕ) * (64/621)) - 1 ≤ 11 * ((5 * (384/5 - 64) / 384) - 63/384) := by + norm_num + simp only [FSTAR] + push_cast at hfold ⊢ + nlinarith [hfold, hv] + +/-- **BOUNDARY cell `d = 62`** (`|cs| = 61`). -/ +theorem subaction_tail_d62 (cs : List Branch) (hlen : cs.length = 61) : + (Real.log (1 + (cs.map bY).sum / ((cs.length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node cs) ≤ (cs.map ρwit).sum := + tail_boundary_cell cs 61 (by norm_num) hlen (by norm_num) (tail_boundary_B 61 (by norm_num) (by norm_num)) + +/-- **BOUNDARY cell `d = 63`** (`|cs| = 62`). -/ +theorem subaction_tail_d63 (cs : List Branch) (hlen : cs.length = 62) : + (Real.log (1 + (cs.map bY).sum / ((cs.length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node cs) ≤ (cs.map ρwit).sum := + tail_boundary_cell cs 62 (by norm_num) hlen (by norm_num) (tail_boundary_B 62 (by norm_num) (by norm_num)) + +/-- **BOUNDARY cell `d = 64`** (`|cs| = 63`). -/ +theorem subaction_tail_d64 (cs : List Branch) (hlen : cs.length = 63) : + (Real.log (1 + (cs.map bY).sum / ((cs.length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node cs) ≤ (cs.map ρwit).sum := + tail_boundary_cell cs 63 (by norm_num) hlen (by norm_num) (tail_boundary_B 63 (by norm_num) (by norm_num)) + +/-! ### The unified tail wrapper. -/ + +/-- **`tail_wrapper`.** `IsSubaction ρwit` at EVERY tail hub (`|cs| ≥ 4`, degree `≥ 5`), unifying all tail + cells over the gap-free partition of `|cs|`: + `{4} → d5`, `{5} → d6`, `{6,7,8} → d7/d8/d9`, `[9,60] → deg4`, `{61,62,63} → d62/d63/d64`, `[64,∞) → deg5`. -/ +theorem tail_wrapper (cs : List Branch) (hlen : 4 ≤ cs.length) : + (Real.log (1 + (cs.map bY).sum / ((cs.length : ℝ) + 1)) - FSTAR) + + ρwit (Branch.node cs) ≤ (cs.map ρwit).sum := by + rcases (show cs.length = 4 ∨ cs.length = 5 ∨ cs.length = 6 ∨ cs.length = 7 ∨ cs.length = 8 + ∨ (9 ≤ cs.length ∧ cs.length ≤ 60) ∨ cs.length = 61 ∨ cs.length = 62 ∨ cs.length = 63 + ∨ 64 ≤ cs.length by omega) with + h | h | h | h | h | ⟨h1, h2⟩ | h | h | h | h + · exact subaction_tail_d5 cs h + · exact subaction_tail_d6 cs h + · exact subaction_tail_d7 cs h + · exact subaction_tail_d8 cs h + · exact subaction_tail_d9 cs h + · exact subaction_tail_deg4 cs h1 h2 + · exact subaction_tail_d62 cs h + · exact subaction_tail_d63 cs h + · exact subaction_tail_d64 cs h + · exact subaction_tail_deg5 cs h + +end BGSCL +end R3Cert