Skip to content

Quality pass: comment hygiene, helper consolidation, golf, docs+CI axiom check#132

Merged
cameronfreer merged 6 commits into
mainfrom
quality-pass
Jun 10, 2026
Merged

Quality pass: comment hygiene, helper consolidation, golf, docs+CI axiom check#132
cameronfreer merged 6 commits into
mainfrom
quality-pass

Conversation

@cameronfreer

Copy link
Copy Markdown
Owner

Summary

A four-part quality pass over the completed formalization (0 sorries and standard axioms before and after; full lake build, checkdecls, and check_blueprint.py all pass).

1. Comment hygiene

Rewrote 5 historical comments to describe current state per the project style rule, including the stale "BorelSpace synthesis issue" note on alphaIicCE_measurable (the proof below it already works) and "previously"/"earlier drafts" phrasing in L2Helpers.lean, DirectingMeasureIntegral.lean, AlphaIicEq.lean, CommonEnding.lean.

2. Helper consolidation — intentional API break

Exchangeability.DeFinetti.ViaKoopman.LpCondExpHelpers no longer exists as an importable module, and Exchangeability.Probability.MartingaleExtras is gone too. Migration:

Old (root namespace) New
condExp_const_mul removed — use mathlib's MeasureTheory.condExp_smul
condExp_sum_finset private in its only consumer, ViaKoopman/CesaroHelpers.lean
integrable_of_bounded_measurable MeasureTheory.integrable_of_bounded_measurable in Probability/LpNormHelpers.lean
eLpNorm_one_le_eLpNorm_two_toReal MeasureTheory.eLpNorm_one_le_eLpNorm_two_toReal in Probability/LpNormHelpers.lean
Exchangeability.Probability.lintegral_fatou_ofReal_norm Exchangeability.Probability.IntegrationHelpers.lintegral_fatou_ofReal_norm

Only 3 proof-call-site lines changed library-wide. Module count 105 → 103: import_graph_colored.{svg,png} regenerated with the same procedure as 722fba0, with each surviving module keeping its color; file counts refreshed in README.md / home_page/index.md / STATUS.md. As in 722fba0, import_graph_colored.html and import_graph_full_declarations.html are not regenerated here (interactive viewer coloring / doc-gen4 CI artifact).

3. Proof golf

4 of 9 find_golfable candidates applied (Contractability.lean, Core.lean); statements untouched (the two blueprint-cited theorems' citations verified via checkdecls). The remaining 5 were skipped where the existing structure was clearer or the golf broke elaboration.

4. Docs + CI

  • DEVELOPMENT_CHRONOLOGY.md: header recounted from git (4,247 commits / 3,373 non-merge through June 8, 2026) and a new Phase 11 covering Jan 9 – June 8 (toolchain to v4.30.0-rc2, dead-code sweeps, linter-suppression cleanup to zero, blueprint/CI refresh).
  • blueprint.yml: new Check axioms step diffs the full #print axioms Exchangeability.DeFinetti.deFinetti output against the expected single line — exact match, so any added axiom or extra output fails CI. Simulated locally end-to-end.

Verification

  • lake build: 3525/3525 jobs
  • sorry_analyzer: 0 sorries
  • #print axioms deFinetti: [propext, Classical.choice, Quot.sound]
  • lake exe checkdecls blueprint/lean_decls: pass
  • python3 blueprint/check_blueprint.py: 52/52 consistent
  • All 12 touched .lean files compile individually

Per the project style rule (describe what code is, not what it was):
- AlphaIicCE.lean: the 'BorelSpace synthesis issue' note described a
  problem the proof below no longer has
- L2Helpers.lean, DirectingMeasureIntegral.lean, AlphaIicEq.lean,
  CommonEnding.lean: drop 'previously'/'earlier drafts' phrasing
…into shared Probability helpers

Intentional API cleanup (breaking for external users of these names):
- condExp_const_mul: removed; the two call sites in CesaroHelpers now use
  mathlib's condExp_smul directly
- condExp_sum_finset: now a private lemma in its only consumer,
  CesaroHelpers.lean
- integrable_of_bounded_measurable, eLpNorm_one_le_eLpNorm_two_toReal:
  moved to Probability/LpNormHelpers.lean (namespace MeasureTheory)
- lintegral_fatou_ofReal_norm: moved from MartingaleExtras.lean into
  Probability/IntegrationHelpers.lean

Module count 105 -> 103: regenerated import_graph_colored {svg,png}
(same procedure as 722fba0, colors carried over per module) and
refreshed file counts in README.md / home_page/index.md.
- Contractability.lean: strictMono_all_lt_succ_last to term mode;
  inline h_mono into the calc; inline hf/hg into the obtain
- Core.lean: cylinder_subset_prefixCylinders uses the definitional
  equality directly instead of an explicit rfl-transport

Statements unchanged; remaining find_golfable candidates skipped where
the existing structure is clearer.
- DEVELOPMENT_CHRONOLOGY.md: header recounted from git (4,247 commits,
  3,373 non-merge, through June 8 2026); new Phase 11 covering the
  Jan 9 - June 8 maintenance period
- blueprint.yml: after the build, #print axioms output for deFinetti is
  diffed against the expected single line, so any added axiom fails CI
…unt convention

- import_graph_colored.html: re-embed the GEXF from the current import
  graph (lake exe graph; 103 modules, includes the new
  LpNormHelpers->CesaroHelpers and IntegrationHelpers->AntitoneLimit
  edges). The page's own JS computes colors, so the proof-palette
  view is unchanged.
- import_graph_full_declarations.html: drop the 5 declaration nodes
  (and their 5 edges) for the deleted ViaKoopman/LpCondExpHelpers from
  the Feb snapshot; arrays re-validated (426 nodes / 468 edges, no
  dangling ids). The live copy is rebuilt by docgen CI on push to main.
- DEVELOPMENT_CHRONOLOGY.md: Phase 11 count was time-of-day dependent
  (bare --since date); now 226 commits (208 non-merge) with the
  explicit --since="2026-01-09 00:00" convention stated inline.
@cameronfreer cameronfreer merged commit 48e7501 into main Jun 10, 2026
1 check passed
cameronfreer added a commit that referenced this pull request Jun 11, 2026
* refactor: replace 4 helpers with mathlib v4.30.0 equivalents

- Finset.filter_val_lt_card -> Fin.card_filter_val_lt (2 sites);
  Util/FinsetHelpers.lean deleted (sole content)
- integrable_of_bounded (Probability/CondExp.lean) -> Integrable.of_bound
  (6 sites in CesaroL1Bounded)
- integrable_of_bounded_measurable (LpNormHelpers) -> Integrable.of_bound
  (10 sites across ViaKoopman)
- memLp_two_of_bounded (LpNormHelpers) -> MemLp.of_bound (3 sites)

NOT migrated (audit claim didn't survive contact with the real call
sites): aestronglyMeasurable_sub_of_tendsto_ae stays — mathlib's
aestronglyMeasurable_of_tendsto_ae only covers the m = m0 case, while
this helper's purpose is AEStronglyMeasurable[m] for m < m0 via a
limsup witness; its docstring now records that.

* refactor: collapse injective_implies_strictMono_perm onto Tuple.sort; drop dead condExp_mul_pullout

- injective_implies_strictMono_perm: 64-line orderIsoOfFin construction
  -> one-liner via Tuple.sort + Monotone.strictMono_of_injective
  (signature unchanged)
- Probability/CondExp.lean condExp_mul_pullout: deleted — zero call
  sites; the same-named ViaKoopman/InfraGeneralized lemma (the one
  actually used, already a thin wrapper over mathlib's
  condExp_mul_of_aestronglyMeasurable_left) is unchanged

* refactor!: eLpNorm_two_sq_eq_integral_sq — shrink proof, drop IsFiniteMeasure

The new proof goes through MemLp.eLpNorm_eq_integral_rpow_norm and does
not need [IsFiniteMeasure μ]; the hypothesis is dropped (user-approved
signature weakening — strictly more general, call sites unaffected).
~55 lines of lintegral manipulation -> 8 lines.

* chore(artifacts): regenerate import graph (103 -> 102 modules) + refresh counts

Util/FinsetHelpers.lean deletion drops one module: SVG/PNG/HTML
regenerated via the PR #132 procedure (colors carried per module;
102 clickable SVG nodes; embedded GEXF re-validated, 102 nodes /
151 edges); home_page file count and STATUS.md LOC table refreshed.

* style: drop blank line at EOF in SigmaAlgebraHelpers

Also recording here (per review): commit ccc9c6c's removal of the
public lemma Exchangeability.Probability.condExp_mul_pullout is an
intentional breaking API change — it had zero call sites in this repo
and no wrapper is kept; external users should migrate to mathlib's
condExp_mul_of_stronglyMeasurable_right (right-factor form) or the
ViaKoopman condExp_mul_pullout (left-factor, shift-invariant form).
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