Skip to content

Instantly share code, notes, and snippets.

@takeouchida
Last active December 2, 2016 13:01
Show Gist options
  • Save takeouchida/cd3a3efcc64c50eae21b92b34482b557 to your computer and use it in GitHub Desktop.
Save takeouchida/cd3a3efcc64c50eae21b92b34482b557 to your computer and use it in GitHub Desktop.
rev (rev s) = s
Require Import mathcomp.ssreflect.ssreflect.
From mathcomp Require Import all_ssreflect.
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
Lemma cons_rcons T (x1 x2 : T) s : x1 :: rcons s x2 = rcons (x1 :: s) x2.
Proof. done. Qed.
Theorem rev_rev_id T (s : seq T) : rev (rev s) = s.
Proof.
elim: s => // x s. rewrite rev_cons. case: (rev s) => [|x1 s1] <- //=.
rewrite cons_rcons rev_rcons => //=.
Qed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment