Skip to content

feat(ModelTheory): add syntax and semantics for infinitary logic - #42758

Open
cameronfreer wants to merge 1 commit into
leanprover-community:masterfrom
cameronfreer:freer/modeltheory-infinitary-pr1
Open

feat(ModelTheory): add syntax and semantics for infinitary logic#42758
cameronfreer wants to merge 1 commit into
leanprover-community:masterfrom
cameronfreer:freer/modeltheory-infinitary-pr1

Conversation

@cameronfreer

Copy link
Copy Markdown
Contributor

Add basic syntax and semantics for infinitary model theory of L∞ω (and Lω₁ω).

The new BoundedFormulaInf L ι α n uses index type ι for all of a formula's infinitary conjunctions and disjunctions, and the definitional

abbrev BoundedFormulaω (α : Type u') (n : ℕ) := L.BoundedFormulaInf ℕ α n

lands in exactly the universe of the finitary BoundedFormula, as suggested by @plp127 in #mathlib4 > ModelTheory: API for infinitary formulas of L_{∞,ω} @ 💬.

This PR contains iSup/iInf constructors, derived connectives together with alls/exs, Realize with simp lemmas for every constructor and derived connective, and the embedding BoundedFormula.toInf with realize_toInf.

I developed this with extensive assistance from several Claude and GPT models along with lean4-skills and lean-lsp-mcp as part of the ongoing project cameronfreer/infinitary-logic.

@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 Aug 14, 2026
@github-actions

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 Aug 14, 2026

Copy link
Copy Markdown

PR summary 8cfe4425f1

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.ModelTheory.Infinitary.Syntax (new file) 714
Mathlib.ModelTheory.Infinitary.Semantics (new file) 716

Declarations diff (regex)

+ BoundedFormulaInf
+ BoundedFormulaInf.realize_alls
+ BoundedFormulaInf.realize_exs
+ BoundedFormulaω
+ FormulaInf
+ FormulaInf.Realize
+ Formulaω
+ Realize
+ SentenceInf
+ SentenceInf.Realize
+ Sentenceω
+ alls
+ ex
+ exs
+ instance : Bot (L.BoundedFormulaInf ι α n)
+ instance : Inhabited (L.BoundedFormulaInf ι α n)
+ instance : Top (L.BoundedFormulaInf ι α n)
+ not
+ realize_all
+ realize_bot
+ realize_equal
+ realize_ex
+ realize_falsum
+ realize_iInf
+ realize_iSup
+ realize_imp
+ realize_not
+ realize_rel
+ realize_toInf
+ realize_top
+ toInf
+ toOmega
+ verum

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

  • +89 new declarations
  • −0 removed declarations
+FirstOrder.Language.BoundedFormula.realize_toInf
+FirstOrder.Language.BoundedFormula.toInf
+FirstOrder.Language.BoundedFormula.toInf.eq_def
+FirstOrder.Language.BoundedFormula.toOmega
+FirstOrder.Language.BoundedFormulaInf
+FirstOrder.Language.BoundedFormulaInf.Realize
+FirstOrder.Language.BoundedFormulaInf.Realize.eq_def
+FirstOrder.Language.BoundedFormulaInf.all
+FirstOrder.Language.BoundedFormulaInf.all.elim
+FirstOrder.Language.BoundedFormulaInf.all.inj
+FirstOrder.Language.BoundedFormulaInf.all.injEq
+FirstOrder.Language.BoundedFormulaInf.all.noConfusion
+FirstOrder.Language.BoundedFormulaInf.all.sizeOf_spec
+FirstOrder.Language.BoundedFormulaInf.alls
+FirstOrder.Language.BoundedFormulaInf.alls.eq_def
+FirstOrder.Language.BoundedFormulaInf.below
+FirstOrder.Language.BoundedFormulaInf.brecOn
+FirstOrder.Language.BoundedFormulaInf.brecOn.eq
+FirstOrder.Language.BoundedFormulaInf.brecOn.go
+FirstOrder.Language.BoundedFormulaInf.casesOn
+FirstOrder.Language.BoundedFormulaInf.ctorElim
+FirstOrder.Language.BoundedFormulaInf.ctorElimType
+FirstOrder.Language.BoundedFormulaInf.ctorIdx
+FirstOrder.Language.BoundedFormulaInf.equal
+FirstOrder.Language.BoundedFormulaInf.equal.elim
+FirstOrder.Language.BoundedFormulaInf.equal.inj
+FirstOrder.Language.BoundedFormulaInf.equal.injEq
+FirstOrder.Language.BoundedFormulaInf.equal.noConfusion
+FirstOrder.Language.BoundedFormulaInf.equal.sizeOf_spec
+FirstOrder.Language.BoundedFormulaInf.ex
+FirstOrder.Language.BoundedFormulaInf.exs
+FirstOrder.Language.BoundedFormulaInf.exs.eq_def
+FirstOrder.Language.BoundedFormulaInf.falsum
+FirstOrder.Language.BoundedFormulaInf.falsum.elim
+FirstOrder.Language.BoundedFormulaInf.falsum.noConfusion
+FirstOrder.Language.BoundedFormulaInf.falsum.sizeOf_spec
+FirstOrder.Language.BoundedFormulaInf.iInf
+FirstOrder.Language.BoundedFormulaInf.iInf.elim
+FirstOrder.Language.BoundedFormulaInf.iInf.inj
+FirstOrder.Language.BoundedFormulaInf.iInf.injEq
+FirstOrder.Language.BoundedFormulaInf.iInf.noConfusion
+FirstOrder.Language.BoundedFormulaInf.iInf.sizeOf_spec
+FirstOrder.Language.BoundedFormulaInf.iSup
+FirstOrder.Language.BoundedFormulaInf.iSup.elim
+FirstOrder.Language.BoundedFormulaInf.iSup.inj
+FirstOrder.Language.BoundedFormulaInf.iSup.injEq
+FirstOrder.Language.BoundedFormulaInf.iSup.noConfusion
+FirstOrder.Language.BoundedFormulaInf.iSup.sizeOf_spec
+FirstOrder.Language.BoundedFormulaInf.imp
+FirstOrder.Language.BoundedFormulaInf.imp.elim
+FirstOrder.Language.BoundedFormulaInf.imp.inj
+FirstOrder.Language.BoundedFormulaInf.imp.injEq
+FirstOrder.Language.BoundedFormulaInf.imp.noConfusion
+FirstOrder.Language.BoundedFormulaInf.imp.sizeOf_spec
+FirstOrder.Language.BoundedFormulaInf.instBot
+FirstOrder.Language.BoundedFormulaInf.instInhabited
+FirstOrder.Language.BoundedFormulaInf.instTop
+FirstOrder.Language.BoundedFormulaInf.noConfusion
+FirstOrder.Language.BoundedFormulaInf.noConfusionType
+FirstOrder.Language.BoundedFormulaInf.not
+FirstOrder.Language.BoundedFormulaInf.realize_all
+FirstOrder.Language.BoundedFormulaInf.realize_alls
+FirstOrder.Language.BoundedFormulaInf.realize_bot
+FirstOrder.Language.BoundedFormulaInf.realize_equal
+FirstOrder.Language.BoundedFormulaInf.realize_ex
+FirstOrder.Language.BoundedFormulaInf.realize_exs
+FirstOrder.Language.BoundedFormulaInf.realize_falsum
+FirstOrder.Language.BoundedFormulaInf.realize_iInf
+FirstOrder.Language.BoundedFormulaInf.realize_iSup
+FirstOrder.Language.BoundedFormulaInf.realize_imp
+FirstOrder.Language.BoundedFormulaInf.realize_not
+FirstOrder.Language.BoundedFormulaInf.realize_rel
+FirstOrder.Language.BoundedFormulaInf.realize_top
+FirstOrder.Language.BoundedFormulaInf.rec
+FirstOrder.Language.BoundedFormulaInf.recOn
+FirstOrder.Language.BoundedFormulaInf.rel
+FirstOrder.Language.BoundedFormulaInf.rel.elim
+FirstOrder.Language.BoundedFormulaInf.rel.inj
+FirstOrder.Language.BoundedFormulaInf.rel.injEq
+FirstOrder.Language.BoundedFormulaInf.rel.noConfusion
+FirstOrder.Language.BoundedFormulaInf.rel.sizeOf_spec
+FirstOrder.Language.BoundedFormulaInf.verum
+FirstOrder.Language.BoundedFormulaω
+FirstOrder.Language.FormulaInf
+FirstOrder.Language.FormulaInf.Realize
+FirstOrder.Language.Formulaω
+FirstOrder.Language.SentenceInf
+FirstOrder.Language.SentenceInf.Realize
+FirstOrder.Language.Sentenceω

No changes to strong technical debt.

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

Current commit 8cfe4425f1
Reference commit caa4dbde35

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 Aug 14, 2026
@cameronfreer

Copy link
Copy Markdown
Contributor Author

LLM-generated

@github-actions github-actions Bot added the LLM-generated PRs with substantial input from LLMs - review accordingly label Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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! t-logic Logic (model theory, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant