Skip to content

Integrate the Lean formalism wave: #156–#163 with one regeneration and one CI run - #164

Merged
docxology merged 25 commits into
mainfrom
claude/lean-integration-1
Oct 9, 2026
Merged

docxology merged 25 commits into
mainfrom
claude/lean-integration-1

Conversation

@docxology

Copy link
Copy Markdown
Collaborator

Merges the eight open Lean PRs in a single step. Each one passed its own build and checks, but they all regenerate the same projections and pins, so merging them one at a time would have taken eight serial CI cycles with a conflict in each. When this lands, GitHub marks each PR merged, because its head commit is in main.

PR Issue Content
#157 FORM-S8 #91 Generalized-coordinate jets are derivatives
#156 LEAN-1 #99 One shared finite-matrix kit
#158 FORM-S2 #85 General finite MaxEnt and the constrained Gibbs maximiser
#159 LEAN-6/8 #104 #106 Pairing review; derivational edges for 4 isolated topics
#160 FORM-S9 #92 Precision as inference; predictive-coding energy = −log joint
#161 FORM-S3 #86 Helmholtz free energy as the variational minimum, with dF/dT = −H
#162 FORM-S13 #96 Optimal linear/log pooling; Dobrushin consensus
#163 FORM-S6 #89 Markov path laws, Schnakenberg form, reversed-kernel duality

