(* This file is generated by Why3's Coq driver *)
(* Beware! Only edit allowed sections below    *)
Require Import BuiltIn.
Require Reals.R_sqrt.
Require BuiltIn.
Require HighOrd.
Require int.Int.
Require int.Abs.
Require int.MinMax.
Require int.EuclideanDivision.
Require real.Real.
Require real.FromInt.
Require real.Square.
Require map.Map.

Parameter infix_eqeq: forall {a:Type} {a_WT:WhyType a}, a -> a -> Prop.

Axiom infix_eqeq_spec :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:a) (b:a), (infix_eqeq a1 b) -> (a1 = b).

Axiom infix_eqeq_spec1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:a) (b:a), (a1 = b) -> infix_eqeq a1 b.

Axiom assert_equal : True.

Axiom goal_comm :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:a) (b:a), (a1 = b) -> (b = a1).

Axiom complex : Type.
Parameter complex_WhyType : WhyType complex.
Existing Instance complex_WhyType.

Parameter teq: complex -> complex -> Prop.

Axiom teq_def : forall (x:complex) (y:complex), (teq x y) -> infix_eqeq x y.

Axiom teq_def1 : forall (x:complex) (y:complex), (infix_eqeq x y) -> teq x y.

Axiom teq_spec : forall (x:complex) (y:complex), (teq x y) -> (x = y).

Axiom teq_spec1 : forall (x:complex) (y:complex), (x = y) -> teq x y.

Parameter c_zero: complex.

Parameter c_one: complex.

Parameter prefix_mndt: complex -> complex.

Parameter infix_pldt: complex -> complex -> complex.

Parameter infix_asdt: complex -> complex -> complex.

Parameter inv: complex -> complex.

Axiom Assoc :
  forall (x:complex) (y:complex) (z:complex),
  ((infix_pldt (infix_pldt x y) z) = (infix_pldt x (infix_pldt y z))).

Axiom Unit_def_l : forall (x:complex), ((infix_pldt c_zero x) = x).

Axiom Unit_def_r : forall (x:complex), ((infix_pldt x c_zero) = x).

Axiom Inv_def_l :
  forall (x:complex), ((infix_pldt (prefix_mndt x) x) = c_zero).

Axiom Inv_def_r :
  forall (x:complex), ((infix_pldt x (prefix_mndt x)) = c_zero).

Axiom Comm :
  forall (x:complex) (y:complex), ((infix_pldt x y) = (infix_pldt y x)).

Axiom Assoc1 :
  forall (x:complex) (y:complex) (z:complex),
  ((infix_asdt (infix_asdt x y) z) = (infix_asdt x (infix_asdt y z))).

Axiom Mul_distr_l :
  forall (x:complex) (y:complex) (z:complex),
  ((infix_asdt x (infix_pldt y z)) =
   (infix_pldt (infix_asdt x y) (infix_asdt x z))).

Axiom Mul_distr_r :
  forall (x:complex) (y:complex) (z:complex),
  ((infix_asdt (infix_pldt y z) x) =
   (infix_pldt (infix_asdt y x) (infix_asdt z x))).

Axiom Comm1 :
  forall (x:complex) (y:complex), ((infix_asdt x y) = (infix_asdt y x)).

Axiom Unitary : forall (x:complex), ((infix_asdt c_one x) = x).

Axiom NonTrivialRing : ~ (c_zero = c_one).

Axiom Inverse :
  forall (x:complex), ~ (x = c_zero) -> ((infix_asdt x (inv x)) = c_one).

Parameter infix_mn: complex -> complex -> complex.

Axiom infix_mn_def :
  forall (x:complex) (y:complex),
  ((infix_mn x y) = (infix_pldt x (prefix_mndt y))).

Parameter infix_sl: complex -> complex -> complex.

Axiom infix_sl_def :
  forall (x:complex) (y:complex), ((infix_sl x y) = (infix_asdt x (inv y))).

Axiom add_div :
  forall (x:complex) (y:complex) (z:complex), ~ (z = c_zero) ->
  ((infix_sl (infix_pldt x y) z) =
   (infix_pldt (infix_sl x z) (infix_sl y z))).

Axiom sub_div :
  forall (x:complex) (y:complex) (z:complex), ~ (z = c_zero) ->
  ((infix_sl (infix_mn x y) z) = (infix_mn (infix_sl x z) (infix_sl y z))).

Axiom neg_div :
  forall (x:complex) (y:complex), ~ (y = c_zero) ->
  ((infix_sl (prefix_mndt x) y) = (prefix_mndt (infix_sl x y))).

Axiom assoc_mul_div :
  forall (x:complex) (y:complex) (z:complex), ~ (z = c_zero) ->
  ((infix_sl (infix_asdt x y) z) = (infix_asdt x (infix_sl y z))).

Axiom assoc_div_mul :
  forall (x:complex) (y:complex) (z:complex),
  (~ (y = c_zero) /\ ~ (z = c_zero)) ->
  ((infix_sl (infix_sl x y) z) = (infix_sl x (infix_asdt y z))).

Axiom assoc_div_div :
  forall (x:complex) (y:complex) (z:complex),
  (~ (y = c_zero) /\ ~ (z = c_zero)) ->
  ((infix_sl x (infix_sl y z)) = (infix_sl (infix_asdt x z) y)).

Parameter infix_mndt: complex -> complex -> complex.

Axiom infix_mndt_def :
  forall (x:complex) (y:complex),
  ((infix_mndt x y) = (infix_pldt x (prefix_mndt y))).

Parameter infix_sldt: complex -> complex -> complex.

Axiom infix_sldt_def :
  forall (x:complex) (y:complex), ~ (y = c_zero) ->
  ((infix_sldt x y) = (infix_asdt x (inv y))).

Axiom infix_sldt_spec :
  forall (x:complex) (y:complex), ~ (y = c_zero) ->
  ((infix_sldt x y) = (infix_asdt x (inv y))).

Parameter infix_slas: R -> R -> R.

Axiom infix_slas_def :
  forall (x:R) (y:R), ~ (y = 0%R) -> ((infix_slas x y) = (x / y)%R).

Parameter infix_eqas: R -> R -> Prop.

Axiom infix_eqas_def :
  forall (x:R) (y:R), (infix_eqas x y) -> infix_eqeq x y.

Axiom infix_eqas_def1 :
  forall (x:R) (y:R), (infix_eqeq x y) -> infix_eqas x y.

Axiom infix_eqas_spec : forall (x:R) (y:R), (infix_eqas x y) -> (x = y).

Axiom infix_eqas_spec1 : forall (x:R) (y:R), (x = y) -> infix_eqas x y.

Parameter infix_lsgtas: R -> R -> Prop.

Axiom infix_lsgtas_def :
  forall (x:R) (y:R), (infix_lsgtas x y) -> ~ (infix_eqeq x y).

Axiom infix_lsgtas_def1 :
  forall (x:R) (y:R), ~ (infix_eqeq x y) -> infix_lsgtas x y.

Axiom infix_lsgtas_spec :
  forall (x:R) (y:R), (infix_lsgtas x y) -> ~ (x = y).

Axiom infix_lsgtas_spec1 : forall (x:R) (y:R), ~ (x = y) -> infix_lsgtas x y.

Parameter infix_plas: R -> R -> R.

Axiom infix_plas_def : forall (x:R) (y:R), ((infix_plas x y) = (x + y)%R).

Parameter infix_mnas: R -> R -> R.

Axiom infix_mnas_def :
  forall (x:R) (y:R), ((infix_mnas x y) = (x + (-y)%R)%R).

Parameter infix_asas: R -> R -> R.

Axiom infix_asas_def : forall (x:R) (y:R), ((infix_asas x y) = (x * y)%R).

Parameter infix_lseqas: R -> R -> Prop.

Axiom infix_lseqas_def :
  forall (x:R) (y:R), (infix_lseqas x y) -> (x <= y)%R.

Axiom infix_lseqas_def1 : forall (x:R) (y:R), (x <= y)%R -> infix_lseqas x y.

Parameter prefix_mnas: R -> R.

Axiom prefix_mnas_def : forall (y:R), ((prefix_mnas y) = (-y)%R).

Parameter infix_lsas: R -> R -> Prop.

Axiom infix_lsas_def :
  forall (x:R) (y:R), (infix_lsas x y) -> infix_lseqas x y.

Axiom infix_lsas_def1 :
  forall (x:R) (y:R), (infix_lsas x y) -> infix_lsgtas x y.

Axiom infix_lsas_def2 :
  forall (x:R) (y:R), ((infix_lseqas x y) /\ (infix_lsgtas x y)) ->
  infix_lsas x y.

Parameter infix_gtas: R -> R -> Prop.

Axiom infix_gtas_def :
  forall (x:R) (y:R), (infix_gtas x y) -> infix_lsas y x.

Axiom infix_gtas_def1 :
  forall (x:R) (y:R), (infix_lsas y x) -> infix_gtas x y.

Parameter infix_gteqas: R -> R -> Prop.

Axiom infix_gteqas_def :
  forall (x:R) (y:R), (infix_gteqas x y) -> infix_lseqas y x.

Axiom infix_gteqas_def1 :
  forall (x:R) (y:R), (infix_lseqas y x) -> infix_gteqas x y.

Parameter from_int: Z -> R.

Axiom from_int_spec : forall (x:Z), ((from_int x) = (BuiltIn.IZR x)).

Axiom Zero : ((from_int 0%Z) = 0%R).

Axiom Add :
  forall (x:Z) (y:Z),
  ((from_int (x + y)%Z) = (infix_plas (from_int x) (from_int y))).

Axiom One : ((from_int 1%Z) = 1%R).

Axiom Sub :
  forall (x:Z) (y:Z),
  ((from_int (x - y)%Z) = (infix_mnas (from_int x) (from_int y))).

Axiom mul_pos :
  forall (x:Z) (y:Z), (0%Z <= y)%Z ->
  ((from_int (x * y)%Z) = (infix_asas (from_int x) (from_int y))).

Axiom mul :
  forall (x:Z) (y:Z), (0%Z <= y)%Z ->
  ((from_int (x * y)%Z) = (infix_asas (from_int x) (from_int y))).

Axiom mul_rev :
  forall (x:Z) (y:Z), (0%Z <= y)%Z ->
  ((infix_asas (from_int x) (from_int y)) = (from_int (x * y)%Z)).

Axiom neg : forall (x:Z), ((from_int (-x)%Z) = (prefix_mnas (from_int x))).

Axiom injective :
  forall (x:Z) (y:Z), ((from_int x) = (from_int y)) -> (x = y).

Axiom Monotonic :
  forall (x:Z) (y:Z), (x <= y)%Z -> infix_lseqas (from_int x) (from_int y).

Axiom positive_inv :
  forall (x:R), (infix_lsas 0%R x) -> infix_lsas 0%R (infix_slas 1%R x).

Axiom r_zeroLessOne : infix_lseqas 0%R 1%R.

Axiom r_compatOrderAdd :
  forall (x:R) (y:R) (z:R), (infix_lseqas x y) ->
  infix_lseqas (infix_plas x z) (infix_plas y z).

Axiom r_compatOrderMult :
  forall (x:R) (y:R) (z:R), (infix_lseqas x y) -> (infix_lseqas 0%R z) ->
  infix_lseqas (infix_asas x z) (infix_asas y z).

Axiom inv_order :
  forall (a:R) (b:R), (infix_lsas 0%R a) -> (infix_lsas 0%R b) ->
  (infix_lseqas a b) -> infix_lseqas (1%R / b)%R (1%R / a)%R.

Axiom inv_strict_order :
  forall (a:R) (b:R), (infix_lsas 0%R a) -> (infix_lsas 0%R b) ->
  (infix_lsas a b) -> infix_lsas (1%R / b)%R (1%R / a)%R.

Axiom invol_neg : forall (a:complex), ((prefix_mndt (prefix_mndt a)) = a).

Axiom injective_neg :
  forall (a:complex) (b:complex), ((prefix_mndt a) = (prefix_mndt b)) ->
  (a = b).

Axiom find_opposite :
  forall (a:complex) (b:complex), ((infix_mndt a b) = c_zero) -> (a = b).

Axiom add_opposite :
  forall (a:complex), ((infix_pldt a (prefix_mndt a)) = c_zero).

Axiom opposite : forall (a:complex), ((infix_mndt a a) = c_zero).

Axiom mult_num :
  forall (a:complex) (b:complex) (c:complex), ~ (c = c_zero) ->
  ((infix_sldt (infix_asdt a b) c) = (infix_asdt a (infix_sldt b c))).

Axiom div_as_mult_inv :
  forall (a:complex) (b:complex), ~ (b = c_zero) ->
  ((infix_sldt a b) = (infix_asdt a (infix_sldt c_one b))).

Axiom div_rev :
  forall (a:complex) (b:complex), ~ (b = c_zero) ->
  ((infix_asdt a (infix_sldt c_one b)) = (infix_sldt a b)).

Axiom mult_div_num :
  forall (a:complex) (b:complex) (c:complex), ~ (c = c_zero) ->
  ((infix_asdt (infix_sldt a c) b) = (infix_sldt (infix_asdt a b) c)).

Axiom mult_denom :
  forall (a:complex) (b:complex) (c:complex), ~ (c = c_zero) ->
  ~ (b = c_zero) ->
  ((infix_sldt a (infix_asdt b c)) =
   (infix_asdt (infix_sldt a b) (infix_sldt c_one c))).

Axiom mult_simpl :
  forall (a:complex) (b:complex) (c:complex), ~ (c = c_zero) ->
  ~ (b = c_zero) ->
  ((infix_sldt (infix_asdt a b) (infix_asdt c b)) = (infix_sldt a c)).

Axiom dic_simpl :
  forall (a:complex) (b:complex) (c:complex), ~ (c = c_zero) ->
  ~ (b = c_zero) ->
  ((infix_asdt (infix_sldt a (infix_asdt c b)) b) = (infix_sldt a c)).

Axiom simpl_with_c_one :
  forall (a:complex) (b:complex), ~ (a = c_zero) -> ~ (b = c_zero) ->
  ((infix_asdt (infix_sldt a b) (infix_sldt c_one a)) = (infix_sldt c_one b)).

Axiom add_op :
  forall (a1:complex) (a2:complex), (a1 = (prefix_mndt a2)) ->
  ((infix_pldt a1 a2) = c_zero).

Axiom mult_eq_t :
  forall (a1:complex) (a2:complex) (b1:complex) (b2:complex), (a1 = a2) ->
  (b1 = b2) -> ((infix_asdt a1 b1) = (infix_asdt a2 b2)).

Axiom mult_eq_t_rev :
  forall (a1:complex) (a2:complex) (b1:complex) (b2:complex), (a1 = a2) ->
  (b1 = b2) -> ((infix_asdt a1 b1) = (infix_asdt b2 a2)).

Axiom mult_comm :
  forall (a:complex) (b:complex), ((infix_asdt a b) = (infix_asdt b a)).

Axiom mult_assoc :
  forall (a:complex) (b:complex) (c:complex),
  ((infix_asdt (infix_asdt a b) c) = (infix_asdt a (infix_asdt b c))).

Axiom mult_abc_to_acb :
  forall (a:complex) (b:complex) (c:complex),
  ((infix_asdt (infix_asdt a b) c) = (infix_asdt (infix_asdt a c) b)).

Axiom zero_mult_t :
  forall (a1:complex) (a2:complex), (a1 = c_zero) ->
  ((infix_asdt a1 a2) = c_zero).

Axiom mult_zero_t :
  forall (a1:complex) (a2:complex), (a1 = c_zero) ->
  ((infix_asdt a2 a1) = c_zero).

Axiom mult_one_t :
  forall (a1:complex) (a2:complex), (a2 = c_one) -> ((infix_asdt a1 a2) = a1).

Axiom add_eq_t :
  forall (a1:complex) (a2:complex) (b1:complex) (b2:complex), (a1 = a2) ->
  (b1 = b2) -> ((infix_pldt a1 b1) = (infix_pldt a2 b2)).

Axiom add_eq_t_rev :
  forall (a1:complex) (a2:complex) (b1:complex) (b2:complex), (a1 = a2) ->
  (b1 = b2) -> ((infix_pldt a1 b1) = (infix_pldt b2 a2)).

Axiom substr_eq_t :
  forall (a1:complex) (a2:complex) (b1:complex) (b2:complex), (a1 = a2) ->
  (b1 = b2) -> ((infix_mndt a1 b1) = (infix_mndt a2 b2)).

Parameter im: complex.

Axiom im_Def : ((infix_asdt im im) = (prefix_mndt c_one)).

Parameter ttwo: complex.

Axiom ttwo_def : (ttwo = (infix_pldt c_one c_one)).

Parameter r_to_c: R -> complex.

Axiom r_to_c_zero : ((r_to_c 0%R) = c_zero).

Axiom r_to_c_one : ((r_to_c 1%R) = c_one).

Axiom r_to_c_add :
  forall (i:R) (j:R),
  ((infix_pldt (r_to_c i) (r_to_c j)) = (r_to_c (infix_plas i j))).

Axiom r_to_c_add_rev :
  forall (i:R) (j:R),
  ((r_to_c (infix_plas i j)) = (infix_pldt (r_to_c i) (r_to_c j))).

Axiom r_to_c_opp :
  forall (i:R), ((r_to_c (prefix_mnas i)) = (prefix_mndt (r_to_c i))).

Axiom r_to_c_div :
  forall (i:R) (j:R), ~ (j = 0%R) ->
  ((r_to_c (infix_slas i j)) = (infix_sldt (r_to_c i) (r_to_c j))).

Axiom r_to_c_mult :
  forall (i:R) (j:R),
  ((infix_asdt (r_to_c i) (r_to_c j)) = (r_to_c (infix_asas i j))).

Axiom r_to_c_mult_rev :
  forall (i:R) (j:R),
  ((r_to_c (infix_asas i j)) = (infix_asdt (r_to_c i) (r_to_c j))).

Axiom r_to_c_sub :
  forall (i:R) (j:R),
  ((infix_mndt (r_to_c i) (r_to_c j)) = (r_to_c (infix_mnas i j))).

Parameter real_part: complex -> R.

Parameter im_part: complex -> R.

Axiom Real_part_add :
  forall (i:complex) (j:complex),
  ((real_part (infix_pldt i j)) = (infix_plas (real_part i) (real_part j))).

Axiom Im_part_add :
  forall (i:complex) (j:complex),
  ((im_part (infix_pldt i j)) = (infix_plas (im_part i) (im_part j))).

Axiom Real_part_opposite :
  forall (i:complex),
  ((real_part (prefix_mndt i)) = (prefix_mnas (real_part i))).

Axiom Im_part_opposite :
  forall (i:complex), ((im_part (prefix_mndt i)) = (prefix_mnas (im_part i))).

Axiom Complex_decomp :
  forall (i:complex),
  (i =
   (infix_pldt (r_to_c (real_part i)) (infix_asdt im (r_to_c (im_part i))))).

Axiom Unic_decomp :
  forall (i:complex), forall (x:R) (y:R),
  (i = (infix_pldt (r_to_c x) (infix_asdt im (r_to_c y)))) ->
  (x = (real_part i)).

Axiom Unic_decomp1 :
  forall (i:complex), forall (x:R) (y:R),
  (i = (infix_pldt (r_to_c x) (infix_asdt im (r_to_c y)))) ->
  (y = (im_part i)).

Parameter real_: complex -> Prop.

Axiom real__def :
  forall (x:complex), (real_ x) -> infix_eqeq (im_part x) 0%R.

Axiom real__def1 :
  forall (x:complex), (infix_eqeq (im_part x) 0%R) -> real_ x.

Parameter pure_im_: complex -> Prop.

Axiom pure_im__def :
  forall (x:complex), (pure_im_ x) -> infix_eqeq (real_part x) 0%R.

Axiom pure_im__def1 :
  forall (x:complex), (infix_eqeq (real_part x) 0%R) -> pure_im_ x.

Axiom unic_decomp :
  forall (i:complex) (x:R) (y:R),
  (i = (infix_pldt (r_to_c x) (infix_asdt im (r_to_c y)))) ->
  (x = (real_part i)).

Axiom unic_decomp1 :
  forall (i:complex) (x:R) (y:R),
  (i = (infix_pldt (r_to_c x) (infix_asdt im (r_to_c y)))) ->
  (y = (im_part i)).

Axiom r_to_c_real :
  forall (x:complex), (real_ x) -> (x = (r_to_c (real_part x))).

Axiom real_r_to_c : forall (x:R), real_ (r_to_c x).

Axiom r_to_c_pure_im :
  forall (x:complex), (pure_im_ x) ->
  (x = (infix_asdt im (r_to_c (im_part x)))).

Axiom decomp_mult :
  forall (a:complex) (b:complex),
  ((infix_asdt a b) =
   (infix_pldt
    (infix_mndt (infix_asdt (r_to_c (real_part a)) (r_to_c (real_part b)))
     (infix_asdt (r_to_c (im_part a)) (r_to_c (im_part b))))
    (infix_asdt im
     (infix_pldt (infix_asdt (r_to_c (real_part a)) (r_to_c (im_part b)))
      (infix_asdt (r_to_c (real_part b)) (r_to_c (im_part a))))))).

Parameter t_real_part: complex -> complex.

Axiom t_real_part_def :
  forall (x:complex), ((t_real_part x) = (r_to_c (real_part x))).

Axiom t_real_part_spec : forall (x:complex), real_ (t_real_part x).

Axiom t_real_part_inv :
  forall (x:complex),
  ((t_real_part (prefix_mndt x)) = (prefix_mndt (t_real_part x))).

Parameter t_im_part: complex -> complex.

Axiom t_im_part_def :
  forall (x:complex), ((t_im_part x) = (r_to_c (im_part x))).

Axiom t_im_part_spec : forall (x:complex), real_ (t_im_part x).

Axiom t_im_part_inv :
  forall (x:complex),
  ((t_im_part (prefix_mndt x)) = (prefix_mndt (t_im_part x))).

Axiom decomp_mult_as_reals :
  forall (a:complex) (b:complex),
  ((infix_asdt a b) =
   (infix_pldt
    (infix_mndt (infix_asdt (t_real_part a) (t_real_part b))
     (infix_asdt (t_im_part a) (t_im_part b)))
    (infix_asdt im
     (infix_pldt (infix_asdt (t_real_part a) (t_im_part b))
      (infix_asdt (t_real_part b) (t_im_part a)))))).

Axiom decomp_mult_real_part :
  forall (a:complex) (b:complex),
  ((real_part (infix_asdt a b)) =
   (infix_mnas (infix_asas (real_part a) (real_part b))
    (infix_asas (im_part a) (im_part b)))).

Axiom decomp_mult_im_part :
  forall (a:complex) (b:complex),
  ((im_part (infix_asdt a b)) =
   (infix_plas (infix_asas (real_part a) (im_part b))
    (infix_asas (real_part b) (im_part a)))).

Axiom t_mult_real :
  forall (a:complex) (b:complex),
  ((t_real_part (infix_asdt a b)) =
   (infix_mndt (infix_asdt (t_real_part a) (t_real_part b))
    (infix_asdt (t_im_part a) (t_im_part b)))).

Axiom t_mult_im :
  forall (a:complex) (b:complex),
  ((t_im_part (infix_asdt a b)) =
   (infix_pldt (infix_asdt (t_real_part a) (t_im_part b))
    (infix_asdt (t_im_part a) (t_real_part b)))).

Axiom mult_real_real :
  forall (a:complex) (b:complex), (real_ a) -> (real_ b) ->
  ((infix_asdt a b) =
   (infix_asdt (r_to_c (real_part a)) (r_to_c (real_part b)))).

Axiom mult_real_real1 :
  forall (a:complex) (b:complex), (real_ a) -> (real_ b) ->
  ((infix_asdt (r_to_c (real_part a)) (r_to_c (real_part b))) =
   (r_to_c (infix_asas (real_part a) (real_part b)))).

Axiom mult_real_real2 :
  forall (a:complex) (b:complex), (real_ a) -> (real_ b) ->
  ((real_part (infix_asdt a b)) = (infix_asas (real_part a) (real_part b))).

Axiom mult_real_real3 :
  forall (a:complex) (b:complex), (real_ a) -> (real_ b) ->
  ((im_part (infix_asdt a b)) = 0%R).

Axiom complex_squared :
  forall (a:complex),
  ((infix_asdt a a) =
   (infix_pldt
    (infix_mndt (infix_asdt (t_real_part a) (t_real_part a))
     (infix_asdt (t_im_part a) (t_im_part a)))
    (infix_asdt (infix_asdt (infix_asdt im ttwo) (t_real_part a))
     (t_im_part a)))).

Axiom complex_squared1 :
  forall (a:complex),
  ((t_real_part (infix_asdt a a)) =
   (infix_mndt (infix_asdt (t_real_part a) (t_real_part a))
    (infix_asdt (t_im_part a) (t_im_part a)))).

Axiom complex_squared2 :
  forall (a:complex),
  ((t_im_part (infix_asdt a a)) =
   (infix_asdt (infix_asdt ttwo (t_real_part a)) (t_im_part a))).

Axiom complex_real_squared :
  forall (a:complex), (real_ a) ->
  ((infix_asdt a a) = (infix_asdt (t_real_part a) (t_real_part a))).

Axiom decomp_div :
  forall (a:complex) (b:complex), ~ (b = c_zero) ->
  ((infix_sldt a b) =
   (infix_pldt (infix_sldt (t_real_part (infix_asdt a b)) (infix_asdt b b))
    (infix_asdt im
     (infix_sldt (t_im_part (infix_asdt a b)) (infix_asdt b b))))).

Axiom decomp_div_real :
  forall (a:complex) (b:complex), (real_ b) -> ~ (b = c_zero) ->
  ((infix_sldt a b) =
   (infix_pldt (infix_sldt (infix_asdt (t_real_part a) b) (infix_asdt b b))
    (infix_asdt im
     (infix_sldt (infix_asdt (t_im_part a) b) (infix_asdt b b))))).

Axiom complex_prod_fact :
  forall (a:complex) (b:complex),
  ((infix_asdt a b) =
   (infix_pldt (infix_asdt (r_to_c (real_part a)) b)
    (infix_asdt (infix_asdt im (r_to_c (im_part a))) b))).

Axiom non_zero_prod_pre :
  forall (a:complex) (b:complex), ~ (a = c_zero) ->
  ((infix_asdt a b) = c_zero) -> ((im_part b) = (real_part b)).

Axiom non_zero_prod_pre1 :
  forall (a:complex) (b:complex), ~ (a = c_zero) ->
  ((infix_asdt a b) = c_zero) -> ((real_part b) = 0%R).

Axiom non_zero_prod :
  forall (a:complex) (b:complex), ~ (a = c_zero) -> ~ (b = c_zero) ->
  ~ ((infix_asdt a b) = c_zero).

Axiom minus_c_one :
  forall (a:complex), ((prefix_mndt a) = (infix_asdt (prefix_mndt c_one) a)).

Axiom mult_neg_l :
  forall (a:complex) (b:complex),
  ((infix_asdt (prefix_mndt a) b) = (prefix_mndt (infix_asdt a b))).

Axiom mult_neg_r :
  forall (a:complex) (b:complex),
  ((infix_asdt a (prefix_mndt b)) = (prefix_mndt (infix_asdt a b))).

Axiom neg_neg_out : forall (a:complex), ((prefix_mndt (prefix_mndt a)) = a).

Axiom div_neg_l :
  forall (a:complex) (b:complex), ~ (b = c_zero) ->
  ((infix_sldt (prefix_mndt a) b) = (prefix_mndt (infix_sldt a b))).

Axiom eq_to_real :
  forall (a:complex) (b:complex), (real_ a) -> (real_ b) -> (a = b) ->
  ((real_part a) = (real_part b)).

Axiom eq_by_real :
  forall (a:complex) (b:complex), (real_ a) -> (real_ b) ->
  ((real_part a) = (real_part b)) -> (a = b).

Axiom div_neg_r :
  forall (a:complex) (b:complex), ~ (b = c_zero) ->
  ((infix_sldt a (prefix_mndt b)) = (prefix_mndt (infix_sldt a b))).

Axiom invadd :
  forall (i:complex), ((prefix_mndt i) = (infix_asdt (prefix_mndt c_one) i)).

Axiom noc_zeroAdd :
  forall (x:complex) (y:complex), ~ (x = c_zero) -> ~ ((infix_pldt x y) = y).

Axiom Absorbing_zero :
  forall (a:complex) (b:complex), ((infix_asdt a b) = c_zero) ->
  ~ (a = c_zero) -> (b = c_zero).

Axiom Absorbing_zero1 :
  forall (a:complex) (b:complex), (a = c_zero) -> ((infix_asdt a b) = c_zero).

Axiom Absorbing_zero2 :
  forall (a:complex) (b:complex), (b = c_zero) -> ((infix_asdt a b) = c_zero).

Axiom real_part_add :
  forall (i:complex) (j:complex),
  ((real_part (infix_pldt i j)) = (infix_plas (real_part i) (real_part j))).

Axiom mult_im_rev :
  forall (a:complex), ((infix_asdt a im) = (infix_asdt im a)).

Axiom im_im_elim :
  forall (a:complex), ((infix_asdt im (infix_asdt im a)) = (prefix_mndt a)).

Axiom im_im_fact :
  forall (a:complex) (b:complex),
  ((infix_asdt (infix_asdt im a) (infix_asdt im b)) =
   (prefix_mndt (infix_asdt a b))).

Axiom minus_minus_fact :
  forall (a:complex) (b:complex),
  ((infix_asdt (prefix_mndt a) (prefix_mndt b)) = (infix_asdt a b)).

Axiom minus_minus_add :
  forall (a:complex) (b:complex),
  ((infix_pldt (prefix_mndt a) (prefix_mndt b)) =
   (prefix_mndt (infix_pldt a b))).

Axiom minus_minus_add_rev :
  forall (a:complex) (b:complex),
  ((prefix_mndt (infix_pldt a b)) =
   (infix_pldt (prefix_mndt a) (prefix_mndt b))).

Axiom minus_out_left :
  forall (a:complex) (b:complex),
  ((infix_asdt (prefix_mndt a) b) = (prefix_mndt (infix_asdt a b))).

Axiom minus_out_right :
  forall (a:complex) (b:complex),
  ((infix_asdt a (prefix_mndt b)) = (prefix_mndt (infix_asdt a b))).

Axiom minus_in_left :
  forall (a:complex) (b:complex),
  ((prefix_mndt (infix_asdt a b)) = (infix_asdt (prefix_mndt a) b)).

Axiom minus_in_right :
  forall (a:complex) (b:complex),
  ((prefix_mndt (infix_asdt a b)) = (infix_asdt a (prefix_mndt b))).

Axiom minus_add_out_left :
  forall (a:complex) (b:complex),
  ((infix_pldt (prefix_mndt a) b) =
   (prefix_mndt (infix_pldt a (prefix_mndt b)))).

Axiom minus_as_add_opp :
  forall (a:complex) (b:complex),
  ((infix_mndt a b) = (infix_pldt a (prefix_mndt b))).

Axiom minus_add_out_right :
  forall (a:complex) (b:complex),
  ((infix_pldt a (prefix_mndt b)) =
   (prefix_mndt (infix_pldt (prefix_mndt a) b))).

Axiom minus_add_in :
  forall (a:complex) (b:complex),
  ((prefix_mndt (infix_pldt a b)) =
   (infix_pldt (prefix_mndt a) (prefix_mndt b))).

Axiom minus_add_out :
  forall (a:complex) (b:complex),
  ((infix_pldt (prefix_mndt a) (prefix_mndt b)) =
   (prefix_mndt (infix_pldt a b))).

Axiom minus_eq :
  forall (a:complex) (b:complex), (a = b) ->
  ((prefix_mndt a) = (prefix_mndt b)).

Axiom im_out_right :
  forall (a:complex) (b:complex),
  ((infix_asdt (infix_asdt im a) b) = (infix_asdt im (infix_asdt a b))).

Axiom im_out_left :
  forall (a:complex) (b:complex),
  ((infix_asdt a (infix_asdt im b)) = (infix_asdt im (infix_asdt a b))).

Axiom im_part_add :
  forall (i:complex) (j:complex),
  ((im_part (infix_pldt i j)) = (infix_plas (im_part i) (im_part j))).

Axiom injective_real_part :
  forall (i:complex) (j:complex), ~ ((real_part i) = (real_part j)) ->
  ~ (i = j).

Axiom injective_im_part :
  forall (i:complex) (j:complex), ~ ((im_part i) = (im_part j)) -> ~ (i = j).

Axiom minus_distr_four :
  forall (a:complex) (b:complex) (c:complex) (d:complex),
  ((infix_pldt (infix_asdt a b)
    (infix_asdt (infix_asdt (prefix_mndt b) c) d))
   = (infix_asdt (infix_mndt a (infix_asdt c d)) b)).

Axiom complex_decomp :
  forall (i:complex),
  (i =
   (infix_pldt (r_to_c (real_part i)) (infix_asdt im (r_to_c (im_part i))))).

Axiom simpl_frac :
  forall (x:complex) (y:complex), ~ (y = c_zero) ->
  ((infix_sldt (infix_asdt x y) y) = x).

Axiom simpl_frac_ :
  forall (x:complex) (y:complex) (z:complex), ~ (y = c_zero) ->
  ~ (z = c_zero) ->
  ((infix_sldt (infix_asdt x y) (infix_asdt z y)) = (infix_sldt x z)).

Axiom fact_frac :
  forall (x:complex) (y:complex) (z:complex), ~ (z = c_zero) ->
  ((infix_sldt (infix_asdt x y) z) = (infix_asdt x (infix_sldt y z))).

Axiom fact_frac_rev :
  forall (x:complex) (y:complex) (z:complex), ~ (z = c_zero) ->
  ((infix_asdt x (infix_sldt y z)) = (infix_sldt (infix_asdt x y) z)).

Axiom mult_sym :
  forall (x:complex) (y:complex), ((infix_asdt x y) = (infix_asdt y x)).

Axiom inv_mult :
  forall (x:complex) (y:complex), ~ (x = c_zero) -> ~ (y = c_zero) ->
  ((infix_asdt (infix_sldt c_one x) (infix_sldt c_one y)) =
   (infix_sldt c_one (infix_asdt x y))).

Axiom div_div :
  forall (x:complex) (y:complex) (z:complex), ~ (y = c_zero) ->
  ~ (z = c_zero) ->
  ((infix_sldt (infix_sldt x y) z) = (infix_sldt x (infix_asdt y z))).

Axiom div_div_rev :
  forall (x:complex) (y:complex) (z:complex), ~ (y = c_zero) ->
  ~ (z = c_zero) ->
  ((infix_sldt x (infix_asdt y z)) = (infix_sldt (infix_sldt x y) z)).

Axiom involutive_inv :
  forall (a:complex), ~ (a = c_zero) ->
  ((infix_sldt c_one (infix_sldt c_one a)) = a).

Axiom twice : forall (i:complex), ((infix_asdt ttwo i) = (infix_pldt i i)).

Axiom twice_half : ((infix_asdt ttwo (infix_sldt c_one ttwo)) = c_one).

Axiom half_plus_half :
  forall (i:complex),
  ((infix_pldt (infix_sldt i ttwo) (infix_sldt i ttwo)) = i).

Axiom decomp_inv_real :
  forall (a:complex), (real_ a) -> ~ (a = c_zero) ->
  ((infix_sldt c_one a) = (infix_sldt c_one (t_real_part a))).

Axiom decomp_inv_real1 :
  forall (a:complex), (real_ a) -> ~ (a = c_zero) ->
  real_ (infix_sldt c_one a).

Axiom decomp_inv_real2 :
  forall (a:complex), (real_ a) -> ~ (a = c_zero) ->
  ((t_real_part (infix_sldt c_one a)) = (infix_sldt c_one (t_real_part a))).

Axiom decomp_inv_real3 :
  forall (a:complex), (real_ a) -> ~ (a = c_zero) ->
  ((real_part (infix_sldt c_one a)) = (infix_slas 1%R (real_part a))).

Axiom mult_div_comm :
  forall (x:complex) (y:complex) (z:complex) (t:complex), ~ (z = c_zero) ->
  ~ (t = c_zero) ->
  ((infix_sldt (infix_asdt x y) (infix_asdt z t)) =
   (infix_asdt (infix_sldt x z) (infix_sldt y t))).

Axiom mult_div_comm_rev :
  forall (x:complex) (y:complex) (z:complex) (t:complex), ~ (z = c_zero) ->
  ~ (t = c_zero) ->
  ((infix_asdt (infix_sldt x z) (infix_sldt y t)) =
   (infix_sldt (infix_asdt x y) (infix_asdt z t))).

Parameter infix_lseqdt: complex -> complex -> Prop.

Axiom infix_lseqdt_def :
  forall (x:complex) (y:complex), (infix_lseqdt x y) ->
  (real_ x) \/ (infix_eqeq x y).

Axiom infix_lseqdt_def1 :
  forall (x:complex) (y:complex), (infix_lseqdt x y) ->
  (real_ y) \/ (infix_eqeq x y).

Axiom infix_lseqdt_def2 :
  forall (x:complex) (y:complex), (infix_lseqdt x y) ->
  (infix_lseqas (real_part x) (real_part y)) \/ (infix_eqeq x y).

Axiom infix_lseqdt_def3 :
  forall (x:complex) (y:complex),
  ((real_ x) /\ ((real_ y) /\ (infix_lseqas (real_part x) (real_part y)))) ->
  infix_lseqdt x y.

Axiom infix_lseqdt_def4 :
  forall (x:complex) (y:complex), (infix_eqeq x y) -> infix_lseqdt x y.

Parameter infix_lsdt: complex -> complex -> Prop.

Axiom infix_lsdt_def :
  forall (x:complex) (y:complex), (infix_lsdt x y) -> infix_lseqdt x y.

Axiom infix_lsdt_def1 :
  forall (x:complex) (y:complex), (infix_lsdt x y) -> ~ (infix_eqeq x y).

Axiom infix_lsdt_def2 :
  forall (x:complex) (y:complex),
  ((infix_lseqdt x y) /\ ~ (infix_eqeq x y)) -> infix_lsdt x y.

Parameter infix_gteqdt: complex -> complex -> Prop.

Axiom infix_gteqdt_def :
  forall (x:complex) (y:complex), (infix_gteqdt x y) -> infix_lseqdt y x.

Axiom infix_gteqdt_def1 :
  forall (x:complex) (y:complex), (infix_lseqdt y x) -> infix_gteqdt x y.

Parameter infix_gtdt: complex -> complex -> Prop.

Axiom infix_gtdt_def :
  forall (x:complex) (y:complex), (infix_gtdt x y) -> infix_gteqdt x y.

Axiom infix_gtdt_def1 :
  forall (x:complex) (y:complex), (infix_gtdt x y) -> ~ (infix_eqeq x y).

Axiom infix_gtdt_def2 :
  forall (x:complex) (y:complex),
  ((infix_gteqdt x y) /\ ~ (infix_eqeq x y)) -> infix_gtdt x y.

Axiom leq_left_real :
  forall (a:complex) (b:complex), (infix_lseqdt a b) -> (real_ a) -> real_ b.

Axiom leq_right_real :
  forall (a:complex) (b:complex), (infix_lseqdt a b) -> (real_ b) -> real_ a.

Axiom inf_left_real :
  forall (a:complex) (b:complex), (infix_lsdt a b) -> real_ a.

Axiom inf_right_real :
  forall (a:complex) (b:complex), (infix_lsdt a b) -> real_ b.

Axiom inf_from_real :
  forall (a:complex) (b:complex), (real_ a) -> (real_ b) ->
  (infix_lsas (real_part a) (real_part b)) -> infix_lsdt a b.

Axiom inf_to_real :
  forall (a:complex) (b:complex), (infix_lsdt a b) ->
  infix_lsas (real_part a) (real_part b).

Axiom leq_left_not_real_a :
  forall (a:complex) (b:complex), (infix_lseqdt a b) -> ~ (real_ a) ->
  (a = b).

Axiom leq_left_not_real_b :
  forall (a:complex) (b:complex), (infix_lseqdt a b) -> ~ (real_ b) ->
  (a = b).

Axiom Refl : forall (x:complex), infix_lseqdt x x.

Axiom Trans :
  forall (x:complex) (y:complex) (z:complex), (infix_lseqdt x y) ->
  (infix_lseqdt y z) -> infix_lseqdt x z.

Axiom Antisymm :
  forall (x:complex) (y:complex), (infix_lseqdt x y) -> (infix_lseqdt y x) ->
  (x = y).

Axiom Refl1 : forall (x:complex), infix_gteqdt x x.

Axiom Trans1 :
  forall (x:complex) (y:complex) (z:complex), (infix_gteqdt x y) ->
  (infix_gteqdt y z) -> infix_gteqdt x z.

Axiom Antisymm1 :
  forall (x:complex) (y:complex), (infix_gteqdt x y) -> (infix_gteqdt y x) ->
  (x = y).

Axiom Trans2 :
  forall (x:complex) (y:complex) (z:complex), (infix_lsdt x y) ->
  (infix_lsdt y z) -> infix_lsdt x z.

Axiom Asymm :
  forall (x:complex) (y:complex), (infix_lsdt x y) -> ~ (infix_lsdt y x).

Axiom Trans3 :
  forall (x:complex) (y:complex) (z:complex), (infix_gtdt x y) ->
  (infix_gtdt y z) -> infix_gtdt x z.

Axiom Asymm1 :
  forall (x:complex) (y:complex), (infix_gtdt x y) -> ~ (infix_gtdt y x).

Axiom r_to_c_inf :
  forall (i:R) (j:R), (infix_lseqdt (r_to_c i) (r_to_c j)) ->
  infix_lseqas i j.

Axiom r_to_c_inf1 :
  forall (i:R) (j:R), (infix_lseqas i j) ->
  infix_lseqdt (r_to_c i) (r_to_c j).

Axiom reali_is_its_real_part :
  forall (a:complex), (real_ a) -> (a = (r_to_c (real_part a))).

Axiom inf_from_r :
  forall (a:complex) (b:complex), (real_ a) -> (real_ b) ->
  (infix_lseqas (real_part a) (real_part b)) -> infix_lseqdt a b.

Axiom strict_inf_from_r :
  forall (a:complex) (b:complex), (real_ a) -> (real_ b) ->
  (infix_lsas (real_part a) (real_part b)) -> infix_lsdt a b.

Axiom positive_inv_t :
  forall (x:complex), (infix_lsdt c_zero x) ->
  infix_lsdt c_zero (infix_sldt c_one x).

Parameter pi: complex.

Axiom pi_def : infix_lsdt (r_to_c 3%R) pi.

Axiom real_pi : real_ pi.

Axiom pi_sup_one : infix_lsdt c_one pi.

Axiom pi_sup_zero : infix_lsdt c_zero pi.

Axiom compat_order_mult :
  forall (x:complex) (y:complex) (z:complex), (infix_lseqdt x y) ->
  (real_ x) -> (real_ y) -> (real_ z) -> (infix_lseqdt c_zero z) ->
  infix_lseqdt (infix_asdt x z) (infix_asdt y z).

Axiom compat_order_add :
  forall (x:complex) (y:complex) (z:complex), (infix_lseqdt x y) ->
  (real_ x) -> (real_ y) -> (real_ z) ->
  infix_lseqdt (infix_pldt x z) (infix_pldt y z).

Axiom compat_order_substr :
  forall (x:complex) (y:complex) (z:complex), (infix_lseqdt x y) ->
  (real_ x) -> (real_ y) -> (real_ z) ->
  infix_lseqdt (infix_mndt x z) (infix_mndt y z).

Axiom compat_inf_mult :
  forall (x:complex) (y:complex) (z:complex), (infix_lsdt x y) ->
  (real_ x) -> (real_ y) -> (real_ z) -> (infix_lsdt c_zero z) ->
  infix_lsdt (infix_asdt x z) (infix_asdt y z).

Axiom transitive_infeq :
  forall (a:complex) (b:complex) (c:complex), (infix_lseqdt a b) ->
  (infix_lseqdt b c) -> infix_lseqdt a c.

Axiom transitive_infeq_inf :
  forall (a:complex) (b:complex) (c:complex), (infix_lseqdt a b) ->
  (infix_lsdt b c) -> infix_lsdt a c.

Axiom transitive_inf_infeq :
  forall (a:complex) (b:complex) (c:complex), (infix_lsdt a b) ->
  (infix_lseqdt b c) -> infix_lsdt a c.

Axiom transitive_inf :
  forall (a:complex) (b:complex) (c:complex), (infix_lsdt a b) ->
  (infix_lsdt b c) -> infix_lsdt a c.

Axiom pi_sup_ttwo : infix_lsdt ttwo pi.

Axiom transitive_leq_inv_r :
  forall (a:complex) (b:complex) (c:complex), (real_ a) -> (real_ b) ->
  (real_ c) -> (infix_lseqdt a b) -> (infix_lseqdt b (infix_sldt c_one c)) ->
  (infix_lseqdt c_one c) -> infix_lseqdt a b.

Axiom transitive_leq_inv_r1 :
  forall (a:complex) (b:complex) (c:complex), (real_ a) -> (real_ b) ->
  (real_ c) -> (infix_lseqdt a b) -> (infix_lseqdt b (infix_sldt c_one c)) ->
  (infix_lseqdt c_one c) -> infix_lseqdt b c_one.

Axiom compat_inf_mult_left :
  forall (x:complex) (y:complex) (z:complex), (infix_lsdt x y) ->
  (real_ x) -> (real_ y) -> (real_ z) -> (infix_lsdt c_zero z) ->
  infix_lsdt (infix_asdt z x) (infix_asdt z y).

Axiom compat_inf_mult_both :
  forall (x:complex) (y:complex) (z:complex) (t:complex), (infix_lsdt x y) ->
  (real_ x) -> (real_ y) -> (real_ z) ->
  ((infix_lsdt c_zero z) /\ (infix_lsdt z t)) -> (infix_lsdt c_zero y) ->
  infix_lsdt (infix_asdt z x) (infix_asdt t y).

Axiom compat_inf_add :
  forall (x:complex) (y:complex) (z:complex), (infix_lsdt x y) ->
  (real_ x) -> (real_ y) -> (real_ z) ->
  infix_lsdt (infix_pldt x z) (infix_pldt y z).

Axiom compat_inf_add_left :
  forall (x:complex) (y:complex) (z:complex), (infix_lsdt x y) ->
  (real_ x) -> (real_ y) -> (real_ z) ->
  infix_lsdt (infix_pldt z x) (infix_pldt z y).

Axiom compat_inf_add_both :
  forall (x:complex) (y:complex) (z:complex) (t:complex), (infix_lsdt x y) ->
  (infix_lsdt z t) -> infix_lsdt (infix_pldt x z) (infix_pldt y t).

Axiom compat_inf_substr :
  forall (x:complex) (y:complex) (z:complex), (infix_lsdt x y) ->
  (real_ x) -> (real_ y) -> (real_ z) ->
  infix_lsdt (infix_mndt x z) (infix_mndt y z).

Axiom real_inv :
  forall (x:complex), (real_ x) -> ~ (x = c_zero) ->
  real_ (infix_sldt c_one x).

Axiom compat_order_mult_rev :
  forall (x:complex) (y:complex) (z:complex), (real_ x) -> (real_ y) ->
  (real_ z) -> (infix_lsdt c_zero z) ->
  (infix_lseqdt (infix_asdt x z) (infix_asdt y z)) -> infix_lseqdt x y.

Axiom compat_order_mult_left :
  forall (x:complex) (y:complex) (z:complex), (infix_lseqdt x y) ->
  (real_ x) -> (real_ y) -> (real_ z) -> (infix_lseqdt c_zero z) ->
  infix_lseqdt (infix_asdt z x) (infix_asdt z y).

Axiom strict_compat_order_mult :
  forall (x:complex) (y:complex) (z:complex), (infix_lsdt x y) ->
  (real_ x) -> (real_ y) -> (real_ z) -> (infix_lsdt c_zero z) ->
  infix_lsdt (infix_asdt x z) (infix_asdt y z).

Axiom strict_compat_order_mult_left :
  forall (x:complex) (y:complex) (z:complex), (infix_lsdt x y) ->
  (real_ x) -> (real_ y) -> (real_ z) -> (infix_lsdt c_zero z) ->
  infix_lsdt (infix_asdt z x) (infix_asdt z y).

Axiom complete_order_real :
  forall (x:complex) (y:complex), (real_ x) -> (real_ y) -> ~ (x = y) ->
  ~ (infix_lsdt x y) -> infix_lsdt y x.

Axiom complete_order_real_ :
  forall (x:complex) (y:complex), (real_ x) -> (real_ y) ->
  ~ (infix_lsdt x y) -> ~ (infix_lsdt y x) -> (y = x).

Axiom compat_order_mult_both :
  forall (x:complex) (y:complex) (z:complex) (t:complex),
  ((infix_lseqdt c_zero x) /\ (infix_lseqdt x y)) ->
  ((infix_lseqdt c_zero z) /\ (infix_lseqdt z t)) ->
  infix_lseqdt (infix_asdt z x) (infix_asdt t y).

Axiom inf_to_non_sup_eq :
  forall (x:complex) (y:complex), (real_ x) -> (real_ y) ->
  (infix_lsdt x y) -> ~ (infix_gteqdt x y).

Axiom sup_eq_to_non_inf :
  forall (x:complex) (y:complex), (real_ x) -> (real_ y) ->
  (infix_gteqdt x y) -> ~ (infix_lsdt x y).

Axiom sup_to_inf :
  forall (x:complex) (y:complex), (real_ x) -> (real_ y) ->
  (infix_gtdt x y) -> infix_lsdt y x.

Axiom inf_to_sup :
  forall (x:complex) (y:complex), (real_ x) -> (real_ y) ->
  (infix_lsdt x y) -> infix_gtdt y x.

Axiom sup_to_non_inf_eq :
  forall (x:complex) (y:complex), (real_ x) -> (real_ y) ->
  (infix_gtdt x y) -> ~ (infix_lseqdt x y).

Axiom inf_eq_to_non_sup :
  forall (x:complex) (y:complex), (real_ x) -> (real_ y) ->
  (infix_lseqdt x y) -> ~ (infix_gtdt x y).

Axiom non_inf_eq_to_sup :
  forall (x:complex) (y:complex), (real_ x) -> (real_ y) ->
  ~ (infix_lseqdt x y) -> infix_gtdt x y.

Axiom non_sup_toinf_eq :
  forall (x:complex) (y:complex), (real_ x) -> (real_ y) ->
  ~ (infix_gtdt x y) -> infix_lseqdt x y.

Axiom real_mult :
  forall (x:complex) (y:complex), (real_ x) -> (real_ y) ->
  real_ (infix_asdt x y).

Axiom real_add :
  forall (x:complex) (y:complex), (real_ x) -> (real_ y) ->
  real_ (infix_pldt x y).

Axiom inv_pos :
  forall (x:complex), (real_ x) -> (infix_lsdt c_zero x) ->
  infix_lsdt c_zero (infix_sldt c_one x).

Axiom lower_over_cons :
  forall (a:complex) (b:complex) (c:complex), (infix_lsdt c_zero c) ->
  (infix_lseqdt c_zero a) -> (infix_lseqdt a b) ->
  infix_lseqdt (infix_sldt a c) (infix_sldt b c).

Axiom eq_to_leq_t :
  forall (a:complex) (b:complex), (real_ a) -> (a = b) -> infix_lseqdt a b.

Axiom real_minus : forall (a:complex), (real_ a) -> real_ (prefix_mndt a).

Axiom compat_r_to_c_infeq :
  forall (a:R) (b:R), (infix_lseqas a b) ->
  infix_lseqdt (r_to_c a) (r_to_c b).

Axiom compat_r_to_c_inf :
  forall (a:R) (b:R), (infix_lsas a b) -> infix_lsdt (r_to_c a) (r_to_c b).

Axiom compat_r_to_c_supeq :
  forall (a:R) (b:R), (infix_gteqas a b) ->
  infix_gteqdt (r_to_c a) (r_to_c b).

Axiom compat_r_to_c_sup :
  forall (a:R) (b:R), (infix_gtas a b) -> infix_gtdt (r_to_c a) (r_to_c b).

Axiom unic_inv :
  forall (i:complex) (j:complex), ~ (i = c_zero) ->
  ((infix_asdt i j) = c_one) -> (j = (inv i)).

Axiom inf_eq_def :
  forall (x:complex) (y:complex), (infix_lseqdt x y) -> (real_ x) \/ (x = y).

Axiom inf_eq_def1 :
  forall (x:complex) (y:complex), (infix_lseqdt x y) -> (real_ y) \/ (x = y).

Axiom inf_eq_def2 :
  forall (x:complex) (y:complex), (infix_lseqdt x y) ->
  (infix_lseqas (real_part x) (real_part y)) \/ (x = y).

Axiom inf_eq_def3 :
  forall (x:complex) (y:complex),
  ((real_ x) /\ ((real_ y) /\ (infix_lseqas (real_part x) (real_part y)))) ->
  infix_lseqdt x y.

Axiom inf_eq_def4 :
  forall (x:complex) (y:complex), (x = y) -> infix_lseqdt x y.

Axiom inf_minus :
  forall (x:complex) (y:complex), (infix_lsdt x y) ->
  infix_lsdt (prefix_mndt y) (prefix_mndt x).

Axiom absorbing_zero :
  forall (a:complex) (b:complex), ((infix_asdt a b) = c_zero) ->
  ~ (a = c_zero) -> (b = c_zero).

Axiom absorbing_zero1 :
  forall (a:complex) (b:complex), ((infix_asdt a b) = c_zero) ->
  ~ (b = c_zero) -> (a = c_zero).

Axiom inf_zero_inv :
  forall (z:complex), (infix_lsdt c_zero z) ->
  infix_lsdt c_zero (infix_sldt c_one z).

Axiom inf_zero_inv1 :
  forall (z:complex), (infix_lsdt c_zero z) ->
  infix_lseqdt c_zero (infix_sldt c_one z).

Axiom mult_pos :
  forall (x:complex) (y:complex), (infix_lseqdt c_zero x) ->
  (infix_lseqdt c_zero y) -> infix_lseqdt c_zero (infix_asdt x y).

Axiom simpl_leq_mult_div :
  forall (a:complex) (b:complex) (c:complex), (real_ a) ->
  (infix_lsdt c_zero b) -> (infix_lseqdt (infix_asdt a b) c) ->
  infix_lseqdt a (infix_asdt (infix_sldt c_one b) c).

Axiom mult_leq_c_one_leq :
  forall (a:complex) (b:complex), (infix_lseqdt c_zero a) ->
  ((infix_lseqdt c_zero b) /\ (infix_lseqdt b c_one)) ->
  infix_lseqdt (infix_asdt a b) a.

Axiom mult_leq_c_one_leq_gen :
  forall (a:complex) (a':complex) (b:complex), (infix_lseqdt c_zero a) ->
  ((infix_lseqdt c_zero b) /\ (infix_lseqdt b c_one)) -> (a = a') ->
  infix_lseqdt (infix_asdt a b) a'.

Axiom mult_leq_c_one :
  forall (a:complex) (b:complex), (infix_lseqdt c_zero a) ->
  (exists c:complex, (infix_lseqdt a c) /\ (b = (infix_sldt c_one c))) ->
  (infix_lsdt c_zero b) -> infix_lseqdt (infix_asdt a b) c_one.

Axiom mult_leq_c_one_expl :
  forall (a:complex) (b:complex) (d:complex), (infix_lseqdt c_zero a) ->
  (infix_lseqdt a d) -> (infix_lsdt c_zero d) ->
  (b = (infix_sldt c_one d)) -> infix_lseqdt (infix_asdt a b) c_one.

Axiom mult_leq_c_one_rev :
  forall (a:complex) (b:complex), (infix_lseqdt c_zero a) ->
  (infix_lsdt c_zero b) -> (infix_lseqdt (infix_asdt a b) c_one) ->
  infix_lseqdt a (infix_sldt c_one b).

Axiom simpl_leq_mult :
  forall (a:complex) (b:complex) (c:complex), (infix_lsdt c_zero b) ->
  (infix_lseqdt a c) -> infix_lseqdt (infix_asdt a b) (infix_asdt c b).

Axiom simpl_leq_mult_inv :
  forall (a:complex) (b:complex) (c:complex), (infix_lsdt c_zero a) ->
  (infix_lsdt c_zero b) -> (infix_lsdt c_zero c) ->
  (infix_lseqdt a (infix_sldt c_one (infix_asdt b c))) ->
  infix_lseqdt (infix_asdt a b) (infix_sldt c_one c).

Axiom mult_to_div_leq :
  forall (a:complex) (b:complex) (c:complex), (real_ a) ->
  (infix_lsdt c_zero b) -> (infix_lseqdt (infix_asdt a b) c) ->
  infix_lseqdt a (infix_asdt (infix_sldt c_one b) c).

Axiom mult_div :
  forall (x:complex) (y:complex), (infix_lseqdt c_zero x) ->
  (infix_lsdt c_zero y) -> infix_lseqdt c_zero (infix_sldt x y).

Axiom strict_mult_pos :
  forall (x:complex) (y:complex), (infix_lsdt c_zero x) ->
  (infix_lsdt c_zero y) -> infix_lsdt c_zero (infix_asdt x y).

Axiom rewrite_supeq :
  forall (x:complex) (y:complex), (infix_lseqdt x y) -> infix_gteqdt y x.

Axiom rewrite_sup :
  forall (x:complex) (y:complex), (infix_lsdt x y) -> infix_gtdt y x.

Axiom inv_order_complex :
  forall (a:complex) (b:complex), (infix_lsdt c_zero a) ->
  (infix_lsdt c_zero b) -> (infix_lseqdt a b) ->
  infix_lseqdt (infix_sldt c_one b) (infix_sldt c_one a).

Axiom compat_inv_order :
  forall (a:complex) (b:complex) (c:complex),
  ((infix_lsdt c_zero a) /\ (infix_lseqdt a b)) ->
  (infix_lseqdt c (infix_sldt c_one b)) ->
  infix_lseqdt c (infix_sldt c_one a).

Axiom leq_by_div_simpl :
  forall (a:complex) (b:complex) (c:complex), (infix_lseqdt c_zero a) ->
  ((infix_lsdt c_zero b) /\ (infix_lseqdt b c)) ->
  infix_lseqdt (infix_sldt a c) (infix_sldt a b).

Axiom leq_by_div :
  forall (a:complex) (b:complex) (c:complex), (infix_lseqdt c_zero a) ->
  ((infix_lsdt c_zero b) /\ (infix_lseqdt b c)) ->
  infix_lseqdt (infix_sldt a c) (infix_sldt a b).

Axiom inf_def : forall (x:complex) (y:complex), (infix_lsdt x y) -> real_ x.

Axiom inf_def1 : forall (x:complex) (y:complex), (infix_lsdt x y) -> real_ y.

Axiom inf_def2 :
  forall (x:complex) (y:complex), (infix_lsdt x y) ->
  infix_lsas (real_part x) (real_part y).

Axiom inf_def3 :
  forall (x:complex) (y:complex),
  ((real_ x) /\ ((real_ y) /\ (infix_lsas (real_part x) (real_part y)))) ->
  infix_lsdt x y.

Axiom sup_eq_def :
  forall (x:complex) (y:complex), (infix_gteqdt x y) -> (real_ x) \/ (x = y).

Axiom sup_eq_def1 :
  forall (x:complex) (y:complex), (infix_gteqdt x y) -> (real_ y) \/ (x = y).

Axiom sup_eq_def2 :
  forall (x:complex) (y:complex), (infix_gteqdt x y) ->
  (infix_gteqas (real_part x) (real_part y)) \/ (x = y).

Axiom sup_eq_def3 :
  forall (x:complex) (y:complex),
  ((real_ x) /\ ((real_ y) /\ (infix_gteqas (real_part x) (real_part y)))) ->
  infix_gteqdt x y.

Axiom sup_eq_def4 :
  forall (x:complex) (y:complex), (x = y) -> infix_gteqdt x y.

Axiom sup_def : forall (x:complex) (y:complex), (infix_gtdt x y) -> real_ x.

Axiom sup_def1 : forall (x:complex) (y:complex), (infix_gtdt x y) -> real_ y.

Axiom sup_def2 :
  forall (x:complex) (y:complex), (infix_gtdt x y) ->
  infix_gtas (real_part x) (real_part y).

Axiom sup_def3 :
  forall (x:complex) (y:complex),
  ((real_ x) /\ ((real_ y) /\ (infix_gtas (real_part x) (real_part y)))) ->
  infix_gtdt x y.

Axiom assoc_mult_div :
  forall (x:complex) (y:complex) (z:complex), ~ (z = c_zero) ->
  ((infix_asdt x (infix_sldt y z)) = (infix_sldt (infix_asdt x y) z)).

Axiom assoc_mult_div_rev :
  forall (x:complex) (y:complex) (z:complex), ~ (z = c_zero) ->
  ((infix_sldt (infix_asdt x y) z) = (infix_asdt x (infix_sldt y z))).

Axiom subst_zero : forall (a:complex), ((infix_mndt a c_zero) = a).

Axiom subst_zero_gen :
  forall (a:complex) (b:complex), (b = c_zero) -> ((infix_mndt a b) = a).

Axiom transitive_inf_inv_r :
  forall (a:complex) (b:complex) (c:complex), (infix_lseqdt a b) ->
  (infix_lseqdt b (infix_sldt c_one c)) -> (infix_lsdt c_one c) ->
  infix_lseqdt a b.

Axiom transitive_inf_inv_r1 :
  forall (a:complex) (b:complex) (c:complex), (infix_lseqdt a b) ->
  (infix_lseqdt b (infix_sldt c_one c)) -> (infix_lsdt c_one c) ->
  infix_lsdt b c_one.

Axiom infeq_scal_r :
  forall (a:complex) (b:complex) (c:complex), (infix_lseqdt a c) ->
  (infix_lseqdt c_zero b) -> infix_lseqdt (infix_asdt a b) (infix_asdt c b).

Axiom infeq_scal_l :
  forall (a:complex) (b:complex) (c:complex), (infix_lseqdt a c) ->
  (infix_lseqdt c_zero b) -> infix_lseqdt (infix_asdt b a) (infix_asdt b c).

Axiom transitive_supeq :
  forall (a:complex) (b:complex) (c:complex), (infix_gteqdt a b) ->
  (infix_gteqdt b c) -> infix_gteqdt a c.

Axiom transitive_inf_l :
  forall (a:complex) (b:complex) (c:complex), (infix_lsdt a b) ->
  (infix_lseqdt b c) -> infix_lsdt a c.

Axiom transitive_sup_l :
  forall (a:complex) (b:complex) (c:complex), (infix_gtdt a b) ->
  (infix_gteqdt b c) -> infix_gtdt a c.

Axiom transitive_inf_r :
  forall (a:complex) (b:complex) (c:complex), (infix_lseqdt a b) ->
  (infix_lsdt b c) -> infix_lsdt a c.

Axiom transitive_sup_r :
  forall (a:complex) (b:complex) (c:complex), (infix_gteqdt a b) ->
  (infix_gtdt b c) -> infix_gtdt a c.

Axiom simpl_frac_r :
  forall (x:complex) (y:complex), ~ (x = c_zero) ->
  ((infix_asdt x (infix_sldt y x)) = y).

Axiom compat_mult_sup_eq_right :
  forall (a:complex) (b:complex) (c:complex), (infix_lseqdt c_zero a) ->
  (infix_gteqdt b c) -> infix_gteqdt (infix_asdt a b) (infix_asdt a c).

Axiom compat_mult_sup_right :
  forall (a:complex) (b:complex) (c:complex), (infix_lsdt c_zero a) ->
  (infix_gtdt b c) -> infix_gtdt (infix_asdt a b) (infix_asdt a c).

Axiom compat_mult_inf_right :
  forall (a:complex) (b:complex) (c:complex), (infix_lsdt c_zero a) ->
  (infix_lsdt b c) -> infix_lsdt (infix_asdt a b) (infix_asdt a c).

Axiom infeq_to_supeq :
  forall (a:complex) (b:complex), (infix_lseqdt a b) -> infix_gteqdt b a.

Axiom infeq_inv :
  forall (a:complex) (b:complex), (infix_lseqdt a b) ->
  infix_lseqdt (prefix_mndt b) (prefix_mndt a).

Axiom infeq_inv_add_l :
  forall (a:complex) (b:complex) (c:complex),
  (infix_lseqdt (infix_pldt a c) b) -> (real_ a) -> (real_ c) ->
  infix_lseqdt a (infix_mndt b c).

Axiom infeq_inv_add_r :
  forall (a:complex) (b:complex) (c:complex), (real_ a) -> (real_ c) ->
  (infix_lseqdt a (infix_pldt b c)) -> infix_lseqdt (infix_mndt a c) b.

Axiom r_to_c_surj :
  forall (x:R) (y:R), ~ (x = y) -> ~ ((r_to_c x) = (r_to_c y)).

Axiom r_to_c_inf_rev :
  forall (x:R) (y:R), (infix_lsas x y) -> infix_lsdt (r_to_c x) (r_to_c y).

Axiom div_simpl :
  forall (a:complex) (b:complex), (infix_lsdt c_zero a) ->
  (infix_lsdt c_zero b) ->
  ((infix_sldt c_one b) = (infix_sldt a (infix_asdt a b))).

Axiom infeq_inv_subs_l :
  forall (a:complex) (b:complex) (c:complex), (real_ a) -> (real_ b) ->
  (real_ c) -> (infix_lseqdt (infix_mndt a c) b) ->
  infix_lseqdt a (infix_pldt b c).

Axiom infeq_inv_subs_r :
  forall (a:complex) (b:complex) (c:complex), (real_ a) -> (real_ b) ->
  (real_ c) -> (infix_lseqdt a (infix_mndt b c)) ->
  infix_lseqdt (infix_pldt a c) b.

Axiom infeq_pos_elim :
  forall (a:complex) (b:complex), (real_ a) -> (infix_lseqdt c_zero b) ->
  infix_lseqdt a (infix_pldt a b).

Axiom infeq_pos_elim_add :
  forall (a:complex) (b:complex) (c:complex), (real_ a) -> (real_ b) ->
  (real_ c) -> (infix_lseqdt c_zero b) -> (infix_lseqdt c a) ->
  infix_lseqdt c (infix_pldt a b).

Axiom supeq_elim_left :
  forall (a:complex) (b:complex), (real_ a) -> (real_ b) ->
  (infix_gteqdt a b) -> infix_gteqdt c_zero (infix_mndt b a).

Axiom sup_elim_left :
  forall (a:complex) (b:complex), (infix_gtdt a b) ->
  infix_gtdt c_zero (infix_mndt b a).

Axiom infeq_elim_left :
  forall (a:complex) (b:complex), (real_ a) -> (real_ b) ->
  (infix_lseqdt a b) -> infix_lseqdt c_zero (infix_mndt b a).

Axiom inf_elim_left :
  forall (a:complex) (b:complex), (infix_lsdt a b) ->
  infix_lsdt c_zero (infix_mndt b a).

Axiom t_im_real :
  forall (a:complex) (b:complex),
  ((t_im_part (infix_asdt a b)) =
   (infix_pldt (infix_asdt (t_real_part a) (t_im_part b))
    (infix_asdt (t_im_part a) (t_real_part b)))).

Axiom t_decomp_mult :
  forall (a:complex) (b:complex),
  ((infix_asdt a b) =
   (infix_pldt
    (infix_mndt (infix_asdt (t_real_part a) (t_real_part b))
     (infix_asdt (t_im_part a) (t_im_part b)))
    (infix_asdt im
     (infix_pldt (infix_asdt (t_real_part a) (t_im_part b))
      (infix_asdt (t_im_part a) (t_real_part b)))))).

Axiom t_complex_decomp :
  forall (i:complex),
  (i = (infix_pldt (t_real_part i) (infix_asdt im (t_im_part i)))).

Axiom t_unic_decomp :
  forall (i:complex) (a:complex) (b:complex), (real_ a) -> (real_ b) ->
  (i = (infix_pldt a (infix_asdt im b))) -> (a = (t_real_part i)).

Axiom t_unic_decomp1 :
  forall (i:complex) (a:complex) (b:complex), (real_ a) -> (real_ b) ->
  (i = (infix_pldt a (infix_asdt im b))) -> (b = (t_im_part i)).

Axiom t_decomp_minus :
  forall (i:complex) (a:complex) (b:complex), (real_ a) -> (real_ b) ->
  (i = (infix_mndt a (infix_asdt im b))) -> (a = (t_real_part i)).

Axiom t_decomp_minus1 :
  forall (i:complex) (a:complex) (b:complex), (real_ a) -> (real_ b) ->
  (i = (infix_mndt a (infix_asdt im b))) -> ((prefix_mndt b) = (t_im_part i)).

Axiom real_sum :
  forall (x:complex) (y:complex), (real_ x) -> (real_ y) ->
  real_ (infix_pldt x y).

Axiom set : forall (a:Type), Type.
Parameter set_WhyType : forall (a:Type) {a_WT:WhyType a}, WhyType (set a).
Existing Instance set_WhyType.

Parameter mem: forall {a:Type} {a_WT:WhyType a}, a -> (set a) -> Prop.

Parameter infix_eqeq1:
  forall {a:Type} {a_WT:WhyType a}, (set a) -> (set a) -> Prop.

Axiom infix_eqeq_spec2 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s1:set a) (s2:set a), (infix_eqeq1 s1 s2) -> forall (x:a),
  (mem x s1) -> mem x s2.

Axiom infix_eqeq_spec3 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s1:set a) (s2:set a), (infix_eqeq1 s1 s2) -> forall (x:a),
  (mem x s2) -> mem x s1.

Axiom infix_eqeq_spec4 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s1:set a) (s2:set a), (forall (x:a), (mem x s1) <-> (mem x s2)) ->
  infix_eqeq1 s1 s2.

Axiom extensionality :
  forall {a:Type} {a_WT:WhyType a},
  forall (s1:set a) (s2:set a), (infix_eqeq1 s1 s2) -> (s1 = s2).

Parameter subset:
  forall {a:Type} {a_WT:WhyType a}, (set a) -> (set a) -> Prop.

Axiom subset_spec :
  forall {a:Type} {a_WT:WhyType a},
  forall (s1:set a) (s2:set a), (subset s1 s2) -> forall (x:a), (mem x s1) ->
  mem x s2.

Axiom subset_spec1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s1:set a) (s2:set a), (forall (x:a), (mem x s1) -> mem x s2) ->
  subset s1 s2.

Axiom subset_refl :
  forall {a:Type} {a_WT:WhyType a}, forall (s:set a), subset s s.

Axiom subset_trans :
  forall {a:Type} {a_WT:WhyType a},
  forall (s1:set a) (s2:set a) (s3:set a), (subset s1 s2) ->
  (subset s2 s3) -> subset s1 s3.

Parameter is_empty: forall {a:Type} {a_WT:WhyType a}, (set a) -> Prop.

Axiom is_empty_spec :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a), (is_empty s) -> forall (x:a), ~ (mem x s).

Axiom is_empty_spec1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a), (forall (x:a), ~ (mem x s)) -> is_empty s.

Parameter empty: forall {a:Type} {a_WT:WhyType a}, set a.

Axiom empty_def : forall {a:Type} {a_WT:WhyType a}, is_empty (empty : set a).

Parameter add: forall {a:Type} {a_WT:WhyType a}, a -> (set a) -> set a.

Axiom add_spec :
  forall {a:Type} {a_WT:WhyType a},
  forall (x:a) (s:set a), forall (y:a), (mem y (add x s)) ->
  (y = x) \/ (mem y s).

Axiom add_spec1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (x:a) (s:set a), forall (y:a), (y = x) -> mem y (add x s).

Axiom add_spec2 :
  forall {a:Type} {a_WT:WhyType a},
  forall (x:a) (s:set a), forall (y:a), (mem y s) -> mem y (add x s).

Parameter singleton: forall {a:Type} {a_WT:WhyType a}, a -> set a.

Axiom singleton_def :
  forall {a:Type} {a_WT:WhyType a},
  forall (x:a), ((singleton x) = (add x (empty : set a))).

Parameter remove: forall {a:Type} {a_WT:WhyType a}, a -> (set a) -> set a.

Axiom remove_spec :
  forall {a:Type} {a_WT:WhyType a},
  forall (x:a) (s:set a), forall (y:a), (mem y (remove x s)) -> ~ (y = x).

Axiom remove_spec1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (x:a) (s:set a), forall (y:a), (mem y (remove x s)) -> mem y s.

Axiom remove_spec2 :
  forall {a:Type} {a_WT:WhyType a},
  forall (x:a) (s:set a), forall (y:a), (~ (y = x) /\ (mem y s)) ->
  mem y (remove x s).

Axiom add_remove :
  forall {a:Type} {a_WT:WhyType a},
  forall (x:a) (s:set a), (mem x s) -> ((add x (remove x s)) = s).

Axiom remove_add :
  forall {a:Type} {a_WT:WhyType a},
  forall (x:a) (s:set a), ((remove x (add x s)) = (remove x s)).

Axiom subset_remove :
  forall {a:Type} {a_WT:WhyType a},
  forall (x:a) (s:set a), subset (remove x s) s.

Parameter union:
  forall {a:Type} {a_WT:WhyType a}, (set a) -> (set a) -> set a.

Axiom union_spec :
  forall {a:Type} {a_WT:WhyType a},
  forall (s1:set a) (s2:set a), forall (x:a), (mem x (union s1 s2)) ->
  (mem x s1) \/ (mem x s2).

Axiom union_spec1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s1:set a) (s2:set a), forall (x:a), (mem x s1) ->
  mem x (union s1 s2).

Axiom union_spec2 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s1:set a) (s2:set a), forall (x:a), (mem x s2) ->
  mem x (union s1 s2).

Parameter inter:
  forall {a:Type} {a_WT:WhyType a}, (set a) -> (set a) -> set a.

Axiom inter_spec :
  forall {a:Type} {a_WT:WhyType a},
  forall (s1:set a) (s2:set a), forall (x:a), (mem x (inter s1 s2)) ->
  mem x s1.

Axiom inter_spec1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s1:set a) (s2:set a), forall (x:a), (mem x (inter s1 s2)) ->
  mem x s2.

Axiom inter_spec2 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s1:set a) (s2:set a), forall (x:a), ((mem x s1) /\ (mem x s2)) ->
  mem x (inter s1 s2).

Parameter diff:
  forall {a:Type} {a_WT:WhyType a}, (set a) -> (set a) -> set a.

Axiom diff_spec :
  forall {a:Type} {a_WT:WhyType a},
  forall (s1:set a) (s2:set a), forall (x:a), (mem x (diff s1 s2)) ->
  mem x s1.

Axiom diff_spec1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s1:set a) (s2:set a), forall (x:a), (mem x (diff s1 s2)) ->
  ~ (mem x s2).

Axiom diff_spec2 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s1:set a) (s2:set a), forall (x:a), ((mem x s1) /\ ~ (mem x s2)) ->
  mem x (diff s1 s2).

Axiom subset_diff :
  forall {a:Type} {a_WT:WhyType a},
  forall (s1:set a) (s2:set a), subset (diff s1 s2) s1.

Parameter choose: forall {a:Type} {a_WT:WhyType a}, (set a) -> a.

Axiom choose_spec :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a), ~ (is_empty s) -> mem (choose s) s.

Parameter cardinal: forall {a:Type} {a_WT:WhyType a}, (set a) -> Z.

Axiom cardinal_nonneg :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a), ((cardinal s) >= 0%Z)%Z.

Axiom cardinal_empty :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a), ((cardinal s) = 0%Z) -> is_empty s.

Axiom cardinal_empty1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a), (is_empty s) -> ((cardinal s) = 0%Z).

Axiom cardinal_add :
  forall {a:Type} {a_WT:WhyType a},
  forall (x:a), forall (s:set a), ~ (mem x s) ->
  ((cardinal (add x s)) = (1%Z + (cardinal s))%Z).

Axiom cardinal_remove :
  forall {a:Type} {a_WT:WhyType a},
  forall (x:a), forall (s:set a), (mem x s) ->
  ((cardinal s) = (1%Z + (cardinal (remove x s)))%Z).

Axiom cardinal_subset :
  forall {a:Type} {a_WT:WhyType a},
  forall (s1:set a) (s2:set a), (subset s1 s2) ->
  ((cardinal s1) <= (cardinal s2))%Z.

Axiom subset_eq :
  forall {a:Type} {a_WT:WhyType a},
  forall (s1:set a) (s2:set a), (subset s1 s2) ->
  ((cardinal s1) = (cardinal s2)) -> infix_eqeq1 s1 s2.

Axiom cardinal1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a), ((cardinal s) = 1%Z) -> forall (x:a), (mem x s) ->
  (x = (choose s)).

Axiom real_diff :
  forall (x:complex) (y:complex), (real_ x) -> (real_ y) ->
  real_ (infix_mndt x y).

Axiom pure_im_sum :
  forall (x:complex) (y:complex), (pure_im_ x) -> (pure_im_ y) ->
  pure_im_ (infix_pldt x y).

Axiom equal_decomp :
  forall (x:complex) (y:complex), ((real_part x) = (real_part y)) ->
  ((im_part x) = (im_part y)) -> (x = y).

Axiom t_equal_decomp :
  forall (x:complex) (y:complex), ((t_real_part x) = (t_real_part y)) ->
  ((t_im_part x) = (t_im_part y)) -> (x = y).

Axiom pure_im_diff :
  forall (x:complex) (y:complex), (pure_im_ x) -> (pure_im_ y) ->
  pure_im_ (infix_mndt x y).

Axiom real_div :
  forall (x:complex) (y:complex), (real_ x) -> ~ (y = c_zero) -> (real_ y) ->
  real_ (infix_sldt x y).

Axiom mult_im_im :
  forall (a:complex) (b:complex), (pure_im_ a) -> (pure_im_ b) ->
  ((infix_asdt a b) =
   (infix_asdt (infix_asdt im im)
    (infix_asdt (r_to_c (im_part a)) (r_to_c (im_part b))))).

Axiom mult_im_im1 :
  forall (a:complex) (b:complex), (pure_im_ a) -> (pure_im_ b) ->
  ((infix_asdt a b) =
   (prefix_mndt (r_to_c (infix_asas (im_part a) (im_part b))))).

Axiom mult_im_im2 :
  forall (a:complex) (b:complex), (pure_im_ a) -> (pure_im_ b) ->
  ((real_part (infix_asdt a b)) =
   (prefix_mnas (infix_asas (im_part a) (im_part b)))).

Axiom mult_im_im3 :
  forall (a:complex) (b:complex), (pure_im_ a) -> (pure_im_ b) ->
  ((im_part (infix_asdt a b)) = 0%R).

Axiom mult_real_im :
  forall (a:complex) (b:complex), (real_ a) -> (pure_im_ b) ->
  ((infix_asdt a b) =
   (infix_asdt im (infix_asdt (r_to_c (real_part a)) (r_to_c (im_part b))))).

Axiom mult_real_im1 :
  forall (a:complex) (b:complex), (real_ a) -> (pure_im_ b) ->
  ((infix_asdt a b) =
   (infix_asdt im (r_to_c (infix_asas (real_part a) (im_part b))))).

Axiom mult_real_im2 :
  forall (a:complex) (b:complex), (real_ a) -> (pure_im_ b) ->
  ((real_part (infix_asdt a b)) = 0%R).

Axiom mult_real_im3 :
  forall (a:complex) (b:complex), (real_ a) -> (pure_im_ b) ->
  ((im_part (infix_asdt a b)) = (infix_asas (real_part a) (im_part b))).

Axiom mult_im_real :
  forall (a:complex) (b:complex), (pure_im_ a) -> (real_ b) ->
  ((infix_asdt a b) =
   (infix_asdt im (infix_asdt (r_to_c (im_part a)) (r_to_c (real_part b))))).

Axiom mult_im_real1 :
  forall (a:complex) (b:complex), (pure_im_ a) -> (real_ b) ->
  ((infix_asdt a b) =
   (infix_asdt im (r_to_c (infix_asas (im_part a) (real_part b))))).

Axiom mult_im_real2 :
  forall (a:complex) (b:complex), (pure_im_ a) -> (real_ b) ->
  ((real_part (infix_asdt a b)) = 0%R).

Axiom mult_im_real3 :
  forall (a:complex) (b:complex), (pure_im_ a) -> (real_ b) ->
  ((im_part (infix_asdt a b)) = (infix_asas (im_part a) (real_part b))).

Axiom decomp_mult_gen :
  forall (a:complex) (b:complex),
  ((real_part (infix_asdt a b)) =
   (infix_mnas (infix_asas (real_part a) (real_part b))
    (infix_asas (im_part a) (im_part b)))).

Axiom decomp_mult_gen1 :
  forall (a:complex) (b:complex),
  ((im_part (infix_asdt a b)) =
   (infix_plas (infix_asas (real_part a) (im_part b))
    (infix_asas (im_part a) (real_part b)))).

Axiom inv_real :
  forall (a:complex), ~ (a = c_zero) -> (real_ a) ->
  ((real_part (infix_sldt c_one a)) = (infix_slas 1%R (real_part a))).

Axiom inv_real1 :
  forall (a:complex), ~ (a = c_zero) -> (real_ a) ->
  real_ (infix_sldt c_one a).

Axiom div_real_real :
  forall (a:complex) (b:complex), (real_ a) -> (real_ b) -> ~ (b = c_zero) ->
  ((real_part (infix_sldt a b)) = (infix_slas (real_part a) (real_part b))).

Axiom zeroLessOne : infix_lseqdt c_zero c_one.

Axiom compatOrderAdd :
  forall (x:complex) (y:complex) (z:complex), (infix_lseqdt x y) ->
  (real_ x) -> (real_ y) -> (real_ z) ->
  infix_lseqdt (infix_pldt x z) (infix_pldt y z).

Axiom positive_add :
  forall (x:complex) (y:complex), (infix_lseqdt c_zero x) ->
  (infix_lseqdt c_zero y) -> infix_lseqdt c_zero (infix_pldt x y).

Axiom strict_positive_add_l :
  forall (x:complex) (y:complex), (infix_lsdt c_zero x) ->
  (infix_lseqdt c_zero y) -> infix_lsdt c_zero (infix_pldt x y).

Axiom strict_compatOrderAdd :
  forall (x:complex) (y:complex) (z:complex) (t:complex), (infix_lsdt x y) ->
  (infix_lsdt z t) -> (real_ x) -> (real_ y) -> (real_ z) -> (real_ t) ->
  infix_lsdt (infix_pldt x z) (infix_pldt y t).

Axiom compat_sup_add :
  forall (x:complex) (y:complex) (z:complex) (t:complex), (infix_gtdt x y) ->
  (infix_gtdt z t) -> (real_ x) -> (real_ y) -> (real_ z) -> (real_ t) ->
  infix_gtdt (infix_pldt x z) (infix_pldt y t).

Axiom compat_supeq_mult :
  forall (x:complex) (y:complex) (z:complex), (infix_gteqdt x y) ->
  (real_ x) -> (real_ y) -> (real_ z) -> (infix_lseqdt c_zero z) ->
  infix_gteqdt (infix_asdt x z) (infix_asdt y z).

Axiom compat_supeq_div :
  forall (x:complex) (y:complex) (z:complex), (infix_gteqdt x y) ->
  (real_ x) -> (real_ y) -> (real_ z) -> (infix_lsdt c_zero z) ->
  infix_gteqdt (infix_sldt x z) (infix_sldt y z).

Axiom compat_infeq_div :
  forall (x:complex) (y:complex) (z:complex), (infix_lseqdt x y) ->
  (real_ x) -> (real_ y) -> (real_ z) -> (infix_lsdt c_zero z) ->
  infix_lseqdt (infix_sldt x z) (infix_sldt y z).

Axiom compat_sup_div :
  forall (x:complex) (y:complex) (z:complex), (infix_gtdt x y) ->
  (real_ x) -> (real_ y) -> (real_ z) -> (infix_lsdt c_zero z) ->
  infix_gtdt (infix_sldt x z) (infix_sldt y z).

Axiom compat_inf_div :
  forall (x:complex) (y:complex) (z:complex), (infix_lsdt x y) ->
  (real_ x) -> (real_ y) -> (real_ z) -> (infix_lsdt c_zero z) ->
  infix_lsdt (infix_sldt x z) (infix_sldt y z).

Axiom positive_prod_itself :
  forall (x:complex), (real_ x) -> infix_lseqdt c_zero (infix_asdt x x).

Axiom strict_positive_prod_itself :
  forall (x:complex), (real_ x) -> ~ (x = c_zero) ->
  infix_lsdt c_zero (infix_asdt x x).

Axiom compat_sup_mult :
  forall (x:complex) (y:complex) (z:complex), (infix_gteqdt x y) ->
  (real_ x) -> (real_ y) -> (real_ z) -> (infix_lseqdt c_zero z) ->
  infix_gteqdt (infix_asdt x z) (infix_asdt y z).

Axiom strict_compat_sup_mult :
  forall (x:complex) (y:complex) (z:complex), (infix_gtdt x y) ->
  (real_ x) -> (real_ y) -> (real_ z) -> (infix_lsdt c_zero z) ->
  infix_gtdt (infix_asdt x z) (infix_asdt y z).

Axiom compat_sup_mult_left :
  forall (x:complex) (y:complex) (z:complex), (infix_gteqdt x y) ->
  (real_ x) -> (real_ y) -> (real_ z) -> (infix_lseqdt c_zero z) ->
  infix_gteqdt (infix_asdt z x) (infix_asdt z y).

Axiom strict_compat_sup_mult_left :
  forall (x:complex) (y:complex) (z:complex), (infix_gtdt x y) ->
  (real_ x) -> (real_ y) -> (real_ z) -> (infix_lsdt c_zero z) ->
  infix_gtdt (infix_asdt z x) (infix_asdt z y).

Axiom inv_inf_eq :
  forall (a:complex) (b:complex), (infix_lsdt c_zero a) ->
  (infix_lsdt c_zero b) -> (infix_lseqdt a b) ->
  infix_lseqdt (infix_sldt c_one b) (infix_sldt c_one a).

Axiom inv_sup_eq :
  forall (a:complex) (b:complex), (infix_lsdt c_zero a) ->
  (infix_lsdt c_zero b) -> (infix_gteqdt a b) ->
  infix_gteqdt (infix_sldt c_one b) (infix_sldt c_one a).

Axiom inv_sup :
  forall (x:complex) (y:complex), (real_ x) -> (real_ y) ->
  ((infix_lsdt c_zero x) /\ (infix_lsdt x y)) ->
  infix_gtdt (infix_sldt c_one x) (infix_sldt c_one y).

Axiom inv_eqinf :
  forall (x:complex) (y:complex), (real_ x) -> (real_ y) ->
  ((infix_lsdt c_zero x) /\ (infix_lseqdt x y)) ->
  infix_gteqdt (infix_sldt c_one x) (infix_sldt c_one y).

Axiom inv_eqsup :
  forall (x:complex) (y:complex), (real_ x) -> (real_ y) ->
  ((infix_gteqdt x y) /\ (infix_gtdt y c_zero)) ->
  infix_lseqdt (infix_sldt c_one x) (infix_sldt c_one y).

Axiom inv_inf :
  forall (x:complex) (y:complex), (real_ x) -> (real_ y) ->
  ((infix_gtdt x y) /\ (infix_gtdt y c_zero)) ->
  infix_lsdt (infix_sldt c_one x) (infix_sldt c_one y).

Axiom inv_neg :
  forall (x:complex), (real_ x) -> (infix_lsdt x c_zero) ->
  infix_lsdt (infix_sldt c_one x) c_zero.

Axiom lower_inv :
  forall (a:complex) (b:complex) (c:complex), (infix_lsdt c_zero b) ->
  (infix_lseqdt c_zero a) -> (infix_lseqdt b c) ->
  infix_gteqdt (infix_sldt a b) (infix_sldt a c).

Axiom lower_inv_ :
  forall (a:complex) (b:complex) (c:complex), (infix_lsdt c_zero b) ->
  (infix_lseqdt c_zero a) -> (infix_lseqdt b c) ->
  infix_lseqdt (infix_sldt a c) (infix_sldt a b).

Axiom zero_add_t :
  forall (a1:complex) (a2:complex), (a1 = c_zero) ->
  ((infix_pldt a1 a2) = a2).

Axiom add_zero_t :
  forall (a1:complex) (a2:complex), (a2 = c_zero) ->
  ((infix_pldt a1 a2) = a1).

Axiom one_mult_t :
  forall (a1:complex) (a2:complex), (a1 = c_one) -> ((infix_asdt a1 a2) = a2).

Axiom one_mult_t_const : forall (a:complex), ((infix_asdt c_one a) = a).

Axiom zero_mult_t_const :
  forall (a:complex), ((infix_asdt c_zero a) = c_zero).

Axiom mult_zero_t_const :
  forall (a:complex), ((infix_asdt a c_zero) = c_zero).

Axiom subs_eq :
  forall (a1:complex) (a2:complex) (b1:complex) (b2:complex), (a1 = a2) ->
  (b1 = b2) -> ((infix_mndt a1 b1) = (infix_mndt a2 b2)).

Axiom subst_itself :
  forall (a1:complex) (a2:complex), (a1 = a2) ->
  ((infix_mndt a1 a2) = c_zero).

Axiom mult_assoc_four :
  forall (a:complex) (b:complex) (c:complex) (d:complex),
  ((infix_asdt (infix_asdt a (infix_asdt b c)) d) =
   (infix_asdt (infix_asdt a b) (infix_asdt c d))).

Axiom mult_assoc_rev :
  forall (a:complex) (b:complex) (c:complex),
  ((infix_asdt a (infix_asdt b c)) = (infix_asdt (infix_asdt a b) c)).

Axiom add_assoc :
  forall (a:complex) (b:complex) (c:complex),
  ((infix_pldt (infix_pldt a b) c) = (infix_pldt a (infix_pldt b c))).

Axiom add_assoc_rev :
  forall (a:complex) (b:complex) (c:complex),
  ((infix_pldt a (infix_pldt b c)) = (infix_pldt (infix_pldt a b) c)).

Axiom div_mult :
  forall (a:complex) (b:complex) (c:complex), ~ (c = c_zero) ->
  ((infix_asdt a (infix_sldt b c)) = (infix_sldt (infix_asdt a b) c)).

Axiom div_mult_rev :
  forall (a:complex) (b:complex) (c:complex), ~ (c = c_zero) ->
  ((infix_sldt (infix_asdt a b) c) = (infix_asdt a (infix_sldt b c))).

Axiom triang_p :
  forall (a:complex) (b:complex),
  ((infix_asdt (infix_pldt a b) (infix_pldt a b)) =
   (infix_pldt (infix_pldt (infix_asdt a a) (infix_asdt b b))
    (infix_asdt (infix_asdt ttwo a) b))).

Axiom triang_n :
  forall (a:complex) (b:complex),
  ((infix_asdt (infix_mndt a b) (infix_mndt a b)) =
   (infix_mndt (infix_pldt (infix_asdt a a) (infix_asdt b b))
    (infix_asdt (infix_asdt ttwo a) b))).

Axiom triang_s :
  forall (a:complex) (b:complex) (c:complex) (d:complex) (e:complex),
  ((infix_pldt (infix_pldt (infix_pldt a b) c)
    (infix_pldt (infix_mndt d b) e))
   = (infix_pldt (infix_pldt a c) (infix_pldt d e))).

Axiom triang_t :
  forall (a:complex) (b:complex),
  ((infix_asdt (infix_pldt a b) (infix_mndt a b)) =
   (infix_mndt (infix_asdt a a) (infix_asdt b b))).

Axiom triang_sr :
  forall (a:complex) (b:complex) (c:complex) (d:complex) (e:complex),
  ((infix_pldt (infix_pldt (infix_mndt a b) c)
    (infix_pldt (infix_pldt d b) e))
   = (infix_pldt (infix_pldt a c) (infix_pldt d e))).

Axiom add_pos :
  forall (x:complex) (y:complex), (infix_lseqdt c_zero x) ->
  (infix_lseqdt c_zero y) -> infix_lseqdt c_zero (infix_pldt x y).

Axiom add_pos_strit_l :
  forall (x:complex) (y:complex), (infix_lsdt c_zero x) ->
  (infix_lseqdt c_zero y) -> infix_lsdt c_zero (infix_pldt x y).

Axiom add_pos_strit_r :
  forall (x:complex) (y:complex), (infix_lseqdt c_zero x) ->
  (infix_lsdt c_zero y) -> infix_lsdt c_zero (infix_pldt x y).

Axiom modulus_pre_pre :
  forall (a:complex) (b:complex) (c:complex) (d:complex),
  ((infix_pldt (infix_pldt (infix_asdt a b) (infix_asdt c d))
    (infix_pldt (infix_asdt a d) (infix_asdt c b)))
   =
   (infix_pldt (infix_asdt a (infix_pldt b d))
    (infix_asdt c (infix_pldt b d)))).

Axiom modulus_pre_pre1 :
  forall (a:complex) (b:complex) (c:complex) (d:complex),
  ((infix_pldt (infix_pldt (infix_asdt a b) (infix_asdt c d))
    (infix_pldt (infix_asdt a d) (infix_asdt c b)))
   = (infix_asdt (infix_pldt a c) (infix_pldt b d))).

Axiom modulus_pre :
  forall (a:complex) (b:complex) (c:complex) (d:complex),
  ((infix_pldt
    (infix_pldt (infix_asdt (infix_asdt a b) (infix_asdt a b))
     (infix_asdt (infix_asdt c d) (infix_asdt c d)))
    (infix_pldt (infix_asdt (infix_asdt a d) (infix_asdt a d))
     (infix_asdt (infix_asdt c b) (infix_asdt c b))))
   =
   (infix_asdt (infix_pldt (infix_asdt a a) (infix_asdt c c))
    (infix_pldt (infix_asdt b b) (infix_asdt d d)))).

Parameter real_sqrt: R -> R.

Axiom real_sqrt_spec :
  forall (x:R), (infix_lseqas 0%R x) ->
  ((infix_asas (real_sqrt x) (real_sqrt x)) = x).

Axiom real_sqrt_spec1 :
  forall (x:R), (infix_lseqas 0%R x) ->
  ((real_sqrt x) = (Reals.R_sqrt.sqrt x)).

Parameter square_rt: complex -> complex.

Axiom square_rt_def :
  forall (x:complex), (infix_lseqdt c_zero x) ->
  ((square_rt x) = (r_to_c (real_sqrt (real_part x)))).

Axiom square_rt_spec :
  forall (x:complex), (infix_lseqdt c_zero x) -> real_ (square_rt x).

Axiom square_rt_spec1 :
  forall (x:complex), (infix_lseqdt c_zero x) ->
  ((infix_asdt (square_rt x) (square_rt x)) = x).

Axiom square_rt_spec2 :
  forall (x:complex), (infix_lseqdt c_zero x) ->
  infix_lseqdt c_zero (square_rt x).

Axiom square_rt_eq :
  forall (a:complex) (b:complex), (infix_lseqdt c_zero a) ->
  (infix_lseqdt c_zero b) -> (a = b) -> ((square_rt a) = (square_rt b)).

Axiom real_square_rt :
  forall (x:complex), (real_ x) -> (infix_lseqdt c_zero x) ->
  real_ (square_rt x).

Axiom pos_square_rt :
  forall (x:complex), (real_ x) -> (infix_lseqdt c_zero x) ->
  infix_gteqdt (square_rt x) c_zero.

Axiom square_rt_square :
  forall (x:complex), (infix_lseqdt c_zero x) ->
  ((infix_asdt (square_rt x) (square_rt x)) = x).

Axiom square_rt_infeq :
  forall (x:complex) (y:complex), (real_ x) -> (real_ y) ->
  ((infix_lseqdt c_zero x) /\ (infix_lseqdt x y)) ->
  infix_lseqdt (square_rt x) (square_rt y).

Axiom square_rt_inf :
  forall (x:complex) (y:complex),
  ((infix_lseqdt c_zero x) /\ (infix_lsdt x y)) ->
  infix_lsdt (square_rt x) (square_rt y).

Axiom injective_square_rt :
  forall (x:complex) (y:complex), (real_ x) -> (real_ y) ->
  (infix_lseqdt c_zero x) -> (infix_lseqdt c_zero y) ->
  ((square_rt x) = (square_rt y)) -> (x = y).

Axiom injective_square :
  forall (x:complex) (y:complex), (real_ x) -> (real_ y) ->
  (infix_lseqdt c_zero x) -> (infix_lseqdt c_zero y) ->
  ((infix_asdt x x) = (infix_asdt y y)) -> (x = y).

Axiom square_rt_c_one : ((square_rt c_one) = c_one).

Axiom square_rt_mult :
  forall (t:complex) (t':complex), (real_ t) -> (infix_lseqdt c_zero t) ->
  (real_ t') -> (infix_lseqdt c_zero t') ->
  ((infix_asdt (square_rt t) (square_rt t')) = (square_rt (infix_asdt t t'))).

Axiom square_rt_mult_rev :
  forall (t:complex) (t':complex), (real_ t) -> (infix_lseqdt c_zero t) ->
  (real_ t') -> (infix_lseqdt c_zero t') ->
  ((square_rt (infix_asdt t t')) = (infix_asdt (square_rt t) (square_rt t'))).

Parameter modulus: complex -> complex.

Axiom modulus_def :
  forall (x:complex),
  ((modulus x) =
   (square_rt
    (infix_pldt (infix_asdt (t_real_part x) (t_real_part x))
     (infix_asdt (t_im_part x) (t_im_part x))))).

Axiom modulus_spec : forall (x:complex), infix_lseqdt c_zero (modulus x).

Parameter c_one_modulus: complex -> Prop.

Axiom c_one_modulus_def :
  forall (x:complex), (c_one_modulus x) -> ((modulus x) = c_one).

Axiom c_one_modulus_def1 :
  forall (x:complex), ((modulus x) = c_one) -> c_one_modulus x.

Axiom modulus_eq :
  forall (x:complex) (y:complex),
  ((infix_asdt (t_real_part x) (t_real_part x)) =
   (infix_asdt (t_real_part y) (t_real_part y))) ->
  ((infix_asdt (t_im_part x) (t_im_part x)) =
   (infix_asdt (t_im_part y) (t_im_part y))) ->
  ((modulus x) = (modulus y)).

Axiom modulus_minus :
  forall (x:complex), ((modulus (prefix_mndt x)) = (modulus x)).

Axiom square_rt_simpl :
  forall (x:complex), (infix_lsdt c_zero x) ->
  ((infix_asdt x (infix_sldt c_one (square_rt x))) = (square_rt x)).

Axiom square_rt_simpl_fact :
  forall (x:complex) (a:complex), (infix_lsdt c_zero x) ->
  ((infix_asdt (infix_asdt a (infix_sldt c_one (square_rt x))) x) =
   (infix_asdt a (square_rt x))).

Axiom square_rt_simpl_mult :
  forall (x:complex) (a:complex), (infix_lsdt c_zero x) ->
  ((infix_asdt (infix_asdt (square_rt x) a) (infix_sldt c_one (square_rt x)))
   = a).

Axiom square_rt_simpl_fact_assoc :
  forall (x:complex) (a:complex), (infix_lsdt c_zero x) ->
  ((infix_asdt x (infix_asdt a (infix_sldt c_one (square_rt x)))) =
   (infix_asdt a (square_rt x))).

Axiom modulus_itself :
  forall (x:complex) (y:complex), (x = y) -> ((modulus x) = (modulus y)).

Axiom modulus_real_pos :
  forall (x:complex), (real_ x) -> (infix_lseqdt c_zero x) ->
  ((modulus x) = x).

Axiom modulus_real_pos_inv :
  forall (x:complex), (real_ x) -> (infix_lseqdt c_zero x) ->
  ((modulus (prefix_mndt x)) = x).

Axiom modulus_real_neg :
  forall (x:complex), (real_ x) -> (infix_lseqdt x c_zero) ->
  ((modulus x) = (prefix_mndt x)).

Axiom strict_positive_modulus :
  forall (x:complex), ~ (x = c_zero) -> infix_lsdt c_zero (modulus x).

Axiom not_modulus_zero :
  forall (x:complex), ~ (x = c_zero) -> ~ ((modulus x) = c_zero).

Axiom modulus_real : forall (x:complex), real_ (modulus x).

Axiom t_mult_real_square :
  forall (a:complex) (b:complex),
  ((infix_asdt (t_real_part (infix_asdt a b)) (t_real_part (infix_asdt a b)))
   =
   (infix_mndt
    (infix_pldt
     (infix_asdt (infix_asdt (t_real_part a) (t_real_part a))
      (infix_asdt (t_real_part b) (t_real_part b)))
     (infix_asdt (infix_asdt (t_im_part a) (t_im_part a))
      (infix_asdt (t_im_part b) (t_im_part b))))
    (infix_asdt ttwo
     (infix_asdt
      (infix_asdt (infix_asdt (t_real_part a) (t_real_part b)) (t_im_part a))
      (t_im_part b))))).

Axiom t_mult_im_square :
  forall (a:complex) (b:complex),
  ((infix_asdt (t_im_part (infix_asdt a b)) (t_im_part (infix_asdt a b))) =
   (infix_pldt
    (infix_pldt
     (infix_asdt (infix_asdt (t_real_part a) (t_real_part a))
      (infix_asdt (t_im_part b) (t_im_part b)))
     (infix_asdt (infix_asdt (t_im_part a) (t_im_part a))
      (infix_asdt (t_real_part b) (t_real_part b))))
    (infix_asdt ttwo
     (infix_asdt
      (infix_asdt (infix_asdt (t_real_part a) (t_real_part b)) (t_im_part a))
      (t_im_part b))))).

Axiom mult_modulus_pre :
  forall (a:complex) (b:complex),
  ((infix_pldt
    (infix_asdt (t_real_part (infix_asdt a b))
     (t_real_part (infix_asdt a b)))
    (infix_asdt (t_im_part (infix_asdt a b)) (t_im_part (infix_asdt a b))))
   =
   (infix_asdt
    (infix_pldt (infix_asdt (t_real_part a) (t_real_part a))
     (infix_asdt (t_im_part a) (t_im_part a)))
    (infix_pldt (infix_asdt (t_real_part b) (t_real_part b))
     (infix_asdt (t_im_part b) (t_im_part b))))).

Axiom mult_modulus :
  forall (x:complex) (y:complex),
  ((modulus (infix_asdt x y)) = (infix_asdt (modulus x) (modulus y))).

Axiom mult_modulus_rev :
  forall (x:complex) (y:complex),
  ((infix_asdt (modulus x) (modulus y)) = (modulus (infix_asdt x y))).

Axiom mult_real_modulus :
  forall (x:complex) (y:complex), (real_ x) -> (infix_lseqdt c_zero x) ->
  ((modulus (infix_asdt x y)) = (infix_asdt x (modulus y))).

Axiom mult_modulus_real :
  forall (x:complex) (y:complex), (real_ y) -> (infix_lseqdt c_zero y) ->
  ((modulus (infix_asdt x y)) = (infix_asdt (modulus x) y)).

Axiom mult_modulus_non_null :
  forall (x:complex) (y:complex), ~ (x = c_zero) -> ~ (y = c_zero) ->
  ~ ((modulus (infix_asdt x y)) = c_zero).

Axiom modulus_to_non_null :
  forall (x:complex), (infix_lsdt c_zero (modulus x)) -> ~ (x = c_zero).

Axiom mult_c_one_modulus :
  forall (x:complex) (y:complex), (c_one_modulus x) -> (c_one_modulus y) ->
  c_one_modulus (infix_asdt x y).

Axiom modulus_pos :
  forall (x:complex), ~ (x = c_zero) -> infix_lseqdt c_zero (modulus x).

Axiom modulus_infeq :
  forall (x:complex) (b:complex) (c:complex), (real_ x) ->
  (infix_lseqdt b c) -> (infix_lseqdt (modulus x) b) -> infix_lseqdt x c.

Axiom modulus_inf :
  forall (x:complex) (b:complex) (c:complex), (real_ x) ->
  (infix_lsdt b c) -> (infix_lseqdt (modulus x) b) -> infix_lsdt x c.

Axiom modulus_diff_rev :
  forall (a:complex) (b:complex),
  ((modulus (infix_mndt a b)) = (modulus (infix_mndt b a))).

Axiom modulus_simpl_leq :
  forall (a:complex) (b:complex) (c:complex), (real_ a) -> (real_ b) ->
  (real_ c) -> (infix_lsdt c_zero c) ->
  (infix_lseqdt (modulus (infix_asdt a c)) (infix_asdt b c)) ->
  infix_lseqdt (modulus a) b.

Axiom modulus_simpl_leq_rev :
  forall (a:complex) (b:complex) (c:complex), (real_ a) -> (real_ b) ->
  (real_ c) -> (infix_lseqdt c_zero c) -> (infix_lseqdt (modulus a) b) ->
  infix_lseqdt (modulus (infix_asdt a c)) (infix_asdt b c).

Axiom div_eq :
  forall (a1:complex) (a2:complex) (b1:complex) (b2:complex), (a1 = a2) ->
  (b1 = b2) -> ~ (b1 = c_zero) -> ((infix_sldt a1 b1) = (infix_sldt a2 b2)).

Axiom add_eq_inv_t :
  forall (a1:complex) (a2:complex) (b1:complex) (b2:complex), (a1 = a2) ->
  (b1 = b2) -> ((infix_pldt a1 b1) = (infix_pldt b2 a2)).

Axiom mult_eq_inv_t :
  forall (a1:complex) (a2:complex) (b1:complex) (b2:complex), (a1 = a2) ->
  (b1 = b2) -> ((infix_asdt a1 b1) = (infix_asdt b2 a2)).

Axiom sum_frac :
  forall (a1:complex) (a2:complex) (b:complex), ~ (b = c_zero) ->
  ((infix_pldt (infix_sldt a1 b) (infix_sldt a2 b)) =
   (infix_sldt (infix_pldt a1 a2) b)).

Axiom sum_frac_rev :
  forall (a1:complex) (a2:complex) (b:complex), ~ (b = c_zero) ->
  ((infix_sldt (infix_pldt a1 a2) b) =
   (infix_pldt (infix_sldt a1 b) (infix_sldt a2 b))).

Parameter p_id: forall {a:Type} {a_WT:WhyType a}, a -> a.

Axiom p_id_def :
  forall {a:Type} {a_WT:WhyType a}, forall (a1:a), ((p_id a1) = a1).

Parameter const:
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b}, a -> b -> a.

Axiom const_def :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (a1:a) (b1:b), ((const a1 b1) = a1).

Parameter constant_f:
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b}, (a -> b) ->
  Prop.

Axiom constant_f_def :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b), (constant_f f) ->
  exists a1:b, (f = ((fun (y0:b) (y1:a) => (const y0 y1)) a1)).

Axiom constant_f_def1 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b),
  (exists a1:b, (f = ((fun (y0:b) (y1:a) => (const y0 y1)) a1))) ->
  constant_f f.

Parameter op: forall {im1:Type} {im1_WT:WhyType im1}, im1 -> im1 -> im1.

Parameter po: forall {im1:Type} {im1_WT:WhyType im1}, im1 -> im1 -> im1.

Parameter inver: forall {im1:Type} {im1_WT:WhyType im1}, im1 -> im1.

Parameter filter:
  forall {a:Type} {a_WT:WhyType a}, (a -> bool) -> (set a) -> set a.

Axiom filter_def :
  forall {a:Type} {a_WT:WhyType a},
  forall (p:a -> bool) (u:set a), forall (x:a), (mem x (filter p u)) ->
  ((p x) = true).

Axiom filter_def1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (p:a -> bool) (u:set a), forall (x:a), (mem x (filter p u)) ->
  mem x u.

Axiom filter_def2 :
  forall {a:Type} {a_WT:WhyType a},
  forall (p:a -> bool) (u:set a), forall (x:a),
  (((p x) = true) /\ (mem x u)) -> mem x (filter p u).

Axiom filter_cardinal :
  forall {a:Type} {a_WT:WhyType a},
  forall (p:a -> bool) (u:set a), ((cardinal (filter p u)) <= (cardinal u))%Z.

Parameter map:
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b}, (a -> b) ->
  (set a) -> set b.

Axiom map_def1 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (u:set a), forall (y:b), (mem y (map f u)) ->
  exists x:a, (mem x u) /\ (y = (f x)).

Axiom map_def11 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (u:set a), forall (y:b),
  (exists x:a, (mem x u) /\ (y = (f x))) -> mem y (map f u).

Axiom map_def2 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (u:set a), forall (x:a), (mem x u) -> mem (f x) (map f u).

Axiom map_cardinal :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (u:set a), ((cardinal (map f u)) <= (cardinal u))%Z.

Parameter fir:
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b}, (a* b)%type ->
  a.

Parameter sec:
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b}, (a* b)%type ->
  b.

Axiom projections :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (o:(a* b)%type), (o = (fir o, sec o)).

Axiom get_fir :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (a1:a) (b1:b), ((fir (a1, b1)) = a1).

Axiom get_sec :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (a1:a) (b1:b), ((sec (a1, b1)) = b1).

(* Why3 assumption *)
Inductive ref (a:Type) :=
  | mk_ref : a -> ref a.
Axiom ref_WhyType : forall (a:Type) {a_WT:WhyType a}, WhyType (ref a).
Existing Instance ref_WhyType.
Arguments mk_ref {a}.

(* Why3 assumption *)
Definition contents {a:Type} {a_WT:WhyType a} (v:ref a) : a :=
  match v with
  | mk_ref x => x
  end.

Parameter prefix_ex: forall {a:Type} {a_WT:WhyType a}, (ref a) -> a.

Axiom prefix_ex_def :
  forall {a:Type} {a_WT:WhyType a},
  forall (r:ref a), ((prefix_ex r) = (contents r)).

Parameter eq_e: forall {a:Type} {a_WT:WhyType a}, a -> a -> Prop.

Axiom eq_e_def :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:a) (a':a), (eq_e a1 a') -> (a1 = a').

Axiom eq_e_def1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:a) (a':a), (a1 = a') -> eq_e a1 a'.

Axiom set_equal :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s':set a), (forall (e:a), (mem e s) -> mem e s') ->
  (forall (e:a), (mem e s') -> mem e s) -> (s = s').

Axiom set_equal_eqq :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s':set a), (forall (e:a), (mem e s) -> mem e s') ->
  (forall (e:a), (mem e s') -> mem e s) -> infix_eqeq s s'.

Axiom union_exchange :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s':set a), ~ (is_empty s') ->
  ((union (add (choose s') s) (remove (choose s') s')) = (union s s')).

Axiom get_filter :
  forall {a:Type} {a_WT:WhyType a},
  forall (p:a -> bool) (s:set a) (x:a), (mem x (filter p s)) ->
  ((p x) = true).

Axiom get_filter1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (p:a -> bool) (s:set a) (x:a), (mem x (filter p s)) -> mem x s.

Axiom set_filter :
  forall {a:Type} {a_WT:WhyType a},
  forall (p:a -> bool) (s:set a) (x:a), ((p x) = true) -> (mem x s) ->
  mem x (filter p s).

Axiom inter_empty :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s':set a), (is_empty s) -> is_empty (inter s s').

Axiom inter_empty_comm :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s':set a), (is_empty s') -> is_empty (inter s s').

Axiom inter_empty_elts :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s':set a), (forall (e:a), (mem e s) -> ~ (mem e s')) ->
  is_empty (inter s s').

Axiom inter_sym :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s':set a), ((inter s s') = (inter s' s)).

Axiom union_sym :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s':set a), ((union s s') = (union s' s)).

Axiom union_empty :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s':set a), (is_empty s) -> ((union s s') = s').

Axiom union_comm :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s':set a), (is_empty s') -> ((union s s') = s).

Axiom union_members :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s':set a), forall (a1:a), (mem a1 (union s s')) ->
  ~ (mem a1 s) -> mem a1 s'.

Axiom union_members1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s':set a), forall (a1:a), (mem a1 (union s s')) ->
  ~ (mem a1 s') -> mem a1 s.

Axiom union_alt :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s':set a) (e:a), (mem e (union s s')) -> ~ (mem e s) ->
  mem e s'.

Axiom union_empty_comm :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s':set a), (is_empty s') -> ((union s s') = s).

Axiom set_subset :
  forall {a:Type} {a_WT:WhyType a},
  forall (s':set a) (s:set a), (forall (e:a), (mem e s') -> mem e s) ->
  subset s' s.

Axiom set_empty :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a), (forall (e:a), ~ (mem e s)) -> (s = (empty : set a)).

Axiom set_empty1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a), (forall (e:a), ~ (mem e s)) -> is_empty s.

Axiom get_empty :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a), (s = (empty : set a)) -> forall (e:a), ~ (mem e s).

Axiom get_empty1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a), (s = (empty : set a)) -> is_empty s.

Axiom get_non_empty :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a), ~ (is_empty s) -> exists e:a, mem e s.

Axiom set_non_empty :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a), (exists e:a, mem e s) -> ~ (is_empty s).

Axiom set_non_empty1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a), (exists e:a, mem e s) -> ((cardinal s) > 0%Z)%Z.

Axiom set_pos_card_elt :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (a1:a), (mem a1 s) -> ((cardinal s) > 0%Z)%Z.

Axiom union_add :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s':set a) (x:a), ~ (mem x s') ->
  ((union s (add x s')) = (add x (union s s'))).

Axiom union_add_mem :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s':set a) (x:a) (y:a), (mem x (add y (union s s'))) ->
  ~ (mem x s') -> ~ (mem x s) -> (x = y).

Axiom union_add_comm :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s':set a) (x:a), ~ (mem x s') ->
  ((add x (union s s')) = (union s (add x s'))).

Axiom remove_add1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (x:a), ~ (mem x s) -> ((remove x (add x s)) = s).

Axiom add_remove1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (x:a), (mem x s) -> ((add x (remove x s)) = s).

Parameter p_injective:
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b}, (a -> b) ->
  (set a) -> Prop.

Axiom p_injective_def :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a), (p_injective f s) -> forall (e:a) (e':a),
  (mem e s) -> (mem e' s) -> ~ (e = e') -> ~ ((f e) = (f e')).

Axiom p_injective_def1 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a),
  (forall (e:a) (e':a), (mem e s) -> (mem e' s) -> ~ (e = e') ->
   ~ ((f e) = (f e'))) ->
  p_injective f s.

Axiom set_map_mem :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (b1:b),
  (exists a1:a, (mem a1 s) /\ (b1 = (f a1))) -> mem b1 (map f s).

Axiom map_add :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (x:a), ~ (mem x s) ->
  ((map f (add x s)) = (add (f x) (map f s))).

Axiom map_eq :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (g:a -> b) (s:set a),
  (forall (e:a), (mem e s) -> ((f e) = (g e))) -> ((map f s) = (map g s)).

Axiom remove_mem :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (e:a) (f:a), (mem e (remove f s)) -> mem e s.

Axiom injective_map_cardinal :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a), (p_injective f s) ->
  ((cardinal (map f s)) = (cardinal s)).

Axiom set_map_mem_el :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (b1:b) (a1:a), (mem a1 s) -> (b1 = (f a1)) ->
  mem b1 (map f s).

Axiom set_map_mem_el_gen :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (b1:b),
  (exists a1:a, (mem a1 s) /\ (b1 = (f a1))) -> mem b1 (map f s).

Axiom map_antec :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (b1:b), (mem b1 (map f s)) ->
  exists a1:a, (mem a1 s) /\ (b1 = (f a1)).

Axiom map_antec_gen :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a), forall (b1:b), (mem b1 (map f s)) ->
  exists a1:a, (mem a1 s) /\ (b1 = (f a1)).

Axiom map_remove_choose :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s:set a) (f:a -> b), (p_injective f s) ->
  ((map f (remove (choose s) s)) = (remove (f (choose s)) (map f s))).

Parameter antec_set:
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b}, (set a) ->
  (a -> b) -> b -> set a.

Parameter result:
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b}, (a -> b) ->
  b -> a -> bool.

Axiom result_def :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (b1:b) (e:a),
  (((result f b1) e) = true) <-> (eq_e (f e) b1).

Axiom antec_set_def :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s:set a) (f:a -> b) (b1:b), (mem b1 (map f s)) ->
  ((antec_set s f b1) = (filter (result f b1) s)).

Parameter remove_s:
  forall {a:Type} {a_WT:WhyType a}, (set a) -> (set a) -> set a.

Parameter result1: forall {a:Type} {a_WT:WhyType a}, (set a) -> a -> bool.

Axiom result_def1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s':set a) (e:a), (((result1 s') e) = true) <-> ~ (mem e s').

Axiom remove_s_def :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s':set a), (subset s' s) ->
  ((remove_s s s') = (filter (result1 s') s)).

Axiom remove_s_spec :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s':set a), (subset s' s) -> forall (e:a),
  (mem e (remove_s s s')) -> mem e s.

Axiom remove_s_spec1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s':set a), (subset s' s) -> forall (e:a),
  (mem e (remove_s s s')) -> ~ (mem e s').

Axiom remove_s_spec2 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s':set a), (subset s' s) -> forall (e:a),
  ((mem e s) /\ ~ (mem e s')) -> mem e (remove_s s s').

Parameter remove_antecs:
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b}, (set a) ->
  (a -> b) -> b -> set a.

Axiom remove_antecs_def :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s:set a) (f:a -> b) (b1:b), (mem b1 (map f s)) ->
  ((remove_antecs s f b1) = (remove_s s (antec_set s f b1))).

Axiom remove_antecs_spec :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s:set a) (f:a -> b) (b1:b), (mem b1 (map f s)) -> forall (e:a),
  (mem e (remove_antecs s f b1)) -> mem e s.

Axiom remove_antecs_spec1 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s:set a) (f:a -> b) (b1:b), (mem b1 (map f s)) -> forall (e:a),
  (mem e (remove_antecs s f b1)) -> ~ ((f e) = b1).

Axiom remove_antecs_spec2 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s:set a) (f:a -> b) (b1:b), (mem b1 (map f s)) -> forall (e:a),
  ((mem e s) /\ ~ ((f e) = b1)) -> mem e (remove_antecs s f b1).

Axiom remove_antecs_spec3 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s:set a) (f:a -> b) (b1:b), (mem b1 (map f s)) ->
  ((cardinal (remove_antecs s f b1)) < (cardinal s))%Z.

Axiom map_remove_antec :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s:set a) (f:a -> b) (b1:b), (mem b1 (map f s)) ->
  ((map f (remove_antecs s f b1)) = (remove b1 (map f s))).

Axiom map_non_empty :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a), ((cardinal s) > 0%Z)%Z ->
  ((cardinal (map f s)) > 0%Z)%Z.

Axiom non_empty_map :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a), ((cardinal (map f s)) > 0%Z)%Z ->
  ((cardinal s) > 0%Z)%Z.

Parameter right_injections:
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b}, a -> (set b) ->
  set (a* b)%type.

Axiom right_injections_def :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (a1:a) (s:set b), (is_empty s) ->
  ((right_injections a1 s) = (empty : set (a* b)%type)).

Axiom right_injections_def1 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (a1:a) (s:set b), ~ (is_empty s) ->
  ((right_injections a1 s) =
   (add (a1, choose s) (right_injections a1 (remove (choose s) s)))).

Axiom right_injections_spec :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (a1:a) (s:set b),
  ((cardinal (right_injections a1 s)) = (cardinal s)).

Axiom right_injections_spec1 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (a1:a) (s:set b), forall (a':a), forall (b1:b),
  (mem (a', b1) (right_injections a1 s)) -> (a' = a1).

Axiom right_injections_spec2 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (a1:a) (s:set b), forall (a':a), forall (b1:b),
  (mem (a', b1) (right_injections a1 s)) -> mem b1 s.

Axiom right_injections_spec3 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (a1:a) (s:set b), forall (a':a), forall (b1:b),
  ((a' = a1) /\ (mem b1 s)) -> mem (a', b1) (right_injections a1 s).

Axiom right_injections_spec4 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (a1:a) (s:set b),
  ((right_injections a1 s) = (map (fun (b1:b) => (a1, b1)) s)).

Parameter left_injections:
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b}, (set a) -> b ->
  set (a* b)%type.

Axiom left_injections_def :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s:set a) (b1:b), (is_empty s) ->
  ((left_injections s b1) = (empty : set (a* b)%type)).

Axiom left_injections_def1 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s:set a) (b1:b), ~ (is_empty s) ->
  ((left_injections s b1) =
   (add (choose s, b1) (left_injections (remove (choose s) s) b1))).

Axiom left_injections_spec :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s:set a) (b1:b), forall (a1:a), forall (b':b),
  (mem (a1, b') (left_injections s b1)) -> mem a1 s.

Axiom left_injections_spec1 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s:set a) (b1:b), forall (a1:a), forall (b':b),
  (mem (a1, b') (left_injections s b1)) -> (b' = b1).

Axiom left_injections_spec2 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s:set a) (b1:b), forall (a1:a), forall (b':b),
  ((mem a1 s) /\ (b' = b1)) -> mem (a1, b') (left_injections s b1).

Axiom left_injections_spec3 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s:set a) (b1:b), ((cardinal (left_injections s b1)) = (cardinal s)).

Axiom left_injections_spec4 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s:set a) (b1:b),
  ((left_injections s b1) = (map (fun (a1:a) => (a1, b1)) s)).

Axiom set_map_eq :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b),
  (forall (b1:b), (mem b1 s') -> exists a1:a, (mem a1 s) /\ ((f a1) = b1)) ->
  (forall (a1:a), (mem a1 s) -> mem (f a1) s') -> ((map f s) = s').

Axiom right_injections_l :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (a1:a) (s:set b),
  ((cardinal (right_injections a1 s)) = (cardinal s)).

Axiom right_injections_l1 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (a1:a) (s:set b), forall (a':a), forall (b1:b),
  (mem (a', b1) (right_injections a1 s)) -> (a' = a1).

Axiom right_injections_l2 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (a1:a) (s:set b), forall (a':a), forall (b1:b),
  (mem (a', b1) (right_injections a1 s)) -> mem b1 s.

Axiom right_injections_l3 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (a1:a) (s:set b), forall (a':a), forall (b1:b),
  ((a' = a1) /\ (mem b1 s)) -> mem (a', b1) (right_injections a1 s).

Axiom right_injections_l4 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (a1:a) (s:set b),
  ((right_injections a1 s) = (map (fun (b1:b) => (a1, b1)) s)).

Axiom left_injections_l :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s:set a) (b1:b), forall (a1:a), forall (b':b),
  (mem (a1, b') (left_injections s b1)) -> mem a1 s.

Axiom left_injections_l1 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s:set a) (b1:b), forall (a1:a), forall (b':b),
  (mem (a1, b') (left_injections s b1)) -> (b' = b1).

Axiom left_injections_l2 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s:set a) (b1:b), forall (a1:a), forall (b':b),
  ((mem a1 s) /\ (b' = b1)) -> mem (a1, b') (left_injections s b1).

Axiom left_injections_l3 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s:set a) (b1:b), ((cardinal (left_injections s b1)) = (cardinal s)).

Axiom left_injections_l4 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s:set a) (b1:b),
  ((left_injections s b1) = (map (fun (a1:a) => (a1, b1)) s)).

Axiom disjoint_injections :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s:set a) (b1:b) (c:b), ~ (b1 = c) ->
  is_empty (inter (right_injections b1 s) (right_injections c s)).

Axiom disjoint_injections1 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s:set a) (b1:b) (c:b), ~ (b1 = c) ->
  is_empty (inter (left_injections s b1) (left_injections s c)).

Axiom induction :
  forall {a:Type} {a_WT:WhyType a},
  forall (p:(set a) -> bool) (t:set a),
  (forall (s:set a), (is_empty s) -> ((p s) = true)) ->
  (forall (s:set a), ((p s) = true) -> forall (t1:a), ~ (mem t1 s) ->
   ((p (add t1 s)) = true)) ->
  ((p t) = true).

Axiom cardinal_sum :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s':set a),
  ((cardinal (union s s')) =
   (((cardinal s) + (cardinal s'))%Z - (cardinal (inter s s')))%Z).

Axiom cardinal_eq :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s':set a), (forall (e:a), (mem e s) -> mem e s') ->
  (forall (e:a), (mem e s') -> mem e s) -> ((cardinal s) = (cardinal s')).

Axiom cardinal_sum_empty_inter :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s':set a), ((inter s s') = (empty : set a)) ->
  ((cardinal (union s s')) = ((cardinal s) + (cardinal s'))%Z).

Parameter cartesian_product:
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b}, (set a) ->
  (set b) -> set (a* b)%type.

Axiom cartesian_product_spec :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s1:set a) (s2:set b),
  ((cardinal (cartesian_product s1 s2)) = ((cardinal s1) * (cardinal s2))%Z).

Axiom cartesian_product_spec1 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s1:set a) (s2:set b), forall (a1:a), forall (b1:b),
  (mem (a1, b1) (cartesian_product s1 s2)) -> mem a1 s1.

Axiom cartesian_product_spec2 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s1:set a) (s2:set b), forall (a1:a), forall (b1:b),
  (mem (a1, b1) (cartesian_product s1 s2)) -> mem b1 s2.

Axiom cartesian_product_spec3 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s1:set a) (s2:set b), forall (a1:a), forall (b1:b),
  ((mem a1 s1) /\ (mem b1 s2)) -> mem (a1, b1) (cartesian_product s1 s2).

Axiom cartesian_product_spec4 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s1:set a) (s2:set b), forall (o:(a* b)%type),
  (mem o (cartesian_product s1 s2)) -> mem (fir o) s1.

Axiom cartesian_product_spec5 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s1:set a) (s2:set b), forall (o:(a* b)%type),
  (mem o (cartesian_product s1 s2)) -> mem (sec o) s2.

Axiom cartesian_product_spec6 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s1:set a) (s2:set b), forall (o:(a* b)%type),
  ((mem (fir o) s1) /\ (mem (sec o) s2)) -> mem o (cartesian_product s1 s2).

Parameter commute:
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b}, (a* b)%type ->
  (b* a)%type.

Axiom commute_def :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (o:(a* b)%type), forall (x:a) (x1:b), (o = (x, x1)) ->
  ((commute o) = (x1, x)).

Axiom commute_inj :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (a1:a) (a':a) (b1:b) (b':b), ~ (a1 = a') ->
  ~ ((commute (a1, b1)) = (commute (a', b'))).

Axiom commute_inj1 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (a1:a) (a':a) (b1:b) (b':b), ~ (b1 = b') ->
  ~ ((commute (a1, b1)) = (commute (a', b'))).

Axiom mem_cartesian_product :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s1:set a) (s2:set b) (a1:a) (b1:b), (mem a1 s1) -> (mem b1 s2) ->
  mem (a1, b1) (cartesian_product s1 s2).

Axiom commute_inj_gen :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s1:set a) (s2:set b),
  p_injective (fun (y0:(a* b)%type) => (commute y0))
  (cartesian_product s1 s2).

Parameter commute_product:
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b}, (set a) ->
  (set b) -> set (b* a)%type.

Axiom commute_product_def :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s1:set a) (s2:set b),
  ((commute_product s1 s2) =
   (map (fun (y0:(a* b)%type) => (commute y0)) (cartesian_product s1 s2))).

Axiom commute_product_spec :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s1:set a) (s2:set b),
  ((commute_product s1 s2) = (cartesian_product s2 s1)).

Parameter commute_product_el:
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b}, (set a) ->
  (set b) -> set (b* a)%type.

Axiom commute_product_el_def :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s1:set a) (s2:set b),
  ((commute_product_el s1 s2) =
   (map (fun (y0:(a* b)%type) => (commute y0)) (cartesian_product s1 s2))).

Axiom commute_product_el_spec :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s1:set a) (s2:set b), forall (o:(a* b)%type), forall (x:a) (x1:b),
  (o = (x, x1)) -> (mem o (cartesian_product s1 s2)) -> mem x s1.

Axiom commute_product_el_spec1 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s1:set a) (s2:set b), forall (o:(a* b)%type), forall (x:a) (x1:b),
  (o = (x, x1)) -> (mem o (cartesian_product s1 s2)) -> mem x1 s2.

Axiom commute_product_el_spec2 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s1:set a) (s2:set b), forall (o:(a* b)%type), forall (x:a) (x1:b),
  (o = (x, x1)) -> ((mem x s1) /\ (mem x1 s2)) ->
  mem o (cartesian_product s1 s2).

Axiom commute_product_el_spec3 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s1:set a) (s2:set b), forall (o:(a* b)%type), forall (x:a) (x1:b),
  (o = (x, x1)) -> ((mem x s1) /\ (mem x1 s2)) ->
  mem (x1, x) (commute_product_el s1 s2).

Axiom commute_product_el_spec4 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s1:set a) (s2:set b), forall (o:(a* b)%type), forall (x:a) (x1:b),
  (o = (x, x1)) -> (mem (x1, x) (commute_product_el s1 s2)) -> mem x s1.

Axiom commute_product_el_spec5 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s1:set a) (s2:set b), forall (o:(a* b)%type), forall (x:a) (x1:b),
  (o = (x, x1)) -> (mem (x1, x) (commute_product_el s1 s2)) -> mem x1 s2.

Axiom cartesian_product_union :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s1:set a) (s2:set b) (s3:set b),
  ((cartesian_product s1 (union s2 s3)) =
   (union (cartesian_product s1 s2) (cartesian_product s1 s3))).

Axiom cartesian_union_product :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s1:set a) (s2:set a) (s3:set b),
  ((cartesian_product (union s1 s2) s3) =
   (union (cartesian_product s1 s3) (cartesian_product s2 s3))).

Axiom cartesian_product_cardone_r :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s1:set a) (s2:set b), ((cardinal s1) = 1%Z) ->
  infix_eqeq (cartesian_product s1 s2) (right_injections (choose s1) s2).

Axiom cartesian_product_cardone_r1 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s1:set a) (s2:set b), ((cardinal s1) = 1%Z) ->
  infix_eqeq (cartesian_product s1 s2)
  (map (fun (e2:b) => (choose s1, e2)) s2).

Axiom cartesian_product_cardone_l :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s1:set a) (s2:set b), ((cardinal s2) = 1%Z) ->
  infix_eqeq (cartesian_product s1 s2) (left_injections s1 (choose s2)).

Axiom cartesian_product_cardone_l1 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s1:set a) (s2:set b), ((cardinal s2) = 1%Z) ->
  infix_eqeq (cartesian_product s1 s2)
  (map (fun (e1:a) => (e1, choose s2)) s1).

Axiom disjoint_cartesian_product_l :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s1:set a) (s2:set a) (s3:set b),
  ((inter s1 s2) = (empty : set a)) ->
  ((inter (cartesian_product s1 s3) (cartesian_product s2 s3)) =
   (empty : set (a* b)%type)).

Axiom disjoint_cartesian_product_r :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s1:set a) (s2:set b) (s3:set b),
  ((inter s2 s3) = (empty : set b)) ->
  ((inter (cartesian_product s1 s2) (cartesian_product s1 s3)) =
   (empty : set (a* b)%type)).

Parameter iter_union:
  forall {a:Type} {a_WT:WhyType a}, (set (set a)) -> set a.

Axiom iter_union_def :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set (set a)), (is_empty s) -> ((iter_union s) = (empty : set a)).

Axiom iter_union_def1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set (set a)), ~ (is_empty s) ->
  ((iter_union s) = (union (choose s) (iter_union (remove (choose s) s)))).

Axiom get_mem_union :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s':set a) (e:a), (mem e (union s s')) -> ~ (mem e s') ->
  mem e s.

Axiom get_mem_union' :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s':set a) (e:a), (mem e (union s s')) -> ~ (mem e s) ->
  mem e s'.

Axiom set_mem_union :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s':set a) (e:a), (mem e s) -> mem e (union s s').

Axiom set_mem_union' :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s':set a) (e:a), (mem e s') -> mem e (union s s').

Parameter op_neutral_left:
  forall {im1:Type} {im1_WT:WhyType im1}, (im1 -> im1 -> im1) -> im1 -> Prop.

Axiom op_neutral_left_def :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (neutral:im1),
  (op_neutral_left op1 neutral) -> forall (e:im1), (((op1 neutral) e) = e).

Axiom op_neutral_left_def1 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (neutral:im1),
  (forall (e:im1), (((op1 neutral) e) = e)) -> op_neutral_left op1 neutral.

Parameter op_neutral_right:
  forall {im1:Type} {im1_WT:WhyType im1}, (im1 -> im1 -> im1) -> im1 -> Prop.

Axiom op_neutral_right_def :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (neutral:im1),
  (op_neutral_right op1 neutral) -> forall (e:im1), (((op1 e) neutral) = e).

Axiom op_neutral_right_def1 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (neutral:im1),
  (forall (e:im1), (((op1 e) neutral) = e)) -> op_neutral_right op1 neutral.

Parameter op_assoc:
  forall {im1:Type} {im1_WT:WhyType im1}, (im1 -> im1 -> im1) -> Prop.

Axiom op_assoc_def :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1), (op_assoc op1) ->
  forall (a:im1) (b:im1) (c:im1),
  (((op1 ((op1 a) b)) c) = ((op1 a) ((op1 b) c))).

Axiom op_assoc_def1 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1),
  (forall (a:im1) (b:im1) (c:im1),
   (((op1 ((op1 a) b)) c) = ((op1 a) ((op1 b) c)))) ->
  op_assoc op1.

Parameter op_neutral_left_comm:
  forall {im1:Type} {im1_WT:WhyType im1}, (im1 -> im1 -> im1) -> im1 -> Prop.

Axiom op_neutral_left_comm_def :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (neutral:im1),
  (op_neutral_left_comm op1 neutral) -> forall (a:im1),
  (forall (b:im1), (((op1 a) b) = b)) -> (a = neutral).

Axiom op_neutral_left_comm_def1 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (neutral:im1),
  (forall (a:im1), (forall (b:im1), (((op1 a) b) = b)) -> (a = neutral)) ->
  op_neutral_left_comm op1 neutral.

Parameter commut:
  forall {im1:Type} {im1_WT:WhyType im1}, (im1 -> im1 -> im1) -> Prop.

Axiom commut_def :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1), (commut op1) -> forall (a:im1) (b:im1),
  (((op1 a) b) = ((op1 b) a)).

Axiom commut_def1 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1),
  (forall (a:im1) (b:im1), (((op1 a) b) = ((op1 b) a))) -> commut op1.

Parameter assoc:
  forall {im1:Type} {im1_WT:WhyType im1}, (im1 -> im1 -> im1) -> Prop.

Axiom assoc_def :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1), (assoc op1) ->
  forall (a:im1) (b:im1) (c:im1),
  (((op1 ((op1 a) b)) c) = ((op1 a) ((op1 b) c))).

Axiom assoc_def1 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1),
  (forall (a:im1) (b:im1) (c:im1),
   (((op1 ((op1 a) b)) c) = ((op1 a) ((op1 b) c)))) ->
  assoc op1.

Parameter opposite_n:
  forall {im1:Type} {im1_WT:WhyType im1}, (im1 -> im1 -> im1) ->
  (im1 -> im1 -> im1) -> im1 -> Prop.

Axiom opposite_n_def :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (po1:im1 -> im1 -> im1) (neutral:im1),
  (opposite_n op1 po1 neutral) -> forall (a:im1), (((po1 a) a) = neutral).

Axiom opposite_n_def1 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (po1:im1 -> im1 -> im1) (neutral:im1),
  (forall (a:im1), (((po1 a) a) = neutral)) -> opposite_n op1 po1 neutral.

Parameter inverse:
  forall {im1:Type} {im1_WT:WhyType im1}, (im1 -> im1 -> im1) ->
  (im1 -> im1 -> im1) -> (im1 -> im1) -> Prop.

Axiom inverse_def :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (po1:im1 -> im1 -> im1) (inver1:im1 -> im1),
  (inverse op1 po1 inver1) -> forall (a:im1) (b:im1),
  (((po1 a) b) = ((op1 a) (inver1 b))).

Axiom inverse_def1 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (po1:im1 -> im1 -> im1) (inver1:im1 -> im1),
  (forall (a:im1) (b:im1), (((po1 a) b) = ((op1 a) (inver1 b)))) ->
  inverse op1 po1 inver1.

Parameter opposite1:
  forall {im1:Type} {im1_WT:WhyType im1}, (im1 -> im1 -> im1) ->
  (im1 -> im1 -> im1) -> Prop.

Axiom opposite_def :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (po1:im1 -> im1 -> im1),
  (opposite1 op1 po1) -> forall (a:im1) (b:im1), (((op1 ((po1 a) b)) b) = a).

Axiom opposite_def1 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (po1:im1 -> im1 -> im1),
  (forall (a:im1) (b:im1), (((op1 ((po1 a) b)) b) = a)) -> opposite1 op1 po1.

Parameter opposite_com:
  forall {im1:Type} {im1_WT:WhyType im1}, (im1 -> im1 -> im1) ->
  (im1 -> im1 -> im1) -> Prop.

Axiom opposite_com_def :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (po1:im1 -> im1 -> im1),
  (opposite_com op1 po1) -> forall (a:im1) (b:im1),
  (((po1 ((op1 a) b)) b) = a).

Axiom opposite_com_def1 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (po1:im1 -> im1 -> im1),
  (forall (a:im1) (b:im1), (((po1 ((op1 a) b)) b) = a)) ->
  opposite_com op1 po1.

Axiom refl :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (a:im1) (b:im1), (commut op1) ->
  (((op1 a) b) = ((op1 b) a)).

Parameter neutral:
  forall {im1:Type} {im1_WT:WhyType im1}, (im1 -> im1 -> im1) -> im1 -> Prop.

Axiom neutral_def :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (neut:im1), (neutral op1 neut) ->
  op_neutral_left op1 neut.

Axiom neutral_def1 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (neut:im1), (neutral op1 neut) ->
  op_neutral_right op1 neut.

Axiom neutral_def2 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (neut:im1), (neutral op1 neut) ->
  op_assoc op1.

Axiom neutral_def3 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (neut:im1),
  ((op_neutral_left op1 neut) /\
   ((op_neutral_right op1 neut) /\ (op_assoc op1))) ->
  neutral op1 neut.

Axiom set_neutral :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (neut:im1), (op_neutral_left op1 neut) ->
  (op_neutral_right op1 neut) -> (op_assoc op1) -> neutral op1 neut.

Parameter has_neutral:
  forall {im1:Type} {im1_WT:WhyType im1}, (im1 -> im1 -> im1) -> Prop.

Axiom has_neutral_def :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1), (has_neutral op1) ->
  exists e:im1, neutral op1 e.

Axiom has_neutral_def1 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1), (exists e:im1, neutral op1 e) ->
  has_neutral op1.

Parameter iterates:
  forall {im1:Type} {im1_WT:WhyType im1}, (im1 -> im1 -> im1) -> im1 -> Prop.

Axiom iterates_def :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (neutral1:im1), (iterates op1 neutral1) ->
  op_neutral_left op1 neutral1.

Axiom iterates_def1 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (neutral1:im1), (iterates op1 neutral1) ->
  op_neutral_right op1 neutral1.

Axiom iterates_def2 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (neutral1:im1), (iterates op1 neutral1) ->
  op_assoc op1.

Axiom iterates_def3 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (neutral1:im1),
  ((op_neutral_left op1 neutral1) /\
   ((op_neutral_right op1 neutral1) /\ (op_assoc op1))) ->
  iterates op1 neutral1.

Parameter iterable:
  forall {im1:Type} {im1_WT:WhyType im1}, (im1 -> im1 -> im1) -> Prop.

Axiom iterable_def :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1), (iterable op1) ->
  exists e:im1, iterates op1 e.

Axiom iterable_def1 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1), (exists e:im1, iterates op1 e) ->
  iterable op1.

Axiom iterates_ :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (neutral1:im1),
  (op_neutral_left op1 neutral1) -> (op_neutral_right op1 neutral1) ->
  (op_assoc op1) -> iterates op1 neutral1.

Axiom iterates_1 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (neutral1:im1),
  (op_neutral_left op1 neutral1) -> (op_neutral_right op1 neutral1) ->
  (op_assoc op1) -> iterable op1.

Parameter neutral_elt:
  forall {im1:Type} {im1_WT:WhyType im1}, (im1 -> im1 -> im1) -> im1.

Axiom neutral_elt_spec :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1), forall (e:im1), (neutral op1 e) ->
  ((neutral_elt op1) = e).

Axiom neutral_elt_spec1 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1), forall (e:im1), ((neutral_elt op1) = e) ->
  neutral op1 e.

Parameter inverse_tuple:
  forall {im1:Type} {im1_WT:WhyType im1}, (im1 -> im1 -> im1) ->
  (im1 -> im1 -> im1) -> im1 -> Prop.

Axiom inverse_tuple_def :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (po1:im1 -> im1 -> im1) (neutral1:im1),
  (inverse_tuple op1 po1 neutral1) -> opposite_n op1 po1 neutral1.

Axiom inverse_tuple_def1 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (po1:im1 -> im1 -> im1) (neutral1:im1),
  (inverse_tuple op1 po1 neutral1) -> opposite1 op1 po1.

Axiom inverse_tuple_def2 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (po1:im1 -> im1 -> im1) (neutral1:im1),
  (inverse_tuple op1 po1 neutral1) -> opposite_com op1 po1.

Axiom inverse_tuple_def3 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (po1:im1 -> im1 -> im1) (neutral1:im1),
  ((opposite_n op1 po1 neutral1) /\
   ((opposite1 op1 po1) /\ (opposite_com op1 po1))) ->
  inverse_tuple op1 po1 neutral1.

Parameter iterate:
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  (im1 -> im1 -> im1) -> (set a) -> (a -> im1) -> im1.

Axiom Iterate_def_empty :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1), forall (s:set a), forall (f:a -> im1),
  (commut op1) -> (iterable op1) -> (is_empty s) ->
  ((iterate op1 (empty : set a) f) = (neutral_elt op1)).

Axiom Iterate_one :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1), forall (s:set a), forall (f:a -> im1),
  forall (x:a), (is_empty s) -> (commut op1) ->
  ((iterate op1 (add x s) f) = (f x)).

Axiom Iterate_add :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1), forall (s:set a), forall (f:a -> im1),
  forall (x:a), ((cardinal s) > 0%Z)%Z -> (commut op1) -> ~ (mem x s) ->
  ((iterate op1 (add x s) f) = ((op1 (f x)) (iterate op1 s f))).

Axiom minus_zero :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (po1:im1 -> im1 -> im1) (a:im1),
  (iterable op1) -> (inverse_tuple op1 po1 (neutral_elt op1)) ->
  (((po1 a) (neutral_elt op1)) = a).

Axiom unic :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (po1:im1 -> im1 -> im1) (a:im1) (b:im1)
    (c:im1),
  (iterable op1) -> (commut op1) -> (((op1 a) b) = ((op1 a) c)) ->
  (inverse_tuple op1 po1 (neutral_elt op1)) -> (b = c).

Axiom substract_comm :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (po1:im1 -> im1 -> im1) (a:im1) (b:im1),
  (iterable op1) -> (commut op1) ->
  (inverse_tuple op1 po1 (neutral_elt op1)) -> (((po1 ((op1 a) b)) a) = b).

Axiom substract_comm1 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (po1:im1 -> im1 -> im1) (a:im1) (b:im1),
  (iterable op1) -> (commut op1) ->
  (inverse_tuple op1 po1 (neutral_elt op1)) -> (((po1 ((op1 b) a)) a) = b).

Axiom substract_comm2 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (po1:im1 -> im1 -> im1) (a:im1) (b:im1)
    (c:im1),
  (iterable op1) -> (commut op1) ->
  (inverse_tuple op1 po1 (neutral_elt op1)) ->
  (((po1 a) ((po1 b) c)) = ((op1 ((po1 a) b)) c)).

Axiom substract_comm3 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (po1:im1 -> im1 -> im1) (a:im1) (b:im1)
    (c:im1),
  (iterable op1) -> (commut op1) ->
  (inverse_tuple op1 po1 (neutral_elt op1)) ->
  (((po1 ((op1 a) b)) c) = ((op1 a) ((po1 b) c))).

Parameter int_iterate:
  forall {im1:Type} {im1_WT:WhyType im1}, (im1 -> im1 -> im1) ->
  (Z -> im1) -> Z -> Z -> im1.

Axiom int_iterate_def :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (f:Z -> im1) (i:Z) (j:Z), ~ (j <= i)%Z ->
  (j <= i)%Z -> ((int_iterate op1 f i j) = (neutral_elt op1)).

Axiom int_iterate_def1 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (f:Z -> im1) (i:Z) (j:Z), ~ (j <= i)%Z ->
  ~ (j <= i)%Z -> (j = (i + 1%Z)%Z) -> ((int_iterate op1 f i j) = (f i)).

Axiom int_iterate_def2 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (f:Z -> im1) (i:Z) (j:Z), ~ (j <= i)%Z ->
  ~ (j <= i)%Z -> ~ (j = (i + 1%Z)%Z) ->
  ((int_iterate op1 f i j) = ((op1 (f i)) (int_iterate op1 f (i + 1%Z)%Z j))).

Axiom int_iterate_def3 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (f:Z -> im1) (i:Z) (j:Z), (iterable op1) ->
  (j <= i)%Z -> ((int_iterate op1 f i j) = (neutral_elt op1)).

Axiom int_iterate_def4 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (f:Z -> im1) (i:Z) (j:Z), (iterable op1) ->
  ~ (j <= i)%Z -> (j = (i + 1%Z)%Z) -> ((int_iterate op1 f i j) = (f i)).

Axiom int_iterate_def5 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (f:Z -> im1) (i:Z) (j:Z), (iterable op1) ->
  ~ (j <= i)%Z -> ~ (j = (i + 1%Z)%Z) ->
  ((int_iterate op1 f i j) = ((op1 (f i)) (int_iterate op1 f (i + 1%Z)%Z j))).

Axiom int_iterate_spec :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (f:Z -> im1) (i:Z) (j:Z), ~ (j <= i)%Z ->
  (j <= i)%Z -> ((int_iterate op1 f i j) = (neutral_elt op1)).

Axiom int_iterate_spec1 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (f:Z -> im1) (i:Z) (j:Z), ~ (j <= i)%Z ->
  (j = (i + 1%Z)%Z) ->
  ((int_iterate op1 f i j) = ((op1 (f i)) (neutral_elt op1))).

Axiom int_iterate_spec2 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (f:Z -> im1) (i:Z) (j:Z), (iterable op1) ->
  (j <= i)%Z -> ((int_iterate op1 f i j) = (neutral_elt op1)).

Axiom int_iterate_spec3 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (f:Z -> im1) (i:Z) (j:Z), (iterable op1) ->
  (j = (i + 1%Z)%Z) ->
  ((int_iterate op1 f i j) = ((op1 (f i)) (neutral_elt op1))).

Parameter int_int_iterate:
  forall {im1:Type} {im1_WT:WhyType im1}, (im1 -> im1 -> im1) ->
  (Z -> Z -> im1) -> Z -> Z -> Z -> Z -> im1.

Axiom int_int_iterate_def :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (f:Z -> Z -> im1) (i:Z) (j:Z) (k:Z) (l:Z),
  (iterable op1) -> (j <= i)%Z ->
  ((int_int_iterate op1 f i j k l) = (neutral_elt op1)).

Axiom int_int_iterate_def1 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (f:Z -> Z -> im1) (i:Z) (j:Z) (k:Z) (l:Z),
  (iterable op1) -> ~ (j <= i)%Z ->
  ((int_int_iterate op1 f i j k l) =
   ((op1 (int_iterate op1 (f i) k l))
    (int_int_iterate op1 f (i + 1%Z)%Z j k l))).

Parameter to_set: forall {a:Type} {a_WT:WhyType a}, a -> set a.

Axiom to_set_def :
  forall {a:Type} {a_WT:WhyType a},
  forall (e:a), ((to_set e) = (add e (empty : set a))).

Axiom to_set_spec :
  forall {a:Type} {a_WT:WhyType a},
  forall (e:a), forall (b:a), (b = e) -> mem b (to_set e).

Axiom to_set_spec1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (e:a), ((cardinal (to_set e)) = 1%Z).

Axiom to_set_spec2 :
  forall {a:Type} {a_WT:WhyType a},
  forall (e:a), forall (b:a), (mem b (to_set e)) -> (b = e).

Parameter to_fset: Z -> Z -> set Z.

Axiom to_fset_spec :
  forall (i:Z) (j:Z), (i < j)%Z -> ((cardinal (to_fset i j)) = (j - i)%Z).

Axiom to_fset_spec1 :
  forall (i:Z) (j:Z), (j <= i)%Z -> is_empty (to_fset i j).

Axiom to_fset_spec2 :
  forall (i:Z) (j:Z), forall (k:Z), (mem k (to_fset i j)) -> (i <= k)%Z.

Axiom to_fset_spec3 :
  forall (i:Z) (j:Z), forall (k:Z), (mem k (to_fset i j)) -> (k < j)%Z.

Axiom to_fset_spec4 :
  forall (i:Z) (j:Z), forall (k:Z), ((i <= k)%Z /\ (k < j)%Z) ->
  mem k (to_fset i j).

Axiom to_fset_bounds :
  forall (i:Z) (k:Z) (j:Z), (i < j)%Z -> (mem k (to_fset i j)) -> (i <= k)%Z.

Axiom to_fset_bounds1 :
  forall (i:Z) (k:Z) (j:Z), (i < j)%Z -> (mem k (to_fset i j)) -> (k < j)%Z.

Axiom to_fset_unit_ext :
  forall (i:Z) (j:Z), (i < j)%Z ->
  ((to_fset i j) = (add i (to_fset (i + 1%Z)%Z j))).

Axiom to_fset_ext :
  forall (i:Z) (i':Z) (j:Z), ((i <= i')%Z /\ (i' <= j)%Z) ->
  ((to_fset i j) = (union (to_fset i i') (to_fset i' j))).

Axiom card_fset :
  forall (n:Z), (0%Z <= n)%Z -> ((cardinal (to_fset 0%Z n)) = n).

Axiom set_mem_to_fset :
  forall (i:Z) (k:Z) (j:Z), ((i <= k)%Z /\ (k < j)%Z) -> mem k (to_fset i j).

Parameter element: forall {a:Type} {a_WT:WhyType a}, (set a) -> a.

Axiom element_def :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a), ((cardinal s) = 1%Z) -> ((element s) = (choose s)).

Axiom cardone :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (a1:a), (forall (b:a), (mem b s) <-> (b = a1)) ->
  ((cardinal s) > 0%Z)%Z -> ((cardinal s) = 1%Z).

Axiom cardone1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (a1:a), (forall (b:a), (mem b s) <-> (b = a1)) ->
  ((cardinal s) > 0%Z)%Z -> ((element s) = a1).

Axiom set_cardone :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a), ((cardinal s) > 0%Z)%Z ->
  (exists a1:a, forall (b:a), (mem b s) <-> (b = a1)) -> ((cardinal s) = 1%Z).

Axiom get_cardone :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a), ((cardinal s) = 1%Z) ->
  exists a1:a, forall (b:a), (mem b s) <-> (b = a1).

Axiom get_cardone_elt :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (e:a), ((cardinal s) = 1%Z) -> (mem e s) ->
  (e = (element s)).

Axiom set_cardone_elt :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (a1:a), (forall (b:a), (mem b s) <-> (b = a1)) ->
  ((cardinal s) = 1%Z).

Axiom set_cardone_elt1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (a1:a), (forall (b:a), (mem b s) <-> (b = a1)) ->
  ((element s) = a1).

Axiom set_cardone_elt_ :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (a1:a), (forall (b:a), (mem b s) <-> (b = a1)) ->
  ((cardinal s) = 1%Z).

Axiom cardzero :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a), (forall (b:a), ~ (mem b s)) -> ((cardinal s) = 0%Z).

Axiom get_choose_cardone :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (e:a), ((cardinal s) = 1%Z) -> (mem e s) ->
  ((choose s) = e).

Parameter p_injective_in:
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b}, (a -> b) ->
  (set a) -> (set b) -> Prop.

Axiom p_injective_in_def :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b), (p_injective_in f s s') ->
  forall (e:a), (mem e s) -> mem (f e) s'.

Axiom p_injective_in_def1 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b), (p_injective_in f s s') ->
  forall (e:a), (mem e s) -> forall (e1:a) (e':a), (mem e1 s) ->
  (mem e' s) -> ~ (e1 = e') -> ~ ((f e1) = (f e')).

Axiom p_injective_in_def2 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b),
  (forall (e:a), (mem e s) ->
   (mem (f e) s') /\
   forall (e1:a) (e':a), (mem e1 s) -> (mem e' s) -> ~ (e1 = e') ->
   ~ ((f e1) = (f e'))) ->
  p_injective_in f s s'.

Parameter equal_func:
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b}, (a -> b) ->
  (a -> b) -> Prop.

Axiom equal_func_def :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (g:a -> b), (equal_func f g) -> forall (e:a),
  ((f e) = (g e)).

Axiom equal_func_def1 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (g:a -> b), (forall (e:a), ((f e) = (g e))) ->
  equal_func f g.

Axiom set_equal_func :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (g:a -> b), (forall (e:a), ((f e) = (g e))) -> (f = g).

Axiom get_equal_func :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (g:a -> b), (equal_func f g) -> forall (e:a),
  ((f e) = (g e)).

Axiom set_injective :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a),
  (forall (e:a) (e':a), (mem e s) -> (mem e' s) -> ~ (e = e') ->
   ~ ((f e) = (f e'))) ->
  p_injective f s.

Parameter image:
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b}, (a -> b) ->
  (set a) -> set b.

Axiom image_def :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a), ((image f s) = (map f s)).

Axiom image_spec :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a), forall (a1:b), (mem a1 (image f s)) ->
  exists antec_a:a, (mem antec_a s) /\ (a1 = (f antec_a)).

Axiom image_spec1 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a), forall (a1:b),
  (exists antec_a:a, (mem antec_a s) /\ (a1 = (f antec_a))) ->
  mem a1 (image f s).

Axiom card_image :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a), ((cardinal (image f s)) <= (cardinal s))%Z.

Axiom card_image_injective :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a), (p_injective f s) ->
  ((cardinal (image f s)) = (cardinal s)).

Axiom get_injective :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a), (p_injective f s) -> forall (e:a) (e':a),
  (mem e s) -> (mem e' s) -> ~ (e = e') -> ~ ((f e) = (f e')).

Axiom get_not_injective :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a), ~ (p_injective f s) ->
  exists e:a, exists e':a,
  (mem e s) /\ ((mem e' s) /\ (~ (e = e') /\ ((f e) = (f e')))).

Axiom set_injective_in :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b),
  (forall (e:a), (mem e s) -> mem (f e) s') ->
  (forall (e:a) (e':a), (mem e s) -> (mem e' s) -> ~ (e = e') ->
   ~ ((f e) = (f e'))) ->
  p_injective f s.

Axiom get_injective_in :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b), (p_injective_in f s s') ->
  forall (e:a), (mem e s) -> mem (f e) s'.

Axiom get_injective_in1 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b), (p_injective_in f s s') ->
  forall (e:a) (e':a), (mem e s) -> (mem e' s) -> ~ (e = e') ->
  ~ ((f e) = (f e')).

Parameter p_surjective:
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b}, (a -> b) ->
  (set a) -> (set b) -> Prop.

Axiom p_surjective_def :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b), (p_surjective f s s') ->
  forall (e:a), (mem e s) -> mem (f e) s'.

Axiom p_surjective_def1 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b), (p_surjective f s s') ->
  forall (e':b), (mem e' s') -> exists e:a, (mem e s) /\ ((f e) = e').

Axiom p_surjective_def2 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b),
  ((forall (e:a), (mem e s) -> mem (f e) s') /\
   forall (e':b), (mem e' s') -> exists e:a, (mem e s) /\ ((f e) = e')) ->
  p_surjective f s s'.

Axiom set_surjective :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b),
  (forall (e:a), (mem e s) -> mem (f e) s') ->
  (forall (e':b), (mem e' s') -> exists e:a, (mem e s) /\ ((f e) = e')) ->
  p_surjective f s s'.

Axiom get_surjective :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b), (p_surjective f s s') ->
  forall (e:a), (mem e s) -> mem (f e) s'.

Axiom get_surjective1 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b), (p_surjective f s s') ->
  forall (e':b), (mem e' s') -> exists e:a, (mem e s) /\ ((f e) = e').

Axiom image_surjective :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b), (p_surjective f s s') ->
  ((image f s) = s').

Parameter p_bijective:
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b}, (a -> b) ->
  (set a) -> (set b) -> Prop.

Axiom p_bijective_def :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b), (p_bijective f s s') ->
  p_injective_in f s s'.

Axiom p_bijective_def1 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b), (p_bijective f s s') ->
  p_surjective f s s'.

Axiom p_bijective_def2 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b),
  ((p_injective_in f s s') /\ (p_surjective f s s')) -> p_bijective f s s'.

Axiom bijective_is_injective :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b), (p_bijective f s s') ->
  p_injective f s.

Axiom bijective_is_surjective :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b), (p_bijective f s s') ->
  p_surjective f s s'.

Axiom set_bijective :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b),
  (forall (e:a), (mem e s) -> mem (f e) s') ->
  (forall (e:a) (e':a), (mem e s) -> (mem e' s) -> ~ (e = e') ->
   ~ ((f e) = (f e'))) ->
  (forall (e':b), (mem e' s') -> exists e:a, (mem e s) /\ ((f e) = e')) ->
  p_bijective f s s'.

Axiom set_bijective1 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b),
  (forall (e:a), (mem e s) -> mem (f e) s') ->
  (forall (e:a) (e':a), (mem e s) -> (mem e' s) -> ~ (e = e') ->
   ~ ((f e) = (f e'))) ->
  (forall (e':b), (mem e' s') -> exists e:a, (mem e s) /\ ((f e) = e')) ->
  ((map f s) = s').

Axiom bijectivity_is_transitive :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b}
    {c:Type} {c_WT:WhyType c},
  forall (f:a -> b) (g:b -> c) (s:set a) (s':set b) (s'':set c),
  (p_bijective f s s') -> (p_bijective g s' s'') ->
  p_bijective (fun (k:a) => (g (f k))) s s''.

Axiom bijective_image :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b), (p_bijective f s s') ->
  ((cardinal s) = (cardinal s')).

Axiom bijective_image1 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b), (p_bijective f s s') ->
  (s' = (image f s)).

Axiom get_bijective :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b), (p_bijective f s s') ->
  forall (e:a), (mem e s) -> mem (f e) s'.

Axiom get_bijective1 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b), (p_bijective f s s') ->
  forall (e:a) (e':a), (mem e s) -> (mem e' s) -> ~ (e = e') ->
  ~ ((f e) = (f e')).

Axiom get_bijective2 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b), (p_bijective f s s') ->
  forall (e':b), (mem e' s') -> exists e:a, (mem e s) /\ ((f e) = e').

Axiom get_bijective3 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b), (p_bijective f s s') ->
  ((cardinal s) = (cardinal s')).

Axiom bijective_eq :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (g:a -> b) (s:set a) (s':set b), (p_bijective f s s') ->
  (forall (e:a), (mem e s) -> ((f e) = (g e))) -> p_bijective g s s'.

Axiom bijective_eq_gen :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b), (p_bijective f s s') ->
  forall (g:a -> b), (forall (e:a), (mem e s) -> ((f e) = (g e))) ->
  p_bijective g s s'.

Axiom bij_equal_card :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a), ((cardinal s) = (cardinal (map f s))) ->
  p_bijective f s (map f s).

Axiom set_bijective_auto :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:a -> a) (s:set a), (forall (e:a), (mem e s) -> mem (f e) s) ->
  (forall (e':a), (mem e' s) -> exists e:a, (mem e s) /\ ((f e) = e')) ->
  p_bijective f s s.

Axiom iterate_empty :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s:set a) (t:a -> im1), (is_empty s) ->
  (commut op1) -> (iterable op1) -> ((iterate op1 s t) = (neutral_elt op1)).

Axiom iterate_one :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s:set a) (t:a -> im1),
  ((cardinal s) = 1%Z) -> (commut op1) ->
  ((iterate op1 s t) = (t (choose s))).

Axiom iterate_add :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s:set a) (f:a -> im1) (x:a),
  (commut op1) -> (iterable op1) -> ~ (mem x s) ->
  ((iterate op1 (add x s) f) = ((op1 (f x)) (iterate op1 s f))).

Axiom iterate_add_ :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s:set a) (f:a -> im1) (x:a),
  (commut op1) -> ~ (mem x s) -> ~ (is_empty s) ->
  ((iterate op1 (add x s) f) = ((op1 (f x)) (iterate op1 s f))).

Axiom iterate_remove :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s:set a) (f:a -> im1) (x:a),
  (commut op1) -> (iterable op1) ->
  (inverse_tuple op1 (fun (y0:im1) (y1:im1) => (po y0 y1)) (neutral_elt op1)) ->
  (mem x s) -> ((iterate op1 (remove x s) f) = (po (iterate op1 s f) (f x))).

Axiom iterate_def_choose :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s:set a) (f:a -> im1),
  ~ ((cardinal s) = 1%Z) -> (commut op1) -> ~ (is_empty s) ->
  ((iterate op1 s f) =
   ((op1 (f (choose s))) (iterate op1 (remove (choose s) s) f))).

Axiom iterate_def_choose1 :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s:set a) (f:a -> im1), (iterable op1) ->
  (commut op1) -> ~ (is_empty s) ->
  ((iterate op1 s f) =
   ((op1 (f (choose s))) (iterate op1 (remove (choose s) s) f))).

Axiom choose_any :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s:set a) (f:a -> im1) (t:a),
  (iterable op1) -> (commut op1) -> (mem t s) ->
  ((iterate op1 s f) = ((op1 (f t)) (iterate op1 (remove t s) f))).

Axiom iterate_comp_iterate :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s1:set a) (f:a -> im1) (g:a -> im1),
  (iterable op1) -> (commut op1) -> (assoc op1) ->
  ((iterate op1 s1 (fun (k:a) => ((op1 (f k)) (g k)))) =
   ((op1 (iterate op1 s1 (fun (k:a) => (f k))))
    (iterate op1 s1 (fun (k:a) => (g k))))).

Axiom iterate_comp_iterate_com :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s1:set a) (f:a -> im1) (g:a -> im1),
  (iterable op1) -> (commut op1) ->
  (((op1 (iterate op1 s1 (fun (k:a) => (f k))))
    (iterate op1 s1 (fun (k:a) => (g k))))
   = (iterate op1 s1 (fun (k:a) => ((op1 (f k)) (g k))))).

Axiom iterate_transitivity :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (po1:im1 -> im1 -> im1) (s1:set a)
    (s2:set a) (f:a -> im1),
  (iterable op1) -> (commut op1) ->
  (inverse_tuple op1 po1 (neutral_elt op1)) ->
  ((iterate op1 (union s1 s2) f) =
   ((po1 ((op1 (iterate op1 s1 f)) (iterate op1 s2 f)))
    (iterate op1 (inter s1 s2) f))).

Axiom iterate_disjoint_transitivity :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s1:set a) (s2:set a) (t:a -> im1),
  (iterable op1) -> (commut op1) -> ((inter s1 s2) = (empty : set a)) ->
  ((iterate op1 (union s1 s2) t) =
   ((op1 (iterate op1 s1 t)) (iterate op1 s2 t))).

Axiom iterate_eq :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s:set a) (f:a -> im1) (g:a -> im1),
  (forall (x:a), (mem x s) -> ((f x) = (g x))) -> (commut op1) ->
  ~ (is_empty s) -> ((iterate op1 s f) = (iterate op1 s g)).

Axiom iterate_eq1 :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s:set a) (f:a -> im1) (g:a -> im1),
  (forall (x:a), (mem x s) -> ((f x) = (g x))) -> (commut op1) ->
  (iterable op1) -> ((iterate op1 s f) = (iterate op1 s g)).

Axiom iterate_map :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b}
    {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s:set b) (f:b -> a) (t:a -> im1),
  ~ (is_empty s) -> (commut op1) -> (p_injective f s) ->
  ((iterate op1 (map f s) t) = (iterate op1 s (fun (b1:b) => (t (f b1))))).

Axiom iterate_map1 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b}
    {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s:set b) (f:b -> a) (t:a -> im1),
  (iterable op1) -> (commut op1) -> (p_injective f s) ->
  ((iterate op1 (map f s) t) = (iterate op1 s (fun (b1:b) => (t (f b1))))).

Axiom iterate_cardone :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s:set a) (t:a -> im1), (iterable op1) ->
  (commut op1) -> ((cardinal s) = 1%Z) ->
  ((iterate op1 s t) = (t (element s))).

Axiom iterate_cardzero :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s:set a) (t:a -> im1), (commut op1) ->
  (iterable op1) -> ((cardinal s) = 0%Z) ->
  ((iterate op1 s t) = (neutral_elt op1)).

Axiom injec_iterate :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b}
    {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (a1:a) (s:set b) (f:a -> b -> im1),
  (iterable op1) -> (commut op1) ->
  ((iterate op1 s (f a1)) =
   (iterate op1 (cartesian_product (to_set a1) s)
    (fun (o:(a* b)%type) => ((f (fir o)) (sec o))))).

Axiom iterate_cartesian_product :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b}
    {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s1:set a) (s2:set b) (f:a -> b -> im1),
  (iterable op1) -> (commut op1) ->
  ((iterate op1 s1 (fun (a1:a) => (iterate op1 s2 (f a1)))) =
   (iterate op1 (cartesian_product s1 s2)
    (fun (o:(a* b)%type) => ((f (fir o)) (sec o))))).

Axiom iterate_eq_func :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s:set a) (f1:a -> im1) (f2:a -> im1),
  (commut op1) -> (iterable op1) -> (p_injective f1 s) ->
  (p_injective f2 s) -> ((map f1 s) = (map f2 s)) ->
  ((iterate op1 s f1) = (iterate op1 s f2)).

Axiom int_iterate_def_empty :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (f:Z -> im1) (i:Z) (j:Z), (j <= i)%Z ->
  (iterable op1) -> ((int_iterate op1 f i j) = (neutral_elt op1)).

Axiom int_iterate_def_plus_one :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (f:Z -> im1) (i:Z) (j:Z), (i < j)%Z ->
  ~ ((i + 1%Z)%Z = j) ->
  ((int_iterate op1 f i j) = ((op1 (f i)) (int_iterate op1 f (i + 1%Z)%Z j))).

Axiom int_iterate_def_plus_one1 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (f:Z -> im1) (i:Z) (j:Z), (i < j)%Z ->
  (iterable op1) ->
  ((int_iterate op1 f i j) = ((op1 (f i)) (int_iterate op1 f (i + 1%Z)%Z j))).

Axiom int_iterate_cardone :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (f:Z -> im1) (i:Z) (j:Z),
  (j = (i + 1%Z)%Z) -> ((int_iterate op1 f i j) = (f i)).

Axiom int_iterate_def_plus_one_com :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (f:Z -> im1) (i:Z) (j:Z), (i < j)%Z ->
  ~ (j = (i + 1%Z)%Z) ->
  (((op1 (f i)) (int_iterate op1 f (i + 1%Z)%Z j)) = (int_iterate op1 f i j)).

Axiom int_iterate_def_plus_one_com1 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (f:Z -> im1) (i:Z) (j:Z), (i < j)%Z ->
  (iterable op1) ->
  (((op1 (f i)) (int_iterate op1 f (i + 1%Z)%Z j)) = (int_iterate op1 f i j)).

Axiom int_iterate_to_iterate :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (f:Z -> im1) (i:Z) (j:Z), ~ (j <= i)%Z ->
  (commut op1) -> ((int_iterate op1 f i j) = (iterate op1 (to_fset i j) f)).

Axiom int_iterate_to_iterate1 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (f:Z -> im1) (i:Z) (j:Z), (iterable op1) ->
  (commut op1) -> ((int_iterate op1 f i j) = (iterate op1 (to_fset i j) f)).

Axiom int_iterate_right_extension :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (f:Z -> im1) (i:Z) (j:Z), (iterable op1) ->
  (i < j)%Z ->
  ((int_iterate op1 f i j) =
   ((op1 (int_iterate op1 f i (j - 1%Z)%Z)) (f (j - 1%Z)%Z))).

Axiom int_iterate_right_extension_ :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (f:Z -> im1) (i:Z) (j:Z), (assoc op1) ->
  ((i + 1%Z)%Z < j)%Z ->
  ((int_iterate op1 f i j) =
   ((op1 (int_iterate op1 f i (j - 1%Z)%Z)) (f (j - 1%Z)%Z))).

Axiom int_iterate_transitivity :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (f:Z -> im1) (i:Z) (k:Z) (j:Z),
  (iterable op1) -> (iterable op1) ->
  (op_neutral_left op1 (neutral_elt op1)) -> ((i <= k)%Z /\ (k <= j)%Z) ->
  ((int_iterate op1 f i j) =
   ((op1 (int_iterate op1 f i k)) (int_iterate op1 f k j))).

Axiom int_iterate_transitivity_ :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (f:Z -> im1) (i:Z) (k:Z) (j:Z),
  (op_neutral_left op1 (neutral_elt op1)) -> ((i < k)%Z /\ (k < j)%Z) ->
  ((int_iterate op1 f i j) =
   ((op1 (int_iterate op1 f i k)) (int_iterate op1 f k j))).

Axiom int_iterate_comp_iterate :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (f:Z -> im1) (g:Z -> im1) (i:Z) (j:Z),
  (iterable op1) -> (op_neutral_right op1 (neutral_elt op1)) ->
  (commut op1) ->
  ((int_iterate op1 (fun (k:Z) => ((op1 (f k)) (g k))) i j) =
   ((op1 (int_iterate op1 f i j)) (int_iterate op1 g i j))).

Axiom int_iterate_attr_no_f :
  forall {im1:Type} {im1_WT:WhyType im1} {im2:Type} {im2_WT:WhyType im2},
  forall (op1:im1 -> im1 -> im1) (op2:im2 -> im2 -> im2) (t1:Z -> im1)
    (t2:Z -> im2) (f:im1 -> im2) (i:Z) (j:Z),
  (forall (x:Z), forall (y:im1),
   (((op2 (t2 x)) (f y)) = (f ((op1 (t1 x)) y)))) ->
  ((f (neutral_elt op1)) = (neutral_elt op2)) -> (iterable op1) ->
  (iterable op2) -> (forall (i1:Z), ((f (t1 i1)) = (t2 i1))) ->
  ((int_iterate op2 t2 i j) = (f (int_iterate op1 t1 i j))).

Axiom int_iterate_attr :
  forall {im1:Type} {im1_WT:WhyType im1} {im2:Type} {im2_WT:WhyType im2},
  forall (op1:im1 -> im1 -> im1) (op2:im2 -> im2 -> im2) (t:Z -> im1)
    (f:im1 -> im2) (i:Z) (j:Z),
  (forall (x:Z), forall (y:im1),
   (((op2 (f (t x))) (f y)) = (f ((op1 (t x)) y)))) ->
  ((f (neutral_elt op1)) = (neutral_elt op2)) -> (iterable op1) ->
  (iterable op2) ->
  ((int_iterate op2 (fun (e:Z) => (f (t e))) i j) =
   (f (int_iterate op1 t i j))).

Axiom int_iterate_attr_comm :
  forall {im1:Type} {im1_WT:WhyType im1} {im2:Type} {im2_WT:WhyType im2},
  forall (op1:im1 -> im1 -> im1) (op2:im2 -> im2 -> im2) (t:Z -> im1)
    (f:im1 -> im2) (i:Z) (j:Z),
  (forall (x:Z), forall (y:im1),
   (((op2 (f (t x))) (f y)) = (f ((op1 (t x)) y)))) ->
  ((f (neutral_elt op1)) = (neutral_elt op2)) -> (iterable op1) ->
  (iterable op2) ->
  ((f (int_iterate op1 t i j)) =
   (int_iterate op2 (fun (e:Z) => (f (t e))) i j)).

Axiom int_iterate_eq :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (f:Z -> im1) (g:Z -> im1) (i:Z) (j:Z),
  (forall (k:Z), ((i <= k)%Z /\ (k < j)%Z) -> ((f k) = (g k))) ->
  ~ (j <= i)%Z -> ((int_iterate op1 f i j) = (int_iterate op1 g i j)).

Axiom int_iterate_eq1 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (f:Z -> im1) (g:Z -> im1) (i:Z) (j:Z),
  (forall (k:Z), ((i <= k)%Z /\ (k < j)%Z) -> ((f k) = (g k))) ->
  (iterable op1) -> ((int_iterate op1 f i j) = (int_iterate op1 g i j)).

Axiom int_iterate_left_right :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (f:Z -> im1) (l:Z) (k:Z) (h:Z),
  (iterable op1) -> (commut op1) -> ((l <= k)%Z /\ (k <= h)%Z) ->
  ((int_iterate op1 f l k) =
   (int_iterate op1 (fun (a:Z) => (f ((h - (a + 1%Z)%Z)%Z + l)%Z))
    ((h - k)%Z + l)%Z h)).

Axiom int_iterate_eq_func :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (i:Z) (j:Z) (f:Z -> im1) (g:Z -> im1),
  (iterable op1) -> (commut op1) -> (p_injective f (to_fset i j)) ->
  (p_injective g (to_fset i j)) ->
  ((map f (to_fset i j)) = (map g (to_fset i j))) ->
  ((int_iterate op1 f i j) = (int_iterate op1 g i j)).

Axiom int_iterate_map :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (i:Z) (j:Z) (k:Z) (l:Z) (f:Z -> Z)
    (t:Z -> im1),
  ~ (j <= i)%Z -> (commut op1) ->
  (p_bijective f (to_fset i j) (to_fset k l)) ->
  ((int_iterate op1 t k l) = (int_iterate op1 (fun (b:Z) => (t (f b))) i j)).

Axiom int_iterate_map1 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (i:Z) (j:Z) (k:Z) (l:Z) (f:Z -> Z)
    (t:Z -> im1),
  (iterable op1) -> (commut op1) ->
  (p_bijective f (to_fset i j) (to_fset k l)) ->
  ((int_iterate op1 t k l) = (int_iterate op1 (fun (b:Z) => (t (f b))) i j)).

Axiom int_iterate_transl :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (f:Z -> im1) (i:Z) (j:Z) (k:Z),
  (iterable op1) ->
  ((int_iterate op1 f i j) =
   (int_iterate op1 (fun (b:Z) => (f (b + k)%Z)) (i - k)%Z (j - k)%Z)).

Axiom int_iterate_map_auto :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (i:Z) (j:Z) (f:Z -> Z) (t:Z -> im1),
  ~ (j <= i)%Z -> (commut op1) ->
  (p_bijective f (to_fset i j) (to_fset i j)) ->
  ((int_iterate op1 t i j) = (int_iterate op1 (fun (b:Z) => (t (f b))) i j)).

Axiom int_iterate_map_auto1 :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (i:Z) (j:Z) (f:Z -> Z) (t:Z -> im1),
  (iterable op1) -> (commut op1) ->
  (p_bijective f (to_fset i j) (to_fset i j)) ->
  ((int_iterate op1 t i j) = (int_iterate op1 (fun (b:Z) => (t (f b))) i j)).

Axiom leq_trans :
  forall (a:Z) (b:Z) (c:Z), (a <= b)%Z -> (b <= c)%Z -> (a <= c)%Z.

Axiom leq_trans_add :
  forall (a:Z) (b:Z) (c:Z) (d:Z), (a <= c)%Z -> (b <= d)%Z ->
  ((a + b)%Z <= (c + d)%Z)%Z.

Axiom leq_trans_mult :
  forall (a:Z) (b:Z) (c:Z), (0%Z <= c)%Z -> (a <= b)%Z ->
  ((a * c)%Z <= (b * c)%Z)%Z.

Axiom leq_trans_mult_right :
  forall (a:Z) (b:Z) (c:Z), (0%Z <= c)%Z -> (a <= b)%Z ->
  ((c * a)%Z <= (c * b)%Z)%Z.

Axiom compat_int_order_mult :
  forall (a:Z) (b:Z) (c:Z) (d:Z), ((0%Z <= c)%Z /\ (c <= d)%Z) ->
  ((0%Z <= a)%Z /\ (a <= b)%Z) -> ((c * a)%Z <= (d * b)%Z)%Z.

Axiom leq_trans_fact :
  forall (a:Z) (b:Z) (c:Z) (n:Z), (0%Z <= n)%Z ->
  ((0%Z <= a)%Z /\ (a <= c)%Z) -> ((0%Z <= b)%Z /\ (b <= (c * n)%Z)%Z) ->
  ((a + b)%Z <= (c * (n + 1%Z)%Z)%Z)%Z.

Axiom leq_trans_facrev :
  forall (a:Z) (b:Z) (c:Z) (n:Z), (0%Z <= n)%Z ->
  ((0%Z <= a)%Z /\ (a <= c)%Z) -> ((0%Z <= b)%Z /\ (b <= (c * n)%Z)%Z) ->
  ((b + a)%Z <= (c * (n + 1%Z)%Z)%Z)%Z.

Axiom neutrals : (0%Z = (neutral_elt (fun (y0:Z) (y1:Z) => (y0 + y1)%Z))).

Axiom neutrals1 : (1%Z = (neutral_elt (fun (y0:Z) (y1:Z) => (y0 * y1)%Z))).

Axiom neutrals2 : iterable (fun (y0:Z) (y1:Z) => (y0 + y1)%Z).

Axiom neutrals3 : iterable (fun (y0:Z) (y1:Z) => (y0 * y1)%Z).

Parameter isum: forall {a:Type} {a_WT:WhyType a}, (set a) -> (a -> Z) -> Z.

Axiom isum_def :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (t:a -> Z),
  ((isum s t) = (iterate (fun (y0:Z) (y1:Z) => (y0 + y1)%Z) s t)).

Parameter iproduct:
  forall {a:Type} {a_WT:WhyType a}, (set a) -> (a -> Z) -> Z.

Axiom iproduct_def :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (t:a -> Z),
  ((iproduct s t) = (iterate (fun (y0:Z) (y1:Z) => (y0 * y1)%Z) s t)).

Axiom isum_iter : iterates (fun (y0:Z) (y1:Z) => (y0 + y1)%Z) 0%Z.

Axiom isum_iter__ : iterable (fun (y0:Z) (y1:Z) => (y0 + y1)%Z).

Axiom isum_eq :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (t:a -> Z) (t':a -> Z),
  (forall (e:a), (mem e s) -> ((t e) = (t' e))) -> ((isum s t) = (isum s t')).

Axiom isum_eq_gen :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s':set a) (t:a -> Z) (t':a -> Z), (s = s') ->
  (forall (e:a), (mem e s) -> ((t e) = (t' e))) -> ((isum s t) = (isum s t')).

Axiom isum_add :
  forall {b:Type} {b_WT:WhyType b},
  forall (s:set b) (f:b -> Z) (x:b), ~ (mem x s) ->
  ((isum (add x s) f) = ((f x) + (isum s f))%Z).

Axiom iproduct_eq :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (t:a -> Z) (t':a -> Z),
  (forall (e:a), (mem e s) -> ((t e) = (t' e))) ->
  ((iproduct s t) = (iproduct s t')).

Axiom iproduct_eq_gen :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s':set a) (t:a -> Z) (t':a -> Z), (s = s') ->
  (forall (e:a), (mem e s) -> ((t e) = (t' e))) ->
  ((iproduct s t) = (iproduct s t')).

Axiom iproduct_add :
  forall {b:Type} {b_WT:WhyType b},
  forall (s:set b) (f:b -> Z) (x:b), ~ (mem x s) ->
  ((iproduct (add x s) f) = ((f x) * (iproduct s f))%Z).

Axiom iproduct_from_choose :
  forall {b:Type} {b_WT:WhyType b},
  forall (s:set b) (f:b -> Z), (0%Z < (cardinal s))%Z ->
  ((iproduct s f) = ((f (choose s)) * (iproduct (remove (choose s) s) f))%Z).

Axiom iproduct_map :
  forall (s:set Z) (f:Z -> Z) (t:Z -> Z), (p_injective f s) ->
  ((iproduct (map f s) t) = (iproduct s (fun (b:Z) => (t (f b))))).

Axiom iproduct_map_auto :
  forall (s:set Z) (f:Z -> Z) (t:Z -> Z), (p_bijective f s s) ->
  ((iproduct s t) = (iproduct s (fun (b:Z) => (t (f b))))).

Axiom iproduct_one :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> Z), (forall (e:a), (mem e s) -> ((f e) = 1%Z)) ->
  ((iproduct s f) = 1%Z).

Axiom iproduct_one_but_maybe_one_elt :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> Z) (e:a), (mem e s) ->
  (forall (e':a), (mem e' s) -> ~ (e' = e) -> ((f e') = 1%Z)) ->
  ((iproduct s f) = (f e)).

Axiom iproduct_one_but_maybe_one_elt1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> Z) (e:a), (mem e s) ->
  (forall (e':a), (mem e' s) -> ~ (e' = e) -> ((f e') = 1%Z)) ->
  ((iproduct s f) = ((f (choose s)) * (iproduct (remove (choose s) s) f))%Z).

Axiom mul_assoc :
  forall (a:Z) (b:Z) (c:Z), (((a * b)%Z * c)%Z = (a * (b * c)%Z)%Z).

Axiom ad_assoc :
  forall (a:Z) (b:Z) (c:Z), (((a + b)%Z + c)%Z = (a + (b + c)%Z)%Z).

Axiom ad_assoc_rev :
  forall (a:Z) (b:Z) (c:Z), ((a + (b + c)%Z)%Z = ((a + b)%Z + c)%Z).

Axiom ad_seq_switch :
  forall (a:Z) (b:Z) (c:Z) (a':Z) (b':Z) (c':Z), (a = a') -> (b = b') ->
  (c = c') -> ((a' + (b' + c')%Z)%Z = (b + (c + a)%Z)%Z).

Axiom mul_comm : forall (a:Z) (b:Z), ((a * b)%Z = (b * a)%Z).

Axiom add_eq_i :
  forall (a:Z) (a':Z) (b:Z) (b':Z), (a = a') -> (b = b') ->
  ((a + b)%Z = (a' + b')%Z).

Axiom mult_eq_i :
  forall (a:Z) (a':Z) (b:Z) (b':Z), (a = a') -> (b = b') ->
  ((a * b)%Z = (a' * b')%Z).

Axiom mul_assoc_rev :
  forall (a:Z) (b:Z) (c:Z), ((a * (b * c)%Z)%Z = ((a * b)%Z * c)%Z).

Axiom mult_add_distr :
  forall (a:Z) (b:Z) (c:Z) (d:Z),
  (((a + b)%Z * (c + d)%Z)%Z =
   ((((a * c)%Z + (a * d)%Z)%Z + (b * c)%Z)%Z + (b * d)%Z)%Z).

Axiom mult_add_right :
  forall (a:Z) (b:Z) (c:Z), (((a + b)%Z * c)%Z = ((a * c)%Z + (b * c)%Z)%Z).

Axiom mult_add_right_rev :
  forall (a:Z) (b:Z) (c:Z), (((a * c)%Z + (b * c)%Z)%Z = ((a + b)%Z * c)%Z).

Axiom mult_add_left :
  forall (a:Z) (b:Z) (c:Z), ((a * (b + c)%Z)%Z = ((a * b)%Z + (a * c)%Z)%Z).

Axiom mult_add_left_rev :
  forall (a:Z) (b:Z) (c:Z), (((a * b)%Z + (a * c)%Z)%Z = (a * (b + c)%Z)%Z).

Axiom mult_add_distr_rev :
  forall (a:Z) (b:Z) (c:Z) (d:Z),
  (((((a * c)%Z + (a * d)%Z)%Z + (b * c)%Z)%Z + (b * d)%Z)%Z =
   ((a + b)%Z * (c + d)%Z)%Z).

Axiom mul_assoc_comm :
  forall (a:Z) (b:Z) (c:Z), (((a * b)%Z * c)%Z = (b * (a * c)%Z)%Z).

Axiom mul_assoc_rev_comm :
  forall (a:Z) (b:Z) (c:Z), ((a * (b * c)%Z)%Z = ((a * c)%Z * b)%Z).

Axiom add_assoc1 :
  forall (a:Z) (b:Z) (c:Z), (((a + b)%Z + c)%Z = (a + (b + c)%Z)%Z).

Axiom add_assoc_rev1 :
  forall (a:Z) (b:Z) (c:Z), ((a + (b + c)%Z)%Z = ((a + b)%Z + c)%Z).

Axiom isum_empty :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> Z), (is_empty s) -> ((isum s f) = 0%Z).

Axiom iproduct_empty :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> Z), (is_empty s) -> ((iproduct s f) = 1%Z).

Axiom isum_iter_ :
  opposite_n (fun (y0:Z) (y1:Z) => (y0 + y1)%Z)
  (fun (y0:Z) (y1:Z) => (y0 - y1)%Z) 0%Z.

Axiom isum_iter_1 :
  opposite1 (fun (y0:Z) (y1:Z) => (y0 + y1)%Z)
  (fun (y0:Z) (y1:Z) => (y0 - y1)%Z).

Axiom isum_iter_2 :
  opposite_com (fun (y0:Z) (y1:Z) => (y0 + y1)%Z)
  (fun (y0:Z) (y1:Z) => (y0 - y1)%Z).

Axiom isum_iter_3 :
  inverse_tuple (fun (y0:Z) (y1:Z) => (y0 + y1)%Z)
  (fun (y0:Z) (y1:Z) => (y0 - y1)%Z) 0%Z.

Parameter ind_isum: (Z -> Z) -> Z -> Z -> Z.

Axiom ind_isum_def :
  forall (f:Z -> Z) (i:Z) (j:Z),
  ((ind_isum f i j) = (int_iterate (fun (y0:Z) (y1:Z) => (y0 + y1)%Z) f i j)).

Axiom ind_isum_empty :
  forall (f:Z -> Z) (i:Z) (j:Z), (j <= i)%Z -> ((ind_isum f i j) = 0%Z).

Axiom ind_isum_one :
  forall (f:Z -> Z) (i:Z) (j:Z), (j = (i + 1%Z)%Z) ->
  ((ind_isum f i j) = (f i)).

Axiom ind_isum_plus_one :
  forall (f:Z -> Z) (i:Z) (j:Z), (i < j)%Z ->
  ((ind_isum f i j) = ((f i) + (ind_isum f (i + 1%Z)%Z j))%Z).

Axiom ind_isum_to_isum :
  forall (f:Z -> Z) (i:Z) (j:Z), (i < j)%Z ->
  ((ind_isum f i j) = (isum (to_fset i j) f)).

Axiom pos_to_strict : forall (a:Z), (1%Z <= a)%Z -> (0%Z < a)%Z.

Axiom pos_by_strict : forall (a:Z), (0%Z < a)%Z -> (1%Z <= a)%Z.

Axiom ind_isum_const :
  forall (k:Z) (i:Z) (j:Z), (i < j)%Z ->
  ((ind_isum ((fun (y0:Z) (y1:Z) => (const y0 y1)) k) i j) =
   (k * (j - i)%Z)%Z).

Axiom ind_isum_null :
  forall (f:Z -> Z) (i:Z) (j:Z), (i < j)%Z ->
  (forall (k:Z), ((i <= k)%Z /\ (k < j)%Z) -> ((f k) = 0%Z)) ->
  ((ind_isum f i j) = 0%Z).

Axiom ind_isum_right_extension :
  forall (f:Z -> Z) (i:Z) (j:Z), (i <= j)%Z ->
  ((ind_isum f i (j + 1%Z)%Z) = ((ind_isum f i j) + (f j))%Z).

Axiom ind_isum_re :
  forall (f:Z -> Z) (i:Z) (j:Z), (i < j)%Z ->
  ((ind_isum f i j) = ((ind_isum f i (j - 1%Z)%Z) + (f (j - 1%Z)%Z))%Z).

Axiom ind_isum_re_null :
  forall (f:Z -> Z) (i:Z) (j:Z), (i < j)%Z -> ((f j) = 0%Z) ->
  ((ind_isum f i (j + 1%Z)%Z) = (ind_isum f i j)).

Axiom ind_isum_null_but_maybe_one_elt :
  forall (l:Z) (h:Z) (t:Z -> Z) (e:Z), ((l <= e)%Z /\ (e < h)%Z) ->
  (forall (a:Z), ((l <= a)%Z /\ (a < h)%Z) -> ~ (a = e) -> ((t a) = 0%Z)) ->
  ((ind_isum t l h) = (t e)).

Axiom ind_isum_eq :
  forall (f:Z -> Z) (g:Z -> Z) (i:Z) (j:Z),
  (forall (k:Z), ((i <= k)%Z /\ (k < j)%Z) -> ((f k) = (g k))) ->
  ((ind_isum f i j) = (ind_isum g i j)).

Parameter fc: (Z -> Z) -> (Z -> Z) -> (Z -> bool) -> Z -> Z.

Axiom fc_def :
  forall (f:Z -> Z) (g:Z -> Z) (p:Z -> bool) (k:Z),
  (((p k) = true) -> (((fc f g p) k) = (f k))) /\
  (~ ((p k) = true) -> (((fc f g p) k) = (g k))).

Axiom ind_isum_to_guard :
  forall (f:Z -> Z) (g:Z -> Z) (p:Z -> bool) (i:Z) (j:Z),
  (forall (k:Z), ((i <= k)%Z /\ (k < j)%Z) -> ((p k) = true)) ->
  ((ind_isum (fc f g p) i j) = (ind_isum f i j)).

Parameter fc1: (Z -> Z) -> (Z -> Z) -> (Z -> bool) -> Z -> Z.

Axiom fc_def1 :
  forall (f:Z -> Z) (g:Z -> Z) (p:Z -> bool) (k:Z),
  (((p k) = true) -> (((fc1 f g p) k) = (g k))) /\
  (~ ((p k) = true) -> (((fc1 f g p) k) = (f k))).

Axiom ind_isum_no_guard :
  forall (f:Z -> Z) (g:Z -> Z) (p:Z -> bool) (i:Z) (j:Z),
  (forall (k:Z), ((i <= k)%Z /\ (k < j)%Z) -> ~ ((p k) = true)) ->
  ((ind_isum (fc1 f g p) i j) = (ind_isum f i j)).

Axiom ind_isum_eq_gen :
  forall (f:Z -> Z) (g:Z -> Z) (i:Z) (i1:Z) (j:Z) (j1:Z),
  (forall (k:Z), ((i <= k)%Z /\ (k < j)%Z) -> ((f k) = (g k))) -> (i = i1) ->
  (j = j1) -> ((ind_isum f i j) = (ind_isum g i1 j1)).

Axiom ind_isum_func_const :
  forall (k:Z) (f:Z -> Z) (i:Z) (j:Z), (i < j)%Z ->
  (forall (l:Z), ((i <= l)%Z /\ (l < j)%Z) -> ((f l) = k)) ->
  ((ind_isum f i j) = (k * (j - i)%Z)%Z).

Axiom ind_isum_pos :
  forall (f:Z -> Z) (i:Z) (j:Z), (i <= j)%Z ->
  (forall (k:Z), ((i <= k)%Z /\ (k < j)%Z) -> ((f k) >= 0%Z)%Z) ->
  (0%Z <= (ind_isum f i j))%Z.

Parameter ind_iproduct: (Z -> Z) -> Z -> Z -> Z.

Axiom ind_iproduct_def :
  forall (f:Z -> Z) (i:Z) (j:Z),
  ((ind_iproduct f i j) =
   (int_iterate (fun (y0:Z) (y1:Z) => (y0 * y1)%Z) f i j)).

Axiom ind_iproduct_eq :
  forall (f:Z -> Z) (g:Z -> Z) (i:Z) (j:Z),
  (forall (k:Z), ((i <= k)%Z /\ (k < j)%Z) -> ((f k) = (g k))) ->
  ((ind_iproduct f i j) = (ind_iproduct g i j)).

Axiom ind_iproduct_eq_gen :
  forall (f:Z -> Z) (g:Z -> Z) (i1:Z) (j1:Z) (i2:Z) (j2:Z),
  (forall (k:Z), ((i1 <= k)%Z /\ (k < j1)%Z) -> ((f k) = (g k))) ->
  (i1 = i2) -> (j1 = j2) -> ((ind_iproduct f i1 j1) = (ind_iproduct g i2 j2)).

Axiom ind_iproduct_to_iproduct :
  forall (f:Z -> Z) (i:Z) (j:Z),
  ((ind_iproduct f i j) = (iproduct (to_fset i j) f)).

Axiom ind_iproduct_one_but_maybe_one_elt :
  forall (f:Z -> Z) (i:Z) (j:Z) (e:Z), ((i <= e)%Z /\ (e < j)%Z) ->
  (forall (e':Z), ((i <= e')%Z /\ (e' <= j)%Z) -> ~ (e = e') ->
   ((f e') = 1%Z)) ->
  ((ind_iproduct f i j) = (f e)).

Axiom mult_one_int : forall (a:Z) (b:Z), (b = 1%Z) -> ((a * b)%Z = a).

Axiom one_mult_int : forall (a:Z) (b:Z), (a = 1%Z) -> ((a * b)%Z = b).

Axiom mult_zero_int : forall (a:Z) (b:Z), (b = 0%Z) -> ((a * b)%Z = 0%Z).

Axiom zero_mult_int : forall (a:Z) (b:Z), (a = 0%Z) -> ((a * b)%Z = 0%Z).

Axiom iproduct_to_iterate :
  forall (f:Z -> Z) (i:Z) (j:Z),
  ((ind_iproduct f i j) =
   (int_iterate (fun (y0:Z) (y1:Z) => (y0 * y1)%Z) f i j)).

Axiom ind_isum_map_auto :
  forall (i:Z) (j:Z) (f:Z -> Z) (t:Z -> Z),
  (p_bijective f (to_fset i j) (to_fset i j)) ->
  ((ind_isum t i j) = (ind_isum (fun (b:Z) => (t (f b))) i j)).

Axiom ind_isum_rev :
  forall (i:Z) (j:Z) (f:Z -> Z),
  ((ind_isum f i j) =
   (ind_isum (fun (k:Z) => (f (((j - k)%Z - 1%Z)%Z + i)%Z)) i j)).

Axiom ind_isum_map :
  forall (i:Z) (j:Z) (k:Z) (l:Z) (f:Z -> Z) (t:Z -> Z),
  (p_bijective f (to_fset i j) (to_fset k l)) ->
  ((ind_isum t k l) = (ind_isum (fun (b:Z) => (t (f b))) i j)).

Axiom ind_isum_map_auto_bij :
  forall (i:Z) (j:Z) (f:Z -> Z) (t:Z -> Z),
  (forall (e:Z), ((i <= e)%Z /\ (e < j)%Z) ->
   (i <= (f e))%Z /\ ((f e) < j)%Z) ->
  (forall (e:Z) (e':Z), ((i <= e)%Z /\ (e < j)%Z) ->
   ((i <= e')%Z /\ (e' < j)%Z) -> ~ (e = e') -> ~ ((f e) = (f e'))) ->
  (forall (e':Z), ((i <= e')%Z /\ (e' < j)%Z) ->
   exists e:Z, ((i <= e)%Z /\ (e < j)%Z) /\ ((f e) = e')) ->
  ((ind_isum t i j) = (ind_isum (fun (b:Z) => (t (f b))) i j)).

Axiom ind_isum_map_bij :
  forall (i:Z) (j:Z) (k:Z) (l:Z) (f:Z -> Z) (t:Z -> Z),
  (forall (e:Z), ((i <= e)%Z /\ (e < j)%Z) ->
   (k <= (f e))%Z /\ ((f e) < l)%Z) ->
  (forall (e:Z) (e':Z), ((i <= e)%Z /\ (e < j)%Z) ->
   ((i <= e')%Z /\ (e' < j)%Z) -> ~ (e = e') -> ~ ((f e) = (f e'))) ->
  (forall (e':Z), ((k <= e')%Z /\ (e' < l)%Z) ->
   exists e:Z, ((i <= e)%Z /\ (e < j)%Z) /\ ((f e) = e')) ->
  ((ind_isum t k l) = (ind_isum (fun (b:Z) => (t (f b))) i j)).

Axiom ind_iproduct_empty :
  forall (f:Z -> Z) (i:Z) (j:Z), (i >= j)%Z -> ((ind_iproduct f i j) = 1%Z).

Axiom ind_iproduct_plus_one :
  forall (f:Z -> Z) (i:Z) (j:Z), (i < j)%Z ->
  ((ind_iproduct f i j) = ((f i) * (ind_iproduct f (i + 1%Z)%Z j))%Z).

Axiom ind_iproduct_right_extension :
  forall (f:Z -> Z) (i:Z) (j:Z), (i < j)%Z ->
  ((ind_iproduct f i j) =
   ((ind_iproduct f i (j - 1%Z)%Z) * (f (j - 1%Z)%Z))%Z).

Axiom ind_iproduct_right_extension_comm :
  forall (f:Z -> Z) (i:Z) (j:Z), (i < j)%Z ->
  (((ind_iproduct f i (j - 1%Z)%Z) * (f (j - 1%Z)%Z))%Z =
   (ind_iproduct f i j)).

Axiom ind_iproduct_comp :
  forall (f:Z -> Z) (g:Z -> Z) (h:Z -> Z) (i:Z) (j:Z), (i <= j)%Z ->
  (forall (k:Z), ((i <= k)%Z /\ (k < j)%Z) -> (((f k) * (g k))%Z = (h k))) ->
  ((ind_iproduct h i j) = ((ind_iproduct f i j) * (ind_iproduct g i j))%Z).

Axiom ind_iproduct_one :
  forall (f:Z -> Z) (i:Z) (j:Z),
  (forall (k:Z), ((i <= k)%Z /\ (k < j)%Z) -> ((f k) = 1%Z)) ->
  ((ind_iproduct f i j) = 1%Z).

Axiom positive_iproduct :
  forall (f:Z -> Z) (i:Z) (j:Z),
  (forall (k:Z), ((i <= k)%Z /\ (k < j)%Z) -> ((f k) > 0%Z)%Z) ->
  ((ind_iproduct f i j) > 0%Z)%Z.

Axiom ind_iproduct_pos :
  forall (f:Z -> Z) (i:Z) (j:Z),
  (forall (k:Z), ((i <= k)%Z /\ (k < j)%Z) -> (0%Z <= (f k))%Z) ->
  (0%Z <= (ind_iproduct f i j))%Z.

Axiom ind_iproduct_strict_pos :
  forall (f:Z -> Z) (i:Z) (j:Z),
  (forall (k:Z), ((i <= k)%Z /\ (k < j)%Z) -> (0%Z < (f k))%Z) ->
  (0%Z < (ind_iproduct f i j))%Z.

Axiom iproduct_strict_pos :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> Z),
  (forall (k:a), (mem k s) -> (0%Z < (f k))%Z) -> (0%Z < (iproduct s f))%Z.

Axiom ind_iproduct_strict_pos_one :
  forall (f:Z -> Z) (i:Z) (j:Z),
  (forall (k:Z), ((i <= k)%Z /\ (k < j)%Z) -> (0%Z < (f k))%Z) ->
  (1%Z <= (ind_iproduct f i j))%Z.

Axiom ind_iproduct_left_right :
  forall (f:Z -> Z) (l:Z) (k:Z) (h:Z), ((l <= k)%Z /\ (k <= h)%Z) ->
  ((ind_iproduct f l k) =
   (ind_iproduct (fun (a:Z) => (f ((h - (a + 1%Z)%Z)%Z + l)%Z))
    ((h - k)%Z + l)%Z h)).

Axiom iterable_imult : iterable (fun (y0:Z) (y1:Z) => (y0 * y1)%Z).

Axiom int_minus_distr :
  forall (a:Z) (b:Z), ((-(a + b)%Z)%Z = ((-a)%Z + (-b)%Z)%Z).

Axiom int_minus_eq : forall (a:Z) (b:Z), (a = b) -> ((-a)%Z = (-b)%Z).

Axiom ind_iproduct_map_auto :
  forall (i:Z) (j:Z) (f:Z -> Z) (t:Z -> Z),
  (p_bijective f (to_fset i j) (to_fset i j)) ->
  ((ind_iproduct t i j) = (ind_iproduct (fun (b:Z) => (t (f b))) i j)).

Axiom ind_iproduct_map :
  forall (i:Z) (j:Z) (k:Z) (l:Z) (f:Z -> Z) (t:Z -> Z),
  (p_bijective f (to_fset i j) (to_fset k l)) ->
  ((ind_iproduct t k l) = (ind_iproduct (fun (b:Z) => (t (f b))) i j)).

Axiom ind_iproduct_trans :
  forall (f:Z -> Z) (i:Z) (k:Z) (j:Z), ((i <= k)%Z /\ (k <= j)%Z) ->
  ((ind_iproduct f i j) = ((ind_iproduct f i k) * (ind_iproduct f k j))%Z).

Axiom ind_iproduct_inf :
  forall (f:Z -> Z) (g:Z -> Z) (i:Z) (j:Z),
  (forall (k:Z), ((i <= k)%Z /\ (k < j)%Z) ->
   (0%Z <= (f k))%Z /\ ((f k) <= (g k))%Z) ->
  ((ind_iproduct f i j) <= (ind_iproduct g i j))%Z.

Parameter choose_filter:
  forall {a:Type} {a_WT:WhyType a}, (set a) -> (a -> bool) -> a.

Axiom choose_filter_def :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (p:a -> bool),
  (exists e:a, (mem e s) /\ ((p e) = true)) -> ((p (choose s)) = true) ->
  ((choose_filter s p) = (choose s)).

Axiom choose_filter_def1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (p:a -> bool),
  (exists e:a, (mem e s) /\ ((p e) = true)) -> ~ ((p (choose s)) = true) ->
  ((choose_filter s p) = (choose_filter (remove (choose s) s) p)).

Axiom choose_filter_spec :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (p:a -> bool),
  (exists e:a, (mem e s) /\ ((p e) = true)) ->
  ((p (choose_filter s p)) = true).

Axiom choose_filter_spec1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (p:a -> bool),
  (exists e:a, (mem e s) /\ ((p e) = true)) -> mem (choose_filter s p) s.

Parameter my_filter:
  forall {a:Type} {a_WT:WhyType a}, (set a) -> (a -> bool) -> set a.

Axiom my_filter_def :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (p:a -> bool), (is_empty s) ->
  ((my_filter s p) = (empty : set a)).

Axiom my_filter_def1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (p:a -> bool), ~ (is_empty s) ->
  ((p (choose s)) = true) ->
  ((my_filter s p) = (add (choose s) (my_filter (remove (choose s) s) p))).

Axiom my_filter_def2 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (p:a -> bool), ~ (is_empty s) ->
  ~ ((p (choose s)) = true) ->
  ((my_filter s p) = (my_filter (remove (choose s) s) p)).

Axiom my_filter_spec :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (p:a -> bool), forall (e:a), (mem e s) ->
  ((p e) = true) -> mem e (my_filter s p).

Axiom my_filter_spec1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (p:a -> bool), forall (e:a), (mem e s) ->
  (mem e (my_filter s p)) -> ((p e) = true).

Axiom my_filter_spec2 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (p:a -> bool), forall (e:a), (mem e (my_filter s p)) ->
  mem e s.

Axiom my_filter_spec3 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (p:a -> bool), (0%Z <= (cardinal (my_filter s p)))%Z.

Axiom my_filter_spec4 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (p:a -> bool),
  ((cardinal (my_filter s p)) <= (cardinal s))%Z.

Axiom in_my_filter :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (p:a -> bool) (e:a), (mem e s) -> ((p e) = true) ->
  mem e (my_filter s p).

Axiom not_in_my_filter_set :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (p:a -> bool) (e:a), ~ (mem e s) ->
  ~ (mem e (my_filter s p)).

Axiom not_in_my_filter_filter :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (p:a -> bool) (e:a), ~ ((p e) = true) ->
  ~ (mem e (my_filter s p)).

Axiom in_my_filter_set :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (p:a -> bool) (e:a), (mem e (my_filter s p)) -> mem e s.

Axiom in_my_filter_filter :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (p:a -> bool) (e:a), (mem e (my_filter s p)) ->
  ((p e) = true).

Axiom my_filter_inter :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (p1:a -> bool) (p2:a -> bool),
  (forall (e:a), (mem e s) -> ((p1 e) = true) -> ~ ((p2 e) = true)) ->
  ((inter (my_filter s p1) (my_filter s p2)) = (empty : set a)).

Axiom my_filter_union :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (p1:a -> bool) (p2:a -> bool),
  (forall (e:a), (mem e s) -> ~ ((p1 e) = true) -> ((p2 e) = true)) ->
  ((union (my_filter s p1) (my_filter s p2)) = s).

Axiom ind_iproduct_sup_one :
  forall (f:Z -> Z) (i:Z) (j:Z), (i < j)%Z ->
  (forall (k:Z), ((i <= k)%Z /\ (k < j)%Z) -> (1%Z <= (f k))%Z) ->
  (exists k:Z, ((i <= k)%Z /\ (k < j)%Z) /\ ~ ((f k) = 1%Z)) ->
  (1%Z < (ind_iproduct f i j))%Z.

Axiom ind_isum_transl :
  forall (f:Z -> Z) (i:Z) (j:Z) (k:Z),
  ((ind_isum f i j) =
   (ind_isum (fun (b:Z) => (f (b + k)%Z)) (i - k)%Z (j - k)%Z)).

Axiom ind_isum_transl_plus_one :
  forall (f:Z -> Z) (i:Z) (j:Z),
  ((ind_isum f i j) =
   (ind_isum (fun (b:Z) => (f (b - 1%Z)%Z)) (i + 1%Z)%Z (j + 1%Z)%Z)).

Axiom ind_isum_transl_minus_one :
  forall (f:Z -> Z) (i:Z) (j:Z),
  ((ind_isum f i j) =
   (ind_isum (fun (b:Z) => (f (b + 1%Z)%Z)) (i - 1%Z)%Z (j - 1%Z)%Z)).

Axiom ind_isum_scal :
  forall (f:Z -> Z) (i:Z) (j:Z) (a:Z), (i <= j)%Z ->
  ((ind_isum (fun (i1:Z) => (a * (f i1))%Z) i j) = (a * (ind_isum f i j))%Z).

Axiom minus_ind_isum :
  forall (f:Z -> Z) (i:Z) (j:Z), (i <= j)%Z ->
  ((-(ind_isum f i j))%Z = (ind_isum (fun (i1:Z) => (-(f i1))%Z) i j)).

Axiom minus_ind_isum_rev :
  forall (f:Z -> Z) (i:Z) (j:Z), (i <= j)%Z ->
  ((ind_isum (fun (i1:Z) => (-(f i1))%Z) i j) = (-(ind_isum f i j))%Z).

Axiom ind_isum_scal_rev :
  forall (f:Z -> Z) (i:Z) (j:Z) (a:Z), (i <= j)%Z ->
  ((a * (ind_isum f i j))%Z = (ind_isum (fun (i1:Z) => (a * (f i1))%Z) i j)).

Axiom ind_isum_scal_rev_right :
  forall (f:Z -> Z) (i:Z) (j:Z) (a:Z), (i <= j)%Z ->
  (((ind_isum f i j) * a)%Z = (ind_isum (fun (i1:Z) => ((f i1) * a)%Z) i j)).

Axiom ind_isum_scal_right :
  forall (f:Z -> Z) (i:Z) (j:Z) (a:Z), (i <= j)%Z ->
  ((ind_isum (fun (i1:Z) => ((f i1) * a)%Z) i j) = ((ind_isum f i j) * a)%Z).

Axiom ind_isum_bound :
  forall (f:Z -> Z) (g:Z -> Z) (i:Z) (j:Z), (i < j)%Z ->
  (forall (k:Z), ((i <= k)%Z /\ (k < j)%Z) -> ((f k) < (g k))%Z) ->
  ((ind_isum f i j) < (ind_isum g i j))%Z.

Axiom comp_trans_equal_strict :
  forall (a:Z) (b:Z) (c:Z), (a <= b)%Z -> (b < c)%Z -> (a < c)%Z.

Axiom transitive_inf_leq_int :
  forall (a:Z) (b:Z) (c:Z), (a < b)%Z -> (b <= c)%Z -> (a < c)%Z.

Axiom transitive_inf_int :
  forall (a:Z) (b:Z) (c:Z), (a < b)%Z -> (b < c)%Z -> (a < c)%Z.

Axiom compeq_trans_sum :
  forall (a:Z) (b:Z) (c:Z), (b <= c)%Z -> ((a + b)%Z <= (a + c)%Z)%Z.

Axiom compeq_trans_sum_zero :
  forall (a:Z) (b:Z), (0%Z <= b)%Z -> (a <= (a + b)%Z)%Z.

Axiom comp_trans_sum :
  forall (a:Z) (b:Z) (c:Z), (b < c)%Z -> ((a + b)%Z < (a + c)%Z)%Z.

Axiom ind_isum_bound_eq :
  forall (f:Z -> Z) (g:Z -> Z) (i:Z) (j:Z), (i <= j)%Z ->
  (forall (k:Z), ((i <= k)%Z /\ (k < j)%Z) -> ((f k) <= (g k))%Z) ->
  ((ind_isum f i j) <= (ind_isum g i j))%Z.

Axiom ind_isum_scal_gen :
  forall (f:Z -> Z) (i:Z) (j:Z), forall (a:Z), ((i <= a)%Z /\ (a < j)%Z) ->
  ((ind_isum (fun (i1:Z) => (a * (f i1))%Z) i j) = (a * (ind_isum f i j))%Z).

Axiom ind_isum_trans :
  forall (f:Z -> Z) (i:Z) (k:Z) (j:Z), ((i <= k)%Z /\ (k <= j)%Z) ->
  ((ind_isum f i j) = ((ind_isum f i k) + (ind_isum f k j))%Z).

Axiom minus_out_int : forall (a:Z) (b:Z), (((-a)%Z * b)%Z = (-(a * b)%Z)%Z).

Parameter power: Z -> Z -> Z.

Axiom power_def :
  forall (e:Z) (i:Z), (0%Z <= i)%Z -> (i = 0%Z) -> ((power e i) = 1%Z).

Axiom power_def1 :
  forall (e:Z) (i:Z), (0%Z <= i)%Z -> ~ (i = 0%Z) ->
  ((power e i) = (e * (power e (i - 1%Z)%Z))%Z).

Axiom Power_zero : forall (i:Z), ((power i 0%Z) = 1%Z).

Axiom Power_one : forall (i:Z), ((power i 1%Z) = i).

Axiom power_plus_one :
  forall (i:Z) (x:Z), (0%Z <= x)%Z ->
  ((power i (x + 1%Z)%Z) = ((power i x) * i)%Z).

Axiom power_sum :
  forall (i:Z) (x:Z) (y:Z), (0%Z <= x)%Z -> (0%Z <= y)%Z ->
  ((power i (x + y)%Z) = ((power i x) * (power i y))%Z).

Axiom power_mult :
  forall (i:Z) (x:Z) (y:Z), (0%Z <= x)%Z -> (0%Z <= y)%Z ->
  ((power i (x * y)%Z) = (power (power i x) y)).

Axiom Power_sum :
  forall (x:Z) (y:Z) (i:Z), (x >= 0%Z)%Z -> (y >= 0%Z)%Z ->
  ((power i (x + y)%Z) = ((power i x) * (power i y))%Z).

Axiom Power_mult :
  forall (x:Z) (y:Z) (i:Z), (x >= 0%Z)%Z -> (y >= 0%Z)%Z ->
  ((power i (x * y)%Z) = (power (power i x) y)).

Axiom power_to_ind_iproduct :
  forall (e:Z) (i:Z), (0%Z <= i)%Z ->
  ((power e i) =
   (ind_iproduct ((fun (y0:Z) (y1:Z) => (const y0 y1)) e) 0%Z i)).

Axiom power_transl :
  forall (e:Z) (k:Z) (i:Z), (0%Z <= i)%Z ->
  ((power e i) =
   (ind_iproduct ((fun (y0:Z) (y1:Z) => (const y0 y1)) e) k (k + i)%Z)).

Axiom ind_iproduct_to_power :
  forall (e:Z) (i:Z) (j:Z), ((0%Z <= i)%Z /\ (i <= j)%Z) ->
  ((ind_iproduct ((fun (y0:Z) (y1:Z) => (const y0 y1)) e) i j) =
   (power e (j - i)%Z)).

Axiom ind_iproduct_to_power_gen :
  forall (e:Z), forall (i:Z) (j:Z), ((0%Z <= i)%Z /\ (i <= j)%Z) ->
  ((ind_iproduct ((fun (y0:Z) (y1:Z) => (const y0 y1)) e) i j) =
   (power e (j - i)%Z)).

Axiom power_sum_rev :
  forall (x:Z) (n:Z) (m:Z), (n >= 0%Z)%Z -> (m >= 0%Z)%Z ->
  (((power x n) * (power x m))%Z = (power x (n + m)%Z)).

Axiom power_eq :
  forall (x:Z) (n:Z) (m:Z), (n = m) -> ((power x n) = (power x m)).

Axiom power_eq_gen :
  forall (x:Z) (y:Z) (n:Z) (m:Z), (n = m) -> (x = y) ->
  ((power x n) = (power y m)).

Axiom power_2_sum :
  forall (i:Z), (i >= 1%Z)%Z ->
  ((ind_isum (fun (k:Z) => (power 2%Z (k + 1%Z)%Z)) 0%Z i) =
   ((power 2%Z (i + 1%Z)%Z) - 2%Z)%Z).

Axiom power_decomp :
  forall (i:Z), (i >= 1%Z)%Z ->
  ((ind_isum (fun (k:Z) => (power 2%Z (k + 1%Z)%Z)) 0%Z i) <
   (power 2%Z (i + 1%Z)%Z))%Z.

Parameter fc2: Z -> Z -> Z.

Axiom fc_def2 :
  forall (i:Z) (k:Z),
  (((1%Z <= k)%Z /\ (k < (i + 1%Z)%Z)%Z) ->
   (((fc2 i) k) = (power 2%Z (k - 1%Z)%Z))) /\
  (~ ((1%Z <= k)%Z /\ (k < (i + 1%Z)%Z)%Z) -> (((fc2 i) k) = 0%Z)).

Axiom power_decomp_minus_one :
  forall (i:Z), (i >= 1%Z)%Z ->
  ((ind_isum (fc2 i) 1%Z i) < (power 2%Z (i - 1%Z)%Z))%Z.

Axiom power_decomp_ :
  forall (i:Z), (i >= 1%Z)%Z ->
  ((ind_isum (fun (k:Z) => (power 2%Z k)) 0%Z i) < (power 2%Z i))%Z.

Axiom power_decomp_one :
  forall (i:Z), (i >= 1%Z)%Z ->
  ((ind_isum (fun (k:Z) => (power 2%Z (k + 1%Z)%Z)) 1%Z i) <
   (power 2%Z (i + 1%Z)%Z))%Z.

Axiom power_decomp_one_ :
  forall (i:Z), (i >= 1%Z)%Z ->
  ((ind_isum (fun (k:Z) => (power 2%Z k)) 1%Z i) < (power 2%Z i))%Z.

Axiom growing_mult :
  forall (n:Z) (m:Z), (0%Z <= n)%Z -> (1%Z <= m)%Z -> ((n * m)%Z >= n)%Z.

Axiom strict_growing_mult :
  forall (n:Z) (m:Z), (1%Z < n)%Z -> (1%Z < m)%Z -> ((n * m)%Z > n)%Z.

Axiom init_exp : forall (k:Z), ((power k 0%Z) = 1%Z).

Axiom init_exp1 : forall (k:Z), ((power k 1%Z) = k).

Axiom init_exp2 : forall (k:Z), ((power k 2%Z) = (k * k)%Z).

Axiom positive_int_exp :
  forall (k:Z) (n:Z), (1%Z <= k)%Z -> (0%Z <= n)%Z -> ((power k n) >= 1%Z)%Z.

Axiom positive_int_exp1 :
  forall (k:Z) (n:Z), (1%Z <= k)%Z -> (0%Z <= n)%Z -> ((power k n) > 0%Z)%Z.

Axiom positive_int_exp2 :
  forall (k:Z) (n:Z), (1%Z <= k)%Z -> (0%Z <= n)%Z ->
  ((power k n) <= (power k (n + 1%Z)%Z))%Z.

Axiom strict_positive_int_exp :
  forall (k:Z) (n:Z), (1%Z < k)%Z -> (0%Z < n)%Z -> ((power k n) > 1%Z)%Z.

Axiom strict_positive_int_exp1 :
  forall (k:Z) (n:Z), (1%Z < k)%Z -> (0%Z < n)%Z ->
  ((power k (n - 1%Z)%Z) < (power k n))%Z.

Axiom strict_positive_int_exp2 :
  forall (k:Z) (n:Z), (1%Z < k)%Z -> (0%Z < n)%Z ->
  ((power k n) < (power k (n + 1%Z)%Z))%Z.

Axiom power_minus_one :
  forall (i:Z), (0%Z <= i)%Z -> ((int.EuclideanDivision.mod1 i 2%Z) = 0%Z) ->
  ((power (-1%Z)%Z i) = 1%Z).

Axiom power_minus_one1 :
  forall (i:Z), (0%Z <= i)%Z -> ((int.EuclideanDivision.mod1 i 2%Z) = 1%Z) ->
  ((power (-1%Z)%Z i) = (-1%Z)%Z).

Axiom growing_exp :
  forall (k:Z) (m:Z) (n:Z), (1%Z <= k)%Z -> ((0%Z <= m)%Z /\ (m <= n)%Z) ->
  ((power k m) <= (power k n))%Z.

Axiom strict_growing_exp :
  forall (k:Z) (m:Z) (n:Z), (1%Z < k)%Z -> ((0%Z <= m)%Z /\ (m < n)%Z) ->
  ((power k m) < (power k n))%Z.

Axiom unicity_exp :
  forall (k:Z) (m:Z) (n:Z), (1%Z < k)%Z -> (0%Z <= m)%Z -> (0%Z <= n)%Z ->
  ((power k m) = (power k n)) -> (m = n).

Axiom unicity_exp1 :
  forall (k:Z) (m:Z) (n:Z), (1%Z < k)%Z -> (0%Z <= m)%Z -> (0%Z <= n)%Z ->
  (m = n) -> ((power k m) = (power k n)).

Axiom bounded_sum_exp :
  forall (i:Z) (j:Z) (m:Z) (n:Z), (0%Z <= m)%Z -> (0%Z <= n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z m))%Z) ->
  ((0%Z <= j)%Z /\ (j < (power 2%Z n))%Z) ->
  (((i * (power 2%Z n))%Z + j)%Z < (power 2%Z (m + n)%Z))%Z.

Axiom add_im_re :
  forall (i:complex) (j:complex),
  ((infix_pldt i j) =
   (infix_pldt (infix_pldt (t_real_part i) (t_real_part j))
    (infix_asdt im (infix_pldt (t_im_part i) (t_im_part j))))).

Axiom add_im_re1 :
  forall (i:complex) (j:complex),
  ((t_real_part (infix_pldt i j)) =
   (infix_pldt (t_real_part i) (t_real_part j))).

Axiom add_im_re2 :
  forall (i:complex) (j:complex),
  ((t_im_part (infix_pldt i j)) = (infix_pldt (t_im_part i) (t_im_part j))).

Axiom add_real_part :
  forall (i:complex) (j:complex),
  ((infix_pldt (t_real_part i) (t_real_part j)) =
   (t_real_part (infix_pldt i j))).

Axiom add_im_part :
  forall (i:complex) (j:complex),
  ((infix_pldt (t_im_part i) (t_im_part j)) = (t_im_part (infix_pldt i j))).

Axiom add_real_part_rev :
  forall (i:complex) (j:complex),
  ((t_real_part (infix_pldt i j)) =
   (infix_pldt (t_real_part i) (t_real_part j))).

Axiom add_im_part_rev :
  forall (i:complex) (j:complex),
  ((t_im_part (infix_pldt i j)) = (infix_pldt (t_im_part i) (t_im_part j))).

Axiom mult_distr_add_r :
  forall (a:complex) (b:complex) (c:complex),
  ((infix_asdt a (infix_pldt b c)) =
   (infix_pldt (infix_asdt a b) (infix_asdt a c))).

Axiom mult_distr_minus :
  forall (a:complex) (b:complex) (c:complex),
  ((infix_asdt a (infix_mndt b c)) =
   (infix_mndt (infix_asdt a b) (infix_asdt a c))).

Axiom minus_out :
  forall (a:complex) (b:complex),
  ((infix_asdt (prefix_mndt a) b) = (prefix_mndt (infix_asdt a b))).

Axiom mult_distr_add_r_rev :
  forall (a:complex) (b:complex) (c:complex),
  ((infix_pldt (infix_asdt a b) (infix_asdt a c)) =
   (infix_asdt a (infix_pldt b c))).

Axiom mult_distr_minus_rev :
  forall (a:complex) (b:complex) (c:complex),
  ((infix_mndt (infix_asdt a b) (infix_asdt a c)) =
   (infix_asdt a (infix_mndt b c))).

Axiom div_distr_add :
  forall (a:complex) (b:complex) (c:complex), ~ (a = c_zero) ->
  ((infix_sldt (infix_pldt b c) a) =
   (infix_pldt (infix_sldt b a) (infix_sldt c a))).

Axiom div_distr_minus :
  forall (a:complex) (b:complex) (c:complex), ~ (a = c_zero) ->
  ((infix_sldt (infix_mndt b c) a) =
   (infix_mndt (infix_sldt b a) (infix_sldt c a))).

Axiom div_distr_add_rev :
  forall (a:complex) (b:complex) (c:complex), ~ (a = c_zero) ->
  ((infix_pldt (infix_sldt b a) (infix_sldt c a)) =
   (infix_sldt (infix_pldt b c) a)).

Axiom div_distr_minus_rev :
  forall (a:complex) (b:complex) (c:complex), ~ (a = c_zero) ->
  ((infix_mndt (infix_sldt b a) (infix_sldt c a)) =
   (infix_sldt (infix_mndt b c) a)).

Axiom mult_distr_add_l :
  forall (a:complex) (b:complex) (c:complex),
  ((infix_asdt (infix_pldt b c) a) =
   (infix_pldt (infix_asdt a b) (infix_asdt a c))).

Axiom mult_distr_minus_r :
  forall (a:complex) (b:complex) (c:complex),
  ((infix_asdt a (infix_mndt b c)) =
   (infix_mndt (infix_asdt a b) (infix_asdt a c))).

Axiom mult_distr_minus_ll :
  forall (a:complex) (b:complex) (c:complex),
  ((infix_asdt (infix_pldt (prefix_mndt b) c) a) =
   (infix_pldt (infix_asdt (prefix_mndt a) b) (infix_asdt a c))).

Axiom mult_distr_minus_ri :
  forall (a:complex) (b:complex) (c:complex),
  ((infix_asdt (infix_mndt b c) a) =
   (infix_mndt (infix_asdt a b) (infix_asdt a c))).

Axiom minus_distr_op :
  forall (a:complex) (b:complex) (c:complex),
  ((infix_mndt a (infix_pldt b c)) = (infix_mndt (infix_mndt a b) c)).

Axiom mult_distr_minus_l :
  forall (a:complex) (b:complex) (c:complex),
  ((infix_asdt (infix_mndt b c) a) =
   (infix_mndt (infix_asdt a b) (infix_asdt a c))).

Axiom assoc_right :
  forall (a:complex) (b:complex) (c:complex),
  ((infix_pldt a (infix_pldt b c)) = (infix_pldt (infix_pldt a b) c)).

Axiom assoc_right_mult :
  forall (a:complex) (b:complex) (c:complex),
  ((infix_asdt a (infix_asdt b c)) = (infix_asdt (infix_asdt a b) c)).

Axiom minus_elim :
  forall (a:complex) (b:complex),
  ((infix_mndt a b) = (infix_pldt a (prefix_mndt b))).

Axiom minus_eq_t :
  forall (a:complex) (b:complex) (a':complex) (b':complex), (a = a') ->
  (b = b') -> ((infix_mndt a b) = (infix_mndt a' b')).

Axiom minus_distr_elim :
  forall (a:complex) (b:complex) (c:complex),
  ((infix_mndt a (infix_pldt b c)) =
   (infix_pldt (infix_pldt a (prefix_mndt b)) (prefix_mndt c))).

Axiom plus_minus_distr_elim :
  forall (a:complex) (b:complex) (c:complex),
  ((infix_pldt a (prefix_mndt (infix_pldt b c))) =
   (infix_pldt (infix_pldt a (prefix_mndt b)) (prefix_mndt c))).

Axiom def_by_minus :
  forall (x:complex) (y:complex) (z:complex), (x = (infix_mndt y z)) ->
  (y = (infix_pldt x z)).

Axiom switch :
  forall (a:complex) (b:complex) (c:complex),
  ((infix_pldt (infix_pldt a b) c) = (infix_pldt (infix_pldt a c) b)).

Axiom meet_a_c :
  forall (a:complex) (b:complex) (c:complex) (d:complex),
  ((infix_pldt (infix_pldt (infix_pldt a b) c) d) =
   (infix_pldt (infix_pldt (infix_pldt a c) b) d)).

Axiom meet_a_d :
  forall (a:complex) (b:complex) (c:complex) (d:complex),
  ((infix_pldt (infix_pldt (infix_pldt a b) c) d) =
   (infix_pldt (infix_pldt (infix_pldt a d) b) c)).

Axiom meet_b_c :
  forall (a:complex) (b:complex) (c:complex) (d:complex),
  ((infix_pldt (infix_pldt (infix_pldt a b) c) d) =
   (infix_pldt (infix_pldt (infix_pldt b c) a) d)).

Axiom meet_b_d :
  forall (a:complex) (b:complex) (c:complex) (d:complex),
  ((infix_pldt (infix_pldt (infix_pldt a b) c) d) =
   (infix_pldt (infix_pldt (infix_pldt b d) a) c)).

Axiom meet_c_d :
  forall (a:complex) (b:complex) (c:complex) (d:complex),
  ((infix_pldt (infix_pldt (infix_pldt a b) c) d) =
   (infix_pldt (infix_pldt (infix_pldt c d) a) b)).

Axiom inv_add :
  forall (a:complex) (b:complex),
  ((infix_pldt (infix_pldt a (prefix_mndt a)) b) = b).

Axiom switch_m :
  forall (a:complex) (b:complex) (c:complex),
  ((infix_pldt (infix_pldt a b) c) = (infix_pldt (infix_pldt a c) b)).

Axiom meet_a_c_m :
  forall (a:complex) (b:complex) (c:complex) (d:complex),
  ((infix_pldt (infix_pldt (infix_pldt a b) c) d) =
   (infix_pldt (infix_pldt (infix_pldt a c) b) d)).

Axiom meet_a_d_m :
  forall (a:complex) (b:complex) (c:complex) (d:complex),
  ((infix_pldt (infix_pldt (infix_pldt a b) c) d) =
   (infix_pldt (infix_pldt (infix_pldt a d) b) c)).

Axiom meet_b_c_m :
  forall (a:complex) (b:complex) (c:complex) (d:complex),
  ((infix_pldt (infix_pldt (infix_pldt a b) c) d) =
   (infix_pldt (infix_pldt (infix_pldt b c) a) d)).

Axiom meet_b_d_m :
  forall (a:complex) (b:complex) (c:complex) (d:complex),
  ((infix_pldt (infix_pldt (infix_pldt a b) c) d) =
   (infix_pldt (infix_pldt (infix_pldt b d) a) c)).

Axiom meet_c_d_m :
  forall (a:complex) (b:complex) (c:complex) (d:complex),
  ((infix_pldt (infix_pldt (infix_pldt a b) c) d) =
   (infix_pldt (infix_pldt (infix_pldt c d) a) b)).

Axiom t_real_part_add :
  forall (a:complex) (b:complex),
  ((t_real_part (infix_pldt a b)) =
   (infix_pldt (t_real_part a) (t_real_part b))).

Axiom t_real_part_subs :
  forall (a:complex) (b:complex),
  ((t_real_part (infix_mndt a b)) =
   (infix_mndt (t_real_part a) (t_real_part b))).

Axiom t_im_part_add :
  forall (a:complex) (b:complex),
  ((t_im_part (infix_pldt a b)) = (infix_pldt (t_im_part a) (t_im_part b))).

Axiom t_im_part_subs :
  forall (a:complex) (b:complex),
  ((t_im_part (infix_mndt a b)) = (infix_mndt (t_im_part a) (t_im_part b))).

Axiom t_real_part_real :
  forall (a:complex), (real_ a) -> ((t_real_part a) = a).

Axiom t_real_part_im :
  forall (a:complex), (pure_im_ a) -> ((t_real_part a) = c_zero).

Axiom im_t_im_part_im :
  forall (a:complex), (pure_im_ a) -> ((infix_asdt im (t_im_part a)) = a).

Axiom t_im_part_im :
  forall (a:complex), (pure_im_ a) ->
  ((t_im_part a) = (infix_asdt (prefix_mndt im) a)).

Axiom t_im_part_real :
  forall (a:complex), (real_ a) -> ((t_im_part a) = c_zero).

Axiom a_div_b_mult_a :
  forall (a:complex) (b:complex) (c:complex) (d:complex), ~ (b = c_zero) ->
  ~ (c = c_zero) -> (d = (infix_sldt c_one b)) -> (a = c) ->
  ((infix_asdt (infix_sldt a b) (infix_sldt c_one c)) = d).

Parameter nonn_part:
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  (im1 -> im1 -> im1) -> (set a) -> (a -> im1) -> set a.

Parameter result2:
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  (im1 -> im1 -> im1) -> (a -> im1) -> a -> bool.

Axiom result_def2 :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (t:a -> im1) (e:a),
  (((result2 op1 t) e) = true) <-> ~ (neutral op1 (t e)).

Axiom nonn_part_def :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s:set a) (t:a -> im1),
  ((nonn_part op1 s t) = (filter (result2 op1 t) s)).

Axiom nonn_part_spec :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s:set a) (t:a -> im1), forall (e:a),
  (mem e (nonn_part op1 s t)) -> mem e s.

Axiom nonn_part_spec1 :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s:set a) (t:a -> im1), forall (e:a),
  (mem e (nonn_part op1 s t)) -> ~ (neutral op1 (t e)).

Axiom nonn_part_spec2 :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s:set a) (t:a -> im1), forall (e:a),
  ((mem e s) /\ ~ (neutral op1 (t e))) -> mem e (nonn_part op1 s t).

Parameter n_part:
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  (im1 -> im1 -> im1) -> (set a) -> (a -> im1) -> set a.

Parameter result3:
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  (im1 -> im1 -> im1) -> (a -> im1) -> a -> bool.

Axiom result_def3 :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (t:a -> im1) (e:a),
  (((result3 op1 t) e) = true) <-> (neutral op1 (t e)).

Axiom n_part_def :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s:set a) (t:a -> im1),
  ((n_part op1 s t) = (filter (result3 op1 t) s)).

Axiom n_part_spec :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s:set a) (t:a -> im1), forall (e:a),
  (mem e (n_part op1 s t)) -> mem e s.

Axiom n_part_spec1 :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s:set a) (t:a -> im1), forall (e:a),
  (mem e (n_part op1 s t)) -> neutral op1 (t e).

Axiom n_part_spec2 :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s:set a) (t:a -> im1), forall (e:a),
  ((mem e s) /\ (neutral op1 (t e))) -> mem e (n_part op1 s t).

Axiom nullity_partition :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s:set a) (t:a -> im1), (commut op1) ->
  (s = (union (nonn_part op1 s t) (n_part op1 s t))).

Axiom nullity_partition1 :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s:set a) (t:a -> im1), (commut op1) ->
  ((inter (nonn_part op1 s t) (n_part op1 s t)) = (empty : set a)).

Axiom iterate_neutral :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s:set a) (t:a -> im1), (iterable op1) ->
  (commut op1) ->
  (forall (a1:a), (mem a1 s) -> ((t a1) = (neutral_elt op1))) ->
  ((iterate op1 s t) = (neutral_elt op1)).

Axiom iterate_nullity_partition :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s:set a) (t:a -> im1), (iterable op1) ->
  (commut op1) -> ((iterate op1 s t) = (iterate op1 (nonn_part op1 s t) t)).

Parameter couple:
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b}
    {im1:Type} {im1_WT:WhyType im1},
  (a -> b -> im1) -> (a* b)%type -> im1.

Axiom couple_def :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b}
    {im1:Type} {im1_WT:WhyType im1},
  forall (f:a -> b -> im1) (o:(a* b)%type), forall (x:a) (x1:b),
  (o = (x, x1)) -> ((couple f o) = ((f x) x1)).

Axiom null_product :
  forall (a:complex) (b:complex), ((infix_asdt a b) = c_zero) ->
  (a = c_zero) \/ (b = c_zero).

Axiom couple_value :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b}
    {im1:Type} {im1_WT:WhyType im1},
  forall (f:a -> b -> im1) (o:(a* b)%type),
  ((couple f o) = ((f (fir o)) (sec o))).

Axiom couple_value_dev :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b}
    {im1:Type} {im1_WT:WhyType im1},
  forall (f:a -> b -> im1) (o:(a* b)%type) (a1:a) (b1:b), (o = (a1, b1)) ->
  ((couple f o) = ((f a1) b1)).

Axiom neutral_c_zero :
  neutral (fun (y0:complex) (y1:complex) => (infix_pldt y0 y1)) c_zero.

Axiom neutral_c_zero1 :
  iterable (fun (y0:complex) (y1:complex) => (infix_pldt y0 y1)).

Parameter sum:
  forall {a:Type} {a_WT:WhyType a}, (set a) -> (a -> complex) -> complex.

Axiom sum_def :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (t:a -> complex),
  ((sum s t) =
   (iterate (fun (y0:complex) (y1:complex) => (infix_pldt y0 y1)) s t)).

Parameter eq_t: complex -> complex -> Prop.

Axiom eq_t_def : forall (a:complex) (a':complex), (eq_t a a') -> (a = a').

Axiom eq_t_def1 : forall (a:complex) (a':complex), (a = a') -> eq_t a a'.

Axiom sum_empty :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (t:a -> complex), (is_empty s) -> ((sum s t) = c_zero).

Axiom sum_one :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (t:a -> complex), ((cardinal s) = 1%Z) ->
  ((sum s t) = (t (choose s))).

Axiom sum_add :
  forall {b:Type} {b_WT:WhyType b},
  forall (s:set b) (f:b -> complex) (x:b), ~ (mem x s) ->
  ((sum (add x s) f) = (infix_pldt (f x) (sum s f))).

Axiom sum_plus_one :
  forall {b:Type} {b_WT:WhyType b},
  forall (s:set b) (f:b -> complex), ((cardinal s) > 1%Z)%Z ->
  ((sum s f) = (infix_pldt (f (choose s)) (sum (remove (choose s) s) f))).

Axiom sum_real :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> complex),
  (forall (a1:a), (mem a1 s) -> real_ (f a1)) -> ((cardinal s) > 0%Z)%Z ->
  real_ (sum s f).

Axiom map_sum_eq :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s:set b) (f:b -> a) (t:a -> complex), (p_injective f s) ->
  ((sum (map f s) t) = (sum s (fun (b1:b) => (t (f b1))))).

Axiom sum_comp :
  forall {b:Type} {b_WT:WhyType b},
  forall (s:set b) (f:b -> complex) (g:b -> complex),
  ((sum s (fun (k:b) => (infix_pldt (f k) (g k)))) =
   (infix_pldt (sum s f) (sum s g))).

Axiom sum_comp_rev :
  forall {b:Type} {b_WT:WhyType b},
  forall (s:set b) (f:b -> complex) (g:b -> complex),
  ((infix_pldt (sum s f) (sum s g)) =
   (sum s (fun (k:b) => (infix_pldt (f k) (g k))))).

Axiom sum_iter_ :
  opposite_n (fun (y0:complex) (y1:complex) => (infix_pldt y0 y1))
  (fun (y0:complex) (y1:complex) => (infix_mndt y0 y1)) c_zero.

Axiom sum_iter_1 :
  opposite1 (fun (y0:complex) (y1:complex) => (infix_pldt y0 y1))
  (fun (y0:complex) (y1:complex) => (infix_mndt y0 y1)).

Axiom sum_iter_2 :
  opposite_com (fun (y0:complex) (y1:complex) => (infix_pldt y0 y1))
  (fun (y0:complex) (y1:complex) => (infix_mndt y0 y1)).

Axiom sum_iter_3 :
  inverse_tuple (fun (y0:complex) (y1:complex) => (infix_pldt y0 y1))
  (fun (y0:complex) (y1:complex) => (infix_mndt y0 y1)) c_zero.

Axiom neutral_zero :
  ((neutral_elt (fun (y0:complex) (y1:complex) => (infix_pldt y0 y1))) =
   c_zero).

Axiom sum_eq :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> complex) (g:a -> complex),
  (forall (x:a), (mem x s) -> ((f x) = (g x))) -> ((sum s f) = (sum s g)).

Axiom sum_eq_gen :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s':set a) (f:a -> complex) (g:a -> complex), (s = s') ->
  (forall (x:a), (mem x s) -> ((f x) = (g x))) -> ((sum s f) = (sum s' g)).

Axiom sum_disjoint_transitivity :
  forall {a:Type} {a_WT:WhyType a},
  forall (s1:set a) (s2:set a) (t:a -> complex),
  ((inter s1 s2) = (empty : set a)) ->
  ((sum (union s1 s2) t) = (infix_pldt (sum s1 t) (sum s2 t))).

Axiom sum_to_cartesian_product :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s1:set a) (s2:set b) (f:a -> b -> complex),
  ((sum s1 (fun (a1:a) => (sum s2 (f a1)))) =
   (sum (cartesian_product s1 s2)
    (fun (o:(a* b)%type) => ((f (fir o)) (sec o))))).

Axiom sum_from_cartesian_product :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s1:set a) (s2:set b) (f:a -> b -> complex),
  ((sum (cartesian_product s1 s2)
    (fun (o:(a* b)%type) => ((f (fir o)) (sec o))))
   = (sum s1 (fun (a1:a) => (sum s2 (f a1))))).

Parameter ind_sum: (Z -> complex) -> Z -> Z -> complex.

Axiom ind_sum_def :
  forall (f:Z -> complex) (i:Z) (j:Z),
  ((ind_sum f i j) =
   (int_iterate (fun (y0:complex) (y1:complex) => (infix_pldt y0 y1)) f i j)).

Axiom ind_sum_to_int_iterate :
  forall (f:Z -> complex) (i:Z) (j:Z),
  ((ind_sum f i j) =
   (int_iterate (fun (y0:complex) (y1:complex) => (infix_pldt y0 y1)) f i j)).

Axiom ind_sum_cardone :
  forall (f:Z -> complex) (i:Z) (j:Z), (j = (i + 1%Z)%Z) ->
  ((ind_sum f i j) = (f i)).

Axiom ind_sum_right_extension :
  forall (f:Z -> complex) (i:Z) (j:Z), (i < j)%Z ->
  ((ind_sum f i j) = (infix_pldt (ind_sum f i (j - 1%Z)%Z) (f (j - 1%Z)%Z))).

Axiom ind_sum_trans :
  forall (f:Z -> complex) (i:Z) (k:Z) (j:Z), ((i <= k)%Z /\ (k <= j)%Z) ->
  ((ind_sum f i j) = (infix_pldt (ind_sum f i k) (ind_sum f k j))).

Axiom ind_sum_plus_one :
  forall (f:Z -> complex) (i:Z) (j:Z), (i < j)%Z ->
  ((ind_sum f i j) = (infix_pldt (f i) (ind_sum f (i + 1%Z)%Z j))).

Axiom real_ind_sum :
  forall (f:Z -> complex) (i:Z) (j:Z), (i < j)%Z ->
  (forall (k:Z), ((i <= k)%Z /\ (k < j)%Z) -> real_ (f k)) ->
  real_ (ind_sum f i j).

Axiom positive_ind_sum :
  forall (f:Z -> complex) (i:Z) (j:Z), (i < j)%Z ->
  (forall (k:Z), ((i <= k)%Z /\ (k < j)%Z) -> infix_lseqdt c_zero (f k)) ->
  infix_lseqdt c_zero (ind_sum f i j).

Axiom positive_sum :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> complex),
  (forall (k:a), (mem k s) -> infix_lseqdt c_zero (f k)) ->
  infix_lseqdt c_zero (sum s f).

Axiom ind_sum_eq :
  forall (f:Z -> complex) (g:Z -> complex) (i:Z) (j:Z),
  (forall (k:Z), ((i <= k)%Z /\ (k < j)%Z) -> ((f k) = (g k))) ->
  ((ind_sum f i j) = (ind_sum g i j)).

Parameter fc3: (Z -> complex) -> complex -> Z -> Z -> Z -> complex.

Axiom fc_def3 :
  forall (f:Z -> complex) (g:complex) (i:Z) (j:Z) (k:Z),
  (((i <= k)%Z /\ (k < j)%Z) -> (((fc3 f g i j) k) = (f k))) /\
  (~ ((i <= k)%Z /\ (k < j)%Z) -> (((fc3 f g i j) k) = g)).

Axiom ind_sum_eq_del_bound :
  forall (f:Z -> complex) (g:complex) (i:Z) (j:Z),
  ((ind_sum (fc3 f g i j) i j) = (ind_sum f i j)).

Parameter fc4: (Z -> complex) -> complex -> Z -> Z -> Z -> complex.

Axiom fc_def4 :
  forall (f:Z -> complex) (g:complex) (i:Z) (j:Z) (k:Z),
  (((i <= k)%Z /\ (k < j)%Z) -> (((fc4 f g i j) k) = (f k))) /\
  (~ ((i <= k)%Z /\ (k < j)%Z) -> (((fc4 f g i j) k) = g)).

Axiom ind_sum_eq_del_bound_rev :
  forall (f:Z -> complex) (g:complex) (i:Z) (j:Z),
  ((ind_sum f i j) = (ind_sum (fc4 f g i j) i j)).

Axiom ind_sum_eq_gen :
  forall (f:Z -> complex) (g:Z -> complex) (i1:Z) (j1:Z) (i2:Z) (j2:Z),
  (i1 = i2) -> (j1 = j2) ->
  (forall (k:Z), ((i1 <= k)%Z /\ (k < j1)%Z) -> ((f k) = (g k))) ->
  ((ind_sum f i1 j1) = (ind_sum g i2 j2)).

Axiom ind_sum_eq_bound :
  forall (f:Z -> complex) (g:Z -> complex) (i:Z) (j:Z), (i = j) ->
  (forall (k:Z), ((0%Z <= k)%Z /\ (k < j)%Z) -> ((f k) = (g k))) ->
  ((ind_sum f 0%Z i) = (ind_sum g 0%Z j)).

Axiom ind_sum_comp :
  forall (f:Z -> complex) (g:Z -> complex) (i:Z) (j:Z),
  ((ind_sum (fun (k:Z) => (infix_pldt (f k) (g k))) i j) =
   (infix_pldt (ind_sum f i j) (ind_sum g i j))).

Axiom ind_sum_comp_rev :
  forall (f:Z -> complex) (g:Z -> complex) (i:Z) (i':Z) (j:Z) (j':Z),
  (i = i') -> (j = j') ->
  ((infix_pldt (ind_sum f i j) (ind_sum g i' j')) =
   (ind_sum (fun (k:Z) => (infix_pldt (f k) (g k))) i j)).

Axiom ind_sum_to_iterate :
  forall (f:Z -> complex) (i:Z) (j:Z),
  ((ind_sum f i j) =
   (iterate (fun (y0:complex) (y1:complex) => (infix_pldt y0 y1))
    (to_fset i j) f)).

Axiom ind_sum_to_sum :
  forall (f:Z -> complex) (i:Z) (j:Z),
  ((ind_sum f i j) = (sum (to_fset i j) f)).

Axiom map_ind_sum_eq :
  forall (i:Z) (j:Z) (k:Z) (l:Z) (f:Z -> Z) (t:Z -> complex),
  (p_bijective f (to_fset i j) (to_fset k l)) ->
  ((ind_sum t k l) = (ind_sum (fun (b:Z) => (t (f b))) i j)).

Axiom sum_scal :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:a -> complex) (s:set a) (c:complex),
  ((sum s (fun (x:a) => (infix_asdt c (f x)))) = (infix_asdt c (sum s f))).

Axiom sum_scal_right :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:a -> complex) (s:set a) (c:complex),
  ((sum s (fun (x:a) => (infix_asdt (f x) c))) = (infix_asdt (sum s f) c)).

Axiom sum_scal_rev_right :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:a -> complex) (s:set a) (c:complex),
  ((infix_asdt (sum s f) c) = (sum s (fun (x:a) => (infix_asdt (f x) c)))).

Axiom sum_scal_rev :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:a -> complex) (s:set a) (c:complex),
  ((infix_asdt c (sum s f)) = (sum s (fun (x:a) => (infix_asdt c (f x))))).

Axiom ind_sum_scal :
  forall (f:Z -> complex) (i:Z) (j:Z) (a:complex),
  ((ind_sum (fun (i1:Z) => (infix_asdt a (f i1))) i j) =
   (infix_asdt a (ind_sum f i j))).

Axiom ind_sum_scal_rev :
  forall (f:Z -> complex) (i:Z) (j:Z) (a:complex),
  ((infix_asdt a (ind_sum f i j)) =
   (ind_sum (fun (i1:Z) => (infix_asdt a (f i1))) i j)).

Axiom scal_ind_sum :
  forall (f:Z -> complex) (i:Z) (j:Z) (a:complex),
  ((ind_sum (fun (i1:Z) => (infix_asdt (f i1) a)) i j) =
   (infix_asdt (ind_sum f i j) a)).

Axiom scal_ind_sum_rev :
  forall (f:Z -> complex) (i:Z) (j:Z) (a:complex),
  ((infix_asdt (ind_sum f i j) a) =
   (ind_sum (fun (i1:Z) => (infix_asdt (f i1) a)) i j)).

Axiom sum_scal_gen :
  forall (f:Z -> complex) (s:set Z), forall (a:complex),
  ((sum s (fun (i:Z) => (infix_asdt a (f i)))) = (infix_asdt a (sum s f))).

Axiom ind_sum_scal_gen :
  forall (f:Z -> complex) (i:Z) (j:Z), forall (a:complex),
  ((ind_sum (fun (i1:Z) => (infix_asdt a (f i1))) i j) =
   (infix_asdt a (ind_sum f i j))).

Axiom int_int_iterate_def_empty :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (f:Z -> Z -> im1) (i:Z) (j:Z) (k:Z) (l:Z),
  (j <= i)%Z -> (iterable op1) ->
  ((int_int_iterate op1 f i j k l) = (neutral_elt op1)).

Axiom int_int_iterate_def_plus_one :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (f:Z -> Z -> im1) (i:Z) (j:Z) (k:Z) (l:Z),
  (i < j)%Z -> (iterable op1) ->
  ((int_int_iterate op1 f i j k l) =
   ((op1 (int_iterate op1 (fun (n:Z) => ((f i) n)) k l))
    (int_int_iterate op1 f (i + 1%Z)%Z j k l))).

Axiom int_int_iterate_to_int_iterate :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (f:Z -> Z -> im1) (i:Z) (j:Z) (k:Z) (l:Z),
  (i <= j)%Z -> (iterable op1) ->
  ((int_int_iterate op1 f i j k l) =
   (int_iterate op1 (fun (a:Z) => (int_iterate op1 (f a) k l)) i j)).

Axiom int_iterate_to_int_int_iterate :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (f:Z -> Z -> im1) (i:Z) (j:Z) (k:Z) (l:Z),
  (i <= j)%Z -> (iterable op1) ->
  ((int_iterate op1 (fun (a:Z) => (int_iterate op1 (f a) k l)) i j) =
   (int_int_iterate op1 f i j k l)).

Axiom int_int_iterate_to_iterate :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (f:Z -> Z -> im1) (i:Z) (j:Z) (k:Z) (l:Z),
  (i <= j)%Z -> (iterable op1) -> (commut op1) ->
  ((int_int_iterate op1 f i j k l) =
   (iterate op1 (cartesian_product (to_fset i j) (to_fset k l))
    (fun (o:(Z* Z)%type) => ((f (fir o)) (sec o))))).

Axiom iterate_commute :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b}
    {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s1:set a) (s2:set b) (f:a -> b -> im1),
  (iterable op1) -> (commut op1) ->
  ((iterate op1 (cartesian_product s1 s2)
    (fun (o:(a* b)%type) => ((f (fir o)) (sec o))))
   =
   (iterate op1 (cartesian_product s2 s1)
    (fun (o:(b* a)%type) => ((f (sec o)) (fir o))))).

Axiom iterate_commute_ :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b}
    {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s1:set a) (s2:set b) (f:a -> b -> im1),
  (iterable op1) -> (commut op1) ->
  ((iterate op1 s1
    (fun (a1:a) => (iterate op1 s2 (fun (a2:b) => ((f a1) a2)))))
   =
   (iterate op1 s2
    (fun (a2:b) => (iterate op1 s1 (fun (a1:a) => ((f a1) a2)))))).

Axiom int_int_iterate_commute :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (f:Z -> Z -> im1) (i:Z) (j:Z) (k:Z) (l:Z),
  (iterable op1) -> (commut op1) -> (i <= j)%Z -> (k <= l)%Z ->
  ((int_int_iterate op1 f i j k l) =
   (int_int_iterate op1 (fun (a:Z) (b:Z) => ((f b) a)) k l i j)).

Axiom int_iterate_commute :
  forall {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (f:Z -> Z -> im1) (i:Z) (j:Z) (k:Z) (l:Z),
  (iterable op1) -> (commut op1) -> (i <= j)%Z -> (k <= l)%Z ->
  ((int_iterate op1 (fun (a:Z) => (int_iterate op1 (f a) k l)) i j) =
   (int_iterate op1
    (fun (a:Z) => (int_iterate op1 (fun (b:Z) => ((f b) a)) i j)) k l)).

Axiom ind_sum_commute :
  forall (f:Z -> Z -> complex) (i:Z) (j:Z) (k:Z) (l:Z), (i <= j)%Z ->
  (k <= l)%Z ->
  ((ind_sum (fun (k1:Z) => (ind_sum (f k1) k l)) i j) =
   (ind_sum (fun (k1:Z) => (ind_sum (fun (k2:Z) => ((f k2) k1)) i j)) k l)).

Axiom sum_commute :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b -> complex) (sa:set a) (sb:set b),
  ((sum sa (fun (a1:a) => (sum sb (f a1)))) =
   (sum sb (fun (b1:b) => (sum sa (fun (a1:a) => ((f a1) b1)))))).

Parameter non_c_zero:
  forall {a:Type} {a_WT:WhyType a}, (set a) -> (a -> complex) -> set a.

Axiom non_c_zero_def :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (t:a -> complex),
  ((non_c_zero s t) =
   (nonn_part (fun (y0:complex) (y1:complex) => (infix_pldt y0 y1)) s t)).

Axiom non_c_zero_spec :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (t:a -> complex), forall (e:a),
  (mem e (non_c_zero s t)) -> mem e s.

Axiom non_c_zero_spec1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (t:a -> complex), forall (e:a),
  (mem e (non_c_zero s t)) -> ~ ((t e) = c_zero).

Axiom non_c_zero_spec2 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (t:a -> complex), forall (e:a),
  ((mem e s) /\ ~ ((t e) = c_zero)) -> mem e (non_c_zero s t).

Axiom get_non_c_zero_member :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (t:a -> complex) (e:a), (mem e (non_c_zero s t)) ->
  mem e s.

Axiom get_non_c_zero_member1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (t:a -> complex) (e:a), (mem e (non_c_zero s t)) ->
  ~ ((t e) = c_zero).

Axiom set_non_c_zero_member :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (t:a -> complex) (e:a), (mem e s) -> ~ ((t e) = c_zero) ->
  mem e (non_c_zero s t).

Axiom set_non_c_zero_member_gen :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (t:a -> complex), forall (e:a),
  ((mem e s) /\ ~ ((t e) = c_zero)) -> mem e (non_c_zero s t).

Axiom set_non_c_zero_member_gen_ :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (t:a -> complex), forall (e:a),
  ((mem e s) /\ ~ ((t e) = c_zero)) -> mem e (non_c_zero s t).

Axiom sum_nullity_partition :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (t:a -> complex), ((sum s t) = (sum (non_c_zero s t) t)).

Axiom non_null_map :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> a) (t:a -> complex),
  ((non_c_zero (map f s) t) =
   (map f (non_c_zero s (fun (b:a) => (t (f b)))))).

Axiom map_sum_eq_nonnull :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> a) (t:a -> complex),
  (p_bijective f (non_c_zero s (fun (b:a) => (t (f b))))
   (non_c_zero (map f s) t)) ->
  ((sum (non_c_zero (map f s) t) t) =
   (sum (non_c_zero s (fun (b:a) => (t (f b)))) (fun (b:a) => (t (f b))))).

Axiom sum_null_but_one :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (t:a -> complex), ((cardinal (non_c_zero s t)) = 1%Z) ->
  ((sum s t) = (t (element (non_c_zero s t)))).

Axiom sum_null :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (t:a -> complex), ((cardinal (non_c_zero s t)) = 0%Z) ->
  ((sum s t) = c_zero).

Axiom sum_null_ :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (t:a -> complex),
  (forall (e:a), (mem e s) -> ((t e) = c_zero)) -> ((sum s t) = c_zero).

Axiom sum_null_forall :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (t:a -> complex),
  (forall (e:a), (mem e s) -> ((t e) = c_zero)) -> ((sum s t) = c_zero).

Axiom ind_sum_null :
  forall (t:Z -> complex) (i:Z) (j:Z),
  (forall (k:Z), ((i <= k)%Z /\ (k < j)%Z) -> ((t k) = c_zero)) ->
  ((ind_sum t i j) = c_zero).

Axiom sum_null_but_one_elt :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (t:a -> complex) (elt:a),
  ((mem elt s) /\ ~ ((t elt) = c_zero)) ->
  (forall (a1:a), (mem a1 s) -> ~ (a1 = elt) -> ((t a1) = c_zero)) ->
  ((sum s t) = (t elt)).

Axiom sum_null_but_maybe_one_elt :
  forall {a:Type} {a_WT:WhyType a},
  forall (t:a -> complex) (s:set a) (elt:a), (mem elt s) ->
  (forall (k:a), (mem k s) -> ~ (k = elt) -> ((t k) = c_zero)) ->
  ((sum s t) = (t elt)).

Axiom sum_null_but_maybe_two_elt :
  forall {a:Type} {a_WT:WhyType a},
  forall (t:a -> complex) (s:set a) (elt:a) (elt':a), (mem elt s) ->
  (mem elt' s) -> ~ (elt = elt') ->
  (forall (k:a), (mem k s) -> ~ (k = elt) -> ~ (k = elt') ->
   ((t k) = c_zero)) ->
  ((sum s t) = (infix_pldt (t elt) (t elt'))).

Axiom ind_sum_null_but_maybe_one_elt :
  forall (t:Z -> complex) (i:Z) (j:Z) (ind:Z),
  ((i <= ind)%Z /\ (ind < j)%Z) ->
  (forall (k:Z), ((i <= k)%Z /\ (k < j)%Z) -> ~ (k = ind) ->
   ((t k) = c_zero)) ->
  ((ind_sum t i j) = (t ind)).

Axiom ind_sum_null_but_maybe_two_elt :
  forall (t:Z -> complex) (i:Z) (j:Z) (ind:Z) (ind':Z),
  ((i <= ind)%Z /\ (ind < j)%Z) -> ((i <= ind')%Z /\ (ind' < j)%Z) ->
  ~ (ind = ind') ->
  (forall (k:Z), ((i <= k)%Z /\ (k < j)%Z) -> ~ (k = ind) -> ~ (k = ind') ->
   ((t k) = c_zero)) ->
  ((ind_sum t i j) = (infix_pldt (t ind) (t ind'))).

Axiom ind_sum_map_filter :
  forall (n:Z) (n':Z) (g:Z -> Z) (f:Z -> complex) (p:Z -> bool),
  ((0%Z <= n')%Z /\ (n' <= n)%Z) -> (p_injective g (to_fset 0%Z n')) ->
  (forall (k:Z), ((0%Z <= k)%Z /\ (k < n)%Z) -> ~ ((p k) = true) ->
   ((f k) = c_zero)) ->
  (forall (k:Z), ((0%Z <= k)%Z /\ (k < n')%Z) ->
   (0%Z <= (g k))%Z /\ ((g k) < n)%Z) ->
  (forall (k:Z), ((0%Z <= k)%Z /\ (k < n)%Z) ->
   ((p k) = true) <->
   exists ant:Z, ((0%Z <= ant)%Z /\ (ant < n')%Z) /\ (k = (g ant))) ->
  ((ind_sum f 0%Z n) = (ind_sum (fun (k:Z) => (f (g k))) 0%Z n')).

Axiom neutral_c_one :
  neutral (fun (y0:complex) (y1:complex) => (infix_asdt y0 y1)) c_one.

Axiom neutral_c_one1 :
  iterable (fun (y0:complex) (y1:complex) => (infix_asdt y0 y1)).

Axiom product_iter :
  op_neutral_left (fun (y0:complex) (y1:complex) => (infix_asdt y0 y1)) c_one.

Axiom product_iter1 :
  op_neutral_right (fun (y0:complex) (y1:complex) => (infix_asdt y0 y1))
  c_one.

Axiom product_iter2 :
  op_assoc (fun (y0:complex) (y1:complex) => (infix_asdt y0 y1)).

Axiom product_iter3 :
  commut (fun (y0:complex) (y1:complex) => (infix_asdt y0 y1)).

Axiom product_iter4 :
  iterates (fun (y0:complex) (y1:complex) => (infix_asdt y0 y1)) c_one.

Parameter product:
  forall {a:Type} {a_WT:WhyType a}, (set a) -> (a -> complex) -> complex.

Axiom product_def :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (t:a -> complex),
  ((product s t) =
   (iterate (fun (y0:complex) (y1:complex) => (infix_asdt y0 y1)) s t)).

Axiom product_eq :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (t:a -> complex) (t':a -> complex),
  (forall (e:a), (mem e s) -> ((t e) = (t' e))) ->
  ((product s t) = (product s t')).

Axiom product_eq_gen :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s':set a) (t:a -> complex) (t':a -> complex), (s = s') ->
  (forall (e:a), (mem e s) -> ((t e) = (t' e))) ->
  ((product s t) = (product s' t')).

Axiom product_empty :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> complex), (is_empty s) -> ((product s f) = c_one).

Axiom product_iter_ :
  iterable (fun (y0:complex) (y1:complex) => (infix_asdt y0 y1)).

Axiom add_product :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> complex) (x:a), ~ (mem x s) ->
  ((product (add x s) f) = (infix_asdt (f x) (product s f))).

Axiom product_add :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> complex) (x:a), ~ (mem x s) ->
  ((product (add x s) f) = (infix_asdt (product s f) (f x))).

Axiom neutral_one :
  ((neutral_elt (fun (y0:complex) (y1:complex) => (infix_asdt y0 y1))) =
   c_one).

Parameter ind_product: (Z -> complex) -> Z -> Z -> complex.

Axiom ind_product_def :
  forall (f:Z -> complex) (i:Z) (j:Z),
  ((ind_product f i j) =
   (int_iterate (fun (y0:complex) (y1:complex) => (infix_asdt y0 y1)) f i j)).

Axiom ind_product_eq :
  forall (f:Z -> complex) (g:Z -> complex) (i:Z) (j:Z),
  (forall (k:Z), ((i <= k)%Z /\ (k < j)%Z) -> ((f k) = (g k))) ->
  ((ind_product f i j) = (ind_product g i j)).

Axiom ind_product_cardone :
  forall (f:Z -> complex) (i:Z) (j:Z), (j = (i + 1%Z)%Z) ->
  ((ind_product f i j) = (f i)).

Axiom ind_product_eq_gen :
  forall (f:Z -> complex) (g:Z -> complex) (i1:Z) (j1:Z) (i2:Z) (j2:Z),
  (forall (k:Z), ((i1 <= k)%Z /\ (k < j1)%Z) -> ((f k) = (g k))) ->
  (i1 = i2) -> (j1 = j2) -> ((ind_product f i1 j1) = (ind_product g i2 j2)).

Axiom ind_product_right_extension :
  forall (f:Z -> complex) (i:Z) (j:Z), (i < j)%Z ->
  ((ind_product f i j) =
   (infix_asdt (ind_product f i (j - 1%Z)%Z) (f (j - 1%Z)%Z))).

Axiom ind_product_left_extension :
  forall (f:Z -> complex) (i:Z) (j:Z), (i < j)%Z ->
  ((ind_product f i j) = (infix_asdt (f i) (ind_product f (i + 1%Z)%Z j))).

Axiom ind_product_to_product :
  forall (f:Z -> complex) (i:Z) (j:Z),
  ((ind_product f i j) = (product (to_fset i j) f)).

Axiom map_product_eq :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s:set b) (f:b -> a) (t:a -> complex), (p_injective f s) ->
  ((product (map f s) t) = (product s (fun (b1:b) => (t (f b1))))).

Axiom map_ind_product_eq :
  forall (i:Z) (j:Z) (k:Z) (l:Z) (f:Z -> Z) (t:Z -> complex),
  (p_bijective f (to_fset i j) (to_fset k l)) ->
  ((ind_product t k l) = (ind_product (fun (b:Z) => (t (f b))) i j)).

Axiom ind_product_right_extension_comm :
  forall (f:Z -> complex) (i:Z) (j:Z), (i < j)%Z ->
  ((infix_asdt (ind_product f i (j - 1%Z)%Z) (f (j - 1%Z)%Z)) =
   (ind_product f i j)).

Axiom ind_product_eq_func :
  forall (i:Z) (j:Z) (f1:Z -> complex) (f2:Z -> complex),
  (p_injective f1 (to_fset i j)) -> (p_injective f2 (to_fset i j)) ->
  ((map f1 (to_fset i j)) = (map f2 (to_fset i j))) ->
  ((ind_product f1 i j) = (ind_product f2 i j)).

Axiom ind_product_trans :
  forall (f:Z -> complex) (i:Z) (k:Z) (j:Z), ((i <= k)%Z /\ (k <= j)%Z) ->
  ((ind_product f i j) =
   (infix_asdt (ind_product f i k) (ind_product f k j))).

Axiom ind_product_zero_pre :
  forall (f:Z -> complex) (i:Z) (t:Z) (j:Z), ((i <= t)%Z /\ (t < j)%Z) ->
  ((f t) = c_zero) -> ((ind_product f i j) = c_zero).

Axiom ind_product_zero :
  forall (f:Z -> complex) (i:Z) (j:Z), (i <= j)%Z ->
  (exists t:Z, ((i <= t)%Z /\ (t < j)%Z) /\ ((f t) = c_zero)) ->
  ((ind_product f i j) = c_zero).

Axiom ind_product_zero_elt :
  forall (f:Z -> complex) (i:Z) (j:Z) (t:Z), (i <= j)%Z ->
  ((i <= t)%Z /\ (t < j)%Z) -> ((f t) = c_zero) ->
  ((ind_product f i j) = c_zero).

Axiom ind_product_const_c_one :
  forall (f:Z -> complex) (i:Z) (j:Z), (i <= j)%Z ->
  (forall (t:Z), ((i <= t)%Z /\ (t < j)%Z) -> ((f t) = c_one)) ->
  ((ind_product f i j) = c_one).

Parameter nonn_part1:
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  (im1 -> im1 -> im1) -> (set a) -> (a -> im1) -> set a.

Parameter result4:
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  (im1 -> im1 -> im1) -> (a -> im1) -> a -> bool.

Axiom result_def4 :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (t:a -> im1) (e:a),
  (((result4 op1 t) e) = true) <-> ~ (neutral op1 (t e)).

Axiom nonn_part_def1 :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s:set a) (t:a -> im1),
  ((nonn_part1 op1 s t) = (filter (result4 op1 t) s)).

Axiom nonn_part_spec3 :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s:set a) (t:a -> im1), forall (e:a),
  (mem e (nonn_part1 op1 s t)) -> mem e s.

Axiom nonn_part_spec4 :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s:set a) (t:a -> im1), forall (e:a),
  (mem e (nonn_part1 op1 s t)) -> ~ (neutral op1 (t e)).

Axiom nonn_part_spec5 :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s:set a) (t:a -> im1), forall (e:a),
  ((mem e s) /\ ~ (neutral op1 (t e))) -> mem e (nonn_part1 op1 s t).

Parameter n_part1:
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  (im1 -> im1 -> im1) -> (set a) -> (a -> im1) -> set a.

Parameter result5:
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  (im1 -> im1 -> im1) -> (a -> im1) -> a -> bool.

Axiom result_def5 :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (t:a -> im1) (e:a),
  (((result5 op1 t) e) = true) <-> (neutral op1 (t e)).

Axiom n_part_def1 :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s:set a) (t:a -> im1),
  ((n_part1 op1 s t) = (filter (result5 op1 t) s)).

Axiom n_part_spec3 :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s:set a) (t:a -> im1), forall (e:a),
  (mem e (n_part1 op1 s t)) -> mem e s.

Axiom n_part_spec4 :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s:set a) (t:a -> im1), forall (e:a),
  (mem e (n_part1 op1 s t)) -> neutral op1 (t e).

Axiom n_part_spec5 :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s:set a) (t:a -> im1), forall (e:a),
  ((mem e s) /\ (neutral op1 (t e))) -> mem e (n_part1 op1 s t).

Axiom nullity_partition2 :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s:set a) (t:a -> im1), (commut op1) ->
  (s = (union (nonn_part1 op1 s t) (n_part1 op1 s t))).

Axiom nullity_partition3 :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s:set a) (t:a -> im1), (commut op1) ->
  ((inter (nonn_part1 op1 s t) (n_part1 op1 s t)) = (empty : set a)).

Axiom iterate_neutral1 :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s:set a) (t:a -> im1), (iterable op1) ->
  (commut op1) ->
  (forall (a1:a), (mem a1 s) -> ((t a1) = (neutral_elt op1))) ->
  ((iterate op1 s t) = (neutral_elt op1)).

Axiom iterate_nullity_partition1 :
  forall {a:Type} {a_WT:WhyType a} {im1:Type} {im1_WT:WhyType im1},
  forall (op1:im1 -> im1 -> im1) (s:set a) (t:a -> im1), (iterable op1) ->
  (commut op1) -> ((iterate op1 s t) = (iterate op1 (nonn_part1 op1 s t) t)).

Parameter indic: forall {a:Type} {a_WT:WhyType a}, a -> a -> complex.

Axiom indic_def :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:a) (a':a), (infix_eqeq a1 a') -> ((indic a1 a') = c_one).

Axiom indic_def1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:a) (a':a), ~ (infix_eqeq a1 a') -> ((indic a1 a') = c_zero).

Axiom indic_spec :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:a) (a':a),
  ((a1 = a') -> ((indic a1 a') = c_one)) /\
  (~ (a1 = a') -> ((indic a1 a') = c_zero)).

Axiom get_indic :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:a) (a':a),
  ((a1 = a') -> ((indic a1 a') = c_one)) /\
  (~ (a1 = a') -> ((indic a1 a') = c_zero)).

Parameter indic_bool: forall {a:Type} {a_WT:WhyType a}, a -> a -> bool.

Axiom indic_bool_def :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:a) (a':a), (infix_eqeq a1 a') -> ((indic_bool a1 a') = true).

Axiom indic_bool_def1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:a) (a':a), ~ (infix_eqeq a1 a') -> ((indic_bool a1 a') = false).

Axiom indic_bool_spec :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:a) (a':a),
  ((a1 = a') -> ((indic_bool a1 a') = true)) /\
  (~ (a1 = a') -> ((indic_bool a1 a') = false)).

Axiom indic_comm :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:a) (a':a), ((indic a1 a') = (indic a' a1)).

Axiom indic_transl_r :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:a) (b:a) (c:a), (b = c) -> ((indic a1 b) = (indic a1 c)).

Axiom indic_transl_l :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:a) (b:a) (c:a), (b = c) -> ((indic b a1) = (indic c a1)).

Parameter indic_2:
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b}, a -> a -> b ->
  b -> complex.

Axiom indic_2_def :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (a1:a) (a':a) (b1:b) (b':b),
  (((indic_bool a1 a') = true) /\ ((indic_bool b1 b') = true)) ->
  ((indic_2 a1 a' b1 b') = c_one).

Axiom indic_2_def1 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (a1:a) (a':a) (b1:b) (b':b), ~ ((indic_bool a1 a') = true) ->
  ((indic_2 a1 a' b1 b') = c_zero).

Axiom indic_2_def2 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (a1:a) (a':a) (b1:b) (b':b), ~ ((indic_bool b1 b') = true) ->
  ((indic_2 a1 a' b1 b') = c_zero).

Axiom indic_2_spec :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (a1:a) (a':a) (b1:b) (b':b),
  ((indic_2 a1 a' b1 b') = (infix_asdt (indic a1 a') (indic b1 b'))).

Axiom indic_2_spec1 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (a1:a) (a':a) (b1:b) (b':b),
  ((indic_2 a1 a' b1 b') = (indic (a1, b1) (a', b'))).

Axiom indic_2_if :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (i:a) (k:a) (j:b) (l:b),
  (((i = k) /\ (j = l)) -> ((indic_2 i k j l) = c_one)) /\
  (~ ((i = k) /\ (j = l)) -> ((indic_2 i k j l) = c_zero)).

Axiom indic_2_comm :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (a1:a) (a':a) (b1:b) (b':b),
  ((indic_2 a1 a' b1 b') = (indic_2 a' a1 b1 b')).

Axiom indic_2_comm1 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (a1:a) (a':a) (b1:b) (b':b),
  ((indic_2 a1 a' b1 b') = (indic_2 a1 a' b' b1)).

Axiom indic_2_comm2 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (a1:a) (a':a) (b1:b) (b':b),
  ((indic_2 a1 a' b1 b') = (indic_2 a' a1 b' b1)).

Parameter sum_indic:
  forall {a:Type} {a_WT:WhyType a}, (set a) -> (a -> complex) -> a ->
  complex.

Axiom sum_indic_def :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (t:a -> complex) (i:a),
  ((sum_indic s t i) = (sum s (fun (e:a) => (infix_asdt (t e) (indic i e))))).

Parameter bool_to_c: bool -> complex.

Axiom bool_to_c_def : forall (a:bool), (a = true) -> ((bool_to_c a) = c_one).

Axiom bool_to_c_def1 :
  forall (a:bool), ~ (a = true) -> ((bool_to_c a) = c_zero).

Parameter ind_sum_indic: (Z -> complex) -> Z -> Z -> Z -> complex.

Axiom ind_sum_indic_def :
  forall (t:Z -> complex) (l:Z) (h:Z) (i:Z), (l < h)%Z ->
  ((ind_sum_indic t l h i) =
   (ind_sum (fun (e:Z) => (infix_asdt (t e) (indic i e))) l h)).

Axiom ind_sum_indic_spec :
  forall (t:Z -> complex) (l:Z) (h:Z) (i:Z), (l < h)%Z ->
  ((ind_sum_indic t l h i) = (sum_indic (to_fset l h) t i)).

Axiom sum_indic_t :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (t:a -> complex) (i:a), (mem i s) ->
  ((sum_indic s t i) = (t i)).

Axiom sum_indic_ts :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (t:a -> complex) (i:a), (mem i s) ->
  ((sum s (fun (e:a) => (infix_asdt (t e) (indic i e)))) = (t i)).

Axiom ind_sum_indic_t :
  forall (t:Z -> complex) (l:Z) (h:Z) (i:Z), ((l <= i)%Z /\ (i < h)%Z) ->
  ((ind_sum_indic t l h i) = (t i)).

Axiom ind_sum_indic_t1 :
  forall (t:Z -> complex) (l:Z) (h:Z) (i:Z), ((l <= i)%Z /\ (i < h)%Z) ->
  ((ind_sum (fun (e:Z) => (infix_asdt (t e) (indic i e))) l h) = (t i)).

Axiom ind_sum_indic_t_quant :
  forall (t:Z -> complex) (l:Z) (h:Z), forall (i:Z),
  ((l <= i)%Z /\ (i < h)%Z) ->
  ((ind_sum (fun (e:Z) => (infix_asdt (t e) (indic i e))) l h) = (t i)).

Axiom div_plus_one :
  forall (i:Z) (j:Z), (0%Z <= i)%Z -> (0%Z < j)%Z ->
  (((int.EuclideanDivision.div i j) * j)%Z <= i)%Z.

Axiom div_plus_one1 :
  forall (i:Z) (j:Z), (0%Z <= i)%Z -> (0%Z < j)%Z ->
  (i < (((int.EuclideanDivision.div i j) + 1%Z)%Z * j)%Z)%Z.

Axiom mod_is_inf :
  forall (i:Z) (j:Z), (0%Z < j)%Z -> ((int.EuclideanDivision.mod1 i j) < j)%Z.

Axiom zero_add : forall (a1:Z) (a2:Z), (a1 = 0%Z) -> ((a1 + a2)%Z = a2).

Axiom add_zero : forall (a1:Z) (a2:Z), (a2 = 0%Z) -> ((a1 + a2)%Z = a1).

Axiom one_mult : forall (a1:Z) (a2:Z), (a1 = 1%Z) -> ((a1 * a2)%Z = a2).

Axiom mult_one : forall (a1:Z) (a2:Z), (a2 = 1%Z) -> ((a1 * a2)%Z = a1).

Axiom add_eq :
  forall (a1:Z) (a2:Z) (b1:Z) (b2:Z), (a1 = a2) -> (b1 = b2) ->
  ((a1 + b1)%Z = (a2 + b2)%Z).

Axiom mult_eq :
  forall (a1:Z) (a2:Z) (b1:Z) (b2:Z), (a1 = a2) -> (b1 = b2) ->
  ((a1 * b1)%Z = (a2 * b2)%Z).

Axiom add_eq_inv :
  forall (a1:Z) (a2:Z) (b1:Z) (b2:Z), (a1 = a2) -> (b1 = b2) ->
  ((a1 + b1)%Z = (b2 + a2)%Z).

Axiom mult_eq_inv :
  forall (a1:Z) (a2:Z) (b1:Z) (b2:Z), (a1 = a2) -> (b1 = b2) ->
  ((a1 * b1)%Z = (b2 * a2)%Z).

Axiom bound_eq :
  forall (i:Z) (j:Z), ((0%Z <= i)%Z /\ (i < j)%Z) ->
  (i = (int.EuclideanDivision.mod1 i j)).

Axiom bound_eq_rev :
  forall (i:Z) (j:Z), ((0%Z <= i)%Z /\ (i < j)%Z) ->
  ((int.EuclideanDivision.mod1 i j) = i).

Axiom unicity_div_mod :
  forall (i:Z) (j:Z) (q:Z) (r:Z), (0%Z < j)%Z -> (i = ((q * j)%Z + r)%Z) ->
  ((0%Z <= r)%Z /\ (r < j)%Z) -> (q = (int.EuclideanDivision.div i j)).

Axiom unicity_div_mod1 :
  forall (i:Z) (j:Z) (q:Z) (r:Z), (0%Z < j)%Z -> (i = ((q * j)%Z + r)%Z) ->
  ((0%Z <= r)%Z /\ (r < j)%Z) -> (r = (int.EuclideanDivision.mod1 i j)).

Axiom get_div :
  forall (j:Z) (q:Z) (r:Z), (0%Z < j)%Z -> ((0%Z <= r)%Z /\ (r < j)%Z) ->
  ((int.EuclideanDivision.div ((q * j)%Z + r)%Z j) = q).

Axiom positive_div :
  forall (i:Z) (j:Z), ((0%Z < j)%Z /\ (j < i)%Z) ->
  (0%Z < (int.EuclideanDivision.div i j))%Z.

Axiom div_mod_sim_bound :
  forall (d:Z) (m:Z) (q:Z) (r:Z), ((0%Z <= d)%Z /\ (d < r)%Z) ->
  ((0%Z <= m)%Z /\ (m < q)%Z) -> (0%Z <= ((d * q)%Z + m)%Z)%Z.

Axiom div_mod_sim_bound1 :
  forall (d:Z) (m:Z) (q:Z) (r:Z), ((0%Z <= d)%Z /\ (d < r)%Z) ->
  ((0%Z <= m)%Z /\ (m < q)%Z) -> (((d * q)%Z + m)%Z < (r * q)%Z)%Z.

Axiom div_mod_sim_bound_gen_r :
  forall (d:Z) (q:Z) (r:Z), ((0%Z <= d)%Z /\ (d < r)%Z) -> forall (m:Z),
  ((0%Z <= m)%Z /\ (m < q)%Z) -> (0%Z <= ((d * q)%Z + m)%Z)%Z.

Axiom div_mod_sim_bound_gen_r1 :
  forall (d:Z) (q:Z) (r:Z), ((0%Z <= d)%Z /\ (d < r)%Z) -> forall (m:Z),
  ((0%Z <= m)%Z /\ (m < q)%Z) -> (((d * q)%Z + m)%Z < (r * q)%Z)%Z.

Axiom unicity_div_gen :
  forall (j:Z) (q:Z), (0%Z <= q)%Z -> (0%Z < j)%Z -> forall (i:Z),
  (0%Z <= i)%Z ->
  ((0%Z <= (i - (q * j)%Z)%Z)%Z /\ ((i - (q * j)%Z)%Z < j)%Z) ->
  (q = (int.EuclideanDivision.div i j)).

Axiom unicity_div_gen1 :
  forall (j:Z) (q:Z), (0%Z <= q)%Z -> (0%Z < j)%Z -> forall (i:Z),
  (0%Z <= i)%Z ->
  ((0%Z <= (i - (q * j)%Z)%Z)%Z /\ ((i - (q * j)%Z)%Z < j)%Z) ->
  ((i - (j * q)%Z)%Z = (int.EuclideanDivision.mod1 i j)).

Axiom bound_mod :
  forall (i:Z) (j:Z), (0%Z < j)%Z ->
  (0%Z <= (int.EuclideanDivision.mod1 i j))%Z.

Axiom bound_mod1 :
  forall (i:Z) (j:Z), (0%Z < j)%Z -> ((int.EuclideanDivision.mod1 i j) < j)%Z.

Axiom mod_eq :
  forall (a:Z) (b:Z) (d:Z), (a = b) ->
  ((int.EuclideanDivision.mod1 a d) = (int.EuclideanDivision.mod1 b d)).

Axiom e_div_eq :
  forall (a:Z) (b:Z) (d:Z), (a = b) ->
  ((int.EuclideanDivision.div a d) = (int.EuclideanDivision.div b d)).

Axiom decomp :
  forall (i:Z) (j:Z), ~ (0%Z = j) ->
  (i =
   ((j * (int.EuclideanDivision.div i j))%Z +
    (int.EuclideanDivision.mod1 i j))%Z).

Axiom div_mod_eq :
  forall (i:Z) (j:Z) (q:Z), (0%Z <= i)%Z -> (0%Z <= j)%Z -> (0%Z < q)%Z ->
  ((int.EuclideanDivision.div i q) = (int.EuclideanDivision.div j q)) ->
  ((int.EuclideanDivision.mod1 i q) = (int.EuclideanDivision.mod1 j q)) ->
  (i = j).

Axiom mod_zero :
  forall (i:Z) (j:Z), (0%Z <= i)%Z -> (0%Z < j)%Z ->
  ((int.EuclideanDivision.mod1 i j) = 0%Z) ->
  (i = (j * (int.EuclideanDivision.div i j))%Z).

Axiom div_plus_quotient :
  forall (i:Z) (j:Z), (0%Z <= i)%Z -> (0%Z < j)%Z ->
  ((int.EuclideanDivision.div (i + j)%Z j) =
   ((int.EuclideanDivision.div i j) + 1%Z)%Z).

Axiom div_plus_fact_gen_div :
  forall (i:Z) (j:Z) (k:Z), (0%Z < j)%Z ->
  ((int.EuclideanDivision.div (i + (k * j)%Z)%Z j) =
   ((int.EuclideanDivision.div i j) + k)%Z).

Axiom mod_plus_fact_gen_mod :
  forall (i:Z) (j:Z) (k:Z), (0%Z < j)%Z ->
  ((int.EuclideanDivision.mod1 ((k * j)%Z + i)%Z j) =
   (int.EuclideanDivision.mod1 i j)).

Axiom mod_plus_fact_gen_mod_left :
  forall (i:Z) (j:Z) (k:Z), (0%Z < j)%Z ->
  ((int.EuclideanDivision.mod1 ((j * k)%Z + i)%Z j) =
   (int.EuclideanDivision.mod1 i j)).

Axiom bound_div :
  forall (i:Z) (q:Z) (f:Z), (0%Z <= i)%Z -> (0%Z <= q)%Z -> (0%Z <= f)%Z ->
  (i < (f * q)%Z)%Z -> (0%Z <= (int.EuclideanDivision.div i q))%Z.

Axiom bound_div1 :
  forall (i:Z) (q:Z) (f:Z), (0%Z <= i)%Z -> (0%Z <= q)%Z -> (0%Z <= f)%Z ->
  (i < (f * q)%Z)%Z -> (0%Z <= ((int.EuclideanDivision.div i q) * q)%Z)%Z.

Axiom bound_div2 :
  forall (i:Z) (q:Z) (f:Z), (0%Z <= i)%Z -> (0%Z <= q)%Z -> (0%Z <= f)%Z ->
  (i < (f * q)%Z)%Z -> (((int.EuclideanDivision.div i q) * q)%Z <= i)%Z.

Axiom bound_div3 :
  forall (i:Z) (q:Z) (f:Z), (0%Z <= i)%Z -> (0%Z <= q)%Z -> (0%Z <= f)%Z ->
  (i < (f * q)%Z)%Z ->
  (i < (q * ((int.EuclideanDivision.div i q) + 1%Z)%Z)%Z)%Z.

Axiom bound_div4 :
  forall (i:Z) (q:Z) (f:Z), (0%Z <= i)%Z -> (0%Z <= q)%Z -> (0%Z <= f)%Z ->
  (i < (f * q)%Z)%Z -> ((int.EuclideanDivision.div i q) < f)%Z.

Axiom mod_upper_bound :
  forall (i:Z) (q:Z), (0%Z < i)%Z -> (i = q) ->
  ((int.EuclideanDivision.mod1 i q) = 0%Z).

Axiom bound_div_gen :
  forall (q:Z) (f:Z), (0%Z < q)%Z -> (0%Z <= f)%Z -> forall (i:Z),
  ((0%Z <= i)%Z /\ (i < (q * f)%Z)%Z) ->
  ((int.EuclideanDivision.div i q) < f)%Z.

Axiom mod_invariant :
  forall (i:Z) (q:Z) (f:Z), (0%Z <= i)%Z -> (0%Z < q)%Z -> (0%Z < f)%Z ->
  ((int.EuclideanDivision.mod1
    ((q * (f * (int.EuclideanDivision.div i (q * f)%Z))%Z)%Z +
     (int.EuclideanDivision.mod1 i (q * f)%Z))%Z
    q)
   = (int.EuclideanDivision.mod1 (int.EuclideanDivision.mod1 i (q * f)%Z) q)).

Axiom mod_inf :
  forall (i:Z) (q:Z), ((0%Z <= i)%Z /\ (i < q)%Z) ->
  ((int.EuclideanDivision.mod1 i q) = i).

Axiom add_mod :
  forall (a:Z) (b:Z) (c:Z), (c > 0%Z)%Z ->
  ((int.EuclideanDivision.mod1
    ((int.EuclideanDivision.mod1 a c) + (int.EuclideanDivision.mod1 b c))%Z
    c)
   = (int.EuclideanDivision.mod1 (a + b)%Z c)).

Axiom add_mod_eq :
  forall (a:Z) (b:Z) (c:Z) (d:Z) (n:Z), (0%Z < n)%Z ->
  ((int.EuclideanDivision.mod1 a n) = (int.EuclideanDivision.mod1 c n)) ->
  ((int.EuclideanDivision.mod1 b n) = (int.EuclideanDivision.mod1 d n)) ->
  ((int.EuclideanDivision.mod1 (a + b)%Z n) =
   (int.EuclideanDivision.mod1 (c + d)%Z n)).

Axiom add_mod_left :
  forall (a:Z) (b:Z) (c:Z), (c > 0%Z)%Z ->
  ((int.EuclideanDivision.mod1 ((int.EuclideanDivision.mod1 a c) + b)%Z c) =
   (int.EuclideanDivision.mod1 (a + b)%Z c)).

Axiom simpl_add_mod_left :
  forall (a:Z) (b:Z) (c:Z), (c > 0%Z)%Z ->
  ((int.EuclideanDivision.mod1 a c) = 0%Z) ->
  ((int.EuclideanDivision.mod1 (a + b)%Z c) =
   (int.EuclideanDivision.mod1 b c)).

Axiom add_mod_right :
  forall (a:Z) (b:Z) (c:Z), (c > 0%Z)%Z ->
  ((int.EuclideanDivision.mod1 (a + (int.EuclideanDivision.mod1 b c))%Z c) =
   (int.EuclideanDivision.mod1 (a + b)%Z c)).

Axiom mod_mod_left :
  forall (i:Z) (j:Z) (f:Z), (0%Z < j)%Z -> (0%Z < f)%Z ->
  ((int.EuclideanDivision.mod1 (int.EuclideanDivision.mod1 i (f * j)%Z) j) =
   (int.EuclideanDivision.mod1 i j)).

Axiom mult_mod :
  forall (a:Z) (b:Z) (c:Z), (c > 0%Z)%Z ->
  ((int.EuclideanDivision.mod1
    ((int.EuclideanDivision.mod1 a c) * (int.EuclideanDivision.mod1 b c))%Z
    c)
   = (int.EuclideanDivision.mod1 (a * b)%Z c)).

Axiom mod_mod_mult :
  forall (a:Z) (b:Z) (c:Z), (0%Z < b)%Z ->
  ((int.EuclideanDivision.mod1
    ((int.EuclideanDivision.mod1 a b) * (int.EuclideanDivision.mod1 c b))%Z
    b)
   = (int.EuclideanDivision.mod1 (a * c)%Z b)).

Axiom mod_mod_mult_rev :
  forall (a:Z) (b:Z) (c:Z), (0%Z < b)%Z ->
  ((int.EuclideanDivision.mod1 (a * c)%Z b) =
   (int.EuclideanDivision.mod1
    ((int.EuclideanDivision.mod1 a b) * (int.EuclideanDivision.mod1 c b))%Z
    b)).

Axiom mod_mod_i :
  forall (i:Z) (j:Z), (0%Z < j)%Z ->
  ((int.EuclideanDivision.mod1 (int.EuclideanDivision.mod1 i j) j) =
   (int.EuclideanDivision.mod1 i j)).

Axiom binary_prod :
  forall (i:Z) (j:Z), (0%Z <= i)%Z -> (0%Z < j)%Z ->
  ((int.EuclideanDivision.mod1
    ((int.EuclideanDivision.mod1 i 2%Z) *
     (int.EuclideanDivision.mod1 j 2%Z))%Z
    2%Z)
   = (int.EuclideanDivision.mod1 (i * j)%Z 2%Z)).

Axiom mod_minus :
  forall (a:Z) (b:Z) (c:Z), (0%Z < b)%Z ->
  ((int.EuclideanDivision.mod1 a b) = c) ->
  ((int.EuclideanDivision.mod1 (-a)%Z b) =
   (int.EuclideanDivision.mod1 (-c)%Z b)).

Axiom mult_mod_left :
  forall (a:Z) (b:Z) (c:Z), (c > 0%Z)%Z ->
  ((int.EuclideanDivision.mod1 ((int.EuclideanDivision.mod1 a c) * b)%Z c) =
   (int.EuclideanDivision.mod1 (a * b)%Z c)).

Axiom mult_mod_right :
  forall (a:Z) (b:Z) (c:Z), (c > 0%Z)%Z ->
  ((int.EuclideanDivision.mod1 (a * (int.EuclideanDivision.mod1 b c))%Z c) =
   (int.EuclideanDivision.mod1 (a * b)%Z c)).

Axiom mod_mod_right :
  forall (i:Z) (j:Z) (f:Z), (0%Z <= i)%Z -> (0%Z < j)%Z -> (0%Z < f)%Z ->
  ((int.EuclideanDivision.mod1 (int.EuclideanDivision.mod1 i (j * f)%Z) j) =
   (int.EuclideanDivision.mod1 i j)).

Axiom mod_mod_rev :
  forall (i:Z) (j:Z) (f:Z), (0%Z <= i)%Z -> (0%Z < j)%Z -> (0%Z < f)%Z ->
  ((int.EuclideanDivision.mod1 i j) =
   (int.EuclideanDivision.mod1 (int.EuclideanDivision.mod1 i (j * f)%Z) j)).

Axiom mod_mod_rev1 :
  forall (i:Z) (j:Z) (f:Z), (0%Z <= i)%Z -> (0%Z < j)%Z -> (0%Z < f)%Z ->
  ((int.EuclideanDivision.mod1 i j) =
   (int.EuclideanDivision.mod1 (int.EuclideanDivision.mod1 i (f * j)%Z) j)).

Axiom mod_mod_plus :
  forall (i:Z) (j:Z), (0%Z <= i)%Z -> (0%Z < j)%Z ->
  ((int.EuclideanDivision.mod1 i j) =
   (int.EuclideanDivision.mod1 (int.EuclideanDivision.mod1 i (j + j)%Z) j)).

Axiom mod_mod_add_left :
  forall (a:Z) (b:Z) (c:Z), (0%Z < c)%Z ->
  ((int.EuclideanDivision.mod1 ((int.EuclideanDivision.mod1 a c) + b)%Z c) =
   (int.EuclideanDivision.mod1 (a + b)%Z c)).

Axiom mod_mod_add_right :
  forall (a:Z) (b:Z) (c:Z), (0%Z < c)%Z ->
  ((int.EuclideanDivision.mod1 (a + (int.EuclideanDivision.mod1 b c))%Z c) =
   (int.EuclideanDivision.mod1 (a + b)%Z c)).

Axiom mod_mod_add_left_rev :
  forall (a:Z) (b:Z) (c:Z), (0%Z < c)%Z ->
  ((int.EuclideanDivision.mod1 (a + b)%Z c) =
   (int.EuclideanDivision.mod1 ((int.EuclideanDivision.mod1 a c) + b)%Z c)).

Axiom mod_mod_add_right_rev :
  forall (a:Z) (b:Z) (c:Z), (0%Z < c)%Z ->
  ((int.EuclideanDivision.mod1 (a + b)%Z c) =
   (int.EuclideanDivision.mod1 (a + (int.EuclideanDivision.mod1 b c))%Z c)).

Axiom mult_assoc1 :
  forall (i:Z) (q:Z) (f:Z), (0%Z <= i)%Z -> (0%Z < q)%Z -> (0%Z < f)%Z ->
  ((q * (f * (int.EuclideanDivision.div i (q * f)%Z))%Z)%Z =
   ((q * f)%Z * (int.EuclideanDivision.div i (q * f)%Z))%Z).

Axiom div_div1 :
  forall (i:Z) (j:Z) (k:Z), (0%Z <= i)%Z -> (0%Z < j)%Z -> (0%Z < k)%Z ->
  ((int.EuclideanDivision.div (int.EuclideanDivision.div i k) j) =
   (int.EuclideanDivision.div i (k * j)%Z)).

Axiom div_div2 :
  forall (i:Z) (j:Z) (k:Z), (0%Z <= i)%Z -> (0%Z < j)%Z -> (0%Z < k)%Z ->
  ((int.EuclideanDivision.div (int.EuclideanDivision.div i k) j) =
   (int.EuclideanDivision.div i (j * k)%Z)).

Axiom compat_order_div :
  forall (i:Z) (i':Z) (j:Z), ((0%Z <= i)%Z /\ (i <= i')%Z) -> (0%Z < j)%Z ->
  ((int.EuclideanDivision.div i j) <= (int.EuclideanDivision.div i' j))%Z.

Axiom mod_div :
  forall (i:Z) (j:Z) (k:Z), (0%Z <= i)%Z -> (0%Z < j)%Z -> (0%Z < k)%Z ->
  ((int.EuclideanDivision.div (int.EuclideanDivision.mod1 i (j * k)%Z) j) =
   (int.EuclideanDivision.mod1 (int.EuclideanDivision.div i j) k)).

Axiom inf_mul :
  forall (ia:Z) (ib:Z) (a:Z) (b:Z), ((0%Z <= ia)%Z /\ (ia < a)%Z) ->
  ((0%Z <= ib)%Z /\ (ib < b)%Z) -> (((a * ib)%Z + ia)%Z < (a * b)%Z)%Z.

Axiom inf_mul1 :
  forall (ia:Z) (ib:Z) (a:Z) (b:Z), ((0%Z <= ia)%Z /\ (ia < a)%Z) ->
  ((0%Z <= ib)%Z /\ (ib < b)%Z) -> (((ib * a)%Z + ia)%Z < (b * a)%Z)%Z.

Axiom inf_mul_gen :
  forall (n:Z) (v:Z) (p:Z), ((0%Z <= p)%Z /\ (p < v)%Z) -> forall (k:Z),
  ((0%Z <= k)%Z /\ (k < n)%Z) -> (((k * v)%Z + p)%Z < (n * v)%Z)%Z.

Axiom inf_mul_gen_b :
  forall (n:Z) (v:Z) (p:Z), ((0%Z <= p)%Z /\ (p < n)%Z) -> forall (k:Z),
  ((0%Z <= k)%Z /\ (k < v)%Z) -> (((p * v)%Z + k)%Z < (n * v)%Z)%Z.

Axiom inf_mul_comm :
  forall (i:Z) (bi:Z) (quot:Z) (rest:Z), ((0%Z <= i)%Z /\ (i < bi)%Z) ->
  (0%Z < rest)%Z -> (0%Z < quot)%Z -> (bi = (quot * rest)%Z) ->
  ((int.EuclideanDivision.mod1 i rest) < rest)%Z.

Axiom indic_div_mod :
  forall (i:Z) (j:Z) (q:Z), (0%Z <= i)%Z -> (0%Z <= j)%Z -> (0%Z < q)%Z ->
  ((indic i j) =
   (infix_asdt
    (indic (int.EuclideanDivision.mod1 i q) (int.EuclideanDivision.mod1 j q))
    (indic (int.EuclideanDivision.div i q) (int.EuclideanDivision.div j q)))).

Axiom indic_div_mod_gen :
  forall (q:Z), (0%Z < q)%Z -> forall (i:Z) (j:Z),
  ((0%Z <= i)%Z /\ (0%Z <= j)%Z) ->
  ((indic i j) =
   (infix_asdt
    (indic (int.EuclideanDivision.mod1 i q) (int.EuclideanDivision.mod1 j q))
    (indic (int.EuclideanDivision.div i q) (int.EuclideanDivision.div j q)))).

Axiom set_inf : True.

Axiom set_infeq : True.

Axiom bounded_cycle :
  forall (a:Z) (b:Z) (c:Z) (d:Z), (0%Z <= a)%Z -> (0%Z < b)%Z ->
  ((0%Z <= d)%Z /\ (d < b)%Z) -> (0%Z < c)%Z ->
  ((int.EuclideanDivision.div ((a * b)%Z + d)%Z (b * c)%Z) =
   (int.EuclideanDivision.div a c)).

Axiom div_mod_minus :
  forall (a:Z) (b:Z), (0%Z < b)%Z -> (0%Z < a)%Z ->
  ((int.EuclideanDivision.mod1 (-a)%Z b) =
   (b - (int.EuclideanDivision.mod1 a b))%Z).

Axiom mod_mod_iproduct :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> Z) (b:Z), (0%Z < b)%Z ->
  ((int.EuclideanDivision.mod1
    (iproduct s (fun (i:a) => (int.EuclideanDivision.mod1 (f i) b))) b)
   = (int.EuclideanDivision.mod1 (iproduct s f) b)).

Axiom ind_isum_mod_eq :
  forall (f:Z -> Z) (g:Z -> Z) (i:Z) (j:Z) (n:Z), (0%Z < n)%Z ->
  (forall (k:Z), ((i <= k)%Z /\ (k < j)%Z) ->
   ((int.EuclideanDivision.mod1 (f k) n) =
    (int.EuclideanDivision.mod1 (g k) n))) ->
  ((int.EuclideanDivision.mod1 (ind_isum f i j) n) =
   (int.EuclideanDivision.mod1 (ind_isum g i j) n)).

Parameter binary: (Z -> Z) -> Prop.

Axiom binary_def :
  forall (t:Z -> Z), (binary t) -> forall (k:Z), (0%Z <= (t k))%Z.

Axiom binary_def1 :
  forall (t:Z -> Z), (binary t) -> forall (k:Z), ((t k) < 2%Z)%Z.

Axiom binary_def2 :
  forall (t:Z -> Z), (forall (k:Z), (0%Z <= (t k))%Z /\ ((t k) < 2%Z)%Z) ->
  binary t.

Axiom set_binary :
  forall (t:Z -> Z), (forall (k:Z), (0%Z <= (t k))%Z /\ ((t k) < 2%Z)%Z) ->
  binary t.

Axiom get_binary :
  forall (t:Z -> Z), (binary t) -> forall (k:Z), (0%Z <= (t k))%Z.

Axiom get_binary1 :
  forall (t:Z -> Z), (binary t) -> forall (k:Z), ((t k) < 2%Z)%Z.

Parameter shift: forall {a:Type} {a_WT:WhyType a}, (Z -> a) -> Z -> Z -> a.

Axiom shift_def :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:Z -> a) (i:Z) (k:Z), ((shift f i k) = (f (k + i)%Z)).

Axiom shift_value :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:Z -> a) (i:Z) (k:Z), ((shift f i k) = (f (k + i)%Z)).

Axiom shiftz :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:Z -> a) (k:Z), ((shift f 0%Z k) = (f k)).

Axiom shiftz_gen :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:Z -> a) (i:Z) (k:Z), (i = 0%Z) -> ((shift f i k) = (f k)).

Axiom shiftz_quant :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:Z -> a),
  ((((fun (y0:Z -> a) (y1:Z) (y2:Z) => (shift y0 y1 y2)) f) 0%Z) = f).

Axiom shiftz_quant_rev :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:Z -> a),
  (f = (((fun (y0:Z -> a) (y1:Z) (y2:Z) => (shift y0 y1 y2)) f) 0%Z)).

Parameter concat_fun:
  forall {a:Type} {a_WT:WhyType a}, (Z -> a) -> (Z -> a) -> Z -> Z -> a.

Axiom concat_fun_def :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:Z -> a) (g:Z -> a) (i:Z) (k:Z), (k < i)%Z ->
  ((concat_fun f g i k) = (f k)).

Axiom concat_fun_def1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:Z -> a) (g:Z -> a) (i:Z) (k:Z), ~ (k < i)%Z ->
  ((concat_fun f g i k) = (g (k - i)%Z)).

Axiom shift_add :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:Z -> a) (i:Z) (j:Z) (k:Z),
  ((shift (((fun (y0:Z -> a) (y1:Z) (y2:Z) => (shift y0 y1 y2)) f) j) i k) =
   (shift f (i + j)%Z k)).

Axiom concat_fun_value :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:Z -> a) (g:Z -> a) (i:Z) (k:Z),
  ((k < i)%Z -> ((concat_fun f g i k) = (f k))) /\
  (~ (k < i)%Z -> ((concat_fun f g i k) = (g (k - i)%Z))).

Axiom concat_eq :
  forall {a:Type} {a_WT:WhyType a},
  forall (f1:Z -> a) (g1:Z -> a) (f2:Z -> a) (g2:Z -> a) (i1:Z) (i2:Z) (k:Z),
  (forall (l:Z), (l < i1)%Z -> ((f1 l) = (f2 l))) ->
  (forall (l:Z), (l >= 0%Z)%Z -> ((g1 l) = (g2 l))) -> (i1 = i2) ->
  ((concat_fun f1 g1 i1 k) = (concat_fun f2 g2 i2 k)).

Parameter mod_func:
  forall {a:Type} {a_WT:WhyType a}, (Z -> a) -> Z -> Z -> a.

Axiom mod_func_def :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:Z -> a) (k:Z) (i:Z), (k > 0%Z)%Z ->
  ((mod_func f k i) = (f (int.EuclideanDivision.mod1 i k))).

Axiom mod_func_inf :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:Z -> a) (k:Z) (i:Z), (k > 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < k)%Z) -> ((mod_func f k i) = (f i)).

Axiom shift_mod :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:Z -> a) (k:Z) (i:Z), (k > 0%Z)%Z ->
  ((mod_func f k i) =
   (shift (((fun (y0:Z -> a) (y1:Z) (y2:Z) => (mod_func y0 y1 y2)) f) k) k i)).

Axiom shift_mod_rev :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:Z -> a) (k:Z) (i:Z), (k > 0%Z)%Z ->
  ((shift (((fun (y0:Z -> a) (y1:Z) (y2:Z) => (mod_func y0 y1 y2)) f) k) k i)
   = (mod_func f k i)).

Parameter head_bit: Z -> Z -> Z.

Axiom head_bit_def :
  forall (i:Z) (k:Z), (k > 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z k))%Z) ->
  ((head_bit i k) = (int.EuclideanDivision.div i (power 2%Z (k - 1%Z)%Z))).

Axiom head_bit_spec :
  forall (i:Z) (k:Z), (k > 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z k))%Z) -> (0%Z <= (head_bit i k))%Z.

Axiom head_bit_spec1 :
  forall (i:Z) (k:Z), (k > 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z k))%Z) -> ((head_bit i k) <= 1%Z)%Z.

Parameter tail_bits: Z -> Z -> Z.

Axiom tail_bits_def :
  forall (i:Z) (k:Z), (k > 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z k))%Z) ->
  ((tail_bits i k) = (int.EuclideanDivision.mod1 i (power 2%Z (k - 1%Z)%Z))).

Axiom tail_bits_spec :
  forall (i:Z) (k:Z), (k > 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z k))%Z) -> (0%Z <= (tail_bits i k))%Z.

Axiom tail_bits_spec1 :
  forall (i:Z) (k:Z), (k > 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z k))%Z) ->
  ((tail_bits i k) <= (power 2%Z (k - 1%Z)%Z))%Z.

Parameter ht_to_int: Z -> Z -> Z -> Z.

Axiom ht_to_int_def :
  forall (hi:Z) (ti:Z) (k:Z), (0%Z < k)%Z ->
  ((0%Z <= hi)%Z /\ (hi < 2%Z)%Z) ->
  ((0%Z <= ti)%Z /\ (ti < (power 2%Z (k - 1%Z)%Z))%Z) ->
  ((ht_to_int hi ti k) = ((hi * (power 2%Z (k - 1%Z)%Z))%Z + ti)%Z).

Axiom head_tail_inv :
  forall (i:Z) (k:Z), (k > 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z k))%Z) ->
  ((ht_to_int (head_bit i k) (tail_bits i k) k) = i).

Axiom ht_to_int_head :
  forall (i:Z) (ti:Z) (k:Z), (k > 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z k))%Z) ->
  ((0%Z <= ti)%Z /\ (ti < (power 2%Z (k - 1%Z)%Z))%Z) ->
  ((head_bit (ht_to_int (head_bit i k) ti k) k) = (head_bit i k)).

Axiom ht_to_int_tail :
  forall (hi:Z) (i:Z) (k:Z), (k > 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z k))%Z) ->
  ((0%Z <= hi)%Z /\ (hi < 2%Z)%Z) ->
  ((tail_bits (ht_to_int hi (tail_bits i k) k) k) = (tail_bits i k)).

Axiom concat_fun_bin_i :
  forall (f:Z -> Z) (g:Z -> Z) (i:Z) (k:Z), (binary f) -> (binary g) ->
  (0%Z <= (concat_fun f g i k))%Z.

Axiom concat_fun_bin_i1 :
  forall (f:Z -> Z) (g:Z -> Z) (i:Z) (k:Z), (binary f) -> (binary g) ->
  ((concat_fun f g i k) < 2%Z)%Z.

Axiom shift_bin_i :
  forall (f:Z -> Z) (i:Z) (k:Z), (binary f) -> (0%Z <= (shift f i k))%Z.

Axiom shift_bin_i1 :
  forall (f:Z -> Z) (i:Z) (k:Z), (binary f) -> ((shift f i k) < 2%Z)%Z.

Axiom concat_fun_bin :
  forall (f:Z -> Z) (g:Z -> Z) (i:Z), (binary f) -> (binary g) ->
  binary
  ((((fun (y0:Z -> Z) (y1:Z -> Z) (y2:Z) (y3:Z) => (concat_fun y0 y1 y2 y3))
     f)
    g)
   i).

Axiom mod_func_bin :
  forall (f:Z -> Z) (k:Z), (k > 0%Z)%Z -> (binary f) ->
  binary (((fun (y0:Z -> Z) (y1:Z) (y2:Z) => (mod_func y0 y1 y2)) f) k).

Axiom shift_bin :
  forall (f:Z -> Z) (i:Z), (binary f) ->
  binary (((fun (y0:Z -> Z) (y1:Z) (y2:Z) => (shift y0 y1 y2)) f) i).

Axiom binary_comp :
  forall (f:Z -> Z) (g:Z -> Z), (binary f) -> binary (fun (x:Z) => (f (g x))).

Axiom set_is_all_binary :
  forall (t:Z -> Z), (forall (k:Z), (0%Z <= (t k))%Z /\ ((t k) < 2%Z)%Z) ->
  binary t.

Parameter nary_length: Z -> Z -> Z.

Axiom nary_length_spec :
  forall (i:Z) (n:Z), (1%Z < n)%Z -> (0%Z <= i)%Z -> (0%Z < i)%Z ->
  ((power n ((nary_length i n) - 1%Z)%Z) <= i)%Z.

Axiom nary_length_spec1 :
  forall (i:Z) (n:Z), (1%Z < n)%Z -> (0%Z <= i)%Z -> (0%Z < i)%Z ->
  (i < (power n (nary_length i n)))%Z.

Axiom nary_length_spec2 :
  forall (i:Z) (n:Z), (1%Z < n)%Z -> (0%Z <= i)%Z -> (i < n)%Z ->
  ((nary_length i n) = 1%Z).

Axiom nary_length_spec3 :
  forall (i:Z) (n:Z), (1%Z < n)%Z -> (0%Z <= i)%Z ->
  ((nary_length i n) >= 1%Z)%Z.

Axiom nary_length_spec4 :
  forall (i:Z) (n:Z), (1%Z < n)%Z -> (0%Z <= i)%Z ->
  (i = (int.EuclideanDivision.mod1 i (power n (nary_length i n)))).

Parameter binary_length: Z -> Z.

Axiom binary_length_def :
  forall (i:Z), (0%Z <= i)%Z -> ((binary_length i) = (nary_length i 2%Z)).

Axiom binary_length_spec :
  forall (i:Z), (0%Z <= i)%Z -> (0%Z < i)%Z ->
  ((power 2%Z ((binary_length i) - 1%Z)%Z) <= i)%Z.

Axiom binary_length_spec1 :
  forall (i:Z), (0%Z <= i)%Z -> (0%Z < i)%Z ->
  (i < (power 2%Z (binary_length i)))%Z.

Axiom binary_length_spec2 :
  forall (i:Z), (0%Z <= i)%Z -> (i < 2%Z)%Z -> ((binary_length i) = 1%Z).

Axiom binary_length_spec3 :
  forall (i:Z), (0%Z <= i)%Z -> ((binary_length i) >= 1%Z)%Z.

Axiom binary_length_spec4 :
  forall (i:Z), (0%Z <= i)%Z ->
  (i = (int.EuclideanDivision.mod1 i (power 2%Z (binary_length i)))).

Axiom set_binary_length :
  forall (i:Z) (k:Z), (0%Z <= i)%Z -> (0%Z <= k)%Z -> ~ (0%Z < i)%Z ->
  ~ (i < 2%Z)%Z -> (k = (binary_length i)).

Axiom set_binary_length1 :
  forall (i:Z) (k:Z), (0%Z <= i)%Z -> (0%Z <= k)%Z -> ~ (0%Z < i)%Z ->
  (k = 1%Z) -> (k = (binary_length i)).

Axiom set_binary_length2 :
  forall (i:Z) (k:Z), (0%Z <= i)%Z -> (0%Z <= k)%Z ->
  (((power 2%Z (k - 1%Z)%Z) <= i)%Z /\ (i < (power 2%Z k))%Z) ->
  ~ (i < 2%Z)%Z -> (k = (binary_length i)).

Axiom set_binary_length3 :
  forall (i:Z) (k:Z), (0%Z <= i)%Z -> (0%Z <= k)%Z ->
  (((power 2%Z (k - 1%Z)%Z) <= i)%Z /\ (i < (power 2%Z k))%Z) -> (k = 1%Z) ->
  (k = (binary_length i)).

Axiom set_binary_length_b :
  forall (i:Z) (k:Z), (0%Z <= i)%Z -> (0%Z < k)%Z -> (i < (power 2%Z k))%Z ->
  ((binary_length i) <= k)%Z.

Axiom bitvec : Type.
Parameter bitvec_WhyType : WhyType bitvec.
Existing Instance bitvec_WhyType.

Parameter value: bitvec -> Z -> Z.

Parameter length: bitvec -> Z.

Axiom bitvec'invariant : forall (self:bitvec), (0%Z <= (length self))%Z.

Axiom bitvec'invariant1 :
  forall (self:bitvec), forall (i:Z),
  ((0%Z <= i)%Z /\ (i < (length self))%Z) -> (0%Z <= ((value self) i))%Z.

Axiom bitvec'invariant2 :
  forall (self:bitvec), forall (i:Z),
  ((0%Z <= i)%Z /\ (i < (length self))%Z) -> (((value self) i) < 2%Z)%Z.

Axiom bitvec'invariant3 :
  forall (self:bitvec), forall (i:Z), ~ (0%Z <= i)%Z ->
  (((value self) i) = 0%Z).

Axiom bitvec'invariant4 :
  forall (self:bitvec), forall (i:Z), ~ (i < (length self))%Z ->
  (((value self) i) = 0%Z).

Parameter bvlength: (Z -> Z) -> Z -> Prop.

Axiom bvlength_def :
  forall (f:Z -> Z) (i:Z), (bvlength f i) -> forall (k:Z),
  ((0%Z <= k)%Z /\ (k < i)%Z) -> (0%Z <= (f k))%Z.

Axiom bvlength_def1 :
  forall (f:Z -> Z) (i:Z), (bvlength f i) -> forall (k:Z),
  ((0%Z <= k)%Z /\ (k < i)%Z) -> ((f k) < 2%Z)%Z.

Axiom bvlength_def2 :
  forall (f:Z -> Z) (i:Z),
  (forall (k:Z), ((0%Z <= k)%Z /\ (k < i)%Z) ->
   (0%Z <= (f k))%Z /\ ((f k) < 2%Z)%Z) ->
  bvlength f i.

Axiom binary_mult :
  forall (a:Z) (b:Z),
  ((int.EuclideanDivision.mod1 (a * b)%Z 2%Z) =
   ((int.EuclideanDivision.mod1 a 2%Z) *
    (int.EuclideanDivision.mod1 b 2%Z))%Z).

Parameter getbv: bitvec -> Z -> Z.

Axiom getbv_def : forall (a:bitvec), ((getbv a) = (value a)).

Axiom getbv_spec : forall (a:bitvec), binary (getbv a).

Axiom getbv_spec1 :
  forall (a:bitvec), forall (i:Z), (((getbv a) i) = ((value a) i)).

Parameter to_bool: Z -> bool.

Axiom to_bool_def :
  forall (i:Z), ((0%Z <= i)%Z /\ (i < 2%Z)%Z) -> ~ (i = 0%Z) ->
  ((to_bool i) = true).

Axiom to_bool_def1 :
  forall (i:Z), ((0%Z <= i)%Z /\ (i < 2%Z)%Z) -> (i = 0%Z) ->
  ((to_bool i) = false).

Axiom getbv_bound : forall (bv:bitvec) (i:Z), (0%Z <= ((getbv bv) i))%Z.

Axiom getbv_bound1 : forall (bv:bitvec) (i:Z), (((getbv bv) i) < 2%Z)%Z.

Axiom getbv_eq :
  forall (bvx:bitvec) (bvy:bitvec) (i:Z), (bvx = bvy) ->
  (((getbv bvx) i) = ((getbv bvy) i)).

Axiom getbv_eq_gen :
  forall (bvx:bitvec) (bvy:bitvec) (i:Z) (j:Z), (bvx = bvy) -> (i = j) ->
  (((getbv bvx) i) = ((getbv bvy) j)).

Parameter setbv: (Z -> Z) -> Z -> Z -> Z -> Z.

Axiom setbv_def :
  forall (bv:Z -> Z) (i:Z) (j:Z),
  let result6 := setbv bv i j in
  forall (k:Z),
  ((k = i) -> ((result6 k) = j)) /\ (~ (k = i) -> ((result6 k) = (bv k))).

Axiom setbv_spec :
  forall (bv:Z -> Z) (i:Z) (j:Z), forall (k:Z), ~ (k = i) ->
  (((setbv bv i j) k) = (bv k)).

Axiom setbv_spec1 : forall (bv:Z -> Z) (i:Z) (j:Z), (((setbv bv i j) i) = j).

Parameter setbv_int: (Z -> Z) -> (Z -> Z) -> Z -> Z -> Z -> Z.

Axiom setbv_int_def :
  forall (bv1:Z -> Z) (bv2:Z -> Z) (i:Z) (j:Z),
  let result6 := setbv_int bv1 bv2 i j in
  forall (k:Z),
  (((i < k)%Z /\ (k <= j)%Z) -> ((result6 k) = (bv2 (k - i)%Z))) /\
  (~ ((i < k)%Z /\ (k <= j)%Z) -> ((result6 k) = (bv1 k))).

Axiom setbv_int_spec :
  forall (bv1:Z -> Z) (bv2:Z -> Z) (i:Z) (j:Z), forall (k:Z),
  ((i < k)%Z /\ (k <= j)%Z) ->
  (((setbv_int bv1 bv2 i j) k) = (bv2 (k - i)%Z)).

Axiom setbv_int_spec1 :
  forall (bv1:Z -> Z) (bv2:Z -> Z) (i:Z) (j:Z), forall (k:Z), (k <= i)%Z ->
  (((setbv_int bv1 bv2 i j) k) = (bv1 k)).

Axiom setbv_int_spec2 :
  forall (bv1:Z -> Z) (bv2:Z -> Z) (i:Z) (j:Z), forall (k:Z), (j < k)%Z ->
  (((setbv_int bv1 bv2 i j) k) = (bv1 k)).

Axiom set_bvlength :
  forall (bv:bitvec) (i:Z),
  (forall (k:Z), ((1%Z <= k)%Z /\ (k < i)%Z) ->
   (0%Z <= ((getbv bv) k))%Z /\ (((getbv bv) k) < 2%Z)%Z) ->
  bvlength (getbv bv) i.

Axiom null_product_bitvec :
  forall (x:bitvec) (n:Z), (n = (length x)) ->
  (forall (i:Z), ((0%Z <= i)%Z /\ (i < n)%Z) -> (((getbv x) i) = 1%Z)) ->
  ((ind_iproduct (getbv x) 0%Z n) = 1%Z).

Axiom non_null_product_bitvec :
  forall (x:bitvec) (n:Z), (n = (length x)) ->
  ~ (forall (i:Z), ((0%Z <= i)%Z /\ (i < n)%Z) -> (((getbv x) i) = 1%Z)) ->
  ((ind_iproduct (getbv x) 0%Z n) = 0%Z).

Axiom null_product_bitvec_inv :
  forall (x:bitvec) (n:Z), (n = (length x)) ->
  (forall (i:Z), ((0%Z <= i)%Z /\ (i < n)%Z) -> (((getbv x) i) = 0%Z)) ->
  ((ind_iproduct (fun (i:Z) => (1%Z - ((getbv x) i))%Z) 0%Z n) = 1%Z).

Axiom non_null_product_bitvec_inv :
  forall (x:bitvec) (n:Z), (n = (length x)) ->
  ~ (forall (i:Z), ((0%Z <= i)%Z /\ (i < n)%Z) -> (((getbv x) i) = 0%Z)) ->
  ((ind_iproduct (fun (i:Z) => (1%Z - ((getbv x) i))%Z) 0%Z n) = 0%Z).

Axiom null_product_bitvec_rev :
  forall (x:bitvec) (n:Z), (n = (length x)) ->
  ((ind_iproduct (getbv x) 0%Z n) = 1%Z) -> forall (i:Z),
  ((0%Z <= i)%Z /\ (i < n)%Z) -> (((getbv x) i) = 1%Z).

Axiom non_null_product_bitvec_rev :
  forall (x:bitvec) (n:Z), (n = (length x)) ->
  ((ind_iproduct (getbv x) 0%Z n) = 0%Z) ->
  ~ (forall (i:Z), ((0%Z <= i)%Z /\ (i < n)%Z) -> (((getbv x) i) = 1%Z)).

Axiom null_product_bitvec_inv_rev :
  forall (x:bitvec) (n:Z), (n = (length x)) ->
  ((ind_iproduct (fun (i:Z) => (1%Z - ((getbv x) i))%Z) 0%Z n) = 1%Z) ->
  forall (i:Z), ((0%Z <= i)%Z /\ (i < n)%Z) -> (((getbv x) i) = 0%Z).

Axiom inter1 :
  forall (x:bitvec) (n:Z) (k:Z), (n = (length x)) ->
  ((ind_iproduct (fun (i:Z) => (1%Z - ((getbv x) i))%Z) 0%Z n) = 0%Z) ->
  ((0%Z <= k)%Z /\ (k <= n)%Z) ->
  (forall (i:Z), ((0%Z <= i)%Z /\ (i < n)%Z) -> (((getbv x) i) = 0%Z)) ->
  ((ind_iproduct (fun (i:Z) => (1%Z - ((getbv x) i))%Z) 0%Z k) = 1%Z).

Axiom non_null_product_bitvec_inv_rev :
  forall (x:bitvec) (n:Z), (n = (length x)) ->
  ((ind_iproduct (fun (i:Z) => (1%Z - ((getbv x) i))%Z) 0%Z n) = 0%Z) ->
  ~ (forall (i:Z), ((0%Z <= i)%Z /\ (i < n)%Z) -> (((getbv x) i) = 0%Z)).

Axiom set_flength :
  forall (f:Z -> Z) (i:Z),
  (forall (k:Z), ((0%Z <= k)%Z /\ (k < i)%Z) ->
   (0%Z <= (f k))%Z /\ ((f k) < 2%Z)%Z) ->
  bvlength f i.

Axiom get_bvlength :
  forall (f:Z -> Z) (i:Z), (bvlength f i) -> forall (k:Z),
  ((0%Z <= k)%Z /\ (k < i)%Z) -> (0%Z <= (f k))%Z.

Axiom get_bvlength1 :
  forall (f:Z -> Z) (i:Z), (bvlength f i) -> forall (k:Z),
  ((0%Z <= k)%Z /\ (k < i)%Z) -> ((f k) < 2%Z)%Z.

Axiom set_bv_to :
  forall (f:Z -> Z) (i:Z), (0%Z < i)%Z ->
  (forall (j:Z), ((0%Z <= j)%Z /\ (j < i)%Z) ->
   (0%Z <= (f j))%Z /\ ((f j) <= 1%Z)%Z) ->
  bvlength f i.

Axiom set_in_range_val :
  forall (bv:bitvec) (i:Z), ((0%Z <= i)%Z /\ (i < (length bv))%Z) ->
  (0%Z <= ((getbv bv) i))%Z.

Axiom set_in_range_val1 :
  forall (bv:bitvec) (i:Z), ((0%Z <= i)%Z /\ (i < (length bv))%Z) ->
  (((getbv bv) i) < 2%Z)%Z.

Axiom bvlengthm :
  forall (bv:bitvec) (i:Z), ((0%Z <= i)%Z /\ (i < (length bv))%Z) ->
  bvlength (getbv bv) i.

Parameter in_range: bitvec -> Z -> Prop.

Axiom in_range_def :
  forall (bv:bitvec) (r:Z), (in_range bv r) -> (0%Z <= r)%Z.

Axiom in_range_def1 :
  forall (bv:bitvec) (r:Z), (in_range bv r) -> (r < (length bv))%Z.

Axiom in_range_def2 :
  forall (bv:bitvec) (r:Z), ((0%Z <= r)%Z /\ (r < (length bv))%Z) ->
  in_range bv r.

Axiom binary_bv :
  forall (bv:bitvec) (i:Z), (in_range bv i) -> (0%Z <= ((getbv bv) i))%Z.

Axiom binary_bv1 :
  forall (bv:bitvec) (i:Z), (in_range bv i) -> (((getbv bv) i) <= 1%Z)%Z.

Axiom equal_bv :
  forall (m:bitvec) (n:bitvec), (m = n) -> ((length m) = (length n)).

Axiom equal_bv1 :
  forall (m:bitvec) (n:bitvec), (m = n) -> forall (i:Z), (in_range m i) ->
  (((getbv m) i) = ((getbv n) i)).

Axiom equal_bv2 :
  forall (m:bitvec) (n:bitvec),
  (((length m) = (length n)) /\
   forall (i:Z), (in_range m i) -> (((getbv m) i) = ((getbv n) i))) ->
  (m = n).

Axiom set_equal_bv :
  forall (bv:bitvec) (bv':bitvec), ((length bv) = (length bv')) ->
  (forall (i:Z), ((0%Z <= i)%Z /\ (i < (length bv))%Z) ->
   (((getbv bv) i) = ((getbv bv') i))) ->
  (bv = bv').

Axiom get_equal_bv :
  forall (bv:bitvec) (bv':bitvec), (bv = bv') -> ((length bv) = (length bv')).

Axiom get_equal_bv1 :
  forall (bv:bitvec) (bv':bitvec), (bv = bv') -> forall (i:Z),
  ((0%Z <= i)%Z /\ (i < (length bv))%Z) -> (((getbv bv) i) = ((getbv bv') i)).

Parameter make_bv: (Z -> Z) -> Z -> bitvec.

Axiom make_bv_spec :
  forall (f:Z -> Z) (s:Z),
  (forall (i:Z), ((0%Z <= i)%Z /\ (i < s)%Z) ->
   (0%Z <= (f i))%Z /\ ((f i) < 2%Z)%Z) ->
  (s >= 0%Z)%Z -> ((length (make_bv f s)) = s).

Axiom make_bv_spec1 :
  forall (f:Z -> Z) (s:Z),
  (forall (i:Z), ((0%Z <= i)%Z /\ (i < s)%Z) ->
   (0%Z <= (f i))%Z /\ ((f i) < 2%Z)%Z) ->
  (s >= 0%Z)%Z -> forall (i:Z), ((0%Z <= i)%Z /\ (i < s)%Z) ->
  (((getbv (make_bv f s)) i) = (f i)).

Axiom make_bv_spec2 :
  forall (f:Z -> Z) (s:Z),
  (forall (i:Z), ((0%Z <= i)%Z /\ (i < s)%Z) ->
   (0%Z <= (f i))%Z /\ ((f i) < 2%Z)%Z) ->
  (s >= 0%Z)%Z -> forall (i:Z), ~ (0%Z <= i)%Z ->
  (((getbv (make_bv f s)) i) = 0%Z).

Axiom make_bv_spec3 :
  forall (f:Z -> Z) (s:Z),
  (forall (i:Z), ((0%Z <= i)%Z /\ (i < s)%Z) ->
   (0%Z <= (f i))%Z /\ ((f i) < 2%Z)%Z) ->
  (s >= 0%Z)%Z -> forall (i:Z), ~ (i < s)%Z ->
  (((getbv (make_bv f s)) i) = 0%Z).

Parameter make_bv_m: (Z -> Z) -> Z -> bitvec.

Axiom make_bv_m_def :
  forall (f:Z -> Z) (s:Z), (s >= 0%Z)%Z ->
  ((make_bv_m f s) =
   (make_bv (fun (k:Z) => (int.EuclideanDivision.mod1 (f k) 2%Z)) s)).

Axiom make_bv_m_spec :
  forall (f:Z -> Z) (s:Z), (s >= 0%Z)%Z -> ((length (make_bv_m f s)) = s).

Axiom make_bv_m_spec1 :
  forall (f:Z -> Z) (s:Z), (s >= 0%Z)%Z -> forall (i:Z),
  bvlength (getbv (make_bv_m f s)) i.

Axiom make_bv_m_spec2 :
  forall (f:Z -> Z) (s:Z), (s >= 0%Z)%Z -> forall (k:Z),
  ((0%Z <= k)%Z /\ (k < s)%Z) ->
  (((getbv (make_bv_m f s)) k) = (int.EuclideanDivision.mod1 (f k) 2%Z)).

Axiom make_bv_m_spec3 :
  forall (f:Z -> Z) (s:Z), (s >= 0%Z)%Z -> forall (k:Z), ~ (0%Z <= k)%Z ->
  (((getbv (make_bv_m f s)) k) = 0%Z).

Axiom make_bv_m_spec4 :
  forall (f:Z -> Z) (s:Z), (s >= 0%Z)%Z -> forall (k:Z), ~ (k < s)%Z ->
  (((getbv (make_bv_m f s)) k) = 0%Z).

Parameter bitvec_null: bitvec.

Axiom bitvec_null_def : (bitvec_null = (make_bv (fun (i:Z) => 0%Z) 0%Z)).

Axiom assert_make_bv_no_bound :
  forall (f:Z -> Z) (s:Z) (i:Z),
  (forall (i1:Z), ((0%Z <= i1)%Z /\ (i1 < s)%Z) ->
   (0%Z <= (f i1))%Z /\ ((f i1) < 2%Z)%Z) ->
  ((1%Z <= i)%Z /\ (i <= s)%Z) -> (((getbv (make_bv f 0%Z)) i) = 0%Z).

Axiom make_bv_length :
  forall (f:Z -> Z) (s:Z),
  (forall (i:Z), ((0%Z <= i)%Z /\ (i < s)%Z) ->
   (0%Z <= (f i))%Z /\ ((f i) < 2%Z)%Z) ->
  (s >= 0%Z)%Z -> ((length (make_bv f s)) = s).

Axiom assert_make_bv :
  forall (f:Z -> Z) (s:Z) (i:Z),
  (forall (i1:Z), ((0%Z <= i1)%Z /\ (i1 < s)%Z) ->
   (0%Z <= (f i1))%Z /\ ((f i1) < 2%Z)%Z) ->
  (0%Z <= s)%Z ->
  (((0%Z <= i)%Z /\ (i < s)%Z) -> (((getbv (make_bv f s)) i) = (f i))) /\
  (~ ((0%Z <= i)%Z /\ (i < s)%Z) -> (((getbv (make_bv f s)) i) = 0%Z)).

Axiom assert_make_m :
  forall (f:Z -> Z) (s:Z) (i:Z), (s >= 0%Z)%Z ->
  (((0%Z <= i)%Z /\ (i < s)%Z) ->
   (((getbv (make_bv_m f s)) i) = (int.EuclideanDivision.mod1 (f i) 2%Z))) /\
  (~ ((0%Z <= i)%Z /\ (i < s)%Z) -> (((getbv (make_bv_m f s)) i) = 0%Z)).

Axiom make_bv_eq :
  forall (f:Z -> Z) (f':Z -> Z) (n:Z) (n':Z), (n >= 0%Z)%Z -> (n = n') ->
  (forall (i:Z), ((0%Z <= i)%Z /\ (i < n)%Z) -> ((f i) = (f' i))) ->
  (forall (i:Z), ((0%Z <= i)%Z /\ (i < n)%Z) ->
   (0%Z <= (f i))%Z /\ ((f i) < 2%Z)%Z) ->
  ((make_bv f n) = (make_bv f' n')).

Axiom assert_make_bv_b :
  forall (f:Z -> Z) (s:Z) (i:Z),
  (forall (i1:Z), ((0%Z <= i1)%Z /\ (i1 < s)%Z) ->
   (0%Z <= (f i1))%Z /\ ((f i1) < 2%Z)%Z) ->
  ((0%Z <= i)%Z /\ (i < s)%Z) -> (((getbv (make_bv f s)) i) = (f i)).

Axiom assert_make_m_b :
  forall (f:Z -> Z) (s:Z) (i:Z), ((0%Z <= i)%Z /\ (i < s)%Z) ->
  (s >= 0%Z)%Z ->
  (((getbv (make_bv_m f s)) i) = (int.EuclideanDivision.mod1 (f i) 2%Z)).

Axiom make_m_bv_length :
  forall (f:Z -> Z) (s:Z) (i:Z), (s >= 0%Z)%Z ->
  bvlength (getbv (make_bv_m f s)) i.

Axiom make_m_length :
  forall (f:Z -> Z) (s:Z), (s >= 0%Z)%Z -> ((length (make_bv_m f s)) = s).

Axiom set_equal_bv_make :
  forall (f:Z -> Z) (g:Z -> Z) (s:Z),
  (forall (i:Z), (0%Z <= (f i))%Z /\ ((f i) < 2%Z)%Z) -> (s >= 0%Z)%Z ->
  (forall (i:Z), ((f i) = (g i))) -> ((make_bv f s) = (make_bv g s)).

Axiom set_equal_bv_make_ :
  forall (f:Z -> Z) (g:Z -> Z) (s:Z), (s >= 0%Z)%Z ->
  (forall (i:Z), ((0%Z <= i)%Z /\ (i < s)%Z) ->
   (0%Z <= (f i))%Z /\ ((f i) < 2%Z)%Z) ->
  (forall (i:Z), ((0%Z <= i)%Z /\ (i < s)%Z) -> ((f i) = (g i))) ->
  ((make_bv f s) = (make_bv g s)).

Axiom set_equal_bv_m_make :
  forall (f:Z -> Z) (g:Z -> Z) (s:Z), (s >= 0%Z)%Z ->
  (forall (i:Z),
   ((int.EuclideanDivision.mod1 (f i) 2%Z) =
    (int.EuclideanDivision.mod1 (g i) 2%Z))) ->
  ((make_bv_m f s) = (make_bv_m g s)).

Axiom make_bv_itself :
  forall (x:bitvec) (n:Z), ((length x) = n) ->
  ((make_bv (fun (i:Z) => ((getbv x) i)) n) = x).

Parameter head: bitvec -> Z.

Axiom head_def :
  forall (bv:bitvec), ((length bv) >= 1%Z)%Z ->
  ((head bv) = ((getbv bv) 0%Z)).

Axiom head_spec :
  forall (bv:bitvec), ((length bv) >= 1%Z)%Z -> (0%Z <= (head bv))%Z.

Axiom head_spec1 :
  forall (bv:bitvec), ((length bv) >= 1%Z)%Z -> ((head bv) <= 1%Z)%Z.

Parameter makes_bv: (Z -> Z) -> Z -> bitvec.

Parameter result6: (Z -> Z) -> Z -> Z.

Axiom result_def6 :
  forall (f:Z -> Z) (i:Z),
  (((0%Z <= (f i))%Z /\ ((f i) < 2%Z)%Z) -> (((result6 f) i) = (f i))) /\
  (~ ((0%Z <= (f i))%Z /\ ((f i) < 2%Z)%Z) -> (((result6 f) i) = 0%Z)).

Axiom makes_bv_def :
  forall (f:Z -> Z) (s:Z), (s >= 0%Z)%Z ->
  ((makes_bv f s) = (make_bv (result6 f) s)).

Axiom makes_bv_spec :
  forall (f:Z -> Z) (s:Z), (s >= 0%Z)%Z -> ((length (makes_bv f s)) = s).

Axiom makes_bv_spec1 :
  forall (f:Z -> Z) (s:Z), (s >= 0%Z)%Z -> forall (i:Z),
  ((0%Z <= i)%Z /\ (i < s)%Z) -> ((0%Z <= (f i))%Z /\ ((f i) < 2%Z)%Z) ->
  (((getbv (makes_bv f s)) i) = (f i)).

Axiom makes_bv_spec2 :
  forall (f:Z -> Z) (s:Z), (s >= 0%Z)%Z ->
  (forall (i:Z), ((0%Z <= i)%Z /\ (i < s)%Z) ->
   (0%Z <= (f i))%Z /\ ((f i) < 2%Z)%Z) ->
  ((makes_bv f s) = (make_bv f s)).

Axiom makes_bv_spec3 :
  forall (f:Z -> Z) (s:Z), (s >= 0%Z)%Z -> forall (i:Z), ~ (0%Z <= i)%Z ->
  (((getbv (makes_bv f s)) i) = 0%Z).

Axiom makes_bv_spec4 :
  forall (f:Z -> Z) (s:Z), (s >= 0%Z)%Z -> forall (i:Z), ~ (i < s)%Z ->
  (((getbv (makes_bv f s)) i) = 0%Z).

Axiom assert_makes_bv_c :
  forall (f:Z -> Z) (s:Z) (i:Z),
  (forall (i1:Z), ((0%Z <= i1)%Z /\ (i1 < s)%Z) ->
   (0%Z <= (f i1))%Z /\ ((f i1) < 2%Z)%Z) ->
  (0%Z <= s)%Z ->
  (((0%Z <= i)%Z /\ (i < s)%Z) -> (((getbv (makes_bv f s)) i) = (f i))) /\
  (~ ((0%Z <= i)%Z /\ (i < s)%Z) -> (((getbv (makes_bv f s)) i) = 0%Z)).

Axiom assert_makes_bv_b :
  forall (f:Z -> Z) (s:Z) (i:Z),
  (forall (i1:Z), ((0%Z <= i1)%Z /\ (i1 < s)%Z) ->
   (0%Z <= (f i1))%Z /\ ((f i1) < 2%Z)%Z) ->
  (0%Z <= s)%Z -> ((0%Z <= i)%Z /\ (i < s)%Z) ->
  (((getbv (makes_bv f s)) i) = (f i)).

Axiom assert_makes_bv :
  forall (f:Z -> Z) (s:Z) (i:Z),
  (forall (i1:Z), ((0%Z <= i1)%Z /\ (i1 < s)%Z) ->
   (0%Z <= (f i1))%Z /\ ((f i1) < 2%Z)%Z) ->
  (0%Z <= s)%Z ->
  ((((0%Z <= i)%Z /\ (i < s)%Z) /\ (0%Z <= (f i))%Z) ->
   (((getbv (makes_bv f s)) i) = (f i))) /\
  (~ (((0%Z <= i)%Z /\ (i < s)%Z) /\ (0%Z <= (f i))%Z) ->
   (((getbv (makes_bv f s)) i) = 0%Z)).

Axiom makes_bv_length :
  forall (f:Z -> Z) (s:Z), (s >= 0%Z)%Z -> ((length (makes_bv f s)) = s).

Parameter tail: bitvec -> bitvec.

Axiom tail_def :
  forall (bv:bitvec), ((length bv) >= 1%Z)%Z ->
  ((tail bv) =
   (make_bv (fun (i:Z) => ((getbv bv) (i + 1%Z)%Z)) ((length bv) - 1%Z)%Z)).

Axiom tail_spec :
  forall (bv:bitvec), ((length bv) >= 1%Z)%Z ->
  ((length (tail bv)) = ((length bv) - 1%Z)%Z).

Axiom tail_spec1 :
  forall (bv:bitvec), ((length bv) >= 1%Z)%Z -> forall (i:Z),
  (in_range (tail bv) i) ->
  (((getbv (tail bv)) i) = ((getbv bv) (i + 1%Z)%Z)).

Parameter concat_l: bitvec -> Z -> bitvec.

Parameter result7: bitvec -> Z -> Z -> Z.

Axiom result_def7 :
  forall (bv:bitvec) (i:Z) (k:Z),
  ((k = 0%Z) -> (((result7 bv i) k) = i)) /\
  (~ (k = 0%Z) -> (((result7 bv i) k) = ((getbv bv) (k - 1%Z)%Z))).

Axiom concat_l_def :
  forall (bv:bitvec) (i:Z), ((0%Z <= i)%Z /\ (i <= 1%Z)%Z) ->
  ((concat_l bv i) = (make_bv (result7 bv i) ((length bv) + 1%Z)%Z)).

Axiom concat_l_spec :
  forall (bv:bitvec) (i:Z), ((0%Z <= i)%Z /\ (i <= 1%Z)%Z) ->
  ((length (concat_l bv i)) = ((length bv) + 1%Z)%Z).

Axiom concat_l_spec1 :
  forall (bv:bitvec) (i:Z), ((0%Z <= i)%Z /\ (i <= 1%Z)%Z) ->
  (((getbv (concat_l bv i)) 0%Z) = i).

Axiom concat_l_spec2 :
  forall (bv:bitvec) (i:Z), ((0%Z <= i)%Z /\ (i <= 1%Z)%Z) -> forall (j:Z),
  (in_range bv j) -> (((getbv (concat_l bv i)) (j + 1%Z)%Z) = ((getbv bv) j)).

Axiom concat_l_value :
  forall (bv:bitvec) (i:Z) (k:Z), ((0%Z <= i)%Z /\ (i < 2%Z)%Z) ->
  ((k = 0%Z) -> (((getbv (concat_l bv i)) k) = i)) /\
  (~ (k = 0%Z) ->
   (((0%Z < k)%Z /\ (k <= ((length bv) + 1%Z)%Z)%Z) ->
    (((getbv (concat_l bv i)) k) = ((getbv bv) (k - 1%Z)%Z))) /\
   (~ ((0%Z < k)%Z /\ (k <= ((length bv) + 1%Z)%Z)%Z) ->
    (((getbv (concat_l bv i)) k) = 0%Z))).

Axiom concat_l_value_b :
  forall (bv:bitvec) (i:Z) (k:Z),
  ((0%Z <= k)%Z /\ (k < ((length bv) + 1%Z)%Z)%Z) ->
  ((0%Z <= i)%Z /\ (i < 2%Z)%Z) ->
  ((k = 0%Z) -> (((getbv (concat_l bv i)) k) = i)) /\
  (~ (k = 0%Z) -> (((getbv (concat_l bv i)) k) = ((getbv bv) (k - 1%Z)%Z))).

Axiom concat_ht :
  forall (bv:bitvec), ((length bv) >= 1%Z)%Z ->
  (bv = (concat_l (tail bv) (head bv))).

Axiom concat_ht_union :
  forall (bv:bitvec), ((length bv) >= 2%Z)%Z ->
  ~ (bv = (concat_l (tail bv) 0%Z)) -> (bv = (concat_l (tail bv) 1%Z)).

Parameter bv_to_int: bitvec -> Z.

Parameter result8: bitvec -> Z -> Z.

Axiom result_def8 :
  forall (bv:bitvec) (k:Z),
  ((in_range bv k) ->
   (((result8 bv) k) =
    (((getbv bv) k) * (power 2%Z (((length bv) - 1%Z)%Z - k)%Z))%Z)) /\
  (~ (in_range bv k) -> (((result8 bv) k) = 1%Z)).

Axiom bv_to_int_def :
  forall (bv:bitvec),
  ((bv_to_int bv) = (ind_isum (result8 bv) 0%Z (length bv))).

Axiom bv_to_int_spec :
  forall (bv:bitvec),
  ((bv_to_int bv) =
   (ind_isum
    (fun (k:Z) =>
     (((getbv bv) k) * (power 2%Z (((length bv) - 1%Z)%Z - k)%Z))%Z)
    0%Z (length bv))).

Axiom bv_to_int_spec1 : forall (bv:bitvec), (0%Z <= (bv_to_int bv))%Z.

Axiom bv_to_int_eq :
  forall (bv1:bitvec) (bv2:bitvec), (bv1 = bv2) ->
  ((bv_to_int bv1) = (bv_to_int bv2)).

Axiom bv_to_int_sum :
  forall (bv:bitvec),
  ((bv_to_int bv) =
   (ind_isum
    (fun (k:Z) =>
     (((getbv bv) k) * (power 2%Z (((length bv) - 1%Z)%Z - k)%Z))%Z)
    0%Z (length bv))).

Axiom bv_to_int_sum_inv :
  forall (bv:bitvec),
  ((bv_to_int bv) =
   (ind_isum
    (fun (k:Z) =>
     (((getbv bv) (((length bv) - 1%Z)%Z - k)%Z) * (power 2%Z k))%Z)
    0%Z (length bv))).

Axiom bv_to_int_sum_opp :
  forall (bv:bitvec),
  ((-(bv_to_int bv))%Z =
   (ind_isum
    (fun (k:Z) =>
     ((-((getbv bv) k))%Z * (power 2%Z (((length bv) - 1%Z)%Z - k)%Z))%Z)
    0%Z (length bv))).

Axiom bv_to_int_onebit :
  forall (bv:bitvec), ((length bv) = 1%Z) ->
  ((bv_to_int bv) = ((getbv bv) 0%Z)).

Axiom ind_isum_bv_rev :
  forall (bv:bitvec) (i:Z), ((0%Z <= i)%Z /\ (i <= (length bv))%Z) ->
  ((ind_isum
    (fun (l:Z) =>
     (((getbv bv) l) * (power 2%Z (((length bv) - 1%Z)%Z - l)%Z))%Z)
    i (length bv))
   =
   (ind_isum
    (fun (l:Z) =>
     (((getbv bv) (((length bv) - 1%Z)%Z - l)%Z) * (power 2%Z l))%Z)
    0%Z ((length bv) - i)%Z)).

Axiom ind_isum_bin_rev :
  forall (f:Z -> Z) (n:Z) (i:Z), ((0%Z <= i)%Z /\ (i < n)%Z) -> (binary f) ->
  ((ind_isum (fun (l:Z) => ((f l) * (power 2%Z ((n - 1%Z)%Z - l)%Z))%Z) i n)
   =
   (ind_isum (fun (l:Z) => ((f ((n - 1%Z)%Z - l)%Z) * (power 2%Z l))%Z) 0%Z
    (n - i)%Z)).

Axiom ind_isum_bin_rev_z :
  forall (f:Z -> Z) (n:Z), (0%Z <= n)%Z -> (binary f) ->
  ((ind_isum (fun (l:Z) => ((f l) * (power 2%Z ((n - 1%Z)%Z - l)%Z))%Z) 0%Z
    n)
   =
   (ind_isum (fun (l:Z) => ((f ((n - 1%Z)%Z - l)%Z) * (power 2%Z l))%Z) 0%Z
    n)).

Axiom bv_to_int_sum_rev :
  forall (bv:bitvec),
  ((ind_isum
    (fun (k:Z) =>
     (((getbv bv) (((length bv) - 1%Z)%Z - k)%Z) * (power 2%Z k))%Z)
    0%Z (length bv))
   = (bv_to_int bv)).

Axiom ind_isum_bv_bound_growing :
  forall (bv:bitvec) (i:Z), ((0%Z < i)%Z /\ (i < (length bv))%Z) ->
  ((ind_isum (fun (l:Z) => (((getbv bv) l) * (power 2%Z l))%Z) 0%Z i) <
   (power 2%Z i))%Z.

Axiom ind_isum_bv_bound :
  forall (bv:bitvec) (i:Z), ((0%Z <= i)%Z /\ (i < (length bv))%Z) ->
  ((ind_isum
    (fun (l:Z) =>
     (((getbv bv) l) * (power 2%Z (((length bv) - 1%Z)%Z - l)%Z))%Z)
    i (length bv))
   < (power 2%Z ((length bv) - i)%Z))%Z.

Axiom ind_isum_bin_bound :
  forall (f:Z -> Z) (n:Z) (i:Z), ((0%Z <= i)%Z /\ (i < n)%Z) -> (binary f) ->
  ((ind_isum (fun (l:Z) => ((f l) * (power 2%Z ((n - 1%Z)%Z - l)%Z))%Z) i n)
   < (power 2%Z (n - i)%Z))%Z.

Axiom bv_to_int_bound :
  forall (bv:bitvec), ((length bv) >= 1%Z)%Z ->
  ((bv_to_int bv) < (power 2%Z (length bv)))%Z.

Parameter power_: Z -> Z -> Z.

Axiom power__def :
  forall (e:Z) (i:Z), (i >= 0%Z)%Z -> ((power_ e i) = (power e i)).

Axiom power__def1 :
  forall (e:Z) (i:Z), ~ (i >= 0%Z)%Z -> ((power_ e i) = 0%Z).

Axiom power_to_ :
  forall (i:Z) (x:Z), (0%Z <= x)%Z -> ((power i x) = (power_ i x)).

Axiom power_no_ :
  forall (i:Z) (x:Z), (0%Z <= x)%Z -> ((power_ i x) = (power i x)).

Axiom power__plus_one :
  forall (i:Z) (x:Z), (0%Z <= x)%Z ->
  ((power_ i (x + 1%Z)%Z) = ((power_ i x) * i)%Z).

Axiom power__eq :
  forall (e:Z) (e':Z) (i:Z) (i':Z), (e = e') -> (i = i') ->
  ((power_ e i) = (power_ e' i')).

Axiom power__sum :
  forall (i:Z) (x:Z) (y:Z), (0%Z <= x)%Z -> (0%Z <= y)%Z ->
  ((power_ i (x + y)%Z) = ((power_ i x) * (power_ i y))%Z).

Axiom power__sum_rev :
  forall (i:Z) (x:Z) (y:Z), (0%Z <= x)%Z -> (0%Z <= y)%Z ->
  (((power_ i x) * (power_ i y))%Z = (power_ i (x + y)%Z)).

Axiom power__mult :
  forall (i:Z) (x:Z) (y:Z), (0%Z <= x)%Z -> (0%Z <= y)%Z ->
  ((power_ i (x * y)%Z) = (power_ (power_ i x) y)).

Axiom Power_zero_ : forall (i:Z), ((power_ i 0%Z) = 1%Z).

Axiom Power_one_ : forall (i:Z), ((power_ i 1%Z) = i).

Axiom Power_sum_ :
  forall (x:Z) (y:Z) (i:Z), (0%Z <= x)%Z -> (y >= 0%Z)%Z ->
  ((power_ i (x + y)%Z) = ((power_ i x) * (power_ i y))%Z).

Axiom Power_mult_ :
  forall (x:Z) (y:Z) (i:Z), (x >= 0%Z)%Z -> (y >= 0%Z)%Z ->
  ((power i (x * y)%Z) = (power (power i x) y)).

Axiom Power_pos_ : forall (i:Z), (i >= 0%Z)%Z -> ((power_ i 0%Z) > 0%Z)%Z.

Axiom Power_pos_gen_ :
  forall (i:Z) (j:Z), (i > 0%Z)%Z -> (j >= 0%Z)%Z -> (0%Z < (power_ i j))%Z.

Axiom power_two_ :
  forall (x:Z), (0%Z <= x)%Z -> ((power_ x 2%Z) = (x * x)%Z).

Axiom power_plus_one_two :
  forall (x:Z), (0%Z <= x)%Z ->
  ((power_ 2%Z (x + 1%Z)%Z) = ((power_ 2%Z x) + (power_ 2%Z x))%Z).

Axiom growing_right_power_ :
  forall (a:Z) (b:Z) (i:Z), (0%Z <= i)%Z -> ((0%Z <= a)%Z /\ (a <= b)%Z) ->
  ((power_ a i) <= (power_ b i))%Z.

Axiom power_of_one_ :
  forall (a:Z) (b:Z), (0%Z <= b)%Z -> (a = 1%Z) -> ((power_ a b) = 1%Z).

Axiom bound_power_ :
  forall (i:Z) (a:Z) (k:Z) (n:Z), (0%Z < a)%Z ->
  ((0%Z < k)%Z /\ (k <= n)%Z) -> ((0%Z <= i)%Z /\ (i < (power_ a n))%Z) ->
  ((int.EuclideanDivision.div i (power_ a (n - k)%Z)) < (power_ a k))%Z.

Axiom power_inf :
  forall (a:Z) (n:Z) (n':Z), (1%Z < a)%Z -> ((0%Z < n)%Z /\ (n < n')%Z) ->
  ((power_ a n) < (power_ a n'))%Z.

Axiom power_leq :
  forall (a:Z) (n:Z) (n':Z), (0%Z <= a)%Z -> ((0%Z < n)%Z /\ (n <= n')%Z) ->
  ((power_ a n) <= (power_ a n'))%Z.

Axiom power_rises :
  forall (a:Z) (n:Z), (1%Z < a)%Z -> (1%Z < n)%Z -> (a < (power_ a n))%Z.

Axiom int_expo_rises :
  forall (a:Z) (n:Z), (1%Z < a)%Z -> (1%Z <= n)%Z -> (n < (power_ a n))%Z.

Axiom bound_power_2 :
  forall (i:Z) (n:Z), (0%Z <= n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power_ 2%Z (n + 1%Z)%Z))%Z) ->
  ((int.EuclideanDivision.div i (power_ 2%Z n)) < 2%Z)%Z.

Parameter polysquare: Z -> Z -> Z -> Z -> Z.

Axiom polysquare_def :
  forall (n:Z) (a2:Z) (a1:Z) (a0:Z), (0%Z < n)%Z -> (0%Z <= a2)%Z ->
  (0%Z <= a1)%Z -> (0%Z <= a0)%Z ->
  ((polysquare n a2 a1 a0) =
   (((a2 * (power_ n 2%Z))%Z + (a1 * n)%Z)%Z + a0)%Z).

Axiom polysquare_spec :
  forall (n:Z) (a2:Z) (a1:Z) (a0:Z), (0%Z < n)%Z -> (0%Z <= a2)%Z ->
  (0%Z <= a1)%Z -> (0%Z <= a0)%Z -> (0%Z <= (polysquare n a2 a1 a0))%Z.

Axiom polysquare_leq_trans :
  forall (n:Z) (a2:Z) (a1:Z) (a0:Z) (b2:Z) (b1:Z) (b0:Z) (pa:Z) (pb:Z) (ps:Z),
  (0%Z < n)%Z -> (0%Z <= a2)%Z -> (0%Z <= a1)%Z -> (0%Z <= a0)%Z ->
  (0%Z <= b2)%Z -> (0%Z <= b1)%Z -> (0%Z <= b0)%Z ->
  (pa <= (polysquare n a2 a1 a0))%Z -> (pb <= (polysquare n b2 b1 b0))%Z ->
  (ps <= (pa + pb)%Z)%Z ->
  (ps <= (polysquare n (a2 + b2)%Z (a1 + b1)%Z (a0 + b0)%Z))%Z.

Axiom polysquare_leq_trans_sc :
  forall (n:Z) (a2:Z) (a1:Z) (a0:Z) (b2:Z) (b1:Z) (b0:Z) (pa:Z) (sc:Z) (ps:Z),
  (0%Z < n)%Z -> (0%Z <= a2)%Z -> (0%Z <= a1)%Z -> (0%Z <= a0)%Z ->
  (0%Z <= sc)%Z -> ((sc * a2)%Z <= b2)%Z -> ((sc * a1)%Z <= b1)%Z ->
  ((sc * a0)%Z <= b0)%Z -> (pa <= (polysquare n a2 a1 a0))%Z ->
  (ps <= (sc * pa)%Z)%Z -> (ps <= (polysquare n b2 b1 b0))%Z.

Axiom polysquare_update :
  forall (na:Z) (nb:Z) (a2:Z) (a1:Z) (a0:Z) (pa:Z),
  ((0%Z < na)%Z /\ (na <= nb)%Z) -> (0%Z <= a2)%Z -> (0%Z <= a1)%Z ->
  (0%Z <= a0)%Z -> (pa <= (polysquare na a2 a1 a0))%Z ->
  (pa <= (polysquare nb a2 a1 a0))%Z.

Axiom power__minus_one :
  forall (i:Z), (0%Z <= i)%Z -> ((int.EuclideanDivision.mod1 i 2%Z) = 1%Z) ->
  ((power_ (-1%Z)%Z i) = (-1%Z)%Z).

Axiom power__minus_one1 :
  forall (i:Z), (0%Z <= i)%Z -> ((int.EuclideanDivision.mod1 i 2%Z) = 0%Z) ->
  ((power_ (-1%Z)%Z i) = 1%Z).

Axiom real : forall (x:complex), (real_ x) -> (x = (r_to_c (real_part x))).

Axiom pure_im :
  forall (x:complex), (pure_im_ x) ->
  (x = (infix_asdt im (r_to_c (im_part x)))).

Axiom im_dec : ((real_part im) = 0%R).

Axiom im_dec1 : ((im_part im) = 1%R).

Axiom c_one_dec : ((real_part c_one) = 1%R).

Axiom c_one_dec1 : ((im_part c_one) = 0%R).

Axiom c_zero_dec : ((real_part c_zero) = 0%R).

Axiom c_zero_dec1 : ((im_part c_zero) = 0%R).

Axiom ttwo_dec : ((real_part ttwo) = 2%R).

Axiom ttwo_dec1 : ((im_part ttwo) = 0%R).

Parameter i_to_c: Z -> complex.

Axiom i_to_c_def : forall (i:Z), ((i_to_c i) = (r_to_c (from_int i))).

Axiom i_to_c_spec : forall (i:Z), real_ (i_to_c i).

Axiom i_to_c_zero : ((i_to_c 0%Z) = c_zero).

Axiom i_to_c_surj :
  forall (i:Z) (j:Z), ~ (i = j) -> ~ ((i_to_c i) = (i_to_c j)).

Axiom i_to_c_eq : forall (i:Z) (j:Z), (i = j) -> ((i_to_c i) = (i_to_c j)).

Axiom i_to_c_inf :
  forall (i:Z) (j:Z), (i < j)%Z -> infix_lsdt (i_to_c i) (i_to_c j).

Axiom i_to_c_nzero : forall (i:Z), ~ (i = 0%Z) -> ~ ((i_to_c i) = c_zero).

Axiom i_to_c_one : ((i_to_c 1%Z) = c_one).

Axiom i_to_c_add :
  forall (i:Z) (j:Z),
  ((infix_pldt (i_to_c i) (i_to_c j)) = (i_to_c (i + j)%Z)).

Axiom i_to_c_add_rev :
  forall (i:Z) (j:Z),
  ((i_to_c (i + j)%Z) = (infix_pldt (i_to_c i) (i_to_c j))).

Axiom i_to_c_ttwo : ((i_to_c 2%Z) = ttwo).

Axiom i_to_c_pos :
  forall (a:Z), (0%Z <= a)%Z -> infix_lseqdt c_zero (i_to_c a).

Axiom i_to_c_minus :
  forall (a:Z), ((i_to_c (-a)%Z) = (prefix_mndt (i_to_c a))).

Axiom i_to_c_strict_pos :
  forall (a:Z), (0%Z < a)%Z -> infix_lsdt c_zero (i_to_c a).

Axiom i_to_c_mult_pos :
  forall (i:Z) (j:Z), (0%Z <= j)%Z ->
  ((infix_asdt (i_to_c i) (i_to_c j)) = (i_to_c (i * j)%Z)).

Axiom i_to_c_mult :
  forall (i:Z) (j:Z),
  ((infix_asdt (i_to_c i) (i_to_c j)) = (i_to_c (i * j)%Z)).

Axiom i_to_c_mult_rev :
  forall (i:Z) (j:Z),
  ((i_to_c (i * j)%Z) = (infix_asdt (i_to_c i) (i_to_c j))).

Axiom i_to_c_mult_assoc :
  forall (x:complex) (i:Z) (j:Z),
  ((infix_asdt x (i_to_c (i * j)%Z)) =
   (infix_asdt (infix_asdt x (i_to_c i)) (i_to_c j))).

Axiom i_to_c_mult_assoc_rev :
  forall (x:complex) (i:Z) (j:Z),
  ((infix_asdt (infix_asdt x (i_to_c i)) (i_to_c j)) =
   (infix_asdt x (i_to_c (i * j)%Z))).

Axiom i_to_c_sub :
  forall (i:Z) (j:Z),
  ((infix_mndt (i_to_c i) (i_to_c j)) = (i_to_c (i - j)%Z)).

Axiom i_to_c_opp :
  forall (i:Z), ((i_to_c (-i)%Z) = (prefix_mndt (i_to_c i))).

Axiom i_to_c_div :
  forall (i:Z) (j:Z), ~ (j = 0%Z) ->
  ((infix_sldt (i_to_c (i * j)%Z) (i_to_c j)) = (i_to_c i)).

Axiom i_to_c_minus_mult :
  forall (i:Z) (j:Z),
  ((infix_asdt (i_to_c (-i)%Z) (i_to_c j)) =
   (infix_asdt (i_to_c i) (i_to_c (-j)%Z))).

Axiom i_to_c_div_leq_c_one :
  forall (a:Z) (b:Z), ((0%Z <= a)%Z /\ (a < b)%Z) ->
  infix_lseqdt (infix_sldt (i_to_c a) (i_to_c b)) c_one.

Axiom compat_i_to_c_infeq :
  forall (a:Z) (b:Z), (a <= b)%Z -> infix_lseqdt (i_to_c a) (i_to_c b).

Axiom compat_i_to_c_inf :
  forall (a:Z) (b:Z), (a < b)%Z -> infix_lsdt (i_to_c a) (i_to_c b).

Axiom compat_i_to_c_supeq :
  forall (a:Z) (b:Z), (a >= b)%Z -> infix_gteqdt (i_to_c a) (i_to_c b).

Axiom compat_i_to_c_sup :
  forall (a:Z) (b:Z), (a > b)%Z -> infix_gtdt (i_to_c a) (i_to_c b).

Axiom positive_int_squrt :
  forall (i:Z), (i > 0%Z)%Z -> infix_gtdt (square_rt (i_to_c i)) c_zero.

Axiom non_null_int_squrt :
  forall (i:Z), (i > 0%Z)%Z -> ~ ((square_rt (i_to_c i)) = c_zero).

Axiom ind_sum_constant :
  forall (f:Z -> complex) (valu:complex) (i:Z) (j:Z), (i <= j)%Z ->
  (forall (k:Z), ((i <= k)%Z /\ (k < j)%Z) -> ((f k) = valu)) ->
  ((ind_sum f i j) = (infix_asdt valu (i_to_c (j - i)%Z))).

Axiom ind_sum_constant_from_z :
  forall (f:Z -> complex) (valu:complex) (j:Z), (0%Z <= j)%Z ->
  (forall (k:Z), ((0%Z <= k)%Z /\ (k < j)%Z) -> ((f k) = valu)) ->
  ((ind_sum f 0%Z j) = (infix_asdt valu (i_to_c j))).

Axiom sum_constant :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (t:a -> complex) (x:complex),
  (forall (e:a), (mem e s) -> ((t e) = x)) ->
  ((sum s t) = (infix_asdt (i_to_c (cardinal s)) x)).

Axiom ind_sum_constant_case :
  forall (n:Z) (t:Z -> complex) (p:Z -> bool) (x:complex) (y:complex) (k1:Z),
  (0%Z <= n)%Z -> ((cardinal (my_filter (to_fset 0%Z n) p)) = k1) ->
  (forall (e:Z), ((0%Z <= e)%Z /\ (e < n)%Z) -> ((p e) = true) ->
   ((t e) = x)) ->
  (forall (e:Z), ((0%Z <= e)%Z /\ (e < n)%Z) -> ~ ((p e) = true) ->
   ((t e) = y)) ->
  ((ind_sum t 0%Z n) =
   (infix_pldt (infix_asdt (i_to_c k1) x) (infix_asdt (i_to_c (n - k1)%Z) y))).

Axiom sum_const_one :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (t:a -> complex),
  (forall (e:a), (mem e s) -> ((t e) = c_one)) ->
  ((sum s t) = (i_to_c (cardinal s))).

Axiom abs_eqinf :
  forall (x:Z) (y:Z), ((x <= y)%Z /\ (y <= 0%Z)%Z) ->
  ((ZArith.BinInt.Z.abs x) >= (ZArith.BinInt.Z.abs y))%Z.

Axiom abs_inf :
  forall (x:Z) (y:Z), ((0%Z < x)%Z /\ ((x < y)%Z /\ (y <= 0%Z)%Z)) ->
  ((ZArith.BinInt.Z.abs x) > (ZArith.BinInt.Z.abs y))%Z.

Axiom abs_eqsup :
  forall (x:Z) (y:Z), ((0%Z >= x)%Z /\ (x >= y)%Z) ->
  ((ZArith.BinInt.Z.abs x) <= (ZArith.BinInt.Z.abs y))%Z.

Axiom abs_sup :
  forall (x:Z) (y:Z), ((0%Z >= x)%Z /\ (x > y)%Z) ->
  ((ZArith.BinInt.Z.abs x) < (ZArith.BinInt.Z.abs y))%Z.

Axiom inv_negeq :
  forall (x:Z), (0%Z >= x)%Z -> ((ZArith.BinInt.Z.abs x) >= 0%Z)%Z.

Axiom inv_neg1 :
  forall (x:Z), (0%Z > x)%Z -> ((ZArith.BinInt.Z.abs x) > 0%Z)%Z.

Parameter cpower: complex -> Z -> complex.

Axiom Cpower_zero : forall (i:complex), ((cpower i 0%Z) = c_one).

Axiom Cpower_one : forall (i:complex), ((cpower i 1%Z) = i).

Axiom Cpower_sum :
  forall (i:complex), forall (n:Z) (m:Z), ~ (i = c_zero) ->
  ((cpower i (n + m)%Z) = (infix_asdt (cpower i n) (cpower i m))).

Axiom Cpower_sum1 :
  forall (i:complex), forall (n:Z) (m:Z), ~ (n = (-m)%Z) ->
  ((cpower i (n + m)%Z) = (infix_asdt (cpower i n) (cpower i m))).

Axiom zero_poower :
  forall (e:Z), ~ (e = 0%Z) -> ((cpower c_zero e) = c_zero).

Axiom cpower_ttwo_two : ((cpower ttwo 2%Z) = (i_to_c 4%Z)).

Parameter squarert_two: complex.

Axiom squarert_two_def : (squarert_two = (square_rt ttwo)).

Axiom real_squarert_two : real_ squarert_two.

Axiom squarertTwo : ((cpower squarert_two 2%Z) = ttwo).

Axiom complete_rt_two :
  forall (a:complex), (a = (infix_sldt squarert_two ttwo)) ->
  ((infix_asdt squarert_two a) = c_one).

Axiom cpower_sum :
  forall (x:complex) (n:Z) (m:Z), ~ (x = c_zero) ->
  ((cpower x (n + m)%Z) = (infix_asdt (cpower x n) (cpower x m))).

Axiom cpower_sum1 :
  forall (x:complex) (n:Z) (m:Z), ~ (n = (-m)%Z) ->
  ((cpower x (n + m)%Z) = (infix_asdt (cpower x n) (cpower x m))).

Axiom cpower_one : forall (x:complex) (n:Z), (n = 1%Z) -> ((cpower x n) = x).

Axiom cpower_two :
  forall (x:complex) (n:Z), (n = 2%Z) -> ((cpower x n) = (infix_asdt x x)).

Axiom cpower_two_rev :
  forall (x:complex), ((infix_asdt x x) = (cpower x 2%Z)).

Axiom cpower_sum_rev :
  forall (x:complex) (n:Z) (m:Z), ~ (x = c_zero) ->
  ((infix_asdt (cpower x n) (cpower x m)) = (cpower x (n + m)%Z)).

Axiom cpower_sum_rev1 :
  forall (x:complex) (n:Z) (m:Z), ~ (n = (-m)%Z) ->
  ((infix_asdt (cpower x n) (cpower x m)) = (cpower x (n + m)%Z)).

Axiom cpower_plus_one :
  forall (e:complex) (i:Z), ~ (e = c_zero) ->
  ((cpower e (i + 1%Z)%Z) = (infix_asdt (cpower e i) e)).

Axiom cpower_plus_one1 :
  forall (e:complex) (i:Z), ~ (i = (-1%Z)%Z) ->
  ((cpower e (i + 1%Z)%Z) = (infix_asdt (cpower e i) e)).

Axiom cpower_zero : forall (e:complex), ((cpower e 0%Z) = c_one).

Axiom cpower_eq :
  forall (e:complex) (e':complex) (i:Z) (i':Z), (e = e') -> (i = i') ->
  ((cpower e i) = (cpower e' i')).

Axiom cpower_inv :
  forall (e:complex) (i:Z), ~ (e = c_zero) ->
  ((infix_asdt (cpower e i) (cpower e (-i)%Z)) = c_one).

Axiom compat_cpower_leq :
  forall (a:complex) (b:complex) (i:Z),
  ((infix_lseqdt c_zero a) /\ (infix_lseqdt a b)) -> (0%Z <= i)%Z ->
  infix_lseqdt c_zero (cpower a i).

Axiom compat_cpower_leq1 :
  forall (a:complex) (b:complex) (i:Z),
  ((infix_lseqdt c_zero a) /\ (infix_lseqdt a b)) -> (0%Z <= i)%Z ->
  infix_lseqdt (cpower a i) (cpower b i).

Axiom cpower_inv_rew :
  forall (e:complex) (i:Z), ~ (e = c_zero) ->
  ((cpower e i) = (infix_sldt c_one (cpower e (-i)%Z))).

Axiom inv_cpower :
  forall (e:complex) (i:Z), ~ ((cpower e i) = c_zero) ->
  ((infix_sldt c_one (cpower e i)) = (cpower e (-i)%Z)).

Axiom cpower_div :
  forall (x:complex) (y:complex) (n:Z), (0%Z <= n)%Z -> ~ (y = c_zero) ->
  ((cpower (infix_sldt x y) n) = (infix_sldt (cpower x n) (cpower y n))).

Axiom cpower_div_rev :
  forall (x:complex) (y:complex) (n:Z), (0%Z <= n)%Z -> ~ (y = c_zero) ->
  ((infix_sldt (cpower x n) (cpower y n)) = (cpower (infix_sldt x y) n)).

Axiom cpower_pi_bound_square_inv :
  infix_lseqdt (infix_sldt (i_to_c 4%Z) (cpower pi 2%Z)) c_one.

Axiom cpower_mult_split :
  forall (x:complex) (y:complex) (m:Z), (0%Z <= m)%Z ->
  ((cpower (infix_asdt x y) m) = (infix_asdt (cpower x m) (cpower y m))).

Axiom not_cpower_zero :
  forall (e:complex) (i:Z), ~ (e = c_zero) -> ~ ((cpower e i) = c_zero).

Axiom cpower_inv_out :
  forall (x:complex) (y:complex), (infix_lsdt c_zero y) ->
  ((infix_asdt (cpower (infix_asdt (infix_sldt c_one (square_rt y)) x) 2%Z)
    y)
   = (cpower x 2%Z)).

Axiom squarert_inv :
  forall (x:complex), (infix_lsdt c_zero x) ->
  ((infix_sldt c_one (square_rt x)) = (square_rt (infix_sldt c_one x))).

Axiom squarert_inv_rev :
  forall (x:complex), (infix_lsdt c_zero x) ->
  ((square_rt (infix_sldt c_one x)) = (infix_sldt c_one (square_rt x))).

Axiom cpower_squarert_two :
  forall (i:Z), (0%Z <= i)%Z ->
  ((cpower squarert_two i) = (square_rt (i_to_c (power_ 2%Z i)))).

Axiom cpower_square_rt_raise :
  forall (x:complex) (y:complex), (infix_lsdt c_zero y) ->
  ((cpower (infix_sldt x (square_rt y)) 2%Z) =
   (infix_sldt (infix_asdt (cpower x 2%Z) c_one) y)).

Axiom cpower_subst :
  forall (x:complex) (n:Z) (m:Z), ~ (x = c_zero) ->
  ((infix_asdt (infix_sldt c_one (cpower x n)) (cpower x m)) =
   (cpower x (m - n)%Z)).

Axiom cpower_c_one_pos :
  forall (m:Z), (m >= 0%Z)%Z -> ((cpower c_one m) = c_one).

Axiom mult_cpower :
  forall (x:complex) (x':complex) (i:Z), (0%Z <= i)%Z ->
  ((infix_asdt (cpower x i) (cpower x' i)) = (cpower (infix_asdt x x') i)).

Axiom mult_cpower_rev :
  forall (x:complex) (x':complex) (i:Z), (0%Z <= i)%Z ->
  ((cpower (infix_asdt x x') i) = (infix_asdt (cpower x i) (cpower x' i))).

Axiom cpower_iterate :
  forall (e:complex) (i:Z), (0%Z <= i)%Z ->
  ((cpower e i) =
   (int_iterate (fun (y0:complex) (y1:complex) => (infix_asdt y0 y1))
    ((fun (y0:complex) (y1:Z) => (const y0 y1)) e) 0%Z i)).

Axiom cpower_modulus :
  forall (x:complex) (n:Z), (0%Z <= n)%Z ->
  ((modulus (cpower x n)) = (cpower (modulus x) n)).

Axiom cpower_modulus1 :
  forall (x:complex) (n:Z), (0%Z <= n)%Z -> (n > 0%Z)%Z ->
  (infix_lsdt (modulus x) c_one) -> infix_lsdt (modulus (cpower x n)) c_one.

Axiom cpower_modulus2 :
  forall (x:complex) (n:Z), (0%Z <= n)%Z -> (n > 0%Z)%Z ->
  ((modulus x) = c_one) -> ((modulus (cpower x n)) = c_one).

Axiom cpower_modulus3 :
  forall (x:complex) (n:Z), (0%Z <= n)%Z -> (n > 0%Z)%Z ->
  (infix_gtdt (modulus x) c_one) -> infix_gtdt (modulus (cpower x n)) c_one.

Axiom cpower_modulus4 :
  forall (x:complex) (n:Z), (0%Z <= n)%Z -> (n > 0%Z)%Z ->
  (infix_lsdt (modulus (cpower x n)) c_one) -> infix_lsdt (modulus x) c_one.

Axiom cpower_modulus5 :
  forall (x:complex) (n:Z), (0%Z <= n)%Z -> (n > 0%Z)%Z ->
  ((modulus (cpower x n)) = c_one) -> ((modulus x) = c_one).

Axiom cpower_modulus6 :
  forall (x:complex) (n:Z), (0%Z <= n)%Z -> (n > 0%Z)%Z ->
  (infix_gtdt (modulus (cpower x n)) c_one) -> infix_gtdt (modulus x) c_one.

Axiom cpower_mult_pre :
  forall (x:complex) (n:Z) (m:Z), (0%Z <= m)%Z ->
  ((cpower x (n * m)%Z) = (cpower (cpower x n) m)).

Axiom cpower_mult :
  forall (x:complex) (n:Z) (m:Z),
  ((cpower x (n * m)%Z) = (cpower (cpower x n) m)).

Axiom cpower_mult_rev :
  forall (x:complex) (n:Z) (m:Z),
  ((cpower (cpower x n) m) = (cpower x (n * m)%Z)).

Axiom non_zero_cpower_pos :
  forall (i:complex) (n:Z), ~ (i = c_zero) -> (n >= 0%Z)%Z ->
  ~ ((cpower i n) = c_zero).

Axiom inv_cpower_ :
  forall (e:complex) (i:Z), ~ (e = c_zero) ->
  ((infix_sldt c_one (cpower e i)) = (cpower e (-i)%Z)).

Axiom zero_cpower_pos :
  forall (n:Z), (n > 0%Z)%Z -> ((cpower c_zero n) = c_zero).

Axiom zero_cpower :
  forall (n:Z), ~ (n = 0%Z) -> ((cpower c_zero n) = c_zero).

Axiom non_zero_cpower :
  forall (i:complex) (n:Z), ~ (i = c_zero) -> ~ ((cpower i n) = c_zero).

Axiom real_cpower_pos :
  forall (elt:complex) (i:Z), (real_ elt) -> (0%Z <= i)%Z ->
  real_ (cpower elt i).

Axiom real_cpower :
  forall (elt:complex) (i:Z), (real_ elt) -> real_ (cpower elt i).

Axiom real_cpower_is_pos :
  forall (elt:complex) (i:Z), (real_ elt) -> (infix_lseqdt c_zero elt) ->
  (0%Z <= i)%Z -> infix_lseqdt c_zero (cpower elt i).

Axiom real_cpower_is_strict_pos :
  forall (elt:complex) (i:Z), (real_ elt) -> (infix_lsdt c_zero elt) ->
  (0%Z <= i)%Z -> infix_lsdt c_zero (cpower elt i).

Axiom real_modulus_square :
  forall (x:complex), (real_ x) ->
  ((cpower (modulus x) 2%Z) = (cpower x 2%Z)).

Axiom real_modulus_pos :
  forall (x:complex), (real_ x) -> (infix_gteqdt x c_zero) ->
  ((modulus x) = x).

Parameter conjugate: complex -> complex.

Axiom conjugate_def :
  forall (i:complex),
  ((conjugate i) =
   (infix_mndt (t_real_part i) (infix_asdt im (t_im_part i)))).

Axiom real_part_conjugate :
  forall (i:complex), ((t_real_part (conjugate i)) = (t_real_part i)).

Axiom im_part_conjugate :
  forall (i:complex),
  ((t_im_part (conjugate i)) = (prefix_mndt (t_im_part i))).

Axiom invol_conjugate : forall (i:complex), ((conjugate (conjugate i)) = i).

Axiom add_conjugate :
  forall (i:complex) (j:complex),
  ((conjugate (infix_pldt i j)) = (infix_pldt (conjugate i) (conjugate j))).

Axiom add_own_conjugate :
  forall (i:complex),
  ((infix_pldt i (conjugate i)) = (infix_asdt ttwo (t_real_part i))).

Axiom itself_times_conjugate :
  forall (i:complex), real_ (infix_asdt i (conjugate i)).

Axiom itself_times_conjugate1 :
  forall (i:complex),
  ((infix_asdt i (conjugate i)) =
   (infix_pldt (infix_asdt (t_real_part i) (t_real_part i))
    (infix_asdt (t_im_part i) (t_im_part i)))).

Axiom conjugate_to_modulus :
  forall (i:complex),
  ((modulus i) = (square_rt (infix_asdt i (conjugate i)))).

Axiom conjugate_times_itself_pos :
  forall (i:complex), infix_lseqdt c_zero (infix_asdt i (conjugate i)).

Axiom sum_conjugate :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> complex),
  ((conjugate (sum s f)) = (sum s (fun (x:a) => (conjugate (f x))))).

Axiom conjugate_module_one :
  forall (i:complex), ((modulus i) = c_one) -> ((conjugate i) = (inv i)).

Axiom conjugate_module_one_rev :
  forall (i:complex), ~ (i = c_zero) -> ((conjugate i) = (inv i)) ->
  ((modulus i) = c_one).

Axiom conjugate_real : forall (i:complex), (real_ i) -> ((conjugate i) = i).

Axiom conjugate_real_gen :
  forall (i:complex), (real_ i) -> ((conjugate i) = i).

Axiom conjugate_one :
  forall (x:complex), (x = c_one) -> ((conjugate x) = c_one).

Axiom conjugate_c_zero :
  forall (x:complex), (x = c_zero) -> ((conjugate x) = c_zero).

Axiom conjugate_indic :
  forall {a:Type} {a_WT:WhyType a},
  forall (i:a) (j:a), ((conjugate (indic i j)) = (indic i j)).

Axiom conjugate_indic_rev :
  forall {a:Type} {a_WT:WhyType a},
  forall (i:a) (j:a), ((indic i j) = (conjugate (indic i j))).

Axiom conjugate_indic_gen_int :
  forall (i:Z) (j:Z), ((conjugate (indic i j)) = (indic i j)).

Axiom conjugate_pure_im :
  forall (i:complex), (pure_im_ i) -> ((conjugate i) = (prefix_mndt i)).

Axiom conjugate_im : ((conjugate im) = (prefix_mndt im)).

Axiom conjugate_value :
  forall (c:complex) (a:complex) (b:complex), (real_ a) -> (real_ b) ->
  (c = (infix_pldt a (infix_asdt im b))) ->
  ((conjugate c) = (infix_mndt a (infix_asdt im b))).

Axiom conjugate_minus_value :
  forall (c:complex) (a:complex) (b:complex), (real_ a) -> (real_ b) ->
  (c = (infix_mndt a (infix_asdt im b))) ->
  ((conjugate c) = (infix_pldt a (infix_asdt im b))).

Axiom prod_conjugate :
  forall (a:complex) (b:complex),
  ((infix_asdt a (conjugate b)) =
   (infix_pldt
    (infix_pldt (infix_asdt (t_real_part a) (t_real_part b))
     (infix_asdt (t_im_part a) (t_im_part b)))
    (infix_asdt im
     (infix_mndt (infix_asdt (t_real_part b) (t_im_part a))
      (infix_asdt (t_im_part b) (t_real_part a)))))).

Axiom mult_conjugate :
  forall (a:complex) (b:complex),
  ((conjugate (infix_asdt a b)) = (infix_asdt (conjugate a) (conjugate b))).

Axiom conjugate_prod :
  forall (a:complex) (b:complex),
  ((infix_asdt (conjugate a) b) =
   (infix_pldt
    (infix_pldt (infix_asdt (t_real_part a) (t_real_part b))
     (infix_asdt (t_im_part a) (t_im_part b)))
    (infix_asdt im
     (infix_mndt (infix_asdt (t_real_part a) (t_im_part b))
      (infix_asdt (t_real_part b) (t_im_part a)))))).

Axiom conj_conj_prod :
  forall (a:complex) (b:complex),
  ((conjugate (infix_asdt (conjugate a) b)) = (infix_asdt a (conjugate b))).

Axiom conj_prod_conj :
  forall (a:complex) (b:complex),
  ((conjugate (infix_asdt a (conjugate b))) = (infix_asdt (conjugate a) b)).

Axiom itself_prod_conjugate_modulus_one :
  forall (a:complex), ((modulus a) = c_one) ->
  ((infix_asdt a (conjugate a)) = c_one).

Axiom conjugate_prod_itself_modulus_one :
  forall (a:complex), ((modulus a) = c_one) ->
  ((infix_asdt a (conjugate a)) = c_one).

Axiom modulus_opposite :
  forall (a:complex), (real_ a) -> (infix_lseqdt c_zero a) ->
  ((modulus a) = (modulus (prefix_mndt a))).

Axiom modulus_conjugate :
  forall (a:complex), ((modulus a) = (modulus (conjugate a))).

Axiom modulus_pos1 :
  forall (a:complex), (real_ a) -> (infix_lseqdt c_zero a) ->
  ((modulus a) = a).

Axiom modulus_neg :
  forall (a:complex), (real_ a) -> (infix_lseqdt a c_zero) ->
  ((modulus a) = (prefix_mndt a)).

Axiom inv_rewrite :
  forall (x:complex), ~ (x = c_zero) ->
  ((infix_sldt c_one x) =
   (infix_sldt (conjugate x) (cpower (modulus x) 2%Z))).

Axiom inv_rewrite1 :
  forall (x:complex), ~ (x = c_zero) ->
  ((infix_sldt c_one x) =
   (infix_asdt (conjugate x) (infix_sldt c_one (cpower (modulus x) 2%Z)))).

Axiom inv_modulus :
  forall (x:complex), ~ (x = c_zero) ->
  ((modulus (infix_sldt c_one x)) = (infix_sldt c_one (modulus x))).

Axiom div_modulus :
  forall (x:complex) (y:complex), ~ (x = c_zero) ->
  ((modulus (infix_sldt y x)) = (infix_sldt (modulus y) (modulus x))).

Axiom square_frac_modulus :
  forall (x:complex) (y:complex), ~ (y = c_zero) ->
  ((cpower (modulus (infix_sldt x y)) 2%Z) =
   (infix_sldt (cpower (modulus x) 2%Z) (cpower (modulus y) 2%Z))).

Axiom modulus_one_decomp :
  forall (k:Z) (n:Z), ((0%Z <= k)%Z /\ (k < (power_ 2%Z n))%Z) ->
  ((modulus
    (infix_pldt
     (infix_sldt (square_rt (i_to_c ((power_ 2%Z n) - k)%Z))
      (square_rt (i_to_c (power_ 2%Z n))))
     (infix_asdt im
      (infix_sldt (square_rt (i_to_c k)) (square_rt (i_to_c (power_ 2%Z n)))))))
   = c_one).

Axiom modulus_one_decomp_add :
  forall (k:Z) (n:Z), ((0%Z <= k)%Z /\ (k < (power_ 2%Z n))%Z) ->
  ((infix_pldt
    (modulus
     (infix_sldt (square_rt (i_to_c ((power_ 2%Z n) - k)%Z))
      (square_rt (i_to_c (power_ 2%Z n)))))
    (modulus
     (infix_sldt (square_rt (i_to_c k)) (square_rt (i_to_c (power_ 2%Z n))))))
   = c_one).

Axiom extract_2_sq_modulus :
  forall (x:complex) (y:complex) (a:complex), ~ (a = c_zero) ->
  ~ (y = c_zero) ->
  ((infix_sldt (cpower (modulus x) 2%Z) (cpower (modulus y) 2%Z)) =
   (infix_sldt (infix_asdt a (cpower (modulus x) 2%Z))
    (infix_asdt a (cpower (modulus y) 2%Z)))).

Axiom cpower_2_modulus_simpl :
  forall (x:complex) (y:complex) (z:complex), ~ (x = c_zero) ->
  ~ (y = c_zero) -> ~ (z = c_zero) ->
  ((infix_sldt (cpower (modulus (infix_asdt x y)) 2%Z)
    (cpower (modulus (infix_asdt z y)) 2%Z))
   = (infix_sldt (cpower (modulus x) 2%Z) (cpower (modulus z) 2%Z))).

Axiom cpower_div_leq_one :
  forall (a:complex) (b:complex) (i:Z),
  ((infix_lseqdt c_zero a) /\ (infix_lseqdt a b)) -> (infix_lsdt c_zero b) ->
  (0%Z <= i)%Z -> infix_lseqdt c_zero (infix_sldt (cpower a i) (cpower b i)).

Axiom cpower_div_leq_one1 :
  forall (a:complex) (b:complex) (i:Z),
  ((infix_lseqdt c_zero a) /\ (infix_lseqdt a b)) -> (infix_lsdt c_zero b) ->
  (0%Z <= i)%Z -> infix_lseqdt (infix_sldt (cpower a i) (cpower b i)) c_one.

Axiom cpower_cpower :
  forall (x:complex) (a:Z) (b:Z),
  ((cpower (cpower x a) b) = (cpower x (a * b)%Z)).

Axiom pre_cond_int_ :
  forall (a:complex) (b:complex) (c:complex), (infix_lsdt a b) ->
  (infix_lsdt c_zero c) -> infix_lsdt (infix_asdt a c) (infix_asdt b c).

Axiom growing_mult1 :
  forall (n:complex) (m:complex), (infix_lseqdt c_zero n) ->
  (infix_lseqdt c_one m) -> infix_lseqdt n (infix_asdt n m).

Axiom strict_growing_mult_pos :
  forall (n:complex) (m:complex), (infix_lsdt c_one n) ->
  (infix_lsdt c_one m) -> infix_lsdt n (infix_asdt n m).

Axiom init_exp3 : forall (k:complex), ((cpower k 0%Z) = c_one).

Axiom init_exp4 : forall (k:complex), ((cpower k 1%Z) = k).

Axiom init_exp5 : forall (k:complex), ((cpower k 2%Z) = (infix_asdt k k)).

Axiom int_exp_pos :
  forall (k:complex) (n:Z), (infix_lseqdt c_one k) -> (0%Z <= n)%Z ->
  infix_gteqdt (cpower k n) c_one.

Axiom int_exp_pos1 :
  forall (k:complex) (n:Z), (infix_lseqdt c_one k) -> (0%Z <= n)%Z ->
  infix_gtdt (cpower k n) c_zero.

Axiom int_exp_pos2 :
  forall (k:complex) (n:Z), (infix_lseqdt c_one k) -> (0%Z <= n)%Z ->
  infix_lseqdt (cpower k n) (cpower k (n + 1%Z)%Z).

Axiom strict_int_exp_pos :
  forall (k:complex) (n:Z), (infix_lsdt c_one k) -> (0%Z < n)%Z ->
  infix_gtdt (cpower k n) c_one.

Axiom strict_int_exp_pos1 :
  forall (k:complex) (n:Z), (infix_lsdt c_one k) -> (0%Z < n)%Z ->
  infix_lsdt (cpower k (n - 1%Z)%Z) (cpower k n).

Axiom strict_int_exp_pos2 :
  forall (k:complex) (n:Z), (infix_lsdt c_one k) -> (0%Z < n)%Z ->
  infix_lsdt (cpower k n) (cpower k (n + 1%Z)%Z).

Axiom strict_int_exp_neg :
  forall (k:complex) (n:Z), (infix_lsdt c_one k) -> (n < 0%Z)%Z ->
  infix_lsdt (cpower k n) c_one.

Axiom strict_int_exp_neg1 :
  forall (k:complex) (n:Z), (infix_lsdt c_one k) -> (n < 0%Z)%Z ->
  infix_lsdt (cpower k (n - 1%Z)%Z) (cpower k n).

Axiom strict_int_exp_neg2 :
  forall (k:complex) (n:Z), (infix_lsdt c_one k) -> (n < 0%Z)%Z ->
  infix_lsdt (cpower k n) (cpower k (n + 1%Z)%Z).

Axiom int_exp_neg :
  forall (k:complex) (n:Z), (infix_lseqdt c_one k) -> (n < 0%Z)%Z ->
  infix_lseqdt (cpower k n) c_one.

Axiom int_exp_neg1 :
  forall (k:complex) (n:Z), (infix_lseqdt c_one k) -> (n < 0%Z)%Z ->
  infix_gtdt (cpower k n) c_zero.

Axiom int_exp_neg2 :
  forall (k:complex) (n:Z), (infix_lseqdt c_one k) -> (n < 0%Z)%Z ->
  infix_lseqdt (cpower k n) (cpower k (n + 1%Z)%Z).

Axiom positive_exp :
  forall (k:complex) (m:Z), (infix_lseqdt c_one k) ->
  infix_lsdt c_zero (cpower k m).

Axiom growing_exp_pos :
  forall (k:complex) (m:Z) (n:Z), (infix_lseqdt c_one k) ->
  ((0%Z <= m)%Z /\ (m <= n)%Z) -> infix_lseqdt (cpower k m) (cpower k n).

Axiom growing_exp1 :
  forall (k:complex) (m:Z) (n:Z), (infix_lseqdt c_one k) -> (m <= n)%Z ->
  infix_lseqdt (cpower k m) (cpower k n).

Axiom growing_exp_arg :
  forall (k:complex) (k':complex) (n:Z),
  ((infix_lseqdt c_zero k) /\ (infix_lseqdt k k')) -> (0%Z <= n)%Z ->
  infix_lseqdt (cpower k n) (cpower k' n).

Axiom strict_growing_exp1 :
  forall (k:complex) (m:Z) (n:Z), (infix_lsdt c_one k) -> (m < n)%Z ->
  infix_lsdt (cpower k m) (cpower k n).

Axiom cpower_comm_pos :
  forall (x:complex) (y:complex) (n:Z), (infix_lseqdt c_one x) ->
  (infix_lseqdt c_one y) -> (0%Z <= n)%Z ->
  ((cpower (infix_asdt x y) n) = (infix_asdt (cpower x n) (cpower y n))).

Axiom cpower_comm :
  forall (x:complex) (y:complex) (n:Z), (infix_lseqdt c_one x) ->
  (infix_lseqdt c_one y) ->
  ((cpower (infix_asdt x y) n) = (infix_asdt (cpower x n) (cpower y n))).

Axiom unicity_exp2 :
  forall (k:complex) (m:Z) (n:Z), (infix_lsdt c_one k) ->
  ((cpower k m) = (cpower k n)) -> (m = n).

Axiom unicity_exp3 :
  forall (k:complex) (m:Z) (n:Z), (infix_lsdt c_one k) -> (m = n) ->
  ((cpower k m) = (cpower k n)).

Axiom cpower_i_to_c :
  forall (a:Z) (b:Z), (0%Z <= b)%Z ->
  ((i_to_c (power_ a b)) = (cpower (i_to_c a) b)).

Axiom cpower_i_to_c_rev :
  forall (a:Z) (b:Z), (0%Z <= b)%Z ->
  ((cpower (i_to_c a) b) = (i_to_c (power_ a b))).

Axiom geometric_series :
  forall (a:complex) (q:complex) (n:Z), (1%Z <= n)%Z -> ~ (c_one = q) ->
  ((sum (to_fset 0%Z n) (fun (i:Z) => (infix_asdt a (cpower q i)))) =
   (infix_sldt (infix_asdt a (infix_mndt c_one (cpower q n)))
    (infix_mndt c_one q))).

Axiom ind_geometric_series_r :
  forall (a:complex) (q:complex) (n:Z), (n >= 1%Z)%Z -> ~ (c_one = q) ->
  ((ind_sum (fun (i:Z) => (infix_asdt a (cpower q i))) 0%Z n) =
   (infix_sldt (infix_asdt a (infix_mndt c_one (cpower q n)))
    (infix_mndt c_one q))).

Axiom ind_geometric_series :
  forall (q:complex) (n:Z), (n >= 1%Z)%Z -> ~ (c_one = q) ->
  ((ind_sum (fun (i:Z) => (cpower q i)) 0%Z n) =
   (infix_sldt (infix_mndt c_one (cpower q n)) (infix_mndt c_one q))).

Axiom geometric_series_init_one :
  forall (q:complex) (n:Z), (n >= 1%Z)%Z -> ~ (c_one = q) ->
  ((sum (to_fset 0%Z n) (fun (i:Z) => (cpower q i))) =
   (infix_sldt (infix_mndt c_one (cpower q n)) (infix_mndt c_one q))).

Axiom geometric_series_c_one :
  forall (a:complex) (q:complex) (n:Z), (1%Z <= n)%Z -> (q = c_one) ->
  ((sum (to_fset 0%Z n) (fun (i:Z) => (infix_asdt a (cpower q i)))) =
   (infix_asdt a (i_to_c n))).

Axiom geometric_series_c_one_init_one :
  forall (q:complex) (n:Z), (1%Z <= n)%Z -> (q = c_one) ->
  ((sum (to_fset 0%Z n) (fun (i:Z) => (cpower q i))) = (i_to_c n)).

Axiom positive_cpower_2 :
  forall (x:complex), (real_ x) -> ~ (c_zero = x) ->
  infix_lsdt c_zero (cpower x 2%Z).

Axiom positive_cpower_2_mod :
  forall (x:complex), infix_lseqdt c_zero (cpower (modulus x) 2%Z).

Axiom cpower_2_mod_non_null :
  forall (x:complex), ~ (x = c_zero) ->
  infix_lsdt c_zero (cpower (modulus x) 2%Z).

Axiom cpower_2_mod_mult_non_null :
  forall (x:complex) (y:complex), ~ (x = c_zero) -> ~ (y = c_zero) ->
  infix_lsdt c_zero (cpower (modulus x) 2%Z).

Axiom growing_cpower_2 :
  forall (x:complex) (y:complex),
  ((infix_lseqdt c_zero x) /\ (infix_lseqdt x y)) ->
  infix_lseqdt (cpower x 2%Z) (cpower y 2%Z).

Axiom cpower_incr_power_2 :
  forall (k:Z), (0%Z <= k)%Z ->
  ((cpower (i_to_c (power_ 2%Z k)) 2%Z) = (i_to_c (power_ 2%Z (2%Z * k)%Z))).

Axiom cpower_modulus_incr_power_2 :
  forall (k:Z), (0%Z <= k)%Z ->
  ((cpower (modulus (i_to_c (power_ 2%Z k))) 2%Z) =
   (i_to_c (power_ 2%Z (2%Z * k)%Z))).

Axiom cpower_modulus_supeq :
  forall (x:complex) (y:complex) (i:Z), (i >= 1%Z)%Z ->
  (infix_gteqdt (modulus x) (modulus y)) ->
  infix_gteqdt (cpower (modulus x) i) (cpower (modulus y) i).

Axiom cpower_modulus_div_simpl :
  forall (x:complex) (y:complex) (z:complex) (i:Z), (i >= 1%Z)%Z ->
  (infix_lseqdt c_zero x) -> (infix_lsdt c_zero y) ->
  (infix_lsdt c_zero z) ->
  ((infix_sldt (cpower x i) (cpower y i)) =
   (infix_sldt (cpower (modulus (infix_asdt x z)) i)
    (cpower (modulus (infix_asdt y z)) i))).

Axiom cpower_two_modulus_div_simpl :
  forall (x:complex) (y:complex) (z:complex), (real_ x) -> (real_ y) ->
  (real_ z) -> ~ (c_zero = y) -> ~ (c_zero = z) ->
  ((infix_sldt (cpower x 2%Z) (cpower y 2%Z)) =
   (infix_sldt (cpower (modulus (infix_asdt x z)) 2%Z)
    (cpower (modulus (infix_asdt y z)) 2%Z))).

Parameter exp: complex -> complex.

Parameter e: complex.

Axiom e_def : (e = (exp c_one)).

Axiom e_mod : forall (x:complex), ((modulus (exp x)) = c_one).

Axiom e_diff_c_zero : forall (x:complex), ~ ((exp x) = c_zero).

Axiom Exp_one : real_ (exp c_one).

Axiom Exp_zero : ((exp c_zero) = c_one).

Axiom Exp_sum :
  forall (x:complex) (y:complex),
  ((exp (infix_pldt x y)) = (infix_asdt (exp x) (exp y))).

Axiom exp_one : real_ e.

Axiom Exp_quarter_pi :
  ((exp (infix_sldt (infix_asdt im pi) (i_to_c 4%Z))) =
   (infix_pldt (infix_sldt squarert_two ttwo)
    (infix_asdt im (infix_sldt squarert_two ttwo)))).

Axiom exp_sum :
  forall (x:complex) (y:complex),
  ((exp (infix_pldt x y)) = (infix_asdt (exp x) (exp y))).

Axiom exp_eq :
  forall (t1:complex) (t2:complex), (t1 = t2) -> ((exp t1) = (exp t2)).

Axiom exp_sum_rev :
  forall (x:complex) (y:complex),
  ((infix_asdt (exp x) (exp y)) = (exp (infix_pldt x y))).

Axiom exp_inv :
  forall (i:complex), ~ ((exp i) = c_zero) ->
  ((exp (prefix_mndt i)) = (infix_sldt c_one (exp i))).

Axiom exp_inv_rev :
  forall (i:complex), ~ ((exp i) = c_zero) ->
  ((infix_sldt c_one (exp i)) = (exp (prefix_mndt i))).

Axiom exp_mult_pre :
  forall (x:complex) (y:Z), (y >= 0%Z)%Z ->
  ((exp (infix_asdt x (i_to_c y))) = (cpower (exp x) y)).

Axiom exp_mult :
  forall (x:complex) (y:Z),
  ((exp (infix_asdt x (i_to_c y))) = (cpower (exp x) y)).

Axiom cpower_to_exp :
  forall (x:complex) (y:Z),
  ((cpower (exp x) y) = (exp (infix_asdt x (i_to_c y)))).

Axiom exp_h_pi : ((exp (infix_sldt (infix_asdt im pi) ttwo)) = im).

Parameter two_pi_i: complex.

Axiom two_pi_i_def : (two_pi_i = (infix_asdt (infix_asdt im pi) ttwo)).

Axiom exp_pi : ((exp (infix_asdt im pi)) = (prefix_mndt c_one)).

Axiom exp_two_pi : ((exp two_pi_i) = c_one).

Axiom exp_two_pi_mul :
  forall (k:Z), ((exp (infix_asdt (i_to_c k) two_pi_i)) = c_one).

Axiom exp_two_pi_mul_den :
  forall (k:Z) (l:Z), ~ (k = 0%Z) ->
  ((exp (infix_sldt (infix_asdt (i_to_c (k * l)%Z) two_pi_i) (i_to_c k))) =
   c_one).

Axiom exp_two_pi_mul_den_add :
  forall (k:Z) (l:Z) (m:Z),
  ((exp (infix_asdt (i_to_c ((k * m)%Z + l)%Z) two_pi_i)) =
   (exp (infix_asdt (i_to_c l) two_pi_i))).

Axiom angle : Type.
Parameter angle_WhyType : WhyType angle.
Existing Instance angle_WhyType.

Parameter ang_inv: angle -> angle.

Parameter ang_add: angle -> angle -> angle.

Parameter ang_meas: angle -> complex.

Axiom ang_meas_spec : forall (o:angle), infix_lseqdt c_zero (ang_meas o).

Axiom ang_meas_spec1 : forall (o:angle), infix_lsdt (ang_meas o) c_one.

Axiom real_ang_meas : forall (o:angle), real_ (ang_meas o).

Parameter real_to_ang: complex -> angle.

Parameter ang_zero: angle.

Axiom Assoc2 :
  forall (x:angle) (y:angle) (z:angle),
  ((ang_add (ang_add x y) z) = (ang_add x (ang_add y z))).

Axiom Unit_def_l1 : forall (x:angle), ((ang_add ang_zero x) = x).

Axiom Unit_def_r1 : forall (x:angle), ((ang_add x ang_zero) = x).

Axiom Inv_def_l1 : forall (x:angle), ((ang_add (ang_inv x) x) = ang_zero).

Axiom Inv_def_r1 : forall (x:angle), ((ang_add x (ang_inv x)) = ang_zero).

Axiom Comm2 : forall (x:angle) (y:angle), ((ang_add x y) = (ang_add y x)).

Axiom Real_To_Ang_one :
  forall (phi:complex), (real_ phi) -> ((real_to_ang c_one) = ang_zero).

Axiom Real_To_Ang_inv :
  forall (phi:complex), (real_ phi) ->
  ((ang_inv (real_to_ang phi)) = (real_to_ang (prefix_mndt phi))).

Axiom Real_To_Ang_add :
  forall (phi:complex) (phi':complex), (real_ phi) -> (real_ phi') ->
  ((ang_add (real_to_ang phi) (real_to_ang phi')) =
   (real_to_ang (infix_pldt phi phi'))).

Axiom meas_value :
  forall (phi:complex), (real_ phi) ->
  ((infix_lseqdt c_zero phi) /\ (infix_lsdt phi c_one)) ->
  ((ang_meas (real_to_ang phi)) = phi).

Axiom Equal_angle :
  forall (o:angle) (o':angle),
  ((exp (infix_asdt two_pi_i (ang_meas o))) =
   (exp (infix_asdt two_pi_i (ang_meas o')))) ->
  (o = o').

Axiom Equal_angle1 :
  forall (o:angle) (o':angle), (o = o') ->
  ((exp (infix_asdt two_pi_i (ang_meas o))) =
   (exp (infix_asdt two_pi_i (ang_meas o')))).

Axiom set_equal_angle_meas :
  forall (o:angle) (o':angle), (o = o') -> ((ang_meas o) = (ang_meas o')).

Axiom get_equal_angle_meas :
  forall (o:angle) (o':angle), ((ang_meas o) = (ang_meas o')) -> (o = o').

Axiom meas_real_to_ang : forall (o:angle), ((real_to_ang (ang_meas o)) = o).

Axiom meas_real_to_ang_rev :
  forall (o:angle), (o = (real_to_ang (ang_meas o))).

Axiom ang_add_rev :
  forall (o:angle) (o':angle), ((ang_add o o') = (ang_add o' o)).

Axiom real_to_ang_zero : ((real_to_ang c_zero) = ang_zero).

Parameter ang_exp: angle -> complex.

Axiom ang_exp_def :
  forall (o:angle), ((ang_exp o) = (exp (infix_asdt two_pi_i (ang_meas o)))).

Axiom ang_exp_spec : forall (o:angle), ~ ((ang_exp o) = c_zero).

Axiom set_equal_angle_exp :
  forall (o:angle) (o':angle), (o = o') -> ((ang_exp o) = (ang_exp o')).

Axiom get_equal_angle_exp :
  forall (o:angle) (o':angle), ((ang_exp o) = (ang_exp o')) -> (o = o').

Axiom meas_value_plus_one :
  forall (phi:complex), (real_ phi) ->
  ((exp (infix_asdt two_pi_i (ang_meas (real_to_ang phi)))) =
   (exp
    (infix_asdt two_pi_i (infix_pldt (ang_meas (real_to_ang phi)) c_one)))).

Axiom ang_exp_pi_over_four :
  ((ang_exp (real_to_ang (infix_sldt c_one (i_to_c 8%Z)))) =
   (infix_pldt (infix_sldt squarert_two ttwo)
    (infix_asdt im (infix_sldt squarert_two ttwo)))).

Axiom ang_exp_pi_over_two :
  ((ang_exp (real_to_ang (infix_sldt c_one (i_to_c 4%Z)))) = im).

Axiom ang_exp_pi :
  ((ang_exp (real_to_ang (infix_sldt c_one (i_to_c 2%Z)))) =
   (prefix_mndt c_one)).

Axiom real_to_ang_c_one : ((real_to_ang c_one) = ang_zero).

Axiom set_ang_meas_eq :
  forall (o:angle) (o':angle), (o = o') -> ((ang_meas o) = (ang_meas o')).

Axiom get_ang_meas_eq :
  forall (o:angle) (o':angle), ((ang_meas o) = (ang_meas o')) -> (o = o').

Axiom ang_exp_zero : ((ang_exp ang_zero) = c_one).

Axiom ang_exp_two_pi : ((ang_exp (real_to_ang (i_to_c 1%Z))) = c_one).

Axiom ang_exp_c_one : ((ang_exp (real_to_ang c_one)) = c_one).

Axiom ang_meas_add_inf_c_one :
  forall (o:angle) (o':angle),
  (infix_lsdt (infix_pldt (ang_meas o) (ang_meas o')) c_one) ->
  ((ang_meas (ang_add o o')) = (infix_pldt (ang_meas o) (ang_meas o'))).

Axiom set_ang_exp_eq :
  forall (o:angle) (o':angle), (o = o') -> ((ang_exp o) = (ang_exp o')).

Axiom get_ang_exp_meas_eq :
  forall (o:angle) (o':angle), ((ang_exp o) = (ang_exp o')) ->
  ((ang_meas o) = (ang_meas o')).

Axiom get_ang_exp_eq :
  forall (o:angle) (o':angle), ((ang_exp o) = (ang_exp o')) -> (o = o').

Axiom ang_meas_zero : ((ang_meas ang_zero) = c_zero).

Axiom real_to_ang_add_one :
  forall (x:complex), (real_ x) ->
  ((real_to_ang (infix_pldt x c_one)) = (real_to_ang x)).

Parameter truncate: R -> Z.

Axiom Truncate_int : forall (i:Z), ((truncate (BuiltIn.IZR i)) = i).

Axiom Truncate_down_pos :
  forall (x:R), (x >= 0%R)%R -> ((BuiltIn.IZR (truncate x)) <= x)%R.

Axiom Truncate_down_pos1 :
  forall (x:R), (x >= 0%R)%R -> (x < (BuiltIn.IZR ((truncate x) + 1%Z)%Z))%R.

Axiom Truncate_up_neg :
  forall (x:R), (x <= 0%R)%R -> ((BuiltIn.IZR ((truncate x) - 1%Z)%Z) < x)%R.

Axiom Truncate_up_neg1 :
  forall (x:R), (x <= 0%R)%R -> (x <= (BuiltIn.IZR (truncate x)))%R.

Axiom Real_of_truncate :
  forall (x:R), ((x - 1%R)%R <= (BuiltIn.IZR (truncate x)))%R.

Axiom Real_of_truncate1 :
  forall (x:R), ((BuiltIn.IZR (truncate x)) <= (x + 1%R)%R)%R.

Axiom Truncate_monotonic :
  forall (x:R) (y:R), (x <= y)%R -> ((truncate x) <= (truncate y))%Z.

Axiom Truncate_monotonic_int1 :
  forall (x:R) (i:Z), (x <= (BuiltIn.IZR i))%R -> ((truncate x) <= i)%Z.

Axiom Truncate_monotonic_int2 :
  forall (x:R) (i:Z), ((BuiltIn.IZR i) <= x)%R -> (i <= (truncate x))%Z.

Parameter floor: R -> Z.

Parameter ceil: R -> Z.

Axiom Floor_int : forall (i:Z), ((floor (BuiltIn.IZR i)) = i).

Axiom Ceil_int : forall (i:Z), ((ceil (BuiltIn.IZR i)) = i).

Axiom Floor_down : forall (x:R), ((BuiltIn.IZR (floor x)) <= x)%R.

Axiom Floor_down1 : forall (x:R), (x < (BuiltIn.IZR ((floor x) + 1%Z)%Z))%R.

Axiom Ceil_up : forall (x:R), ((BuiltIn.IZR ((ceil x) - 1%Z)%Z) < x)%R.

Axiom Ceil_up1 : forall (x:R), (x <= (BuiltIn.IZR (ceil x)))%R.

Axiom Floor_monotonic :
  forall (x:R) (y:R), (x <= y)%R -> ((floor x) <= (floor y))%Z.

Axiom Ceil_monotonic :
  forall (x:R) (y:R), (x <= y)%R -> ((ceil x) <= (ceil y))%Z.

Parameter int_part: complex -> complex.

Axiom int_part_def :
  forall (x:complex), (real_ x) ->
  ((int_part x) = (i_to_c (floor (real_part x)))).

Axiom int_part_spec : forall (x:complex), (real_ x) -> real_ (int_part x).

Axiom int_part_spec1 :
  forall (x:complex), (real_ x) -> exists i:Z, ((int_part x) = (i_to_c i)).

Axiom int_part_spec2 :
  forall (x:complex), (real_ x) -> infix_lseqdt (int_part x) x.

Axiom int_part_spec3 :
  forall (x:complex), (real_ x) ->
  infix_lsdt x (infix_pldt (int_part x) c_one).

Parameter int_part_int: complex -> Z.

Axiom int_part_int_def :
  forall (x:complex), (real_ x) -> ((int_part_int x) = (floor (real_part x))).

Axiom int_part_int_spec :
  forall (x:complex), (real_ x) -> ((i_to_c (int_part_int x)) = (int_part x)).

Axiom int_part_int_spec1 :
  forall (x:complex), (real_ x) -> infix_lseqdt (i_to_c (int_part_int x)) x.

Axiom int_part_int_spec2 :
  forall (x:complex), (real_ x) ->
  infix_lsdt x (infix_pldt (i_to_c (int_part_int x)) c_one).

Parameter dec_part: complex -> complex.

Axiom dec_part_def :
  forall (x:complex), (real_ x) ->
  ((dec_part x) = (infix_mndt x (int_part x))).

Axiom dec_part_spec : forall (x:complex), (real_ x) -> real_ (dec_part x).

Axiom dec_part_spec1 :
  forall (x:complex), (real_ x) ->
  exists i:Z, ((dec_part x) = (infix_mndt x (i_to_c i))).

Axiom dec_part_spec2 :
  forall (x:complex), (real_ x) -> infix_lseqdt c_zero (dec_part x).

Axiom dec_part_spec3 :
  forall (x:complex), (real_ x) -> infix_lsdt (dec_part x) c_one.

Axiom dec_part_decomp :
  forall (x:complex), (real_ x) ->
  (x = (infix_pldt (dec_part x) (int_part x))).

Axiom dec_part_decomp_rev :
  forall (x:complex), (real_ x) ->
  ((infix_pldt (dec_part x) (int_part x)) = x).

Axiom dec_part_decomp_int :
  forall (x:complex), (real_ x) ->
  (x = (infix_pldt (dec_part x) (i_to_c (int_part_int x)))).

Axiom dec_part_decomp_int_rev :
  forall (x:complex), (real_ x) ->
  ((infix_pldt (dec_part x) (i_to_c (int_part_int x))) = x).

Axiom ang_exp_add_b :
  forall (o:angle) (o':angle),
  (infix_lsdt (infix_pldt (ang_meas o) (ang_meas o')) c_one) ->
  ((ang_exp (ang_add o o')) = (infix_asdt (ang_exp o) (ang_exp o'))).

Axiom ang_exp_add_b_rev :
  forall (o:angle) (o':angle),
  (infix_lsdt (infix_pldt (ang_meas o) (ang_meas o')) c_one) ->
  ((infix_asdt (ang_exp o) (ang_exp o')) = (ang_exp (ang_add o o'))).

Axiom real_to_ang_add :
  forall (x:complex) (x':complex), (real_ x) -> (real_ x') ->
  ((real_to_ang (infix_pldt x x')) =
   (ang_add (real_to_ang x) (real_to_ang x'))).

Axiom real_to_ang_add_rev :
  forall (x:complex) (x':complex), (real_ x) -> (real_ x') ->
  ((ang_add (real_to_ang x) (real_to_ang x')) =
   (real_to_ang (infix_pldt x x'))).

Axiom ang_inv_add :
  forall (o:angle) (o':angle),
  ((ang_inv (ang_add o o')) = (ang_add (ang_inv o) (ang_inv o'))).

Axiom ang_inv_add_rev :
  forall (o:angle) (o':angle),
  ((ang_add (ang_inv o) (ang_inv o')) = (ang_inv (ang_add o o'))).

Axiom ang_exp_add_pre :
  forall (o:angle) (o':angle),
  (infix_lseqdt c_one (infix_pldt (ang_meas o) (ang_meas o'))) ->
  (infix_lseqdt (ang_meas o) (ang_meas o')) ->
  ((ang_exp (ang_add o o')) = (infix_asdt (ang_exp o) (ang_exp o'))).

Axiom ang_exp_add :
  forall (o:angle) (o':angle),
  ((ang_exp (ang_add o o')) = (infix_asdt (ang_exp o) (ang_exp o'))).

Axiom ang_meas_add :
  forall (o:angle) (o':angle),
  ((real_to_ang (ang_meas (ang_add o o'))) = (ang_add o o')).

Axiom ang_exp_add_rev :
  forall (o:angle) (o':angle),
  ((infix_asdt (ang_exp o) (ang_exp o')) = (ang_exp (ang_add o o'))).

Axiom real_to_ang_int_pre :
  forall (k:Z), (0%Z <= k)%Z -> ((ang_exp (real_to_ang (i_to_c k))) = c_one).

Axiom real_to_ang_int :
  forall (k:Z), ((ang_exp (real_to_ang (i_to_c k))) = c_one).

Axiom real_to_ang_int_ : forall (k:Z), ((real_to_ang (i_to_c k)) = ang_zero).

Axiom real_to_ang_value_add :
  forall (phi:complex) (k:Z),
  ((infix_lseqdt c_zero phi) /\ (infix_lsdt phi c_one)) ->
  ((ang_exp (real_to_ang (infix_pldt phi (i_to_c k)))) =
   (exp (infix_asdt two_pi_i phi))).

Axiom real_to_ang_value :
  forall (phi:complex), (real_ phi) ->
  ((ang_exp (real_to_ang phi)) = (exp (infix_asdt two_pi_i phi))).

Axiom ang_exp_zero_ : ((ang_exp ang_zero) = c_one).

Parameter ang_mult_int_: angle -> Z -> angle.

Axiom ang_mult_int__def :
  forall (theta:angle) (i:Z), (0%Z <= i)%Z -> (i = 0%Z) ->
  ((ang_mult_int_ theta i) = ang_zero).

Axiom ang_mult_int__def1 :
  forall (theta:angle) (i:Z), (0%Z <= i)%Z -> ~ (i = 0%Z) ->
  ((ang_mult_int_ theta i) =
   (ang_add (ang_mult_int_ theta (i - 1%Z)%Z) theta)).

Axiom ang_mult_int__spec :
  forall (theta:angle) (i:Z), (0%Z <= i)%Z ->
  ((ang_mult_int_ theta i) =
   (real_to_ang (infix_asdt (ang_meas theta) (i_to_c i)))).

Parameter ang_mult_int: angle -> Z -> angle.

Axiom ang_mult_int_def :
  forall (theta:angle) (i:Z), (0%Z <= i)%Z ->
  ((ang_mult_int theta i) = (ang_mult_int_ theta i)).

Axiom ang_mult_int_def1 :
  forall (theta:angle) (i:Z), ~ (0%Z <= i)%Z ->
  ((ang_mult_int theta i) = (ang_inv (ang_mult_int_ theta (-i)%Z))).

Axiom ang_mult_int_to_real_to_ang :
  forall (theta:angle) (i:Z),
  ((ang_mult_int theta i) =
   (real_to_ang (infix_asdt (ang_meas theta) (i_to_c i)))).

Axiom ang_mult_int_plus_one_pos :
  forall (theta:angle) (i:Z), (0%Z < i)%Z ->
  ((ang_mult_int theta i) = (ang_add (ang_mult_int theta (i - 1%Z)%Z) theta)).

Axiom ang_mult_int_inv :
  forall (theta:angle) (i:Z), (i < 0%Z)%Z ->
  ((ang_mult_int theta i) = (ang_inv (ang_mult_int theta (-i)%Z))).

Axiom real_to_ang_eq :
  forall (phi:complex) (phi':complex), (real_ phi) -> (phi = phi') ->
  ((real_to_ang phi) = (real_to_ang phi')).

Axiom set_equal_angle_by_exp :
  forall (o:angle) (o':angle), ((ang_exp o) = (ang_exp o')) -> (o = o').

Axiom real_to_ang_int_dec_part :
  forall (x:complex), (real_ x) ->
  ((real_to_ang x) = (real_to_ang (dec_part x))).

Axiom set_equal_exp_by_ang :
  forall (o:angle) (o':angle), (o = o') -> ((ang_exp o) = (ang_exp o')).

Parameter int_to_ang: Z -> Z -> angle.

Axiom int_to_ang_def :
  forall (k:Z) (n:Z), (n >= 0%Z)%Z ->
  ((int_to_ang k n) =
   (real_to_ang (infix_sldt (i_to_c k) (i_to_c (power_ 2%Z n))))).

Axiom int_to_ang_spec :
  forall (k:Z) (n:Z), (n >= 0%Z)%Z ->
  ((int_to_ang k n) =
   (real_to_ang
    (infix_sldt (i_to_c (int.EuclideanDivision.mod1 k (power_ 2%Z n)))
     (i_to_c (power_ 2%Z n))))).

Axiom int_to_ang_spec1 :
  forall (k:Z) (n:Z), (n >= 0%Z)%Z ->
  ((0%Z <= k)%Z /\ (k < (power_ 2%Z n))%Z) ->
  ((ang_meas (int_to_ang k n)) =
   (infix_sldt (i_to_c k) (i_to_c (power_ 2%Z n)))).

Axiom real_to_ang_inv :
  forall (x:complex), (real_ x) ->
  ((real_to_ang (prefix_mndt x)) = (ang_inv (real_to_ang x))).

Axiom real_to_ang_inv_rev :
  forall (x:complex), (real_ x) ->
  ((ang_inv (real_to_ang x)) = (real_to_ang (prefix_mndt x))).

Axiom involutive_ang_inv : forall (o:angle), ((ang_inv (ang_inv o)) = o).

Axiom Real_To_Ang_inv_add :
  forall (phi:complex), (real_ phi) ->
  ((ang_add (real_to_ang phi) (real_to_ang (prefix_mndt phi))) = ang_zero).

Axiom Real_To_Ang_up :
  forall (phi:complex), (real_ phi) ->
  ((real_to_ang phi) = (real_to_ang (infix_pldt c_one phi))).

Axiom real_To_Ang_cyclic_pos :
  forall (phi:complex) (k:Z), (real_ phi) -> (0%Z <= k)%Z ->
  ((real_to_ang phi) = (real_to_ang (infix_pldt (i_to_c k) phi))).

Axiom real_To_Ang_cyclic_neg :
  forall (phi:complex) (k:Z), (real_ phi) -> (0%Z <= k)%Z ->
  ((real_to_ang (infix_mndt (i_to_c k) phi)) =
   (real_to_ang (prefix_mndt phi))).

Axiom real_to_ang_equiv :
  forall (x:complex) (x':complex), (real_ x) ->
  (exists k:Z, (x' = (infix_pldt x (i_to_c k)))) ->
  ((real_to_ang x) = (real_to_ang x')).

Axiom Real_zero_n : ((real_to_ang c_zero) = ang_zero).

Axiom real_ang_mult_pos :
  forall (phi:complex) (i:Z), (real_ phi) -> (0%Z <= i)%Z ->
  ((ang_mult_int (real_to_ang phi) i) =
   (real_to_ang (infix_asdt phi (i_to_c i)))).

Axiom real_ang_mult :
  forall (phi:complex) (i:Z), (real_ phi) ->
  ((ang_mult_int (real_to_ang phi) i) =
   (real_to_ang (infix_asdt phi (i_to_c i)))).

Axiom real_to_ang_down_cucles :
  forall (phi:complex) (x:complex), (real_ phi) -> (x = c_one) ->
  ((real_to_ang (infix_mndt phi x)) = (real_to_ang phi)).

Parameter odd: Z -> bool.

Axiom odd_def :
  forall (n:Z), ((int.EuclideanDivision.mod1 n 2%Z) = 1%Z) ->
  ((odd n) = true).

Axiom odd_def1 :
  forall (n:Z), ~ ((int.EuclideanDivision.mod1 n 2%Z) = 1%Z) ->
  ((odd n) = false).

Axiom odd_spec :
  forall (n:Z), ((odd n) = true) ->
  (n = ((2%Z * (int.EuclideanDivision.div n 2%Z))%Z + 1%Z)%Z).

Axiom odd_spec1 :
  forall (n:Z), ((odd n) = false) ->
  (n = (2%Z * (int.EuclideanDivision.div n 2%Z))%Z).

Parameter even: Z -> bool.

Axiom even_def :
  forall (n:Z), ((int.EuclideanDivision.mod1 n 2%Z) = 0%Z) ->
  ((even n) = true).

Axiom even_def1 :
  forall (n:Z), ~ ((int.EuclideanDivision.mod1 n 2%Z) = 0%Z) ->
  ((even n) = false).

Axiom even_spec : forall (n:Z), ((even n) = true) -> ~ ((odd n) = true).

Axiom even_spec1 : forall (n:Z), ~ ((odd n) = true) -> ((even n) = true).

Axiom even_to_mod :
  forall (n:Z), ((even n) = true) ->
  ((int.EuclideanDivision.mod1 n 2%Z) = 0%Z).

Axiom even_minus_one :
  forall (n:Z), (0%Z < n)%Z -> ((even n) = true) ->
  ((odd (n - 1%Z)%Z) = true).

Axiom odd_minus_one :
  forall (n:Z), (0%Z < n)%Z -> ((odd n) = true) ->
  ((even (n - 1%Z)%Z) = true).

Axiom even_opp : forall (n:Z), ((even n) = true) -> ((even (-n)%Z) = true).

Axiom odd_opp : forall (n:Z), ((odd n) = true) -> ((odd (-n)%Z) = true).

Axiom odd_to_mod :
  forall (n:Z), ((odd n) = true) ->
  ((int.EuclideanDivision.mod1 n 2%Z) = 1%Z).

Axiom even_or_odd : forall (n:Z), ((even n) = true) \/ ((odd n) = true).

Axiom cpower_minus_c_one :
  forall (n:Z), (0%Z <= n)%Z -> ((even n) = true) ->
  ((cpower (prefix_mndt c_one) n) = c_one).

Axiom cpower_minus_c_one1 :
  forall (n:Z), (0%Z <= n)%Z -> ((odd n) = true) ->
  ((cpower (prefix_mndt c_one) n) = (prefix_mndt c_one)).

Axiom cpower_minus_c_one_even :
  forall (n:Z), (0%Z <= n)%Z -> ((even n) = true) ->
  ((cpower (prefix_mndt c_one) n) = c_one).

Axiom cpower_minus_c_one_odd :
  forall (n:Z), (0%Z <= n)%Z -> ((odd n) = true) ->
  ((cpower (prefix_mndt c_one) n) = (prefix_mndt c_one)).

Axiom iproduct_extract_const :
  forall (s:set Z) (f:Z -> Z) (a:Z),
  ((iproduct s (fun (i:Z) => (a * (f i))%Z)) =
   ((power_ a (cardinal s)) * (iproduct s f))%Z).

Axiom not_null_powers_squarert_two :
  forall (i:Z), (0%Z <= i)%Z -> ~ ((cpower squarert_two i) = c_zero).

Parameter pos_coeff: complex.

Axiom pos_coeff_def : (pos_coeff = (infix_sldt c_one squarert_two)).

Axiom real_pos_coeff : real_ pos_coeff.

Parameter neg_coeff: complex.

Axiom neg_coeff_def :
  (neg_coeff = (infix_sldt (prefix_mndt c_one) squarert_two)).

Axiom coeffs : (neg_coeff = (prefix_mndt pos_coeff)).

Parameter mop: Z -> complex.

Axiom mop_def :
  forall (i:Z), (0%Z <= i)%Z -> ((mop i) = (cpower (prefix_mndt c_one) i)).

Axiom minus_one_power_values :
  forall (i:Z), (0%Z <= i)%Z -> ((even i) = true) -> ((mop i) = c_one).

Axiom minus_one_power_values1 :
  forall (i:Z), (0%Z <= i)%Z -> ((odd i) = true) ->
  ((mop i) = (prefix_mndt c_one)).

Axiom factors_mop :
  forall (i:Z) (j:Z), (0%Z <= i)%Z -> (0%Z <= j)%Z ->
  ((mop (i + j)%Z) = (infix_asdt (mop i) (mop j))).

Axiom factors_mop_rev :
  forall (i:Z) (j:Z), (0%Z <= i)%Z -> (0%Z <= j)%Z ->
  ((infix_asdt (mop i) (mop j)) = (mop (i + j)%Z)).

Parameter pow_inv_sqrt_2: Z -> complex.

Axiom pow_inv_sqrt_2_def :
  forall (i:Z), (0%Z <= i)%Z -> ((pow_inv_sqrt_2 i) = (cpower pos_coeff i)).

Axiom pow_inv_sqrt_2_spec :
  forall (i:Z), (0%Z <= i)%Z -> real_ (pow_inv_sqrt_2 i).

Axiom pow_inv_sqrt_2_spec1 :
  forall (i:Z), (0%Z <= i)%Z ->
  ((pow_inv_sqrt_2 i) =
   (infix_sldt c_one (square_rt (i_to_c (power 2%Z i))))).

Axiom pow_inv_sqrt_2_add :
  forall (i:Z) (j:Z), (0%Z <= i)%Z -> (0%Z <= j)%Z ->
  ((pow_inv_sqrt_2 (i + j)%Z) =
   (infix_asdt (pow_inv_sqrt_2 i) (pow_inv_sqrt_2 j))).

Parameter pow_inv_2: Z -> complex.

Axiom pow_inv_2_def :
  forall (i:Z), (0%Z <= i)%Z ->
  ((pow_inv_2 i) = (infix_sldt c_one (i_to_c (power 2%Z i)))).

Axiom pow_inv_2_spec : forall (i:Z), (0%Z <= i)%Z -> real_ (pow_inv_2 i).

Axiom pow_inv_2_spec1 :
  forall (i:Z), (0%Z <= i)%Z -> infix_gtdt (pow_inv_2 i) c_zero.

Axiom pow_inv_2_spec2 :
  forall (i:Z), (0%Z <= i)%Z ->
  ((pow_inv_2 i) = (pow_inv_sqrt_2 (2%Z * i)%Z)).

Axiom pow_inv_2_spec3 :
  forall (i:Z), (0%Z <= i)%Z ->
  ((pow_inv_2 i) = (infix_asdt (pow_inv_sqrt_2 i) (pow_inv_sqrt_2 i))).

Axiom pow_inv_2_leq_c_one :
  forall (i:Z), (0%Z <= i)%Z -> infix_lseqdt (pow_inv_2 i) c_one.

Axiom pow_inv_2_inf_c_one :
  forall (i:Z), (1%Z <= i)%Z -> infix_lsdt (pow_inv_2 i) c_one.

Axiom cpower_pow_inv_2 :
  forall (i:Z) (k:Z), (1%Z <= i)%Z -> (1%Z <= k)%Z ->
  ((cpower (pow_inv_2 i) k) = (pow_inv_2 (i * k)%Z)).

Axiom cpower_pow_inv_sqrt_2 :
  forall (i:Z) (k:Z), (1%Z <= i)%Z -> (1%Z <= k)%Z ->
  ((cpower (pow_inv_sqrt_2 i) k) = (pow_inv_sqrt_2 (i * k)%Z)).

Axiom cpower_2_pow_inv_sqrt_2 :
  forall (i:Z), (1%Z <= i)%Z ->
  ((cpower (pow_inv_sqrt_2 i) 2%Z) = (pow_inv_2 i)).

Axiom pow_inv_2_subst :
  forall (i:Z) (j:Z), ((0%Z <= i)%Z /\ (i <= j)%Z) ->
  ((infix_asdt (pow_inv_2 i) (cpower ttwo j)) = (cpower ttwo (j - i)%Z)).

Axiom pow_inv_2_ :
  forall (i:Z), (0%Z <= i)%Z ->
  ((pow_inv_2 i) = (infix_sldt c_one (i_to_c (power_ 2%Z i)))).

Axiom pow_inv_sqrt_2_2_add :
  ((infix_pldt (pow_inv_sqrt_2 1%Z) (pow_inv_sqrt_2 1%Z)) = squarert_two).

Axiom pow_inv_2_cpower :
  forall (i:Z), (0%Z <= i)%Z ->
  ((pow_inv_2 i) = (infix_sldt c_one (cpower ttwo i))).

Axiom matrix : forall (a:Type), Type.
Parameter matrix_WhyType :
  forall (a:Type) {a_WT:WhyType a}, WhyType (matrix a).
Existing Instance matrix_WhyType.

Parameter elts: forall {a:Type} {a_WT:WhyType a}, (matrix a) -> Z -> Z -> a.

Parameter rows: forall {a:Type} {a_WT:WhyType a}, (matrix a) -> Z.

Parameter columns: forall {a:Type} {a_WT:WhyType a}, (matrix a) -> Z.

Axiom matrix'invariant :
  forall {a:Type} {a_WT:WhyType a},
  forall (self:matrix a), (0%Z < (rows self))%Z.

Axiom matrix'invariant1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (self:matrix a), (0%Z < (columns self))%Z.

Parameter valid_index:
  forall {a:Type} {a_WT:WhyType a}, (matrix a) -> Z -> Z -> Prop.

Axiom valid_index_def :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:matrix a) (r:Z) (c:Z), (valid_index a1 r c) -> (0%Z <= r)%Z.

Axiom valid_index_def1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:matrix a) (r:Z) (c:Z), (valid_index a1 r c) -> (r < (rows a1))%Z.

Axiom valid_index_def2 :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:matrix a) (r:Z) (c:Z), (valid_index a1 r c) -> (0%Z <= c)%Z.

Axiom valid_index_def3 :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:matrix a) (r:Z) (c:Z), (valid_index a1 r c) ->
  (c < (columns a1))%Z.

Axiom valid_index_def4 :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:matrix a) (r:Z) (c:Z),
  (((0%Z <= r)%Z /\ (r < (rows a1))%Z) /\
   ((0%Z <= c)%Z /\ (c < (columns a1))%Z)) ->
  valid_index a1 r c.

Parameter equal_size:
  forall {a:Type} {a_WT:WhyType a}, (matrix a) -> (matrix a) -> Prop.

Axiom equal_size_def :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:matrix a) (b:matrix a), (equal_size a1 b) ->
  ((rows a1) = (rows b)).

Axiom equal_size_def1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:matrix a) (b:matrix a), (equal_size a1 b) ->
  ((columns a1) = (columns b)).

Axiom equal_size_def2 :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:matrix a) (b:matrix a),
  (((rows a1) = (rows b)) /\ ((columns a1) = (columns b))) -> equal_size a1 b.

Parameter get: forall {a:Type} {a_WT:WhyType a}, (matrix a) -> Z -> Z -> a.

Axiom get_def :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:matrix a) (r:Z) (c:Z), ((get a1 r c) = (((elts a1) r) c)).

Axiom get_spec :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:matrix a) (r:Z) (c:Z), ((get a1 r c) = (((elts a1) r) c)).

Axiom elts_eq :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:matrix a) (b:matrix a), (a1 = b) -> ((elts a1) = (elts b)).

Axiom elts_inst_eq :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:matrix a) (b:matrix a) (i:Z) (j:Z), (a1 = b) ->
  ((0%Z <= i)%Z /\ (i < (rows a1))%Z) ->
  ((0%Z <= j)%Z /\ (j < (columns a1))%Z) ->
  ((((elts a1) i) j) = (((elts b) i) j)).

Parameter make: forall {a:Type} {a_WT:WhyType a}, Z -> Z -> a -> matrix a.

Axiom make_spec :
  forall {a:Type} {a_WT:WhyType a},
  forall (r:Z) (c:Z) (v:a), ((r > 0%Z)%Z /\ (c > 0%Z)%Z) ->
  ((rows (make r c v)) = r).

Axiom make_spec1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (r:Z) (c:Z) (v:a), ((r > 0%Z)%Z /\ (c > 0%Z)%Z) ->
  ((columns (make r c v)) = c).

Axiom make_spec2 :
  forall {a:Type} {a_WT:WhyType a},
  forall (r:Z) (c:Z) (v:a), ((r > 0%Z)%Z /\ (c > 0%Z)%Z) ->
  forall (i:Z) (j:Z),
  (((0%Z <= i)%Z /\ (i < r)%Z) /\ ((0%Z <= j)%Z /\ (j < c)%Z)) ->
  ((get (make r c v) i j) = v).

Axiom equality :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix a) (n:matrix a), (m = n) -> ((rows m) = (rows n)).

Axiom equality1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix a) (n:matrix a), (m = n) -> ((columns m) = (columns n)).

Axiom equality2 :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix a) (n:matrix a), (m = n) -> forall (i:Z) (j:Z),
  (valid_index m i j) -> ((get m i j) = (get n i j)).

Axiom equality3 :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix a) (n:matrix a),
  ((((rows m) = (rows n)) /\ ((columns m) = (columns n))) /\
   forall (i:Z) (j:Z), (valid_index m i j) -> ((get m i j) = (get n i j))) ->
  (m = n).

Axiom make_value :
  forall {a:Type} {a_WT:WhyType a},
  forall (r:Z) (c:Z) (i:Z) (j:Z) (v:a), ((r > 0%Z)%Z /\ (c > 0%Z)%Z) ->
  ((0%Z <= i)%Z /\ (i < r)%Z) -> ((0%Z <= j)%Z /\ (j < c)%Z) ->
  ((get (make r c v) i j) = v).

Parameter mat_indices:
  forall {a:Type} {a_WT:WhyType a}, (matrix a) -> set (Z* Z)%type.

Axiom mat_indices_def :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix a),
  ((mat_indices m) =
   (cartesian_product (to_fset 0%Z (rows m)) (to_fset 0%Z (columns m)))).

Axiom mat_indices_spec :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix a), forall (o:(Z* Z)%type), (mem o (mat_indices m)) ->
  (0%Z <= (fir o))%Z.

Axiom mat_indices_spec1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix a), forall (o:(Z* Z)%type), (mem o (mat_indices m)) ->
  ((fir o) < (rows m))%Z.

Axiom mat_indices_spec2 :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix a), forall (o:(Z* Z)%type), (mem o (mat_indices m)) ->
  (0%Z <= (sec o))%Z.

Axiom mat_indices_spec3 :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix a), forall (o:(Z* Z)%type), (mem o (mat_indices m)) ->
  ((sec o) < (columns m))%Z.

Axiom mat_indices_spec4 :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix a), forall (o:(Z* Z)%type),
  ((0%Z <= (fir o))%Z /\ ((fir o) < (rows m))%Z) ->
  ((0%Z <= (sec o))%Z /\ ((sec o) < (columns m))%Z) -> mem o (mat_indices m).

Axiom mat_indices_spec5 :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix a), forall (i:Z) (j:Z), (valid_index m i j) ->
  mem (i, j) (mat_indices m).

Axiom mat_indices_spec6 :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix a), forall (i:Z) (j:Z), (mem (i, j) (mat_indices m)) ->
  valid_index m i j.

Parameter set1:
  forall {a:Type} {a_WT:WhyType a}, (matrix a) -> Z -> Z -> a -> matrix a.

Axiom set_spec :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:matrix a) (r:Z) (c:Z) (v:a), (valid_index a1 r c) ->
  ((rows (set1 a1 r c v)) = (rows a1)).

Axiom set_spec1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:matrix a) (r:Z) (c:Z) (v:a), (valid_index a1 r c) ->
  ((columns (set1 a1 r c v)) = (columns a1)).

Axiom set_spec2 :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:matrix a) (r:Z) (c:Z) (v:a), (valid_index a1 r c) ->
  forall (i:Z) (j:Z), (valid_index a1 i j) ->
  (((i = r) /\ (j = c)) -> ((get (set1 a1 r c v) i j) = v)) /\
  (~ ((i = r) /\ (j = c)) -> ((get (set1 a1 r c v) i j) = (get a1 i j))).

Axiom set_spec3 :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:matrix a) (r:Z) (c:Z) (v:a), (valid_index a1 r c) ->
  ((get (set1 a1 r c v) r c) = v).

Axiom set_spec4 :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:matrix a) (r:Z) (c:Z) (v:a), (valid_index a1 r c) ->
  forall (i:Z) (j:Z), (valid_index (set1 a1 r c v) i j) -> ~ (i = r) ->
  ((get (set1 a1 r c v) i j) = (get a1 i j)).

Axiom set_spec5 :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:matrix a) (r:Z) (c:Z) (v:a), (valid_index a1 r c) ->
  forall (i:Z) (j:Z), (valid_index (set1 a1 r c v) i j) -> ~ (j = c) ->
  ((get (set1 a1 r c v) i j) = (get a1 i j)).

Axiom set_valid_index :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:matrix a) (i:Z) (j:Z), ((0%Z <= i)%Z /\ (i < (rows a1))%Z) ->
  ((0%Z <= j)%Z /\ (j < (columns a1))%Z) -> valid_index a1 i j.

Axiom get_valid_index :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:matrix a) (r:Z) (c:Z), ((rows a1) = r) -> ((columns a1) = c) ->
  forall (i:Z) (j:Z), (valid_index a1 i j) -> (0%Z <= i)%Z.

Axiom get_valid_index1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:matrix a) (r:Z) (c:Z), ((rows a1) = r) -> ((columns a1) = c) ->
  forall (i:Z) (j:Z), (valid_index a1 i j) -> (i < r)%Z.

Axiom get_valid_index2 :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:matrix a) (r:Z) (c:Z), ((rows a1) = r) -> ((columns a1) = c) ->
  forall (i:Z) (j:Z), (valid_index a1 i j) -> (0%Z <= j)%Z.

Axiom get_valid_index3 :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:matrix a) (r:Z) (c:Z), ((rows a1) = r) -> ((columns a1) = c) ->
  forall (i:Z) (j:Z), (valid_index a1 i j) -> (j < c)%Z.

Axiom get_valid_index_params :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:matrix a) (r:Z) (c:Z) (i:Z) (j:Z), ((rows a1) = r) ->
  ((columns a1) = c) -> (valid_index a1 i j) -> (0%Z <= i)%Z.

Axiom get_valid_index_params1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:matrix a) (r:Z) (c:Z) (i:Z) (j:Z), ((rows a1) = r) ->
  ((columns a1) = c) -> (valid_index a1 i j) -> (i < r)%Z.

Axiom get_valid_index_params2 :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:matrix a) (r:Z) (c:Z) (i:Z) (j:Z), ((rows a1) = r) ->
  ((columns a1) = c) -> (valid_index a1 i j) -> (0%Z <= j)%Z.

Axiom get_valid_index_params3 :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:matrix a) (r:Z) (c:Z) (i:Z) (j:Z), ((rows a1) = r) ->
  ((columns a1) = c) -> (valid_index a1 i j) -> (j < c)%Z.

Axiom set_values :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:matrix a) (r:Z) (c:Z) (v:a), (valid_index a1 r c) ->
  forall (i:Z) (j:Z), (valid_index a1 i j) ->
  (((i = r) /\ (j = c)) -> ((get (set1 a1 r c v) i j) = v)) /\
  (~ ((i = r) /\ (j = c)) -> ((get (set1 a1 r c v) i j) = (get a1 i j))).

Axiom set_rows :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:matrix a) (r:Z) (c:Z) (v:a), (valid_index a1 r c) ->
  ((rows (set1 a1 r c v)) = (rows a1)).

Axiom set_columns :
  forall {a:Type} {a_WT:WhyType a},
  forall (a1:matrix a) (r:Z) (c:Z) (v:a), (valid_index a1 r c) ->
  ((columns (set1 a1 r c v)) = (columns a1)).

Parameter make_func:
  forall {a:Type} {a_WT:WhyType a}, Z -> Z -> (Z -> Z -> a) -> matrix a.

Axiom make_func_spec :
  forall {a:Type} {a_WT:WhyType a},
  forall (r:Z) (c:Z) (f:Z -> Z -> a), (r > 0%Z)%Z -> (c > 0%Z)%Z ->
  ((elts (make_func r c f)) = f).

Axiom make_func_spec1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (r:Z) (c:Z) (f:Z -> Z -> a), (r > 0%Z)%Z -> (c > 0%Z)%Z ->
  ((rows (make_func r c f)) = r).

Axiom make_func_spec2 :
  forall {a:Type} {a_WT:WhyType a},
  forall (r:Z) (c:Z) (f:Z -> Z -> a), (r > 0%Z)%Z -> (c > 0%Z)%Z ->
  ((columns (make_func r c f)) = c).

Axiom make_func_spec3 :
  forall {a:Type} {a_WT:WhyType a},
  forall (r:Z) (c:Z) (f:Z -> Z -> a), (r > 0%Z)%Z -> (c > 0%Z)%Z ->
  forall (i:Z) (j:Z), ((get (make_func r c f) i j) = ((f i) j)).

Parameter make_f:
  forall {a:Type} {a_WT:WhyType a}, Z -> Z -> (Z -> Z -> a) -> matrix a.

Axiom make_f_def :
  forall {a:Type} {a_WT:WhyType a},
  forall (r:Z) (c:Z) (f:Z -> Z -> a), (r > 0%Z)%Z -> (c > 0%Z)%Z ->
  ((make_f r c f) = (make_func r c f)).

Axiom make_f_spec :
  forall {a:Type} {a_WT:WhyType a},
  forall (r:Z) (c:Z) (f:Z -> Z -> a), (r > 0%Z)%Z -> (c > 0%Z)%Z ->
  ((rows (make_f r c f)) = r).

Axiom make_f_spec1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (r:Z) (c:Z) (f:Z -> Z -> a), (r > 0%Z)%Z -> (c > 0%Z)%Z ->
  ((columns (make_f r c f)) = c).

Axiom make_f_spec2 :
  forall {a:Type} {a_WT:WhyType a},
  forall (r:Z) (c:Z) (f:Z -> Z -> a), (r > 0%Z)%Z -> (c > 0%Z)%Z ->
  forall (i:Z) (j:Z), ((get (make_f r c f) i j) = ((f i) j)).

Axiom assert_make :
  forall {a:Type} {a_WT:WhyType a},
  forall (r:Z) (c:Z) (f:Z -> Z -> a) (i:Z) (j:Z),
  ((0%Z <= i)%Z /\ (i < r)%Z) -> ((0%Z <= j)%Z /\ (j < c)%Z) ->
  ((get (make_f r c f) i j) = ((f i) j)).

Axiom assert_make_r :
  forall {a:Type} {a_WT:WhyType a},
  forall (r:Z) (c:Z) (f:Z -> Z -> a), (0%Z < r)%Z -> (0%Z < c)%Z ->
  ((rows (make_f r c f)) = r).

Axiom assert_make_c :
  forall {a:Type} {a_WT:WhyType a},
  forall (r:Z) (c:Z) (f:Z -> Z -> a), (0%Z < r)%Z -> (0%Z < c)%Z ->
  ((columns (make_f r c f)) = c).

Parameter to_indexes:
  forall {a:Type} {a_WT:WhyType a}, (matrix a) -> set (Z* Z)%type.

Axiom to_indexes_def :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix a),
  ((to_indexes m) =
   (cartesian_product (to_fset 0%Z (rows m)) (to_fset 0%Z (columns m)))).

Axiom to_indexes_spec :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix a),
  ((cardinal (to_indexes m)) = ((rows m) * (columns m))%Z).

Axiom set_to_indexes_mem :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix a) (i:Z) (j:Z), ((0%Z <= i)%Z /\ (i < (rows m))%Z) ->
  ((0%Z <= j)%Z /\ (j < (columns m))%Z) -> mem (i, j) (to_indexes m).

Axiom get_to_indexes_mem :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix a) (o:(Z* Z)%type), (mem o (to_indexes m)) ->
  (0%Z <= (fir o))%Z.

Axiom get_to_indexes_mem1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix a) (o:(Z* Z)%type), (mem o (to_indexes m)) ->
  ((fir o) < (rows m))%Z.

Axiom get_to_indexes_mem2 :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix a) (o:(Z* Z)%type), (mem o (to_indexes m)) ->
  (0%Z <= (sec o))%Z.

Axiom get_to_indexes_mem3 :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix a) (o:(Z* Z)%type), (mem o (to_indexes m)) ->
  ((sec o) < (columns m))%Z.

Parameter equal:
  forall {a:Type} {a_WT:WhyType a}, (matrix a) -> (matrix a) -> Prop.

Axiom equal_def :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix a) (n:matrix a), (equal m n) -> infix_eqeq m n.

Axiom equal_def1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix a) (n:matrix a), (infix_eqeq m n) -> equal m n.

Axiom mat_equality :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix a) (n:matrix a), ((rows m) = (rows n)) ->
  ((columns m) = (columns n)) ->
  (forall (i:Z) (j:Z), (valid_index m i j) -> ((get m i j) = (get n i j))) ->
  equal m n.

Parameter square: forall {a:Type} {a_WT:WhyType a}, (matrix a) -> Prop.

Axiom square_def :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix a), (square m) -> ((rows m) = (columns m)).

Axiom square_def1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix a), ((rows m) = (columns m)) -> square m.

Axiom equal_sym :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix a) (n:matrix a), (equal m n) -> equal n m.

Axiom equal_sym1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix a) (n:matrix a), (equal n m) -> equal m n.

Axiom equal_rex :
  forall {a:Type} {a_WT:WhyType a}, forall (m:matrix a), equal m m.

Axiom equal_trans :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix a) (n:matrix a) (o:matrix a), (equal m n) ->
  (equal n o) -> equal m o.

Axiom set_equal_mat :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix a) (n:matrix a), ((rows m) = (rows n)) ->
  ((columns m) = (columns n)) ->
  (forall (i:Z) (j:Z), (valid_index m i j) -> ((get m i j) = (get n i j))) ->
  (m = n).

Axiom set_equal_mat_make :
  forall {a:Type} {a_WT:WhyType a},
  forall (r:Z) (c:Z) (f:Z -> Z -> a) (g:Z -> Z -> a), (0%Z < r)%Z ->
  (0%Z < c)%Z ->
  (forall (i:Z) (j:Z), ((0%Z <= i)%Z /\ (i < r)%Z) ->
   ((0%Z <= j)%Z /\ (j < c)%Z) -> (((f i) j) = ((g i) j))) ->
  ((make_f r c f) = (make_f r c g)).

Axiom set_equal_mat_make_t :
  forall {a:Type} {a_WT:WhyType a},
  forall (r:Z) (r':Z) (c:Z) (c':Z) (f:Z -> Z -> a) (g:Z -> Z -> a),
  (0%Z < r)%Z -> (0%Z < c)%Z -> (r = r') -> (c = c') ->
  (forall (i:Z) (j:Z), ((0%Z <= i)%Z /\ (i < r)%Z) ->
   ((0%Z <= j)%Z /\ (j < c)%Z) -> (((f i) j) = ((g i) j))) ->
  ((make_f r c f) = (make_f r' c' g)).

Axiom get_equal_mat :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix a) (n:matrix a), (m = n) -> ((rows m) = (rows n)).

Axiom get_equal_mat1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix a) (n:matrix a), (m = n) -> ((columns m) = (columns n)).

Axiom get_equal_mat2 :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix a) (n:matrix a), (m = n) -> forall (i:Z) (j:Z),
  (valid_index m i j) -> ((get m i j) = (get n i j)).

Axiom equal_functions :
  forall {a:Type} {a_WT:WhyType a},
  forall (r:Z) (c:Z) (f:Z -> Z -> a) (g:Z -> Z -> a), (0%Z < r)%Z ->
  (0%Z < c)%Z ->
  (forall (i:Z) (j:Z),
   (((0%Z <= i)%Z /\ (i < r)%Z) /\ ((0%Z <= j)%Z /\ (j < c)%Z)) ->
   (((f i) j) = ((g i) j))) ->
  ((make_f r c f) = (make_f r c g)).

Axiom equal_functions_mat :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:Z -> Z -> a) (m:matrix a),
  (forall (i:Z) (j:Z),
   (((0%Z <= i)%Z /\ (i < (rows m))%Z) /\
    ((0%Z <= j)%Z /\ (j < (columns m))%Z)) ->
   (((f i) j) = (get m i j))) ->
  (m = (make_f (rows m) (columns m) f)).

Parameter null_mat: (matrix complex) -> Prop.

Axiom null_mat_def :
  forall (a:matrix complex), (null_mat a) -> forall (i:Z) (j:Z),
  (valid_index a i j) -> ((get a i j) = c_zero).

Axiom null_mat_def1 :
  forall (a:matrix complex),
  (forall (i:Z) (j:Z), (valid_index a i j) -> ((get a i j) = c_zero)) ->
  null_mat a.

Axiom set_null_mat :
  forall (a:matrix complex),
  (forall (i:Z) (j:Z), (valid_index a i j) -> ((get a i j) = c_zero)) ->
  null_mat a.

Axiom get_null_mat :
  forall (a:matrix complex), (null_mat a) -> forall (i:Z) (j:Z),
  (valid_index a i j) -> ((get a i j) = c_zero).

Axiom power_minus_one2 :
  forall (i:Z), (i >= 0%Z)%Z -> ((int.EuclideanDivision.mod1 i 2%Z) = 0%Z) ->
  ((power (-1%Z)%Z i) = 1%Z).

Axiom power_minus_one3 :
  forall (i:Z), (i >= 0%Z)%Z -> ((int.EuclideanDivision.mod1 i 2%Z) = 1%Z) ->
  ((power (-1%Z)%Z i) = (-1%Z)%Z).

Parameter kth_right: Z -> Z -> Z -> (Z -> Z) -> Z.

Axiom kth_right_def :
  forall (i:Z) (k:Z) (h:Z) (f:Z -> Z), (0%Z <= i)%Z -> (1%Z <= k)%Z ->
  (forall (l:Z), (((h - k)%Z <= l)%Z /\ (l < h)%Z) -> (0%Z < (f l))%Z) ->
  ((kth_right i k h f) =
   (int.EuclideanDivision.mod1
    (int.EuclideanDivision.div i (ind_iproduct f ((h - k)%Z + 1%Z)%Z h))
    (f (h - k)%Z))).

Axiom kth_right_spec :
  forall (i:Z) (k:Z) (h:Z) (f:Z -> Z), (0%Z <= i)%Z -> (1%Z <= k)%Z ->
  (forall (l:Z), (((h - k)%Z <= l)%Z /\ (l < h)%Z) -> (0%Z < (f l))%Z) ->
  (0%Z <= (kth_right i k h f))%Z.

Axiom kth_right_spec1 :
  forall (i:Z) (k:Z) (h:Z) (f:Z -> Z), (0%Z <= i)%Z -> (1%Z <= k)%Z ->
  (forall (l:Z), (((h - k)%Z <= l)%Z /\ (l < h)%Z) -> (0%Z < (f l))%Z) ->
  ((kth_right i k h f) < (f (h - k)%Z))%Z.

Axiom kth_right_eq :
  forall (i:Z) (k:Z) (h:Z) (f:Z -> Z) (g:Z -> Z), (0%Z <= i)%Z ->
  (1%Z <= k)%Z ->
  (forall (l:Z), (((h - k)%Z <= l)%Z /\ (l <= h)%Z) -> (0%Z < (f l))%Z) ->
  (forall (l:Z), (((h - k)%Z <= l)%Z /\ (l <= h)%Z) -> ((f l) = (g l))) ->
  ((kth_right i k h f) = (kth_right i k h g)).

Axiom kth_right_trans :
  forall (i:Z) (k:Z) (h:Z) (t:Z) (f:Z -> Z), (0%Z <= i)%Z -> (1%Z <= k)%Z ->
  (forall (l:Z), (0%Z < (f l))%Z) -> (0%Z <= h)%Z -> (0%Z <= t)%Z ->
  ((kth_right (int.EuclideanDivision.div i (ind_iproduct f h (h + t)%Z)) k h
    f)
   = (kth_right i (k + t)%Z (h + t)%Z f)).

Parameter kth_left: Z -> Z -> Z -> Z -> (Z -> Z) -> Z.

Axiom kth_left_def :
  forall (i:Z) (k:Z) (l:Z) (h:Z) (f:Z -> Z), (0%Z <= i)%Z -> (0%Z <= l)%Z ->
  ((1%Z <= k)%Z /\ (k <= (h - l)%Z)%Z) ->
  (forall (ind:Z), ((l <= ind)%Z /\ (ind < h)%Z) -> (0%Z < (f ind))%Z) ->
  ((kth_left i k l h f) = (kth_right i (((h - l)%Z - k)%Z + 1%Z)%Z h f)).

Axiom kth_left_spec :
  forall (i:Z) (k:Z) (l:Z) (h:Z) (f:Z -> Z), (0%Z <= i)%Z -> (0%Z <= l)%Z ->
  ((1%Z <= k)%Z /\ (k <= (h - l)%Z)%Z) ->
  (forall (ind:Z), ((l <= ind)%Z /\ (ind < h)%Z) -> (0%Z < (f ind))%Z) ->
  ((kth_left i k l h f) =
   (int.EuclideanDivision.mod1
    (int.EuclideanDivision.div i (ind_iproduct f (l + k)%Z h))
    (f ((l + k)%Z - 1%Z)%Z))).

Axiom kth_left_spec1 :
  forall (i:Z) (k:Z) (l:Z) (h:Z) (f:Z -> Z), (0%Z <= i)%Z -> (0%Z <= l)%Z ->
  ((1%Z <= k)%Z /\ (k <= (h - l)%Z)%Z) ->
  (forall (ind:Z), ((l <= ind)%Z /\ (ind < h)%Z) -> (0%Z < (f ind))%Z) ->
  (0%Z <= (kth_left i k l h f))%Z.

Axiom kth_left_spec2 :
  forall (i:Z) (k:Z) (l:Z) (h:Z) (f:Z -> Z), (0%Z <= i)%Z -> (0%Z <= l)%Z ->
  ((1%Z <= k)%Z /\ (k <= (h - l)%Z)%Z) ->
  (forall (ind:Z), ((l <= ind)%Z /\ (ind < h)%Z) -> (0%Z < (f ind))%Z) ->
  ((kth_left i k l h f) < (f ((l + k)%Z - 1%Z)%Z))%Z.

Axiom kth_left_eq :
  forall (i:Z) (k:Z) (l:Z) (h:Z) (f:Z -> Z) (g:Z -> Z), (0%Z <= i)%Z ->
  ((1%Z <= k)%Z /\ (k <= (h - l)%Z)%Z) -> (0%Z <= l)%Z ->
  (forall (ind:Z), ((l <= ind)%Z /\ (ind < h)%Z) ->
   ((f ind) = (g ind)) /\ ((g ind) > 0%Z)%Z) ->
  ((kth_left i k l h f) = (kth_left i k l h g)).

Axiom kth_left_to_mod_div :
  forall (i:Z) (k:Z) (l:Z) (h:Z) (f:Z -> Z), (0%Z <= i)%Z -> (0%Z <= l)%Z ->
  ((1%Z <= k)%Z /\ (k <= (h - l)%Z)%Z) ->
  (forall (ind:Z), ((l <= ind)%Z /\ (ind <= h)%Z) -> ((f ind) > 0%Z)%Z) ->
  ((kth_left i k l h f) =
   (int.EuclideanDivision.mod1
    (int.EuclideanDivision.div i (ind_iproduct f (l + k)%Z h))
    (f ((l + k)%Z - 1%Z)%Z))).

Axiom kth_left_trans :
  forall (i:Z) (k:Z) (l:Z) (h:Z) (f:Z -> Z), (0%Z <= i)%Z -> (0%Z <= l)%Z ->
  ((1%Z <= k)%Z /\ (k < (h - l)%Z)%Z) ->
  (forall (ind:Z), ((l <= ind)%Z /\ (ind <= h)%Z) -> ((f ind) > 0%Z)%Z) ->
  ((kth_left i k l h f) =
   (kth_left (int.EuclideanDivision.div i (f (h - 1%Z)%Z)) k l (h - 1%Z)%Z f)).

Axiom div_isum_exponents :
  forall (i:Z) (k:Z) (n:Z) (m:Z), (0%Z <= i)%Z -> (0%Z < k)%Z ->
  (0%Z <= n)%Z -> (0%Z <= m)%Z ->
  ((power k (n + m)%Z) = ((power k n) * (power k m))%Z).

Axiom div_isum_exponents1 :
  forall (i:Z) (k:Z) (n:Z) (m:Z), (0%Z <= i)%Z -> (0%Z < k)%Z ->
  (0%Z <= n)%Z -> (0%Z <= m)%Z ->
  ((power k (n + 1%Z)%Z) = ((power k n) * k)%Z).

Axiom div_isum_exponents2 :
  forall (i:Z) (k:Z) (n:Z) (m:Z), (0%Z <= i)%Z -> (0%Z < k)%Z ->
  (0%Z <= n)%Z -> (0%Z <= m)%Z -> ((power k 1%Z) = k).

Axiom div_isum_exponents3 :
  forall (i:Z) (k:Z) (n:Z) (m:Z), (0%Z <= i)%Z -> (0%Z < k)%Z ->
  (0%Z <= n)%Z -> (0%Z <= m)%Z ->
  ((int.EuclideanDivision.div (int.EuclideanDivision.div i (power k n))
    (power k m))
   = (int.EuclideanDivision.div i (power k (n + m)%Z))).

Axiom div_isum_exponents4 :
  forall (i:Z) (k:Z) (n:Z) (m:Z), (0%Z <= i)%Z -> (0%Z < k)%Z ->
  (0%Z <= n)%Z -> (0%Z <= m)%Z ->
  ((int.EuclideanDivision.div (int.EuclideanDivision.div i (power k n)) k) =
   (int.EuclideanDivision.div i (power k (n + 1%Z)%Z))).

Parameter divp: Z -> Z -> Z.

Axiom divp_def :
  forall (i:Z) (j:Z), (0%Z <= i)%Z -> (0%Z < j)%Z ->
  ((divp i j) = ((int.EuclideanDivision.div i j) * j)%Z).

Axiom divp_spec :
  forall (i:Z) (j:Z), (0%Z <= i)%Z -> (0%Z < j)%Z ->
  (i = ((divp i j) + (int.EuclideanDivision.mod1 i j))%Z).

Axiom divp_spec1 :
  forall (i:Z) (j:Z), (0%Z <= i)%Z -> (0%Z < j)%Z -> ((divp i j) <= i)%Z.

Axiom divp_spec2 :
  forall (i:Z) (j:Z), (0%Z <= i)%Z -> (0%Z < j)%Z ->
  (i < (((divp i j) + 1%Z)%Z * j)%Z)%Z.

Axiom divp_spec3 :
  forall (i:Z) (j:Z), (0%Z <= i)%Z -> (0%Z < j)%Z -> (i > j)%Z ->
  ((divp i j) > 0%Z)%Z.

Axiom kth_right_div_mod :
  forall (i:Z) (k:Z) (h:Z) (f:Z -> Z), (0%Z <= i)%Z -> (1%Z <= k)%Z ->
  (forall (k1:Z), (0%Z < (f k1))%Z) ->
  ((kth_right i k h f) =
   (int.EuclideanDivision.div
    (int.EuclideanDivision.mod1 i (ind_iproduct f (h - k)%Z h))
    (ind_iproduct f ((h - k)%Z + 1%Z)%Z h))).

Axiom kth_head :
  forall (i:Z) (h:Z) (f:Z -> Z), (0%Z <= i)%Z -> (1%Z <= h)%Z ->
  (forall (k:Z), (0%Z < (f k))%Z) ->
  ((kth_right i 1%Z h f) = (int.EuclideanDivision.mod1 i (f (h - 1%Z)%Z))).

Parameter weighted_kth_right: Z -> Z -> Z -> (Z -> Z) -> Z.

Axiom weighted_kth_right_def :
  forall (i:Z) (k:Z) (h:Z) (f:Z -> Z), (0%Z <= i)%Z ->
  (forall (k1:Z), (0%Z < (f k1))%Z) -> (1%Z <= k)%Z ->
  ((weighted_kth_right i k h f) =
   ((kth_right i k h f) * (ind_iproduct f ((h - k)%Z + 1%Z)%Z h))%Z).

Axiom weighted_kth_right_ :
  forall (i:Z) (k:Z) (h:Z) (f:Z -> Z), (1%Z <= k)%Z -> (0%Z <= i)%Z ->
  (forall (k1:Z), (0%Z < (f k1))%Z) ->
  ((int.EuclideanDivision.mod1 i (ind_iproduct f (h - k)%Z h)) =
   ((weighted_kth_right i k h f) +
    (int.EuclideanDivision.mod1 i (ind_iproduct f ((h - k)%Z + 1%Z)%Z h)))%Z).

Axiom kth_right_decomposition :
  forall (i:Z) (k:Z) (h:Z) (f:Z -> Z), (0%Z <= i)%Z -> (1%Z <= k)%Z ->
  (forall (k1:Z), (0%Z < (f k1))%Z) ->
  ((int.EuclideanDivision.mod1 i (ind_iproduct f (h - k)%Z h)) =
   (ind_isum (fun (a:Z) => (weighted_kth_right i a h f)) 1%Z (k + 1%Z)%Z)).

Axiom kth_left_div_mod :
  forall (i:Z) (k:Z) (l:Z) (h:Z) (f:Z -> Z), (0%Z <= i)%Z ->
  ((0%Z <= l)%Z /\ (l <= h)%Z) -> ((1%Z <= k)%Z /\ (k <= (h - l)%Z)%Z) ->
  (forall (k1:Z), (0%Z < (f k1))%Z) ->
  ((kth_left i k l h f) =
   (int.EuclideanDivision.div
    (int.EuclideanDivision.mod1 i (ind_iproduct f ((l + k)%Z - 1%Z)%Z h))
    (ind_iproduct f (l + k)%Z h))).

Parameter weighted_kth_left: Z -> Z -> Z -> Z -> (Z -> Z) -> Z.

Axiom weighted_kth_left_def :
  forall (i:Z) (k:Z) (l:Z) (h:Z) (f:Z -> Z), (0%Z <= i)%Z -> (l <= h)%Z ->
  ((1%Z <= k)%Z /\ (k <= (h - l)%Z)%Z) ->
  (forall (k1:Z), (0%Z < (f k1))%Z) ->
  ((weighted_kth_left i k l h f) =
   (weighted_kth_right i (((h - l)%Z - k)%Z + 1%Z)%Z h f)).

Axiom weighted_kth_left_ :
  forall (i:Z) (k:Z) (l:Z) (h:Z) (f:Z -> Z), (0%Z <= i)%Z -> (l <= h)%Z ->
  ((1%Z <= k)%Z /\ (k <= (h - l)%Z)%Z) ->
  (forall (k1:Z), (0%Z < (f k1))%Z) ->
  ((int.EuclideanDivision.mod1 i (ind_iproduct f ((l + k)%Z - 1%Z)%Z h)) =
   ((weighted_kth_left i k l h f) +
    (int.EuclideanDivision.mod1 i (ind_iproduct f (l + k)%Z h)))%Z).

Axiom bounded_kth_left_decomposition :
  forall (i:Z) (k:Z) (l:Z) (h:Z) (f:Z -> Z), (0%Z <= i)%Z -> (l <= h)%Z ->
  ((1%Z <= k)%Z /\ (k <= (h - l)%Z)%Z) ->
  (forall (k1:Z), (0%Z < (f k1))%Z) ->
  ((int.EuclideanDivision.mod1 i (ind_iproduct f ((l + k)%Z - 1%Z)%Z h)) =
   (ind_isum (fun (a:Z) => (weighted_kth_left i a l h f)) k
    ((h - l)%Z + 1%Z)%Z)).

Axiom kth_left_decomposition :
  forall (i:Z) (l:Z) (h:Z) (f:Z -> Z),
  ((0%Z <= i)%Z /\ (i < (ind_iproduct f l h))%Z) -> (l < h)%Z ->
  (forall (k:Z), (0%Z < (f k))%Z) ->
  (i =
   (ind_isum (fun (a:Z) => (weighted_kth_left i a l h f)) 1%Z
    ((h - l)%Z + 1%Z)%Z)).

Parameter kronecker_neutral: matrix complex.

Axiom kronecker_neutral_def : (kronecker_neutral = (make 1%Z 1%Z c_one)).

Parameter identity: Z -> matrix complex.

Parameter result9: Z -> Z -> complex.

Axiom result_def9 :
  forall (i:Z) (j:Z),
  ((i = j) -> (((result9 i) j) = c_one)) /\
  (~ (i = j) -> (((result9 i) j) = c_zero)).

Axiom identity_def :
  forall (n:Z), (0%Z <= n)%Z ->
  ((identity n) = (make_f (power 2%Z n) (power 2%Z n) result9)).

Axiom identity_spec :
  forall (n:Z), (0%Z <= n)%Z -> ((rows (identity n)) = (power 2%Z n)).

Axiom identity_spec1 :
  forall (n:Z), (0%Z <= n)%Z -> ((columns (identity n)) = (power 2%Z n)).

Axiom identity_spec2 :
  forall (n:Z), (0%Z <= n)%Z -> forall (i:Z) (j:Z),
  (valid_index (identity n) i j) ->
  ((i = j) -> ((get (identity n) i j) = c_one)) /\
  (~ (i = j) -> ((get (identity n) i j) = c_zero)).

Axiom identity_rows :
  forall (n:Z), (0%Z <= n)%Z -> ((rows (identity n)) = (power 2%Z n)).

Axiom identity_columns :
  forall (n:Z), (0%Z <= n)%Z -> ((columns (identity n)) = (power 2%Z n)).

Axiom identity_values :
  forall (i:Z) (j:Z) (n:Z), (0%Z <= n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) ->
  ((0%Z <= j)%Z /\ (j < (power 2%Z n))%Z) ->
  ((i = j) -> ((get (identity n) i j) = c_one)) /\
  (~ (i = j) -> ((get (identity n) i j) = c_zero)).

Parameter kronecker: (matrix complex) -> (matrix complex) -> matrix complex.

Axiom kronecker_def :
  forall (m:matrix complex) (n:matrix complex),
  ((kronecker m n) =
   (make_f ((rows m) * (rows n))%Z ((columns m) * (columns n))%Z
    (fun (i:Z) (j:Z) =>
     (infix_asdt
      (get m (int.EuclideanDivision.div i (rows n))
       (int.EuclideanDivision.div j (columns n)))
      (get n (int.EuclideanDivision.mod1 i (rows n))
       (int.EuclideanDivision.mod1 j (columns n))))))).

Axiom kronecker_spec :
  forall (m:matrix complex) (n:matrix complex),
  ((rows (kronecker m n)) = ((rows m) * (rows n))%Z).

Axiom kronecker_spec1 :
  forall (m:matrix complex) (n:matrix complex),
  ((columns (kronecker m n)) = ((columns m) * (columns n))%Z).

Axiom kronecker_spec2 :
  forall (m:matrix complex) (n:matrix complex), forall (i:Z) (j:Z),
  (valid_index (kronecker m n) i j) ->
  ((get (kronecker m n) i j) =
   (infix_asdt
    (get m (int.EuclideanDivision.div i (rows n))
     (int.EuclideanDivision.div j (columns n)))
    (get n (int.EuclideanDivision.mod1 i (rows n))
     (int.EuclideanDivision.mod1 j (columns n))))).

Axiom kronecker_eq :
  forall (m1:matrix complex) (n1:matrix complex) (m2:matrix complex)
    (n2:matrix complex),
  (m1 = m2) -> (n1 = n2) -> ((kronecker m1 n1) = (kronecker m2 n2)).

Axiom get_kronecker :
  forall (m:matrix complex) (n:matrix complex),
  ((kronecker m n) =
   (make_f ((rows m) * (rows n))%Z ((columns m) * (columns n))%Z
    (fun (i:Z) (j:Z) =>
     (infix_asdt
      (get m (int.EuclideanDivision.div i (rows n))
       (int.EuclideanDivision.div j (columns n)))
      (get n (int.EuclideanDivision.mod1 i (rows n))
       (int.EuclideanDivision.mod1 j (columns n))))))).

Axiom kronecker_values :
  forall (m:matrix complex) (n:matrix complex) (i:Z) (j:Z),
  (valid_index (kronecker m n) i j) ->
  ((get (kronecker m n) i j) =
   (infix_asdt
    (get m (int.EuclideanDivision.div i (rows n))
     (int.EuclideanDivision.div j (columns n)))
    (get n (int.EuclideanDivision.mod1 i (rows n))
     (int.EuclideanDivision.mod1 j (columns n))))).

Axiom kronecker_rows :
  forall (m:matrix complex) (n:matrix complex),
  ((rows (kronecker m n)) = ((rows m) * (rows n))%Z).

Axiom kronecker_columns :
  forall (m:matrix complex) (n:matrix complex),
  ((columns (kronecker m n)) = ((columns m) * (columns n))%Z).

Axiom kronecker_values_gen :
  forall (m:matrix complex) (n:matrix complex), forall (i:Z) (j:Z),
  (valid_index (kronecker m n) i j) ->
  ((get (kronecker m n) i j) =
   (infix_asdt
    (get m (int.EuclideanDivision.div i (rows n))
     (int.EuclideanDivision.div j (columns n)))
    (get n (int.EuclideanDivision.mod1 i (rows n))
     (int.EuclideanDivision.mod1 j (columns n))))).

Axiom kronecker_mod_values :
  forall (m:matrix complex) (n:matrix complex) (i:Z) (j:Z),
  (valid_index (kronecker m n) i j) ->
  ((get (kronecker m n) i j) =
   (infix_asdt
    (get m
     (int.EuclideanDivision.div
      (int.EuclideanDivision.mod1 i (rows (kronecker m n))) (rows n))
     (int.EuclideanDivision.div
      (int.EuclideanDivision.mod1 j (columns (kronecker m n))) (columns n)))
    (get n
     (int.EuclideanDivision.mod1
      (int.EuclideanDivision.mod1 i (rows (kronecker m n))) (rows n))
     (int.EuclideanDivision.mod1
      (int.EuclideanDivision.mod1 j (columns (kronecker m n))) (columns n))))).

Axiom kronecker_indexes :
  forall (m:matrix complex) (n:matrix complex) (i:Z) (j:Z) (k:Z) (l:Z),
  (valid_index m i j) -> (valid_index n k l) ->
  valid_index (kronecker m n) ((i * (rows n))%Z + k)%Z
  ((j * (columns n))%Z + l)%Z.

Axiom kronecker_indexes_com :
  forall (m:matrix complex) (n:matrix complex) (i:Z) (j:Z),
  (valid_index (kronecker m n) i j) ->
  valid_index m (int.EuclideanDivision.div i (rows n))
  (int.EuclideanDivision.div j (columns n)).

Axiom kronecker_indexes_com1 :
  forall (m:matrix complex) (n:matrix complex) (i:Z) (j:Z),
  (valid_index (kronecker m n) i j) ->
  valid_index n (int.EuclideanDivision.mod1 i (rows n))
  (int.EuclideanDivision.mod1 j (columns n)).

Axiom kronecker_assoc_pre :
  forall (m:matrix complex) (n:matrix complex) (o:matrix complex) (i:Z) (j:Z),
  ((0%Z <= i)%Z /\ (i < (((rows m) * (rows n))%Z * (rows o))%Z)%Z) ->
  ((0%Z <= j)%Z /\ (j < (((columns m) * (columns n))%Z * (columns o))%Z)%Z) ->
  ((get (kronecker (kronecker m n) o) i j) =
   (get (kronecker m (kronecker n o)) i j)).

Axiom kronecker_assoc :
  op_assoc (fun (y0:matrix complex) (y1:matrix complex) => (kronecker y0 y1)).

Axiom kronecker_assoc_use :
  forall (a:matrix complex) (b:matrix complex) (c:matrix complex),
  ((kronecker a (kronecker b c)) = (kronecker (kronecker a b) c)).

Axiom kronecker_assoc_use_rev :
  forall (a:matrix complex) (b:matrix complex) (c:matrix complex),
  ((kronecker (kronecker a b) c) = (kronecker a (kronecker b c))).

Axiom neutral_ :
  forall (m:matrix complex), ((kronecker m kronecker_neutral) = m).

Axiom neutral_1 :
  forall (m:matrix complex), ((kronecker kronecker_neutral m) = m).

Axiom neutral1 :
  (kronecker_neutral =
   (neutral_elt
    (fun (y0:matrix complex) (y1:matrix complex) => (kronecker y0 y1)))).

Axiom neutral2 :
  has_neutral
  (fun (y0:matrix complex) (y1:matrix complex) => (kronecker y0 y1)).

Axiom neutral3 :
  iterable (fun (y0:matrix complex) (y1:matrix complex) => (kronecker y0 y1)).

Axiom kronecker_equal :
  forall (m:matrix complex) (ml:matrix complex) (n:matrix complex)
    (nl:matrix complex),
  (equal m ml) -> (equal n nl) -> equal (kronecker m n) (kronecker ml nl).

Axiom kron_id :
  forall (m:Z) (n:Z), (0%Z <= m)%Z -> (0%Z <= n)%Z ->
  ((kronecker (identity m) (identity n)) = (identity (m + n)%Z)).

Parameter frows: (Z -> matrix complex) -> Z -> Z.

Axiom frows_def :
  forall (f:Z -> matrix complex) (k:Z), ((frows f k) = (rows (f k))).

Axiom frows_spec :
  forall (f:Z -> matrix complex) (k:Z), ((frows f k) > 0%Z)%Z.

Parameter fcolumns: (Z -> matrix complex) -> Z -> Z.

Axiom fcolumns_def :
  forall (f:Z -> matrix complex) (k:Z), ((fcolumns f k) = (columns (f k))).

Axiom fcolumns_spec :
  forall (f:Z -> matrix complex) (k:Z), ((fcolumns f k) > 0%Z)%Z.

Axiom const_fcol :
  forall (m:matrix complex) (k:Z),
  ((fcolumns ((fun (y0:matrix complex) (y1:Z) => (const y0 y1)) m) k) =
   (columns m)).

Axiom const_frows :
  forall (m:matrix complex) (k:Z),
  ((frows ((fun (y0:matrix complex) (y1:Z) => (const y0 y1)) m) k) =
   (rows m)).

Parameter mat_mult_no_bound:
  (matrix complex) -> (matrix complex) -> matrix complex.

Axiom mat_mult_no_bound_def :
  forall (m:matrix complex) (n:matrix complex), ((columns m) = (rows n)) ->
  ((mat_mult_no_bound m n) =
   (make_f (rows m) (columns n)
    (fun (i:Z) (j:Z) =>
     (ind_sum (fun (k:Z) => (infix_asdt (get m i k) (get n k j))) 0%Z
      (columns m))))).

Axiom mat_mult_no_bound_def1 :
  forall (m:matrix complex) (n:matrix complex), ~ ((columns m) = (rows n)) ->
  ((mat_mult_no_bound m n) = (make_f 1%Z 1%Z (fun (i:Z) (j:Z) => c_zero))).

Axiom mat_mult_no_bound_spec :
  forall (m:matrix complex) (n:matrix complex), ((columns m) = (rows n)) ->
  ((rows (mat_mult_no_bound m n)) = (rows m)).

Axiom mat_mult_no_bound_spec1 :
  forall (m:matrix complex) (n:matrix complex), ((columns m) = (rows n)) ->
  ((columns (mat_mult_no_bound m n)) = (columns n)).

Axiom mat_mult_no_bound_spec2 :
  forall (m:matrix complex) (n:matrix complex), ((columns m) = (rows n)) ->
  forall (i:Z) (j:Z), (valid_index (mat_mult_no_bound m n) i j) ->
  ((get (mat_mult_no_bound m n) i j) =
   (ind_sum (fun (k:Z) => (infix_asdt (get m i k) (get n k j))) 0%Z
    (columns m))).

Parameter mat_mult: (matrix complex) -> (matrix complex) -> matrix complex.

Axiom mat_mult_def :
  forall (m:matrix complex) (n:matrix complex), ((columns m) = (rows n)) ->
  ((mat_mult m n) = (mat_mult_no_bound m n)).

Axiom mat_mult_spec :
  forall (m:matrix complex) (n:matrix complex), ((columns m) = (rows n)) ->
  ((rows (mat_mult m n)) = (rows m)).

Axiom mat_mult_spec1 :
  forall (m:matrix complex) (n:matrix complex), ((columns m) = (rows n)) ->
  ((columns (mat_mult m n)) = (columns n)).

Axiom mat_mult_spec2 :
  forall (m:matrix complex) (n:matrix complex), ((columns m) = (rows n)) ->
  forall (i:Z) (j:Z), (valid_index (mat_mult m n) i j) ->
  ((get (mat_mult m n) i j) =
   (ind_sum (fun (k:Z) => (infix_asdt (get m i k) (get n k j))) 0%Z
    (columns m))).

Axiom correct_mat_mult :
  forall (m:matrix complex) (n:matrix complex), ((columns m) = (rows n)) ->
  ((mat_mult m n) =
   (make_f (rows m) (columns n)
    (fun (i:Z) (j:Z) =>
     (ind_sum (fun (k:Z) => (infix_asdt (get m i k) (get n k j))) 0%Z
      (columns m))))).

Axiom mat_mult_values :
  forall (m:matrix complex) (n:matrix complex) (i:Z) (j:Z),
  ((columns m) = (rows n)) -> (valid_index (mat_mult m n) i j) ->
  ((get (mat_mult m n) i j) =
   (ind_sum (fun (k:Z) => (infix_asdt (get m i k) (get n k j))) 0%Z
    (columns m))).

Axiom mat_mult_columns :
  forall (m:matrix complex) (n:matrix complex), ((columns m) = (rows n)) ->
  ((columns (mat_mult m n)) = (columns n)).

Axiom mat_mult_rows :
  forall (m:matrix complex) (n:matrix complex), ((columns m) = (rows n)) ->
  ((rows (mat_mult m n)) = (rows m)).

Axiom mat_mult_values_quant :
  forall (m:matrix complex) (n:matrix complex), ((columns m) = (rows n)) ->
  forall (i:Z) (j:Z), (valid_index (mat_mult m n) i j) ->
  ((get (mat_mult m n) i j) =
   (ind_sum (fun (k:Z) => (infix_asdt (get m i k) (get n k j))) 0%Z
    (columns m))).

Parameter int_mat_prod: (Z -> matrix complex) -> Z -> Z -> matrix complex.

Axiom int_mat_prod_def :
  forall (f:Z -> matrix complex) (i:Z) (j:Z), (i <= j)%Z ->
  (forall (k:Z) (k':Z),
   (((i <= k)%Z /\ (k <= j)%Z) /\ ((i <= k')%Z /\ (k' <= j)%Z)) ->
   ((rows (f k)) = (rows (f k'))) /\ ((rows (f k')) = (columns (f k')))) ->
  ((j - i)%Z = 0%Z) -> ((int_mat_prod f i j) = (f i)).

Axiom int_mat_prod_def1 :
  forall (f:Z -> matrix complex) (i:Z) (j:Z), (i <= j)%Z ->
  (forall (k:Z) (k':Z),
   (((i <= k)%Z /\ (k <= j)%Z) /\ ((i <= k')%Z /\ (k' <= j)%Z)) ->
   ((rows (f k)) = (rows (f k'))) /\ ((rows (f k')) = (columns (f k')))) ->
  ~ ((j - i)%Z = 0%Z) ->
  ((int_mat_prod f i j) =
   (mat_mult_no_bound (int_mat_prod f i (j - 1%Z)%Z) (f j))).

Axiom int_mat_prod_spec :
  forall (f:Z -> matrix complex) (i:Z) (j:Z), (i <= j)%Z ->
  (forall (k:Z) (k':Z),
   (((i <= k)%Z /\ (k <= j)%Z) /\ ((i <= k')%Z /\ (k' <= j)%Z)) ->
   ((rows (f k)) = (rows (f k'))) /\ ((rows (f k')) = (columns (f k')))) ->
  ((rows (int_mat_prod f i j)) = (rows (f i))).

Axiom int_mat_prod_spec1 :
  forall (f:Z -> matrix complex) (i:Z) (j:Z), (i <= j)%Z ->
  (forall (k:Z) (k':Z),
   (((i <= k)%Z /\ (k <= j)%Z) /\ ((i <= k')%Z /\ (k' <= j)%Z)) ->
   ((rows (f k)) = (rows (f k'))) /\ ((rows (f k')) = (columns (f k')))) ->
  ((columns (int_mat_prod f i j)) = (columns (f i))).

Axiom int_mat_prod_spec2 :
  forall (f:Z -> matrix complex) (i:Z) (j:Z), (i <= j)%Z ->
  (forall (k:Z) (k':Z),
   (((i <= k)%Z /\ (k <= j)%Z) /\ ((i <= k')%Z /\ (k' <= j)%Z)) ->
   ((rows (f k)) = (rows (f k'))) /\ ((rows (f k')) = (columns (f k')))) ->
  ((columns (int_mat_prod f i j)) = (rows (f i))).

Axiom int_mat_prod_zero :
  forall (f:Z -> matrix complex) (i:Z) (j:Z),
  ((rows (f i)) = (columns (f i))) -> (i = j) ->
  ((int_mat_prod f i j) = (f i)).

Parameter int_mat_prod_plus_one: (Z -> matrix complex) -> Z -> Z -> unit.

Axiom int_mat_prod_plus_one_def :
  forall (f:Z -> matrix complex) (i:Z) (j:Z), (i < j)%Z ->
  (forall (k:Z) (k':Z),
   (((i <= k)%Z /\ (k <= j)%Z) /\ ((i <= k')%Z /\ (k' <= j)%Z)) ->
   ((rows (f k)) = (rows (f k'))) /\ ((rows (f k')) = (columns (f k')))) ->
  ((int_mat_prod_plus_one f i j) = tt).

Axiom int_mat_prod_plus_one_spec :
  forall (f:Z -> matrix complex) (i:Z) (j:Z), (i < j)%Z ->
  (forall (k:Z) (k':Z),
   (((i <= k)%Z /\ (k <= j)%Z) /\ ((i <= k')%Z /\ (k' <= j)%Z)) ->
   ((rows (f k)) = (rows (f k'))) /\ ((rows (f k')) = (columns (f k')))) ->
  ((int_mat_prod f i j) = (mat_mult (int_mat_prod f i (j - 1%Z)%Z) (f j))).

Axiom int_mat_prod_eq :
  forall (f:Z -> matrix complex) (g:Z -> matrix complex) (i:Z) (j:Z),
  (i <= j)%Z ->
  (forall (k:Z) (k':Z), ((i <= k)%Z /\ (k <= j)%Z) ->
   ((i <= k')%Z /\ (k' <= j)%Z) ->
   ((rows (f k)) = (rows (f k'))) /\ ((rows (f k')) = (columns (f k')))) ->
  (forall (k:Z), ((i <= k)%Z /\ (k <= j)%Z) -> ((f k) = (g k))) ->
  ((int_mat_prod f i j) = (int_mat_prod g i j)).

Axiom mat_mult_id :
  forall (n:Z) (m:matrix complex), (n >= 0%Z)%Z ->
  ((columns m) = (power 2%Z n)) -> ((mat_mult m (identity n)) = m).

Axiom id_mat_mult :
  forall (n:Z) (m:matrix complex), (n >= 0%Z)%Z ->
  ((rows m) = (power 2%Z n)) -> ((mat_mult (identity n) m) = m).

Axiom mat_mult_eq :
  forall (m:matrix complex) (n:matrix complex) (m':matrix complex)
    (n':matrix complex),
  (m = m') -> (n = n') -> ((columns m) = (rows n)) ->
  ((mat_mult m n) = (mat_mult m' n')).

Parameter add_mat: (matrix complex) -> (matrix complex) -> matrix complex.

Axiom add_mat_def :
  forall (m:matrix complex) (n:matrix complex), ((rows m) = (rows n)) ->
  ((columns m) = (columns n)) ->
  ((add_mat m n) =
   (make_f (rows m) (columns m)
    (fun (i:Z) (j:Z) => (infix_pldt (get m i j) (get n i j))))).

Axiom add_mat_spec :
  forall (m:matrix complex) (n:matrix complex), ((rows m) = (rows n)) ->
  ((columns m) = (columns n)) -> ((columns (add_mat m n)) = (columns m)).

Axiom add_mat_spec1 : True.

Axiom add_mat_spec2 :
  forall (m:matrix complex) (n:matrix complex), ((rows m) = (rows n)) ->
  ((columns m) = (columns n)) -> ((rows (add_mat m n)) = (rows m)).

Axiom add_mat_spec3 :
  forall (m:matrix complex) (n:matrix complex), ((rows m) = (rows n)) ->
  ((columns m) = (columns n)) -> ((rows m) = (rows n)).

Axiom add_mat_spec4 :
  forall (m:matrix complex) (n:matrix complex), ((rows m) = (rows n)) ->
  ((columns m) = (columns n)) -> forall (i:Z) (j:Z),
  ((get (add_mat m n) i j) = (infix_pldt (get m i j) (get n i j))).

Axiom add_mat_equal :
  forall (m:matrix complex) (n:matrix complex) (m':matrix complex)
    (n':matrix complex),
  ((rows m) = (rows n)) -> ((columns m) = (columns n)) -> (m = m') ->
  (n = n') -> ((add_mat m n) = (add_mat m' n')).

Axiom add_value :
  forall (m:matrix complex) (n:matrix complex),
  ((columns m) = (columns n)) -> ((rows m) = (rows n)) ->
  ((columns m) = (columns n)) -> forall (i:Z) (j:Z),
  ((0%Z <= i)%Z /\ (i < (rows m))%Z) ->
  ((0%Z <= j)%Z /\ (j < (columns m))%Z) ->
  ((get (add_mat m n) i j) = (infix_pldt (get m i j) (get n i j))).

Axiom add_values :
  forall (m:matrix complex) (n:matrix complex) (i:Z) (j:Z),
  ((columns m) = (columns n)) -> ((rows m) = (rows n)) ->
  ((get (add_mat m n) i j) = (infix_pldt (get m i j) (get n i j))).

Axiom add_mat_null_left :
  forall (m:matrix complex) (n:matrix complex),
  ((columns m) = (columns n)) -> ((rows m) = (rows n)) -> (null_mat m) ->
  ((add_mat m n) = n).

Axiom add_mat_null_right :
  forall (m:matrix complex) (n:matrix complex),
  ((columns m) = (columns n)) -> ((rows m) = (rows n)) -> (null_mat n) ->
  ((add_mat m n) = m).

Axiom set_equal_columns_elt :
  forall (m:matrix complex) (n:matrix complex) (i:Z),
  (((columns m) = (columns n)) /\ ((columns n) = i)) ->
  ((columns m) = (columns n)).

Axiom set_equal_rows_elt :
  forall (m:matrix complex) (n:matrix complex) (i:Z),
  (((rows m) = (rows n)) /\ ((rows n) = i)) -> ((rows m) = (rows n)).

Axiom add_columns :
  forall (m:matrix complex) (n:matrix complex),
  ((columns m) = (columns n)) -> ((rows m) = (rows n)) ->
  ((columns (add_mat m n)) = (columns m)).

Axiom add_rows :
  forall (m:matrix complex) (n:matrix complex),
  ((columns m) = (columns n)) -> ((rows m) = (rows n)) ->
  ((rows (add_mat m n)) = (rows m)).

Axiom set_equal_dim_elt :
  forall (m:matrix complex) (n:matrix complex) (i:Z) (j:Z),
  (((rows m) = (rows n)) /\ ((rows n) = i)) ->
  (((columns m) = (columns n)) /\ ((columns n) = j)) ->
  ((columns m) = (columns n)).

Axiom set_equal_dim_elt1 :
  forall (m:matrix complex) (n:matrix complex) (i:Z) (j:Z),
  (((rows m) = (rows n)) /\ ((rows n) = i)) ->
  (((columns m) = (columns n)) /\ ((columns n) = j)) -> ((rows m) = (rows n)).

Axiom set_dim_add :
  forall (m:matrix complex) (n:matrix complex) (i:Z) (j:Z),
  (((rows m) = (rows n)) /\ ((rows n) = i)) ->
  (((columns m) = (columns n)) /\ ((columns n) = j)) ->
  ((rows (add_mat m n)) = i).

Axiom set_dim_add1 :
  forall (m:matrix complex) (n:matrix complex) (i:Z) (j:Z),
  (((rows m) = (rows n)) /\ ((rows n) = i)) ->
  (((columns m) = (columns n)) /\ ((columns n) = j)) ->
  ((columns (add_mat m n)) = j).

Axiom add_mat_eq :
  forall (m:matrix complex) (m1:matrix complex) (n:matrix complex)
    (n1:matrix complex),
  ((rows m) = (rows n)) -> ((columns m) = (columns n)) -> (m = m1) ->
  (n = n1) -> ((add_mat m n) = (add_mat m1 n1)).

Axiom add_mat_comm :
  forall (m:matrix complex) (n:matrix complex), ((rows m) = (rows n)) ->
  ((columns m) = (columns n)) -> ((add_mat m n) = (add_mat n m)).

Axiom add_mat_eq_rev :
  forall (m:matrix complex) (m1:matrix complex) (n:matrix complex)
    (n1:matrix complex),
  ((rows m) = (rows n)) -> ((columns m) = (columns n)) -> (m = m1) ->
  (n = n1) -> ((add_mat n m) = (add_mat m1 n1)).

Parameter add_neutral: unit -> matrix complex.

Axiom add_neutral_spec :
  forall (us:unit), forall (i:Z) (j:Z), (valid_index (add_neutral us) i j) ->
  ((get (add_neutral us) i j) = c_zero).

Axiom add_neutral_spec1 :
  forall (us:unit), ((rows (add_neutral us)) > 0%Z)%Z.

Axiom add_neutral_spec2 :
  forall (us:unit), ((columns (add_neutral us)) > 0%Z)%Z.

Axiom distr_1_pre :
  forall (m:matrix complex) (n:matrix complex) (o:matrix complex) (i:Z) (j:Z),
  ((rows m) = (rows n)) -> ((columns m) = (columns n)) ->
  ((columns m) = (rows o)) -> ((0%Z <= i)%Z /\ (i < (rows m))%Z) ->
  ((0%Z <= j)%Z /\ (j < (columns o))%Z) ->
  ((get (mat_mult (add_mat m n) o) i j) =
   (get (add_mat (mat_mult m o) (mat_mult n o)) i j)).

Axiom distr_l :
  forall (m:matrix complex) (n:matrix complex) (o:matrix complex),
  ((rows m) = (rows n)) -> ((columns m) = (columns n)) ->
  ((columns m) = (rows o)) ->
  ((mat_mult (add_mat m n) o) = (add_mat (mat_mult m o) (mat_mult n o))).

Axiom distr_2_pre :
  forall (m:matrix complex) (n:matrix complex) (o:matrix complex) (i:Z) (j:Z),
  ((rows n) = (rows o)) -> ((columns n) = (columns o)) ->
  ((columns m) = (rows n)) -> ((0%Z <= i)%Z /\ (i < (rows m))%Z) ->
  ((0%Z <= j)%Z /\ (j < (columns n))%Z) ->
  valid_index (mat_mult m (add_mat n o)) i j.

Axiom distr_2_pre1 :
  forall (m:matrix complex) (n:matrix complex) (o:matrix complex) (i:Z) (j:Z),
  ((rows n) = (rows o)) -> ((columns n) = (columns o)) ->
  ((columns m) = (rows n)) -> ((0%Z <= i)%Z /\ (i < (rows m))%Z) ->
  ((0%Z <= j)%Z /\ (j < (columns n))%Z) ->
  ((get (mat_mult m (add_mat n o)) i j) =
   (get (add_mat (mat_mult m n) (mat_mult m o)) i j)).

Axiom distr_r :
  forall (m:matrix complex) (n:matrix complex) (o:matrix complex),
  ((rows n) = (rows o)) -> ((columns n) = (columns o)) ->
  ((columns m) = (rows n)) ->
  ((mat_mult m (add_mat n o)) = (add_mat (mat_mult m n) (mat_mult m o))).

Parameter infix_asdtdt: complex -> (matrix complex) -> matrix complex.

Axiom infix_asdtdt_def :
  forall (s:complex) (m:matrix complex),
  ((infix_asdtdt s m) =
   (make_f (rows m) (columns m)
    (fun (i:Z) (j:Z) => (infix_asdt s (get m i j))))).

Axiom infix_asdtdt_spec :
  forall (s:complex) (m:matrix complex),
  ((columns (infix_asdtdt s m)) = (columns m)).

Axiom infix_asdtdt_spec1 :
  forall (s:complex) (m:matrix complex),
  ((rows (infix_asdtdt s m)) = (rows m)).

Axiom infix_asdtdt_spec2 :
  forall (s:complex) (m:matrix complex), forall (i:Z) (j:Z),
  (valid_index (infix_asdtdt s m) i j) ->
  ((get (infix_asdtdt s m) i j) = (infix_asdt s (get m i j))).

Axiom infix_asdtdt_spec3 :
  forall (s:complex) (m:matrix complex), forall (i:Z) (j:Z),
  (valid_index (infix_asdtdt s m) i j) -> valid_index m i j.

Axiom infix_asdtdt_spec4 :
  forall (s:complex) (m:matrix complex), forall (i:Z) (j:Z),
  (valid_index m i j) -> valid_index (infix_asdtdt s m) i j.

Axiom scalar_columns :
  forall (m:matrix complex) (a:complex),
  ((columns (infix_asdtdt a m)) = (columns m)).

Axiom scalar_values :
  forall (m:matrix complex) (a:complex) (i:Z) (j:Z),
  ((get (infix_asdtdt a m) i j) = (infix_asdt a (get m i j))).

Axiom scalar_rows :
  forall (m:matrix complex) (a:complex),
  ((rows (infix_asdtdt a m)) = (rows m)).

Axiom scalar_null :
  forall (m:matrix complex), null_mat (infix_asdtdt c_zero m).

Axiom scalar_c_one : forall (m:matrix complex), ((infix_asdtdt c_one m) = m).

Axiom scalar_c_one_gen :
  forall (m:matrix complex) (a:complex), (a = c_one) ->
  ((infix_asdtdt a m) = m).

Axiom scalar_null_gen :
  forall (m:matrix complex) (a:complex), (a = c_zero) ->
  null_mat (infix_asdtdt a m).

Axiom scalar_plus :
  forall (m:matrix complex) (a:complex) (b:complex),
  ((infix_asdtdt (infix_pldt a b) m) =
   (add_mat (infix_asdtdt a m) (infix_asdtdt b m))).

Axiom scalar_plus_rev :
  forall (m:matrix complex) (a:complex) (b:complex),
  ((add_mat (infix_asdtdt a m) (infix_asdtdt b m)) =
   (infix_asdtdt (infix_pldt a b) m)).

Axiom add_scal :
  forall (m:matrix complex) (n:matrix complex) (a:complex),
  ((rows m) = (rows n)) -> ((columns m) = (columns n)) ->
  ((infix_asdtdt a (add_mat m n)) =
   (add_mat (infix_asdtdt a m) (infix_asdtdt a n))).

Axiom add_scal_rev :
  forall (m:matrix complex) (n:matrix complex) (a:complex),
  ((rows m) = (rows n)) -> ((columns m) = (columns n)) ->
  ((add_mat (infix_asdtdt a m) (infix_asdtdt a n)) =
   (infix_asdtdt a (add_mat m n))).

Axiom mat_mult_scal_values_l :
  forall (m:matrix complex) (n:matrix complex) (a:complex) (i:Z) (j:Z),
  ((rows n) = (columns m)) -> ((0%Z <= i)%Z /\ (i < (rows m))%Z) ->
  ((0%Z <= j)%Z /\ (j < (columns n))%Z) ->
  ((infix_asdt a (get (mat_mult m n) i j)) =
   (ind_sum
    (fun (k:Z) => (infix_asdt (infix_asdt a (get m i k)) (get n k j))) 0%Z
    (columns m))).

Axiom mat_mult_scal_values_r :
  forall (m:matrix complex) (n:matrix complex) (a:complex) (i:Z) (j:Z),
  ((rows n) = (columns m)) -> ((rows m) = (columns n)) ->
  ((columns m) = (columns n)) -> ((0%Z <= i)%Z /\ (i < (rows m))%Z) ->
  ((0%Z <= j)%Z /\ (j < (columns n))%Z) ->
  ((infix_asdt (get (mat_mult m n) i j) a) =
   (ind_sum
    (fun (k:Z) => (infix_asdt (infix_asdt a (get m i k)) (get n k j))) 0%Z
    (columns m))).

Axiom mat_mut_scal :
  forall (m:matrix complex) (n:matrix complex) (a:complex),
  ((rows n) = (columns m)) ->
  ((mat_mult m (infix_asdtdt a n)) = (infix_asdtdt a (mat_mult m n))).

Axiom scal_mat_mut :
  forall (m:matrix complex) (n:matrix complex) (a:complex),
  ((rows n) = (columns m)) ->
  ((mat_mult (infix_asdtdt a m) n) = (infix_asdtdt a (mat_mult m n))).

Axiom mat_mut_scal_rev :
  forall (m:matrix complex) (n:matrix complex) (a:complex),
  ((rows n) = (columns m)) ->
  ((infix_asdtdt a (mat_mult m n)) = (mat_mult m (infix_asdtdt a n))).

Axiom scal_mat_mut_rev :
  forall (m:matrix complex) (n:matrix complex) (a:complex),
  ((rows n) = (columns m)) ->
  ((infix_asdtdt a (mat_mult m n)) = (mat_mult (infix_asdtdt a m) n)).

Axiom ind_sum_commute_scal_r :
  forall (f:Z -> Z -> complex) (g:Z -> complex) (i:Z) (j:Z) (k:Z) (l:Z),
  (i <= j)%Z -> (k <= l)%Z ->
  ((ind_sum (fun (k1:Z) => (infix_asdt (ind_sum (f k1) k l) (g k1))) i j) =
   (ind_sum
    (fun (k1:Z) =>
     (ind_sum (fun (k2:Z) => (infix_asdt ((f k2) k1) (g k2))) i j))
    k l)).

Axiom mat_mult_assoc_pre :
  forall (m:matrix complex) (n:matrix complex) (o:matrix complex) (i:Z) (j:Z),
  ((columns m) = (rows n)) -> ((columns n) = (rows o)) ->
  ((0%Z <= i)%Z /\ (i < (rows m))%Z) ->
  ((0%Z <= j)%Z /\ (j < (columns o))%Z) ->
  ((get (mat_mult (mat_mult m n) o) i j) =
   (get (mat_mult m (mat_mult n o)) i j)).

Axiom mat_mult_assoc :
  forall (m:matrix complex) (n:matrix complex) (o:matrix complex),
  ((columns m) = (rows n)) -> ((columns n) = (rows o)) ->
  ((mat_mult (mat_mult m n) o) = (mat_mult m (mat_mult n o))).

Axiom mat_mult_assoc_quant :
  forall (m:matrix complex) (n:matrix complex), ((columns m) = (rows n)) ->
  forall (o:matrix complex), ((columns n) = (rows o)) ->
  ((mat_mult (mat_mult m n) o) = (mat_mult m (mat_mult n o))).

Axiom mat_mult_assoc_comm :
  forall (m:matrix complex) (n:matrix complex) (o:matrix complex),
  ((columns m) = (rows n)) -> ((columns n) = (rows o)) ->
  ((mat_mult m (mat_mult n o)) = (mat_mult (mat_mult m n) o)).

Axiom scalar_eq :
  forall (m:matrix complex) (n:matrix complex) (a:complex), (m = n) ->
  ((infix_asdtdt a m) = (infix_asdtdt a n)).

Axiom scalar_eq_gen :
  forall (m:matrix complex) (n:matrix complex) (a:complex) (b:complex),
  (m = n) -> (a = b) -> ((infix_asdtdt a m) = (infix_asdtdt b n)).

Axiom scalar_add :
  forall (m:matrix complex) (a:complex) (b:complex),
  ((infix_asdtdt (infix_pldt a b) m) =
   (add_mat (infix_asdtdt a m) (infix_asdtdt b m))).

Axiom scalar_assoc :
  forall (m:matrix complex) (a:complex) (b:complex),
  ((infix_asdtdt a (infix_asdtdt b m)) = (infix_asdtdt (infix_asdt a b) m)).

Axiom scalar_assoc_rev :
  forall (m:matrix complex) (a:complex) (b:complex),
  ((infix_asdtdt (infix_asdt a b) m) = (infix_asdtdt a (infix_asdtdt b m))).

Axiom scalars_inv :
  forall (m:matrix complex) (a:complex) (b:complex) (a':complex) (b':complex),
  (a = a') -> (b = b') ->
  ((infix_asdtdt a' (infix_asdtdt b' m)) =
   (infix_asdtdt b (infix_asdtdt a m))).

Axiom eq_scalar :
  forall (m:matrix complex) (a:complex) (b:complex),
  (exists i:Z, exists j:Z, (valid_index m i j) /\ ~ ((get m i j) = c_zero)) ->
  ((infix_asdtdt a m) = (infix_asdtdt b m)) -> (a = b).

Parameter mat_substr: (matrix complex) -> (matrix complex) -> matrix complex.

Axiom mat_substr_def :
  forall (m:matrix complex) (n:matrix complex), ((rows m) = (rows n)) ->
  ((columns m) = (columns n)) ->
  ((mat_substr m n) = (add_mat m (infix_asdtdt (prefix_mndt c_one) n))).

Axiom mat_substr_spec :
  forall (m:matrix complex) (n:matrix complex), ((rows m) = (rows n)) ->
  ((columns m) = (columns n)) -> ((rows (mat_substr m n)) = (rows m)).

Axiom mat_substr_spec1 :
  forall (m:matrix complex) (n:matrix complex), ((rows m) = (rows n)) ->
  ((columns m) = (columns n)) -> ((columns (mat_substr m n)) = (columns m)).

Axiom mat_substr_spec2 :
  forall (m:matrix complex) (n:matrix complex), ((rows m) = (rows n)) ->
  ((columns m) = (columns n)) -> forall (i:Z) (j:Z),
  ((0%Z <= i)%Z /\ (i < (rows m))%Z) ->
  ((0%Z <= j)%Z /\ (j < (columns m))%Z) ->
  ((get (mat_substr m n) i j) = (infix_mndt (get m i j) (get n i j))).

Axiom substr_rows :
  forall (m:matrix complex) (n:matrix complex) (r:Z),
  (((rows m) = (rows n)) /\ ((rows n) = r)) -> ((columns m) = (columns n)) ->
  ((rows (mat_substr m n)) = r).

Axiom substr_columns :
  forall (m:matrix complex) (n:matrix complex) (c:Z),
  ((rows m) = (rows n)) ->
  (((columns m) = (columns n)) /\ ((columns n) = c)) ->
  ((columns (mat_substr m n)) = c).

Axiom substr_value :
  forall (m:matrix complex) (n:matrix complex) (i:Z) (j:Z),
  ((rows m) = (rows n)) -> ((columns m) = (columns n)) ->
  ((0%Z <= i)%Z /\ (i < (rows m))%Z) ->
  ((0%Z <= j)%Z /\ (j < (columns m))%Z) ->
  ((get (mat_substr m n) i j) = (infix_mndt (get m i j) (get n i j))).

Axiom distr_l_substr :
  forall (m:matrix complex) (n:matrix complex) (o:matrix complex),
  ((rows m) = (rows n)) -> ((columns m) = (columns n)) ->
  ((columns m) = (rows o)) ->
  ((mat_mult (mat_substr m n) o) =
   (mat_substr (mat_mult m o) (mat_mult n o))).

Axiom distr_r_substr :
  forall (m:matrix complex) (n:matrix complex) (o:matrix complex),
  ((rows n) = (rows o)) -> ((columns n) = (columns o)) ->
  ((columns m) = (rows o)) ->
  ((mat_mult m (mat_substr n o)) =
   (mat_substr (mat_mult m n) (mat_mult m o))).

Axiom mat_substr_eq :
  forall (m:matrix complex) (m':matrix complex) (n:matrix complex)
    (n':matrix complex),
  ((rows m) = (rows n)) -> ((columns m) = (columns n)) -> (m = m') ->
  (n = n') -> ((mat_substr m n) = (mat_substr m' n')).

Axiom substr_decomp :
  forall (m:matrix complex) (n:matrix complex), ((rows m) = (rows n)) ->
  ((columns m) = (columns n)) -> (m = (add_mat n (mat_substr m n))).

Axiom subtr_scal :
  forall (m:matrix complex) (n:matrix complex) (a:complex),
  ((rows m) = (rows n)) -> ((columns m) = (columns n)) ->
  ((infix_asdtdt a (mat_substr m n)) =
   (mat_substr (infix_asdtdt a m) (infix_asdtdt a n))).

Axiom subtr_scal_rev :
  forall (m:matrix complex) (n:matrix complex) (a:complex),
  ((rows m) = (rows n)) -> ((columns m) = (columns n)) ->
  ((mat_substr (infix_asdtdt a m) (infix_asdtdt a n)) =
   (infix_asdtdt a (mat_substr m n))).

Axiom get_equal_mat_to_substr :
  forall (m:matrix complex) (n:matrix complex), ((rows m) = (rows n)) ->
  ((columns m) = (columns n)) -> (m = n) ->
  ((mat_substr m n) = (make (rows m) (columns m) c_zero)).

Axiom set_inequal_mat_by_substr :
  forall (m:matrix complex) (n:matrix complex), ((rows m) = (rows n)) ->
  ((columns m) = (columns n)) -> ~ (m = n) ->
  ~ ((mat_substr m n) = (make (rows m) (columns m) c_zero)).

Axiom set_inequal_mat_by_substr1 :
  forall (m:matrix complex) (n:matrix complex), ((rows m) = (rows n)) ->
  ((columns m) = (columns n)) ->
  ~ ((mat_substr m n) = (make (rows m) (columns m) c_zero)) -> ~ (m = n).

Axiom pow_inv_2_scal :
  forall (i:Z) (x:matrix complex), (0%Z <= i)%Z ->
  ((infix_asdtdt (pow_inv_2 i) x) =
   (infix_asdtdt (pow_inv_sqrt_2 i) (infix_asdtdt (pow_inv_sqrt_2 i) x))).

Axiom pow_inv_2_from_int :
  forall (n:Z), (0%Z <= n)%Z ->
  ((pow_inv_2 n) = (infix_sldt c_one (i_to_c (power 2%Z n)))).

Axiom pow_inv_2_sq_rt :
  forall (n:Z), (0%Z <= n)%Z ->
  ((square_rt (pow_inv_2 n)) = (pow_inv_sqrt_2 n)).

Axiom pow_inv_sqrt_2_double :
  forall (n:Z), (0%Z <= n)%Z ->
  ((pow_inv_sqrt_2 (2%Z * n)%Z) = (pow_inv_2 n)).

Axiom pos_pow_inv_2 :
  forall (i:Z), (0%Z <= i)%Z -> infix_lseqdt c_zero (pow_inv_2 i).

Axiom pos_pow_inv_sqrt_2 :
  forall (i:Z), (0%Z <= i)%Z -> infix_lseqdt c_zero (pow_inv_sqrt_2 i).

Axiom strict_pos_pow_inv_2 :
  forall (i:Z), (0%Z <= i)%Z -> infix_lsdt c_zero (pow_inv_2 i).

Axiom pow_inv_2_add :
  forall (i:Z) (j:Z), (0%Z <= i)%Z -> (0%Z <= j)%Z ->
  ((pow_inv_2 (i + j)%Z) = (infix_asdt (pow_inv_2 i) (pow_inv_2 j))).

Axiom pow_inv_2_plus_one :
  forall (i:Z), (0%Z <= i)%Z ->
  ((pow_inv_2 (i + 1%Z)%Z) =
   (infix_asdt (infix_sldt c_one ttwo) (pow_inv_2 i))).

Axiom pow_inv_2_plus_one_rev :
  forall (i:Z), (0%Z <= i)%Z ->
  ((infix_asdt (infix_sldt c_one ttwo) (pow_inv_2 i)) =
   (pow_inv_2 (i + 1%Z)%Z)).

Axiom pow_inv_2_with_ :
  forall (i:Z), (0%Z <= i)%Z ->
  ((pow_inv_2 i) = (infix_sldt c_one (i_to_c (power_ 2%Z i)))).

Axiom pow_inv_2_to_one :
  forall (i:Z), (0%Z <= i)%Z ->
  ((infix_asdt (i_to_c (power_ 2%Z i)) (pow_inv_2 i)) = c_one).

Axiom pow_inv_2_one :
  forall (i:Z), (i = 1%Z) -> ((i_to_c (power_ 2%Z i)) = ttwo).

Axiom pow_inv_2_to_one_gen :
  forall (i:Z) (x:complex), (0%Z <= i)%Z -> (x = (i_to_c (power_ 2%Z i))) ->
  ((infix_asdt (pow_inv_2 i) x) = c_one).

Axiom pow_inv_to_pow_2 :
  forall (k:Z) (l:Z), (0%Z <= l)%Z -> (k >= l)%Z ->
  ((infix_asdt (pow_inv_2 k) (i_to_c (power_ 2%Z l))) =
   (pow_inv_2 (k - l)%Z)).

Parameter neg_pow_inv_sqrt_2: Z -> complex.

Axiom neg_pow_inv_sqrt_2_def :
  forall (i:Z), (0%Z <= i)%Z ->
  ((neg_pow_inv_sqrt_2 i) = (cpower neg_coeff i)).

Axiom inv_pow_inv_sqrt_2 :
  ((infix_asdt (pow_inv_sqrt_2 1%Z) squarert_two) = c_one).

Axiom pow_inv_sqrt_2_values :
  forall (i:Z), (0%Z <= i)%Z ->
  ((pow_inv_sqrt_2 i) = (infix_sldt c_one (cpower squarert_two i))).

Axiom neg_pow_inv_sqrt_2_values :
  forall (i:Z), (0%Z <= i)%Z ->
  ((neg_pow_inv_sqrt_2 i) =
   (infix_asdt (mop i) (infix_sldt c_one (cpower squarert_two i)))).

Axiom ppos_neg_coeff_values :
  forall (i:Z), (0%Z <= i)%Z -> ((even i) = true) ->
  ((pow_inv_sqrt_2 i) = (neg_pow_inv_sqrt_2 i)).

Axiom ppos_neg_coeff_values1 :
  forall (i:Z), (0%Z <= i)%Z -> ((odd i) = true) ->
  ((pow_inv_sqrt_2 i) = (prefix_mndt (neg_pow_inv_sqrt_2 i))).

Axiom ppos_neg_coeff_values2 :
  forall (i:Z), (0%Z <= i)%Z ->
  ((neg_pow_inv_sqrt_2 i) = (infix_asdt (mop i) (pow_inv_sqrt_2 i))).

Parameter pow_inv_sqrt_2_neg: Z -> complex.

Axiom pow_inv_sqrt_2_neg_def :
  forall (i:Z), (0%Z <= i)%Z ->
  ((pow_inv_sqrt_2_neg i) = (prefix_mndt (pow_inv_sqrt_2 i))).

Axiom int_to_ang_to_real_to_ang :
  forall (theta:angle) (k:Z) (n:Z), (n >= 0%Z)%Z ->
  (theta = (int_to_ang k n)) ->
  (theta = (real_to_ang (infix_asdt (i_to_c k) (pow_inv_2 n)))).

Axiom real_to_ang_to_int_to_ang :
  forall (k:Z) (n:Z), (n >= 0%Z)%Z ->
  ((real_to_ang (infix_asdt (i_to_c k) (pow_inv_2 n))) = (int_to_ang k n)).

Axiom real_to_ang_to_int_to_ang_add :
  forall (k:Z) (k':Z) (n:Z), (n >= 0%Z)%Z ->
  ((real_to_ang
    (infix_asdt (infix_pldt (i_to_c k) (i_to_c k')) (pow_inv_2 n)))
   = (int_to_ang (k + k')%Z n)).

Axiom int_to_ang_to_real_to_ang_gen :
  forall (k:Z) (n:Z) (kx:complex), (n >= 0%Z)%Z -> (kx = (i_to_c k)) ->
  ((int_to_ang k n) = (real_to_ang (infix_asdt kx (pow_inv_2 n)))).

Axiom Int_To_Ang_inv :
  forall (k:Z) (n:Z), (n >= 0%Z)%Z ->
  ((ang_inv (int_to_ang k n)) = (int_to_ang (-k)%Z n)).

Axiom Int_To_Ang_inv_add :
  forall (k:Z) (n:Z), (n >= 0%Z)%Z ->
  ((ang_add (int_to_ang k n) (int_to_ang (-k)%Z n)) = ang_zero).

Axiom Int_To_Ang_add :
  forall (k:Z) (k':Z) (n:Z), (n >= 0%Z)%Z ->
  ((ang_add (int_to_ang k n) (int_to_ang k' n)) = (int_to_ang (k + k')%Z n)).

Axiom Int_To_Ang_up :
  forall (k:Z) (n:Z), (0%Z <= n)%Z ->
  ((int_to_ang k n) = (int_to_ang (2%Z * k)%Z (n + 1%Z)%Z)).

Axiom Int_To_Ang_cyclic :
  forall (k:Z) (n:Z), (0%Z <= n)%Z ->
  ((int_to_ang k n) = (int_to_ang (k + (power_ 2%Z n))%Z n)).

Axiom Zero_n : forall (n:Z), (n >= 0%Z)%Z -> ((int_to_ang 0%Z n) = ang_zero).

Parameter ang_minus_one: angle.

Axiom ang_minus_one_def : (ang_minus_one = (int_to_ang 1%Z 1%Z)).

Axiom set_ang_minus_one_by_int :
  forall (a:Z) (b:Z), (a = 1%Z) -> (b = 1%Z) ->
  ((int_to_ang a b) = ang_minus_one).

Axiom ang_minus_one_from_real :
  (ang_minus_one = (real_to_ang (infix_sldt c_one ttwo))).

Axiom ang_exp_minus_one : ((ang_exp ang_minus_one) = (prefix_mndt c_one)).

Axiom set_ang_zero_by_int :
  forall (a:Z) (b:Z), (a = 0%Z) -> (0%Z <= b)%Z ->
  ((int_to_ang a b) = ang_zero).

Axiom ang_minus_one_twice :
  forall (a1:angle) (a2:angle), (a1 = ang_minus_one) ->
  (a2 = ang_minus_one) -> ((ang_add a1 a2) = ang_zero).

Parameter div_two: angle -> angle.

Axiom div_two_def :
  forall (d:angle),
  ((div_two d) = (real_to_ang (infix_sldt (ang_meas d) ttwo))).

Axiom div_two_spec :
  forall (d:angle), ((ang_meas (div_two d)) = (infix_sldt (ang_meas d) ttwo)).

Axiom div_two_spec1 :
  forall (d:angle), ((ang_add (div_two d) (div_two d)) = d).

Axiom Div_two : forall (d:angle), ((ang_add (div_two d) (div_two d)) = d).

Axiom div_two_int_to_ang :
  forall (k:Z) (n:Z), (n >= 0%Z)%Z ->
  ((0%Z <= k)%Z /\ (k < (power_ 2%Z n))%Z) ->
  ((div_two (int_to_ang k n)) = (int_to_ang k (n + 1%Z)%Z)).

Axiom ang_exp_mult :
  forall (x:angle) (x':angle),
  ((infix_asdt (ang_exp x) (ang_exp x')) = (ang_exp (ang_add x x'))).

Axiom ang_exp_modulus : forall (x:angle), ((modulus (ang_exp x)) = c_one).

Axiom ang_exp_not_one :
  forall (i:complex), ((infix_lsdt c_zero i) /\ (infix_lsdt i c_one)) ->
  ~ ((ang_exp (real_to_ang i)) = c_one).

Axiom ang_exp_not_by_modulus :
  forall (i:complex), ((infix_lsdt c_zero i) /\ (infix_lsdt i c_one)) ->
  ~ ((ang_exp (real_to_ang (modulus i))) = c_one).

Parameter k_int_to_ang: Z -> angle.

Axiom k_int_to_ang_def :
  forall (k:Z), (0%Z <= k)%Z -> ((k_int_to_ang k) = (int_to_ang 1%Z k)).

Axiom K_int_to_angplus_one :
  forall (k:Z), (k > 0%Z)%Z ->
  ((ang_add (k_int_to_ang k) (k_int_to_ang k)) = (k_int_to_ang (k - 1%Z)%Z)).

Parameter phase_inv_pre: Z -> angle -> angle.

Axiom phase_inv_pre_def :
  forall (i:Z) (d:angle), (0%Z <= i)%Z -> (i = 0%Z) ->
  ((phase_inv_pre i d) = d).

Axiom phase_inv_pre_def1 :
  forall (i:Z) (d:angle), (0%Z <= i)%Z -> ~ (i = 0%Z) ->
  ((phase_inv_pre i d) = (ang_inv (phase_inv_pre (i - 1%Z)%Z d))).

Axiom phase_inv_pre_spec :
  forall (i:Z) (d:angle), (0%Z <= i)%Z ->
  ((int.EuclideanDivision.mod1 i 2%Z) = 0%Z) -> ((phase_inv_pre i d) = d).

Axiom phase_inv_pre_spec1 :
  forall (i:Z) (d:angle), (0%Z <= i)%Z ->
  ((int.EuclideanDivision.mod1 i 2%Z) = 1%Z) ->
  ((phase_inv_pre i d) = (ang_inv d)).

Parameter phase_inv_: Z -> angle -> angle.

Axiom phase_inv__def :
  forall (i:Z) (d:angle), (0%Z <= i)%Z ->
  ((phase_inv_ i d) = (phase_inv_pre i d)).

Axiom phase_inv__def1 :
  forall (i:Z) (d:angle), ~ (0%Z <= i)%Z ->
  ((phase_inv_ i d) = (phase_inv_pre (-i)%Z d)).

Axiom phase_inv__spec :
  forall (i:Z) (d:angle), ((int.EuclideanDivision.mod1 i 2%Z) = 0%Z) ->
  ((phase_inv_ i d) = d).

Axiom phase_inv__spec1 :
  forall (i:Z) (d:angle), ((int.EuclideanDivision.mod1 i 2%Z) = 1%Z) ->
  ((phase_inv_ i d) = (ang_inv d)).

Axiom Even_phase_inv :
  forall (d:angle), forall (i:Z),
  ((int.EuclideanDivision.mod1 i 2%Z) = 0%Z) -> ((phase_inv_ i d) = d).

Axiom Odd_phase_inv :
  forall (d:angle), forall (i:Z),
  ((int.EuclideanDivision.mod1 i 2%Z) = 1%Z) ->
  ((phase_inv_ i d) = (ang_inv d)).

Axiom Gen_phase_inv :
  forall (k:Z) (n:Z) (i:Z), (n >= 0%Z)%Z -> (i >= 0%Z)%Z ->
  ((phase_inv_ i (int_to_ang k n)) =
   (int_to_ang ((power_ (-1%Z)%Z i) * k)%Z n)).

Axiom Gen_phase_inv_neg :
  forall (k:Z) (n:Z) (i:Z), (n >= 0%Z)%Z -> (i < 0%Z)%Z ->
  ((phase_inv_ i (int_to_ang k n)) =
   (int_to_ang ((power_ (-1%Z)%Z (-i)%Z) * k)%Z n)).

Axiom Ang_exp_inv :
  forall (o:angle), ((ang_exp (ang_inv o)) = (infix_sldt c_one (ang_exp o))).

Axiom ang_inv_to_conjugate :
  forall (o:angle), ((ang_exp (ang_inv o)) = (conjugate (ang_exp o))).

Axiom exp_minus :
  forall (x:complex), (real_ x) ->
  ((exp (infix_asdt im (prefix_mndt x))) =
   (conjugate (exp (infix_asdt im x)))).

Axiom conjugate_to_ang_inv :
  forall (o:angle), ((conjugate (ang_exp o)) = (ang_exp (ang_inv o))).

Axiom conjugate_inv_elim :
  forall (o:angle), ((conjugate (ang_exp (ang_inv o))) = (ang_exp o)).

Axiom ang_exp_neg_conjugate :
  forall (x:complex), (real_ x) ->
  ((ang_exp (real_to_ang (prefix_mndt x))) =
   (conjugate (ang_exp (real_to_ang x)))).

Axiom ang_exp_neg_conjugate_rev :
  forall (x:complex), (real_ x) ->
  ((conjugate (ang_exp (real_to_ang x))) =
   (ang_exp (real_to_ang (prefix_mndt x)))).

Axiom ang_mult_int_in :
  forall (i:Z) (k:Z) (n:Z), (0%Z <= n)%Z ->
  ((ang_mult_int (int_to_ang k n) i) = (int_to_ang (i * k)%Z n)).

Axiom ang_mult_int_out :
  forall (i:Z) (k:Z) (n:Z), (0%Z <= n)%Z ->
  ((int_to_ang (i * k)%Z n) = (ang_mult_int (int_to_ang k n) i)).

Axiom int_to_ang_cycles :
  forall (k:Z) (n:Z) (i:Z), (0%Z <= n)%Z -> (0%Z <= i)%Z ->
  ((int_to_ang (k + (i * (power_ 2%Z n))%Z)%Z n) = (int_to_ang k n)).

Axiom int_to_ang_eq :
  forall (k1:Z) (k2:Z) (n1:Z) (n2:Z), (k1 = k2) -> (n1 = n2) ->
  ((int_to_ang k1 n1) = (int_to_ang k2 n2)).

Axiom int_to_ang_cycles_neg :
  forall (k:Z) (n:Z) (i:Z), (0%Z <= n)%Z -> (0%Z >= i)%Z ->
  ((int_to_ang (k + (i * (power_ 2%Z n))%Z)%Z n) = (int_to_ang k n)).

Axiom int_to_ang_cycles_gen :
  forall (k:Z) (n:Z) (i:Z), (0%Z <= n)%Z ->
  ((int_to_ang (k + (i * (power_ 2%Z n))%Z)%Z n) = (int_to_ang k n)).

Axiom int_to_ang_cycles_zero :
  forall (n':Z) (n:Z), ((0%Z <= n)%Z /\ (n <= n')%Z) ->
  ((int_to_ang (power_ 2%Z n') n) = ang_zero).

Axiom int_to_ang_cycles_zero_mult :
  forall (k:Z) (n':Z) (n:Z), ((0%Z <= n)%Z /\ (n <= n')%Z) ->
  ((int_to_ang (k * (power_ 2%Z n'))%Z n) = ang_zero).

Axiom int_to_ang_cycles_zero_mult_ :
  forall (k:Z) (n':Z) (n:Z), ((0%Z <= n)%Z /\ (n <= n')%Z) ->
  ((int_to_ang (k * (power_ 2%Z n'))%Z n) = ang_zero).

Axiom int_to_ang_up :
  forall (k:Z) (n:Z) (n':Z), (0%Z <= n)%Z -> (0%Z <= n')%Z ->
  ((int_to_ang (k * (power_ 2%Z n'))%Z (n + n')%Z) = (int_to_ang k n)).

Axiom int_to_ang_mod :
  forall (k:Z) (n:Z), (0%Z <= n)%Z ->
  ((int_to_ang k n) =
   (int_to_ang (int.EuclideanDivision.mod1 k (power_ 2%Z n)) n)).

Axiom int_to_ang_equiv :
  forall (k1:Z) (k2:Z) (n1:Z) (n2:Z), (0%Z <= n1)%Z ->
  ((int.EuclideanDivision.mod1 k1 (power_ 2%Z n1)) =
   (int.EuclideanDivision.mod1 k2 (power_ 2%Z n1))) ->
  (n1 = n2) -> ((int_to_ang k1 n1) = (int_to_ang k2 n2)).

Axiom int_to_ang_red :
  forall (k:Z) (n:Z), (1%Z <= n)%Z -> ~ (0%Z = k) ->
  ((int.EuclideanDivision.mod1 k 2%Z) = 0%Z) ->
  ((int_to_ang k n) =
   (int_to_ang (int.EuclideanDivision.div k 2%Z) (n - 1%Z)%Z)).

Axiom int_to_ang_bin_rev :
  forall (n:Z) (i:Z) (j:Z), (0%Z <= n)%Z -> (0%Z <= i)%Z ->
  (j = (n - 1%Z)%Z) ->
  ((int_to_ang (-(i * (power_ 2%Z j))%Z)%Z n) =
   (int_to_ang (i * (power_ 2%Z (n - 1%Z)%Z))%Z n)).

Axiom int_to_ang_bin_rev_ :
  forall (n:Z) (i:Z) (j:Z), (0%Z <= n)%Z -> (0%Z <= i)%Z ->
  (j = (n - 1%Z)%Z) ->
  ((int_to_ang (-(i * (power_ 2%Z j))%Z)%Z n) =
   (int_to_ang (i * (power_ 2%Z (n - 1%Z)%Z))%Z n)).

Axiom int_to_ang_add_rev :
  forall (i:Z) (j:Z) (n:Z), (0%Z <= n)%Z ->
  ((int_to_ang (i + j)%Z n) = (ang_add (int_to_ang i n) (int_to_ang j n))).

Axiom int_to_ang_ind_isum_plus_one :
  forall (f:Z -> Z) (i:Z) (j:Z) (n:Z), (i < j)%Z -> (0%Z <= n)%Z ->
  ((int_to_ang (ind_isum f i j) n) =
   (ang_add (int_to_ang (f i) n) (int_to_ang (ind_isum f (i + 1%Z)%Z j) n))).

Axiom int_to_ang_ind_isum_plus_one_rev :
  forall (f:Z -> Z) (i:Z) (j:Z) (n:Z), (i < j)%Z -> (0%Z <= n)%Z ->
  ((int_to_ang (ind_isum f i j) n) =
   (ang_add (int_to_ang (ind_isum f (i + 1%Z)%Z j) n) (int_to_ang (f i) n))).

Axiom int_to_ang_ind_isum_right_extension :
  forall (f:Z -> Z) (i:Z) (j:Z) (n:Z), (i < j)%Z -> (0%Z <= n)%Z ->
  ((int_to_ang (ind_isum f i j) n) =
   (ang_add (int_to_ang (ind_isum f i (j - 1%Z)%Z) n)
    (int_to_ang (f (j - 1%Z)%Z) n))).

Axiom int_to_ang_ind_isum_right_extension_rev :
  forall (f:Z -> Z) (i:Z) (j:Z) (n:Z), (i < j)%Z -> (0%Z <= n)%Z ->
  ((int_to_ang (ind_isum f i j) n) =
   (ang_add (int_to_ang (f (j - 1%Z)%Z) n)
    (int_to_ang (ind_isum f i (j - 1%Z)%Z) n))).

Axiom minus_int_to_ang_ind_isum_plus_one :
  forall (f:Z -> Z) (i:Z) (j:Z) (n:Z), (i < j)%Z -> (0%Z <= n)%Z ->
  ((int_to_ang (-(ind_isum f i j))%Z n) =
   (ang_add (int_to_ang (-(f i))%Z n)
    (int_to_ang (-(ind_isum f (i + 1%Z)%Z j))%Z n))).

Axiom minus_int_to_ang_ind_isum_plus_one_rev :
  forall (f:Z -> Z) (i:Z) (j:Z) (n:Z), (i < j)%Z -> (0%Z <= n)%Z ->
  ((int_to_ang (-(ind_isum f i j))%Z n) =
   (ang_add (int_to_ang (-(ind_isum f (i + 1%Z)%Z j))%Z n)
    (int_to_ang (-(f i))%Z n))).

Axiom minus_int_to_ang_ind_isum_right_extension :
  forall (f:Z -> Z) (i:Z) (j:Z) (n:Z), (i < j)%Z -> (0%Z <= n)%Z ->
  ((int_to_ang (-(ind_isum f i j))%Z n) =
   (ang_add (int_to_ang (-(ind_isum f i (j - 1%Z)%Z))%Z n)
    (int_to_ang (-(f (j - 1%Z)%Z))%Z n))).

Axiom minus_int_to_ang_ind_isum_right_extension_rev :
  forall (f:Z -> Z) (i:Z) (j:Z) (n:Z), (i < j)%Z -> (0%Z <= n)%Z ->
  ((int_to_ang (-(ind_isum f i j))%Z n) =
   (ang_add (int_to_ang (-(f (j - 1%Z)%Z))%Z n)
    (int_to_ang (-(ind_isum f i (j - 1%Z)%Z))%Z n))).

Axiom int_to_ang_simpl :
  forall (k:Z) (n1:Z) (n2:Z), (n1 >= 0%Z)%Z -> (n2 >= 0%Z)%Z ->
  ((int_to_ang (k * (power_ 2%Z n1))%Z (n2 + n1)%Z) = (int_to_ang k n2)).

Axiom ang_add_eq :
  forall (d1:angle) (d2:angle) (e1:angle) (e2:angle), (d1 = e1) ->
  (d2 = e2) -> ((ang_add d1 d2) = (ang_add e1 e2)).

Axiom ang_add_comm :
  forall (d1:angle) (d2:angle), ((ang_add d1 d2) = (ang_add d2 d1)).

Axiom ang_add_eq_comm :
  forall (d1:angle) (d2:angle) (d3:angle) (d4:angle), (d1 = d3) ->
  (d2 = d4) -> ((ang_add d1 d2) = (ang_add d4 d3)).

Axiom ang_mult_int_zero :
  forall (theta:angle), ((ang_mult_int theta 0%Z) = ang_zero).

Axiom ang_div :
  forall (k:Z) (n:Z) (i:Z), (n >= 0%Z)%Z -> (i >= 0%Z)%Z ->
  ((int_to_ang k n) = (ang_mult_int (int_to_ang k (n + i)%Z) (power_ 2%Z i))).

Axiom ang_zero_add :
  forall (d':angle) (d:angle), (d' = ang_zero) -> ((ang_add d' d) = d).

Axiom int_to_ang_rev :
  forall (k:Z) (l:Z) (n:Z) (m:Z), (0%Z < n)%Z -> (0%Z <= k)%Z ->
  (n = (m + 1%Z)%Z) ->
  ((int_to_ang (((-k)%Z * l)%Z * (power_ 2%Z m))%Z n) =
   (int_to_ang ((k * l)%Z * (power_ 2%Z m))%Z n)).

Axiom int_to_ang_rev_ :
  forall (k:Z) (l:Z) (n:Z) (m:Z), (0%Z < n)%Z -> (0%Z <= k)%Z ->
  (0%Z <= l)%Z -> (n = (m + 1%Z)%Z) ->
  ((int_to_ang (((-k)%Z * l)%Z * (power_ 2%Z m))%Z n) =
   (int_to_ang ((k * l)%Z * (power_ 2%Z m))%Z n)).

Axiom ang_add_zero_d :
  forall (d':angle) (d:angle), (d' = ang_zero) -> ((ang_add d d') = d).

Axiom real_to_ang_distr_minus :
  forall (x:complex) (z:complex) (t:complex), forall (y:Z), (real_ x) ->
  (real_ z) -> (real_ t) ->
  ((ang_add (real_to_ang (infix_asdt x (i_to_c y)))
    (real_to_ang (infix_asdt (infix_asdt (i_to_c y) (prefix_mndt z)) t)))
   = (ang_mult_int (real_to_ang (infix_mndt x (infix_asdt z t))) y)).

Axiom ang_mult_int_exp_pos :
  forall (o:angle) (i:Z), (0%Z <= i)%Z ->
  ((ang_exp (ang_mult_int o i)) = (cpower (ang_exp o) i)).

Axiom ang_mult_int_exp :
  forall (o:angle) (i:Z),
  ((ang_exp (ang_mult_int o i)) = (cpower (ang_exp o) i)).

Axiom ang_mult_int_exp_rev :
  forall (o:angle) (i:Z),
  ((cpower (ang_exp o) i) = (ang_exp (ang_mult_int o i))).

Axiom cpower_ang_exp_real :
  forall (x:complex) (i:Z), (real_ x) ->
  ((cpower (ang_exp (real_to_ang x)) i) =
   (ang_exp (real_to_ang (infix_asdt x (i_to_c i))))).

Axiom ang_mult_int_add :
  forall (o:angle) (i:Z) (i':Z),
  ((ang_mult_int o (i + i')%Z) =
   (ang_add (ang_mult_int o i) (ang_mult_int o i'))).

Axiom ang_mult_int_plus_one :
  forall (o:angle) (i:Z),
  ((ang_add o (ang_mult_int o i)) = (ang_mult_int o (i + 1%Z)%Z)).

Axiom ang_mult_int_plus_one_rev :
  forall (o:angle) (i:Z),
  ((ang_mult_int o (1%Z + i)%Z) = (ang_add o (ang_mult_int o i))).

Axiom ang_mult_int_double :
  forall (o:angle) (i:Z),
  ((ang_mult_int o (2%Z * i)%Z) =
   (ang_add (ang_mult_int o i) (ang_mult_int o i))).

Axiom ang_mult_int_inv_one :
  forall (o:angle), ((ang_mult_int o (-1%Z)%Z) = (ang_inv o)).

Axiom ang_mult_int_one :
  forall (o:angle) (n:Z), (n = 1%Z) -> ((ang_mult_int o n) = o).

Axiom ang_mult_int_inv_rev :
  forall (o:angle), ((ang_inv o) = (ang_mult_int o (-1%Z)%Z)).

Axiom ang_mult_int_comp :
  forall (o:angle) (i:Z) (j:Z),
  ((ang_mult_int (ang_mult_int o i) j) = (ang_mult_int o (i * j)%Z)).

Axiom ang_mult_int_comp_rev :
  forall (o:angle) (i:Z) (j:Z),
  ((ang_mult_int o (i * j)%Z) = (ang_mult_int (ang_mult_int o i) j)).

Axiom add_ang_mult_int_pos :
  forall (o:angle) (o':angle) (i:Z), (0%Z <= i)%Z ->
  ((ang_add (ang_mult_int o i) (ang_mult_int o' i)) =
   (ang_mult_int (ang_add o o') i)).

Axiom add_ang_mult_int :
  forall (o:angle) (o':angle) (i:Z),
  ((ang_add (ang_mult_int o i) (ang_mult_int o' i)) =
   (ang_mult_int (ang_add o o') i)).

Parameter ang_substr: angle -> angle -> angle.

Axiom ang_substr_def :
  forall (o:angle) (o':angle), ((ang_substr o o') = (ang_add o (ang_inv o'))).

Axiom ang_substr_inv :
  forall (o:angle) (o':angle),
  ((ang_substr o (ang_mult_int o' (-1%Z)%Z)) = (ang_add o o')).

Axiom ang_mult_int_distr :
  forall (o:angle) (o':angle) (n:Z),
  ((ang_mult_int (ang_add o o') n) =
   (ang_add (ang_mult_int o n) (ang_mult_int o' n))).

Axiom ang_mult_int_distr_rev :
  forall (o:angle) (n1:Z) (n2:Z),
  ((ang_add (ang_mult_int o n1) (ang_mult_int o n2)) =
   (ang_mult_int o (n1 + n2)%Z)).

Axiom ang_add_assoc :
  forall (o:angle) (o':angle) (o'':angle),
  ((ang_add o (ang_add o' o'')) = (ang_add (ang_add o o') o'')).

Axiom ang_add_assoc_rev :
  forall (o:angle) (o':angle) (o'':angle),
  ((ang_add (ang_add o o') o'') = (ang_add o (ang_add o' o''))).

Axiom ang_add_own_inv :
  forall (o:angle), ((ang_add (ang_mult_int o (-1%Z)%Z) o) = ang_zero).

Axiom ang_exp_inv :
  forall (o:angle), ((ang_exp (ang_inv o)) = (conjugate (ang_exp o))).

Parameter constant_size:
  forall {a:Type} {a_WT:WhyType a}, (set a) -> (a -> matrix complex) -> Prop.

Axiom constant_size_def :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex), (constant_size s f) ->
  forall (e1:a), (mem e1 s) -> ((rows (f e1)) = (rows (f (choose s)))).

Axiom constant_size_def1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex), (constant_size s f) ->
  forall (e1:a), (mem e1 s) -> ((columns (f e1)) = (columns (f (choose s)))).

Axiom constant_size_def2 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex),
  (forall (e1:a), (mem e1 s) ->
   ((rows (f e1)) = (rows (f (choose s)))) /\
   ((columns (f e1)) = (columns (f (choose s))))) ->
  constant_size s f.

Axiom set_constant_size :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex),
  (forall (e1:a) (e':a), (mem e1 s) -> (mem e' s) ->
   ((rows (f e1)) = (rows (f e')))) ->
  (forall (e1:a) (e':a), (mem e1 s) -> (mem e' s) ->
   ((columns (f e1)) = (columns (f e')))) ->
  constant_size s f.

Axiom set_constant_size_exists :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex),
  (exists r:Z, forall (e1:a), (mem e1 s) -> ((rows (f e1)) = r)) ->
  (exists c:Z, forall (e1:a), (mem e1 s) -> ((columns (f e1)) = c)) ->
  constant_size s f.

Axiom set_constant_size_t :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (r:Z) (c:Z),
  (forall (e1:a), (mem e1 s) -> ((rows (f e1)) = r)) ->
  (forall (e1:a), (mem e1 s) -> ((columns (f e1)) = c)) -> constant_size s f.

Parameter fc5:
  forall {a:Type} {a_WT:WhyType a}, (a -> matrix complex) -> (a -> bool) ->
  (matrix complex) -> a -> matrix complex.

Axiom fc_def5 :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:a -> matrix complex) (p:a -> bool) (m:matrix complex) (j:a),
  (((p j) = true) -> (((fc5 f p m) j) = (f j))) /\
  (~ ((p j) = true) -> (((fc5 f p m) j) = m)).

Axiom guarded_set_constant_size :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (p:a -> bool) (m:matrix complex),
  (constant_size s f) -> (forall (e1:a), (mem e1 s) -> ((p e1) = true)) ->
  constant_size s (fc5 f p m).

Axiom set_constant_size_set :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> complex) (m:matrix complex) (i:Z) (j:Z),
  (valid_index m i j) -> constant_size s (fun (e1:a) => (set1 m i j (f e1))).

Axiom get_constant_size :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex), (constant_size s f) ->
  forall (e1:a) (e':a), (mem e1 s) -> (mem e' s) ->
  ((rows (f e1)) = (rows (f e'))).

Axiom get_constant_size1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex), (constant_size s f) ->
  forall (e1:a) (e':a), (mem e1 s) -> (mem e' s) ->
  ((columns (f e1)) = (columns (f e'))).

Parameter s_rows:
  forall {a:Type} {a_WT:WhyType a}, (set a) -> (a -> matrix complex) -> Z.

Axiom s_rows_def :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex), (constant_size s f) ->
  ((s_rows s f) = (rows (f (choose s)))).

Axiom s_rows_spec :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex), (constant_size s f) ->
  (0%Z < (s_rows s f))%Z.

Axiom s_rows_spec1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex), (constant_size s f) ->
  forall (e1:a), (mem e1 s) -> ((rows (f e1)) = (s_rows s f)).

Axiom s_rows_spec2 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex), (constant_size s f) ->
  forall (e1:a) (e':a), (mem e1 s) -> (mem e' s) ->
  ((rows (f e1)) = (rows (f e'))).

Parameter s_columns:
  forall {a:Type} {a_WT:WhyType a}, (set a) -> (a -> matrix complex) -> Z.

Axiom s_columns_def :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex), (constant_size s f) ->
  ((s_columns s f) = (columns (f (choose s)))).

Axiom s_columns_spec :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex), (constant_size s f) ->
  (0%Z < (s_columns s f))%Z.

Axiom s_columns_spec1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex), (constant_size s f) ->
  forall (e1:a), (mem e1 s) -> ((columns (f e1)) = (s_columns s f)).

Axiom s_columns_spec2 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex), (constant_size s f) ->
  forall (e1:a) (e':a), (mem e1 s) -> (mem e' s) ->
  ((columns (f e1)) = (columns (f e'))).

Axiom set_s_rows :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (r:Z), (constant_size s f) ->
  ((rows (f (choose s))) = r) -> ((s_rows s f) = r).

Axiom set_s_rows_elt :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (elt:a), (constant_size s f) ->
  (mem elt s) -> ((s_rows s f) = (rows (f elt))).

Axiom set_s_columns :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (r:Z), (constant_size s f) ->
  ((columns (f (choose s))) = r) -> ((s_columns s f) = r).

Axiom set_s_columns_elt :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (elt:a), (constant_size s f) ->
  (mem elt s) -> ((s_columns s f) = (columns (f elt))).

Axiom s_rows_eq :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (g:a -> matrix complex),
  (constant_size s f) -> ((cardinal s) > 0%Z)%Z ->
  (forall (e1:a), (mem e1 s) -> ((f e1) = (g e1))) ->
  ((s_rows s f) = (s_rows s g)).

Axiom set_constant_size_give :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (r:Z) (c:Z),
  ((cardinal s) > 0%Z)%Z ->
  (forall (e1:a), (mem e1 s) -> ((rows (f e1)) = r)) ->
  (forall (e1:a), (mem e1 s) -> ((columns (f e1)) = c)) -> constant_size s f.

Axiom set_constant_size_give1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (r:Z) (c:Z),
  ((cardinal s) > 0%Z)%Z ->
  (forall (e1:a), (mem e1 s) -> ((rows (f e1)) = r)) ->
  (forall (e1:a), (mem e1 s) -> ((columns (f e1)) = c)) -> forall (e1:a),
  (mem e1 s) -> ((rows (f e1)) = r).

Axiom set_constant_size_give2 : True.

Axiom set_constant_size_give3 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (r:Z) (c:Z),
  ((cardinal s) > 0%Z)%Z ->
  (forall (e1:a), (mem e1 s) -> ((rows (f e1)) = r)) ->
  (forall (e1:a), (mem e1 s) -> ((columns (f e1)) = c)) -> ((s_rows s f) = r).

Axiom set_constant_size_give4 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (r:Z) (c:Z),
  ((cardinal s) > 0%Z)%Z ->
  (forall (e1:a), (mem e1 s) -> ((rows (f e1)) = r)) ->
  (forall (e1:a), (mem e1 s) -> ((columns (f e1)) = c)) ->
  ((s_columns s f) = c).

Axiom s_columns_eq :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (g:a -> matrix complex),
  (constant_size s f) -> ((cardinal s) > 0%Z)%Z ->
  (forall (e1:a), (mem e1 s) -> ((f e1) = (g e1))) ->
  ((s_columns s f) = (s_columns s g)).

Axiom subset_constant_size :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s':set a) (f:a -> matrix complex), (constant_size s f) ->
  ~ (is_empty s') -> (subset s' s) -> constant_size s' f.

Axiom subset_constant_size1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s':set a) (f:a -> matrix complex), (constant_size s f) ->
  ~ (is_empty s') -> (subset s' s) -> ((s_rows s' f) = (s_rows s f)).

Axiom subset_constant_size2 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s':set a) (f:a -> matrix complex), (constant_size s f) ->
  ~ (is_empty s') -> (subset s' s) -> ((s_columns s' f) = (s_columns s f)).

Axiom set_s_rows_rem :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex), ((cardinal s) > 1%Z)%Z ->
  (constant_size s f) -> constant_size (remove (choose s) s) f.

Axiom set_s_rows_rem1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex), ((cardinal s) > 1%Z)%Z ->
  (constant_size s f) ->
  ((s_rows (remove (choose s) s) f) = (rows (f (choose s)))).

Axiom set_s_columns_rem :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex), ((cardinal s) > 1%Z)%Z ->
  (constant_size s f) -> constant_size (remove (choose s) s) f.

Axiom set_s_columns_rem1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex), ((cardinal s) > 1%Z)%Z ->
  (constant_size s f) ->
  ((s_columns (remove (choose s) s) f) = (columns (f (choose s)))).

Axiom set_s_rows_add :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (x:a), ((cardinal s) > 0%Z)%Z ->
  (constant_size s f) -> ((columns (f x)) = (s_columns s f)) ->
  ((rows (f x)) = (s_rows s f)) -> ((s_rows (add x s) f) = (s_rows s f)).

Axiom set_s_columns_add :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (x:a), ((cardinal s) > 0%Z)%Z ->
  (constant_size s f) -> ((columns (f x)) = (s_columns s f)) ->
  ((rows (f x)) = (s_rows s f)) ->
  ((s_columns (add x s) f) = (s_columns s f)).

Axiom set_s_rows_columns_add :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (x:a), ((cardinal s) > 0%Z)%Z ->
  (constant_size s f) -> ((columns (f x)) = (s_columns s f)) ->
  ((rows (f x)) = (s_rows s f)) ->
  ((s_columns (add x s) f) = (s_columns s f)).

Axiom set_s_rows_columns_add1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (x:a), ((cardinal s) > 0%Z)%Z ->
  (constant_size s f) -> ((columns (f x)) = (s_columns s f)) ->
  ((rows (f x)) = (s_rows s f)) -> ((s_rows (add x s) f) = (s_rows s f)).

Parameter mat_sum:
  forall {a:Type} {a_WT:WhyType a}, (set a) -> (a -> matrix complex) ->
  matrix complex.

Axiom mat_sum_def :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex), (constant_size s f) ->
  ((cardinal s) > 0%Z)%Z -> ((cardinal s) = 1%Z) ->
  ((mat_sum s f) = (f (element s))).

Axiom mat_sum_def1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex), (constant_size s f) ->
  ((cardinal s) > 0%Z)%Z -> ~ ((cardinal s) = 1%Z) ->
  ((mat_sum s f) =
   (add_mat (f (choose s)) (mat_sum (remove (choose s) s) f))).

Axiom mat_sum_spec :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex), (constant_size s f) ->
  ((cardinal s) > 0%Z)%Z -> ((rows (mat_sum s f)) = (s_rows s f)).

Axiom mat_sum_spec1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex), (constant_size s f) ->
  ((cardinal s) > 0%Z)%Z -> ((columns (mat_sum s f)) = (s_columns s f)).

Axiom mat_sum_spec2 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex), (constant_size s f) ->
  ((cardinal s) > 0%Z)%Z -> forall (e1:a), (mem e1 s) ->
  ((rows (f e1)) = (s_rows s f)).

Axiom mat_sum_spec3 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex), (constant_size s f) ->
  ((cardinal s) > 0%Z)%Z -> forall (e1:a), (mem e1 s) ->
  ((columns (f e1)) = (s_columns s f)).

Axiom columns_mat_sum :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (n:Z), ~ ((cardinal s) = 0%Z) ->
  (constant_size s f) ->
  (forall (e1:a), (mem e1 s) -> ((columns (f e1)) = n)) ->
  ((columns (mat_sum s f)) = n).

Axiom rows_mat_sum :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (n:Z), ~ ((cardinal s) = 0%Z) ->
  (constant_size s f) ->
  (forall (e1:a), (mem e1 s) -> ((rows (f e1)) = n)) ->
  ((rows (mat_sum s f)) = n).

Axiom mat_sum_cardone :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex), ((cardinal s) = 1%Z) ->
  ((mat_sum s f) = (f (element s))).

Axiom mat_sum_to_sum_pre :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (i:Z) (j:Z),
  (constant_size s f) -> ((cardinal s) > 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (s_rows s f))%Z) ->
  ((0%Z <= j)%Z /\ (j < (s_columns s f))%Z) ->
  ((get (mat_sum s f) i j) = (sum s (fun (e1:a) => (get (f e1) i j)))).

Axiom mat_sum_to_sum :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex), (constant_size s f) ->
  ((cardinal s) > 0%Z)%Z ->
  ((mat_sum s f) =
   (make_f (s_rows s f) (s_columns s f)
    (fun (i:Z) (j:Z) => (sum s (fun (e1:a) => (get (f e1) i j)))))).

Axiom mat_sum_value :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (i:Z) (j:Z),
  (constant_size s f) -> ((cardinal s) > 0%Z)%Z ->
  (valid_index (mat_sum s f) i j) ->
  ((get (mat_sum s f) i j) = (sum s (fun (e1:a) => (get (f e1) i j)))).

Axiom mat_sum_add :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (x:a), ((cardinal s) > 0%Z)%Z ->
  (constant_size s f) -> ((rows (f x)) = (s_rows s f)) ->
  ((columns (f x)) = (s_columns s f)) -> ~ (mem x s) ->
  ((mat_sum (add x s) f) = (add_mat (f x) (mat_sum s f))).

Axiom mat_sum_plus_one :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex), ((cardinal s) > 1%Z)%Z ->
  (constant_size s f) ->
  ((mat_sum s f) =
   (add_mat (f (choose s)) (mat_sum (remove (choose s) s) f))).

Axiom mat_sum_comp_pre :
  forall {b:Type} {b_WT:WhyType b},
  forall (s:set b) (f:b -> matrix complex) (g:b -> matrix complex) (i:Z)
    (j:Z),
  (constant_size s f) -> (constant_size s g) ->
  ((0%Z <= i)%Z /\ (i < (s_rows s f))%Z) ->
  ((0%Z <= j)%Z /\ (j < (s_columns s f))%Z) ->
  ((s_rows s f) = (s_rows s g)) -> ((s_columns s f) = (s_columns s g)) ->
  ((cardinal s) > 0%Z)%Z ->
  ((get (mat_sum s (fun (k:b) => (add_mat (f k) (g k)))) i j) =
   (get (add_mat (mat_sum s f) (mat_sum s g)) i j)).

Axiom mat_sum_comp :
  forall {b:Type} {b_WT:WhyType b},
  forall (s:set b) (f:b -> matrix complex) (g:b -> matrix complex),
  (constant_size s f) -> (constant_size s g) ->
  ((s_rows s f) = (s_rows s g)) -> ((s_columns s f) = (s_columns s g)) ->
  ((cardinal s) > 0%Z)%Z ->
  ((mat_sum s (fun (k:b) => (add_mat (f k) (g k)))) =
   (add_mat (mat_sum s f) (mat_sum s g))).

Axiom mat_sum_comp_rec :
  forall {b:Type} {b_WT:WhyType b},
  forall (s:set b) (f:b -> matrix complex) (g:b -> matrix complex),
  (constant_size s f) -> (constant_size s g) ->
  ((s_rows s f) = (s_rows s g)) -> ((s_columns s f) = (s_columns s g)) ->
  ((cardinal s) > 0%Z)%Z ->
  ((add_mat (mat_sum s f) (mat_sum s g)) =
   (mat_sum s (fun (k:b) => (add_mat (f k) (g k))))).

Axiom mat_sum_to_sum_fun :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s:set a) (s':set b) (f:a -> b -> matrix complex) (r:Z) (c:Z)
    (i:Z) (j:Z),
  ((cardinal s) > 0%Z)%Z -> ((cardinal s') > 0%Z)%Z ->
  (forall (e1:a), forall (e11:b), (mem e1 s) -> (mem e11 s') ->
   ((rows ((f e1) e11)) = r)) ->
  (forall (e1:a), forall (e11:b), (mem e1 s) -> (mem e11 s') ->
   ((columns ((f e1) e11)) = c)) ->
  ((0%Z <= i)%Z /\ (i < r)%Z) -> ((0%Z <= j)%Z /\ (j < c)%Z) ->
  ((sum s (fun (e1:a) => (get (mat_sum s' (f e1)) i j))) =
   (sum s (fun (e1:a) => (sum s' (fun (e11:b) => (get ((f e1) e11) i j)))))).

Axiom mat_sum_to_sum_double_pre :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s:set a) (s':set b) (f:a -> b -> matrix complex) (r:Z) (c:Z)
    (i:Z) (j:Z),
  (forall (e1:a) (e':b), (mem e1 s) -> (mem e' s') ->
   ((rows ((f e1) e')) = r)) ->
  (forall (e1:a) (e':b), (mem e1 s) -> (mem e' s') ->
   ((columns ((f e1) e')) = c)) ->
  ((0%Z <= i)%Z /\ (i < r)%Z) -> ((0%Z <= j)%Z /\ (j < c)%Z) ->
  ((cardinal s) > 0%Z)%Z -> ((cardinal s') > 0%Z)%Z ->
  ((get (mat_sum s (fun (e1:a) => (mat_sum s' (f e1)))) i j) =
   (sum s (fun (e1:a) => (sum s' (fun (e':b) => (get ((f e1) e') i j)))))).

Axiom mat_mult_sum_out_l :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (n:matrix complex),
  ((cardinal s) > 0%Z)%Z ->
  (forall (e1:a), (mem e1 s) -> ((columns (f e1)) = (rows n))) ->
  (exists r:Z, forall (e1:a), (mem e1 s) -> ((rows (f e1)) = r)) ->
  ((mat_mult (mat_sum s f) n) =
   (mat_sum s (fun (e1:a) => (mat_mult (f e1) n)))).

Parameter mat_sum_dim:
  forall {a:Type} {a_WT:WhyType a}, (set a) -> (a -> matrix complex) ->
  Z -> Z -> matrix complex.

Axiom mat_sum_dim_def :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (r:Z) (c:Z), (0%Z < r)%Z ->
  (0%Z < c)%Z -> (forall (e1:a), (mem e1 s) -> ((rows (f e1)) = r)) ->
  (forall (e1:a), (mem e1 s) -> ((columns (f e1)) = c)) ->
  ((cardinal s) = 0%Z) -> ((mat_sum_dim s f r c) = (make r c c_zero)).

Axiom mat_sum_dim_def1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (r:Z) (c:Z), (0%Z < r)%Z ->
  (0%Z < c)%Z -> (forall (e1:a), (mem e1 s) -> ((rows (f e1)) = r)) ->
  (forall (e1:a), (mem e1 s) -> ((columns (f e1)) = c)) ->
  ~ ((cardinal s) = 0%Z) -> ((mat_sum_dim s f r c) = (mat_sum s f)).

Axiom mat_sum_dim_spec :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (r:Z) (c:Z), (0%Z < r)%Z ->
  (0%Z < c)%Z -> (forall (e1:a), (mem e1 s) -> ((rows (f e1)) = r)) ->
  (forall (e1:a), (mem e1 s) -> ((columns (f e1)) = c)) ->
  ((cardinal s) > 0%Z)%Z -> ((mat_sum_dim s f r c) = (mat_sum s f)).

Axiom mat_sum_dim_spec1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (r:Z) (c:Z), (0%Z < r)%Z ->
  (0%Z < c)%Z -> (forall (e1:a), (mem e1 s) -> ((rows (f e1)) = r)) ->
  (forall (e1:a), (mem e1 s) -> ((columns (f e1)) = c)) ->
  ((cardinal s) = 0%Z) -> ((mat_sum_dim s f r c) = (make r c c_zero)).

Axiom mat_sum_dim_spec2 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (r:Z) (c:Z), (0%Z < r)%Z ->
  (0%Z < c)%Z -> (forall (e1:a), (mem e1 s) -> ((rows (f e1)) = r)) ->
  (forall (e1:a), (mem e1 s) -> ((columns (f e1)) = c)) ->
  ((rows (mat_sum_dim s f r c)) = r).

Axiom mat_sum_dim_spec3 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (r:Z) (c:Z), (0%Z < r)%Z ->
  (0%Z < c)%Z -> (forall (e1:a), (mem e1 s) -> ((rows (f e1)) = r)) ->
  (forall (e1:a), (mem e1 s) -> ((columns (f e1)) = c)) ->
  ((columns (mat_sum_dim s f r c)) = c).

Axiom mat_sum_dim_to_mat_sum :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (r:Z) (c:Z),
  ((cardinal s) > 0%Z)%Z -> (0%Z < r)%Z -> (0%Z < c)%Z ->
  (forall (e1:a), (mem e1 s) -> ((rows (f e1)) = r)) ->
  (forall (e1:a), (mem e1 s) -> ((columns (f e1)) = c)) ->
  ((mat_sum_dim s f r c) = (mat_sum s f)).

Axiom mat_sum_dim_to_make_zero :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (r:Z) (c:Z),
  ((cardinal s) = 0%Z) ->
  (forall (e1:a), (mem e1 s) -> ((rows (f e1)) = r)) ->
  (forall (e1:a), (mem e1 s) -> ((columns (f e1)) = c)) -> (0%Z < r)%Z ->
  (0%Z < c)%Z -> ((mat_sum_dim s f r c) = (make r c c_zero)).

Axiom mat_sum_dim_add :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (x:a) (r:Z) (c:Z),
  ((cardinal s) >= 0%Z)%Z -> ~ (mem x s) ->
  (forall (e1:a), (mem e1 (add x s)) -> ((rows (f e1)) = r)) ->
  (forall (e1:a), (mem e1 (add x s)) -> ((columns (f e1)) = c)) ->
  (0%Z < r)%Z -> (0%Z < c)%Z ->
  ((mat_sum_dim (add x s) f r c) = (add_mat (f x) (mat_sum_dim s f r c))).

Axiom mat_sum_scalar :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (a1:complex),
  (constant_size s f) -> ((cardinal s) > 0%Z)%Z ->
  ((mat_sum s (fun (k:a) => (infix_asdtdt a1 (f k)))) =
   (infix_asdtdt a1 (mat_sum s f))).

Axiom mat_sum_scalar_rev :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (a1:complex),
  (constant_size s f) -> ((cardinal s) > 0%Z)%Z ->
  ((infix_asdtdt a1 (mat_sum s f)) =
   (mat_sum s (fun (k:a) => (infix_asdtdt a1 (f k))))).

Axiom mat_sum_const :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (x:matrix complex), ((cardinal s) > 0%Z)%Z ->
  ((mat_sum s (fun (us:a) => x)) = (infix_asdtdt (i_to_c (cardinal s)) x)).

Axiom mat_sum_quot :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (x:matrix complex), ((cardinal s) > 0%Z)%Z ->
  (x =
   (infix_asdtdt (infix_sldt c_one (i_to_c (cardinal s)))
    (mat_sum s (fun (us:a) => x)))).

Axiom mat_sum_scalar_right :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (m:matrix complex) (i:Z) (j:Z),
  (constant_size s f) -> ((cardinal s) > 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (s_rows s f))%Z) ->
  ((0%Z <= j)%Z /\ (j < (s_columns s f))%Z) ->
  ((infix_asdtdt (get (mat_sum s f) i j) m) =
   (mat_sum s (fun (k:a) => (infix_asdtdt (get (f k) i j) m)))).

Axiom mat_sum_eq :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (g:a -> matrix complex),
  ((cardinal s) > 0%Z)%Z -> (constant_size s f) ->
  (forall (a1:a), (mem a1 s) -> ((f a1) = (g a1))) ->
  ((mat_sum s f) = (mat_sum s g)).

Axiom mat_sum_eq_gen :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s':set a) (f:a -> matrix complex) (g:a -> matrix complex),
  ((cardinal s) > 0%Z)%Z -> (s = s') -> (constant_size s f) ->
  (forall (a1:a), (mem a1 s) -> ((f a1) = (g a1))) ->
  ((mat_sum s f) = (mat_sum s' g)).

Axiom mat_sum_eq_gen_int :
  forall (i1:Z) (i2:Z) (o1:Z) (o2:Z) (f:Z -> matrix complex)
    (g:Z -> matrix complex),
  (i1 < o1)%Z -> (i1 = o1) -> (i2 = o2) ->
  (constant_size (to_fset i1 o1) f) ->
  (forall (a:Z), (mem a (to_fset i1 o1)) -> ((f a) = (g a))) ->
  ((mat_sum (to_fset i1 o1) f) = (mat_sum (to_fset i2 o2) g)).

Axiom mat_sum_comp_eq :
  forall {b:Type} {b_WT:WhyType b},
  forall (s:set b) (f:b -> matrix complex) (g:b -> matrix complex)
    (h:b -> matrix complex),
  (constant_size s f) -> (constant_size s g) -> (constant_size s h) ->
  (((s_rows s f) = (s_rows s g)) /\ ((s_rows s g) = (s_rows s h))) ->
  (((s_columns s f) = (s_columns s g)) /\
   ((s_columns s g) = (s_columns s h))) ->
  ((cardinal s) > 0%Z)%Z ->
  (forall (e1:b), forall (i:Z) (j:Z), (mem e1 s) ->
   ((0%Z <= i)%Z /\ (i < (s_rows s f))%Z) ->
   ((0%Z <= j)%Z /\ (j < (s_columns s f))%Z) ->
   ((infix_pldt (get (f e1) i j) (get (g e1) i j)) = (get (h e1) i j))) ->
  ((add_mat (mat_sum s f) (mat_sum s g)) = (mat_sum s h)).

Axiom mat_sum_dim_eq :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (g:a -> matrix complex) (r:Z)
    (c:Z),
  (0%Z < r)%Z -> (0%Z < c)%Z ->
  (forall (e1:a), (mem e1 s) -> ((rows (f e1)) = r)) ->
  (forall (e1:a), (mem e1 s) -> ((columns (f e1)) = c)) ->
  (forall (e1:a), (mem e1 s) -> ((f e1) = (g e1))) ->
  ((mat_sum_dim s f r c) = (mat_sum_dim s g r c)).

Axiom constant_size_map :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:b -> matrix complex) (s:set a) (t:a -> b),
  (constant_size s (fun (a1:a) => (f (t a1)))) -> constant_size (map t s) f.

Axiom map_mat_sum :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:b -> matrix complex) (s:set a) (t:a -> b),
  ((cardinal s) > 0%Z)%Z -> (constant_size s (fun (a1:a) => (f (t a1)))) ->
  (p_injective t s) ->
  ((mat_sum (map t s) f) = (mat_sum s (fun (a1:a) => (f (t a1))))).

Axiom map_mat_sum_rec :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:b -> matrix complex) (s:set a) (t:a -> b),
  ((cardinal s) > 0%Z)%Z -> (constant_size s (fun (a1:a) => (f (t a1)))) ->
  (p_injective t s) ->
  ((mat_sum s (fun (a1:a) => (f (t a1)))) = (mat_sum (map t s) f)).

Axiom mat_sum_id :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:a -> matrix complex) (s:set a), ((cardinal s) > 0%Z)%Z ->
  (constant_size s f) ->
  (constant_size (map f s) (fun (y0:matrix complex) => (p_id y0))) ->
  (p_injective f s) ->
  ((mat_sum (map f s) (fun (y0:matrix complex) => (p_id y0))) =
   (mat_sum s f)).

Parameter nonn_mat_subset:
  forall {a:Type} {a_WT:WhyType a}, (a -> matrix complex) -> (set a) ->
  set a.

Parameter result10:
  forall {a:Type} {a_WT:WhyType a}, (a -> matrix complex) -> (set a) ->
  a -> bool.

Axiom result_def10 :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:a -> matrix complex) (s:set a) (e1:a),
  (((result10 f s) e1) = true) <->
  ~ (equal (f e1) (make (s_rows s f) (s_columns s f) c_zero)).

Axiom nonn_mat_subset_def :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:a -> matrix complex) (s:set a), (constant_size s f) ->
  ((nonn_mat_subset f s) = (filter (result10 f s) s)).

Axiom nonn_mat_subset_spec :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:a -> matrix complex) (s:set a), (constant_size s f) ->
  subset (nonn_mat_subset f s) s.

Axiom nonn_mat_subset_spec1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:a -> matrix complex) (s:set a), (constant_size s f) ->
  forall (e1:a), (mem e1 (nonn_mat_subset f s)) -> mem e1 s.

Axiom nonn_mat_subset_spec2 :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:a -> matrix complex) (s:set a), (constant_size s f) ->
  constant_size (nonn_mat_subset f s) f.

Axiom nonn_mat_subset_spec3 :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:a -> matrix complex) (s:set a), (constant_size s f) ->
  ~ ((nonn_mat_subset f s) = (empty : set a)) ->
  ((s_rows (nonn_mat_subset f s) f) = (s_rows s f)).

Axiom nonn_mat_subset_spec4 :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:a -> matrix complex) (s:set a), (constant_size s f) ->
  ~ ((nonn_mat_subset f s) = (empty : set a)) ->
  ((s_columns (nonn_mat_subset f s) f) = (s_columns s f)).

Axiom mat_subset_elt :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:a -> matrix complex) (s:set a), (constant_size s f) ->
  forall (e1:a), (mem e1 (nonn_mat_subset f s)) -> mem e1 s.

Axiom mat_subset_nonn_elt :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:a -> matrix complex) (s:set a), (constant_size s f) ->
  forall (e1:a), (mem e1 (nonn_mat_subset f s)) ->
  ~ ((f e1) = (make (s_rows s f) (s_columns s f) c_zero)).

Axiom nonn_mat_sum_cardzero :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:a -> matrix complex) (s:set a) (r:Z) (c:Z),
  ((cardinal s) = 0%Z) -> (r > 0%Z)%Z -> (c > 0%Z)%Z ->
  ((mat_sum_dim s f r c) = (mat_sum_dim (nonn_mat_subset f s) f r c)).

Axiom nonn_mat_sum_cardone :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:a -> matrix complex) (s:set a) (r:Z) (c:Z),
  ((cardinal s) = 1%Z) -> (r > 0%Z)%Z -> (c > 0%Z)%Z ->
  ((rows (f (choose s))) = r) -> ((columns (f (choose s))) = c) ->
  ((mat_sum_dim s f r c) = (mat_sum_dim (nonn_mat_subset f s) f r c)).

Axiom mat_sum_null_but_maybe_one_elt :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:a -> matrix complex) (s:set a) (e1:a), ((cardinal s) > 1%Z)%Z ->
  (constant_size s f) -> (mem e1 s) ->
  (forall (e':a), (mem e' s) -> ~ (e1 = e') -> null_mat (f e')) ->
  ((mat_sum s f) = (f e1)).

Axiom nonn_mat_sum_plus_one :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:a -> matrix complex) (s:set a) (r:Z) (c:Z),
  ((cardinal s) > 1%Z)%Z -> (r > 0%Z)%Z -> (c > 0%Z)%Z ->
  (forall (e1:a), (mem e1 s) -> ((rows (f e1)) = r)) ->
  (forall (e1:a), (mem e1 s) -> ((columns (f e1)) = c)) ->
  ((mat_sum_dim (remove (choose s) s) f r c) =
   (mat_sum_dim (nonn_mat_subset f (remove (choose s) s)) f r c)) ->
  ((mat_sum_dim s f r c) = (mat_sum_dim (nonn_mat_subset f s) f r c)).

Axiom nonn_mat_sum :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:a -> matrix complex) (s:set a) (r:Z) (c:Z), (r > 0%Z)%Z ->
  (c > 0%Z)%Z -> (forall (e1:a), (mem e1 s) -> ((rows (f e1)) = r)) ->
  (forall (e1:a), (mem e1 s) -> ((columns (f e1)) = c)) ->
  ((mat_sum_dim s f r c) = (mat_sum_dim (nonn_mat_subset f s) f r c)).

Axiom mat_sum_map_map :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b}
    {c:Type} {c_WT:WhyType c},
  forall (s1:set a) (s2:set b) (t1:a -> c) (t2:b -> c)
    (f:c -> matrix complex),
  ((cardinal s1) > 0%Z)%Z -> (p_injective t1 s1) ->
  (constant_size s1 (fun (a1:a) => (f (t1 a1)))) ->
  ((cardinal s2) > 0%Z)%Z -> (p_injective t2 s2) ->
  (constant_size s2 (fun (a1:b) => (f (t2 a1)))) ->
  ((map t1 s1) = (map t2 s2)) ->
  ((mat_sum (map t1 s1) f) = (mat_sum (map t2 s2) f)).

Axiom mat_sum_disjoint_transitivity :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s1:set a) (s2:set a) (f:a -> matrix complex),
  (constant_size s f) -> ((inter s1 s2) = (empty : set a)) ->
  ((union s1 s2) = s) -> ((cardinal s1) > 0%Z)%Z ->
  ((cardinal s2) > 0%Z)%Z ->
  ((add_mat (mat_sum s1 f) (mat_sum s2 f)) = (mat_sum s f)).

Axiom mat_sum_null :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:a -> matrix complex) (s:set a), ((cardinal s) > 1%Z)%Z ->
  (constant_size s f) ->
  (forall (e1:a), (mem e1 s) -> forall (i:Z) (j:Z),
   (valid_index (f e1) i j) -> ((get (f e1) i j) = c_zero)) ->
  forall (i:Z) (j:Z), (valid_index (mat_sum s f) i j) ->
  ((get (mat_sum s f) i j) = c_zero).

Axiom mat_sum_null_b :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:a -> matrix complex) (s:set a) (r:Z) (c:Z),
  ((cardinal s) > 1%Z)%Z ->
  (forall (e1:a), (mem e1 s) -> ((rows (f e1)) = r)) ->
  (forall (e1:a), (mem e1 s) -> ((columns (f e1)) = c)) ->
  (forall (e1:a), (mem e1 s) -> forall (i:Z) (j:Z),
   (valid_index (f e1) i j) -> ((get (f e1) i j) = c_zero)) ->
  forall (i:Z) (j:Z), ((0%Z <= i)%Z /\ (i < r)%Z) ->
  ((0%Z <= j)%Z /\ (j < c)%Z) -> ((get (mat_sum s f) i j) = c_zero).

Axiom map_add_mat_sum_t :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s:set a) (s':set b) (f:b -> matrix complex) (injz:a -> b)
    (injo:a -> b),
  (constant_size s' f) -> ((cardinal s) > 0%Z)%Z ->
  ((inter (map injz s) (map injo s)) = (empty : set b)) ->
  ((union (map injz s) (map injo s)) = s') -> (p_injective injo s) ->
  (p_injective injz s) ->
  ((mat_sum s (fun (e1:a) => (add_mat (f (injz e1)) (f (injo e1))))) =
   (mat_sum s' f)).

Axiom map_add_mat_sum :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s1:set a) (s2:set a) (s':set a) (f:a -> matrix complex)
    (g:a -> matrix complex) (h:a -> matrix complex),
  (constant_size s' h) -> (constant_size s f) -> (constant_size s g) ->
  (((s_rows s' h) = (s_rows s f)) /\ ((s_rows s f) = (s_rows s g))) ->
  (((s_columns s' h) = (s_columns s f)) /\
   ((s_columns s f) = (s_columns s g))) ->
  ((cardinal s) > 0%Z)%Z -> (p_injective f s) -> (p_injective g s) ->
  (p_injective h s') -> ((map f s) = (map h s1)) ->
  ((map g s) = (map h s2)) -> ((inter s1 s2) = (empty : set a)) ->
  ((union s1 s2) = s') ->
  ((mat_sum s (fun (e1:a) => (add_mat (f e1) (g e1)))) =
   (mat_sum s' (fun (e1:a) => (h e1)))).

Parameter inv_func:
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b}, (a -> b) ->
  (set a) -> (set b) -> b -> a.

Axiom inv_func_def :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b) (e':b), (p_bijective f s s') ->
  (mem e' s') ->
  ((inv_func f s s' e') =
   (element (my_filter s (fun (e1:a) => (indic_bool (f e1) e'))))).

Axiom inv_func_spec :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b) (e':b), (p_bijective f s s') ->
  (mem e' s') -> mem (inv_func f s s' e') s.

Axiom inv_func_spec1 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b) (e':b), (p_bijective f s s') ->
  (mem e' s') -> ((f (inv_func f s s' e')) = e').

Axiom bijective_inv_func :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b), (p_bijective f s s') ->
  p_bijective (fun (x:b) => (inv_func f s s' x)) s' s.

Axiom inv_rec :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b) (e1:a), (p_bijective f s s') ->
  (mem e1 s) -> ((inv_func f s s' (f e1)) = e1).

Parameter inv_:
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b}, (a -> b) ->
  (set a) -> (set b) -> b -> a.

Axiom inv__def :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b) (e1:b), (p_bijective f s s') ->
  (mem e1 s') -> ((inv_ f s s' e1) = (inv_func f s s' e1)).

Axiom inv__spec :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b) (e1:b), (p_bijective f s s') ->
  (mem e1 s') -> mem (inv_ f s s' e1) s.

Axiom inv__spec1 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b) (e1:b), (p_bijective f s s') ->
  (mem e1 s') -> ((f (inv_ f s s' e1)) = e1).

Axiom inv_bijective :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b), (p_bijective f s s') ->
  p_bijective
  ((((fun (y0:a -> b) (y1:set a) (y2:set b) (y3:b) => (inv_ y0 y1 y2 y3)) f)
    s)
   s')
  s' s.

Axiom set_bijective_inv :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (g:b -> a) (s:set a) (b1:b), (mem b1 (map f s)) ->
  (forall (e1:a) (e':a), (mem e1 s) -> (mem e' s) -> ~ (e1 = e') ->
   ~ ((f e1) = (f e'))) ->
  (forall (e':b), (mem e' (map f s)) -> (mem (g e') s) /\ ((f (g e')) = e')) ->
  p_bijective f s (map f s).

Axiom set_bijective_inv1 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (g:b -> a) (s:set a) (b1:b), (mem b1 (map f s)) ->
  (forall (e1:a) (e':a), (mem e1 s) -> (mem e' s) -> ~ (e1 = e') ->
   ~ ((f e1) = (f e'))) ->
  (forall (e':b), (mem e' (map f s)) -> (mem (g e') s) /\ ((f (g e')) = e')) ->
  ((inv_func f s (map f s) b1) = (g b1)).

Axiom set_bij_inv :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (g:b -> a) (s:set a),
  (forall (e1:a) (e':a), (mem e1 s) -> (mem e' s) -> ~ (e1 = e') ->
   ~ ((f e1) = (f e'))) ->
  (forall (e':b), (mem e' (map f s)) -> (mem (g e') s) /\ ((f (g e')) = e')) ->
  p_bijective f s (map f s).

Axiom set_bij_inv1 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (g:b -> a) (s:set a),
  (forall (e1:a) (e':a), (mem e1 s) -> (mem e' s) -> ~ (e1 = e') ->
   ~ ((f e1) = (f e'))) ->
  (forall (e':b), (mem e' (map f s)) -> (mem (g e') s) /\ ((f (g e')) = e')) ->
  p_bijective g (map f s) s.

Axiom set_bij_inv2 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (g:b -> a) (s:set a),
  (forall (e1:a) (e':a), (mem e1 s) -> (mem e' s) -> ~ (e1 = e') ->
   ~ ((f e1) = (f e'))) ->
  (forall (e':b), (mem e' (map f s)) -> (mem (g e') s) /\ ((f (g e')) = e')) ->
  forall (b1:b), (mem b1 (map f s)) -> ((inv_func f s (map f s) b1) = (g b1)).

Parameter inv_f:
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b}, (a -> b) ->
  (set a) -> (set b) -> b -> a.

Axiom inv_f_spec :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b), (p_bijective f s s') ->
  forall (e1:b), (mem e1 s') -> mem ((inv_f f s s') e1) s.

Axiom inv_f_spec1 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b), (p_bijective f s s') ->
  forall (e1:b), (mem e1 s') -> ((f ((inv_f f s s') e1)) = e1).

Axiom inv_f_spec2 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b), (p_bijective f s s') ->
  p_bijective (inv_f f s s') s' s.

Axiom inv_f_back :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b) (e1:b), (mem e1 s') ->
  (p_bijective f s s') -> ((f ((inv_f f s s') e1)) = e1).

Axiom inv_f_back_rev :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b) (e1:a), (mem e1 s) ->
  (p_bijective f s s') -> (((inv_f f s s') (f e1)) = e1).

Axiom injective_is_bijective :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (s:set a) (s':set b), (p_injective f s) ->
  (forall (e1:a), (mem e1 s) -> mem (f e1) s') ->
  ((cardinal s) = (cardinal s')) -> p_bijective f s s'.

Axiom injective_is_bijective_auto :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:a -> a) (s:set a), (p_injective f s) ->
  (forall (e1:a), (mem e1 s) -> mem (f e1) s) -> p_bijective f s s.

Axiom injective_is_bijective_auto1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:a -> a) (s:set a), (p_injective f s) ->
  (forall (e1:a), (mem e1 s) -> mem (f e1) s) -> ((map f s) = s).

Parameter inv_auto:
  forall {a:Type} {a_WT:WhyType a}, (a -> a) -> (set a) -> a -> a.

Axiom inv_auto_def :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:a -> a) (s:set a), (p_injective f s) ->
  (forall (e1:a), (mem e1 s) -> mem (f e1) s) ->
  ((inv_auto f s) = (inv_f f s s)).

Axiom inv_auto_spec :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:a -> a) (s:set a), (p_injective f s) ->
  (forall (e1:a), (mem e1 s) -> mem (f e1) s) -> forall (e1:a), (mem e1 s) ->
  mem ((inv_auto f s) e1) s.

Axiom inv_auto_spec1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:a -> a) (s:set a), (p_injective f s) ->
  (forall (e1:a), (mem e1 s) -> mem (f e1) s) -> forall (e1:a), (mem e1 s) ->
  ((f ((inv_auto f s) e1)) = e1).

Axiom inv_auto_spec2 :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:a -> a) (s:set a), (p_injective f s) ->
  (forall (e1:a), (mem e1 s) -> mem (f e1) s) ->
  p_bijective (inv_auto f s) s s.

Axiom ind_isum_mod_div :
  forall (bv:bitvec) (i:Z), ((0%Z <= i)%Z /\ (i < (length bv))%Z) ->
  ((int.EuclideanDivision.mod1
    (ind_isum
     (fun (k:Z) =>
      (((getbv bv) k) * (power 2%Z (((length bv) - 1%Z)%Z - k)%Z))%Z)
     0%Z (length bv))
    (power 2%Z ((length bv) - i)%Z))
   =
   (ind_isum
    (fun (k:Z) =>
     (((getbv bv) k) * (power 2%Z (((length bv) - 1%Z)%Z - k)%Z))%Z)
    i (length bv))).

Axiom ind_isum_mod_div1 :
  forall (bv:bitvec) (i:Z), ((0%Z <= i)%Z /\ (i < (length bv))%Z) ->
  ((int.EuclideanDivision.div
    (ind_isum
     (fun (k:Z) =>
      (((getbv bv) k) * (power 2%Z (((length bv) - 1%Z)%Z - k)%Z))%Z)
     0%Z (length bv))
    (power 2%Z ((length bv) - i)%Z))
   =
   (ind_isum
    (fun (k:Z) => (((getbv bv) k) * (power 2%Z ((i - 1%Z)%Z - k)%Z))%Z) 0%Z
    i)).

Axiom mod_ind_isum :
  forall (f:Z -> Z) (i:Z) (l:Z), ((0%Z <= i)%Z /\ (i <= l)%Z) ->
  (binary f) ->
  ((int.EuclideanDivision.mod1
    (ind_isum (fun (k:Z) => ((f k) * (power 2%Z ((l - 1%Z)%Z - k)%Z))%Z) 0%Z
     l)
    (power 2%Z i))
   =
   (ind_isum (fun (k:Z) => ((f k) * (power 2%Z ((l - 1%Z)%Z - k)%Z))%Z)
    (l - i)%Z l)).

Axiom mod_ind_isum_z :
  forall (f:Z -> Z) (i:Z) (l:Z), ((0%Z <= i)%Z /\ (i <= l)%Z) ->
  (binary f) ->
  ((int.EuclideanDivision.mod1
    (ind_isum (fun (k:Z) => ((f k) * (power 2%Z ((l - 1%Z)%Z - k)%Z))%Z) 0%Z
     l)
    (power 2%Z i))
   =
   (ind_isum
    (fun (k:Z) =>
     ((f ((k + l)%Z - i)%Z) * (power 2%Z ((i - 1%Z)%Z - k)%Z))%Z)
    0%Z i)).

Axiom div_ind_isum :
  forall (f:Z -> Z) (i:Z) (l:Z), ((0%Z <= i)%Z /\ (i <= l)%Z) ->
  (binary f) ->
  ((int.EuclideanDivision.div
    (ind_isum (fun (k:Z) => ((f k) * (power 2%Z ((l - 1%Z)%Z - k)%Z))%Z) 0%Z
     l)
    (power 2%Z i))
   =
   (ind_isum
    (fun (k:Z) => ((f k) * (power 2%Z (((l - 1%Z)%Z - k)%Z - i)%Z))%Z) 0%Z
    (l - i)%Z)).

Axiom ind_isum_mod :
  forall (bv:bitvec) (i:Z), ((0%Z <= i)%Z /\ (i < (length bv))%Z) ->
  ((int.EuclideanDivision.mod1
    (ind_isum (fun (l:Z) => (((getbv bv) l) * (power 2%Z (i - l)%Z))%Z) 0%Z
     (i + 1%Z)%Z)
    2%Z)
   = ((getbv bv) i)).

Axiom mod_ind_isum_ :
  forall (f:Z -> Z) (i:Z) (l:Z), ((0%Z <= i)%Z /\ (i <= l)%Z) ->
  (binary f) ->
  ((int.EuclideanDivision.mod1
    (ind_isum (fun (k:Z) => ((f k) * (power_ 2%Z ((l - 1%Z)%Z - k)%Z))%Z) 0%Z
     l)
    (power_ 2%Z i))
   =
   (ind_isum (fun (k:Z) => ((f k) * (power_ 2%Z ((l - 1%Z)%Z - k)%Z))%Z)
    (l - i)%Z l)).

Axiom mod_ind_isum_z_ :
  forall (f:Z -> Z) (i:Z) (l:Z), ((0%Z <= i)%Z /\ (i <= l)%Z) ->
  (binary f) ->
  ((int.EuclideanDivision.mod1
    (ind_isum (fun (k:Z) => ((f k) * (power_ 2%Z ((l - 1%Z)%Z - k)%Z))%Z) 0%Z
     l)
    (power_ 2%Z i))
   =
   (ind_isum
    (fun (k:Z) =>
     ((f ((k + l)%Z - i)%Z) * (power_ 2%Z ((i - 1%Z)%Z - k)%Z))%Z)
    0%Z i)).

Axiom div_ind_isum_ :
  forall (f:Z -> Z) (i:Z) (l:Z), ((0%Z <= i)%Z /\ (i <= l)%Z) ->
  (binary f) ->
  ((int.EuclideanDivision.div
    (ind_isum (fun (k:Z) => ((f k) * (power_ 2%Z ((l - 1%Z)%Z - k)%Z))%Z) 0%Z
     l)
    (power_ 2%Z i))
   =
   (ind_isum
    (fun (k:Z) => ((f k) * (power_ 2%Z (((l - 1%Z)%Z - k)%Z - i)%Z))%Z) 0%Z
    (l - i)%Z)).

Axiom ind_isum_mod_ :
  forall (bv:bitvec) (i:Z), ((0%Z <= i)%Z /\ (i < (length bv))%Z) ->
  ((int.EuclideanDivision.mod1
    (ind_isum (fun (l:Z) => (((getbv bv) l) * (power_ 2%Z (i - l)%Z))%Z) 0%Z
     (i + 1%Z)%Z)
    2%Z)
   = ((getbv bv) i)).

Axiom bv_to_int_kth_pre :
  forall (bv:bitvec) (k:Z),
  ((0%Z <= k)%Z /\ (k < ((length bv) - 1%Z)%Z)%Z) ->
  (((getbv bv) k) =
   (int.EuclideanDivision.mod1
    (int.EuclideanDivision.div
     (ind_isum
      (fun (l:Z) =>
       (((getbv bv) l) * (power 2%Z (((length bv) - 1%Z)%Z - l)%Z))%Z)
      0%Z (length bv))
     (power 2%Z (((length bv) - k)%Z - 1%Z)%Z))
    2%Z)).

Axiom bv_to_int_kth_pre1 :
  forall (bv:bitvec) (k:Z),
  ((0%Z <= k)%Z /\ (k < ((length bv) - 1%Z)%Z)%Z) ->
  (((getbv bv) k) =
   (int.EuclideanDivision.div
    (int.EuclideanDivision.mod1
     (ind_isum
      (fun (l:Z) =>
       (((getbv bv) l) * (power 2%Z (((length bv) - 1%Z)%Z - l)%Z))%Z)
      0%Z (length bv))
     (power 2%Z ((length bv) - k)%Z))
    (power 2%Z (((length bv) - k)%Z - 1%Z)%Z))).

Parameter int_to_bv: Z -> Z -> bitvec.

Parameter result11: Z -> Z -> Z -> Z.

Axiom result_def11 :
  forall (i:Z) (n:Z) (k:Z),
  (((0%Z <= k)%Z /\ (k < n)%Z) ->
   (((result11 i n) k) =
    (int.EuclideanDivision.div
     (int.EuclideanDivision.mod1 i (power 2%Z (n - k)%Z))
     (power 2%Z ((n - k)%Z - 1%Z)%Z)))) /\
  (~ ((0%Z <= k)%Z /\ (k < n)%Z) -> (((result11 i n) k) = 0%Z)).

Axiom int_to_bv_def :
  forall (i:Z) (n:Z), (n >= 0%Z)%Z ->
  ((int_to_bv i n) = (make_bv (result11 i n) n)).

Axiom int_to_bv_spec :
  forall (i:Z) (n:Z), (n >= 0%Z)%Z -> ((length (int_to_bv i n)) = n).

Axiom int_to_bv_spec1 :
  forall (i:Z) (n:Z), (n >= 0%Z)%Z ->
  ((int_to_bv i n) =
   (make_bv
    (fun (k:Z) =>
     (int.EuclideanDivision.div
      (int.EuclideanDivision.mod1 i (power 2%Z (n - k)%Z))
      (power 2%Z ((n - k)%Z - 1%Z)%Z)))
    n)).

Axiom int_to_bv_sum_pre :
  forall (i:Z) (n:Z) (k:Z), ((n >= k)%Z /\ (k >= 0%Z)%Z) ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) ->
  ((int.EuclideanDivision.mod1 i (power 2%Z k)) =
   (ind_isum
    (fun (l:Z) =>
     (((getbv (int_to_bv i n)) l) * (power 2%Z ((n - l)%Z - 1%Z)%Z))%Z)
    (n - k)%Z n)).

Axiom int_to_bv_sum :
  forall (i:Z) (n:Z), (n >= 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) ->
  (i =
   (ind_isum
    (fun (k:Z) =>
     (((getbv (int_to_bv i n)) k) * (power 2%Z ((n - 1%Z)%Z - k)%Z))%Z)
    0%Z n)).

Axiom int_to_bv_sum_rev :
  forall (i:Z) (n:Z), (n >= 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) ->
  ((ind_isum
    (fun (k:Z) =>
     (((getbv (int_to_bv i n)) k) * (power_ 2%Z ((n - k)%Z - 1%Z)%Z))%Z)
    0%Z n)
   = i).

Axiom int_to_bv_mod_div :
  forall (i:Z) (n:Z), (n >= 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) ->
  ((int_to_bv i n) =
   (make_bv
    (fun (k:Z) =>
     (int.EuclideanDivision.mod1
      (int.EuclideanDivision.div i (power 2%Z ((n - k)%Z - 1%Z)%Z)) 2%Z))
    n)).

Axiom mod_isum :
  forall (i:Z) (k:Z) (n:Z), (n >= 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) -> ((0%Z <= k)%Z /\ (k < n)%Z) ->
  ((int.EuclideanDivision.mod1 i (power 2%Z k)) =
   (ind_isum
    (fun (l:Z) =>
     (((getbv (int_to_bv i n)) l) * (power 2%Z ((n - 1%Z)%Z - l)%Z))%Z)
    (n - k)%Z n)).

Axiom mod_isum_z :
  forall (i:Z) (k:Z) (n:Z), (n >= 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) -> ((0%Z <= k)%Z /\ (k < n)%Z) ->
  ((int.EuclideanDivision.mod1 i (power 2%Z k)) =
   (ind_isum
    (fun (l:Z) =>
     (((getbv (int_to_bv i n)) (l + (n - k)%Z)%Z) *
      (power 2%Z ((k - l)%Z - 1%Z)%Z))%Z)
    0%Z k)).

Axiom div_isum :
  forall (i:Z) (k:Z) (n:Z), (n >= 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) -> ((0%Z <= k)%Z /\ (k < n)%Z) ->
  ((int.EuclideanDivision.div i (power 2%Z k)) =
   (ind_isum
    (fun (l:Z) =>
     (((getbv (int_to_bv i n)) l) *
      (power 2%Z (((n - 1%Z)%Z - k)%Z - l)%Z))%Z)
    0%Z (n - k)%Z)).

Axiom int_to_bv_div_mod :
  forall (i:Z) (k:Z) (n:Z), (n >= 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) -> ((0%Z <= k)%Z /\ (k < n)%Z) ->
  ((int_to_bv i n) =
   (make_bv
    (fun (k1:Z) =>
     (int.EuclideanDivision.div
      (int.EuclideanDivision.mod1 i (power 2%Z (n - k1)%Z))
      (power 2%Z ((n - k1)%Z - 1%Z)%Z)))
    n)).

Axiom int_to_bv_value :
  forall (i:Z) (n:Z) (k:Z), (n > 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) -> ((0%Z <= k)%Z /\ (k < n)%Z) ->
  (((getbv (int_to_bv i n)) k) =
   (int.EuclideanDivision.mod1
    (int.EuclideanDivision.div i (power 2%Z ((n - k)%Z - 1%Z)%Z)) 2%Z)).

Axiom int_to_bv_value_zero :
  forall (i:Z) (n:Z), (0%Z < n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) ->
  ((i < (power 2%Z (n - 1%Z)%Z))%Z -> (((getbv (int_to_bv i n)) 0%Z) = 0%Z)) /\
  (~ (i < (power 2%Z (n - 1%Z)%Z))%Z ->
   (((getbv (int_to_bv i n)) 0%Z) = 1%Z)).

Axiom int_to_bv_mod_div_ :
  forall (i:Z) (n:Z), (n >= 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (power_ 2%Z n))%Z) ->
  ((int_to_bv i n) =
   (make_bv
    (fun (k:Z) =>
     (int.EuclideanDivision.mod1
      (int.EuclideanDivision.div i (power_ 2%Z ((n - k)%Z - 1%Z)%Z)) 2%Z))
    n)).

Axiom mod_isum_ :
  forall (i:Z) (k:Z) (n:Z), (n >= 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (power_ 2%Z n))%Z) -> ((0%Z <= k)%Z /\ (k < n)%Z) ->
  ((int.EuclideanDivision.mod1 i (power_ 2%Z k)) =
   (ind_isum
    (fun (l:Z) =>
     (((getbv (int_to_bv i n)) l) * (power_ 2%Z ((n - 1%Z)%Z - l)%Z))%Z)
    (n - k)%Z n)).

Axiom mod_isum_z_ :
  forall (i:Z) (k:Z) (n:Z), (n >= 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (power_ 2%Z n))%Z) -> ((0%Z <= k)%Z /\ (k < n)%Z) ->
  ((int.EuclideanDivision.mod1 i (power_ 2%Z k)) =
   (ind_isum
    (fun (l:Z) =>
     (((getbv (int_to_bv i n)) (l + (n - k)%Z)%Z) *
      (power_ 2%Z ((k - l)%Z - 1%Z)%Z))%Z)
    0%Z k)).

Axiom div_isum_ :
  forall (i:Z) (k:Z) (n:Z), (n >= 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (power_ 2%Z n))%Z) -> ((0%Z <= k)%Z /\ (k < n)%Z) ->
  ((int.EuclideanDivision.div i (power_ 2%Z k)) =
   (ind_isum
    (fun (l:Z) =>
     (((getbv (int_to_bv i n)) l) *
      (power_ 2%Z (((n - 1%Z)%Z - k)%Z - l)%Z))%Z)
    0%Z (n - k)%Z)).

Axiom int_to_bv_div_mod_ :
  forall (i:Z) (k:Z) (n:Z), (n >= 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (power_ 2%Z n))%Z) -> ((0%Z <= k)%Z /\ (k < n)%Z) ->
  ((int_to_bv i n) =
   (make_bv
    (fun (k1:Z) =>
     (int.EuclideanDivision.div
      (int.EuclideanDivision.mod1 i (power_ 2%Z (n - k1)%Z))
      (power_ 2%Z ((n - k1)%Z - 1%Z)%Z)))
    n)).

Axiom int_to_bv_value_ :
  forall (i:Z) (n:Z) (k:Z), (n > 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (power_ 2%Z n))%Z) -> ((0%Z <= k)%Z /\ (k < n)%Z) ->
  (((getbv (int_to_bv i n)) k) =
   (int.EuclideanDivision.mod1
    (int.EuclideanDivision.div i (power_ 2%Z ((n - k)%Z - 1%Z)%Z)) 2%Z)).

Axiom int_to_bv_value_zero_ :
  forall (i:Z) (n:Z), (0%Z < n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power_ 2%Z n))%Z) ->
  ((i < (power_ 2%Z (n - 1%Z)%Z))%Z -> (((getbv (int_to_bv i n)) 0%Z) = 0%Z)) /\
  (~ (i < (power_ 2%Z (n - 1%Z)%Z))%Z ->
   (((getbv (int_to_bv i n)) 0%Z) = 1%Z)).

Axiom int_to_bv_zero :
  forall (n:Z), forall (k:Z), ((0%Z <= k)%Z /\ (k < n)%Z) ->
  (((getbv (int_to_bv 0%Z n)) k) = 0%Z).

Axiom int_to_sum :
  forall (i:Z) (n:Z), (n > 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) ->
  (i =
   (ind_isum
    (fun (k:Z) =>
     (((getbv (int_to_bv i n)) k) * (power 2%Z ((n - k)%Z - 1%Z)%Z))%Z)
    0%Z n)).

Axiom int_to_bv_transl :
  forall (i:Z) (k:Z) (n:Z) (t:Z), ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) ->
  ((0%Z <= k)%Z /\ (k < (n - t)%Z)%Z) -> ((0%Z < t)%Z /\ (t <= n)%Z) ->
  (((getbv
     (int_to_bv (int.EuclideanDivision.mod1 i (power_ 2%Z (n - t)%Z))
      (n - t)%Z))
    k)
   = ((getbv (int_to_bv i n)) (k + t)%Z)).

Axiom int_to_bv_transl_div :
  forall (i:Z) (k:Z) (n:Z) (n':Z) (t:Z),
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) -> ((0%Z <= k)%Z /\ (k < t)%Z) ->
  (n' = t) -> ((0%Z < t)%Z /\ (t <= n)%Z) ->
  (((getbv
     (int_to_bv (int.EuclideanDivision.div i (power_ 2%Z (n - t)%Z)) n'))
    k)
   = ((getbv (int_to_bv i n)) k)).

Axiom product_int_to_bv_inv :
  forall (n:Z) (i:Z), (0%Z <= n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) ->
  ((i = 0%Z) ->
   ((ind_iproduct (fun (j:Z) => (1%Z - ((getbv (int_to_bv i n)) j))%Z) 0%Z n)
    = 1%Z)) /\
  (~ (i = 0%Z) ->
   ((ind_iproduct (fun (j:Z) => (1%Z - ((getbv (int_to_bv i n)) j))%Z) 0%Z n)
    = 0%Z)).

Parameter bin_to_int: (Z -> Z) -> Z -> Z.

Axiom bin_to_int_def :
  forall (f:Z -> Z) (n:Z), (0%Z <= n)%Z -> (binary f) ->
  ((bin_to_int f n) = (bv_to_int (make_bv f n))).

Axiom bin_to_int_spec :
  forall (f:Z -> Z) (n:Z), (0%Z <= n)%Z -> (binary f) ->
  ((bin_to_int f n) =
   (ind_isum (fun (k:Z) => ((f k) * (power 2%Z ((n - 1%Z)%Z - k)%Z))%Z) 0%Z
    n)).

Axiom bin_to_int_spec1 :
  forall (f:Z -> Z) (n:Z), (0%Z <= n)%Z -> (binary f) ->
  (0%Z <= (bin_to_int f n))%Z.

Parameter int_to_bin: Z -> Z -> Z -> Z.

Axiom int_to_bin_def :
  forall (i:Z) (n:Z), (n >= 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) ->
  ((int_to_bin i n) = (getbv (int_to_bv i n))).

Axiom int_to_bin_spec :
  forall (i:Z) (n:Z), (n >= 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) ->
  (i =
   (ind_isum
    (fun (k:Z) =>
     (((int_to_bin i n) k) * (power_ 2%Z ((n - 1%Z)%Z - k)%Z))%Z)
    0%Z n)).

Axiom int_to_bin_spec1 :
  forall (i:Z) (n:Z), (n >= 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) -> binary (int_to_bin i n).

Axiom int_to_bin_spec2 :
  forall (i:Z) (n:Z), (n >= 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) -> forall (k:Z),
  ((0%Z <= k)%Z /\ (k < n)%Z) ->
  (((int_to_bin i n) k) =
   (int.EuclideanDivision.mod1
    (int.EuclideanDivision.div i (power_ 2%Z ((n - k)%Z - 1%Z)%Z)) 2%Z)).

Axiom int_to_bv_tail :
  forall (i:Z) (n:Z), (n > 1%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) ->
  ((int_to_bv (tail_bits i n) (n - 1%Z)%Z) = (tail (int_to_bv i n))).

Axiom bound_sum_dec :
  forall (bv:bitvec) (i:Z), ((1%Z <= i)%Z /\ (i <= (length bv))%Z) ->
  ((ind_isum
    (fun (l:Z) => (((getbv bv) l) * (power 2%Z ((length bv) - l)%Z))%Z) i
    ((length bv) + 1%Z)%Z)
   < (power 2%Z (((length bv) - i)%Z + 1%Z)%Z))%Z.

Axiom bv_to_int_to_bv :
  forall (i:Z) (n:Z), (n >= 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) ->
  ((bv_to_int (int_to_bv i n)) = i).

Axiom bv_to_int_to_bv_ :
  forall (i:Z) (n:Z), (n >= 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (power_ 2%Z n))%Z) ->
  ((bv_to_int (int_to_bv i n)) = i).

Axiom tail_bits_sum :
  forall (i:Z) (n:Z), (1%Z < n)%Z -> (0%Z <= i)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) ->
  ((tail_bits i n) =
   (ind_isum
    (fun (l:Z) =>
     (((getbv (int_to_bv i n)) l) * (power 2%Z ((n - 1%Z)%Z - l)%Z))%Z)
    1%Z n)).

Axiom int_to_bv_to_int :
  forall (bv:bitvec), (1%Z <= (length bv))%Z ->
  ((int_to_bv (bv_to_int bv) (length bv)) = bv).

Axiom int_to_bv_to_int_ :
  forall (bv:bitvec) (l:Z), (0%Z <= l)%Z -> ((length bv) = l) ->
  ((int_to_bv (bv_to_int bv) l) = bv).

Axiom concat_to_int :
  forall (bv:bitvec) (i:Z), ((0%Z <= i)%Z /\ (i <= 1%Z)%Z) ->
  ((bv_to_int (concat_l bv i)) =
   ((bv_to_int bv) + (i * (power 2%Z (length bv)))%Z)%Z).

Axiom bounded_to_int :
  forall (bv:bitvec), ((bv_to_int bv) < (power 2%Z (length bv)))%Z.

Axiom int_to_bv_to_int_value :
  forall (bv:bitvec) (i:Z), (1%Z <= (length bv))%Z ->
  (((0%Z <= i)%Z /\ (i < (length bv))%Z) ->
   (((getbv (int_to_bv (bv_to_int bv) (length bv))) i) = ((getbv bv) i))) /\
  (~ ((0%Z <= i)%Z /\ (i < (length bv))%Z) ->
   (((getbv (int_to_bv (bv_to_int bv) (length bv))) i) = 0%Z)).

Axiom int_to_bv_to_int_gen :
  forall (bv:bitvec) (n:Z), (1%Z <= (length bv))%Z -> (n = (length bv)) ->
  ((int_to_bv (bv_to_int bv) n) = bv).

Axiom bv_to_int_mod :
  forall (bv:bitvec) (k:Z), ((0%Z <= k)%Z /\ (k < (length bv))%Z) ->
  ((int.EuclideanDivision.mod1 (bv_to_int bv)
    (power 2%Z ((length bv) - k)%Z))
   =
   (ind_isum
    (fun (l:Z) =>
     (((getbv bv) l) * (power 2%Z (((length bv) - 1%Z)%Z - l)%Z))%Z)
    k (length bv))).

Axiom bv_to_int_mod_rev :
  forall (bv:bitvec) (k:Z), ((0%Z <= k)%Z /\ (k < (length bv))%Z) ->
  ((ind_isum
    (fun (l:Z) =>
     (((getbv bv) l) * (power 2%Z (((length bv) - 1%Z)%Z - l)%Z))%Z)
    k (length bv))
   =
   (int.EuclideanDivision.mod1 (bv_to_int bv)
    (power 2%Z ((length bv) - k)%Z))).

Axiom bv_to_int_mod_gen :
  forall (k:Z) (n:Z), ((0%Z <= k)%Z /\ (k < n)%Z) -> forall (bv:bitvec),
  ((length bv) = n) ->
  ((int.EuclideanDivision.mod1 (bv_to_int bv)
    (power 2%Z ((length bv) - k)%Z))
   =
   (ind_isum
    (fun (l:Z) =>
     (((getbv bv) l) * (power 2%Z (((length bv) - 1%Z)%Z - l)%Z))%Z)
    k (length bv))).

Axiom to_int_head_tail :
  forall (bv:bitvec), ((length bv) >= 1%Z)%Z ->
  ((bv_to_int bv) =
   ((bv_to_int (tail bv)) +
    ((head bv) * (power 2%Z ((length bv) - 1%Z)%Z))%Z)%Z).

Axiom to_int_head_tail1 :
  forall (bv:bitvec), ((length bv) >= 1%Z)%Z ->
  ((bv_to_int (tail bv)) =
   (int.EuclideanDivision.mod1 (bv_to_int bv)
    (power 2%Z ((length bv) - 1%Z)%Z))).

Axiom not_disj :
  forall (a:bool) (b:bool), ~ (a = true) -> ~ (b = true) -> ~ (a = true).

Axiom not_disj1 : True.

Parameter my_map:
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b}, (a -> b) ->
  (set a) -> set b.

Axiom my_map_def :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (u:set a), ((cardinal u) = 0%Z) ->
  ((my_map f u) = (empty : set b)).

Axiom my_map_def1 :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (u:set a), ~ ((cardinal u) = 0%Z) ->
  ((my_map f u) = (add (f (choose u)) (my_map f (remove (choose u) u)))).

Axiom my_map_spec :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (u:set a), ((my_map f u) = (map f u)).

Axiom my_map_to_map :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (u:set a), ((my_map f u) = (map f u)).

Axiom map_to_my_map :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:a -> b) (u:set a), ((map f u) = (my_map f u)).

Parameter mapz_pre: Z -> (set bitvec) -> set bitvec.

Axiom mapz_pre_def :
  forall (n:Z) (s:set bitvec), (1%Z <= n)%Z ->
  (forall (f:bitvec), (mem f s) <-> ((length f) = (n - 1%Z)%Z)) ->
  ((mapz_pre n s) = (my_map (fun (bv:bitvec) => (concat_l bv 0%Z)) s)).

Axiom mapz_pre_spec :
  forall (n:Z) (s:set bitvec), (1%Z <= n)%Z ->
  (forall (f:bitvec), (mem f s) <-> ((length f) = (n - 1%Z)%Z)) ->
  mem (make_bv (fun (us:Z) => 0%Z) n) (mapz_pre n s).

Axiom mapz_pre_spec1 :
  forall (n:Z) (s:set bitvec), (1%Z <= n)%Z ->
  (forall (f:bitvec), (mem f s) <-> ((length f) = (n - 1%Z)%Z)) ->
  forall (e1:bitvec), (mem e1 (mapz_pre n s)) -> (((getbv e1) 0%Z) = 0%Z).

Axiom mapz_pre_spec2 :
  forall (n:Z) (s:set bitvec), (1%Z <= n)%Z ->
  (forall (f:bitvec), (mem f s) <-> ((length f) = (n - 1%Z)%Z)) ->
  forall (e1:bitvec), (mem e1 (mapz_pre n s)) ->
  exists bv:bitvec, (mem bv s) /\ (e1 = (concat_l bv 0%Z)).

Axiom mapz_pre_spec3 :
  forall (n:Z) (s:set bitvec), (1%Z <= n)%Z ->
  (forall (f:bitvec), (mem f s) <-> ((length f) = (n - 1%Z)%Z)) ->
  forall (e1:bitvec), (mem e1 (mapz_pre n s)) -> ((length e1) = n).

Axiom mapz_pre_spec4 :
  forall (n:Z) (s:set bitvec), (1%Z <= n)%Z ->
  (forall (f:bitvec), (mem f s) <-> ((length f) = (n - 1%Z)%Z)) ->
  forall (e1:bitvec), ((length e1) = n) -> (((getbv e1) 0%Z) = 0%Z) ->
  mem e1 (mapz_pre n s).

Parameter mapo_pre: Z -> (set bitvec) -> set bitvec.

Axiom mapo_pre_def :
  forall (n:Z) (s:set bitvec), (1%Z <= n)%Z ->
  (forall (f:bitvec), (mem f s) <-> ((length f) = (n - 1%Z)%Z)) ->
  ((mapo_pre n s) = (my_map (fun (bv:bitvec) => (concat_l bv 1%Z)) s)).

Axiom mapo_pre_spec :
  forall (n:Z) (s:set bitvec), (1%Z <= n)%Z ->
  (forall (f:bitvec), (mem f s) <-> ((length f) = (n - 1%Z)%Z)) ->
  mem (make_bv (fun (us:Z) => 1%Z) n) (mapo_pre n s).

Axiom mapo_pre_spec1 :
  forall (n:Z) (s:set bitvec), (1%Z <= n)%Z ->
  (forall (f:bitvec), (mem f s) <-> ((length f) = (n - 1%Z)%Z)) ->
  forall (e1:bitvec), (mem e1 (mapo_pre n s)) -> (((getbv e1) 0%Z) = 1%Z).

Axiom mapo_pre_spec2 :
  forall (n:Z) (s:set bitvec), (1%Z <= n)%Z ->
  (forall (f:bitvec), (mem f s) <-> ((length f) = (n - 1%Z)%Z)) ->
  forall (e1:bitvec), (mem e1 (mapo_pre n s)) ->
  exists bv:bitvec, (mem bv s) /\ (e1 = (concat_l bv 1%Z)).

Axiom mapo_pre_spec3 :
  forall (n:Z) (s:set bitvec), (1%Z <= n)%Z ->
  (forall (f:bitvec), (mem f s) <-> ((length f) = (n - 1%Z)%Z)) ->
  forall (e1:bitvec), (mem e1 (mapo_pre n s)) -> ((length e1) = n).

Axiom mapo_pre_spec4 :
  forall (n:Z) (s:set bitvec), (1%Z <= n)%Z ->
  (forall (f:bitvec), (mem f s) <-> ((length f) = (n - 1%Z)%Z)) ->
  forall (e1:bitvec), ((length e1) = n) -> (((getbv e1) 0%Z) = 1%Z) ->
  mem e1 (mapo_pre n s).

Parameter n_bvs: Z -> set bitvec.

Axiom n_bvs_spec :
  forall (n:Z), (0%Z <= n)%Z -> (1%Z <= n)%Z -> forall (s:set bitvec),
  (forall (f:bitvec), (mem f s) <-> ((length f) = (n - 1%Z)%Z)) ->
  ((n_bvs n) = (union (mapz_pre n s) (mapo_pre n s))).

Axiom n_bvs_spec1 :
  forall (n:Z), (0%Z <= n)%Z -> forall (f:bitvec), (mem f (n_bvs n)) ->
  ((length f) = n).

Axiom n_bvs_spec2 :
  forall (n:Z), (0%Z <= n)%Z -> forall (f:bitvec), (mem f (n_bvs n)) ->
  ((length f) = n).

Axiom n_bvs_spec3 :
  forall (n:Z), (0%Z <= n)%Z -> forall (f:bitvec), ((length f) = n) ->
  mem f (n_bvs n).

Axiom n_bvs_spec4 :
  forall (n:Z), (0%Z <= n)%Z -> ((cardinal (n_bvs n)) > 0%Z)%Z.

Axiom in_n_bvs :
  forall (x:bitvec) (n:Z), (0%Z <= n)%Z -> ((length x) = n) ->
  mem x (n_bvs n).

Axiom get_in_n_bvs :
  forall (x:bitvec) (n:Z), (0%Z <= n)%Z -> (mem x (n_bvs n)) ->
  ((length x) = n).

Parameter mapz: Z -> set bitvec.

Axiom mapz_def :
  forall (n:Z), (1%Z <= n)%Z -> ((mapz n) = (mapz_pre n (n_bvs (n - 1%Z)%Z))).

Axiom mapz_spec :
  forall (n:Z), (1%Z <= n)%Z ->
  ((mapz n) =
   (my_map (fun (bv:bitvec) => (concat_l bv 0%Z)) (n_bvs (n - 1%Z)%Z))).

Axiom mapz_spec1 :
  forall (n:Z), (1%Z <= n)%Z -> (0%Z < (cardinal (mapz n)))%Z.

Axiom mapz_spec2 :
  forall (n:Z), (1%Z <= n)%Z -> forall (e1:bitvec), (mem e1 (mapz n)) ->
  (((getbv e1) 0%Z) = 0%Z).

Axiom mapz_spec3 :
  forall (n:Z), (1%Z <= n)%Z -> forall (e1:bitvec), (mem e1 (mapz n)) ->
  exists bv:bitvec, (mem bv (n_bvs (n - 1%Z)%Z)) /\ (e1 = (concat_l bv 0%Z)).

Axiom mapz_spec4 :
  forall (n:Z), (1%Z <= n)%Z -> forall (e1:bitvec), (mem e1 (mapz n)) ->
  ((length e1) = n).

Axiom mapz_spec5 :
  forall (n:Z), (1%Z <= n)%Z -> forall (e1:bitvec), ((length e1) = n) ->
  (((getbv e1) 0%Z) = 0%Z) -> mem e1 (mapz n).

Parameter mapo: Z -> set bitvec.

Axiom mapo_def :
  forall (n:Z), (1%Z <= n)%Z -> ((mapo n) = (mapo_pre n (n_bvs (n - 1%Z)%Z))).

Axiom mapo_spec :
  forall (n:Z), (1%Z <= n)%Z ->
  ((mapo n) =
   (my_map (fun (bv:bitvec) => (concat_l bv 1%Z)) (n_bvs (n - 1%Z)%Z))).

Axiom mapo_spec1 :
  forall (n:Z), (1%Z <= n)%Z -> (0%Z < (cardinal (mapo n)))%Z.

Axiom mapo_spec2 :
  forall (n:Z), (1%Z <= n)%Z -> forall (e1:bitvec), (mem e1 (mapo n)) ->
  (((getbv e1) 0%Z) = 1%Z).

Axiom mapo_spec3 :
  forall (n:Z), (1%Z <= n)%Z -> forall (e1:bitvec), (mem e1 (mapo n)) ->
  exists bv:bitvec, (mem bv (n_bvs (n - 1%Z)%Z)) /\ (e1 = (concat_l bv 1%Z)).

Axiom mapo_spec4 :
  forall (n:Z), (1%Z <= n)%Z -> forall (e1:bitvec), (mem e1 (mapo n)) ->
  ((length e1) = n).

Axiom mapo_spec5 :
  forall (n:Z), (1%Z <= n)%Z -> forall (e1:bitvec), ((length e1) = n) ->
  (((getbv e1) 0%Z) = 1%Z) -> mem e1 (mapo n).

Axiom n_bvs_node :
  forall (n:Z), (0%Z < n)%Z ->
  ((inter (mapz n) (mapo n)) = (empty : set bitvec)).

Axiom n_bvs_node1 :
  forall (n:Z), (0%Z < n)%Z -> ((union (mapz n) (mapo n)) = (n_bvs n)).

Parameter n_bvsz: unit -> set bitvec.

Axiom n_bvsz_def : forall (us:unit), ((n_bvsz us) = (n_bvs 0%Z)).

Axiom n_bvsz_spec :
  forall (us:unit), forall (x:bitvec), ((length x) = 0%Z) ->
  mem x (n_bvsz us).

Axiom n_bvsz_spec1 :
  forall (us:unit), forall (x:bitvec), (mem x (n_bvsz us)) ->
  (x = (make_bv (fun (us1:Z) => 0%Z) 0%Z)).

Axiom n_bvsz_spec2 :
  forall (us:unit),
  ((n_bvsz us) = (to_set (make_bv (fun (us1:Z) => 0%Z) 0%Z))).

Axiom n_bvsz_spec3 :
  forall (us:unit),
  ((choose (n_bvsz us)) = (make_bv (fun (us1:Z) => 0%Z) 0%Z)).

Axiom n_bvsz_spec4 :
  forall (us:unit), forall (f:bitvec -> matrix complex),
  ((mat_sum (n_bvsz us) f) = (f (make_bv (fun (us1:Z) => 0%Z) 0%Z))).

Parameter n_bvso: unit -> set bitvec.

Axiom n_bvso_def : forall (us:unit), ((n_bvso us) = (n_bvs 1%Z)).

Axiom n_bvso_spec :
  forall (us:unit), forall (x:bitvec), ((length x) = 1%Z) ->
  mem x (n_bvso us).

Axiom n_bvso_spec1 :
  forall (us:unit), forall (x:bitvec), (mem x (n_bvso us)) ->
  ((length x) = 1%Z).

Axiom n_bvso_spec2 :
  forall (us:unit),
  ((n_bvso us) =
   (add (make_bv (fun (us1:Z) => 0%Z) 1%Z)
    (to_set (make_bv (fun (us1:Z) => 1%Z) 1%Z)))).

Axiom n_bvso_spec3 :
  forall (us:unit), forall (f:bitvec -> matrix complex),
  (constant_size (n_bvso us) f) ->
  ((mat_sum (n_bvso us) f) =
   (add_mat (f (make_bv (fun (us1:Z) => 0%Z) 1%Z))
    (f (make_bv (fun (us1:Z) => 1%Z) 1%Z)))).

Axiom injective_node :
  forall (n:Z), (0%Z <= n)%Z ->
  p_injective (fun (bv:bitvec) => (concat_l bv 0%Z)) (n_bvs n).

Axiom injective_node1 :
  forall (n:Z), (0%Z <= n)%Z ->
  p_injective (fun (bv:bitvec) => (concat_l bv 1%Z)) (n_bvs n).

Axiom mat_sum_n_bvs_pos :
  forall (n:Z) (f:bitvec -> matrix complex), (0%Z < n)%Z ->
  (constant_size (n_bvs n) f) ->
  ((mat_sum (n_bvs n) f) =
   (add_mat
    (mat_sum (n_bvs (n - 1%Z)%Z) (fun (bv:bitvec) => (f (concat_l bv 0%Z))))
    (mat_sum (n_bvs (n - 1%Z)%Z) (fun (bv:bitvec) => (f (concat_l bv 1%Z)))))).

Axiom mat_sum_n_bvs_null :
  forall (f:bitvec -> matrix complex),
  ((mat_sum (n_bvs 0%Z) f) =
   (f (make_bv ((fun (y0:Z) (y1:Z) => (const y0 y1)) 0%Z) 0%Z))).

Axiom mat_sum_n_bvs_null_eq :
  forall (f:bitvec -> matrix complex) (x:matrix complex),
  (x = (f (make_bv ((fun (y0:Z) (y1:Z) => (const y0 y1)) 0%Z) 0%Z))) ->
  ((mat_sum (n_bvs 0%Z) f) = x).

Axiom get_n_bvs : forall (bv:bitvec), mem bv (n_bvs (length bv)).

Axiom get_n_bvs_gen :
  forall (bv:bitvec) (l:Z), (l = (length bv)) -> mem bv (n_bvs l).

Axiom set_n_bvs :
  forall (bv:bitvec), (mem bv (n_bvs (length bv))) -> forall (i:Z),
  ~ (0%Z <= i)%Z -> (((getbv bv) i) = 0%Z).

Axiom set_n_bvs1 :
  forall (bv:bitvec), (mem bv (n_bvs (length bv))) -> forall (i:Z),
  ~ (i < (length bv))%Z -> (((getbv bv) i) = 0%Z).

Axiom int_to_bv_n_bvs :
  forall (i:Z) (n:Z), (n >= 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) -> mem (int_to_bv i n) (n_bvs n).

Axiom n_bvs_def_pos :
  forall (n:Z), (0%Z < n)%Z ->
  ((n_bvs n) =
   (union (map (fun (bv:bitvec) => (concat_l bv 0%Z)) (n_bvs (n - 1%Z)%Z))
    (map (fun (bv:bitvec) => (concat_l bv 1%Z)) (n_bvs (n - 1%Z)%Z)))).

Axiom map_n_bvs :
  forall (n:Z), (0%Z < n)%Z ->
  ((to_fset 0%Z (power 2%Z n)) =
   (map (fun (y0:bitvec) => (bv_to_int y0)) (n_bvs n))).

Axiom ind_sum_bv :
  forall (f:Z -> complex) (n:Z), (1%Z <= n)%Z ->
  ((ind_sum f 0%Z (power_ 2%Z n)) =
   (sum (n_bvs n) (fun (k:bitvec) => (f (bv_to_int k))))).

Parameter first_div: bitvec -> bitvec -> Z.

Axiom first_div_spec :
  forall (bv1:bitvec) (bv2:bitvec), ((length bv1) = (length bv2)) ->
  ~ (bv1 = bv2) -> forall (j:Z),
  ((0%Z <= j)%Z /\ (j < (first_div bv1 bv2))%Z) ->
  (((getbv bv1) j) = ((getbv bv2) j)).

Axiom first_div_spec1 :
  forall (bv1:bitvec) (bv2:bitvec), ((length bv1) = (length bv2)) ->
  ~ (bv1 = bv2) -> ((first_div bv1 bv2) < (length bv1))%Z ->
  ~ (((getbv bv1) (first_div bv1 bv2)) = ((getbv bv2) (first_div bv1 bv2))).

Axiom first_div_spec2 :
  forall (bv1:bitvec) (bv2:bitvec), ((length bv1) = (length bv2)) ->
  ~ (bv1 = bv2) -> (0%Z <= (first_div bv1 bv2))%Z.

Axiom first_div_spec3 :
  forall (bv1:bitvec) (bv2:bitvec), ((length bv1) = (length bv2)) ->
  ~ (bv1 = bv2) -> ((first_div bv1 bv2) < (length bv1))%Z.

Axiom injective_concat :
  forall (i:Z) (n:Z), (0%Z <= n)%Z -> ((0%Z <= i)%Z /\ (i <= 1%Z)%Z) ->
  p_injective (fun (bv:bitvec) => (concat_l bv i)) (n_bvs n).

Axiom inf_first_div :
  forall (bv1:bitvec) (bv2:bitvec), ((length bv1) = (length bv2)) ->
  ~ (bv1 = bv2) -> forall (j:Z), (1%Z <= j)%Z ->
  ~ (((getbv bv1) j) = ((getbv bv2) j)) -> ((first_div bv1 bv2) <= j)%Z.

Axiom first_div_diff :
  forall (bv1:bitvec) (bv2:bitvec), ((length bv1) = (length bv2)) ->
  ~ (bv1 = bv2) ->
  ~ (((getbv bv1) (first_div bv1 bv2)) = ((getbv bv2) (first_div bv1 bv2))).

Axiom exists_first_div :
  forall (bv1:bitvec) (bv2:bitvec), ((length bv1) = (length bv2)) ->
  ~ (bv1 = bv2) ->
  exists i:Z,
  ((0%Z <= i)%Z /\ (i < (length bv1))%Z) /\ (i = (first_div bv1 bv2)).

Axiom set_diff_length :
  forall (bv1:bitvec) (bv2:bitvec), ~ ((length bv1) = (length bv2)) ->
  ~ (bv1 = bv2).

Axiom set_diff_val :
  forall (bv1:bitvec) (bv2:bitvec) (i:Z), ((length bv1) = (length bv2)) ->
  ((0%Z <= i)%Z /\ (i < (length bv1))%Z) ->
  ~ (((getbv bv1) i) = ((getbv bv2) i)) -> ~ (bv1 = bv2).

Parameter fc6: bitvec -> Z -> Z.

Parameter fc7: bitvec -> Z -> Z.

Axiom fc_def6 :
  forall (bv:bitvec) (l:Z),
  ((l < (length bv))%Z ->
   (((fc6 bv) l) =
    (((getbv bv) l) * (power 2%Z (((length bv) - 1%Z)%Z - l)%Z))%Z)) /\
  (~ (l < (length bv))%Z -> (((fc6 bv) l) = 0%Z)).

Axiom fc_def7 :
  forall (bv:bitvec) (l:Z),
  ((l < (length bv))%Z ->
   (((fc7 bv) l) =
    (((getbv bv) l) * (power 2%Z (((length bv) - 1%Z)%Z - l)%Z))%Z)) /\
  (~ (l < (length bv))%Z -> (((fc7 bv) l) = 0%Z)).

Axiom kth_decomp :
  forall (bv:bitvec) (k:Z), ((0%Z <= k)%Z /\ (k < (length bv))%Z) ->
  ((bv_to_int bv) =
   (((ind_isum (fc6 bv) 0%Z k) +
     (((getbv bv) k) * (power 2%Z (((length bv) - 1%Z)%Z - k)%Z))%Z)%Z
    + (ind_isum (fc7 bv) (k + 1%Z)%Z (length bv)))%Z).

Axiom kth_decomp1 :
  forall (bv:bitvec) (k:Z), ((0%Z <= k)%Z /\ (k < (length bv))%Z) ->
  ((bv_to_int bv) =
   (((ind_isum
      (fun (l:Z) =>
       (((getbv bv) l) * (power 2%Z (((length bv) - 1%Z)%Z - l)%Z))%Z)
      0%Z k)
     + (((getbv bv) k) * (power 2%Z (((length bv) - 1%Z)%Z - k)%Z))%Z)%Z
    +
    (ind_isum
     (fun (l:Z) =>
      (((getbv bv) l) * (power 2%Z (((length bv) - 1%Z)%Z - l)%Z))%Z)
     (k + 1%Z)%Z (length bv)))%Z).

Axiom int_to_bv_prod :
  forall (i:Z) (j:Z) (n:Z), (n > 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) ->
  ((0%Z <= j)%Z /\ (j < (power 2%Z n))%Z) ->
  ((ind_product
    (fun (k:Z) =>
     (indic ((getbv (int_to_bv i n)) k) ((getbv (int_to_bv j n)) k)))
    0%Z n)
   = (indic i j)).

Axiom int_to_bv_prod_gen :
  forall (i:Z) (n:Z), (n > 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) -> forall (j:Z),
  ((0%Z <= j)%Z /\ (j < (power 2%Z n))%Z) ->
  ((ind_product
    (fun (k:Z) =>
     (indic ((getbv (int_to_bv i n)) k) ((getbv (int_to_bv j n)) k)))
    0%Z n)
   = (indic i j)).

Axiom kth_decomp_bound_zero :
  forall (bv:bitvec) (k:Z), ((0%Z <= k)%Z /\ (k < (length bv))%Z) ->
  (((getbv bv) k) = 0%Z) ->
  ((ind_isum
    (fun (l:Z) =>
     (((getbv bv) l) * (power 2%Z (((length bv) - 1%Z)%Z - l)%Z))%Z)
    0%Z k)
   <= (bv_to_int bv))%Z.

Axiom kth_decomp_bound_zero1 :
  forall (bv:bitvec) (k:Z), ((0%Z <= k)%Z /\ (k < (length bv))%Z) ->
  (((getbv bv) k) = 0%Z) ->
  ((bv_to_int bv) <
   ((ind_isum
     (fun (l:Z) =>
      (((getbv bv) l) * (power 2%Z (((length bv) - 1%Z)%Z - l)%Z))%Z)
     0%Z k)
    + (power 2%Z (((length bv) - k)%Z - 1%Z)%Z))%Z)%Z.

Axiom kth_decomp_bound_one :
  forall (bv:bitvec) (k:Z), ((0%Z <= k)%Z /\ (k < (length bv))%Z) ->
  (((getbv bv) k) = 1%Z) ->
  (((ind_isum
     (fun (l:Z) =>
      (((getbv bv) l) * (power 2%Z (((length bv) - 1%Z)%Z - l)%Z))%Z)
     0%Z k)
    + (power 2%Z (((length bv) - k)%Z - 1%Z)%Z))%Z
   <= (bv_to_int bv))%Z.

Axiom kth_decomp_bound_one1 :
  forall (bv:bitvec) (k:Z), ((0%Z <= k)%Z /\ (k < (length bv))%Z) ->
  (((getbv bv) k) = 1%Z) ->
  ((bv_to_int bv) <
   ((ind_isum
     (fun (l:Z) =>
      (((getbv bv) l) * (power 2%Z (((length bv) - l)%Z - 1%Z)%Z))%Z)
     0%Z k)
    + (power 2%Z ((length bv) - k)%Z))%Z)%Z.

Axiom bv_to_int_length_2 :
  forall (x:bitvec), ((length x) = 2%Z) ->
  (((getbv x) 0%Z) = (int.EuclideanDivision.div (bv_to_int x) 2%Z)).

Axiom bv_to_int_length_21 :
  forall (x:bitvec), ((length x) = 2%Z) ->
  (((getbv x) 1%Z) = (int.EuclideanDivision.mod1 (bv_to_int x) 2%Z)).

Axiom bv_to_int_length_2_gen :
  forall (x:bitvec), ((length x) = 2%Z) ->
  (((getbv x) 0%Z) = (int.EuclideanDivision.div (bv_to_int x) 2%Z)).

Axiom bv_to_int_length_2_gen1 :
  forall (x:bitvec), ((length x) = 2%Z) ->
  (((getbv x) 1%Z) = (int.EuclideanDivision.mod1 (bv_to_int x) 2%Z)).

Parameter is_a_ket: (matrix complex) -> Prop.

Axiom Is_a_ket :
  forall (m:matrix complex), (is_a_ket m) -> ((columns m) = 1%Z).

Axiom Is_a_ket1 :
  forall (m:matrix complex), (is_a_ket m) ->
  exists s:Z, (s >= 0%Z)%Z /\ ((rows m) = (power 2%Z s)).

Axiom Is_a_ket2 :
  forall (m:matrix complex),
  (((columns m) = 1%Z) /\
   exists s:Z, (s >= 0%Z)%Z /\ ((rows m) = (power 2%Z s))) ->
  is_a_ket m.

Parameter xor_i: Z -> Z -> Z.

Axiom xor_i_def :
  forall (i:Z) (i':Z), ((0%Z <= i)%Z /\ (i < 2%Z)%Z) ->
  ((0%Z <= i')%Z /\ (i' < 2%Z)%Z) -> (i = 0%Z) -> ((xor_i i i') = i').

Axiom xor_i_def1 :
  forall (i:Z) (i':Z), ((0%Z <= i)%Z /\ (i < 2%Z)%Z) ->
  ((0%Z <= i')%Z /\ (i' < 2%Z)%Z) -> ~ (i = 0%Z) ->
  ((xor_i i i') = (1%Z - i')%Z).

Axiom xor_i_spec :
  forall (i:Z) (i':Z), ((0%Z <= i)%Z /\ (i < 2%Z)%Z) ->
  ((0%Z <= i')%Z /\ (i' < 2%Z)%Z) -> (i = 0%Z) -> (i' = 0%Z) ->
  ((xor_i i i') = 0%Z).

Axiom xor_i_spec1 :
  forall (i:Z) (i':Z), ((0%Z <= i)%Z /\ (i < 2%Z)%Z) ->
  ((0%Z <= i')%Z /\ (i' < 2%Z)%Z) -> (i = 0%Z) -> (i' = 1%Z) ->
  ((xor_i i i') = 1%Z).

Axiom xor_i_spec2 :
  forall (i:Z) (i':Z), ((0%Z <= i)%Z /\ (i < 2%Z)%Z) ->
  ((0%Z <= i')%Z /\ (i' < 2%Z)%Z) -> (i = 1%Z) -> (i' = 0%Z) ->
  ((xor_i i i') = 1%Z).

Axiom xor_i_spec3 :
  forall (i:Z) (i':Z), ((0%Z <= i)%Z /\ (i < 2%Z)%Z) ->
  ((0%Z <= i')%Z /\ (i' < 2%Z)%Z) -> (i = 1%Z) -> (i' = 1%Z) ->
  ((xor_i i i') = 0%Z).

Parameter is_a_ket_l: (matrix complex) -> Z -> Prop.

Axiom is_a_ket_l_def :
  forall (m:matrix complex) (l:Z), (is_a_ket_l m l) -> (l >= 0%Z)%Z.

Axiom is_a_ket_l_def1 :
  forall (m:matrix complex) (l:Z), (is_a_ket_l m l) -> ((columns m) = 1%Z).

Axiom is_a_ket_l_def2 :
  forall (m:matrix complex) (l:Z), (is_a_ket_l m l) ->
  ((rows m) = (power 2%Z l)).

Axiom is_a_ket_l_def3 :
  forall (m:matrix complex) (l:Z),
  ((l >= 0%Z)%Z /\ (((columns m) = 1%Z) /\ ((rows m) = (power 2%Z l)))) ->
  is_a_ket_l m l.

Axiom ket_l_rows :
  forall (m:matrix complex) (l:Z), (is_a_ket_l m l) ->
  ((rows m) = (power 2%Z l)).

Axiom ket_l_columns :
  forall (m:matrix complex), (exists l:Z, is_a_ket_l m l) ->
  ((columns m) = 1%Z).

Parameter ket_valid_index: (matrix complex) -> Z -> Prop.

Axiom ket_valid_index_def :
  forall (m:matrix complex) (i:Z), (ket_valid_index m i) ->
  valid_index m i 0%Z.

Axiom ket_valid_index_def1 :
  forall (m:matrix complex) (i:Z), (valid_index m i 0%Z) ->
  ket_valid_index m i.

Parameter ket_length: (matrix complex) -> Z.

Axiom ket_length_def :
  forall (m:matrix complex), (is_a_ket m) ->
  ((ket_length m) = ((binary_length (rows m)) - 1%Z)%Z).

Axiom ket_length_spec :
  forall (m:matrix complex), (is_a_ket m) -> (0%Z <= (ket_length m))%Z.

Axiom ket_length_spec1 :
  forall (m:matrix complex), (is_a_ket m) ->
  ((rows m) = (power 2%Z (ket_length m))).

Parameter get_ket: (matrix complex) -> Z -> complex.

Axiom get_ket_def :
  forall (m:matrix complex) (i:Z), ((get_ket m i) = (get m i 0%Z)).

Axiom get_ket_rev :
  forall (m:matrix complex) (i:Z), ((get m i 0%Z) = (get_ket m i)).

Parameter get_ket_bv: (matrix complex) -> bitvec -> complex.

Axiom get_ket_bv_def :
  forall (x:matrix complex) (bv:bitvec), (is_a_ket_l x (length bv)) ->
  ((get_ket_bv x bv) = (get_ket x (bv_to_int bv))).

Axiom get_ket_add :
  forall (x:matrix complex) (y:matrix complex) (i:Z), (is_a_ket x) ->
  (is_a_ket y) -> ((ket_length x) = (ket_length y)) ->
  ((0%Z <= i)%Z /\ (i < (power_ 2%Z (ket_length y)))%Z) ->
  ((get_ket (add_mat x y) i) = (infix_pldt (get_ket x i) (get_ket y i))).

Axiom get_ket_substr :
  forall (x:matrix complex) (y:matrix complex) (i:Z), (is_a_ket x) ->
  (is_a_ket y) -> ((ket_length x) = (ket_length y)) ->
  ((0%Z <= i)%Z /\ (i < (power_ 2%Z (ket_length y)))%Z) ->
  ((get_ket (mat_substr x y) i) = (infix_mndt (get_ket x i) (get_ket y i))).

Axiom mat_mult_ket_l :
  forall (m:matrix complex) (k:matrix complex) (n:Z), (is_a_ket_l k n) ->
  ((rows m) = (power 2%Z n)) -> ((columns m) = (power 2%Z n)) ->
  is_a_ket_l (mat_mult m k) n.

Axiom ket_kronecker_values :
  forall (m:matrix complex) (n:matrix complex) (i:Z), (is_a_ket m) ->
  (is_a_ket n) -> ((0%Z <= i)%Z /\ (i < ((rows m) * (rows n))%Z)%Z) ->
  ((get_ket (kronecker m n) i) =
   (infix_asdt (get_ket m (int.EuclideanDivision.div i (rows n)))
    (get_ket n (int.EuclideanDivision.mod1 i (rows n))))).

Axiom ket_l_to_ket :
  forall (m:matrix complex) (l:Z), (is_a_ket_l m l) -> is_a_ket m.

Axiom ket_l_to_ket1 :
  forall (m:matrix complex) (l:Z), (is_a_ket_l m l) -> ((ket_length m) = l).

Axiom ket_l_to_ket_gen :
  forall (m:matrix complex), (exists l:Z, is_a_ket_l m l) -> is_a_ket m.

Axiom ket_to_ket_l :
  forall (m:matrix complex), (is_a_ket m) -> is_a_ket_l m (ket_length m).

Axiom set_ket_valid_index :
  forall (m:matrix complex) (i:Z), (is_a_ket m) ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z (ket_length m)))%Z) -> ket_valid_index m i.

Axiom ket_to_ket_l_l :
  forall (m:matrix complex) (i:Z), (is_a_ket m) -> ((ket_length m) = i) ->
  is_a_ket_l m i.

Axiom set_constant_size_ket :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex),
  (forall (e1:a), (mem e1 s) -> is_a_ket (f e1)) ->
  (forall (e1:a) (e':a), (mem e1 s) -> (mem e' s) ->
   ((ket_length (f e1)) = (ket_length (f e')))) ->
  constant_size s f.

Parameter ket_norm_l: (matrix complex) -> Z -> complex.

Axiom ket_norm_l_def :
  forall (x:matrix complex) (n:Z), (is_a_ket_l x n) ->
  ((ket_norm_l x n) =
   (square_rt
    (sum (to_fset 0%Z (power 2%Z n))
     (fun (k:Z) =>
      (infix_asdt (modulus (get x k 0%Z)) (modulus (get x k 0%Z))))))).

Axiom ind_sum_ket_norm_l :
  forall (x:matrix complex) (n:Z), (is_a_ket_l x n) ->
  ((ket_norm_l x n) =
   (square_rt
    (ind_sum
     (fun (k:Z) =>
      (infix_asdt (modulus (get x k 0%Z)) (modulus (get x k 0%Z))))
     0%Z (power 2%Z n)))).

Axiom ket_norm_one :
  forall (x:matrix complex) (n:Z), (n = 1%Z) -> (is_a_ket_l x n) ->
  ((ket_norm_l x n) =
   (square_rt
    (infix_pldt
     (infix_asdt (modulus (get x 0%Z 0%Z)) (modulus (get x 0%Z 0%Z)))
     (infix_asdt (modulus (get x 1%Z 0%Z)) (modulus (get x 1%Z 0%Z)))))).

Axiom ket_norm_one_c_one :
  forall (x:matrix complex) (n:Z), (n = 1%Z) -> (is_a_ket_l x n) ->
  ((infix_pldt
    (infix_asdt (modulus (get x 0%Z 0%Z)) (modulus (get x 0%Z 0%Z)))
    (infix_asdt (modulus (get x 1%Z 0%Z)) (modulus (get x 1%Z 0%Z))))
   = c_one) ->
  ((ket_norm_l x n) = c_one).

Axiom scalar_ket_norm_l :
  forall (x:matrix complex) (a:complex) (n:Z), (infix_lseqdt c_zero a) ->
  (is_a_ket_l x n) ->
  ((ket_norm_l (infix_asdtdt a x) n) = (infix_asdt a (ket_norm_l x n))).

Axiom zero_ket_norm_l :
  forall (x:matrix complex) (n:Z), (is_a_ket_l x n) ->
  ((ket_norm_l x n) = c_zero) -> forall (i:Z) (j:Z),
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) -> (j = 0%Z) ->
  ((get x i j) = c_zero).

Parameter normalized_l: (matrix complex) -> Z -> matrix complex.

Axiom normalized_l_def :
  forall (x:matrix complex) (n:Z), (is_a_ket_l x n) ->
  (exists i:Z,
   ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) /\ ~ ((get x i 0%Z) = c_zero)) ->
  ((normalized_l x n) = (infix_asdtdt (infix_sldt c_one (ket_norm_l x n)) x)).

Axiom normalized_l_spec :
  forall (x:matrix complex) (n:Z), (is_a_ket_l x n) ->
  (exists i:Z,
   ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) /\ ~ ((get x i 0%Z) = c_zero)) ->
  is_a_ket_l (normalized_l x n) n.

Parameter make_ket: Z -> (Z -> complex) -> matrix complex.

Axiom make_ket_def :
  forall (n:Z) (f:Z -> complex), (n >= 0%Z)%Z ->
  ((make_ket n f) = (make_f (power 2%Z n) 1%Z (fun (x:Z) (us:Z) => (f x)))).

Axiom make_ket_spec :
  forall (n:Z) (f:Z -> complex), (n >= 0%Z)%Z -> is_a_ket_l (make_ket n f) n.

Axiom make_ket_spec1 :
  forall (n:Z) (f:Z -> complex), (n >= 0%Z)%Z -> forall (i:Z),
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) ->
  ((get_ket (make_ket n f) i) = (f i)).

Axiom make_ket_spec2 :
  forall (n:Z) (f:Z -> complex), (n >= 0%Z)%Z -> forall (i:Z) (j:Z),
  (valid_index (make_ket n f) i j) -> ((get (make_ket n f) i j) = (f i)).

Axiom assert_make_ket :
  forall (r:Z) (c:Z) (f:Z -> complex) (i:Z), (c = 1%Z) ->
  ((0%Z <= i)%Z /\ (i < (power_ 2%Z r))%Z) ->
  ((get_ket (make_ket r f) i) = (f i)).

Axiom assert_make_ket_l :
  forall (l:Z) (f:Z -> complex) (i:Z), (0%Z <= l)%Z ->
  ((get_ket (make_ket l f) i) = (f i)).

Axiom make_ket_length :
  forall (l:Z) (f:Z -> complex), (0%Z <= l)%Z ->
  ((ket_length (make_ket l f)) = l).

Axiom make_ket_rows :
  forall (l:Z) (f:Z -> complex), (0%Z <= l)%Z ->
  ((rows (make_ket l f)) = (power_ 2%Z l)).

Axiom make_ket_columns :
  forall (l:Z) (f:Z -> complex), (0%Z <= l)%Z ->
  ((columns (make_ket l f)) = 1%Z).

Parameter make_ket_constant: Z -> complex -> matrix complex.

Axiom make_ket_constant_def :
  forall (n:Z) (c:complex), (n >= 0%Z)%Z ->
  ((make_ket_constant n c) = (make_ket n (fun (i:Z) => c))).

Axiom make_ket_constant_spec :
  forall (n:Z) (c:complex), (n >= 0%Z)%Z ->
  is_a_ket_l (make_ket_constant n c) n.

Axiom make_ket_constant_spec1 :
  forall (n:Z) (c:complex), (n >= 0%Z)%Z -> forall (i:Z),
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) ->
  ((get_ket (make_ket_constant n c) i) = c).

Axiom make_ket_constant_spec2 :
  forall (n:Z) (c:complex), (n >= 0%Z)%Z -> forall (i:Z) (j:Z),
  (valid_index (make_ket_constant n c) i j) ->
  ((get (make_ket_constant n c) i j) = c).

Axiom set_equal_ket :
  forall (m:matrix complex) (n:matrix complex), (is_a_ket m) ->
  (is_a_ket n) -> ((ket_length m) = (ket_length n)) ->
  (forall (i:Z), ((0%Z <= i)%Z /\ (i < (power 2%Z (ket_length m)))%Z) ->
   ((get_ket m i) = (get_ket n i))) ->
  (m = n).

Axiom set_equal_ket_ :
  forall (m:matrix complex) (n:matrix complex),
  (exists l:Z,
   (is_a_ket_l m l) /\
   ((is_a_ket_l n l) /\
    forall (i:Z), ((0%Z <= i)%Z /\ (i < (power 2%Z l))%Z) ->
    ((get_ket m i) = (get_ket n i)))) ->
  (m = n).

Parameter add_ket: (matrix complex) -> (matrix complex) -> matrix complex.

Axiom add_ket_def :
  forall (m:matrix complex) (n:matrix complex), (is_a_ket m) ->
  (is_a_ket n) -> ((ket_length m) = (ket_length n)) ->
  ((add_ket m n) = (add_mat m n)).

Axiom add_ket_spec :
  forall (m:matrix complex) (n:matrix complex), (is_a_ket m) ->
  (is_a_ket n) -> ((ket_length m) = (ket_length n)) -> is_a_ket (add_ket m n).

Axiom add_ket_spec1 :
  forall (m:matrix complex) (n:matrix complex), (is_a_ket m) ->
  (is_a_ket n) -> ((ket_length m) = (ket_length n)) ->
  ((ket_length (add_ket m n)) = (ket_length m)).

Axiom add_ket_spec2 :
  forall (m:matrix complex) (n:matrix complex), (is_a_ket m) ->
  (is_a_ket n) -> ((ket_length m) = (ket_length n)) -> forall (i:Z),
  (ket_valid_index (add_ket m n) i) ->
  ((get_ket (add_ket m n) i) = (infix_pldt (get_ket m i) (get_ket n i))).

Parameter add_ket_l:
  (matrix complex) -> (matrix complex) -> Z -> matrix complex.

Axiom add_ket_l_def :
  forall (m:matrix complex) (n:matrix complex) (l:Z), (0%Z <= l)%Z ->
  ((add_ket_l m n l) =
   (make_ket l (fun (i:Z) => (infix_pldt (get_ket m i) (get_ket n i))))).

Axiom add_ket_l_spec :
  forall (m:matrix complex) (n:matrix complex) (l:Z), (0%Z <= l)%Z ->
  is_a_ket_l (add_ket_l m n l) l.

Axiom add_ket_l_spec1 :
  forall (m:matrix complex) (n:matrix complex) (l:Z), (0%Z <= l)%Z ->
  ((ket_length (add_ket_l m n l)) = l).

Axiom add_ket_l_spec2 :
  forall (m:matrix complex) (n:matrix complex) (l:Z), (0%Z <= l)%Z ->
  forall (i:Z),
  ((get_ket (add_ket_l m n l) i) = (infix_pldt (get_ket m i) (get_ket n i))).

Axiom add_ket_l_spec3 :
  forall (m:matrix complex) (n:matrix complex) (l:Z), (0%Z <= l)%Z ->
  (is_a_ket_l m l) -> (is_a_ket_l n l) -> ((add_ket_l m n l) = (add_mat m n)).

Axiom add_ket_l_to_add_mat :
  forall (m:matrix complex) (n:matrix complex) (l:Z), (0%Z <= l)%Z ->
  (is_a_ket_l m l) -> (is_a_ket_l n l) -> ((add_ket_l m n l) = (add_mat m n)).

Axiom null_add_ket_l :
  forall (m:matrix complex) (n:matrix complex) (l:Z), (is_a_ket_l m l) ->
  (is_a_ket_l n l) -> (null_mat m) -> ((add_ket_l m n l) = n).

Axiom add_ket_l_null :
  forall (m:matrix complex) (n:matrix complex) (l:Z), (is_a_ket_l m l) ->
  (is_a_ket_l n l) -> (null_mat n) -> ((add_ket_l m n l) = m).

Parameter add_ket_l_eq:
  (matrix complex) -> (matrix complex) -> (matrix complex) ->
  (matrix complex) -> Z -> unit.

Axiom add_ket_l_eq_def :
  forall (m:matrix complex) (m':matrix complex) (n:matrix complex)
    (n':matrix complex) (l:Z),
  (is_a_ket_l m l) -> (is_a_ket_l n l) -> (m = m') -> (n = n') ->
  ((add_ket_l_eq m m' n n' l) = tt).

Axiom add_ket_l_eq_spec :
  forall (m:matrix complex) (m':matrix complex) (n:matrix complex)
    (n':matrix complex) (l:Z),
  (is_a_ket_l m l) -> (is_a_ket_l n l) -> (m = m') -> (n = n') ->
  ((((fun (y0:matrix complex) (y1:matrix complex) (y2:Z) =>
      (add_ket_l y0 y1 y2))
     m)
    n)
   =
   (((fun (y0:matrix complex) (y1:matrix complex) (y2:Z) =>
      (add_ket_l y0 y1 y2))
     m')
    n')).

Axiom add_ket_l_value :
  forall (m:matrix complex) (n:matrix complex) (l:Z) (i:Z),
  ((0%Z <= i)%Z /\ (i < (power 2%Z l))%Z) -> (0%Z <= l)%Z ->
  ((get_ket (add_ket_l m n l) i) = (infix_pldt (get_ket m i) (get_ket n i))).

Axiom add_ket_l_length :
  forall (m:matrix complex) (n:matrix complex) (l:Z), (0%Z <= l)%Z ->
  ((ket_length (add_ket_l m n l)) = l).

Axiom add_ket_l_rows :
  forall (m:matrix complex) (n:matrix complex) (l:Z), (0%Z <= l)%Z ->
  ((rows (add_ket_l m n l)) = (power_ 2%Z l)).

Axiom add_ket_l_columns :
  forall (m:matrix complex) (n:matrix complex) (l:Z), (0%Z <= l)%Z ->
  ((columns (add_ket_l m n l)) = 1%Z).

Axiom add_ket_l_values :
  forall (m:matrix complex) (n:matrix complex) (l:Z), (0%Z <= l)%Z ->
  forall (i:Z), ((0%Z <= i)%Z /\ (i < (power_ 2%Z l))%Z) ->
  ((get_ket (add_ket_l m n l) i) = (infix_pldt (get_ket m i) (get_ket n i))).

Axiom set_equal_ket_l :
  forall (m:matrix complex) (n:matrix complex),
  (exists l:Z, (is_a_ket_l m l) /\ (is_a_ket_l n l)) ->
  (forall (i:Z), ((0%Z <= i)%Z /\ (i < (power 2%Z (ket_length m)))%Z) ->
   ((get_ket m i) = (get_ket n i))) ->
  (m = n).

Axiom set_equal_ket_l_ :
  forall (m:matrix complex) (n:matrix complex) (l:Z), (is_a_ket_l m l) ->
  (is_a_ket_l n l) ->
  (forall (i:Z), ((0%Z <= i)%Z /\ (i < (power_ 2%Z l))%Z) ->
   ((get_ket m i) = (get_ket n i))) ->
  (m = n).

Axiom get_ket_length :
  forall (m:matrix complex) (n:Z), (0%Z <= n)%Z -> ((columns m) = 1%Z) ->
  ((rows m) = (power 2%Z n)) -> ((ket_length m) = n).

Axiom set_ket_length :
  forall (m:matrix complex) (n:Z), (0%Z <= n)%Z -> (is_a_ket m) ->
  ((ket_length m) = n) -> ((rows m) = (power 2%Z n)).

Axiom scalar_ket :
  forall (x:matrix complex) (a:complex), (is_a_ket x) ->
  is_a_ket (infix_asdtdt a x).

Axiom scalar_ket_length :
  forall (m:matrix complex) (a:complex), (is_a_ket m) ->
  ((ket_length (infix_asdtdt a m)) = (ket_length m)).

Axiom scalar_ket_valid_index :
  forall (m:matrix complex) (a:complex) (i:Z), (ket_valid_index m i) ->
  (is_a_ket m) -> ket_valid_index (infix_asdtdt a m) i.

Axiom scalar_ket_l :
  forall (x:matrix complex) (l:Z) (a:complex), (is_a_ket_l x l) ->
  is_a_ket_l (infix_asdtdt a x) l.

Axiom scalar_ket_l_values :
  forall (a:complex) (x:matrix complex) (l:Z), (is_a_ket_l x l) ->
  forall (i:Z), ((0%Z <= i)%Z /\ (i < (power_ 2%Z l))%Z) ->
  ((get_ket (infix_asdtdt a x) i) = (infix_asdt a (get_ket x i))).

Axiom scalar_ket_l_value :
  forall (a:complex) (x:matrix complex) (i:Z) (l:Z),
  ((0%Z <= i)%Z /\ (i < (power_ 2%Z l))%Z) -> (is_a_ket_l x l) ->
  ((get_ket (infix_asdtdt a x) i) = (infix_asdt a (get_ket x i))).

Axiom scalar_ket_value :
  forall (x:matrix complex) (i:Z) (a:complex),
  ((get_ket (infix_asdtdt a x) i) = (infix_asdt a (get_ket x i))).

Axiom scalar_ket_value_rev :
  forall (x:matrix complex) (i:Z) (a:complex),
  ((infix_asdt a (get_ket x i)) = (get_ket (infix_asdtdt a x) i)).

Axiom add_ket_is_a_ket :
  forall (x:matrix complex) (y:matrix complex), (is_a_ket x) ->
  (is_a_ket y) -> ((ket_length x) = (ket_length y)) -> is_a_ket (add_mat x y).

Axiom set_ket_length_gen :
  forall (m:matrix complex) (n:Z), (0%Z <= n)%Z -> (is_a_ket m) ->
  ((power 2%Z (ket_length m)) = n) -> ((rows m) = n).

Axiom set_is_a_ket :
  forall (m:matrix complex), ((columns m) = 1%Z) ->
  (exists s:Z, (s >= 0%Z)%Z /\ ((rows m) = (power 2%Z s))) -> is_a_ket m.

Axiom set_is_a_ket_l :
  forall (m:matrix complex) (l:Z), (l >= 0%Z)%Z -> ((columns m) = 1%Z) ->
  ((rows m) = (power 2%Z l)) -> is_a_ket_l m l.

Axiom set_is_a_ket_p :
  forall (m:matrix complex) (l:Z), (l >= 0%Z)%Z -> ((columns m) = 1%Z) ->
  ((rows m) = (power 2%Z l)) -> is_a_ket m.

Axiom get_is_a_ket :
  forall (m:matrix complex), (is_a_ket m) -> ((columns m) = 1%Z).

Axiom get_is_a_ket1 :
  forall (m:matrix complex), (is_a_ket m) ->
  ((rows m) = (power 2%Z (ket_length m))).

Axiom get_ket_columns :
  forall (m:matrix complex), (is_a_ket m) -> ((columns m) = 1%Z).

Axiom get_ket_rows :
  forall (m:matrix complex), (is_a_ket m) ->
  ((rows m) = (power 2%Z (ket_length m))).

Axiom get_ket_rows_gen :
  forall (m:matrix complex) (i:Z), (is_a_ket m) ->
  (i = (power 2%Z (ket_length m))) -> ((rows m) = i).

Axiom get_ket_rows_length :
  forall (m:matrix complex) (l:Z), (is_a_ket m) -> ((ket_length m) = l) ->
  ((rows m) = (power 2%Z l)).

Axiom ket_kronecker :
  forall (m:matrix complex) (n:matrix complex), (is_a_ket m) ->
  (is_a_ket n) -> is_a_ket (kronecker m n).

Axiom ket_kronecker1 :
  forall (m:matrix complex) (n:matrix complex), (is_a_ket m) ->
  (is_a_ket n) ->
  ((ket_length (kronecker m n)) = ((ket_length m) + (ket_length n))%Z).

Axiom ket_kronecker_l :
  forall (m:matrix complex) (n:matrix complex) (l:Z) (l':Z),
  (is_a_ket_l m l) -> (is_a_ket_l n l') ->
  is_a_ket_l (kronecker m n) (l + l')%Z.

Axiom set_ket_kron_l :
  forall (m:matrix complex) (n:matrix complex) (l:Z) (l':Z) (l'':Z),
  (is_a_ket_l m l) -> (is_a_ket_l n l') -> (l'' = (l + l')%Z) ->
  is_a_ket_l (kronecker m n) l''.

Parameter ket: Z -> Z -> matrix complex.

Axiom ket_def :
  forall (n:Z) (i:Z), (0%Z <= n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) ->
  ((ket n i) = (set1 (make (power 2%Z n) 1%Z c_zero) i 0%Z c_one)).

Axiom ket_def1 :
  forall (n:Z) (i:Z), (0%Z <= n)%Z -> ~ (0%Z <= i)%Z ->
  ((ket n i) = (make (power 2%Z n) 1%Z c_zero)).

Axiom ket_def2 :
  forall (n:Z) (i:Z), (0%Z <= n)%Z -> ~ (i < (power 2%Z n))%Z ->
  ((ket n i) = (make (power 2%Z n) 1%Z c_zero)).

Axiom ket_spec : forall (n:Z) (i:Z), (0%Z <= n)%Z -> is_a_ket (ket n i).

Axiom ket_spec1 :
  forall (n:Z) (i:Z), (0%Z <= n)%Z -> ((ket_length (ket n i)) = n).

Axiom ket_spec2 :
  forall (n:Z) (i:Z), (0%Z <= n)%Z -> ((columns (ket n i)) = 1%Z).

Axiom ket_spec3 :
  forall (n:Z) (i:Z), (0%Z <= n)%Z -> ((rows (ket n i)) = (power 2%Z n)).

Axiom ket_spec4 :
  forall (n:Z) (i:Z), (0%Z <= n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) -> forall (j:Z),
  (valid_index (ket n i) j 0%Z) -> ((get (ket n i) j 0%Z) = (indic j i)).

Axiom ket_spec5 :
  forall (n:Z) (i:Z), (0%Z <= n)%Z -> forall (j:Z),
  (valid_index (ket n i) j 0%Z) -> ~ (i = j) ->
  ((get (ket n i) j 0%Z) = c_zero).

Axiom ket_spec6 :
  forall (n:Z) (i:Z), (0%Z <= n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) -> ((get (ket n i) i 0%Z) = c_one).

Parameter scal_ket_zero: matrix complex.

Axiom scal_ket_zero_def : (scal_ket_zero = (ket 0%Z 0%Z)).

Parameter scal_ket_one: matrix complex.

Axiom scal_ket_one_def : (scal_ket_one = (ket 0%Z 1%Z)).

Axiom ket_l :
  forall (n:Z) (m:Z) (i:Z), (0%Z <= n)%Z -> (n = m) -> is_a_ket_l (ket n i) m.

Axiom ket_ket_length :
  forall (n:Z) (m:Z) (i:Z), (0%Z <= n)%Z -> (n = m) ->
  ((ket_length (ket n i)) = m).

Axiom ket_length_explicit :
  forall (n:Z) (i:Z), (0%Z <= n)%Z -> ((ket_length (ket n i)) = n).

Axiom ket_eq :
  forall (n1:Z) (n2:Z) (i1:Z) (i2:Z), (0%Z <= n1)%Z -> (n1 = n2) ->
  (i1 = i2) -> ((ket n1 i1) = (ket n2 i2)).

Axiom ket_rows :
  forall (n:Z) (i:Z), (0%Z <= n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) ->
  ((rows (ket n i)) = (power 2%Z n)).

Axiom ket_columns :
  forall (n:Z) (i:Z), (0%Z <= n)%Z -> ((columns (ket n i)) = 1%Z).

Axiom ket_value :
  forall (n:Z) (i:Z) (j:Z), (0%Z <= n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) ->
  ((0%Z <= j)%Z /\ (j < (power 2%Z n))%Z) ->
  ((i = j) -> ((get (ket n i) j 0%Z) = c_one)) /\
  (~ (i = j) -> ((get (ket n i) j 0%Z) = c_zero)).

Axiom g_ket_value :
  forall (n:Z) (i:Z) (j:Z), (0%Z <= n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) ->
  ((0%Z <= j)%Z /\ (j < (power 2%Z n))%Z) ->
  ((i = j) -> ((get_ket (ket n i) j) = c_one)) /\
  (~ (i = j) -> ((get_ket (ket n i) j) = c_zero)).

Axiom norm_ket_basis :
  forall (n:Z) (i:Z), (n >= 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) ->
  ((ket_norm_l (ket n i) n) = c_one).

Axiom get_ket_ :
  forall (m:matrix complex) (i:Z) (n:Z), (m = (ket n i)) -> (0%Z <= n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) -> is_a_ket m.

Axiom get_ket_1 :
  forall (m:matrix complex) (i:Z) (n:Z), (m = (ket n i)) -> (0%Z <= n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) -> ((ket_length m) = n).

Axiom get_ket_2 :
  forall (m:matrix complex) (i:Z) (n:Z), (m = (ket n i)) -> (0%Z <= n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) -> ((columns m) = 1%Z).

Axiom get_ket_3 :
  forall (m:matrix complex) (i:Z) (n:Z), (m = (ket n i)) -> (0%Z <= n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) -> ((rows m) = (power 2%Z n)).

Axiom get_ket_4 :
  forall (m:matrix complex) (i:Z) (n:Z), (m = (ket n i)) -> (0%Z <= n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) -> forall (j:Z),
  (valid_index m j 0%Z) -> ((get m j 0%Z) = (indic j i)).

Axiom get_ket_5 :
  forall (m:matrix complex) (i:Z) (n:Z), (m = (ket n i)) -> (0%Z <= n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) -> forall (j:Z),
  (valid_index m j 0%Z) -> ~ (i = j) -> ((get m j 0%Z) = c_zero).

Axiom get_ket_6 :
  forall (m:matrix complex) (i:Z) (n:Z), (m = (ket n i)) -> (0%Z <= n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) -> ((get m i 0%Z) = c_one).

Axiom get_ket_value :
  forall (i:Z) (n:Z) (j:Z), (0%Z <= n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) ->
  ((0%Z <= j)%Z /\ (j < (power 2%Z n))%Z) ->
  ((get (ket n i) j 0%Z) = (indic j i)).

Axiom get_ket_values :
  forall (i:Z) (n:Z), (0%Z <= n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) -> forall (j:Z),
  ((0%Z <= j)%Z /\ (j < (power 2%Z n))%Z) ->
  ((get (ket n i) j 0%Z) = (indic j i)).

Axiom get_ket_value_z :
  forall (i:Z) (n:Z) (j:Z) (z:Z), (z = 0%Z) -> (0%Z <= n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) ->
  ((0%Z <= j)%Z /\ (j < (power 2%Z n))%Z) ->
  ((get (ket n i) j z) = (indic j i)).

Axiom get__ket_value :
  forall (i:Z) (j:Z) (n:Z), (0%Z <= n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) ->
  ((0%Z <= j)%Z /\ (j < (power 2%Z n))%Z) ->
  ((get_ket (ket n i) j) = (indic j i)).

Axiom set_ket :
  forall (m:matrix complex) (i:Z) (n:Z), (0%Z <= n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) -> ((columns m) = 1%Z) ->
  ((rows m) = (power 2%Z n)) ->
  (forall (j:Z), (valid_index m j 0%Z) -> ((get m j 0%Z) = (indic j i))) ->
  (m = (ket n i)).

Axiom kronecker_kets :
  forall (i1:Z) (i2:Z) (n1:Z) (n2:Z), (0%Z <= n1)%Z -> (0%Z <= n2)%Z ->
  ((0%Z <= i1)%Z /\ (i1 < (power 2%Z n1))%Z) ->
  ((0%Z <= i2)%Z /\ (i2 < (power 2%Z n2))%Z) ->
  ((kronecker (ket n1 i1) (ket n2 i2)) =
   (ket (n1 + n2)%Z ((i1 * (power 2%Z n2))%Z + i2)%Z)).

Axiom kronecker_ket_l :
  forall (x:matrix complex) (y:matrix complex) (n1:Z) (n2:Z),
  (0%Z <= n1)%Z -> (0%Z <= n2)%Z -> (is_a_ket_l x n1) -> (is_a_ket_l y n2) ->
  is_a_ket_l (kronecker x y) (n1 + n2)%Z.

Axiom kronecker_ket_l_sum :
  forall (x:matrix complex) (y:matrix complex) (n1:Z) (n2:Z) (n3:Z),
  (0%Z <= n1)%Z -> (0%Z <= n2)%Z -> (is_a_ket_l x n1) -> (is_a_ket_l y n2) ->
  (n3 = (n1 + n2)%Z) -> is_a_ket_l (kronecker x y) n3.

Axiom kronecker_kets_bin_to_int :
  forall (f1:Z -> Z) (f2:Z -> Z) (n1:Z) (n2:Z), (binary f1) -> (binary f2) ->
  (0%Z <= n1)%Z -> (0%Z <= n2)%Z ->
  ((kronecker (ket n1 (bin_to_int f1 n1)) (ket n2 (bin_to_int f2 n2))) =
   (ket (n1 + n2)%Z
    (((bin_to_int f1 n1) * (power 2%Z n2))%Z + (bin_to_int f2 n2))%Z)).

Parameter concat: bitvec -> bitvec -> bitvec.

Parameter result12: bitvec -> bitvec -> Z -> Z.

Axiom result_def12 :
  forall (bv1:bitvec) (bv2:bitvec) (i:Z),
  ((((length bv1) <= i)%Z /\ (i < ((length bv1) + (length bv2))%Z)%Z) ->
   (((result12 bv1 bv2) i) = ((getbv bv2) (i - (length bv1))%Z))) /\
  (~ (((length bv1) <= i)%Z /\ (i < ((length bv1) + (length bv2))%Z)%Z) ->
   (((result12 bv1 bv2) i) = ((getbv bv1) i))).

Axiom concat_def :
  forall (bv1:bitvec) (bv2:bitvec),
  ((concat bv1 bv2) =
   (make_bv (result12 bv1 bv2) ((length bv1) + (length bv2))%Z)).

Axiom concat_spec :
  forall (bv1:bitvec) (bv2:bitvec),
  ((length (concat bv1 bv2)) = ((length bv1) + (length bv2))%Z).

Axiom concat_spec1 :
  forall (bv1:bitvec) (bv2:bitvec), forall (i:Z),
  ((0%Z <= i)%Z /\ (i < (length bv1))%Z) ->
  (((getbv (concat bv1 bv2)) i) = ((getbv bv1) i)).

Axiom concat_spec2 :
  forall (bv1:bitvec) (bv2:bitvec), forall (i:Z),
  ((length (concat bv1 bv2)) <= i)%Z ->
  (((getbv (concat bv1 bv2)) i) = ((getbv bv1) i)).

Axiom concat_spec3 :
  forall (bv1:bitvec) (bv2:bitvec), forall (i:Z),
  (((length bv1) <= i)%Z /\ (i < (length (concat bv1 bv2)))%Z) ->
  (((getbv (concat bv1 bv2)) i) = ((getbv bv2) (i - (length bv1))%Z)).

Axiom concat_length :
  forall (bv1:bitvec) (bv2:bitvec),
  ((length (concat bv1 bv2)) = ((length bv1) + (length bv2))%Z).

Parameter hpart: bitvec -> Z -> bitvec.

Axiom hpart_def :
  forall (bv:bitvec) (m:Z), (0%Z <= m)%Z ->
  ((hpart bv m) = (make_bv (getbv bv) m)).

Axiom hpart_spec :
  forall (bv:bitvec) (m:Z), (0%Z <= m)%Z -> ((length (hpart bv m)) = m).

Axiom hpart_spec1 :
  forall (bv:bitvec) (m:Z), (0%Z <= m)%Z -> ((length bv) = m) ->
  ((hpart bv m) = bv).

Axiom hpart_spec2 :
  forall (bv:bitvec) (m:Z), (0%Z <= m)%Z -> forall (k:Z),
  ((0%Z <= k)%Z /\ (k < m)%Z) -> (((getbv (hpart bv m)) k) = ((getbv bv) k)).

Axiom hpart_spec3 :
  forall (bv:bitvec) (m:Z), (0%Z <= m)%Z -> forall (k:Z), ~ (0%Z <= k)%Z ->
  (((getbv (hpart bv m)) k) = 0%Z).

Axiom hpart_spec4 :
  forall (bv:bitvec) (m:Z), (0%Z <= m)%Z -> forall (k:Z), ~ (k < m)%Z ->
  (((getbv (hpart bv m)) k) = 0%Z).

Axiom hpart_value :
  forall (bv:bitvec) (m:Z) (i:Z), (0%Z <= m)%Z ->
  (((0%Z <= i)%Z /\ (i < m)%Z) ->
   (((getbv (hpart bv m)) i) = ((getbv bv) i))) /\
  (~ ((0%Z <= i)%Z /\ (i < m)%Z) -> (((getbv (hpart bv m)) i) = 0%Z)).

Axiom hpart_value_b :
  forall (bv:bitvec) (m:Z) (i:Z), ((0%Z <= i)%Z /\ (i < m)%Z) ->
  (((getbv (hpart bv m)) i) = ((getbv bv) i)).

Parameter tpart: bitvec -> Z -> bitvec.

Axiom tpart_def :
  forall (bv:bitvec) (m:Z), (0%Z <= m)%Z -> ((length bv) >= m)%Z ->
  ((tpart bv m) =
   (make_bv (fun (k:Z) => ((getbv bv) (k + m)%Z)) ((length bv) - m)%Z)).

Axiom tpart_def1 :
  forall (bv:bitvec) (m:Z), (0%Z <= m)%Z -> ~ ((length bv) >= m)%Z ->
  ((tpart bv m) = (make_bv (fun (k:Z) => ((getbv bv) (k + m)%Z)) 0%Z)).

Axiom tpart_spec :
  forall (bv:bitvec) (m:Z), (0%Z <= m)%Z -> ((length bv) >= m)%Z ->
  ((length (tpart bv m)) = ((length bv) - m)%Z).

Axiom tpart_spec1 :
  forall (bv:bitvec) (m:Z), (0%Z <= m)%Z -> ((length bv) < m)%Z ->
  ((length (tpart bv m)) = 0%Z).

Axiom tpart_spec2 :
  forall (bv:bitvec) (m:Z), (0%Z <= m)%Z -> forall (k:Z),
  ((0%Z <= k)%Z /\ (k < (length (tpart bv m)))%Z) ->
  (((getbv (tpart bv m)) k) = ((getbv bv) (k + m)%Z)).

Parameter bv_tail: bitvec -> Z -> bitvec.

Axiom bv_tail_def :
  forall (bv:bitvec) (m:Z), ((0%Z <= m)%Z /\ (m <= ((length bv) - m)%Z)%Z) ->
  ((bv_tail bv m) = (tpart bv ((length bv) - m)%Z)).

Axiom bv_tail_spec :
  forall (bv:bitvec) (m:Z), ((0%Z <= m)%Z /\ (m <= ((length bv) - m)%Z)%Z) ->
  ((length (bv_tail bv m)) = m).

Axiom bv_tail_spec1 :
  forall (bv:bitvec) (m:Z), ((0%Z <= m)%Z /\ (m <= ((length bv) - m)%Z)%Z) ->
  forall (k:Z), ((0%Z <= k)%Z /\ (k < (length (bv_tail bv m)))%Z) ->
  (((getbv (bv_tail bv m)) k) = ((getbv bv) (k + ((length bv) - m)%Z)%Z)).

Parameter last: bitvec -> Z.

Axiom last_def :
  forall (bv:bitvec), ((length bv) >= 1%Z)%Z ->
  ((last bv) = ((getbv bv) ((length bv) - 1%Z)%Z)).

Parameter bv_head: bitvec -> Z -> bitvec.

Axiom bv_head_def :
  forall (bv:bitvec) (m:Z), ((0%Z <= m)%Z /\ (m <= (length bv))%Z) ->
  ((bv_head bv m) = (hpart bv ((length bv) - m)%Z)).

Axiom bv_head_spec :
  forall (bv:bitvec) (m:Z), ((0%Z <= m)%Z /\ (m <= (length bv))%Z) ->
  ((length (bv_head bv m)) = ((length bv) - m)%Z).

Axiom bv_head_spec1 :
  forall (bv:bitvec) (m:Z), ((0%Z <= m)%Z /\ (m <= (length bv))%Z) ->
  forall (k:Z), ((0%Z <= k)%Z /\ (k < (length (bv_head bv m)))%Z) ->
  (((getbv (bv_head bv m)) k) = ((getbv bv) k)).

Parameter htpart: bitvec -> Z -> Z -> bitvec.

Axiom htpart_def :
  forall (bv:bitvec) (k:Z) (n:Z), (0%Z <= k)%Z -> (0%Z <= n)%Z ->
  ((htpart bv k n) = (make_bv (fun (i:Z) => ((getbv bv) (k + i)%Z)) n)).

Axiom htpart_spec :
  forall (bv:bitvec) (k:Z) (n:Z), (0%Z <= k)%Z -> (0%Z <= n)%Z ->
  ((length (htpart bv k n)) = n).

Axiom htpart_spec1 :
  forall (bv:bitvec) (k:Z) (n:Z), (0%Z <= k)%Z -> (0%Z <= n)%Z ->
  forall (i:Z), ((0%Z <= i)%Z /\ (i < n)%Z) ->
  (((getbv (htpart bv k n)) i) = ((getbv bv) (k + i)%Z)).

Axiom tpart_value :
  forall (bv:bitvec) (m:Z) (i:Z), (0%Z <= m)%Z ->
  (((0%Z <= i)%Z /\ (i < ((length bv) - m)%Z)%Z) ->
   (((getbv (tpart bv m)) i) = ((getbv bv) (i + m)%Z))) /\
  (~ ((0%Z <= i)%Z /\ (i < ((length bv) - m)%Z)%Z) ->
   (((getbv (tpart bv m)) i) = 0%Z)).

Axiom tpart_value_b :
  forall (bv:bitvec) (m:Z) (i:Z), (0%Z <= m)%Z ->
  ((0%Z <= i)%Z /\ (i < ((length bv) - m)%Z)%Z) ->
  (((getbv (tpart bv m)) i) = ((getbv bv) (i + m)%Z)).

Axiom tpart_length :
  forall (bv:bitvec) (m:Z), ((0%Z <= m)%Z /\ (m <= (length bv))%Z) ->
  ((length (tpart bv m)) = ((length bv) - m)%Z).

Axiom htpart_value :
  forall (bv:bitvec) (k:Z) (n:Z) (i:Z), (0%Z <= k)%Z -> (0%Z <= n)%Z ->
  (((0%Z <= i)%Z /\ (i < n)%Z) ->
   (((getbv (htpart bv k n)) i) = ((getbv bv) (k + i)%Z))) /\
  (~ ((0%Z <= i)%Z /\ (i < n)%Z) -> (((getbv (htpart bv k n)) i) = 0%Z)).

Axiom htpart_value_b :
  forall (bv:bitvec) (k:Z) (n:Z) (i:Z), (0%Z <= k)%Z -> (0%Z <= n)%Z ->
  ((0%Z <= i)%Z /\ (i < n)%Z) ->
  (((getbv (htpart bv k n)) i) = ((getbv bv) (k + i)%Z)).

Axiom htpart_product_ :
  forall (x:bitvec) (k:Z) (n:Z) (n':Z), ((0%Z <= k)%Z /\ (k < n)%Z) ->
  (n' = (n - k)%Z) ->
  ((ind_iproduct (getbv (htpart x k n')) 0%Z (n - k)%Z) =
   (ind_iproduct (getbv x) k n)).

Axiom htpart_product_one :
  forall (x:bitvec) (k:Z) (n:Z) (n':Z), ((0%Z <= k)%Z /\ (k < n)%Z) ->
  ((length x) = n) -> (n' = (n - k)%Z) ->
  ((ind_iproduct (getbv x) 0%Z n) = 1%Z) ->
  ((ind_iproduct (getbv (htpart x k n')) 0%Z (n - k)%Z) = 1%Z).

Axiom htpart_product_zero :
  forall (x:bitvec) (k:Z) (n:Z) (n':Z), ((0%Z <= k)%Z /\ (k < n)%Z) ->
  ((length x) = n) -> (n' = (n - k)%Z) ->
  (exists j:Z, ((k <= j)%Z /\ (j < n)%Z) /\ ~ (((getbv x) j) = 1%Z)) ->
  ((ind_iproduct (getbv (htpart x k n')) 0%Z (n - k)%Z) = 0%Z).

Axiom htpart_product :
  forall (x:bitvec) (k:Z) (n:Z) (n':Z), ((0%Z <= k)%Z /\ (k < n)%Z) ->
  ((length x) = n) -> (n' = (n - k)%Z) ->
  ((forall (j:Z), ((k <= j)%Z /\ (j < n)%Z) -> (((getbv x) j) = 1%Z)) ->
   ((ind_iproduct (getbv (htpart x k n')) 0%Z (n - k)%Z) = 1%Z)) /\
  (~ (forall (j:Z), ((k <= j)%Z /\ (j < n)%Z) -> (((getbv x) j) = 1%Z)) ->
   ((ind_iproduct (getbv (htpart x k n')) 0%Z (n - k)%Z) = 0%Z)).

Axiom htpart_length :
  forall (bv:bitvec) (k:Z) (n:Z), (0%Z <= k)%Z -> (0%Z <= n)%Z ->
  ((length (htpart bv k n)) = n).

Axiom tpart_length_gen :
  forall (bv:bitvec) (m:Z) (l:Z), ((0%Z <= m)%Z /\ (m <= (length bv))%Z) ->
  (l = ((length bv) - m)%Z) -> ((length (tpart bv m)) = l).

Axiom concat_value_left :
  forall (bv1:bitvec) (bv2:bitvec) (i:Z),
  ((0%Z <= i)%Z /\ (i < (length bv1))%Z) ->
  (((getbv (concat bv1 bv2)) i) = ((getbv bv1) i)).

Axiom concat_value :
  forall (bv1:bitvec) (bv2:bitvec) (i:Z),
  ((((length bv1) <= i)%Z /\ (i < ((length bv1) + (length bv2))%Z)%Z) ->
   (((getbv (concat bv1 bv2)) i) = ((getbv bv2) (i - (length bv1))%Z))) /\
  (~ (((length bv1) <= i)%Z /\ (i < ((length bv1) + (length bv2))%Z)%Z) ->
   (((0%Z <= i)%Z /\ (i < (length bv1))%Z) ->
    (((getbv (concat bv1 bv2)) i) = ((getbv bv1) i))) /\
   (~ ((0%Z <= i)%Z /\ (i < (length bv1))%Z) ->
    (((getbv (concat bv1 bv2)) i) = 0%Z))).

Axiom concat_value_right :
  forall (bv1:bitvec) (bv2:bitvec) (i:Z),
  (((length bv1) <= i)%Z /\ (i < ((length bv1) + (length bv2))%Z)%Z) ->
  (((getbv (concat bv1 bv2)) i) = ((getbv bv2) (i - (length bv1))%Z)).

Axiom concat_value_out :
  forall (bv1:bitvec) (bv2:bitvec) (i:Z),
  (((length bv1) + (length bv2))%Z < i)%Z ->
  (((getbv (concat bv1 bv2)) i) = ((getbv bv1) i)).

Axiom concat_value_tpart :
  forall (bv1:bitvec) (bv2:bitvec) (i:Z),
  (((length bv1) <= i)%Z /\ (i < (length bv2))%Z) ->
  (((getbv (concat bv1 (tpart bv2 (length bv1)))) i) = ((getbv bv2) i)).

Axiom concat_value_ht :
  forall (bv1:bitvec) (bv2:bitvec) (bv3:bitvec) (bv4:bitvec) (i:Z),
  ((0%Z <= i)%Z /\ (i < (length bv3))%Z) -> ~ (0%Z <= i)%Z ->
  ~ ((length bv1) <= i)%Z -> (bv2 = (tpart bv3 (length bv1))) ->
  (((getbv (concat bv1 bv2)) i) = ((getbv bv4) i)).

Axiom concat_value_ht1 :
  forall (bv1:bitvec) (bv2:bitvec) (bv3:bitvec) (bv4:bitvec) (i:Z),
  ((0%Z <= i)%Z /\ (i < (length bv3))%Z) -> ~ (0%Z <= i)%Z ->
  (((getbv bv3) i) = ((getbv bv4) i)) -> (bv2 = (tpart bv3 (length bv1))) ->
  (((getbv (concat bv1 bv2)) i) = ((getbv bv4) i)).

Axiom concat_value_ht2 :
  forall (bv1:bitvec) (bv2:bitvec) (bv3:bitvec) (bv4:bitvec) (i:Z),
  ((0%Z <= i)%Z /\ (i < (length bv3))%Z) -> ~ (i < (length bv1))%Z ->
  ~ ((length bv1) <= i)%Z -> (bv2 = (tpart bv3 (length bv1))) ->
  (((getbv (concat bv1 bv2)) i) = ((getbv bv4) i)).

Axiom concat_value_ht3 :
  forall (bv1:bitvec) (bv2:bitvec) (bv3:bitvec) (bv4:bitvec) (i:Z),
  ((0%Z <= i)%Z /\ (i < (length bv3))%Z) -> ~ (i < (length bv1))%Z ->
  (((getbv bv3) i) = ((getbv bv4) i)) -> (bv2 = (tpart bv3 (length bv1))) ->
  (((getbv (concat bv1 bv2)) i) = ((getbv bv4) i)).

Axiom concat_value_ht4 :
  forall (bv1:bitvec) (bv2:bitvec) (bv3:bitvec) (bv4:bitvec) (i:Z),
  ((0%Z <= i)%Z /\ (i < (length bv3))%Z) ->
  (((getbv bv1) i) = ((getbv bv4) i)) -> ~ ((length bv1) <= i)%Z ->
  (bv2 = (tpart bv3 (length bv1))) ->
  (((getbv (concat bv1 bv2)) i) = ((getbv bv4) i)).

Axiom concat_value_ht5 :
  forall (bv1:bitvec) (bv2:bitvec) (bv3:bitvec) (bv4:bitvec) (i:Z),
  ((0%Z <= i)%Z /\ (i < (length bv3))%Z) ->
  (((getbv bv1) i) = ((getbv bv4) i)) ->
  (((getbv bv3) i) = ((getbv bv4) i)) -> (bv2 = (tpart bv3 (length bv1))) ->
  (((getbv (concat bv1 bv2)) i) = ((getbv bv4) i)).

Axiom concat_ht1 :
  forall (bv1:bitvec) (bv2:bitvec) (bv3:bitvec) (bv4:bitvec),
  (forall (i:Z), ((0%Z <= i)%Z /\ (i < (length bv1))%Z) ->
   (((getbv bv1) i) = ((getbv bv4) i))) ->
  (forall (i:Z), ((length bv1) <= i)%Z ->
   (((getbv bv3) i) = ((getbv bv4) i))) ->
  ((length bv4) = ((length bv1) + (length bv2))%Z) ->
  ((length bv3) >= ((length bv1) + (length bv2))%Z)%Z ->
  (bv2 = (tpart bv3 (length bv1))) -> ((concat bv1 bv2) = bv4).

Axiom set_concat :
  forall (bv1:bitvec) (bv2:bitvec) (bv4:bitvec),
  (forall (i:Z), ((0%Z <= i)%Z /\ (i < (length bv1))%Z) ->
   (((getbv bv1) i) = ((getbv bv4) i))) ->
  (forall (i:Z), ((length bv1) <= i)%Z ->
   (((getbv bv2) (i - (length bv1))%Z) = ((getbv bv4) i))) ->
  ((length bv4) = ((length bv1) + (length bv2))%Z) ->
  ((concat bv1 bv2) = bv4).

Axiom concat_m :
  forall (bv1:bitvec) (bv2:bitvec) (i1:Z) (i2:Z), (i1 > 0%Z)%Z ->
  (i2 > 0%Z)%Z -> ((length bv1) = i1) -> ((length bv2) = i2) ->
  ((concat (make_bv_m (getbv bv1) i1) (make_bv_m (getbv bv2) i2)) =
   (make_bv_m (getbv (concat bv1 bv2)) (i1 + i2)%Z)).

Axiom concat_comm :
  forall (bv1:bitvec) (bv2:bitvec),
  ((hpart (concat bv1 bv2) (length bv1)) = bv1).

Axiom concat_comm1 :
  forall (bv1:bitvec) (bv2:bitvec),
  ((tpart (concat bv1 bv2) (length bv1)) = bv2).

Axiom concat_and_rec :
  forall (bv:bitvec) (i:Z), ((0%Z <= i)%Z /\ (i <= (length bv))%Z) ->
  ((concat (hpart bv i) (tpart bv i)) = bv).

Parameter concat_int_bv: bitvec -> Z -> Z -> bitvec.

Axiom concat_int_bv_def :
  forall (bv:bitvec) (i:Z) (n:Z), (n > 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) ->
  ((concat_int_bv bv i n) = (concat bv (int_to_bv i n))).

Axiom concat_int_to_bv_value :
  forall (bv:bitvec) (i:Z) (n:Z) (j:Z), (n > 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) ->
  ((0%Z <= j)%Z /\ (j < (length (concat_int_bv bv i n)))%Z) ->
  (j < (length bv))%Z ->
  (((getbv (concat_int_bv bv i n)) j) = ((getbv bv) j)).

Axiom bv_to_int_concat :
  forall (bvx:bitvec) (bvy:bitvec),
  ((bv_to_int (concat bvx bvy)) =
   (((power 2%Z (length bvy)) * (bv_to_int bvx))%Z + (bv_to_int bvy))%Z).

Axiom concat_fin :
  forall (f1:Z -> Z) (f2:Z -> Z) (l1:Z) (l2:Z), (l1 >= 0%Z)%Z ->
  (l2 >= 0%Z)%Z -> (binary f1) -> (binary f2) ->
  ((make_bv
    ((((fun (y0:Z -> Z) (y1:Z -> Z) (y2:Z) (y3:Z) =>
        (concat_fun y0 y1 y2 y3))
       f1)
      f2)
     l1)
    (l1 + l2)%Z)
   = (concat (make_bv f1 l1) (make_bv f2 l2))).

Axiom bin_to_int_concat :
  forall (f1:Z -> Z) (f2:Z -> Z) (l1:Z) (l2:Z), (l1 >= 0%Z)%Z ->
  (l2 >= 0%Z)%Z -> (binary f1) -> (binary f2) ->
  ((bin_to_int
    ((((fun (y0:Z -> Z) (y1:Z -> Z) (y2:Z) (y3:Z) =>
        (concat_fun y0 y1 y2 y3))
       f1)
      f2)
     l1)
    (l1 + l2)%Z)
   = (((power 2%Z l2) * (bin_to_int f1 l1))%Z + (bin_to_int f2 l2))%Z).

Axiom bijective_concat :
  forall (i:Z) (j:Z), (0%Z <= i)%Z -> (0%Z <= j)%Z ->
  p_bijective (fun (o:(bitvec* bitvec)%type) => (concat (fir o) (sec o)))
  (cartesian_product (n_bvs i) (n_bvs j)) (n_bvs (i + j)%Z).

Axiom bijective_concat1 :
  forall (i:Z) (j:Z), (0%Z <= i)%Z -> (0%Z <= j)%Z ->
  p_bijective (fun (x:bitvec) => (hpart x i, tpart x i)) (n_bvs (i + j)%Z)
  (cartesian_product (n_bvs i) (n_bvs j)).

Axiom bv_to_int_hpart :
  forall (bv:bitvec) (l:Z), ((0%Z <= l)%Z /\ (l <= (length bv))%Z) ->
  ((bv_to_int (hpart bv l)) =
   (int.EuclideanDivision.div (bv_to_int bv) (power 2%Z ((length bv) - l)%Z))).

Axiom bv_to_int_tpart :
  forall (bv:bitvec) (l:Z), ((0%Z <= l)%Z /\ (l <= (length bv))%Z) ->
  ((bv_to_int (tpart bv l)) =
   (int.EuclideanDivision.mod1 (bv_to_int bv)
    (power 2%Z ((length bv) - l)%Z))).

Axiom bv_to_int_hpart_rev :
  forall (bv:bitvec) (l:Z) (q:Z), (q = ((length bv) - l)%Z) ->
  ((0%Z <= l)%Z /\ (l <= (length bv))%Z) ->
  ((int.EuclideanDivision.div (bv_to_int bv) (power_ 2%Z q)) =
   (bv_to_int (hpart bv l))).

Axiom bv_to_int_tpart_rev :
  forall (bv:bitvec) (l:Z) (q:Z), (q = ((length bv) - l)%Z) ->
  ((0%Z <= l)%Z /\ (l <= (length bv))%Z) ->
  ((int.EuclideanDivision.mod1 (bv_to_int bv) (power_ 2%Z q)) =
   (bv_to_int (tpart bv l))).

Parameter ind_basis_mat: Z -> Z -> Z -> Z -> matrix complex.

Axiom ind_basis_mat_def :
  forall (i:Z) (j:Z) (r:Z) (c:Z), ((0%Z <= i)%Z /\ (i < r)%Z) ->
  ((0%Z <= j)%Z /\ (j < c)%Z) ->
  ((ind_basis_mat i j r c) =
   (make_f r c (fun (k:Z) (l:Z) => (indic_2 k i l j)))).

Axiom ind_basis_mat_spec :
  forall (i:Z) (j:Z) (r:Z) (c:Z), ((0%Z <= i)%Z /\ (i < r)%Z) ->
  ((0%Z <= j)%Z /\ (j < c)%Z) -> ((rows (ind_basis_mat i j r c)) = r).

Axiom ind_basis_mat_spec1 :
  forall (i:Z) (j:Z) (r:Z) (c:Z), ((0%Z <= i)%Z /\ (i < r)%Z) ->
  ((0%Z <= j)%Z /\ (j < c)%Z) -> ((columns (ind_basis_mat i j r c)) = c).

Axiom ind_basis_mat_spec2 :
  forall (i:Z) (j:Z) (r:Z) (c:Z), ((0%Z <= i)%Z /\ (i < r)%Z) ->
  ((0%Z <= j)%Z /\ (j < c)%Z) -> forall (k:Z) (l:Z),
  (valid_index (ind_basis_mat i j r c) k l) ->
  ((get (ind_basis_mat i j r c) k l) = (indic_2 k i l j)).

Axiom ind_basis_mat_spec3 :
  forall (i:Z) (j:Z) (r:Z) (c:Z), ((0%Z <= i)%Z /\ (i < r)%Z) ->
  ((0%Z <= j)%Z /\ (j < c)%Z) -> forall (o:(Z* Z)%type),
  (mem o (mat_indices (ind_basis_mat i j r c))) ->
  ((get (ind_basis_mat i j r c) (fir o) (sec o)) = c_one) -> ((fir o) = i).

Axiom ind_basis_mat_spec4 :
  forall (i:Z) (j:Z) (r:Z) (c:Z), ((0%Z <= i)%Z /\ (i < r)%Z) ->
  ((0%Z <= j)%Z /\ (j < c)%Z) -> forall (o:(Z* Z)%type),
  (mem o (mat_indices (ind_basis_mat i j r c))) ->
  ((get (ind_basis_mat i j r c) (fir o) (sec o)) = c_one) -> ((sec o) = j).

Axiom ind_basis_mat_spec5 :
  forall (i:Z) (j:Z) (r:Z) (c:Z), ((0%Z <= i)%Z /\ (i < r)%Z) ->
  ((0%Z <= j)%Z /\ (j < c)%Z) -> forall (o:(Z* Z)%type),
  (mem o (mat_indices (ind_basis_mat i j r c))) ->
  (((fir o) = i) /\ ((sec o) = j)) ->
  ((get (ind_basis_mat i j r c) (fir o) (sec o)) = c_one).

Axiom ind_basis_mat_values :
  forall (i:Z) (j:Z) (r:Z) (c:Z), ((0%Z <= i)%Z /\ (i < r)%Z) ->
  ((0%Z <= j)%Z /\ (j < c)%Z) -> forall (i1:Z) (j1:Z),
  ((0%Z <= i1)%Z /\ (i1 < r)%Z) -> ((0%Z <= j1)%Z /\ (j1 < c)%Z) ->
  ((get (ind_basis_mat i j r c) i1 j1) = (indic_2 i i1 j j1)).

Axiom unic_ind_basis_mat :
  forall (i1:Z) (j1:Z) (i2:Z) (j2:Z) (r:Z) (c:Z),
  ((0%Z <= i1)%Z /\ (i1 < r)%Z) -> ((0%Z <= j1)%Z /\ (j1 < c)%Z) ->
  ((0%Z <= i2)%Z /\ (i2 < r)%Z) -> ((0%Z <= j2)%Z /\ (j2 < c)%Z) ->
  ((ind_basis_mat i1 j1 r c) = (ind_basis_mat i2 j2 r c)) ->
  ((i1, j1) = (i2, j2)).

Parameter basis_mat: Z -> Z -> set (matrix complex).

Parameter result13: Z -> Z -> (Z* Z)%type -> matrix complex.

Axiom result_def13 :
  forall (r:Z) (c:Z) (o:(Z* Z)%type),
  match o with
  | (i, j) =>
      ((((0%Z <= i)%Z /\ (i < r)%Z) /\ ((0%Z <= j)%Z /\ (j < c)%Z)) ->
       (((result13 r c) o) = (ind_basis_mat i j r c))) /\
      (~ (((0%Z <= i)%Z /\ (i < r)%Z) /\ ((0%Z <= j)%Z /\ (j < c)%Z)) ->
       (((result13 r c) o) = (make r c c_zero)))
  end.

Axiom basis_mat_def :
  forall (r:Z) (c:Z), (0%Z < r)%Z -> (0%Z < c)%Z ->
  ((basis_mat r c) =
   (map (result13 r c) (cartesian_product (to_fset 0%Z r) (to_fset 0%Z c)))).

Axiom basis_mat_spec :
  forall (r:Z) (c:Z), (0%Z < r)%Z -> (0%Z < c)%Z ->
  forall (m:matrix complex), (mem m (basis_mat r c)) ->
  exists i:Z, exists j:Z,
  ((0%Z <= i)%Z /\ (i < r)%Z) /\
  (((0%Z <= j)%Z /\ (j < c)%Z) /\ (m = (ind_basis_mat i j r c))).

Axiom basis_mat_spec1 :
  forall (r:Z) (c:Z), (0%Z < r)%Z -> (0%Z < c)%Z ->
  forall (m:matrix complex),
  (exists i:Z, exists j:Z,
   ((0%Z <= i)%Z /\ (i < r)%Z) /\
   (((0%Z <= j)%Z /\ (j < c)%Z) /\ (m = (ind_basis_mat i j r c)))) ->
  mem m (basis_mat r c).

Axiom basis_mat_spec2 :
  forall (r:Z) (c:Z), (0%Z < r)%Z -> (0%Z < c)%Z ->
  ((basis_mat r c) =
   (map (fun (o:(Z* Z)%type) => (ind_basis_mat (fir o) (sec o) r c))
    (cartesian_product (to_fset 0%Z r) (to_fset 0%Z c)))).

Axiom basis_mat_spec3 :
  forall (r:Z) (c:Z), (0%Z < r)%Z -> (0%Z < c)%Z ->
  constant_size (basis_mat r c) (fun (y0:matrix complex) => (p_id y0)).

Axiom basis_mat_spec4 :
  forall (r:Z) (c:Z), (0%Z < r)%Z -> (0%Z < c)%Z ->
  ((s_columns (basis_mat r c) (fun (y0:matrix complex) => (p_id y0))) = c).

Axiom basis_mat_spec5 :
  forall (r:Z) (c:Z), (0%Z < r)%Z -> (0%Z < c)%Z ->
  ((s_rows (basis_mat r c) (fun (y0:matrix complex) => (p_id y0))) = r).

Parameter fc8: (matrix complex) -> (Z* Z)%type -> bool.

Axiom fc_def8 :
  forall (m:matrix complex) (x:(Z* Z)%type),
  (((fc8 m) x) = true) <-> (eq_t (get m (fir x) (sec x)) c_one).

Axiom basis_mat_spec6 :
  forall (r:Z) (c:Z), (0%Z < r)%Z -> (0%Z < c)%Z ->
  forall (m:matrix complex), (mem m (basis_mat r c)) ->
  ((cardinal (my_filter (mat_indices m) (fc8 m))) = 1%Z).

Parameter basis_mat_indexes: (matrix complex) -> (Z* Z)%type.

Parameter result14: (matrix complex) -> (Z* Z)%type -> bool.

Axiom result_def14 :
  forall (m:matrix complex) (x:(Z* Z)%type),
  (((result14 m) x) = true) <->
  ((mem x (mat_indices m)) /\
   (equal m (ind_basis_mat (fir x) (sec x) (rows m) (columns m)))).

Axiom basis_mat_indexes_def :
  forall (m:matrix complex), (mem m (basis_mat (rows m) (columns m))) ->
  ((basis_mat_indexes m) =
   (element (my_filter (mat_indices m) (result14 m)))).

Axiom basis_mat_indexes_spec :
  forall (m:matrix complex), (mem m (basis_mat (rows m) (columns m))) ->
  (m =
   (ind_basis_mat (fir (basis_mat_indexes m)) (sec (basis_mat_indexes m))
    (rows m) (columns m))).

Axiom basis_mat_indexes_spec1 :
  forall (m:matrix complex), (mem m (basis_mat (rows m) (columns m))) ->
  (m =
   (make_f (rows m) (columns m)
    (fun (i:Z) (j:Z) =>
     (indic_2 (fir (basis_mat_indexes m)) i (sec (basis_mat_indexes m)) j)))).

Axiom basis_mat_indexes_spec2 :
  forall (m:matrix complex), (mem m (basis_mat (rows m) (columns m))) ->
  ((get m (fir (basis_mat_indexes m)) (sec (basis_mat_indexes m))) = c_one).

Axiom basis_mat_indexes_spec3 :
  forall (m:matrix complex), (mem m (basis_mat (rows m) (columns m))) ->
  forall (i:Z) (j:Z), (valid_index m i j) ->
  (i = (fir (basis_mat_indexes m))) -> ~ (j = (sec (basis_mat_indexes m))) ->
  ((get m i j) = c_zero).

Axiom basis_mat_indexes_spec4 :
  forall (m:matrix complex), (mem m (basis_mat (rows m) (columns m))) ->
  valid_index m (fir (basis_mat_indexes m)) (sec (basis_mat_indexes m)).

Axiom get_basis_mat_indexes :
  forall (m:matrix complex), (mem m (basis_mat (rows m) (columns m))) ->
  (m =
   (ind_basis_mat (fir (basis_mat_indexes m)) (sec (basis_mat_indexes m))
    (rows m) (columns m))).

Axiom get_basis_mat_indexes1 :
  forall (m:matrix complex), (mem m (basis_mat (rows m) (columns m))) ->
  (m =
   (make_f (rows m) (columns m)
    (fun (i:Z) (j:Z) =>
     (indic_2 (fir (basis_mat_indexes m)) i (sec (basis_mat_indexes m)) j)))).

Axiom get_basis_mat_indexes2 :
  forall (m:matrix complex), (mem m (basis_mat (rows m) (columns m))) ->
  ((get m (fir (basis_mat_indexes m)) (sec (basis_mat_indexes m))) = c_one).

Axiom get_basis_mat_indexes3 :
  forall (m:matrix complex), (mem m (basis_mat (rows m) (columns m))) ->
  forall (i:Z) (j:Z), (valid_index m i j) ->
  ~ ((basis_mat_indexes m) = (i, j)) -> ((get m i j) = c_zero).

Axiom set_basis_mat_indexes :
  forall (m:matrix complex) (i:Z) (j:Z), (valid_index m i j) ->
  (mem m (basis_mat (rows m) (columns m))) -> ((get m i j) = c_one) ->
  ((basis_mat_indexes m) = (i, j)).

Axiom set_basis_mat_indexes1 :
  forall (m:matrix complex) (i:Z) (j:Z), (valid_index m i j) ->
  (mem m (basis_mat (rows m) (columns m))) -> ((get m i j) = c_one) ->
  (m = (ind_basis_mat i j (rows m) (columns m))).

Axiom set_basis_mat_indexes2 :
  forall (m:matrix complex) (i:Z) (j:Z), (valid_index m i j) ->
  (mem m (basis_mat (rows m) (columns m))) -> ((get m i j) = c_one) ->
  (m =
   (make_f (rows m) (columns m) (fun (i1:Z) (j1:Z) => (indic_2 i i1 j j1)))).

Axiom set_basis_mat_indexes3 :
  forall (m:matrix complex) (i:Z) (j:Z), (valid_index m i j) ->
  (mem m (basis_mat (rows m) (columns m))) -> ((get m i j) = c_one) ->
  forall (i1:Z) (j1:Z), (valid_index m i1 j1) -> (i1 = i) -> ~ (j1 = j) ->
  ((get m i1 j1) = c_zero).

Parameter basis_projection: (matrix complex) -> Z -> Z -> matrix complex.

Axiom basis_projection_def :
  forall (m:matrix complex) (i:Z) (j:Z),
  ((0%Z <= i)%Z /\ (i < (rows m))%Z) ->
  ((0%Z <= j)%Z /\ (j < (columns m))%Z) ->
  ((basis_projection m i j) =
   (infix_asdtdt (get m i j) (ind_basis_mat i j (rows m) (columns m)))).

Axiom basis_projection_spec :
  forall (m:matrix complex) (i:Z) (j:Z),
  ((0%Z <= i)%Z /\ (i < (rows m))%Z) ->
  ((0%Z <= j)%Z /\ (j < (columns m))%Z) ->
  ((rows (basis_projection m i j)) = (rows m)).

Axiom basis_projection_spec1 :
  forall (m:matrix complex) (i:Z) (j:Z),
  ((0%Z <= i)%Z /\ (i < (rows m))%Z) ->
  ((0%Z <= j)%Z /\ (j < (columns m))%Z) ->
  ((columns (basis_projection m i j)) = (columns m)).

Axiom basis_projection_spec2 :
  forall (m:matrix complex) (i:Z) (j:Z),
  ((0%Z <= i)%Z /\ (i < (rows m))%Z) ->
  ((0%Z <= j)%Z /\ (j < (columns m))%Z) ->
  ((basis_projection m i j) =
   (make_f (rows m) (columns m)
    (fun (k:Z) (l:Z) => (infix_asdt (get m i j) (indic_2 k i l j))))).

Axiom basis_projection_spec3 :
  forall (m:matrix complex) (i:Z) (j:Z),
  ((0%Z <= i)%Z /\ (i < (rows m))%Z) ->
  ((0%Z <= j)%Z /\ (j < (columns m))%Z) ->
  ((get (basis_projection m i j) i j) = (get m i j)).

Axiom basis_projection_spec4 :
  forall (m:matrix complex) (i:Z) (j:Z),
  ((0%Z <= i)%Z /\ (i < (rows m))%Z) ->
  ((0%Z <= j)%Z /\ (j < (columns m))%Z) -> forall (i':Z) (j':Z),
  (valid_index (basis_projection m i j) i' j') -> ~ (i' = i) ->
  ((get (basis_projection m i j) i' j') = c_zero).

Axiom basis_projection_spec5 :
  forall (m:matrix complex) (i:Z) (j:Z),
  ((0%Z <= i)%Z /\ (i < (rows m))%Z) ->
  ((0%Z <= j)%Z /\ (j < (columns m))%Z) -> forall (i':Z) (j':Z),
  (valid_index (basis_projection m i j) i' j') -> ~ (j' = j) ->
  ((get (basis_projection m i j) i' j') = c_zero).

Axiom basis_projection_null :
  forall (m:matrix complex) (i:Z) (j:Z) (k:Z) (l:Z), (valid_index m i j) ->
  (valid_index m k l) -> ~ (i = k) ->
  ((get (basis_projection m i j) k l) = c_zero).

Axiom basis_projection_null1 :
  forall (m:matrix complex) (i:Z) (j:Z) (k:Z) (l:Z), (valid_index m i j) ->
  (valid_index m k l) -> ~ (j = l) ->
  ((get (basis_projection m i j) k l) = c_zero).

Parameter basis_projections: (matrix complex) -> set (matrix complex).

Parameter result15: (matrix complex) -> (Z* Z)%type -> matrix complex.

Axiom result_def15 :
  forall (m:matrix complex) (o:(Z* Z)%type),
  ((valid_index m (fir o) (sec o)) ->
   (((result15 m) o) = (basis_projection m (fir o) (sec o)))) /\
  (~ (valid_index m (fir o) (sec o)) -> (((result15 m) o) = m)).

Axiom basis_projections_def :
  forall (m:matrix complex),
  ((basis_projections m) = (map (result15 m) (to_indexes m))).

Axiom basis_projections_spec :
  forall (m:matrix complex),
  ((basis_projections m) =
   (map
    ((fun (y0:Z -> Z -> matrix complex) (y1:(Z* Z)%type) => (couple y0 y1))
     ((fun (y0:matrix complex) (y1:Z) (y2:Z) => (basis_projection y0 y1 y2))
      m))
    (to_indexes m))).

Axiom basis_projections_spec1 :
  forall (m:matrix complex), forall (e1:matrix complex),
  (mem e1 (basis_projections m)) -> ((rows e1) = (rows m)).

Axiom basis_projections_spec2 :
  forall (m:matrix complex), forall (e1:matrix complex),
  (mem e1 (basis_projections m)) -> ((columns e1) = (columns m)).

Axiom basis_projections_spec3 :
  forall (m:matrix complex),
  constant_size (basis_projections m) (fun (y0:matrix complex) => (p_id y0)).

Parameter fc9: (matrix complex) -> (Z* Z)%type -> matrix complex.

Axiom fc_def9 :
  forall (m:matrix complex) (o:(Z* Z)%type),
  ((valid_index m (fir o) (sec o)) ->
   (((fc9 m) o) = (basis_projection m (fir o) (sec o)))) /\
  (~ (valid_index m (fir o) (sec o)) -> (((fc9 m) o) = m)).

Axiom rewrite_basis_projections :
  forall (m:matrix complex),
  ((basis_projections m) = (map (fc9 m) (to_indexes m))).

Parameter indexes_decomp: (matrix complex) -> matrix complex.

Parameter result16: (matrix complex) -> (Z* Z)%type -> matrix complex.

Axiom result_def16 :
  forall (m:matrix complex) (o:(Z* Z)%type),
  ((mem o (to_indexes m)) ->
   (((result16 m) o) = (basis_projection m (fir o) (sec o)))) /\
  (~ (mem o (to_indexes m)) -> (((result16 m) o) = m)).

Axiom indexes_decomp_def :
  forall (m:matrix complex),
  ((indexes_decomp m) = (mat_sum (to_indexes m) (result16 m))).

Axiom indexes_decomp_spec :
  forall (m:matrix complex), ((rows (indexes_decomp m)) = (rows m)).

Axiom indexes_decomp_spec1 :
  forall (m:matrix complex), ((columns (indexes_decomp m)) = (columns m)).

Axiom rewrite_indexes_decomp :
  forall (m:matrix complex),
  ((indexes_decomp m) =
   (mat_sum (to_indexes m)
    (fun (o:(Z* Z)%type) => (basis_projection m (fir o) (sec o))))).

Axiom indexes_decomp_pre :
  forall (m:matrix complex) (i:Z) (j:Z), (valid_index m i j) ->
  ((get m i j) =
   (sum (to_indexes m)
    (fun (o:(Z* Z)%type) => (get (basis_projection m (fir o) (sec o)) i j)))).

Axiom indexes_decomp_pre_gen :
  forall (m:matrix complex), forall (i:Z) (j:Z), (valid_index m i j) ->
  ((get m i j) =
   (sum (to_indexes m)
    (fun (o:(Z* Z)%type) => (get (basis_projection m (fir o) (sec o)) i j)))).

Axiom mat_to_indexes_decomp :
  forall (m:matrix complex), (m = (indexes_decomp m)).

Parameter basis_decomp: (matrix complex) -> matrix complex.

Axiom basis_decomp_def :
  forall (m:matrix complex),
  ((basis_decomp m) =
   (mat_sum (basis_projections m) (fun (y0:matrix complex) => (p_id y0)))).

Axiom basis_decomp_spec :
  forall (m:matrix complex), ((rows (basis_decomp m)) = (rows m)).

Axiom basis_decomp_spec1 :
  forall (m:matrix complex), ((columns (basis_decomp m)) = (columns m)).

Axiom indexes_basis_decomp_equal_pre :
  forall (m:matrix complex) (i:Z) (j:Z), (valid_index m i j) ->
  ((get (indexes_decomp m) i j) = (get (basis_decomp m) i j)).

Axiom indexes_basis_decomp_equal :
  forall (m:matrix complex), ((indexes_decomp m) = (basis_decomp m)).

Axiom mat_to_basis_decomp :
  forall (m:matrix complex), (m = (indexes_decomp m)).

Parameter fc10:
  forall {a:Type} {a_WT:WhyType a}, (matrix complex) -> (set a) ->
  (a -> matrix complex) -> a -> matrix complex.

Axiom fc_def10 :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix complex) (s:set a) (f:a -> matrix complex) (a1:a),
  ((mem a1 s) -> (((fc10 m s f) a1) = (mat_mult m (f a1)))) /\
  (~ (mem a1 s) -> (((fc10 m s f) a1) = m)).

Axiom product_mat_sum_r_pre :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix complex) (s':set a) (s:set a) (f:a -> matrix complex),
  (constant_size s f) -> ((columns m) = (s_rows s f)) -> (subset s' s) ->
  ((cardinal s') > 0%Z)%Z ->
  ((mat_mult m (mat_sum s' f)) = (mat_sum s' (fc10 m s f))).

Axiom product_mat_sum_r_pre1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix complex) (s':set a) (s:set a) (f:a -> matrix complex),
  (constant_size s f) -> ((columns m) = (s_rows s f)) -> (subset s' s) ->
  ((cardinal s') > 0%Z)%Z ->
  ((mat_mult m (mat_sum s' f)) =
   (mat_sum s' (fun (a1:a) => (mat_mult m (f a1))))).

Axiom product_mat_sum_r_pre2 :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix complex) (s':set a) (s:set a) (f:a -> matrix complex),
  (constant_size s f) -> ((columns m) = (s_rows s f)) -> (subset s' s) ->
  ((cardinal s') > 0%Z)%Z -> ((rows (mat_sum s' f)) = (s_rows s f)).

Axiom product_mat_sum_r_pre3 :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix complex) (s':set a) (s:set a) (f:a -> matrix complex),
  (constant_size s f) -> ((columns m) = (s_rows s f)) -> (subset s' s) ->
  ((cardinal s') > 0%Z)%Z -> ((columns (mat_sum s' f)) = (s_columns s f)).

Axiom product_mat_sum_r_pre4 :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix complex) (s':set a) (s:set a) (f:a -> matrix complex),
  (constant_size s f) -> ((columns m) = (s_rows s f)) -> (subset s' s) ->
  ((cardinal s') > 0%Z)%Z -> ((rows (mat_mult m (mat_sum s' f))) = (rows m)).

Axiom product_mat_sum_r_pre5 :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix complex) (s':set a) (s:set a) (f:a -> matrix complex),
  (constant_size s f) -> ((columns m) = (s_rows s f)) -> (subset s' s) ->
  ((cardinal s') > 0%Z)%Z ->
  ((columns (mat_mult m (mat_sum s' f))) = (s_columns s f)).

Axiom product_mat_sum_r :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix complex) (s:set a) (f:a -> matrix complex),
  (constant_size s f) -> ((columns m) = (s_rows s f)) ->
  ((cardinal s) > 0%Z)%Z ->
  ((mat_mult m (mat_sum s f)) =
   (mat_sum s (fun (a1:a) => (mat_mult m (f a1))))).

Axiom product_mat_sum_r_rev :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix complex) (s:set a) (f:a -> matrix complex),
  (constant_size s f) -> ((columns m) = (s_rows s f)) ->
  ((cardinal s) > 0%Z)%Z ->
  ((mat_sum s (fun (a1:a) => (mat_mult m (f a1)))) =
   (mat_mult m (mat_sum s f))).

Axiom p_injective_proj :
  forall (m:matrix complex),
  p_injective
  ((fun (y0:Z -> Z -> matrix complex) (y1:(Z* Z)%type) => (couple y0 y1))
   ((fun (y0:matrix complex) (y1:Z) (y2:Z) => (basis_projection y0 y1 y2)) m))
  (nonn_mat_subset
   ((fun (y0:Z -> Z -> matrix complex) (y1:(Z* Z)%type) => (couple y0 y1))
    ((fun (y0:matrix complex) (y1:Z) (y2:Z) => (basis_projection y0 y1 y2))
     m))
   (to_indexes m)).

Axiom mat_decomp_equal_indexes :
  forall (m:matrix complex), (m = (indexes_decomp m)).

Parameter ket_basis: Z -> set (matrix complex).

Axiom ket_basis_def :
  forall (n:Z), (0%Z <= n)%Z ->
  ((ket_basis n) = (basis_mat (power 2%Z n) 1%Z)).

Axiom ket_basis_spec :
  forall (n:Z), (0%Z <= n)%Z ->
  ((ket_basis n) =
   (map
    (fun (o:(Z* Z)%type) =>
     (ind_basis_mat (fir o) (sec o) (power 2%Z n) 1%Z))
    (cartesian_product (to_fset 0%Z (power 2%Z n)) (to_fset 0%Z 1%Z)))).

Axiom ket_basis_spec1 :
  forall (n:Z), (0%Z <= n)%Z ->
  ((ket_basis n) = (basis_mat (power 2%Z n) 1%Z)).

Axiom ket_basis_spec2 :
  forall (n:Z), (0%Z <= n)%Z -> forall (mat:matrix complex),
  (mem mat (ket_basis n)) -> ((rows mat) = (power 2%Z n)).

Axiom ket_basis_spec3 :
  forall (n:Z), (0%Z <= n)%Z -> forall (mat:matrix complex),
  (mem mat (ket_basis n)) -> ((columns mat) = 1%Z).

Axiom ket_basis_spec4 :
  forall (n:Z), (0%Z <= n)%Z -> forall (mat:matrix complex),
  (mem mat (ket_basis n)) -> ((rows mat) = (power 2%Z n)).

Axiom ket_basis_spec5 :
  forall (n:Z), (0%Z <= n)%Z -> forall (mat:matrix complex),
  (mem mat (ket_basis n)) -> ((columns mat) = 1%Z).

Axiom ket_basis_spec6 :
  forall (n:Z), (0%Z <= n)%Z -> forall (mat:matrix complex),
  (mem mat (ket_basis n)) ->
  exists i:Z, (valid_index mat i 0%Z) /\ ((basis_mat_indexes mat) = (i, 0%Z)).

Axiom unary_ket_basis :
  forall (n:Z), (0%Z <= n)%Z ->
  ((ket_basis n) =
   (map (fun (i:Z) => (ind_basis_mat i 0%Z (power 2%Z n) 1%Z))
    (to_fset 0%Z (power 2%Z n)))).

Axiom to_ket_basis :
  forall (i:Z) (n:Z), (0%Z <= n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) ->
  mem (ind_basis_mat i 0%Z (power 2%Z n) 1%Z) (ket_basis n).

Parameter ket_basis_index: (matrix complex) -> Z -> Z.

Axiom ket_basis_index_def :
  forall (m:matrix complex) (n:Z), (0%Z <= n)%Z -> (mem m (ket_basis n)) ->
  ((ket_basis_index m n) = (fir (basis_mat_indexes m))).

Axiom ket_basis_index_spec :
  forall (m:matrix complex) (n:Z), (0%Z <= n)%Z -> (mem m (ket_basis n)) ->
  mem (ind_basis_mat (ket_basis_index m n) 0%Z (power 2%Z n) 1%Z)
  (ket_basis n).

Axiom ket_basis_index_spec1 :
  forall (m:matrix complex) (n:Z), (0%Z <= n)%Z -> (mem m (ket_basis n)) ->
  (m =
   (make_f (rows m) 1%Z
    (fun (i:Z) (us:Z) => (indic (ket_basis_index m n) i)))).

Axiom ket_basis_index_spec2 :
  forall (m:matrix complex) (n:Z), (0%Z <= n)%Z -> (mem m (ket_basis n)) ->
  forall (i:Z), (valid_index m i 0%Z) -> ~ (i = (ket_basis_index m n)) ->
  ((get m i 0%Z) = c_zero).

Axiom ket_basis_index_spec3 :
  forall (m:matrix complex) (n:Z), (0%Z <= n)%Z -> (mem m (ket_basis n)) ->
  valid_index m (ket_basis_index m n) 0%Z.

Axiom set_ket_basis :
  forall (m:matrix complex) (n:Z) (i:Z), (0%Z <= n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) -> (mem m (ket_basis n)) ->
  ((get m i 0%Z) = c_one) -> ((ket_basis_index m n) = i).

Axiom set_ket_basis1 :
  forall (m:matrix complex) (n:Z) (i:Z), (0%Z <= n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) -> (mem m (ket_basis n)) ->
  ((get m i 0%Z) = c_one) -> forall (i1:Z), (valid_index m i1 0%Z) ->
  ~ (i1 = i) -> ((get m i1 0%Z) = c_zero).

Axiom set_ket_basis2 :
  forall (m:matrix complex) (n:Z) (i:Z), (0%Z <= n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) -> (mem m (ket_basis n)) ->
  ((get m i 0%Z) = c_one) -> mem m (ket_basis n).

Axiom set_ket_basis3 :
  forall (m:matrix complex) (n:Z) (i:Z), (0%Z <= n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) -> (mem m (ket_basis n)) ->
  ((get m i 0%Z) = c_one) ->
  (m = (make_f (rows m) (columns m) (fun (i1:Z) (us:Z) => (indic i i1)))).

Axiom from_ket_basis :
  forall (n:Z) (m:matrix complex), (0%Z <= n)%Z -> (mem m (ket_basis n)) ->
  exists i:Z,
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) /\
  (m = (ind_basis_mat i 0%Z (power 2%Z n) 1%Z)).

Axiom int_to_ket_basis :
  forall (n:Z) (i:Z), (n > 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) -> mem (ket n i) (ket_basis n).

Parameter is_a_ket_basis_elt: (matrix complex) -> Prop.

Axiom is_a_ket_basis_elt_def :
  forall (m:matrix complex), (is_a_ket_basis_elt m) -> is_a_ket m.

Axiom is_a_ket_basis_elt_def1 :
  forall (m:matrix complex), (is_a_ket_basis_elt m) ->
  mem m (ket_basis (ket_length m)).

Axiom is_a_ket_basis_elt_def2 :
  forall (m:matrix complex),
  ((is_a_ket m) /\ (mem m (ket_basis (ket_length m)))) ->
  is_a_ket_basis_elt m.

Axiom ket_basis_elt_are_kets :
  forall (m:matrix complex), (is_a_ket_basis_elt m) -> is_a_ket m.

Axiom get_is_a_ket_basis_elt :
  forall (m:matrix complex), (is_a_ket_basis_elt m) -> is_a_ket m.

Axiom get_is_a_ket_basis_elt1 :
  forall (m:matrix complex), (is_a_ket_basis_elt m) ->
  mem m (ket_basis (ket_length m)).

Axiom get_is_a_ket_basis_elt2 :
  forall (m:matrix complex), (is_a_ket_basis_elt m) ->
  exists i:Z,
  ((0%Z <= i)%Z /\ (i < (power 2%Z (ket_length m)))%Z) /\
  (m = (ket (ket_length m) i)).

Axiom get_is_a_ket_basis_elt3 :
  forall (m:matrix complex), (is_a_ket_basis_elt m) ->
  exists i:Z,
  ((0%Z <= i)%Z /\ (i < (power 2%Z (ket_length m)))%Z) /\
  (((get m i 0%Z) = c_one) /\
   forall (j:Z),
   (((0%Z <= j)%Z /\ (j < (power 2%Z (ket_length m)))%Z) /\
    ~ ((get m j 0%Z) = c_zero)) ->
   (i = j)).

Axiom get_is_a_ket_basis_elt4 :
  forall (m:matrix complex), (is_a_ket_basis_elt m) -> forall (i:Z),
  (((0%Z <= i)%Z /\ (i < (power 2%Z (ket_length m)))%Z) /\
   ((get m i 0%Z) = c_one)) ->
  forall (j:Z),
  (((0%Z <= j)%Z /\ (j < (power 2%Z (ket_length m)))%Z) /\
   ~ ((get m j 0%Z) = c_zero)) ->
  (i = j).

Axiom get_is_a_ket_basis_elt_indic :
  forall (m:matrix complex), (is_a_ket_basis_elt m) ->
  exists i:Z,
  ((0%Z <= i)%Z /\ (i < (power 2%Z (ket_length m)))%Z) /\
  forall (j:Z), ((0%Z <= j)%Z /\ (j < (power 2%Z (ket_length m)))%Z) ->
  ((get m j 0%Z) = (indic i j)).

Axiom set_is_a_ket_basis_elt :
  forall (m:matrix complex), (is_a_ket m) ->
  (exists i:Z,
   ((0%Z <= i)%Z /\ (i < (power 2%Z (ket_length m)))%Z) /\
   (m = (ket (ket_length m) i))) ->
  is_a_ket_basis_elt m.

Axiom set_is_a_ket_basis_elt_exists :
  forall (m:matrix complex), (is_a_ket m) ->
  (exists j:Z,
   ((0%Z <= j)%Z /\ (j < (power 2%Z (ket_length m)))%Z) /\
   (m =
    (make_f (power 2%Z (ket_length m)) 1%Z (fun (i:Z) (us:Z) => (indic i j))))) ->
  is_a_ket_basis_elt m.

Axiom ket_func_sets_ket_basis_elts :
  forall (n:Z) (i:Z), (0%Z <= n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) -> is_a_ket_basis_elt (ket n i).

Axiom ket_func_sets_ket_basis_elts1 :
  forall (n:Z) (i:Z), (0%Z <= n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) -> ((ket_length (ket n i)) = n).

Axiom kronecker_is_a_ket_basis_elt :
  forall (x:matrix complex) (y:matrix complex), (is_a_ket_basis_elt x) ->
  (is_a_ket_basis_elt y) -> is_a_ket_basis_elt (kronecker x y).

Axiom ket_is_a_ket_basis_elt :
  forall (n:Z) (i:Z), (0%Z <= n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) -> is_a_ket_basis_elt (ket n i).

Axiom ket_basis_non_null_val :
  forall (m:matrix complex) (n:Z) (i:Z), (0%Z <= n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) -> (is_a_ket_basis_elt m) ->
  ((ket_length m) = n) -> ~ ((get m i 0%Z) = c_zero) -> (m = (ket n i)).

Parameter ket_to_int: (matrix complex) -> Z.

Axiom ket_to_int_spec :
  forall (m:matrix complex), (is_a_ket_basis_elt m) ->
  (0%Z <= (ket_to_int m))%Z.

Axiom ket_to_int_spec1 :
  forall (m:matrix complex), (is_a_ket_basis_elt m) ->
  ((ket_to_int m) < (power 2%Z (ket_length m)))%Z.

Axiom ket_to_int_spec2 :
  forall (m:matrix complex), (is_a_ket_basis_elt m) ->
  ((get m (ket_to_int m) 0%Z) = c_one).

Axiom ket_to_int_spec3 :
  forall (m:matrix complex), (is_a_ket_basis_elt m) ->
  (m = (ket (ket_length m) (ket_to_int m))).

Axiom ket_to_int_spec4 :
  forall (m:matrix complex), (is_a_ket_basis_elt m) -> forall (i:Z),
  ((0%Z <= i)%Z /\ (i < (power 2%Z (ket_length m)))%Z) ->
  (m = (ket (ket_length m) i)) -> (i = (ket_to_int m)).

Axiom ket_to_int_ket :
  forall (n:Z) (i:Z), (0%Z <= n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) -> ((ket_to_int (ket n i)) = i).

Axiom equal_ket_by_int :
  forall (m:matrix complex) (n:matrix complex) (l:Z), (is_a_ket_l m l) ->
  (is_a_ket_l n l) -> (is_a_ket_basis_elt n) -> (is_a_ket_basis_elt m) ->
  ((ket_to_int m) = (ket_to_int n)) -> (m = n).

Parameter bin_to_ket: Z -> (Z -> Z) -> matrix complex.

Axiom bin_to_ket_def :
  forall (n:Z) (bvx:Z -> Z), (n >= 0%Z)%Z -> (binary bvx) ->
  ((bin_to_ket n bvx) = (ket n (bin_to_int bvx n))).

Axiom bin_to_ket_spec :
  forall (n:Z) (bvx:Z -> Z), (n >= 0%Z)%Z -> (binary bvx) ->
  is_a_ket_basis_elt (bin_to_ket n bvx).

Axiom bin_to_ket_spec1 :
  forall (n:Z) (bvx:Z -> Z), (n >= 0%Z)%Z -> (binary bvx) ->
  ((ket_length (bin_to_ket n bvx)) = n).

Axiom bin_to_ket_spec2 :
  forall (n:Z) (bvx:Z -> Z), (n >= 0%Z)%Z -> (binary bvx) ->
  ((ket_to_int (bin_to_ket n bvx)) = (bin_to_int bvx n)).

Axiom bin_to_ket_spec3 :
  forall (n:Z) (bvx:Z -> Z), (n >= 0%Z)%Z -> (binary bvx) ->
  ((rows (bin_to_ket n bvx)) = (power 2%Z n)).

Axiom bin_to_ket_spec4 :
  forall (n:Z) (bvx:Z -> Z), (n >= 0%Z)%Z -> (binary bvx) ->
  ((columns (bin_to_ket n bvx)) = 1%Z).

Axiom bin_to_ket_spec5 :
  forall (n:Z) (bvx:Z -> Z), (n >= 0%Z)%Z -> (binary bvx) ->
  is_a_ket (bin_to_ket n bvx).

Axiom bin_to_ket_spec6 :
  forall (n:Z) (bvx:Z -> Z), (n >= 0%Z)%Z -> (binary bvx) ->
  is_a_ket_l (bin_to_ket n bvx) n.

Axiom bin_to_ket_l :
  forall (n:Z) (n':Z) (bvx:Z -> Z), (n >= 0%Z)%Z -> (n = n') ->
  (binary bvx) -> is_a_ket_l (bin_to_ket n bvx) n'.

Axiom bin_to_ket_eq :
  forall (n1:Z) (n2:Z) (bvx1:Z -> Z) (bvx2:Z -> Z), (n1 >= 0%Z)%Z ->
  (binary bvx1) -> (binary bvx2) -> (n2 = n1) ->
  (forall (i:Z), ((0%Z <= i)%Z /\ (i < n1)%Z) -> ((bvx1 i) = (bvx2 i))) ->
  ((bin_to_ket n1 bvx1) = (bin_to_ket n2 bvx2)).

Axiom kronecker_kets_bin_to_ket :
  forall (f1:Z -> Z) (f2:Z -> Z) (n1:Z) (n2:Z), (binary f1) -> (binary f2) ->
  (0%Z <= n1)%Z -> (0%Z <= n2)%Z ->
  ((kronecker (bin_to_ket n1 f1) (bin_to_ket n2 f2)) =
   (bin_to_ket (n1 + n2)%Z
    ((((fun (y0:Z -> Z) (y1:Z -> Z) (y2:Z) (y3:Z) =>
        (concat_fun y0 y1 y2 y3))
       f1)
      f2)
     n1))).

Axiom kronecker_ket_to_int :
  forall (x:matrix complex) (y:matrix complex), (is_a_ket_basis_elt x) ->
  (is_a_ket_basis_elt y) -> is_a_ket_basis_elt (kronecker x y).

Axiom kronecker_ket_to_int1 :
  forall (x:matrix complex) (y:matrix complex), (is_a_ket_basis_elt x) ->
  (is_a_ket_basis_elt y) ->
  ((ket_length (kronecker x y)) = ((ket_length x) + (ket_length y))%Z).

Axiom kronecker_ket_to_int2 :
  forall (x:matrix complex) (y:matrix complex), (is_a_ket_basis_elt x) ->
  (is_a_ket_basis_elt y) ->
  ((kronecker x y) =
   (ket ((ket_length x) + (ket_length y))%Z
    (((ket_to_int x) * (power 2%Z (ket_length y)))%Z + (ket_to_int y))%Z)).

Axiom kronecker_ket_to_int3 :
  forall (x:matrix complex) (y:matrix complex), (is_a_ket_basis_elt x) ->
  (is_a_ket_basis_elt y) ->
  ((ket_to_int (kronecker x y)) =
   (((ket_to_int x) * (power 2%Z (ket_length y)))%Z + (ket_to_int y))%Z).

Axiom ket_ket_to_int :
  forall (x:matrix complex), (is_a_ket_basis_elt x) ->
  ((ket (ket_length x) (ket_to_int x)) = x).

Axiom ket_ket_to_int_values :
  forall (x:matrix complex), (is_a_ket_basis_elt x) -> forall (i:Z) (j:Z),
  (valid_index x i j) -> ((get x i j) = (indic i (ket_to_int x))).

Parameter ket_basis_projection: (matrix complex) -> Z -> matrix complex.

Axiom ket_basis_projection_def :
  forall (m:matrix complex) (j:Z), (is_a_ket m) ->
  ((0%Z <= j)%Z /\ (j < (power 2%Z (ket_length m)))%Z) ->
  ((ket_basis_projection m j) =
   (infix_asdtdt (get m j 0%Z) (ket (ket_length m) j))).

Axiom ket_basis_projection_spec :
  forall (m:matrix complex) (j:Z), (is_a_ket m) ->
  ((0%Z <= j)%Z /\ (j < (power 2%Z (ket_length m)))%Z) ->
  ((ket_basis_projection m j) = (basis_projection m j 0%Z)).

Axiom ket_basis_projection_columns :
  forall (m:matrix complex) (j:Z), (is_a_ket m) ->
  ((0%Z <= j)%Z /\ (j < (power 2%Z (ket_length m)))%Z) ->
  ((columns (ket_basis_projection m j)) = 1%Z).

Axiom ket_basis_projection_rows :
  forall (m:matrix complex) (j:Z), (is_a_ket m) ->
  ((0%Z <= j)%Z /\ (j < (power 2%Z (ket_length m)))%Z) ->
  ((rows (ket_basis_projection m j)) = (rows m)).

Parameter ket_basis_projections: (matrix complex) -> set (matrix complex).

Parameter result17: (matrix complex) -> Z -> matrix complex.

Axiom result_def17 :
  forall (m:matrix complex) (j:Z),
  ((mem j (to_fset 0%Z (power 2%Z (ket_length m)))) ->
   (((result17 m) j) = (ket_basis_projection m j))) /\
  (~ (mem j (to_fset 0%Z (power 2%Z (ket_length m)))) ->
   (((result17 m) j) = m)).

Axiom ket_basis_projections_def :
  forall (m:matrix complex), (is_a_ket m) ->
  ((ket_basis_projections m) =
   (map (result17 m) (to_fset 0%Z (power 2%Z (ket_length m))))).

Axiom ket_basis_projections_spec :
  forall (m:matrix complex), (is_a_ket m) ->
  ((ket_basis_projections m) = (basis_projections m)).

Parameter ket_basis_projections_antec: (matrix complex) -> unit.

Axiom ket_basis_projections_antec_def :
  forall (m:matrix complex), (is_a_ket m) ->
  ((ket_basis_projections_antec m) = tt).

Axiom ket_basis_projections_antec_spec :
  forall (m:matrix complex), (is_a_ket m) -> forall (e1:matrix complex),
  (mem e1 (ket_basis_projections m)) ->
  exists j:Z,
  ((0%Z <= j)%Z /\ (j < (power 2%Z (ket_length m)))%Z) /\
  (e1 = (ket_basis_projection m j)).

Axiom ket_basis_projections_antec_spec1 :
  forall (m:matrix complex), (is_a_ket m) -> forall (e1:matrix complex),
  (exists j:Z,
   ((0%Z <= j)%Z /\ (j < (power 2%Z (ket_length m)))%Z) /\
   (e1 = (ket_basis_projection m j))) ->
  mem e1 (ket_basis_projections m).

Axiom ket_basis_projections_antec_spec2 :
  forall (m:matrix complex), (is_a_ket m) -> forall (e1:matrix complex),
  (mem e1 (ket_basis_projections m)) ->
  exists j:Z, exists i:Z,
  (valid_index m j i) /\ (e1 = (basis_projection m j i)).

Axiom ket_basis_projections_antec_spec3 :
  forall (m:matrix complex), (is_a_ket m) -> forall (e1:matrix complex),
  (exists j:Z, exists i:Z,
   (valid_index m j i) /\ (e1 = (basis_projection m j i))) ->
  mem e1 (ket_basis_projections m).

Parameter ket_sum:
  forall {a:Type} {a_WT:WhyType a}, (set a) -> (a -> matrix complex) ->
  matrix complex.

Axiom ket_sum_def :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex), ((cardinal s) > 0%Z)%Z ->
  (forall (e1:a), (mem e1 s) -> is_a_ket (f e1)) ->
  (exists l:Z, forall (e1:a), (mem e1 s) -> ((ket_length (f e1)) = l)) ->
  ((ket_sum s f) = (mat_sum s f)).

Axiom ket_sum_spec :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex), ((cardinal s) > 0%Z)%Z ->
  (forall (e1:a), (mem e1 s) -> is_a_ket (f e1)) ->
  (exists l:Z, forall (e1:a), (mem e1 s) -> ((ket_length (f e1)) = l)) ->
  forall (i:Z), (ket_valid_index (ket_sum s f) i) ->
  ((get_ket (ket_sum s f) i) = (sum s (fun (e1:a) => (get_ket (f e1) i)))).

Axiom ket_sum_spec1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex), ((cardinal s) > 0%Z)%Z ->
  (forall (e1:a), (mem e1 s) -> is_a_ket (f e1)) ->
  (exists l:Z, forall (e1:a), (mem e1 s) -> ((ket_length (f e1)) = l)) ->
  is_a_ket (ket_sum s f).

Axiom ket_sum_spec2 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex), ((cardinal s) > 0%Z)%Z ->
  (forall (e1:a), (mem e1 s) -> is_a_ket (f e1)) ->
  (exists l:Z, forall (e1:a), (mem e1 s) -> ((ket_length (f e1)) = l)) ->
  forall (e1:a), (mem e1 s) ->
  ((ket_length (ket_sum s f)) = (ket_length (f e1))).

Parameter ket_sum_l:
  forall {a:Type} {a_WT:WhyType a}, (set a) -> (a -> matrix complex) ->
  Z -> matrix complex.

Axiom ket_sum_l_def :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (l:Z), (0%Z <= l)%Z ->
  ((cardinal s) = 0%Z) ->
  ((ket_sum_l s f l) = (make_ket l (fun (us:Z) => c_zero))).

Axiom ket_sum_l_def1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (l:Z), (0%Z <= l)%Z ->
  ~ ((cardinal s) = 0%Z) -> ((cardinal s) = 1%Z) ->
  ((ket_sum_l s f l) =
   (make_ket l
    ((fun (y0:matrix complex) (y1:Z) => (get_ket y0 y1)) (f (choose s))))).

Axiom ket_sum_l_def2 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (l:Z), (0%Z <= l)%Z ->
  ~ ((cardinal s) = 0%Z) -> ~ ((cardinal s) = 1%Z) ->
  ((ket_sum_l s f l) =
   (add_ket (ket_sum_l (remove (choose s) s) f l)
    (make_ket l
     ((fun (y0:matrix complex) (y1:Z) => (get_ket y0 y1)) (f (choose s)))))).

Axiom ket_sum_l_spec :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (l:Z), (0%Z <= l)%Z ->
  (0%Z < (cardinal s))%Z ->
  ((ket_sum_l s f l) =
   (mat_sum s (fun (i:a) => (make_ket l (fun (j:Z) => (get (f i) j 0%Z)))))).

Axiom ket_sum_l_spec1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (l:Z), (0%Z <= l)%Z ->
  is_a_ket (ket_sum_l s f l).

Axiom ket_sum_l_spec2 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (l:Z), (0%Z <= l)%Z ->
  forall (i:Z), (ket_valid_index (ket_sum_l s f l) i) ->
  ((get_ket (ket_sum_l s f l) i) =
   (sum s (fun (e1:a) => (get_ket (f e1) i)))).

Axiom ket_sum_l_spec3 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (l:Z), (0%Z <= l)%Z ->
  is_a_ket_l (ket_sum_l s f l) l.

Axiom ket_sum_l_spec4 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (l:Z), (0%Z <= l)%Z ->
  (0%Z < (cardinal s))%Z ->
  (forall (e1:a), (mem e1 s) -> is_a_ket_l (f e1) l) ->
  ((ket_sum_l s f l) = (mat_sum s f)).

Axiom ket_sum_l_spec5 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (l:Z), (0%Z <= l)%Z ->
  ((ket_length (ket_sum_l s f l)) = l).

Axiom ket_sum_l_to_mat_sum :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (l:Z), (0%Z <= l)%Z ->
  ((cardinal s) > 0%Z)%Z ->
  ((ket_sum_l s f l) =
   (mat_sum s (fun (i:a) => (make_ket l (fun (j:Z) => (get (f i) j 0%Z)))))).

Axiom ket_sum_l_rows :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (l:Z), (0%Z <= l)%Z ->
  ((cardinal s) > 0%Z)%Z -> ((rows (ket_sum_l s f l)) = (power 2%Z l)).

Axiom ket_sum_l_value :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (l:Z) (i:Z) (j:Z), (0%Z <= l)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z l))%Z) -> (j = 0%Z) ->
  ((get (ket_sum_l s f l) i j) = (sum s (fun (e1:a) => (get (f e1) i 0%Z)))).

Axiom get_ket_sum_l_value :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (l:Z) (i:Z), (0%Z <= l)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z l))%Z) ->
  ((get_ket (ket_sum_l s f l) i) =
   (sum s (fun (e1:a) => (get_ket (f e1) i)))).

Axiom ket_sum_l_columns :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (l:Z), (0%Z <= l)%Z ->
  ((columns (ket_sum_l s f l)) = 1%Z).

Axiom ket_sum_null_but_maybe_one_elt :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:a -> matrix complex) (s:set a) (e1:a), ((cardinal s) > 1%Z)%Z ->
  (forall (e2:a), (mem e2 s) -> is_a_ket (f e2)) -> (constant_size s f) ->
  (mem e1 s) ->
  (forall (e':a), (mem e' s) -> ~ (e1 = e') -> null_mat (f e')) ->
  ((ket_sum s f) = (f e1)).

Axiom ket_sum_null :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (l:Z), ((cardinal s) > 1%Z)%Z ->
  (l >= 0%Z)%Z ->
  (forall (e1:a), (mem e1 s) -> forall (i:Z),
   ((0%Z <= i)%Z /\ (i < (power_ 2%Z l))%Z) -> ((get_ket (f e1) i) = c_zero)) ->
  forall (j:Z), ((0%Z <= j)%Z /\ (j < (power 2%Z l))%Z) ->
  ((get_ket (ket_sum_l s f l) j) = c_zero).

Axiom ket_sum_l_null_but_maybe_one_elt :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:a -> matrix complex) (s:set a) (e1:a) (l:Z), (0%Z <= l)%Z ->
  ((cardinal s) > 1%Z)%Z -> (mem e1 s) ->
  (forall (e':a), (mem e' s) -> ~ (e' = e1) -> forall (i:Z),
   ((0%Z <= i)%Z /\ (i < (power_ 2%Z l))%Z) -> ((get_ket (f e') i) = c_zero)) ->
  ((ket_sum_l s f l) =
   (make_ket l ((fun (y0:matrix complex) (y1:Z) => (get_ket y0 y1)) (f e1)))).

Axiom ket_sum_ket_l :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (l:Z), (0%Z <= l)%Z ->
  is_a_ket_l (ket_sum_l s f l) l.

Axiom ket_sum_ket_l_ :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (l:Z) (l':Z), (0%Z <= l)%Z ->
  (l = l') -> is_a_ket_l (ket_sum_l s f l) l'.

Axiom add_ket_l_eq1 :
  forall (m:matrix complex) (o:matrix complex) (m':matrix complex)
    (o':matrix complex) (l:Z),
  (0%Z <= l)%Z -> (m = m') -> (o = o') ->
  ((add_ket_l m o l) = (add_ket_l m' o' l)).

Axiom add_ket_l_eq_scal :
  forall (m:matrix complex) (o:matrix complex) (m':matrix complex)
    (o':matrix complex) (a:complex) (b:complex) (a':complex) (b':complex)
    (l:Z),
  (0%Z <= l)%Z -> (m = m') -> (o = o') -> (a = a') -> (b = b') ->
  ((add_ket_l (infix_asdtdt a m) (infix_asdtdt b o) l) =
   (add_ket_l (infix_asdtdt a' m') (infix_asdtdt b' o') l)).

Axiom add_ket_l_scal :
  forall (x:matrix complex) (y:matrix complex) (a:complex) (l:Z),
  (is_a_ket_l x l) -> (is_a_ket_l y l) ->
  ((add_ket_l (infix_asdtdt a x) (infix_asdtdt a y) l) =
   (infix_asdtdt a (add_ket_l x y l))).

Axiom add_ket_l_scal_rev :
  forall (x:matrix complex) (y:matrix complex) (a:complex) (l:Z),
  (is_a_ket_l x l) -> (is_a_ket_l y l) ->
  ((infix_asdtdt a (add_ket_l x y l)) =
   (add_ket_l (infix_asdtdt a x) (infix_asdtdt a y) l)).

Axiom get_ket_scalar :
  forall (x:matrix complex) (a:complex) (i:Z),
  ((get_ket (infix_asdtdt a x) i) = (infix_asdt a (get_ket x i))).

Axiom scal_add_scal_ket_l :
  forall (g:complex) (a:complex) (x:matrix complex) (a':complex)
    (x':matrix complex) (n:Z),
  (0%Z <= n)%Z ->
  ((infix_asdtdt g (add_ket_l (infix_asdtdt a x) (infix_asdtdt a' x') n)) =
   (add_ket_l (infix_asdtdt (infix_asdt g a) x)
    (infix_asdtdt (infix_asdt g a') x') n)).

Axiom add_ket_l_switch :
  forall (a:matrix complex) (b:matrix complex) (c:matrix complex)
    (d:matrix complex) (n:Z),
  (0%Z <= n)%Z ->
  ((add_ket_l (add_ket_l a b n) (add_ket_l c d n) n) =
   (add_ket_l (add_ket_l a c n) (add_ket_l b d n) n)).

Axiom add_ket_scal_fact :
  forall (a:matrix complex) (n:Z) (s:complex) (s':complex),
  (is_a_ket_l a n) -> (0%Z <= n)%Z ->
  ((add_ket_l (infix_asdtdt s a) (infix_asdtdt s' a) n) =
   (infix_asdtdt (infix_pldt s s') a)).

Axiom ket_sum_comp_l :
  forall {b:Type} {b_WT:WhyType b},
  forall (s:set b) (f:b -> matrix complex) (g:b -> matrix complex) (l:Z),
  (0%Z <= l)%Z ->
  ((ket_sum_l s (fun (k:b) => (add_ket_l (f k) (g k) l)) l) =
   (add_ket_l (ket_sum_l s f l) (ket_sum_l s g l) l)).

Axiom ket_sum_comp_l_rev :
  forall {b:Type} {b_WT:WhyType b},
  forall (s:set b) (f:b -> matrix complex) (g:b -> matrix complex) (l:Z),
  (0%Z <= l)%Z ->
  ((add_ket_l (ket_sum_l s f l) (ket_sum_l s g l) l) =
   (ket_sum_l s (fun (k:b) => (add_ket_l (f k) (g k) l)) l)).

Axiom ket_sum_scalar_l :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (a1:complex) (l:Z),
  (0%Z <= l)%Z ->
  ((ket_sum_l s (fun (k:a) => (infix_asdtdt a1 (f k))) l) =
   (infix_asdtdt a1 (ket_sum_l s f l))).

Axiom ket_l_ket_sum_scalar :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (a1:complex) (l:Z) (n:Z),
  (0%Z <= l)%Z -> (l = n) -> is_a_ket_l (infix_asdtdt a1 (ket_sum_l s f l)) n.

Axiom scal_ket_sum_scalar_l :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (b:complex) (l:Z) (l':Z),
  (0%Z <= l)%Z -> (l = l') ->
  is_a_ket_l (infix_asdtdt b (ket_sum_l s f l)) l'.

Axiom ket_sum_scalar_rev_l :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (a1:complex) (l:Z),
  (0%Z <= l)%Z ->
  ((infix_asdtdt a1 (ket_sum_l s f l)) =
   (ket_sum_l s (fun (k:a) => (infix_asdtdt a1 (f k))) l)).

Axiom ket_sum_eq :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s':set a) (f:a -> matrix complex) (g:a -> matrix complex)
    (l:Z),
  (0%Z <= l)%Z -> (s = s') ->
  (forall (a1:a), (mem a1 s) -> ((f a1) = (g a1))) ->
  ((ket_sum_l s f l) = (ket_sum_l s' g l)).

Axiom ket_sum_eq_gen :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s':set a) (f:a -> matrix complex) (g:a -> matrix complex)
    (l1:Z) (l2:Z),
  (0%Z <= l1)%Z -> (s = s') -> (l1 = l2) ->
  (forall (a1:a), (mem a1 s) -> ((f a1) = (g a1))) ->
  ((ket_sum_l s f l1) = (ket_sum_l s' g l2)).

Axiom ket_sum_eq_by_sum :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s':set a) (f:a -> matrix complex) (g:a -> matrix complex)
    (l1:Z) (l2:Z),
  (0%Z <= l1)%Z -> (s = s') -> (l1 = l2) ->
  (forall (i:Z), ((0%Z <= i)%Z /\ (i < (power_ 2%Z l1))%Z) ->
   ((sum s (fun (e1:a) => (get_ket (f e1) i))) =
    (sum s (fun (e1:a) => (get_ket (g e1) i))))) ->
  ((ket_sum_l s f l1) = (ket_sum_l s' g l2)).

Axiom ket_sum_bvs_eq :
  forall (n1:Z) (n2:Z) (f:bitvec -> matrix complex)
    (g:bitvec -> matrix complex) (l1:Z) (l2:Z),
  (0%Z <= l1)%Z -> (l1 = l2) -> (n1 = n2) -> (n1 >= 0%Z)%Z ->
  (forall (e1:bitvec), (mem e1 (n_bvs n1)) -> ((f e1) = (g e1))) ->
  ((ket_sum_l (n_bvs n1) f l1) = (ket_sum_l (n_bvs n2) g l2)).

Axiom ket_sum_scal_bvs_eq :
  forall (n1:Z) (n2:Z) (f:bitvec -> matrix complex)
    (g:bitvec -> matrix complex) (l1:Z) (l2:Z) (s1:complex) (s2:complex),
  (0%Z <= l1)%Z -> (l1 = l2) -> (n1 = n2) -> (s1 = s2) -> (n1 >= 0%Z)%Z ->
  (forall (e1:bitvec), (mem e1 (n_bvs n1)) -> ((f e1) = (g e1))) ->
  ((infix_asdtdt s1 (ket_sum_l (n_bvs n1) f l1)) =
   (infix_asdtdt s2 (ket_sum_l (n_bvs n2) g l2))).

Axiom ket_sum_sum_bvs_eq :
  forall (n1:Z) (n2:Z) (n1':Z) (n2':Z) (f:bitvec -> bitvec -> matrix complex)
    (g:bitvec -> bitvec -> matrix complex) (l1:Z) (l2:Z) (l1':Z) (l2':Z),
  (0%Z <= l1)%Z -> ((l1 = l2) /\ ((l2 = l1') /\ (l1' = l2'))) ->
  (n1 = n1') -> (n1 >= 0%Z)%Z -> (n2 = n2') -> (n2 >= 0%Z)%Z ->
  (forall (e1:bitvec) (e':bitvec), (mem e1 (n_bvs n1)) ->
   (mem e' (n_bvs n2)) -> (((f e1) e') = ((g e1) e'))) ->
  ((ket_sum_l (n_bvs n1) (fun (k:bitvec) => (ket_sum_l (n_bvs n2) (f k) l1))
    l2)
   =
   (ket_sum_l (n_bvs n1')
    (fun (k:bitvec) => (ket_sum_l (n_bvs n2') (g k) l1')) l2')).

Axiom ket_sum_sum_scal_bvs_eq :
  forall (n1:Z) (n2:Z) (n1':Z) (n2':Z) (f:bitvec -> bitvec -> matrix complex)
    (g:bitvec -> bitvec -> matrix complex) (l1:Z) (l2:Z) (l1':Z) (l2':Z)
    (s1:complex) (s2:complex),
  (0%Z <= l1)%Z -> ((l1 = l2) /\ ((l2 = l1') /\ (l1' = l2'))) ->
  (n1 = n1') -> (n1 >= 0%Z)%Z -> (n2 = n2') -> (s1 = s2) -> (n2 >= 0%Z)%Z ->
  (forall (e1:bitvec) (e':bitvec), (mem e1 (n_bvs n1)) ->
   (mem e' (n_bvs n2)) -> (((f e1) e') = ((g e1) e'))) ->
  ((infix_asdtdt s1
    (ket_sum_l (n_bvs n1) (fun (k:bitvec) => (ket_sum_l (n_bvs n2) (f k) l1))
     l2))
   =
   (infix_asdtdt s1
    (ket_sum_l (n_bvs n1')
     (fun (k:bitvec) => (ket_sum_l (n_bvs n2') (g k) l1')) l2'))).

Axiom ket_sum_sum_scal_mult_bvs_eq :
  forall (n1:Z) (n2:Z) (n1':Z) (n2':Z) (f:bitvec -> bitvec -> matrix complex)
    (g:bitvec -> bitvec -> matrix complex) (l1:Z) (l2:Z) (l1':Z) (l2':Z)
    (s1:complex) (s2:complex) (s3:complex),
  (0%Z <= l1)%Z -> ((l1 = l2) /\ ((l2 = l1') /\ (l1' = l2'))) ->
  (n1 = n1') -> (n1 >= 0%Z)%Z -> (s3 = (infix_asdt s1 s2)) -> (n2 = n2') ->
  (n2 >= 0%Z)%Z ->
  (forall (e1:bitvec) (e':bitvec), (mem e1 (n_bvs n1)) ->
   (mem e' (n_bvs n2)) -> (((f e1) e') = ((g e1) e'))) ->
  ((infix_asdtdt s1
    (ket_sum_l (n_bvs n1')
     (fun (k:bitvec) => (infix_asdtdt s2 (ket_sum_l (n_bvs n2') (f k) l1')))
     l2'))
   =
   (infix_asdtdt s3
    (ket_sum_l (n_bvs n1) (fun (k:bitvec) => (ket_sum_l (n_bvs n2) (g k) l1))
     l2))).

Axiom ket_sum_l_cardone :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (l:Z), (0%Z <= l)%Z ->
  ((cardinal s) = 1%Z) -> (is_a_ket_l (f (choose s)) l) ->
  ((ket_sum_l s f l) = (f (choose s))).

Axiom ket_sum_l_empty :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (l:Z), (0%Z <= l)%Z ->
  ((cardinal s) = 0%Z) ->
  ((ket_sum_l s f l) = (make_ket l (fun (us:Z) => c_zero))).

Axiom ket_sum_l_cardone_ :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (l:Z), (0%Z <= l)%Z ->
  ((cardinal s) = 1%Z) ->
  ((ket_sum_l s f l) =
   (make_ket l
    ((fun (y0:matrix complex) (y1:Z) => (get_ket y0 y1)) (f (choose s))))).

Axiom ket_sum_l_plus_one :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (e1:a) (f:a -> matrix complex) (l:Z), (0%Z <= l)%Z ->
  ((cardinal s) > 0%Z)%Z -> ~ (mem e1 s) ->
  ((ket_sum_l (add e1 s) f l) = (add_ket_l (ket_sum_l s f l) (f e1) l)).

Axiom ket_sum_bitvec_one :
  forall (f:bitvec -> matrix complex) (l:Z), (0%Z <= l)%Z ->
  ((ket_sum_l (n_bvs 1%Z) f l) =
   (add_ket_l (f (int_to_bv 0%Z 1%Z)) (f (int_to_bv 1%Z 1%Z)) l)).

Axiom ket_sum_bitvec_zero :
  forall (f:bitvec -> matrix complex) (l:Z) (m:Z), (0%Z <= l)%Z ->
  (m = 0%Z) -> (is_a_ket_l (f (int_to_bv 0%Z 0%Z)) l) ->
  ((ket_sum_l (n_bvs m) f l) = (f (int_to_bv 0%Z 0%Z))).

Axiom ket_sum_l_valid_index :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (l:Z) (i:Z), (0%Z <= l)%Z ->
  (0%Z < (cardinal s))%Z -> ((0%Z <= i)%Z /\ (i < (power_ 1%Z l))%Z) ->
  ket_valid_index (ket_sum_l s f l) i.

Axiom ket_sum_const :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (x:matrix complex) (l:Z), (0%Z <= l)%Z ->
  (is_a_ket_l x l) ->
  ((ket_sum_l s (fun (us:a) => x) l) =
   (infix_asdtdt (i_to_c (cardinal s)) x)).

Axiom ket_sum_const_w :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (x:matrix complex) (l:Z), (0%Z <= l)%Z ->
  (0%Z < (cardinal s))%Z -> (is_a_ket_l x l) ->
  ((infix_asdtdt (infix_sldt c_one (i_to_c (cardinal s)))
    (ket_sum_l s (fun (us:a) => x) l))
   = x).

Axiom map_ket_sum_l :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (f:b -> matrix complex) (s:set a) (t:a -> b) (n:Z), (0%Z <= n)%Z ->
  (p_injective t s) ->
  ((ket_sum_l (map t s) f n) = (ket_sum_l s (fun (a1:a) => (f (t a1))) n)).

Axiom pre_injective_bv_to_int :
  forall (bv1:bitvec) (bv2:bitvec), ((length bv1) = (length bv2)) ->
  ~ (bv1 = bv2) -> ~ ((bv_to_int bv1) = (bv_to_int bv2)).

Axiom injective_bv_to_int :
  forall (n:Z), (0%Z <= n)%Z ->
  p_injective (fun (y0:bitvec) => (bv_to_int y0)) (n_bvs n).

Axiom bijective_to_int :
  forall (n:Z), (0%Z < n)%Z ->
  p_bijective (fun (y0:bitvec) => (bv_to_int y0)) (n_bvs n)
  (to_fset 0%Z (power 2%Z n)).

Axiom injective_int_to_bv :
  forall (n:Z), (0%Z <= n)%Z ->
  p_injective (fun (i:Z) => (int_to_bv i n)) (to_fset 0%Z (power 2%Z n)).

Axiom n_bvs_card :
  forall (n:Z), (0%Z <= n)%Z -> ((cardinal (n_bvs n)) = (power 2%Z n)).

Axiom concat_first_term_zero :
  forall (e1:bitvec) (i:Z), (0%Z <= i)%Z ->
  (mem e1 (map (fun (bv:bitvec) => (concat_l bv 0%Z)) (n_bvs i))) ->
  (((getbv e1) 0%Z) = 0%Z).

Axiom concat_first_term_one :
  forall (e1:bitvec) (i:Z), (0%Z <= i)%Z ->
  (mem e1 (map (fun (bv:bitvec) => (concat_l bv 1%Z)) (n_bvs i))) ->
  (((getbv e1) 0%Z) = 1%Z).

Axiom bv_sum_to_int_sum :
  forall (n:Z) (f:Z -> complex) (g:bitvec -> complex), (0%Z <= n)%Z ->
  (forall (x:bitvec), ((length x) = n) -> ((g x) = (f (bv_to_int x)))) ->
  ((sum (n_bvs n) g) = (sum (to_fset 0%Z (power 2%Z n)) f)).

Axiom sum_concat :
  forall (f:bitvec -> matrix complex) (i:Z) (r:Z) (c:Z), (i > 0%Z)%Z ->
  (forall (bv:bitvec), ((rows (f bv)) = r)) ->
  (forall (bv:bitvec), ((columns (f bv)) = c)) ->
  ((mat_sum (n_bvs i)
    (fun (bv:bitvec) =>
     (add_mat (f (concat_l bv 0%Z)) (f (concat_l bv 1%Z)))))
   = (mat_sum (n_bvs (i + 1%Z)%Z) f)).

Axiom geometric_series_bv :
  forall (a:complex) (q:complex) (n:Z), (n >= 1%Z)%Z -> ~ (q = c_one) ->
  ((sum (n_bvs n)
    (fun (i:bitvec) => (infix_asdt a (cpower q (bv_to_int i)))))
   =
   (infix_sldt (infix_asdt a (infix_mndt c_one (cpower q (power_ 2%Z n))))
    (infix_mndt c_one q))).

Axiom geometric_series_bv_init_one :
  forall (q:complex) (n:Z), (n >= 1%Z)%Z -> ~ (q = c_one) ->
  ((sum (n_bvs n) (fun (i:bitvec) => (cpower q (bv_to_int i)))) =
   (infix_sldt (infix_mndt c_one (cpower q (power_ 2%Z n)))
    (infix_mndt c_one q))).

Axiom ket_sum_l_to_n_bvs :
  forall (f:Z -> matrix complex) (l:Z) (n:Z), (0%Z <= n)%Z -> (0%Z <= l)%Z ->
  ((ket_sum_l (to_fset 0%Z (power_ 2%Z l)) f n) =
   (ket_sum_l (n_bvs l) (fun (a:bitvec) => (f (bv_to_int a))) n)).

Axiom ket_sum_l_to_fset :
  forall (f:bitvec -> matrix complex) (l:Z) (n:Z), (0%Z <= n)%Z ->
  (0%Z <= l)%Z ->
  ((ket_sum_l (n_bvs l) f n) =
   (ket_sum_l (to_fset 0%Z (power_ 2%Z l)) (fun (i:Z) => (f (int_to_bv i l)))
    n)).

Axiom ket_sum_partition :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (s1:set a) (s2:set a) (f:a -> matrix complex) (n:Z),
  (0%Z <= n)%Z -> (s = (union s1 s2)) -> ((inter s1 s2) = (empty : set a)) ->
  ((ket_sum_l s f n) = (add_ket_l (ket_sum_l s1 f n) (ket_sum_l s2 f n) n)).

Axiom ket_decomp :
  forall (m:matrix complex) (n:Z), (0%Z <= n)%Z -> (is_a_ket m) ->
  ((ket_length m) = n) ->
  (m =
   (mat_sum (to_fset 0%Z (power 2%Z n))
    (fun (j:Z) => (infix_asdtdt (get m j 0%Z) (ket n j))))).

Axiom ket_decomp_bv :
  forall (m:matrix complex) (n:Z), (0%Z <= n)%Z -> (is_a_ket m) ->
  ((ket_length m) = n) ->
  (m =
   (ket_sum_l (n_bvs n)
    (fun (bvx:bitvec) =>
     (infix_asdtdt (get m (bv_to_int bvx) 0%Z) (ket n (bv_to_int bvx))))
    n)).

Axiom ket_recomp :
  forall (f:Z -> complex) (n:Z), (0%Z <= n)%Z ->
  ((mat_sum (to_fset 0%Z (power 2%Z n))
    (fun (j:Z) => (infix_asdtdt (f j) (ket n j))))
   = (make_f (power 2%Z n) 1%Z (fun (x:Z) (us:Z) => (f x)))).

Axiom ket_decomp_quant :
  forall (m:matrix complex), (is_a_ket m) ->
  (m =
   (mat_sum (to_fset 0%Z (power 2%Z (ket_length m)))
    (fun (j:Z) => (infix_asdtdt (get m j 0%Z) (ket (ket_length m) j))))).

Axiom mat_mult_ket_basis :
  forall (m:matrix complex) (x:matrix complex), (is_a_ket_basis_elt x) ->
  (((columns m) = (rows m)) /\ ((rows m) = (rows x))) ->
  ((mat_mult m x) =
   (mat_sum (to_fset 0%Z (rows x))
    (fun (k:Z) =>
     (infix_asdtdt (get m k (ket_to_int x)) (ket (ket_length x) k))))).

Axiom ket_mult_diag :
  forall (m:matrix complex) (x:matrix complex), ((ket_length x) >= 1%Z)%Z ->
  (is_a_ket_basis_elt x) -> ((rows m) = (power 2%Z (ket_length x))) ->
  ((columns m) = (power 2%Z (ket_length x))) ->
  (forall (i:Z) (j:Z),
   ((0%Z <= i)%Z /\ (i < (power 2%Z (ket_length x)))%Z) ->
   ((0%Z <= j)%Z /\ (j < (power 2%Z (ket_length x)))%Z) -> ~ (i = j) ->
   ((get m i j) = c_zero)) ->
  ((mat_mult m x) =
   (infix_asdtdt (get m (ket_to_int x) (ket_to_int x))
    (ket (ket_length x) (ket_to_int x)))).

Axiom mat_mult_ket_basis_bv :
  forall (m:matrix complex) (x:matrix complex) (n:Z), ((ket_length x) = n) ->
  (is_a_ket_basis_elt x) ->
  (((columns m) = (rows m)) /\ ((rows m) = (rows x))) ->
  ((mat_mult m x) =
   (ket_sum_l (n_bvs n)
    (fun (bvx:bitvec) =>
     (infix_asdtdt (get m (bv_to_int bvx) (ket_to_int x))
      (ket n (bv_to_int bvx))))
    n)).

Axiom mat_mult_ket_basis_bv_gen :
  forall (m:matrix complex) (x:matrix complex), (is_a_ket_basis_elt x) ->
  (((columns m) = (rows m)) /\ ((rows m) = (rows x))) ->
  ((mat_mult m x) =
   (ket_sum_l (n_bvs (ket_length x))
    (fun (bvx:bitvec) =>
     (infix_asdtdt (get m (bv_to_int bvx) (ket_to_int x))
      (ket (ket_length x) (bv_to_int bvx))))
    (ket_length x))).

Axiom mat_mult_ket_bv :
  forall (m:matrix complex) (x:matrix complex) (n:Z), (is_a_ket_l x n) ->
  (((columns m) = (rows m)) /\
   (((rows m) = (rows x)) /\ ((rows x) = (power 2%Z n)))) ->
  ((mat_mult m x) =
   (ket_sum_l (n_bvs n)
    (fun (bvx:bitvec) =>
     (infix_asdtdt (get_ket x (bv_to_int bvx))
      (mat_mult m (ket n (bv_to_int bvx)))))
    n)).

Axiom mat_mult_ket_bv_gen :
  forall (m:matrix complex) (x:matrix complex), (is_a_ket x) ->
  (((columns m) = (rows m)) /\ ((rows m) = (rows x))) ->
  ((mat_mult m x) =
   (ket_sum_l (n_bvs (ket_length x))
    (fun (bvx:bitvec) =>
     (infix_asdtdt (get_ket x (bv_to_int bvx))
      (mat_mult m (ket (ket_length x) (bv_to_int bvx)))))
    (ket_length x))).

Axiom mat_mult_ket_sum_l :
  forall {a:Type} {a_WT:WhyType a},
  forall (m:matrix complex) (s:set a) (f:a -> matrix complex) (l:Z),
  (0%Z < (cardinal s))%Z ->
  (forall (e1:a), (mem e1 s) -> is_a_ket_l (f e1) l) ->
  (((columns m) = (rows m)) /\ ((rows m) = (power_ 2%Z l))) ->
  ((mat_mult m (ket_sum_l s f l)) =
   (ket_sum_l s (fun (x:a) => (mat_mult m (f x))) l)).

Axiom fun_inversion_pre :
  forall (f:Z -> Z) (s:set Z) (s':set Z) (a:Z -> complex) (n:Z),
  (0%Z <= n)%Z -> ((cardinal s) > 0%Z)%Z -> (p_bijective f s s') ->
  (subset s (to_fset 0%Z n)) -> (subset s' (to_fset 0%Z n)) ->
  ((mat_sum s
    (fun (j:Z) =>
     (infix_asdtdt (a j) (set1 (make n 1%Z c_zero) (f j) 0%Z c_one))))
   =
   (mat_sum s'
    (fun (j:Z) =>
     (infix_asdtdt (a (inv_func f s s' j))
      (set1 (make n 1%Z c_zero) j 0%Z c_one))))).

Axiom ket_fun_inversion :
  forall (f:Z -> Z) (a:Z -> complex) (m:matrix complex) (pow_2_n:Z),
  (pow_2_n = (power 2%Z (ket_length m))) -> (is_a_ket m) ->
  (pow_2_n > 0%Z)%Z ->
  (p_bijective f (to_fset 0%Z pow_2_n) (to_fset 0%Z pow_2_n)) ->
  (m =
   (mat_sum (to_fset 0%Z pow_2_n)
    (fun (j:Z) => (infix_asdtdt (a j) (ket (ket_length m) (f j)))))) ->
  (m =
   (mat_sum (to_fset 0%Z pow_2_n)
    (fun (j:Z) =>
     (infix_asdtdt (a (inv_ f (to_fset 0%Z pow_2_n) (to_fset 0%Z pow_2_n) j))
      (ket (ket_length m) j))))).

Axiom ket_sum_partition_filter :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (p1:a -> bool) (p2:a -> bool)
    (n:Z),
  (0%Z <= n)%Z ->
  (forall (e1:a), (mem e1 s) -> ((p1 e1) = true) <-> ~ ((p2 e1) = true)) ->
  ((ket_sum_l s f n) =
   (add_ket_l (ket_sum_l (my_filter s p1) f n)
    (ket_sum_l (my_filter s p2) f n) n)).

Parameter ket_to_bv: (matrix complex) -> bitvec.

Axiom ket_to_bv_def :
  forall (x:matrix complex), (is_a_ket_basis_elt x) ->
  ((ket_to_bv x) = (int_to_bv (ket_to_int x) (ket_length x))).

Axiom ket_to_bv_spec :
  forall (x:matrix complex), (is_a_ket_basis_elt x) ->
  ((bv_to_int (ket_to_bv x)) = (ket_to_int x)).

Axiom ket_to_bv_spec1 :
  forall (x:matrix complex), (is_a_ket_basis_elt x) ->
  ((length (ket_to_bv x)) = (ket_length x)).

Axiom ket_to_bv_spec2 :
  forall (x:matrix complex), (is_a_ket_basis_elt x) ->
  mem (ket_to_bv x) (n_bvs (ket_length x)).

Axiom ket_to_bv_length :
  forall (x:matrix complex) (n:Z), (is_a_ket_basis_elt x) ->
  ((ket_length x) = n) -> ((length (ket_to_bv x)) = n).

Parameter bv_to_ket: bitvec -> matrix complex.

Axiom bv_to_ket_def :
  forall (bv:bitvec), ((bv_to_ket bv) = (ket (length bv) (bv_to_int bv))).

Axiom bv_to_ket_spec : forall (bv:bitvec), is_a_ket_basis_elt (bv_to_ket bv).

Axiom bv_to_ket_spec1 :
  forall (bv:bitvec), ((ket_to_int (bv_to_ket bv)) = (bv_to_int bv)).

Axiom bv_to_ket_spec2 :
  forall (bv:bitvec), is_a_ket_l (bv_to_ket bv) (length bv).

Axiom bv_to_ket_spec3 :
  forall (bv:bitvec), ((rows (bv_to_ket bv)) = (power 2%Z (length bv))).

Axiom bv_to_ket_spec4 : forall (bv:bitvec), ((columns (bv_to_ket bv)) = 1%Z).

Axiom bv_to_ket_spec5 :
  forall (bv:bitvec), ((bv_to_ket bv) = (bin_to_ket (length bv) (getbv bv))).

Axiom ket_to_bv_ket_length :
  forall (i:Z) (n:Z), (n >= 0%Z)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) ->
  ((length (ket_to_bv (ket n i))) = n).

Axiom is_a_ket_l_bv_to_ket :
  forall (bv:bitvec) (l:Z), ((length bv) = l) -> is_a_ket_l (bv_to_ket bv) l.

Axiom bin_to_ket_to_bv_to_ket :
  forall (f:Z -> Z) (n:Z), (0%Z <= n)%Z -> (binary f) ->
  ((bin_to_ket n f) = (bv_to_ket (make_bv f n))).

Axiom bin_to_ket_to_bv_to_ket_abs :
  forall (f:Z -> Z) (n:Z) (a:bitvec), (0%Z <= n)%Z -> (a = (make_bv f n)) ->
  (binary f) -> ((bin_to_ket n f) = (bv_to_ket a)).

Axiom ket_to_int_to_bv_to_ket :
  forall (n:Z) (e1:bitvec), (0%Z <= n)%Z -> (mem e1 (n_bvs n)) ->
  ((ket n (bv_to_int e1)) = (bv_to_ket e1)).

Axiom ket_to_bv_ket :
  forall (n:Z) (i:Z), (0%Z <= n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power_ 2%Z n))%Z) ->
  ((ket_to_bv (ket n i)) = (int_to_bv i n)).

Axiom bv_to_ket_length :
  forall (bv:bitvec), ((ket_length (bv_to_ket bv)) = (length bv)).

Axiom get_ket_bv_to_ket_length :
  forall (bv:bitvec) (k:Z),
  ((0%Z <= k)%Z /\ (k < (power 2%Z (length bv)))%Z) ->
  ((k = (bv_to_int bv)) -> ((get_ket (bv_to_ket bv) k) = c_one)) /\
  (~ (k = (bv_to_int bv)) -> ((get_ket (bv_to_ket bv) k) = c_zero)).

Axiom is_a_ket_l_bvs :
  forall (e1:bitvec) (n:Z), (0%Z <= n)%Z -> (mem e1 (n_bvs n)) ->
  is_a_ket_l (bv_to_ket e1) n.

Axiom is_a_ket_l_scal_bvs :
  forall (e1:bitvec) (n:Z) (a:complex), (0%Z <= n)%Z -> (mem e1 (n_bvs n)) ->
  is_a_ket_l (infix_asdtdt a (bv_to_ket e1)) n.

Axiom ket_to_bv_concat :
  forall (x:bitvec) (y:bitvec),
  ((bv_to_ket (concat x y)) = (kronecker (bv_to_ket x) (bv_to_ket y))).

Axiom bv_to_ket_concat_rev :
  forall (x:bitvec) (y:bitvec),
  ((kronecker (bv_to_ket x) (bv_to_ket y)) = (bv_to_ket (concat x y))).

Axiom bv_to_ket_to_bv :
  forall (bv:bitvec), ((ket_to_bv (bv_to_ket bv)) = bv).

Axiom ket_to_bv_to_ket :
  forall (x:matrix complex), (is_a_ket_basis_elt x) ->
  ((bv_to_ket (ket_to_bv x)) = x).

Axiom bv_to_ket_eq :
  forall (bv1:bitvec) (bv2:bitvec), ((length bv1) = (length bv2)) ->
  (forall (i:Z), ((0%Z <= i)%Z /\ (i < (length bv1))%Z) ->
   (((getbv bv1) i) = ((getbv bv2) i))) ->
  ((bv_to_ket bv1) = (bv_to_ket bv2)).

Axiom ket_decomp_ :
  forall (m:matrix complex) (n:Z), (0%Z <= n)%Z -> (is_a_ket m) ->
  ((ket_length m) = n) ->
  (m =
   (ket_sum_l (n_bvs n)
    (fun (bvx:bitvec) =>
     (infix_asdtdt (get_ket m (bv_to_int bvx)) (bv_to_ket bvx)))
    n)).

Axiom ket_to_bv_kronecker :
  forall (x:matrix complex) (y:matrix complex), (is_a_ket_basis_elt x) ->
  (is_a_ket_basis_elt y) ->
  ((ket_to_bv (kronecker x y)) = (concat (ket_to_bv x) (ket_to_bv y))).

Axiom ket_decomp_bv_ket :
  forall (m:matrix complex) (n:Z), (0%Z <= n)%Z -> (is_a_ket m) ->
  ((ket_length m) = n) ->
  (m =
   (ket_sum_l (n_bvs n)
    (fun (bvx:bitvec) =>
     (infix_asdtdt (get_ket m (bv_to_int bvx)) (ket n (bv_to_int bvx))))
    n)).

Axiom ket_zero : forall (n:Z), (n >= 0%Z)%Z -> is_a_ket_l (ket n 0%Z) n.

Axiom ket_zero1 :
  forall (n:Z), (n >= 0%Z)%Z -> is_a_ket_basis_elt (ket n 0%Z).

Axiom ket_zero2 :
  forall (n:Z), (n >= 0%Z)%Z ->
  ((ket_to_bv (ket n 0%Z)) = (make_bv (fun (us:Z) => 0%Z) n)).

Axiom ket_zero3 :
  forall (n:Z), (n >= 0%Z)%Z -> forall (i:Z), ((0%Z <= i)%Z /\ (i < n)%Z) ->
  (((getbv (ket_to_bv (ket n 0%Z))) i) = 0%Z).

Axiom uniform_ket_norm_l :
  forall (x:matrix complex) (f:bitvec -> complex) (n:Z), (is_a_ket_l x n) ->
  (forall (e1:bitvec), (mem e1 (n_bvs n)) -> ((modulus (f e1)) = c_one)) ->
  (x =
   (infix_asdtdt (pow_inv_sqrt_2 n)
    (ket_sum_l (n_bvs n)
     (fun (x1:bitvec) => (infix_asdtdt (f x1) (bv_to_ket x1))) n))) ->
  ((ket_norm_l x n) = c_one).

Parameter ket_sum_l_diag: (bitvec -> complex) -> Z -> matrix complex.

Axiom ket_sum_l_diag_def :
  forall (f:bitvec -> complex) (l:Z), (0%Z <= l)%Z ->
  ((ket_sum_l_diag f l) =
   (ket_sum_l (n_bvs l)
    (fun (x:bitvec) => (infix_asdtdt (f x) (bv_to_ket x))) l)).

Axiom ket_sum_l_diag_spec :
  forall (f:bitvec -> complex) (l:Z), (0%Z <= l)%Z ->
  is_a_ket_l (ket_sum_l_diag f l) l.

Axiom ket_sum_l_diag_spec1 :
  forall (f:bitvec -> complex) (l:Z), (0%Z <= l)%Z -> forall (i:Z),
  ((0%Z <= i)%Z /\ (i < (power_ 2%Z l))%Z) ->
  ((get_ket (ket_sum_l_diag f l) i) = (f (int_to_bv i l))).

Axiom ket_sum_of_scalars :
  forall (f:bitvec -> complex) (n:Z), (n >= 0%Z)%Z ->
  is_a_ket_l
  (ket_sum_l (n_bvs n) (fun (x:bitvec) => (infix_asdtdt (f x) (bv_to_ket x)))
   n)
  n.

Axiom ket_sum_of_scalars1 :
  forall (f:bitvec -> complex) (n:Z), (n >= 0%Z)%Z -> forall (i:Z),
  ((0%Z <= i)%Z /\ (i < (power_ 2%Z n))%Z) ->
  ((get
    (ket_sum_l (n_bvs n)
     (fun (x:bitvec) => (infix_asdtdt (f x) (bv_to_ket x))) n)
    i 0%Z)
   = (f (int_to_bv i n))).

Axiom mat_sum_sum_cartesian_product_pre :
  forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b},
  forall (s1:set a) (s2:set b) (f:a -> b -> matrix complex) (r:Z) (c:Z),
  (0%Z < r)%Z -> (0%Z < c)%Z ->
  (forall (a1:a) (b1:b), (mem a1 s1) -> (mem b1 s2) ->
   ((rows ((f a1) b1)) = r)) ->
  (forall (a1:a) (b1:b), (mem a1 s1) -> (mem b1 s2) ->
   ((columns ((f a1) b1)) = c)) ->
  ((cardinal s1) > 0%Z)%Z -> ((cardinal s2) > 0%Z)%Z ->
  ((mat_sum s1 (fun (a1:a) => (mat_sum s2 (f a1)))) =
   (mat_sum (cartesian_product s1 s2)
    (fun (o:(a* b)%type) => ((f (fir o)) (sec o))))).

Axiom mat_sum_comp1 :
  forall (f:bitvec -> bitvec -> matrix complex) (l:Z) (x:Z) (y:Z),
  (0%Z <= x)%Z -> (0%Z <= y)%Z -> (0%Z <= l)%Z ->
  (forall (bvx:bitvec) (bvy:bitvec), (mem bvx (n_bvs x)) ->
   (mem bvy (n_bvs y)) -> is_a_ket ((f bvy) bvx)) ->
  (forall (bvx:bitvec) (bvy:bitvec), (mem bvx (n_bvs x)) ->
   (mem bvy (n_bvs y)) -> ((ket_length ((f bvy) bvx)) = l)) ->
  ((mat_sum (n_bvs y)
    (fun (bvy:bitvec) =>
     (mat_sum (n_bvs x) (fun (bvx:bitvec) => ((f bvy) bvx)))))
   =
   (mat_sum (n_bvs (x + y)%Z)
    (fun (bv:bitvec) => ((f (hpart bv y)) (tpart bv y))))).

Axiom mat_sum_comp_rev :
  forall (f:bitvec -> bitvec -> matrix complex) (l:Z) (x:Z) (y:Z),
  (0%Z <= x)%Z -> (0%Z <= y)%Z -> (0%Z <= l)%Z ->
  (forall (bvx:bitvec) (bvy:bitvec), (mem bvx (n_bvs x)) ->
   (mem bvy (n_bvs y)) -> is_a_ket ((f bvy) bvx)) ->
  (forall (bvx:bitvec) (bvy:bitvec), (mem bvx (n_bvs x)) ->
   (mem bvy (n_bvs y)) -> ((ket_length ((f bvy) bvx)) = l)) ->
  ((mat_sum (n_bvs (x + y)%Z)
    (fun (bv:bitvec) => ((f (hpart bv y)) (tpart bv y))))
   =
   (mat_sum (n_bvs y)
    (fun (bvy:bitvec) =>
     (mat_sum (n_bvs x) (fun (bvx:bitvec) => ((f bvy) bvx)))))).

Axiom ket_sum_bin_comp_l :
  forall (f:bitvec -> bitvec -> matrix complex) (scal:bitvec -> complex)
    (l:Z) (x:Z) (y:Z),
  (0%Z <= x)%Z -> (0%Z <= y)%Z -> (0%Z <= l)%Z ->
  ((ket_sum_l (n_bvs y)
    (fun (bvy:bitvec) =>
     (infix_asdtdt (scal bvy)
      (ket_sum_l (n_bvs x) (fun (bvx:bitvec) => ((f bvy) bvx)) l)))
    l)
   =
   (ket_sum_l (n_bvs (x + y)%Z)
    (fun (bv:bitvec) =>
     (infix_asdtdt (scal (hpart bv y)) ((f (hpart bv y)) (tpart bv y))))
    l)).

Axiom ket_sum_bin_comp :
  forall (f:bitvec -> bitvec -> matrix complex) (l:Z) (x:Z) (y:Z),
  (0%Z <= x)%Z -> (0%Z <= y)%Z -> (0%Z <= l)%Z ->
  ((ket_sum_l (n_bvs y)
    (fun (bvy:bitvec) =>
     (ket_sum_l (n_bvs x) (fun (bvx:bitvec) => ((f bvy) bvx)) l))
    l)
   =
   (ket_sum_l (n_bvs (x + y)%Z)
    (fun (bv:bitvec) => ((f (hpart bv y)) (tpart bv y))) l)).

Axiom ket_sum_bin_comp_rev :
  forall (f:bitvec -> bitvec -> matrix complex) (l:Z) (x:Z) (y:Z),
  (0%Z <= x)%Z -> (0%Z <= y)%Z -> (0%Z <= l)%Z ->
  ((ket_sum_l (n_bvs (x + y)%Z)
    (fun (bv:bitvec) => ((f (hpart bv y)) (tpart bv y))) l)
   =
   (ket_sum_l (n_bvs y)
    (fun (bvy:bitvec) =>
     (ket_sum_l (n_bvs x) (fun (bvx:bitvec) => ((f bvy) bvx)) l))
    l)).

Axiom ket_sum_bin_comp_rev_ :
  forall (f:bitvec -> bitvec -> matrix complex) (l:Z) (x:Z) (y:Z),
  (0%Z <= x)%Z -> (0%Z <= y)%Z -> (0%Z <= l)%Z ->
  ((ket_sum_l (n_bvs (x + y)%Z)
    (fun (bv:bitvec) => ((f (hpart bv x)) (tpart bv x))) l)
   =
   (ket_sum_l (n_bvs x)
    (fun (bvx:bitvec) =>
     (ket_sum_l (n_bvs y) (fun (bvy:bitvec) => ((f bvx) bvy)) l))
    l)).

Axiom ket_sum_bv_to_ints :
  forall (n:Z) (f:bitvec -> matrix complex) (g:Z -> matrix complex),
  (n >= 0%Z)%Z ->
  (forall (x:bitvec), ((length x) = n) -> ((f x) = (g (bv_to_int x)))) ->
  ((ket_sum_l (n_bvs n) f n) = (ket_sum_l (to_fset 0%Z (power 2%Z n)) g n)).

Axiom ket_sum_sum_rev :
  forall (f:bitvec -> bitvec -> matrix complex) (l:Z) (l1:Z) (l2:Z),
  (0%Z <= l)%Z -> ((0%Z <= l1)%Z /\ (l1 = l2)) ->
  ((ket_sum_l (n_bvs l1) (fun (x:bitvec) => (ket_sum_l (n_bvs l2) (f x) l))
    l)
   =
   (ket_sum_l (n_bvs l2) (fun (y:bitvec) => (ket_sum_l (n_bvs l1) (f y) l))
    l)).

Axiom get_ket_sum :
  forall (f:bitvec -> complex) (n:Z) (i:Z),
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) -> (n >= 0%Z)%Z ->
  ((get_ket
    (ket_sum_l (n_bvs n)
     (fun (y:bitvec) => (infix_asdtdt (f y) (bv_to_ket y))) n)
    i)
   = (f (int_to_bv i n))).

Axiom get_ket_scalar_zero :
  forall (x:matrix complex) (a:complex),
  ((get_ket (infix_asdtdt a x) 0%Z) = (infix_asdt a (get_ket x 0%Z))).

Axiom ket_sum_sum_complex :
  forall (f:bitvec -> bitvec -> complex) (sx:set bitvec) (sy:set bitvec)
    (l:Z),
  (0%Z <= l)%Z -> (forall (x:bitvec), (mem x sx) -> ((length x) = l)) ->
  (forall (y:bitvec), (mem y sy) -> ((length y) = l)) ->
  ((ket_sum_l sx
    (fun (x:bitvec) =>
     (ket_sum_l sy (fun (y:bitvec) => (infix_asdtdt ((f x) y) (bv_to_ket y)))
      l))
    l)
   =
   (ket_sum_l sy
    (fun (y:bitvec) =>
     (infix_asdtdt (sum sx (fun (x:bitvec) => ((f x) y))) (bv_to_ket y)))
    l)).

Axiom mat_mult_ket_basis_bv_value :
  forall (m:matrix complex) (x:bitvec) (i:Z) (l:Z), ((length x) = l) ->
  ((0%Z <= i)%Z /\ (i < (power_ 2%Z l))%Z) ->
  (((columns m) = (rows m)) /\ ((rows m) = (power_ 2%Z l))) ->
  ((get_ket (mat_mult m (bv_to_ket x)) i) = (get m i (bv_to_int x))).

Axiom mat_mult_ket_basis_bv_value_gen :
  forall (m:matrix complex) (l:Z),
  (((columns m) = (rows m)) /\ ((rows m) = (power_ 2%Z l))) ->
  forall (x:bitvec), forall (i:Z), ((length x) = l) ->
  ((0%Z <= i)%Z /\ (i < (power_ 2%Z l))%Z) ->
  ((get_ket (mat_mult m (bv_to_ket x)) i) = (get m i (bv_to_int x))).

Axiom mat_mult_ket_injec_eq_left :
  forall (m:matrix complex) (n:matrix complex) (l:Z),
  ((rows m) = (power_ 2%Z l)) -> ((columns m) = (power_ 2%Z l)) ->
  ((rows n) = (power_ 2%Z l)) -> ((columns n) = (power_ 2%Z l)) ->
  (forall (x:bitvec), ((length x) = l) ->
   ((mat_mult m (bv_to_ket x)) = (mat_mult n (bv_to_ket x)))) ->
  (m = n).

Axiom pps : Type.
Parameter pps_WhyType : WhyType pps.
Existing Instance pps_WhyType.

Parameter h_width: pps -> Z.

Parameter h_range: pps -> Z.

Parameter h_basis_ket: pps -> (Z -> Z) -> (Z -> Z) -> Z -> Z.

Parameter h_angle: pps -> (Z -> Z) -> (Z -> Z) -> angle.

Axiom pps'invariant : forall (self:pps), (0%Z <= (h_width self))%Z.

Axiom pps'invariant1 : forall (self:pps), (0%Z <= (h_range self))%Z.

Axiom pps'invariant2 :
  forall (self:pps), forall (x:Z -> Z) (y:Z -> Z),
  (forall (i:Z), ((0%Z <= i)%Z /\ (i < (h_width self))%Z) ->
   (0%Z <= (x i))%Z /\ ((x i) < 2%Z)%Z) ->
  (forall (i:Z), ((0%Z <= i)%Z /\ (i < (h_range self))%Z) ->
   (0%Z <= (y i))%Z /\ ((y i) < 2%Z)%Z) ->
  forall (i:Z), ((0%Z <= i)%Z /\ (i < (h_width self))%Z) ->
  (0%Z <= ((((h_basis_ket self) x) y) i))%Z.

Axiom pps'invariant3 :
  forall (self:pps), forall (x:Z -> Z) (y:Z -> Z),
  (forall (i:Z), ((0%Z <= i)%Z /\ (i < (h_width self))%Z) ->
   (0%Z <= (x i))%Z /\ ((x i) < 2%Z)%Z) ->
  (forall (i:Z), ((0%Z <= i)%Z /\ (i < (h_range self))%Z) ->
   (0%Z <= (y i))%Z /\ ((y i) < 2%Z)%Z) ->
  forall (i:Z), ((0%Z <= i)%Z /\ (i < (h_width self))%Z) ->
  (((((h_basis_ket self) x) y) i) < 2%Z)%Z.

Axiom pps'invariant4 :
  forall (self:pps), forall (x:Z -> Z) (x':Z -> Z) (y:Z -> Z) (y':Z -> Z),
  (forall (i:Z), ((0%Z <= i)%Z /\ (i < (h_width self))%Z) ->
   ((x i) = (x' i))) ->
  (forall (i:Z), ((0%Z <= i)%Z /\ (i < (h_range self))%Z) ->
   ((y i) = (y' i))) ->
  forall (i:Z), ((0%Z <= i)%Z /\ (i < (h_width self))%Z) ->
  (((((h_basis_ket self) x) y) i) = ((((h_basis_ket self) x') y') i)).

Axiom pps'invariant5 :
  forall (self:pps), forall (x:Z -> Z) (x':Z -> Z) (y:Z -> Z) (y':Z -> Z),
  (forall (i:Z), ((0%Z <= i)%Z /\ (i < (h_width self))%Z) ->
   ((x i) = (x' i))) ->
  (forall (i:Z), ((0%Z <= i)%Z /\ (i < (h_range self))%Z) ->
   ((y i) = (y' i))) ->
  ((((h_angle self) x) y) = (((h_angle self) x') y')).

Parameter build_pps:
  Z -> Z -> ((Z -> Z) -> (Z -> Z) -> Z -> Z) ->
  ((Z -> Z) -> (Z -> Z) -> angle) -> pps.

Axiom build_pps_spec :
  forall (w:Z) (r:Z) (k:(Z -> Z) -> (Z -> Z) -> Z -> Z)
    (a:(Z -> Z) -> (Z -> Z) -> angle),
  (0%Z <= w)%Z -> (0%Z <= r)%Z ->
  (forall (x:Z -> Z) (y:Z -> Z),
   (forall (i:Z), ((0%Z <= i)%Z /\ (i < w)%Z) ->
    (0%Z <= (x i))%Z /\ ((x i) < 2%Z)%Z) ->
   (forall (i:Z), ((0%Z <= i)%Z /\ (i < r)%Z) ->
    (0%Z <= (y i))%Z /\ ((y i) < 2%Z)%Z) ->
   forall (i:Z), ((0%Z <= i)%Z /\ (i < w)%Z) ->
   (0%Z <= (((k x) y) i))%Z /\ ((((k x) y) i) < 2%Z)%Z) ->
  (forall (x:Z -> Z) (x':Z -> Z) (y:Z -> Z) (y':Z -> Z),
   (forall (i:Z), ((0%Z <= i)%Z /\ (i < w)%Z) -> ((x i) = (x' i))) ->
   (forall (i:Z), ((0%Z <= i)%Z /\ (i < r)%Z) -> ((y i) = (y' i))) ->
   forall (i:Z), ((0%Z <= i)%Z /\ (i < w)%Z) ->
   ((((k x) y) i) = (((k x') y') i))) ->
  (forall (x:Z -> Z) (x':Z -> Z) (y:Z -> Z) (y':Z -> Z),
   (forall (i:Z), ((0%Z <= i)%Z /\ (i < w)%Z) -> ((x i) = (x' i))) ->
   (forall (i:Z), ((0%Z <= i)%Z /\ (i < r)%Z) -> ((y i) = (y' i))) ->
   (((a x) y) = ((a x') y'))) ->
  ((h_width (build_pps w r k a)) = w).

Axiom build_pps_spec1 :
  forall (w:Z) (r:Z) (k:(Z -> Z) -> (Z -> Z) -> Z -> Z)
    (a:(Z -> Z) -> (Z -> Z) -> angle),
  (0%Z <= w)%Z -> (0%Z <= r)%Z ->
  (forall (x:Z -> Z) (y:Z -> Z),
   (forall (i:Z), ((0%Z <= i)%Z /\ (i < w)%Z) ->
    (0%Z <= (x i))%Z /\ ((x i) < 2%Z)%Z) ->
   (forall (i:Z), ((0%Z <= i)%Z /\ (i < r)%Z) ->
    (0%Z <= (y i))%Z /\ ((y i) < 2%Z)%Z) ->
   forall (i:Z), ((0%Z <= i)%Z /\ (i < w)%Z) ->
   (0%Z <= (((k x) y) i))%Z /\ ((((k x) y) i) < 2%Z)%Z) ->
  (forall (x:Z -> Z) (x':Z -> Z) (y:Z -> Z) (y':Z -> Z),
   (forall (i:Z), ((0%Z <= i)%Z /\ (i < w)%Z) -> ((x i) = (x' i))) ->
   (forall (i:Z), ((0%Z <= i)%Z /\ (i < r)%Z) -> ((y i) = (y' i))) ->
   forall (i:Z), ((0%Z <= i)%Z /\ (i < w)%Z) ->
   ((((k x) y) i) = (((k x') y') i))) ->
  (forall (x:Z -> Z) (x':Z -> Z) (y:Z -> Z) (y':Z -> Z),
   (forall (i:Z), ((0%Z <= i)%Z /\ (i < w)%Z) -> ((x i) = (x' i))) ->
   (forall (i:Z), ((0%Z <= i)%Z /\ (i < r)%Z) -> ((y i) = (y' i))) ->
   (((a x) y) = ((a x') y'))) ->
  ((h_range (build_pps w r k a)) = r).

Axiom build_pps_spec2 :
  forall (w:Z) (r:Z) (k:(Z -> Z) -> (Z -> Z) -> Z -> Z)
    (a:(Z -> Z) -> (Z -> Z) -> angle),
  (0%Z <= w)%Z -> (0%Z <= r)%Z ->
  (forall (x:Z -> Z) (y:Z -> Z),
   (forall (i:Z), ((0%Z <= i)%Z /\ (i < w)%Z) ->
    (0%Z <= (x i))%Z /\ ((x i) < 2%Z)%Z) ->
   (forall (i:Z), ((0%Z <= i)%Z /\ (i < r)%Z) ->
    (0%Z <= (y i))%Z /\ ((y i) < 2%Z)%Z) ->
   forall (i:Z), ((0%Z <= i)%Z /\ (i < w)%Z) ->
   (0%Z <= (((k x) y) i))%Z /\ ((((k x) y) i) < 2%Z)%Z) ->
  (forall (x:Z -> Z) (x':Z -> Z) (y:Z -> Z) (y':Z -> Z),
   (forall (i:Z), ((0%Z <= i)%Z /\ (i < w)%Z) -> ((x i) = (x' i))) ->
   (forall (i:Z), ((0%Z <= i)%Z /\ (i < r)%Z) -> ((y i) = (y' i))) ->
   forall (i:Z), ((0%Z <= i)%Z /\ (i < w)%Z) ->
   ((((k x) y) i) = (((k x') y') i))) ->
  (forall (x:Z -> Z) (x':Z -> Z) (y:Z -> Z) (y':Z -> Z),
   (forall (i:Z), ((0%Z <= i)%Z /\ (i < w)%Z) -> ((x i) = (x' i))) ->
   (forall (i:Z), ((0%Z <= i)%Z /\ (i < r)%Z) -> ((y i) = (y' i))) ->
   (((a x) y) = ((a x') y'))) ->
  forall (x:bitvec) (y:bitvec), forall (i:Z), ((length x) = w) ->
  ((length y) = r) -> ((0%Z <= i)%Z /\ (i < w)%Z) ->
  (((((h_basis_ket (build_pps w r k a)) (getbv x)) (getbv y)) i) =
   (int.EuclideanDivision.mod1 (((k (getbv x)) (getbv y)) i) 2%Z)).

Axiom build_pps_spec3 :
  forall (w:Z) (r:Z) (k:(Z -> Z) -> (Z -> Z) -> Z -> Z)
    (a:(Z -> Z) -> (Z -> Z) -> angle),
  (0%Z <= w)%Z -> (0%Z <= r)%Z ->
  (forall (x:Z -> Z) (y:Z -> Z),
   (forall (i:Z), ((0%Z <= i)%Z /\ (i < w)%Z) ->
    (0%Z <= (x i))%Z /\ ((x i) < 2%Z)%Z) ->
   (forall (i:Z), ((0%Z <= i)%Z /\ (i < r)%Z) ->
    (0%Z <= (y i))%Z /\ ((y i) < 2%Z)%Z) ->
   forall (i:Z), ((0%Z <= i)%Z /\ (i < w)%Z) ->
   (0%Z <= (((k x) y) i))%Z /\ ((((k x) y) i) < 2%Z)%Z) ->
  (forall (x:Z -> Z) (x':Z -> Z) (y:Z -> Z) (y':Z -> Z),
   (forall (i:Z), ((0%Z <= i)%Z /\ (i < w)%Z) -> ((x i) = (x' i))) ->
   (forall (i:Z), ((0%Z <= i)%Z /\ (i < r)%Z) -> ((y i) = (y' i))) ->
   forall (i:Z), ((0%Z <= i)%Z /\ (i < w)%Z) ->
   ((((k x) y) i) = (((k x') y') i))) ->
  (forall (x:Z -> Z) (x':Z -> Z) (y:Z -> Z) (y':Z -> Z),
   (forall (i:Z), ((0%Z <= i)%Z /\ (i < w)%Z) -> ((x i) = (x' i))) ->
   (forall (i:Z), ((0%Z <= i)%Z /\ (i < r)%Z) -> ((y i) = (y' i))) ->
   (((a x) y) = ((a x') y'))) ->
  forall (x:bitvec) (y:bitvec), ((length x) = w) -> ((length y) = r) ->
  ((((h_angle (build_pps w r k a)) (getbv x)) (getbv y)) =
   ((a (getbv x)) (getbv y))).

Parameter build_pps_bv:
  Z -> Z -> (bitvec -> bitvec -> bitvec) -> (bitvec -> bitvec -> angle) ->
  pps.

Axiom build_pps_bv_def :
  forall (w:Z) (r:Z) (k:bitvec -> bitvec -> bitvec)
    (a:bitvec -> bitvec -> angle),
  (0%Z <= w)%Z -> (0%Z <= r)%Z ->
  (forall (x:bitvec) (y:bitvec), ((length x) = w) -> ((length y) = r) ->
   ((length ((k x) y)) = w)) ->
  ((build_pps_bv w r k a) =
   (build_pps w r
    (fun (x:Z -> Z) (y:Z -> Z) =>
     (getbv
      ((k (make_bv (fun (i:Z) => (int.EuclideanDivision.mod1 (x i) 2%Z)) w))
       (make_bv (fun (i:Z) => (int.EuclideanDivision.mod1 (y i) 2%Z)) r))))
    (fun (x:Z -> Z) (y:Z -> Z) =>
     ((a (make_bv (fun (i:Z) => (int.EuclideanDivision.mod1 (x i) 2%Z)) w))
      (make_bv (fun (i:Z) => (int.EuclideanDivision.mod1 (y i) 2%Z)) r))))).

Axiom build_pps_bv_spec :
  forall (w:Z) (r:Z) (k:bitvec -> bitvec -> bitvec)
    (a:bitvec -> bitvec -> angle),
  (0%Z <= w)%Z -> (0%Z <= r)%Z ->
  (forall (x:bitvec) (y:bitvec), ((length x) = w) -> ((length y) = r) ->
   ((length ((k x) y)) = w)) ->
  ((h_width (build_pps_bv w r k a)) = w).

Axiom build_pps_bv_spec1 :
  forall (w:Z) (r:Z) (k:bitvec -> bitvec -> bitvec)
    (a:bitvec -> bitvec -> angle),
  (0%Z <= w)%Z -> (0%Z <= r)%Z ->
  (forall (x:bitvec) (y:bitvec), ((length x) = w) -> ((length y) = r) ->
   ((length ((k x) y)) = w)) ->
  ((h_range (build_pps_bv w r k a)) = r).

Axiom build_pps_bv_spec2 :
  forall (w:Z) (r:Z) (k:bitvec -> bitvec -> bitvec)
    (a:bitvec -> bitvec -> angle),
  (0%Z <= w)%Z -> (0%Z <= r)%Z ->
  (forall (x:bitvec) (y:bitvec), ((length x) = w) -> ((length y) = r) ->
   ((length ((k x) y)) = w)) ->
  forall (x:bitvec) (y:bitvec), forall (i:Z), ((length x) = w) ->
  ((length y) = r) -> ((0%Z <= i)%Z /\ (i < w)%Z) ->
  (((((h_basis_ket (build_pps_bv w r k a)) (getbv x)) (getbv y)) i) =
   ((getbv ((k x) y)) i)).

Axiom build_pps_bv_spec3 :
  forall (w:Z) (r:Z) (k:bitvec -> bitvec -> bitvec)
    (a:bitvec -> bitvec -> angle),
  (0%Z <= w)%Z -> (0%Z <= r)%Z ->
  (forall (x:bitvec) (y:bitvec), ((length x) = w) -> ((length y) = r) ->
   ((length ((k x) y)) = w)) ->
  forall (x:bitvec) (y:bitvec), ((length x) = w) -> ((length y) = r) ->
  ((((h_angle (build_pps_bv w r k a)) (getbv x)) (getbv y)) = ((a x) y)).

Parameter h_basis_ket_bv: pps -> bitvec -> bitvec -> bitvec.

Axiom h_basis_ket_bv_def :
  forall (h:pps) (x:bitvec) (y:bitvec), ((length x) = (h_width h)) ->
  ((length y) = (h_range h)) ->
  ((h_basis_ket_bv h x y) =
   (make_bv (((h_basis_ket h) (getbv x)) (getbv y)) (h_width h))).

Axiom h_basis_ket_bv_spec :
  forall (h:pps) (x:bitvec) (y:bitvec), ((length x) = (h_width h)) ->
  ((length y) = (h_range h)) ->
  ((length (h_basis_ket_bv h x y)) = (h_width h)).

Axiom h_basis_ket_bv_spec1 :
  forall (h:pps) (x:bitvec) (y:bitvec), ((length x) = (h_width h)) ->
  ((length y) = (h_range h)) -> forall (i:Z),
  ((0%Z <= i)%Z /\ (i < (h_width h))%Z) ->
  (((getbv (h_basis_ket_bv h x y)) i) =
   ((((h_basis_ket h) (getbv x)) (getbv y)) i)).

Parameter h_angle_bv: pps -> bitvec -> bitvec -> angle.

Axiom h_angle_bv_def :
  forall (h:pps) (x:bitvec) (y:bitvec), ((length x) = (h_width h)) ->
  ((length y) = (h_range h)) ->
  ((h_angle_bv h x y) = (((h_angle h) (getbv x)) (getbv y))).

Axiom pps_ket_bound :
  forall (h:pps) (x:Z -> Z) (y:Z -> Z) (i:Z),
  ((0%Z <= i)%Z /\ (i < (h_width h))%Z) ->
  (forall (i1:Z), ((0%Z <= i1)%Z /\ (i1 < (h_width h))%Z) ->
   (0%Z <= (x i1))%Z /\ ((x i1) < 2%Z)%Z) ->
  (forall (i1:Z), ((0%Z <= i1)%Z /\ (i1 < (h_range h))%Z) ->
   (0%Z <= (y i1))%Z /\ ((y i1) < 2%Z)%Z) ->
  (0%Z <= ((((h_basis_ket h) x) y) i))%Z.

Axiom pps_ket_bound1 :
  forall (h:pps) (x:Z -> Z) (y:Z -> Z) (i:Z),
  ((0%Z <= i)%Z /\ (i < (h_width h))%Z) ->
  (forall (i1:Z), ((0%Z <= i1)%Z /\ (i1 < (h_width h))%Z) ->
   (0%Z <= (x i1))%Z /\ ((x i1) < 2%Z)%Z) ->
  (forall (i1:Z), ((0%Z <= i1)%Z /\ (i1 < (h_range h))%Z) ->
   (0%Z <= (y i1))%Z /\ ((y i1) < 2%Z)%Z) ->
  (((((h_basis_ket h) x) y) i) < 2%Z)%Z.

Axiom low_pps_ket_bound :
  forall (h:pps) (x:Z -> Z) (y:Z -> Z) (i:Z),
  ((0%Z <= i)%Z /\ (i < (h_width h))%Z) ->
  (forall (i1:Z), ((0%Z <= i1)%Z /\ (i1 < (h_width h))%Z) ->
   (0%Z <= (x i1))%Z /\ ((x i1) < 2%Z)%Z) ->
  (forall (i1:Z), ((0%Z <= i1)%Z /\ (i1 < (h_range h))%Z) ->
   (0%Z <= (y i1))%Z /\ ((y i1) < 2%Z)%Z) ->
  (0%Z <= ((((h_basis_ket h) x) y) i))%Z.

Axiom high_pps_ket_bound :
  forall (h:pps) (x:Z -> Z) (y:Z -> Z) (i:Z),
  ((0%Z <= i)%Z /\ (i < (h_width h))%Z) ->
  (forall (i1:Z), ((0%Z <= i1)%Z /\ (i1 < (h_width h))%Z) ->
   (0%Z <= (x i1))%Z /\ ((x i1) < 2%Z)%Z) ->
  (forall (i1:Z), ((0%Z <= i1)%Z /\ (i1 < (h_range h))%Z) ->
   (0%Z <= (y i1))%Z /\ ((y i1) < 2%Z)%Z) ->
  (((((h_basis_ket h) x) y) i) < 2%Z)%Z.

Parameter pps_apply_basis: pps -> bitvec -> matrix complex.

Axiom pps_apply_basis_def :
  forall (h:pps) (x:bitvec), ((length x) = (h_width h)) ->
  ((pps_apply_basis h x) =
   (infix_asdtdt (pow_inv_sqrt_2 (h_range h))
    (ket_sum_l (n_bvs (h_range h))
     (fun (y:bitvec) =>
      (infix_asdtdt (ang_exp (((h_angle h) (getbv x)) (getbv y)))
       (bv_to_ket
        (make_bv (((h_basis_ket h) (getbv x)) (getbv y)) (h_width h)))))
     (h_width h)))).

Axiom pps_apply_basis_spec :
  forall (h:pps) (x:bitvec), ((length x) = (h_width h)) ->
  is_a_ket_l (pps_apply_basis h x) (h_width h).

Axiom pps_apply_basis_spec1 :
  forall (h:pps) (x:bitvec), ((length x) = (h_width h)) -> forall (i:Z),
  ((0%Z <= i)%Z /\ (i < (power_ 2%Z (h_width h)))%Z) ->
  ((get_ket (pps_apply_basis h x) i) =
   (infix_asdt (pow_inv_sqrt_2 (h_range h))
    (sum (n_bvs (h_range h))
     (fun (y:bitvec) =>
      (infix_asdt (ang_exp (((h_angle h) (getbv x)) (getbv y)))
       (indic
        (bv_to_int
         (make_bv (((h_basis_ket h) (getbv x)) (getbv y)) (h_width h)))
        i)))))).

Axiom pps_apply_basis_decomp :
  forall (h:pps) (x:bitvec), ((length x) = (h_width h)) ->
  ((pps_apply_basis h x) =
   (ket_sum_l (n_bvs (h_width h))
    (fun (z:bitvec) =>
     (infix_asdtdt
      (infix_asdt (pow_inv_sqrt_2 (h_range h))
       (sum (n_bvs (h_range h))
        (fun (y:bitvec) =>
         (infix_asdt (ang_exp (((h_angle h) (getbv x)) (getbv y)))
          (indic (h_basis_ket_bv h x y) z)))))
      (ket (h_width h) (bv_to_int z))))
    (h_width h))).

Axiom pps_apply_basis_ket_l :
  forall (h:pps) (x:bitvec) (l:Z), ((length x) = l) -> (l = (h_width h)) ->
  is_a_ket_l (pps_apply_basis h x) l.

Axiom pps_apply_basis_ket_length :
  forall (h:pps) (x:bitvec) (l:Z), ((length x) = l) -> (l = (h_width h)) ->
  ((ket_length (pps_apply_basis h x)) = l).

Axiom pps_apply_basis_bv :
  forall (h:pps) (x:bitvec), ((length x) = (h_width h)) ->
  ((pps_apply_basis h x) =
   (infix_asdtdt (pow_inv_sqrt_2 (h_range h))
    (ket_sum_l (n_bvs (h_range h))
     (fun (y:bitvec) =>
      (infix_asdtdt (ang_exp (h_angle_bv h x y))
       (bv_to_ket (h_basis_ket_bv h x y))))
     (h_width h)))).

Axiom pps_apply_basis_value :
  forall (h:pps) (x:bitvec), ((length x) = (h_width h)) -> forall (i:Z),
  ((0%Z <= i)%Z /\ (i < (power_ 2%Z (h_width h)))%Z) ->
  ((get_ket (pps_apply_basis h x) i) =
   (infix_asdt (pow_inv_sqrt_2 (h_range h))
    (sum (n_bvs (h_range h))
     (fun (y:bitvec) =>
      (infix_asdt (ang_exp (h_angle_bv h x y))
       (indic (h_basis_ket_bv h x y) (int_to_bv i (h_width h)))))))).

Parameter pps_apply: pps -> (matrix complex) -> matrix complex.

Parameter result18: pps -> (matrix complex) -> bitvec -> matrix complex.

Axiom result_def18 :
  forall (h:pps) (x:matrix complex) (y:bitvec),
  (((length y) = (h_width h)) ->
   (((result18 h x) y) =
    (infix_asdtdt (get_ket x (bv_to_int y)) (pps_apply_basis h y)))) /\
  (~ ((length y) = (h_width h)) -> (((result18 h x) y) = x)).

Axiom pps_apply_def :
  forall (h:pps) (x:matrix complex), (is_a_ket_l x (h_width h)) ->
  ((pps_apply h x) =
   (ket_sum_l (n_bvs (h_width h)) (result18 h x) (h_width h))).

Axiom pps_apply_spec :
  forall (h:pps) (x:matrix complex), (is_a_ket_l x (h_width h)) ->
  is_a_ket_l (pps_apply h x) (h_width h).

Axiom get_pps_apply :
  forall (h:pps) (x:matrix complex), (is_a_ket_l x (h_width h)) ->
  ((pps_apply h x) =
   (ket_sum_l (n_bvs (h_width h))
    (fun (y:bitvec) =>
     (infix_asdtdt (get_ket x (bv_to_int y)) (pps_apply_basis h y)))
    (h_width h))).

Axiom rewrite_pps_apply_basis :
  forall (h:pps) (x:matrix complex), (is_a_ket_l x (h_width h)) ->
  (is_a_ket_basis_elt x) ->
  ((pps_apply h x) = (pps_apply_basis h (ket_to_bv x))).

Axiom rewrite_pps_apply_basis_rev :
  forall (h:pps) (x:bitvec), ((length x) = (h_width h)) ->
  ((pps_apply_basis h x) = (pps_apply h (bv_to_ket x))).

Axiom pps_apply_decomp :
  forall (h:pps) (x:matrix complex), (is_a_ket_l x (h_width h)) ->
  ((pps_apply h x) =
   (ket_sum_l (n_bvs (h_width h))
    (fun (z:bitvec) =>
     (infix_asdtdt (get_ket x (bv_to_int z)) (pps_apply h (bv_to_ket z))))
    (h_width h))).

Axiom pps_apply_scal :
  forall (h:pps) (x:matrix complex) (a:complex),
  (is_a_ket_l x (h_width h)) ->
  ((pps_apply h (infix_asdtdt a x)) = (infix_asdtdt a (pps_apply h x))).

Axiom pps_apply_add :
  forall (h:pps) (x:matrix complex) (y:matrix complex) (l:Z),
  (is_a_ket_l x (h_width h)) -> (is_a_ket_l y (h_width h)) ->
  (l = (h_width h)) ->
  ((pps_apply h (add_ket_l x y l)) =
   (add_ket_l (pps_apply h x) (pps_apply h y) l)).

Axiom pps_apply_sum :
  forall {a:Type} {a_WT:WhyType a},
  forall (h:pps) (s:set a) (f:a -> matrix complex) (l:Z),
  (1%Z <= (cardinal s))%Z ->
  (forall (e1:a), (mem e1 s) -> is_a_ket_l (f e1) (h_width h)) ->
  (l = (h_width h)) ->
  ((pps_apply h (ket_sum_l s f l)) =
   (ket_sum_l s (fun (e1:a) => (pps_apply h (f e1))) l)).

Parameter pps_id: pps.

Axiom pps_id_def : ((h_width pps_id) = 1%Z).

Axiom pps_id_def1 : ((h_range pps_id) = 0%Z).

Axiom pps_id_def2 :
  forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
  (((((h_basis_ket pps_id) x) y) i) = (x i)).

Axiom pps_id_def3 :
  forall (x:Z -> Z) (y:Z -> Z), ((((h_angle pps_id) x) y) = ang_zero).

Parameter pps_swap: pps.

Axiom pps_swap_def : ((h_width pps_swap) = 2%Z).

Axiom pps_swap_def1 : ((h_range pps_swap) = 0%Z).

Axiom pps_swap_def2 :
  forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
  (((x 0%Z) = (x 1%Z)) -> (((((h_basis_ket pps_swap) x) y) i) = (x i))) /\
  (~ ((x 0%Z) = (x 1%Z)) ->
   (((((h_basis_ket pps_swap) x) y) i) = (x (1%Z - i)%Z))).

Axiom pps_swap_def3 :
  forall (x:Z -> Z) (y:Z -> Z), ((((h_angle pps_swap) x) y) = ang_zero).

Parameter pps_phase: Z -> pps.

Axiom pps_phase_spec : forall (k:Z), ((h_width (pps_phase k)) = 1%Z).

Axiom pps_phase_spec1 : forall (k:Z), ((h_range (pps_phase k)) = 0%Z).

Axiom pps_phase_spec2 :
  forall (k:Z), forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
  (((((h_basis_ket (pps_phase k)) x) y) i) = (x i)).

Axiom pps_phase_spec3 :
  forall (k:Z), forall (x:Z -> Z) (y:Z -> Z),
  ((0%Z <= k)%Z -> ((((h_angle (pps_phase k)) x) y) = (int_to_ang 1%Z k))) /\
  (~ (0%Z <= k)%Z ->
   ((((h_angle (pps_phase k)) x) y) = (int_to_ang (-1%Z)%Z (-k)%Z))).

Parameter pps_rz: Z -> pps.

Axiom pps_rz_spec : forall (k:Z), ((h_width (pps_rz k)) = 1%Z).

Axiom pps_rz_spec1 : forall (k:Z), ((h_range (pps_rz k)) = 0%Z).

Axiom pps_rz_spec2 :
  forall (k:Z), forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
  (((((h_basis_ket (pps_rz k)) x) y) i) = (x i)).

Axiom pps_rz_spec3 :
  forall (k:Z), forall (x:Z -> Z) (y:Z -> Z),
  (((x 0%Z) = 0%Z) -> ((((h_angle (pps_rz k)) x) y) = ang_zero)) /\
  (~ ((x 0%Z) = 0%Z) ->
   ((0%Z <= k)%Z -> ((((h_angle (pps_rz k)) x) y) = (int_to_ang 1%Z k))) /\
   (~ (0%Z <= k)%Z ->
    ((((h_angle (pps_rz k)) x) y) = (int_to_ang (-1%Z)%Z (-k)%Z)))).

Parameter pps_hadamard: pps.

Axiom pps_hadamard_def : ((h_width pps_hadamard) = 1%Z).

Axiom pps_hadamard_def1 : ((h_range pps_hadamard) = 1%Z).

Axiom pps_hadamard_def2 :
  forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
  (((((h_basis_ket pps_hadamard) x) y) i) = (y i)).

Axiom pps_hadamard_def3 :
  forall (x:Z -> Z) (y:Z -> Z),
  ((((x 0%Z) = (y 0%Z)) /\ ((y 0%Z) = 1%Z)) ->
   ((((h_angle pps_hadamard) x) y) = ang_minus_one)) /\
  (~ (((x 0%Z) = (y 0%Z)) /\ ((y 0%Z) = 1%Z)) ->
   ((((h_angle pps_hadamard) x) y) = ang_zero)).

Parameter pps_cnot: pps.

Axiom pps_cnot_def : ((h_width pps_cnot) = 2%Z).

Axiom pps_cnot_def1 : ((h_range pps_cnot) = 0%Z).

Axiom pps_cnot_def2 :
  forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
  ((i = 0%Z) -> (((((h_basis_ket pps_cnot) x) y) i) = (x i))) /\
  (~ (i = 0%Z) ->
   (((((h_basis_ket pps_cnot) x) y) i) =
    (int.EuclideanDivision.mod1 ((x 0%Z) + (x i))%Z 2%Z))).

Axiom pps_cnot_def3 :
  forall (x:Z -> Z) (y:Z -> Z), ((((h_angle pps_cnot) x) y) = ang_zero).

Axiom pps_id_apply_basis :
  forall (x:bitvec), ((length x) = 1%Z) ->
  ((pps_apply_basis pps_id x) = (bv_to_ket x)).

Axiom pps_swap_apply_basis :
  forall (x:bitvec), ((length x) = 2%Z) ->
  (((bv_to_int x) = 0%Z) -> ((pps_apply_basis pps_swap x) = (ket 2%Z 0%Z))) /\
  (~ ((bv_to_int x) = 0%Z) ->
   (((bv_to_int x) = 1%Z) -> ((pps_apply_basis pps_swap x) = (ket 2%Z 2%Z))) /\
   (~ ((bv_to_int x) = 1%Z) ->
    (((bv_to_int x) = 2%Z) -> ((pps_apply_basis pps_swap x) = (ket 2%Z 1%Z))) /\
    (~ ((bv_to_int x) = 2%Z) ->
     ((pps_apply_basis pps_swap x) = (ket 2%Z 3%Z))))).

Axiom pps_cnot_apply_basis :
  forall (x:bitvec), ((length x) = 2%Z) ->
  (((bv_to_int x) = 0%Z) -> ((pps_apply_basis pps_cnot x) = (ket 2%Z 0%Z))) /\
  (~ ((bv_to_int x) = 0%Z) ->
   (((bv_to_int x) = 1%Z) -> ((pps_apply_basis pps_cnot x) = (ket 2%Z 1%Z))) /\
   (~ ((bv_to_int x) = 1%Z) ->
    (((bv_to_int x) = 2%Z) -> ((pps_apply_basis pps_cnot x) = (ket 2%Z 3%Z))) /\
    (~ ((bv_to_int x) = 2%Z) ->
     ((pps_apply_basis pps_cnot x) = (ket 2%Z 2%Z))))).

Axiom pps_phase_apply_basis :
  forall (k:Z) (x:bitvec), ((length x) = 1%Z) ->
  ((0%Z <= k)%Z ->
   ((pps_apply_basis (pps_phase k) x) =
    (infix_asdtdt (ang_exp (int_to_ang 1%Z k)) (bv_to_ket x)))) /\
  (~ (0%Z <= k)%Z ->
   ((pps_apply_basis (pps_phase k) x) =
    (infix_asdtdt (ang_exp (int_to_ang (-1%Z)%Z (-k)%Z)) (bv_to_ket x)))).

Axiom pps_rz_apply_basis :
  forall (k:Z) (x:bitvec), ((length x) = 1%Z) ->
  ((((getbv x) 0%Z) = 0%Z) ->
   ((pps_apply_basis (pps_rz k) x) = (bv_to_ket x))) /\
  (~ (((getbv x) 0%Z) = 0%Z) ->
   ((0%Z <= k)%Z ->
    ((pps_apply_basis (pps_rz k) x) =
     (infix_asdtdt (ang_exp (int_to_ang 1%Z k)) (bv_to_ket x)))) /\
   (~ (0%Z <= k)%Z ->
    ((pps_apply_basis (pps_rz k) x) =
     (infix_asdtdt (ang_exp (int_to_ang (-1%Z)%Z (-k)%Z)) (bv_to_ket x))))).

Axiom pps_hadamard_apply_basis :
  forall (x:bitvec), ((length x) = 1%Z) ->
  ((((getbv x) 0%Z) = 0%Z) ->
   ((pps_apply_basis pps_hadamard x) =
    (infix_asdtdt (pow_inv_sqrt_2 1%Z)
     (add_ket_l (ket 1%Z 0%Z) (ket 1%Z 1%Z) 1%Z)))) /\
  (~ (((getbv x) 0%Z) = 0%Z) ->
   ((pps_apply_basis pps_hadamard x) =
    (infix_asdtdt (pow_inv_sqrt_2 1%Z)
     (add_ket_l (ket 1%Z 0%Z)
      (infix_asdtdt (prefix_mndt c_one) (ket 1%Z 1%Z)) 1%Z)))).

Parameter pps_seq: pps -> pps -> pps.

Axiom pps_seq_spec :
  forall (h1:pps) (h2:pps), ((h_width h1) = (h_width h2)) ->
  ((h_width (pps_seq h1 h2)) = (h_width h1)).

Axiom pps_seq_spec1 :
  forall (h1:pps) (h2:pps), ((h_width h1) = (h_width h2)) ->
  ((h_range (pps_seq h1 h2)) = ((h_range h1) + (h_range h2))%Z).

Axiom pps_seq_spec2 :
  forall (h1:pps) (h2:pps), ((h_width h1) = (h_width h2)) ->
  forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
  (((((h_basis_ket (pps_seq h1 h2)) x) y) i) =
   ((((h_basis_ket h2) (((h_basis_ket h1) x) y))
     fun (k:Z) => (y (k + (h_range h1))%Z))
    i)).

Axiom pps_seq_spec3 :
  forall (h1:pps) (h2:pps), ((h_width h1) = (h_width h2)) ->
  forall (x:Z -> Z) (y:Z -> Z),
  ((((h_angle (pps_seq h1 h2)) x) y) =
   (ang_add (((h_angle h1) x) y)
    (((h_angle h2) (((h_basis_ket h1) x) y))
     fun (k:Z) => (y (k + (h_range h1))%Z)))).

Axiom h_basis_ket_bv_seq :
  forall (h1:pps) (h2:pps) (x:bitvec) (y:bitvec),
  ((h_width h1) = (h_width h2)) -> ((length x) = (h_width h1)) ->
  ((length y) = ((h_range h1) + (h_range h2))%Z) ->
  ((h_basis_ket_bv (pps_seq h1 h2) x y) =
   (h_basis_ket_bv h2 (h_basis_ket_bv h1 x (hpart y (h_range h1)))
    (tpart y (h_range h1)))).

Axiom h_angle_bv_seq :
  forall (h1:pps) (h2:pps) (x:bitvec) (y:bitvec),
  ((h_width h1) = (h_width h2)) -> ((length x) = (h_width h1)) ->
  ((length y) = ((h_range h1) + (h_range h2))%Z) ->
  ((h_angle_bv (pps_seq h1 h2) x y) =
   (ang_add (h_angle_bv h1 x (hpart y (h_range h1)))
    (h_angle_bv h2 (h_basis_ket_bv h1 x (hpart y (h_range h1)))
     (tpart y (h_range h1))))).

Parameter pps_par: pps -> pps -> pps.

Axiom pps_par_spec :
  forall (h1:pps) (h2:pps),
  ((h_width (pps_par h1 h2)) = ((h_width h1) + (h_width h2))%Z).

Axiom pps_par_spec1 :
  forall (h1:pps) (h2:pps),
  ((h_range (pps_par h1 h2)) = ((h_range h1) + (h_range h2))%Z).

Axiom pps_par_spec2 :
  forall (h1:pps) (h2:pps), forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
  ((i < (h_width h1))%Z ->
   (((((h_basis_ket (pps_par h1 h2)) x) y) i) = ((((h_basis_ket h1) x) y) i))) /\
  (~ (i < (h_width h1))%Z ->
   (((((h_basis_ket (pps_par h1 h2)) x) y) i) =
    ((((h_basis_ket h2) fun (k:Z) => (x (k + (h_width h1))%Z))
      fun (k:Z) => (y (k + (h_range h1))%Z))
     (i - (h_width h1))%Z))).

Axiom pps_par_spec3 :
  forall (h1:pps) (h2:pps), forall (x:Z -> Z) (y:Z -> Z),
  ((((h_angle (pps_par h1 h2)) x) y) =
   (ang_add (((h_angle h1) x) y)
    (((h_angle h2) fun (k:Z) => (x (k + (h_width h1))%Z))
     fun (k:Z) => (y (k + (h_range h1))%Z)))).

Axiom h_basis_ket_bv_par :
  forall (h1:pps) (h2:pps) (x:bitvec) (y:bitvec),
  ((length x) = ((h_width h1) + (h_width h2))%Z) ->
  ((length y) = ((h_range h1) + (h_range h2))%Z) ->
  ((h_basis_ket_bv (pps_par h1 h2) x y) =
   (concat (h_basis_ket_bv h1 (hpart x (h_width h1)) (hpart y (h_range h1)))
    (h_basis_ket_bv h2 (tpart x (h_width h1)) (tpart y (h_range h1))))).

Axiom h_angle_bv_par :
  forall (h1:pps) (h2:pps) (x:bitvec) (y:bitvec),
  ((length x) = ((h_width h1) + (h_width h2))%Z) ->
  ((length y) = ((h_range h1) + (h_range h2))%Z) ->
  ((h_angle_bv (pps_par h1 h2) x y) =
   (ang_add (h_angle_bv h1 (hpart x (h_width h1)) (hpart y (h_range h1)))
    (h_angle_bv h2 (tpart x (h_width h1)) (tpart y (h_range h1))))).

Axiom kron_to_ket_l :
  forall (x:matrix complex) (l:Z), (0%Z <= l)%Z ->
  (is_a_ket_l (kronecker x (ket 1%Z 0%Z)) (l + 1%Z)%Z) -> is_a_ket_l x l.

Parameter pps_anc: pps -> pps.

Axiom pps_anc_spec :
  forall (h1:pps), (1%Z <= (h_width h1))%Z ->
  ((h_width (pps_anc h1)) = ((h_width h1) - 1%Z)%Z).

Axiom pps_anc_spec1 :
  forall (h1:pps), (1%Z <= (h_width h1))%Z ->
  ((h_range (pps_anc h1)) = (h_range h1)).

Parameter fc11: pps -> (Z -> Z) -> Z -> Z.

Axiom fc_def11 :
  forall (h1:pps) (x:Z -> Z) (k:Z),
  ((k = ((h_width h1) - 1%Z)%Z) -> (((fc11 h1 x) k) = 0%Z)) /\
  (~ (k = ((h_width h1) - 1%Z)%Z) -> (((fc11 h1 x) k) = (x k))).

Axiom pps_anc_spec2 :
  forall (h1:pps), (1%Z <= (h_width h1))%Z -> forall (x:Z -> Z) (y:Z -> Z),
  forall (i:Z),
  (((((h_basis_ket (pps_anc h1)) x) y) i) =
   ((((h_basis_ket h1) (fc11 h1 x)) y) i)).

Parameter fc12: pps -> (Z -> Z) -> Z -> Z.

Axiom fc_def12 :
  forall (h1:pps) (x:Z -> Z) (k:Z),
  ((k = ((h_width h1) - 1%Z)%Z) -> (((fc12 h1 x) k) = 0%Z)) /\
  (~ (k = ((h_width h1) - 1%Z)%Z) -> (((fc12 h1 x) k) = (x k))).

Axiom pps_anc_spec3 :
  forall (h1:pps), (1%Z <= (h_width h1))%Z -> forall (x:Z -> Z) (y:Z -> Z),
  ((((h_angle (pps_anc h1)) x) y) = (((h_angle h1) (fc12 h1 x)) y)).

Axiom h_basis_ket_bv_anc :
  forall (h:pps) (x:bitvec) (y:bitvec), (1%Z <= (h_width h))%Z ->
  ((length x) = ((h_width h) - 1%Z)%Z) -> ((length y) = (h_range h)) ->
  ((h_basis_ket_bv (pps_anc h) x y) =
   (hpart (h_basis_ket_bv h (concat x (make_bv (fun (us:Z) => 0%Z) 1%Z)) y)
    ((h_width h) - 1%Z)%Z)).

Axiom h_basis_ket_bv_anc_ :
  forall (h:pps) (x:bitvec) (y:bitvec) (l:Z), (1%Z <= (h_width h))%Z ->
  (((getbv x) ((h_width h) - 1%Z)%Z) = 0%Z) -> ((length x) = (h_width h)) ->
  (l = ((h_width h) - 1%Z)%Z) -> ((length y) = (h_range h)) ->
  ((h_basis_ket_bv (pps_anc h) (hpart x l) y) =
   (hpart (h_basis_ket_bv h x y) ((h_width h) - 1%Z)%Z)).

Axiom h_angle_bv_anc :
  forall (h:pps) (x:bitvec) (y:bitvec), (1%Z <= (h_width h))%Z ->
  ((length x) = ((h_width h) - 1%Z)%Z) -> ((length y) = (h_range h)) ->
  ((h_angle_bv (pps_anc h) x y) =
   (h_angle_bv h (concat x (make_bv (fun (us:Z) => 0%Z) 1%Z)) y)).

Axiom h_angle_bv_anc_ :
  forall (h:pps) (x:bitvec) (y:bitvec) (l:Z), (1%Z <= (h_width h))%Z ->
  (((getbv x) ((h_width h) - 1%Z)%Z) = 0%Z) -> ((length x) = (h_width h)) ->
  (l = ((h_width h) - 1%Z)%Z) -> ((length y) = (h_range h)) ->
  ((h_angle_bv (pps_anc h) (hpart x l) y) = (h_angle_bv h x y)).

Parameter is_diagonal: (matrix complex) -> Prop.

Parameter fc13: (Z -> complex) -> Z -> Z -> complex.

Axiom fc_def13 :
  forall (f:Z -> complex) (i:Z) (j:Z),
  ((i = j) -> ((((fc13 f) i) j) = (f i))) /\
  (~ (i = j) -> ((((fc13 f) i) j) = c_zero)).

Axiom is_diagonal_def :
  forall (m:matrix complex), (is_diagonal m) ->
  exists f:Z -> complex, (m = (make_f (rows m) (rows m) (fc13 f))).

Parameter fc14: (Z -> complex) -> Z -> Z -> complex.

Axiom fc_def14 :
  forall (f:Z -> complex) (i:Z) (j:Z),
  ((i = j) -> ((((fc14 f) i) j) = (f i))) /\
  (~ (i = j) -> ((((fc14 f) i) j) = c_zero)).

Axiom is_diagonal_def1 :
  forall (m:matrix complex),
  (exists f:Z -> complex, (m = (make_f (rows m) (rows m) (fc14 f)))) ->
  is_diagonal m.

Parameter diag_mat: (Z -> complex) -> Z -> matrix complex.

Parameter result19: (Z -> complex) -> Z -> Z -> complex.

Axiom result_def19 :
  forall (f:Z -> complex) (i:Z) (j:Z),
  ((i = j) -> ((((result19 f) i) j) = (f i))) /\
  (~ (i = j) -> ((((result19 f) i) j) = c_zero)).

Axiom diag_mat_def :
  forall (f:Z -> complex) (s:Z), (0%Z < s)%Z ->
  ((diag_mat f s) = (make_f s s (result19 f))).

Axiom diag_mat_spec :
  forall (f:Z -> complex) (s:Z), (0%Z < s)%Z -> is_diagonal (diag_mat f s).

Axiom diag_mat_spec1 :
  forall (f:Z -> complex) (s:Z), (0%Z < s)%Z -> ((rows (diag_mat f s)) = s).

Axiom diag_mat_spec2 :
  forall (f:Z -> complex) (s:Z), (0%Z < s)%Z ->
  ((columns (diag_mat f s)) = s).

Axiom diag_mat_rows :
  forall (f:Z -> complex) (s:Z), (0%Z < s)%Z -> ((rows (diag_mat f s)) = s).

Axiom diag_mat_columns :
  forall (f:Z -> complex) (s:Z), (0%Z < s)%Z ->
  ((columns (diag_mat f s)) = s).

Axiom diag_mat_values :
  forall (f:Z -> complex) (s:Z) (i:Z) (j:Z), (0%Z < s)%Z ->
  ((0%Z <= i)%Z /\ (i < s)%Z) -> ((0%Z <= j)%Z /\ (j < s)%Z) ->
  ((i = j) -> ((get (diag_mat f s) i j) = (f i))) /\
  (~ (i = j) -> ((get (diag_mat f s) i j) = c_zero)).

Parameter diagonal: (matrix complex) -> Z -> complex.

Axiom diagonal_def :
  forall (m:matrix complex) (i:Z), ((0%Z <= i)%Z /\ (i < (rows m))%Z) ->
  (is_diagonal m) -> ((diagonal m i) = (get m i i)).

Axiom diag_mat_add :
  forall (f:Z -> complex) (g:Z -> complex) (h:Z -> complex) (s:Z),
  (0%Z < s)%Z ->
  (forall (i:Z), ((0%Z <= i)%Z /\ (i < s)%Z) ->
   ((infix_pldt (f i) (g i)) = (h i))) ->
  ((add_mat (diag_mat f s) (diag_mat g s)) = (diag_mat h s)).

Axiom diag_mat_subst :
  forall (f:Z -> complex) (g:Z -> complex) (h:Z -> complex) (s:Z),
  (0%Z < s)%Z ->
  (forall (i:Z), ((0%Z <= i)%Z /\ (i < s)%Z) ->
   ((infix_mndt (f i) (g i)) = (h i))) ->
  ((diag_mat h s) = (mat_substr (diag_mat f s) (diag_mat g s))).

Axiom diag_mat_scal :
  forall (f:Z -> complex) (g:Z -> complex) (s:Z) (a:complex), (0%Z < s)%Z ->
  (forall (i:Z), ((0%Z <= i)%Z /\ (i < s)%Z) ->
   ((g i) = (infix_asdt a (f i)))) ->
  ((diag_mat g s) = (infix_asdtdt a (diag_mat f s))).

Axiom diag_mat_eq :
  forall (f:Z -> complex) (g:Z -> complex) (s:Z) (s':Z), (0%Z < s)%Z ->
  (forall (i:Z), ((0%Z <= i)%Z /\ (i < s)%Z) -> ((f i) = (g i))) ->
  (s = s') -> ((diag_mat f s) = (diag_mat g s')).

Parameter id_mat: Z -> matrix complex.

Axiom id_mat_def :
  forall (n:Z), (n >= 1%Z)%Z ->
  ((id_mat n) = (diag_mat (fun (i:Z) => c_one) n)).

Axiom id_mat_spec :
  forall (n:Z), (n >= 1%Z)%Z -> forall (i:Z), ((0%Z <= i)%Z /\ (i < n)%Z) ->
  ((diagonal (id_mat n) i) = c_one).

Axiom id_mat_spec1 : forall (n:Z), (n >= 1%Z)%Z -> ((rows (id_mat n)) = n).

Axiom id_mat_spec2 :
  forall (n:Z), (n >= 1%Z)%Z -> ((columns (id_mat n)) = n).

Axiom set_id_mat :
  forall (n:Z) (f:Z -> complex), (1%Z <= n)%Z ->
  (forall (i:Z), ((0%Z <= i)%Z /\ (i < n)%Z) -> ((f i) = c_one)) ->
  ((diag_mat f n) = (id_mat n)).

Axiom id_mat_prod_r :
  forall (n:Z) (m:matrix complex), (1%Z <= n)%Z -> ((rows m) = n) ->
  ((mat_mult (id_mat n) m) = m).

Axiom id_mat_prod_l :
  forall (n:Z) (m:matrix complex), (n >= 1%Z)%Z -> ((columns m) = n) ->
  ((mat_mult m (id_mat n)) = m).

Axiom kronecker_scalar_distr :
  forall (m:matrix complex) (n:matrix complex) (a:complex),
  ((kronecker (infix_asdtdt a m) n) = (infix_asdtdt a (kronecker m n))).

Axiom kronecker_scalar_distr_r :
  forall (m:matrix complex) (n:matrix complex) (a:complex),
  ((kronecker m (infix_asdtdt a n)) = (infix_asdtdt a (kronecker m n))).

Axiom kronecker_scalar_distr_rev :
  forall (m:matrix complex) (n:matrix complex) (a:complex),
  ((infix_asdtdt a (kronecker m n)) = (kronecker (infix_asdtdt a m) n)).

Axiom kronecker_scalar_distr_rev_r :
  forall (m:matrix complex) (n:matrix complex) (a:complex),
  ((infix_asdtdt a (kronecker m n)) = (kronecker m (infix_asdtdt a n))).

Axiom kronecker_scalars :
  forall (m:matrix complex) (n:matrix complex) (a:complex) (b:complex),
  ((kronecker (infix_asdtdt a m) (infix_asdtdt b n)) =
   (infix_asdtdt (infix_asdt a b) (kronecker m n))).

Parameter mat_k_id: (matrix complex) -> Z -> matrix complex.

Axiom mat_k_id_def :
  forall (m:matrix complex) (n:Z), (0%Z <= n)%Z ->
  ((mat_k_id m n) = (kronecker m (identity n))).

Axiom mat_k_id_spec :
  forall (m:matrix complex) (n:Z), (0%Z <= n)%Z ->
  ((mat_k_id m n) =
   (make_f ((rows m) * (power 2%Z n))%Z ((columns m) * (power 2%Z n))%Z
    (fun (i:Z) (j:Z) =>
     (infix_asdt
      (indic (int.EuclideanDivision.mod1 i (power 2%Z n))
       (int.EuclideanDivision.mod1 j (power 2%Z n)))
      (get m (int.EuclideanDivision.div i (power 2%Z n))
       (int.EuclideanDivision.div j (power 2%Z n))))))).

Axiom mat_k_id_values :
  forall (m:matrix complex) (n:Z) (i:Z) (j:Z), (0%Z <= n)%Z ->
  ((0%Z <= i)%Z /\ (i < ((rows m) * (power 2%Z n))%Z)%Z) ->
  ((0%Z <= j)%Z /\ (j < ((columns m) * (power 2%Z n))%Z)%Z) ->
  ((get (mat_k_id m n) i j) =
   (infix_asdt
    (indic (int.EuclideanDivision.mod1 i (power 2%Z n))
     (int.EuclideanDivision.mod1 j (power 2%Z n)))
    (get m (int.EuclideanDivision.div i (power 2%Z n))
     (int.EuclideanDivision.div j (power 2%Z n))))).

Axiom mat_k_id_rows :
  forall (m:matrix complex) (n:Z), (0%Z <= n)%Z ->
  ((rows (mat_k_id m n)) = ((rows m) * (power 2%Z n))%Z).

Axiom mat_k_id_columns :
  forall (m:matrix complex) (n:Z), (0%Z <= n)%Z ->
  ((columns (mat_k_id m n)) = ((columns m) * (power 2%Z n))%Z).

Parameter id_k_mat: (matrix complex) -> Z -> matrix complex.

Axiom id_k_mat_def :
  forall (m:matrix complex) (n:Z), (0%Z <= n)%Z ->
  ((id_k_mat m n) = (kronecker (identity n) m)).

Axiom id_k_mat_spec :
  forall (m:matrix complex) (n:Z), (0%Z <= n)%Z ->
  ((id_k_mat m n) =
   (make_f ((rows m) * (power 2%Z n))%Z ((columns m) * (power 2%Z n))%Z
    (fun (i:Z) (j:Z) =>
     (infix_asdt
      (indic (int.EuclideanDivision.div i (rows m))
       (int.EuclideanDivision.div j (columns m)))
      (get m (int.EuclideanDivision.mod1 i (rows m))
       (int.EuclideanDivision.mod1 j (columns m))))))).

Axiom id_k_mat_values :
  forall (m:matrix complex) (n:Z) (i:Z) (j:Z), (0%Z <= n)%Z ->
  ((0%Z <= i)%Z /\ (i < ((rows m) * (power 2%Z n))%Z)%Z) ->
  ((0%Z <= j)%Z /\ (j < ((columns m) * (power 2%Z n))%Z)%Z) ->
  ((get (id_k_mat m n) i j) =
   (infix_asdt
    (indic (int.EuclideanDivision.div i (rows m))
     (int.EuclideanDivision.div j (columns m)))
    (get m (int.EuclideanDivision.mod1 i (rows m))
     (int.EuclideanDivision.mod1 j (columns m))))).

Axiom id_k_mat_rows :
  forall (m:matrix complex) (n:Z), (0%Z <= n)%Z ->
  ((rows (id_k_mat m n)) = ((rows m) * (power 2%Z n))%Z).

Axiom id_k_mat_columns :
  forall (m:matrix complex) (n:Z), (0%Z <= n)%Z ->
  ((columns (id_k_mat m n)) = ((columns m) * (power 2%Z n))%Z).

Parameter mat_prod_k_id:
  (matrix complex) -> (matrix complex) -> Z -> matrix complex.

Axiom mat_prod_k_id_def :
  forall (m:matrix complex) (o:matrix complex) (n:Z), (0%Z <= n)%Z ->
  ((columns m) = (rows o)) ->
  ((mat_prod_k_id m o n) = (kronecker (mat_mult m o) (identity n))).

Axiom mat_prod_k_id_spec :
  forall (m:matrix complex) (o:matrix complex) (n:Z), (0%Z <= n)%Z ->
  ((columns m) = (rows o)) ->
  ((mat_prod_k_id m o n) =
   (make_f ((rows m) * (power 2%Z n))%Z ((columns o) * (power 2%Z n))%Z
    (fun (i:Z) (j:Z) =>
     (infix_asdt
      (indic (int.EuclideanDivision.mod1 i (power 2%Z n))
       (int.EuclideanDivision.mod1 j (power 2%Z n)))
      (ind_sum
       (fun (k:Z) =>
        (infix_asdt (get m (int.EuclideanDivision.div i (power 2%Z n)) k)
         (get o k (int.EuclideanDivision.div j (power 2%Z n)))))
       0%Z (columns m)))))).

Parameter id_k_mat_prod:
  (matrix complex) -> (matrix complex) -> Z -> matrix complex.

Axiom id_k_mat_prod_def :
  forall (m:matrix complex) (o:matrix complex) (n:Z), (0%Z <= n)%Z ->
  ((columns m) = (rows o)) ->
  ((id_k_mat_prod m o n) = (kronecker (identity n) (mat_mult m o))).

Axiom id_k_mat_prod_spec :
  forall (m:matrix complex) (o:matrix complex) (n:Z), (0%Z <= n)%Z ->
  ((columns m) = (rows o)) ->
  ((id_k_mat_prod m o n) =
   (make_f ((rows m) * (power 2%Z n))%Z ((columns o) * (power 2%Z n))%Z
    (fun (i:Z) (j:Z) =>
     (infix_asdt
      (indic (int.EuclideanDivision.div i (rows m))
       (int.EuclideanDivision.div j (columns o)))
      (ind_sum
       (fun (k:Z) =>
        (infix_asdt (get m (int.EuclideanDivision.mod1 i (rows m)) k)
         (get o k (int.EuclideanDivision.mod1 j (columns o)))))
       0%Z (columns m)))))).

Axiom filter_sum_mod_indic :
  forall (v:Z) (n:Z) (p:Z) (g:Z -> complex), (n > 0%Z)%Z -> (v > 0%Z)%Z ->
  ((0%Z <= p)%Z /\ (p < v)%Z) ->
  ((sum (to_fset 0%Z (v * n)%Z)
    (fun (k:Z) =>
     (infix_asdt (indic (int.EuclideanDivision.mod1 k v) p)
      (g (int.EuclideanDivision.div k v)))))
   = (sum (to_fset 0%Z n) g)).

Axiom filter_sum_indic_div :
  forall (v:Z) (n:Z) (p:Z) (g:Z -> complex), (n > 0%Z)%Z -> (v > 0%Z)%Z ->
  ((0%Z <= p)%Z /\ (p < n)%Z) ->
  ((sum (to_fset 0%Z (v * n)%Z)
    (fun (k:Z) =>
     (infix_asdt (g (int.EuclideanDivision.mod1 k v))
      (indic (int.EuclideanDivision.div k v) p))))
   = (sum (to_fset 0%Z v) g)).

Axiom filtered_ind_sum_mod_indic :
  forall (v:Z) (n:Z) (p:Z) (g:Z -> complex), (n > 0%Z)%Z -> (v > 0%Z)%Z ->
  ((0%Z <= p)%Z /\ (p < v)%Z) ->
  ((ind_sum
    (fun (k:Z) =>
     (infix_asdt (indic (int.EuclideanDivision.mod1 k v) p)
      (g (int.EuclideanDivision.div k v))))
    0%Z (v * n)%Z)
   = (ind_sum g 0%Z n)).

Axiom filtered_ind_sum_indic_div :
  forall (v:Z) (n:Z) (p:Z) (g:Z -> complex), (n > 0%Z)%Z -> (v > 0%Z)%Z ->
  ((0%Z <= p)%Z /\ (p < n)%Z) ->
  ((ind_sum
    (fun (k:Z) =>
     (infix_asdt (g (int.EuclideanDivision.mod1 k v))
      (indic (int.EuclideanDivision.div k v) p)))
    0%Z (v * n)%Z)
   = (ind_sum g 0%Z v)).

Axiom prod_mat_k_id_pre :
  forall (m:matrix complex) (o:matrix complex) (i:Z) (j:Z) (n:Z),
  (0%Z <= n)%Z -> ((columns m) = (rows o)) ->
  ((0%Z <= i)%Z /\ (i < ((rows m) * (power 2%Z n))%Z)%Z) ->
  ((0%Z <= j)%Z /\ (j < ((columns o) * (power 2%Z n))%Z)%Z) ->
  ((get (mat_mult (mat_k_id m n) (mat_k_id o n)) i j) =
   (infix_asdt
    (indic (int.EuclideanDivision.mod1 i (power 2%Z n))
     (int.EuclideanDivision.mod1 j (power 2%Z n)))
    (ind_sum
     (fun (k:Z) =>
      (infix_asdt (get m (int.EuclideanDivision.div i (power 2%Z n)) k)
       (get o k (int.EuclideanDivision.div j (power 2%Z n)))))
     0%Z (columns m)))).

Parameter prod_mat_k_id:
  (matrix complex) -> (matrix complex) -> Z -> matrix complex.

Axiom prod_mat_k_id_def :
  forall (m:matrix complex) (o:matrix complex) (n:Z), (0%Z <= n)%Z ->
  ((columns m) = (rows o)) ->
  ((prod_mat_k_id m o n) = (mat_mult (mat_k_id m n) (mat_k_id o n))).

Axiom prod_mat_k_id_spec :
  forall (m:matrix complex) (o:matrix complex) (n:Z), (0%Z <= n)%Z ->
  ((columns m) = (rows o)) ->
  ((prod_mat_k_id m o n) =
   (make_f ((rows m) * (power 2%Z n))%Z ((columns o) * (power 2%Z n))%Z
    (fun (i:Z) (j:Z) =>
     (infix_asdt
      (indic (int.EuclideanDivision.mod1 i (power 2%Z n))
       (int.EuclideanDivision.mod1 j (power 2%Z n)))
      (ind_sum
       (fun (k:Z) =>
        (infix_asdt (get m (int.EuclideanDivision.div i (power 2%Z n)) k)
         (get o k (int.EuclideanDivision.div j (power 2%Z n)))))
       0%Z (columns m)))))).

Axiom prod_mat_k_id_dec :
  forall (m:matrix complex) (o:matrix complex) (n:Z), (0%Z <= n)%Z ->
  ((columns m) = (rows o)) -> ((prod_mat_k_id m o n) = (mat_prod_k_id m o n)).

Axiom k_id_prod_mat_pre :
  forall (m:matrix complex) (o:matrix complex) (i:Z) (j:Z) (n:Z),
  (0%Z <= n)%Z -> ((columns m) = (rows o)) ->
  ((0%Z <= i)%Z /\ (i < ((rows m) * (power 2%Z n))%Z)%Z) ->
  ((0%Z <= j)%Z /\ (j < ((columns o) * (power 2%Z n))%Z)%Z) ->
  ((get (mat_mult (id_k_mat m n) (id_k_mat o n)) i j) =
   (infix_asdt
    (indic (int.EuclideanDivision.div i (rows m))
     (int.EuclideanDivision.div j (columns o)))
    (ind_sum
     (fun (k:Z) =>
      (infix_asdt (get m (int.EuclideanDivision.mod1 i (rows m)) k)
       (get o k (int.EuclideanDivision.mod1 j (columns o)))))
     0%Z (columns m)))).

Parameter k_id_prod_mat:
  (matrix complex) -> (matrix complex) -> Z -> matrix complex.

Axiom k_id_prod_mat_def :
  forall (m:matrix complex) (o:matrix complex) (n:Z), (0%Z <= n)%Z ->
  ((columns m) = (rows o)) ->
  ((k_id_prod_mat m o n) = (mat_mult (id_k_mat m n) (id_k_mat o n))).

Axiom k_id_prod_mat_spec :
  forall (m:matrix complex) (o:matrix complex) (n:Z), (0%Z <= n)%Z ->
  ((columns m) = (rows o)) ->
  ((k_id_prod_mat m o n) =
   (make_f ((rows m) * (power 2%Z n))%Z ((columns o) * (power 2%Z n))%Z
    (fun (i:Z) (j:Z) =>
     (infix_asdt
      (indic (int.EuclideanDivision.div i (rows m))
       (int.EuclideanDivision.div j (columns o)))
      (ind_sum
       (fun (k:Z) =>
        (infix_asdt (get m (int.EuclideanDivision.mod1 i (rows m)) k)
         (get o k (int.EuclideanDivision.mod1 j (columns o)))))
       0%Z (columns m)))))).

Axiom k_id_prod_mat_dec :
  forall (m:matrix complex) (o:matrix complex) (n:Z), (0%Z <= n)%Z ->
  ((columns m) = (rows o)) -> ((k_id_prod_mat m o n) = (id_k_mat_prod m o n)).

Axiom split_ne_pre :
  forall (m1:matrix complex) (m2:matrix complex) (nc1:Z) (nc2:Z) (nr1:Z)
    (nr2:Z) (i:Z) (j:Z),
  (0%Z <= nr1)%Z -> (0%Z <= nr2)%Z -> (0%Z <= nc1)%Z -> (0%Z <= nc2)%Z ->
  ((columns m1) = (power 2%Z nc1)) -> ((columns m2) = (power 2%Z nc2)) ->
  ((rows m1) = (power 2%Z nr1)) -> ((rows m2) = (power 2%Z nr2)) ->
  ((0%Z <= i)%Z /\ (i < ((power 2%Z nr1) * (power 2%Z nr2))%Z)%Z) ->
  ((0%Z <= j)%Z /\ (j < ((power 2%Z nc1) * (power 2%Z nc2))%Z)%Z) ->
  ((get (mat_mult (id_k_mat m1 nr2) (mat_k_id m2 nc1)) i j) =
   (get (kronecker m2 m1) i j)).

Axiom split_nw_pre :
  forall (m1:matrix complex) (m2:matrix complex) (nc1:Z) (nc2:Z) (nr1:Z)
    (nr2:Z) (i:Z) (j:Z),
  (0%Z <= nr1)%Z -> (0%Z <= nr2)%Z -> (0%Z <= nc1)%Z -> (0%Z <= nc2)%Z ->
  ((columns m1) = (power 2%Z nc1)) -> ((columns m2) = (power 2%Z nc2)) ->
  ((rows m1) = (power 2%Z nr1)) -> ((rows m2) = (power 2%Z nr2)) ->
  ((0%Z <= i)%Z /\ (i < ((power 2%Z nr1) * (power 2%Z nr2))%Z)%Z) ->
  ((0%Z <= j)%Z /\ (j < ((power 2%Z nc1) * (power 2%Z nc2))%Z)%Z) ->
  ((get (mat_mult (mat_k_id m1 nr2) (id_k_mat m2 nc1)) i j) =
   (get (kronecker m1 m2) i j)).

Axiom split_ne :
  forall (m1:matrix complex) (m2:matrix complex) (nc1:Z) (nc2:Z) (nr1:Z)
    (nr2:Z),
  (0%Z <= nr1)%Z -> (0%Z <= nr2)%Z -> (0%Z <= nc1)%Z -> (0%Z <= nc2)%Z ->
  ((columns m1) = (power 2%Z nc1)) -> ((columns m2) = (power 2%Z nc2)) ->
  ((rows m1) = (power 2%Z nr1)) -> ((rows m2) = (power 2%Z nr2)) ->
  ((mat_mult (id_k_mat m1 nr2) (mat_k_id m2 nc1)) = (kronecker m2 m1)).

Axiom split_nw :
  forall (m1:matrix complex) (m2:matrix complex) (nc1:Z) (nc2:Z) (nr1:Z)
    (nr2:Z),
  (0%Z <= nr1)%Z -> (0%Z <= nr2)%Z -> (0%Z <= nc1)%Z -> (0%Z <= nc2)%Z ->
  ((columns m1) = (power 2%Z nc1)) -> ((columns m2) = (power 2%Z nc2)) ->
  ((rows m1) = (power 2%Z nr1)) -> ((rows m2) = (power 2%Z nr2)) ->
  ((mat_mult (mat_k_id m1 nr2) (id_k_mat m2 nc1)) = (kronecker m1 m2)).

Axiom shift_k_id :
  forall (m1:matrix complex) (m2:matrix complex) (nc1:Z) (nc2:Z) (nr1:Z)
    (nr2:Z),
  (0%Z <= nr1)%Z -> (0%Z <= nr2)%Z -> (0%Z <= nc1)%Z -> (0%Z <= nc2)%Z ->
  ((columns m1) = (power 2%Z nc1)) -> ((columns m2) = (power 2%Z nc2)) ->
  ((rows m1) = (power 2%Z nr1)) -> ((rows m2) = (power 2%Z nr2)) ->
  ((mat_mult (mat_k_id m1 nr2) (id_k_mat m2 nc1)) =
   (mat_mult (id_k_mat m2 nr1) (mat_k_id m1 nc2))).

Axiom kronecker_mult_commut :
  forall (a:matrix complex) (b:matrix complex) (c:matrix complex)
    (d:matrix complex) (ra:Z) (ca:Z) (cc:Z) (rb:Z) (cb:Z) (cd:Z),
  (0%Z <= ra)%Z -> (0%Z <= ca)%Z -> (0%Z <= cc)%Z -> (0%Z <= rb)%Z ->
  (0%Z <= cb)%Z -> (0%Z <= cd)%Z -> ((rows a) = (power 2%Z ra)) ->
  ((columns a) = (power 2%Z ca)) -> ((rows c) = (power 2%Z ca)) ->
  ((columns c) = (power 2%Z cc)) -> ((rows b) = (power 2%Z rb)) ->
  ((columns b) = (power 2%Z cb)) -> ((rows d) = (power 2%Z cb)) ->
  ((columns d) = (power 2%Z cd)) ->
  ((mat_mult (kronecker a b) (kronecker c d)) =
   (kronecker (mat_mult a c) (mat_mult b d))).

Parameter isa_square: (matrix complex) -> Prop.

Axiom isa_square_def :
  forall (m:matrix complex), (isa_square m) -> ((rows m) = (columns m)).

Axiom isa_square_def1 :
  forall (m:matrix complex), ((rows m) = (columns m)) -> isa_square m.

Parameter pow2dim: (matrix complex) -> Prop.

Axiom pow2dim_def :
  forall (m:matrix complex), (pow2dim m) ->
  exists i:Z, exists j:Z,
  ((rows m) = (power 2%Z i)) /\ ((columns m) = (power 2%Z j)).

Axiom pow2dim_def1 :
  forall (m:matrix complex),
  (exists i:Z, exists j:Z,
   ((rows m) = (power 2%Z i)) /\ ((columns m) = (power 2%Z j))) ->
  pow2dim m.

Parameter pow2dim_square: (matrix complex) -> Prop.

Axiom pow2dim_square_def :
  forall (m:matrix complex), (pow2dim_square m) ->
  exists i:Z, ((rows m) = (power 2%Z i)) /\ ((columns m) = (power 2%Z i)).

Axiom pow2dim_square_def1 :
  forall (m:matrix complex),
  (exists i:Z, ((rows m) = (power 2%Z i)) /\ ((columns m) = (power 2%Z i))) ->
  pow2dim_square m.

Axiom pow_2dim_kets : forall (m:matrix complex), (is_a_ket m) -> pow2dim m.

Parameter lnr: (matrix complex) -> Z.

Axiom lnr_spec :
  forall (m:matrix complex), (pow2dim m) -> ((rows m) = (power 2%Z (lnr m))).

Axiom lnr_spec1 :
  forall (m:matrix complex), (pow2dim m) -> ((lnr m) >= 0%Z)%Z.

Parameter lnc: (matrix complex) -> Z.

Axiom lnc_spec :
  forall (m:matrix complex), (pow2dim m) ->
  ((columns m) = (power 2%Z (lnc m))).

Axiom lnc_spec1 :
  forall (m:matrix complex), (pow2dim m) -> ((lnc m) >= 0%Z)%Z.

Axiom get_pow2dim :
  forall (m:matrix complex), (pow2dim m) ->
  exists i:Z, exists j:Z,
  ((rows m) = (power 2%Z i)) /\ ((columns m) = (power 2%Z j)).

Axiom set_pow2dim :
  forall (m:matrix complex),
  (exists i:Z, exists j:Z,
   ((rows m) = (power 2%Z i)) /\ ((columns m) = (power 2%Z j))) ->
  pow2dim m.

Axiom get_pow2dim_elt :
  forall (m:matrix complex) (i:Z) (j:Z), (pow2dim m) -> ((lnr m) = i) ->
  ((lnc m) = j) -> ((rows m) = (power 2%Z i)).

Axiom get_pow2dim_elt1 :
  forall (m:matrix complex) (i:Z) (j:Z), (pow2dim m) -> ((lnr m) = i) ->
  ((lnc m) = j) -> ((columns m) = (power 2%Z j)).

Axiom set_pow2dim_elt :
  forall (m:matrix complex) (i:Z) (j:Z), (0%Z <= i)%Z -> (0%Z <= j)%Z ->
  ((rows m) = (power 2%Z i)) -> ((columns m) = (power 2%Z j)) -> pow2dim m.

Axiom set_pow2dim_elt1 :
  forall (m:matrix complex) (i:Z) (j:Z), (0%Z <= i)%Z -> (0%Z <= j)%Z ->
  ((rows m) = (power 2%Z i)) -> ((columns m) = (power 2%Z j)) ->
  ((lnr m) = i).

Axiom set_pow2dim_elt2 :
  forall (m:matrix complex) (i:Z) (j:Z), (0%Z <= i)%Z -> (0%Z <= j)%Z ->
  ((rows m) = (power 2%Z i)) -> ((columns m) = (power 2%Z j)) ->
  ((lnc m) = j).

Parameter mat_size: (matrix complex) -> Z.

Axiom mat_size_def :
  forall (m:matrix complex), (isa_square m) -> ((mat_size m) = (rows m)).

Axiom mat_size_spec :
  forall (m:matrix complex), (isa_square m) -> ((mat_size m) = (rows m)).

Axiom mat_size_spec1 :
  forall (m:matrix complex), (isa_square m) -> ((mat_size m) = (columns m)).

Axiom get_square :
  forall (m:matrix complex), (isa_square m) -> ((rows m) = (columns m)).

Axiom set_square :
  forall (m:matrix complex), ((rows m) = (columns m)) -> isa_square m.

Axiom set_square_elt :
  forall (m:matrix complex) (i:Z), ((rows m) = i) -> ((columns m) = i) ->
  isa_square m.

Axiom set_square_elt1 :
  forall (m:matrix complex) (i:Z), ((rows m) = i) -> ((columns m) = i) ->
  ((mat_size m) = i).

Axiom get_square_elt :
  forall (m:matrix complex) (i:Z), (isa_square m) -> ((mat_size m) = i) ->
  ((rows m) = i).

Axiom get_square_elt1 :
  forall (m:matrix complex) (i:Z), (isa_square m) -> ((mat_size m) = i) ->
  ((columns m) = i).

Axiom pow2dim_square_dec :
  forall (m:matrix complex), (isa_square m) -> (pow2dim m) ->
  pow2dim_square m.

Axiom dec_pow2dim_square :
  forall (m:matrix complex), (pow2dim_square m) -> isa_square m.

Axiom dec_pow2dim_square1 :
  forall (m:matrix complex), (pow2dim_square m) -> pow2dim m.

Parameter ln_size: (matrix complex) -> Z.

Axiom ln_size_def :
  forall (m:matrix complex), (pow2dim_square m) -> ((ln_size m) = (lnr m)).

Axiom ln_size_spec :
  forall (m:matrix complex), (pow2dim_square m) -> ((ln_size m) = (lnc m)).

Axiom ln_size_spec1 :
  forall (m:matrix complex), (pow2dim_square m) ->
  ((rows m) = (power 2%Z (ln_size m))).

Axiom ln_size_spec2 :
  forall (m:matrix complex), (pow2dim_square m) ->
  ((columns m) = (power 2%Z (ln_size m))).

Axiom set_ln_size_lnc :
  forall (m:matrix complex) (i:Z), (pow2dim_square m) -> ((lnc m) = i) ->
  ((ln_size m) = i).

Axiom set_ln_size_lnr :
  forall (m:matrix complex) (i:Z), (pow2dim_square m) -> ((lnr m) = i) ->
  ((ln_size m) = i).

Axiom set_ln_size_columns :
  forall (m:matrix complex) (i:Z), (0%Z <= i)%Z -> (pow2dim_square m) ->
  ((columns m) = (power 2%Z i)) -> ((ln_size m) = i).

Axiom set_ln_size_rows :
  forall (m:matrix complex) (i:Z), (0%Z <= i)%Z -> (pow2dim_square m) ->
  ((rows m) = (power 2%Z i)) -> ((ln_size m) = i).

Axiom set_pow2dim_square :
  forall (m:matrix complex),
  (exists i:Z, ((rows m) = (columns m)) /\ ((columns m) = (power 2%Z i))) ->
  pow2dim_square m.

Axiom set_pow2dim_square_elt :
  forall (m:matrix complex) (i:Z), (0%Z <= i)%Z ->
  (((rows m) = (columns m)) /\ ((columns m) = (power 2%Z i))) ->
  pow2dim_square m.

Axiom set_pow2dim_square_elt1 :
  forall (m:matrix complex) (i:Z), (0%Z <= i)%Z ->
  (((rows m) = (columns m)) /\ ((columns m) = (power 2%Z i))) ->
  ((ln_size m) = i).

Axiom get_pow2dim_square_elt :
  forall (m:matrix complex) (i:Z), (pow2dim_square m) -> ((ln_size m) = i) ->
  ((rows m) = (power 2%Z i)).

Axiom get_pow2dim_square_elt1 :
  forall (m:matrix complex) (i:Z), (pow2dim_square m) -> ((ln_size m) = i) ->
  ((columns m) = (power 2%Z i)).

Axiom kronecker_mult_commut_p :
  forall (a:matrix complex) (b:matrix complex) (c:matrix complex)
    (d:matrix complex),
  ((columns a) = (rows c)) -> ((columns b) = (rows d)) -> (pow2dim a) ->
  (pow2dim b) -> (pow2dim c) -> (pow2dim d) ->
  ((mat_mult (kronecker a b) (kronecker c d)) =
   (kronecker (mat_mult a c) (mat_mult b d))).

Axiom kronecker_mult_commut_p_quant :
  forall (a:matrix complex) (b:matrix complex), (pow2dim a) -> (pow2dim b) ->
  forall (c:matrix complex) (d:matrix complex), ((columns a) = (rows c)) ->
  ((columns b) = (rows d)) -> (pow2dim c) -> (pow2dim d) ->
  ((mat_mult (kronecker a b) (kronecker c d)) =
   (kronecker (mat_mult a c) (mat_mult b d))).

Axiom kronecker_add_distr_l :
  forall (m:matrix complex) (n:matrix complex) (o:matrix complex),
  ((rows m) = (rows n)) -> ((columns m) = (columns n)) ->
  ((rows (kronecker (add_mat m n) o)) = ((rows m) * (rows o))%Z).

Axiom kronecker_add_distr_l1 :
  forall (m:matrix complex) (n:matrix complex) (o:matrix complex),
  ((rows m) = (rows n)) -> ((columns m) = (columns n)) ->
  ((columns (kronecker (add_mat m n) o)) = ((columns m) * (columns o))%Z).

Axiom kronecker_add_distr_l2 :
  forall (m:matrix complex) (n:matrix complex) (o:matrix complex),
  ((rows m) = (rows n)) -> ((columns m) = (columns n)) ->
  ((kronecker (add_mat m n) o) = (add_mat (kronecker m o) (kronecker n o))).

Axiom kronecker_add_distr_r :
  forall (m:matrix complex) (n:matrix complex) (o:matrix complex),
  ((rows m) = (rows n)) -> ((columns m) = (columns n)) ->
  ((kronecker o (add_mat m n)) = (add_mat (kronecker o m) (kronecker o n))).

Axiom kronecker_add_distr_r1 :
  forall (m:matrix complex) (n:matrix complex) (o:matrix complex),
  ((rows m) = (rows n)) -> ((columns m) = (columns n)) ->
  ((rows (kronecker o (add_mat m n))) = ((rows m) * (rows o))%Z).

Axiom kronecker_add_distr_r2 :
  forall (m:matrix complex) (n:matrix complex) (o:matrix complex),
  ((rows m) = (rows n)) -> ((columns m) = (columns n)) ->
  ((columns (kronecker o (add_mat m n))) = ((columns m) * (columns o))%Z).

Axiom kronecker_ket_add_distr_r :
  forall (m:matrix complex) (n:matrix complex) (x:matrix complex) (l:Z)
    (l1:Z) (l2:Z),
  (l = (l1 + l2)%Z) -> (is_a_ket_l m l1) -> (is_a_ket_l n l1) ->
  (is_a_ket_l x l2) ->
  ((add_ket_l (kronecker m x) (kronecker n x) l) =
   (kronecker (add_ket_l m n l1) x)).

Axiom kronecker_sum_distr_l :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (m:matrix complex),
  (constant_size s f) -> ((cardinal s) > 0%Z)%Z ->
  ((columns (mat_sum s (fun (k:a) => (kronecker (f k) m)))) =
   (columns ((fun (k:a) => (kronecker (f k) m)) (choose s)))).

Axiom kronecker_sum_distr_l1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (m:matrix complex),
  (constant_size s f) -> ((cardinal s) > 0%Z)%Z ->
  ((columns ((fun (k:a) => (kronecker (f k) m)) (choose s))) =
   ((columns m) * (columns (f (choose s))))%Z).

Axiom kronecker_sum_distr_l2 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (m:matrix complex),
  (constant_size s f) -> ((cardinal s) > 0%Z)%Z ->
  ((rows (mat_sum s (fun (k:a) => (kronecker (f k) m)))) =
   (rows ((fun (k:a) => (kronecker (f k) m)) (choose s)))).

Axiom kronecker_sum_distr_l3 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (m:matrix complex),
  (constant_size s f) -> ((cardinal s) > 0%Z)%Z ->
  ((rows ((fun (k:a) => (kronecker (f k) m)) (choose s))) =
   ((rows m) * (rows (f (choose s))))%Z).

Axiom kronecker_sum_distr_l4 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (m:matrix complex),
  (constant_size s f) -> ((cardinal s) > 0%Z)%Z ->
  ((kronecker (mat_sum s f) m) =
   (mat_sum s (fun (k:a) => (kronecker (f k) m)))).

Axiom kronecker_sum_distr_r :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (m:matrix complex),
  (constant_size s f) -> ((cardinal s) > 0%Z)%Z ->
  ((columns (mat_sum s (fun (k:a) => (kronecker m (f k))))) =
   (columns ((fun (k:a) => (kronecker m (f k))) (choose s)))).

Axiom kronecker_sum_distr_r1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (m:matrix complex),
  (constant_size s f) -> ((cardinal s) > 0%Z)%Z ->
  ((columns ((fun (k:a) => (kronecker m (f k))) (choose s))) =
   ((columns m) * (columns (f (choose s))))%Z).

Axiom kronecker_sum_distr_r2 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (m:matrix complex),
  (constant_size s f) -> ((cardinal s) > 0%Z)%Z ->
  ((rows (mat_sum s (fun (k:a) => (kronecker m (f k))))) =
   (rows ((fun (k:a) => (kronecker m (f k))) (choose s)))).

Axiom kronecker_sum_distr_r3 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (m:matrix complex),
  (constant_size s f) -> ((cardinal s) > 0%Z)%Z ->
  ((rows ((fun (k:a) => (kronecker m (f k))) (choose s))) =
   ((rows m) * (rows (f (choose s))))%Z).

Axiom kronecker_sum_distr_r4 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (m:matrix complex),
  (constant_size s f) -> ((cardinal s) > 0%Z)%Z ->
  ((kronecker m (mat_sum s f)) =
   (mat_sum s (fun (k:a) => (kronecker m (f k))))).

Axiom mat_sum_scalar1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (a1:complex),
  (constant_size s f) -> ((cardinal s) > 0%Z)%Z ->
  ((mat_sum s (fun (k:a) => (infix_asdtdt a1 (f k)))) =
   (infix_asdtdt a1 (mat_sum s f))).

Axiom kronecker_sum_distr_sc :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (m:matrix complex) (a1:complex),
  (constant_size s f) -> ((cardinal s) > 0%Z)%Z ->
  ((mat_sum s (fun (k:a) => (kronecker (infix_asdtdt a1 (f k)) m))) =
   (infix_asdtdt a1 (mat_sum s (fun (k:a) => (kronecker (f k) m))))).

Axiom kronecker_ket_sum_distr_l :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (m:matrix complex) (l1:Z) (l2:Z),
  (forall (e1:a), (mem e1 s) -> is_a_ket_l (f e1) l1) -> (is_a_ket_l m l2) ->
  ((cardinal s) > 0%Z)%Z ->
  is_a_ket_l (ket_sum_l s (fun (k:a) => (kronecker (f k) m)) (l1 + l2)%Z)
  (l1 + l2)%Z.

Axiom kronecker_ket_sum_distr_l1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (m:matrix complex) (l1:Z) (l2:Z),
  (forall (e1:a), (mem e1 s) -> is_a_ket_l (f e1) l1) -> (is_a_ket_l m l2) ->
  ((cardinal s) > 0%Z)%Z ->
  ((kronecker (ket_sum_l s f l1) m) =
   (ket_sum_l s (fun (k:a) => (kronecker (f k) m)) (l1 + l2)%Z)).

Axiom kronecker_ket_sum_distr_l_nol :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (m:matrix complex) (l1:Z),
  (forall (e1:a), (mem e1 s) -> is_a_ket_l (f e1) l1) -> (is_a_ket m) ->
  ((cardinal s) > 0%Z)%Z ->
  is_a_ket_l
  (ket_sum_l s (fun (k:a) => (kronecker (f k) m)) (l1 + (ket_length m))%Z)
  (l1 + (ket_length m))%Z.

Axiom kronecker_ket_sum_distr_l_nol1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (m:matrix complex) (l1:Z),
  (forall (e1:a), (mem e1 s) -> is_a_ket_l (f e1) l1) -> (is_a_ket m) ->
  ((cardinal s) > 0%Z)%Z ->
  ((kronecker (ket_sum_l s f l1) m) =
   (ket_sum_l s (fun (k:a) => (kronecker (f k) m)) (l1 + (ket_length m))%Z)).

Axiom kronecker_ket_sum_distr_l_rew :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (m:matrix complex) (l1:Z),
  (forall (e1:a), (mem e1 s) -> is_a_ket_l (f e1) l1) -> (is_a_ket m) ->
  ((cardinal s) > 0%Z)%Z ->
  ((kronecker (ket_sum_l s f l1) m) =
   (ket_sum_l s (fun (k:a) => (kronecker (f k) m)) (l1 + (ket_length m))%Z)).

Axiom kronecker_ket_sum_distr_r :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (m:matrix complex) (l1:Z) (l2:Z),
  (forall (e1:a), (mem e1 s) -> is_a_ket_l (f e1) l1) -> (is_a_ket_l m l2) ->
  ((cardinal s) > 0%Z)%Z ->
  is_a_ket_l (ket_sum_l s (fun (k:a) => (kronecker m (f k))) (l1 + l2)%Z)
  (l1 + l2)%Z.

Axiom kronecker_ket_sum_distr_r1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (m:matrix complex) (l1:Z) (l2:Z),
  (forall (e1:a), (mem e1 s) -> is_a_ket_l (f e1) l1) -> (is_a_ket_l m l2) ->
  ((cardinal s) > 0%Z)%Z ->
  ((kronecker m (ket_sum_l s f l1)) =
   (ket_sum_l s (fun (k:a) => (kronecker m (f k))) (l1 + l2)%Z)).

Axiom kronecker_ket_sum_distr_l_rev :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (m:matrix complex) (l1:Z) (l2:Z),
  (forall (e1:a), (mem e1 s) -> is_a_ket_l (f e1) l1) -> (is_a_ket_l m l2) ->
  ((cardinal s) > 0%Z)%Z ->
  is_a_ket_l (ket_sum_l s (fun (k:a) => (kronecker (f k) m)) (l1 + l2)%Z)
  (l1 + l2)%Z.

Axiom kronecker_ket_sum_distr_l_rev1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (m:matrix complex) (l1:Z) (l2:Z),
  (forall (e1:a), (mem e1 s) -> is_a_ket_l (f e1) l1) -> (is_a_ket_l m l2) ->
  ((cardinal s) > 0%Z)%Z ->
  ((ket_sum_l s (fun (k:a) => (kronecker (f k) m)) (l1 + l2)%Z) =
   (kronecker (ket_sum_l s f l1) m)).

Axiom kronecker_ket_sum_distr_r_rev :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (m:matrix complex) (l1:Z) (l2:Z),
  (forall (e1:a), (mem e1 s) -> is_a_ket_l (f e1) l1) -> (is_a_ket_l m l2) ->
  ((cardinal s) > 0%Z)%Z ->
  is_a_ket_l (ket_sum_l s (fun (k:a) => (kronecker m (f k))) (l1 + l2)%Z)
  (l1 + l2)%Z.

Axiom kronecker_ket_sum_distr_r_rev1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (m:matrix complex) (l1:Z) (l2:Z),
  (forall (e1:a), (mem e1 s) -> is_a_ket_l (f e1) l1) -> (is_a_ket_l m l2) ->
  ((cardinal s) > 0%Z)%Z ->
  ((ket_sum_l s (fun (k:a) => (kronecker m (f k))) (l1 + l2)%Z) =
   (kronecker m (ket_sum_l s f l1))).

Axiom kronecker_ket_sum_distr_l_ :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (m:matrix complex) (l1:Z) (l2:Z),
  (forall (e1:a), (mem e1 s) -> is_a_ket_l (f e1) l1) -> (is_a_ket_l m l2) ->
  (0%Z <= l1)%Z ->
  is_a_ket_l (ket_sum_l s (fun (k:a) => (kronecker (f k) m)) (l1 + l2)%Z)
  (l1 + l2)%Z.

Axiom kronecker_ket_sum_distr_l_1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (m:matrix complex) (l1:Z) (l2:Z),
  (forall (e1:a), (mem e1 s) -> is_a_ket_l (f e1) l1) -> (is_a_ket_l m l2) ->
  (0%Z <= l1)%Z ->
  ((kronecker (ket_sum_l s f l1) m) =
   (ket_sum_l s (fun (k:a) => (kronecker (f k) m)) (l1 + l2)%Z)).

Axiom kronecker_ket_sum_distr_l_nol_ :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (m:matrix complex) (l1:Z),
  (forall (e1:a), (mem e1 s) -> is_a_ket_l (f e1) l1) -> (is_a_ket m) ->
  (0%Z <= l1)%Z ->
  is_a_ket_l
  (ket_sum_l s (fun (k:a) => (kronecker (f k) m)) (l1 + (ket_length m))%Z)
  (l1 + (ket_length m))%Z.

Axiom kronecker_ket_sum_distr_l_nol_1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (m:matrix complex) (l1:Z),
  (forall (e1:a), (mem e1 s) -> is_a_ket_l (f e1) l1) -> (is_a_ket m) ->
  (0%Z <= l1)%Z ->
  ((kronecker (ket_sum_l s f l1) m) =
   (ket_sum_l s (fun (k:a) => (kronecker (f k) m)) (l1 + (ket_length m))%Z)).

Axiom kronecker_ket_sum_distr_l_rew_ :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (m:matrix complex) (l1:Z),
  (forall (e1:a), (mem e1 s) -> is_a_ket_l (f e1) l1) -> (is_a_ket m) ->
  (0%Z <= l1)%Z ->
  ((kronecker (ket_sum_l s f l1) m) =
   (ket_sum_l s (fun (k:a) => (kronecker (f k) m)) (l1 + (ket_length m))%Z)).

Axiom kronecker_ket_sum_distr_r_ :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (m:matrix complex) (l1:Z) (l2:Z),
  (forall (e1:a), (mem e1 s) -> is_a_ket_l (f e1) l1) -> (is_a_ket_l m l2) ->
  (0%Z <= l1)%Z ->
  is_a_ket_l (ket_sum_l s (fun (k:a) => (kronecker m (f k))) (l1 + l2)%Z)
  (l1 + l2)%Z.

Axiom kronecker_ket_sum_distr_r_1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (m:matrix complex) (l1:Z) (l2:Z),
  (forall (e1:a), (mem e1 s) -> is_a_ket_l (f e1) l1) -> (is_a_ket_l m l2) ->
  (0%Z <= l1)%Z ->
  ((kronecker m (ket_sum_l s f l1)) =
   (ket_sum_l s (fun (k:a) => (kronecker m (f k))) (l1 + l2)%Z)).

Axiom kronecker_ket_sum_distr_l_rev_ :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (m:matrix complex) (l1:Z) (l2:Z),
  (forall (e1:a), (mem e1 s) -> is_a_ket_l (f e1) l1) -> (is_a_ket_l m l2) ->
  (0%Z <= l1)%Z ->
  is_a_ket_l (ket_sum_l s (fun (k:a) => (kronecker (f k) m)) (l1 + l2)%Z)
  (l1 + l2)%Z.

Axiom kronecker_ket_sum_distr_l_rev_1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (m:matrix complex) (l1:Z) (l2:Z),
  (forall (e1:a), (mem e1 s) -> is_a_ket_l (f e1) l1) -> (is_a_ket_l m l2) ->
  (0%Z <= l1)%Z ->
  ((ket_sum_l s (fun (k:a) => (kronecker (f k) m)) (l1 + l2)%Z) =
   (kronecker (ket_sum_l s f l1) m)).

Axiom kronecker_ket_sum_distr_r_rev_ :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (m:matrix complex) (l1:Z) (l2:Z),
  (forall (e1:a), (mem e1 s) -> is_a_ket_l (f e1) l1) -> (is_a_ket_l m l2) ->
  (0%Z <= l1)%Z ->
  is_a_ket_l (ket_sum_l s (fun (k:a) => (kronecker m (f k))) (l1 + l2)%Z)
  (l1 + l2)%Z.

Axiom kronecker_ket_sum_distr_r_rev_1 :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (m:matrix complex) (l1:Z) (l2:Z),
  (forall (e1:a), (mem e1 s) -> is_a_ket_l (f e1) l1) -> (is_a_ket_l m l2) ->
  (0%Z <= l1)%Z ->
  ((ket_sum_l s (fun (k:a) => (kronecker m (f k))) (l1 + l2)%Z) =
   (kronecker m (ket_sum_l s f l1))).

Axiom kronecker_ket_sum_distr_r_rew :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (m:matrix complex) (l1:Z),
  (forall (e1:a), (mem e1 s) -> is_a_ket_l (f e1) l1) -> (is_a_ket m) ->
  ((cardinal s) > 0%Z)%Z ->
  ((kronecker m (ket_sum_l s f l1)) =
   (ket_sum_l s (fun (k:a) => (kronecker m (f k))) (l1 + (ket_length m))%Z)).

Axiom ket_sum_scalar :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (a1:complex) (l:Z),
  (forall (e1:a), (mem e1 s) -> is_a_ket_l (f e1) l) ->
  ((cardinal s) > 0%Z)%Z ->
  ((ket_sum_l s (fun (k:a) => (infix_asdtdt a1 (f k))) l) =
   (infix_asdtdt a1 (ket_sum_l s f l))).

Axiom kronecker_ket_sum_distr_sc :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> matrix complex) (m:matrix complex) (a1:complex)
    (l1:Z) (l2:Z),
  (forall (e1:a), (mem e1 s) -> is_a_ket_l (f e1) l1) -> (is_a_ket_l m l2) ->
  ((cardinal s) > 0%Z)%Z ->
  ((ket_sum_l s (fun (k:a) => (kronecker (infix_asdtdt a1 (f k)) m))
    (l1 + l2)%Z)
   =
   (infix_asdtdt a1
    (ket_sum_l s (fun (k:a) => (kronecker (f k) m)) (l1 + l2)%Z))).

Axiom kronecker_decomp_r :
  forall (m:matrix complex) (n:matrix complex) (lm:Z) (ln:Z),
  (is_a_ket_l m lm) -> (is_a_ket_l n ln) ->
  ((kronecker m n) =
   (ket_sum_l (n_bvs ln)
    (fun (x:bitvec) =>
     (infix_asdtdt (get_ket n (bv_to_int x)) (kronecker m (bv_to_ket x))))
    (lm + ln)%Z)).

Axiom kronecker_decomp_l :
  forall (m:matrix complex) (n:matrix complex) (lm:Z) (ln:Z),
  (is_a_ket_l m lm) -> (is_a_ket_l n ln) ->
  ((kronecker m n) =
   (ket_sum_l (n_bvs lm)
    (fun (x:bitvec) =>
     (infix_asdtdt (get_ket m (bv_to_int x)) (kronecker (bv_to_ket x) n)))
    (lm + ln)%Z)).

Axiom kronecker_ket_sum_distr_double :
  forall (i:Z) (j:Z) (f:bitvec -> matrix complex)
    (g:bitvec -> matrix complex) (l1:Z) (l2:Z),
  (0%Z <= i)%Z -> (0%Z <= j)%Z ->
  (forall (bv:bitvec), (mem bv (n_bvs i)) -> is_a_ket_l (f bv) l1) ->
  (forall (bv:bitvec), (mem bv (n_bvs j)) -> is_a_ket_l (g bv) l2) ->
  ((kronecker (ket_sum_l (n_bvs i) f l1) (ket_sum_l (n_bvs j) g l2)) =
   (ket_sum_l (n_bvs (i + j)%Z)
    (fun (k:bitvec) => (kronecker (f (hpart k i)) (g (tpart k i))))
    (l1 + l2)%Z)).

Axiom kronecker_add_null :
  forall (m:matrix complex) (m1:matrix complex) (m2:matrix complex)
    (x:matrix complex) (x':matrix complex) (l1:Z) (l2:Z),
  (is_a_ket_l m l1) -> (is_a_ket_l m1 l1) -> (is_a_ket_l m2 l1) ->
  (is_a_ket_l x l2) -> (is_a_ket_l x' l2) -> (is_a_ket_basis_elt x) ->
  (is_a_ket_basis_elt x') -> ~ ((ket_to_int x) = (ket_to_int x')) ->
  ((kronecker m x) =
   (add_ket_l (kronecker m1 x) (kronecker m2 x') (l1 + l2)%Z)) ->
  null_mat (kronecker m2 x').

Axiom kronecker_add_null1 :
  forall (m:matrix complex) (m1:matrix complex) (m2:matrix complex)
    (x:matrix complex) (x':matrix complex) (l1:Z) (l2:Z),
  (is_a_ket_l m l1) -> (is_a_ket_l m1 l1) -> (is_a_ket_l m2 l1) ->
  (is_a_ket_l x l2) -> (is_a_ket_l x' l2) -> (is_a_ket_basis_elt x) ->
  (is_a_ket_basis_elt x') -> ~ ((ket_to_int x) = (ket_to_int x')) ->
  ((kronecker m x) =
   (add_ket_l (kronecker m1 x) (kronecker m2 x') (l1 + l2)%Z)) ->
  null_mat m2.

Axiom kronecker_add_null2 :
  forall (m:matrix complex) (m1:matrix complex) (m2:matrix complex)
    (x:matrix complex) (x':matrix complex) (l1:Z) (l2:Z),
  (is_a_ket_l m l1) -> (is_a_ket_l m1 l1) -> (is_a_ket_l m2 l1) ->
  (is_a_ket_l x l2) -> (is_a_ket_l x' l2) -> (is_a_ket_basis_elt x) ->
  (is_a_ket_basis_elt x') -> ~ ((ket_to_int x) = (ket_to_int x')) ->
  ((kronecker m x) =
   (add_ket_l (kronecker m1 x) (kronecker m2 x') (l1 + l2)%Z)) ->
  forall (x'1:matrix complex), null_mat (kronecker m2 x'1).

Axiom kronecker_injec_eq_left :
  forall (m:matrix complex) (m':matrix complex) (o:matrix complex),
  ((kronecker m o) = (kronecker m' o)) -> ~ (null_mat o) -> (m = m').

Parameter pps_apply_equiv: pps -> pps -> Prop.

Axiom pps_apply_equiv_def :
  forall (h1:pps) (h2:pps), (pps_apply_equiv h1 h2) ->
  ((h_width h1) = (h_width h2)).

Axiom pps_apply_equiv_def1 :
  forall (h1:pps) (h2:pps), (pps_apply_equiv h1 h2) ->
  forall (x:matrix complex), (is_a_ket_l x (h_width h1)) ->
  ((pps_apply h1 x) = (pps_apply h2 x)).

Axiom pps_apply_equiv_def2 :
  forall (h1:pps) (h2:pps),
  (((h_width h1) = (h_width h2)) /\
   forall (x:matrix complex), (is_a_ket_l x (h_width h1)) ->
   ((pps_apply h1 x) = (pps_apply h2 x))) ->
  pps_apply_equiv h1 h2.

Axiom set_pps_apply_equiv :
  forall (h1:pps) (h2:pps), ((h_width h1) = (h_width h2)) ->
  (forall (x:bitvec), ((length x) = (h_width h1)) ->
   ((pps_apply_basis h1 x) = (pps_apply_basis h2 x))) ->
  pps_apply_equiv h1 h2.

Axiom set_pps_apply_equiv_sim :
  forall (h1:pps) (h2:pps), ((h_width h1) = (h_width h2)) ->
  ((h_range h1) = (h_range h2)) ->
  (forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h1))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h1))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   ((0%Z <= i)%Z /\ (i < (h_width h1))%Z) ->
   (((((h_basis_ket h1) x) y) i) = ((((h_basis_ket h2) x) y) i))) ->
  (forall (x:Z -> Z) (y:Z -> Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h1))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h1))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   ((((h_angle h1) x) y) = (((h_angle h2) x) y))) ->
  pps_apply_equiv h1 h2.

Axiom get_pps_apply_equiv :
  forall (h1:pps) (h2:pps) (x:matrix complex),
  ((h_width h1) = (h_width h2)) -> (pps_apply_equiv h1 h2) ->
  (is_a_ket_l x (h_width h1)) -> ((pps_apply h1 x) = (pps_apply h2 x)).

Axiom get_pps_apply_basis_equiv :
  forall (h1:pps) (h2:pps) (x:bitvec), ((h_width h1) = (h_width h2)) ->
  (pps_apply_equiv h1 h2) -> ((length x) = (h_width h1)) ->
  ((pps_apply_basis h1 x) = (pps_apply_basis h2 x)).

Axiom reflexive_pps_apply_equiv : forall (h:pps), pps_apply_equiv h h.

Axiom commut_pps_apply_equiv :
  forall (h:pps) (h':pps), (pps_apply_equiv h h') -> pps_apply_equiv h' h.

Axiom transitive_pps_apply_equiv :
  forall (h:pps) (h':pps) (h'':pps), (pps_apply_equiv h h') ->
  (pps_apply_equiv h' h'') -> pps_apply_equiv h h''.

Axiom pps_apply_basis_seq :
  forall (h1:pps) (h2:pps) (x:bitvec), ((length x) = (h_width h1)) ->
  ((h_width h1) = (h_width h2)) ->
  ((pps_apply_basis (pps_seq h1 h2) x) =
   (pps_apply h2 (pps_apply_basis h1 x))).

Axiom pps_apply_seq :
  forall (h1:pps) (h2:pps) (x:matrix complex),
  ((h_width h1) = (h_width h2)) -> (is_a_ket_l x (h_width h1)) ->
  ((pps_apply (pps_seq h1 h2) x) = (pps_apply h2 (pps_apply h1 x))).

Axiom pps_seq_pred :
  forall (h1:pps) (h2:pps) (h3:pps),
  (((h_width h1) = (h_width h2)) /\ ((h_width h2) = (h_width h3))) ->
  ((h_range h3) = ((h_range h1) + (h_range h2))%Z) ->
  (forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h3))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h3))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   ((0%Z <= i)%Z /\ (i < (h_width h3))%Z) ->
   (((((h_basis_ket h3) x) y) i) =
    ((((h_basis_ket h2) (((h_basis_ket h1) x) y))
      fun (k:Z) => (y (k + (h_range h1))%Z))
     i))) ->
  (forall (x:Z -> Z) (y:Z -> Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h3))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h3))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   ((((h_angle h3) x) y) =
    (ang_add (((h_angle h1) x) y)
     (((h_angle h2) (((h_basis_ket h1) x) y))
      fun (k:Z) => (y (k + (h_range h1))%Z))))) ->
  forall (x:matrix complex), (is_a_ket_l x (h_width h3)) ->
  ((pps_apply h3 x) = (pps_apply h2 (pps_apply h1 x))).

Axiom pps_apply_basis_par :
  forall (h1:pps) (h2:pps) (x:bitvec),
  ((length x) = ((h_width h1) + (h_width h2))%Z) ->
  ((pps_apply_basis (pps_par h1 h2) x) =
   (kronecker (pps_apply_basis h1 (hpart x (h_width h1)))
    (pps_apply_basis h2 (tpart x (h_width h1))))).

Axiom pps_apply_par :
  forall (h1:pps) (h2:pps) (x:matrix complex) (y:matrix complex),
  (is_a_ket_l x (h_width h1)) -> (is_a_ket_l y (h_width h2)) ->
  ((pps_apply (pps_par h1 h2) (kronecker x y)) =
   (kronecker (pps_apply h1 x) (pps_apply h2 y))).

Axiom pps_par_pred :
  forall (h1:pps) (h2:pps) (h3:pps),
  ((h_width h3) = ((h_width h1) + (h_width h2))%Z) ->
  ((h_range h3) = ((h_range h1) + (h_range h2))%Z) ->
  (forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h3))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h3))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   ((0%Z <= i)%Z /\ (i < (h_width h3))%Z) ->
   ((i < (h_width h1))%Z /\
    (((((h_basis_ket h3) x) y) i) = ((((h_basis_ket h1) x) y) i))) \/
   (~ (i < (h_width h1))%Z /\
    (((((h_basis_ket h3) x) y) i) =
     ((((h_basis_ket h2) fun (k:Z) => (x (k + (h_width h1))%Z))
       fun (k:Z) => (y (k + (h_range h1))%Z))
      (i - (h_width h1))%Z)))) ->
  (forall (x:Z -> Z) (y:Z -> Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h3))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h3))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   ((((h_angle h3) x) y) =
    (ang_add (((h_angle h1) x) y)
     (((h_angle h2) fun (k:Z) => (x (k + (h_width h1))%Z))
      fun (k:Z) => (y (k + (h_range h1))%Z))))) ->
  forall (x:matrix complex) (y:matrix complex),
  (is_a_ket_l x (h_width h1)) -> (is_a_ket_l y (h_width h2)) ->
  ((pps_apply h3 (kronecker x y)) =
   (kronecker (pps_apply h1 x) (pps_apply h2 y))).

Axiom pps_apply_basis_anc :
  forall (h:pps) (x:bitvec) (y:matrix complex), (1%Z <= (h_width h))%Z ->
  ((length x) = (h_width h)) -> (((getbv x) ((h_width h) - 1%Z)%Z) = 0%Z) ->
  ((pps_apply_basis h x) = (kronecker y (ket 1%Z 0%Z))) ->
  (is_a_ket_l y ((h_width h) - 1%Z)%Z) ->
  ((pps_apply_basis (pps_anc h) (hpart x ((h_width h) - 1%Z)%Z)) = y).

Axiom pps_apply_basis_anc_ :
  forall (h:pps) (x:bitvec) (y:matrix complex), (1%Z <= (h_width h))%Z ->
  ((length x) = ((h_width h) - 1%Z)%Z) ->
  ((pps_apply_basis h (concat x (make_bv (fun (us:Z) => 0%Z) 1%Z))) =
   (kronecker y (ket 1%Z 0%Z))) ->
  (is_a_ket_l y ((h_width h) - 1%Z)%Z) ->
  ((pps_apply_basis (pps_anc h) x) = y).

Axiom pps_apply_anc :
  forall (h:pps) (path_sem_target:(matrix complex) -> matrix complex)
    (x:matrix complex),
  (1%Z <= (h_width h))%Z -> (is_a_ket_l x ((h_width h) - 1%Z)%Z) ->
  (forall (x1:matrix complex), (is_a_ket_l x1 ((h_width h) - 1%Z)%Z) ->
   ((pps_apply h (kronecker x1 (ket 1%Z 0%Z))) =
    (kronecker (path_sem_target x1) (ket 1%Z 0%Z)))) ->
  (is_a_ket_l x ((h_width h) - 1%Z)%Z) ->
  ((pps_apply (pps_anc h) x) = (path_sem_target x)).

Parameter pps_anc_gen: pps -> Z -> pps.

Axiom pps_anc_gen_def :
  forall (h:pps) (k:Z), (1%Z <= (h_width h))%Z -> (k = 1%Z) ->
  ((pps_anc_gen h k) = (pps_anc h)).

Axiom pps_anc_gen_def1 :
  forall (h:pps) (k:Z), (1%Z <= (h_width h))%Z -> ~ (k = 1%Z) ->
  ((pps_anc_gen h k) = (pps_anc (pps_anc_gen h (k - 1%Z)%Z))).

Axiom pps_apply_equiv_seq :
  forall (h1:pps) (h1':pps) (h2:pps) (h2':pps), (pps_apply_equiv h1 h1') ->
  (pps_apply_equiv h2 h2') -> ((h_width h1) = (h_width h2)) ->
  pps_apply_equiv (pps_seq h1 h2) (pps_seq h1' h2').

Axiom pps_apply_equiv_par :
  forall (h1:pps) (h1':pps) (h2:pps) (h2':pps), (pps_apply_equiv h1 h1') ->
  (pps_apply_equiv h2 h2') ->
  pps_apply_equiv (pps_par h1 h2) (pps_par h1' h2').

Axiom pps_apply_equiv_anc :
  forall (h:pps) (h':pps), (1%Z <= (h_width h))%Z ->
  (pps_apply_equiv h h') ->
  (exists path_sem_target:bitvec -> matrix complex,
   forall (y:bitvec), ((length y) = ((h_width h) - 1%Z)%Z) ->
   ((pps_apply_basis h (concat y (make_bv (fun (us:Z) => 0%Z) 1%Z))) =
    (kronecker (path_sem_target y) (ket 1%Z 0%Z)))) ->
  pps_apply_equiv (pps_anc h) (pps_anc h').

Parameter fc15: pps -> (Z -> Z) -> Z -> Z.

Parameter fc16: pps -> (Z -> Z) -> Z -> Z.

Axiom fc_def15 :
  forall (h1:pps) (x:Z -> Z) (k:Z),
  ((k = ((h_width h1) - 1%Z)%Z) -> (((fc15 h1 x) k) = 0%Z)) /\
  (~ (k = ((h_width h1) - 1%Z)%Z) -> (((fc15 h1 x) k) = (x k))).

Axiom fc_def16 :
  forall (h1:pps) (x:Z -> Z) (k:Z),
  ((k = ((h_width h1) - 1%Z)%Z) -> (((fc16 h1 x) k) = 0%Z)) /\
  (~ (k = ((h_width h1) - 1%Z)%Z) -> (((fc16 h1 x) k) = (x k))).

Axiom pps_anc_pred :
  forall (h1:pps) (h2:pps) (path_sem_target:bitvec -> matrix complex),
  (1%Z <= (h_width h1))%Z ->
  (forall (y:bitvec), ((length y) = ((h_width h1) - 1%Z)%Z) ->
   ((pps_apply_basis h1 (concat y (make_bv (fun (us:Z) => 0%Z) 1%Z))) =
    (kronecker (path_sem_target y) (ket 1%Z 0%Z)))) ->
  ((h_width h2) = ((h_width h1) - 1%Z)%Z) -> ((h_range h2) = (h_range h1)) ->
  (forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h2))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h2))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   ((0%Z <= i)%Z /\ (i < (h_width h2))%Z) ->
   (((((h_basis_ket h2) x) y) i) = ((((h_basis_ket h1) (fc15 h1 x)) y) i))) ->
  (forall (x:Z -> Z) (y:Z -> Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h2))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h2))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   ((((h_angle h2) x) y) = (((h_angle h1) (fc16 h1 x)) y))) ->
  forall (x:bitvec), ((length x) = (h_width h2)) ->
  ((pps_apply_basis h2 x) = (path_sem_target x)).

Parameter fc17: pps -> (Z -> Z) -> Z -> Z.

Parameter fc18: pps -> (Z -> Z) -> Z -> Z.

Axiom fc_def17 :
  forall (h1:pps) (x:Z -> Z) (k:Z),
  ((k = ((h_width h1) - 1%Z)%Z) -> (((fc17 h1 x) k) = 0%Z)) /\
  (~ (k = ((h_width h1) - 1%Z)%Z) -> (((fc17 h1 x) k) = (x k))).

Axiom fc_def18 :
  forall (h1:pps) (x:Z -> Z) (k:Z),
  ((k = ((h_width h1) - 1%Z)%Z) -> (((fc18 h1 x) k) = 0%Z)) /\
  (~ (k = ((h_width h1) - 1%Z)%Z) -> (((fc18 h1 x) k) = (x k))).

Axiom pps_anc_pred_ :
  forall (h1:pps) (h2:pps), (1%Z <= (h_width h1))%Z ->
  (exists path_sem_target:bitvec -> matrix complex,
   forall (y:bitvec), ((length y) = ((h_width h1) - 1%Z)%Z) ->
   ((pps_apply_basis h1 (concat y (make_bv (fun (us:Z) => 0%Z) 1%Z))) =
    (kronecker (path_sem_target y) (ket 1%Z 0%Z)))) ->
  ((h_width h2) = ((h_width h1) - 1%Z)%Z) -> ((h_range h2) = (h_range h1)) ->
  (forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h2))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h2))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   ((0%Z <= i)%Z /\ (i < (h_width h2))%Z) ->
   (((((h_basis_ket h2) x) y) i) = ((((h_basis_ket h1) (fc17 h1 x)) y) i))) ->
  (forall (x:Z -> Z) (y:Z -> Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h2))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h2))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   ((((h_angle h2) x) y) = (((h_angle h1) (fc18 h1 x)) y))) ->
  forall (x:bitvec), ((length x) = (h_width h2)) ->
  ((pps_apply_basis h1 (concat x (make_bv (fun (us:Z) => 0%Z) 1%Z))) =
   (kronecker (pps_apply_basis h2 x) (ket 1%Z 0%Z))).

Parameter pps_to_mat: pps -> matrix complex.

Parameter result20: pps -> bitvec -> bitvec -> Z -> Z -> complex.

Parameter result21: pps -> bitvec -> bitvec -> matrix complex.

Axiom result_def20 :
  forall (h:pps) (x:bitvec) (y:bitvec) (i:Z) (j:Z),
  (((i = (bv_to_int (h_basis_ket_bv h x y))) /\ (j = (bv_to_int x))) ->
   ((((result20 h x y) i) j) = (ang_exp (h_angle_bv h x y)))) /\
  (~ ((i = (bv_to_int (h_basis_ket_bv h x y))) /\ (j = (bv_to_int x))) ->
   ((((result20 h x y) i) j) = c_zero)).

Axiom result_def21 :
  forall (h:pps) (x:bitvec) (y:bitvec),
  ((((length x) = (h_width h)) /\ ((length y) = (h_range h))) ->
   (((result21 h x) y) =
    (make_f (power_ 2%Z (h_width h)) (power_ 2%Z (h_width h))
     (result20 h x y)))) /\
  (~ (((length x) = (h_width h)) /\ ((length y) = (h_range h))) ->
   (((result21 h x) y) =
    (make_f (power_ 2%Z (h_width h)) (power_ 2%Z (h_width h))
     (fun (i:Z) (j:Z) => c_zero)))).

Axiom pps_to_mat_def :
  forall (h:pps),
  ((pps_to_mat h) =
   (infix_asdtdt (pow_inv_sqrt_2 (h_range h))
    (mat_sum_dim (n_bvs (h_width h))
     (fun (x:bitvec) =>
      (mat_sum_dim (n_bvs (h_range h)) (result21 h x)
       (power_ 2%Z (h_width h)) (power_ 2%Z (h_width h))))
     (power_ 2%Z (h_width h)) (power_ 2%Z (h_width h))))).

Parameter fc19: pps -> bitvec -> bitvec -> Z -> Z -> complex.

Axiom fc_def19 :
  forall (h:pps) (x:bitvec) (y:bitvec) (i:Z) (j:Z),
  (((i = (bv_to_int (h_basis_ket_bv h x y))) /\ (j = (bv_to_int x))) ->
   ((((fc19 h x y) i) j) = (ang_exp (h_angle_bv h x y)))) /\
  (~ ((i = (bv_to_int (h_basis_ket_bv h x y))) /\ (j = (bv_to_int x))) ->
   ((((fc19 h x y) i) j) = c_zero)).

Axiom pps_to_mat_spec :
  forall (h:pps),
  ((pps_to_mat h) =
   (infix_asdtdt (pow_inv_sqrt_2 (h_range h))
    (mat_sum_dim (n_bvs (h_width h))
     (fun (x:bitvec) =>
      (mat_sum_dim (n_bvs (h_range h))
       (fun (y:bitvec) =>
        (make_f (power_ 2%Z (h_width h)) (power_ 2%Z (h_width h))
         (fc19 h x y)))
       (power_ 2%Z (h_width h)) (power_ 2%Z (h_width h))))
     (power_ 2%Z (h_width h)) (power_ 2%Z (h_width h))))).

Parameter fc20: pps -> bitvec -> bitvec -> Z -> Z -> complex.

Axiom fc_def20 :
  forall (h:pps) (x:bitvec) (y:bitvec) (i:Z) (j:Z),
  (((i = (bv_to_int (h_basis_ket_bv h x y))) /\ (j = (bv_to_int x))) ->
   ((((fc20 h x y) i) j) = (ang_exp (h_angle_bv h x y)))) /\
  (~ ((i = (bv_to_int (h_basis_ket_bv h x y))) /\ (j = (bv_to_int x))) ->
   ((((fc20 h x y) i) j) = c_zero)).

Axiom pps_to_mat_spec1 :
  forall (h:pps),
  ((pps_to_mat h) =
   (infix_asdtdt (pow_inv_sqrt_2 (h_range h))
    (mat_sum (n_bvs (h_width h))
     (fun (x:bitvec) =>
      (mat_sum (n_bvs (h_range h))
       (fun (y:bitvec) =>
        (make_f (power_ 2%Z (h_width h)) (power_ 2%Z (h_width h))
         (fc20 h x y)))))))).

Axiom pps_to_mat_spec2 :
  forall (h:pps), ((rows (pps_to_mat h)) = (power_ 2%Z (h_width h))).

Axiom pps_to_mat_spec3 :
  forall (h:pps), ((columns (pps_to_mat h)) = (power_ 2%Z (h_width h))).

Axiom pps_to_mat_spec4 :
  forall (h:pps), forall (x:bitvec), ((length x) = (h_width h)) ->
  ((mat_mult (pps_to_mat h) (bv_to_ket x)) = (pps_apply_basis h x)).

Axiom pps_to_mat_spec5 :
  forall (h:pps), forall (x:matrix complex), (is_a_ket_l x (h_width h)) ->
  ((mat_mult (pps_to_mat h) x) = (pps_apply h x)).

Parameter min_set: (set Z) -> Z.

Axiom min_set_def :
  forall (s:set Z), ((cardinal s) > 0%Z)%Z -> ((cardinal s) = 1%Z) ->
  ((min_set s) = (choose s)).

Axiom min_set_def1 :
  forall (s:set Z), ((cardinal s) > 0%Z)%Z -> ~ ((cardinal s) = 1%Z) ->
  ((min_set s) =
   (ZArith.BinInt.Z.min (choose s) (min_set (remove (choose s) s)))).

Axiom min_set_spec :
  forall (s:set Z), ((cardinal s) > 0%Z)%Z -> mem (min_set s) s.

Axiom min_set_spec1 :
  forall (s:set Z), ((cardinal s) > 0%Z)%Z -> forall (e1:Z), (mem e1 s) ->
  (e1 >= (min_set s))%Z.

Parameter max_set: (set Z) -> Z.

Axiom max_set_def :
  forall (s:set Z), ((cardinal s) > 0%Z)%Z -> ((cardinal s) = 1%Z) ->
  ((max_set s) = (choose s)).

Axiom max_set_def1 :
  forall (s:set Z), ((cardinal s) > 0%Z)%Z -> ~ ((cardinal s) = 1%Z) ->
  ((max_set s) =
   (ZArith.BinInt.Z.max (choose s) (max_set (remove (choose s) s)))).

Axiom max_set_spec :
  forall (s:set Z), ((cardinal s) > 0%Z)%Z -> mem (max_set s) s.

Axiom max_set_spec1 :
  forall (s:set Z), ((cardinal s) > 0%Z)%Z -> forall (e1:Z), (mem e1 s) ->
  (e1 <= (max_set s))%Z.

Parameter max3: Z -> Z -> Z -> Z.

Axiom max3_def :
  forall (a:Z) (b:Z) (c:Z),
  ((max3 a b c) = (ZArith.BinInt.Z.max (ZArith.BinInt.Z.max a b) c)).

Axiom max3_spec :
  forall (a:Z) (b:Z) (c:Z),
  ((max3 a b c) = (ZArith.BinInt.Z.max a (ZArith.BinInt.Z.max b c))).

Parameter min_filter: (set Z) -> (Z -> bool) -> Z.

Axiom min_filter_def :
  forall (s:set Z) (p:Z -> bool),
  (exists e1:Z, (mem e1 s) /\ ((p e1) = true)) -> ((p (min_set s)) = true) ->
  ((min_filter s p) = (min_set s)).

Axiom min_filter_def1 :
  forall (s:set Z) (p:Z -> bool),
  (exists e1:Z, (mem e1 s) /\ ((p e1) = true)) ->
  ~ ((p (min_set s)) = true) ->
  ((min_filter s p) = (min_filter (remove (min_set s) s) p)).

Axiom min_filter_spec :
  forall (s:set Z) (p:Z -> bool),
  (exists e1:Z, (mem e1 s) /\ ((p e1) = true)) ->
  ((p (min_filter s p)) = true).

Axiom min_filter_spec1 :
  forall (s:set Z) (p:Z -> bool),
  (exists e1:Z, (mem e1 s) /\ ((p e1) = true)) -> mem (min_filter s p) s.

Axiom min_filter_spec2 :
  forall (s:set Z) (p:Z -> bool),
  (exists e1:Z, (mem e1 s) /\ ((p e1) = true)) -> forall (e1:Z),
  (mem e1 s) -> ((p e1) = true) -> ((min_filter s p) <= e1)%Z.

Axiom min_filter_spec3 :
  forall (s:set Z) (p:Z -> bool),
  (exists e1:Z, (mem e1 s) /\ ((p e1) = true)) -> forall (e1:Z),
  (mem e1 s) -> (e1 < (min_filter s p))%Z -> ~ ((p e1) = true).

Parameter max_filter: (set Z) -> (Z -> bool) -> Z.

Axiom max_filter_def :
  forall (s:set Z) (p:Z -> bool),
  (exists e1:Z, (mem e1 s) /\ ((p e1) = true)) -> ((p (max_set s)) = true) ->
  ((max_filter s p) = (max_set s)).

Axiom max_filter_def1 :
  forall (s:set Z) (p:Z -> bool),
  (exists e1:Z, (mem e1 s) /\ ((p e1) = true)) ->
  ~ ((p (max_set s)) = true) ->
  ((max_filter s p) = (max_filter (remove (max_set s) s) p)).

Axiom max_filter_spec :
  forall (s:set Z) (p:Z -> bool),
  (exists e1:Z, (mem e1 s) /\ ((p e1) = true)) ->
  ((p (max_filter s p)) = true).

Axiom max_filter_spec1 :
  forall (s:set Z) (p:Z -> bool),
  (exists e1:Z, (mem e1 s) /\ ((p e1) = true)) -> mem (max_filter s p) s.

Axiom max_filter_spec2 :
  forall (s:set Z) (p:Z -> bool),
  (exists e1:Z, (mem e1 s) /\ ((p e1) = true)) -> forall (e1:Z),
  (mem e1 s) -> ((p e1) = true) -> (e1 <= (max_filter s p))%Z.

Axiom max_filter_spec3 :
  forall (s:set Z) (p:Z -> bool),
  (exists e1:Z, (mem e1 s) /\ ((p e1) = true)) -> forall (e1:Z),
  (mem e1 s) -> ((max_filter s p) < e1)%Z -> ~ ((p e1) = true).

Axiom appr_pre :
  forall (theta:complex) (n:Z), (0%Z < n)%Z -> (real_ theta) ->
  ((infix_lsdt c_zero theta) /\ (infix_lseqdt theta c_one)) ->
  exists k:Z,
  (mem k (to_fset 0%Z (n + 1%Z)%Z)) /\
  (infix_lseqdt
   (modulus (infix_mndt theta (infix_sldt (i_to_c k) (i_to_c n))))
   (infix_sldt c_one (i_to_c (n * 2%Z)%Z))).

Axiom appr :
  forall (theta:complex) (n:Z), (0%Z < n)%Z -> (real_ theta) ->
  ((infix_lsdt c_zero theta) /\ (infix_lseqdt theta c_one)) ->
  exists k:Z,
  (mem k (to_fset 0%Z (n + 1%Z)%Z)) /\
  (infix_lseqdt
   (modulus (infix_mndt theta (infix_sldt (i_to_c k) (i_to_c n))))
   (infix_sldt c_one (i_to_c (n * 2%Z)%Z))).

Axiom circuit : Type.
Parameter circuit_WhyType : WhyType circuit.
Existing Instance circuit_WhyType.

Parameter circ_to_pps: circuit -> pps.

Axiom circ_to_pps_spec :
  forall (c:circuit), (1%Z <= (h_width (circ_to_pps c)))%Z.

Parameter width: circuit -> Z.

Axiom width_spec : forall (c:circuit), (1%Z <= (width c))%Z.

Axiom width_spec1 :
  forall (c:circuit), ((width c) = (h_width (circ_to_pps c))).

Parameter size: circuit -> Z.

Axiom size_spec : forall (c:circuit), (0%Z <= (size c))%Z.

Parameter ancillas: circuit -> Z.

Axiom ancillas_spec : forall (c:circuit), (0%Z <= (ancillas c))%Z.

Parameter range: circuit -> Z.

Axiom range_spec : forall (c:circuit), (0%Z <= (range c))%Z.

Axiom range_spec1 :
  forall (c:circuit), ((range c) = (h_range (circ_to_pps c))).

Parameter basis_ket: circuit -> (Z -> Z) -> (Z -> Z) -> Z -> Z.

Axiom basis_ket_spec :
  forall (c:circuit) (x:Z -> Z) (y:Z -> Z) (i:Z),
  ((basis_ket c x y i) = ((((h_basis_ket (circ_to_pps c)) x) y) i)).

Axiom basis_ket_spec1 :
  forall (c:circuit) (x:Z -> Z) (y:Z -> Z) (i:Z),
  (forall (i1:Z), ((0%Z <= i1)%Z /\ (i1 < (width c))%Z) ->
   (0%Z <= (x i1))%Z /\ ((x i1) < 2%Z)%Z) ->
  (forall (i1:Z), ((0%Z <= i1)%Z /\ (i1 < (range c))%Z) ->
   (0%Z <= (y i1))%Z /\ ((y i1) < 2%Z)%Z) ->
  ((0%Z <= i)%Z /\ (i < (width c))%Z) -> (0%Z <= (basis_ket c x y i))%Z.

Axiom basis_ket_spec2 :
  forall (c:circuit) (x:Z -> Z) (y:Z -> Z) (i:Z),
  (forall (i1:Z), ((0%Z <= i1)%Z /\ (i1 < (width c))%Z) ->
   (0%Z <= (x i1))%Z /\ ((x i1) < 2%Z)%Z) ->
  (forall (i1:Z), ((0%Z <= i1)%Z /\ (i1 < (range c))%Z) ->
   (0%Z <= (y i1))%Z /\ ((y i1) < 2%Z)%Z) ->
  ((0%Z <= i)%Z /\ (i < (width c))%Z) -> ((basis_ket c x y i) < 2%Z)%Z.

Parameter ang_ind: circuit -> (Z -> Z) -> (Z -> Z) -> angle.

Axiom ang_ind_spec :
  forall (c:circuit) (x:Z -> Z) (y:Z -> Z),
  ((ang_ind c x y) = (((h_angle (circ_to_pps c)) x) y)).

Axiom circ_to_pps_width :
  forall (c:circuit), ((h_width (circ_to_pps c)) = (width c)).

Axiom circ_to_pps_range :
  forall (c:circuit), ((h_range (circ_to_pps c)) = (range c)).

Axiom circ_to_pps_basis_ket :
  forall (c:circuit) (x:Z -> Z) (y:Z -> Z) (i:Z),
  (((((h_basis_ket (circ_to_pps c)) x) y) i) = (basis_ket c x y i)).

Axiom circ_to_pps_basis_ket_gen :
  forall (c:circuit) (x:Z -> Z) (y:Z -> Z),
  ((((h_basis_ket (circ_to_pps c)) x) y) =
   ((((fun (y0:circuit) (y1:Z -> Z) (y2:Z -> Z) (y3:Z) =>
       (basis_ket y0 y1 y2 y3))
      c)
     x)
    y)).

Axiom circ_to_pps_angle :
  forall (c:circuit) (x:Z -> Z) (y:Z -> Z),
  ((((h_angle (circ_to_pps c)) x) y) = (ang_ind c x y)).

Parameter path_sem_basis: circuit -> (matrix complex) -> matrix complex.

Axiom path_sem_basis_spec :
  forall (c:circuit) (x:matrix complex), (is_a_ket_l x (width c)) ->
  (is_a_ket_basis_elt x) -> is_a_ket_l (path_sem_basis c x) (width c).

Axiom path_sem_basis_spec1 :
  forall (c:circuit) (x:matrix complex), (is_a_ket_l x (width c)) ->
  (is_a_ket_basis_elt x) ->
  ((path_sem_basis c x) = (pps_apply_basis (circ_to_pps c) (ket_to_bv x))).

Parameter path_sem: circuit -> (matrix complex) -> matrix complex.

Axiom path_sem_spec :
  forall (c:circuit) (x:matrix complex), (is_a_ket_l x (width c)) ->
  is_a_ket_l (path_sem c x) (width c).

Axiom path_sem_spec1 :
  forall (c:circuit) (x:matrix complex), (is_a_ket_l x (width c)) ->
  ((path_sem c x) = (pps_apply (circ_to_pps c) x)).

Parameter sem: circuit -> (matrix complex) -> (matrix complex) -> Prop.

Axiom sem_def :
  forall (c:circuit) (x:matrix complex) (y:matrix complex), (sem c x y) ->
  is_a_ket_l x (width c).

Axiom sem_def1 :
  forall (c:circuit) (x:matrix complex) (y:matrix complex), (sem c x y) ->
  infix_eqeq y (path_sem c x).

Axiom sem_def2 :
  forall (c:circuit) (x:matrix complex) (y:matrix complex),
  ((is_a_ket_l x (width c)) /\ (infix_eqeq y (path_sem c x))) -> sem c x y.

Parameter id: circuit.

Axiom id_def : ((circ_to_pps id) = pps_id).

Axiom id_def1 : ((ancillas id) = 0%Z).

Axiom id_def2 : ((size id) = 0%Z).

Axiom id_def3 : ((range id) = 0%Z).

Axiom id_def4 : ((width id) = 1%Z).

Axiom id_def5 :
  forall (x:Z -> Z) (y:Z -> Z), forall (i:Z), ((basis_ket id x y i) = (x i)).

Axiom id_def6 : forall (x:Z -> Z) (y:Z -> Z), ((ang_ind id x y) = ang_zero).

Parameter swap: circuit.

Axiom swap_def : ((circ_to_pps swap) = pps_swap).

Axiom swap_def1 : ((ancillas swap) = 0%Z).

Axiom swap_def2 : ((size swap) = 0%Z).

Axiom swap_def3 : ((range swap) = 0%Z).

Axiom swap_def4 : ((width swap) = 2%Z).

Axiom swap_def5 :
  forall (x:Z -> Z) (y:Z -> Z), ((basis_ket swap x y 0%Z) = (x 1%Z)).

Axiom swap_def6 :
  forall (x:Z -> Z) (y:Z -> Z), ((basis_ket swap x y 1%Z) = (x 0%Z)).

Axiom swap_def7 :
  forall (x:Z -> Z) (y:Z -> Z), ((ang_ind swap x y) = ang_zero).

Parameter phase: Z -> circuit.

Axiom phase_spec : forall (k:Z), ((circ_to_pps (phase k)) = (pps_phase k)).

Axiom phase_spec1 : forall (k:Z), ((ancillas (phase k)) = 0%Z).

Axiom phase_spec2 : forall (k:Z), ((size (phase k)) = 1%Z).

Axiom phase_spec3 : forall (k:Z), ((range (phase k)) = 0%Z).

Axiom phase_spec4 : forall (k:Z), ((width (phase k)) = 1%Z).

Axiom phase_spec5 :
  forall (k:Z), forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
  ((basis_ket (phase k) x y i) = (x i)).

Axiom phase_spec6 :
  forall (k:Z), (0%Z <= k)%Z -> forall (x:Z -> Z) (y:Z -> Z),
  ((ang_ind (phase k) x y) = (int_to_ang 1%Z k)).

Axiom phase_spec7 :
  forall (k:Z), (k < 0%Z)%Z -> forall (x:Z -> Z) (y:Z -> Z),
  ((ang_ind (phase k) x y) = (int_to_ang (-1%Z)%Z (-k)%Z)).

Parameter rz: Z -> circuit.

Axiom rz_spec : forall (k:Z), ((circ_to_pps (rz k)) = (pps_rz k)).

Axiom rz_spec1 : forall (k:Z), ((ancillas (rz k)) = 0%Z).

Axiom rz_spec2 : forall (k:Z), ((size (rz k)) = 1%Z).

Axiom rz_spec3 : forall (k:Z), ((range (rz k)) = 0%Z).

Axiom rz_spec4 : forall (k:Z), ((width (rz k)) = 1%Z).

Axiom rz_spec5 :
  forall (k:Z), forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
  ((basis_ket (rz k) x y i) = (x i)).

Axiom rz_spec6 :
  forall (k:Z), (0%Z <= k)%Z -> forall (x:Z -> Z) (y:Z -> Z),
  (((x 0%Z) = 0%Z) -> ((ang_ind (rz k) x y) = ang_zero)) /\
  (~ ((x 0%Z) = 0%Z) -> ((ang_ind (rz k) x y) = (int_to_ang 1%Z k))).

Axiom rz_spec7 :
  forall (k:Z), (k < 0%Z)%Z -> forall (x:Z -> Z) (y:Z -> Z),
  (((x 0%Z) = 0%Z) -> ((ang_ind (rz k) x y) = ang_zero)) /\
  (~ ((x 0%Z) = 0%Z) ->
   ((ang_ind (rz k) x y) = (int_to_ang (-1%Z)%Z (-k)%Z))).

Parameter hadamard: circuit.

Axiom hadamard_def : ((circ_to_pps hadamard) = pps_hadamard).

Axiom hadamard_def1 : ((ancillas hadamard) = 0%Z).

Axiom hadamard_def2 : ((size hadamard) = 1%Z).

Axiom hadamard_def3 : ((range hadamard) = 1%Z).

Axiom hadamard_def4 : ((width hadamard) = 1%Z).

Axiom hadamard_def5 :
  forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
  ((basis_ket hadamard x y i) = (y i)).

Axiom hadamard_def6 :
  forall (x:Z -> Z) (y:Z -> Z),
  ((((x 0%Z) = (y 0%Z)) /\ ((y 0%Z) = 1%Z)) ->
   ((ang_ind hadamard x y) = ang_minus_one)) /\
  (~ (((x 0%Z) = (y 0%Z)) /\ ((y 0%Z) = 1%Z)) ->
   ((ang_ind hadamard x y) = ang_zero)).

Parameter cnot: circuit.

Axiom cnot_def : ((circ_to_pps cnot) = pps_cnot).

Axiom cnot_def1 : ((ancillas cnot) = 0%Z).

Axiom cnot_def2 : ((size cnot) = 1%Z).

Axiom cnot_def3 : ((range cnot) = 0%Z).

Axiom cnot_def4 : ((width cnot) = 2%Z).

Axiom cnot_def5 :
  forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
  ((i = 0%Z) -> ((basis_ket cnot x y i) = (x i))) /\
  (~ (i = 0%Z) ->
   ((basis_ket cnot x y i) =
    (int.EuclideanDivision.mod1 ((x 0%Z) + (x i))%Z 2%Z))).

Axiom cnot_def6 :
  forall (x:Z -> Z) (y:Z -> Z), ((ang_ind cnot x y) = ang_zero).

Parameter parallel: circuit -> circuit -> circuit.

Axiom parallel_spec :
  forall (d:circuit) (e1:circuit),
  ((circ_to_pps (parallel d e1)) =
   (pps_par (circ_to_pps d) (circ_to_pps e1))).

Axiom parallel_spec1 :
  forall (d:circuit) (e1:circuit),
  ((ancillas (parallel d e1)) = ((ancillas d) + (ancillas e1))%Z).

Axiom parallel_spec2 :
  forall (d:circuit) (e1:circuit),
  ((size (parallel d e1)) = ((size d) + (size e1))%Z).

Axiom parallel_spec3 :
  forall (d:circuit) (e1:circuit),
  ((width (parallel d e1)) = ((width d) + (width e1))%Z).

Axiom parallel_spec4 :
  forall (d:circuit) (e1:circuit),
  ((range (parallel d e1)) = ((range d) + (range e1))%Z).

Axiom parallel_spec5 :
  forall (d:circuit) (e1:circuit), forall (x:Z -> Z) (y:Z -> Z),
  ((ang_ind (parallel d e1) x y) =
   (ang_add (ang_ind d x y)
    (ang_ind e1 (fun (k:Z) => (x (k + (width d))%Z))
     (fun (k:Z) => (y (k + (range d))%Z))))).

Axiom parallel_spec6 :
  forall (d:circuit) (e1:circuit), forall (x:Z -> Z) (y:Z -> Z),
  forall (i:Z),
  ((i < (width d))%Z ->
   ((basis_ket (parallel d e1) x y i) = (basis_ket d x y i))) /\
  (~ (i < (width d))%Z ->
   ((basis_ket (parallel d e1) x y i) =
    (basis_ket e1 (fun (k:Z) => (x (k + (width d))%Z))
     (fun (k:Z) => (y (k + (range d))%Z)) (i - (width d))%Z))).

Parameter sequence: circuit -> circuit -> circuit.

Axiom sequence_spec :
  forall (d:circuit) (e1:circuit), ((width d) = (width e1)) ->
  ((circ_to_pps (sequence d e1)) =
   (pps_seq (circ_to_pps d) (circ_to_pps e1))).

Axiom sequence_spec1 :
  forall (d:circuit) (e1:circuit), ((width d) = (width e1)) ->
  ((ancillas (sequence d e1)) =
   (ZArith.BinInt.Z.max (ancillas d) (ancillas e1))).

Axiom sequence_spec2 :
  forall (d:circuit) (e1:circuit), ((width d) = (width e1)) ->
  ((size (sequence d e1)) = ((size d) + (size e1))%Z).

Axiom sequence_spec3 :
  forall (d:circuit) (e1:circuit), ((width d) = (width e1)) ->
  ((width (sequence d e1)) = (width d)).

Axiom sequence_spec4 :
  forall (d:circuit) (e1:circuit), ((width d) = (width e1)) ->
  ((range (sequence d e1)) = ((range d) + (range e1))%Z).

Axiom sequence_spec5 :
  forall (d:circuit) (e1:circuit), ((width d) = (width e1)) ->
  forall (x:Z -> Z) (y:Z -> Z),
  ((ang_ind (sequence d e1) x y) =
   (ang_add (ang_ind d x y)
    (ang_ind e1
     ((((fun (y0:circuit) (y1:Z -> Z) (y2:Z -> Z) (y3:Z) =>
         (basis_ket y0 y1 y2 y3))
        d)
       x)
      y)
     (fun (k:Z) => (y (k + (range d))%Z))))).

Axiom sequence_spec6 :
  forall (d:circuit) (e1:circuit), ((width d) = (width e1)) ->
  forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
  ((basis_ket (sequence d e1) x y i) =
   (basis_ket e1
    ((((fun (y0:circuit) (y1:Z -> Z) (y2:Z -> Z) (y3:Z) =>
        (basis_ket y0 y1 y2 y3))
       d)
      x)
     y)
    (fun (k:Z) => (y (k + (range d))%Z)) i)).

Parameter ancilla: circuit -> circuit.

Axiom ancilla_spec :
  forall (c:circuit), (2%Z <= (width c))%Z ->
  (exists path_sem_target:(matrix complex) -> matrix complex,
   forall (x:matrix complex), (is_a_ket_l x ((width c) - 1%Z)%Z) ->
   ((path_sem c (kronecker x (ket 1%Z 0%Z))) =
    (kronecker (path_sem_target x) (ket 1%Z 0%Z)))) ->
  ((circ_to_pps (ancilla c)) = (pps_anc (circ_to_pps c))).

Axiom ancilla_spec1 :
  forall (c:circuit), (2%Z <= (width c))%Z ->
  (exists path_sem_target:(matrix complex) -> matrix complex,
   forall (x:matrix complex), (is_a_ket_l x ((width c) - 1%Z)%Z) ->
   ((path_sem c (kronecker x (ket 1%Z 0%Z))) =
    (kronecker (path_sem_target x) (ket 1%Z 0%Z)))) ->
  ((ancillas (ancilla c)) = ((ancillas c) + 1%Z)%Z).

Axiom ancilla_spec2 :
  forall (c:circuit), (2%Z <= (width c))%Z ->
  (exists path_sem_target:(matrix complex) -> matrix complex,
   forall (x:matrix complex), (is_a_ket_l x ((width c) - 1%Z)%Z) ->
   ((path_sem c (kronecker x (ket 1%Z 0%Z))) =
    (kronecker (path_sem_target x) (ket 1%Z 0%Z)))) ->
  ((size (ancilla c)) = (size c)).

Parameter correct_path_sum_basis: circuit -> pps -> bitvec -> Prop.

Parameter correct_path_sum: circuit -> pps -> Prop.

Axiom correct_main_path_sum :
  forall (c:circuit), correct_path_sum c (circ_to_pps c).

Axiom path_sem_basis_apply :
  forall (c:circuit) (x:matrix complex), (is_a_ket_l x (width c)) ->
  (is_a_ket_basis_elt x) ->
  ((path_sem_basis c x) = (pps_apply_basis (circ_to_pps c) (ket_to_bv x))).

Axiom path_sem_basis_value :
  forall (c:circuit) (x:matrix complex), (is_a_ket_l x (width c)) ->
  (is_a_ket_basis_elt x) ->
  ((path_sem_basis c x) =
   (infix_asdtdt (pow_inv_sqrt_2 (range c))
    (ket_sum_l (n_bvs (range c))
     (fun (y:bitvec) =>
      (infix_asdtdt (ang_exp (ang_ind c (getbv (ket_to_bv x)) (getbv y)))
       (bv_to_ket
        (make_bv
         ((((fun (y0:circuit) (y1:Z -> Z) (y2:Z -> Z) (y3:Z) =>
             (basis_ket y0 y1 y2 y3))
            c)
           (getbv (ket_to_bv x)))
          (getbv y))
         (width c)))))
     (width c)))).

Axiom path_sem_value_for_basis :
  forall (c:circuit) (x:matrix complex), (is_a_ket_l x (width c)) ->
  (is_a_ket_basis_elt x) ->
  ((path_sem c x) =
   (infix_asdtdt (pow_inv_sqrt_2 (range c))
    (ket_sum_l (n_bvs (range c))
     (fun (y:bitvec) =>
      (infix_asdtdt (ang_exp (ang_ind c (getbv (ket_to_bv x)) (getbv y)))
       (bv_to_ket
        (make_bv
         ((((fun (y0:circuit) (y1:Z -> Z) (y2:Z -> Z) (y3:Z) =>
             (basis_ket y0 y1 y2 y3))
            c)
           (getbv (ket_to_bv x)))
          (getbv y))
         (width c)))))
     (width c)))).

Axiom apply_path_sem_basis :
  forall (c:circuit) (x:matrix complex), (is_a_ket_l x (width c)) ->
  (is_a_ket_basis_elt x) ->
  ((pps_apply_basis (circ_to_pps c) (ket_to_bv x)) = (path_sem_basis c x)).

Axiom path_sem_apply :
  forall (c:circuit) (x:matrix complex), (is_a_ket_l x (width c)) ->
  ((path_sem c x) = (pps_apply (circ_to_pps c) x)).

Axiom apply_path_sem :
  forall (c:circuit) (x:matrix complex), (is_a_ket_l x (width c)) ->
  ((pps_apply (circ_to_pps c) x) = (path_sem c x)).

Axiom path_sem_ket_l :
  forall (c:circuit) (x:matrix complex) (l:Z), (is_a_ket_l x (width c)) ->
  (l = (width c)) -> is_a_ket_l (path_sem c x) l.

Axiom path_sem_ket_length :
  forall (c:circuit) (x:matrix complex) (l:Z), (is_a_ket_l x (width c)) ->
  (l = (width c)) -> ((ket_length (path_sem c x)) = l).

Axiom get_path_sem :
  forall (c:circuit) (x:matrix complex), (is_a_ket_l x (width c)) ->
  ((path_sem c x) =
   (ket_sum_l (n_bvs (width c))
    (fun (y:bitvec) =>
     (infix_asdtdt (get_ket x (bv_to_int y))
      (path_sem_basis c (bv_to_ket y))))
    (width c))).

Axiom get_path_sem_basis :
  forall (c:circuit) (x:matrix complex), (is_a_ket_l x (width c)) ->
  (is_a_ket_basis_elt x) -> ((path_sem c x) = (path_sem_basis c x)).

Axiom circ_to_pps_parallel :
  forall (d:circuit) (e1:circuit),
  ((circ_to_pps (parallel d e1)) =
   (pps_par (circ_to_pps d) (circ_to_pps e1))).

Axiom parallel_width :
  forall (d:circuit) (e1:circuit),
  ((width (parallel d e1)) = ((width d) + (width e1))%Z).

Axiom parallel_range :
  forall (d:circuit) (e1:circuit),
  ((range (parallel d e1)) = ((range d) + (range e1))%Z).

Axiom parallel_basis_ket :
  forall (d:circuit) (e1:circuit) (x:Z -> Z) (y:Z -> Z) (i:Z),
  ((i < (width d))%Z ->
   ((basis_ket (parallel d e1) x y i) = (basis_ket d x y i))) /\
  (~ (i < (width d))%Z ->
   ((basis_ket (parallel d e1) x y i) =
    (basis_ket e1 (fun (k:Z) => (x (k + (width d))%Z))
     (fun (k:Z) => (y (k + (range d))%Z)) (i - (width d))%Z))).

Axiom parallel_angle :
  forall (d:circuit) (e1:circuit) (x:Z -> Z) (y:Z -> Z),
  ((ang_ind (parallel d e1) x y) =
   (ang_add (ang_ind d x y)
    (ang_ind e1 (fun (k:Z) => (x (k + (width d))%Z))
     (fun (k:Z) => (y (k + (range d))%Z))))).

Axiom circ_to_pps_sequence :
  forall (d:circuit) (e1:circuit), ((width d) = (width e1)) ->
  ((circ_to_pps (sequence d e1)) =
   (pps_seq (circ_to_pps d) (circ_to_pps e1))).

Axiom sequence_width :
  forall (d:circuit) (e1:circuit), ((width d) = (width e1)) ->
  ((width (sequence d e1)) = (width d)).

Axiom sequence_range :
  forall (d:circuit) (e1:circuit), ((width d) = (width e1)) ->
  ((range (sequence d e1)) = ((range d) + (range e1))%Z).

Axiom sequence_basis_ket :
  forall (d:circuit) (e1:circuit) (x:Z -> Z) (y:Z -> Z) (i:Z),
  ((width d) = (width e1)) ->
  ((basis_ket (sequence d e1) x y i) =
   (basis_ket e1
    ((((fun (y0:circuit) (y1:Z -> Z) (y2:Z -> Z) (y3:Z) =>
        (basis_ket y0 y1 y2 y3))
       d)
      x)
     y)
    (fun (k:Z) => (y (k + (range d))%Z)) i)).

Axiom sequence_angle :
  forall (d:circuit) (e1:circuit) (x:Z -> Z) (y:Z -> Z),
  ((width d) = (width e1)) ->
  ((ang_ind (sequence d e1) x y) =
   (ang_add (ang_ind d x y)
    (ang_ind e1
     ((((fun (y0:circuit) (y1:Z -> Z) (y2:Z -> Z) (y3:Z) =>
         (basis_ket y0 y1 y2 y3))
        d)
       x)
      y)
     (fun (k:Z) => (y (k + (range d))%Z))))).

Axiom circ_to_pps_ancilla :
  forall (c:circuit), (2%Z <= (width c))%Z ->
  (exists path_sem_target:(matrix complex) -> matrix complex,
   forall (x:matrix complex), (is_a_ket_l x ((width c) - 1%Z)%Z) ->
   ((path_sem c (kronecker x (ket 1%Z 0%Z))) =
    (kronecker (path_sem_target x) (ket 1%Z 0%Z)))) ->
  ((circ_to_pps (ancilla c)) = (pps_anc (circ_to_pps c))).

Axiom ancilla_width :
  forall (c:circuit), (2%Z <= (width c))%Z ->
  (exists path_sem_target:(matrix complex) -> matrix complex,
   forall (x:matrix complex), (is_a_ket_l x ((width c) - 1%Z)%Z) ->
   ((path_sem c (kronecker x (ket 1%Z 0%Z))) =
    (kronecker (path_sem_target x) (ket 1%Z 0%Z)))) ->
  ((width (ancilla c)) = ((width c) - 1%Z)%Z).

Axiom ancilla_range :
  forall (c:circuit), (2%Z <= (width c))%Z ->
  (exists path_sem_target:(matrix complex) -> matrix complex,
   forall (x:matrix complex), (is_a_ket_l x ((width c) - 1%Z)%Z) ->
   ((path_sem c (kronecker x (ket 1%Z 0%Z))) =
    (kronecker (path_sem_target x) (ket 1%Z 0%Z)))) ->
  ((range (ancilla c)) = (range c)).

Parameter fc21: circuit -> (Z -> Z) -> Z -> Z.

Axiom fc_def21 :
  forall (c:circuit) (x:Z -> Z) (k:Z),
  ((k = ((width c) - 1%Z)%Z) -> (((fc21 c x) k) = 0%Z)) /\
  (~ (k = ((width c) - 1%Z)%Z) -> (((fc21 c x) k) = (x k))).

Axiom ancilla_basis_ket :
  forall (c:circuit) (x:Z -> Z) (y:Z -> Z) (i:Z), (2%Z <= (width c))%Z ->
  (exists path_sem_target:(matrix complex) -> matrix complex,
   forall (x1:matrix complex), (is_a_ket_l x1 ((width c) - 1%Z)%Z) ->
   ((path_sem c (kronecker x1 (ket 1%Z 0%Z))) =
    (kronecker (path_sem_target x1) (ket 1%Z 0%Z)))) ->
  ((basis_ket (ancilla c) x y i) = (basis_ket c (fc21 c x) y i)).

Parameter fc22: circuit -> (Z -> Z) -> Z -> Z.

Axiom fc_def22 :
  forall (c:circuit) (x:Z -> Z) (k:Z),
  ((k = ((width c) - 1%Z)%Z) -> (((fc22 c x) k) = 0%Z)) /\
  (~ (k = ((width c) - 1%Z)%Z) -> (((fc22 c x) k) = (x k))).

Axiom ancilla_angle :
  forall (c:circuit) (x:Z -> Z) (y:Z -> Z), (2%Z <= (width c))%Z ->
  (exists path_sem_target:(matrix complex) -> matrix complex,
   forall (x1:matrix complex), (is_a_ket_l x1 ((width c) - 1%Z)%Z) ->
   ((path_sem c (kronecker x1 (ket 1%Z 0%Z))) =
    (kronecker (path_sem_target x1) (ket 1%Z 0%Z)))) ->
  ((ang_ind (ancilla c) x y) = (ang_ind c (fc22 c x) y)).

Axiom sequence_eq :
  forall (d:circuit) (d':circuit) (e1:circuit) (e':circuit),
  ((width d) = (width e1)) -> (d = d') -> (e1 = e') ->
  ((sequence d e1) = (sequence d' e')).

Axiom ancilla_eq :
  forall (c:circuit) (c':circuit)
    (path_sem_target:(matrix complex) -> matrix complex),
  (forall (x:matrix complex), (is_a_ket_l x (width c)) ->
   ((path_sem c (kronecker x (ket 1%Z 0%Z))) =
    (kronecker (path_sem_target x) (ket 1%Z 0%Z)))) ->
  ((width c) = (width c')) -> (c = c') -> ((ancilla c) = (ancilla c')).

Axiom parallel_eq :
  forall (d:circuit) (d':circuit) (e1:circuit) (e':circuit), (d = d') ->
  (e1 = e') -> ((parallel d e1) = (parallel d' e')).

Axiom path_sem_decomp :
  forall (c:circuit) (x:matrix complex), (is_a_ket_l x (width c)) ->
  ((path_sem c x) =
   (ket_sum_l (n_bvs (width c))
    (fun (z:bitvec) =>
     (infix_asdtdt (get_ket x (bv_to_int z)) (path_sem c (bv_to_ket z))))
    (width c))).

Axiom path_sem_scal_ :
  forall (c:circuit) (x:matrix complex) (y:matrix complex) (sc:complex),
  (is_a_ket_l x (width c)) -> ((path_sem c x) = y) ->
  ((path_sem c (infix_asdtdt sc x)) = (infix_asdtdt sc y)).

Axiom path_sem_scal :
  forall (c:circuit) (x:matrix complex) (sc:complex),
  (is_a_ket_l x (width c)) ->
  ((path_sem c (infix_asdtdt sc x)) = (infix_asdtdt sc (path_sem c x))).

Axiom path_sem_scal_rev :
  forall (c:circuit) (x:matrix complex) (sc:complex),
  (is_a_ket_l x (width c)) ->
  ((infix_asdtdt sc (path_sem c x)) = (path_sem c (infix_asdtdt sc x))).

Axiom path_sem_add :
  forall (c:circuit) (x:matrix complex) (x':matrix complex)
    (y:matrix complex) (y':matrix complex),
  (is_a_ket_l x (width c)) -> (is_a_ket_l x' (width c)) ->
  ((path_sem c x) = y) -> ((path_sem c x') = y') ->
  ((path_sem c (add_ket_l x x' (width c))) = (add_ket_l y y' (width c))).

Axiom path_sem_scal_add_ket_l :
  forall (c:circuit) (x:matrix complex) (x':matrix complex) (a:complex)
    (a':complex) (n:Z),
  ((width c) = n) -> (is_a_ket_l x n) -> (is_a_ket_l x' n) ->
  ((path_sem c (add_ket_l (infix_asdtdt a x) (infix_asdtdt a' x') n)) =
   (add_ket_l (infix_asdtdt a (path_sem c x))
    (infix_asdtdt a' (path_sem c x')) n)).

Axiom path_sem_substr :
  forall (c:circuit) (x:matrix complex) (x':matrix complex)
    (y:matrix complex) (y':matrix complex),
  (is_a_ket_l x (width c)) -> (is_a_ket_l x' (width c)) ->
  ((path_sem c x) = y) -> ((path_sem c x') = y') ->
  ((path_sem c (mat_substr x x')) = (mat_substr y y')).

Axiom path_sem_scal_add :
  forall (c:circuit) (x:matrix complex) (x':matrix complex)
    (y:matrix complex) (y':matrix complex) (scal:complex),
  (is_a_ket_l x (width c)) -> (is_a_ket_l x' (width c)) ->
  ((path_sem c x) = y) -> ((path_sem c x') = y') ->
  ((path_sem c (infix_asdtdt scal (add_ket_l x x' (width c)))) =
   (infix_asdtdt scal (add_ket_l y y' (width c)))).

Axiom path_sem_scal_substr :
  forall (c:circuit) (x:matrix complex) (x':matrix complex)
    (y:matrix complex) (y':matrix complex) (scal:complex),
  (is_a_ket_l x (width c)) -> (is_a_ket_l x' (width c)) ->
  ((path_sem c x) = y) -> ((path_sem c x') = y') ->
  ((path_sem c (infix_asdtdt scal (mat_substr x x'))) =
   (infix_asdtdt scal (mat_substr y y'))).

Axiom path_sem_sum :
  forall {a:Type} {a_WT:WhyType a},
  forall (c:circuit) (s:set a) (f:a -> matrix complex)
    (g:a -> matrix complex) (n:Z),
  ((cardinal s) >= 1%Z)%Z -> (n = (width c)) ->
  (forall (x:a), (mem x s) -> is_a_ket_l (f x) (width c)) ->
  (forall (x:a), (mem x s) -> ((path_sem c (f x)) = (g x))) ->
  ((path_sem c (ket_sum_l s f n)) = (ket_sum_l s g n)).

Axiom path_sem_sum_diag :
  forall (c:circuit) (s:set bitvec) (f:bitvec -> complex) (l:Z),
  (s = (n_bvs l)) -> (l = (width c)) ->
  ((path_sem c (ket_sum_l_diag f l)) =
   (ket_sum_l s
    (fun (x:bitvec) => (infix_asdtdt (f x) (path_sem c (bv_to_ket x)))) l)).

Axiom path_sem_sum_ :
  forall {a:Type} {a_WT:WhyType a},
  forall (c:circuit) (s:set a) (f:a -> matrix complex) (n:Z),
  ((cardinal s) >= 1%Z)%Z -> (n = (width c)) ->
  (forall (x:a), (mem x s) -> is_a_ket_l (f x) (width c)) ->
  ((path_sem c (ket_sum_l s f n)) =
   (ket_sum_l s (fun (x:a) => (path_sem c (f x))) n)).

Axiom path_sem_sum_gen :
  forall {a:Type} {a_WT:WhyType a},
  forall (c:circuit) (s:set a) (f:a -> matrix complex)
    (g:a -> matrix complex) (n:Z),
  ((cardinal s) >= 1%Z)%Z -> (n = (width c)) ->
  (forall (x:a), (mem x s) -> is_a_ket_l (f x) (width c)) ->
  (forall (x:a), (mem x s) -> ((path_sem c (f x)) = (g x))) ->
  ((path_sem c (ket_sum_l s f n)) = (ket_sum_l s g n)).

Axiom scal_path_sem_sum_gen :
  forall {a:Type} {a_WT:WhyType a},
  forall (c:circuit) (s:set a) (f:a -> matrix complex)
    (g:a -> matrix complex) (n:Z) (n':Z) (a1:complex) (b:complex),
  ((cardinal s) >= 1%Z)%Z -> (n = (width c)) ->
  (forall (x:a), (mem x s) -> is_a_ket_l (f x) (width c)) ->
  (forall (x:a), (mem x s) -> ((path_sem c (f x)) = (g x))) -> (a1 = b) ->
  (n = n') ->
  ((infix_asdtdt a1 (path_sem c (ket_sum_l s f n))) =
   (infix_asdtdt b (ket_sum_l s g n'))).

Axiom scal_path_sem_sum :
  forall {a:Type} {a_WT:WhyType a},
  forall (c:circuit) (s:set a) (f:a -> matrix complex) (n:Z) (a1:complex),
  ((cardinal s) >= 1%Z)%Z -> (n = (width c)) ->
  (forall (x:a), (mem x s) -> is_a_ket_l (f x) (width c)) ->
  ((infix_asdtdt a1 (path_sem c (ket_sum_l s f n))) =
   (infix_asdtdt a1 (ket_sum_l s (fun (x:a) => (path_sem c (f x))) n))).

Axiom path_sem_scal_sum :
  forall {a:Type} {a_WT:WhyType a},
  forall (c:circuit) (s:set a) (f:a -> matrix complex) (n:Z) (a1:complex),
  ((cardinal s) >= 1%Z)%Z -> (n = (width c)) ->
  (forall (x:a), (mem x s) -> is_a_ket_l (f x) (width c)) ->
  ((path_sem c (infix_asdtdt a1 (ket_sum_l s f n))) =
   (infix_asdtdt a1 (ket_sum_l s (fun (x:a) => (path_sem c (f x))) n))).

Axiom path_sem_comp :
  forall (d:circuit) (e1:circuit) (x:matrix complex) (y:matrix complex)
    (z:matrix complex),
  (is_a_ket_l x (width d)) -> ((path_sem d x) = y) ->
  ((path_sem e1 y) = z) -> ((width d) = (width e1)) ->
  ((path_sem (sequence d e1) x) = z).

Axiom sem_comp :
  forall (d:circuit) (e1:circuit) (x:matrix complex) (y:matrix complex)
    (z:matrix complex),
  (sem d x y) -> (sem e1 y z) -> ((width d) = (width e1)) ->
  sem (sequence d e1) x z.

Axiom path_sem_kron :
  forall (d:circuit) (e1:circuit) (x:matrix complex) (x':matrix complex)
    (y:matrix complex) (y':matrix complex),
  (is_a_ket_l x (width d)) -> (is_a_ket_l y (width e1)) ->
  ((path_sem d x) = x') -> ((path_sem e1 y) = y') ->
  ((path_sem (parallel d e1) (kronecker x y)) = (kronecker x' y')).

Axiom path_sem_kron_ :
  forall (d:circuit) (e1:circuit) (x:matrix complex) (y:matrix complex),
  (is_a_ket_l x (width d)) -> (is_a_ket_l y (width e1)) ->
  ((path_sem (parallel d e1) (kronecker x y)) =
   (kronecker (path_sem d x) (path_sem e1 y))).

Axiom path_sem_sequence_parallel :
  forall (a:circuit) (b:circuit) (d:circuit) (e1:circuit) (x:matrix complex),
  (is_a_ket_l x ((width a) + (width b))%Z) -> ((width a) = (width d)) ->
  ((width b) = (width e1)) ->
  ((path_sem (sequence (parallel a b) (parallel d e1)) x) =
   (path_sem (parallel (sequence a d) (sequence b e1)) x)).

Axiom path_sem_id_basis :
  forall (x:matrix complex), (is_a_ket_l x 1%Z) -> (is_a_ket_basis_elt x) ->
  ((path_sem_basis id x) = x).

Axiom path_sem_id :
  forall (x:matrix complex), (is_a_ket_l x 1%Z) -> ((path_sem id x) = x).

Axiom path_sem_phase_basis :
  forall (x:matrix complex) (k:Z), (is_a_ket_l x 1%Z) ->
  (is_a_ket_basis_elt x) ->
  ((0%Z <= k)%Z ->
   ((path_sem (phase k) x) = (infix_asdtdt (ang_exp (int_to_ang 1%Z k)) x))) /\
  (~ (0%Z <= k)%Z ->
   ((path_sem (phase k) x) =
    (infix_asdtdt (ang_exp (int_to_ang (-1%Z)%Z (-k)%Z)) x))).

Axiom path_sem_phase_basis_inv :
  forall (x:matrix complex) (k:Z), (is_a_ket_l x 1%Z) ->
  (is_a_ket_basis_elt x) ->
  ((path_sem (phase k) (path_sem (phase (-k)%Z) x)) = x).

Axiom path_sem_phase_inv :
  forall (x:matrix complex) (k:Z), (is_a_ket_l x 1%Z) ->
  ((path_sem (phase k) (path_sem (phase (-k)%Z) x)) = x).

Axiom path_sem_rz_basis :
  forall (x:matrix complex) (k:Z), (is_a_ket_l x 1%Z) ->
  (is_a_ket_basis_elt x) ->
  (((ket_to_int x) = 0%Z) -> ((path_sem (rz k) x) = x)) /\
  (~ ((ket_to_int x) = 0%Z) ->
   ((0%Z <= k)%Z ->
    ((path_sem (rz k) x) = (infix_asdtdt (ang_exp (int_to_ang 1%Z k)) x))) /\
   (~ (0%Z <= k)%Z ->
    ((path_sem (rz k) x) =
     (infix_asdtdt (ang_exp (int_to_ang (-1%Z)%Z (-k)%Z)) x)))).

Axiom path_sem_rz_basis_inv :
  forall (x:matrix complex) (k:Z), (is_a_ket_l x 1%Z) ->
  (is_a_ket_basis_elt x) -> ((path_sem (rz k) (path_sem (rz (-k)%Z) x)) = x).

Axiom path_sem_rz_inv :
  forall (x:matrix complex) (k:Z), (is_a_ket_l x 1%Z) ->
  ((path_sem (rz k) (path_sem (rz (-k)%Z) x)) = x).

Parameter qbit_zero: unit -> matrix complex.

Axiom qbit_zero_def : forall (us:unit), ((qbit_zero us) = (ket 1%Z 0%Z)).

Axiom qbit_zero_spec :
  forall (us:unit), ((get_ket (qbit_zero us) 0%Z) = c_one).

Axiom qbit_zero_spec1 :
  forall (us:unit), ((get_ket (qbit_zero us) 1%Z) = c_zero).

Axiom qbit_zero_spec2 : forall (us:unit), is_a_ket_l (qbit_zero us) 1%Z.

Axiom qbit_zero_spec3 : forall (us:unit), ((rows (qbit_zero us)) = 2%Z).

Axiom qbit_zero_spec4 : forall (us:unit), ((columns (qbit_zero us)) = 1%Z).

Axiom qbit_zero_spec5 :
  forall (us:unit), ((get (qbit_zero us) 0%Z 0%Z) = c_one).

Axiom qbit_zero_spec6 :
  forall (us:unit), ((get (qbit_zero us) 1%Z 0%Z) = c_zero).

Axiom qbit_zero_spec7 : forall (us:unit), is_a_ket_basis_elt (qbit_zero us).

Parameter qbit_one: unit -> matrix complex.

Axiom qbit_one_def : forall (us:unit), ((qbit_one us) = (ket 1%Z 1%Z)).

Axiom qbit_one_spec :
  forall (us:unit), ((get_ket (qbit_one us) 0%Z) = c_zero).

Axiom qbit_one_spec1 :
  forall (us:unit), ((get_ket (qbit_one us) 1%Z) = c_one).

Axiom qbit_one_spec2 : forall (us:unit), is_a_ket_l (qbit_one us) 1%Z.

Axiom qbit_one_spec3 : forall (us:unit), ((rows (qbit_one us)) = 2%Z).

Axiom qbit_one_spec4 : forall (us:unit), ((columns (qbit_one us)) = 1%Z).

Axiom qbit_one_spec5 :
  forall (us:unit), ((get (qbit_one us) 0%Z 0%Z) = c_zero).

Axiom qbit_one_spec6 :
  forall (us:unit), ((get (qbit_one us) 1%Z 0%Z) = c_one).

Axiom qbit_one_spec7 : forall (us:unit), is_a_ket_basis_elt (qbit_one us).

Parameter qbit_plus: unit -> matrix complex.

Axiom qbit_plus_def :
  forall (us:unit),
  ((qbit_plus us) = (pps_apply pps_hadamard (qbit_zero tt))).

Axiom qbit_plus_spec :
  forall (us:unit),
  ((qbit_plus us) =
   (infix_asdtdt (pow_inv_sqrt_2 1%Z)
    (add_ket_l (qbit_zero tt) (qbit_one tt) 1%Z))).

Axiom qbit_plus_spec1 : forall (us:unit), is_a_ket_l (qbit_plus us) 1%Z.

Axiom qbit_plus_spec2 : forall (us:unit), ((rows (qbit_plus us)) = 2%Z).

Axiom qbit_plus_spec3 : forall (us:unit), ((columns (qbit_plus us)) = 1%Z).

Axiom qbit_plus_spec4 :
  forall (us:unit), ((get_ket (qbit_plus us) 0%Z) = (pow_inv_sqrt_2 1%Z)).

Axiom qbit_plus_spec5 :
  forall (us:unit), ((get_ket (qbit_plus us) 1%Z) = (pow_inv_sqrt_2 1%Z)).

Parameter qbit_minus: unit -> matrix complex.

Axiom qbit_minus_def :
  forall (us:unit),
  ((qbit_minus us) = (pps_apply pps_hadamard (qbit_one tt))).

Axiom qbit_minus_spec :
  forall (us:unit),
  ((qbit_minus us) =
   (infix_asdtdt (pow_inv_sqrt_2 1%Z)
    (add_ket_l (qbit_zero tt)
     (infix_asdtdt (prefix_mndt c_one) (qbit_one tt)) 1%Z))).

Axiom qbit_minus_spec1 : forall (us:unit), is_a_ket_l (qbit_minus us) 1%Z.

Axiom qbit_minus_spec2 : forall (us:unit), ((rows (qbit_minus us)) = 2%Z).

Axiom qbit_minus_spec3 : forall (us:unit), ((columns (qbit_minus us)) = 1%Z).

Axiom qbit_minus_spec4 :
  forall (us:unit), ((get_ket (qbit_minus us) 0%Z) = (pow_inv_sqrt_2 1%Z)).

Axiom qbit_minus_spec5 :
  forall (us:unit),
  ((get_ket (qbit_minus us) 1%Z) = (prefix_mndt (pow_inv_sqrt_2 1%Z))).

Axiom add_plus_minus :
  ((add_ket_l (qbit_plus tt) (qbit_minus tt) 1%Z) =
   (infix_asdtdt squarert_two (qbit_zero tt))).

Axiom add_plus_minus1 :
  ((add_ket_l (infix_asdtdt (pow_inv_sqrt_2 1%Z) (qbit_plus tt))
    (infix_asdtdt (pow_inv_sqrt_2 1%Z) (qbit_minus tt)) 1%Z)
   = (qbit_zero tt)).

Axiom substr_plus_minus :
  ((add_ket_l (qbit_plus tt)
    (infix_asdtdt (prefix_mndt c_one) (qbit_minus tt)) 1%Z)
   = (infix_asdtdt squarert_two (qbit_one tt))).

Axiom substr_plus_minus1 :
  ((add_ket_l (infix_asdtdt (pow_inv_sqrt_2 1%Z) (qbit_plus tt))
    (infix_asdtdt (prefix_mndt (pow_inv_sqrt_2 1%Z)) (qbit_minus tt)) 1%Z)
   = (qbit_one tt)).

Axiom plus_to_zero :
  ((pps_apply pps_hadamard (qbit_plus tt)) = (qbit_zero tt)).

Axiom plus_to_one :
  ((pps_apply pps_hadamard (qbit_minus tt)) = (qbit_one tt)).

Axiom hadamard_comp :
  forall (x:bitvec), ((length x) = 1%Z) ->
  ((pps_apply pps_hadamard (pps_apply pps_hadamard (bv_to_ket x))) =
   (bv_to_ket x)).

Axiom set_equal_qbit :
  forall (a:matrix complex) (b:matrix complex), (is_a_ket_l a 1%Z) ->
  (is_a_ket_l b 1%Z) -> ((get_ket a 0%Z) = (get_ket b 0%Z)) ->
  ((get_ket a 1%Z) = (get_ket b 1%Z)) -> (a = b).

Parameter xor_qbits: (matrix complex) -> (matrix complex) -> matrix complex.

Parameter result22: (matrix complex) -> (matrix complex) -> Z -> complex.

Axiom result_def22 :
  forall (x:matrix complex) (y:matrix complex) (i:Z),
  ((i = 0%Z) ->
   (((result22 x y) i) =
    (infix_pldt (infix_asdt (get_ket x 0%Z) (get_ket y 0%Z))
     (infix_asdt (get_ket x 1%Z) (get_ket y 1%Z))))) /\
  (~ (i = 0%Z) ->
   (((result22 x y) i) =
    (infix_pldt (infix_asdt (get_ket x 0%Z) (get_ket y 1%Z))
     (infix_asdt (get_ket x 1%Z) (get_ket y 0%Z))))).

Axiom xor_qbits_def :
  forall (x:matrix complex) (y:matrix complex), (is_a_ket_l x 1%Z) ->
  (is_a_ket_l y 1%Z) -> ((xor_qbits x y) = (make_ket 1%Z (result22 x y))).

Axiom xor_qbits_spec :
  forall (x:matrix complex) (y:matrix complex), (is_a_ket_l x 1%Z) ->
  (is_a_ket_l y 1%Z) -> is_a_ket_l (xor_qbits x y) 1%Z.

Axiom xor_qbits_spec1 :
  forall (x:matrix complex) (y:matrix complex), (is_a_ket_l x 1%Z) ->
  (is_a_ket_l y 1%Z) -> (is_a_ket_basis_elt x) -> (is_a_ket_basis_elt y) ->
  ((xor_qbits x y) = (ket 1%Z (xor_i (ket_to_int x) (ket_to_int y)))).

Axiom xor_qbits_spec2 :
  forall (x:matrix complex) (y:matrix complex), (is_a_ket_l x 1%Z) ->
  (is_a_ket_l y 1%Z) ->
  ((get_ket (xor_qbits x y) 0%Z) =
   (infix_pldt (infix_asdt (get_ket x 0%Z) (get_ket y 0%Z))
    (infix_asdt (get_ket x 1%Z) (get_ket y 1%Z)))).

Axiom xor_qbits_spec3 :
  forall (x:matrix complex) (y:matrix complex), (is_a_ket_l x 1%Z) ->
  (is_a_ket_l y 1%Z) ->
  ((get_ket (xor_qbits x y) 1%Z) =
   (infix_pldt (infix_asdt (get_ket x 0%Z) (get_ket y 1%Z))
    (infix_asdt (get_ket x 1%Z) (get_ket y 0%Z)))).

Axiom xor_int_to_ket :
  forall (x:matrix complex) (i:Z), (is_a_ket_l x 1%Z) ->
  is_a_ket_l (xor_qbits (ket 1%Z i) x) 1%Z.

Axiom xor_qbit_minus :
  forall (i:Z), ((0%Z <= i)%Z /\ (i < 2%Z)%Z) ->
  ((xor_qbits (ket 1%Z i) (qbit_minus tt)) =
   (infix_asdtdt (cpower (prefix_mndt c_one) i) (qbit_minus tt))).

Axiom ket_sum_xor_qbit_minus :
  forall {a:Type} {a_WT:WhyType a},
  forall (s:set a) (f:a -> Z),
  (forall (e1:a), (mem e1 s) -> (0%Z <= (f e1))%Z /\ ((f e1) < 2%Z)%Z) ->
  ((ket_sum_l s (fun (e1:a) => (xor_qbits (ket 1%Z (f e1)) (qbit_minus tt)))
    1%Z)
   =
   (ket_sum_l s
    (fun (e1:a) =>
     (infix_asdtdt (cpower (prefix_mndt c_one) (f e1)) (qbit_minus tt)))
    1%Z)).

Axiom superposition_xor_qbit_minus :
  forall (f:bitvec -> Z) (n:Z),
  (forall (e1:bitvec), ((length e1) = n) ->
   (0%Z <= (f e1))%Z /\ ((f e1) < 2%Z)%Z) ->
  (0%Z <= n)%Z ->
  ((kronecker
    (infix_asdtdt (pow_inv_sqrt_2 n)
     (ket_sum_l (n_bvs n)
      (fun (x:bitvec) =>
       (infix_asdtdt (cpower (prefix_mndt c_one) (f x)) (bv_to_ket x)))
      n))
    (qbit_minus tt))
   =
   (infix_asdtdt (pow_inv_sqrt_2 n)
    (ket_sum_l (n_bvs n)
     (fun (e1:bitvec) =>
      (kronecker (bv_to_ket e1) (xor_qbits (ket 1%Z (f e1)) (qbit_minus tt))))
     (n + 1%Z)%Z))).

Parameter bv_inversion: bitvec -> bitvec.

Axiom bv_inversion_def :
  forall (bv:bitvec),
  ((bv_inversion bv) =
   (make_bv (fun (k:Z) => ((getbv bv) (((length bv) - k)%Z - 1%Z)%Z))
    (length bv))).

Axiom bv_inversion_spec :
  forall (bv:bitvec), ((length (bv_inversion bv)) = (length bv)).

Axiom bv_inversion_spec1 :
  forall (bv:bitvec), forall (k:Z), (in_range (bv_inversion bv) k) ->
  (((getbv (bv_inversion bv)) k) =
   ((getbv bv) (((length bv) - k)%Z - 1%Z)%Z)).

Axiom bv_inversion_value :
  forall (bv:bitvec) (i:Z),
  (((getbv (bv_inversion bv)) i) =
   ((getbv bv) (((length bv) - i)%Z - 1%Z)%Z)).

Axiom bv_inversion_invol :
  forall (bv:bitvec), ((bv_inversion (bv_inversion bv)) = bv).

Parameter int_bit_inversion: Z -> Z -> Z.

Axiom int_bit_inversion_def :
  forall (i:Z) (n:Z), (0%Z < n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) ->
  ((int_bit_inversion i n) = (bv_to_int (bv_inversion (int_to_bv i n)))).

Axiom int_bit_inversion_spec :
  forall (i:Z) (n:Z), (0%Z < n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) ->
  (0%Z <= (int_bit_inversion i n))%Z.

Axiom int_bit_inversion_spec1 :
  forall (i:Z) (n:Z), (0%Z < n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) ->
  ((int_bit_inversion i n) < (power 2%Z n))%Z.

Parameter int_bit_inversion_ext: Z -> Z -> Z.

Axiom int_bit_inversion_ext_def :
  forall (i:Z) (n:Z), (0%Z < n)%Z ->
  ((0%Z <= i)%Z /\ (i <= (power_ 2%Z n))%Z) -> (i = (power_ 2%Z n)) ->
  ((int_bit_inversion_ext i n) = i).

Axiom int_bit_inversion_ext_def1 :
  forall (i:Z) (n:Z), (0%Z < n)%Z ->
  ((0%Z <= i)%Z /\ (i <= (power_ 2%Z n))%Z) -> ~ (i = (power_ 2%Z n)) ->
  ((int_bit_inversion_ext i n) = (bv_to_int (bv_inversion (int_to_bv i n)))).

Axiom int_bit_inversion_ext_spec :
  forall (i:Z) (n:Z), (0%Z < n)%Z ->
  ((0%Z <= i)%Z /\ (i <= (power_ 2%Z n))%Z) ->
  (0%Z <= (int_bit_inversion_ext i n))%Z.

Axiom int_bit_inversion_ext_spec1 :
  forall (i:Z) (n:Z), (0%Z < n)%Z ->
  ((0%Z <= i)%Z /\ (i <= (power_ 2%Z n))%Z) ->
  ((int_bit_inversion_ext i n) <= (power_ 2%Z n))%Z.

Axiom int_bit_inversion_ext_spec2 :
  forall (i:Z) (n:Z), (0%Z < n)%Z ->
  ((0%Z <= i)%Z /\ (i <= (power_ 2%Z n))%Z) -> (i = (power_ 2%Z n)) ->
  ((int_bit_inversion_ext i n) = (power_ 2%Z n)).

Axiom int_bit_inversion_invol :
  forall (i:Z) (n:Z), (0%Z < n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) ->
  ((int_bit_inversion (int_bit_inversion i n) n) = i).

Axiom int_bit_inversion_inj :
  forall (i:Z) (j:Z) (n:Z), (0%Z < n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) ->
  ((0%Z <= j)%Z /\ (j < (power 2%Z n))%Z) -> ~ (i = j) ->
  ~ ((int_bit_inversion i n) = (int_bit_inversion j n)).

Axiom int_bit_inversion_ext_invol :
  forall (i:Z) (n:Z), (0%Z < n)%Z ->
  ((0%Z <= i)%Z /\ (i <= (power 2%Z n))%Z) ->
  ((int_bit_inversion_ext (int_bit_inversion_ext i n) n) = i).

Axiom int_bit_inversion_onebit :
  forall (i:Z), ((0%Z <= i)%Z /\ (i < 2%Z)%Z) ->
  ((int_bit_inversion i 1%Z) = i).

Axiom int_bit_inversion_zero :
  forall (i:Z) (n:Z), (0%Z < n)%Z -> (0%Z = i) ->
  ((int_bit_inversion i n) = 0%Z).

Axiom bv_to_int_sum_inversion :
  forall (bv:bitvec), ((length bv) > 0%Z)%Z ->
  ((int_bit_inversion (bv_to_int bv) (length bv)) =
   (ind_isum
    (fun (k:Z) =>
     (((getbv bv) (((length bv) - k)%Z - 1%Z)%Z) *
      (power 2%Z (((length bv) - 1%Z)%Z - k)%Z))%Z)
    0%Z (length bv))).

Axiom bv_to_int_sum_inversion_inc :
  forall (bv:bitvec), ((length bv) > 0%Z)%Z ->
  ((int_bit_inversion (bv_to_int bv) (length bv)) =
   (ind_isum (fun (k:Z) => (((getbv bv) k) * (power 2%Z k))%Z) 0%Z
    (length bv))).

Axiom inversion_to_int_comm :
  forall (bv:bitvec), ((length bv) > 0%Z)%Z ->
  ((int_to_bv (int_bit_inversion (bv_to_int bv) (length bv)) (length bv)) =
   (bv_inversion bv)).

Axiom bv_inversion_sum :
  forall (i:Z) (n:Z), (0%Z < n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) ->
  ((int_bit_inversion i n) =
   (ind_isum
    (fun (k:Z) =>
     (((getbv (int_to_bv i n)) ((n - k)%Z - 1%Z)%Z) *
      (power 2%Z ((n - 1%Z)%Z - k)%Z))%Z)
    0%Z n)).

Axiom bv_to_int_inversion_sum :
  forall (bv:bitvec),
  ((bv_to_int (bv_inversion bv)) =
   (ind_isum
    (fun (k:Z) =>
     (((getbv bv) (((length bv) - k)%Z - 1%Z)%Z) *
      (power 2%Z (((length bv) - 1%Z)%Z - k)%Z))%Z)
    0%Z (length bv))).

Axiom bv_to_int_bit_inversion :
  forall (bv:bitvec), ((length bv) > 0%Z)%Z ->
  ((bv_to_int (bv_inversion bv)) =
   (int_bit_inversion (bv_to_int bv) (length bv))).

Axiom bv_to_int_inversion_sum_inc :
  forall (bv:bitvec), ((length bv) > 0%Z)%Z ->
  ((bv_to_int (bv_inversion bv)) =
   (ind_isum (fun (k:Z) => (((getbv bv) k) * (power 2%Z k))%Z) 0%Z
    (length bv))).

Axiom bv_m_to_int_bit_inversion :
  forall (f:Z -> Z) (n:Z), (0%Z < n)%Z ->
  ((bv_to_int (bv_inversion (make_bv_m f n))) =
   (int_bit_inversion (bv_to_int (make_bv_m f n)) n)).

Axiom int_bit_inversion_tail_bits :
  forall (i:Z) (n:Z), (1%Z < n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) ->
  ((int_bit_inversion (tail_bits i n) (n - 1%Z)%Z) =
   (ind_isum
    (fun (k:Z) =>
     (((getbv (int_to_bv i n)) (n - k)%Z) *
      (power 2%Z ((n - k)%Z - 1%Z)%Z))%Z)
    1%Z n)).

Axiom tail_bits_int_bit_inversion :
  forall (bv:Z -> Z) (n:Z), (1%Z < n)%Z ->
  ((tail_bits (int_bit_inversion (bv_to_int (make_bv_m bv n)) n) n) =
   (ind_isum
    (fun (k:Z) =>
     ((int.EuclideanDivision.mod1 (bv ((n - 1%Z)%Z - k)%Z) 2%Z) *
      (power 2%Z ((n - k)%Z - 1%Z)%Z))%Z)
    1%Z n)).

Axiom int_bit_inversion_ht :
  forall (i:Z) (n:Z), (1%Z < n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power 2%Z n))%Z) ->
  ((int_bit_inversion i n) =
   ((2%Z * (int_bit_inversion (tail_bits i n) (n - 1%Z)%Z))%Z +
    (head_bit i n))%Z).

Axiom bv_inversion_ht :
  forall (f:Z -> Z) (n:Z), (1%Z < n)%Z ->
  ((bv_to_int (bv_inversion (make_bv_m f n))) =
   ((head (make_bv_m f n)) +
    (2%Z * (bv_to_int (bv_inversion (tail (make_bv_m f n)))))%Z)%Z).

Axiom bv_inversion_ht_bv :
  forall (bv:bitvec), (1%Z < (length bv))%Z ->
  ((bv_to_int (bv_inversion bv)) =
   ((head bv) + (2%Z * (bv_to_int (bv_inversion (tail bv))))%Z)%Z).

Axiom bv_to_int_ht :
  forall (f:Z -> Z) (n:Z), (1%Z < n)%Z ->
  ((bv_to_int (make_bv_m f n)) =
   (((power 2%Z (n - 1%Z)%Z) * (head (make_bv_m f n)))%Z +
    (bv_to_int (tail (make_bv_m f n))))%Z).

Axiom bv_inversion_mult_ht :
  forall (fx:Z -> Z) (fy:Z -> Z) (n:Z), (1%Z < n)%Z ->
  (((bv_to_int (make_bv_m fx n)) *
    (bv_to_int (bv_inversion (make_bv_m fy n))))%Z
   =
   ((((head (make_bv_m fy n)) * (bv_to_int (make_bv_m fx n)))%Z +
     ((bv_to_int (tail (make_bv_m fx n))) *
      (2%Z * (bv_to_int (bv_inversion (tail (make_bv_m fy n)))))%Z)%Z)%Z
    +
    ((power 2%Z n) *
     ((head (make_bv_m fx n)) *
      (bv_to_int (bv_inversion (tail (make_bv_m fy n)))))%Z)%Z)%Z).

Axiom bv_inversion_mult_ht_bv :
  forall (bvx:bitvec) (bvy:bitvec), (1%Z < (length bvx))%Z ->
  ((length bvx) = (length bvy)) ->
  (((bv_to_int bvx) * (bv_to_int (bv_inversion bvy)))%Z =
   ((((head bvy) * (bv_to_int bvx))%Z +
     ((bv_to_int (tail bvx)) *
      (2%Z * (bv_to_int (bv_inversion (tail bvy))))%Z)%Z)%Z
    +
    ((power 2%Z (length bvx)) *
     ((head bvx) * (bv_to_int (bv_inversion (tail bvy))))%Z)%Z)%Z).

Parameter ang_sum: (Z -> angle) -> Z -> Z -> angle.

Axiom ang_sum_def :
  forall (f:Z -> angle) (i:Z) (j:Z), (j <= i)%Z ->
  ((ang_sum f i j) = ang_zero).

Axiom ang_sum_def1 :
  forall (f:Z -> angle) (i:Z) (j:Z), ~ (j <= i)%Z ->
  ((ang_sum f i j) =
   (int_iterate (fun (y0:angle) (y1:angle) => (ang_add y0 y1)) f i j)).

Axiom ang_sumto_int_iterate :
  forall (f:Z -> angle) (i:Z) (j:Z), (i < j)%Z ->
  ((ang_sum f i j) =
   (int_iterate (fun (y0:angle) (y1:angle) => (ang_add y0 y1)) f i j)).

Axiom ang_sum_plus_one :
  forall (f:Z -> angle) (i:Z) (j:Z), ((i + 1%Z)%Z < j)%Z ->
  ((ang_sum f i j) = (ang_add (f i) (ang_sum f (i + 1%Z)%Z j))).

Axiom ang_sum_cardone :
  forall (f:Z -> angle) (i:Z) (j:Z), (j = (i + 1%Z)%Z) ->
  ((ang_sum f i j) = (f i)).

Axiom ang_sum_cardone_p :
  forall (f:Z -> angle) (i:Z) (j:Z) (r:angle), (j = (i + 1%Z)%Z) ->
  ((f i) = r) -> (r = (ang_sum f i j)).

Axiom ang_sum_neutral :
  forall (f:Z -> angle) (i:Z) (j:Z), (i <= j)%Z ->
  (forall (k:Z), ((i <= k)%Z /\ (k < j)%Z) -> ((f k) = ang_zero)) ->
  ((ang_sum f i j) = ang_zero).

Axiom ang_sum_def_plus_one_com :
  forall (f:Z -> angle) (i:Z) (j:Z), ((i + 1%Z)%Z < j)%Z ->
  ((ang_add (f i) (ang_sum f (i + 1%Z)%Z j)) = (ang_sum f i j)).

Axiom ang_sum_right_extension :
  forall (f:Z -> angle) (i:Z) (j:Z), ((i + 1%Z)%Z < j)%Z ->
  ((ang_sum f i j) = (ang_add (ang_sum f i (j - 1%Z)%Z) (f (j - 1%Z)%Z))).

Axiom ang_sum_transitivity :
  forall (f:Z -> angle) (i:Z) (k:Z) (j:Z), ((i < k)%Z /\ (k < j)%Z) ->
  ((ang_sum f i j) = (ang_add (ang_sum f i k) (ang_sum f k j))).

Axiom ang_sum_eq :
  forall (f:Z -> angle) (g:Z -> angle) (i:Z) (j:Z), (i <= j)%Z ->
  (forall (k:Z), ((i <= k)%Z /\ (k < j)%Z) -> ((f k) = (g k))) ->
  ((ang_sum f i j) = (ang_sum g i j)).

Axiom ang_sum_int_to_ang :
  forall (f:Z -> angle) (g:Z -> angle) (i:Z) (j:Z), (i < j)%Z ->
  (forall (k:Z), ((i <= k)%Z /\ (k < j)%Z) -> ((f k) = (g k))) ->
  (exists n:Z,
   forall (k:Z),
   exists j1:Z, exists j':Z,
   ((f k) = (int_to_ang j1 n)) /\ (((g k) = (int_to_ang j' n)) /\ (j1 = j'))) ->
  ((ang_sum f i j) = (ang_sum g i j)).

Axiom vang_sum_eq :
  forall (f:Z -> angle) (g:Z -> angle) (i:Z) (j:Z), (i < j)%Z ->
  (forall (k:Z), ((i <= k)%Z /\ (k < j)%Z) -> ((f k) = (g k))) ->
  ((ang_exp (ang_sum f i j)) = (ang_exp (ang_sum g i j))).

Axiom vang_sum_scal_eq :
  forall (f:Z -> angle) (g:Z -> angle) (m:matrix complex) (n:matrix complex)
    (i:Z) (j:Z),
  (i < j)%Z -> (m = n) ->
  (forall (k:Z), ((i <= k)%Z /\ (k < j)%Z) -> ((f k) = (g k))) ->
  ((infix_asdtdt (ang_exp (ang_sum f i j)) m) =
   (infix_asdtdt (ang_exp (ang_sum g i j)) n)).

Axiom ang_sum_inv :
  forall (f:Z -> angle) (i:Z) (j:Z),
  ((ang_inv (ang_sum f i j)) = (ang_sum (fun (k:Z) => (ang_inv (f k))) i j)).

Axiom ang_sum_plus_one_p :
  forall (f:Z -> angle) (g:Z -> angle) (i:Z) (j:Z) (l:Z) (m:Z) (r:angle),
  ((i + 1%Z)%Z < j)%Z -> (l = (i + 1%Z)%Z) -> (m = j) -> ((g i) = r) ->
  (forall (k:Z), (((i + 1%Z)%Z <= k)%Z /\ (k < j)%Z) -> ((f k) = (g k))) ->
  ((ang_add r (ang_sum f l m)) = (ang_sum g i j)).

Axiom vang_sum_plus_one_p :
  forall (f:Z -> angle) (g:Z -> angle) (i:Z) (j:Z) (l:Z) (m:Z) (r:angle),
  ((i + 1%Z)%Z < j)%Z -> (l = (i + 1%Z)%Z) -> (m = j) -> ((g i) = r) ->
  (forall (k:Z), (((i + 1%Z)%Z <= k)%Z /\ (k < j)%Z) -> ((f k) = (g k))) ->
  ((infix_asdt (ang_exp r) (ang_exp (ang_sum f l m))) =
   (ang_exp (ang_sum g i j))).

Axiom vang_sum_plus_one_rev :
  forall (f:Z -> angle) (g:Z -> angle) (i:Z) (j:Z) (l:Z) (m:Z) (r:angle),
  ((i + 1%Z)%Z < j)%Z -> (l = (i + 1%Z)%Z) -> (m = j) -> ((g i) = r) ->
  (forall (k:Z), (((i + 1%Z)%Z <= k)%Z /\ (k < j)%Z) -> ((f k) = (g k))) ->
  ((ang_exp (ang_sum g i j)) =
   (infix_asdt (ang_exp r) (ang_exp (ang_sum f l m)))).

Axiom ang_sum_right_extension_p :
  forall (f:Z -> angle) (g:Z -> angle) (i:Z) (j:Z) (l:Z) (m:Z) (r:angle),
  ((i + 1%Z)%Z < j)%Z -> (m = (j - 1%Z)%Z) -> (l = i) ->
  ((g (j - 1%Z)%Z) = r) ->
  (forall (k:Z), ((i <= k)%Z /\ (k < (j - 1%Z)%Z)%Z) -> ((f k) = (g k))) ->
  ((ang_add (ang_sum f l m) r) = (ang_sum g i j)).

Axiom vang_sum_right_extension_p :
  forall (f:Z -> angle) (g:Z -> angle) (i:Z) (j:Z) (l:Z) (m:Z) (r:angle),
  ((i + 1%Z)%Z < j)%Z -> (m = (j - 1%Z)%Z) -> (l = i) ->
  ((g (j - 1%Z)%Z) = r) ->
  (forall (k:Z), ((i <= k)%Z /\ (k < (j - 1%Z)%Z)%Z) -> ((f k) = (g k))) ->
  ((infix_asdt (ang_exp (ang_sum f l m)) (ang_exp r)) =
   (ang_exp (ang_sum g i j))).

Axiom vang_sum_right_extension_rev :
  forall (f:Z -> angle) (g:Z -> angle) (i:Z) (j:Z) (l:Z) (m:Z) (r:angle),
  ((i + 1%Z)%Z < j)%Z -> (m = (j - 1%Z)%Z) -> (l = i) ->
  ((g (j - 1%Z)%Z) = r) ->
  (forall (k:Z), ((i <= k)%Z /\ (k < (j - 1%Z)%Z)%Z) -> ((f k) = (g k))) ->
  ((ang_exp (ang_sum g i j)) =
   (infix_asdt (ang_exp (ang_sum f l m)) (ang_exp r))).

Axiom ang_sum_cardzero :
  forall (f:Z -> angle) (i:Z) (j:Z), (j <= i)%Z ->
  ((ang_sum f i j) = ang_zero).

Axiom ang_sum_eq_gen :
  forall (f:Z -> angle) (g:Z -> angle) (i:Z) (j:Z) (i':Z) (j':Z),
  (i < j)%Z -> (i = i') -> (j = j') ->
  (forall (k:Z), ((i <= k)%Z /\ (k < j)%Z) -> ((f k) = (g k))) ->
  ((ang_sum f i j) = (ang_sum g i' j')).

Axiom ang_sum_sum_eq_vl :
  forall (f:Z -> Z -> angle) (g:Z -> Z -> angle) (i:Z) (j:Z) (i':Z) (j':Z)
    (l:Z) (l':Z),
  (i < j)%Z -> (j <= l)%Z -> (i = i') -> (j = j') -> (l = l') ->
  (forall (x:Z) (x':Z), ((i <= x)%Z /\ (x < j)%Z) ->
   ((x <= x')%Z /\ (x' < l)%Z) -> (((f x) x') = ((g x) x'))) ->
  ((ang_sum (fun (x:Z) => (ang_sum (f x) x l)) i j) =
   (ang_sum (fun (x:Z) => (ang_sum (g x) x l')) i' j')).

Axiom ang_sum_minus :
  forall (f:Z -> Z) (i:Z) (j:Z) (n:Z), (n >= 0%Z)%Z -> (i < j)%Z ->
  ((ang_sum (fun (k:Z) => (int_to_ang (-(f k))%Z n)) i j) =
   (int_to_ang (-(ind_isum f i j))%Z n)).

Axiom multiple_control_as_ang_sum :
  forall (n:Z), (0%Z < n)%Z -> forall (x:bitvec), ((length x) = n) ->
  ((forall (j:Z), ((0%Z <= j)%Z /\ (j < n)%Z) -> (((getbv x) j) = 1%Z)) ->
   (ang_minus_one =
    (ang_mult_int ang_minus_one (ind_iproduct (getbv x) 0%Z n)))) /\
  (~ (forall (j:Z), ((0%Z <= j)%Z /\ (j < n)%Z) -> (((getbv x) j) = 1%Z)) ->
   (ang_zero = (ang_mult_int ang_minus_one (ind_iproduct (getbv x) 0%Z n)))).

Axiom multiple_control_as_ang_sum_rev :
  forall (n:Z), (0%Z < n)%Z -> forall (x:bitvec), ((length x) = n) ->
  ((forall (j:Z), ((0%Z <= j)%Z /\ (j < n)%Z) -> (((getbv x) j) = 1%Z)) ->
   ((ang_mult_int ang_minus_one (ind_iproduct (getbv x) 0%Z n)) =
    ang_minus_one)) /\
  (~ (forall (j:Z), ((0%Z <= j)%Z /\ (j < n)%Z) -> (((getbv x) j) = 1%Z)) ->
   ((ang_mult_int ang_minus_one (ind_iproduct (getbv x) 0%Z n)) = ang_zero)).

Axiom ang_sum_map :
  forall (i:Z) (j:Z) (k:Z) (l:Z) (f:Z -> Z) (t:Z -> angle), (i < j)%Z ->
  (p_bijective f (to_fset i j) (to_fset k l)) ->
  ((ang_sum t k l) = (ang_sum (fun (b:Z) => (t (f b))) i j)).

Axiom ang_sum_break :
  forall (f:Z -> angle) (i:Z) (j:Z) (y:Z), ((i <= y)%Z /\ (y <= j)%Z) ->
  ((ang_sum f i j) = (ang_add (ang_sum f i y) (ang_sum f y j))).

Axiom ang_sum_break_zero_l :
  forall (f:Z -> angle) (i:Z) (j:Z) (y:Z), ((i <= y)%Z /\ (y <= j)%Z) ->
  (forall (k:Z), ((i <= k)%Z /\ (k < y)%Z) -> ((f k) = ang_zero)) ->
  ((ang_sum f y j) = (ang_sum f i j)).

Axiom ang_sum_break_zero_lg :
  forall (f:Z -> angle) (g:Z -> angle) (i:Z) (j:Z) (y:Z),
  ((i <= y)%Z /\ (y <= j)%Z) ->
  (forall (k:Z), ((i <= k)%Z /\ (k < y)%Z) -> ((f k) = ang_zero)) ->
  (forall (k:Z), ((i <= k)%Z /\ (k < j)%Z) -> ((f k) = (g k))) ->
  ((ang_sum f y j) = (ang_sum g i j)).

Axiom ang_sum_break_zero_lg_params :
  forall (f:bitvec -> bitvec -> Z -> Z -> angle)
    (g:bitvec -> bitvec -> Z -> Z -> angle) (i:Z) (j:Z) (s:Z) (r:Z),
  (s >= 0%Z)%Z -> (r >= 0%Z)%Z ->
  (forall (x:bitvec) (z:bitvec), forall (a:Z) (k:Z), ((length x) = s) ->
   ((length z) = r) -> ((i <= a)%Z /\ (a < j)%Z) ->
   ((i <= k)%Z /\ (k < a)%Z) -> (((((g x) z) a) k) = ang_zero)) ->
  (forall (x:bitvec) (z:bitvec), forall (a:Z) (k:Z), ((length x) = s) ->
   ((length z) = r) -> ((i <= a)%Z /\ (a < j)%Z) ->
   ((a <= k)%Z /\ (k < j)%Z) -> (((((f x) z) a) k) = ((((g x) z) a) k))) ->
  forall (x:bitvec) (z:bitvec), forall (a:Z), ((length x) = s) ->
  ((length z) = r) -> ((i <= a)%Z /\ (a < j)%Z) ->
  ((ang_sum (fun (k:Z) => ((((f x) z) a) k)) a j) =
   (ang_sum (fun (k:Z) => ((((g x) z) a) k)) i j)).

Axiom ang_sum_break_zero_l_params :
  forall {a:Type} {a_WT:WhyType a},
  forall (f:a -> a -> Z -> angle) (g:a -> a -> Z -> angle) (i:Z) (j:Z) (l:Z),
  ((i <= l)%Z /\ (l <= j)%Z) -> forall (x:a) (y:a),
  (forall (k:Z), ((i <= k)%Z /\ (k < l)%Z) -> ((((f x) y) k) = ang_zero)) ->
  (forall (k:Z), ((i <= k)%Z /\ (k < j)%Z) ->
   ((((f x) y) k) = (((g x) y) k))) ->
  ((ang_sum ((g x) y) i j) = (ang_sum ((f x) y) l j)).

Axiom ang_sum_break_param :
  forall (f:Z -> Z -> angle) (i:Z) (j:Z), (i < j)%Z -> forall (y:Z),
  ((i <= y)%Z /\ (y < j)%Z) ->
  ((ang_sum (f y) i j) = (ang_add (ang_sum (f y) i y) (ang_sum (f y) y j))).

Axiom ang_sum_neutral_param_r :
  forall (f:Z -> Z -> angle) (i:Z) (j:Z), (i < j)%Z -> forall (y:Z),
  ((i <= y)%Z /\ (y < j)%Z) ->
  (forall (k:Z), ((y <= k)%Z /\ (k < j)%Z) -> (((f y) k) = ang_zero)) ->
  ((ang_sum (f y) y j) = ang_zero).

Axiom ang_sum_neutral_param_l :
  forall (f:Z -> Z -> angle) (i:Z) (j:Z), (i < j)%Z -> forall (y:Z),
  ((i <= y)%Z /\ (y < j)%Z) ->
  (forall (k:Z), ((i <= k)%Z /\ (k < y)%Z) -> (((f y) k) = ang_zero)) ->
  ((ang_sum (f y) i y) = ang_zero).

Axiom ang_sum_transl :
  forall (f:Z -> angle) (i:Z) (j:Z) (k:Z), (i < j)%Z ->
  ((ang_sum f i j) =
   (ang_sum (fun (b:Z) => (f (b + k)%Z)) (i - k)%Z (j - k)%Z)).

Axiom ang_sum_transl_one :
  forall (f:Z -> angle) (i:Z) (j:Z), (i < j)%Z ->
  ((ang_sum f i j) =
   (ang_sum (fun (b:Z) => (f (b - 1%Z)%Z)) (i + 1%Z)%Z (j + 1%Z)%Z)).

Axiom ang_sum_to_ind_isum :
  forall (f:Z -> Z) (n:Z) (i:Z) (j:Z), (0%Z <= n)%Z -> (i < j)%Z ->
  ((ang_sum (fun (k:Z) => (int_to_ang (f k) n)) i j) =
   (int_to_ang (ind_isum f i j) n)).

Axiom ind_isum_to_d_sum :
  forall (f:Z -> Z) (n:Z) (i:Z) (j:Z), (0%Z <= n)%Z -> (i < j)%Z ->
  ((int_to_ang (ind_isum f i j) n) =
   (ang_sum (fun (k:Z) => (int_to_ang (f k) n)) i j)).

Axiom ang_sum_int_decomp :
  forall (bvx:Z -> Z) (k:Z) (n:Z), (0%Z < n)%Z -> (binary bvx) ->
  ((ang_sum
    (fun (x:Z) =>
     (int_to_ang (((bvx x) * (power_ 2%Z ((n - x)%Z - 1%Z)%Z))%Z * k)%Z n))
    0%Z n)
   = (int_to_ang ((bin_to_int bvx n) * k)%Z n)).

Axiom ang_sum_int_decomp_gen :
  forall (bvx:Z -> Z) (n:Z), (0%Z < n)%Z -> (binary bvx) -> forall (k:Z),
  ((ang_sum
    (fun (x:Z) =>
     (int_to_ang (((bvx x) * (power_ 2%Z ((n - x)%Z - 1%Z)%Z))%Z * k)%Z n))
    0%Z n)
   = (int_to_ang ((bin_to_int bvx n) * k)%Z n)).

Axiom ang_sum_bv_to_int :
  forall (n:Z), (0%Z < n)%Z -> forall (x:bitvec), forall (k:Z),
  ((length x) = n) ->
  ((ang_sum
    (fun (i:Z) =>
     (int_to_ang ((((getbv x) i) * (power_ 2%Z ((n - i)%Z - 1%Z)%Z))%Z * k)%Z
      n))
    0%Z n)
   = (int_to_ang ((bv_to_int x) * k)%Z n)).

Axiom ang_sum_bv_to_int_ :
  forall (n:Z), (0%Z < n)%Z -> forall (x:bitvec), forall (k:Z),
  ((length x) = n) ->
  ((ang_sum
    (fun (i:Z) =>
     (int_to_ang ((((getbv x) i) * (power_ 2%Z ((n - i)%Z - 1%Z)%Z))%Z * k)%Z
      n))
    0%Z n)
   = (int_to_ang ((bv_to_int x) * k)%Z n)).

Axiom ang_sum_int_decomp_gen_rev :
  forall (bvx:Z -> Z) (n:Z), (0%Z < n)%Z -> (binary bvx) -> forall (k:Z),
  ((int_to_ang ((bin_to_int bvx n) * k)%Z n) =
   (ang_sum
    (fun (x:Z) =>
     (int_to_ang (((bvx x) * (power_ 2%Z ((n - x)%Z - 1%Z)%Z))%Z * k)%Z n))
    0%Z n)).

Axiom sum_ang_mult_int_e :
  forall (o:angle) (f:Z -> Z) (l:Z) (h:Z), (l < h)%Z ->
  ((ang_sum (fun (i:Z) => (ang_mult_int o (f i))) l h) =
   (ang_mult_int o (ind_isum f l h))).

Axiom real_to_ang_sum :
  forall (phi:Z -> complex) (l:Z) (h:Z), (l < h)%Z ->
  (forall (i:Z), ((l <= i)%Z /\ (i < h)%Z) -> real_ (phi i)) ->
  ((ang_sum (fun (i:Z) => (real_to_ang (phi i))) l h) =
   (real_to_ang (ind_sum phi l h))).

Axiom real_to_ang_sum_int :
  forall (f:Z -> Z) (l:Z) (h:Z) (x:complex), (l < h)%Z -> (real_ x) ->
  ((ang_sum (fun (i:Z) => (real_to_ang (infix_asdt x (i_to_c (f i))))) l h) =
   (real_to_ang (infix_asdt x (i_to_c (ind_isum f l h))))).

Axiom real_to_ang_sum_int_gen :
  forall (f:Z -> Z) (l:Z) (h:Z), (l < h)%Z -> forall (x:complex),
  (real_ x) ->
  ((ang_sum (fun (i:Z) => (real_to_ang (infix_asdt x (i_to_c (f i))))) l h) =
   (real_to_ang (infix_asdt x (i_to_c (ind_isum f l h))))).

Axiom real_to_ang_bv_inversion :
  forall (ft:Z) (x:complex) (y:bitvec), (0%Z < ft)%Z -> (real_ x) ->
  ((length y) = ft) ->
  ((ang_sum
    (fun (i:Z) =>
     (real_to_ang
      (infix_asdt (infix_asdt x (i_to_c (power_ 2%Z i)))
       (i_to_c ((getbv y) i)))))
    0%Z ft)
   = (real_to_ang (infix_asdt x (i_to_c (bv_to_int (bv_inversion y)))))).

Axiom sum_ang_mult_int :
  forall (f:Z -> angle) (i:Z) (l:Z) (h:Z), (l < h)%Z ->
  ((ang_sum (fun (x:Z) => (ang_mult_int (f x) i)) l h) =
   (ang_mult_int (ang_sum f l h) i)).

Axiom ang_sum_bv_to_int_inversion_pre :
  forall (n:Z) (x:bitvec), (0%Z < n)%Z -> ((length x) = n) ->
  forall (theta:complex), (real_ theta) ->
  ((real_to_ang (infix_asdt theta (i_to_c (bv_to_int (bv_inversion x))))) =
   (ang_sum
    (fun (i:Z) =>
     (real_to_ang
      (infix_asdt (infix_asdt theta (i_to_c (power_ 2%Z i)))
       (i_to_c ((getbv x) i)))))
    0%Z n)).

Axiom ang_sum_bv_to_int_inversion :
  forall (n:Z), (0%Z < n)%Z -> forall (x:bitvec), forall (theta:complex),
  ((length x) = n) -> (real_ theta) ->
  ((real_to_ang (infix_asdt theta (i_to_c (bv_to_int (bv_inversion x))))) =
   (ang_sum
    (fun (i:Z) =>
     (real_to_ang
      (infix_asdt (infix_asdt theta (i_to_c (power_ 2%Z i)))
       (i_to_c ((getbv x) i)))))
    0%Z n)).

Axiom ang_sum_bv_to_int_opp_pre :
  forall (n:Z) (x:bitvec), (0%Z < n)%Z -> ((length x) = n) ->
  forall (theta:complex), (real_ theta) ->
  ((real_to_ang (infix_asdt theta (i_to_c (-(bv_to_int x))%Z))) =
   (ang_sum
    (fun (i:Z) =>
     (real_to_ang
      (infix_asdt
       (infix_asdt theta (i_to_c (power_ 2%Z ((n - i)%Z - 1%Z)%Z)))
       (i_to_c (-((getbv x) i))%Z))))
    0%Z n)).

Axiom ang_sum_bv_to_int_opp :
  forall (n:Z), (0%Z < n)%Z -> forall (x:bitvec), forall (theta:complex),
  ((length x) = n) -> (real_ theta) ->
  ((real_to_ang (infix_asdt theta (i_to_c (-(bv_to_int x))%Z))) =
   (ang_sum
    (fun (i:Z) =>
     (real_to_ang
      (infix_asdt
       (infix_asdt theta (i_to_c (power_ 2%Z ((n - i)%Z - 1%Z)%Z)))
       (i_to_c (-((getbv x) i))%Z))))
    0%Z n)).

Axiom ang_sum_bv_to_int_mult_pre :
  forall (n:Z) (x:bitvec), (0%Z < n)%Z -> ((length x) = n) ->
  forall (theta:complex), (real_ theta) ->
  ((real_to_ang (infix_asdt theta (i_to_c (bv_to_int x)))) =
   (ang_sum
    (fun (i:Z) =>
     (real_to_ang
      (infix_asdt
       (infix_asdt theta (i_to_c (power_ 2%Z ((n - i)%Z - 1%Z)%Z)))
       (i_to_c ((getbv x) i)))))
    0%Z n)).

Axiom ang_sum_bv_to_int_mult :
  forall (n:Z), (0%Z < n)%Z -> forall (x:bitvec), forall (theta:complex),
  ((length x) = n) -> (real_ theta) ->
  ((real_to_ang (infix_asdt theta (i_to_c (bv_to_int x)))) =
   (ang_sum
    (fun (i:Z) =>
     (real_to_ang
      (infix_asdt
       (infix_asdt theta (i_to_c (power_ 2%Z ((n - i)%Z - 1%Z)%Z)))
       (i_to_c ((getbv x) i)))))
    0%Z n)).

Axiom rewrite_ang_sum_sum_to_bv_and_inversion :
  forall (n:Z) (x:bitvec) (y:bitvec), (0%Z < n)%Z -> ((length x) = n) ->
  ((length y) = n) ->
  ((ang_sum
    (fun (j:Z) =>
     (ang_sum
      (fun (i:Z) =>
       (int_to_ang
        (((-((getbv x) i))%Z * ((getbv y) j))%Z *
         (power_ 2%Z (((n - i)%Z - 1%Z)%Z + j)%Z))%Z
        n))
      j n))
    0%Z n)
   =
   (real_to_ang
    (infix_sldt
     (infix_asdt (i_to_c (-(bv_to_int x))%Z)
      (i_to_c (bv_to_int (bv_inversion y))))
     (i_to_c (power_ 2%Z n))))).

Axiom rewrite_ang_sum_sum_to_bv_and_inversion_gen :
  forall (n:Z), (0%Z < n)%Z -> forall (x:bitvec) (y:bitvec),
  ((length x) = n) -> ((length y) = n) ->
  ((ang_sum
    (fun (j:Z) =>
     (ang_sum
      (fun (i:Z) =>
       (int_to_ang
        (((-((getbv x) i))%Z * ((getbv y) j))%Z *
         (power_ 2%Z (((n - i)%Z - 1%Z)%Z + j)%Z))%Z
        n))
      j n))
    0%Z n)
   =
   (real_to_ang
    (infix_asdt
     (infix_asdt (i_to_c (-(bv_to_int x))%Z)
      (i_to_c (bv_to_int (bv_inversion y))))
     (pow_inv_2 n)))).

Axiom int_to_ang_by_sum_mult_break :
  forall (n:Z) (x:bitvec) (y:bitvec), (0%Z < n)%Z -> ((length x) = n) ->
  ((length y) = n) ->
  ((int_to_ang
    (ind_isum
     (fun (j:Z) =>
      (ind_isum
       (fun (i:Z) =>
        ((((getbv x) i) * ((getbv y) j))%Z *
         (power_ 2%Z (((n - i)%Z - 1%Z)%Z + j)%Z))%Z)
       j n))
     0%Z n)
    n)
   = (int_to_ang ((bv_to_int x) * (bv_to_int (bv_inversion y)))%Z n)).

Axiom int_to_ang_by_sum_mult_break_gen :
  forall (n:Z), (0%Z < n)%Z -> forall (x:bitvec) (y:bitvec),
  ((length x) = n) -> ((length y) = n) ->
  ((int_to_ang
    (ind_isum
     (fun (j:Z) =>
      (ind_isum
       (fun (i:Z) =>
        ((((getbv x) i) * ((getbv y) j))%Z *
         (power_ 2%Z (((n - i)%Z - 1%Z)%Z + j)%Z))%Z)
       j n))
     0%Z n)
    n)
   = (int_to_ang ((bv_to_int x) * (bv_to_int (bv_inversion y)))%Z n)).

Axiom int_to_ang_by_sum_mult_break_neg :
  forall (n:Z), (0%Z < n)%Z -> forall (x:bitvec) (y:bitvec),
  ((length x) = n) -> ((length y) = n) ->
  ((int_to_ang
    (ind_isum
     (fun (j:Z) =>
      (-(ind_isum
         (fun (i:Z) =>
          ((((getbv x) i) * ((getbv y) j))%Z *
           (power_ 2%Z (((n - i)%Z - 1%Z)%Z + j)%Z))%Z)
         j n))%Z)
     0%Z n)
    n)
   = (int_to_ang ((-(bv_to_int x))%Z * (bv_to_int (bv_inversion y)))%Z n)).

Parameter bv_check_zero: bitvec -> angle.

Axiom bv_check_zero_def :
  forall (x:bitvec), ((length x) = 0%Z) ->
  ((bv_check_zero x) = ang_minus_one).

Axiom bv_check_zero_def1 :
  forall (x:bitvec), ~ ((length x) = 0%Z) -> ((length x) = 1%Z) ->
  (((getbv x) 0%Z) = 1%Z) -> ((bv_check_zero x) = ang_minus_one).

Axiom bv_check_zero_def2 :
  forall (x:bitvec), ~ ((length x) = 0%Z) -> ((length x) = 1%Z) ->
  ~ (((getbv x) 0%Z) = 1%Z) -> ((bv_check_zero x) = ang_zero).

Axiom bv_check_zero_def3 :
  forall (x:bitvec), ~ ((length x) = 0%Z) -> ~ ((length x) = 1%Z) ->
  (((getbv x) 0%Z) = 1%Z) ->
  ((bv_check_zero x) = (bv_check_zero (tpart x 1%Z))).

Axiom bv_check_zero_def4 :
  forall (x:bitvec), ~ ((length x) = 0%Z) -> ~ ((length x) = 1%Z) ->
  ~ (((getbv x) 0%Z) = 1%Z) -> ((bv_check_zero x) = ang_zero).

Axiom bv_check_zero_spec :
  forall (x:bitvec),
  ((forall (j:Z), ((0%Z <= j)%Z /\ (j < (length x))%Z) ->
    (((getbv x) j) = 1%Z)) ->
   ((bv_check_zero x) = ang_minus_one)) /\
  (~ (forall (j:Z), ((0%Z <= j)%Z /\ (j < (length x))%Z) ->
      (((getbv x) j) = 1%Z)) ->
   ((bv_check_zero x) = ang_zero)).

Axiom bv_check_zero_int :
  forall (i:Z) (n:Z), (0%Z <= n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power_ 2%Z n))%Z) ->
  ((i = ((power_ 2%Z n) - 1%Z)%Z) ->
   ((bv_check_zero (int_to_bv i n)) = ang_minus_one)) /\
  (~ (i = ((power_ 2%Z n) - 1%Z)%Z) ->
   ((bv_check_zero (int_to_bv i n)) = ang_zero)).

Axiom bv_check_zero_plus_one :
  forall (x:bitvec), (1%Z < (length x))%Z ->
  ((((getbv x) 0%Z) = 1%Z) ->
   ((bv_check_zero x) = (bv_check_zero (tpart x 1%Z)))) /\
  (~ (((getbv x) 0%Z) = 1%Z) -> ((bv_check_zero x) = ang_zero)).

Axiom bv_check_zero_two :
  forall (x:bitvec), ((length x) = 2%Z) ->
  (((((getbv x) 0%Z) = ((getbv x) 1%Z)) /\ (((getbv x) 1%Z) = 1%Z)) ->
   ((bv_check_zero x) = ang_minus_one)) /\
  (~ ((((getbv x) 0%Z) = ((getbv x) 1%Z)) /\ (((getbv x) 1%Z) = 1%Z)) ->
   ((bv_check_zero x) = ang_zero)).

Axiom sum_ket_zero :
  forall (n:Z), (n >= 0%Z)%Z -> forall (y:bitvec),
  ((ang_sum
    (fun (i:Z) =>
     (int_to_ang (((getbv (ket_to_bv (ket n 0%Z))) i) * ((getbv y) i))%Z 1%Z))
    0%Z n)
   = ang_zero).

Parameter repeat_pps_had: Z -> pps.

Axiom repeat_pps_had_def :
  forall (n:Z), (n >= 1%Z)%Z -> (n = 1%Z) ->
  ((repeat_pps_had n) = pps_hadamard).

Axiom repeat_pps_had_def1 :
  forall (n:Z), (n >= 1%Z)%Z -> ~ (n = 1%Z) ->
  ((repeat_pps_had n) = (pps_par (repeat_pps_had (n - 1%Z)%Z) pps_hadamard)).

Axiom repeat_pps_had_spec :
  forall (n:Z), (n >= 1%Z)%Z -> ((h_width (repeat_pps_had n)) = n).

Axiom repeat_pps_had_spec1 :
  forall (n:Z), (n >= 1%Z)%Z -> ((h_range (repeat_pps_had n)) = n).

Axiom repeat_pps_had_spec2 :
  forall (n:Z), (n >= 1%Z)%Z -> forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
  ((0%Z <= i)%Z /\ (i < n)%Z) ->
  (((((h_basis_ket (repeat_pps_had n)) x) y) i) = (y i)).

Parameter fc23: (Z -> Z) -> (Z -> Z) -> Z -> angle.

Axiom fc_def23 :
  forall (x:Z -> Z) (y:Z -> Z) (i:Z),
  ((((x i) = (y i)) /\ ((y i) = 1%Z)) ->
   (((fc23 x y) i) = (int_to_ang 1%Z 1%Z))) /\
  (~ (((x i) = (y i)) /\ ((y i) = 1%Z)) ->
   (((fc23 x y) i) = (int_to_ang 0%Z 1%Z))).

Axiom repeat_pps_had_spec3 :
  forall (n:Z), (n >= 1%Z)%Z -> forall (x:Z -> Z) (y:Z -> Z),
  ((((h_angle (repeat_pps_had n)) x) y) = (ang_sum (fc23 x y) 0%Z n)).

Parameter kron_had_coeffs: Z -> Z -> Z -> complex.

Axiom kron_had_coeffs_def :
  forall (n:Z) (i:Z) (j:Z), (0%Z <= n)%Z ->
  ((kron_had_coeffs n i j) =
   (infix_asdt (pow_inv_sqrt_2 n)
    (cpower (prefix_mndt c_one)
     (ind_isum
      (fun (k:Z) =>
       (((getbv (int_to_bv i n)) k) * ((getbv (int_to_bv j n)) k))%Z)
      0%Z n)))).

Parameter superposition_state: Z -> matrix complex.

Axiom superposition_state_def :
  forall (n:Z), (n >= 1%Z)%Z ->
  ((superposition_state n) = (pps_apply (repeat_pps_had n) (ket n 0%Z))).

Axiom superposition_state_spec :
  forall (n:Z), (n >= 1%Z)%Z ->
  ((superposition_state n) =
   (infix_asdtdt (pow_inv_sqrt_2 n)
    (ket_sum_l (n_bvs n) (fun (y0:bitvec) => (bv_to_ket y0)) n))).

Axiom superposition_state_spec1 :
  forall (n:Z), (n >= 1%Z)%Z ->
  ((superposition_state n) =
   (infix_asdtdt (pow_inv_sqrt_2 n)
    (ket_sum_l (to_fset 0%Z (power_ 2%Z n))
     ((fun (y0:Z) (y1:Z) => (ket y0 y1)) n) n))).

Axiom superposition_state_spec2 :
  forall (n:Z), (n >= 1%Z)%Z -> is_a_ket_l (superposition_state n) n.

Axiom get_ket_superposition :
  forall (n:Z) (i:Z), (1%Z <= n)%Z ->
  ((0%Z <= i)%Z /\ (i < (power_ 2%Z n))%Z) ->
  ((get_ket (superposition_state n) i) =
   (infix_sldt c_one (square_rt (i_to_c (power_ 2%Z n))))).

Axiom repeat_had_twice_bv :
  forall (n:Z) (x:bitvec), (n >= 1%Z)%Z -> ((length x) = n) ->
  ((pps_apply (repeat_pps_had n)
    (pps_apply (repeat_pps_had n) (bv_to_ket x)))
   = (bv_to_ket x)).

Axiom repeat_had_twice_bv_gen :
  forall (n:Z), (n >= 1%Z)%Z -> forall (x:bitvec), ((length x) = n) ->
  ((pps_apply (repeat_pps_had n)
    (pps_apply (repeat_pps_had n) (bv_to_ket x)))
   = (bv_to_ket x)).

Axiom repeat_had_twice_ket :
  forall (n:Z), (n >= 1%Z)%Z -> forall (x:matrix complex),
  (is_a_ket_l x n) ->
  ((pps_apply (repeat_pps_had n) (pps_apply (repeat_pps_had n) x)) = x).

Axiom repeat_had_superposition :
  forall (n:Z), (n >= 1%Z)%Z ->
  ((pps_apply (repeat_pps_had n) (superposition_state n)) = (ket n 0%Z)).

Axiom path_sem_repeat_at_zero_bv :
  forall (n:Z) (x:bitvec), (n >= 1%Z)%Z -> ((length x) = n) ->
  ((get_ket (pps_apply (repeat_pps_had n) (bv_to_ket x)) 0%Z) =
   (pow_inv_sqrt_2 n)).

Axiom path_sem_repeat_at_zero :
  forall (n:Z) (x:matrix complex), (n >= 1%Z)%Z -> (is_a_ket_l x n) ->
  ((get_ket (pps_apply (repeat_pps_had n) x) 0%Z) =
   (infix_asdt (pow_inv_sqrt_2 n)
    (ind_sum ((fun (y0:matrix complex) (y1:Z) => (get_ket y0 y1)) x) 0%Z
     (power_ 2%Z n)))).

Axiom ket_sum_power_minus_one :
  forall (f:bitvec -> Z) (g:bitvec -> bitvec -> Z) (n:Z), (n >= 0%Z)%Z ->
  ((ket_sum_l (n_bvs n)
    (fun (x:bitvec) =>
     (infix_asdtdt (cpower (prefix_mndt c_one) (f x))
      (ket_sum_l (n_bvs n)
       (fun (y:bitvec) =>
        (infix_asdtdt (cpower (prefix_mndt c_one) ((g x) y)) (bv_to_ket y)))
       n)))
    n)
   =
   (ket_sum_l (n_bvs n)
    (fun (y:bitvec) =>
     (infix_asdtdt
      (sum (n_bvs n)
       (fun (x:bitvec) => (cpower (prefix_mndt c_one) (((g x) y) + (f x))%Z)))
      (bv_to_ket y)))
    n)).

Axiom path_sem_hadamard_zero :
  forall (x:matrix complex), (x = (qbit_zero tt)) ->
  ((path_sem hadamard x) = (qbit_plus tt)).

Axiom path_sem_hadamard_one :
  forall (x:matrix complex), (x = (qbit_one tt)) ->
  ((path_sem hadamard x) = (qbit_minus tt)).

Axiom path_sem_hadamard_plus :
  forall (x:matrix complex), (x = (qbit_plus tt)) ->
  ((path_sem hadamard x) = (qbit_zero tt)).

Axiom path_sem_hadamard_minus :
  forall (x:matrix complex), (x = (qbit_minus tt)) ->
  ((path_sem hadamard x) = (qbit_one tt)).

Axiom path_sem_cnot_basis :
  forall (x:matrix complex), (is_a_ket_l x 2%Z) -> (is_a_ket_basis_elt x) ->
  (((ket_to_int x) = 0%Z) -> ((path_sem cnot x) = (ket 2%Z 0%Z))) /\
  (~ ((ket_to_int x) = 0%Z) ->
   (((ket_to_int x) = 1%Z) -> ((path_sem cnot x) = (ket 2%Z 1%Z))) /\
   (~ ((ket_to_int x) = 1%Z) ->
    (((ket_to_int x) = 2%Z) -> ((path_sem cnot x) = (ket 2%Z 3%Z))) /\
    (~ ((ket_to_int x) = 2%Z) -> ((path_sem cnot x) = (ket 2%Z 2%Z))))).

Axiom path_sem_swap_basis :
  forall (x:matrix complex), (is_a_ket_l x 2%Z) -> (is_a_ket_basis_elt x) ->
  (((ket_to_int x) = 0%Z) -> ((path_sem swap x) = (ket 2%Z 0%Z))) /\
  (~ ((ket_to_int x) = 0%Z) ->
   (((ket_to_int x) = 1%Z) -> ((path_sem swap x) = (ket 2%Z 2%Z))) /\
   (~ ((ket_to_int x) = 1%Z) ->
    (((ket_to_int x) = 2%Z) -> ((path_sem swap x) = (ket 2%Z 1%Z))) /\
    (~ ((ket_to_int x) = 2%Z) -> ((path_sem swap x) = (ket 2%Z 3%Z))))).

Axiom hadamard_invol :
  forall (x:matrix complex), (is_a_ket_l x 1%Z) ->
  ((path_sem hadamard (path_sem hadamard x)) = x).

Parameter ancilla_g:
  circuit -> ((matrix complex) -> matrix complex) -> circuit.

Axiom ancilla_g_spec :
  forall (c:circuit) (path_sem_target:(matrix complex) -> matrix complex),
  (2%Z <= (width c))%Z ->
  (forall (x:matrix complex), (is_a_ket_l x ((width c) - 1%Z)%Z) ->
   ((path_sem c (kronecker x (ket 1%Z 0%Z))) =
    (kronecker (path_sem_target x) (ket 1%Z 0%Z)))) ->
  ((ancillas (ancilla_g c path_sem_target)) = ((ancillas c) + 1%Z)%Z).

Axiom ancilla_g_spec1 :
  forall (c:circuit) (path_sem_target:(matrix complex) -> matrix complex),
  (2%Z <= (width c))%Z ->
  (forall (x:matrix complex), (is_a_ket_l x ((width c) - 1%Z)%Z) ->
   ((path_sem c (kronecker x (ket 1%Z 0%Z))) =
    (kronecker (path_sem_target x) (ket 1%Z 0%Z)))) ->
  ((size (ancilla_g c path_sem_target)) = (size c)).

Axiom ancilla_g_spec2 :
  forall (c:circuit) (path_sem_target:(matrix complex) -> matrix complex),
  (2%Z <= (width c))%Z ->
  (forall (x:matrix complex), (is_a_ket_l x ((width c) - 1%Z)%Z) ->
   ((path_sem c (kronecker x (ket 1%Z 0%Z))) =
    (kronecker (path_sem_target x) (ket 1%Z 0%Z)))) ->
  ((range (ancilla_g c path_sem_target)) = (range c)).

Axiom ancilla_g_spec3 :
  forall (c:circuit) (path_sem_target:(matrix complex) -> matrix complex),
  (2%Z <= (width c))%Z ->
  (forall (x:matrix complex), (is_a_ket_l x ((width c) - 1%Z)%Z) ->
   ((path_sem c (kronecker x (ket 1%Z 0%Z))) =
    (kronecker (path_sem_target x) (ket 1%Z 0%Z)))) ->
  ((width (ancilla_g c path_sem_target)) = ((width c) - 1%Z)%Z).

Parameter fc24: circuit -> (Z -> Z) -> Z -> Z.

Axiom fc_def24 :
  forall (c:circuit) (x:Z -> Z) (k:Z),
  ((k = ((width c) - 1%Z)%Z) -> (((fc24 c x) k) = 0%Z)) /\
  (~ (k = ((width c) - 1%Z)%Z) -> (((fc24 c x) k) = (x k))).

Axiom ancilla_g_spec4 :
  forall (c:circuit) (path_sem_target:(matrix complex) -> matrix complex),
  (2%Z <= (width c))%Z ->
  (forall (x:matrix complex), (is_a_ket_l x ((width c) - 1%Z)%Z) ->
   ((path_sem c (kronecker x (ket 1%Z 0%Z))) =
    (kronecker (path_sem_target x) (ket 1%Z 0%Z)))) ->
  forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
  ((basis_ket (ancilla_g c path_sem_target) x y i) =
   (basis_ket c (fc24 c x) y i)).

Parameter fc25: circuit -> (Z -> Z) -> Z -> Z.

Axiom fc_def25 :
  forall (c:circuit) (x:Z -> Z) (k:Z),
  ((k = ((width c) - 1%Z)%Z) -> (((fc25 c x) k) = 0%Z)) /\
  (~ (k = ((width c) - 1%Z)%Z) -> (((fc25 c x) k) = (x k))).

Axiom ancilla_g_spec5 :
  forall (c:circuit) (path_sem_target:(matrix complex) -> matrix complex),
  (2%Z <= (width c))%Z ->
  (forall (x:matrix complex), (is_a_ket_l x ((width c) - 1%Z)%Z) ->
   ((path_sem c (kronecker x (ket 1%Z 0%Z))) =
    (kronecker (path_sem_target x) (ket 1%Z 0%Z)))) ->
  forall (x:Z -> Z) (y:Z -> Z),
  ((ang_ind (ancilla_g c path_sem_target) x y) = (ang_ind c (fc25 c x) y)).

Axiom ancilla_g_spec6 :
  forall (c:circuit) (path_sem_target:(matrix complex) -> matrix complex),
  (2%Z <= (width c))%Z ->
  (forall (x:matrix complex), (is_a_ket_l x ((width c) - 1%Z)%Z) ->
   ((path_sem c (kronecker x (ket 1%Z 0%Z))) =
    (kronecker (path_sem_target x) (ket 1%Z 0%Z)))) ->
  forall (x:matrix complex),
  (is_a_ket_l x (width (ancilla_g c path_sem_target))) ->
  ((kronecker (path_sem (ancilla_g c path_sem_target) x) (ket 1%Z 0%Z)) =
   (path_sem c (kronecker x (ket 1%Z 0%Z)))).

Axiom ancilla_g_spec7 :
  forall (c:circuit) (path_sem_target:(matrix complex) -> matrix complex),
  (2%Z <= (width c))%Z ->
  (forall (x:matrix complex), (is_a_ket_l x ((width c) - 1%Z)%Z) ->
   ((path_sem c (kronecker x (ket 1%Z 0%Z))) =
    (kronecker (path_sem_target x) (ket 1%Z 0%Z)))) ->
  forall (x:matrix complex),
  (is_a_ket_l x (width (ancilla_g c path_sem_target))) ->
  ((path_sem (ancilla_g c path_sem_target) x) = (path_sem_target x)).

Parameter ancilla_ket: circuit -> Z -> Z -> circuit.

Axiom ancilla_ket_spec :
  forall (c:circuit) (k:Z) (n:Z), ((width c) = n) ->
  ((0%Z < k)%Z /\ (k < n)%Z) ->
  (forall (x:matrix complex), (is_a_ket_l x (n - k)%Z) ->
   (is_a_ket_basis_elt x) ->
   exists y:matrix complex,
   ((path_sem c (kronecker x (ket 0%Z k))) = (kronecker y (ket 0%Z k)))) ->
  ((ancillas (ancilla_ket c k n)) = (k + (ancillas c))%Z).

Axiom ancilla_ket_spec1 :
  forall (c:circuit) (k:Z) (n:Z), ((width c) = n) ->
  ((0%Z < k)%Z /\ (k < n)%Z) ->
  (forall (x:matrix complex), (is_a_ket_l x (n - k)%Z) ->
   (is_a_ket_basis_elt x) ->
   exists y:matrix complex,
   ((path_sem c (kronecker x (ket 0%Z k))) = (kronecker y (ket 0%Z k)))) ->
  ((size (ancilla_ket c k n)) = (size c)).

Axiom ancilla_ket_spec2 :
  forall (c:circuit) (k:Z) (n:Z), ((width c) = n) ->
  ((0%Z < k)%Z /\ (k < n)%Z) ->
  (forall (x:matrix complex), (is_a_ket_l x (n - k)%Z) ->
   (is_a_ket_basis_elt x) ->
   exists y:matrix complex,
   ((path_sem c (kronecker x (ket 0%Z k))) = (kronecker y (ket 0%Z k)))) ->
  forall (x:matrix complex) (y:matrix complex), (is_a_ket_l x (n - k)%Z) ->
  ((path_sem c (kronecker x (ket k 0%Z))) = (kronecker y (ket k 0%Z))) ->
  ((path_sem (ancilla_ket c k n) x) = y).

Axiom ancilla_ket_spec3 :
  forall (c:circuit) (k:Z) (n:Z), ((width c) = n) ->
  ((0%Z < k)%Z /\ (k < n)%Z) ->
  (forall (x:matrix complex), (is_a_ket_l x (n - k)%Z) ->
   (is_a_ket_basis_elt x) ->
   exists y:matrix complex,
   ((path_sem c (kronecker x (ket 0%Z k))) = (kronecker y (ket 0%Z k)))) ->
  ((width (ancilla_ket c k n)) = (n - k)%Z).

Axiom correct_seq :
  forall (c:circuit) (c':circuit) (h:pps) (h':pps) (h'':pps),
  (correct_path_sum c h) -> (correct_path_sum c' h') ->
  ((width c) = (width c')) -> ((h_width h'') = (width c)) ->
  ((h_range h'') = ((h_range h) + (h_range h'))%Z) ->
  (forall (x:Z -> Z) (y:Z -> Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h''))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h''))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   ((((h_angle h'') x) y) =
    (ang_add (((h_angle h) x) y)
     (((h_angle h') (((h_basis_ket h) x) y))
      fun (k:Z) => (y (k + (h_range h))%Z))))) ->
  (forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h''))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h''))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   ((0%Z <= i)%Z /\ (i < (h_width h''))%Z) ->
   (((((h_basis_ket h'') x) y) i) =
    ((((h_basis_ket h') (((h_basis_ket h) x) y))
      fun (k:Z) => (y (k + (h_range h))%Z))
     i))) ->
  correct_path_sum (sequence c c') h''.

Axiom correct_par :
  forall (c:circuit) (c':circuit) (h:pps) (h':pps) (h'':pps),
  (correct_path_sum c h) -> (correct_path_sum c' h') ->
  ((h_width h'') = ((width c) + (width c'))%Z) ->
  ((h_range h'') = ((h_range h) + (h_range h'))%Z) ->
  (forall (x:Z -> Z) (y:Z -> Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h''))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h''))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   ((((h_angle h'') x) y) =
    (ang_add (((h_angle h) x) y)
     (((h_angle h') fun (k:Z) => (x (k + (h_width h))%Z))
      fun (k:Z) => (y (k + (h_range h))%Z))))) ->
  (forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h''))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h''))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   ((0%Z <= i)%Z /\ (i < (h_width h))%Z) ->
   (((((h_basis_ket h'') x) y) i) = ((((h_basis_ket h) x) y) i))) ->
  (forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h''))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h''))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   (((h_width h) <= i)%Z /\ (i < (h_width h''))%Z) ->
   (((((h_basis_ket h'') x) y) i) =
    ((((h_basis_ket h') fun (k:Z) => (x (k + (h_width h))%Z))
      fun (k:Z) => (y (k + (h_range h))%Z))
     (i - (h_width h))%Z))) ->
  correct_path_sum (parallel c c') h''.

Parameter sequence_ghost_pps:
  circuit -> circuit -> pps -> pps -> pps -> circuit.

Axiom sequence_ghost_pps_def :
  forall (c:circuit) (c':circuit) (h:pps) (h':pps) (h'':pps),
  (correct_path_sum c h) -> (correct_path_sum c' h') ->
  ((width c) = (width c')) -> ((h_width h'') = (width c)) ->
  ((h_range h'') = ((h_range h) + (h_range h'))%Z) ->
  (forall (x:Z -> Z) (y:Z -> Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h''))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h''))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   ((((h_angle h'') x) y) =
    (ang_add (((h_angle h) x) y)
     (((h_angle h') (((h_basis_ket h) x) y))
      fun (k:Z) => (y (k + (h_range h))%Z))))) ->
  (forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h''))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h''))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   ((0%Z <= i)%Z /\ (i < (h_width h''))%Z) ->
   (((((h_basis_ket h'') x) y) i) =
    ((((h_basis_ket h') (((h_basis_ket h) x) y))
      fun (k:Z) => (y (k + (h_range h))%Z))
     i))) ->
  ((sequence_ghost_pps c c' h h' h'') = (sequence c c')).

Axiom sequence_ghost_pps_spec :
  forall (c:circuit) (c':circuit) (h:pps) (h':pps) (h'':pps),
  (correct_path_sum c h) -> (correct_path_sum c' h') ->
  ((width c) = (width c')) -> ((h_width h'') = (width c)) ->
  ((h_range h'') = ((h_range h) + (h_range h'))%Z) ->
  (forall (x:Z -> Z) (y:Z -> Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h''))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h''))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   ((((h_angle h'') x) y) =
    (ang_add (((h_angle h) x) y)
     (((h_angle h') (((h_basis_ket h) x) y))
      fun (k:Z) => (y (k + (h_range h))%Z))))) ->
  (forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h''))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h''))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   ((0%Z <= i)%Z /\ (i < (h_width h''))%Z) ->
   (((((h_basis_ket h'') x) y) i) =
    ((((h_basis_ket h') (((h_basis_ket h) x) y))
      fun (k:Z) => (y (k + (h_range h))%Z))
     i))) ->
  ((width (sequence_ghost_pps c c' h h' h'')) = (width c)).

Axiom sequence_ghost_pps_spec1 :
  forall (c:circuit) (c':circuit) (h:pps) (h':pps) (h'':pps),
  (correct_path_sum c h) -> (correct_path_sum c' h') ->
  ((width c) = (width c')) -> ((h_width h'') = (width c)) ->
  ((h_range h'') = ((h_range h) + (h_range h'))%Z) ->
  (forall (x:Z -> Z) (y:Z -> Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h''))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h''))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   ((((h_angle h'') x) y) =
    (ang_add (((h_angle h) x) y)
     (((h_angle h') (((h_basis_ket h) x) y))
      fun (k:Z) => (y (k + (h_range h))%Z))))) ->
  (forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h''))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h''))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   ((0%Z <= i)%Z /\ (i < (h_width h''))%Z) ->
   (((((h_basis_ket h'') x) y) i) =
    ((((h_basis_ket h') (((h_basis_ket h) x) y))
      fun (k:Z) => (y (k + (h_range h))%Z))
     i))) ->
  ((size (sequence_ghost_pps c c' h h' h'')) = ((size c) + (size c'))%Z).

Axiom sequence_ghost_pps_spec2 :
  forall (c:circuit) (c':circuit) (h:pps) (h':pps) (h'':pps),
  (correct_path_sum c h) -> (correct_path_sum c' h') ->
  ((width c) = (width c')) -> ((h_width h'') = (width c)) ->
  ((h_range h'') = ((h_range h) + (h_range h'))%Z) ->
  (forall (x:Z -> Z) (y:Z -> Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h''))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h''))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   ((((h_angle h'') x) y) =
    (ang_add (((h_angle h) x) y)
     (((h_angle h') (((h_basis_ket h) x) y))
      fun (k:Z) => (y (k + (h_range h))%Z))))) ->
  (forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h''))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h''))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   ((0%Z <= i)%Z /\ (i < (h_width h''))%Z) ->
   (((((h_basis_ket h'') x) y) i) =
    ((((h_basis_ket h') (((h_basis_ket h) x) y))
      fun (k:Z) => (y (k + (h_range h))%Z))
     i))) ->
  ((ancillas (sequence_ghost_pps c c' h h' h'')) =
   (ZArith.BinInt.Z.max (ancillas c) (ancillas c'))).

Axiom sequence_ghost_pps_spec3 :
  forall (c:circuit) (c':circuit) (h:pps) (h':pps) (h'':pps),
  (correct_path_sum c h) -> (correct_path_sum c' h') ->
  ((width c) = (width c')) -> ((h_width h'') = (width c)) ->
  ((h_range h'') = ((h_range h) + (h_range h'))%Z) ->
  (forall (x:Z -> Z) (y:Z -> Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h''))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h''))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   ((((h_angle h'') x) y) =
    (ang_add (((h_angle h) x) y)
     (((h_angle h') (((h_basis_ket h) x) y))
      fun (k:Z) => (y (k + (h_range h))%Z))))) ->
  (forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h''))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h''))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   ((0%Z <= i)%Z /\ (i < (h_width h''))%Z) ->
   (((((h_basis_ket h'') x) y) i) =
    ((((h_basis_ket h') (((h_basis_ket h) x) y))
      fun (k:Z) => (y (k + (h_range h))%Z))
     i))) ->
  correct_path_sum (sequence_ghost_pps c c' h h' h'') h''.

Parameter parallel_ghost_pps:
  circuit -> circuit -> pps -> pps -> pps -> circuit.

Axiom parallel_ghost_pps_def :
  forall (c:circuit) (c':circuit) (h:pps) (h':pps) (h'':pps),
  (correct_path_sum c h) -> (correct_path_sum c' h') ->
  ((h_width h'') = ((width c) + (width c'))%Z) ->
  ((h_range h'') = ((h_range h) + (h_range h'))%Z) ->
  (forall (x:Z -> Z) (y:Z -> Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h''))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h''))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   ((((h_angle h'') x) y) =
    (ang_add (((h_angle h) x) y)
     (((h_angle h') fun (k:Z) => (x (k + (h_width h))%Z))
      fun (k:Z) => (y (k + (h_range h))%Z))))) ->
  (forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h''))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h''))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   ((0%Z <= i)%Z /\ (i < (h_width h))%Z) ->
   (((((h_basis_ket h'') x) y) i) = ((((h_basis_ket h) x) y) i))) ->
  (forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h''))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h''))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   (((h_width h) <= i)%Z /\ (i < (h_width h''))%Z) ->
   (((((h_basis_ket h'') x) y) i) =
    ((((h_basis_ket h') fun (k:Z) => (x (k + (h_width h))%Z))
      fun (k:Z) => (y (k + (h_range h))%Z))
     (i - (h_width h))%Z))) ->
  ((parallel_ghost_pps c c' h h' h'') = (parallel c c')).

Axiom parallel_ghost_pps_spec :
  forall (c:circuit) (c':circuit) (h:pps) (h':pps) (h'':pps),
  (correct_path_sum c h) -> (correct_path_sum c' h') ->
  ((h_width h'') = ((width c) + (width c'))%Z) ->
  ((h_range h'') = ((h_range h) + (h_range h'))%Z) ->
  (forall (x:Z -> Z) (y:Z -> Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h''))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h''))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   ((((h_angle h'') x) y) =
    (ang_add (((h_angle h) x) y)
     (((h_angle h') fun (k:Z) => (x (k + (h_width h))%Z))
      fun (k:Z) => (y (k + (h_range h))%Z))))) ->
  (forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h''))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h''))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   ((0%Z <= i)%Z /\ (i < (h_width h))%Z) ->
   (((((h_basis_ket h'') x) y) i) = ((((h_basis_ket h) x) y) i))) ->
  (forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h''))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h''))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   (((h_width h) <= i)%Z /\ (i < (h_width h''))%Z) ->
   (((((h_basis_ket h'') x) y) i) =
    ((((h_basis_ket h') fun (k:Z) => (x (k + (h_width h))%Z))
      fun (k:Z) => (y (k + (h_range h))%Z))
     (i - (h_width h))%Z))) ->
  correct_path_sum (parallel_ghost_pps c c' h h' h'') h''.

Axiom parallel_ghost_pps_spec1 :
  forall (c:circuit) (c':circuit) (h:pps) (h':pps) (h'':pps),
  (correct_path_sum c h) -> (correct_path_sum c' h') ->
  ((h_width h'') = ((width c) + (width c'))%Z) ->
  ((h_range h'') = ((h_range h) + (h_range h'))%Z) ->
  (forall (x:Z -> Z) (y:Z -> Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h''))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h''))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   ((((h_angle h'') x) y) =
    (ang_add (((h_angle h) x) y)
     (((h_angle h') fun (k:Z) => (x (k + (h_width h))%Z))
      fun (k:Z) => (y (k + (h_range h))%Z))))) ->
  (forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h''))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h''))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   ((0%Z <= i)%Z /\ (i < (h_width h))%Z) ->
   (((((h_basis_ket h'') x) y) i) = ((((h_basis_ket h) x) y) i))) ->
  (forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h''))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h''))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   (((h_width h) <= i)%Z /\ (i < (h_width h''))%Z) ->
   (((((h_basis_ket h'') x) y) i) =
    ((((h_basis_ket h') fun (k:Z) => (x (k + (h_width h))%Z))
      fun (k:Z) => (y (k + (h_range h))%Z))
     (i - (h_width h))%Z))) ->
  ((width (parallel_ghost_pps c c' h h' h'')) = ((width c) + (width c'))%Z).

Axiom parallel_ghost_pps_spec2 :
  forall (c:circuit) (c':circuit) (h:pps) (h':pps) (h'':pps),
  (correct_path_sum c h) -> (correct_path_sum c' h') ->
  ((h_width h'') = ((width c) + (width c'))%Z) ->
  ((h_range h'') = ((h_range h) + (h_range h'))%Z) ->
  (forall (x:Z -> Z) (y:Z -> Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h''))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h''))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   ((((h_angle h'') x) y) =
    (ang_add (((h_angle h) x) y)
     (((h_angle h') fun (k:Z) => (x (k + (h_width h))%Z))
      fun (k:Z) => (y (k + (h_range h))%Z))))) ->
  (forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h''))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h''))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   ((0%Z <= i)%Z /\ (i < (h_width h))%Z) ->
   (((((h_basis_ket h'') x) y) i) = ((((h_basis_ket h) x) y) i))) ->
  (forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h''))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h''))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   (((h_width h) <= i)%Z /\ (i < (h_width h''))%Z) ->
   (((((h_basis_ket h'') x) y) i) =
    ((((h_basis_ket h') fun (k:Z) => (x (k + (h_width h))%Z))
      fun (k:Z) => (y (k + (h_range h))%Z))
     (i - (h_width h))%Z))) ->
  ((size (parallel_ghost_pps c c' h h' h'')) = ((size c) + (size c'))%Z).

Axiom parallel_ghost_pps_spec3 :
  forall (c:circuit) (c':circuit) (h:pps) (h':pps) (h'':pps),
  (correct_path_sum c h) -> (correct_path_sum c' h') ->
  ((h_width h'') = ((width c) + (width c'))%Z) ->
  ((h_range h'') = ((h_range h) + (h_range h'))%Z) ->
  (forall (x:Z -> Z) (y:Z -> Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h''))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h''))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   ((((h_angle h'') x) y) =
    (ang_add (((h_angle h) x) y)
     (((h_angle h') fun (k:Z) => (x (k + (h_width h))%Z))
      fun (k:Z) => (y (k + (h_range h))%Z))))) ->
  (forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h''))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h''))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   ((0%Z <= i)%Z /\ (i < (h_width h))%Z) ->
   (((((h_basis_ket h'') x) y) i) = ((((h_basis_ket h) x) y) i))) ->
  (forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h''))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h''))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   (((h_width h) <= i)%Z /\ (i < (h_width h''))%Z) ->
   (((((h_basis_ket h'') x) y) i) =
    ((((h_basis_ket h') fun (k:Z) => (x (k + (h_width h))%Z))
      fun (k:Z) => (y (k + (h_range h))%Z))
     (i - (h_width h))%Z))) ->
  ((ancillas (parallel_ghost_pps c c' h h' h'')) =
   ((ancillas c) + (ancillas c'))%Z).

Parameter fc26: circuit -> (Z -> Z) -> Z -> Z.

Parameter fc27: circuit -> (Z -> Z) -> Z -> Z.

Axiom fc_def26 :
  forall (c:circuit) (x:Z -> Z) (k:Z),
  ((k = ((width c) - 1%Z)%Z) -> (((fc26 c x) k) = 0%Z)) /\
  (~ (k = ((width c) - 1%Z)%Z) -> (((fc26 c x) k) = (x k))).

Axiom fc_def27 :
  forall (c:circuit) (x:Z -> Z) (k:Z),
  ((k = ((width c) - 1%Z)%Z) -> (((fc27 c x) k) = 0%Z)) /\
  (~ (k = ((width c) - 1%Z)%Z) -> (((fc27 c x) k) = (x k))).

Axiom correct_ancilla :
  forall (c:circuit) (h:pps) (h':pps), (2%Z <= (width c))%Z ->
  (correct_path_sum c h) ->
  (exists path_sem_target:(matrix complex) -> matrix complex,
   forall (x:matrix complex), (is_a_ket_l x ((width c) - 1%Z)%Z) ->
   ((path_sem c (kronecker x (ket 1%Z 0%Z))) =
    (kronecker (path_sem_target x) (ket 1%Z 0%Z)))) ->
  ((h_width h') = ((width c) - 1%Z)%Z) -> ((h_range h') = (h_range h)) ->
  (forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_width h'))%Z) ->
    (0%Z <= (x j))%Z /\ ((x j) < 2%Z)%Z) ->
   (forall (j:Z), ((0%Z <= j)%Z /\ (j < (h_range h'))%Z) ->
    (0%Z <= (y j))%Z /\ ((y j) < 2%Z)%Z) ->
   (((((h_basis_ket h') x) y) i) = ((((h_basis_ket h) (fc26 c x)) y) i))) ->
  (forall (x:Z -> Z) (y:Z -> Z),
   ((((h_angle h') x) y) = (((h_angle h) (fc27 c x)) y))) ->
  correct_path_sum (ancilla c) h'.

Axiom set_correct_main_path_sum :
  forall (c:circuit) (h:pps), ((h_width h) = (width c)) ->
  ((h_range h) = (range c)) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width c)) ->
   ((length y) = (range c)) ->
   ((((h_angle h) (getbv x)) (getbv y)) = (ang_ind c (getbv x) (getbv y)))) ->
  (forall (x:bitvec) (y:bitvec), forall (i:Z),
   ((0%Z <= i)%Z /\ (i < (width c))%Z) -> ((length x) = (width c)) ->
   ((length y) = (range c)) ->
   (((((h_basis_ket h) (getbv x)) (getbv y)) i) =
    (basis_ket c (getbv x) (getbv y) i))) ->
  correct_path_sum c h.

Axiom set_path_sem_by_correct_pps :
  forall (c:circuit) (h:pps) (x:matrix complex), (correct_path_sum c h) ->
  (is_a_ket_l x (width c)) -> (is_a_ket_basis_elt x) ->
  ((path_sem c x) = (pps_apply h x)).

Axiom set_path_sem_by_main_pps :
  forall (c:circuit) (x:bitvec), ((length x) = (width c)) ->
  ((path_sem c (bv_to_ket x)) =
   (infix_asdtdt (pow_inv_sqrt_2 (range c))
    (ket_sum_l (n_bvs (range c))
     (fun (y:bitvec) =>
      (infix_asdtdt (ang_exp (ang_ind c (getbv x) (getbv y)))
       (bv_to_ket
        (make_bv
         ((((fun (y0:circuit) (y1:Z -> Z) (y2:Z -> Z) (y3:Z) =>
             (basis_ket y0 y1 y2 y3))
            c)
           (getbv x))
          (getbv y))
         (width c)))))
     (width c)))).

Axiom set_path_sem_by_correct_pps_gen :
  forall (c:circuit) (h:pps), (correct_path_sum c h) ->
  forall (x:matrix complex), (is_a_ket_l x (width c)) ->
  (is_a_ket_basis_elt x) -> ((path_sem c x) = (pps_apply h x)).

Axiom set_correct_pps :
  forall (c:circuit) (h:pps), ((h_width h) = (width c)) ->
  (forall (x:matrix complex), (is_a_ket_l x (width c)) ->
   (is_a_ket_basis_elt x) -> ((pps_apply h x) = (path_sem_basis c x))) ->
  correct_path_sum c h.

Axiom set_correct_path_sum_sim :
  forall (c:circuit) (h:pps) (h':pps), ((h_range h) = (h_range h')) ->
  ((h_width h) = (h_width h')) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width c)) ->
   ((length y) = (h_range h)) ->
   ((((h_angle h) (getbv x)) (getbv y)) =
    (((h_angle h') (getbv x)) (getbv y)))) ->
  (forall (x:bitvec) (y:bitvec), forall (i:Z), ((length x) = (width c)) ->
   ((length y) = (h_range h)) -> ((0%Z <= i)%Z /\ (i < (width c))%Z) ->
   (((((h_basis_ket h) (getbv x)) (getbv y)) i) =
    ((((h_basis_ket h') (getbv x)) (getbv y)) i))) ->
  (correct_path_sum c h) -> correct_path_sum c h'.

Axiom path_sum_equiv :
  forall (c:circuit) (h:pps) (h':pps), ((h_range h) >= 0%Z)%Z ->
  ((h_range h) = (h_range h')) -> ((h_width h) = (h_width h')) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width c)) ->
   ((length y) = (h_range h)) ->
   ((((h_angle h) (getbv x)) (getbv y)) =
    (((h_angle h') (getbv x)) (getbv y)))) ->
  (forall (x:bitvec) (y:bitvec), forall (i:Z),
   ((0%Z <= i)%Z /\ (i < (width c))%Z) -> ((length x) = (width c)) ->
   ((length y) = (h_range h)) ->
   ((((h_basis_ket h) (getbv x)) (getbv y)) =
    (((h_basis_ket h') (getbv x)) (getbv y)))) ->
  (correct_path_sum c h) -> correct_path_sum c h'.

Axiom path_sum_equiv1 :
  forall (c:circuit) (h:pps) (h':pps), ((h_range h) >= 0%Z)%Z ->
  ((h_range h) = (h_range h')) -> ((h_width h) = (h_width h')) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width c)) ->
   ((length y) = (h_range h)) ->
   ((((h_angle h) (getbv x)) (getbv y)) =
    (((h_angle h') (getbv x)) (getbv y)))) ->
  (forall (x:bitvec) (y:bitvec), forall (i:Z),
   ((0%Z <= i)%Z /\ (i < (width c))%Z) -> ((length x) = (width c)) ->
   ((length y) = (h_range h)) ->
   ((((h_basis_ket h) (getbv x)) (getbv y)) =
    (((h_basis_ket h') (getbv x)) (getbv y)))) ->
  (correct_path_sum c h') -> correct_path_sum c h.

Axiom correct_to_path_sem :
  forall (c:circuit) (h:pps), (correct_path_sum c h) ->
  forall (x:matrix complex), (is_a_ket_l x (width c)) ->
  ((pps_apply h x) = (path_sem c x)).

Axiom path_sem_to_correct :
  forall (c:circuit) (h:pps), ((h_width h) = (width c)) ->
  (forall (x:matrix complex), (is_a_ket_l x (width c)) ->
   (is_a_ket_basis_elt x) -> ((pps_apply h x) = (path_sem c x))) ->
  correct_path_sum c h.

Parameter correct_path_sum_bv:
  circuit -> Z -> (bitvec -> bitvec -> bitvec) ->
  (bitvec -> bitvec -> angle) -> Prop.

Axiom correct_path_sum_bv_spec :
  forall (c:circuit) (r:Z) (k:bitvec -> bitvec -> bitvec)
    (a:bitvec -> bitvec -> angle),
  (forall (x:bitvec) (y:bitvec), ((length x) = (width c)) ->
   ((length y) = r) -> ((length ((k x) y)) = (width c))) ->
  (correct_path_sum_bv c r k a) ->
  correct_path_sum c (build_pps_bv (width c) r k a).

Axiom correct_path_sum_bv_spec1 :
  forall (c:circuit) (r:Z) (k:bitvec -> bitvec -> bitvec)
    (a:bitvec -> bitvec -> angle),
  (forall (x:bitvec) (y:bitvec), ((length x) = (width c)) ->
   ((length y) = r) -> ((length ((k x) y)) = (width c))) ->
  (correct_path_sum c (build_pps_bv (width c) r k a)) ->
  correct_path_sum_bv c r k a.

Axiom correct_path_sum_to_bv :
  forall (c:circuit) (r:Z) (k:bitvec -> bitvec -> bitvec)
    (a:bitvec -> bitvec -> angle),
  (forall (x:bitvec) (y:bitvec), ((length x) = (width c)) ->
   ((length y) = r) -> ((length ((k x) y)) = (width c))) ->
  (correct_path_sum c (build_pps_bv (width c) r k a)) ->
  correct_path_sum_bv c r k a.

Axiom correct_path_sum_by_bv :
  forall (c:circuit) (r:Z) (k:bitvec -> bitvec -> bitvec)
    (a:bitvec -> bitvec -> angle),
  (forall (x:bitvec) (y:bitvec), ((length x) = (width c)) ->
   ((length y) = r) -> ((length ((k x) y)) = (width c))) ->
  (correct_path_sum_bv c r k a) ->
  correct_path_sum c (build_pps_bv (width c) r k a).

Axiom correct_path_sum_bv_main :
  forall (c:circuit) (r:Z) (k:bitvec -> bitvec -> bitvec)
    (a:bitvec -> bitvec -> angle),
  (forall (x:bitvec) (y:bitvec), ((length x) = (width c)) ->
   ((length y) = r) -> ((length ((k x) y)) = (width c))) ->
  (forall (x:bitvec) (y:bitvec), forall (i:Z), ((length x) = (width c)) ->
   ((length y) = r) -> ((0%Z <= i)%Z /\ (i < (width c))%Z) ->
   (((getbv ((k x) y)) i) = (basis_ket c (getbv x) (getbv y) i))) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width c)) ->
   ((length y) = r) -> (((a x) y) = (ang_ind c (getbv x) (getbv y)))) ->
  (r = (range c)) -> correct_path_sum_bv c r k a.

Axiom correct_path_sum_bv_apply :
  forall (c:circuit) (r:Z) (k:bitvec -> bitvec -> bitvec)
    (a:bitvec -> bitvec -> angle) (x:bitvec),
  (forall (x1:bitvec) (y:bitvec), ((length x1) = (width c)) ->
   ((length y) = r) -> ((length ((k x1) y)) = (width c))) ->
  ((length x) = (width c)) -> (correct_path_sum_bv c r k a) ->
  ((path_sem c (bv_to_ket x)) =
   (infix_asdtdt (pow_inv_sqrt_2 r)
    (ket_sum_l (n_bvs r)
     (fun (y:bitvec) =>
      (infix_asdtdt (ang_exp ((a x) y)) (bv_to_ket ((k x) y))))
     (width c)))).

Parameter seq_pps_bv:
  circuit -> circuit -> Z -> Z -> Z -> (bitvec -> bitvec -> bitvec) ->
  (bitvec -> bitvec -> bitvec) -> (bitvec -> bitvec -> bitvec) ->
  (bitvec -> bitvec -> angle) -> (bitvec -> bitvec -> angle) ->
  (bitvec -> bitvec -> angle) -> circuit.

Axiom seq_pps_bv_spec :
  forall (c:circuit) (c':circuit) (r1:Z) (r2:Z) (r3:Z)
    (k1:bitvec -> bitvec -> bitvec) (k2:bitvec -> bitvec -> bitvec)
    (k3:bitvec -> bitvec -> bitvec) (a1:bitvec -> bitvec -> angle)
    (a2:bitvec -> bitvec -> angle) (a3:bitvec -> bitvec -> angle),
  (forall (x:bitvec) (y:bitvec), ((length x) = (width c)) ->
   ((length y) = r1) -> ((length ((k1 x) y)) = (width c))) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width c)) ->
   ((length y) = r2) -> ((length ((k2 x) y)) = (width c))) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width c)) ->
   ((length y) = r3) -> ((length ((k3 x) y)) = (width c))) ->
  ((width c) = (width c')) -> (r3 = (r1 + r2)%Z) ->
  (correct_path_sum_bv c r1 k1 a1) -> (correct_path_sum_bv c' r2 k2 a2) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width c)) ->
   ((length y) = r3) ->
   (((a3 x) y) =
    (ang_add ((a1 x) (hpart y r1)) ((a2 ((k1 x) (hpart y r1))) (tpart y r1))))) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width c)) ->
   ((length y) = r3) ->
   (((k3 x) y) = ((k2 ((k1 x) (hpart y r1))) (tpart y r1)))) ->
  ((seq_pps_bv c c' r1 r2 r3 k1 k2 k3 a1 a2 a3) = (sequence c c')).

Axiom seq_pps_bv_spec1 :
  forall (c:circuit) (c':circuit) (r1:Z) (r2:Z) (r3:Z)
    (k1:bitvec -> bitvec -> bitvec) (k2:bitvec -> bitvec -> bitvec)
    (k3:bitvec -> bitvec -> bitvec) (a1:bitvec -> bitvec -> angle)
    (a2:bitvec -> bitvec -> angle) (a3:bitvec -> bitvec -> angle),
  (forall (x:bitvec) (y:bitvec), ((length x) = (width c)) ->
   ((length y) = r1) -> ((length ((k1 x) y)) = (width c))) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width c)) ->
   ((length y) = r2) -> ((length ((k2 x) y)) = (width c))) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width c)) ->
   ((length y) = r3) -> ((length ((k3 x) y)) = (width c))) ->
  ((width c) = (width c')) -> (r3 = (r1 + r2)%Z) ->
  (correct_path_sum_bv c r1 k1 a1) -> (correct_path_sum_bv c' r2 k2 a2) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width c)) ->
   ((length y) = r3) ->
   (((a3 x) y) =
    (ang_add ((a1 x) (hpart y r1)) ((a2 ((k1 x) (hpart y r1))) (tpart y r1))))) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width c)) ->
   ((length y) = r3) ->
   (((k3 x) y) = ((k2 ((k1 x) (hpart y r1))) (tpart y r1)))) ->
  ((width (seq_pps_bv c c' r1 r2 r3 k1 k2 k3 a1 a2 a3)) = (width c)).

Axiom seq_pps_bv_spec2 :
  forall (c:circuit) (c':circuit) (r1:Z) (r2:Z) (r3:Z)
    (k1:bitvec -> bitvec -> bitvec) (k2:bitvec -> bitvec -> bitvec)
    (k3:bitvec -> bitvec -> bitvec) (a1:bitvec -> bitvec -> angle)
    (a2:bitvec -> bitvec -> angle) (a3:bitvec -> bitvec -> angle),
  (forall (x:bitvec) (y:bitvec), ((length x) = (width c)) ->
   ((length y) = r1) -> ((length ((k1 x) y)) = (width c))) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width c)) ->
   ((length y) = r2) -> ((length ((k2 x) y)) = (width c))) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width c)) ->
   ((length y) = r3) -> ((length ((k3 x) y)) = (width c))) ->
  ((width c) = (width c')) -> (r3 = (r1 + r2)%Z) ->
  (correct_path_sum_bv c r1 k1 a1) -> (correct_path_sum_bv c' r2 k2 a2) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width c)) ->
   ((length y) = r3) ->
   (((a3 x) y) =
    (ang_add ((a1 x) (hpart y r1)) ((a2 ((k1 x) (hpart y r1))) (tpart y r1))))) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width c)) ->
   ((length y) = r3) ->
   (((k3 x) y) = ((k2 ((k1 x) (hpart y r1))) (tpart y r1)))) ->
  ((size (seq_pps_bv c c' r1 r2 r3 k1 k2 k3 a1 a2 a3)) =
   ((size c) + (size c'))%Z).

Axiom seq_pps_bv_spec3 :
  forall (c:circuit) (c':circuit) (r1:Z) (r2:Z) (r3:Z)
    (k1:bitvec -> bitvec -> bitvec) (k2:bitvec -> bitvec -> bitvec)
    (k3:bitvec -> bitvec -> bitvec) (a1:bitvec -> bitvec -> angle)
    (a2:bitvec -> bitvec -> angle) (a3:bitvec -> bitvec -> angle),
  (forall (x:bitvec) (y:bitvec), ((length x) = (width c)) ->
   ((length y) = r1) -> ((length ((k1 x) y)) = (width c))) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width c)) ->
   ((length y) = r2) -> ((length ((k2 x) y)) = (width c))) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width c)) ->
   ((length y) = r3) -> ((length ((k3 x) y)) = (width c))) ->
  ((width c) = (width c')) -> (r3 = (r1 + r2)%Z) ->
  (correct_path_sum_bv c r1 k1 a1) -> (correct_path_sum_bv c' r2 k2 a2) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width c)) ->
   ((length y) = r3) ->
   (((a3 x) y) =
    (ang_add ((a1 x) (hpart y r1)) ((a2 ((k1 x) (hpart y r1))) (tpart y r1))))) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width c)) ->
   ((length y) = r3) ->
   (((k3 x) y) = ((k2 ((k1 x) (hpart y r1))) (tpart y r1)))) ->
  ((ancillas (seq_pps_bv c c' r1 r2 r3 k1 k2 k3 a1 a2 a3)) =
   (ZArith.BinInt.Z.max (ancillas c) (ancillas c'))).

Axiom seq_pps_bv_spec4 :
  forall (c:circuit) (c':circuit) (r1:Z) (r2:Z) (r3:Z)
    (k1:bitvec -> bitvec -> bitvec) (k2:bitvec -> bitvec -> bitvec)
    (k3:bitvec -> bitvec -> bitvec) (a1:bitvec -> bitvec -> angle)
    (a2:bitvec -> bitvec -> angle) (a3:bitvec -> bitvec -> angle),
  (forall (x:bitvec) (y:bitvec), ((length x) = (width c)) ->
   ((length y) = r1) -> ((length ((k1 x) y)) = (width c))) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width c)) ->
   ((length y) = r2) -> ((length ((k2 x) y)) = (width c))) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width c)) ->
   ((length y) = r3) -> ((length ((k3 x) y)) = (width c))) ->
  ((width c) = (width c')) -> (r3 = (r1 + r2)%Z) ->
  (correct_path_sum_bv c r1 k1 a1) -> (correct_path_sum_bv c' r2 k2 a2) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width c)) ->
   ((length y) = r3) ->
   (((a3 x) y) =
    (ang_add ((a1 x) (hpart y r1)) ((a2 ((k1 x) (hpart y r1))) (tpart y r1))))) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width c)) ->
   ((length y) = r3) ->
   (((k3 x) y) = ((k2 ((k1 x) (hpart y r1))) (tpart y r1)))) ->
  correct_path_sum_bv (seq_pps_bv c c' r1 r2 r3 k1 k2 k3 a1 a2 a3) r3 k3 a3.

Axiom correct_path_sum_bv_sim :
  forall (c:circuit) (r1:Z) (k1:bitvec -> bitvec -> bitvec)
    (a1:bitvec -> bitvec -> angle) (r2:Z) (k2:bitvec -> bitvec -> bitvec)
    (a2:bitvec -> bitvec -> angle),
  (r1 = r2) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width c)) ->
   ((length y) = r1) -> ((length ((k1 x) y)) = (width c))) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width c)) ->
   ((length y) = r1) -> (((k1 x) y) = ((k2 x) y))) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width c)) ->
   ((length y) = r1) -> (((a1 x) y) = ((a2 x) y))) ->
  (correct_path_sum_bv c r1 k1 a1) -> correct_path_sum_bv c r2 k2 a2.

Parameter reverse: circuit -> circuit.

Axiom reverse_spec :
  forall (c:circuit), ((ancillas c) = 0%Z) ->
  ((width (reverse c)) = (width c)).

Axiom reverse_spec1 :
  forall (c:circuit), ((ancillas c) = 0%Z) -> ((size (reverse c)) = (size c)).

Axiom reverse_spec2 :
  forall (c:circuit), ((ancillas c) = 0%Z) -> ((ancillas (reverse c)) = 0%Z).

Axiom reverse_spec3 :
  forall (c:circuit), ((ancillas c) = 0%Z) ->
  forall (x:matrix complex) (y:matrix complex), (is_a_ket_l x (width c)) ->
  (is_a_ket_l y (width c)) -> ((path_sem c x) = y) ->
  ((path_sem (reverse c) y) = x).

Axiom reverse_spec4 :
  forall (c:circuit), ((ancillas c) = 0%Z) ->
  forall (x:matrix complex) (y:matrix complex), (is_a_ket_l x (width c)) ->
  (is_a_ket_l y (width c)) -> ((path_sem (reverse c) y) = x) ->
  ((path_sem c x) = y).

Axiom reverse_spec5 :
  forall (c:circuit), ((ancillas c) = 0%Z) ->
  forall (x:matrix complex) (y:matrix complex), (sem c x y) ->
  sem (reverse c) y x.

Axiom reverse_spec6 :
  forall (c:circuit), ((ancillas c) = 0%Z) ->
  forall (x:matrix complex) (y:matrix complex), (sem (reverse c) y x) ->
  sem c x y.

Axiom path_sem_reverse :
  forall (c:circuit) (x:matrix complex) (y:matrix complex),
  (is_a_ket_l x (width c)) -> ((path_sem c x) = y) ->
  ((path_sem (reverse c) y) = x).

Parameter ids: Z -> circuit.

Axiom ids_spec : forall (n:Z), (1%Z <= n)%Z -> ((width (ids n)) = n).

Axiom ids_spec1 : forall (n:Z), (1%Z <= n)%Z -> ((size (ids n)) = 0%Z).

Axiom ids_spec2 : forall (n:Z), (1%Z <= n)%Z -> ((ancillas (ids n)) = 0%Z).

Axiom ids_spec3 : forall (n:Z), (1%Z <= n)%Z -> ((range (ids n)) = 0%Z).

Axiom ids_spec4 :
  forall (n:Z), (1%Z <= n)%Z -> forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
  ((basis_ket (ids n) x y i) = (x i)).

Axiom ids_spec5 :
  forall (n:Z), (1%Z <= n)%Z -> forall (x:Z -> Z) (y:Z -> Z),
  ((ang_ind (ids n) x y) = ang_zero).

Axiom ids_spec6 :
  forall (n:Z), (1%Z <= n)%Z -> forall (x:matrix complex),
  (is_a_ket_l x n) -> (is_a_ket_basis_elt x) -> ((path_sem (ids n) x) = x).

Axiom ids_spec7 :
  forall (n:Z), (1%Z <= n)%Z -> forall (x:matrix complex),
  (is_a_ket_l x n) -> ((path_sem (ids n) x) = x).

Parameter place: circuit -> Z -> Z -> circuit.

Axiom place_spec :
  forall (c:circuit) (k:Z) (n:Z), (0%Z <= k)%Z ->
  (((width c) + k)%Z <= n)%Z -> ((ancillas (place c k n)) = (ancillas c)).

Axiom place_spec1 :
  forall (c:circuit) (k:Z) (n:Z), (0%Z <= k)%Z ->
  (((width c) + k)%Z <= n)%Z -> ((size (place c k n)) = (size c)).

Axiom place_spec2 :
  forall (c:circuit) (k:Z) (n:Z), (0%Z <= k)%Z ->
  (((width c) + k)%Z <= n)%Z -> ((range (place c k n)) = (range c)).

Axiom place_spec3 :
  forall (c:circuit) (k:Z) (n:Z), (0%Z <= k)%Z ->
  (((width c) + k)%Z <= n)%Z -> ((width (place c k n)) = n).

Axiom place_spec4 :
  forall (c:circuit) (k:Z) (n:Z), (0%Z <= k)%Z ->
  (((width c) + k)%Z <= n)%Z -> forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
  ((0%Z <= i)%Z /\ (i < n)%Z) ->
  (((k <= i)%Z /\ (i < (k + (width c))%Z)%Z) ->
   ((basis_ket (place c k n) x y i) =
    (basis_ket c (fun (j:Z) => (x (j + k)%Z)) y (i - k)%Z))) /\
  (~ ((k <= i)%Z /\ (i < (k + (width c))%Z)%Z) ->
   ((basis_ket (place c k n) x y i) = (x i))).

Axiom place_spec5 :
  forall (c:circuit) (k:Z) (n:Z), (0%Z <= k)%Z ->
  (((width c) + k)%Z <= n)%Z -> forall (x:Z -> Z) (y:Z -> Z),
  ((ang_ind (place c k n) x y) = (ang_ind c (fun (j:Z) => (x (j + k)%Z)) y)).

Axiom place_spec6 :
  forall (c:circuit) (k:Z) (n:Z), (0%Z <= k)%Z ->
  (((width c) + k)%Z <= n)%Z ->
  (((k = 0%Z) /\ (n = (k + (width c))%Z)) -> ((place c k n) = c)) /\
  (~ ((k = 0%Z) /\ (n = (k + (width c))%Z)) ->
   ((k = 0%Z) ->
    ((place c k n) = (parallel c (ids ((n - k)%Z - (width c))%Z)))) /\
   (~ (k = 0%Z) ->
    ((n = (k + (width c))%Z) -> ((place c k n) = (parallel (ids k) c))) /\
    (~ (n = (k + (width c))%Z) ->
     ((place c k n) =
      (parallel (ids k) (parallel c (ids ((n - k)%Z - (width c))%Z))))))).

Axiom place_kron :
  forall (c:circuit) (k:Z) (n:Z) (x:matrix complex) (y:matrix complex)
    (y':matrix complex) (z:matrix complex),
  (0%Z < k)%Z -> (((width c) + k)%Z < n)%Z -> (is_a_ket_l x k) ->
  (is_a_ket_l y (width c)) -> (is_a_ket_l z ((n - (width c))%Z - k)%Z) ->
  ((path_sem c y) = y') ->
  ((path_sem (place c k n) (kronecker x (kronecker y z))) =
   (kronecker x (kronecker y' z))).

Axiom place_kron_left :
  forall (c:circuit) (n:Z) (y:matrix complex) (y':matrix complex)
    (z:matrix complex),
  ((width c) < n)%Z -> (is_a_ket_l y (width c)) ->
  (is_a_ket_l z (n - (width c))%Z) -> ((path_sem c y) = y') ->
  ((path_sem (place c 0%Z n) (kronecker y z)) = (kronecker y' z)).

Axiom place_kron_right :
  forall (c:circuit) (k:Z) (n:Z), (0%Z < k)%Z -> (n = ((width c) + k)%Z) ->
  forall (y:matrix complex) (x:matrix complex), (is_a_ket_l x k) ->
  (is_a_ket_l y (n - k)%Z) ->
  ((path_sem (place c k n) (kronecker x y)) = (kronecker x (path_sem c y))).

Axiom place_kron_gen :
  forall (c:circuit) (k:Z) (n:Z) (x:bitvec), (0%Z <= k)%Z ->
  (((width c) + k)%Z <= n)%Z -> ((length x) = n) ->
  ((k = 0%Z) ->
   ((n = (width c)) ->
    ((path_sem (place c k n) (bv_to_ket x)) = (path_sem c (bv_to_ket x)))) /\
   (~ (n = (width c)) ->
    ((path_sem (place c k n) (bv_to_ket x)) =
     (kronecker (path_sem c (bv_to_ket (hpart x (width c))))
      (bv_to_ket (tpart x (width c))))))) /\
  (~ (k = 0%Z) ->
   ((n = (k + (width c))%Z) ->
    ((path_sem (place c k n) (bv_to_ket x)) =
     (kronecker (bv_to_ket (hpart x k)) (path_sem c (bv_to_ket (tpart x k)))))) /\
   (~ (n = (k + (width c))%Z) ->
    ((path_sem (place c k n) (bv_to_ket x)) =
     (kronecker (bv_to_ket (hpart x k))
      (kronecker (path_sem c (bv_to_ket (htpart x k (width c))))
       (bv_to_ket (tpart x ((width c) + k)%Z))))))).

Axiom place_get_ket :
  forall (c:circuit) (k:Z) (n:Z) (x:bitvec) (y:bitvec), (0%Z <= k)%Z ->
  (((width c) + k)%Z <= n)%Z -> ((length x) = n) -> ((length y) = n) ->
  ((hpart x k) = (hpart y k)) ->
  ((tpart x (k + (width c))%Z) = (tpart y (k + (width c))%Z)) ->
  ((get_ket (path_sem (place c k n) (bv_to_ket x)) (bv_to_int y)) =
   (get_ket
    (path_sem c
     (bv_to_ket (make_bv (fun (i:Z) => ((getbv x) (i + k)%Z)) (width c))))
    (bv_to_int (make_bv (fun (i:Z) => ((getbv y) (i + k)%Z)) (width c))))).

Axiom place_get_ket_hpart_null :
  forall (c:circuit) (k:Z) (n:Z) (x:bitvec) (y:bitvec), (0%Z <= k)%Z ->
  (((width c) + k)%Z <= n)%Z -> ((length x) = n) -> ((length y) = n) ->
  ~ ((hpart x k) = (hpart y k)) ->
  ((get_ket (path_sem (place c k n) (bv_to_ket x)) (bv_to_int y)) = c_zero).

Axiom place_get_ket_tpart_null :
  forall (c:circuit) (k:Z) (n:Z) (x:bitvec) (y:bitvec), (0%Z <= k)%Z ->
  (((width c) + k)%Z <= n)%Z -> ((length x) = n) -> ((length y) = n) ->
  ~ ((tpart x (k + (width c))%Z) = (tpart y (k + (width c))%Z)) ->
  ((get_ket (path_sem (place c k n) (bv_to_ket x)) (bv_to_int y)) = c_zero).

Parameter place_hadamard: Z -> Z -> circuit.

Axiom place_hadamard_spec :
  forall (k:Z) (n:Z), ((0%Z <= k)%Z /\ (k < n)%Z) ->
  ((range (place_hadamard k n)) = 1%Z).

Axiom place_hadamard_spec1 :
  forall (k:Z) (n:Z), ((0%Z <= k)%Z /\ (k < n)%Z) ->
  ((width (place_hadamard k n)) = n).

Axiom place_hadamard_spec2 :
  forall (k:Z) (n:Z), ((0%Z <= k)%Z /\ (k < n)%Z) ->
  ((size (place_hadamard k n)) = 1%Z).

Axiom place_hadamard_spec3 :
  forall (k:Z) (n:Z), ((0%Z <= k)%Z /\ (k < n)%Z) ->
  ((ancillas (place_hadamard k n)) = 0%Z).

Axiom place_hadamard_spec4 :
  forall (k:Z) (n:Z), ((0%Z <= k)%Z /\ (k < n)%Z) ->
  forall (x:Z -> Z) (y:Z -> Z), forall (i:Z), ((0%Z <= i)%Z /\ (i < n)%Z) ->
  ((i = k) -> ((basis_ket (place_hadamard k n) x y i) = (y 0%Z))) /\
  (~ (i = k) -> ((basis_ket (place_hadamard k n) x y i) = (x i))).

Axiom place_hadamard_spec5 :
  forall (k:Z) (n:Z), ((0%Z <= k)%Z /\ (k < n)%Z) ->
  forall (x:Z -> Z) (y:Z -> Z),
  ((((x k) = (y 0%Z)) /\ ((y 0%Z) = 1%Z)) ->
   ((ang_ind (place_hadamard k n) x y) = ang_minus_one)) /\
  (~ (((x k) = (y 0%Z)) /\ ((y 0%Z) = 1%Z)) ->
   ((ang_ind (place_hadamard k n) x y) = ang_zero)).

Axiom place_hadamard_spec6 :
  forall (k:Z) (n:Z), ((0%Z <= k)%Z /\ (k < n)%Z) ->
  forall (x:Z -> Z) (y:Z -> Z), forall (m:Z), (m >= 1%Z)%Z ->
  ((((x k) = (y 0%Z)) /\ ((y 0%Z) = 1%Z)) ->
   ((ang_ind (place_hadamard k n) x y) =
    (int_to_ang (((x k) * (y 0%Z))%Z * (power_ 2%Z (m - 1%Z)%Z))%Z m))) /\
  (~ (((x k) = (y 0%Z)) /\ ((y 0%Z) = 1%Z)) ->
   ((ang_ind (place_hadamard k n) x y) = ang_zero)).

Parameter place_hadamard_bv: Z -> Z -> circuit.

Axiom place_hadamard_bv_def :
  forall (k:Z) (n:Z), ((0%Z <= k)%Z /\ (k < n)%Z) ->
  ((place_hadamard_bv k n) = (place_hadamard k n)).

Axiom place_hadamard_bv_spec :
  forall (k:Z) (n:Z), ((0%Z <= k)%Z /\ (k < n)%Z) ->
  ((range (place_hadamard_bv k n)) = 1%Z).

Axiom place_hadamard_bv_spec1 :
  forall (k:Z) (n:Z), ((0%Z <= k)%Z /\ (k < n)%Z) ->
  ((width (place_hadamard_bv k n)) = n).

Axiom place_hadamard_bv_spec2 :
  forall (k:Z) (n:Z), ((0%Z <= k)%Z /\ (k < n)%Z) ->
  ((size (place_hadamard_bv k n)) = 1%Z).

Axiom place_hadamard_bv_spec3 :
  forall (k:Z) (n:Z), ((0%Z <= k)%Z /\ (k < n)%Z) ->
  ((ancillas (place_hadamard_bv k n)) = 0%Z).

Axiom place_hadamard_bv_spec4 :
  forall (k:Z) (n:Z), ((0%Z <= k)%Z /\ (k < n)%Z) ->
  forall (x:Z -> Z) (y:Z -> Z), forall (i:Z), ((0%Z <= i)%Z /\ (i < n)%Z) ->
  ((i = k) -> ((basis_ket (place_hadamard_bv k n) x y i) = (y 0%Z))) /\
  (~ (i = k) -> ((basis_ket (place_hadamard_bv k n) x y i) = (x i))).

Axiom place_hadamard_bv_spec5 :
  forall (k:Z) (n:Z), ((0%Z <= k)%Z /\ (k < n)%Z) ->
  forall (x:Z -> Z) (y:Z -> Z),
  ((((x k) = (y 0%Z)) /\ ((y 0%Z) = 1%Z)) ->
   ((ang_ind (place_hadamard_bv k n) x y) = ang_minus_one)) /\
  (~ (((x k) = (y 0%Z)) /\ ((y 0%Z) = 1%Z)) ->
   ((ang_ind (place_hadamard_bv k n) x y) = ang_zero)).

Axiom place_hadamard_bv_spec6 :
  forall (k:Z) (n:Z), ((0%Z <= k)%Z /\ (k < n)%Z) ->
  forall (x:Z -> Z) (y:Z -> Z), forall (m:Z), (m >= 1%Z)%Z ->
  ((((x k) = (y 0%Z)) /\ ((y 0%Z) = 1%Z)) ->
   ((ang_ind (place_hadamard_bv k n) x y) =
    (int_to_ang (((x k) * (y 0%Z))%Z * (power_ 2%Z (m - 1%Z)%Z))%Z m))) /\
  (~ (((x k) = (y 0%Z)) /\ ((y 0%Z) = 1%Z)) ->
   ((ang_ind (place_hadamard_bv k n) x y) = ang_zero)).

Parameter fc28: Z -> bitvec -> bitvec -> Z -> Z.

Axiom fc_def28 :
  forall (k:Z) (x:bitvec) (y:bitvec) (i:Z),
  ((i = k) -> (((fc28 k x y) i) = ((getbv y) 0%Z))) /\
  (~ (i = k) -> (((fc28 k x y) i) = ((getbv x) i))).

Axiom place_hadamard_bv_spec7 :
  forall (k:Z) (n:Z), ((0%Z <= k)%Z /\ (k < n)%Z) ->
  correct_path_sum_bv (place_hadamard_bv k n) 1%Z
  (fun (x:bitvec) (y:bitvec) => (make_bv (fc28 k x y) n))
  (fun (x:bitvec) (y:bitvec) =>
   (int_to_ang
    ((((getbv x) k) * ((getbv y) 0%Z))%Z * (power_ 2%Z (n - 1%Z)%Z))%Z n)).

Axiom place_place :
  forall (c:circuit) (k:Z) (k':Z) (n:Z) (n':Z) (x:bitvec), (0%Z <= k)%Z ->
  (((width c) + k)%Z <= n)%Z -> (0%Z <= k')%Z -> ((n + k')%Z <= n')%Z ->
  ((length x) = n') ->
  ((path_sem (place (place c k n) k' n') (bv_to_ket x)) =
   (path_sem (place c (k + k')%Z n') (bv_to_ket x))).

Parameter qbit_permutes: circuit -> Prop.

Axiom qbit_permutes_spec :
  forall (c:circuit), (qbit_permutes c) -> ((size c) = 0%Z).

Axiom qbit_permutes_spec1 :
  forall (c:circuit), (qbit_permutes c) -> ((ancillas c) = 0%Z).

Axiom qbit_permutes_spec2 :
  forall (c:circuit), (qbit_permutes c) -> ((range c) = 0%Z).

Axiom qbit_permutes_spec3 :
  forall (c:circuit), (qbit_permutes c) -> forall (x:Z -> Z) (y:Z -> Z),
  ((ang_ind c x y) = ang_zero).

Parameter qbit_permutation: circuit -> Z -> Z.

Axiom qbit_permutation_spec :
  forall (c:circuit), (qbit_permutes c) -> forall (x:Z -> Z) (y:Z -> Z),
  forall (i:Z), ((0%Z <= i)%Z /\ (i < (width c))%Z) ->
  ((basis_ket c x y i) = (x ((qbit_permutation c) i))).

Axiom qbit_permutation_spec1 :
  forall (c:circuit), (qbit_permutes c) ->
  p_bijective (qbit_permutation c) (to_fset 0%Z (width c))
  (to_fset 0%Z (width c)).

Parameter permute_atom: Z -> Z -> Z -> circuit.

Axiom permute_atom_spec :
  forall (k:Z) (fk:Z) (n:Z), ((0%Z <= k)%Z /\ (k < n)%Z) ->
  ((0%Z <= fk)%Z /\ (fk < n)%Z) -> ((size (permute_atom k fk n)) = 0%Z).

Axiom permute_atom_spec1 :
  forall (k:Z) (fk:Z) (n:Z), ((0%Z <= k)%Z /\ (k < n)%Z) ->
  ((0%Z <= fk)%Z /\ (fk < n)%Z) -> ((width (permute_atom k fk n)) = n).

Axiom permute_atom_spec2 :
  forall (k:Z) (fk:Z) (n:Z), ((0%Z <= k)%Z /\ (k < n)%Z) ->
  ((0%Z <= fk)%Z /\ (fk < n)%Z) -> qbit_permutes (permute_atom k fk n).

Axiom permute_atom_spec3 :
  forall (k:Z) (fk:Z) (n:Z), ((0%Z <= k)%Z /\ (k < n)%Z) ->
  ((0%Z <= fk)%Z /\ (fk < n)%Z) ->
  (((qbit_permutation (permute_atom k fk n)) k) = fk).

Axiom permute_atom_spec4 :
  forall (k:Z) (fk:Z) (n:Z), ((0%Z <= k)%Z /\ (k < n)%Z) ->
  ((0%Z <= fk)%Z /\ (fk < n)%Z) ->
  (((qbit_permutation (permute_atom k fk n)) fk) = k).

Axiom permute_atom_spec5 :
  forall (k:Z) (fk:Z) (n:Z), ((0%Z <= k)%Z /\ (k < n)%Z) ->
  ((0%Z <= fk)%Z /\ (fk < n)%Z) -> forall (i:Z),
  ((0%Z <= i)%Z /\ (i < n)%Z) -> ~ (i = k) -> ~ (i = fk) ->
  (((qbit_permutation (permute_atom k fk n)) i) = i).

Parameter permutation_circuit: Z -> (Z -> Z) -> circuit.

Axiom permutation_circuit_spec :
  forall (n:Z) (f:Z -> Z), (0%Z < n)%Z ->
  (p_bijective f (to_fset 0%Z n) (to_fset 0%Z n)) ->
  ((size (permutation_circuit n f)) = 0%Z).

Axiom permutation_circuit_spec1 :
  forall (n:Z) (f:Z -> Z), (0%Z < n)%Z ->
  (p_bijective f (to_fset 0%Z n) (to_fset 0%Z n)) ->
  ((width (permutation_circuit n f)) = n).

Axiom permutation_circuit_spec2 :
  forall (n:Z) (f:Z -> Z), (0%Z < n)%Z ->
  (p_bijective f (to_fset 0%Z n) (to_fset 0%Z n)) ->
  qbit_permutes (permutation_circuit n f).

Axiom permutation_circuit_spec3 :
  forall (n:Z) (f:Z -> Z), (0%Z < n)%Z ->
  (p_bijective f (to_fset 0%Z n) (to_fset 0%Z n)) -> forall (i:Z),
  ((0%Z <= i)%Z /\ (i < n)%Z) ->
  (((qbit_permutation (permutation_circuit n f)) i) = (f i)).

Axiom permutation_circuit_spec4 :
  forall (n:Z) (f:Z -> Z), (0%Z < n)%Z ->
  (p_bijective f (to_fset 0%Z n) (to_fset 0%Z n)) -> forall (i:Z),
  ((0%Z <= i)%Z /\ (i < n)%Z) ->
  (((qbit_permutation (permutation_circuit n f))
    (inv_func f (to_fset 0%Z n) (to_fset 0%Z n) i))
   = i).

Parameter with_permutation: circuit -> (Z -> Z) -> circuit.

Axiom with_permutation_spec :
  forall (c:circuit) (f:Z -> Z),
  (p_bijective f (to_fset 0%Z (width c)) (to_fset 0%Z (width c))) ->
  ((size (with_permutation c f)) = (size c)).

Axiom with_permutation_spec1 :
  forall (c:circuit) (f:Z -> Z),
  (p_bijective f (to_fset 0%Z (width c)) (to_fset 0%Z (width c))) ->
  ((ancillas (with_permutation c f)) = (ancillas c)).

Axiom with_permutation_spec2 :
  forall (c:circuit) (f:Z -> Z),
  (p_bijective f (to_fset 0%Z (width c)) (to_fset 0%Z (width c))) ->
  ((width (with_permutation c f)) = (width c)).

Axiom with_permutation_spec3 :
  forall (c:circuit) (f:Z -> Z),
  (p_bijective f (to_fset 0%Z (width c)) (to_fset 0%Z (width c))) ->
  ((range (with_permutation c f)) = (range c)).

Axiom with_permutation_spec4 :
  forall (c:circuit) (f:Z -> Z),
  (p_bijective f (to_fset 0%Z (width c)) (to_fset 0%Z (width c))) ->
  forall (x:Z -> Z) (y:Z -> Z),
  ((ang_ind (with_permutation c f) x y) =
   (ang_ind c (fun (i:Z) => (x (f i))) y)).

Axiom with_permutation_spec5 :
  forall (c:circuit) (f:Z -> Z),
  (p_bijective f (to_fset 0%Z (width c)) (to_fset 0%Z (width c))) ->
  forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
  ((0%Z <= i)%Z /\ (i < (width c))%Z) ->
  ((basis_ket (with_permutation c f) x y i) =
   (basis_ket c (fun (i1:Z) => (x (f i1))) y
    ((inv_f f (to_fset 0%Z (width c)) (to_fset 0%Z (width c))) i))).

Axiom with_permutation_spec6 :
  forall (c:circuit) (f:Z -> Z),
  (p_bijective f (to_fset 0%Z (width c)) (to_fset 0%Z (width c))) ->
  forall (x:Z -> Z) (y:Z -> Z), forall (i:Z),
  ((0%Z <= i)%Z /\ (i < (width c))%Z) ->
  ((basis_ket (with_permutation c f)
    (fun (i1:Z) =>
     (x ((inv_f f (to_fset 0%Z (width c)) (to_fset 0%Z (width c))) i1)))
    y i)
   =
   (basis_ket c x y
    ((inv_f f (to_fset 0%Z (width c)) (to_fset 0%Z (width c))) i))).

Axiom with_permutation_get_ket :
  forall (c:circuit) (f:Z -> Z) (x:bitvec) (y:bitvec),
  ((length x) = (width c)) -> ((length y) = (width c)) ->
  (p_bijective f (to_fset 0%Z (width c)) (to_fset 0%Z (width c))) ->
  ((get_ket (path_sem (with_permutation c f) (bv_to_ket x)) (bv_to_int y)) =
   (get_ket
    (path_sem c
     (bv_to_ket (make_bv (fun (i:Z) => ((getbv x) (f i))) (width c))))
    (bv_to_int (make_bv (fun (i:Z) => ((getbv y) (f i))) (width c))))).

Parameter fc29: Z -> Z -> Z -> Z.

Axiom fc_def29 :
  forall (k:Z) (n:Z) (i:Z),
  ((i < k)%Z -> (((fc29 k n) i) = ((i + n)%Z - k)%Z)) /\
  (~ (i < k)%Z -> (((fc29 k n) i) = (i - k)%Z)).

Axiom with_permutation_kronecker :
  forall (c:circuit) (im_c:matrix complex) (im_d:matrix complex)
    (ant_c:matrix complex) (ant_d:matrix complex) (k:Z) (n:Z),
  ((width c) = n) -> ((0%Z <= k)%Z /\ (k < n)%Z) -> (is_a_ket_l im_c k) ->
  (is_a_ket_l im_d (n - k)%Z) -> (is_a_ket_l ant_c k) ->
  (is_a_ket_l ant_d (n - k)%Z) -> (is_a_ket_basis_elt ant_c) ->
  (is_a_ket_basis_elt ant_d) ->
  ((path_sem c (kronecker ant_c ant_d)) = (kronecker im_c im_d)) ->
  ((path_sem (with_permutation c (fc29 k n)) (kronecker ant_d ant_c)) =
   (kronecker im_d im_c)).

Parameter cont_size: Z.

Axiom cont_size_def : (0%Z < cont_size)%Z.

Parameter cont_zero: circuit -> circuit.

Axiom cont_zero_spec :
  forall (c:circuit), ((size (cont_zero c)) <= ((size c) * cont_size)%Z)%Z.

Axiom cont_zero_spec1 :
  forall (c:circuit), ((ancillas (cont_zero c)) = (ancillas c)).

Axiom cont_zero_spec2 :
  forall (c:circuit), ((range (cont_zero c)) = (range c)).

Axiom cont_zero_spec3 :
  forall (c:circuit), ((width (cont_zero c)) = ((width c) + 1%Z)%Z).

Axiom cont_zero_spec4 :
  forall (c:circuit), forall (bv:bitvec),
  ((length bv) = ((width c) + 1%Z)%Z) -> (((getbv bv) 0%Z) = 0%Z) ->
  ((path_sem (cont_zero c) (bv_to_ket bv)) = (bv_to_ket bv)).

Axiom cont_zero_spec5 :
  forall (c:circuit), forall (bv:bitvec),
  ((length bv) = ((width c) + 1%Z)%Z) -> (((getbv bv) 0%Z) = 1%Z) ->
  ((path_sem (cont_zero c) (bv_to_ket bv)) =
   (path_sem (place c 1%Z ((width c) + 1%Z)%Z) (bv_to_ket bv))).

Axiom cont_zero_path_sem_kron :
  forall (c:circuit) (x:bitvec), ((length x) = (width c)) ->
  ((path_sem (cont_zero c) (kronecker (ket 1%Z 0%Z) (bv_to_ket x))) =
   (kronecker (ket 1%Z 0%Z) (bv_to_ket x))).

Axiom cont_zero_path_sem_kron1 :
  forall (c:circuit) (x:bitvec), ((length x) = (width c)) ->
  ((path_sem (cont_zero c) (kronecker (ket 1%Z 1%Z) (bv_to_ket x))) =
   (kronecker (ket 1%Z 1%Z) (path_sem c (bv_to_ket x)))).

Parameter cont_last_qbit: circuit -> circuit.

Axiom cont_last_qbit_spec :
  forall (c:circuit),
  ((size (cont_last_qbit c)) <= ((size c) * cont_size)%Z)%Z.

Axiom cont_last_qbit_spec1 :
  forall (c:circuit), ((ancillas (cont_last_qbit c)) = (ancillas c)).

Axiom cont_last_qbit_spec2 :
  forall (c:circuit), ((range (cont_last_qbit c)) = (range c)).

Axiom cont_last_qbit_spec3 :
  forall (c:circuit), ((width (cont_last_qbit c)) = ((width c) + 1%Z)%Z).

Axiom cont_last_qbit_spec4 :
  forall (c:circuit), forall (bv:bitvec),
  ((length bv) = ((width c) + 1%Z)%Z) -> (((getbv bv) (width c)) = 0%Z) ->
  ((path_sem (cont_last_qbit c) (bv_to_ket bv)) = (bv_to_ket bv)).

Axiom cont_last_qbit_spec5 :
  forall (c:circuit), forall (bv:bitvec),
  ((length bv) = ((width c) + 1%Z)%Z) -> (((getbv bv) (width c)) = 1%Z) ->
  ((path_sem (cont_last_qbit c) (bv_to_ket bv)) =
   (path_sem (place c 0%Z ((width c) + 1%Z)%Z) (bv_to_ket bv))).

Parameter cont_last_qbit_kron: circuit -> circuit.

Axiom cont_last_qbit_kron_spec :
  forall (c:circuit),
  ((size (cont_last_qbit_kron c)) <= ((size c) * cont_size)%Z)%Z.

Axiom cont_last_qbit_kron_spec1 :
  forall (c:circuit), ((ancillas (cont_last_qbit_kron c)) = (ancillas c)).

Axiom cont_last_qbit_kron_spec2 :
  forall (c:circuit), ((range (cont_last_qbit_kron c)) = (range c)).

Axiom cont_last_qbit_kron_spec3 :
  forall (c:circuit), ((width (cont_last_qbit_kron c)) = ((width c) + 1%Z)%Z).

Axiom cont_last_qbit_kron_spec4 :
  forall (c:circuit), forall (x:matrix complex) (y:matrix complex),
  (sem c x y) ->
  sem (cont_last_qbit_kron c) (kronecker x (ket 1%Z 0%Z))
  (kronecker x (ket 1%Z 0%Z)).

Axiom cont_last_qbit_kron_spec5 :
  forall (c:circuit), forall (x:matrix complex) (y:matrix complex),
  (sem c x y) ->
  sem (cont_last_qbit_kron c) (kronecker x (ket 1%Z 1%Z))
  (kronecker y (ket 1%Z 1%Z)).

Parameter cont: circuit -> Z -> Z -> Z -> circuit.

Axiom cont_spec :
  forall (c:circuit) (co:Z) (k:Z) (n:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) -> ~ (k <= co)%Z ->
  ((size (cont c co k n)) <= ((size c) * cont_size)%Z)%Z.

Axiom cont_spec1 :
  forall (c:circuit) (co:Z) (k:Z) (n:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) -> ~ (k <= co)%Z ->
  ((ancillas (cont c co k n)) = (ancillas c)).

Axiom cont_spec2 :
  forall (c:circuit) (co:Z) (k:Z) (n:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) -> ~ (k <= co)%Z ->
  ((range (cont c co k n)) = (range c)).

Axiom cont_spec3 :
  forall (c:circuit) (co:Z) (k:Z) (n:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) -> ~ (k <= co)%Z ->
  ((width (cont c co k n)) = n).

Axiom cont_spec4 :
  forall (c:circuit) (co:Z) (k:Z) (n:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) -> ~ (k <= co)%Z ->
  forall (bv:bitvec), ((length bv) = n) -> (((getbv bv) co) = 0%Z) ->
  ((path_sem (cont c co k n) (bv_to_ket bv)) = (bv_to_ket bv)).

Axiom cont_spec5 :
  forall (c:circuit) (co:Z) (k:Z) (n:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) -> ~ (k <= co)%Z ->
  forall (bv:bitvec), ((length bv) = n) -> (((getbv bv) co) = 1%Z) ->
  ((path_sem (cont c co k n) (bv_to_ket bv)) =
   (path_sem (place c k n) (bv_to_ket bv))).

Axiom cont_spec6 :
  forall (c:circuit) (co:Z) (k:Z) (n:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) ->
  ((k + (width c))%Z <= co)%Z ->
  ((size (cont c co k n)) <= ((size c) * cont_size)%Z)%Z.

Axiom cont_spec7 :
  forall (c:circuit) (co:Z) (k:Z) (n:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) ->
  ((k + (width c))%Z <= co)%Z -> ((ancillas (cont c co k n)) = (ancillas c)).

Axiom cont_spec8 :
  forall (c:circuit) (co:Z) (k:Z) (n:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) ->
  ((k + (width c))%Z <= co)%Z -> ((range (cont c co k n)) = (range c)).

Axiom cont_spec9 :
  forall (c:circuit) (co:Z) (k:Z) (n:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) ->
  ((k + (width c))%Z <= co)%Z -> ((width (cont c co k n)) = n).

Axiom cont_spec10 :
  forall (c:circuit) (co:Z) (k:Z) (n:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) ->
  ((k + (width c))%Z <= co)%Z -> forall (bv:bitvec), ((length bv) = n) ->
  (((getbv bv) co) = 0%Z) ->
  ((path_sem (cont c co k n) (bv_to_ket bv)) = (bv_to_ket bv)).

Axiom cont_spec11 :
  forall (c:circuit) (co:Z) (k:Z) (n:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) ->
  ((k + (width c))%Z <= co)%Z -> forall (bv:bitvec), ((length bv) = n) ->
  (((getbv bv) co) = 1%Z) ->
  ((path_sem (cont c co k n) (bv_to_ket bv)) =
   (path_sem (place c k n) (bv_to_ket bv))).

Axiom size_cont :
  forall (c:circuit) (co:Z) (k:Z) (n:Z) (s:Z),
  ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) -> ~ (k <= co)%Z ->
  ((size c) <= s)%Z -> ((size (cont c co k n)) <= (cont_size * s)%Z)%Z.

Axiom size_cont1 :
  forall (c:circuit) (co:Z) (k:Z) (n:Z) (s:Z),
  ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) ->
  ((k + (width c))%Z <= co)%Z -> ((size c) <= s)%Z ->
  ((size (cont c co k n)) <= (cont_size * s)%Z)%Z.

Axiom path_cont :
  forall (c:circuit) (co:Z) (k:Z) (n:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) -> ~ (k <= co)%Z ->
  forall (bv:bitvec), ((length bv) = n) -> (((getbv bv) co) = 0%Z) ->
  ((path_sem (cont c co k n) (bv_to_ket bv)) = (bv_to_ket bv)).

Axiom path_cont1 :
  forall (c:circuit) (co:Z) (k:Z) (n:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) -> ~ (k <= co)%Z ->
  forall (bv:bitvec), ((length bv) = n) -> (((getbv bv) co) = 1%Z) ->
  ((path_sem (cont c co k n) (bv_to_ket bv)) =
   (path_sem (place c k n) (bv_to_ket bv))).

Axiom path_cont2 :
  forall (c:circuit) (co:Z) (k:Z) (n:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) ->
  ((k + (width c))%Z <= co)%Z -> forall (bv:bitvec), ((length bv) = n) ->
  (((getbv bv) co) = 0%Z) ->
  ((path_sem (cont c co k n) (bv_to_ket bv)) = (bv_to_ket bv)).

Axiom path_cont3 :
  forall (c:circuit) (co:Z) (k:Z) (n:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) ->
  ((k + (width c))%Z <= co)%Z -> forall (bv:bitvec), ((length bv) = n) ->
  (((getbv bv) co) = 1%Z) ->
  ((path_sem (cont c co k n) (bv_to_ket bv)) =
   (path_sem (place c k n) (bv_to_ket bv))).

Axiom path_cont_ketz :
  forall (c:circuit) (co:Z) (k:Z) (n:Z) (x:matrix complex),
  ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) -> ~ (k <= co)%Z ->
  (is_a_ket_l x n) -> (is_a_ket_basis_elt x) ->
  (((getbv (ket_to_bv x)) co) = 0%Z) -> ((path_sem (cont c co k n) x) = x).

Axiom path_cont_ketz1 :
  forall (c:circuit) (co:Z) (k:Z) (n:Z) (x:matrix complex),
  ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) ->
  ((k + (width c))%Z <= co)%Z -> (is_a_ket_l x n) ->
  (is_a_ket_basis_elt x) -> (((getbv (ket_to_bv x)) co) = 0%Z) ->
  ((path_sem (cont c co k n) x) = x).

Axiom path_cont_keto :
  forall (c:circuit) (co:Z) (k:Z) (n:Z) (x:matrix complex),
  ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) -> ~ (k <= co)%Z ->
  (is_a_ket_l x n) -> (is_a_ket_basis_elt x) ->
  (((getbv (ket_to_bv x)) co) = 1%Z) ->
  ((path_sem (cont c co k n) x) = (path_sem (place c k n) x)).

Axiom path_cont_keto1 :
  forall (c:circuit) (co:Z) (k:Z) (n:Z) (x:matrix complex),
  ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) ->
  ((k + (width c))%Z <= co)%Z -> (is_a_ket_l x n) ->
  (is_a_ket_basis_elt x) -> (((getbv (ket_to_bv x)) co) = 1%Z) ->
  ((path_sem (cont c co k n) x) = (path_sem (place c k n) x)).

Axiom path_cont_ketz_gen :
  forall (c:circuit) (co:Z) (k:Z) (n:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) -> ~ (k <= co)%Z ->
  forall (x:matrix complex), (is_a_ket_l x n) -> (is_a_ket_basis_elt x) ->
  (((getbv (ket_to_bv x)) co) = 0%Z) -> ((path_sem (cont c co k n) x) = x).

Axiom path_cont_ketz_gen1 :
  forall (c:circuit) (co:Z) (k:Z) (n:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) ->
  ((k + (width c))%Z <= co)%Z -> forall (x:matrix complex),
  (is_a_ket_l x n) -> (is_a_ket_basis_elt x) ->
  (((getbv (ket_to_bv x)) co) = 0%Z) -> ((path_sem (cont c co k n) x) = x).

Axiom path_cont_keto_gen :
  forall (c:circuit) (co:Z) (k:Z) (n:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) -> ~ (k <= co)%Z ->
  forall (x:matrix complex), (is_a_ket_l x n) -> (is_a_ket_basis_elt x) ->
  (((getbv (ket_to_bv x)) co) = 1%Z) ->
  ((path_sem (cont c co k n) x) = (path_sem (place c k n) x)).

Axiom path_cont_keto_gen1 :
  forall (c:circuit) (co:Z) (k:Z) (n:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) ->
  ((k + (width c))%Z <= co)%Z -> forall (x:matrix complex),
  (is_a_ket_l x n) -> (is_a_ket_basis_elt x) ->
  (((getbv (ket_to_bv x)) co) = 1%Z) ->
  ((path_sem (cont c co k n) x) = (path_sem (place c k n) x)).

Axiom cont_kron_left_bv_to_ket :
  forall (c:circuit) (n:Z) (x:matrix complex),
  ((0%Z <= (width c))%Z /\ ((width c) = (n - 1%Z)%Z)) ->
  (is_a_ket_l x (width c)) -> forall (y:bitvec), ((length y) = 1%Z) ->
  (((getbv y) 0%Z) = 0%Z) ->
  ((path_sem (cont c (n - 1%Z)%Z 0%Z n) (kronecker x (bv_to_ket y))) =
   (kronecker x (bv_to_ket y))).

Axiom cont_kron_left_bv_to_ket1 :
  forall (c:circuit) (n:Z) (x:matrix complex),
  ((0%Z <= (width c))%Z /\ ((width c) = (n - 1%Z)%Z)) ->
  (is_a_ket_l x (width c)) -> forall (y:bitvec), ((length y) = 1%Z) ->
  (((getbv y) 0%Z) = 1%Z) ->
  ((path_sem (cont c (n - 1%Z)%Z 0%Z n) (kronecker x (bv_to_ket y))) =
   (kronecker (path_sem c x) (bv_to_ket y))).

Axiom place_kron_left_path :
  forall (c:circuit) (n:Z), ((width c) < n)%Z ->
  forall (x:matrix complex) (y:matrix complex), (is_a_ket_l x (width c)) ->
  (is_a_ket_l y (n - (width c))%Z) ->
  ((path_sem (place c 0%Z n) (kronecker x y)) = (kronecker (path_sem c x) y)).

Axiom cont_kron_pat_right :
  forall (circ:circuit) (c:Z) (k:Z) (n:Z) (y:matrix complex),
  ((0%Z <= c)%Z /\ (c < k)%Z) -> (n = (k + (width circ))%Z) ->
  (is_a_ket_l y (width circ)) -> forall (x:matrix complex),
  (is_a_ket_basis_elt x) -> (is_a_ket_l x k) ->
  (((getbv (ket_to_bv x)) c) = 0%Z) ->
  ((path_sem (cont circ c k n) (kronecker x y)) = (kronecker x y)).

Axiom cont_kron_pat_right1 :
  forall (circ:circuit) (c:Z) (k:Z) (n:Z) (y:matrix complex),
  ((0%Z <= c)%Z /\ (c < k)%Z) -> (n = (k + (width circ))%Z) ->
  (is_a_ket_l y (width circ)) -> forall (x:matrix complex),
  (is_a_ket_basis_elt x) -> (is_a_ket_l x k) ->
  (((getbv (ket_to_bv x)) c) = 1%Z) ->
  ((path_sem (cont circ c k n) (kronecker x y)) =
   (kronecker x (path_sem circ y))).

Axiom cont_kron_pat_right_gen :
  forall (circ:circuit) (c:Z) (k:Z) (n:Z), ((0%Z <= c)%Z /\ (c < k)%Z) ->
  (n = (k + (width circ))%Z) -> forall (y:matrix complex), forall (x:bitvec),
  (is_a_ket_l y (width circ)) -> ((length x) = k) -> (((getbv x) c) = 0%Z) ->
  ((path_sem (cont circ c k n) (kronecker (bv_to_ket x) y)) =
   (kronecker (bv_to_ket x) y)).

Axiom cont_kron_pat_right_gen1 :
  forall (circ:circuit) (c:Z) (k:Z) (n:Z), ((0%Z <= c)%Z /\ (c < k)%Z) ->
  (n = (k + (width circ))%Z) -> forall (y:matrix complex), forall (x:bitvec),
  (is_a_ket_l y (width circ)) -> ((length x) = k) -> (((getbv x) c) = 1%Z) ->
  ((path_sem (cont circ c k n) (kronecker (bv_to_ket x) y)) =
   (kronecker (bv_to_ket x) (path_sem circ y))).

Parameter diagonal1: circuit -> (bitvec -> angle) -> Prop.

Axiom diagonal_def1 :
  forall (c:circuit) (g:bitvec -> angle), (diagonal1 c g) ->
  correct_path_sum_bv c 0%Z (fun (x:bitvec) (us:bitvec) => x)
  (fun (x:bitvec) (us:bitvec) => (g x)).

Axiom diagonal_def2 :
  forall (c:circuit) (g:bitvec -> angle),
  (correct_path_sum_bv c 0%Z (fun (x:bitvec) (us:bitvec) => x)
   (fun (x:bitvec) (us:bitvec) => (g x))) ->
  diagonal1 c g.

Axiom set_diagonal :
  forall (c:circuit) (f:bitvec -> angle),
  (forall (x:bitvec), ((length x) = (width c)) ->
   ((path_sem_basis c (bv_to_ket x)) =
    (infix_asdtdt (ang_exp (f x)) (bv_to_ket x)))) ->
  diagonal1 c f.

Axiom get_diagonal :
  forall (c:circuit) (f:bitvec -> angle), (diagonal1 c f) ->
  forall (x:bitvec), ((length x) = (width c)) ->
  ((path_sem_basis c (bv_to_ket x)) =
   (infix_asdtdt (ang_exp (f x)) (bv_to_ket x))).

Axiom set_diagonal_ :
  forall (c:circuit) (f:bitvec -> angle),
  (forall (x:bitvec), ((length x) = (width c)) ->
   ((path_sem c (bv_to_ket x)) =
    (infix_asdtdt (ang_exp (f x)) (bv_to_ket x)))) ->
  diagonal1 c f.

Axiom get_diagonal_ :
  forall (c:circuit) (f:bitvec -> angle), (diagonal1 c f) ->
  forall (x:bitvec), ((length x) = (width c)) ->
  ((path_sem c (bv_to_ket x)) = (infix_asdtdt (ang_exp (f x)) (bv_to_ket x))).

Axiom get_diagonal_basis :
  forall (c:circuit) (f:bitvec -> angle) (x:bitvec), (diagonal1 c f) ->
  ((length x) = (width c)) ->
  ((path_sem_basis c (bv_to_ket x)) =
   (infix_asdtdt (ang_exp (f x)) (bv_to_ket x))).

Axiom get_diagonal_basis_ :
  forall (c:circuit) (f:bitvec -> angle) (x:bitvec), (diagonal1 c f) ->
  ((length x) = (width c)) ->
  ((path_sem c (bv_to_ket x)) = (infix_asdtdt (ang_exp (f x)) (bv_to_ket x))).

Parameter diag_id: Z -> circuit.

Axiom diag_id_def : forall (i:Z), (1%Z <= i)%Z -> ((diag_id i) = (ids i)).

Axiom diag_id_spec :
  forall (i:Z), (1%Z <= i)%Z -> ((size (diag_id i)) = 0%Z).

Axiom diag_id_spec1 :
  forall (i:Z), (1%Z <= i)%Z -> ((ancillas (diag_id i)) = 0%Z).

Axiom diag_id_spec2 :
  forall (i:Z), (1%Z <= i)%Z -> ((width (diag_id i)) = i).

Axiom diag_id_spec3 :
  forall (i:Z), (1%Z <= i)%Z ->
  diagonal1 (diag_id i) (fun (us:bitvec) => ang_zero).

Parameter diag_rz: Z -> circuit.

Axiom diag_rz_def : forall (k:Z), (0%Z <= k)%Z -> ((diag_rz k) = (rz k)).

Axiom diag_rz_spec :
  forall (k:Z), (0%Z <= k)%Z -> ((size (diag_rz k)) = 1%Z).

Axiom diag_rz_spec1 :
  forall (k:Z), (0%Z <= k)%Z -> ((ancillas (diag_rz k)) = 0%Z).

Axiom diag_rz_spec2 :
  forall (k:Z), (0%Z <= k)%Z -> ((width (diag_rz k)) = 1%Z).

Axiom diag_rz_spec3 :
  forall (k:Z), (0%Z <= k)%Z ->
  diagonal1 (diag_rz k) (fun (x:bitvec) => (int_to_ang ((getbv x) 0%Z) k)).

Parameter diag_rz_neg: Z -> circuit.

Axiom diag_rz_neg_def :
  forall (k:Z), (k <= 0%Z)%Z -> ((diag_rz_neg k) = (rz k)).

Axiom diag_rz_neg_spec :
  forall (k:Z), (k <= 0%Z)%Z -> ((size (diag_rz_neg k)) = 1%Z).

Axiom diag_rz_neg_spec1 :
  forall (k:Z), (k <= 0%Z)%Z -> ((ancillas (diag_rz_neg k)) = 0%Z).

Axiom diag_rz_neg_spec2 :
  forall (k:Z), (k <= 0%Z)%Z -> ((width (diag_rz_neg k)) = 1%Z).

Axiom diag_rz_neg_spec3 :
  forall (k:Z), (k <= 0%Z)%Z ->
  diagonal1 (diag_rz_neg k)
  (fun (x:bitvec) => (int_to_ang (-((getbv x) 0%Z))%Z (-k)%Z)).

Parameter diag_phase: Z -> circuit.

Axiom diag_phase_def :
  forall (k:Z), (0%Z <= k)%Z -> ((diag_phase k) = (phase k)).

Axiom diag_phase_spec :
  forall (k:Z), (0%Z <= k)%Z -> ((size (diag_phase k)) = 1%Z).

Axiom diag_phase_spec1 :
  forall (k:Z), (0%Z <= k)%Z -> ((ancillas (diag_phase k)) = 0%Z).

Axiom diag_phase_spec2 :
  forall (k:Z), (0%Z <= k)%Z -> ((width (diag_phase k)) = 1%Z).

Axiom diag_phase_spec3 :
  forall (k:Z), (0%Z <= k)%Z ->
  diagonal1 (diag_phase k) (fun (us:bitvec) => (int_to_ang 1%Z k)).

Parameter diag_phase_neg: Z -> circuit.

Axiom diag_phase_neg_def :
  forall (k:Z), (k <= 0%Z)%Z -> ((diag_phase_neg k) = (phase k)).

Axiom diag_phase_neg_spec :
  forall (k:Z), (k <= 0%Z)%Z -> ((size (diag_phase_neg k)) = 1%Z).

Axiom diag_phase_neg_spec1 :
  forall (k:Z), (k <= 0%Z)%Z -> ((ancillas (diag_phase_neg k)) = 0%Z).

Axiom diag_phase_neg_spec2 :
  forall (k:Z), (k <= 0%Z)%Z -> ((width (diag_phase_neg k)) = 1%Z).

Axiom diag_phase_neg_spec3 :
  forall (k:Z), (k <= 0%Z)%Z ->
  diagonal1 (diag_phase_neg k)
  (fun (us:bitvec) => (int_to_ang (-1%Z)%Z (-k)%Z)).

Parameter diag_sequence:
  circuit -> circuit -> (bitvec -> angle) -> (bitvec -> angle) ->
  (bitvec -> angle) -> circuit.

Axiom diag_sequence_def :
  forall (d:circuit) (e1:circuit) (f:bitvec -> angle) (g:bitvec -> angle)
    (h:bitvec -> angle),
  (diagonal1 d f) -> (diagonal1 e1 g) -> ((width d) = (width e1)) ->
  (forall (x:bitvec), ((length x) = (width d)) ->
   ((h x) = (ang_add (f x) (g x)))) ->
  ((diag_sequence d e1 f g h) = (sequence d e1)).

Axiom diag_sequence_spec :
  forall (d:circuit) (e1:circuit) (f:bitvec -> angle) (g:bitvec -> angle)
    (h:bitvec -> angle),
  (diagonal1 d f) -> (diagonal1 e1 g) -> ((width d) = (width e1)) ->
  (forall (x:bitvec), ((length x) = (width d)) ->
   ((h x) = (ang_add (f x) (g x)))) ->
  diagonal1 (diag_sequence d e1 f g h) h.

Axiom diag_sequence_spec1 :
  forall (d:circuit) (e1:circuit) (f:bitvec -> angle) (g:bitvec -> angle)
    (h:bitvec -> angle),
  (diagonal1 d f) -> (diagonal1 e1 g) -> ((width d) = (width e1)) ->
  (forall (x:bitvec), ((length x) = (width d)) ->
   ((h x) = (ang_add (f x) (g x)))) ->
  ((width (diag_sequence d e1 f g h)) = (width d)).

Axiom diag_sequence_spec2 :
  forall (d:circuit) (e1:circuit) (f:bitvec -> angle) (g:bitvec -> angle)
    (h:bitvec -> angle),
  (diagonal1 d f) -> (diagonal1 e1 g) -> ((width d) = (width e1)) ->
  (forall (x:bitvec), ((length x) = (width d)) ->
   ((h x) = (ang_add (f x) (g x)))) ->
  ((size (diag_sequence d e1 f g h)) = ((size d) + (size e1))%Z).

Axiom diag_sequence_spec3 :
  forall (d:circuit) (e1:circuit) (f:bitvec -> angle) (g:bitvec -> angle)
    (h:bitvec -> angle),
  (diagonal1 d f) -> (diagonal1 e1 g) -> ((width d) = (width e1)) ->
  (forall (x:bitvec), ((length x) = (width d)) ->
   ((h x) = (ang_add (f x) (g x)))) ->
  ((ancillas (diag_sequence d e1 f g h)) =
   (ZArith.BinInt.Z.max (ancillas d) (ancillas e1))).

Parameter sequence_diag_gen:
  circuit -> circuit -> (bitvec -> angle) -> (bitvec -> bitvec -> angle) ->
  (bitvec -> bitvec -> bitvec) -> Z -> circuit.

Axiom sequence_diag_gen_def :
  forall (d:circuit) (e1:circuit) (f:bitvec -> angle)
    (g:bitvec -> bitvec -> angle) (h:bitvec -> bitvec -> bitvec) (r:Z),
  (diagonal1 d f) -> (r = (range e1)) -> ((width d) = (width e1)) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width d)) ->
   ((length y) = r) -> ((length ((h x) y)) = (width d))) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width d)) ->
   ((length y) = r) ->
   (((g x) y) = (ang_add (f x) (ang_ind e1 (getbv x) (getbv y))))) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width d)) ->
   ((length y) = r) ->
   (((h x) y) =
    (make_bv
     ((((fun (y0:circuit) (y1:Z -> Z) (y2:Z -> Z) (y3:Z) =>
         (basis_ket y0 y1 y2 y3))
        e1)
       (getbv x))
      (getbv y))
     (width d)))) ->
  ((sequence_diag_gen d e1 f g h r) =
   (seq_pps_bv d e1 0%Z r r (fun (x:bitvec) (us:bitvec) => x) h h
    (fun (x:bitvec) (us:bitvec) => (f x))
    (fun (x:bitvec) (y:bitvec) => (ang_ind e1 (getbv x) (getbv y))) g)).

Axiom sequence_diag_gen_spec :
  forall (d:circuit) (e1:circuit) (f:bitvec -> angle)
    (g:bitvec -> bitvec -> angle) (h:bitvec -> bitvec -> bitvec) (r:Z),
  (diagonal1 d f) -> (r = (range e1)) -> ((width d) = (width e1)) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width d)) ->
   ((length y) = r) -> ((length ((h x) y)) = (width d))) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width d)) ->
   ((length y) = r) ->
   (((g x) y) = (ang_add (f x) (ang_ind e1 (getbv x) (getbv y))))) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width d)) ->
   ((length y) = r) ->
   (((h x) y) =
    (make_bv
     ((((fun (y0:circuit) (y1:Z -> Z) (y2:Z -> Z) (y3:Z) =>
         (basis_ket y0 y1 y2 y3))
        e1)
       (getbv x))
      (getbv y))
     (width d)))) ->
  ((width (sequence_diag_gen d e1 f g h r)) = (width d)).

Axiom sequence_diag_gen_spec1 :
  forall (d:circuit) (e1:circuit) (f:bitvec -> angle)
    (g:bitvec -> bitvec -> angle) (h:bitvec -> bitvec -> bitvec) (r:Z),
  (diagonal1 d f) -> (r = (range e1)) -> ((width d) = (width e1)) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width d)) ->
   ((length y) = r) -> ((length ((h x) y)) = (width d))) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width d)) ->
   ((length y) = r) ->
   (((g x) y) = (ang_add (f x) (ang_ind e1 (getbv x) (getbv y))))) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width d)) ->
   ((length y) = r) ->
   (((h x) y) =
    (make_bv
     ((((fun (y0:circuit) (y1:Z -> Z) (y2:Z -> Z) (y3:Z) =>
         (basis_ket y0 y1 y2 y3))
        e1)
       (getbv x))
      (getbv y))
     (width d)))) ->
  ((size (sequence_diag_gen d e1 f g h r)) = ((size d) + (size e1))%Z).

Axiom sequence_diag_gen_spec2 :
  forall (d:circuit) (e1:circuit) (f:bitvec -> angle)
    (g:bitvec -> bitvec -> angle) (h:bitvec -> bitvec -> bitvec) (r:Z),
  (diagonal1 d f) -> (r = (range e1)) -> ((width d) = (width e1)) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width d)) ->
   ((length y) = r) -> ((length ((h x) y)) = (width d))) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width d)) ->
   ((length y) = r) ->
   (((g x) y) = (ang_add (f x) (ang_ind e1 (getbv x) (getbv y))))) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width d)) ->
   ((length y) = r) ->
   (((h x) y) =
    (make_bv
     ((((fun (y0:circuit) (y1:Z -> Z) (y2:Z -> Z) (y3:Z) =>
         (basis_ket y0 y1 y2 y3))
        e1)
       (getbv x))
      (getbv y))
     (width d)))) ->
  ((ancillas (sequence_diag_gen d e1 f g h r)) =
   (ZArith.BinInt.Z.max (ancillas d) (ancillas e1))).

Axiom sequence_diag_gen_spec3 :
  forall (d:circuit) (e1:circuit) (f:bitvec -> angle)
    (g:bitvec -> bitvec -> angle) (h:bitvec -> bitvec -> bitvec) (r:Z),
  (diagonal1 d f) -> (r = (range e1)) -> ((width d) = (width e1)) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width d)) ->
   ((length y) = r) -> ((length ((h x) y)) = (width d))) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width d)) ->
   ((length y) = r) ->
   (((g x) y) = (ang_add (f x) (ang_ind e1 (getbv x) (getbv y))))) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width d)) ->
   ((length y) = r) ->
   (((h x) y) =
    (make_bv
     ((((fun (y0:circuit) (y1:Z -> Z) (y2:Z -> Z) (y3:Z) =>
         (basis_ket y0 y1 y2 y3))
        e1)
       (getbv x))
      (getbv y))
     (width d)))) ->
  correct_path_sum_bv (sequence_diag_gen d e1 f g h r) r h g.

Parameter sequence_gen_diag:
  circuit -> circuit -> (bitvec -> angle) -> (bitvec -> bitvec -> angle) ->
  (bitvec -> bitvec -> bitvec) -> Z -> circuit.

Axiom sequence_gen_diag_def :
  forall (d:circuit) (e1:circuit) (f:bitvec -> angle)
    (g:bitvec -> bitvec -> angle) (h:bitvec -> bitvec -> bitvec) (r:Z),
  (diagonal1 d f) -> (r = (range e1)) -> ((width d) = (width e1)) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width d)) ->
   ((length y) = r) -> ((length ((h x) y)) = (width d))) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width d)) ->
   ((length y) = r) ->
   (((g x) y) = (ang_add (ang_ind e1 (getbv x) (getbv y)) (f ((h x) y))))) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width d)) ->
   ((length y) = r) ->
   (((h x) y) =
    (make_bv
     ((((fun (y0:circuit) (y1:Z -> Z) (y2:Z -> Z) (y3:Z) =>
         (basis_ket y0 y1 y2 y3))
        e1)
       (getbv x))
      (getbv y))
     (width d)))) ->
  ((sequence_gen_diag d e1 f g h r) =
   (seq_pps_bv e1 d r 0%Z r h (fun (x:bitvec) (us:bitvec) => x) h
    (fun (x:bitvec) (y:bitvec) => (ang_ind e1 (getbv x) (getbv y)))
    (fun (x:bitvec) (us:bitvec) => (f x)) g)).

Axiom sequence_gen_diag_spec :
  forall (d:circuit) (e1:circuit) (f:bitvec -> angle)
    (g:bitvec -> bitvec -> angle) (h:bitvec -> bitvec -> bitvec) (r:Z),
  (diagonal1 d f) -> (r = (range e1)) -> ((width d) = (width e1)) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width d)) ->
   ((length y) = r) -> ((length ((h x) y)) = (width d))) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width d)) ->
   ((length y) = r) ->
   (((g x) y) = (ang_add (ang_ind e1 (getbv x) (getbv y)) (f ((h x) y))))) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width d)) ->
   ((length y) = r) ->
   (((h x) y) =
    (make_bv
     ((((fun (y0:circuit) (y1:Z -> Z) (y2:Z -> Z) (y3:Z) =>
         (basis_ket y0 y1 y2 y3))
        e1)
       (getbv x))
      (getbv y))
     (width d)))) ->
  ((width (sequence_gen_diag d e1 f g h r)) = (width d)).

Axiom sequence_gen_diag_spec1 :
  forall (d:circuit) (e1:circuit) (f:bitvec -> angle)
    (g:bitvec -> bitvec -> angle) (h:bitvec -> bitvec -> bitvec) (r:Z),
  (diagonal1 d f) -> (r = (range e1)) -> ((width d) = (width e1)) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width d)) ->
   ((length y) = r) -> ((length ((h x) y)) = (width d))) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width d)) ->
   ((length y) = r) ->
   (((g x) y) = (ang_add (ang_ind e1 (getbv x) (getbv y)) (f ((h x) y))))) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width d)) ->
   ((length y) = r) ->
   (((h x) y) =
    (make_bv
     ((((fun (y0:circuit) (y1:Z -> Z) (y2:Z -> Z) (y3:Z) =>
         (basis_ket y0 y1 y2 y3))
        e1)
       (getbv x))
      (getbv y))
     (width d)))) ->
  ((size (sequence_gen_diag d e1 f g h r)) = ((size d) + (size e1))%Z).

Axiom sequence_gen_diag_spec2 :
  forall (d:circuit) (e1:circuit) (f:bitvec -> angle)
    (g:bitvec -> bitvec -> angle) (h:bitvec -> bitvec -> bitvec) (r:Z),
  (diagonal1 d f) -> (r = (range e1)) -> ((width d) = (width e1)) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width d)) ->
   ((length y) = r) -> ((length ((h x) y)) = (width d))) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width d)) ->
   ((length y) = r) ->
   (((g x) y) = (ang_add (ang_ind e1 (getbv x) (getbv y)) (f ((h x) y))))) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width d)) ->
   ((length y) = r) ->
   (((h x) y) =
    (make_bv
     ((((fun (y0:circuit) (y1:Z -> Z) (y2:Z -> Z) (y3:Z) =>
         (basis_ket y0 y1 y2 y3))
        e1)
       (getbv x))
      (getbv y))
     (width d)))) ->
  ((ancillas (sequence_gen_diag d e1 f g h r)) =
   (ZArith.BinInt.Z.max (ancillas d) (ancillas e1))).

Axiom sequence_gen_diag_spec3 :
  forall (d:circuit) (e1:circuit) (f:bitvec -> angle)
    (g:bitvec -> bitvec -> angle) (h:bitvec -> bitvec -> bitvec) (r:Z),
  (diagonal1 d f) -> (r = (range e1)) -> ((width d) = (width e1)) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width d)) ->
   ((length y) = r) -> ((length ((h x) y)) = (width d))) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width d)) ->
   ((length y) = r) ->
   (((g x) y) = (ang_add (ang_ind e1 (getbv x) (getbv y)) (f ((h x) y))))) ->
  (forall (x:bitvec) (y:bitvec), ((length x) = (width d)) ->
   ((length y) = r) ->
   (((h x) y) =
    (make_bv
     ((((fun (y0:circuit) (y1:Z -> Z) (y2:Z -> Z) (y3:Z) =>
         (basis_ket y0 y1 y2 y3))
        e1)
       (getbv x))
      (getbv y))
     (width d)))) ->
  correct_path_sum_bv (sequence_gen_diag d e1 f g h r) r h g.

Parameter diag_expo:
  circuit -> (bitvec -> angle) -> (bitvec -> angle) -> Z -> circuit.

Axiom diag_expo_def :
  forall (c:circuit) (f:bitvec -> angle) (g:bitvec -> angle) (k:Z),
  (0%Z < k)%Z -> (diagonal1 c f) ->
  (forall (x:bitvec), ((length x) = (width c)) ->
   ((g x) = (ang_mult_int (f x) k))) ->
  (k = 1%Z) -> ((diag_expo c f g k) = c).

Axiom diag_expo_def1 :
  forall (c:circuit) (f:bitvec -> angle) (g:bitvec -> angle) (k:Z),
  (0%Z < k)%Z -> (diagonal1 c f) ->
  (forall (x:bitvec), ((length x) = (width c)) ->
   ((g x) = (ang_mult_int (f x) k))) ->
  ~ (k = 1%Z) ->
  ((diag_expo c f g k) =
   (diag_sequence
    (diag_expo c f (fun (x:bitvec) => (ang_mult_int (f x) (k - 1%Z)%Z))
     (k - 1%Z)%Z)
    c (fun (x:bitvec) => (ang_mult_int (f x) (k - 1%Z)%Z)) f g)).

Axiom diag_expo_spec :
  forall (c:circuit) (f:bitvec -> angle) (g:bitvec -> angle) (k:Z),
  (0%Z < k)%Z -> (diagonal1 c f) ->
  (forall (x:bitvec), ((length x) = (width c)) ->
   ((g x) = (ang_mult_int (f x) k))) ->
  diagonal1 (diag_expo c f g k) g.

Axiom diag_expo_spec1 :
  forall (c:circuit) (f:bitvec -> angle) (g:bitvec -> angle) (k:Z),
  (0%Z < k)%Z -> (diagonal1 c f) ->
  (forall (x:bitvec), ((length x) = (width c)) ->
   ((g x) = (ang_mult_int (f x) k))) ->
  ((width (diag_expo c f g k)) = (width c)).

Axiom diag_expo_spec2 :
  forall (c:circuit) (f:bitvec -> angle) (g:bitvec -> angle) (k:Z),
  (0%Z < k)%Z -> (diagonal1 c f) ->
  (forall (x:bitvec), ((length x) = (width c)) ->
   ((g x) = (ang_mult_int (f x) k))) ->
  ((size (diag_expo c f g k)) = (k * (size c))%Z).

Axiom diag_expo_spec3 :
  forall (c:circuit) (f:bitvec -> angle) (g:bitvec -> angle) (k:Z),
  (0%Z < k)%Z -> (diagonal1 c f) ->
  (forall (x:bitvec), ((length x) = (width c)) ->
   ((g x) = (ang_mult_int (f x) k))) ->
  ((ancillas (diag_expo c f g k)) = (ancillas c)).

Parameter diag_parallel:
  circuit -> circuit -> (bitvec -> angle) -> (bitvec -> angle) ->
  (bitvec -> angle) -> circuit.

Axiom diag_parallel_def :
  forall (d:circuit) (e1:circuit) (f:bitvec -> angle) (g:bitvec -> angle)
    (h:bitvec -> angle),
  (diagonal1 d f) -> (diagonal1 e1 g) ->
  (forall (x:bitvec),
   ((h x) = (ang_add (f (hpart x (width d))) (g (tpart x (width d)))))) ->
  ((diag_parallel d e1 f g h) = (parallel d e1)).

Axiom diag_parallel_spec :
  forall (d:circuit) (e1:circuit) (f:bitvec -> angle) (g:bitvec -> angle)
    (h:bitvec -> angle),
  (diagonal1 d f) -> (diagonal1 e1 g) ->
  (forall (x:bitvec),
   ((h x) = (ang_add (f (hpart x (width d))) (g (tpart x (width d)))))) ->
  diagonal1 (diag_parallel d e1 f g h) h.

Parameter diag_place:
  circuit -> Z -> Z -> (bitvec -> angle) -> (bitvec -> angle) -> circuit.

Axiom diag_place_def :
  forall (c:circuit) (k:Z) (n:Z) (f:bitvec -> angle) (g:bitvec -> angle),
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) -> (diagonal1 c f) ->
  (forall (x:bitvec), ((length x) = n) ->
   ((g x) = (f (htpart x k (width c))))) ->
  ((diag_place c k n f g) = (place c k n)).

Axiom diag_place_spec :
  forall (c:circuit) (k:Z) (n:Z) (f:bitvec -> angle) (g:bitvec -> angle),
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) -> (diagonal1 c f) ->
  (forall (x:bitvec), ((length x) = n) ->
   ((g x) = (f (htpart x k (width c))))) ->
  ((size (diag_place c k n f g)) = (size c)).

Axiom diag_place_spec1 :
  forall (c:circuit) (k:Z) (n:Z) (f:bitvec -> angle) (g:bitvec -> angle),
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) -> (diagonal1 c f) ->
  (forall (x:bitvec), ((length x) = n) ->
   ((g x) = (f (htpart x k (width c))))) ->
  ((ancillas (diag_place c k n f g)) = (ancillas c)).

Axiom diag_place_spec2 :
  forall (c:circuit) (k:Z) (n:Z) (f:bitvec -> angle) (g:bitvec -> angle),
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) -> (diagonal1 c f) ->
  (forall (x:bitvec), ((length x) = n) ->
   ((g x) = (f (htpart x k (width c))))) ->
  ((width (diag_place c k n f g)) = n).

Axiom diag_place_spec3 :
  forall (c:circuit) (k:Z) (n:Z) (f:bitvec -> angle) (g:bitvec -> angle),
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) -> (diagonal1 c f) ->
  (forall (x:bitvec), ((length x) = n) ->
   ((g x) = (f (htpart x k (width c))))) ->
  diagonal1 (diag_place c k n f g) g.

Parameter diag_cont:
  circuit -> Z -> Z -> Z -> (bitvec -> angle) -> (bitvec -> angle) ->
  circuit.

Axiom diag_cont_def :
  forall (c:circuit) (co:Z) (k:Z) (n:Z) (f:bitvec -> angle)
    (g:bitvec -> angle),
  ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) -> ~ (k <= co)%Z ->
  (diagonal1 c f) ->
  (forall (x:bitvec), ((length x) = n) ->
   ((((getbv x) co) = 0%Z) /\ ((g x) = ang_zero)) \/
   (~ (((getbv x) co) = 0%Z) /\ ((g x) = (f (htpart x k (width c)))))) ->
  ((diag_cont c co k n f g) = (cont c co k n)).

Axiom diag_cont_def1 :
  forall (c:circuit) (co:Z) (k:Z) (n:Z) (f:bitvec -> angle)
    (g:bitvec -> angle),
  ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) ->
  ((k + (width c))%Z <= co)%Z -> (diagonal1 c f) ->
  (forall (x:bitvec), ((length x) = n) ->
   ((((getbv x) co) = 0%Z) /\ ((g x) = ang_zero)) \/
   (~ (((getbv x) co) = 0%Z) /\ ((g x) = (f (htpart x k (width c)))))) ->
  ((diag_cont c co k n f g) = (cont c co k n)).

Axiom diag_cont_spec :
  forall (c:circuit) (co:Z) (k:Z) (n:Z) (f:bitvec -> angle)
    (g:bitvec -> angle),
  ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) -> ~ (k <= co)%Z ->
  (diagonal1 c f) ->
  (forall (x:bitvec), ((length x) = n) ->
   ((((getbv x) co) = 0%Z) /\ ((g x) = ang_zero)) \/
   (~ (((getbv x) co) = 0%Z) /\ ((g x) = (f (htpart x k (width c)))))) ->
  ((size (diag_cont c co k n f g)) <= ((size c) * cont_size)%Z)%Z.

Axiom diag_cont_spec1 :
  forall (c:circuit) (co:Z) (k:Z) (n:Z) (f:bitvec -> angle)
    (g:bitvec -> angle),
  ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) -> ~ (k <= co)%Z ->
  (diagonal1 c f) ->
  (forall (x:bitvec), ((length x) = n) ->
   ((((getbv x) co) = 0%Z) /\ ((g x) = ang_zero)) \/
   (~ (((getbv x) co) = 0%Z) /\ ((g x) = (f (htpart x k (width c)))))) ->
  ((ancillas (diag_cont c co k n f g)) = (ancillas c)).

Axiom diag_cont_spec2 :
  forall (c:circuit) (co:Z) (k:Z) (n:Z) (f:bitvec -> angle)
    (g:bitvec -> angle),
  ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) -> ~ (k <= co)%Z ->
  (diagonal1 c f) ->
  (forall (x:bitvec), ((length x) = n) ->
   ((((getbv x) co) = 0%Z) /\ ((g x) = ang_zero)) \/
   (~ (((getbv x) co) = 0%Z) /\ ((g x) = (f (htpart x k (width c)))))) ->
  ((width (diag_cont c co k n f g)) = n).

Axiom diag_cont_spec3 :
  forall (c:circuit) (co:Z) (k:Z) (n:Z) (f:bitvec -> angle)
    (g:bitvec -> angle),
  ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) -> ~ (k <= co)%Z ->
  (diagonal1 c f) ->
  (forall (x:bitvec), ((length x) = n) ->
   ((((getbv x) co) = 0%Z) /\ ((g x) = ang_zero)) \/
   (~ (((getbv x) co) = 0%Z) /\ ((g x) = (f (htpart x k (width c)))))) ->
  diagonal1 (diag_cont c co k n f g) g.

Axiom diag_cont_spec4 :
  forall (c:circuit) (co:Z) (k:Z) (n:Z) (f:bitvec -> angle)
    (g:bitvec -> angle),
  ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) ->
  ((k + (width c))%Z <= co)%Z -> (diagonal1 c f) ->
  (forall (x:bitvec), ((length x) = n) ->
   ((((getbv x) co) = 0%Z) /\ ((g x) = ang_zero)) \/
   (~ (((getbv x) co) = 0%Z) /\ ((g x) = (f (htpart x k (width c)))))) ->
  ((size (diag_cont c co k n f g)) <= ((size c) * cont_size)%Z)%Z.

Axiom diag_cont_spec5 :
  forall (c:circuit) (co:Z) (k:Z) (n:Z) (f:bitvec -> angle)
    (g:bitvec -> angle),
  ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) ->
  ((k + (width c))%Z <= co)%Z -> (diagonal1 c f) ->
  (forall (x:bitvec), ((length x) = n) ->
   ((((getbv x) co) = 0%Z) /\ ((g x) = ang_zero)) \/
   (~ (((getbv x) co) = 0%Z) /\ ((g x) = (f (htpart x k (width c)))))) ->
  ((ancillas (diag_cont c co k n f g)) = (ancillas c)).

Axiom diag_cont_spec6 :
  forall (c:circuit) (co:Z) (k:Z) (n:Z) (f:bitvec -> angle)
    (g:bitvec -> angle),
  ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) ->
  ((k + (width c))%Z <= co)%Z -> (diagonal1 c f) ->
  (forall (x:bitvec), ((length x) = n) ->
   ((((getbv x) co) = 0%Z) /\ ((g x) = ang_zero)) \/
   (~ (((getbv x) co) = 0%Z) /\ ((g x) = (f (htpart x k (width c)))))) ->
  ((width (diag_cont c co k n f g)) = n).

Axiom diag_cont_spec7 :
  forall (c:circuit) (co:Z) (k:Z) (n:Z) (f:bitvec -> angle)
    (g:bitvec -> angle),
  ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= k)%Z /\ (k <= (n - (width c))%Z)%Z) ->
  ((k + (width c))%Z <= co)%Z -> (diagonal1 c f) ->
  (forall (x:bitvec), ((length x) = n) ->
   ((((getbv x) co) = 0%Z) /\ ((g x) = ang_zero)) \/
   (~ (((getbv x) co) = 0%Z) /\ ((g x) = (f (htpart x k (width c)))))) ->
  diagonal1 (diag_cont c co k n f g) g.

Parameter gen_phase: Z -> Z -> circuit.

Axiom gen_phase_def :
  forall (k:Z) (n:Z), (0%Z < n)%Z -> (0%Z <= k)%Z ->
  ((gen_phase k n) =
   (diag_place (diag_phase k) 0%Z n (fun (us:bitvec) => (int_to_ang 1%Z k))
    (fun (us:bitvec) => (int_to_ang 1%Z k)))).

Axiom gen_phase_spec :
  forall (k:Z) (n:Z), (0%Z < n)%Z -> (0%Z <= k)%Z ->
  diagonal1 (gen_phase k n) (fun (us:bitvec) => (int_to_ang 1%Z k)).

Axiom gen_phase_spec1 :
  forall (k:Z) (n:Z), (0%Z < n)%Z -> (0%Z <= k)%Z ->
  ((width (gen_phase k n)) = n).

Parameter crzp: Z -> Z -> Z -> Z -> circuit.

Axiom crzp_def :
  forall (co:Z) (t:Z) (k:Z) (n:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> ~ (t = co) -> (0%Z <= k)%Z ->
  ((crzp co t k n) =
   (diag_cont (diag_rz k) co t n
    (fun (x:bitvec) => (int_to_ang ((getbv x) 0%Z) k))
    (fun (x:bitvec) => (int_to_ang (((getbv x) co) * ((getbv x) t))%Z k)))).

Axiom crzp_spec :
  forall (co:Z) (t:Z) (k:Z) (n:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> ~ (t = co) -> (0%Z <= k)%Z ->
  ((size (crzp co t k n)) <= cont_size)%Z.

Axiom crzp_spec1 :
  forall (co:Z) (t:Z) (k:Z) (n:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> ~ (t = co) -> (0%Z <= k)%Z ->
  ((ancillas (crzp co t k n)) = 0%Z).

Axiom crzp_spec2 :
  forall (co:Z) (t:Z) (k:Z) (n:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> ~ (t = co) -> (0%Z <= k)%Z ->
  ((width (crzp co t k n)) = n).

Axiom crzp_spec3 :
  forall (co:Z) (t:Z) (k:Z) (n:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> ~ (t = co) -> (0%Z <= k)%Z ->
  diagonal1 (crzp co t k n)
  (fun (x:bitvec) => (int_to_ang (((getbv x) co) * ((getbv x) t))%Z k)).

Parameter przp: Z -> Z -> Z -> circuit.

Axiom przp_def :
  forall (i:Z) (k:Z) (n:Z), ((0%Z <= i)%Z /\ (i <= n)%Z) ->
  ((0%Z <= k)%Z /\ (k < n)%Z) ->
  ((przp i k n) =
   (diag_place (diag_rz i) k n
    (fun (x:bitvec) => (int_to_ang ((getbv x) 0%Z) i))
    (fun (x:bitvec) =>
     (int_to_ang (((getbv x) k) * (power_ 2%Z (n - i)%Z))%Z n)))).

Axiom przp_spec :
  forall (i:Z) (k:Z) (n:Z), ((0%Z <= i)%Z /\ (i <= n)%Z) ->
  ((0%Z <= k)%Z /\ (k < n)%Z) -> ((size (przp i k n)) = 1%Z).

Axiom przp_spec1 :
  forall (i:Z) (k:Z) (n:Z), ((0%Z <= i)%Z /\ (i <= n)%Z) ->
  ((0%Z <= k)%Z /\ (k < n)%Z) -> ((ancillas (przp i k n)) = 0%Z).

Axiom przp_spec2 :
  forall (i:Z) (k:Z) (n:Z), ((0%Z <= i)%Z /\ (i <= n)%Z) ->
  ((0%Z <= k)%Z /\ (k < n)%Z) -> ((width (przp i k n)) = n).

Axiom przp_spec3 :
  forall (i:Z) (k:Z) (n:Z), ((0%Z <= i)%Z /\ (i <= n)%Z) ->
  ((0%Z <= k)%Z /\ (k < n)%Z) ->
  diagonal1 (przp i k n)
  (fun (x:bitvec) =>
   (int_to_ang (((getbv x) k) * (power_ 2%Z (n - i)%Z))%Z n)).

Parameter crzn: Z -> Z -> Z -> Z -> circuit.

Axiom crzn_def :
  forall (co:Z) (t:Z) (k:Z) (n:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> ~ (t = co) -> (k <= 0%Z)%Z ->
  ((crzn co t k n) =
   (diag_cont (diag_rz_neg k) co t n
    (fun (x:bitvec) => (int_to_ang (-((getbv x) 0%Z))%Z (-k)%Z))
    (fun (x:bitvec) =>
     (int_to_ang ((-((getbv x) co))%Z * ((getbv x) t))%Z (-k)%Z)))).

Axiom crzn_spec :
  forall (co:Z) (t:Z) (k:Z) (n:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> ~ (t = co) -> (k <= 0%Z)%Z ->
  ((size (crzn co t k n)) <= cont_size)%Z.

Axiom crzn_spec1 :
  forall (co:Z) (t:Z) (k:Z) (n:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> ~ (t = co) -> (k <= 0%Z)%Z ->
  ((ancillas (crzn co t k n)) = 0%Z).

Axiom crzn_spec2 :
  forall (co:Z) (t:Z) (k:Z) (n:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> ~ (t = co) -> (k <= 0%Z)%Z ->
  ((width (crzn co t k n)) = n).

Axiom crzn_spec3 :
  forall (co:Z) (t:Z) (k:Z) (n:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> ~ (t = co) -> (k <= 0%Z)%Z ->
  diagonal1 (crzn co t k n)
  (fun (x:bitvec) =>
   (int_to_ang ((-((getbv x) co))%Z * ((getbv x) t))%Z (-k)%Z)).

Parameter crzp_up: Z -> Z -> Z -> Z -> Z -> circuit.

Axiom crzp_up_def :
  forall (co:Z) (t:Z) (k:Z) (n:Z) (den:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> ~ (t = co) -> (0%Z <= k)%Z ->
  (k <= den)%Z -> ((crzp_up co t k n den) = (crzp co t k n)).

Axiom crzp_up_spec :
  forall (co:Z) (t:Z) (k:Z) (n:Z) (den:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> ~ (t = co) -> (0%Z <= k)%Z ->
  (k <= den)%Z -> ((size (crzp_up co t k n den)) <= cont_size)%Z.

Axiom crzp_up_spec1 :
  forall (co:Z) (t:Z) (k:Z) (n:Z) (den:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> ~ (t = co) -> (0%Z <= k)%Z ->
  (k <= den)%Z -> ((ancillas (crzp_up co t k n den)) = 0%Z).

Axiom crzp_up_spec2 :
  forall (co:Z) (t:Z) (k:Z) (n:Z) (den:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> ~ (t = co) -> (0%Z <= k)%Z ->
  (k <= den)%Z -> ((width (crzp_up co t k n den)) = n).

Axiom crzp_up_spec3 :
  forall (co:Z) (t:Z) (k:Z) (n:Z) (den:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> ~ (t = co) -> (0%Z <= k)%Z ->
  (k <= den)%Z ->
  diagonal1 (crzp_up co t k n den)
  (fun (x:bitvec) =>
   (int_to_ang
    ((((getbv x) co) * ((getbv x) t))%Z * (power_ 2%Z (den - k)%Z))%Z den)).

Parameter crzn_up: Z -> Z -> Z -> Z -> Z -> circuit.

Axiom crzn_up_def :
  forall (co:Z) (t:Z) (k:Z) (n:Z) (den:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> ~ (t = co) -> (k <= 0%Z)%Z ->
  ((-k)%Z <= den)%Z -> ((crzn_up co t k n den) = (crzn co t k n)).

Axiom crzn_up_spec :
  forall (co:Z) (t:Z) (k:Z) (n:Z) (den:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> ~ (t = co) -> (k <= 0%Z)%Z ->
  ((-k)%Z <= den)%Z -> ((size (crzn_up co t k n den)) <= cont_size)%Z.

Axiom crzn_up_spec1 :
  forall (co:Z) (t:Z) (k:Z) (n:Z) (den:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> ~ (t = co) -> (k <= 0%Z)%Z ->
  ((-k)%Z <= den)%Z -> ((ancillas (crzn_up co t k n den)) = 0%Z).

Axiom crzn_up_spec2 :
  forall (co:Z) (t:Z) (k:Z) (n:Z) (den:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> ~ (t = co) -> (k <= 0%Z)%Z ->
  ((-k)%Z <= den)%Z -> ((width (crzn_up co t k n den)) = n).

Axiom crzn_up_spec3 :
  forall (co:Z) (t:Z) (k:Z) (n:Z) (den:Z), ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> ~ (t = co) -> (k <= 0%Z)%Z ->
  ((-k)%Z <= den)%Z ->
  diagonal1 (crzn_up co t k n den)
  (fun (x:bitvec) =>
   (int_to_ang
    (((-((getbv x) co))%Z * ((getbv x) t))%Z * (power_ 2%Z (den + k)%Z))%Z
    den)).

Parameter c_rzp_one: Z -> Z -> Z -> circuit.

Axiom c_rzp_one_def :
  forall (co:Z) (t:Z) (n:Z), (n >= 0%Z)%Z -> ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> ~ (t <= co)%Z ->
  ((c_rzp_one co t n) = (crzp co t 1%Z n)).

Axiom c_rzp_one_def1 :
  forall (co:Z) (t:Z) (n:Z), (n >= 0%Z)%Z -> ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> (t < co)%Z ->
  ((c_rzp_one co t n) = (crzp co t 1%Z n)).

Axiom c_rzp_one_spec :
  forall (co:Z) (t:Z) (n:Z), (n >= 0%Z)%Z -> ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> ~ (t <= co)%Z ->
  ((width (c_rzp_one co t n)) = n).

Axiom c_rzp_one_spec1 :
  forall (co:Z) (t:Z) (n:Z), (n >= 0%Z)%Z -> ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> ~ (t <= co)%Z ->
  ((ancillas (c_rzp_one co t n)) = 0%Z).

Axiom c_rzp_one_spec2 :
  forall (co:Z) (t:Z) (n:Z), (n >= 0%Z)%Z -> ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> ~ (t <= co)%Z ->
  ((size (c_rzp_one co t n)) <= cont_size)%Z.

Axiom c_rzp_one_spec3 :
  forall (co:Z) (t:Z) (n:Z), (n >= 0%Z)%Z -> ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> ~ (t <= co)%Z ->
  diagonal1 (c_rzp_one co t n)
  (fun (x:bitvec) => (int_to_ang (((getbv x) co) * ((getbv x) t))%Z 1%Z)).

Parameter fc30: Z -> Z -> bitvec -> angle.

Axiom fc_def30 :
  forall (co:Z) (t:Z) (x:bitvec),
  (((((getbv x) co) = ((getbv x) t)) /\ (((getbv x) t) = 1%Z)) ->
   (((fc30 co t) x) = ang_minus_one)) /\
  (~ ((((getbv x) co) = ((getbv x) t)) /\ (((getbv x) t) = 1%Z)) ->
   (((fc30 co t) x) = ang_zero)).

Axiom c_rzp_one_spec4 :
  forall (co:Z) (t:Z) (n:Z), (n >= 0%Z)%Z -> ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> ~ (t <= co)%Z ->
  diagonal1 (c_rzp_one co t n) (fc30 co t).

Axiom c_rzp_one_spec5 :
  forall (co:Z) (t:Z) (n:Z), (n >= 0%Z)%Z -> ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> (t < co)%Z ->
  ((width (c_rzp_one co t n)) = n).

Axiom c_rzp_one_spec6 :
  forall (co:Z) (t:Z) (n:Z), (n >= 0%Z)%Z -> ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> (t < co)%Z ->
  ((ancillas (c_rzp_one co t n)) = 0%Z).

Axiom c_rzp_one_spec7 :
  forall (co:Z) (t:Z) (n:Z), (n >= 0%Z)%Z -> ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> (t < co)%Z ->
  ((size (c_rzp_one co t n)) <= cont_size)%Z.

Axiom c_rzp_one_spec8 :
  forall (co:Z) (t:Z) (n:Z), (n >= 0%Z)%Z -> ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> (t < co)%Z ->
  diagonal1 (c_rzp_one co t n)
  (fun (x:bitvec) => (int_to_ang (((getbv x) co) * ((getbv x) t))%Z 1%Z)).

Parameter fc31: Z -> Z -> bitvec -> angle.

Axiom fc_def31 :
  forall (co:Z) (t:Z) (x:bitvec),
  (((((getbv x) co) = ((getbv x) t)) /\ (((getbv x) t) = 1%Z)) ->
   (((fc31 co t) x) = ang_minus_one)) /\
  (~ ((((getbv x) co) = ((getbv x) t)) /\ (((getbv x) t) = 1%Z)) ->
   (((fc31 co t) x) = ang_zero)).

Axiom c_rzp_one_spec9 :
  forall (co:Z) (t:Z) (n:Z), (n >= 0%Z)%Z -> ((0%Z <= co)%Z /\ (co < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> (t < co)%Z ->
  diagonal1 (c_rzp_one co t n) (fc31 co t).

Parameter cascade_cont_rz_neg: Z -> Z -> Z -> Z -> Z -> circuit.

Axiom cascade_cont_rz_neg_def :
  forall (first_k:Z) (first_c:Z) (t:Z) (l:Z) (n:Z),
  ((0%Z <= l)%Z /\ (l < n)%Z) -> ((0%Z <= first_c)%Z /\ (first_c < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> ((first_c + l)%Z < n)%Z ->
  (0%Z <= first_k)%Z -> ((first_k + l)%Z <= n)%Z ->
  ~ (t <= (first_c + l)%Z)%Z -> (l = 0%Z) ->
  ((cascade_cont_rz_neg first_k first_c t l n) =
   (crzn_up first_c t (-first_k)%Z n n)).

Axiom cascade_cont_rz_neg_def1 :
  forall (first_k:Z) (first_c:Z) (t:Z) (l:Z) (n:Z),
  ((0%Z <= l)%Z /\ (l < n)%Z) -> ((0%Z <= first_c)%Z /\ (first_c < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> ((first_c + l)%Z < n)%Z ->
  (0%Z <= first_k)%Z -> ((first_k + l)%Z <= n)%Z ->
  ~ (t <= (first_c + l)%Z)%Z -> ~ (l = 0%Z) ->
  ((cascade_cont_rz_neg first_k first_c t l n) =
   (diag_sequence (cascade_cont_rz_neg first_k first_c t (l - 1%Z)%Z n)
    (crzn_up (first_c + l)%Z t (-(first_k + l)%Z)%Z n n)
    (fun (x:bitvec) =>
     (int_to_ang
      (-(ind_isum
         (fun (k:Z) =>
          ((((getbv x) (first_c + k)%Z) * ((getbv x) t))%Z *
           (power_ 2%Z (n - (k + first_k)%Z)%Z))%Z)
         0%Z l))%Z
      n))
    (fun (x:bitvec) =>
     (int_to_ang
      (((-((getbv x) (first_c + l)%Z))%Z * ((getbv x) t))%Z *
       (power_ 2%Z (n - (l + first_k)%Z)%Z))%Z
      n))
    (fun (x:bitvec) =>
     (int_to_ang
      (-(ind_isum
         (fun (k:Z) =>
          ((((getbv x) (first_c + k)%Z) * ((getbv x) t))%Z *
           (power_ 2%Z (n - (k + first_k)%Z)%Z))%Z)
         0%Z (l + 1%Z)%Z))%Z
      n)))).

Axiom cascade_cont_rz_neg_def2 :
  forall (first_k:Z) (first_c:Z) (t:Z) (l:Z) (n:Z),
  ((0%Z <= l)%Z /\ (l < n)%Z) -> ((0%Z <= first_c)%Z /\ (first_c < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> ((first_c + l)%Z < n)%Z ->
  (0%Z <= first_k)%Z -> ((first_k + l)%Z <= n)%Z -> (t < first_c)%Z ->
  (l = 0%Z) ->
  ((cascade_cont_rz_neg first_k first_c t l n) =
   (crzn_up first_c t (-first_k)%Z n n)).

Axiom cascade_cont_rz_neg_def3 :
  forall (first_k:Z) (first_c:Z) (t:Z) (l:Z) (n:Z),
  ((0%Z <= l)%Z /\ (l < n)%Z) -> ((0%Z <= first_c)%Z /\ (first_c < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> ((first_c + l)%Z < n)%Z ->
  (0%Z <= first_k)%Z -> ((first_k + l)%Z <= n)%Z -> (t < first_c)%Z ->
  ~ (l = 0%Z) ->
  ((cascade_cont_rz_neg first_k first_c t l n) =
   (diag_sequence (cascade_cont_rz_neg first_k first_c t (l - 1%Z)%Z n)
    (crzn_up (first_c + l)%Z t (-(first_k + l)%Z)%Z n n)
    (fun (x:bitvec) =>
     (int_to_ang
      (-(ind_isum
         (fun (k:Z) =>
          ((((getbv x) (first_c + k)%Z) * ((getbv x) t))%Z *
           (power_ 2%Z (n - (k + first_k)%Z)%Z))%Z)
         0%Z l))%Z
      n))
    (fun (x:bitvec) =>
     (int_to_ang
      (((-((getbv x) (first_c + l)%Z))%Z * ((getbv x) t))%Z *
       (power_ 2%Z (n - (l + first_k)%Z)%Z))%Z
      n))
    (fun (x:bitvec) =>
     (int_to_ang
      (-(ind_isum
         (fun (k:Z) =>
          ((((getbv x) (first_c + k)%Z) * ((getbv x) t))%Z *
           (power_ 2%Z (n - (k + first_k)%Z)%Z))%Z)
         0%Z (l + 1%Z)%Z))%Z
      n)))).

Axiom cascade_cont_rz_neg_spec :
  forall (first_k:Z) (first_c:Z) (t:Z) (l:Z) (n:Z),
  ((0%Z <= l)%Z /\ (l < n)%Z) -> ((0%Z <= first_c)%Z /\ (first_c < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> ((first_c + l)%Z < n)%Z ->
  (0%Z <= first_k)%Z -> ((first_k + l)%Z <= n)%Z ->
  ~ (t <= (first_c + l)%Z)%Z ->
  ((width (cascade_cont_rz_neg first_k first_c t l n)) = n).

Axiom cascade_cont_rz_neg_spec1 :
  forall (first_k:Z) (first_c:Z) (t:Z) (l:Z) (n:Z),
  ((0%Z <= l)%Z /\ (l < n)%Z) -> ((0%Z <= first_c)%Z /\ (first_c < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> ((first_c + l)%Z < n)%Z ->
  (0%Z <= first_k)%Z -> ((first_k + l)%Z <= n)%Z ->
  ~ (t <= (first_c + l)%Z)%Z ->
  ((ancillas (cascade_cont_rz_neg first_k first_c t l n)) = 0%Z).

Axiom cascade_cont_rz_neg_spec2 :
  forall (first_k:Z) (first_c:Z) (t:Z) (l:Z) (n:Z),
  ((0%Z <= l)%Z /\ (l < n)%Z) -> ((0%Z <= first_c)%Z /\ (first_c < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> ((first_c + l)%Z < n)%Z ->
  (0%Z <= first_k)%Z -> ((first_k + l)%Z <= n)%Z ->
  ~ (t <= (first_c + l)%Z)%Z ->
  ((size (cascade_cont_rz_neg first_k first_c t l n)) <=
   (cont_size * (l + 1%Z)%Z)%Z)%Z.

Axiom cascade_cont_rz_neg_spec3 :
  forall (first_k:Z) (first_c:Z) (t:Z) (l:Z) (n:Z),
  ((0%Z <= l)%Z /\ (l < n)%Z) -> ((0%Z <= first_c)%Z /\ (first_c < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> ((first_c + l)%Z < n)%Z ->
  (0%Z <= first_k)%Z -> ((first_k + l)%Z <= n)%Z ->
  ~ (t <= (first_c + l)%Z)%Z ->
  diagonal1 (cascade_cont_rz_neg first_k first_c t l n)
  (fun (x:bitvec) =>
   (int_to_ang
    (-(ind_isum
       (fun (k:Z) =>
        ((((getbv x) (first_c + k)%Z) * ((getbv x) t))%Z *
         (power_ 2%Z (n - (k + first_k)%Z)%Z))%Z)
       0%Z (l + 1%Z)%Z))%Z
    n)).

Axiom cascade_cont_rz_neg_spec4 :
  forall (first_k:Z) (first_c:Z) (t:Z) (l:Z) (n:Z),
  ((0%Z <= l)%Z /\ (l < n)%Z) -> ((0%Z <= first_c)%Z /\ (first_c < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> ((first_c + l)%Z < n)%Z ->
  (0%Z <= first_k)%Z -> ((first_k + l)%Z <= n)%Z -> (t < first_c)%Z ->
  ((width (cascade_cont_rz_neg first_k first_c t l n)) = n).

Axiom cascade_cont_rz_neg_spec5 :
  forall (first_k:Z) (first_c:Z) (t:Z) (l:Z) (n:Z),
  ((0%Z <= l)%Z /\ (l < n)%Z) -> ((0%Z <= first_c)%Z /\ (first_c < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> ((first_c + l)%Z < n)%Z ->
  (0%Z <= first_k)%Z -> ((first_k + l)%Z <= n)%Z -> (t < first_c)%Z ->
  ((ancillas (cascade_cont_rz_neg first_k first_c t l n)) = 0%Z).

Axiom cascade_cont_rz_neg_spec6 :
  forall (first_k:Z) (first_c:Z) (t:Z) (l:Z) (n:Z),
  ((0%Z <= l)%Z /\ (l < n)%Z) -> ((0%Z <= first_c)%Z /\ (first_c < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> ((first_c + l)%Z < n)%Z ->
  (0%Z <= first_k)%Z -> ((first_k + l)%Z <= n)%Z -> (t < first_c)%Z ->
  ((size (cascade_cont_rz_neg first_k first_c t l n)) <=
   (cont_size * (l + 1%Z)%Z)%Z)%Z.

Axiom cascade_cont_rz_neg_spec7 :
  forall (first_k:Z) (first_c:Z) (t:Z) (l:Z) (n:Z),
  ((0%Z <= l)%Z /\ (l < n)%Z) -> ((0%Z <= first_c)%Z /\ (first_c < n)%Z) ->
  ((0%Z <= t)%Z /\ (t < n)%Z) -> ((first_c + l)%Z < n)%Z ->
  (0%Z <= first_k)%Z -> ((first_k + l)%Z <= n)%Z -> (t < first_c)%Z ->
  diagonal1 (cascade_cont_rz_neg first_k first_c t l n)
  (fun (x:bitvec) =>
   (int_to_ang
    (-(ind_isum
       (fun (k:Z) =>
        ((((getbv x) (first_c + k)%Z) * ((getbv x) t))%Z *
         (power_ 2%Z (n - (k + first_k)%Z)%Z))%Z)
       0%Z (l + 1%Z)%Z))%Z
    n)).

Parameter cascade_cont_qft: Z -> Z -> circuit.

Axiom cascade_cont_qft_def :
  forall (t:Z) (n:Z), ((0%Z <= t)%Z /\ (t < (n - 1%Z)%Z)%Z) ->
  ((cascade_cont_qft t n) =
   (cascade_cont_rz_neg 2%Z (t + 1%Z)%Z t (n - (t + 2%Z)%Z)%Z n)).

Axiom cascade_cont_qft_spec :
  forall (t:Z) (n:Z), ((0%Z <= t)%Z /\ (t < (n - 1%Z)%Z)%Z) ->
  ((width (cascade_cont_qft t n)) = n).

Axiom cascade_cont_qft_spec1 :
  forall (t:Z) (n:Z), ((0%Z <= t)%Z /\ (t < (n - 1%Z)%Z)%Z) ->
  ((size (cascade_cont_qft t n)) <= (cont_size * ((n - t)%Z - 1%Z)%Z)%Z)%Z.

Axiom cascade_cont_qft_spec2 :
  forall (t:Z) (n:Z), ((0%Z <= t)%Z /\ (t < (n - 1%Z)%Z)%Z) ->
  ((ancillas (cascade_cont_qft t n)) = 0%Z).

Axiom cascade_cont_qft_spec3 :
  forall (t:Z) (n:Z), ((0%Z <= t)%Z /\ (t < (n - 1%Z)%Z)%Z) ->
  diagonal1 (cascade_cont_qft t n)
  (fun (x:bitvec) =>
   (int_to_ang
    (-(ind_isum
       (fun (k:Z) =>
        ((((getbv x) ((t + 1%Z)%Z + k)%Z) * ((getbv x) t))%Z *
         (power_ 2%Z (n - (k + 2%Z)%Z)%Z))%Z)
       0%Z ((n - (t + 2%Z)%Z)%Z + 1%Z)%Z))%Z
    n)).

Axiom cascade_cont_qft_spec4 :
  forall (t:Z) (n:Z), ((0%Z <= t)%Z /\ (t < (n - 1%Z)%Z)%Z) ->
  diagonal1 (cascade_cont_qft t n)
  (fun (x:bitvec) =>
   (int_to_ang
    (-(ind_isum
       (fun (k:Z) =>
        ((((getbv x) t) * ((getbv x) k))%Z *
         (power_ 2%Z (((n - k)%Z - 1%Z)%Z + t)%Z))%Z)
       (t + 1%Z)%Z n))%Z
    n)).

Parameter qft_rev_line: Z -> Z -> circuit.

Axiom qft_rev_line_def :
  forall (t:Z) (n:Z), ((0%Z <= t)%Z /\ (t < n)%Z) -> (t = (n - 1%Z)%Z) ->
  ((qft_rev_line t n) = (place_hadamard_bv t n)).

Parameter result23: Z -> bitvec -> bitvec -> Z -> Z.

Axiom result_def23 :
  forall (t:Z) (x:bitvec) (y:bitvec) (i:Z),
  ((i = t) -> (((result23 t x y) i) = ((getbv y) 0%Z))) /\
  (~ (i = t) -> (((result23 t x y) i) = ((getbv x) i))).

Axiom qft_rev_line_def1 :
  forall (t:Z) (n:Z), ((0%Z <= t)%Z /\ (t < n)%Z) -> ~ (t = (n - 1%Z)%Z) ->
  ((qft_rev_line t n) =
   (sequence_gen_diag (cascade_cont_qft t n) (place_hadamard_bv t n)
    (fun (x:bitvec) =>
     (int_to_ang
      (-(ind_isum
         (fun (k:Z) =>
          ((((getbv x) t) * ((getbv x) k))%Z *
           (power_ 2%Z (((n - k)%Z - 1%Z)%Z + t)%Z))%Z)
         (t + 1%Z)%Z n))%Z
      n))
    (fun (x:bitvec) (y:bitvec) =>
     (int_to_ang
      (-(ind_isum
         (fun (k:Z) =>
          ((((getbv x) k) * ((getbv y) 0%Z))%Z *
           (power_ 2%Z (((n - k)%Z - 1%Z)%Z + t)%Z))%Z)
         t n))%Z
      n))
    (fun (x:bitvec) (y:bitvec) => (make_bv (result23 t x y) n)) 1%Z)).

Axiom qft_rev_line_spec :
  forall (t:Z) (n:Z), ((0%Z <= t)%Z /\ (t < n)%Z) ->
  ((size (qft_rev_line t n)) <= (cont_size * n)%Z)%Z.

Axiom qft_rev_line_spec1 :
  forall (t:Z) (n:Z), ((0%Z <= t)%Z /\ (t < n)%Z) ->
  ((ancillas (qft_rev_line t n)) = 0%Z).

Axiom qft_rev_line_spec2 :
  forall (t:Z) (n:Z), ((0%Z <= t)%Z /\ (t < n)%Z) ->
  ((width (qft_rev_line t n)) = n).

Parameter fc32: Z -> bitvec -> bitvec -> Z -> Z.

Axiom fc_def32 :
  forall (t:Z) (x:bitvec) (y:bitvec) (i:Z),
  ((i = t) -> (((fc32 t x y) i) = ((getbv y) 0%Z))) /\
  (~ (i = t) -> (((fc32 t x y) i) = ((getbv x) i))).

Axiom qft_rev_line_spec3 :
  forall (t:Z) (n:Z), ((0%Z <= t)%Z /\ (t < n)%Z) ->
  correct_path_sum_bv (qft_rev_line t n) 1%Z
  (fun (x:bitvec) (y:bitvec) => (make_bv (fc32 t x y) n))
  (fun (x:bitvec) (y:bitvec) =>
   (int_to_ang
    (-(ind_isum
       (fun (j:Z) =>
        ((((getbv x) j) * ((getbv y) 0%Z))%Z *
         (power_ 2%Z (((n - j)%Z - 1%Z)%Z + t)%Z))%Z)
       t n))%Z
    n)).

Parameter qft_rev: Z -> circuit.

Axiom qft_rev_spec :
  forall (n:Z), (0%Z < n)%Z ->
  ((size (qft_rev n)) <= (polysquare n cont_size 0%Z 0%Z))%Z.

Axiom qft_rev_spec1 :
  forall (n:Z), (0%Z < n)%Z -> ((ancillas (qft_rev n)) = 0%Z).

Axiom qft_rev_spec2 : forall (n:Z), (0%Z < n)%Z -> ((width (qft_rev n)) = n).

Axiom qft_rev_spec3 :
  forall (n:Z), (0%Z < n)%Z ->
  correct_path_sum_bv (qft_rev n) n (fun (us:bitvec) (y:bitvec) => y)
  (fun (x:bitvec) (y:bitvec) =>
   (int_to_ang
    (ind_isum
     (fun (l:Z) =>
      (-(ind_isum
         (fun (k:Z) =>
          ((((getbv x) k) * ((getbv y) l))%Z *
           (power_ 2%Z (((n - k)%Z - 1%Z)%Z + l)%Z))%Z)
         l n))%Z)
     0%Z n)
    n)).

Parameter qft_rev_coeff: bitvec -> bitvec -> Z -> complex.

Axiom qft_rev_coeff_def :
  forall (x:bitvec) (y:bitvec) (n:Z), (0%Z < n)%Z ->
  ((qft_rev_coeff x y n) =
   (ang_exp
    (real_to_ang
     (infix_asdt
      (infix_asdt (i_to_c (-(bv_to_int x))%Z)
       (i_to_c (bv_to_int (bv_inversion y))))
      (pow_inv_2 n))))).

Axiom qft_rev_coeff_spec :
  forall (x:bitvec) (y:bitvec) (n:Z), (0%Z < n)%Z -> ((length x) = n) ->
  ((length y) = n) ->
  ((qft_rev_coeff x y n) =
   (ang_exp
    (int_to_ang
     (ind_isum
      (fun (l:Z) =>
       (-(ind_isum
          (fun (k:Z) =>
           ((((getbv x) k) * ((getbv y) l))%Z *
            (power_ 2%Z (((n - k)%Z - 1%Z)%Z + l)%Z))%Z)
          l n))%Z)
      0%Z n)
     n))).

Axiom path_sem_rev_qft_unit :
  forall (n:Z), (0%Z < n)%Z -> forall (x:matrix complex), (is_a_ket_l x n) ->
  (is_a_ket_basis_elt x) ->
  ((path_sem (qft_rev n) x) =
   (infix_asdtdt (pow_inv_sqrt_2 n)
    (ket_sum_l (n_bvs n)
     (fun (y:bitvec) =>
      (infix_asdtdt (qft_rev_coeff (ket_to_bv x) y n) (bv_to_ket y)))
     n))).

Parameter i: Z.

Parameter j: Z.

Parameter n: Z.

Axiom H : (0%Z < n)%Z.

Axiom H1 : (i < 0%Z)%Z.

Axiom H2 :
  ((-((int.EuclideanDivision.div i (power_ 2%Z n)) + 1%Z)%Z)%Z =
   (int.EuclideanDivision.div (-i)%Z (power_ 2%Z n))).

Axiom H3 :
  (((power_ 2%Z n) - (int.EuclideanDivision.mod1 i (power_ 2%Z n)))%Z =
   (int.EuclideanDivision.mod1 (-i)%Z (power_ 2%Z n))).

Axiom H4 : real_ (pow_inv_2 n).

Axiom H5 : infix_gtdt (pow_inv_2 n) c_zero.

Axiom H6 : ((pow_inv_2 n) = (pow_inv_sqrt_2 (2%Z * n)%Z)).

Axiom H7 :
  ((pow_inv_2 n) = (infix_asdt (pow_inv_sqrt_2 n) (pow_inv_sqrt_2 n))).

Axiom H8 :
  (0%Z <=
   (int_bit_inversion (int.EuclideanDivision.mod1 j (power_ 2%Z n)) n))%Z.

Axiom H9 :
  ((int_bit_inversion (int.EuclideanDivision.mod1 j (power_ 2%Z n)) n) <
   (power 2%Z n))%Z.

Axiom H10 :
  real_
  (i_to_c
   (int_bit_inversion (int.EuclideanDivision.mod1 j (power_ 2%Z n)) n)).

Axiom H11 :
  real_ (i_to_c (int.EuclideanDivision.mod1 (-i)%Z (power_ 2%Z n))).

Axiom H12 :
  ((real_to_ang
    (infix_asdt
     (infix_asdt (i_to_c (int.EuclideanDivision.mod1 (-i)%Z (power_ 2%Z n)))
      (i_to_c
       (int_bit_inversion (int.EuclideanDivision.mod1 j (power_ 2%Z n)) n)))
     (pow_inv_2 n)))
   =
   (real_to_ang
    (infix_pldt
     (i_to_c ((-(int.EuclideanDivision.div i (power_ 2%Z n)))%Z + 1%Z)%Z)
     (infix_asdt
      (infix_asdt (i_to_c (int.EuclideanDivision.mod1 (-i)%Z (power_ 2%Z n)))
       (i_to_c
        (int_bit_inversion (int.EuclideanDivision.mod1 j (power_ 2%Z n)) n)))
      (pow_inv_2 n))))).

Axiom H13 : real_ (pow_inv_2 n).

Axiom H14 : infix_gtdt (pow_inv_2 n) c_zero.

Axiom H15 : ((pow_inv_2 n) = (pow_inv_sqrt_2 (2%Z * n)%Z)).

Axiom H16 :
  ((pow_inv_2 n) = (infix_asdt (pow_inv_sqrt_2 n) (pow_inv_sqrt_2 n))).

Axiom H17 :
  (0%Z <=
   (int_bit_inversion (int.EuclideanDivision.mod1 j (power_ 2%Z n)) n))%Z.

Axiom H18 :
  ((int_bit_inversion (int.EuclideanDivision.mod1 j (power_ 2%Z n)) n) <
   (power 2%Z n))%Z.

Axiom H19 :
  real_
  (i_to_c
   (int_bit_inversion (int.EuclideanDivision.mod1 j (power_ 2%Z n)) n)).

Axiom H20 :
  real_ (i_to_c (int.EuclideanDivision.mod1 (-i)%Z (power_ 2%Z n))).

Parameter result24: complex.

Axiom result_def24 :
  (result24 =
   (ang_exp
    (real_to_ang
     (infix_asdt
      (infix_asdt (i_to_c (int.EuclideanDivision.mod1 (-i)%Z (power_ 2%Z n)))
       (i_to_c
        (int_bit_inversion (int.EuclideanDivision.mod1 j (power_ 2%Z n)) n)))
      (pow_inv_2 n))))).

Axiom H21 : ~ (result24 = c_zero).

(* Why3 goal *)
Theorem VC_int_qft_rev_coeff :
  ((ang_exp
    (real_to_ang
     (infix_pldt
      (i_to_c ((-(int.EuclideanDivision.div i (power_ 2%Z n)))%Z + 1%Z)%Z)
      (infix_asdt
       (infix_asdt
        (i_to_c (int.EuclideanDivision.mod1 (-i)%Z (power_ 2%Z n)))
        (i_to_c
         (int_bit_inversion (int.EuclideanDivision.mod1 j (power_ 2%Z n)) n)))
       (pow_inv_2 n)))))
   =
   (ang_exp
    (real_to_ang
     (infix_asdt
      (infix_asdt (i_to_c (-(int.EuclideanDivision.mod1 i (power_ 2%Z n)))%Z)
       (i_to_c
        (int_bit_inversion (int.EuclideanDivision.mod1 j (power_ 2%Z n)) n)))
      (pow_inv_2 n))))).
Proof.

Qed.