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
Probably WellFounded does not hold for <-lex on lists.
Right?
But for each n, it holds for the vectors of length ≤ n.
So far I have implemented it for vectors of length ≡ n.
But
a) my library uses a different representation for Vector (shown below),
b) I expect, the Agda team can implement this itself.
c) I can send the code as a sample, it is clear enough. One can rewrite it to the standard Vector representation.
The approach is as follows.
The vector representation:
module Vector.Base {α} (A : Set α)
where
data Vector (n : ℕ) : Set α
where
vec : (xs : List A) → length xs ≡ n → Vector n
_<_ : Rel A α
A general simple lemma suggested in another issue and used here:
The proof is by induction on n and by using <lex-1+n ⇒ (×-lex _<_ <lexₙ) on f,
where f : Vector 1+n → A × Vector n is a certain evident map.
This is using that a) <lex-1+n on Vector 1+n equals to a certain composition ×-lex on Product with <lexₙ on Vector n,
b) WellFounded for ×-lex for Product is in lib-1.7.
The text was updated successfully, but these errors were encountered:
MatthewDaggitt
changed the title
Proposal WellFounded for lexicorgaphic ordering on Vector n.WellFounded for lexicographic ordering on Vector.
Mar 12, 2022
I don't think we would want to add your representation of Vector to the standard library. But if you would like to make a PR with a proof that the lexicographic order over the current version of Vector is a well-founded relation if the original relation is well-founded, that would be welcome.
Probably WellFounded does not hold for <-lex on lists.
Right?
But for each n, it holds for the vectors of length ≤ n.
So far I have implemented it for vectors of length ≡ n.
But
a) my library uses a different representation for
Vector
(shown below),b) I expect, the Agda team can implement this itself.
c) I can send the code as a sample, it is clear enough. One can rewrite it to the standard Vector representation.
The approach is as follows.
The vector representation:
A general simple lemma suggested in another issue and used here:
Lexicographic ordering on lists:
Lexicographic ordering on
Vector n
:Theorem:
The proof is by induction on n and by using
<lex-1+n ⇒ (×-lex _<_ <lexₙ) on f,
where
f : Vector 1+n → A × Vector n
is a certain evident map.This is using that a)
<lex-1+n
onVector 1+n
equals to a certain composition×-lex
onProduct
with<lexₙ
onVector n
,b)
WellFounded
for×-lex
forProduct
is in lib-1.7.The text was updated successfully, but these errors were encountered: