(************************************************************************)
(*         *      The Rocq Prover / The Rocq Development Team           *)
(*  v      *         Copyright INRIA, CNRS and contributors             *)
(* <O___,, * (see version control and CREDITS file for authors & dates) *)
(*   \VV/  **************************************************************)
(*    //   *    This file is distributed under the terms of the         *)
(*         *     GNU Lesser General Public License Version 2.1          *)
(*         *     (see LICENSE file for the text of the license)         *)
(************************************************************************)
(** * Uint63 numbers defines Z/(2^63)Z, and can hence be equipped with a ring structure and a ring tactic *)
Local Open Scope uint63_scope.
(** Detection of constants *)
Ltac isUint63cst t :=
match eval lazy delta [add] in (t + 1)%uint63 with
| add _ _ => constr:(false)
| _ => constr:(true)
end.
Ltac Uint63cst t :=
match eval lazy delta [add] in (t + 1)%uint63 with
| add _ _ => constr:(NotConstant)
| _ => constr:(t)
end.
(** The generic ring structure inferred from the Cyclic structure *)
Module Uint63ring := CyclicRing Uint63Cyclic.
(** Unlike in the generic [CyclicRing], we can use Leibniz here. *)

Lemma Uint63Ring : ring_theory 0 1 add mul sub opp Logic.eq.