Skip to content

feat(ModelTheory): typeclass for theory to have nonempty models - #42513

Open
plp127 wants to merge 3 commits into
leanprover-community:masterfrom
plp127:aliu/nonempty-theory
Open

feat(ModelTheory): typeclass for theory to have nonempty models#42513
plp127 wants to merge 3 commits into
leanprover-community:masterfrom
plp127:aliu/nonempty-theory

Conversation

@plp127

@plp127 plp127 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

We add a typeclass for a theory to have nonempty models. We provide instances for nonemptyTheory, infiniteTheory, and completeTheory.


Open in Gitpod

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

PR summary 4cc12ddf7c

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff (regex)

+ IsNonemptyTheory
+ IsNonemptyTheory.mono
+ IsNonemptyTheory.nonempty
+ instance : IsNonemptyTheory (infiniteTheory L)
+ instance : IsNonemptyTheory (nonemptyTheory L)
+ instance : Nonempty Language.ring.Constants := ⟨zeroFunc⟩
+ instance [Nonempty M] : IsNonemptyTheory (completeTheory L M)
+ isNonemptyTheory_of_cardGe_mem
+ isNonemptyTheory_of_nonempty_constants

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

  • +14 new declarations
  • −0 removed declarations
+FirstOrder.Language.IsNonemptyTheory
+FirstOrder.Language.IsNonemptyTheory.casesOn
+FirstOrder.Language.IsNonemptyTheory.mk
+FirstOrder.Language.IsNonemptyTheory.mono
+FirstOrder.Language.IsNonemptyTheory.nonempty
+FirstOrder.Language.IsNonemptyTheory.not_models'
+FirstOrder.Language.IsNonemptyTheory.rec
+FirstOrder.Language.IsNonemptyTheory.recOn
+FirstOrder.Language.instIsNonemptyTheoryCompleteTheoryOfNonempty
+FirstOrder.Language.instIsNonemptyTheoryInfiniteTheory
+FirstOrder.Language.instIsNonemptyTheoryNonemptyTheory
+FirstOrder.Language.isNonemptyTheory_of_cardGe_mem
+FirstOrder.Language.isNonemptyTheory_of_nonempty_constants
+FirstOrder.Ring.instNonemptyConstantsRing

No changes to strong technical debt.

No changes to weak technical debt.

Current commit 4cc12ddf7c
Reference commit 38c06cd7f3

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 6, 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 Aug 7, 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 Aug 7, 2026
@mathlib-dependent-issues

Copy link
Copy Markdown

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

Labels

t-logic Logic (model theory, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant