Skip to content

feat: 158 new lemmas discovered by a weightless verifier-mediated learner#41508

Closed
jeremiahrthompson wants to merge 1 commit into
leanprover-community:masterfrom
jeremiahrthompson:feat/dual-lemmas-n3
Closed

feat: 158 new lemmas discovered by a weightless verifier-mediated learner#41508
jeremiahrthompson wants to merge 1 commit into
leanprover-community:masterfrom
jeremiahrthompson:feat/dual-lemmas-n3

Conversation

@jeremiahrthompson

Copy link
Copy Markdown

What this is

This PR adds 158 new lemmas across 86 files that are the missing dual (order-dual / left-right / preimage-image) counterparts of existing results. They were not hand-written. They were discovered and proven by a learning architecture with no neural network, no training data, and no parameters — the principles of which are described in our paper.

Each lemma is the natural symmetric partner of a lemma already in mathlib. The system detected the symmetry gap, constructed the missing statement, transported the sibling's proof through the duality, and the Lean kernel independently certified it. Every one compiles against current master (verified at b9a56a6, toolchain v4.32.0-rc1), uses only standard axioms (propext, Classical.choice, Quot.sound), and is non-trivial.

Why we're submitting it

The paper, "Manifold Destiny: Continuous Learning by Consumption of Truth-Verified Structure from the Zero-Information Floor" (Thompson & Horowitz), describes a verifier-mediated learning architecture in which a bounded grammar hypothesizes candidate abstractions and a hard truth-checker accepts or rejects each — no weights, no gradients, no fitting. The same mechanism that produced these lemmas is demonstrated on three domains in the paper: formal mathematics (Lean 4.31.0 kernel), synthetic GF(2) problems, and quantum measurements on real entanglement data (CHSH violation on a 156-qubit superconducting processor).

We are submitting this PR partly as content and partly because we believe the community should look at the mechanism. We invite the scrutiny. Each of the 158 is independently reproducible.

Verification

Every lemma was dual-verified by two independent systems (Claude Fable + OpenAI GPT-5.5) against the Lean kernel, then re-verified against current master:

  • genuinely absent from mathlib (statement-level Meta.isDefEq scan over 529,929 constants)
  • compiles in real module context at HEAD
  • axioms subset of {propext, Classical.choice, Quot.sound}
  • non-trivial (not provable by rfl / Iff.rfl / decide after binders)

Each entry records the sibling lemma it is the dual of and the transport axis used, so reviewers can verify quickly.

Contents (by area)

  • Order theory (codisjointness, intervals, Fin image/preimage): ~40
  • Analysis (ENNReal, ENat, NNReal, Tropical, Stieltjes): ~19
  • Category theory (MorphismProperty, Precoverage, Subfunctor): ~7
  • Measure theory: ~5
  • Filter: ~5
  • Linear / module theory: ~5
  • Algebra (RingCon, Con, Cardinal, Ordinal): ~10
  • Set theory: ~28
  • Topology, graph theory, probability, Lie theory, and others: the remainder

Notes

  • 3 additional lemmas (AddMonoidAlgebra support refactor, VectorMeasure dsimp) were excluded because they broke against recent upstream refactors; they are likely re-provable with updated witnesses.
  • Happy to split into per-area PRs or adjust namespace placement per reviewer preference.

…earning

Adds 158 lemmas that are the dual (order-dual / left-right /
preimage-image) counterparts of existing results but were missing
from the library. Each is the natural symmetric partner of a lemma
already in mathlib, verified to compile against current master.

Discovered by a verifier-mediated learning architecture described in
'Manifold Destiny: Continuous Learning by Consumption of Truth-Verified
Structure from the Zero-Information Floor' (Thompson & Horowitz).

Paper: https://github.com/sumofagents/manifold-destiny
Contact: @jeremyrt on X, jeremiah@jeremiahai.com
@github-actions github-actions Bot added the new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! label Jul 8, 2026
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

Welcome new contributor!

Thank you for contributing to Mathlib! If you haven't done so already, please review our contribution guidelines, as well as the style guide and naming conventions. In particular, we kindly remind contributors that we have guidelines regarding the use of AI when making pull requests.

