-
Notifications
You must be signed in to change notification settings - Fork 242
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 ] Reconcile left/right congruence statements and proofs #2532
Comments
Could you phrase your "decisions to be made" crisply? I feel like I can't give any opinion right now, as I'm not quite sure what I have to give an opinion on! Maybe split things into 1) crisp problem statement, and 2) discussion of the problem ? |
Ouch! Will attempt to do so... |
Here goes (but given I never seem to be able to meet @JacquesCarette 's standards of crispness/non-verbosity, I'm not confident): there are 2 mismatches at issue, as I see things:
As to discussion of the above, I've probably written a lot/too much already, but I'll return to this provided the above meets the required crispness threshhold. |
Those are quite crisp, thank you.
Those should likely be two issues, as they are not related to each other. Given the title of this issue, let's keep this one for left/right. So 'left' (in the context of an obvious binary operator or relation) can mean either
Personally, I think my brain definitely goes to the first interpretation. [And I would not be surprised at all if there were left / right in |
Thanks @JacquesCarette . The 'discussion'/issue title unfortunately does/did seem to involve both parts, mostly because of earlier bad decisions by me in #2426 :
HTH. |
So it seems that, at least on the examples polled, consistency favours 2, sorry! |
I looked again at the original PR, and it's v2.2, so actually fixing the offending switch in handedness should be a non-breaking change! (and we should do it quickly!) |
Aaargh... further investigation reveals further instances of 'opposite' conventions being employed:
++⁺ʳ : ∀ {xs ys} zs → xs ⊆ ys → zs ++ xs ⊆ zs ++ ys
++⁺ˡ : ∀ {xs ys} zs → xs ⊆ ys → xs ++ zs ⊆ ys ++ zs
Sigh. |
I did rather expect a lot more contradictions would show up. Not sure I would be convinced by a "majority" argument unless it was > 80% on one side. Certainly a 60/40 split would most definitely not sway me. I think we should 'design' this. Having said that: "works on the left" and "keeps left constant" are both really simple to explain, so I don't actually care which one is chosen. |
Re: majority arguments. Indeed, I agree (majority should be more decisive)... But in #2426 I even went against what was prevailing in those modules. For me, the argument is more (now): all such lemmas should be phrased in terms of |
For #2426 the main reason I'm still hesitating (even though that clearly introduce unnecessary inconsistency): what if we decide that the current handedness of the ones you changed there were actually right? That would introduce unnecessary incompatibilities. I do agree that we ought to go through |
As with my comment on #2535 whatever design choice we make will give rise to a |
++⁺ʳ
now has a type corresponding to the explicitly quantified version ofAlgebra.Definitions.LeftCongruent
++⁺ˡ
now has a type corresponding to the explicitly quantified version ofAlgebra.Definitions.RightCongruent
(and explicit because "
_++_
can't infer its arguments"... at least in the first case)Which nomenclature/notation should be taken as canon? (Potential issue: I think that the use(s) of left/right superscript annotations in the
Data.List.Relation*
hierarchy are opposite to those of theAlgebra.*
congruence properties... sigh)Barring the resolution of this question, I think this is (should be! ;-)) good to go now.
Originally posted by @jamesmckinna in #2426 (comment)
cf. #1436
Design decisions to be made:
Relation.Binary.Definitions
andAlgebra.Definitions
, so I'll try to remedy that with a v3.0 PR, and I'm inclined to decide in favour of theAlgebra.Definitions
left/right convention, unless anyone strongly objects. NB this goes against @MatthewDaggitt 's original comments on Add left- and right-Pointwise
congruence for_++_
onList
#2426 ...Left
/RightCongruent
: when considering prefixingxs ++_
as aPointwise
-respecting (or any otherData.List.Relation.Binary.*
), most, if not all of the uses of such properties do not requirexs
to be given explicitly (and as a suffixing operation, seemingly never, thanks to unification), and only a handful (typically those underData.List.Relation.Unary.Any.Properties
) actually do induction onxs
to prove the relevant property, but again, never seem to use it in anger when applying those proofs. So I'm strongly tempted not to change the quantifiers inAlgebra.Definitions
, again unless anyone strongly objects, and to modify the quantification inData.List.Relation.*.Properties
. This goes slightly against the design advocated in Standardise implicit arguments of cancellation properties. #1436 and elsewhere (egAssociativity
... which similarly almost never needs its arguments supplied explicitly), but is conformant with the abstract use of-congˡ
and-congʳ
derived forms inAlgebra.Structures.IsMagma
.(Similar remarks apply to the corresponding lemmas under
Data.Vec.Relation.*
in the usual way)Ahead of any review discussion (and consequent potential waste of bandwidth/effort) on a candidate PR, it would be useful to poll opinion on the wisdom of such choices, or otherwise!
The text was updated successfully, but these errors were encountered: