-
Notifications
You must be signed in to change notification settings - Fork 383
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
[Merged by Bors] - refactor: Make CompleteLinearOrder
extend BiheytingAlgebra
#12731
Conversation
In fact, linear orders themselves are biheyting algebras, but registering this as an instance causes a bit of a chicken and the egg problem which I'm not willing to try solving. `CompleteLinearOrder` really does need to extend `BiheytingAlgebra` if we are going to make `Frame` extend `HeytingAlgebra`.
Mathlib/Order/UpperLower/Basic.lean
Outdated
decidableLE := Classical.decRel _ | ||
decidableEq := Classical.decRel _ | ||
decidableLT := Classical.decRel _ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I worry this is going to create a diamond with the instLinearOrder
instance above. Can't you use __ := instLinearOrder
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both are definitely Classical.decRel _
because they prove decidability of inclusions of sets.
Spread notation seems to be broken/uncover a diamond. This works:
noncomputable instance UpperSet.instCompleteLinearOrder : CompleteLinearOrder (UpperSet α) where
__ := completelyDistribLattice
__ := instLinearOrder
himp := LinearOrder.toBiheytingAlgebra.himp
le_himp_iff := LinearOrder.toBiheytingAlgebra.le_himp_iff
compl := LinearOrder.toBiheytingAlgebra.compl
himp_bot := LinearOrder.toBiheytingAlgebra.himp_bot
sdiff := LinearOrder.toBiheytingAlgebra.sdiff
hnot := LinearOrder.toBiheytingAlgebra.hnot
sdiff_le_iff := LinearOrder.toBiheytingAlgebra.sdiff_le_iff
top_sdiff := LinearOrder.toBiheytingAlgebra.top_sdiff
This works too:
noncomputable instance UpperSet.instCompleteLinearOrder : CompleteLinearOrder (UpperSet α) :=
{ completelyDistribLattice, instLinearOrder, LinearOrder.toBiheytingAlgebra with }
This doesn't:
noncomputable instance UpperSet.instCompleteLinearOrder : CompleteLinearOrder (UpperSet α) where
__ := completelyDistribLattice
__ := instLinearOrder
__ := LinearOrder.toBiheytingAlgebra
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to have "tests" to confirm the definitional equality (with_reducible_and_instances rfl
?) of diamonds?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would that help here? I think it's a metavariable issue with the spread notation, not an actual non-defeq diamond.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 🎉
bors merge
In fact, linear orders themselves are biheyting algebras, but registering this as an instance causes a bit of a chicken and the egg problem which I'm not willing to try solving. `CompleteLinearOrder` really does need to extend `BiheytingAlgebra` if we are going to make `Frame` extend `HeytingAlgebra`. This is a step towards #10560
Pull request successfully merged into master. Build succeeded: |
CompleteLinearOrder
extend BiheytingAlgebra
CompleteLinearOrder
extend BiheytingAlgebra
In fact, linear orders themselves are biheyting algebras, but registering this as an instance causes a bit of a chicken and the egg problem which I'm not willing to try solving. `CompleteLinearOrder` really does need to extend `BiheytingAlgebra` if we are going to make `Frame` extend `HeytingAlgebra`. This is a step towards #10560
In fact, linear orders themselves are biheyting algebras, but registering this as an instance causes a bit of a chicken and the egg problem which I'm not willing to try solving. `CompleteLinearOrder` really does need to extend `BiheytingAlgebra` if we are going to make `Frame` extend `HeytingAlgebra`. This is a step towards #10560
In fact, linear orders themselves are biheyting algebras, but registering this as an instance causes a bit of a chicken and the egg problem which I'm not willing to try solving.
CompleteLinearOrder
really does need to extendBiheytingAlgebra
if we are going to makeFrame
extendHeytingAlgebra
.This is a step towards #10560