Integration: the Lean sources merged cleanly except for two appended sections in variational_duality.lean (MaxEnt from #158, Helmholtz from #161), and both are kept. Their definitions don't clash: energyGibbsLaw and helmholtzGibbsLaw use different parameterisations, β versus T. Projections were regenerated once by their owners. Pins are set to the measured totals, which match the additive expectation exactly: lexical declarations 2,053 = 1,946 + 107, predictive_coding 47, variational_duality 74.

Evidence on the integrated tree

  • lake --wfail build FepSketches: 8,997 jobs, zero warnings.
  • Every generator --check and methods check pass.
  • check_render_log --verify-receipt, theorem_ref_audit, check_orphan_compiles, citation_audit and xref_audit pass.
  • 204 formal, relation and methods tests pass, as do ruff, format, mypy, links and hygiene.

Formalism issues stay open pending independent semantic review, per their claim boundaries. No disposition was promoted.

…echanics (#99)

helmholtz_ao_ness.lean now imports geometric_mechanics and re-exports the
shared kit (dot, mulVec, mulOf, traceOf, SkewSymmetric, SymmetricOf and the
four lemmas) so FEP.HelmholtzAoNess.<name> still resolves. Regenerated
projections; theorem total 1946 -> 1942, helmholtz module 26 -> 22.
H(p) <= log n with equality iff uniform; Gibbs law maximises entropy under
a mean-energy constraint, uniquely; strict Bool witnesses.
# Conflicts:
#	docs/formalism-atlas.html
#	docs/formalism-coverage.json
#	docs/formalism-coverage.md
Reviewed the seven formal_pairing witnesses named specializes/refines/
extends/bounds against the strict derivation test (consume one endpoint's
theorem, produce the other's statement or an exact instance). Every witness
conjoins two independently proved endpoint laws, so none is re-tagged;
the formal edge count stays 20. Rationales that overstated (fep-092 -> fep-032
"equivalent" iteration, fep-063 -> fep-014, fep-116 -> fep-001, fep-115 ->
fep-042, fep-054 -> fep-017, fep-089 -> fep-006) are tightened and all seven
carry a dated review entry. Review table appended to
docs/relations-endpoint-adjudication.md; projections regenerated.

Refs #104
… (LEAN-8, #106)

fep-007, fep-046 and fep-050 had no relation and fep-029 only a conceptual
one; no existing composition mentioned any of them. Add one small theorem
per topic in an existing composition leaf, each with an explicit scope
caveat in its rationale:

- fep-007 -> fep-028 (control_temporal): normalized message = embedded
  softmax; fep-007 normalization derives the softmax unit sum.
- fep-029 -> fep-104 (thermo_geometry): scalar quadratic Bregman is the
  d = 1 instance of the generic Bregman; fep-104 three-point identity.
- fep-046 -> fep-045 (core): one stick break is the Bernoulli law; fep-046
  mass conservation derives fep-045 posterior-mass normalization.
- fep-050 -> fep-049 (thermo_geometry): fep-049 entropy-production
  nonnegativity discharges fep-050's second-law premise (explicit balance
  premise) to give the Landauer work bound.

Formal edges 20 -> 24. Pins updated for the exact changes: declarations per
module (core 23, control_temporal 15, thermo_geometry 16), lexical
declarations 1950, authored edges 150. Projections regenerated; Lean
modules and full FepSketches build with --wfail, axioms limited to
propext/Classical.choice/Quot.sound.

Refs #106
…ude/lean-integration-1

# Conflicts:
#	docs/formalism-atlas.html
#	docs/formalism-coverage.json
#	docs/formalism-coverage.md
#	tests/test_mathematical_methods.py
…lean-integration-1

# Conflicts:
#	docs/formalism-atlas.html
#	docs/formalism-coverage.json
#	docs/formalism-coverage.md
#	tests/test_mathematical_methods.py
…de/lean-integration-1

# Conflicts:
#	docs/formalism-atlas.html
#	docs/formalism-coverage.json
#	docs/formalism-coverage.md
#	tests/test_mathematical_methods.py
…de/lean-integration-1

# Conflicts:
#	docs/formalism-atlas.html
#	docs/formalism-coverage.json
#	docs/formalism-coverage.md
#	docs/mathematical-positioning/positioning.json
#	docs/mathematical-positioning/positioning.md
#	docs/mathematical-positioning/visual-model.json
#	tests/test_formal_foundations.py
#	tests/test_mathematical_methods.py
…de/lean-integration-1

# Conflicts:
#	docs/formalism-atlas.html
#	docs/formalism-coverage.json
#	docs/formalism-coverage.md
#	docs/mathematical-positioning/positioning.json
#	docs/mathematical-positioning/positioning.md
#	docs/mathematical-positioning/visual-model.json
#	lean/FepSketches/variational_duality.lean
#	src/fep_lean/formal/variational_duality.lean
#	tests/test_formal_foundations.py
#	tests/test_mathematical_methods.py
…de/lean-integration-1

# Conflicts:
#	docs/formalism-atlas.html
#	docs/formalism-coverage.json
#	docs/formalism-coverage.md
#	tests/test_mathematical_methods.py
…laude/lean-integration-1

# Conflicts:
#	docs/formalism-atlas.html
#	docs/formalism-coverage.json
#	docs/formalism-coverage.md
#	tests/test_mathematical_methods.py
Integrates #156 #157 #158 #159 #160 #161 #162 #163 on top of #150. Their
Lean sources merged cleanly apart from two appended sections in
variational_duality.lean (MaxEnt and Helmholtz; both kept). Generated
projections were regenerated once by their owners, and pins set to the
measured totals: lexical declarations 2053 (= 1946 + 107 across the nine
Lean PRs), predictive_coding 47, variational_duality 74.
…sealed

CI on the integration found two invariants the relations lane broke:

- The five expansion composition leaves own exactly one bridge theorem per
  expansion topic (fep-051..120). Move the three new core-topic derivations
  (fep-007 -> 028, fep-029 -> 104, fep-050 -> 049) into a dedicated section
  of compositions/core.lean beside fep-046 -> 045; control_temporal.lean and
  thermo_geometry.lean are byte-identical to main again.
- Released relation rows are digest-sealed. Restore main's released edges
  exactly (the tightened pairing rationales stay recorded as review notes in
  docs/relations-endpoint-adjudication.md) and insert the four new edges in
  sorted position. Mirror the existing NEW_CAPABILITY_IDS exclusion with an
  explicit NEW_EDGE_KEYS set so the historical edges digest still covers
  every released row unchanged.

lake --wfail build FepSketches passes; projections regenerated; 227 formal,
relation, expansion and methods tests pass.
)

Released relation rows are digest-sealed, so the five tightened rationales
from the LEAN-6 review are kept as proposals until a reviewed seal delta.
… contracts

The lean job's serial tests pin the collective_inference theorem inventory
and forbid 'opinion pool' wording (renamed to product-of-experts earlier).
Rename the new section to KL-optimal linear and product-of-experts pooling
and extend the pinned inventory with the 28 new theorems in source order.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant