Definition compare (x y : bool) : comparison :=
  match x, y with
  | true, false => Gt
  | false, true => Lt
  | true, true | false, false => Eq
  end.

(* Specifications: *)
Lemma compare_implies_eq : forall (x y : bool), compare x y = Eq -> x = y.
Lemma compare_same_is_eq : forall (x : bool), compare x x = Eq.