We use a review queue to manage reviews. If your PR does not appear there, it is probably because it is not successfully building (i.e., it doesn't have a green checkmark), has the awaiting-author tag, or another reason described in the Lifecycle of a PR. The review dashboard has a dedicated webpage which shows whether your PR is on the review queue, and (if not), why.

If you haven't already done so, please come to https://leanprover.zulipchat.com/, introduce yourself, and mention your new PR.

Thank you again for joining our community.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

PR summary 32848d7ba8

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff (regex)

+ AbsoluteValue.map_one_of_isRightRegular
+ AffineSubspace.vectorSpan_eq_bot_of_affineSpan_eq_bot
+ AlgebraicGeometry.Scheme.IdealSheafData.ideal_biSup
+ AlternatingMap.curryRight_add
+ AlternatingMap.curryRight_smul
+ BoxIntegral.Box.lower_sub_upper_splitCenterBox
+ Cardinal.aleph_min
+ Cardinal.preAleph_min
+ CategoryTheory.GrothendieckTopology.eq_bot_of_isEmpty
+ CategoryTheory.MorphismProperty.toSet_iInf
+ CategoryTheory.MorphismProperty.toSet_min
+ CategoryTheory.ObjectProperty.shift_iInf
+ CategoryTheory.ObjectProperty.shift_inf
+ CategoryTheory.Precoverage.comap_sup
+ CategoryTheory.Subfunctor.image_id
+ Class.congToClass_univ
+ Codisjoint.inter_left
+ Codisjoint.inter_right
+ Codisjoint.union_eq
+ Codisjoint.union_left
+ Codisjoint.union_left'
+ Codisjoint.union_right
+ Codisjoint.union_right'
+ Con.inf_def
+ Con.sInf_def
+ ContMDiff.piecewise_Ici
+ ContinuousAlternatingMap.curryRight_add
+ ContinuousAlternatingMap.curryRight_smul
+ ContinuousAlternatingMap.norm_curryRight
+ ENNReal.coe_mem_lowerBounds
+ ENNReal.iInf_pow_of_ne_zero
+ ENNReal.iInf₂_pow_of_ne_zero
+ ENNReal.preimage_coe_Icc
+ ENNReal.preimage_coe_Ico
+ ENNReal.preimage_coe_Iic
+ ENNReal.preimage_coe_Iio
+ ENNReal.preimage_coe_Ioc
+ ENNReal.preimage_coe_Ioo
+ ENNReal.toNNReal_bot_mul
+ ENNReal.toNNReal_mul_bot
+ ENat.WithTop.add_natCast_cancel
+ ENat.WithTop.add_one_cancel
+ ENat.WithTop.natCast_add_cancel
+ ENat.WithTop.one_add_cancel
+ Encodable.iInf_decode₂
+ Filter.Tendsto.eventually_ne_atBot'
+ Filter.codisjoint_comap
+ Filter.comap_sInf
+ Filter.sUnion_lift_sets
+ Filter.tendsto_Ico_Iic_Iic
+ Filter.tendsto_Ioc_Ici_Ici
+ Fin.image_rev_Icc
+ Fin.image_rev_Ici
+ Fin.image_rev_Ico
+ Fin.image_rev_Iic
+ Fin.image_rev_Iio
+ Fin.image_rev_Ioc
+ Fin.image_rev_Ioi
+ Fin.image_rev_Ioo
+ Fin.image_rev_uIcc
+ Fin.image_rev_uIoo
+ Finset.erase_inter_distrib
+ Finset.inter_union_cancel_left
+ Finset.inter_union_cancel_right
+ Finset.measurable_inf'
+ FirstOrder.Language.Formula.equivSentence_sup
+ InfIrred.not_isMax
+ InfPrime.not_isMax
+ IntermediateField.adjoin_eq_bot_iff_of_isAlgebraic
+ IsPrincipalIdealRing.of_prime_ne_top
+ Language.sub_iInf
+ LieAlgebra.Extension.lie_apply_proj_of_rightInverse_eq
+ LieIdeal.bot_toLieSubalgebra
+ LinearMap.BilinForm.separatingRight_of_anisotropic
+ LinearMap.IsPerfectCompl.left_bot_iff
+ LinearMap.IsRefl.ker_eq_top_iff_ker_flip_eq_top
+ LinearMap.IsRefl.ker_flip_eq_top
+ LinearMap.inf_range_inl_inr
+ MeasureTheory.Measure.compProd_apply_empty
+ MeasureTheory.Measure.comp_apply_empty
+ MeasureTheory.NullMeasurableSet.inter_null
+ MeasureTheory.OuterMeasure.isCaratheodory_univ
+ MeasureTheory.OuterMeasure.restrict_biSup
+ ModuleCat.preservesFiniteLimits_tensorRight_of_ringHomFlat
+ MonomialOrder.preimage_leadingTerm_insert_zero
+ MonomialOrder.preimage_leadingTerm_sdiff_singleton_zero
+ NNReal.iInf_div
+ Nat.WithTop.add_eq_one_iff
+ Nat.WithTop.add_eq_three_iff
+ Nat.WithTop.add_eq_two_iff
+ Nat.zero_inter_range_succ
+ Ordinal.iInf_eq_of_range_eq
+ Ordinal.omega_min
+ Ordinal.preOmega_min
+ Pairwise.codisjoint_extend_top
+ Pi.eq_top_iff
+ PointedCone.dual_inf
+ PrimeSpectrum.inter_zeroLocus
+ ProbabilityTheory.IdentDistrib.essInf_eq
+ ProbabilityTheory.Kernel.parallelComp_apply_empty
+ Relator.RightUnique.flip
+ RingCon.inf_def
+ RingCon.sInf_def
+ SaturatedSubmonoid.iInf_def
+ Set.Ici.eq_bot_iff
+ Set.Ioc_inter_Ioc_inter_Ioc_cycle
+ Set.Ioc_inter_Ioc_left
+ Set.Ioc_inter_Ioc_right
+ Set.Ioc_inter_Ioc_symm
+ Set.biInter_prod'
+ Set.codisjoint_empty
+ Set.codisjoint_iff_union_eq_univ
+ Set.codisjoint_inter_left
+ Set.codisjoint_inter_right
+ Set.codisjoint_univ
+ Set.empty_codisjoint
+ Set.iInter_prod'
+ Set.iInter_sumElim
+ Set.inter_sigma
+ Set.ite_union_union
+ Set.mulIndicator_inter_mul_union_apply
+ Set.preimage_inv_Icc
+ Set.preimage_inv_Ici
+ Set.preimage_inv_Ico
+ Set.preimage_inv_Iic
+ Set.preimage_inv_Iio
+ Set.preimage_inv_Ioc
+ Set.preimage_inv_Ioi
+ Set.preimage_inv_Ioo
+ Set.preimage_neg_uIcc
+ Set.univ_codisjoint
+ SetRel.gc_rightDual_leftDual
+ SimpleGraph.IsClique.sdiff_of_inf_edge
+ SimpleGraph.Subgraph.comap_equiv_bot
+ SimpleGraph.Subgraph.map_iso_bot
+ SimpleGraph.deleteEdges_inf
+ StieltjesFunction.id_rightLim
+ Subgroup.IsComplement'.codisjoint
+ Subgroup.IsComplement'.inf_eq_bot
+ Subgroup.prod_eq_top_iff
+ Submodule.toAddSubgroup_eq_bot
+ Submodule.topologicalClosure_eq_bot_iff
+ TopologicalSpace.IsTopologicalBasis.insert_univ
+ Topology.IsLocallyConstructible.biInter
+ Tropical.trop_min_def
+ Tropical.untrop_min
+ UniformSpace.ball_iUnion
+ UniformSpace.ball_union
+ WithZero.instMulRightReflectLT
+ differentiableWithinAt_Iio_iff_Iic
+ iInf_codisjoint_iff
+ isClosed_iInter₂
+ isOpen_iUnion₂
+ min_ack_left
+ min_ack_right
+ not_isRight_and_isLeft
+ sInf_codisjoint_iff
+ tprod_iInf_decode₂

You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.

Declarations diff (Lean -- pending)

Computed after the build finishes.


No changes to strong technical debt.

No changes to weak technical debt.

Current commit 32848d7ba8
Reference commit b9a56a66c2

This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:

git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/scripts/reporting/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@felixpernegger

Copy link
Copy Markdown
Contributor

LLM-generated

@github-actions github-actions Bot added the LLM-generated PRs with substantial input from LLMs - review accordingly label Jul 8, 2026
@felixpernegger

Copy link
Copy Markdown
Contributor

@jeremiahrt please take a look at this. In particular, your PR description looks very AI generated, which is against the rules.

@felixpernegger felixpernegger left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment on the lemma I selected for more.

This PR is not suitable for a variety of reasons, among others that you add hundreds of unrelated lemmas in a variety of fields (many of which I suspect to be preexisting).

Further, this PR and the docstrings seem very much like an advertisment/announcement, which is not suitable.

If you think you made something novel, maybe post in on the "AI and Lean" channel on zulip, that would be much better.

For now I recommend you close this PR.

Comment on lines +675 to +685


-- Dual/order lemmas discovered by the Manifold Destiny verifier-mediated learner.
-- Paper: https://github.com/sumofagents/manifold-destiny
section
theorem NNReal.iInf_div : ∀ {ι : Sort u_3} (f : ι → NNReal) (a : NNReal), (⨅ i, f i) / a = ⨅ i, f i / a := by
open NNReal Function Set Real in
intro ι f a
simp only [div_eq_mul_inv, iInf_mul]

end

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are several style issues with this (this basically applies to all other lemmas you added).
You shouldnt open namespaces in a proof normally, the forall quantifier is not good, simp only shouldnt be at the end of a proof (just simp instead), wrong format for the docstring (ought to use /-- ... -/), I see not reason why you wrap the theorem in a section, wrong indentation, one empty line too much, ....

Take a look at https://leanprover-community.github.io/contribute/style.html

But most importantly, the docstring isnt informative (a docstring wouldnt be needed for something trivial like this) and in fact just an advertisment.

@felixpernegger

Copy link
Copy Markdown
Contributor

awaiting-author

@github-actions github-actions Bot added the awaiting-author A reviewer has asked the author a question or requested changes. label Jul 8, 2026
@jeremiahrthompson

Copy link
Copy Markdown
Author

@felixpernegger It is not LLM generated. It is LLM assisted. It is not slop.

I will review your recommendations and resubmit.

Thank you very much for your feedback. Some words of preparation, prepare for a lot more formal unsolved proofs. Did you read the associated white paper?

https://github.com/sumofagents/manifold-destiny/blob/main/paper/main.pdf

@jeremiahrthompson

Copy link
Copy Markdown
Author

Closing this PR and proceeding with the proper formal steps to integrate this with the established process. Building and changing now.

@felixpernegger

Copy link
Copy Markdown
Contributor

@felixpernegger It is not LLM generated. It is LLM assisted. It is not slop.

The description for the LLM-generated says "PRs with substantial input from LLMs". I think it is fair to say this pplies here. Note we often merge such PRs anyways

I will review your recommendations and resubmit.

Before making a new PR please review sytel guide and notwworthyness etc, and keep it limited to one area (or even file) please.

@jeremiahrthompson

Copy link
Copy Markdown
Author

You got it.

I am going to post and introduce myself on Zulip and then post in the #AI and lean section to introduce this work.

I am also reformulating the proofs so they compile CI. They will be ready for formal PR when the community is ready to accept.

Please accept my apology, I am new here.

@jeremiahrthompson

Copy link
Copy Markdown
Author

@felixpernegger In Zulip in '#AI and Lean' there is not a sub section that covers this contribution. There is "Machine Learning for Theorem Proving only. This is not, by definition ML. It does not train, it does not guess, it is not a probabilistic model. Does this change your suggestion?

@felixpernegger

Copy link
Copy Markdown
Contributor

I dont think it is very helpful to argue about semantics. If you really want to, you can post it to Project announcements, but I recommend to stick to the ML thread.

@jeremiahrthompson

Copy link
Copy Markdown
Author

Not trying to argue. Just don't want to make mistake again and follow protocol from here. How about I post in "AI Authored Projects"?

@felixpernegger

Copy link
Copy Markdown
Contributor

sure

@jeremiahrthompson

Copy link
Copy Markdown
Author

Closing. PR is ready now to pass CI. the engineer details have been fixed. Closing this PR to wait for community feedback on this work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-author A reviewer has asked the author a question or requested changes. LLM-generated PRs with substantial input from LLMs - review accordingly new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants