-
Notifications
You must be signed in to change notification settings - Fork 245
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
[ refactor ] (Re)define (Is)TightApartness
and (Is)HeytingCommutativeRing
/(Is)HeytingField
#2588
base: master
Are you sure you want to change the base?
Conversation
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.
Otherwise, code-wise it looks good. Can't comment on the mathematics 😄
@@ -36,8 +37,19 @@ open SetoidProperties setoid | |||
; cotrans = ≉-cotrans | |||
} | |||
|
|||
≉-tight : Tight _≈_ _≉_ | |||
≉-tight x y = decidable-stable (x ≟ y) |
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.
Missing addition from Changelog.
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.
yeah, I wasn't sure how to record this... it's a redefinition, rather than an addition, because the definition of Tight
has been changed in Relation.Binary.Definitions
to drop the redundant second conjunct, which is equivalent to Irreflexive
, as noted on the issue.
What's the best way to do this? (See latest commits for one attempt...)
@@ -17,6 +17,10 @@ Non-backwards compatible changes | |||
significantly faster. However, its reduction behaviour on open terms may have | |||
changed. | |||
|
|||
* The definitions of `Algebra.Structures.IsHeyting*` and |
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 know this is a draft, but in the final version it would be good to explain broadly what the refactorings actually are 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.
See latest commits, hopefully enough, but not too much, detail now!
… re-exported by `Algebra.Properties.Ring`
I think this is now ready for review! Many thanks to @MatthewDaggitt for the pre-review, hopefully the latest round of (many!) commits have put things on a more sound footing. As in updated preamble above:
|
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.
Spent a lot of time reviewing this... and no comment to speak of. I did spot several proofs that I'd want to change, but I should add some reasoning combinators first that would show how these embody repeated patterns.
x#0y#0→xy#0 : x # 0# → y # 0# → x * y # 0# | ||
x#0y#0→xy#0 {x} {y} x#0 y#0 = helper (#⇒invertible x#0) (#⇒invertible y#0) |
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.
@JacquesCarette 's wanting to refactor the proofs (and FTR, largely inherited from the original PR #1968 ...)
It occurs to me that some (all?) of these arguments could be refactored by going via Algebra.Properties.CancellativeCommutativeSemiring
, after establishing the relevant structure/bundle?
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.
Er... no, in fact. Those properties require Decidable _≈_
, and maybe could be simplified to consider only Tight _≈_ _≉_
, but I'm not going to push my luck...
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.
Could be. I was thinking of analogs to the elim
and cancel
reasoning combinators of agda-categories
. While at it, I would have ported push/pull (but renamed them) too. Many of these already work on Monoid
.
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.
Indeed: please raise a PR addressing #2288 !
Hopefully the discussion on #2587 clarifies this? |
Fixes #2587
Adds:
Algebra.Apartness.Properties.HeytingField
, supersedingAlgebra.Apartness.Properties.HeytingCommutativeRing
NB:
Algebra.Properties.Ring
(or evenAlgebra.Properties.AbelianGroup
...) DONE properties moved; module NOT deprecatedData.Rational.Unnormalised.Properties
should be refactored to make use ofRelation.Binary.Properties.DecSetoid
for its(Is)*ApartnessRelation
definitions DONEIssue:
bug
fix of the various APIs involved?) or v3.0 (as a largebreaking
change?)Apartness
vs.TightApartness
, etc. but that the fundamental distinction should be between*CommutativeRing
and*Field
(and yes: perhapsHeytingLocalRing
would have been better, but see also DefineLocalRing
#2219 ) in that the latter should have inverses, while the former need not. The existing APIs make the distinction turn on whether the apartness is tight or not, which seems 'wrong'... even to the point of being abug
?RFC from @cspollard and @bsaul ...