Skip to content

Instantly share code, notes, and snippets.

@Lysxia
Created November 30, 2018 01:59
Show Gist options
  • Select an option

  • Save Lysxia/13109240eff4082a9c17634c6e2f6c5f to your computer and use it in GitHub Desktop.

Select an option

Save Lysxia/13109240eff4082a9c17634c6e2f6c5f to your computer and use it in GitHub Desktop.
For Mukesh
Fixpoint map_intersperse_2
(A B : Type) (f : A -> B) (c : A) (l : list A) {struct l} :
map f (intersperse _ c l) = intersperse _ (f c) (map f l) :=
match l with
| [] => eq_refl
| h :: t =>
let foo := map_intersperse_2 _ _ f c t in
match t as t0
return
map f (intersperse _ c t0)
=
intersperse _ (f c) (map f t0)
->
map f (intersperse _ c (h :: t0))
=
intersperse _ (f c) (map f (h :: t0))
with
| [] => fun _ => eq_refl
| _ :: _ => fun foo =>
match foo in _ = X return _ = f h :: f c :: X with
| eq_refl => eq_refl
end
end foo
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment