Skip to content

Instantly share code, notes, and snippets.

@gdsfh
Created January 18, 2013 15:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gdsfh/4565232 to your computer and use it in GitHub Desktop.
Save gdsfh/4565232 to your computer and use it in GitHub Desktop.
Require Import List.
Inductive prop : list (bool * nat) -> Prop :=
| Case_cons : forall hb hn t, hb = true -> prop ((hb, hn) :: t)
| Case_nil : prop nil
.
Goal prop ((true, 0) :: nil).
apply Case_cons; reflexivity.
Defined.
(* that's ok. *)
Goal forall (f : nat -> nat) lst,
prop lst ->
prop
(match lst with
| nil => nil
| cons h t =>
match h with
| (hb, hn) =>
let hn' := f hn in
(hb, hn') :: t
end
end
)
.
intros.
induction lst.
(* nil *)
apply Case_nil.
(* cons *)
(* compute in *. // doesn't change anything *)
cbv.
apply Case_cons.
(*
Error: Impossible to unify "prop ((?18952, ?18953) :: ?18954)" with
"prop (let (hb, hn) := a in (hb, f hn) :: lst)".
same error for "eapply Case_cons"
*)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment