Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions formal/MEASURE_BRIDGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Same-law measure-theoretic transfer companions

Scientific effect: NONE. Author: Dylan Roy — delegated AI work; actual performer
OpenAI / GPT-6 Astra Pro, ChatGPT session of 2026-10-05. These are new companions,
not edits to GP-FOR-192, its original modules, or an existing analytic proof.
Statement alignment is PENDING_INDEPENDENT_REVIEW. A supplied proof is not a claim
of successful Lean execution; only the actual exact-commit receipt can establish it.

## Source and dependency identity

The informal interface is P02-LM-008, LCR-CAP-024-v1.0, §§2–3 and §§6–8:
`d6g8k5htny-coder/Math-`, commit
`22876edaaec054d3ab8b0b16668ce3ff8cbf8c73`, path
`imports/hardening_ebedb780/P02-LM-008/proof.md.export.txt`.
This is a read-only correspondence reference, not a newly authenticated historical
review. The new source module consumes the unchanged scalar companions, whose
SHA-256 remains `338452a0c2ba24d016059354d543cc995b8cb29c9d4a41d98bb93499f5f8cb8f`.
Lean stays at `leanprover/lean4:v4.34.1`; mathlib stays at
`d13f23b723b8a846827a245b89c10fc7d3f11612`. Its
`MeasureTheory.integral_mul_le_Lp_mul_Lq_of_nonneg` in
`Mathlib/MeasureTheory/Integral/Bochner/Basic.lean` is specialized to exponents 2,2.

## Exact mathematical interface

Let μ be one probability measure, W an almost-everywhere nonnegative real function
with `MemLp W 2 μ`, and A a measurable event. Write

q = (μ A).toReal, n = ∫_A W dμ, z = ∫ W dμ, M₂ = ∫ W² dμ.

The new declarations have the following coverage:

| Declaration suffix | Established implication |
|---|---|
| `p02_lm008_integral_cs` | Actual Bochner-integral Cauchy–Schwarz for nonnegative L² functions on a measure space, with no probability-measure restriction. |
| `p02_lm008_event_cs` | n ≤ √M₂ √q, using the measurable event indicator under the identical μ. |
| `p02_lm008_event_numerator` | M₂ ≤ cW r⁴ and cW ≥ 0 imply n ≤ √cW r² √q. |
| `p02_lm008_measure_transfer` | With r > 0, cZ > 0, cW ≥ 0, M₂ ≤ cW r⁴ and cZ r² ≤ z, derive z > 0 and n/z ≤ (√cW/cZ)√q. |
| `p02_lm009_measure_transfer_r8_to_r3` | Also q ≤ K r⁸, K ≥ 0 and r ≤ 1 imply n/z ≤ ((√cW/cZ)√K)r³, via the stronger intermediate fourth-order bound. |
| `p02_lm008_sqrt_counterexample` | Exact scalar sharpness/negative witness for omitting √q. |
| `p02_lm008_upper_normalizer_counterexample` | Exact scalar witness showing an upper normalizer bound cannot replace the required lower one. |

The common μ and W occur in the theorem types, not just in documentation. No
independence of A and W is assumed. Null/full events and zero weights on A are
allowed; the positive-normalizer hypothesis excludes the identically zero weight
from the ratio theorem. `MemLp` supplies genuine square-integrability rather than
using Lean's totalized integral to interpret a divergent second moment as zero.

## Deliberate remaining obligations

These are pointwise-in-r theorems. They do not construct a random field, a
conditioned law, a normalized `withDensity` probability measure, or a typed Palm
law. In particular PT1 (construction of the reweighted probability law) in the
informal source is not formalized here. The ratio is the interface being bounded.

A concrete application must still prove its own L²/measurability assumptions,
second-moment estimate, lower normalizer and event tail under this exact law and
weight, together with constant uniformity. GP214's upper bound supplies none of
the lower-normalizer premise. No Gaussian or GT5 assertion, family asymptotic,
exponential/super-polynomial corollary, P02-LM-006, P02-LM-007, P0.2, or parent
persistence theorem is closed by these companions. Historical source labels and
reviews are preserved, not promoted or transferred to this new code.

## Controls and execution

The existing gate is unchanged. It builds the complete registered package,
rechecks it with leanchecker, prints types and transitive axioms for all 20
declarations, and runs its original five rejection controls. All seven new
declarations are included in the same target/axiom inventory; the two counterexample
declarations are additional kernel propositions, not two extra rejection runs.

`tests/test_measure_bridge.py` adds 11 focused tests. Its 216 exact three-point
cases check the squared Cauchy–Schwarz and normalized bounds, dependent events,
zero weights and null/full events. Separate rational models expose removal of the
event square root, upper-for-lower normalization, first-for-second-moment and
cross-law substitution. These tests check finite models and source wiring only;
they cannot replace Lean execution or a semantic alignment review.

Review requests must identify the actual provider/family/agent and the exact new
manifest/scope. An OpenAI author replay or same-account commentary is not an
independent alignment acceptance. Existing gate/schema/toolchain and all original
proof bytes remain unchanged.
10 changes: 7 additions & 3 deletions formal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,20 @@ cd ..
python formal/gate.py --execute
```

The source-only command does not run Lean. The execute command fails unless the pinned project builds, `leanchecker` rechecks the package, all 13 declarations have transitive axiom reports restricted to propext/Classical.choice/Quot.sound, and five executable negative controls are rejected. It writes logs and a receipt in `.lake/formal-evidence/`; the workflow uploads them even on failure. A receipt from arbitrary input is not trusted evidence: use the successful read-only workflow and checked Git commit.
The source-only command does not run Lean. The execute command fails unless the pinned project builds, `leanchecker` rechecks the package, all 20 declarations have transitive axiom reports restricted to propext/Classical.choice/Quot.sound, and five executable negative controls are rejected. It writes logs and a receipt in `.lake/formal-evidence/`; the workflow uploads them even on failure. A receipt from arbitrary input is not trusted evidence: use the successful read-only workflow and checked Git commit.

Sources: [scope](SCOPE.md), [glossary](GLOSSARY.md), [manifest](manifest.json), [blueprint source](blueprint/src/content.tex). The original GP-FOR-192 bytes are preserved under originals/*.lean.txt; separately named V2 companions carry the documented compiler-only repairs in [COMPATIBILITY.md](COMPATIBILITY.md). No historical Status.lean or claimed status is imported. [Alignment contract](SCOPE.md#review-contract) remains distinct from kernel evidence.

## Formal progress versus scientific status

`none`: no formal source; `specified`: statement only; `proved`: proof text supplied but no successful trusted run yet; `kernel-checked`: successful exact-commit build, recheck, axiom audit and negative controls. Alignment is separately pending/accepted/stale. The pilot's manifest records `proved` as source progress; the actual run receipt reports kernel evidence. No workflow edits a scientific register or retroactively changes old ACCEPT/AMEND dispositions. This workflow is not claimed to be a globally required branch-protection check.
`none`: no formal source; `specified`: statement only; `proved`: proof text supplied but no successful trusted run yet; `kernel-checked`: successful exact-commit build, recheck, axiom audit and negative controls. Alignment is separately pending/accepted/stale. The pilot's manifest records `proved` as source progress; the actual run receipt reports kernel evidence. No workflow edits a scientific register or retroactively changes old ACCEPT/AMEND dispositions. The existing required-check aggregate consumes this workflow as described in [required formal checks](../docs/FORMAL_REQUIRED_CHECKS.md); the workflow alone is not a scientific-acceptance gate.

## Measure-theoretic bridge

The additive [MeasureBridge](MEASURE_BRIDGE.md) contributes five same-law measure-theoretic/conditional-transfer declarations and two scalar counterexamples. It supplies the actual Cauchy–Schwarz numerator step, while the concrete moment estimate, lower normalizer and input event tail remain explicit premises. The original 13 scalar declarations, toolchain and gate are unchanged. The two counterexamples are audited declarations, not extra rejection runs.

## Next agents

Read main #95 and the exact PR head first. A non-OpenAI alignment reviewer should inspect all assumptions, the source correspondence and the explicit nonclaims. An independent engineering reviewer should attack omitted targets, imports carrying custom axioms, stale scope/hash/review records and altered toolchains. A probability formalizer should next establish an actual measure-theoretic Cauchy–Schwarz interface and its lower-normalizer dependency, without importing GP214's upper bound as the lower bound. Coordinate before editing; a review request is not a claim that a reviewer is active.
Read the current source-bound PR and exact head first; main #95 is historical rollout context. A non-OpenAI alignment reviewer should inspect all assumptions, the source correspondence and the explicit nonclaims. An independent engineering reviewer should attack omitted targets, imports carrying custom axioms, stale scope/hash/review records and altered toolchains. A probability formalizer should next construct the normalized reweighted probability measure and then discharge a concrete same-law moment/lower-normalizer interface. Do not import GP214's upper bound as the lower bound. The MeasureBridge source is supplied but has no self-awarded kernel or alignment status. Coordinate before editing; a review request is not a claim that a reviewer is active.

Blueprint declaration links are checked against the target inventory and compiled declarations, not by semantic equivalence. The full plasTeX/LaTeX website is not installed in this pilot. Optional independent checkers or AI proof generators may be added with pinned versions/budgets; their availability and execution must be separately recorded. Never treat AlphaProof as an assumed publicly callable CI service or a generator's success as an independent alignment review.
1 change: 1 addition & 0 deletions formal/ResearchFormalCoreR1.lean
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
import ResearchFormalCoreR1.AlgebraV2
import ResearchFormalCoreR1.ProbabilityCompanionsV2
import ResearchFormalCoreR1.MeasureBridge
145 changes: 145 additions & 0 deletions formal/ResearchFormalCoreR1/MeasureBridge.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
import ResearchFormalCoreR1.ProbabilityCompanionsV2

/-!
# Measure-theoretic companions to P02-LM-008

These declarations use one measure and one weight throughout. They supply the
Cauchy-Schwarz step rather than assuming its numerator estimate. The concrete
second-moment and lower-normalizer estimates remain hypotheses. No Gaussian
field, typed Palm measure, uniform family of constants, or parent theorem is
constructed here. See ../MEASURE_BRIDGE.md for the exact source correspondence.
-/

namespace ResearchFormalCoreR1

open MeasureTheory
open scoped ENNReal

set_option autoImplicit false

variable {Ω : Type*} [MeasurableSpace Ω]

/-- Actual Bochner-integral Cauchy-Schwarz for nonnegative square-integrable
functions, obtained from the pinned mathlib Holder theorem with exponents 2,2. -/
theorem p02_lm008_integral_cs
(μ : Measure Ω) (f g : Ω → ℝ)
(hf : MemLp f 2 μ) (hg : MemLp g 2 μ)
(hf0 : 0 ≤ᵐ[μ] f) (hg0 : 0 ≤ᵐ[μ] g) :
(∫ x, f x * g x ∂μ) ≤
Real.sqrt (∫ x, f x ^ 2 ∂μ) * Real.sqrt (∫ x, g x ^ 2 ∂μ) := by
have h := integral_mul_le_Lp_mul_Lq_of_nonneg
Real.HolderConjugate.two_two hf0 hg0
(by simpa using hf) (by simpa using hg)
simpa only [Real.rpow_two, ← Real.sqrt_eq_rpow] using h

/-- The event may depend arbitrarily on W. Its indicator's second moment is
its probability under this same μ; no independence assumption is used. -/
theorem p02_lm008_event_cs
(μ : Measure Ω) [IsProbabilityMeasure μ] (W : Ω → ℝ) (A : Set Ω)
(hW : MemLp W 2 μ) (hW0 : 0 ≤ᵐ[μ] W) (hA : MeasurableSet A) :
(∫ x in A, W x ∂μ) ≤
Real.sqrt (∫ x, W x ^ 2 ∂μ) * Real.sqrt ((μ A).toReal) := by
classical
have hI : MemLp (A.indicator (fun _ : Ω => (1 : ℝ))) 2 μ :=
(memLp_const (1 : ℝ)).indicator hA
have hI0 : 0 ≤ᵐ[μ] A.indicator (fun _ : Ω => (1 : ℝ)) := by
apply Filter.Eventually.of_forall
intro x
by_cases hx : x ∈ A <;> simp [hx]
have hcs := p02_lm008_integral_cs μ W
(A.indicator (fun _ : Ω => (1 : ℝ))) hW hI hW0 hI0
have hprod : (fun x => W x * A.indicator (fun _ : Ω => (1 : ℝ)) x) =
A.indicator W := by
funext x
by_cases hx : x ∈ A <;> simp [hx]
have hsquare : (fun x => (A.indicator (fun _ : Ω => (1 : ℝ)) x) ^ 2) =
A.indicator (fun _ : Ω => (1 : ℝ)) := by
funext x
by_cases hx : x ∈ A <;> simp [hx]
rw [hprod, integral_indicator hA, hsquare, integral_indicator hA] at hcs
simpa [MeasureTheory.measureReal_def] using hcs

/-- The r^4 second-moment premise supplies the previously assumed r^2
numerator bound. This theorem does not establish that premise for a model. -/
theorem p02_lm008_event_numerator
(μ : Measure Ω) [IsProbabilityMeasure μ] (W : Ω → ℝ) (A : Set Ω)
(hW : MemLp W 2 μ) (hW0 : 0 ≤ᵐ[μ] W) (hA : MeasurableSet A)
(r cW : ℝ) (hcW : 0 ≤ cW)
(hsecond : (∫ x, W x ^ 2 ∂μ) ≤ cW * r ^ 4) :
(∫ x in A, W x ∂μ) ≤ Real.sqrt cW * r ^ 2 * Real.sqrt ((μ A).toReal) := by
have hsqrt : Real.sqrt (∫ x, W x ^ 2 ∂μ) ≤ Real.sqrt cW * r ^ 2 := by
calc
Real.sqrt (∫ x, W x ^ 2 ∂μ) ≤ Real.sqrt (cW * r ^ 4) :=
Real.sqrt_le_sqrt hsecond
_ = Real.sqrt cW * r ^ 2 := by
rw [Real.sqrt_mul hcW]
rw [show r ^ 4 = (r ^ 2) ^ 2 by ring, Real.sqrt_sq (sq_nonneg r)]
exact (p02_lm008_event_cs μ W A hW hW0 hA).trans
(mul_le_mul_of_nonneg_right hsqrt (Real.sqrt_nonneg _))

/-- Same-law integral-ratio transfer. Positivity of the actual normalizer
is derived from its explicit lower bound, never from an upper bound. -/
theorem p02_lm008_measure_transfer
(μ : Measure Ω) [IsProbabilityMeasure μ] (W : Ω → ℝ) (A : Set Ω)
(hW : MemLp W 2 μ) (hW0 : 0 ≤ᵐ[μ] W) (hA : MeasurableSet A)
(r cW cZ : ℝ) (hr : 0 < r) (hcW : 0 ≤ cW) (hcZ : 0 < cZ)
(hsecond : (∫ x, W x ^ 2 ∂μ) ≤ cW * r ^ 4)
(hlower : cZ * r ^ 2 ≤ ∫ x, W x ∂μ) :
(∫ x in A, W x ∂μ) / (∫ x, W x ∂μ) ≤
(Real.sqrt cW / cZ) * Real.sqrt ((μ A).toReal) := by
have hzpos : 0 < ∫ x, W x ∂μ :=
lt_of_lt_of_le (mul_pos hcZ (sq_pos_of_pos hr)) hlower
exact p02_lm008_quotient_bound
(∫ x in A, W x ∂μ) (∫ x, W x ∂μ) r cW cZ ((μ A).toReal)
hr hcW hcZ ENNReal.toReal_nonneg hzpos hlower
(p02_lm008_event_numerator μ W A hW hW0 hA r cW hcW hsecond)

/-- An explicitly supplied eighth-order event bound transfers to a cubic
bound on 0 < r ≤ 1. Uniformity in r and the input tail remain unproved here. -/
theorem p02_lm009_measure_transfer_r8_to_r3
(μ : Measure Ω) [IsProbabilityMeasure μ] (W : Ω → ℝ) (A : Set Ω)
(hW : MemLp W 2 μ) (hW0 : 0 ≤ᵐ[μ] W) (hA : MeasurableSet A)
(r cW cZ K : ℝ) (hr : 0 < r) (hr1 : r ≤ 1)
(hcW : 0 ≤ cW) (hcZ : 0 < cZ) (hK : 0 ≤ K)
(hsecond : (∫ x, W x ^ 2 ∂μ) ≤ cW * r ^ 4)
(hlower : cZ * r ^ 2 ≤ ∫ x, W x ∂μ)
(htail : (μ A).toReal ≤ K * r ^ 8) :
(∫ x in A, W x ∂μ) / (∫ x, W x ∂μ) ≤
((Real.sqrt cW / cZ) * Real.sqrt K) * r ^ 3 := by
have hcoef : 0 ≤ Real.sqrt cW / cZ :=
div_nonneg (Real.sqrt_nonneg _) hcZ.le
have hsqrt : Real.sqrt ((μ A).toReal) ≤ Real.sqrt K * r ^ 4 := by
calc
Real.sqrt ((μ A).toReal) ≤ Real.sqrt (K * r ^ 8) := Real.sqrt_le_sqrt htail
_ = Real.sqrt K * r ^ 4 := by
rw [Real.sqrt_mul hK]
rw [show r ^ 8 = (r ^ 4) ^ 2 by ring, Real.sqrt_sq (pow_nonneg hr.le 4)]
have hfourth : (∫ x in A, W x ∂μ) / (∫ x, W x ∂μ) ≤
((Real.sqrt cW / cZ) * Real.sqrt K) * r ^ 4 := by
calc
(∫ x in A, W x ∂μ) / (∫ x, W x ∂μ) ≤
(Real.sqrt cW / cZ) * Real.sqrt ((μ A).toReal) :=
p02_lm008_measure_transfer μ W A hW hW0 hA r cW cZ hr hcW hcZ hsecond hlower
_ ≤ (Real.sqrt cW / cZ) * (Real.sqrt K * r ^ 4) :=
mul_le_mul_of_nonneg_left hsqrt hcoef
_ = ((Real.sqrt cW / cZ) * Real.sqrt K) * r ^ 4 := by ring
exact p02_lm009_palm_r4_to_r3 _ _ r
(mul_nonneg hcoef (Real.sqrt_nonneg _)) hr.le hr1 hfourth

/-- Scalar data realized by W=4 on an event of probability 1/4 and W=0
elsewhere. Cauchy-Schwarz is sharp; omitting the event square root is false.
The realization is checked separately by exact finite-model Python tests. -/
theorem p02_lm008_sqrt_counterexample :
(1 : ℝ) = Real.sqrt 4 * Real.sqrt (1 / 4 : ℝ) ∧
¬ (1 : ℝ) ≤ Real.sqrt 4 * (1 / 4 : ℝ) := by
norm_num

/-- Scalar data realized by W=1 on a one-point probability space, r=1,
cW=1, cZ=2. The upper bound on z holds but the proposed ratio bound fails.
This does not assert that the required lower bound holds. -/
theorem p02_lm008_upper_normalizer_counterexample :
(1 : ℝ) ≤ 2 * 1 ^ 2 ∧
(1 : ℝ) / 1 > (Real.sqrt 1 / 2) * Real.sqrt 1 := by
norm_num

end ResearchFormalCoreR1
Loading
Loading