How do you prove that an Ascii character compares equal with itself in Coq idiomatically?
In the course of trying to prove a random exercise in Logical Foundations, I wanted to prove the following very simple lemma. This lemma is removed enough from the way a student is intended to prove the theorems in LF that I'm comfortable posting it in a public forum.
Lemma ascii_equals_self : forall x, Ascii.eqb x x = true.
I can prove this exhaustively by examining 256 goals in parallel, one for each boolean within Ascii.ascii
.
Require Export Coq.Strings.String.
Lemma ascii_equals_self : forall x, Ascii.eqb x x = true.
Proof.
intros.
destruct x.
all:destruct b.
all:destruct b0.
all:destruct b1.
all:destruct b2.
all:destruct b3.
all:destruct b4.
all:destruct b5.
all:destruct b6.
all:auto.
Qed.
However, this is a little unsatisfying and it feels like there's a higher-level tactic or language feature that I could use to prove this quickly.