chore(ConditionallyCompleteLattice/Indexed): dualize#38938
Conversation
PR summary e19202a082Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
| theorem WithTop.sInf_empty [InfSet α] : sInf (∅ : Set (WithTop α)) = ⊤ := | ||
| if_pos <| by simp | ||
|
|
||
| @[to_dual (attr := norm_cast)] |
There was a problem hiding this comment.
Was there a particular reason for the WithTop ones to not have norm_cast? With this PR, both versions get tagged for norm_cast
There was a problem hiding this comment.
Yes, this is probably an oversight. I'm not sure that this is actually a good norm_cast lemma. can you try removing the tag? If something breaks as a result, then we'll know why we need the norm_cast tag.
4ff10ea to
7590793
Compare
|
|
||
| @[deprecated (since := "2026-04-05")] alias ciInf_eq_top_of_top_mem := ciSup_eq_top_of_top_mem | ||
|
|
||
| variable [WellFoundedLT α] |
There was a problem hiding this comment.
Dual theorems for WellFoundedLT did not get added because the chain of @[to_dual]s to add eventually leads to the WellFounded structure, which does not have a dual. And similarly for ConditionallyCompleteOrderBot
|
This pull request has conflicts, please merge |
|
This pull request has conflicts, please merge |
|
This pull request has conflicts, please merge |
|
Why does this PR depend on the other PR? Can't this be a standalone PR? |
c23b520 to
b86c675
Compare
|
This pull request is now in draft mode. No active bors state needed cleanup. While this PR remains draft, bors will ignore commands on this PR. Mark it ready for review before using commands like |
JovanGerb
left a comment
There was a problem hiding this comment.
Thanks for making this PR! With to_dual PRs, it is best to try to dualize all of the declarations in the files that you are dualizing, because otherwise, we will run into missing to_dual tags in the future. Doing so will make this PR even bigger, so you could maybe split it into a PR doing Basic.lean, and a subsequent one doing Indexed.lean.
|
|
||
| open Classical in | ||
| @[to_dual] | ||
| noncomputable instance WithTop.instSupSet [SupSet α] : |
There was a problem hiding this comment.
| noncomputable instance WithTop.instSupSet [SupSet α] : | |
| noncomputable instance [SupSet α] : |
Can you put the first part of the file inside a namespace WithTop? Then you can also omit the name of the instance altogether.
That does require dualizing all of the declarations in the section.
| InfSet (WithBot α) := | ||
| ⟨(WithTop.instSupSet (α := αᵒᵈ)).sSup⟩ | ||
|
|
||
| theorem WithTop.sSup_eq [SupSet α] {s : Set (WithTop α)} (hs : ⊤ ∉ s) |
There was a problem hiding this comment.
Is there a reason not to tag this with to_dual?
| theorem WithTop.sInf_empty [InfSet α] : sInf (∅ : Set (WithTop α)) = ⊤ := | ||
| if_pos <| by simp | ||
|
|
||
| @[to_dual (attr := norm_cast)] |
There was a problem hiding this comment.
Yes, this is probably an oversight. I'm not sure that this is actually a good norm_cast lemma. can you try removing the tag? If something breaks as a result, then we'll know why we need the norm_cast tag.
| by_cases BddAbove (s ∪ t) <;> | ||
| grind [csSup_union, bddAbove_union, csSup_of_not_bddAbove] | ||
|
|
||
| lemma sSup_iUnion_Iic (f : ι → α) : sSup (⋃ (i : ι), Iic (f i)) = ⨆ i, f i := by |
There was a problem hiding this comment.
Can you dualize this too?
| @[to_dual csInf_eq_of_forall_ge_of_forall_gt_exists_lt /-- Introduction rule to prove that `b` is | ||
| the infimum of `s`: it suffices to check that `b` is smaller than all elements of `s`, and that this | ||
| is not the case of any `w>b`. See `sInf_eq_of_forall_ge_of_forall_gt_exists_lt` for a version in | ||
| complete lattices. -/] |
There was a problem hiding this comment.
| @[to_dual csInf_eq_of_forall_ge_of_forall_gt_exists_lt /-- Introduction rule to prove that `b` is | |
| the infimum of `s`: it suffices to check that `b` is smaller than all elements of `s`, and that this | |
| is not the case of any `w>b`. See `sInf_eq_of_forall_ge_of_forall_gt_exists_lt` for a version in | |
| complete lattices. -/] | |
| @[to_dual csInf_eq_of_forall_ge_of_forall_gt_exists_lt | |
| /-- Introduction rule to prove that `b` is the infimum of `s`: it suffices to check that `b` | |
| is smaller than all elements of `s`, and that this is not the case of any `w>b`. | |
| See `sInf_eq_of_forall_ge_of_forall_gt_exists_lt` for a version in complete lattices. -/] |
I prefer starting the dual comment on a new line if it takes multiple lines, so that it aligns nicely with original comment. This makes it easier to edit both, and to ensure that they actually align. Similarly below
|
@JovanGerb Thank you for your comments! This makes sense, I will try to split it for |
|
This pull request has conflicts, please merge |
|
@lua-vr, have you made the new PR already? |
|
@JovanGerb no, not yet. Feel free to add awaiting-author. |
|
I have now created #41558 for using |
Uh oh!
There was an error while loading. Please reload this page.