Skip to content

Instantly share code, notes, and snippets.

@Blaisorblade
Created July 8, 2019 10:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Blaisorblade/2cc6275cce499c81ec30ff12b1fc4b23 to your computer and use it in GitHub Desktop.
Save Blaisorblade/2cc6275cce499c81ec30ff12b1fc4b23 to your computer and use it in GitHub Desktop.
Require Import ssreflect.
(*
Playing with
https://coq.inria.fr/refman/proof-engine/ssreflect-proof-language.html#type-families
*)
Lemma foo {a1 a2} : a1 = a2 -> a1 + a1 = a2 + a2.
Fail progress case.
(* Either one works, and gives a goal that can be dispatches by reflexivity. *)
(* case E: _ /. *)
(* case E: a2 /. *)
(* case: a2 /. *)
(* Harder: let's rewrite just one occurrence of a2, but generate an equation E: *)
case E: {2} a2 /.
(* Let's destruct on this equation to get to the rest. *)
(* case: a1 / E. *)
(* case: {1 2 3} a1 / E. *)
case: {1} a1 / E.
reflexivity.
Qed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment