Sergei Meshveliani
2018-09-24 17:07:27 UTC
People,
This is about Fin and `lookup' of Standard library.
I am trying to prove the following simple lemma:
... (i : Fin (length xs)) â lookup xs i â¡ lookup (xs ++ [ y ]) i
Only the last occurrence of i needs to be replaced with
i' = (inject†i length-xs-â€-length-xs++y).
This proof occurs difficult for me.
Then I replace Fin with
Fin' : â â Set
Fin' n = Σ â (_< n)
And succeed with a proof for the corresponding lookup' and lemma'.
Is Fin' better?
Can people, please, provide a reasonably looking proof for `lemma' with
Fin ?
I attach a small source containing first the version (II) with Fin',
and then the formulation for version (I).
Thanks,
------
Sergei
This is about Fin and `lookup' of Standard library.
I am trying to prove the following simple lemma:
... (i : Fin (length xs)) â lookup xs i â¡ lookup (xs ++ [ y ]) i
Only the last occurrence of i needs to be replaced with
i' = (inject†i length-xs-â€-length-xs++y).
This proof occurs difficult for me.
Then I replace Fin with
Fin' : â â Set
Fin' n = Σ â (_< n)
And succeed with a proof for the corresponding lookup' and lemma'.
Is Fin' better?
Can people, please, provide a reasonably looking proof for `lemma' with
Fin ?
I attach a small source containing first the version (II) with Fin',
and then the formulation for version (I).
Thanks,
------
Sergei