-
Notifications
You must be signed in to change notification settings - Fork 251
[ add ] BooleanRing
plus Properties
#2763
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
base: master
Are you sure you want to change the base?
Conversation
Removed spurious entry
Hmm, if the base is I guess it would be really weird for a "boolean ring" to have only false but not true. And then clearly Probably this means that the main file needs more comments. |
A thought on this: If * is idempotent, then 1 = -1 * -1 = -1, so -x = -1 * x = 1 * x = x, so -_ ~ id. (not Can we have this based on semiring, and prove it's a ring? Note that this is only possible if we do have a multiplicative identity |
@Taneb wrote:
I wasn't sure what to make of this...
... so such a proof would then indeed rely on rule-of-signs, and that would make this PR blocking on #2761
Ah!? By defining |
Cf. @JacquesCarette 's #2761 (comment) about |
@Taneb I think you are right, to the extent that:
will have, as now in the current
Thus the additive structure will in fact be an So for now, I'll replace the uses of Let me know if you want to change the underlying API to: record IsBooleanRing
(+ * : Op₂ A) (0# 1# : A) : Set (a ⊔ ℓ) where
field
isSemiring : IsSemiring + * 0# 1#
+-cancel : Cancellative +
*-idem : Idempotent *
open IsSemiring isSemiring public
+-cancelˡ : LeftCancellative +
+-cancelˡ = proj₁ +-cancel
+-cancelʳ : RightCancellative +
+-cancelʳ = proj₂ +-cancel
*-isIdempotentMonoid : IsIdempotentMonoid * 1#
*-isIdempotentMonoid = record { isMonoid = *-isMonoid ; idem = *-idem }
open IsIdempotentMonoid *-isIdempotentMonoid public
using () renaming (isBand to *-isBand) Everything indeed seems to work with such definition... but maybe that should be called UPDATED: so committed, with various knock-ons such as needing to introduce a stub for |
Hmm, not sure if after all that refactoring that I have the |
Fixes #2704
Outstanding issue:
IsRing
orIsRingWithoutOne
?TODO:
BooleanRing
andBooleanAlgebra
(which does require a1#
, IIUC)