-
Notifications
You must be signed in to change notification settings - Fork 250
Refactor Data.Vec.Properties
: Add toList-injective and new lemmas
#2733
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
Conversation
While I happen to like that, this goes specifically against the stdlib naming convention which states that it should be
It has been an (unwritten!) convention to not use tactics in fairly low-level parts of the library, as we don't want those parts of the library to depend on the |
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.
Generally the lemmas look good, but I agree with @JacquesCarette point about the use of tactics.
Otherwise once the old lemma is added back, then it looks good to go! |
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.
Other than the missing CHANGELOG
bit that @MatthewDaggitt asked for, and the cong!
, this looks good to me too.
Replace
Data.List.Base as List
andData.List.Properties as List
with shorterL
aliases throughout the module for better readable proofAdd new utility lemma
toList-injective
that proves vector equality from list equality using heterogeneous equalityAdd new equation-free lemmas that leverage
toList-injective
for cleaner proofs:fromList-reverse
: provesfromList (L.reverse xs) ≈[ L.length-reverse xs ] reverse (fromList xs)
++-ʳ++-eqFree
: proves associativity-like property for reverse-append without explicit equation parameterʳ++-ʳ++-eqFree
: proves composition property for reverse-append operationsUpdate all
List.
references toL.
in function types and implementationsImport
Tactic.Cong
module to support thecong!
tactic used in several proofsThis change improves code readability and adds a fundamental lemma for reasoning about vector equality via list conversion, which is used in several proofs throughout the module.