#[global]
Instance Op_eq : BinRel (@eq int) :=
  {| TR := @eq Z; TRInj := eq_int_inj |}.#[global]
Instance Op_add : BinOp add :=
  {| TBOp := fun x y => (x + y) mod 9223372036854775808%Z; TBOpInj := add_spec |}%Z.#[global]
Instance Op_sub : BinOp sub :=
  {| TBOp := fun x y => (x - y) mod 9223372036854775808%Z; TBOpInj := sub_spec |}%Z.#[global]
Instance Op_opp : UnOp Uint63.opp :=
  {| TUOp := (fun x => (- x) mod 9223372036854775808)%Z; TUOpInj := (sub_spec 0) |}%Z.#[global]
Instance Op_oppcarry : UnOp oppcarry :=
  {| TUOp := (fun x => 2^63 -  x - 1)%Z; TUOpInj := oppcarry_spec |}%Z.#[global]
Instance Op_succ : UnOp succ :=
  {| TUOp := (fun x => (x + 1) mod 2^63)%Z; TUOpInj := succ_spec |}%Z.#[global]
Instance Op_pred : UnOp Uint63.pred :=
  {| TUOp := (fun x => (x - 1) mod 2^63)%Z; TUOpInj := pred_spec |}%Z.#[global]
Instance Op_mul : BinOp mul :=
  {| TBOp := fun x y => (x * y) mod 9223372036854775808%Z; TBOpInj := mul_spec |}%Z.#[global]
Instance Op_gcd : BinOp gcd:=
  {| TBOp := (fun x y => Zgcd_alt.Zgcdn (2 * 63)%nat y x) ; TBOpInj := to_Z_gcd |}.#[global]
Instance Op_mod : BinOp Uint63.mod :=
  {| TBOp := Z.modulo ; TBOpInj := mod_spec |}.#[global]
Instance Op_subcarry : BinOp subcarry :=
  {| TBOp := (fun x y => (x - y - 1) mod 2^63)%Z ; TBOpInj := subcarry_spec |}.#[global]
Instance Op_addcarry : BinOp addcarry :=
  {| TBOp := (fun x y => (x + y + 1) mod 2^63)%Z ; TBOpInj := addcarry_spec |}.#[global]
Instance Op_lsr : BinOp lsr :=
  {| TBOp := (fun x y => x / 2^ y)%Z ; TBOpInj := lsr_spec |}.#[global]
Instance Op_lsl : BinOp lsl :=
  {| TBOp := (fun x y => (x  * 2^ y) mod 2^ 63)%Z ; TBOpInj := lsl_spec |}.#[global]
Instance Op_lor : BinOp Uint63.lor :=
  {| TBOp := Z.lor ; TBOpInj := lor_spec' |}.#[global]
Instance Op_land : BinOp Uint63.land :=
  {| TBOp := Z.land ; TBOpInj := land_spec' |}.#[global]
Instance Op_lxor : BinOp Uint63.lxor :=
  {| TBOp := Z.lxor ; TBOpInj := lxor_spec' |}.#[global]
Instance Op_div : BinOp div :=
  {| TBOp := Z.div ; TBOpInj := div_spec |}.#[global]
Instance Op_bit : BinOp bit :=
  {| TBOp := Z.testbit ; TBOpInj := bitE |}.#[global]
Instance Op_of_Z : UnOp of_Z :=
  { TUOp := (fun x => x mod 9223372036854775808)%Z; TUOpInj := of_Z_spec }.#[global]
Instance Op_to_Z : UnOp to_Z :=
  { TUOp := fun x => x ; TUOpInj := fun x : int => eq_refl }.#[global]
Instance Op_is_zero : UnOp is_zero :=
  { TUOp := (Z.eqb 0) ; TUOpInj := is_zeroE }.

Lemma is_evenE : forall x, is_even x = Z.even φ (x)%uint63.