Skip to content

Instantly share code, notes, and snippets.

View jakobbotsch's full-sized avatar

Jakob Botsch Nielsen jakobbotsch

View GitHub Profile
@JasonGross
JasonGross / fast_fin.v
Created May 23, 2019 02:42
Fast boolean equality proofs on finite types
Require Import Coq.Lists.List.
Require Import Coq.Bool.Bool.
Import ListNotations.
Lemma negb_existsb_nth_error {A} (ls : list A) (f : A -> bool) (H : existsb f ls = false) n v (H' : nth_error ls n = Some v)
: f v = false.
Proof.
revert dependent n; induction ls, n; cbn in *; intros; try congruence.
all: repeat first [ progress subst
| rewrite orb_false_iff in *