Skip to content

feat(ModelTheory): add elementary chains - #42029

Open
NoneMore wants to merge 6 commits into
leanprover-community:masterfrom
NoneMore:feat/elementary-chain
Open

feat(ModelTheory): add elementary chains#42029
NoneMore wants to merge 6 commits into
leanprover-community:masterfrom
NoneMore:feat/elementary-chain

Conversation

@NoneMore

@NoneMore NoneMore commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

This PR adds the definition of elementary chains and construct their direct limits, shows that the canonical maps and compatible cocone lifts are elementary and derives theory preservation and cardinality bounds for the limit.


AI disclosure: Most declarations, comments, and documentation in this PR were generated with Codex. Some proofs were structurally simplified using the /golf command from Lean 4 Skills. I reviewed the resulting code and documentation and can vouch for all submitted content.

Open in Gitpod

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown

PR summary 1e7695608f

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.SetTheory.Cardinal.DirectLimit (new file) 777
Mathlib.ModelTheory.ElementaryChain (new file) 809

Declarations diff (regex)

+ ElementaryChain
+ Limit
+ coe_natLERec
+ equivOfForallLE
+ exists_finite_common_stage
+ exists_toLimit
+ iSup_lift_mk_le_mk
+ liftElementary
+ limitEquiv
+ limit_models
+ mk_eq_iSup_lift_mk
+ mk_eq_of_forall_lift_mk_eq
+ mk_le_of_aleph0_le
+ mk_le_sum
+ mk_limit_eq_of_forall_lift_mk_eq
+ mk_limit_le_of_lift_mk_le
+ natLERec
+ natLERec_self
+ natLERec_succ
+ natLERec_trans
+ ofNatSucc
+ ofNatSucc_map_succ
+ realize_toLimit
+ toEmbeddingDirectedSystem
+ toLimit
+ toLimitElementary
+ toLimit_map

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)

Lean-aware diff — post-build, computed from the Lean environment (commit 1e76956).

  • +43 new declarations
  • −0 removed declarations
+DirectLimit.equivOfForallLE
+DirectLimit.iSup_lift_mk_le_mk
+DirectLimit.mk_eq_iSup_lift_mk
+DirectLimit.mk_eq_of_forall_lift_mk_eq
+DirectLimit.mk_le_of_aleph0_le
+DirectLimit.mk_le_sum
+FirstOrder.Language.ElementaryChain
+FirstOrder.Language.ElementaryChain.Limit
+FirstOrder.Language.ElementaryChain.carrier
+FirstOrder.Language.ElementaryChain.casesOn
+FirstOrder.Language.ElementaryChain.ctorIdx
+FirstOrder.Language.ElementaryChain.exists_finite_common_stage
+FirstOrder.Language.ElementaryChain.exists_toLimit
+FirstOrder.Language.ElementaryChain.liftElementary
+FirstOrder.Language.ElementaryChain.limit_models
+FirstOrder.Language.ElementaryChain.map
+FirstOrder.Language.ElementaryChain.map.congr_simp
+FirstOrder.Language.ElementaryChain.map_map
+FirstOrder.Language.ElementaryChain.map_self
+FirstOrder.Language.ElementaryChain.mk
+FirstOrder.Language.ElementaryChain.mk.inj
+FirstOrder.Language.ElementaryChain.mk.injEq
+FirstOrder.Language.ElementaryChain.mk.noConfusion
+FirstOrder.Language.ElementaryChain.mk.sizeOf_spec
+FirstOrder.Language.ElementaryChain.mk_limit_eq_of_forall_lift_mk_eq
+FirstOrder.Language.ElementaryChain.mk_limit_le_of_lift_mk_le
+FirstOrder.Language.ElementaryChain.noConfusion
+FirstOrder.Language.ElementaryChain.noConfusionType
+FirstOrder.Language.ElementaryChain.ofNatSucc
+FirstOrder.Language.ElementaryChain.ofNatSucc_map_succ
+FirstOrder.Language.ElementaryChain.realize_toLimit
+FirstOrder.Language.ElementaryChain.rec
+FirstOrder.Language.ElementaryChain.recOn
+FirstOrder.Language.ElementaryChain.struc
+FirstOrder.Language.ElementaryChain.toEmbeddingDirectedSystem
+FirstOrder.Language.ElementaryChain.toLimit
+FirstOrder.Language.ElementaryChain.toLimitElementary
+FirstOrder.Language.ElementaryChain.toLimit_map
+FirstOrder.Language.ElementaryEmbedding.natLERec
+FirstOrder.Language.ElementaryEmbedding.natLERec.congr_simp
+FirstOrder.Language.ElementaryEmbedding.natLERec_self
+FirstOrder.Language.ElementaryEmbedding.natLERec_succ
+FirstOrder.Language.ElementaryEmbedding.natLERec_trans

No changes to strong technical debt.

Increase in weak tech debt: (relative, absolute) = (2.00, 0.00)
Current number Change Type (weak)
5022 2 exposed public sections

Current commit 1e7695608f
Reference commit 6996953ff1

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).

@github-actions github-actions Bot added the t-logic Logic (model theory, etc) label Jul 23, 2026
@mathlib-dependent-issues mathlib-dependent-issues Bot added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Jul 23, 2026
@mathlib-dependent-issues mathlib-dependent-issues Bot removed the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Jul 27, 2026
@mathlib-dependent-issues

mathlib-dependent-issues Bot commented Jul 27, 2026

Copy link
Copy Markdown

This PR/issue depends on:

@mathlib-dependent-issues mathlib-dependent-issues Bot added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) t-logic Logic (model theory, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant