You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@tomjack has this definition of ⊥. It comes with a big advantage: because all
the proofs of a given Prop are definitionally equal, we get for free that all
proofs of a negative statement are equal (cf. unique).
{-# OPTIONS --prop #-}open importAgda.Builtin.EqualityrecordTruth (P :Prop) :Setwhereconstructor[_]fieldtruth : P
openTruthpublicdata⊥':Propwhere
⊥ = Truth ⊥'
¬ :Set→Set
¬ A = A → ⊥
unique : {A :Set} (x y : ¬ A) → x ≡ y
unique x y = refl
This would in particular allow us to change ≢-≟-identity's type from the
cumbersome ∀ {b} → a ≢ b → ∃ λ ¬eq → a ≟ b ≡ no ¬eq to the nicer ∀ {b} (¬eq : a ≢ b) → a ≟ b ≡ no ¬eq
Hmm interesting suggestion. The problem is that pattern matching on ⊥ is then results in [ () ] rather than () right?
Regardless of whether we adopt it or not, I'd prefer to hold off introducing it for a while until Prop has been in use for a bit. I'm sure there's probably not, but if there is a bug in the implementation then using it for the empty set seems the best possible way of breaking as much as the standard library as possible!
The problem is that pattern matching on ⊥ then results in [ () ] rather than () right?
Splitting a value of type ⊥ indeed yields [ truth ] rather than (). However ()
is accepted in 2.6.0 for a record with at least one absurd field so the change would
be backwards compatible.
Just like agda/agda#3533 improves case-splitting to take into account the fact that
Agda is now more clever, we could probably also get it to generate the expected ()
pattern.
One thing to consider is that some people might not want to use all features that Agda has to offer. If someone wants to work in the fragment of Agda that does not include Prop, then this change would presumably make large parts of the standard library useless.
Reacted by Matthew Daggitt, Tim Baumann and Jacques Carette
I think @nad is probably right about this one. At the very least, let's see how @JacquesCarette gets on using it in the category theory portion of the library first...
I'm going to close this for now but feel free to re-open in the future.
Sorry I should have been clearer given the title of the issue: I'm proposing to use irrelevance
(that we now use widely for NonZero arguments), not Prop.
Hmm so are you proposing a) to update the definition of ⊥ to a record with an irrelevant field or b) mark all arguments of type ⊥ to be irrelevant?
I'd be more on board with b), as the number of such arguments is very low and it doesn't involve altering crucial definitions for reasons that would be non-obvious to users.
The use case is having proofs of negations be trivially equal to each other. In which case there is no
"argument of type ⊥": ⊥ is the return type of the function.
Note that I've been successfully nudged to the positive side of this by this code which is now smooth but used to need a postulate. [It goes all the way to Prop, but I think that irrelevance could have been enough.]
If all you want is a proof irrelevant empty type, then just a record type with an irrelevant field is indeed enough. (Though I am still a bit sad that Prop is hidden under a flag).
Activity
MatthewDaggitt commentedon Mar 7, 2019
Hmm interesting suggestion. The problem is that pattern matching on
⊥is then results in[ () ]rather than()right?Regardless of whether we adopt it or not, I'd prefer to hold off introducing it for a while until
Prophas been in use for a bit. I'm sure there's probably not, but if there is a bug in the implementation then using it for the empty set seems the best possible way of breaking as much as the standard library as possible!gallais commentedon Mar 7, 2019
Splitting a value of type
⊥indeed yields[ truth ]rather than(). However()is accepted in 2.6.0 for a record with at least one absurd field so the change would
be backwards compatible.
Just like agda/agda#3533 improves case-splitting to take into account the fact that
Agda is now more clever, we could probably also get it to generate the expected
()pattern.
MatthewDaggitt commentedon Mar 8, 2019
If you think we can make it entirely backwards compatible then it definitely sounds worthwhile.
gallais commentedon Mar 8, 2019
I am currently writing a patch to fix case splitting for this work. ;)
nad commentedon Mar 8, 2019
One thing to consider is that some people might not want to use all features that Agda has to offer. If someone wants to work in the fragment of Agda that does not include
Prop, then this change would presumably make large parts of the standard library useless.MatthewDaggitt commentedon Apr 19, 2019
I think @nad is probably right about this one. At the very least, let's see how @JacquesCarette gets on using it in the category theory portion of the library first...
I'm going to close this for now but feel free to re-open in the future.
6 remaining items
gallais commentedon Feb 24, 2022
Sorry I should have been clearer given the title of the issue: I'm proposing to use irrelevance
(that we now use widely for
NonZeroarguments), not Prop.[-]Redefine Bottom to make use of Prop?[/-][+]Redefine Bottom to make its proofs irrelevant?[/+][-]Redefine Bottom to make its proofs irrelevant?[/-][+]Redefine ⊥ to make its proofs irrelevant?[/+]JacquesCarette commentedon Feb 24, 2022
Ah. Well, my bias still holds, but I don't think I have active reasons to object. And it would be a coherent choice to make.
MatthewDaggitt commentedon Feb 25, 2022
Hmm so are you proposing a) to update the definition of
⊥to a record with an irrelevant field or b) mark all arguments of type⊥to be irrelevant?I'd be more on board with b), as the number of such arguments is very low and it doesn't involve altering crucial definitions for reasons that would be non-obvious to users.
gallais commentedon Feb 25, 2022
The use case is having proofs of negations be trivially equal to each other. In which case there is no
"argument of type
⊥":⊥is the return type of the function.JacquesCarette commentedon Feb 25, 2022
Note that I've been successfully nudged to the positive side of this by this code which is now smooth but used to need a postulate. [It goes all the way to
Prop, but I think that irrelevance could have been enough.]jespercockx commentedon Feb 25, 2022
If all you want is a proof irrelevant empty type, then just a record type with an irrelevant field is indeed enough. (Though I am still a bit sad that
Propis hidden under a flag).MatthewDaggitt commentedon Feb 26, 2022
As long as it's well documented why the definition is a little odd then I'm not averse to making the change.
[ fix agda#645 ] Irrelevant Data.Empty
[ fix agda#645 ] Irrelevant Data.Empty
[ fix agda#645 ] Irrelevant Data.Empty (agda#1732)