Skip to content

chore(SetTheory/Ordinal/FixedPointApproximants): golf + better variable management#16361

Closed
vihdzp wants to merge 8 commits intomasterfrom
vi.fpfix
Closed

chore(SetTheory/Ordinal/FixedPointApproximants): golf + better variable management#16361
vihdzp wants to merge 8 commits intomasterfrom
vi.fpfix

Conversation

@vihdzp
Copy link
Copy Markdown
Collaborator

@vihdzp vihdzp commented Aug 31, 2024

We avoid making f : α →o α and x : α explicit arguments when not needed. We then golf most theorems in the file.


Open in Gitpod

@vihdzp vihdzp added the t-logic Logic (model theory, etc) label Aug 31, 2024
@github-actions
Copy link
Copy Markdown

github-actions bot commented Aug 31, 2024

PR summary 34451f3c7e

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

No declarations were harmed in the making of this PR! 🐙

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.

@vihdzp vihdzp added the WIP Work in progress label Sep 5, 2024
@vihdzp vihdzp removed the WIP Work in progress label Sep 5, 2024
@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 25, 2024
@github-actions github-actions bot added the t-set-theory Set theory label Oct 8, 2024
@vihdzp vihdzp requested a review from PhoenixIra October 8, 2024 07:21
@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 8, 2024
Copy link
Copy Markdown
Collaborator

@PhoenixIra PhoenixIra left a comment

Choose a reason for hiding this comment

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

I left some small suggestions for further golfing.

apply And.intro (le_lfpApprox f x)
use le_lfpApprox f x a
intro a' ha'b
by_cases haa : a' < a
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We could also use cases lt_or_le a' a here instead.

theorem lfpApprox_mono_mid (f : α →o α) : Monotone (lfpApprox f) := by
intro x₁ x₂ h a
induction a using Ordinal.induction with
| h i ih =>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maybe you could also get rid of the constructor here and use use le_sup_of_le_left h instead.

rw [mem_fixedPoints_iff] at h
induction b using Ordinal.induction with | h b IH =>
apply le_antisymm
· conv => left; rw [lfpApprox]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
· conv => left; rw [lfpApprox]
· rw [lfpApprox]

This should work as well

Comment on lines 75 to 76
refine sSup_le_sSup ?h
apply sup_le_sup_right
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
refine sSup_le_sSup ?h
apply sup_le_sup_right
apply sSup_le_sSup <| sup_le_sup_right ?h _

Or at least we can remove the ?h here, I think.

Copy link
Copy Markdown
Contributor

@YaelDillies YaelDillies left a comment

Choose a reason for hiding this comment

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

I have strain injuries to both wrists, hence must not type much. Please apologise the poor spelling, vague indications and general conciseness.

theorem lfpApprox_monotone (f : α →o α) (x : α) : Monotone (lfpApprox f x) := by
intros a b h
rw [lfpApprox, lfpApprox]
refine sSup_le_sSup ?h
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.

gcongr?

decreasing_by exact h

theorem lfpApprox_monotone : Monotone (lfpApprox f x) := by
theorem lfpApprox_monotone (f : α →o α) (x : α) : Monotone (lfpApprox f x) := by
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.

gcongr?

exact ⟨a', h'.trans_le h, rfl⟩

theorem le_lfpApprox {a : Ordinal} : x ≤ lfpApprox f x a := by
theorem le_lfpApprox (f : α →o α) (x : α) (a : Ordinal) : x ≤ lfpApprox f x a := by
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.

plrase keep a implicit

@YaelDillies YaelDillies added the awaiting-author A reviewer has asked the author a question or requested changes. label Nov 2, 2024
@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 Nov 23, 2024
@YaelDillies YaelDillies deleted the vi.fpfix branch October 25, 2025 10:40
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. merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) t-logic Logic (model theory, etc) t-set-theory Set theory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants