Require Bool.
Local Open Scope char.
Local Open Scope N.
(** Total order on characters. *)
Definition compare (x y : Ascii.ascii) : comparison :=
N.compare (Ascii.N_of_ascii x) (Ascii.N_of_ascii y).
unfold compare; intros x y H.
rewrite <- ascii_N_embedding with (a := x);
rewrite <- ascii_N_embedding with (a := y).
f_equal.
now apply N.compare_eq_iff.
Qed.

Lemma compare_same_is_eq : forall (x : Ascii.ascii), compare x x = Eq.