Skip to content

Instantly share code, notes, and snippets.

@mukeshtiwari
Created August 25, 2016 01:35
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 mukeshtiwari/e0e5c873a8a44a186ba85de2637be79e to your computer and use it in GitHub Desktop.
Save mukeshtiwari/e0e5c873a8a44a186ba85de2637be79e to your computer and use it in GitHub Desktop.
A : Type
k : nat
O : (A -> bool) -> A -> bool
Hmon : mon O
l : list A
Hin : forall a : A, In a l
Hlen : length l <= k
n : nat
Hler : k >= n
H : forall a : A, iter O k nil_pred a = true <-> iter O (k + 1) nil_pred a = true
a : A
Hiter : iter O n nil_pred a = true
H0 : forall (n : nat) (a : A), iter O n nil_pred a = true -> iter O (n + 1) nil_pred a = true
============================
iter O k nil_pred a = true
From H0 and Hler, it is obvious that goal is true. How to follow this kind of chain of reasoning in Coq
Complete source code.
https://github.com/mukeshtiwari/formalized-voting/blob/master/fp.v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment