Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ModelTheory/Complexity): define literals #16885

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open

Conversation

metinersin
Copy link
Collaborator

@metinersin metinersin commented Sep 17, 2024

Defines FirstOrder.Language.BoundedFormula.IsLiteral and FirstOrder.Language.BoundedFormula.simpleNot - an auxiliary operation that takes the negation of a formula and does some simplification.


Open in Gitpod

@leanprover-community-bot-assistant leanprover-community-bot-assistant added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Sep 17, 2024
@github-actions github-actions bot added the new-contributor This PR was made by a contributor with fewer than 5 merged PRs. Welcome to the community! label Sep 17, 2024
Copy link

github-actions bot commented Sep 17, 2024

PR summary 96ffb83c8b

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ IsAtomic.isLiteral
+ IsAtomic.simpleNot_eq_not
+ IsAtomic.simpleNot_not
+ IsLiteral
+ IsLiteral.simpleNot
+ inf
+ inf_sup_left_iff
+ inf_sup_right_iff
+ not_all_iff_ex_not
+ not_ex_iff_all_not
+ not_inf_iff_sup_not
+ not_sup_iff_inf_not
+ realize_falsum
+ realize_simpleNot
+ simpleNot
+ simpleNot_iff_not
+ sup
+ sup_inf_left_iff
+ sup_inf_right_iff

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

The doc-module for script/declarations_diff.sh contains some details about this script.

@metinersin metinersin added the t-logic Logic (model theory, etc) label Sep 17, 2024
@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot added the blocked-by-other-PR This PR depends on another PR to Mathlib (this label is automatically managed by a bot) label Sep 17, 2024
@leanprover-community-bot-assistant leanprover-community-bot-assistant removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Sep 17, 2024
@awainverse
Copy link
Contributor

Rather than defining simpleNotAux as having values in {ψ : L.BoundedFormula α n // ψ ⇔[∅] ∼φ},
I feel like it might be simpler to just define simpleNot directly, and then prove simpleNot_semanticallyEquivalent_not by induction. (This is how I defined toPrenex.)

At least - I think it might be easier to use, once simpleNot becomes a recursive definition, instead of the first part of a recursive definition, but clearly this way is compatible with your subsequent work, so it may be subjective.

@metinersin
Copy link
Collaborator Author

metinersin commented Sep 18, 2024

Rather than defining simpleNotAux as having values in {ψ : L.BoundedFormula α n // ψ ⇔[∅] ∼φ}, I feel like it might be simpler to just define simpleNot directly, and then prove simpleNot_semanticallyEquivalent_not by induction. (This is how I defined toPrenex.)

At least - I think it might be easier to use, once simpleNot becomes a recursive definition, instead of the first part of a recursive definition, but clearly this way is compatible with your subsequent work, so it may be subjective.

I agree. Defining simpleNot directly is more beautiful. I did it this way because the match pattern inside it was a little more complicated originally, and the split tactic did not work against it. I will update the code.

@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot removed the blocked-by-other-PR This PR depends on another PR to Mathlib (this label is automatically managed by a bot) label Oct 2, 2024
@mathlib4-dependent-issues-bot
Copy link
Collaborator

@leanprover-community-bot-assistant leanprover-community-bot-assistant added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Oct 2, 2024
@leanprover-community-bot-assistant leanprover-community-bot-assistant removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Oct 3, 2024
Mathlib/ModelTheory/Complexity.lean Outdated Show resolved Hide resolved
Mathlib/ModelTheory/Complexity.lean Outdated Show resolved Hide resolved
Mathlib/ModelTheory/Complexity.lean Outdated Show resolved Hide resolved
Mathlib/ModelTheory/Complexity.lean Outdated Show resolved Hide resolved
Mathlib/ModelTheory/Complexity.lean Outdated Show resolved Hide resolved
Mathlib/ModelTheory/Equivalence.lean Outdated Show resolved Hide resolved
Mathlib/ModelTheory/Equivalence.lean Outdated Show resolved Hide resolved
@YaelDillies YaelDillies added the awaiting-author A reviewer has asked the author a question or requested changes label Oct 3, 2024
@metinersin metinersin removed the awaiting-author A reviewer has asked the author a question or requested changes label Oct 3, 2024
Mathlib/ModelTheory/Complexity.lean Outdated Show resolved Hide resolved
Mathlib/ModelTheory/Complexity.lean Outdated Show resolved Hide resolved
Mathlib/ModelTheory/Complexity.lean Outdated Show resolved Hide resolved
Mathlib/ModelTheory/Equivalence.lean Outdated Show resolved Hide resolved
Mathlib/ModelTheory/Equivalence.lean Outdated Show resolved Hide resolved
Comment on lines +369 to +383
/-- The conjunction of two bounded formulas is also a bounded formula. -/
@[match_pattern]
protected def inf (φ ψ : L.BoundedFormula α n) : L.BoundedFormula α n :=
(φ.imp ψ.not).not

instance : Inf (L.BoundedFormula α n) :=
fun f g => (f.imp g.not).not⟩
fun f g => f.inf g⟩

/-- The disjunction of two bounded formulas is also a bounded formula. -/
@[match_pattern]
protected def sup (φ ψ : L.BoundedFormula α n) : L.BoundedFormula α n :=
φ.not.imp ψ

instance : Sup (L.BoundedFormula α n) :=
fun f g => f.not.imp g⟩
fun f g => f.sup g⟩
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's the point of this change?

Copy link
Collaborator Author

@metinersin metinersin Oct 3, 2024

Choose a reason for hiding this comment

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

I defined separate sup and inf functions with a match_pattern tag to be able to use sup φ ψ and inf φ ψ inside match in the definition of simpleNot. Do you know how to make the expressions φ ⊔ ψ and φ ⊓ ψ matchable?

@YaelDillies YaelDillies added the awaiting-author A reviewer has asked the author a question or requested changes label Oct 3, 2024
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 new-contributor This PR was made by a contributor with fewer than 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.

5 participants