-
Notifications
You must be signed in to change notification settings - Fork 247
Add prove of injectivity to Data.Fin.combine #1679
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
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.
Thanks for the great PR! I've added a few comments.
src/Data/Fin/Properties.agda
Outdated
where open ≡-Reasoning | ||
|
||
combine-surjective : ∀ {n k} (x : Fin (n ℕ.* k)) → Σ[ y ∈ Fin n ] Σ[ z ∈ Fin k ] combine y z ≡ x | ||
combine-surjective {n} {k} x with remQuot {n} k x | P.inspect (remQuot {n} k) x |
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.
Can we use the new with ... <- ...
idiom instead of inspect
? (see #1630 for an attempt to deprecate it.)
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.
combine-surjective : ∀ {n k} (x : Fin (n ℕ.* k)) → Σ[ y ∈ Fin n ] Σ[ z ∈ Fin k ] combine y z ≡ x
combine-surjective {n} {k} x with remQuot {n} k x in eq
... | y , z = y , z , (begin
combine y z ≡˘⟨ uncurry (cong₂ combine) (,-injective eq) ⟩
uncurry combine (remQuot {n} k x) ≡⟨ combine-remQuot {n} k x ⟩
x ∎)
where open ≡-Reasoning
causes
Panic: uncaught pattern violation
What agda version I need to have?
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.
Eek, that's scary. Agda 2.6.2 should be fine. If you're on that and the issue is still occuring, then I would open an issue on the main Agda repo with a cut-down example, and then I guess you'll need to switch back to inspect
👍
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 have 2.6.2.1. I will create an issue.
Thanks again for the PR! |
No description provided.