From f6672c1a77d67b6257c43acaf5a4481b28fd87e0 Mon Sep 17 00:00:00 2001 From: Dylan Roy <249851642+d6g8k5htny-coder@users.noreply.github.com> Date: Mon, 5 Oct 2026 08:33:51 -0700 Subject: [PATCH] formal: compile agent6/7 finite-measure and interval-family companions Four additive declarations adapted from Grok Bot agent6/7 proposals #277/#278. Executable packaging/tests: Dylan Roy delegated AI work, OpenAI GPT-6 Astra Pro. Retain all36 predecessor proofs, gate, pins and scientific registers. Scientific effect NONE. Execution and statement alignment require actual evidence. --- formal/MOMENT_GENERALITY.md | 90 ++++++++++++ formal/README.md | 6 +- formal/ResearchFormalCoreR1.lean | 1 + .../MomentGenerality.lean | 95 ++++++++++++ formal/SCOPE.md | 15 +- formal/manifest.json | 22 ++- formal/tests/test_moment_generality.py | 136 ++++++++++++++++++ formal/tests/test_moment_tail.py | 4 +- 8 files changed, 358 insertions(+), 11 deletions(-) create mode 100644 formal/MOMENT_GENERALITY.md create mode 100644 formal/ResearchFormalCoreR1/MomentGenerality.lean create mode 100644 formal/tests/test_moment_generality.py diff --git a/formal/MOMENT_GENERALITY.md b/formal/MOMENT_GENERALITY.md new file mode 100644 index 000000000..b7cdbe5a3 --- /dev/null +++ b/formal/MOMENT_GENERALITY.md @@ -0,0 +1,90 @@ +# Finite-measure and interval-only companions + +Scientific effect: NONE. Executable adaptation, tests and packaging: Dylan Roy — +delegated AI work; actual performer OpenAI / GPT-6 Astra Pro, 2026-10-05. +Proposal contributors: Grok Bot agents 6 (L6 / MT-N2) and 7 (L7 / MT-N1). +Their underlying providers/models are not established by their role labels. +Source progress is proof supplied; only an exact execution receipt establishes +kernel evidence. Source-to-statement alignment requires a separate actual review. + +## Consumed sources and authorship + +All references below are in `d6g8k5htny-coder/Math-`. + +- Integration base: `a44db48f10ea27c93595840118457a39a5bbbea4`. +- Retained `formal/ResearchFormalCoreR1/MomentTail.lean`: SHA256 + `87fe3ee90afc52d8c2652881f1ae195d1b0b15a2ffc18c84d6166d1a4d0de2aa`. +- Audit motivating the two generalizations: #276, + `reviews/moment_tail_alignment_20261005/REVIEW.md` at + `0cb17c1b836651144486d55788eef8d7cf532081`, notes MT-N1 and MT-N2. +- Agent 6 proposal, #277 at `d1267a6106e8180eeb75fa008ce09de9ad8065ca`: + `reviews/lean_cycle2_20261005/agent6/MomentTail_finite_MT_N2.lean.txt`. +- Agent 7 proposal, #278 at `cf58e5b812699cd7016441c0b477b86fecb7017f`: + `reviews/lean_cycle2_20261005/agent7/MomentTail_family_interval_MT_N1.lean.txt`. + +Those immutable proposal files remain UNCOMPILED historical proposals; their PR +checks do not compile text files. This new module preserves all four proposed +theorem types and the first three proofs, apart from comments/packaging. The final +specialization proof uses a direct conjunction pair instead of repeatedly +projecting and reconstructing the same hypothesis tuple. No original source or +proposal is overwritten, and no contributor is silently relabeled as OpenAI. + +## Exact four-target extension: 36 to 40 + +All names below are in `ResearchFormalCoreR1`. + +| Target | Exact conclusion and retained requirements | +|---|---| +| `p02_lm009_moment40_tail_finite` | For a finite measure, positive r and epsilon, integrable R^40 and its integral bounded by M, the real mass of `{epsilon < r R^5}` is at most `(M/epsilon^8)r^8`. | +| `p02_lm009_moment40_tail_of_finite` | Recovers the probability-measure version as a specialization of the finite-measure companion. | +| `p02_lm009_moment40_family_r3_interval` | Produces one nonnegative C for every 0 R x ^ 40) μ) + (hMbound : (∫ x, R x ^ 40 ∂μ) ≤ M) : + (μ (badJetEvent R r ε)).toReal ≤ (M / ε ^ 8) * r ^ 8 := by + have hnonneg : 0 ≤ᵐ[μ] (fun x => R x ^ 40) := by + apply Filter.Eventually.of_forall + intro x + positivity + have ha : 0 < (ε / r) ^ 8 := pow_pos (div_pos hε hr) 8 + calc + (μ (badJetEvent R r ε)).toReal ≤ (∫ x, R x ^ 40 ∂μ) / (ε / r) ^ 8 := + p02_lm009_markov_event μ (fun x => R x ^ 40) (badJetEvent R r ε) + hRi hnonneg ((ε / r) ^ 8) ha (p02_lm009_badJet_subset R r ε hr hε) + _ ≤ M / (ε / r) ^ 8 := div_le_div_of_nonneg_right hMbound ha.le + _ = (M / ε ^ 8) * r ^ 8 := by + field_simp [ne_of_gt hr, ne_of_gt hε] + +/-- The original probability-space conclusion specializes from the finite +measure companion. This does not replace or edit the original declaration. -/ +theorem p02_lm009_moment40_tail_of_finite + (μ : Measure Ω) [IsProbabilityMeasure μ] (R : Ω → ℝ) + (r ε M : ℝ) (hr : 0 < r) (hε : 0 < ε) + (hRi : Integrable (fun x => R x ^ 40) μ) + (hMbound : (∫ x, R x ^ 40 ∂μ) ≤ M) : + (μ (badJetEvent R r ε)).toReal ≤ (M / ε ^ 8) * r ^ 8 := + p02_lm009_moment40_tail_finite μ R r ε M hr hε hRi hMbound + +/-- One fixed cubic constant, with probability and all model bounds required +only on 0 < r ≤ r0. No probability assumption is made outside that interval. -/ +theorem p02_lm009_moment40_family_r3_interval + (μ : ℝ → Measure Ω) + (W R : ℝ → Ω → ℝ) (r0 ε M cW cZ : ℝ) + (hr0 : 0 < r0 ∧ r0 ≤ 1) (hε : 0 < ε) + (hM : 0 ≤ M) (hcW : 0 ≤ cW) (hcZ : 0 < cZ) + (hdata : ∀ r, 0 < r → r ≤ r0 → + IsProbabilityMeasure (μ r) ∧ + MemLp (W r) 2 (μ r) ∧ (0 ≤ᵐ[μ r] W r) ∧ Measurable (R r) ∧ + Integrable (fun x => R r x ^ 40) (μ r) ∧ + (∫ x, R r x ^ 40 ∂(μ r)) ≤ M ∧ + (∫ x, W r x ^ 2 ∂(μ r)) ≤ cW * r ^ 4 ∧ + cZ * r ^ 2 ≤ ∫ x, W r x ∂(μ r)) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ r, 0 < r → r ≤ r0 → + IsProbabilityMeasure (weightedLaw (μ r) (W r)) ∧ + (weightedLaw (μ r) (W r) (badJetEvent (R r) r ε)).toReal ≤ C * r ^ 3 := by + refine ⟨(Real.sqrt cW / cZ) * Real.sqrt (M / ε ^ 8), by positivity, ?_⟩ + intro r hr hrr0 + obtain ⟨hProb, hW, hW0, hR, hRi, hMb, hsecond, hlower⟩ := hdata r hr hrr0 + letI : IsProbabilityMeasure (μ r) := hProb + exact p02_lm009_moment40_weighted_r3 (μ r) (W r) (R r) hW hW0 hR + r ε M cW cZ hr (hrr0.trans hr0.2) hε hM hcW hcZ hRi hMb hsecond hlower + +/-- A globally supplied probability family is a specialization of the interval +version, so the previous interface is retained without changing its source. -/ +theorem p02_lm009_moment40_family_r3_of_interval + (μ : ℝ → Measure Ω) [∀ r, IsProbabilityMeasure (μ r)] + (W R : ℝ → Ω → ℝ) (r0 ε M cW cZ : ℝ) + (hr0 : 0 < r0 ∧ r0 ≤ 1) (hε : 0 < ε) + (hM : 0 ≤ M) (hcW : 0 ≤ cW) (hcZ : 0 < cZ) + (hdata : ∀ r, 0 < r → r ≤ r0 → + MemLp (W r) 2 (μ r) ∧ (0 ≤ᵐ[μ r] W r) ∧ Measurable (R r) ∧ + Integrable (fun x => R r x ^ 40) (μ r) ∧ + (∫ x, R r x ^ 40 ∂(μ r)) ≤ M ∧ + (∫ x, W r x ^ 2 ∂(μ r)) ≤ cW * r ^ 4 ∧ + cZ * r ^ 2 ≤ ∫ x, W r x ∂(μ r)) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ r, 0 < r → r ≤ r0 → + IsProbabilityMeasure (weightedLaw (μ r) (W r)) ∧ + (weightedLaw (μ r) (W r) (badJetEvent (R r) r ε)).toReal ≤ C * r ^ 3 := + p02_lm009_moment40_family_r3_interval μ W R r0 ε M cW cZ hr0 hε hM hcW hcZ + (fun r hr hrr0 => ⟨inferInstance, hdata r hr hrr0⟩) + +end ResearchFormalCoreR1 diff --git a/formal/SCOPE.md b/formal/SCOPE.md index a892d5609..5b959f619 100644 --- a/formal/SCOPE.md +++ b/formal/SCOPE.md @@ -57,7 +57,7 @@ No existing review is silently rebound to the changed manifest or scope. ## Additive moment-to-tail composition (seven further declarations) -The current total is 36 theorem targets. [MOMENT_TAIL.md](MOMENT_TAIL.md) is the +This retained layer has 36 theorem targets. [MOMENT_TAIL.md](MOMENT_TAIL.md) is the hash-bound scope for `MomentTail.lean`: actual finite-measure Markov inequality, strict-event measurability/threshold inclusion, the fortieth-moment-to-eighth-order event tail, fourth-order and cubic weighted probability bounds, and an explicit @@ -69,6 +69,19 @@ parent theorem is established. All earlier29 proof bytes, the executable gate and its five rejection controls are unchanged. Existing package-level alignment records do not automatically cover these new targets or changed scope. +## Additive generality companions (four further declarations) + +The total is now 40 theorem targets. [MOMENT_GENERALITY.md](MOMENT_GENERALITY.md) +binds the exact scope and contributor/source identities for `MomentGenerality.lean`. +The finite-measure fortieth-moment tail keeps the exact `(M/epsilon^8)r^8` +constant, with no normalization by total mass. The interval-only family requires +probability and all fixed model bounds only for 0